@adtrackify/at-service-common 1.1.16 → 1.1.17

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: sleavely/node-awscli:18.x
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
@@ -18,5 +18,5 @@ build({
18
18
  format: 'esm',
19
19
  platform: 'node',
20
20
  sourcemap: 'linked',
21
- external: [...Object.keys(dependencies), '@aws-sdk/client-dynamodb', '@aws-sdk/client-eventbridge', '@aws-sdk/lib-dynamodb', '@aws-sdk/client-s3', "@faker-js/faker"]
21
+ external: [...Object.keys(dependencies), '@aws-sdk/client-dynamodb', '@aws-sdk/client-eventbridge', '@aws-sdk/lib-dynamodb', '@aws-sdk/client-s3', '@aws-sdk/client-cognito-identity-provider', "@faker-js/faker"]
22
22
  })
package/dist/index.d.ts CHANGED
@@ -1,3 +1,26 @@
1
+ declare module '@adtrackify/at-service-common/__tests__/helpers/subscription-helper.spec' {
2
+ export {};
3
+
4
+ }
5
+ declare module '@adtrackify/at-service-common/clients/generic/cognito-service' {
6
+ export function dictToAwsAttributes(input: any): {
7
+ Name: string;
8
+ Value: any;
9
+ }[];
10
+ export class CognitoService {
11
+ static setCredentials: (userPoolId: string, userPoolNoSecretClientId: string) => void;
12
+ static signupUser: (data: any) => Promise<import("@aws-sdk/client-cognito-identity-provider").SignUpCommandOutput>;
13
+ static forgotPassword: (email: string) => Promise<import("@aws-sdk/client-cognito-identity-provider").ForgotPasswordCommandOutput>;
14
+ static adminEmailVerify: (email: string) => Promise<void>;
15
+ static forceValidateEmail: (email: string) => Promise<void>;
16
+ static adminConfirmUser: (data: any) => Promise<import("@aws-sdk/client-cognito-identity-provider").AdminConfirmSignUpCommandOutput>;
17
+ static confirmUser: (data: any) => Promise<import("@aws-sdk/client-cognito-identity-provider").ConfirmSignUpCommandOutput>;
18
+ static resendCode: (email: string) => Promise<void>;
19
+ static adminDeleteUser: (userId: string) => Promise<boolean>;
20
+ static getUserByEmail: (email: string) => Promise<any>;
21
+ }
22
+
23
+ }
1
24
  declare module '@adtrackify/at-service-common/clients/generic/dynamodb-client' {
2
25
  export class DynamoDbClient {
3
26
  static safeGet: (tableName: string, keyName: string, keyValue: any) => Promise<Record<string, any> | null>;
@@ -73,11 +96,11 @@ declare module '@adtrackify/at-service-common/clients/generic/index' {
73
96
 
74
97
  }
75
98
  declare module '@adtrackify/at-service-common/clients/generic/s3-client' {
76
- import { ObjectCannedACL, S3 } from '@aws-sdk/client-s3';
99
+ import { S3 } from '@aws-sdk/client-s3';
77
100
  export class S3Client {
78
101
  s3: S3;
79
- constructor(region?: string);
80
- uploadJson(path: string, bucket: string, jsonData: any, ACL?: ObjectCannedACL | string): Promise<unknown>;
102
+ constructor(accessKeyId: string, secretAccessKey: string);
103
+ uploadJson(path: string, bucket: string, jsonData: any): Promise<unknown>;
81
104
  }
82
105
 
83
106
  }
@@ -703,10 +726,6 @@ declare module '@adtrackify/at-service-common/types/internal-events/event-detail
703
726
  declare module '@adtrackify/at-service-common/types/internal-events/index' {
704
727
  export * from '@adtrackify/at-service-common/types/internal-events/event-detail-types';
705
728
 
706
- }
707
- declare module '@adtrackify/at-service-common/__tests__/helpers/subscription-helper.spec' {
708
- export {};
709
-
710
729
  }
711
730
  declare module '@adtrackify/at-service-common' {
712
731
  import main = require('@adtrackify/at-service-common/src/index');
package/dist/index.js CHANGED
@@ -222,17 +222,21 @@ var axiosHttpService = (config = {}) => {
222
222
  };
223
223
 
224
224
  // src/clients/generic/s3-client.ts
225
- import { ObjectCannedACL, S3 } from "@aws-sdk/client-s3";
225
+ import { S3 } from "@aws-sdk/client-s3";
226
226
  import * as log3 from "lambda-log";
227
227
  var S3Client = class {
228
228
  s3;
229
- constructor(region = "us-west-2") {
230
- this.s3 = new S3({ region });
229
+ constructor(accessKeyId, secretAccessKey) {
230
+ this.s3 = new S3({
231
+ credentials: {
232
+ accessKeyId,
233
+ secretAccessKey
234
+ }
235
+ });
231
236
  }
232
- async uploadJson(path, bucket, jsonData, ACL = ObjectCannedACL.private) {
237
+ async uploadJson(path, bucket, jsonData) {
233
238
  try {
234
239
  const res = await this.s3.putObject({
235
- ACL,
236
240
  Bucket: bucket,
237
241
  ContentType: "application/json; charset=utf-8",
238
242
  Body: JSON.stringify(jsonData),