@adtrackify/at-service-common 1.0.76 → 1.0.78

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/.editorconfig CHANGED
@@ -1,12 +1,12 @@
1
- root = true
2
-
3
- [*]
4
- end_of_line = lf
5
- charset = utf-8
6
- trim_trailing_whitespace = true
7
- insert_final_newline = false
8
- indent_style = space
9
- indent_size = 2
10
-
11
- [*.{diff,md}]
12
- trim_trailing_whitespace = false
1
+ root = true
2
+
3
+ [*]
4
+ end_of_line = lf
5
+ charset = utf-8
6
+ trim_trailing_whitespace = true
7
+ insert_final_newline = false
8
+ indent_style = space
9
+ indent_size = 2
10
+
11
+ [*.{diff,md}]
12
+ trim_trailing_whitespace = false
@@ -1,10 +1,10 @@
1
- { "eslint.validate": [
2
- "javascript",
3
- "javascriptreact",
4
- "typescript",
5
- "typescriptreact"
6
- ],
7
- "editor.codeActionsOnSave": {
8
- "source.fixAll.eslint": true,
9
- },
1
+ { "eslint.validate": [
2
+ "javascript",
3
+ "javascriptreact",
4
+ "typescript",
5
+ "typescriptreact"
6
+ ],
7
+ "editor.codeActionsOnSave": {
8
+ "source.fixAll.eslint": true,
9
+ },
10
10
  }
@@ -1,20 +1,20 @@
1
- image: node:16.18.0
2
-
3
- pipelines:
4
- default:
5
- - step:
6
- caches:
7
- - node
8
- script:
9
- - printf "//`node -p \"require('url').parse(process.env.NPM_REGISTRY_URL || 'https://registry.npmjs.org').host\"`/:_authToken=${NPM_TOKEN}\nregistry=${NPM_REGISTRY_URL:-https://registry.npmjs.org}\n" >> ~/.npmrc
10
- - npm install
11
- - npm run build:dev
12
- branches:
13
- master:
14
- - step:
15
- deployment: prod
16
- caches:
17
- - node
18
- script:
19
- - printf "//`node -p \"require('url').parse(process.env.NPM_REGISTRY_URL || 'https://registry.npmjs.org').host\"`/:_authToken=${NPM_TOKEN}\nregistry=${NPM_REGISTRY_URL:-https://registry.npmjs.org}\n" >> ~/.npmrc
20
- - npm run push
1
+ image: node:16.18.0
2
+
3
+ pipelines:
4
+ default:
5
+ - step:
6
+ caches:
7
+ - node
8
+ script:
9
+ - printf "//`node -p \"require('url').parse(process.env.NPM_REGISTRY_URL || 'https://registry.npmjs.org').host\"`/:_authToken=${NPM_TOKEN}\nregistry=${NPM_REGISTRY_URL:-https://registry.npmjs.org}\n" >> ~/.npmrc
10
+ - npm install
11
+ - npm run build:dev
12
+ branches:
13
+ master:
14
+ - step:
15
+ deployment: prod
16
+ caches:
17
+ - node
18
+ script:
19
+ - printf "//`node -p \"require('url').parse(process.env.NPM_REGISTRY_URL || 'https://registry.npmjs.org').host\"`/:_authToken=${NPM_TOKEN}\nregistry=${NPM_REGISTRY_URL:-https://registry.npmjs.org}\n" >> ~/.npmrc
20
+ - npm run push
package/build.js CHANGED
@@ -1,22 +1,22 @@
1
- // @ts-nocheck
2
- // @ts-ignore
3
- /* eslint-disable */
4
-
5
- const { build } = require('esbuild')
6
- const { dependencies } = require('./package.json')
7
- const { Generator } = require('npm-dts')
8
-
9
- new Generator({
10
- entry: 'src/index.ts',
11
- output: 'dist/index.d.ts',
12
- }).generate()
13
-
14
- build({
15
- entryPoints: ['./src/index.ts'],
16
- outdir: 'dist',
17
- bundle: true,
18
- format: 'esm',
19
- platform: 'node',
20
- sourcemap: 'linked',
21
- external: [...Object.keys(dependencies), 'aws-sdk', "@faker-js/faker"]
1
+ // @ts-nocheck
2
+ // @ts-ignore
3
+ /* eslint-disable */
4
+
5
+ const { build } = require('esbuild')
6
+ const { dependencies } = require('./package.json')
7
+ const { Generator } = require('npm-dts')
8
+
9
+ new Generator({
10
+ entry: 'src/index.ts',
11
+ output: 'dist/index.d.ts',
12
+ }).generate()
13
+
14
+ build({
15
+ entryPoints: ['./src/index.ts'],
16
+ outdir: 'dist',
17
+ bundle: true,
18
+ format: 'esm',
19
+ platform: 'node',
20
+ sourcemap: 'linked',
21
+ external: [...Object.keys(dependencies), 'aws-sdk', "@faker-js/faker"]
22
22
  })
package/dist/index.d.ts CHANGED
@@ -1,7 +1,3 @@
1
- declare module '@adtrackify/at-service-common/__tests__/helpers/subscription-helper.spec' {
2
- export {};
3
-
4
- }
5
1
  declare module '@adtrackify/at-service-common/clients/generic/dynamodb-client' {
6
2
  import AWS from 'aws-sdk';
7
3
  export class DynamoDbClient {
@@ -692,6 +688,10 @@ declare module '@adtrackify/at-service-common/types/internal-events/event-detail
692
688
  declare module '@adtrackify/at-service-common/types/internal-events/index' {
693
689
  export * from '@adtrackify/at-service-common/types/internal-events/event-detail-types';
694
690
 
691
+ }
692
+ declare module '@adtrackify/at-service-common/__tests__/helpers/subscription-helper.spec' {
693
+ export {};
694
+
695
695
  }
696
696
  declare module '@adtrackify/at-service-common' {
697
697
  import main = require('@adtrackify/at-service-common/src/index');
package/dist/index.js CHANGED
@@ -373,7 +373,7 @@ var generatePublicKey = () => {
373
373
 
374
374
  // src/libs/http-error.ts
375
375
  import { strict as assert } from "assert";
376
- var deepClone = (o2 = {}) => JSON.parse(JSON.stringify(o2));
376
+ var deepClone = (o = {}) => JSON.parse(JSON.stringify(o));
377
377
  var containsStackTrace = (text = "") => /at.+\.js:\d+:\d+/.test(text);
378
378
  var objectContainsStackTrace = (obj) => !obj ? false : containsStackTrace(JSON.stringify(obj));
379
379
  var supportedStatusCodes = {
@@ -677,7 +677,7 @@ __publicField(ShopifyClient, "updateShopifyAppMetafield", async (shop, accessTok
677
677
  };
678
678
  const res = await _ShopifyClient.genericShopifyPost(url, accessToken, payload);
679
679
  if (res.status >= 400) {
680
- log8.error("Failed to register Webhook Topic", { shop, accessToken, url, payload });
680
+ log8.error("Failed to update Shopify app Metafield ", { shop, accessToken, url, payload });
681
681
  }
682
682
  return res;
683
683
  });
@@ -806,16 +806,16 @@ var buildResponse = (statusCode, body = {}) => {
806
806
  };
807
807
 
808
808
  // node_modules/@adtrackify/at-tracking-event-types/dist/index.js
809
- var o = ((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))(o || {});
810
- var a = ((n) => (n.PENDING = "pending", n.ACTIVE = "active", n.INACTIVE = "inactive", n))(a || {});
811
- var g = ((n) => (n.HEADER = "header", n.FOOTER = "footer", n.BODY = "body", n))(g || {});
812
- var c = ((t) => (t.FACEBOOK = "facebook", t.TIKTOK = "tiktok", t.GOOGLE_ADS = "googleAds", t.GOOGLE_ANALYTICS_4 = "googleAnalytics4", t.HUBSPOT = "hubspot", t.WEBHOOK = "webhook", t.CUSTOM_HTML = "customHTML", t))(c || {});
813
- var d = ((r) => (r.STARTED = "started", r.COMPLETED = "completed", r.UNINSTALLED = "uninstalled", r.FAILED = "failed", r.NONE = "none", r))(d || {});
814
- var p = ((t) => (t.ACTIVE = "active", t.CANCELLED = "cancelled", t.DECLINED = "declined", t.EXPIRED = "expired", t.FROZEN = "frozen", t.PENDING = "pending", t.NOT_SUBMITTED = "na", t))(p || {});
815
- var l = ((s) => (s.MONTHLY = "monthly", s.YEARLY = "yearly", s))(l || {});
816
- var m = ((i) => (i.CURRENT = "current", i.PAST_DUE = "past_due", i.CANCELLED = "cancelled", i.FAILED = "failed", i))(m || {});
817
- 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 || {});
818
- var f = ((n) => (n.STRIPE = "stripe", n.PAYPAL = "paypal", n.SHOPIFY = "shopify", n))(f || {});
809
+ var a = ((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))(a || {});
810
+ var g = ((n) => (n.PENDING = "pending", n.ACTIVE = "active", n.INACTIVE = "inactive", n))(g || {});
811
+ var c = ((n) => (n.HEADER = "header", n.FOOTER = "footer", n.BODY = "body", n))(c || {});
812
+ var d = ((r) => (r.FACEBOOK = "facebook", r.TIKTOK = "tiktok", r.GOOGLE_ADS = "googleAds", r.GOOGLE_ANALYTICS_4 = "googleAnalytics4", r.HUBSPOT = "hubspot", r.WEBHOOK = "webhook", r.CUSTOM_HTML = "customHTML", r.CUSTOM_JS = "customJS", r.SNAPCHAT = "snapchat", r.TWITTER = "twitter", r))(d || {});
813
+ var p = ((i) => (i.STARTED = "started", i.COMPLETED = "completed", i.UNINSTALLED = "uninstalled", i.FAILED = "failed", i.NONE = "none", i))(p || {});
814
+ 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 || {});
815
+ var m = ((o) => (o.MONTHLY = "monthly", o.YEARLY = "yearly", o))(m || {});
816
+ var u = ((s) => (s.CURRENT = "current", s.PAST_DUE = "past_due", s.CANCELLED = "cancelled", s.FAILED = "failed", s))(u || {});
817
+ var f = ((e) => (e.ACTIVE = "active", e.CANCELLED = "cancelled", e.DECLINED = "declined", e.EXPIRED = "expired", e.FROZEN = "frozen", e.PENDING = "pending", e.NOT_SUBMITTED = "na", e))(f || {});
818
+ var x = ((n) => (n.STRIPE = "stripe", n.PAYPAL = "paypal", n.SHOPIFY = "shopify", n))(x || {});
819
819
 
820
820
  // src/helpers/subscription-helper.ts
821
821
  var StripeBillingMap = {
@@ -857,7 +857,7 @@ var SubscriptionPlanSeedItems = {
857
857
  description: "Free Plan - Monthly",
858
858
  price: "0",
859
859
  displayPrice: "$0",
860
- billingFrequency: l.MONTHLY,
860
+ billingFrequency: m.MONTHLY,
861
861
  trialLengthDays: 30,
862
862
  trialRequiresCreditCard: false,
863
863
  planDesc: [
@@ -881,7 +881,7 @@ var SubscriptionPlanSeedItems = {
881
881
  description: "Starter Plan - Monthly",
882
882
  price: "9.99",
883
883
  displayPrice: "$9.99",
884
- billingFrequency: l.MONTHLY,
884
+ billingFrequency: m.MONTHLY,
885
885
  trialLengthDays: 30,
886
886
  trialRequiresCreditCard: false,
887
887
  planDesc: [
@@ -906,7 +906,7 @@ var SubscriptionPlanSeedItems = {
906
906
  description: "Starter Plan - Yearly",
907
907
  price: "96.00",
908
908
  displayPrice: "$8",
909
- billingFrequency: l.YEARLY,
909
+ billingFrequency: m.YEARLY,
910
910
  trialLengthDays: 30,
911
911
  trialRequiresCreditCard: false,
912
912
  planDesc: [
@@ -931,7 +931,7 @@ var SubscriptionPlanSeedItems = {
931
931
  description: "Scale Plan - Monthly",
932
932
  price: "59.99",
933
933
  displayPrice: "$59.99",
934
- billingFrequency: l.MONTHLY,
934
+ billingFrequency: m.MONTHLY,
935
935
  trialLengthDays: 30,
936
936
  trialRequiresCreditCard: false,
937
937
  planDesc: [
@@ -958,7 +958,7 @@ var SubscriptionPlanSeedItems = {
958
958
  description: "Scale Plan - Yearly",
959
959
  price: "540.00",
960
960
  displayPrice: "$45",
961
- billingFrequency: l.YEARLY,
961
+ billingFrequency: m.YEARLY,
962
962
  trialLengthDays: 30,
963
963
  trialRequiresCreditCard: false,
964
964
  planDesc: [
@@ -985,7 +985,7 @@ var SubscriptionPlanSeedItems = {
985
985
  description: "Growth Plan - Monthly",
986
986
  price: "159.99",
987
987
  displayPrice: "$159.99",
988
- billingFrequency: l.MONTHLY,
988
+ billingFrequency: m.MONTHLY,
989
989
  trialLengthDays: 30,
990
990
  trialRequiresCreditCard: false,
991
991
  planDesc: [
@@ -1012,7 +1012,7 @@ var SubscriptionPlanSeedItems = {
1012
1012
  description: "Growth Plan - Yearly",
1013
1013
  price: "1344.00",
1014
1014
  displayPrice: "$112",
1015
- billingFrequency: l.YEARLY,
1015
+ billingFrequency: m.YEARLY,
1016
1016
  trialLengthDays: 30,
1017
1017
  trialRequiresCreditCard: false,
1018
1018
  planDesc: [
@@ -1034,14 +1034,14 @@ var SubscriptionPlanSeedItems = {
1034
1034
  ]
1035
1035
  };
1036
1036
  var getPlanDetails = (planId, stage2) => {
1037
- const plan = SubscriptionPlanSeedItems.items.filter((x) => x.id === planId)[0];
1037
+ const plan = SubscriptionPlanSeedItems.items.filter((x2) => x2.id === planId)[0];
1038
1038
  plan.stripePriceId = StripeBillingMap[stage2][plan.planName];
1039
1039
  return plan;
1040
1040
  };
1041
1041
  var getPlanByStripePriceId = (stripePriceId, stage2) => {
1042
1042
  const stripePriceIds = StripeBillingMap[stage2];
1043
1043
  const planName = Object.keys(stripePriceIds).find((key) => stripePriceIds[key] === stripePriceId);
1044
- const plan = SubscriptionPlanSeedItems.items.filter((x) => x.planName === planName)[0];
1044
+ const plan = SubscriptionPlanSeedItems.items.filter((x2) => x2.planName === planName)[0];
1045
1045
  plan.stripePriceId = stripePriceId;
1046
1046
  return plan;
1047
1047
  };