dub 0.7.0 → 0.9.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.
Files changed (72) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +27 -23
  3. package/index.d.mts +5 -3
  4. package/index.d.ts +5 -3
  5. package/index.d.ts.map +1 -1
  6. package/index.js +4 -0
  7. package/index.js.map +1 -1
  8. package/index.mjs +4 -0
  9. package/index.mjs.map +1 -1
  10. package/package.json +3 -1
  11. package/resources/index.d.ts +2 -2
  12. package/resources/index.d.ts.map +1 -1
  13. package/resources/index.js.map +1 -1
  14. package/resources/index.mjs.map +1 -1
  15. package/resources/links/bulk.d.ts +176 -10
  16. package/resources/links/bulk.d.ts.map +1 -1
  17. package/resources/links/bulk.js +2 -2
  18. package/resources/links/bulk.js.map +1 -1
  19. package/resources/links/bulk.mjs +2 -2
  20. package/resources/links/bulk.mjs.map +1 -1
  21. package/resources/links/index.d.ts +2 -2
  22. package/resources/links/index.d.ts.map +1 -1
  23. package/resources/links/index.js.map +1 -1
  24. package/resources/links/index.mjs.map +1 -1
  25. package/resources/links/info.d.ts +156 -5
  26. package/resources/links/info.d.ts.map +1 -1
  27. package/resources/links/info.js.map +1 -1
  28. package/resources/links/info.mjs.map +1 -1
  29. package/resources/links/links.d.ts +554 -52
  30. package/resources/links/links.d.ts.map +1 -1
  31. package/resources/links/links.js.map +1 -1
  32. package/resources/links/links.mjs.map +1 -1
  33. package/resources/projects/index.d.ts +2 -2
  34. package/resources/projects/index.d.ts.map +1 -1
  35. package/resources/projects/index.js.map +1 -1
  36. package/resources/projects/index.mjs.map +1 -1
  37. package/resources/projects/projects.d.ts +135 -34
  38. package/resources/projects/projects.d.ts.map +1 -1
  39. package/resources/projects/projects.js.map +1 -1
  40. package/resources/projects/projects.mjs.map +1 -1
  41. package/resources/projects/tags.d.ts +0 -49
  42. package/resources/projects/tags.d.ts.map +1 -1
  43. package/resources/projects/tags.js +0 -16
  44. package/resources/projects/tags.js.map +1 -1
  45. package/resources/projects/tags.mjs +0 -16
  46. package/resources/projects/tags.mjs.map +1 -1
  47. package/resources/qr.d.ts +7 -6
  48. package/resources/qr.d.ts.map +1 -1
  49. package/resources/qr.js +5 -4
  50. package/resources/qr.js.map +1 -1
  51. package/resources/qr.mjs +5 -4
  52. package/resources/qr.mjs.map +1 -1
  53. package/src/index.ts +9 -3
  54. package/src/resources/index.ts +4 -3
  55. package/src/resources/links/bulk.ts +216 -13
  56. package/src/resources/links/index.ts +4 -2
  57. package/src/resources/links/info.ts +190 -5
  58. package/src/resources/links/links.ts +670 -53
  59. package/src/resources/projects/index.ts +2 -2
  60. package/src/resources/projects/projects.ts +166 -34
  61. package/src/resources/projects/tags.ts +1 -66
  62. package/src/resources/qr.ts +16 -7
  63. package/src/uploads.ts +2 -3
  64. package/src/version.ts +1 -1
  65. package/uploads.d.ts.map +1 -1
  66. package/uploads.js +2 -1
  67. package/uploads.js.map +1 -1
  68. package/uploads.mjs +2 -1
  69. package/uploads.mjs.map +1 -1
  70. package/version.d.ts +1 -1
  71. package/version.js +1 -1
  72. package/version.mjs +1 -1
@@ -13,7 +13,7 @@ export class Links extends APIResource {
13
13
  /**
14
14
  * Create a new link for the authenticated project.
15
15
  */
16
- create(params: LinkCreateParams, options?: Core.RequestOptions): Core.APIPromise<Link> {
16
+ create(params: LinkCreateParams, options?: Core.RequestOptions): Core.APIPromise<LinkCreateResponse> {
17
17
  const { projectSlug = this._client.projectSlug, ...body } = params;
18
18
  return this._client.post('/links', { query: { projectSlug }, body, ...options });
19
19
  }
@@ -21,7 +21,11 @@ export class Links extends APIResource {
21
21
  /**
22
22
  * Edit a link for the authenticated project.
23
23
  */
24
- update(linkId: string, params: LinkUpdateParams, options?: Core.RequestOptions): Core.APIPromise<Link> {
24
+ update(
25
+ linkId: string,
26
+ params: LinkUpdateParams,
27
+ options?: Core.RequestOptions,
28
+ ): Core.APIPromise<LinkUpdateResponse> {
25
29
  const { projectSlug = this._client.projectSlug, ...body } = params;
26
30
  return this._client.put(`/links/${linkId}`, { query: { projectSlug }, body, ...options });
27
31
  }
@@ -42,183 +46,759 @@ export class Links extends APIResource {
42
46
  linkId: string,
43
47
  params: LinkDeleteLinkParams,
44
48
  options?: Core.RequestOptions,
45
- ): Core.APIPromise<Link> {
49
+ ): Core.APIPromise<LinkDeleteLinkResponse> {
46
50
  const { projectSlug = this._client.projectSlug } = params;
47
51
  return this._client.delete(`/links/${linkId}`, { query: { projectSlug }, ...options });
48
52
  }
49
53
  }
50
54
 
51
- export interface Link {
55
+ export interface LinkCreateResponse {
52
56
  /**
53
57
  * The unique ID of the short link.
54
58
  */
55
- id?: string;
59
+ id: string;
56
60
 
57
61
  /**
58
62
  * The Android destination URL for the short link for Android device targeting.
59
63
  */
60
- android?: string | null;
64
+ android: string | null;
61
65
 
62
66
  /**
63
67
  * Whether the short link is archived.
64
68
  */
65
- archived?: boolean;
69
+ archived: boolean;
66
70
 
67
71
  /**
68
72
  * The number of clicks on the short link.
69
73
  */
70
- clicks?: number;
74
+ clicks: number;
71
75
 
72
76
  /**
73
77
  * The comments for the short link.
74
78
  */
75
- comments?: string | null;
79
+ comments: string | null;
76
80
 
77
81
  /**
78
82
  * The date and time when the short link was created.
79
83
  */
80
- createdAt?: string;
84
+ createdAt: string;
81
85
 
82
86
  /**
83
87
  * The description of the short link generated via `api.dub.co/metatags`. Will be
84
88
  * used for Custom Social Media Cards if `proxy` is true.
85
89
  */
86
- description?: string | null;
90
+ description: string | null;
87
91
 
88
92
  /**
89
93
  * The domain of the short link. If not provided, the primary domain for the
90
94
  * project will be used (or `dub.sh` if the project has no domains).
91
95
  */
92
- domain?: string;
96
+ domain: string;
93
97
 
94
98
  /**
95
99
  * The date and time when the short link will expire in ISO-8601 format. Must be in
96
100
  * the future.
97
101
  */
98
- expiresAt?: string | null;
102
+ expiresAt: string | null;
99
103
 
100
104
  /**
101
- * Geo targeting information for the short link in JSON format {[COUNTRY]:
102
- * `https://example.com` }. Learn more: `https://dub.sh/geo`
105
+ * Geo targeting information for the short link in JSON format
106
+ * `{[COUNTRY]: https://example.com }`. Learn more: https://d.to/geo
103
107
  */
104
- geo?: Record<string, string> | null;
108
+ geo: Record<string, string> | null;
105
109
 
106
110
  /**
107
111
  * The image of the short link generated via `api.dub.co/metatags`. Will be used
108
112
  * for Custom Social Media Cards if `proxy` is true.
109
113
  */
110
- image?: string | null;
114
+ image: string | null;
111
115
 
112
116
  /**
113
117
  * The iOS destination URL for the short link for iOS device targeting.
114
118
  */
115
- ios?: string | null;
119
+ ios: string | null;
116
120
 
117
121
  /**
118
122
  * The short link slug. If not provided, a random 7-character slug will be
119
123
  * generated.
120
124
  */
121
- key?: string;
125
+ key: string;
122
126
 
123
127
  /**
124
128
  * The date and time when the short link was last clicked.
125
129
  */
126
- lastClicked?: string | null;
130
+ lastClicked: string | null;
127
131
 
128
132
  /**
129
133
  * The password required to access the destination URL of the short link.
130
134
  */
131
- password?: string | null;
135
+ password: string | null;
132
136
 
133
137
  /**
134
138
  * The project ID of the short link.
135
139
  */
136
- projectId?: string;
140
+ projectId: string;
137
141
 
138
142
  /**
139
143
  * Whether the short link uses Custom Social Media Cards feature.
140
144
  */
141
- proxy?: boolean;
145
+ proxy: boolean;
142
146
 
143
147
  /**
144
148
  * Whether the short link's stats are publicly accessible.
145
149
  */
146
- publicStats?: boolean;
150
+ publicStats: boolean;
147
151
 
148
152
  /**
149
153
  * The full URL of the QR code for the short link (e.g.
150
154
  * `https://api.dub.co/qr?url=https://dub.sh/try`).
151
155
  */
152
- qrCode?: string;
156
+ qrCode: string;
153
157
 
154
158
  /**
155
159
  * Whether the short link uses link cloaking.
156
160
  */
157
- rewrite?: boolean;
161
+ rewrite: boolean;
158
162
 
159
163
  /**
160
164
  * The full URL of the short link, including the https protocol (e.g.
161
165
  * `https://dub.sh/try`).
162
166
  */
163
- shortLink?: string;
167
+ shortLink: string;
164
168
 
165
169
  /**
166
- * The unique id of the tag assigned to the short link.
170
+ * The tags assigned to the short link.
167
171
  */
168
- tagId?: string | null;
172
+ tags: Array<LinkCreateResponse.Tag> | null;
169
173
 
170
174
  /**
171
175
  * The title of the short link generated via `api.dub.co/metatags`. Will be used
172
176
  * for Custom Social Media Cards if `proxy` is true.
173
177
  */
174
- title?: string | null;
178
+ title: string | null;
175
179
 
176
180
  /**
177
181
  * The date and time when the short link was last updated.
178
182
  */
179
- updatedAt?: string;
183
+ updatedAt: string;
180
184
 
181
185
  /**
182
186
  * The destination URL of the short link.
183
187
  */
184
- url?: string;
188
+ url: string;
185
189
 
186
190
  /**
187
191
  * The user ID of the creator of the short link.
188
192
  */
189
- userId?: string;
193
+ userId: string;
194
+
195
+ /**
196
+ * The UTM campaign of the short link.
197
+ */
198
+ utm_campaign: string | null;
199
+
200
+ /**
201
+ * The UTM content of the short link.
202
+ */
203
+ utm_content: string | null;
204
+
205
+ /**
206
+ * The UTM medium of the short link.
207
+ */
208
+ utm_medium: string | null;
209
+
210
+ /**
211
+ * The UTM source of the short link.
212
+ */
213
+ utm_source: string | null;
214
+
215
+ /**
216
+ * The UTM term of the short link.
217
+ */
218
+ utm_term: string | null;
219
+ }
220
+
221
+ export namespace LinkCreateResponse {
222
+ export interface Tag {
223
+ /**
224
+ * The unique ID of the tag.
225
+ */
226
+ id: string;
227
+
228
+ /**
229
+ * The color of the tag.
230
+ */
231
+ color: 'red' | 'yellow' | 'green' | 'blue' | 'purple' | 'pink' | 'brown';
232
+
233
+ /**
234
+ * The name of the tag.
235
+ */
236
+ name: string;
237
+ }
238
+ }
239
+
240
+ export interface LinkUpdateResponse {
241
+ /**
242
+ * The unique ID of the short link.
243
+ */
244
+ id: string;
245
+
246
+ /**
247
+ * The Android destination URL for the short link for Android device targeting.
248
+ */
249
+ android: string | null;
250
+
251
+ /**
252
+ * Whether the short link is archived.
253
+ */
254
+ archived: boolean;
255
+
256
+ /**
257
+ * The number of clicks on the short link.
258
+ */
259
+ clicks: number;
260
+
261
+ /**
262
+ * The comments for the short link.
263
+ */
264
+ comments: string | null;
265
+
266
+ /**
267
+ * The date and time when the short link was created.
268
+ */
269
+ createdAt: string;
270
+
271
+ /**
272
+ * The description of the short link generated via `api.dub.co/metatags`. Will be
273
+ * used for Custom Social Media Cards if `proxy` is true.
274
+ */
275
+ description: string | null;
276
+
277
+ /**
278
+ * The domain of the short link. If not provided, the primary domain for the
279
+ * project will be used (or `dub.sh` if the project has no domains).
280
+ */
281
+ domain: string;
282
+
283
+ /**
284
+ * The date and time when the short link will expire in ISO-8601 format. Must be in
285
+ * the future.
286
+ */
287
+ expiresAt: string | null;
288
+
289
+ /**
290
+ * Geo targeting information for the short link in JSON format
291
+ * `{[COUNTRY]: https://example.com }`. Learn more: https://d.to/geo
292
+ */
293
+ geo: Record<string, string> | null;
294
+
295
+ /**
296
+ * The image of the short link generated via `api.dub.co/metatags`. Will be used
297
+ * for Custom Social Media Cards if `proxy` is true.
298
+ */
299
+ image: string | null;
300
+
301
+ /**
302
+ * The iOS destination URL for the short link for iOS device targeting.
303
+ */
304
+ ios: string | null;
305
+
306
+ /**
307
+ * The short link slug. If not provided, a random 7-character slug will be
308
+ * generated.
309
+ */
310
+ key: string;
311
+
312
+ /**
313
+ * The date and time when the short link was last clicked.
314
+ */
315
+ lastClicked: string | null;
316
+
317
+ /**
318
+ * The password required to access the destination URL of the short link.
319
+ */
320
+ password: string | null;
321
+
322
+ /**
323
+ * The project ID of the short link.
324
+ */
325
+ projectId: string;
326
+
327
+ /**
328
+ * Whether the short link uses Custom Social Media Cards feature.
329
+ */
330
+ proxy: boolean;
331
+
332
+ /**
333
+ * Whether the short link's stats are publicly accessible.
334
+ */
335
+ publicStats: boolean;
336
+
337
+ /**
338
+ * The full URL of the QR code for the short link (e.g.
339
+ * `https://api.dub.co/qr?url=https://dub.sh/try`).
340
+ */
341
+ qrCode: string;
342
+
343
+ /**
344
+ * Whether the short link uses link cloaking.
345
+ */
346
+ rewrite: boolean;
347
+
348
+ /**
349
+ * The full URL of the short link, including the https protocol (e.g.
350
+ * `https://dub.sh/try`).
351
+ */
352
+ shortLink: string;
353
+
354
+ /**
355
+ * The tags assigned to the short link.
356
+ */
357
+ tags: Array<LinkUpdateResponse.Tag> | null;
358
+
359
+ /**
360
+ * The title of the short link generated via `api.dub.co/metatags`. Will be used
361
+ * for Custom Social Media Cards if `proxy` is true.
362
+ */
363
+ title: string | null;
364
+
365
+ /**
366
+ * The date and time when the short link was last updated.
367
+ */
368
+ updatedAt: string;
369
+
370
+ /**
371
+ * The destination URL of the short link.
372
+ */
373
+ url: string;
374
+
375
+ /**
376
+ * The user ID of the creator of the short link.
377
+ */
378
+ userId: string;
190
379
 
191
380
  /**
192
381
  * The UTM campaign of the short link.
193
382
  */
194
- utm_campaign?: string | null;
383
+ utm_campaign: string | null;
195
384
 
196
385
  /**
197
386
  * The UTM content of the short link.
198
387
  */
199
- utm_content?: string | null;
388
+ utm_content: string | null;
200
389
 
201
390
  /**
202
391
  * The UTM medium of the short link.
203
392
  */
204
- utm_medium?: string | null;
393
+ utm_medium: string | null;
205
394
 
206
395
  /**
207
396
  * The UTM source of the short link.
208
397
  */
209
- utm_source?: string | null;
398
+ utm_source: string | null;
210
399
 
211
400
  /**
212
401
  * The UTM term of the short link.
213
402
  */
214
- utm_term?: string | null;
403
+ utm_term: string | null;
215
404
  }
216
405
 
217
- export type LinkListResponse = Array<Link>;
406
+ export namespace LinkUpdateResponse {
407
+ export interface Tag {
408
+ /**
409
+ * The unique ID of the tag.
410
+ */
411
+ id: string;
412
+
413
+ /**
414
+ * The color of the tag.
415
+ */
416
+ color: 'red' | 'yellow' | 'green' | 'blue' | 'purple' | 'pink' | 'brown';
417
+
418
+ /**
419
+ * The name of the tag.
420
+ */
421
+ name: string;
422
+ }
423
+ }
424
+
425
+ export type LinkListResponse = Array<LinkListResponse.LinkListResponseItem>;
426
+
427
+ export namespace LinkListResponse {
428
+ export interface LinkListResponseItem {
429
+ /**
430
+ * The unique ID of the short link.
431
+ */
432
+ id: string;
433
+
434
+ /**
435
+ * The Android destination URL for the short link for Android device targeting.
436
+ */
437
+ android: string | null;
438
+
439
+ /**
440
+ * Whether the short link is archived.
441
+ */
442
+ archived: boolean;
443
+
444
+ /**
445
+ * The number of clicks on the short link.
446
+ */
447
+ clicks: number;
448
+
449
+ /**
450
+ * The comments for the short link.
451
+ */
452
+ comments: string | null;
453
+
454
+ /**
455
+ * The date and time when the short link was created.
456
+ */
457
+ createdAt: string;
458
+
459
+ /**
460
+ * The description of the short link generated via `api.dub.co/metatags`. Will be
461
+ * used for Custom Social Media Cards if `proxy` is true.
462
+ */
463
+ description: string | null;
464
+
465
+ /**
466
+ * The domain of the short link. If not provided, the primary domain for the
467
+ * project will be used (or `dub.sh` if the project has no domains).
468
+ */
469
+ domain: string;
470
+
471
+ /**
472
+ * The date and time when the short link will expire in ISO-8601 format. Must be in
473
+ * the future.
474
+ */
475
+ expiresAt: string | null;
476
+
477
+ /**
478
+ * Geo targeting information for the short link in JSON format
479
+ * `{[COUNTRY]: https://example.com }`. Learn more: https://d.to/geo
480
+ */
481
+ geo: Record<string, string> | null;
482
+
483
+ /**
484
+ * The image of the short link generated via `api.dub.co/metatags`. Will be used
485
+ * for Custom Social Media Cards if `proxy` is true.
486
+ */
487
+ image: string | null;
488
+
489
+ /**
490
+ * The iOS destination URL for the short link for iOS device targeting.
491
+ */
492
+ ios: string | null;
493
+
494
+ /**
495
+ * The short link slug. If not provided, a random 7-character slug will be
496
+ * generated.
497
+ */
498
+ key: string;
499
+
500
+ /**
501
+ * The date and time when the short link was last clicked.
502
+ */
503
+ lastClicked: string | null;
504
+
505
+ /**
506
+ * The password required to access the destination URL of the short link.
507
+ */
508
+ password: string | null;
509
+
510
+ /**
511
+ * The project ID of the short link.
512
+ */
513
+ projectId: string;
514
+
515
+ /**
516
+ * Whether the short link uses Custom Social Media Cards feature.
517
+ */
518
+ proxy: boolean;
519
+
520
+ /**
521
+ * Whether the short link's stats are publicly accessible.
522
+ */
523
+ publicStats: boolean;
524
+
525
+ /**
526
+ * The full URL of the QR code for the short link (e.g.
527
+ * `https://api.dub.co/qr?url=https://dub.sh/try`).
528
+ */
529
+ qrCode: string;
530
+
531
+ /**
532
+ * Whether the short link uses link cloaking.
533
+ */
534
+ rewrite: boolean;
535
+
536
+ /**
537
+ * The full URL of the short link, including the https protocol (e.g.
538
+ * `https://dub.sh/try`).
539
+ */
540
+ shortLink: string;
541
+
542
+ /**
543
+ * The tags assigned to the short link.
544
+ */
545
+ tags: Array<LinkListResponseItem.Tag> | null;
546
+
547
+ /**
548
+ * The title of the short link generated via `api.dub.co/metatags`. Will be used
549
+ * for Custom Social Media Cards if `proxy` is true.
550
+ */
551
+ title: string | null;
552
+
553
+ /**
554
+ * The date and time when the short link was last updated.
555
+ */
556
+ updatedAt: string;
557
+
558
+ /**
559
+ * The destination URL of the short link.
560
+ */
561
+ url: string;
562
+
563
+ /**
564
+ * The user ID of the creator of the short link.
565
+ */
566
+ userId: string;
567
+
568
+ /**
569
+ * The UTM campaign of the short link.
570
+ */
571
+ utm_campaign: string | null;
572
+
573
+ /**
574
+ * The UTM content of the short link.
575
+ */
576
+ utm_content: string | null;
577
+
578
+ /**
579
+ * The UTM medium of the short link.
580
+ */
581
+ utm_medium: string | null;
582
+
583
+ /**
584
+ * The UTM source of the short link.
585
+ */
586
+ utm_source: string | null;
587
+
588
+ /**
589
+ * The UTM term of the short link.
590
+ */
591
+ utm_term: string | null;
592
+ }
593
+
594
+ export namespace LinkListResponseItem {
595
+ export interface Tag {
596
+ /**
597
+ * The unique ID of the tag.
598
+ */
599
+ id: string;
600
+
601
+ /**
602
+ * The color of the tag.
603
+ */
604
+ color: 'red' | 'yellow' | 'green' | 'blue' | 'purple' | 'pink' | 'brown';
605
+
606
+ /**
607
+ * The name of the tag.
608
+ */
609
+ name: string;
610
+ }
611
+ }
612
+ }
613
+
614
+ export interface LinkDeleteLinkResponse {
615
+ /**
616
+ * The unique ID of the short link.
617
+ */
618
+ id: string;
619
+
620
+ /**
621
+ * The Android destination URL for the short link for Android device targeting.
622
+ */
623
+ android: string | null;
624
+
625
+ /**
626
+ * Whether the short link is archived.
627
+ */
628
+ archived: boolean;
629
+
630
+ /**
631
+ * The number of clicks on the short link.
632
+ */
633
+ clicks: number;
634
+
635
+ /**
636
+ * The comments for the short link.
637
+ */
638
+ comments: string | null;
639
+
640
+ /**
641
+ * The date and time when the short link was created.
642
+ */
643
+ createdAt: string;
644
+
645
+ /**
646
+ * The description of the short link generated via `api.dub.co/metatags`. Will be
647
+ * used for Custom Social Media Cards if `proxy` is true.
648
+ */
649
+ description: string | null;
650
+
651
+ /**
652
+ * The domain of the short link. If not provided, the primary domain for the
653
+ * project will be used (or `dub.sh` if the project has no domains).
654
+ */
655
+ domain: string;
656
+
657
+ /**
658
+ * The date and time when the short link will expire in ISO-8601 format. Must be in
659
+ * the future.
660
+ */
661
+ expiresAt: string | null;
662
+
663
+ /**
664
+ * Geo targeting information for the short link in JSON format
665
+ * `{[COUNTRY]: https://example.com }`. Learn more: https://d.to/geo
666
+ */
667
+ geo: Record<string, string> | null;
668
+
669
+ /**
670
+ * The image of the short link generated via `api.dub.co/metatags`. Will be used
671
+ * for Custom Social Media Cards if `proxy` is true.
672
+ */
673
+ image: string | null;
674
+
675
+ /**
676
+ * The iOS destination URL for the short link for iOS device targeting.
677
+ */
678
+ ios: string | null;
679
+
680
+ /**
681
+ * The short link slug. If not provided, a random 7-character slug will be
682
+ * generated.
683
+ */
684
+ key: string;
685
+
686
+ /**
687
+ * The date and time when the short link was last clicked.
688
+ */
689
+ lastClicked: string | null;
690
+
691
+ /**
692
+ * The password required to access the destination URL of the short link.
693
+ */
694
+ password: string | null;
695
+
696
+ /**
697
+ * The project ID of the short link.
698
+ */
699
+ projectId: string;
700
+
701
+ /**
702
+ * Whether the short link uses Custom Social Media Cards feature.
703
+ */
704
+ proxy: boolean;
705
+
706
+ /**
707
+ * Whether the short link's stats are publicly accessible.
708
+ */
709
+ publicStats: boolean;
710
+
711
+ /**
712
+ * The full URL of the QR code for the short link (e.g.
713
+ * `https://api.dub.co/qr?url=https://dub.sh/try`).
714
+ */
715
+ qrCode: string;
716
+
717
+ /**
718
+ * Whether the short link uses link cloaking.
719
+ */
720
+ rewrite: boolean;
721
+
722
+ /**
723
+ * The full URL of the short link, including the https protocol (e.g.
724
+ * `https://dub.sh/try`).
725
+ */
726
+ shortLink: string;
727
+
728
+ /**
729
+ * The tags assigned to the short link.
730
+ */
731
+ tags: Array<LinkDeleteLinkResponse.Tag> | null;
732
+
733
+ /**
734
+ * The title of the short link generated via `api.dub.co/metatags`. Will be used
735
+ * for Custom Social Media Cards if `proxy` is true.
736
+ */
737
+ title: string | null;
738
+
739
+ /**
740
+ * The date and time when the short link was last updated.
741
+ */
742
+ updatedAt: string;
743
+
744
+ /**
745
+ * The destination URL of the short link.
746
+ */
747
+ url: string;
748
+
749
+ /**
750
+ * The user ID of the creator of the short link.
751
+ */
752
+ userId: string;
753
+
754
+ /**
755
+ * The UTM campaign of the short link.
756
+ */
757
+ utm_campaign: string | null;
758
+
759
+ /**
760
+ * The UTM content of the short link.
761
+ */
762
+ utm_content: string | null;
763
+
764
+ /**
765
+ * The UTM medium of the short link.
766
+ */
767
+ utm_medium: string | null;
768
+
769
+ /**
770
+ * The UTM source of the short link.
771
+ */
772
+ utm_source: string | null;
773
+
774
+ /**
775
+ * The UTM term of the short link.
776
+ */
777
+ utm_term: string | null;
778
+ }
779
+
780
+ export namespace LinkDeleteLinkResponse {
781
+ export interface Tag {
782
+ /**
783
+ * The unique ID of the tag.
784
+ */
785
+ id: string;
786
+
787
+ /**
788
+ * The color of the tag.
789
+ */
790
+ color: 'red' | 'yellow' | 'green' | 'blue' | 'purple' | 'pink' | 'brown';
791
+
792
+ /**
793
+ * The name of the tag.
794
+ */
795
+ name: string;
796
+ }
797
+ }
218
798
 
219
799
  export interface LinkCreateParams {
220
800
  /**
221
- * Query param: The slug for the project to create links for. E.g. for
801
+ * Query param: The slug for the project that the link belongs to. E.g. for
222
802
  * `app.dub.co/acme`, the projectSlug is `acme`.
223
803
  */
224
804
  projectSlug?: string;
@@ -265,7 +845,7 @@ export interface LinkCreateParams {
265
845
 
266
846
  /**
267
847
  * Body param: Geo targeting information for the short link in JSON format
268
- * {[COUNTRY]: `https://example.com` }. Learn more: `https://dub.sh/geo`
848
+ * `{[COUNTRY]: https://example.com }`.
269
849
  */
270
850
  geo?: Record<string, string> | null;
271
851
 
@@ -292,6 +872,13 @@ export interface LinkCreateParams {
292
872
  */
293
873
  password?: string | null;
294
874
 
875
+ /**
876
+ * Body param: The prefix of the short link slug for randomly-generated keys (e.g.
877
+ * if prefix is `/c/`, generated keys will be in the `/c/:key` format). Will be
878
+ * ignored if `key` is provided.
879
+ */
880
+ prefix?: string;
881
+
295
882
  /**
296
883
  * Body param: Whether the short link uses Custom Social Media Cards feature.
297
884
  */
@@ -308,10 +895,15 @@ export interface LinkCreateParams {
308
895
  rewrite?: boolean;
309
896
 
310
897
  /**
311
- * Body param: The unique id of the tag assigned to the short link.
898
+ * Body param: The unique ID of the tag assigned to the short link.
312
899
  */
313
900
  tagId?: string | null;
314
901
 
902
+ /**
903
+ * Body param: The unique IDs of the tags assigned to the short link.
904
+ */
905
+ tagIds?: Array<string> | null;
906
+
315
907
  /**
316
908
  * Body param: The title of the short link generated via `api.dub.co/metatags`.
317
909
  * Will be used for Custom Social Media Cards if `proxy` is true.
@@ -326,6 +918,11 @@ export interface LinkUpdateParams {
326
918
  */
327
919
  projectSlug?: string;
328
920
 
921
+ /**
922
+ * Body param: The destination URL of the short link.
923
+ */
924
+ url: string;
925
+
329
926
  /**
330
927
  * Body param: The Android destination URL for the short link for Android device
331
928
  * targeting.
@@ -363,7 +960,7 @@ export interface LinkUpdateParams {
363
960
 
364
961
  /**
365
962
  * Body param: Geo targeting information for the short link in JSON format
366
- * {[COUNTRY]: `https://example.com` }. Learn more: `https://dub.sh/geo`
963
+ * `{[COUNTRY]: https://example.com }`.
367
964
  */
368
965
  geo?: Record<string, string> | null;
369
966
 
@@ -390,6 +987,13 @@ export interface LinkUpdateParams {
390
987
  */
391
988
  password?: string | null;
392
989
 
990
+ /**
991
+ * Body param: The prefix of the short link slug for randomly-generated keys (e.g.
992
+ * if prefix is `/c/`, generated keys will be in the `/c/:key` format). Will be
993
+ * ignored if `key` is provided.
994
+ */
995
+ prefix?: string;
996
+
393
997
  /**
394
998
  * Body param: Whether the short link uses Custom Social Media Cards feature.
395
999
  */
@@ -406,26 +1010,26 @@ export interface LinkUpdateParams {
406
1010
  rewrite?: boolean;
407
1011
 
408
1012
  /**
409
- * Body param: The unique id of the tag assigned to the short link.
1013
+ * Body param: The unique ID of the tag assigned to the short link.
410
1014
  */
411
1015
  tagId?: string | null;
412
1016
 
413
1017
  /**
414
- * Body param: The title of the short link generated via `api.dub.co/metatags`.
415
- * Will be used for Custom Social Media Cards if `proxy` is true.
1018
+ * Body param: The unique IDs of the tags assigned to the short link.
416
1019
  */
417
- title?: string | null;
1020
+ tagIds?: Array<string> | null;
418
1021
 
419
1022
  /**
420
- * Body param: The destination URL of the short link.
1023
+ * Body param: The title of the short link generated via `api.dub.co/metatags`.
1024
+ * Will be used for Custom Social Media Cards if `proxy` is true.
421
1025
  */
422
- url?: string;
1026
+ title?: string | null;
423
1027
  }
424
1028
 
425
1029
  export interface LinkListParams {
426
1030
  /**
427
- * The slug for the project to retrieve links for. E.g. for `app.dub.co/acme`, the
428
- * projectSlug is `acme`.
1031
+ * The slug for the project that the link belongs to. E.g. for `app.dub.co/acme`,
1032
+ * the projectSlug is `acme`.
429
1033
  */
430
1034
  projectSlug?: string;
431
1035
 
@@ -450,7 +1054,7 @@ export interface LinkListParams {
450
1054
  * Whether to include archived links in the response. Defaults to `false` if not
451
1055
  * provided.
452
1056
  */
453
- showArchived?: true | false;
1057
+ showArchived?: boolean;
454
1058
 
455
1059
  /**
456
1060
  * The field to sort the links by. The default is `createdAt`, and sort order is
@@ -463,10 +1067,20 @@ export interface LinkListParams {
463
1067
  */
464
1068
  tagId?: string;
465
1069
 
1070
+ /**
1071
+ * The tag IDs to filter the links by.
1072
+ */
1073
+ tagIds?: Array<string>;
1074
+
466
1075
  /**
467
1076
  * The user ID to filter the links by.
468
1077
  */
469
1078
  userId?: string;
1079
+
1080
+ /**
1081
+ * Whether to include tags in the response. Defaults to `false` if not provided.
1082
+ */
1083
+ withTags?: boolean;
470
1084
  }
471
1085
 
472
1086
  export interface LinkDeleteLinkParams {
@@ -478,13 +1092,16 @@ export interface LinkDeleteLinkParams {
478
1092
  }
479
1093
 
480
1094
  export namespace Links {
481
- export import Link = LinksAPI.Link;
1095
+ export import LinkCreateResponse = LinksAPI.LinkCreateResponse;
1096
+ export import LinkUpdateResponse = LinksAPI.LinkUpdateResponse;
482
1097
  export import LinkListResponse = LinksAPI.LinkListResponse;
1098
+ export import LinkDeleteLinkResponse = LinksAPI.LinkDeleteLinkResponse;
483
1099
  export import LinkCreateParams = LinksAPI.LinkCreateParams;
484
1100
  export import LinkUpdateParams = LinksAPI.LinkUpdateParams;
485
1101
  export import LinkListParams = LinksAPI.LinkListParams;
486
1102
  export import LinkDeleteLinkParams = LinksAPI.LinkDeleteLinkParams;
487
1103
  export import Info = InfoAPI.Info;
1104
+ export import InfoRetrieveResponse = InfoAPI.InfoRetrieveResponse;
488
1105
  export import InfoRetrieveParams = InfoAPI.InfoRetrieveParams;
489
1106
  export import Bulk = BulkAPI.Bulk;
490
1107
  export import BulkCreateResponse = BulkAPI.BulkCreateResponse;