@strimz/shared-types 0.14.0 → 0.15.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.
- package/dist/analytics.cjs +36 -0
- package/dist/analytics.cjs.map +1 -1
- package/dist/analytics.js +36 -0
- package/dist/analytics.js.map +1 -1
- package/dist/events.cjs +36 -0
- package/dist/events.cjs.map +1 -1
- package/dist/events.d.cts +60 -60
- package/dist/events.d.ts +60 -60
- package/dist/events.js +36 -0
- package/dist/events.js.map +1 -1
- package/dist/index.cjs +40 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +37 -1
- package/dist/index.js.map +1 -1
- package/dist/storefronts.cjs +151 -0
- package/dist/storefronts.cjs.map +1 -1
- package/dist/storefronts.js +151 -0
- package/dist/storefronts.js.map +1 -1
- package/dist/subscriptions.cjs +153 -0
- package/dist/subscriptions.cjs.map +1 -1
- package/dist/subscriptions.d.cts +80 -3
- package/dist/subscriptions.d.ts +80 -3
- package/dist/subscriptions.js +150 -1
- package/dist/subscriptions.js.map +1 -1
- package/package.json +1 -1
- package/src/subscriptions.ts +49 -0
package/dist/events.d.ts
CHANGED
|
@@ -744,8 +744,8 @@ declare const subscriptionCreatedEventSchema: z.ZodObject<{
|
|
|
744
744
|
payerAddress: string;
|
|
745
745
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
746
746
|
intervalCount: number;
|
|
747
|
-
onchainSubscriptionId: number | null;
|
|
748
747
|
planId: string;
|
|
748
|
+
onchainSubscriptionId: number | null;
|
|
749
749
|
trialEndsAt: string | null;
|
|
750
750
|
currentPeriodStartAt: string;
|
|
751
751
|
currentPeriodEndAt: string;
|
|
@@ -764,8 +764,8 @@ declare const subscriptionCreatedEventSchema: z.ZodObject<{
|
|
|
764
764
|
payerAddress: string;
|
|
765
765
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
766
766
|
intervalCount: number;
|
|
767
|
-
onchainSubscriptionId: number | null;
|
|
768
767
|
planId: string;
|
|
768
|
+
onchainSubscriptionId: number | null;
|
|
769
769
|
trialEndsAt: string | null;
|
|
770
770
|
currentPeriodStartAt: string;
|
|
771
771
|
currentPeriodEndAt: string;
|
|
@@ -790,8 +790,8 @@ declare const subscriptionCreatedEventSchema: z.ZodObject<{
|
|
|
790
790
|
payerAddress: string;
|
|
791
791
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
792
792
|
intervalCount: number;
|
|
793
|
-
onchainSubscriptionId: number | null;
|
|
794
793
|
planId: string;
|
|
794
|
+
onchainSubscriptionId: number | null;
|
|
795
795
|
trialEndsAt: string | null;
|
|
796
796
|
currentPeriodStartAt: string;
|
|
797
797
|
currentPeriodEndAt: string;
|
|
@@ -817,8 +817,8 @@ declare const subscriptionCreatedEventSchema: z.ZodObject<{
|
|
|
817
817
|
payerAddress: string;
|
|
818
818
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
819
819
|
intervalCount: number;
|
|
820
|
-
onchainSubscriptionId: number | null;
|
|
821
820
|
planId: string;
|
|
821
|
+
onchainSubscriptionId: number | null;
|
|
822
822
|
trialEndsAt: string | null;
|
|
823
823
|
currentPeriodStartAt: string;
|
|
824
824
|
currentPeriodEndAt: string;
|
|
@@ -872,8 +872,8 @@ declare const subscriptionChargedEventSchema: z.ZodObject<{
|
|
|
872
872
|
payerAddress: string;
|
|
873
873
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
874
874
|
intervalCount: number;
|
|
875
|
-
onchainSubscriptionId: number | null;
|
|
876
875
|
planId: string;
|
|
876
|
+
onchainSubscriptionId: number | null;
|
|
877
877
|
trialEndsAt: string | null;
|
|
878
878
|
currentPeriodStartAt: string;
|
|
879
879
|
currentPeriodEndAt: string;
|
|
@@ -892,8 +892,8 @@ declare const subscriptionChargedEventSchema: z.ZodObject<{
|
|
|
892
892
|
payerAddress: string;
|
|
893
893
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
894
894
|
intervalCount: number;
|
|
895
|
-
onchainSubscriptionId: number | null;
|
|
896
895
|
planId: string;
|
|
896
|
+
onchainSubscriptionId: number | null;
|
|
897
897
|
trialEndsAt: string | null;
|
|
898
898
|
currentPeriodStartAt: string;
|
|
899
899
|
currentPeriodEndAt: string;
|
|
@@ -1053,8 +1053,8 @@ declare const subscriptionChargedEventSchema: z.ZodObject<{
|
|
|
1053
1053
|
payerAddress: string;
|
|
1054
1054
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
1055
1055
|
intervalCount: number;
|
|
1056
|
-
onchainSubscriptionId: number | null;
|
|
1057
1056
|
planId: string;
|
|
1057
|
+
onchainSubscriptionId: number | null;
|
|
1058
1058
|
trialEndsAt: string | null;
|
|
1059
1059
|
currentPeriodStartAt: string;
|
|
1060
1060
|
currentPeriodEndAt: string;
|
|
@@ -1115,8 +1115,8 @@ declare const subscriptionChargedEventSchema: z.ZodObject<{
|
|
|
1115
1115
|
payerAddress: string;
|
|
1116
1116
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
1117
1117
|
intervalCount: number;
|
|
1118
|
-
onchainSubscriptionId: number | null;
|
|
1119
1118
|
planId: string;
|
|
1119
|
+
onchainSubscriptionId: number | null;
|
|
1120
1120
|
trialEndsAt: string | null;
|
|
1121
1121
|
currentPeriodStartAt: string;
|
|
1122
1122
|
currentPeriodEndAt: string;
|
|
@@ -1183,8 +1183,8 @@ declare const subscriptionChargedEventSchema: z.ZodObject<{
|
|
|
1183
1183
|
payerAddress: string;
|
|
1184
1184
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
1185
1185
|
intervalCount: number;
|
|
1186
|
-
onchainSubscriptionId: number | null;
|
|
1187
1186
|
planId: string;
|
|
1187
|
+
onchainSubscriptionId: number | null;
|
|
1188
1188
|
trialEndsAt: string | null;
|
|
1189
1189
|
currentPeriodStartAt: string;
|
|
1190
1190
|
currentPeriodEndAt: string;
|
|
@@ -1252,8 +1252,8 @@ declare const subscriptionChargedEventSchema: z.ZodObject<{
|
|
|
1252
1252
|
payerAddress: string;
|
|
1253
1253
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
1254
1254
|
intervalCount: number;
|
|
1255
|
-
onchainSubscriptionId: number | null;
|
|
1256
1255
|
planId: string;
|
|
1256
|
+
onchainSubscriptionId: number | null;
|
|
1257
1257
|
trialEndsAt: string | null;
|
|
1258
1258
|
currentPeriodStartAt: string;
|
|
1259
1259
|
currentPeriodEndAt: string;
|
|
@@ -1327,8 +1327,8 @@ declare const subscriptionChargeFailedEventSchema: z.ZodObject<{
|
|
|
1327
1327
|
payerAddress: string;
|
|
1328
1328
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
1329
1329
|
intervalCount: number;
|
|
1330
|
-
onchainSubscriptionId: number | null;
|
|
1331
1330
|
planId: string;
|
|
1331
|
+
onchainSubscriptionId: number | null;
|
|
1332
1332
|
trialEndsAt: string | null;
|
|
1333
1333
|
currentPeriodStartAt: string;
|
|
1334
1334
|
currentPeriodEndAt: string;
|
|
@@ -1347,8 +1347,8 @@ declare const subscriptionChargeFailedEventSchema: z.ZodObject<{
|
|
|
1347
1347
|
payerAddress: string;
|
|
1348
1348
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
1349
1349
|
intervalCount: number;
|
|
1350
|
-
onchainSubscriptionId: number | null;
|
|
1351
1350
|
planId: string;
|
|
1351
|
+
onchainSubscriptionId: number | null;
|
|
1352
1352
|
trialEndsAt: string | null;
|
|
1353
1353
|
currentPeriodStartAt: string;
|
|
1354
1354
|
currentPeriodEndAt: string;
|
|
@@ -1426,8 +1426,8 @@ declare const subscriptionChargeFailedEventSchema: z.ZodObject<{
|
|
|
1426
1426
|
payerAddress: string;
|
|
1427
1427
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
1428
1428
|
intervalCount: number;
|
|
1429
|
-
onchainSubscriptionId: number | null;
|
|
1430
1429
|
planId: string;
|
|
1430
|
+
onchainSubscriptionId: number | null;
|
|
1431
1431
|
trialEndsAt: string | null;
|
|
1432
1432
|
currentPeriodStartAt: string;
|
|
1433
1433
|
currentPeriodEndAt: string;
|
|
@@ -1467,8 +1467,8 @@ declare const subscriptionChargeFailedEventSchema: z.ZodObject<{
|
|
|
1467
1467
|
payerAddress: string;
|
|
1468
1468
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
1469
1469
|
intervalCount: number;
|
|
1470
|
-
onchainSubscriptionId: number | null;
|
|
1471
1470
|
planId: string;
|
|
1471
|
+
onchainSubscriptionId: number | null;
|
|
1472
1472
|
trialEndsAt: string | null;
|
|
1473
1473
|
currentPeriodStartAt: string;
|
|
1474
1474
|
currentPeriodEndAt: string;
|
|
@@ -1514,8 +1514,8 @@ declare const subscriptionChargeFailedEventSchema: z.ZodObject<{
|
|
|
1514
1514
|
payerAddress: string;
|
|
1515
1515
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
1516
1516
|
intervalCount: number;
|
|
1517
|
-
onchainSubscriptionId: number | null;
|
|
1518
1517
|
planId: string;
|
|
1518
|
+
onchainSubscriptionId: number | null;
|
|
1519
1519
|
trialEndsAt: string | null;
|
|
1520
1520
|
currentPeriodStartAt: string;
|
|
1521
1521
|
currentPeriodEndAt: string;
|
|
@@ -1562,8 +1562,8 @@ declare const subscriptionChargeFailedEventSchema: z.ZodObject<{
|
|
|
1562
1562
|
payerAddress: string;
|
|
1563
1563
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
1564
1564
|
intervalCount: number;
|
|
1565
|
-
onchainSubscriptionId: number | null;
|
|
1566
1565
|
planId: string;
|
|
1566
|
+
onchainSubscriptionId: number | null;
|
|
1567
1567
|
trialEndsAt: string | null;
|
|
1568
1568
|
currentPeriodStartAt: string;
|
|
1569
1569
|
currentPeriodEndAt: string;
|
|
@@ -1637,8 +1637,8 @@ declare const subscriptionRecoveryAttemptEventSchema: z.ZodObject<{
|
|
|
1637
1637
|
payerAddress: string;
|
|
1638
1638
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
1639
1639
|
intervalCount: number;
|
|
1640
|
-
onchainSubscriptionId: number | null;
|
|
1641
1640
|
planId: string;
|
|
1641
|
+
onchainSubscriptionId: number | null;
|
|
1642
1642
|
trialEndsAt: string | null;
|
|
1643
1643
|
currentPeriodStartAt: string;
|
|
1644
1644
|
currentPeriodEndAt: string;
|
|
@@ -1657,8 +1657,8 @@ declare const subscriptionRecoveryAttemptEventSchema: z.ZodObject<{
|
|
|
1657
1657
|
payerAddress: string;
|
|
1658
1658
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
1659
1659
|
intervalCount: number;
|
|
1660
|
-
onchainSubscriptionId: number | null;
|
|
1661
1660
|
planId: string;
|
|
1661
|
+
onchainSubscriptionId: number | null;
|
|
1662
1662
|
trialEndsAt: string | null;
|
|
1663
1663
|
currentPeriodStartAt: string;
|
|
1664
1664
|
currentPeriodEndAt: string;
|
|
@@ -1683,8 +1683,8 @@ declare const subscriptionRecoveryAttemptEventSchema: z.ZodObject<{
|
|
|
1683
1683
|
payerAddress: string;
|
|
1684
1684
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
1685
1685
|
intervalCount: number;
|
|
1686
|
-
onchainSubscriptionId: number | null;
|
|
1687
1686
|
planId: string;
|
|
1687
|
+
onchainSubscriptionId: number | null;
|
|
1688
1688
|
trialEndsAt: string | null;
|
|
1689
1689
|
currentPeriodStartAt: string;
|
|
1690
1690
|
currentPeriodEndAt: string;
|
|
@@ -1706,8 +1706,8 @@ declare const subscriptionRecoveryAttemptEventSchema: z.ZodObject<{
|
|
|
1706
1706
|
payerAddress: string;
|
|
1707
1707
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
1708
1708
|
intervalCount: number;
|
|
1709
|
-
onchainSubscriptionId: number | null;
|
|
1710
1709
|
planId: string;
|
|
1710
|
+
onchainSubscriptionId: number | null;
|
|
1711
1711
|
trialEndsAt: string | null;
|
|
1712
1712
|
currentPeriodStartAt: string;
|
|
1713
1713
|
currentPeriodEndAt: string;
|
|
@@ -1735,8 +1735,8 @@ declare const subscriptionRecoveryAttemptEventSchema: z.ZodObject<{
|
|
|
1735
1735
|
payerAddress: string;
|
|
1736
1736
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
1737
1737
|
intervalCount: number;
|
|
1738
|
-
onchainSubscriptionId: number | null;
|
|
1739
1738
|
planId: string;
|
|
1739
|
+
onchainSubscriptionId: number | null;
|
|
1740
1740
|
trialEndsAt: string | null;
|
|
1741
1741
|
currentPeriodStartAt: string;
|
|
1742
1742
|
currentPeriodEndAt: string;
|
|
@@ -1765,8 +1765,8 @@ declare const subscriptionRecoveryAttemptEventSchema: z.ZodObject<{
|
|
|
1765
1765
|
payerAddress: string;
|
|
1766
1766
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
1767
1767
|
intervalCount: number;
|
|
1768
|
-
onchainSubscriptionId: number | null;
|
|
1769
1768
|
planId: string;
|
|
1769
|
+
onchainSubscriptionId: number | null;
|
|
1770
1770
|
trialEndsAt: string | null;
|
|
1771
1771
|
currentPeriodStartAt: string;
|
|
1772
1772
|
currentPeriodEndAt: string;
|
|
@@ -1820,8 +1820,8 @@ declare const subscriptionCancelledEventSchema: z.ZodObject<{
|
|
|
1820
1820
|
payerAddress: string;
|
|
1821
1821
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
1822
1822
|
intervalCount: number;
|
|
1823
|
-
onchainSubscriptionId: number | null;
|
|
1824
1823
|
planId: string;
|
|
1824
|
+
onchainSubscriptionId: number | null;
|
|
1825
1825
|
trialEndsAt: string | null;
|
|
1826
1826
|
currentPeriodStartAt: string;
|
|
1827
1827
|
currentPeriodEndAt: string;
|
|
@@ -1840,8 +1840,8 @@ declare const subscriptionCancelledEventSchema: z.ZodObject<{
|
|
|
1840
1840
|
payerAddress: string;
|
|
1841
1841
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
1842
1842
|
intervalCount: number;
|
|
1843
|
-
onchainSubscriptionId: number | null;
|
|
1844
1843
|
planId: string;
|
|
1844
|
+
onchainSubscriptionId: number | null;
|
|
1845
1845
|
trialEndsAt: string | null;
|
|
1846
1846
|
currentPeriodStartAt: string;
|
|
1847
1847
|
currentPeriodEndAt: string;
|
|
@@ -1866,8 +1866,8 @@ declare const subscriptionCancelledEventSchema: z.ZodObject<{
|
|
|
1866
1866
|
payerAddress: string;
|
|
1867
1867
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
1868
1868
|
intervalCount: number;
|
|
1869
|
-
onchainSubscriptionId: number | null;
|
|
1870
1869
|
planId: string;
|
|
1870
|
+
onchainSubscriptionId: number | null;
|
|
1871
1871
|
trialEndsAt: string | null;
|
|
1872
1872
|
currentPeriodStartAt: string;
|
|
1873
1873
|
currentPeriodEndAt: string;
|
|
@@ -1893,8 +1893,8 @@ declare const subscriptionCancelledEventSchema: z.ZodObject<{
|
|
|
1893
1893
|
payerAddress: string;
|
|
1894
1894
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
1895
1895
|
intervalCount: number;
|
|
1896
|
-
onchainSubscriptionId: number | null;
|
|
1897
1896
|
planId: string;
|
|
1897
|
+
onchainSubscriptionId: number | null;
|
|
1898
1898
|
trialEndsAt: string | null;
|
|
1899
1899
|
currentPeriodStartAt: string;
|
|
1900
1900
|
currentPeriodEndAt: string;
|
|
@@ -1947,8 +1947,8 @@ declare const subscriptionLapsedEventSchema: z.ZodObject<{
|
|
|
1947
1947
|
payerAddress: string;
|
|
1948
1948
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
1949
1949
|
intervalCount: number;
|
|
1950
|
-
onchainSubscriptionId: number | null;
|
|
1951
1950
|
planId: string;
|
|
1951
|
+
onchainSubscriptionId: number | null;
|
|
1952
1952
|
trialEndsAt: string | null;
|
|
1953
1953
|
currentPeriodStartAt: string;
|
|
1954
1954
|
currentPeriodEndAt: string;
|
|
@@ -1967,8 +1967,8 @@ declare const subscriptionLapsedEventSchema: z.ZodObject<{
|
|
|
1967
1967
|
payerAddress: string;
|
|
1968
1968
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
1969
1969
|
intervalCount: number;
|
|
1970
|
-
onchainSubscriptionId: number | null;
|
|
1971
1970
|
planId: string;
|
|
1971
|
+
onchainSubscriptionId: number | null;
|
|
1972
1972
|
trialEndsAt: string | null;
|
|
1973
1973
|
currentPeriodStartAt: string;
|
|
1974
1974
|
currentPeriodEndAt: string;
|
|
@@ -1993,8 +1993,8 @@ declare const subscriptionLapsedEventSchema: z.ZodObject<{
|
|
|
1993
1993
|
payerAddress: string;
|
|
1994
1994
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
1995
1995
|
intervalCount: number;
|
|
1996
|
-
onchainSubscriptionId: number | null;
|
|
1997
1996
|
planId: string;
|
|
1997
|
+
onchainSubscriptionId: number | null;
|
|
1998
1998
|
trialEndsAt: string | null;
|
|
1999
1999
|
currentPeriodStartAt: string;
|
|
2000
2000
|
currentPeriodEndAt: string;
|
|
@@ -2020,8 +2020,8 @@ declare const subscriptionLapsedEventSchema: z.ZodObject<{
|
|
|
2020
2020
|
payerAddress: string;
|
|
2021
2021
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
2022
2022
|
intervalCount: number;
|
|
2023
|
-
onchainSubscriptionId: number | null;
|
|
2024
2023
|
planId: string;
|
|
2024
|
+
onchainSubscriptionId: number | null;
|
|
2025
2025
|
trialEndsAt: string | null;
|
|
2026
2026
|
currentPeriodStartAt: string;
|
|
2027
2027
|
currentPeriodEndAt: string;
|
|
@@ -4282,8 +4282,8 @@ declare const webhookEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
4282
4282
|
payerAddress: string;
|
|
4283
4283
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
4284
4284
|
intervalCount: number;
|
|
4285
|
-
onchainSubscriptionId: number | null;
|
|
4286
4285
|
planId: string;
|
|
4286
|
+
onchainSubscriptionId: number | null;
|
|
4287
4287
|
trialEndsAt: string | null;
|
|
4288
4288
|
currentPeriodStartAt: string;
|
|
4289
4289
|
currentPeriodEndAt: string;
|
|
@@ -4302,8 +4302,8 @@ declare const webhookEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
4302
4302
|
payerAddress: string;
|
|
4303
4303
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
4304
4304
|
intervalCount: number;
|
|
4305
|
-
onchainSubscriptionId: number | null;
|
|
4306
4305
|
planId: string;
|
|
4306
|
+
onchainSubscriptionId: number | null;
|
|
4307
4307
|
trialEndsAt: string | null;
|
|
4308
4308
|
currentPeriodStartAt: string;
|
|
4309
4309
|
currentPeriodEndAt: string;
|
|
@@ -4328,8 +4328,8 @@ declare const webhookEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
4328
4328
|
payerAddress: string;
|
|
4329
4329
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
4330
4330
|
intervalCount: number;
|
|
4331
|
-
onchainSubscriptionId: number | null;
|
|
4332
4331
|
planId: string;
|
|
4332
|
+
onchainSubscriptionId: number | null;
|
|
4333
4333
|
trialEndsAt: string | null;
|
|
4334
4334
|
currentPeriodStartAt: string;
|
|
4335
4335
|
currentPeriodEndAt: string;
|
|
@@ -4355,8 +4355,8 @@ declare const webhookEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
4355
4355
|
payerAddress: string;
|
|
4356
4356
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
4357
4357
|
intervalCount: number;
|
|
4358
|
-
onchainSubscriptionId: number | null;
|
|
4359
4358
|
planId: string;
|
|
4359
|
+
onchainSubscriptionId: number | null;
|
|
4360
4360
|
trialEndsAt: string | null;
|
|
4361
4361
|
currentPeriodStartAt: string;
|
|
4362
4362
|
currentPeriodEndAt: string;
|
|
@@ -4409,8 +4409,8 @@ declare const webhookEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
4409
4409
|
payerAddress: string;
|
|
4410
4410
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
4411
4411
|
intervalCount: number;
|
|
4412
|
-
onchainSubscriptionId: number | null;
|
|
4413
4412
|
planId: string;
|
|
4413
|
+
onchainSubscriptionId: number | null;
|
|
4414
4414
|
trialEndsAt: string | null;
|
|
4415
4415
|
currentPeriodStartAt: string;
|
|
4416
4416
|
currentPeriodEndAt: string;
|
|
@@ -4429,8 +4429,8 @@ declare const webhookEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
4429
4429
|
payerAddress: string;
|
|
4430
4430
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
4431
4431
|
intervalCount: number;
|
|
4432
|
-
onchainSubscriptionId: number | null;
|
|
4433
4432
|
planId: string;
|
|
4433
|
+
onchainSubscriptionId: number | null;
|
|
4434
4434
|
trialEndsAt: string | null;
|
|
4435
4435
|
currentPeriodStartAt: string;
|
|
4436
4436
|
currentPeriodEndAt: string;
|
|
@@ -4590,8 +4590,8 @@ declare const webhookEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
4590
4590
|
payerAddress: string;
|
|
4591
4591
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
4592
4592
|
intervalCount: number;
|
|
4593
|
-
onchainSubscriptionId: number | null;
|
|
4594
4593
|
planId: string;
|
|
4594
|
+
onchainSubscriptionId: number | null;
|
|
4595
4595
|
trialEndsAt: string | null;
|
|
4596
4596
|
currentPeriodStartAt: string;
|
|
4597
4597
|
currentPeriodEndAt: string;
|
|
@@ -4652,8 +4652,8 @@ declare const webhookEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
4652
4652
|
payerAddress: string;
|
|
4653
4653
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
4654
4654
|
intervalCount: number;
|
|
4655
|
-
onchainSubscriptionId: number | null;
|
|
4656
4655
|
planId: string;
|
|
4656
|
+
onchainSubscriptionId: number | null;
|
|
4657
4657
|
trialEndsAt: string | null;
|
|
4658
4658
|
currentPeriodStartAt: string;
|
|
4659
4659
|
currentPeriodEndAt: string;
|
|
@@ -4720,8 +4720,8 @@ declare const webhookEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
4720
4720
|
payerAddress: string;
|
|
4721
4721
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
4722
4722
|
intervalCount: number;
|
|
4723
|
-
onchainSubscriptionId: number | null;
|
|
4724
4723
|
planId: string;
|
|
4724
|
+
onchainSubscriptionId: number | null;
|
|
4725
4725
|
trialEndsAt: string | null;
|
|
4726
4726
|
currentPeriodStartAt: string;
|
|
4727
4727
|
currentPeriodEndAt: string;
|
|
@@ -4789,8 +4789,8 @@ declare const webhookEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
4789
4789
|
payerAddress: string;
|
|
4790
4790
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
4791
4791
|
intervalCount: number;
|
|
4792
|
-
onchainSubscriptionId: number | null;
|
|
4793
4792
|
planId: string;
|
|
4793
|
+
onchainSubscriptionId: number | null;
|
|
4794
4794
|
trialEndsAt: string | null;
|
|
4795
4795
|
currentPeriodStartAt: string;
|
|
4796
4796
|
currentPeriodEndAt: string;
|
|
@@ -4863,8 +4863,8 @@ declare const webhookEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
4863
4863
|
payerAddress: string;
|
|
4864
4864
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
4865
4865
|
intervalCount: number;
|
|
4866
|
-
onchainSubscriptionId: number | null;
|
|
4867
4866
|
planId: string;
|
|
4867
|
+
onchainSubscriptionId: number | null;
|
|
4868
4868
|
trialEndsAt: string | null;
|
|
4869
4869
|
currentPeriodStartAt: string;
|
|
4870
4870
|
currentPeriodEndAt: string;
|
|
@@ -4883,8 +4883,8 @@ declare const webhookEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
4883
4883
|
payerAddress: string;
|
|
4884
4884
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
4885
4885
|
intervalCount: number;
|
|
4886
|
-
onchainSubscriptionId: number | null;
|
|
4887
4886
|
planId: string;
|
|
4887
|
+
onchainSubscriptionId: number | null;
|
|
4888
4888
|
trialEndsAt: string | null;
|
|
4889
4889
|
currentPeriodStartAt: string;
|
|
4890
4890
|
currentPeriodEndAt: string;
|
|
@@ -4962,8 +4962,8 @@ declare const webhookEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
4962
4962
|
payerAddress: string;
|
|
4963
4963
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
4964
4964
|
intervalCount: number;
|
|
4965
|
-
onchainSubscriptionId: number | null;
|
|
4966
4965
|
planId: string;
|
|
4966
|
+
onchainSubscriptionId: number | null;
|
|
4967
4967
|
trialEndsAt: string | null;
|
|
4968
4968
|
currentPeriodStartAt: string;
|
|
4969
4969
|
currentPeriodEndAt: string;
|
|
@@ -5003,8 +5003,8 @@ declare const webhookEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
5003
5003
|
payerAddress: string;
|
|
5004
5004
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
5005
5005
|
intervalCount: number;
|
|
5006
|
-
onchainSubscriptionId: number | null;
|
|
5007
5006
|
planId: string;
|
|
5007
|
+
onchainSubscriptionId: number | null;
|
|
5008
5008
|
trialEndsAt: string | null;
|
|
5009
5009
|
currentPeriodStartAt: string;
|
|
5010
5010
|
currentPeriodEndAt: string;
|
|
@@ -5050,8 +5050,8 @@ declare const webhookEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
5050
5050
|
payerAddress: string;
|
|
5051
5051
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
5052
5052
|
intervalCount: number;
|
|
5053
|
-
onchainSubscriptionId: number | null;
|
|
5054
5053
|
planId: string;
|
|
5054
|
+
onchainSubscriptionId: number | null;
|
|
5055
5055
|
trialEndsAt: string | null;
|
|
5056
5056
|
currentPeriodStartAt: string;
|
|
5057
5057
|
currentPeriodEndAt: string;
|
|
@@ -5098,8 +5098,8 @@ declare const webhookEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
5098
5098
|
payerAddress: string;
|
|
5099
5099
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
5100
5100
|
intervalCount: number;
|
|
5101
|
-
onchainSubscriptionId: number | null;
|
|
5102
5101
|
planId: string;
|
|
5102
|
+
onchainSubscriptionId: number | null;
|
|
5103
5103
|
trialEndsAt: string | null;
|
|
5104
5104
|
currentPeriodStartAt: string;
|
|
5105
5105
|
currentPeriodEndAt: string;
|
|
@@ -5172,8 +5172,8 @@ declare const webhookEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
5172
5172
|
payerAddress: string;
|
|
5173
5173
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
5174
5174
|
intervalCount: number;
|
|
5175
|
-
onchainSubscriptionId: number | null;
|
|
5176
5175
|
planId: string;
|
|
5176
|
+
onchainSubscriptionId: number | null;
|
|
5177
5177
|
trialEndsAt: string | null;
|
|
5178
5178
|
currentPeriodStartAt: string;
|
|
5179
5179
|
currentPeriodEndAt: string;
|
|
@@ -5192,8 +5192,8 @@ declare const webhookEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
5192
5192
|
payerAddress: string;
|
|
5193
5193
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
5194
5194
|
intervalCount: number;
|
|
5195
|
-
onchainSubscriptionId: number | null;
|
|
5196
5195
|
planId: string;
|
|
5196
|
+
onchainSubscriptionId: number | null;
|
|
5197
5197
|
trialEndsAt: string | null;
|
|
5198
5198
|
currentPeriodStartAt: string;
|
|
5199
5199
|
currentPeriodEndAt: string;
|
|
@@ -5218,8 +5218,8 @@ declare const webhookEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
5218
5218
|
payerAddress: string;
|
|
5219
5219
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
5220
5220
|
intervalCount: number;
|
|
5221
|
-
onchainSubscriptionId: number | null;
|
|
5222
5221
|
planId: string;
|
|
5222
|
+
onchainSubscriptionId: number | null;
|
|
5223
5223
|
trialEndsAt: string | null;
|
|
5224
5224
|
currentPeriodStartAt: string;
|
|
5225
5225
|
currentPeriodEndAt: string;
|
|
@@ -5241,8 +5241,8 @@ declare const webhookEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
5241
5241
|
payerAddress: string;
|
|
5242
5242
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
5243
5243
|
intervalCount: number;
|
|
5244
|
-
onchainSubscriptionId: number | null;
|
|
5245
5244
|
planId: string;
|
|
5245
|
+
onchainSubscriptionId: number | null;
|
|
5246
5246
|
trialEndsAt: string | null;
|
|
5247
5247
|
currentPeriodStartAt: string;
|
|
5248
5248
|
currentPeriodEndAt: string;
|
|
@@ -5270,8 +5270,8 @@ declare const webhookEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
5270
5270
|
payerAddress: string;
|
|
5271
5271
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
5272
5272
|
intervalCount: number;
|
|
5273
|
-
onchainSubscriptionId: number | null;
|
|
5274
5273
|
planId: string;
|
|
5274
|
+
onchainSubscriptionId: number | null;
|
|
5275
5275
|
trialEndsAt: string | null;
|
|
5276
5276
|
currentPeriodStartAt: string;
|
|
5277
5277
|
currentPeriodEndAt: string;
|
|
@@ -5300,8 +5300,8 @@ declare const webhookEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
5300
5300
|
payerAddress: string;
|
|
5301
5301
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
5302
5302
|
intervalCount: number;
|
|
5303
|
-
onchainSubscriptionId: number | null;
|
|
5304
5303
|
planId: string;
|
|
5304
|
+
onchainSubscriptionId: number | null;
|
|
5305
5305
|
trialEndsAt: string | null;
|
|
5306
5306
|
currentPeriodStartAt: string;
|
|
5307
5307
|
currentPeriodEndAt: string;
|
|
@@ -5354,8 +5354,8 @@ declare const webhookEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
5354
5354
|
payerAddress: string;
|
|
5355
5355
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
5356
5356
|
intervalCount: number;
|
|
5357
|
-
onchainSubscriptionId: number | null;
|
|
5358
5357
|
planId: string;
|
|
5358
|
+
onchainSubscriptionId: number | null;
|
|
5359
5359
|
trialEndsAt: string | null;
|
|
5360
5360
|
currentPeriodStartAt: string;
|
|
5361
5361
|
currentPeriodEndAt: string;
|
|
@@ -5374,8 +5374,8 @@ declare const webhookEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
5374
5374
|
payerAddress: string;
|
|
5375
5375
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
5376
5376
|
intervalCount: number;
|
|
5377
|
-
onchainSubscriptionId: number | null;
|
|
5378
5377
|
planId: string;
|
|
5378
|
+
onchainSubscriptionId: number | null;
|
|
5379
5379
|
trialEndsAt: string | null;
|
|
5380
5380
|
currentPeriodStartAt: string;
|
|
5381
5381
|
currentPeriodEndAt: string;
|
|
@@ -5400,8 +5400,8 @@ declare const webhookEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
5400
5400
|
payerAddress: string;
|
|
5401
5401
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
5402
5402
|
intervalCount: number;
|
|
5403
|
-
onchainSubscriptionId: number | null;
|
|
5404
5403
|
planId: string;
|
|
5404
|
+
onchainSubscriptionId: number | null;
|
|
5405
5405
|
trialEndsAt: string | null;
|
|
5406
5406
|
currentPeriodStartAt: string;
|
|
5407
5407
|
currentPeriodEndAt: string;
|
|
@@ -5427,8 +5427,8 @@ declare const webhookEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
5427
5427
|
payerAddress: string;
|
|
5428
5428
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
5429
5429
|
intervalCount: number;
|
|
5430
|
-
onchainSubscriptionId: number | null;
|
|
5431
5430
|
planId: string;
|
|
5431
|
+
onchainSubscriptionId: number | null;
|
|
5432
5432
|
trialEndsAt: string | null;
|
|
5433
5433
|
currentPeriodStartAt: string;
|
|
5434
5434
|
currentPeriodEndAt: string;
|
|
@@ -5480,8 +5480,8 @@ declare const webhookEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
5480
5480
|
payerAddress: string;
|
|
5481
5481
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
5482
5482
|
intervalCount: number;
|
|
5483
|
-
onchainSubscriptionId: number | null;
|
|
5484
5483
|
planId: string;
|
|
5484
|
+
onchainSubscriptionId: number | null;
|
|
5485
5485
|
trialEndsAt: string | null;
|
|
5486
5486
|
currentPeriodStartAt: string;
|
|
5487
5487
|
currentPeriodEndAt: string;
|
|
@@ -5500,8 +5500,8 @@ declare const webhookEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
5500
5500
|
payerAddress: string;
|
|
5501
5501
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
5502
5502
|
intervalCount: number;
|
|
5503
|
-
onchainSubscriptionId: number | null;
|
|
5504
5503
|
planId: string;
|
|
5504
|
+
onchainSubscriptionId: number | null;
|
|
5505
5505
|
trialEndsAt: string | null;
|
|
5506
5506
|
currentPeriodStartAt: string;
|
|
5507
5507
|
currentPeriodEndAt: string;
|
|
@@ -5526,8 +5526,8 @@ declare const webhookEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
5526
5526
|
payerAddress: string;
|
|
5527
5527
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
5528
5528
|
intervalCount: number;
|
|
5529
|
-
onchainSubscriptionId: number | null;
|
|
5530
5529
|
planId: string;
|
|
5530
|
+
onchainSubscriptionId: number | null;
|
|
5531
5531
|
trialEndsAt: string | null;
|
|
5532
5532
|
currentPeriodStartAt: string;
|
|
5533
5533
|
currentPeriodEndAt: string;
|
|
@@ -5553,8 +5553,8 @@ declare const webhookEventSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
|
5553
5553
|
payerAddress: string;
|
|
5554
5554
|
interval: "daily" | "weekly" | "monthly" | "quarterly" | "yearly";
|
|
5555
5555
|
intervalCount: number;
|
|
5556
|
-
onchainSubscriptionId: number | null;
|
|
5557
5556
|
planId: string;
|
|
5557
|
+
onchainSubscriptionId: number | null;
|
|
5558
5558
|
trialEndsAt: string | null;
|
|
5559
5559
|
currentPeriodStartAt: string;
|
|
5560
5560
|
currentPeriodEndAt: string;
|
package/dist/events.js
CHANGED
|
@@ -205,6 +205,9 @@ z.object({
|
|
|
205
205
|
intervalCount: z.number().int().min(1).max(365),
|
|
206
206
|
trialPeriodDays: z.number().int().min(0).max(365).nullable(),
|
|
207
207
|
status: subscriptionPlanStatusSchema,
|
|
208
|
+
/** `{SUBSCRIPTION_ID}` and `{ON_CHAIN_TX_HASH}` are filled in on redirect. */
|
|
209
|
+
successUrl: callbackUrlSchema.nullable(),
|
|
210
|
+
cancelUrl: callbackUrlSchema.nullable(),
|
|
208
211
|
metadata: metadataSchema,
|
|
209
212
|
createdAt: isoTimestampSchema,
|
|
210
213
|
updatedAt: isoTimestampSchema
|
|
@@ -217,8 +220,41 @@ z.object({
|
|
|
217
220
|
interval: subscriptionIntervalSchema,
|
|
218
221
|
intervalCount: z.number().int().min(1).max(365).default(1),
|
|
219
222
|
trialPeriodDays: z.number().int().min(0).max(365).optional(),
|
|
223
|
+
successUrl: callbackUrlSchema.optional(),
|
|
224
|
+
cancelUrl: callbackUrlSchema.optional(),
|
|
220
225
|
metadata: metadataSchema.optional()
|
|
221
226
|
});
|
|
227
|
+
z.object({
|
|
228
|
+
successUrl: callbackUrlSchema.nullable().optional(),
|
|
229
|
+
cancelUrl: callbackUrlSchema.nullable().optional()
|
|
230
|
+
}).strict().refine((v) => v.successUrl !== void 0 || v.cancelUrl !== void 0, {
|
|
231
|
+
message: "set successUrl or cancelUrl"
|
|
232
|
+
});
|
|
233
|
+
var subscriptionResultErrorCodes = [
|
|
234
|
+
"load_failed",
|
|
235
|
+
"merchant_not_ready",
|
|
236
|
+
"payment_reverted",
|
|
237
|
+
"already_subscribed"
|
|
238
|
+
];
|
|
239
|
+
var subscriptionResultErrorCodeSchema = z.enum(subscriptionResultErrorCodes);
|
|
240
|
+
z.discriminatedUnion("type", [
|
|
241
|
+
z.object({
|
|
242
|
+
type: z.literal("strimz:subscription:success"),
|
|
243
|
+
planId: idSchema,
|
|
244
|
+
subscriptionId: idSchema.nullable(),
|
|
245
|
+
txHash: evmTxHashSchema
|
|
246
|
+
}),
|
|
247
|
+
z.object({
|
|
248
|
+
type: z.literal("strimz:subscription:cancel"),
|
|
249
|
+
planId: idSchema
|
|
250
|
+
}),
|
|
251
|
+
z.object({
|
|
252
|
+
type: z.literal("strimz:subscription:error"),
|
|
253
|
+
planId: idSchema,
|
|
254
|
+
code: subscriptionResultErrorCodeSchema,
|
|
255
|
+
message: z.string().min(1).max(500)
|
|
256
|
+
})
|
|
257
|
+
]);
|
|
222
258
|
var subscriptionStatusSchema = z.enum([
|
|
223
259
|
"trialing",
|
|
224
260
|
"active",
|