effortless-aws 0.7.2 → 0.8.1
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 +1 -1
- package/dist/{chunk-5L76NICW.js → chunk-B4P7ZKNM.js} +11 -7
- package/dist/cli/index.js +1333 -642
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +77 -70
- package/dist/index.js +14 -14
- package/dist/index.js.map +1 -1
- package/dist/runtime/wrap-app.js +3 -3
- package/dist/runtime/wrap-fifo-queue.js +2 -2
- package/dist/runtime/wrap-http.js +2 -2
- package/dist/runtime/wrap-table-stream.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# effortless-aws
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/effortless-aws)
|
|
4
|
-
[](https://www.npmjs.com/package/effortless-aws)
|
|
5
5
|
|
|
6
6
|
TypeScript framework for AWS serverless. Export handlers, deploy with one command. No YAML, no CloudFormation, no state files.
|
|
7
7
|
|
|
@@ -162,7 +162,7 @@ var buildParams = async (params) => {
|
|
|
162
162
|
for (const { propName, ssmPath } of entries) {
|
|
163
163
|
const raw = values.get(ssmPath) ?? "";
|
|
164
164
|
const ref = params[propName];
|
|
165
|
-
result[propName] = ref?.transform ? ref.transform(raw) : raw;
|
|
165
|
+
result[propName] = typeof ref === "object" && ref?.transform ? ref.transform(raw) : raw;
|
|
166
166
|
}
|
|
167
167
|
return result;
|
|
168
168
|
};
|
|
@@ -176,24 +176,28 @@ var createHandlerRuntime = (handler, handlerType, logLevel = "info") => {
|
|
|
176
176
|
const getDeps = () => resolvedDeps ??= buildDeps(handler.deps);
|
|
177
177
|
const getParams = async () => {
|
|
178
178
|
if (resolvedParams !== null) return resolvedParams;
|
|
179
|
-
resolvedParams = await buildParams(handler.
|
|
179
|
+
resolvedParams = await buildParams(handler.config);
|
|
180
180
|
return resolvedParams;
|
|
181
181
|
};
|
|
182
|
-
const
|
|
182
|
+
const getSetup = async () => {
|
|
183
183
|
if (ctx !== null) return ctx;
|
|
184
|
-
if (handler.
|
|
184
|
+
if (handler.setup) {
|
|
185
185
|
const params = await getParams();
|
|
186
|
-
|
|
186
|
+
const deps = getDeps();
|
|
187
|
+
const args = {};
|
|
188
|
+
if (params) args.config = params;
|
|
189
|
+
if (deps) args.deps = deps;
|
|
190
|
+
ctx = Object.keys(args).length > 0 ? await handler.setup(args) : await handler.setup();
|
|
187
191
|
}
|
|
188
192
|
return ctx;
|
|
189
193
|
};
|
|
190
194
|
const commonArgs = async () => {
|
|
191
195
|
const args = {};
|
|
192
|
-
if (handler.
|
|
196
|
+
if (handler.setup) args.ctx = await getSetup();
|
|
193
197
|
const deps = getDeps();
|
|
194
198
|
if (deps) args.deps = deps;
|
|
195
199
|
const params = await getParams();
|
|
196
|
-
if (params) args.
|
|
200
|
+
if (params) args.config = params;
|
|
197
201
|
if (handler.static) args.readStatic = readStatic;
|
|
198
202
|
return args;
|
|
199
203
|
};
|