@adtrackify/at-service-common 3.0.97 → 3.0.98
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/dist/cjs/__tests__/identity-cache/identity-cache-db-service.spec.d.ts +1 -1
- package/dist/cjs/__tests__/identity-cache/identity-cache-db-service.spec.js +527 -527
- package/dist/cjs/__tests__/libs/compress-decompress.spec.d.ts +1 -1
- package/dist/cjs/__tests__/libs/compress-decompress.spec.js +16 -16
- package/dist/cjs/__tests__/s3-client/s3-client.spec.d.ts +1 -1
- package/dist/cjs/__tests__/s3-client/s3-client.spec.js +26 -26
- package/dist/cjs/clients/generic/cognito-client.d.ts +20 -20
- package/dist/cjs/clients/generic/cognito-client.js +164 -164
- package/dist/cjs/clients/generic/dynamodb-client.d.ts +17 -17
- package/dist/cjs/clients/generic/dynamodb-client.js +167 -167
- package/dist/cjs/clients/generic/eventbridge-client.d.ts +14 -14
- package/dist/cjs/clients/generic/eventbridge-client.js +49 -49
- package/dist/cjs/clients/generic/http-client.d.ts +88 -88
- package/dist/cjs/clients/generic/http-client.js +60 -60
- package/dist/cjs/clients/generic/index.d.ts +10 -10
- package/dist/cjs/clients/generic/index.js +26 -26
- package/dist/cjs/clients/generic/lambda-invoke-client.d.ts +10 -10
- package/dist/cjs/clients/generic/lambda-invoke-client.js +35 -35
- package/dist/cjs/clients/generic/location-client.d.ts +8 -8
- package/dist/cjs/clients/generic/location-client.js +31 -31
- package/dist/cjs/clients/generic/redis-client.d.ts +17 -17
- package/dist/cjs/clients/generic/redis-client.js +117 -117
- package/dist/cjs/clients/generic/s3-client.d.ts +16 -16
- package/dist/cjs/clients/generic/s3-client.js +110 -110
- package/dist/cjs/clients/generic/singlestore-db-client.d.ts +14 -14
- package/dist/cjs/clients/generic/singlestore-db-client.js +67 -67
- package/dist/cjs/clients/generic/sqs-client.d.ts +20 -14
- package/dist/cjs/clients/generic/sqs-client.js +36 -36
- package/dist/cjs/clients/generic/sqs-client.js.map +1 -1
- package/dist/cjs/clients/index.d.ts +3 -3
- package/dist/cjs/clients/index.js +19 -19
- package/dist/cjs/clients/internal-api/accounts-client.d.ts +112 -112
- package/dist/cjs/clients/internal-api/accounts-client.js +117 -117
- package/dist/cjs/clients/internal-api/cache-lambda-client.d.ts +23 -23
- package/dist/cjs/clients/internal-api/cache-lambda-client.js +59 -59
- package/dist/cjs/clients/internal-api/db-management-client.d.ts +18 -18
- package/dist/cjs/clients/internal-api/db-management-client.js +39 -39
- package/dist/cjs/clients/internal-api/destinations-client.d.ts +29 -29
- package/dist/cjs/clients/internal-api/destinations-client.js +54 -54
- package/dist/cjs/clients/internal-api/event-collector-client.d.ts +20 -20
- package/dist/cjs/clients/internal-api/event-collector-client.js +39 -39
- package/dist/cjs/clients/internal-api/identity-client.d.ts +25 -25
- package/dist/cjs/clients/internal-api/identity-client.js +92 -92
- package/dist/cjs/clients/internal-api/index.d.ts +8 -8
- package/dist/cjs/clients/internal-api/index.js +24 -24
- package/dist/cjs/clients/internal-api/shopify-app-install-client.d.ts +34 -34
- package/dist/cjs/clients/internal-api/shopify-app-install-client.js +63 -63
- package/dist/cjs/clients/internal-api/users-auth-client.d.ts +31 -31
- package/dist/cjs/clients/internal-api/users-auth-client.js +92 -92
- package/dist/cjs/clients/third-party/index.d.ts +1 -1
- package/dist/cjs/clients/third-party/index.js +17 -17
- package/dist/cjs/clients/third-party/shopify-client.d.ts +198 -198
- package/dist/cjs/clients/third-party/shopify-client.js +150 -150
- package/dist/cjs/helpers/identity-cache-helper.d.ts +4 -4
- package/dist/cjs/helpers/identity-cache-helper.js +150 -150
- package/dist/cjs/helpers/index.d.ts +5 -5
- package/dist/cjs/helpers/index.js +21 -21
- package/dist/cjs/helpers/input-validation-helper.d.ts +3 -3
- package/dist/cjs/helpers/input-validation-helper.js +22 -22
- package/dist/cjs/helpers/logging-helper.d.ts +16 -16
- package/dist/cjs/helpers/logging-helper.js +84 -84
- package/dist/cjs/helpers/response-helper.d.ts +15 -15
- package/dist/cjs/helpers/response-helper.js +42 -42
- package/dist/cjs/helpers/shopify-helper.d.ts +9 -9
- package/dist/cjs/helpers/shopify-helper.js +28 -28
- package/dist/cjs/index.d.ts +5 -5
- package/dist/cjs/index.js +21 -21
- package/dist/cjs/libs/clickId-parser.d.ts +23 -23
- package/dist/cjs/libs/clickId-parser.js +49 -49
- package/dist/cjs/libs/compression.d.ts +2 -2
- package/dist/cjs/libs/compression.js +33 -33
- package/dist/cjs/libs/crypto.d.ts +1 -1
- package/dist/cjs/libs/crypto.js +12 -12
- package/dist/cjs/libs/dates.d.ts +6 -6
- package/dist/cjs/libs/dates.js +31 -31
- package/dist/cjs/libs/http-error.d.ts +21 -21
- package/dist/cjs/libs/http-error.js +59 -59
- package/dist/cjs/libs/http-status-codes.d.ts +58 -58
- package/dist/cjs/libs/http-status-codes.js +62 -62
- package/dist/cjs/libs/index.d.ts +9 -9
- package/dist/cjs/libs/index.js +25 -25
- package/dist/cjs/libs/referrer-parser/index.d.ts +2 -2
- package/dist/cjs/libs/referrer-parser/index.js +18 -18
- package/dist/cjs/libs/referrer-parser/referrer-data.d.ts +9 -9
- package/dist/cjs/libs/referrer-parser/referrer-data.js +4712 -4712
- package/dist/cjs/libs/referrer-parser/referrer-parser-util.d.ts +20 -20
- package/dist/cjs/libs/referrer-parser/referrer-parser-util.js +128 -128
- package/dist/cjs/libs/url.d.ts +1 -1
- package/dist/cjs/libs/url.js +13 -13
- package/dist/cjs/services/db/destinations-db-service.d.ts +8 -8
- package/dist/cjs/services/db/destinations-db-service.js +47 -47
- package/dist/cjs/services/db/identity-cache-db-service.d.ts +24 -24
- package/dist/cjs/services/db/identity-cache-db-service.js +233 -233
- package/dist/cjs/services/db/index.d.ts +7 -7
- package/dist/cjs/services/db/index.js +23 -23
- package/dist/cjs/services/db/log-events-db-service.d.ts +11 -11
- package/dist/cjs/services/db/log-events-db-service.js +172 -172
- package/dist/cjs/services/db/purchased-contacts-db-service.d.ts +9 -9
- package/dist/cjs/services/db/purchased-contacts-db-service.js +38 -38
- package/dist/cjs/services/db/shopify-app-installs-db-service.d.ts +7 -7
- package/dist/cjs/services/db/shopify-app-installs-db-service.js +47 -47
- package/dist/cjs/services/db/shopify-products-cache-db-service.d.ts +9 -9
- package/dist/cjs/services/db/shopify-products-cache-db-service.js +64 -64
- package/dist/cjs/services/db/tracking-events-db-service.d.ts +20 -20
- package/dist/cjs/services/db/tracking-events-db-service.js +162 -162
- package/dist/cjs/services/eventbridge-integration-service.d.ts +9 -9
- package/dist/cjs/services/eventbridge-integration-service.js +28 -28
- package/dist/cjs/services/index.d.ts +5 -5
- package/dist/cjs/services/index.js +21 -21
- package/dist/cjs/services/ipdata-lookup-service.d.ts +17 -17
- package/dist/cjs/services/ipdata-lookup-service.js +71 -71
- package/dist/cjs/services/log-event-service.d.ts +9 -9
- package/dist/cjs/services/log-event-service.js +56 -56
- package/dist/cjs/services/metric-event-service.d.ts +9 -9
- package/dist/cjs/services/metric-event-service.js +49 -49
- package/dist/cjs/types/api-response.d.ts +6 -6
- package/dist/cjs/types/api-response.js +2 -2
- package/dist/cjs/types/index.d.ts +1 -1
- package/dist/cjs/types/index.js +17 -17
- package/dist/cjs/types/internal-events/event-detail-types.d.ts +20 -20
- package/dist/cjs/types/internal-events/event-detail-types.js +27 -27
- package/dist/cjs/types/internal-events/index.d.ts +1 -1
- package/dist/cjs/types/internal-events/index.js +17 -17
- package/dist/esm/__tests__/identity-cache/identity-cache-db-service.spec.d.ts +1 -1
- package/dist/esm/__tests__/identity-cache/identity-cache-db-service.spec.js +525 -525
- package/dist/esm/__tests__/libs/compress-decompress.spec.d.ts +1 -1
- package/dist/esm/__tests__/libs/compress-decompress.spec.js +14 -14
- package/dist/esm/__tests__/s3-client/s3-client.spec.d.ts +1 -1
- package/dist/esm/__tests__/s3-client/s3-client.spec.js +24 -24
- package/dist/esm/clients/generic/cognito-client.d.ts +20 -20
- package/dist/esm/clients/generic/cognito-client.js +159 -159
- package/dist/esm/clients/generic/dynamodb-client.d.ts +17 -17
- package/dist/esm/clients/generic/dynamodb-client.js +163 -163
- package/dist/esm/clients/generic/eventbridge-client.d.ts +14 -14
- package/dist/esm/clients/generic/eventbridge-client.js +45 -45
- package/dist/esm/clients/generic/http-client.d.ts +88 -88
- package/dist/esm/clients/generic/http-client.js +52 -52
- package/dist/esm/clients/generic/index.d.ts +10 -10
- package/dist/esm/clients/generic/index.js +10 -10
- package/dist/esm/clients/generic/lambda-invoke-client.d.ts +10 -10
- package/dist/esm/clients/generic/lambda-invoke-client.js +31 -31
- package/dist/esm/clients/generic/location-client.d.ts +8 -8
- package/dist/esm/clients/generic/location-client.js +27 -27
- package/dist/esm/clients/generic/redis-client.d.ts +17 -17
- package/dist/esm/clients/generic/redis-client.js +110 -110
- package/dist/esm/clients/generic/s3-client.d.ts +16 -16
- package/dist/esm/clients/generic/s3-client.js +106 -106
- package/dist/esm/clients/generic/singlestore-db-client.d.ts +14 -14
- package/dist/esm/clients/generic/singlestore-db-client.js +40 -40
- package/dist/esm/clients/generic/sqs-client.d.ts +20 -14
- package/dist/esm/clients/generic/sqs-client.js +32 -32
- package/dist/esm/clients/generic/sqs-client.js.map +1 -1
- package/dist/esm/clients/index.d.ts +3 -3
- package/dist/esm/clients/index.js +3 -3
- package/dist/esm/clients/internal-api/accounts-client.d.ts +112 -112
- package/dist/esm/clients/internal-api/accounts-client.js +113 -113
- package/dist/esm/clients/internal-api/cache-lambda-client.d.ts +23 -23
- package/dist/esm/clients/internal-api/cache-lambda-client.js +55 -55
- package/dist/esm/clients/internal-api/db-management-client.d.ts +18 -18
- package/dist/esm/clients/internal-api/db-management-client.js +32 -32
- package/dist/esm/clients/internal-api/destinations-client.d.ts +29 -29
- package/dist/esm/clients/internal-api/destinations-client.js +50 -50
- package/dist/esm/clients/internal-api/event-collector-client.d.ts +20 -20
- package/dist/esm/clients/internal-api/event-collector-client.js +32 -32
- package/dist/esm/clients/internal-api/identity-client.d.ts +25 -25
- package/dist/esm/clients/internal-api/identity-client.js +88 -88
- package/dist/esm/clients/internal-api/index.d.ts +8 -8
- package/dist/esm/clients/internal-api/index.js +8 -8
- package/dist/esm/clients/internal-api/shopify-app-install-client.d.ts +34 -34
- package/dist/esm/clients/internal-api/shopify-app-install-client.js +56 -56
- package/dist/esm/clients/internal-api/users-auth-client.d.ts +31 -31
- package/dist/esm/clients/internal-api/users-auth-client.js +88 -88
- package/dist/esm/clients/third-party/index.d.ts +1 -1
- package/dist/esm/clients/third-party/index.js +1 -1
- package/dist/esm/clients/third-party/shopify-client.d.ts +198 -198
- package/dist/esm/clients/third-party/shopify-client.js +146 -146
- package/dist/esm/helpers/identity-cache-helper.d.ts +4 -4
- package/dist/esm/helpers/identity-cache-helper.js +145 -145
- package/dist/esm/helpers/index.d.ts +5 -5
- package/dist/esm/helpers/index.js +5 -5
- package/dist/esm/helpers/input-validation-helper.d.ts +3 -3
- package/dist/esm/helpers/input-validation-helper.js +18 -18
- package/dist/esm/helpers/logging-helper.d.ts +16 -16
- package/dist/esm/helpers/logging-helper.js +56 -56
- package/dist/esm/helpers/response-helper.d.ts +15 -15
- package/dist/esm/helpers/response-helper.js +36 -36
- package/dist/esm/helpers/shopify-helper.d.ts +9 -9
- package/dist/esm/helpers/shopify-helper.js +23 -23
- package/dist/esm/index.d.ts +5 -5
- package/dist/esm/index.js +5 -5
- package/dist/esm/libs/clickId-parser.d.ts +23 -23
- package/dist/esm/libs/clickId-parser.js +45 -45
- package/dist/esm/libs/compression.d.ts +2 -2
- package/dist/esm/libs/compression.js +25 -25
- package/dist/esm/libs/crypto.d.ts +1 -1
- package/dist/esm/libs/crypto.js +5 -5
- package/dist/esm/libs/dates.d.ts +6 -6
- package/dist/esm/libs/dates.js +22 -22
- package/dist/esm/libs/http-error.d.ts +21 -21
- package/dist/esm/libs/http-error.js +55 -55
- package/dist/esm/libs/http-status-codes.d.ts +58 -58
- package/dist/esm/libs/http-status-codes.js +59 -59
- package/dist/esm/libs/index.d.ts +9 -9
- package/dist/esm/libs/index.js +9 -9
- package/dist/esm/libs/referrer-parser/index.d.ts +2 -2
- package/dist/esm/libs/referrer-parser/index.js +2 -2
- package/dist/esm/libs/referrer-parser/referrer-data.d.ts +9 -9
- package/dist/esm/libs/referrer-parser/referrer-data.js +4709 -4709
- package/dist/esm/libs/referrer-parser/referrer-parser-util.d.ts +20 -20
- package/dist/esm/libs/referrer-parser/referrer-parser-util.js +121 -121
- package/dist/esm/libs/url.d.ts +1 -1
- package/dist/esm/libs/url.js +9 -9
- package/dist/esm/services/db/destinations-db-service.d.ts +8 -8
- package/dist/esm/services/db/destinations-db-service.js +43 -43
- package/dist/esm/services/db/identity-cache-db-service.d.ts +24 -24
- package/dist/esm/services/db/identity-cache-db-service.js +229 -229
- package/dist/esm/services/db/index.d.ts +7 -7
- package/dist/esm/services/db/index.js +7 -7
- package/dist/esm/services/db/log-events-db-service.d.ts +11 -11
- package/dist/esm/services/db/log-events-db-service.js +168 -168
- package/dist/esm/services/db/purchased-contacts-db-service.d.ts +9 -9
- package/dist/esm/services/db/purchased-contacts-db-service.js +34 -34
- package/dist/esm/services/db/shopify-app-installs-db-service.d.ts +7 -7
- package/dist/esm/services/db/shopify-app-installs-db-service.js +43 -43
- package/dist/esm/services/db/shopify-products-cache-db-service.d.ts +9 -9
- package/dist/esm/services/db/shopify-products-cache-db-service.js +60 -60
- package/dist/esm/services/db/tracking-events-db-service.d.ts +20 -20
- package/dist/esm/services/db/tracking-events-db-service.js +158 -158
- package/dist/esm/services/eventbridge-integration-service.d.ts +9 -9
- package/dist/esm/services/eventbridge-integration-service.js +24 -24
- package/dist/esm/services/index.d.ts +5 -5
- package/dist/esm/services/index.js +5 -5
- package/dist/esm/services/ipdata-lookup-service.d.ts +17 -17
- package/dist/esm/services/ipdata-lookup-service.js +67 -67
- package/dist/esm/services/log-event-service.d.ts +9 -9
- package/dist/esm/services/log-event-service.js +52 -52
- package/dist/esm/services/metric-event-service.d.ts +9 -9
- package/dist/esm/services/metric-event-service.js +45 -45
- package/dist/esm/types/api-response.d.ts +6 -6
- package/dist/esm/types/api-response.js +1 -1
- package/dist/esm/types/index.d.ts +1 -1
- package/dist/esm/types/index.js +1 -1
- package/dist/esm/types/internal-events/event-detail-types.d.ts +20 -20
- package/dist/esm/types/internal-events/event-detail-types.js +24 -24
- package/dist/esm/types/internal-events/index.d.ts +1 -1
- package/dist/esm/types/internal-events/index.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const compression_1 = require("../../libs/compression");
|
|
4
|
-
describe('compression, decompression unit tests', () => {
|
|
5
|
-
afterEach(() => {
|
|
6
|
-
jest.resetModules();
|
|
7
|
-
});
|
|
8
|
-
it('should compress json to string', () => {
|
|
9
|
-
const compressed = (0, compression_1.compressJSON)({ key1: 'value1', key2: 'value2' });
|
|
10
|
-
expect(compressed).toBe('eNqrVspOrTRUslIqS8wpTTVU0gHxjWB8I6VaAK3KCjs=');
|
|
11
|
-
});
|
|
12
|
-
it('should decompress string to json', () => {
|
|
13
|
-
const decompressed = (0, compression_1.decompressJSON)('eNqrVspOrTRUslIqS8wpTTVU0gHxjWB8I6VaAK3KCjs=');
|
|
14
|
-
expect(decompressed).toStrictEqual({ key1: 'value1', key2: 'value2' });
|
|
15
|
-
});
|
|
16
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const compression_1 = require("../../libs/compression");
|
|
4
|
+
describe('compression, decompression unit tests', () => {
|
|
5
|
+
afterEach(() => {
|
|
6
|
+
jest.resetModules();
|
|
7
|
+
});
|
|
8
|
+
it('should compress json to string', () => {
|
|
9
|
+
const compressed = (0, compression_1.compressJSON)({ key1: 'value1', key2: 'value2' });
|
|
10
|
+
expect(compressed).toBe('eNqrVspOrTRUslIqS8wpTTVU0gHxjWB8I6VaAK3KCjs=');
|
|
11
|
+
});
|
|
12
|
+
it('should decompress string to json', () => {
|
|
13
|
+
const decompressed = (0, compression_1.decompressJSON)('eNqrVspOrTRUslIqS8wpTTVU0gHxjWB8I6VaAK3KCjs=');
|
|
14
|
+
expect(decompressed).toStrictEqual({ key1: 'value1', key2: 'value2' });
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
17
|
//# sourceMappingURL=compress-decompress.spec.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const index_js_1 = require("../../index.js");
|
|
4
|
-
jest.setTimeout(30000);
|
|
5
|
-
describe('s3-client test', () => {
|
|
6
|
-
afterEach(() => {
|
|
7
|
-
jest.resetAllMocks();
|
|
8
|
-
});
|
|
9
|
-
it('should run uploadJson multiple times', async () => {
|
|
10
|
-
const s3Client = new index_js_1.S3Client();
|
|
11
|
-
const putObjectMock = jest.spyOn(s3Client.s3, 'putObject').mockImplementation(() => Promise.reject({ message: 'something went wrong!' }));
|
|
12
|
-
const maxRetries = 5;
|
|
13
|
-
const dataToWrite = { pixelId: '1234', shopifyAppInstallId: '123455' };
|
|
14
|
-
const res = await s3Client.uploadJson('test/path/id.json', 'shopify-data-bucket', dataToWrite, undefined, 0, maxRetries);
|
|
15
|
-
expect(putObjectMock).toHaveBeenCalledTimes(maxRetries + 1);
|
|
16
|
-
expect(res.status).toBe(false);
|
|
17
|
-
expect(res.response).toBe(dataToWrite);
|
|
18
|
-
});
|
|
19
|
-
it('should return true from uploadJson', async () => {
|
|
20
|
-
const s3Client = new index_js_1.S3Client();
|
|
21
|
-
const putObjectMock = jest.spyOn(s3Client.s3, 'putObject').mockImplementation(() => Promise.resolve({ message: 'uploaded successfully' }));
|
|
22
|
-
const res = await s3Client.uploadJson('test/path/id.json', 'shopify-data-bucket', { pixelId: '1234', shopifyAppInstallId: '123455' });
|
|
23
|
-
expect(putObjectMock).toHaveBeenCalledTimes(1);
|
|
24
|
-
expect(res.status).toBe(true);
|
|
25
|
-
});
|
|
26
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const index_js_1 = require("../../index.js");
|
|
4
|
+
jest.setTimeout(30000);
|
|
5
|
+
describe('s3-client test', () => {
|
|
6
|
+
afterEach(() => {
|
|
7
|
+
jest.resetAllMocks();
|
|
8
|
+
});
|
|
9
|
+
it('should run uploadJson multiple times', async () => {
|
|
10
|
+
const s3Client = new index_js_1.S3Client();
|
|
11
|
+
const putObjectMock = jest.spyOn(s3Client.s3, 'putObject').mockImplementation(() => Promise.reject({ message: 'something went wrong!' }));
|
|
12
|
+
const maxRetries = 5;
|
|
13
|
+
const dataToWrite = { pixelId: '1234', shopifyAppInstallId: '123455' };
|
|
14
|
+
const res = await s3Client.uploadJson('test/path/id.json', 'shopify-data-bucket', dataToWrite, undefined, 0, maxRetries);
|
|
15
|
+
expect(putObjectMock).toHaveBeenCalledTimes(maxRetries + 1);
|
|
16
|
+
expect(res.status).toBe(false);
|
|
17
|
+
expect(res.response).toBe(dataToWrite);
|
|
18
|
+
});
|
|
19
|
+
it('should return true from uploadJson', async () => {
|
|
20
|
+
const s3Client = new index_js_1.S3Client();
|
|
21
|
+
const putObjectMock = jest.spyOn(s3Client.s3, 'putObject').mockImplementation(() => Promise.resolve({ message: 'uploaded successfully' }));
|
|
22
|
+
const res = await s3Client.uploadJson('test/path/id.json', 'shopify-data-bucket', { pixelId: '1234', shopifyAppInstallId: '123455' });
|
|
23
|
+
expect(putObjectMock).toHaveBeenCalledTimes(1);
|
|
24
|
+
expect(res.status).toBe(true);
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
27
|
//# sourceMappingURL=s3-client.spec.js.map
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
export declare function dictToAwsAttributes(input: any): {
|
|
2
|
-
Name: string;
|
|
3
|
-
Value: any;
|
|
4
|
-
}[];
|
|
5
|
-
export declare class CognitoClient {
|
|
6
|
-
cognitoClient: any;
|
|
7
|
-
USER_POOL_ID: string;
|
|
8
|
-
USER_POOL_NO_SECRET_CLIENT_ID: string;
|
|
9
|
-
constructor(userPoolId: string, userPoolNoSecretClientId: string);
|
|
10
|
-
signupUser: (data: any) => Promise<any>;
|
|
11
|
-
forgotPassword: (email: string) => Promise<any>;
|
|
12
|
-
adminEmailVerify: (email: string) => Promise<void>;
|
|
13
|
-
forceValidateEmail: (email: string) => Promise<void>;
|
|
14
|
-
adminConfirmUser: (data: any) => Promise<any>;
|
|
15
|
-
confirmUser: (data: any) => Promise<any>;
|
|
16
|
-
resendCode: (email: string) => Promise<void>;
|
|
17
|
-
adminDeleteUser: (userId: string) => Promise<boolean>;
|
|
18
|
-
getUserByEmail: (email: string) => Promise<any>;
|
|
19
|
-
getUser: (id: string) => Promise<any>;
|
|
20
|
-
}
|
|
1
|
+
export declare function dictToAwsAttributes(input: any): {
|
|
2
|
+
Name: string;
|
|
3
|
+
Value: any;
|
|
4
|
+
}[];
|
|
5
|
+
export declare class CognitoClient {
|
|
6
|
+
cognitoClient: any;
|
|
7
|
+
USER_POOL_ID: string;
|
|
8
|
+
USER_POOL_NO_SECRET_CLIENT_ID: string;
|
|
9
|
+
constructor(userPoolId: string, userPoolNoSecretClientId: string);
|
|
10
|
+
signupUser: (data: any) => Promise<any>;
|
|
11
|
+
forgotPassword: (email: string) => Promise<any>;
|
|
12
|
+
adminEmailVerify: (email: string) => Promise<void>;
|
|
13
|
+
forceValidateEmail: (email: string) => Promise<void>;
|
|
14
|
+
adminConfirmUser: (data: any) => Promise<any>;
|
|
15
|
+
confirmUser: (data: any) => Promise<any>;
|
|
16
|
+
resendCode: (email: string) => Promise<void>;
|
|
17
|
+
adminDeleteUser: (userId: string) => Promise<boolean>;
|
|
18
|
+
getUserByEmail: (email: string) => Promise<any>;
|
|
19
|
+
getUser: (id: string) => Promise<any>;
|
|
20
|
+
}
|
|
@@ -1,165 +1,165 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CognitoClient = exports.dictToAwsAttributes = void 0;
|
|
4
|
-
const client_cognito_identity_provider_1 = require("@aws-sdk/client-cognito-identity-provider");
|
|
5
|
-
const index_js_1 = require("../../index.js");
|
|
6
|
-
function dictToAwsAttributes(input) {
|
|
7
|
-
delete input.email;
|
|
8
|
-
delete input.password;
|
|
9
|
-
const output = [];
|
|
10
|
-
for (const att in input) {
|
|
11
|
-
if (Object.prototype.hasOwnProperty.call(input, att)) {
|
|
12
|
-
output.push({ Name: att, Value: input[att] });
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
return output;
|
|
16
|
-
}
|
|
17
|
-
exports.dictToAwsAttributes = dictToAwsAttributes;
|
|
18
|
-
const buildAttributes = (data) => {
|
|
19
|
-
const attributes = {
|
|
20
|
-
name: data.givenName,
|
|
21
|
-
family_name: data.familyName,
|
|
22
|
-
};
|
|
23
|
-
return dictToAwsAttributes(attributes);
|
|
24
|
-
};
|
|
25
|
-
class CognitoClient {
|
|
26
|
-
cognitoClient;
|
|
27
|
-
USER_POOL_ID;
|
|
28
|
-
USER_POOL_NO_SECRET_CLIENT_ID;
|
|
29
|
-
constructor(userPoolId, userPoolNoSecretClientId) {
|
|
30
|
-
this.cognitoClient = new client_cognito_identity_provider_1.CognitoIdentityProvider({});
|
|
31
|
-
this.USER_POOL_ID = userPoolId;
|
|
32
|
-
this.USER_POOL_NO_SECRET_CLIENT_ID = userPoolNoSecretClientId;
|
|
33
|
-
}
|
|
34
|
-
signupUser = async (data) => {
|
|
35
|
-
const params = {
|
|
36
|
-
ClientId: this.USER_POOL_NO_SECRET_CLIENT_ID,
|
|
37
|
-
Password: data.password,
|
|
38
|
-
Username: data.email,
|
|
39
|
-
UserAttributes: buildAttributes(data),
|
|
40
|
-
};
|
|
41
|
-
const cognitoResponse = await this.cognitoClient.signUp(params);
|
|
42
|
-
index_js_1.Logger.info('Successfully Registered User', { cognitoResponse });
|
|
43
|
-
return cognitoResponse;
|
|
44
|
-
};
|
|
45
|
-
forgotPassword = async (email) => {
|
|
46
|
-
await this.adminEmailVerify(email);
|
|
47
|
-
const params = {
|
|
48
|
-
ClientId: this.USER_POOL_NO_SECRET_CLIENT_ID,
|
|
49
|
-
Username: email,
|
|
50
|
-
};
|
|
51
|
-
const cognitoResponse = await this.cognitoClient.forgotPassword(params);
|
|
52
|
-
index_js_1.Logger.info('Sent Forgot Password', { cognitoResponse });
|
|
53
|
-
return cognitoResponse;
|
|
54
|
-
};
|
|
55
|
-
adminEmailVerify = async (email) => {
|
|
56
|
-
try {
|
|
57
|
-
const user = await this.getUserByEmail(email);
|
|
58
|
-
if (user && user?.UserStatus === 'CONFIRMED' && user?.email_verified !== 'true') {
|
|
59
|
-
await this.forceValidateEmail(email);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
catch (error) {
|
|
63
|
-
index_js_1.Logger.error('Failed admin email verify', { error });
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
forceValidateEmail = async (email) => {
|
|
67
|
-
try {
|
|
68
|
-
const params = {
|
|
69
|
-
UserPoolId: this.USER_POOL_ID,
|
|
70
|
-
Username: email,
|
|
71
|
-
UserAttributes: [
|
|
72
|
-
{
|
|
73
|
-
Name: 'email_verified',
|
|
74
|
-
Value: 'true',
|
|
75
|
-
},
|
|
76
|
-
],
|
|
77
|
-
};
|
|
78
|
-
await this.cognitoClient.adminUpdateUserAttributes(params);
|
|
79
|
-
}
|
|
80
|
-
catch (error) {
|
|
81
|
-
index_js_1.Logger.error('Failed force validate email', { email, error });
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
adminConfirmUser = async (data) => {
|
|
85
|
-
const params = {
|
|
86
|
-
UserPoolId: this.USER_POOL_ID,
|
|
87
|
-
Username: data.email,
|
|
88
|
-
};
|
|
89
|
-
const cognitoResponse = await this.cognitoClient.adminConfirmSignUp(params);
|
|
90
|
-
await this.forceValidateEmail(data.email);
|
|
91
|
-
index_js_1.Logger.info('Admin Successfully Confirmed User', { cognitoResponse });
|
|
92
|
-
return cognitoResponse;
|
|
93
|
-
};
|
|
94
|
-
confirmUser = async (data) => {
|
|
95
|
-
const params = {
|
|
96
|
-
ClientId: this.USER_POOL_NO_SECRET_CLIENT_ID,
|
|
97
|
-
ConfirmationCode: data.confirmationCode,
|
|
98
|
-
Username: data.email,
|
|
99
|
-
};
|
|
100
|
-
const cognitoResponse = await this.cognitoClient.confirmSignUp(params);
|
|
101
|
-
index_js_1.Logger.info('Successfully Confirmed User', { cognitoResponse });
|
|
102
|
-
return cognitoResponse;
|
|
103
|
-
};
|
|
104
|
-
resendCode = async (email) => {
|
|
105
|
-
const params = {
|
|
106
|
-
ClientId: this.USER_POOL_NO_SECRET_CLIENT_ID,
|
|
107
|
-
Username: email,
|
|
108
|
-
};
|
|
109
|
-
await this.cognitoClient.resendConfirmationCode(params);
|
|
110
|
-
index_js_1.Logger.info('Successfully Resend Confirmation Code', { email });
|
|
111
|
-
return;
|
|
112
|
-
};
|
|
113
|
-
adminDeleteUser = async (userId) => {
|
|
114
|
-
const params = {
|
|
115
|
-
UserPoolId: this.USER_POOL_ID,
|
|
116
|
-
Username: userId,
|
|
117
|
-
};
|
|
118
|
-
await this.cognitoClient.adminDeleteUser(params);
|
|
119
|
-
return true;
|
|
120
|
-
};
|
|
121
|
-
getUserByEmail = async (email) => {
|
|
122
|
-
const params = {
|
|
123
|
-
UserPoolId: this.USER_POOL_ID,
|
|
124
|
-
Filter: `email=\"${email}\"`,
|
|
125
|
-
Limit: 1,
|
|
126
|
-
};
|
|
127
|
-
const cognitoResponse = await this.cognitoClient.listUsers(params);
|
|
128
|
-
index_js_1.Logger.info('Get Users by Email', { cognitoResponse });
|
|
129
|
-
if (cognitoResponse?.Users && cognitoResponse?.Users.length > 0) {
|
|
130
|
-
const attributes = cognitoResponse.Users[0].Attributes;
|
|
131
|
-
const user = {
|
|
132
|
-
...cognitoResponse.Users[0],
|
|
133
|
-
Attributes: undefined,
|
|
134
|
-
id: cognitoResponse.Users[0].sub,
|
|
135
|
-
};
|
|
136
|
-
attributes.forEach((attr) => {
|
|
137
|
-
user[attr.Name] = attr?.Value;
|
|
138
|
-
});
|
|
139
|
-
return user;
|
|
140
|
-
}
|
|
141
|
-
return null;
|
|
142
|
-
};
|
|
143
|
-
getUser = async (id) => {
|
|
144
|
-
const params = {
|
|
145
|
-
UserPoolId: this.USER_POOL_ID,
|
|
146
|
-
Username: id
|
|
147
|
-
};
|
|
148
|
-
const cognitoResponse = await this.cognitoClient.adminGetUser(params);
|
|
149
|
-
if (cognitoResponse) {
|
|
150
|
-
const attributes = cognitoResponse?.UserAttributes || [];
|
|
151
|
-
const user = {
|
|
152
|
-
...cognitoResponse,
|
|
153
|
-
UserAttributes: undefined,
|
|
154
|
-
id: cognitoResponse.Username
|
|
155
|
-
};
|
|
156
|
-
attributes.forEach((attr) => {
|
|
157
|
-
user[attr.Name] = attr?.Value;
|
|
158
|
-
});
|
|
159
|
-
return user;
|
|
160
|
-
}
|
|
161
|
-
return null;
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
exports.CognitoClient = CognitoClient;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CognitoClient = exports.dictToAwsAttributes = void 0;
|
|
4
|
+
const client_cognito_identity_provider_1 = require("@aws-sdk/client-cognito-identity-provider");
|
|
5
|
+
const index_js_1 = require("../../index.js");
|
|
6
|
+
function dictToAwsAttributes(input) {
|
|
7
|
+
delete input.email;
|
|
8
|
+
delete input.password;
|
|
9
|
+
const output = [];
|
|
10
|
+
for (const att in input) {
|
|
11
|
+
if (Object.prototype.hasOwnProperty.call(input, att)) {
|
|
12
|
+
output.push({ Name: att, Value: input[att] });
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return output;
|
|
16
|
+
}
|
|
17
|
+
exports.dictToAwsAttributes = dictToAwsAttributes;
|
|
18
|
+
const buildAttributes = (data) => {
|
|
19
|
+
const attributes = {
|
|
20
|
+
name: data.givenName,
|
|
21
|
+
family_name: data.familyName,
|
|
22
|
+
};
|
|
23
|
+
return dictToAwsAttributes(attributes);
|
|
24
|
+
};
|
|
25
|
+
class CognitoClient {
|
|
26
|
+
cognitoClient;
|
|
27
|
+
USER_POOL_ID;
|
|
28
|
+
USER_POOL_NO_SECRET_CLIENT_ID;
|
|
29
|
+
constructor(userPoolId, userPoolNoSecretClientId) {
|
|
30
|
+
this.cognitoClient = new client_cognito_identity_provider_1.CognitoIdentityProvider({});
|
|
31
|
+
this.USER_POOL_ID = userPoolId;
|
|
32
|
+
this.USER_POOL_NO_SECRET_CLIENT_ID = userPoolNoSecretClientId;
|
|
33
|
+
}
|
|
34
|
+
signupUser = async (data) => {
|
|
35
|
+
const params = {
|
|
36
|
+
ClientId: this.USER_POOL_NO_SECRET_CLIENT_ID,
|
|
37
|
+
Password: data.password,
|
|
38
|
+
Username: data.email,
|
|
39
|
+
UserAttributes: buildAttributes(data),
|
|
40
|
+
};
|
|
41
|
+
const cognitoResponse = await this.cognitoClient.signUp(params);
|
|
42
|
+
index_js_1.Logger.info('Successfully Registered User', { cognitoResponse });
|
|
43
|
+
return cognitoResponse;
|
|
44
|
+
};
|
|
45
|
+
forgotPassword = async (email) => {
|
|
46
|
+
await this.adminEmailVerify(email);
|
|
47
|
+
const params = {
|
|
48
|
+
ClientId: this.USER_POOL_NO_SECRET_CLIENT_ID,
|
|
49
|
+
Username: email,
|
|
50
|
+
};
|
|
51
|
+
const cognitoResponse = await this.cognitoClient.forgotPassword(params);
|
|
52
|
+
index_js_1.Logger.info('Sent Forgot Password', { cognitoResponse });
|
|
53
|
+
return cognitoResponse;
|
|
54
|
+
};
|
|
55
|
+
adminEmailVerify = async (email) => {
|
|
56
|
+
try {
|
|
57
|
+
const user = await this.getUserByEmail(email);
|
|
58
|
+
if (user && user?.UserStatus === 'CONFIRMED' && user?.email_verified !== 'true') {
|
|
59
|
+
await this.forceValidateEmail(email);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
index_js_1.Logger.error('Failed admin email verify', { error });
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
forceValidateEmail = async (email) => {
|
|
67
|
+
try {
|
|
68
|
+
const params = {
|
|
69
|
+
UserPoolId: this.USER_POOL_ID,
|
|
70
|
+
Username: email,
|
|
71
|
+
UserAttributes: [
|
|
72
|
+
{
|
|
73
|
+
Name: 'email_verified',
|
|
74
|
+
Value: 'true',
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
};
|
|
78
|
+
await this.cognitoClient.adminUpdateUserAttributes(params);
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
index_js_1.Logger.error('Failed force validate email', { email, error });
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
adminConfirmUser = async (data) => {
|
|
85
|
+
const params = {
|
|
86
|
+
UserPoolId: this.USER_POOL_ID,
|
|
87
|
+
Username: data.email,
|
|
88
|
+
};
|
|
89
|
+
const cognitoResponse = await this.cognitoClient.adminConfirmSignUp(params);
|
|
90
|
+
await this.forceValidateEmail(data.email);
|
|
91
|
+
index_js_1.Logger.info('Admin Successfully Confirmed User', { cognitoResponse });
|
|
92
|
+
return cognitoResponse;
|
|
93
|
+
};
|
|
94
|
+
confirmUser = async (data) => {
|
|
95
|
+
const params = {
|
|
96
|
+
ClientId: this.USER_POOL_NO_SECRET_CLIENT_ID,
|
|
97
|
+
ConfirmationCode: data.confirmationCode,
|
|
98
|
+
Username: data.email,
|
|
99
|
+
};
|
|
100
|
+
const cognitoResponse = await this.cognitoClient.confirmSignUp(params);
|
|
101
|
+
index_js_1.Logger.info('Successfully Confirmed User', { cognitoResponse });
|
|
102
|
+
return cognitoResponse;
|
|
103
|
+
};
|
|
104
|
+
resendCode = async (email) => {
|
|
105
|
+
const params = {
|
|
106
|
+
ClientId: this.USER_POOL_NO_SECRET_CLIENT_ID,
|
|
107
|
+
Username: email,
|
|
108
|
+
};
|
|
109
|
+
await this.cognitoClient.resendConfirmationCode(params);
|
|
110
|
+
index_js_1.Logger.info('Successfully Resend Confirmation Code', { email });
|
|
111
|
+
return;
|
|
112
|
+
};
|
|
113
|
+
adminDeleteUser = async (userId) => {
|
|
114
|
+
const params = {
|
|
115
|
+
UserPoolId: this.USER_POOL_ID,
|
|
116
|
+
Username: userId,
|
|
117
|
+
};
|
|
118
|
+
await this.cognitoClient.adminDeleteUser(params);
|
|
119
|
+
return true;
|
|
120
|
+
};
|
|
121
|
+
getUserByEmail = async (email) => {
|
|
122
|
+
const params = {
|
|
123
|
+
UserPoolId: this.USER_POOL_ID,
|
|
124
|
+
Filter: `email=\"${email}\"`,
|
|
125
|
+
Limit: 1,
|
|
126
|
+
};
|
|
127
|
+
const cognitoResponse = await this.cognitoClient.listUsers(params);
|
|
128
|
+
index_js_1.Logger.info('Get Users by Email', { cognitoResponse });
|
|
129
|
+
if (cognitoResponse?.Users && cognitoResponse?.Users.length > 0) {
|
|
130
|
+
const attributes = cognitoResponse.Users[0].Attributes;
|
|
131
|
+
const user = {
|
|
132
|
+
...cognitoResponse.Users[0],
|
|
133
|
+
Attributes: undefined,
|
|
134
|
+
id: cognitoResponse.Users[0].sub,
|
|
135
|
+
};
|
|
136
|
+
attributes.forEach((attr) => {
|
|
137
|
+
user[attr.Name] = attr?.Value;
|
|
138
|
+
});
|
|
139
|
+
return user;
|
|
140
|
+
}
|
|
141
|
+
return null;
|
|
142
|
+
};
|
|
143
|
+
getUser = async (id) => {
|
|
144
|
+
const params = {
|
|
145
|
+
UserPoolId: this.USER_POOL_ID,
|
|
146
|
+
Username: id
|
|
147
|
+
};
|
|
148
|
+
const cognitoResponse = await this.cognitoClient.adminGetUser(params);
|
|
149
|
+
if (cognitoResponse) {
|
|
150
|
+
const attributes = cognitoResponse?.UserAttributes || [];
|
|
151
|
+
const user = {
|
|
152
|
+
...cognitoResponse,
|
|
153
|
+
UserAttributes: undefined,
|
|
154
|
+
id: cognitoResponse.Username
|
|
155
|
+
};
|
|
156
|
+
attributes.forEach((attr) => {
|
|
157
|
+
user[attr.Name] = attr?.Value;
|
|
158
|
+
});
|
|
159
|
+
return user;
|
|
160
|
+
}
|
|
161
|
+
return null;
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
exports.CognitoClient = CognitoClient;
|
|
165
165
|
//# sourceMappingURL=cognito-client.js.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export declare class DynamoDbClient {
|
|
2
|
-
static safeGet: (tableName: string, keyName: string, keyValue: any) => Promise<Record<string, any> | null>;
|
|
3
|
-
static safePut: (tableName: string, data: any) => Promise<import("@aws-sdk/lib-dynamodb").PutCommandOutput | null>;
|
|
4
|
-
static safeDelete: (tableName: string, keyName: string, keyValue: any) => Promise<import("@aws-sdk/lib-dynamodb").DeleteCommandOutput | null>;
|
|
5
|
-
static safeQueryByGSI: (tableName: string, gsiName: string, keyName: string, keyValue: any) => Promise<any[] | null>;
|
|
6
|
-
static safeBatchGet: (tableName: string, keys: any) => Promise<Record<string, any>[]>;
|
|
7
|
-
static safeBatchPut: (tableName: string, items: any[]) => Promise<import("@aws-sdk/lib-dynamodb").BatchWriteCommandOutput | null>;
|
|
8
|
-
static queryAll: (params: any) => Promise<any[] | null>;
|
|
9
|
-
static scanAll: (params: any) => Promise<any[] | null>;
|
|
10
|
-
static batchGet: (params: any) => Promise<import("@aws-sdk/lib-dynamodb").BatchGetCommandOutput>;
|
|
11
|
-
static get: (params: any) => Promise<import("@aws-sdk/lib-dynamodb").GetCommandOutput>;
|
|
12
|
-
static put: (params: any) => Promise<import("@aws-sdk/lib-dynamodb").PutCommandOutput>;
|
|
13
|
-
static query: (params: any) => Promise<import("@aws-sdk/lib-dynamodb").QueryCommandOutput>;
|
|
14
|
-
static scan: (params: any) => Promise<import("@aws-sdk/lib-dynamodb").ScanCommandOutput>;
|
|
15
|
-
static update: (params: any) => Promise<import("@aws-sdk/lib-dynamodb").UpdateCommandOutput>;
|
|
16
|
-
static delete: (params: any) => Promise<import("@aws-sdk/lib-dynamodb").DeleteCommandOutput>;
|
|
17
|
-
}
|
|
1
|
+
export declare class DynamoDbClient {
|
|
2
|
+
static safeGet: (tableName: string, keyName: string, keyValue: any) => Promise<Record<string, any> | null>;
|
|
3
|
+
static safePut: (tableName: string, data: any) => Promise<import("@aws-sdk/lib-dynamodb").PutCommandOutput | null>;
|
|
4
|
+
static safeDelete: (tableName: string, keyName: string, keyValue: any) => Promise<import("@aws-sdk/lib-dynamodb").DeleteCommandOutput | null>;
|
|
5
|
+
static safeQueryByGSI: (tableName: string, gsiName: string, keyName: string, keyValue: any) => Promise<any[] | null>;
|
|
6
|
+
static safeBatchGet: (tableName: string, keys: any) => Promise<Record<string, any>[]>;
|
|
7
|
+
static safeBatchPut: (tableName: string, items: any[]) => Promise<import("@aws-sdk/lib-dynamodb").BatchWriteCommandOutput | null>;
|
|
8
|
+
static queryAll: (params: any) => Promise<any[] | null>;
|
|
9
|
+
static scanAll: (params: any) => Promise<any[] | null>;
|
|
10
|
+
static batchGet: (params: any) => Promise<import("@aws-sdk/lib-dynamodb").BatchGetCommandOutput>;
|
|
11
|
+
static get: (params: any) => Promise<import("@aws-sdk/lib-dynamodb").GetCommandOutput>;
|
|
12
|
+
static put: (params: any) => Promise<import("@aws-sdk/lib-dynamodb").PutCommandOutput>;
|
|
13
|
+
static query: (params: any) => Promise<import("@aws-sdk/lib-dynamodb").QueryCommandOutput>;
|
|
14
|
+
static scan: (params: any) => Promise<import("@aws-sdk/lib-dynamodb").ScanCommandOutput>;
|
|
15
|
+
static update: (params: any) => Promise<import("@aws-sdk/lib-dynamodb").UpdateCommandOutput>;
|
|
16
|
+
static delete: (params: any) => Promise<import("@aws-sdk/lib-dynamodb").DeleteCommandOutput>;
|
|
17
|
+
}
|