@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
@@ -284,20 +284,35 @@ export namespace EventListResponse {
284
284
 
285
285
  export namespace Link {
286
286
  export interface Rule {
287
- attribute:
287
+ attribute?:
288
288
  | 'device'
289
289
  | 'country'
290
290
  | 'utm_source'
291
291
  | 'utm_medium'
292
292
  | 'utm_campaign'
293
293
  | 'referrer'
294
- | 'language';
294
+ | 'language'
295
+ | 'city'
296
+ | 'region'
297
+ | 'continent'
298
+ | 'utm_term'
299
+ | 'utm_content';
295
300
 
296
- operator: 'equals' | 'not_equals';
301
+ operator?: 'equals' | 'not_equals';
297
302
 
298
- url: string;
303
+ split?: Array<Rule.Split>;
299
304
 
300
- value: string;
305
+ url?: string;
306
+
307
+ value?: string;
308
+ }
309
+
310
+ export namespace Rule {
311
+ export interface Split {
312
+ url: string;
313
+
314
+ weight: number;
315
+ }
301
316
  }
302
317
  }
303
318
  }
@@ -508,6 +523,8 @@ export namespace EventListResponse {
508
523
  */
509
524
  saleAmount: number;
510
525
 
526
+ timestamp: string;
527
+
511
528
  /**
512
529
  * @deprecated Deprecated. Use `click.qr` instead.
513
530
  */
@@ -517,8 +534,6 @@ export namespace EventListResponse {
517
534
  * @deprecated Deprecated. Use `click.url` instead.
518
535
  */
519
536
  url: string;
520
-
521
- timestamp?: string;
522
537
  }
523
538
 
524
539
  export namespace SaleEvent {
@@ -549,76 +564,13 @@ export namespace EventListResponse {
549
564
  }
550
565
 
551
566
  export interface Customer {
552
- /**
553
- * The unique ID of the customer. You may use either the customer's `id` on CodeQR
554
- * (obtained via `/customers` endpoint) or their `externalId` (unique ID within
555
- * your system, prefixed with `ext_`, e.g. `ext_123`).
556
- */
557
567
  id: string;
558
568
 
559
- /**
560
- * The date the customer was created.
561
- */
562
- createdAt: string;
569
+ avatar: string;
563
570
 
564
- /**
565
- * Unique identifier for the customer in the client's app.
566
- */
567
- externalId: string;
571
+ email: string;
568
572
 
569
- /**
570
- * Name of the customer.
571
- */
572
573
  name: string;
573
-
574
- /**
575
- * Avatar URL of the customer.
576
- */
577
- avatar?: string | null;
578
-
579
- /**
580
- * Country of the customer.
581
- */
582
- country?: string | null;
583
-
584
- /**
585
- * Custom fields of the customer.
586
- */
587
- customFields?: { [key: string]: string } | null;
588
-
589
- /**
590
- * Email of the customer.
591
- */
592
- email?: string | null;
593
-
594
- link?: Customer.Link | null;
595
- }
596
-
597
- export namespace Customer {
598
- export interface Link {
599
- /**
600
- * The unique ID of the short link.
601
- */
602
- id: string;
603
-
604
- /**
605
- * The domain of the short link. If not provided, the main domain of the project
606
- * will be used (or `codeqr.link` if the project has no domains).
607
- */
608
- domain: string;
609
-
610
- /**
611
- * The slug of the short link. If not provided, a random 7-character slug will be
612
- * generated.
613
- */
614
- key: string;
615
-
616
- /**
617
- * The complete URL of the short link, including the https protocol (for example,
618
- * `https://codeqr.link/try`).
619
- */
620
- shortLink?: string;
621
- }
622
574
  }
623
575
 
624
576
  export interface Link {
@@ -780,20 +732,35 @@ export namespace EventListResponse {
780
732
 
781
733
  export namespace Link {
782
734
  export interface Rule {
783
- attribute:
735
+ attribute?:
784
736
  | 'device'
785
737
  | 'country'
786
738
  | 'utm_source'
787
739
  | 'utm_medium'
788
740
  | 'utm_campaign'
789
741
  | 'referrer'
790
- | 'language';
742
+ | 'language'
743
+ | 'city'
744
+ | 'region'
745
+ | 'continent'
746
+ | 'utm_term'
747
+ | 'utm_content';
748
+
749
+ operator?: 'equals' | 'not_equals';
791
750
 
792
- operator: 'equals' | 'not_equals';
751
+ split?: Array<Rule.Split>;
793
752
 
794
- url: string;
753
+ url?: string;
795
754
 
796
- value: string;
755
+ value?: string;
756
+ }
757
+
758
+ export namespace Rule {
759
+ export interface Split {
760
+ url: string;
761
+
762
+ weight: number;
763
+ }
797
764
  }
798
765
  }
799
766
 
@@ -811,10 +778,7 @@ export namespace EventListResponse {
811
778
  */
812
779
  invoiceId: string | null;
813
780
 
814
- /**
815
- * The payment processor via which the sale was made.
816
- */
817
- paymentProcessor: 'stripe' | 'shopify' | 'polar' | 'paddle' | 'revenuecat' | 'custom' | 'manual';
781
+ paymentProcessor: string;
818
782
  }
819
783
  }
820
784
  }
@@ -949,7 +913,9 @@ export interface EventListParams {
949
913
  types?: string;
950
914
 
951
915
  /**
952
- * The URL to retrieve analytics for.
916
+ * The destination URL to retrieve analytics for. Match it without the query params
917
+ * CodeQR copies off the click (UTM and ad click IDs such as fbclid or gclid):
918
+ * those differ per visitor, so a URL carrying them matches at most one click.
953
919
  */
954
920
  url?: string;
955
921
 
@@ -13,8 +13,8 @@ export {
13
13
  type DomainListResponse,
14
14
  type DomainDeleteResponse,
15
15
  type DomainCreateParams,
16
- type DomainListParams,
17
16
  type DomainUpdateParams,
17
+ type DomainListParams,
18
18
  } from './domains';
19
19
  export { Events, type EventListResponse, type EventListParams } from './events';
20
20
  export {
@@ -23,9 +23,9 @@ export {
23
23
  type LinkListResponse,
24
24
  type LinkDeleteResponse,
25
25
  type LinkCreateParams,
26
+ type LinkUpdateParams,
26
27
  type LinkListParams,
27
28
  type LinkRetrieveInfoParams,
28
- type LinkUpdateParams,
29
29
  } from './links/links';
30
30
  export { Projects, type Project, type ProjectListResponse } from './projects';
31
31
  export {
@@ -34,9 +34,9 @@ export {
34
34
  type QrcodeListResponse,
35
35
  type QrcodeDeleteResponse,
36
36
  type QrcodeCreateParams,
37
- type QrcodeListParams,
38
37
  type QrcodeRetrieveParams,
39
38
  type QrcodeUpdateParams,
39
+ type QrcodeListParams,
40
40
  } from './qrcodes/qrcodes';
41
41
  export {
42
42
  Tags,
@@ -44,8 +44,8 @@ export {
44
44
  type TagListResponse,
45
45
  type TagDeleteResponse,
46
46
  type TagCreateParams,
47
- type TagListParams,
48
47
  type TagUpdateParams,
48
+ type TagListParams,
49
49
  } from './tags';
50
50
  export {
51
51
  Track,
@@ -73,7 +73,8 @@ export namespace BulkCreateParams {
73
73
  android?: string | null;
74
74
 
75
75
  /**
76
- * Whether the short link is archived.
76
+ * Whether the short link is archived. Archiving hides it from the default
77
+ * dashboard listing; the link keeps redirecting and keeps counting clicks.
77
78
  */
78
79
  archived?: boolean;
79
80
 
@@ -216,6 +217,7 @@ export namespace BulkCreateParams {
216
217
 
217
218
  /**
218
219
  * The unique name of the tags assigned to the short link (case insensitive).
220
+ * Ignored when `tagIds` is also present.
219
221
  */
220
222
  tagNames?: string | Array<string>;
221
223
 
@@ -755,20 +757,35 @@ export namespace BulkCreateParams {
755
757
  }
756
758
 
757
759
  export interface Rule {
758
- attribute:
760
+ attribute?:
759
761
  | 'device'
760
762
  | 'country'
761
763
  | 'utm_source'
762
764
  | 'utm_medium'
763
765
  | 'utm_campaign'
764
766
  | 'referrer'
765
- | 'language';
767
+ | 'language'
768
+ | 'city'
769
+ | 'region'
770
+ | 'continent'
771
+ | 'utm_term'
772
+ | 'utm_content';
766
773
 
767
- operator: 'equals' | 'not_equals';
774
+ operator?: 'equals' | 'not_equals';
768
775
 
769
- url: string;
776
+ split?: Array<Rule.Split>;
770
777
 
771
- value: string;
778
+ url?: string;
779
+
780
+ value?: string;
781
+ }
782
+
783
+ export namespace Rule {
784
+ export interface Split {
785
+ url: string;
786
+
787
+ weight: number;
788
+ }
772
789
  }
773
790
  }
774
791
  }
@@ -7,7 +7,7 @@ export {
7
7
  type LinkListResponse,
8
8
  type LinkDeleteResponse,
9
9
  type LinkCreateParams,
10
+ type LinkUpdateParams,
10
11
  type LinkListParams,
11
12
  type LinkRetrieveInfoParams,
12
- type LinkUpdateParams,
13
13
  } from './links';