diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index a38564b..7e7b18e 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,38 +1,38 @@ lockVersion: 2.0.0 id: b46c9081-6a59-4f57-9207-8f7715e429dc management: - docChecksum: 3a4e84c87697babb874d300af039b238 + docChecksum: 70840c3e3c2cf1f66112a42a549e0e6a docVersion: 3.0.16 - speakeasyVersion: 1.700.2 - generationVersion: 2.801.2 - releaseVersion: 0.0.9-beta - configChecksum: f0d1585bb5d1c103c9d0b239e03b5d9a + speakeasyVersion: 1.725.0 + generationVersion: 2.836.5 + releaseVersion: 0.0.9-beta.1 + configChecksum: 19d7e651a32f32ab3a97c202bea0fc69 repoURL: https://github.com/authlete/authlete-typescript-sdk.git installationURL: https://github.com/authlete/authlete-typescript-sdk published: true persistentEdits: - generation_id: 28c15ed4-bb04-4f92-8dc6-32e680002cc0 - pristine_commit_hash: 7ac0a92902a3d4041c72c3c324c9ad937e19071a - pristine_tree_hash: a0a9309bf5e184d01ab3944fdf634c3be6bed5a6 + generation_id: d2bb6f76-0915-450e-929b-3d95c2b73e8d + pristine_commit_hash: be37add1d6be6b6f1ce8c578acd9bc2fc221b655 + pristine_tree_hash: 13de0b451a6fc28996e4e49c14ddda0cac22fe22 features: typescript: additionalDependencies: 0.1.0 additionalProperties: 0.1.3 - core: 3.26.23 + core: 3.26.31 defaultEnabledRetries: 0.1.0 devContainers: 2.90.1 enumUnions: 0.1.0 envVarSecurityUsage: 0.1.2 - globalSecurity: 2.82.14 + globalSecurity: 2.82.15 globalSecurityCallbacks: 0.1.0 globalSecurityFlattening: 0.1.0 globalServerURLs: 2.83.0 groups: 2.81.3 inputOutputModels: 2.82.1 methodArguments: 0.1.2 - nameOverrides: 2.81.2 + nameOverrides: 2.81.4 nullables: 0.1.1 - responseFormat: 0.2.3 + responseFormat: 0.3.0 retries: 2.83.0 sdkHooks: 0.4.0 trackedFiles: @@ -606,8 +606,8 @@ trackedFiles: pristine_git_object: 6df1e75642a819d8d12bbc66a3839dc16e81256e docs/models/operations/authtokencreateapirequest.md: id: 4446cbd17e55 - last_write_checksum: sha1:d3e62684cd569c4f25a0022530b586f47be394df - pristine_git_object: c40c3d286d67335a962d4763f99a166faff08e1c + last_write_checksum: sha1:ea5056cf347d99a413d2c96e06517f9747590c22 + pristine_git_object: 24fbfb55b69cbd0687cbb9d351ae1fc2712347b9 docs/models/operations/authtokencreatebatchapirequest.md: id: 5180b45fd6ca last_write_checksum: sha1:d2db1d1581ed963e8fb302615764801dd23e04ec @@ -638,8 +638,8 @@ trackedFiles: pristine_git_object: 0e9ef899f69eaf522a03f45c9ccef2e0681be686 docs/models/operations/authtokenupdateapirequest.md: id: 070ace636b85 - last_write_checksum: sha1:245997568056fcfa3e3af382f52bc7453b9fe982 - pristine_git_object: c075a191b85cd27be271641981967454e5282d79 + last_write_checksum: sha1:889cde86e7bd42d68da16ae1210085b5b3272551 + pristine_git_object: db2377bd71836114fe2ff0044c1c4fb06343e621 docs/models/operations/authuserinfoapirequest.md: id: 0f7939a4d6da last_write_checksum: sha1:fd84c1c0ba0053ae94b668ca8d1cbe16b889af75 @@ -1066,8 +1066,8 @@ trackedFiles: pristine_git_object: 0687e8b8a0b23a255df39db975a4076ed0355c35 docs/models/tokencreaterequest.md: id: 59329108a4e0 - last_write_checksum: sha1:dc5554d61bbc6a356dc93bdc28f8a778d788ebbd - pristine_git_object: 82d1cf35ce6297c6e4cccd10376a7f7551a71b3d + last_write_checksum: sha1:f31aded0e1f87b36945b7894faadff1c0af5e4aa + pristine_git_object: 71cf947b3a364bd28545a9e10d1e7c96c475ec7d docs/models/tokencreateresponse.md: id: f5acfe275f61 last_write_checksum: sha1:051eb48250851043d576160ff82b0fee83f00e41 @@ -1138,8 +1138,8 @@ trackedFiles: pristine_git_object: 116bf523e8c821bf2689ab1c6b5552b6b242f98b docs/models/tokenupdaterequest.md: id: 6b8192230856 - last_write_checksum: sha1:9affed7f206f3bdab04c38b70b95773f8fc871dd - pristine_git_object: 45e927f46de738cc8504879a45d5e4d4823aa70b + last_write_checksum: sha1:3a8821622de5cd35e3cd9dd7f4b9f1e4b83e981d + pristine_git_object: 32aedf58d013c675ce519bb8784cd9d5c8776118 docs/models/tokenupdateresponse.md: id: 4bf96a3516db last_write_checksum: sha1:f020fa09068445b813ce3c6c89970dd6f9b27061 @@ -1330,8 +1330,8 @@ trackedFiles: pristine_git_object: 683d1cf54a57a76d2de77ae04de872c8ce693d13 docs/sdks/client/README.md: id: 6fb5a6948c65 - last_write_checksum: sha1:bd86efc0cc88501efcbc269068459962e5ec2d3d - pristine_git_object: 7c4cf9c0ed37c1ed2d2c55eea1ecd5b0400f5eb7 + last_write_checksum: sha1:6a5ede5c72a0e7bb670c3e237c92008836bcced8 + pristine_git_object: d35d4e9f6ced63712bd4a182e2191ece451f389c docs/sdks/clientmanagement1/README.md: id: c1d012f912af last_write_checksum: sha1:1663e8b148d08216cd5b25e5536ed0ddda24fc77 @@ -1390,8 +1390,8 @@ trackedFiles: pristine_git_object: d2b7a6a86f796d28957517dac7f495521effe05b docs/sdks/service/README.md: id: d161cb00129d - last_write_checksum: sha1:1761be846f2253d123761f282440c8e5dca4cd1a - pristine_git_object: 1dd2d69bafde940dcf023ef9c8d28e8f2b4a2d6c + last_write_checksum: sha1:fa3f157ef955311dcbaa7208c36029fe782c6108 + pristine_git_object: 8b40d755c4c7a91b3362e793c5c72d633e18e61d docs/sdks/token/README.md: id: 627ae416a06f last_write_checksum: sha1:d019bb662395eb50ce647f878684bda1f3320b59 @@ -1434,12 +1434,12 @@ trackedFiles: pristine_git_object: 2f7b714bbe12442f6ed257ace618d48767cf552c jsr.json: id: 7f6ab7767282 - last_write_checksum: sha1:be4124215d1d3420812d36f23b75980be10de971 - pristine_git_object: e0b616ad77bce08796e1a56f113834530394dd21 + last_write_checksum: sha1:d6c7ef6ecb56bc645e85e1562505fa6708f05926 + pristine_git_object: 4b18807fd371921aa35769cdfd01ad2f2c50473f package.json: id: 7030d0b2f71b - last_write_checksum: sha1:b7be8ff344cf6ea51f19daeffa536e7549a4cfc8 - pristine_git_object: 6b34151b2354a612d9d57e8f1064d35d132d4541 + last_write_checksum: sha1:27d0ddc2effa85c9a6f182b2cfde980f023c3da7 + pristine_git_object: c4cd2ee5f2cc2b2292dff0aa888d142afb81ed03 src/core.ts: id: f431fdbcd144 last_write_checksum: sha1:d2e0ad6b984b5be0cd66f84e06b451806539d6d0 @@ -1814,8 +1814,8 @@ trackedFiles: pristine_git_object: 0aebd8b0a4867e35cb3348fc52921c3c0b4725b7 src/lib/config.ts: id: 320761608fb3 - last_write_checksum: sha1:4aae8765b587714f69c133dc3f3975b6bf403b8b - pristine_git_object: e44c772469a1daef4a8887265af091cb35af4b2e + last_write_checksum: sha1:9f5a4129c8bbd38f688e478e63559c06a6b22906 + pristine_git_object: 63180352fa56399ddd0e03ec64b3dee17884a6ca src/lib/dlv.ts: id: b1988214835a last_write_checksum: sha1:1dd3e3fbb4550c4bf31f5ef997faff355d6f3250 @@ -2710,8 +2710,8 @@ trackedFiles: pristine_git_object: 5803326002b826e48959ef1120396b444b87d2d3 src/models/tokencreaterequest.ts: id: ac5d635835a2 - last_write_checksum: sha1:3cafbabf0cab99b02f3e2c52536b74730f3f83c2 - pristine_git_object: 8509cd9524b0acf2c6b03bb247c42e8fb4071c15 + last_write_checksum: sha1:cbc9e9390fe66e9bbf158641e4c15bbcc6b6330d + pristine_git_object: 7e0e74b41e73aeba8636d2320684765d8791f9b6 src/models/tokencreateresponse.ts: id: a4a78de5d809 last_write_checksum: sha1:082523208138e4e793fce4959eac027019c65f9c @@ -2762,8 +2762,8 @@ trackedFiles: pristine_git_object: a004bfe68fe7ecb625eafa45491e7fc014dbb4ac src/models/tokenupdaterequest.ts: id: 1c72f5c6be32 - last_write_checksum: sha1:c7b472bacc4d662c959dbc408cb27b4f519ef458 - pristine_git_object: a9dd358f816870fcb910164db07d08195f76a532 + last_write_checksum: sha1:12c89b3e1a131461ad83b39ffc6964fdc030f9f9 + pristine_git_object: a595185c823fe7c8826620e6ca43112c2f6120ea src/models/tokenupdateresponse.ts: id: dd0c374cd172 last_write_checksum: sha1:c2f91740b210c18c743eedae8e5019ab55974346 @@ -3803,8 +3803,8 @@ examples: path: serviceId: "" requestBody: - application/json: {"grantType": "REFRESH_TOKEN", "clientId": 987169} - application/x-www-form-urlencoded: {"grantType": "REFRESH_TOKEN", "clientId": 987169} + application/json: {"grantType": "REFRESH_TOKEN"} + application/x-www-form-urlencoded: {"grantType": "REFRESH_TOKEN"} responses: "200": application/json: {} @@ -3818,8 +3818,8 @@ examples: path: serviceId: "" requestBody: - application/json: {"accessToken": ""} - application/x-www-form-urlencoded: {"accessToken": ""} + application/json: {} + application/x-www-form-urlencoded: {} responses: "200": application/json: {} @@ -4302,9 +4302,7 @@ examples: "200": text/plain: "" examplesVersion: 1.0.2 -releaseNotes: | - ## Typescript SDK Changes: - * `authlete.authorization.processRequest()`: `response` **Changed** **Breaking** ⚠️ +releaseNotes: "## Typescript SDK Changes:\n* `authlete.token.management.create()`: \n * `request.tokenCreateRequest.clientId` **Changed**\n* `authlete.token.management.update()`: \n * `request.tokenUpdateRequest.accessToken` **Changed**\n* `authlete.tokenOperations.authTokenCreateBatchApi()`: \n * `request.requestBody[].clientId` **Changed**\n" generatedFiles: - .devcontainer/README.md - .devcontainer/devcontainer.json diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 9effea0..efaf8cc 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -17,6 +17,7 @@ generation: securityFeb2025: true sharedErrorComponentsApr2025: true sharedNestedComponentsJan2026: false + nameOverrideFeb2026: false auth: oAuth2ClientCredentialsEnabled: false oAuth2PasswordEnabled: false @@ -25,13 +26,14 @@ generation: schemas: allOfMergeStrategy: shallowMerge requestBodyFieldName: "" + versioningStrategy: automatic persistentEdits: {} tests: generateTests: false generateNewTests: true skipResponseBodyAssertions: false typescript: - version: 0.0.9-beta + version: 0.0.9-beta.1 acceptHeaderEnum: true additionalDependencies: dependencies: {} diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 4f408fc..ee0cd00 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -17046,7 +17046,6 @@ components: type: object required: - grantType - - clientId properties: grantType: $ref: '#/components/schemas/grant_type' @@ -17372,8 +17371,6 @@ components: $ref: '#/components/schemas/token_batch_status' token_update_request: type: object - required: - - accessToken properties: accessToken: type: string diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 1a2a097..602ff13 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,21 +1,21 @@ -speakeasyVersion: 1.700.2 +speakeasyVersion: 1.725.0 sources: Authlete API Explorer: sourceNamespace: authlete-api-explorer - sourceRevisionDigest: sha256:ea3aaa8f932c51803f472f3799b310657fc5721aa0ab657e2cc06a13f70f9482 - sourceBlobDigest: sha256:57e95030ce7d309271c12a96f663b45af25747a37226f2d60f011d14e7b96999 + sourceRevisionDigest: sha256:11b1d75e5d0cb9c492177775fddc5b23918bb40732030ac1ac40d9303a9e2215 + sourceBlobDigest: sha256:bb0bf855f55fb974f73a1e98853156d3b3d40ea0fd41a7b12721ac289aea8de2 tags: - latest - - speakeasy-sdk-regen-1769130004 + - speakeasy-sdk-regen-1771290756 - 3.0.16 targets: authlete: source: Authlete API Explorer sourceNamespace: authlete-api-explorer - sourceRevisionDigest: sha256:ea3aaa8f932c51803f472f3799b310657fc5721aa0ab657e2cc06a13f70f9482 - sourceBlobDigest: sha256:57e95030ce7d309271c12a96f663b45af25747a37226f2d60f011d14e7b96999 + sourceRevisionDigest: sha256:11b1d75e5d0cb9c492177775fddc5b23918bb40732030ac1ac40d9303a9e2215 + sourceBlobDigest: sha256:bb0bf855f55fb974f73a1e98853156d3b3d40ea0fd41a7b12721ac289aea8de2 codeSamplesNamespace: authlete-api-explorer-typescript-code-samples - codeSamplesRevisionDigest: sha256:8e1ff7338b980a953bd6c49596fada0353c4e6d05f45f6925de1759d931355f3 + codeSamplesRevisionDigest: sha256:1b732b4b1023f11d781ea4fef33b0d4840ba1518e0037fdc6c4a40dfb7248549 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 879390d..1400da0 100644 --- a/README.md +++ b/README.md @@ -737,19 +737,23 @@ The `HTTPClient` constructor takes an optional `fetcher` argument that can be used to integrate a third-party HTTP client or when writing tests to mock out the HTTP client and feed in fixtures. -The following example shows how to use the `"beforeRequest"` hook to to add a -custom header and a timeout to requests and how to use the `"requestError"` hook -to log errors: +The following example shows how to: +- route requests through a proxy server using [undici](https://www.npmjs.com/package/undici)'s ProxyAgent +- use the `"beforeRequest"` hook to add a custom header and a timeout to requests +- use the `"requestError"` hook to log errors ```typescript import { Authlete } from "@authlete/typescript-sdk"; +import { ProxyAgent } from "undici"; import { HTTPClient } from "@authlete/typescript-sdk/lib/http"; +const dispatcher = new ProxyAgent("http://proxy.example.com:8080"); + const httpClient = new HTTPClient({ - // fetcher takes a function that has the same signature as native `fetch`. - fetcher: (request) => { - return fetch(request); - } + // 'fetcher' takes a function that has the same signature as native 'fetch'. + fetcher: (input, init) => + // 'dispatcher' is specific to undici and not part of the standard Fetch API. + fetch(input, { ...init, dispatcher } as RequestInit), }); httpClient.addHook("beforeRequest", (request) => { diff --git a/RELEASES.md b/RELEASES.md index 43c6424..85c6bfe 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -246,4 +246,14 @@ Based on: ### Generated - [typescript v0.0.9-beta] . ### Releases -- [NPM v0.0.9-beta] https://www.npmjs.com/package/@authlete/typescript-sdk/v/0.0.9-beta - . \ No newline at end of file +- [NPM v0.0.9-beta] https://www.npmjs.com/package/@authlete/typescript-sdk/v/0.0.9-beta - . + +## 2026-02-24 01:10:09 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.725.0 (2.836.5) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v0.0.9-beta.1] . +### Releases +- [NPM v0.0.9-beta.1] https://www.npmjs.com/package/@authlete/typescript-sdk/v/0.0.9-beta.1 - . \ No newline at end of file diff --git a/docs/models/operations/authtokencreateapirequest.md b/docs/models/operations/authtokencreateapirequest.md index c40c3d2..24fbfb5 100644 --- a/docs/models/operations/authtokencreateapirequest.md +++ b/docs/models/operations/authtokencreateapirequest.md @@ -9,7 +9,6 @@ let value: AuthTokenCreateApiRequest = { serviceId: "", tokenCreateRequest: { grantType: "DEVICE_CODE", - clientId: 622368, }, }; ``` diff --git a/docs/models/operations/authtokenupdateapirequest.md b/docs/models/operations/authtokenupdateapirequest.md index c075a19..db2377b 100644 --- a/docs/models/operations/authtokenupdateapirequest.md +++ b/docs/models/operations/authtokenupdateapirequest.md @@ -7,9 +7,7 @@ import { AuthTokenUpdateApiRequest } from "@authlete/typescript-sdk/models/opera let value: AuthTokenUpdateApiRequest = { serviceId: "", - tokenUpdateRequest: { - accessToken: "", - }, + tokenUpdateRequest: {}, }; ``` diff --git a/docs/models/tokencreaterequest.md b/docs/models/tokencreaterequest.md index 82d1cf3..71cf947 100644 --- a/docs/models/tokencreaterequest.md +++ b/docs/models/tokencreaterequest.md @@ -7,7 +7,6 @@ import { TokenCreateRequest } from "@authlete/typescript-sdk/models"; let value: TokenCreateRequest = { grantType: "REFRESH_TOKEN", - clientId: 549697, }; ``` @@ -16,7 +15,7 @@ let value: TokenCreateRequest = { | Field | Type | Required | Description | | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `grantType` | [models.GrantType](../models/granttype.md) | :heavy_check_mark: | The grant type of the access token when the access token was created.
| -| `clientId` | *number* | :heavy_check_mark: | The ID of the client application which will be associated with a newly created access token.
| +| `clientId` | *number* | :heavy_minus_sign: | The ID of the client application which will be associated with a newly created access token.
| | `subject` | *string* | :heavy_minus_sign: | The subject (= unique identifier) of the user who will be associated with a newly created access
token. This parameter is required unless the grant type is `CLIENT_CREDENTIALS`. The value must
consist of only ASCII characters and its length must not exceed 100.
| | `scopes` | *string*[] | :heavy_minus_sign: | The scopes which will be associated with a newly created access token. Scopes that are not supported
by the service cannot be specified and requesting them will cause an error.
| | `accessTokenDuration` | *number* | :heavy_minus_sign: | The duration of a newly created access token in seconds. If the value is 0, the duration is determined
according to the settings of the service.
| diff --git a/docs/models/tokenupdaterequest.md b/docs/models/tokenupdaterequest.md index 45e927f..32aedf5 100644 --- a/docs/models/tokenupdaterequest.md +++ b/docs/models/tokenupdaterequest.md @@ -5,16 +5,14 @@ ```typescript import { TokenUpdateRequest } from "@authlete/typescript-sdk/models"; -let value: TokenUpdateRequest = { - accessToken: "", -}; +let value: TokenUpdateRequest = {}; ``` ## Fields | Field | Type | Required | Description | | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `accessToken` | *string* | :heavy_check_mark: | An access token.
| +| `accessToken` | *string* | :heavy_minus_sign: | An access token.
| | `accessTokenExpiresAt` | *number* | :heavy_minus_sign: | A new date at which the access token will expire in milliseconds since the Unix epoch (1970-01-01).
If the `accessTokenExpiresAt` request parameter is not included in a request or its value is 0
(or negative), the expiration date of the access token is not changed.
| | `scopes` | *string*[] | :heavy_minus_sign: | A new set of scopes assigned to the access token. Scopes that are not supported by the service
and those that the client application associated with the access token is not allowed to request
are ignored on the server side. If the `scopes` request parameter is not included in a request or
its value is `null`, the scopes of the access token are not changed. Note that `properties` parameter
is accepted only when `Content-Type` of the request is `application/json`, so don't use `application/x-www-form-urlencoded`
if you want to specify `properties`.
| | `properties` | [models.Property](../models/property.md)[] | :heavy_minus_sign: | A new set of properties assigned to the access token. If the `properties` request parameter is
not included in a request or its value is null, the properties of the access token are not changed.
| diff --git a/docs/sdks/client/README.md b/docs/sdks/client/README.md index 7c4cf9c..d35d4e9 100644 --- a/docs/sdks/client/README.md +++ b/docs/sdks/client/README.md @@ -99,9 +99,58 @@ service are returned. - ViewClient: [] -### Example Usage +### Example Usage: full + + +```typescript +import { Authlete } from "@authlete/typescript-sdk"; + +const authlete = new Authlete({ + bearer: process.env["AUTHLETE_BEARER"] ?? "", +}); + +async function run() { + const result = await authlete.client.list({ + serviceId: "", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AuthleteCore } from "@authlete/typescript-sdk/core.js"; +import { clientList } from "@authlete/typescript-sdk/funcs/clientList.js"; + +// Use `AuthleteCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const authlete = new AuthleteCore({ + bearer: process.env["AUTHLETE_BEARER"] ?? "", +}); + +async function run() { + const res = await clientList(authlete, { + serviceId: "", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("clientList failed:", res.error); + } +} + +run(); +``` +### Example Usage: limited - + ```typescript import { Authlete } from "@authlete/typescript-sdk"; diff --git a/docs/sdks/service/README.md b/docs/sdks/service/README.md index 1dd2d69..8b40d75 100644 --- a/docs/sdks/service/README.md +++ b/docs/sdks/service/README.md @@ -19,9 +19,58 @@ If the access token can only view or modify clients underneath this service, but have access to view this service directly, a limited view of the service will be returned. -### Example Usage +### Example Usage: full + + +```typescript +import { Authlete } from "@authlete/typescript-sdk"; + +const authlete = new Authlete({ + bearer: process.env["AUTHLETE_BEARER"] ?? "", +}); + +async function run() { + const result = await authlete.service.get({ + serviceId: "", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AuthleteCore } from "@authlete/typescript-sdk/core.js"; +import { serviceGet } from "@authlete/typescript-sdk/funcs/serviceGet.js"; + +// Use `AuthleteCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const authlete = new AuthleteCore({ + bearer: process.env["AUTHLETE_BEARER"] ?? "", +}); + +async function run() { + const res = await serviceGet(authlete, { + serviceId: "", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("serviceGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: limited - + ```typescript import { Authlete } from "@authlete/typescript-sdk"; @@ -102,9 +151,54 @@ If the access token is an administrative token, this returns a list of all servi Otherwise, all services that the access token can view, even in a limited fashion, are returned. -### Example Usage +### Example Usage: full + + +```typescript +import { Authlete } from "@authlete/typescript-sdk"; + +const authlete = new Authlete({ + bearer: process.env["AUTHLETE_BEARER"] ?? "", +}); + +async function run() { + const result = await authlete.service.list(); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { AuthleteCore } from "@authlete/typescript-sdk/core.js"; +import { serviceList } from "@authlete/typescript-sdk/funcs/serviceList.js"; + +// Use `AuthleteCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const authlete = new AuthleteCore({ + bearer: process.env["AUTHLETE_BEARER"] ?? "", +}); + +async function run() { + const res = await serviceList(authlete); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("serviceList failed:", res.error); + } +} + +run(); +``` +### Example Usage: limited - + ```typescript import { Authlete } from "@authlete/typescript-sdk"; diff --git a/examples/package-lock.json b/examples/package-lock.json index b2a51b5..5295985 100644 --- a/examples/package-lock.json +++ b/examples/package-lock.json @@ -18,13 +18,13 @@ }, "..": { "name": "@authlete/typescript-sdk", - "version": "0.0.9-beta", + "version": "0.0.9-beta.1", "dependencies": { "zod": "^3.25.0 || ^4.0.0" }, "devDependencies": { - "@eslint/js": "^9.19.0", - "eslint": "^9.19.0", + "@eslint/js": "^9.26.0", + "eslint": "^9.26.0", "globals": "^15.14.0", "tshy": "^2.0.0", "typescript": "~5.8.3", diff --git a/jsr.json b/jsr.json index e0b616a..4b18807 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@authlete/typescript-sdk", - "version": "0.0.9-beta", + "version": "0.0.9-beta.1", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index 4886104..b27ed88 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,18 +1,18 @@ { "name": "@authlete/typescript-sdk", - "version": "0.0.9-beta", + "version": "0.0.9-beta.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@authlete/typescript-sdk", - "version": "0.0.9-beta", + "version": "0.0.9-beta.1", "dependencies": { "zod": "^3.25.0 || ^4.0.0" }, "devDependencies": { - "@eslint/js": "^9.19.0", - "eslint": "^9.19.0", + "@eslint/js": "^9.26.0", + "eslint": "^9.26.0", "globals": "^15.14.0", "tshy": "^2.0.0", "typescript": "~5.8.3", diff --git a/package.json b/package.json index 6b34151..c4cd2ee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@authlete/typescript-sdk", - "version": "0.0.9-beta", + "version": "0.0.9-beta.1", "author": "Speakeasy", "publishConfig": { "access": "public", @@ -34,8 +34,8 @@ }, "peerDependencies": {}, "devDependencies": { - "@eslint/js": "^9.19.0", - "eslint": "^9.19.0", + "@eslint/js": "^9.26.0", + "eslint": "^9.26.0", "globals": "^15.14.0", "tshy": "^2.0.0", "typescript": "~5.8.3", diff --git a/src/lib/config.ts b/src/lib/config.ts index e44c772..6318035 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -73,8 +73,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "3.0.16", - sdkVersion: "0.0.9-beta", - genVersion: "2.801.2", + sdkVersion: "0.0.9-beta.1", + genVersion: "2.836.5", userAgent: - "speakeasy-sdk/typescript 0.0.9-beta 2.801.2 3.0.16 @authlete/typescript-sdk", + "speakeasy-sdk/typescript 0.0.9-beta.1 2.836.5 3.0.16 @authlete/typescript-sdk", } as const; diff --git a/src/models/tokencreaterequest.ts b/src/models/tokencreaterequest.ts index 8509cd9..7e0e74b 100644 --- a/src/models/tokencreaterequest.ts +++ b/src/models/tokencreaterequest.ts @@ -27,7 +27,7 @@ export type TokenCreateRequest = { * * @remarks */ - clientId: number; + clientId?: number | undefined; /** * The subject (= unique identifier) of the user who will be associated with a newly created access * @@ -221,7 +221,7 @@ export type TokenCreateRequest = { /** @internal */ export type TokenCreateRequest$Outbound = { grantType: string; - clientId: number; + clientId?: number | undefined; subject?: string | undefined; scopes?: Array | undefined; accessTokenDuration?: number | undefined; @@ -252,7 +252,7 @@ export const TokenCreateRequest$outboundSchema: z.ZodType< TokenCreateRequest > = z.object({ grantType: GrantType$outboundSchema, - clientId: z.number().int(), + clientId: z.number().int().optional(), subject: z.string().optional(), scopes: z.array(z.string()).optional(), accessTokenDuration: z.number().int().optional(), diff --git a/src/models/tokenupdaterequest.ts b/src/models/tokenupdaterequest.ts index a9dd358..a595185 100644 --- a/src/models/tokenupdaterequest.ts +++ b/src/models/tokenupdaterequest.ts @@ -20,7 +20,7 @@ export type TokenUpdateRequest = { * * @remarks */ - accessToken: string; + accessToken?: string | undefined; /** * A new date at which the access token will expire in milliseconds since the Unix epoch (1970-01-01). * @@ -138,7 +138,7 @@ export type TokenUpdateRequest = { /** @internal */ export type TokenUpdateRequest$Outbound = { - accessToken: string; + accessToken?: string | undefined; accessTokenExpiresAt?: number | undefined; scopes?: Array | undefined; properties?: Array | undefined; @@ -161,7 +161,7 @@ export const TokenUpdateRequest$outboundSchema: z.ZodType< z.ZodTypeDef, TokenUpdateRequest > = z.object({ - accessToken: z.string(), + accessToken: z.string().optional(), accessTokenExpiresAt: z.number().int().optional(), scopes: z.array(z.string()).optional(), properties: z.array(Property$outboundSchema).optional(),