diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 984aca6c..c738994c 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 2bb10af9-e48a-4bd7-ae46-a35fa809dc29 management: - docChecksum: 648a1c76291df8598c3b2a9ac657e10b - docVersion: v2.0.0-rc.32 - speakeasyVersion: 1.300.0 - generationVersion: 2.338.14 - releaseVersion: 2.4.3 - configChecksum: 1d25e5e5a4465726f7965fcb8876f065 + docChecksum: 408cf4a96e96e76eaf0f8b23c35b2cb3 + docVersion: v2.0.0-rc.33 + speakeasyVersion: 1.306.0 + generationVersion: 2.340.3 + releaseVersion: 2.4.4 + configChecksum: c010a22da550696fd9374cdeb229e252 repoURL: https://github.com/formancehq/formance-sdk-typescript.git repoSubDirectory: . installationURL: https://github.com/formancehq/formance-sdk-typescript @@ -15,7 +15,7 @@ features: typescript: additionalDependencies: 0.1.0 constsAndDefaults: 0.1.5 - core: 3.9.12 + core: 3.9.13 deprecations: 2.81.1 errors: 2.81.10 globalSecurity: 2.82.9 diff --git a/RELEASES.md b/RELEASES.md index 0c184c99..9b1d3fcb 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -136,4 +136,14 @@ Based on: ### Generated - [typescript v2.4.3] . ### Releases -- [NPM v2.4.3] https://www.npmjs.com/package/@formance/formance-sdk/v/2.4.3 - . \ No newline at end of file +- [NPM v2.4.3] https://www.npmjs.com/package/@formance/formance-sdk/v/2.4.3 - . + +## 2024-06-13 00:19:23 +### Changes +Based on: +- OpenAPI Doc v2.0.0-rc.33 +- Speakeasy CLI 1.306.0 (2.340.3) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v2.4.4] . +### Releases +- [NPM v2.4.4] https://www.npmjs.com/package/@formance/formance-sdk/v/2.4.4 - . \ No newline at end of file diff --git a/gen.yaml b/gen.yaml index 1dfc84c8..52c131b0 100755 --- a/gen.yaml +++ b/gen.yaml @@ -12,7 +12,7 @@ generation: comments: {} telemetryEnabled: false typescript: - version: 2.4.3 + version: 2.4.4 additionalDependencies: dependencies: {} devDependencies: {} diff --git a/jsr.json b/jsr.json index 2393079e..ac2c9ada 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@formance/formance-sdk", - "version": "2.4.3", + "version": "2.4.4", "exports": { ".": "./src/index.ts", "./sdk/models/errors": "./src/sdk/models/errors/index.ts", diff --git a/package.json b/package.json index 9fb9d4da..91a0fccd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@formance/formance-sdk", - "version": "2.4.3", + "version": "2.4.4", "author": "Formance", "main": "./index.js", "sideEffects": false, diff --git a/src/lib/config.ts b/src/lib/config.ts index 05e6c58e..732a3541 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -53,8 +53,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", - openapiDocVersion: "v2.0.0-rc.32", - sdkVersion: "2.4.3", - genVersion: "2.338.14", - userAgent: "speakeasy-sdk/typescript 2.4.3 2.338.14 v2.0.0-rc.32 @formance/formance-sdk", + openapiDocVersion: "v2.0.0-rc.33", + sdkVersion: "2.4.4", + genVersion: "2.340.3", + userAgent: "speakeasy-sdk/typescript 2.4.4 2.340.3 v2.0.0-rc.33 @formance/formance-sdk", } as const; diff --git a/src/lib/encodings.ts b/src/lib/encodings.ts index 8cd50f68..c28d8944 100644 --- a/src/lib/encodings.ts +++ b/src/lib/encodings.ts @@ -383,3 +383,49 @@ function mapDefinedEntries( return acc; } + +export function queryJoin(...args: string[]): string { + return args.filter(Boolean).join("&"); +} + +type QueryEncoderOptions = { + explode?: boolean; + charEncoding?: "percent" | "none"; +}; + +type QueryEncoder = ( + key: string, + value: unknown, + options?: QueryEncoderOptions, +) => string; + +type BulkQueryEncoder = ( + values: Record, + options?: QueryEncoderOptions, +) => string; + +export function queryEncoder(f: QueryEncoder): BulkQueryEncoder { + const bulkEncode = function ( + values: Record, + options?: QueryEncoderOptions, + ): string { + const opts: QueryEncoderOptions = { + ...options, + explode: options?.explode ?? true, + charEncoding: options?.charEncoding ?? "percent", + }; + + const encoded = Object.entries(values).map(([key, value]) => { + return f(key, value, opts); + }); + return queryJoin(...encoded); + }; + + return bulkEncode; +} + +export const encodeJSONQuery = queryEncoder(encodeJSON); +export const encodeFormQuery = queryEncoder(encodeForm); +export const encodeSpaceDelimitedQuery = queryEncoder(encodeSpaceDelimited); +export const encodePipeDelimitedQuery = queryEncoder(encodePipeDelimited); +export const encodeDeepObjectQuery = queryEncoder(encodeDeepObject); diff --git a/src/sdk/auth.ts b/src/sdk/auth.ts index 9c958b73..58aef57a 100644 --- a/src/sdk/auth.ts +++ b/src/sdk/auth.ts @@ -4,7 +4,7 @@ import { SDKHooks } from "../hooks"; import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config"; -import * as enc$ from "../lib/encodings"; +import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings"; import { HTTPClient } from "../lib/http"; import * as schemas$ from "../lib/schemas"; import { ClientSDK, RequestOptions } from "../lib/sdks"; @@ -57,7 +57,7 @@ export class Auth extends ClientSDK { "Input validation failed" ); const body$ = - payload$ === undefined ? null : enc$.encodeJSON("body", payload$, { explode: true }); + payload$ === undefined ? null : encodeJSON$("body", payload$, { explode: true }); const path$ = this.templateURLComponent("/api/auth/clients")(); @@ -127,10 +127,10 @@ export class Auth extends ClientSDK { (value$) => operations.CreateSecretRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$.CreateSecretRequest, { explode: true }); + const body$ = encodeJSON$("body", payload$.CreateSecretRequest, { explode: true }); const pathParams$ = { - clientId: enc$.encodeSimple("clientId", payload$.clientId, { + clientId: encodeSimple$("clientId", payload$.clientId, { explode: false, charEncoding: "percent", }), @@ -207,7 +207,7 @@ export class Auth extends ClientSDK { const body$ = null; const pathParams$ = { - clientId: enc$.encodeSimple("clientId", payload$.clientId, { + clientId: encodeSimple$("clientId", payload$.clientId, { explode: false, charEncoding: "percent", }), @@ -282,11 +282,11 @@ export class Auth extends ClientSDK { const body$ = null; const pathParams$ = { - clientId: enc$.encodeSimple("clientId", payload$.clientId, { + clientId: encodeSimple$("clientId", payload$.clientId, { explode: false, charEncoding: "percent", }), - secretId: enc$.encodeSimple("secretId", payload$.secretId, { + secretId: encodeSimple$("secretId", payload$.secretId, { explode: false, charEncoding: "percent", }), @@ -480,7 +480,7 @@ export class Auth extends ClientSDK { const body$ = null; const pathParams$ = { - clientId: enc$.encodeSimple("clientId", payload$.clientId, { + clientId: encodeSimple$("clientId", payload$.clientId, { explode: false, charEncoding: "percent", }), @@ -558,7 +558,7 @@ export class Auth extends ClientSDK { const body$ = null; const pathParams$ = { - userId: enc$.encodeSimple("userId", payload$.userId, { + userId: encodeSimple$("userId", payload$.userId, { explode: false, charEncoding: "percent", }), @@ -631,10 +631,10 @@ export class Auth extends ClientSDK { (value$) => operations.UpdateClientRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$.UpdateClientRequest, { explode: true }); + const body$ = encodeJSON$("body", payload$.UpdateClientRequest, { explode: true }); const pathParams$ = { - clientId: enc$.encodeSimple("clientId", payload$.clientId, { + clientId: encodeSimple$("clientId", payload$.clientId, { explode: false, charEncoding: "percent", }), diff --git a/src/sdk/ledger.ts b/src/sdk/ledger.ts index 01c9d407..1b7130b0 100644 --- a/src/sdk/ledger.ts +++ b/src/sdk/ledger.ts @@ -4,7 +4,14 @@ import { SDKHooks } from "../hooks"; import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config"; -import * as enc$ from "../lib/encodings"; +import { + encodeDeepObjectQuery as encodeDeepObjectQuery$, + encodeFormQuery as encodeFormQuery$, + encodeJSON as encodeJSON$, + encodeJSONQuery as encodeJSONQuery$, + encodeSimple as encodeSimple$, + queryJoin as queryJoin$, +} from "../lib/encodings"; import { HTTPClient } from "../lib/http"; import * as schemas$ from "../lib/schemas"; import { ClientSDK, RequestOptions } from "../lib/sdks"; @@ -56,10 +63,10 @@ export class Ledger extends ClientSDK { (value$) => operations.CreateTransactionsRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$.Transactions, { explode: true }); + const body$ = encodeJSON$("body", payload$.Transactions, { explode: true }); const pathParams$ = { - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), @@ -134,17 +141,14 @@ export class Ledger extends ClientSDK { (value$) => operations.AddMetadataOnTransactionRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$.RequestBody, { explode: true }); + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); const pathParams$ = { - ledger: enc$.encodeSimple("ledger", payload$.ledger, { - explode: false, - charEncoding: "percent", - }), - txid: enc$.encodeSimple("txid", payload$.txid, { + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), + txid: encodeSimple$("txid", payload$.txid, { explode: false, charEncoding: "percent" }), }; const path$ = this.templateURLComponent( "/api/ledger/{ledger}/transactions/{txid}/metadata" @@ -216,14 +220,14 @@ export class Ledger extends ClientSDK { (value$) => operations.AddMetadataToAccountRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$.RequestBody, { explode: true }); + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); const pathParams$ = { - address: enc$.encodeSimple("address", payload$.address, { + address: encodeSimple$("address", payload$.address, { explode: false, charEncoding: "percent", }), - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), @@ -300,22 +304,21 @@ export class Ledger extends ClientSDK { const body$ = null; const pathParams$ = { - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), }; const path$ = this.templateURLComponent("/api/ledger/{ledger}/accounts")(pathParams$); - const query$ = [ - enc$.encodeForm("address", payload$.address, { - explode: true, - charEncoding: "percent", + const query$ = queryJoin$( + encodeFormQuery$({ + address: payload$.address, }), - enc$.encodeDeepObject("metadata", payload$.metadata, { charEncoding: "percent" }), - ] - .filter(Boolean) - .join("&"); + encodeDeepObjectQuery$({ + metadata: payload$.metadata, + }) + ); let security$; if (typeof this.options$.authorization === "function") { @@ -383,39 +386,26 @@ export class Ledger extends ClientSDK { const body$ = null; const pathParams$ = { - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), }; const path$ = this.templateURLComponent("/api/ledger/{ledger}/transactions")(pathParams$); - const query$ = [ - enc$.encodeForm("account", payload$.account, { - explode: true, - charEncoding: "percent", - }), - enc$.encodeForm("destination", payload$.destination, { - explode: true, - charEncoding: "percent", - }), - enc$.encodeForm("endTime", payload$.endTime, { - explode: true, - charEncoding: "percent", - }), - enc$.encodeDeepObject("metadata", payload$.metadata, { charEncoding: "percent" }), - enc$.encodeForm("reference", payload$.reference, { - explode: true, - charEncoding: "percent", - }), - enc$.encodeForm("source", payload$.source, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("startTime", payload$.startTime, { - explode: true, - charEncoding: "percent", - }), - ] - .filter(Boolean) - .join("&"); + const query$ = queryJoin$( + encodeFormQuery$({ + reference: payload$.reference, + source: payload$.source, + startTime: payload$.startTime, + account: payload$.account, + destination: payload$.destination, + endTime: payload$.endTime, + }), + encodeDeepObjectQuery$({ + metadata: payload$.metadata, + }) + ); let security$; if (typeof this.options$.authorization === "function") { @@ -481,24 +471,19 @@ export class Ledger extends ClientSDK { (value$) => operations.CreateTransactionRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$.PostTransaction, { explode: true }); + const body$ = encodeJSON$("body", payload$.PostTransaction, { explode: true }); const pathParams$ = { - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), }; const path$ = this.templateURLComponent("/api/ledger/{ledger}/transactions")(pathParams$); - const query$ = [ - enc$.encodeForm("preview", payload$.preview, { - explode: true, - charEncoding: "percent", - }), - ] - .filter(Boolean) - .join("&"); + const query$ = encodeFormQuery$({ + preview: payload$.preview, + }); let security$; if (typeof this.options$.authorization === "function") { @@ -566,11 +551,11 @@ export class Ledger extends ClientSDK { const body$ = null; const pathParams$ = { - address: enc$.encodeSimple("address", payload$.address, { + address: encodeSimple$("address", payload$.address, { explode: false, charEncoding: "percent", }), - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), @@ -647,27 +632,19 @@ export class Ledger extends ClientSDK { const body$ = null; const pathParams$ = { - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), }; const path$ = this.templateURLComponent("/api/ledger/{ledger}/balances")(pathParams$); - const query$ = [ - enc$.encodeForm("address", payload$.address, { - explode: true, - charEncoding: "percent", - }), - enc$.encodeForm("after", payload$.after, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("cursor", payload$.cursor, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("pageSize", payload$.pageSize, { - explode: true, - charEncoding: "percent", - }), - ] - .filter(Boolean) - .join("&"); + const query$ = encodeFormQuery$({ + address: payload$.address, + after: payload$.after, + cursor: payload$.cursor, + pageSize: payload$.pageSize, + }); let security$; if (typeof this.options$.authorization === "function") { @@ -735,7 +712,7 @@ export class Ledger extends ClientSDK { const body$ = null; const pathParams$ = { - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), @@ -744,18 +721,10 @@ export class Ledger extends ClientSDK { pathParams$ ); - const query$ = [ - enc$.encodeForm("address", payload$.address, { - explode: true, - charEncoding: "percent", - }), - enc$.encodeForm("useInsertionDate", payload$.useInsertionDate, { - explode: true, - charEncoding: "percent", - }), - ] - .filter(Boolean) - .join("&"); + const query$ = encodeFormQuery$({ + address: payload$.address, + useInsertionDate: payload$.useInsertionDate, + }); let security$; if (typeof this.options$.authorization === "function") { @@ -882,7 +851,7 @@ export class Ledger extends ClientSDK { const body$ = null; const pathParams$ = { - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), @@ -957,7 +926,7 @@ export class Ledger extends ClientSDK { const body$ = null; const pathParams$ = { - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), @@ -1032,14 +1001,11 @@ export class Ledger extends ClientSDK { const body$ = null; const pathParams$ = { - ledger: enc$.encodeSimple("ledger", payload$.ledger, { - explode: false, - charEncoding: "percent", - }), - txid: enc$.encodeSimple("txid", payload$.txid, { + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), + txid: encodeSimple$("txid", payload$.txid, { explode: false, charEncoding: "percent" }), }; const path$ = this.templateURLComponent("/api/ledger/{ledger}/transactions/{txid}")( pathParams$ @@ -1116,36 +1082,26 @@ export class Ledger extends ClientSDK { const body$ = null; const pathParams$ = { - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), }; const path$ = this.templateURLComponent("/api/ledger/{ledger}/accounts")(pathParams$); - const query$ = [ - enc$.encodeForm("address", payload$.address, { - explode: true, - charEncoding: "percent", - }), - enc$.encodeForm("after", payload$.after, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("balance", payload$.balance, { - explode: true, - charEncoding: "percent", - }), - enc$.encodeForm("cursor", payload$.cursor, { explode: true, charEncoding: "percent" }), - enc$.encodeDeepObject("metadata", payload$.metadata, { charEncoding: "percent" }), - enc$.encodeForm("pageSize", payload$.pageSize, { - explode: true, - charEncoding: "percent", - }), - enc$.encodeForm("pagination_token", payload$.pagination_token, { - explode: true, - charEncoding: "percent", - }), - ] - .filter(Boolean) - .join("&"); + const query$ = queryJoin$( + encodeFormQuery$({ + address: payload$.address, + after: payload$.after, + balance: payload$.balance, + cursor: payload$.cursor, + pageSize: payload$.pageSize, + pagination_token: payload$.pagination_token, + }), + encodeDeepObjectQuery$({ + metadata: payload$.metadata, + }) + ); let security$; if (typeof this.options$.authorization === "function") { @@ -1216,31 +1172,20 @@ export class Ledger extends ClientSDK { const body$ = null; const pathParams$ = { - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), }; const path$ = this.templateURLComponent("/api/ledger/{ledger}/logs")(pathParams$); - const query$ = [ - enc$.encodeForm("after", payload$.after, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("cursor", payload$.cursor, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("endTime", payload$.endTime, { - explode: true, - charEncoding: "percent", - }), - enc$.encodeForm("pageSize", payload$.pageSize, { - explode: true, - charEncoding: "percent", - }), - enc$.encodeForm("startTime", payload$.startTime, { - explode: true, - charEncoding: "percent", - }), - ] - .filter(Boolean) - .join("&"); + const query$ = encodeFormQuery$({ + startTime: payload$.startTime, + after: payload$.after, + cursor: payload$.cursor, + endTime: payload$.endTime, + pageSize: payload$.pageSize, + }); let security$; if (typeof this.options$.authorization === "function") { @@ -1311,45 +1256,29 @@ export class Ledger extends ClientSDK { const body$ = null; const pathParams$ = { - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), }; const path$ = this.templateURLComponent("/api/ledger/{ledger}/transactions")(pathParams$); - const query$ = [ - enc$.encodeForm("account", payload$.account, { - explode: true, - charEncoding: "percent", - }), - enc$.encodeForm("after", payload$.after, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("cursor", payload$.cursor, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("destination", payload$.destination, { - explode: true, - charEncoding: "percent", - }), - enc$.encodeForm("endTime", payload$.endTime, { - explode: true, - charEncoding: "percent", - }), - enc$.encodeDeepObject("metadata", payload$.metadata, { charEncoding: "percent" }), - enc$.encodeForm("pageSize", payload$.pageSize, { - explode: true, - charEncoding: "percent", - }), - enc$.encodeForm("reference", payload$.reference, { - explode: true, - charEncoding: "percent", - }), - enc$.encodeForm("source", payload$.source, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("startTime", payload$.startTime, { - explode: true, - charEncoding: "percent", - }), - ] - .filter(Boolean) - .join("&"); + const query$ = queryJoin$( + encodeFormQuery$({ + reference: payload$.reference, + startTime: payload$.startTime, + account: payload$.account, + after: payload$.after, + cursor: payload$.cursor, + destination: payload$.destination, + endTime: payload$.endTime, + pageSize: payload$.pageSize, + source: payload$.source, + }), + encodeDeepObjectQuery$({ + metadata: payload$.metadata, + }) + ); let security$; if (typeof this.options$.authorization === "function") { @@ -1421,7 +1350,7 @@ export class Ledger extends ClientSDK { const body$ = null; const pathParams$ = { - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), @@ -1496,27 +1425,19 @@ export class Ledger extends ClientSDK { const body$ = null; const pathParams$ = { - ledger: enc$.encodeSimple("ledger", payload$.ledger, { - explode: false, - charEncoding: "percent", - }), - txid: enc$.encodeSimple("txid", payload$.txid, { + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), + txid: encodeSimple$("txid", payload$.txid, { explode: false, charEncoding: "percent" }), }; const path$ = this.templateURLComponent("/api/ledger/{ledger}/transactions/{txid}/revert")( pathParams$ ); - const query$ = [ - enc$.encodeForm("disableChecks", payload$.disableChecks, { - explode: true, - charEncoding: "percent", - }), - ] - .filter(Boolean) - .join("&"); + const query$ = encodeFormQuery$({ + disableChecks: payload$.disableChecks, + }); let security$; if (typeof this.options$.authorization === "function") { @@ -1588,24 +1509,19 @@ export class Ledger extends ClientSDK { (value$) => operations.RunScriptRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$.Script, { explode: true }); + const body$ = encodeJSON$("body", payload$.Script, { explode: true }); const pathParams$ = { - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), }; const path$ = this.templateURLComponent("/api/ledger/{ledger}/script")(pathParams$); - const query$ = [ - enc$.encodeForm("preview", payload$.preview, { - explode: true, - charEncoding: "percent", - }), - ] - .filter(Boolean) - .join("&"); + const query$ = encodeFormQuery$({ + preview: payload$.preview, + }); let security$; if (typeof this.options$.authorization === "function") { @@ -1671,10 +1587,10 @@ export class Ledger extends ClientSDK { (value$) => operations.UpdateMappingRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$.Mapping, { explode: true }); + const body$ = encodeJSON$("body", payload$.Mapping, { explode: true }); const pathParams$ = { - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), @@ -1747,11 +1663,11 @@ export class Ledger extends ClientSDK { (value$) => operations.V2AddMetadataOnTransactionRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$.RequestBody, { explode: true }); + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); const pathParams$ = { - id: enc$.encodeSimple("id", payload$.id, { explode: false, charEncoding: "percent" }), - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), @@ -1760,15 +1676,13 @@ export class Ledger extends ClientSDK { "/api/ledger/v2/{ledger}/transactions/{id}/metadata" )(pathParams$); - const query$ = [ - enc$.encodeForm("dryRun", payload$.dryRun, { explode: true, charEncoding: "percent" }), - ] - .filter(Boolean) - .join("&"); + const query$ = encodeFormQuery$({ + dryRun: payload$.dryRun, + }); headers$.set( "Idempotency-Key", - enc$.encodeSimple("Idempotency-Key", payload$["Idempotency-Key"], { + encodeSimple$("Idempotency-Key", payload$["Idempotency-Key"], { explode: false, charEncoding: "none", }) @@ -1838,14 +1752,14 @@ export class Ledger extends ClientSDK { (value$) => operations.V2AddMetadataToAccountRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$.RequestBody, { explode: true }); + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); const pathParams$ = { - address: enc$.encodeSimple("address", payload$.address, { + address: encodeSimple$("address", payload$.address, { explode: false, charEncoding: "percent", }), - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), @@ -1854,15 +1768,13 @@ export class Ledger extends ClientSDK { "/api/ledger/v2/{ledger}/accounts/{address}/metadata" )(pathParams$); - const query$ = [ - enc$.encodeForm("dryRun", payload$.dryRun, { explode: true, charEncoding: "percent" }), - ] - .filter(Boolean) - .join("&"); + const query$ = encodeFormQuery$({ + dryRun: payload$.dryRun, + }); headers$.set( "Idempotency-Key", - enc$.encodeSimple("Idempotency-Key", payload$["Idempotency-Key"], { + encodeSimple$("Idempotency-Key", payload$["Idempotency-Key"], { explode: false, charEncoding: "none", }) @@ -1934,19 +1846,24 @@ export class Ledger extends ClientSDK { const body$ = null; const pathParams$ = { - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), }; const path$ = this.templateURLComponent("/api/ledger/v2/{ledger}/accounts")(pathParams$); - const query$ = [ - enc$.encodeForm("pit", payload$.pit, { explode: true, charEncoding: "percent" }), - enc$.encodeJSON("query", payload$.query, { explode: false, charEncoding: "percent" }), - ] - .filter(Boolean) - .join("&"); + const query$ = queryJoin$( + encodeFormQuery$({ + pit: payload$.pit, + }), + encodeJSONQuery$( + { + query: payload$.query, + }, + { explode: false } + ) + ); let security$; if (typeof this.options$.authorization === "function") { @@ -2014,7 +1931,7 @@ export class Ledger extends ClientSDK { const body$ = null; const pathParams$ = { - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), @@ -2023,12 +1940,17 @@ export class Ledger extends ClientSDK { pathParams$ ); - const query$ = [ - enc$.encodeForm("pit", payload$.pit, { explode: true, charEncoding: "percent" }), - enc$.encodeJSON("query", payload$.query, { explode: false, charEncoding: "percent" }), - ] - .filter(Boolean) - .join("&"); + const query$ = queryJoin$( + encodeFormQuery$({ + pit: payload$.pit, + }), + encodeJSONQuery$( + { + query: payload$.query, + }, + { explode: false } + ) + ); let security$; if (typeof this.options$.authorization === "function") { @@ -2094,10 +2016,10 @@ export class Ledger extends ClientSDK { (value$) => operations.V2CreateBulkRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$.RequestBody, { explode: true }); + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); const pathParams$ = { - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), @@ -2170,10 +2092,10 @@ export class Ledger extends ClientSDK { (value$) => operations.V2CreateLedgerRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$.V2CreateLedgerRequest, { explode: true }); + const body$ = encodeJSON$("body", payload$.V2CreateLedgerRequest, { explode: true }); const pathParams$ = { - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), @@ -2246,10 +2168,10 @@ export class Ledger extends ClientSDK { (value$) => operations.V2CreateTransactionRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$.V2PostTransaction, { explode: true }); + const body$ = encodeJSON$("body", payload$.V2PostTransaction, { explode: true }); const pathParams$ = { - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), @@ -2258,15 +2180,13 @@ export class Ledger extends ClientSDK { pathParams$ ); - const query$ = [ - enc$.encodeForm("dryRun", payload$.dryRun, { explode: true, charEncoding: "percent" }), - ] - .filter(Boolean) - .join("&"); + const query$ = encodeFormQuery$({ + dryRun: payload$.dryRun, + }); headers$.set( "Idempotency-Key", - enc$.encodeSimple("Idempotency-Key", payload$["Idempotency-Key"], { + encodeSimple$("Idempotency-Key", payload$["Idempotency-Key"], { explode: false, charEncoding: "none", }) @@ -2343,15 +2263,12 @@ export class Ledger extends ClientSDK { const body$ = null; const pathParams$ = { - address: enc$.encodeSimple("address", payload$.address, { - explode: false, - charEncoding: "percent", - }), - key: enc$.encodeSimple("key", payload$.key, { + address: encodeSimple$("address", payload$.address, { explode: false, charEncoding: "percent", }), - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + key: encodeSimple$("key", payload$.key, { explode: false, charEncoding: "percent" }), + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), @@ -2428,11 +2345,8 @@ export class Ledger extends ClientSDK { const body$ = null; const pathParams$ = { - key: enc$.encodeSimple("key", payload$.key, { - explode: false, - charEncoding: "percent", - }), - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + key: encodeSimple$("key", payload$.key, { explode: false, charEncoding: "percent" }), + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), @@ -2512,12 +2426,9 @@ export class Ledger extends ClientSDK { const body$ = null; const pathParams$ = { - id: enc$.encodeSimple("id", payload$.id, { explode: false, charEncoding: "percent" }), - key: enc$.encodeSimple("key", payload$.key, { - explode: false, - charEncoding: "percent", - }), - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + key: encodeSimple$("key", payload$.key, { explode: false, charEncoding: "percent" }), + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), @@ -2594,11 +2505,11 @@ export class Ledger extends ClientSDK { const body$ = null; const pathParams$ = { - address: enc$.encodeSimple("address", payload$.address, { + address: encodeSimple$("address", payload$.address, { explode: false, charEncoding: "percent", }), - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), @@ -2607,12 +2518,10 @@ export class Ledger extends ClientSDK { pathParams$ ); - const query$ = [ - enc$.encodeForm("expand", payload$.expand, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("pit", payload$.pit, { explode: true, charEncoding: "percent" }), - ] - .filter(Boolean) - .join("&"); + const query$ = encodeFormQuery$({ + expand: payload$.expand, + pit: payload$.pit, + }); let security$; if (typeof this.options$.authorization === "function") { @@ -2680,7 +2589,7 @@ export class Ledger extends ClientSDK { const body$ = null; const pathParams$ = { - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), @@ -2689,16 +2598,18 @@ export class Ledger extends ClientSDK { pathParams$ ); - const query$ = [ - enc$.encodeForm("pit", payload$.pit, { explode: true, charEncoding: "percent" }), - enc$.encodeJSON("query", payload$.query, { explode: false, charEncoding: "percent" }), - enc$.encodeForm("useInsertionDate", payload$.useInsertionDate, { - explode: true, - charEncoding: "percent", + const query$ = queryJoin$( + encodeFormQuery$({ + pit: payload$.pit, + useInsertionDate: payload$.useInsertionDate, }), - ] - .filter(Boolean) - .join("&"); + encodeJSONQuery$( + { + query: payload$.query, + }, + { explode: false } + ) + ); let security$; if (typeof this.options$.authorization === "function") { @@ -2825,7 +2736,7 @@ export class Ledger extends ClientSDK { const body$ = null; const pathParams$ = { - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), @@ -2900,7 +2811,7 @@ export class Ledger extends ClientSDK { const body$ = null; const pathParams$ = { - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), @@ -2975,8 +2886,8 @@ export class Ledger extends ClientSDK { const body$ = null; const pathParams$ = { - id: enc$.encodeSimple("id", payload$.id, { explode: false, charEncoding: "percent" }), - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), @@ -2985,12 +2896,10 @@ export class Ledger extends ClientSDK { pathParams$ ); - const query$ = [ - enc$.encodeForm("expand", payload$.expand, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("pit", payload$.pit, { explode: true, charEncoding: "percent" }), - ] - .filter(Boolean) - .join("&"); + const query$ = encodeFormQuery$({ + expand: payload$.expand, + pit: payload$.pit, + }); let security$; if (typeof this.options$.authorization === "function") { @@ -3058,39 +2967,29 @@ export class Ledger extends ClientSDK { const body$ = null; const pathParams$ = { - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), }; const path$ = this.templateURLComponent("/api/ledger/v2/{ledger}/volumes")(pathParams$); - const query$ = [ - enc$.encodeForm("cursor", payload$.cursor, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("endTime", payload$.endTime, { - explode: true, - charEncoding: "percent", + const query$ = queryJoin$( + encodeFormQuery$({ + endTime: payload$.endTime, + groupBy: payload$.groupBy, + insertionDate: payload$.insertionDate, + pageSize: payload$.pageSize, + startTime: payload$.startTime, + cursor: payload$.cursor, }), - enc$.encodeForm("groupBy", payload$.groupBy, { - explode: true, - charEncoding: "percent", - }), - enc$.encodeForm("insertionDate", payload$.insertionDate, { - explode: true, - charEncoding: "percent", - }), - enc$.encodeForm("pageSize", payload$.pageSize, { - explode: true, - charEncoding: "percent", - }), - enc$.encodeJSON("query", payload$.query, { explode: false, charEncoding: "percent" }), - enc$.encodeForm("startTime", payload$.startTime, { - explode: true, - charEncoding: "percent", - }), - ] - .filter(Boolean) - .join("&"); + encodeJSONQuery$( + { + query: payload$.query, + }, + { explode: false } + ) + ); let security$; if (typeof this.options$.authorization === "function") { @@ -3163,25 +3062,27 @@ export class Ledger extends ClientSDK { const body$ = null; const pathParams$ = { - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), }; const path$ = this.templateURLComponent("/api/ledger/v2/{ledger}/accounts")(pathParams$); - const query$ = [ - enc$.encodeForm("cursor", payload$.cursor, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("expand", payload$.expand, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("pageSize", payload$.pageSize, { - explode: true, - charEncoding: "percent", + const query$ = queryJoin$( + encodeFormQuery$({ + pageSize: payload$.pageSize, + pit: payload$.pit, + cursor: payload$.cursor, + expand: payload$.expand, }), - enc$.encodeForm("pit", payload$.pit, { explode: true, charEncoding: "percent" }), - enc$.encodeJSON("query", payload$.query, { explode: false, charEncoding: "percent" }), - ] - .filter(Boolean) - .join("&"); + encodeJSONQuery$( + { + query: payload$.query, + }, + { explode: false } + ) + ); let security$; if (typeof this.options$.authorization === "function") { @@ -3250,15 +3151,10 @@ export class Ledger extends ClientSDK { const path$ = this.templateURLComponent("/api/ledger/v2")(); - const query$ = [ - enc$.encodeForm("cursor", payload$.cursor, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("pageSize", payload$.pageSize, { - explode: true, - charEncoding: "percent", - }), - ] - .filter(Boolean) - .join("&"); + const query$ = encodeFormQuery$({ + cursor: payload$.cursor, + pageSize: payload$.pageSize, + }); let security$; if (typeof this.options$.authorization === "function") { @@ -3329,24 +3225,26 @@ export class Ledger extends ClientSDK { const body$ = null; const pathParams$ = { - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), }; const path$ = this.templateURLComponent("/api/ledger/v2/{ledger}/logs")(pathParams$); - const query$ = [ - enc$.encodeForm("cursor", payload$.cursor, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("pageSize", payload$.pageSize, { - explode: true, - charEncoding: "percent", + const query$ = queryJoin$( + encodeFormQuery$({ + cursor: payload$.cursor, + pageSize: payload$.pageSize, + pit: payload$.pit, }), - enc$.encodeForm("pit", payload$.pit, { explode: true, charEncoding: "percent" }), - enc$.encodeJSON("query", payload$.query, { explode: false, charEncoding: "percent" }), - ] - .filter(Boolean) - .join("&"); + encodeJSONQuery$( + { + query: payload$.query, + }, + { explode: false } + ) + ); let security$; if (typeof this.options$.authorization === "function") { @@ -3417,7 +3315,7 @@ export class Ledger extends ClientSDK { const body$ = null; const pathParams$ = { - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), @@ -3426,18 +3324,20 @@ export class Ledger extends ClientSDK { pathParams$ ); - const query$ = [ - enc$.encodeForm("cursor", payload$.cursor, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("expand", payload$.expand, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("pageSize", payload$.pageSize, { - explode: true, - charEncoding: "percent", + const query$ = queryJoin$( + encodeFormQuery$({ + expand: payload$.expand, + pageSize: payload$.pageSize, + pit: payload$.pit, + cursor: payload$.cursor, }), - enc$.encodeForm("pit", payload$.pit, { explode: true, charEncoding: "percent" }), - enc$.encodeJSON("query", payload$.query, { explode: false, charEncoding: "percent" }), - ] - .filter(Boolean) - .join("&"); + encodeJSONQuery$( + { + query: payload$.query, + }, + { explode: false } + ) + ); let security$; if (typeof this.options$.authorization === "function") { @@ -3511,7 +3411,7 @@ export class Ledger extends ClientSDK { const body$ = null; const pathParams$ = { - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), @@ -3586,8 +3486,8 @@ export class Ledger extends ClientSDK { const body$ = null; const pathParams$ = { - id: enc$.encodeSimple("id", payload$.id, { explode: false, charEncoding: "percent" }), - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), @@ -3596,15 +3496,10 @@ export class Ledger extends ClientSDK { pathParams$ ); - const query$ = [ - enc$.encodeForm("atEffectiveDate", payload$.atEffectiveDate, { - explode: true, - charEncoding: "percent", - }), - enc$.encodeForm("force", payload$.force, { explode: true, charEncoding: "percent" }), - ] - .filter(Boolean) - .join("&"); + const query$ = encodeFormQuery$({ + atEffectiveDate: payload$.atEffectiveDate, + force: payload$.force, + }); let security$; if (typeof this.options$.authorization === "function") { @@ -3672,10 +3567,10 @@ export class Ledger extends ClientSDK { (value$) => operations.V2UpdateLedgerMetadataRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$.RequestBody, { explode: true }); + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); const pathParams$ = { - ledger: enc$.encodeSimple("ledger", payload$.ledger, { + ledger: encodeSimple$("ledger", payload$.ledger, { explode: false, charEncoding: "percent", }), diff --git a/src/sdk/orchestration.ts b/src/sdk/orchestration.ts index a5ab1942..2ddf1364 100644 --- a/src/sdk/orchestration.ts +++ b/src/sdk/orchestration.ts @@ -4,7 +4,11 @@ import { SDKHooks } from "../hooks"; import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config"; -import * as enc$ from "../lib/encodings"; +import { + encodeFormQuery as encodeFormQuery$, + encodeJSON as encodeJSON$, + encodeSimple as encodeSimple$, +} from "../lib/encodings"; import { HTTPClient } from "../lib/http"; import * as schemas$ from "../lib/schemas"; import { ClientSDK, RequestOptions } from "../lib/sdks"; @@ -62,7 +66,7 @@ export class Orchestration extends ClientSDK { const body$ = null; const pathParams$ = { - instanceID: enc$.encodeSimple("instanceID", payload$.instanceID, { + instanceID: encodeSimple$("instanceID", payload$.instanceID, { explode: false, charEncoding: "percent", }), @@ -141,7 +145,7 @@ export class Orchestration extends ClientSDK { "Input validation failed" ); const body$ = - payload$ === undefined ? null : enc$.encodeJSON("body", payload$, { explode: true }); + payload$ === undefined ? null : encodeJSON$("body", payload$, { explode: true }); const path$ = this.templateURLComponent("/api/orchestration/triggers")(); @@ -215,7 +219,7 @@ export class Orchestration extends ClientSDK { "Input validation failed" ); const body$ = - payload$ === undefined ? null : enc$.encodeJSON("body", payload$, { explode: true }); + payload$ === undefined ? null : encodeJSON$("body", payload$, { explode: true }); const path$ = this.templateURLComponent("/api/orchestration/workflows")(); @@ -290,7 +294,7 @@ export class Orchestration extends ClientSDK { const body$ = null; const pathParams$ = { - triggerID: enc$.encodeSimple("triggerID", payload$.triggerID, { + triggerID: encodeSimple$("triggerID", payload$.triggerID, { explode: false, charEncoding: "percent", }), @@ -370,7 +374,7 @@ export class Orchestration extends ClientSDK { const body$ = null; const pathParams$ = { - flowId: enc$.encodeSimple("flowId", payload$.flowId, { + flowId: encodeSimple$("flowId", payload$.flowId, { explode: false, charEncoding: "percent", }), @@ -450,7 +454,7 @@ export class Orchestration extends ClientSDK { const body$ = null; const pathParams$ = { - instanceID: enc$.encodeSimple("instanceID", payload$.instanceID, { + instanceID: encodeSimple$("instanceID", payload$.instanceID, { explode: false, charEncoding: "percent", }), @@ -530,7 +534,7 @@ export class Orchestration extends ClientSDK { const body$ = null; const pathParams$ = { - instanceID: enc$.encodeSimple("instanceID", payload$.instanceID, { + instanceID: encodeSimple$("instanceID", payload$.instanceID, { explode: false, charEncoding: "percent", }), @@ -612,11 +616,11 @@ export class Orchestration extends ClientSDK { const body$ = null; const pathParams$ = { - instanceID: enc$.encodeSimple("instanceID", payload$.instanceID, { + instanceID: encodeSimple$("instanceID", payload$.instanceID, { explode: false, charEncoding: "percent", }), - number: enc$.encodeSimple("number", payload$.number, { + number: encodeSimple$("number", payload$.number, { explode: false, charEncoding: "percent", }), @@ -698,7 +702,7 @@ export class Orchestration extends ClientSDK { const body$ = null; const pathParams$ = { - flowId: enc$.encodeSimple("flowId", payload$.flowId, { + flowId: encodeSimple$("flowId", payload$.flowId, { explode: false, charEncoding: "percent", }), @@ -779,18 +783,10 @@ export class Orchestration extends ClientSDK { const path$ = this.templateURLComponent("/api/orchestration/instances")(); - const query$ = [ - enc$.encodeForm("running", payload$.running, { - explode: true, - charEncoding: "percent", - }), - enc$.encodeForm("workflowID", payload$.workflowID, { - explode: true, - charEncoding: "percent", - }), - ] - .filter(Boolean) - .join("&"); + const query$ = encodeFormQuery$({ + running: payload$.running, + workflowID: payload$.workflowID, + }); let security$; if (typeof this.options$.authorization === "function") { @@ -862,11 +858,9 @@ export class Orchestration extends ClientSDK { const path$ = this.templateURLComponent("/api/orchestration/triggers")(); - const query$ = [ - enc$.encodeForm("name", payload$.name, { explode: true, charEncoding: "percent" }), - ] - .filter(Boolean) - .join("&"); + const query$ = encodeFormQuery$({ + name: payload$.name, + }); let security$; if (typeof this.options$.authorization === "function") { @@ -937,7 +931,7 @@ export class Orchestration extends ClientSDK { const body$ = null; const pathParams$ = { - triggerID: enc$.encodeSimple("triggerID", payload$.triggerID, { + triggerID: encodeSimple$("triggerID", payload$.triggerID, { explode: false, charEncoding: "percent", }), @@ -1138,7 +1132,7 @@ export class Orchestration extends ClientSDK { const body$ = null; const pathParams$ = { - triggerID: enc$.encodeSimple("triggerID", payload$.triggerID, { + triggerID: encodeSimple$("triggerID", payload$.triggerID, { explode: false, charEncoding: "percent", }), @@ -1216,10 +1210,10 @@ export class Orchestration extends ClientSDK { (value$) => operations.RunWorkflowRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$.RequestBody, { explode: true }); + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); const pathParams$ = { - workflowID: enc$.encodeSimple("workflowID", payload$.workflowID, { + workflowID: encodeSimple$("workflowID", payload$.workflowID, { explode: false, charEncoding: "percent", }), @@ -1228,11 +1222,9 @@ export class Orchestration extends ClientSDK { "/api/orchestration/workflows/{workflowID}/instances" )(pathParams$); - const query$ = [ - enc$.encodeForm("wait", payload$.wait, { explode: true, charEncoding: "percent" }), - ] - .filter(Boolean) - .join("&"); + const query$ = encodeFormQuery$({ + wait: payload$.wait, + }); let security$; if (typeof this.options$.authorization === "function") { @@ -1301,10 +1293,10 @@ export class Orchestration extends ClientSDK { (value$) => operations.SendEventRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$.RequestBody, { explode: true }); + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); const pathParams$ = { - instanceID: enc$.encodeSimple("instanceID", payload$.instanceID, { + instanceID: encodeSimple$("instanceID", payload$.instanceID, { explode: false, charEncoding: "percent", }), @@ -1382,10 +1374,10 @@ export class Orchestration extends ClientSDK { (value$) => operations.TestTriggerRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$.RequestBody, { explode: true }); + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); const pathParams$ = { - triggerID: enc$.encodeSimple("triggerID", payload$.triggerID, { + triggerID: encodeSimple$("triggerID", payload$.triggerID, { explode: false, charEncoding: "percent", }), @@ -1465,7 +1457,7 @@ export class Orchestration extends ClientSDK { const body$ = null; const pathParams$ = { - instanceID: enc$.encodeSimple("instanceID", payload$.instanceID, { + instanceID: encodeSimple$("instanceID", payload$.instanceID, { explode: false, charEncoding: "percent", }), @@ -1544,7 +1536,7 @@ export class Orchestration extends ClientSDK { "Input validation failed" ); const body$ = - payload$ === undefined ? null : enc$.encodeJSON("body", payload$, { explode: true }); + payload$ === undefined ? null : encodeJSON$("body", payload$, { explode: true }); const path$ = this.templateURLComponent("/api/orchestration/v2/triggers")(); @@ -1618,7 +1610,7 @@ export class Orchestration extends ClientSDK { "Input validation failed" ); const body$ = - payload$ === undefined ? null : enc$.encodeJSON("body", payload$, { explode: true }); + payload$ === undefined ? null : encodeJSON$("body", payload$, { explode: true }); const path$ = this.templateURLComponent("/api/orchestration/v2/workflows")(); @@ -1693,7 +1685,7 @@ export class Orchestration extends ClientSDK { const body$ = null; const pathParams$ = { - triggerID: enc$.encodeSimple("triggerID", payload$.triggerID, { + triggerID: encodeSimple$("triggerID", payload$.triggerID, { explode: false, charEncoding: "percent", }), @@ -1773,7 +1765,7 @@ export class Orchestration extends ClientSDK { const body$ = null; const pathParams$ = { - flowId: enc$.encodeSimple("flowId", payload$.flowId, { + flowId: encodeSimple$("flowId", payload$.flowId, { explode: false, charEncoding: "percent", }), @@ -1853,7 +1845,7 @@ export class Orchestration extends ClientSDK { const body$ = null; const pathParams$ = { - instanceID: enc$.encodeSimple("instanceID", payload$.instanceID, { + instanceID: encodeSimple$("instanceID", payload$.instanceID, { explode: false, charEncoding: "percent", }), @@ -1933,7 +1925,7 @@ export class Orchestration extends ClientSDK { const body$ = null; const pathParams$ = { - instanceID: enc$.encodeSimple("instanceID", payload$.instanceID, { + instanceID: encodeSimple$("instanceID", payload$.instanceID, { explode: false, charEncoding: "percent", }), @@ -2015,11 +2007,11 @@ export class Orchestration extends ClientSDK { const body$ = null; const pathParams$ = { - instanceID: enc$.encodeSimple("instanceID", payload$.instanceID, { + instanceID: encodeSimple$("instanceID", payload$.instanceID, { explode: false, charEncoding: "percent", }), - number: enc$.encodeSimple("number", payload$.number, { + number: encodeSimple$("number", payload$.number, { explode: false, charEncoding: "percent", }), @@ -2158,7 +2150,7 @@ export class Orchestration extends ClientSDK { const body$ = null; const pathParams$ = { - flowId: enc$.encodeSimple("flowId", payload$.flowId, { + flowId: encodeSimple$("flowId", payload$.flowId, { explode: false, charEncoding: "percent", }), @@ -2239,23 +2231,12 @@ export class Orchestration extends ClientSDK { const path$ = this.templateURLComponent("/api/orchestration/v2/instances")(); - const query$ = [ - enc$.encodeForm("cursor", payload$.cursor, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("pageSize", payload$.pageSize, { - explode: true, - charEncoding: "percent", - }), - enc$.encodeForm("running", payload$.running, { - explode: true, - charEncoding: "percent", - }), - enc$.encodeForm("workflowID", payload$.workflowID, { - explode: true, - charEncoding: "percent", - }), - ] - .filter(Boolean) - .join("&"); + const query$ = encodeFormQuery$({ + cursor: payload$.cursor, + pageSize: payload$.pageSize, + running: payload$.running, + workflowID: payload$.workflowID, + }); let security$; if (typeof this.options$.authorization === "function") { @@ -2327,16 +2308,11 @@ export class Orchestration extends ClientSDK { const path$ = this.templateURLComponent("/api/orchestration/v2/triggers")(); - const query$ = [ - enc$.encodeForm("cursor", payload$.cursor, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("name", payload$.name, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("pageSize", payload$.pageSize, { - explode: true, - charEncoding: "percent", - }), - ] - .filter(Boolean) - .join("&"); + const query$ = encodeFormQuery$({ + name: payload$.name, + pageSize: payload$.pageSize, + cursor: payload$.cursor, + }); let security$; if (typeof this.options$.authorization === "function") { @@ -2407,7 +2383,7 @@ export class Orchestration extends ClientSDK { const body$ = null; const pathParams$ = { - triggerID: enc$.encodeSimple("triggerID", payload$.triggerID, { + triggerID: encodeSimple$("triggerID", payload$.triggerID, { explode: false, charEncoding: "percent", }), @@ -2416,15 +2392,10 @@ export class Orchestration extends ClientSDK { "/api/orchestration/v2/triggers/{triggerID}/occurrences" )(pathParams$); - const query$ = [ - enc$.encodeForm("cursor", payload$.cursor, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("pageSize", payload$.pageSize, { - explode: true, - charEncoding: "percent", - }), - ] - .filter(Boolean) - .join("&"); + const query$ = encodeFormQuery$({ + pageSize: payload$.pageSize, + cursor: payload$.cursor, + }); let security$; if (typeof this.options$.authorization === "function") { @@ -2498,15 +2469,10 @@ export class Orchestration extends ClientSDK { const path$ = this.templateURLComponent("/api/orchestration/v2/workflows")(); - const query$ = [ - enc$.encodeForm("cursor", payload$.cursor, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("pageSize", payload$.pageSize, { - explode: true, - charEncoding: "percent", - }), - ] - .filter(Boolean) - .join("&"); + const query$ = encodeFormQuery$({ + cursor: payload$.cursor, + pageSize: payload$.pageSize, + }); let security$; if (typeof this.options$.authorization === "function") { @@ -2577,7 +2543,7 @@ export class Orchestration extends ClientSDK { const body$ = null; const pathParams$ = { - triggerID: enc$.encodeSimple("triggerID", payload$.triggerID, { + triggerID: encodeSimple$("triggerID", payload$.triggerID, { explode: false, charEncoding: "percent", }), @@ -2655,10 +2621,10 @@ export class Orchestration extends ClientSDK { (value$) => operations.V2RunWorkflowRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$.RequestBody, { explode: true }); + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); const pathParams$ = { - workflowID: enc$.encodeSimple("workflowID", payload$.workflowID, { + workflowID: encodeSimple$("workflowID", payload$.workflowID, { explode: false, charEncoding: "percent", }), @@ -2667,11 +2633,9 @@ export class Orchestration extends ClientSDK { "/api/orchestration/v2/workflows/{workflowID}/instances" )(pathParams$); - const query$ = [ - enc$.encodeForm("wait", payload$.wait, { explode: true, charEncoding: "percent" }), - ] - .filter(Boolean) - .join("&"); + const query$ = encodeFormQuery$({ + wait: payload$.wait, + }); let security$; if (typeof this.options$.authorization === "function") { @@ -2740,10 +2704,10 @@ export class Orchestration extends ClientSDK { (value$) => operations.V2SendEventRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$.RequestBody, { explode: true }); + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); const pathParams$ = { - instanceID: enc$.encodeSimple("instanceID", payload$.instanceID, { + instanceID: encodeSimple$("instanceID", payload$.instanceID, { explode: false, charEncoding: "percent", }), diff --git a/src/sdk/payments.ts b/src/sdk/payments.ts index f7318daf..19d9fa55 100644 --- a/src/sdk/payments.ts +++ b/src/sdk/payments.ts @@ -4,7 +4,11 @@ import { SDKHooks } from "../hooks"; import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config"; -import * as enc$ from "../lib/encodings"; +import { + encodeFormQuery as encodeFormQuery$, + encodeJSON as encodeJSON$, + encodeSimple as encodeSimple$, +} from "../lib/encodings"; import { HTTPClient } from "../lib/http"; import * as schemas$ from "../lib/schemas"; import { ClientSDK, RequestOptions } from "../lib/sdks"; @@ -60,10 +64,10 @@ export class Payments extends ClientSDK { (value$) => operations.AddAccountToPoolRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$.AddAccountToPoolRequest, { explode: true }); + const body$ = encodeJSON$("body", payload$.AddAccountToPoolRequest, { explode: true }); const pathParams$ = { - poolId: enc$.encodeSimple("poolId", payload$.poolId, { + poolId: encodeSimple$("poolId", payload$.poolId, { explode: false, charEncoding: "percent", }), @@ -141,10 +145,10 @@ export class Payments extends ClientSDK { (value$) => operations.ConnectorsTransferRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$.TransferRequest, { explode: true }); + const body$ = encodeJSON$("body", payload$.TransferRequest, { explode: true }); const pathParams$ = { - connector: enc$.encodeSimple("connector", payload$.connector, { + connector: encodeSimple$("connector", payload$.connector, { explode: false, charEncoding: "percent", }), @@ -222,7 +226,7 @@ export class Payments extends ClientSDK { (value$) => shared.AccountRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$, { explode: true }); + const body$ = encodeJSON$("body", payload$, { explode: true }); const path$ = this.templateURLComponent("/api/payments/accounts")(); @@ -295,7 +299,7 @@ export class Payments extends ClientSDK { (value$) => shared.BankAccountRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$, { explode: true }); + const body$ = encodeJSON$("body", payload$, { explode: true }); const path$ = this.templateURLComponent("/api/payments/bank-accounts")(); @@ -368,7 +372,7 @@ export class Payments extends ClientSDK { (value$) => shared.PaymentRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$, { explode: true }); + const body$ = encodeJSON$("body", payload$, { explode: true }); const path$ = this.templateURLComponent("/api/payments/payments")(); @@ -441,7 +445,7 @@ export class Payments extends ClientSDK { (value$) => shared.PoolRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$, { explode: true }); + const body$ = encodeJSON$("body", payload$, { explode: true }); const path$ = this.templateURLComponent("/api/payments/pools")(); @@ -514,7 +518,7 @@ export class Payments extends ClientSDK { (value$) => shared.TransferInitiationRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$, { explode: true }); + const body$ = encodeJSON$("body", payload$, { explode: true }); const path$ = this.templateURLComponent("/api/payments/transfer-initiations")(); @@ -591,7 +595,7 @@ export class Payments extends ClientSDK { const body$ = null; const pathParams$ = { - poolId: enc$.encodeSimple("poolId", payload$.poolId, { + poolId: encodeSimple$("poolId", payload$.poolId, { explode: false, charEncoding: "percent", }), @@ -669,7 +673,7 @@ export class Payments extends ClientSDK { const body$ = null; const pathParams$ = { - transferId: enc$.encodeSimple("transferId", payload$.transferId, { + transferId: encodeSimple$("transferId", payload$.transferId, { explode: false, charEncoding: "percent", }), @@ -744,12 +748,10 @@ export class Payments extends ClientSDK { (value$) => operations.ForwardBankAccountRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$.ForwardBankAccountRequest, { - explode: true, - }); + const body$ = encodeJSON$("body", payload$.ForwardBankAccountRequest, { explode: true }); const pathParams$ = { - bankAccountId: enc$.encodeSimple("bankAccountId", payload$.bankAccountId, { + bankAccountId: encodeSimple$("bankAccountId", payload$.bankAccountId, { explode: false, charEncoding: "percent", }), @@ -826,7 +828,7 @@ export class Payments extends ClientSDK { const body$ = null; const pathParams$ = { - accountId: enc$.encodeSimple("accountId", payload$.accountId, { + accountId: encodeSimple$("accountId", payload$.accountId, { explode: false, charEncoding: "percent", }), @@ -835,20 +837,15 @@ export class Payments extends ClientSDK { pathParams$ ); - const query$ = [ - enc$.encodeForm("asset", payload$.asset, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("cursor", payload$.cursor, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("from", payload$.from, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("limit", payload$.limit, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("pageSize", payload$.pageSize, { - explode: true, - charEncoding: "percent", - }), - enc$.encodeForm("sort", payload$.sort, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("to", payload$.to, { explode: true, charEncoding: "percent" }), - ] - .filter(Boolean) - .join("&"); + const query$ = encodeFormQuery$({ + from: payload$.from, + limit: payload$.limit, + pageSize: payload$.pageSize, + sort: payload$.sort, + to: payload$.to, + asset: payload$.asset, + cursor: payload$.cursor, + }); let security$; if (typeof this.options$.authorization === "function") { @@ -916,7 +913,7 @@ export class Payments extends ClientSDK { const body$ = null; const pathParams$ = { - bankAccountId: enc$.encodeSimple("bankAccountId", payload$.bankAccountId, { + bankAccountId: encodeSimple$("bankAccountId", payload$.bankAccountId, { explode: false, charEncoding: "percent", }), @@ -998,11 +995,11 @@ export class Payments extends ClientSDK { const body$ = null; const pathParams$ = { - connector: enc$.encodeSimple("connector", payload$.connector, { + connector: encodeSimple$("connector", payload$.connector, { explode: false, charEncoding: "percent", }), - taskId: enc$.encodeSimple("taskId", payload$.taskId, { + taskId: encodeSimple$("taskId", payload$.taskId, { explode: false, charEncoding: "percent", }), @@ -1082,15 +1079,15 @@ export class Payments extends ClientSDK { const body$ = null; const pathParams$ = { - connector: enc$.encodeSimple("connector", payload$.connector, { + connector: encodeSimple$("connector", payload$.connector, { explode: false, charEncoding: "percent", }), - connectorId: enc$.encodeSimple("connectorId", payload$.connectorId, { + connectorId: encodeSimple$("connectorId", payload$.connectorId, { explode: false, charEncoding: "percent", }), - taskId: enc$.encodeSimple("taskId", payload$.taskId, { + taskId: encodeSimple$("taskId", payload$.taskId, { explode: false, charEncoding: "percent", }), @@ -1167,7 +1164,7 @@ export class Payments extends ClientSDK { const body$ = null; const pathParams$ = { - paymentId: enc$.encodeSimple("paymentId", payload$.paymentId, { + paymentId: encodeSimple$("paymentId", payload$.paymentId, { explode: false, charEncoding: "percent", }), @@ -1242,7 +1239,7 @@ export class Payments extends ClientSDK { const body$ = null; const pathParams$ = { - poolId: enc$.encodeSimple("poolId", payload$.poolId, { + poolId: encodeSimple$("poolId", payload$.poolId, { explode: false, charEncoding: "percent", }), @@ -1317,7 +1314,7 @@ export class Payments extends ClientSDK { const body$ = null; const pathParams$ = { - poolId: enc$.encodeSimple("poolId", payload$.poolId, { + poolId: encodeSimple$("poolId", payload$.poolId, { explode: false, charEncoding: "percent", }), @@ -1326,11 +1323,9 @@ export class Payments extends ClientSDK { pathParams$ ); - const query$ = [ - enc$.encodeForm("at", payload$.at, { explode: true, charEncoding: "percent" }), - ] - .filter(Boolean) - .join("&"); + const query$ = encodeFormQuery$({ + at: payload$.at, + }); let security$; if (typeof this.options$.authorization === "function") { @@ -1398,7 +1393,7 @@ export class Payments extends ClientSDK { const body$ = null; const pathParams$ = { - transferId: enc$.encodeSimple("transferId", payload$.transferId, { + transferId: encodeSimple$("transferId", payload$.transferId, { explode: false, charEncoding: "percent", }), @@ -1478,10 +1473,10 @@ export class Payments extends ClientSDK { (value$) => operations.InstallConnectorRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$.ConnectorConfig, { explode: true }); + const body$ = encodeJSON$("body", payload$.ConnectorConfig, { explode: true }); const pathParams$ = { - connector: enc$.encodeSimple("connector", payload$.connector, { + connector: encodeSimple$("connector", payload$.connector, { explode: false, charEncoding: "percent", }), @@ -1624,16 +1619,11 @@ export class Payments extends ClientSDK { const path$ = this.templateURLComponent("/api/payments/bank-accounts")(); - const query$ = [ - enc$.encodeForm("cursor", payload$.cursor, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("pageSize", payload$.pageSize, { - explode: true, - charEncoding: "percent", - }), - enc$.encodeForm("sort", payload$.sort, { explode: true, charEncoding: "percent" }), - ] - .filter(Boolean) - .join("&"); + const query$ = encodeFormQuery$({ + sort: payload$.sort, + cursor: payload$.cursor, + pageSize: payload$.pageSize, + }); let security$; if (typeof this.options$.authorization === "function") { @@ -1770,7 +1760,7 @@ export class Payments extends ClientSDK { const body$ = null; const pathParams$ = { - connector: enc$.encodeSimple("connector", payload$.connector, { + connector: encodeSimple$("connector", payload$.connector, { explode: false, charEncoding: "percent", }), @@ -1779,15 +1769,10 @@ export class Payments extends ClientSDK { pathParams$ ); - const query$ = [ - enc$.encodeForm("cursor", payload$.cursor, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("pageSize", payload$.pageSize, { - explode: true, - charEncoding: "percent", - }), - ] - .filter(Boolean) - .join("&"); + const query$ = encodeFormQuery$({ + cursor: payload$.cursor, + pageSize: payload$.pageSize, + }); let security$; if (typeof this.options$.authorization === "function") { @@ -1858,11 +1843,11 @@ export class Payments extends ClientSDK { const body$ = null; const pathParams$ = { - connector: enc$.encodeSimple("connector", payload$.connector, { + connector: encodeSimple$("connector", payload$.connector, { explode: false, charEncoding: "percent", }), - connectorId: enc$.encodeSimple("connectorId", payload$.connectorId, { + connectorId: encodeSimple$("connectorId", payload$.connectorId, { explode: false, charEncoding: "percent", }), @@ -1871,15 +1856,10 @@ export class Payments extends ClientSDK { "/api/payments/connectors/{connector}/{connectorId}/tasks" )(pathParams$); - const query$ = [ - enc$.encodeForm("cursor", payload$.cursor, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("pageSize", payload$.pageSize, { - explode: true, - charEncoding: "percent", - }), - ] - .filter(Boolean) - .join("&"); + const query$ = encodeFormQuery$({ + cursor: payload$.cursor, + pageSize: payload$.pageSize, + }); let security$; if (typeof this.options$.authorization === "function") { @@ -1948,17 +1928,12 @@ export class Payments extends ClientSDK { const path$ = this.templateURLComponent("/api/payments/payments")(); - const query$ = [ - enc$.encodeForm("cursor", payload$.cursor, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("pageSize", payload$.pageSize, { - explode: true, - charEncoding: "percent", - }), - enc$.encodeForm("query", payload$.query, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("sort", payload$.sort, { explode: true, charEncoding: "percent" }), - ] - .filter(Boolean) - .join("&"); + const query$ = encodeFormQuery$({ + pageSize: payload$.pageSize, + query: payload$.query, + sort: payload$.sort, + cursor: payload$.cursor, + }); let security$; if (typeof this.options$.authorization === "function") { @@ -2027,17 +2002,12 @@ export class Payments extends ClientSDK { const path$ = this.templateURLComponent("/api/payments/pools")(); - const query$ = [ - enc$.encodeForm("cursor", payload$.cursor, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("pageSize", payload$.pageSize, { - explode: true, - charEncoding: "percent", - }), - enc$.encodeForm("query", payload$.query, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("sort", payload$.sort, { explode: true, charEncoding: "percent" }), - ] - .filter(Boolean) - .join("&"); + const query$ = encodeFormQuery$({ + query: payload$.query, + sort: payload$.sort, + cursor: payload$.cursor, + pageSize: payload$.pageSize, + }); let security$; if (typeof this.options$.authorization === "function") { @@ -2106,17 +2076,12 @@ export class Payments extends ClientSDK { const path$ = this.templateURLComponent("/api/payments/transfer-initiations")(); - const query$ = [ - enc$.encodeForm("cursor", payload$.cursor, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("pageSize", payload$.pageSize, { - explode: true, - charEncoding: "percent", - }), - enc$.encodeForm("query", payload$.query, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("sort", payload$.sort, { explode: true, charEncoding: "percent" }), - ] - .filter(Boolean) - .join("&"); + const query$ = encodeFormQuery$({ + cursor: payload$.cursor, + pageSize: payload$.pageSize, + query: payload$.query, + sort: payload$.sort, + }); let security$; if (typeof this.options$.authorization === "function") { @@ -2186,7 +2151,7 @@ export class Payments extends ClientSDK { const body$ = null; const pathParams$ = { - accountId: enc$.encodeSimple("accountId", payload$.accountId, { + accountId: encodeSimple$("accountId", payload$.accountId, { explode: false, charEncoding: "percent", }), @@ -2321,17 +2286,12 @@ export class Payments extends ClientSDK { const path$ = this.templateURLComponent("/api/payments/accounts")(); - const query$ = [ - enc$.encodeForm("cursor", payload$.cursor, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("pageSize", payload$.pageSize, { - explode: true, - charEncoding: "percent", - }), - enc$.encodeForm("query", payload$.query, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("sort", payload$.sort, { explode: true, charEncoding: "percent" }), - ] - .filter(Boolean) - .join("&"); + const query$ = encodeFormQuery$({ + cursor: payload$.cursor, + pageSize: payload$.pageSize, + query: payload$.query, + sort: payload$.sort, + }); let security$; if (typeof this.options$.authorization === "function") { @@ -2404,7 +2364,7 @@ export class Payments extends ClientSDK { const body$ = null; const pathParams$ = { - connector: enc$.encodeSimple("connector", payload$.connector, { + connector: encodeSimple$("connector", payload$.connector, { explode: false, charEncoding: "percent", }), @@ -2484,11 +2444,11 @@ export class Payments extends ClientSDK { const body$ = null; const pathParams$ = { - connector: enc$.encodeSimple("connector", payload$.connector, { + connector: encodeSimple$("connector", payload$.connector, { explode: false, charEncoding: "percent", }), - connectorId: enc$.encodeSimple("connectorId", payload$.connectorId, { + connectorId: encodeSimple$("connectorId", payload$.connectorId, { explode: false, charEncoding: "percent", }), @@ -2570,11 +2530,11 @@ export class Payments extends ClientSDK { const body$ = null; const pathParams$ = { - accountId: enc$.encodeSimple("accountId", payload$.accountId, { + accountId: encodeSimple$("accountId", payload$.accountId, { explode: false, charEncoding: "percent", }), - poolId: enc$.encodeSimple("poolId", payload$.poolId, { + poolId: encodeSimple$("poolId", payload$.poolId, { explode: false, charEncoding: "percent", }), @@ -2658,7 +2618,7 @@ export class Payments extends ClientSDK { const body$ = null; const pathParams$ = { - connector: enc$.encodeSimple("connector", payload$.connector, { + connector: encodeSimple$("connector", payload$.connector, { explode: false, charEncoding: "percent", }), @@ -2740,11 +2700,11 @@ export class Payments extends ClientSDK { const body$ = null; const pathParams$ = { - connector: enc$.encodeSimple("connector", payload$.connector, { + connector: encodeSimple$("connector", payload$.connector, { explode: false, charEncoding: "percent", }), - connectorId: enc$.encodeSimple("connectorId", payload$.connectorId, { + connectorId: encodeSimple$("connectorId", payload$.connectorId, { explode: false, charEncoding: "percent", }), @@ -2824,7 +2784,7 @@ export class Payments extends ClientSDK { const body$ = null; const pathParams$ = { - transferId: enc$.encodeSimple("transferId", payload$.transferId, { + transferId: encodeSimple$("transferId", payload$.transferId, { explode: false, charEncoding: "percent", }), @@ -2902,12 +2862,12 @@ export class Payments extends ClientSDK { (value$) => operations.ReverseTransferInitiationRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$.ReverseTransferInitiationRequest, { + const body$ = encodeJSON$("body", payload$.ReverseTransferInitiationRequest, { explode: true, }); const pathParams$ = { - transferId: enc$.encodeSimple("transferId", payload$.transferId, { + transferId: encodeSimple$("transferId", payload$.transferId, { explode: false, charEncoding: "percent", }), @@ -2986,12 +2946,12 @@ export class Payments extends ClientSDK { operations.UdpateTransferInitiationStatusRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$.UpdateTransferInitiationStatusRequest, { + const body$ = encodeJSON$("body", payload$.UpdateTransferInitiationStatusRequest, { explode: true, }); const pathParams$ = { - transferId: enc$.encodeSimple("transferId", payload$.transferId, { + transferId: encodeSimple$("transferId", payload$.transferId, { explode: false, charEncoding: "percent", }), @@ -3073,7 +3033,7 @@ export class Payments extends ClientSDK { const body$ = null; const pathParams$ = { - connector: enc$.encodeSimple("connector", payload$.connector, { + connector: encodeSimple$("connector", payload$.connector, { explode: false, charEncoding: "percent", }), @@ -3153,11 +3113,11 @@ export class Payments extends ClientSDK { const body$ = null; const pathParams$ = { - connector: enc$.encodeSimple("connector", payload$.connector, { + connector: encodeSimple$("connector", payload$.connector, { explode: false, charEncoding: "percent", }), - connectorId: enc$.encodeSimple("connectorId", payload$.connectorId, { + connectorId: encodeSimple$("connectorId", payload$.connectorId, { explode: false, charEncoding: "percent", }), @@ -3232,12 +3192,12 @@ export class Payments extends ClientSDK { (value$) => operations.UpdateBankAccountMetadataRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$.UpdateBankAccountMetadataRequest, { + const body$ = encodeJSON$("body", payload$.UpdateBankAccountMetadataRequest, { explode: true, }); const pathParams$ = { - bankAccountId: enc$.encodeSimple("bankAccountId", payload$.bankAccountId, { + bankAccountId: encodeSimple$("bankAccountId", payload$.bankAccountId, { explode: false, charEncoding: "percent", }), @@ -3315,14 +3275,14 @@ export class Payments extends ClientSDK { (value$) => operations.UpdateConnectorConfigV1Request$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$.ConnectorConfig, { explode: true }); + const body$ = encodeJSON$("body", payload$.ConnectorConfig, { explode: true }); const pathParams$ = { - connector: enc$.encodeSimple("connector", payload$.connector, { + connector: encodeSimple$("connector", payload$.connector, { explode: false, charEncoding: "percent", }), - connectorId: enc$.encodeSimple("connectorId", payload$.connectorId, { + connectorId: encodeSimple$("connectorId", payload$.connectorId, { explode: false, charEncoding: "percent", }), @@ -3397,10 +3357,10 @@ export class Payments extends ClientSDK { (value$) => operations.UpdateMetadataRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$.RequestBody, { explode: true }); + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); const pathParams$ = { - paymentId: enc$.encodeSimple("paymentId", payload$.paymentId, { + paymentId: encodeSimple$("paymentId", payload$.paymentId, { explode: false, charEncoding: "percent", }), diff --git a/src/sdk/reconciliation.ts b/src/sdk/reconciliation.ts index 380a9305..135fc9f3 100644 --- a/src/sdk/reconciliation.ts +++ b/src/sdk/reconciliation.ts @@ -4,7 +4,11 @@ import { SDKHooks } from "../hooks"; import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config"; -import * as enc$ from "../lib/encodings"; +import { + encodeFormQuery as encodeFormQuery$, + encodeJSON as encodeJSON$, + encodeSimple as encodeSimple$, +} from "../lib/encodings"; import { HTTPClient } from "../lib/http"; import * as schemas$ from "../lib/schemas"; import { ClientSDK, RequestOptions } from "../lib/sdks"; @@ -60,7 +64,7 @@ export class Reconciliation extends ClientSDK { (value$) => shared.PolicyRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$, { explode: true }); + const body$ = encodeJSON$("body", payload$, { explode: true }); const path$ = this.templateURLComponent("/api/reconciliation/policies")(); @@ -135,7 +139,7 @@ export class Reconciliation extends ClientSDK { const body$ = null; const pathParams$ = { - policyID: enc$.encodeSimple("policyID", payload$.policyID, { + policyID: encodeSimple$("policyID", payload$.policyID, { explode: false, charEncoding: "percent", }), @@ -212,7 +216,7 @@ export class Reconciliation extends ClientSDK { const body$ = null; const pathParams$ = { - policyID: enc$.encodeSimple("policyID", payload$.policyID, { + policyID: encodeSimple$("policyID", payload$.policyID, { explode: false, charEncoding: "percent", }), @@ -289,7 +293,7 @@ export class Reconciliation extends ClientSDK { const body$ = null; const pathParams$ = { - reconciliationID: enc$.encodeSimple("reconciliationID", payload$.reconciliationID, { + reconciliationID: encodeSimple$("reconciliationID", payload$.reconciliationID, { explode: false, charEncoding: "percent", }), @@ -367,15 +371,10 @@ export class Reconciliation extends ClientSDK { const path$ = this.templateURLComponent("/api/reconciliation/policies")(); - const query$ = [ - enc$.encodeForm("cursor", payload$.cursor, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("pageSize", payload$.pageSize, { - explode: true, - charEncoding: "percent", - }), - ] - .filter(Boolean) - .join("&"); + const query$ = encodeFormQuery$({ + cursor: payload$.cursor, + pageSize: payload$.pageSize, + }); let security$; if (typeof this.options$.authorization === "function") { @@ -444,15 +443,10 @@ export class Reconciliation extends ClientSDK { const path$ = this.templateURLComponent("/api/reconciliation/reconciliations")(); - const query$ = [ - enc$.encodeForm("cursor", payload$.cursor, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("pageSize", payload$.pageSize, { - explode: true, - charEncoding: "percent", - }), - ] - .filter(Boolean) - .join("&"); + const query$ = encodeFormQuery$({ + cursor: payload$.cursor, + pageSize: payload$.pageSize, + }); let security$; if (typeof this.options$.authorization === "function") { @@ -523,10 +517,10 @@ export class Reconciliation extends ClientSDK { (value$) => operations.ReconcileRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$.ReconciliationRequest, { explode: true }); + const body$ = encodeJSON$("body", payload$.ReconciliationRequest, { explode: true }); const pathParams$ = { - policyID: enc$.encodeSimple("policyID", payload$.policyID, { + policyID: encodeSimple$("policyID", payload$.policyID, { explode: false, charEncoding: "percent", }), diff --git a/src/sdk/search.ts b/src/sdk/search.ts index 44359ff4..cfeecdeb 100644 --- a/src/sdk/search.ts +++ b/src/sdk/search.ts @@ -4,7 +4,7 @@ import { SDKHooks } from "../hooks"; import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config"; -import * as enc$ from "../lib/encodings"; +import { encodeJSON as encodeJSON$ } from "../lib/encodings"; import { HTTPClient } from "../lib/http"; import * as schemas$ from "../lib/schemas"; import { ClientSDK, RequestOptions } from "../lib/sdks"; @@ -59,7 +59,7 @@ export class Search extends ClientSDK { (value$) => shared.Query$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$, { explode: true }); + const body$ = encodeJSON$("body", payload$, { explode: true }); const path$ = this.templateURLComponent("/api/search/")(); diff --git a/src/sdk/wallets.ts b/src/sdk/wallets.ts index f3bea67c..a2268486 100644 --- a/src/sdk/wallets.ts +++ b/src/sdk/wallets.ts @@ -4,7 +4,13 @@ import { SDKHooks } from "../hooks"; import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config"; -import * as enc$ from "../lib/encodings"; +import { + encodeDeepObjectQuery as encodeDeepObjectQuery$, + encodeFormQuery as encodeFormQuery$, + encodeJSON as encodeJSON$, + encodeSimple as encodeSimple$, + queryJoin as queryJoin$, +} from "../lib/encodings"; import { HTTPClient } from "../lib/http"; import * as schemas$ from "../lib/schemas"; import { ClientSDK, RequestOptions } from "../lib/sdks"; @@ -57,10 +63,10 @@ export class Wallets extends ClientSDK { (value$) => operations.ConfirmHoldRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$.ConfirmHoldRequest, { explode: true }); + const body$ = encodeJSON$("body", payload$.ConfirmHoldRequest, { explode: true }); const pathParams$ = { - hold_id: enc$.encodeSimple("hold_id", payload$.hold_id, { + hold_id: encodeSimple$("hold_id", payload$.hold_id, { explode: false, charEncoding: "percent", }), @@ -135,10 +141,10 @@ export class Wallets extends ClientSDK { (value$) => operations.CreateBalanceRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$.CreateBalanceRequest, { explode: true }); + const body$ = encodeJSON$("body", payload$.CreateBalanceRequest, { explode: true }); const pathParams$ = { - id: enc$.encodeSimple("id", payload$.id, { explode: false, charEncoding: "percent" }), + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), }; const path$ = this.templateURLComponent("/api/wallets/wallets/{id}/balances")(pathParams$); @@ -209,7 +215,7 @@ export class Wallets extends ClientSDK { "Input validation failed" ); const body$ = - payload$ === undefined ? null : enc$.encodeJSON("body", payload$, { explode: true }); + payload$ === undefined ? null : encodeJSON$("body", payload$, { explode: true }); const path$ = this.templateURLComponent("/api/wallets/wallets")(); @@ -279,10 +285,10 @@ export class Wallets extends ClientSDK { (value$) => operations.CreditWalletRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$.CreditWalletRequest, { explode: true }); + const body$ = encodeJSON$("body", payload$.CreditWalletRequest, { explode: true }); const pathParams$ = { - id: enc$.encodeSimple("id", payload$.id, { explode: false, charEncoding: "percent" }), + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), }; const path$ = this.templateURLComponent("/api/wallets/wallets/{id}/credit")(pathParams$); @@ -352,10 +358,10 @@ export class Wallets extends ClientSDK { (value$) => operations.DebitWalletRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$.DebitWalletRequest, { explode: true }); + const body$ = encodeJSON$("body", payload$.DebitWalletRequest, { explode: true }); const pathParams$ = { - id: enc$.encodeSimple("id", payload$.id, { explode: false, charEncoding: "percent" }), + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), }; const path$ = this.templateURLComponent("/api/wallets/wallets/{id}/debit")(pathParams$); @@ -428,11 +434,11 @@ export class Wallets extends ClientSDK { const body$ = null; const pathParams$ = { - balanceName: enc$.encodeSimple("balanceName", payload$.balanceName, { + balanceName: encodeSimple$("balanceName", payload$.balanceName, { explode: false, charEncoding: "percent", }), - id: enc$.encodeSimple("id", payload$.id, { explode: false, charEncoding: "percent" }), + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), }; const path$ = this.templateURLComponent("/api/wallets/wallets/{id}/balances/{balanceName}")( pathParams$ @@ -506,7 +512,7 @@ export class Wallets extends ClientSDK { const body$ = null; const pathParams$ = { - holdID: enc$.encodeSimple("holdID", payload$.holdID, { + holdID: encodeSimple$("holdID", payload$.holdID, { explode: false, charEncoding: "percent", }), @@ -582,20 +588,16 @@ export class Wallets extends ClientSDK { const path$ = this.templateURLComponent("/api/wallets/holds")(); - const query$ = [ - enc$.encodeForm("cursor", payload$.cursor, { explode: true, charEncoding: "percent" }), - enc$.encodeDeepObject("metadata", payload$.metadata, { charEncoding: "percent" }), - enc$.encodeForm("pageSize", payload$.pageSize, { - explode: true, - charEncoding: "percent", - }), - enc$.encodeForm("walletID", payload$.walletID, { - explode: true, - charEncoding: "percent", + const query$ = queryJoin$( + encodeDeepObjectQuery$({ + metadata: payload$.metadata, }), - ] - .filter(Boolean) - .join("&"); + encodeFormQuery$({ + pageSize: payload$.pageSize, + walletID: payload$.walletID, + cursor: payload$.cursor, + }) + ); let security$; if (typeof this.options$.authorization === "function") { @@ -661,19 +663,11 @@ export class Wallets extends ClientSDK { const path$ = this.templateURLComponent("/api/wallets/transactions")(); - const query$ = [ - enc$.encodeForm("cursor", payload$.cursor, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("pageSize", payload$.pageSize, { - explode: true, - charEncoding: "percent", - }), - enc$.encodeForm("walletID", payload$.walletID, { - explode: true, - charEncoding: "percent", - }), - ] - .filter(Boolean) - .join("&"); + const query$ = encodeFormQuery$({ + cursor: payload$.cursor, + pageSize: payload$.pageSize, + walletID: payload$.walletID, + }); let security$; if (typeof this.options$.authorization === "function") { @@ -741,7 +735,7 @@ export class Wallets extends ClientSDK { const body$ = null; const pathParams$ = { - id: enc$.encodeSimple("id", payload$.id, { explode: false, charEncoding: "percent" }), + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), }; const path$ = this.templateURLComponent("/api/wallets/wallets/{id}")(pathParams$); @@ -814,7 +808,7 @@ export class Wallets extends ClientSDK { const body$ = null; const pathParams$ = { - id: enc$.encodeSimple("id", payload$.id, { explode: false, charEncoding: "percent" }), + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), }; const path$ = this.templateURLComponent("/api/wallets/wallets/{id}/summary")(pathParams$); @@ -887,7 +881,7 @@ export class Wallets extends ClientSDK { const body$ = null; const pathParams$ = { - id: enc$.encodeSimple("id", payload$.id, { explode: false, charEncoding: "percent" }), + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), }; const path$ = this.templateURLComponent("/api/wallets/wallets/{id}/balances")(pathParams$); @@ -960,17 +954,16 @@ export class Wallets extends ClientSDK { const path$ = this.templateURLComponent("/api/wallets/wallets")(); - const query$ = [ - enc$.encodeForm("cursor", payload$.cursor, { explode: true, charEncoding: "percent" }), - enc$.encodeDeepObject("metadata", payload$.metadata, { charEncoding: "percent" }), - enc$.encodeForm("name", payload$.name, { explode: true, charEncoding: "percent" }), - enc$.encodeForm("pageSize", payload$.pageSize, { - explode: true, - charEncoding: "percent", + const query$ = queryJoin$( + encodeDeepObjectQuery$({ + metadata: payload$.metadata, }), - ] - .filter(Boolean) - .join("&"); + encodeFormQuery$({ + name: payload$.name, + pageSize: payload$.pageSize, + cursor: payload$.cursor, + }) + ); let security$; if (typeof this.options$.authorization === "function") { @@ -1036,10 +1029,10 @@ export class Wallets extends ClientSDK { (value$) => operations.UpdateWalletRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$.RequestBody, { explode: true }); + const body$ = encodeJSON$("body", payload$.RequestBody, { explode: true }); const pathParams$ = { - id: enc$.encodeSimple("id", payload$.id, { explode: false, charEncoding: "percent" }), + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), }; const path$ = this.templateURLComponent("/api/wallets/wallets/{id}")(pathParams$); @@ -1111,7 +1104,7 @@ export class Wallets extends ClientSDK { const body$ = null; const pathParams$ = { - hold_id: enc$.encodeSimple("hold_id", payload$.hold_id, { + hold_id: encodeSimple$("hold_id", payload$.hold_id, { explode: false, charEncoding: "percent", }), diff --git a/src/sdk/webhooks.ts b/src/sdk/webhooks.ts index 4911702d..53b2b373 100644 --- a/src/sdk/webhooks.ts +++ b/src/sdk/webhooks.ts @@ -4,7 +4,11 @@ import { SDKHooks } from "../hooks"; import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "../lib/config"; -import * as enc$ from "../lib/encodings"; +import { + encodeFormQuery as encodeFormQuery$, + encodeJSON as encodeJSON$, + encodeSimple as encodeSimple$, +} from "../lib/encodings"; import { HTTPClient } from "../lib/http"; import * as schemas$ from "../lib/schemas"; import { ClientSDK, RequestOptions } from "../lib/sdks"; @@ -62,7 +66,7 @@ export class Webhooks extends ClientSDK { const body$ = null; const pathParams$ = { - id: enc$.encodeSimple("id", payload$.id, { explode: false, charEncoding: "percent" }), + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), }; const path$ = this.templateURLComponent("/api/webhooks/configs/{id}/activate")(pathParams$); @@ -139,10 +143,10 @@ export class Webhooks extends ClientSDK { (value$) => operations.ChangeConfigSecretRequest$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$.ConfigChangeSecret, { explode: true }); + const body$ = encodeJSON$("body", payload$.ConfigChangeSecret, { explode: true }); const pathParams$ = { - id: enc$.encodeSimple("id", payload$.id, { explode: false, charEncoding: "percent" }), + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), }; const path$ = this.templateURLComponent("/api/webhooks/configs/{id}/secret/change")( pathParams$ @@ -219,7 +223,7 @@ export class Webhooks extends ClientSDK { const body$ = null; const pathParams$ = { - id: enc$.encodeSimple("id", payload$.id, { explode: false, charEncoding: "percent" }), + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), }; const path$ = this.templateURLComponent("/api/webhooks/configs/{id}/deactivate")( pathParams$ @@ -296,7 +300,7 @@ export class Webhooks extends ClientSDK { const body$ = null; const pathParams$ = { - id: enc$.encodeSimple("id", payload$.id, { explode: false, charEncoding: "percent" }), + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), }; const path$ = this.templateURLComponent("/api/webhooks/configs/{id}")(pathParams$); @@ -372,15 +376,10 @@ export class Webhooks extends ClientSDK { const path$ = this.templateURLComponent("/api/webhooks/configs")(); - const query$ = [ - enc$.encodeForm("endpoint", payload$.endpoint, { - explode: true, - charEncoding: "percent", - }), - enc$.encodeForm("id", payload$.id, { explode: true, charEncoding: "percent" }), - ] - .filter(Boolean) - .join("&"); + const query$ = encodeFormQuery$({ + endpoint: payload$.endpoint, + id: payload$.id, + }); let security$; if (typeof this.options$.authorization === "function") { @@ -458,7 +457,7 @@ export class Webhooks extends ClientSDK { (value$) => shared.ConfigUser$.outboundSchema.parse(value$), "Input validation failed" ); - const body$ = enc$.encodeJSON("body", payload$, { explode: true }); + const body$ = encodeJSON$("body", payload$, { explode: true }); const path$ = this.templateURLComponent("/api/webhooks/configs")(); @@ -533,7 +532,7 @@ export class Webhooks extends ClientSDK { const body$ = null; const pathParams$ = { - id: enc$.encodeSimple("id", payload$.id, { explode: false, charEncoding: "percent" }), + id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }), }; const path$ = this.templateURLComponent("/api/webhooks/configs/{id}/test")(pathParams$);