@adtrackify/at-service-common 1.2.33 → 1.2.34
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/__tests__/helpers/subscription-helper.spec.d.ts +1 -1
- package/dist/__tests__/helpers/subscription-helper.spec.js +27 -27
- package/dist/__tests__/s3-client/s3-client.spec.d.ts +1 -1
- package/dist/__tests__/s3-client/s3-client.spec.js +24 -24
- package/dist/clients/generic/cognito-client.d.ts +19 -19
- package/dist/clients/generic/cognito-client.js +139 -139
- package/dist/clients/generic/dynamodb-client.d.ts +15 -15
- package/dist/clients/generic/dynamodb-client.js +122 -122
- package/dist/clients/generic/eventbridge-client.d.ts +14 -14
- package/dist/clients/generic/eventbridge-client.js +45 -45
- package/dist/clients/generic/http-client.d.ts +30 -30
- package/dist/clients/generic/http-client.js +28 -28
- package/dist/clients/generic/index.d.ts +6 -6
- package/dist/clients/generic/index.js +6 -6
- package/dist/clients/generic/s3-client.d.ts +14 -14
- package/dist/clients/generic/s3-client.js +78 -78
- package/dist/clients/generic/sqs-client.d.ts +14 -14
- package/dist/clients/generic/sqs-client.js +34 -34
- package/dist/clients/index.d.ts +3 -3
- package/dist/clients/index.js +3 -3
- package/dist/clients/internal-api/accounts-client.d.ts +82 -82
- package/dist/clients/internal-api/accounts-client.js +78 -78
- package/dist/clients/internal-api/destinations-client.d.ts +54 -54
- package/dist/clients/internal-api/destinations-client.js +36 -36
- package/dist/clients/internal-api/index.d.ts +4 -4
- package/dist/clients/internal-api/index.js +4 -4
- package/dist/clients/internal-api/shopify-app-install-client.d.ts +57 -57
- package/dist/clients/internal-api/shopify-app-install-client.js +42 -42
- package/dist/clients/internal-api/users-auth-client.d.ts +61 -61
- package/dist/clients/internal-api/users-auth-client.js +73 -73
- package/dist/clients/third-party/index.d.ts +1 -1
- package/dist/clients/third-party/index.js +1 -1
- package/dist/clients/third-party/shopify-client.d.ts +90 -90
- package/dist/clients/third-party/shopify-client.js +121 -121
- package/dist/helpers/index.d.ts +5 -5
- package/dist/helpers/index.js +5 -5
- package/dist/helpers/input-validation-helper.d.ts +2 -2
- package/dist/helpers/input-validation-helper.js +18 -18
- package/dist/helpers/logging-helper.d.ts +15 -15
- package/dist/helpers/logging-helper.js +53 -53
- package/dist/helpers/response-helper.d.ts +36 -36
- package/dist/helpers/response-helper.js +35 -35
- package/dist/helpers/shopify-helper.d.ts +9 -9
- package/dist/helpers/shopify-helper.js +23 -23
- package/dist/helpers/subscription-helper.d.ts +8 -8
- package/dist/helpers/subscription-helper.js +181 -181
- package/dist/index.d.ts +5 -5
- package/dist/index.esm.js +4865 -32
- package/dist/index.esm.js.map +4 -4
- package/dist/index.js +5 -5
- package/dist/libs/clickId-parser.d.ts +21 -0
- package/dist/libs/clickId-parser.js +28 -0
- package/dist/libs/clickId-parser.js.map +1 -0
- package/dist/libs/crypto.d.ts +1 -1
- package/dist/libs/crypto.js +5 -5
- package/dist/libs/dates.d.ts +3 -3
- package/dist/libs/dates.js +10 -10
- package/dist/libs/http-error.d.ts +21 -21
- package/dist/libs/http-error.js +55 -55
- package/dist/libs/http-status-codes.d.ts +58 -58
- package/dist/libs/http-status-codes.js +59 -59
- package/dist/libs/index.d.ts +7 -6
- package/dist/libs/index.js +7 -6
- package/dist/libs/index.js.map +1 -1
- package/dist/libs/referrer-parser/index.d.ts +2 -0
- package/dist/libs/referrer-parser/index.js +3 -0
- package/dist/libs/referrer-parser/index.js.map +1 -0
- package/dist/libs/referrer-parser/referrer-data.d.ts +9 -0
- package/dist/libs/referrer-parser/referrer-data.js +4710 -0
- package/dist/libs/referrer-parser/referrer-data.js.map +1 -0
- package/dist/libs/referrer-parser/referrer-parser-util.d.ts +20 -0
- package/dist/libs/referrer-parser/referrer-parser-util.js +117 -0
- package/dist/libs/referrer-parser/referrer-parser-util.js.map +1 -0
- package/dist/libs/url.d.ts +1 -1
- package/dist/libs/url.js +9 -9
- package/dist/services/eventbridge-integration-service.d.ts +9 -9
- package/dist/services/eventbridge-integration-service.js +24 -24
- package/dist/services/index.d.ts +1 -1
- package/dist/services/index.js +1 -1
- package/dist/types/api-response.d.ts +6 -6
- package/dist/types/api-response.js +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/internal-events/event-detail-types.d.ts +20 -20
- package/dist/types/internal-events/event-detail-types.js +24 -24
- package/dist/types/internal-events/index.d.ts +1 -1
- package/dist/types/internal-events/index.js +1 -1
- package/package.json +6 -3
|
@@ -1,182 +1,182 @@
|
|
|
1
|
-
import { PLAN_BILLING_FREQUENCY } from '@adtrackify/at-tracking-event-types';
|
|
2
|
-
export const StripeBillingMap = {
|
|
3
|
-
dev2: {
|
|
4
|
-
'free': 'price_1JzjbKK7krGh4037ezNbGJEm',
|
|
5
|
-
'starter_monthly': 'price_1JwzsGK7krGh4037Li0hPpsZ',
|
|
6
|
-
'starter_yearly': 'price_1JwzsGK7krGh4037Li0hPpsZ',
|
|
7
|
-
'scale_monthly': 'price_1JzjcSK7krGh4037yh34LPk3',
|
|
8
|
-
'scale_yearly': 'price_1JzjcSK7krGh4037QiBJYfnD',
|
|
9
|
-
'growth_monthly': 'price_1Jzje1K7krGh4037KErHBp5N',
|
|
10
|
-
'growth_yearly': 'price_1Jzje1K7krGh4037MhCUhTDh'
|
|
11
|
-
},
|
|
12
|
-
qa2: {
|
|
13
|
-
'free': 'price_1JzjbKK7krGh4037ezNbGJEm',
|
|
14
|
-
'starter_monthly': 'price_1JwzsGK7krGh4037Li0hPpsZ',
|
|
15
|
-
'starter_yearly': 'price_1JwzsGK7krGh4037Li0hPpsZ',
|
|
16
|
-
'scale_monthly': 'price_1JzjcSK7krGh4037yh34LPk3',
|
|
17
|
-
'scale_yearly': 'price_1JzjcSK7krGh4037QiBJYfnD',
|
|
18
|
-
'growth_monthly': 'price_1Jzje1K7krGh4037KErHBp5N',
|
|
19
|
-
'growth_yearly': 'price_1Jzje1K7krGh4037MhCUhTDh'
|
|
20
|
-
},
|
|
21
|
-
prod2: {
|
|
22
|
-
'free': 'price_1KAFsIK7krGh4037RsaAYMEl',
|
|
23
|
-
'starter_monthly': 'price_1KAFsMK7krGh4037Lz3P0ksU',
|
|
24
|
-
'starter_yearly': 'price_1KAFsMK7krGh4037Dj1WmSi8',
|
|
25
|
-
'scale_monthly': 'price_1KAFrxK7krGh4037zWCdaTly',
|
|
26
|
-
'scale_yearly': 'price_1KAFrxK7krGh40375fhymyWP',
|
|
27
|
-
'growth_monthly': 'price_1KAFs7K7krGh4037JChjz5Cr',
|
|
28
|
-
'growth_yearly': 'price_1KAFs7K7krGh4037rZElg12s'
|
|
29
|
-
},
|
|
30
|
-
dev: {
|
|
31
|
-
'free': 'price_1JzjbKK7krGh4037ezNbGJEm',
|
|
32
|
-
'starter_monthly': 'price_1JwzsGK7krGh4037Li0hPpsZ',
|
|
33
|
-
'starter_yearly': 'price_1JwzsGK7krGh4037Li0hPpsZ',
|
|
34
|
-
'scale_monthly': 'price_1JzjcSK7krGh4037yh34LPk3',
|
|
35
|
-
'scale_yearly': 'price_1JzjcSK7krGh4037QiBJYfnD',
|
|
36
|
-
'growth_monthly': 'price_1Jzje1K7krGh4037KErHBp5N',
|
|
37
|
-
'growth_yearly': 'price_1Jzje1K7krGh4037MhCUhTDh'
|
|
38
|
-
},
|
|
39
|
-
qa: {
|
|
40
|
-
'free': 'price_1JzjbKK7krGh4037ezNbGJEm',
|
|
41
|
-
'starter_monthly': 'price_1JwzsGK7krGh4037Li0hPpsZ',
|
|
42
|
-
'starter_yearly': 'price_1JwzsGK7krGh4037Li0hPpsZ',
|
|
43
|
-
'scale_monthly': 'price_1JzjcSK7krGh4037yh34LPk3',
|
|
44
|
-
'scale_yearly': 'price_1JzjcSK7krGh4037QiBJYfnD',
|
|
45
|
-
'growth_monthly': 'price_1Jzje1K7krGh4037KErHBp5N',
|
|
46
|
-
'growth_yearly': 'price_1Jzje1K7krGh4037MhCUhTDh'
|
|
47
|
-
},
|
|
48
|
-
prod: {
|
|
49
|
-
'free': 'price_1KAFsIK7krGh4037RsaAYMEl',
|
|
50
|
-
'starter_monthly': 'price_1KAFsMK7krGh4037Lz3P0ksU',
|
|
51
|
-
'starter_yearly': 'price_1KAFsMK7krGh4037Dj1WmSi8',
|
|
52
|
-
'scale_monthly': 'price_1KAFrxK7krGh4037zWCdaTly',
|
|
53
|
-
'scale_yearly': 'price_1KAFrxK7krGh40375fhymyWP',
|
|
54
|
-
'growth_monthly': 'price_1KAFs7K7krGh4037JChjz5Cr',
|
|
55
|
-
'growth_yearly': 'price_1KAFs7K7krGh4037rZElg12s'
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
export const CommonPlanInfo = [
|
|
59
|
-
'Free Server Side Tracking & Conversion API',
|
|
60
|
-
'MultiPixel Support (Multiple facebook, tiktok, etc)',
|
|
61
|
-
'Corrects Facebook Conversion Tracking post IOS14',
|
|
62
|
-
'Increase ROAS & Attribution Data',
|
|
63
|
-
'Enhanced Fingerprinting & Identity Resolution',
|
|
64
|
-
'Unlimited Integrations',
|
|
65
|
-
'Advanced Integrations (Webhooks, Custom JS/HTML, Hubspot)'
|
|
66
|
-
];
|
|
67
|
-
export const SubscriptionPlanSeedItems = {
|
|
68
|
-
items: [{
|
|
69
|
-
id: 1,
|
|
70
|
-
planName: 'free',
|
|
71
|
-
displayName: 'Free',
|
|
72
|
-
sku: 'ADT-001',
|
|
73
|
-
description: 'Free Plan - Monthly',
|
|
74
|
-
price: '0',
|
|
75
|
-
displayPrice: '$0',
|
|
76
|
-
billingFrequency: PLAN_BILLING_FREQUENCY.MONTHLY,
|
|
77
|
-
trialLengthDays: 0,
|
|
78
|
-
trialRequiresCreditCard: false,
|
|
79
|
-
planDesc: [
|
|
80
|
-
...CommonPlanInfo,
|
|
81
|
-
'Free Up to 500 orders/month (50,000 events)*'
|
|
82
|
-
],
|
|
83
|
-
unitPriceText: 'try now - free forever',
|
|
84
|
-
isHighlighted: false,
|
|
85
|
-
isBanner: false
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
id: 2,
|
|
89
|
-
planName: 'starter_monthly',
|
|
90
|
-
displayName: 'Starter',
|
|
91
|
-
sku: 'ADT-002',
|
|
92
|
-
description: 'Starter Plan - Monthly',
|
|
93
|
-
price: '79.99',
|
|
94
|
-
displayPrice: '$79.99',
|
|
95
|
-
billingFrequency: PLAN_BILLING_FREQUENCY.MONTHLY,
|
|
96
|
-
trialLengthDays: 60,
|
|
97
|
-
trialRequiresCreditCard: false,
|
|
98
|
-
planDesc: [
|
|
99
|
-
'60-day Risk Free Trial',
|
|
100
|
-
...CommonPlanInfo,
|
|
101
|
-
'Up to 2,000 orders/month (250,000 events)*'
|
|
102
|
-
],
|
|
103
|
-
isHighlighted: true,
|
|
104
|
-
isBanner: true,
|
|
105
|
-
bannerColor: 'blue',
|
|
106
|
-
bannerText: 'MOST POPULAR'
|
|
107
|
-
}, {
|
|
108
|
-
id: 3,
|
|
109
|
-
planName: 'starter_yearly',
|
|
110
|
-
displayName: 'Starter',
|
|
111
|
-
sku: 'ADT-003',
|
|
112
|
-
description: 'Starter Plan - Yearly',
|
|
113
|
-
price: '767.90',
|
|
114
|
-
displayPrice: '$63.99',
|
|
115
|
-
billingFrequency: PLAN_BILLING_FREQUENCY.YEARLY,
|
|
116
|
-
trialLengthDays: 30,
|
|
117
|
-
trialRequiresCreditCard: false,
|
|
118
|
-
planDesc: [
|
|
119
|
-
'60-day Risk Free Trial',
|
|
120
|
-
...CommonPlanInfo,
|
|
121
|
-
'Up to 2,000 orders/month (250,000 events)*'
|
|
122
|
-
],
|
|
123
|
-
unitPriceText: 'billed yearly ($767.90) - 20% savings',
|
|
124
|
-
isHighlighted: true,
|
|
125
|
-
isBanner: true,
|
|
126
|
-
bannerColor: 'blue',
|
|
127
|
-
bannerText: 'MOST POPULAR'
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
id: 4,
|
|
131
|
-
planName: 'scale_monthly',
|
|
132
|
-
displayName: 'Scale',
|
|
133
|
-
sku: 'ADT-004',
|
|
134
|
-
description: 'Scale Plan - Monthly',
|
|
135
|
-
price: '199.99',
|
|
136
|
-
displayPrice: '$199.99',
|
|
137
|
-
billingFrequency: PLAN_BILLING_FREQUENCY.MONTHLY,
|
|
138
|
-
trialLengthDays: 60,
|
|
139
|
-
trialRequiresCreditCard: false,
|
|
140
|
-
planDesc: [
|
|
141
|
-
'60-day Risk Free Trial',
|
|
142
|
-
...CommonPlanInfo,
|
|
143
|
-
'Up to 7,500 orders/month (750,000 events)*'
|
|
144
|
-
],
|
|
145
|
-
unitPriceText: '',
|
|
146
|
-
isHighlighted: false,
|
|
147
|
-
isBanner: false
|
|
148
|
-
}, {
|
|
149
|
-
id: 5,
|
|
150
|
-
planName: 'scale_yearly',
|
|
151
|
-
displayName: 'Scale',
|
|
152
|
-
sku: 'ADT-005',
|
|
153
|
-
description: 'Scale Plan - Yearly',
|
|
154
|
-
price: '1823.91',
|
|
155
|
-
displayPrice: '$151.99',
|
|
156
|
-
billingFrequency: PLAN_BILLING_FREQUENCY.YEARLY,
|
|
157
|
-
trialLengthDays: 60,
|
|
158
|
-
trialRequiresCreditCard: false,
|
|
159
|
-
planDesc: [
|
|
160
|
-
'60-day Risk Free Trial',
|
|
161
|
-
...CommonPlanInfo,
|
|
162
|
-
'Up to 7,500 orders/month (750,000 events)*'
|
|
163
|
-
],
|
|
164
|
-
unitPriceText: 'billed yearly ($1823.91) - 24% savings',
|
|
165
|
-
isHighlighted: false,
|
|
166
|
-
isBanner: false
|
|
167
|
-
},
|
|
168
|
-
]
|
|
169
|
-
};
|
|
170
|
-
export const getPlanDetails = (planId, stage) => {
|
|
171
|
-
const plan = SubscriptionPlanSeedItems.items.filter(x => x.id === planId)[0];
|
|
172
|
-
plan.stripePriceId = StripeBillingMap[stage][plan.planName];
|
|
173
|
-
return plan;
|
|
174
|
-
};
|
|
175
|
-
export const getPlanByStripePriceId = (stripePriceId, stage) => {
|
|
176
|
-
const stripePriceIds = StripeBillingMap[stage];
|
|
177
|
-
const planName = Object.keys(stripePriceIds).find(key => stripePriceIds[key] === stripePriceId);
|
|
178
|
-
const plan = SubscriptionPlanSeedItems.items.filter(x => x.planName === planName)[0];
|
|
179
|
-
plan.stripePriceId = stripePriceId;
|
|
180
|
-
return plan;
|
|
181
|
-
};
|
|
1
|
+
import { PLAN_BILLING_FREQUENCY } from '@adtrackify/at-tracking-event-types';
|
|
2
|
+
export const StripeBillingMap = {
|
|
3
|
+
dev2: {
|
|
4
|
+
'free': 'price_1JzjbKK7krGh4037ezNbGJEm',
|
|
5
|
+
'starter_monthly': 'price_1JwzsGK7krGh4037Li0hPpsZ',
|
|
6
|
+
'starter_yearly': 'price_1JwzsGK7krGh4037Li0hPpsZ',
|
|
7
|
+
'scale_monthly': 'price_1JzjcSK7krGh4037yh34LPk3',
|
|
8
|
+
'scale_yearly': 'price_1JzjcSK7krGh4037QiBJYfnD',
|
|
9
|
+
'growth_monthly': 'price_1Jzje1K7krGh4037KErHBp5N',
|
|
10
|
+
'growth_yearly': 'price_1Jzje1K7krGh4037MhCUhTDh'
|
|
11
|
+
},
|
|
12
|
+
qa2: {
|
|
13
|
+
'free': 'price_1JzjbKK7krGh4037ezNbGJEm',
|
|
14
|
+
'starter_monthly': 'price_1JwzsGK7krGh4037Li0hPpsZ',
|
|
15
|
+
'starter_yearly': 'price_1JwzsGK7krGh4037Li0hPpsZ',
|
|
16
|
+
'scale_monthly': 'price_1JzjcSK7krGh4037yh34LPk3',
|
|
17
|
+
'scale_yearly': 'price_1JzjcSK7krGh4037QiBJYfnD',
|
|
18
|
+
'growth_monthly': 'price_1Jzje1K7krGh4037KErHBp5N',
|
|
19
|
+
'growth_yearly': 'price_1Jzje1K7krGh4037MhCUhTDh'
|
|
20
|
+
},
|
|
21
|
+
prod2: {
|
|
22
|
+
'free': 'price_1KAFsIK7krGh4037RsaAYMEl',
|
|
23
|
+
'starter_monthly': 'price_1KAFsMK7krGh4037Lz3P0ksU',
|
|
24
|
+
'starter_yearly': 'price_1KAFsMK7krGh4037Dj1WmSi8',
|
|
25
|
+
'scale_monthly': 'price_1KAFrxK7krGh4037zWCdaTly',
|
|
26
|
+
'scale_yearly': 'price_1KAFrxK7krGh40375fhymyWP',
|
|
27
|
+
'growth_monthly': 'price_1KAFs7K7krGh4037JChjz5Cr',
|
|
28
|
+
'growth_yearly': 'price_1KAFs7K7krGh4037rZElg12s'
|
|
29
|
+
},
|
|
30
|
+
dev: {
|
|
31
|
+
'free': 'price_1JzjbKK7krGh4037ezNbGJEm',
|
|
32
|
+
'starter_monthly': 'price_1JwzsGK7krGh4037Li0hPpsZ',
|
|
33
|
+
'starter_yearly': 'price_1JwzsGK7krGh4037Li0hPpsZ',
|
|
34
|
+
'scale_monthly': 'price_1JzjcSK7krGh4037yh34LPk3',
|
|
35
|
+
'scale_yearly': 'price_1JzjcSK7krGh4037QiBJYfnD',
|
|
36
|
+
'growth_monthly': 'price_1Jzje1K7krGh4037KErHBp5N',
|
|
37
|
+
'growth_yearly': 'price_1Jzje1K7krGh4037MhCUhTDh'
|
|
38
|
+
},
|
|
39
|
+
qa: {
|
|
40
|
+
'free': 'price_1JzjbKK7krGh4037ezNbGJEm',
|
|
41
|
+
'starter_monthly': 'price_1JwzsGK7krGh4037Li0hPpsZ',
|
|
42
|
+
'starter_yearly': 'price_1JwzsGK7krGh4037Li0hPpsZ',
|
|
43
|
+
'scale_monthly': 'price_1JzjcSK7krGh4037yh34LPk3',
|
|
44
|
+
'scale_yearly': 'price_1JzjcSK7krGh4037QiBJYfnD',
|
|
45
|
+
'growth_monthly': 'price_1Jzje1K7krGh4037KErHBp5N',
|
|
46
|
+
'growth_yearly': 'price_1Jzje1K7krGh4037MhCUhTDh'
|
|
47
|
+
},
|
|
48
|
+
prod: {
|
|
49
|
+
'free': 'price_1KAFsIK7krGh4037RsaAYMEl',
|
|
50
|
+
'starter_monthly': 'price_1KAFsMK7krGh4037Lz3P0ksU',
|
|
51
|
+
'starter_yearly': 'price_1KAFsMK7krGh4037Dj1WmSi8',
|
|
52
|
+
'scale_monthly': 'price_1KAFrxK7krGh4037zWCdaTly',
|
|
53
|
+
'scale_yearly': 'price_1KAFrxK7krGh40375fhymyWP',
|
|
54
|
+
'growth_monthly': 'price_1KAFs7K7krGh4037JChjz5Cr',
|
|
55
|
+
'growth_yearly': 'price_1KAFs7K7krGh4037rZElg12s'
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
export const CommonPlanInfo = [
|
|
59
|
+
'Free Server Side Tracking & Conversion API',
|
|
60
|
+
'MultiPixel Support (Multiple facebook, tiktok, etc)',
|
|
61
|
+
'Corrects Facebook Conversion Tracking post IOS14',
|
|
62
|
+
'Increase ROAS & Attribution Data',
|
|
63
|
+
'Enhanced Fingerprinting & Identity Resolution',
|
|
64
|
+
'Unlimited Integrations',
|
|
65
|
+
'Advanced Integrations (Webhooks, Custom JS/HTML, Hubspot)'
|
|
66
|
+
];
|
|
67
|
+
export const SubscriptionPlanSeedItems = {
|
|
68
|
+
items: [{
|
|
69
|
+
id: 1,
|
|
70
|
+
planName: 'free',
|
|
71
|
+
displayName: 'Free',
|
|
72
|
+
sku: 'ADT-001',
|
|
73
|
+
description: 'Free Plan - Monthly',
|
|
74
|
+
price: '0',
|
|
75
|
+
displayPrice: '$0',
|
|
76
|
+
billingFrequency: PLAN_BILLING_FREQUENCY.MONTHLY,
|
|
77
|
+
trialLengthDays: 0,
|
|
78
|
+
trialRequiresCreditCard: false,
|
|
79
|
+
planDesc: [
|
|
80
|
+
...CommonPlanInfo,
|
|
81
|
+
'Free Up to 500 orders/month (50,000 events)*'
|
|
82
|
+
],
|
|
83
|
+
unitPriceText: 'try now - free forever',
|
|
84
|
+
isHighlighted: false,
|
|
85
|
+
isBanner: false
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
id: 2,
|
|
89
|
+
planName: 'starter_monthly',
|
|
90
|
+
displayName: 'Starter',
|
|
91
|
+
sku: 'ADT-002',
|
|
92
|
+
description: 'Starter Plan - Monthly',
|
|
93
|
+
price: '79.99',
|
|
94
|
+
displayPrice: '$79.99',
|
|
95
|
+
billingFrequency: PLAN_BILLING_FREQUENCY.MONTHLY,
|
|
96
|
+
trialLengthDays: 60,
|
|
97
|
+
trialRequiresCreditCard: false,
|
|
98
|
+
planDesc: [
|
|
99
|
+
'60-day Risk Free Trial',
|
|
100
|
+
...CommonPlanInfo,
|
|
101
|
+
'Up to 2,000 orders/month (250,000 events)*'
|
|
102
|
+
],
|
|
103
|
+
isHighlighted: true,
|
|
104
|
+
isBanner: true,
|
|
105
|
+
bannerColor: 'blue',
|
|
106
|
+
bannerText: 'MOST POPULAR'
|
|
107
|
+
}, {
|
|
108
|
+
id: 3,
|
|
109
|
+
planName: 'starter_yearly',
|
|
110
|
+
displayName: 'Starter',
|
|
111
|
+
sku: 'ADT-003',
|
|
112
|
+
description: 'Starter Plan - Yearly',
|
|
113
|
+
price: '767.90',
|
|
114
|
+
displayPrice: '$63.99',
|
|
115
|
+
billingFrequency: PLAN_BILLING_FREQUENCY.YEARLY,
|
|
116
|
+
trialLengthDays: 30,
|
|
117
|
+
trialRequiresCreditCard: false,
|
|
118
|
+
planDesc: [
|
|
119
|
+
'60-day Risk Free Trial',
|
|
120
|
+
...CommonPlanInfo,
|
|
121
|
+
'Up to 2,000 orders/month (250,000 events)*'
|
|
122
|
+
],
|
|
123
|
+
unitPriceText: 'billed yearly ($767.90) - 20% savings',
|
|
124
|
+
isHighlighted: true,
|
|
125
|
+
isBanner: true,
|
|
126
|
+
bannerColor: 'blue',
|
|
127
|
+
bannerText: 'MOST POPULAR'
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
id: 4,
|
|
131
|
+
planName: 'scale_monthly',
|
|
132
|
+
displayName: 'Scale',
|
|
133
|
+
sku: 'ADT-004',
|
|
134
|
+
description: 'Scale Plan - Monthly',
|
|
135
|
+
price: '199.99',
|
|
136
|
+
displayPrice: '$199.99',
|
|
137
|
+
billingFrequency: PLAN_BILLING_FREQUENCY.MONTHLY,
|
|
138
|
+
trialLengthDays: 60,
|
|
139
|
+
trialRequiresCreditCard: false,
|
|
140
|
+
planDesc: [
|
|
141
|
+
'60-day Risk Free Trial',
|
|
142
|
+
...CommonPlanInfo,
|
|
143
|
+
'Up to 7,500 orders/month (750,000 events)*'
|
|
144
|
+
],
|
|
145
|
+
unitPriceText: '',
|
|
146
|
+
isHighlighted: false,
|
|
147
|
+
isBanner: false
|
|
148
|
+
}, {
|
|
149
|
+
id: 5,
|
|
150
|
+
planName: 'scale_yearly',
|
|
151
|
+
displayName: 'Scale',
|
|
152
|
+
sku: 'ADT-005',
|
|
153
|
+
description: 'Scale Plan - Yearly',
|
|
154
|
+
price: '1823.91',
|
|
155
|
+
displayPrice: '$151.99',
|
|
156
|
+
billingFrequency: PLAN_BILLING_FREQUENCY.YEARLY,
|
|
157
|
+
trialLengthDays: 60,
|
|
158
|
+
trialRequiresCreditCard: false,
|
|
159
|
+
planDesc: [
|
|
160
|
+
'60-day Risk Free Trial',
|
|
161
|
+
...CommonPlanInfo,
|
|
162
|
+
'Up to 7,500 orders/month (750,000 events)*'
|
|
163
|
+
],
|
|
164
|
+
unitPriceText: 'billed yearly ($1823.91) - 24% savings',
|
|
165
|
+
isHighlighted: false,
|
|
166
|
+
isBanner: false
|
|
167
|
+
},
|
|
168
|
+
]
|
|
169
|
+
};
|
|
170
|
+
export const getPlanDetails = (planId, stage) => {
|
|
171
|
+
const plan = SubscriptionPlanSeedItems.items.filter(x => x.id === planId)[0];
|
|
172
|
+
plan.stripePriceId = StripeBillingMap[stage][plan.planName];
|
|
173
|
+
return plan;
|
|
174
|
+
};
|
|
175
|
+
export const getPlanByStripePriceId = (stripePriceId, stage) => {
|
|
176
|
+
const stripePriceIds = StripeBillingMap[stage];
|
|
177
|
+
const planName = Object.keys(stripePriceIds).find(key => stripePriceIds[key] === stripePriceId);
|
|
178
|
+
const plan = SubscriptionPlanSeedItems.items.filter(x => x.planName === planName)[0];
|
|
179
|
+
plan.stripePriceId = stripePriceId;
|
|
180
|
+
return plan;
|
|
181
|
+
};
|
|
182
182
|
//# sourceMappingURL=subscription-helper.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './clients/index.js';
|
|
2
|
-
export * from './helpers/index.js';
|
|
3
|
-
export * from './libs/index.js';
|
|
4
|
-
export * from './types/index.js';
|
|
5
|
-
export * from './services/index.js';
|
|
1
|
+
export * from './clients/index.js';
|
|
2
|
+
export * from './helpers/index.js';
|
|
3
|
+
export * from './libs/index.js';
|
|
4
|
+
export * from './types/index.js';
|
|
5
|
+
export * from './services/index.js';
|