From 70eaf210a89697c46c5cf5ce1677d61f4815917b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 23 Apr 2024 07:42:05 +0000 Subject: [PATCH 001/109] feat(api): OpenAPI spec update via Stainless API (#12) --- .devcontainer/Dockerfile | 4 + .github/workflows/ci.yml | 2 + .gitignore | 1 + .prettierignore | 2 +- .stats.yml | 2 +- CONTRIBUTING.md | 6 +- README.md | 59 +++++++- api.md | 32 ++-- jest.config.ts | 3 + package.json | 7 +- src/core.ts | 5 +- src/error.ts | 2 +- src/index.ts | 9 +- src/resource.ts | 2 +- src/resources/capabilities/capabilities.ts | 2 +- src/resources/capabilities/index.ts | 2 +- src/resources/capabilities/media.ts | 9 +- .../file-interpreter/file-interpreter.ts | 11 +- src/resources/file-interpreter/from-audio.ts | 2 +- src/resources/file-interpreter/from-docx.ts | 2 +- src/resources/file-interpreter/from-html.ts | 2 +- src/resources/file-interpreter/from-image.ts | 14 +- .../file-interpreter/from-pdf-scanned.ts | 100 +++++++++++++ src/resources/file-interpreter/from-pdf.ts | 2 +- src/resources/file-interpreter/index.ts | 5 +- src/resources/index.ts | 2 +- src/resources/kpu.ts | 73 +++------ src/resources/mainet/index.ts | 4 +- src/resources/mainet/mainet.ts | 6 +- src/resources/mainet/search.ts | 51 +------ src/resources/models/embeddings.ts | 2 +- src/resources/models/index.ts | 4 +- src/resources/models/models.ts | 6 +- src/resources/models/rerank.ts | 34 +---- src/resources/shared.ts | 2 +- src/uploads.ts | 5 +- .../capabilities/capabilities.test.ts | 2 +- .../api-resources/capabilities/media.test.ts | 2 +- .../file-interpreter/from-audio.test.ts | 2 +- .../file-interpreter/from-docx.test.ts | 2 +- .../file-interpreter/from-html.test.ts | 2 +- .../file-interpreter/from-image.test.ts | 2 +- .../file-interpreter/from-pdf-scanned.test.ts | 44 ++++++ .../file-interpreter/from-pdf.test.ts | 2 +- tests/api-resources/kpu.test.ts | 4 +- tests/api-resources/mainet/search.test.ts | 30 ---- tests/api-resources/models/embeddings.test.ts | 2 +- tests/api-resources/models/rerank.test.ts | 32 ---- tests/index.test.ts | 2 +- tsconfig.build.json | 1 - tsconfig.deno.json | 1 - tsconfig.json | 1 - typings/digest-fetch/index.d.ts | 33 ----- yarn.lock | 139 +++++++++++++----- 54 files changed, 420 insertions(+), 359 deletions(-) create mode 100644 src/resources/file-interpreter/from-pdf-scanned.ts create mode 100644 tests/api-resources/file-interpreter/from-pdf-scanned.test.ts delete mode 100644 tests/api-resources/mainet/search.test.ts delete mode 100644 tests/api-resources/models/rerank.test.ts delete mode 100644 typings/digest-fetch/index.d.ts diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index d03365a..8ea34be 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -7,6 +7,10 @@ RUN apt-get update && apt-get install -y \ yarnpkg \ && apt-get clean autoclean +# Ensure UTF-8 encoding +ENV LANG=C.UTF-8 +ENV LC_ALL=C.UTF-8 + # Yarn RUN ln -sf /usr/bin/yarnpkg /usr/bin/yarn diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e6d1af..86f853f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,3 +28,5 @@ jobs: - name: Check types run: | yarn build + + diff --git a/.gitignore b/.gitignore index 58b3944..425a011 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ dist /deno /*.tgz .idea/ + diff --git a/.prettierignore b/.prettierignore index fc6160f..3548c5a 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,5 +1,5 @@ CHANGELOG.md -/ecosystem-tests +/ecosystem-tests/*/** /node_modules /deno diff --git a/.stats.yml b/.stats.yml index c254947..dd47305 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1 +1 @@ -configured_endpoints: 15 +configured_endpoints: 14 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2d7b5d4..dfd915c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,9 +42,7 @@ If you’d like to use the repository from source, you can either install from g To install via git: ```bash -npm install --save git+ssh://git@github.com:maisaai/node-sdk.git -# or -yarn add git+ssh://git@github.com:maisaai/node-sdk.git +npm install git+ssh://git@github.com:maisaai/node-sdk.git ``` Alternatively, to link a local copy of the repo: @@ -70,7 +68,7 @@ pnpm link -—global maisa Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests. ```bash -npx prism path/to/your/openapi.yml +npx prism mock path/to/your/openapi.yml ``` ```bash diff --git a/README.md b/README.md index e3bb179..a81e54d 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,12 @@ This library provides convenient access to the Maisa REST API from server-side T The REST API documentation can be found [on docs.maisa.ai](https://docs.maisa.ai/). The full API of this library can be found in [api.md](api.md). +It is generated with [Stainless](https://www.stainlessapi.com/). + ## Installation ```sh -# install from NPM -npm install --save maisa -# or -yarn add maisa +npm install maisa ``` ## Usage @@ -157,7 +156,51 @@ console.log(raw.headers.get('X-My-Header')); console.log(textSummary.summary); ``` -## Customizing the fetch client +### Making custom/undocumented requests + +This library is typed for convenient access to the documented API. If you need to access undocumented +endpoints, params, or response properties, the library can still be used. + +#### Undocumented endpoints + +To make requests to undocumented endpoints, you can use `client.get`, `client.post`, and other HTTP verbs. +Options on the client, such as retries, will be respected when making these requests. + +```ts +await client.post('/some/path', { + body: { some_prop: 'foo' }, + query: { some_query_arg: 'bar' }, +}); +``` + +#### Undocumented request params + +To make requests using undocumented parameters, you may use `// @ts-expect-error` on the undocumented +parameter. This library doesn't validate at runtime that the request matches the type, so any extra values you +send will be sent as-is. + +```ts +client.foo.create({ + foo: 'my_param', + bar: 12, + // @ts-expect-error baz is not yet public + baz: 'undocumented option', +}); +``` + +For requests with the `GET` verb, any extra params will be in the query, all other requests will send the +extra param in the body. + +If you want to explicitly send an extra argument, you can do so with the `query`, `body`, and `headers` request +options. + +#### Undocumented response properties + +To access undocumented response properties, you may access the response object with `// @ts-expect-error` on +the response object, or cast the response object to the requisite type. Like the request params, we do not +validate or strip extra properties from the response from the API. + +### Customizing the fetch client By default, this library uses `node-fetch` in Node, and expects a global `fetch` function in other environments. @@ -175,6 +218,8 @@ import Maisa from 'maisa'; To do the inverse, add `import "maisa/shims/node"` (which does import polyfills). This can also be useful if you are getting the wrong TypeScript types for `Response` ([more details](https://github.com/maisaai/node-sdk/tree/main/src/_shims#readme)). +### Logging and middleware + You may also provide a custom `fetch` function when instantiating the client, which can be used to inspect or alter the `Request` or `Response` before/after each request: @@ -195,7 +240,7 @@ const client = new Maisa({ Note that if given a `DEBUG=true` environment variable, this library will log all requests and responses automatically. This is intended for debugging purposes only and may change in the future without notice. -## Configuring an HTTP(S) Agent (e.g., for proxies) +### Configuring an HTTP(S) Agent (e.g., for proxies) By default, this library uses a stable agent for all http/https requests to reuse TCP connections, eliminating many TCP & TLS handshakes and shaving around 100ms off most requests. @@ -220,7 +265,7 @@ await maisa.capabilities.summarize( ); ``` -## Semantic Versioning +## Semantic versioning This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions: diff --git a/api.md b/api.md index 2106a57..7eec7ea 100644 --- a/api.md +++ b/api.md @@ -36,14 +36,6 @@ Methods: ## Rerank -Types: - -- Rerank - -Methods: - -- client.models.rerank.create({ ...params }) -> Rerank - # Kpu Types: @@ -52,7 +44,7 @@ Types: Methods: -- client.kpu.run({ ...params }) -> KpuRunResponse +- client.kpu.run({ ...params }) -> unknown # FileInterpreter @@ -66,6 +58,16 @@ Methods: - client.fileInterpreter.fromPdf.create({ ...params }) -> unknown +## FromPdfScanned + +Types: + +- FromPdfScannedCreateResponse + +Methods: + +- client.fileInterpreter.fromPdfScanned.create({ ...params }) -> unknown + ## FromDocx Types: @@ -90,11 +92,11 @@ Methods: Types: -- FromImage +- FromImageCreateResponse Methods: -- client.fileInterpreter.fromImage.create({ ...params }) -> FromImage +- client.fileInterpreter.fromImage.create({ ...params }) -> unknown ## FromAudio @@ -109,11 +111,3 @@ Methods: # Mainet ## Search - -Types: - -- Search - -Methods: - -- client.mainet.search.create({ ...params }) -> Search diff --git a/jest.config.ts b/jest.config.ts index 1299213..1c4942a 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -3,6 +3,9 @@ import type { JestConfigWithTsJest } from 'ts-jest'; const config: JestConfigWithTsJest = { preset: 'ts-jest/presets/default-esm', testEnvironment: 'node', + transform: { + '^.+\\.(t|j)sx?$': ['@swc/jest', { sourceMaps: 'inline' }], + }, moduleNameMapper: { '^maisa$': '/src/index.ts', '^maisa/_shims/auto/(.*)$': '/src/_shims/auto/$1-node', diff --git a/package.json b/package.json index df9922a..af5f763 100644 --- a/package.json +++ b/package.json @@ -2,13 +2,13 @@ "name": "maisa", "version": "0.1.0-alpha.2", "description": "The official TypeScript library for the Maisa API", - "author": "Maisa ", + "author": "Maisa ", "types": "dist/index.d.ts", "main": "dist/index.js", "type": "commonjs", "repository": "github:maisaai/node-sdk", "license": "Apache-2.0", - "packageManager": "yarn@1.22.21", + "packageManager": "yarn@1.22.22", "files": [ "*" ], @@ -29,13 +29,14 @@ "@types/node-fetch": "^2.6.4", "abort-controller": "^3.0.0", "agentkeepalive": "^4.2.1", - "digest-fetch": "^1.3.0", "form-data-encoder": "1.7.2", "formdata-node": "^4.3.2", "node-fetch": "^2.6.7", "web-streams-polyfill": "^3.2.1" }, "devDependencies": { + "@swc/core": "^1.3.102", + "@swc/jest": "^0.2.29", "@types/jest": "^29.4.0", "@typescript-eslint/eslint-plugin": "^6.7.0", "@typescript-eslint/parser": "^6.7.0", diff --git a/src/core.ts b/src/core.ts index e3e7b7c..b19f1dc 100644 --- a/src/core.ts +++ b/src/core.ts @@ -802,7 +802,8 @@ const getPlatformProperties = (): PlatformProperties => { 'X-Stainless-OS': normalizePlatform(Deno.build.os), 'X-Stainless-Arch': normalizeArch(Deno.build.arch), 'X-Stainless-Runtime': 'deno', - 'X-Stainless-Runtime-Version': Deno.version, + 'X-Stainless-Runtime-Version': + typeof Deno.version === 'string' ? Deno.version : Deno.version?.deno ?? 'unknown', }; } if (typeof EdgeRuntime !== 'undefined') { @@ -1059,7 +1060,7 @@ function applyHeadersMut(targetHeaders: Headers, newHeaders: Headers): void { } export function debug(action: string, ...args: any[]) { - if (typeof process !== 'undefined' && process.env['DEBUG'] === 'true') { + if (typeof process !== 'undefined' && process?.env?.['DEBUG'] === 'true') { console.log(`Maisa:DEBUG:${action}`, ...args); } } diff --git a/src/error.ts b/src/error.ts index 4f5e748..f0e7fef 100644 --- a/src/error.ts +++ b/src/error.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { castToError, Headers } from './core'; diff --git a/src/index.ts b/src/index.ts index 6cb1346..f289424 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import * as Core from './core'; import * as Errors from './error'; @@ -152,6 +152,9 @@ export class Maisa extends Core.APIClient { static InternalServerError = Errors.InternalServerError; static PermissionDeniedError = Errors.PermissionDeniedError; static UnprocessableEntityError = Errors.UnprocessableEntityError; + + static toFile = Uploads.toFile; + static fileFromPath = Uploads.fileFromPath; } export const { @@ -174,10 +177,6 @@ export import toFile = Uploads.toFile; export import fileFromPath = Uploads.fileFromPath; export namespace Maisa { - // Helper functions - export import toFile = Uploads.toFile; - export import fileFromPath = Uploads.fileFromPath; - export import RequestOptions = Core.RequestOptions; export import Capabilities = API.Capabilities; diff --git a/src/resource.ts b/src/resource.ts index bafec39..664cba0 100644 --- a/src/resource.ts +++ b/src/resource.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import type { Maisa } from './index'; diff --git a/src/resources/capabilities/capabilities.ts b/src/resources/capabilities/capabilities.ts index 21f0af5..1c0a2e9 100644 --- a/src/resources/capabilities/capabilities.ts +++ b/src/resources/capabilities/capabilities.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import * as Core from 'maisa/core'; import { APIResource } from 'maisa/resource'; diff --git a/src/resources/capabilities/index.ts b/src/resources/capabilities/index.ts index 94c7780..eb02778 100644 --- a/src/resources/capabilities/index.ts +++ b/src/resources/capabilities/index.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { CapabilityCompareParams, diff --git a/src/resources/capabilities/media.ts b/src/resources/capabilities/media.ts index cfdc57d..140f1ec 100644 --- a/src/resources/capabilities/media.ts +++ b/src/resources/capabilities/media.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import * as Core from 'maisa/core'; import { APIResource } from 'maisa/resource'; @@ -10,7 +10,7 @@ export class Media extends APIResource { /** * Compare extracts of media files based on a specific data. This endpoint supports * an additional field `model` documented in this url: - * https://dash.readme.com/project/clibrain-platform-api/v1.0/docs/capabilities-with-media-via-json-config + * https://docs.maisa.ai/docs/capabilities-with-media-via-json-config */ compare(body: MediaCompareParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post( @@ -22,8 +22,7 @@ export class Media extends APIResource { /** * Extracts structured data from a file. The text is analyzed and the variables are * extracted. This endpoint supports an additional field `model` documented in this - * url: - * https://dash.readme.com/project/clibrain-platform-api/v1.0/docs/capabilities-with-media-via-json-config + * url: https://docs.maisa.ai/docs/capabilities-with-media-via-json-config */ extract(body: MediaExtractParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post( @@ -35,7 +34,7 @@ export class Media extends APIResource { /** * Summarizes a media file. This endpoint supports an additional field `model` * documented in this url: - * https://dash.readme.com/project/clibrain-platform-api/v1.0/docs/capabilities-with-media-via-json-config + * https://docs.maisa.ai/docs/capabilities-with-media-via-json-config */ summarize(body: MediaSummarizeParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post( diff --git a/src/resources/file-interpreter/file-interpreter.ts b/src/resources/file-interpreter/file-interpreter.ts index 18c8820..87879e0 100644 --- a/src/resources/file-interpreter/file-interpreter.ts +++ b/src/resources/file-interpreter/file-interpreter.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from 'maisa/resource'; import * as FromAudioAPI from 'maisa/resources/file-interpreter/from-audio'; @@ -6,12 +6,14 @@ import * as FromDocxAPI from 'maisa/resources/file-interpreter/from-docx'; import * as FromHTMLAPI from 'maisa/resources/file-interpreter/from-html'; import * as FromImageAPI from 'maisa/resources/file-interpreter/from-image'; import * as FromPdfAPI from 'maisa/resources/file-interpreter/from-pdf'; +import * as FromPdfScannedAPI from 'maisa/resources/file-interpreter/from-pdf-scanned'; export class FileInterpreter extends APIResource { fromPdf: FromPdfAPI.FromPdf = new FromPdfAPI.FromPdf(this._client); + fromPdfScanned: FromPdfScannedAPI.FromPdfScanned = new FromPdfScannedAPI.FromPdfScanned(this._client); fromDocx: FromDocxAPI.FromDocx = new FromDocxAPI.FromDocx(this._client); fromHTML: FromHTMLAPI.FromHTML = new FromHTMLAPI.FromHTML(this._client); - fromImage: FromImageAPI.FromImageResource = new FromImageAPI.FromImageResource(this._client); + fromImage: FromImageAPI.FromImage = new FromImageAPI.FromImage(this._client); fromAudio: FromAudioAPI.FromAudio = new FromAudioAPI.FromAudio(this._client); } @@ -19,14 +21,17 @@ export namespace FileInterpreter { export import FromPdf = FromPdfAPI.FromPdf; export import FromPdfCreateResponse = FromPdfAPI.FromPdfCreateResponse; export import FromPdfCreateParams = FromPdfAPI.FromPdfCreateParams; + export import FromPdfScanned = FromPdfScannedAPI.FromPdfScanned; + export import FromPdfScannedCreateResponse = FromPdfScannedAPI.FromPdfScannedCreateResponse; + export import FromPdfScannedCreateParams = FromPdfScannedAPI.FromPdfScannedCreateParams; export import FromDocx = FromDocxAPI.FromDocx; export import FromDocxCreateResponse = FromDocxAPI.FromDocxCreateResponse; export import FromDocxCreateParams = FromDocxAPI.FromDocxCreateParams; export import FromHTML = FromHTMLAPI.FromHTML; export import FromHTMLCreateResponse = FromHTMLAPI.FromHTMLCreateResponse; export import FromHTMLCreateParams = FromHTMLAPI.FromHTMLCreateParams; - export import FromImageResource = FromImageAPI.FromImageResource; export import FromImage = FromImageAPI.FromImage; + export import FromImageCreateResponse = FromImageAPI.FromImageCreateResponse; export import FromImageCreateParams = FromImageAPI.FromImageCreateParams; export import FromAudio = FromAudioAPI.FromAudio; export import FromAudioCreateResponse = FromAudioAPI.FromAudioCreateResponse; diff --git a/src/resources/file-interpreter/from-audio.ts b/src/resources/file-interpreter/from-audio.ts index 8dd0cb9..c0f8676 100644 --- a/src/resources/file-interpreter/from-audio.ts +++ b/src/resources/file-interpreter/from-audio.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import * as Core from 'maisa/core'; import { APIResource } from 'maisa/resource'; diff --git a/src/resources/file-interpreter/from-docx.ts b/src/resources/file-interpreter/from-docx.ts index 8794d02..5e1b1eb 100644 --- a/src/resources/file-interpreter/from-docx.ts +++ b/src/resources/file-interpreter/from-docx.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import * as Core from 'maisa/core'; import { APIResource } from 'maisa/resource'; diff --git a/src/resources/file-interpreter/from-html.ts b/src/resources/file-interpreter/from-html.ts index 77ca141..2dce2f6 100644 --- a/src/resources/file-interpreter/from-html.ts +++ b/src/resources/file-interpreter/from-html.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import * as Core from 'maisa/core'; import { APIResource } from 'maisa/resource'; diff --git a/src/resources/file-interpreter/from-image.ts b/src/resources/file-interpreter/from-image.ts index c5cb15e..604ef27 100644 --- a/src/resources/file-interpreter/from-image.ts +++ b/src/resources/file-interpreter/from-image.ts @@ -1,15 +1,15 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import * as Core from 'maisa/core'; import { APIResource } from 'maisa/resource'; import * as FromImageAPI from 'maisa/resources/file-interpreter/from-image'; import { type Uploadable, multipartFormRequestOptions } from 'maisa/core'; -export class FromImageResource extends APIResource { +export class FromImage extends APIResource { /** * Interprets an image file and returns a description of the image. */ - create(body: FromImageCreateParams, options?: Core.RequestOptions): Core.APIPromise { + create(body: FromImageCreateParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post( '/v1/file-interpreter/from-image', multipartFormRequestOptions({ body, ...options }), @@ -17,15 +17,13 @@ export class FromImageResource extends APIResource { } } -export interface FromImage { - imageCaption: string; -} +export type FromImageCreateResponse = unknown; export interface FromImageCreateParams { file: Uploadable; } -export namespace FromImageResource { - export import FromImage = FromImageAPI.FromImage; +export namespace FromImage { + export import FromImageCreateResponse = FromImageAPI.FromImageCreateResponse; export import FromImageCreateParams = FromImageAPI.FromImageCreateParams; } diff --git a/src/resources/file-interpreter/from-pdf-scanned.ts b/src/resources/file-interpreter/from-pdf-scanned.ts new file mode 100644 index 0000000..558a569 --- /dev/null +++ b/src/resources/file-interpreter/from-pdf-scanned.ts @@ -0,0 +1,100 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import * as Core from 'maisa/core'; +import { APIResource } from 'maisa/resource'; +import * as FromPdfScannedAPI from 'maisa/resources/file-interpreter/from-pdf-scanned'; +import { type Uploadable, multipartFormRequestOptions } from 'maisa/core'; + +export class FromPdfScanned extends APIResource { + /** + * Interprets pdf file and returns some extracted variables. + */ + create(body: FromPdfScannedCreateParams, options?: Core.RequestOptions): Core.APIPromise { + return this._client.post( + '/v1/file-interpreter/from-pdf-scanned', + multipartFormRequestOptions({ body, ...options }), + ); + } +} + +export type FromPdfScannedCreateResponse = unknown; + +export interface FromPdfScannedCreateParams { + file: Uploadable; + + /** + * The language of the output. If not provided, the language used will be the same + * as the language of the text provided. + */ + lang?: 'en' | 'es' | 'pt' | 'fr' | 'de' | 'it' | 'nl' | 'sv' | 'pl' | 'ro'; + + /** + * The maximum number of pages to be extracted. + */ + max_pages?: number; + + /** + * The description of the variable. + */ + variable1_description?: string; + + /** + * The name of the variable to be extracted. + */ + variable1_name?: string; + + /** + * Text Extraction Request Variable Type. + */ + variable1_type?: 'string' | 'number' | 'date' | 'boolean'; + + /** + * The description of the variable. + */ + variable2_description?: string; + + /** + * The name of the variable to be extracted. + */ + variable2_name?: string; + + /** + * Text Extraction Request Variable Type. + */ + variable2_type?: 'string' | 'number' | 'date' | 'boolean'; + + /** + * The description of the variable. + */ + variable3_description?: string; + + /** + * The name of the variable to be extracted. + */ + variable3_name?: string; + + /** + * Text Extraction Request Variable Type. + */ + variable3_type?: 'string' | 'number' | 'date' | 'boolean'; + + /** + * The description of the variable. + */ + variable4_description?: string; + + /** + * The name of the variable to be extracted. + */ + variable4_name?: string; + + /** + * Text Extraction Request Variable Type. + */ + variable4_type?: 'string' | 'number' | 'date' | 'boolean'; +} + +export namespace FromPdfScanned { + export import FromPdfScannedCreateResponse = FromPdfScannedAPI.FromPdfScannedCreateResponse; + export import FromPdfScannedCreateParams = FromPdfScannedAPI.FromPdfScannedCreateParams; +} diff --git a/src/resources/file-interpreter/from-pdf.ts b/src/resources/file-interpreter/from-pdf.ts index 845a318..9bdf316 100644 --- a/src/resources/file-interpreter/from-pdf.ts +++ b/src/resources/file-interpreter/from-pdf.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import * as Core from 'maisa/core'; import { APIResource } from 'maisa/resource'; diff --git a/src/resources/file-interpreter/index.ts b/src/resources/file-interpreter/index.ts index 686c1cf..a69a17a 100644 --- a/src/resources/file-interpreter/index.ts +++ b/src/resources/file-interpreter/index.ts @@ -1,8 +1,9 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { FileInterpreter } from './file-interpreter'; export { FromAudioCreateResponse, FromAudioCreateParams, FromAudio } from './from-audio'; export { FromDocxCreateResponse, FromDocxCreateParams, FromDocx } from './from-docx'; export { FromHTMLCreateResponse, FromHTMLCreateParams, FromHTML } from './from-html'; -export { FromImage, FromImageCreateParams, FromImageResource } from './from-image'; +export { FromImageCreateResponse, FromImageCreateParams, FromImage } from './from-image'; export { FromPdfCreateResponse, FromPdfCreateParams, FromPdf } from './from-pdf'; +export { FromPdfScannedCreateResponse, FromPdfScannedCreateParams, FromPdfScanned } from './from-pdf-scanned'; diff --git a/src/resources/index.ts b/src/resources/index.ts index ebb2d3a..74798a5 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export * from './shared'; export { diff --git a/src/resources/kpu.ts b/src/resources/kpu.ts index d9f30e7..6f6e6c5 100644 --- a/src/resources/kpu.ts +++ b/src/resources/kpu.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import * as Core from 'maisa/core'; import { APIResource } from 'maisa/resource'; @@ -8,8 +8,10 @@ import { type Uploadable, multipartFormRequestOptions } from 'maisa/core'; export class Kpu extends APIResource { /** * Executes the KPU in sync, sending the response when the KPU execution is done. + * The KPU beta is currently available for selected users. Submit your request to + * be granted access: https://maisa.ai */ - run(params: KpuRunParams, options?: Core.RequestOptions): Core.APIPromise { + run(params: KpuRunParams, options?: Core.RequestOptions): Core.APIPromise { const { explain_steps, retries, ...body } = params; return this._client.post( '/v1/kpu/run', @@ -18,53 +20,7 @@ export class Kpu extends APIResource { } } -export interface KpuRunResponse { - /** - * Array of the intents executed by the KPU. - */ - intents: Array; - - /** - * The result of the KPU execution. The result may be invalid if none of the - * intents were successful. - */ - result: string; - - /** - * Key-value of the files generated by the KPU. - */ - downloadable_files?: Record; -} - -export namespace KpuRunResponse { - export interface Intent { - /** - * Array of the steps of the intent explained in natural language. This field is an - * ampty array if `explain_steps` param is set to `false` - */ - explain_steps: Array; - - /** - * Intent number, starting from 0. - */ - intent: number; - - /** - * The result of the intent. - */ - result: string; - - /** - * Whether the intent was interpreted as solved by the KPU or not. - */ - solved: boolean; - - /** - * Key-value of the files generated by the KPU. - */ - downloadable_files?: Record; - } -} +export type KpuRunResponse = unknown; export interface KpuRunParams { /** @@ -90,6 +46,25 @@ export interface KpuRunParams { * Body param: Files to be used in the KPU execution. Files can be of any type. */ file?: Array; + + /** + * Body param: + */ + reasoner_model?: + | 'gpt-4-turbo' + | 'mistral-large' + | 'gpt-3.5-turbo' + | 'claude-3-sonnet' + | 'claude-3-opus' + | 'gemini-pro' + | 'azure/gpt-4-turbo' + | 'openai/gpt-4-turbo' + | null; + + /** + * Body param: + */ + reasoner_prompt?: string | null; } export namespace Kpu { diff --git a/src/resources/mainet/index.ts b/src/resources/mainet/index.ts index bed9ddb..38ae44a 100644 --- a/src/resources/mainet/index.ts +++ b/src/resources/mainet/index.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Mainet } from './mainet'; -export { Search, SearchCreateParams, SearchResource } from './search'; +export { Search } from './search'; diff --git a/src/resources/mainet/mainet.ts b/src/resources/mainet/mainet.ts index 83c2034..56d73d4 100644 --- a/src/resources/mainet/mainet.ts +++ b/src/resources/mainet/mainet.ts @@ -1,14 +1,12 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from 'maisa/resource'; import * as SearchAPI from 'maisa/resources/mainet/search'; export class Mainet extends APIResource { - search: SearchAPI.SearchResource = new SearchAPI.SearchResource(this._client); + search: SearchAPI.Search = new SearchAPI.Search(this._client); } export namespace Mainet { - export import SearchResource = SearchAPI.SearchResource; export import Search = SearchAPI.Search; - export import SearchCreateParams = SearchAPI.SearchCreateParams; } diff --git a/src/resources/mainet/search.ts b/src/resources/mainet/search.ts index c4c8f5e..6daedfb 100644 --- a/src/resources/mainet/search.ts +++ b/src/resources/mainet/search.ts @@ -1,52 +1,5 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'maisa/core'; import { APIResource } from 'maisa/resource'; -import * as SearchAPI from 'maisa/resources/mainet/search'; -export class SearchResource extends APIResource { - /** - * Finds content in mainet network - */ - create(body: SearchCreateParams, options?: Core.RequestOptions): Core.APIPromise { - return this._client.post('/v1/mainet/search', { body, ...options }); - } -} - -export interface Search { - /** - * The list of documents found. - */ - docs: Array; -} - -export namespace Search { - export interface Doc { - /** - * The id of the document. - */ - id: string; - - /** - * The content of the document. - */ - content: string; - - /** - * The source of the document. - */ - source: string; - } -} - -export interface SearchCreateParams { - /** - * The text or query to search for. - */ - text: string; -} - -export namespace SearchResource { - export import Search = SearchAPI.Search; - export import SearchCreateParams = SearchAPI.SearchCreateParams; -} +export class Search extends APIResource {} diff --git a/src/resources/models/embeddings.ts b/src/resources/models/embeddings.ts index 31359bc..002e59c 100644 --- a/src/resources/models/embeddings.ts +++ b/src/resources/models/embeddings.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import * as Core from 'maisa/core'; import { APIResource } from 'maisa/resource'; diff --git a/src/resources/models/index.ts b/src/resources/models/index.ts index 71c6e7a..d9a194b 100644 --- a/src/resources/models/index.ts +++ b/src/resources/models/index.ts @@ -1,5 +1,5 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Embeddings, EmbeddingCreateParams } from './embeddings'; export { Models } from './models'; -export { Rerank, RerankCreateParams, RerankResource } from './rerank'; +export { Rerank } from './rerank'; diff --git a/src/resources/models/models.ts b/src/resources/models/models.ts index adfe565..3ad737c 100644 --- a/src/resources/models/models.ts +++ b/src/resources/models/models.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from 'maisa/resource'; import * as EmbeddingsAPI from 'maisa/resources/models/embeddings'; @@ -6,13 +6,11 @@ import * as RerankAPI from 'maisa/resources/models/rerank'; export class Models extends APIResource { embeddings: EmbeddingsAPI.Embeddings = new EmbeddingsAPI.Embeddings(this._client); - rerank: RerankAPI.RerankResource = new RerankAPI.RerankResource(this._client); + rerank: RerankAPI.Rerank = new RerankAPI.Rerank(this._client); } export namespace Models { export import Embeddings = EmbeddingsAPI.Embeddings; export import EmbeddingCreateParams = EmbeddingsAPI.EmbeddingCreateParams; - export import RerankResource = RerankAPI.RerankResource; export import Rerank = RerankAPI.Rerank; - export import RerankCreateParams = RerankAPI.RerankCreateParams; } diff --git a/src/resources/models/rerank.ts b/src/resources/models/rerank.ts index 8e49676..7ae77c4 100644 --- a/src/resources/models/rerank.ts +++ b/src/resources/models/rerank.ts @@ -1,35 +1,5 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'maisa/core'; import { APIResource } from 'maisa/resource'; -import * as RerankAPI from 'maisa/resources/models/rerank'; -export class RerankResource extends APIResource { - /** - * Rerank the sentences based on the similarity with the source sentence. - */ - create(body: RerankCreateParams, options?: Core.RequestOptions): Core.APIPromise { - return this._client.post('/v1/models/rerank', { body, ...options }); - } -} - -export interface Rerank { - sorted_sentences: Array; -} - -export interface RerankCreateParams { - /** - * A list of sentences to be reranked. - */ - sentences: Array; - - /** - * The sentence to be used as a reference to rerank the sentences. - */ - source_sentence: string; -} - -export namespace RerankResource { - export import Rerank = RerankAPI.Rerank; - export import RerankCreateParams = RerankAPI.RerankCreateParams; -} +export class Rerank extends APIResource {} diff --git a/src/resources/shared.ts b/src/resources/shared.ts index 5660544..e6b315e 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. /** * Texts Comparator Response. diff --git a/src/uploads.ts b/src/uploads.ts index 2398baf..081827c 100644 --- a/src/uploads.ts +++ b/src/uploads.ts @@ -102,11 +102,14 @@ export type ToFileInput = Uploadable | Exclude | AsyncIter export async function toFile( value: ToFileInput | PromiseLike, name?: string | null | undefined, - options: FilePropertyBag | undefined = {}, + options?: FilePropertyBag | undefined, ): Promise { // If it's a promise, resolve it. value = await value; + // Use the file's options if there isn't one provided + options ??= isFileLike(value) ? { lastModified: value.lastModified, type: value.type } : {}; + if (isResponseLike(value)) { const blob = await value.blob(); name ||= new URL(value.url).pathname.split(/[\\/]/).pop() ?? 'unknown_file'; diff --git a/tests/api-resources/capabilities/capabilities.test.ts b/tests/api-resources/capabilities/capabilities.test.ts index 3f12ed2..32fffb8 100644 --- a/tests/api-resources/capabilities/capabilities.test.ts +++ b/tests/api-resources/capabilities/capabilities.test.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import Maisa from 'maisa'; import { Response } from 'node-fetch'; diff --git a/tests/api-resources/capabilities/media.test.ts b/tests/api-resources/capabilities/media.test.ts index 52226ab..8bc937d 100644 --- a/tests/api-resources/capabilities/media.test.ts +++ b/tests/api-resources/capabilities/media.test.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import Maisa, { toFile } from 'maisa'; import { Response } from 'node-fetch'; diff --git a/tests/api-resources/file-interpreter/from-audio.test.ts b/tests/api-resources/file-interpreter/from-audio.test.ts index 5536b9e..b482327 100644 --- a/tests/api-resources/file-interpreter/from-audio.test.ts +++ b/tests/api-resources/file-interpreter/from-audio.test.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import Maisa, { toFile } from 'maisa'; import { Response } from 'node-fetch'; diff --git a/tests/api-resources/file-interpreter/from-docx.test.ts b/tests/api-resources/file-interpreter/from-docx.test.ts index a9875f8..4ae8817 100644 --- a/tests/api-resources/file-interpreter/from-docx.test.ts +++ b/tests/api-resources/file-interpreter/from-docx.test.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import Maisa, { toFile } from 'maisa'; import { Response } from 'node-fetch'; diff --git a/tests/api-resources/file-interpreter/from-html.test.ts b/tests/api-resources/file-interpreter/from-html.test.ts index fece251..2f34618 100644 --- a/tests/api-resources/file-interpreter/from-html.test.ts +++ b/tests/api-resources/file-interpreter/from-html.test.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import Maisa, { toFile } from 'maisa'; import { Response } from 'node-fetch'; diff --git a/tests/api-resources/file-interpreter/from-image.test.ts b/tests/api-resources/file-interpreter/from-image.test.ts index 4376ed4..ed1c104 100644 --- a/tests/api-resources/file-interpreter/from-image.test.ts +++ b/tests/api-resources/file-interpreter/from-image.test.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import Maisa, { toFile } from 'maisa'; import { Response } from 'node-fetch'; diff --git a/tests/api-resources/file-interpreter/from-pdf-scanned.test.ts b/tests/api-resources/file-interpreter/from-pdf-scanned.test.ts new file mode 100644 index 0000000..4f9f89a --- /dev/null +++ b/tests/api-resources/file-interpreter/from-pdf-scanned.test.ts @@ -0,0 +1,44 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Maisa, { toFile } from 'maisa'; +import { Response } from 'node-fetch'; + +const maisa = new Maisa({ + apiKey: 'My API Key', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource fromPdfScanned', () => { + test('create: only required params', async () => { + const responsePromise = maisa.fileInterpreter.fromPdfScanned.create({ + file: await toFile(Buffer.from('# my file contents'), 'README.md'), + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('create: required and optional params', async () => { + const response = await maisa.fileInterpreter.fromPdfScanned.create({ + file: await toFile(Buffer.from('# my file contents'), 'README.md'), + lang: 'en', + max_pages: 0, + variable1_description: 'The name of the person.', + variable1_name: 'Name', + variable1_type: 'string', + variable2_description: 'The name of the person.', + variable2_name: 'Name', + variable2_type: 'string', + variable3_description: 'The name of the person.', + variable3_name: 'Name', + variable3_type: 'string', + variable4_description: 'The name of the person.', + variable4_name: 'Name', + variable4_type: 'string', + }); + }); +}); diff --git a/tests/api-resources/file-interpreter/from-pdf.test.ts b/tests/api-resources/file-interpreter/from-pdf.test.ts index d680c9a..b1eacc0 100644 --- a/tests/api-resources/file-interpreter/from-pdf.test.ts +++ b/tests/api-resources/file-interpreter/from-pdf.test.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import Maisa, { toFile } from 'maisa'; import { Response } from 'node-fetch'; diff --git a/tests/api-resources/kpu.test.ts b/tests/api-resources/kpu.test.ts index 1369973..c935657 100644 --- a/tests/api-resources/kpu.test.ts +++ b/tests/api-resources/kpu.test.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import Maisa, { toFile } from 'maisa'; import { Response } from 'node-fetch'; @@ -30,6 +30,8 @@ describe('resource kpu', () => { await toFile(Buffer.from('# my file contents'), 'README.md'), await toFile(Buffer.from('# my file contents'), 'README.md'), ], + reasoner_model: 'gpt-4-turbo', + reasoner_prompt: 'string', }); }); }); diff --git a/tests/api-resources/mainet/search.test.ts b/tests/api-resources/mainet/search.test.ts deleted file mode 100644 index 7c6293e..0000000 --- a/tests/api-resources/mainet/search.test.ts +++ /dev/null @@ -1,30 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Maisa from 'maisa'; -import { Response } from 'node-fetch'; - -const maisa = new Maisa({ - apiKey: 'My API Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource search', () => { - test('create: only required params', async () => { - const responsePromise = maisa.mainet.search.create({ - text: 'Plato, the philosopher, was born in Athens.', - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('create: required and optional params', async () => { - const response = await maisa.mainet.search.create({ - text: 'Plato, the philosopher, was born in Athens.', - }); - }); -}); diff --git a/tests/api-resources/models/embeddings.test.ts b/tests/api-resources/models/embeddings.test.ts index 583b402..376729f 100644 --- a/tests/api-resources/models/embeddings.test.ts +++ b/tests/api-resources/models/embeddings.test.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import Maisa from 'maisa'; import { Response } from 'node-fetch'; diff --git a/tests/api-resources/models/rerank.test.ts b/tests/api-resources/models/rerank.test.ts deleted file mode 100644 index 63e1ded..0000000 --- a/tests/api-resources/models/rerank.test.ts +++ /dev/null @@ -1,32 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import Maisa from 'maisa'; -import { Response } from 'node-fetch'; - -const maisa = new Maisa({ - apiKey: 'My API Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource rerank', () => { - test('create: only required params', async () => { - const responsePromise = maisa.models.rerank.create({ - sentences: ['The light bulb was invented by Thomas Edison', "It's a nice day, isn't it"], - source_sentence: 'Who invented the light bulb?', - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('create: required and optional params', async () => { - const response = await maisa.models.rerank.create({ - sentences: ['The light bulb was invented by Thomas Edison', "It's a nice day, isn't it"], - source_sentence: 'Who invented the light bulb?', - }); - }); -}); diff --git a/tests/index.test.ts b/tests/index.test.ts index 50d6d7f..aac03c5 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import Maisa from 'maisa'; import { APIUserAbortError } from 'maisa'; diff --git a/tsconfig.build.json b/tsconfig.build.json index 217ca4c..cd1a49f 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -7,7 +7,6 @@ "paths": { "maisa/*": ["dist/src/*"], "maisa": ["dist/src/index.ts"], - "digest-fetch": ["./typings/digest-fetch"] }, "noEmit": false, "declaration": true, diff --git a/tsconfig.deno.json b/tsconfig.deno.json index b881c28..7ef14ac 100644 --- a/tsconfig.deno.json +++ b/tsconfig.deno.json @@ -9,7 +9,6 @@ "maisa/_shims/auto/*": ["deno/_shims/auto/*-deno"], "maisa/*": ["deno/*"], "maisa": ["deno/index.ts"], - "digest-fetch": ["./typings/digest-fetch"] }, "noEmit": true, "declaration": true, diff --git a/tsconfig.json b/tsconfig.json index 9a4b047..05db708 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,7 +12,6 @@ "maisa/_shims/auto/*": ["src/_shims/auto/*-node"], "maisa/*": ["src/*"], "maisa": ["src/index.ts"], - "digest-fetch": ["./typings/digest-fetch"] }, "noEmit": true, diff --git a/typings/digest-fetch/index.d.ts b/typings/digest-fetch/index.d.ts deleted file mode 100644 index f6bcbfd..0000000 --- a/typings/digest-fetch/index.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -declare module 'digest-fetch'; - -import type { RequestInfo, RequestInit, Response } from 'node-fetch'; - -type Algorithm = 'MD5' | 'MD5-sess'; - -type Options = { - algorithm?: Algorithm; - statusCode?: number; - cnonceSize?: number; - basic?: boolean; - precomputeHash?: boolean; - logger?: typeof console; -}; - -class DigestClient { - user: string; - password: string; - - private nonceRaw: string; - private logger?: typeof console; - private precomputedHash?: boolean; - private statusCode?: number; - private basic: boolean; - private cnonceSize: number; - private hasAuth: boolean; - private digest: { nc: number; algorithm: Algorithm; realm: string }; - - constructor(user: string, password: string, options: Options = {}); - async fetch(url: RequestInfo, options: RequestInit = {}): Promise; -} - -export default DigestClient; diff --git a/yarn.lock b/yarn.lock index b3447b1..51cdd9f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -432,6 +432,13 @@ slash "^3.0.0" strip-ansi "^6.0.0" +"@jest/create-cache-key-function@^29.7.0": + version "29.7.0" + resolved "https://registry.yarnpkg.com/@jest/create-cache-key-function/-/create-cache-key-function-29.7.0.tgz#793be38148fab78e65f40ae30c36785f4ad859f0" + integrity sha512-4QqS3LY5PBmTRHj9sAg1HLoPzqAI0uOX6wI/TRqHIcOxlFidy6YEmCQJk6FSZjNLGCeubDMfmkWL+qaLKhSGQA== + dependencies: + "@jest/types" "^29.6.3" + "@jest/environment@^29.7.0": version "29.7.0" resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.7.0.tgz#24d61f54ff1f786f3cd4073b4b94416383baf2a7" @@ -662,6 +669,96 @@ dependencies: "@sinonjs/commons" "^3.0.0" +"@swc/core-darwin-arm64@1.4.16": + version "1.4.16" + resolved "https://registry.yarnpkg.com/@swc/core-darwin-arm64/-/core-darwin-arm64-1.4.16.tgz#2cd45d709ce76d448d96bf8d0006849541436611" + integrity sha512-UOCcH1GvjRnnM/LWT6VCGpIk0OhHRq6v1U6QXuPt5wVsgXnXQwnf5k3sG5Cm56hQHDvhRPY6HCsHi/p0oek8oQ== + +"@swc/core-darwin-x64@1.4.16": + version "1.4.16" + resolved "https://registry.yarnpkg.com/@swc/core-darwin-x64/-/core-darwin-x64-1.4.16.tgz#a5bc7d8b1dd850adb0bb95c6b5c742b92201fd01" + integrity sha512-t3bgqFoYLWvyVtVL6KkFNCINEoOrIlyggT/kJRgi1y0aXSr0oVgcrQ4ezJpdeahZZ4N+Q6vT3ffM30yIunELNA== + +"@swc/core-linux-arm-gnueabihf@1.4.16": + version "1.4.16" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.4.16.tgz#961744908ee5cbb79bc009dcf58cc8b831111f38" + integrity sha512-DvHuwvEF86YvSd0lwnzVcjOTZ0jcxewIbsN0vc/0fqm9qBdMMjr9ox6VCam1n3yYeRtj4VFgrjeNFksqbUejdQ== + +"@swc/core-linux-arm64-gnu@1.4.16": + version "1.4.16" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.4.16.tgz#43713be3f26757d82d2745dc25f8b63400e0a3d0" + integrity sha512-9Uu5YlPbyCvbidjKtYEsPpyZlu16roOZ5c2tP1vHfnU9bgf5Tz5q5VovSduNxPHx+ed2iC1b1URODHvDzbbDuQ== + +"@swc/core-linux-arm64-musl@1.4.16": + version "1.4.16" + resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.4.16.tgz#394a7d030f3a61902bd3947bb9d70d26d42f3c81" + integrity sha512-/YZq/qB1CHpeoL0eMzyqK5/tYZn/rzKoCYDviFU4uduSUIJsDJQuQA/skdqUzqbheOXKAd4mnJ1hT04RbJ8FPQ== + +"@swc/core-linux-x64-gnu@1.4.16": + version "1.4.16" + resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.4.16.tgz#71eb108b784f9d551ee8a35ebcdaed972f567981" + integrity sha512-UUjaW5VTngZYDcA8yQlrFmqs1tLi1TxbKlnaJwoNhel9zRQ0yG1YEVGrzTvv4YApSuIiDK18t+Ip927bwucuVQ== + +"@swc/core-linux-x64-musl@1.4.16": + version "1.4.16" + resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.4.16.tgz#10dbaedb4e3dfc7268e3a9a66ad3431471ef035b" + integrity sha512-aFhxPifevDTwEDKPi4eRYWzC0p/WYJeiFkkpNU5Uc7a7M5iMWPAbPFUbHesdlb9Jfqs5c07oyz86u+/HySBNPQ== + +"@swc/core-win32-arm64-msvc@1.4.16": + version "1.4.16" + resolved "https://registry.yarnpkg.com/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.4.16.tgz#80247adff6c245ff32b44d773c1a148858cd655f" + integrity sha512-bTD43MbhIHL2s5QgCwyleaGwl96Gk/scF2TaVKdUe4QlJCDV/YK9h5oIBAp63ckHtE8GHlH4c8dZNBiAXn4Org== + +"@swc/core-win32-ia32-msvc@1.4.16": + version "1.4.16" + resolved "https://registry.yarnpkg.com/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.4.16.tgz#e540afc3ccf3224267b4ddfb408f9d9737984686" + integrity sha512-/lmZeAN/qV5XbK2SEvi8e2RkIg8FQNYiSA8y2/Zb4gTUMKVO5JMLH0BSWMiIKMstKDPDSxMWgwJaQHF8UMyPmQ== + +"@swc/core-win32-x64-msvc@1.4.16": + version "1.4.16" + resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.4.16.tgz#f880939fca32c181adfe7e3abd2b6b7857bd3489" + integrity sha512-BPAfFfODWXtUu6SwaTTftDHvcbDyWBSI/oanUeRbQR5vVWkXoQ3cxLTsDluc3H74IqXS5z1Uyoe0vNo2hB1opA== + +"@swc/core@^1.3.102": + version "1.4.16" + resolved "https://registry.yarnpkg.com/@swc/core/-/core-1.4.16.tgz#d175bae2acfecd53bcbd4293f1fba5ec316634a0" + integrity sha512-Xaf+UBvW6JNuV131uvSNyMXHn+bh6LyKN4tbv7tOUFQpXyz/t9YWRE04emtlUW9Y0qrm/GKFCbY8n3z6BpZbTA== + dependencies: + "@swc/counter" "^0.1.2" + "@swc/types" "^0.1.5" + optionalDependencies: + "@swc/core-darwin-arm64" "1.4.16" + "@swc/core-darwin-x64" "1.4.16" + "@swc/core-linux-arm-gnueabihf" "1.4.16" + "@swc/core-linux-arm64-gnu" "1.4.16" + "@swc/core-linux-arm64-musl" "1.4.16" + "@swc/core-linux-x64-gnu" "1.4.16" + "@swc/core-linux-x64-musl" "1.4.16" + "@swc/core-win32-arm64-msvc" "1.4.16" + "@swc/core-win32-ia32-msvc" "1.4.16" + "@swc/core-win32-x64-msvc" "1.4.16" + +"@swc/counter@^0.1.2", "@swc/counter@^0.1.3": + version "0.1.3" + resolved "https://registry.yarnpkg.com/@swc/counter/-/counter-0.1.3.tgz#cc7463bd02949611c6329596fccd2b0ec782b0e9" + integrity sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ== + +"@swc/jest@^0.2.29": + version "0.2.36" + resolved "https://registry.yarnpkg.com/@swc/jest/-/jest-0.2.36.tgz#2797450a30d28b471997a17e901ccad946fe693e" + integrity sha512-8X80dp81ugxs4a11z1ka43FPhP+/e+mJNXJSxiNYk8gIX/jPBtY4gQTrKu/KIoco8bzKuPI5lUxjfLiGsfvnlw== + dependencies: + "@jest/create-cache-key-function" "^29.7.0" + "@swc/counter" "^0.1.3" + jsonc-parser "^3.2.0" + +"@swc/types@^0.1.5": + version "0.1.6" + resolved "https://registry.yarnpkg.com/@swc/types/-/types-0.1.6.tgz#2f13f748995b247d146de2784d3eb7195410faba" + integrity sha512-/JLo/l2JsT/LRd80C3HfbmVpxOAJ11FO2RCEslFrgzLltoP9j8XIbsyDcfCt2WWyX+CM96rBoNM+IToAkFOugg== + dependencies: + "@swc/counter" "^0.1.3" + "@ts-morph/common@~0.20.0": version "0.20.0" resolved "https://registry.yarnpkg.com/@ts-morph/common/-/common-0.20.0.tgz#3f161996b085ba4519731e4d24c35f6cba5b80af" @@ -1076,11 +1173,6 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== -base-64@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/base-64/-/base-64-0.1.0.tgz#780a99c84e7d600260361511c4877613bf24f6bb" - integrity sha512-Y5gU45svrR5tI2Vt/X9GPd3L0HNIKzGu202EjxrXMpuc2V2CiKgemAbUUsqYmZJvPtCXoUKjNZwBJzsNScUbXA== - big-integer@^1.6.44: version "1.6.52" resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.52.tgz#60a887f3047614a8e1bffe5d7173490a97dc8c85" @@ -1193,11 +1285,6 @@ char-regex@^1.0.2: resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== -charenc@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667" - integrity sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA== - ci-info@^3.2.0: version "3.9.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.9.0.tgz#4279a62028a7b1f262f3473fc9605f5e218c59b4" @@ -1305,11 +1392,6 @@ cross-spawn@^7.0.2, cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" -crypt@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b" - integrity sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow== - debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" @@ -1380,14 +1462,6 @@ diff@^4.0.1: resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== -digest-fetch@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/digest-fetch/-/digest-fetch-1.3.0.tgz#898e69264d00012a23cf26e8a3e40320143fc661" - integrity sha512-CGJuv6iKNM7QyZlM2T3sPAdZWd/p9zQiRNS9G+9COUCwzWFTs0Xp8NF5iePx7wtvhDykReiRRrSeNb4oMmB8lA== - dependencies: - base-64 "^0.1.0" - md5 "^2.3.0" - dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" @@ -1934,11 +2008,6 @@ is-arrayish@^0.2.1: resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== -is-buffer@~1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" - integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== - is-core-module@^2.13.0: version "2.13.1" resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.13.1.tgz#ad0d7532c6fea9da1ebdc82742d74525c6273384" @@ -2473,6 +2542,11 @@ json5@^2.2.2, json5@^2.2.3: resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== +jsonc-parser@^3.2.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.1.tgz#031904571ccf929d7670ee8c547545081cb37f1a" + integrity sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA== + kleur@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" @@ -2553,15 +2627,6 @@ makeerror@1.0.12: dependencies: tmpl "1.0.5" -md5@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/md5/-/md5-2.3.0.tgz#c3da9a6aae3a30b46b7b0c349b87b110dc3bda4f" - integrity sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g== - dependencies: - charenc "0.0.2" - crypt "0.0.2" - is-buffer "~1.1.6" - merge-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" From 39d7ac0350a854f3aeb0d8c19df2cffba70ef001 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 May 2024 11:54:20 +0000 Subject: [PATCH 002/109] feat(api): OpenAPI spec update via Stainless API (#14) --- .github/workflows/ci.yml | 18 +++- .github/workflows/publish-npm.yml | 2 +- .github/workflows/release-doctor.yml | 2 +- .gitignore | 1 + .stats.yml | 3 +- Brewfile | 1 + api.md | 8 -- bin/check-test-server | 50 ---------- jest.config.ts | 1 + package.json | 8 +- scripts/bootstrap | 18 ++++ build => scripts/build | 15 +-- scripts/lint | 7 ++ scripts/mock | 41 ++++++++ scripts/test | 57 +++++++++++ .../{ => utils}/check-is-in-git-install.sh | 0 scripts/{ => utils}/check-version.cjs | 4 +- scripts/{ => utils}/fix-index-exports.cjs | 2 +- .../{ => utils}/make-dist-package-json.cjs | 2 +- scripts/{ => utils}/postprocess-files.cjs | 6 +- .../file-interpreter/file-interpreter.ts | 2 - .../file-interpreter/from-pdf-scanned.ts | 97 +------------------ src/resources/file-interpreter/index.ts | 2 +- .../file-interpreter/from-pdf-scanned.test.ts | 44 --------- 24 files changed, 169 insertions(+), 222 deletions(-) create mode 100644 Brewfile delete mode 100755 bin/check-test-server create mode 100755 scripts/bootstrap rename build => scripts/build (84%) create mode 100755 scripts/lint create mode 100755 scripts/mock create mode 100755 scripts/test rename scripts/{ => utils}/check-is-in-git-install.sh (100%) rename scripts/{ => utils}/check-version.cjs (82%) rename scripts/{ => utils}/fix-index-exports.cjs (86%) rename scripts/{ => utils}/make-dist-package-json.cjs (87%) rename scripts/{ => utils}/postprocess-files.cjs (97%) delete mode 100644 tests/api-resources/file-interpreter/from-pdf-scanned.test.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86f853f..f6b6073 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,5 +28,21 @@ jobs: - name: Check types run: | yarn build + test: + name: test + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: '18' + + - name: Bootstrap + run: ./scripts/bootstrap + + - name: Run tests + run: ./scripts/test - diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 5244216..f6002f1 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Node uses: actions/setup-node@v3 diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 02a9c33..2853af7 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -10,7 +10,7 @@ jobs: if: github.repository == 'maisaai/node-sdk' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Check release environment run: | diff --git a/.gitignore b/.gitignore index 425a011..9a5858a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ node_modules yarn-error.log codegen.log +Brewfile.lock.json dist /deno /*.tgz diff --git a/.stats.yml b/.stats.yml index dd47305..9128fdb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1 +1,2 @@ -configured_endpoints: 14 +configured_endpoints: 13 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/maisa%2Fmaisa-c82e0a80b379d33d11af783865ec15844bcd750043bf0f1543ebdf72bda79f3a.yml diff --git a/Brewfile b/Brewfile new file mode 100644 index 0000000..e4feee6 --- /dev/null +++ b/Brewfile @@ -0,0 +1 @@ +brew "node" diff --git a/api.md b/api.md index 7eec7ea..eeb4e12 100644 --- a/api.md +++ b/api.md @@ -60,14 +60,6 @@ Methods: ## FromPdfScanned -Types: - -- FromPdfScannedCreateResponse - -Methods: - -- client.fileInterpreter.fromPdfScanned.create({ ...params }) -> unknown - ## FromDocx Types: diff --git a/bin/check-test-server b/bin/check-test-server deleted file mode 100755 index a6fa349..0000000 --- a/bin/check-test-server +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env bash - -RED='\033[0;31m' -GREEN='\033[0;32m' -YELLOW='\033[0;33m' -NC='\033[0m' # No Color - -function prism_is_running() { - curl --silent "http://localhost:4010" >/dev/null 2>&1 -} - -function is_overriding_api_base_url() { - [ -n "$TEST_API_BASE_URL" ] -} - -if is_overriding_api_base_url ; then - # If someone is running the tests against the live API, we can trust they know - # what they're doing and exit early. - echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}" - - exit 0 -elif prism_is_running ; then - echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}" - echo - - exit 0 -else - echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server" - echo -e "running against your OpenAPI spec." - echo - echo -e "${YELLOW}To fix:${NC}" - echo - echo -e "1. Install Prism (requires Node 16+):" - echo - echo -e " With npm:" - echo -e " \$ ${YELLOW}npm install -g @stoplight/prism-cli${NC}" - echo - echo -e " With yarn:" - echo -e " \$ ${YELLOW}yarn global add @stoplight/prism-cli${NC}" - echo - echo -e "2. Run the mock server" - echo - echo -e " To run the server, pass in the path of your OpenAPI" - echo -e " spec to the prism command:" - echo - echo -e " \$ ${YELLOW}prism mock path/to/your.openapi.yml${NC}" - echo - - exit 1 -fi diff --git a/jest.config.ts b/jest.config.ts index 1c4942a..dd3c6f5 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -17,6 +17,7 @@ const config: JestConfigWithTsJest = { '/deno/', '/deno_tests/', ], + testPathIgnorePatterns: ['scripts'], }; export default config; diff --git a/package.json b/package.json index af5f763..9163e57 100644 --- a/package.json +++ b/package.json @@ -14,14 +14,14 @@ ], "private": false, "scripts": { - "test": "bin/check-test-server && yarn jest", - "build": "bash ./build", + "test": "./scripts/test", + "build": "./scripts/build", "prepack": "echo 'to pack, run yarn build && (cd dist; yarn pack)' && exit 1", "prepublishOnly": "echo 'to publish, run yarn build && (cd dist; yarn publish)' && exit 1", "format": "prettier --write --cache --cache-strategy metadata . !dist", - "prepare": "if ./scripts/check-is-in-git-install.sh; then npm run build; fi", + "prepare": "if ./scripts/utils/check-is-in-git-install.sh; then ./scripts/build; fi", "tsn": "ts-node -r tsconfig-paths/register", - "lint": "eslint --ext ts,js .", + "lint": "./scripts/lint", "fix": "eslint --fix --ext ts,js ." }, "dependencies": { diff --git a/scripts/bootstrap b/scripts/bootstrap new file mode 100755 index 0000000..05dd47a --- /dev/null +++ b/scripts/bootstrap @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then + brew bundle check >/dev/null 2>&1 || { + echo "==> Installing Homebrew dependencies…" + brew bundle + } +fi + +echo "==> Installing Node dependencies…" + +PACKAGE_MANAGER=$(command -v yarn >/dev/null 2>&1 && echo "yarn" || echo "npm") + +$PACKAGE_MANAGER install diff --git a/build b/scripts/build similarity index 84% rename from build rename to scripts/build index e04ebb4..355144b 100755 --- a/build +++ b/scripts/build @@ -1,7 +1,10 @@ #!/usr/bin/env bash + set -exuo pipefail -node scripts/check-version.cjs +cd "$(dirname "$0")/.." + +node scripts/utils/check-version.cjs # Build into dist and will publish the package from there, # so that src/resources/foo.ts becomes /resources/foo.js @@ -22,7 +25,7 @@ if [ -e "bin/cli" ]; then fi # this converts the export map paths for the dist directory # and does a few other minor things -node scripts/make-dist-package-json.cjs > dist/package.json +node scripts/utils/make-dist-package-json.cjs > dist/package.json # build to .js/.mjs/.d.ts files npm exec tsc-multi @@ -32,7 +35,7 @@ cp src/_shims/auto/*.{d.ts,js,mjs} dist/_shims/auto # we need to add exports = module.exports = Maisa Node to index.js; # No way to get that from index.ts because it would cause compile errors # when building .mjs -node scripts/fix-index-exports.cjs +node scripts/utils/fix-index-exports.cjs # with "moduleResolution": "nodenext", if ESM resolves to index.d.ts, # it'll have TS errors on the default import. But if it resolves to # index.d.mts the default import will work (even though both files have @@ -40,14 +43,14 @@ node scripts/fix-index-exports.cjs cp dist/index.d.ts dist/index.d.mts cp tsconfig.dist-src.json dist/src/tsconfig.json -node scripts/postprocess-files.cjs +node scripts/utils/postprocess-files.cjs # make sure that nothing crashes when we require the output CJS or # import the output ESM (cd dist && node -e 'require("maisa")') (cd dist && node -e 'import("maisa")' --input-type=module) -if command -v deno &> /dev/null && [ -e ./build-deno ] +if command -v deno &> /dev/null && [ -e ./scripts/build-deno ] then - ./build-deno + ./scripts/build-deno fi diff --git a/scripts/lint b/scripts/lint new file mode 100755 index 0000000..4f05d66 --- /dev/null +++ b/scripts/lint @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +./node_modules/.bin/eslint --ext ts,js . diff --git a/scripts/mock b/scripts/mock new file mode 100755 index 0000000..fe89a1d --- /dev/null +++ b/scripts/mock @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +if [[ -n "$1" && "$1" != '--'* ]]; then + URL="$1" + shift +else + URL="$(grep 'openapi_spec_url' .stats.yml | cut -d' ' -f2)" +fi + +# Check if the URL is empty +if [ -z "$URL" ]; then + echo "Error: No OpenAPI spec path/url provided or found in .stats.yml" + exit 1 +fi + +echo "==> Starting mock server with URL ${URL}" + +# Run prism mock on the given spec +if [ "$1" == "--daemon" ]; then + npm exec --package=@stoplight/prism-cli@~5.8 -- prism mock "$URL" &> .prism.log & + + # Wait for server to come online + echo -n "Waiting for server" + while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do + echo -n "." + sleep 0.1 + done + + if grep -q "✖ fatal" ".prism.log"; then + cat .prism.log + exit 1 + fi + + echo +else + npm exec --package=@stoplight/prism-cli@~5.8 -- prism mock "$URL" +fi diff --git a/scripts/test b/scripts/test new file mode 100755 index 0000000..b62a7cc --- /dev/null +++ b/scripts/test @@ -0,0 +1,57 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[0;33m' +NC='\033[0m' # No Color + +function prism_is_running() { + curl --silent "http://localhost:4010" >/dev/null 2>&1 +} + +kill_server_on_port() { + pids=$(lsof -t -i tcp:"$1" || echo "") + if [ "$pids" != "" ]; then + kill "$pids" + echo "Stopped $pids." + fi +} + +function is_overriding_api_base_url() { + [ -n "$TEST_API_BASE_URL" ] +} + +if ! is_overriding_api_base_url && ! prism_is_running ; then + # When we exit this script, make sure to kill the background mock server process + trap 'kill_server_on_port 4010' EXIT + + # Start the dev server + ./scripts/mock --daemon +fi + +if is_overriding_api_base_url ; then + echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}" + echo +elif ! prism_is_running ; then + echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server" + echo -e "running against your OpenAPI spec." + echo + echo -e "To run the server, pass in the path or url of your OpenAPI" + echo -e "spec to the prism command:" + echo + echo -e " \$ ${YELLOW}npm exec --package=@stoplight/prism-cli@~5.3.2 -- prism mock path/to/your.openapi.yml${NC}" + echo + + exit 1 +else + echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}" + echo +fi + +# Run tests +echo "==> Running tests" +./node_modules/.bin/jest "$@" diff --git a/scripts/check-is-in-git-install.sh b/scripts/utils/check-is-in-git-install.sh similarity index 100% rename from scripts/check-is-in-git-install.sh rename to scripts/utils/check-is-in-git-install.sh diff --git a/scripts/check-version.cjs b/scripts/utils/check-version.cjs similarity index 82% rename from scripts/check-version.cjs rename to scripts/utils/check-version.cjs index 50a8566..86c56df 100644 --- a/scripts/check-version.cjs +++ b/scripts/utils/check-version.cjs @@ -2,14 +2,14 @@ const fs = require('fs'); const path = require('path'); const main = () => { - const pkg = require('../package.json'); + const pkg = require('../../package.json'); const version = pkg['version']; if (!version) throw 'The version property is not set in the package.json file'; if (typeof version !== 'string') { throw `Unexpected type for the package.json version field; got ${typeof version}, expected string`; } - const versionFile = path.resolve(__dirname, '..', 'src', 'version.ts'); + const versionFile = path.resolve(__dirname, '..', '..', 'src', 'version.ts'); const contents = fs.readFileSync(versionFile, 'utf8'); const output = contents.replace(/(export const VERSION = ')(.*)(')/g, `$1${version}$3`); fs.writeFileSync(versionFile, output); diff --git a/scripts/fix-index-exports.cjs b/scripts/utils/fix-index-exports.cjs similarity index 86% rename from scripts/fix-index-exports.cjs rename to scripts/utils/fix-index-exports.cjs index b61b2ea..72b0b8f 100644 --- a/scripts/fix-index-exports.cjs +++ b/scripts/utils/fix-index-exports.cjs @@ -4,7 +4,7 @@ const path = require('path'); const indexJs = process.env['DIST_PATH'] ? path.resolve(process.env['DIST_PATH'], 'index.js') - : path.resolve(__dirname, '..', 'dist', 'index.js'); + : path.resolve(__dirname, '..', '..', 'dist', 'index.js'); let before = fs.readFileSync(indexJs, 'utf8'); let after = before.replace( diff --git a/scripts/make-dist-package-json.cjs b/scripts/utils/make-dist-package-json.cjs similarity index 87% rename from scripts/make-dist-package-json.cjs rename to scripts/utils/make-dist-package-json.cjs index d4a0a69..7c24f56 100644 --- a/scripts/make-dist-package-json.cjs +++ b/scripts/utils/make-dist-package-json.cjs @@ -1,4 +1,4 @@ -const pkgJson = require(process.env['PKG_JSON_PATH'] || '../package.json'); +const pkgJson = require(process.env['PKG_JSON_PATH'] || '../../package.json'); function processExportMap(m) { for (const key in m) { diff --git a/scripts/postprocess-files.cjs b/scripts/utils/postprocess-files.cjs similarity index 97% rename from scripts/postprocess-files.cjs rename to scripts/utils/postprocess-files.cjs index c049563..32d670b 100644 --- a/scripts/postprocess-files.cjs +++ b/scripts/utils/postprocess-files.cjs @@ -2,12 +2,12 @@ const fs = require('fs'); const path = require('path'); const { parse } = require('@typescript-eslint/parser'); -const pkgImportPath = process.env['PKG_IMPORT_PATH'] ?? 'maisa/' +const pkgImportPath = process.env['PKG_IMPORT_PATH'] ?? 'maisa/'; const distDir = process.env['DIST_PATH'] ? path.resolve(process.env['DIST_PATH']) - : path.resolve(__dirname, '..', 'dist'); + : path.resolve(__dirname, '..', '..', 'dist'); const distSrcDir = path.join(distDir, 'src'); /** @@ -103,7 +103,7 @@ async function* walk(dir) { } async function postprocess() { - for await (const file of walk(path.resolve(__dirname, '..', 'dist'))) { + for await (const file of walk(path.resolve(__dirname, '..', '..', 'dist'))) { if (!/\.([cm]?js|(\.d)?[cm]?ts)$/.test(file)) continue; const code = await fs.promises.readFile(file, 'utf8'); diff --git a/src/resources/file-interpreter/file-interpreter.ts b/src/resources/file-interpreter/file-interpreter.ts index 87879e0..df69669 100644 --- a/src/resources/file-interpreter/file-interpreter.ts +++ b/src/resources/file-interpreter/file-interpreter.ts @@ -22,8 +22,6 @@ export namespace FileInterpreter { export import FromPdfCreateResponse = FromPdfAPI.FromPdfCreateResponse; export import FromPdfCreateParams = FromPdfAPI.FromPdfCreateParams; export import FromPdfScanned = FromPdfScannedAPI.FromPdfScanned; - export import FromPdfScannedCreateResponse = FromPdfScannedAPI.FromPdfScannedCreateResponse; - export import FromPdfScannedCreateParams = FromPdfScannedAPI.FromPdfScannedCreateParams; export import FromDocx = FromDocxAPI.FromDocx; export import FromDocxCreateResponse = FromDocxAPI.FromDocxCreateResponse; export import FromDocxCreateParams = FromDocxAPI.FromDocxCreateParams; diff --git a/src/resources/file-interpreter/from-pdf-scanned.ts b/src/resources/file-interpreter/from-pdf-scanned.ts index 558a569..e426aa1 100644 --- a/src/resources/file-interpreter/from-pdf-scanned.ts +++ b/src/resources/file-interpreter/from-pdf-scanned.ts @@ -1,100 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'maisa/core'; import { APIResource } from 'maisa/resource'; -import * as FromPdfScannedAPI from 'maisa/resources/file-interpreter/from-pdf-scanned'; -import { type Uploadable, multipartFormRequestOptions } from 'maisa/core'; -export class FromPdfScanned extends APIResource { - /** - * Interprets pdf file and returns some extracted variables. - */ - create(body: FromPdfScannedCreateParams, options?: Core.RequestOptions): Core.APIPromise { - return this._client.post( - '/v1/file-interpreter/from-pdf-scanned', - multipartFormRequestOptions({ body, ...options }), - ); - } -} - -export type FromPdfScannedCreateResponse = unknown; - -export interface FromPdfScannedCreateParams { - file: Uploadable; - - /** - * The language of the output. If not provided, the language used will be the same - * as the language of the text provided. - */ - lang?: 'en' | 'es' | 'pt' | 'fr' | 'de' | 'it' | 'nl' | 'sv' | 'pl' | 'ro'; - - /** - * The maximum number of pages to be extracted. - */ - max_pages?: number; - - /** - * The description of the variable. - */ - variable1_description?: string; - - /** - * The name of the variable to be extracted. - */ - variable1_name?: string; - - /** - * Text Extraction Request Variable Type. - */ - variable1_type?: 'string' | 'number' | 'date' | 'boolean'; - - /** - * The description of the variable. - */ - variable2_description?: string; - - /** - * The name of the variable to be extracted. - */ - variable2_name?: string; - - /** - * Text Extraction Request Variable Type. - */ - variable2_type?: 'string' | 'number' | 'date' | 'boolean'; - - /** - * The description of the variable. - */ - variable3_description?: string; - - /** - * The name of the variable to be extracted. - */ - variable3_name?: string; - - /** - * Text Extraction Request Variable Type. - */ - variable3_type?: 'string' | 'number' | 'date' | 'boolean'; - - /** - * The description of the variable. - */ - variable4_description?: string; - - /** - * The name of the variable to be extracted. - */ - variable4_name?: string; - - /** - * Text Extraction Request Variable Type. - */ - variable4_type?: 'string' | 'number' | 'date' | 'boolean'; -} - -export namespace FromPdfScanned { - export import FromPdfScannedCreateResponse = FromPdfScannedAPI.FromPdfScannedCreateResponse; - export import FromPdfScannedCreateParams = FromPdfScannedAPI.FromPdfScannedCreateParams; -} +export class FromPdfScanned extends APIResource {} diff --git a/src/resources/file-interpreter/index.ts b/src/resources/file-interpreter/index.ts index a69a17a..43c32da 100644 --- a/src/resources/file-interpreter/index.ts +++ b/src/resources/file-interpreter/index.ts @@ -6,4 +6,4 @@ export { FromDocxCreateResponse, FromDocxCreateParams, FromDocx } from './from-d export { FromHTMLCreateResponse, FromHTMLCreateParams, FromHTML } from './from-html'; export { FromImageCreateResponse, FromImageCreateParams, FromImage } from './from-image'; export { FromPdfCreateResponse, FromPdfCreateParams, FromPdf } from './from-pdf'; -export { FromPdfScannedCreateResponse, FromPdfScannedCreateParams, FromPdfScanned } from './from-pdf-scanned'; +export { FromPdfScanned } from './from-pdf-scanned'; diff --git a/tests/api-resources/file-interpreter/from-pdf-scanned.test.ts b/tests/api-resources/file-interpreter/from-pdf-scanned.test.ts deleted file mode 100644 index 4f9f89a..0000000 --- a/tests/api-resources/file-interpreter/from-pdf-scanned.test.ts +++ /dev/null @@ -1,44 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Maisa, { toFile } from 'maisa'; -import { Response } from 'node-fetch'; - -const maisa = new Maisa({ - apiKey: 'My API Key', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource fromPdfScanned', () => { - test('create: only required params', async () => { - const responsePromise = maisa.fileInterpreter.fromPdfScanned.create({ - file: await toFile(Buffer.from('# my file contents'), 'README.md'), - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('create: required and optional params', async () => { - const response = await maisa.fileInterpreter.fromPdfScanned.create({ - file: await toFile(Buffer.from('# my file contents'), 'README.md'), - lang: 'en', - max_pages: 0, - variable1_description: 'The name of the person.', - variable1_name: 'Name', - variable1_type: 'string', - variable2_description: 'The name of the person.', - variable2_name: 'Name', - variable2_type: 'string', - variable3_description: 'The name of the person.', - variable3_name: 'Name', - variable3_type: 'string', - variable4_description: 'The name of the person.', - variable4_name: 'Name', - variable4_type: 'string', - }); - }); -}); From 9d62f6432e15ec16cdcb8b4f8e62ba54a6df3ba0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 May 2024 11:54:58 +0000 Subject: [PATCH 003/109] chore: rebuild project due to oas spec rename (#15) --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 9128fdb..4076c46 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 13 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/maisa%2Fmaisa-c82e0a80b379d33d11af783865ec15844bcd750043bf0f1543ebdf72bda79f3a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/maisa%2FMaisa-c82e0a80b379d33d11af783865ec15844bcd750043bf0f1543ebdf72bda79f3a.yml From df79224bb82acaee52c77de6bbc473be110e97d2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 4 Nov 2024 19:48:37 +0000 Subject: [PATCH 004/109] chore: rebuild project due to codegen change (#16) --- .github/workflows/ci.yml | 28 ++- .github/workflows/release-doctor.yml | 3 + .gitignore | 3 +- CONTRIBUTING.md | 54 ++--- README.md | 44 ++-- SECURITY.md | 27 +++ bin/check-release-environment | 14 +- bin/publish-npm | 20 +- package.json | 9 +- scripts/build | 2 +- scripts/format | 8 + scripts/lint | 6 +- scripts/mock | 4 +- scripts/test | 1 - src/_shims/node-runtime.ts | 4 +- src/_shims/node-types.d.ts | 2 +- src/core.ts | 92 ++++++-- src/error.ts | 6 +- src/index.ts | 60 ++++-- src/resources/capabilities/capabilities.ts | 33 +-- src/resources/capabilities/index.ts | 8 +- src/resources/capabilities/media.ts | 32 +-- .../file-interpreter/file-interpreter.ts | 76 ++++--- src/resources/file-interpreter/from-audio.ts | 18 +- src/resources/file-interpreter/from-docx.ts | 18 +- src/resources/file-interpreter/from-html.ts | 18 +- src/resources/file-interpreter/from-image.ts | 18 +- .../file-interpreter/from-pdf-scanned.ts | 2 +- src/resources/file-interpreter/from-pdf.ts | 18 +- src/resources/file-interpreter/index.ts | 10 +- src/resources/index.ts | 8 +- src/resources/kpu.ts | 15 +- src/resources/mainet/mainet.ts | 11 +- src/resources/mainet/search.ts | 2 +- src/resources/models/embeddings.ts | 10 +- src/resources/models/index.ts | 2 +- src/resources/models/models.ts | 18 +- src/resources/models/rerank.ts | 2 +- src/uploads.ts | 15 +- .../capabilities/capabilities.test.ts | 24 +-- .../api-resources/capabilities/media.test.ts | 14 +- .../file-interpreter/from-audio.test.ts | 6 +- .../file-interpreter/from-docx.test.ts | 6 +- .../file-interpreter/from-html.test.ts | 6 +- .../file-interpreter/from-image.test.ts | 6 +- .../file-interpreter/from-pdf.test.ts | 6 +- tests/api-resources/kpu.test.ts | 10 +- tests/api-resources/models/embeddings.test.ts | 6 +- tests/index.test.ts | 116 +++++++++++ tests/stringifyQuery.test.ts | 9 +- tests/uploads.test.ts | 8 + tsconfig.deno.json | 11 +- tsconfig.json | 3 +- yarn.lock | 197 +++++++++--------- 54 files changed, 728 insertions(+), 421 deletions(-) create mode 100644 SECURITY.md create mode 100755 scripts/format diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6b6073..e3530dc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,7 @@ on: pull_request: branches: - main + - next jobs: lint: @@ -21,13 +22,30 @@ jobs: with: node-version: '18' - - name: Install dependencies - run: | - yarn install + - name: Bootstrap + run: ./scripts/bootstrap - name: Check types - run: | - yarn build + run: ./scripts/lint + + build: + name: build + runs-on: ubuntu-latest + + + steps: + - uses: actions/checkout@v4 + + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: '18' + + - name: Bootstrap + run: ./scripts/bootstrap + + - name: Check build + run: ./scripts/build test: name: test runs-on: ubuntu-latest diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 2853af7..56b7304 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -1,6 +1,8 @@ name: Release Doctor on: pull_request: + branches: + - main workflow_dispatch: jobs: @@ -17,3 +19,4 @@ jobs: bash ./bin/check-release-environment env: NPM_TOKEN: ${{ secrets.MAISA_NPM_TOKEN || secrets.NPM_TOKEN }} + diff --git a/.gitignore b/.gitignore index 9a5858a..d98d51a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,10 @@ +.prism.log node_modules yarn-error.log codegen.log Brewfile.lock.json dist -/deno +dist-deno /*.tgz .idea/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dfd915c..4d24ab8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -5,24 +5,24 @@ Other package managers may work but are not officially supported for development To set up the repository, run: -```bash -yarn -yarn build +```sh +$ yarn +$ yarn build ``` This will install all the required dependencies and build output files to `dist/`. ## Modifying/Adding code -Most of the SDK is generated code, and any modified code will be overridden on the next generation. The -`src/lib/` and `examples/` directories are exceptions and will never be overridden. +Most of the SDK is generated code. Modifications to code will be persisted between generations, but may +result in merge conflicts between manual patches and changes from the generator. The generator will never +modify the contents of the `src/lib/` and `examples/` directories. ## Adding and running examples -All files in the `examples/` directory are not modified by the Stainless generator and can be freely edited or -added to. +All files in the `examples/` directory are not modified by the generator and can be freely edited or added to. -```bash +```ts // add an example to examples/.ts #!/usr/bin/env -S npm run tsn -T @@ -41,38 +41,38 @@ If you’d like to use the repository from source, you can either install from g To install via git: -```bash -npm install git+ssh://git@github.com:maisaai/node-sdk.git +```sh +$ npm install git+ssh://git@github.com:maisaai/node-sdk.git ``` Alternatively, to link a local copy of the repo: -```bash +```sh # Clone -git clone https://www.github.com/maisaai/node-sdk -cd node-sdk +$ git clone https://www.github.com/maisaai/node-sdk +$ cd node-sdk # With yarn -yarn link -cd ../my-package -yarn link maisa +$ yarn link +$ cd ../my-package +$ yarn link maisa # With pnpm -pnpm link --global -cd ../my-package -pnpm link -—global maisa +$ pnpm link --global +$ cd ../my-package +$ pnpm link -—global maisa ``` ## Running tests Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests. -```bash -npx prism mock path/to/your/openapi.yml +```sh +$ npx prism mock path/to/your/openapi.yml ``` -```bash -yarn run test +```sh +$ yarn run test ``` ## Linting and formatting @@ -82,14 +82,14 @@ This repository uses [prettier](https://www.npmjs.com/package/prettier) and To lint: -```bash -yarn lint +```sh +$ yarn lint ``` To format and fix all lint issues automatically: -```bash -yarn fix +```sh +$ yarn fix ``` ## Publishing and releases diff --git a/README.md b/README.md index a81e54d..0e0f5a6 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # Maisa Node API Library -[![NPM version](https://img.shields.io/npm/v/maisa.svg)](https://npmjs.org/package/maisa) +[![NPM version](https://img.shields.io/npm/v/maisa.svg)](https://npmjs.org/package/maisa) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/maisa) This library provides convenient access to the Maisa REST API from server-side TypeScript or JavaScript. -The REST API documentation can be found [on docs.maisa.ai](https://docs.maisa.ai/). The full API of this library can be found in [api.md](api.md). +The REST API documentation can be found on [docs.maisa.ai](https://docs.maisa.ai/). The full API of this library can be found in [api.md](api.md). It is generated with [Stainless](https://www.stainlessapi.com/). @@ -22,10 +22,10 @@ The full API of this library can be found in [api.md](api.md). ```js import Maisa from 'maisa'; -const maisa = new Maisa(); +const client = new Maisa(); async function main() { - const textSummary = await maisa.capabilities.summarize({ text: 'Example long text...' }); + const textSummary = await client.capabilities.summarize({ text: 'Example long text...' }); console.log(textSummary.summary); } @@ -41,11 +41,11 @@ This library includes TypeScript definitions for all request params and response ```ts import Maisa from 'maisa'; -const maisa = new Maisa(); +const client = new Maisa(); async function main() { const params: Maisa.CapabilitySummarizeParams = { text: 'Example long text...' }; - const textSummary: Maisa.TextSummary = await maisa.capabilities.summarize(params); + const textSummary: Maisa.TextSummary = await client.capabilities.summarize(params); } main(); @@ -62,7 +62,7 @@ a subclass of `APIError` will be thrown: ```ts async function main() { - const textSummary = await maisa.capabilities + const textSummary = await client.capabilities .summarize({ text: 'Example long text...' }) .catch(async (err) => { if (err instanceof Maisa.APIError) { @@ -102,12 +102,12 @@ You can use the `maxRetries` option to configure or disable this: ```js // Configure the default for all requests: -const maisa = new Maisa({ +const client = new Maisa({ maxRetries: 0, // default is 2 }); // Or, configure per-request: -await maisa.capabilities.summarize({ text: 'Example long text...' }, { +await client.capabilities.summarize({ text: 'Example long text...' }, { maxRetries: 5, }); ``` @@ -119,12 +119,12 @@ Requests time out after 1 minute by default. You can configure this with a `time ```ts // Configure the default for all requests: -const maisa = new Maisa({ +const client = new Maisa({ timeout: 20 * 1000, // 20 seconds (default is 1 minute) }); // Override per-request: -await maisa.capabilities.summarize({ text: 'Example long text...' }, { +await client.capabilities.summarize({ text: 'Example long text...' }, { timeout: 5 * 1000, }); ``` @@ -143,13 +143,13 @@ You can also use the `.withResponse()` method to get the raw `Response` along wi ```ts -const maisa = new Maisa(); +const client = new Maisa(); -const response = await maisa.capabilities.summarize({ text: 'Example long text...' }).asResponse(); +const response = await client.capabilities.summarize({ text: 'Example long text...' }).asResponse(); console.log(response.headers.get('X-My-Header')); console.log(response.statusText); // access the underlying Response object -const { data: textSummary, response: raw } = await maisa.capabilities +const { data: textSummary, response: raw } = await client.capabilities .summarize({ text: 'Example long text...' }) .withResponse(); console.log(raw.headers.get('X-My-Header')); @@ -252,12 +252,12 @@ import http from 'http'; import { HttpsProxyAgent } from 'https-proxy-agent'; // Configure the default for all requests: -const maisa = new Maisa({ +const client = new Maisa({ httpAgent: new HttpsProxyAgent(process.env.PROXY_URL), }); // Override per-request: -await maisa.capabilities.summarize( +await client.capabilities.summarize( { text: 'Example long text...' }, { httpAgent: new http.Agent({ keepAlive: false }), @@ -283,14 +283,10 @@ TypeScript >= 4.5 is supported. The following runtimes are supported: -- Node.js 18 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions. -- Deno v1.28.0 or higher, using `import Maisa from "npm:maisa"`. -- Bun 1.0 or later. -- Cloudflare Workers. -- Vercel Edge Runtime. -- Jest 28 or greater with the `"node"` environment (`"jsdom"` is not supported at this time). -- Nitro v2.6 or greater. - Note that React Native is not supported at this time. If you are interested in other runtime environments, please open or upvote an issue on GitHub. + +## Contributing + +See [the contributing documentation](./CONTRIBUTING.md). diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..459e731 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,27 @@ +# Security Policy + +## Reporting Security Issues + +This SDK is generated by [Stainless Software Inc](http://stainlessapi.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken. + +To report a security issue, please contact the Stainless team at security@stainlessapi.com. + +## Responsible Disclosure + +We appreciate the efforts of security researchers and individuals who help us maintain the security of +SDKs we generate. If you believe you have found a security vulnerability, please adhere to responsible +disclosure practices by allowing us a reasonable amount of time to investigate and address the issue +before making any information public. + +## Reporting Non-SDK Related Security Issues + +If you encounter security issues that are not directly related to SDKs but pertain to the services +or products provided by Maisa please follow the respective company's security reporting guidelines. + +### Maisa Terms and Policies + +Please contact support@maisa.ai for any questions or concerns regarding security of our services. + +--- + +Thank you for helping us keep the SDKs and systems they interact with secure. diff --git a/bin/check-release-environment b/bin/check-release-environment index c87f23b..85f403d 100644 --- a/bin/check-release-environment +++ b/bin/check-release-environment @@ -1,20 +1,9 @@ #!/usr/bin/env bash -warnings=() errors=() if [ -z "${NPM_TOKEN}" ]; then - warnings+=("The MAISA_NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets") -fi - -lenWarnings=${#warnings[@]} - -if [[ lenWarnings -gt 0 ]]; then - echo -e "Found the following warnings in the release environment:\n" - - for warning in "${warnings[@]}"; do - echo -e "- $warning\n" - done + errors+=("The MAISA_NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets") fi lenErrors=${#errors[@]} @@ -30,3 +19,4 @@ if [[ lenErrors -gt 0 ]]; then fi echo "The environment is ready to push releases!" + diff --git a/bin/publish-npm b/bin/publish-npm index 4d6c9f3..4c21181 100644 --- a/bin/publish-npm +++ b/bin/publish-npm @@ -2,8 +2,24 @@ set -eux -npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN +npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN" +# Build the project yarn build + +# Navigate to the dist directory cd dist -yarn publish --access public + +# Get the version from package.json +VERSION="$(node -p "require('./package.json').version")" + +# Extract the pre-release tag if it exists +if [[ "$VERSION" =~ -([a-zA-Z]+) ]]; then + # Extract the part before any dot in the pre-release identifier + TAG="${BASH_REMATCH[1]}" +else + TAG="latest" +fi + +# Publish with the appropriate tag +yarn publish --access public --tag "$TAG" diff --git a/package.json b/package.json index 9163e57..0965d3a 100644 --- a/package.json +++ b/package.json @@ -10,19 +10,18 @@ "license": "Apache-2.0", "packageManager": "yarn@1.22.22", "files": [ - "*" + "**/*" ], "private": false, "scripts": { "test": "./scripts/test", "build": "./scripts/build", - "prepack": "echo 'to pack, run yarn build && (cd dist; yarn pack)' && exit 1", "prepublishOnly": "echo 'to publish, run yarn build && (cd dist; yarn publish)' && exit 1", "format": "prettier --write --cache --cache-strategy metadata . !dist", "prepare": "if ./scripts/utils/check-is-in-git-install.sh; then ./scripts/build; fi", "tsn": "ts-node -r tsconfig-paths/register", "lint": "./scripts/lint", - "fix": "eslint --fix --ext ts,js ." + "fix": "./scripts/format" }, "dependencies": { "@types/node": "^18.11.18", @@ -31,8 +30,7 @@ "agentkeepalive": "^4.2.1", "form-data-encoder": "1.7.2", "formdata-node": "^4.3.2", - "node-fetch": "^2.6.7", - "web-streams-polyfill": "^3.2.1" + "node-fetch": "^2.6.7" }, "devDependencies": { "@swc/core": "^1.3.102", @@ -43,6 +41,7 @@ "eslint": "^8.49.0", "eslint-plugin-prettier": "^5.0.1", "eslint-plugin-unused-imports": "^3.0.0", + "iconv-lite": "^0.6.3", "jest": "^29.4.0", "prettier": "^3.0.0", "ts-jest": "^29.1.0", diff --git a/scripts/build b/scripts/build index 355144b..7cf7680 100755 --- a/scripts/build +++ b/scripts/build @@ -50,7 +50,7 @@ node scripts/utils/postprocess-files.cjs (cd dist && node -e 'require("maisa")') (cd dist && node -e 'import("maisa")' --input-type=module) -if command -v deno &> /dev/null && [ -e ./scripts/build-deno ] +if [ -e ./scripts/build-deno ] then ./scripts/build-deno fi diff --git a/scripts/format b/scripts/format new file mode 100755 index 0000000..a6bb9d0 --- /dev/null +++ b/scripts/format @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +echo "==> Running eslint --fix" +ESLINT_USE_FLAT_CONFIG="false" ./node_modules/.bin/eslint --fix --ext ts,js . diff --git a/scripts/lint b/scripts/lint index 4f05d66..6ba75df 100755 --- a/scripts/lint +++ b/scripts/lint @@ -4,4 +4,8 @@ set -e cd "$(dirname "$0")/.." -./node_modules/.bin/eslint --ext ts,js . +echo "==> Running eslint" +ESLINT_USE_FLAT_CONFIG="false" ./node_modules/.bin/eslint --ext ts,js . + +echo "==> Running tsc" +./node_modules/.bin/tsc --noEmit diff --git a/scripts/mock b/scripts/mock index fe89a1d..d2814ae 100755 --- a/scripts/mock +++ b/scripts/mock @@ -21,7 +21,7 @@ echo "==> Starting mock server with URL ${URL}" # Run prism mock on the given spec if [ "$1" == "--daemon" ]; then - npm exec --package=@stoplight/prism-cli@~5.8 -- prism mock "$URL" &> .prism.log & + npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" &> .prism.log & # Wait for server to come online echo -n "Waiting for server" @@ -37,5 +37,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stoplight/prism-cli@~5.8 -- prism mock "$URL" + npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" fi diff --git a/scripts/test b/scripts/test index b62a7cc..2049e31 100755 --- a/scripts/test +++ b/scripts/test @@ -52,6 +52,5 @@ else echo fi -# Run tests echo "==> Running tests" ./node_modules/.bin/jest "$@" diff --git a/src/_shims/node-runtime.ts b/src/_shims/node-runtime.ts index a9c42eb..ab9f2ab 100644 --- a/src/_shims/node-runtime.ts +++ b/src/_shims/node-runtime.ts @@ -13,9 +13,7 @@ import { Readable } from 'node:stream'; import { type RequestOptions } from '../core'; import { MultipartBody } from './MultipartBody'; import { type Shims } from './registry'; - -// @ts-ignore (this package does not have proper export maps for this export) -import { ReadableStream } from 'web-streams-polyfill/dist/ponyfill.es2018.js'; +import { ReadableStream } from 'node:stream/web'; type FileFromPathOptions = Omit; diff --git a/src/_shims/node-types.d.ts b/src/_shims/node-types.d.ts index b31698f..c159e5f 100644 --- a/src/_shims/node-types.d.ts +++ b/src/_shims/node-types.d.ts @@ -7,7 +7,7 @@ import * as fd from 'formdata-node'; export { type Agent } from 'node:http'; export { type Readable } from 'node:stream'; export { type ReadStream as FsReadStream } from 'node:fs'; -export { ReadableStream } from 'web-streams-polyfill'; +export { ReadableStream } from 'node:stream/web'; export const fetch: typeof nf.default; diff --git a/src/core.ts b/src/core.ts index b19f1dc..4863807 100644 --- a/src/core.ts +++ b/src/core.ts @@ -18,7 +18,7 @@ import { type HeadersInit, } from './_shims/index'; export { type Response }; -import { isMultipartBody } from './uploads'; +import { BlobLike, isBlobLike, isMultipartBody } from './uploads'; export { maybeMultipartFormRequestOptions, multipartFormRequestOptions, @@ -84,8 +84,10 @@ export class APIPromise extends Promise { }); } - _thenUnwrap(transform: (data: T) => U): APIPromise { - return new APIPromise(this.responsePromise, async (props) => transform(await this.parseResponse(props))); + _thenUnwrap(transform: (data: T, props: APIResponseProps) => U): APIPromise { + return new APIPromise(this.responsePromise, async (props) => + transform(await this.parseResponse(props), props), + ); } /** @@ -235,7 +237,17 @@ export abstract class APIClient { path: string, opts?: PromiseOrValue>, ): APIPromise { - return this.request(Promise.resolve(opts).then((opts) => ({ method, path, ...opts }))); + return this.request( + Promise.resolve(opts).then(async (opts) => { + const body = + opts && isBlobLike(opts?.body) ? new DataView(await opts.body.arrayBuffer()) + : opts?.body instanceof DataView ? opts.body + : opts?.body instanceof ArrayBuffer ? new DataView(opts.body) + : opts && ArrayBuffer.isView(opts?.body) ? new DataView(opts.body.buffer) + : opts?.body; + return { method, path, ...opts, body }; + }), + ); } getAPIList = AbstractPage>( @@ -257,16 +269,23 @@ export abstract class APIClient { const encoded = encoder.encode(body); return encoded.length.toString(); } + } else if (ArrayBuffer.isView(body)) { + return body.byteLength.toString(); } return null; } - buildRequest(options: FinalRequestOptions): { req: RequestInit; url: string; timeout: number } { + buildRequest( + options: FinalRequestOptions, + { retryCount = 0 }: { retryCount?: number } = {}, + ): { req: RequestInit; url: string; timeout: number } { const { method, path, query, headers: headers = {} } = options; const body = - isMultipartBody(options.body) ? options.body.body + ArrayBuffer.isView(options.body) || (options.__binaryRequest && typeof options.body === 'string') ? + options.body + : isMultipartBody(options.body) ? options.body.body : options.body ? JSON.stringify(options.body, null, 2) : null; const contentLength = this.calculateContentLength(body); @@ -292,7 +311,7 @@ export abstract class APIClient { headers[this.idempotencyHeader] = options.idempotencyKey; } - const reqHeaders = this.buildHeaders({ options, headers, contentLength }); + const reqHeaders = this.buildHeaders({ options, headers, contentLength, retryCount }); const req: RequestInit = { method, @@ -311,10 +330,12 @@ export abstract class APIClient { options, headers, contentLength, + retryCount, }: { options: FinalRequestOptions; headers: Record; contentLength: string | null | undefined; + retryCount: number; }): Record { const reqHeaders: Record = {}; if (contentLength) { @@ -330,6 +351,16 @@ export abstract class APIClient { delete reqHeaders['content-type']; } + // Don't set the retry count header if it was already set or removed through default headers or by the + // caller. We check `defaultHeaders` and `headers`, which can contain nulls, instead of `reqHeaders` to + // account for the removal case. + if ( + getHeader(defaultHeaders, 'x-stainless-retry-count') === undefined && + getHeader(headers, 'x-stainless-retry-count') === undefined + ) { + reqHeaders['x-stainless-retry-count'] = String(retryCount); + } + this.validateHeaders(reqHeaders, headers); return reqHeaders; @@ -365,7 +396,7 @@ export abstract class APIClient { error: Object | undefined, message: string | undefined, headers: Headers | undefined, - ) { + ): APIError { return APIError.generate(status, error, message, headers); } @@ -381,13 +412,14 @@ export abstract class APIClient { retriesRemaining: number | null, ): Promise { const options = await optionsInput; + const maxRetries = options.maxRetries ?? this.maxRetries; if (retriesRemaining == null) { - retriesRemaining = options.maxRetries ?? this.maxRetries; + retriesRemaining = maxRetries; } await this.prepareOptions(options); - const { req, url, timeout } = this.buildRequest(options); + const { req, url, timeout } = this.buildRequest(options, { retryCount: maxRetries - retriesRemaining }); await this.prepareRequest(req, { url, options }); @@ -636,9 +668,9 @@ export abstract class AbstractPage implements AsyncIterable { return await this.#client.requestAPIList(this.constructor as any, nextOptions); } - async *iterPages() { + async *iterPages(): AsyncGenerator { // eslint-disable-next-line @typescript-eslint/no-this-alias - let page: AbstractPage = this; + let page: this = this; yield page; while (page.hasNextPage()) { page = await page.getNextPage(); @@ -646,7 +678,7 @@ export abstract class AbstractPage implements AsyncIterable { } } - async *[Symbol.asyncIterator]() { + async *[Symbol.asyncIterator](): AsyncGenerator { for await (const page of this.iterPages()) { for (const item of page.getPaginatedItems()) { yield item; @@ -689,7 +721,7 @@ export class PagePromise< * console.log(item) * } */ - async *[Symbol.asyncIterator]() { + async *[Symbol.asyncIterator](): AsyncGenerator { const page = await this; for await (const item of page) { yield item; @@ -721,7 +753,9 @@ export type Headers = Record; export type DefaultQuery = Record; export type KeysEnum = { [P in keyof Required]: true }; -export type RequestOptions | Readable> = { +export type RequestOptions< + Req = unknown | Record | Readable | BlobLike | ArrayBufferView | ArrayBuffer, +> = { method?: HTTPMethod; path?: string; query?: Req | undefined; @@ -735,6 +769,7 @@ export type RequestOptions | Readable> = signal?: AbortSignal | undefined | null; idempotencyKey?: string; + __binaryRequest?: boolean | undefined; __binaryResponse?: boolean | undefined; }; @@ -755,6 +790,7 @@ const requestOptionsKeys: KeysEnum = { signal: true, idempotencyKey: true, + __binaryRequest: true, __binaryResponse: true, }; @@ -767,10 +803,11 @@ export const isRequestOptions = (obj: unknown): obj is RequestOptions => { ); }; -export type FinalRequestOptions | Readable> = RequestOptions & { - method: HTTPMethod; - path: string; -}; +export type FinalRequestOptions | Readable | DataView> = + RequestOptions & { + method: HTTPMethod; + path: string; + }; declare const Deno: any; declare const EdgeRuntime: any; @@ -959,6 +996,11 @@ const validatePositiveInteger = (name: string, n: unknown): number => { export const castToError = (err: any): Error => { if (err instanceof Error) return err; + if (typeof err === 'object' && err !== null) { + try { + return new Error(JSON.stringify(err)); + } catch {} + } return new Error(err); }; @@ -1096,7 +1138,15 @@ export const isHeadersProtocol = (headers: any): headers is HeadersProtocol => { return typeof headers?.get === 'function'; }; -export const getRequiredHeader = (headers: HeadersLike, header: string): string => { +export const getRequiredHeader = (headers: HeadersLike | Headers, header: string): string => { + const foundHeader = getHeader(headers, header); + if (foundHeader === undefined) { + throw new Error(`Could not find ${header} header`); + } + return foundHeader; +}; + +export const getHeader = (headers: HeadersLike | Headers, header: string): string | undefined => { const lowerCasedHeader = header.toLowerCase(); if (isHeadersProtocol(headers)) { // to deal with the case where the header looks like Stainless-Event-Id @@ -1122,7 +1172,7 @@ export const getRequiredHeader = (headers: HeadersLike, header: string): string } } - throw new Error(`Could not find ${header} header`); + return undefined; }; /** diff --git a/src/error.ts b/src/error.ts index f0e7fef..9ceebf9 100644 --- a/src/error.ts +++ b/src/error.ts @@ -47,9 +47,9 @@ export class APIError extends MaisaError { errorResponse: Object | undefined, message: string | undefined, headers: Headers | undefined, - ) { + ): APIError { if (!status) { - return new APIConnectionError({ cause: castToError(errorResponse) }); + return new APIConnectionError({ message, cause: castToError(errorResponse) }); } const error = errorResponse as Record; @@ -101,7 +101,7 @@ export class APIUserAbortError extends APIError { export class APIConnectionError extends APIError { override readonly status: undefined = undefined; - constructor({ message, cause }: { message?: string; cause?: Error | undefined }) { + constructor({ message, cause }: { message?: string | undefined; cause?: Error | undefined }) { super(undefined, undefined, message || 'Connection error.', undefined); // in some environments the 'cause' property is already declared // @ts-ignore diff --git a/src/index.ts b/src/index.ts index f289424..76947d0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,10 +1,20 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +import { type Agent } from './_shims/index'; import * as Core from './core'; import * as Errors from './error'; -import { type Agent } from './_shims/index'; import * as Uploads from './uploads'; -import * as API from 'maisa/resources/index'; +import * as API from './resources/index'; +import { Kpu, KpuRunParams, KpuRunResponse } from './resources/kpu'; +import { + Capabilities, + CapabilityCompareParams, + CapabilityExtractParams, + CapabilitySummarizeParams, +} from './resources/capabilities/capabilities'; +import { FileInterpreter } from './resources/file-interpreter/file-interpreter'; +import { Mainet } from './resources/mainet/mainet'; +import { Models } from './resources/models/models'; export interface ClientOptions { /** @@ -69,7 +79,9 @@ export interface ClientOptions { defaultQuery?: Core.DefaultQuery; } -/** API Client for interfacing with the Maisa API. */ +/** + * API Client for interfacing with the Maisa API. + */ export class Maisa extends Core.APIClient { apiKey: string; @@ -111,6 +123,7 @@ export class Maisa extends Core.APIClient { maxRetries: options.maxRetries, fetch: options.fetch, }); + this._options = options; this.apiKey = apiKey; @@ -138,6 +151,7 @@ export class Maisa extends Core.APIClient { } static Maisa = this; + static DEFAULT_TIMEOUT = 60000; // 1 minute static MaisaError = Errors.MaisaError; static APIError = Errors.APIError; @@ -157,7 +171,7 @@ export class Maisa extends Core.APIClient { static fileFromPath = Uploads.fileFromPath; } -export const { +export { MaisaError, APIError, APIConnectionError, @@ -171,32 +185,38 @@ export const { InternalServerError, PermissionDeniedError, UnprocessableEntityError, -} = Errors; +} from './error'; export import toFile = Uploads.toFile; export import fileFromPath = Uploads.fileFromPath; -export namespace Maisa { - export import RequestOptions = Core.RequestOptions; +Maisa.Capabilities = Capabilities; +Maisa.Models = Models; +Maisa.Kpu = Kpu; +Maisa.FileInterpreter = FileInterpreter; +Maisa.Mainet = Mainet; + +export declare namespace Maisa { + export type RequestOptions = Core.RequestOptions; - export import Capabilities = API.Capabilities; - export import CapabilityCompareParams = API.CapabilityCompareParams; - export import CapabilityExtractParams = API.CapabilityExtractParams; - export import CapabilitySummarizeParams = API.CapabilitySummarizeParams; + export { + Capabilities as Capabilities, + type CapabilityCompareParams as CapabilityCompareParams, + type CapabilityExtractParams as CapabilityExtractParams, + type CapabilitySummarizeParams as CapabilitySummarizeParams, + }; - export import Models = API.Models; + export { Models as Models }; - export import Kpu = API.Kpu; - export import KpuRunResponse = API.KpuRunResponse; - export import KpuRunParams = API.KpuRunParams; + export { Kpu as Kpu, type KpuRunResponse as KpuRunResponse, type KpuRunParams as KpuRunParams }; - export import FileInterpreter = API.FileInterpreter; + export { FileInterpreter as FileInterpreter }; - export import Mainet = API.Mainet; + export { Mainet as Mainet }; - export import TextComparator = API.TextComparator; - export import TextExtractor = API.TextExtractor; - export import TextSummary = API.TextSummary; + export type TextComparator = API.TextComparator; + export type TextExtractor = API.TextExtractor; + export type TextSummary = API.TextSummary; } export default Maisa; diff --git a/src/resources/capabilities/capabilities.ts b/src/resources/capabilities/capabilities.ts index 1c0a2e9..b9e2fac 100644 --- a/src/resources/capabilities/capabilities.ts +++ b/src/resources/capabilities/capabilities.ts @@ -1,10 +1,10 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'maisa/core'; -import { APIResource } from 'maisa/resource'; -import * as CapabilitiesAPI from 'maisa/resources/capabilities/capabilities'; -import * as Shared from 'maisa/resources/shared'; -import * as MediaAPI from 'maisa/resources/capabilities/media'; +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import * as Shared from '../shared'; +import * as MediaAPI from './media'; +import { Media, MediaCompareParams, MediaExtractParams, MediaSummarizeParams } from './media'; export class Capabilities extends APIResource { media: MediaAPI.Media = new MediaAPI.Media(this._client); @@ -147,12 +147,19 @@ export interface CapabilitySummarizeParams { summary_hint?: string; } -export namespace Capabilities { - export import CapabilityCompareParams = CapabilitiesAPI.CapabilityCompareParams; - export import CapabilityExtractParams = CapabilitiesAPI.CapabilityExtractParams; - export import CapabilitySummarizeParams = CapabilitiesAPI.CapabilitySummarizeParams; - export import Media = MediaAPI.Media; - export import MediaCompareParams = MediaAPI.MediaCompareParams; - export import MediaExtractParams = MediaAPI.MediaExtractParams; - export import MediaSummarizeParams = MediaAPI.MediaSummarizeParams; +Capabilities.Media = Media; + +export declare namespace Capabilities { + export { + type CapabilityCompareParams as CapabilityCompareParams, + type CapabilityExtractParams as CapabilityExtractParams, + type CapabilitySummarizeParams as CapabilitySummarizeParams, + }; + + export { + Media as Media, + type MediaCompareParams as MediaCompareParams, + type MediaExtractParams as MediaExtractParams, + type MediaSummarizeParams as MediaSummarizeParams, + }; } diff --git a/src/resources/capabilities/index.ts b/src/resources/capabilities/index.ts index eb02778..44372af 100644 --- a/src/resources/capabilities/index.ts +++ b/src/resources/capabilities/index.ts @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { - CapabilityCompareParams, - CapabilityExtractParams, - CapabilitySummarizeParams, Capabilities, + type CapabilityCompareParams, + type CapabilityExtractParams, + type CapabilitySummarizeParams, } from './capabilities'; -export { MediaCompareParams, MediaExtractParams, MediaSummarizeParams, Media } from './media'; +export { Media, type MediaCompareParams, type MediaExtractParams, type MediaSummarizeParams } from './media'; diff --git a/src/resources/capabilities/media.ts b/src/resources/capabilities/media.ts index 140f1ec..a859f1f 100644 --- a/src/resources/capabilities/media.ts +++ b/src/resources/capabilities/media.ts @@ -1,10 +1,8 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'maisa/core'; -import { APIResource } from 'maisa/resource'; -import * as MediaAPI from 'maisa/resources/capabilities/media'; -import * as Shared from 'maisa/resources/shared'; -import { type Uploadable, multipartFormRequestOptions } from 'maisa/core'; +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import * as Shared from '../shared'; export class Media extends APIResource { /** @@ -15,7 +13,7 @@ export class Media extends APIResource { compare(body: MediaCompareParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post( '/v1/capabilities/compare/media', - multipartFormRequestOptions({ body, ...options }), + Core.multipartFormRequestOptions({ body, ...options }), ); } @@ -27,7 +25,7 @@ export class Media extends APIResource { extract(body: MediaExtractParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post( '/v1/capabilities/extract/media', - multipartFormRequestOptions({ body, ...options }), + Core.multipartFormRequestOptions({ body, ...options }), ); } @@ -39,15 +37,15 @@ export class Media extends APIResource { summarize(body: MediaSummarizeParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post( '/v1/capabilities/summarize/media', - multipartFormRequestOptions({ body, ...options }), + Core.multipartFormRequestOptions({ body, ...options }), ); } } export interface MediaCompareParams { - file1: Uploadable; + file1: Core.Uploadable; - file2: Uploadable; + file2: Core.Uploadable; /** * The language of the output. If not provided, the language used will be the same @@ -122,7 +120,7 @@ export interface MediaCompareParams { } export interface MediaExtractParams { - file: Uploadable; + file: Core.Uploadable; /** * The language of the output. If not provided, the language used will be the same @@ -192,7 +190,7 @@ export interface MediaExtractParams { } export interface MediaSummarizeParams { - file: Uploadable; + file: Core.Uploadable; /** * Text Summary Request Format. @@ -216,8 +214,10 @@ export interface MediaSummarizeParams { summary_hint?: string; } -export namespace Media { - export import MediaCompareParams = MediaAPI.MediaCompareParams; - export import MediaExtractParams = MediaAPI.MediaExtractParams; - export import MediaSummarizeParams = MediaAPI.MediaSummarizeParams; +export declare namespace Media { + export { + type MediaCompareParams as MediaCompareParams, + type MediaExtractParams as MediaExtractParams, + type MediaSummarizeParams as MediaSummarizeParams, + }; } diff --git a/src/resources/file-interpreter/file-interpreter.ts b/src/resources/file-interpreter/file-interpreter.ts index df69669..9dcb7e8 100644 --- a/src/resources/file-interpreter/file-interpreter.ts +++ b/src/resources/file-interpreter/file-interpreter.ts @@ -1,12 +1,18 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from 'maisa/resource'; -import * as FromAudioAPI from 'maisa/resources/file-interpreter/from-audio'; -import * as FromDocxAPI from 'maisa/resources/file-interpreter/from-docx'; -import * as FromHTMLAPI from 'maisa/resources/file-interpreter/from-html'; -import * as FromImageAPI from 'maisa/resources/file-interpreter/from-image'; -import * as FromPdfAPI from 'maisa/resources/file-interpreter/from-pdf'; -import * as FromPdfScannedAPI from 'maisa/resources/file-interpreter/from-pdf-scanned'; +import { APIResource } from '../../resource'; +import * as FromAudioAPI from './from-audio'; +import { FromAudio, FromAudioCreateParams, FromAudioCreateResponse } from './from-audio'; +import * as FromDocxAPI from './from-docx'; +import { FromDocx, FromDocxCreateParams, FromDocxCreateResponse } from './from-docx'; +import * as FromHTMLAPI from './from-html'; +import { FromHTML, FromHTMLCreateParams, FromHTMLCreateResponse } from './from-html'; +import * as FromImageAPI from './from-image'; +import { FromImage, FromImageCreateParams, FromImageCreateResponse } from './from-image'; +import * as FromPdfAPI from './from-pdf'; +import { FromPdf, FromPdfCreateParams, FromPdfCreateResponse } from './from-pdf'; +import * as FromPdfScannedAPI from './from-pdf-scanned'; +import { FromPdfScanned } from './from-pdf-scanned'; export class FileInterpreter extends APIResource { fromPdf: FromPdfAPI.FromPdf = new FromPdfAPI.FromPdf(this._client); @@ -17,21 +23,43 @@ export class FileInterpreter extends APIResource { fromAudio: FromAudioAPI.FromAudio = new FromAudioAPI.FromAudio(this._client); } -export namespace FileInterpreter { - export import FromPdf = FromPdfAPI.FromPdf; - export import FromPdfCreateResponse = FromPdfAPI.FromPdfCreateResponse; - export import FromPdfCreateParams = FromPdfAPI.FromPdfCreateParams; - export import FromPdfScanned = FromPdfScannedAPI.FromPdfScanned; - export import FromDocx = FromDocxAPI.FromDocx; - export import FromDocxCreateResponse = FromDocxAPI.FromDocxCreateResponse; - export import FromDocxCreateParams = FromDocxAPI.FromDocxCreateParams; - export import FromHTML = FromHTMLAPI.FromHTML; - export import FromHTMLCreateResponse = FromHTMLAPI.FromHTMLCreateResponse; - export import FromHTMLCreateParams = FromHTMLAPI.FromHTMLCreateParams; - export import FromImage = FromImageAPI.FromImage; - export import FromImageCreateResponse = FromImageAPI.FromImageCreateResponse; - export import FromImageCreateParams = FromImageAPI.FromImageCreateParams; - export import FromAudio = FromAudioAPI.FromAudio; - export import FromAudioCreateResponse = FromAudioAPI.FromAudioCreateResponse; - export import FromAudioCreateParams = FromAudioAPI.FromAudioCreateParams; +FileInterpreter.FromPdf = FromPdf; +FileInterpreter.FromPdfScanned = FromPdfScanned; +FileInterpreter.FromDocx = FromDocx; +FileInterpreter.FromHTML = FromHTML; +FileInterpreter.FromImage = FromImage; +FileInterpreter.FromAudio = FromAudio; + +export declare namespace FileInterpreter { + export { + FromPdf as FromPdf, + type FromPdfCreateResponse as FromPdfCreateResponse, + type FromPdfCreateParams as FromPdfCreateParams, + }; + + export { FromPdfScanned as FromPdfScanned }; + + export { + FromDocx as FromDocx, + type FromDocxCreateResponse as FromDocxCreateResponse, + type FromDocxCreateParams as FromDocxCreateParams, + }; + + export { + FromHTML as FromHTML, + type FromHTMLCreateResponse as FromHTMLCreateResponse, + type FromHTMLCreateParams as FromHTMLCreateParams, + }; + + export { + FromImage as FromImage, + type FromImageCreateResponse as FromImageCreateResponse, + type FromImageCreateParams as FromImageCreateParams, + }; + + export { + FromAudio as FromAudio, + type FromAudioCreateResponse as FromAudioCreateResponse, + type FromAudioCreateParams as FromAudioCreateParams, + }; } diff --git a/src/resources/file-interpreter/from-audio.ts b/src/resources/file-interpreter/from-audio.ts index c0f8676..b311eb5 100644 --- a/src/resources/file-interpreter/from-audio.ts +++ b/src/resources/file-interpreter/from-audio.ts @@ -1,9 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'maisa/core'; -import { APIResource } from 'maisa/resource'; -import * as FromAudioAPI from 'maisa/resources/file-interpreter/from-audio'; -import { type Uploadable, multipartFormRequestOptions } from 'maisa/core'; +import { APIResource } from '../../resource'; +import * as Core from '../../core'; export class FromAudio extends APIResource { /** @@ -12,7 +10,7 @@ export class FromAudio extends APIResource { create(body: FromAudioCreateParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post( '/v1/file-interpreter/from-audio', - multipartFormRequestOptions({ body, ...options }), + Core.multipartFormRequestOptions({ body, ...options }), ); } } @@ -20,10 +18,12 @@ export class FromAudio extends APIResource { export type FromAudioCreateResponse = unknown; export interface FromAudioCreateParams { - file: Uploadable; + file: Core.Uploadable; } -export namespace FromAudio { - export import FromAudioCreateResponse = FromAudioAPI.FromAudioCreateResponse; - export import FromAudioCreateParams = FromAudioAPI.FromAudioCreateParams; +export declare namespace FromAudio { + export { + type FromAudioCreateResponse as FromAudioCreateResponse, + type FromAudioCreateParams as FromAudioCreateParams, + }; } diff --git a/src/resources/file-interpreter/from-docx.ts b/src/resources/file-interpreter/from-docx.ts index 5e1b1eb..e0245a9 100644 --- a/src/resources/file-interpreter/from-docx.ts +++ b/src/resources/file-interpreter/from-docx.ts @@ -1,9 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'maisa/core'; -import { APIResource } from 'maisa/resource'; -import * as FromDocxAPI from 'maisa/resources/file-interpreter/from-docx'; -import { type Uploadable, multipartFormRequestOptions } from 'maisa/core'; +import { APIResource } from '../../resource'; +import * as Core from '../../core'; export class FromDocx extends APIResource { /** @@ -12,7 +10,7 @@ export class FromDocx extends APIResource { create(body: FromDocxCreateParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post( '/v1/file-interpreter/from-docx', - multipartFormRequestOptions({ body, ...options }), + Core.multipartFormRequestOptions({ body, ...options }), ); } } @@ -20,10 +18,12 @@ export class FromDocx extends APIResource { export type FromDocxCreateResponse = unknown; export interface FromDocxCreateParams { - file: Uploadable; + file: Core.Uploadable; } -export namespace FromDocx { - export import FromDocxCreateResponse = FromDocxAPI.FromDocxCreateResponse; - export import FromDocxCreateParams = FromDocxAPI.FromDocxCreateParams; +export declare namespace FromDocx { + export { + type FromDocxCreateResponse as FromDocxCreateResponse, + type FromDocxCreateParams as FromDocxCreateParams, + }; } diff --git a/src/resources/file-interpreter/from-html.ts b/src/resources/file-interpreter/from-html.ts index 2dce2f6..b3bbd40 100644 --- a/src/resources/file-interpreter/from-html.ts +++ b/src/resources/file-interpreter/from-html.ts @@ -1,9 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'maisa/core'; -import { APIResource } from 'maisa/resource'; -import * as FromHTMLAPI from 'maisa/resources/file-interpreter/from-html'; -import { type Uploadable, multipartFormRequestOptions } from 'maisa/core'; +import { APIResource } from '../../resource'; +import * as Core from '../../core'; export class FromHTML extends APIResource { /** @@ -12,7 +10,7 @@ export class FromHTML extends APIResource { create(body: FromHTMLCreateParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post( '/v1/file-interpreter/from-html', - multipartFormRequestOptions({ body, ...options }), + Core.multipartFormRequestOptions({ body, ...options }), ); } } @@ -20,10 +18,12 @@ export class FromHTML extends APIResource { export type FromHTMLCreateResponse = unknown; export interface FromHTMLCreateParams { - file: Uploadable; + file: Core.Uploadable; } -export namespace FromHTML { - export import FromHTMLCreateResponse = FromHTMLAPI.FromHTMLCreateResponse; - export import FromHTMLCreateParams = FromHTMLAPI.FromHTMLCreateParams; +export declare namespace FromHTML { + export { + type FromHTMLCreateResponse as FromHTMLCreateResponse, + type FromHTMLCreateParams as FromHTMLCreateParams, + }; } diff --git a/src/resources/file-interpreter/from-image.ts b/src/resources/file-interpreter/from-image.ts index 604ef27..f41c79e 100644 --- a/src/resources/file-interpreter/from-image.ts +++ b/src/resources/file-interpreter/from-image.ts @@ -1,9 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'maisa/core'; -import { APIResource } from 'maisa/resource'; -import * as FromImageAPI from 'maisa/resources/file-interpreter/from-image'; -import { type Uploadable, multipartFormRequestOptions } from 'maisa/core'; +import { APIResource } from '../../resource'; +import * as Core from '../../core'; export class FromImage extends APIResource { /** @@ -12,7 +10,7 @@ export class FromImage extends APIResource { create(body: FromImageCreateParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post( '/v1/file-interpreter/from-image', - multipartFormRequestOptions({ body, ...options }), + Core.multipartFormRequestOptions({ body, ...options }), ); } } @@ -20,10 +18,12 @@ export class FromImage extends APIResource { export type FromImageCreateResponse = unknown; export interface FromImageCreateParams { - file: Uploadable; + file: Core.Uploadable; } -export namespace FromImage { - export import FromImageCreateResponse = FromImageAPI.FromImageCreateResponse; - export import FromImageCreateParams = FromImageAPI.FromImageCreateParams; +export declare namespace FromImage { + export { + type FromImageCreateResponse as FromImageCreateResponse, + type FromImageCreateParams as FromImageCreateParams, + }; } diff --git a/src/resources/file-interpreter/from-pdf-scanned.ts b/src/resources/file-interpreter/from-pdf-scanned.ts index e426aa1..c0ebdc1 100644 --- a/src/resources/file-interpreter/from-pdf-scanned.ts +++ b/src/resources/file-interpreter/from-pdf-scanned.ts @@ -1,5 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from 'maisa/resource'; +import { APIResource } from '../../resource'; export class FromPdfScanned extends APIResource {} diff --git a/src/resources/file-interpreter/from-pdf.ts b/src/resources/file-interpreter/from-pdf.ts index 9bdf316..7f0870e 100644 --- a/src/resources/file-interpreter/from-pdf.ts +++ b/src/resources/file-interpreter/from-pdf.ts @@ -1,9 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'maisa/core'; -import { APIResource } from 'maisa/resource'; -import * as FromPdfAPI from 'maisa/resources/file-interpreter/from-pdf'; -import { type Uploadable, multipartFormRequestOptions } from 'maisa/core'; +import { APIResource } from '../../resource'; +import * as Core from '../../core'; export class FromPdf extends APIResource { /** @@ -13,7 +11,7 @@ export class FromPdf extends APIResource { const { max_pages, ...body } = params; return this._client.post( '/v1/file-interpreter/from-pdf', - multipartFormRequestOptions({ query: { max_pages }, body, ...options }), + Core.multipartFormRequestOptions({ query: { max_pages }, body, ...options }), ); } } @@ -24,7 +22,7 @@ export interface FromPdfCreateParams { /** * Body param: */ - file: Uploadable; + file: Core.Uploadable; /** * Query param: @@ -32,7 +30,9 @@ export interface FromPdfCreateParams { max_pages?: number | null; } -export namespace FromPdf { - export import FromPdfCreateResponse = FromPdfAPI.FromPdfCreateResponse; - export import FromPdfCreateParams = FromPdfAPI.FromPdfCreateParams; +export declare namespace FromPdf { + export { + type FromPdfCreateResponse as FromPdfCreateResponse, + type FromPdfCreateParams as FromPdfCreateParams, + }; } diff --git a/src/resources/file-interpreter/index.ts b/src/resources/file-interpreter/index.ts index 43c32da..6971d74 100644 --- a/src/resources/file-interpreter/index.ts +++ b/src/resources/file-interpreter/index.ts @@ -1,9 +1,9 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { FileInterpreter } from './file-interpreter'; -export { FromAudioCreateResponse, FromAudioCreateParams, FromAudio } from './from-audio'; -export { FromDocxCreateResponse, FromDocxCreateParams, FromDocx } from './from-docx'; -export { FromHTMLCreateResponse, FromHTMLCreateParams, FromHTML } from './from-html'; -export { FromImageCreateResponse, FromImageCreateParams, FromImage } from './from-image'; -export { FromPdfCreateResponse, FromPdfCreateParams, FromPdf } from './from-pdf'; +export { FromAudio, type FromAudioCreateResponse, type FromAudioCreateParams } from './from-audio'; +export { FromDocx, type FromDocxCreateResponse, type FromDocxCreateParams } from './from-docx'; +export { FromHTML, type FromHTMLCreateResponse, type FromHTMLCreateParams } from './from-html'; +export { FromImage, type FromImageCreateResponse, type FromImageCreateParams } from './from-image'; +export { FromPdf, type FromPdfCreateResponse, type FromPdfCreateParams } from './from-pdf'; export { FromPdfScanned } from './from-pdf-scanned'; diff --git a/src/resources/index.ts b/src/resources/index.ts index 74798a5..6fbde78 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -2,12 +2,12 @@ export * from './shared'; export { - CapabilityCompareParams, - CapabilityExtractParams, - CapabilitySummarizeParams, Capabilities, + type CapabilityCompareParams, + type CapabilityExtractParams, + type CapabilitySummarizeParams, } from './capabilities/capabilities'; export { FileInterpreter } from './file-interpreter/file-interpreter'; -export { KpuRunResponse, KpuRunParams, Kpu } from './kpu'; +export { Kpu, type KpuRunResponse, type KpuRunParams } from './kpu'; export { Mainet } from './mainet/mainet'; export { Models } from './models/models'; diff --git a/src/resources/kpu.ts b/src/resources/kpu.ts index 6f6e6c5..f43e39e 100644 --- a/src/resources/kpu.ts +++ b/src/resources/kpu.ts @@ -1,9 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'maisa/core'; -import { APIResource } from 'maisa/resource'; -import * as KpuAPI from 'maisa/resources/kpu'; -import { type Uploadable, multipartFormRequestOptions } from 'maisa/core'; +import { APIResource } from '../resource'; +import * as Core from '../core'; export class Kpu extends APIResource { /** @@ -15,7 +13,7 @@ export class Kpu extends APIResource { const { explain_steps, retries, ...body } = params; return this._client.post( '/v1/kpu/run', - multipartFormRequestOptions({ query: { explain_steps, retries }, body, ...options }), + Core.multipartFormRequestOptions({ query: { explain_steps, retries }, body, ...options }), ); } } @@ -45,7 +43,7 @@ export interface KpuRunParams { /** * Body param: Files to be used in the KPU execution. Files can be of any type. */ - file?: Array; + file?: Array; /** * Body param: @@ -67,7 +65,6 @@ export interface KpuRunParams { reasoner_prompt?: string | null; } -export namespace Kpu { - export import KpuRunResponse = KpuAPI.KpuRunResponse; - export import KpuRunParams = KpuAPI.KpuRunParams; +export declare namespace Kpu { + export { type KpuRunResponse as KpuRunResponse, type KpuRunParams as KpuRunParams }; } diff --git a/src/resources/mainet/mainet.ts b/src/resources/mainet/mainet.ts index 56d73d4..78f0ed9 100644 --- a/src/resources/mainet/mainet.ts +++ b/src/resources/mainet/mainet.ts @@ -1,12 +1,15 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from 'maisa/resource'; -import * as SearchAPI from 'maisa/resources/mainet/search'; +import { APIResource } from '../../resource'; +import * as SearchAPI from './search'; +import { Search } from './search'; export class Mainet extends APIResource { search: SearchAPI.Search = new SearchAPI.Search(this._client); } -export namespace Mainet { - export import Search = SearchAPI.Search; +Mainet.Search = Search; + +export declare namespace Mainet { + export { Search as Search }; } diff --git a/src/resources/mainet/search.ts b/src/resources/mainet/search.ts index 6daedfb..72dd2c1 100644 --- a/src/resources/mainet/search.ts +++ b/src/resources/mainet/search.ts @@ -1,5 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from 'maisa/resource'; +import { APIResource } from '../../resource'; export class Search extends APIResource {} diff --git a/src/resources/models/embeddings.ts b/src/resources/models/embeddings.ts index 002e59c..c16e9cb 100644 --- a/src/resources/models/embeddings.ts +++ b/src/resources/models/embeddings.ts @@ -1,8 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'maisa/core'; -import { APIResource } from 'maisa/resource'; -import * as EmbeddingsAPI from 'maisa/resources/models/embeddings'; +import { APIResource } from '../../resource'; +import * as Core from '../../core'; export class Embeddings extends APIResource { /** @@ -27,7 +26,6 @@ export interface EmbeddingCreateParams { texts: Array; } -export namespace Embeddings { - export import Embeddings = EmbeddingsAPI.Embeddings; - export import EmbeddingCreateParams = EmbeddingsAPI.EmbeddingCreateParams; +export declare namespace Embeddings { + export { type Embeddings as Embeddings, type EmbeddingCreateParams as EmbeddingCreateParams }; } diff --git a/src/resources/models/index.ts b/src/resources/models/index.ts index d9a194b..283a53b 100644 --- a/src/resources/models/index.ts +++ b/src/resources/models/index.ts @@ -1,5 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Embeddings, EmbeddingCreateParams } from './embeddings'; export { Models } from './models'; export { Rerank } from './rerank'; +export { type Embeddings, type EmbeddingCreateParams } from './embeddings'; diff --git a/src/resources/models/models.ts b/src/resources/models/models.ts index 3ad737c..8ab7dc6 100644 --- a/src/resources/models/models.ts +++ b/src/resources/models/models.ts @@ -1,16 +1,20 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from 'maisa/resource'; -import * as EmbeddingsAPI from 'maisa/resources/models/embeddings'; -import * as RerankAPI from 'maisa/resources/models/rerank'; +import { APIResource } from '../../resource'; +import * as EmbeddingsAPI from './embeddings'; +import { EmbeddingCreateParams, Embeddings } from './embeddings'; +import * as RerankAPI from './rerank'; +import { Rerank } from './rerank'; export class Models extends APIResource { embeddings: EmbeddingsAPI.Embeddings = new EmbeddingsAPI.Embeddings(this._client); rerank: RerankAPI.Rerank = new RerankAPI.Rerank(this._client); } -export namespace Models { - export import Embeddings = EmbeddingsAPI.Embeddings; - export import EmbeddingCreateParams = EmbeddingsAPI.EmbeddingCreateParams; - export import Rerank = RerankAPI.Rerank; +Models.Rerank = Rerank; + +export declare namespace Models { + export { type Embeddings as Embeddings, type EmbeddingCreateParams as EmbeddingCreateParams }; + + export { Rerank as Rerank }; } diff --git a/src/resources/models/rerank.ts b/src/resources/models/rerank.ts index 7ae77c4..9c014bd 100644 --- a/src/resources/models/rerank.ts +++ b/src/resources/models/rerank.ts @@ -1,5 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from 'maisa/resource'; +import { APIResource } from '../../resource'; export class Rerank extends APIResource {} diff --git a/src/uploads.ts b/src/uploads.ts index 081827c..8fd2154 100644 --- a/src/uploads.ts +++ b/src/uploads.ts @@ -107,21 +107,28 @@ export async function toFile( // If it's a promise, resolve it. value = await value; - // Use the file's options if there isn't one provided - options ??= isFileLike(value) ? { lastModified: value.lastModified, type: value.type } : {}; + // If we've been given a `File` we don't need to do anything + if (isFileLike(value)) { + return value; + } if (isResponseLike(value)) { const blob = await value.blob(); name ||= new URL(value.url).pathname.split(/[\\/]/).pop() ?? 'unknown_file'; - return new File([blob as any], name, options); + // we need to convert the `Blob` into an array buffer because the `Blob` class + // that `node-fetch` defines is incompatible with the web standard which results + // in `new File` interpreting it as a string instead of binary data. + const data = isBlobLike(blob) ? [(await blob.arrayBuffer()) as any] : [blob]; + + return new File(data, name, options); } const bits = await getBytes(value); name ||= getName(value) ?? 'unknown_file'; - if (!options.type) { + if (!options?.type) { const type = (bits[0] as any)?.type; if (typeof type === 'string') { options = { ...options, type }; diff --git a/tests/api-resources/capabilities/capabilities.test.ts b/tests/api-resources/capabilities/capabilities.test.ts index 32fffb8..508054b 100644 --- a/tests/api-resources/capabilities/capabilities.test.ts +++ b/tests/api-resources/capabilities/capabilities.test.ts @@ -3,17 +3,17 @@ import Maisa from 'maisa'; import { Response } from 'node-fetch'; -const maisa = new Maisa({ +const client = new Maisa({ apiKey: 'My API Key', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource capabilities', () => { test('compare: only required params', async () => { - const responsePromise = maisa.capabilities.compare({ + const responsePromise = client.capabilities.compare({ text1: 'Lorem Ipsum dolor sit amet', text2: 'Sed ut perspiciatis unde omnis', - variables: { name: { type: 'string', description: 'The name of the person.' } }, + variables: { name: { description: 'The name of the person.', type: 'string' } }, }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -25,19 +25,19 @@ describe('resource capabilities', () => { }); test('compare: required and optional params', async () => { - const response = await maisa.capabilities.compare({ + const response = await client.capabilities.compare({ text1: 'Lorem Ipsum dolor sit amet', text2: 'Sed ut perspiciatis unde omnis', - variables: { name: { type: 'string', description: 'The name of the person.' } }, + variables: { name: { description: 'The name of the person.', type: 'string' } }, lang: 'en', prompt: 'Compare the value for end customer.', }); }); test('extract: only required params', async () => { - const responsePromise = maisa.capabilities.extract({ + const responsePromise = client.capabilities.extract({ text: 'Example long text...', - variables: { name: { type: 'string', description: 'The name of the person.' } }, + variables: { name: { description: 'The name of the person.', type: 'string' } }, }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -49,15 +49,15 @@ describe('resource capabilities', () => { }); test('extract: required and optional params', async () => { - const response = await maisa.capabilities.extract({ + const response = await client.capabilities.extract({ text: 'Example long text...', - variables: { name: { type: 'string', description: 'The name of the person.' } }, + variables: { name: { description: 'The name of the person.', type: 'string' } }, lang: 'en', }); }); test('summarize: only required params', async () => { - const responsePromise = maisa.capabilities.summarize({ text: 'Example long text...' }); + const responsePromise = client.capabilities.summarize({ text: 'Example long text...' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -68,11 +68,11 @@ describe('resource capabilities', () => { }); test('summarize: required and optional params', async () => { - const response = await maisa.capabilities.summarize({ + const response = await client.capabilities.summarize({ text: 'Example long text...', format: 'paragraph', lang: 'en', - length: 'medium', + length: 'short', summary_hint: 'Example summary of the text...', }); }); diff --git a/tests/api-resources/capabilities/media.test.ts b/tests/api-resources/capabilities/media.test.ts index 8bc937d..15c70c2 100644 --- a/tests/api-resources/capabilities/media.test.ts +++ b/tests/api-resources/capabilities/media.test.ts @@ -3,14 +3,14 @@ import Maisa, { toFile } from 'maisa'; import { Response } from 'node-fetch'; -const maisa = new Maisa({ +const client = new Maisa({ apiKey: 'My API Key', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource media', () => { test('compare: only required params', async () => { - const responsePromise = maisa.capabilities.media.compare({ + const responsePromise = client.capabilities.media.compare({ file1: await toFile(Buffer.from('# my file contents'), 'README.md'), file2: await toFile(Buffer.from('# my file contents'), 'README.md'), }); @@ -24,7 +24,7 @@ describe('resource media', () => { }); test('compare: required and optional params', async () => { - const response = await maisa.capabilities.media.compare({ + const response = await client.capabilities.media.compare({ file1: await toFile(Buffer.from('# my file contents'), 'README.md'), file2: await toFile(Buffer.from('# my file contents'), 'README.md'), lang: 'en', @@ -45,7 +45,7 @@ describe('resource media', () => { }); test('extract: only required params', async () => { - const responsePromise = maisa.capabilities.media.extract({ + const responsePromise = client.capabilities.media.extract({ file: await toFile(Buffer.from('# my file contents'), 'README.md'), }); const rawResponse = await responsePromise.asResponse(); @@ -58,7 +58,7 @@ describe('resource media', () => { }); test('extract: required and optional params', async () => { - const response = await maisa.capabilities.media.extract({ + const response = await client.capabilities.media.extract({ file: await toFile(Buffer.from('# my file contents'), 'README.md'), lang: 'en', variable1_description: 'The name of the person.', @@ -77,7 +77,7 @@ describe('resource media', () => { }); test('summarize: only required params', async () => { - const responsePromise = maisa.capabilities.media.summarize({ + const responsePromise = client.capabilities.media.summarize({ file: await toFile(Buffer.from('# my file contents'), 'README.md'), }); const rawResponse = await responsePromise.asResponse(); @@ -90,7 +90,7 @@ describe('resource media', () => { }); test('summarize: required and optional params', async () => { - const response = await maisa.capabilities.media.summarize({ + const response = await client.capabilities.media.summarize({ file: await toFile(Buffer.from('# my file contents'), 'README.md'), format: 'paragraph', lang: 'en', diff --git a/tests/api-resources/file-interpreter/from-audio.test.ts b/tests/api-resources/file-interpreter/from-audio.test.ts index b482327..94ff2ff 100644 --- a/tests/api-resources/file-interpreter/from-audio.test.ts +++ b/tests/api-resources/file-interpreter/from-audio.test.ts @@ -3,14 +3,14 @@ import Maisa, { toFile } from 'maisa'; import { Response } from 'node-fetch'; -const maisa = new Maisa({ +const client = new Maisa({ apiKey: 'My API Key', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource fromAudio', () => { test('create: only required params', async () => { - const responsePromise = maisa.fileInterpreter.fromAudio.create({ + const responsePromise = client.fileInterpreter.fromAudio.create({ file: await toFile(Buffer.from('# my file contents'), 'README.md'), }); const rawResponse = await responsePromise.asResponse(); @@ -23,7 +23,7 @@ describe('resource fromAudio', () => { }); test('create: required and optional params', async () => { - const response = await maisa.fileInterpreter.fromAudio.create({ + const response = await client.fileInterpreter.fromAudio.create({ file: await toFile(Buffer.from('# my file contents'), 'README.md'), }); }); diff --git a/tests/api-resources/file-interpreter/from-docx.test.ts b/tests/api-resources/file-interpreter/from-docx.test.ts index 4ae8817..73e6a74 100644 --- a/tests/api-resources/file-interpreter/from-docx.test.ts +++ b/tests/api-resources/file-interpreter/from-docx.test.ts @@ -3,14 +3,14 @@ import Maisa, { toFile } from 'maisa'; import { Response } from 'node-fetch'; -const maisa = new Maisa({ +const client = new Maisa({ apiKey: 'My API Key', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource fromDocx', () => { test('create: only required params', async () => { - const responsePromise = maisa.fileInterpreter.fromDocx.create({ + const responsePromise = client.fileInterpreter.fromDocx.create({ file: await toFile(Buffer.from('# my file contents'), 'README.md'), }); const rawResponse = await responsePromise.asResponse(); @@ -23,7 +23,7 @@ describe('resource fromDocx', () => { }); test('create: required and optional params', async () => { - const response = await maisa.fileInterpreter.fromDocx.create({ + const response = await client.fileInterpreter.fromDocx.create({ file: await toFile(Buffer.from('# my file contents'), 'README.md'), }); }); diff --git a/tests/api-resources/file-interpreter/from-html.test.ts b/tests/api-resources/file-interpreter/from-html.test.ts index 2f34618..711fbb5 100644 --- a/tests/api-resources/file-interpreter/from-html.test.ts +++ b/tests/api-resources/file-interpreter/from-html.test.ts @@ -3,14 +3,14 @@ import Maisa, { toFile } from 'maisa'; import { Response } from 'node-fetch'; -const maisa = new Maisa({ +const client = new Maisa({ apiKey: 'My API Key', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource fromHTML', () => { test('create: only required params', async () => { - const responsePromise = maisa.fileInterpreter.fromHTML.create({ + const responsePromise = client.fileInterpreter.fromHTML.create({ file: await toFile(Buffer.from('# my file contents'), 'README.md'), }); const rawResponse = await responsePromise.asResponse(); @@ -23,7 +23,7 @@ describe('resource fromHTML', () => { }); test('create: required and optional params', async () => { - const response = await maisa.fileInterpreter.fromHTML.create({ + const response = await client.fileInterpreter.fromHTML.create({ file: await toFile(Buffer.from('# my file contents'), 'README.md'), }); }); diff --git a/tests/api-resources/file-interpreter/from-image.test.ts b/tests/api-resources/file-interpreter/from-image.test.ts index ed1c104..ffa1ed5 100644 --- a/tests/api-resources/file-interpreter/from-image.test.ts +++ b/tests/api-resources/file-interpreter/from-image.test.ts @@ -3,14 +3,14 @@ import Maisa, { toFile } from 'maisa'; import { Response } from 'node-fetch'; -const maisa = new Maisa({ +const client = new Maisa({ apiKey: 'My API Key', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource fromImage', () => { test('create: only required params', async () => { - const responsePromise = maisa.fileInterpreter.fromImage.create({ + const responsePromise = client.fileInterpreter.fromImage.create({ file: await toFile(Buffer.from('# my file contents'), 'README.md'), }); const rawResponse = await responsePromise.asResponse(); @@ -23,7 +23,7 @@ describe('resource fromImage', () => { }); test('create: required and optional params', async () => { - const response = await maisa.fileInterpreter.fromImage.create({ + const response = await client.fileInterpreter.fromImage.create({ file: await toFile(Buffer.from('# my file contents'), 'README.md'), }); }); diff --git a/tests/api-resources/file-interpreter/from-pdf.test.ts b/tests/api-resources/file-interpreter/from-pdf.test.ts index b1eacc0..5d02b45 100644 --- a/tests/api-resources/file-interpreter/from-pdf.test.ts +++ b/tests/api-resources/file-interpreter/from-pdf.test.ts @@ -3,14 +3,14 @@ import Maisa, { toFile } from 'maisa'; import { Response } from 'node-fetch'; -const maisa = new Maisa({ +const client = new Maisa({ apiKey: 'My API Key', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource fromPdf', () => { test('create: only required params', async () => { - const responsePromise = maisa.fileInterpreter.fromPdf.create({ + const responsePromise = client.fileInterpreter.fromPdf.create({ file: await toFile(Buffer.from('# my file contents'), 'README.md'), }); const rawResponse = await responsePromise.asResponse(); @@ -23,7 +23,7 @@ describe('resource fromPdf', () => { }); test('create: required and optional params', async () => { - const response = await maisa.fileInterpreter.fromPdf.create({ + const response = await client.fileInterpreter.fromPdf.create({ file: await toFile(Buffer.from('# my file contents'), 'README.md'), max_pages: 0, }); diff --git a/tests/api-resources/kpu.test.ts b/tests/api-resources/kpu.test.ts index c935657..941576d 100644 --- a/tests/api-resources/kpu.test.ts +++ b/tests/api-resources/kpu.test.ts @@ -3,14 +3,14 @@ import Maisa, { toFile } from 'maisa'; import { Response } from 'node-fetch'; -const maisa = new Maisa({ +const client = new Maisa({ apiKey: 'My API Key', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource kpu', () => { test('run: only required params', async () => { - const responsePromise = maisa.kpu.run({ query: 'string' }); + const responsePromise = client.kpu.run({ query: 'query' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -21,8 +21,8 @@ describe('resource kpu', () => { }); test('run: required and optional params', async () => { - const response = await maisa.kpu.run({ - query: 'string', + const response = await client.kpu.run({ + query: 'query', explain_steps: true, retries: 1, file: [ @@ -31,7 +31,7 @@ describe('resource kpu', () => { await toFile(Buffer.from('# my file contents'), 'README.md'), ], reasoner_model: 'gpt-4-turbo', - reasoner_prompt: 'string', + reasoner_prompt: 'reasoner_prompt', }); }); }); diff --git a/tests/api-resources/models/embeddings.test.ts b/tests/api-resources/models/embeddings.test.ts index 376729f..f91cd5c 100644 --- a/tests/api-resources/models/embeddings.test.ts +++ b/tests/api-resources/models/embeddings.test.ts @@ -3,14 +3,14 @@ import Maisa from 'maisa'; import { Response } from 'node-fetch'; -const maisa = new Maisa({ +const client = new Maisa({ apiKey: 'My API Key', baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); describe('resource embeddings', () => { test('create: only required params', async () => { - const responsePromise = maisa.models.embeddings.create({ texts: ['string'] }); + const responsePromise = client.models.embeddings.create({ texts: ['string'] }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -21,6 +21,6 @@ describe('resource embeddings', () => { }); test('create: required and optional params', async () => { - const response = await maisa.models.embeddings.create({ texts: ['string'] }); + const response = await client.models.embeddings.create({ texts: ['string'] }); }); }); diff --git a/tests/index.test.ts b/tests/index.test.ts index aac03c5..9c031cc 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -241,6 +241,122 @@ describe('retries', () => { expect(count).toEqual(3); }); + test('retry count header', async () => { + let count = 0; + let capturedRequest: RequestInit | undefined; + const testFetch = async (url: RequestInfo, init: RequestInit = {}): Promise => { + count++; + if (count <= 2) { + return new Response(undefined, { + status: 429, + headers: { + 'Retry-After': '0.1', + }, + }); + } + capturedRequest = init; + return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } }); + }; + + const client = new Maisa({ apiKey: 'My API Key', fetch: testFetch, maxRetries: 4 }); + + expect(await client.request({ path: '/foo', method: 'get' })).toEqual({ a: 1 }); + + expect((capturedRequest!.headers as Headers)['x-stainless-retry-count']).toEqual('2'); + expect(count).toEqual(3); + }); + + test('omit retry count header', async () => { + let count = 0; + let capturedRequest: RequestInit | undefined; + const testFetch = async (url: RequestInfo, init: RequestInit = {}): Promise => { + count++; + if (count <= 2) { + return new Response(undefined, { + status: 429, + headers: { + 'Retry-After': '0.1', + }, + }); + } + capturedRequest = init; + return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } }); + }; + const client = new Maisa({ apiKey: 'My API Key', fetch: testFetch, maxRetries: 4 }); + + expect( + await client.request({ + path: '/foo', + method: 'get', + headers: { 'X-Stainless-Retry-Count': null }, + }), + ).toEqual({ a: 1 }); + + expect(capturedRequest!.headers as Headers).not.toHaveProperty('x-stainless-retry-count'); + }); + + test('omit retry count header by default', async () => { + let count = 0; + let capturedRequest: RequestInit | undefined; + const testFetch = async (url: RequestInfo, init: RequestInit = {}): Promise => { + count++; + if (count <= 2) { + return new Response(undefined, { + status: 429, + headers: { + 'Retry-After': '0.1', + }, + }); + } + capturedRequest = init; + return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } }); + }; + const client = new Maisa({ + apiKey: 'My API Key', + fetch: testFetch, + maxRetries: 4, + defaultHeaders: { 'X-Stainless-Retry-Count': null }, + }); + + expect( + await client.request({ + path: '/foo', + method: 'get', + }), + ).toEqual({ a: 1 }); + + expect(capturedRequest!.headers as Headers).not.toHaveProperty('x-stainless-retry-count'); + }); + + test('overwrite retry count header', async () => { + let count = 0; + let capturedRequest: RequestInit | undefined; + const testFetch = async (url: RequestInfo, init: RequestInit = {}): Promise => { + count++; + if (count <= 2) { + return new Response(undefined, { + status: 429, + headers: { + 'Retry-After': '0.1', + }, + }); + } + capturedRequest = init; + return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } }); + }; + const client = new Maisa({ apiKey: 'My API Key', fetch: testFetch, maxRetries: 4 }); + + expect( + await client.request({ + path: '/foo', + method: 'get', + headers: { 'X-Stainless-Retry-Count': '42' }, + }), + ).toEqual({ a: 1 }); + + expect((capturedRequest!.headers as Headers)['x-stainless-retry-count']).toBe('42'); + }); + test('retry on 429 with retry-after', async () => { let count = 0; const testFetch = async (url: RequestInfo, { signal }: RequestInit = {}): Promise => { diff --git a/tests/stringifyQuery.test.ts b/tests/stringifyQuery.test.ts index faa6d83..403f340 100644 --- a/tests/stringifyQuery.test.ts +++ b/tests/stringifyQuery.test.ts @@ -1,8 +1,10 @@ -import { APIClient } from 'maisa/core'; +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -const { stringifyQuery } = APIClient.prototype as any; +import { Maisa } from 'maisa'; -describe('APIClient.stringifyQuery', () => { +const { stringifyQuery } = Maisa.prototype as any; + +describe(stringifyQuery, () => { for (const [input, expected] of [ [{ a: '1', b: 2, c: true }, 'a=1&b=2&c=true'], [{ a: null, b: false, c: undefined }, 'a=&b=false'], @@ -18,6 +20,7 @@ describe('APIClient.stringifyQuery', () => { expect(stringifyQuery(input)).toEqual(expected); }); } + for (const value of [[], {}, new Date()]) { it(`${JSON.stringify(value)} -> `, () => { expect(() => stringifyQuery({ value })).toThrow(`Cannot stringify type ${typeof value}`); diff --git a/tests/uploads.test.ts b/tests/uploads.test.ts index 3b4d30e..2daff1f 100644 --- a/tests/uploads.test.ts +++ b/tests/uploads.test.ts @@ -54,4 +54,12 @@ describe('toFile', () => { const file = await toFile(input); expect(file.name).toEqual('uploads.test.ts'); }); + + it('does not copy File objects', async () => { + const input = new File(['foo'], 'input.jsonl', { type: 'jsonl' }); + const file = await toFile(input); + expect(file).toBe(input); + expect(file.name).toEqual('input.jsonl'); + expect(file.type).toBe('jsonl'); + }); }); diff --git a/tsconfig.deno.json b/tsconfig.deno.json index 7ef14ac..849e070 100644 --- a/tsconfig.deno.json +++ b/tsconfig.deno.json @@ -1,19 +1,14 @@ { "extends": "./tsconfig.json", - "include": ["deno"], + "include": ["dist-deno"], "exclude": [], "compilerOptions": { - "rootDir": "./deno", + "rootDir": "./dist-deno", "lib": ["es2020", "DOM"], - "paths": { - "maisa/_shims/auto/*": ["deno/_shims/auto/*-deno"], - "maisa/*": ["deno/*"], - "maisa": ["deno/index.ts"], - }, "noEmit": true, "declaration": true, "declarationMap": true, - "outDir": "deno", + "outDir": "dist-deno", "pretty": true, "sourceMap": true } diff --git a/tsconfig.json b/tsconfig.json index 05db708..deeab7d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,7 +11,7 @@ "paths": { "maisa/_shims/auto/*": ["src/_shims/auto/*-node"], "maisa/*": ["src/*"], - "maisa": ["src/index.ts"], + "maisa": ["src/index.ts"] }, "noEmit": true, @@ -32,6 +32,7 @@ "noUncheckedIndexedAccess": true, "noImplicitOverride": true, "noPropertyAccessFromIndexSignature": true, + "isolatedModules": false, "skipLibCheck": true } diff --git a/yarn.lock b/yarn.lock index 51cdd9f..14e8a75 100644 --- a/yarn.lock +++ b/yarn.lock @@ -322,9 +322,9 @@ eslint-visitor-keys "^3.3.0" "@eslint-community/regexpp@^4.5.1": - version "4.9.0" - resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.9.0.tgz#7ccb5f58703fa61ffdcbf39e2c604a109e781162" - integrity sha512-zJmuCWj2VLBt4c25CfBIbMZLGLyhkvs7LznyVX5HfpzeocThgIj5XQK4L+g3U36mMcx8bPMhGyPpwCATamC4jQ== + version "4.11.1" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.11.1.tgz#a547badfc719eb3e5f4b556325e542fbe9d7a18f" + integrity sha512-m4DVN9ZqskZoLU5GlWZadwDnYo3vAEydiUayB9widCl9ffWx2IvPnp6n3on5rJmziJSw9Bv+Z3ChDVdMwXCY8Q== "@eslint-community/regexpp@^4.6.1": version "4.6.2" @@ -857,9 +857,9 @@ pretty-format "^29.0.0" "@types/json-schema@^7.0.12": - version "7.0.13" - resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.13.tgz#02c24f4363176d2d18fc8b70b9f3c54aba178a85" - integrity sha512-RbSSoHliUbnXj3ny0CNFOoxrIDV6SUGyStHsvDqosw6CkdPV8TtWGlfecuK4ToyMEAql6pzNxgCFKanovUzlgQ== + version "7.0.15" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" + integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== "@types/node-fetch@^2.6.4": version "2.6.4" @@ -882,9 +882,9 @@ integrity sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA== "@types/semver@^7.5.0": - version "7.5.3" - resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.3.tgz#9a726e116beb26c24f1ccd6850201e1246122e04" - integrity sha512-OxepLK9EuNEIPxWNME+C6WwbRAOOI2o2BaQEGzz5Lu2e4Z5eDnEo+/aVEDMIXywoJitJ7xWd641wrGLZdtwRyw== + version "7.5.8" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.8.tgz#8268a8c57a3e4abd25c165ecd36237db7948a55e" + integrity sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ== "@types/stack-utils@^2.0.0": version "2.0.3" @@ -904,15 +904,15 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^6.7.0": - version "6.7.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.7.3.tgz#d98046e9f7102d49a93d944d413c6055c47fafd7" - integrity sha512-vntq452UHNltxsaaN+L9WyuMch8bMd9CqJ3zhzTPXXidwbf5mqqKCVXEuvRZUqLJSTLeWE65lQwyXsRGnXkCTA== + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz#30830c1ca81fd5f3c2714e524c4303e0194f9cd3" + integrity sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA== dependencies: "@eslint-community/regexpp" "^4.5.1" - "@typescript-eslint/scope-manager" "6.7.3" - "@typescript-eslint/type-utils" "6.7.3" - "@typescript-eslint/utils" "6.7.3" - "@typescript-eslint/visitor-keys" "6.7.3" + "@typescript-eslint/scope-manager" "6.21.0" + "@typescript-eslint/type-utils" "6.21.0" + "@typescript-eslint/utils" "6.21.0" + "@typescript-eslint/visitor-keys" "6.21.0" debug "^4.3.4" graphemer "^1.4.0" ignore "^5.2.4" @@ -921,71 +921,72 @@ ts-api-utils "^1.0.1" "@typescript-eslint/parser@^6.7.0": - version "6.7.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.7.3.tgz#aaf40092a32877439e5957e18f2d6a91c82cc2fd" - integrity sha512-TlutE+iep2o7R8Lf+yoer3zU6/0EAUc8QIBB3GYBc1KGz4c4TRm83xwXUZVPlZ6YCLss4r77jbu6j3sendJoiQ== - dependencies: - "@typescript-eslint/scope-manager" "6.7.3" - "@typescript-eslint/types" "6.7.3" - "@typescript-eslint/typescript-estree" "6.7.3" - "@typescript-eslint/visitor-keys" "6.7.3" + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.21.0.tgz#af8fcf66feee2edc86bc5d1cf45e33b0630bf35b" + integrity sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ== + dependencies: + "@typescript-eslint/scope-manager" "6.21.0" + "@typescript-eslint/types" "6.21.0" + "@typescript-eslint/typescript-estree" "6.21.0" + "@typescript-eslint/visitor-keys" "6.21.0" debug "^4.3.4" -"@typescript-eslint/scope-manager@6.7.3": - version "6.7.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.7.3.tgz#07e5709c9bdae3eaf216947433ef97b3b8b7d755" - integrity sha512-wOlo0QnEou9cHO2TdkJmzF7DFGvAKEnB82PuPNHpT8ZKKaZu6Bm63ugOTn9fXNJtvuDPanBc78lGUGGytJoVzQ== +"@typescript-eslint/scope-manager@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz#ea8a9bfc8f1504a6ac5d59a6df308d3a0630a2b1" + integrity sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg== dependencies: - "@typescript-eslint/types" "6.7.3" - "@typescript-eslint/visitor-keys" "6.7.3" + "@typescript-eslint/types" "6.21.0" + "@typescript-eslint/visitor-keys" "6.21.0" -"@typescript-eslint/type-utils@6.7.3": - version "6.7.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.7.3.tgz#c2c165c135dda68a5e70074ade183f5ad68f3400" - integrity sha512-Fc68K0aTDrKIBvLnKTZ5Pf3MXK495YErrbHb1R6aTpfK5OdSFj0rVN7ib6Tx6ePrZ2gsjLqr0s98NG7l96KSQw== +"@typescript-eslint/type-utils@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz#6473281cfed4dacabe8004e8521cee0bd9d4c01e" + integrity sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag== dependencies: - "@typescript-eslint/typescript-estree" "6.7.3" - "@typescript-eslint/utils" "6.7.3" + "@typescript-eslint/typescript-estree" "6.21.0" + "@typescript-eslint/utils" "6.21.0" debug "^4.3.4" ts-api-utils "^1.0.1" -"@typescript-eslint/types@6.7.3": - version "6.7.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.7.3.tgz#0402b5628a63f24f2dc9d4a678e9a92cc50ea3e9" - integrity sha512-4g+de6roB2NFcfkZb439tigpAMnvEIg3rIjWQ+EM7IBaYt/CdJt6em9BJ4h4UpdgaBWdmx2iWsafHTrqmgIPNw== +"@typescript-eslint/types@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.21.0.tgz#205724c5123a8fef7ecd195075fa6e85bac3436d" + integrity sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg== -"@typescript-eslint/typescript-estree@6.7.3": - version "6.7.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.7.3.tgz#ec5bb7ab4d3566818abaf0e4a8fa1958561b7279" - integrity sha512-YLQ3tJoS4VxLFYHTw21oe1/vIZPRqAO91z6Uv0Ss2BKm/Ag7/RVQBcXTGcXhgJMdA4U+HrKuY5gWlJlvoaKZ5g== +"@typescript-eslint/typescript-estree@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz#c47ae7901db3b8bddc3ecd73daff2d0895688c46" + integrity sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ== dependencies: - "@typescript-eslint/types" "6.7.3" - "@typescript-eslint/visitor-keys" "6.7.3" + "@typescript-eslint/types" "6.21.0" + "@typescript-eslint/visitor-keys" "6.21.0" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" + minimatch "9.0.3" semver "^7.5.4" ts-api-utils "^1.0.1" -"@typescript-eslint/utils@6.7.3": - version "6.7.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.7.3.tgz#96c655816c373135b07282d67407cb577f62e143" - integrity sha512-vzLkVder21GpWRrmSR9JxGZ5+ibIUSudXlW52qeKpzUEQhRSmyZiVDDj3crAth7+5tmN1ulvgKaCU2f/bPRCzg== +"@typescript-eslint/utils@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.21.0.tgz#4714e7a6b39e773c1c8e97ec587f520840cd8134" + integrity sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ== dependencies: "@eslint-community/eslint-utils" "^4.4.0" "@types/json-schema" "^7.0.12" "@types/semver" "^7.5.0" - "@typescript-eslint/scope-manager" "6.7.3" - "@typescript-eslint/types" "6.7.3" - "@typescript-eslint/typescript-estree" "6.7.3" + "@typescript-eslint/scope-manager" "6.21.0" + "@typescript-eslint/types" "6.21.0" + "@typescript-eslint/typescript-estree" "6.21.0" semver "^7.5.4" -"@typescript-eslint/visitor-keys@6.7.3": - version "6.7.3" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.7.3.tgz#83809631ca12909bd2083558d2f93f5747deebb2" - integrity sha512-HEVXkU9IB+nk9o63CeICMHxFWbHWr3E1mpilIQBe9+7L/lH97rleFLVtYsfnWB+JVMaiFnEaxvknvmIzX+CqVg== +"@typescript-eslint/visitor-keys@6.21.0": + version "6.21.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz#87a99d077aa507e20e238b11d56cc26ade45fe47" + integrity sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A== dependencies: - "@typescript-eslint/types" "6.7.3" + "@typescript-eslint/types" "6.21.0" eslint-visitor-keys "^3.4.1" abort-controller@^3.0.0: @@ -1392,13 +1393,20 @@ cross-spawn@^7.0.2, cross-spawn@^7.0.3: shebang-command "^2.0.0" which "^2.0.1" -debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.4: +debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== dependencies: ms "2.1.2" +debug@^4.3.4: + version "4.3.7" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.7.tgz#87945b4151a011d76d95a198d7111c865c360a52" + integrity sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ== + dependencies: + ms "^2.1.3" + dedent@^1.0.0: version "1.5.1" resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.5.1.tgz#4f3fc94c8b711e9bb2800d185cd6ad20f2a90aff" @@ -1546,12 +1554,7 @@ eslint-scope@^7.2.2: esrecurse "^4.3.0" estraverse "^5.2.0" -eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1: - version "3.4.2" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.2.tgz#8c2095440eca8c933bedcadf16fefa44dbe9ba5f" - integrity sha512-8drBzUEyZ2llkpCA67iYrgEssKDUu68V8ChqqOfFupIaG/LCVPUT+CoGJpT77zJprs4T/W7p07LP7zAIMuweVw== - -eslint-visitor-keys@^3.4.3: +eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4.3: version "3.4.3" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800" integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== @@ -1709,18 +1712,7 @@ fast-glob@^3.2.12: merge2 "^1.3.0" micromatch "^4.0.4" -fast-glob@^3.2.9: - version "3.3.1" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.1.tgz#784b4e897340f3dbbef17413b3f11acf03c874c4" - integrity sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg== - dependencies: - "@nodelib/fs.stat" "^2.0.2" - "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.2" - merge2 "^1.3.0" - micromatch "^4.0.4" - -fast-glob@^3.3.0: +fast-glob@^3.2.9, fast-glob@^3.3.0: version "3.3.2" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.2.tgz#a904501e57cfdd2ffcded45e99a54fef55e46129" integrity sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow== @@ -1742,9 +1734,9 @@ fast-levenshtein@^2.0.6: integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== fastq@^1.6.0: - version "1.15.0" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.15.0.tgz#d04d07c6a2a68fe4599fea8d2e103a937fae6b3a" - integrity sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw== + version "1.17.1" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.17.1.tgz#2a523f07a4e7b1e81a42b91b8bf2254107753b47" + integrity sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w== dependencies: reusify "^1.0.4" @@ -1959,10 +1951,17 @@ humanize-ms@^1.2.1: dependencies: ms "^2.0.0" +iconv-lite@^0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501" + integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw== + dependencies: + safer-buffer ">= 2.1.2 < 3.0.0" + ignore@^5.2.0, ignore@^5.2.4: - version "5.2.4" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" - integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== + version "5.3.2" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.2.tgz#3cd40e729f3643fd87cb04e50bf0eb722bc596f5" + integrity sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g== import-fresh@^3.2.1: version "3.3.0" @@ -2667,6 +2666,13 @@ mimic-fn@^4.0.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-4.0.0.tgz#60a90550d5cb0b239cca65d893b1a53b29871ecc" integrity sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw== +minimatch@9.0.3: + version "9.0.3" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825" + integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg== + dependencies: + brace-expansion "^2.0.1" + minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" @@ -2696,7 +2702,7 @@ ms@2.1.2: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -ms@^2.0.0: +ms@^2.0.0, ms@^2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== @@ -3041,18 +3047,28 @@ safe-buffer@~5.2.0: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== +"safer-buffer@>= 2.1.2 < 3.0.0": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + semver@^6.3.0, semver@^6.3.1: version "6.3.1" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== -semver@^7.5.3, semver@^7.5.4: +semver@^7.5.3: version "7.5.4" resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.4.tgz#483986ec4ed38e1c6c48c34894a9182dbff68a6e" integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA== dependencies: lru-cache "^6.0.0" +semver@^7.5.4: + version "7.6.3" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" + integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== + shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" @@ -3249,9 +3265,9 @@ tr46@~0.0.3: integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= ts-api-utils@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.0.3.tgz#f12c1c781d04427313dbac808f453f050e54a331" - integrity sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg== + version "1.3.0" + resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-1.3.0.tgz#4b490e27129f1e8e686b45cc4ab63714dc60eea1" + integrity sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ== ts-jest@^29.1.0: version "29.1.1" @@ -3412,11 +3428,6 @@ web-streams-polyfill@4.0.0-beta.1: resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-4.0.0-beta.1.tgz#3b19b9817374b7cee06d374ba7eeb3aeb80e8c95" integrity sha512-3ux37gEX670UUphBF9AMCq8XM6iQ8Ac6A+DSRRjDoRBm1ufCkaCDdNVbaqq60PsEkdNlLKrGtv/YBP4EJXqNtQ== -web-streams-polyfill@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz#71c2718c52b45fd49dbeee88634b3a60ceab42a6" - integrity sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q== - webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" From 036b17d968f6a3171cd2994a004d8d8bfad79af5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 12 Nov 2024 03:25:07 +0000 Subject: [PATCH 005/109] chore: rebuild project due to codegen change (#18) --- src/index.ts | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/src/index.ts b/src/index.ts index 76947d0..e959acf 100644 --- a/src/index.ts +++ b/src/index.ts @@ -171,31 +171,11 @@ export class Maisa extends Core.APIClient { static fileFromPath = Uploads.fileFromPath; } -export { - MaisaError, - APIError, - APIConnectionError, - APIConnectionTimeoutError, - APIUserAbortError, - NotFoundError, - ConflictError, - RateLimitError, - BadRequestError, - AuthenticationError, - InternalServerError, - PermissionDeniedError, - UnprocessableEntityError, -} from './error'; - -export import toFile = Uploads.toFile; -export import fileFromPath = Uploads.fileFromPath; - Maisa.Capabilities = Capabilities; Maisa.Models = Models; Maisa.Kpu = Kpu; Maisa.FileInterpreter = FileInterpreter; Maisa.Mainet = Mainet; - export declare namespace Maisa { export type RequestOptions = Core.RequestOptions; @@ -219,4 +199,21 @@ export declare namespace Maisa { export type TextSummary = API.TextSummary; } +export { toFile, fileFromPath } from 'maisa/uploads'; +export { + MaisaError, + APIError, + APIConnectionError, + APIConnectionTimeoutError, + APIUserAbortError, + NotFoundError, + ConflictError, + RateLimitError, + BadRequestError, + AuthenticationError, + InternalServerError, + PermissionDeniedError, + UnprocessableEntityError, +} from 'maisa/error'; + export default Maisa; From c8a77bff486ef066c96de6d35246efa96212dbbf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2024 03:06:32 +0000 Subject: [PATCH 006/109] chore: rebuild project due to codegen change (#19) --- package.json | 1 - src/index.ts | 4 ++-- yarn.lock | 40 ---------------------------------------- 3 files changed, 2 insertions(+), 43 deletions(-) diff --git a/package.json b/package.json index 0965d3a..7338ba4 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,6 @@ "jest": "^29.4.0", "prettier": "^3.0.0", "ts-jest": "^29.1.0", - "ts-morph": "^19.0.0", "ts-node": "^10.5.0", "tsc-multi": "^1.1.0", "tsconfig-paths": "^4.0.0", diff --git a/src/index.ts b/src/index.ts index e959acf..1ef33fe 100644 --- a/src/index.ts +++ b/src/index.ts @@ -199,7 +199,7 @@ export declare namespace Maisa { export type TextSummary = API.TextSummary; } -export { toFile, fileFromPath } from 'maisa/uploads'; +export { toFile, fileFromPath } from './uploads'; export { MaisaError, APIError, @@ -214,6 +214,6 @@ export { InternalServerError, PermissionDeniedError, UnprocessableEntityError, -} from 'maisa/error'; +} from './error'; export default Maisa; diff --git a/yarn.lock b/yarn.lock index 14e8a75..bfd47d8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -759,16 +759,6 @@ dependencies: "@swc/counter" "^0.1.3" -"@ts-morph/common@~0.20.0": - version "0.20.0" - resolved "https://registry.yarnpkg.com/@ts-morph/common/-/common-0.20.0.tgz#3f161996b085ba4519731e4d24c35f6cba5b80af" - integrity sha512-7uKjByfbPpwuzkstL3L5MQyuXPSKdoNG93Fmi2JoDcTf3pEP731JdRFAduRVkOs8oqxPsXKA+ScrWkdQ8t/I+Q== - dependencies: - fast-glob "^3.2.12" - minimatch "^7.4.3" - mkdirp "^2.1.6" - path-browserify "^1.0.1" - "@tsconfig/node10@^1.0.7": version "1.0.8" resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.8.tgz#c1e4e80d6f964fbecb3359c43bd48b40f7cadad9" @@ -1315,11 +1305,6 @@ co@^4.6.0: resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" integrity sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ== -code-block-writer@^12.0.0: - version "12.0.0" - resolved "https://registry.yarnpkg.com/code-block-writer/-/code-block-writer-12.0.0.tgz#4dd58946eb4234105aff7f0035977b2afdc2a770" - integrity sha512-q4dMFMlXtKR3XNBHyMHt/3pwYNA69EDk00lloMOaaUMKPUXBw6lpXtbu3MMVG6/uOihGnRDOlkyqsONEUj60+w== - collect-v8-coverage@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz#c0b29bcd33bcd0779a1344c2136051e6afd3d9e9" @@ -2680,23 +2665,11 @@ minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: dependencies: brace-expansion "^1.1.7" -minimatch@^7.4.3: - version "7.4.6" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-7.4.6.tgz#845d6f254d8f4a5e4fd6baf44d5f10c8448365fb" - integrity sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw== - dependencies: - brace-expansion "^2.0.1" - minimist@^1.2.6: version "1.2.6" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== -mkdirp@^2.1.6: - version "2.1.6" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-2.1.6.tgz#964fbcb12b2d8c5d6fbc62a963ac95a273e2cc19" - integrity sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A== - ms@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" @@ -2860,11 +2833,6 @@ parse-json@^5.2.0: json-parse-even-better-errors "^2.3.0" lines-and-columns "^1.1.6" -path-browserify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-browserify/-/path-browserify-1.0.1.tgz#d98454a9c3753d5790860f16f68867b9e46be1fd" - integrity sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g== - path-exists@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" @@ -3283,14 +3251,6 @@ ts-jest@^29.1.0: semver "^7.5.3" yargs-parser "^21.0.1" -ts-morph@^19.0.0: - version "19.0.0" - resolved "https://registry.yarnpkg.com/ts-morph/-/ts-morph-19.0.0.tgz#43e95fb0156c3fe3c77c814ac26b7d0be2f93169" - integrity sha512-D6qcpiJdn46tUqV45vr5UGM2dnIEuTGNxVhg0sk5NX11orcouwj6i1bMqZIz2mZTZB1Hcgy7C3oEVhAT+f6mbQ== - dependencies: - "@ts-morph/common" "~0.20.0" - code-block-writer "^12.0.0" - ts-node@^10.5.0: version "10.7.0" resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.7.0.tgz#35d503d0fab3e2baa672a0e94f4b40653c2463f5" From 424c10e00a0cd21b51295535d875a57b6330c877 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 15 Nov 2024 21:35:37 +0000 Subject: [PATCH 007/109] chore: rebuild project due to codegen change (#20) --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 0e0f5a6..185ccf7 100644 --- a/README.md +++ b/README.md @@ -283,6 +283,15 @@ TypeScript >= 4.5 is supported. The following runtimes are supported: +- Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more) +- Node.js 18 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions. +- Deno v1.28.0 or higher, using `import Maisa from "npm:maisa"`. +- Bun 1.0 or later. +- Cloudflare Workers. +- Vercel Edge Runtime. +- Jest 28 or greater with the `"node"` environment (`"jsdom"` is not supported at this time). +- Nitro v2.6 or greater. + Note that React Native is not supported at this time. If you are interested in other runtime environments, please open or upvote an issue on GitHub. From 31e045e7b6edf51a329a2687ced65d2e278a6cb0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 14:33:24 +0000 Subject: [PATCH 008/109] chore: rebuild project due to codegen change (#21) --- tests/api-resources/kpu.test.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/api-resources/kpu.test.ts b/tests/api-resources/kpu.test.ts index 941576d..a603f9c 100644 --- a/tests/api-resources/kpu.test.ts +++ b/tests/api-resources/kpu.test.ts @@ -25,11 +25,7 @@ describe('resource kpu', () => { query: 'query', explain_steps: true, retries: 1, - file: [ - await toFile(Buffer.from('# my file contents'), 'README.md'), - await toFile(Buffer.from('# my file contents'), 'README.md'), - await toFile(Buffer.from('# my file contents'), 'README.md'), - ], + file: [await toFile(Buffer.from('# my file contents'), 'README.md')], reasoner_model: 'gpt-4-turbo', reasoner_prompt: 'reasoner_prompt', }); From 0331bbaf7ace3113e9bf4d2ba1220813a40e6a28 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 08:19:38 +0000 Subject: [PATCH 009/109] docs: remove suggestion to use `npm` call out (#22) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 185ccf7..fc7835f 100644 --- a/README.md +++ b/README.md @@ -285,7 +285,7 @@ The following runtimes are supported: - Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more) - Node.js 18 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions. -- Deno v1.28.0 or higher, using `import Maisa from "npm:maisa"`. +- Deno v1.28.0 or higher. - Bun 1.0 or later. - Cloudflare Workers. - Vercel Edge Runtime. From 487943aa4079151535a7fd19ea4246cb1607df2b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 20 Nov 2024 08:23:21 +0000 Subject: [PATCH 010/109] chore: remove redundant word in comment (#23) --- scripts/build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build b/scripts/build index 7cf7680..78b38ea 100755 --- a/scripts/build +++ b/scripts/build @@ -32,7 +32,7 @@ npm exec tsc-multi # copy over handwritten .js/.mjs/.d.ts files cp src/_shims/*.{d.ts,js,mjs,md} dist/_shims cp src/_shims/auto/*.{d.ts,js,mjs} dist/_shims/auto -# we need to add exports = module.exports = Maisa Node to index.js; +# we need to add exports = module.exports = Maisa to index.js; # No way to get that from index.ts because it would cause compile errors # when building .mjs node scripts/utils/fix-index-exports.cjs From 987a383228232a8d312ec782149d80593ff9ff08 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 28 Nov 2024 06:03:51 +0000 Subject: [PATCH 011/109] chore(internal): codegen related update (#24) --- package.json | 2 +- scripts/utils/check-is-in-git-install.sh | 2 +- scripts/utils/git-swap.sh | 13 +++++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100755 scripts/utils/git-swap.sh diff --git a/package.json b/package.json index 7338ba4..4af3d08 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "build": "./scripts/build", "prepublishOnly": "echo 'to publish, run yarn build && (cd dist; yarn publish)' && exit 1", "format": "prettier --write --cache --cache-strategy metadata . !dist", - "prepare": "if ./scripts/utils/check-is-in-git-install.sh; then ./scripts/build; fi", + "prepare": "if ./scripts/utils/check-is-in-git-install.sh; then ./scripts/build && ./scripts/utils/git-swap.sh; fi", "tsn": "ts-node -r tsconfig-paths/register", "lint": "./scripts/lint", "fix": "./scripts/format" diff --git a/scripts/utils/check-is-in-git-install.sh b/scripts/utils/check-is-in-git-install.sh index 36bcedc..1354eb4 100755 --- a/scripts/utils/check-is-in-git-install.sh +++ b/scripts/utils/check-is-in-git-install.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Check if you happen to call prepare for a repository that's already in node_modules. [ "$(basename "$(dirname "$PWD")")" = 'node_modules' ] || # The name of the containing directory that 'npm` uses, which looks like diff --git a/scripts/utils/git-swap.sh b/scripts/utils/git-swap.sh new file mode 100755 index 0000000..79d1888 --- /dev/null +++ b/scripts/utils/git-swap.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -exuo pipefail +# the package is published to NPM from ./dist +# we want the final file structure for git installs to match the npm installs, so we + +# delete everything except ./dist and ./node_modules +find . -maxdepth 1 -mindepth 1 ! -name 'dist' ! -name 'node_modules' -exec rm -rf '{}' + + +# move everything from ./dist to . +mv dist/* . + +# delete the now-empty ./dist +rmdir dist From 23917bffd4f82f55f0351786cfec5222b71e0cdd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 15:18:46 +0000 Subject: [PATCH 012/109] wip (#25) --- src/core.ts | 14 ++++---------- yarn.lock | 6 +++--- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/core.ts b/src/core.ts index 4863807..2ed30a8 100644 --- a/src/core.ts +++ b/src/core.ts @@ -523,19 +523,13 @@ export abstract class APIClient { const timeout = setTimeout(() => controller.abort(), ms); return ( - this.getRequestClient() - // use undefined this binding; fetch errors if bound to something else in browser/cloudflare - .fetch.call(undefined, url, { signal: controller.signal as any, ...options }) - .finally(() => { - clearTimeout(timeout); - }) + // use undefined this binding; fetch errors if bound to something else in browser/cloudflare + this.fetch.call(undefined, url, { signal: controller.signal as any, ...options }).finally(() => { + clearTimeout(timeout); + }) ); } - protected getRequestClient(): RequestClient { - return { fetch: this.fetch }; - } - private shouldRetry(response: Response): boolean { // Note this is not a standard header. const shouldRetryHeader = response.headers.get('x-should-retry'); diff --git a/yarn.lock b/yarn.lock index bfd47d8..bb17942 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1370,9 +1370,9 @@ create-require@^1.1.0: integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== cross-spawn@^7.0.2, cross-spawn@^7.0.3: - version "7.0.3" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + version "7.0.6" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" + integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== dependencies: path-key "^3.1.0" shebang-command "^2.0.0" From eeae75a631ce110cada808b8ad0609b0553a7738 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Dec 2024 05:57:49 +0000 Subject: [PATCH 013/109] chore(types): nicer error class types + jsdocs (#26) --- src/error.ts | 64 ++++++++++++++++++++-------------------------------- 1 file changed, 24 insertions(+), 40 deletions(-) diff --git a/src/error.ts b/src/error.ts index 9ceebf9..2ed28f6 100644 --- a/src/error.ts +++ b/src/error.ts @@ -4,17 +4,19 @@ import { castToError, Headers } from './core'; export class MaisaError extends Error {} -export class APIError extends MaisaError { - readonly status: number | undefined; - readonly headers: Headers | undefined; - readonly error: Object | undefined; - - constructor( - status: number | undefined, - error: Object | undefined, - message: string | undefined, - headers: Headers | undefined, - ) { +export class APIError< + TStatus extends number | undefined = number | undefined, + THeaders extends Headers | undefined = Headers | undefined, + TError extends Object | undefined = Object | undefined, +> extends MaisaError { + /** HTTP status for the response that caused the error */ + readonly status: TStatus; + /** HTTP headers for the response that caused the error */ + readonly headers: THeaders; + /** JSON body of the response that caused the error */ + readonly error: TError; + + constructor(status: TStatus, error: TError, message: string | undefined, headers: THeaders) { super(`${APIError.makeMessage(status, error, message)}`); this.status = status; this.headers = headers; @@ -48,7 +50,7 @@ export class APIError extends MaisaError { message: string | undefined, headers: Headers | undefined, ): APIError { - if (!status) { + if (!status || !headers) { return new APIConnectionError({ message, cause: castToError(errorResponse) }); } @@ -90,17 +92,13 @@ export class APIError extends MaisaError { } } -export class APIUserAbortError extends APIError { - override readonly status: undefined = undefined; - +export class APIUserAbortError extends APIError { constructor({ message }: { message?: string } = {}) { super(undefined, undefined, message || 'Request was aborted.', undefined); } } -export class APIConnectionError extends APIError { - override readonly status: undefined = undefined; - +export class APIConnectionError extends APIError { constructor({ message, cause }: { message?: string | undefined; cause?: Error | undefined }) { super(undefined, undefined, message || 'Connection error.', undefined); // in some environments the 'cause' property is already declared @@ -115,32 +113,18 @@ export class APIConnectionTimeoutError extends APIConnectionError { } } -export class BadRequestError extends APIError { - override readonly status: 400 = 400; -} +export class BadRequestError extends APIError<400, Headers> {} -export class AuthenticationError extends APIError { - override readonly status: 401 = 401; -} +export class AuthenticationError extends APIError<401, Headers> {} -export class PermissionDeniedError extends APIError { - override readonly status: 403 = 403; -} +export class PermissionDeniedError extends APIError<403, Headers> {} -export class NotFoundError extends APIError { - override readonly status: 404 = 404; -} +export class NotFoundError extends APIError<404, Headers> {} -export class ConflictError extends APIError { - override readonly status: 409 = 409; -} +export class ConflictError extends APIError<409, Headers> {} -export class UnprocessableEntityError extends APIError { - override readonly status: 422 = 422; -} +export class UnprocessableEntityError extends APIError<422, Headers> {} -export class RateLimitError extends APIError { - override readonly status: 429 = 429; -} +export class RateLimitError extends APIError<429, Headers> {} -export class InternalServerError extends APIError {} +export class InternalServerError extends APIError {} From 694c6745b6a2c622e597ce249746f26f62352f38 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 4 Mar 2025 06:15:35 +0000 Subject: [PATCH 014/109] chore(internal): codegen related update (#27) --- .devcontainer/Dockerfile | 23 ---------------- .devcontainer/devcontainer.json | 27 ++++++++---------- CONTRIBUTING.md | 8 +++--- LICENSE | 2 +- README.md | 49 +++++++++++++++++++++++++++++++-- SECURITY.md | 4 +-- package.json | 14 +++++----- src/core.ts | 40 +++++++++++++++++++-------- src/index.ts | 10 +++---- src/resources/models/index.ts | 2 +- tests/index.test.ts | 24 +++++++++++++++- 11 files changed, 131 insertions(+), 72 deletions(-) delete mode 100644 .devcontainer/Dockerfile diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index 8ea34be..0000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -# syntax=docker/dockerfile:1 -FROM debian:bookworm-slim AS stainless - -RUN apt-get update && apt-get install -y \ - nodejs \ - npm \ - yarnpkg \ - && apt-get clean autoclean - -# Ensure UTF-8 encoding -ENV LANG=C.UTF-8 -ENV LC_ALL=C.UTF-8 - -# Yarn -RUN ln -sf /usr/bin/yarnpkg /usr/bin/yarn - -WORKDIR /workspace - -COPY package.json yarn.lock /workspace/ - -RUN yarn install - -COPY . /workspace diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index d55fc4d..763462f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,20 +1,17 @@ // For format details, see https://aka.ms/devcontainer.json. For config options, see the // README at: https://github.com/devcontainers/templates/tree/main/src/debian { - "name": "Debian", - "build": { - "dockerfile": "Dockerfile" + "name": "Development", + "image": "mcr.microsoft.com/devcontainers/typescript-node:latest", + "features": { + "ghcr.io/devcontainers/features/node:1": {} + }, + "postCreateCommand": "yarn install", + "customizations": { + "vscode": { + "extensions": [ + "esbenp.prettier-vscode" + ] + } } - - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - - // Configure tool-specific properties. - // "customizations": {}, - - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" } diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4d24ab8..1f75bdc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ ## Setting up the environment -This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable). +This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install). Other package managers may work but are not officially supported for development. To set up the repository, run: @@ -29,10 +29,10 @@ All files in the `examples/` directory are not modified by the generator and can … ``` -``` -chmod +x examples/.ts +```sh +$ chmod +x examples/.ts # run the example against your api -yarn tsn -T examples/.ts +$ yarn tsn -T examples/.ts ``` ## Using the repository from source diff --git a/LICENSE b/LICENSE index 34d7846..cab49bf 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2024 Maisa + Copyright 2025 Maisa Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index fc7835f..ac3cae6 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This library provides convenient access to the Maisa REST API from server-side T The REST API documentation can be found on [docs.maisa.ai](https://docs.maisa.ai/). The full API of this library can be found in [api.md](api.md). -It is generated with [Stainless](https://www.stainlessapi.com/). +It is generated with [Stainless](https://www.stainless.com/). ## Installation @@ -53,6 +53,51 @@ main(); Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors. +## File uploads + +Request parameters that correspond to file uploads can be passed in many different forms: + +- `File` (or an object with the same structure) +- a `fetch` `Response` (or an object with the same structure) +- an `fs.ReadStream` +- the return value of our `toFile` helper + +```ts +import fs from 'fs'; +import fetch from 'node-fetch'; +import Maisa, { toFile } from 'maisa'; + +const client = new Maisa(); + +// If you have access to Node `fs` we recommend using `fs.createReadStream()`: +await client.capabilities.media.compare({ + file1: fs.createReadStream('/path/to/file'), + file2: fs.createReadStream('path/to/file'), +}); + +// Or if you have the web `File` API you can pass a `File` instance: +await client.capabilities.media.compare({ + file1: new File(['my bytes'], 'file'), + file2: fs.createReadStream('path/to/file'), +}); + +// You can also pass a `fetch` `Response`: +await client.capabilities.media.compare({ + file1: await fetch('https://somesite/file'), + file2: fs.createReadStream('path/to/file'), +}); + +// Finally, if none of the above are convenient, you can use our `toFile` helper: +await client.capabilities.media.compare({ + file1: await toFile(Buffer.from('my bytes'), 'file'), + file2: fs.createReadStream('path/to/file'), +}); +await client.capabilities.media.compare({ + file1: await toFile(new Uint8Array([0, 1, 2]), 'file'), + file2: fs.createReadStream('path/to/file'), +}); +``` + ## Handling errors When the library is unable to connect to the API, @@ -270,7 +315,7 @@ await client.capabilities.summarize( This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions: 1. Changes that only affect static types, without breaking runtime behavior. -2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_. +2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_ 3. Changes that we do not expect to impact the vast majority of users in practice. We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience. diff --git a/SECURITY.md b/SECURITY.md index 459e731..e69f1e1 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,9 +2,9 @@ ## Reporting Security Issues -This SDK is generated by [Stainless Software Inc](http://stainlessapi.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken. +This SDK is generated by [Stainless Software Inc](http://stainless.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken. -To report a security issue, please contact the Stainless team at security@stainlessapi.com. +To report a security issue, please contact the Stainless team at security@stainless.com. ## Responsible Disclosure diff --git a/package.json b/package.json index 4af3d08..620fdca 100644 --- a/package.json +++ b/package.json @@ -107,17 +107,17 @@ "default": "./dist/index.mjs" }, "./*.mjs": { - "types": "./dist/*.d.ts", - "default": "./dist/*.mjs" + "types": ["./dist/*.d.ts", "./dist/*/index.d.ts"], + "default": ["./dist/*.mjs", "./dist/*/index.mjs"] }, "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" + "types": ["./dist/*.d.ts", "./dist/*/index.d.ts"], + "default": ["./dist/*.js", "./dist/*/index.js"] }, "./*": { - "types": "./dist/*.d.ts", - "require": "./dist/*.js", - "default": "./dist/*.mjs" + "types": ["./dist/*.d.ts", "./dist/*/index.d.ts"], + "require": ["./dist/*.js", "./dist/*/index.js"], + "default": ["./dist/*.mjs", "./dist/*/index.mjs"] } } } diff --git a/src/core.ts b/src/core.ts index 2ed30a8..b65fe4c 100644 --- a/src/core.ts +++ b/src/core.ts @@ -163,7 +163,7 @@ export abstract class APIClient { maxRetries = 2, timeout = 60000, // 1 minute httpAgent, - fetch: overridenFetch, + fetch: overriddenFetch, }: { baseURL: string; maxRetries?: number | undefined; @@ -176,7 +176,7 @@ export abstract class APIClient { this.timeout = validatePositiveInteger('timeout', timeout); this.httpAgent = httpAgent; - this.fetch = overridenFetch ?? fetch; + this.fetch = overriddenFetch ?? fetch; } protected authHeaders(opts: FinalRequestOptions): Headers { @@ -280,6 +280,7 @@ export abstract class APIClient { options: FinalRequestOptions, { retryCount = 0 }: { retryCount?: number } = {}, ): { req: RequestInit; url: string; timeout: number } { + options = { ...options }; const { method, path, query, headers: headers = {} } = options; const body = @@ -292,9 +293,9 @@ export abstract class APIClient { const url = this.buildURL(path!, query); if ('timeout' in options) validatePositiveInteger('timeout', options.timeout); - const timeout = options.timeout ?? this.timeout; + options.timeout = options.timeout ?? this.timeout; const httpAgent = options.httpAgent ?? this.httpAgent ?? getDefaultAgent(url); - const minAgentTimeout = timeout + 1000; + const minAgentTimeout = options.timeout + 1000; if ( typeof (httpAgent as any)?.options?.timeout === 'number' && minAgentTimeout > ((httpAgent as any).options.timeout ?? 0) @@ -323,7 +324,7 @@ export abstract class APIClient { signal: options.signal ?? null, }; - return { req, url, timeout }; + return { req, url, timeout: options.timeout }; } private buildHeaders({ @@ -351,15 +352,22 @@ export abstract class APIClient { delete reqHeaders['content-type']; } - // Don't set the retry count header if it was already set or removed through default headers or by the - // caller. We check `defaultHeaders` and `headers`, which can contain nulls, instead of `reqHeaders` to - // account for the removal case. + // Don't set theses headers if they were already set or removed through default headers or by the caller. + // We check `defaultHeaders` and `headers`, which can contain nulls, instead of `reqHeaders` to account + // for the removal case. if ( getHeader(defaultHeaders, 'x-stainless-retry-count') === undefined && getHeader(headers, 'x-stainless-retry-count') === undefined ) { reqHeaders['x-stainless-retry-count'] = String(retryCount); } + if ( + getHeader(defaultHeaders, 'x-stainless-timeout') === undefined && + getHeader(headers, 'x-stainless-timeout') === undefined && + options.timeout + ) { + reqHeaders['x-stainless-timeout'] = String(options.timeout); + } this.validateHeaders(reqHeaders, headers); @@ -522,9 +530,19 @@ export abstract class APIClient { const timeout = setTimeout(() => controller.abort(), ms); + const fetchOptions = { + signal: controller.signal as any, + ...options, + }; + if (fetchOptions.method) { + // Custom methods like 'patch' need to be uppercased + // See https://github.com/nodejs/undici/issues/2294 + fetchOptions.method = fetchOptions.method.toUpperCase(); + } + return ( // use undefined this binding; fetch errors if bound to something else in browser/cloudflare - this.fetch.call(undefined, url, { signal: controller.signal as any, ...options }).finally(() => { + this.fetch.call(undefined, url, fetchOptions).finally(() => { clearTimeout(timeout); }) ); @@ -970,8 +988,8 @@ export const safeJSON = (text: string) => { } }; -// https://stackoverflow.com/a/19709846 -const startsWithSchemeRegexp = new RegExp('^(?:[a-z]+:)?//', 'i'); +// https://url.spec.whatwg.org/#url-scheme-string +const startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i; const isAbsoluteURL = (url: string): boolean => { return startsWithSchemeRegexp.test(url); }; diff --git a/src/index.ts b/src/index.ts index 1ef33fe..5573ae4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -36,7 +36,7 @@ export interface ClientOptions { * Note that request timeouts are retried by default, so in a worst-case scenario you may wait * much longer than this timeout before the promise succeeds or fails. */ - timeout?: number; + timeout?: number | undefined; /** * An HTTP agent used to manage HTTP(S) connections. @@ -44,7 +44,7 @@ export interface ClientOptions { * If not provided, an agent will be constructed by default in the Node.js environment, * otherwise no agent is used. */ - httpAgent?: Agent; + httpAgent?: Agent | undefined; /** * Specify a custom `fetch` function implementation. @@ -60,7 +60,7 @@ export interface ClientOptions { * * @default 2 */ - maxRetries?: number; + maxRetries?: number | undefined; /** * Default headers to include with every request to the API. @@ -68,7 +68,7 @@ export interface ClientOptions { * These can be removed in individual requests by explicitly setting the * header to `undefined` or `null` in request options. */ - defaultHeaders?: Core.Headers; + defaultHeaders?: Core.Headers | undefined; /** * Default query parameters to include with every request to the API. @@ -76,7 +76,7 @@ export interface ClientOptions { * These can be removed in individual requests by explicitly setting the * param to `undefined` in request options. */ - defaultQuery?: Core.DefaultQuery; + defaultQuery?: Core.DefaultQuery | undefined; } /** diff --git a/src/resources/models/index.ts b/src/resources/models/index.ts index 283a53b..2adeb18 100644 --- a/src/resources/models/index.ts +++ b/src/resources/models/index.ts @@ -1,5 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +export { Embeddings, type EmbeddingCreateParams } from './embeddings'; export { Models } from './models'; export { Rerank } from './rerank'; -export { type Embeddings, type EmbeddingCreateParams } from './embeddings'; diff --git a/tests/index.test.ts b/tests/index.test.ts index 9c031cc..b8c11fa 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -96,6 +96,15 @@ describe('instantiate client', () => { expect(response).toEqual({ url: 'http://localhost:5000/foo', custom: true }); }); + test('explicit global fetch', async () => { + // make sure the global fetch type is assignable to our Fetch type + const client = new Maisa({ + baseURL: 'http://localhost:5000/', + apiKey: 'My API Key', + fetch: defaultFetch, + }); + }); + test('custom signal', async () => { const client = new Maisa({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', @@ -122,6 +131,19 @@ describe('instantiate client', () => { expect(spy).toHaveBeenCalledTimes(1); }); + test('normalized method', async () => { + let capturedRequest: RequestInit | undefined; + const testFetch = async (url: RequestInfo, init: RequestInit = {}): Promise => { + capturedRequest = init; + return new Response(JSON.stringify({}), { headers: { 'Content-Type': 'application/json' } }); + }; + + const client = new Maisa({ baseURL: 'http://localhost:5000/', apiKey: 'My API Key', fetch: testFetch }); + + await client.patch('/foo'); + expect(capturedRequest?.method).toEqual('PATCH'); + }); + describe('baseUrl', () => { test('trailing slash', () => { const client = new Maisa({ baseURL: 'http://localhost:5000/custom/path/', apiKey: 'My API Key' }); @@ -177,7 +199,7 @@ describe('instantiate client', () => { expect(client.apiKey).toBe('My API Key'); }); - test('with overriden environment variable arguments', () => { + test('with overridden environment variable arguments', () => { // set options via env var process.env['MAISA_API_KEY'] = 'another My API Key'; const client = new Maisa({ apiKey: 'My API Key' }); From 3565f732457bbe4e5e0267b46de0f48b0f0b25b4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Mar 2025 06:52:57 +0000 Subject: [PATCH 015/109] feat: add SKIP_BREW env var to ./scripts/bootstrap (#28) --- scripts/bootstrap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/bootstrap b/scripts/bootstrap index 05dd47a..0af58e2 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -4,7 +4,7 @@ set -e cd "$(dirname "$0")/.." -if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then +if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ]; then brew bundle check >/dev/null 2>&1 || { echo "==> Installing Homebrew dependencies…" brew bundle From e18ddd3331647b0c25aed3f6b24d3428df5a64ee Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Mar 2025 07:22:33 +0000 Subject: [PATCH 016/109] feat(client): accept RFC6838 JSON content types (#29) --- src/core.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core.ts b/src/core.ts index b65fe4c..375c701 100644 --- a/src/core.ts +++ b/src/core.ts @@ -48,8 +48,8 @@ async function defaultParseResponse(props: APIResponseProps): Promise { } const contentType = response.headers.get('content-type'); - const isJSON = - contentType?.includes('application/json') || contentType?.includes('application/vnd.api+json'); + const mediaType = contentType?.split(';')[0]?.trim(); + const isJSON = mediaType?.includes('application/json') || mediaType?.endsWith('+json'); if (isJSON) { const json = await response.json(); From de5ba3faf8605c664970d642cfa3d0d0b2aa3f57 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Mar 2025 05:18:58 +0000 Subject: [PATCH 017/109] chore(internal): remove extra empty newlines (#30) --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e3530dc..0312165 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,4 +63,3 @@ jobs: - name: Run tests run: ./scripts/test - From af90af83d326d512b81019f04f9bba84e939c4e4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Mar 2025 05:29:17 +0000 Subject: [PATCH 018/109] fix(exports): ensure resource imports don't require /index (#31) --- src/resources/capabilities.ts | 3 +++ src/resources/file-interpreter.ts | 3 +++ src/resources/mainet.ts | 3 +++ src/resources/models.ts | 3 +++ 4 files changed, 12 insertions(+) create mode 100644 src/resources/capabilities.ts create mode 100644 src/resources/file-interpreter.ts create mode 100644 src/resources/mainet.ts create mode 100644 src/resources/models.ts diff --git a/src/resources/capabilities.ts b/src/resources/capabilities.ts new file mode 100644 index 0000000..f756863 --- /dev/null +++ b/src/resources/capabilities.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './capabilities/index'; diff --git a/src/resources/file-interpreter.ts b/src/resources/file-interpreter.ts new file mode 100644 index 0000000..1771c08 --- /dev/null +++ b/src/resources/file-interpreter.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './file-interpreter/index'; diff --git a/src/resources/mainet.ts b/src/resources/mainet.ts new file mode 100644 index 0000000..72ada94 --- /dev/null +++ b/src/resources/mainet.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './mainet/index'; diff --git a/src/resources/models.ts b/src/resources/models.ts new file mode 100644 index 0000000..8ce5add --- /dev/null +++ b/src/resources/models.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './models/index'; From b97f68a49579b5ef2ea73c4c7989ad7776b3585f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Mar 2025 05:14:42 +0000 Subject: [PATCH 019/109] chore(exports): cleaner resource index imports (#32) --- src/resources.ts | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/resources.ts diff --git a/src/resources.ts b/src/resources.ts new file mode 100644 index 0000000..b283d57 --- /dev/null +++ b/src/resources.ts @@ -0,0 +1 @@ +export * from './resources/index'; From 2282a64da90602664be9ed9e57a7feec170bb88f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Mar 2025 05:15:59 +0000 Subject: [PATCH 020/109] chore(exports): stop using path fallbacks (#33) --- package.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 620fdca..4af3d08 100644 --- a/package.json +++ b/package.json @@ -107,17 +107,17 @@ "default": "./dist/index.mjs" }, "./*.mjs": { - "types": ["./dist/*.d.ts", "./dist/*/index.d.ts"], - "default": ["./dist/*.mjs", "./dist/*/index.mjs"] + "types": "./dist/*.d.ts", + "default": "./dist/*.mjs" }, "./*.js": { - "types": ["./dist/*.d.ts", "./dist/*/index.d.ts"], - "default": ["./dist/*.js", "./dist/*/index.js"] + "types": "./dist/*.d.ts", + "default": "./dist/*.js" }, "./*": { - "types": ["./dist/*.d.ts", "./dist/*/index.d.ts"], - "require": ["./dist/*.js", "./dist/*/index.js"], - "default": ["./dist/*.mjs", "./dist/*/index.mjs"] + "types": "./dist/*.d.ts", + "require": "./dist/*.js", + "default": "./dist/*.mjs" } } } From 4a5837edd9fa1738b823777841874c6106eeba82 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 22 Mar 2025 04:46:10 +0000 Subject: [PATCH 021/109] fix: avoid type error in certain environments (#34) --- src/core.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core.ts b/src/core.ts index 375c701..6abf724 100644 --- a/src/core.ts +++ b/src/core.ts @@ -395,7 +395,7 @@ export abstract class APIClient { !headers ? {} : Symbol.iterator in headers ? Object.fromEntries(Array.from(headers as Iterable).map((header) => [...header])) - : { ...headers } + : { ...(headers as any as Record) } ); } From 41b19e96785cad9931ea781fe89f615021fbaa7f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Mar 2025 03:42:01 +0000 Subject: [PATCH 022/109] codegen metadata --- .stats.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.stats.yml b/.stats.yml index 4076c46..1646475 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,4 @@ configured_endpoints: 13 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/maisa%2FMaisa-c82e0a80b379d33d11af783865ec15844bcd750043bf0f1543ebdf72bda79f3a.yml +openapi_spec_hash: 67e2baafe7455c2a734ac0b0ea699719 +config_hash: d6a8d922bf8b98716e3f55b9c829cd45 From 633b99a727dfdf145a1c2f2f6a7244a6576d13d9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 28 Mar 2025 03:55:55 +0000 Subject: [PATCH 023/109] fix(internal): work around https://github.com/vercel/next.js/issues/76881 (#35) --- src/_shims/index-deno.ts | 2 ++ src/_shims/index.d.ts | 2 ++ src/_shims/index.js | 6 +++++- src/_shims/index.mjs | 6 +++++- src/core.ts | 5 +++++ 5 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/_shims/index-deno.ts b/src/_shims/index-deno.ts index f83d9a2..321a93e 100644 --- a/src/_shims/index-deno.ts +++ b/src/_shims/index-deno.ts @@ -108,3 +108,5 @@ export declare class FsReadStream extends Readable { const _ReadableStream = ReadableStream; type _ReadableStream = ReadableStream; export { _ReadableStream as ReadableStream }; + +export const init = () => {}; diff --git a/src/_shims/index.d.ts b/src/_shims/index.d.ts index 7c1618b..e390617 100644 --- a/src/_shims/index.d.ts +++ b/src/_shims/index.d.ts @@ -79,3 +79,5 @@ export function fileFromPath(path: string, options?: FileFromPathOptions): Promi export function fileFromPath(path: string, filename?: string, options?: FileFromPathOptions): Promise; export function isFsReadStream(value: any): value is FsReadStream; + +export const init: () => void; diff --git a/src/_shims/index.js b/src/_shims/index.js index b8f47cd..85acd63 100644 --- a/src/_shims/index.js +++ b/src/_shims/index.js @@ -3,7 +3,9 @@ */ const shims = require('./registry'); const auto = require('maisa/_shims/auto/runtime'); -if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true }); +exports.init = () => { + if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true }); +}; for (const property of Object.keys(shims)) { Object.defineProperty(exports, property, { get() { @@ -11,3 +13,5 @@ for (const property of Object.keys(shims)) { }, }); } + +exports.init(); diff --git a/src/_shims/index.mjs b/src/_shims/index.mjs index 5f93ce1..172405e 100644 --- a/src/_shims/index.mjs +++ b/src/_shims/index.mjs @@ -3,5 +3,9 @@ */ import * as shims from './registry.mjs'; import * as auto from 'maisa/_shims/auto/runtime'; -if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true }); +export const init = () => { + if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true }); +}; export * from './registry.mjs'; + +init(); diff --git a/src/core.ts b/src/core.ts index 6abf724..9705865 100644 --- a/src/core.ts +++ b/src/core.ts @@ -16,7 +16,12 @@ import { type RequestInit, type Response, type HeadersInit, + init, } from './_shims/index'; + +// try running side effects outside of _shims/index to workaround https://github.com/vercel/next.js/issues/76881 +init(); + export { type Response }; import { BlobLike, isBlobLike, isMultipartBody } from './uploads'; export { From b0e7faa8126499453343390a7be1bb0c9d63dda5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 3 Apr 2025 07:50:50 +0000 Subject: [PATCH 024/109] fix(client): send `X-Stainless-Timeout` in seconds (#36) --- src/core.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core.ts b/src/core.ts index 9705865..634ab0c 100644 --- a/src/core.ts +++ b/src/core.ts @@ -371,7 +371,7 @@ export abstract class APIClient { getHeader(headers, 'x-stainless-timeout') === undefined && options.timeout ) { - reqHeaders['x-stainless-timeout'] = String(options.timeout); + reqHeaders['x-stainless-timeout'] = String(Math.trunc(options.timeout / 1000)); } this.validateHeaders(reqHeaders, headers); From bff89bef422def683f609dfe2b002a183d48e872 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 3 Apr 2025 08:15:26 +0000 Subject: [PATCH 025/109] chore(internal): add aliases for Record and Array (#37) --- src/core.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/core.ts b/src/core.ts index 634ab0c..eaa383a 100644 --- a/src/core.ts +++ b/src/core.ts @@ -33,6 +33,20 @@ export { export type Fetch = (url: RequestInfo, init?: RequestInit) => Promise; +/** + * An alias to the builtin `Array` type so we can + * easily alias it in import statements if there are name clashes. + */ +type _Array = Array; + +/** + * An alias to the builtin `Record` type so we can + * easily alias it in import statements if there are name clashes. + */ +type _Record = Record; + +export type { _Array as Array, _Record as Record }; + type PromiseOrValue = T | Promise; type APIResponseProps = { From 837d599f19c3d9b7e57802e72bc258c338d6db9c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 4 Apr 2025 09:58:40 +0000 Subject: [PATCH 026/109] fix(api): improve type resolution when importing as a package (#38) --- packages/mcp-server/src/tools.ts | 1 + 1 file changed, 1 insertion(+) create mode 100644 packages/mcp-server/src/tools.ts diff --git a/packages/mcp-server/src/tools.ts b/packages/mcp-server/src/tools.ts new file mode 100644 index 0000000..7e516de --- /dev/null +++ b/packages/mcp-server/src/tools.ts @@ -0,0 +1 @@ +export * from './tools/index'; From 9a32b3417bdebbde3a678e5768107c07d023442f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 5 Apr 2025 02:23:04 +0000 Subject: [PATCH 027/109] fix(mcp): remove unused tools.ts (#39) --- packages/mcp-server/src/tools.ts | 1 - 1 file changed, 1 deletion(-) delete mode 100644 packages/mcp-server/src/tools.ts diff --git a/packages/mcp-server/src/tools.ts b/packages/mcp-server/src/tools.ts deleted file mode 100644 index 7e516de..0000000 --- a/packages/mcp-server/src/tools.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './tools/index'; From 50475c4c257096ca8c8b06d6cdb970f383c1b3bf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 9 Apr 2025 02:48:44 +0000 Subject: [PATCH 028/109] chore(tests): improve enum examples (#40) --- tests/api-resources/capabilities/capabilities.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/api-resources/capabilities/capabilities.test.ts b/tests/api-resources/capabilities/capabilities.test.ts index 508054b..ec4bf8e 100644 --- a/tests/api-resources/capabilities/capabilities.test.ts +++ b/tests/api-resources/capabilities/capabilities.test.ts @@ -72,7 +72,7 @@ describe('resource capabilities', () => { text: 'Example long text...', format: 'paragraph', lang: 'en', - length: 'short', + length: 'medium', summary_hint: 'Example summary of the text...', }); }); From c1939edb4f841356930782d377c66aea05aed0b5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 10 Apr 2025 02:43:34 +0000 Subject: [PATCH 029/109] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 1646475..817e922 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 13 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/maisa%2FMaisa-c82e0a80b379d33d11af783865ec15844bcd750043bf0f1543ebdf72bda79f3a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/maisa%2Fmaisa-c82e0a80b379d33d11af783865ec15844bcd750043bf0f1543ebdf72bda79f3a.yml openapi_spec_hash: 67e2baafe7455c2a734ac0b0ea699719 config_hash: d6a8d922bf8b98716e3f55b9c829cd45 From 730ed99464ca7b778e0fa030eb6b7b6b9f26d61e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 10 Apr 2025 02:48:40 +0000 Subject: [PATCH 030/109] chore(internal): upload builds and expand CI branch coverage --- .github/workflows/ci.yml | 36 ++++++++++++++++++++++---------- scripts/utils/upload-artifact.sh | 25 ++++++++++++++++++++++ 2 files changed, 50 insertions(+), 11 deletions(-) create mode 100755 scripts/utils/upload-artifact.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0312165..304de46 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,19 +1,18 @@ name: CI on: push: - branches: - - main - pull_request: - branches: - - main - - next + branches-ignore: + - 'generated' + - 'codegen/**' + - 'integrated/**' + - 'preview-head/**' + - 'preview-base/**' + - 'preview/**' jobs: lint: name: lint runs-on: ubuntu-latest - - steps: - uses: actions/checkout@v4 @@ -31,8 +30,9 @@ jobs: build: name: build runs-on: ubuntu-latest - - + permissions: + contents: read + id-token: write steps: - uses: actions/checkout@v4 @@ -46,10 +46,24 @@ jobs: - name: Check build run: ./scripts/build + + - name: Get GitHub OIDC Token + if: github.repository == 'stainless-sdks/maisa-node' + id: github-oidc + uses: actions/github-script@v6 + with: + script: core.setOutput('github_token', await core.getIDToken()); + + - name: Upload tarball + if: github.repository == 'stainless-sdks/maisa-node' + env: + URL: https://pkg.stainless.com/s + AUTH: ${{ steps.github-oidc.outputs.github_token }} + SHA: ${{ github.sha }} + run: ./scripts/utils/upload-artifact.sh test: name: test runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh new file mode 100755 index 0000000..a9cf996 --- /dev/null +++ b/scripts/utils/upload-artifact.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -exuo pipefail + +RESPONSE=$(curl -X POST "$URL" \ + -H "Authorization: Bearer $AUTH" \ + -H "Content-Type: application/json") + +SIGNED_URL=$(echo "$RESPONSE" | jq -r '.url') + +if [[ "$SIGNED_URL" == "null" ]]; then + echo -e "\033[31mFailed to get signed URL.\033[0m" + exit 1 +fi + +UPLOAD_RESPONSE=$(tar -cz dist | curl -v -X PUT \ + -H "Content-Type: application/gzip" \ + --data-binary @- "$SIGNED_URL" 2>&1) + +if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then + echo -e "\033[32mUploaded build to Stainless storage.\033[0m" + echo -e "\033[32mInstallation: npm install 'https://pkg.stainless.com/s/maisa-node/$SHA'\033[0m" +else + echo -e "\033[31mFailed to upload artifact.\033[0m" + exit 1 +fi From 94b6670329550c6a11860790403bd1b2cdcbd602 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 10 Apr 2025 02:53:48 +0000 Subject: [PATCH 031/109] chore(internal): reduce CI branch coverage --- .github/workflows/ci.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 304de46..b5ad7a3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,13 +1,12 @@ name: CI on: push: - branches-ignore: - - 'generated' - - 'codegen/**' - - 'integrated/**' - - 'preview-head/**' - - 'preview-base/**' - - 'preview/**' + branches: + - main + pull_request: + branches: + - main + - next jobs: lint: From 0924cf64d7d97376b782168885e8076fa410b1cc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 15 Apr 2025 03:05:54 +0000 Subject: [PATCH 032/109] chore(client): minor internal fixes --- src/core.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core.ts b/src/core.ts index eaa383a..f233631 100644 --- a/src/core.ts +++ b/src/core.ts @@ -296,10 +296,10 @@ export abstract class APIClient { } buildRequest( - options: FinalRequestOptions, + inputOptions: FinalRequestOptions, { retryCount = 0 }: { retryCount?: number } = {}, ): { req: RequestInit; url: string; timeout: number } { - options = { ...options }; + const options = { ...inputOptions }; const { method, path, query, headers: headers = {} } = options; const body = @@ -327,8 +327,8 @@ export abstract class APIClient { } if (this.idempotencyHeader && method !== 'get') { - if (!options.idempotencyKey) options.idempotencyKey = this.defaultIdempotencyKey(); - headers[this.idempotencyHeader] = options.idempotencyKey; + if (!inputOptions.idempotencyKey) inputOptions.idempotencyKey = this.defaultIdempotencyKey(); + headers[this.idempotencyHeader] = inputOptions.idempotencyKey; } const reqHeaders = this.buildHeaders({ options, headers, contentLength, retryCount }); From 959262c3ac17fceccc76a32ef23c977fa8689201 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Apr 2025 03:38:10 +0000 Subject: [PATCH 033/109] chore(ci): add timeout thresholds for CI jobs --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b5ad7a3..01b6770 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,7 @@ on: jobs: lint: + timeout-minutes: 10 name: lint runs-on: ubuntu-latest steps: @@ -27,6 +28,7 @@ jobs: run: ./scripts/lint build: + timeout-minutes: 5 name: build runs-on: ubuntu-latest permissions: @@ -61,6 +63,7 @@ jobs: SHA: ${{ github.sha }} run: ./scripts/utils/upload-artifact.sh test: + timeout-minutes: 10 name: test runs-on: ubuntu-latest steps: From 618a3aa37451f0a7724ca0d5f1655174eb737c32 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 02:38:59 +0000 Subject: [PATCH 034/109] chore(internal): codegen related update --- .github/workflows/ci.yml | 18 +++++++++--------- .github/workflows/publish-npm.yml | 2 +- .github/workflows/release-doctor.yml | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 01b6770..1dbf4b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,18 +1,18 @@ name: CI on: push: - branches: - - main - pull_request: - branches: - - main - - next + branches-ignore: + - 'generated' + - 'codegen/**' + - 'integrated/**' + - 'stl-preview-head/**' + - 'stl-preview-base/**' jobs: lint: timeout-minutes: 10 name: lint - runs-on: ubuntu-latest + runs-on: depot-ubuntu-24.04 steps: - uses: actions/checkout@v4 @@ -30,7 +30,7 @@ jobs: build: timeout-minutes: 5 name: build - runs-on: ubuntu-latest + runs-on: depot-ubuntu-24.04 permissions: contents: read id-token: write @@ -65,7 +65,7 @@ jobs: test: timeout-minutes: 10 name: test - runs-on: ubuntu-latest + runs-on: depot-ubuntu-24.04 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index f6002f1..9ac3c8c 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -11,7 +11,7 @@ on: jobs: publish: name: publish - runs-on: ubuntu-latest + runs-on: depot-ubuntu-24.04 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 56b7304..f12a7ef 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -8,7 +8,7 @@ on: jobs: release_doctor: name: release doctor - runs-on: ubuntu-latest + runs-on: depot-ubuntu-24.04 if: github.repository == 'maisaai/node-sdk' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: From 4016e99d9c7d17947730fbae49b242e039753d5f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Apr 2025 02:39:46 +0000 Subject: [PATCH 035/109] chore(ci): only use depot for staging repos --- .github/workflows/ci.yml | 6 +++--- .github/workflows/publish-npm.yml | 2 +- .github/workflows/release-doctor.yml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1dbf4b7..9341e38 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: lint: timeout-minutes: 10 name: lint - runs-on: depot-ubuntu-24.04 + runs-on: ${{ github.repository == 'stainless-sdks/maisa-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} steps: - uses: actions/checkout@v4 @@ -30,7 +30,7 @@ jobs: build: timeout-minutes: 5 name: build - runs-on: depot-ubuntu-24.04 + runs-on: ${{ github.repository == 'stainless-sdks/maisa-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} permissions: contents: read id-token: write @@ -65,7 +65,7 @@ jobs: test: timeout-minutes: 10 name: test - runs-on: depot-ubuntu-24.04 + runs-on: ${{ github.repository == 'stainless-sdks/maisa-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 9ac3c8c..f6002f1 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -11,7 +11,7 @@ on: jobs: publish: name: publish - runs-on: depot-ubuntu-24.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index f12a7ef..56b7304 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -8,7 +8,7 @@ on: jobs: release_doctor: name: release doctor - runs-on: depot-ubuntu-24.04 + runs-on: ubuntu-latest if: github.repository == 'maisaai/node-sdk' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: From 9d4ca9a8d674e96e4897fb4a54c66664e5493bb6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 1 May 2025 03:29:13 +0000 Subject: [PATCH 036/109] docs(readme): fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ac3cae6..c2aa193 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ async function main() { main(); ``` -Error codes are as followed: +Error codes are as follows: | Status Code | Error Type | | ----------- | -------------------------- | From 202d49b4ae927a582b8b40c5e28c0593f17f5886 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 7 May 2025 04:41:03 +0000 Subject: [PATCH 037/109] chore(ci): bump node version for release workflows --- .github/workflows/ci.yml | 2 +- .github/workflows/publish-npm.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9341e38..4f81b4d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,7 +72,7 @@ jobs: - name: Set up Node uses: actions/setup-node@v4 with: - node-version: '18' + node-version: '20' - name: Bootstrap run: ./scripts/bootstrap diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index f6002f1..fbe3db6 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Node uses: actions/setup-node@v3 with: - node-version: '18' + node-version: '20' - name: Install dependencies run: | From c89ae8d485ad35edf887a691dba66f1730f7f714 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 7 May 2025 04:44:53 +0000 Subject: [PATCH 038/109] docs: add examples to tsdocs --- src/resources/capabilities/capabilities.ts | 34 ++++++++++++++++++++++ src/resources/capabilities/media.ts | 25 ++++++++++++++++ src/resources/models/embeddings.ts | 7 +++++ 3 files changed, 66 insertions(+) diff --git a/src/resources/capabilities/capabilities.ts b/src/resources/capabilities/capabilities.ts index b9e2fac..38856ed 100644 --- a/src/resources/capabilities/capabilities.ts +++ b/src/resources/capabilities/capabilities.ts @@ -11,6 +11,20 @@ export class Capabilities extends APIResource { /** * Compare extracts of text based on a specific data. + * + * @example + * ```ts + * const textComparator = await client.capabilities.compare({ + * text1: 'Lorem Ipsum dolor sit amet', + * text2: 'Sed ut perspiciatis unde omnis', + * variables: { + * name: { + * description: 'The name of the person.', + * type: 'string', + * }, + * }, + * }); + * ``` */ compare( body: CapabilityCompareParams, @@ -22,6 +36,19 @@ export class Capabilities extends APIResource { /** * Extracts structured data from text. The text is analyzed and the variables are * extracted. + * + * @example + * ```ts + * const textExtractor = await client.capabilities.extract({ + * text: 'Example long text...', + * variables: { + * name: { + * description: 'The name of the person.', + * type: 'string', + * }, + * }, + * }); + * ``` */ extract( body: CapabilityExtractParams, @@ -32,6 +59,13 @@ export class Capabilities extends APIResource { /** * Summarizes a text. The summary is returned in the format and length specified. + * + * @example + * ```ts + * const textSummary = await client.capabilities.summarize({ + * text: 'Example long text...', + * }); + * ``` */ summarize( body: CapabilitySummarizeParams, diff --git a/src/resources/capabilities/media.ts b/src/resources/capabilities/media.ts index a859f1f..d603ac8 100644 --- a/src/resources/capabilities/media.ts +++ b/src/resources/capabilities/media.ts @@ -9,6 +9,15 @@ export class Media extends APIResource { * Compare extracts of media files based on a specific data. This endpoint supports * an additional field `model` documented in this url: * https://docs.maisa.ai/docs/capabilities-with-media-via-json-config + * + * @example + * ```ts + * const textComparator = + * await client.capabilities.media.compare({ + * file1: fs.createReadStream('path/to/file'), + * file2: fs.createReadStream('path/to/file'), + * }); + * ``` */ compare(body: MediaCompareParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post( @@ -21,6 +30,14 @@ export class Media extends APIResource { * Extracts structured data from a file. The text is analyzed and the variables are * extracted. This endpoint supports an additional field `model` documented in this * url: https://docs.maisa.ai/docs/capabilities-with-media-via-json-config + * + * @example + * ```ts + * const textExtractor = + * await client.capabilities.media.extract({ + * file: fs.createReadStream('path/to/file'), + * }); + * ``` */ extract(body: MediaExtractParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post( @@ -33,6 +50,14 @@ export class Media extends APIResource { * Summarizes a media file. This endpoint supports an additional field `model` * documented in this url: * https://docs.maisa.ai/docs/capabilities-with-media-via-json-config + * + * @example + * ```ts + * const textSummary = + * await client.capabilities.media.summarize({ + * file: fs.createReadStream('path/to/file'), + * }); + * ``` */ summarize(body: MediaSummarizeParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post( diff --git a/src/resources/models/embeddings.ts b/src/resources/models/embeddings.ts index c16e9cb..7969bb9 100644 --- a/src/resources/models/embeddings.ts +++ b/src/resources/models/embeddings.ts @@ -6,6 +6,13 @@ import * as Core from '../../core'; export class Embeddings extends APIResource { /** * Creates embeddings from pieces of text. + * + * @example + * ```ts + * const embeddings = await client.models.embeddings.create({ + * texts: ['string'], + * }); + * ``` */ create(body: EmbeddingCreateParams, options?: Core.RequestOptions): Core.APIPromise { return this._client.post('/v1/models/embeddings', { body, ...options }); From 2966ec5dbf5ce47edd2814ca2645608706d56a27 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 22 May 2025 02:36:29 +0000 Subject: [PATCH 039/109] chore(docs): grammar improvements --- SECURITY.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index e69f1e1..f7e8253 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -16,11 +16,11 @@ before making any information public. ## Reporting Non-SDK Related Security Issues If you encounter security issues that are not directly related to SDKs but pertain to the services -or products provided by Maisa please follow the respective company's security reporting guidelines. +or products provided by Maisa, please follow the respective company's security reporting guidelines. ### Maisa Terms and Policies -Please contact support@maisa.ai for any questions or concerns regarding security of our services. +Please contact support@maisa.ai for any questions or concerns regarding the security of our services. --- From 2a38060be33b58fd6d298881574aed704834c2a8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 28 May 2025 03:45:58 +0000 Subject: [PATCH 040/109] chore: improve publish-npm script --latest tag logic --- bin/publish-npm | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/bin/publish-npm b/bin/publish-npm index 4c21181..2505dec 100644 --- a/bin/publish-npm +++ b/bin/publish-npm @@ -4,19 +4,35 @@ set -eux npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN" -# Build the project yarn build - -# Navigate to the dist directory cd dist -# Get the version from package.json +# Get latest version from npm +# +# If the package doesn't exist, yarn will return +# {"type":"error","data":"Received invalid response from npm."} +# where .data.version doesn't exist so LAST_VERSION will be an empty string. +LAST_VERSION="$(yarn info --json 2> /dev/null | jq -r '.data.version')" + +# Get current version from package.json VERSION="$(node -p "require('./package.json').version")" -# Extract the pre-release tag if it exists +# Check if current version is pre-release (e.g. alpha / beta / rc) +CURRENT_IS_PRERELEASE=false if [[ "$VERSION" =~ -([a-zA-Z]+) ]]; then - # Extract the part before any dot in the pre-release identifier - TAG="${BASH_REMATCH[1]}" + CURRENT_IS_PRERELEASE=true + CURRENT_TAG="${BASH_REMATCH[1]}" +fi + +# Check if last version is a stable release +LAST_IS_STABLE_RELEASE=true +if [[ -z "$LAST_VERSION" || "$LAST_VERSION" =~ -([a-zA-Z]+) ]]; then + LAST_IS_STABLE_RELEASE=false +fi + +# Use a corresponding alpha/beta tag if there already is a stable release and we're publishing a prerelease. +if $CURRENT_IS_PRERELEASE && $LAST_IS_STABLE_RELEASE; then + TAG="$CURRENT_TAG" else TAG="latest" fi From cb120430cdf94f774ec6d49500ad57d9fde5622a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Jun 2025 04:15:40 +0000 Subject: [PATCH 041/109] chore(docs): use top-level-await in example snippets --- README.md | 42 +++++++++++++++--------------------------- 1 file changed, 15 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index c2aa193..9d0ca56 100644 --- a/README.md +++ b/README.md @@ -24,13 +24,9 @@ import Maisa from 'maisa'; const client = new Maisa(); -async function main() { - const textSummary = await client.capabilities.summarize({ text: 'Example long text...' }); +const textSummary = await client.capabilities.summarize({ text: 'Example long text...' }); - console.log(textSummary.summary); -} - -main(); +console.log(textSummary.summary); ``` ### Request & Response types @@ -43,12 +39,8 @@ import Maisa from 'maisa'; const client = new Maisa(); -async function main() { - const params: Maisa.CapabilitySummarizeParams = { text: 'Example long text...' }; - const textSummary: Maisa.TextSummary = await client.capabilities.summarize(params); -} - -main(); +const params: Maisa.CapabilitySummarizeParams = { text: 'Example long text...' }; +const textSummary: Maisa.TextSummary = await client.capabilities.summarize(params); ``` Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors. @@ -106,21 +98,17 @@ a subclass of `APIError` will be thrown: ```ts -async function main() { - const textSummary = await client.capabilities - .summarize({ text: 'Example long text...' }) - .catch(async (err) => { - if (err instanceof Maisa.APIError) { - console.log(err.status); // 400 - console.log(err.name); // BadRequestError - console.log(err.headers); // {server: 'nginx', ...} - } else { - throw err; - } - }); -} - -main(); +const textSummary = await client.capabilities + .summarize({ text: 'Example long text...' }) + .catch(async (err) => { + if (err instanceof Maisa.APIError) { + console.log(err.status); // 400 + console.log(err.name); // BadRequestError + console.log(err.headers); // {server: 'nginx', ...} + } else { + throw err; + } + }); ``` Error codes are as follows: From 9fcc1d6feeb78995559669a6812fa0a44a10afe0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 14 Jun 2025 02:30:41 +0000 Subject: [PATCH 042/109] =?UTF-8?q?fix:=20publish=20script=20=E2=80=94=20h?= =?UTF-8?q?andle=20NPM=20errors=20correctly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/publish-npm | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/bin/publish-npm b/bin/publish-npm index 2505dec..fa2243d 100644 --- a/bin/publish-npm +++ b/bin/publish-npm @@ -7,15 +7,35 @@ npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN" yarn build cd dist +# Get package name and version from package.json +PACKAGE_NAME="$(jq -r -e '.name' ./package.json)" +VERSION="$(jq -r -e '.version' ./package.json)" + # Get latest version from npm # -# If the package doesn't exist, yarn will return -# {"type":"error","data":"Received invalid response from npm."} -# where .data.version doesn't exist so LAST_VERSION will be an empty string. -LAST_VERSION="$(yarn info --json 2> /dev/null | jq -r '.data.version')" - -# Get current version from package.json -VERSION="$(node -p "require('./package.json').version")" +# If the package doesn't exist, npm will return: +# { +# "error": { +# "code": "E404", +# "summary": "Unpublished on 2025-06-05T09:54:53.528Z", +# "detail": "'the_package' is not in this registry..." +# } +# } +NPM_INFO="$(npm view "$PACKAGE_NAME" version --json 2>/dev/null || true)" + +# Check if we got an E404 error +if echo "$NPM_INFO" | jq -e '.error.code == "E404"' > /dev/null 2>&1; then + # Package doesn't exist yet, no last version + LAST_VERSION="" +elif echo "$NPM_INFO" | jq -e '.error' > /dev/null 2>&1; then + # Report other errors + echo "ERROR: npm returned unexpected data:" + echo "$NPM_INFO" + exit 1 +else + # Success - get the version + LAST_VERSION=$(echo "$NPM_INFO" | jq -r '.') # strip quotes +fi # Check if current version is pre-release (e.g. alpha / beta / rc) CURRENT_IS_PRERELEASE=false From eef6cdcf1d8c744254b9cfb402b08b0f311cdce6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 14 Jun 2025 02:45:01 +0000 Subject: [PATCH 043/109] chore(internal): make base APIResource abstract --- scripts/build | 2 +- src/resource.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build b/scripts/build index 78b38ea..21e4d5a 100755 --- a/scripts/build +++ b/scripts/build @@ -28,7 +28,7 @@ fi node scripts/utils/make-dist-package-json.cjs > dist/package.json # build to .js/.mjs/.d.ts files -npm exec tsc-multi +./node_modules/.bin/tsc-multi # copy over handwritten .js/.mjs/.d.ts files cp src/_shims/*.{d.ts,js,mjs,md} dist/_shims cp src/_shims/auto/*.{d.ts,js,mjs} dist/_shims/auto diff --git a/src/resource.ts b/src/resource.ts index 664cba0..75bbec9 100644 --- a/src/resource.ts +++ b/src/resource.ts @@ -2,7 +2,7 @@ import type { Maisa } from './index'; -export class APIResource { +export abstract class APIResource { protected _client: Maisa; constructor(client: Maisa) { From d3cec191d768c173919950d80367d2e78888dde7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Jun 2025 04:04:23 +0000 Subject: [PATCH 044/109] feat(client): add support for endpoint-specific base URLs --- src/core.ts | 15 +++++++++++---- src/index.ts | 8 ++++++++ tests/index.test.ts | 22 ++++++++++++++++++++++ 3 files changed, 41 insertions(+), 4 deletions(-) diff --git a/src/core.ts b/src/core.ts index f233631..92c06fd 100644 --- a/src/core.ts +++ b/src/core.ts @@ -170,6 +170,7 @@ export class APIPromise extends Promise { export abstract class APIClient { baseURL: string; + #baseURLOverridden: boolean; maxRetries: number; timeout: number; httpAgent: Agent | undefined; @@ -179,18 +180,21 @@ export abstract class APIClient { constructor({ baseURL, + baseURLOverridden, maxRetries = 2, timeout = 60000, // 1 minute httpAgent, fetch: overriddenFetch, }: { baseURL: string; + baseURLOverridden: boolean; maxRetries?: number | undefined; timeout: number | undefined; httpAgent: Agent | undefined; fetch: Fetch | undefined; }) { this.baseURL = baseURL; + this.#baseURLOverridden = baseURLOverridden; this.maxRetries = validatePositiveInteger('maxRetries', maxRetries); this.timeout = validatePositiveInteger('timeout', timeout); this.httpAgent = httpAgent; @@ -300,7 +304,7 @@ export abstract class APIClient { { retryCount = 0 }: { retryCount?: number } = {}, ): { req: RequestInit; url: string; timeout: number } { const options = { ...inputOptions }; - const { method, path, query, headers: headers = {} } = options; + const { method, path, query, defaultBaseURL, headers: headers = {} } = options; const body = ArrayBuffer.isView(options.body) || (options.__binaryRequest && typeof options.body === 'string') ? @@ -310,7 +314,7 @@ export abstract class APIClient { : null; const contentLength = this.calculateContentLength(body); - const url = this.buildURL(path!, query); + const url = this.buildURL(path!, query, defaultBaseURL); if ('timeout' in options) validatePositiveInteger('timeout', options.timeout); options.timeout = options.timeout ?? this.timeout; const httpAgent = options.httpAgent ?? this.httpAgent ?? getDefaultAgent(url); @@ -503,11 +507,12 @@ export abstract class APIClient { return new PagePromise(this, request, Page); } - buildURL(path: string, query: Req | null | undefined): string { + buildURL(path: string, query: Req | null | undefined, defaultBaseURL?: string | undefined): string { + const baseURL = (!this.#baseURLOverridden && defaultBaseURL) || this.baseURL; const url = isAbsoluteURL(path) ? new URL(path) - : new URL(this.baseURL + (this.baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path)); + : new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path)); const defaultQuery = this.defaultQuery(); if (!isEmptyObj(defaultQuery)) { @@ -792,6 +797,7 @@ export type RequestOptions< query?: Req | undefined; body?: Req | null | undefined; headers?: Headers | undefined; + defaultBaseURL?: string | undefined; maxRetries?: number; stream?: boolean | undefined; @@ -813,6 +819,7 @@ const requestOptionsKeys: KeysEnum = { query: true, body: true, headers: true, + defaultBaseURL: true, maxRetries: true, stream: true, diff --git a/src/index.ts b/src/index.ts index 5573ae4..be2beb5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -118,6 +118,7 @@ export class Maisa extends Core.APIClient { super({ baseURL: options.baseURL!, + baseURLOverridden: baseURL ? baseURL !== 'https://api.maisa.ai' : false, timeout: options.timeout ?? 60000 /* 1 minute */, httpAgent: options.httpAgent, maxRetries: options.maxRetries, @@ -135,6 +136,13 @@ export class Maisa extends Core.APIClient { fileInterpreter: API.FileInterpreter = new API.FileInterpreter(this); mainet: API.Mainet = new API.Mainet(this); + /** + * Check whether the base URL is set to its default. + */ + #baseURLOverridden(): boolean { + return this.baseURL !== 'https://api.maisa.ai'; + } + protected override defaultQuery(): Core.DefaultQuery | undefined { return this._options.defaultQuery; } diff --git a/tests/index.test.ts b/tests/index.test.ts index b8c11fa..85e2da9 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -181,6 +181,28 @@ describe('instantiate client', () => { const client = new Maisa({ apiKey: 'My API Key' }); expect(client.baseURL).toEqual('https://api.maisa.ai'); }); + + test('in request options', () => { + const client = new Maisa({ apiKey: 'My API Key' }); + expect(client.buildURL('/foo', null, 'http://localhost:5000/option')).toEqual( + 'http://localhost:5000/option/foo', + ); + }); + + test('in request options overridden by client options', () => { + const client = new Maisa({ apiKey: 'My API Key', baseURL: 'http://localhost:5000/client' }); + expect(client.buildURL('/foo', null, 'http://localhost:5000/option')).toEqual( + 'http://localhost:5000/client/foo', + ); + }); + + test('in request options overridden by env variable', () => { + process.env['MAISA_BASE_URL'] = 'http://localhost:5000/env'; + const client = new Maisa({ apiKey: 'My API Key' }); + expect(client.buildURL('/foo', null, 'http://localhost:5000/option')).toEqual( + 'http://localhost:5000/env/foo', + ); + }); }); test('maxRetries option is correctly set', () => { From 554bc435bf0c35ccbdf153d9e3d90c92c8020075 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Jun 2025 06:50:37 +0000 Subject: [PATCH 045/109] chore(ci): enable for pull requests --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4f81b4d..02aecd9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,10 @@ on: - 'integrated/**' - 'stl-preview-head/**' - 'stl-preview-base/**' + pull_request: + branches-ignore: + - 'stl-preview-head/**' + - 'stl-preview-base/**' jobs: lint: From affc92743d1fac0b927a20f155ef51d6df4c88a8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Jun 2025 04:46:10 +0000 Subject: [PATCH 046/109] refactor(types): replace Record with mapped types --- src/resources/capabilities/capabilities.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/resources/capabilities/capabilities.ts b/src/resources/capabilities/capabilities.ts index 38856ed..f607012 100644 --- a/src/resources/capabilities/capabilities.ts +++ b/src/resources/capabilities/capabilities.ts @@ -89,7 +89,7 @@ export interface CapabilityCompareParams { /** * The variables to be compared. */ - variables: Record; + variables: { [key: string]: CapabilityCompareParams.Variables }; /** * The language of the output. If not provided, the language used will be the same @@ -126,7 +126,7 @@ export interface CapabilityExtractParams { /** * The variables to be extracted from the text. */ - variables: Record; + variables: { [key: string]: CapabilityExtractParams.Variables }; /** * The language of the output. If not provided, the language used will be the same From 2683b03ddccdf2dede541acdded547ab985d5419 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 27 Jun 2025 02:40:46 +0000 Subject: [PATCH 047/109] =?UTF-8?q?fix(ci):=20release-doctor=20=E2=80=94?= =?UTF-8?q?=20report=20correct=20token=20name?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/check-release-environment | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/check-release-environment b/bin/check-release-environment index 85f403d..e4b6d58 100644 --- a/bin/check-release-environment +++ b/bin/check-release-environment @@ -3,7 +3,7 @@ errors=() if [ -z "${NPM_TOKEN}" ]; then - errors+=("The MAISA_NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets") + errors+=("The NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets") fi lenErrors=${#errors[@]} From 411ababaa9cb6fd7c35bdb28891f6c2ccbfb4c6a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 28 Jun 2025 08:40:07 +0000 Subject: [PATCH 048/109] chore(ci): only run for pushes and fork pull requests --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 02aecd9..c9319e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,6 +17,7 @@ jobs: timeout-minutes: 10 name: lint runs-on: ${{ github.repository == 'stainless-sdks/maisa-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@v4 @@ -35,6 +36,7 @@ jobs: timeout-minutes: 5 name: build runs-on: ${{ github.repository == 'stainless-sdks/maisa-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork permissions: contents: read id-token: write @@ -70,6 +72,7 @@ jobs: timeout-minutes: 10 name: test runs-on: ${{ github.repository == 'stainless-sdks/maisa-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@v4 From d5641f81cf1e6ee1399a6055133f888da1db620c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 3 Jul 2025 04:00:32 +0000 Subject: [PATCH 049/109] chore: mention unit type in timeout docs --- src/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/index.ts b/src/index.ts index be2beb5..28fcab1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -35,6 +35,8 @@ export interface ClientOptions { * * Note that request timeouts are retried by default, so in a worst-case scenario you may wait * much longer than this timeout before the promise succeeds or fails. + * + * @unit milliseconds */ timeout?: number | undefined; From 1bebaad2866e7910bdd0a28362f72caeaa942425 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 3 Jul 2025 04:53:33 +0000 Subject: [PATCH 050/109] fix(client): don't send `Content-Type` for bodyless methods --- src/core.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core.ts b/src/core.ts index 92c06fd..b88c858 100644 --- a/src/core.ts +++ b/src/core.ts @@ -217,7 +217,7 @@ export abstract class APIClient { protected defaultHeaders(opts: FinalRequestOptions): Headers { return { Accept: 'application/json', - 'Content-Type': 'application/json', + ...(['head', 'get'].includes(opts.method) ? {} : { 'Content-Type': 'application/json' }), 'User-Agent': this.getUserAgent(), ...getPlatformHeaders(), ...this.authHeaders(opts), From 8ea868af815cf48c7df8a2c8930b484903e9db1c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 10 Jul 2025 04:45:49 +0000 Subject: [PATCH 051/109] chore: make some internal functions async --- src/core.ts | 8 +++++--- tests/index.test.ts | 24 ++++++++++++------------ 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/src/core.ts b/src/core.ts index b88c858..1f545f2 100644 --- a/src/core.ts +++ b/src/core.ts @@ -299,10 +299,10 @@ export abstract class APIClient { return null; } - buildRequest( + async buildRequest( inputOptions: FinalRequestOptions, { retryCount = 0 }: { retryCount?: number } = {}, - ): { req: RequestInit; url: string; timeout: number } { + ): Promise<{ req: RequestInit; url: string; timeout: number }> { const options = { ...inputOptions }; const { method, path, query, defaultBaseURL, headers: headers = {} } = options; @@ -450,7 +450,9 @@ export abstract class APIClient { await this.prepareOptions(options); - const { req, url, timeout } = this.buildRequest(options, { retryCount: maxRetries - retriesRemaining }); + const { req, url, timeout } = await this.buildRequest(options, { + retryCount: maxRetries - retriesRemaining, + }); await this.prepareRequest(req, { url, options }); diff --git a/tests/index.test.ts b/tests/index.test.ts index 85e2da9..9b3c876 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -26,13 +26,13 @@ describe('instantiate client', () => { apiKey: 'My API Key', }); - test('they are used in the request', () => { - const { req } = client.buildRequest({ path: '/foo', method: 'post' }); + test('they are used in the request', async () => { + const { req } = await client.buildRequest({ path: '/foo', method: 'post' }); expect((req.headers as Headers)['x-my-default-header']).toEqual('2'); }); - test('can ignore `undefined` and leave the default', () => { - const { req } = client.buildRequest({ + test('can ignore `undefined` and leave the default', async () => { + const { req } = await client.buildRequest({ path: '/foo', method: 'post', headers: { 'X-My-Default-Header': undefined }, @@ -40,8 +40,8 @@ describe('instantiate client', () => { expect((req.headers as Headers)['x-my-default-header']).toEqual('2'); }); - test('can be removed with `null`', () => { - const { req } = client.buildRequest({ + test('can be removed with `null`', async () => { + const { req } = await client.buildRequest({ path: '/foo', method: 'post', headers: { 'X-My-Default-Header': null }, @@ -233,20 +233,20 @@ describe('request building', () => { const client = new Maisa({ apiKey: 'My API Key' }); describe('Content-Length', () => { - test('handles multi-byte characters', () => { - const { req } = client.buildRequest({ path: '/foo', method: 'post', body: { value: '—' } }); + test('handles multi-byte characters', async () => { + const { req } = await client.buildRequest({ path: '/foo', method: 'post', body: { value: '—' } }); expect((req.headers as Record)['content-length']).toEqual('20'); }); - test('handles standard characters', () => { - const { req } = client.buildRequest({ path: '/foo', method: 'post', body: { value: 'hello' } }); + test('handles standard characters', async () => { + const { req } = await client.buildRequest({ path: '/foo', method: 'post', body: { value: 'hello' } }); expect((req.headers as Record)['content-length']).toEqual('22'); }); }); describe('custom headers', () => { - test('handles undefined', () => { - const { req } = client.buildRequest({ + test('handles undefined', async () => { + const { req } = await client.buildRequest({ path: '/foo', method: 'post', body: { value: 'hello' }, From 9650bfba397d7496178b3416983a7e50c7605a46 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 15 Jul 2025 02:16:37 +0000 Subject: [PATCH 052/109] feat: clean up environment call outs --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 9d0ca56..be3e361 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,9 @@ The full API of this library can be found in [api.md](api.md). ```js import Maisa from 'maisa'; -const client = new Maisa(); +const client = new Maisa({ + apiKey: process.env['MAISA_API_KEY'], // This is the default and can be omitted +}); const textSummary = await client.capabilities.summarize({ text: 'Example long text...' }); @@ -37,7 +39,9 @@ This library includes TypeScript definitions for all request params and response ```ts import Maisa from 'maisa'; -const client = new Maisa(); +const client = new Maisa({ + apiKey: process.env['MAISA_API_KEY'], // This is the default and can be omitted +}); const params: Maisa.CapabilitySummarizeParams = { text: 'Example long text...' }; const textSummary: Maisa.TextSummary = await client.capabilities.summarize(params); From 11a794845c180a0760d5d67d7cdcb24c50571cfb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 30 Jul 2025 04:20:25 +0000 Subject: [PATCH 053/109] chore(internal): remove redundant imports config --- package.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/package.json b/package.json index 4af3d08..c5e3731 100644 --- a/package.json +++ b/package.json @@ -58,10 +58,6 @@ "./shims/web.js", "./shims/web.mjs" ], - "imports": { - "maisa": ".", - "maisa/*": "./src/*" - }, "exports": { "./_shims/auto/*": { "deno": { From 151270b19b0ae322989ad049a1d0907beb000ab6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 04:31:52 +0000 Subject: [PATCH 054/109] chore(internal): move publish config --- bin/publish-npm | 2 +- package.json | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/publish-npm b/bin/publish-npm index fa2243d..45e8aa8 100644 --- a/bin/publish-npm +++ b/bin/publish-npm @@ -58,4 +58,4 @@ else fi # Publish with the appropriate tag -yarn publish --access public --tag "$TAG" +yarn publish --tag "$TAG" diff --git a/package.json b/package.json index c5e3731..8baa25a 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,9 @@ "**/*" ], "private": false, + "publishConfig": { + "access": "public" + }, "scripts": { "test": "./scripts/test", "build": "./scripts/build", From 15c19485981e9a85f9d9a8e22fce255abcc60708 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 9 Aug 2025 05:16:36 +0000 Subject: [PATCH 055/109] chore: update @stainless-api/prism-cli to v5.15.0 --- scripts/mock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mock b/scripts/mock index d2814ae..0b28f6e 100755 --- a/scripts/mock +++ b/scripts/mock @@ -21,7 +21,7 @@ echo "==> Starting mock server with URL ${URL}" # Run prism mock on the given spec if [ "$1" == "--daemon" ]; then - npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" &> .prism.log & + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & # Wait for server to come online echo -n "Waiting for server" @@ -37,5 +37,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" fi From ca84bfcaed7cdd34b121078037ce616be6b5b1c6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 9 Aug 2025 05:22:27 +0000 Subject: [PATCH 056/109] chore(internal): update comment in script --- scripts/test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/test b/scripts/test index 2049e31..7bce051 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! prism_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the prism command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stoplight/prism-cli@~5.3.2 -- prism mock path/to/your.openapi.yml${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}" echo exit 1 From fc9ab238c88204698c6e2ecc66d17938e6fd66a4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 16 Aug 2025 04:08:58 +0000 Subject: [PATCH 057/109] chore(deps): update dependency node-fetch to v2.6.13 --- yarn.lock | 163 +++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 131 insertions(+), 32 deletions(-) diff --git a/yarn.lock b/yarn.lock index bb17942..2bcc59e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -852,19 +852,19 @@ integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== "@types/node-fetch@^2.6.4": - version "2.6.4" - resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.4.tgz#1bc3a26de814f6bf466b25aeb1473fa1afe6a660" - integrity sha512-1ZX9fcN4Rvkvgv4E6PAY5WXUFWFcRWxZa3EW83UjycOB9ljJCedb2CupIP4RZMEwF/M3eTcCihbBRgwtGbg5Rg== + version "2.6.13" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.13.tgz#e0c9b7b5edbdb1b50ce32c127e85e880872d56ee" + integrity sha512-QGpRVpzSaUs30JBSGPjOg4Uveu384erbHBoT1zeONvyCfwQxIkUshLAOqN/k9EjGviPRmWTTe6aH2qySWKTVSw== dependencies: "@types/node" "*" - form-data "^3.0.0" + form-data "^4.0.4" "@types/node@*": - version "20.10.5" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.10.5.tgz#47ad460b514096b7ed63a1dae26fad0914ed3ab2" - integrity sha512-nNPsNE65wjMxEKI93yOP+NPGGBJz/PoN3kZsVLee0XMiJolxSekEVD8wRwBUBqkwc7UWop0edW50yrCQW4CyRw== + version "24.3.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-24.3.0.tgz#89b09f45cb9a8ee69466f18ee5864e4c3eb84dec" + integrity sha512-aPTXCrfwnDLj4VvXrm+UUCQjNEvJgNA8s5F1cvwQU+3KNltTOkBm1j30uNLyqqPNe7gE3KFzImYoZEfLhp4Yow== dependencies: - undici-types "~5.26.4" + undici-types "~7.10.0" "@types/node@^18.11.18": version "18.11.18" @@ -1097,7 +1097,7 @@ array-union@^2.1.0: asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== babel-jest@^29.7.0: version "29.7.0" @@ -1234,6 +1234,14 @@ bundle-name@^3.0.0: dependencies: run-applescript "^5.0.0" +call-bind-apply-helpers@^1.0.1, call-bind-apply-helpers@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz#4b5428c222be985d79c3d82657479dbe0b59b2d6" + integrity sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ== + dependencies: + es-errors "^1.3.0" + function-bind "^1.1.2" + callsites@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" @@ -1433,7 +1441,7 @@ define-lazy-prop@^3.0.0: delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== depd@^1.1.2: version "1.1.2" @@ -1469,6 +1477,15 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" +dunder-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/dunder-proto/-/dunder-proto-1.0.1.tgz#d7ae667e1dc83482f8b70fd0f6eefc50da30f58a" + integrity sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A== + dependencies: + call-bind-apply-helpers "^1.0.1" + es-errors "^1.3.0" + gopd "^1.2.0" + electron-to-chromium@^1.4.601: version "1.4.614" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.614.tgz#2fe789d61fa09cb875569f37c309d0c2701f91c0" @@ -1491,6 +1508,33 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" +es-define-property@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.1.tgz#983eb2f9a6724e9303f61addf011c72e09e0b0fa" + integrity sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g== + +es-errors@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" + integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== + +es-object-atoms@^1.0.0, es-object-atoms@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/es-object-atoms/-/es-object-atoms-1.1.1.tgz#1c4f2c4837327597ce69d2ca190a7fdd172338c1" + integrity sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA== + dependencies: + es-errors "^1.3.0" + +es-set-tostringtag@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz#f31dbbe0c183b00a6d26eb6325c810c0fd18bd4d" + integrity sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA== + dependencies: + es-errors "^1.3.0" + get-intrinsic "^1.2.6" + has-tostringtag "^1.0.2" + hasown "^2.0.2" + escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" @@ -1780,13 +1824,15 @@ form-data-encoder@1.7.2: resolved "https://registry.yarnpkg.com/form-data-encoder/-/form-data-encoder-1.7.2.tgz#1f1ae3dccf58ed4690b86d87e4f57c654fbab040" integrity sha512-qfqtYan3rxrnCk1VYaA4H+Ms9xdpPqvLZa6xmMgFvhO32x7/3J/ExcTd6qpxM0vH2GdMI+poehyBZvqfMTto8A== -form-data@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f" - integrity sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg== +form-data@^4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.4.tgz#784cdcce0669a9d68e94d11ac4eea98088edd2c4" + integrity sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow== dependencies: asynckit "^0.4.0" combined-stream "^1.0.8" + es-set-tostringtag "^2.1.0" + hasown "^2.0.2" mime-types "^2.1.12" formdata-node@^4.3.2: @@ -1822,11 +1868,35 @@ get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== +get-intrinsic@^1.2.6: + version "1.3.0" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.3.0.tgz#743f0e3b6964a93a5491ed1bffaae054d7f98d01" + integrity sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ== + dependencies: + call-bind-apply-helpers "^1.0.2" + es-define-property "^1.0.1" + es-errors "^1.3.0" + es-object-atoms "^1.1.1" + function-bind "^1.1.2" + get-proto "^1.0.1" + gopd "^1.2.0" + has-symbols "^1.1.0" + hasown "^2.0.2" + math-intrinsics "^1.1.0" + get-package-type@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== +get-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/get-proto/-/get-proto-1.0.1.tgz#150b3f2743869ef3e851ec0c49d15b1d14d00ee1" + integrity sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g== + dependencies: + dunder-proto "^1.0.1" + es-object-atoms "^1.0.0" + get-stdin@^8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-8.0.0.tgz#cbad6a73feb75f6eeb22ba9e01f89aa28aa97a53" @@ -1887,6 +1957,11 @@ globby@^11.1.0: merge2 "^1.4.1" slash "^3.0.0" +gopd@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.2.0.tgz#89f56b8217bdbc8802bd299df6d7f1081d7e51a1" + integrity sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg== + graceful-fs@^4.2.9: version "4.2.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" @@ -1907,6 +1982,18 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== +has-symbols@^1.0.3, has-symbols@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.1.0.tgz#fc9c6a783a084951d0b971fe1018de813707a338" + integrity sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ== + +has-tostringtag@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.2.tgz#2cdc42d40bef2e5b4eeab7c01a73c54ce7ab5abc" + integrity sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw== + dependencies: + has-symbols "^1.0.3" + hasown@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.0.tgz#f4c513d454a57b7c7e1650778de226b11700546c" @@ -1914,6 +2001,13 @@ hasown@^2.0.0: dependencies: function-bind "^1.1.2" +hasown@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" + integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== + dependencies: + function-bind "^1.1.2" + html-escaper@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" @@ -2611,6 +2705,11 @@ makeerror@1.0.12: dependencies: tmpl "1.0.5" +math-intrinsics@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz#a0dd74be81e2aa5c2f27e65ce283605ee4e2b7f9" + integrity sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g== + merge-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" @@ -2629,17 +2728,17 @@ micromatch@^4.0.4: braces "^3.0.3" picomatch "^2.3.1" -mime-db@1.51.0: - version "1.51.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.51.0.tgz#d9ff62451859b18342d960850dc3cfb77e63fb0c" - integrity sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g== +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== mime-types@^2.1.12: - version "2.1.34" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.34.tgz#5a712f9ec1503511a945803640fafe09d3793c24" - integrity sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A== + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== dependencies: - mime-db "1.51.0" + mime-db "1.52.0" mimic-fn@^2.1.0: version "2.1.0" @@ -2691,9 +2790,9 @@ node-domexception@1.0.0: integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ== node-fetch@^2.6.7: - version "2.6.11" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.11.tgz#cde7fc71deef3131ef80a738919f999e6edfff25" - integrity sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w== + version "2.7.0" + resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" + integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== dependencies: whatwg-url "^5.0.0" @@ -3230,7 +3329,7 @@ to-regex-range@^5.0.1: tr46@~0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" - integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o= + integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== ts-api-utils@^1.0.1: version "1.3.0" @@ -3332,10 +3431,10 @@ typescript@^4.8.2: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== +undici-types@~7.10.0: + version "7.10.0" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.10.0.tgz#4ac2e058ce56b462b056e629cc6a02393d3ff350" + integrity sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag== untildify@^4.0.0: version "4.0.0" @@ -3391,12 +3490,12 @@ web-streams-polyfill@4.0.0-beta.1: webidl-conversions@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" - integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= + integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== whatwg-url@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" - integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0= + integrity sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw== dependencies: tr46 "~0.0.3" webidl-conversions "^3.0.0" From 846300a68c239046ea51be523514afcf453a07d4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 16 Aug 2025 04:18:50 +0000 Subject: [PATCH 058/109] chore(internal): formatting change --- src/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.ts b/src/index.ts index 28fcab1..cc097f4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -186,6 +186,7 @@ Maisa.Models = Models; Maisa.Kpu = Kpu; Maisa.FileInterpreter = FileInterpreter; Maisa.Mainet = Mainet; + export declare namespace Maisa { export type RequestOptions = Core.RequestOptions; From 695a63b5c02e36b9b2469986dd4d27b923b83821 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 23 Aug 2025 05:29:29 +0000 Subject: [PATCH 059/109] chore: update CI script --- scripts/utils/upload-artifact.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh index a9cf996..08a6b59 100755 --- a/scripts/utils/upload-artifact.sh +++ b/scripts/utils/upload-artifact.sh @@ -12,7 +12,7 @@ if [[ "$SIGNED_URL" == "null" ]]; then exit 1 fi -UPLOAD_RESPONSE=$(tar -cz dist | curl -v -X PUT \ +UPLOAD_RESPONSE=$(tar -cz "${BUILD_PATH:-dist}" | curl -v -X PUT \ -H "Content-Type: application/gzip" \ --data-binary @- "$SIGNED_URL" 2>&1) From eb696f73f16d7b7494811905a18131f7b741d263 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 6 Sep 2025 05:05:13 +0000 Subject: [PATCH 060/109] chore: ci build action --- scripts/utils/upload-artifact.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh index 08a6b59..1362d89 100755 --- a/scripts/utils/upload-artifact.sh +++ b/scripts/utils/upload-artifact.sh @@ -12,7 +12,7 @@ if [[ "$SIGNED_URL" == "null" ]]; then exit 1 fi -UPLOAD_RESPONSE=$(tar -cz "${BUILD_PATH:-dist}" | curl -v -X PUT \ +UPLOAD_RESPONSE=$(tar "${BASE_PATH:+-C$BASE_PATH}" -cz "${ARTIFACT_PATH:-dist}" | curl -v -X PUT \ -H "Content-Type: application/gzip" \ --data-binary @- "$SIGNED_URL" 2>&1) From 8abc12ec8cecb9f44e631323bd5a790f0d2e7d85 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 9 Sep 2025 03:45:05 +0000 Subject: [PATCH 061/109] fix: coerce nullable values to undefined --- src/core.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core.ts b/src/core.ts index 1f545f2..e6d7271 100644 --- a/src/core.ts +++ b/src/core.ts @@ -1087,21 +1087,21 @@ export const coerceBoolean = (value: unknown): boolean => { }; export const maybeCoerceInteger = (value: unknown): number | undefined => { - if (value === undefined) { + if (value == null) { return undefined; } return coerceInteger(value); }; export const maybeCoerceFloat = (value: unknown): number | undefined => { - if (value === undefined) { + if (value == null) { return undefined; } return coerceFloat(value); }; export const maybeCoerceBoolean = (value: unknown): boolean | undefined => { - if (value === undefined) { + if (value == null) { return undefined; } return coerceBoolean(value); From 16353ab3eff92358d99e16d11df1097c496e7965 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 20 Sep 2025 03:45:50 +0000 Subject: [PATCH 062/109] chore: do not install brew dependencies in ./scripts/bootstrap by default --- scripts/bootstrap | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/bootstrap b/scripts/bootstrap index 0af58e2..f68beda 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -4,10 +4,18 @@ set -e cd "$(dirname "$0")/.." -if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ]; then +if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then brew bundle check >/dev/null 2>&1 || { - echo "==> Installing Homebrew dependencies…" - brew bundle + echo -n "==> Install Homebrew dependencies? (y/N): " + read -r response + case "$response" in + [yY][eE][sS]|[yY]) + brew bundle + ;; + *) + ;; + esac + echo } fi From 17f089f418f965225fc2590d9bbf471c31d0663c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 26 Sep 2025 02:56:51 +0000 Subject: [PATCH 063/109] perf: faster formatting --- scripts/fast-format | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 scripts/fast-format diff --git a/scripts/fast-format b/scripts/fast-format new file mode 100755 index 0000000..03fb1a3 --- /dev/null +++ b/scripts/fast-format @@ -0,0 +1,40 @@ +#!/usr/bin/env bash + +set -euo pipefail + +echo "Script started with $# arguments" +echo "Arguments: $*" +echo "Script location: $(dirname "$0")" + +cd "$(dirname "$0")/.." +echo "Changed to directory: $(pwd)" + +if [ $# -eq 0 ]; then + echo "Usage: $0 [additional-formatter-args...]" + echo "The file should contain one file path per line" + exit 1 +fi + +FILE_LIST="$1" + +echo "Looking for file: $FILE_LIST" + +if [ ! -f "$FILE_LIST" ]; then + echo "Error: File '$FILE_LIST' not found" + exit 1 +fi + +echo "==> Running eslint --fix" +ESLINT_FILES="$(grep '\.ts$' "$FILE_LIST" || true)" +if ! [ -z "$ESLINT_FILES" ]; then + echo "$ESLINT_FILES" | ESLINT_USE_FLAT_CONFIG="false" xargs ./node_modules/.bin/eslint --cache --fix +fi + +echo "==> Running prettier --write" +# format things eslint didn't +PRETTIER_FILES="$(grep '\.\(js\|json\)$' "$FILE_LIST" || true)" +if ! [ -z "$PRETTIER_FILES" ]; then + echo "$PRETTIER_FILES" | xargs ./node_modules/.bin/prettier \ + --write --cache --cache-strategy metadata \ + '!**/dist' '!**/*.ts' '!**/*.mts' '!**/*.cts' '!**/*.js' '!**/*.mjs' '!**/*.cjs' +fi From accffdbb5b22c3ae02df8f4f50589dde5b6223ca Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 26 Sep 2025 02:57:56 +0000 Subject: [PATCH 064/109] chore(internal): remove deprecated `compilerOptions.baseUrl` from tsconfig.json This allows sdks to be built using tsgo - see https://github.com/microsoft/typescript-go/issues/474 --- tsconfig.build.json | 4 ++-- tsconfig.json | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/tsconfig.build.json b/tsconfig.build.json index cd1a49f..bafbf71 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -5,8 +5,8 @@ "compilerOptions": { "rootDir": "./dist/src", "paths": { - "maisa/*": ["dist/src/*"], - "maisa": ["dist/src/index.ts"], + "maisa/*": ["./dist/src/*"], + "maisa": ["./dist/src/index.ts"] }, "noEmit": false, "declaration": true, diff --git a/tsconfig.json b/tsconfig.json index deeab7d..aa0e734 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -7,11 +7,10 @@ "module": "commonjs", "moduleResolution": "node", "esModuleInterop": true, - "baseUrl": "./", "paths": { - "maisa/_shims/auto/*": ["src/_shims/auto/*-node"], - "maisa/*": ["src/*"], - "maisa": ["src/index.ts"] + "maisa/_shims/auto/*": ["./src/_shims/auto/*-node"], + "maisa/*": ["./src/*"], + "maisa": ["./src/index.ts"] }, "noEmit": true, @@ -32,7 +31,7 @@ "noUncheckedIndexedAccess": true, "noImplicitOverride": true, "noPropertyAccessFromIndexSignature": true, - "isolatedModules": false, + "isolatedModules": false, "skipLibCheck": true } From d3f62b4156c77ee1040f582bb0342af287fc11d9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 27 Sep 2025 03:25:39 +0000 Subject: [PATCH 065/109] chore(internal): fix incremental formatting in some cases --- scripts/fast-format | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/fast-format b/scripts/fast-format index 03fb1a3..8a8e9d5 100755 --- a/scripts/fast-format +++ b/scripts/fast-format @@ -35,6 +35,6 @@ echo "==> Running prettier --write" PRETTIER_FILES="$(grep '\.\(js\|json\)$' "$FILE_LIST" || true)" if ! [ -z "$PRETTIER_FILES" ]; then echo "$PRETTIER_FILES" | xargs ./node_modules/.bin/prettier \ - --write --cache --cache-strategy metadata \ + --write --cache --cache-strategy metadata --no-error-on-unmatched-pattern \ '!**/dist' '!**/*.ts' '!**/*.mts' '!**/*.cts' '!**/*.js' '!**/*.mjs' '!**/*.cjs' fi From 51d80209aa956a6ea5fdc5b4cc485db8267be626 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 27 Sep 2025 03:28:38 +0000 Subject: [PATCH 066/109] chore(internal): codegen related update --- .devcontainer/devcontainer.json | 4 +--- .eslintcache | 1 + release-please-config.json | 5 +---- 3 files changed, 3 insertions(+), 7 deletions(-) create mode 100644 .eslintcache diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 763462f..43fd5a7 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -9,9 +9,7 @@ "postCreateCommand": "yarn install", "customizations": { "vscode": { - "extensions": [ - "esbenp.prettier-vscode" - ] + "extensions": ["esbenp.prettier-vscode"] } } } diff --git a/.eslintcache b/.eslintcache new file mode 100644 index 0000000..1661489 --- /dev/null +++ b/.eslintcache @@ -0,0 +1 @@ +[{"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/jest.config.ts":"1","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/MultipartBody.ts":"2","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/auto/runtime-bun.ts":"3","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/auto/runtime-node.ts":"4","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/auto/runtime-deno.ts":"5","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/auto/runtime.ts":"6","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/auto/types-deno.ts":"7","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/auto/types-node.ts":"8","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/auto/types.d.ts":"9","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/index.d.ts":"10","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/bun-runtime.ts":"11","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/index-deno.ts":"12","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/manual-types.d.ts":"13","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/node-runtime.ts":"14","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/node-types.d.ts":"15","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/registry.ts":"16","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/web-runtime.ts":"17","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/web-types.d.ts":"18","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/core.ts":"19","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/error.ts":"20","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/index.ts":"21","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resource.ts":"22","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/capabilities/index.ts":"23","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/capabilities/media.ts":"24","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/capabilities.ts":"25","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/file-interpreter/file-interpreter.ts":"26","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/capabilities/capabilities.ts":"27","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/file-interpreter/from-audio.ts":"28","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/file-interpreter/from-docx.ts":"29","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/file-interpreter/from-html.ts":"30","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/file-interpreter/from-image.ts":"31","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/file-interpreter/from-pdf-scanned.ts":"32","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/file-interpreter/from-pdf.ts":"33","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/file-interpreter/index.ts":"34","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/file-interpreter.ts":"35","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/index.ts":"36","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/kpu.ts":"37","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/mainet/index.ts":"38","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/mainet/mainet.ts":"39","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/mainet/search.ts":"40","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/mainet.ts":"41","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/models/embeddings.ts":"42","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/models/index.ts":"43","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/models/models.ts":"44","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/models/rerank.ts":"45","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/shared.ts":"46","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources.ts":"47","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/shims/node.ts":"48","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/models.ts":"49","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/shims/web.ts":"50","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/uploads.ts":"51","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/version.ts":"52","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/tests/api-resources/capabilities/capabilities.test.ts":"53","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/tests/api-resources/capabilities/media.test.ts":"54","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/tests/api-resources/file-interpreter/from-audio.test.ts":"55","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/tests/api-resources/file-interpreter/from-docx.test.ts":"56","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/tests/api-resources/file-interpreter/from-html.test.ts":"57","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/tests/api-resources/file-interpreter/from-image.test.ts":"58","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/tests/api-resources/file-interpreter/from-pdf.test.ts":"59","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/tests/api-resources/kpu.test.ts":"60","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/tests/api-resources/models/embeddings.test.ts":"61","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/tests/form.test.ts":"62","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/tests/index.test.ts":"63","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/tests/responses.test.ts":"64","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/tests/stringifyQuery.test.ts":"65","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/tests/uploads.test.ts":"66"},{"size":632,"mtime":1758943699986,"results":"67","hashOfConfig":"68"},{"size":223,"mtime":1758943699998,"results":"69","hashOfConfig":"68"},{"size":118,"mtime":1758943700014,"results":"70","hashOfConfig":"68"},{"size":119,"mtime":1758943700014,"results":"71","hashOfConfig":"68"},{"size":118,"mtime":1758943700014,"results":"72","hashOfConfig":"68"},{"size":118,"mtime":1758943700018,"results":"73","hashOfConfig":"68"},{"size":116,"mtime":1758943700018,"results":"74","hashOfConfig":"68"},{"size":117,"mtime":1758943700018,"results":"75","hashOfConfig":"68"},{"size":3001,"mtime":1758943700018,"results":"76","hashOfConfig":"68"},{"size":3155,"mtime":1758943700018,"results":"77","hashOfConfig":"68"},{"size":468,"mtime":1758943700018,"results":"78","hashOfConfig":"68"},{"size":2738,"mtime":1758943700018,"results":"79","hashOfConfig":"68"},{"size":331,"mtime":1758943700018,"results":"80","hashOfConfig":"68"},{"size":3133,"mtime":1758943700022,"results":"81","hashOfConfig":"68"},{"size":1238,"mtime":1758943700022,"results":"82","hashOfConfig":"68"},{"size":2434,"mtime":1758943712398},{"size":3036,"mtime":1758943700022,"results":"83","hashOfConfig":"68"},{"size":2073,"mtime":1758943700022,"results":"84","hashOfConfig":"68"},{"size":39657,"mtime":1758943712398},{"size":3970,"mtime":1758943712398},{"size":7519,"mtime":1758943712398},{"size":256,"mtime":1758943700090,"results":"85","hashOfConfig":"68"},{"size":339,"mtime":1758943712398},{"size":6207,"mtime":1758943712398},{"size":126,"mtime":1758943700118,"results":"86","hashOfConfig":"68"},{"size":2685,"mtime":1758943712398},{"size":5025,"mtime":1758943712398},{"size":1020,"mtime":1758943712398},{"size":1022,"mtime":1758943712398},{"size":993,"mtime":1758943712398},{"size":1020,"mtime":1758943712398},{"size":312,"mtime":1758943712398},{"size":1112,"mtime":1758943712398},{"size":686,"mtime":1758943712398},{"size":130,"mtime":1758943700250,"results":"87","hashOfConfig":"68"},{"size":496,"mtime":1758943712398},{"size":2066,"mtime":1758943712398},{"size":160,"mtime":1758943712398},{"size":541,"mtime":1758943712398},{"size":304,"mtime":1758943712398},{"size":120,"mtime":1758943700282,"results":"88","hashOfConfig":"68"},{"size":1150,"mtime":1758943712398},{"size":232,"mtime":1758943712398},{"size":847,"mtime":1758943712398},{"size":304,"mtime":1758943712398},{"size":573,"mtime":1758943712398},{"size":35,"mtime":1758943700030,"results":"89","hashOfConfig":"68"},{"size":1564,"mtime":1758943700030,"results":"90","hashOfConfig":"68"},{"size":120,"mtime":1758943700214,"results":"91","hashOfConfig":"68"},{"size":1588,"mtime":1758943700030,"results":"92","hashOfConfig":"68"},{"size":9029,"mtime":1758943712398},{"size":67,"mtime":1758943712398},{"size":2994,"mtime":1758943712398},{"size":3770,"mtime":1758943712398},{"size":1117,"mtime":1758943712398},{"size":1114,"mtime":1758943712398},{"size":1114,"mtime":1758943712398},{"size":1117,"mtime":1758943712398},{"size":1125,"mtime":1758943712398},{"size":1121,"mtime":1758943712398},{"size":1004,"mtime":1758943712398},{"size":1656,"mtime":1758943700030,"results":"93","hashOfConfig":"68"},{"size":14987,"mtime":1758943712398},{"size":946,"mtime":1758943700034,"results":"94","hashOfConfig":"68"},{"size":912,"mtime":1758943712398},{"size":2116,"mtime":1758943700034,"results":"95","hashOfConfig":"68"},{"filePath":"96","messages":"97","suppressedMessages":"98","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"3ld0jq",{"filePath":"99","messages":"100","suppressedMessages":"101","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"102","messages":"103","suppressedMessages":"104","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"105","messages":"106","suppressedMessages":"107","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"108","messages":"109","suppressedMessages":"110","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"111","messages":"112","suppressedMessages":"113","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"114","messages":"115","suppressedMessages":"116","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"117","messages":"118","suppressedMessages":"119","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"120","messages":"121","suppressedMessages":"122","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"123","messages":"124","suppressedMessages":"125","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"126","messages":"127","suppressedMessages":"128","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"129","messages":"130","suppressedMessages":"131","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"132","messages":"133","suppressedMessages":"134","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"135","messages":"136","suppressedMessages":"137","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"138","messages":"139","suppressedMessages":"140","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"141","messages":"142","suppressedMessages":"143","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"144","messages":"145","suppressedMessages":"146","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"147","messages":"148","suppressedMessages":"149","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"150","messages":"151","suppressedMessages":"152","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"153","messages":"154","suppressedMessages":"155","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"156","messages":"157","suppressedMessages":"158","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"159","messages":"160","suppressedMessages":"161","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"162","messages":"163","suppressedMessages":"164","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"165","messages":"166","suppressedMessages":"167","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"168","messages":"169","suppressedMessages":"170","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"171","messages":"172","suppressedMessages":"173","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"174","messages":"175","suppressedMessages":"176","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"177","messages":"178","suppressedMessages":"179","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/jest.config.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/MultipartBody.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/auto/runtime-bun.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/auto/runtime-node.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/auto/runtime-deno.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/auto/runtime.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/auto/types-deno.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/auto/types-node.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/auto/types.d.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/index.d.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/bun-runtime.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/index-deno.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/manual-types.d.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/node-runtime.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/node-types.d.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/web-runtime.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/web-types.d.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resource.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/capabilities.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/file-interpreter.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/mainet.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/shims/node.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/models.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/shims/web.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/tests/form.test.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/tests/responses.test.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/tests/uploads.test.ts",[],[]] \ No newline at end of file diff --git a/release-please-config.json b/release-please-config.json index 624ed99..1ebd0bd 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -60,8 +60,5 @@ } ], "release-type": "node", - "extra-files": [ - "src/version.ts", - "README.md" - ] + "extra-files": ["src/version.ts", "README.md"] } From 638db23350725cad7aca39687d46d02e36c027d7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 27 Sep 2025 03:30:51 +0000 Subject: [PATCH 067/109] chore(internal): ignore .eslintcache --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index d98d51a..2412bb7 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ dist dist-deno /*.tgz .idea/ +.eslintcache From 34ca6c3b4bbf8e0e59f54c2e9d64bfcfa3f6e98a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 03:27:20 +0000 Subject: [PATCH 068/109] chore(internal): remove .eslintcache --- .eslintcache | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .eslintcache diff --git a/.eslintcache b/.eslintcache deleted file mode 100644 index 1661489..0000000 --- a/.eslintcache +++ /dev/null @@ -1 +0,0 @@ -[{"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/jest.config.ts":"1","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/MultipartBody.ts":"2","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/auto/runtime-bun.ts":"3","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/auto/runtime-node.ts":"4","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/auto/runtime-deno.ts":"5","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/auto/runtime.ts":"6","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/auto/types-deno.ts":"7","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/auto/types-node.ts":"8","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/auto/types.d.ts":"9","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/index.d.ts":"10","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/bun-runtime.ts":"11","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/index-deno.ts":"12","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/manual-types.d.ts":"13","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/node-runtime.ts":"14","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/node-types.d.ts":"15","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/registry.ts":"16","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/web-runtime.ts":"17","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/web-types.d.ts":"18","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/core.ts":"19","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/error.ts":"20","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/index.ts":"21","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resource.ts":"22","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/capabilities/index.ts":"23","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/capabilities/media.ts":"24","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/capabilities.ts":"25","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/file-interpreter/file-interpreter.ts":"26","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/capabilities/capabilities.ts":"27","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/file-interpreter/from-audio.ts":"28","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/file-interpreter/from-docx.ts":"29","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/file-interpreter/from-html.ts":"30","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/file-interpreter/from-image.ts":"31","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/file-interpreter/from-pdf-scanned.ts":"32","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/file-interpreter/from-pdf.ts":"33","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/file-interpreter/index.ts":"34","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/file-interpreter.ts":"35","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/index.ts":"36","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/kpu.ts":"37","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/mainet/index.ts":"38","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/mainet/mainet.ts":"39","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/mainet/search.ts":"40","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/mainet.ts":"41","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/models/embeddings.ts":"42","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/models/index.ts":"43","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/models/models.ts":"44","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/models/rerank.ts":"45","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/shared.ts":"46","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources.ts":"47","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/shims/node.ts":"48","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/models.ts":"49","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/shims/web.ts":"50","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/uploads.ts":"51","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/version.ts":"52","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/tests/api-resources/capabilities/capabilities.test.ts":"53","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/tests/api-resources/capabilities/media.test.ts":"54","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/tests/api-resources/file-interpreter/from-audio.test.ts":"55","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/tests/api-resources/file-interpreter/from-docx.test.ts":"56","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/tests/api-resources/file-interpreter/from-html.test.ts":"57","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/tests/api-resources/file-interpreter/from-image.test.ts":"58","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/tests/api-resources/file-interpreter/from-pdf.test.ts":"59","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/tests/api-resources/kpu.test.ts":"60","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/tests/api-resources/models/embeddings.test.ts":"61","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/tests/form.test.ts":"62","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/tests/index.test.ts":"63","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/tests/responses.test.ts":"64","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/tests/stringifyQuery.test.ts":"65","/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/tests/uploads.test.ts":"66"},{"size":632,"mtime":1758943699986,"results":"67","hashOfConfig":"68"},{"size":223,"mtime":1758943699998,"results":"69","hashOfConfig":"68"},{"size":118,"mtime":1758943700014,"results":"70","hashOfConfig":"68"},{"size":119,"mtime":1758943700014,"results":"71","hashOfConfig":"68"},{"size":118,"mtime":1758943700014,"results":"72","hashOfConfig":"68"},{"size":118,"mtime":1758943700018,"results":"73","hashOfConfig":"68"},{"size":116,"mtime":1758943700018,"results":"74","hashOfConfig":"68"},{"size":117,"mtime":1758943700018,"results":"75","hashOfConfig":"68"},{"size":3001,"mtime":1758943700018,"results":"76","hashOfConfig":"68"},{"size":3155,"mtime":1758943700018,"results":"77","hashOfConfig":"68"},{"size":468,"mtime":1758943700018,"results":"78","hashOfConfig":"68"},{"size":2738,"mtime":1758943700018,"results":"79","hashOfConfig":"68"},{"size":331,"mtime":1758943700018,"results":"80","hashOfConfig":"68"},{"size":3133,"mtime":1758943700022,"results":"81","hashOfConfig":"68"},{"size":1238,"mtime":1758943700022,"results":"82","hashOfConfig":"68"},{"size":2434,"mtime":1758943712398},{"size":3036,"mtime":1758943700022,"results":"83","hashOfConfig":"68"},{"size":2073,"mtime":1758943700022,"results":"84","hashOfConfig":"68"},{"size":39657,"mtime":1758943712398},{"size":3970,"mtime":1758943712398},{"size":7519,"mtime":1758943712398},{"size":256,"mtime":1758943700090,"results":"85","hashOfConfig":"68"},{"size":339,"mtime":1758943712398},{"size":6207,"mtime":1758943712398},{"size":126,"mtime":1758943700118,"results":"86","hashOfConfig":"68"},{"size":2685,"mtime":1758943712398},{"size":5025,"mtime":1758943712398},{"size":1020,"mtime":1758943712398},{"size":1022,"mtime":1758943712398},{"size":993,"mtime":1758943712398},{"size":1020,"mtime":1758943712398},{"size":312,"mtime":1758943712398},{"size":1112,"mtime":1758943712398},{"size":686,"mtime":1758943712398},{"size":130,"mtime":1758943700250,"results":"87","hashOfConfig":"68"},{"size":496,"mtime":1758943712398},{"size":2066,"mtime":1758943712398},{"size":160,"mtime":1758943712398},{"size":541,"mtime":1758943712398},{"size":304,"mtime":1758943712398},{"size":120,"mtime":1758943700282,"results":"88","hashOfConfig":"68"},{"size":1150,"mtime":1758943712398},{"size":232,"mtime":1758943712398},{"size":847,"mtime":1758943712398},{"size":304,"mtime":1758943712398},{"size":573,"mtime":1758943712398},{"size":35,"mtime":1758943700030,"results":"89","hashOfConfig":"68"},{"size":1564,"mtime":1758943700030,"results":"90","hashOfConfig":"68"},{"size":120,"mtime":1758943700214,"results":"91","hashOfConfig":"68"},{"size":1588,"mtime":1758943700030,"results":"92","hashOfConfig":"68"},{"size":9029,"mtime":1758943712398},{"size":67,"mtime":1758943712398},{"size":2994,"mtime":1758943712398},{"size":3770,"mtime":1758943712398},{"size":1117,"mtime":1758943712398},{"size":1114,"mtime":1758943712398},{"size":1114,"mtime":1758943712398},{"size":1117,"mtime":1758943712398},{"size":1125,"mtime":1758943712398},{"size":1121,"mtime":1758943712398},{"size":1004,"mtime":1758943712398},{"size":1656,"mtime":1758943700030,"results":"93","hashOfConfig":"68"},{"size":14987,"mtime":1758943712398},{"size":946,"mtime":1758943700034,"results":"94","hashOfConfig":"68"},{"size":912,"mtime":1758943712398},{"size":2116,"mtime":1758943700034,"results":"95","hashOfConfig":"68"},{"filePath":"96","messages":"97","suppressedMessages":"98","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"3ld0jq",{"filePath":"99","messages":"100","suppressedMessages":"101","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"102","messages":"103","suppressedMessages":"104","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"105","messages":"106","suppressedMessages":"107","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"108","messages":"109","suppressedMessages":"110","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"111","messages":"112","suppressedMessages":"113","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"114","messages":"115","suppressedMessages":"116","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"117","messages":"118","suppressedMessages":"119","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"120","messages":"121","suppressedMessages":"122","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"123","messages":"124","suppressedMessages":"125","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"126","messages":"127","suppressedMessages":"128","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"129","messages":"130","suppressedMessages":"131","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"132","messages":"133","suppressedMessages":"134","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"135","messages":"136","suppressedMessages":"137","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"138","messages":"139","suppressedMessages":"140","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"141","messages":"142","suppressedMessages":"143","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"144","messages":"145","suppressedMessages":"146","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"147","messages":"148","suppressedMessages":"149","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"150","messages":"151","suppressedMessages":"152","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"153","messages":"154","suppressedMessages":"155","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"156","messages":"157","suppressedMessages":"158","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"159","messages":"160","suppressedMessages":"161","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"162","messages":"163","suppressedMessages":"164","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"165","messages":"166","suppressedMessages":"167","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"168","messages":"169","suppressedMessages":"170","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"171","messages":"172","suppressedMessages":"173","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"174","messages":"175","suppressedMessages":"176","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"177","messages":"178","suppressedMessages":"179","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/jest.config.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/MultipartBody.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/auto/runtime-bun.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/auto/runtime-node.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/auto/runtime-deno.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/auto/runtime.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/auto/types-deno.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/auto/types-node.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/auto/types.d.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/index.d.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/bun-runtime.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/index-deno.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/manual-types.d.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/node-runtime.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/node-types.d.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/web-runtime.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/_shims/web-types.d.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resource.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/capabilities.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/file-interpreter.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/mainet.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/shims/node.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/resources/models.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/src/shims/web.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/tests/form.test.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/tests/responses.test.ts",[],[],"/home/tempuser-f91z7k/run/codegen-output/maisa/maisa-node/tests/uploads.test.ts",[],[]] \ No newline at end of file From c3fd8cd1f78b13db1ddc1f956a463649742d901f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 03:27:18 +0000 Subject: [PATCH 069/109] chore(internal): use npm pack for build uploads --- scripts/utils/upload-artifact.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh index 1362d89..52700b9 100755 --- a/scripts/utils/upload-artifact.sh +++ b/scripts/utils/upload-artifact.sh @@ -12,9 +12,11 @@ if [[ "$SIGNED_URL" == "null" ]]; then exit 1 fi -UPLOAD_RESPONSE=$(tar "${BASE_PATH:+-C$BASE_PATH}" -cz "${ARTIFACT_PATH:-dist}" | curl -v -X PUT \ +TARBALL=$(cd dist && npm pack --silent) + +UPLOAD_RESPONSE=$(curl -v -X PUT \ -H "Content-Type: application/gzip" \ - --data-binary @- "$SIGNED_URL" 2>&1) + --data-binary "@dist/$TARBALL" "$SIGNED_URL" 2>&1) if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then echo -e "\033[32mUploaded build to Stainless storage.\033[0m" From 39e09fbcb3ba8ace9a5e959c10c48dfcbe9484f1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 6 Dec 2025 05:47:28 +0000 Subject: [PATCH 070/109] fix(mcp): return correct lines on typescript errors --- .devcontainer/Dockerfile | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .devcontainer/Dockerfile diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..8ea34be --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,23 @@ +# syntax=docker/dockerfile:1 +FROM debian:bookworm-slim AS stainless + +RUN apt-get update && apt-get install -y \ + nodejs \ + npm \ + yarnpkg \ + && apt-get clean autoclean + +# Ensure UTF-8 encoding +ENV LANG=C.UTF-8 +ENV LC_ALL=C.UTF-8 + +# Yarn +RUN ln -sf /usr/bin/yarnpkg /usr/bin/yarn + +WORKDIR /workspace + +COPY package.json yarn.lock /workspace/ + +RUN yarn install + +COPY . /workspace From a0eff02ff7bb1962dcb3ca2403b0bb0bf3f6b21d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 6 Dec 2025 05:48:18 +0000 Subject: [PATCH 071/109] chore(internal): codegen related update --- .devcontainer/Dockerfile | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 .devcontainer/Dockerfile diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index 8ea34be..0000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -# syntax=docker/dockerfile:1 -FROM debian:bookworm-slim AS stainless - -RUN apt-get update && apt-get install -y \ - nodejs \ - npm \ - yarnpkg \ - && apt-get clean autoclean - -# Ensure UTF-8 encoding -ENV LANG=C.UTF-8 -ENV LC_ALL=C.UTF-8 - -# Yarn -RUN ln -sf /usr/bin/yarnpkg /usr/bin/yarn - -WORKDIR /workspace - -COPY package.json yarn.lock /workspace/ - -RUN yarn install - -COPY . /workspace From 2175f4adac573b5cd2b2050d472b5174a83307d7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 6 Dec 2025 05:49:07 +0000 Subject: [PATCH 072/109] fix(mcp): correct code tool API endpoint --- .devcontainer/Dockerfile | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .devcontainer/Dockerfile diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..8ea34be --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,23 @@ +# syntax=docker/dockerfile:1 +FROM debian:bookworm-slim AS stainless + +RUN apt-get update && apt-get install -y \ + nodejs \ + npm \ + yarnpkg \ + && apt-get clean autoclean + +# Ensure UTF-8 encoding +ENV LANG=C.UTF-8 +ENV LC_ALL=C.UTF-8 + +# Yarn +RUN ln -sf /usr/bin/yarnpkg /usr/bin/yarn + +WORKDIR /workspace + +COPY package.json yarn.lock /workspace/ + +RUN yarn install + +COPY . /workspace From 59ebea3adcbae40ec8bb1c92de3b4899a298fbae Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 6 Dec 2025 05:50:01 +0000 Subject: [PATCH 073/109] chore(internal): codegen related update --- .devcontainer/Dockerfile | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 .devcontainer/Dockerfile diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index 8ea34be..0000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -# syntax=docker/dockerfile:1 -FROM debian:bookworm-slim AS stainless - -RUN apt-get update && apt-get install -y \ - nodejs \ - npm \ - yarnpkg \ - && apt-get clean autoclean - -# Ensure UTF-8 encoding -ENV LANG=C.UTF-8 -ENV LC_ALL=C.UTF-8 - -# Yarn -RUN ln -sf /usr/bin/yarnpkg /usr/bin/yarn - -WORKDIR /workspace - -COPY package.json yarn.lock /workspace/ - -RUN yarn install - -COPY . /workspace From ceb4f952168bcdac7e1080ff682f0c2984bd33e4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 6 Jan 2026 06:49:06 +0000 Subject: [PATCH 074/109] chore(internal): codegen related update --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index cab49bf..4f7064a 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2025 Maisa + Copyright 2026 Maisa Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From db723646328bd135e924415412ce62cc9271599c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 7 Jan 2026 06:39:46 +0000 Subject: [PATCH 075/109] chore: break long lines in snippets into multiline --- tests/index.test.ts | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/tests/index.test.ts b/tests/index.test.ts index 9b3c876..2ac1e2e 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -138,7 +138,11 @@ describe('instantiate client', () => { return new Response(JSON.stringify({}), { headers: { 'Content-Type': 'application/json' } }); }; - const client = new Maisa({ baseURL: 'http://localhost:5000/', apiKey: 'My API Key', fetch: testFetch }); + const client = new Maisa({ + baseURL: 'http://localhost:5000/', + apiKey: 'My API Key', + fetch: testFetch, + }); await client.patch('/foo'); expect(capturedRequest?.method).toEqual('PATCH'); @@ -272,7 +276,11 @@ describe('retries', () => { return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } }); }; - const client = new Maisa({ apiKey: 'My API Key', timeout: 10, fetch: testFetch }); + const client = new Maisa({ + apiKey: 'My API Key', + timeout: 10, + fetch: testFetch, + }); expect(await client.request({ path: '/foo', method: 'get' })).toEqual({ a: 1 }); expect(count).toEqual(2); @@ -302,7 +310,11 @@ describe('retries', () => { return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } }); }; - const client = new Maisa({ apiKey: 'My API Key', fetch: testFetch, maxRetries: 4 }); + const client = new Maisa({ + apiKey: 'My API Key', + fetch: testFetch, + maxRetries: 4, + }); expect(await client.request({ path: '/foo', method: 'get' })).toEqual({ a: 1 }); @@ -326,7 +338,11 @@ describe('retries', () => { capturedRequest = init; return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } }); }; - const client = new Maisa({ apiKey: 'My API Key', fetch: testFetch, maxRetries: 4 }); + const client = new Maisa({ + apiKey: 'My API Key', + fetch: testFetch, + maxRetries: 4, + }); expect( await client.request({ @@ -388,7 +404,11 @@ describe('retries', () => { capturedRequest = init; return new Response(JSON.stringify({ a: 1 }), { headers: { 'Content-Type': 'application/json' } }); }; - const client = new Maisa({ apiKey: 'My API Key', fetch: testFetch, maxRetries: 4 }); + const client = new Maisa({ + apiKey: 'My API Key', + fetch: testFetch, + maxRetries: 4, + }); expect( await client.request({ From bab57e2971bdc8786ada51ef0c992b05c1a852b0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 14 Jan 2026 10:22:38 +0000 Subject: [PATCH 076/109] chore: fix typo in descriptions --- src/resources/file-interpreter/from-pdf.ts | 4 ++-- src/resources/kpu.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/resources/file-interpreter/from-pdf.ts b/src/resources/file-interpreter/from-pdf.ts index 7f0870e..2d49b2d 100644 --- a/src/resources/file-interpreter/from-pdf.ts +++ b/src/resources/file-interpreter/from-pdf.ts @@ -20,12 +20,12 @@ export type FromPdfCreateResponse = unknown; export interface FromPdfCreateParams { /** - * Body param: + * Body param */ file: Core.Uploadable; /** - * Query param: + * Query param */ max_pages?: number | null; } diff --git a/src/resources/kpu.ts b/src/resources/kpu.ts index f43e39e..dd64522 100644 --- a/src/resources/kpu.ts +++ b/src/resources/kpu.ts @@ -46,7 +46,7 @@ export interface KpuRunParams { file?: Array; /** - * Body param: + * Body param */ reasoner_model?: | 'gpt-4-turbo' @@ -60,7 +60,7 @@ export interface KpuRunParams { | null; /** - * Body param: + * Body param */ reasoner_prompt?: string | null; } From 725bccbe7669485dd8a30db75ac48c4304d39472 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 15 Jan 2026 08:32:44 +0000 Subject: [PATCH 077/109] chore(internal): upgrade babel, qs, js-yaml --- yarn.lock | 562 +++++++++++++++++++++++++----------------------------- 1 file changed, 257 insertions(+), 305 deletions(-) diff --git a/yarn.lock b/yarn.lock index 2bcc59e..d6c83fe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,163 +7,119 @@ resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf" integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA== -"@ampproject/remapping@^2.2.0": - version "2.2.1" - resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.1.tgz#99e8e11851128b8702cd57c33684f1d0f260b630" - integrity sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg== - dependencies: - "@jridgewell/gen-mapping" "^0.3.0" - "@jridgewell/trace-mapping" "^0.3.9" - -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.22.13", "@babel/code-frame@^7.23.5": - version "7.23.5" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.23.5.tgz#9009b69a8c602293476ad598ff53e4562e15c244" - integrity sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA== +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.28.6.tgz#72499312ec58b1e2245ba4a4f550c132be4982f7" + integrity sha512-JYgintcMjRiCvS8mMECzaEn+m3PfoQiyqukOMCCVQtoJGYJw8j/8LBJEiqkHLkfwCcs74E3pbAUFNg7d9VNJ+Q== dependencies: - "@babel/highlight" "^7.23.4" - chalk "^2.4.2" + "@babel/helper-validator-identifier" "^7.28.5" + js-tokens "^4.0.0" + picocolors "^1.1.1" -"@babel/compat-data@^7.23.5": - version "7.23.5" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.23.5.tgz#ffb878728bb6bdcb6f4510aa51b1be9afb8cfd98" - integrity sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw== +"@babel/compat-data@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.28.6.tgz#103f466803fa0f059e82ccac271475470570d74c" + integrity sha512-2lfu57JtzctfIrcGMz992hyLlByuzgIk58+hhGCxjKZ3rWI82NnVLjXcaTqkI2NvlcvOskZaiZ5kjUALo3Lpxg== "@babel/core@^7.11.6", "@babel/core@^7.12.3": - version "7.23.6" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.23.6.tgz#8be77cd77c55baadcc1eae1c33df90ab6d2151d4" - integrity sha512-FxpRyGjrMJXh7X3wGLGhNDCRiwpWEF74sKjTLDJSG5Kyvow3QZaG0Adbqzi9ZrVjTWpsX+2cxWXD71NMg93kdw== - dependencies: - "@ampproject/remapping" "^2.2.0" - "@babel/code-frame" "^7.23.5" - "@babel/generator" "^7.23.6" - "@babel/helper-compilation-targets" "^7.23.6" - "@babel/helper-module-transforms" "^7.23.3" - "@babel/helpers" "^7.23.6" - "@babel/parser" "^7.23.6" - "@babel/template" "^7.22.15" - "@babel/traverse" "^7.23.6" - "@babel/types" "^7.23.6" + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.28.6.tgz#531bf883a1126e53501ba46eb3bb414047af507f" + integrity sha512-H3mcG6ZDLTlYfaSNi0iOKkigqMFvkTKlGUYlD8GW7nNOYRrevuA46iTypPyv+06V3fEmvvazfntkBU34L0azAw== + dependencies: + "@babel/code-frame" "^7.28.6" + "@babel/generator" "^7.28.6" + "@babel/helper-compilation-targets" "^7.28.6" + "@babel/helper-module-transforms" "^7.28.6" + "@babel/helpers" "^7.28.6" + "@babel/parser" "^7.28.6" + "@babel/template" "^7.28.6" + "@babel/traverse" "^7.28.6" + "@babel/types" "^7.28.6" + "@jridgewell/remapping" "^2.3.5" convert-source-map "^2.0.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.2.3" semver "^6.3.1" -"@babel/generator@^7.23.6", "@babel/generator@^7.7.2": - version "7.23.6" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.23.6.tgz#9e1fca4811c77a10580d17d26b57b036133f3c2e" - integrity sha512-qrSfCYxYQB5owCmGLbl8XRpX1ytXlpueOb0N0UmQwA073KZxejgQTzAmJezxvpwQD9uGtK2shHdi55QT+MbjIw== +"@babel/generator@^7.28.6", "@babel/generator@^7.7.2": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.28.6.tgz#48dcc65d98fcc8626a48f72b62e263d25fc3c3f1" + integrity sha512-lOoVRwADj8hjf7al89tvQ2a1lf53Z+7tiXMgpZJL3maQPDxh0DgLMN62B2MKUOFcoodBHLMbDM6WAbKgNy5Suw== + dependencies: + "@babel/parser" "^7.28.6" + "@babel/types" "^7.28.6" + "@jridgewell/gen-mapping" "^0.3.12" + "@jridgewell/trace-mapping" "^0.3.28" + jsesc "^3.0.2" + +"@babel/helper-compilation-targets@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.28.6.tgz#32c4a3f41f12ed1532179b108a4d746e105c2b25" + integrity sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA== + dependencies: + "@babel/compat-data" "^7.28.6" + "@babel/helper-validator-option" "^7.27.1" + browserslist "^4.24.0" + lru-cache "^5.1.1" + semver "^6.3.1" + +"@babel/helper-globals@^7.28.0": + version "7.28.0" + resolved "https://registry.yarnpkg.com/@babel/helper-globals/-/helper-globals-7.28.0.tgz#b9430df2aa4e17bc28665eadeae8aa1d985e6674" + integrity sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw== + +"@babel/helper-module-imports@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.28.6.tgz#60632cbd6ffb70b22823187201116762a03e2d5c" + integrity sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw== dependencies: - "@babel/types" "^7.23.6" - "@jridgewell/gen-mapping" "^0.3.2" - "@jridgewell/trace-mapping" "^0.3.17" - jsesc "^2.5.1" + "@babel/traverse" "^7.28.6" + "@babel/types" "^7.28.6" -"@babel/helper-compilation-targets@^7.23.6": - version "7.23.6" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.23.6.tgz#4d79069b16cbcf1461289eccfbbd81501ae39991" - integrity sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ== +"@babel/helper-module-transforms@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.28.6.tgz#9312d9d9e56edc35aeb6e95c25d4106b50b9eb1e" + integrity sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA== dependencies: - "@babel/compat-data" "^7.23.5" - "@babel/helper-validator-option" "^7.23.5" - browserslist "^4.22.2" - lru-cache "^5.1.1" - semver "^6.3.1" + "@babel/helper-module-imports" "^7.28.6" + "@babel/helper-validator-identifier" "^7.28.5" + "@babel/traverse" "^7.28.6" -"@babel/helper-environment-visitor@^7.22.20": - version "7.22.20" - resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz#96159db61d34a29dba454c959f5ae4a649ba9167" - integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA== - -"@babel/helper-function-name@^7.23.0": - version "7.23.0" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz#1f9a3cdbd5b2698a670c30d2735f9af95ed52759" - integrity sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw== - dependencies: - "@babel/template" "^7.22.15" - "@babel/types" "^7.23.0" - -"@babel/helper-hoist-variables@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz#c01a007dac05c085914e8fb652b339db50d823bb" - integrity sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw== - dependencies: - "@babel/types" "^7.22.5" - -"@babel/helper-module-imports@^7.22.15": - version "7.22.15" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz#16146307acdc40cc00c3b2c647713076464bdbf0" - integrity sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w== - dependencies: - "@babel/types" "^7.22.15" - -"@babel/helper-module-transforms@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz#d7d12c3c5d30af5b3c0fcab2a6d5217773e2d0f1" - integrity sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ== - dependencies: - "@babel/helper-environment-visitor" "^7.22.20" - "@babel/helper-module-imports" "^7.22.15" - "@babel/helper-simple-access" "^7.22.5" - "@babel/helper-split-export-declaration" "^7.22.6" - "@babel/helper-validator-identifier" "^7.22.20" - -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.22.5", "@babel/helper-plugin-utils@^7.8.0": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz#dd7ee3735e8a313b9f7b05a773d892e88e6d7295" - integrity sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg== - -"@babel/helper-simple-access@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz#4938357dc7d782b80ed6dbb03a0fba3d22b1d5de" - integrity sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w== - dependencies: - "@babel/types" "^7.22.5" - -"@babel/helper-split-export-declaration@^7.22.6": - version "7.22.6" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz#322c61b7310c0997fe4c323955667f18fcefb91c" - integrity sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g== - dependencies: - "@babel/types" "^7.22.5" - -"@babel/helper-string-parser@^7.23.4": - version "7.23.4" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz#9478c707febcbbe1ddb38a3d91a2e054ae622d83" - integrity sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ== - -"@babel/helper-validator-identifier@^7.22.20": - version "7.22.20" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz#c4ae002c61d2879e724581d96665583dbc1dc0e0" - integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== - -"@babel/helper-validator-option@^7.23.5": - version "7.23.5" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.23.5.tgz#907a3fbd4523426285365d1206c423c4c5520307" - integrity sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw== - -"@babel/helpers@^7.23.6": - version "7.23.6" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.23.6.tgz#d03af2ee5fb34691eec0cda90f5ecbb4d4da145a" - integrity sha512-wCfsbN4nBidDRhpDhvcKlzHWCTlgJYUUdSJfzXb2NuBssDSIjc3xcb+znA7l+zYsFljAcGM0aFkN40cR3lXiGA== - dependencies: - "@babel/template" "^7.22.15" - "@babel/traverse" "^7.23.6" - "@babel/types" "^7.23.6" - -"@babel/highlight@^7.23.4": - version "7.23.4" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.23.4.tgz#edaadf4d8232e1a961432db785091207ead0621b" - integrity sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A== - dependencies: - "@babel/helper-validator-identifier" "^7.22.20" - chalk "^2.4.2" - js-tokens "^4.0.0" +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.28.6", "@babel/helper-plugin-utils@^7.8.0": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.28.6.tgz#6f13ea251b68c8532e985fd532f28741a8af9ac8" + integrity sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug== + +"@babel/helper-string-parser@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz#54da796097ab19ce67ed9f88b47bb2ec49367687" + integrity sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA== + +"@babel/helper-validator-identifier@^7.28.5": + version "7.28.5" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz#010b6938fab7cb7df74aa2bbc06aa503b8fe5fb4" + integrity sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q== -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.22.15", "@babel/parser@^7.23.6": - version "7.23.6" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.6.tgz#ba1c9e512bda72a47e285ae42aff9d2a635a9e3b" - integrity sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ== +"@babel/helper-validator-option@^7.27.1": + version "7.27.1" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz#fa52f5b1e7db1ab049445b421c4471303897702f" + integrity sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg== + +"@babel/helpers@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.28.6.tgz#fca903a313ae675617936e8998b814c415cbf5d7" + integrity sha512-xOBvwq86HHdB7WUDTfKfT/Vuxh7gElQ+Sfti2Cy6yIWNW05P8iUslOVcZ4/sKbE+/jQaukQAdz/gf3724kYdqw== + dependencies: + "@babel/template" "^7.28.6" + "@babel/types" "^7.28.6" + +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.28.6.tgz#f01a8885b7fa1e56dd8a155130226cd698ef13fd" + integrity sha512-TeR9zWR18BvbfPmGbLampPMW+uW1NZnJlRuuHso8i87QZNq2JRF9i6RgxRqtEq+wQGsS19NNTWr2duhnE49mfQ== + dependencies: + "@babel/types" "^7.28.6" "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -179,14 +135,28 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-class-properties@^7.8.3": +"@babel/plugin-syntax-class-properties@^7.12.13": version "7.12.13" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10" integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== dependencies: "@babel/helper-plugin-utils" "^7.12.13" -"@babel/plugin-syntax-import-meta@^7.8.3": +"@babel/plugin-syntax-class-static-block@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz#195df89b146b4b78b3bf897fd7a257c84659d406" + integrity sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-syntax-import-attributes@^7.24.7": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.28.6.tgz#b71d5914665f60124e133696f17cd7669062c503" + integrity sha512-jiLC0ma9XkQT3TKJ9uYvlakm66Pamywo+qwL+oL8HJOvc6TWdZXVfhqJr8CCzbSGUAbDOzlGHJC1U+vRfLQDvw== + dependencies: + "@babel/helper-plugin-utils" "^7.28.6" + +"@babel/plugin-syntax-import-meta@^7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz#ee601348c370fa334d2207be158777496521fd51" integrity sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g== @@ -201,13 +171,13 @@ "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-jsx@^7.7.2": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.23.3.tgz#8f2e4f8a9b5f9aa16067e142c1ac9cd9f810f473" - integrity sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg== + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.28.6.tgz#f8ca28bbd84883b5fea0e447c635b81ba73997ee" + integrity sha512-wgEmr06G6sIpqr8YDwA2dSRTE3bJ+V0IfpzfSY3Lfgd7YWOaAdlykvJi13ZKBt8cZHfgH1IXN+CL656W3uUa4w== dependencies: - "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-plugin-utils" "^7.28.6" -"@babel/plugin-syntax-logical-assignment-operators@^7.8.3": +"@babel/plugin-syntax-logical-assignment-operators@^7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig== @@ -221,7 +191,7 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-numeric-separator@^7.8.3": +"@babel/plugin-syntax-numeric-separator@^7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz#b9b070b3e33570cd9fd07ba7fa91c0dd37b9af97" integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug== @@ -249,7 +219,14 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" -"@babel/plugin-syntax-top-level-await@^7.8.3": +"@babel/plugin-syntax-private-property-in-object@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz#0dc6671ec0ea22b6e94a1114f857970cd39de1ad" + integrity sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-syntax-top-level-await@^7.14.5": version "7.14.5" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz#c1cfdadc35a646240001f06138247b741c34d94c" integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw== @@ -257,45 +234,41 @@ "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-typescript@^7.7.2": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.23.3.tgz#24f460c85dbbc983cd2b9c4994178bcc01df958f" - integrity sha512-9EiNjVJOMwCO+43TqoTrgQ8jMwcAd0sWyXi9RPfIsLTj4R2MADDDQXELhffaUx/uJv2AYcxBgPwH6j4TIA4ytQ== - dependencies: - "@babel/helper-plugin-utils" "^7.22.5" - -"@babel/template@^7.22.15", "@babel/template@^7.3.3": - version "7.22.15" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.22.15.tgz#09576efc3830f0430f4548ef971dde1350ef2f38" - integrity sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w== - dependencies: - "@babel/code-frame" "^7.22.13" - "@babel/parser" "^7.22.15" - "@babel/types" "^7.22.15" - -"@babel/traverse@^7.23.6": - version "7.23.6" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.6.tgz#b53526a2367a0dd6edc423637f3d2d0f2521abc5" - integrity sha512-czastdK1e8YByZqezMPFiZ8ahwVMh/ESl9vPgvgdB9AmFMGP5jfpFax74AQgl5zj4XHzqeYAg2l8PuUeRS1MgQ== - dependencies: - "@babel/code-frame" "^7.23.5" - "@babel/generator" "^7.23.6" - "@babel/helper-environment-visitor" "^7.22.20" - "@babel/helper-function-name" "^7.23.0" - "@babel/helper-hoist-variables" "^7.22.5" - "@babel/helper-split-export-declaration" "^7.22.6" - "@babel/parser" "^7.23.6" - "@babel/types" "^7.23.6" + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.28.6.tgz#c7b2ddf1d0a811145b1de800d1abd146af92e3a2" + integrity sha512-+nDNmQye7nlnuuHDboPbGm00Vqg3oO8niRRL27/4LYHUsHYh0zJ1xWOz0uRwNFmM1Avzk8wZbc6rdiYhomzv/A== + dependencies: + "@babel/helper-plugin-utils" "^7.28.6" + +"@babel/template@^7.28.6", "@babel/template@^7.3.3": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.28.6.tgz#0e7e56ecedb78aeef66ce7972b082fce76a23e57" + integrity sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ== + dependencies: + "@babel/code-frame" "^7.28.6" + "@babel/parser" "^7.28.6" + "@babel/types" "^7.28.6" + +"@babel/traverse@^7.28.6": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.28.6.tgz#871ddc79a80599a5030c53b1cc48cbe3a5583c2e" + integrity sha512-fgWX62k02qtjqdSNTAGxmKYY/7FSL9WAS1o2Hu5+I5m9T0yxZzr4cnrfXQ/MX0rIifthCSs6FKTlzYbJcPtMNg== + dependencies: + "@babel/code-frame" "^7.28.6" + "@babel/generator" "^7.28.6" + "@babel/helper-globals" "^7.28.0" + "@babel/parser" "^7.28.6" + "@babel/template" "^7.28.6" + "@babel/types" "^7.28.6" debug "^4.3.1" - globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.22.15", "@babel/types@^7.22.5", "@babel/types@^7.23.0", "@babel/types@^7.23.6", "@babel/types@^7.3.3": - version "7.23.6" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.6.tgz#be33fdb151e1f5a56877d704492c240fc71c7ccd" - integrity sha512-+uarb83brBzPKN38NX1MkB6vb6+mwvR6amUulqAE7ccQw1pEl+bCia9TbdG1lsnFP7lZySvUn37CHyXQdfTwzg== +"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.28.6", "@babel/types@^7.3.3": + version "7.28.6" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.28.6.tgz#c3e9377f1b155005bcc4c46020e7e394e13089df" + integrity sha512-0ZrskXVEHSWIqZM/sQZ4EV3jZJXRkio/WCxaqKZP1g//CEWEPSfeZFcms4XeKBCHU0ZKnIkdJeU/kF+eRp5lBg== dependencies: - "@babel/helper-string-parser" "^7.23.4" - "@babel/helper-validator-identifier" "^7.22.20" - to-fast-properties "^2.0.0" + "@babel/helper-string-parser" "^7.27.1" + "@babel/helper-validator-identifier" "^7.28.5" "@bcoe/v8-coverage@^0.2.3": version "0.2.3" @@ -585,31 +558,38 @@ "@types/yargs" "^17.0.8" chalk "^4.0.0" -"@jridgewell/gen-mapping@^0.3.0", "@jridgewell/gen-mapping@^0.3.2": - version "0.3.3" - resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz#7e02e6eb5df901aaedb08514203b096614024098" - integrity sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ== +"@jridgewell/gen-mapping@^0.3.12", "@jridgewell/gen-mapping@^0.3.5": + version "0.3.13" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz#6342a19f44347518c93e43b1ac69deb3c4656a1f" + integrity sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA== + dependencies: + "@jridgewell/sourcemap-codec" "^1.5.0" + "@jridgewell/trace-mapping" "^0.3.24" + +"@jridgewell/remapping@^2.3.5": + version "2.3.5" + resolved "https://registry.yarnpkg.com/@jridgewell/remapping/-/remapping-2.3.5.tgz#375c476d1972947851ba1e15ae8f123047445aa1" + integrity sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ== dependencies: - "@jridgewell/set-array" "^1.0.1" - "@jridgewell/sourcemap-codec" "^1.4.10" - "@jridgewell/trace-mapping" "^0.3.9" + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.24" "@jridgewell/resolve-uri@^3.1.0": version "3.1.1" resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721" integrity sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA== -"@jridgewell/set-array@^1.0.1": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" - integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== - -"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14": +"@jridgewell/sourcemap-codec@^1.4.14": version "1.4.15" resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== -"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.9": +"@jridgewell/sourcemap-codec@^1.5.0": + version "1.5.5" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz#6912b00d2c631c0d15ce1a7ab57cd657f2a8f8ba" + integrity sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og== + +"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.18": version "0.3.20" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz#72e45707cf240fa6b081d0366f8265b0cd10197f" integrity sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q== @@ -617,6 +597,14 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" +"@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.28": + version "0.3.31" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz#db15d6781c931f3a251a3dac39501c98a6082fd0" + integrity sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -1045,13 +1033,6 @@ ansi-regex@^5.0.1: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - ansi-styles@^4.0.0, ansi-styles@^4.1.0: version "4.3.0" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" @@ -1134,22 +1115,25 @@ babel-plugin-jest-hoist@^29.6.3: "@types/babel__traverse" "^7.0.6" babel-preset-current-node-syntax@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz#b4399239b89b2a011f9ddbe3e4f401fc40cff73b" - integrity sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ== + version "1.2.0" + resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.2.0.tgz#20730d6cdc7dda5d89401cab10ac6a32067acde6" + integrity sha512-E/VlAEzRrsLEb2+dv8yp3bo4scof3l9nR4lrld+Iy5NyVqgVYUJnDAmunkhPMisRI32Qc4iRiz425d8vM++2fg== dependencies: "@babel/plugin-syntax-async-generators" "^7.8.4" "@babel/plugin-syntax-bigint" "^7.8.3" - "@babel/plugin-syntax-class-properties" "^7.8.3" - "@babel/plugin-syntax-import-meta" "^7.8.3" + "@babel/plugin-syntax-class-properties" "^7.12.13" + "@babel/plugin-syntax-class-static-block" "^7.14.5" + "@babel/plugin-syntax-import-attributes" "^7.24.7" + "@babel/plugin-syntax-import-meta" "^7.10.4" "@babel/plugin-syntax-json-strings" "^7.8.3" - "@babel/plugin-syntax-logical-assignment-operators" "^7.8.3" + "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" - "@babel/plugin-syntax-numeric-separator" "^7.8.3" + "@babel/plugin-syntax-numeric-separator" "^7.10.4" "@babel/plugin-syntax-object-rest-spread" "^7.8.3" "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" "@babel/plugin-syntax-optional-chaining" "^7.8.3" - "@babel/plugin-syntax-top-level-await" "^7.8.3" + "@babel/plugin-syntax-private-property-in-object" "^7.14.5" + "@babel/plugin-syntax-top-level-await" "^7.14.5" babel-preset-jest@^29.6.3: version "29.6.3" @@ -1164,6 +1148,11 @@ balanced-match@^1.0.0: resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== +baseline-browser-mapping@^2.9.0: + version "2.9.14" + resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.9.14.tgz#3b6af0bc032445bca04de58caa9a87cfe921cbb3" + integrity sha512-B0xUquLkiGLgHhpPBqvl7GWegWBUNuujQ6kXd/r1U38ElPT6Ok8KZ8e+FpUGEc2ZoRQUzq/aUnaKFc/svWUGSg== + big-integer@^1.6.44: version "1.6.52" resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.52.tgz#60a887f3047614a8e1bffe5d7173490a97dc8c85" @@ -1177,17 +1166,17 @@ bplist-parser@^0.2.0: big-integer "^1.6.44" brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + version "1.1.12" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.12.tgz#ab9b454466e5a8cc3a187beaad580412a9c5b843" + integrity sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg== dependencies: balanced-match "^1.0.0" concat-map "0.0.1" brace-expansion@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" - integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + version "2.0.2" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.2.tgz#54fc53237a613d854c7bd37463aad17df87214e7" + integrity sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ== dependencies: balanced-match "^1.0.0" @@ -1198,15 +1187,16 @@ braces@^3.0.3: dependencies: fill-range "^7.1.1" -browserslist@^4.22.2: - version "4.22.2" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.22.2.tgz#704c4943072bd81ea18997f3bd2180e89c77874b" - integrity sha512-0UgcrvQmBDvZHFGdYUehrCNIazki7/lUP3kkoi/r3YB2amZbFM9J43ZRkJTXBUZK4gmx56+Sqk9+Vs9mwZx9+A== +browserslist@^4.24.0: + version "4.28.1" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.28.1.tgz#7f534594628c53c63101079e27e40de490456a95" + integrity sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA== dependencies: - caniuse-lite "^1.0.30001565" - electron-to-chromium "^1.4.601" - node-releases "^2.0.14" - update-browserslist-db "^1.0.13" + baseline-browser-mapping "^2.9.0" + caniuse-lite "^1.0.30001759" + electron-to-chromium "^1.5.263" + node-releases "^2.0.27" + update-browserslist-db "^1.2.0" bs-logger@0.x: version "0.2.6" @@ -1257,19 +1247,10 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001565: - version "1.0.30001570" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001570.tgz#b4e5c1fa786f733ab78fc70f592df6b3f23244ca" - integrity sha512-+3e0ASu4sw1SWaoCtvPeyXp+5PsjigkSt8OXZbF9StH5pQWbxEjLAZE3n8Aup5udop1uRiKA7a4utUk/uoSpUw== - -chalk@^2.4.2: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" +caniuse-lite@^1.0.30001759: + version "1.0.30001764" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001764.tgz#03206c56469f236103b90f9ae10bcb8b9e1f6005" + integrity sha512-9JGuzl2M+vPL+pz70gtMF9sHdMFbY9FJaQBi186cHKH3pSzDvzoUJUPV6fqiKIMyXbud9ZLg4F3Yza1vJ1+93g== chalk@^4.0.0: version "4.1.2" @@ -1318,13 +1299,6 @@ collect-v8-coverage@^1.0.0: resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.2.tgz#c0b29bcd33bcd0779a1344c2136051e6afd3d9e9" integrity sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q== -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - color-convert@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" @@ -1332,11 +1306,6 @@ color-convert@^2.0.1: dependencies: color-name "~1.1.4" -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== - color-name@~1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" @@ -1486,10 +1455,10 @@ dunder-proto@^1.0.1: es-errors "^1.3.0" gopd "^1.2.0" -electron-to-chromium@^1.4.601: - version "1.4.614" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.614.tgz#2fe789d61fa09cb875569f37c309d0c2701f91c0" - integrity sha512-X4ze/9Sc3QWs6h92yerwqv7aB/uU8vCjZcrMjA8N9R1pjMFRe44dLsck5FzLilOYvcXuDn93B+bpGYyufc70gQ== +electron-to-chromium@^1.5.263: + version "1.5.267" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.267.tgz#5d84f2df8cdb6bfe7e873706bb21bd4bfb574dc7" + integrity sha512-0Drusm6MVRXSOJpGbaSVgcQsuB4hEkMpHXaVstcPmhu5LIedxs1xNK/nIxmQIU/RPC0+1/o0AVZfBTkTNJOdUw== emittery@^0.13.1: version "0.13.1" @@ -1540,10 +1509,10 @@ escalade@^3.1.1: resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== -escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== +escalade@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5" + integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA== escape-string-regexp@^2.0.0: version "2.0.0" @@ -1933,11 +1902,6 @@ glob@^7.1.3, glob@^7.1.4: once "^1.3.0" path-is-absolute "^1.0.0" -globals@^11.1.0: - version "11.12.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" - integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== - globals@^13.19.0: version "13.20.0" resolved "https://registry.yarnpkg.com/globals/-/globals-13.20.0.tgz#ea276a1e508ffd4f1612888f9d1bad1e2717bf82" @@ -1972,11 +1936,6 @@ graphemer@^1.4.0: resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== - has-flag@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" @@ -2581,24 +2540,24 @@ js-tokens@^4.0.0: integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== js-yaml@^3.13.1: - version "3.14.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" - integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== + version "3.14.2" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.2.tgz#77485ce1dd7f33c061fd1b16ecea23b55fcb04b0" + integrity sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg== dependencies: argparse "^1.0.7" esprima "^4.0.0" js-yaml@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" - integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + version "4.1.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.1.tgz#854c292467705b699476e1a2decc0c8a3458806b" + integrity sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA== dependencies: argparse "^2.0.1" -jsesc@^2.5.1: - version "2.5.2" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" - integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== +jsesc@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-3.1.0.tgz#74d335a234f67ed19907fdadfac7ccf9d409825d" + integrity sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA== json-parse-even-better-errors@^2.3.0: version "2.3.1" @@ -2801,10 +2760,10 @@ node-int64@^0.4.0: resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== -node-releases@^2.0.14: - version "2.0.14" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.14.tgz#2ffb053bceb8b2be8495ece1ab6ce600c4461b0b" - integrity sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw== +node-releases@^2.0.27: + version "2.0.27" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.27.tgz#eedca519205cf20f650f61d56b070db111231e4e" + integrity sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA== normalize-path@^3.0.0: version "3.0.0" @@ -2967,6 +2926,11 @@ picocolors@^1.0.0: resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== +picocolors@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" + integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== + picomatch@^2.0.4, picomatch@^2.2.3, picomatch@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" @@ -3256,13 +3220,6 @@ superstruct@^1.0.3: resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-1.0.3.tgz#de626a5b49c6641ff4d37da3c7598e7a87697046" integrity sha512-8iTn3oSS8nRGn+C2pgXSKPI3jmpm6FExNazNpjvqS6ZUJQCej3PUXEKM8NjHBOs54ExM+LPW/FBRhymrdcCiSg== -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - supports-color@^7.1.0: version "7.2.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" @@ -3314,11 +3271,6 @@ tmpl@1.0.5: resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc" integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw== -to-fast-properties@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" - integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== - to-regex-range@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" @@ -3441,13 +3393,13 @@ untildify@^4.0.0: resolved "https://registry.yarnpkg.com/untildify/-/untildify-4.0.0.tgz#2bc947b953652487e4600949fb091e3ae8cd919b" integrity sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw== -update-browserslist-db@^1.0.13: - version "1.0.13" - resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz#3c5e4f5c083661bd38ef64b6328c26ed6c8248c4" - integrity sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg== +update-browserslist-db@^1.2.0: + version "1.2.3" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz#64d76db58713136acbeb4c49114366cc6cc2e80d" + integrity sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w== dependencies: - escalade "^3.1.1" - picocolors "^1.0.0" + escalade "^3.2.0" + picocolors "^1.1.1" uri-js@^4.2.2: version "4.4.1" From 1b1a007aff2bcd038f500b22330ecf22fdfcf8d7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 17 Jan 2026 07:23:06 +0000 Subject: [PATCH 078/109] chore(internal): update `actions/checkout` version --- .github/workflows/ci.yml | 6 +++--- .github/workflows/publish-npm.yml | 2 +- .github/workflows/release-doctor.yml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c9319e8..1cfbdd3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/maisa-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Node uses: actions/setup-node@v4 @@ -41,7 +41,7 @@ jobs: contents: read id-token: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Node uses: actions/setup-node@v4 @@ -74,7 +74,7 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/maisa-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Node uses: actions/setup-node@v4 diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index fbe3db6..76f4770 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Node uses: actions/setup-node@v3 diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 56b7304..1e23984 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -12,7 +12,7 @@ jobs: if: github.repository == 'maisaai/node-sdk' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Check release environment run: | From 26b60fa45899c30f717c5cf979e954422a81b771 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 24 Jan 2026 06:24:00 +0000 Subject: [PATCH 079/109] chore(ci): upgrade `actions/github-script` --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1cfbdd3..7f13700 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,7 +57,7 @@ jobs: - name: Get GitHub OIDC Token if: github.repository == 'stainless-sdks/maisa-node' id: github-oidc - uses: actions/github-script@v6 + uses: actions/github-script@v8 with: script: core.setOutput('github_token', await core.getIDToken()); From 2146bde4a683159ec08b047d2a1227fbf0937242 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Feb 2026 07:50:49 +0000 Subject: [PATCH 080/109] chore(client): do not parse responses with empty content-length --- src/core.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core.ts b/src/core.ts index e6d7271..1f32770 100644 --- a/src/core.ts +++ b/src/core.ts @@ -70,6 +70,12 @@ async function defaultParseResponse(props: APIResponseProps): Promise { const mediaType = contentType?.split(';')[0]?.trim(); const isJSON = mediaType?.includes('application/json') || mediaType?.endsWith('+json'); if (isJSON) { + const contentLength = response.headers.get('content-length'); + if (contentLength === '0') { + // if there is no content we can't do anything + return undefined as T; + } + const json = await response.json(); debug('response', response.status, response.url, response.headers, json); From ec985936ba0034dd1a2f5afd03feea8c064e8f20 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 20 Feb 2026 07:38:58 +0000 Subject: [PATCH 081/109] chore: update mock server docs --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1f75bdc..4ee8719 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -68,7 +68,7 @@ $ pnpm link -—global maisa Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests. ```sh -$ npx prism mock path/to/your/openapi.yml +$ ./scripts/mock ``` ```sh From 87e0ce781aa392df571fa9673b036fff02c17f7d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Feb 2026 07:51:24 +0000 Subject: [PATCH 082/109] fix(docs/contributing): correct pnpm link command --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4ee8719..c7270ab 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -60,7 +60,7 @@ $ yarn link maisa # With pnpm $ pnpm link --global $ cd ../my-package -$ pnpm link -—global maisa +$ pnpm link --global maisa ``` ## Running tests From 9b1e546ec712a2f2fdf239cd357694b674f6391b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 27 Feb 2026 08:37:37 +0000 Subject: [PATCH 083/109] chore(internal): move stringifyQuery implementation to internal function --- src/core.ts | 20 ++++---------------- src/internal/utils/query.ts | 23 +++++++++++++++++++++++ tests/stringifyQuery.test.ts | 6 ++---- 3 files changed, 29 insertions(+), 20 deletions(-) create mode 100644 src/internal/utils/query.ts diff --git a/src/core.ts b/src/core.ts index 1f32770..edfba80 100644 --- a/src/core.ts +++ b/src/core.ts @@ -6,6 +6,7 @@ import { APIConnectionTimeoutError, APIUserAbortError, } from './error'; +import { stringifyQuery } from './internal/utils/query'; import { kind as shimsKind, type Readable, @@ -528,27 +529,14 @@ export abstract class APIClient { } if (typeof query === 'object' && query && !Array.isArray(query)) { - url.search = this.stringifyQuery(query as Record); + url.search = this.stringifyQuery(query); } return url.toString(); } - protected stringifyQuery(query: Record): string { - return Object.entries(query) - .filter(([_, value]) => typeof value !== 'undefined') - .map(([key, value]) => { - if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') { - return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`; - } - if (value === null) { - return `${encodeURIComponent(key)}=`; - } - throw new MaisaError( - `Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`, - ); - }) - .join('&'); + protected stringifyQuery(query: object | Record): string { + return stringifyQuery(query); } async fetchWithTimeout( diff --git a/src/internal/utils/query.ts b/src/internal/utils/query.ts new file mode 100644 index 0000000..99c33b1 --- /dev/null +++ b/src/internal/utils/query.ts @@ -0,0 +1,23 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { MaisaError } from '../../error'; + +/** + * Basic re-implementation of `qs.stringify` for primitive types. + */ +export function stringifyQuery(query: object | Record) { + return Object.entries(query) + .filter(([_, value]) => typeof value !== 'undefined') + .map(([key, value]) => { + if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') { + return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`; + } + if (value === null) { + return `${encodeURIComponent(key)}=`; + } + throw new MaisaError( + `Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`, + ); + }) + .join('&'); +} diff --git a/tests/stringifyQuery.test.ts b/tests/stringifyQuery.test.ts index 403f340..fa8d585 100644 --- a/tests/stringifyQuery.test.ts +++ b/tests/stringifyQuery.test.ts @@ -1,8 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { Maisa } from 'maisa'; - -const { stringifyQuery } = Maisa.prototype as any; +import { stringifyQuery } from 'maisa/internal/utils/query'; describe(stringifyQuery, () => { for (const [input, expected] of [ @@ -15,7 +13,7 @@ describe(stringifyQuery, () => { 'e=f', )}=${encodeURIComponent('g&h')}`, ], - ]) { + ] as const) { it(`${JSON.stringify(input)} -> ${expected}`, () => { expect(stringifyQuery(input)).toEqual(expected); }); From ad7909c20b87c65781c087ea3e8e1976f0abd87e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2026 13:13:18 +0000 Subject: [PATCH 084/109] chore(internal): codegen related update --- src/core.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core.ts b/src/core.ts index edfba80..ce6a2e0 100644 --- a/src/core.ts +++ b/src/core.ts @@ -618,9 +618,9 @@ export abstract class APIClient { } } - // If the API asks us to wait a certain amount of time (and it's a reasonable amount), - // just do what it says, but otherwise calculate a default - if (!(timeoutMillis && 0 <= timeoutMillis && timeoutMillis < 60 * 1000)) { + // If the API asks us to wait a certain amount of time, do what it says. + // Otherwise calculate a default. + if (timeoutMillis === undefined) { const maxRetries = options.maxRetries ?? this.maxRetries; timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries); } From c86bbfc5343ec69a6ae193d484f8e8039cb3c69e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2026 13:27:42 +0000 Subject: [PATCH 085/109] chore(test): do not count install time for mock server timeout --- scripts/mock | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/mock b/scripts/mock index 0b28f6e..bcf3b39 100755 --- a/scripts/mock +++ b/scripts/mock @@ -21,11 +21,22 @@ echo "==> Starting mock server with URL ${URL}" # Run prism mock on the given spec if [ "$1" == "--daemon" ]; then + # Pre-install the package so the download doesn't eat into the startup timeout + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism --version + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & - # Wait for server to come online + # Wait for server to come online (max 30s) echo -n "Waiting for server" + attempts=0 while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do + attempts=$((attempts + 1)) + if [ "$attempts" -ge 300 ]; then + echo + echo "Timed out waiting for Prism server to start" + cat .prism.log + exit 1 + fi echo -n "." sleep 0.1 done From 279547720bd1f3359028096cded81cf15f8c0282 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 7 Mar 2026 19:10:53 +0000 Subject: [PATCH 086/109] chore(ci): skip uploading artifacts on stainless-internal branches --- .github/workflows/ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f13700..718542e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,14 +55,18 @@ jobs: run: ./scripts/build - name: Get GitHub OIDC Token - if: github.repository == 'stainless-sdks/maisa-node' + if: |- + github.repository == 'stainless-sdks/maisa-node' && + !startsWith(github.ref, 'refs/heads/stl/') id: github-oidc uses: actions/github-script@v8 with: script: core.setOutput('github_token', await core.getIDToken()); - name: Upload tarball - if: github.repository == 'stainless-sdks/maisa-node' + if: |- + github.repository == 'stainless-sdks/maisa-node' && + !startsWith(github.ref, 'refs/heads/stl/') env: URL: https://pkg.stainless.com/s AUTH: ${{ steps.github-oidc.outputs.github_token }} From 194604e309f974a187879e781151eca87c3854f8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 7 Mar 2026 19:12:25 +0000 Subject: [PATCH 087/109] chore: update placeholder string --- tests/api-resources/capabilities/media.test.ts | 16 ++++++++-------- .../file-interpreter/from-audio.test.ts | 4 ++-- .../file-interpreter/from-docx.test.ts | 4 ++-- .../file-interpreter/from-html.test.ts | 4 ++-- .../file-interpreter/from-image.test.ts | 4 ++-- .../file-interpreter/from-pdf.test.ts | 4 ++-- tests/api-resources/kpu.test.ts | 2 +- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/tests/api-resources/capabilities/media.test.ts b/tests/api-resources/capabilities/media.test.ts index 15c70c2..f948f32 100644 --- a/tests/api-resources/capabilities/media.test.ts +++ b/tests/api-resources/capabilities/media.test.ts @@ -11,8 +11,8 @@ const client = new Maisa({ describe('resource media', () => { test('compare: only required params', async () => { const responsePromise = client.capabilities.media.compare({ - file1: await toFile(Buffer.from('# my file contents'), 'README.md'), - file2: await toFile(Buffer.from('# my file contents'), 'README.md'), + file1: await toFile(Buffer.from('Example data'), 'README.md'), + file2: await toFile(Buffer.from('Example data'), 'README.md'), }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -25,8 +25,8 @@ describe('resource media', () => { test('compare: required and optional params', async () => { const response = await client.capabilities.media.compare({ - file1: await toFile(Buffer.from('# my file contents'), 'README.md'), - file2: await toFile(Buffer.from('# my file contents'), 'README.md'), + file1: await toFile(Buffer.from('Example data'), 'README.md'), + file2: await toFile(Buffer.from('Example data'), 'README.md'), lang: 'en', prompt: 'Compare the value for end customer.', variable1_description: 'The name of the person.', @@ -46,7 +46,7 @@ describe('resource media', () => { test('extract: only required params', async () => { const responsePromise = client.capabilities.media.extract({ - file: await toFile(Buffer.from('# my file contents'), 'README.md'), + file: await toFile(Buffer.from('Example data'), 'README.md'), }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -59,7 +59,7 @@ describe('resource media', () => { test('extract: required and optional params', async () => { const response = await client.capabilities.media.extract({ - file: await toFile(Buffer.from('# my file contents'), 'README.md'), + file: await toFile(Buffer.from('Example data'), 'README.md'), lang: 'en', variable1_description: 'The name of the person.', variable1_name: 'Name', @@ -78,7 +78,7 @@ describe('resource media', () => { test('summarize: only required params', async () => { const responsePromise = client.capabilities.media.summarize({ - file: await toFile(Buffer.from('# my file contents'), 'README.md'), + file: await toFile(Buffer.from('Example data'), 'README.md'), }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -91,7 +91,7 @@ describe('resource media', () => { test('summarize: required and optional params', async () => { const response = await client.capabilities.media.summarize({ - file: await toFile(Buffer.from('# my file contents'), 'README.md'), + file: await toFile(Buffer.from('Example data'), 'README.md'), format: 'paragraph', lang: 'en', length: 'short', diff --git a/tests/api-resources/file-interpreter/from-audio.test.ts b/tests/api-resources/file-interpreter/from-audio.test.ts index 94ff2ff..3278ebf 100644 --- a/tests/api-resources/file-interpreter/from-audio.test.ts +++ b/tests/api-resources/file-interpreter/from-audio.test.ts @@ -11,7 +11,7 @@ const client = new Maisa({ describe('resource fromAudio', () => { test('create: only required params', async () => { const responsePromise = client.fileInterpreter.fromAudio.create({ - file: await toFile(Buffer.from('# my file contents'), 'README.md'), + file: await toFile(Buffer.from('Example data'), 'README.md'), }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -24,7 +24,7 @@ describe('resource fromAudio', () => { test('create: required and optional params', async () => { const response = await client.fileInterpreter.fromAudio.create({ - file: await toFile(Buffer.from('# my file contents'), 'README.md'), + file: await toFile(Buffer.from('Example data'), 'README.md'), }); }); }); diff --git a/tests/api-resources/file-interpreter/from-docx.test.ts b/tests/api-resources/file-interpreter/from-docx.test.ts index 73e6a74..9e9820f 100644 --- a/tests/api-resources/file-interpreter/from-docx.test.ts +++ b/tests/api-resources/file-interpreter/from-docx.test.ts @@ -11,7 +11,7 @@ const client = new Maisa({ describe('resource fromDocx', () => { test('create: only required params', async () => { const responsePromise = client.fileInterpreter.fromDocx.create({ - file: await toFile(Buffer.from('# my file contents'), 'README.md'), + file: await toFile(Buffer.from('Example data'), 'README.md'), }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -24,7 +24,7 @@ describe('resource fromDocx', () => { test('create: required and optional params', async () => { const response = await client.fileInterpreter.fromDocx.create({ - file: await toFile(Buffer.from('# my file contents'), 'README.md'), + file: await toFile(Buffer.from('Example data'), 'README.md'), }); }); }); diff --git a/tests/api-resources/file-interpreter/from-html.test.ts b/tests/api-resources/file-interpreter/from-html.test.ts index 711fbb5..855019f 100644 --- a/tests/api-resources/file-interpreter/from-html.test.ts +++ b/tests/api-resources/file-interpreter/from-html.test.ts @@ -11,7 +11,7 @@ const client = new Maisa({ describe('resource fromHTML', () => { test('create: only required params', async () => { const responsePromise = client.fileInterpreter.fromHTML.create({ - file: await toFile(Buffer.from('# my file contents'), 'README.md'), + file: await toFile(Buffer.from('Example data'), 'README.md'), }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -24,7 +24,7 @@ describe('resource fromHTML', () => { test('create: required and optional params', async () => { const response = await client.fileInterpreter.fromHTML.create({ - file: await toFile(Buffer.from('# my file contents'), 'README.md'), + file: await toFile(Buffer.from('Example data'), 'README.md'), }); }); }); diff --git a/tests/api-resources/file-interpreter/from-image.test.ts b/tests/api-resources/file-interpreter/from-image.test.ts index ffa1ed5..adaac75 100644 --- a/tests/api-resources/file-interpreter/from-image.test.ts +++ b/tests/api-resources/file-interpreter/from-image.test.ts @@ -11,7 +11,7 @@ const client = new Maisa({ describe('resource fromImage', () => { test('create: only required params', async () => { const responsePromise = client.fileInterpreter.fromImage.create({ - file: await toFile(Buffer.from('# my file contents'), 'README.md'), + file: await toFile(Buffer.from('Example data'), 'README.md'), }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -24,7 +24,7 @@ describe('resource fromImage', () => { test('create: required and optional params', async () => { const response = await client.fileInterpreter.fromImage.create({ - file: await toFile(Buffer.from('# my file contents'), 'README.md'), + file: await toFile(Buffer.from('Example data'), 'README.md'), }); }); }); diff --git a/tests/api-resources/file-interpreter/from-pdf.test.ts b/tests/api-resources/file-interpreter/from-pdf.test.ts index 5d02b45..d58ce17 100644 --- a/tests/api-resources/file-interpreter/from-pdf.test.ts +++ b/tests/api-resources/file-interpreter/from-pdf.test.ts @@ -11,7 +11,7 @@ const client = new Maisa({ describe('resource fromPdf', () => { test('create: only required params', async () => { const responsePromise = client.fileInterpreter.fromPdf.create({ - file: await toFile(Buffer.from('# my file contents'), 'README.md'), + file: await toFile(Buffer.from('Example data'), 'README.md'), }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -24,7 +24,7 @@ describe('resource fromPdf', () => { test('create: required and optional params', async () => { const response = await client.fileInterpreter.fromPdf.create({ - file: await toFile(Buffer.from('# my file contents'), 'README.md'), + file: await toFile(Buffer.from('Example data'), 'README.md'), max_pages: 0, }); }); diff --git a/tests/api-resources/kpu.test.ts b/tests/api-resources/kpu.test.ts index a603f9c..5a2da2d 100644 --- a/tests/api-resources/kpu.test.ts +++ b/tests/api-resources/kpu.test.ts @@ -25,7 +25,7 @@ describe('resource kpu', () => { query: 'query', explain_steps: true, retries: 1, - file: [await toFile(Buffer.from('# my file contents'), 'README.md')], + file: [await toFile(Buffer.from('Example data'), 'README.md')], reasoner_model: 'gpt-4-turbo', reasoner_prompt: 'reasoner_prompt', }); From 48d3a7617a90a7ae1565e029482d0118f515780f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 7 Mar 2026 19:16:25 +0000 Subject: [PATCH 088/109] fix(client): preserve URL params already embedded in path --- src/core.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core.ts b/src/core.ts index ce6a2e0..174fc88 100644 --- a/src/core.ts +++ b/src/core.ts @@ -524,8 +524,9 @@ export abstract class APIClient { : new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path)); const defaultQuery = this.defaultQuery(); - if (!isEmptyObj(defaultQuery)) { - query = { ...defaultQuery, ...query } as Req; + const pathQuery = Object.fromEntries(url.searchParams); + if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) { + query = { ...pathQuery, ...defaultQuery, ...query } as Req; } if (typeof query === 'object' && query && !Array.isArray(query)) { From 454a3b267522c0a8b0509ee9346a992668ed2b29 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 17 Mar 2026 12:07:16 +0000 Subject: [PATCH 089/109] chore(internal): tweak CI branches --- .github/workflows/ci.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 718542e..b8e9a1c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,12 +1,14 @@ name: CI on: push: - branches-ignore: - - 'generated' - - 'codegen/**' - - 'integrated/**' - - 'stl-preview-head/**' - - 'stl-preview-base/**' + branches: + - '**' + - '!integrated/**' + - '!stl-preview-head/**' + - '!stl-preview-base/**' + - '!generated' + - '!codegen/**' + - 'codegen/stl/**' pull_request: branches-ignore: - 'stl-preview-head/**' From 31ba2930540fe4c6b256cf0021f3c6ea81722bd7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 20 Mar 2026 03:39:07 +0000 Subject: [PATCH 090/109] refactor(tests): switch from prism to steady --- CONTRIBUTING.md | 2 +- scripts/mock | 26 +++++++++++++------------- scripts/test | 16 ++++++++-------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c7270ab..d2e5b3f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -65,7 +65,7 @@ $ pnpm link --global maisa ## Running tests -Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests. +Most tests require you to [set up a mock server](https://github.com/dgellow/steady) against the OpenAPI spec to run the tests. ```sh $ ./scripts/mock diff --git a/scripts/mock b/scripts/mock index bcf3b39..38201de 100755 --- a/scripts/mock +++ b/scripts/mock @@ -19,34 +19,34 @@ fi echo "==> Starting mock server with URL ${URL}" -# Run prism mock on the given spec +# Run steady mock on the given spec if [ "$1" == "--daemon" ]; then # Pre-install the package so the download doesn't eat into the startup timeout - npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism --version + npm exec --package=@stdy/cli@0.19.3 -- steady --version - npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & + npm exec --package=@stdy/cli@0.19.3 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-query-object-format=brackets "$URL" &> .stdy.log & - # Wait for server to come online (max 30s) + # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" attempts=0 - while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do + while ! curl --silent --fail "http://127.0.0.1:4010/_x-steady/health" >/dev/null 2>&1; do + if ! kill -0 $! 2>/dev/null; then + echo + cat .stdy.log + exit 1 + fi attempts=$((attempts + 1)) if [ "$attempts" -ge 300 ]; then echo - echo "Timed out waiting for Prism server to start" - cat .prism.log + echo "Timed out waiting for Steady server to start" + cat .stdy.log exit 1 fi echo -n "." sleep 0.1 done - if grep -q "✖ fatal" ".prism.log"; then - cat .prism.log - exit 1 - fi - echo else - npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" + npm exec --package=@stdy/cli@0.19.3 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-query-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index 7bce051..af1c7a5 100755 --- a/scripts/test +++ b/scripts/test @@ -9,8 +9,8 @@ GREEN='\033[0;32m' YELLOW='\033[0;33m' NC='\033[0m' # No Color -function prism_is_running() { - curl --silent "http://localhost:4010" >/dev/null 2>&1 +function steady_is_running() { + curl --silent "http://127.0.0.1:4010/_x-steady/health" >/dev/null 2>&1 } kill_server_on_port() { @@ -25,7 +25,7 @@ function is_overriding_api_base_url() { [ -n "$TEST_API_BASE_URL" ] } -if ! is_overriding_api_base_url && ! prism_is_running ; then +if ! is_overriding_api_base_url && ! steady_is_running ; then # When we exit this script, make sure to kill the background mock server process trap 'kill_server_on_port 4010' EXIT @@ -36,19 +36,19 @@ fi if is_overriding_api_base_url ; then echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}" echo -elif ! prism_is_running ; then - echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server" +elif ! steady_is_running ; then + echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Steady server" echo -e "running against your OpenAPI spec." echo echo -e "To run the server, pass in the path or url of your OpenAPI" - echo -e "spec to the prism command:" + echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.3 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-query-object-format=brackets${NC}" echo exit 1 else - echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}" + echo -e "${GREEN}✔ Mock steady server is running with your OpenAPI spec${NC}" echo fi From b5d7d9f6eb306f51af0ae4c4ace9feaebdb9ea49 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 21 Mar 2026 04:43:52 +0000 Subject: [PATCH 091/109] chore(tests): bump steady to v0.19.4 --- scripts/mock | 6 +++--- scripts/test | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/mock b/scripts/mock index 38201de..e1c19e8 100755 --- a/scripts/mock +++ b/scripts/mock @@ -22,9 +22,9 @@ echo "==> Starting mock server with URL ${URL}" # Run steady mock on the given spec if [ "$1" == "--daemon" ]; then # Pre-install the package so the download doesn't eat into the startup timeout - npm exec --package=@stdy/cli@0.19.3 -- steady --version + npm exec --package=@stdy/cli@0.19.4 -- steady --version - npm exec --package=@stdy/cli@0.19.3 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-query-object-format=brackets "$URL" &> .stdy.log & + npm exec --package=@stdy/cli@0.19.4 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" @@ -48,5 +48,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stdy/cli@0.19.3 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-query-object-format=brackets "$URL" + npm exec --package=@stdy/cli@0.19.4 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index af1c7a5..8cf5220 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! steady_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.3 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-query-object-format=brackets${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.4 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets${NC}" echo exit 1 From f72c5526b6ed5cea736e3f33677deb2fcaed8b24 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 21 Mar 2026 04:49:18 +0000 Subject: [PATCH 092/109] chore(tests): bump steady to v0.19.5 --- scripts/mock | 6 +++--- scripts/test | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/mock b/scripts/mock index e1c19e8..ab814d3 100755 --- a/scripts/mock +++ b/scripts/mock @@ -22,9 +22,9 @@ echo "==> Starting mock server with URL ${URL}" # Run steady mock on the given spec if [ "$1" == "--daemon" ]; then # Pre-install the package so the download doesn't eat into the startup timeout - npm exec --package=@stdy/cli@0.19.4 -- steady --version + npm exec --package=@stdy/cli@0.19.5 -- steady --version - npm exec --package=@stdy/cli@0.19.4 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & + npm exec --package=@stdy/cli@0.19.5 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" @@ -48,5 +48,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stdy/cli@0.19.4 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" + npm exec --package=@stdy/cli@0.19.5 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index 8cf5220..907f7be 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! steady_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.4 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.5 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets${NC}" echo exit 1 From ad821701c21bca695d20b641f0a35a5c72626907 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Mar 2026 04:49:06 +0000 Subject: [PATCH 093/109] chore(internal): update gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2412bb7..c85fe68 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .prism.log +.stdy.log node_modules yarn-error.log codegen.log From ca75a498a0791a74d12bc54085bad27ecaccb238 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 24 Mar 2026 04:55:02 +0000 Subject: [PATCH 094/109] chore(tests): bump steady to v0.19.6 --- scripts/mock | 6 +++--- scripts/test | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/mock b/scripts/mock index ab814d3..b319bdf 100755 --- a/scripts/mock +++ b/scripts/mock @@ -22,9 +22,9 @@ echo "==> Starting mock server with URL ${URL}" # Run steady mock on the given spec if [ "$1" == "--daemon" ]; then # Pre-install the package so the download doesn't eat into the startup timeout - npm exec --package=@stdy/cli@0.19.5 -- steady --version + npm exec --package=@stdy/cli@0.19.6 -- steady --version - npm exec --package=@stdy/cli@0.19.5 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & + npm exec --package=@stdy/cli@0.19.6 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" @@ -48,5 +48,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stdy/cli@0.19.5 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" + npm exec --package=@stdy/cli@0.19.6 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index 907f7be..8061e04 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! steady_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.5 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.6 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets${NC}" echo exit 1 From 70b2d9e3abf1ea056f4ef8ff688ac86cc9331c8c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 25 Mar 2026 03:18:15 +0000 Subject: [PATCH 095/109] chore(ci): skip lint on metadata-only changes Note that we still want to run tests, as these depend on the metadata. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b8e9a1c..4c567ff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: timeout-minutes: 10 name: lint runs-on: ${{ github.repository == 'stainless-sdks/maisa-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} - if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: - uses: actions/checkout@v6 @@ -38,7 +38,7 @@ jobs: timeout-minutes: 5 name: build runs-on: ${{ github.repository == 'stainless-sdks/maisa-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} - if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') permissions: contents: read id-token: write From ad262cf972b2171d2546ff2dbac4f92aaff85595 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 25 Mar 2026 03:18:58 +0000 Subject: [PATCH 096/109] chore(tests): bump steady to v0.19.7 --- scripts/mock | 6 +++--- scripts/test | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/mock b/scripts/mock index b319bdf..09eb49f 100755 --- a/scripts/mock +++ b/scripts/mock @@ -22,9 +22,9 @@ echo "==> Starting mock server with URL ${URL}" # Run steady mock on the given spec if [ "$1" == "--daemon" ]; then # Pre-install the package so the download doesn't eat into the startup timeout - npm exec --package=@stdy/cli@0.19.6 -- steady --version + npm exec --package=@stdy/cli@0.19.7 -- steady --version - npm exec --package=@stdy/cli@0.19.6 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & + npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" @@ -48,5 +48,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stdy/cli@0.19.6 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" + npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index 8061e04..a7cf561 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! steady_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.6 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.7 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets${NC}" echo exit 1 From d2be5a41f5983f7a06e3b0091df28e89494bab16 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 27 Mar 2026 06:11:39 +0000 Subject: [PATCH 097/109] chore(internal): update multipart form array serialization --- scripts/mock | 4 ++-- scripts/test | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/mock b/scripts/mock index 09eb49f..290e21b 100755 --- a/scripts/mock +++ b/scripts/mock @@ -24,7 +24,7 @@ if [ "$1" == "--daemon" ]; then # Pre-install the package so the download doesn't eat into the startup timeout npm exec --package=@stdy/cli@0.19.7 -- steady --version - npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" &> .stdy.log & + npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log & # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" @@ -48,5 +48,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets "$URL" + npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index a7cf561..a1ebb5e 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! steady_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.7 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=brackets --validator-query-object-format=brackets${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.7 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}" echo exit 1 From 30bf325267b8c555aea1777fb25876f01ac1ed29 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 08:13:35 +0000 Subject: [PATCH 098/109] chore(tests): bump steady to v0.20.1 --- scripts/mock | 6 +++--- scripts/test | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/mock b/scripts/mock index 290e21b..15c2994 100755 --- a/scripts/mock +++ b/scripts/mock @@ -22,9 +22,9 @@ echo "==> Starting mock server with URL ${URL}" # Run steady mock on the given spec if [ "$1" == "--daemon" ]; then # Pre-install the package so the download doesn't eat into the startup timeout - npm exec --package=@stdy/cli@0.19.7 -- steady --version + npm exec --package=@stdy/cli@0.20.1 -- steady --version - npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log & + npm exec --package=@stdy/cli@0.20.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log & # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" @@ -48,5 +48,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stdy/cli@0.19.7 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" + npm exec --package=@stdy/cli@0.20.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index a1ebb5e..7431f9f 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! steady_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.7 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.20.1 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}" echo exit 1 From 7f5ab979d3b67b1e34df3be7d04f8f8e906df29d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 1 Apr 2026 08:17:18 +0000 Subject: [PATCH 099/109] chore(tests): bump steady to v0.20.2 --- scripts/mock | 6 +++--- scripts/test | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/mock b/scripts/mock index 15c2994..5cd7c15 100755 --- a/scripts/mock +++ b/scripts/mock @@ -22,9 +22,9 @@ echo "==> Starting mock server with URL ${URL}" # Run steady mock on the given spec if [ "$1" == "--daemon" ]; then # Pre-install the package so the download doesn't eat into the startup timeout - npm exec --package=@stdy/cli@0.20.1 -- steady --version + npm exec --package=@stdy/cli@0.20.2 -- steady --version - npm exec --package=@stdy/cli@0.20.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log & + npm exec --package=@stdy/cli@0.20.2 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log & # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" @@ -48,5 +48,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stdy/cli@0.20.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" + npm exec --package=@stdy/cli@0.20.2 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index 7431f9f..a9d718c 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! steady_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.20.1 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.20.2 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}" echo exit 1 From 007bf403afeef5fdee5ee5c05bf82bace33301a5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 9 Apr 2026 10:03:43 +0000 Subject: [PATCH 100/109] chore(internal): codegen related update --- src/core.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core.ts b/src/core.ts index 174fc88..022fc24 100644 --- a/src/core.ts +++ b/src/core.ts @@ -1053,10 +1053,10 @@ export const ensurePresent = (value: T | null | undefined): T => { */ export const readEnv = (env: string): string | undefined => { if (typeof process !== 'undefined') { - return process.env?.[env]?.trim() ?? undefined; + return process.env?.[env]?.trim() || undefined; } if (typeof Deno !== 'undefined') { - return Deno.env?.get?.(env)?.trim(); + return Deno.env?.get?.(env)?.trim() || undefined; } return undefined; }; From c2857cd7168a6ab787ecf0c83883e9cda18d2075 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 11 Apr 2026 08:26:56 +0000 Subject: [PATCH 101/109] docs: update examples --- README.md | 18 ++++++++++-------- src/resources/capabilities/capabilities.ts | 4 ++-- src/resources/models/embeddings.ts | 5 ++++- .../capabilities/capabilities.test.ts | 10 +++++----- tests/api-resources/models/embeddings.test.ts | 8 ++++++-- 5 files changed, 27 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index be3e361..73c3a04 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ const client = new Maisa({ apiKey: process.env['MAISA_API_KEY'], // This is the default and can be omitted }); -const textSummary = await client.capabilities.summarize({ text: 'Example long text...' }); +const textSummary = await client.capabilities.summarize({ text: 'Lorem Ipsum dolor sit amet' }); console.log(textSummary.summary); ``` @@ -43,7 +43,7 @@ const client = new Maisa({ apiKey: process.env['MAISA_API_KEY'], // This is the default and can be omitted }); -const params: Maisa.CapabilitySummarizeParams = { text: 'Example long text...' }; +const params: Maisa.CapabilitySummarizeParams = { text: 'Lorem Ipsum dolor sit amet' }; const textSummary: Maisa.TextSummary = await client.capabilities.summarize(params); ``` @@ -103,7 +103,7 @@ a subclass of `APIError` will be thrown: ```ts const textSummary = await client.capabilities - .summarize({ text: 'Example long text...' }) + .summarize({ text: 'Lorem Ipsum dolor sit amet' }) .catch(async (err) => { if (err instanceof Maisa.APIError) { console.log(err.status); // 400 @@ -144,7 +144,7 @@ const client = new Maisa({ }); // Or, configure per-request: -await client.capabilities.summarize({ text: 'Example long text...' }, { +await client.capabilities.summarize({ text: 'Lorem Ipsum dolor sit amet' }, { maxRetries: 5, }); ``` @@ -161,7 +161,7 @@ const client = new Maisa({ }); // Override per-request: -await client.capabilities.summarize({ text: 'Example long text...' }, { +await client.capabilities.summarize({ text: 'Lorem Ipsum dolor sit amet' }, { timeout: 5 * 1000, }); ``` @@ -182,12 +182,14 @@ You can also use the `.withResponse()` method to get the raw `Response` along wi ```ts const client = new Maisa(); -const response = await client.capabilities.summarize({ text: 'Example long text...' }).asResponse(); +const response = await client.capabilities + .summarize({ text: 'Lorem Ipsum dolor sit amet' }) + .asResponse(); console.log(response.headers.get('X-My-Header')); console.log(response.statusText); // access the underlying Response object const { data: textSummary, response: raw } = await client.capabilities - .summarize({ text: 'Example long text...' }) + .summarize({ text: 'Lorem Ipsum dolor sit amet' }) .withResponse(); console.log(raw.headers.get('X-My-Header')); console.log(textSummary.summary); @@ -295,7 +297,7 @@ const client = new Maisa({ // Override per-request: await client.capabilities.summarize( - { text: 'Example long text...' }, + { text: 'Lorem Ipsum dolor sit amet' }, { httpAgent: new http.Agent({ keepAlive: false }), }, diff --git a/src/resources/capabilities/capabilities.ts b/src/resources/capabilities/capabilities.ts index f607012..e41828c 100644 --- a/src/resources/capabilities/capabilities.ts +++ b/src/resources/capabilities/capabilities.ts @@ -40,7 +40,7 @@ export class Capabilities extends APIResource { * @example * ```ts * const textExtractor = await client.capabilities.extract({ - * text: 'Example long text...', + * text: 'My name is John Doe', * variables: { * name: { * description: 'The name of the person.', @@ -63,7 +63,7 @@ export class Capabilities extends APIResource { * @example * ```ts * const textSummary = await client.capabilities.summarize({ - * text: 'Example long text...', + * text: 'Lorem Ipsum dolor sit amet', * }); * ``` */ diff --git a/src/resources/models/embeddings.ts b/src/resources/models/embeddings.ts index 7969bb9..5d91496 100644 --- a/src/resources/models/embeddings.ts +++ b/src/resources/models/embeddings.ts @@ -10,7 +10,10 @@ export class Embeddings extends APIResource { * @example * ```ts * const embeddings = await client.models.embeddings.create({ - * texts: ['string'], + * texts: [ + * 'Who invented the light bulb?', + * 'Hey, how are you?', + * ], * }); * ``` */ diff --git a/tests/api-resources/capabilities/capabilities.test.ts b/tests/api-resources/capabilities/capabilities.test.ts index ec4bf8e..ff0a76f 100644 --- a/tests/api-resources/capabilities/capabilities.test.ts +++ b/tests/api-resources/capabilities/capabilities.test.ts @@ -36,7 +36,7 @@ describe('resource capabilities', () => { test('extract: only required params', async () => { const responsePromise = client.capabilities.extract({ - text: 'Example long text...', + text: 'My name is John Doe', variables: { name: { description: 'The name of the person.', type: 'string' } }, }); const rawResponse = await responsePromise.asResponse(); @@ -50,14 +50,14 @@ describe('resource capabilities', () => { test('extract: required and optional params', async () => { const response = await client.capabilities.extract({ - text: 'Example long text...', + text: 'My name is John Doe', variables: { name: { description: 'The name of the person.', type: 'string' } }, lang: 'en', }); }); test('summarize: only required params', async () => { - const responsePromise = client.capabilities.summarize({ text: 'Example long text...' }); + const responsePromise = client.capabilities.summarize({ text: 'Lorem Ipsum dolor sit amet' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -69,10 +69,10 @@ describe('resource capabilities', () => { test('summarize: required and optional params', async () => { const response = await client.capabilities.summarize({ - text: 'Example long text...', + text: 'Lorem Ipsum dolor sit amet', format: 'paragraph', lang: 'en', - length: 'medium', + length: 'long', summary_hint: 'Example summary of the text...', }); }); diff --git a/tests/api-resources/models/embeddings.test.ts b/tests/api-resources/models/embeddings.test.ts index f91cd5c..57dcf7a 100644 --- a/tests/api-resources/models/embeddings.test.ts +++ b/tests/api-resources/models/embeddings.test.ts @@ -10,7 +10,9 @@ const client = new Maisa({ describe('resource embeddings', () => { test('create: only required params', async () => { - const responsePromise = client.models.embeddings.create({ texts: ['string'] }); + const responsePromise = client.models.embeddings.create({ + texts: ['Who invented the light bulb?', 'Hey, how are you?'], + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -21,6 +23,8 @@ describe('resource embeddings', () => { }); test('create: required and optional params', async () => { - const response = await client.models.embeddings.create({ texts: ['string'] }); + const response = await client.models.embeddings.create({ + texts: ['Who invented the light bulb?', 'Hey, how are you?'], + }); }); }); From eceb8f02dc30bdc1594ddcb37a386015828f36ce Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 07:42:05 +0000 Subject: [PATCH 102/109] chore(tests): bump steady to v0.22.1 --- scripts/mock | 6 +++--- scripts/test | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/mock b/scripts/mock index 5cd7c15..feebe5e 100755 --- a/scripts/mock +++ b/scripts/mock @@ -22,9 +22,9 @@ echo "==> Starting mock server with URL ${URL}" # Run steady mock on the given spec if [ "$1" == "--daemon" ]; then # Pre-install the package so the download doesn't eat into the startup timeout - npm exec --package=@stdy/cli@0.20.2 -- steady --version + npm exec --package=@stdy/cli@0.22.1 -- steady --version - npm exec --package=@stdy/cli@0.20.2 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log & + npm exec --package=@stdy/cli@0.22.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" &> .stdy.log & # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" @@ -48,5 +48,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stdy/cli@0.20.2 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" + npm exec --package=@stdy/cli@0.22.1 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets "$URL" fi diff --git a/scripts/test b/scripts/test index a9d718c..19b8d0c 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! steady_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.20.2 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.22.1 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=brackets --validator-form-object-format=brackets${NC}" echo exit 1 From e6a079e6bbe8303c59c56ae38d9906c222bb75da Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 23 Apr 2026 03:56:41 +0000 Subject: [PATCH 103/109] chore(internal): more robust bootstrap script --- scripts/bootstrap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/bootstrap b/scripts/bootstrap index f68beda..28b5985 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -4,7 +4,7 @@ set -e cd "$(dirname "$0")/.." -if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then +if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "${SKIP_BREW:-}" != "1" ] && [ -t 0 ]; then brew bundle check >/dev/null 2>&1 || { echo -n "==> Install Homebrew dependencies? (y/N): " read -r response From 73cd33fef5fd01323711be99cc3534df5f8479f9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 28 Apr 2026 04:02:04 +0000 Subject: [PATCH 104/109] feat: support setting headers via env --- src/index.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/index.ts b/src/index.ts index cc097f4..dcf2fd4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -127,6 +127,18 @@ export class Maisa extends Core.APIClient { fetch: options.fetch, }); + const customHeadersEnv = Core.readEnv('MAISA_CUSTOM_HEADERS'); + if (customHeadersEnv) { + const parsed: Record = {}; + for (const line of customHeadersEnv.split('\n')) { + const colon = line.indexOf(':'); + if (colon >= 0) { + parsed[line.substring(0, colon).trim()] = line.substring(colon + 1).trim(); + } + } + options.defaultHeaders = { ...parsed, ...options.defaultHeaders }; + } + this._options = options; this.apiKey = apiKey; From a687197446f9d9d1d7d2bb462d8cb370db2972ef Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Apr 2026 06:09:18 +0000 Subject: [PATCH 105/109] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 817e922..2fed3f1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 13 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/maisa%2Fmaisa-c82e0a80b379d33d11af783865ec15844bcd750043bf0f1543ebdf72bda79f3a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/maisa/maisa-c82e0a80b379d33d11af783865ec15844bcd750043bf0f1543ebdf72bda79f3a.yml openapi_spec_hash: 67e2baafe7455c2a734ac0b0ea699719 config_hash: d6a8d922bf8b98716e3f55b9c829cd45 From 3ab81f9c18f2cd5ee2719bdd21249f23d6787e51 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 1 May 2026 02:03:52 +0000 Subject: [PATCH 106/109] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 2fed3f1..cfa854a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 13 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/maisa/maisa-c82e0a80b379d33d11af783865ec15844bcd750043bf0f1543ebdf72bda79f3a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/maisa/maisa-d1dd8e6736faa244dcf5cd516d0e2463cb22f1aba163ab329430582d7bd0d8c7.yml openapi_spec_hash: 67e2baafe7455c2a734ac0b0ea699719 config_hash: d6a8d922bf8b98716e3f55b9c829cd45 From 7dd6889bcfca4071a1ade1d6c05291f482b5ca3c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 13 May 2026 02:00:53 +0000 Subject: [PATCH 107/109] ci: pin GitHub Actions to commit SHAs Pin all GitHub Actions referenced in generated workflows (both first-party `actions/*` and third-party) to immutable commit SHAs. Updating pinned actions is now a deliberate codegen-side bump rather than implicit on every workflow run. --- .github/workflows/ci.yml | 14 +++++++------- .github/workflows/publish-npm.yml | 4 ++-- .github/workflows/release-doctor.yml | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4c567ff..d5f2faf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,10 +21,10 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/maisa-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Node - uses: actions/setup-node@v4 + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: '18' @@ -43,10 +43,10 @@ jobs: contents: read id-token: write steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Node - uses: actions/setup-node@v4 + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: '18' @@ -61,7 +61,7 @@ jobs: github.repository == 'stainless-sdks/maisa-node' && !startsWith(github.ref, 'refs/heads/stl/') id: github-oidc - uses: actions/github-script@v8 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0 with: script: core.setOutput('github_token', await core.getIDToken()); @@ -80,10 +80,10 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/maisa-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Node - uses: actions/setup-node@v4 + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: '20' diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 76f4770..ff6dfb1 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -14,10 +14,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up Node - uses: actions/setup-node@v3 + uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3.9.1 with: node-version: '20' diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 1e23984..3f8d4ad 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -12,7 +12,7 @@ jobs: if: github.repository == 'maisaai/node-sdk' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Check release environment run: | From a0c5ab4c7bad46eb93bc0c3c3b6ac82d2d54e25e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 18 Jul 2026 02:00:27 +0000 Subject: [PATCH 108/109] feat(stlc): configurable CI runner and private-production-repo support in workflow templates --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d5f2faf..1e95b75 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: lint: timeout-minutes: 10 name: lint - runs-on: ${{ github.repository == 'stainless-sdks/maisa-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 @@ -37,7 +37,7 @@ jobs: build: timeout-minutes: 5 name: build - runs-on: ${{ github.repository == 'stainless-sdks/maisa-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') permissions: contents: read @@ -77,7 +77,7 @@ jobs: test: timeout-minutes: 10 name: test - runs-on: ${{ github.repository == 'stainless-sdks/maisa-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + runs-on: ${{ startsWith(github.repository, 'stainless-sdks/') && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 From aa3015af458835e7216c37bf62ee98f375e73daf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 18 Jul 2026 02:01:24 +0000 Subject: [PATCH 109/109] release: 0.1.0-alpha.3 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 129 ++++++++++++++++++++++++++++++++++ package.json | 2 +- src/version.ts | 2 +- 4 files changed, 132 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c5e8a3e..17473a2 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.2" + ".": "0.1.0-alpha.3" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 16c8347..3f32b70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,134 @@ # Changelog +## 0.1.0-alpha.3 (2026-07-18) + +Full Changelog: [v0.1.0-alpha.2...v0.1.0-alpha.3](https://github.com/maisaai/node-sdk/compare/v0.1.0-alpha.2...v0.1.0-alpha.3) + +### Features + +* add SKIP_BREW env var to ./scripts/bootstrap ([#28](https://github.com/maisaai/node-sdk/issues/28)) ([3565f73](https://github.com/maisaai/node-sdk/commit/3565f732457bbe4e5e0267b46de0f48b0f0b25b4)) +* **api:** OpenAPI spec update via Stainless API ([#12](https://github.com/maisaai/node-sdk/issues/12)) ([70eaf21](https://github.com/maisaai/node-sdk/commit/70eaf210a89697c46c5cf5ce1677d61f4815917b)) +* **api:** OpenAPI spec update via Stainless API ([#14](https://github.com/maisaai/node-sdk/issues/14)) ([39d7ac0](https://github.com/maisaai/node-sdk/commit/39d7ac0350a854f3aeb0d8c19df2cffba70ef001)) +* clean up environment call outs ([9650bfb](https://github.com/maisaai/node-sdk/commit/9650bfba397d7496178b3416983a7e50c7605a46)) +* **client:** accept RFC6838 JSON content types ([#29](https://github.com/maisaai/node-sdk/issues/29)) ([e18ddd3](https://github.com/maisaai/node-sdk/commit/e18ddd3331647b0c25aed3f6b24d3428df5a64ee)) +* **client:** add support for endpoint-specific base URLs ([d3cec19](https://github.com/maisaai/node-sdk/commit/d3cec191d768c173919950d80367d2e78888dde7)) +* **stlc:** configurable CI runner and private-production-repo support in workflow templates ([a0c5ab4](https://github.com/maisaai/node-sdk/commit/a0c5ab4c7bad46eb93bc0c3c3b6ac82d2d54e25e)) +* support setting headers via env ([73cd33f](https://github.com/maisaai/node-sdk/commit/73cd33fef5fd01323711be99cc3534df5f8479f9)) + + +### Bug Fixes + +* **api:** improve type resolution when importing as a package ([#38](https://github.com/maisaai/node-sdk/issues/38)) ([837d599](https://github.com/maisaai/node-sdk/commit/837d599f19c3d9b7e57802e72bc258c338d6db9c)) +* avoid type error in certain environments ([#34](https://github.com/maisaai/node-sdk/issues/34)) ([4a5837e](https://github.com/maisaai/node-sdk/commit/4a5837edd9fa1738b823777841874c6106eeba82)) +* **ci:** release-doctor — report correct token name ([2683b03](https://github.com/maisaai/node-sdk/commit/2683b03ddccdf2dede541acdded547ab985d5419)) +* **client:** don't send `Content-Type` for bodyless methods ([1bebaad](https://github.com/maisaai/node-sdk/commit/1bebaad2866e7910bdd0a28362f72caeaa942425)) +* **client:** preserve URL params already embedded in path ([48d3a76](https://github.com/maisaai/node-sdk/commit/48d3a7617a90a7ae1565e029482d0118f515780f)) +* **client:** send `X-Stainless-Timeout` in seconds ([#36](https://github.com/maisaai/node-sdk/issues/36)) ([b0e7faa](https://github.com/maisaai/node-sdk/commit/b0e7faa8126499453343390a7be1bb0c9d63dda5)) +* coerce nullable values to undefined ([8abc12e](https://github.com/maisaai/node-sdk/commit/8abc12ec8cecb9f44e631323bd5a790f0d2e7d85)) +* **docs/contributing:** correct pnpm link command ([87e0ce7](https://github.com/maisaai/node-sdk/commit/87e0ce781aa392df571fa9673b036fff02c17f7d)) +* **exports:** ensure resource imports don't require /index ([#31](https://github.com/maisaai/node-sdk/issues/31)) ([af90af8](https://github.com/maisaai/node-sdk/commit/af90af83d326d512b81019f04f9bba84e939c4e4)) +* **internal:** work around https://github.com/vercel/next.js/issues/76881 ([#35](https://github.com/maisaai/node-sdk/issues/35)) ([633b99a](https://github.com/maisaai/node-sdk/commit/633b99a727dfdf145a1c2f2f6a7244a6576d13d9)) +* **mcp:** correct code tool API endpoint ([2175f4a](https://github.com/maisaai/node-sdk/commit/2175f4adac573b5cd2b2050d472b5174a83307d7)) +* **mcp:** remove unused tools.ts ([#39](https://github.com/maisaai/node-sdk/issues/39)) ([9a32b34](https://github.com/maisaai/node-sdk/commit/9a32b3417bdebbde3a678e5768107c07d023442f)) +* **mcp:** return correct lines on typescript errors ([39e09fb](https://github.com/maisaai/node-sdk/commit/39e09fbcb3ba8ace9a5e959c10c48dfcbe9484f1)) +* publish script — handle NPM errors correctly ([9fcc1d6](https://github.com/maisaai/node-sdk/commit/9fcc1d6feeb78995559669a6812fa0a44a10afe0)) + + +### Performance Improvements + +* faster formatting ([17f089f](https://github.com/maisaai/node-sdk/commit/17f089f418f965225fc2590d9bbf471c31d0663c)) + + +### Chores + +* break long lines in snippets into multiline ([db72364](https://github.com/maisaai/node-sdk/commit/db723646328bd135e924415412ce62cc9271599c)) +* ci build action ([eb696f7](https://github.com/maisaai/node-sdk/commit/eb696f73f16d7b7494811905a18131f7b741d263)) +* **ci:** add timeout thresholds for CI jobs ([959262c](https://github.com/maisaai/node-sdk/commit/959262c3ac17fceccc76a32ef23c977fa8689201)) +* **ci:** bump node version for release workflows ([202d49b](https://github.com/maisaai/node-sdk/commit/202d49b4ae927a582b8b40c5e28c0593f17f5886)) +* **ci:** enable for pull requests ([554bc43](https://github.com/maisaai/node-sdk/commit/554bc435bf0c35ccbdf153d9e3d90c92c8020075)) +* **ci:** only run for pushes and fork pull requests ([411abab](https://github.com/maisaai/node-sdk/commit/411ababaa9cb6fd7c35bdb28891f6c2ccbfb4c6a)) +* **ci:** only use depot for staging repos ([4016e99](https://github.com/maisaai/node-sdk/commit/4016e99d9c7d17947730fbae49b242e039753d5f)) +* **ci:** skip lint on metadata-only changes ([70b2d9e](https://github.com/maisaai/node-sdk/commit/70b2d9e3abf1ea056f4ef8ff688ac86cc9331c8c)) +* **ci:** skip uploading artifacts on stainless-internal branches ([2795477](https://github.com/maisaai/node-sdk/commit/279547720bd1f3359028096cded81cf15f8c0282)) +* **ci:** upgrade `actions/github-script` ([26b60fa](https://github.com/maisaai/node-sdk/commit/26b60fa45899c30f717c5cf979e954422a81b771)) +* **client:** do not parse responses with empty content-length ([2146bde](https://github.com/maisaai/node-sdk/commit/2146bde4a683159ec08b047d2a1227fbf0937242)) +* **client:** minor internal fixes ([0924cf6](https://github.com/maisaai/node-sdk/commit/0924cf64d7d97376b782168885e8076fa410b1cc)) +* **deps:** update dependency node-fetch to v2.6.13 ([fc9ab23](https://github.com/maisaai/node-sdk/commit/fc9ab238c88204698c6e2ecc66d17938e6fd66a4)) +* do not install brew dependencies in ./scripts/bootstrap by default ([16353ab](https://github.com/maisaai/node-sdk/commit/16353ab3eff92358d99e16d11df1097c496e7965)) +* **docs:** grammar improvements ([2966ec5](https://github.com/maisaai/node-sdk/commit/2966ec5dbf5ce47edd2814ca2645608706d56a27)) +* **docs:** use top-level-await in example snippets ([cb12043](https://github.com/maisaai/node-sdk/commit/cb120430cdf94f774ec6d49500ad57d9fde5622a)) +* **exports:** cleaner resource index imports ([#32](https://github.com/maisaai/node-sdk/issues/32)) ([b97f68a](https://github.com/maisaai/node-sdk/commit/b97f68a49579b5ef2ea73c4c7989ad7776b3585f)) +* **exports:** stop using path fallbacks ([#33](https://github.com/maisaai/node-sdk/issues/33)) ([2282a64](https://github.com/maisaai/node-sdk/commit/2282a64da90602664be9ed9e57a7feec170bb88f)) +* fix typo in descriptions ([bab57e2](https://github.com/maisaai/node-sdk/commit/bab57e2971bdc8786ada51ef0c992b05c1a852b0)) +* improve publish-npm script --latest tag logic ([2a38060](https://github.com/maisaai/node-sdk/commit/2a38060be33b58fd6d298881574aed704834c2a8)) +* **internal:** add aliases for Record and Array ([#37](https://github.com/maisaai/node-sdk/issues/37)) ([bff89be](https://github.com/maisaai/node-sdk/commit/bff89bef422def683f609dfe2b002a183d48e872)) +* **internal:** codegen related update ([007bf40](https://github.com/maisaai/node-sdk/commit/007bf403afeef5fdee5ee5c05bf82bace33301a5)) +* **internal:** codegen related update ([ad7909c](https://github.com/maisaai/node-sdk/commit/ad7909c20b87c65781c087ea3e8e1976f0abd87e)) +* **internal:** codegen related update ([ceb4f95](https://github.com/maisaai/node-sdk/commit/ceb4f952168bcdac7e1080ff682f0c2984bd33e4)) +* **internal:** codegen related update ([59ebea3](https://github.com/maisaai/node-sdk/commit/59ebea3adcbae40ec8bb1c92de3b4899a298fbae)) +* **internal:** codegen related update ([a0eff02](https://github.com/maisaai/node-sdk/commit/a0eff02ff7bb1962dcb3ca2403b0bb0bf3f6b21d)) +* **internal:** codegen related update ([51d8020](https://github.com/maisaai/node-sdk/commit/51d80209aa956a6ea5fdc5b4cc485db8267be626)) +* **internal:** codegen related update ([618a3aa](https://github.com/maisaai/node-sdk/commit/618a3aa37451f0a7724ca0d5f1655174eb737c32)) +* **internal:** codegen related update ([#24](https://github.com/maisaai/node-sdk/issues/24)) ([987a383](https://github.com/maisaai/node-sdk/commit/987a383228232a8d312ec782149d80593ff9ff08)) +* **internal:** codegen related update ([#27](https://github.com/maisaai/node-sdk/issues/27)) ([694c674](https://github.com/maisaai/node-sdk/commit/694c6745b6a2c622e597ce249746f26f62352f38)) +* **internal:** fix incremental formatting in some cases ([d3f62b4](https://github.com/maisaai/node-sdk/commit/d3f62b4156c77ee1040f582bb0342af287fc11d9)) +* **internal:** formatting change ([846300a](https://github.com/maisaai/node-sdk/commit/846300a68c239046ea51be523514afcf453a07d4)) +* **internal:** ignore .eslintcache ([638db23](https://github.com/maisaai/node-sdk/commit/638db23350725cad7aca39687d46d02e36c027d7)) +* **internal:** make base APIResource abstract ([eef6cdc](https://github.com/maisaai/node-sdk/commit/eef6cdcf1d8c744254b9cfb402b08b0f311cdce6)) +* **internal:** more robust bootstrap script ([e6a079e](https://github.com/maisaai/node-sdk/commit/e6a079e6bbe8303c59c56ae38d9906c222bb75da)) +* **internal:** move publish config ([151270b](https://github.com/maisaai/node-sdk/commit/151270b19b0ae322989ad049a1d0907beb000ab6)) +* **internal:** move stringifyQuery implementation to internal function ([9b1e546](https://github.com/maisaai/node-sdk/commit/9b1e546ec712a2f2fdf239cd357694b674f6391b)) +* **internal:** reduce CI branch coverage ([94b6670](https://github.com/maisaai/node-sdk/commit/94b6670329550c6a11860790403bd1b2cdcbd602)) +* **internal:** remove .eslintcache ([34ca6c3](https://github.com/maisaai/node-sdk/commit/34ca6c3b4bbf8e0e59f54c2e9d64bfcfa3f6e98a)) +* **internal:** remove deprecated `compilerOptions.baseUrl` from tsconfig.json ([accffdb](https://github.com/maisaai/node-sdk/commit/accffdbb5b22c3ae02df8f4f50589dde5b6223ca)) +* **internal:** remove extra empty newlines ([#30](https://github.com/maisaai/node-sdk/issues/30)) ([de5ba3f](https://github.com/maisaai/node-sdk/commit/de5ba3faf8605c664970d642cfa3d0d0b2aa3f57)) +* **internal:** remove redundant imports config ([11a7948](https://github.com/maisaai/node-sdk/commit/11a794845c180a0760d5d67d7cdcb24c50571cfb)) +* **internal:** tweak CI branches ([454a3b2](https://github.com/maisaai/node-sdk/commit/454a3b267522c0a8b0509ee9346a992668ed2b29)) +* **internal:** update `actions/checkout` version ([1b1a007](https://github.com/maisaai/node-sdk/commit/1b1a007aff2bcd038f500b22330ecf22fdfcf8d7)) +* **internal:** update comment in script ([ca84bfc](https://github.com/maisaai/node-sdk/commit/ca84bfcaed7cdd34b121078037ce616be6b5b1c6)) +* **internal:** update gitignore ([ad82170](https://github.com/maisaai/node-sdk/commit/ad821701c21bca695d20b641f0a35a5c72626907)) +* **internal:** update multipart form array serialization ([d2be5a4](https://github.com/maisaai/node-sdk/commit/d2be5a41f5983f7a06e3b0091df28e89494bab16)) +* **internal:** upgrade babel, qs, js-yaml ([725bccb](https://github.com/maisaai/node-sdk/commit/725bccbe7669485dd8a30db75ac48c4304d39472)) +* **internal:** upload builds and expand CI branch coverage ([730ed99](https://github.com/maisaai/node-sdk/commit/730ed99464ca7b778e0fa030eb6b7b6b9f26d61e)) +* **internal:** use npm pack for build uploads ([c3fd8cd](https://github.com/maisaai/node-sdk/commit/c3fd8cd1f78b13db1ddc1f956a463649742d901f)) +* make some internal functions async ([8ea868a](https://github.com/maisaai/node-sdk/commit/8ea868af815cf48c7df8a2c8930b484903e9db1c)) +* mention unit type in timeout docs ([d5641f8](https://github.com/maisaai/node-sdk/commit/d5641f81cf1e6ee1399a6055133f888da1db620c)) +* rebuild project due to codegen change ([#16](https://github.com/maisaai/node-sdk/issues/16)) ([df79224](https://github.com/maisaai/node-sdk/commit/df79224bb82acaee52c77de6bbc473be110e97d2)) +* rebuild project due to codegen change ([#18](https://github.com/maisaai/node-sdk/issues/18)) ([036b17d](https://github.com/maisaai/node-sdk/commit/036b17d968f6a3171cd2994a004d8d8bfad79af5)) +* rebuild project due to codegen change ([#19](https://github.com/maisaai/node-sdk/issues/19)) ([c8a77bf](https://github.com/maisaai/node-sdk/commit/c8a77bff486ef066c96de6d35246efa96212dbbf)) +* rebuild project due to codegen change ([#20](https://github.com/maisaai/node-sdk/issues/20)) ([424c10e](https://github.com/maisaai/node-sdk/commit/424c10e00a0cd21b51295535d875a57b6330c877)) +* rebuild project due to codegen change ([#21](https://github.com/maisaai/node-sdk/issues/21)) ([31e045e](https://github.com/maisaai/node-sdk/commit/31e045e7b6edf51a329a2687ced65d2e278a6cb0)) +* rebuild project due to oas spec rename ([#15](https://github.com/maisaai/node-sdk/issues/15)) ([9d62f64](https://github.com/maisaai/node-sdk/commit/9d62f6432e15ec16cdcb8b4f8e62ba54a6df3ba0)) +* remove redundant word in comment ([#23](https://github.com/maisaai/node-sdk/issues/23)) ([487943a](https://github.com/maisaai/node-sdk/commit/487943aa4079151535a7fd19ea4246cb1607df2b)) +* **test:** do not count install time for mock server timeout ([c86bbfc](https://github.com/maisaai/node-sdk/commit/c86bbfc5343ec69a6ae193d484f8e8039cb3c69e)) +* **tests:** bump steady to v0.19.4 ([b5d7d9f](https://github.com/maisaai/node-sdk/commit/b5d7d9f6eb306f51af0ae4c4ace9feaebdb9ea49)) +* **tests:** bump steady to v0.19.5 ([f72c552](https://github.com/maisaai/node-sdk/commit/f72c5526b6ed5cea736e3f33677deb2fcaed8b24)) +* **tests:** bump steady to v0.19.6 ([ca75a49](https://github.com/maisaai/node-sdk/commit/ca75a498a0791a74d12bc54085bad27ecaccb238)) +* **tests:** bump steady to v0.19.7 ([ad262cf](https://github.com/maisaai/node-sdk/commit/ad262cf972b2171d2546ff2dbac4f92aaff85595)) +* **tests:** bump steady to v0.20.1 ([30bf325](https://github.com/maisaai/node-sdk/commit/30bf325267b8c555aea1777fb25876f01ac1ed29)) +* **tests:** bump steady to v0.20.2 ([7f5ab97](https://github.com/maisaai/node-sdk/commit/7f5ab979d3b67b1e34df3be7d04f8f8e906df29d)) +* **tests:** bump steady to v0.22.1 ([eceb8f0](https://github.com/maisaai/node-sdk/commit/eceb8f02dc30bdc1594ddcb37a386015828f36ce)) +* **tests:** improve enum examples ([#40](https://github.com/maisaai/node-sdk/issues/40)) ([50475c4](https://github.com/maisaai/node-sdk/commit/50475c4c257096ca8c8b06d6cdb970f383c1b3bf)) +* **types:** nicer error class types + jsdocs ([#26](https://github.com/maisaai/node-sdk/issues/26)) ([eeae75a](https://github.com/maisaai/node-sdk/commit/eeae75a631ce110cada808b8ad0609b0553a7738)) +* update @stainless-api/prism-cli to v5.15.0 ([15c1948](https://github.com/maisaai/node-sdk/commit/15c19485981e9a85f9d9a8e22fce255abcc60708)) +* update CI script ([695a63b](https://github.com/maisaai/node-sdk/commit/695a63b5c02e36b9b2469986dd4d27b923b83821)) +* update mock server docs ([ec98593](https://github.com/maisaai/node-sdk/commit/ec985936ba0034dd1a2f5afd03feea8c064e8f20)) +* update placeholder string ([194604e](https://github.com/maisaai/node-sdk/commit/194604e309f974a187879e781151eca87c3854f8)) + + +### Documentation + +* add examples to tsdocs ([c89ae8d](https://github.com/maisaai/node-sdk/commit/c89ae8d485ad35edf887a691dba66f1730f7f714)) +* **readme:** fix typo ([9d4ca9a](https://github.com/maisaai/node-sdk/commit/9d4ca9a8d674e96e4897fb4a54c66664e5493bb6)) +* remove suggestion to use `npm` call out ([#22](https://github.com/maisaai/node-sdk/issues/22)) ([0331bba](https://github.com/maisaai/node-sdk/commit/0331bbaf7ace3113e9bf4d2ba1220813a40e6a28)) +* update examples ([c2857cd](https://github.com/maisaai/node-sdk/commit/c2857cd7168a6ab787ecf0c83883e9cda18d2075)) + + +### Refactors + +* **tests:** switch from prism to steady ([31ba293](https://github.com/maisaai/node-sdk/commit/31ba2930540fe4c6b256cf0021f3c6ea81722bd7)) +* **types:** replace Record with mapped types ([affc927](https://github.com/maisaai/node-sdk/commit/affc92743d1fac0b927a20f155ef51d6df4c88a8)) + ## 0.1.0-alpha.2 (2024-03-05) Full Changelog: [v0.1.0-alpha.1...v0.1.0-alpha.2](https://github.com/maisaai/node-sdk/compare/v0.1.0-alpha.1...v0.1.0-alpha.2) diff --git a/package.json b/package.json index 8baa25a..ca8e518 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "maisa", - "version": "0.1.0-alpha.2", + "version": "0.1.0-alpha.3", "description": "The official TypeScript library for the Maisa API", "author": "Maisa ", "types": "dist/index.d.ts", diff --git a/src/version.ts b/src/version.ts index a528f63..a64b06c 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.1.0-alpha.2'; // x-release-please-version +export const VERSION = '0.1.0-alpha.3'; // x-release-please-version