@aspan-corporation/ac-shared 0.0.3 → 0.0.6
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/README.md +8 -0
- package/lib/assertUtils.d.ts +2 -0
- package/lib/index.d.ts +6 -4
- package/lib/index.js +26 -0
- package/lib/logger.d.ts +4 -0
- package/package.json +5 -5
package/README.md
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
1
|
+
export * from "./plumbingMiddleware.js";
|
|
2
|
+
export * from "./sharedUtils.js";
|
|
3
|
+
export * from "./s3.js";
|
|
4
|
+
export * from "./dynamoDB.js";
|
|
5
|
+
export * from "./assertUtils.js";
|
|
6
|
+
export * from "./logger.js";
|
package/lib/index.js
CHANGED
|
@@ -242,15 +242,41 @@ var putCommand = async (putCommandInput, logger) => {
|
|
|
242
242
|
});
|
|
243
243
|
return putCommandOutput;
|
|
244
244
|
};
|
|
245
|
+
|
|
246
|
+
// src/assertUtils.ts
|
|
247
|
+
import assert3 from "node:assert/strict";
|
|
248
|
+
var assertEnvVar = (envVar) => {
|
|
249
|
+
assert3(process.env[envVar], `${envVar} is not set`);
|
|
250
|
+
return process.env[envVar];
|
|
251
|
+
};
|
|
252
|
+
var assertString = (value) => {
|
|
253
|
+
assert3(typeof value === "string", "Value is not a string");
|
|
254
|
+
assert3(value.length > 0, "Value is empty");
|
|
255
|
+
return value;
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
// src/logger.ts
|
|
259
|
+
import { Logger as Logger2 } from "@aws-lambda-powertools/logger";
|
|
260
|
+
var rootLogger = new Logger2();
|
|
261
|
+
var getLoggerWithScope = (scope) => {
|
|
262
|
+
const childLogger = rootLogger.createChild();
|
|
263
|
+
childLogger.appendKeys({ scope });
|
|
264
|
+
return childLogger;
|
|
265
|
+
};
|
|
245
266
|
export {
|
|
267
|
+
Logger2 as Logger,
|
|
268
|
+
assertEnvVar,
|
|
269
|
+
assertString,
|
|
246
270
|
createDynamoDBTable,
|
|
247
271
|
createS3DownloadStream,
|
|
248
272
|
createS3UploadStream,
|
|
249
273
|
deleteDynamoDBTable,
|
|
250
274
|
getCommand,
|
|
275
|
+
getLoggerWithScope,
|
|
251
276
|
getPersistenceStore,
|
|
252
277
|
plumbingMiddleware,
|
|
253
278
|
putCommand,
|
|
254
279
|
queryCommand,
|
|
280
|
+
rootLogger,
|
|
255
281
|
updateCommand
|
|
256
282
|
};
|
package/lib/logger.d.ts
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aspan-corporation/ac-shared",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"build:types": "tsc --emitDeclarationOnly --declaration"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@aws-lambda-powertools/idempotency": "^2.0
|
|
19
|
-
"@aws-lambda-powertools/logger": "^2.0
|
|
20
|
-
"@aws-lambda-powertools/metrics": "^2.0
|
|
21
|
-
"@aws-lambda-powertools/tracer": "^2.0
|
|
18
|
+
"@aws-lambda-powertools/idempotency": "^2.19.0",
|
|
19
|
+
"@aws-lambda-powertools/logger": "^2.19.0",
|
|
20
|
+
"@aws-lambda-powertools/metrics": "^2.19.0",
|
|
21
|
+
"@aws-lambda-powertools/tracer": "^2.19.0",
|
|
22
22
|
"@aws-sdk/client-dynamodb": "^3.549.0",
|
|
23
23
|
"@aws-sdk/client-s3": "^3.550.0",
|
|
24
24
|
"@aws-sdk/lib-dynamodb": "^3.549.0",
|