@codeqr/ts 0.24.1 → 0.25.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 (129) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/LICENSE +1 -1
  3. package/README.md +28 -28
  4. package/client.d.mts +10 -10
  5. package/client.d.mts.map +1 -1
  6. package/client.d.ts +10 -10
  7. package/client.d.ts.map +1 -1
  8. package/client.js +38 -38
  9. package/client.mjs +36 -36
  10. package/core/api-promise.d.mts +2 -2
  11. package/core/api-promise.d.ts +2 -2
  12. package/core/error.d.mts +2 -2
  13. package/core/error.d.ts +2 -2
  14. package/core/error.js +4 -4
  15. package/core/error.mjs +2 -2
  16. package/core/resource.d.mts +3 -3
  17. package/core/resource.d.ts +3 -3
  18. package/index.d.mts +3 -3
  19. package/index.d.ts +3 -3
  20. package/index.js +4 -4
  21. package/index.mjs +3 -3
  22. package/internal/parse.d.mts +2 -2
  23. package/internal/parse.d.ts +2 -2
  24. package/internal/shims.js +1 -1
  25. package/internal/shims.mjs +1 -1
  26. package/internal/uploads.d.mts +4 -4
  27. package/internal/uploads.d.ts +4 -4
  28. package/internal/utils/base64.js +2 -2
  29. package/internal/utils/base64.mjs +3 -3
  30. package/internal/utils/log.d.mts +3 -3
  31. package/internal/utils/log.d.ts +3 -3
  32. package/internal/utils/path.js +1 -1
  33. package/internal/utils/path.mjs +2 -2
  34. package/internal/utils/values.js +5 -5
  35. package/internal/utils/values.mjs +6 -6
  36. package/package.json +3 -3
  37. package/resources/analytics.d.mts +38 -5
  38. package/resources/analytics.d.mts.map +1 -1
  39. package/resources/analytics.d.ts +38 -5
  40. package/resources/analytics.d.ts.map +1 -1
  41. package/resources/domains.d.mts +26 -26
  42. package/resources/domains.d.mts.map +1 -1
  43. package/resources/domains.d.ts +26 -26
  44. package/resources/domains.d.ts.map +1 -1
  45. package/resources/domains.js +8 -8
  46. package/resources/domains.js.map +1 -1
  47. package/resources/domains.mjs +8 -8
  48. package/resources/domains.mjs.map +1 -1
  49. package/resources/events.d.mts +29 -72
  50. package/resources/events.d.mts.map +1 -1
  51. package/resources/events.d.ts +29 -72
  52. package/resources/events.d.ts.map +1 -1
  53. package/resources/index.d.mts +4 -4
  54. package/resources/index.d.mts.map +1 -1
  55. package/resources/index.d.ts +4 -4
  56. package/resources/index.d.ts.map +1 -1
  57. package/resources/links/bulk.d.mts +14 -5
  58. package/resources/links/bulk.d.mts.map +1 -1
  59. package/resources/links/bulk.d.ts +14 -5
  60. package/resources/links/bulk.d.ts.map +1 -1
  61. package/resources/links/index.d.mts +1 -1
  62. package/resources/links/index.d.mts.map +1 -1
  63. package/resources/links/index.d.ts +1 -1
  64. package/resources/links/index.d.ts.map +1 -1
  65. package/resources/links/links.d.mts +263 -237
  66. package/resources/links/links.d.mts.map +1 -1
  67. package/resources/links/links.d.ts +263 -237
  68. package/resources/links/links.d.ts.map +1 -1
  69. package/resources/links/links.js +21 -21
  70. package/resources/links/links.js.map +1 -1
  71. package/resources/links/links.mjs +21 -21
  72. package/resources/links/links.mjs.map +1 -1
  73. package/resources/qrcodes/bulk.d.mts +84 -17
  74. package/resources/qrcodes/bulk.d.mts.map +1 -1
  75. package/resources/qrcodes/bulk.d.ts +84 -17
  76. package/resources/qrcodes/bulk.d.ts.map +1 -1
  77. package/resources/qrcodes/index.d.mts +1 -1
  78. package/resources/qrcodes/index.d.mts.map +1 -1
  79. package/resources/qrcodes/index.d.ts +1 -1
  80. package/resources/qrcodes/index.d.ts.map +1 -1
  81. package/resources/qrcodes/qrcodes.d.mts +409 -223
  82. package/resources/qrcodes/qrcodes.d.mts.map +1 -1
  83. package/resources/qrcodes/qrcodes.d.ts +409 -223
  84. package/resources/qrcodes/qrcodes.d.ts.map +1 -1
  85. package/resources/qrcodes/qrcodes.js +11 -11
  86. package/resources/qrcodes/qrcodes.js.map +1 -1
  87. package/resources/qrcodes/qrcodes.mjs +11 -11
  88. package/resources/qrcodes/qrcodes.mjs.map +1 -1
  89. package/resources/tags.d.mts +12 -12
  90. package/resources/tags.d.mts.map +1 -1
  91. package/resources/tags.d.ts +12 -12
  92. package/resources/tags.d.ts.map +1 -1
  93. package/resources/tags.js +6 -6
  94. package/resources/tags.js.map +1 -1
  95. package/resources/tags.mjs +6 -6
  96. package/resources/tags.mjs.map +1 -1
  97. package/resources/track.d.mts +12 -0
  98. package/resources/track.d.mts.map +1 -1
  99. package/resources/track.d.ts +12 -0
  100. package/resources/track.d.ts.map +1 -1
  101. package/src/client.ts +21 -21
  102. package/src/core/api-promise.ts +4 -4
  103. package/src/core/error.ts +2 -2
  104. package/src/core/resource.ts +3 -3
  105. package/src/index.ts +3 -3
  106. package/src/internal/parse.ts +2 -2
  107. package/src/internal/shims.ts +1 -1
  108. package/src/internal/uploads.ts +5 -5
  109. package/src/internal/utils/base64.ts +3 -3
  110. package/src/internal/utils/log.ts +3 -3
  111. package/src/internal/utils/path.ts +2 -2
  112. package/src/internal/utils/values.ts +6 -6
  113. package/src/resources/analytics.ts +45 -5
  114. package/src/resources/domains.ts +37 -37
  115. package/src/resources/events.ts +48 -82
  116. package/src/resources/index.ts +4 -4
  117. package/src/resources/links/bulk.ts +23 -6
  118. package/src/resources/links/index.ts +1 -1
  119. package/src/resources/links/links.ts +328 -257
  120. package/src/resources/qrcodes/bulk.ts +103 -17
  121. package/src/resources/qrcodes/index.ts +1 -1
  122. package/src/resources/qrcodes/qrcodes.ts +629 -368
  123. package/src/resources/tags.ts +16 -16
  124. package/src/resources/track.ts +14 -0
  125. package/src/version.ts +1 -1
  126. package/version.d.mts +1 -1
  127. package/version.d.ts +1 -1
  128. package/version.js +1 -1
  129. package/version.mjs +1 -1
@@ -26,63 +26,63 @@ export class Links extends APIResource {
26
26
  }
27
27
 
28
28
  /**
29
- * Retrieve a paginated list of links for the authenticated workspace.
29
+ * Update a link for the authenticated workspace. If there's no change, returns it
30
+ * as it is.
30
31
  *
31
32
  * @example
32
33
  * ```ts
33
- * const links = await client.links.list();
34
+ * const link = await client.links.update('linkId');
34
35
  * ```
35
36
  */
36
- list(
37
- query: LinkListParams | null | undefined = {},
37
+ update(
38
+ linkID: string,
39
+ body: LinkUpdateParams | null | undefined = {},
38
40
  options?: RequestOptions,
39
- ): APIPromise<LinkListResponse> {
40
- return this._client.get('/links', { query, ...options });
41
+ ): APIPromise<Link> {
42
+ return this._client.put(path`/links/${linkID}`, { body, ...options });
41
43
  }
42
44
 
43
45
  /**
44
- * Retrieve the info for a link.
46
+ * Retrieve a paginated list of links for the authenticated workspace.
45
47
  *
46
48
  * @example
47
49
  * ```ts
48
- * const link = await client.links.retrieveInfo({
49
- * domain: 'x',
50
- * key: 'x',
51
- * projectSlug: 'x',
52
- * });
50
+ * const links = await client.links.list();
53
51
  * ```
54
52
  */
55
- retrieveInfo(query: LinkRetrieveInfoParams, options?: RequestOptions): APIPromise<Link> {
56
- return this._client.get('/links/info', { query, ...options });
53
+ list(
54
+ query: LinkListParams | null | undefined = {},
55
+ options?: RequestOptions,
56
+ ): APIPromise<LinkListResponse> {
57
+ return this._client.get('/links', { query, ...options });
57
58
  }
58
59
 
59
60
  /**
60
- * Update a link for the authenticated workspace. If there's no change, returns it
61
- * as it is.
61
+ * Delete a link for the authenticated workspace.
62
62
  *
63
63
  * @example
64
64
  * ```ts
65
- * const link = await client.links.update('linkId');
65
+ * const link = await client.links.delete('linkId');
66
66
  * ```
67
67
  */
68
- update(
69
- linkID: string,
70
- body: LinkUpdateParams | null | undefined = {},
71
- options?: RequestOptions,
72
- ): APIPromise<Link> {
73
- return this._client.put(path`/links/${linkID}`, { body, ...options });
68
+ delete(linkID: string, options?: RequestOptions): APIPromise<LinkDeleteResponse> {
69
+ return this._client.delete(path`/links/${linkID}`, options);
74
70
  }
75
71
 
76
72
  /**
77
- * Delete a link for the authenticated workspace.
73
+ * Retrieve the info for a link.
78
74
  *
79
75
  * @example
80
76
  * ```ts
81
- * const link = await client.links.delete('linkId');
77
+ * const link = await client.links.retrieveInfo({
78
+ * domain: 'x',
79
+ * key: 'x',
80
+ * projectSlug: 'x',
81
+ * });
82
82
  * ```
83
83
  */
84
- delete(linkID: string, options?: RequestOptions): APIPromise<LinkDeleteResponse> {
85
- return this._client.delete(path`/links/${linkID}`, options);
84
+ retrieveInfo(query: LinkRetrieveInfoParams, options?: RequestOptions): APIPromise<Link> {
85
+ return this._client.get('/links/info', { query, ...options });
86
86
  }
87
87
  }
88
88
 
@@ -98,7 +98,8 @@ export interface Link {
98
98
  android: string | null;
99
99
 
100
100
  /**
101
- * Whether the short link is archived.
101
+ * Whether the short link is archived. Archiving hides it from the default
102
+ * dashboard listing; the link keeps redirecting and keeps counting clicks.
102
103
  */
103
104
  archived: boolean;
104
105
 
@@ -350,13 +351,35 @@ export interface Link {
350
351
 
351
352
  export namespace Link {
352
353
  export interface Rule {
353
- attribute: 'device' | 'country' | 'utm_source' | 'utm_medium' | 'utm_campaign' | 'referrer' | 'language';
354
-
355
- operator: 'equals' | 'not_equals';
354
+ attribute?:
355
+ | 'device'
356
+ | 'country'
357
+ | 'utm_source'
358
+ | 'utm_medium'
359
+ | 'utm_campaign'
360
+ | 'referrer'
361
+ | 'language'
362
+ | 'city'
363
+ | 'region'
364
+ | 'continent'
365
+ | 'utm_term'
366
+ | 'utm_content';
367
+
368
+ operator?: 'equals' | 'not_equals';
369
+
370
+ split?: Array<Rule.Split>;
371
+
372
+ url?: string;
373
+
374
+ value?: string;
375
+ }
356
376
 
357
- url: string;
377
+ export namespace Rule {
378
+ export interface Split {
379
+ url: string;
358
380
 
359
- value: string;
381
+ weight: number;
382
+ }
360
383
  }
361
384
  }
362
385
 
@@ -381,7 +404,8 @@ export interface LinkCreateParams {
381
404
  android?: string | null;
382
405
 
383
406
  /**
384
- * Whether the short link is archived.
407
+ * Whether the short link is archived. Archiving hides it from the default
408
+ * dashboard listing; the link keeps redirecting and keeps counting clicks.
385
409
  */
386
410
  archived?: boolean;
387
411
 
@@ -524,6 +548,7 @@ export interface LinkCreateParams {
524
548
 
525
549
  /**
526
550
  * The unique name of the tags assigned to the short link (case insensitive).
551
+ * Ignored when `tagIds` is also present.
527
552
  */
528
553
  tagNames?: string | Array<string>;
529
554
 
@@ -1063,235 +1088,229 @@ export namespace LinkCreateParams {
1063
1088
  }
1064
1089
 
1065
1090
  export interface Rule {
1066
- attribute: 'device' | 'country' | 'utm_source' | 'utm_medium' | 'utm_campaign' | 'referrer' | 'language';
1067
-
1068
- operator: 'equals' | 'not_equals';
1091
+ attribute?:
1092
+ | 'device'
1093
+ | 'country'
1094
+ | 'utm_source'
1095
+ | 'utm_medium'
1096
+ | 'utm_campaign'
1097
+ | 'referrer'
1098
+ | 'language'
1099
+ | 'city'
1100
+ | 'region'
1101
+ | 'continent'
1102
+ | 'utm_term'
1103
+ | 'utm_content';
1104
+
1105
+ operator?: 'equals' | 'not_equals';
1106
+
1107
+ split?: Array<Rule.Split>;
1108
+
1109
+ url?: string;
1110
+
1111
+ value?: string;
1112
+ }
1069
1113
 
1070
- url: string;
1114
+ export namespace Rule {
1115
+ export interface Split {
1116
+ url: string;
1071
1117
 
1072
- value: string;
1118
+ weight: number;
1119
+ }
1073
1120
  }
1074
1121
  }
1075
1122
 
1076
- export interface LinkListParams {
1077
- /**
1078
- * The Android device to filter by.
1079
- */
1080
- android?: string;
1081
-
1123
+ export interface LinkUpdateParams {
1082
1124
  /**
1083
- * Maximum number of clicks
1125
+ * The Android destination URL for the short link for Android device targeting.
1084
1126
  */
1085
- clicksMax?: number;
1127
+ android?: string | null;
1086
1128
 
1087
1129
  /**
1088
- * Minimum number of clicks
1130
+ * Whether the short link is archived. Archiving hides it from the default
1131
+ * dashboard listing; the link keeps redirecting and keeps counting clicks.
1089
1132
  */
1090
- clicksMin?: number;
1133
+ archived?: boolean;
1091
1134
 
1092
1135
  /**
1093
- * The comments to filter by.
1136
+ * The comments for the short link.
1094
1137
  */
1095
- comments?: string;
1138
+ comments?: string | null;
1096
1139
 
1097
1140
  /**
1098
- * Created after date (ISO string)
1141
+ * The description of the short link generated via `api.codeqr.io/metatags`. Will
1142
+ * be used for custom link preview if `proxy` is true.
1099
1143
  */
1100
- createdAfter?: string;
1144
+ description?: string | null;
1101
1145
 
1102
1146
  /**
1103
- * Created before date (ISO string)
1147
+ * Allow search engines to index your short link. Default is `false` if not
1148
+ * provided. Learn more: https://codeqr.link/noindex
1104
1149
  */
1105
- createdBefore?: string;
1150
+ doIndex?: boolean;
1106
1151
 
1107
1152
  /**
1108
- * The domain to filter the links. For example, `ac.me`. If not provided, all links
1109
- * of the project will be returned.
1153
+ * The domain of the short link. If not provided, the main domain of the project
1154
+ * will be used (or `codeqr.link` if the project has no domains).
1110
1155
  */
1111
1156
  domain?: string;
1112
1157
 
1113
1158
  /**
1114
- * Expires after date (ISO string)
1159
+ * The URL to redirect to when the short link expires.
1115
1160
  */
1116
- expiresAfter?: string;
1161
+ expiredUrl?: string | null;
1117
1162
 
1118
1163
  /**
1119
- * The date and time the short link will expire in ISO-8601 format. Must be in the
1120
- * future.
1164
+ * The date and time when the short link will expire in ISO-8601 format. Must be in
1165
+ * the future.
1121
1166
  */
1122
1167
  expiresAt?: string | null;
1123
1168
 
1124
1169
  /**
1125
- * Expires before date (ISO string)
1126
- */
1127
- expiresBefore?: string;
1128
-
1129
- /**
1130
- * The folder ID to filter the links by.
1131
- */
1132
- folderId?: string;
1133
-
1134
- /**
1135
- * Geographic segmentation information for the short link in JSON format
1136
- * `{[COUNTRY]: https://example.com }`.
1137
- */
1138
- geo?: LinkListParams.Geo | null;
1139
-
1140
- /**
1141
- * Filter links that have comments (any comments)
1170
+ * This is the ID of the link in your database. If set, it can be used to identify
1171
+ * the link in the future. Must be prefixed with `ext_` when passed as a query
1172
+ * parameter.
1142
1173
  */
1143
- hasComments?: boolean;
1174
+ externalId?: string | null;
1144
1175
 
1145
1176
  /**
1146
- * Filter links that have custom social media cards
1177
+ * Whether the short link is flexible.
1147
1178
  */
1148
- hasCustomSocial?: boolean;
1179
+ flexible?: boolean;
1149
1180
 
1150
1181
  /**
1151
- * Filter links that have device targeting
1182
+ * The unique ID existing folder to assign the short link to.
1152
1183
  */
1153
- hasDevice?: boolean;
1184
+ folderId?: string | null;
1154
1185
 
1155
1186
  /**
1156
- * Filter links that have expiration date (any expiration)
1187
+ * Geographic targeting information for the short link in JSON format
1188
+ * `{[COUNTRY]: https://example.com }`.
1157
1189
  */
1158
- hasExpiration?: boolean;
1190
+ geo?: LinkUpdateParams.Geo | null;
1159
1191
 
1160
1192
  /**
1161
- * Filter links that have geo-targeting
1193
+ * The image of the short link generated via `api.codeqr.io/metatags`. Will be used
1194
+ * for custom link preview if `proxy` is true.
1162
1195
  */
1163
- hasGeo?: boolean;
1196
+ image?: string | null;
1164
1197
 
1165
1198
  /**
1166
- * Filter links that have password protection (any password)
1199
+ * The iOS destination URL for the short link for iOS device targeting.
1167
1200
  */
1168
- hasPassword?: boolean;
1201
+ ios?: string | null;
1169
1202
 
1170
1203
  /**
1171
- * Filter links that have tags (any tags)
1204
+ * If the form is mandatory for the page.
1172
1205
  */
1173
- hasTags?: boolean;
1206
+ isFormMandatory?: boolean;
1174
1207
 
1175
1208
  /**
1176
- * Filter links that have UTM parameters
1209
+ * The slug of the short link. If not provided, a random 7-character slug will be
1210
+ * generated.
1177
1211
  */
1178
- hasUTM?: boolean;
1212
+ key?: string;
1179
1213
 
1180
1214
  /**
1181
- * The iOS device to filter by.
1215
+ * The ID of the page to redirect to before the link destination.
1182
1216
  */
1183
- ios?: string;
1217
+ pageId?: string | null;
1184
1218
 
1185
1219
  /**
1186
- * Link IDs to filter by.
1220
+ * The URL of the page to redirect to before the link destination.
1187
1221
  */
1188
- linkIds?: string | Array<string>;
1222
+ pageUrl?: string | null;
1189
1223
 
1190
1224
  /**
1191
- * The page number for pagination.
1225
+ * The password required to access the short link destination URL.
1192
1226
  */
1193
- page?: number;
1227
+ password?: string | null;
1194
1228
 
1195
1229
  /**
1196
- * The number of items per page.
1230
+ * The prefix of the short link slug for randomly generated keys (for example, if
1231
+ * the prefix is `/c/`, the generated keys will be in the format `/c/:key`). Will
1232
+ * be ignored if `key` is provided.
1197
1233
  */
1198
- pageSize?: number;
1234
+ prefix?: string;
1199
1235
 
1200
1236
  /**
1201
- * The password to filter by.
1237
+ * Whether the short link has pre-redirection.
1202
1238
  */
1203
- password?: string;
1239
+ preRedirection?: boolean;
1204
1240
 
1205
1241
  /**
1206
- * The slug of the project to which the link belongs. For example, for
1207
- * `app.codeqr.io/acme`, the projectSlug is `acme`.
1242
+ * Whether the short link uses the custom link preview feature.
1208
1243
  */
1209
- projectSlug?: string;
1244
+ proxy?: boolean;
1210
1245
 
1211
1246
  /**
1212
- * The search term to filter the links. The search term will be matched against the
1213
- * short link slug and the destination URL.
1247
+ * Whether the short link statistics are publicly accessible.
1214
1248
  */
1215
- search?: string;
1249
+ publicStats?: boolean;
1216
1250
 
1217
1251
  /**
1218
- * If should include archived links in the response. The default is `false` if not
1219
- * provided.
1252
+ * Whether the short link uses link cloaking.
1220
1253
  */
1221
- showArchived?: boolean;
1254
+ rewrite?: boolean;
1222
1255
 
1223
1256
  /**
1224
- * The field to sort the links by. The default is `createdAt`, and sort order is
1225
- * always descending.
1257
+ * Smart rules for conditional destination routing by request attribute.
1226
1258
  */
1227
- sort?: 'createdAt' | 'clicks' | 'lastClicked';
1259
+ rules?: Array<LinkUpdateParams.Rule> | null;
1228
1260
 
1229
1261
  /**
1230
- * @deprecated [OBSOLETO (use tagIds em vez disso)]: The unique ID of the tag
1231
- * assigned to the short link.
1262
+ * @deprecated The unique ID of the tag assigned to the short link. This field is
1263
+ * deprecated – use `tagIds` instead.
1232
1264
  */
1233
- tagId?: string;
1265
+ tagId?: string | null;
1234
1266
 
1235
1267
  /**
1236
- * The IDs of the tags to filter the links.
1268
+ * The unique IDs of the tags assigned to the short link.
1237
1269
  */
1238
1270
  tagIds?: string | Array<string>;
1239
1271
 
1240
1272
  /**
1241
1273
  * The unique name of the tags assigned to the short link (case insensitive).
1274
+ * Ignored when `tagIds` is also present.
1242
1275
  */
1243
1276
  tagNames?: string | Array<string>;
1244
1277
 
1245
1278
  /**
1246
- * If should include links with conversion tracking enabled. The default is `false`
1247
- * if not provided.
1248
- */
1249
- trackConversion?: boolean;
1250
-
1251
- /**
1252
- * Filter links marked as templates.
1253
- */
1254
- useAsTemplate?: boolean;
1255
-
1256
- /**
1257
- * The ID of the user to filter by.
1258
- */
1259
- userId?: string;
1260
-
1261
- /**
1262
- * Filter by UTM campaign value
1279
+ * The title of the short link generated via `api.codeqr.io/metatags`. Will be used
1280
+ * for custom link preview if `proxy` is true.
1263
1281
  */
1264
- utm_campaign?: string;
1282
+ title?: string | null;
1265
1283
 
1266
1284
  /**
1267
- * Filter by UTM content value
1285
+ * Whether to track conversions for the short link.
1268
1286
  */
1269
- utm_content?: string;
1287
+ trackConversion?: boolean;
1270
1288
 
1271
1289
  /**
1272
- * Filter by UTM medium value
1290
+ * The destination URL of the short link.
1273
1291
  */
1274
- utm_medium?: string;
1292
+ url?: string;
1275
1293
 
1276
1294
  /**
1277
- * Filter by UTM source value
1295
+ * Whether this link should be used as a reusable template.
1278
1296
  */
1279
- utm_source?: string;
1297
+ useAsTemplate?: boolean;
1280
1298
 
1281
1299
  /**
1282
- * Filter by UTM term value
1300
+ * The video of the short link.
1283
1301
  */
1284
- utm_term?: string;
1302
+ video?: string | null;
1285
1303
 
1286
1304
  /**
1287
- * If should include tags in the response. The default is `false` if not provided.
1305
+ * An array of webhook IDs to trigger when the link is clicked. These webhooks will
1306
+ * receive click event data.
1288
1307
  */
1289
- withTags?: boolean;
1308
+ webhookIds?: Array<string> | null;
1290
1309
  }
1291
1310
 
1292
- export namespace LinkListParams {
1311
+ export namespace LinkUpdateParams {
1293
1312
  /**
1294
- * Geographic segmentation information for the short link in JSON format
1313
+ * Geographic targeting information for the short link in JSON format
1295
1314
  * `{[COUNTRY]: https://example.com }`.
1296
1315
  */
1297
1316
  export interface Geo {
@@ -1795,184 +1814,201 @@ export namespace LinkListParams {
1795
1814
 
1796
1815
  ZW?: string;
1797
1816
  }
1798
- }
1799
1817
 
1800
- export interface LinkRetrieveInfoParams {
1801
- /**
1802
- * The domain of the link to be retrieved. For example, for `codeqr.link/github`,
1803
- * the domain is `codeqr.link`.
1804
- */
1805
- domain: string;
1818
+ export interface Rule {
1819
+ attribute?:
1820
+ | 'device'
1821
+ | 'country'
1822
+ | 'utm_source'
1823
+ | 'utm_medium'
1824
+ | 'utm_campaign'
1825
+ | 'referrer'
1826
+ | 'language'
1827
+ | 'city'
1828
+ | 'region'
1829
+ | 'continent'
1830
+ | 'utm_term'
1831
+ | 'utm_content';
1832
+
1833
+ operator?: 'equals' | 'not_equals';
1834
+
1835
+ split?: Array<Rule.Split>;
1836
+
1837
+ url?: string;
1838
+
1839
+ value?: string;
1840
+ }
1806
1841
 
1842
+ export namespace Rule {
1843
+ export interface Split {
1844
+ url: string;
1845
+
1846
+ weight: number;
1847
+ }
1848
+ }
1849
+ }
1850
+
1851
+ export interface LinkListParams {
1807
1852
  /**
1808
- * The key of the link to be retrieved. For example, for `codeqr.link/github`, the
1809
- * key is `github`.
1853
+ * The Android device to filter by.
1810
1854
  */
1811
- key: string;
1855
+ android?: string;
1812
1856
 
1813
1857
  /**
1814
- * The slug of the project to which the link belongs. For example, for
1815
- * `app.codeqr.io/acme`, the projectSlug is `acme`.
1858
+ * Maximum number of clicks
1816
1859
  */
1817
- projectSlug: string;
1860
+ clicksMax?: number;
1818
1861
 
1819
1862
  /**
1820
- * This is the ID of the link in your database. Must be prefixed with `ext_` when
1821
- * passed as a query parameter.
1863
+ * Minimum number of clicks
1822
1864
  */
1823
- externalId?: string;
1865
+ clicksMin?: number;
1824
1866
 
1825
1867
  /**
1826
- * The unique ID of the short link.
1868
+ * The comments to filter by.
1827
1869
  */
1828
- linkId?: string;
1829
- }
1870
+ comments?: string;
1830
1871
 
1831
- export interface LinkUpdateParams {
1832
1872
  /**
1833
- * The Android destination URL for the short link for Android device targeting.
1873
+ * Created after date (ISO string)
1834
1874
  */
1835
- android?: string | null;
1875
+ createdAfter?: string;
1836
1876
 
1837
1877
  /**
1838
- * Whether the short link is archived.
1878
+ * Created before date (ISO string)
1839
1879
  */
1840
- archived?: boolean;
1880
+ createdBefore?: string;
1841
1881
 
1842
1882
  /**
1843
- * The comments for the short link.
1883
+ * The domain to filter the links. For example, `ac.me`. If not provided, all links
1884
+ * of the project will be returned.
1844
1885
  */
1845
- comments?: string | null;
1886
+ domain?: string;
1846
1887
 
1847
1888
  /**
1848
- * The description of the short link generated via `api.codeqr.io/metatags`. Will
1849
- * be used for custom link preview if `proxy` is true.
1889
+ * Expires after date (ISO string)
1850
1890
  */
1851
- description?: string | null;
1891
+ expiresAfter?: string;
1852
1892
 
1853
1893
  /**
1854
- * Allow search engines to index your short link. Default is `false` if not
1855
- * provided. Learn more: https://codeqr.link/noindex
1894
+ * The date and time the short link will expire in ISO-8601 format. Must be in the
1895
+ * future.
1856
1896
  */
1857
- doIndex?: boolean;
1897
+ expiresAt?: string | null;
1858
1898
 
1859
1899
  /**
1860
- * The domain of the short link. If not provided, the main domain of the project
1861
- * will be used (or `codeqr.link` if the project has no domains).
1900
+ * Expires before date (ISO string)
1862
1901
  */
1863
- domain?: string;
1902
+ expiresBefore?: string;
1864
1903
 
1865
1904
  /**
1866
- * The URL to redirect to when the short link expires.
1905
+ * The folder ID to filter the links by.
1867
1906
  */
1868
- expiredUrl?: string | null;
1907
+ folderId?: string;
1869
1908
 
1870
1909
  /**
1871
- * The date and time when the short link will expire in ISO-8601 format. Must be in
1872
- * the future.
1910
+ * Geographic segmentation information for the short link in JSON format
1911
+ * `{[COUNTRY]: https://example.com }`.
1873
1912
  */
1874
- expiresAt?: string | null;
1913
+ geo?: LinkListParams.Geo | null;
1875
1914
 
1876
1915
  /**
1877
- * This is the ID of the link in your database. If set, it can be used to identify
1878
- * the link in the future. Must be prefixed with `ext_` when passed as a query
1879
- * parameter.
1916
+ * Filter links that have comments (any comments)
1880
1917
  */
1881
- externalId?: string | null;
1918
+ hasComments?: boolean;
1882
1919
 
1883
1920
  /**
1884
- * Whether the short link is flexible.
1921
+ * Filter links that have custom social media cards
1885
1922
  */
1886
- flexible?: boolean;
1923
+ hasCustomSocial?: boolean;
1887
1924
 
1888
1925
  /**
1889
- * The unique ID existing folder to assign the short link to.
1926
+ * Filter links that have device targeting
1890
1927
  */
1891
- folderId?: string | null;
1928
+ hasDevice?: boolean;
1892
1929
 
1893
1930
  /**
1894
- * Geographic targeting information for the short link in JSON format
1895
- * `{[COUNTRY]: https://example.com }`.
1931
+ * Filter links that have expiration date (any expiration)
1896
1932
  */
1897
- geo?: LinkUpdateParams.Geo | null;
1933
+ hasExpiration?: boolean;
1898
1934
 
1899
1935
  /**
1900
- * The image of the short link generated via `api.codeqr.io/metatags`. Will be used
1901
- * for custom link preview if `proxy` is true.
1936
+ * Filter links that have geo-targeting
1902
1937
  */
1903
- image?: string | null;
1938
+ hasGeo?: boolean;
1904
1939
 
1905
1940
  /**
1906
- * The iOS destination URL for the short link for iOS device targeting.
1941
+ * Filter links that have password protection (any password)
1907
1942
  */
1908
- ios?: string | null;
1943
+ hasPassword?: boolean;
1909
1944
 
1910
1945
  /**
1911
- * If the form is mandatory for the page.
1946
+ * Filter links that have tags (any tags)
1912
1947
  */
1913
- isFormMandatory?: boolean;
1948
+ hasTags?: boolean;
1914
1949
 
1915
1950
  /**
1916
- * The slug of the short link. If not provided, a random 7-character slug will be
1917
- * generated.
1951
+ * Filter links that have UTM parameters
1918
1952
  */
1919
- key?: string;
1953
+ hasUTM?: boolean;
1920
1954
 
1921
1955
  /**
1922
- * The ID of the page to redirect to before the link destination.
1956
+ * The iOS device to filter by.
1923
1957
  */
1924
- pageId?: string | null;
1958
+ ios?: string;
1925
1959
 
1926
1960
  /**
1927
- * The URL of the page to redirect to before the link destination.
1961
+ * Link IDs to filter by.
1928
1962
  */
1929
- pageUrl?: string | null;
1963
+ linkIds?: string | Array<string>;
1930
1964
 
1931
1965
  /**
1932
- * The password required to access the short link destination URL.
1966
+ * The page number for pagination.
1933
1967
  */
1934
- password?: string | null;
1968
+ page?: number;
1935
1969
 
1936
1970
  /**
1937
- * The prefix of the short link slug for randomly generated keys (for example, if
1938
- * the prefix is `/c/`, the generated keys will be in the format `/c/:key`). Will
1939
- * be ignored if `key` is provided.
1971
+ * The number of items per page.
1940
1972
  */
1941
- prefix?: string;
1973
+ pageSize?: number;
1942
1974
 
1943
1975
  /**
1944
- * Whether the short link has pre-redirection.
1976
+ * The password to filter by.
1945
1977
  */
1946
- preRedirection?: boolean;
1978
+ password?: string;
1947
1979
 
1948
1980
  /**
1949
- * Whether the short link uses the custom link preview feature.
1981
+ * The slug of the project to which the link belongs. For example, for
1982
+ * `app.codeqr.io/acme`, the projectSlug is `acme`.
1950
1983
  */
1951
- proxy?: boolean;
1984
+ projectSlug?: string;
1952
1985
 
1953
1986
  /**
1954
- * Whether the short link statistics are publicly accessible.
1987
+ * The search term to filter the links. The search term will be matched against the
1988
+ * short link slug and the destination URL.
1955
1989
  */
1956
- publicStats?: boolean;
1990
+ search?: string;
1957
1991
 
1958
1992
  /**
1959
- * Whether the short link uses link cloaking.
1993
+ * If should include archived links in the response. The default is `false` if not
1994
+ * provided.
1960
1995
  */
1961
- rewrite?: boolean;
1996
+ showArchived?: boolean;
1962
1997
 
1963
1998
  /**
1964
- * Smart rules for conditional destination routing by request attribute.
1999
+ * The field to sort the links by. The default is `createdAt`, and sort order is
2000
+ * always descending.
1965
2001
  */
1966
- rules?: Array<LinkUpdateParams.Rule> | null;
2002
+ sort?: 'createdAt' | 'clicks' | 'lastClicked';
1967
2003
 
1968
2004
  /**
1969
- * @deprecated The unique ID of the tag assigned to the short link. This field is
1970
- * deprecated – use `tagIds` instead.
2005
+ * @deprecated [OBSOLETO (use tagIds em vez disso)]: The unique ID of the tag
2006
+ * assigned to the short link.
1971
2007
  */
1972
- tagId?: string | null;
2008
+ tagId?: string;
1973
2009
 
1974
2010
  /**
1975
- * The unique IDs of the tags assigned to the short link.
2011
+ * The IDs of the tags to filter the links.
1976
2012
  */
1977
2013
  tagIds?: string | Array<string>;
1978
2014
 
@@ -1982,41 +2018,55 @@ export interface LinkUpdateParams {
1982
2018
  tagNames?: string | Array<string>;
1983
2019
 
1984
2020
  /**
1985
- * The title of the short link generated via `api.codeqr.io/metatags`. Will be used
1986
- * for custom link preview if `proxy` is true.
2021
+ * If should include links with conversion tracking enabled. The default is `false`
2022
+ * if not provided.
1987
2023
  */
1988
- title?: string | null;
2024
+ trackConversion?: boolean;
1989
2025
 
1990
2026
  /**
1991
- * Whether to track conversions for the short link.
2027
+ * Filter links marked as templates.
1992
2028
  */
1993
- trackConversion?: boolean;
2029
+ useAsTemplate?: boolean;
1994
2030
 
1995
2031
  /**
1996
- * The destination URL of the short link.
2032
+ * The ID of the user to filter by.
1997
2033
  */
1998
- url?: string;
2034
+ userId?: string;
1999
2035
 
2000
2036
  /**
2001
- * Whether this link should be used as a reusable template.
2037
+ * Filter by UTM campaign value
2002
2038
  */
2003
- useAsTemplate?: boolean;
2039
+ utm_campaign?: string;
2004
2040
 
2005
2041
  /**
2006
- * The video of the short link.
2042
+ * Filter by UTM content value
2007
2043
  */
2008
- video?: string | null;
2044
+ utm_content?: string;
2009
2045
 
2010
2046
  /**
2011
- * An array of webhook IDs to trigger when the link is clicked. These webhooks will
2012
- * receive click event data.
2047
+ * Filter by UTM medium value
2013
2048
  */
2014
- webhookIds?: Array<string> | null;
2049
+ utm_medium?: string;
2050
+
2051
+ /**
2052
+ * Filter by UTM source value
2053
+ */
2054
+ utm_source?: string;
2055
+
2056
+ /**
2057
+ * Filter by UTM term value
2058
+ */
2059
+ utm_term?: string;
2060
+
2061
+ /**
2062
+ * If should include tags in the response. The default is `false` if not provided.
2063
+ */
2064
+ withTags?: boolean;
2015
2065
  }
2016
2066
 
2017
- export namespace LinkUpdateParams {
2067
+ export namespace LinkListParams {
2018
2068
  /**
2019
- * Geographic targeting information for the short link in JSON format
2069
+ * Geographic segmentation information for the short link in JSON format
2020
2070
  * `{[COUNTRY]: https://example.com }`.
2021
2071
  */
2022
2072
  export interface Geo {
@@ -2520,16 +2570,37 @@ export namespace LinkUpdateParams {
2520
2570
 
2521
2571
  ZW?: string;
2522
2572
  }
2573
+ }
2523
2574
 
2524
- export interface Rule {
2525
- attribute: 'device' | 'country' | 'utm_source' | 'utm_medium' | 'utm_campaign' | 'referrer' | 'language';
2575
+ export interface LinkRetrieveInfoParams {
2576
+ /**
2577
+ * The domain of the link to be retrieved. For example, for `codeqr.link/github`,
2578
+ * the domain is `codeqr.link`.
2579
+ */
2580
+ domain: string;
2526
2581
 
2527
- operator: 'equals' | 'not_equals';
2582
+ /**
2583
+ * The key of the link to be retrieved. For example, for `codeqr.link/github`, the
2584
+ * key is `github`.
2585
+ */
2586
+ key: string;
2587
+
2588
+ /**
2589
+ * The slug of the project to which the link belongs. For example, for
2590
+ * `app.codeqr.io/acme`, the projectSlug is `acme`.
2591
+ */
2592
+ projectSlug: string;
2528
2593
 
2529
- url: string;
2594
+ /**
2595
+ * This is the ID of the link in your database. Must be prefixed with `ext_` when
2596
+ * passed as a query parameter.
2597
+ */
2598
+ externalId?: string;
2530
2599
 
2531
- value: string;
2532
- }
2600
+ /**
2601
+ * The unique ID of the short link.
2602
+ */
2603
+ linkId?: string;
2533
2604
  }
2534
2605
 
2535
2606
  Links.Bulk = Bulk;
@@ -2540,9 +2611,9 @@ export declare namespace Links {
2540
2611
  type LinkListResponse as LinkListResponse,
2541
2612
  type LinkDeleteResponse as LinkDeleteResponse,
2542
2613
  type LinkCreateParams as LinkCreateParams,
2614
+ type LinkUpdateParams as LinkUpdateParams,
2543
2615
  type LinkListParams as LinkListParams,
2544
2616
  type LinkRetrieveInfoParams as LinkRetrieveInfoParams,
2545
- type LinkUpdateParams as LinkUpdateParams,
2546
2617
  };
2547
2618
 
2548
2619
  export {