dub 0.22.2 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.speakeasy/gen.lock +6 -5
- package/.speakeasy/gen.yaml +1 -1
- package/README.md +35 -33
- package/docs/sdks/analytics/README.md +60 -60
- package/docs/sdks/links/README.md +52 -48
- package/docs/sdks/metatags/README.md +6 -6
- package/docs/sdks/qrcodes/README.md +6 -6
- package/docs/sdks/tags/README.md +12 -12
- package/docs/sdks/workspaces/README.md +18 -18
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/package.json +1 -1
- package/src/lib/config.ts +3 -3
package/.speakeasy/gen.lock
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
lockVersion: 2.0.0
|
|
2
2
|
id: f28179cc-ef59-426d-9e85-60cec22fc642
|
|
3
3
|
management:
|
|
4
|
-
docChecksum:
|
|
4
|
+
docChecksum: 0fd7c7dd60bcd8b21c5a82e77f886ca4
|
|
5
5
|
docVersion: 0.0.1
|
|
6
|
-
speakeasyVersion: 1.
|
|
7
|
-
generationVersion: 2.
|
|
8
|
-
releaseVersion: 0.
|
|
9
|
-
configChecksum:
|
|
6
|
+
speakeasyVersion: 1.253.1
|
|
7
|
+
generationVersion: 2.306.0
|
|
8
|
+
releaseVersion: 0.23.0
|
|
9
|
+
configChecksum: 42694dd34d8f28936b3acf5fc2011448
|
|
10
10
|
repoURL: https://github.com/dubinc/dub-node.git
|
|
11
11
|
installationURL: https://github.com/dubinc/dub-node
|
|
12
12
|
published: true
|
|
@@ -16,6 +16,7 @@ features:
|
|
|
16
16
|
constsAndDefaults: 0.1.5
|
|
17
17
|
core: 3.7.1
|
|
18
18
|
deprecations: 2.81.1
|
|
19
|
+
examples: 2.81.3
|
|
19
20
|
flattening: 2.81.1
|
|
20
21
|
globalSecurity: 2.82.9
|
|
21
22
|
globalServerURLs: 2.82.4
|
package/.speakeasy/gen.yaml
CHANGED
package/README.md
CHANGED
|
@@ -37,14 +37,16 @@ For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md).
|
|
|
37
37
|
```typescript
|
|
38
38
|
import { Dub } from "dub";
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
});
|
|
40
|
+
const dub = new Dub({
|
|
41
|
+
token: "DUB_API_KEY",
|
|
42
|
+
workspaceId: "<value>",
|
|
43
|
+
});
|
|
45
44
|
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
async function run() {
|
|
46
|
+
const result = await dub.links.create({
|
|
47
|
+
url: "https://google/com",
|
|
48
|
+
tagIds: ["clux0rgak00011..."],
|
|
49
|
+
geo: {},
|
|
48
50
|
});
|
|
49
51
|
|
|
50
52
|
// Handle the result
|
|
@@ -127,15 +129,15 @@ Validation errors can also occur when either method arguments or data returned f
|
|
|
127
129
|
import { Dub } from "dub";
|
|
128
130
|
import * as errors from "dub/models/errors";
|
|
129
131
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
});
|
|
132
|
+
const dub = new Dub({
|
|
133
|
+
token: "DUB_API_KEY",
|
|
134
|
+
workspaceId: "<value>",
|
|
135
|
+
});
|
|
135
136
|
|
|
137
|
+
async function run() {
|
|
136
138
|
let result;
|
|
137
139
|
try {
|
|
138
|
-
result = await
|
|
140
|
+
result = await dub.links.list({
|
|
139
141
|
tagIds: ["<value>"],
|
|
140
142
|
});
|
|
141
143
|
} catch (err) {
|
|
@@ -212,14 +214,14 @@ You can override the default server globally by passing a server index to the `s
|
|
|
212
214
|
```typescript
|
|
213
215
|
import { Dub } from "dub";
|
|
214
216
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
});
|
|
217
|
+
const dub = new Dub({
|
|
218
|
+
serverIdx: 0,
|
|
219
|
+
token: "DUB_API_KEY",
|
|
220
|
+
workspaceId: "<value>",
|
|
221
|
+
});
|
|
221
222
|
|
|
222
|
-
|
|
223
|
+
async function run() {
|
|
224
|
+
const result = await dub.links.list({
|
|
223
225
|
tagIds: ["<value>"],
|
|
224
226
|
});
|
|
225
227
|
|
|
@@ -239,14 +241,14 @@ The default server can also be overridden globally by passing a URL to the `serv
|
|
|
239
241
|
```typescript
|
|
240
242
|
import { Dub } from "dub";
|
|
241
243
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
});
|
|
244
|
+
const dub = new Dub({
|
|
245
|
+
serverURL: "https://api.dub.co",
|
|
246
|
+
token: "DUB_API_KEY",
|
|
247
|
+
workspaceId: "<value>",
|
|
248
|
+
});
|
|
248
249
|
|
|
249
|
-
|
|
250
|
+
async function run() {
|
|
251
|
+
const result = await dub.links.list({
|
|
250
252
|
tagIds: ["<value>"],
|
|
251
253
|
});
|
|
252
254
|
|
|
@@ -323,13 +325,13 @@ To authenticate with the API the `token` parameter must be set when initializing
|
|
|
323
325
|
```typescript
|
|
324
326
|
import { Dub } from "dub";
|
|
325
327
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
});
|
|
328
|
+
const dub = new Dub({
|
|
329
|
+
token: "DUB_API_KEY",
|
|
330
|
+
workspaceId: "<value>",
|
|
331
|
+
});
|
|
331
332
|
|
|
332
|
-
|
|
333
|
+
async function run() {
|
|
334
|
+
const result = await dub.links.list({
|
|
333
335
|
tagIds: ["<value>"],
|
|
334
336
|
});
|
|
335
337
|
|
|
@@ -23,13 +23,13 @@ Retrieve the number of clicks for a link, a domain, or the authenticated workspa
|
|
|
23
23
|
```typescript
|
|
24
24
|
import { Dub } from "dub";
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
});
|
|
26
|
+
const dub = new Dub({
|
|
27
|
+
token: "DUB_API_KEY",
|
|
28
|
+
workspaceId: "<value>",
|
|
29
|
+
});
|
|
31
30
|
|
|
32
|
-
|
|
31
|
+
async function run() {
|
|
32
|
+
const result = await dub.analytics.clicks({});
|
|
33
33
|
|
|
34
34
|
// Handle the result
|
|
35
35
|
console.log(result)
|
|
@@ -74,13 +74,13 @@ Retrieve the number of clicks for a link, a domain, or the authenticated workspa
|
|
|
74
74
|
```typescript
|
|
75
75
|
import { Dub } from "dub";
|
|
76
76
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
});
|
|
77
|
+
const dub = new Dub({
|
|
78
|
+
token: "DUB_API_KEY",
|
|
79
|
+
workspaceId: "<value>",
|
|
80
|
+
});
|
|
82
81
|
|
|
83
|
-
|
|
82
|
+
async function run() {
|
|
83
|
+
const result = await dub.analytics.timeseries({});
|
|
84
84
|
|
|
85
85
|
// Handle the result
|
|
86
86
|
console.log(result)
|
|
@@ -125,13 +125,13 @@ Retrieve the top countries by number of clicks for a link, a domain, or the auth
|
|
|
125
125
|
```typescript
|
|
126
126
|
import { Dub } from "dub";
|
|
127
127
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
});
|
|
128
|
+
const dub = new Dub({
|
|
129
|
+
token: "DUB_API_KEY",
|
|
130
|
+
workspaceId: "<value>",
|
|
131
|
+
});
|
|
133
132
|
|
|
134
|
-
|
|
133
|
+
async function run() {
|
|
134
|
+
const result = await dub.analytics.countries({});
|
|
135
135
|
|
|
136
136
|
// Handle the result
|
|
137
137
|
console.log(result)
|
|
@@ -176,13 +176,13 @@ Retrieve the top countries by number of clicks for a link, a domain, or the auth
|
|
|
176
176
|
```typescript
|
|
177
177
|
import { Dub } from "dub";
|
|
178
178
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
});
|
|
179
|
+
const dub = new Dub({
|
|
180
|
+
token: "DUB_API_KEY",
|
|
181
|
+
workspaceId: "<value>",
|
|
182
|
+
});
|
|
184
183
|
|
|
185
|
-
|
|
184
|
+
async function run() {
|
|
185
|
+
const result = await dub.analytics.cities({});
|
|
186
186
|
|
|
187
187
|
// Handle the result
|
|
188
188
|
console.log(result)
|
|
@@ -227,13 +227,13 @@ Retrieve the top devices by number of clicks for a link, a domain, or the authen
|
|
|
227
227
|
```typescript
|
|
228
228
|
import { Dub } from "dub";
|
|
229
229
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
});
|
|
230
|
+
const dub = new Dub({
|
|
231
|
+
token: "DUB_API_KEY",
|
|
232
|
+
workspaceId: "<value>",
|
|
233
|
+
});
|
|
235
234
|
|
|
236
|
-
|
|
235
|
+
async function run() {
|
|
236
|
+
const result = await dub.analytics.devices({});
|
|
237
237
|
|
|
238
238
|
// Handle the result
|
|
239
239
|
console.log(result)
|
|
@@ -278,13 +278,13 @@ Retrieve the top browsers by number of clicks for a link, a domain, or the authe
|
|
|
278
278
|
```typescript
|
|
279
279
|
import { Dub } from "dub";
|
|
280
280
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
});
|
|
281
|
+
const dub = new Dub({
|
|
282
|
+
token: "DUB_API_KEY",
|
|
283
|
+
workspaceId: "<value>",
|
|
284
|
+
});
|
|
286
285
|
|
|
287
|
-
|
|
286
|
+
async function run() {
|
|
287
|
+
const result = await dub.analytics.browsers({});
|
|
288
288
|
|
|
289
289
|
// Handle the result
|
|
290
290
|
console.log(result)
|
|
@@ -329,13 +329,13 @@ Retrieve the top OS by number of clicks for a link, a domain, or the authenticat
|
|
|
329
329
|
```typescript
|
|
330
330
|
import { Dub } from "dub";
|
|
331
331
|
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
});
|
|
332
|
+
const dub = new Dub({
|
|
333
|
+
token: "DUB_API_KEY",
|
|
334
|
+
workspaceId: "<value>",
|
|
335
|
+
});
|
|
337
336
|
|
|
338
|
-
|
|
337
|
+
async function run() {
|
|
338
|
+
const result = await dub.analytics.os({});
|
|
339
339
|
|
|
340
340
|
// Handle the result
|
|
341
341
|
console.log(result)
|
|
@@ -380,13 +380,13 @@ Retrieve the top referers by number of clicks for a link, a domain, or the authe
|
|
|
380
380
|
```typescript
|
|
381
381
|
import { Dub } from "dub";
|
|
382
382
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
});
|
|
383
|
+
const dub = new Dub({
|
|
384
|
+
token: "DUB_API_KEY",
|
|
385
|
+
workspaceId: "<value>",
|
|
386
|
+
});
|
|
388
387
|
|
|
389
|
-
|
|
388
|
+
async function run() {
|
|
389
|
+
const result = await dub.analytics.referers({});
|
|
390
390
|
|
|
391
391
|
// Handle the result
|
|
392
392
|
console.log(result)
|
|
@@ -431,13 +431,13 @@ Retrieve the top links by number of clicks for a domain or the authenticated wor
|
|
|
431
431
|
```typescript
|
|
432
432
|
import { Dub } from "dub";
|
|
433
433
|
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
});
|
|
434
|
+
const dub = new Dub({
|
|
435
|
+
token: "DUB_API_KEY",
|
|
436
|
+
workspaceId: "<value>",
|
|
437
|
+
});
|
|
439
438
|
|
|
440
|
-
|
|
439
|
+
async function run() {
|
|
440
|
+
const result = await dub.analytics.topLinks({});
|
|
441
441
|
|
|
442
442
|
// Handle the result
|
|
443
443
|
console.log(result)
|
|
@@ -482,13 +482,13 @@ Retrieve the top URLs by number of clicks for a given short link.
|
|
|
482
482
|
```typescript
|
|
483
483
|
import { Dub } from "dub";
|
|
484
484
|
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
});
|
|
485
|
+
const dub = new Dub({
|
|
486
|
+
token: "DUB_API_KEY",
|
|
487
|
+
workspaceId: "<value>",
|
|
488
|
+
});
|
|
490
489
|
|
|
491
|
-
|
|
490
|
+
async function run() {
|
|
491
|
+
const result = await dub.analytics.topUrls({});
|
|
492
492
|
|
|
493
493
|
// Handle the result
|
|
494
494
|
console.log(result)
|
|
@@ -20,13 +20,13 @@ Retrieve a list of links for the authenticated workspace. The list will be pagin
|
|
|
20
20
|
```typescript
|
|
21
21
|
import { Dub } from "dub";
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
});
|
|
23
|
+
const dub = new Dub({
|
|
24
|
+
token: "DUB_API_KEY",
|
|
25
|
+
workspaceId: "<value>",
|
|
26
|
+
});
|
|
28
27
|
|
|
29
|
-
|
|
28
|
+
async function run() {
|
|
29
|
+
const result = await dub.links.list({
|
|
30
30
|
tagIds: [
|
|
31
31
|
"<value>",
|
|
32
32
|
],
|
|
@@ -75,15 +75,17 @@ Create a new link for the authenticated workspace.
|
|
|
75
75
|
```typescript
|
|
76
76
|
import { Dub } from "dub";
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
});
|
|
78
|
+
const dub = new Dub({
|
|
79
|
+
token: "DUB_API_KEY",
|
|
80
|
+
workspaceId: "<value>",
|
|
81
|
+
});
|
|
83
82
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
async function run() {
|
|
84
|
+
const result = await dub.links.create({
|
|
85
|
+
url: "https://google/com",
|
|
86
|
+
tagIds: [
|
|
87
|
+
"clux0rgak00011...",
|
|
88
|
+
],
|
|
87
89
|
geo: {},
|
|
88
90
|
});
|
|
89
91
|
|
|
@@ -131,13 +133,13 @@ Retrieve the number of links for the authenticated workspace. The provided query
|
|
|
131
133
|
import { Dub } from "dub";
|
|
132
134
|
import { One } from "dub/models/operations";
|
|
133
135
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
});
|
|
136
|
+
const dub = new Dub({
|
|
137
|
+
token: "DUB_API_KEY",
|
|
138
|
+
workspaceId: "<value>",
|
|
139
|
+
});
|
|
139
140
|
|
|
140
|
-
|
|
141
|
+
async function run() {
|
|
142
|
+
const result = await dub.links.count({
|
|
141
143
|
tagIds: "<value>",
|
|
142
144
|
groupBy: One.Domain,
|
|
143
145
|
});
|
|
@@ -185,13 +187,13 @@ Retrieve the info for a link from their domain and key.
|
|
|
185
187
|
```typescript
|
|
186
188
|
import { Dub } from "dub";
|
|
187
189
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
});
|
|
190
|
+
const dub = new Dub({
|
|
191
|
+
token: "DUB_API_KEY",
|
|
192
|
+
workspaceId: "<value>",
|
|
193
|
+
});
|
|
193
194
|
|
|
194
|
-
|
|
195
|
+
async function run() {
|
|
196
|
+
const result = await dub.links.get({
|
|
195
197
|
domain: "ringed-blow.name",
|
|
196
198
|
key: "<key>",
|
|
197
199
|
});
|
|
@@ -239,20 +241,22 @@ Edit a link for the authenticated workspace.
|
|
|
239
241
|
```typescript
|
|
240
242
|
import { Dub } from "dub";
|
|
241
243
|
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
});
|
|
244
|
+
const dub = new Dub({
|
|
245
|
+
token: "DUB_API_KEY",
|
|
246
|
+
workspaceId: "<value>",
|
|
247
|
+
});
|
|
247
248
|
|
|
249
|
+
async function run() {
|
|
248
250
|
const linkId = "<value>";
|
|
249
251
|
const requestBody = {
|
|
250
|
-
url: "https://
|
|
251
|
-
tagIds:
|
|
252
|
+
url: "https://google/com",
|
|
253
|
+
tagIds: [
|
|
254
|
+
"clux0rgak00011...",
|
|
255
|
+
],
|
|
252
256
|
geo: {},
|
|
253
257
|
};
|
|
254
258
|
|
|
255
|
-
const result = await
|
|
259
|
+
const result = await dub.links.update(linkId, requestBody);
|
|
256
260
|
|
|
257
261
|
// Handle the result
|
|
258
262
|
console.log(result)
|
|
@@ -298,15 +302,15 @@ Delete a link for the authenticated workspace.
|
|
|
298
302
|
```typescript
|
|
299
303
|
import { Dub } from "dub";
|
|
300
304
|
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
});
|
|
305
|
+
const dub = new Dub({
|
|
306
|
+
token: "DUB_API_KEY",
|
|
307
|
+
workspaceId: "<value>",
|
|
308
|
+
});
|
|
306
309
|
|
|
310
|
+
async function run() {
|
|
307
311
|
const linkId = "<value>";
|
|
308
312
|
|
|
309
|
-
const result = await
|
|
313
|
+
const result = await dub.links.delete(linkId);
|
|
310
314
|
|
|
311
315
|
// Handle the result
|
|
312
316
|
console.log(result)
|
|
@@ -351,17 +355,17 @@ Bulk create up to 100 links for the authenticated workspace.
|
|
|
351
355
|
```typescript
|
|
352
356
|
import { Dub } from "dub";
|
|
353
357
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
});
|
|
358
|
+
const dub = new Dub({
|
|
359
|
+
token: "DUB_API_KEY",
|
|
360
|
+
workspaceId: "<value>",
|
|
361
|
+
});
|
|
359
362
|
|
|
360
|
-
|
|
363
|
+
async function run() {
|
|
364
|
+
const result = await dub.links.createMany([
|
|
361
365
|
{
|
|
362
|
-
url: "https://
|
|
366
|
+
url: "https://google/com",
|
|
363
367
|
tagIds: [
|
|
364
|
-
"
|
|
368
|
+
"clux0rgak00011...",
|
|
365
369
|
],
|
|
366
370
|
geo: {},
|
|
367
371
|
},
|
|
@@ -14,13 +14,13 @@ Retrieve the metatags for a URL
|
|
|
14
14
|
```typescript
|
|
15
15
|
import { Dub } from "dub";
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
});
|
|
17
|
+
const dub = new Dub({
|
|
18
|
+
token: "DUB_API_KEY",
|
|
19
|
+
workspaceId: "<value>",
|
|
20
|
+
});
|
|
22
21
|
|
|
23
|
-
|
|
22
|
+
async function run() {
|
|
23
|
+
const result = await dub.metatags.get({
|
|
24
24
|
url: "https://brief-micronutrient.org",
|
|
25
25
|
});
|
|
26
26
|
|
|
@@ -14,13 +14,13 @@ Retrieve a QR code for a link.
|
|
|
14
14
|
```typescript
|
|
15
15
|
import { Dub } from "dub";
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
});
|
|
17
|
+
const dub = new Dub({
|
|
18
|
+
token: "DUB_API_KEY",
|
|
19
|
+
workspaceId: "<value>",
|
|
20
|
+
});
|
|
22
21
|
|
|
23
|
-
|
|
22
|
+
async function run() {
|
|
23
|
+
const result = await dub.qrCodes.get({});
|
|
24
24
|
|
|
25
25
|
// Handle the result
|
|
26
26
|
console.log(result)
|
package/docs/sdks/tags/README.md
CHANGED
|
@@ -15,13 +15,13 @@ Retrieve a list of tags for the authenticated workspace.
|
|
|
15
15
|
```typescript
|
|
16
16
|
import { Dub } from "dub";
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
});
|
|
18
|
+
const dub = new Dub({
|
|
19
|
+
token: "DUB_API_KEY",
|
|
20
|
+
workspaceId: "<value>",
|
|
21
|
+
});
|
|
23
22
|
|
|
24
|
-
|
|
23
|
+
async function run() {
|
|
24
|
+
const result = await dub.tags.list({});
|
|
25
25
|
|
|
26
26
|
// Handle the result
|
|
27
27
|
console.log(result)
|
|
@@ -66,13 +66,13 @@ Create a new tag for the authenticated workspace.
|
|
|
66
66
|
```typescript
|
|
67
67
|
import { Dub } from "dub";
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
});
|
|
69
|
+
const dub = new Dub({
|
|
70
|
+
token: "DUB_API_KEY",
|
|
71
|
+
workspaceId: "<value>",
|
|
72
|
+
});
|
|
74
73
|
|
|
75
|
-
|
|
74
|
+
async function run() {
|
|
75
|
+
const result = await dub.tags.create({
|
|
76
76
|
tag: "<value>",
|
|
77
77
|
});
|
|
78
78
|
|
|
@@ -16,13 +16,13 @@ Retrieve a list of workspaces for the authenticated user.
|
|
|
16
16
|
```typescript
|
|
17
17
|
import { Dub } from "dub";
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
});
|
|
19
|
+
const dub = new Dub({
|
|
20
|
+
token: "DUB_API_KEY",
|
|
21
|
+
workspaceId: "<value>",
|
|
22
|
+
});
|
|
24
23
|
|
|
25
|
-
|
|
24
|
+
async function run() {
|
|
25
|
+
const result = await dub.workspaces.list();
|
|
26
26
|
|
|
27
27
|
// Handle the result
|
|
28
28
|
console.log(result)
|
|
@@ -66,13 +66,13 @@ Create a new workspace for the authenticated user.
|
|
|
66
66
|
```typescript
|
|
67
67
|
import { Dub } from "dub";
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
});
|
|
69
|
+
const dub = new Dub({
|
|
70
|
+
token: "DUB_API_KEY",
|
|
71
|
+
workspaceId: "<value>",
|
|
72
|
+
});
|
|
74
73
|
|
|
75
|
-
|
|
74
|
+
async function run() {
|
|
75
|
+
const result = await dub.workspaces.create({
|
|
76
76
|
name: "<value>",
|
|
77
77
|
slug: "<value>",
|
|
78
78
|
});
|
|
@@ -120,13 +120,13 @@ Retrieve a workspace for the authenticated user.
|
|
|
120
120
|
```typescript
|
|
121
121
|
import { Dub } from "dub";
|
|
122
122
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
});
|
|
123
|
+
const dub = new Dub({
|
|
124
|
+
token: "DUB_API_KEY",
|
|
125
|
+
workspaceId: "<value>",
|
|
126
|
+
});
|
|
128
127
|
|
|
129
|
-
|
|
128
|
+
async function run() {
|
|
129
|
+
const result = await dub.workspaces.get({
|
|
130
130
|
idOrSlug: "<value>",
|
|
131
131
|
});
|
|
132
132
|
|
package/lib/config.d.ts
CHANGED
|
@@ -32,8 +32,8 @@ export declare function serverURLFromOptions(options: SDKOptions): URL | null;
|
|
|
32
32
|
export declare const SDK_METADATA: Readonly<{
|
|
33
33
|
language: "typescript";
|
|
34
34
|
openapiDocVersion: "0.0.1";
|
|
35
|
-
sdkVersion: "0.
|
|
36
|
-
genVersion: "2.
|
|
37
|
-
userAgent: "speakeasy-sdk/typescript 0.
|
|
35
|
+
sdkVersion: "0.23.0";
|
|
36
|
+
genVersion: "2.306.0";
|
|
37
|
+
userAgent: "speakeasy-sdk/typescript 0.23.0 2.306.0 0.0.1 dub";
|
|
38
38
|
}>;
|
|
39
39
|
//# sourceMappingURL=config.d.ts.map
|
package/lib/config.js
CHANGED
|
@@ -32,8 +32,8 @@ exports.serverURLFromOptions = serverURLFromOptions;
|
|
|
32
32
|
exports.SDK_METADATA = Object.freeze({
|
|
33
33
|
language: "typescript",
|
|
34
34
|
openapiDocVersion: "0.0.1",
|
|
35
|
-
sdkVersion: "0.
|
|
36
|
-
genVersion: "2.
|
|
37
|
-
userAgent: "speakeasy-sdk/typescript 0.
|
|
35
|
+
sdkVersion: "0.23.0",
|
|
36
|
+
genVersion: "2.306.0",
|
|
37
|
+
userAgent: "speakeasy-sdk/typescript 0.23.0 2.306.0 0.0.1 dub",
|
|
38
38
|
});
|
|
39
39
|
//# sourceMappingURL=config.js.map
|
package/package.json
CHANGED
package/src/lib/config.ts
CHANGED
|
@@ -64,7 +64,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
64
64
|
export const SDK_METADATA = Object.freeze({
|
|
65
65
|
language: "typescript",
|
|
66
66
|
openapiDocVersion: "0.0.1",
|
|
67
|
-
sdkVersion: "0.
|
|
68
|
-
genVersion: "2.
|
|
69
|
-
userAgent: "speakeasy-sdk/typescript 0.
|
|
67
|
+
sdkVersion: "0.23.0",
|
|
68
|
+
genVersion: "2.306.0",
|
|
69
|
+
userAgent: "speakeasy-sdk/typescript 0.23.0 2.306.0 0.0.1 dub",
|
|
70
70
|
});
|