diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 44ff882..fce44e3 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: f28179cc-ef59-426d-9e85-60cec22fc642 management: - docChecksum: 58f984453d09b11200ae524bf6ab56d2 + docChecksum: 51863c384b062f0d4c1dd02e14254615 docVersion: 0.0.1 - speakeasyVersion: 1.299.1 - generationVersion: 2.338.5 - releaseVersion: 0.29.12 - configChecksum: a22618851e75846b6e022571d2dfa96c + speakeasyVersion: 1.299.4 + generationVersion: 2.338.7 + releaseVersion: 0.29.13 + configChecksum: f29df458bc70edf5911d8ec36c741de5 repoURL: https://github.com/dubinc/dub-node.git installationURL: https://github.com/dubinc/dub-node published: true @@ -279,11 +279,14 @@ generatedFiles: - docs/models/operations/transferdomainglobals.md - docs/models/operations/transferdomainrequestbody.md - docs/models/operations/transferdomainrequest.md + - docs/models/operations/trackleadglobals.md - docs/models/operations/trackleadrequestbody.md - docs/models/operations/trackleadresponsebody.md + - docs/models/operations/tracksaleglobals.md - docs/models/operations/paymentprocessor.md - docs/models/operations/tracksalerequestbody.md - docs/models/operations/tracksaleresponsebody.md + - docs/models/operations/trackcustomerglobals.md - docs/models/operations/trackcustomerrequestbody.md - docs/models/operations/trackcustomerresponsebody.md - docs/models/operations/getmetatagsrequest.md diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 8603ffa..d6a75bd 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -12,7 +12,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: false typescript: - version: 0.29.12 + version: 0.29.13 additionalDependencies: dependencies: {} devDependencies: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index df2300e..754c529 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.299.1 +speakeasyVersion: 1.299.4 sources: my-first-source: sourceNamespace: my-first-source - sourceRevisionDigest: sha256:094ba510458650e8b32d7a4a655e53e4c7b531c25b6e070882ee5b187504ac42 - sourceBlobDigest: sha256:11824f29a9b18d3141c8f88c15769c49f56b187d8844549d8f6070550a0d2c76 + sourceRevisionDigest: sha256:bb4192687fd363eff689a81497aa7519f010f8f3def49cabb20ce1a8bce61fa2 + sourceBlobDigest: sha256:e9c849908d21e7d4406be80d292b20a9c0af00a329a6543539e566d41b7cbedf tags: - latest - main @@ -11,8 +11,8 @@ targets: my-first-target: source: my-first-source sourceNamespace: my-first-source - sourceRevisionDigest: sha256:094ba510458650e8b32d7a4a655e53e4c7b531c25b6e070882ee5b187504ac42 - sourceBlobDigest: sha256:11824f29a9b18d3141c8f88c15769c49f56b187d8844549d8f6070550a0d2c76 + sourceRevisionDigest: sha256:bb4192687fd363eff689a81497aa7519f010f8f3def49cabb20ce1a8bce61fa2 + sourceBlobDigest: sha256:e9c849908d21e7d4406be80d292b20a9c0af00a329a6543539e566d41b7cbedf outLocation: /github/workspace/repo workflow: workflowVersion: 1.0.0 diff --git a/RELEASES.md b/RELEASES.md index 26409bb..861f662 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -386,4 +386,14 @@ Based on: ### Generated - [typescript v0.29.12] . ### Releases -- [NPM v0.29.12] https://www.npmjs.com/package/dub/v/0.29.12 - . \ No newline at end of file +- [NPM v0.29.12] https://www.npmjs.com/package/dub/v/0.29.12 - . + +## 2024-05-31 15:32:42 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.299.4 (2.338.7) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v0.29.13] . +### Releases +- [NPM v0.29.13] https://www.npmjs.com/package/dub/v/0.29.13 - . \ No newline at end of file diff --git a/codeSamples.yaml b/codeSamples.yaml index a66da51..85812db 100644 --- a/codeSamples.yaml +++ b/codeSamples.yaml @@ -3,11 +3,11 @@ info: title: CodeSamples overlay for typescript target version: 0.0.0 actions: - - target: $["paths"]["/workspaces"]["get"] + - target: $["paths"]["/links/count"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "getWorkspaces" + "label": "getLinksCount" "source": |- import { Dub } from "dub"; @@ -17,18 +17,18 @@ actions: }); async function run() { - const result = await dub.workspaces.list(); + const result = await dub.links.count({}); // Handle the result console.log(result) } run(); - - target: $["paths"]["/domains/{slug}"]["delete"] + - target: $["paths"]["/links/{linkId}"]["delete"] update: "x-codeSamples": - "lang": "typescript" - "label": "deleteDomain" + "label": "deleteLink" "source": |- import { Dub } from "dub"; @@ -38,18 +38,18 @@ actions: }); async function run() { - const result = await dub.domains.delete("acme.com"); + const result = await dub.links.delete(""); // Handle the result console.log(result) } run(); - - target: $["paths"]["/links"]["get"] + - target: $["paths"]["/links/bulk"]["post"] update: "x-codeSamples": - "lang": "typescript" - "label": "getLinks" + "label": "bulkCreateLinks" "source": |- import { Dub } from "dub"; @@ -59,7 +59,78 @@ actions: }); async function run() { - const result = await dub.links.list({}); + const result = await dub.links.createMany([ + { + url: "https://google/com", + }, + ]); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/domains/{slug}/primary"]["post"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "setPrimaryDomain" + "source": |- + import { Dub } from "dub"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.domains.setPrimary("acme.com"); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/track/customer"]["post"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "trackCustomer" + "source": |- + import { Dub } from "dub"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.track.customer({ + customerId: "", + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/links/upsert"]["put"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "upsertLink" + "source": |- + import { Dub } from "dub"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.links.upsert({ + url: "https://google/com", + }); // Handle the result console.log(result) @@ -88,6 +159,160 @@ actions: console.log(result) } + run(); + - target: $["paths"]["/analytics"]["get"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "retrieveAnalytics" + "source": |- + import { Dub } from "dub"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.analytics.retrieve({}); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/workspaces"]["get"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "getWorkspaces" + "source": |- + import { Dub } from "dub"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.workspaces.list(); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/tags"]["get"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "getTags" + "source": |- + import { Dub } from "dub"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.tags.list({}); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/domains/{slug}"]["patch"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "updateDomain" + "source": |- + import { Dub } from "dub"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.domains.update("acme.com", {}); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/track/sale"]["post"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "trackSale" + "source": |- + import { Dub } from "dub"; + import { PaymentProcessor } from "dub/models/operations"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.track.sale({ + customerId: "", + amount: 996500, + paymentProcessor: PaymentProcessor.Shopify, + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/links"]["post"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "createLink" + "source": |- + import { Dub } from "dub"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.links.create({ + url: "https://google/com", + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/links/info"]["get"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "getLinkInfo" + "source": |- + import { Dub } from "dub"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.links.get({}); + + // Handle the result + console.log(result) + } + run(); - target: $["paths"]["/links/{linkId}"]["patch"] update: @@ -112,11 +337,11 @@ actions: } run(); - - target: $["paths"]["/analytics"]["get"] + - target: $["paths"]["/tags"]["post"] update: "x-codeSamples": - "lang": "typescript" - "label": "retrieveAnalytics" + "label": "createTag" "source": |- import { Dub } from "dub"; @@ -126,7 +351,74 @@ actions: }); async function run() { - const result = await dub.analytics.retrieve({}); + const result = await dub.tags.create({ + tag: "", + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/domains"]["get"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "listDomains" + "source": |- + import { Dub } from "dub"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.domains.list({}); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/domains/{slug}/transfer"]["post"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "transferDomain" + "source": |- + import { Dub } from "dub"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.domains.transfer("acme.com", { + newWorkspaceId: "", + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/links"]["get"] + update: + "x-codeSamples": + - "lang": "typescript" + "label": "getLinks" + "source": |- + import { Dub } from "dub"; + + const dub = new Dub({ + token: "DUB_API_KEY", + workspaceId: "", + }); + + async function run() { + const result = await dub.links.list({}); // Handle the result console.log(result) @@ -180,11 +472,11 @@ actions: } run(); - - target: $["paths"]["/domains"]["get"] + - target: $["paths"]["/domains"]["post"] update: "x-codeSamples": - "lang": "typescript" - "label": "listDomains" + "label": "addDomain" "source": |- import { Dub } from "dub"; @@ -194,92 +486,8 @@ actions: }); async function run() { - const result = await dub.domains.list({}); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/domains/{slug}"]["patch"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "updateDomain" - "source": |- - import { Dub } from "dub"; - - const dub = new Dub({ - token: "DUB_API_KEY", - workspaceId: "", - }); - - async function run() { - const result = await dub.domains.update("acme.com", {}); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/links/count"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "getLinksCount" - "source": |- - import { Dub } from "dub"; - - const dub = new Dub({ - token: "DUB_API_KEY", - workspaceId: "", - }); - - async function run() { - const result = await dub.links.count({}); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/links/{linkId}"]["delete"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "deleteLink" - "source": |- - import { Dub } from "dub"; - - const dub = new Dub({ - token: "DUB_API_KEY", - workspaceId: "", - }); - - async function run() { - const result = await dub.links.delete(""); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/track/customer"]["post"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "trackCustomer" - "source": |- - import { Dub } from "dub"; - - const dub = new Dub({ - token: "DUB_API_KEY", - workspaceId: "", - }); - - async function run() { - const result = await dub.track.customer({ - customerId: "", + const result = await dub.domains.add({ + slug: "acme.com", }); // Handle the result @@ -287,11 +495,11 @@ actions: } run(); - - target: $["paths"]["/metatags"]["get"] + - target: $["paths"]["/domains/{slug}"]["delete"] update: "x-codeSamples": - "lang": "typescript" - "label": "getMetatags" + "label": "deleteDomain" "source": |- import { Dub } from "dub"; @@ -301,32 +509,7 @@ actions: }); async function run() { - const result = await dub.metatags.get({ - url: "https://dub.co", - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/domains/{slug}/transfer"]["post"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "transferDomain" - "source": |- - import { Dub } from "dub"; - - const dub = new Dub({ - token: "DUB_API_KEY", - workspaceId: "", - }); - - async function run() { - const result = await dub.domains.transfer("acme.com", { - newWorkspaceId: "", - }); + const result = await dub.domains.delete("acme.com"); // Handle the result console.log(result) @@ -358,11 +541,11 @@ actions: } run(); - - target: $["paths"]["/domains"]["post"] + - target: $["paths"]["/metatags"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "addDomain" + "label": "getMetatags" "source": |- import { Dub } from "dub"; @@ -372,191 +555,8 @@ actions: }); async function run() { - const result = await dub.domains.add({ - slug: "acme.com", - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/domains/{slug}/primary"]["post"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "setPrimaryDomain" - "source": |- - import { Dub } from "dub"; - - const dub = new Dub({ - token: "DUB_API_KEY", - workspaceId: "", - }); - - async function run() { - const result = await dub.domains.setPrimary("acme.com"); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/track/sale"]["post"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "trackSale" - "source": |- - import { Dub } from "dub"; - import { PaymentProcessor } from "dub/models/operations"; - - const dub = new Dub({ - token: "DUB_API_KEY", - workspaceId: "", - }); - - async function run() { - const result = await dub.track.sale({ - customerId: "", - amount: 996500, - paymentProcessor: PaymentProcessor.Shopify, - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/links/info"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "getLinkInfo" - "source": |- - import { Dub } from "dub"; - - const dub = new Dub({ - token: "DUB_API_KEY", - workspaceId: "", - }); - - async function run() { - const result = await dub.links.get({}); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/links/bulk"]["post"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "bulkCreateLinks" - "source": |- - import { Dub } from "dub"; - - const dub = new Dub({ - token: "DUB_API_KEY", - workspaceId: "", - }); - - async function run() { - const result = await dub.links.createMany([ - { - url: "https://google/com", - }, - ]); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/tags"]["get"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "getTags" - "source": |- - import { Dub } from "dub"; - - const dub = new Dub({ - token: "DUB_API_KEY", - workspaceId: "", - }); - - async function run() { - const result = await dub.tags.list({}); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/tags"]["post"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "createTag" - "source": |- - import { Dub } from "dub"; - - const dub = new Dub({ - token: "DUB_API_KEY", - workspaceId: "", - }); - - async function run() { - const result = await dub.tags.create({ - tag: "", - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/links"]["post"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "createLink" - "source": |- - import { Dub } from "dub"; - - const dub = new Dub({ - token: "DUB_API_KEY", - workspaceId: "", - }); - - async function run() { - const result = await dub.links.create({ - url: "https://google/com", - }); - - // Handle the result - console.log(result) - } - - run(); - - target: $["paths"]["/links/upsert"]["put"] - update: - "x-codeSamples": - - "lang": "typescript" - "label": "upsertLink" - "source": |- - import { Dub } from "dub"; - - const dub = new Dub({ - token: "DUB_API_KEY", - workspaceId: "", - }); - - async function run() { - const result = await dub.links.upsert({ - url: "https://google/com", + const result = await dub.metatags.get({ + url: "https://dub.co", }); // Handle the result diff --git a/docs/models/operations/trackcustomerglobals.md b/docs/models/operations/trackcustomerglobals.md new file mode 100644 index 0000000..753e332 --- /dev/null +++ b/docs/models/operations/trackcustomerglobals.md @@ -0,0 +1,9 @@ +# TrackCustomerGlobals + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `workspaceId` | *string* | :heavy_check_mark: | N/A | +| ~~`projectSlug`~~ | *string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | \ No newline at end of file diff --git a/docs/models/operations/trackleadglobals.md b/docs/models/operations/trackleadglobals.md new file mode 100644 index 0000000..99dd170 --- /dev/null +++ b/docs/models/operations/trackleadglobals.md @@ -0,0 +1,9 @@ +# TrackLeadGlobals + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `workspaceId` | *string* | :heavy_check_mark: | N/A | +| ~~`projectSlug`~~ | *string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | \ No newline at end of file diff --git a/docs/models/operations/tracksaleglobals.md b/docs/models/operations/tracksaleglobals.md new file mode 100644 index 0000000..c3cc2f1 --- /dev/null +++ b/docs/models/operations/tracksaleglobals.md @@ -0,0 +1,9 @@ +# TrackSaleGlobals + + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- | +| `workspaceId` | *string* | :heavy_check_mark: | N/A | +| ~~`projectSlug`~~ | *string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible. | \ No newline at end of file diff --git a/jsr.json b/jsr.json index 1048811..0369191 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "dub", - "version": "0.29.12", + "version": "0.29.13", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index 2d3c63b..237b160 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "dub", - "version": "0.29.12", + "version": "0.29.13", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "dub", - "version": "0.29.12", + "version": "0.29.13", "devDependencies": { "@types/jsonpath": "^0.2.4", "@types/node": "^20.12.7", diff --git a/package.json b/package.json index 0305bd4..8da945a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dub", - "version": "0.29.12", + "version": "0.29.13", "author": "Dub", "main": "./index.js", "sideEffects": false, diff --git a/src/lib/config.ts b/src/lib/config.ts index 8715744..0516bfc 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -64,7 +64,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "0.0.1", - sdkVersion: "0.29.12", - genVersion: "2.338.5", - userAgent: "speakeasy-sdk/typescript 0.29.12 2.338.5 0.0.1 dub", + sdkVersion: "0.29.13", + genVersion: "2.338.7", + userAgent: "speakeasy-sdk/typescript 0.29.13 2.338.7 0.0.1 dub", } as const; diff --git a/src/models/operations/trackcustomer.ts b/src/models/operations/trackcustomer.ts index 151a230..6841a13 100644 --- a/src/models/operations/trackcustomer.ts +++ b/src/models/operations/trackcustomer.ts @@ -4,6 +4,14 @@ import * as z from "zod"; +export type TrackCustomerGlobals = { + workspaceId: string; + /** + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + projectSlug?: string | undefined; +}; + export type TrackCustomerRequestBody = { /** * This is the unique identifier for the customer in the client's app. This is used to track the customer's journey. @@ -33,6 +41,38 @@ export type TrackCustomerResponseBody = { customerAvatar: string | null; }; +/** @internal */ +export namespace TrackCustomerGlobals$ { + export const inboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + projectSlug: z.string().optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.projectSlug === undefined ? null : { projectSlug: v.projectSlug }), + }; + }); + + export type Outbound = { + workspaceId: string; + projectSlug?: string | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + projectSlug: z.string().optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.projectSlug === undefined ? null : { projectSlug: v.projectSlug }), + }; + }); +} + /** @internal */ export namespace TrackCustomerRequestBody$ { export const inboundSchema: z.ZodType = z diff --git a/src/models/operations/tracklead.ts b/src/models/operations/tracklead.ts index ea6b243..57d5048 100644 --- a/src/models/operations/tracklead.ts +++ b/src/models/operations/tracklead.ts @@ -4,6 +4,14 @@ import * as z from "zod"; +export type TrackLeadGlobals = { + workspaceId: string; + /** + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + projectSlug?: string | undefined; +}; + export type TrackLeadRequestBody = { /** * The ID of the click in th Dub. You can read this value from `dclid` cookie. @@ -48,6 +56,38 @@ export type TrackLeadResponseBody = { metadata?: { [k: string]: any } | undefined; }; +/** @internal */ +export namespace TrackLeadGlobals$ { + export const inboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + projectSlug: z.string().optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.projectSlug === undefined ? null : { projectSlug: v.projectSlug }), + }; + }); + + export type Outbound = { + workspaceId: string; + projectSlug?: string | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + projectSlug: z.string().optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.projectSlug === undefined ? null : { projectSlug: v.projectSlug }), + }; + }); +} + /** @internal */ export namespace TrackLeadRequestBody$ { export const inboundSchema: z.ZodType = z diff --git a/src/models/operations/tracksale.ts b/src/models/operations/tracksale.ts index e4cf5ff..082d12c 100644 --- a/src/models/operations/tracksale.ts +++ b/src/models/operations/tracksale.ts @@ -5,6 +5,14 @@ import { ClosedEnum } from "../../types"; import * as z from "zod"; +export type TrackSaleGlobals = { + workspaceId: string; + /** + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + projectSlug?: string | undefined; +}; + /** * The payment processor via which the sale was made. */ @@ -57,6 +65,38 @@ export type TrackSaleResponseBody = { metadata: { [k: string]: any } | null; }; +/** @internal */ +export namespace TrackSaleGlobals$ { + export const inboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + projectSlug: z.string().optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.projectSlug === undefined ? null : { projectSlug: v.projectSlug }), + }; + }); + + export type Outbound = { + workspaceId: string; + projectSlug?: string | undefined; + }; + + export const outboundSchema: z.ZodType = z + .object({ + workspaceId: z.string(), + projectSlug: z.string().optional(), + }) + .transform((v) => { + return { + workspaceId: v.workspaceId, + ...(v.projectSlug === undefined ? null : { projectSlug: v.projectSlug }), + }; + }); +} + /** @internal */ export namespace PaymentProcessor$ { export const inboundSchema = z.nativeEnum(PaymentProcessor); diff --git a/src/sdk/track.ts b/src/sdk/track.ts index 41b02e6..083f084 100644 --- a/src/sdk/track.ts +++ b/src/sdk/track.ts @@ -64,7 +64,18 @@ export class Track extends ClientSDK { const path$ = this.templateURLComponent("/track/lead")(); - const query$ = ""; + const query$ = [ + enc$.encodeForm("projectSlug", this.options$.projectSlug, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("workspaceId", this.options$.workspaceId, { + explode: true, + charEncoding: "percent", + }), + ] + .filter(Boolean) + .join("&"); let security$; if (typeof this.options$.token === "function") { @@ -159,7 +170,18 @@ export class Track extends ClientSDK { const path$ = this.templateURLComponent("/track/sale")(); - const query$ = ""; + const query$ = [ + enc$.encodeForm("projectSlug", this.options$.projectSlug, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("workspaceId", this.options$.workspaceId, { + explode: true, + charEncoding: "percent", + }), + ] + .filter(Boolean) + .join("&"); let security$; if (typeof this.options$.token === "function") { @@ -255,7 +277,18 @@ export class Track extends ClientSDK { const path$ = this.templateURLComponent("/track/customer")(); - const query$ = ""; + const query$ = [ + enc$.encodeForm("projectSlug", this.options$.projectSlug, { + explode: true, + charEncoding: "percent", + }), + enc$.encodeForm("workspaceId", this.options$.workspaceId, { + explode: true, + charEncoding: "percent", + }), + ] + .filter(Boolean) + .join("&"); let security$; if (typeof this.options$.token === "function") {