From d9b017f07d7c98a4c919e4dd41dea5ee3bb92f53 Mon Sep 17 00:00:00 2001 From: polytomic-sdk-bot Date: Wed, 10 Jul 2024 04:22:12 +0000 Subject: [PATCH] Release 1.8.2 --- .github/workflows/ci.yml | 18 +- .gitignore | 11 +- .npmignore | 1 + jest.config.js | 4 +- package.json | 19 +- src/Client.ts | 6 + src/api/errors/BadRequestError.ts | 4 +- src/api/errors/ForbiddenError.ts | 4 +- src/api/errors/InternalServerError.ts | 4 +- src/api/errors/NotFoundError.ts | 4 +- src/api/errors/UnauthorizedError.ts | 4 +- src/api/errors/UnprocessableEntityError.ts | 4 +- src/api/resources/bulkSync/client/Client.ts | 120 ++++-- .../client/requests/CreateBulkSyncRequest.ts | 2 +- .../client/requests/UpdateBulkSyncRequest.ts | 2 +- .../bulkSync/client/requests/index.ts | 12 +- .../resources/executions/client/Client.ts | 43 +- .../executions/client/requests/index.ts | 2 +- .../resources/schemas/client/Client.ts | 61 ++- .../client/requests/BulkSyncSchemasRequest.ts | 2 +- .../client/requests/SchemasListRequest.ts | 2 +- .../client/requests/UpdateBulkSchema.ts | 2 +- .../schemas/client/requests/index.ts | 6 +- .../V2CreateBulkSyncRequestSchemasItem.ts | 2 +- .../V2UpdateBulkSyncRequestSchemasItem.ts | 2 +- .../resources/connections/client/Client.ts | 86 ++-- .../connections/client/requests/index.ts | 8 +- src/api/resources/events/client/Client.ts | 29 +- .../resources/events/client/requests/index.ts | 2 +- src/api/resources/identity/client/Client.ts | 19 +- src/api/resources/jobs/client/Client.ts | 23 +- src/api/resources/modelSync/client/Client.ts | 149 +++++-- .../client/requests/CreateModelSyncRequest.ts | 2 +- .../requests/ModelSyncGetSourceRequest.ts | 2 +- .../client/requests/UpdateModelSyncRequest.ts | 2 +- .../modelSync/client/requests/index.ts | 12 +- .../resources/executions/client/Client.ts | 62 ++- src/api/resources/models/client/Client.ts | 104 +++-- .../GetEnrichmentInputFieldsRequest.ts | 2 +- .../client/requests/ModelsCreateRequest.ts | 2 +- .../client/requests/ModelsPreviewRequest.ts | 2 +- .../client/requests/UpdateModelRequest.ts | 2 +- .../resources/models/client/requests/index.ts | 14 +- .../resources/organization/client/Client.ts | 63 ++- .../organization/client/requests/index.ts | 4 +- .../resources/permissions/client/Client.ts | 6 + .../resources/policies/client/Client.ts | 58 ++- .../client/requests/CreatePolicyRequest.ts | 2 +- .../client/requests/UpdatePolicyRequest.ts | 2 +- .../policies/client/requests/index.ts | 4 +- .../resources/roles/client/Client.ts | 58 ++- .../resources/roles/client/requests/index.ts | 4 +- .../resources/queryRunner/client/Client.ts | 38 +- .../queryRunner/client/requests/index.ts | 4 +- src/api/resources/schemas/client/Client.ts | 54 ++- src/api/resources/users/client/Client.ts | 87 +++- .../resources/users/client/requests/index.ts | 6 +- src/api/resources/webhooks/client/Client.ts | 62 ++- .../webhooks/client/requests/index.ts | 4 +- src/api/types/ActivateSyncEnvelope.ts | 2 +- src/api/types/ApiKeyResponseEnvelope.ts | 2 +- src/api/types/BulkFilter.ts | 2 +- src/api/types/BulkItemizedSchedule.ts | 2 +- .../types/BulkMultiScheduleConfiguration.ts | 2 +- src/api/types/BulkSchedule.ts | 2 +- src/api/types/BulkSchema.ts | 2 +- src/api/types/BulkSchemaEnvelope.ts | 2 +- src/api/types/BulkSyncDest.ts | 2 +- src/api/types/BulkSyncDestEnvelope.ts | 2 +- src/api/types/BulkSyncExecution.ts | 2 +- src/api/types/BulkSyncExecutionEnvelope.ts | 2 +- src/api/types/BulkSyncExecutionStatus.ts | 2 +- src/api/types/BulkSyncListEnvelope.ts | 2 +- src/api/types/BulkSyncResponse.ts | 2 +- src/api/types/BulkSyncResponseEnvelope.ts | 2 +- src/api/types/BulkSyncSchemaExecution.ts | 2 +- .../types/BulkSyncSchemaExecutionStatus.ts | 2 +- src/api/types/BulkSyncSource.ts | 2 +- src/api/types/BulkSyncSourceEnvelope.ts | 2 +- src/api/types/BulkSyncSourceSchemaEnvelope.ts | 2 +- src/api/types/BulkSyncSourceStatusEnvelope.ts | 2 +- src/api/types/BulkSyncStatusEnvelope.ts | 2 +- src/api/types/BulkSyncStatusResponse.ts | 2 +- src/api/types/ConnectCardResponseEnvelope.ts | 2 +- .../types/ConnectionListResponseEnvelope.ts | 2 +- src/api/types/ConnectionMetaResponse.ts | 2 +- .../types/ConnectionParameterValuesResp.ts | 2 +- ...nnectionParameterValuesResponseEnvelope.ts | 2 +- src/api/types/ConnectionResponseEnvelope.ts | 2 +- src/api/types/ConnectionResponseSchema.ts | 2 +- .../types/ConnectionTypeResponseEnvelope.ts | 2 +- .../types/CreateConnectionResponseEnvelope.ts | 2 +- .../types/CreateConnectionResponseSchema.ts | 2 +- src/api/types/CreateModelRequest.ts | 2 +- src/api/types/Enrichment.ts | 2 +- src/api/types/Event.ts | 2 +- src/api/types/EventBody.ts | 2 +- src/api/types/EventsEnvelope.ts | 2 +- .../types/ExecutionLogsResponseEnvelope.ts | 2 +- src/api/types/Filter.ts | 2 +- src/api/types/GetConnectionMetaEnvelope.ts | 2 +- src/api/types/GetExecutionResponseEnvelope.ts | 2 +- src/api/types/GetExecutionResponseSchema.ts | 2 +- src/api/types/GetIdentityResponseEnvelope.ts | 2 +- .../types/GetModelSyncSourceMetaEnvelope.ts | 2 +- src/api/types/Identity.ts | 2 +- src/api/types/JobResponse.ts | 2 +- src/api/types/JobResponseEnvelope.ts | 2 +- src/api/types/ListBulkSchema.ts | 2 +- .../ListBulkSyncExecutionStatusEnvelope.ts | 2 +- .../types/ListBulkSyncExecutionsEnvelope.ts | 2 +- .../types/ListExecutionResponseEnvelope.ts | 2 +- .../types/ListModelSyncResponseEnvelope.ts | 2 +- src/api/types/ListPoliciesResponseEnvelope.ts | 2 +- src/api/types/ListUsersEnvelope.ts | 2 +- src/api/types/ModelFieldResponse.ts | 2 +- src/api/types/ModelListResponseEnvelope.ts | 2 +- src/api/types/ModelRelation.ts | 2 +- src/api/types/ModelResponse.ts | 2 +- src/api/types/ModelResponseEnvelope.ts | 2 +- src/api/types/ModelSample.ts | 2 +- src/api/types/ModelSampleResponseEnvelope.ts | 2 +- src/api/types/ModelSyncField.ts | 2 +- src/api/types/ModelSyncResponse.ts | 2 +- src/api/types/ModelSyncResponseEnvelope.ts | 2 +- src/api/types/ModelSyncSourceMetaResponse.ts | 2 +- src/api/types/OrganizationEnvelope.ts | 2 +- src/api/types/OrganizationsEnvelope.ts | 2 +- src/api/types/Override.ts | 2 +- src/api/types/PolicyResponse.ts | 2 +- src/api/types/PolicyResponseEnvelope.ts | 2 +- src/api/types/Relation.ts | 2 +- src/api/types/RoleListResponseEnvelope.ts | 2 +- src/api/types/RoleResponseEnvelope.ts | 2 +- src/api/types/Schedule.ts | 2 +- src/api/types/ScheduleOptionResponse.ts | 2 +- .../types/ScheduleOptionResponseEnvelope.ts | 2 +- src/api/types/ScheduleScheduleOption.ts | 2 +- src/api/types/Schema.ts | 2 +- src/api/types/SchemaConfiguration.ts | 2 +- src/api/types/SchemaField.ts | 2 +- .../types/StartModelSyncResponseEnvelope.ts | 2 +- src/api/types/StartModelSyncResponseSchema.ts | 2 +- src/api/types/SyncCanceledEvent.ts | 2 +- src/api/types/SyncCompletedEvent.ts | 2 +- src/api/types/SyncDestinationProperties.ts | 1 + src/api/types/SyncStatusEnvelope.ts | 2 +- src/api/types/SyncStatusResponse.ts | 2 +- src/api/types/TargetField.ts | 2 +- src/api/types/TargetResponse.ts | 2 +- src/api/types/TargetResponseEnvelope.ts | 2 +- src/api/types/UserEnvelope.ts | 2 +- .../types/V2SchemaConfigurationFieldsItem.ts | 2 +- src/api/types/V4QueryResultsEnvelope.ts | 2 +- src/api/types/V4RunQueryEnvelope.ts | 2 +- src/api/types/V4RunQueryResult.ts | 2 +- src/api/types/WebhookEnvelope.ts | 2 +- src/api/types/WebhookListEnvelope.ts | 2 +- src/core/fetcher/Fetcher.ts | 138 ++++++- src/core/runtime/runtime.ts | 14 +- tests/client.test.ts | 11 - tests/custom.test.ts | 13 + tsconfig.json | 6 +- yarn.lock | 388 ++++++++++++++++-- 164 files changed, 1520 insertions(+), 566 deletions(-) delete mode 100644 tests/client.test.ts create mode 100644 tests/custom.test.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 93e8e37..1a55fdb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: - name: Compile run: yarn && yarn build - + test: runs-on: ubuntu-latest @@ -27,29 +27,31 @@ jobs: uses: actions/setup-node@v3 - name: Compile - run: yarn && yarn test - + run: yarn && yarn test + publish: needs: [ compile, test ] if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') runs-on: ubuntu-latest - steps: - name: Checkout repo uses: actions/checkout@v3 - - name: Set up node uses: actions/setup-node@v3 - - name: Install dependencies run: yarn install - - name: Build run: yarn build - name: Publish to npm run: | npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN} - npm publish --access public + if [[ ${GITHUB_REF} == *alpha* ]]; then + npm publish --access public --tag alpha + elif [[ ${GITHUB_REF} == *beta* ]]; then + npm publish --access public --tag beta + else + npm publish --access public + fi env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 66afc72..72271e0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,3 @@ node_modules .DS_Store -/dist -/Client.d.ts -/Client.js -/environments.d.ts -/environments.js -/index.d.ts -/index.js -/api -/core -/errors \ No newline at end of file +/dist \ No newline at end of file diff --git a/.npmignore b/.npmignore index e62938d..6db0876 100644 --- a/.npmignore +++ b/.npmignore @@ -1,5 +1,6 @@ node_modules src +tests .gitignore .github .fernignore diff --git a/jest.config.js b/jest.config.js index 3a09892..35d6e65 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,5 +1,5 @@ -/** @type {import('ts-jest').JestConfigWithTsJest} */ +/** @type {import('jest').Config} */ module.exports = { preset: "ts-jest", testEnvironment: "node", -}; \ No newline at end of file +}; diff --git a/package.json b/package.json index f79d761..00f89d0 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,13 @@ { "name": "polytomic", - "version": "1.8.0", + "version": "1.8.2", "private": false, "repository": "https://github.com/polytomic/polytomic-typescript", "license": "MIT", "main": "./index.js", "types": "./index.d.ts", "scripts": { - "format": "prettier --write 'src/**/*.ts'", + "format": "prettier . --write --ignore-unknown", "build": "tsc", "prepack": "cp -rv dist/. .", "test": "jest" @@ -15,6 +15,7 @@ "dependencies": { "url-join": "4.0.1", "form-data": "4.0.0", + "formdata-node": "^6.0.3", "node-fetch": "2.7.0", "qs": "6.11.2", "js-base64": "3.7.2" @@ -23,11 +24,17 @@ "@types/url-join": "4.0.1", "@types/qs": "6.9.8", "@types/node-fetch": "2.6.9", - "jest": "^29.7.0", - "@types/jest": "^29.5.5", - "ts-jest": "^29.1.1", + "jest": "29.7.0", + "@types/jest": "29.5.5", + "ts-jest": "29.1.1", + "jest-environment-jsdom": "29.7.0", "@types/node": "17.0.33", "prettier": "2.7.1", "typescript": "4.6.4" + }, + "browser": { + "fs": false, + "os": false, + "path": false } -} \ No newline at end of file +} diff --git a/src/Client.ts b/src/Client.ts index 902b91a..2f79f14 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -26,8 +26,14 @@ export declare namespace PolytomicClient { } interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the X-Polytomic-Version header */ + version?: string | undefined; } } diff --git a/src/api/errors/BadRequestError.ts b/src/api/errors/BadRequestError.ts index de1dcd8..9f4d85d 100644 --- a/src/api/errors/BadRequestError.ts +++ b/src/api/errors/BadRequestError.ts @@ -2,8 +2,8 @@ * This file was auto-generated from our API Definition. */ -import * as errors from "../../errors"; -import * as Polytomic from ".."; +import * as errors from "../../errors/index"; +import * as Polytomic from "../index"; export class BadRequestError extends errors.PolytomicError { constructor(body: Polytomic.ApiError) { diff --git a/src/api/errors/ForbiddenError.ts b/src/api/errors/ForbiddenError.ts index fb6f1f2..4103f6b 100644 --- a/src/api/errors/ForbiddenError.ts +++ b/src/api/errors/ForbiddenError.ts @@ -2,8 +2,8 @@ * This file was auto-generated from our API Definition. */ -import * as errors from "../../errors"; -import * as Polytomic from ".."; +import * as errors from "../../errors/index"; +import * as Polytomic from "../index"; export class ForbiddenError extends errors.PolytomicError { constructor(body: Polytomic.ApiError) { diff --git a/src/api/errors/InternalServerError.ts b/src/api/errors/InternalServerError.ts index 2134abd..42d9321 100644 --- a/src/api/errors/InternalServerError.ts +++ b/src/api/errors/InternalServerError.ts @@ -2,8 +2,8 @@ * This file was auto-generated from our API Definition. */ -import * as errors from "../../errors"; -import * as Polytomic from ".."; +import * as errors from "../../errors/index"; +import * as Polytomic from "../index"; export class InternalServerError extends errors.PolytomicError { constructor(body: Polytomic.ApiError) { diff --git a/src/api/errors/NotFoundError.ts b/src/api/errors/NotFoundError.ts index 76911f5..3fbed49 100644 --- a/src/api/errors/NotFoundError.ts +++ b/src/api/errors/NotFoundError.ts @@ -2,8 +2,8 @@ * This file was auto-generated from our API Definition. */ -import * as errors from "../../errors"; -import * as Polytomic from ".."; +import * as errors from "../../errors/index"; +import * as Polytomic from "../index"; export class NotFoundError extends errors.PolytomicError { constructor(body: Polytomic.ApiError) { diff --git a/src/api/errors/UnauthorizedError.ts b/src/api/errors/UnauthorizedError.ts index 19c3d32..b640847 100644 --- a/src/api/errors/UnauthorizedError.ts +++ b/src/api/errors/UnauthorizedError.ts @@ -2,8 +2,8 @@ * This file was auto-generated from our API Definition. */ -import * as errors from "../../errors"; -import * as Polytomic from ".."; +import * as errors from "../../errors/index"; +import * as Polytomic from "../index"; export class UnauthorizedError extends errors.PolytomicError { constructor(body: Polytomic.RestErrResponse) { diff --git a/src/api/errors/UnprocessableEntityError.ts b/src/api/errors/UnprocessableEntityError.ts index 1049f3c..c17f0d1 100644 --- a/src/api/errors/UnprocessableEntityError.ts +++ b/src/api/errors/UnprocessableEntityError.ts @@ -2,8 +2,8 @@ * This file was auto-generated from our API Definition. */ -import * as errors from "../../errors"; -import * as Polytomic from ".."; +import * as errors from "../../errors/index"; +import * as Polytomic from "../index"; export class UnprocessableEntityError extends errors.PolytomicError { constructor(body: Polytomic.ApiError) { diff --git a/src/api/resources/bulkSync/client/Client.ts b/src/api/resources/bulkSync/client/Client.ts index 2341067..d0892c2 100644 --- a/src/api/resources/bulkSync/client/Client.ts +++ b/src/api/resources/bulkSync/client/Client.ts @@ -4,9 +4,9 @@ import * as environments from "../../../../environments"; import * as core from "../../../../core"; -import * as Polytomic from "../../.."; +import * as Polytomic from "../../../index"; import urlJoin from "url-join"; -import * as errors from "../../../../errors"; +import * as errors from "../../../../errors/index"; import { Executions } from "../resources/executions/client/Client"; import { Schemas } from "../resources/schemas/client/Client"; @@ -18,8 +18,14 @@ export declare namespace BulkSync { } interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the X-Polytomic-Version header */ + version?: string | undefined; } } @@ -27,11 +33,13 @@ export class BulkSync { constructor(protected readonly _options: BulkSync.Options) {} /** + * @param {BulkSync.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.bulkSync.list() + * await client.bulkSync.list() */ public async list(requestOptions?: BulkSync.RequestOptions): Promise { const _response = await core.fetcher({ @@ -48,13 +56,14 @@ export class BulkSync { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.BulkSyncListEnvelope; @@ -90,13 +99,16 @@ export class BulkSync { } /** + * @param {Polytomic.CreateBulkSyncRequest} request + * @param {BulkSync.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.BadRequestError} * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.ForbiddenError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.bulkSync.create({ + * await client.bulkSync.create({ * destination_connection_id: "248df4b7-aa70-47b8-a036-33ac447e668d", * mode: "replicate", * name: "My Bulk Sync", @@ -124,7 +136,7 @@ export class BulkSync { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -132,6 +144,7 @@ export class BulkSync { body: request, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.BulkSyncResponseEnvelope; @@ -171,11 +184,15 @@ export class BulkSync { } /** + * @param {string} id + * @param {Polytomic.BulkSyncGetRequest} request + * @param {BulkSync.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * * @example - * await polytomic.bulkSync.get("248df4b7-aa70-47b8-a036-33ac447e668d", { + * await client.bulkSync.get("248df4b7-aa70-47b8-a036-33ac447e668d", { * refresh_schemas: true * }) */ @@ -185,7 +202,7 @@ export class BulkSync { requestOptions?: BulkSync.RequestOptions ): Promise { const { refresh_schemas: refreshSchemas } = request; - const _queryParams: Record = {}; + const _queryParams: Record = {}; if (refreshSchemas != null) { _queryParams["refresh_schemas"] = refreshSchemas.toString(); } @@ -193,7 +210,7 @@ export class BulkSync { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/bulk/syncs/${id}` + `api/bulk/syncs/${encodeURIComponent(id)}` ), method: "GET", headers: { @@ -204,7 +221,7 @@ export class BulkSync { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -212,6 +229,7 @@ export class BulkSync { queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.BulkSyncResponseEnvelope; @@ -250,6 +268,11 @@ export class BulkSync { * > 📘 Updating schemas * > * > Schema updates can be performed using the [Update Bulk Sync Schemas](https://apidocs.polytomic.com/api-reference/bulk-sync/schemas/patch) endpoint. + * + * @param {string} id + * @param {Polytomic.UpdateBulkSyncRequest} request + * @param {BulkSync.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.BadRequestError} * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.ForbiddenError} @@ -257,7 +280,7 @@ export class BulkSync { * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.bulkSync.update("248df4b7-aa70-47b8-a036-33ac447e668d", { + * await client.bulkSync.update("248df4b7-aa70-47b8-a036-33ac447e668d", { * destination_connection_id: "248df4b7-aa70-47b8-a036-33ac447e668d", * mode: "replicate", * name: "My Bulk Sync", @@ -275,7 +298,7 @@ export class BulkSync { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/bulk/syncs/${id}` + `api/bulk/syncs/${encodeURIComponent(id)}` ), method: "PUT", headers: { @@ -286,7 +309,7 @@ export class BulkSync { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -294,6 +317,7 @@ export class BulkSync { body: request, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.BulkSyncResponseEnvelope; @@ -335,13 +359,17 @@ export class BulkSync { } /** + * @param {string} id + * @param {Polytomic.BulkSyncRemoveRequest} request + * @param {BulkSync.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.ForbiddenError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.bulkSync.remove("248df4b7-aa70-47b8-a036-33ac447e668d", { + * await client.bulkSync.remove("248df4b7-aa70-47b8-a036-33ac447e668d", { * refresh_schemas: true * }) */ @@ -351,7 +379,7 @@ export class BulkSync { requestOptions?: BulkSync.RequestOptions ): Promise { const { refresh_schemas: refreshSchemas } = request; - const _queryParams: Record = {}; + const _queryParams: Record = {}; if (refreshSchemas != null) { _queryParams["refresh_schemas"] = refreshSchemas.toString(); } @@ -359,7 +387,7 @@ export class BulkSync { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/bulk/syncs/${id}` + `api/bulk/syncs/${encodeURIComponent(id)}` ), method: "DELETE", headers: { @@ -370,7 +398,7 @@ export class BulkSync { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -378,6 +406,7 @@ export class BulkSync { queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return; @@ -417,13 +446,17 @@ export class BulkSync { } /** + * @param {string} id + * @param {Polytomic.ActivateSyncInput} request + * @param {BulkSync.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.ForbiddenError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.bulkSync.activate("248df4b7-aa70-47b8-a036-33ac447e668d", { + * await client.bulkSync.activate("248df4b7-aa70-47b8-a036-33ac447e668d", { * active: true * }) */ @@ -435,7 +468,7 @@ export class BulkSync { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/bulk/syncs/${id}/activate` + `api/bulk/syncs/${encodeURIComponent(id)}/activate` ), method: "POST", headers: { @@ -446,7 +479,7 @@ export class BulkSync { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -454,6 +487,7 @@ export class BulkSync { body: request, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.ActivateSyncEnvelope; @@ -493,11 +527,15 @@ export class BulkSync { } /** + * @param {string} id + * @param {Polytomic.StartBulkSyncRequest} request + * @param {BulkSync.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.BadRequestError} * @throws {@link Polytomic.UnauthorizedError} * * @example - * await polytomic.bulkSync.start("248df4b7-aa70-47b8-a036-33ac447e668d", {}) + * await client.bulkSync.start("248df4b7-aa70-47b8-a036-33ac447e668d") */ public async start( id: string, @@ -507,7 +545,7 @@ export class BulkSync { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/bulk/syncs/${id}/executions` + `api/bulk/syncs/${encodeURIComponent(id)}/executions` ), method: "POST", headers: { @@ -518,7 +556,7 @@ export class BulkSync { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -526,6 +564,7 @@ export class BulkSync { body: request, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.BulkSyncExecutionEnvelope; @@ -561,12 +600,15 @@ export class BulkSync { } /** + * @param {string} id + * @param {BulkSync.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.bulkSync.getStatus("248df4b7-aa70-47b8-a036-33ac447e668d") + * await client.bulkSync.getStatus("248df4b7-aa70-47b8-a036-33ac447e668d") */ public async getStatus( id: string, @@ -575,7 +617,7 @@ export class BulkSync { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/bulk/syncs/${id}/status` + `api/bulk/syncs/${encodeURIComponent(id)}/status` ), method: "GET", headers: { @@ -586,13 +628,14 @@ export class BulkSync { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.BulkSyncStatusEnvelope; @@ -630,13 +673,17 @@ export class BulkSync { } /** + * @param {string} id + * @param {Polytomic.BulkSyncGetSourceRequest} request + * @param {BulkSync.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.BadRequestError} * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.bulkSync.getSource("248df4b7-aa70-47b8-a036-33ac447e668d", { + * await client.bulkSync.getSource("248df4b7-aa70-47b8-a036-33ac447e668d", { * include_fields: true * }) */ @@ -646,7 +693,7 @@ export class BulkSync { requestOptions?: BulkSync.RequestOptions ): Promise { const { include_fields: includeFields } = request; - const _queryParams: Record = {}; + const _queryParams: Record = {}; if (includeFields != null) { _queryParams["include_fields"] = includeFields.toString(); } @@ -654,7 +701,7 @@ export class BulkSync { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/connections/${id}/bulksync/source` + `api/connections/${encodeURIComponent(id)}/bulksync/source` ), method: "GET", headers: { @@ -665,7 +712,7 @@ export class BulkSync { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -673,6 +720,7 @@ export class BulkSync { queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.BulkSyncSourceEnvelope; @@ -712,13 +760,16 @@ export class BulkSync { } /** + * @param {string} id + * @param {BulkSync.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.BadRequestError} * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.ForbiddenError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.bulkSync.getDestination("248df4b7-aa70-47b8-a036-33ac447e668d") + * await client.bulkSync.getDestination("248df4b7-aa70-47b8-a036-33ac447e668d") */ public async getDestination( id: string, @@ -727,7 +778,7 @@ export class BulkSync { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/connections/${id}/bulksync/target` + `api/connections/${encodeURIComponent(id)}/bulksync/target` ), method: "GET", headers: { @@ -738,13 +789,14 @@ export class BulkSync { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.BulkSyncDestEnvelope; @@ -795,7 +847,7 @@ export class BulkSync { return (this._schemas ??= new Schemas(this._options)); } - protected async _getAuthorizationHeader() { + protected async _getAuthorizationHeader(): Promise { return `Bearer ${await core.Supplier.get(this._options.token)}`; } } diff --git a/src/api/resources/bulkSync/client/requests/CreateBulkSyncRequest.ts b/src/api/resources/bulkSync/client/requests/CreateBulkSyncRequest.ts index 75ea393..21999ec 100644 --- a/src/api/resources/bulkSync/client/requests/CreateBulkSyncRequest.ts +++ b/src/api/resources/bulkSync/client/requests/CreateBulkSyncRequest.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from "../../../.."; +import * as Polytomic from "../../../../index"; /** * @example diff --git a/src/api/resources/bulkSync/client/requests/UpdateBulkSyncRequest.ts b/src/api/resources/bulkSync/client/requests/UpdateBulkSyncRequest.ts index 7b7cbf6..49a8041 100644 --- a/src/api/resources/bulkSync/client/requests/UpdateBulkSyncRequest.ts +++ b/src/api/resources/bulkSync/client/requests/UpdateBulkSyncRequest.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from "../../../.."; +import * as Polytomic from "../../../../index"; /** * @example diff --git a/src/api/resources/bulkSync/client/requests/index.ts b/src/api/resources/bulkSync/client/requests/index.ts index d8f0094..ee9da57 100644 --- a/src/api/resources/bulkSync/client/requests/index.ts +++ b/src/api/resources/bulkSync/client/requests/index.ts @@ -1,6 +1,6 @@ -export { CreateBulkSyncRequest } from "./CreateBulkSyncRequest"; -export { BulkSyncGetRequest } from "./BulkSyncGetRequest"; -export { UpdateBulkSyncRequest } from "./UpdateBulkSyncRequest"; -export { BulkSyncRemoveRequest } from "./BulkSyncRemoveRequest"; -export { StartBulkSyncRequest } from "./StartBulkSyncRequest"; -export { BulkSyncGetSourceRequest } from "./BulkSyncGetSourceRequest"; +export { type CreateBulkSyncRequest } from "./CreateBulkSyncRequest"; +export { type BulkSyncGetRequest } from "./BulkSyncGetRequest"; +export { type UpdateBulkSyncRequest } from "./UpdateBulkSyncRequest"; +export { type BulkSyncRemoveRequest } from "./BulkSyncRemoveRequest"; +export { type StartBulkSyncRequest } from "./StartBulkSyncRequest"; +export { type BulkSyncGetSourceRequest } from "./BulkSyncGetSourceRequest"; diff --git a/src/api/resources/bulkSync/resources/executions/client/Client.ts b/src/api/resources/bulkSync/resources/executions/client/Client.ts index b3c45dd..8f04307 100644 --- a/src/api/resources/bulkSync/resources/executions/client/Client.ts +++ b/src/api/resources/bulkSync/resources/executions/client/Client.ts @@ -4,9 +4,9 @@ import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; -import * as Polytomic from "../../../../.."; +import * as Polytomic from "../../../../../index"; import urlJoin from "url-join"; -import * as errors from "../../../../../../errors"; +import * as errors from "../../../../../../errors/index"; export declare namespace Executions { interface Options { @@ -16,8 +16,14 @@ export declare namespace Executions { } interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the X-Polytomic-Version header */ + version?: string | undefined; } } @@ -25,11 +31,14 @@ export class Executions { constructor(protected readonly _options: Executions.Options) {} /** + * @param {Polytomic.bulkSync.ExecutionsListStatusRequest} request + * @param {Executions.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * * @example - * await polytomic.bulkSync.executions.listStatus({ + * await client.bulkSync.executions.listStatus({ * all: true, * active: true * }) @@ -39,7 +48,7 @@ export class Executions { requestOptions?: Executions.RequestOptions ): Promise { const { all, active, sync_id: syncId } = request; - const _queryParams: Record = {}; + const _queryParams: Record = {}; if (all != null) { _queryParams["all"] = all.toString(); } @@ -70,7 +79,7 @@ export class Executions { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -78,6 +87,7 @@ export class Executions { queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.ListBulkSyncExecutionStatusEnvelope; @@ -113,11 +123,14 @@ export class Executions { } /** + * @param {string} id + * @param {Executions.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * * @example - * await polytomic.bulkSync.executions.list("248df4b7-aa70-47b8-a036-33ac447e668d") + * await client.bulkSync.executions.list("248df4b7-aa70-47b8-a036-33ac447e668d") */ public async list( id: string, @@ -126,7 +139,7 @@ export class Executions { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/bulk/syncs/${id}/executions` + `api/bulk/syncs/${encodeURIComponent(id)}/executions` ), method: "GET", headers: { @@ -137,13 +150,14 @@ export class Executions { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.ListBulkSyncExecutionsEnvelope; @@ -179,11 +193,15 @@ export class Executions { } /** + * @param {string} id + * @param {string} execId + * @param {Executions.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * * @example - * await polytomic.bulkSync.executions.get("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d") + * await client.bulkSync.executions.get("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d") */ public async get( id: string, @@ -193,7 +211,7 @@ export class Executions { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/bulk/syncs/${id}/executions/${execId}` + `api/bulk/syncs/${encodeURIComponent(id)}/executions/${encodeURIComponent(execId)}` ), method: "GET", headers: { @@ -204,13 +222,14 @@ export class Executions { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.BulkSyncExecutionEnvelope; @@ -245,7 +264,7 @@ export class Executions { } } - protected async _getAuthorizationHeader() { + protected async _getAuthorizationHeader(): Promise { return `Bearer ${await core.Supplier.get(this._options.token)}`; } } diff --git a/src/api/resources/bulkSync/resources/executions/client/requests/index.ts b/src/api/resources/bulkSync/resources/executions/client/requests/index.ts index e01043f..08e0eb0 100644 --- a/src/api/resources/bulkSync/resources/executions/client/requests/index.ts +++ b/src/api/resources/bulkSync/resources/executions/client/requests/index.ts @@ -1 +1 @@ -export { ExecutionsListStatusRequest } from "./ExecutionsListStatusRequest"; +export { type ExecutionsListStatusRequest } from "./ExecutionsListStatusRequest"; diff --git a/src/api/resources/bulkSync/resources/schemas/client/Client.ts b/src/api/resources/bulkSync/resources/schemas/client/Client.ts index c8d139c..63934f5 100644 --- a/src/api/resources/bulkSync/resources/schemas/client/Client.ts +++ b/src/api/resources/bulkSync/resources/schemas/client/Client.ts @@ -4,9 +4,9 @@ import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; -import * as Polytomic from "../../../../.."; +import * as Polytomic from "../../../../../index"; import urlJoin from "url-join"; -import * as errors from "../../../../../../errors"; +import * as errors from "../../../../../../errors/index"; export declare namespace Schemas { interface Options { @@ -16,8 +16,14 @@ export declare namespace Schemas { } interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the X-Polytomic-Version header */ + version?: string | undefined; } } @@ -25,11 +31,15 @@ export class Schemas { constructor(protected readonly _options: Schemas.Options) {} /** + * @param {string} id + * @param {Polytomic.bulkSync.SchemasListRequest} request + * @param {Schemas.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * * @example - * await polytomic.bulkSync.schemas.list("248df4b7-aa70-47b8-a036-33ac447e668d", {}) + * await client.bulkSync.schemas.list("248df4b7-aa70-47b8-a036-33ac447e668d") */ public async list( id: string, @@ -37,15 +47,15 @@ export class Schemas { requestOptions?: Schemas.RequestOptions ): Promise { const { filters } = request; - const _queryParams: Record = {}; + const _queryParams: Record = {}; if (filters != null) { - _queryParams["filters"] = filters; + _queryParams["filters"] = JSON.stringify(filters); } const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/bulk/syncs/${id}/schemas` + `api/bulk/syncs/${encodeURIComponent(id)}/schemas` ), method: "GET", headers: { @@ -56,7 +66,7 @@ export class Schemas { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -64,6 +74,7 @@ export class Schemas { queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.ListBulkSchema; @@ -99,13 +110,17 @@ export class Schemas { } /** + * @param {string} id + * @param {Polytomic.bulkSync.BulkSyncSchemasRequest} request + * @param {Schemas.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.ForbiddenError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.bulkSync.schemas.patch("248df4b7-aa70-47b8-a036-33ac447e668d", {}) + * await client.bulkSync.schemas.patch("248df4b7-aa70-47b8-a036-33ac447e668d") */ public async patch( id: string, @@ -115,7 +130,7 @@ export class Schemas { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/bulk/syncs/${id}/schemas` + `api/bulk/syncs/${encodeURIComponent(id)}/schemas` ), method: "PATCH", headers: { @@ -126,7 +141,7 @@ export class Schemas { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -134,6 +149,7 @@ export class Schemas { body: request, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.ListBulkSchema; @@ -173,11 +189,15 @@ export class Schemas { } /** + * @param {string} id + * @param {string} schemaId + * @param {Schemas.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * * @example - * await polytomic.bulkSync.schemas.get("248df4b7-aa70-47b8-a036-33ac447e668d", "Contact") + * await client.bulkSync.schemas.get("248df4b7-aa70-47b8-a036-33ac447e668d", "Contact") */ public async get( id: string, @@ -187,7 +207,7 @@ export class Schemas { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/bulk/syncs/${id}/schemas/${schemaId}` + `api/bulk/syncs/${encodeURIComponent(id)}/schemas/${encodeURIComponent(schemaId)}` ), method: "GET", headers: { @@ -198,13 +218,14 @@ export class Schemas { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.BulkSchemaEnvelope; @@ -240,13 +261,18 @@ export class Schemas { } /** + * @param {string} id + * @param {string} schemaId + * @param {Polytomic.bulkSync.UpdateBulkSchema} request + * @param {Schemas.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.ForbiddenError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.bulkSync.schemas.update("248df4b7-aa70-47b8-a036-33ac447e668d", "contact", {}) + * await client.bulkSync.schemas.update("248df4b7-aa70-47b8-a036-33ac447e668d", "contact") */ public async update( id: string, @@ -257,7 +283,7 @@ export class Schemas { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/bulk/syncs/${id}/schemas/${schemaId}` + `api/bulk/syncs/${encodeURIComponent(id)}/schemas/${encodeURIComponent(schemaId)}` ), method: "PUT", headers: { @@ -268,7 +294,7 @@ export class Schemas { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -276,6 +302,7 @@ export class Schemas { body: request, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.BulkSchemaEnvelope; @@ -314,7 +341,7 @@ export class Schemas { } } - protected async _getAuthorizationHeader() { + protected async _getAuthorizationHeader(): Promise { return `Bearer ${await core.Supplier.get(this._options.token)}`; } } diff --git a/src/api/resources/bulkSync/resources/schemas/client/requests/BulkSyncSchemasRequest.ts b/src/api/resources/bulkSync/resources/schemas/client/requests/BulkSyncSchemasRequest.ts index ba6ffd8..f37566a 100644 --- a/src/api/resources/bulkSync/resources/schemas/client/requests/BulkSyncSchemasRequest.ts +++ b/src/api/resources/bulkSync/resources/schemas/client/requests/BulkSyncSchemasRequest.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from "../../../../../.."; +import * as Polytomic from "../../../../../../index"; /** * @example diff --git a/src/api/resources/bulkSync/resources/schemas/client/requests/SchemasListRequest.ts b/src/api/resources/bulkSync/resources/schemas/client/requests/SchemasListRequest.ts index d389e12..57543ba 100644 --- a/src/api/resources/bulkSync/resources/schemas/client/requests/SchemasListRequest.ts +++ b/src/api/resources/bulkSync/resources/schemas/client/requests/SchemasListRequest.ts @@ -7,5 +7,5 @@ * {} */ export interface SchemasListRequest { - filters?: string; + filters?: Record; } diff --git a/src/api/resources/bulkSync/resources/schemas/client/requests/UpdateBulkSchema.ts b/src/api/resources/bulkSync/resources/schemas/client/requests/UpdateBulkSchema.ts index 45fe051..8fa6e15 100644 --- a/src/api/resources/bulkSync/resources/schemas/client/requests/UpdateBulkSchema.ts +++ b/src/api/resources/bulkSync/resources/schemas/client/requests/UpdateBulkSchema.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from "../../../../../.."; +import * as Polytomic from "../../../../../../index"; /** * @example diff --git a/src/api/resources/bulkSync/resources/schemas/client/requests/index.ts b/src/api/resources/bulkSync/resources/schemas/client/requests/index.ts index 1c57da0..13212f8 100644 --- a/src/api/resources/bulkSync/resources/schemas/client/requests/index.ts +++ b/src/api/resources/bulkSync/resources/schemas/client/requests/index.ts @@ -1,3 +1,3 @@ -export { SchemasListRequest } from "./SchemasListRequest"; -export { BulkSyncSchemasRequest } from "./BulkSyncSchemasRequest"; -export { UpdateBulkSchema } from "./UpdateBulkSchema"; +export { type SchemasListRequest } from "./SchemasListRequest"; +export { type BulkSyncSchemasRequest } from "./BulkSyncSchemasRequest"; +export { type UpdateBulkSchema } from "./UpdateBulkSchema"; diff --git a/src/api/resources/bulkSync/types/V2CreateBulkSyncRequestSchemasItem.ts b/src/api/resources/bulkSync/types/V2CreateBulkSyncRequestSchemasItem.ts index 63e4af5..60a007d 100644 --- a/src/api/resources/bulkSync/types/V2CreateBulkSyncRequestSchemasItem.ts +++ b/src/api/resources/bulkSync/types/V2CreateBulkSyncRequestSchemasItem.ts @@ -2,6 +2,6 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from "../../.."; +import * as Polytomic from "../../../index"; export type V2CreateBulkSyncRequestSchemasItem = string | Polytomic.SchemaConfiguration; diff --git a/src/api/resources/bulkSync/types/V2UpdateBulkSyncRequestSchemasItem.ts b/src/api/resources/bulkSync/types/V2UpdateBulkSyncRequestSchemasItem.ts index afa1e3d..50969d8 100644 --- a/src/api/resources/bulkSync/types/V2UpdateBulkSyncRequestSchemasItem.ts +++ b/src/api/resources/bulkSync/types/V2UpdateBulkSyncRequestSchemasItem.ts @@ -2,6 +2,6 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from "../../.."; +import * as Polytomic from "../../../index"; export type V2UpdateBulkSyncRequestSchemasItem = string | Polytomic.SchemaConfiguration; diff --git a/src/api/resources/connections/client/Client.ts b/src/api/resources/connections/client/Client.ts index b8cdeba..059ff9b 100644 --- a/src/api/resources/connections/client/Client.ts +++ b/src/api/resources/connections/client/Client.ts @@ -4,9 +4,9 @@ import * as environments from "../../../../environments"; import * as core from "../../../../core"; -import * as Polytomic from "../../.."; +import * as Polytomic from "../../../index"; import urlJoin from "url-join"; -import * as errors from "../../../../errors"; +import * as errors from "../../../../errors/index"; export declare namespace Connections { interface Options { @@ -16,8 +16,14 @@ export declare namespace Connections { } interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the X-Polytomic-Version header */ + version?: string | undefined; } } @@ -25,11 +31,13 @@ export class Connections { constructor(protected readonly _options: Connections.Options) {} /** + * @param {Connections.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.connections.getTypes() + * await client.connections.getTypes() */ public async getTypes( requestOptions?: Connections.RequestOptions @@ -48,13 +56,14 @@ export class Connections { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.ConnectionTypeResponseEnvelope; @@ -90,11 +99,13 @@ export class Connections { } /** + * @param {Connections.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.connections.list() + * await client.connections.list() */ public async list(requestOptions?: Connections.RequestOptions): Promise { const _response = await core.fetcher({ @@ -111,13 +122,14 @@ export class Connections { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.ConnectionListResponseEnvelope; @@ -153,6 +165,9 @@ export class Connections { } /** + * @param {Polytomic.CreateConnectionRequestSchema} request + * @param {Connections.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.BadRequestError} * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.ForbiddenError} @@ -160,7 +175,7 @@ export class Connections { * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.connections.create({ + * await client.connections.create({ * configuration: { * "database": "example", * "hostname": "postgres.example.com", @@ -190,7 +205,7 @@ export class Connections { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -198,6 +213,7 @@ export class Connections { body: request, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.CreateConnectionResponseEnvelope; @@ -239,13 +255,16 @@ export class Connections { } /** + * @param {Polytomic.ConnectCardRequest} request + * @param {Connections.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.ForbiddenError} * @throws {@link Polytomic.UnprocessableEntityError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.connections.connect({ + * await client.connections.connect({ * name: "Salesforce Connection", * redirect_url: "redirect_url" * }) @@ -268,7 +287,7 @@ export class Connections { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -276,6 +295,7 @@ export class Connections { body: request, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.ConnectCardResponseEnvelope; @@ -315,12 +335,15 @@ export class Connections { } /** + * @param {string} id + * @param {Connections.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.connections.get("248df4b7-aa70-47b8-a036-33ac447e668d") + * await client.connections.get("248df4b7-aa70-47b8-a036-33ac447e668d") */ public async get( id: string, @@ -329,7 +352,7 @@ export class Connections { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/connections/${id}` + `api/connections/${encodeURIComponent(id)}` ), method: "GET", headers: { @@ -340,13 +363,14 @@ export class Connections { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.ConnectionResponseEnvelope; @@ -384,6 +408,10 @@ export class Connections { } /** + * @param {string} id + * @param {Polytomic.UpdateConnectionRequestSchema} request + * @param {Connections.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.BadRequestError} * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.ForbiddenError} @@ -392,7 +420,7 @@ export class Connections { * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.connections.update("248df4b7-aa70-47b8-a036-33ac447e668d", { + * await client.connections.update("248df4b7-aa70-47b8-a036-33ac447e668d", { * configuration: { * "database": "example", * "hostname": "postgres.example.com", @@ -411,7 +439,7 @@ export class Connections { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/connections/${id}` + `api/connections/${encodeURIComponent(id)}` ), method: "PUT", headers: { @@ -422,7 +450,7 @@ export class Connections { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -430,6 +458,7 @@ export class Connections { body: request, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.CreateConnectionResponseEnvelope; @@ -473,6 +502,10 @@ export class Connections { } /** + * @param {string} id + * @param {Polytomic.ConnectionsRemoveRequest} request + * @param {Connections.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.ForbiddenError} * @throws {@link Polytomic.NotFoundError} @@ -480,7 +513,7 @@ export class Connections { * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.connections.remove("248df4b7-aa70-47b8-a036-33ac447e668d", { + * await client.connections.remove("248df4b7-aa70-47b8-a036-33ac447e668d", { * force: true * }) */ @@ -490,7 +523,7 @@ export class Connections { requestOptions?: Connections.RequestOptions ): Promise { const { force } = request; - const _queryParams: Record = {}; + const _queryParams: Record = {}; if (force != null) { _queryParams["force"] = force.toString(); } @@ -498,7 +531,7 @@ export class Connections { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/connections/${id}` + `api/connections/${encodeURIComponent(id)}` ), method: "DELETE", headers: { @@ -509,7 +542,7 @@ export class Connections { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -517,6 +550,7 @@ export class Connections { queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return; @@ -558,12 +592,15 @@ export class Connections { } /** + * @param {string} id + * @param {Connections.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.connections.getParameterValues("248df4b7-aa70-47b8-a036-33ac447e668d") + * await client.connections.getParameterValues("248df4b7-aa70-47b8-a036-33ac447e668d") */ public async getParameterValues( id: string, @@ -572,7 +609,7 @@ export class Connections { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/connections/${id}/parameter_values` + `api/connections/${encodeURIComponent(id)}/parameter_values` ), method: "GET", headers: { @@ -583,13 +620,14 @@ export class Connections { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.ConnectionParameterValuesResponseEnvelope; @@ -626,7 +664,7 @@ export class Connections { } } - protected async _getAuthorizationHeader() { + protected async _getAuthorizationHeader(): Promise { return `Bearer ${await core.Supplier.get(this._options.token)}`; } } diff --git a/src/api/resources/connections/client/requests/index.ts b/src/api/resources/connections/client/requests/index.ts index 9bc79d3..782f805 100644 --- a/src/api/resources/connections/client/requests/index.ts +++ b/src/api/resources/connections/client/requests/index.ts @@ -1,4 +1,4 @@ -export { CreateConnectionRequestSchema } from "./CreateConnectionRequestSchema"; -export { ConnectCardRequest } from "./ConnectCardRequest"; -export { UpdateConnectionRequestSchema } from "./UpdateConnectionRequestSchema"; -export { ConnectionsRemoveRequest } from "./ConnectionsRemoveRequest"; +export { type CreateConnectionRequestSchema } from "./CreateConnectionRequestSchema"; +export { type ConnectCardRequest } from "./ConnectCardRequest"; +export { type UpdateConnectionRequestSchema } from "./UpdateConnectionRequestSchema"; +export { type ConnectionsRemoveRequest } from "./ConnectionsRemoveRequest"; diff --git a/src/api/resources/events/client/Client.ts b/src/api/resources/events/client/Client.ts index ff86815..347c9cd 100644 --- a/src/api/resources/events/client/Client.ts +++ b/src/api/resources/events/client/Client.ts @@ -4,9 +4,9 @@ import * as environments from "../../../../environments"; import * as core from "../../../../core"; -import * as Polytomic from "../../.."; +import * as Polytomic from "../../../index"; import urlJoin from "url-join"; -import * as errors from "../../../../errors"; +import * as errors from "../../../../errors/index"; export declare namespace Events { interface Options { @@ -16,8 +16,14 @@ export declare namespace Events { } interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the X-Polytomic-Version header */ + version?: string | undefined; } } @@ -25,12 +31,15 @@ export class Events { constructor(protected readonly _options: Events.Options) {} /** + * @param {Polytomic.EventsListRequest} request + * @param {Events.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.UnprocessableEntityError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.events.list({ + * await client.events.list({ * organization_id: "248df4b7-aa70-47b8-a036-33ac447e668d", * starting_after: new Date("2020-01-01T00:00:00.000Z"), * ending_before: new Date("2020-01-01T00:00:00.000Z") @@ -47,7 +56,7 @@ export class Events { ending_before: endingBefore, limit, } = request; - const _queryParams: Record = {}; + const _queryParams: Record = {}; if (organizationId != null) { _queryParams["organization_id"] = organizationId; } @@ -82,7 +91,7 @@ export class Events { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -90,6 +99,7 @@ export class Events { queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.EventsEnvelope; @@ -127,10 +137,12 @@ export class Events { } /** + * @param {Events.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * * @example - * await polytomic.events.getTypes() + * await client.events.getTypes() */ public async getTypes(requestOptions?: Events.RequestOptions): Promise { const _response = await core.fetcher({ @@ -147,13 +159,14 @@ export class Events { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.EventTypesEnvelope; @@ -186,7 +199,7 @@ export class Events { } } - protected async _getAuthorizationHeader() { + protected async _getAuthorizationHeader(): Promise { return `Bearer ${await core.Supplier.get(this._options.token)}`; } } diff --git a/src/api/resources/events/client/requests/index.ts b/src/api/resources/events/client/requests/index.ts index 10d6d89..a6fbede 100644 --- a/src/api/resources/events/client/requests/index.ts +++ b/src/api/resources/events/client/requests/index.ts @@ -1 +1 @@ -export { EventsListRequest } from "./EventsListRequest"; +export { type EventsListRequest } from "./EventsListRequest"; diff --git a/src/api/resources/identity/client/Client.ts b/src/api/resources/identity/client/Client.ts index 5db1f51..ad8dcbd 100644 --- a/src/api/resources/identity/client/Client.ts +++ b/src/api/resources/identity/client/Client.ts @@ -4,9 +4,9 @@ import * as environments from "../../../../environments"; import * as core from "../../../../core"; -import * as Polytomic from "../../.."; +import * as Polytomic from "../../../index"; import urlJoin from "url-join"; -import * as errors from "../../../../errors"; +import * as errors from "../../../../errors/index"; export declare namespace Identity { interface Options { @@ -16,8 +16,14 @@ export declare namespace Identity { } interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the X-Polytomic-Version header */ + version?: string | undefined; } } @@ -25,11 +31,13 @@ export class Identity { constructor(protected readonly _options: Identity.Options) {} /** + * @param {Identity.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.identity.get() + * await client.identity.get() */ public async get(requestOptions?: Identity.RequestOptions): Promise { const _response = await core.fetcher({ @@ -46,13 +54,14 @@ export class Identity { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.GetIdentityResponseEnvelope; @@ -87,7 +96,7 @@ export class Identity { } } - protected async _getAuthorizationHeader() { + protected async _getAuthorizationHeader(): Promise { return `Bearer ${await core.Supplier.get(this._options.token)}`; } } diff --git a/src/api/resources/jobs/client/Client.ts b/src/api/resources/jobs/client/Client.ts index 9ca62cb..b10927e 100644 --- a/src/api/resources/jobs/client/Client.ts +++ b/src/api/resources/jobs/client/Client.ts @@ -4,9 +4,9 @@ import * as environments from "../../../../environments"; import * as core from "../../../../core"; -import * as Polytomic from "../../.."; +import * as Polytomic from "../../../index"; import urlJoin from "url-join"; -import * as errors from "../../../../errors"; +import * as errors from "../../../../errors/index"; export declare namespace Jobs { interface Options { @@ -16,8 +16,14 @@ export declare namespace Jobs { } interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the X-Polytomic-Version header */ + version?: string | undefined; } } @@ -25,13 +31,17 @@ export class Jobs { constructor(protected readonly _options: Jobs.Options) {} /** + * @param {string} id + * @param {string} type + * @param {Jobs.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.BadRequestError} * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.jobs.get("248df4b7-aa70-47b8-a036-33ac447e668d", "createmodel") + * await client.jobs.get("248df4b7-aa70-47b8-a036-33ac447e668d", "createmodel") */ public async get( id: string, @@ -41,7 +51,7 @@ export class Jobs { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/jobs/${type}/${id}` + `api/jobs/${encodeURIComponent(type)}/${encodeURIComponent(id)}` ), method: "GET", headers: { @@ -52,13 +62,14 @@ export class Jobs { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.JobResponseEnvelope; @@ -97,7 +108,7 @@ export class Jobs { } } - protected async _getAuthorizationHeader() { + protected async _getAuthorizationHeader(): Promise { return `Bearer ${await core.Supplier.get(this._options.token)}`; } } diff --git a/src/api/resources/modelSync/client/Client.ts b/src/api/resources/modelSync/client/Client.ts index 864e340..2ccfaa3 100644 --- a/src/api/resources/modelSync/client/Client.ts +++ b/src/api/resources/modelSync/client/Client.ts @@ -4,9 +4,9 @@ import * as environments from "../../../../environments"; import * as core from "../../../../core"; -import * as Polytomic from "../../.."; +import * as Polytomic from "../../../index"; import urlJoin from "url-join"; -import * as errors from "../../../../errors"; +import * as errors from "../../../../errors/index"; import { Executions } from "../resources/executions/client/Client"; export declare namespace ModelSync { @@ -17,8 +17,14 @@ export declare namespace ModelSync { } interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the X-Polytomic-Version header */ + version?: string | undefined; } } @@ -26,6 +32,10 @@ export class ModelSync { constructor(protected readonly _options: ModelSync.Options) {} /** + * @param {string} id + * @param {Polytomic.ModelSyncGetSourceRequest} request + * @param {ModelSync.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.BadRequestError} * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.ForbiddenError} @@ -33,7 +43,7 @@ export class ModelSync { * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.modelSync.getSource("248df4b7-aa70-47b8-a036-33ac447e668d", {}) + * await client.modelSync.getSource("248df4b7-aa70-47b8-a036-33ac447e668d") */ public async getSource( id: string, @@ -41,15 +51,15 @@ export class ModelSync { requestOptions?: ModelSync.RequestOptions ): Promise { const { params } = request; - const _queryParams: Record = {}; + const _queryParams: Record = {}; if (params != null) { - _queryParams["params"] = params; + _queryParams["params"] = JSON.stringify(params); } const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/connections/${id}/modelsync/source` + `api/connections/${encodeURIComponent(id)}/modelsync/source` ), method: "GET", headers: { @@ -60,7 +70,7 @@ export class ModelSync { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -68,6 +78,7 @@ export class ModelSync { queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.GetModelSyncSourceMetaEnvelope; @@ -109,6 +120,9 @@ export class ModelSync { } /** + * @param {string} id + * @param {ModelSync.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.BadRequestError} * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.ForbiddenError} @@ -116,7 +130,7 @@ export class ModelSync { * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.modelSync.getSourceFields("248df4b7-aa70-47b8-a036-33ac447e668d") + * await client.modelSync.getSourceFields("248df4b7-aa70-47b8-a036-33ac447e668d") */ public async getSourceFields( id: string, @@ -125,7 +139,7 @@ export class ModelSync { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/connections/${id}/modelsync/source/fields` + `api/connections/${encodeURIComponent(id)}/modelsync/source/fields` ), method: "GET", headers: { @@ -136,13 +150,14 @@ export class ModelSync { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.ModelFieldResponse; @@ -184,6 +199,10 @@ export class ModelSync { } /** + * @param {string} id + * @param {Polytomic.ModelSyncGetTargetRequest} request + * @param {ModelSync.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.BadRequestError} * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.ForbiddenError} @@ -191,7 +210,7 @@ export class ModelSync { * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.modelSync.getTarget("248df4b7-aa70-47b8-a036-33ac447e668d", {}) + * await client.modelSync.getTarget("248df4b7-aa70-47b8-a036-33ac447e668d") */ public async getTarget( id: string, @@ -199,7 +218,7 @@ export class ModelSync { requestOptions?: ModelSync.RequestOptions ): Promise { const { type: type_, search } = request; - const _queryParams: Record = {}; + const _queryParams: Record = {}; if (type_ != null) { _queryParams["type"] = type_; } @@ -211,7 +230,7 @@ export class ModelSync { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/connections/${id}/modelsync/target` + `api/connections/${encodeURIComponent(id)}/modelsync/target` ), method: "GET", headers: { @@ -222,7 +241,7 @@ export class ModelSync { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -230,6 +249,7 @@ export class ModelSync { queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.GetConnectionMetaEnvelope; @@ -271,13 +291,17 @@ export class ModelSync { } /** + * @param {string} id + * @param {Polytomic.ModelSyncGetTargetFieldsRequest} request + * @param {ModelSync.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.ForbiddenError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.modelSync.getTargetFields("248df4b7-aa70-47b8-a036-33ac447e668d", { + * await client.modelSync.getTargetFields("248df4b7-aa70-47b8-a036-33ac447e668d", { * target: "database.table", * refresh: false * }) @@ -288,7 +312,7 @@ export class ModelSync { requestOptions?: ModelSync.RequestOptions ): Promise { const { target, refresh } = request; - const _queryParams: Record = {}; + const _queryParams: Record = {}; _queryParams["target"] = target; if (refresh != null) { _queryParams["refresh"] = refresh.toString(); @@ -297,7 +321,7 @@ export class ModelSync { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/connections/${id}/modelsync/target/fields` + `api/connections/${encodeURIComponent(id)}/modelsync/target/fields` ), method: "GET", headers: { @@ -308,7 +332,7 @@ export class ModelSync { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -316,6 +340,7 @@ export class ModelSync { queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.TargetResponseEnvelope; @@ -355,12 +380,14 @@ export class ModelSync { } /** + * @param {ModelSync.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.modelSync.list() + * await client.modelSync.list() */ public async list(requestOptions?: ModelSync.RequestOptions): Promise { const _response = await core.fetcher({ @@ -377,13 +404,14 @@ export class ModelSync { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.ListModelSyncResponseEnvelope; @@ -421,6 +449,9 @@ export class ModelSync { } /** + * @param {Polytomic.CreateModelSyncRequest} request + * @param {ModelSync.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.BadRequestError} * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.ForbiddenError} @@ -428,7 +459,7 @@ export class ModelSync { * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.modelSync.create({ + * await client.modelSync.create({ * fields: [{ * target: "name" * }], @@ -459,7 +490,7 @@ export class ModelSync { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -467,6 +498,7 @@ export class ModelSync { body: request, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.ModelSyncResponseEnvelope; @@ -508,11 +540,13 @@ export class ModelSync { } /** + * @param {ModelSync.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.modelSync.getScheduleOptions() + * await client.modelSync.getScheduleOptions() */ public async getScheduleOptions( requestOptions?: ModelSync.RequestOptions @@ -531,13 +565,14 @@ export class ModelSync { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.ScheduleOptionResponseEnvelope; @@ -573,12 +608,15 @@ export class ModelSync { } /** + * @param {string} id + * @param {ModelSync.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.modelSync.get("248df4b7-aa70-47b8-a036-33ac447e668d") + * await client.modelSync.get("248df4b7-aa70-47b8-a036-33ac447e668d") */ public async get( id: string, @@ -587,7 +625,7 @@ export class ModelSync { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/syncs/${id}` + `api/syncs/${encodeURIComponent(id)}` ), method: "GET", headers: { @@ -598,13 +636,14 @@ export class ModelSync { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.ModelSyncResponseEnvelope; @@ -642,6 +681,10 @@ export class ModelSync { } /** + * @param {string} id + * @param {Polytomic.UpdateModelSyncRequest} request + * @param {ModelSync.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.BadRequestError} * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.ForbiddenError} @@ -650,7 +693,7 @@ export class ModelSync { * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.modelSync.update("248df4b7-aa70-47b8-a036-33ac447e668d", { + * await client.modelSync.update("248df4b7-aa70-47b8-a036-33ac447e668d", { * fields: [{ * target: "name" * }], @@ -671,7 +714,7 @@ export class ModelSync { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/syncs/${id}` + `api/syncs/${encodeURIComponent(id)}` ), method: "PUT", headers: { @@ -682,7 +725,7 @@ export class ModelSync { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -690,6 +733,7 @@ export class ModelSync { body: request, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.ModelSyncResponseEnvelope; @@ -733,19 +777,22 @@ export class ModelSync { } /** + * @param {string} id + * @param {ModelSync.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.ForbiddenError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.modelSync.remove("248df4b7-aa70-47b8-a036-33ac447e668d") + * await client.modelSync.remove("248df4b7-aa70-47b8-a036-33ac447e668d") */ public async remove(id: string, requestOptions?: ModelSync.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/syncs/${id}` + `api/syncs/${encodeURIComponent(id)}` ), method: "DELETE", headers: { @@ -756,13 +803,14 @@ export class ModelSync { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return; @@ -802,13 +850,17 @@ export class ModelSync { } /** + * @param {string} id + * @param {Polytomic.ActivateSyncInput} request + * @param {ModelSync.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.ForbiddenError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.modelSync.activate("248df4b7-aa70-47b8-a036-33ac447e668d", { + * await client.modelSync.activate("248df4b7-aa70-47b8-a036-33ac447e668d", { * active: true * }) */ @@ -820,7 +872,7 @@ export class ModelSync { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/syncs/${id}/activate` + `api/syncs/${encodeURIComponent(id)}/activate` ), method: "POST", headers: { @@ -831,7 +883,7 @@ export class ModelSync { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -839,6 +891,7 @@ export class ModelSync { body: request, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.ActivateSyncEnvelope; @@ -881,6 +934,11 @@ export class ModelSync { * > 🚧 Force full resync * > * > Use caution when setting the `resync` parameter to `true`. This will force a full resync of the data from the source system. This can be a time-consuming operation and may impact the performance of the source system. It is recommended to only use this option when necessary. + * + * @param {string} id + * @param {Polytomic.StartModelSyncRequest} request + * @param {ModelSync.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.BadRequestError} * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.ForbiddenError} @@ -888,7 +946,7 @@ export class ModelSync { * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.modelSync.start("248df4b7-aa70-47b8-a036-33ac447e668d", {}) + * await client.modelSync.start("248df4b7-aa70-47b8-a036-33ac447e668d") */ public async start( id: string, @@ -898,7 +956,7 @@ export class ModelSync { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/syncs/${id}/executions` + `api/syncs/${encodeURIComponent(id)}/executions` ), method: "POST", headers: { @@ -909,7 +967,7 @@ export class ModelSync { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -917,6 +975,7 @@ export class ModelSync { body: request, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.StartModelSyncResponseEnvelope; @@ -958,12 +1017,15 @@ export class ModelSync { } /** + * @param {string} id + * @param {ModelSync.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.modelSync.getStatus("248df4b7-aa70-47b8-a036-33ac447e668d") + * await client.modelSync.getStatus("248df4b7-aa70-47b8-a036-33ac447e668d") */ public async getStatus( id: string, @@ -972,7 +1034,7 @@ export class ModelSync { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/syncs/${id}/status` + `api/syncs/${encodeURIComponent(id)}/status` ), method: "GET", headers: { @@ -983,13 +1045,14 @@ export class ModelSync { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.SyncStatusEnvelope; @@ -1032,7 +1095,7 @@ export class ModelSync { return (this._executions ??= new Executions(this._options)); } - protected async _getAuthorizationHeader() { + protected async _getAuthorizationHeader(): Promise { return `Bearer ${await core.Supplier.get(this._options.token)}`; } } diff --git a/src/api/resources/modelSync/client/requests/CreateModelSyncRequest.ts b/src/api/resources/modelSync/client/requests/CreateModelSyncRequest.ts index dcc3b48..02822bc 100644 --- a/src/api/resources/modelSync/client/requests/CreateModelSyncRequest.ts +++ b/src/api/resources/modelSync/client/requests/CreateModelSyncRequest.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from "../../../.."; +import * as Polytomic from "../../../../index"; /** * @example diff --git a/src/api/resources/modelSync/client/requests/ModelSyncGetSourceRequest.ts b/src/api/resources/modelSync/client/requests/ModelSyncGetSourceRequest.ts index 1df5875..6575d95 100644 --- a/src/api/resources/modelSync/client/requests/ModelSyncGetSourceRequest.ts +++ b/src/api/resources/modelSync/client/requests/ModelSyncGetSourceRequest.ts @@ -7,5 +7,5 @@ * {} */ export interface ModelSyncGetSourceRequest { - params?: string; + params?: Record; } diff --git a/src/api/resources/modelSync/client/requests/UpdateModelSyncRequest.ts b/src/api/resources/modelSync/client/requests/UpdateModelSyncRequest.ts index 0882786..ff31293 100644 --- a/src/api/resources/modelSync/client/requests/UpdateModelSyncRequest.ts +++ b/src/api/resources/modelSync/client/requests/UpdateModelSyncRequest.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from "../../../.."; +import * as Polytomic from "../../../../index"; /** * @example diff --git a/src/api/resources/modelSync/client/requests/index.ts b/src/api/resources/modelSync/client/requests/index.ts index 877bb4e..f268342 100644 --- a/src/api/resources/modelSync/client/requests/index.ts +++ b/src/api/resources/modelSync/client/requests/index.ts @@ -1,6 +1,6 @@ -export { ModelSyncGetSourceRequest } from "./ModelSyncGetSourceRequest"; -export { ModelSyncGetTargetRequest } from "./ModelSyncGetTargetRequest"; -export { ModelSyncGetTargetFieldsRequest } from "./ModelSyncGetTargetFieldsRequest"; -export { CreateModelSyncRequest } from "./CreateModelSyncRequest"; -export { UpdateModelSyncRequest } from "./UpdateModelSyncRequest"; -export { StartModelSyncRequest } from "./StartModelSyncRequest"; +export { type ModelSyncGetSourceRequest } from "./ModelSyncGetSourceRequest"; +export { type ModelSyncGetTargetRequest } from "./ModelSyncGetTargetRequest"; +export { type ModelSyncGetTargetFieldsRequest } from "./ModelSyncGetTargetFieldsRequest"; +export { type CreateModelSyncRequest } from "./CreateModelSyncRequest"; +export { type UpdateModelSyncRequest } from "./UpdateModelSyncRequest"; +export { type StartModelSyncRequest } from "./StartModelSyncRequest"; diff --git a/src/api/resources/modelSync/resources/executions/client/Client.ts b/src/api/resources/modelSync/resources/executions/client/Client.ts index 28203b3..20e72bb 100644 --- a/src/api/resources/modelSync/resources/executions/client/Client.ts +++ b/src/api/resources/modelSync/resources/executions/client/Client.ts @@ -4,9 +4,9 @@ import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; -import * as Polytomic from "../../../../.."; +import * as Polytomic from "../../../../../index"; import urlJoin from "url-join"; -import * as errors from "../../../../../../errors"; +import * as errors from "../../../../../../errors/index"; export declare namespace Executions { interface Options { @@ -16,8 +16,14 @@ export declare namespace Executions { } interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the X-Polytomic-Version header */ + version?: string | undefined; } } @@ -25,11 +31,14 @@ export class Executions { constructor(protected readonly _options: Executions.Options) {} /** + * @param {string} syncId + * @param {Executions.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * * @example - * await polytomic.modelSync.executions.list("248df4b7-aa70-47b8-a036-33ac447e668d") + * await client.modelSync.executions.list("248df4b7-aa70-47b8-a036-33ac447e668d") */ public async list( syncId: string, @@ -38,7 +47,7 @@ export class Executions { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/syncs/${syncId}/executions` + `api/syncs/${encodeURIComponent(syncId)}/executions` ), method: "GET", headers: { @@ -49,13 +58,14 @@ export class Executions { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.ListExecutionResponseEnvelope; @@ -91,12 +101,16 @@ export class Executions { } /** + * @param {string} syncId + * @param {string} id + * @param {Executions.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.modelSync.executions.get("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d") + * await client.modelSync.executions.get("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d") */ public async get( syncId: string, @@ -106,7 +120,7 @@ export class Executions { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/syncs/${syncId}/executions/${id}` + `api/syncs/${encodeURIComponent(syncId)}/executions/${encodeURIComponent(id)}` ), method: "GET", headers: { @@ -117,13 +131,14 @@ export class Executions { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.GetExecutionResponseEnvelope; @@ -161,13 +176,18 @@ export class Executions { } /** + * @param {string} syncId + * @param {string} id + * @param {string} type + * @param {Executions.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.BadRequestError} * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.modelSync.executions.getLogUrls("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d", "records") + * await client.modelSync.executions.getLogUrls("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d", "records") */ public async getLogUrls( syncId: string, @@ -178,7 +198,9 @@ export class Executions { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/syncs/${syncId}/executions/${id}/${type}` + `api/syncs/${encodeURIComponent(syncId)}/executions/${encodeURIComponent(id)}/${encodeURIComponent( + type + )}` ), method: "GET", headers: { @@ -189,13 +211,14 @@ export class Executions { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.ExecutionLogsResponseEnvelope; @@ -235,13 +258,19 @@ export class Executions { } /** + * @param {string} syncId + * @param {string} id + * @param {string} type + * @param {string} filename + * @param {Executions.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.BadRequestError} * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.modelSync.executions.getLogs("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d", "records", "path/to/file.json") + * await client.modelSync.executions.getLogs("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d", "records", "path/to/file.json") */ public async getLogs( syncId: string, @@ -253,7 +282,9 @@ export class Executions { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/syncs/${syncId}/executions/${id}/${type}/${filename}` + `api/syncs/${encodeURIComponent(syncId)}/executions/${encodeURIComponent(id)}/${encodeURIComponent( + type + )}/${encodeURIComponent(filename)}` ), method: "GET", headers: { @@ -264,13 +295,14 @@ export class Executions { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return; @@ -309,7 +341,7 @@ export class Executions { } } - protected async _getAuthorizationHeader() { + protected async _getAuthorizationHeader(): Promise { return `Bearer ${await core.Supplier.get(this._options.token)}`; } } diff --git a/src/api/resources/models/client/Client.ts b/src/api/resources/models/client/Client.ts index 4d0edb9..08d3bb9 100644 --- a/src/api/resources/models/client/Client.ts +++ b/src/api/resources/models/client/Client.ts @@ -4,9 +4,9 @@ import * as environments from "../../../../environments"; import * as core from "../../../../core"; -import * as Polytomic from "../../.."; +import * as Polytomic from "../../../index"; import urlJoin from "url-join"; -import * as errors from "../../../../errors"; +import * as errors from "../../../../errors/index"; export declare namespace Models { interface Options { @@ -16,8 +16,14 @@ export declare namespace Models { } interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the X-Polytomic-Version header */ + version?: string | undefined; } } @@ -26,13 +32,18 @@ export class Models { /** * For a given connection and enrichment configuration, provides the valid sets of input fields. + * + * @param {string} connectionId + * @param {Polytomic.GetEnrichmentInputFieldsRequest} request + * @param {Models.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.ForbiddenError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.models.post("248df4b7-aa70-47b8-a036-33ac447e668d", {}) + * await client.models.post("248df4b7-aa70-47b8-a036-33ac447e668d") */ public async post( connectionId: string, @@ -42,7 +53,7 @@ export class Models { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/enrichment/${connectionId}/inputfields` + `api/enrichment/${encodeURIComponent(connectionId)}/inputfields` ), method: "POST", headers: { @@ -53,7 +64,7 @@ export class Models { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -61,6 +72,7 @@ export class Models { body: request, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.V2GetEnrichmentInputFieldsResponseEnvelope; @@ -100,13 +112,16 @@ export class Models { } /** + * @param {Polytomic.ModelsPreviewRequest} request + * @param {Models.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.BadRequestError} * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.models.preview({ + * await client.models.preview({ * body: { * configuration: { * "table": "public.users" @@ -121,7 +136,7 @@ export class Models { requestOptions?: Models.RequestOptions ): Promise { const { async, body: _body } = request; - const _queryParams: Record = {}; + const _queryParams: Record = {}; if (async != null) { _queryParams["async"] = async.toString(); } @@ -140,7 +155,7 @@ export class Models { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -149,6 +164,7 @@ export class Models { body: _body, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.ModelResponseEnvelope; @@ -188,11 +204,13 @@ export class Models { } /** + * @param {Models.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * * @example - * await polytomic.models.list() + * await client.models.list() */ public async list(requestOptions?: Models.RequestOptions): Promise { const _response = await core.fetcher({ @@ -209,13 +227,14 @@ export class Models { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.ModelListResponseEnvelope; @@ -251,13 +270,16 @@ export class Models { } /** + * @param {Polytomic.ModelsCreateRequest} request + * @param {Models.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.BadRequestError} * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.ForbiddenError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.models.create({ + * await client.models.create({ * body: { * configuration: { * "table": "public.users" @@ -272,7 +294,7 @@ export class Models { requestOptions?: Models.RequestOptions ): Promise { const { async, body: _body } = request; - const _queryParams: Record = {}; + const _queryParams: Record = {}; if (async != null) { _queryParams["async"] = async.toString(); } @@ -291,7 +313,7 @@ export class Models { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -300,6 +322,7 @@ export class Models { body: _body, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.ModelResponseEnvelope; @@ -339,12 +362,16 @@ export class Models { } /** + * @param {string} id + * @param {Polytomic.ModelsGetRequest} request + * @param {Models.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.models.get("248df4b7-aa70-47b8-a036-33ac447e668d", {}) + * await client.models.get("248df4b7-aa70-47b8-a036-33ac447e668d") */ public async get( id: string, @@ -352,7 +379,7 @@ export class Models { requestOptions?: Models.RequestOptions ): Promise { const { async } = request; - const _queryParams: Record = {}; + const _queryParams: Record = {}; if (async != null) { _queryParams["async"] = async.toString(); } @@ -360,7 +387,7 @@ export class Models { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/models/${id}` + `api/models/${encodeURIComponent(id)}` ), method: "GET", headers: { @@ -371,7 +398,7 @@ export class Models { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -379,6 +406,7 @@ export class Models { queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.ModelResponseEnvelope; @@ -416,13 +444,17 @@ export class Models { } /** + * @param {string} id + * @param {Polytomic.UpdateModelRequest} request + * @param {Models.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.BadRequestError} * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.models.update("248df4b7-aa70-47b8-a036-33ac447e668d", { + * await client.models.update("248df4b7-aa70-47b8-a036-33ac447e668d", { * async: false, * configuration: { * "table": "public.users" @@ -437,7 +469,7 @@ export class Models { requestOptions?: Models.RequestOptions ): Promise { const { async, ..._body } = request; - const _queryParams: Record = {}; + const _queryParams: Record = {}; if (async != null) { _queryParams["async"] = async.toString(); } @@ -445,7 +477,7 @@ export class Models { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/models/${id}` + `api/models/${encodeURIComponent(id)}` ), method: "PUT", headers: { @@ -456,7 +488,7 @@ export class Models { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -465,6 +497,7 @@ export class Models { body: _body, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.ModelResponseEnvelope; @@ -504,13 +537,17 @@ export class Models { } /** + * @param {string} id + * @param {Polytomic.ModelsRemoveRequest} request + * @param {Models.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.ForbiddenError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.models.remove("248df4b7-aa70-47b8-a036-33ac447e668d", {}) + * await client.models.remove("248df4b7-aa70-47b8-a036-33ac447e668d") */ public async remove( id: string, @@ -518,7 +555,7 @@ export class Models { requestOptions?: Models.RequestOptions ): Promise { const { async } = request; - const _queryParams: Record = {}; + const _queryParams: Record = {}; if (async != null) { _queryParams["async"] = async.toString(); } @@ -526,7 +563,7 @@ export class Models { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/models/${id}` + `api/models/${encodeURIComponent(id)}` ), method: "DELETE", headers: { @@ -537,7 +574,7 @@ export class Models { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -545,6 +582,7 @@ export class Models { queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return; @@ -585,13 +623,18 @@ export class Models { /** * Returns sample records from the model. The first ten records that the source provides will be returned after being enriched (if applicable). Synchronous requests must complete within 10s. If either querying or enrichment exceeds 10s, please use the async option. + * + * @param {string} id + * @param {Polytomic.ModelsSampleRequest} request + * @param {Models.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.BadRequestError} * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.models.sample("248df4b7-aa70-47b8-a036-33ac447e668d", {}) + * await client.models.sample("248df4b7-aa70-47b8-a036-33ac447e668d") */ public async sample( id: string, @@ -599,7 +642,7 @@ export class Models { requestOptions?: Models.RequestOptions ): Promise { const { async } = request; - const _queryParams: Record = {}; + const _queryParams: Record = {}; if (async != null) { _queryParams["async"] = async.toString(); } @@ -607,7 +650,7 @@ export class Models { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/models/${id}/sample` + `api/models/${encodeURIComponent(id)}/sample` ), method: "GET", headers: { @@ -618,7 +661,7 @@ export class Models { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -626,6 +669,7 @@ export class Models { queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.ModelSampleResponseEnvelope; @@ -664,7 +708,7 @@ export class Models { } } - protected async _getAuthorizationHeader() { + protected async _getAuthorizationHeader(): Promise { return `Bearer ${await core.Supplier.get(this._options.token)}`; } } diff --git a/src/api/resources/models/client/requests/GetEnrichmentInputFieldsRequest.ts b/src/api/resources/models/client/requests/GetEnrichmentInputFieldsRequest.ts index a0d183d..95a49be 100644 --- a/src/api/resources/models/client/requests/GetEnrichmentInputFieldsRequest.ts +++ b/src/api/resources/models/client/requests/GetEnrichmentInputFieldsRequest.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from "../../../.."; +import * as Polytomic from "../../../../index"; /** * @example diff --git a/src/api/resources/models/client/requests/ModelsCreateRequest.ts b/src/api/resources/models/client/requests/ModelsCreateRequest.ts index 7ff169c..6e249db 100644 --- a/src/api/resources/models/client/requests/ModelsCreateRequest.ts +++ b/src/api/resources/models/client/requests/ModelsCreateRequest.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from "../../../.."; +import * as Polytomic from "../../../../index"; /** * @example diff --git a/src/api/resources/models/client/requests/ModelsPreviewRequest.ts b/src/api/resources/models/client/requests/ModelsPreviewRequest.ts index 7735194..42364de 100644 --- a/src/api/resources/models/client/requests/ModelsPreviewRequest.ts +++ b/src/api/resources/models/client/requests/ModelsPreviewRequest.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from "../../../.."; +import * as Polytomic from "../../../../index"; /** * @example diff --git a/src/api/resources/models/client/requests/UpdateModelRequest.ts b/src/api/resources/models/client/requests/UpdateModelRequest.ts index dc19f40..44f92d0 100644 --- a/src/api/resources/models/client/requests/UpdateModelRequest.ts +++ b/src/api/resources/models/client/requests/UpdateModelRequest.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from "../../../.."; +import * as Polytomic from "../../../../index"; /** * @example diff --git a/src/api/resources/models/client/requests/index.ts b/src/api/resources/models/client/requests/index.ts index 4a32148..7a52c8f 100644 --- a/src/api/resources/models/client/requests/index.ts +++ b/src/api/resources/models/client/requests/index.ts @@ -1,7 +1,7 @@ -export { GetEnrichmentInputFieldsRequest } from "./GetEnrichmentInputFieldsRequest"; -export { ModelsPreviewRequest } from "./ModelsPreviewRequest"; -export { ModelsCreateRequest } from "./ModelsCreateRequest"; -export { ModelsGetRequest } from "./ModelsGetRequest"; -export { UpdateModelRequest } from "./UpdateModelRequest"; -export { ModelsRemoveRequest } from "./ModelsRemoveRequest"; -export { ModelsSampleRequest } from "./ModelsSampleRequest"; +export { type GetEnrichmentInputFieldsRequest } from "./GetEnrichmentInputFieldsRequest"; +export { type ModelsPreviewRequest } from "./ModelsPreviewRequest"; +export { type ModelsCreateRequest } from "./ModelsCreateRequest"; +export { type ModelsGetRequest } from "./ModelsGetRequest"; +export { type UpdateModelRequest } from "./UpdateModelRequest"; +export { type ModelsRemoveRequest } from "./ModelsRemoveRequest"; +export { type ModelsSampleRequest } from "./ModelsSampleRequest"; diff --git a/src/api/resources/organization/client/Client.ts b/src/api/resources/organization/client/Client.ts index 0f08964..1b4af9e 100644 --- a/src/api/resources/organization/client/Client.ts +++ b/src/api/resources/organization/client/Client.ts @@ -4,9 +4,9 @@ import * as environments from "../../../../environments"; import * as core from "../../../../core"; -import * as Polytomic from "../../.."; +import * as Polytomic from "../../../index"; import urlJoin from "url-join"; -import * as errors from "../../../../errors"; +import * as errors from "../../../../errors/index"; export declare namespace Organization { interface Options { @@ -16,8 +16,14 @@ export declare namespace Organization { } interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the X-Polytomic-Version header */ + version?: string | undefined; } } @@ -28,11 +34,14 @@ export class Organization { * > 🚧 Requires partner key * > * > Organization endpoints are only accessible using [partner keys](https://apidocs.polytomic.com/getting-started/obtaining-api-keys#partner-keys) + * + * @param {Organization.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.organization.list() + * await client.organization.list() */ public async list(requestOptions?: Organization.RequestOptions): Promise { const _response = await core.fetcher({ @@ -49,13 +58,14 @@ export class Organization { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.OrganizationsEnvelope; @@ -94,12 +104,16 @@ export class Organization { * > 🚧 Requires partner key * > * > Organization endpoints are only accessible using [partner keys](https://apidocs.polytomic.com/getting-started/obtaining-api-keys#partner-keys) + * + * @param {Polytomic.CreateOrganizationRequestSchema} request + * @param {Organization.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.UnprocessableEntityError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.organization.create({ + * await client.organization.create({ * name: "My Organization" * }) */ @@ -121,7 +135,7 @@ export class Organization { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -129,6 +143,7 @@ export class Organization { body: request, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.OrganizationEnvelope; @@ -169,11 +184,15 @@ export class Organization { * > 🚧 Requires partner key * > * > Organization endpoints are only accessible using [partner keys](https://apidocs.polytomic.com/getting-started/obtaining-api-keys#partner-keys) + * + * @param {string} id + * @param {Organization.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * * @example - * await polytomic.organization.get("248df4b7-aa70-47b8-a036-33ac447e668d") + * await client.organization.get("248df4b7-aa70-47b8-a036-33ac447e668d") */ public async get( id: string, @@ -182,7 +201,7 @@ export class Organization { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/organizations/${id}` + `api/organizations/${encodeURIComponent(id)}` ), method: "GET", headers: { @@ -193,13 +212,14 @@ export class Organization { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.OrganizationEnvelope; @@ -238,12 +258,17 @@ export class Organization { * > 🚧 Requires partner key * > * > Organization endpoints are only accessible using [partner keys](https://apidocs.polytomic.com/getting-started/obtaining-api-keys#partner-keys) + * + * @param {string} id + * @param {Polytomic.UpdateOrganizationRequestSchema} request + * @param {Organization.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.UnprocessableEntityError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.organization.update("248df4b7-aa70-47b8-a036-33ac447e668d", { + * await client.organization.update("248df4b7-aa70-47b8-a036-33ac447e668d", { * name: "My Organization" * }) */ @@ -255,7 +280,7 @@ export class Organization { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/organizations/${id}` + `api/organizations/${encodeURIComponent(id)}` ), method: "PUT", headers: { @@ -266,7 +291,7 @@ export class Organization { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -274,6 +299,7 @@ export class Organization { body: request, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.OrganizationEnvelope; @@ -314,18 +340,22 @@ export class Organization { * > 🚧 Requires partner key * > * > Organization endpoints are only accessible using [partner keys](https://apidocs.polytomic.com/getting-started/obtaining-api-keys#partner-keys) + * + * @param {string} id + * @param {Organization.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.organization.remove("248df4b7-aa70-47b8-a036-33ac447e668d") + * await client.organization.remove("248df4b7-aa70-47b8-a036-33ac447e668d") */ public async remove(id: string, requestOptions?: Organization.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/organizations/${id}` + `api/organizations/${encodeURIComponent(id)}` ), method: "DELETE", headers: { @@ -336,13 +366,14 @@ export class Organization { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return; @@ -379,7 +410,7 @@ export class Organization { } } - protected async _getAuthorizationHeader() { + protected async _getAuthorizationHeader(): Promise { return `Bearer ${await core.Supplier.get(this._options.token)}`; } } diff --git a/src/api/resources/organization/client/requests/index.ts b/src/api/resources/organization/client/requests/index.ts index 0b05f27..49101f2 100644 --- a/src/api/resources/organization/client/requests/index.ts +++ b/src/api/resources/organization/client/requests/index.ts @@ -1,2 +1,2 @@ -export { CreateOrganizationRequestSchema } from "./CreateOrganizationRequestSchema"; -export { UpdateOrganizationRequestSchema } from "./UpdateOrganizationRequestSchema"; +export { type CreateOrganizationRequestSchema } from "./CreateOrganizationRequestSchema"; +export { type UpdateOrganizationRequestSchema } from "./UpdateOrganizationRequestSchema"; diff --git a/src/api/resources/permissions/client/Client.ts b/src/api/resources/permissions/client/Client.ts index 41be229..c62eccb 100644 --- a/src/api/resources/permissions/client/Client.ts +++ b/src/api/resources/permissions/client/Client.ts @@ -15,8 +15,14 @@ export declare namespace Permissions { } interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the X-Polytomic-Version header */ + version?: string | undefined; } } diff --git a/src/api/resources/permissions/resources/policies/client/Client.ts b/src/api/resources/permissions/resources/policies/client/Client.ts index 4d93e1a..c0c3b64 100644 --- a/src/api/resources/permissions/resources/policies/client/Client.ts +++ b/src/api/resources/permissions/resources/policies/client/Client.ts @@ -4,9 +4,9 @@ import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; -import * as Polytomic from "../../../../.."; +import * as Polytomic from "../../../../../index"; import urlJoin from "url-join"; -import * as errors from "../../../../../../errors"; +import * as errors from "../../../../../../errors/index"; export declare namespace Policies { interface Options { @@ -16,8 +16,14 @@ export declare namespace Policies { } interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the X-Polytomic-Version header */ + version?: string | undefined; } } @@ -25,11 +31,13 @@ export class Policies { constructor(protected readonly _options: Policies.Options) {} /** + * @param {Policies.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.permissions.policies.list() + * await client.permissions.policies.list() */ public async list(requestOptions?: Policies.RequestOptions): Promise { const _response = await core.fetcher({ @@ -46,13 +54,14 @@ export class Policies { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.ListPoliciesResponseEnvelope; @@ -88,6 +97,9 @@ export class Policies { } /** + * @param {Polytomic.permissions.CreatePolicyRequest} request + * @param {Policies.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.BadRequestError} * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.ForbiddenError} @@ -95,7 +107,7 @@ export class Policies { * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.permissions.policies.create({ + * await client.permissions.policies.create({ * name: "Custom" * }) */ @@ -117,7 +129,7 @@ export class Policies { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -125,6 +137,7 @@ export class Policies { body: request, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.PolicyResponseEnvelope; @@ -166,18 +179,21 @@ export class Policies { } /** + * @param {string} id + * @param {Policies.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.permissions.policies.get("248df4b7-aa70-47b8-a036-33ac447e668d") + * await client.permissions.policies.get("248df4b7-aa70-47b8-a036-33ac447e668d") */ public async get(id: string, requestOptions?: Policies.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/permissions/policies/${id}` + `api/permissions/policies/${encodeURIComponent(id)}` ), method: "GET", headers: { @@ -188,13 +204,14 @@ export class Policies { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.PolicyResponseEnvelope; @@ -232,6 +249,10 @@ export class Policies { } /** + * @param {string} id + * @param {Polytomic.permissions.UpdatePolicyRequest} request + * @param {Policies.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.BadRequestError} * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.ForbiddenError} @@ -239,7 +260,7 @@ export class Policies { * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.permissions.policies.update("248df4b7-aa70-47b8-a036-33ac447e668d", { + * await client.permissions.policies.update("248df4b7-aa70-47b8-a036-33ac447e668d", { * name: "Custom" * }) */ @@ -251,7 +272,7 @@ export class Policies { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/permissions/policies/${id}` + `api/permissions/policies/${encodeURIComponent(id)}` ), method: "PUT", headers: { @@ -262,7 +283,7 @@ export class Policies { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -270,6 +291,7 @@ export class Policies { body: request, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.PolicyResponseEnvelope; @@ -311,19 +333,22 @@ export class Policies { } /** + * @param {string} id + * @param {Policies.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.ForbiddenError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.permissions.policies.remove("248df4b7-aa70-47b8-a036-33ac447e668d") + * await client.permissions.policies.remove("248df4b7-aa70-47b8-a036-33ac447e668d") */ public async remove(id: string, requestOptions?: Policies.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/permissions/policies/${id}` + `api/permissions/policies/${encodeURIComponent(id)}` ), method: "DELETE", headers: { @@ -334,13 +359,14 @@ export class Policies { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return; @@ -379,7 +405,7 @@ export class Policies { } } - protected async _getAuthorizationHeader() { + protected async _getAuthorizationHeader(): Promise { return `Bearer ${await core.Supplier.get(this._options.token)}`; } } diff --git a/src/api/resources/permissions/resources/policies/client/requests/CreatePolicyRequest.ts b/src/api/resources/permissions/resources/policies/client/requests/CreatePolicyRequest.ts index 65a41f2..e902c08 100644 --- a/src/api/resources/permissions/resources/policies/client/requests/CreatePolicyRequest.ts +++ b/src/api/resources/permissions/resources/policies/client/requests/CreatePolicyRequest.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from "../../../../../.."; +import * as Polytomic from "../../../../../../index"; /** * @example diff --git a/src/api/resources/permissions/resources/policies/client/requests/UpdatePolicyRequest.ts b/src/api/resources/permissions/resources/policies/client/requests/UpdatePolicyRequest.ts index d0e28db..f9af880 100644 --- a/src/api/resources/permissions/resources/policies/client/requests/UpdatePolicyRequest.ts +++ b/src/api/resources/permissions/resources/policies/client/requests/UpdatePolicyRequest.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from "../../../../../.."; +import * as Polytomic from "../../../../../../index"; /** * @example diff --git a/src/api/resources/permissions/resources/policies/client/requests/index.ts b/src/api/resources/permissions/resources/policies/client/requests/index.ts index 31382fc..22e24c1 100644 --- a/src/api/resources/permissions/resources/policies/client/requests/index.ts +++ b/src/api/resources/permissions/resources/policies/client/requests/index.ts @@ -1,2 +1,2 @@ -export { CreatePolicyRequest } from "./CreatePolicyRequest"; -export { UpdatePolicyRequest } from "./UpdatePolicyRequest"; +export { type CreatePolicyRequest } from "./CreatePolicyRequest"; +export { type UpdatePolicyRequest } from "./UpdatePolicyRequest"; diff --git a/src/api/resources/permissions/resources/roles/client/Client.ts b/src/api/resources/permissions/resources/roles/client/Client.ts index b7d9fa0..15dc1aa 100644 --- a/src/api/resources/permissions/resources/roles/client/Client.ts +++ b/src/api/resources/permissions/resources/roles/client/Client.ts @@ -4,9 +4,9 @@ import * as environments from "../../../../../../environments"; import * as core from "../../../../../../core"; -import * as Polytomic from "../../../../.."; +import * as Polytomic from "../../../../../index"; import urlJoin from "url-join"; -import * as errors from "../../../../../../errors"; +import * as errors from "../../../../../../errors/index"; export declare namespace Roles { interface Options { @@ -16,8 +16,14 @@ export declare namespace Roles { } interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the X-Polytomic-Version header */ + version?: string | undefined; } } @@ -25,11 +31,13 @@ export class Roles { constructor(protected readonly _options: Roles.Options) {} /** + * @param {Roles.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.permissions.roles.list() + * await client.permissions.roles.list() */ public async list(requestOptions?: Roles.RequestOptions): Promise { const _response = await core.fetcher({ @@ -46,13 +54,14 @@ export class Roles { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.RoleListResponseEnvelope; @@ -88,6 +97,9 @@ export class Roles { } /** + * @param {Polytomic.permissions.CreateRoleRequest} request + * @param {Roles.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.BadRequestError} * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.ForbiddenError} @@ -95,7 +107,7 @@ export class Roles { * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.permissions.roles.create({ + * await client.permissions.roles.create({ * name: "Custom" * }) */ @@ -117,7 +129,7 @@ export class Roles { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -125,6 +137,7 @@ export class Roles { body: request, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.RoleResponseEnvelope; @@ -166,17 +179,20 @@ export class Roles { } /** + * @param {string} id + * @param {Roles.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * * @example - * await polytomic.permissions.roles.get("248df4b7-aa70-47b8-a036-33ac447e668d") + * await client.permissions.roles.get("248df4b7-aa70-47b8-a036-33ac447e668d") */ public async get(id: string, requestOptions?: Roles.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/permissions/roles/${id}` + `api/permissions/roles/${encodeURIComponent(id)}` ), method: "GET", headers: { @@ -187,13 +203,14 @@ export class Roles { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.RoleResponseEnvelope; @@ -229,6 +246,10 @@ export class Roles { } /** + * @param {string} id + * @param {Polytomic.permissions.UpdateRoleRequest} request + * @param {Roles.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.BadRequestError} * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.ForbiddenError} @@ -236,7 +257,7 @@ export class Roles { * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.permissions.roles.update("248df4b7-aa70-47b8-a036-33ac447e668d", { + * await client.permissions.roles.update("248df4b7-aa70-47b8-a036-33ac447e668d", { * name: "Custom" * }) */ @@ -248,7 +269,7 @@ export class Roles { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/permissions/roles/${id}` + `api/permissions/roles/${encodeURIComponent(id)}` ), method: "PUT", headers: { @@ -259,7 +280,7 @@ export class Roles { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -267,6 +288,7 @@ export class Roles { body: request, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.RoleResponseEnvelope; @@ -308,19 +330,22 @@ export class Roles { } /** + * @param {string} id + * @param {Roles.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.ForbiddenError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.permissions.roles.remove("248df4b7-aa70-47b8-a036-33ac447e668d") + * await client.permissions.roles.remove("248df4b7-aa70-47b8-a036-33ac447e668d") */ public async remove(id: string, requestOptions?: Roles.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/permissions/roles/${id}` + `api/permissions/roles/${encodeURIComponent(id)}` ), method: "DELETE", headers: { @@ -331,13 +356,14 @@ export class Roles { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return; @@ -376,7 +402,7 @@ export class Roles { } } - protected async _getAuthorizationHeader() { + protected async _getAuthorizationHeader(): Promise { return `Bearer ${await core.Supplier.get(this._options.token)}`; } } diff --git a/src/api/resources/permissions/resources/roles/client/requests/index.ts b/src/api/resources/permissions/resources/roles/client/requests/index.ts index 344f2f8..a10d79c 100644 --- a/src/api/resources/permissions/resources/roles/client/requests/index.ts +++ b/src/api/resources/permissions/resources/roles/client/requests/index.ts @@ -1,2 +1,2 @@ -export { CreateRoleRequest } from "./CreateRoleRequest"; -export { UpdateRoleRequest } from "./UpdateRoleRequest"; +export { type CreateRoleRequest } from "./CreateRoleRequest"; +export { type UpdateRoleRequest } from "./UpdateRoleRequest"; diff --git a/src/api/resources/queryRunner/client/Client.ts b/src/api/resources/queryRunner/client/Client.ts index 30c539f..8a2e6cc 100644 --- a/src/api/resources/queryRunner/client/Client.ts +++ b/src/api/resources/queryRunner/client/Client.ts @@ -4,9 +4,9 @@ import * as environments from "../../../../environments"; import * as core from "../../../../core"; -import * as Polytomic from "../../.."; +import * as Polytomic from "../../../index"; import urlJoin from "url-join"; -import * as errors from "../../../../errors"; +import * as errors from "../../../../errors/index"; export declare namespace QueryRunner { interface Options { @@ -16,8 +16,14 @@ export declare namespace QueryRunner { } interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the X-Polytomic-Version header */ + version?: string | undefined; } } @@ -25,13 +31,17 @@ export class QueryRunner { constructor(protected readonly _options: QueryRunner.Options) {} /** + * @param {string} connectionId + * @param {Polytomic.V4RunQueryRequest} request + * @param {QueryRunner.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.BadRequestError} * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.queryRunner.runQuery("248df4b7-aa70-47b8-a036-33ac447e668d", { + * await client.queryRunner.runQuery("248df4b7-aa70-47b8-a036-33ac447e668d", { * query: "SELECT * FROM table" * }) */ @@ -41,7 +51,7 @@ export class QueryRunner { requestOptions?: QueryRunner.RequestOptions ): Promise { const { query, ..._body } = request; - const _queryParams: Record = {}; + const _queryParams: Record = {}; if (query != null) { _queryParams["query"] = query; } @@ -49,7 +59,7 @@ export class QueryRunner { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/connections/${connectionId}/query` + `api/connections/${encodeURIComponent(connectionId)}/query` ), method: "POST", headers: { @@ -60,7 +70,7 @@ export class QueryRunner { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -69,6 +79,7 @@ export class QueryRunner { body: _body, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.V4RunQueryEnvelope; @@ -108,13 +119,17 @@ export class QueryRunner { } /** + * @param {string} id + * @param {Polytomic.QueryRunnerGetQueryRequest} request + * @param {QueryRunner.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.BadRequestError} * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.queryRunner.getQuery("248df4b7-aa70-47b8-a036-33ac447e668d", {}) + * await client.queryRunner.getQuery("248df4b7-aa70-47b8-a036-33ac447e668d") */ public async getQuery( id: string, @@ -122,7 +137,7 @@ export class QueryRunner { requestOptions?: QueryRunner.RequestOptions ): Promise { const { page } = request; - const _queryParams: Record = {}; + const _queryParams: Record = {}; if (page != null) { _queryParams["page"] = page; } @@ -130,7 +145,7 @@ export class QueryRunner { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/queries/${id}` + `api/queries/${encodeURIComponent(id)}` ), method: "GET", headers: { @@ -141,7 +156,7 @@ export class QueryRunner { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -149,6 +164,7 @@ export class QueryRunner { queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.V4QueryResultsEnvelope; @@ -187,7 +203,7 @@ export class QueryRunner { } } - protected async _getAuthorizationHeader() { + protected async _getAuthorizationHeader(): Promise { return `Bearer ${await core.Supplier.get(this._options.token)}`; } } diff --git a/src/api/resources/queryRunner/client/requests/index.ts b/src/api/resources/queryRunner/client/requests/index.ts index 8253304..d303d76 100644 --- a/src/api/resources/queryRunner/client/requests/index.ts +++ b/src/api/resources/queryRunner/client/requests/index.ts @@ -1,2 +1,2 @@ -export { V4RunQueryRequest } from "./V4RunQueryRequest"; -export { QueryRunnerGetQueryRequest } from "./QueryRunnerGetQueryRequest"; +export { type V4RunQueryRequest } from "./V4RunQueryRequest"; +export { type QueryRunnerGetQueryRequest } from "./QueryRunnerGetQueryRequest"; diff --git a/src/api/resources/schemas/client/Client.ts b/src/api/resources/schemas/client/Client.ts index 80e4cab..f4e71de 100644 --- a/src/api/resources/schemas/client/Client.ts +++ b/src/api/resources/schemas/client/Client.ts @@ -4,9 +4,9 @@ import * as environments from "../../../../environments"; import * as core from "../../../../core"; -import * as Polytomic from "../../.."; +import * as Polytomic from "../../../index"; import urlJoin from "url-join"; -import * as errors from "../../../../errors"; +import * as errors from "../../../../errors/index"; export declare namespace Schemas { interface Options { @@ -16,8 +16,14 @@ export declare namespace Schemas { } interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the X-Polytomic-Version header */ + version?: string | undefined; } } @@ -25,19 +31,22 @@ export class Schemas { constructor(protected readonly _options: Schemas.Options) {} /** + * @param {string} id + * @param {Schemas.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.BadRequestError} * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.schemas.refresh("248df4b7-aa70-47b8-a036-33ac447e668d") + * await client.schemas.refresh("248df4b7-aa70-47b8-a036-33ac447e668d") */ public async refresh(id: string, requestOptions?: Schemas.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/connections/${id}/schemas/refresh` + `api/connections/${encodeURIComponent(id)}/schemas/refresh` ), method: "POST", headers: { @@ -48,13 +57,14 @@ export class Schemas { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return; @@ -94,13 +104,16 @@ export class Schemas { } /** + * @param {string} id + * @param {Schemas.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.BadRequestError} * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.schemas.getStatus("248df4b7-aa70-47b8-a036-33ac447e668d") + * await client.schemas.getStatus("248df4b7-aa70-47b8-a036-33ac447e668d") */ public async getStatus( id: string, @@ -109,7 +122,7 @@ export class Schemas { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/connections/${id}/schemas/status` + `api/connections/${encodeURIComponent(id)}/schemas/status` ), method: "GET", headers: { @@ -120,13 +133,14 @@ export class Schemas { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.BulkSyncSourceStatusEnvelope; @@ -166,13 +180,17 @@ export class Schemas { } /** + * @param {string} id + * @param {string} schemaId + * @param {Schemas.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.BadRequestError} * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.schemas.get("248df4b7-aa70-47b8-a036-33ac447e668d", "public.users") + * await client.schemas.get("248df4b7-aa70-47b8-a036-33ac447e668d", "public.users") */ public async get( id: string, @@ -182,7 +200,7 @@ export class Schemas { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/connections/${id}/schemas/${schemaId}` + `api/connections/${encodeURIComponent(id)}/schemas/${encodeURIComponent(schemaId)}` ), method: "GET", headers: { @@ -193,13 +211,14 @@ export class Schemas { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.BulkSyncSourceSchemaEnvelope; @@ -239,6 +258,10 @@ export class Schemas { } /** + * @param {string} id + * @param {string} schemaId + * @param {Schemas.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.BadRequestError} * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.ForbiddenError} @@ -246,7 +269,7 @@ export class Schemas { * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.schemas.getRecords("248df4b7-aa70-47b8-a036-33ac447e668d", "public.users") + * await client.schemas.getRecords("248df4b7-aa70-47b8-a036-33ac447e668d", "public.users") */ public async getRecords( id: string, @@ -256,7 +279,7 @@ export class Schemas { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/connections/${id}/schemas/${schemaId}/records` + `api/connections/${encodeURIComponent(id)}/schemas/${encodeURIComponent(schemaId)}/records` ), method: "GET", headers: { @@ -267,13 +290,14 @@ export class Schemas { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.SchemaRecordsResponseEnvelope; @@ -314,7 +338,7 @@ export class Schemas { } } - protected async _getAuthorizationHeader() { + protected async _getAuthorizationHeader(): Promise { return `Bearer ${await core.Supplier.get(this._options.token)}`; } } diff --git a/src/api/resources/users/client/Client.ts b/src/api/resources/users/client/Client.ts index d1bd199..a97f142 100644 --- a/src/api/resources/users/client/Client.ts +++ b/src/api/resources/users/client/Client.ts @@ -4,9 +4,9 @@ import * as environments from "../../../../environments"; import * as core from "../../../../core"; -import * as Polytomic from "../../.."; +import * as Polytomic from "../../../index"; import urlJoin from "url-join"; -import * as errors from "../../../../errors"; +import * as errors from "../../../../errors/index"; export declare namespace Users { interface Options { @@ -16,8 +16,14 @@ export declare namespace Users { } interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the X-Polytomic-Version header */ + version?: string | undefined; } } @@ -28,17 +34,21 @@ export class Users { * > 🚧 Requires partner key * > * > User endpoints are only accessible using [partner keys](https://apidocs.polytomic.com/getting-started/obtaining-api-keys#partner-keys) + * + * @param {string} orgId + * @param {Users.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * * @example - * await polytomic.users.list("248df4b7-aa70-47b8-a036-33ac447e668d") + * await client.users.list("248df4b7-aa70-47b8-a036-33ac447e668d") */ public async list(orgId: string, requestOptions?: Users.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/organizations/${orgId}/users` + `api/organizations/${encodeURIComponent(orgId)}/users` ), method: "GET", headers: { @@ -49,13 +59,14 @@ export class Users { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.ListUsersEnvelope; @@ -94,12 +105,17 @@ export class Users { * > 🚧 Requires partner key * > * > User endpoints are only accessible using [partner keys](https://apidocs.polytomic.com/getting-started/obtaining-api-keys#partner-keys) + * + * @param {string} orgId + * @param {Polytomic.CreateUserRequestSchema} request + * @param {Users.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.UnprocessableEntityError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.users.create("248df4b7-aa70-47b8-a036-33ac447e668d", { + * await client.users.create("248df4b7-aa70-47b8-a036-33ac447e668d", { * email: "mail@example.com" * }) */ @@ -111,7 +127,7 @@ export class Users { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/organizations/${orgId}/users` + `api/organizations/${encodeURIComponent(orgId)}/users` ), method: "POST", headers: { @@ -122,7 +138,7 @@ export class Users { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -130,6 +146,7 @@ export class Users { body: request, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.UserEnvelope; @@ -170,12 +187,17 @@ export class Users { * > 🚧 Requires partner key * > * > User endpoints are only accessible using [partner keys](https://apidocs.polytomic.com/getting-started/obtaining-api-keys#partner-keys) + * + * @param {string} id + * @param {string} orgId + * @param {Users.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.users.get("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d") + * await client.users.get("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d") */ public async get( id: string, @@ -185,7 +207,7 @@ export class Users { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/organizations/${orgId}/users/${id}` + `api/organizations/${encodeURIComponent(orgId)}/users/${encodeURIComponent(id)}` ), method: "GET", headers: { @@ -196,13 +218,14 @@ export class Users { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.UserEnvelope; @@ -243,12 +266,18 @@ export class Users { * > 🚧 Requires partner key * > * > User endpoints are only accessible using [partner keys](https://apidocs.polytomic.com/getting-started/obtaining-api-keys#partner-keys) + * + * @param {string} id + * @param {string} orgId + * @param {Polytomic.UpdateUserRequestSchema} request + * @param {Users.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.UnprocessableEntityError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.users.update("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d", { + * await client.users.update("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d", { * email: "mail@example.com" * }) */ @@ -261,7 +290,7 @@ export class Users { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/organizations/${orgId}/users/${id}` + `api/organizations/${encodeURIComponent(orgId)}/users/${encodeURIComponent(id)}` ), method: "PUT", headers: { @@ -272,7 +301,7 @@ export class Users { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -280,6 +309,7 @@ export class Users { body: request, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.UserEnvelope; @@ -320,12 +350,17 @@ export class Users { * > 🚧 Requires partner key * > * > User endpoints are only accessible using [partner keys](https://apidocs.polytomic.com/getting-started/obtaining-api-keys#partner-keys) + * + * @param {string} id + * @param {string} orgId + * @param {Users.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.users.remove("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d") + * await client.users.remove("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d") */ public async remove( id: string, @@ -335,7 +370,7 @@ export class Users { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/organizations/${orgId}/users/${id}` + `api/organizations/${encodeURIComponent(orgId)}/users/${encodeURIComponent(id)}` ), method: "DELETE", headers: { @@ -346,13 +381,14 @@ export class Users { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.UserEnvelope; @@ -393,12 +429,18 @@ export class Users { * > 🚧 Requires partner key * > * > User endpoints are only accessible using [partner keys](https://apidocs.polytomic.com/getting-started/obtaining-api-keys#partner-keys) + * + * @param {string} orgId + * @param {string} id + * @param {Polytomic.UsersCreateApiKeyRequest} request + * @param {Users.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.users.createApiKey("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d", { + * await client.users.createApiKey("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d", { * force: true * }) */ @@ -409,7 +451,7 @@ export class Users { requestOptions?: Users.RequestOptions ): Promise { const { force } = request; - const _queryParams: Record = {}; + const _queryParams: Record = {}; if (force != null) { _queryParams["force"] = force.toString(); } @@ -417,7 +459,7 @@ export class Users { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/organizations/${orgId}/users/${id}/keys` + `api/organizations/${encodeURIComponent(orgId)}/users/${encodeURIComponent(id)}/keys` ), method: "POST", headers: { @@ -428,7 +470,7 @@ export class Users { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -436,6 +478,7 @@ export class Users { queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.ApiKeyResponseEnvelope; @@ -472,7 +515,7 @@ export class Users { } } - protected async _getAuthorizationHeader() { + protected async _getAuthorizationHeader(): Promise { return `Bearer ${await core.Supplier.get(this._options.token)}`; } } diff --git a/src/api/resources/users/client/requests/index.ts b/src/api/resources/users/client/requests/index.ts index 4ec57ee..e1d3dd7 100644 --- a/src/api/resources/users/client/requests/index.ts +++ b/src/api/resources/users/client/requests/index.ts @@ -1,3 +1,3 @@ -export { CreateUserRequestSchema } from "./CreateUserRequestSchema"; -export { UpdateUserRequestSchema } from "./UpdateUserRequestSchema"; -export { UsersCreateApiKeyRequest } from "./UsersCreateApiKeyRequest"; +export { type CreateUserRequestSchema } from "./CreateUserRequestSchema"; +export { type UpdateUserRequestSchema } from "./UpdateUserRequestSchema"; +export { type UsersCreateApiKeyRequest } from "./UsersCreateApiKeyRequest"; diff --git a/src/api/resources/webhooks/client/Client.ts b/src/api/resources/webhooks/client/Client.ts index b70873c..86a17f3 100644 --- a/src/api/resources/webhooks/client/Client.ts +++ b/src/api/resources/webhooks/client/Client.ts @@ -4,9 +4,9 @@ import * as environments from "../../../../environments"; import * as core from "../../../../core"; -import * as Polytomic from "../../.."; +import * as Polytomic from "../../../index"; import urlJoin from "url-join"; -import * as errors from "../../../../errors"; +import * as errors from "../../../../errors/index"; export declare namespace Webhooks { interface Options { @@ -16,8 +16,14 @@ export declare namespace Webhooks { } interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Override the X-Polytomic-Version header */ + version?: string | undefined; } } @@ -30,11 +36,14 @@ export class Webhooks { * in that organization. * * Consult the [Events documentation](https://apidocs.polytomic.com/getting-started/events) for more information. + * + * @param {Webhooks.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.webhooks.list() + * await client.webhooks.list() */ public async list(requestOptions?: Webhooks.RequestOptions): Promise { const _response = await core.fetcher({ @@ -51,13 +60,14 @@ export class Webhooks { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.WebhookListEnvelope; @@ -98,12 +108,16 @@ export class Webhooks { * in that organization. * * Consult the [Events documentation](https://apidocs.polytomic.com/getting-started/events) for more information. + * + * @param {Polytomic.CreateWebhooksSchema} request + * @param {Webhooks.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.UnprocessableEntityError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.webhooks.create({ + * await client.webhooks.create({ * endpoint: "https://example.com/webhook", * secret: "secret" * }) @@ -126,7 +140,7 @@ export class Webhooks { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -134,6 +148,7 @@ export class Webhooks { body: request, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.WebhookEnvelope; @@ -176,17 +191,21 @@ export class Webhooks { * in that organization. * * Consult the [Events documentation](https://apidocs.polytomic.com/getting-started/events) for more information. + * + * @param {string} id + * @param {Webhooks.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * * @example - * await polytomic.webhooks.get("248df4b7-aa70-47b8-a036-33ac447e668d") + * await client.webhooks.get("248df4b7-aa70-47b8-a036-33ac447e668d") */ public async get(id: string, requestOptions?: Webhooks.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/webhooks/${id}` + `api/webhooks/${encodeURIComponent(id)}` ), method: "GET", headers: { @@ -197,13 +216,14 @@ export class Webhooks { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.WebhookEnvelope; @@ -244,12 +264,17 @@ export class Webhooks { * in that organization. * * Consult the [Events documentation](https://apidocs.polytomic.com/getting-started/events) for more information. + * + * @param {string} id + * @param {Polytomic.UpdateWebhooksSchema} request + * @param {Webhooks.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.UnprocessableEntityError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.webhooks.update("248df4b7-aa70-47b8-a036-33ac447e668d", { + * await client.webhooks.update("248df4b7-aa70-47b8-a036-33ac447e668d", { * endpoint: "https://example.com/webhook", * secret: "secret" * }) @@ -262,7 +287,7 @@ export class Webhooks { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/webhooks/${id}` + `api/webhooks/${encodeURIComponent(id)}` ), method: "PUT", headers: { @@ -273,7 +298,7 @@ export class Webhooks { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -281,6 +306,7 @@ export class Webhooks { body: request, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return _response.body as Polytomic.WebhookEnvelope; @@ -318,18 +344,21 @@ export class Webhooks { } /** + * @param {string} id + * @param {Webhooks.RequestOptions} requestOptions - Request-specific configuration. + * * @throws {@link Polytomic.UnauthorizedError} * @throws {@link Polytomic.NotFoundError} * @throws {@link Polytomic.InternalServerError} * * @example - * await polytomic.webhooks.remove("248df4b7-aa70-47b8-a036-33ac447e668d") + * await client.webhooks.remove("248df4b7-aa70-47b8-a036-33ac447e668d") */ public async remove(id: string, requestOptions?: Webhooks.RequestOptions): Promise { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.PolytomicEnvironment.Default, - `api/webhooks/${id}` + `api/webhooks/${encodeURIComponent(id)}` ), method: "DELETE", headers: { @@ -340,13 +369,14 @@ export class Webhooks { : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", - "X-Fern-SDK-Version": "1.8.0", + "X-Fern-SDK-Version": "1.8.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return; @@ -383,7 +413,7 @@ export class Webhooks { } } - protected async _getAuthorizationHeader() { + protected async _getAuthorizationHeader(): Promise { return `Bearer ${await core.Supplier.get(this._options.token)}`; } } diff --git a/src/api/resources/webhooks/client/requests/index.ts b/src/api/resources/webhooks/client/requests/index.ts index 2006800..a601173 100644 --- a/src/api/resources/webhooks/client/requests/index.ts +++ b/src/api/resources/webhooks/client/requests/index.ts @@ -1,2 +1,2 @@ -export { CreateWebhooksSchema } from "./CreateWebhooksSchema"; -export { UpdateWebhooksSchema } from "./UpdateWebhooksSchema"; +export { type CreateWebhooksSchema } from "./CreateWebhooksSchema"; +export { type UpdateWebhooksSchema } from "./UpdateWebhooksSchema"; diff --git a/src/api/types/ActivateSyncEnvelope.ts b/src/api/types/ActivateSyncEnvelope.ts index 21f3b98..0388dd8 100644 --- a/src/api/types/ActivateSyncEnvelope.ts +++ b/src/api/types/ActivateSyncEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface ActivateSyncEnvelope { data?: Polytomic.ActivateSyncOutput; diff --git a/src/api/types/ApiKeyResponseEnvelope.ts b/src/api/types/ApiKeyResponseEnvelope.ts index cee4b62..b53c6ee 100644 --- a/src/api/types/ApiKeyResponseEnvelope.ts +++ b/src/api/types/ApiKeyResponseEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface ApiKeyResponseEnvelope { data?: Polytomic.ApiKeyResponse; diff --git a/src/api/types/BulkFilter.ts b/src/api/types/BulkFilter.ts index e71e869..cf58f0f 100644 --- a/src/api/types/BulkFilter.ts +++ b/src/api/types/BulkFilter.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface BulkFilter { /** Schema field ID to filter on. */ diff --git a/src/api/types/BulkItemizedSchedule.ts b/src/api/types/BulkItemizedSchedule.ts index 8ca396f..9198d39 100644 --- a/src/api/types/BulkItemizedSchedule.ts +++ b/src/api/types/BulkItemizedSchedule.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface BulkItemizedSchedule { item: Polytomic.BulkSelectiveMode; diff --git a/src/api/types/BulkMultiScheduleConfiguration.ts b/src/api/types/BulkMultiScheduleConfiguration.ts index 6325df2..9482483 100644 --- a/src/api/types/BulkMultiScheduleConfiguration.ts +++ b/src/api/types/BulkMultiScheduleConfiguration.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface BulkMultiScheduleConfiguration { schedules?: Polytomic.BulkItemizedSchedule[]; diff --git a/src/api/types/BulkSchedule.ts b/src/api/types/BulkSchedule.ts index beca9d4..cf61ceb 100644 --- a/src/api/types/BulkSchedule.ts +++ b/src/api/types/BulkSchedule.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface BulkSchedule { day_of_month?: string; diff --git a/src/api/types/BulkSchema.ts b/src/api/types/BulkSchema.ts index 2ee9a36..7a46ac6 100644 --- a/src/api/types/BulkSchema.ts +++ b/src/api/types/BulkSchema.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface BulkSchema { enabled?: boolean; diff --git a/src/api/types/BulkSchemaEnvelope.ts b/src/api/types/BulkSchemaEnvelope.ts index 3176fee..f21a39c 100644 --- a/src/api/types/BulkSchemaEnvelope.ts +++ b/src/api/types/BulkSchemaEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface BulkSchemaEnvelope { data?: Polytomic.BulkSchema; diff --git a/src/api/types/BulkSyncDest.ts b/src/api/types/BulkSyncDest.ts index 401164a..360b5df 100644 --- a/src/api/types/BulkSyncDest.ts +++ b/src/api/types/BulkSyncDest.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface BulkSyncDest { configuration?: Record; diff --git a/src/api/types/BulkSyncDestEnvelope.ts b/src/api/types/BulkSyncDestEnvelope.ts index a2cbdef..37f3738 100644 --- a/src/api/types/BulkSyncDestEnvelope.ts +++ b/src/api/types/BulkSyncDestEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface BulkSyncDestEnvelope { data?: Polytomic.BulkSyncDest; diff --git a/src/api/types/BulkSyncExecution.ts b/src/api/types/BulkSyncExecution.ts index dc1a32f..5e80695 100644 --- a/src/api/types/BulkSyncExecution.ts +++ b/src/api/types/BulkSyncExecution.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface BulkSyncExecution { completed_at?: string; diff --git a/src/api/types/BulkSyncExecutionEnvelope.ts b/src/api/types/BulkSyncExecutionEnvelope.ts index c162dba..e6ed607 100644 --- a/src/api/types/BulkSyncExecutionEnvelope.ts +++ b/src/api/types/BulkSyncExecutionEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface BulkSyncExecutionEnvelope { data?: Polytomic.BulkSyncExecution; diff --git a/src/api/types/BulkSyncExecutionStatus.ts b/src/api/types/BulkSyncExecutionStatus.ts index b63f177..2c467da 100644 --- a/src/api/types/BulkSyncExecutionStatus.ts +++ b/src/api/types/BulkSyncExecutionStatus.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface BulkSyncExecutionStatus { nextExecutionTime?: string; diff --git a/src/api/types/BulkSyncListEnvelope.ts b/src/api/types/BulkSyncListEnvelope.ts index 6e00d35..335a80f 100644 --- a/src/api/types/BulkSyncListEnvelope.ts +++ b/src/api/types/BulkSyncListEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface BulkSyncListEnvelope { data?: Polytomic.BulkSyncResponse[]; diff --git a/src/api/types/BulkSyncResponse.ts b/src/api/types/BulkSyncResponse.ts index 4e75566..671f815 100644 --- a/src/api/types/BulkSyncResponse.ts +++ b/src/api/types/BulkSyncResponse.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface BulkSyncResponse { active?: boolean; diff --git a/src/api/types/BulkSyncResponseEnvelope.ts b/src/api/types/BulkSyncResponseEnvelope.ts index f6e5101..7b787e8 100644 --- a/src/api/types/BulkSyncResponseEnvelope.ts +++ b/src/api/types/BulkSyncResponseEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface BulkSyncResponseEnvelope { data?: Polytomic.BulkSyncResponse; diff --git a/src/api/types/BulkSyncSchemaExecution.ts b/src/api/types/BulkSyncSchemaExecution.ts index 1d608ec..8e78ea6 100644 --- a/src/api/types/BulkSyncSchemaExecution.ts +++ b/src/api/types/BulkSyncSchemaExecution.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface BulkSyncSchemaExecution { completed_at?: string; diff --git a/src/api/types/BulkSyncSchemaExecutionStatus.ts b/src/api/types/BulkSyncSchemaExecutionStatus.ts index 8b2de76..6c4d9dc 100644 --- a/src/api/types/BulkSyncSchemaExecutionStatus.ts +++ b/src/api/types/BulkSyncSchemaExecutionStatus.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface BulkSyncSchemaExecutionStatus { completed_at?: string; diff --git a/src/api/types/BulkSyncSource.ts b/src/api/types/BulkSyncSource.ts index 4a389f6..530c924 100644 --- a/src/api/types/BulkSyncSource.ts +++ b/src/api/types/BulkSyncSource.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface BulkSyncSource { configuration?: unknown; diff --git a/src/api/types/BulkSyncSourceEnvelope.ts b/src/api/types/BulkSyncSourceEnvelope.ts index fa074c6..c3fa16c 100644 --- a/src/api/types/BulkSyncSourceEnvelope.ts +++ b/src/api/types/BulkSyncSourceEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface BulkSyncSourceEnvelope { data?: Polytomic.BulkSyncSource; diff --git a/src/api/types/BulkSyncSourceSchemaEnvelope.ts b/src/api/types/BulkSyncSourceSchemaEnvelope.ts index 30481cc..7251038 100644 --- a/src/api/types/BulkSyncSourceSchemaEnvelope.ts +++ b/src/api/types/BulkSyncSourceSchemaEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface BulkSyncSourceSchemaEnvelope { data?: Polytomic.Schema; diff --git a/src/api/types/BulkSyncSourceStatusEnvelope.ts b/src/api/types/BulkSyncSourceStatusEnvelope.ts index 96e58c4..63ccbf1 100644 --- a/src/api/types/BulkSyncSourceStatusEnvelope.ts +++ b/src/api/types/BulkSyncSourceStatusEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface BulkSyncSourceStatusEnvelope { data?: Polytomic.BulkSyncSourceStatus; diff --git a/src/api/types/BulkSyncStatusEnvelope.ts b/src/api/types/BulkSyncStatusEnvelope.ts index 54f134f..d5ef379 100644 --- a/src/api/types/BulkSyncStatusEnvelope.ts +++ b/src/api/types/BulkSyncStatusEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface BulkSyncStatusEnvelope { data?: Polytomic.BulkSyncStatusResponse; diff --git a/src/api/types/BulkSyncStatusResponse.ts b/src/api/types/BulkSyncStatusResponse.ts index 07cd5d5..b994488 100644 --- a/src/api/types/BulkSyncStatusResponse.ts +++ b/src/api/types/BulkSyncStatusResponse.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface BulkSyncStatusResponse { current_execution?: Polytomic.BulkSyncExecution; diff --git a/src/api/types/ConnectCardResponseEnvelope.ts b/src/api/types/ConnectCardResponseEnvelope.ts index 0dbcb5c..e7f23a4 100644 --- a/src/api/types/ConnectCardResponseEnvelope.ts +++ b/src/api/types/ConnectCardResponseEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface ConnectCardResponseEnvelope { data?: Polytomic.ConnectCardResponse; diff --git a/src/api/types/ConnectionListResponseEnvelope.ts b/src/api/types/ConnectionListResponseEnvelope.ts index 4159d0a..c86846e 100644 --- a/src/api/types/ConnectionListResponseEnvelope.ts +++ b/src/api/types/ConnectionListResponseEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface ConnectionListResponseEnvelope { data?: Polytomic.ConnectionResponseSchema[]; diff --git a/src/api/types/ConnectionMetaResponse.ts b/src/api/types/ConnectionMetaResponse.ts index 9428a06..b92aa75 100644 --- a/src/api/types/ConnectionMetaResponse.ts +++ b/src/api/types/ConnectionMetaResponse.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface ConnectionMetaResponse { configuration?: Record; diff --git a/src/api/types/ConnectionParameterValuesResp.ts b/src/api/types/ConnectionParameterValuesResp.ts index 9aca2bb..4be59f8 100644 --- a/src/api/types/ConnectionParameterValuesResp.ts +++ b/src/api/types/ConnectionParameterValuesResp.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface ConnectionParameterValuesResp { allows_creation?: boolean; diff --git a/src/api/types/ConnectionParameterValuesResponseEnvelope.ts b/src/api/types/ConnectionParameterValuesResponseEnvelope.ts index 9c86e75..9f08cc9 100644 --- a/src/api/types/ConnectionParameterValuesResponseEnvelope.ts +++ b/src/api/types/ConnectionParameterValuesResponseEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface ConnectionParameterValuesResponseEnvelope { data?: Record; diff --git a/src/api/types/ConnectionResponseEnvelope.ts b/src/api/types/ConnectionResponseEnvelope.ts index ed516cb..5693e7a 100644 --- a/src/api/types/ConnectionResponseEnvelope.ts +++ b/src/api/types/ConnectionResponseEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface ConnectionResponseEnvelope { data?: Polytomic.ConnectionResponseSchema; diff --git a/src/api/types/ConnectionResponseSchema.ts b/src/api/types/ConnectionResponseSchema.ts index 015db6e..7dc48ad 100644 --- a/src/api/types/ConnectionResponseSchema.ts +++ b/src/api/types/ConnectionResponseSchema.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface ConnectionResponseSchema { /** API calls made to service in the last 24h (supported integrations only). */ diff --git a/src/api/types/ConnectionTypeResponseEnvelope.ts b/src/api/types/ConnectionTypeResponseEnvelope.ts index fce96b7..e247f50 100644 --- a/src/api/types/ConnectionTypeResponseEnvelope.ts +++ b/src/api/types/ConnectionTypeResponseEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface ConnectionTypeResponseEnvelope { data?: Polytomic.ConnectionType[]; diff --git a/src/api/types/CreateConnectionResponseEnvelope.ts b/src/api/types/CreateConnectionResponseEnvelope.ts index f533de3..1d1b416 100644 --- a/src/api/types/CreateConnectionResponseEnvelope.ts +++ b/src/api/types/CreateConnectionResponseEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface CreateConnectionResponseEnvelope { data?: Polytomic.CreateConnectionResponseSchema; diff --git a/src/api/types/CreateConnectionResponseSchema.ts b/src/api/types/CreateConnectionResponseSchema.ts index 292e956..df42786 100644 --- a/src/api/types/CreateConnectionResponseSchema.ts +++ b/src/api/types/CreateConnectionResponseSchema.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface CreateConnectionResponseSchema { /** Code to enter in order to complete connection authentication. */ diff --git a/src/api/types/CreateModelRequest.ts b/src/api/types/CreateModelRequest.ts index f5d1d09..cca7dbb 100644 --- a/src/api/types/CreateModelRequest.ts +++ b/src/api/types/CreateModelRequest.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface CreateModelRequest { additional_fields?: Polytomic.ModelModelFieldRequest[]; diff --git a/src/api/types/Enrichment.ts b/src/api/types/Enrichment.ts index e802e81..b424fb7 100644 --- a/src/api/types/Enrichment.ts +++ b/src/api/types/Enrichment.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface Enrichment { configuration?: Polytomic.V2EnricherConfiguration; diff --git a/src/api/types/Event.ts b/src/api/types/Event.ts index 1cf4e24..aea0bbd 100644 --- a/src/api/types/Event.ts +++ b/src/api/types/Event.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface Event { created_at?: string; diff --git a/src/api/types/EventBody.ts b/src/api/types/EventBody.ts index e2c6902..71f4084 100644 --- a/src/api/types/EventBody.ts +++ b/src/api/types/EventBody.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export type EventBody = | Polytomic.SyncRunningEvent diff --git a/src/api/types/EventsEnvelope.ts b/src/api/types/EventsEnvelope.ts index efc87a5..9a1a16b 100644 --- a/src/api/types/EventsEnvelope.ts +++ b/src/api/types/EventsEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface EventsEnvelope { data?: Polytomic.Event[]; diff --git a/src/api/types/ExecutionLogsResponseEnvelope.ts b/src/api/types/ExecutionLogsResponseEnvelope.ts index e0efa6d..434e292 100644 --- a/src/api/types/ExecutionLogsResponseEnvelope.ts +++ b/src/api/types/ExecutionLogsResponseEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface ExecutionLogsResponseEnvelope { data?: Polytomic.ExecutionLogResponse; diff --git a/src/api/types/Filter.ts b/src/api/types/Filter.ts index a341674..f4f44f3 100644 --- a/src/api/types/Filter.ts +++ b/src/api/types/Filter.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; /** * Either `field` or `field_id` must be provided. If `field` is provided, `field_id` is ignored. diff --git a/src/api/types/GetConnectionMetaEnvelope.ts b/src/api/types/GetConnectionMetaEnvelope.ts index 63aa1d1..4441956 100644 --- a/src/api/types/GetConnectionMetaEnvelope.ts +++ b/src/api/types/GetConnectionMetaEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface GetConnectionMetaEnvelope { data?: Polytomic.ConnectionMetaResponse; diff --git a/src/api/types/GetExecutionResponseEnvelope.ts b/src/api/types/GetExecutionResponseEnvelope.ts index 8855981..0fa26cf 100644 --- a/src/api/types/GetExecutionResponseEnvelope.ts +++ b/src/api/types/GetExecutionResponseEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface GetExecutionResponseEnvelope { data?: Polytomic.GetExecutionResponseSchema; diff --git a/src/api/types/GetExecutionResponseSchema.ts b/src/api/types/GetExecutionResponseSchema.ts index 1be11d5..e511472 100644 --- a/src/api/types/GetExecutionResponseSchema.ts +++ b/src/api/types/GetExecutionResponseSchema.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface GetExecutionResponseSchema { completed_at?: string; diff --git a/src/api/types/GetIdentityResponseEnvelope.ts b/src/api/types/GetIdentityResponseEnvelope.ts index f612057..f69a578 100644 --- a/src/api/types/GetIdentityResponseEnvelope.ts +++ b/src/api/types/GetIdentityResponseEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface GetIdentityResponseEnvelope { data?: Polytomic.GetIdentityResponseSchema; diff --git a/src/api/types/GetModelSyncSourceMetaEnvelope.ts b/src/api/types/GetModelSyncSourceMetaEnvelope.ts index 813627f..e1acbab 100644 --- a/src/api/types/GetModelSyncSourceMetaEnvelope.ts +++ b/src/api/types/GetModelSyncSourceMetaEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface GetModelSyncSourceMetaEnvelope { data?: Polytomic.ModelSyncSourceMetaResponse; diff --git a/src/api/types/Identity.ts b/src/api/types/Identity.ts index 9d9c223..f184eb4 100644 --- a/src/api/types/Identity.ts +++ b/src/api/types/Identity.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface Identity { function: Polytomic.SchemaIdentityFunction; diff --git a/src/api/types/JobResponse.ts b/src/api/types/JobResponse.ts index b16b0e1..43d294b 100644 --- a/src/api/types/JobResponse.ts +++ b/src/api/types/JobResponse.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface JobResponse { error?: string; diff --git a/src/api/types/JobResponseEnvelope.ts b/src/api/types/JobResponseEnvelope.ts index e042bc6..8b8d6fd 100644 --- a/src/api/types/JobResponseEnvelope.ts +++ b/src/api/types/JobResponseEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface JobResponseEnvelope { data?: Polytomic.JobResponse; diff --git a/src/api/types/ListBulkSchema.ts b/src/api/types/ListBulkSchema.ts index 073eea7..a3d511d 100644 --- a/src/api/types/ListBulkSchema.ts +++ b/src/api/types/ListBulkSchema.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface ListBulkSchema { data?: Polytomic.BulkSchema[]; diff --git a/src/api/types/ListBulkSyncExecutionStatusEnvelope.ts b/src/api/types/ListBulkSyncExecutionStatusEnvelope.ts index 4f0408a..001a8f7 100644 --- a/src/api/types/ListBulkSyncExecutionStatusEnvelope.ts +++ b/src/api/types/ListBulkSyncExecutionStatusEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface ListBulkSyncExecutionStatusEnvelope { data?: Polytomic.BulkSyncExecutionStatus[]; diff --git a/src/api/types/ListBulkSyncExecutionsEnvelope.ts b/src/api/types/ListBulkSyncExecutionsEnvelope.ts index f8f735a..93d42c0 100644 --- a/src/api/types/ListBulkSyncExecutionsEnvelope.ts +++ b/src/api/types/ListBulkSyncExecutionsEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface ListBulkSyncExecutionsEnvelope { data?: Polytomic.BulkSyncExecution[]; diff --git a/src/api/types/ListExecutionResponseEnvelope.ts b/src/api/types/ListExecutionResponseEnvelope.ts index d875571..0f90e45 100644 --- a/src/api/types/ListExecutionResponseEnvelope.ts +++ b/src/api/types/ListExecutionResponseEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface ListExecutionResponseEnvelope { data?: Polytomic.GetExecutionResponseSchema[]; diff --git a/src/api/types/ListModelSyncResponseEnvelope.ts b/src/api/types/ListModelSyncResponseEnvelope.ts index 809b05b..aba77ad 100644 --- a/src/api/types/ListModelSyncResponseEnvelope.ts +++ b/src/api/types/ListModelSyncResponseEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface ListModelSyncResponseEnvelope { data?: Polytomic.ModelSyncResponse[]; diff --git a/src/api/types/ListPoliciesResponseEnvelope.ts b/src/api/types/ListPoliciesResponseEnvelope.ts index 120a3ee..aa514e0 100644 --- a/src/api/types/ListPoliciesResponseEnvelope.ts +++ b/src/api/types/ListPoliciesResponseEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface ListPoliciesResponseEnvelope { data?: Polytomic.PolicyResponse[]; diff --git a/src/api/types/ListUsersEnvelope.ts b/src/api/types/ListUsersEnvelope.ts index 1001db2..af5c6e3 100644 --- a/src/api/types/ListUsersEnvelope.ts +++ b/src/api/types/ListUsersEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface ListUsersEnvelope { data?: Polytomic.User[]; diff --git a/src/api/types/ModelFieldResponse.ts b/src/api/types/ModelFieldResponse.ts index c10d3b7..c9b9fcc 100644 --- a/src/api/types/ModelFieldResponse.ts +++ b/src/api/types/ModelFieldResponse.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface ModelFieldResponse { data?: Polytomic.ModelField[]; diff --git a/src/api/types/ModelListResponseEnvelope.ts b/src/api/types/ModelListResponseEnvelope.ts index c3e96ef..1db7c32 100644 --- a/src/api/types/ModelListResponseEnvelope.ts +++ b/src/api/types/ModelListResponseEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface ModelListResponseEnvelope { data?: Polytomic.ModelResponse[]; diff --git a/src/api/types/ModelRelation.ts b/src/api/types/ModelRelation.ts index fe6080e..61249f1 100644 --- a/src/api/types/ModelRelation.ts +++ b/src/api/types/ModelRelation.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface ModelRelation { from?: string; diff --git a/src/api/types/ModelResponse.ts b/src/api/types/ModelResponse.ts index b255c72..ea6b948 100644 --- a/src/api/types/ModelResponse.ts +++ b/src/api/types/ModelResponse.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface ModelResponse { configuration?: Record; diff --git a/src/api/types/ModelResponseEnvelope.ts b/src/api/types/ModelResponseEnvelope.ts index 518baf9..0539930 100644 --- a/src/api/types/ModelResponseEnvelope.ts +++ b/src/api/types/ModelResponseEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface ModelResponseEnvelope { data?: Polytomic.ModelResponse; diff --git a/src/api/types/ModelSample.ts b/src/api/types/ModelSample.ts index 794b192..5f8a1d5 100644 --- a/src/api/types/ModelSample.ts +++ b/src/api/types/ModelSample.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface ModelSample { records?: Polytomic.V2SampleRecord[]; diff --git a/src/api/types/ModelSampleResponseEnvelope.ts b/src/api/types/ModelSampleResponseEnvelope.ts index d067198..863d505 100644 --- a/src/api/types/ModelSampleResponseEnvelope.ts +++ b/src/api/types/ModelSampleResponseEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface ModelSampleResponseEnvelope { data?: Polytomic.ModelSample; diff --git a/src/api/types/ModelSyncField.ts b/src/api/types/ModelSyncField.ts index a02038d..8aae1c1 100644 --- a/src/api/types/ModelSyncField.ts +++ b/src/api/types/ModelSyncField.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface ModelSyncField { /** New is set to true if the target field should be created by Polytomic. This is not supported by all backends. */ diff --git a/src/api/types/ModelSyncResponse.ts b/src/api/types/ModelSyncResponse.ts index 40191a4..2448ef8 100644 --- a/src/api/types/ModelSyncResponse.ts +++ b/src/api/types/ModelSyncResponse.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface ModelSyncResponse { active?: boolean; diff --git a/src/api/types/ModelSyncResponseEnvelope.ts b/src/api/types/ModelSyncResponseEnvelope.ts index 374003a..c690f3b 100644 --- a/src/api/types/ModelSyncResponseEnvelope.ts +++ b/src/api/types/ModelSyncResponseEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface ModelSyncResponseEnvelope { data?: Polytomic.ModelSyncResponse; diff --git a/src/api/types/ModelSyncSourceMetaResponse.ts b/src/api/types/ModelSyncSourceMetaResponse.ts index 40a8147..3811711 100644 --- a/src/api/types/ModelSyncSourceMetaResponse.ts +++ b/src/api/types/ModelSyncSourceMetaResponse.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface ModelSyncSourceMetaResponse { configuration?: Record; diff --git a/src/api/types/OrganizationEnvelope.ts b/src/api/types/OrganizationEnvelope.ts index fd83939..eedf8b9 100644 --- a/src/api/types/OrganizationEnvelope.ts +++ b/src/api/types/OrganizationEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface OrganizationEnvelope { data?: Polytomic.Organization; diff --git a/src/api/types/OrganizationsEnvelope.ts b/src/api/types/OrganizationsEnvelope.ts index 08cf2bc..fc45fe6 100644 --- a/src/api/types/OrganizationsEnvelope.ts +++ b/src/api/types/OrganizationsEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface OrganizationsEnvelope { data?: Polytomic.Organization[]; diff --git a/src/api/types/Override.ts b/src/api/types/Override.ts index 93b8b44..272065e 100644 --- a/src/api/types/Override.ts +++ b/src/api/types/Override.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; /** * Either `field` or `field_id` must be provided. If `field_id` is provided, `field` is ignored. diff --git a/src/api/types/PolicyResponse.ts b/src/api/types/PolicyResponse.ts index 0bb12c1..c8aee96 100644 --- a/src/api/types/PolicyResponse.ts +++ b/src/api/types/PolicyResponse.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface PolicyResponse { id?: string; diff --git a/src/api/types/PolicyResponseEnvelope.ts b/src/api/types/PolicyResponseEnvelope.ts index 39173ce..4f7634b 100644 --- a/src/api/types/PolicyResponseEnvelope.ts +++ b/src/api/types/PolicyResponseEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface PolicyResponseEnvelope { data?: Polytomic.PolicyResponse; diff --git a/src/api/types/Relation.ts b/src/api/types/Relation.ts index 5c673ed..a5e8588 100644 --- a/src/api/types/Relation.ts +++ b/src/api/types/Relation.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface Relation { from?: string; diff --git a/src/api/types/RoleListResponseEnvelope.ts b/src/api/types/RoleListResponseEnvelope.ts index f8f6aec..f0617cc 100644 --- a/src/api/types/RoleListResponseEnvelope.ts +++ b/src/api/types/RoleListResponseEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface RoleListResponseEnvelope { data?: Polytomic.RoleResponse[]; diff --git a/src/api/types/RoleResponseEnvelope.ts b/src/api/types/RoleResponseEnvelope.ts index 97dad3b..052fc64 100644 --- a/src/api/types/RoleResponseEnvelope.ts +++ b/src/api/types/RoleResponseEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface RoleResponseEnvelope { data?: Polytomic.RoleResponse; diff --git a/src/api/types/Schedule.ts b/src/api/types/Schedule.ts index b312d9d..eb3d9a8 100644 --- a/src/api/types/Schedule.ts +++ b/src/api/types/Schedule.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface Schedule { connection_id?: string; diff --git a/src/api/types/ScheduleOptionResponse.ts b/src/api/types/ScheduleOptionResponse.ts index e93e8eb..0624236 100644 --- a/src/api/types/ScheduleOptionResponse.ts +++ b/src/api/types/ScheduleOptionResponse.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface ScheduleOptionResponse { schedule_options?: Polytomic.ScheduleScheduleOption[]; diff --git a/src/api/types/ScheduleOptionResponseEnvelope.ts b/src/api/types/ScheduleOptionResponseEnvelope.ts index c201df8..3ecb1e8 100644 --- a/src/api/types/ScheduleOptionResponseEnvelope.ts +++ b/src/api/types/ScheduleOptionResponseEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface ScheduleOptionResponseEnvelope { data?: Polytomic.ScheduleOptionResponse; diff --git a/src/api/types/ScheduleScheduleOption.ts b/src/api/types/ScheduleScheduleOption.ts index f626026..0eb3ba3 100644 --- a/src/api/types/ScheduleScheduleOption.ts +++ b/src/api/types/ScheduleScheduleOption.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface ScheduleScheduleOption { configuration?: Polytomic.JsonschemaForm; diff --git a/src/api/types/Schema.ts b/src/api/types/Schema.ts index 2ed354e..52d1899 100644 --- a/src/api/types/Schema.ts +++ b/src/api/types/Schema.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface Schema { fields?: Polytomic.SchemaField[]; diff --git a/src/api/types/SchemaConfiguration.ts b/src/api/types/SchemaConfiguration.ts index 852031b..d9419f9 100644 --- a/src/api/types/SchemaConfiguration.ts +++ b/src/api/types/SchemaConfiguration.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface SchemaConfiguration { /** Whether the schema is enabled for syncing. */ diff --git a/src/api/types/SchemaField.ts b/src/api/types/SchemaField.ts index c0003b7..219f516 100644 --- a/src/api/types/SchemaField.ts +++ b/src/api/types/SchemaField.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface SchemaField { association?: Polytomic.SchemaAssociation; diff --git a/src/api/types/StartModelSyncResponseEnvelope.ts b/src/api/types/StartModelSyncResponseEnvelope.ts index b137506..3ce72cd 100644 --- a/src/api/types/StartModelSyncResponseEnvelope.ts +++ b/src/api/types/StartModelSyncResponseEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface StartModelSyncResponseEnvelope { data?: Polytomic.StartModelSyncResponseSchema; diff --git a/src/api/types/StartModelSyncResponseSchema.ts b/src/api/types/StartModelSyncResponseSchema.ts index bb89366..b4a3bab 100644 --- a/src/api/types/StartModelSyncResponseSchema.ts +++ b/src/api/types/StartModelSyncResponseSchema.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface StartModelSyncResponseSchema { created_at?: string; diff --git a/src/api/types/SyncCanceledEvent.ts b/src/api/types/SyncCanceledEvent.ts index ec1a8ec..d795d19 100644 --- a/src/api/types/SyncCanceledEvent.ts +++ b/src/api/types/SyncCanceledEvent.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface SyncCanceledEvent { execution_id?: string; diff --git a/src/api/types/SyncCompletedEvent.ts b/src/api/types/SyncCompletedEvent.ts index 9a2c706..e224955 100644 --- a/src/api/types/SyncCompletedEvent.ts +++ b/src/api/types/SyncCompletedEvent.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface SyncCompletedEvent { deleted_records?: string[]; diff --git a/src/api/types/SyncDestinationProperties.ts b/src/api/types/SyncDestinationProperties.ts index f790aa1..acff45b 100644 --- a/src/api/types/SyncDestinationProperties.ts +++ b/src/api/types/SyncDestinationProperties.ts @@ -4,6 +4,7 @@ export interface SyncDestinationProperties { does_not_report_operation_counts?: boolean; + mappings_not_required?: boolean; new_target_label?: string; optional_target_mappings?: boolean; primary_metadata_object?: string; diff --git a/src/api/types/SyncStatusEnvelope.ts b/src/api/types/SyncStatusEnvelope.ts index e44e483..b68f1cc 100644 --- a/src/api/types/SyncStatusEnvelope.ts +++ b/src/api/types/SyncStatusEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface SyncStatusEnvelope { data?: Polytomic.SyncStatusResponse; diff --git a/src/api/types/SyncStatusResponse.ts b/src/api/types/SyncStatusResponse.ts index 640aa33..6e0f932 100644 --- a/src/api/types/SyncStatusResponse.ts +++ b/src/api/types/SyncStatusResponse.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface SyncStatusResponse { current_execution?: Polytomic.GetExecutionResponseSchema; diff --git a/src/api/types/TargetField.ts b/src/api/types/TargetField.ts index f066ade..f4805ad 100644 --- a/src/api/types/TargetField.ts +++ b/src/api/types/TargetField.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface TargetField { association?: boolean; diff --git a/src/api/types/TargetResponse.ts b/src/api/types/TargetResponse.ts index 5109f44..f8fc359 100644 --- a/src/api/types/TargetResponse.ts +++ b/src/api/types/TargetResponse.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface TargetResponse { fields?: Polytomic.TargetField[]; diff --git a/src/api/types/TargetResponseEnvelope.ts b/src/api/types/TargetResponseEnvelope.ts index ac8e0d7..27ca0ab 100644 --- a/src/api/types/TargetResponseEnvelope.ts +++ b/src/api/types/TargetResponseEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface TargetResponseEnvelope { data?: Polytomic.TargetResponse; diff --git a/src/api/types/UserEnvelope.ts b/src/api/types/UserEnvelope.ts index 5d01269..32de3fe 100644 --- a/src/api/types/UserEnvelope.ts +++ b/src/api/types/UserEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface UserEnvelope { data?: Polytomic.User; diff --git a/src/api/types/V2SchemaConfigurationFieldsItem.ts b/src/api/types/V2SchemaConfigurationFieldsItem.ts index 12c8feb..169c94f 100644 --- a/src/api/types/V2SchemaConfigurationFieldsItem.ts +++ b/src/api/types/V2SchemaConfigurationFieldsItem.ts @@ -2,6 +2,6 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export type V2SchemaConfigurationFieldsItem = string | Polytomic.FieldConfiguration; diff --git a/src/api/types/V4QueryResultsEnvelope.ts b/src/api/types/V4QueryResultsEnvelope.ts index 09aba93..387a0c6 100644 --- a/src/api/types/V4QueryResultsEnvelope.ts +++ b/src/api/types/V4QueryResultsEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface V4QueryResultsEnvelope { data?: Polytomic.V4RunQueryResult; diff --git a/src/api/types/V4RunQueryEnvelope.ts b/src/api/types/V4RunQueryEnvelope.ts index db71523..12c991f 100644 --- a/src/api/types/V4RunQueryEnvelope.ts +++ b/src/api/types/V4RunQueryEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface V4RunQueryEnvelope { data?: Polytomic.V4RunQueryResult; diff --git a/src/api/types/V4RunQueryResult.ts b/src/api/types/V4RunQueryResult.ts index 144bd16..4e28e80 100644 --- a/src/api/types/V4RunQueryResult.ts +++ b/src/api/types/V4RunQueryResult.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface V4RunQueryResult { /** The number of rows returned by the query. This will not be returned until the query completes. */ diff --git a/src/api/types/WebhookEnvelope.ts b/src/api/types/WebhookEnvelope.ts index 76ec453..130719b 100644 --- a/src/api/types/WebhookEnvelope.ts +++ b/src/api/types/WebhookEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface WebhookEnvelope { data?: Polytomic.Webhook; diff --git a/src/api/types/WebhookListEnvelope.ts b/src/api/types/WebhookListEnvelope.ts index 884dd99..01e4a65 100644 --- a/src/api/types/WebhookListEnvelope.ts +++ b/src/api/types/WebhookListEnvelope.ts @@ -2,7 +2,7 @@ * This file was auto-generated from our API Definition. */ -import * as Polytomic from ".."; +import * as Polytomic from "../index"; export interface WebhookListEnvelope { data?: Polytomic.Webhook[]; diff --git a/src/core/fetcher/Fetcher.ts b/src/core/fetcher/Fetcher.ts index eddba46..90bf37f 100644 --- a/src/core/fetcher/Fetcher.ts +++ b/src/core/fetcher/Fetcher.ts @@ -1,4 +1,3 @@ -import { default as FormData } from "form-data"; import qs from "qs"; import { RUNTIME } from "../runtime"; import { APIResponse } from "./APIResponse"; @@ -11,12 +10,13 @@ export declare namespace Fetcher { method: string; contentType?: string; headers?: Record; - queryParameters?: Record; + queryParameters?: Record; body?: unknown; timeoutMs?: number; maxRetries?: number; withCredentials?: boolean; - responseType?: "json" | "blob" | "streaming"; + abortSignal?: AbortSignal; + responseType?: "json" | "blob" | "streaming" | "text"; } export type Error = FailedStatusCodeError | NonJsonError | TimeoutError | UnknownError; @@ -67,37 +67,65 @@ async function fetcherImpl(args: Fetcher.Args): Promise { + if (body instanceof Uint8Array) { + return body; + } else if (args.contentType === "application/x-www-form-urlencoded" && typeof args.body === "string") { + return args.body; + } else { + return JSON.stringify(body); + } + }; + + if (RUNTIME.type === "node") { + if (args.body instanceof (await import("formdata-node")).FormData) { + // @ts-expect-error + body = args.body; + } else if (args.body instanceof (await import("stream")).Readable) { + // @ts-expect-error + body = args.body; + } else { + body = maybeStringifyBody(args.body); + } } else { - body = JSON.stringify(args.body); + if (args.body instanceof (await import("form-data")).default) { + // @ts-expect-error + body = args.body; + } else { + body = maybeStringifyBody(args.body); + } } - // In Node.js environments, the SDK always uses`node-fetch`. - // If not in Node.js the SDK uses global fetch if available, - // and falls back to node-fetch. - const fetchFn = - RUNTIME.type === "node" ? require("node-fetch") : typeof fetch == "function" ? fetch : require("node-fetch"); + const fetchFn = await getFetchFn(); const makeRequest = async (): Promise => { - const controller = new AbortController(); - let abortId = undefined; + const signals: AbortSignal[] = []; + + // Add timeout signal + let timeoutAbortId: NodeJS.Timeout | undefined = undefined; if (args.timeoutMs != null) { - abortId = setTimeout(() => controller.abort(), args.timeoutMs); + const { signal, abortId } = getTimeoutSignal(args.timeoutMs); + timeoutAbortId = abortId; + signals.push(signal); } + + // Add arbitrary signal + if (args.abortSignal != null) { + signals.push(args.abortSignal); + } + const response = await fetchFn(url, { method: args.method, headers, body, - signal: controller.signal, + signal: anySignal(signals), credentials: args.withCredentials ? "include" : undefined, }); - if (abortId != null) { - clearTimeout(abortId); + + if (timeoutAbortId != null) { + clearTimeout(timeoutAbortId); } + return response; }; @@ -124,6 +152,8 @@ async function fetcherImpl(args: Fetcher.Args): Promise 0) { @@ -159,7 +189,15 @@ async function fetcherImpl(args: Fetcher.Args): Promise(args: Fetcher.Args): Promise controller.abort(TIMEOUT), timeoutMs); + return { signal: controller.signal, abortId }; +} + +/** + * Returns an abort signal that is getting aborted when + * at least one of the specified abort signals is aborted. + * + * Requires at least node.js 18. + */ +function anySignal(...args: AbortSignal[] | [AbortSignal[]]): AbortSignal { + // Allowing signals to be passed either as array + // of signals or as multiple arguments. + const signals = (args.length === 1 && Array.isArray(args[0]) ? args[0] : args); + + const controller = new AbortController(); + + for (const signal of signals) { + if (signal.aborted) { + // Exiting early if one of the signals + // is already aborted. + controller.abort((signal as any)?.reason); + break; + } + + // Listening for signals and removing the listeners + // when at least one symbol is aborted. + signal.addEventListener("abort", () => controller.abort((signal as any)?.reason), { + signal: controller.signal, + }); + } + + return controller.signal; +} + +/** + * Returns a fetch function based on the runtime + */ +async function getFetchFn(): Promise { + // In Node.js environments, the SDK always uses`node-fetch`. + if (RUNTIME.type === "node") { + return (await import("node-fetch")).default as any; + } + + // Otherwise the SDK uses global fetch if available, + // and falls back to node-fetch. + if (typeof fetch == "function") { + return fetch; + } + + // Defaults to node `node-fetch` if global fetch isn't available + return (await import("node-fetch")).default as any; +} + export const fetcher: FetchFunction = fetcherImpl; diff --git a/src/core/runtime/runtime.ts b/src/core/runtime/runtime.ts index f0692ab..30fe077 100644 --- a/src/core/runtime/runtime.ts +++ b/src/core/runtime/runtime.ts @@ -55,13 +55,19 @@ const isNode = */ const isReactNative = typeof navigator !== "undefined" && navigator?.product === "ReactNative"; +/** + * A constant that indicates whether the environment the code is running is Cloudflare. + * https://developers.cloudflare.com/workers/runtime-apis/web-standards/#navigatoruseragent + */ +const isCloudflare = typeof globalThis !== "undefined" && globalThis?.navigator?.userAgent === "Cloudflare-Workers"; + /** * A constant that indicates which environment and version the SDK is running in. */ export const RUNTIME: Runtime = evaluateRuntime(); export interface Runtime { - type: "browser" | "web-worker" | "deno" | "bun" | "node" | "react-native" | "unknown"; + type: "browser" | "web-worker" | "deno" | "bun" | "node" | "react-native" | "unknown" | "workerd"; version?: string; } @@ -73,6 +79,12 @@ function evaluateRuntime(): Runtime { }; } + if (isCloudflare) { + return { + type: "workerd", + }; + } + if (isWebWorker) { return { type: "web-worker", diff --git a/tests/client.test.ts b/tests/client.test.ts deleted file mode 100644 index 62b373b..0000000 --- a/tests/client.test.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** -* This is a test file for the SDK. -* -* Add any tests here and make sure to mark this file -* in `.fernignore`. -*/ -describe("test", () => { - it("default", () => { - expect(true).toBe(true); - }); -}); \ No newline at end of file diff --git a/tests/custom.test.ts b/tests/custom.test.ts new file mode 100644 index 0000000..7f5e031 --- /dev/null +++ b/tests/custom.test.ts @@ -0,0 +1,13 @@ +/** + * This is a custom test file, if you wish to add more tests + * to your SDK. + * Be sure to mark this file in `.fernignore`. + * + * If you include example requests/responses in your fern definition, + * you will have tests automatically generated for you. + */ +describe("test", () => { + it("default", () => { + expect(true).toBe(true); + }); +}); diff --git a/tsconfig.json b/tsconfig.json index 5a306b2..538c94f 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,8 +12,6 @@ "rootDir": "src", "baseUrl": "src" }, - "include": [ - "src" - ], + "include": ["src"], "exclude": [] -} \ No newline at end of file +} diff --git a/yarn.lock b/yarn.lock index 0bc3670..e25cc08 100644 --- a/yarn.lock +++ b/yarn.lock @@ -529,9 +529,9 @@ integrity sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A== "@jridgewell/sourcemap-codec@^1.4.10", "@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== + version "1.5.0" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a" + integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== "@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": version "0.3.25" @@ -560,6 +560,11 @@ dependencies: "@sinonjs/commons" "^3.0.0" +"@tootallnate/once@2": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" + integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== + "@types/babel__core@^7.1.14": version "7.20.5" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.5.tgz#3df15f27ba85319caa07ba08d0721889bb39c017" @@ -619,14 +624,23 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/jest@^29.5.5": - version "29.5.12" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.5.12.tgz#7f7dc6eb4cf246d2474ed78744b05d06ce025544" - integrity sha512-eDC8bTvT/QhYdxJAulQikueigY5AsdBRH2yDKW3yveW7svY3+DzN84/2NUgkw10RTiJbWqZrTtoGVdYlvFJdLw== +"@types/jest@29.5.5": + version "29.5.5" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.5.5.tgz#727204e06228fe24373df9bae76b90f3e8236a2a" + integrity sha512-ebylz2hnsWR9mYvmBFbXJXr+33UPc4+ZdxyDXh5w0FlPBTfCVN3wPL+kuOiQt3xvrK419v7XWeAs+AeOksafXg== dependencies: expect "^29.0.0" pretty-format "^29.0.0" +"@types/jsdom@^20.0.0": + version "20.0.1" + resolved "https://registry.yarnpkg.com/@types/jsdom/-/jsdom-20.0.1.tgz#07c14bc19bd2f918c1929541cdaacae894744808" + integrity sha512-d0r18sZPmMQr1eG35u12FZfhIXNrnsPU/g5wvRKCUf/tOGilKKwYMYGqh33BNR6ba+2gkHw1EUiHoN3mn7E5IQ== + dependencies: + "@types/node" "*" + "@types/tough-cookie" "*" + parse5 "^7.0.0" + "@types/node-fetch@2.6.9": version "2.6.9" resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.9.tgz#15f529d247f1ede1824f7e7acdaa192d5f28071e" @@ -636,9 +650,9 @@ form-data "^4.0.0" "@types/node@*": - version "20.14.9" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.14.9.tgz#12e8e765ab27f8c421a1820c99f5f313a933b420" - integrity sha512-06OCtnTXtWOZBJlRApleWndH4JsRVs1pDCc8dLSQp+7PpUpX3ePdHyeNSFTeSe7FtKyQkrlPvHwJOW3SLd8Oyg== + version "20.14.10" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.14.10.tgz#a1a218290f1b6428682e3af044785e5874db469a" + integrity sha512-MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ== dependencies: undici-types "~5.26.4" @@ -657,6 +671,11 @@ resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.3.tgz#6209321eb2c1712a7e7466422b8cb1fc0d9dd5d8" integrity sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw== +"@types/tough-cookie@*": + version "4.0.5" + resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.5.tgz#cb6e2a691b70cb177c6e3ae9c1d2e8b2ea8cd304" + integrity sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA== + "@types/url-join@4.0.1": version "4.0.1" resolved "https://registry.yarnpkg.com/@types/url-join/-/url-join-4.0.1.tgz#4989c97f969464647a8586c7252d97b449cdc045" @@ -674,6 +693,38 @@ dependencies: "@types/yargs-parser" "*" +abab@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.6.tgz#41b80f2c871d19686216b82309231cfd3cb3d291" + integrity sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA== + +acorn-globals@^7.0.0: + version "7.0.1" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-7.0.1.tgz#0dbf05c44fa7c94332914c02066d5beff62c40c3" + integrity sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q== + dependencies: + acorn "^8.1.0" + acorn-walk "^8.0.2" + +acorn-walk@^8.0.2: + version "8.3.3" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.3.tgz#9caeac29eefaa0c41e3d4c65137de4d6f34df43e" + integrity sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw== + dependencies: + acorn "^8.11.0" + +acorn@^8.1.0, acorn@^8.11.0, acorn@^8.8.1: + version "8.12.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.12.1.tgz#71616bdccbe25e27a54439e0046e89ca76df2248" + integrity sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg== + +agent-base@6: + version "6.0.2" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" + integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== + dependencies: + debug "4" + ansi-escapes@^4.2.1: version "4.3.2" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" @@ -806,14 +857,14 @@ braces@^3.0.3: fill-range "^7.1.1" browserslist@^4.22.2: - version "4.23.1" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.23.1.tgz#ce4af0534b3d37db5c1a4ca98b9080f985041e96" - integrity sha512-TUfofFo/KsK/bWZ9TWQ5O26tsWW4Uhmt8IYklbnUa70udB6P2wA7w7o4PY4muaEPBQaAX+CEnmmIA41NVHtPVw== + version "4.23.2" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.23.2.tgz#244fe803641f1c19c28c48c4b6ec9736eb3d32ed" + integrity sha512-qkqSyistMYdxAcw+CzbZwlBy8AGmS/eEWs+sEV5TnLRGDOL+C5M2EnH6tlZyg0YoAxGJAFKh61En9BR941GnHA== dependencies: - caniuse-lite "^1.0.30001629" - electron-to-chromium "^1.4.796" + caniuse-lite "^1.0.30001640" + electron-to-chromium "^1.4.820" node-releases "^2.0.14" - update-browserslist-db "^1.0.16" + update-browserslist-db "^1.1.0" bs-logger@0.x: version "0.2.6" @@ -860,7 +911,7 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001629: +caniuse-lite@^1.0.30001640: version "1.0.30001640" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001640.tgz#32c467d4bf1f1a0faa63fc793c2ba81169e7652f" integrity sha512-lA4VMpW0PSUrFnkmVuEKBUovSWKhj7puyCg8StBChgu298N1AtuF1sKWEvfDuimSEDbhlb/KqPKC3fs1HbuQUA== @@ -979,13 +1030,44 @@ 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: +cssom@^0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.5.0.tgz#d254fa92cd8b6fbd83811b9fbaed34663cc17c36" + integrity sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw== + +cssom@~0.3.6: + version "0.3.8" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" + integrity sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg== + +cssstyle@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-2.3.0.tgz#ff665a0ddbdc31864b09647f34163443d90b0852" + integrity sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A== + dependencies: + cssom "~0.3.6" + +data-urls@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-3.0.2.tgz#9cf24a477ae22bcef5cd5f6f0bfbc1d2d3be9143" + integrity sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ== + dependencies: + abab "^2.0.6" + whatwg-mimetype "^3.0.0" + whatwg-url "^11.0.0" + +debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1: version "4.3.5" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.5.tgz#e83444eceb9fedd4a1da56d671ae2446a01a6e1e" integrity sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg== dependencies: ms "2.1.2" +decimal.js@^10.4.2: + version "10.4.3" + resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.4.3.tgz#1044092884d245d1b7f65725fa4ad4c6f781cc23" + integrity sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA== + dedent@^1.0.0: version "1.5.3" resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.5.3.tgz#99aee19eb9bae55a67327717b6e848d0bf777e5a" @@ -1020,10 +1102,17 @@ diff-sequences@^29.6.3: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.6.3.tgz#4deaf894d11407c51efc8418012f9e70b84ea921" integrity sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q== -electron-to-chromium@^1.4.796: - version "1.4.816" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.816.tgz#3624649d1e7fde5cdbadf59d31a524245d8ee85f" - integrity sha512-EKH5X5oqC6hLmiS7/vYtZHZFTNdhsYG5NVPRN6Yn0kQHNBlT59+xSM8HBy66P5fxWpKgZbPqb+diC64ng295Jw== +domexception@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/domexception/-/domexception-4.0.0.tgz#4ad1be56ccadc86fc76d033353999a8037d03673" + integrity sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw== + dependencies: + webidl-conversions "^7.0.0" + +electron-to-chromium@^1.4.820: + version "1.4.822" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.822.tgz#17511699c1573bb6bf510f27fd2c19e379e9da43" + integrity sha512-qJzHIt4dRRFKjHHvaExCrG95F65kUP3xysaEZ4I2+/R/uIyr5Ar5g/rkAnrRz0parRUYwzpqN8Pz1HgoiYQPpg== emittery@^0.13.1: version "0.13.1" @@ -1035,6 +1124,11 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== +entities@^4.4.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/entities/-/entities-4.5.0.tgz#5d268ea5e7113ec74c4d033b79ea5a35a488fb48" + integrity sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw== + error-ex@^1.3.1: version "1.3.2" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" @@ -1069,11 +1163,32 @@ escape-string-regexp@^2.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== -esprima@^4.0.0: +escodegen@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-2.1.0.tgz#ba93bbb7a43986d29d6041f99f5262da773e2e17" + integrity sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w== + dependencies: + esprima "^4.0.1" + estraverse "^5.2.0" + esutils "^2.0.2" + optionalDependencies: + source-map "~0.6.1" + +esprima@^4.0.0, esprima@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== +estraverse@^5.2.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== + +esutils@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== + execa@^5.0.0: version "5.1.1" resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" @@ -1141,6 +1256,11 @@ form-data@4.0.0, form-data@^4.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" +formdata-node@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/formdata-node/-/formdata-node-6.0.3.tgz#48f8e2206ae2befded82af621ef015f08168dc6d" + integrity sha512-8e1++BCiTzUno9v5IZ2J6bv4RU+3UKDmqWUQD0MIMVCd9AdhWkO1gw57oo1mNEX1dMq2EGI+FbWz4B92pscSQg== + fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -1250,16 +1370,47 @@ hasown@^2.0.0, hasown@^2.0.2: dependencies: function-bind "^1.1.2" +html-encoding-sniffer@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz#2cb1a8cf0db52414776e5b2a7a04d5dd98158de9" + integrity sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA== + dependencies: + whatwg-encoding "^2.0.0" + html-escaper@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== +http-proxy-agent@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz#5129800203520d434f142bc78ff3c170800f2b43" + integrity sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w== + dependencies: + "@tootallnate/once" "2" + agent-base "6" + debug "4" + +https-proxy-agent@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" + integrity sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA== + dependencies: + agent-base "6" + debug "4" + human-signals@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== +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" + import-local@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.1.0.tgz#b4479df8a5fd44f6cdce24070675676063c95cb4" @@ -1313,6 +1464,11 @@ is-number@^7.0.0: resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== +is-potential-custom-element-name@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" + integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ== + is-stream@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" @@ -1484,6 +1640,20 @@ jest-each@^29.7.0: jest-util "^29.7.0" pretty-format "^29.7.0" +jest-environment-jsdom@29.7.0: + version "29.7.0" + resolved "https://registry.yarnpkg.com/jest-environment-jsdom/-/jest-environment-jsdom-29.7.0.tgz#d206fa3551933c3fd519e5dfdb58a0f5139a837f" + integrity sha512-k9iQbsf9OyOfdzWH8HDmrRT0gSIcX+FLNW7IQq94tFX0gynPwqDTW0Ho6iMVNjGz/nb+l/vW3dWM2bbLLpkbXA== + dependencies: + "@jest/environment" "^29.7.0" + "@jest/fake-timers" "^29.7.0" + "@jest/types" "^29.6.3" + "@types/jsdom" "^20.0.0" + "@types/node" "*" + jest-mock "^29.7.0" + jest-util "^29.7.0" + jsdom "^20.0.0" + jest-environment-node@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.7.0.tgz#0b93e111dda8ec120bc8300e6d1fb9576e164376" @@ -1724,7 +1894,7 @@ jest-worker@^29.7.0: merge-stream "^2.0.0" supports-color "^8.0.0" -jest@^29.7.0: +jest@29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/jest/-/jest-29.7.0.tgz#994676fc24177f088f1c5e3737f5697204ff2613" integrity sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw== @@ -1752,6 +1922,38 @@ js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" +jsdom@^20.0.0: + version "20.0.3" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-20.0.3.tgz#886a41ba1d4726f67a8858028c99489fed6ad4db" + integrity sha512-SYhBvTh89tTfCD/CRdSOm13mOBa42iTaTyfyEWBdKcGdPxPtLFBXuHR8XHb33YNYaP+lLbmSvBTsnoesCNJEsQ== + dependencies: + abab "^2.0.6" + acorn "^8.8.1" + acorn-globals "^7.0.0" + cssom "^0.5.0" + cssstyle "^2.3.0" + data-urls "^3.0.2" + decimal.js "^10.4.2" + domexception "^4.0.0" + escodegen "^2.0.0" + form-data "^4.0.0" + html-encoding-sniffer "^3.0.0" + http-proxy-agent "^5.0.0" + https-proxy-agent "^5.0.1" + is-potential-custom-element-name "^1.0.1" + nwsapi "^2.2.2" + parse5 "^7.1.1" + saxes "^6.0.0" + symbol-tree "^3.2.4" + tough-cookie "^4.1.2" + w3c-xmlserializer "^4.0.0" + webidl-conversions "^7.0.0" + whatwg-encoding "^2.0.0" + whatwg-mimetype "^3.0.0" + whatwg-url "^11.0.0" + ws "^8.11.0" + xml-name-validator "^4.0.0" + jsesc@^2.5.1: version "2.5.2" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" @@ -1896,6 +2098,11 @@ npm-run-path@^4.0.1: dependencies: path-key "^3.0.0" +nwsapi@^2.2.2: + version "2.2.10" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.10.tgz#0b77a68e21a0b483db70b11fad055906e867cda8" + integrity sha512-QK0sRs7MKv0tKe1+5uZIQk/C8XGza4DAnztJG8iD+TpJIORARrCxczA738awHrZoHeTjSSoHqao2teO0dC/gFQ== + object-inspect@^1.13.1: version "1.13.2" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.2.tgz#dea0088467fb991e67af4058147a24824a3043ff" @@ -1951,6 +2158,13 @@ parse-json@^5.2.0: json-parse-even-better-errors "^2.3.0" lines-and-columns "^1.1.6" +parse5@^7.0.0, parse5@^7.1.1: + version "7.1.2" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-7.1.2.tgz#0736bebbfd77793823240a23b7fc5e010b7f8e32" + integrity sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw== + dependencies: + entities "^4.4.0" + path-exists@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" @@ -2015,6 +2229,16 @@ prompts@^2.0.1: kleur "^3.0.3" sisteransi "^1.0.5" +psl@^1.1.33: + version "1.9.0" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.9.0.tgz#d0df2a137f00794565fcaf3b2c00cd09f8d5a5a7" + integrity sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag== + +punycode@^2.1.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5" + integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg== + pure-rand@^6.0.0: version "6.1.0" resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-6.1.0.tgz#d173cf23258231976ccbdb05247c9787957604f2" @@ -2027,6 +2251,11 @@ qs@6.11.2: dependencies: side-channel "^1.0.4" +querystringify@^2.1.1: + version "2.2.0" + resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" + integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== + react-is@^18.0.0: version "18.3.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.3.1.tgz#e83557dc12eae63a99e003a46388b1dcbb44db7e" @@ -2037,6 +2266,11 @@ require-directory@^2.1.1: resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== +requires-port@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" + integrity sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ== + resolve-cwd@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" @@ -2063,6 +2297,18 @@ resolve@^1.20.0: path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" +"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== + +saxes@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/saxes/-/saxes-6.0.0.tgz#fe5b4a4768df4f14a201b1ba6a65c1f3d9988cc5" + integrity sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA== + dependencies: + xmlchars "^2.2.0" + semver@^6.3.0, semver@^6.3.1: version "6.3.1" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" @@ -2130,7 +2376,7 @@ source-map-support@0.5.13: buffer-from "^1.0.0" source-map "^0.6.0" -source-map@^0.6.0, source-map@^0.6.1: +source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== @@ -2212,6 +2458,11 @@ supports-preserve-symlinks-flag@^1.0.0: resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== +symbol-tree@^3.2.4: + version "3.2.4" + resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" + integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== + test-exclude@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" @@ -2238,15 +2489,32 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" +tough-cookie@^4.1.2: + version "4.1.4" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-4.1.4.tgz#945f1461b45b5a8c76821c33ea49c3ac192c1b36" + integrity sha512-Loo5UUvLD9ScZ6jh8beX1T6sO1w2/MpCRpEP7V280GKMVUQ0Jzar2U3UJPsrdbziLEMMhu3Ujnq//rhiFuIeag== + dependencies: + psl "^1.1.33" + punycode "^2.1.1" + universalify "^0.2.0" + url-parse "^1.5.3" + +tr46@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-3.0.0.tgz#555c4e297a950617e8eeddef633c87d4d9d6cbf9" + integrity sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA== + dependencies: + punycode "^2.1.1" + tr46@~0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a" integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== -ts-jest@^29.1.1: - version "29.1.5" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.1.5.tgz#d6c0471cc78bffa2cb4664a0a6741ef36cfe8f69" - integrity sha512-UuClSYxM7byvvYfyWdFI+/2UxMmwNyJb0NPkZPQE2hew3RurV7l7zURgOHAd/1I1ZdPpe3GUsXNXAcN8TFKSIg== +ts-jest@29.1.1: + version "29.1.1" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.1.1.tgz#f58fe62c63caf7bfcc5cc6472082f79180f0815b" + integrity sha512-D6xjnnbP17cC85nliwGiL+tpoKN0StpgE0TeOjXQTU6MVCfsB4v7aW05CgQ/1OywGb0x/oy9hHFnN+sczTiRaA== dependencies: bs-logger "0.x" fast-json-stable-stringify "2.x" @@ -2277,7 +2545,12 @@ undici-types@~5.26.4: resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== -update-browserslist-db@^1.0.16: +universalify@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0" + integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg== + +update-browserslist-db@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz#7ca61c0d8650766090728046e416a8cde682859e" integrity sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ== @@ -2290,6 +2563,14 @@ url-join@4.0.1: resolved "https://registry.yarnpkg.com/url-join/-/url-join-4.0.1.tgz#b642e21a2646808ffa178c4c5fda39844e12cde7" integrity sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA== +url-parse@^1.5.3: + version "1.5.10" + resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1" + integrity sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ== + dependencies: + querystringify "^2.1.1" + requires-port "^1.0.0" + v8-to-istanbul@^9.0.1: version "9.3.0" resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz#b9572abfa62bd556c16d75fdebc1a411d5ff3175" @@ -2299,6 +2580,13 @@ v8-to-istanbul@^9.0.1: "@types/istanbul-lib-coverage" "^2.0.1" convert-source-map "^2.0.0" +w3c-xmlserializer@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-4.0.0.tgz#aebdc84920d806222936e3cdce408e32488a3073" + integrity sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw== + dependencies: + xml-name-validator "^4.0.0" + walker@^1.0.8: version "1.0.8" resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.8.tgz#bd498db477afe573dc04185f011d3ab8a8d7653f" @@ -2311,6 +2599,31 @@ webidl-conversions@^3.0.0: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== +webidl-conversions@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-7.0.0.tgz#256b4e1882be7debbf01d05f0aa2039778ea080a" + integrity sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g== + +whatwg-encoding@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz#e7635f597fd87020858626805a2729fa7698ac53" + integrity sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg== + dependencies: + iconv-lite "0.6.3" + +whatwg-mimetype@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz#5fa1a7623867ff1af6ca3dc72ad6b8a4208beba7" + integrity sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q== + +whatwg-url@^11.0.0: + version "11.0.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-11.0.0.tgz#0a849eebb5faf2119b901bb76fd795c2848d4018" + integrity sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ== + dependencies: + tr46 "^3.0.0" + webidl-conversions "^7.0.0" + whatwg-url@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d" @@ -2348,6 +2661,21 @@ write-file-atomic@^4.0.2: imurmurhash "^0.1.4" signal-exit "^3.0.7" +ws@^8.11.0: + version "8.18.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc" + integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw== + +xml-name-validator@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-4.0.0.tgz#79a006e2e63149a8600f15430f0a4725d1524835" + integrity sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw== + +xmlchars@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" + integrity sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw== + y18n@^5.0.5: version "5.0.8" resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55"