@adtrackify/at-service-common 1.0.80 → 1.0.81
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/.vscode/settings.json +9 -9
- package/bitbucket-pipelines.yml +20 -20
- package/build.js +21 -21
- package/dist/index.d.ts +5 -4
- package/dist/index.js +6 -0
- package/dist/index.js.map +2 -2
- package/jest.config.ts +40 -40
- package/package.json +1 -1
- package/src/__tests__/helpers/subscription-helper.spec.ts +40 -40
- package/src/clients/generic/axios.d.ts +7 -7
- package/src/clients/generic/dynamodb-client.ts +113 -113
- package/src/clients/generic/eventbridge-client.ts +52 -52
- package/src/clients/internal-api/destinations-client.ts +58 -58
- package/src/clients/internal-api/index.ts +4 -4
- package/src/clients/internal-api/shopify-app-install-client.ts +66 -59
- package/src/clients/internal-api/users-auth-client.ts +111 -111
- package/src/clients/third-party/shopify-client.ts +139 -139
- package/src/helpers/index.ts +5 -5
- package/src/helpers/input-validation-helper.ts +21 -21
- package/src/helpers/shopify-helper.ts +39 -39
- package/src/helpers/subscription-helper.ts +234 -234
- package/src/index.ts +4 -4
- package/src/libs/index.ts +7 -7
- package/src/libs/url.ts +9 -9
- package/src/services/eventbridge-integration-service.ts +44 -44
- package/src/types/internal-events/event-detail-types.ts +9 -9
- package/tsconfig.json +35 -35
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
|
package/.vscode/settings.json
CHANGED
|
@@ -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
|
}
|
package/bitbucket-pipelines.yml
CHANGED
|
@@ -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 {
|
|
@@ -283,6 +287,7 @@ declare module '@adtrackify/at-service-common/clients/internal-api/shopify-app-i
|
|
|
283
287
|
}>;
|
|
284
288
|
updateShopifyAppInstall: (shopifyAppInstallId: string, updateShopifyAppInstallRequest: UpdateShopifyAppInstallRequest) => Promise<ApiResponse<ShopifyAppInstallResponseData>>;
|
|
285
289
|
getShopifyAppInstall: (shopifyAppInstallId: string) => Promise<ApiResponse<ShopifyAppInstallResponseData>>;
|
|
290
|
+
getShopifyAppInstallByShop: (shop: string) => Promise<ApiResponse<ShopifyAppInstallResponseData>>;
|
|
286
291
|
}
|
|
287
292
|
|
|
288
293
|
}
|
|
@@ -688,10 +693,6 @@ declare module '@adtrackify/at-service-common/types/internal-events/event-detail
|
|
|
688
693
|
declare module '@adtrackify/at-service-common/types/internal-events/index' {
|
|
689
694
|
export * from '@adtrackify/at-service-common/types/internal-events/event-detail-types';
|
|
690
695
|
|
|
691
|
-
}
|
|
692
|
-
declare module '@adtrackify/at-service-common/__tests__/helpers/subscription-helper.spec' {
|
|
693
|
-
export {};
|
|
694
|
-
|
|
695
696
|
}
|
|
696
697
|
declare module '@adtrackify/at-service-common' {
|
|
697
698
|
import main = require('@adtrackify/at-service-common/src/index');
|
package/dist/index.js
CHANGED
|
@@ -613,6 +613,12 @@ var ShopifyAppInstallClient = class {
|
|
|
613
613
|
log7.info("getShopifyAppInstall", { response });
|
|
614
614
|
return response;
|
|
615
615
|
};
|
|
616
|
+
getShopifyAppInstallByShop = async (shop) => {
|
|
617
|
+
const client2 = await this.getClient();
|
|
618
|
+
const response = await client2.get(`/?shop=${shop}`);
|
|
619
|
+
log7.info("getShopifyAppInstallByShop", { response });
|
|
620
|
+
return response;
|
|
621
|
+
};
|
|
616
622
|
};
|
|
617
623
|
|
|
618
624
|
// src/clients/third-party/shopify-client.ts
|