dub 0.8.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 (64) hide show
  1. package/CHANGELOG.md +8 -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 +163 -11
  16. package/resources/links/bulk.d.ts.map +1 -1
  17. package/resources/links/bulk.js.map +1 -1
  18. package/resources/links/bulk.mjs.map +1 -1
  19. package/resources/links/index.d.ts +2 -2
  20. package/resources/links/index.d.ts.map +1 -1
  21. package/resources/links/index.js.map +1 -1
  22. package/resources/links/index.mjs.map +1 -1
  23. package/resources/links/info.d.ts +156 -5
  24. package/resources/links/info.d.ts.map +1 -1
  25. package/resources/links/info.js.map +1 -1
  26. package/resources/links/info.mjs.map +1 -1
  27. package/resources/links/links.d.ts +529 -66
  28. package/resources/links/links.d.ts.map +1 -1
  29. package/resources/links/links.js.map +1 -1
  30. package/resources/links/links.mjs.map +1 -1
  31. package/resources/projects/index.d.ts +2 -2
  32. package/resources/projects/index.d.ts.map +1 -1
  33. package/resources/projects/index.js.map +1 -1
  34. package/resources/projects/index.mjs.map +1 -1
  35. package/resources/projects/projects.d.ts +135 -31
  36. package/resources/projects/projects.d.ts.map +1 -1
  37. package/resources/projects/projects.js.map +1 -1
  38. package/resources/projects/projects.mjs.map +1 -1
  39. package/resources/projects/tags.d.ts +0 -18
  40. package/resources/projects/tags.d.ts.map +1 -1
  41. package/resources/projects/tags.js +0 -2
  42. package/resources/projects/tags.js.map +1 -1
  43. package/resources/projects/tags.mjs +0 -2
  44. package/resources/projects/tags.mjs.map +1 -1
  45. package/resources/qr.d.ts +7 -6
  46. package/resources/qr.d.ts.map +1 -1
  47. package/resources/qr.js +5 -4
  48. package/resources/qr.js.map +1 -1
  49. package/resources/qr.mjs +5 -4
  50. package/resources/qr.mjs.map +1 -1
  51. package/src/index.ts +9 -3
  52. package/src/resources/index.ts +4 -3
  53. package/src/resources/links/bulk.ts +198 -12
  54. package/src/resources/links/index.ts +4 -2
  55. package/src/resources/links/info.ts +190 -5
  56. package/src/resources/links/links.ts +637 -67
  57. package/src/resources/projects/index.ts +2 -2
  58. package/src/resources/projects/projects.ts +166 -31
  59. package/src/resources/projects/tags.ts +0 -22
  60. package/src/resources/qr.ts +16 -7
  61. package/src/version.ts +1 -1
  62. package/version.d.ts +1 -1
  63. package/version.js +1 -1
  64. package/version.mjs +1 -1
@@ -5,7 +5,6 @@ import { APIResource } from "../../resource";
5
5
  import * as LinksAPI from "./links";
6
6
  import * as BulkAPI from "./bulk";
7
7
  import * as InfoAPI from "./info";
8
- import * as TagsAPI from "../projects/tags";
9
8
 
10
9
  export class Links extends APIResource {
11
10
  info: InfoAPI.Info = new InfoAPI.Info(this._client);
@@ -14,7 +13,7 @@ export class Links extends APIResource {
14
13
  /**
15
14
  * Create a new link for the authenticated project.
16
15
  */
17
- create(params: LinkCreateParams, options?: Core.RequestOptions): Core.APIPromise<Link> {
16
+ create(params: LinkCreateParams, options?: Core.RequestOptions): Core.APIPromise<LinkCreateResponse> {
18
17
  const { projectSlug = this._client.projectSlug, ...body } = params;
19
18
  return this._client.post('/links', { query: { projectSlug }, body, ...options });
20
19
  }
@@ -22,7 +21,11 @@ export class Links extends APIResource {
22
21
  /**
23
22
  * Edit a link for the authenticated project.
24
23
  */
25
- 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> {
26
29
  const { projectSlug = this._client.projectSlug, ...body } = params;
27
30
  return this._client.put(`/links/${linkId}`, { query: { projectSlug }, body, ...options });
28
31
  }
@@ -43,200 +46,759 @@ export class Links extends APIResource {
43
46
  linkId: string,
44
47
  params: LinkDeleteLinkParams,
45
48
  options?: Core.RequestOptions,
46
- ): Core.APIPromise<Link> {
49
+ ): Core.APIPromise<LinkDeleteLinkResponse> {
47
50
  const { projectSlug = this._client.projectSlug } = params;
48
51
  return this._client.delete(`/links/${linkId}`, { query: { projectSlug }, ...options });
49
52
  }
50
53
  }
51
54
 
52
- export interface Link {
55
+ export interface LinkCreateResponse {
53
56
  /**
54
57
  * The unique ID of the short link.
55
58
  */
56
- id?: string;
59
+ id: string;
57
60
 
58
61
  /**
59
62
  * The Android destination URL for the short link for Android device targeting.
60
63
  */
61
- android?: string | null;
64
+ android: string | null;
62
65
 
63
66
  /**
64
67
  * Whether the short link is archived.
65
68
  */
66
- archived?: boolean;
69
+ archived: boolean;
67
70
 
68
71
  /**
69
72
  * The number of clicks on the short link.
70
73
  */
71
- clicks?: number;
74
+ clicks: number;
72
75
 
73
76
  /**
74
77
  * The comments for the short link.
75
78
  */
76
- comments?: string | null;
79
+ comments: string | null;
77
80
 
78
81
  /**
79
82
  * The date and time when the short link was created.
80
83
  */
81
- createdAt?: string;
84
+ createdAt: string;
82
85
 
83
86
  /**
84
87
  * The description of the short link generated via `api.dub.co/metatags`. Will be
85
88
  * used for Custom Social Media Cards if `proxy` is true.
86
89
  */
87
- description?: string | null;
90
+ description: string | null;
88
91
 
89
92
  /**
90
93
  * The domain of the short link. If not provided, the primary domain for the
91
94
  * project will be used (or `dub.sh` if the project has no domains).
92
95
  */
93
- domain?: string;
96
+ domain: string;
94
97
 
95
98
  /**
96
99
  * The date and time when the short link will expire in ISO-8601 format. Must be in
97
100
  * the future.
98
101
  */
99
- expiresAt?: string | null;
102
+ expiresAt: string | null;
100
103
 
101
104
  /**
102
- * Geo targeting information for the short link in JSON format {[COUNTRY]:
103
- * `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
104
107
  */
105
- geo?: Record<string, string> | null;
108
+ geo: Record<string, string> | null;
106
109
 
107
110
  /**
108
111
  * The image of the short link generated via `api.dub.co/metatags`. Will be used
109
112
  * for Custom Social Media Cards if `proxy` is true.
110
113
  */
111
- image?: string | null;
114
+ image: string | null;
112
115
 
113
116
  /**
114
117
  * The iOS destination URL for the short link for iOS device targeting.
115
118
  */
116
- ios?: string | null;
119
+ ios: string | null;
117
120
 
118
121
  /**
119
122
  * The short link slug. If not provided, a random 7-character slug will be
120
123
  * generated.
121
124
  */
122
- key?: string;
125
+ key: string;
123
126
 
124
127
  /**
125
128
  * The date and time when the short link was last clicked.
126
129
  */
127
- lastClicked?: string | null;
130
+ lastClicked: string | null;
128
131
 
129
132
  /**
130
133
  * The password required to access the destination URL of the short link.
131
134
  */
132
- password?: string | null;
135
+ password: string | null;
133
136
 
134
137
  /**
135
- * The prefix of the short link slug for randomly-generated keys (e.g. if prefix is
136
- * `/c/`, generated keys will be in the `/c/:key` format). Will be ignored if `key`
137
- * is provided.
138
+ * The project ID of the short link.
138
139
  */
139
- prefix?: string;
140
+ projectId: string;
141
+
142
+ /**
143
+ * Whether the short link uses Custom Social Media Cards feature.
144
+ */
145
+ proxy: boolean;
146
+
147
+ /**
148
+ * Whether the short link's stats are publicly accessible.
149
+ */
150
+ publicStats: boolean;
151
+
152
+ /**
153
+ * The full URL of the QR code for the short link (e.g.
154
+ * `https://api.dub.co/qr?url=https://dub.sh/try`).
155
+ */
156
+ qrCode: string;
157
+
158
+ /**
159
+ * Whether the short link uses link cloaking.
160
+ */
161
+ rewrite: boolean;
162
+
163
+ /**
164
+ * The full URL of the short link, including the https protocol (e.g.
165
+ * `https://dub.sh/try`).
166
+ */
167
+ shortLink: string;
168
+
169
+ /**
170
+ * The tags assigned to the short link.
171
+ */
172
+ tags: Array<LinkCreateResponse.Tag> | null;
173
+
174
+ /**
175
+ * The title of the short link generated via `api.dub.co/metatags`. Will be used
176
+ * for Custom Social Media Cards if `proxy` is true.
177
+ */
178
+ title: string | null;
179
+
180
+ /**
181
+ * The date and time when the short link was last updated.
182
+ */
183
+ updatedAt: string;
184
+
185
+ /**
186
+ * The destination URL of the short link.
187
+ */
188
+ url: string;
189
+
190
+ /**
191
+ * The user ID of the creator of the short link.
192
+ */
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;
140
321
 
141
322
  /**
142
323
  * The project ID of the short link.
143
324
  */
144
- projectId?: string;
325
+ projectId: string;
145
326
 
146
327
  /**
147
328
  * Whether the short link uses Custom Social Media Cards feature.
148
329
  */
149
- proxy?: boolean;
330
+ proxy: boolean;
150
331
 
151
332
  /**
152
333
  * Whether the short link's stats are publicly accessible.
153
334
  */
154
- publicStats?: boolean;
335
+ publicStats: boolean;
155
336
 
156
337
  /**
157
338
  * The full URL of the QR code for the short link (e.g.
158
339
  * `https://api.dub.co/qr?url=https://dub.sh/try`).
159
340
  */
160
- qrCode?: string;
341
+ qrCode: string;
161
342
 
162
343
  /**
163
344
  * Whether the short link uses link cloaking.
164
345
  */
165
- rewrite?: boolean;
346
+ rewrite: boolean;
166
347
 
167
348
  /**
168
349
  * The full URL of the short link, including the https protocol (e.g.
169
350
  * `https://dub.sh/try`).
170
351
  */
171
- shortLink?: string;
352
+ shortLink: string;
172
353
 
173
354
  /**
174
- * The unique ID of the tag assigned to the short link.
355
+ * The tags assigned to the short link.
175
356
  */
176
- tagId?: string;
357
+ tags: Array<LinkUpdateResponse.Tag> | null;
177
358
 
178
359
  /**
179
- * The unique IDs of the tags assigned to the short link.
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.
180
362
  */
181
- tagIds?: Array<string>;
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;
379
+
380
+ /**
381
+ * The UTM campaign of the short link.
382
+ */
383
+ utm_campaign: string | null;
384
+
385
+ /**
386
+ * The UTM content of the short link.
387
+ */
388
+ utm_content: string | null;
389
+
390
+ /**
391
+ * The UTM medium of the short link.
392
+ */
393
+ utm_medium: string | null;
394
+
395
+ /**
396
+ * The UTM source of the short link.
397
+ */
398
+ utm_source: string | null;
399
+
400
+ /**
401
+ * The UTM term of the short link.
402
+ */
403
+ utm_term: string | null;
404
+ }
405
+
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;
182
727
 
183
728
  /**
184
729
  * The tags assigned to the short link.
185
730
  */
186
- tags?: Array<TagsAPI.Tag>;
731
+ tags: Array<LinkDeleteLinkResponse.Tag> | null;
187
732
 
188
733
  /**
189
734
  * The title of the short link generated via `api.dub.co/metatags`. Will be used
190
735
  * for Custom Social Media Cards if `proxy` is true.
191
736
  */
192
- title?: string | null;
737
+ title: string | null;
193
738
 
194
739
  /**
195
740
  * The date and time when the short link was last updated.
196
741
  */
197
- updatedAt?: string;
742
+ updatedAt: string;
198
743
 
199
744
  /**
200
745
  * The destination URL of the short link.
201
746
  */
202
- url?: string;
747
+ url: string;
203
748
 
204
749
  /**
205
750
  * The user ID of the creator of the short link.
206
751
  */
207
- userId?: string;
752
+ userId: string;
208
753
 
209
754
  /**
210
755
  * The UTM campaign of the short link.
211
756
  */
212
- utm_campaign?: string | null;
757
+ utm_campaign: string | null;
213
758
 
214
759
  /**
215
760
  * The UTM content of the short link.
216
761
  */
217
- utm_content?: string | null;
762
+ utm_content: string | null;
218
763
 
219
764
  /**
220
765
  * The UTM medium of the short link.
221
766
  */
222
- utm_medium?: string | null;
767
+ utm_medium: string | null;
223
768
 
224
769
  /**
225
770
  * The UTM source of the short link.
226
771
  */
227
- utm_source?: string | null;
772
+ utm_source: string | null;
228
773
 
229
774
  /**
230
775
  * The UTM term of the short link.
231
776
  */
232
- utm_term?: string | null;
777
+ utm_term: string | null;
233
778
  }
234
779
 
235
- export type LinkListResponse = Array<Link>;
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
+ }
236
798
 
237
799
  export interface LinkCreateParams {
238
800
  /**
239
- * 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
240
802
  * `app.dub.co/acme`, the projectSlug is `acme`.
241
803
  */
242
804
  projectSlug?: string;
@@ -283,7 +845,7 @@ export interface LinkCreateParams {
283
845
 
284
846
  /**
285
847
  * Body param: Geo targeting information for the short link in JSON format
286
- * {[COUNTRY]: `https://example.com` }. Learn more: `https://dub.sh/geo`
848
+ * `{[COUNTRY]: https://example.com }`.
287
849
  */
288
850
  geo?: Record<string, string> | null;
289
851
 
@@ -335,12 +897,12 @@ export interface LinkCreateParams {
335
897
  /**
336
898
  * Body param: The unique ID of the tag assigned to the short link.
337
899
  */
338
- tagId?: string;
900
+ tagId?: string | null;
339
901
 
340
902
  /**
341
903
  * Body param: The unique IDs of the tags assigned to the short link.
342
904
  */
343
- tagIds?: Array<string>;
905
+ tagIds?: Array<string> | null;
344
906
 
345
907
  /**
346
908
  * Body param: The title of the short link generated via `api.dub.co/metatags`.
@@ -356,6 +918,11 @@ export interface LinkUpdateParams {
356
918
  */
357
919
  projectSlug?: string;
358
920
 
921
+ /**
922
+ * Body param: The destination URL of the short link.
923
+ */
924
+ url: string;
925
+
359
926
  /**
360
927
  * Body param: The Android destination URL for the short link for Android device
361
928
  * targeting.
@@ -393,7 +960,7 @@ export interface LinkUpdateParams {
393
960
 
394
961
  /**
395
962
  * Body param: Geo targeting information for the short link in JSON format
396
- * {[COUNTRY]: `https://example.com` }. Learn more: `https://dub.sh/geo`
963
+ * `{[COUNTRY]: https://example.com }`.
397
964
  */
398
965
  geo?: Record<string, string> | null;
399
966
 
@@ -445,29 +1012,24 @@ export interface LinkUpdateParams {
445
1012
  /**
446
1013
  * Body param: The unique ID of the tag assigned to the short link.
447
1014
  */
448
- tagId?: string;
1015
+ tagId?: string | null;
449
1016
 
450
1017
  /**
451
1018
  * Body param: The unique IDs of the tags assigned to the short link.
452
1019
  */
453
- tagIds?: Array<string>;
1020
+ tagIds?: Array<string> | null;
454
1021
 
455
1022
  /**
456
1023
  * Body param: The title of the short link generated via `api.dub.co/metatags`.
457
1024
  * Will be used for Custom Social Media Cards if `proxy` is true.
458
1025
  */
459
1026
  title?: string | null;
460
-
461
- /**
462
- * Body param: The destination URL of the short link.
463
- */
464
- url?: string;
465
1027
  }
466
1028
 
467
1029
  export interface LinkListParams {
468
1030
  /**
469
- * The slug for the project to retrieve links for. E.g. for `app.dub.co/acme`, the
470
- * 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`.
471
1033
  */
472
1034
  projectSlug?: string;
473
1035
 
@@ -492,7 +1054,7 @@ export interface LinkListParams {
492
1054
  * Whether to include archived links in the response. Defaults to `false` if not
493
1055
  * provided.
494
1056
  */
495
- showArchived?: true | false;
1057
+ showArchived?: boolean;
496
1058
 
497
1059
  /**
498
1060
  * The field to sort the links by. The default is `createdAt`, and sort order is
@@ -501,9 +1063,14 @@ export interface LinkListParams {
501
1063
  sort?: 'createdAt' | 'clicks' | 'lastClicked';
502
1064
 
503
1065
  /**
504
- * The tag ID(s) to filter the links by.
1066
+ * The tag ID to filter the links by.
505
1067
  */
506
- tagId?: string | Array<string>;
1068
+ tagId?: string;
1069
+
1070
+ /**
1071
+ * The tag IDs to filter the links by.
1072
+ */
1073
+ tagIds?: Array<string>;
507
1074
 
508
1075
  /**
509
1076
  * The user ID to filter the links by.
@@ -511,9 +1078,9 @@ export interface LinkListParams {
511
1078
  userId?: string;
512
1079
 
513
1080
  /**
514
- * Only return links with tags. Defaults to `false` if not provided.
1081
+ * Whether to include tags in the response. Defaults to `false` if not provided.
515
1082
  */
516
- withTags?: true | false;
1083
+ withTags?: boolean;
517
1084
  }
518
1085
 
519
1086
  export interface LinkDeleteLinkParams {
@@ -525,13 +1092,16 @@ export interface LinkDeleteLinkParams {
525
1092
  }
526
1093
 
527
1094
  export namespace Links {
528
- export import Link = LinksAPI.Link;
1095
+ export import LinkCreateResponse = LinksAPI.LinkCreateResponse;
1096
+ export import LinkUpdateResponse = LinksAPI.LinkUpdateResponse;
529
1097
  export import LinkListResponse = LinksAPI.LinkListResponse;
1098
+ export import LinkDeleteLinkResponse = LinksAPI.LinkDeleteLinkResponse;
530
1099
  export import LinkCreateParams = LinksAPI.LinkCreateParams;
531
1100
  export import LinkUpdateParams = LinksAPI.LinkUpdateParams;
532
1101
  export import LinkListParams = LinksAPI.LinkListParams;
533
1102
  export import LinkDeleteLinkParams = LinksAPI.LinkDeleteLinkParams;
534
1103
  export import Info = InfoAPI.Info;
1104
+ export import InfoRetrieveResponse = InfoAPI.InfoRetrieveResponse;
535
1105
  export import InfoRetrieveParams = InfoAPI.InfoRetrieveParams;
536
1106
  export import Bulk = BulkAPI.Bulk;
537
1107
  export import BulkCreateResponse = BulkAPI.BulkCreateResponse;