ag-common 0.0.688 → 0.0.690
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.
|
@@ -51,25 +51,25 @@ const setupLambda = ({ lambdaConfig, pathV, verb, seenPermissions, authorizers,
|
|
|
51
51
|
seenPermissions.default = true;
|
|
52
52
|
}
|
|
53
53
|
//
|
|
54
|
-
const readTables = (0, array_1.distinctBy)([...((_b = (_a = def.dynamo) === null || _a === void 0 ? void 0 : _a.reads) !== null && _b !== void 0 ? _b : []), ...((_d = (_c = lp.dynamo) === null || _c === void 0 ? void 0 : _c.reads) !== null && _d !== void 0 ? _d : [])], (s) => s.tableName);
|
|
55
|
-
const writeTables = (0, array_1.distinctBy)([...((_f = (_e = def.dynamo) === null || _e === void 0 ? void 0 : _e.writes) !== null && _f !== void 0 ? _f : []), ...((_h = (_g = lp.dynamo) === null || _g === void 0 ? void 0 : _g.writes) !== null && _h !== void 0 ? _h : [])], (s) => s.tableName);
|
|
56
|
-
const policies = [...((_j = def.policies) !== null && _j !== void 0 ? _j : []), ...((_k = lp.policies) !== null && _k !== void 0 ? _k : [])].filter(array_1.notEmpty);
|
|
57
|
-
const layers = [...((_l = def.layers) !== null && _l !== void 0 ? _l : []), ...((_m = lp.layers) !== null && _m !== void 0 ? _m : [])].filter(array_1.notEmpty);
|
|
58
|
-
const memory = (_p = (_o = lp.memory) !== null && _o !== void 0 ? _o : def.memory) !== null && _p !== void 0 ? _p : 128;
|
|
54
|
+
const readTables = (0, array_1.distinctBy)([...((_b = (_a = def === null || def === void 0 ? void 0 : def.dynamo) === null || _a === void 0 ? void 0 : _a.reads) !== null && _b !== void 0 ? _b : []), ...((_d = (_c = lp === null || lp === void 0 ? void 0 : lp.dynamo) === null || _c === void 0 ? void 0 : _c.reads) !== null && _d !== void 0 ? _d : [])], (s) => s.tableName);
|
|
55
|
+
const writeTables = (0, array_1.distinctBy)([...((_f = (_e = def === null || def === void 0 ? void 0 : def.dynamo) === null || _e === void 0 ? void 0 : _e.writes) !== null && _f !== void 0 ? _f : []), ...((_h = (_g = lp === null || lp === void 0 ? void 0 : lp.dynamo) === null || _g === void 0 ? void 0 : _g.writes) !== null && _h !== void 0 ? _h : [])], (s) => s.tableName);
|
|
56
|
+
const policies = [...((_j = def === null || def === void 0 ? void 0 : def.policies) !== null && _j !== void 0 ? _j : []), ...((_k = lp === null || lp === void 0 ? void 0 : lp.policies) !== null && _k !== void 0 ? _k : [])].filter(array_1.notEmpty);
|
|
57
|
+
const layers = [...((_l = def === null || def === void 0 ? void 0 : def.layers) !== null && _l !== void 0 ? _l : []), ...((_m = lp === null || lp === void 0 ? void 0 : lp.layers) !== null && _m !== void 0 ? _m : [])].filter(array_1.notEmpty);
|
|
58
|
+
const memory = (_p = (_o = lp === null || lp === void 0 ? void 0 : lp.memory) !== null && _o !== void 0 ? _o : def === null || def === void 0 ? void 0 : def.memory) !== null && _p !== void 0 ? _p : 128;
|
|
59
59
|
// null forces undefined, undefined forces 5
|
|
60
|
-
let reservedConcurrentExecutions = lp.reservedConcurrentExecutions;
|
|
60
|
+
let reservedConcurrentExecutions = lp === null || lp === void 0 ? void 0 : lp.reservedConcurrentExecutions;
|
|
61
61
|
if (reservedConcurrentExecutions === undefined) {
|
|
62
|
-
reservedConcurrentExecutions = def.reservedConcurrentExecutions;
|
|
62
|
+
reservedConcurrentExecutions = def === null || def === void 0 ? void 0 : def.reservedConcurrentExecutions;
|
|
63
63
|
}
|
|
64
64
|
if (reservedConcurrentExecutions === undefined) {
|
|
65
65
|
reservedConcurrentExecutions = 5;
|
|
66
66
|
}
|
|
67
67
|
reservedConcurrentExecutions = reservedConcurrentExecutions !== null && reservedConcurrentExecutions !== void 0 ? reservedConcurrentExecutions : undefined;
|
|
68
68
|
//
|
|
69
|
-
const timeout = aws_cdk_lib_1.Duration.seconds((_r = (_q = lp.timeoutS) !== null && _q !== void 0 ? _q : def.timeoutS) !== null && _r !== void 0 ? _r : 30);
|
|
70
|
-
let authorizerName = lp.authorizerName;
|
|
69
|
+
const timeout = aws_cdk_lib_1.Duration.seconds((_r = (_q = lp === null || lp === void 0 ? void 0 : lp.timeoutS) !== null && _q !== void 0 ? _q : def === null || def === void 0 ? void 0 : def.timeoutS) !== null && _r !== void 0 ? _r : 30);
|
|
70
|
+
let authorizerName = lp === null || lp === void 0 ? void 0 : lp.authorizerName;
|
|
71
71
|
if (authorizerName === undefined) {
|
|
72
|
-
authorizerName = def.authorizerName;
|
|
72
|
+
authorizerName = def === null || def === void 0 ? void 0 : def.authorizerName;
|
|
73
73
|
}
|
|
74
74
|
if (authorizerName && (!authorizers || !authorizers[authorizerName])) {
|
|
75
75
|
throw new Error('unseen auth name:' + authorizerName);
|
|
@@ -77,7 +77,7 @@ const setupLambda = ({ lambdaConfig, pathV, verb, seenPermissions, authorizers,
|
|
|
77
77
|
const authorizer = !authorizerName
|
|
78
78
|
? undefined
|
|
79
79
|
: authorizers === null || authorizers === void 0 ? void 0 : authorizers[authorizerName];
|
|
80
|
-
const env = Object.assign(Object.assign({}, ((_s = def.env) !== null && _s !== void 0 ? _s : {})), ((_t = lp.env) !== null && _t !== void 0 ? _t : {}));
|
|
80
|
+
const env = Object.assign(Object.assign({}, ((_s = def === null || def === void 0 ? void 0 : def.env) !== null && _s !== void 0 ? _s : {})), ((_t = lp === null || lp === void 0 ? void 0 : lp.env) !== null && _t !== void 0 ? _t : {}));
|
|
81
81
|
const environment = env;
|
|
82
82
|
return {
|
|
83
83
|
environment,
|
|
@@ -41,11 +41,9 @@ export interface ILambdaConfig {
|
|
|
41
41
|
/**
|
|
42
42
|
* 'default' will be applied to all functions
|
|
43
43
|
*/
|
|
44
|
-
export
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
};
|
|
48
|
-
}
|
|
44
|
+
export type ILambdaConfigs = Partial<Record<string, ILambdaConfig & {
|
|
45
|
+
default?: ILambdaConfig;
|
|
46
|
+
}>>;
|
|
49
47
|
export type TSkOperator = 'BETWEEN' | '<' | '<=' | '=' | '>=' | '>' | '<>' | 'BEGINS_WITH';
|
|
50
48
|
export interface IQueryDynamo {
|
|
51
49
|
pkName: string;
|
|
@@ -3,7 +3,7 @@ export declare const GetLogLevel: (l: TLogType) => number;
|
|
|
3
3
|
export type TLogShim = (...args: unknown[]) => void;
|
|
4
4
|
/** if passed in, will use this instead of console.xxx */
|
|
5
5
|
export declare const SetLogShim: (ls: TLogShim) => void;
|
|
6
|
-
export declare const SetLogLevel: (l
|
|
6
|
+
export declare const SetLogLevel: (l?: TLogType) => void;
|
|
7
7
|
export declare const debug: (...args: unknown[]) => void;
|
|
8
8
|
export declare const info: (...args: unknown[]) => void;
|
|
9
9
|
export declare const warn: (...args: unknown[]) => void;
|
|
@@ -14,7 +14,7 @@ const SetLogShim = (ls) => {
|
|
|
14
14
|
exports.SetLogShim = SetLogShim;
|
|
15
15
|
let userLogLevel;
|
|
16
16
|
const SetLogLevel = (l) => {
|
|
17
|
-
const lu = l.toUpperCase();
|
|
17
|
+
const lu = (l !== null && l !== void 0 ? l : 'INFO').toUpperCase();
|
|
18
18
|
if ((0, exports.GetLogLevel)(lu) === -1) {
|
|
19
19
|
return;
|
|
20
20
|
}
|
package/package.json
CHANGED