mirror of
https://github.com/LukeHagar/dub-node.git
synced 2025-12-06 04:19:37 +00:00
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.279.0 (#95)
Co-authored-by: speakeasybot <bot@speakeasyapi.dev>
This commit is contained in:
committed by
GitHub
parent
20aa5eb3d0
commit
9e50ee43ce
@@ -1,19 +1,19 @@
|
||||
lockVersion: 2.0.0
|
||||
id: f28179cc-ef59-426d-9e85-60cec22fc642
|
||||
management:
|
||||
docChecksum: 1504d2d6c3f4514d30a37a76c74a48a5
|
||||
docChecksum: c38ab49043c57320aee33ca443a1c66b
|
||||
docVersion: 0.0.1
|
||||
speakeasyVersion: 1.277.4
|
||||
generationVersion: 2.318.3
|
||||
releaseVersion: 0.26.0
|
||||
configChecksum: 640563cb2897eac551ae0d2397065a1c
|
||||
speakeasyVersion: 1.279.0
|
||||
generationVersion: 2.322.5
|
||||
releaseVersion: 0.26.1
|
||||
configChecksum: 2bd291f2df61e20c2670d16d58227cef
|
||||
repoURL: https://github.com/dubinc/dub-node.git
|
||||
installationURL: https://github.com/dubinc/dub-node
|
||||
published: true
|
||||
features:
|
||||
typescript:
|
||||
constsAndDefaults: 0.1.5
|
||||
core: 3.9.2
|
||||
core: 3.9.3
|
||||
deprecations: 2.81.1
|
||||
examples: 2.81.3
|
||||
flattening: 2.81.1
|
||||
@@ -23,7 +23,7 @@ features:
|
||||
hiddenGlobals: 0.1.0
|
||||
nameOverrides: 2.81.2
|
||||
responseFormat: 0.2.3
|
||||
unions: 2.85.3
|
||||
unions: 2.85.4
|
||||
generatedFiles:
|
||||
- src/sdk/links.ts
|
||||
- src/sdk/qrcodes.ts
|
||||
@@ -73,8 +73,8 @@ generatedFiles:
|
||||
- src/models/operations/createlink.ts
|
||||
- src/models/operations/getlinkscount.ts
|
||||
- src/models/operations/getlinkinfo.ts
|
||||
- src/models/operations/editlink.ts
|
||||
- src/models/operations/deletelink.ts
|
||||
- src/models/operations/updatelink.ts
|
||||
- src/models/operations/bulkcreatelinks.ts
|
||||
- src/models/operations/getqrcode.ts
|
||||
- src/models/operations/getclicksanalytics.ts
|
||||
@@ -94,7 +94,7 @@ generatedFiles:
|
||||
- src/models/operations/listdomains.ts
|
||||
- src/models/operations/adddomain.ts
|
||||
- src/models/operations/deletedomain.ts
|
||||
- src/models/operations/editdomain.ts
|
||||
- src/models/operations/updatedomain.ts
|
||||
- src/models/operations/setprimarydomain.ts
|
||||
- src/models/operations/transferdomain.ts
|
||||
- src/models/operations/getmetatags.ts
|
||||
@@ -155,13 +155,13 @@ generatedFiles:
|
||||
- docs/models/operations/groupby.md
|
||||
- docs/models/operations/getlinkscountrequest.md
|
||||
- docs/models/operations/getlinkinforequest.md
|
||||
- docs/models/operations/editlinktagids.md
|
||||
- docs/models/operations/editlinktagnames.md
|
||||
- docs/models/operations/editlinkgeo.md
|
||||
- docs/models/operations/editlinkrequestbody.md
|
||||
- docs/models/operations/editlinkrequest.md
|
||||
- docs/models/operations/deletelinkrequest.md
|
||||
- docs/models/operations/deletelinkresponsebody.md
|
||||
- docs/models/operations/updatelinktagids.md
|
||||
- docs/models/operations/updatelinktagnames.md
|
||||
- docs/models/operations/updatelinkgeo.md
|
||||
- docs/models/operations/updatelinkrequestbody.md
|
||||
- docs/models/operations/updatelinkrequest.md
|
||||
- docs/models/operations/bulkcreatelinkstagids.md
|
||||
- docs/models/operations/bulkcreatelinkstagnames.md
|
||||
- docs/models/operations/bulkcreatelinksgeo.md
|
||||
@@ -219,9 +219,9 @@ generatedFiles:
|
||||
- docs/models/operations/adddomainrequestbody.md
|
||||
- docs/models/operations/deletedomainrequest.md
|
||||
- docs/models/operations/deletedomainresponsebody.md
|
||||
- docs/models/operations/editdomaintype.md
|
||||
- docs/models/operations/editdomainrequestbody.md
|
||||
- docs/models/operations/editdomainrequest.md
|
||||
- docs/models/operations/updatedomaintype.md
|
||||
- docs/models/operations/updatedomainrequestbody.md
|
||||
- docs/models/operations/updatedomainrequest.md
|
||||
- docs/models/operations/setprimarydomainrequest.md
|
||||
- docs/models/operations/transferdomainrequestbody.md
|
||||
- docs/models/operations/transferdomainrequest.md
|
||||
|
||||
@@ -12,7 +12,7 @@ generation:
|
||||
auth:
|
||||
oAuth2ClientCredentialsEnabled: false
|
||||
typescript:
|
||||
version: 0.26.0
|
||||
version: 0.26.1
|
||||
additionalDependencies:
|
||||
dependencies: {}
|
||||
devDependencies:
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
speakeasyVersion: 1.277.4
|
||||
speakeasyVersion: 1.279.0
|
||||
sources:
|
||||
my-first-source:
|
||||
sourceNamespace: my-first-source
|
||||
sourceRevisionDigest: sha256:55ec84ef7f4cfe2ce4c37f825adf9e34af493fc6bd28fc897643faea892381a4
|
||||
sourceBlobDigest: sha256:646aaaaf591cd2d029735da923e4ddf83e85d98d268353bb9c884cd77000c4b2
|
||||
sourceRevisionDigest: sha256:e6203c2aa1c988a36a86dc96eb739e41e9a39ccf4ed817206a1fff5eb1199a28
|
||||
sourceBlobDigest: sha256:0d376a9762a91f0109b087d69e9516f3bbe68ff02d2ac52483373544e6ab7508
|
||||
tags:
|
||||
- latest
|
||||
targets:
|
||||
my-first-target:
|
||||
source: my-first-source
|
||||
sourceNamespace: my-first-source
|
||||
sourceRevisionDigest: sha256:55ec84ef7f4cfe2ce4c37f825adf9e34af493fc6bd28fc897643faea892381a4
|
||||
sourceBlobDigest: sha256:646aaaaf591cd2d029735da923e4ddf83e85d98d268353bb9c884cd77000c4b2
|
||||
sourceRevisionDigest: sha256:e6203c2aa1c988a36a86dc96eb739e41e9a39ccf4ed817206a1fff5eb1199a28
|
||||
sourceBlobDigest: sha256:0d376a9762a91f0109b087d69e9516f3bbe68ff02d2ac52483373544e6ab7508
|
||||
outLocation: /github/workspace/repo
|
||||
workflow:
|
||||
workflowVersion: 1.0.0
|
||||
|
||||
@@ -69,8 +69,8 @@ run();
|
||||
* [create](docs/sdks/links/README.md#create) - Create a new link
|
||||
* [count](docs/sdks/links/README.md#count) - Retrieve the number of links
|
||||
* [get](docs/sdks/links/README.md#get) - Retrieve a link
|
||||
* [update](docs/sdks/links/README.md#update) - Edit a link
|
||||
* [delete](docs/sdks/links/README.md#delete) - Delete a link
|
||||
* [update](docs/sdks/links/README.md#update) - Update a link
|
||||
* [createMany](docs/sdks/links/README.md#createmany) - Bulk create links
|
||||
|
||||
### [qrCodes](docs/sdks/qrcodes/README.md)
|
||||
@@ -106,7 +106,7 @@ run();
|
||||
* [list](docs/sdks/domains/README.md#list) - Retrieve a list of domains
|
||||
* [add](docs/sdks/domains/README.md#add) - Add a domain
|
||||
* [delete](docs/sdks/domains/README.md#delete) - Delete a domain
|
||||
* [update](docs/sdks/domains/README.md#update) - Edit a domain
|
||||
* [update](docs/sdks/domains/README.md#update) - Update a domain
|
||||
* [setPrimary](docs/sdks/domains/README.md#setprimary) - Set a domain as primary
|
||||
* [transfer](docs/sdks/domains/README.md#transfer) - Transfer a domain
|
||||
|
||||
|
||||
12
RELEASES.md
12
RELEASES.md
@@ -216,4 +216,14 @@ Based on:
|
||||
### Generated
|
||||
- [typescript v0.26.0] .
|
||||
### Releases
|
||||
- [NPM v0.26.0] https://www.npmjs.com/package/dub/v/0.26.0 - .
|
||||
- [NPM v0.26.0] https://www.npmjs.com/package/dub/v/0.26.0 - .
|
||||
|
||||
## 2024-05-06 01:14:43
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.279.0 (2.322.5) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [typescript v0.26.1] .
|
||||
### Releases
|
||||
- [NPM v0.26.1] https://www.npmjs.com/package/dub/v/0.26.1 - .
|
||||
714
codeSamples.yaml
714
codeSamples.yaml
@@ -3,11 +3,11 @@ info:
|
||||
title: CodeSamples overlay for typescript target
|
||||
version: 0.0.0
|
||||
actions:
|
||||
- target: $["paths"]["/analytics/clicks"]["get"]
|
||||
- target: $["paths"]["/tags"]["post"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "getClicksAnalytics"
|
||||
"label": "createTag"
|
||||
"source": |-
|
||||
import { Dub } from "dub";
|
||||
|
||||
@@ -17,13 +17,119 @@ actions:
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.clicks({});
|
||||
const result = await dub.create({
|
||||
tag: "<value>",
|
||||
});
|
||||
|
||||
// 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\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n workspaceId: \"<value>\",\n});\n\nasync function run() {\n const slug = \"acme.com\";\n const requestBody = {\n newWorkspaceId: \"<value>\",\n };\n \n const result = await dub.transfer(slug, requestBody);\n\n // Handle the result\n console.log(result)\n}\n\nrun();"
|
||||
- target: $["paths"]["/domains/{slug}"]["patch"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "updateDomain"
|
||||
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n workspaceId: \"<value>\",\n});\n\nasync function run() {\n const slug = \"acme.com\";\n const requestBody = {};\n \n const result = await dub.update(slug, requestBody);\n\n // Handle the result\n console.log(result)\n}\n\nrun();"
|
||||
- target: $["paths"]["/analytics/city"]["get"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "getCityAnalytics"
|
||||
"source": |-
|
||||
import { Dub } from "dub";
|
||||
|
||||
const dub = new Dub({
|
||||
token: "DUB_API_KEY",
|
||||
workspaceId: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.cities({});
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
}
|
||||
|
||||
run();
|
||||
- target: $["paths"]["/analytics/top_links"]["get"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "getTopLinks"
|
||||
"source": |-
|
||||
import { Dub } from "dub";
|
||||
|
||||
const dub = new Dub({
|
||||
token: "DUB_API_KEY",
|
||||
workspaceId: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.topLinks({});
|
||||
|
||||
// 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: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.list({});
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
}
|
||||
|
||||
run();
|
||||
- target: $["paths"]["/domains"]["post"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "addDomain"
|
||||
"source": |-
|
||||
import { Dub } from "dub";
|
||||
|
||||
const dub = new Dub({
|
||||
token: "DUB_API_KEY",
|
||||
workspaceId: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.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\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n workspaceId: \"<value>\",\n});\n\nasync function run() {\n const slug = \"acme.com\";\n \n const result = await dub.setPrimary(slug);\n\n // Handle the result\n console.log(result)\n}\n\nrun();"
|
||||
- target: $["paths"]["/analytics/timeseries"]["get"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
@@ -44,6 +150,150 @@ actions:
|
||||
console.log(result)
|
||||
}
|
||||
|
||||
run();
|
||||
- target: $["paths"]["/links/{linkId}"]["patch"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "updateLink"
|
||||
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n workspaceId: \"<value>\",\n});\n\nasync function run() {\n const linkId = \"<value>\";\n const requestBody = {\n url: \"https://google/com\",\n };\n \n const result = await dub.update(linkId, requestBody);\n\n // Handle the result\n console.log(result)\n}\n\nrun();"
|
||||
- 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: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.createMany([
|
||||
{
|
||||
url: "https://google/com",
|
||||
},
|
||||
]);
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
}
|
||||
|
||||
run();
|
||||
- target: $["paths"]["/qr"]["get"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "getQRCode"
|
||||
"source": |-
|
||||
import { Dub } from "dub";
|
||||
|
||||
const dub = new Dub({
|
||||
token: "DUB_API_KEY",
|
||||
workspaceId: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.get({});
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
}
|
||||
|
||||
run();
|
||||
- target: $["paths"]["/workspaces/{idOrSlug}"]["get"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "getWorkspace"
|
||||
"source": |-
|
||||
import { Dub } from "dub";
|
||||
|
||||
const dub = new Dub({
|
||||
token: "DUB_API_KEY",
|
||||
workspaceId: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.get({
|
||||
idOrSlug: "<value>",
|
||||
});
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
}
|
||||
|
||||
run();
|
||||
- target: $["paths"]["/links/{linkId}"]["delete"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "deleteLink"
|
||||
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n workspaceId: \"<value>\",\n});\n\nasync function run() {\n const linkId = \"<value>\";\n \n const result = await dub.delete(linkId);\n\n // Handle the result\n console.log(result)\n}\n\nrun();"
|
||||
- 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: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.count({});
|
||||
|
||||
// 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: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.get({});
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
}
|
||||
|
||||
run();
|
||||
- target: $["paths"]["/analytics/country"]["get"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "getCountryAnalytics"
|
||||
"source": |-
|
||||
import { Dub } from "dub";
|
||||
|
||||
const dub = new Dub({
|
||||
token: "DUB_API_KEY",
|
||||
workspaceId: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.countries({});
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
}
|
||||
|
||||
run();
|
||||
- target: $["paths"]["/analytics/device"]["get"]
|
||||
update:
|
||||
@@ -65,6 +315,95 @@ actions:
|
||||
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: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.list();
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
}
|
||||
|
||||
run();
|
||||
- target: $["paths"]["/workspaces"]["post"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "createWorkspace"
|
||||
"source": |-
|
||||
import { Dub } from "dub";
|
||||
|
||||
const dub = new Dub({
|
||||
token: "DUB_API_KEY",
|
||||
workspaceId: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.create({
|
||||
name: "<value>",
|
||||
slug: "<value>",
|
||||
});
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
}
|
||||
|
||||
run();
|
||||
- target: $["paths"]["/metatags"]["get"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "getMetatags"
|
||||
"source": |-
|
||||
import { Dub } from "dub";
|
||||
|
||||
const dub = new Dub({
|
||||
token: "DUB_API_KEY",
|
||||
workspaceId: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.get({
|
||||
url: "https://dub.co",
|
||||
});
|
||||
|
||||
// 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: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.list({});
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
}
|
||||
|
||||
run();
|
||||
- target: $["paths"]["/analytics/referer"]["get"]
|
||||
update:
|
||||
@@ -87,17 +426,11 @@ actions:
|
||||
}
|
||||
|
||||
run();
|
||||
- target: $["paths"]["/domains/{slug}"]["patch"]
|
||||
- target: $["paths"]["/tags"]["get"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "editDomain"
|
||||
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n workspaceId: \"<value>\",\n});\n\nasync function run() {\n const slug = \"acme.com\";\n const requestBody = {};\n \n const result = await dub.update(slug, requestBody);\n\n // Handle the result\n console.log(result)\n}\n\nrun();"
|
||||
- target: $["paths"]["/links/bulk"]["post"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "bulkCreateLinks"
|
||||
"label": "getTags"
|
||||
"source": |-
|
||||
import { Dub } from "dub";
|
||||
|
||||
@@ -107,11 +440,7 @@ actions:
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.createMany([
|
||||
{
|
||||
url: "https://google/com",
|
||||
},
|
||||
]);
|
||||
const result = await dub.list({});
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
@@ -160,11 +489,11 @@ actions:
|
||||
}
|
||||
|
||||
run();
|
||||
- target: $["paths"]["/workspaces/{idOrSlug}"]["get"]
|
||||
- target: $["paths"]["/analytics/clicks"]["get"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "getWorkspace"
|
||||
"label": "getClicksAnalytics"
|
||||
"source": |-
|
||||
import { Dub } from "dub";
|
||||
|
||||
@@ -174,201 +503,7 @@ actions:
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.get({
|
||||
idOrSlug: "<value>",
|
||||
});
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
}
|
||||
|
||||
run();
|
||||
- target: $["paths"]["/analytics/top_links"]["get"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "getTopLinks"
|
||||
"source": |-
|
||||
import { Dub } from "dub";
|
||||
|
||||
const dub = new Dub({
|
||||
token: "DUB_API_KEY",
|
||||
workspaceId: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.topLinks({});
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
}
|
||||
|
||||
run();
|
||||
- target: $["paths"]["/domains/{slug}"]["delete"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "deleteDomain"
|
||||
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n workspaceId: \"<value>\",\n});\n\nasync function run() {\n const slug = \"acme.com\";\n \n const result = await dub.delete(slug);\n\n // Handle the result\n console.log(result)\n}\n\nrun();"
|
||||
- target: $["paths"]["/analytics/country"]["get"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "getCountryAnalytics"
|
||||
"source": |-
|
||||
import { Dub } from "dub";
|
||||
|
||||
const dub = new Dub({
|
||||
token: "DUB_API_KEY",
|
||||
workspaceId: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.countries({});
|
||||
|
||||
// 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: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.create({
|
||||
tag: "<value>",
|
||||
});
|
||||
|
||||
// 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\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n workspaceId: \"<value>\",\n});\n\nasync function run() {\n const slug = \"acme.com\";\n \n const result = await dub.setPrimary(slug);\n\n // Handle the result\n console.log(result)\n}\n\nrun();"
|
||||
- target: $["paths"]["/qr"]["get"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "getQRCode"
|
||||
"source": |-
|
||||
import { Dub } from "dub";
|
||||
|
||||
const dub = new Dub({
|
||||
token: "DUB_API_KEY",
|
||||
workspaceId: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.get({});
|
||||
|
||||
// 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: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.create({
|
||||
url: "https://google/com",
|
||||
});
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
}
|
||||
|
||||
run();
|
||||
- target: $["paths"]["/links/{linkId}"]["put"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "editLink"
|
||||
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n workspaceId: \"<value>\",\n});\n\nasync function run() {\n const linkId = \"<value>\";\n const requestBody = {\n url: \"https://google/com\",\n };\n \n const result = await dub.update(linkId, requestBody);\n\n // Handle the result\n console.log(result)\n}\n\nrun();"
|
||||
- target: $["paths"]["/domains"]["post"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "addDomain"
|
||||
"source": |-
|
||||
import { Dub } from "dub";
|
||||
|
||||
const dub = new Dub({
|
||||
token: "DUB_API_KEY",
|
||||
workspaceId: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.add({
|
||||
slug: "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: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.count({});
|
||||
|
||||
// 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: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.get({});
|
||||
const result = await dub.clicks({});
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
@@ -396,11 +531,17 @@ actions:
|
||||
}
|
||||
|
||||
run();
|
||||
- target: $["paths"]["/workspaces"]["post"]
|
||||
- target: $["paths"]["/domains/{slug}"]["delete"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "createWorkspace"
|
||||
"label": "deleteDomain"
|
||||
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n workspaceId: \"<value>\",\n});\n\nasync function run() {\n const slug = \"acme.com\";\n \n const result = await dub.delete(slug);\n\n // Handle the result\n console.log(result)\n}\n\nrun();"
|
||||
- target: $["paths"]["/links"]["post"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "createLink"
|
||||
"source": |-
|
||||
import { Dub } from "dub";
|
||||
|
||||
@@ -411,148 +552,7 @@ actions:
|
||||
|
||||
async function run() {
|
||||
const result = await dub.create({
|
||||
name: "<value>",
|
||||
slug: "<value>",
|
||||
});
|
||||
|
||||
// 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: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.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\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n workspaceId: \"<value>\",\n});\n\nasync function run() {\n const slug = \"acme.com\";\n const requestBody = {\n newWorkspaceId: \"<value>\",\n };\n \n const result = await dub.transfer(slug, requestBody);\n\n // Handle the result\n console.log(result)\n}\n\nrun();"
|
||||
- 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: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.list({});
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
}
|
||||
|
||||
run();
|
||||
- target: $["paths"]["/links/{linkId}"]["delete"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "deleteLink"
|
||||
"source": "import { Dub } from \"dub\";\n\nconst dub = new Dub({\n token: \"DUB_API_KEY\",\n workspaceId: \"<value>\",\n});\n\nasync function run() {\n const linkId = \"<value>\";\n \n const result = await dub.delete(linkId);\n\n // Handle the result\n console.log(result)\n}\n\nrun();"
|
||||
- target: $["paths"]["/analytics/city"]["get"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "getCityAnalytics"
|
||||
"source": |-
|
||||
import { Dub } from "dub";
|
||||
|
||||
const dub = new Dub({
|
||||
token: "DUB_API_KEY",
|
||||
workspaceId: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.cities({});
|
||||
|
||||
// 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: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.list();
|
||||
|
||||
// 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: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.list({});
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
}
|
||||
|
||||
run();
|
||||
- target: $["paths"]["/metatags"]["get"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "getMetatags"
|
||||
"source": |-
|
||||
import { Dub } from "dub";
|
||||
|
||||
const dub = new Dub({
|
||||
token: "DUB_API_KEY",
|
||||
workspaceId: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.get({
|
||||
url: "https://dub.co",
|
||||
url: "https://google/com",
|
||||
});
|
||||
|
||||
// Handle the result
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
# EditDomainRequest
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
|
||||
| `slug` | *string* | :heavy_check_mark: | The domain name. | acme.com |
|
||||
| `requestBody` | [operations.EditDomainRequestBody](../../models/operations/editdomainrequestbody.md) | :heavy_minus_sign: | N/A | |
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
|
||||
| `domain` | *string* | :heavy_minus_sign: | N/A | |
|
||||
| `key` | *string* | :heavy_minus_sign: | The key of the link to retrieve. E.g. for `d.to/github`, the key is `github`. | |
|
||||
| `linkId` | *string* | :heavy_minus_sign: | The unique ID of the short link. | clux0rgak00011... |
|
||||
| `externalId` | *string* | :heavy_minus_sign: | This is the ID of the link in the your database. Must be prefixed with `ext_`. when provided. | ext_123456 |
|
||||
| Field | Type | Required | Description | Example |
|
||||
| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
|
||||
| `domain` | *string* | :heavy_minus_sign: | N/A | |
|
||||
| `key` | *string* | :heavy_minus_sign: | The key of the link to retrieve. E.g. for `d.to/github`, the key is `github`. | |
|
||||
| `linkId` | *string* | :heavy_minus_sign: | The unique ID of the short link. | clux0rgak00011... |
|
||||
| `externalId` | *string* | :heavy_minus_sign: | This is the ID of the link in the your database. Must be prefixed with `ext_` when passed as a query parameter. | ext_123456 |
|
||||
9
docs/models/operations/updatedomainrequest.md
Normal file
9
docs/models/operations/updatedomainrequest.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# UpdateDomainRequest
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
|
||||
| `slug` | *string* | :heavy_check_mark: | The domain name. | acme.com |
|
||||
| `requestBody` | [operations.UpdateDomainRequestBody](../../models/operations/updatedomainrequestbody.md) | :heavy_minus_sign: | N/A | |
|
||||
@@ -1,4 +1,4 @@
|
||||
# EditDomainRequestBody
|
||||
# UpdateDomainRequestBody
|
||||
|
||||
|
||||
## Fields
|
||||
@@ -6,7 +6,7 @@
|
||||
| Field | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
|
||||
| `slug` | *string* | :heavy_minus_sign: | Name of the domain. | acme.com |
|
||||
| `type` | [operations.EditDomainType](../../models/operations/editdomaintype.md) | :heavy_minus_sign: | The type of redirect to use for this domain. | redirect |
|
||||
| `type` | [operations.UpdateDomainType](../../models/operations/updatedomaintype.md) | :heavy_minus_sign: | The type of redirect to use for this domain. | redirect |
|
||||
| `target` | *string* | :heavy_minus_sign: | The page your users will get redirected to when they visit your domain. | https://acme.com/landing |
|
||||
| `expiredUrl` | *string* | :heavy_minus_sign: | Redirect users to a specific URL when any link under this domain has expired. | https://acme.com/expired |
|
||||
| `archived` | *boolean* | :heavy_minus_sign: | Whether to archive this domain. `false` will unarchive a previously archived domain. | false |
|
||||
@@ -1,4 +1,4 @@
|
||||
# EditDomainType
|
||||
# UpdateDomainType
|
||||
|
||||
The type of redirect to use for this domain.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# EditLinkGeo
|
||||
# UpdateLinkGeo
|
||||
|
||||
Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`.
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# EditLinkRequest
|
||||
# UpdateLinkRequest
|
||||
|
||||
|
||||
## Fields
|
||||
|
||||
| Field | Type | Required | Description |
|
||||
| ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `linkId` | *string* | :heavy_check_mark: | The id of the link to edit. You may use either `linkId` (obtained via `/links/info` endpoint) or `externalId` prefixed with `ext_`. |
|
||||
| `requestBody` | [operations.EditLinkRequestBody](../../models/operations/editlinkrequestbody.md) | :heavy_minus_sign: | N/A |
|
||||
| Field | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `linkId` | *string* | :heavy_check_mark: | The id of the link to update. You may use either `linkId` (obtained via `/links/info` endpoint) or `externalId` prefixed with `ext_`. |
|
||||
| `requestBody` | [operations.UpdateLinkRequestBody](../../models/operations/updatelinkrequestbody.md) | :heavy_minus_sign: | N/A |
|
||||
@@ -1,4 +1,4 @@
|
||||
# EditLinkRequestBody
|
||||
# UpdateLinkRequestBody
|
||||
|
||||
|
||||
## Fields
|
||||
@@ -13,8 +13,8 @@
|
||||
| `archived` | *boolean* | :heavy_minus_sign: | Whether the short link is archived. | |
|
||||
| `publicStats` | *boolean* | :heavy_minus_sign: | Whether the short link's stats are publicly accessible. | |
|
||||
| ~~`tagId`~~ | *string* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.<br/><br/>The unique ID of the tag assigned to the short link. This field is deprecated – use `tagIds` instead. | |
|
||||
| `tagIds` | *operations.EditLinkTagIds* | :heavy_minus_sign: | The unique IDs of the tags assigned to the short link. | [<br/>"clux0rgak00011..."<br/>] |
|
||||
| `tagNames` | *operations.EditLinkTagNames* | :heavy_minus_sign: | The unique name of the tags assigned to the short link (case insensitive). | |
|
||||
| `tagIds` | *operations.UpdateLinkTagIds* | :heavy_minus_sign: | The unique IDs of the tags assigned to the short link. | [<br/>"clux0rgak00011..."<br/>] |
|
||||
| `tagNames` | *operations.UpdateLinkTagNames* | :heavy_minus_sign: | The unique name of the tags assigned to the short link (case insensitive). | |
|
||||
| `comments` | *string* | :heavy_minus_sign: | The comments for the short link. | |
|
||||
| `expiresAt` | *string* | :heavy_minus_sign: | The date and time when the short link will expire at. | |
|
||||
| `expiredUrl` | *string* | :heavy_minus_sign: | The URL to redirect to when the short link has expired. | |
|
||||
@@ -26,4 +26,4 @@
|
||||
| `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. | |
|
||||
| `geo` | [operations.EditLinkGeo](../../models/operations/editlinkgeo.md) | :heavy_minus_sign: | Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. | |
|
||||
| `geo` | [operations.UpdateLinkGeo](../../models/operations/updatelinkgeo.md) | :heavy_minus_sign: | Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. | |
|
||||
@@ -1,4 +1,4 @@
|
||||
# EditLinkTagIds
|
||||
# UpdateLinkTagIds
|
||||
|
||||
The unique IDs of the tags assigned to the short link.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# EditLinkTagNames
|
||||
# UpdateLinkTagNames
|
||||
|
||||
The unique name of the tags assigned to the short link (case insensitive).
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* [list](#list) - Retrieve a list of domains
|
||||
* [add](#add) - Add a domain
|
||||
* [delete](#delete) - Delete a domain
|
||||
* [update](#update) - Edit a domain
|
||||
* [update](#update) - Update a domain
|
||||
* [setPrimary](#setprimary) - Set a domain as primary
|
||||
* [transfer](#transfer) - Transfer a domain
|
||||
|
||||
@@ -169,7 +169,7 @@ run();
|
||||
|
||||
## update
|
||||
|
||||
Edit a domain for the authenticated workspace.
|
||||
Update a domain for the authenticated workspace.
|
||||
|
||||
### Example Usage
|
||||
|
||||
@@ -199,7 +199,7 @@ run();
|
||||
| Parameter | Type | Required | Description | Example |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `slug` | *string* | :heavy_check_mark: | The domain name. | [object Object] |
|
||||
| `requestBody` | [operations.EditDomainRequestBody](../../models/operations/editdomainrequestbody.md) | :heavy_minus_sign: | N/A | |
|
||||
| `requestBody` | [operations.UpdateDomainRequestBody](../../models/operations/updatedomainrequestbody.md) | :heavy_minus_sign: | N/A | |
|
||||
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | |
|
||||
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | |
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
* [create](#create) - Create a new link
|
||||
* [count](#count) - Retrieve the number of links
|
||||
* [get](#get) - Retrieve a link
|
||||
* [update](#update) - Edit a link
|
||||
* [delete](#delete) - Delete a link
|
||||
* [update](#update) - Update a link
|
||||
* [createMany](#createmany) - Bulk create links
|
||||
|
||||
## list
|
||||
@@ -199,63 +199,6 @@ run();
|
||||
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**Promise<[components.LinkSchema](../../models/components/linkschema.md)>**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| -------------------------- | -------------------------- | -------------------------- |
|
||||
| errors.BadRequest | 400 | application/json |
|
||||
| errors.Unauthorized | 401 | application/json |
|
||||
| errors.Forbidden | 403 | application/json |
|
||||
| errors.NotFound | 404 | application/json |
|
||||
| errors.Conflict | 409 | application/json |
|
||||
| errors.InviteExpired | 410 | application/json |
|
||||
| errors.UnprocessableEntity | 422 | application/json |
|
||||
| errors.RateLimitExceeded | 429 | application/json |
|
||||
| errors.InternalServerError | 500 | application/json |
|
||||
| errors.SDKError | 4xx-5xx | */* |
|
||||
|
||||
## update
|
||||
|
||||
Edit a link for the authenticated workspace.
|
||||
|
||||
### Example Usage
|
||||
|
||||
```typescript
|
||||
import { Dub } from "dub";
|
||||
|
||||
const dub = new Dub({
|
||||
token: "DUB_API_KEY",
|
||||
workspaceId: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const linkId = "<value>";
|
||||
const requestBody = {
|
||||
url: "https://google/com",
|
||||
};
|
||||
|
||||
const result = await dub.links.update(linkId, requestBody);
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
}
|
||||
|
||||
run();
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `linkId` | *string* | :heavy_check_mark: | The id of the link to edit. You may use either `linkId` (obtained via `/links/info` endpoint) or `externalId` prefixed with `ext_`. |
|
||||
| `requestBody` | [operations.EditLinkRequestBody](../../models/operations/editlinkrequestbody.md) | :heavy_minus_sign: | N/A |
|
||||
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
||||
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**Promise<[components.LinkSchema](../../models/components/linkschema.md)>**
|
||||
@@ -327,6 +270,63 @@ run();
|
||||
| errors.InternalServerError | 500 | application/json |
|
||||
| errors.SDKError | 4xx-5xx | */* |
|
||||
|
||||
## update
|
||||
|
||||
Update a link for the authenticated workspace.
|
||||
|
||||
### Example Usage
|
||||
|
||||
```typescript
|
||||
import { Dub } from "dub";
|
||||
|
||||
const dub = new Dub({
|
||||
token: "DUB_API_KEY",
|
||||
workspaceId: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const linkId = "<value>";
|
||||
const requestBody = {
|
||||
url: "https://google/com",
|
||||
};
|
||||
|
||||
const result = await dub.links.update(linkId, requestBody);
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
}
|
||||
|
||||
run();
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| `linkId` | *string* | :heavy_check_mark: | The id of the link to update. You may use either `linkId` (obtained via `/links/info` endpoint) or `externalId` prefixed with `ext_`. |
|
||||
| `requestBody` | [operations.UpdateLinkRequestBody](../../models/operations/updatelinkrequestbody.md) | :heavy_minus_sign: | N/A |
|
||||
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
||||
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**Promise<[components.LinkSchema](../../models/components/linkschema.md)>**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
| -------------------------- | -------------------------- | -------------------------- |
|
||||
| errors.BadRequest | 400 | application/json |
|
||||
| errors.Unauthorized | 401 | application/json |
|
||||
| errors.Forbidden | 403 | application/json |
|
||||
| errors.NotFound | 404 | application/json |
|
||||
| errors.Conflict | 409 | application/json |
|
||||
| errors.InviteExpired | 410 | application/json |
|
||||
| errors.UnprocessableEntity | 422 | application/json |
|
||||
| errors.RateLimitExceeded | 429 | application/json |
|
||||
| errors.InternalServerError | 500 | application/json |
|
||||
| errors.SDKError | 4xx-5xx | */* |
|
||||
|
||||
## createMany
|
||||
|
||||
Bulk create up to 100 links for the authenticated workspace.
|
||||
|
||||
2
jsr.json
2
jsr.json
@@ -2,7 +2,7 @@
|
||||
|
||||
{
|
||||
"name": "dub",
|
||||
"version": "0.26.0",
|
||||
"version": "0.26.1",
|
||||
"exports": {
|
||||
".": "./src/index.ts",
|
||||
"./models/errors": "./src/models/errors/index.ts",
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "dub",
|
||||
"version": "0.26.0",
|
||||
"version": "0.26.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "dub",
|
||||
"version": "0.26.0",
|
||||
"version": "0.26.1",
|
||||
"devDependencies": {
|
||||
"@types/jsonpath": "^0.2.4",
|
||||
"@types/node": "^20.12.7",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "dub",
|
||||
"version": "0.26.0",
|
||||
"version": "0.26.1",
|
||||
"author": "Dub",
|
||||
"main": "./index.js",
|
||||
"sideEffects": false,
|
||||
|
||||
@@ -64,7 +64,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
||||
export const SDK_METADATA = {
|
||||
language: "typescript",
|
||||
openapiDocVersion: "0.0.1",
|
||||
sdkVersion: "0.26.0",
|
||||
genVersion: "2.318.3",
|
||||
userAgent: "speakeasy-sdk/typescript 0.26.0 2.318.3 0.0.1 dub",
|
||||
sdkVersion: "0.26.1",
|
||||
genVersion: "2.322.5",
|
||||
userAgent: "speakeasy-sdk/typescript 0.26.1 2.322.5 0.0.1 dub",
|
||||
} as const;
|
||||
|
||||
@@ -9,7 +9,17 @@ export type Fetcher = (
|
||||
|
||||
export type Awaitable<T> = T | Promise<T>;
|
||||
|
||||
const DEFAULT_FETCHER: Fetcher = (input, init) => fetch(input, init);
|
||||
const DEFAULT_FETCHER: Fetcher = (input, init) => {
|
||||
// If input is a Request and init is undefined, Bun will discard the method,
|
||||
// headers, body and other options that were set on the request object.
|
||||
// Node.js and browers would ignore an undefined init value. This check is
|
||||
// therefore needed for interop with Bun.
|
||||
if (init == null) {
|
||||
return fetch(input);
|
||||
} else {
|
||||
return fetch(input, init);
|
||||
}
|
||||
};
|
||||
|
||||
export type RequestInput = {
|
||||
/**
|
||||
|
||||
@@ -15,7 +15,7 @@ export type GetLinkInfoRequest = {
|
||||
*/
|
||||
linkId?: string | undefined;
|
||||
/**
|
||||
* This is the ID of the link in the your database. Must be prefixed with `ext_`. when provided.
|
||||
* This is the ID of the link in the your database. Must be prefixed with `ext_` when passed as a query parameter.
|
||||
*/
|
||||
externalId?: string | undefined;
|
||||
};
|
||||
|
||||
@@ -9,8 +9,6 @@ export * from "./createtag";
|
||||
export * from "./createworkspace";
|
||||
export * from "./deletedomain";
|
||||
export * from "./deletelink";
|
||||
export * from "./editdomain";
|
||||
export * from "./editlink";
|
||||
export * from "./getbrowseranalytics";
|
||||
export * from "./getcityanalytics";
|
||||
export * from "./getclicksanalytics";
|
||||
@@ -31,3 +29,5 @@ export * from "./getworkspace";
|
||||
export * from "./listdomains";
|
||||
export * from "./setprimarydomain";
|
||||
export * from "./transferdomain";
|
||||
export * from "./updatedomain";
|
||||
export * from "./updatelink";
|
||||
|
||||
@@ -7,16 +7,16 @@ import * as z from "zod";
|
||||
/**
|
||||
* The type of redirect to use for this domain.
|
||||
*/
|
||||
export const EditDomainType = {
|
||||
export const UpdateDomainType = {
|
||||
Redirect: "redirect",
|
||||
Rewrite: "rewrite",
|
||||
} as const;
|
||||
/**
|
||||
* The type of redirect to use for this domain.
|
||||
*/
|
||||
export type EditDomainType = (typeof EditDomainType)[keyof typeof EditDomainType];
|
||||
export type UpdateDomainType = (typeof UpdateDomainType)[keyof typeof UpdateDomainType];
|
||||
|
||||
export type EditDomainRequestBody = {
|
||||
export type UpdateDomainRequestBody = {
|
||||
/**
|
||||
* Name of the domain.
|
||||
*/
|
||||
@@ -24,7 +24,7 @@ export type EditDomainRequestBody = {
|
||||
/**
|
||||
* The type of redirect to use for this domain.
|
||||
*/
|
||||
type?: EditDomainType | undefined;
|
||||
type?: UpdateDomainType | undefined;
|
||||
/**
|
||||
* The page your users will get redirected to when they visit your domain.
|
||||
*/
|
||||
@@ -43,32 +43,33 @@ export type EditDomainRequestBody = {
|
||||
placeholder?: string | null | undefined;
|
||||
};
|
||||
|
||||
export type EditDomainRequest = {
|
||||
export type UpdateDomainRequest = {
|
||||
/**
|
||||
* The domain name.
|
||||
*/
|
||||
slug: string;
|
||||
requestBody?: EditDomainRequestBody | undefined;
|
||||
requestBody?: UpdateDomainRequestBody | undefined;
|
||||
};
|
||||
|
||||
/** @internal */
|
||||
export const EditDomainType$: z.ZodNativeEnum<typeof EditDomainType> = z.nativeEnum(EditDomainType);
|
||||
export const UpdateDomainType$: z.ZodNativeEnum<typeof UpdateDomainType> =
|
||||
z.nativeEnum(UpdateDomainType);
|
||||
|
||||
/** @internal */
|
||||
export namespace EditDomainRequestBody$ {
|
||||
export namespace UpdateDomainRequestBody$ {
|
||||
export type Inbound = {
|
||||
slug?: string | undefined;
|
||||
type?: EditDomainType | undefined;
|
||||
type?: UpdateDomainType | undefined;
|
||||
target?: string | null | undefined;
|
||||
expiredUrl?: string | null | undefined;
|
||||
archived?: boolean | undefined;
|
||||
placeholder?: string | null | undefined;
|
||||
};
|
||||
|
||||
export const inboundSchema: z.ZodType<EditDomainRequestBody, z.ZodTypeDef, Inbound> = z
|
||||
export const inboundSchema: z.ZodType<UpdateDomainRequestBody, z.ZodTypeDef, Inbound> = z
|
||||
.object({
|
||||
slug: z.string().optional(),
|
||||
type: EditDomainType$.default("redirect"),
|
||||
type: UpdateDomainType$.default("redirect"),
|
||||
target: z.nullable(z.string()).optional(),
|
||||
expiredUrl: z.nullable(z.string()).optional(),
|
||||
archived: z.boolean().default(false),
|
||||
@@ -87,17 +88,17 @@ export namespace EditDomainRequestBody$ {
|
||||
|
||||
export type Outbound = {
|
||||
slug?: string | undefined;
|
||||
type: EditDomainType;
|
||||
type: UpdateDomainType;
|
||||
target?: string | null | undefined;
|
||||
expiredUrl?: string | null | undefined;
|
||||
archived: boolean;
|
||||
placeholder: string | null;
|
||||
};
|
||||
|
||||
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, EditDomainRequestBody> = z
|
||||
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, UpdateDomainRequestBody> = z
|
||||
.object({
|
||||
slug: z.string().optional(),
|
||||
type: EditDomainType$.default("redirect"),
|
||||
type: UpdateDomainType$.default("redirect"),
|
||||
target: z.nullable(z.string()).optional(),
|
||||
expiredUrl: z.nullable(z.string()).optional(),
|
||||
archived: z.boolean().default(false),
|
||||
@@ -116,16 +117,16 @@ export namespace EditDomainRequestBody$ {
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export namespace EditDomainRequest$ {
|
||||
export namespace UpdateDomainRequest$ {
|
||||
export type Inbound = {
|
||||
slug: string;
|
||||
RequestBody?: EditDomainRequestBody$.Inbound | undefined;
|
||||
RequestBody?: UpdateDomainRequestBody$.Inbound | undefined;
|
||||
};
|
||||
|
||||
export const inboundSchema: z.ZodType<EditDomainRequest, z.ZodTypeDef, Inbound> = z
|
||||
export const inboundSchema: z.ZodType<UpdateDomainRequest, z.ZodTypeDef, Inbound> = z
|
||||
.object({
|
||||
slug: z.string(),
|
||||
RequestBody: z.lazy(() => EditDomainRequestBody$.inboundSchema).optional(),
|
||||
RequestBody: z.lazy(() => UpdateDomainRequestBody$.inboundSchema).optional(),
|
||||
})
|
||||
.transform((v) => {
|
||||
return {
|
||||
@@ -136,13 +137,13 @@ export namespace EditDomainRequest$ {
|
||||
|
||||
export type Outbound = {
|
||||
slug: string;
|
||||
RequestBody?: EditDomainRequestBody$.Outbound | undefined;
|
||||
RequestBody?: UpdateDomainRequestBody$.Outbound | undefined;
|
||||
};
|
||||
|
||||
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, EditDomainRequest> = z
|
||||
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, UpdateDomainRequest> = z
|
||||
.object({
|
||||
slug: z.string(),
|
||||
requestBody: z.lazy(() => EditDomainRequestBody$.outboundSchema).optional(),
|
||||
requestBody: z.lazy(() => UpdateDomainRequestBody$.outboundSchema).optional(),
|
||||
})
|
||||
.transform((v) => {
|
||||
return {
|
||||
@@ -7,17 +7,17 @@ import * as z from "zod";
|
||||
/**
|
||||
* The unique IDs of the tags assigned to the short link.
|
||||
*/
|
||||
export type EditLinkTagIds = string | Array<string>;
|
||||
export type UpdateLinkTagIds = string | Array<string>;
|
||||
|
||||
/**
|
||||
* The unique name of the tags assigned to the short link (case insensitive).
|
||||
*/
|
||||
export type EditLinkTagNames = string | Array<string>;
|
||||
export type UpdateLinkTagNames = string | Array<string>;
|
||||
|
||||
/**
|
||||
* Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`.
|
||||
*/
|
||||
export type EditLinkGeo = {
|
||||
export type UpdateLinkGeo = {
|
||||
af?: string | undefined;
|
||||
al?: string | undefined;
|
||||
dz?: string | undefined;
|
||||
@@ -270,7 +270,7 @@ export type EditLinkGeo = {
|
||||
xk?: string | undefined;
|
||||
};
|
||||
|
||||
export type EditLinkRequestBody = {
|
||||
export type UpdateLinkRequestBody = {
|
||||
/**
|
||||
* The destination URL of the short link.
|
||||
*/
|
||||
@@ -360,49 +360,49 @@ export type EditLinkRequestBody = {
|
||||
/**
|
||||
* Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`.
|
||||
*/
|
||||
geo?: EditLinkGeo | null | undefined;
|
||||
geo?: UpdateLinkGeo | null | undefined;
|
||||
};
|
||||
|
||||
export type EditLinkRequest = {
|
||||
export type UpdateLinkRequest = {
|
||||
/**
|
||||
* The id of the link to edit. You may use either `linkId` (obtained via `/links/info` endpoint) or `externalId` prefixed with `ext_`.
|
||||
* The id of the link to update. You may use either `linkId` (obtained via `/links/info` endpoint) or `externalId` prefixed with `ext_`.
|
||||
*/
|
||||
linkId: string;
|
||||
requestBody?: EditLinkRequestBody | undefined;
|
||||
requestBody?: UpdateLinkRequestBody | undefined;
|
||||
};
|
||||
|
||||
/** @internal */
|
||||
export namespace EditLinkTagIds$ {
|
||||
export namespace UpdateLinkTagIds$ {
|
||||
export type Inbound = string | Array<string>;
|
||||
|
||||
export type Outbound = string | Array<string>;
|
||||
export const inboundSchema: z.ZodType<EditLinkTagIds, z.ZodTypeDef, Inbound> = z.union([
|
||||
export const inboundSchema: z.ZodType<UpdateLinkTagIds, z.ZodTypeDef, Inbound> = z.union([
|
||||
z.string(),
|
||||
z.array(z.string()),
|
||||
]);
|
||||
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, EditLinkTagIds> = z.union([
|
||||
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, UpdateLinkTagIds> = z.union([
|
||||
z.string(),
|
||||
z.array(z.string()),
|
||||
]);
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export namespace EditLinkTagNames$ {
|
||||
export namespace UpdateLinkTagNames$ {
|
||||
export type Inbound = string | Array<string>;
|
||||
|
||||
export type Outbound = string | Array<string>;
|
||||
export const inboundSchema: z.ZodType<EditLinkTagNames, z.ZodTypeDef, Inbound> = z.union([
|
||||
export const inboundSchema: z.ZodType<UpdateLinkTagNames, z.ZodTypeDef, Inbound> = z.union([
|
||||
z.string(),
|
||||
z.array(z.string()),
|
||||
]);
|
||||
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, EditLinkTagNames> = z.union([
|
||||
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, UpdateLinkTagNames> = z.union([
|
||||
z.string(),
|
||||
z.array(z.string()),
|
||||
]);
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export namespace EditLinkGeo$ {
|
||||
export namespace UpdateLinkGeo$ {
|
||||
export type Inbound = {
|
||||
AF?: string | undefined;
|
||||
AL?: string | undefined;
|
||||
@@ -656,7 +656,7 @@ export namespace EditLinkGeo$ {
|
||||
XK?: string | undefined;
|
||||
};
|
||||
|
||||
export const inboundSchema: z.ZodType<EditLinkGeo, z.ZodTypeDef, Inbound> = z
|
||||
export const inboundSchema: z.ZodType<UpdateLinkGeo, z.ZodTypeDef, Inbound> = z
|
||||
.object({
|
||||
AF: z.string().optional(),
|
||||
AL: z.string().optional(),
|
||||
@@ -1417,7 +1417,7 @@ export namespace EditLinkGeo$ {
|
||||
XK?: string | undefined;
|
||||
};
|
||||
|
||||
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, EditLinkGeo> = z
|
||||
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, UpdateLinkGeo> = z
|
||||
.object({
|
||||
af: z.string().optional(),
|
||||
al: z.string().optional(),
|
||||
@@ -1927,7 +1927,7 @@ export namespace EditLinkGeo$ {
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export namespace EditLinkRequestBody$ {
|
||||
export namespace UpdateLinkRequestBody$ {
|
||||
export type Inbound = {
|
||||
url: string;
|
||||
domain?: string | undefined;
|
||||
@@ -1950,10 +1950,10 @@ export namespace EditLinkRequestBody$ {
|
||||
rewrite?: boolean | undefined;
|
||||
ios?: string | null | undefined;
|
||||
android?: string | null | undefined;
|
||||
geo?: EditLinkGeo$.Inbound | null | undefined;
|
||||
geo?: UpdateLinkGeo$.Inbound | null | undefined;
|
||||
};
|
||||
|
||||
export const inboundSchema: z.ZodType<EditLinkRequestBody, z.ZodTypeDef, Inbound> = z
|
||||
export const inboundSchema: z.ZodType<UpdateLinkRequestBody, z.ZodTypeDef, Inbound> = z
|
||||
.object({
|
||||
url: z.string(),
|
||||
domain: z.string().optional(),
|
||||
@@ -1976,7 +1976,7 @@ export namespace EditLinkRequestBody$ {
|
||||
rewrite: z.boolean().default(false),
|
||||
ios: z.nullable(z.string()).optional(),
|
||||
android: z.nullable(z.string()).optional(),
|
||||
geo: z.nullable(z.lazy(() => EditLinkGeo$.inboundSchema)).optional(),
|
||||
geo: z.nullable(z.lazy(() => UpdateLinkGeo$.inboundSchema)).optional(),
|
||||
})
|
||||
.transform((v) => {
|
||||
return {
|
||||
@@ -2027,10 +2027,10 @@ export namespace EditLinkRequestBody$ {
|
||||
rewrite: boolean;
|
||||
ios?: string | null | undefined;
|
||||
android?: string | null | undefined;
|
||||
geo?: EditLinkGeo$.Outbound | null | undefined;
|
||||
geo?: UpdateLinkGeo$.Outbound | null | undefined;
|
||||
};
|
||||
|
||||
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, EditLinkRequestBody> = z
|
||||
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, UpdateLinkRequestBody> = z
|
||||
.object({
|
||||
url: z.string(),
|
||||
domain: z.string().optional(),
|
||||
@@ -2053,7 +2053,7 @@ export namespace EditLinkRequestBody$ {
|
||||
rewrite: z.boolean().default(false),
|
||||
ios: z.nullable(z.string()).optional(),
|
||||
android: z.nullable(z.string()).optional(),
|
||||
geo: z.nullable(z.lazy(() => EditLinkGeo$.outboundSchema)).optional(),
|
||||
geo: z.nullable(z.lazy(() => UpdateLinkGeo$.outboundSchema)).optional(),
|
||||
})
|
||||
.transform((v) => {
|
||||
return {
|
||||
@@ -2084,16 +2084,16 @@ export namespace EditLinkRequestBody$ {
|
||||
}
|
||||
|
||||
/** @internal */
|
||||
export namespace EditLinkRequest$ {
|
||||
export namespace UpdateLinkRequest$ {
|
||||
export type Inbound = {
|
||||
linkId: string;
|
||||
RequestBody?: EditLinkRequestBody$.Inbound | undefined;
|
||||
RequestBody?: UpdateLinkRequestBody$.Inbound | undefined;
|
||||
};
|
||||
|
||||
export const inboundSchema: z.ZodType<EditLinkRequest, z.ZodTypeDef, Inbound> = z
|
||||
export const inboundSchema: z.ZodType<UpdateLinkRequest, z.ZodTypeDef, Inbound> = z
|
||||
.object({
|
||||
linkId: z.string(),
|
||||
RequestBody: z.lazy(() => EditLinkRequestBody$.inboundSchema).optional(),
|
||||
RequestBody: z.lazy(() => UpdateLinkRequestBody$.inboundSchema).optional(),
|
||||
})
|
||||
.transform((v) => {
|
||||
return {
|
||||
@@ -2104,13 +2104,13 @@ export namespace EditLinkRequest$ {
|
||||
|
||||
export type Outbound = {
|
||||
linkId: string;
|
||||
RequestBody?: EditLinkRequestBody$.Outbound | undefined;
|
||||
RequestBody?: UpdateLinkRequestBody$.Outbound | undefined;
|
||||
};
|
||||
|
||||
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, EditLinkRequest> = z
|
||||
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, UpdateLinkRequest> = z
|
||||
.object({
|
||||
linkId: z.string(),
|
||||
requestBody: z.lazy(() => EditLinkRequestBody$.outboundSchema).optional(),
|
||||
requestBody: z.lazy(() => UpdateLinkRequestBody$.outboundSchema).optional(),
|
||||
})
|
||||
.transform((v) => {
|
||||
return {
|
||||
@@ -722,17 +722,17 @@ export class Domains extends ClientSDK {
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit a domain
|
||||
* Update a domain
|
||||
*
|
||||
* @remarks
|
||||
* Edit a domain for the authenticated workspace.
|
||||
* Update a domain for the authenticated workspace.
|
||||
*/
|
||||
async update(
|
||||
slug: string,
|
||||
requestBody?: operations.EditDomainRequestBody | undefined,
|
||||
requestBody?: operations.UpdateDomainRequestBody | undefined,
|
||||
options?: RequestOptions
|
||||
): Promise<components.DomainSchema> {
|
||||
const input$: operations.EditDomainRequest = {
|
||||
const input$: operations.UpdateDomainRequest = {
|
||||
slug: slug,
|
||||
requestBody: requestBody,
|
||||
};
|
||||
@@ -743,7 +743,7 @@ export class Domains extends ClientSDK {
|
||||
|
||||
const payload$ = schemas$.parse(
|
||||
input$,
|
||||
(value$) => operations.EditDomainRequest$.outboundSchema.parse(value$),
|
||||
(value$) => operations.UpdateDomainRequest$.outboundSchema.parse(value$),
|
||||
"Input validation failed"
|
||||
);
|
||||
const body$ = enc$.encodeJSON("body", payload$.RequestBody, { explode: true });
|
||||
@@ -778,7 +778,7 @@ export class Domains extends ClientSDK {
|
||||
security$ = {};
|
||||
}
|
||||
const context = {
|
||||
operationID: "editDomain",
|
||||
operationID: "updateDomain",
|
||||
oAuth2Scopes: [],
|
||||
securitySource: this.options$.token,
|
||||
};
|
||||
|
||||
@@ -991,31 +991,28 @@ export class Links extends ClientSDK {
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit a link
|
||||
* Delete a link
|
||||
*
|
||||
* @remarks
|
||||
* Edit a link for the authenticated workspace.
|
||||
* Delete a link for the authenticated workspace.
|
||||
*/
|
||||
async update(
|
||||
async delete(
|
||||
linkId: string,
|
||||
requestBody?: operations.EditLinkRequestBody | undefined,
|
||||
options?: RequestOptions
|
||||
): Promise<components.LinkSchema> {
|
||||
const input$: operations.EditLinkRequest = {
|
||||
): Promise<operations.DeleteLinkResponseBody> {
|
||||
const input$: operations.DeleteLinkRequest = {
|
||||
linkId: linkId,
|
||||
requestBody: requestBody,
|
||||
};
|
||||
const headers$ = new Headers();
|
||||
headers$.set("user-agent", SDK_METADATA.userAgent);
|
||||
headers$.set("Content-Type", "application/json");
|
||||
headers$.set("Accept", "application/json");
|
||||
|
||||
const payload$ = schemas$.parse(
|
||||
input$,
|
||||
(value$) => operations.EditLinkRequest$.outboundSchema.parse(value$),
|
||||
(value$) => operations.DeleteLinkRequest$.outboundSchema.parse(value$),
|
||||
"Input validation failed"
|
||||
);
|
||||
const body$ = enc$.encodeJSON("body", payload$.RequestBody, { explode: true });
|
||||
const body$ = null;
|
||||
|
||||
const pathParams$ = {
|
||||
linkId: enc$.encodeSimple("linkId", payload$.linkId, {
|
||||
@@ -1047,7 +1044,7 @@ export class Links extends ClientSDK {
|
||||
security$ = {};
|
||||
}
|
||||
const context = {
|
||||
operationID: "editLink",
|
||||
operationID: "deleteLink",
|
||||
oAuth2Scopes: [],
|
||||
securitySource: this.options$.token,
|
||||
};
|
||||
@@ -1073,7 +1070,7 @@ export class Links extends ClientSDK {
|
||||
context,
|
||||
{
|
||||
security: securitySettings$,
|
||||
method: "PUT",
|
||||
method: "DELETE",
|
||||
path: path$,
|
||||
headers: headers$,
|
||||
query: query$,
|
||||
@@ -1096,7 +1093,7 @@ export class Links extends ClientSDK {
|
||||
const result = schemas$.parse(
|
||||
responseBody,
|
||||
(val$) => {
|
||||
return components.LinkSchema$.inboundSchema.parse(val$);
|
||||
return operations.DeleteLinkResponseBody$.inboundSchema.parse(val$);
|
||||
},
|
||||
"Response validation failed"
|
||||
);
|
||||
@@ -1229,28 +1226,31 @@ export class Links extends ClientSDK {
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a link
|
||||
* Update a link
|
||||
*
|
||||
* @remarks
|
||||
* Delete a link for the authenticated workspace.
|
||||
* Update a link for the authenticated workspace.
|
||||
*/
|
||||
async delete(
|
||||
async update(
|
||||
linkId: string,
|
||||
requestBody?: operations.UpdateLinkRequestBody | undefined,
|
||||
options?: RequestOptions
|
||||
): Promise<operations.DeleteLinkResponseBody> {
|
||||
const input$: operations.DeleteLinkRequest = {
|
||||
): Promise<components.LinkSchema> {
|
||||
const input$: operations.UpdateLinkRequest = {
|
||||
linkId: linkId,
|
||||
requestBody: requestBody,
|
||||
};
|
||||
const headers$ = new Headers();
|
||||
headers$.set("user-agent", SDK_METADATA.userAgent);
|
||||
headers$.set("Content-Type", "application/json");
|
||||
headers$.set("Accept", "application/json");
|
||||
|
||||
const payload$ = schemas$.parse(
|
||||
input$,
|
||||
(value$) => operations.DeleteLinkRequest$.outboundSchema.parse(value$),
|
||||
(value$) => operations.UpdateLinkRequest$.outboundSchema.parse(value$),
|
||||
"Input validation failed"
|
||||
);
|
||||
const body$ = null;
|
||||
const body$ = enc$.encodeJSON("body", payload$.RequestBody, { explode: true });
|
||||
|
||||
const pathParams$ = {
|
||||
linkId: enc$.encodeSimple("linkId", payload$.linkId, {
|
||||
@@ -1282,7 +1282,7 @@ export class Links extends ClientSDK {
|
||||
security$ = {};
|
||||
}
|
||||
const context = {
|
||||
operationID: "deleteLink",
|
||||
operationID: "updateLink",
|
||||
oAuth2Scopes: [],
|
||||
securitySource: this.options$.token,
|
||||
};
|
||||
@@ -1308,7 +1308,7 @@ export class Links extends ClientSDK {
|
||||
context,
|
||||
{
|
||||
security: securitySettings$,
|
||||
method: "DELETE",
|
||||
method: "PATCH",
|
||||
path: path$,
|
||||
headers: headers$,
|
||||
query: query$,
|
||||
@@ -1331,7 +1331,7 @@ export class Links extends ClientSDK {
|
||||
const result = schemas$.parse(
|
||||
responseBody,
|
||||
(val$) => {
|
||||
return operations.DeleteLinkResponseBody$.inboundSchema.parse(val$);
|
||||
return components.LinkSchema$.inboundSchema.parse(val$);
|
||||
},
|
||||
"Response validation failed"
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user