@adtrackify/at-service-common 1.1.19 → 1.1.20
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 +12 -12
- package/.eslintignore +3 -0
- package/.vscode/settings.json +9 -9
- package/build.js +27 -10
- package/dist/index.d.ts +41 -41
- package/dist/index.esm.js +1335 -0
- package/dist/index.esm.js.map +7 -0
- package/dist/index.js +249 -122
- package/dist/index.js.map +4 -4
- package/jest.config.ts +40 -40
- package/package.json +27 -27
- package/src/__tests__/helpers/subscription-helper.spec.ts +1 -1
- package/src/clients/generic/axios.d.ts +7 -7
- package/src/clients/generic/eventbridge-client.ts +1 -1
- package/src/clients/generic/http-client.ts +2 -3
- package/src/clients/generic/index.ts +5 -5
- package/src/clients/index.ts +3 -3
- package/src/clients/internal-api/accounts-client.ts +2 -2
- package/src/clients/internal-api/destinations-client.ts +2 -2
- package/src/clients/internal-api/index.ts +4 -4
- package/src/clients/internal-api/shopify-app-install-client.ts +4 -4
- package/src/clients/internal-api/users-auth-client.ts +4 -3
- package/src/clients/third-party/index.ts +1 -1
- package/src/clients/third-party/shopify-client.ts +1 -1
- package/src/helpers/index.ts +5 -5
- package/src/helpers/input-validation-helper.ts +1 -1
- package/src/helpers/shopify-helper.ts +2 -2
- package/src/index.ts +5 -5
- package/src/libs/index.ts +6 -6
- package/src/libs/url.ts +9 -9
- package/src/services/eventbridge-integration-service.ts +1 -1
- package/src/services/index.ts +1 -1
- package/src/types/index.ts +1 -1
- package/src/types/internal-events/event-detail-types.ts +9 -9
- package/src/types/internal-events/index.ts +1 -1
- package/tsconfig.json +2 -3
package/jest.config.ts
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
/*eslint-disable */
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
globals: {
|
|
5
|
-
'ts-jest': {
|
|
6
|
-
isolatedModules: true
|
|
7
|
-
},
|
|
8
|
-
'@swc/jest': {
|
|
9
|
-
isolatedModules: true
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
roots: [ '<rootDir>/src' ],
|
|
14
|
-
testRegex: '\\.spec\\.(js|ts)$',
|
|
15
|
-
transform: {
|
|
16
|
-
"^.+\\.(t|j)sx?$": [ "@swc/jest" ],
|
|
17
|
-
},
|
|
18
|
-
moduleFileExtensions: [ 'js', 'json', 'ts' ],
|
|
19
|
-
transformIgnorePatterns: [],
|
|
20
|
-
runner: 'groups',
|
|
21
|
-
verbose: false,
|
|
22
|
-
coverageThreshold: {
|
|
23
|
-
global: {
|
|
24
|
-
branches: 0,
|
|
25
|
-
functions: 0,
|
|
26
|
-
lines: 0,
|
|
27
|
-
statements: 0
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
coverageReporters: [ 'html', 'text', 'text-summary', 'cobertura' ],
|
|
31
|
-
reporters: [ 'default', 'jest-junit' ],
|
|
32
|
-
collectCoverageFrom: [
|
|
33
|
-
'src/**/*.ts',
|
|
34
|
-
'!src/**/*.spec.js',
|
|
35
|
-
'src/**/*.js',
|
|
36
|
-
'!src/**/*.spec.ts',
|
|
37
|
-
'!src/**/tests/**'
|
|
38
|
-
],
|
|
39
|
-
setupFilesAfterEnv: [],
|
|
40
|
-
};
|
|
1
|
+
/*eslint-disable */
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
globals: {
|
|
5
|
+
'ts-jest': {
|
|
6
|
+
isolatedModules: true
|
|
7
|
+
},
|
|
8
|
+
'@swc/jest': {
|
|
9
|
+
isolatedModules: true
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
},
|
|
13
|
+
roots: [ '<rootDir>/src' ],
|
|
14
|
+
testRegex: '\\.spec\\.(js|ts)$',
|
|
15
|
+
transform: {
|
|
16
|
+
"^.+\\.(t|j)sx?$": [ "@swc/jest" ],
|
|
17
|
+
},
|
|
18
|
+
moduleFileExtensions: [ 'js', 'json', 'ts' ],
|
|
19
|
+
transformIgnorePatterns: [],
|
|
20
|
+
runner: 'groups',
|
|
21
|
+
verbose: false,
|
|
22
|
+
coverageThreshold: {
|
|
23
|
+
global: {
|
|
24
|
+
branches: 0,
|
|
25
|
+
functions: 0,
|
|
26
|
+
lines: 0,
|
|
27
|
+
statements: 0
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
coverageReporters: [ 'html', 'text', 'text-summary', 'cobertura' ],
|
|
31
|
+
reporters: [ 'default', 'jest-junit' ],
|
|
32
|
+
collectCoverageFrom: [
|
|
33
|
+
'src/**/*.ts',
|
|
34
|
+
'!src/**/*.spec.js',
|
|
35
|
+
'src/**/*.js',
|
|
36
|
+
'!src/**/*.spec.ts',
|
|
37
|
+
'!src/**/tests/**'
|
|
38
|
+
],
|
|
39
|
+
setupFilesAfterEnv: [],
|
|
40
|
+
};
|
|
41
41
|
/*eslint-enable */
|
package/package.json
CHANGED
|
@@ -1,25 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adtrackify/at-service-common",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.20",
|
|
4
4
|
"description": "",
|
|
5
|
-
"module": "./dist/index.js",
|
|
6
5
|
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.esm.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
|
+
"typings": "./dist/index.d.ts",
|
|
9
|
+
"type": "module",
|
|
8
10
|
"modules": "esm",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"require": "./dist/index.js",
|
|
14
|
+
"import": "./dist/index.esm.js",
|
|
15
|
+
"types": "./dist/index.d.ts"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
9
18
|
"engines": {
|
|
10
19
|
"npm": ">=8.0.0 <9.0.0",
|
|
11
20
|
"node": ">=16.0.0 <18.14.2"
|
|
12
21
|
},
|
|
13
22
|
"scripts": {
|
|
14
23
|
"clean": "rimraf dist",
|
|
15
|
-
"build": "
|
|
24
|
+
"build": "cross-env NODE_ENV=production node build.js",
|
|
16
25
|
"build:dev": "npm run clean && npm run verify && cross-env NODE_ENV=production stage=dev APP_ENV=dev npm run build",
|
|
17
|
-
"build:qa": "npm run clean && npm run verify && cross-env NODE_ENV=production stage=qa APP_ENV=qa
|
|
18
|
-
"build:prod": "npm run clean && npm run verify && cross-env NODE_ENV=production stage=prod APP_ENV=prod
|
|
19
|
-
"elint": "eslint
|
|
26
|
+
"build:qa": "npm run clean && npm run verify && cross-env NODE_ENV=production stage=qa APP_ENV=qa npm run build",
|
|
27
|
+
"build:prod": "npm run clean && npm run verify && cross-env NODE_ENV=production stage=prod APP_ENV=prod npm run build",
|
|
28
|
+
"elint": "eslint .",
|
|
20
29
|
"format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
|
|
21
30
|
"lint": "eslint src/",
|
|
22
|
-
"lint:fix": "eslint
|
|
31
|
+
"lint:fix": "eslint . --fix",
|
|
23
32
|
"coverage": "npm run test:all -- --coverage --group=unit",
|
|
24
33
|
"test": "jest --group=unit --coverage",
|
|
25
34
|
"test:all": "cross-env AWS_REGION=us-east-2 NODE_ENV=test jest --group=unit --coverage",
|
|
@@ -31,13 +40,8 @@
|
|
|
31
40
|
"type-check": "tsc --noEmit"
|
|
32
41
|
},
|
|
33
42
|
"dependencies": {
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"@types/luxon": "^3.0.1",
|
|
37
|
-
"@types/ua-parser-js": "^0.7.36",
|
|
38
|
-
"@types/uuid": "^8.3.4",
|
|
39
|
-
"axios": "^0.27.2",
|
|
40
|
-
"axios-retry": "^3.3.1",
|
|
43
|
+
"axios": "^1.3.4",
|
|
44
|
+
"axios-retry": "^3.4.0",
|
|
41
45
|
"joi": "^17.6.0",
|
|
42
46
|
"lambda-log": "^3.1.0",
|
|
43
47
|
"luxon": "^3.0.3",
|
|
@@ -52,30 +56,26 @@
|
|
|
52
56
|
"@aws-sdk/client-eventbridge": "^3.278.0",
|
|
53
57
|
"@aws-sdk/client-s3": "^3.282.0",
|
|
54
58
|
"@aws-sdk/lib-dynamodb": "^3.279.0",
|
|
55
|
-
"@babel/cli": "^7.13.16",
|
|
56
|
-
"@babel/core": "^7.19.1",
|
|
57
|
-
"@babel/plugin-proposal-optional-chaining": "^7.13.8",
|
|
58
|
-
"@babel/plugin-transform-runtime": "^7.19.1",
|
|
59
|
-
"@babel/preset-env": "^7.19.1",
|
|
60
|
-
"@babel/preset-typescript": "^7.16.7",
|
|
61
|
-
"@babel/runtime-corejs3": "^7.19.1",
|
|
62
59
|
"@faker-js/faker": "^7.5.0",
|
|
63
60
|
"@swc/core": "^1.3.1",
|
|
64
61
|
"@swc/jest": "^0.2.22",
|
|
65
62
|
"@types/jest": "^28.1.8",
|
|
63
|
+
"@types/lambda-log": "^2.2.1",
|
|
64
|
+
"@types/luxon": "^3.0.1",
|
|
66
65
|
"@types/node": "^17.0.8",
|
|
66
|
+
"@types/ua-parser-js": "^0.7.36",
|
|
67
|
+
"@types/uuid": "^8.3.4",
|
|
67
68
|
"@typescript-eslint/eslint-plugin": "^5.37.0",
|
|
68
69
|
"@typescript-eslint/parser": "^5.37.0",
|
|
69
70
|
"core-js": "^3.25.1",
|
|
70
71
|
"cross-env": "^7.0.3",
|
|
71
|
-
"esbuild": "^0.
|
|
72
|
+
"esbuild": "^0.17.1",
|
|
72
73
|
"eslint": "^8.23.1",
|
|
73
74
|
"eslint-config-standard": "^17.0.0",
|
|
74
75
|
"eslint-plugin-babel": "^5.3.1",
|
|
75
76
|
"eslint-plugin-import": "^2.26.0",
|
|
76
77
|
"eslint-plugin-n": "^15.2.5",
|
|
77
78
|
"eslint-plugin-promise": "^6.0.1",
|
|
78
|
-
"eslint-webpack-plugin": "^3.1.1",
|
|
79
79
|
"glob": "^8.0.3",
|
|
80
80
|
"husky": "^6.0.0",
|
|
81
81
|
"jest": "^29.2.1",
|
|
@@ -90,12 +90,12 @@
|
|
|
90
90
|
"regenerator-runtime": "^0.13.9",
|
|
91
91
|
"rimraf": "^3.0.2",
|
|
92
92
|
"swc-loader": "^0.2.3",
|
|
93
|
-
"ts-jest": "^29.0.
|
|
94
|
-
"ts-loader": "^9.
|
|
93
|
+
"ts-jest": "^29.0.5",
|
|
94
|
+
"ts-loader": "^9.4.2",
|
|
95
95
|
"ts-node": "^10.9.1",
|
|
96
96
|
"tslint": "^6.1.3",
|
|
97
97
|
"tslint-config-prettier": "^1.18.0",
|
|
98
|
-
"typescript": "4.
|
|
98
|
+
"typescript": "4.9.5"
|
|
99
99
|
},
|
|
100
100
|
"repository": {
|
|
101
101
|
"type": "git",
|
|
@@ -104,4 +104,4 @@
|
|
|
104
104
|
"author": "",
|
|
105
105
|
"license": "ISC",
|
|
106
106
|
"homepage": "https://bitbucket.org/eacap/at-service-common#readme"
|
|
107
|
-
}
|
|
107
|
+
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
jest.mock('lambda-log');
|
|
9
9
|
import * as Logger from 'lambda-log';
|
|
10
|
-
import { getPlanDetails } from '../../helpers';
|
|
10
|
+
import { getPlanDetails } from '../../helpers/subscription-helper.js';
|
|
11
11
|
|
|
12
12
|
describe('postmark service email test', () => {
|
|
13
13
|
jest.spyOn(Logger, 'warn').mockImplementation(() => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
declare module 'axios/lib/adapters/http' {
|
|
2
|
-
import { AxiosAdapter } from 'axios';
|
|
3
|
-
|
|
4
|
-
const httpAdapter: AxiosAdapter;
|
|
5
|
-
namespace httpAdapter { }
|
|
6
|
-
|
|
7
|
-
export = httpAdapter;
|
|
1
|
+
declare module 'axios/lib/adapters/http' {
|
|
2
|
+
import { AxiosAdapter } from 'axios';
|
|
3
|
+
|
|
4
|
+
const httpAdapter: AxiosAdapter;
|
|
5
|
+
namespace httpAdapter { }
|
|
6
|
+
|
|
7
|
+
export = httpAdapter;
|
|
8
8
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventBridgeClient as EventBridge, PutEventsCommand, PutEventsCommandInput } from '@aws-sdk/client-eventbridge';
|
|
2
2
|
import { v4 as uuidv4 } from 'uuid';
|
|
3
|
-
import { getCurrentTimestamp } from '../../libs/dates';
|
|
3
|
+
import { getCurrentTimestamp } from '../../libs/dates.js';
|
|
4
4
|
import * as log from 'lambda-log';
|
|
5
5
|
|
|
6
6
|
export class EventBridgeClient {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
|
-
import axiosRetry from 'axios-retry';
|
|
2
|
+
//import axiosRetry from 'axios-retry';
|
|
3
3
|
import https from 'https';
|
|
4
4
|
import httpAdapter from 'axios/lib/adapters/http';
|
|
5
5
|
|
|
@@ -20,8 +20,7 @@ export const axiosHttpService = (config: any = {}) => {
|
|
|
20
20
|
config.adapter = httpAdapter;
|
|
21
21
|
config.httpsAgent = new https.Agent({ keepAlive: true });
|
|
22
22
|
const axiosService = axios.create(config);
|
|
23
|
-
|
|
24
|
-
axiosRetry(axiosService, { retryDelay: axiosRetry.exponentialDelay, retries: 3 });
|
|
23
|
+
// axiosRetry(axiosService, { retryDelay: axiosRetry.exponentialDelay, retries: 3 });
|
|
25
24
|
|
|
26
25
|
return {
|
|
27
26
|
instance: () => axiosService,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './dynamodb-client';
|
|
2
|
-
export * from './eventbridge-client';
|
|
3
|
-
export * from './http-client';
|
|
4
|
-
export * from './s3-client';
|
|
5
|
-
export * from './cognito-client';
|
|
1
|
+
export * from './dynamodb-client.js';
|
|
2
|
+
export * from './eventbridge-client.js';
|
|
3
|
+
export * from './http-client.js';
|
|
4
|
+
export * from './s3-client.js';
|
|
5
|
+
export * from './cognito-client.js';
|
package/src/clients/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './generic';
|
|
2
|
-
export * from './internal-api';
|
|
3
|
-
export * from './third-party';
|
|
1
|
+
export * from './generic/index.js';
|
|
2
|
+
export * from './internal-api/index.js';
|
|
3
|
+
export * from './third-party/index.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as log from 'lambda-log';
|
|
2
|
-
import { ApiResponse } from '../../types/api-response';
|
|
2
|
+
import { ApiResponse } from '../../types/api-response.js';
|
|
3
3
|
import { Account, ACCOUNT_STATUS, Destination } from '@adtrackify/at-tracking-event-types';
|
|
4
|
-
import { axiosHttpService } from '../generic/http-client';
|
|
4
|
+
import { axiosHttpService } from '../generic/http-client.js';
|
|
5
5
|
|
|
6
6
|
//const BASE_API_URL = process.env.BASE_API_URL;
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as log from 'lambda-log';
|
|
2
2
|
//const log = require('lambda-log');
|
|
3
|
-
import { ApiResponse } from '../../types/api-response';
|
|
4
|
-
import { axiosHttpService } from '../generic/http-client';
|
|
3
|
+
import { ApiResponse } from '../../types/api-response.js';
|
|
4
|
+
import { axiosHttpService } from '../generic/http-client.js';
|
|
5
5
|
import { Destination } from '@adtrackify/at-tracking-event-types';
|
|
6
6
|
//const BASE_API_URL = process.env.BASE_API_URL;
|
|
7
7
|
//const DESTINATIONS_API_KEY = process.env.DESTINATIONS_API_KEY;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './destinations-client';
|
|
2
|
-
export * from './accounts-client';
|
|
3
|
-
export * from './users-auth-client';
|
|
4
|
-
export * from './shopify-app-install-client';
|
|
1
|
+
export * from './destinations-client.js';
|
|
2
|
+
export * from './accounts-client.js';
|
|
3
|
+
export * from './users-auth-client.js';
|
|
4
|
+
export * from './shopify-app-install-client.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import log from 'lambda-log';
|
|
2
|
-
import { ApiResponse } from '../../types/api-response';
|
|
3
|
-
import { axiosHttpService } from '../generic/http-client';
|
|
2
|
+
import { ApiResponse } from '../../types/api-response.js';
|
|
3
|
+
import { axiosHttpService } from '../generic/http-client.js';
|
|
4
4
|
import { ShopifyAppInstall, ShopifyAppSubscriptionStatus } from '@adtrackify/at-tracking-event-types';
|
|
5
5
|
//const BASE_API_URL = process.env.BASE_API_URL;
|
|
6
6
|
//const DESTINATIONS_API_KEY = process.env.DESTINATIONS_API_KEY;
|
|
@@ -61,6 +61,6 @@ export class ShopifyAppInstallClient {
|
|
|
61
61
|
const client = await this.getClient();
|
|
62
62
|
const response = await client.get(`/?shop=${shop}`);
|
|
63
63
|
log.info('getShopifyAppInstallByShop', { response });
|
|
64
|
-
return response as ApiResponse<ShopifyAppInstallResponseData>;
|
|
65
|
-
}
|
|
64
|
+
return response as ApiResponse<ShopifyAppInstallResponseData>;
|
|
65
|
+
};
|
|
66
66
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { User } from '@adtrackify/at-tracking-event-types';
|
|
2
2
|
import * as log from 'lambda-log';
|
|
3
|
-
import { HttpError
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { HttpError } from '../../libs/http-error.js';
|
|
4
|
+
import { HttpStatusCodes } from '../../libs/http-status-codes.js';
|
|
5
|
+
import { ApiResponse } from '../../types/api-response.js';
|
|
6
|
+
import { axiosHttpService } from '../generic/http-client.js';
|
|
6
7
|
|
|
7
8
|
export interface UserResponseData {
|
|
8
9
|
user: User;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './shopify-client';
|
|
1
|
+
export * from './shopify-client.js';
|
package/src/helpers/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './input-validation-helper';
|
|
2
|
-
export * from './logging-helper';
|
|
3
|
-
export * from './response-helper';
|
|
4
|
-
export * from './shopify-helper';
|
|
5
|
-
export * from './subscription-helper';
|
|
1
|
+
export * from './input-validation-helper.js';
|
|
2
|
+
export * from './logging-helper.js';
|
|
3
|
+
export * from './response-helper.js';
|
|
4
|
+
export * from './shopify-helper.js';
|
|
5
|
+
export * from './subscription-helper.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Joi from 'joi';
|
|
2
2
|
import * as log from 'lambda-log';
|
|
3
|
-
import { HttpError } from '../libs/http-error';
|
|
3
|
+
import { HttpError } from '../libs/http-error.js';
|
|
4
4
|
|
|
5
5
|
export const validateInput = (schema: Joi.ObjectSchema<any>, input: any) => {
|
|
6
6
|
const { error, value } = schema.validate(input);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createHmac } from 'crypto';
|
|
2
2
|
import * as log from 'lambda-log';
|
|
3
|
-
import { HttpError } from '../libs';
|
|
4
|
-
import { mapObjectToQueryString } from '../libs/url';
|
|
3
|
+
import { HttpError } from '../libs/http-error.js';
|
|
4
|
+
import { mapObjectToQueryString } from '../libs/url.js';
|
|
5
5
|
export interface ShopifyRequestValidationParameters {
|
|
6
6
|
code: string,
|
|
7
7
|
hmac?: string,
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './clients';
|
|
2
|
-
export * from './helpers';
|
|
3
|
-
export * from './libs';
|
|
4
|
-
export * from './types';
|
|
5
|
-
export * from './services';
|
|
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/src/libs/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from '../helpers/shopify-helper';
|
|
2
|
-
export * from './crypto';
|
|
3
|
-
export * from './dates';
|
|
4
|
-
export * from './http-error';
|
|
5
|
-
export * from './http-status-codes';
|
|
6
|
-
export * from './url';
|
|
1
|
+
export * from '../helpers/shopify-helper.js';
|
|
2
|
+
export * from './crypto.js';
|
|
3
|
+
export * from './dates.js';
|
|
4
|
+
export * from './http-error.js';
|
|
5
|
+
export * from './http-status-codes.js';
|
|
6
|
+
export * from './url.js';
|
|
7
7
|
|
package/src/libs/url.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
// Record<string, string> is any object
|
|
2
|
-
export const mapObjectToQueryString = (inputObj: any): string => {
|
|
3
|
-
const qsp = Object.entries(inputObj).sort((a, b) => a[ 0 ] < b[ 0 ] ? -1 : 1);
|
|
4
|
-
const urlParams = new URLSearchParams();
|
|
5
|
-
qsp.map(p => {
|
|
6
|
-
urlParams.append(p[ 0 ], p[ 1 ] as string);
|
|
7
|
-
});
|
|
8
|
-
const qs = urlParams.toString();
|
|
9
|
-
return qs;
|
|
1
|
+
// Record<string, string> is any object
|
|
2
|
+
export const mapObjectToQueryString = (inputObj: any): string => {
|
|
3
|
+
const qsp = Object.entries(inputObj).sort((a, b) => a[ 0 ] < b[ 0 ] ? -1 : 1);
|
|
4
|
+
const urlParams = new URLSearchParams();
|
|
5
|
+
qsp.map(p => {
|
|
6
|
+
urlParams.append(p[ 0 ], p[ 1 ] as string);
|
|
7
|
+
});
|
|
8
|
+
const qs = urlParams.toString();
|
|
9
|
+
return qs;
|
|
10
10
|
};
|
package/src/services/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './eventbridge-integration-service';
|
|
1
|
+
export * from './eventbridge-integration-service.js';
|
package/src/types/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './internal-events';
|
|
1
|
+
export * from './internal-events/index.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export enum ADTRACKIFY_EVENT_TYPES {
|
|
2
|
-
NOTIFY_SHOPIFY_SUBSCRIPTION_CREATED = 'shopifySubscriptionCreated',
|
|
3
|
-
NOTIFY_SUBSCRIPTION_SIGNUP_COMPLETED = 'subscription.signupCompleted',
|
|
4
|
-
REQUEST_SET_ACCOUNT_OWNER = 'setAccountOwner',
|
|
5
|
-
REQUEST_SET_ACCOUNT_SUBSCRIPTION_ID = 'setAccountSubscriptionId',
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export enum ADTRACKIFY_EVENT_SOURCES {
|
|
9
|
-
SUBSCRIPTIONS = 'subscriptions',
|
|
1
|
+
export enum ADTRACKIFY_EVENT_TYPES {
|
|
2
|
+
NOTIFY_SHOPIFY_SUBSCRIPTION_CREATED = 'shopifySubscriptionCreated',
|
|
3
|
+
NOTIFY_SUBSCRIPTION_SIGNUP_COMPLETED = 'subscription.signupCompleted',
|
|
4
|
+
REQUEST_SET_ACCOUNT_OWNER = 'setAccountOwner',
|
|
5
|
+
REQUEST_SET_ACCOUNT_SUBSCRIPTION_ID = 'setAccountSubscriptionId',
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export enum ADTRACKIFY_EVENT_SOURCES {
|
|
9
|
+
SUBSCRIPTIONS = 'subscriptions',
|
|
10
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './event-detail-types';
|
|
1
|
+
export * from './event-detail-types.js';
|
package/tsconfig.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"compilerOptions": {
|
|
3
3
|
"target": "esnext" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */,
|
|
4
4
|
"module": "esnext" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
|
|
5
|
-
|
|
5
|
+
"moduleResolution": "nodenext",
|
|
6
6
|
"allowJs": false, /* Allow javascript files to be compiled. */
|
|
7
7
|
"checkJs": false /* Report errors in .js files. */,
|
|
8
8
|
"outDir": "dist", /* Redirect output to the directory. */
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
"experimentalDecorators": true,
|
|
16
16
|
"sourceMap": true,
|
|
17
17
|
"declaration": true,
|
|
18
|
-
"moduleResolution": "node",
|
|
19
18
|
"resolveJsonModule": true,
|
|
20
19
|
"isolatedModules": true,
|
|
21
20
|
"removeComments": true,
|
|
@@ -28,7 +27,7 @@
|
|
|
28
27
|
]
|
|
29
28
|
},
|
|
30
29
|
"include": [
|
|
31
|
-
"./src"
|
|
30
|
+
"./src/**/*.ts"
|
|
32
31
|
],
|
|
33
32
|
"exclude": [
|
|
34
33
|
"node_modules"
|