@adtrackify/at-service-common 1.2.17 → 1.2.19

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 (75) hide show
  1. package/dist/__tests__/helpers/subscription-helper.spec.d.ts +1 -1
  2. package/dist/__tests__/helpers/subscription-helper.spec.js +27 -27
  3. package/dist/clients/generic/cognito-client.d.ts +19 -19
  4. package/dist/clients/generic/cognito-client.js +139 -139
  5. package/dist/clients/generic/dynamodb-client.d.ts +15 -15
  6. package/dist/clients/generic/dynamodb-client.js +122 -122
  7. package/dist/clients/generic/eventbridge-client.d.ts +14 -14
  8. package/dist/clients/generic/eventbridge-client.js +45 -45
  9. package/dist/clients/generic/http-client.d.ts +30 -30
  10. package/dist/clients/generic/http-client.js +28 -28
  11. package/dist/clients/generic/index.d.ts +6 -6
  12. package/dist/clients/generic/index.js +6 -6
  13. package/dist/clients/generic/s3-client.d.ts +6 -9
  14. package/dist/clients/generic/s3-client.js +24 -28
  15. package/dist/clients/generic/s3-client.js.map +1 -1
  16. package/dist/clients/generic/sqs-client.d.ts +14 -14
  17. package/dist/clients/generic/sqs-client.js +34 -34
  18. package/dist/clients/index.d.ts +3 -3
  19. package/dist/clients/index.js +3 -3
  20. package/dist/clients/internal-api/accounts-client.d.ts +82 -82
  21. package/dist/clients/internal-api/accounts-client.js +78 -78
  22. package/dist/clients/internal-api/destinations-client.d.ts +54 -54
  23. package/dist/clients/internal-api/destinations-client.js +36 -36
  24. package/dist/clients/internal-api/index.d.ts +4 -4
  25. package/dist/clients/internal-api/index.js +4 -4
  26. package/dist/clients/internal-api/shopify-app-install-client.d.ts +57 -57
  27. package/dist/clients/internal-api/shopify-app-install-client.js +42 -42
  28. package/dist/clients/internal-api/users-auth-client.d.ts +61 -61
  29. package/dist/clients/internal-api/users-auth-client.js +73 -73
  30. package/dist/clients/third-party/index.d.ts +1 -1
  31. package/dist/clients/third-party/index.js +1 -1
  32. package/dist/clients/third-party/shopify-client.d.ts +90 -90
  33. package/dist/clients/third-party/shopify-client.js +121 -121
  34. package/dist/helpers/index.d.ts +5 -5
  35. package/dist/helpers/index.js +5 -5
  36. package/dist/helpers/input-validation-helper.d.ts +2 -2
  37. package/dist/helpers/input-validation-helper.js +18 -18
  38. package/dist/helpers/logging-helper.d.ts +15 -1
  39. package/dist/helpers/logging-helper.js +44 -9
  40. package/dist/helpers/logging-helper.js.map +1 -1
  41. package/dist/helpers/response-helper.d.ts +36 -36
  42. package/dist/helpers/response-helper.js +35 -35
  43. package/dist/helpers/shopify-helper.d.ts +9 -9
  44. package/dist/helpers/shopify-helper.js +23 -23
  45. package/dist/helpers/subscription-helper.d.ts +8 -8
  46. package/dist/helpers/subscription-helper.js +181 -181
  47. package/dist/index.d.ts +5 -5
  48. package/dist/index.esm.js +75 -41
  49. package/dist/index.esm.js.map +4 -4
  50. package/dist/index.js +5 -5
  51. package/dist/libs/crypto.d.ts +1 -1
  52. package/dist/libs/crypto.js +5 -5
  53. package/dist/libs/dates.d.ts +3 -3
  54. package/dist/libs/dates.js +10 -10
  55. package/dist/libs/http-error.d.ts +21 -21
  56. package/dist/libs/http-error.js +55 -55
  57. package/dist/libs/http-status-codes.d.ts +58 -58
  58. package/dist/libs/http-status-codes.js +59 -59
  59. package/dist/libs/index.d.ts +6 -6
  60. package/dist/libs/index.js +6 -6
  61. package/dist/libs/url.d.ts +1 -1
  62. package/dist/libs/url.js +9 -9
  63. package/dist/services/eventbridge-integration-service.d.ts +9 -9
  64. package/dist/services/eventbridge-integration-service.js +24 -24
  65. package/dist/services/index.d.ts +1 -1
  66. package/dist/services/index.js +1 -1
  67. package/dist/types/api-response.d.ts +6 -6
  68. package/dist/types/api-response.js +1 -1
  69. package/dist/types/index.d.ts +1 -1
  70. package/dist/types/index.js +1 -1
  71. package/dist/types/internal-events/event-detail-types.d.ts +20 -20
  72. package/dist/types/internal-events/event-detail-types.js +24 -24
  73. package/dist/types/internal-events/index.d.ts +1 -1
  74. package/dist/types/internal-events/index.js +1 -1
  75. package/package.json +4 -4
@@ -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
@@ -198,10 +198,10 @@ var httpResponse = (res = {}) => {
198
198
  status: res?.status || 0
199
199
  };
200
200
  };
201
- var handleAxiosError = (error7) => {
202
- if (!error7?.response && !error7?.request)
203
- throw error7;
204
- return error7.response ? httpResponse(error7.response) : httpResponse({ status: 500, data: { error: error7.request } });
201
+ var handleAxiosError = (error8) => {
202
+ if (!error8?.response && !error8?.request)
203
+ throw error8;
204
+ return error8.response ? httpResponse(error8.response) : httpResponse({ status: 500, data: { error: error8.request } });
205
205
  };
206
206
  var axiosHttpService = (config = {}) => {
207
207
  config.adapter = "http";
@@ -226,7 +226,7 @@ var S3Client = class {
226
226
  constructor(region = "us-west-2") {
227
227
  this.s3 = new S3({ region });
228
228
  }
229
- async uploadJson(path, bucket, jsonData, ACL = ObjectCannedACL.private, retryCount = 0) {
229
+ async uploadJson(path, bucket, jsonData, ACL = ObjectCannedACL.private) {
230
230
  try {
231
231
  const res = await this.s3.putObject({
232
232
  ACL,
@@ -235,14 +235,10 @@ var S3Client = class {
235
235
  Body: JSON.stringify(jsonData),
236
236
  Key: path
237
237
  });
238
- return { status: true, response: res };
239
- } catch (error7) {
240
- log3.error("Error in s3 upload json", { error: error7 });
241
- if (retryCount > 0) {
242
- log3.error("retrying to uploadJson", { path, bucket, jsonData, ACL, retryCount });
243
- return await this.uploadJson(path, bucket, jsonData, ACL, --retryCount);
244
- }
245
- return { status: false, response: jsonData };
238
+ return res;
239
+ } catch (error8) {
240
+ log3.error("Error in s3 upload json", { error: error8 });
241
+ return error8;
246
242
  }
247
243
  }
248
244
  };
@@ -304,8 +300,8 @@ var CognitoClient = class {
304
300
  if (user && user?.UserStatus === "CONFIRMED" && user?.email_verified !== "true") {
305
301
  await this.forceValidateEmail(email);
306
302
  }
307
- } catch (error7) {
308
- log4.error("Failed admin email verify", { error: error7 });
303
+ } catch (error8) {
304
+ log4.error("Failed admin email verify", { error: error8 });
309
305
  }
310
306
  };
311
307
  forceValidateEmail = async (email) => {
@@ -321,8 +317,8 @@ var CognitoClient = class {
321
317
  ]
322
318
  };
323
319
  await this.cognitoClient.adminUpdateUserAttributes(params);
324
- } catch (error7) {
325
- log4.error("Failed force validate email", { email, error: error7 });
320
+ } catch (error8) {
321
+ log4.error("Failed force validate email", { email, error: error8 });
326
322
  }
327
323
  };
328
324
  adminConfirmUser = async (data) => {
@@ -927,11 +923,11 @@ __publicField(ShopifyClient, "genericShopifyPut", async (url, accessToken, paylo
927
923
  // src/helpers/input-validation-helper.ts
928
924
  import * as log11 from "lambda-log";
929
925
  var validateInput = (schema, input) => {
930
- const { error: error7, value } = schema.validate(input);
931
- if (error7) {
932
- log11.info("", { error: error7 });
926
+ const { error: error8, value } = schema.validate(input);
927
+ if (error8) {
928
+ log11.info("", { error: error8 });
933
929
  const httperr = HttpError.badRequest("Bad Request", {
934
- errors: error7.details.map((detail) => ({
930
+ errors: error8.details.map((detail) => ({
935
931
  message: detail?.message,
936
932
  key: detail?.context?.key,
937
933
  path: detail?.path
@@ -946,12 +942,47 @@ var validateInput = (schema, input) => {
946
942
  // src/helpers/logging-helper.ts
947
943
  import * as log12 from "lambda-log";
948
944
  var stage = process?.env?.STAGE;
949
- var configureLogger = (event, context, debug6 = true) => {
945
+ var LEVEL = process?.env?.LOG_LEVEL ?? "info";
946
+ var LogLevelId = {
947
+ trace: 0,
948
+ debug: 1,
949
+ info: 2,
950
+ warn: 3,
951
+ error: 4
952
+ };
953
+ var configureLogger = (event, context, debug7 = LEVEL === "debug") => {
950
954
  log12.options.meta.stage = stage;
951
955
  log12.options.meta.source_name = context?.functionName || "unknown";
952
956
  log12.options.meta.awsRequestId = context?.awsRequestId || "unknown";
953
957
  log12.options.meta.lambdaEvent = event;
954
- log12.options.debug = debug6;
958
+ log12.options.debug = debug7;
959
+ };
960
+ var Logger = {
961
+ log: (logLevel, msg, meta, tags) => {
962
+ if (LogLevelId[logLevel] >= LogLevelId[LEVEL]) {
963
+ log12.log(logLevel, msg, meta, tags);
964
+ }
965
+ },
966
+ debug: (msg, meta, tags) => {
967
+ if (LogLevelId["debug"] >= LogLevelId[LEVEL]) {
968
+ log12.debug(msg, meta, tags);
969
+ }
970
+ },
971
+ info: (msg, meta, tags) => {
972
+ if (LogLevelId["info"] >= LogLevelId[LEVEL]) {
973
+ log12.info(msg, meta, tags);
974
+ }
975
+ },
976
+ warn: (msg, meta, tags) => {
977
+ if (LogLevelId["warn"] >= LogLevelId[LEVEL]) {
978
+ log12.warn(msg, meta, tags);
979
+ }
980
+ },
981
+ error: (msg, meta, tags) => {
982
+ if (LogLevelId["error"] >= LogLevelId[LEVEL]) {
983
+ log12.error(msg, meta, tags);
984
+ }
985
+ }
955
986
  };
956
987
 
957
988
  // src/helpers/response-helper.ts
@@ -961,13 +992,13 @@ var success = (body) => {
961
992
  var defaultError = {
962
993
  message: "internalServerError"
963
994
  };
964
- var failure = (error7, statusCode = 500) => {
965
- statusCode = error7?.statusCode ?? statusCode;
995
+ var failure = (error8, statusCode = 500) => {
996
+ statusCode = error8?.statusCode ?? statusCode;
966
997
  let body = defaultError;
967
- if (error7?.body) {
968
- body = error7.body;
969
- } else if (error7?.message) {
970
- body = { message: error7.message };
998
+ if (error8?.body) {
999
+ body = error8.body;
1000
+ } else if (error8?.message) {
1001
+ body = { message: error8.message };
971
1002
  } else if (statusCode === 500) {
972
1003
  body = defaultError;
973
1004
  }
@@ -991,11 +1022,11 @@ var buildResponse = (statusCode, body = {}) => {
991
1022
 
992
1023
  // src/helpers/shopify-helper.ts
993
1024
  import { createHmac } from "crypto";
994
- import * as log13 from "lambda-log";
1025
+ import * as log14 from "lambda-log";
995
1026
 
996
1027
  // src/libs/url.ts
997
1028
  var mapObjectToQueryString = (inputObj) => {
998
- const qsp = Object.entries(inputObj).sort((a, b) => a[0] < b[0] ? -1 : 1);
1029
+ const qsp = Object.entries(inputObj).sort((a, b2) => a[0] < b2[0] ? -1 : 1);
999
1030
  const urlParams = new URLSearchParams();
1000
1031
  qsp.map((p2) => {
1001
1032
  urlParams.append(p2[0], p2[1]);
@@ -1012,14 +1043,14 @@ var isShopifyRequestValid = (validationParams, validationHmac, shopifyAppApiSecr
1012
1043
  return generatedHash === validationHmac;
1013
1044
  };
1014
1045
  var validateShopifyRequest = (validationParams, validationHmac, shopifyAppApiSecret) => {
1015
- log13.info("Validating shopify request is authentic", { validationParams });
1046
+ log14.info("Validating shopify request is authentic", { validationParams });
1016
1047
  const isValid = isShopifyRequestValid(validationParams, validationHmac, shopifyAppApiSecret);
1017
1048
  if (!isValid) {
1018
1049
  const message = "Failed: Shopify Request hmac validation";
1019
- log13.error(message);
1050
+ log14.error(message);
1020
1051
  throw HttpError.badRequest(message);
1021
1052
  }
1022
- log13.info("Sucess: Shopify Request hmac validation");
1053
+ log14.info("Sucess: Shopify Request hmac validation");
1023
1054
  return true;
1024
1055
  };
1025
1056
 
@@ -1027,14 +1058,15 @@ var validateShopifyRequest = (validationParams, validationHmac, shopifyAppApiSec
1027
1058
  var s = ((n) => (n.PENDING = "pending", n.ACTIVE = "active", n.INACTIVE = "inactive", n))(s || {});
1028
1059
  var g = ((i) => (i.FACEBOOK = "facebook", i.TIKTOK = "tiktok", i.GOOGLE_ADS = "googleAds", i.GOOGLE_ANALYTICS_4 = "googleAnalytics4", i.HUBSPOT = "hubspot", i.WEBHOOK = "webhook", i.CUSTOM_HTML = "customHTML", i.CUSTOM_JS = "customJS", i.SNAPCHAT = "snapchat", i.TWITTER = "twitter", i.REDDIT = "reddit", i))(g || {});
1029
1060
  var c = ((n) => (n.HEADER = "header", n.FOOTER = "footer", n.BODY = "body", n))(c || {});
1030
- var p = ((o) => (o.STARTED = "started", o.COMPLETED = "completed", o.UNINSTALLED = "uninstalled", o.FAILED = "failed", o.NONE = "none", o))(p || {});
1031
- var d = ((e) => (e.ACTIVE = "active", e.CANCELLED = "cancelled", e.DECLINED = "declined", e.EXPIRED = "expired", e.FROZEN = "frozen", e.PENDING = "pending", e.NOT_SUBMITTED = "na", e))(d || {});
1061
+ var p = ((r) => (r.STARTED = "started", r.COMPLETED = "completed", r.UNINSTALLED = "uninstalled", r.FAILED = "failed", r.NONE = "none", r))(p || {});
1062
+ var d = ((t) => (t.ACTIVE = "active", t.CANCELLED = "cancelled", t.DECLINED = "declined", t.EXPIRED = "expired", t.FROZEN = "frozen", t.PENDING = "pending", t.NOT_SUBMITTED = "na", t))(d || {});
1032
1063
  var f = ((a) => (a.MONTHLY = "monthly", a.YEARLY = "yearly", a))(f || {});
1033
- var m = ((r) => (r.CURRENT = "current", r.PAST_DUE = "past_due", r.CANCELLED = "cancelled", r.FAILED = "failed", r))(m || {});
1034
- var l = ((e) => (e.ACTIVE = "active", e.CANCELLED = "cancelled", e.DECLINED = "declined", e.EXPIRED = "expired", e.FROZEN = "frozen", e.PENDING = "pending", e.NOT_SUBMITTED = "na", e))(l || {});
1035
- var u = ((n) => (n.STRIPE = "stripe", n.PAYPAL = "paypal", n.SHOPIFY = "shopify", n))(u || {});
1036
- var x = ((t) => (t.ADD_PAYMENT_INFO = "add_payment_info", t.ADD_SHIPPING_INFO = "add_shipping_info", t.ADD_TO_CART = "add_to_cart", t.ADD_TO_WISHLIST = "add_to_wishlist", t.INITIATE_CHECKOUT = "initiate_checkout", t.LEAD = "lead", t.LOGIN = "login", t.PAGE_VIEW = "page_view", t.PURCHASE = "purchase", t.REFUND = "refund", t.SEARCH = "search", t.SIGN_UP = "sign_up", t.VIEW_CART = "view_cart", t.VIEW_CONTENT = "view_content", t.SELECT_SHIPPING_METHOD = "select_shipping_method", t.VIRTUALIZED_VIEWED_PAYMENT_FORM = "virtualized_viewd_payment_form", t.METRIC = "metric", t.WEB_VITAL = "web_vital", t))(x || {});
1037
- var C = ((r) => (r.TRACKING = "tracking", r.METRIC = "metric", r.IDENTIFY = "identify", r.LOG = "log", r))(C || {});
1064
+ var x = ((o) => (o.CURRENT = "current", o.PAST_DUE = "past_due", o.CANCELLED = "cancelled", o.FAILED = "failed", o))(x || {});
1065
+ var u = ((t) => (t.ACTIVE = "active", t.CANCELLED = "cancelled", t.DECLINED = "declined", t.EXPIRED = "expired", t.FROZEN = "frozen", t.PENDING = "pending", t.NOT_SUBMITTED = "na", t))(u || {});
1066
+ var l = ((n) => (n.STRIPE = "stripe", n.PAYPAL = "paypal", n.SHOPIFY = "shopify", n))(l || {});
1067
+ var m = ((r) => (r.debug = "debug", r.error = "error", r.info = "info", r.trace = "trace", r.warn = "warn", r))(m || {});
1068
+ var C = ((e) => (e.ADD_PAYMENT_INFO = "add_payment_info", e.ADD_SHIPPING_INFO = "add_shipping_info", e.ADD_TO_CART = "add_to_cart", e.ADD_TO_WISHLIST = "add_to_wishlist", e.INITIATE_CHECKOUT = "initiate_checkout", e.LEAD = "lead", e.LOGIN = "login", e.PAGE_VIEW = "page_view", e.PURCHASE = "purchase", e.REFUND = "refund", e.SEARCH = "search", e.SIGN_UP = "sign_up", e.VIEW_CART = "view_cart", e.VIEW_CONTENT = "view_content", e.SELECT_SHIPPING_METHOD = "select_shipping_method", e.VIRTUALIZED_VIEWED_PAYMENT_FORM = "virtualized_viewd_payment_form", e.METRIC = "metric", e.WEB_VITAL = "web_vital", e.LOG = "log", e))(C || {});
1069
+ var b = ((o) => (o.TRACKING = "tracking", o.METRIC = "metric", o.IDENTIFY = "identify", o.LOG = "log", o))(b || {});
1038
1070
 
1039
1071
  // src/helpers/subscription-helper.ts
1040
1072
  var StripeBillingMap = {
@@ -1350,6 +1382,8 @@ export {
1350
1382
  EventBridgeIntegrationService,
1351
1383
  HttpError,
1352
1384
  HttpStatusCodes,
1385
+ LogLevelId,
1386
+ Logger,
1353
1387
  PostmarkRequestType,
1354
1388
  S3Client,
1355
1389
  SQSClient,