@adtrackify/at-service-common 3.16.4 → 3.16.5

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.
@@ -1,3 +1,4 @@
1
1
  export declare const generatePublicKey: () => string;
2
2
  export declare const generateSha256Hash: (input: string) => string;
3
3
  export declare const generateMd5Hash: (input: string) => string;
4
+ export declare const generateApiKey: () => string;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.generateMd5Hash = exports.generateSha256Hash = exports.generatePublicKey = void 0;
6
+ exports.generateApiKey = exports.generateMd5Hash = exports.generateSha256Hash = exports.generatePublicKey = void 0;
7
7
  const crypto_1 = __importDefault(require("crypto"));
8
8
  const generatePublicKey = () => {
9
9
  const publicKey = crypto_1.default.randomBytes(26);
@@ -18,4 +18,9 @@ const generateMd5Hash = (input) => {
18
18
  return crypto_1.default.createHash('md5').update(input).digest('hex');
19
19
  };
20
20
  exports.generateMd5Hash = generateMd5Hash;
21
+ const generateApiKey = () => {
22
+ const randomPart = crypto_1.default.randomBytes(20).toString('hex');
23
+ return `upstack_${randomPart}`;
24
+ };
25
+ exports.generateApiKey = generateApiKey;
21
26
  //# sourceMappingURL=crypto.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../../src/libs/crypto.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAErB,MAAM,iBAAiB,GAAG,GAAW,EAAE;IAC5C,MAAM,SAAS,GAAG,gBAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IACzC,OAAO,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC,CAAC;AAHW,QAAA,iBAAiB,qBAG5B;AAEK,MAAM,kBAAkB,GAAG,CAAC,KAAa,EAAU,EAAE;IAC1D,OAAO,gBAA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AAW,UAAU,EAAE,CAAC;AACjC,CAAC,CAAC;AAHW,QAAA,cAAc,kBAGzB"}
@@ -1,3 +1,4 @@
1
1
  export declare const generatePublicKey: () => string;
2
2
  export declare const generateSha256Hash: (input: string) => string;
3
3
  export declare const generateMd5Hash: (input: string) => string;
4
+ export declare const generateApiKey: () => string;
@@ -9,4 +9,8 @@ export const generateSha256Hash = (input) => {
9
9
  export const generateMd5Hash = (input) => {
10
10
  return crypto.createHash('md5').update(input).digest('hex');
11
11
  };
12
+ export const generateApiKey = () => {
13
+ const randomPart = crypto.randomBytes(20).toString('hex');
14
+ return `upstack_${randomPart}`;
15
+ };
12
16
  //# sourceMappingURL=crypto.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../../src/libs/crypto.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAW,EAAE;IAC5C,MAAM,SAAS,GAAG,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IACzC,OAAO,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAa,EAAU,EAAE;IAC1D,OAAO,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACjE,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAa,EAAU,EAAE;IACvD,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC9D,CAAC,CAAC"}
1
+ {"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../../src/libs/crypto.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAW,EAAE;IAC5C,MAAM,SAAS,GAAG,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IACzC,OAAO,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAa,EAAU,EAAE;IAC1D,OAAO,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACjE,CAAC,CAAC;AACF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAa,EAAU,EAAE;IACvD,OAAO,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC9D,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,GAAW,EAAE;IACzC,MAAM,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC1D,OAAO,WAAW,UAAU,EAAE,CAAC;AACjC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,135 +1,135 @@
1
- {
2
- "name": "@adtrackify/at-service-common",
3
- "version": "3.16.4",
4
- "description": "",
5
- "files": [
6
- "dist/*"
7
- ],
8
- "main": "./dist/cjs/index.js",
9
- "module": "./dist/esm/index.js",
10
- "type": "module",
11
- "engines": {
12
- "node": ">=20.0.0",
13
- "npm": ">=10.0.0"
14
- },
15
- "scripts": {
16
- "clean": "rimraf dist",
17
- "build": "cross-env NODE_ENV=production npm run tsc",
18
- "build:dev": "npm run clean && npm run verify && cross-env NODE_ENV=production stage=dev APP_ENV=dev npm run build",
19
- "build:qa": "npm run clean && npm run verify && cross-env NODE_ENV=production stage=qa APP_ENV=qa npm run build",
20
- "build:prod": "npm run clean && npm run verify && cross-env NODE_ENV=production stage=prod APP_ENV=prod npm run build",
21
- "elint": "eslint .",
22
- "format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
23
- "lint": "eslint src/",
24
- "lint:fix": "eslint . --fix",
25
- "coverage": "npm run test:all -- --coverage --group=unit",
26
- "test": "jest --group=unit --coverage",
27
- "test:all": "cross-env AWS_REGION=us-east-2 NODE_ENV=test jest --group=unit --coverage",
28
- "test:unit": "cross-env AWS_REGION=us-east-2 NODE_ENV=test jest --group=unit --coverage",
29
- "verify": "npm run clean && npm run shopify:graphql:codegen && npm run type-check && npm run lint:fix && npm run test",
30
- "version": "npm run format && git add -A src",
31
- "postversion": "git push && git push --tags",
32
- "tsc": "tsc -p tsconfig.json && tsc -p tsconfig-cjs.json",
33
- "push": "npm install && npm run build:dev && npm publish --verbose",
34
- "type-check": "tsc --noEmit",
35
- "prepublishOnly": "npm run tsc",
36
- "shopify:graphql:codegen": "graphql-codegen && node scripts/fix-codegen-imports.cjs"
37
- },
38
- "dependencies": {
39
- "@adtrackify/at-shared-utils": "^3.2.23",
40
- "@aws-sdk/util-utf8": "^3.374.0",
41
- "@shopify/admin-api-client": "^1.0.4",
42
- "@shopify/shopify-api": "^11.6.1",
43
- "@shopify/storefront-api-client": "^1.0.3",
44
- "big.js": "^7.0.1",
45
- "ioredis": "^5.4.1",
46
- "libphonenumber-js": "^1.12.15",
47
- "loops": "^6.0.1",
48
- "pako": "^2.1.0",
49
- "papaparse": "^5.5.3",
50
- "psl": "^1.15.0",
51
- "shopify-api-node": "^3.12.7",
52
- "ulid": "^3.0.1"
53
- },
54
- "peerDependencies": {
55
- "assert": "^2.0.0",
56
- "axios": "^1.5.1",
57
- "crypto": "^1.0.1",
58
- "joi": "^17.6.0",
59
- "lambda-log": "^3.1.0",
60
- "luxon": "^3.0.3",
61
- "mysql2": "^3.11.0",
62
- "postmark": "^3.0.14",
63
- "ua-parser-js": "^1.0.2",
64
- "uuid": "^9.0.0"
65
- },
66
- "devDependencies": {
67
- "@adtrackify/at-tracking-event-types": "^4.67.1",
68
- "@aws-sdk/client-cognito-identity-provider": "^3.345.0",
69
- "@aws-sdk/client-dynamodb": "^3.345.0",
70
- "@aws-sdk/client-eventbridge": "^3.345.0",
71
- "@aws-sdk/client-lambda": "^3.637.0",
72
- "@aws-sdk/client-location": "^3.568.0",
73
- "@aws-sdk/client-s3": "^3.345.0",
74
- "@aws-sdk/client-sqs": "^3.345.0",
75
- "@aws-sdk/lib-dynamodb": "^3.345.0",
76
- "@faker-js/faker": "^7.5.0",
77
- "@graphql-codegen/graphql-modules-preset": "^4.0.12",
78
- "@graphql-codegen/typescript": "^4.1.2",
79
- "@graphql-codegen/typescript-resolvers": "^4.4.1",
80
- "@shopify/api-codegen-preset": "^1.1.3",
81
- "@swc/core": "^1.7.35",
82
- "@swc/jest": "^0.2.36",
83
- "@types/aws-lambda": "^8.10.145",
84
- "@types/big.js": "^6.2.2",
85
- "@types/jest": "^28.1.8",
86
- "@types/lambda-log": "^3.0.0",
87
- "@types/luxon": "^3.0.1",
88
- "@types/node": "^17.0.8",
89
- "@types/pako": "^2.0.3",
90
- "@types/papaparse": "^5.3.16",
91
- "@types/ua-parser-js": "^0.7.36",
92
- "@types/uuid": "^8.3.4",
93
- "@typescript-eslint/eslint-plugin": "^5.37.0",
94
- "@typescript-eslint/parser": "^5.37.0",
95
- "@upstackdata/eslint-plugin": "^1.0.2",
96
- "core-js": "^3.25.1",
97
- "cross-env": "^7.0.3",
98
- "esbuild": "^0.17.1",
99
- "eslint": "^8.23.1",
100
- "eslint-config-standard": "^17.0.0",
101
- "eslint-plugin-babel": "^5.3.1",
102
- "eslint-plugin-import": "^2.26.0",
103
- "eslint-plugin-n": "^15.2.5",
104
- "eslint-plugin-promise": "^6.0.1",
105
- "glob": "^8.0.3",
106
- "husky": "^6.0.0",
107
- "jest": "^29.2.1",
108
- "jest-cucumber": "3.0.1",
109
- "jest-junit": "13.0.0",
110
- "jest-runner": "^29.0.2",
111
- "jest-runner-groups": "2.2.0",
112
- "jest-util": "^29.7.0",
113
- "npm-dts": "^1.3.12",
114
- "npm-run-all": "^4.1.5",
115
- "npm-scripts-info": "^0.3.9",
116
- "prettier": "^2.7.1",
117
- "regenerator-runtime": "^0.13.9",
118
- "rimraf": "^3.0.2",
119
- "swc-loader": "^0.2.6",
120
- "ts-jest": "^29.0.5",
121
- "ts-jest-resolver": "^2.0.1",
122
- "ts-loader": "^9.5.1",
123
- "ts-node": "^10.9.2",
124
- "tslint": "^6.1.3",
125
- "tslint-config-prettier": "^1.18.0",
126
- "typescript": "4.9.5"
127
- },
128
- "repository": {
129
- "type": "git",
130
- "url": "git+ssh://git@bitbucket.org/eacap/at-service-common.git"
131
- },
132
- "author": "",
133
- "license": "ISC",
134
- "homepage": "https://bitbucket.org/eacap/at-service-common#readme"
135
- }
1
+ {
2
+ "name": "@adtrackify/at-service-common",
3
+ "version": "3.16.5",
4
+ "description": "",
5
+ "files": [
6
+ "dist/*"
7
+ ],
8
+ "main": "./dist/cjs/index.js",
9
+ "module": "./dist/esm/index.js",
10
+ "type": "module",
11
+ "engines": {
12
+ "node": ">=20.0.0",
13
+ "npm": ">=10.0.0"
14
+ },
15
+ "scripts": {
16
+ "clean": "rimraf dist",
17
+ "build": "cross-env NODE_ENV=production npm run tsc",
18
+ "build:dev": "npm run clean && npm run verify && cross-env NODE_ENV=production stage=dev APP_ENV=dev npm run build",
19
+ "build:qa": "npm run clean && npm run verify && cross-env NODE_ENV=production stage=qa APP_ENV=qa npm run build",
20
+ "build:prod": "npm run clean && npm run verify && cross-env NODE_ENV=production stage=prod APP_ENV=prod npm run build",
21
+ "elint": "eslint .",
22
+ "format": "prettier --write \"src/**/*.ts\" \"src/**/*.js\"",
23
+ "lint": "eslint src/",
24
+ "lint:fix": "eslint . --fix",
25
+ "coverage": "npm run test:all -- --coverage --group=unit",
26
+ "test": "jest --group=unit --coverage",
27
+ "test:all": "cross-env AWS_REGION=us-east-2 NODE_ENV=test jest --group=unit --coverage",
28
+ "test:unit": "cross-env AWS_REGION=us-east-2 NODE_ENV=test jest --group=unit --coverage",
29
+ "verify": "npm run clean && npm run shopify:graphql:codegen && npm run type-check && npm run lint:fix && npm run test",
30
+ "version": "npm run format && git add -A src",
31
+ "postversion": "git push && git push --tags",
32
+ "tsc": "tsc -p tsconfig.json && tsc -p tsconfig-cjs.json",
33
+ "push": "npm install && npm run build:dev && npm publish --verbose",
34
+ "type-check": "tsc --noEmit",
35
+ "prepublishOnly": "npm run tsc",
36
+ "shopify:graphql:codegen": "graphql-codegen && node scripts/fix-codegen-imports.cjs"
37
+ },
38
+ "dependencies": {
39
+ "@adtrackify/at-shared-utils": "^3.2.23",
40
+ "@aws-sdk/util-utf8": "^3.374.0",
41
+ "@shopify/admin-api-client": "^1.0.4",
42
+ "@shopify/shopify-api": "^11.6.1",
43
+ "@shopify/storefront-api-client": "^1.0.3",
44
+ "big.js": "^7.0.1",
45
+ "ioredis": "^5.4.1",
46
+ "libphonenumber-js": "^1.12.15",
47
+ "loops": "^6.0.1",
48
+ "pako": "^2.1.0",
49
+ "papaparse": "^5.5.3",
50
+ "psl": "^1.15.0",
51
+ "shopify-api-node": "^3.12.7",
52
+ "ulid": "^3.0.1"
53
+ },
54
+ "peerDependencies": {
55
+ "assert": "^2.0.0",
56
+ "axios": "^1.5.1",
57
+ "crypto": "^1.0.1",
58
+ "joi": "^17.6.0",
59
+ "lambda-log": "^3.1.0",
60
+ "luxon": "^3.0.3",
61
+ "mysql2": "^3.11.0",
62
+ "postmark": "^3.0.14",
63
+ "ua-parser-js": "^1.0.2",
64
+ "uuid": "^9.0.0"
65
+ },
66
+ "devDependencies": {
67
+ "@adtrackify/at-tracking-event-types": "^4.67.1",
68
+ "@aws-sdk/client-cognito-identity-provider": "^3.345.0",
69
+ "@aws-sdk/client-dynamodb": "^3.345.0",
70
+ "@aws-sdk/client-eventbridge": "^3.345.0",
71
+ "@aws-sdk/client-lambda": "^3.637.0",
72
+ "@aws-sdk/client-location": "^3.568.0",
73
+ "@aws-sdk/client-s3": "^3.345.0",
74
+ "@aws-sdk/client-sqs": "^3.345.0",
75
+ "@aws-sdk/lib-dynamodb": "^3.345.0",
76
+ "@faker-js/faker": "^7.5.0",
77
+ "@graphql-codegen/graphql-modules-preset": "^4.0.12",
78
+ "@graphql-codegen/typescript": "^4.1.2",
79
+ "@graphql-codegen/typescript-resolvers": "^4.4.1",
80
+ "@shopify/api-codegen-preset": "^1.1.3",
81
+ "@swc/core": "^1.7.35",
82
+ "@swc/jest": "^0.2.36",
83
+ "@types/aws-lambda": "^8.10.145",
84
+ "@types/big.js": "^6.2.2",
85
+ "@types/jest": "^28.1.8",
86
+ "@types/lambda-log": "^3.0.0",
87
+ "@types/luxon": "^3.0.1",
88
+ "@types/node": "^17.0.8",
89
+ "@types/pako": "^2.0.3",
90
+ "@types/papaparse": "^5.3.16",
91
+ "@types/ua-parser-js": "^0.7.36",
92
+ "@types/uuid": "^8.3.4",
93
+ "@typescript-eslint/eslint-plugin": "^5.37.0",
94
+ "@typescript-eslint/parser": "^5.37.0",
95
+ "@upstackdata/eslint-plugin": "^1.0.2",
96
+ "core-js": "^3.25.1",
97
+ "cross-env": "^7.0.3",
98
+ "esbuild": "^0.17.1",
99
+ "eslint": "^8.23.1",
100
+ "eslint-config-standard": "^17.0.0",
101
+ "eslint-plugin-babel": "^5.3.1",
102
+ "eslint-plugin-import": "^2.26.0",
103
+ "eslint-plugin-n": "^15.2.5",
104
+ "eslint-plugin-promise": "^6.0.1",
105
+ "glob": "^8.0.3",
106
+ "husky": "^6.0.0",
107
+ "jest": "^29.2.1",
108
+ "jest-cucumber": "3.0.1",
109
+ "jest-junit": "13.0.0",
110
+ "jest-runner": "^29.0.2",
111
+ "jest-runner-groups": "2.2.0",
112
+ "jest-util": "^29.7.0",
113
+ "npm-dts": "^1.3.12",
114
+ "npm-run-all": "^4.1.5",
115
+ "npm-scripts-info": "^0.3.9",
116
+ "prettier": "^2.7.1",
117
+ "regenerator-runtime": "^0.13.9",
118
+ "rimraf": "^3.0.2",
119
+ "swc-loader": "^0.2.6",
120
+ "ts-jest": "^29.0.5",
121
+ "ts-jest-resolver": "^2.0.1",
122
+ "ts-loader": "^9.5.1",
123
+ "ts-node": "^10.9.2",
124
+ "tslint": "^6.1.3",
125
+ "tslint-config-prettier": "^1.18.0",
126
+ "typescript": "4.9.5"
127
+ },
128
+ "repository": {
129
+ "type": "git",
130
+ "url": "git+ssh://git@bitbucket.org/eacap/at-service-common.git"
131
+ },
132
+ "author": "",
133
+ "license": "ISC",
134
+ "homepage": "https://bitbucket.org/eacap/at-service-common#readme"
135
+ }