@tomassabol/aws-services 1.8.0 → 1.8.2
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/appconfig.d.ts +3 -0
- package/appconfig.js +18 -0
- package/dynamodb.d.ts +4 -0
- package/dynamodb.js +7 -0
- package/dynamodb.mock.d.ts +8 -0
- package/dynamodb.mock.js +12 -0
- package/eventbridge.d.ts +8 -0
- package/eventbridge.js +37 -0
- package/eventbridge.mock.d.ts +3 -0
- package/eventbridge.mock.js +7 -0
- package/logger.d.ts +2 -0
- package/logger.js +14 -0
- package/package.json +8 -9
- package/s3.d.ts +13 -0
- package/s3.js +46 -0
- package/secrets-manager.d.ts +4 -0
- package/secrets-manager.js +37 -0
- package/secrets-manager.mock.d.ts +4 -0
- package/secrets-manager.mock.js +8 -0
- package/sns.d.ts +7 -0
- package/sns.js +21 -0
- package/sqs.d.ts +6 -0
- package/sqs.js +24 -0
- package/sqs.mock.d.ts +3 -0
- package/sqs.mock.js +7 -0
- package/ssm.d.ts +19 -0
- package/ssm.js +48 -0
- package/ssm.mock.d.ts +3 -0
- package/ssm.mock.js +7 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/.eslintignore +0 -1
- package/.eslintrc.json +0 -75
- package/.husky/pre-commit +0 -4
- package/.lintstagedrc.json +0 -9
- package/.nvmrc +0 -1
- package/.prettierignore +0 -2
- package/.prettierrc.json +0 -3
- package/.vscode/settings.json +0 -6
- package/CHANGELOG.md +0 -96
- package/bitbucket-pipelines.yml +0 -65
- package/jest.config.js +0 -62
- package/sonar-project.properties +0 -8
- package/src/appconfig.ts +0 -20
- package/src/dynamodb.mock.ts +0 -10
- package/src/dynamodb.ts +0 -7
- package/src/eventbridge.mock.ts +0 -5
- package/src/eventbridge.ts +0 -47
- package/src/logger.ts +0 -14
- package/src/s3.ts +0 -56
- package/src/secrets-manager.mock.ts +0 -9
- package/src/secrets-manager.ts +0 -37
- package/src/sns.ts +0 -24
- package/src/sqs.mock.ts +0 -5
- package/src/sqs.ts +0 -32
- package/src/ssm.mock.ts +0 -5
- package/src/ssm.ts +0 -70
- package/test/appconfig.test.ts +0 -45
- package/test/dynamodb.test.ts +0 -13
- package/test/eventbridge.test.ts +0 -35
- package/test/s3.test.ts +0 -78
- package/test/secrets-manager.test.ts +0 -55
- package/test/sns.test.ts +0 -59
- package/test/sqs.test.ts +0 -46
- package/test/ssm.test.ts +0 -85
- package/tsconfig.build.json +0 -4
- package/tsconfig.json +0 -9
- package/typedoc.json +0 -4
package/appconfig.d.ts
ADDED
package/appconfig.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getApplication = exports.appConfigClient = void 0;
|
|
4
|
+
const client_appconfig_1 = require("@aws-sdk/client-appconfig");
|
|
5
|
+
const logger_1 = require("./logger");
|
|
6
|
+
exports.appConfigClient = new client_appconfig_1.AppConfigClient({});
|
|
7
|
+
const getApplication = async (applicationId) => {
|
|
8
|
+
try {
|
|
9
|
+
return await exports.appConfigClient.send(new client_appconfig_1.GetApplicationCommand({
|
|
10
|
+
ApplicationId: applicationId,
|
|
11
|
+
}));
|
|
12
|
+
}
|
|
13
|
+
catch (error) {
|
|
14
|
+
logger_1.logger.error("getApplication", { error, applicationId });
|
|
15
|
+
throw error;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
exports.getApplication = getApplication;
|
package/dynamodb.d.ts
ADDED
package/dynamodb.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.documentClient = exports.client = void 0;
|
|
4
|
+
const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
|
|
5
|
+
const lib_dynamodb_1 = require("@aws-sdk/lib-dynamodb");
|
|
6
|
+
exports.client = new client_dynamodb_1.DynamoDBClient({});
|
|
7
|
+
exports.documentClient = lib_dynamodb_1.DynamoDBDocumentClient.from(exports.client);
|
package/dynamodb.mock.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mockDynamodbService = void 0;
|
|
4
|
+
exports.mockDynamodbService = {
|
|
5
|
+
client: {
|
|
6
|
+
send: jest.fn(),
|
|
7
|
+
},
|
|
8
|
+
documentClient: {
|
|
9
|
+
send: jest.fn(),
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
jest.mock("@tomassabol/aws-services/dynamodb", () => exports.mockDynamodbService);
|
package/eventbridge.d.ts
ADDED
package/eventbridge.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.client = void 0;
|
|
4
|
+
exports.sendEvent = sendEvent;
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
6
|
+
const client_eventbridge_1 = require("@aws-sdk/client-eventbridge");
|
|
7
|
+
const logger_1 = require("./logger");
|
|
8
|
+
exports.client = new client_eventbridge_1.EventBridgeClient({});
|
|
9
|
+
async function sendEvent(params) {
|
|
10
|
+
const { eventBusName, eventType, event, source } = params;
|
|
11
|
+
const input = {
|
|
12
|
+
Entries: [
|
|
13
|
+
{
|
|
14
|
+
EventBusName: eventBusName,
|
|
15
|
+
Source: source,
|
|
16
|
+
DetailType: eventType,
|
|
17
|
+
Detail: JSON.stringify(event),
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
};
|
|
21
|
+
const command = new client_eventbridge_1.PutEventsCommand(input);
|
|
22
|
+
try {
|
|
23
|
+
const result = await exports.client.send(command);
|
|
24
|
+
/* Check if there are any failed events */
|
|
25
|
+
if (result.FailedEntryCount) {
|
|
26
|
+
const errorDetail = result.Entries?.length
|
|
27
|
+
? `${result.Entries[0].ErrorCode}: ${result.Entries[0].ErrorMessage}}`
|
|
28
|
+
: "unknown";
|
|
29
|
+
throw new Error(`PutEventsCommand error ${errorDetail}`);
|
|
30
|
+
}
|
|
31
|
+
logger_1.logger.debug("sendEvent success", { input, result });
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
logger_1.logger.error("sendEvent error", { input, error });
|
|
35
|
+
throw error;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mockEventbridgeService = void 0;
|
|
4
|
+
exports.mockEventbridgeService = {
|
|
5
|
+
sendEvent: jest.fn(),
|
|
6
|
+
};
|
|
7
|
+
jest.mock("@tomassabol/aws-services/eventbridge", () => exports.mockEventbridgeService);
|
package/logger.d.ts
ADDED
package/logger.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.logger = void 0;
|
|
4
|
+
const logger_1 = require("@aws-lambda-powertools/logger");
|
|
5
|
+
const noLogger = {
|
|
6
|
+
log: () => undefined,
|
|
7
|
+
debug: () => undefined,
|
|
8
|
+
info: () => undefined,
|
|
9
|
+
error: () => undefined,
|
|
10
|
+
warn: () => undefined,
|
|
11
|
+
};
|
|
12
|
+
exports.logger = process.env.JEST_WORKER_ID === undefined || process.env.TEST_LOGGER
|
|
13
|
+
? new logger_1.Logger({ logLevel: "DEBUG" })
|
|
14
|
+
: noLogger;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tomassabol/aws-services",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "AWS Services",
|
|
6
6
|
"scripts": {
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@aws-sdk/util-stream-node": "^3.374.0",
|
|
30
|
-
"@tsconfig/
|
|
31
|
-
"@types/aws-sdk": "^2.7.
|
|
30
|
+
"@tsconfig/node22": "^22.0.2",
|
|
31
|
+
"@types/aws-sdk": "^2.7.4",
|
|
32
32
|
"@types/jest": "^29.4.0",
|
|
33
|
-
"@types/node": "^18.
|
|
33
|
+
"@types/node": "^22.18.12",
|
|
34
34
|
"@typescript-eslint/eslint-plugin": "^5.25.0",
|
|
35
35
|
"@typescript-eslint/parser": "^5.25.0",
|
|
36
36
|
"aws-sdk-client-mock": "^3.0.0",
|
|
@@ -48,16 +48,15 @@
|
|
|
48
48
|
"prettier": "^2.6.2",
|
|
49
49
|
"prettier-plugin-sh": "^0.12.8",
|
|
50
50
|
"rimraf": "^5.0.0",
|
|
51
|
-
"typedoc": "^0.
|
|
51
|
+
"typedoc": "^0.28.14",
|
|
52
52
|
"typedoc-plugin-markdown": "^3.14.0",
|
|
53
|
-
"typescript": "^5.
|
|
53
|
+
"typescript": "^5.9.3"
|
|
54
54
|
},
|
|
55
55
|
"jestSonar": {
|
|
56
56
|
"reportPath": ".sonar",
|
|
57
57
|
"reportFile": "test-report.xml"
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
,"publishConfig": {
|
|
58
|
+
},
|
|
59
|
+
"publishConfig": {
|
|
61
60
|
"access": "public"
|
|
62
61
|
}
|
|
63
62
|
}
|
package/s3.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { S3, PutObjectCommandOutput } from "@aws-sdk/client-s3";
|
|
2
|
+
export declare const client: S3;
|
|
3
|
+
export declare function putObjectToS3(params: {
|
|
4
|
+
bucket: string;
|
|
5
|
+
key: string;
|
|
6
|
+
body: string | Uint8Array | Buffer;
|
|
7
|
+
contentEncoding: string;
|
|
8
|
+
contentType: string;
|
|
9
|
+
}): Promise<PutObjectCommandOutput>;
|
|
10
|
+
export declare function getObjectFromS3(params: {
|
|
11
|
+
bucket: string;
|
|
12
|
+
key: string;
|
|
13
|
+
}): Promise<Uint8Array>;
|
package/s3.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.client = void 0;
|
|
4
|
+
exports.putObjectToS3 = putObjectToS3;
|
|
5
|
+
exports.getObjectFromS3 = getObjectFromS3;
|
|
6
|
+
const client_s3_1 = require("@aws-sdk/client-s3");
|
|
7
|
+
const logger_1 = require("./logger");
|
|
8
|
+
exports.client = new client_s3_1.S3({});
|
|
9
|
+
async function putObjectToS3(params) {
|
|
10
|
+
const { bucket, key, body, contentEncoding, contentType } = params;
|
|
11
|
+
try {
|
|
12
|
+
return await exports.client.putObject({
|
|
13
|
+
Bucket: bucket,
|
|
14
|
+
Key: key,
|
|
15
|
+
Body: body,
|
|
16
|
+
ContentEncoding: contentEncoding,
|
|
17
|
+
ContentType: contentType,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
logger_1.logger.error("putObjectToS3", {
|
|
22
|
+
error,
|
|
23
|
+
params: { bucket, key, contentEncoding, contentType },
|
|
24
|
+
});
|
|
25
|
+
throw error;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
async function getObjectFromS3(params) {
|
|
29
|
+
try {
|
|
30
|
+
const { bucket, key } = params;
|
|
31
|
+
const result = await exports.client.getObject({
|
|
32
|
+
Bucket: bucket,
|
|
33
|
+
Key: key,
|
|
34
|
+
});
|
|
35
|
+
const body = result.Body;
|
|
36
|
+
if (body === undefined) {
|
|
37
|
+
logger_1.logger.error("Body not found", { params });
|
|
38
|
+
throw new Error("Body not found");
|
|
39
|
+
}
|
|
40
|
+
return await body.transformToByteArray();
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
logger_1.logger.error("getObjectFromS3", { error, params });
|
|
44
|
+
throw error;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { SecretsManagerClient } from "@aws-sdk/client-secrets-manager";
|
|
2
|
+
export declare const client: SecretsManagerClient;
|
|
3
|
+
export declare function getSecret(secretName: string): Promise<string>;
|
|
4
|
+
export declare function getSecretAsObject<T = unknown>(secretName: string): Promise<T>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.client = void 0;
|
|
7
|
+
exports.getSecret = getSecret;
|
|
8
|
+
exports.getSecretAsObject = getSecretAsObject;
|
|
9
|
+
const client_secrets_manager_1 = require("@aws-sdk/client-secrets-manager");
|
|
10
|
+
const assert_1 = __importDefault(require("assert"));
|
|
11
|
+
const logger_1 = require("./logger");
|
|
12
|
+
exports.client = new client_secrets_manager_1.SecretsManagerClient({});
|
|
13
|
+
async function getSecret(secretName) {
|
|
14
|
+
try {
|
|
15
|
+
const response = await exports.client.send(new client_secrets_manager_1.GetSecretValueCommand({
|
|
16
|
+
SecretId: secretName,
|
|
17
|
+
}));
|
|
18
|
+
const value = response.SecretString;
|
|
19
|
+
(0, assert_1.default)(value, "SecretString value not found");
|
|
20
|
+
return value;
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
logger_1.logger.error("getSecret", { error, secretName });
|
|
24
|
+
// For a list of exceptions thrown, see
|
|
25
|
+
// https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html
|
|
26
|
+
throw error;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
async function getSecretAsObject(secretName) {
|
|
30
|
+
const value = await getSecret(secretName);
|
|
31
|
+
try {
|
|
32
|
+
return JSON.parse(value);
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
throw Error(`Cannot parse secret ${secretName}. Expected JSON.`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mockSecretsManagerService = void 0;
|
|
4
|
+
exports.mockSecretsManagerService = {
|
|
5
|
+
getSecret: jest.fn(),
|
|
6
|
+
getSecretAsObject: jest.fn(),
|
|
7
|
+
};
|
|
8
|
+
jest.mock("@tomassabol/aws-services/secrets-manager", () => exports.mockSecretsManagerService);
|
package/sns.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { SNSClient } from "@aws-sdk/client-sns";
|
|
2
|
+
export declare const snsClient: SNSClient;
|
|
3
|
+
export declare const publishMessageToSNS: (params: {
|
|
4
|
+
topicArn: string;
|
|
5
|
+
message: string;
|
|
6
|
+
options?: object;
|
|
7
|
+
}) => Promise<import("@aws-sdk/client-sns").PublishCommandOutput>;
|
package/sns.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.publishMessageToSNS = exports.snsClient = void 0;
|
|
4
|
+
const client_sns_1 = require("@aws-sdk/client-sns");
|
|
5
|
+
const logger_1 = require("./logger");
|
|
6
|
+
exports.snsClient = new client_sns_1.SNSClient({});
|
|
7
|
+
const publishMessageToSNS = async (params) => {
|
|
8
|
+
try {
|
|
9
|
+
const { topicArn, message, options } = params;
|
|
10
|
+
return await exports.snsClient.send(new client_sns_1.PublishCommand({
|
|
11
|
+
TopicArn: topicArn,
|
|
12
|
+
Message: message,
|
|
13
|
+
...options,
|
|
14
|
+
}));
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
logger_1.logger.error("publishMessageToSNS", { error, params });
|
|
18
|
+
throw error;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
exports.publishMessageToSNS = publishMessageToSNS;
|
package/sqs.d.ts
ADDED
package/sqs.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.client = void 0;
|
|
4
|
+
exports.sendSqsMessage = sendSqsMessage;
|
|
5
|
+
const client_sqs_1 = require("@aws-sdk/client-sqs");
|
|
6
|
+
const logger_1 = require("./logger");
|
|
7
|
+
exports.client = new client_sqs_1.SQSClient({});
|
|
8
|
+
async function sendSqsMessage(params) {
|
|
9
|
+
const { queueUrl, message } = params;
|
|
10
|
+
try {
|
|
11
|
+
const body = typeof message === "object" ? JSON.stringify(message) : message;
|
|
12
|
+
const input = {
|
|
13
|
+
QueueUrl: queueUrl,
|
|
14
|
+
MessageBody: body,
|
|
15
|
+
};
|
|
16
|
+
const command = new client_sqs_1.SendMessageCommand(input);
|
|
17
|
+
const response = await exports.client.send(command);
|
|
18
|
+
return response.MessageId;
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
logger_1.logger.error("sendSqsMessage", { error, params });
|
|
22
|
+
throw error;
|
|
23
|
+
}
|
|
24
|
+
}
|
package/sqs.mock.d.ts
ADDED
package/sqs.mock.js
ADDED
package/ssm.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SSMClient } from "@aws-sdk/client-ssm";
|
|
2
|
+
export declare const client: SSMClient;
|
|
3
|
+
export type SSMParameters = {
|
|
4
|
+
[name: string]: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Get a list of parameters from SSM Parameter Store
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const params = await getSsmParameters({
|
|
12
|
+
* first: "/my-params/first",
|
|
13
|
+
* second: "/my-params/second",
|
|
14
|
+
* })
|
|
15
|
+
*
|
|
16
|
+
* // params = { first: "value1", second: "value2" }
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare function getSsmParameters<T extends SSMParameters>(parameters: T): Promise<T>;
|
package/ssm.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.client = void 0;
|
|
4
|
+
exports.getSsmParameters = getSsmParameters;
|
|
5
|
+
const client_ssm_1 = require("@aws-sdk/client-ssm");
|
|
6
|
+
const assert = require("assert");
|
|
7
|
+
exports.client = new client_ssm_1.SSMClient({});
|
|
8
|
+
/**
|
|
9
|
+
* Get a list of parameters from SSM Parameter Store
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const params = await getSsmParameters({
|
|
14
|
+
* first: "/my-params/first",
|
|
15
|
+
* second: "/my-params/second",
|
|
16
|
+
* })
|
|
17
|
+
*
|
|
18
|
+
* // params = { first: "value1", second: "value2" }
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
async function getSsmParameters(parameters) {
|
|
22
|
+
/*
|
|
23
|
+
* Fetch parameters from SSM
|
|
24
|
+
*/
|
|
25
|
+
const command = new client_ssm_1.GetParametersCommand({
|
|
26
|
+
Names: Object.values(parameters),
|
|
27
|
+
});
|
|
28
|
+
const output = await exports.client.send(command);
|
|
29
|
+
/*
|
|
30
|
+
* Map returned parameters to result object
|
|
31
|
+
*/
|
|
32
|
+
const result = {};
|
|
33
|
+
output.Parameters?.forEach((outputParam) => {
|
|
34
|
+
assert(typeof outputParam.Value === "string", `Received invalid value of SSM parameter ${outputParam.Name}`);
|
|
35
|
+
const entry = Object.entries(parameters).find(([_key, value]) => value === outputParam.Name);
|
|
36
|
+
assert(entry, `Received invalid SSM parameter ${outputParam.Name}`);
|
|
37
|
+
const [key] = entry;
|
|
38
|
+
result[key] = outputParam.Value;
|
|
39
|
+
});
|
|
40
|
+
/*
|
|
41
|
+
* Check that all parameters were received
|
|
42
|
+
*/
|
|
43
|
+
const notFoundParams = Object.keys(parameters).filter((key) => false === Object.hasOwn(result, key));
|
|
44
|
+
if (notFoundParams.length > 0) {
|
|
45
|
+
throw new Error(`Cannot obtain SSM parameters: ${notFoundParams.join(", ")}`);
|
|
46
|
+
}
|
|
47
|
+
return result;
|
|
48
|
+
}
|
package/ssm.mock.d.ts
ADDED
package/ssm.mock.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["../src/appconfig.ts","../src/dynamodb.mock.ts","../src/dynamodb.ts","../src/eventbridge.mock.ts","../src/eventbridge.ts","../src/logger.ts","../src/s3.ts","../src/secrets-manager.mock.ts","../src/secrets-manager.ts","../src/sns.ts","../src/sqs.mock.ts","../src/sqs.ts","../src/ssm.mock.ts","../src/ssm.ts"],"version":"5.9.3"}
|
package/.eslintignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
dist
|
package/.eslintrc.json
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"root": true,
|
|
3
|
-
"env": {
|
|
4
|
-
"node": true
|
|
5
|
-
},
|
|
6
|
-
"overrides": [
|
|
7
|
-
{
|
|
8
|
-
"files": ["**/*.ts", "**/*.tsx"],
|
|
9
|
-
"parser": "@typescript-eslint/parser",
|
|
10
|
-
"parserOptions": {
|
|
11
|
-
"project": "./tsconfig.json"
|
|
12
|
-
},
|
|
13
|
-
"plugins": ["@typescript-eslint"],
|
|
14
|
-
"extends": [
|
|
15
|
-
"eslint:recommended",
|
|
16
|
-
"plugin:import/recommended",
|
|
17
|
-
"plugin:import/typescript",
|
|
18
|
-
"plugin:@typescript-eslint/eslint-recommended",
|
|
19
|
-
"plugin:@typescript-eslint/recommended",
|
|
20
|
-
"prettier"
|
|
21
|
-
],
|
|
22
|
-
"rules": {
|
|
23
|
-
"@typescript-eslint/no-empty-interface": "warn",
|
|
24
|
-
"@typescript-eslint/no-unused-vars": [
|
|
25
|
-
"warn",
|
|
26
|
-
{ "argsIgnorePattern": "^_" }
|
|
27
|
-
],
|
|
28
|
-
"@typescript-eslint/no-floating-promises": "error",
|
|
29
|
-
"require-await": "warn",
|
|
30
|
-
"no-useless-catch": "warn",
|
|
31
|
-
"no-console": "warn",
|
|
32
|
-
"no-new-object": "warn",
|
|
33
|
-
"object-shorthand": ["warn", "always"],
|
|
34
|
-
"quote-props": ["warn", "as-needed"],
|
|
35
|
-
"prefer-object-spread": "warn",
|
|
36
|
-
"prefer-destructuring": [
|
|
37
|
-
"warn",
|
|
38
|
-
{
|
|
39
|
-
"VariableDeclarator": {
|
|
40
|
-
"array": false,
|
|
41
|
-
"object": true
|
|
42
|
-
},
|
|
43
|
-
"AssignmentExpression": {
|
|
44
|
-
"array": false,
|
|
45
|
-
"object": false
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
],
|
|
49
|
-
"default-param-last": "warn",
|
|
50
|
-
"no-param-reassign": [
|
|
51
|
-
"warn",
|
|
52
|
-
{ "props": true, "ignorePropertyModificationsFor": ["acc"] }
|
|
53
|
-
],
|
|
54
|
-
"prefer-arrow-callback": "warn",
|
|
55
|
-
"no-duplicate-imports": "warn",
|
|
56
|
-
"import/no-mutable-exports": "warn",
|
|
57
|
-
"import/first": "warn",
|
|
58
|
-
"no-iterator": "warn",
|
|
59
|
-
"dot-notation": "warn",
|
|
60
|
-
"one-var": ["warn", { "initialized": "never" }],
|
|
61
|
-
"no-multi-assign": "warn",
|
|
62
|
-
"no-plusplus": ["warn", { "allowForLoopAfterthoughts": true }],
|
|
63
|
-
"eqeqeq": "warn"
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
"files": ["**/*.md"],
|
|
68
|
-
"extends": "plugin:markdown/recommended"
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"files": ["**/*.json"],
|
|
72
|
-
"extends": "plugin:json/recommended"
|
|
73
|
-
}
|
|
74
|
-
]
|
|
75
|
-
}
|
package/.husky/pre-commit
DELETED
package/.lintstagedrc.json
DELETED
package/.nvmrc
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
v18.18.2
|
package/.prettierignore
DELETED
package/.prettierrc.json
DELETED