@awsless/awsless 0.0.477 → 0.0.478
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.js +94 -101
- package/dist/prebuild/rpc/bundle.zip +0 -0
- package/package.json +12 -12
package/dist/bin.js
CHANGED
|
@@ -1393,9 +1393,9 @@ var SitesSchema = z29.record(
|
|
|
1393
1393
|
// src/feature/store/schema.ts
|
|
1394
1394
|
import { z as z30 } from "zod";
|
|
1395
1395
|
var StoresSchema = z30.union([
|
|
1396
|
-
z30.array(ResourceIdSchema).transform((
|
|
1396
|
+
z30.array(ResourceIdSchema).transform((list4) => {
|
|
1397
1397
|
const stores = {};
|
|
1398
|
-
for (const key of
|
|
1398
|
+
for (const key of list4) {
|
|
1399
1399
|
stores[key] = {};
|
|
1400
1400
|
}
|
|
1401
1401
|
return stores;
|
|
@@ -1854,11 +1854,11 @@ var authFeature = defineFeature({
|
|
|
1854
1854
|
name: "auth",
|
|
1855
1855
|
async onTypeGen(ctx) {
|
|
1856
1856
|
const gen = new TypeFile("@awsless/awsless");
|
|
1857
|
-
const
|
|
1857
|
+
const resources2 = new TypeObject(1);
|
|
1858
1858
|
for (const name of Object.keys(ctx.appConfig.defaults.auth)) {
|
|
1859
|
-
|
|
1859
|
+
resources2.addType(name, `{ readonly userPoolId: string, readonly clientId: string }`);
|
|
1860
1860
|
}
|
|
1861
|
-
gen.addInterface("AuthResources",
|
|
1861
|
+
gen.addInterface("AuthResources", resources2);
|
|
1862
1862
|
await ctx.write("auth.d.ts", gen, true);
|
|
1863
1863
|
},
|
|
1864
1864
|
// onStack(ctx) {
|
|
@@ -1988,7 +1988,7 @@ var authFeature = defineFeature({
|
|
|
1988
1988
|
deletionProtection: "ACTIVE"
|
|
1989
1989
|
},
|
|
1990
1990
|
{
|
|
1991
|
-
retainOnDelete:
|
|
1991
|
+
retainOnDelete: ctx.appConfig.removal === "retain",
|
|
1992
1992
|
import: ctx.import ? name : void 0
|
|
1993
1993
|
}
|
|
1994
1994
|
);
|
|
@@ -2037,16 +2037,16 @@ var cacheFeature = defineFeature({
|
|
|
2037
2037
|
name: "cache",
|
|
2038
2038
|
async onTypeGen(ctx) {
|
|
2039
2039
|
const gen = new TypeFile("@awsless/awsless");
|
|
2040
|
-
const
|
|
2040
|
+
const resources2 = new TypeObject(1);
|
|
2041
2041
|
for (const stack of ctx.stackConfigs) {
|
|
2042
|
-
const
|
|
2042
|
+
const resource = new TypeObject(2);
|
|
2043
2043
|
for (const name of Object.keys(stack.caches || {})) {
|
|
2044
|
-
|
|
2044
|
+
resource.addType(name, `Command`);
|
|
2045
2045
|
}
|
|
2046
|
-
|
|
2046
|
+
resources2.addType(stack.name, resource);
|
|
2047
2047
|
}
|
|
2048
2048
|
gen.addCode(typeGenCode);
|
|
2049
|
-
gen.addInterface("CacheResources",
|
|
2049
|
+
gen.addInterface("CacheResources", resources2);
|
|
2050
2050
|
await ctx.write("cache.d.ts", gen, true);
|
|
2051
2051
|
},
|
|
2052
2052
|
onStack(ctx) {
|
|
@@ -2281,13 +2281,13 @@ var configFeature = defineFeature({
|
|
|
2281
2281
|
name: "config",
|
|
2282
2282
|
async onTypeGen(ctx) {
|
|
2283
2283
|
const gen = new TypeFile("@awsless/awsless");
|
|
2284
|
-
const
|
|
2284
|
+
const resources2 = new TypeObject(0, false);
|
|
2285
2285
|
for (const stack of ctx.stackConfigs) {
|
|
2286
2286
|
for (const name of stack.configs ?? []) {
|
|
2287
|
-
|
|
2287
|
+
resources2.addConst(name, "string");
|
|
2288
2288
|
}
|
|
2289
2289
|
}
|
|
2290
|
-
gen.addInterface("ConfigResources",
|
|
2290
|
+
gen.addInterface("ConfigResources", resources2.toString());
|
|
2291
2291
|
await ctx.write("config.d.ts", gen, true);
|
|
2292
2292
|
},
|
|
2293
2293
|
onApp(ctx) {
|
|
@@ -2541,9 +2541,9 @@ var createHashFromFile = (file) => {
|
|
|
2541
2541
|
stream.on("end", () => resolve(hash.digest("hex")));
|
|
2542
2542
|
});
|
|
2543
2543
|
};
|
|
2544
|
-
var listAllFiles = async (
|
|
2544
|
+
var listAllFiles = async (list4) => {
|
|
2545
2545
|
const files = [];
|
|
2546
|
-
for (const entry of
|
|
2546
|
+
for (const entry of list4) {
|
|
2547
2547
|
const stat5 = await lstat2(entry);
|
|
2548
2548
|
if (stat5.isDirectory()) {
|
|
2549
2549
|
const dirents = await readdir(entry, {
|
|
@@ -2602,11 +2602,11 @@ import { readdir as readdir3 } from "node:fs/promises";
|
|
|
2602
2602
|
import { join as join9, relative as relative2 } from "node:path";
|
|
2603
2603
|
var zipBundle = async ({ directory }) => {
|
|
2604
2604
|
const zip = new JSZip2();
|
|
2605
|
-
const
|
|
2605
|
+
const list4 = await readdir3(directory, {
|
|
2606
2606
|
recursive: true,
|
|
2607
2607
|
withFileTypes: true
|
|
2608
2608
|
});
|
|
2609
|
-
for (const file of
|
|
2609
|
+
for (const file of list4) {
|
|
2610
2610
|
if (file.isFile()) {
|
|
2611
2611
|
const path = join9(file.path, file.name);
|
|
2612
2612
|
const rel = relative2(directory, path);
|
|
@@ -2747,11 +2747,11 @@ var createLambdaFunction = (group, ctx, ns, id, local) => {
|
|
|
2747
2747
|
role: role.name,
|
|
2748
2748
|
name: "lambda-policy",
|
|
2749
2749
|
policy: new Future(async (resolve) => {
|
|
2750
|
-
const
|
|
2750
|
+
const list4 = await resolveInputs(statements);
|
|
2751
2751
|
resolve(
|
|
2752
2752
|
JSON.stringify({
|
|
2753
2753
|
Version: "2012-10-17",
|
|
2754
|
-
Statement:
|
|
2754
|
+
Statement: list4.map((statement) => ({
|
|
2755
2755
|
Effect: pascalCase(statement.effect ?? "allow"),
|
|
2756
2756
|
Action: statement.actions,
|
|
2757
2757
|
Resource: statement.resources
|
|
@@ -3196,11 +3196,11 @@ var functionFeature = defineFeature({
|
|
|
3196
3196
|
name: "function",
|
|
3197
3197
|
async onTypeGen(ctx) {
|
|
3198
3198
|
const types2 = new TypeFile("@awsless/awsless");
|
|
3199
|
-
const
|
|
3199
|
+
const resources2 = new TypeObject(1);
|
|
3200
3200
|
const mocks = new TypeObject(1);
|
|
3201
3201
|
const mockResponses = new TypeObject(1);
|
|
3202
3202
|
for (const stack of ctx.stackConfigs) {
|
|
3203
|
-
const
|
|
3203
|
+
const resource = new TypeObject(2);
|
|
3204
3204
|
const mock = new TypeObject(2);
|
|
3205
3205
|
const mockResponse = new TypeObject(2);
|
|
3206
3206
|
for (const [name, local] of Object.entries(stack.functions || {})) {
|
|
@@ -3215,23 +3215,23 @@ var functionFeature = defineFeature({
|
|
|
3215
3215
|
if ("file" in local.code) {
|
|
3216
3216
|
const relFile = relative3(directories.types, local.code.file);
|
|
3217
3217
|
if (props.runtime === "container") {
|
|
3218
|
-
|
|
3218
|
+
resource.addType(name, `Invoke<'${funcName}', Func>`);
|
|
3219
3219
|
mock.addType(name, `MockBuilder<Func>`);
|
|
3220
3220
|
mockResponse.addType(name, `MockObject<Func>`);
|
|
3221
3221
|
} else {
|
|
3222
3222
|
types2.addImport(varName, relFile);
|
|
3223
|
-
|
|
3223
|
+
resource.addType(name, `Invoke<'${funcName}', typeof ${varName}>`);
|
|
3224
3224
|
mock.addType(name, `MockBuilder<typeof ${varName}>`);
|
|
3225
3225
|
mockResponse.addType(name, `MockObject<typeof ${varName}>`);
|
|
3226
3226
|
}
|
|
3227
3227
|
}
|
|
3228
3228
|
}
|
|
3229
3229
|
mocks.addType(stack.name, mock);
|
|
3230
|
-
|
|
3230
|
+
resources2.addType(stack.name, resource);
|
|
3231
3231
|
mockResponses.addType(stack.name, mockResponse);
|
|
3232
3232
|
}
|
|
3233
3233
|
types2.addCode(typeGenCode2);
|
|
3234
|
-
types2.addInterface("FunctionResources",
|
|
3234
|
+
types2.addInterface("FunctionResources", resources2);
|
|
3235
3235
|
types2.addInterface("FunctionMock", mocks);
|
|
3236
3236
|
types2.addInterface("FunctionMockResponse", mockResponses);
|
|
3237
3237
|
await ctx.write("function.d.ts", types2, true);
|
|
@@ -3508,11 +3508,11 @@ var queueFeature = defineFeature({
|
|
|
3508
3508
|
name: "queue",
|
|
3509
3509
|
async onTypeGen(ctx) {
|
|
3510
3510
|
const gen = new TypeFile("@awsless/awsless");
|
|
3511
|
-
const
|
|
3511
|
+
const resources2 = new TypeObject(1);
|
|
3512
3512
|
const mocks = new TypeObject(1);
|
|
3513
3513
|
const mockResponses = new TypeObject(1);
|
|
3514
3514
|
for (const stack of ctx.stackConfigs) {
|
|
3515
|
-
const
|
|
3515
|
+
const resource = new TypeObject(2);
|
|
3516
3516
|
const mock = new TypeObject(2);
|
|
3517
3517
|
const mockResponse = new TypeObject(2);
|
|
3518
3518
|
for (const [name, props] of Object.entries(stack.queues || {})) {
|
|
@@ -3527,16 +3527,16 @@ var queueFeature = defineFeature({
|
|
|
3527
3527
|
const relFile = relative4(directories.types, props.consumer.code.file);
|
|
3528
3528
|
gen.addImport(varName, relFile);
|
|
3529
3529
|
mock.addType(name, `MockBuilder<typeof ${varName}>`);
|
|
3530
|
-
|
|
3530
|
+
resource.addType(name, `Send<'${queueName}', typeof ${varName}>`);
|
|
3531
3531
|
mockResponse.addType(name, `MockObject<typeof ${varName}>`);
|
|
3532
3532
|
}
|
|
3533
3533
|
}
|
|
3534
3534
|
mocks.addType(stack.name, mock);
|
|
3535
|
-
|
|
3535
|
+
resources2.addType(stack.name, resource);
|
|
3536
3536
|
mockResponses.addType(stack.name, mockResponse);
|
|
3537
3537
|
}
|
|
3538
3538
|
gen.addCode(typeGenCode3);
|
|
3539
|
-
gen.addInterface("QueueResources",
|
|
3539
|
+
gen.addInterface("QueueResources", resources2);
|
|
3540
3540
|
gen.addInterface("QueueMock", mocks);
|
|
3541
3541
|
gen.addInterface("QueueMockResponse", mockResponses);
|
|
3542
3542
|
await ctx.write("queue.d.ts", gen, true);
|
|
@@ -3784,11 +3784,11 @@ var createPrebuildLambdaFunction = (group, ctx, ns, id, props) => {
|
|
|
3784
3784
|
role: role.name,
|
|
3785
3785
|
name: "lambda-policy",
|
|
3786
3786
|
policy: new Future2(async (resolve) => {
|
|
3787
|
-
const
|
|
3787
|
+
const list4 = await resolveInputs2(statements);
|
|
3788
3788
|
resolve(
|
|
3789
3789
|
JSON.stringify({
|
|
3790
3790
|
Version: "2012-10-17",
|
|
3791
|
-
Statement:
|
|
3791
|
+
Statement: list4.map((statement) => ({
|
|
3792
3792
|
Effect: pascalCase2(statement.effect ?? "allow"),
|
|
3793
3793
|
Action: statement.actions,
|
|
3794
3794
|
Resource: statement.resources
|
|
@@ -3925,15 +3925,15 @@ var rpcFeature = defineFeature({
|
|
|
3925
3925
|
}
|
|
3926
3926
|
for (const stack of ctx.stackConfigs) {
|
|
3927
3927
|
for (const [id, queries] of Object.entries(stack.rpc ?? {})) {
|
|
3928
|
-
const
|
|
3929
|
-
if (!
|
|
3928
|
+
const list4 = names[id];
|
|
3929
|
+
if (!list4) {
|
|
3930
3930
|
throw new FileError(stack.file, `The RPC API for "${id}" isn't defined on app level.`);
|
|
3931
3931
|
}
|
|
3932
3932
|
for (const [name, props] of Object.entries(queries ?? {})) {
|
|
3933
|
-
if (
|
|
3933
|
+
if (list4.has(name)) {
|
|
3934
3934
|
throw new FileError(stack.file, `Duplicate RPC API function "${id}.${name}"`);
|
|
3935
3935
|
} else {
|
|
3936
|
-
|
|
3936
|
+
list4.add(name);
|
|
3937
3937
|
}
|
|
3938
3938
|
const timeout = toSeconds5(props.timeout ?? ctx.appConfig.defaults.function.timeout);
|
|
3939
3939
|
const maxTimeout = toSeconds5(ctx.appConfig.defaults.rpc[id].timeout) * 0.8;
|
|
@@ -4191,16 +4191,16 @@ var searchFeature = defineFeature({
|
|
|
4191
4191
|
name: "search",
|
|
4192
4192
|
async onTypeGen(ctx) {
|
|
4193
4193
|
const gen = new TypeFile("@awsless/awsless");
|
|
4194
|
-
const
|
|
4194
|
+
const resources2 = new TypeObject(1);
|
|
4195
4195
|
for (const stack of ctx.stackConfigs) {
|
|
4196
|
-
const
|
|
4196
|
+
const list4 = new TypeObject(2);
|
|
4197
4197
|
for (const id of Object.keys(stack.searchs ?? {})) {
|
|
4198
|
-
|
|
4198
|
+
list4.addType(id, `Search`);
|
|
4199
4199
|
}
|
|
4200
|
-
|
|
4200
|
+
resources2.addType(stack.name, list4);
|
|
4201
4201
|
}
|
|
4202
4202
|
gen.addCode(typeGenCode4);
|
|
4203
|
-
gen.addInterface("SearchResources",
|
|
4203
|
+
gen.addInterface("SearchResources", resources2);
|
|
4204
4204
|
await ctx.write("search.d.ts", gen, true);
|
|
4205
4205
|
},
|
|
4206
4206
|
onStack(ctx) {
|
|
@@ -4690,9 +4690,9 @@ var storeFeature = defineFeature({
|
|
|
4690
4690
|
name: "store",
|
|
4691
4691
|
async onTypeGen(ctx) {
|
|
4692
4692
|
const gen = new TypeFile("@awsless/awsless");
|
|
4693
|
-
const
|
|
4693
|
+
const resources2 = new TypeObject(1);
|
|
4694
4694
|
for (const stack of ctx.stackConfigs) {
|
|
4695
|
-
const
|
|
4695
|
+
const list4 = new TypeObject(2);
|
|
4696
4696
|
for (const id of Object.keys(stack.stores ?? {})) {
|
|
4697
4697
|
const storeName = formatLocalResourceName({
|
|
4698
4698
|
appName: ctx.appConfig.name,
|
|
@@ -4700,12 +4700,12 @@ var storeFeature = defineFeature({
|
|
|
4700
4700
|
resourceType: "store",
|
|
4701
4701
|
resourceName: id
|
|
4702
4702
|
});
|
|
4703
|
-
|
|
4703
|
+
list4.addType(id, `Store<'${storeName}'>`);
|
|
4704
4704
|
}
|
|
4705
|
-
|
|
4705
|
+
resources2.addType(stack.name, list4);
|
|
4706
4706
|
}
|
|
4707
4707
|
gen.addCode(typeGenCode5);
|
|
4708
|
-
gen.addInterface("StoreResources",
|
|
4708
|
+
gen.addInterface("StoreResources", resources2);
|
|
4709
4709
|
await ctx.write("store.d.ts", gen, true);
|
|
4710
4710
|
},
|
|
4711
4711
|
onApp(ctx) {
|
|
@@ -4829,9 +4829,9 @@ var tableFeature = defineFeature({
|
|
|
4829
4829
|
name: "table",
|
|
4830
4830
|
async onTypeGen(ctx) {
|
|
4831
4831
|
const gen = new TypeFile("@awsless/awsless");
|
|
4832
|
-
const
|
|
4832
|
+
const resources2 = new TypeObject(1);
|
|
4833
4833
|
for (const stack of ctx.stackConfigs) {
|
|
4834
|
-
const
|
|
4834
|
+
const list4 = new TypeObject(2);
|
|
4835
4835
|
for (const name of Object.keys(stack.tables || {})) {
|
|
4836
4836
|
const tableName = formatLocalResourceName({
|
|
4837
4837
|
appName: ctx.appConfig.name,
|
|
@@ -4839,11 +4839,11 @@ var tableFeature = defineFeature({
|
|
|
4839
4839
|
resourceType: "table",
|
|
4840
4840
|
resourceName: name
|
|
4841
4841
|
});
|
|
4842
|
-
|
|
4842
|
+
list4.addType(name, `'${tableName}'`);
|
|
4843
4843
|
}
|
|
4844
|
-
|
|
4844
|
+
resources2.addType(stack.name, list4);
|
|
4845
4845
|
}
|
|
4846
|
-
gen.addInterface("TableResources",
|
|
4846
|
+
gen.addInterface("TableResources", resources2);
|
|
4847
4847
|
await ctx.write("table.d.ts", gen, true);
|
|
4848
4848
|
},
|
|
4849
4849
|
onApp(ctx) {
|
|
@@ -5028,11 +5028,11 @@ var taskFeature = defineFeature({
|
|
|
5028
5028
|
name: "task",
|
|
5029
5029
|
async onTypeGen(ctx) {
|
|
5030
5030
|
const types2 = new TypeFile("@awsless/awsless");
|
|
5031
|
-
const
|
|
5031
|
+
const resources2 = new TypeObject(1);
|
|
5032
5032
|
const mocks = new TypeObject(1);
|
|
5033
5033
|
const mockResponses = new TypeObject(1);
|
|
5034
5034
|
for (const stack of ctx.stackConfigs) {
|
|
5035
|
-
const
|
|
5035
|
+
const resource = new TypeObject(2);
|
|
5036
5036
|
const mock = new TypeObject(2);
|
|
5037
5037
|
const mockResponse = new TypeObject(2);
|
|
5038
5038
|
for (const [name, props] of Object.entries(stack.tasks || {})) {
|
|
@@ -5046,17 +5046,17 @@ var taskFeature = defineFeature({
|
|
|
5046
5046
|
if ("file" in props.consumer.code) {
|
|
5047
5047
|
const relFile = relative6(directories.types, props.consumer.code.file);
|
|
5048
5048
|
types2.addImport(varName, relFile);
|
|
5049
|
-
|
|
5049
|
+
resource.addType(name, `Invoke<'${funcName}', typeof ${varName}>`);
|
|
5050
5050
|
mock.addType(name, `MockBuilder<typeof ${varName}>`);
|
|
5051
5051
|
mockResponse.addType(name, `MockObject<typeof ${varName}>`);
|
|
5052
5052
|
}
|
|
5053
5053
|
}
|
|
5054
5054
|
mocks.addType(stack.name, mock);
|
|
5055
|
-
|
|
5055
|
+
resources2.addType(stack.name, resource);
|
|
5056
5056
|
mockResponses.addType(stack.name, mockResponse);
|
|
5057
5057
|
}
|
|
5058
5058
|
types2.addCode(typeGenCode6);
|
|
5059
|
-
types2.addInterface("TaskResources",
|
|
5059
|
+
types2.addInterface("TaskResources", resources2);
|
|
5060
5060
|
types2.addInterface("TaskMock", mocks);
|
|
5061
5061
|
types2.addInterface("TaskMockResponse", mockResponses);
|
|
5062
5062
|
await ctx.write("task.d.ts", types2, true);
|
|
@@ -5096,7 +5096,7 @@ var topicFeature = defineFeature({
|
|
|
5096
5096
|
name: "topic",
|
|
5097
5097
|
async onTypeGen(ctx) {
|
|
5098
5098
|
const gen = new TypeFile("@awsless/awsless");
|
|
5099
|
-
const
|
|
5099
|
+
const resources2 = new TypeObject(1);
|
|
5100
5100
|
const mocks = new TypeObject(1);
|
|
5101
5101
|
const mockResponses = new TypeObject(1);
|
|
5102
5102
|
for (const stack of ctx.stackConfigs) {
|
|
@@ -5107,12 +5107,12 @@ var topicFeature = defineFeature({
|
|
|
5107
5107
|
resourceName: topic
|
|
5108
5108
|
});
|
|
5109
5109
|
mockResponses.addType(topic, "Mock");
|
|
5110
|
-
|
|
5110
|
+
resources2.addType(topic, `Publish<'${name}'>`);
|
|
5111
5111
|
mocks.addType(topic, `MockBuilder`);
|
|
5112
5112
|
}
|
|
5113
5113
|
}
|
|
5114
5114
|
gen.addCode(typeGenCode7);
|
|
5115
|
-
gen.addInterface("TopicResources",
|
|
5115
|
+
gen.addInterface("TopicResources", resources2);
|
|
5116
5116
|
gen.addInterface("TopicMock", mocks);
|
|
5117
5117
|
gen.addInterface("TopicMockResponse", mockResponses);
|
|
5118
5118
|
await ctx.write("topic.d.ts", gen, true);
|
|
@@ -5282,7 +5282,7 @@ var alertFeature = defineFeature({
|
|
|
5282
5282
|
name: "alert",
|
|
5283
5283
|
async onTypeGen(ctx) {
|
|
5284
5284
|
const gen = new TypeFile("@awsless/awsless");
|
|
5285
|
-
const
|
|
5285
|
+
const resources2 = new TypeObject(1);
|
|
5286
5286
|
const mocks = new TypeObject(1);
|
|
5287
5287
|
const mockResponses = new TypeObject(1);
|
|
5288
5288
|
for (const alert of Object.keys(ctx.appConfig.defaults.alerts ?? {})) {
|
|
@@ -5291,12 +5291,12 @@ var alertFeature = defineFeature({
|
|
|
5291
5291
|
resourceType: "alert",
|
|
5292
5292
|
resourceName: alert
|
|
5293
5293
|
});
|
|
5294
|
-
|
|
5294
|
+
resources2.addType(alert, `Alert<'${name}'>`);
|
|
5295
5295
|
mockResponses.addType(alert, "Mock");
|
|
5296
5296
|
mocks.addType(alert, `MockBuilder`);
|
|
5297
5297
|
}
|
|
5298
5298
|
gen.addCode(typeGenCode8);
|
|
5299
|
-
gen.addInterface("AlertResources",
|
|
5299
|
+
gen.addInterface("AlertResources", resources2);
|
|
5300
5300
|
gen.addInterface("AlertMock", mocks);
|
|
5301
5301
|
gen.addInterface("AlertMockResponse", mockResponses);
|
|
5302
5302
|
await ctx.write("alert.d.ts", gen, true);
|
|
@@ -5801,7 +5801,7 @@ var createApp = (props) => {
|
|
|
5801
5801
|
region: props.appConfig.region,
|
|
5802
5802
|
appName: props.appConfig.name
|
|
5803
5803
|
});
|
|
5804
|
-
const
|
|
5804
|
+
const commands7 = [];
|
|
5805
5805
|
const configs = /* @__PURE__ */ new Set();
|
|
5806
5806
|
const tests = [];
|
|
5807
5807
|
const builders = [];
|
|
@@ -5861,7 +5861,7 @@ var createApp = (props) => {
|
|
|
5861
5861
|
});
|
|
5862
5862
|
},
|
|
5863
5863
|
registerCommand(command) {
|
|
5864
|
-
|
|
5864
|
+
commands7.push(command);
|
|
5865
5865
|
},
|
|
5866
5866
|
registerDomainZone(zone) {
|
|
5867
5867
|
domainZones.push(zone);
|
|
@@ -5953,7 +5953,7 @@ var createApp = (props) => {
|
|
|
5953
5953
|
configs.add(name);
|
|
5954
5954
|
},
|
|
5955
5955
|
registerCommand(command) {
|
|
5956
|
-
|
|
5956
|
+
commands7.push(command);
|
|
5957
5957
|
},
|
|
5958
5958
|
registerDomainZone(zone) {
|
|
5959
5959
|
domainZones.push(zone);
|
|
@@ -6041,7 +6041,7 @@ var createApp = (props) => {
|
|
|
6041
6041
|
shared,
|
|
6042
6042
|
configs,
|
|
6043
6043
|
builders,
|
|
6044
|
-
commands:
|
|
6044
|
+
commands: commands7
|
|
6045
6045
|
// deploymentLine,
|
|
6046
6046
|
};
|
|
6047
6047
|
};
|
|
@@ -6798,7 +6798,7 @@ import { log as log10, note as note3 } from "@clack/prompts";
|
|
|
6798
6798
|
import { constantCase as constantCase12 } from "change-case";
|
|
6799
6799
|
import { spawn } from "child_process";
|
|
6800
6800
|
var bind = (program2) => {
|
|
6801
|
-
program2.command("bind").argument("[command...]", "The command to execute").option("--config <string...>", "List of config values that will be accessable", (v) => v.split(",")).description(`Bind your site environment variables to a command`).action(async (
|
|
6801
|
+
program2.command("bind").argument("[command...]", "The command to execute").option("--config <string...>", "List of config values that will be accessable", (v) => v.split(",")).description(`Bind your site environment variables to a command`).action(async (commands7 = [], opts) => {
|
|
6802
6802
|
await layout("bind", async ({ appConfig, stackConfigs }) => {
|
|
6803
6803
|
const region = appConfig.region;
|
|
6804
6804
|
const profile = appConfig.profile;
|
|
@@ -6829,10 +6829,10 @@ var bind = (program2) => {
|
|
|
6829
6829
|
if (configList.length ?? 0 > 0) {
|
|
6830
6830
|
note3(wrap(configList.map((v) => color.label(constantCase12(v)))), "Bind Config");
|
|
6831
6831
|
}
|
|
6832
|
-
if (
|
|
6832
|
+
if (commands7.length === 0) {
|
|
6833
6833
|
return "No command to execute.";
|
|
6834
6834
|
}
|
|
6835
|
-
const command =
|
|
6835
|
+
const command = commands7.join(" ");
|
|
6836
6836
|
const freshCred = await credentials();
|
|
6837
6837
|
spawn(command, {
|
|
6838
6838
|
env: {
|
|
@@ -6943,13 +6943,13 @@ var dev = (program2) => {
|
|
|
6943
6943
|
});
|
|
6944
6944
|
};
|
|
6945
6945
|
|
|
6946
|
-
// src/cli/command/
|
|
6946
|
+
// src/cli/command/resources.ts
|
|
6947
6947
|
import { log as log12 } from "@clack/prompts";
|
|
6948
6948
|
import chalk6 from "chalk";
|
|
6949
6949
|
import wildstring5 from "wildstring";
|
|
6950
|
-
var
|
|
6951
|
-
program2.command("
|
|
6952
|
-
await layout("
|
|
6950
|
+
var resources = (program2) => {
|
|
6951
|
+
program2.command("resources").argument("[stacks...]", "Optionally filter stack resources to list").description(`List all defined resources in your app`).action(async (filters) => {
|
|
6952
|
+
await layout("resources", async ({ appConfig, stackConfigs }) => {
|
|
6953
6953
|
const region = appConfig.region;
|
|
6954
6954
|
const credentials = getCredentials(appConfig.profile);
|
|
6955
6955
|
const accountId = await getAccountId(credentials, region);
|
|
@@ -6968,21 +6968,14 @@ var list3 = (program2) => {
|
|
|
6968
6968
|
}
|
|
6969
6969
|
log12.step(chalk6.magenta(stack.name));
|
|
6970
6970
|
line("");
|
|
6971
|
-
for (const
|
|
6972
|
-
line(formatResource(stack,
|
|
6971
|
+
for (const resource of stack.resources) {
|
|
6972
|
+
line(formatResource(stack, resource.$.urn));
|
|
6973
6973
|
}
|
|
6974
6974
|
}
|
|
6975
6975
|
});
|
|
6976
6976
|
});
|
|
6977
6977
|
};
|
|
6978
6978
|
|
|
6979
|
-
// src/cli/command/resource/index.ts
|
|
6980
|
-
var commands4 = [list3];
|
|
6981
|
-
var resource = (program2) => {
|
|
6982
|
-
const command = program2.command("resource").description(`Manage app resources`);
|
|
6983
|
-
commands4.forEach((cb) => cb(command));
|
|
6984
|
-
};
|
|
6985
|
-
|
|
6986
6979
|
// src/cli/command/run.ts
|
|
6987
6980
|
import { DynamoDBClient, dynamoDBClient } from "@awsless/dynamodb";
|
|
6988
6981
|
import { iotClient, IoTDataPlaneClient } from "@awsless/iot";
|
|
@@ -6998,17 +6991,17 @@ var run = (program2) => {
|
|
|
6998
6991
|
const region = appConfig.region;
|
|
6999
6992
|
const credentials = getCredentials(appConfig.profile);
|
|
7000
6993
|
const accountId = await getAccountId(credentials, region);
|
|
7001
|
-
const { commands:
|
|
6994
|
+
const { commands: commands7 } = createApp({ appConfig, stackConfigs, accountId });
|
|
7002
6995
|
let command;
|
|
7003
6996
|
if (selected) {
|
|
7004
|
-
command =
|
|
6997
|
+
command = commands7.find((cmd) => {
|
|
7005
6998
|
return cmd.name === selected;
|
|
7006
6999
|
});
|
|
7007
7000
|
} else {
|
|
7008
7001
|
const selected2 = await select2({
|
|
7009
7002
|
message: "Pick the command you want to run:",
|
|
7010
|
-
initialValue:
|
|
7011
|
-
options:
|
|
7003
|
+
initialValue: commands7[0],
|
|
7004
|
+
options: commands7.map((cmd) => ({
|
|
7012
7005
|
value: cmd,
|
|
7013
7006
|
label: cmd.name,
|
|
7014
7007
|
hint: cmd.description
|
|
@@ -7121,10 +7114,10 @@ var unlock = (program2) => {
|
|
|
7121
7114
|
};
|
|
7122
7115
|
|
|
7123
7116
|
// src/cli/command/state/index.ts
|
|
7124
|
-
var
|
|
7117
|
+
var commands4 = [pull, push, unlock];
|
|
7125
7118
|
var state = (program2) => {
|
|
7126
7119
|
const command = program2.command("state").description(`Manage app state`);
|
|
7127
|
-
|
|
7120
|
+
commands4.forEach((cb) => cb(command));
|
|
7128
7121
|
};
|
|
7129
7122
|
|
|
7130
7123
|
// src/cli/command/test.ts
|
|
@@ -7156,7 +7149,7 @@ var types = (program2) => {
|
|
|
7156
7149
|
|
|
7157
7150
|
// src/cli/command/domain/list.ts
|
|
7158
7151
|
import { log as log13 } from "@clack/prompts";
|
|
7159
|
-
var
|
|
7152
|
+
var list3 = (program2) => {
|
|
7160
7153
|
program2.command("list").description("List all domains").action(async () => {
|
|
7161
7154
|
await layout("domain list", async ({ appConfig, stackConfigs }) => {
|
|
7162
7155
|
const region = appConfig.region;
|
|
@@ -7232,14 +7225,14 @@ var deploy2 = (program2) => {
|
|
|
7232
7225
|
};
|
|
7233
7226
|
|
|
7234
7227
|
// src/cli/command/domain/index.ts
|
|
7235
|
-
var
|
|
7228
|
+
var commands5 = [
|
|
7236
7229
|
//
|
|
7237
7230
|
deploy2,
|
|
7238
|
-
|
|
7231
|
+
list3
|
|
7239
7232
|
];
|
|
7240
7233
|
var domain = (program2) => {
|
|
7241
7234
|
const command = program2.command("domain").description(`Manage domains`);
|
|
7242
|
-
|
|
7235
|
+
commands5.forEach((cb) => cb(command));
|
|
7243
7236
|
};
|
|
7244
7237
|
|
|
7245
7238
|
// src/cli/command/logs.ts
|
|
@@ -7267,9 +7260,9 @@ var logs = (program2) => {
|
|
|
7267
7260
|
const logGroupArns = [];
|
|
7268
7261
|
for (const stack of app.stacks) {
|
|
7269
7262
|
if (filters.find((f) => wildstring6.match(f, stack.name))) {
|
|
7270
|
-
for (const
|
|
7271
|
-
if (
|
|
7272
|
-
const logGroup =
|
|
7263
|
+
for (const resource of stack.resources) {
|
|
7264
|
+
if (resource.$.type === "aws_cloudwatch_log_group") {
|
|
7265
|
+
const logGroup = resource;
|
|
7273
7266
|
logGroupArns.push(await logGroup.arn);
|
|
7274
7267
|
}
|
|
7275
7268
|
}
|
|
@@ -7360,10 +7353,10 @@ var parseJsonLog = (message) => {
|
|
|
7360
7353
|
json3 = JSON.parse(message);
|
|
7361
7354
|
} catch (error) {
|
|
7362
7355
|
}
|
|
7363
|
-
if ("level" in json3 && typeof json3.level === "string" && "
|
|
7356
|
+
if ("level" in json3 && typeof json3.level === "string" && "timestamp" in json3 && typeof json3.timestamp === "string" && "message" in json3) {
|
|
7364
7357
|
return {
|
|
7365
7358
|
level: json3.level,
|
|
7366
|
-
message: json3.message,
|
|
7359
|
+
message: typeof json3.message === "string" ? json3.message : JSON.stringify(json3.message, void 0, 2),
|
|
7367
7360
|
date: new Date(json3.timestamp)
|
|
7368
7361
|
};
|
|
7369
7362
|
}
|
|
@@ -7381,7 +7374,7 @@ var parseJsonLog = (message) => {
|
|
|
7381
7374
|
};
|
|
7382
7375
|
|
|
7383
7376
|
// src/cli/command/index.ts
|
|
7384
|
-
var
|
|
7377
|
+
var commands6 = [
|
|
7385
7378
|
bootstrap,
|
|
7386
7379
|
types,
|
|
7387
7380
|
build2,
|
|
@@ -7395,7 +7388,7 @@ var commands7 = [
|
|
|
7395
7388
|
auth,
|
|
7396
7389
|
domain,
|
|
7397
7390
|
state,
|
|
7398
|
-
|
|
7391
|
+
resources,
|
|
7399
7392
|
config,
|
|
7400
7393
|
test
|
|
7401
7394
|
];
|
|
@@ -7420,7 +7413,7 @@ program.on("option:skip-prompt", () => {
|
|
|
7420
7413
|
program.on("option:no-cache", () => {
|
|
7421
7414
|
process.env.NO_CACHE = program.opts().noCache ? "1" : void 0;
|
|
7422
7415
|
});
|
|
7423
|
-
|
|
7416
|
+
commands6.forEach((fn) => fn(program));
|
|
7424
7417
|
|
|
7425
7418
|
// src/bin.ts
|
|
7426
7419
|
program.parse(process.argv);
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awsless/awsless",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.478",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -28,19 +28,19 @@
|
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
+
"@awsless/dynamodb": "^0.1.5",
|
|
32
|
+
"@awsless/iot": "^0.0.3",
|
|
31
33
|
"@awsless/json": "^0.0.8",
|
|
34
|
+
"@awsless/lambda": "^0.0.32",
|
|
32
35
|
"@awsless/open-search": "^0.0.17",
|
|
33
36
|
"@awsless/redis": "^0.0.14",
|
|
34
|
-
"@awsless/
|
|
35
|
-
"@awsless/s3": "^0.0.20",
|
|
36
|
-
"@awsless/lambda": "^0.0.32",
|
|
37
|
+
"@awsless/mqtt": "^0.0.2",
|
|
37
38
|
"@awsless/validate": "^0.0.19",
|
|
38
39
|
"@awsless/sns": "^0.0.10",
|
|
39
|
-
"@awsless/
|
|
40
|
-
"@awsless/iot": "^0.0.3",
|
|
41
|
-
"@awsless/weak-cache": "^0.0.1",
|
|
40
|
+
"@awsless/sqs": "^0.0.8",
|
|
42
41
|
"@awsless/ssm": "^0.0.7",
|
|
43
|
-
"@awsless/
|
|
42
|
+
"@awsless/s3": "^0.0.20",
|
|
43
|
+
"@awsless/weak-cache": "^0.0.1"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@arcanyx/cidr-slicer": "^0.3.0",
|
|
@@ -120,13 +120,13 @@
|
|
|
120
120
|
"zod": "^3.24.2",
|
|
121
121
|
"zod-to-json-schema": "^3.24.3",
|
|
122
122
|
"@awsless/code": "^0.0.10",
|
|
123
|
-
"@awsless/
|
|
123
|
+
"@awsless/json": "^0.0.8",
|
|
124
124
|
"@awsless/formation": "^0.0.73",
|
|
125
|
+
"@awsless/duration": "^0.0.3",
|
|
125
126
|
"@awsless/graphql": "^0.0.9",
|
|
126
|
-
"@awsless/json": "^0.0.8",
|
|
127
127
|
"@awsless/size": "^0.0.2",
|
|
128
|
-
"@awsless/
|
|
129
|
-
"@awsless/
|
|
128
|
+
"@awsless/ts-file-cache": "^0.0.12",
|
|
129
|
+
"@awsless/validate": "^0.0.19"
|
|
130
130
|
},
|
|
131
131
|
"devDependencies": {
|
|
132
132
|
"@node-rs/bcrypt": "^1.10.5"
|