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.274.1 (#91)
Co-authored-by: speakeasybot <bot@speakeasyapi.dev>
This commit is contained in:
committed by
GitHub
parent
bc0ce5a04a
commit
242ccbda10
@@ -3,10 +3,10 @@ id: f28179cc-ef59-426d-9e85-60cec22fc642
|
||||
management:
|
||||
docChecksum: f62cc4d5545e36a4e97e221748501663
|
||||
docVersion: 0.0.1
|
||||
speakeasyVersion: 1.272.2
|
||||
generationVersion: 2.312.1
|
||||
releaseVersion: 0.24.6
|
||||
configChecksum: 9712e5c733f4acb8472f37101f9293dc
|
||||
speakeasyVersion: 1.274.1
|
||||
generationVersion: 2.314.0
|
||||
releaseVersion: 0.25.0
|
||||
configChecksum: 30642fe6dce694be4bd19b050af01108
|
||||
repoURL: https://github.com/dubinc/dub-node.git
|
||||
installationURL: https://github.com/dubinc/dub-node
|
||||
published: true
|
||||
@@ -14,7 +14,7 @@ features:
|
||||
typescript:
|
||||
acceptHeaders: 2.81.1
|
||||
constsAndDefaults: 0.1.5
|
||||
core: 3.8.0
|
||||
core: 3.9.0
|
||||
deprecations: 2.81.1
|
||||
examples: 2.81.3
|
||||
flattening: 2.81.1
|
||||
|
||||
@@ -12,7 +12,7 @@ generation:
|
||||
auth:
|
||||
oAuth2ClientCredentialsEnabled: false
|
||||
typescript:
|
||||
version: 0.24.6
|
||||
version: 0.25.0
|
||||
additionalDependencies:
|
||||
dependencies: {}
|
||||
devDependencies:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
speakeasyVersion: 1.272.2
|
||||
speakeasyVersion: 1.274.1
|
||||
sources:
|
||||
my-first-source: {}
|
||||
targets:
|
||||
|
||||
12
RELEASES.md
12
RELEASES.md
@@ -176,4 +176,14 @@ Based on:
|
||||
### Generated
|
||||
- [typescript v0.24.6] .
|
||||
### Releases
|
||||
- [NPM v0.24.6] https://www.npmjs.com/package/dub/v/0.24.6 - .
|
||||
- [NPM v0.24.6] https://www.npmjs.com/package/dub/v/0.24.6 - .
|
||||
|
||||
## 2024-04-25 01:14:19
|
||||
### Changes
|
||||
Based on:
|
||||
- OpenAPI Doc
|
||||
- Speakeasy CLI 1.274.1 (2.314.0) https://github.com/speakeasy-api/speakeasy
|
||||
### Generated
|
||||
- [typescript v0.25.0] .
|
||||
### Releases
|
||||
- [NPM v0.25.0] https://www.npmjs.com/package/dub/v/0.25.0 - .
|
||||
648
codeSamples.yaml
648
codeSamples.yaml
@@ -3,11 +3,11 @@ info:
|
||||
title: CodeSamples overlay for typescript target
|
||||
version: 0.0.0
|
||||
actions:
|
||||
- target: $["paths"]["/domains"]["post"]
|
||||
- target: $["paths"]["/analytics/os"]["get"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "addDomain"
|
||||
"label": "getOSAnalytics"
|
||||
"source": |-
|
||||
import { Dub } from "dub";
|
||||
|
||||
@@ -17,218 +17,7 @@ actions:
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.add({
|
||||
slug: "acme.com",
|
||||
});
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
}
|
||||
|
||||
run();
|
||||
- target: $["paths"]["/tags"]["get"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "getTags"
|
||||
"source": |-
|
||||
import { Dub } from "dub";
|
||||
|
||||
const dub = new Dub({
|
||||
token: "DUB_API_KEY",
|
||||
workspaceId: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.list({});
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
}
|
||||
|
||||
run();
|
||||
- target: $["paths"]["/analytics/timeseries"]["get"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "getTimeseriesAnalytics"
|
||||
"source": |-
|
||||
import { Dub } from "dub";
|
||||
|
||||
const dub = new Dub({
|
||||
token: "DUB_API_KEY",
|
||||
workspaceId: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.timeseries({});
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
}
|
||||
|
||||
run();
|
||||
- target: $["paths"]["/analytics/device"]["get"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "getDeviceAnalytics"
|
||||
"source": |-
|
||||
import { Dub } from "dub";
|
||||
|
||||
const dub = new Dub({
|
||||
token: "DUB_API_KEY",
|
||||
workspaceId: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.devices({});
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
}
|
||||
|
||||
run();
|
||||
- target: $["paths"]["/analytics/browser"]["get"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "getBrowserAnalytics"
|
||||
"source": |-
|
||||
import { Dub } from "dub";
|
||||
|
||||
const dub = new Dub({
|
||||
token: "DUB_API_KEY",
|
||||
workspaceId: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.browsers({});
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
}
|
||||
|
||||
run();
|
||||
- target: $["paths"]["/analytics/top_urls"]["get"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "getTopURLs"
|
||||
"source": |-
|
||||
import { Dub } from "dub";
|
||||
|
||||
const dub = new Dub({
|
||||
token: "DUB_API_KEY",
|
||||
workspaceId: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.topUrls({});
|
||||
|
||||
// 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"]["/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}"]["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/referer"]["get"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "getRefererAnalytics"
|
||||
"source": |-
|
||||
import { Dub } from "dub";
|
||||
|
||||
const dub = new Dub({
|
||||
token: "DUB_API_KEY",
|
||||
workspaceId: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.referers({});
|
||||
|
||||
// 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}/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({});
|
||||
const result = await dub.os({});
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
@@ -259,17 +48,11 @@ actions:
|
||||
}
|
||||
|
||||
run();
|
||||
- target: $["paths"]["/domains/{slug}"]["patch"]
|
||||
- target: $["paths"]["/domains"]["post"]
|
||||
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"]["/workspaces"]["get"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "getWorkspaces"
|
||||
"label": "addDomain"
|
||||
"source": |-
|
||||
import { Dub } from "dub";
|
||||
|
||||
@@ -279,7 +62,30 @@ actions:
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.list();
|
||||
const result = await dub.add({
|
||||
slug: "acme.com",
|
||||
});
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
}
|
||||
|
||||
run();
|
||||
- target: $["paths"]["/analytics/browser"]["get"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "getBrowserAnalytics"
|
||||
"source": |-
|
||||
import { Dub } from "dub";
|
||||
|
||||
const dub = new Dub({
|
||||
token: "DUB_API_KEY",
|
||||
workspaceId: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.browsers({});
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
@@ -307,29 +113,12 @@ actions:
|
||||
}
|
||||
|
||||
run();
|
||||
- target: $["paths"]["/tags"]["post"]
|
||||
- target: $["paths"]["/links/{linkId}"]["delete"]
|
||||
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();
|
||||
"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"]["/qr"]["get"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
@@ -350,6 +139,144 @@ actions:
|
||||
console.log(result)
|
||||
}
|
||||
|
||||
run();
|
||||
- target: $["paths"]["/analytics/device"]["get"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "getDeviceAnalytics"
|
||||
"source": |-
|
||||
import { Dub } from "dub";
|
||||
|
||||
const dub = new Dub({
|
||||
token: "DUB_API_KEY",
|
||||
workspaceId: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.devices({});
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
}
|
||||
|
||||
run();
|
||||
- target: $["paths"]["/analytics/referer"]["get"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "getRefererAnalytics"
|
||||
"source": |-
|
||||
import { Dub } from "dub";
|
||||
|
||||
const dub = new Dub({
|
||||
token: "DUB_API_KEY",
|
||||
workspaceId: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.referers({});
|
||||
|
||||
// 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}"]["patch"]
|
||||
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/{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"]["/analytics/timeseries"]["get"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "getTimeseriesAnalytics"
|
||||
"source": |-
|
||||
import { Dub } from "dub";
|
||||
|
||||
const dub = new Dub({
|
||||
token: "DUB_API_KEY",
|
||||
workspaceId: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.timeseries({});
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
}
|
||||
|
||||
run();
|
||||
- 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"]["/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:
|
||||
@@ -375,12 +302,6 @@ actions:
|
||||
}
|
||||
|
||||
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"]["/links/bulk"]["post"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
@@ -406,11 +327,11 @@ actions:
|
||||
}
|
||||
|
||||
run();
|
||||
- target: $["paths"]["/domains"]["get"]
|
||||
- target: $["paths"]["/analytics/top_urls"]["get"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "listDomains"
|
||||
"label": "getTopURLs"
|
||||
"source": |-
|
||||
import { Dub } from "dub";
|
||||
|
||||
@@ -420,81 +341,18 @@ actions:
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.list({});
|
||||
const result = await dub.topUrls({});
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
}
|
||||
|
||||
run();
|
||||
- target: $["paths"]["/links/count"]["get"]
|
||||
- target: $["paths"]["/workspaces/{idOrSlug}"]["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"]["/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/os"]["get"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "getOSAnalytics"
|
||||
"source": |-
|
||||
import { Dub } from "dub";
|
||||
|
||||
const dub = new Dub({
|
||||
token: "DUB_API_KEY",
|
||||
workspaceId: "<value>",
|
||||
});
|
||||
|
||||
async function run() {
|
||||
const result = await dub.os({});
|
||||
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
}
|
||||
|
||||
run();
|
||||
- target: $["paths"]["/metatags"]["get"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "getMetatags"
|
||||
"label": "getWorkspace"
|
||||
"source": |-
|
||||
import { Dub } from "dub";
|
||||
|
||||
@@ -505,7 +363,36 @@ actions:
|
||||
|
||||
async function run() {
|
||||
const result = await dub.get({
|
||||
url: "https://dub.co",
|
||||
idOrSlug: "<value>",
|
||||
});
|
||||
|
||||
// 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"]["/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
|
||||
@@ -534,17 +421,88 @@ actions:
|
||||
}
|
||||
|
||||
run();
|
||||
- target: $["paths"]["/domains/{slug}"]["delete"]
|
||||
- target: $["paths"]["/analytics/top_links"]["get"]
|
||||
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"]["/workspaces/{idOrSlug}"]["get"]
|
||||
"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"]["/tags"]["post"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "getWorkspace"
|
||||
"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"]["/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"]["/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"]["/metatags"]["get"]
|
||||
update:
|
||||
"x-codeSamples":
|
||||
- "lang": "typescript"
|
||||
"label": "getMetatags"
|
||||
"source": |-
|
||||
import { Dub } from "dub";
|
||||
|
||||
@@ -555,11 +513,53 @@ actions:
|
||||
|
||||
async function run() {
|
||||
const result = await dub.get({
|
||||
idOrSlug: "<value>",
|
||||
url: "https://dub.co",
|
||||
});
|
||||
|
||||
// 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();
|
||||
|
||||
3
jsr.json
3
jsr.json
@@ -2,7 +2,7 @@
|
||||
|
||||
{
|
||||
"name": "dub",
|
||||
"version": "0.24.6",
|
||||
"version": "0.25.0",
|
||||
"exports": {
|
||||
".": "./src/index.ts",
|
||||
"./models/errors": "./src/models/errors/index.ts",
|
||||
@@ -20,6 +20,7 @@
|
||||
"README.md",
|
||||
"RUNTIMES.md",
|
||||
"USAGE.md",
|
||||
"jsr.json",
|
||||
"src/**/*.ts"
|
||||
]
|
||||
}
|
||||
|
||||
168
package-lock.json
generated
168
package-lock.json
generated
@@ -1,23 +1,23 @@
|
||||
{
|
||||
"name": "dub",
|
||||
"version": "0.24.6",
|
||||
"version": "0.25.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "dub",
|
||||
"version": "0.24.6",
|
||||
"version": "0.25.0",
|
||||
"devDependencies": {
|
||||
"@types/jsonpath": "^0.2.4",
|
||||
"@types/node": "^20.12.7",
|
||||
"@typescript-eslint/eslint-plugin": "^6.13.2",
|
||||
"@typescript-eslint/parser": "^6.13.2",
|
||||
"eslint": "^8.55.0",
|
||||
"@typescript-eslint/eslint-plugin": "^7.7.1",
|
||||
"@typescript-eslint/parser": "^7.7.1",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-import-resolver-typescript": "^3.6.1",
|
||||
"eslint-plugin-import": "^2.29.0",
|
||||
"typescript": "^5.3.3",
|
||||
"eslint-plugin-import": "^2.29.1",
|
||||
"typescript": "^5.4.5",
|
||||
"vitest": "1.4.0",
|
||||
"zod": "^3.22.4"
|
||||
"zod": "^3.23.4"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"zod": ">= 3"
|
||||
@@ -827,33 +827,33 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@typescript-eslint/eslint-plugin": {
|
||||
"version": "6.21.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz",
|
||||
"integrity": "sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==",
|
||||
"version": "7.7.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.7.1.tgz",
|
||||
"integrity": "sha512-KwfdWXJBOviaBVhxO3p5TJiLpNuh2iyXyjmWN0f1nU87pwyvfS0EmjC6ukQVYVFJd/K1+0NWGPDXiyEyQorn0Q==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@eslint-community/regexpp": "^4.5.1",
|
||||
"@typescript-eslint/scope-manager": "6.21.0",
|
||||
"@typescript-eslint/type-utils": "6.21.0",
|
||||
"@typescript-eslint/utils": "6.21.0",
|
||||
"@typescript-eslint/visitor-keys": "6.21.0",
|
||||
"@eslint-community/regexpp": "^4.10.0",
|
||||
"@typescript-eslint/scope-manager": "7.7.1",
|
||||
"@typescript-eslint/type-utils": "7.7.1",
|
||||
"@typescript-eslint/utils": "7.7.1",
|
||||
"@typescript-eslint/visitor-keys": "7.7.1",
|
||||
"debug": "^4.3.4",
|
||||
"graphemer": "^1.4.0",
|
||||
"ignore": "^5.2.4",
|
||||
"ignore": "^5.3.1",
|
||||
"natural-compare": "^1.4.0",
|
||||
"semver": "^7.5.4",
|
||||
"ts-api-utils": "^1.0.1"
|
||||
"semver": "^7.6.0",
|
||||
"ts-api-utils": "^1.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.0.0 || >=18.0.0"
|
||||
"node": "^18.18.0 || >=20.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha",
|
||||
"eslint": "^7.0.0 || ^8.0.0"
|
||||
"@typescript-eslint/parser": "^7.0.0",
|
||||
"eslint": "^8.56.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"typescript": {
|
||||
@@ -862,26 +862,26 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/parser": {
|
||||
"version": "6.21.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.21.0.tgz",
|
||||
"integrity": "sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==",
|
||||
"version": "7.7.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.7.1.tgz",
|
||||
"integrity": "sha512-vmPzBOOtz48F6JAGVS/kZYk4EkXao6iGrD838sp1w3NQQC0W8ry/q641KU4PrG7AKNAf56NOcR8GOpH8l9FPCw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/scope-manager": "6.21.0",
|
||||
"@typescript-eslint/types": "6.21.0",
|
||||
"@typescript-eslint/typescript-estree": "6.21.0",
|
||||
"@typescript-eslint/visitor-keys": "6.21.0",
|
||||
"@typescript-eslint/scope-manager": "7.7.1",
|
||||
"@typescript-eslint/types": "7.7.1",
|
||||
"@typescript-eslint/typescript-estree": "7.7.1",
|
||||
"@typescript-eslint/visitor-keys": "7.7.1",
|
||||
"debug": "^4.3.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.0.0 || >=18.0.0"
|
||||
"node": "^18.18.0 || >=20.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"eslint": "^7.0.0 || ^8.0.0"
|
||||
"eslint": "^8.56.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"typescript": {
|
||||
@@ -890,16 +890,16 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/scope-manager": {
|
||||
"version": "6.21.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz",
|
||||
"integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==",
|
||||
"version": "7.7.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.7.1.tgz",
|
||||
"integrity": "sha512-PytBif2SF+9SpEUKynYn5g1RHFddJUcyynGpztX3l/ik7KmZEv19WCMhUBkHXPU9es/VWGD3/zg3wg90+Dh2rA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "6.21.0",
|
||||
"@typescript-eslint/visitor-keys": "6.21.0"
|
||||
"@typescript-eslint/types": "7.7.1",
|
||||
"@typescript-eslint/visitor-keys": "7.7.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.0.0 || >=18.0.0"
|
||||
"node": "^18.18.0 || >=20.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
@@ -907,25 +907,25 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/type-utils": {
|
||||
"version": "6.21.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz",
|
||||
"integrity": "sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==",
|
||||
"version": "7.7.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.7.1.tgz",
|
||||
"integrity": "sha512-ZksJLW3WF7o75zaBPScdW1Gbkwhd/lyeXGf1kQCxJaOeITscoSl0MjynVvCzuV5boUz/3fOI06Lz8La55mu29Q==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/typescript-estree": "6.21.0",
|
||||
"@typescript-eslint/utils": "6.21.0",
|
||||
"@typescript-eslint/typescript-estree": "7.7.1",
|
||||
"@typescript-eslint/utils": "7.7.1",
|
||||
"debug": "^4.3.4",
|
||||
"ts-api-utils": "^1.0.1"
|
||||
"ts-api-utils": "^1.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.0.0 || >=18.0.0"
|
||||
"node": "^18.18.0 || >=20.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"eslint": "^7.0.0 || ^8.0.0"
|
||||
"eslint": "^8.56.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"typescript": {
|
||||
@@ -934,12 +934,12 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/types": {
|
||||
"version": "6.21.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz",
|
||||
"integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==",
|
||||
"version": "7.7.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.7.1.tgz",
|
||||
"integrity": "sha512-AmPmnGW1ZLTpWa+/2omPrPfR7BcbUU4oha5VIbSbS1a1Tv966bklvLNXxp3mrbc+P2j4MNOTfDffNsk4o0c6/w==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": "^16.0.0 || >=18.0.0"
|
||||
"node": "^18.18.0 || >=20.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
@@ -947,22 +947,22 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/typescript-estree": {
|
||||
"version": "6.21.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz",
|
||||
"integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==",
|
||||
"version": "7.7.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.7.1.tgz",
|
||||
"integrity": "sha512-CXe0JHCXru8Fa36dteXqmH2YxngKJjkQLjxzoj6LYwzZ7qZvgsLSc+eqItCrqIop8Vl2UKoAi0StVWu97FQZIQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "6.21.0",
|
||||
"@typescript-eslint/visitor-keys": "6.21.0",
|
||||
"@typescript-eslint/types": "7.7.1",
|
||||
"@typescript-eslint/visitor-keys": "7.7.1",
|
||||
"debug": "^4.3.4",
|
||||
"globby": "^11.1.0",
|
||||
"is-glob": "^4.0.3",
|
||||
"minimatch": "9.0.3",
|
||||
"semver": "^7.5.4",
|
||||
"ts-api-utils": "^1.0.1"
|
||||
"minimatch": "^9.0.4",
|
||||
"semver": "^7.6.0",
|
||||
"ts-api-utils": "^1.3.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.0.0 || >=18.0.0"
|
||||
"node": "^18.18.0 || >=20.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
@@ -975,41 +975,41 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/utils": {
|
||||
"version": "6.21.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.21.0.tgz",
|
||||
"integrity": "sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==",
|
||||
"version": "7.7.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.7.1.tgz",
|
||||
"integrity": "sha512-QUvBxPEaBXf41ZBbaidKICgVL8Hin0p6prQDu6bbetWo39BKbWJxRsErOzMNT1rXvTll+J7ChrbmMCXM9rsvOQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@eslint-community/eslint-utils": "^4.4.0",
|
||||
"@types/json-schema": "^7.0.12",
|
||||
"@types/semver": "^7.5.0",
|
||||
"@typescript-eslint/scope-manager": "6.21.0",
|
||||
"@typescript-eslint/types": "6.21.0",
|
||||
"@typescript-eslint/typescript-estree": "6.21.0",
|
||||
"semver": "^7.5.4"
|
||||
"@types/json-schema": "^7.0.15",
|
||||
"@types/semver": "^7.5.8",
|
||||
"@typescript-eslint/scope-manager": "7.7.1",
|
||||
"@typescript-eslint/types": "7.7.1",
|
||||
"@typescript-eslint/typescript-estree": "7.7.1",
|
||||
"semver": "^7.6.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.0.0 || >=18.0.0"
|
||||
"node": "^18.18.0 || >=20.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/typescript-eslint"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"eslint": "^7.0.0 || ^8.0.0"
|
||||
"eslint": "^8.56.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@typescript-eslint/visitor-keys": {
|
||||
"version": "6.21.0",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz",
|
||||
"integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==",
|
||||
"version": "7.7.1",
|
||||
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.7.1.tgz",
|
||||
"integrity": "sha512-gBL3Eq25uADw1LQ9kVpf3hRM+DWzs0uZknHYK3hq4jcTPqVCClHGDnB6UUUV2SFeBeA4KWHWbbLqmbGcZ4FYbw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@typescript-eslint/types": "6.21.0",
|
||||
"eslint-visitor-keys": "^3.4.1"
|
||||
"@typescript-eslint/types": "7.7.1",
|
||||
"eslint-visitor-keys": "^3.4.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^16.0.0 || >=18.0.0"
|
||||
"node": "^18.18.0 || >=20.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
@@ -3182,9 +3182,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/minimatch": {
|
||||
"version": "9.0.3",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz",
|
||||
"integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==",
|
||||
"version": "9.0.4",
|
||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz",
|
||||
"integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"brace-expansion": "^2.0.1"
|
||||
@@ -4251,9 +4251,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "5.4.4",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.4.tgz",
|
||||
"integrity": "sha512-dGE2Vv8cpVvw28v8HCPqyb08EzbBURxDpuhJvTrusShUfGnhHBafDsLdS1EhhxyL6BJQE+2cT3dDPAv+MQ6oLw==",
|
||||
"version": "5.4.5",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz",
|
||||
"integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
@@ -4532,9 +4532,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/zod": {
|
||||
"version": "3.22.4",
|
||||
"resolved": "https://registry.npmjs.org/zod/-/zod-3.22.4.tgz",
|
||||
"integrity": "sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==",
|
||||
"version": "3.23.4",
|
||||
"resolved": "https://registry.npmjs.org/zod/-/zod-3.23.4.tgz",
|
||||
"integrity": "sha512-/AtWOKbBgjzEYYQRNfoGKHObgfAZag6qUJX1VbHo2PRBgS+wfWagEY2mizjfyAPcGesrJOcx/wcl0L9WnVrHFw==",
|
||||
"dev": true,
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/colinhacks"
|
||||
|
||||
14
package.json
14
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "dub",
|
||||
"version": "0.24.6",
|
||||
"version": "0.25.0",
|
||||
"author": "Dub",
|
||||
"main": "./index.js",
|
||||
"sideEffects": false,
|
||||
@@ -19,14 +19,14 @@
|
||||
"devDependencies": {
|
||||
"@types/jsonpath": "^0.2.4",
|
||||
"@types/node": "^20.12.7",
|
||||
"@typescript-eslint/eslint-plugin": "^6.13.2",
|
||||
"@typescript-eslint/parser": "^6.13.2",
|
||||
"eslint": "^8.55.0",
|
||||
"@typescript-eslint/eslint-plugin": "^7.7.1",
|
||||
"@typescript-eslint/parser": "^7.7.1",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-import-resolver-typescript": "^3.6.1",
|
||||
"eslint-plugin-import": "^2.29.0",
|
||||
"typescript": "^5.3.3",
|
||||
"eslint-plugin-import": "^2.29.1",
|
||||
"typescript": "^5.4.5",
|
||||
"vitest": "1.4.0",
|
||||
"zod": "^3.22.4"
|
||||
"zod": "^3.23.4"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
import { RequestInput } from "../lib/http";
|
||||
import {
|
||||
AfterErrorContext,
|
||||
AfterErrorHook,
|
||||
@@ -9,6 +10,8 @@ import {
|
||||
AfterSuccessHook,
|
||||
BeforeRequestContext,
|
||||
BeforeRequestHook,
|
||||
BeforeCreateRequestHook,
|
||||
BeforeCreateRequestContext,
|
||||
Hooks,
|
||||
SDKInitHook,
|
||||
SDKInitOptions,
|
||||
@@ -18,6 +21,7 @@ import { initHooks } from "./registration";
|
||||
|
||||
export class SDKHooks implements Hooks {
|
||||
sdkInitHooks: SDKInitHook[] = [];
|
||||
beforeCreateRequestHooks: BeforeCreateRequestHook[] = [];
|
||||
beforeRequestHooks: BeforeRequestHook[] = [];
|
||||
afterSuccessHooks: AfterSuccessHook[] = [];
|
||||
afterErrorHooks: AfterErrorHook[] = [];
|
||||
@@ -30,6 +34,10 @@ export class SDKHooks implements Hooks {
|
||||
this.sdkInitHooks.push(hook);
|
||||
}
|
||||
|
||||
registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook) {
|
||||
this.beforeCreateRequestHooks.push(hook);
|
||||
}
|
||||
|
||||
registerBeforeRequestHook(hook: BeforeRequestHook) {
|
||||
this.beforeRequestHooks.push(hook);
|
||||
}
|
||||
@@ -46,6 +54,16 @@ export class SDKHooks implements Hooks {
|
||||
return this.sdkInitHooks.reduce((opts, hook) => hook.sdkInit(opts), opts);
|
||||
}
|
||||
|
||||
beforeCreateRequest(hookCtx: BeforeCreateRequestContext, input: RequestInput): RequestInput {
|
||||
let inp = input;
|
||||
|
||||
for (const hook of this.beforeCreateRequestHooks) {
|
||||
inp = hook.beforeCreateRequest(hookCtx, inp);
|
||||
}
|
||||
|
||||
return inp;
|
||||
}
|
||||
|
||||
async beforeRequest(hookCtx: BeforeRequestContext, request: Request): Promise<Request> {
|
||||
let req = request;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
||||
*/
|
||||
|
||||
import { HTTPClient } from "../lib/http";
|
||||
import { HTTPClient, RequestInput } from "../lib/http";
|
||||
|
||||
export type HookContext = {
|
||||
operationID: string;
|
||||
@@ -16,6 +16,8 @@ export type SDKInitOptions = {
|
||||
baseURL: URL | null;
|
||||
client: HTTPClient;
|
||||
};
|
||||
|
||||
export type BeforeCreateRequestContext = HookContext & {};
|
||||
export type BeforeRequestContext = HookContext & {};
|
||||
export type AfterSuccessContext = HookContext & {};
|
||||
export type AfterErrorContext = HookContext & {};
|
||||
@@ -28,30 +30,41 @@ export interface SDKInitHook {
|
||||
sdkInit: (opts: SDKInitOptions) => SDKInitOptions;
|
||||
}
|
||||
|
||||
/**
|
||||
* BeforeRequestHook is called before the SDK sends a request. The hook can
|
||||
* modify the request before it is sent or throw an error to stop the request
|
||||
* from being sent.
|
||||
*/
|
||||
export interface BeforeCreateRequestHook {
|
||||
/**
|
||||
* A hook that is called before the SDK creates a `Request` object. The hook
|
||||
* can modify how a request is constructed since certain modifications, like
|
||||
* changing the request URL, cannot be done on a request object directly.
|
||||
*/
|
||||
beforeCreateRequest: (hookCtx: BeforeCreateRequestContext, input: RequestInput) => RequestInput;
|
||||
}
|
||||
|
||||
export interface BeforeRequestHook {
|
||||
/**
|
||||
* A hook that is called before the SDK sends a request. The hook can
|
||||
* introduce instrumentation code such as logging, tracing and metrics or
|
||||
* replace the request before it is sent or throw an error to stop the
|
||||
* request from being sent.
|
||||
*/
|
||||
beforeRequest: (hookCtx: BeforeRequestContext, request: Request) => Awaitable<Request>;
|
||||
}
|
||||
|
||||
/**
|
||||
* AfterSuccessHook is called after the SDK receives a response. The hook can
|
||||
* modify the response before it is handled or throw an error to stop the
|
||||
* response from being handled.
|
||||
*/
|
||||
export interface AfterSuccessHook {
|
||||
/**
|
||||
* A hook that is called after the SDK receives a response. The hook can
|
||||
* introduce instrumentation code such as logging, tracing and metrics or
|
||||
* modify the response before it is handled or throw an error to stop the
|
||||
* response from being handled.
|
||||
*/
|
||||
afterSuccess: (hookCtx: AfterSuccessContext, response: Response) => Awaitable<Response>;
|
||||
}
|
||||
|
||||
/**
|
||||
* AfterErrorHook is called after the SDK encounters an error, or a
|
||||
* non-successful response. The hook can modify the response if available
|
||||
* otherwise modify the error.
|
||||
*/
|
||||
export interface AfterErrorHook {
|
||||
/**
|
||||
* A hook that is called after the SDK encounters an error, or a
|
||||
* non-successful response. The hook can introduce instrumentation code such
|
||||
* as logging, tracing and metrics or modify the response or error values.
|
||||
*/
|
||||
afterError: (
|
||||
hookCtx: AfterErrorContext,
|
||||
response: Response | null,
|
||||
@@ -65,6 +78,8 @@ export interface AfterErrorHook {
|
||||
export interface Hooks {
|
||||
/** Registers a hook to be used by the SDK for initialization event. */
|
||||
registerSDKInitHook(hook: SDKInitHook): void;
|
||||
/** Registers a hook to be used by the SDK for to modify `Request` construction. */
|
||||
registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook): void;
|
||||
/** Registers a hook to be used by the SDK for the before request event. */
|
||||
registerBeforeRequestHook(hook: BeforeRequestHook): void;
|
||||
/** Registers a hook to be used by the SDK for the after success event. */
|
||||
|
||||
@@ -64,7 +64,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
||||
export const SDK_METADATA = {
|
||||
language: "typescript",
|
||||
openapiDocVersion: "0.0.1",
|
||||
sdkVersion: "0.24.6",
|
||||
genVersion: "2.312.1",
|
||||
userAgent: "speakeasy-sdk/typescript 0.24.6 2.312.1 0.0.1 dub",
|
||||
sdkVersion: "0.25.0",
|
||||
genVersion: "2.314.0",
|
||||
userAgent: "speakeasy-sdk/typescript 0.25.0 2.314.0 0.0.1 dub",
|
||||
} as const;
|
||||
|
||||
@@ -11,6 +11,17 @@ export type Awaitable<T> = T | Promise<T>;
|
||||
|
||||
const DEFAULT_FETCHER: Fetcher = (input, init) => fetch(input, init);
|
||||
|
||||
export type RequestInput = {
|
||||
/**
|
||||
* The URL the request will use.
|
||||
*/
|
||||
url: URL;
|
||||
/**
|
||||
* Options used to create a [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request).
|
||||
*/
|
||||
options?: RequestInit | undefined;
|
||||
};
|
||||
|
||||
export interface HTTPClientOptions {
|
||||
fetcher?: Fetcher;
|
||||
}
|
||||
|
||||
@@ -40,7 +40,11 @@ export class ClientSDK {
|
||||
this.client = client;
|
||||
}
|
||||
|
||||
protected createRequest$(conf: RequestConfig, options?: RequestOptions): Request {
|
||||
protected createRequest$(
|
||||
context: HookContext,
|
||||
conf: RequestConfig,
|
||||
options?: RequestOptions
|
||||
): Request {
|
||||
const { method, path, query, headers: opHeaders, security } = conf;
|
||||
|
||||
const base = conf.baseURL ?? this.baseURL;
|
||||
@@ -95,12 +99,17 @@ export class ClientSDK {
|
||||
headers.set(k, v);
|
||||
}
|
||||
|
||||
return new Request(reqURL, {
|
||||
...options?.fetchOptions,
|
||||
body: conf.body ?? null,
|
||||
headers,
|
||||
method,
|
||||
const input = this.hooks$.beforeCreateRequest(context, {
|
||||
url: reqURL,
|
||||
options: {
|
||||
...options?.fetchOptions,
|
||||
body: conf.body ?? null,
|
||||
headers,
|
||||
method,
|
||||
},
|
||||
});
|
||||
|
||||
return new Request(input.url, input.options);
|
||||
}
|
||||
|
||||
protected async do$(
|
||||
|
||||
@@ -137,6 +137,7 @@ export class Analytics extends ClientSDK {
|
||||
],
|
||||
};
|
||||
const request = this.createRequest$(
|
||||
context,
|
||||
{
|
||||
security: securitySettings$,
|
||||
method: "GET",
|
||||
@@ -388,6 +389,7 @@ export class Analytics extends ClientSDK {
|
||||
],
|
||||
};
|
||||
const request = this.createRequest$(
|
||||
context,
|
||||
{
|
||||
security: securitySettings$,
|
||||
method: "GET",
|
||||
@@ -639,6 +641,7 @@ export class Analytics extends ClientSDK {
|
||||
],
|
||||
};
|
||||
const request = this.createRequest$(
|
||||
context,
|
||||
{
|
||||
security: securitySettings$,
|
||||
method: "GET",
|
||||
@@ -892,6 +895,7 @@ export class Analytics extends ClientSDK {
|
||||
],
|
||||
};
|
||||
const request = this.createRequest$(
|
||||
context,
|
||||
{
|
||||
security: securitySettings$,
|
||||
method: "GET",
|
||||
@@ -1145,6 +1149,7 @@ export class Analytics extends ClientSDK {
|
||||
],
|
||||
};
|
||||
const request = this.createRequest$(
|
||||
context,
|
||||
{
|
||||
security: securitySettings$,
|
||||
method: "GET",
|
||||
@@ -1398,6 +1403,7 @@ export class Analytics extends ClientSDK {
|
||||
],
|
||||
};
|
||||
const request = this.createRequest$(
|
||||
context,
|
||||
{
|
||||
security: securitySettings$,
|
||||
method: "GET",
|
||||
@@ -1651,6 +1657,7 @@ export class Analytics extends ClientSDK {
|
||||
],
|
||||
};
|
||||
const request = this.createRequest$(
|
||||
context,
|
||||
{
|
||||
security: securitySettings$,
|
||||
method: "GET",
|
||||
@@ -1904,6 +1911,7 @@ export class Analytics extends ClientSDK {
|
||||
],
|
||||
};
|
||||
const request = this.createRequest$(
|
||||
context,
|
||||
{
|
||||
security: securitySettings$,
|
||||
method: "GET",
|
||||
@@ -2157,6 +2165,7 @@ export class Analytics extends ClientSDK {
|
||||
],
|
||||
};
|
||||
const request = this.createRequest$(
|
||||
context,
|
||||
{
|
||||
security: securitySettings$,
|
||||
method: "GET",
|
||||
@@ -2408,6 +2417,7 @@ export class Analytics extends ClientSDK {
|
||||
],
|
||||
};
|
||||
const request = this.createRequest$(
|
||||
context,
|
||||
{
|
||||
security: securitySettings$,
|
||||
method: "GET",
|
||||
|
||||
@@ -101,6 +101,7 @@ export class Domains extends ClientSDK {
|
||||
],
|
||||
};
|
||||
const request = this.createRequest$(
|
||||
context,
|
||||
{
|
||||
security: securitySettings$,
|
||||
method: "GET",
|
||||
@@ -323,6 +324,7 @@ export class Domains extends ClientSDK {
|
||||
],
|
||||
};
|
||||
const request = this.createRequest$(
|
||||
context,
|
||||
{
|
||||
security: securitySettings$,
|
||||
method: "POST",
|
||||
@@ -553,6 +555,7 @@ export class Domains extends ClientSDK {
|
||||
],
|
||||
};
|
||||
const request = this.createRequest$(
|
||||
context,
|
||||
{
|
||||
security: securitySettings$,
|
||||
method: "DELETE",
|
||||
@@ -786,6 +789,7 @@ export class Domains extends ClientSDK {
|
||||
],
|
||||
};
|
||||
const request = this.createRequest$(
|
||||
context,
|
||||
{
|
||||
security: securitySettings$,
|
||||
method: "PATCH",
|
||||
@@ -1013,6 +1017,7 @@ export class Domains extends ClientSDK {
|
||||
],
|
||||
};
|
||||
const request = this.createRequest$(
|
||||
context,
|
||||
{
|
||||
security: securitySettings$,
|
||||
method: "POST",
|
||||
@@ -1246,6 +1251,7 @@ export class Domains extends ClientSDK {
|
||||
],
|
||||
};
|
||||
const request = this.createRequest$(
|
||||
context,
|
||||
{
|
||||
security: securitySettings$,
|
||||
method: "POST",
|
||||
|
||||
@@ -127,6 +127,7 @@ export class Links extends ClientSDK {
|
||||
],
|
||||
};
|
||||
const request = this.createRequest$(
|
||||
context,
|
||||
{
|
||||
security: securitySettings$,
|
||||
method: "GET",
|
||||
@@ -350,6 +351,7 @@ export class Links extends ClientSDK {
|
||||
],
|
||||
};
|
||||
const request = this.createRequest$(
|
||||
context,
|
||||
{
|
||||
security: securitySettings$,
|
||||
method: "POST",
|
||||
@@ -589,6 +591,7 @@ export class Links extends ClientSDK {
|
||||
],
|
||||
};
|
||||
const request = this.createRequest$(
|
||||
context,
|
||||
{
|
||||
security: securitySettings$,
|
||||
method: "GET",
|
||||
@@ -812,6 +815,7 @@ export class Links extends ClientSDK {
|
||||
],
|
||||
};
|
||||
const request = this.createRequest$(
|
||||
context,
|
||||
{
|
||||
security: securitySettings$,
|
||||
method: "GET",
|
||||
@@ -1045,6 +1049,7 @@ export class Links extends ClientSDK {
|
||||
],
|
||||
};
|
||||
const request = this.createRequest$(
|
||||
context,
|
||||
{
|
||||
security: securitySettings$,
|
||||
method: "PUT",
|
||||
@@ -1275,6 +1280,7 @@ export class Links extends ClientSDK {
|
||||
],
|
||||
};
|
||||
const request = this.createRequest$(
|
||||
context,
|
||||
{
|
||||
security: securitySettings$,
|
||||
method: "DELETE",
|
||||
@@ -1498,6 +1504,7 @@ export class Links extends ClientSDK {
|
||||
],
|
||||
};
|
||||
const request = this.createRequest$(
|
||||
context,
|
||||
{
|
||||
security: securitySettings$,
|
||||
method: "POST",
|
||||
|
||||
@@ -84,6 +84,7 @@ export class Metatags extends ClientSDK {
|
||||
|
||||
const doOptions = { context, errorCodes: ["4XX", "5XX"] };
|
||||
const request = this.createRequest$(
|
||||
context,
|
||||
{
|
||||
security: securitySettings$,
|
||||
method: "GET",
|
||||
|
||||
@@ -121,6 +121,7 @@ export class QRCodes extends ClientSDK {
|
||||
],
|
||||
};
|
||||
const request = this.createRequest$(
|
||||
context,
|
||||
{
|
||||
security: securitySettings$,
|
||||
method: "GET",
|
||||
|
||||
@@ -101,6 +101,7 @@ export class Tags extends ClientSDK {
|
||||
],
|
||||
};
|
||||
const request = this.createRequest$(
|
||||
context,
|
||||
{
|
||||
security: securitySettings$,
|
||||
method: "GET",
|
||||
@@ -323,6 +324,7 @@ export class Tags extends ClientSDK {
|
||||
],
|
||||
};
|
||||
const request = this.createRequest$(
|
||||
context,
|
||||
{
|
||||
security: securitySettings$,
|
||||
method: "POST",
|
||||
|
||||
@@ -87,6 +87,7 @@ export class Workspaces extends ClientSDK {
|
||||
],
|
||||
};
|
||||
const request = this.createRequest$(
|
||||
context,
|
||||
{
|
||||
security: securitySettings$,
|
||||
method: "GET",
|
||||
@@ -299,6 +300,7 @@ export class Workspaces extends ClientSDK {
|
||||
],
|
||||
};
|
||||
const request = this.createRequest$(
|
||||
context,
|
||||
{
|
||||
security: securitySettings$,
|
||||
method: "POST",
|
||||
@@ -515,6 +517,7 @@ export class Workspaces extends ClientSDK {
|
||||
],
|
||||
};
|
||||
const request = this.createRequest$(
|
||||
context,
|
||||
{
|
||||
security: securitySettings$,
|
||||
method: "GET",
|
||||
|
||||
Reference in New Issue
Block a user