@adtrackify/at-service-common 1.0.69 → 1.0.71

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,3 +1,7 @@
1
+ declare module '@adtrackify/at-service-common/__tests__/helpers/subscription-helper.spec' {
2
+ export {};
3
+
4
+ }
1
5
  declare module '@adtrackify/at-service-common/clients/generic/dynamodb-client' {
2
6
  import AWS from 'aws-sdk';
3
7
  export class DynamoDbClient {
@@ -682,10 +686,6 @@ declare module '@adtrackify/at-service-common/types/internal-events/event-detail
682
686
  declare module '@adtrackify/at-service-common/types/internal-events/index' {
683
687
  export * from '@adtrackify/at-service-common/types/internal-events/event-detail-types';
684
688
 
685
- }
686
- declare module '@adtrackify/at-service-common/__tests__/helpers/subscription-helper.spec' {
687
- export {};
688
-
689
689
  }
690
690
  declare module '@adtrackify/at-service-common' {
691
691
  import main = require('@adtrackify/at-service-common/src/index');
package/dist/index.js CHANGED
@@ -403,23 +403,19 @@ var _HttpError = class extends Error {
403
403
  constructor(statusCode, message, body, headers) {
404
404
  assert(statusCode in supportedStatusCodes, supportedStatusCodesMessage);
405
405
  const isServerError = statusCode > 499;
406
- if (isServerError) {
407
- message = supportedStatusCodes[statusCode];
408
- } else {
409
- assert(
410
- body === void 0 || typeof body === "object",
411
- "body must be an object or omitted"
412
- );
413
- assert(
414
- headers === void 0 || typeof headers === "object",
415
- "headers must be an object or omitted"
416
- );
417
- message = message ?? supportedStatusCodes[statusCode];
418
- assert(
419
- !containsStackTrace(message) && !objectContainsStackTrace(body),
420
- "the message or data parameters may not contain errors or stack traces"
421
- );
422
- }
406
+ assert(
407
+ body === void 0 || typeof body === "object",
408
+ "body must be an object or omitted"
409
+ );
410
+ assert(
411
+ headers === void 0 || typeof headers === "object",
412
+ "headers must be an object or omitted"
413
+ );
414
+ message = message ?? supportedStatusCodes[statusCode];
415
+ assert(
416
+ !containsStackTrace(message) && !objectContainsStackTrace(body),
417
+ "the message or data parameters may not contain errors or stack traces"
418
+ );
423
419
  super(message);
424
420
  this.body = deepClone(body);
425
421
  this.headers = deepClone(headers);
@@ -801,8 +797,8 @@ var buildResponse = (statusCode, body = {}) => {
801
797
  };
802
798
 
803
799
  // node_modules/@adtrackify/at-tracking-event-types/dist/index.js
804
- var o = ((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))(o || {});
805
- var a = ((r) => (r.PENDING = "pending", r.ACTIVE = "active", r.INACTIVE = "inactive", r))(a || {});
800
+ 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 || {});
801
+ var o = ((r) => (r.PENDING = "pending", r.ACTIVE = "active", r.INACTIVE = "inactive", r))(o || {});
806
802
  var g = ((n) => (n.FACEBOOK = "facebook", n.TIKTOK = "tiktok", n.GOOGLE_ADS = "googleAds", n.GOOGLE_ANALYTICS_4 = "googleAnalytics4", n))(g || {});
807
803
  var c = ((i) => (i.STARTED = "started", i.COMPLETED = "completed", i.UNINSTALLED = "uninstalled", i.FAILED = "failed", i.NONE = "none", i))(c || {});
808
804
  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 || {});
@@ -846,6 +842,7 @@ var SubscriptionPlanSeedItems = {
846
842
  {
847
843
  id: 1,
848
844
  planName: "free",
845
+ displayName: "Free",
849
846
  sku: "ADT-001",
850
847
  description: "Free Plan - Monthly",
851
848
  price: "0",
@@ -869,6 +866,7 @@ var SubscriptionPlanSeedItems = {
869
866
  {
870
867
  id: 2,
871
868
  planName: "starter_monthly",
869
+ displayName: "Starter",
872
870
  sku: "ADT-002",
873
871
  description: "Starter Plan - Monthly",
874
872
  price: "9.99",
@@ -893,6 +891,7 @@ var SubscriptionPlanSeedItems = {
893
891
  {
894
892
  id: 3,
895
893
  planName: "starter_yearly",
894
+ displayName: "Starter",
896
895
  sku: "ADT-003",
897
896
  description: "Starter Plan - Yearly",
898
897
  price: "96.00",
@@ -917,6 +916,7 @@ var SubscriptionPlanSeedItems = {
917
916
  {
918
917
  id: 4,
919
918
  planName: "scale_monthly",
919
+ displayName: "Scale",
920
920
  sku: "ADT-004",
921
921
  description: "Scale Plan - Monthly",
922
922
  price: "59.99",
@@ -943,6 +943,7 @@ var SubscriptionPlanSeedItems = {
943
943
  {
944
944
  id: 5,
945
945
  planName: "scale_yearly",
946
+ displayName: "Scale",
946
947
  sku: "ADT-005",
947
948
  description: "Scale Plan - Yearly",
948
949
  price: "540.00",
@@ -969,6 +970,7 @@ var SubscriptionPlanSeedItems = {
969
970
  {
970
971
  id: 6,
971
972
  planName: "growth_monthly",
973
+ displayName: "Growth",
972
974
  sku: "ADT-006",
973
975
  description: "Growth Plan - Monthly",
974
976
  price: "159.99",
@@ -995,6 +997,7 @@ var SubscriptionPlanSeedItems = {
995
997
  {
996
998
  id: 7,
997
999
  planName: "growth_yearly",
1000
+ displayName: "Growth",
998
1001
  sku: "ADT-007",
999
1002
  description: "Growth Plan - Yearly",
1000
1003
  price: "1344.00",