@awsless/awsless 0.0.601 → 0.0.602
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
CHANGED
|
@@ -1085,11 +1085,11 @@ var FunctionDefaultSchema = z15.object({
|
|
|
1085
1085
|
// container
|
|
1086
1086
|
warm: WarmSchema.default(0),
|
|
1087
1087
|
vpc: VPCSchema.default(false),
|
|
1088
|
-
log: LogSchema.default(true).transform((
|
|
1089
|
-
retention:
|
|
1090
|
-
level: "level" in
|
|
1091
|
-
system: "system" in
|
|
1092
|
-
format: "format" in
|
|
1088
|
+
log: LogSchema.default(true).transform((log30) => ({
|
|
1089
|
+
retention: log30.retention ?? days(7),
|
|
1090
|
+
level: "level" in log30 ? log30.level : "error",
|
|
1091
|
+
system: "system" in log30 ? log30.system : "warn",
|
|
1092
|
+
format: "format" in log30 ? log30.format : "json"
|
|
1093
1093
|
})),
|
|
1094
1094
|
timeout: TimeoutSchema.default("10 seconds"),
|
|
1095
1095
|
memorySize: MemorySizeSchema.default("128 MB"),
|
|
@@ -1617,8 +1617,8 @@ var InstanceDefaultSchema = z25.object({
|
|
|
1617
1617
|
permissions: PermissionsSchema2.optional(),
|
|
1618
1618
|
healthCheck: HealthCheckSchema.optional(),
|
|
1619
1619
|
// restartPolicy: RestartPolicySchema.default({ enabled: true }),
|
|
1620
|
-
log: LogSchema2.default(true).transform((
|
|
1621
|
-
retention:
|
|
1620
|
+
log: LogSchema2.default(true).transform((log30) => ({
|
|
1621
|
+
retention: log30.retention ?? days4(7)
|
|
1622
1622
|
}))
|
|
1623
1623
|
}).default({});
|
|
1624
1624
|
|
|
@@ -6535,7 +6535,7 @@ var buildExecutable = async (input, outputPath, architecture) => {
|
|
|
6535
6535
|
}
|
|
6536
6536
|
if (!result.success) {
|
|
6537
6537
|
throw new ExpectedError(`Executable build failed:
|
|
6538
|
-
${result.logs?.map((
|
|
6538
|
+
${result.logs?.map((log30) => log30.message).join("\n")}`);
|
|
6539
6539
|
}
|
|
6540
6540
|
const file = await readFile4(filePath);
|
|
6541
6541
|
return {
|
|
@@ -8828,10 +8828,10 @@ var startTest = async (props) => {
|
|
|
8828
8828
|
tests.push(entry);
|
|
8829
8829
|
if ("task" in test2) {
|
|
8830
8830
|
const task2 = test2.task;
|
|
8831
|
-
for (const
|
|
8831
|
+
for (const log30 of task2.logs ?? []) {
|
|
8832
8832
|
entry.logs.push({
|
|
8833
|
-
time:
|
|
8834
|
-
text:
|
|
8833
|
+
time: log30.time,
|
|
8834
|
+
text: log30.content
|
|
8835
8835
|
});
|
|
8836
8836
|
}
|
|
8837
8837
|
}
|
|
@@ -8899,7 +8899,7 @@ var logTestLogs = (event) => {
|
|
|
8899
8899
|
].join(" "),
|
|
8900
8900
|
color.line(icon.dot)
|
|
8901
8901
|
);
|
|
8902
|
-
log16.message(test2.logs.map((
|
|
8902
|
+
log16.message(test2.logs.map((log30) => log30.text).join("\n"));
|
|
8903
8903
|
}
|
|
8904
8904
|
}
|
|
8905
8905
|
};
|
|
@@ -9124,7 +9124,7 @@ import {
|
|
|
9124
9124
|
} from "@aws-sdk/client-cognito-identity-provider";
|
|
9125
9125
|
import { log as log19, prompt as prompt8 } from "@awsless/clui";
|
|
9126
9126
|
var create = (program2) => {
|
|
9127
|
-
program2.command("create").
|
|
9127
|
+
program2.command("create").description("Create an user in your userpool").action(async () => {
|
|
9128
9128
|
await layout("auth user create", async ({ appConfig, stackConfigs }) => {
|
|
9129
9129
|
const region = appConfig.region;
|
|
9130
9130
|
const profile = appConfig.profile;
|
|
@@ -9133,20 +9133,15 @@ var create = (program2) => {
|
|
|
9133
9133
|
if (Object.keys(appConfig.defaults.auth ?? {}).length === 0) {
|
|
9134
9134
|
throw new ExpectedError("No auth resources are defined.");
|
|
9135
9135
|
}
|
|
9136
|
-
|
|
9137
|
-
|
|
9138
|
-
|
|
9139
|
-
|
|
9140
|
-
|
|
9141
|
-
|
|
9142
|
-
|
|
9143
|
-
|
|
9144
|
-
});
|
|
9145
|
-
}
|
|
9136
|
+
const name = await prompt8.select({
|
|
9137
|
+
message: "Select the auth userpool:",
|
|
9138
|
+
initialValue: Object.keys(appConfig.defaults.auth).at(0),
|
|
9139
|
+
options: Object.keys(appConfig.defaults.auth).map((name2) => ({
|
|
9140
|
+
label: name2,
|
|
9141
|
+
value: name2
|
|
9142
|
+
}))
|
|
9143
|
+
});
|
|
9146
9144
|
const props = appConfig.defaults.auth[name];
|
|
9147
|
-
if (!props) {
|
|
9148
|
-
throw new ExpectedError(`Provided auth name doesn't exist inside your app config.`);
|
|
9149
|
-
}
|
|
9150
9145
|
const userPoolId = await log19.task({
|
|
9151
9146
|
initialMessage: "Loading auth userpool...",
|
|
9152
9147
|
successMessage: "Done loading auth userpool.",
|
|
@@ -9270,7 +9265,7 @@ import {
|
|
|
9270
9265
|
} from "@aws-sdk/client-cognito-identity-provider";
|
|
9271
9266
|
import { log as log20, prompt as prompt9 } from "@awsless/clui";
|
|
9272
9267
|
var update = (program2) => {
|
|
9273
|
-
program2.command("update").
|
|
9268
|
+
program2.command("update").description("Update an user in your userpool").action(async () => {
|
|
9274
9269
|
await layout("auth user update", async ({ appConfig, stackConfigs }) => {
|
|
9275
9270
|
const region = appConfig.region;
|
|
9276
9271
|
const profile = appConfig.profile;
|
|
@@ -9279,20 +9274,15 @@ var update = (program2) => {
|
|
|
9279
9274
|
if (Object.keys(appConfig.defaults.auth ?? {}).length === 0) {
|
|
9280
9275
|
throw new ExpectedError("No auth resources are defined.");
|
|
9281
9276
|
}
|
|
9282
|
-
|
|
9283
|
-
|
|
9284
|
-
|
|
9285
|
-
|
|
9286
|
-
|
|
9287
|
-
|
|
9288
|
-
|
|
9289
|
-
|
|
9290
|
-
});
|
|
9291
|
-
}
|
|
9277
|
+
const name = await prompt9.select({
|
|
9278
|
+
message: "Select the auth userpool:",
|
|
9279
|
+
initialValue: Object.keys(appConfig.defaults.auth).at(0),
|
|
9280
|
+
options: Object.keys(appConfig.defaults.auth).map((name2) => ({
|
|
9281
|
+
label: name2,
|
|
9282
|
+
value: name2
|
|
9283
|
+
}))
|
|
9284
|
+
});
|
|
9292
9285
|
const props = appConfig.defaults.auth[name];
|
|
9293
|
-
if (!props) {
|
|
9294
|
-
throw new ExpectedError(`Provided auth name doesn't exist inside your app config.`);
|
|
9295
|
-
}
|
|
9296
9286
|
const userPoolId = await log20.task({
|
|
9297
9287
|
initialMessage: "Loading auth userpool...",
|
|
9298
9288
|
successMessage: "Done loading auth userpool.",
|
|
@@ -9445,8 +9435,97 @@ var update = (program2) => {
|
|
|
9445
9435
|
});
|
|
9446
9436
|
};
|
|
9447
9437
|
|
|
9438
|
+
// src/cli/command/auth/user/delete.ts
|
|
9439
|
+
import {
|
|
9440
|
+
AdminDeleteUserCommand,
|
|
9441
|
+
CognitoIdentityProviderClient as CognitoIdentityProviderClient3,
|
|
9442
|
+
UserNotFoundException as UserNotFoundException2
|
|
9443
|
+
} from "@aws-sdk/client-cognito-identity-provider";
|
|
9444
|
+
import { Cancelled as Cancelled2, log as log21, prompt as prompt10 } from "@awsless/clui";
|
|
9445
|
+
var del3 = (program2) => {
|
|
9446
|
+
program2.command("delete").description("Delete an user from your userpool").action(async () => {
|
|
9447
|
+
await layout("auth user delete", async ({ appConfig, stackConfigs }) => {
|
|
9448
|
+
const region = appConfig.region;
|
|
9449
|
+
const profile = appConfig.profile;
|
|
9450
|
+
const credentials = await getCredentials(profile);
|
|
9451
|
+
const accountId = await getAccountId(credentials, region);
|
|
9452
|
+
if (Object.keys(appConfig.defaults.auth ?? {}).length === 0) {
|
|
9453
|
+
throw new ExpectedError("No auth resources are defined.");
|
|
9454
|
+
}
|
|
9455
|
+
const name = await prompt10.select({
|
|
9456
|
+
message: "Select the auth userpool:",
|
|
9457
|
+
initialValue: Object.keys(appConfig.defaults.auth).at(0),
|
|
9458
|
+
options: Object.keys(appConfig.defaults.auth).map((name2) => ({
|
|
9459
|
+
label: name2,
|
|
9460
|
+
value: name2
|
|
9461
|
+
}))
|
|
9462
|
+
});
|
|
9463
|
+
const userPoolId = await log21.task({
|
|
9464
|
+
initialMessage: "Loading auth userpool...",
|
|
9465
|
+
successMessage: "Done loading auth userpool.",
|
|
9466
|
+
errorMessage: "Failed loading auth userpool.",
|
|
9467
|
+
async task() {
|
|
9468
|
+
const { shared, app } = createApp({ appConfig, stackConfigs, accountId });
|
|
9469
|
+
const { workspace } = await createWorkSpace({
|
|
9470
|
+
credentials,
|
|
9471
|
+
accountId,
|
|
9472
|
+
profile,
|
|
9473
|
+
region
|
|
9474
|
+
});
|
|
9475
|
+
await workspace.hydrate(app);
|
|
9476
|
+
try {
|
|
9477
|
+
return await shared.entry("auth", `user-pool-id`, name);
|
|
9478
|
+
} catch (_) {
|
|
9479
|
+
throw new ExpectedError(`The auth userpool hasn't been deployed yet.`);
|
|
9480
|
+
}
|
|
9481
|
+
}
|
|
9482
|
+
});
|
|
9483
|
+
const username = await prompt10.text({
|
|
9484
|
+
message: "Username:",
|
|
9485
|
+
validate(value) {
|
|
9486
|
+
if (!value) {
|
|
9487
|
+
return "Required";
|
|
9488
|
+
}
|
|
9489
|
+
return;
|
|
9490
|
+
}
|
|
9491
|
+
});
|
|
9492
|
+
const confirm = await prompt10.confirm({
|
|
9493
|
+
message: "Are you sure you want to delete this user?",
|
|
9494
|
+
initialValue: false
|
|
9495
|
+
});
|
|
9496
|
+
if (!confirm) {
|
|
9497
|
+
throw new Cancelled2();
|
|
9498
|
+
}
|
|
9499
|
+
const client = new CognitoIdentityProviderClient3({
|
|
9500
|
+
region,
|
|
9501
|
+
credentials
|
|
9502
|
+
});
|
|
9503
|
+
await log21.task({
|
|
9504
|
+
initialMessage: "Deleting user...",
|
|
9505
|
+
successMessage: "User deleted.",
|
|
9506
|
+
errorMessage: "Failed deleting user.",
|
|
9507
|
+
async task() {
|
|
9508
|
+
try {
|
|
9509
|
+
await client.send(
|
|
9510
|
+
new AdminDeleteUserCommand({
|
|
9511
|
+
UserPoolId: userPoolId,
|
|
9512
|
+
Username: username
|
|
9513
|
+
})
|
|
9514
|
+
);
|
|
9515
|
+
} catch (error) {
|
|
9516
|
+
if (error instanceof UserNotFoundException2) {
|
|
9517
|
+
throw new ExpectedError(`User doesn't exist`);
|
|
9518
|
+
}
|
|
9519
|
+
throw error;
|
|
9520
|
+
}
|
|
9521
|
+
}
|
|
9522
|
+
});
|
|
9523
|
+
});
|
|
9524
|
+
});
|
|
9525
|
+
};
|
|
9526
|
+
|
|
9448
9527
|
// src/cli/command/auth/user/index.ts
|
|
9449
|
-
var commands2 = [create, update];
|
|
9528
|
+
var commands2 = [create, update, del3];
|
|
9450
9529
|
var user = (program2) => {
|
|
9451
9530
|
const command = program2.command("user").description(`Manage auth users`);
|
|
9452
9531
|
commands2.forEach((cb) => cb(command));
|
|
@@ -9460,7 +9539,7 @@ var auth = (program2) => {
|
|
|
9460
9539
|
};
|
|
9461
9540
|
|
|
9462
9541
|
// src/cli/command/bind.ts
|
|
9463
|
-
import { log as
|
|
9542
|
+
import { log as log22 } from "@awsless/clui";
|
|
9464
9543
|
import { constantCase as constantCase15 } from "change-case";
|
|
9465
9544
|
import { spawn } from "child_process";
|
|
9466
9545
|
var bind = (program2) => {
|
|
@@ -9483,9 +9562,9 @@ var bind = (program2) => {
|
|
|
9483
9562
|
env[name] = await value;
|
|
9484
9563
|
}
|
|
9485
9564
|
if (Object.keys(env).length > 0) {
|
|
9486
|
-
|
|
9565
|
+
log22.list("Bind Env", env);
|
|
9487
9566
|
} else {
|
|
9488
|
-
|
|
9567
|
+
log22.warning("No bindings available.");
|
|
9489
9568
|
}
|
|
9490
9569
|
const configList = opts.config ?? [];
|
|
9491
9570
|
const configs = {};
|
|
@@ -9493,7 +9572,7 @@ var bind = (program2) => {
|
|
|
9493
9572
|
configs[`CONFIG_${constantCase15(name)}`] = name;
|
|
9494
9573
|
}
|
|
9495
9574
|
if (configList.length ?? 0 > 0) {
|
|
9496
|
-
|
|
9575
|
+
log22.note("Bind Config", configList.map((v) => color.label(constantCase15(v))).join("\n"));
|
|
9497
9576
|
}
|
|
9498
9577
|
if (commands9.length === 0) {
|
|
9499
9578
|
return "No command to execute.";
|
|
@@ -9552,7 +9631,7 @@ var watchConfig = async (options, resolve, reject) => {
|
|
|
9552
9631
|
};
|
|
9553
9632
|
|
|
9554
9633
|
// src/cli/ui/complex/build-types.ts
|
|
9555
|
-
import { log as
|
|
9634
|
+
import { log as log23 } from "@awsless/clui";
|
|
9556
9635
|
|
|
9557
9636
|
// src/type-gen/generate.ts
|
|
9558
9637
|
import { mkdir as mkdir5, writeFile as writeFile4 } from "fs/promises";
|
|
@@ -9586,7 +9665,7 @@ var generateTypes = async (props) => {
|
|
|
9586
9665
|
// src/cli/ui/complex/build-types.ts
|
|
9587
9666
|
var buildTypes = async (props) => {
|
|
9588
9667
|
await generateTypes(props);
|
|
9589
|
-
|
|
9668
|
+
log23.step("Done generating type definition files.");
|
|
9590
9669
|
};
|
|
9591
9670
|
|
|
9592
9671
|
// src/cli/command/dev.ts
|
|
@@ -9610,7 +9689,7 @@ var dev = (program2) => {
|
|
|
9610
9689
|
};
|
|
9611
9690
|
|
|
9612
9691
|
// src/cli/command/resources.ts
|
|
9613
|
-
import { log as
|
|
9692
|
+
import { log as log24 } from "@awsless/clui";
|
|
9614
9693
|
import chalk4 from "chalk";
|
|
9615
9694
|
import wildstring5 from "wildstring";
|
|
9616
9695
|
var resources = (program2) => {
|
|
@@ -9653,9 +9732,9 @@ var resources = (program2) => {
|
|
|
9653
9732
|
continue;
|
|
9654
9733
|
}
|
|
9655
9734
|
}
|
|
9656
|
-
|
|
9735
|
+
log24.step(chalk4.magenta(stack.name));
|
|
9657
9736
|
if (stack.resources.length) {
|
|
9658
|
-
|
|
9737
|
+
log24.message(
|
|
9659
9738
|
stack.resources.map((r) => {
|
|
9660
9739
|
return [
|
|
9661
9740
|
//
|
|
@@ -9666,7 +9745,7 @@ var resources = (program2) => {
|
|
|
9666
9745
|
}).join("\n")
|
|
9667
9746
|
);
|
|
9668
9747
|
} else {
|
|
9669
|
-
|
|
9748
|
+
log24.message(color.line(`(empty)`));
|
|
9670
9749
|
}
|
|
9671
9750
|
}
|
|
9672
9751
|
});
|
|
@@ -9674,7 +9753,7 @@ var resources = (program2) => {
|
|
|
9674
9753
|
};
|
|
9675
9754
|
|
|
9676
9755
|
// src/cli/command/run.ts
|
|
9677
|
-
import { prompt as
|
|
9756
|
+
import { prompt as prompt11 } from "@awsless/clui";
|
|
9678
9757
|
import { DynamoDBClient, dynamoDBClient } from "@awsless/dynamodb";
|
|
9679
9758
|
import { iotClient, IoTDataPlaneClient } from "@awsless/iot";
|
|
9680
9759
|
import { LambdaClient as LambdaClient3, lambdaClient } from "@awsless/lambda";
|
|
@@ -9694,7 +9773,7 @@ var run = (program2) => {
|
|
|
9694
9773
|
return cmd.name === selected;
|
|
9695
9774
|
});
|
|
9696
9775
|
} else {
|
|
9697
|
-
command = await
|
|
9776
|
+
command = await prompt11.select({
|
|
9698
9777
|
message: "Pick the command you want to run:",
|
|
9699
9778
|
initialValue: commands9[0],
|
|
9700
9779
|
options: commands9.map((cmd) => ({
|
|
@@ -9727,7 +9806,6 @@ var run = (program2) => {
|
|
|
9727
9806
|
credentials,
|
|
9728
9807
|
accountId
|
|
9729
9808
|
});
|
|
9730
|
-
return;
|
|
9731
9809
|
});
|
|
9732
9810
|
});
|
|
9733
9811
|
};
|
|
@@ -9749,7 +9827,7 @@ var pull = (program2) => {
|
|
|
9749
9827
|
};
|
|
9750
9828
|
|
|
9751
9829
|
// src/cli/command/state/push.ts
|
|
9752
|
-
import { prompt as
|
|
9830
|
+
import { prompt as prompt12 } from "@awsless/clui";
|
|
9753
9831
|
var push = (program2) => {
|
|
9754
9832
|
program2.command("push").description("Push the local state to the remote server").action(async () => {
|
|
9755
9833
|
await layout("state pull", async ({ appConfig, stackConfigs }) => {
|
|
@@ -9759,7 +9837,7 @@ var push = (program2) => {
|
|
|
9759
9837
|
const accountId = await getAccountId(credentials, region);
|
|
9760
9838
|
const { app } = createApp({ appConfig, stackConfigs, accountId });
|
|
9761
9839
|
const { state: state2 } = await createWorkSpace({ credentials, region, accountId, profile });
|
|
9762
|
-
const ok = await
|
|
9840
|
+
const ok = await prompt12.confirm({
|
|
9763
9841
|
message: "Pushing up the local state might corrupt your remote state. Are you sure?",
|
|
9764
9842
|
initialValue: false
|
|
9765
9843
|
});
|
|
@@ -9773,7 +9851,7 @@ var push = (program2) => {
|
|
|
9773
9851
|
};
|
|
9774
9852
|
|
|
9775
9853
|
// src/cli/command/state/unlock.ts
|
|
9776
|
-
import { prompt as
|
|
9854
|
+
import { prompt as prompt13 } from "@awsless/clui";
|
|
9777
9855
|
var unlock = (program2) => {
|
|
9778
9856
|
program2.command("unlock").description("Release the lock that ensures sequential deployments").action(async () => {
|
|
9779
9857
|
await layout("state unlock", async ({ appConfig, stackConfigs }) => {
|
|
@@ -9787,7 +9865,7 @@ var unlock = (program2) => {
|
|
|
9787
9865
|
if (!isLocked) {
|
|
9788
9866
|
return "No lock is exists.";
|
|
9789
9867
|
}
|
|
9790
|
-
const ok = await
|
|
9868
|
+
const ok = await prompt13.confirm({
|
|
9791
9869
|
message: "Releasing the lock that ensures sequential deployments might result in corrupt state if a deployment is still running. Are you sure?",
|
|
9792
9870
|
initialValue: false
|
|
9793
9871
|
});
|
|
@@ -9837,7 +9915,7 @@ var types = (program2) => {
|
|
|
9837
9915
|
};
|
|
9838
9916
|
|
|
9839
9917
|
// src/cli/command/domain/list.ts
|
|
9840
|
-
import { log as
|
|
9918
|
+
import { log as log25 } from "@awsless/clui";
|
|
9841
9919
|
var list2 = (program2) => {
|
|
9842
9920
|
program2.command("list").description("List all domains").action(async () => {
|
|
9843
9921
|
await layout("domain list", async ({ appConfig, stackConfigs }) => {
|
|
@@ -9859,7 +9937,7 @@ var list2 = (program2) => {
|
|
|
9859
9937
|
});
|
|
9860
9938
|
await workspace.hydrate(app);
|
|
9861
9939
|
for (const zone of domainZones) {
|
|
9862
|
-
|
|
9940
|
+
log25.step(
|
|
9863
9941
|
[
|
|
9864
9942
|
//
|
|
9865
9943
|
color.label.green(await zone.name),
|
|
@@ -9867,14 +9945,14 @@ var list2 = (program2) => {
|
|
|
9867
9945
|
color.dim(await zone.id)
|
|
9868
9946
|
].join(" ")
|
|
9869
9947
|
);
|
|
9870
|
-
|
|
9948
|
+
log25.message((await zone.nameServers).join("\n"));
|
|
9871
9949
|
}
|
|
9872
9950
|
});
|
|
9873
9951
|
});
|
|
9874
9952
|
};
|
|
9875
9953
|
|
|
9876
9954
|
// src/cli/command/domain/deploy.ts
|
|
9877
|
-
import { log as
|
|
9955
|
+
import { log as log26 } from "@awsless/clui";
|
|
9878
9956
|
var deploy2 = (program2) => {
|
|
9879
9957
|
program2.command("deploy").description("Deploy the domain zones to AWS").action(async () => {
|
|
9880
9958
|
await layout("domain deploy", async ({ appConfig, stackConfigs }) => {
|
|
@@ -9894,7 +9972,7 @@ var deploy2 = (program2) => {
|
|
|
9894
9972
|
profile,
|
|
9895
9973
|
region
|
|
9896
9974
|
});
|
|
9897
|
-
await
|
|
9975
|
+
await log26.task({
|
|
9898
9976
|
initialMessage: "Deploying the domain zones to AWS...",
|
|
9899
9977
|
successMessage: "Done deploying the domain zones to AWS.",
|
|
9900
9978
|
errorMessage: "Failed deploying the domain zones to AWS.",
|
|
@@ -9903,7 +9981,7 @@ var deploy2 = (program2) => {
|
|
|
9903
9981
|
}
|
|
9904
9982
|
});
|
|
9905
9983
|
for (const zone of domainZones) {
|
|
9906
|
-
|
|
9984
|
+
log26.step(
|
|
9907
9985
|
[
|
|
9908
9986
|
//
|
|
9909
9987
|
color.label.green(await zone.name),
|
|
@@ -9911,7 +9989,7 @@ var deploy2 = (program2) => {
|
|
|
9911
9989
|
color.dim(await zone.id)
|
|
9912
9990
|
].join(" ")
|
|
9913
9991
|
);
|
|
9914
|
-
|
|
9992
|
+
log26.message((await zone.nameServers).join("\n"));
|
|
9915
9993
|
}
|
|
9916
9994
|
});
|
|
9917
9995
|
});
|
|
@@ -9930,7 +10008,7 @@ var domain = (program2) => {
|
|
|
9930
10008
|
|
|
9931
10009
|
// src/cli/command/logs.ts
|
|
9932
10010
|
import { CloudWatchLogsClient, StartLiveTailCommand } from "@aws-sdk/client-cloudwatch-logs";
|
|
9933
|
-
import { log as
|
|
10011
|
+
import { log as log27 } from "@awsless/clui";
|
|
9934
10012
|
import { aws as aws30 } from "@terraforge/aws";
|
|
9935
10013
|
import chalk5 from "chalk";
|
|
9936
10014
|
import chunk2 from "chunk";
|
|
@@ -9972,7 +10050,7 @@ var logs = (program2) => {
|
|
|
9972
10050
|
process.once("SIGINT", () => {
|
|
9973
10051
|
abort.abort();
|
|
9974
10052
|
});
|
|
9975
|
-
const streams = await
|
|
10053
|
+
const streams = await log27.task({
|
|
9976
10054
|
initialMessage: "Connecting to the log stream...",
|
|
9977
10055
|
errorMessage: "Failed to connect to the log stream.",
|
|
9978
10056
|
async task(ctx) {
|
|
@@ -10029,7 +10107,7 @@ var formatLog = (level, date, group, message) => {
|
|
|
10029
10107
|
SYSTEM: chalk5.blue
|
|
10030
10108
|
};
|
|
10031
10109
|
const levelColor = levels[level] ?? chalk5.cyan;
|
|
10032
|
-
|
|
10110
|
+
log27.message(
|
|
10033
10111
|
[
|
|
10034
10112
|
[
|
|
10035
10113
|
//
|
|
@@ -10071,7 +10149,7 @@ var parseJsonLog = (message) => {
|
|
|
10071
10149
|
// src/cli/command/image/clear-cache.ts
|
|
10072
10150
|
import { CloudFrontClient as CloudFrontClient2, CreateInvalidationCommand as CreateInvalidationCommand2 } from "@aws-sdk/client-cloudfront";
|
|
10073
10151
|
import { DeleteObjectsCommand, ListObjectsV2Command, S3Client as S3Client3 } from "@aws-sdk/client-s3";
|
|
10074
|
-
import { Cancelled as
|
|
10152
|
+
import { Cancelled as Cancelled3, log as log28, prompt as prompt14 } from "@awsless/clui";
|
|
10075
10153
|
import { randomUUID } from "crypto";
|
|
10076
10154
|
var clearCache = (program2) => {
|
|
10077
10155
|
program2.command("clear-cache").argument("[stack]", "The stack name of the image proxy").argument("[name]", "The name of the image proxy").description("Clears the cache of the image proxy").action(async (stack, name) => {
|
|
@@ -10087,7 +10165,7 @@ var clearCache = (program2) => {
|
|
|
10087
10165
|
}
|
|
10088
10166
|
return;
|
|
10089
10167
|
});
|
|
10090
|
-
stack = await
|
|
10168
|
+
stack = await prompt14.select({
|
|
10091
10169
|
message: "Select the stack:",
|
|
10092
10170
|
options: imageStacks.map((stack2) => ({
|
|
10093
10171
|
label: stack2.name,
|
|
@@ -10104,7 +10182,7 @@ var clearCache = (program2) => {
|
|
|
10104
10182
|
if (!names) {
|
|
10105
10183
|
throw new ExpectedError(`No image resources are defined in stack "${stack}".`);
|
|
10106
10184
|
}
|
|
10107
|
-
name = await
|
|
10185
|
+
name = await prompt14.select({
|
|
10108
10186
|
message: "Select the image resource:",
|
|
10109
10187
|
options: names.map((name2) => ({
|
|
10110
10188
|
label: name2,
|
|
@@ -10112,11 +10190,11 @@ var clearCache = (program2) => {
|
|
|
10112
10190
|
}))
|
|
10113
10191
|
});
|
|
10114
10192
|
}
|
|
10115
|
-
const ok = await
|
|
10193
|
+
const ok = await prompt14.confirm({
|
|
10116
10194
|
message: `Are you sure you want to clear the cache`
|
|
10117
10195
|
});
|
|
10118
10196
|
if (!ok) {
|
|
10119
|
-
throw new
|
|
10197
|
+
throw new Cancelled3();
|
|
10120
10198
|
}
|
|
10121
10199
|
const { shared, app } = createApp({ appConfig, stackConfigs, accountId });
|
|
10122
10200
|
const { workspace } = await createWorkSpace({
|
|
@@ -10143,7 +10221,7 @@ var clearCache = (program2) => {
|
|
|
10143
10221
|
region: "us-east-1"
|
|
10144
10222
|
});
|
|
10145
10223
|
let totalDeleted = 0;
|
|
10146
|
-
await
|
|
10224
|
+
await log28.task({
|
|
10147
10225
|
initialMessage: "Clearing cache...",
|
|
10148
10226
|
successMessage: "Cache successfully cleared.",
|
|
10149
10227
|
task: async () => {
|
|
@@ -10205,7 +10283,7 @@ var image = (program2) => {
|
|
|
10205
10283
|
// src/cli/command/icon/clear-cache.ts
|
|
10206
10284
|
import { CloudFrontClient as CloudFrontClient3, CreateInvalidationCommand as CreateInvalidationCommand3 } from "@aws-sdk/client-cloudfront";
|
|
10207
10285
|
import { DeleteObjectsCommand as DeleteObjectsCommand2, ListObjectsV2Command as ListObjectsV2Command2, S3Client as S3Client4 } from "@aws-sdk/client-s3";
|
|
10208
|
-
import { Cancelled as
|
|
10286
|
+
import { Cancelled as Cancelled4, log as log29, prompt as prompt15 } from "@awsless/clui";
|
|
10209
10287
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
10210
10288
|
var clearCache2 = (program2) => {
|
|
10211
10289
|
program2.command("clear-cache").argument("[stack]", "The stack name of the icon proxy").argument("[name]", "The name of the icon proxy").description("Clears the cache of the icon proxy").action(async (stack, name) => {
|
|
@@ -10221,7 +10299,7 @@ var clearCache2 = (program2) => {
|
|
|
10221
10299
|
}
|
|
10222
10300
|
return;
|
|
10223
10301
|
});
|
|
10224
|
-
stack = await
|
|
10302
|
+
stack = await prompt15.select({
|
|
10225
10303
|
message: "Select the stack:",
|
|
10226
10304
|
options: iconStacks.map((stack2) => ({
|
|
10227
10305
|
label: stack2.name,
|
|
@@ -10238,7 +10316,7 @@ var clearCache2 = (program2) => {
|
|
|
10238
10316
|
if (!names) {
|
|
10239
10317
|
throw new ExpectedError(`No icon resources are defined in stack "${stack}".`);
|
|
10240
10318
|
}
|
|
10241
|
-
name = await
|
|
10319
|
+
name = await prompt15.select({
|
|
10242
10320
|
message: "Select the icon resource:",
|
|
10243
10321
|
options: names.map((name2) => ({
|
|
10244
10322
|
label: name2,
|
|
@@ -10246,11 +10324,11 @@ var clearCache2 = (program2) => {
|
|
|
10246
10324
|
}))
|
|
10247
10325
|
});
|
|
10248
10326
|
}
|
|
10249
|
-
const ok = await
|
|
10327
|
+
const ok = await prompt15.confirm({
|
|
10250
10328
|
message: `Are you sure you want to clear the cache`
|
|
10251
10329
|
});
|
|
10252
10330
|
if (!ok) {
|
|
10253
|
-
throw new
|
|
10331
|
+
throw new Cancelled4();
|
|
10254
10332
|
}
|
|
10255
10333
|
const { shared, app } = createApp({ appConfig, stackConfigs, accountId });
|
|
10256
10334
|
const { workspace } = await createWorkSpace({
|
|
@@ -10277,7 +10355,7 @@ var clearCache2 = (program2) => {
|
|
|
10277
10355
|
region: "us-east-1"
|
|
10278
10356
|
});
|
|
10279
10357
|
let totalDeleted = 0;
|
|
10280
|
-
await
|
|
10358
|
+
await log29.task({
|
|
10281
10359
|
initialMessage: "Clearing cache...",
|
|
10282
10360
|
successMessage: "Cache successfully cleared.",
|
|
10283
10361
|
task: async () => {
|
|
Binary file
|
|
Binary file
|
|
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.602",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -33,22 +33,22 @@
|
|
|
33
33
|
]
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@awsless/cloudwatch": "^0.0.1",
|
|
37
36
|
"@awsless/big-float": "^0.1.5",
|
|
37
|
+
"@awsless/cloudwatch": "^0.0.1",
|
|
38
38
|
"@awsless/duration": "^0.0.4",
|
|
39
|
-
"@awsless/json": "^0.0.10",
|
|
40
39
|
"@awsless/clui": "^0.0.8",
|
|
40
|
+
"@awsless/json": "^0.0.10",
|
|
41
41
|
"@awsless/dynamodb": "^0.3.8",
|
|
42
42
|
"@awsless/iot": "^0.0.3",
|
|
43
|
+
"@awsless/lambda": "^0.0.35",
|
|
43
44
|
"@awsless/mqtt": "^0.0.2",
|
|
45
|
+
"@awsless/s3": "^0.0.21",
|
|
44
46
|
"@awsless/open-search": "^0.0.21",
|
|
45
|
-
"@awsless/lambda": "^0.0.35",
|
|
46
47
|
"@awsless/redis": "^0.0.14",
|
|
47
|
-
"@awsless/s3": "^0.0.21",
|
|
48
|
-
"@awsless/ssm": "^0.0.7",
|
|
49
48
|
"@awsless/sqs": "^0.0.16",
|
|
50
49
|
"@awsless/sns": "^0.0.10",
|
|
51
50
|
"@awsless/validate": "^0.1.3",
|
|
51
|
+
"@awsless/ssm": "^0.0.7",
|
|
52
52
|
"@awsless/weak-cache": "^0.0.1"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
@@ -142,13 +142,13 @@
|
|
|
142
142
|
"@awsless/big-float": "^0.1.5",
|
|
143
143
|
"@awsless/cloudwatch": "^0.0.1",
|
|
144
144
|
"@awsless/clui": "^0.0.8",
|
|
145
|
+
"@awsless/duration": "^0.0.4",
|
|
145
146
|
"@awsless/graphql": "^0.0.9",
|
|
146
|
-
"@awsless/scheduler": "^0.0.4",
|
|
147
147
|
"@awsless/json": "^0.0.10",
|
|
148
148
|
"@awsless/size": "^0.0.2",
|
|
149
|
+
"@awsless/validate": "^0.1.3",
|
|
149
150
|
"@awsless/ts-file-cache": "^0.0.12",
|
|
150
|
-
"@awsless/
|
|
151
|
-
"@awsless/validate": "^0.1.3"
|
|
151
|
+
"@awsless/scheduler": "^0.0.4"
|
|
152
152
|
},
|
|
153
153
|
"devDependencies": {
|
|
154
154
|
"@hono/node-server": "1.19.9",
|