@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
@@ -18,46 +18,46 @@ export declare class Links extends APIResource {
18
18
  */
19
19
  create(body: LinkCreateParams, options?: RequestOptions): APIPromise<Link>;
20
20
  /**
21
- * Retrieve a paginated list of links for the authenticated workspace.
21
+ * Update a link for the authenticated workspace. If there's no change, returns it
22
+ * as it is.
22
23
  *
23
24
  * @example
24
25
  * ```ts
25
- * const links = await client.links.list();
26
+ * const link = await client.links.update('linkId');
26
27
  * ```
27
28
  */
28
- list(query?: LinkListParams | null | undefined, options?: RequestOptions): APIPromise<LinkListResponse>;
29
+ update(linkID: string, body?: LinkUpdateParams | null | undefined, options?: RequestOptions): APIPromise<Link>;
29
30
  /**
30
- * Retrieve the info for a link.
31
+ * Retrieve a paginated list of links for the authenticated workspace.
31
32
  *
32
33
  * @example
33
34
  * ```ts
34
- * const link = await client.links.retrieveInfo({
35
- * domain: 'x',
36
- * key: 'x',
37
- * projectSlug: 'x',
38
- * });
35
+ * const links = await client.links.list();
39
36
  * ```
40
37
  */
41
- retrieveInfo(query: LinkRetrieveInfoParams, options?: RequestOptions): APIPromise<Link>;
38
+ list(query?: LinkListParams | null | undefined, options?: RequestOptions): APIPromise<LinkListResponse>;
42
39
  /**
43
- * Update a link for the authenticated workspace. If there's no change, returns it
44
- * as it is.
40
+ * Delete a link for the authenticated workspace.
45
41
  *
46
42
  * @example
47
43
  * ```ts
48
- * const link = await client.links.update('linkId');
44
+ * const link = await client.links.delete('linkId');
49
45
  * ```
50
46
  */
51
- update(linkID: string, body?: LinkUpdateParams | null | undefined, options?: RequestOptions): APIPromise<Link>;
47
+ delete(linkID: string, options?: RequestOptions): APIPromise<LinkDeleteResponse>;
52
48
  /**
53
- * Delete a link for the authenticated workspace.
49
+ * Retrieve the info for a link.
54
50
  *
55
51
  * @example
56
52
  * ```ts
57
- * const link = await client.links.delete('linkId');
53
+ * const link = await client.links.retrieveInfo({
54
+ * domain: 'x',
55
+ * key: 'x',
56
+ * projectSlug: 'x',
57
+ * });
58
58
  * ```
59
59
  */
60
- delete(linkID: string, options?: RequestOptions): APIPromise<LinkDeleteResponse>;
60
+ retrieveInfo(query: LinkRetrieveInfoParams, options?: RequestOptions): APIPromise<Link>;
61
61
  }
62
62
  export interface Link {
63
63
  /**
@@ -69,7 +69,8 @@ export interface Link {
69
69
  */
70
70
  android: string | null;
71
71
  /**
72
- * Whether the short link is archived.
72
+ * Whether the short link is archived. Archiving hides it from the default
73
+ * dashboard listing; the link keeps redirecting and keeps counting clicks.
73
74
  */
74
75
  archived: boolean;
75
76
  /**
@@ -275,10 +276,17 @@ export interface Link {
275
276
  }
276
277
  export declare namespace Link {
277
278
  interface Rule {
278
- attribute: 'device' | 'country' | 'utm_source' | 'utm_medium' | 'utm_campaign' | 'referrer' | 'language';
279
- operator: 'equals' | 'not_equals';
280
- url: string;
281
- value: string;
279
+ attribute?: 'device' | 'country' | 'utm_source' | 'utm_medium' | 'utm_campaign' | 'referrer' | 'language' | 'city' | 'region' | 'continent' | 'utm_term' | 'utm_content';
280
+ operator?: 'equals' | 'not_equals';
281
+ split?: Array<Rule.Split>;
282
+ url?: string;
283
+ value?: string;
284
+ }
285
+ namespace Rule {
286
+ interface Split {
287
+ url: string;
288
+ weight: number;
289
+ }
282
290
  }
283
291
  }
284
292
  export type LinkListResponse = Array<Link>;
@@ -298,7 +306,8 @@ export interface LinkCreateParams {
298
306
  */
299
307
  android?: string | null;
300
308
  /**
301
- * Whether the short link is archived.
309
+ * Whether the short link is archived. Archiving hides it from the default
310
+ * dashboard listing; the link keeps redirecting and keeps counting clicks.
302
311
  */
303
312
  archived?: boolean;
304
313
  /**
@@ -415,6 +424,7 @@ export interface LinkCreateParams {
415
424
  tagIds?: string | Array<string>;
416
425
  /**
417
426
  * The unique name of the tags assigned to the short link (case insensitive).
427
+ * Ignored when `tagIds` is also present.
418
428
  */
419
429
  tagNames?: string | Array<string>;
420
430
  /**
@@ -698,190 +708,176 @@ export declare namespace LinkCreateParams {
698
708
  ZW?: string;
699
709
  }
700
710
  interface Rule {
701
- attribute: 'device' | 'country' | 'utm_source' | 'utm_medium' | 'utm_campaign' | 'referrer' | 'language';
702
- operator: 'equals' | 'not_equals';
703
- url: string;
704
- value: string;
711
+ attribute?: 'device' | 'country' | 'utm_source' | 'utm_medium' | 'utm_campaign' | 'referrer' | 'language' | 'city' | 'region' | 'continent' | 'utm_term' | 'utm_content';
712
+ operator?: 'equals' | 'not_equals';
713
+ split?: Array<Rule.Split>;
714
+ url?: string;
715
+ value?: string;
716
+ }
717
+ namespace Rule {
718
+ interface Split {
719
+ url: string;
720
+ weight: number;
721
+ }
705
722
  }
706
723
  }
707
- export interface LinkListParams {
708
- /**
709
- * The Android device to filter by.
710
- */
711
- android?: string;
724
+ export interface LinkUpdateParams {
712
725
  /**
713
- * Maximum number of clicks
726
+ * The Android destination URL for the short link for Android device targeting.
714
727
  */
715
- clicksMax?: number;
728
+ android?: string | null;
716
729
  /**
717
- * Minimum number of clicks
730
+ * Whether the short link is archived. Archiving hides it from the default
731
+ * dashboard listing; the link keeps redirecting and keeps counting clicks.
718
732
  */
719
- clicksMin?: number;
733
+ archived?: boolean;
720
734
  /**
721
- * The comments to filter by.
735
+ * The comments for the short link.
722
736
  */
723
- comments?: string;
737
+ comments?: string | null;
724
738
  /**
725
- * Created after date (ISO string)
739
+ * The description of the short link generated via `api.codeqr.io/metatags`. Will
740
+ * be used for custom link preview if `proxy` is true.
726
741
  */
727
- createdAfter?: string;
742
+ description?: string | null;
728
743
  /**
729
- * Created before date (ISO string)
744
+ * Allow search engines to index your short link. Default is `false` if not
745
+ * provided. Learn more: https://codeqr.link/noindex
730
746
  */
731
- createdBefore?: string;
747
+ doIndex?: boolean;
732
748
  /**
733
- * The domain to filter the links. For example, `ac.me`. If not provided, all links
734
- * of the project will be returned.
749
+ * The domain of the short link. If not provided, the main domain of the project
750
+ * will be used (or `codeqr.link` if the project has no domains).
735
751
  */
736
752
  domain?: string;
737
753
  /**
738
- * Expires after date (ISO string)
754
+ * The URL to redirect to when the short link expires.
739
755
  */
740
- expiresAfter?: string;
756
+ expiredUrl?: string | null;
741
757
  /**
742
- * The date and time the short link will expire in ISO-8601 format. Must be in the
743
- * future.
758
+ * The date and time when the short link will expire in ISO-8601 format. Must be in
759
+ * the future.
744
760
  */
745
761
  expiresAt?: string | null;
746
762
  /**
747
- * Expires before date (ISO string)
748
- */
749
- expiresBefore?: string;
750
- /**
751
- * The folder ID to filter the links by.
752
- */
753
- folderId?: string;
754
- /**
755
- * Geographic segmentation information for the short link in JSON format
756
- * `{[COUNTRY]: https://example.com }`.
757
- */
758
- geo?: LinkListParams.Geo | null;
759
- /**
760
- * Filter links that have comments (any comments)
763
+ * This is the ID of the link in your database. If set, it can be used to identify
764
+ * the link in the future. Must be prefixed with `ext_` when passed as a query
765
+ * parameter.
761
766
  */
762
- hasComments?: boolean;
767
+ externalId?: string | null;
763
768
  /**
764
- * Filter links that have custom social media cards
769
+ * Whether the short link is flexible.
765
770
  */
766
- hasCustomSocial?: boolean;
771
+ flexible?: boolean;
767
772
  /**
768
- * Filter links that have device targeting
773
+ * The unique ID existing folder to assign the short link to.
769
774
  */
770
- hasDevice?: boolean;
775
+ folderId?: string | null;
771
776
  /**
772
- * Filter links that have expiration date (any expiration)
777
+ * Geographic targeting information for the short link in JSON format
778
+ * `{[COUNTRY]: https://example.com }`.
773
779
  */
774
- hasExpiration?: boolean;
780
+ geo?: LinkUpdateParams.Geo | null;
775
781
  /**
776
- * Filter links that have geo-targeting
782
+ * The image of the short link generated via `api.codeqr.io/metatags`. Will be used
783
+ * for custom link preview if `proxy` is true.
777
784
  */
778
- hasGeo?: boolean;
785
+ image?: string | null;
779
786
  /**
780
- * Filter links that have password protection (any password)
787
+ * The iOS destination URL for the short link for iOS device targeting.
781
788
  */
782
- hasPassword?: boolean;
789
+ ios?: string | null;
783
790
  /**
784
- * Filter links that have tags (any tags)
791
+ * If the form is mandatory for the page.
785
792
  */
786
- hasTags?: boolean;
793
+ isFormMandatory?: boolean;
787
794
  /**
788
- * Filter links that have UTM parameters
795
+ * The slug of the short link. If not provided, a random 7-character slug will be
796
+ * generated.
789
797
  */
790
- hasUTM?: boolean;
798
+ key?: string;
791
799
  /**
792
- * The iOS device to filter by.
800
+ * The ID of the page to redirect to before the link destination.
793
801
  */
794
- ios?: string;
802
+ pageId?: string | null;
795
803
  /**
796
- * Link IDs to filter by.
804
+ * The URL of the page to redirect to before the link destination.
797
805
  */
798
- linkIds?: string | Array<string>;
806
+ pageUrl?: string | null;
799
807
  /**
800
- * The page number for pagination.
808
+ * The password required to access the short link destination URL.
801
809
  */
802
- page?: number;
810
+ password?: string | null;
803
811
  /**
804
- * The number of items per page.
812
+ * The prefix of the short link slug for randomly generated keys (for example, if
813
+ * the prefix is `/c/`, the generated keys will be in the format `/c/:key`). Will
814
+ * be ignored if `key` is provided.
805
815
  */
806
- pageSize?: number;
816
+ prefix?: string;
807
817
  /**
808
- * The password to filter by.
818
+ * Whether the short link has pre-redirection.
809
819
  */
810
- password?: string;
820
+ preRedirection?: boolean;
811
821
  /**
812
- * The slug of the project to which the link belongs. For example, for
813
- * `app.codeqr.io/acme`, the projectSlug is `acme`.
822
+ * Whether the short link uses the custom link preview feature.
814
823
  */
815
- projectSlug?: string;
824
+ proxy?: boolean;
816
825
  /**
817
- * The search term to filter the links. The search term will be matched against the
818
- * short link slug and the destination URL.
826
+ * Whether the short link statistics are publicly accessible.
819
827
  */
820
- search?: string;
828
+ publicStats?: boolean;
821
829
  /**
822
- * If should include archived links in the response. The default is `false` if not
823
- * provided.
830
+ * Whether the short link uses link cloaking.
824
831
  */
825
- showArchived?: boolean;
832
+ rewrite?: boolean;
826
833
  /**
827
- * The field to sort the links by. The default is `createdAt`, and sort order is
828
- * always descending.
834
+ * Smart rules for conditional destination routing by request attribute.
829
835
  */
830
- sort?: 'createdAt' | 'clicks' | 'lastClicked';
836
+ rules?: Array<LinkUpdateParams.Rule> | null;
831
837
  /**
832
- * @deprecated [OBSOLETO (use tagIds em vez disso)]: The unique ID of the tag
833
- * assigned to the short link.
838
+ * @deprecated The unique ID of the tag assigned to the short link. This field is
839
+ * deprecated – use `tagIds` instead.
834
840
  */
835
- tagId?: string;
841
+ tagId?: string | null;
836
842
  /**
837
- * The IDs of the tags to filter the links.
843
+ * The unique IDs of the tags assigned to the short link.
838
844
  */
839
845
  tagIds?: string | Array<string>;
840
846
  /**
841
847
  * The unique name of the tags assigned to the short link (case insensitive).
848
+ * Ignored when `tagIds` is also present.
842
849
  */
843
850
  tagNames?: string | Array<string>;
844
851
  /**
845
- * If should include links with conversion tracking enabled. The default is `false`
846
- * if not provided.
847
- */
848
- trackConversion?: boolean;
849
- /**
850
- * Filter links marked as templates.
851
- */
852
- useAsTemplate?: boolean;
853
- /**
854
- * The ID of the user to filter by.
855
- */
856
- userId?: string;
857
- /**
858
- * Filter by UTM campaign value
852
+ * The title of the short link generated via `api.codeqr.io/metatags`. Will be used
853
+ * for custom link preview if `proxy` is true.
859
854
  */
860
- utm_campaign?: string;
855
+ title?: string | null;
861
856
  /**
862
- * Filter by UTM content value
857
+ * Whether to track conversions for the short link.
863
858
  */
864
- utm_content?: string;
859
+ trackConversion?: boolean;
865
860
  /**
866
- * Filter by UTM medium value
861
+ * The destination URL of the short link.
867
862
  */
868
- utm_medium?: string;
863
+ url?: string;
869
864
  /**
870
- * Filter by UTM source value
865
+ * Whether this link should be used as a reusable template.
871
866
  */
872
- utm_source?: string;
867
+ useAsTemplate?: boolean;
873
868
  /**
874
- * Filter by UTM term value
869
+ * The video of the short link.
875
870
  */
876
- utm_term?: string;
871
+ video?: string | null;
877
872
  /**
878
- * If should include tags in the response. The default is `false` if not provided.
873
+ * An array of webhook IDs to trigger when the link is clicked. These webhooks will
874
+ * receive click event data.
879
875
  */
880
- withTags?: boolean;
876
+ webhookIds?: Array<string> | null;
881
877
  }
882
- export declare namespace LinkListParams {
878
+ export declare namespace LinkUpdateParams {
883
879
  /**
884
- * Geographic segmentation information for the short link in JSON format
880
+ * Geographic targeting information for the short link in JSON format
885
881
  * `{[COUNTRY]: https://example.com }`.
886
882
  */
887
883
  interface Geo {
@@ -1136,152 +1132,151 @@ export declare namespace LinkListParams {
1136
1132
  ZM?: string;
1137
1133
  ZW?: string;
1138
1134
  }
1135
+ interface Rule {
1136
+ attribute?: 'device' | 'country' | 'utm_source' | 'utm_medium' | 'utm_campaign' | 'referrer' | 'language' | 'city' | 'region' | 'continent' | 'utm_term' | 'utm_content';
1137
+ operator?: 'equals' | 'not_equals';
1138
+ split?: Array<Rule.Split>;
1139
+ url?: string;
1140
+ value?: string;
1141
+ }
1142
+ namespace Rule {
1143
+ interface Split {
1144
+ url: string;
1145
+ weight: number;
1146
+ }
1147
+ }
1139
1148
  }
1140
- export interface LinkRetrieveInfoParams {
1141
- /**
1142
- * The domain of the link to be retrieved. For example, for `codeqr.link/github`,
1143
- * the domain is `codeqr.link`.
1144
- */
1145
- domain: string;
1149
+ export interface LinkListParams {
1146
1150
  /**
1147
- * The key of the link to be retrieved. For example, for `codeqr.link/github`, the
1148
- * key is `github`.
1151
+ * The Android device to filter by.
1149
1152
  */
1150
- key: string;
1153
+ android?: string;
1151
1154
  /**
1152
- * The slug of the project to which the link belongs. For example, for
1153
- * `app.codeqr.io/acme`, the projectSlug is `acme`.
1155
+ * Maximum number of clicks
1154
1156
  */
1155
- projectSlug: string;
1157
+ clicksMax?: number;
1156
1158
  /**
1157
- * This is the ID of the link in your database. Must be prefixed with `ext_` when
1158
- * passed as a query parameter.
1159
+ * Minimum number of clicks
1159
1160
  */
1160
- externalId?: string;
1161
+ clicksMin?: number;
1161
1162
  /**
1162
- * The unique ID of the short link.
1163
+ * The comments to filter by.
1163
1164
  */
1164
- linkId?: string;
1165
- }
1166
- export interface LinkUpdateParams {
1165
+ comments?: string;
1167
1166
  /**
1168
- * The Android destination URL for the short link for Android device targeting.
1167
+ * Created after date (ISO string)
1169
1168
  */
1170
- android?: string | null;
1169
+ createdAfter?: string;
1171
1170
  /**
1172
- * Whether the short link is archived.
1171
+ * Created before date (ISO string)
1173
1172
  */
1174
- archived?: boolean;
1173
+ createdBefore?: string;
1175
1174
  /**
1176
- * The comments for the short link.
1175
+ * The domain to filter the links. For example, `ac.me`. If not provided, all links
1176
+ * of the project will be returned.
1177
1177
  */
1178
- comments?: string | null;
1178
+ domain?: string;
1179
1179
  /**
1180
- * The description of the short link generated via `api.codeqr.io/metatags`. Will
1181
- * be used for custom link preview if `proxy` is true.
1180
+ * Expires after date (ISO string)
1182
1181
  */
1183
- description?: string | null;
1182
+ expiresAfter?: string;
1184
1183
  /**
1185
- * Allow search engines to index your short link. Default is `false` if not
1186
- * provided. Learn more: https://codeqr.link/noindex
1184
+ * The date and time the short link will expire in ISO-8601 format. Must be in the
1185
+ * future.
1187
1186
  */
1188
- doIndex?: boolean;
1187
+ expiresAt?: string | null;
1189
1188
  /**
1190
- * The domain of the short link. If not provided, the main domain of the project
1191
- * will be used (or `codeqr.link` if the project has no domains).
1189
+ * Expires before date (ISO string)
1192
1190
  */
1193
- domain?: string;
1191
+ expiresBefore?: string;
1194
1192
  /**
1195
- * The URL to redirect to when the short link expires.
1193
+ * The folder ID to filter the links by.
1196
1194
  */
1197
- expiredUrl?: string | null;
1195
+ folderId?: string;
1198
1196
  /**
1199
- * The date and time when the short link will expire in ISO-8601 format. Must be in
1200
- * the future.
1197
+ * Geographic segmentation information for the short link in JSON format
1198
+ * `{[COUNTRY]: https://example.com }`.
1201
1199
  */
1202
- expiresAt?: string | null;
1200
+ geo?: LinkListParams.Geo | null;
1203
1201
  /**
1204
- * This is the ID of the link in your database. If set, it can be used to identify
1205
- * the link in the future. Must be prefixed with `ext_` when passed as a query
1206
- * parameter.
1202
+ * Filter links that have comments (any comments)
1207
1203
  */
1208
- externalId?: string | null;
1204
+ hasComments?: boolean;
1209
1205
  /**
1210
- * Whether the short link is flexible.
1206
+ * Filter links that have custom social media cards
1211
1207
  */
1212
- flexible?: boolean;
1208
+ hasCustomSocial?: boolean;
1213
1209
  /**
1214
- * The unique ID existing folder to assign the short link to.
1210
+ * Filter links that have device targeting
1215
1211
  */
1216
- folderId?: string | null;
1212
+ hasDevice?: boolean;
1217
1213
  /**
1218
- * Geographic targeting information for the short link in JSON format
1219
- * `{[COUNTRY]: https://example.com }`.
1214
+ * Filter links that have expiration date (any expiration)
1220
1215
  */
1221
- geo?: LinkUpdateParams.Geo | null;
1216
+ hasExpiration?: boolean;
1222
1217
  /**
1223
- * The image of the short link generated via `api.codeqr.io/metatags`. Will be used
1224
- * for custom link preview if `proxy` is true.
1218
+ * Filter links that have geo-targeting
1225
1219
  */
1226
- image?: string | null;
1220
+ hasGeo?: boolean;
1227
1221
  /**
1228
- * The iOS destination URL for the short link for iOS device targeting.
1222
+ * Filter links that have password protection (any password)
1229
1223
  */
1230
- ios?: string | null;
1224
+ hasPassword?: boolean;
1231
1225
  /**
1232
- * If the form is mandatory for the page.
1226
+ * Filter links that have tags (any tags)
1233
1227
  */
1234
- isFormMandatory?: boolean;
1228
+ hasTags?: boolean;
1235
1229
  /**
1236
- * The slug of the short link. If not provided, a random 7-character slug will be
1237
- * generated.
1230
+ * Filter links that have UTM parameters
1238
1231
  */
1239
- key?: string;
1232
+ hasUTM?: boolean;
1240
1233
  /**
1241
- * The ID of the page to redirect to before the link destination.
1234
+ * The iOS device to filter by.
1242
1235
  */
1243
- pageId?: string | null;
1236
+ ios?: string;
1244
1237
  /**
1245
- * The URL of the page to redirect to before the link destination.
1238
+ * Link IDs to filter by.
1246
1239
  */
1247
- pageUrl?: string | null;
1240
+ linkIds?: string | Array<string>;
1248
1241
  /**
1249
- * The password required to access the short link destination URL.
1242
+ * The page number for pagination.
1250
1243
  */
1251
- password?: string | null;
1244
+ page?: number;
1252
1245
  /**
1253
- * The prefix of the short link slug for randomly generated keys (for example, if
1254
- * the prefix is `/c/`, the generated keys will be in the format `/c/:key`). Will
1255
- * be ignored if `key` is provided.
1246
+ * The number of items per page.
1256
1247
  */
1257
- prefix?: string;
1248
+ pageSize?: number;
1258
1249
  /**
1259
- * Whether the short link has pre-redirection.
1250
+ * The password to filter by.
1260
1251
  */
1261
- preRedirection?: boolean;
1252
+ password?: string;
1262
1253
  /**
1263
- * Whether the short link uses the custom link preview feature.
1254
+ * The slug of the project to which the link belongs. For example, for
1255
+ * `app.codeqr.io/acme`, the projectSlug is `acme`.
1264
1256
  */
1265
- proxy?: boolean;
1257
+ projectSlug?: string;
1266
1258
  /**
1267
- * Whether the short link statistics are publicly accessible.
1259
+ * The search term to filter the links. The search term will be matched against the
1260
+ * short link slug and the destination URL.
1268
1261
  */
1269
- publicStats?: boolean;
1262
+ search?: string;
1270
1263
  /**
1271
- * Whether the short link uses link cloaking.
1264
+ * If should include archived links in the response. The default is `false` if not
1265
+ * provided.
1272
1266
  */
1273
- rewrite?: boolean;
1267
+ showArchived?: boolean;
1274
1268
  /**
1275
- * Smart rules for conditional destination routing by request attribute.
1269
+ * The field to sort the links by. The default is `createdAt`, and sort order is
1270
+ * always descending.
1276
1271
  */
1277
- rules?: Array<LinkUpdateParams.Rule> | null;
1272
+ sort?: 'createdAt' | 'clicks' | 'lastClicked';
1278
1273
  /**
1279
- * @deprecated The unique ID of the tag assigned to the short link. This field is
1280
- * deprecated – use `tagIds` instead.
1274
+ * @deprecated [OBSOLETO (use tagIds em vez disso)]: The unique ID of the tag
1275
+ * assigned to the short link.
1281
1276
  */
1282
- tagId?: string | null;
1277
+ tagId?: string;
1283
1278
  /**
1284
- * The unique IDs of the tags assigned to the short link.
1279
+ * The IDs of the tags to filter the links.
1285
1280
  */
1286
1281
  tagIds?: string | Array<string>;
1287
1282
  /**
@@ -1289,35 +1284,46 @@ export interface LinkUpdateParams {
1289
1284
  */
1290
1285
  tagNames?: string | Array<string>;
1291
1286
  /**
1292
- * The title of the short link generated via `api.codeqr.io/metatags`. Will be used
1293
- * for custom link preview if `proxy` is true.
1287
+ * If should include links with conversion tracking enabled. The default is `false`
1288
+ * if not provided.
1294
1289
  */
1295
- title?: string | null;
1290
+ trackConversion?: boolean;
1296
1291
  /**
1297
- * Whether to track conversions for the short link.
1292
+ * Filter links marked as templates.
1298
1293
  */
1299
- trackConversion?: boolean;
1294
+ useAsTemplate?: boolean;
1300
1295
  /**
1301
- * The destination URL of the short link.
1296
+ * The ID of the user to filter by.
1302
1297
  */
1303
- url?: string;
1298
+ userId?: string;
1304
1299
  /**
1305
- * Whether this link should be used as a reusable template.
1300
+ * Filter by UTM campaign value
1306
1301
  */
1307
- useAsTemplate?: boolean;
1302
+ utm_campaign?: string;
1308
1303
  /**
1309
- * The video of the short link.
1304
+ * Filter by UTM content value
1310
1305
  */
1311
- video?: string | null;
1306
+ utm_content?: string;
1312
1307
  /**
1313
- * An array of webhook IDs to trigger when the link is clicked. These webhooks will
1314
- * receive click event data.
1308
+ * Filter by UTM medium value
1315
1309
  */
1316
- webhookIds?: Array<string> | null;
1310
+ utm_medium?: string;
1311
+ /**
1312
+ * Filter by UTM source value
1313
+ */
1314
+ utm_source?: string;
1315
+ /**
1316
+ * Filter by UTM term value
1317
+ */
1318
+ utm_term?: string;
1319
+ /**
1320
+ * If should include tags in the response. The default is `false` if not provided.
1321
+ */
1322
+ withTags?: boolean;
1317
1323
  }
1318
- export declare namespace LinkUpdateParams {
1324
+ export declare namespace LinkListParams {
1319
1325
  /**
1320
- * Geographic targeting information for the short link in JSON format
1326
+ * Geographic segmentation information for the short link in JSON format
1321
1327
  * `{[COUNTRY]: https://example.com }`.
1322
1328
  */
1323
1329
  interface Geo {
@@ -1572,15 +1578,35 @@ export declare namespace LinkUpdateParams {
1572
1578
  ZM?: string;
1573
1579
  ZW?: string;
1574
1580
  }
1575
- interface Rule {
1576
- attribute: 'device' | 'country' | 'utm_source' | 'utm_medium' | 'utm_campaign' | 'referrer' | 'language';
1577
- operator: 'equals' | 'not_equals';
1578
- url: string;
1579
- value: string;
1580
- }
1581
+ }
1582
+ export interface LinkRetrieveInfoParams {
1583
+ /**
1584
+ * The domain of the link to be retrieved. For example, for `codeqr.link/github`,
1585
+ * the domain is `codeqr.link`.
1586
+ */
1587
+ domain: string;
1588
+ /**
1589
+ * The key of the link to be retrieved. For example, for `codeqr.link/github`, the
1590
+ * key is `github`.
1591
+ */
1592
+ key: string;
1593
+ /**
1594
+ * The slug of the project to which the link belongs. For example, for
1595
+ * `app.codeqr.io/acme`, the projectSlug is `acme`.
1596
+ */
1597
+ projectSlug: string;
1598
+ /**
1599
+ * This is the ID of the link in your database. Must be prefixed with `ext_` when
1600
+ * passed as a query parameter.
1601
+ */
1602
+ externalId?: string;
1603
+ /**
1604
+ * The unique ID of the short link.
1605
+ */
1606
+ linkId?: string;
1581
1607
  }
1582
1608
  export declare namespace Links {
1583
- export { type Link as Link, type LinkListResponse as LinkListResponse, type LinkDeleteResponse as LinkDeleteResponse, type LinkCreateParams as LinkCreateParams, type LinkListParams as LinkListParams, type LinkRetrieveInfoParams as LinkRetrieveInfoParams, type LinkUpdateParams as LinkUpdateParams, };
1609
+ export { type Link as Link, type LinkListResponse as LinkListResponse, type LinkDeleteResponse as LinkDeleteResponse, type LinkCreateParams as LinkCreateParams, type LinkUpdateParams as LinkUpdateParams, type LinkListParams as LinkListParams, type LinkRetrieveInfoParams as LinkRetrieveInfoParams, };
1584
1610
  export { Bulk as Bulk, type BulkCreateResponse as BulkCreateResponse, type BulkCreateParams as BulkCreateParams, };
1585
1611
  }
1586
1612
  //# sourceMappingURL=links.d.ts.map