@adtrackify/at-service-common 1.2.24 → 1.2.26
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/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 +9 -9
- package/dist/clients/generic/s3-client.js +29 -29
- package/dist/clients/generic/s3-client.js.map +1 -1
- 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 -45
- package/dist/helpers/logging-helper.js.map +1 -1
- 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 +10 -5
- package/dist/index.esm.js.map +2 -2
- package/dist/index.js +5 -5
- 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 +6 -6
- package/dist/libs/index.js +6 -6
- 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 +1 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { createHmac } from 'crypto';
|
|
2
|
-
import { Logger } from './logging-helper.js';
|
|
3
|
-
import { HttpError } from '../libs/http-error.js';
|
|
4
|
-
import { mapObjectToQueryString } from '../libs/url.js';
|
|
5
|
-
export const isShopifyRequestValid = (validationParams, validationHmac, shopifyAppApiSecret) => {
|
|
6
|
-
delete validationParams.hmac;
|
|
7
|
-
const hmacString = mapObjectToQueryString(validationParams);
|
|
8
|
-
const generatedHash = createHmac('sha256', shopifyAppApiSecret)
|
|
9
|
-
.update(hmacString)
|
|
10
|
-
.digest('hex');
|
|
11
|
-
return generatedHash === validationHmac;
|
|
12
|
-
};
|
|
13
|
-
export const validateShopifyRequest = (validationParams, validationHmac, shopifyAppApiSecret) => {
|
|
14
|
-
Logger.info('Validating shopify request is authentic', { validationParams });
|
|
15
|
-
const isValid = isShopifyRequestValid(validationParams, validationHmac, shopifyAppApiSecret);
|
|
16
|
-
if (!isValid) {
|
|
17
|
-
const message = 'Failed: Shopify Request hmac validation';
|
|
18
|
-
Logger.error(message);
|
|
19
|
-
throw HttpError.badRequest(message);
|
|
20
|
-
}
|
|
21
|
-
Logger.info('Sucess: Shopify Request hmac validation');
|
|
22
|
-
return true;
|
|
23
|
-
};
|
|
1
|
+
import { createHmac } from 'crypto';
|
|
2
|
+
import { Logger } from './logging-helper.js';
|
|
3
|
+
import { HttpError } from '../libs/http-error.js';
|
|
4
|
+
import { mapObjectToQueryString } from '../libs/url.js';
|
|
5
|
+
export const isShopifyRequestValid = (validationParams, validationHmac, shopifyAppApiSecret) => {
|
|
6
|
+
delete validationParams.hmac;
|
|
7
|
+
const hmacString = mapObjectToQueryString(validationParams);
|
|
8
|
+
const generatedHash = createHmac('sha256', shopifyAppApiSecret)
|
|
9
|
+
.update(hmacString)
|
|
10
|
+
.digest('hex');
|
|
11
|
+
return generatedHash === validationHmac;
|
|
12
|
+
};
|
|
13
|
+
export const validateShopifyRequest = (validationParams, validationHmac, shopifyAppApiSecret) => {
|
|
14
|
+
Logger.info('Validating shopify request is authentic', { validationParams });
|
|
15
|
+
const isValid = isShopifyRequestValid(validationParams, validationHmac, shopifyAppApiSecret);
|
|
16
|
+
if (!isValid) {
|
|
17
|
+
const message = 'Failed: Shopify Request hmac validation';
|
|
18
|
+
Logger.error(message);
|
|
19
|
+
throw HttpError.badRequest(message);
|
|
20
|
+
}
|
|
21
|
+
Logger.info('Sucess: Shopify Request hmac validation');
|
|
22
|
+
return true;
|
|
23
|
+
};
|
|
24
24
|
//# sourceMappingURL=shopify-helper.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { SubscriptionPlan } from '@adtrackify/at-tracking-event-types';
|
|
2
|
-
export declare const StripeBillingMap: any;
|
|
3
|
-
export declare const CommonPlanInfo: string[];
|
|
4
|
-
export declare const SubscriptionPlanSeedItems: {
|
|
5
|
-
items: SubscriptionPlan[];
|
|
6
|
-
};
|
|
7
|
-
export declare const getPlanDetails: (planId: number, stage: string) => SubscriptionPlan;
|
|
8
|
-
export declare const getPlanByStripePriceId: (stripePriceId: string, stage: string) => SubscriptionPlan;
|
|
1
|
+
import { SubscriptionPlan } from '@adtrackify/at-tracking-event-types';
|
|
2
|
+
export declare const StripeBillingMap: any;
|
|
3
|
+
export declare const CommonPlanInfo: string[];
|
|
4
|
+
export declare const SubscriptionPlanSeedItems: {
|
|
5
|
+
items: SubscriptionPlan[];
|
|
6
|
+
};
|
|
7
|
+
export declare const getPlanDetails: (planId: number, stage: string) => SubscriptionPlan;
|
|
8
|
+
export declare const getPlanByStripePriceId: (stripePriceId: string, stage: string) => SubscriptionPlan;
|
|
@@ -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';
|
package/dist/index.esm.js
CHANGED
|
@@ -235,8 +235,8 @@ var S3Client = class {
|
|
|
235
235
|
return { status: true, response: res };
|
|
236
236
|
} catch (error2) {
|
|
237
237
|
Logger.error("Error in s3 upload json", { error: error2 });
|
|
238
|
-
if (retryCount
|
|
239
|
-
retryCount
|
|
238
|
+
if (retryCount > 0) {
|
|
239
|
+
retryCount--;
|
|
240
240
|
Logger.error("retrying to uploadJson", { path, bucket, jsonData, ACL, retryCount });
|
|
241
241
|
return await this.uploadJson(path, bucket, jsonData, ACL, retryCount);
|
|
242
242
|
}
|
|
@@ -934,9 +934,14 @@ var configureLogger = (event, context, debug2 = LEVEL === "debug") => {
|
|
|
934
934
|
};
|
|
935
935
|
var Logger = {
|
|
936
936
|
log: (logLevel, msg, meta = {}, tags) => {
|
|
937
|
-
if (
|
|
938
|
-
|
|
939
|
-
|
|
937
|
+
if (logLevel === "debug") {
|
|
938
|
+
Logger.debug(msg, meta, tags);
|
|
939
|
+
} else if (logLevel === "info") {
|
|
940
|
+
Logger.info(msg, meta, tags);
|
|
941
|
+
} else if (logLevel === "warn") {
|
|
942
|
+
Logger.warn(msg, meta, tags);
|
|
943
|
+
} else if (logLevel === "error") {
|
|
944
|
+
Logger.error(msg, meta, tags);
|
|
940
945
|
}
|
|
941
946
|
},
|
|
942
947
|
debug: (msg, meta, tags) => {
|