diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 2288d70..c9793b7 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,8 +1,8 @@ -speakeasyVersion: 1.385.0 +speakeasyVersion: 1.390.7 sources: source1: sourceNamespace: source-1 - sourceRevisionDigest: sha256:e761d4d8bcbd96d1a2c95ea3f51818e677158d95a4ce349a44675c8391a6cda3 + sourceRevisionDigest: sha256:9943a302176af064bd0009e0b85ed4e33c4e3213a3463ae58344f39e987d7c2a sourceBlobDigest: sha256:7c35756702030633a8d2ebb1d378d34f883126319b06edcd798ac7bb2fddb189 tags: - latest @@ -11,7 +11,7 @@ targets: accounting: source: source1 sourceNamespace: source-1 - sourceRevisionDigest: sha256:e761d4d8bcbd96d1a2c95ea3f51818e677158d95a4ce349a44675c8391a6cda3 + sourceRevisionDigest: sha256:9943a302176af064bd0009e0b85ed4e33c4e3213a3463ae58344f39e987d7c2a sourceBlobDigest: sha256:7c35756702030633a8d2ebb1d378d34f883126319b06edcd798ac7bb2fddb189 outLocation: ./accounting finance: diff --git a/accounting/.speakeasy/gen.lock b/accounting/.speakeasy/gen.lock index f816e0f..50d46fe 100755 --- a/accounting/.speakeasy/gen.lock +++ b/accounting/.speakeasy/gen.lock @@ -3,10 +3,10 @@ id: de44aa14-d51e-4f37-b22e-356d78ca0ebc management: docChecksum: 1bdb7a6f8bf3995d4b40475228403253 docVersion: 1.0.0 - speakeasyVersion: 1.385.0 - generationVersion: 2.407.2 - releaseVersion: 0.2.2 - configChecksum: 300a1be6e0b5be0de3dd36b89d94298f + speakeasyVersion: 1.390.7 + generationVersion: 2.409.8 + releaseVersion: 0.3.0 + configChecksum: 879dd3c1988cd08535a555f32ec5f653 repoURL: https://github.com/ryan-timothy-albert/sample-ts-monorepo.git repoSubDirectory: accounting installationURL: https://gitpkg.now.sh/ryan-timothy-albert/sample-ts-monorepo/accounting @@ -14,7 +14,7 @@ management: features: typescript: additionalDependencies: 0.1.0 - core: 3.14.2 + core: 3.16.1 defaultEnabledRetries: 0.1.0 envVarSecurityUsage: 0.1.1 globalSecurityCallbacks: 0.1.0 @@ -40,6 +40,7 @@ generatedFiles: - src/lib/config.ts - src/lib/dlv.ts - src/lib/encodings.ts + - src/lib/files.ts - src/lib/http.ts - src/lib/is-plain-object.ts - src/lib/logger.ts @@ -61,6 +62,7 @@ generatedFiles: - src/types/index.ts - src/types/operations.ts - src/types/rfcdate.ts + - src/types/streams.ts - tsconfig.json - src/models/operations/listpets.ts - src/models/operations/showpetbyid.ts diff --git a/accounting/.speakeasy/gen.yaml b/accounting/.speakeasy/gen.yaml index a768cae..e1bf610 100644 --- a/accounting/.speakeasy/gen.yaml +++ b/accounting/.speakeasy/gen.yaml @@ -12,11 +12,14 @@ generation: auth: oAuth2ClientCredentialsEnabled: true typescript: - version: 0.2.2 + version: 0.3.0 additionalDependencies: dependencies: {} devDependencies: {} peerDependencies: {} + additionalPackageJSON: + license: UNLICENSED + prepare: npm run build && true author: Speakeasy clientServerStatusCodesAsErrors: true enumFormat: union @@ -30,9 +33,6 @@ typescript: shared: models/components webhooks: models/webhooks inputModelSuffix: input - additionalPackageJSON: - license: UNLICENSED - prepare: "npm run build && true" maxMethodParams: 0 methodArguments: require-security-and-request moduleFormat: commonjs diff --git a/accounting/README.md b/accounting/README.md index 72654a6..fb00969 100644 --- a/accounting/README.md +++ b/accounting/README.md @@ -130,6 +130,9 @@ async function run() { let result; try { result = await accountingSDK.pets.listPets({}); + + // Handle the result + console.log(result); } catch (err) { switch (true) { case err instanceof SDKValidationError: { @@ -144,9 +147,6 @@ async function run() { } } } - - // Handle the result - console.log(result); } run(); diff --git a/accounting/RELEASES.md b/accounting/RELEASES.md index 86cdf13..d4c2e21 100644 --- a/accounting/RELEASES.md +++ b/accounting/RELEASES.md @@ -197,4 +197,14 @@ Based on: ### Generated - [typescript v0.2.2] accounting ### Releases -- [NPM v0.2.2] https://www.npmjs.com/package/ryan-accounting/v/0.2.2 - accounting \ No newline at end of file +- [NPM v0.2.2] https://www.npmjs.com/package/ryan-accounting/v/0.2.2 - accounting + +## 2024-09-06 00:54:19 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.390.7 (2.409.8) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v0.3.0] accounting +### Releases +- [NPM v0.3.0] https://www.npmjs.com/package/ryan-accounting/v/0.3.0 - accounting \ No newline at end of file diff --git a/accounting/docs/sdks/pets/README.md b/accounting/docs/sdks/pets/README.md index fd907d2..239ec06 100644 --- a/accounting/docs/sdks/pets/README.md +++ b/accounting/docs/sdks/pets/README.md @@ -22,7 +22,7 @@ const accountingSDK = new AccountingSDK(); async function run() { const result = await accountingSDK.pets.listPets({}); - + // Handle the result console.log(result) } @@ -94,7 +94,7 @@ async function run() { id: 596804, name: "", }); - + // Handle the result console.log(result) } @@ -168,7 +168,7 @@ async function run() { const result = await accountingSDK.pets.showPetById({ petId: "", }); - + // Handle the result console.log(result) } diff --git a/accounting/jsr.json b/accounting/jsr.json index 8e676eb..37018a3 100644 --- a/accounting/jsr.json +++ b/accounting/jsr.json @@ -2,7 +2,7 @@ { "name": "ryan-accounting", - "version": "0.2.2", + "version": "0.3.0", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/accounting/package-lock.json b/accounting/package-lock.json index a192696..34f5cc8 100644 --- a/accounting/package-lock.json +++ b/accounting/package-lock.json @@ -1,13 +1,15 @@ { "name": "ryan-accounting", - "version": "0.2.2", + "version": "0.3.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "ryan-accounting", - "version": "0.2.2", + "version": "0.3.0", + "license": "UNLICENSED", "devDependencies": { + "@types/node": "^18.19.3", "@typescript-eslint/eslint-plugin": "^7.7.1", "@typescript-eslint/parser": "^7.7.1", "eslint": "^8.57.0", @@ -196,6 +198,16 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, + "node_modules/@types/node": { + "version": "18.19.50", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.50.tgz", + "integrity": "sha512-xonK+NRrMBRtkL1hVCc3G+uXtjh1Al4opBLjqVmipe5ZAaBYWW6cNAiBVZ1BvmkBhep698rP3UM3aRAdSALuhg==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~5.26.4" + } + }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "7.15.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.15.0.tgz", @@ -2977,6 +2989,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true, + "license": "MIT" + }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -3209,6 +3228,15 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, + "@types/node": { + "version": "18.19.50", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.50.tgz", + "integrity": "sha512-xonK+NRrMBRtkL1hVCc3G+uXtjh1Al4opBLjqVmipe5ZAaBYWW6cNAiBVZ1BvmkBhep698rP3UM3aRAdSALuhg==", + "dev": true, + "requires": { + "undici-types": "~5.26.4" + } + }, "@typescript-eslint/eslint-plugin": { "version": "7.15.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.15.0.tgz", @@ -5159,6 +5187,12 @@ "which-boxed-primitive": "^1.0.2" } }, + "undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, "uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", diff --git a/accounting/package.json b/accounting/package.json index 0ad5505..614c3e0 100644 --- a/accounting/package.json +++ b/accounting/package.json @@ -1,7 +1,9 @@ { "name": "ryan-accounting", - "version": "0.2.2", + "version": "0.3.0", "author": "Speakeasy", + "license": "UNLICENSED", + "prepare": "npm run build && true", "main": "./index.js", "sideEffects": false, "repository": { @@ -18,6 +20,7 @@ "zod": ">= 3" }, "devDependencies": { + "@types/node": "^18.19.3", "@typescript-eslint/eslint-plugin": "^7.7.1", "@typescript-eslint/parser": "^7.7.1", "eslint": "^8.57.0", diff --git a/accounting/src/index.ts b/accounting/src/index.ts index ceb6380..c6fc7f0 100644 --- a/accounting/src/index.ts +++ b/accounting/src/index.ts @@ -4,3 +4,4 @@ export * from "./sdk/sdk.js"; export * from "./lib/config.js"; +export * as files from "./lib/files.js"; diff --git a/accounting/src/lib/config.ts b/accounting/src/lib/config.ts index 6cfc430..af255ee 100644 --- a/accounting/src/lib/config.ts +++ b/accounting/src/lib/config.ts @@ -50,7 +50,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "1.0.0", - sdkVersion: "0.2.2", - genVersion: "2.407.2", - userAgent: "speakeasy-sdk/typescript 0.2.2 2.407.2 1.0.0 ryan-accounting", + sdkVersion: "0.3.0", + genVersion: "2.409.8", + userAgent: "speakeasy-sdk/typescript 0.3.0 2.409.8 1.0.0 ryan-accounting", } as const; diff --git a/accounting/src/lib/files.ts b/accounting/src/lib/files.ts new file mode 100644 index 0000000..19e0804 --- /dev/null +++ b/accounting/src/lib/files.ts @@ -0,0 +1,40 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +/** + * Consumes a stream and returns a concatenated array buffer. Useful in + * situations where we need to read the whole file because it forms part of a + * larger payload containing other fields, and we can't modify the underlying + * request structure. + */ +export async function readableStreamToArrayBuffer( + readable: ReadableStream, +): Promise { + const reader = readable.getReader(); + const chunks: Uint8Array[] = []; + + let totalLength = 0; + let done = false; + + while (!done) { + const { value, done: doneReading } = await reader.read(); + + if (doneReading) { + done = true; + } else { + chunks.push(value); + totalLength += value.length; + } + } + + const concatenatedChunks = new Uint8Array(totalLength); + let offset = 0; + + for (const chunk of chunks) { + concatenatedChunks.set(chunk, offset); + offset += chunk.length; + } + + return concatenatedChunks.buffer; +} diff --git a/accounting/src/lib/sdks.ts b/accounting/src/lib/sdks.ts index 51b49bd..f741c47 100644 --- a/accounting/src/lib/sdks.ts +++ b/accounting/src/lib/sdks.ts @@ -181,6 +181,18 @@ export class ClientSDK { } } + if (conf.body instanceof ReadableStream) { + if (!fetchOptions) { + fetchOptions = { + // @ts-expect-error see https://github.com/node-fetch/node-fetch/issues/1769 + duplex: "half", + }; + } else { + // @ts-expect-error see https://github.com/node-fetch/node-fetch/issues/1769 + fetchOptions.duplex = "half"; + } + } + let input; try { input = this.hooks$.beforeCreateRequest(context, { diff --git a/accounting/src/types/streams.ts b/accounting/src/types/streams.ts new file mode 100644 index 0000000..a0163e7 --- /dev/null +++ b/accounting/src/types/streams.ts @@ -0,0 +1,21 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +export function isReadableStream( + val: unknown, +): val is ReadableStream { + if (typeof val !== "object" || val === null) { + return false; + } + + // Check for the presence of methods specific to ReadableStream + const stream = val as ReadableStream; + + // ReadableStream has methods like getReader, cancel, and tee + return ( + typeof stream.getReader === "function" && + typeof stream.cancel === "function" && + typeof stream.tee === "function" + ); +}