@adtrackify/at-service-common 1.1.12 → 1.1.15

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/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
  export class DynamoDbClient {
7
3
  static safeGet: (tableName: string, keyName: string, keyValue: any) => Promise<Record<string, any> | null>;
@@ -78,7 +74,7 @@ declare module '@adtrackify/at-service-common/clients/generic/index' {
78
74
  }
79
75
  declare module '@adtrackify/at-service-common/clients/generic/s3-client' {
80
76
  import { S3 } from '@aws-sdk/client-s3';
81
- export default class S3Client {
77
+ export class S3Client {
82
78
  s3: S3;
83
79
  constructor(accessKeyId: string, secretAccessKey: string);
84
80
  uploadJson(path: string, bucket: string, jsonData: any): Promise<unknown>;
@@ -707,6 +703,10 @@ declare module '@adtrackify/at-service-common/types/internal-events/event-detail
707
703
  declare module '@adtrackify/at-service-common/types/internal-events/index' {
708
704
  export * from '@adtrackify/at-service-common/types/internal-events/event-detail-types';
709
705
 
706
+ }
707
+ declare module '@adtrackify/at-service-common/__tests__/helpers/subscription-helper.spec' {
708
+ export {};
709
+
710
710
  }
711
711
  declare module '@adtrackify/at-service-common' {
712
712
  import main = require('@adtrackify/at-service-common/src/index');
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ import * as log from "lambda-log";
12
12
  var marshallOptions = {
13
13
  convertEmptyValues: false,
14
14
  removeUndefinedValues: false,
15
- convertClassInstanceToMap: false
15
+ convertClassInstanceToMap: true
16
16
  };
17
17
  var unmarshallOptions = {
18
18
  wrapNumbers: false
@@ -224,6 +224,31 @@ var axiosHttpService = (config = {}) => {
224
224
  // src/clients/generic/s3-client.ts
225
225
  import { S3 } from "@aws-sdk/client-s3";
226
226
  import * as log3 from "lambda-log";
227
+ var S3Client = class {
228
+ s3;
229
+ constructor(accessKeyId, secretAccessKey) {
230
+ this.s3 = new S3({
231
+ credentials: {
232
+ accessKeyId,
233
+ secretAccessKey
234
+ }
235
+ });
236
+ }
237
+ async uploadJson(path, bucket, jsonData) {
238
+ try {
239
+ const res = await this.s3.putObject({
240
+ Bucket: bucket,
241
+ ContentType: "application/json; charset=utf-8",
242
+ Body: JSON.stringify(jsonData),
243
+ Key: path
244
+ });
245
+ return res;
246
+ } catch (error6) {
247
+ log3.error("Error in s3 upload json", { error: error6 });
248
+ return error6;
249
+ }
250
+ }
251
+ };
227
252
 
228
253
  // src/clients/internal-api/destinations-client.ts
229
254
  import * as log4 from "lambda-log";
@@ -1090,6 +1115,7 @@ export {
1090
1115
  HttpError,
1091
1116
  HttpStatusCodes,
1092
1117
  PostmarkRequestType,
1118
+ S3Client,
1093
1119
  ShopifyAppInstallClient,
1094
1120
  ShopifyClient,
1095
1121
  StripeBillingMap,