@awsless/awsless 0.0.11 → 0.0.12
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/bin.cjs +7 -4
- package/dist/bin.js +7 -4
- package/dist/index.cjs +22 -20
- package/dist/index.d.ts +6 -6
- package/dist/index.js +18 -16
- package/package.json +1 -1
package/dist/bin.cjs
CHANGED
|
@@ -550,19 +550,22 @@ var rollupBuild = async (input) => {
|
|
|
550
550
|
(0, import_plugin_json.default)()
|
|
551
551
|
]
|
|
552
552
|
});
|
|
553
|
-
const
|
|
553
|
+
const result = await bundle.generate({
|
|
554
554
|
format: "esm",
|
|
555
555
|
sourcemap: "hidden",
|
|
556
556
|
exports: "default"
|
|
557
557
|
});
|
|
558
|
-
const
|
|
558
|
+
const output = result.output[0];
|
|
559
|
+
const code = output.code;
|
|
560
|
+
const map = output.map?.toString();
|
|
561
|
+
const hash = (0, import_crypto.createHash)("sha1").update(code).digest("hex");
|
|
559
562
|
return {
|
|
560
563
|
handler: "index.default",
|
|
561
564
|
hash,
|
|
562
565
|
files: [{
|
|
563
566
|
name: "index.mjs",
|
|
564
|
-
code
|
|
565
|
-
map
|
|
567
|
+
code,
|
|
568
|
+
map
|
|
566
569
|
}]
|
|
567
570
|
};
|
|
568
571
|
};
|
package/dist/bin.js
CHANGED
|
@@ -527,19 +527,22 @@ var rollupBuild = async (input) => {
|
|
|
527
527
|
json()
|
|
528
528
|
]
|
|
529
529
|
});
|
|
530
|
-
const
|
|
530
|
+
const result = await bundle.generate({
|
|
531
531
|
format: "esm",
|
|
532
532
|
sourcemap: "hidden",
|
|
533
533
|
exports: "default"
|
|
534
534
|
});
|
|
535
|
-
const
|
|
535
|
+
const output = result.output[0];
|
|
536
|
+
const code = output.code;
|
|
537
|
+
const map = output.map?.toString();
|
|
538
|
+
const hash = createHash("sha1").update(code).digest("hex");
|
|
536
539
|
return {
|
|
537
540
|
handler: "index.default",
|
|
538
541
|
hash,
|
|
539
542
|
files: [{
|
|
540
543
|
name: "index.mjs",
|
|
541
|
-
code
|
|
542
|
-
map
|
|
544
|
+
code,
|
|
545
|
+
map
|
|
543
546
|
}]
|
|
544
547
|
};
|
|
545
548
|
};
|
package/dist/index.cjs
CHANGED
|
@@ -20,12 +20,12 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/index.ts
|
|
21
21
|
var src_exports = {};
|
|
22
22
|
__export(src_exports, {
|
|
23
|
-
Queue: () => Queue,
|
|
24
|
-
Store: () => Store,
|
|
25
|
-
Table: () => Table,
|
|
26
23
|
definePlugin: () => definePlugin,
|
|
24
|
+
getFunctionName: () => getFunctionName,
|
|
25
|
+
getQueueName: () => getQueueName,
|
|
27
26
|
getResourceName: () => getResourceName,
|
|
28
|
-
|
|
27
|
+
getStoreName: () => getStoreName,
|
|
28
|
+
getTableName: () => getTableName
|
|
29
29
|
});
|
|
30
30
|
module.exports = __toCommonJS(src_exports);
|
|
31
31
|
|
|
@@ -33,30 +33,32 @@ module.exports = __toCommonJS(src_exports);
|
|
|
33
33
|
var definePlugin = (plugin) => plugin;
|
|
34
34
|
|
|
35
35
|
// src/node/resource.ts
|
|
36
|
-
var getResourceName = (type, id) => {
|
|
37
|
-
const key = `RESOURCE_${type.toUpperCase()}_${id}`;
|
|
36
|
+
var getResourceName = (type, id, stack = process.env.STACK || "default") => {
|
|
37
|
+
const key = `RESOURCE_${type.toUpperCase()}_${stack}_${id}`;
|
|
38
38
|
const value = process.env[key];
|
|
39
39
|
if (!value) {
|
|
40
|
-
throw new TypeError(`Resource type: "${type}" id: "${id}" doesn't exist.`);
|
|
40
|
+
throw new TypeError(`Resource type: "${type}" stack: "${stack}" id: "${id}" doesn't exist.`);
|
|
41
41
|
}
|
|
42
42
|
return value;
|
|
43
43
|
};
|
|
44
|
-
var
|
|
45
|
-
return
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
var getFunctionName = (id, stack) => {
|
|
45
|
+
return getResourceName("function", id, stack);
|
|
46
|
+
};
|
|
47
|
+
var getTableName = (id, stack) => {
|
|
48
|
+
return getResourceName("table", id, stack);
|
|
49
|
+
};
|
|
50
|
+
var getQueueName = (id, stack) => {
|
|
51
|
+
return getResourceName("queue", id, stack);
|
|
52
|
+
};
|
|
53
|
+
var getStoreName = (id, stack) => {
|
|
54
|
+
return getResourceName("store", id, stack);
|
|
50
55
|
};
|
|
51
|
-
var Table = /* @__PURE__ */ getResourceProxy("TABLE");
|
|
52
|
-
var Queue = /* @__PURE__ */ getResourceProxy("QUEUE");
|
|
53
|
-
var Store = /* @__PURE__ */ getResourceProxy("STORE");
|
|
54
56
|
// Annotate the CommonJS export names for ESM import in node:
|
|
55
57
|
0 && (module.exports = {
|
|
56
|
-
Queue,
|
|
57
|
-
Store,
|
|
58
|
-
Table,
|
|
59
58
|
definePlugin,
|
|
59
|
+
getFunctionName,
|
|
60
|
+
getQueueName,
|
|
60
61
|
getResourceName,
|
|
61
|
-
|
|
62
|
+
getStoreName,
|
|
63
|
+
getTableName
|
|
62
64
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -1361,13 +1361,13 @@ declare const defaultPlugins: (Plugin<zod.ZodObject<{
|
|
|
1361
1361
|
}>>)[];
|
|
1362
1362
|
type CombinedDefaultPluginsConfigInput = ExtendedConfigInput<typeof defaultPlugins[number]['schema']>;
|
|
1363
1363
|
|
|
1364
|
-
declare const getResourceName: (type: string, id: string) => string;
|
|
1365
|
-
declare const
|
|
1366
|
-
declare const
|
|
1367
|
-
declare const
|
|
1368
|
-
declare const
|
|
1364
|
+
declare const getResourceName: (type: string, id: string, stack?: string) => string;
|
|
1365
|
+
declare const getFunctionName: (id: string, stack?: string) => string;
|
|
1366
|
+
declare const getTableName: (id: string, stack?: string) => string;
|
|
1367
|
+
declare const getQueueName: (id: string, stack?: string) => string;
|
|
1368
|
+
declare const getStoreName: (id: string, stack?: string) => string;
|
|
1369
1369
|
|
|
1370
1370
|
type AppConfig = CombinedDefaultPluginsConfigInput;
|
|
1371
1371
|
type StackConfig = CombinedDefaultPluginsConfigInput['stacks'][number];
|
|
1372
1372
|
|
|
1373
|
-
export { AppConfig, Plugin,
|
|
1373
|
+
export { AppConfig, Plugin, StackConfig, definePlugin, getFunctionName, getQueueName, getResourceName, getStoreName, getTableName };
|
package/dist/index.js
CHANGED
|
@@ -3,29 +3,31 @@ import {
|
|
|
3
3
|
} from "./chunk-PFTL6L4F.js";
|
|
4
4
|
|
|
5
5
|
// src/node/resource.ts
|
|
6
|
-
var getResourceName = (type, id) => {
|
|
7
|
-
const key = `RESOURCE_${type.toUpperCase()}_${id}`;
|
|
6
|
+
var getResourceName = (type, id, stack = process.env.STACK || "default") => {
|
|
7
|
+
const key = `RESOURCE_${type.toUpperCase()}_${stack}_${id}`;
|
|
8
8
|
const value = process.env[key];
|
|
9
9
|
if (!value) {
|
|
10
|
-
throw new TypeError(`Resource type: "${type}" id: "${id}" doesn't exist.`);
|
|
10
|
+
throw new TypeError(`Resource type: "${type}" stack: "${stack}" id: "${id}" doesn't exist.`);
|
|
11
11
|
}
|
|
12
12
|
return value;
|
|
13
13
|
};
|
|
14
|
-
var
|
|
15
|
-
return
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
var getFunctionName = (id, stack) => {
|
|
15
|
+
return getResourceName("function", id, stack);
|
|
16
|
+
};
|
|
17
|
+
var getTableName = (id, stack) => {
|
|
18
|
+
return getResourceName("table", id, stack);
|
|
19
|
+
};
|
|
20
|
+
var getQueueName = (id, stack) => {
|
|
21
|
+
return getResourceName("queue", id, stack);
|
|
22
|
+
};
|
|
23
|
+
var getStoreName = (id, stack) => {
|
|
24
|
+
return getResourceName("store", id, stack);
|
|
20
25
|
};
|
|
21
|
-
var Table = /* @__PURE__ */ getResourceProxy("TABLE");
|
|
22
|
-
var Queue = /* @__PURE__ */ getResourceProxy("QUEUE");
|
|
23
|
-
var Store = /* @__PURE__ */ getResourceProxy("STORE");
|
|
24
26
|
export {
|
|
25
|
-
Queue,
|
|
26
|
-
Store,
|
|
27
|
-
Table,
|
|
28
27
|
definePlugin,
|
|
28
|
+
getFunctionName,
|
|
29
|
+
getQueueName,
|
|
29
30
|
getResourceName,
|
|
30
|
-
|
|
31
|
+
getStoreName,
|
|
32
|
+
getTableName
|
|
31
33
|
};
|