From bdd9d5037c9f3a2ae1921018c91077eaeec70fe2 Mon Sep 17 00:00:00 2001 From: speakeasybot Date: Sun, 14 Jul 2024 00:26:27 +0000 Subject: [PATCH] ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.335.0 --- .gitignore | 4 + .npmignore | 2 + .speakeasy/gen.lock | 13 +- .speakeasy/workflow.lock | 13 +- README.md | 62 +++ RELEASES.md | 10 +- RUNTIMES.md | 2 +- docs/lib/utils/retryconfig.md | 24 ++ docs/sdks/actions/README.md | 1 + docs/sdks/connections/README.md | 6 + docs/sdks/environment/README.md | 1 + docs/sdks/integrations/README.md | 5 + docs/sdks/proxy/README.md | 5 + docs/sdks/records/README.md | 1 + docs/sdks/sync/README.md | 6 + gen.yaml | 3 +- jsr.json | 2 +- package-lock.json | 21 +- package.json | 5 +- src/lib/config.ts | 7 +- src/lib/sdks.ts | 94 ++++- .../components/createactiontriggerrequest.ts | 90 ++-- .../components/createactiontriggerresponse.ts | 61 ++- .../components/createconnectionrequest.ts | 31 +- src/models/components/createproxyrequest.ts | 61 ++- .../components/createsyncpauserequest.ts | 77 ++-- .../components/createsyncstartrequest.ts | 77 ++-- .../components/createsynctriggerrequest.ts | 77 ++-- .../components/getconnectionresponse.ts | 81 +++- .../getenvironmentvariableresponse.ts | 49 ++- .../components/getintegrationresponse.ts | 73 +++- src/models/components/getrecordresponse.ts | 231 +++++++---- .../components/getsyncrecordresponse.ts | 175 +++++--- .../components/getsyncstatusresponse.ts | 178 +++++--- .../components/integrationsresponse200.ts | 72 +++- .../components/listintegrationsrequest.ts | 31 +- src/models/components/patchproxyrequest.ts | 44 +- src/models/components/putproxyrequest.ts | 57 ++- .../updateconnectionfrequencyrequest.ts | 94 +++-- .../updateconnectionfrequencyresponse.ts | 49 ++- .../components/updateintegrationrequest.ts | 31 +- src/models/errors/response400.ts | 64 +-- src/models/errors/response404.ts | 64 +-- src/models/operations/createactiontrigger.ts | 81 ++-- src/models/operations/createmetadata.ts | 108 +++-- src/models/operations/createproxy.ts | 127 +++--- src/models/operations/deleteconnections.ts | 67 +-- src/models/operations/deleteintegration.ts | 43 +- src/models/operations/deleteproxy.ts | 127 +++--- src/models/operations/getconnections.ts | 87 ++-- src/models/operations/getintegration.ts | 67 +-- src/models/operations/getproxy.ts | 123 +++--- src/models/operations/getrecord.ts | 112 +++-- src/models/operations/getsyncrecord.ts | 167 +++++--- src/models/operations/getsyncstatus.ts | 77 ++-- src/models/operations/listconnections.ts | 44 +- src/models/operations/patchproxy.ts | 86 ++-- src/models/operations/putproxy.ts | 123 +++--- src/models/operations/updatemetadata.ts | 141 +++++-- src/sdk/actions.ts | 53 +-- src/sdk/connections.ts | 203 ++++++---- src/sdk/environment.ts | 28 +- src/sdk/integrations.ts | 150 ++++--- src/sdk/proxy.ts | 383 +++++++++--------- src/sdk/records.ts | 51 ++- src/sdk/sync.ts | 204 ++++++---- 66 files changed, 3056 insertions(+), 1650 deletions(-) create mode 100644 docs/lib/utils/retryconfig.md diff --git a/.gitignore b/.gitignore index cc2681a..cf20f5e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +/esm +/dist +/.tshy +/.tshy-* /models /models/errors /types diff --git a/.npmignore b/.npmignore index 709e684..3ef05d1 100644 --- a/.npmignore +++ b/.npmignore @@ -5,3 +5,5 @@ /.eslintrc.js /cjs +/.tshy +/.tshy-* diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 71347e1..ef01ec8 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -3,10 +3,10 @@ id: 0115721b-c5d5-4598-9754-02eb24f100a8 management: docChecksum: 108d5939aa1f55ecaef7b1e04e7745b6 docVersion: 1.0.0 - speakeasyVersion: 1.309.1 - generationVersion: 2.347.4 - releaseVersion: 0.9.1 - configChecksum: 3144aadae02ffcdbc2bcf9d1a9c2c8c7 + speakeasyVersion: 1.335.0 + generationVersion: 2.370.2 + releaseVersion: 0.10.0 + configChecksum: df1796ba257da0b8304dc3fd01342587 repoURL: https://github.com/speakeasy-sdks/nango-typescript-sdk.git repoSubDirectory: . installationURL: https://github.com/speakeasy-sdks/nango-typescript-sdk @@ -14,13 +14,15 @@ management: features: typescript: additionalDependencies: 0.1.0 - core: 3.10.0 + core: 3.11.6 + defaultEnabledRetries: 0.1.0 flattening: 2.81.1 globalSecurityCallbacks: 0.1.0 globalServerURLs: 2.82.4 groups: 2.81.2 nameOverrides: 2.81.2 responseFormat: 0.2.3 + retries: 2.83.0 sdkHooks: 0.1.0 serverIDs: 2.81.2 generatedFiles: @@ -158,6 +160,7 @@ generatedFiles: - docs/models/operations/patchproxyrequest.md - docs/models/operations/deleteproxyrequest.md - docs/sdks/nango/README.md + - docs/lib/utils/retryconfig.md - docs/sdks/integrations/README.md - docs/sdks/connections/README.md - docs/sdks/records/README.md diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index edb922c..1a71163 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,18 +1,19 @@ -speakeasyVersion: 1.309.1 +speakeasyVersion: 1.335.0 sources: my-source: sourceNamespace: my-source - sourceRevisionDigest: sha256:28f8ad416a8c616c03f380901b4f45883c023ec04e4d65ae5a811a8168c45108 - sourceBlobDigest: sha256:efa987571d8346ba36b22ab4746cdde4b9470314c134765f1b925c8d4bf07dae + sourceRevisionDigest: sha256:df54796f529635fb568ba72c74aaaef6cd6648b26e220d76c073c0fa406f7720 + sourceBlobDigest: sha256:ee8fa2cba530915e9b36f27a1b286a0b32b485e920a549ca7a809b1fb5fe68a5 tags: - latest + - main targets: nango-ts: source: my-source sourceNamespace: my-source - sourceRevisionDigest: sha256:28f8ad416a8c616c03f380901b4f45883c023ec04e4d65ae5a811a8168c45108 - sourceBlobDigest: sha256:efa987571d8346ba36b22ab4746cdde4b9470314c134765f1b925c8d4bf07dae - outLocation: /Users/sagar/go/src/Nango-sample-sdk + sourceRevisionDigest: sha256:df54796f529635fb568ba72c74aaaef6cd6648b26e220d76c073c0fa406f7720 + sourceBlobDigest: sha256:ee8fa2cba530915e9b36f27a1b286a0b32b485e920a549ca7a809b1fb5fe68a5 + outLocation: /github/workspace/repo workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index 2968735..255add5 100644 --- a/README.md +++ b/README.md @@ -277,6 +277,68 @@ const sdk = new Nango({ httpClient }); ``` + +## Retries + +Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK. + +To change the default retry strategy for a single API call, simply provide a retryConfig object to the call: +```typescript +import { Nango } from "@speakeasy-sdks/nango"; + +const nango = new Nango(); + +async function run() { + const result = await nango.integrations.list({ + retries: { + strategy: "backoff", + backoff: { + initialInterval: 1, + maxInterval: 50, + exponent: 1.1, + maxElapsedTime: 100, + }, + retryConnectionErrors: false, + }, + }); + + // Handle the result + console.log(result); +} + +run(); + +``` + +If you'd like to override the default retry strategy for all operations that support retries, you can provide a retryConfig at SDK initialization: +```typescript +import { Nango } from "@speakeasy-sdks/nango"; + +const nango = new Nango({ + retryConfig: { + strategy: "backoff", + backoff: { + initialInterval: 1, + maxInterval: 50, + exponent: 1.1, + maxElapsedTime: 100, + }, + retryConnectionErrors: false, + }, +}); + +async function run() { + const result = await nango.integrations.list(); + + // Handle the result + console.log(result); +} + +run(); + +``` + + # Development diff --git a/RELEASES.md b/RELEASES.md index b1b5728..39fe894 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -130,4 +130,12 @@ Based on: ### Generated - [typescript v0.6.0] . ### Releases -- [NPM v0.6.0] https://www.npmjs.com/package/@simplesagar92/nango/v/0.6.0 - . \ No newline at end of file +- [NPM v0.6.0] https://www.npmjs.com/package/@simplesagar92/nango/v/0.6.0 - . + +## 2024-07-14 00:25:52 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.335.0 (2.370.2) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v0.10.0] . \ No newline at end of file diff --git a/RUNTIMES.md b/RUNTIMES.md index 71fa3da..d08a0c0 100644 --- a/RUNTIMES.md +++ b/RUNTIMES.md @@ -3,7 +3,7 @@ This SDK is intended to be used in JavaScript runtimes that support the following features: * [Web Fetch API][web-fetch] -* [Web Streams API](web-streams) and in particular `ReadableStream` +* [Web Streams API][web-streams] and in particular `ReadableStream` * [Async iterables][async-iter] using `Symbol.asyncIterator` [web-fetch]: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API diff --git a/docs/lib/utils/retryconfig.md b/docs/lib/utils/retryconfig.md new file mode 100644 index 0000000..08f95f4 --- /dev/null +++ b/docs/lib/utils/retryconfig.md @@ -0,0 +1,24 @@ +# RetryConfig + +Allows customizing the default retry configuration. It is only permitted in methods that accept retry policies. + +## Fields + +| Name | Type | Description | Example | +| ------------------------- | ----------------------------------- | ------------------------------------------------------------------------------------------ | ----------- | +| `strategy` | `"backoff" | "none"` | The retry strategy to use. | `"backoff"` | +| `backoff` | [BackoffStrategy](#backoffstrategy) | When strategy is "backoff", this configurates for the backoff parameters. | | +| `retryConnectionErrors` | `*boolean*` | When strategy is "backoff", this determines whether or not to retry on connection errors. | `true` | + +## BackoffStrategy + +The backoff strategy allows retrying a request with an exponential backoff between each retry. + +### Fields + +| Name | Type | Description | Example | +| ------------------ | ------------ | ----------------------------------------- | -------- | +| `initialInterval` | `*number*` | The initial interval in milliseconds. | `500` | +| `maxInterval` | `*number*` | The maximum interval in milliseconds. | `60000` | +| `exponent` | `*number*` | The exponent to use for the backoff. | `1.5` | +| `maxElapsedTime` | `*number*` | The maximum elapsed time in milliseconds. | `300000` | \ No newline at end of file diff --git a/docs/sdks/actions/README.md b/docs/sdks/actions/README.md index 74ba993..bef4f79 100644 --- a/docs/sdks/actions/README.md +++ b/docs/sdks/actions/README.md @@ -37,6 +37,7 @@ run(); | `createActionTriggerRequest` | [components.CreateActionTriggerRequest](../../models/components/createactiontriggerrequest.md) | :heavy_check_mark: | N/A | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response diff --git a/docs/sdks/connections/README.md b/docs/sdks/connections/README.md index 6936ada..a8f9037 100644 --- a/docs/sdks/connections/README.md +++ b/docs/sdks/connections/README.md @@ -38,6 +38,7 @@ run(); | `connectionId` | *string* | :heavy_minus_sign: | Filter the list of connections based on this connection ID. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -76,6 +77,7 @@ run(); | `request` | [components.CreateConnectionRequest](../../models/components/createconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -118,6 +120,7 @@ run(); | `refreshToken` | *boolean* | :heavy_minus_sign: | If true, return the refresh token as part of the response (false by default). | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -159,6 +162,7 @@ run(); | `providerConfigKey` | *string* | :heavy_check_mark: | The integration ID used to create the connection (aka Unique Key). | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -201,6 +205,7 @@ run(); | `requestBody` | [operations.CreateMetadataRequestBody](../../models/operations/createmetadatarequestbody.md) | :heavy_check_mark: | N/A | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -243,6 +248,7 @@ run(); | `requestBody` | [operations.UpdateMetadataRequestBody](../../models/operations/updatemetadatarequestbody.md) | :heavy_check_mark: | N/A | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response diff --git a/docs/sdks/environment/README.md b/docs/sdks/environment/README.md index 695e4d3..3ae54b7 100644 --- a/docs/sdks/environment/README.md +++ b/docs/sdks/environment/README.md @@ -32,6 +32,7 @@ run(); | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response diff --git a/docs/sdks/integrations/README.md b/docs/sdks/integrations/README.md index 125154f..78df0e3 100644 --- a/docs/sdks/integrations/README.md +++ b/docs/sdks/integrations/README.md @@ -36,6 +36,7 @@ run(); | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -75,6 +76,7 @@ run(); | `request` | [components.ListIntegrationsRequest](../../models/components/listintegrationsrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -115,6 +117,7 @@ run(); | `request` | [components.UpdateIntegrationRequest](../../models/components/updateintegrationrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -157,6 +160,7 @@ run(); | `includeCreds` | *boolean* | :heavy_minus_sign: | If true, the response will contain the client ID, secret, scopes, auth_mode and app link - if applicable. include_creds is false by default. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -197,6 +201,7 @@ run(); | `providerConfigKey` | *string* | :heavy_check_mark: | The integration ID that you created in Nango. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response diff --git a/docs/sdks/proxy/README.md b/docs/sdks/proxy/README.md index 5a06883..7706bbc 100644 --- a/docs/sdks/proxy/README.md +++ b/docs/sdks/proxy/README.md @@ -41,6 +41,7 @@ run(); | `request` | [operations.GetProxyRequest](../../models/operations/getproxyrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -83,6 +84,7 @@ run(); | `request` | [operations.CreateProxyRequest](../../models/operations/createproxyrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -125,6 +127,7 @@ run(); | `request` | [operations.PutProxyRequest](../../models/operations/putproxyrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -167,6 +170,7 @@ run(); | `request` | [operations.PatchProxyRequest](../../models/operations/patchproxyrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -210,6 +214,7 @@ run(); | `request` | [operations.DeleteProxyRequest](../../models/operations/deleteproxyrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response diff --git a/docs/sdks/records/README.md b/docs/sdks/records/README.md index 0731b82..e310eda 100644 --- a/docs/sdks/records/README.md +++ b/docs/sdks/records/README.md @@ -37,6 +37,7 @@ run(); | `request` | [operations.GetRecordRequest](../../models/operations/getrecordrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response diff --git a/docs/sdks/sync/README.md b/docs/sdks/sync/README.md index 2543d8d..c4c44aa 100644 --- a/docs/sdks/sync/README.md +++ b/docs/sdks/sync/README.md @@ -42,6 +42,7 @@ run(); | `request` | [operations.GetSyncRecordRequest](../../models/operations/getsyncrecordrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -86,6 +87,7 @@ run(); | `request` | [components.CreateSyncTriggerRequest](../../models/components/createsynctriggerrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -130,6 +132,7 @@ run(); | `request` | [components.CreateSyncStartRequest](../../models/components/createsyncstartrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -174,6 +177,7 @@ run(); | `request` | [components.CreateSyncPauseRequest](../../models/components/createsyncpauserequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -216,6 +220,7 @@ run(); | `connectionId` | *string* | :heavy_minus_sign: | The ID of the connection. If omitted, all connections will be surfaced. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -261,6 +266,7 @@ run(); | `request` | [components.UpdateConnectionFrequencyRequest](../../models/components/updateconnectionfrequencyrequest.md) | :heavy_check_mark: | The request object to use for the request. | | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response diff --git a/gen.yaml b/gen.yaml index b4534d4..e914e4a 100644 --- a/gen.yaml +++ b/gen.yaml @@ -12,7 +12,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: false typescript: - version: 0.9.1 + version: 0.10.0 additionalDependencies: dependencies: {} devDependencies: {} @@ -33,6 +33,7 @@ typescript: inputModelSuffix: input maxMethodParams: 4 methodArguments: require-security-and-request + moduleFormat: commonjs outputModelSuffix: output packageName: '@speakeasy-sdks/nango' responseFormat: flat diff --git a/jsr.json b/jsr.json index c951952..7a3422c 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@speakeasy-sdks/nango", - "version": "0.9.1", + "version": "0.10.0", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index 498899b..91566d5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,14 +1,13 @@ { - "name": "@simplesagar92/nango", - "version": "0.6.0", + "name": "@speakeasy-sdks/nango", + "version": "0.10.0", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "@simplesagar92/nango", - "version": "0.6.0", + "name": "@speakeasy-sdks/nango", + "version": "0.10.0", "devDependencies": { - "@types/jsonpath": "^0.2.4", "@typescript-eslint/eslint-plugin": "^7.7.1", "@typescript-eslint/parser": "^7.7.1", "eslint": "^8.57.0", @@ -204,12 +203,6 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, - "node_modules/@types/jsonpath": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/@types/jsonpath/-/jsonpath-0.2.4.tgz", - "integrity": "sha512-K3hxB8Blw0qgW6ExKgMbXQv2UPZBoE2GqLpVY+yr7nMD2Pq86lsuIzyAaiQ7eMqFL5B6di6pxSkogLJEyEHoGA==", - "dev": true - }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "7.13.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.13.0.tgz", @@ -3144,12 +3137,6 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, - "@types/jsonpath": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/@types/jsonpath/-/jsonpath-0.2.4.tgz", - "integrity": "sha512-K3hxB8Blw0qgW6ExKgMbXQv2UPZBoE2GqLpVY+yr7nMD2Pq86lsuIzyAaiQ7eMqFL5B6di6pxSkogLJEyEHoGA==", - "dev": true - }, "@typescript-eslint/eslint-plugin": { "version": "7.13.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.13.0.tgz", diff --git a/package.json b/package.json index 89b9414..f44ce6a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@speakeasy-sdks/nango", - "version": "0.9.1", - "author": "Speakeasy", + "version": "0.10.0", + "author": "Speakeasy", "main": "./index.js", "sideEffects": false, "repository": { @@ -18,7 +18,6 @@ "zod": ">= 3" }, "devDependencies": { - "@types/jsonpath": "^0.2.4", "@typescript-eslint/eslint-plugin": "^7.7.1", "@typescript-eslint/parser": "^7.7.1", "eslint": "^8.57.0", diff --git a/src/lib/config.ts b/src/lib/config.ts index bd4816e..aeab1fc 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -36,6 +36,7 @@ export type SDKOptions = { * Allows overriding the default retry config used by the SDK */ retryConfig?: RetryConfig; + timeoutMs?: number; }; export function serverURLFromOptions(options: SDKOptions): URL | null { @@ -55,7 +56,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "1.0.0", - sdkVersion: "0.9.1", - genVersion: "2.347.4", - userAgent: "speakeasy-sdk/typescript 0.9.1 2.347.4 1.0.0 @speakeasy-sdks/nango", + sdkVersion: "0.10.0", + genVersion: "2.370.2", + userAgent: "speakeasy-sdk/typescript 0.10.0 2.370.2 1.0.0 @speakeasy-sdks/nango", } as const; diff --git a/src/lib/sdks.ts b/src/lib/sdks.ts index cbda9d8..22d8a5c 100644 --- a/src/lib/sdks.ts +++ b/src/lib/sdks.ts @@ -4,13 +4,33 @@ import { ResponseMatcher, HTTPClient, matchStatusCode } from "./http.js"; import { SecurityState, resolveSecurity } from "./security.js"; +import { retry, RetryConfig } from "./retries.js"; import { pathToFunc } from "./url.js"; import { encodeForm } from "./encodings.js"; import { stringToBase64 } from "./base64.js"; +import { SDK_METADATA } from "./config.js"; import { SDKHooks } from "../hooks/hooks.js"; import { HookContext } from "../hooks/types.js"; export type RequestOptions = { + /** + * Sets a timeout, in milliseconds, on HTTP requests made by an SDK method. If + * `fetchOptions.signal` is set then it will take precedence over this option. + */ + timeoutMs?: number; + /** + * Set or override a retry policy on HTTP calls. + */ + retries?: RetryConfig; + /** + * Specifies the status codes which should be retried using the given retry policy. + */ + retryCodes?: string[]; + /** + * Sets various request options on the `fetch` call made by an SDK method. + * + * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options|Request} + */ fetchOptions?: Omit; }; @@ -22,8 +42,21 @@ type RequestConfig = { body?: RequestInit["body"]; headers?: HeadersInit; security?: SecurityState | null; + uaHeader?: string; + timeoutMs?: number; }; +const gt: unknown = typeof globalThis === "undefined" ? null : globalThis; +const webWorkerLike = + typeof gt === "object" && + gt != null && + "importScripts" in gt && + typeof gt["importScripts"] === "function"; +const isBrowserLike = + webWorkerLike || + (typeof navigator !== "undefined" && "serviceWorker" in navigator) || + (typeof window === "object" && typeof window.document !== "undefined"); + export class ClientSDK { private readonly client: HTTPClient; protected readonly baseURL: URL | null; @@ -100,10 +133,26 @@ export class ClientSDK { headers.set(k, v); } + // Only set user agent header in non-browser-like environments since CORS + // policy disallows setting it in browsers e.g. Chrome throws an error. + if (!isBrowserLike) { + headers.set(conf.uaHeader ?? "user-agent", SDK_METADATA.userAgent); + } + + let fetchOptions = options?.fetchOptions; + if (!fetchOptions?.signal && conf.timeoutMs && conf.timeoutMs > 0) { + const timeoutSignal = AbortSignal.timeout(conf.timeoutMs); + if (!fetchOptions) { + fetchOptions = { signal: timeoutSignal }; + } else { + fetchOptions.signal = timeoutSignal; + } + } + const input = this.hooks$.beforeCreateRequest(context, { url: reqURL, options: { - ...options?.fetchOptions, + ...fetchOptions, body: conf.body ?? null, headers, method, @@ -114,27 +163,40 @@ export class ClientSDK { } protected async do$( - req: Request, + request: Request, options: { context: HookContext; errorCodes: number | string | (number | string)[]; + retryConfig?: RetryConfig | undefined; + retryCodes?: string[] | undefined; } ): Promise { const { context, errorCodes } = options; - - let response = await this.client.request(await this.hooks$.beforeRequest(context, req)); - - if (matchStatusCode(response, errorCodes)) { - const result = await this.hooks$.afterError(context, response, null); - if (result.error) { - throw result.error; - } - response = result.response || response; - } else { - response = await this.hooks$.afterSuccess(context, response); - } - - return response; + const retryConfig = options.retryConfig || { strategy: "none" }; + const retryCodes = options.retryCodes || []; + + return retry( + async () => { + const req = request.clone(); + + let response = await this.client.request( + await this.hooks$.beforeRequest(context, req) + ); + + if (matchStatusCode(response, errorCodes)) { + const result = await this.hooks$.afterError(context, response, null); + if (result.error) { + throw result.error; + } + response = result.response || response; + } else { + response = await this.hooks$.afterSuccess(context, response); + } + + return response; + }, + { config: retryConfig, statusCodes: retryCodes } + ); } protected matcher(): ResponseMatcher { diff --git a/src/models/components/createactiontriggerrequest.ts b/src/models/components/createactiontriggerrequest.ts index a358836..ee355fb 100644 --- a/src/models/components/createactiontriggerrequest.ts +++ b/src/models/components/createactiontriggerrequest.ts @@ -22,40 +22,74 @@ export type CreateActionTriggerRequest = { }; /** @internal */ -export namespace Input$ { - export const inboundSchema: z.ZodType = z.object({}); +export const Input$inboundSchema: z.ZodType = z.object({}); + +/** @internal */ +export type Input$Outbound = {}; - export type Outbound = {}; +/** @internal */ +export const Input$outboundSchema: z.ZodType = z.object({}); - export const outboundSchema: z.ZodType = z.object({}); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Input$ { + /** @deprecated use `Input$inboundSchema` instead. */ + export const inboundSchema = Input$inboundSchema; + /** @deprecated use `Input$outboundSchema` instead. */ + export const outboundSchema = Input$outboundSchema; + /** @deprecated use `Input$Outbound` instead. */ + export type Outbound = Input$Outbound; } /** @internal */ -export namespace CreateActionTriggerRequest$ { - export const inboundSchema: z.ZodType = z - .object({ - action_name: z.string(), - input: z.lazy(() => Input$.inboundSchema).optional(), - }) - .transform((v) => { - return remap$(v, { - action_name: "actionName", - }); +export const CreateActionTriggerRequest$inboundSchema: z.ZodType< + CreateActionTriggerRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + action_name: z.string(), + input: z.lazy(() => Input$inboundSchema).optional(), + }) + .transform((v) => { + return remap$(v, { + action_name: "actionName", }); + }); - export type Outbound = { - action_name: string; - input?: Input$.Outbound | undefined; - }; - - export const outboundSchema: z.ZodType = z - .object({ - actionName: z.string(), - input: z.lazy(() => Input$.outboundSchema).optional(), - }) - .transform((v) => { - return remap$(v, { - actionName: "action_name", - }); +/** @internal */ +export type CreateActionTriggerRequest$Outbound = { + action_name: string; + input?: Input$Outbound | undefined; +}; + +/** @internal */ +export const CreateActionTriggerRequest$outboundSchema: z.ZodType< + CreateActionTriggerRequest$Outbound, + z.ZodTypeDef, + CreateActionTriggerRequest +> = z + .object({ + actionName: z.string(), + input: z.lazy(() => Input$outboundSchema).optional(), + }) + .transform((v) => { + return remap$(v, { + actionName: "action_name", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateActionTriggerRequest$ { + /** @deprecated use `CreateActionTriggerRequest$inboundSchema` instead. */ + export const inboundSchema = CreateActionTriggerRequest$inboundSchema; + /** @deprecated use `CreateActionTriggerRequest$outboundSchema` instead. */ + export const outboundSchema = CreateActionTriggerRequest$outboundSchema; + /** @deprecated use `CreateActionTriggerRequest$Outbound` instead. */ + export type Outbound = CreateActionTriggerRequest$Outbound; } diff --git a/src/models/components/createactiontriggerresponse.ts b/src/models/components/createactiontriggerresponse.ts index 17013d3..a15fb29 100644 --- a/src/models/components/createactiontriggerresponse.ts +++ b/src/models/components/createactiontriggerresponse.ts @@ -13,28 +13,49 @@ export type CreateActionTriggerResponse = { }; /** @internal */ -export namespace CreateActionTriggerResponse$ { - export const inboundSchema: z.ZodType = z - .object({ - "your-properties": z.string().optional(), - }) - .transform((v) => { - return remap$(v, { - "your-properties": "yourProperties", - }); +export const CreateActionTriggerResponse$inboundSchema: z.ZodType< + CreateActionTriggerResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + "your-properties": z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + "your-properties": "yourProperties", }); + }); - export type Outbound = { - "your-properties"?: string | undefined; - }; +/** @internal */ +export type CreateActionTriggerResponse$Outbound = { + "your-properties"?: string | undefined; +}; - export const outboundSchema: z.ZodType = z - .object({ - yourProperties: z.string().optional(), - }) - .transform((v) => { - return remap$(v, { - yourProperties: "your-properties", - }); +/** @internal */ +export const CreateActionTriggerResponse$outboundSchema: z.ZodType< + CreateActionTriggerResponse$Outbound, + z.ZodTypeDef, + CreateActionTriggerResponse +> = z + .object({ + yourProperties: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + yourProperties: "your-properties", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateActionTriggerResponse$ { + /** @deprecated use `CreateActionTriggerResponse$inboundSchema` instead. */ + export const inboundSchema = CreateActionTriggerResponse$inboundSchema; + /** @deprecated use `CreateActionTriggerResponse$outboundSchema` instead. */ + export const outboundSchema = CreateActionTriggerResponse$outboundSchema; + /** @deprecated use `CreateActionTriggerResponse$Outbound` instead. */ + export type Outbound = CreateActionTriggerResponse$Outbound; } diff --git a/src/models/components/createconnectionrequest.ts b/src/models/components/createconnectionrequest.ts index 5f11280..ce74cd3 100644 --- a/src/models/components/createconnectionrequest.ts +++ b/src/models/components/createconnectionrequest.ts @@ -7,12 +7,31 @@ import * as z from "zod"; export type CreateConnectionRequest = {}; /** @internal */ -export namespace CreateConnectionRequest$ { - export const inboundSchema: z.ZodType = - z.object({}); +export const CreateConnectionRequest$inboundSchema: z.ZodType< + CreateConnectionRequest, + z.ZodTypeDef, + unknown +> = z.object({}); + +/** @internal */ +export type CreateConnectionRequest$Outbound = {}; - export type Outbound = {}; +/** @internal */ +export const CreateConnectionRequest$outboundSchema: z.ZodType< + CreateConnectionRequest$Outbound, + z.ZodTypeDef, + CreateConnectionRequest +> = z.object({}); - export const outboundSchema: z.ZodType = - z.object({}); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateConnectionRequest$ { + /** @deprecated use `CreateConnectionRequest$inboundSchema` instead. */ + export const inboundSchema = CreateConnectionRequest$inboundSchema; + /** @deprecated use `CreateConnectionRequest$outboundSchema` instead. */ + export const outboundSchema = CreateConnectionRequest$outboundSchema; + /** @deprecated use `CreateConnectionRequest$Outbound` instead. */ + export type Outbound = CreateConnectionRequest$Outbound; } diff --git a/src/models/components/createproxyrequest.ts b/src/models/components/createproxyrequest.ts index 0714b95..3861112 100644 --- a/src/models/components/createproxyrequest.ts +++ b/src/models/components/createproxyrequest.ts @@ -10,28 +10,49 @@ export type CreateProxyRequest = { }; /** @internal */ -export namespace CreateProxyRequest$ { - export const inboundSchema: z.ZodType = z - .object({ - $ANY_BODY_PARAMS: z.string().optional(), - }) - .transform((v) => { - return remap$(v, { - $ANY_BODY_PARAMS: "dollarANYBODYPARAMS", - }); +export const CreateProxyRequest$inboundSchema: z.ZodType< + CreateProxyRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + $ANY_BODY_PARAMS: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + $ANY_BODY_PARAMS: "dollarANYBODYPARAMS", }); + }); - export type Outbound = { - $ANY_BODY_PARAMS?: string | undefined; - }; +/** @internal */ +export type CreateProxyRequest$Outbound = { + $ANY_BODY_PARAMS?: string | undefined; +}; - export const outboundSchema: z.ZodType = z - .object({ - dollarANYBODYPARAMS: z.string().optional(), - }) - .transform((v) => { - return remap$(v, { - dollarANYBODYPARAMS: "$ANY_BODY_PARAMS", - }); +/** @internal */ +export const CreateProxyRequest$outboundSchema: z.ZodType< + CreateProxyRequest$Outbound, + z.ZodTypeDef, + CreateProxyRequest +> = z + .object({ + dollarANYBODYPARAMS: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + dollarANYBODYPARAMS: "$ANY_BODY_PARAMS", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateProxyRequest$ { + /** @deprecated use `CreateProxyRequest$inboundSchema` instead. */ + export const inboundSchema = CreateProxyRequest$inboundSchema; + /** @deprecated use `CreateProxyRequest$outboundSchema` instead. */ + export const outboundSchema = CreateProxyRequest$outboundSchema; + /** @deprecated use `CreateProxyRequest$Outbound` instead. */ + export type Outbound = CreateProxyRequest$Outbound; } diff --git a/src/models/components/createsyncpauserequest.ts b/src/models/components/createsyncpauserequest.ts index 5ab77b0..4f5c14c 100644 --- a/src/models/components/createsyncpauserequest.ts +++ b/src/models/components/createsyncpauserequest.ts @@ -21,36 +21,57 @@ export type CreateSyncPauseRequest = { }; /** @internal */ -export namespace CreateSyncPauseRequest$ { - export const inboundSchema: z.ZodType = z - .object({ - provider_config_key: z.string(), - connection_id: z.string().optional(), - syncs: z.array(z.string()), - }) - .transform((v) => { - return remap$(v, { - provider_config_key: "providerConfigKey", - connection_id: "connectionId", - }); +export const CreateSyncPauseRequest$inboundSchema: z.ZodType< + CreateSyncPauseRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + provider_config_key: z.string(), + connection_id: z.string().optional(), + syncs: z.array(z.string()), + }) + .transform((v) => { + return remap$(v, { + provider_config_key: "providerConfigKey", + connection_id: "connectionId", }); + }); - export type Outbound = { - provider_config_key: string; - connection_id?: string | undefined; - syncs: Array; - }; +/** @internal */ +export type CreateSyncPauseRequest$Outbound = { + provider_config_key: string; + connection_id?: string | undefined; + syncs: Array; +}; - export const outboundSchema: z.ZodType = z - .object({ - providerConfigKey: z.string(), - connectionId: z.string().optional(), - syncs: z.array(z.string()), - }) - .transform((v) => { - return remap$(v, { - providerConfigKey: "provider_config_key", - connectionId: "connection_id", - }); +/** @internal */ +export const CreateSyncPauseRequest$outboundSchema: z.ZodType< + CreateSyncPauseRequest$Outbound, + z.ZodTypeDef, + CreateSyncPauseRequest +> = z + .object({ + providerConfigKey: z.string(), + connectionId: z.string().optional(), + syncs: z.array(z.string()), + }) + .transform((v) => { + return remap$(v, { + providerConfigKey: "provider_config_key", + connectionId: "connection_id", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateSyncPauseRequest$ { + /** @deprecated use `CreateSyncPauseRequest$inboundSchema` instead. */ + export const inboundSchema = CreateSyncPauseRequest$inboundSchema; + /** @deprecated use `CreateSyncPauseRequest$outboundSchema` instead. */ + export const outboundSchema = CreateSyncPauseRequest$outboundSchema; + /** @deprecated use `CreateSyncPauseRequest$Outbound` instead. */ + export type Outbound = CreateSyncPauseRequest$Outbound; } diff --git a/src/models/components/createsyncstartrequest.ts b/src/models/components/createsyncstartrequest.ts index ac52cfa..fa36cdb 100644 --- a/src/models/components/createsyncstartrequest.ts +++ b/src/models/components/createsyncstartrequest.ts @@ -21,36 +21,57 @@ export type CreateSyncStartRequest = { }; /** @internal */ -export namespace CreateSyncStartRequest$ { - export const inboundSchema: z.ZodType = z - .object({ - provider_config_key: z.string(), - connection_id: z.string().optional(), - syncs: z.array(z.string()), - }) - .transform((v) => { - return remap$(v, { - provider_config_key: "providerConfigKey", - connection_id: "connectionId", - }); +export const CreateSyncStartRequest$inboundSchema: z.ZodType< + CreateSyncStartRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + provider_config_key: z.string(), + connection_id: z.string().optional(), + syncs: z.array(z.string()), + }) + .transform((v) => { + return remap$(v, { + provider_config_key: "providerConfigKey", + connection_id: "connectionId", }); + }); - export type Outbound = { - provider_config_key: string; - connection_id?: string | undefined; - syncs: Array; - }; +/** @internal */ +export type CreateSyncStartRequest$Outbound = { + provider_config_key: string; + connection_id?: string | undefined; + syncs: Array; +}; - export const outboundSchema: z.ZodType = z - .object({ - providerConfigKey: z.string(), - connectionId: z.string().optional(), - syncs: z.array(z.string()), - }) - .transform((v) => { - return remap$(v, { - providerConfigKey: "provider_config_key", - connectionId: "connection_id", - }); +/** @internal */ +export const CreateSyncStartRequest$outboundSchema: z.ZodType< + CreateSyncStartRequest$Outbound, + z.ZodTypeDef, + CreateSyncStartRequest +> = z + .object({ + providerConfigKey: z.string(), + connectionId: z.string().optional(), + syncs: z.array(z.string()), + }) + .transform((v) => { + return remap$(v, { + providerConfigKey: "provider_config_key", + connectionId: "connection_id", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateSyncStartRequest$ { + /** @deprecated use `CreateSyncStartRequest$inboundSchema` instead. */ + export const inboundSchema = CreateSyncStartRequest$inboundSchema; + /** @deprecated use `CreateSyncStartRequest$outboundSchema` instead. */ + export const outboundSchema = CreateSyncStartRequest$outboundSchema; + /** @deprecated use `CreateSyncStartRequest$Outbound` instead. */ + export type Outbound = CreateSyncStartRequest$Outbound; } diff --git a/src/models/components/createsynctriggerrequest.ts b/src/models/components/createsynctriggerrequest.ts index 7b841dd..235b45c 100644 --- a/src/models/components/createsynctriggerrequest.ts +++ b/src/models/components/createsynctriggerrequest.ts @@ -21,36 +21,57 @@ export type CreateSyncTriggerRequest = { }; /** @internal */ -export namespace CreateSyncTriggerRequest$ { - export const inboundSchema: z.ZodType = z - .object({ - provider_config_key: z.string(), - connection_id: z.string().optional(), - syncs: z.array(z.string()), - }) - .transform((v) => { - return remap$(v, { - provider_config_key: "providerConfigKey", - connection_id: "connectionId", - }); +export const CreateSyncTriggerRequest$inboundSchema: z.ZodType< + CreateSyncTriggerRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + provider_config_key: z.string(), + connection_id: z.string().optional(), + syncs: z.array(z.string()), + }) + .transform((v) => { + return remap$(v, { + provider_config_key: "providerConfigKey", + connection_id: "connectionId", }); + }); - export type Outbound = { - provider_config_key: string; - connection_id?: string | undefined; - syncs: Array; - }; +/** @internal */ +export type CreateSyncTriggerRequest$Outbound = { + provider_config_key: string; + connection_id?: string | undefined; + syncs: Array; +}; - export const outboundSchema: z.ZodType = z - .object({ - providerConfigKey: z.string(), - connectionId: z.string().optional(), - syncs: z.array(z.string()), - }) - .transform((v) => { - return remap$(v, { - providerConfigKey: "provider_config_key", - connectionId: "connection_id", - }); +/** @internal */ +export const CreateSyncTriggerRequest$outboundSchema: z.ZodType< + CreateSyncTriggerRequest$Outbound, + z.ZodTypeDef, + CreateSyncTriggerRequest +> = z + .object({ + providerConfigKey: z.string(), + connectionId: z.string().optional(), + syncs: z.array(z.string()), + }) + .transform((v) => { + return remap$(v, { + providerConfigKey: "provider_config_key", + connectionId: "connection_id", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateSyncTriggerRequest$ { + /** @deprecated use `CreateSyncTriggerRequest$inboundSchema` instead. */ + export const inboundSchema = CreateSyncTriggerRequest$inboundSchema; + /** @deprecated use `CreateSyncTriggerRequest$outboundSchema` instead. */ + export const outboundSchema = CreateSyncTriggerRequest$outboundSchema; + /** @deprecated use `CreateSyncTriggerRequest$Outbound` instead. */ + export type Outbound = CreateSyncTriggerRequest$Outbound; } diff --git a/src/models/components/getconnectionresponse.ts b/src/models/components/getconnectionresponse.ts index 766043a..f9f6a4e 100644 --- a/src/models/components/getconnectionresponse.ts +++ b/src/models/components/getconnectionresponse.ts @@ -12,31 +12,70 @@ export type GetConnectionResponse = { }; /** @internal */ -export namespace GetConnectionResponseItems$ { - export const inboundSchema: z.ZodType = - z.object({}); +export const GetConnectionResponseItems$inboundSchema: z.ZodType< + GetConnectionResponseItems, + z.ZodTypeDef, + unknown +> = z.object({}); + +/** @internal */ +export type GetConnectionResponseItems$Outbound = {}; - export type Outbound = {}; +/** @internal */ +export const GetConnectionResponseItems$outboundSchema: z.ZodType< + GetConnectionResponseItems$Outbound, + z.ZodTypeDef, + GetConnectionResponseItems +> = z.object({}); - export const outboundSchema: z.ZodType = - z.object({}); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetConnectionResponseItems$ { + /** @deprecated use `GetConnectionResponseItems$inboundSchema` instead. */ + export const inboundSchema = GetConnectionResponseItems$inboundSchema; + /** @deprecated use `GetConnectionResponseItems$outboundSchema` instead. */ + export const outboundSchema = GetConnectionResponseItems$outboundSchema; + /** @deprecated use `GetConnectionResponseItems$Outbound` instead. */ + export type Outbound = GetConnectionResponseItems$Outbound; } /** @internal */ +export const GetConnectionResponse$inboundSchema: z.ZodType< + GetConnectionResponse, + z.ZodTypeDef, + unknown +> = z.object({ + configs: z.array(z.any()), + items: z.lazy(() => GetConnectionResponseItems$inboundSchema).optional(), +}); + +/** @internal */ +export type GetConnectionResponse$Outbound = { + configs: Array; + items?: GetConnectionResponseItems$Outbound | undefined; +}; + +/** @internal */ +export const GetConnectionResponse$outboundSchema: z.ZodType< + GetConnectionResponse$Outbound, + z.ZodTypeDef, + GetConnectionResponse +> = z.object({ + configs: z.array(z.any()), + items: z.lazy(() => GetConnectionResponseItems$outboundSchema).optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace GetConnectionResponse$ { - export const inboundSchema: z.ZodType = z.object({ - configs: z.array(z.any()), - items: z.lazy(() => GetConnectionResponseItems$.inboundSchema).optional(), - }); - - export type Outbound = { - configs: Array; - items?: GetConnectionResponseItems$.Outbound | undefined; - }; - - export const outboundSchema: z.ZodType = - z.object({ - configs: z.array(z.any()), - items: z.lazy(() => GetConnectionResponseItems$.outboundSchema).optional(), - }); + /** @deprecated use `GetConnectionResponse$inboundSchema` instead. */ + export const inboundSchema = GetConnectionResponse$inboundSchema; + /** @deprecated use `GetConnectionResponse$outboundSchema` instead. */ + export const outboundSchema = GetConnectionResponse$outboundSchema; + /** @deprecated use `GetConnectionResponse$Outbound` instead. */ + export type Outbound = GetConnectionResponse$Outbound; } diff --git a/src/models/components/getenvironmentvariableresponse.ts b/src/models/components/getenvironmentvariableresponse.ts index 6f4a003..460fd24 100644 --- a/src/models/components/getenvironmentvariableresponse.ts +++ b/src/models/components/getenvironmentvariableresponse.ts @@ -16,21 +16,40 @@ export type GetEnvironmentVariableResponse = { }; /** @internal */ -export namespace GetEnvironmentVariableResponse$ { - export const inboundSchema: z.ZodType = - z.object({ - name: z.string().optional(), - value: z.string().optional(), - }); +export const GetEnvironmentVariableResponse$inboundSchema: z.ZodType< + GetEnvironmentVariableResponse, + z.ZodTypeDef, + unknown +> = z.object({ + name: z.string().optional(), + value: z.string().optional(), +}); - export type Outbound = { - name?: string | undefined; - value?: string | undefined; - }; +/** @internal */ +export type GetEnvironmentVariableResponse$Outbound = { + name?: string | undefined; + value?: string | undefined; +}; - export const outboundSchema: z.ZodType = - z.object({ - name: z.string().optional(), - value: z.string().optional(), - }); +/** @internal */ +export const GetEnvironmentVariableResponse$outboundSchema: z.ZodType< + GetEnvironmentVariableResponse$Outbound, + z.ZodTypeDef, + GetEnvironmentVariableResponse +> = z.object({ + name: z.string().optional(), + value: z.string().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetEnvironmentVariableResponse$ { + /** @deprecated use `GetEnvironmentVariableResponse$inboundSchema` instead. */ + export const inboundSchema = GetEnvironmentVariableResponse$inboundSchema; + /** @deprecated use `GetEnvironmentVariableResponse$outboundSchema` instead. */ + export const outboundSchema = GetEnvironmentVariableResponse$outboundSchema; + /** @deprecated use `GetEnvironmentVariableResponse$Outbound` instead. */ + export type Outbound = GetEnvironmentVariableResponse$Outbound; } diff --git a/src/models/components/getintegrationresponse.ts b/src/models/components/getintegrationresponse.ts index a9942df..fc9adda 100644 --- a/src/models/components/getintegrationresponse.ts +++ b/src/models/components/getintegrationresponse.ts @@ -12,31 +12,62 @@ export type GetIntegrationResponse = { }; /** @internal */ -export namespace Config$ { - export const inboundSchema: z.ZodType = z.object({}); +export const Config$inboundSchema: z.ZodType = z.object({}); + +/** @internal */ +export type Config$Outbound = {}; - export type Outbound = {}; +/** @internal */ +export const Config$outboundSchema: z.ZodType = z.object({}); - export const outboundSchema: z.ZodType = z.object({}); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Config$ { + /** @deprecated use `Config$inboundSchema` instead. */ + export const inboundSchema = Config$inboundSchema; + /** @deprecated use `Config$outboundSchema` instead. */ + export const outboundSchema = Config$outboundSchema; + /** @deprecated use `Config$Outbound` instead. */ + export type Outbound = Config$Outbound; } /** @internal */ +export const GetIntegrationResponse$inboundSchema: z.ZodType< + GetIntegrationResponse, + z.ZodTypeDef, + unknown +> = z.object({ + config: z.lazy(() => Config$inboundSchema), + properties: z.any().optional(), +}); + +/** @internal */ +export type GetIntegrationResponse$Outbound = { + config: Config$Outbound; + properties?: any | undefined; +}; + +/** @internal */ +export const GetIntegrationResponse$outboundSchema: z.ZodType< + GetIntegrationResponse$Outbound, + z.ZodTypeDef, + GetIntegrationResponse +> = z.object({ + config: z.lazy(() => Config$outboundSchema), + properties: z.any().optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace GetIntegrationResponse$ { - export const inboundSchema: z.ZodType = z.object( - { - config: z.lazy(() => Config$.inboundSchema), - properties: z.any().optional(), - } - ); - - export type Outbound = { - config: Config$.Outbound; - properties?: any | undefined; - }; - - export const outboundSchema: z.ZodType = - z.object({ - config: z.lazy(() => Config$.outboundSchema), - properties: z.any().optional(), - }); + /** @deprecated use `GetIntegrationResponse$inboundSchema` instead. */ + export const inboundSchema = GetIntegrationResponse$inboundSchema; + /** @deprecated use `GetIntegrationResponse$outboundSchema` instead. */ + export const outboundSchema = GetIntegrationResponse$outboundSchema; + /** @deprecated use `GetIntegrationResponse$Outbound` instead. */ + export type Outbound = GetIntegrationResponse$Outbound; } diff --git a/src/models/components/getrecordresponse.ts b/src/models/components/getrecordresponse.ts index 30fbc48..c3a5f9b 100644 --- a/src/models/components/getrecordresponse.ts +++ b/src/models/components/getrecordresponse.ts @@ -50,94 +50,139 @@ export type GetRecordResponse = { }; /** @internal */ +export const GetRecordResponseLastAction$inboundSchema: z.ZodNativeEnum< + typeof GetRecordResponseLastAction +> = z.nativeEnum(GetRecordResponseLastAction); + +/** @internal */ +export const GetRecordResponseLastAction$outboundSchema: z.ZodNativeEnum< + typeof GetRecordResponseLastAction +> = GetRecordResponseLastAction$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace GetRecordResponseLastAction$ { - export const inboundSchema: z.ZodNativeEnum = z.nativeEnum( - GetRecordResponseLastAction - ); - export const outboundSchema: z.ZodNativeEnum = - inboundSchema; + /** @deprecated use `GetRecordResponseLastAction$inboundSchema` instead. */ + export const inboundSchema = GetRecordResponseLastAction$inboundSchema; + /** @deprecated use `GetRecordResponseLastAction$outboundSchema` instead. */ + export const outboundSchema = GetRecordResponseLastAction$outboundSchema; } /** @internal */ -export namespace GetRecordResponseNangoMetadata$ { - export const inboundSchema: z.ZodType = z - .object({ - deleted_at: z.string().optional(), - last_action: GetRecordResponseLastAction$.inboundSchema.optional(), - first_seen_at: z.string().optional(), - last_modified_at: z.string().optional(), - }) - .transform((v) => { - return remap$(v, { - deleted_at: "deletedAt", - last_action: "lastAction", - first_seen_at: "firstSeenAt", - last_modified_at: "lastModifiedAt", - }); +export const GetRecordResponseNangoMetadata$inboundSchema: z.ZodType< + GetRecordResponseNangoMetadata, + z.ZodTypeDef, + unknown +> = z + .object({ + deleted_at: z.string().optional(), + last_action: GetRecordResponseLastAction$inboundSchema.optional(), + first_seen_at: z.string().optional(), + last_modified_at: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + deleted_at: "deletedAt", + last_action: "lastAction", + first_seen_at: "firstSeenAt", + last_modified_at: "lastModifiedAt", }); + }); - export type Outbound = { - deleted_at?: string | undefined; - last_action?: string | undefined; - first_seen_at?: string | undefined; - last_modified_at?: string | undefined; - }; - - export const outboundSchema: z.ZodType = - z - .object({ - deletedAt: z.string().optional(), - lastAction: GetRecordResponseLastAction$.outboundSchema.optional(), - firstSeenAt: z.string().optional(), - lastModifiedAt: z.string().optional(), - }) - .transform((v) => { - return remap$(v, { - deletedAt: "deleted_at", - lastAction: "last_action", - firstSeenAt: "first_seen_at", - lastModifiedAt: "last_modified_at", - }); - }); +/** @internal */ +export type GetRecordResponseNangoMetadata$Outbound = { + deleted_at?: string | undefined; + last_action?: string | undefined; + first_seen_at?: string | undefined; + last_modified_at?: string | undefined; +}; + +/** @internal */ +export const GetRecordResponseNangoMetadata$outboundSchema: z.ZodType< + GetRecordResponseNangoMetadata$Outbound, + z.ZodTypeDef, + GetRecordResponseNangoMetadata +> = z + .object({ + deletedAt: z.string().optional(), + lastAction: GetRecordResponseLastAction$outboundSchema.optional(), + firstSeenAt: z.string().optional(), + lastModifiedAt: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + deletedAt: "deleted_at", + lastAction: "last_action", + firstSeenAt: "first_seen_at", + lastModifiedAt: "last_modified_at", + }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetRecordResponseNangoMetadata$ { + /** @deprecated use `GetRecordResponseNangoMetadata$inboundSchema` instead. */ + export const inboundSchema = GetRecordResponseNangoMetadata$inboundSchema; + /** @deprecated use `GetRecordResponseNangoMetadata$outboundSchema` instead. */ + export const outboundSchema = GetRecordResponseNangoMetadata$outboundSchema; + /** @deprecated use `GetRecordResponseNangoMetadata$Outbound` instead. */ + export type Outbound = GetRecordResponseNangoMetadata$Outbound; } /** @internal */ -export namespace Records$ { - export const inboundSchema: z.ZodType = z - .object({ - "your-properties": z.string().optional(), - _nango_metadata: z.lazy(() => GetRecordResponseNangoMetadata$.inboundSchema).optional(), - }) - .transform((v) => { - return remap$(v, { - "your-properties": "yourProperties", - _nango_metadata: "nangoMetadata", - }); +export const Records$inboundSchema: z.ZodType = z + .object({ + "your-properties": z.string().optional(), + _nango_metadata: z.lazy(() => GetRecordResponseNangoMetadata$inboundSchema).optional(), + }) + .transform((v) => { + return remap$(v, { + "your-properties": "yourProperties", + _nango_metadata: "nangoMetadata", }); + }); - export type Outbound = { - "your-properties"?: string | undefined; - _nango_metadata?: GetRecordResponseNangoMetadata$.Outbound | undefined; - }; +/** @internal */ +export type Records$Outbound = { + "your-properties"?: string | undefined; + _nango_metadata?: GetRecordResponseNangoMetadata$Outbound | undefined; +}; - export const outboundSchema: z.ZodType = z - .object({ - yourProperties: z.string().optional(), - nangoMetadata: z.lazy(() => GetRecordResponseNangoMetadata$.outboundSchema).optional(), - }) - .transform((v) => { - return remap$(v, { - yourProperties: "your-properties", - nangoMetadata: "_nango_metadata", - }); +/** @internal */ +export const Records$outboundSchema: z.ZodType = z + .object({ + yourProperties: z.string().optional(), + nangoMetadata: z.lazy(() => GetRecordResponseNangoMetadata$outboundSchema).optional(), + }) + .transform((v) => { + return remap$(v, { + yourProperties: "your-properties", + nangoMetadata: "_nango_metadata", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Records$ { + /** @deprecated use `Records$inboundSchema` instead. */ + export const inboundSchema = Records$inboundSchema; + /** @deprecated use `Records$outboundSchema` instead. */ + export const outboundSchema = Records$outboundSchema; + /** @deprecated use `Records$Outbound` instead. */ + export type Outbound = Records$Outbound; } /** @internal */ -export namespace GetRecordResponse$ { - export const inboundSchema: z.ZodType = z +export const GetRecordResponse$inboundSchema: z.ZodType = + z .object({ - records: z.array(z.lazy(() => Records$.inboundSchema)).optional(), + records: z.array(z.lazy(() => Records$inboundSchema)).optional(), next_cursor: z.string().optional(), }) .transform((v) => { @@ -146,19 +191,37 @@ export namespace GetRecordResponse$ { }); }); - export type Outbound = { - records?: Array | undefined; - next_cursor?: string | undefined; - }; +/** @internal */ +export type GetRecordResponse$Outbound = { + records?: Array | undefined; + next_cursor?: string | undefined; +}; - export const outboundSchema: z.ZodType = z - .object({ - records: z.array(z.lazy(() => Records$.outboundSchema)).optional(), - nextCursor: z.string().optional(), - }) - .transform((v) => { - return remap$(v, { - nextCursor: "next_cursor", - }); +/** @internal */ +export const GetRecordResponse$outboundSchema: z.ZodType< + GetRecordResponse$Outbound, + z.ZodTypeDef, + GetRecordResponse +> = z + .object({ + records: z.array(z.lazy(() => Records$outboundSchema)).optional(), + nextCursor: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + nextCursor: "next_cursor", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetRecordResponse$ { + /** @deprecated use `GetRecordResponse$inboundSchema` instead. */ + export const inboundSchema = GetRecordResponse$inboundSchema; + /** @deprecated use `GetRecordResponse$outboundSchema` instead. */ + export const outboundSchema = GetRecordResponse$outboundSchema; + /** @deprecated use `GetRecordResponse$Outbound` instead. */ + export type Outbound = GetRecordResponse$Outbound; } diff --git a/src/models/components/getsyncrecordresponse.ts b/src/models/components/getsyncrecordresponse.ts index 4ba8d04..e220a62 100644 --- a/src/models/components/getsyncrecordresponse.ts +++ b/src/models/components/getsyncrecordresponse.ts @@ -42,81 +42,132 @@ export type GetSyncRecordResponse = { }; /** @internal */ +export const LastAction$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(LastAction); + +/** @internal */ +export const LastAction$outboundSchema: z.ZodNativeEnum = + LastAction$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace LastAction$ { - export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(LastAction); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `LastAction$inboundSchema` instead. */ + export const inboundSchema = LastAction$inboundSchema; + /** @deprecated use `LastAction$outboundSchema` instead. */ + export const outboundSchema = LastAction$outboundSchema; } /** @internal */ -export namespace NangoMetadata$ { - export const inboundSchema: z.ZodType = z - .object({ - deleted_at: z.string().optional(), - last_action: LastAction$.inboundSchema.optional(), - first_seen_at: z.string().optional(), - last_modified_at: z.string().optional(), - }) - .transform((v) => { - return remap$(v, { - deleted_at: "deletedAt", - last_action: "lastAction", - first_seen_at: "firstSeenAt", - last_modified_at: "lastModifiedAt", - }); +export const NangoMetadata$inboundSchema: z.ZodType = z + .object({ + deleted_at: z.string().optional(), + last_action: LastAction$inboundSchema.optional(), + first_seen_at: z.string().optional(), + last_modified_at: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + deleted_at: "deletedAt", + last_action: "lastAction", + first_seen_at: "firstSeenAt", + last_modified_at: "lastModifiedAt", }); + }); - export type Outbound = { - deleted_at?: string | undefined; - last_action?: string | undefined; - first_seen_at?: string | undefined; - last_modified_at?: string | undefined; - }; +/** @internal */ +export type NangoMetadata$Outbound = { + deleted_at?: string | undefined; + last_action?: string | undefined; + first_seen_at?: string | undefined; + last_modified_at?: string | undefined; +}; - export const outboundSchema: z.ZodType = z - .object({ - deletedAt: z.string().optional(), - lastAction: LastAction$.outboundSchema.optional(), - firstSeenAt: z.string().optional(), - lastModifiedAt: z.string().optional(), - }) - .transform((v) => { - return remap$(v, { - deletedAt: "deleted_at", - lastAction: "last_action", - firstSeenAt: "first_seen_at", - lastModifiedAt: "last_modified_at", - }); +/** @internal */ +export const NangoMetadata$outboundSchema: z.ZodType< + NangoMetadata$Outbound, + z.ZodTypeDef, + NangoMetadata +> = z + .object({ + deletedAt: z.string().optional(), + lastAction: LastAction$outboundSchema.optional(), + firstSeenAt: z.string().optional(), + lastModifiedAt: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + deletedAt: "deleted_at", + lastAction: "last_action", + firstSeenAt: "first_seen_at", + lastModifiedAt: "last_modified_at", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace NangoMetadata$ { + /** @deprecated use `NangoMetadata$inboundSchema` instead. */ + export const inboundSchema = NangoMetadata$inboundSchema; + /** @deprecated use `NangoMetadata$outboundSchema` instead. */ + export const outboundSchema = NangoMetadata$outboundSchema; + /** @deprecated use `NangoMetadata$Outbound` instead. */ + export type Outbound = NangoMetadata$Outbound; } /** @internal */ -export namespace GetSyncRecordResponse$ { - export const inboundSchema: z.ZodType = z - .object({ - "your-properties": z.string().optional(), - _nango_metadata: z.lazy(() => NangoMetadata$.inboundSchema).optional(), - }) - .transform((v) => { - return remap$(v, { - "your-properties": "yourProperties", - _nango_metadata: "nangoMetadata", - }); +export const GetSyncRecordResponse$inboundSchema: z.ZodType< + GetSyncRecordResponse, + z.ZodTypeDef, + unknown +> = z + .object({ + "your-properties": z.string().optional(), + _nango_metadata: z.lazy(() => NangoMetadata$inboundSchema).optional(), + }) + .transform((v) => { + return remap$(v, { + "your-properties": "yourProperties", + _nango_metadata: "nangoMetadata", }); + }); - export type Outbound = { - "your-properties"?: string | undefined; - _nango_metadata?: NangoMetadata$.Outbound | undefined; - }; +/** @internal */ +export type GetSyncRecordResponse$Outbound = { + "your-properties"?: string | undefined; + _nango_metadata?: NangoMetadata$Outbound | undefined; +}; - export const outboundSchema: z.ZodType = z - .object({ - yourProperties: z.string().optional(), - nangoMetadata: z.lazy(() => NangoMetadata$.outboundSchema).optional(), - }) - .transform((v) => { - return remap$(v, { - yourProperties: "your-properties", - nangoMetadata: "_nango_metadata", - }); +/** @internal */ +export const GetSyncRecordResponse$outboundSchema: z.ZodType< + GetSyncRecordResponse$Outbound, + z.ZodTypeDef, + GetSyncRecordResponse +> = z + .object({ + yourProperties: z.string().optional(), + nangoMetadata: z.lazy(() => NangoMetadata$outboundSchema).optional(), + }) + .transform((v) => { + return remap$(v, { + yourProperties: "your-properties", + nangoMetadata: "_nango_metadata", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetSyncRecordResponse$ { + /** @deprecated use `GetSyncRecordResponse$inboundSchema` instead. */ + export const inboundSchema = GetSyncRecordResponse$inboundSchema; + /** @deprecated use `GetSyncRecordResponse$outboundSchema` instead. */ + export const outboundSchema = GetSyncRecordResponse$outboundSchema; + /** @deprecated use `GetSyncRecordResponse$Outbound` instead. */ + export type Outbound = GetSyncRecordResponse$Outbound; } diff --git a/src/models/components/getsyncstatusresponse.ts b/src/models/components/getsyncstatusresponse.ts index 42b34b9..959df15 100644 --- a/src/models/components/getsyncstatusresponse.ts +++ b/src/models/components/getsyncstatusresponse.ts @@ -68,74 +68,148 @@ export type GetSyncStatusResponse = { }; /** @internal */ +export const Status$inboundSchema: z.ZodNativeEnum = z.nativeEnum(Status); + +/** @internal */ +export const Status$outboundSchema: z.ZodNativeEnum = Status$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace Status$ { - export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(Status); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `Status$inboundSchema` instead. */ + export const inboundSchema = Status$inboundSchema; + /** @deprecated use `Status$outboundSchema` instead. */ + export const outboundSchema = Status$outboundSchema; } /** @internal */ +export const Type$inboundSchema: z.ZodNativeEnum = z.nativeEnum(Type); + +/** @internal */ +export const Type$outboundSchema: z.ZodNativeEnum = Type$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace Type$ { - export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(Type); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `Type$inboundSchema` instead. */ + export const inboundSchema = Type$inboundSchema; + /** @deprecated use `Type$outboundSchema` instead. */ + export const outboundSchema = Type$outboundSchema; } /** @internal */ -export namespace LatestResult$ { - export const inboundSchema: z.ZodType = z.object({}); +export const LatestResult$inboundSchema: z.ZodType = z.object( + {} +); - export type Outbound = {}; +/** @internal */ +export type LatestResult$Outbound = {}; - export const outboundSchema: z.ZodType = z.object({}); +/** @internal */ +export const LatestResult$outboundSchema: z.ZodType< + LatestResult$Outbound, + z.ZodTypeDef, + LatestResult +> = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace LatestResult$ { + /** @deprecated use `LatestResult$inboundSchema` instead. */ + export const inboundSchema = LatestResult$inboundSchema; + /** @deprecated use `LatestResult$outboundSchema` instead. */ + export const outboundSchema = LatestResult$outboundSchema; + /** @deprecated use `LatestResult$Outbound` instead. */ + export type Outbound = LatestResult$Outbound; } /** @internal */ +export const Syncs$inboundSchema: z.ZodType = z.object({ + id: z.string().optional(), + name: z.string().optional(), + status: Status$inboundSchema.optional(), + type: Type$inboundSchema.optional(), + finishedAt: z.string().optional(), + nextScheduledSyncAt: z.string().optional(), + frequency: z.string().optional(), + latestResult: z.lazy(() => LatestResult$inboundSchema).optional(), +}); + +/** @internal */ +export type Syncs$Outbound = { + id?: string | undefined; + name?: string | undefined; + status?: string | undefined; + type?: string | undefined; + finishedAt?: string | undefined; + nextScheduledSyncAt?: string | undefined; + frequency?: string | undefined; + latestResult?: LatestResult$Outbound | undefined; +}; + +/** @internal */ +export const Syncs$outboundSchema: z.ZodType = z.object({ + id: z.string().optional(), + name: z.string().optional(), + status: Status$outboundSchema.optional(), + type: Type$outboundSchema.optional(), + finishedAt: z.string().optional(), + nextScheduledSyncAt: z.string().optional(), + frequency: z.string().optional(), + latestResult: z.lazy(() => LatestResult$outboundSchema).optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace Syncs$ { - export const inboundSchema: z.ZodType = z.object({ - id: z.string().optional(), - name: z.string().optional(), - status: Status$.inboundSchema.optional(), - type: Type$.inboundSchema.optional(), - finishedAt: z.string().optional(), - nextScheduledSyncAt: z.string().optional(), - frequency: z.string().optional(), - latestResult: z.lazy(() => LatestResult$.inboundSchema).optional(), - }); - - export type Outbound = { - id?: string | undefined; - name?: string | undefined; - status?: string | undefined; - type?: string | undefined; - finishedAt?: string | undefined; - nextScheduledSyncAt?: string | undefined; - frequency?: string | undefined; - latestResult?: LatestResult$.Outbound | undefined; - }; - - export const outboundSchema: z.ZodType = z.object({ - id: z.string().optional(), - name: z.string().optional(), - status: Status$.outboundSchema.optional(), - type: Type$.outboundSchema.optional(), - finishedAt: z.string().optional(), - nextScheduledSyncAt: z.string().optional(), - frequency: z.string().optional(), - latestResult: z.lazy(() => LatestResult$.outboundSchema).optional(), - }); + /** @deprecated use `Syncs$inboundSchema` instead. */ + export const inboundSchema = Syncs$inboundSchema; + /** @deprecated use `Syncs$outboundSchema` instead. */ + export const outboundSchema = Syncs$outboundSchema; + /** @deprecated use `Syncs$Outbound` instead. */ + export type Outbound = Syncs$Outbound; } /** @internal */ +export const GetSyncStatusResponse$inboundSchema: z.ZodType< + GetSyncStatusResponse, + z.ZodTypeDef, + unknown +> = z.object({ + syncs: z.array(z.lazy(() => Syncs$inboundSchema)).optional(), +}); + +/** @internal */ +export type GetSyncStatusResponse$Outbound = { + syncs?: Array | undefined; +}; + +/** @internal */ +export const GetSyncStatusResponse$outboundSchema: z.ZodType< + GetSyncStatusResponse$Outbound, + z.ZodTypeDef, + GetSyncStatusResponse +> = z.object({ + syncs: z.array(z.lazy(() => Syncs$outboundSchema)).optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace GetSyncStatusResponse$ { - export const inboundSchema: z.ZodType = z.object({ - syncs: z.array(z.lazy(() => Syncs$.inboundSchema)).optional(), - }); - - export type Outbound = { - syncs?: Array | undefined; - }; - - export const outboundSchema: z.ZodType = - z.object({ - syncs: z.array(z.lazy(() => Syncs$.outboundSchema)).optional(), - }); + /** @deprecated use `GetSyncStatusResponse$inboundSchema` instead. */ + export const inboundSchema = GetSyncStatusResponse$inboundSchema; + /** @deprecated use `GetSyncStatusResponse$outboundSchema` instead. */ + export const outboundSchema = GetSyncStatusResponse$outboundSchema; + /** @deprecated use `GetSyncStatusResponse$Outbound` instead. */ + export type Outbound = GetSyncStatusResponse$Outbound; } diff --git a/src/models/components/integrationsresponse200.ts b/src/models/components/integrationsresponse200.ts index 4f0b98a..35766f3 100644 --- a/src/models/components/integrationsresponse200.ts +++ b/src/models/components/integrationsresponse200.ts @@ -12,30 +12,62 @@ export type IntegrationsResponse200 = { }; /** @internal */ -export namespace Items$ { - export const inboundSchema: z.ZodType = z.object({}); +export const Items$inboundSchema: z.ZodType = z.object({}); + +/** @internal */ +export type Items$Outbound = {}; - export type Outbound = {}; +/** @internal */ +export const Items$outboundSchema: z.ZodType = z.object({}); - export const outboundSchema: z.ZodType = z.object({}); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Items$ { + /** @deprecated use `Items$inboundSchema` instead. */ + export const inboundSchema = Items$inboundSchema; + /** @deprecated use `Items$outboundSchema` instead. */ + export const outboundSchema = Items$outboundSchema; + /** @deprecated use `Items$Outbound` instead. */ + export type Outbound = Items$Outbound; } /** @internal */ +export const IntegrationsResponse200$inboundSchema: z.ZodType< + IntegrationsResponse200, + z.ZodTypeDef, + unknown +> = z.object({ + configs: z.array(z.any()), + items: z.lazy(() => Items$inboundSchema).optional(), +}); + +/** @internal */ +export type IntegrationsResponse200$Outbound = { + configs: Array; + items?: Items$Outbound | undefined; +}; + +/** @internal */ +export const IntegrationsResponse200$outboundSchema: z.ZodType< + IntegrationsResponse200$Outbound, + z.ZodTypeDef, + IntegrationsResponse200 +> = z.object({ + configs: z.array(z.any()), + items: z.lazy(() => Items$outboundSchema).optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace IntegrationsResponse200$ { - export const inboundSchema: z.ZodType = - z.object({ - configs: z.array(z.any()), - items: z.lazy(() => Items$.inboundSchema).optional(), - }); - - export type Outbound = { - configs: Array; - items?: Items$.Outbound | undefined; - }; - - export const outboundSchema: z.ZodType = - z.object({ - configs: z.array(z.any()), - items: z.lazy(() => Items$.outboundSchema).optional(), - }); + /** @deprecated use `IntegrationsResponse200$inboundSchema` instead. */ + export const inboundSchema = IntegrationsResponse200$inboundSchema; + /** @deprecated use `IntegrationsResponse200$outboundSchema` instead. */ + export const outboundSchema = IntegrationsResponse200$outboundSchema; + /** @deprecated use `IntegrationsResponse200$Outbound` instead. */ + export type Outbound = IntegrationsResponse200$Outbound; } diff --git a/src/models/components/listintegrationsrequest.ts b/src/models/components/listintegrationsrequest.ts index 1ce5700..7f97867 100644 --- a/src/models/components/listintegrationsrequest.ts +++ b/src/models/components/listintegrationsrequest.ts @@ -7,12 +7,31 @@ import * as z from "zod"; export type ListIntegrationsRequest = {}; /** @internal */ -export namespace ListIntegrationsRequest$ { - export const inboundSchema: z.ZodType = - z.object({}); +export const ListIntegrationsRequest$inboundSchema: z.ZodType< + ListIntegrationsRequest, + z.ZodTypeDef, + unknown +> = z.object({}); + +/** @internal */ +export type ListIntegrationsRequest$Outbound = {}; - export type Outbound = {}; +/** @internal */ +export const ListIntegrationsRequest$outboundSchema: z.ZodType< + ListIntegrationsRequest$Outbound, + z.ZodTypeDef, + ListIntegrationsRequest +> = z.object({}); - export const outboundSchema: z.ZodType = - z.object({}); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListIntegrationsRequest$ { + /** @deprecated use `ListIntegrationsRequest$inboundSchema` instead. */ + export const inboundSchema = ListIntegrationsRequest$inboundSchema; + /** @deprecated use `ListIntegrationsRequest$outboundSchema` instead. */ + export const outboundSchema = ListIntegrationsRequest$outboundSchema; + /** @deprecated use `ListIntegrationsRequest$Outbound` instead. */ + export type Outbound = ListIntegrationsRequest$Outbound; } diff --git a/src/models/components/patchproxyrequest.ts b/src/models/components/patchproxyrequest.ts index de0ad77..fce7fae 100644 --- a/src/models/components/patchproxyrequest.ts +++ b/src/models/components/patchproxyrequest.ts @@ -10,8 +10,8 @@ export type PatchProxyRequest = { }; /** @internal */ -export namespace PatchProxyRequest$ { - export const inboundSchema: z.ZodType = z +export const PatchProxyRequest$inboundSchema: z.ZodType = + z .object({ $ANY_BODY_PARAMS: z.string().optional(), }) @@ -21,17 +21,35 @@ export namespace PatchProxyRequest$ { }); }); - export type Outbound = { - $ANY_BODY_PARAMS?: string | undefined; - }; +/** @internal */ +export type PatchProxyRequest$Outbound = { + $ANY_BODY_PARAMS?: string | undefined; +}; - export const outboundSchema: z.ZodType = z - .object({ - dollarANYBODYPARAMS: z.string().optional(), - }) - .transform((v) => { - return remap$(v, { - dollarANYBODYPARAMS: "$ANY_BODY_PARAMS", - }); +/** @internal */ +export const PatchProxyRequest$outboundSchema: z.ZodType< + PatchProxyRequest$Outbound, + z.ZodTypeDef, + PatchProxyRequest +> = z + .object({ + dollarANYBODYPARAMS: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + dollarANYBODYPARAMS: "$ANY_BODY_PARAMS", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PatchProxyRequest$ { + /** @deprecated use `PatchProxyRequest$inboundSchema` instead. */ + export const inboundSchema = PatchProxyRequest$inboundSchema; + /** @deprecated use `PatchProxyRequest$outboundSchema` instead. */ + export const outboundSchema = PatchProxyRequest$outboundSchema; + /** @deprecated use `PatchProxyRequest$Outbound` instead. */ + export type Outbound = PatchProxyRequest$Outbound; } diff --git a/src/models/components/putproxyrequest.ts b/src/models/components/putproxyrequest.ts index 41cd49e..d22ab97 100644 --- a/src/models/components/putproxyrequest.ts +++ b/src/models/components/putproxyrequest.ts @@ -10,28 +10,45 @@ export type PutProxyRequest = { }; /** @internal */ -export namespace PutProxyRequest$ { - export const inboundSchema: z.ZodType = z - .object({ - $ANY_BODY_PARAMS: z.string().optional(), - }) - .transform((v) => { - return remap$(v, { - $ANY_BODY_PARAMS: "dollarANYBODYPARAMS", - }); +export const PutProxyRequest$inboundSchema: z.ZodType = z + .object({ + $ANY_BODY_PARAMS: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + $ANY_BODY_PARAMS: "dollarANYBODYPARAMS", }); + }); - export type Outbound = { - $ANY_BODY_PARAMS?: string | undefined; - }; +/** @internal */ +export type PutProxyRequest$Outbound = { + $ANY_BODY_PARAMS?: string | undefined; +}; - export const outboundSchema: z.ZodType = z - .object({ - dollarANYBODYPARAMS: z.string().optional(), - }) - .transform((v) => { - return remap$(v, { - dollarANYBODYPARAMS: "$ANY_BODY_PARAMS", - }); +/** @internal */ +export const PutProxyRequest$outboundSchema: z.ZodType< + PutProxyRequest$Outbound, + z.ZodTypeDef, + PutProxyRequest +> = z + .object({ + dollarANYBODYPARAMS: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + dollarANYBODYPARAMS: "$ANY_BODY_PARAMS", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PutProxyRequest$ { + /** @deprecated use `PutProxyRequest$inboundSchema` instead. */ + export const inboundSchema = PutProxyRequest$inboundSchema; + /** @deprecated use `PutProxyRequest$outboundSchema` instead. */ + export const outboundSchema = PutProxyRequest$outboundSchema; + /** @deprecated use `PutProxyRequest$Outbound` instead. */ + export type Outbound = PutProxyRequest$Outbound; } diff --git a/src/models/components/updateconnectionfrequencyrequest.ts b/src/models/components/updateconnectionfrequencyrequest.ts index b159f46..1cfbd57 100644 --- a/src/models/components/updateconnectionfrequencyrequest.ts +++ b/src/models/components/updateconnectionfrequencyrequest.ts @@ -25,46 +25,62 @@ export type UpdateConnectionFrequencyRequest = { }; /** @internal */ -export namespace UpdateConnectionFrequencyRequest$ { - export const inboundSchema: z.ZodType = - z - .object({ - provider_config_key: z.string(), - connection_id: z.string(), - sync_name: z.string(), - frequency: z.string(), - }) - .transform((v) => { - return remap$(v, { - provider_config_key: "providerConfigKey", - connection_id: "connectionId", - sync_name: "syncName", - }); - }); +export const UpdateConnectionFrequencyRequest$inboundSchema: z.ZodType< + UpdateConnectionFrequencyRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + provider_config_key: z.string(), + connection_id: z.string(), + sync_name: z.string(), + frequency: z.string(), + }) + .transform((v) => { + return remap$(v, { + provider_config_key: "providerConfigKey", + connection_id: "connectionId", + sync_name: "syncName", + }); + }); - export type Outbound = { - provider_config_key: string; - connection_id: string; - sync_name: string; - frequency: string; - }; +/** @internal */ +export type UpdateConnectionFrequencyRequest$Outbound = { + provider_config_key: string; + connection_id: string; + sync_name: string; + frequency: string; +}; - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - UpdateConnectionFrequencyRequest - > = z - .object({ - providerConfigKey: z.string(), - connectionId: z.string(), - syncName: z.string(), - frequency: z.string(), - }) - .transform((v) => { - return remap$(v, { - providerConfigKey: "provider_config_key", - connectionId: "connection_id", - syncName: "sync_name", - }); +/** @internal */ +export const UpdateConnectionFrequencyRequest$outboundSchema: z.ZodType< + UpdateConnectionFrequencyRequest$Outbound, + z.ZodTypeDef, + UpdateConnectionFrequencyRequest +> = z + .object({ + providerConfigKey: z.string(), + connectionId: z.string(), + syncName: z.string(), + frequency: z.string(), + }) + .transform((v) => { + return remap$(v, { + providerConfigKey: "provider_config_key", + connectionId: "connection_id", + syncName: "sync_name", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateConnectionFrequencyRequest$ { + /** @deprecated use `UpdateConnectionFrequencyRequest$inboundSchema` instead. */ + export const inboundSchema = UpdateConnectionFrequencyRequest$inboundSchema; + /** @deprecated use `UpdateConnectionFrequencyRequest$outboundSchema` instead. */ + export const outboundSchema = UpdateConnectionFrequencyRequest$outboundSchema; + /** @deprecated use `UpdateConnectionFrequencyRequest$Outbound` instead. */ + export type Outbound = UpdateConnectionFrequencyRequest$Outbound; } diff --git a/src/models/components/updateconnectionfrequencyresponse.ts b/src/models/components/updateconnectionfrequencyresponse.ts index 884f605..bd5a8a6 100644 --- a/src/models/components/updateconnectionfrequencyresponse.ts +++ b/src/models/components/updateconnectionfrequencyresponse.ts @@ -12,24 +12,37 @@ export type UpdateConnectionFrequencyResponse = { }; /** @internal */ -export namespace UpdateConnectionFrequencyResponse$ { - export const inboundSchema: z.ZodType< - UpdateConnectionFrequencyResponse, - z.ZodTypeDef, - unknown - > = z.object({ - frequency: z.string().optional(), - }); +export const UpdateConnectionFrequencyResponse$inboundSchema: z.ZodType< + UpdateConnectionFrequencyResponse, + z.ZodTypeDef, + unknown +> = z.object({ + frequency: z.string().optional(), +}); + +/** @internal */ +export type UpdateConnectionFrequencyResponse$Outbound = { + frequency?: string | undefined; +}; - export type Outbound = { - frequency?: string | undefined; - }; +/** @internal */ +export const UpdateConnectionFrequencyResponse$outboundSchema: z.ZodType< + UpdateConnectionFrequencyResponse$Outbound, + z.ZodTypeDef, + UpdateConnectionFrequencyResponse +> = z.object({ + frequency: z.string().optional(), +}); - export const outboundSchema: z.ZodType< - Outbound, - z.ZodTypeDef, - UpdateConnectionFrequencyResponse - > = z.object({ - frequency: z.string().optional(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateConnectionFrequencyResponse$ { + /** @deprecated use `UpdateConnectionFrequencyResponse$inboundSchema` instead. */ + export const inboundSchema = UpdateConnectionFrequencyResponse$inboundSchema; + /** @deprecated use `UpdateConnectionFrequencyResponse$outboundSchema` instead. */ + export const outboundSchema = UpdateConnectionFrequencyResponse$outboundSchema; + /** @deprecated use `UpdateConnectionFrequencyResponse$Outbound` instead. */ + export type Outbound = UpdateConnectionFrequencyResponse$Outbound; } diff --git a/src/models/components/updateintegrationrequest.ts b/src/models/components/updateintegrationrequest.ts index 9eef4e7..ab0d2d7 100644 --- a/src/models/components/updateintegrationrequest.ts +++ b/src/models/components/updateintegrationrequest.ts @@ -7,12 +7,31 @@ import * as z from "zod"; export type UpdateIntegrationRequest = {}; /** @internal */ -export namespace UpdateIntegrationRequest$ { - export const inboundSchema: z.ZodType = - z.object({}); +export const UpdateIntegrationRequest$inboundSchema: z.ZodType< + UpdateIntegrationRequest, + z.ZodTypeDef, + unknown +> = z.object({}); + +/** @internal */ +export type UpdateIntegrationRequest$Outbound = {}; - export type Outbound = {}; +/** @internal */ +export const UpdateIntegrationRequest$outboundSchema: z.ZodType< + UpdateIntegrationRequest$Outbound, + z.ZodTypeDef, + UpdateIntegrationRequest +> = z.object({}); - export const outboundSchema: z.ZodType = - z.object({}); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateIntegrationRequest$ { + /** @deprecated use `UpdateIntegrationRequest$inboundSchema` instead. */ + export const inboundSchema = UpdateIntegrationRequest$inboundSchema; + /** @deprecated use `UpdateIntegrationRequest$outboundSchema` instead. */ + export const outboundSchema = UpdateIntegrationRequest$outboundSchema; + /** @deprecated use `UpdateIntegrationRequest$Outbound` instead. */ + export type Outbound = UpdateIntegrationRequest$Outbound; } diff --git a/src/models/errors/response400.ts b/src/models/errors/response400.ts index cc60531..7572285 100644 --- a/src/models/errors/response400.ts +++ b/src/models/errors/response400.ts @@ -19,38 +19,54 @@ export class Response400 extends Error { data$: Response400Data; constructor(err: Response400Data) { - super(""); - this.data$ = err; - - this.message = + const message = "message" in err && typeof err.message === "string" ? err.message - : "API error occurred"; + : `API error occurred: ${JSON.stringify(err)}`; + super(message); + this.data$ = err; this.name = "Response400"; } } /** @internal */ -export namespace Response400$ { - export const inboundSchema: z.ZodType = z - .object({ +export const Response400$inboundSchema: z.ZodType = z + .object({ + message: z.string().optional(), + }) + .transform((v) => { + return new Response400(v); + }); + +/** @internal */ +export type Response400$Outbound = { + message?: string | undefined; +}; + +/** @internal */ +export const Response400$outboundSchema: z.ZodType< + Response400$Outbound, + z.ZodTypeDef, + Response400 +> = z + .instanceof(Response400) + .transform((v) => v.data$) + .pipe( + z.object({ message: z.string().optional(), }) - .transform((v) => { - return new Response400(v); - }); - - export type Outbound = { - message?: string | undefined; - }; - - export const outboundSchema: z.ZodType = z - .instanceof(Response400) - .transform((v) => v.data$) - .pipe( - z.object({ - message: z.string().optional(), - }) - ); + ); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Response400$ { + /** @deprecated use `Response400$inboundSchema` instead. */ + export const inboundSchema = Response400$inboundSchema; + /** @deprecated use `Response400$outboundSchema` instead. */ + export const outboundSchema = Response400$outboundSchema; + /** @deprecated use `Response400$Outbound` instead. */ + export type Outbound = Response400$Outbound; } diff --git a/src/models/errors/response404.ts b/src/models/errors/response404.ts index 477621c..35250ed 100644 --- a/src/models/errors/response404.ts +++ b/src/models/errors/response404.ts @@ -19,38 +19,54 @@ export class Response404 extends Error { data$: Response404Data; constructor(err: Response404Data) { - super(""); - this.data$ = err; - - this.message = + const message = "message" in err && typeof err.message === "string" ? err.message - : "API error occurred"; + : `API error occurred: ${JSON.stringify(err)}`; + super(message); + this.data$ = err; this.name = "Response404"; } } /** @internal */ -export namespace Response404$ { - export const inboundSchema: z.ZodType = z - .object({ +export const Response404$inboundSchema: z.ZodType = z + .object({ + message: z.string().optional(), + }) + .transform((v) => { + return new Response404(v); + }); + +/** @internal */ +export type Response404$Outbound = { + message?: string | undefined; +}; + +/** @internal */ +export const Response404$outboundSchema: z.ZodType< + Response404$Outbound, + z.ZodTypeDef, + Response404 +> = z + .instanceof(Response404) + .transform((v) => v.data$) + .pipe( + z.object({ message: z.string().optional(), }) - .transform((v) => { - return new Response404(v); - }); - - export type Outbound = { - message?: string | undefined; - }; - - export const outboundSchema: z.ZodType = z - .instanceof(Response404) - .transform((v) => v.data$) - .pipe( - z.object({ - message: z.string().optional(), - }) - ); + ); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Response404$ { + /** @deprecated use `Response404$inboundSchema` instead. */ + export const inboundSchema = Response404$inboundSchema; + /** @deprecated use `Response404$outboundSchema` instead. */ + export const outboundSchema = Response404$outboundSchema; + /** @deprecated use `Response404$Outbound` instead. */ + export type Outbound = Response404$Outbound; } diff --git a/src/models/operations/createactiontrigger.ts b/src/models/operations/createactiontrigger.ts index 2469c21..b7b4be2 100644 --- a/src/models/operations/createactiontrigger.ts +++ b/src/models/operations/createactiontrigger.ts @@ -19,38 +19,59 @@ export type CreateActionTriggerRequest = { }; /** @internal */ -export namespace CreateActionTriggerRequest$ { - export const inboundSchema: z.ZodType = z - .object({ - "Connection-Id": z.string(), - "Provider-Config-Key": z.string(), - CreateActionTriggerRequest: components.CreateActionTriggerRequest$.inboundSchema, - }) - .transform((v) => { - return remap$(v, { - "Connection-Id": "connectionId", - "Provider-Config-Key": "providerConfigKey", - CreateActionTriggerRequest: "createActionTriggerRequest", - }); +export const CreateActionTriggerRequest$inboundSchema: z.ZodType< + CreateActionTriggerRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + "Connection-Id": z.string(), + "Provider-Config-Key": z.string(), + CreateActionTriggerRequest: components.CreateActionTriggerRequest$inboundSchema, + }) + .transform((v) => { + return remap$(v, { + "Connection-Id": "connectionId", + "Provider-Config-Key": "providerConfigKey", + CreateActionTriggerRequest: "createActionTriggerRequest", }); + }); - export type Outbound = { - "Connection-Id": string; - "Provider-Config-Key": string; - CreateActionTriggerRequest: components.CreateActionTriggerRequest$.Outbound; - }; +/** @internal */ +export type CreateActionTriggerRequest$Outbound = { + "Connection-Id": string; + "Provider-Config-Key": string; + CreateActionTriggerRequest: components.CreateActionTriggerRequest$Outbound; +}; - export const outboundSchema: z.ZodType = z - .object({ - connectionId: z.string(), - providerConfigKey: z.string(), - createActionTriggerRequest: components.CreateActionTriggerRequest$.outboundSchema, - }) - .transform((v) => { - return remap$(v, { - connectionId: "Connection-Id", - providerConfigKey: "Provider-Config-Key", - createActionTriggerRequest: "CreateActionTriggerRequest", - }); +/** @internal */ +export const CreateActionTriggerRequest$outboundSchema: z.ZodType< + CreateActionTriggerRequest$Outbound, + z.ZodTypeDef, + CreateActionTriggerRequest +> = z + .object({ + connectionId: z.string(), + providerConfigKey: z.string(), + createActionTriggerRequest: components.CreateActionTriggerRequest$outboundSchema, + }) + .transform((v) => { + return remap$(v, { + connectionId: "Connection-Id", + providerConfigKey: "Provider-Config-Key", + createActionTriggerRequest: "CreateActionTriggerRequest", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateActionTriggerRequest$ { + /** @deprecated use `CreateActionTriggerRequest$inboundSchema` instead. */ + export const inboundSchema = CreateActionTriggerRequest$inboundSchema; + /** @deprecated use `CreateActionTriggerRequest$outboundSchema` instead. */ + export const outboundSchema = CreateActionTriggerRequest$outboundSchema; + /** @deprecated use `CreateActionTriggerRequest$Outbound` instead. */ + export type Outbound = CreateActionTriggerRequest$Outbound; } diff --git a/src/models/operations/createmetadata.ts b/src/models/operations/createmetadata.ts index 4320ac9..83f20ab 100644 --- a/src/models/operations/createmetadata.ts +++ b/src/models/operations/createmetadata.ts @@ -20,47 +20,87 @@ export type CreateMetadataRequest = { }; /** @internal */ -export namespace CreateMetadataRequestBody$ { - export const inboundSchema: z.ZodType = - z.object({}); +export const CreateMetadataRequestBody$inboundSchema: z.ZodType< + CreateMetadataRequestBody, + z.ZodTypeDef, + unknown +> = z.object({}); + +/** @internal */ +export type CreateMetadataRequestBody$Outbound = {}; - export type Outbound = {}; +/** @internal */ +export const CreateMetadataRequestBody$outboundSchema: z.ZodType< + CreateMetadataRequestBody$Outbound, + z.ZodTypeDef, + CreateMetadataRequestBody +> = z.object({}); - export const outboundSchema: z.ZodType = - z.object({}); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateMetadataRequestBody$ { + /** @deprecated use `CreateMetadataRequestBody$inboundSchema` instead. */ + export const inboundSchema = CreateMetadataRequestBody$inboundSchema; + /** @deprecated use `CreateMetadataRequestBody$outboundSchema` instead. */ + export const outboundSchema = CreateMetadataRequestBody$outboundSchema; + /** @deprecated use `CreateMetadataRequestBody$Outbound` instead. */ + export type Outbound = CreateMetadataRequestBody$Outbound; } /** @internal */ -export namespace CreateMetadataRequest$ { - export const inboundSchema: z.ZodType = z - .object({ - connectionId: z.string(), - "Provider-Config-Key": z.string(), - RequestBody: z.lazy(() => CreateMetadataRequestBody$.inboundSchema), - }) - .transform((v) => { - return remap$(v, { - "Provider-Config-Key": "providerConfigKey", - RequestBody: "requestBody", - }); +export const CreateMetadataRequest$inboundSchema: z.ZodType< + CreateMetadataRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + connectionId: z.string(), + "Provider-Config-Key": z.string(), + RequestBody: z.lazy(() => CreateMetadataRequestBody$inboundSchema), + }) + .transform((v) => { + return remap$(v, { + "Provider-Config-Key": "providerConfigKey", + RequestBody: "requestBody", }); + }); - export type Outbound = { - connectionId: string; - "Provider-Config-Key": string; - RequestBody: CreateMetadataRequestBody$.Outbound; - }; +/** @internal */ +export type CreateMetadataRequest$Outbound = { + connectionId: string; + "Provider-Config-Key": string; + RequestBody: CreateMetadataRequestBody$Outbound; +}; - export const outboundSchema: z.ZodType = z - .object({ - connectionId: z.string(), - providerConfigKey: z.string(), - requestBody: z.lazy(() => CreateMetadataRequestBody$.outboundSchema), - }) - .transform((v) => { - return remap$(v, { - providerConfigKey: "Provider-Config-Key", - requestBody: "RequestBody", - }); +/** @internal */ +export const CreateMetadataRequest$outboundSchema: z.ZodType< + CreateMetadataRequest$Outbound, + z.ZodTypeDef, + CreateMetadataRequest +> = z + .object({ + connectionId: z.string(), + providerConfigKey: z.string(), + requestBody: z.lazy(() => CreateMetadataRequestBody$outboundSchema), + }) + .transform((v) => { + return remap$(v, { + providerConfigKey: "Provider-Config-Key", + requestBody: "RequestBody", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateMetadataRequest$ { + /** @deprecated use `CreateMetadataRequest$inboundSchema` instead. */ + export const inboundSchema = CreateMetadataRequest$inboundSchema; + /** @deprecated use `CreateMetadataRequest$outboundSchema` instead. */ + export const outboundSchema = CreateMetadataRequest$outboundSchema; + /** @deprecated use `CreateMetadataRequest$Outbound` instead. */ + export type Outbound = CreateMetadataRequest$Outbound; } diff --git a/src/models/operations/createproxy.ts b/src/models/operations/createproxy.ts index 839763c..bdefc73 100644 --- a/src/models/operations/createproxy.ts +++ b/src/models/operations/createproxy.ts @@ -36,61 +36,82 @@ export type CreateProxyRequest = { }; /** @internal */ -export namespace CreateProxyRequest$ { - export const inboundSchema: z.ZodType = z - .object({ - anyPath: z.string(), - "Connection-Id": z.string(), - "Provider-Config-Key": z.string(), - Retries: z.string().optional(), - "Base-Url-Override": z.string().optional(), - Decompress: z.string().optional(), - "nango-proxy-$ANY_HEADER": z.string().optional(), - CreateProxyRequest: components.CreateProxyRequest$.inboundSchema.optional(), - }) - .transform((v) => { - return remap$(v, { - "Connection-Id": "connectionId", - "Provider-Config-Key": "providerConfigKey", - Retries: "retries", - "Base-Url-Override": "baseUrlOverride", - Decompress: "decompress", - "nango-proxy-$ANY_HEADER": "nangoProxyDollarANYHEADER", - CreateProxyRequest: "createProxyRequest", - }); +export const CreateProxyRequest$inboundSchema: z.ZodType< + CreateProxyRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + anyPath: z.string(), + "Connection-Id": z.string(), + "Provider-Config-Key": z.string(), + Retries: z.string().optional(), + "Base-Url-Override": z.string().optional(), + Decompress: z.string().optional(), + "nango-proxy-$ANY_HEADER": z.string().optional(), + CreateProxyRequest: components.CreateProxyRequest$inboundSchema.optional(), + }) + .transform((v) => { + return remap$(v, { + "Connection-Id": "connectionId", + "Provider-Config-Key": "providerConfigKey", + Retries: "retries", + "Base-Url-Override": "baseUrlOverride", + Decompress: "decompress", + "nango-proxy-$ANY_HEADER": "nangoProxyDollarANYHEADER", + CreateProxyRequest: "createProxyRequest", }); + }); - export type Outbound = { - anyPath: string; - "Connection-Id": string; - "Provider-Config-Key": string; - Retries?: string | undefined; - "Base-Url-Override"?: string | undefined; - Decompress?: string | undefined; - "nango-proxy-$ANY_HEADER"?: string | undefined; - CreateProxyRequest?: components.CreateProxyRequest$.Outbound | undefined; - }; +/** @internal */ +export type CreateProxyRequest$Outbound = { + anyPath: string; + "Connection-Id": string; + "Provider-Config-Key": string; + Retries?: string | undefined; + "Base-Url-Override"?: string | undefined; + Decompress?: string | undefined; + "nango-proxy-$ANY_HEADER"?: string | undefined; + CreateProxyRequest?: components.CreateProxyRequest$Outbound | undefined; +}; - export const outboundSchema: z.ZodType = z - .object({ - anyPath: z.string(), - connectionId: z.string(), - providerConfigKey: z.string(), - retries: z.string().optional(), - baseUrlOverride: z.string().optional(), - decompress: z.string().optional(), - nangoProxyDollarANYHEADER: z.string().optional(), - createProxyRequest: components.CreateProxyRequest$.outboundSchema.optional(), - }) - .transform((v) => { - return remap$(v, { - connectionId: "Connection-Id", - providerConfigKey: "Provider-Config-Key", - retries: "Retries", - baseUrlOverride: "Base-Url-Override", - decompress: "Decompress", - nangoProxyDollarANYHEADER: "nango-proxy-$ANY_HEADER", - createProxyRequest: "CreateProxyRequest", - }); +/** @internal */ +export const CreateProxyRequest$outboundSchema: z.ZodType< + CreateProxyRequest$Outbound, + z.ZodTypeDef, + CreateProxyRequest +> = z + .object({ + anyPath: z.string(), + connectionId: z.string(), + providerConfigKey: z.string(), + retries: z.string().optional(), + baseUrlOverride: z.string().optional(), + decompress: z.string().optional(), + nangoProxyDollarANYHEADER: z.string().optional(), + createProxyRequest: components.CreateProxyRequest$outboundSchema.optional(), + }) + .transform((v) => { + return remap$(v, { + connectionId: "Connection-Id", + providerConfigKey: "Provider-Config-Key", + retries: "Retries", + baseUrlOverride: "Base-Url-Override", + decompress: "Decompress", + nangoProxyDollarANYHEADER: "nango-proxy-$ANY_HEADER", + createProxyRequest: "CreateProxyRequest", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateProxyRequest$ { + /** @deprecated use `CreateProxyRequest$inboundSchema` instead. */ + export const inboundSchema = CreateProxyRequest$inboundSchema; + /** @deprecated use `CreateProxyRequest$outboundSchema` instead. */ + export const outboundSchema = CreateProxyRequest$outboundSchema; + /** @deprecated use `CreateProxyRequest$Outbound` instead. */ + export type Outbound = CreateProxyRequest$Outbound; } diff --git a/src/models/operations/deleteconnections.ts b/src/models/operations/deleteconnections.ts index e35a98f..9beea28 100644 --- a/src/models/operations/deleteconnections.ts +++ b/src/models/operations/deleteconnections.ts @@ -17,31 +17,52 @@ export type DeleteConnectionsRequest = { }; /** @internal */ -export namespace DeleteConnectionsRequest$ { - export const inboundSchema: z.ZodType = z - .object({ - connectionId: z.string(), - provider_config_key: z.string(), - }) - .transform((v) => { - return remap$(v, { - provider_config_key: "providerConfigKey", - }); +export const DeleteConnectionsRequest$inboundSchema: z.ZodType< + DeleteConnectionsRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + connectionId: z.string(), + provider_config_key: z.string(), + }) + .transform((v) => { + return remap$(v, { + provider_config_key: "providerConfigKey", }); + }); - export type Outbound = { - connectionId: string; - provider_config_key: string; - }; +/** @internal */ +export type DeleteConnectionsRequest$Outbound = { + connectionId: string; + provider_config_key: string; +}; - export const outboundSchema: z.ZodType = z - .object({ - connectionId: z.string(), - providerConfigKey: z.string(), - }) - .transform((v) => { - return remap$(v, { - providerConfigKey: "provider_config_key", - }); +/** @internal */ +export const DeleteConnectionsRequest$outboundSchema: z.ZodType< + DeleteConnectionsRequest$Outbound, + z.ZodTypeDef, + DeleteConnectionsRequest +> = z + .object({ + connectionId: z.string(), + providerConfigKey: z.string(), + }) + .transform((v) => { + return remap$(v, { + providerConfigKey: "provider_config_key", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DeleteConnectionsRequest$ { + /** @deprecated use `DeleteConnectionsRequest$inboundSchema` instead. */ + export const inboundSchema = DeleteConnectionsRequest$inboundSchema; + /** @deprecated use `DeleteConnectionsRequest$outboundSchema` instead. */ + export const outboundSchema = DeleteConnectionsRequest$outboundSchema; + /** @deprecated use `DeleteConnectionsRequest$Outbound` instead. */ + export type Outbound = DeleteConnectionsRequest$Outbound; } diff --git a/src/models/operations/deleteintegration.ts b/src/models/operations/deleteintegration.ts index 08705a5..c2de015 100644 --- a/src/models/operations/deleteintegration.ts +++ b/src/models/operations/deleteintegration.ts @@ -12,18 +12,37 @@ export type DeleteIntegrationRequest = { }; /** @internal */ -export namespace DeleteIntegrationRequest$ { - export const inboundSchema: z.ZodType = - z.object({ - providerConfigKey: z.string(), - }); +export const DeleteIntegrationRequest$inboundSchema: z.ZodType< + DeleteIntegrationRequest, + z.ZodTypeDef, + unknown +> = z.object({ + providerConfigKey: z.string(), +}); + +/** @internal */ +export type DeleteIntegrationRequest$Outbound = { + providerConfigKey: string; +}; - export type Outbound = { - providerConfigKey: string; - }; +/** @internal */ +export const DeleteIntegrationRequest$outboundSchema: z.ZodType< + DeleteIntegrationRequest$Outbound, + z.ZodTypeDef, + DeleteIntegrationRequest +> = z.object({ + providerConfigKey: z.string(), +}); - export const outboundSchema: z.ZodType = - z.object({ - providerConfigKey: z.string(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DeleteIntegrationRequest$ { + /** @deprecated use `DeleteIntegrationRequest$inboundSchema` instead. */ + export const inboundSchema = DeleteIntegrationRequest$inboundSchema; + /** @deprecated use `DeleteIntegrationRequest$outboundSchema` instead. */ + export const outboundSchema = DeleteIntegrationRequest$outboundSchema; + /** @deprecated use `DeleteIntegrationRequest$Outbound` instead. */ + export type Outbound = DeleteIntegrationRequest$Outbound; } diff --git a/src/models/operations/deleteproxy.ts b/src/models/operations/deleteproxy.ts index e4fc7ae..c94efe5 100644 --- a/src/models/operations/deleteproxy.ts +++ b/src/models/operations/deleteproxy.ts @@ -35,61 +35,82 @@ export type DeleteProxyRequest = { }; /** @internal */ -export namespace DeleteProxyRequest$ { - export const inboundSchema: z.ZodType = z - .object({ - anyPath: z.string(), - $ANY_QUERY_PARAMS: z.string(), - "Connection-Id": z.string(), - "Provider-Config-Key": z.string(), - Retries: z.string().optional(), - "Base-Url-Override": z.string().optional(), - Decompress: z.string().optional(), - "nango-proxy-$ANY_HEADER": z.string().optional(), - }) - .transform((v) => { - return remap$(v, { - $ANY_QUERY_PARAMS: "dollarANYQUERYPARAMS", - "Connection-Id": "connectionId", - "Provider-Config-Key": "providerConfigKey", - Retries: "retries", - "Base-Url-Override": "baseUrlOverride", - Decompress: "decompress", - "nango-proxy-$ANY_HEADER": "nangoProxyDollarANYHEADER", - }); +export const DeleteProxyRequest$inboundSchema: z.ZodType< + DeleteProxyRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + anyPath: z.string(), + $ANY_QUERY_PARAMS: z.string(), + "Connection-Id": z.string(), + "Provider-Config-Key": z.string(), + Retries: z.string().optional(), + "Base-Url-Override": z.string().optional(), + Decompress: z.string().optional(), + "nango-proxy-$ANY_HEADER": z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + $ANY_QUERY_PARAMS: "dollarANYQUERYPARAMS", + "Connection-Id": "connectionId", + "Provider-Config-Key": "providerConfigKey", + Retries: "retries", + "Base-Url-Override": "baseUrlOverride", + Decompress: "decompress", + "nango-proxy-$ANY_HEADER": "nangoProxyDollarANYHEADER", }); + }); - export type Outbound = { - anyPath: string; - $ANY_QUERY_PARAMS: string; - "Connection-Id": string; - "Provider-Config-Key": string; - Retries?: string | undefined; - "Base-Url-Override"?: string | undefined; - Decompress?: string | undefined; - "nango-proxy-$ANY_HEADER"?: string | undefined; - }; +/** @internal */ +export type DeleteProxyRequest$Outbound = { + anyPath: string; + $ANY_QUERY_PARAMS: string; + "Connection-Id": string; + "Provider-Config-Key": string; + Retries?: string | undefined; + "Base-Url-Override"?: string | undefined; + Decompress?: string | undefined; + "nango-proxy-$ANY_HEADER"?: string | undefined; +}; - export const outboundSchema: z.ZodType = z - .object({ - anyPath: z.string(), - dollarANYQUERYPARAMS: z.string(), - connectionId: z.string(), - providerConfigKey: z.string(), - retries: z.string().optional(), - baseUrlOverride: z.string().optional(), - decompress: z.string().optional(), - nangoProxyDollarANYHEADER: z.string().optional(), - }) - .transform((v) => { - return remap$(v, { - dollarANYQUERYPARAMS: "$ANY_QUERY_PARAMS", - connectionId: "Connection-Id", - providerConfigKey: "Provider-Config-Key", - retries: "Retries", - baseUrlOverride: "Base-Url-Override", - decompress: "Decompress", - nangoProxyDollarANYHEADER: "nango-proxy-$ANY_HEADER", - }); +/** @internal */ +export const DeleteProxyRequest$outboundSchema: z.ZodType< + DeleteProxyRequest$Outbound, + z.ZodTypeDef, + DeleteProxyRequest +> = z + .object({ + anyPath: z.string(), + dollarANYQUERYPARAMS: z.string(), + connectionId: z.string(), + providerConfigKey: z.string(), + retries: z.string().optional(), + baseUrlOverride: z.string().optional(), + decompress: z.string().optional(), + nangoProxyDollarANYHEADER: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + dollarANYQUERYPARAMS: "$ANY_QUERY_PARAMS", + connectionId: "Connection-Id", + providerConfigKey: "Provider-Config-Key", + retries: "Retries", + baseUrlOverride: "Base-Url-Override", + decompress: "Decompress", + nangoProxyDollarANYHEADER: "nango-proxy-$ANY_HEADER", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DeleteProxyRequest$ { + /** @deprecated use `DeleteProxyRequest$inboundSchema` instead. */ + export const inboundSchema = DeleteProxyRequest$inboundSchema; + /** @deprecated use `DeleteProxyRequest$outboundSchema` instead. */ + export const outboundSchema = DeleteProxyRequest$outboundSchema; + /** @deprecated use `DeleteProxyRequest$Outbound` instead. */ + export type Outbound = DeleteProxyRequest$Outbound; } diff --git a/src/models/operations/getconnections.ts b/src/models/operations/getconnections.ts index ff62c6e..cd48332 100644 --- a/src/models/operations/getconnections.ts +++ b/src/models/operations/getconnections.ts @@ -25,41 +25,62 @@ export type GetConnectionsRequest = { }; /** @internal */ -export namespace GetConnectionsRequest$ { - export const inboundSchema: z.ZodType = z - .object({ - connectionId: z.string(), - provider_config_key: z.string(), - force_refresh: z.boolean().optional(), - refresh_token: z.boolean().optional(), - }) - .transform((v) => { - return remap$(v, { - provider_config_key: "providerConfigKey", - force_refresh: "forceRefresh", - refresh_token: "refreshToken", - }); +export const GetConnectionsRequest$inboundSchema: z.ZodType< + GetConnectionsRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + connectionId: z.string(), + provider_config_key: z.string(), + force_refresh: z.boolean().optional(), + refresh_token: z.boolean().optional(), + }) + .transform((v) => { + return remap$(v, { + provider_config_key: "providerConfigKey", + force_refresh: "forceRefresh", + refresh_token: "refreshToken", }); + }); - export type Outbound = { - connectionId: string; - provider_config_key: string; - force_refresh?: boolean | undefined; - refresh_token?: boolean | undefined; - }; +/** @internal */ +export type GetConnectionsRequest$Outbound = { + connectionId: string; + provider_config_key: string; + force_refresh?: boolean | undefined; + refresh_token?: boolean | undefined; +}; - export const outboundSchema: z.ZodType = z - .object({ - connectionId: z.string(), - providerConfigKey: z.string(), - forceRefresh: z.boolean().optional(), - refreshToken: z.boolean().optional(), - }) - .transform((v) => { - return remap$(v, { - providerConfigKey: "provider_config_key", - forceRefresh: "force_refresh", - refreshToken: "refresh_token", - }); +/** @internal */ +export const GetConnectionsRequest$outboundSchema: z.ZodType< + GetConnectionsRequest$Outbound, + z.ZodTypeDef, + GetConnectionsRequest +> = z + .object({ + connectionId: z.string(), + providerConfigKey: z.string(), + forceRefresh: z.boolean().optional(), + refreshToken: z.boolean().optional(), + }) + .transform((v) => { + return remap$(v, { + providerConfigKey: "provider_config_key", + forceRefresh: "force_refresh", + refreshToken: "refresh_token", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetConnectionsRequest$ { + /** @deprecated use `GetConnectionsRequest$inboundSchema` instead. */ + export const inboundSchema = GetConnectionsRequest$inboundSchema; + /** @deprecated use `GetConnectionsRequest$outboundSchema` instead. */ + export const outboundSchema = GetConnectionsRequest$outboundSchema; + /** @deprecated use `GetConnectionsRequest$Outbound` instead. */ + export type Outbound = GetConnectionsRequest$Outbound; } diff --git a/src/models/operations/getintegration.ts b/src/models/operations/getintegration.ts index 5df4f23..2761df0 100644 --- a/src/models/operations/getintegration.ts +++ b/src/models/operations/getintegration.ts @@ -17,31 +17,52 @@ export type GetIntegrationRequest = { }; /** @internal */ -export namespace GetIntegrationRequest$ { - export const inboundSchema: z.ZodType = z - .object({ - providerConfigKey: z.string(), - include_creds: z.boolean().optional(), - }) - .transform((v) => { - return remap$(v, { - include_creds: "includeCreds", - }); +export const GetIntegrationRequest$inboundSchema: z.ZodType< + GetIntegrationRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + providerConfigKey: z.string(), + include_creds: z.boolean().optional(), + }) + .transform((v) => { + return remap$(v, { + include_creds: "includeCreds", }); + }); - export type Outbound = { - providerConfigKey: string; - include_creds?: boolean | undefined; - }; +/** @internal */ +export type GetIntegrationRequest$Outbound = { + providerConfigKey: string; + include_creds?: boolean | undefined; +}; - export const outboundSchema: z.ZodType = z - .object({ - providerConfigKey: z.string(), - includeCreds: z.boolean().optional(), - }) - .transform((v) => { - return remap$(v, { - includeCreds: "include_creds", - }); +/** @internal */ +export const GetIntegrationRequest$outboundSchema: z.ZodType< + GetIntegrationRequest$Outbound, + z.ZodTypeDef, + GetIntegrationRequest +> = z + .object({ + providerConfigKey: z.string(), + includeCreds: z.boolean().optional(), + }) + .transform((v) => { + return remap$(v, { + includeCreds: "include_creds", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetIntegrationRequest$ { + /** @deprecated use `GetIntegrationRequest$inboundSchema` instead. */ + export const inboundSchema = GetIntegrationRequest$inboundSchema; + /** @deprecated use `GetIntegrationRequest$outboundSchema` instead. */ + export const outboundSchema = GetIntegrationRequest$outboundSchema; + /** @deprecated use `GetIntegrationRequest$Outbound` instead. */ + export type Outbound = GetIntegrationRequest$Outbound; } diff --git a/src/models/operations/getproxy.ts b/src/models/operations/getproxy.ts index bc9e381..b64847b 100644 --- a/src/models/operations/getproxy.ts +++ b/src/models/operations/getproxy.ts @@ -35,61 +35,78 @@ export type GetProxyRequest = { }; /** @internal */ -export namespace GetProxyRequest$ { - export const inboundSchema: z.ZodType = z - .object({ - anyPath: z.string(), - $ANY_QUERY_PARAMS: z.string(), - "Connection-Id": z.string(), - "Provider-Config-Key": z.string(), - Retries: z.string().optional(), - "Base-Url-Override": z.string().optional(), - Decompress: z.string().optional(), - "nango-proxy-$ANY_HEADER": z.string().optional(), - }) - .transform((v) => { - return remap$(v, { - $ANY_QUERY_PARAMS: "dollarANYQUERYPARAMS", - "Connection-Id": "connectionId", - "Provider-Config-Key": "providerConfigKey", - Retries: "retries", - "Base-Url-Override": "baseUrlOverride", - Decompress: "decompress", - "nango-proxy-$ANY_HEADER": "nangoProxyDollarANYHEADER", - }); +export const GetProxyRequest$inboundSchema: z.ZodType = z + .object({ + anyPath: z.string(), + $ANY_QUERY_PARAMS: z.string(), + "Connection-Id": z.string(), + "Provider-Config-Key": z.string(), + Retries: z.string().optional(), + "Base-Url-Override": z.string().optional(), + Decompress: z.string().optional(), + "nango-proxy-$ANY_HEADER": z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + $ANY_QUERY_PARAMS: "dollarANYQUERYPARAMS", + "Connection-Id": "connectionId", + "Provider-Config-Key": "providerConfigKey", + Retries: "retries", + "Base-Url-Override": "baseUrlOverride", + Decompress: "decompress", + "nango-proxy-$ANY_HEADER": "nangoProxyDollarANYHEADER", }); + }); - export type Outbound = { - anyPath: string; - $ANY_QUERY_PARAMS: string; - "Connection-Id": string; - "Provider-Config-Key": string; - Retries?: string | undefined; - "Base-Url-Override"?: string | undefined; - Decompress?: string | undefined; - "nango-proxy-$ANY_HEADER"?: string | undefined; - }; +/** @internal */ +export type GetProxyRequest$Outbound = { + anyPath: string; + $ANY_QUERY_PARAMS: string; + "Connection-Id": string; + "Provider-Config-Key": string; + Retries?: string | undefined; + "Base-Url-Override"?: string | undefined; + Decompress?: string | undefined; + "nango-proxy-$ANY_HEADER"?: string | undefined; +}; - export const outboundSchema: z.ZodType = z - .object({ - anyPath: z.string(), - dollarANYQUERYPARAMS: z.string(), - connectionId: z.string(), - providerConfigKey: z.string(), - retries: z.string().optional(), - baseUrlOverride: z.string().optional(), - decompress: z.string().optional(), - nangoProxyDollarANYHEADER: z.string().optional(), - }) - .transform((v) => { - return remap$(v, { - dollarANYQUERYPARAMS: "$ANY_QUERY_PARAMS", - connectionId: "Connection-Id", - providerConfigKey: "Provider-Config-Key", - retries: "Retries", - baseUrlOverride: "Base-Url-Override", - decompress: "Decompress", - nangoProxyDollarANYHEADER: "nango-proxy-$ANY_HEADER", - }); +/** @internal */ +export const GetProxyRequest$outboundSchema: z.ZodType< + GetProxyRequest$Outbound, + z.ZodTypeDef, + GetProxyRequest +> = z + .object({ + anyPath: z.string(), + dollarANYQUERYPARAMS: z.string(), + connectionId: z.string(), + providerConfigKey: z.string(), + retries: z.string().optional(), + baseUrlOverride: z.string().optional(), + decompress: z.string().optional(), + nangoProxyDollarANYHEADER: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + dollarANYQUERYPARAMS: "$ANY_QUERY_PARAMS", + connectionId: "Connection-Id", + providerConfigKey: "Provider-Config-Key", + retries: "Retries", + baseUrlOverride: "Base-Url-Override", + decompress: "Decompress", + nangoProxyDollarANYHEADER: "nango-proxy-$ANY_HEADER", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetProxyRequest$ { + /** @deprecated use `GetProxyRequest$inboundSchema` instead. */ + export const inboundSchema = GetProxyRequest$inboundSchema; + /** @deprecated use `GetProxyRequest$outboundSchema` instead. */ + export const outboundSchema = GetProxyRequest$outboundSchema; + /** @deprecated use `GetProxyRequest$Outbound` instead. */ + export type Outbound = GetProxyRequest$Outbound; } diff --git a/src/models/operations/getrecord.ts b/src/models/operations/getrecord.ts index 4d402ee..e3b1f55 100644 --- a/src/models/operations/getrecord.ts +++ b/src/models/operations/getrecord.ts @@ -49,54 +49,82 @@ export type GetRecordRequest = { }; /** @internal */ +export const Filter$inboundSchema: z.ZodNativeEnum = z.nativeEnum(Filter); + +/** @internal */ +export const Filter$outboundSchema: z.ZodNativeEnum = Filter$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace Filter$ { - export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(Filter); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `Filter$inboundSchema` instead. */ + export const inboundSchema = Filter$inboundSchema; + /** @deprecated use `Filter$outboundSchema` instead. */ + export const outboundSchema = Filter$outboundSchema; } /** @internal */ -export namespace GetRecordRequest$ { - export const inboundSchema: z.ZodType = z - .object({ - model: z.string(), - delta: z.string().optional(), - limit: z.number().int().optional(), - cursor: z.string().optional(), - filter: Filter$.inboundSchema.optional(), - "Connection-Id": z.string(), - "Provider-Config-Key": z.string(), - }) - .transform((v) => { - return remap$(v, { - "Connection-Id": "connectionId", - "Provider-Config-Key": "providerConfigKey", - }); +export const GetRecordRequest$inboundSchema: z.ZodType = z + .object({ + model: z.string(), + delta: z.string().optional(), + limit: z.number().int().optional(), + cursor: z.string().optional(), + filter: Filter$inboundSchema.optional(), + "Connection-Id": z.string(), + "Provider-Config-Key": z.string(), + }) + .transform((v) => { + return remap$(v, { + "Connection-Id": "connectionId", + "Provider-Config-Key": "providerConfigKey", }); + }); - export type Outbound = { - model: string; - delta?: string | undefined; - limit?: number | undefined; - cursor?: string | undefined; - filter?: string | undefined; - "Connection-Id": string; - "Provider-Config-Key": string; - }; +/** @internal */ +export type GetRecordRequest$Outbound = { + model: string; + delta?: string | undefined; + limit?: number | undefined; + cursor?: string | undefined; + filter?: string | undefined; + "Connection-Id": string; + "Provider-Config-Key": string; +}; - export const outboundSchema: z.ZodType = z - .object({ - model: z.string(), - delta: z.string().optional(), - limit: z.number().int().optional(), - cursor: z.string().optional(), - filter: Filter$.outboundSchema.optional(), - connectionId: z.string(), - providerConfigKey: z.string(), - }) - .transform((v) => { - return remap$(v, { - connectionId: "Connection-Id", - providerConfigKey: "Provider-Config-Key", - }); +/** @internal */ +export const GetRecordRequest$outboundSchema: z.ZodType< + GetRecordRequest$Outbound, + z.ZodTypeDef, + GetRecordRequest +> = z + .object({ + model: z.string(), + delta: z.string().optional(), + limit: z.number().int().optional(), + cursor: z.string().optional(), + filter: Filter$outboundSchema.optional(), + connectionId: z.string(), + providerConfigKey: z.string(), + }) + .transform((v) => { + return remap$(v, { + connectionId: "Connection-Id", + providerConfigKey: "Provider-Config-Key", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetRecordRequest$ { + /** @deprecated use `GetRecordRequest$inboundSchema` instead. */ + export const inboundSchema = GetRecordRequest$inboundSchema; + /** @deprecated use `GetRecordRequest$outboundSchema` instead. */ + export const outboundSchema = GetRecordRequest$outboundSchema; + /** @deprecated use `GetRecordRequest$Outbound` instead. */ + export type Outbound = GetRecordRequest$Outbound; } diff --git a/src/models/operations/getsyncrecord.ts b/src/models/operations/getsyncrecord.ts index bc6e160..91e036a 100644 --- a/src/models/operations/getsyncrecord.ts +++ b/src/models/operations/getsyncrecord.ts @@ -71,75 +71,130 @@ export type GetSyncRecordRequest = { }; /** @internal */ +export const SortBy$inboundSchema: z.ZodNativeEnum = z.nativeEnum(SortBy); + +/** @internal */ +export const SortBy$outboundSchema: z.ZodNativeEnum = SortBy$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace SortBy$ { - export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(SortBy); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `SortBy$inboundSchema` instead. */ + export const inboundSchema = SortBy$inboundSchema; + /** @deprecated use `SortBy$outboundSchema` instead. */ + export const outboundSchema = SortBy$outboundSchema; } /** @internal */ +export const Order$inboundSchema: z.ZodNativeEnum = z.nativeEnum(Order); + +/** @internal */ +export const Order$outboundSchema: z.ZodNativeEnum = Order$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace Order$ { - export const inboundSchema: z.ZodNativeEnum = z.nativeEnum(Order); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `Order$inboundSchema` instead. */ + export const inboundSchema = Order$inboundSchema; + /** @deprecated use `Order$outboundSchema` instead. */ + export const outboundSchema = Order$outboundSchema; } /** @internal */ +export const QueryParamFilter$inboundSchema: z.ZodNativeEnum = + z.nativeEnum(QueryParamFilter); + +/** @internal */ +export const QueryParamFilter$outboundSchema: z.ZodNativeEnum = + QueryParamFilter$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ export namespace QueryParamFilter$ { - export const inboundSchema: z.ZodNativeEnum = - z.nativeEnum(QueryParamFilter); - export const outboundSchema: z.ZodNativeEnum = inboundSchema; + /** @deprecated use `QueryParamFilter$inboundSchema` instead. */ + export const inboundSchema = QueryParamFilter$inboundSchema; + /** @deprecated use `QueryParamFilter$outboundSchema` instead. */ + export const outboundSchema = QueryParamFilter$outboundSchema; } /** @internal */ -export namespace GetSyncRecordRequest$ { - export const inboundSchema: z.ZodType = z - .object({ - model: z.string(), - delta: z.string().optional(), - limit: z.number().int().optional(), - offset: z.number().int().optional(), - sort_by: SortBy$.inboundSchema.optional(), - order: Order$.inboundSchema.optional(), - filter: QueryParamFilter$.inboundSchema.optional(), - "Connection-Id": z.string(), - "Provider-Config-Key": z.string(), - }) - .transform((v) => { - return remap$(v, { - sort_by: "sortBy", - "Connection-Id": "connectionId", - "Provider-Config-Key": "providerConfigKey", - }); +export const GetSyncRecordRequest$inboundSchema: z.ZodType< + GetSyncRecordRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + model: z.string(), + delta: z.string().optional(), + limit: z.number().int().optional(), + offset: z.number().int().optional(), + sort_by: SortBy$inboundSchema.optional(), + order: Order$inboundSchema.optional(), + filter: QueryParamFilter$inboundSchema.optional(), + "Connection-Id": z.string(), + "Provider-Config-Key": z.string(), + }) + .transform((v) => { + return remap$(v, { + sort_by: "sortBy", + "Connection-Id": "connectionId", + "Provider-Config-Key": "providerConfigKey", }); + }); + +/** @internal */ +export type GetSyncRecordRequest$Outbound = { + model: string; + delta?: string | undefined; + limit?: number | undefined; + offset?: number | undefined; + sort_by?: string | undefined; + order?: string | undefined; + filter?: string | undefined; + "Connection-Id": string; + "Provider-Config-Key": string; +}; - export type Outbound = { - model: string; - delta?: string | undefined; - limit?: number | undefined; - offset?: number | undefined; - sort_by?: string | undefined; - order?: string | undefined; - filter?: string | undefined; - "Connection-Id": string; - "Provider-Config-Key": string; - }; - - export const outboundSchema: z.ZodType = z - .object({ - model: z.string(), - delta: z.string().optional(), - limit: z.number().int().optional(), - offset: z.number().int().optional(), - sortBy: SortBy$.outboundSchema.optional(), - order: Order$.outboundSchema.optional(), - filter: QueryParamFilter$.outboundSchema.optional(), - connectionId: z.string(), - providerConfigKey: z.string(), - }) - .transform((v) => { - return remap$(v, { - sortBy: "sort_by", - connectionId: "Connection-Id", - providerConfigKey: "Provider-Config-Key", - }); +/** @internal */ +export const GetSyncRecordRequest$outboundSchema: z.ZodType< + GetSyncRecordRequest$Outbound, + z.ZodTypeDef, + GetSyncRecordRequest +> = z + .object({ + model: z.string(), + delta: z.string().optional(), + limit: z.number().int().optional(), + offset: z.number().int().optional(), + sortBy: SortBy$outboundSchema.optional(), + order: Order$outboundSchema.optional(), + filter: QueryParamFilter$outboundSchema.optional(), + connectionId: z.string(), + providerConfigKey: z.string(), + }) + .transform((v) => { + return remap$(v, { + sortBy: "sort_by", + connectionId: "Connection-Id", + providerConfigKey: "Provider-Config-Key", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetSyncRecordRequest$ { + /** @deprecated use `GetSyncRecordRequest$inboundSchema` instead. */ + export const inboundSchema = GetSyncRecordRequest$inboundSchema; + /** @deprecated use `GetSyncRecordRequest$outboundSchema` instead. */ + export const outboundSchema = GetSyncRecordRequest$outboundSchema; + /** @deprecated use `GetSyncRecordRequest$Outbound` instead. */ + export type Outbound = GetSyncRecordRequest$Outbound; } diff --git a/src/models/operations/getsyncstatus.ts b/src/models/operations/getsyncstatus.ts index 16dead2..a017a7d 100644 --- a/src/models/operations/getsyncstatus.ts +++ b/src/models/operations/getsyncstatus.ts @@ -21,36 +21,57 @@ export type GetSyncStatusRequest = { }; /** @internal */ -export namespace GetSyncStatusRequest$ { - export const inboundSchema: z.ZodType = z - .object({ - provider_config_key: z.string(), - syncs: z.string(), - connection_id: z.string().optional(), - }) - .transform((v) => { - return remap$(v, { - provider_config_key: "providerConfigKey", - connection_id: "connectionId", - }); +export const GetSyncStatusRequest$inboundSchema: z.ZodType< + GetSyncStatusRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + provider_config_key: z.string(), + syncs: z.string(), + connection_id: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + provider_config_key: "providerConfigKey", + connection_id: "connectionId", }); + }); - export type Outbound = { - provider_config_key: string; - syncs: string; - connection_id?: string | undefined; - }; +/** @internal */ +export type GetSyncStatusRequest$Outbound = { + provider_config_key: string; + syncs: string; + connection_id?: string | undefined; +}; - export const outboundSchema: z.ZodType = z - .object({ - providerConfigKey: z.string(), - syncs: z.string(), - connectionId: z.string().optional(), - }) - .transform((v) => { - return remap$(v, { - providerConfigKey: "provider_config_key", - connectionId: "connection_id", - }); +/** @internal */ +export const GetSyncStatusRequest$outboundSchema: z.ZodType< + GetSyncStatusRequest$Outbound, + z.ZodTypeDef, + GetSyncStatusRequest +> = z + .object({ + providerConfigKey: z.string(), + syncs: z.string(), + connectionId: z.string().optional(), + }) + .transform((v) => { + return remap$(v, { + providerConfigKey: "provider_config_key", + connectionId: "connection_id", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetSyncStatusRequest$ { + /** @deprecated use `GetSyncStatusRequest$inboundSchema` instead. */ + export const inboundSchema = GetSyncStatusRequest$inboundSchema; + /** @deprecated use `GetSyncStatusRequest$outboundSchema` instead. */ + export const outboundSchema = GetSyncStatusRequest$outboundSchema; + /** @deprecated use `GetSyncStatusRequest$Outbound` instead. */ + export type Outbound = GetSyncStatusRequest$Outbound; } diff --git a/src/models/operations/listconnections.ts b/src/models/operations/listconnections.ts index 0cf7638..1c91acd 100644 --- a/src/models/operations/listconnections.ts +++ b/src/models/operations/listconnections.ts @@ -12,19 +12,37 @@ export type ListConnectionsRequest = { }; /** @internal */ -export namespace ListConnectionsRequest$ { - export const inboundSchema: z.ZodType = z.object( - { - connectionId: z.string().optional(), - } - ); +export const ListConnectionsRequest$inboundSchema: z.ZodType< + ListConnectionsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + connectionId: z.string().optional(), +}); + +/** @internal */ +export type ListConnectionsRequest$Outbound = { + connectionId?: string | undefined; +}; - export type Outbound = { - connectionId?: string | undefined; - }; +/** @internal */ +export const ListConnectionsRequest$outboundSchema: z.ZodType< + ListConnectionsRequest$Outbound, + z.ZodTypeDef, + ListConnectionsRequest +> = z.object({ + connectionId: z.string().optional(), +}); - export const outboundSchema: z.ZodType = - z.object({ - connectionId: z.string().optional(), - }); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListConnectionsRequest$ { + /** @deprecated use `ListConnectionsRequest$inboundSchema` instead. */ + export const inboundSchema = ListConnectionsRequest$inboundSchema; + /** @deprecated use `ListConnectionsRequest$outboundSchema` instead. */ + export const outboundSchema = ListConnectionsRequest$outboundSchema; + /** @deprecated use `ListConnectionsRequest$Outbound` instead. */ + export type Outbound = ListConnectionsRequest$Outbound; } diff --git a/src/models/operations/patchproxy.ts b/src/models/operations/patchproxy.ts index b4b7f98..6953c24 100644 --- a/src/models/operations/patchproxy.ts +++ b/src/models/operations/patchproxy.ts @@ -36,8 +36,8 @@ export type PatchProxyRequest = { }; /** @internal */ -export namespace PatchProxyRequest$ { - export const inboundSchema: z.ZodType = z +export const PatchProxyRequest$inboundSchema: z.ZodType = + z .object({ anyPath: z.string(), "Connection-Id": z.string(), @@ -46,7 +46,7 @@ export namespace PatchProxyRequest$ { "Base-Url-Override": z.string().optional(), Decompress: z.string().optional(), "nango-proxy-$ANY_HEADER": z.string().optional(), - PatchProxyRequest: components.PatchProxyRequest$.inboundSchema.optional(), + PatchProxyRequest: components.PatchProxyRequest$inboundSchema.optional(), }) .transform((v) => { return remap$(v, { @@ -60,37 +60,55 @@ export namespace PatchProxyRequest$ { }); }); - export type Outbound = { - anyPath: string; - "Connection-Id": string; - "Provider-Config-Key": string; - Retries?: string | undefined; - "Base-Url-Override"?: string | undefined; - Decompress?: string | undefined; - "nango-proxy-$ANY_HEADER"?: string | undefined; - PatchProxyRequest?: components.PatchProxyRequest$.Outbound | undefined; - }; +/** @internal */ +export type PatchProxyRequest$Outbound = { + anyPath: string; + "Connection-Id": string; + "Provider-Config-Key": string; + Retries?: string | undefined; + "Base-Url-Override"?: string | undefined; + Decompress?: string | undefined; + "nango-proxy-$ANY_HEADER"?: string | undefined; + PatchProxyRequest?: components.PatchProxyRequest$Outbound | undefined; +}; - export const outboundSchema: z.ZodType = z - .object({ - anyPath: z.string(), - connectionId: z.string(), - providerConfigKey: z.string(), - retries: z.string().optional(), - baseUrlOverride: z.string().optional(), - decompress: z.string().optional(), - nangoProxyDollarANYHEADER: z.string().optional(), - patchProxyRequest: components.PatchProxyRequest$.outboundSchema.optional(), - }) - .transform((v) => { - return remap$(v, { - connectionId: "Connection-Id", - providerConfigKey: "Provider-Config-Key", - retries: "Retries", - baseUrlOverride: "Base-Url-Override", - decompress: "Decompress", - nangoProxyDollarANYHEADER: "nango-proxy-$ANY_HEADER", - patchProxyRequest: "PatchProxyRequest", - }); +/** @internal */ +export const PatchProxyRequest$outboundSchema: z.ZodType< + PatchProxyRequest$Outbound, + z.ZodTypeDef, + PatchProxyRequest +> = z + .object({ + anyPath: z.string(), + connectionId: z.string(), + providerConfigKey: z.string(), + retries: z.string().optional(), + baseUrlOverride: z.string().optional(), + decompress: z.string().optional(), + nangoProxyDollarANYHEADER: z.string().optional(), + patchProxyRequest: components.PatchProxyRequest$outboundSchema.optional(), + }) + .transform((v) => { + return remap$(v, { + connectionId: "Connection-Id", + providerConfigKey: "Provider-Config-Key", + retries: "Retries", + baseUrlOverride: "Base-Url-Override", + decompress: "Decompress", + nangoProxyDollarANYHEADER: "nango-proxy-$ANY_HEADER", + patchProxyRequest: "PatchProxyRequest", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PatchProxyRequest$ { + /** @deprecated use `PatchProxyRequest$inboundSchema` instead. */ + export const inboundSchema = PatchProxyRequest$inboundSchema; + /** @deprecated use `PatchProxyRequest$outboundSchema` instead. */ + export const outboundSchema = PatchProxyRequest$outboundSchema; + /** @deprecated use `PatchProxyRequest$Outbound` instead. */ + export type Outbound = PatchProxyRequest$Outbound; } diff --git a/src/models/operations/putproxy.ts b/src/models/operations/putproxy.ts index 93ecc84..85b7d54 100644 --- a/src/models/operations/putproxy.ts +++ b/src/models/operations/putproxy.ts @@ -36,61 +36,78 @@ export type PutProxyRequest = { }; /** @internal */ -export namespace PutProxyRequest$ { - export const inboundSchema: z.ZodType = z - .object({ - anyPath: z.string(), - "Connection-Id": z.string(), - "Provider-Config-Key": z.string(), - Retries: z.string().optional(), - "Base-Url-Override": z.string().optional(), - Decompress: z.string().optional(), - "nango-proxy-$ANY_HEADER": z.string().optional(), - PutProxyRequest: components.PutProxyRequest$.inboundSchema.optional(), - }) - .transform((v) => { - return remap$(v, { - "Connection-Id": "connectionId", - "Provider-Config-Key": "providerConfigKey", - Retries: "retries", - "Base-Url-Override": "baseUrlOverride", - Decompress: "decompress", - "nango-proxy-$ANY_HEADER": "nangoProxyDollarANYHEADER", - PutProxyRequest: "putProxyRequest", - }); +export const PutProxyRequest$inboundSchema: z.ZodType = z + .object({ + anyPath: z.string(), + "Connection-Id": z.string(), + "Provider-Config-Key": z.string(), + Retries: z.string().optional(), + "Base-Url-Override": z.string().optional(), + Decompress: z.string().optional(), + "nango-proxy-$ANY_HEADER": z.string().optional(), + PutProxyRequest: components.PutProxyRequest$inboundSchema.optional(), + }) + .transform((v) => { + return remap$(v, { + "Connection-Id": "connectionId", + "Provider-Config-Key": "providerConfigKey", + Retries: "retries", + "Base-Url-Override": "baseUrlOverride", + Decompress: "decompress", + "nango-proxy-$ANY_HEADER": "nangoProxyDollarANYHEADER", + PutProxyRequest: "putProxyRequest", }); + }); - export type Outbound = { - anyPath: string; - "Connection-Id": string; - "Provider-Config-Key": string; - Retries?: string | undefined; - "Base-Url-Override"?: string | undefined; - Decompress?: string | undefined; - "nango-proxy-$ANY_HEADER"?: string | undefined; - PutProxyRequest?: components.PutProxyRequest$.Outbound | undefined; - }; +/** @internal */ +export type PutProxyRequest$Outbound = { + anyPath: string; + "Connection-Id": string; + "Provider-Config-Key": string; + Retries?: string | undefined; + "Base-Url-Override"?: string | undefined; + Decompress?: string | undefined; + "nango-proxy-$ANY_HEADER"?: string | undefined; + PutProxyRequest?: components.PutProxyRequest$Outbound | undefined; +}; - export const outboundSchema: z.ZodType = z - .object({ - anyPath: z.string(), - connectionId: z.string(), - providerConfigKey: z.string(), - retries: z.string().optional(), - baseUrlOverride: z.string().optional(), - decompress: z.string().optional(), - nangoProxyDollarANYHEADER: z.string().optional(), - putProxyRequest: components.PutProxyRequest$.outboundSchema.optional(), - }) - .transform((v) => { - return remap$(v, { - connectionId: "Connection-Id", - providerConfigKey: "Provider-Config-Key", - retries: "Retries", - baseUrlOverride: "Base-Url-Override", - decompress: "Decompress", - nangoProxyDollarANYHEADER: "nango-proxy-$ANY_HEADER", - putProxyRequest: "PutProxyRequest", - }); +/** @internal */ +export const PutProxyRequest$outboundSchema: z.ZodType< + PutProxyRequest$Outbound, + z.ZodTypeDef, + PutProxyRequest +> = z + .object({ + anyPath: z.string(), + connectionId: z.string(), + providerConfigKey: z.string(), + retries: z.string().optional(), + baseUrlOverride: z.string().optional(), + decompress: z.string().optional(), + nangoProxyDollarANYHEADER: z.string().optional(), + putProxyRequest: components.PutProxyRequest$outboundSchema.optional(), + }) + .transform((v) => { + return remap$(v, { + connectionId: "Connection-Id", + providerConfigKey: "Provider-Config-Key", + retries: "Retries", + baseUrlOverride: "Base-Url-Override", + decompress: "Decompress", + nangoProxyDollarANYHEADER: "nango-proxy-$ANY_HEADER", + putProxyRequest: "PutProxyRequest", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PutProxyRequest$ { + /** @deprecated use `PutProxyRequest$inboundSchema` instead. */ + export const inboundSchema = PutProxyRequest$inboundSchema; + /** @deprecated use `PutProxyRequest$outboundSchema` instead. */ + export const outboundSchema = PutProxyRequest$outboundSchema; + /** @deprecated use `PutProxyRequest$Outbound` instead. */ + export type Outbound = PutProxyRequest$Outbound; } diff --git a/src/models/operations/updatemetadata.ts b/src/models/operations/updatemetadata.ts index 132f0a9..6896517 100644 --- a/src/models/operations/updatemetadata.ts +++ b/src/models/operations/updatemetadata.ts @@ -25,58 +25,117 @@ export type UpdateMetadataRequest = { export type UpdateMetadataResponseBody = {}; /** @internal */ -export namespace UpdateMetadataRequestBody$ { - export const inboundSchema: z.ZodType = - z.object({}); +export const UpdateMetadataRequestBody$inboundSchema: z.ZodType< + UpdateMetadataRequestBody, + z.ZodTypeDef, + unknown +> = z.object({}); + +/** @internal */ +export type UpdateMetadataRequestBody$Outbound = {}; - export type Outbound = {}; +/** @internal */ +export const UpdateMetadataRequestBody$outboundSchema: z.ZodType< + UpdateMetadataRequestBody$Outbound, + z.ZodTypeDef, + UpdateMetadataRequestBody +> = z.object({}); - export const outboundSchema: z.ZodType = - z.object({}); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateMetadataRequestBody$ { + /** @deprecated use `UpdateMetadataRequestBody$inboundSchema` instead. */ + export const inboundSchema = UpdateMetadataRequestBody$inboundSchema; + /** @deprecated use `UpdateMetadataRequestBody$outboundSchema` instead. */ + export const outboundSchema = UpdateMetadataRequestBody$outboundSchema; + /** @deprecated use `UpdateMetadataRequestBody$Outbound` instead. */ + export type Outbound = UpdateMetadataRequestBody$Outbound; } /** @internal */ -export namespace UpdateMetadataRequest$ { - export const inboundSchema: z.ZodType = z - .object({ - connectionId: z.string(), - "Provider-Config-Key": z.string(), - RequestBody: z.lazy(() => UpdateMetadataRequestBody$.inboundSchema), - }) - .transform((v) => { - return remap$(v, { - "Provider-Config-Key": "providerConfigKey", - RequestBody: "requestBody", - }); +export const UpdateMetadataRequest$inboundSchema: z.ZodType< + UpdateMetadataRequest, + z.ZodTypeDef, + unknown +> = z + .object({ + connectionId: z.string(), + "Provider-Config-Key": z.string(), + RequestBody: z.lazy(() => UpdateMetadataRequestBody$inboundSchema), + }) + .transform((v) => { + return remap$(v, { + "Provider-Config-Key": "providerConfigKey", + RequestBody: "requestBody", }); + }); + +/** @internal */ +export type UpdateMetadataRequest$Outbound = { + connectionId: string; + "Provider-Config-Key": string; + RequestBody: UpdateMetadataRequestBody$Outbound; +}; - export type Outbound = { - connectionId: string; - "Provider-Config-Key": string; - RequestBody: UpdateMetadataRequestBody$.Outbound; - }; - - export const outboundSchema: z.ZodType = z - .object({ - connectionId: z.string(), - providerConfigKey: z.string(), - requestBody: z.lazy(() => UpdateMetadataRequestBody$.outboundSchema), - }) - .transform((v) => { - return remap$(v, { - providerConfigKey: "Provider-Config-Key", - requestBody: "RequestBody", - }); +/** @internal */ +export const UpdateMetadataRequest$outboundSchema: z.ZodType< + UpdateMetadataRequest$Outbound, + z.ZodTypeDef, + UpdateMetadataRequest +> = z + .object({ + connectionId: z.string(), + providerConfigKey: z.string(), + requestBody: z.lazy(() => UpdateMetadataRequestBody$outboundSchema), + }) + .transform((v) => { + return remap$(v, { + providerConfigKey: "Provider-Config-Key", + requestBody: "RequestBody", }); + }); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateMetadataRequest$ { + /** @deprecated use `UpdateMetadataRequest$inboundSchema` instead. */ + export const inboundSchema = UpdateMetadataRequest$inboundSchema; + /** @deprecated use `UpdateMetadataRequest$outboundSchema` instead. */ + export const outboundSchema = UpdateMetadataRequest$outboundSchema; + /** @deprecated use `UpdateMetadataRequest$Outbound` instead. */ + export type Outbound = UpdateMetadataRequest$Outbound; } /** @internal */ -export namespace UpdateMetadataResponseBody$ { - export const inboundSchema: z.ZodType = - z.object({}); +export const UpdateMetadataResponseBody$inboundSchema: z.ZodType< + UpdateMetadataResponseBody, + z.ZodTypeDef, + unknown +> = z.object({}); - export type Outbound = {}; +/** @internal */ +export type UpdateMetadataResponseBody$Outbound = {}; + +/** @internal */ +export const UpdateMetadataResponseBody$outboundSchema: z.ZodType< + UpdateMetadataResponseBody$Outbound, + z.ZodTypeDef, + UpdateMetadataResponseBody +> = z.object({}); - export const outboundSchema: z.ZodType = - z.object({}); +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateMetadataResponseBody$ { + /** @deprecated use `UpdateMetadataResponseBody$inboundSchema` instead. */ + export const inboundSchema = UpdateMetadataResponseBody$inboundSchema; + /** @deprecated use `UpdateMetadataResponseBody$outboundSchema` instead. */ + export const outboundSchema = UpdateMetadataResponseBody$outboundSchema; + /** @deprecated use `UpdateMetadataResponseBody$Outbound` instead. */ + export type Outbound = UpdateMetadataResponseBody$Outbound; } diff --git a/src/sdk/actions.ts b/src/sdk/actions.ts index 750f142..f28f7d3 100644 --- a/src/sdk/actions.ts +++ b/src/sdk/actions.ts @@ -3,7 +3,7 @@ */ import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; +import { SDKOptions, serverURLFromOptions } from "../lib/config.js"; import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js"; import { HTTPClient } from "../lib/http.js"; import * as schemas$ from "../lib/schemas.js"; @@ -56,14 +56,10 @@ export class Actions extends ClientSDK { providerConfigKey: providerConfigKey, createActionTriggerRequest: createActionTriggerRequest, }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); const payload$ = schemas$.parse( input$, - (value$) => operations.CreateActionTriggerRequest$.outboundSchema.parse(value$), + (value$) => operations.CreateActionTriggerRequest$outboundSchema.parse(value$), "Input validation failed" ); const body$ = encodeJSON$("body", payload$.CreateActionTriggerRequest, { explode: true }); @@ -72,42 +68,53 @@ export class Actions extends ClientSDK { const query$ = ""; - headers$.set( - "Connection-Id", - encodeSimple$("Connection-Id", payload$["Connection-Id"], { + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + "Connection-Id": encodeSimple$("Connection-Id", payload$["Connection-Id"], { explode: false, charEncoding: "none", - }) - ); - headers$.set( - "Provider-Config-Key", - encodeSimple$("Provider-Config-Key", payload$["Provider-Config-Key"], { - explode: false, - charEncoding: "none", - }) - ); + }), + "Provider-Config-Key": encodeSimple$( + "Provider-Config-Key", + payload$["Provider-Config-Key"], + { explode: false, charEncoding: "none" } + ), + }); + const context = { operationID: "createActionTrigger", oAuth2Scopes: [], securitySource: null, }; - const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] }; const request$ = this.createRequest$( context, - { method: "POST", path: path$, headers: headers$, query: query$, body: body$ }, + { + method: "POST", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || this.options$.timeoutMs || -1, + }, options ); - const response = await this.do$(request$, doOptions); + const response = await this.do$(request$, { + context, + errorCodes: ["400", "4XX", "5XX"], + retryConfig: options?.retries || this.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); const responseFields$ = { HttpMeta: { Response: response, Request: request$ }, }; const [result$] = await this.matcher() - .json(200, components.CreateActionTriggerResponse$) - .json(400, errors.Response400$, { err: true }) + .json(200, components.CreateActionTriggerResponse$inboundSchema) + .json(400, errors.Response400$inboundSchema, { err: true }) .fail(["4XX", "5XX"]) .match(response, { extraFields: responseFields$ }); diff --git a/src/sdk/connections.ts b/src/sdk/connections.ts index f267f78..8c67662 100644 --- a/src/sdk/connections.ts +++ b/src/sdk/connections.ts @@ -3,7 +3,7 @@ */ import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; +import { SDKOptions, serverURLFromOptions } from "../lib/config.js"; import { encodeFormQuery as encodeFormQuery$, encodeJSON as encodeJSON$, @@ -57,13 +57,10 @@ export class Connections extends ClientSDK { const input$: operations.ListConnectionsRequest = { connectionId: connectionId, }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); const payload$ = schemas$.parse( input$, - (value$) => operations.ListConnectionsRequest$.outboundSchema.parse(value$), + (value$) => operations.ListConnectionsRequest$outboundSchema.parse(value$), "Input validation failed" ); const body$ = null; @@ -74,19 +71,34 @@ export class Connections extends ClientSDK { connectionId: payload$.connectionId, }); + const headers$ = new Headers({ + Accept: "application/json", + }); + const context = { operationID: "listConnections", oAuth2Scopes: [], securitySource: null }; - const doOptions = { context, errorCodes: ["4XX", "5XX"] }; const request$ = this.createRequest$( context, - { method: "GET", path: path$, headers: headers$, query: query$, body: body$ }, + { + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || this.options$.timeoutMs || -1, + }, options ); - const response = await this.do$(request$, doOptions); + const response = await this.do$(request$, { + context, + errorCodes: ["4XX", "5XX"], + retryConfig: options?.retries || this.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); const [result$] = await this.matcher() - .json(200, components.GetConnectionResponse$) + .json(200, components.GetConnectionResponse$inboundSchema) .fail(["4XX", "5XX"]) .match(response); @@ -105,25 +117,36 @@ export class Connections extends ClientSDK { ): Promise { const input$ = request; void input$; // request input is unused - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); const path$ = this.templateURLComponent("/connection")(); const query$ = ""; + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + const context = { operationID: "createConnection", oAuth2Scopes: [], securitySource: null }; - const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] }; const request$ = this.createRequest$( context, - { method: "POST", path: path$, headers: headers$, query: query$ }, + { + method: "POST", + path: path$, + headers: headers$, + query: query$, + timeoutMs: options?.timeoutMs || this.options$.timeoutMs || -1, + }, options ); - const response = await this.do$(request$, doOptions); + const response = await this.do$(request$, { + context, + errorCodes: ["400", "4XX", "5XX"], + retryConfig: options?.retries || this.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); const responseFields$ = { HttpMeta: { Response: response, Request: request$ }, @@ -131,7 +154,7 @@ export class Connections extends ClientSDK { const [result$] = await this.matcher() .void(200, z.void()) - .json(400, errors.Response400$, { err: true }) + .json(400, errors.Response400$inboundSchema, { err: true }) .fail(["4XX", "5XX"]) .match(response, { extraFields: responseFields$ }); @@ -157,13 +180,10 @@ export class Connections extends ClientSDK { forceRefresh: forceRefresh, refreshToken: refreshToken, }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); const payload$ = schemas$.parse( input$, - (value$) => operations.GetConnectionsRequest$.outboundSchema.parse(value$), + (value$) => operations.GetConnectionsRequest$outboundSchema.parse(value$), "Input validation failed" ); const body$ = null; @@ -182,16 +202,31 @@ export class Connections extends ClientSDK { refresh_token: payload$.refresh_token, }); + const headers$ = new Headers({ + Accept: "application/json", + }); + const context = { operationID: "getConnections", oAuth2Scopes: [], securitySource: null }; - const doOptions = { context, errorCodes: ["400", "404", "4XX", "5XX"] }; const request$ = this.createRequest$( context, - { method: "GET", path: path$, headers: headers$, query: query$, body: body$ }, + { + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || this.options$.timeoutMs || -1, + }, options ); - const response = await this.do$(request$, doOptions); + const response = await this.do$(request$, { + context, + errorCodes: ["400", "404", "4XX", "5XX"], + retryConfig: options?.retries || this.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); const responseFields$ = { HttpMeta: { Response: response, Request: request$ }, @@ -199,8 +234,8 @@ export class Connections extends ClientSDK { const [result$] = await this.matcher() .void(200, z.void()) - .json(400, errors.Response400$, { err: true }) - .json(404, errors.Response404$, { err: true }) + .json(400, errors.Response400$inboundSchema, { err: true }) + .json(404, errors.Response404$inboundSchema, { err: true }) .fail(["4XX", "5XX"]) .match(response, { extraFields: responseFields$ }); @@ -222,13 +257,10 @@ export class Connections extends ClientSDK { connectionId: connectionId, providerConfigKey: providerConfigKey, }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); const payload$ = schemas$.parse( input$, - (value$) => operations.DeleteConnectionsRequest$.outboundSchema.parse(value$), + (value$) => operations.DeleteConnectionsRequest$outboundSchema.parse(value$), "Input validation failed" ); const body$ = null; @@ -245,20 +277,35 @@ export class Connections extends ClientSDK { provider_config_key: payload$.provider_config_key, }); + const headers$ = new Headers({ + Accept: "application/json", + }); + const context = { operationID: "deleteConnections", oAuth2Scopes: [], securitySource: null, }; - const doOptions = { context, errorCodes: ["400", "404", "4XX", "5XX"] }; const request$ = this.createRequest$( context, - { method: "DELETE", path: path$, headers: headers$, query: query$, body: body$ }, + { + method: "DELETE", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || this.options$.timeoutMs || -1, + }, options ); - const response = await this.do$(request$, doOptions); + const response = await this.do$(request$, { + context, + errorCodes: ["400", "404", "4XX", "5XX"], + retryConfig: options?.retries || this.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); const responseFields$ = { HttpMeta: { Response: response, Request: request$ }, @@ -266,8 +313,8 @@ export class Connections extends ClientSDK { const [result$] = await this.matcher() .void(204, z.void()) - .json(400, errors.Response400$, { err: true }) - .json(404, errors.Response404$, { err: true }) + .json(400, errors.Response400$inboundSchema, { err: true }) + .json(404, errors.Response404$inboundSchema, { err: true }) .fail(["4XX", "5XX"]) .match(response, { extraFields: responseFields$ }); @@ -291,14 +338,10 @@ export class Connections extends ClientSDK { providerConfigKey: providerConfigKey, requestBody: requestBody, }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); const payload$ = schemas$.parse( input$, - (value$) => operations.CreateMetadataRequest$.outboundSchema.parse(value$), + (value$) => operations.CreateMetadataRequest$outboundSchema.parse(value$), "Input validation failed" ); const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); @@ -313,23 +356,37 @@ export class Connections extends ClientSDK { const query$ = ""; - headers$.set( - "Provider-Config-Key", - encodeSimple$("Provider-Config-Key", payload$["Provider-Config-Key"], { - explode: false, - charEncoding: "none", - }) - ); + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + "Provider-Config-Key": encodeSimple$( + "Provider-Config-Key", + payload$["Provider-Config-Key"], + { explode: false, charEncoding: "none" } + ), + }); + const context = { operationID: "createMetadata", oAuth2Scopes: [], securitySource: null }; - const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] }; const request$ = this.createRequest$( context, - { method: "POST", path: path$, headers: headers$, query: query$, body: body$ }, + { + method: "POST", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || this.options$.timeoutMs || -1, + }, options ); - const response = await this.do$(request$, doOptions); + const response = await this.do$(request$, { + context, + errorCodes: ["400", "4XX", "5XX"], + retryConfig: options?.retries || this.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); const responseFields$ = { HttpMeta: { Response: response, Request: request$ }, @@ -337,7 +394,7 @@ export class Connections extends ClientSDK { const [result$] = await this.matcher() .void(201, z.void()) - .json(400, errors.Response400$, { err: true }) + .json(400, errors.Response400$inboundSchema, { err: true }) .fail(["4XX", "5XX"]) .match(response, { extraFields: responseFields$ }); @@ -361,14 +418,10 @@ export class Connections extends ClientSDK { providerConfigKey: providerConfigKey, requestBody: requestBody, }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); const payload$ = schemas$.parse( input$, - (value$) => operations.UpdateMetadataRequest$.outboundSchema.parse(value$), + (value$) => operations.UpdateMetadataRequest$outboundSchema.parse(value$), "Input validation failed" ); const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); @@ -383,31 +436,45 @@ export class Connections extends ClientSDK { const query$ = ""; - headers$.set( - "Provider-Config-Key", - encodeSimple$("Provider-Config-Key", payload$["Provider-Config-Key"], { - explode: false, - charEncoding: "none", - }) - ); + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + "Provider-Config-Key": encodeSimple$( + "Provider-Config-Key", + payload$["Provider-Config-Key"], + { explode: false, charEncoding: "none" } + ), + }); + const context = { operationID: "updateMetadata", oAuth2Scopes: [], securitySource: null }; - const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] }; const request$ = this.createRequest$( context, - { method: "PATCH", path: path$, headers: headers$, query: query$, body: body$ }, + { + method: "PATCH", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || this.options$.timeoutMs || -1, + }, options ); - const response = await this.do$(request$, doOptions); + const response = await this.do$(request$, { + context, + errorCodes: ["400", "4XX", "5XX"], + retryConfig: options?.retries || this.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); const responseFields$ = { HttpMeta: { Response: response, Request: request$ }, }; const [result$] = await this.matcher() - .json(200, operations.UpdateMetadataResponseBody$) - .json(400, errors.Response400$, { err: true }) + .json(200, operations.UpdateMetadataResponseBody$inboundSchema) + .json(400, errors.Response400$inboundSchema, { err: true }) .fail(["4XX", "5XX"]) .match(response, { extraFields: responseFields$ }); diff --git a/src/sdk/environment.ts b/src/sdk/environment.ts index 8dea492..cf9312b 100644 --- a/src/sdk/environment.ts +++ b/src/sdk/environment.ts @@ -3,7 +3,7 @@ */ import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; +import { SDKOptions, serverURLFromOptions } from "../lib/config.js"; import { HTTPClient } from "../lib/http.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; @@ -43,31 +43,41 @@ export class Environment extends ClientSDK { * Retrieve the environment variables as added in the Nango dashboard */ async get(options?: RequestOptions): Promise> { - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - const path$ = this.templateURLComponent("/environment-variables")(); const query$ = ""; + const headers$ = new Headers({ + Accept: "application/json", + }); + const context = { operationID: "getEnvironmentVariable", oAuth2Scopes: [], securitySource: null, }; - const doOptions = { context, errorCodes: ["4XX", "5XX"] }; const request$ = this.createRequest$( context, - { method: "GET", path: path$, headers: headers$, query: query$ }, + { + method: "GET", + path: path$, + headers: headers$, + query: query$, + timeoutMs: options?.timeoutMs || this.options$.timeoutMs || -1, + }, options ); - const response = await this.do$(request$, doOptions); + const response = await this.do$(request$, { + context, + errorCodes: ["4XX", "5XX"], + retryConfig: options?.retries || this.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); const [result$] = await this.matcher>() - .json(200, z.array(components.GetEnvironmentVariableResponse$.inboundSchema)) + .json(200, z.array(components.GetEnvironmentVariableResponse$inboundSchema)) .fail(["4XX", "5XX"]) .match(response); diff --git a/src/sdk/integrations.ts b/src/sdk/integrations.ts index 903a613..d7c8a9d 100644 --- a/src/sdk/integrations.ts +++ b/src/sdk/integrations.ts @@ -3,7 +3,7 @@ */ import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; +import { SDKOptions, serverURLFromOptions } from "../lib/config.js"; import { encodeFormQuery as encodeFormQuery$, encodeSimple as encodeSimple$, @@ -50,27 +50,37 @@ export class Integrations extends ClientSDK { * Returns a list of integrations */ async list(options?: RequestOptions): Promise { - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); - const path$ = this.templateURLComponent("/config")(); const query$ = ""; + const headers$ = new Headers({ + Accept: "application/json", + }); + const context = { operationID: "listIntegrations", oAuth2Scopes: [], securitySource: null }; - const doOptions = { context, errorCodes: ["4XX", "5XX"] }; const request$ = this.createRequest$( context, - { method: "GET", path: path$, headers: headers$, query: query$ }, + { + method: "GET", + path: path$, + headers: headers$, + query: query$, + timeoutMs: options?.timeoutMs || this.options$.timeoutMs || -1, + }, options ); - const response = await this.do$(request$, doOptions); + const response = await this.do$(request$, { + context, + errorCodes: ["4XX", "5XX"], + retryConfig: options?.retries || this.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); const [result$] = await this.matcher() - .json(200, components.IntegrationsResponse200$) + .json(200, components.IntegrationsResponse200$inboundSchema) .fail(["4XX", "5XX"]) .match(response); @@ -89,37 +99,48 @@ export class Integrations extends ClientSDK { ): Promise { const input$ = request; void input$; // request input is unused - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); const path$ = this.templateURLComponent("/config")(); const query$ = ""; + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + const context = { operationID: "createIntegrations", oAuth2Scopes: [], securitySource: null, }; - const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] }; const request$ = this.createRequest$( context, - { method: "POST", path: path$, headers: headers$, query: query$ }, + { + method: "POST", + path: path$, + headers: headers$, + query: query$, + timeoutMs: options?.timeoutMs || this.options$.timeoutMs || -1, + }, options ); - const response = await this.do$(request$, doOptions); + const response = await this.do$(request$, { + context, + errorCodes: ["400", "4XX", "5XX"], + retryConfig: options?.retries || this.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); const responseFields$ = { HttpMeta: { Response: response, Request: request$ }, }; const [result$] = await this.matcher() - .json(200, components.IntegrationsResponse200$) - .json(400, errors.Response400$, { err: true }) + .json(200, components.IntegrationsResponse200$inboundSchema) + .json(400, errors.Response400$inboundSchema, { err: true }) .fail(["4XX", "5XX"]) .match(response, { extraFields: responseFields$ }); @@ -138,38 +159,49 @@ export class Integrations extends ClientSDK { ): Promise { const input$ = request; void input$; // request input is unused - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); const path$ = this.templateURLComponent("/config")(); const query$ = ""; + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + const context = { operationID: "updateIntegration", oAuth2Scopes: [], securitySource: null, }; - const doOptions = { context, errorCodes: ["400", "404", "4XX", "5XX"] }; const request$ = this.createRequest$( context, - { method: "PUT", path: path$, headers: headers$, query: query$ }, + { + method: "PUT", + path: path$, + headers: headers$, + query: query$, + timeoutMs: options?.timeoutMs || this.options$.timeoutMs || -1, + }, options ); - const response = await this.do$(request$, doOptions); + const response = await this.do$(request$, { + context, + errorCodes: ["400", "404", "4XX", "5XX"], + retryConfig: options?.retries || this.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); const responseFields$ = { HttpMeta: { Response: response, Request: request$ }, }; const [result$] = await this.matcher() - .json(200, components.IntegrationsResponse200$) - .json(400, errors.Response400$, { err: true }) - .json(404, errors.Response404$, { err: true }) + .json(200, components.IntegrationsResponse200$inboundSchema) + .json(400, errors.Response400$inboundSchema, { err: true }) + .json(404, errors.Response404$inboundSchema, { err: true }) .fail(["4XX", "5XX"]) .match(response, { extraFields: responseFields$ }); @@ -191,13 +223,10 @@ export class Integrations extends ClientSDK { providerConfigKey: providerConfigKey, includeCreds: includeCreds, }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); const payload$ = schemas$.parse( input$, - (value$) => operations.GetIntegrationRequest$.outboundSchema.parse(value$), + (value$) => operations.GetIntegrationRequest$outboundSchema.parse(value$), "Input validation failed" ); const body$ = null; @@ -214,25 +243,40 @@ export class Integrations extends ClientSDK { include_creds: payload$.include_creds, }); + const headers$ = new Headers({ + Accept: "application/json", + }); + const context = { operationID: "getIntegration", oAuth2Scopes: [], securitySource: null }; - const doOptions = { context, errorCodes: ["400", "404", "4XX", "5XX"] }; const request$ = this.createRequest$( context, - { method: "GET", path: path$, headers: headers$, query: query$, body: body$ }, + { + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || this.options$.timeoutMs || -1, + }, options ); - const response = await this.do$(request$, doOptions); + const response = await this.do$(request$, { + context, + errorCodes: ["400", "404", "4XX", "5XX"], + retryConfig: options?.retries || this.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); const responseFields$ = { HttpMeta: { Response: response, Request: request$ }, }; const [result$] = await this.matcher() - .json(200, components.GetIntegrationResponse$) - .json(400, errors.Response400$, { err: true }) - .json(404, errors.Response404$, { err: true }) + .json(200, components.GetIntegrationResponse$inboundSchema) + .json(400, errors.Response400$inboundSchema, { err: true }) + .json(404, errors.Response404$inboundSchema, { err: true }) .fail(["4XX", "5XX"]) .match(response, { extraFields: responseFields$ }); @@ -249,13 +293,10 @@ export class Integrations extends ClientSDK { const input$: operations.DeleteIntegrationRequest = { providerConfigKey: providerConfigKey, }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); const payload$ = schemas$.parse( input$, - (value$) => operations.DeleteIntegrationRequest$.outboundSchema.parse(value$), + (value$) => operations.DeleteIntegrationRequest$outboundSchema.parse(value$), "Input validation failed" ); const body$ = null; @@ -270,20 +311,35 @@ export class Integrations extends ClientSDK { const query$ = ""; + const headers$ = new Headers({ + Accept: "application/json", + }); + const context = { operationID: "deleteIntegration", oAuth2Scopes: [], securitySource: null, }; - const doOptions = { context, errorCodes: ["400", "404", "4XX", "5XX"] }; const request$ = this.createRequest$( context, - { method: "DELETE", path: path$, headers: headers$, query: query$, body: body$ }, + { + method: "DELETE", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || this.options$.timeoutMs || -1, + }, options ); - const response = await this.do$(request$, doOptions); + const response = await this.do$(request$, { + context, + errorCodes: ["400", "404", "4XX", "5XX"], + retryConfig: options?.retries || this.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); const responseFields$ = { HttpMeta: { Response: response, Request: request$ }, @@ -291,8 +347,8 @@ export class Integrations extends ClientSDK { const [result$] = await this.matcher() .void(204, z.void()) - .json(400, errors.Response400$, { err: true }) - .json(404, errors.Response404$, { err: true }) + .json(400, errors.Response400$inboundSchema, { err: true }) + .json(404, errors.Response404$inboundSchema, { err: true }) .fail(["4XX", "5XX"]) .match(response, { extraFields: responseFields$ }); diff --git a/src/sdk/proxy.ts b/src/sdk/proxy.ts index a88df6c..1d88df6 100644 --- a/src/sdk/proxy.ts +++ b/src/sdk/proxy.ts @@ -3,7 +3,7 @@ */ import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; +import { SDKOptions, serverURLFromOptions } from "../lib/config.js"; import { encodeFormQuery as encodeFormQuery$, encodeJSON as encodeJSON$, @@ -50,13 +50,10 @@ export class Proxy extends ClientSDK { */ async get(request: operations.GetProxyRequest, options?: RequestOptions): Promise { const input$ = request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "*/*"); const payload$ = schemas$.parse( input$, - (value$) => operations.GetProxyRequest$.outboundSchema.parse(value$), + (value$) => operations.GetProxyRequest$outboundSchema.parse(value$), "Input validation failed" ); const body$ = null; @@ -73,55 +70,57 @@ export class Proxy extends ClientSDK { $ANY_QUERY_PARAMS: payload$.$ANY_QUERY_PARAMS, }); - headers$.set( - "Base-Url-Override", - encodeSimple$("Base-Url-Override", payload$["Base-Url-Override"], { + const headers$ = new Headers({ + Accept: "*/*", + "Base-Url-Override": encodeSimple$("Base-Url-Override", payload$["Base-Url-Override"], { explode: false, charEncoding: "none", - }) - ); - headers$.set( - "Connection-Id", - encodeSimple$("Connection-Id", payload$["Connection-Id"], { - explode: false, - charEncoding: "none", - }) - ); - headers$.set( - "Decompress", - encodeSimple$("Decompress", payload$.Decompress, { + }), + "Connection-Id": encodeSimple$("Connection-Id", payload$["Connection-Id"], { explode: false, charEncoding: "none", - }) - ); - headers$.set( - "Provider-Config-Key", - encodeSimple$("Provider-Config-Key", payload$["Provider-Config-Key"], { + }), + Decompress: encodeSimple$("Decompress", payload$.Decompress, { explode: false, charEncoding: "none", - }) - ); - headers$.set( - "Retries", - encodeSimple$("Retries", payload$.Retries, { explode: false, charEncoding: "none" }) - ); - headers$.set( - "nango-proxy-$ANY_HEADER", - encodeSimple$("nango-proxy-$ANY_HEADER", payload$["nango-proxy-$ANY_HEADER"], { + }), + "Provider-Config-Key": encodeSimple$( + "Provider-Config-Key", + payload$["Provider-Config-Key"], + { explode: false, charEncoding: "none" } + ), + Retries: encodeSimple$("Retries", payload$.Retries, { explode: false, charEncoding: "none", - }) - ); + }), + "nango-proxy-$ANY_HEADER": encodeSimple$( + "nango-proxy-$ANY_HEADER", + payload$["nango-proxy-$ANY_HEADER"], + { explode: false, charEncoding: "none" } + ), + }); + const context = { operationID: "getProxy", oAuth2Scopes: [], securitySource: null }; - const doOptions = { context, errorCodes: ["4XX", "5XX"] }; const request$ = this.createRequest$( context, - { method: "GET", path: path$, headers: headers$, query: query$, body: body$ }, + { + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || this.options$.timeoutMs || -1, + }, options ); - const response = await this.do$(request$, doOptions); + const response = await this.do$(request$, { + context, + errorCodes: ["4XX", "5XX"], + retryConfig: options?.retries || this.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); const [result$] = await this.matcher() .void(200, z.void()) @@ -139,14 +138,10 @@ export class Proxy extends ClientSDK { */ async create(request: operations.CreateProxyRequest, options?: RequestOptions): Promise { const input$ = request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "*/*"); const payload$ = schemas$.parse( input$, - (value$) => operations.CreateProxyRequest$.outboundSchema.parse(value$), + (value$) => operations.CreateProxyRequest$outboundSchema.parse(value$), "Input validation failed" ); const body$ = encodeJSON$("body", payload$.CreateProxyRequest, { explode: true }); @@ -161,55 +156,58 @@ export class Proxy extends ClientSDK { const query$ = ""; - headers$.set( - "Base-Url-Override", - encodeSimple$("Base-Url-Override", payload$["Base-Url-Override"], { + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "*/*", + "Base-Url-Override": encodeSimple$("Base-Url-Override", payload$["Base-Url-Override"], { explode: false, charEncoding: "none", - }) - ); - headers$.set( - "Connection-Id", - encodeSimple$("Connection-Id", payload$["Connection-Id"], { - explode: false, - charEncoding: "none", - }) - ); - headers$.set( - "Decompress", - encodeSimple$("Decompress", payload$.Decompress, { + }), + "Connection-Id": encodeSimple$("Connection-Id", payload$["Connection-Id"], { explode: false, charEncoding: "none", - }) - ); - headers$.set( - "Provider-Config-Key", - encodeSimple$("Provider-Config-Key", payload$["Provider-Config-Key"], { + }), + Decompress: encodeSimple$("Decompress", payload$.Decompress, { explode: false, charEncoding: "none", - }) - ); - headers$.set( - "Retries", - encodeSimple$("Retries", payload$.Retries, { explode: false, charEncoding: "none" }) - ); - headers$.set( - "nango-proxy-$ANY_HEADER", - encodeSimple$("nango-proxy-$ANY_HEADER", payload$["nango-proxy-$ANY_HEADER"], { + }), + "Provider-Config-Key": encodeSimple$( + "Provider-Config-Key", + payload$["Provider-Config-Key"], + { explode: false, charEncoding: "none" } + ), + Retries: encodeSimple$("Retries", payload$.Retries, { explode: false, charEncoding: "none", - }) - ); + }), + "nango-proxy-$ANY_HEADER": encodeSimple$( + "nango-proxy-$ANY_HEADER", + payload$["nango-proxy-$ANY_HEADER"], + { explode: false, charEncoding: "none" } + ), + }); + const context = { operationID: "createProxy", oAuth2Scopes: [], securitySource: null }; - const doOptions = { context, errorCodes: ["4XX", "5XX"] }; const request$ = this.createRequest$( context, - { method: "POST", path: path$, headers: headers$, query: query$, body: body$ }, + { + method: "POST", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || this.options$.timeoutMs || -1, + }, options ); - const response = await this.do$(request$, doOptions); + const response = await this.do$(request$, { + context, + errorCodes: ["4XX", "5XX"], + retryConfig: options?.retries || this.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); const [result$] = await this.matcher() .void(200, z.void()) @@ -227,14 +225,10 @@ export class Proxy extends ClientSDK { */ async update(request: operations.PutProxyRequest, options?: RequestOptions): Promise { const input$ = request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "*/*"); const payload$ = schemas$.parse( input$, - (value$) => operations.PutProxyRequest$.outboundSchema.parse(value$), + (value$) => operations.PutProxyRequest$outboundSchema.parse(value$), "Input validation failed" ); const body$ = encodeJSON$("body", payload$.PutProxyRequest, { explode: true }); @@ -249,55 +243,58 @@ export class Proxy extends ClientSDK { const query$ = ""; - headers$.set( - "Base-Url-Override", - encodeSimple$("Base-Url-Override", payload$["Base-Url-Override"], { - explode: false, - charEncoding: "none", - }) - ); - headers$.set( - "Connection-Id", - encodeSimple$("Connection-Id", payload$["Connection-Id"], { + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "*/*", + "Base-Url-Override": encodeSimple$("Base-Url-Override", payload$["Base-Url-Override"], { explode: false, charEncoding: "none", - }) - ); - headers$.set( - "Decompress", - encodeSimple$("Decompress", payload$.Decompress, { + }), + "Connection-Id": encodeSimple$("Connection-Id", payload$["Connection-Id"], { explode: false, charEncoding: "none", - }) - ); - headers$.set( - "Provider-Config-Key", - encodeSimple$("Provider-Config-Key", payload$["Provider-Config-Key"], { + }), + Decompress: encodeSimple$("Decompress", payload$.Decompress, { explode: false, charEncoding: "none", - }) - ); - headers$.set( - "Retries", - encodeSimple$("Retries", payload$.Retries, { explode: false, charEncoding: "none" }) - ); - headers$.set( - "nango-proxy-$ANY_HEADER", - encodeSimple$("nango-proxy-$ANY_HEADER", payload$["nango-proxy-$ANY_HEADER"], { + }), + "Provider-Config-Key": encodeSimple$( + "Provider-Config-Key", + payload$["Provider-Config-Key"], + { explode: false, charEncoding: "none" } + ), + Retries: encodeSimple$("Retries", payload$.Retries, { explode: false, charEncoding: "none", - }) - ); + }), + "nango-proxy-$ANY_HEADER": encodeSimple$( + "nango-proxy-$ANY_HEADER", + payload$["nango-proxy-$ANY_HEADER"], + { explode: false, charEncoding: "none" } + ), + }); + const context = { operationID: "putProxy", oAuth2Scopes: [], securitySource: null }; - const doOptions = { context, errorCodes: ["4XX", "5XX"] }; const request$ = this.createRequest$( context, - { method: "PUT", path: path$, headers: headers$, query: query$, body: body$ }, + { + method: "PUT", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || this.options$.timeoutMs || -1, + }, options ); - const response = await this.do$(request$, doOptions); + const response = await this.do$(request$, { + context, + errorCodes: ["4XX", "5XX"], + retryConfig: options?.retries || this.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); const [result$] = await this.matcher() .void(200, z.void()) @@ -315,14 +312,10 @@ export class Proxy extends ClientSDK { */ async modify(request: operations.PatchProxyRequest, options?: RequestOptions): Promise { const input$ = request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "*/*"); const payload$ = schemas$.parse( input$, - (value$) => operations.PatchProxyRequest$.outboundSchema.parse(value$), + (value$) => operations.PatchProxyRequest$outboundSchema.parse(value$), "Input validation failed" ); const body$ = encodeJSON$("body", payload$.PatchProxyRequest, { explode: true }); @@ -337,55 +330,58 @@ export class Proxy extends ClientSDK { const query$ = ""; - headers$.set( - "Base-Url-Override", - encodeSimple$("Base-Url-Override", payload$["Base-Url-Override"], { - explode: false, - charEncoding: "none", - }) - ); - headers$.set( - "Connection-Id", - encodeSimple$("Connection-Id", payload$["Connection-Id"], { + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "*/*", + "Base-Url-Override": encodeSimple$("Base-Url-Override", payload$["Base-Url-Override"], { explode: false, charEncoding: "none", - }) - ); - headers$.set( - "Decompress", - encodeSimple$("Decompress", payload$.Decompress, { + }), + "Connection-Id": encodeSimple$("Connection-Id", payload$["Connection-Id"], { explode: false, charEncoding: "none", - }) - ); - headers$.set( - "Provider-Config-Key", - encodeSimple$("Provider-Config-Key", payload$["Provider-Config-Key"], { + }), + Decompress: encodeSimple$("Decompress", payload$.Decompress, { explode: false, charEncoding: "none", - }) - ); - headers$.set( - "Retries", - encodeSimple$("Retries", payload$.Retries, { explode: false, charEncoding: "none" }) - ); - headers$.set( - "nango-proxy-$ANY_HEADER", - encodeSimple$("nango-proxy-$ANY_HEADER", payload$["nango-proxy-$ANY_HEADER"], { + }), + "Provider-Config-Key": encodeSimple$( + "Provider-Config-Key", + payload$["Provider-Config-Key"], + { explode: false, charEncoding: "none" } + ), + Retries: encodeSimple$("Retries", payload$.Retries, { explode: false, charEncoding: "none", - }) - ); + }), + "nango-proxy-$ANY_HEADER": encodeSimple$( + "nango-proxy-$ANY_HEADER", + payload$["nango-proxy-$ANY_HEADER"], + { explode: false, charEncoding: "none" } + ), + }); + const context = { operationID: "patchProxy", oAuth2Scopes: [], securitySource: null }; - const doOptions = { context, errorCodes: ["4XX", "5XX"] }; const request$ = this.createRequest$( context, - { method: "PATCH", path: path$, headers: headers$, query: query$, body: body$ }, + { + method: "PATCH", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || this.options$.timeoutMs || -1, + }, options ); - const response = await this.do$(request$, doOptions); + const response = await this.do$(request$, { + context, + errorCodes: ["4XX", "5XX"], + retryConfig: options?.retries || this.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); const [result$] = await this.matcher() .void(200, z.void()) @@ -403,13 +399,10 @@ export class Proxy extends ClientSDK { */ async delete(request: operations.DeleteProxyRequest, options?: RequestOptions): Promise { const input$ = request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "*/*"); const payload$ = schemas$.parse( input$, - (value$) => operations.DeleteProxyRequest$.outboundSchema.parse(value$), + (value$) => operations.DeleteProxyRequest$outboundSchema.parse(value$), "Input validation failed" ); const body$ = null; @@ -426,55 +419,57 @@ export class Proxy extends ClientSDK { $ANY_QUERY_PARAMS: payload$.$ANY_QUERY_PARAMS, }); - headers$.set( - "Base-Url-Override", - encodeSimple$("Base-Url-Override", payload$["Base-Url-Override"], { - explode: false, - charEncoding: "none", - }) - ); - headers$.set( - "Connection-Id", - encodeSimple$("Connection-Id", payload$["Connection-Id"], { + const headers$ = new Headers({ + Accept: "*/*", + "Base-Url-Override": encodeSimple$("Base-Url-Override", payload$["Base-Url-Override"], { explode: false, charEncoding: "none", - }) - ); - headers$.set( - "Decompress", - encodeSimple$("Decompress", payload$.Decompress, { + }), + "Connection-Id": encodeSimple$("Connection-Id", payload$["Connection-Id"], { explode: false, charEncoding: "none", - }) - ); - headers$.set( - "Provider-Config-Key", - encodeSimple$("Provider-Config-Key", payload$["Provider-Config-Key"], { + }), + Decompress: encodeSimple$("Decompress", payload$.Decompress, { explode: false, charEncoding: "none", - }) - ); - headers$.set( - "Retries", - encodeSimple$("Retries", payload$.Retries, { explode: false, charEncoding: "none" }) - ); - headers$.set( - "nango-proxy-$ANY_HEADER", - encodeSimple$("nango-proxy-$ANY_HEADER", payload$["nango-proxy-$ANY_HEADER"], { + }), + "Provider-Config-Key": encodeSimple$( + "Provider-Config-Key", + payload$["Provider-Config-Key"], + { explode: false, charEncoding: "none" } + ), + Retries: encodeSimple$("Retries", payload$.Retries, { explode: false, charEncoding: "none", - }) - ); + }), + "nango-proxy-$ANY_HEADER": encodeSimple$( + "nango-proxy-$ANY_HEADER", + payload$["nango-proxy-$ANY_HEADER"], + { explode: false, charEncoding: "none" } + ), + }); + const context = { operationID: "deleteProxy", oAuth2Scopes: [], securitySource: null }; - const doOptions = { context, errorCodes: ["4XX", "5XX"] }; const request$ = this.createRequest$( context, - { method: "DELETE", path: path$, headers: headers$, query: query$, body: body$ }, + { + method: "DELETE", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || this.options$.timeoutMs || -1, + }, options ); - const response = await this.do$(request$, doOptions); + const response = await this.do$(request$, { + context, + errorCodes: ["4XX", "5XX"], + retryConfig: options?.retries || this.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); const [result$] = await this.matcher() .void(200, z.void()) diff --git a/src/sdk/records.ts b/src/sdk/records.ts index 0f0f043..f0daa24 100644 --- a/src/sdk/records.ts +++ b/src/sdk/records.ts @@ -3,7 +3,7 @@ */ import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; +import { SDKOptions, serverURLFromOptions } from "../lib/config.js"; import { encodeFormQuery as encodeFormQuery$, encodeSimple as encodeSimple$, @@ -53,13 +53,10 @@ export class Records extends ClientSDK { options?: RequestOptions ): Promise { const input$ = request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); const payload$ = schemas$.parse( input$, - (value$) => operations.GetRecordRequest$.outboundSchema.parse(value$), + (value$) => operations.GetRecordRequest$outboundSchema.parse(value$), "Input validation failed" ); const body$ = null; @@ -74,38 +71,48 @@ export class Records extends ClientSDK { model: payload$.model, }); - headers$.set( - "Connection-Id", - encodeSimple$("Connection-Id", payload$["Connection-Id"], { + const headers$ = new Headers({ + Accept: "application/json", + "Connection-Id": encodeSimple$("Connection-Id", payload$["Connection-Id"], { explode: false, charEncoding: "none", - }) - ); - headers$.set( - "Provider-Config-Key", - encodeSimple$("Provider-Config-Key", payload$["Provider-Config-Key"], { - explode: false, - charEncoding: "none", - }) - ); + }), + "Provider-Config-Key": encodeSimple$( + "Provider-Config-Key", + payload$["Provider-Config-Key"], + { explode: false, charEncoding: "none" } + ), + }); + const context = { operationID: "getRecord", oAuth2Scopes: [], securitySource: null }; - const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] }; const request$ = this.createRequest$( context, - { method: "GET", path: path$, headers: headers$, query: query$, body: body$ }, + { + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || this.options$.timeoutMs || -1, + }, options ); - const response = await this.do$(request$, doOptions); + const response = await this.do$(request$, { + context, + errorCodes: ["400", "4XX", "5XX"], + retryConfig: options?.retries || this.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); const responseFields$ = { HttpMeta: { Response: response, Request: request$ }, }; const [result$] = await this.matcher() - .json(200, components.GetRecordResponse$) - .json(400, errors.Response400$, { err: true }) + .json(200, components.GetRecordResponse$inboundSchema) + .json(400, errors.Response400$inboundSchema, { err: true }) .fail(["4XX", "5XX"]) .match(response, { extraFields: responseFields$ }); diff --git a/src/sdk/sync.ts b/src/sdk/sync.ts index 6cc422c..0d77c37 100644 --- a/src/sdk/sync.ts +++ b/src/sdk/sync.ts @@ -3,7 +3,7 @@ */ import { SDKHooks } from "../hooks/hooks.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config.js"; +import { SDKOptions, serverURLFromOptions } from "../lib/config.js"; import { encodeFormQuery as encodeFormQuery$, encodeJSON as encodeJSON$, @@ -55,13 +55,10 @@ export class Sync extends ClientSDK { options?: RequestOptions ): Promise> { const input$ = request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); const payload$ = schemas$.parse( input$, - (value$) => operations.GetSyncRecordRequest$.outboundSchema.parse(value$), + (value$) => operations.GetSyncRecordRequest$outboundSchema.parse(value$), "Input validation failed" ); const body$ = null; @@ -78,38 +75,48 @@ export class Sync extends ClientSDK { sort_by: payload$.sort_by, }); - headers$.set( - "Connection-Id", - encodeSimple$("Connection-Id", payload$["Connection-Id"], { + const headers$ = new Headers({ + Accept: "application/json", + "Connection-Id": encodeSimple$("Connection-Id", payload$["Connection-Id"], { explode: false, charEncoding: "none", - }) - ); - headers$.set( - "Provider-Config-Key", - encodeSimple$("Provider-Config-Key", payload$["Provider-Config-Key"], { - explode: false, - charEncoding: "none", - }) - ); + }), + "Provider-Config-Key": encodeSimple$( + "Provider-Config-Key", + payload$["Provider-Config-Key"], + { explode: false, charEncoding: "none" } + ), + }); + const context = { operationID: "getSyncRecord", oAuth2Scopes: [], securitySource: null }; - const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] }; const request$ = this.createRequest$( context, - { method: "GET", path: path$, headers: headers$, query: query$, body: body$ }, + { + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || this.options$.timeoutMs || -1, + }, options ); - const response = await this.do$(request$, doOptions); + const response = await this.do$(request$, { + context, + errorCodes: ["400", "4XX", "5XX"], + retryConfig: options?.retries || this.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); const responseFields$ = { HttpMeta: { Response: response, Request: request$ }, }; const [result$] = await this.matcher>() - .json(200, z.array(components.GetSyncRecordResponse$.inboundSchema)) - .json(400, errors.Response400$, { err: true }) + .json(200, z.array(components.GetSyncRecordResponse$inboundSchema)) + .json(400, errors.Response400$inboundSchema, { err: true }) .fail(["4XX", "5XX"]) .match(response, { extraFields: responseFields$ }); @@ -127,15 +134,10 @@ export class Sync extends ClientSDK { options?: RequestOptions ): Promise { const input$ = request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); const payload$ = schemas$.parse( input$, - (value$) => - components.CreateSyncTriggerRequest$.outboundSchema.optional().parse(value$), + (value$) => components.CreateSyncTriggerRequest$outboundSchema.optional().parse(value$), "Input validation failed" ); const body$ = @@ -145,20 +147,36 @@ export class Sync extends ClientSDK { const query$ = ""; + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + const context = { operationID: "createSyncTrigger", oAuth2Scopes: [], securitySource: null, }; - const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] }; const request$ = this.createRequest$( context, - { method: "POST", path: path$, headers: headers$, query: query$, body: body$ }, + { + method: "POST", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || this.options$.timeoutMs || -1, + }, options ); - const response = await this.do$(request$, doOptions); + const response = await this.do$(request$, { + context, + errorCodes: ["400", "4XX", "5XX"], + retryConfig: options?.retries || this.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); const responseFields$ = { HttpMeta: { Response: response, Request: request$ }, @@ -166,7 +184,7 @@ export class Sync extends ClientSDK { const [result$] = await this.matcher() .void(200, z.void()) - .json(400, errors.Response400$, { err: true }) + .json(400, errors.Response400$inboundSchema, { err: true }) .fail(["4XX", "5XX"]) .match(response, { extraFields: responseFields$ }); @@ -184,14 +202,10 @@ export class Sync extends ClientSDK { options?: RequestOptions ): Promise { const input$ = request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); const payload$ = schemas$.parse( input$, - (value$) => components.CreateSyncStartRequest$.outboundSchema.optional().parse(value$), + (value$) => components.CreateSyncStartRequest$outboundSchema.optional().parse(value$), "Input validation failed" ); const body$ = @@ -201,16 +215,32 @@ export class Sync extends ClientSDK { const query$ = ""; + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + const context = { operationID: "createSyncStart", oAuth2Scopes: [], securitySource: null }; - const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] }; const request$ = this.createRequest$( context, - { method: "POST", path: path$, headers: headers$, query: query$, body: body$ }, + { + method: "POST", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || this.options$.timeoutMs || -1, + }, options ); - const response = await this.do$(request$, doOptions); + const response = await this.do$(request$, { + context, + errorCodes: ["400", "4XX", "5XX"], + retryConfig: options?.retries || this.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); const responseFields$ = { HttpMeta: { Response: response, Request: request$ }, @@ -218,7 +248,7 @@ export class Sync extends ClientSDK { const [result$] = await this.matcher() .void(200, z.void()) - .json(400, errors.Response400$, { err: true }) + .json(400, errors.Response400$inboundSchema, { err: true }) .fail(["4XX", "5XX"]) .match(response, { extraFields: responseFields$ }); @@ -236,14 +266,10 @@ export class Sync extends ClientSDK { options?: RequestOptions ): Promise { const input$ = request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); const payload$ = schemas$.parse( input$, - (value$) => components.CreateSyncPauseRequest$.outboundSchema.optional().parse(value$), + (value$) => components.CreateSyncPauseRequest$outboundSchema.optional().parse(value$), "Input validation failed" ); const body$ = @@ -253,16 +279,32 @@ export class Sync extends ClientSDK { const query$ = ""; + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + const context = { operationID: "createSyncPause", oAuth2Scopes: [], securitySource: null }; - const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] }; const request$ = this.createRequest$( context, - { method: "POST", path: path$, headers: headers$, query: query$, body: body$ }, + { + method: "POST", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || this.options$.timeoutMs || -1, + }, options ); - const response = await this.do$(request$, doOptions); + const response = await this.do$(request$, { + context, + errorCodes: ["400", "4XX", "5XX"], + retryConfig: options?.retries || this.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); const responseFields$ = { HttpMeta: { Response: response, Request: request$ }, @@ -270,7 +312,7 @@ export class Sync extends ClientSDK { const [result$] = await this.matcher() .void(200, z.void()) - .json(400, errors.Response400$, { err: true }) + .json(400, errors.Response400$inboundSchema, { err: true }) .fail(["4XX", "5XX"]) .match(response, { extraFields: responseFields$ }); @@ -294,13 +336,10 @@ export class Sync extends ClientSDK { syncs: syncs, connectionId: connectionId, }; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Accept", "application/json"); const payload$ = schemas$.parse( input$, - (value$) => operations.GetSyncStatusRequest$.outboundSchema.parse(value$), + (value$) => operations.GetSyncStatusRequest$outboundSchema.parse(value$), "Input validation failed" ); const body$ = null; @@ -313,24 +352,39 @@ export class Sync extends ClientSDK { syncs: payload$.syncs, }); + const headers$ = new Headers({ + Accept: "application/json", + }); + const context = { operationID: "getSyncStatus", oAuth2Scopes: [], securitySource: null }; - const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] }; const request$ = this.createRequest$( context, - { method: "GET", path: path$, headers: headers$, query: query$, body: body$ }, + { + method: "GET", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || this.options$.timeoutMs || -1, + }, options ); - const response = await this.do$(request$, doOptions); + const response = await this.do$(request$, { + context, + errorCodes: ["400", "4XX", "5XX"], + retryConfig: options?.retries || this.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); const responseFields$ = { HttpMeta: { Response: response, Request: request$ }, }; const [result$] = await this.matcher() - .json(200, components.GetSyncStatusResponse$) - .json(400, errors.Response400$, { err: true }) + .json(200, components.GetSyncStatusResponse$inboundSchema) + .json(400, errors.Response400$inboundSchema, { err: true }) .fail(["4XX", "5XX"]) .match(response, { extraFields: responseFields$ }); @@ -348,14 +402,10 @@ export class Sync extends ClientSDK { options?: RequestOptions ): Promise { const input$ = request; - const headers$ = new Headers(); - headers$.set("user-agent", SDK_METADATA.userAgent); - headers$.set("Content-Type", "application/json"); - headers$.set("Accept", "application/json"); const payload$ = schemas$.parse( input$, - (value$) => components.UpdateConnectionFrequencyRequest$.outboundSchema.parse(value$), + (value$) => components.UpdateConnectionFrequencyRequest$outboundSchema.parse(value$), "Input validation failed" ); const body$ = encodeJSON$("body", payload$, { explode: true }); @@ -364,28 +414,44 @@ export class Sync extends ClientSDK { const query$ = ""; + const headers$ = new Headers({ + "Content-Type": "application/json", + Accept: "application/json", + }); + const context = { operationID: "updateConnectionFrequency", oAuth2Scopes: [], securitySource: null, }; - const doOptions = { context, errorCodes: ["400", "4XX", "5XX"] }; const request$ = this.createRequest$( context, - { method: "PUT", path: path$, headers: headers$, query: query$, body: body$ }, + { + method: "PUT", + path: path$, + headers: headers$, + query: query$, + body: body$, + timeoutMs: options?.timeoutMs || this.options$.timeoutMs || -1, + }, options ); - const response = await this.do$(request$, doOptions); + const response = await this.do$(request$, { + context, + errorCodes: ["400", "4XX", "5XX"], + retryConfig: options?.retries || this.options$.retryConfig, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }); const responseFields$ = { HttpMeta: { Response: response, Request: request$ }, }; const [result$] = await this.matcher() - .json(200, components.UpdateConnectionFrequencyResponse$) - .json(400, errors.Response400$, { err: true }) + .json(200, components.UpdateConnectionFrequencyResponse$inboundSchema) + .json(400, errors.Response400$inboundSchema, { err: true }) .fail(["4XX", "5XX"]) .match(response, { extraFields: responseFields$ });