diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index a031220d..3b3b5b6d 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: d0b5f8295789a6e5094c2a864663e7e5 + docChecksum: ff99d725530dd92bf929c57a1840df75 docVersion: 0.0.1 - speakeasyVersion: 1.335.2 - generationVersion: 2.372.3 - releaseVersion: 0.34.1 - configChecksum: 3d38f32021ee5bb84ac709fb6f9eef4f + speakeasyVersion: 1.345.1 + generationVersion: 2.378.1 + releaseVersion: 0.34.2 + configChecksum: 05c888c383b927e166d2748c59ac9908 repoURL: https://github.com/dubinc/dub-ts.git installationURL: https://github.com/dubinc/dub-ts published: true @@ -14,10 +14,10 @@ features: typescript: additionalDependencies: 0.1.0 constsAndDefaults: 0.1.5 - core: 3.11.6 + core: 3.11.8 defaultEnabledRetries: 0.1.0 deprecations: 2.81.1 - errors: 2.81.11 + errors: 2.81.12 examples: 2.81.4 flattening: 2.81.1 globalSecurity: 2.82.9 @@ -29,7 +29,7 @@ features: responseFormat: 0.2.3 retries: 2.83.0 sdkHooks: 0.1.0 - unions: 2.85.5 + unions: 2.85.6 generatedFiles: - src/sdk/links.ts - src/sdk/qrcodes.ts @@ -286,3 +286,4 @@ generatedFiles: - src/hooks/hooks.ts - src/hooks/types.ts - src/hooks/index.ts + - CONTRIBUTING.md diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 95f6f264..34cf817f 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -12,7 +12,7 @@ generation: auth: oAuth2ClientCredentialsEnabled: false typescript: - version: 0.34.1 + version: 0.34.2 additionalDependencies: dependencies: {} devDependencies: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 25b36cfe..b482b414 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.335.2 +speakeasyVersion: 1.345.1 sources: my-first-source: sourceNamespace: my-first-source - sourceRevisionDigest: sha256:e81713c78ad2a720829f9e11d386b9914593e929c2dbf12b8ed17f292ba54708 - sourceBlobDigest: sha256:72daf1db5b244b325fa721f1218f8efbabc9dbe21958c4e30b1cc4e952b6ad42 + sourceRevisionDigest: sha256:44a39a3a7c7c611c83cd96e9a48564b178ab4a5da2900acf8912c1cdf6de57e3 + sourceBlobDigest: sha256:1846a60748f8012cb7b61a3efc5115eba934f33b634f5127760d34b1a1d8dd0d tags: - latest - main @@ -11,10 +11,10 @@ targets: my-first-target: source: my-first-source sourceNamespace: my-first-source - sourceRevisionDigest: sha256:e81713c78ad2a720829f9e11d386b9914593e929c2dbf12b8ed17f292ba54708 - sourceBlobDigest: sha256:72daf1db5b244b325fa721f1218f8efbabc9dbe21958c4e30b1cc4e952b6ad42 + sourceRevisionDigest: sha256:44a39a3a7c7c611c83cd96e9a48564b178ab4a5da2900acf8912c1cdf6de57e3 + sourceBlobDigest: sha256:1846a60748f8012cb7b61a3efc5115eba934f33b634f5127760d34b1a1d8dd0d codeSamplesNamespace: code-samples-typescript-my-first-target - codeSamplesRevisionDigest: sha256:1addf09930a333988cda7c26a9ca0a5350795c5da2650faf28fdfbaaa444f1e9 + codeSamplesRevisionDigest: sha256:cb4793ea270e582b2fa2c48d95ab1962231caa0d5b44dd8cdfa3ded921cb9280 outLocation: /github/workspace/repo workflow: workflowVersion: 1.0.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..d585717f --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,26 @@ +# Contributing to This Repository + +Thank you for your interest in contributing to this repository. Please note that this repository contains generated code. As such, we do not accept direct changes or pull requests. Instead, we encourage you to follow the guidelines below to report issues and suggest improvements. + +## How to Report Issues + +If you encounter any bugs or have suggestions for improvements, please open an issue on GitHub. When reporting an issue, please provide as much detail as possible to help us reproduce the problem. This includes: + +- A clear and descriptive title +- Steps to reproduce the issue +- Expected and actual behavior +- Any relevant logs, screenshots, or error messages +- Information about your environment (e.g., operating system, software versions) + - For example can be collected using the `npx envinfo` command from your terminal if you have Node.js installed + +## Issue Triage and Upstream Fixes + +We will review and triage issues as quickly as possible. Our goal is to address bugs and incorporate improvements in the upstream source code. Fixes will be included in the next generation of the generated code. + +## Contact + +If you have any questions or need further assistance, please feel free to reach out by opening an issue. + +Thank you for your understanding and cooperation! + +The Maintainers diff --git a/RELEASES.md b/RELEASES.md index a370ad63..06830f6d 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -586,4 +586,14 @@ Based on: ### Generated - [typescript v0.34.1] . ### Releases -- [NPM v0.34.1] https://www.npmjs.com/package/dub/v/0.34.1 - . \ No newline at end of file +- [NPM v0.34.1] https://www.npmjs.com/package/dub/v/0.34.1 - . + +## 2024-07-23 03:24:14 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.345.1 (2.378.1) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v0.34.2] . +### Releases +- [NPM v0.34.2] https://www.npmjs.com/package/dub/v/0.34.2 - . \ No newline at end of file diff --git a/codeSamples.yaml b/codeSamples.yaml index 07ac1fd6..613c4353 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"]["/links/bulk"]["patch"] + - target: $["paths"]["/tags"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "bulkUpdateLinks" + "label": "getTags" "source": |- import { Dub } from "dub"; @@ -16,23 +16,18 @@ actions: }); async function run() { - const result = await dub.links.updateMany({ - linkIds: [ - "", - ], - data: {}, - }); + const result = await dub.tags.list(); // Handle the result console.log(result) } run(); - - target: $["paths"]["/domains/{slug}"]["delete"] + - target: $["paths"]["/domains/{slug}"]["patch"] update: "x-codeSamples": - "lang": "typescript" - "label": "deleteDomain" + "label": "updateDomain" "source": |- import { Dub } from "dub"; @@ -41,7 +36,7 @@ actions: }); async function run() { - const result = await dub.domains.delete("acme.com"); + const result = await dub.domains.update("acme.com", {}); // Handle the result console.log(result) @@ -72,11 +67,11 @@ actions: } run(); - - target: $["paths"]["/links/info"]["get"] + - target: $["paths"]["/track/customer"]["post"] update: "x-codeSamples": - "lang": "typescript" - "label": "getLinkInfo" + "label": "trackCustomer" "source": |- import { Dub } from "dub"; @@ -85,18 +80,20 @@ actions: }); async function run() { - const result = await dub.links.get({}); + const result = await dub.track.customer({ + customerId: "", + }); // Handle the result console.log(result) } run(); - - target: $["paths"]["/links/bulk"]["post"] + - target: $["paths"]["/analytics"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "bulkCreateLinks" + "label": "retrieveAnalytics" "source": |- import { Dub } from "dub"; @@ -105,22 +102,18 @@ actions: }); async function run() { - const result = await dub.links.createMany([ - { - url: "https://google.com", - }, - ]); + const result = await dub.analytics.retrieve({}); // Handle the result console.log(result) } run(); - - target: $["paths"]["/analytics"]["get"] + - target: $["paths"]["/workspaces/{idOrSlug}"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "retrieveAnalytics" + "label": "getWorkspace" "source": |- import { Dub } from "dub"; @@ -129,18 +122,20 @@ actions: }); async function run() { - const result = await dub.analytics.retrieve({}); + const result = await dub.workspaces.get({ + idOrSlug: "", + }); // Handle the result console.log(result) } run(); - - target: $["paths"]["/links"]["get"] + - target: $["paths"]["/tags"]["post"] update: "x-codeSamples": - "lang": "typescript" - "label": "getLinks" + "label": "createTag" "source": |- import { Dub } from "dub"; @@ -149,18 +144,18 @@ actions: }); async function run() { - const result = await dub.links.list({}); + const result = await dub.tags.create({}); // Handle the result console.log(result) } run(); - - target: $["paths"]["/links/{linkId}"]["delete"] + - target: $["paths"]["/tags/{id}"]["patch"] update: "x-codeSamples": - "lang": "typescript" - "label": "deleteLink" + "label": "updateTag" "source": |- import { Dub } from "dub"; @@ -169,18 +164,18 @@ actions: }); async function run() { - const result = await dub.links.delete(""); + const result = await dub.tags.update("", {}); // Handle the result console.log(result) } run(); - - target: $["paths"]["/links/count"]["get"] + - target: $["paths"]["/domains"]["post"] update: "x-codeSamples": - "lang": "typescript" - "label": "getLinksCount" + "label": "createDomain" "source": |- import { Dub } from "dub"; @@ -189,18 +184,20 @@ actions: }); async function run() { - const result = await dub.links.count({}); + const result = await dub.domains.create({ + slug: "acme.com", + }); // Handle the result console.log(result) } run(); - - target: $["paths"]["/links/{linkId}"]["patch"] + - target: $["paths"]["/track/sale"]["post"] update: "x-codeSamples": - "lang": "typescript" - "label": "updateLink" + "label": "trackSale" "source": |- import { Dub } from "dub"; @@ -209,18 +206,22 @@ actions: }); async function run() { - const result = await dub.links.update("", {}); + const result = await dub.track.sale({ + customerId: "", + amount: 996500, + paymentProcessor: "shopify", + }); // Handle the result console.log(result) } run(); - - target: $["paths"]["/qr"]["get"] + - target: $["paths"]["/metatags"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "getQRCode" + "label": "getMetatags" "source": |- import { Dub } from "dub"; @@ -229,8 +230,8 @@ actions: }); async function run() { - const result = await dub.qrCodes.get({ - url: "https://brief-micronutrient.org", + const result = await dub.metatags.get({ + url: "https://dub.co", }); // Handle the result @@ -238,11 +239,11 @@ actions: } run(); - - target: $["paths"]["/workspaces/{idOrSlug}"]["get"] + - target: $["paths"]["/links/{linkId}"]["delete"] update: "x-codeSamples": - "lang": "typescript" - "label": "getWorkspace" + "label": "deleteLink" "source": |- import { Dub } from "dub"; @@ -251,20 +252,18 @@ actions: }); async function run() { - const result = await dub.workspaces.get({ - idOrSlug: "", - }); + const result = await dub.links.delete(""); // Handle the result console.log(result) } run(); - - target: $["paths"]["/tags"]["post"] + - target: $["paths"]["/links/{linkId}"]["patch"] update: "x-codeSamples": - "lang": "typescript" - "label": "createTag" + "label": "updateLink" "source": |- import { Dub } from "dub"; @@ -273,18 +272,18 @@ actions: }); async function run() { - const result = await dub.tags.create({}); + const result = await dub.links.update("", {}); // Handle the result console.log(result) } run(); - - target: $["paths"]["/track/customer"]["post"] + - target: $["paths"]["/links/count"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "trackCustomer" + "label": "getLinksCount" "source": |- import { Dub } from "dub"; @@ -293,20 +292,18 @@ actions: }); async function run() { - const result = await dub.track.customer({ - customerId: "", - }); + const result = await dub.links.count({}); // Handle the result console.log(result) } run(); - - target: $["paths"]["/links"]["post"] + - target: $["paths"]["/links/info"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "createLink" + "label": "getLinkInfo" "source": |- import { Dub } from "dub"; @@ -315,20 +312,18 @@ actions: }); async function run() { - const result = await dub.links.create({ - url: "https://google.com", - }); + const result = await dub.links.get({}); // Handle the result console.log(result) } run(); - - target: $["paths"]["/links/upsert"]["put"] + - target: $["paths"]["/links/bulk"]["patch"] update: "x-codeSamples": - "lang": "typescript" - "label": "upsertLink" + "label": "bulkUpdateLinks" "source": |- import { Dub } from "dub"; @@ -337,8 +332,11 @@ actions: }); async function run() { - const result = await dub.links.upsert({ - url: "https://google.com", + const result = await dub.links.updateMany({ + linkIds: [ + "", + ], + data: {}, }); // Handle the result @@ -346,11 +344,11 @@ actions: } run(); - - target: $["paths"]["/tags/{id}"]["patch"] + - target: $["paths"]["/qr"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "updateTag" + "label": "getQRCode" "source": |- import { Dub } from "dub"; @@ -359,18 +357,20 @@ actions: }); async function run() { - const result = await dub.tags.update("", {}); + const result = await dub.qrCodes.get({ + url: "https://brief-micronutrient.org", + }); // Handle the result console.log(result) } run(); - - target: $["paths"]["/domains"]["get"] + - target: $["paths"]["/workspaces/{idOrSlug}"]["patch"] update: "x-codeSamples": - "lang": "typescript" - "label": "listDomains" + "label": "updateWorkspace" "source": |- import { Dub } from "dub"; @@ -379,18 +379,18 @@ actions: }); async function run() { - const result = await dub.domains.list(); + const result = await dub.workspaces.update("", {}); // Handle the result console.log(result) } run(); - - target: $["paths"]["/domains"]["post"] + - target: $["paths"]["/domains/{slug}"]["delete"] update: "x-codeSamples": - "lang": "typescript" - "label": "createDomain" + "label": "deleteDomain" "source": |- import { Dub } from "dub"; @@ -399,20 +399,18 @@ actions: }); async function run() { - const result = await dub.domains.create({ - slug: "acme.com", - }); + const result = await dub.domains.delete("acme.com"); // Handle the result console.log(result) } run(); - - target: $["paths"]["/domains/{slug}"]["patch"] + - target: $["paths"]["/links/upsert"]["put"] update: "x-codeSamples": - "lang": "typescript" - "label": "updateDomain" + "label": "upsertLink" "source": |- import { Dub } from "dub"; @@ -421,18 +419,20 @@ actions: }); async function run() { - const result = await dub.domains.update("acme.com", {}); + const result = await dub.links.upsert({ + url: "https://google.com", + }); // Handle the result console.log(result) } run(); - - target: $["paths"]["/track/sale"]["post"] + - target: $["paths"]["/links"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "trackSale" + "label": "getLinks" "source": |- import { Dub } from "dub"; @@ -441,22 +441,18 @@ actions: }); async function run() { - const result = await dub.track.sale({ - customerId: "", - amount: 996500, - paymentProcessor: "shopify", - }); + const result = await dub.links.list({}); // Handle the result console.log(result) } run(); - - target: $["paths"]["/metatags"]["get"] + - target: $["paths"]["/domains"]["get"] update: "x-codeSamples": - "lang": "typescript" - "label": "getMetatags" + "label": "listDomains" "source": |- import { Dub } from "dub"; @@ -465,20 +461,18 @@ actions: }); async function run() { - const result = await dub.metatags.get({ - url: "https://dub.co", - }); + const result = await dub.domains.list(); // Handle the result console.log(result) } run(); - - target: $["paths"]["/workspaces/{idOrSlug}"]["patch"] + - target: $["paths"]["/links"]["post"] update: "x-codeSamples": - "lang": "typescript" - "label": "updateWorkspace" + "label": "createLink" "source": |- import { Dub } from "dub"; @@ -487,18 +481,20 @@ actions: }); async function run() { - const result = await dub.workspaces.update("", {}); + const result = await dub.links.create({ + url: "https://google.com", + }); // Handle the result console.log(result) } run(); - - target: $["paths"]["/tags"]["get"] + - target: $["paths"]["/links/bulk"]["post"] update: "x-codeSamples": - "lang": "typescript" - "label": "getTags" + "label": "bulkCreateLinks" "source": |- import { Dub } from "dub"; @@ -507,7 +503,11 @@ actions: }); async function run() { - const result = await dub.tags.list(); + const result = await dub.links.createMany([ + { + url: "https://google.com", + }, + ]); // Handle the result console.log(result) diff --git a/docs/models/components/linkschema.md b/docs/models/components/linkschema.md index e4a1680e..724a823b 100644 --- a/docs/models/components/linkschema.md +++ b/docs/models/components/linkschema.md @@ -19,6 +19,7 @@ | `title` | *string* | :heavy_check_mark: | The title of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | `description` | *string* | :heavy_check_mark: | The description of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | `image` | *string* | :heavy_check_mark: | The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | +| `video` | *string* | :heavy_check_mark: | The custom link preview video (og:video). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og | | `rewrite` | *boolean* | :heavy_minus_sign: | Whether the short link uses link cloaking. | | `doIndex` | *boolean* | :heavy_minus_sign: | Whether to allow search engines to index the short link. | | `ios` | *string* | :heavy_check_mark: | The iOS destination URL for the short link for iOS device targeting. | diff --git a/docs/models/operations/createlinkrequestbody.md b/docs/models/operations/createlinkrequestbody.md index b84d7dd4..7f6b756f 100644 --- a/docs/models/operations/createlinkrequestbody.md +++ b/docs/models/operations/createlinkrequestbody.md @@ -21,9 +21,10 @@ | `expiredUrl` | *string* | :heavy_minus_sign: | The URL to redirect to when the short link has expired. | | | `password` | *string* | :heavy_minus_sign: | The password required to access the destination URL of the short link. | | | `proxy` | *boolean* | :heavy_minus_sign: | Whether the short link uses Custom Social Media Cards feature. | | -| `title` | *string* | :heavy_minus_sign: | The title of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | -| `description` | *string* | :heavy_minus_sign: | The description of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | -| `image` | *string* | :heavy_minus_sign: | The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | +| `title` | *string* | :heavy_minus_sign: | The custom link preview title (og:title). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og | | +| `description` | *string* | :heavy_minus_sign: | The custom link preview description (og:description). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og | | +| `image` | *string* | :heavy_minus_sign: | The custom link preview image (og:image). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og | | +| `video` | *string* | :heavy_minus_sign: | The custom link preview video (og:video). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og | | | `rewrite` | *boolean* | :heavy_minus_sign: | Whether the short link uses link cloaking. | | | `ios` | *string* | :heavy_minus_sign: | The iOS destination URL for the short link for iOS device targeting. | | | `android` | *string* | :heavy_minus_sign: | The Android destination URL for the short link for Android device targeting. | | diff --git a/docs/models/operations/data.md b/docs/models/operations/data.md index b3255c98..2f743c5b 100644 --- a/docs/models/operations/data.md +++ b/docs/models/operations/data.md @@ -17,9 +17,10 @@ | `expiredUrl` | *string* | :heavy_minus_sign: | The URL to redirect to when the short link has expired. | | | `password` | *string* | :heavy_minus_sign: | The password required to access the destination URL of the short link. | | | `proxy` | *boolean* | :heavy_minus_sign: | Whether the short link uses Custom Social Media Cards feature. | | -| `title` | *string* | :heavy_minus_sign: | The title of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | -| `description` | *string* | :heavy_minus_sign: | The description of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | -| `image` | *string* | :heavy_minus_sign: | The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | +| `title` | *string* | :heavy_minus_sign: | The custom link preview title (og:title). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og | | +| `description` | *string* | :heavy_minus_sign: | The custom link preview description (og:description). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og | | +| `image` | *string* | :heavy_minus_sign: | The custom link preview image (og:image). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og | | +| `video` | *string* | :heavy_minus_sign: | The custom link preview video (og:video). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og | | | `rewrite` | *boolean* | :heavy_minus_sign: | Whether the short link uses link cloaking. | | | `ios` | *string* | :heavy_minus_sign: | The iOS destination URL for the short link for iOS device targeting. | | | `android` | *string* | :heavy_minus_sign: | The Android destination URL for the short link for Android device targeting. | | diff --git a/docs/models/operations/requestbody.md b/docs/models/operations/requestbody.md index 1714c42e..219bac88 100644 --- a/docs/models/operations/requestbody.md +++ b/docs/models/operations/requestbody.md @@ -21,9 +21,10 @@ | `expiredUrl` | *string* | :heavy_minus_sign: | The URL to redirect to when the short link has expired. | | | `password` | *string* | :heavy_minus_sign: | The password required to access the destination URL of the short link. | | | `proxy` | *boolean* | :heavy_minus_sign: | Whether the short link uses Custom Social Media Cards feature. | | -| `title` | *string* | :heavy_minus_sign: | The title of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | -| `description` | *string* | :heavy_minus_sign: | The description of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | -| `image` | *string* | :heavy_minus_sign: | The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | +| `title` | *string* | :heavy_minus_sign: | The custom link preview title (og:title). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og | | +| `description` | *string* | :heavy_minus_sign: | The custom link preview description (og:description). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og | | +| `image` | *string* | :heavy_minus_sign: | The custom link preview image (og:image). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og | | +| `video` | *string* | :heavy_minus_sign: | The custom link preview video (og:video). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og | | | `rewrite` | *boolean* | :heavy_minus_sign: | Whether the short link uses link cloaking. | | | `ios` | *string* | :heavy_minus_sign: | The iOS destination URL for the short link for iOS device targeting. | | | `android` | *string* | :heavy_minus_sign: | The Android destination URL for the short link for Android device targeting. | | diff --git a/docs/models/operations/updatelinkrequestbody.md b/docs/models/operations/updatelinkrequestbody.md index 5d21be23..13a9fdb4 100644 --- a/docs/models/operations/updatelinkrequestbody.md +++ b/docs/models/operations/updatelinkrequestbody.md @@ -21,9 +21,10 @@ | `expiredUrl` | *string* | :heavy_minus_sign: | The URL to redirect to when the short link has expired. | | | `password` | *string* | :heavy_minus_sign: | The password required to access the destination URL of the short link. | | | `proxy` | *boolean* | :heavy_minus_sign: | Whether the short link uses Custom Social Media Cards feature. | | -| `title` | *string* | :heavy_minus_sign: | The title of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | -| `description` | *string* | :heavy_minus_sign: | The description of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | -| `image` | *string* | :heavy_minus_sign: | The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | +| `title` | *string* | :heavy_minus_sign: | The custom link preview title (og:title). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og | | +| `description` | *string* | :heavy_minus_sign: | The custom link preview description (og:description). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og | | +| `image` | *string* | :heavy_minus_sign: | The custom link preview image (og:image). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og | | +| `video` | *string* | :heavy_minus_sign: | The custom link preview video (og:video). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og | | | `rewrite` | *boolean* | :heavy_minus_sign: | Whether the short link uses link cloaking. | | | `ios` | *string* | :heavy_minus_sign: | The iOS destination URL for the short link for iOS device targeting. | | | `android` | *string* | :heavy_minus_sign: | The Android destination URL for the short link for Android device targeting. | | diff --git a/docs/models/operations/upsertlinkrequestbody.md b/docs/models/operations/upsertlinkrequestbody.md index 9350d8e3..909484d0 100644 --- a/docs/models/operations/upsertlinkrequestbody.md +++ b/docs/models/operations/upsertlinkrequestbody.md @@ -21,9 +21,10 @@ | `expiredUrl` | *string* | :heavy_minus_sign: | The URL to redirect to when the short link has expired. | | | `password` | *string* | :heavy_minus_sign: | The password required to access the destination URL of the short link. | | | `proxy` | *boolean* | :heavy_minus_sign: | Whether the short link uses Custom Social Media Cards feature. | | -| `title` | *string* | :heavy_minus_sign: | The title of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | -| `description` | *string* | :heavy_minus_sign: | The description of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | -| `image` | *string* | :heavy_minus_sign: | The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. | | +| `title` | *string* | :heavy_minus_sign: | The custom link preview title (og:title). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og | | +| `description` | *string* | :heavy_minus_sign: | The custom link preview description (og:description). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og | | +| `image` | *string* | :heavy_minus_sign: | The custom link preview image (og:image). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og | | +| `video` | *string* | :heavy_minus_sign: | The custom link preview video (og:video). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og | | | `rewrite` | *boolean* | :heavy_minus_sign: | Whether the short link uses link cloaking. | | | `ios` | *string* | :heavy_minus_sign: | The iOS destination URL for the short link for iOS device targeting. | | | `android` | *string* | :heavy_minus_sign: | The Android destination URL for the short link for Android device targeting. | | diff --git a/jsr.json b/jsr.json index 9f8b0932..6ee734eb 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "dub", - "version": "0.34.1", + "version": "0.34.2", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index 1c6f6702..3b7ceb50 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "dub", - "version": "0.34.1", + "version": "0.34.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "dub", - "version": "0.34.1", + "version": "0.34.2", "devDependencies": { "@types/node": "^20.12.7", "@typescript-eslint/eslint-plugin": "^7.7.1", diff --git a/package.json b/package.json index f7159773..f6603f8e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dub", - "version": "0.34.1", + "version": "0.34.2", "author": "Dub", "main": "./index.js", "sideEffects": false, diff --git a/src/lib/config.ts b/src/lib/config.ts index be69600f..0ab04ec6 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -55,7 +55,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "0.0.1", - sdkVersion: "0.34.1", - genVersion: "2.372.3", - userAgent: "speakeasy-sdk/typescript 0.34.1 2.372.3 0.0.1 dub", + sdkVersion: "0.34.2", + genVersion: "2.378.1", + userAgent: "speakeasy-sdk/typescript 0.34.2 2.378.1 0.0.1 dub", } as const; diff --git a/src/lib/encodings.ts b/src/lib/encodings.ts index 49f536b6..9ddea674 100644 --- a/src/lib/encodings.ts +++ b/src/lib/encodings.ts @@ -212,6 +212,24 @@ export function encodeDeepObject( return ""; } + if (!isPlainObject(value)) { + throw new EncodingError( + `Value of parameter '${key}' which uses deepObject encoding must be an object`, + ); + } + + return encodeDeepObjectObject(key, value, options); +} + +export function encodeDeepObjectObject( + key: string, + value: unknown, + options?: { charEncoding?: "percent" | "none" }, +): string { + if (value == null) { + return ""; + } + let out = ""; const encodeString = (v: string) => { @@ -219,9 +237,7 @@ export function encodeDeepObject( }; if (!isPlainObject(value)) { - throw new EncodingError( - `Value of parameter '${key}' which uses deepObject encoding must be an object`, - ); + throw new EncodingError(`Expected parameter '${key}' to be an object.`); } Object.entries(value).forEach(([ck, cv]) => { @@ -232,9 +248,11 @@ export function encodeDeepObject( const pk = `${key}[${ck}]`; if (isPlainObject(cv)) { - throw new EncodingError( - `Value of parameter field '${pk}' cannot be an array or object.`, - ); + const objOut = encodeDeepObjectObject(pk, cv, options); + + out += `&${objOut}`; + + return; } const pairs: unknown[] = Array.isArray(cv) ? cv : [cv]; diff --git a/src/lib/http.ts b/src/lib/http.ts index 7c5107ad..9d22befe 100644 --- a/src/lib/http.ts +++ b/src/lib/http.ts @@ -284,6 +284,7 @@ type ResponsePredicateMatch = { key: string | undefined; err: boolean; fail: boolean; + sseSentinel?: string | undefined; }; type ResponsePredicateOptions = { @@ -291,6 +292,8 @@ type ResponsePredicateOptions = { ctype?: string; /** Pass HTTP headers to deserializer. */ hdrs?: boolean; + /** A value for an SSE event's data field that indicates a stream should be terminated. */ + sseSentinel?: string; } & ( | { /** The result key to store the deserialized value into. */ @@ -326,6 +329,7 @@ export class ResponseMatcher { const key = opts?.key; const err = !!opts?.err; const fail = !!opts?.fail; + const sseSentinel = opts?.sseSentinel; this.predicates.push({ method, codes, @@ -335,6 +339,7 @@ export class ResponseMatcher { key, err, fail, + sseSentinel, }); return this; } diff --git a/src/models/components/linkschema.ts b/src/models/components/linkschema.ts index 5f76a9a2..e4dc6634 100644 --- a/src/models/components/linkschema.ts +++ b/src/models/components/linkschema.ts @@ -324,6 +324,10 @@ export type LinkSchema = { * The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. */ image: string | null; + /** + * The custom link preview video (og:video). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og + */ + video: string | null; /** * Whether the short link uses link cloaking. */ @@ -1732,6 +1736,7 @@ export const LinkSchema$inboundSchema: z.ZodType = z.obje title: z.nullable(z.string()).optional(), description: z.nullable(z.string()).optional(), image: z.nullable(z.string()).optional(), + video: z.nullable(z.string()).optional(), rewrite: z.boolean().default(false), ios: z.nullable(z.string()).optional(), android: z.nullable(z.string()).optional(), @@ -206,6 +211,7 @@ export type Data$Outbound = { title?: string | null | undefined; description?: string | null | undefined; image?: string | null | undefined; + video?: string | null | undefined; rewrite: boolean; ios?: string | null | undefined; android?: string | null | undefined; @@ -230,6 +236,7 @@ export const Data$outboundSchema: z.ZodType = title: z.nullable(z.string()).optional(), description: z.nullable(z.string()).optional(), image: z.nullable(z.string()).optional(), + video: z.nullable(z.string()).optional(), rewrite: z.boolean().default(false), ios: z.nullable(z.string()).optional(), android: z.nullable(z.string()).optional(), diff --git a/src/models/operations/createlink.ts b/src/models/operations/createlink.ts index 8d5780fb..3867643e 100644 --- a/src/models/operations/createlink.ts +++ b/src/models/operations/createlink.ts @@ -83,17 +83,21 @@ export type CreateLinkRequestBody = { */ proxy?: boolean | undefined; /** - * The title of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + * The custom link preview title (og:title). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og */ title?: string | null | undefined; /** - * The description of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + * The custom link preview description (og:description). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og */ description?: string | null | undefined; /** - * The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + * The custom link preview image (og:image). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og */ image?: string | null | undefined; + /** + * The custom link preview video (og:video). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og + */ + video?: string | null | undefined; /** * Whether the short link uses link cloaking. */ @@ -195,6 +199,7 @@ export const CreateLinkRequestBody$inboundSchema: z.ZodType< title: z.nullable(z.string()).optional(), description: z.nullable(z.string()).optional(), image: z.nullable(z.string()).optional(), + video: z.nullable(z.string()).optional(), rewrite: z.boolean().default(false), ios: z.nullable(z.string()).optional(), android: z.nullable(z.string()).optional(), @@ -223,6 +228,7 @@ export type CreateLinkRequestBody$Outbound = { title?: string | null | undefined; description?: string | null | undefined; image?: string | null | undefined; + video?: string | null | undefined; rewrite: boolean; ios?: string | null | undefined; android?: string | null | undefined; @@ -255,6 +261,7 @@ export const CreateLinkRequestBody$outboundSchema: z.ZodType< title: z.nullable(z.string()).optional(), description: z.nullable(z.string()).optional(), image: z.nullable(z.string()).optional(), + video: z.nullable(z.string()).optional(), rewrite: z.boolean().default(false), ios: z.nullable(z.string()).optional(), android: z.nullable(z.string()).optional(), diff --git a/src/models/operations/updatelink.ts b/src/models/operations/updatelink.ts index 3a1f9388..a1649506 100644 --- a/src/models/operations/updatelink.ts +++ b/src/models/operations/updatelink.ts @@ -84,17 +84,21 @@ export type UpdateLinkRequestBody = { */ proxy?: boolean | undefined; /** - * The title of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + * The custom link preview title (og:title). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og */ title?: string | null | undefined; /** - * The description of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + * The custom link preview description (og:description). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og */ description?: string | null | undefined; /** - * The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + * The custom link preview image (og:image). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og */ image?: string | null | undefined; + /** + * The custom link preview video (og:video). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og + */ + video?: string | null | undefined; /** * Whether the short link uses link cloaking. */ @@ -204,6 +208,7 @@ export const UpdateLinkRequestBody$inboundSchema: z.ZodType< title: z.nullable(z.string()).optional(), description: z.nullable(z.string()).optional(), image: z.nullable(z.string()).optional(), + video: z.nullable(z.string()).optional(), rewrite: z.boolean().default(false), ios: z.nullable(z.string()).optional(), android: z.nullable(z.string()).optional(), @@ -232,6 +237,7 @@ export type UpdateLinkRequestBody$Outbound = { title?: string | null | undefined; description?: string | null | undefined; image?: string | null | undefined; + video?: string | null | undefined; rewrite: boolean; ios?: string | null | undefined; android?: string | null | undefined; @@ -264,6 +270,7 @@ export const UpdateLinkRequestBody$outboundSchema: z.ZodType< title: z.nullable(z.string()).optional(), description: z.nullable(z.string()).optional(), image: z.nullable(z.string()).optional(), + video: z.nullable(z.string()).optional(), rewrite: z.boolean().default(false), ios: z.nullable(z.string()).optional(), android: z.nullable(z.string()).optional(), diff --git a/src/models/operations/upsertlink.ts b/src/models/operations/upsertlink.ts index bb334efa..69e2b7b2 100644 --- a/src/models/operations/upsertlink.ts +++ b/src/models/operations/upsertlink.ts @@ -83,17 +83,21 @@ export type UpsertLinkRequestBody = { */ proxy?: boolean | undefined; /** - * The title of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + * The custom link preview title (og:title). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og */ title?: string | null | undefined; /** - * The description of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + * The custom link preview description (og:description). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og */ description?: string | null | undefined; /** - * The image of the short link generated via `api.dub.co/metatags`. Will be used for Custom Social Media Cards if `proxy` is true. + * The custom link preview image (og:image). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og */ image?: string | null | undefined; + /** + * The custom link preview video (og:video). Will be used for Custom Social Media Cards if `proxy` is true. Learn more: https://d.to/og + */ + video?: string | null | undefined; /** * Whether the short link uses link cloaking. */ @@ -198,6 +202,7 @@ export const UpsertLinkRequestBody$inboundSchema: z.ZodType< title: z.nullable(z.string()).optional(), description: z.nullable(z.string()).optional(), image: z.nullable(z.string()).optional(), + video: z.nullable(z.string()).optional(), rewrite: z.boolean().default(false), ios: z.nullable(z.string()).optional(), android: z.nullable(z.string()).optional(), @@ -226,6 +231,7 @@ export type UpsertLinkRequestBody$Outbound = { title?: string | null | undefined; description?: string | null | undefined; image?: string | null | undefined; + video?: string | null | undefined; rewrite: boolean; ios?: string | null | undefined; android?: string | null | undefined; @@ -258,6 +264,7 @@ export const UpsertLinkRequestBody$outboundSchema: z.ZodType< title: z.nullable(z.string()).optional(), description: z.nullable(z.string()).optional(), image: z.nullable(z.string()).optional(), + video: z.nullable(z.string()).optional(), rewrite: z.boolean().default(false), ios: z.nullable(z.string()).optional(), android: z.nullable(z.string()).optional(),