@awsless/awsless 0.0.655 → 0.0.657
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/app.json +1 -1
- package/dist/app.stage.json +1 -1
- package/dist/bin.js +205 -190
- package/dist/build-json-schema.js +190 -180
- package/dist/prebuild/icon/bundle.zip +0 -0
- package/dist/prebuild/image/bundle.zip +0 -0
- package/dist/prebuild/on-failure/bundle.zip +0 -0
- package/dist/prebuild/rpc/bundle.zip +0 -0
- package/dist/stack.json +1 -1
- package/dist/stack.stage.json +1 -1
- package/package.json +14 -14
|
@@ -4,7 +4,7 @@ import { join as join2 } from "node:path";
|
|
|
4
4
|
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
5
5
|
|
|
6
6
|
// src/config/app.ts
|
|
7
|
-
import { z as
|
|
7
|
+
import { z as z26 } from "zod";
|
|
8
8
|
|
|
9
9
|
// src/feature/alert/schema.ts
|
|
10
10
|
import { kebabCase } from "change-case";
|
|
@@ -201,9 +201,6 @@ var EphemeralStorageSizeSchema = SizeSchema.refine(
|
|
|
201
201
|
var ReservedConcurrentExecutionsSchema = z11.number().int().min(0).describe("The number of simultaneous executions to reserve for the function. You can specify a number from 0.");
|
|
202
202
|
var EnvironmentSchema = z11.record(z11.string(), z11.string()).optional().describe("Environment variable key-value pairs.");
|
|
203
203
|
var ArchitectureSchema = z11.enum(["x86_64", "arm64"]).describe("The instruction set architecture that the function supports.");
|
|
204
|
-
var RetryAttemptsSchema = z11.number().int().min(0).max(2).describe(
|
|
205
|
-
"The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 2."
|
|
206
|
-
);
|
|
207
204
|
var NodeRuntimeSchema = z11.enum(["nodejs18.x", "nodejs20.x", "nodejs22.x", "nodejs24.x"]);
|
|
208
205
|
var ContainerRuntimeSchema = z11.literal("container");
|
|
209
206
|
var RuntimeSchema = NodeRuntimeSchema.or(ContainerRuntimeSchema).or(z11.string()).describe("The identifier of the function's runtime.");
|
|
@@ -296,7 +293,7 @@ var FnSchema = z11.object({
|
|
|
296
293
|
memorySize: MemorySizeSchema.optional(),
|
|
297
294
|
architecture: ArchitectureSchema.optional(),
|
|
298
295
|
ephemeralStorageSize: EphemeralStorageSizeSchema.optional(),
|
|
299
|
-
retryAttempts: RetryAttemptsSchema.optional(),
|
|
296
|
+
// retryAttempts: RetryAttemptsSchema.optional(),
|
|
300
297
|
reserved: ReservedConcurrentExecutionsSchema.optional(),
|
|
301
298
|
layers: LayersSchema.optional(),
|
|
302
299
|
environment: EnvironmentSchema.optional(),
|
|
@@ -330,7 +327,7 @@ var FunctionDefaultSchema = z11.object({
|
|
|
330
327
|
memorySize: MemorySizeSchema.default("128 MB"),
|
|
331
328
|
architecture: ArchitectureSchema.default("arm64"),
|
|
332
329
|
ephemeralStorageSize: EphemeralStorageSizeSchema.default("512 MB"),
|
|
333
|
-
retryAttempts: RetryAttemptsSchema.default(2),
|
|
330
|
+
// retryAttempts: RetryAttemptsSchema.default(2),
|
|
334
331
|
reserved: ReservedConcurrentExecutionsSchema.optional(),
|
|
335
332
|
layers: LayersSchema.optional(),
|
|
336
333
|
environment: EnvironmentSchema.optional(),
|
|
@@ -372,10 +369,16 @@ var NotifySchema = z14.union([
|
|
|
372
369
|
EmailSchema.transform((v) => [v]),
|
|
373
370
|
EmailSchema.array()
|
|
374
371
|
]).describe("Receive an email notification when consuming failure entries goes wrong.");
|
|
375
|
-
var OnFailureDefaultSchema = z14.
|
|
376
|
-
consumer
|
|
377
|
-
|
|
378
|
-
|
|
372
|
+
var OnFailureDefaultSchema = z14.union([
|
|
373
|
+
FunctionSchema.transform((consumer) => ({
|
|
374
|
+
consumer,
|
|
375
|
+
notify: []
|
|
376
|
+
})),
|
|
377
|
+
z14.object({
|
|
378
|
+
consumer: FunctionSchema,
|
|
379
|
+
notify: NotifySchema.optional()
|
|
380
|
+
})
|
|
381
|
+
]).optional().describe(
|
|
379
382
|
[
|
|
380
383
|
"Defining a onFailure handler will add a global onFailure handler for the following resources:",
|
|
381
384
|
"- Tasks",
|
|
@@ -425,12 +428,16 @@ var PubSubDefaultSchema = z16.record(
|
|
|
425
428
|
// .optional(),
|
|
426
429
|
})
|
|
427
430
|
).optional().describe("Define the pubsub subscriber in your stack.");
|
|
431
|
+
var RetryAttemptsSchema = z16.number().int().min(0).max(2).describe(
|
|
432
|
+
"The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 2."
|
|
433
|
+
);
|
|
428
434
|
var PubSubSchema = z16.record(
|
|
429
435
|
ResourceIdSchema,
|
|
430
436
|
z16.object({
|
|
431
437
|
sql: z16.string().describe("The SQL statement used to query the IOT topic."),
|
|
432
438
|
sqlVersion: z16.enum(["2015-10-08", "2016-03-23", "beta"]).default("2016-03-23").describe("The version of the SQL rules engine to use when evaluating the rule."),
|
|
433
|
-
consumer: FunctionSchema.describe("The consuming lambda function properties.")
|
|
439
|
+
consumer: FunctionSchema.describe("The consuming lambda function properties."),
|
|
440
|
+
retryAttempts: RetryAttemptsSchema.default(2)
|
|
434
441
|
})
|
|
435
442
|
).optional().describe("Define the pubsub subscriber in your stack.");
|
|
436
443
|
|
|
@@ -897,15 +904,34 @@ var InstanceDefaultSchema = z22.object({
|
|
|
897
904
|
|
|
898
905
|
// src/feature/topic/schema.ts
|
|
899
906
|
import { kebabCase as kebabCase3 } from "change-case";
|
|
907
|
+
import { z as z24 } from "zod";
|
|
908
|
+
|
|
909
|
+
// src/feature/task/schema.ts
|
|
900
910
|
import { z as z23 } from "zod";
|
|
901
|
-
var
|
|
902
|
-
|
|
911
|
+
var RetryAttemptsSchema3 = z23.number().int().min(0).max(2).describe(
|
|
912
|
+
"The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 2."
|
|
913
|
+
);
|
|
914
|
+
var TaskSchema = z23.union([
|
|
915
|
+
FunctionSchema.transform((consumer) => ({
|
|
916
|
+
consumer,
|
|
917
|
+
retryAttempts: 2
|
|
918
|
+
})),
|
|
919
|
+
z23.object({
|
|
920
|
+
consumer: FunctionSchema,
|
|
921
|
+
retryAttempts: RetryAttemptsSchema3.default(2)
|
|
922
|
+
})
|
|
923
|
+
]);
|
|
924
|
+
var TasksSchema = z23.record(ResourceIdSchema, TaskSchema).optional().describe("Define the tasks in your stack.");
|
|
925
|
+
|
|
926
|
+
// src/feature/topic/schema.ts
|
|
927
|
+
var TopicNameSchema = z24.string().min(3).max(256).regex(/^[a-z0-9\-]+$/i, "Invalid topic name").transform((value) => kebabCase3(value)).describe("Define event topic name.");
|
|
928
|
+
var TopicsDefaultSchema = z24.array(TopicNameSchema).refine((topics) => {
|
|
903
929
|
return topics.length === new Set(topics).size;
|
|
904
930
|
}, "Must be a list of unique topic names").optional().describe("Define the event topics for your app.");
|
|
905
|
-
var SubscribersSchema =
|
|
931
|
+
var SubscribersSchema = z24.record(TopicNameSchema, TaskSchema).optional().describe("Define the event topics to subscribe too in your stack.");
|
|
906
932
|
|
|
907
933
|
// src/config/schema/region.ts
|
|
908
|
-
import { z as
|
|
934
|
+
import { z as z25 } from "zod";
|
|
909
935
|
var US = ["us-east-2", "us-east-1", "us-west-1", "us-west-2"];
|
|
910
936
|
var AF = ["af-south-1"];
|
|
911
937
|
var AP = [
|
|
@@ -934,16 +960,16 @@ var EU = [
|
|
|
934
960
|
var ME = ["me-south-1", "me-central-1"];
|
|
935
961
|
var SA = ["sa-east-1"];
|
|
936
962
|
var regions = [...US, ...AF, ...AP, ...CA, ...EU, ...ME, ...SA];
|
|
937
|
-
var RegionSchema =
|
|
963
|
+
var RegionSchema = z25.enum(regions);
|
|
938
964
|
|
|
939
965
|
// src/config/app.ts
|
|
940
|
-
var AppSchema =
|
|
941
|
-
$schema:
|
|
966
|
+
var AppSchema = z26.object({
|
|
967
|
+
$schema: z26.string().optional(),
|
|
942
968
|
name: ResourceIdSchema.describe("App name."),
|
|
943
969
|
region: RegionSchema.describe("The AWS region to deploy to."),
|
|
944
|
-
profile:
|
|
945
|
-
protect:
|
|
946
|
-
removal:
|
|
970
|
+
profile: z26.string().describe("The AWS profile to deploy to."),
|
|
971
|
+
protect: z26.boolean().default(false).describe("Protect your app & stacks from being deleted."),
|
|
972
|
+
removal: z26.enum(["remove", "retain"]).default("remove").describe(
|
|
947
973
|
[
|
|
948
974
|
"Configure how your resources are handled when they have to be removed.",
|
|
949
975
|
"",
|
|
@@ -957,7 +983,7 @@ var AppSchema = z25.object({
|
|
|
957
983
|
// .default('prod')
|
|
958
984
|
// .describe('The deployment stage.'),
|
|
959
985
|
// onFailure: OnFailureSchema,
|
|
960
|
-
defaults:
|
|
986
|
+
defaults: z26.object({
|
|
961
987
|
onFailure: OnFailureDefaultSchema,
|
|
962
988
|
onLog: OnLogDefaultSchema,
|
|
963
989
|
auth: AuthDefaultSchema,
|
|
@@ -1238,7 +1264,7 @@ import { z as z41 } from "zod";
|
|
|
1238
1264
|
|
|
1239
1265
|
// src/feature/cache/schema.ts
|
|
1240
1266
|
import { gibibytes as gibibytes2 } from "@awsless/size";
|
|
1241
|
-
import { z as
|
|
1267
|
+
import { z as z27 } from "zod";
|
|
1242
1268
|
var StorageSchema = SizeSchema.refine(sizeMin(gibibytes2(1)), "Minimum storage size is 1 GB").refine(
|
|
1243
1269
|
sizeMax(gibibytes2(5e3)),
|
|
1244
1270
|
"Maximum storage size is 5000 GB"
|
|
@@ -1249,31 +1275,31 @@ var MinimumStorageSchema = StorageSchema.describe(
|
|
|
1249
1275
|
var MaximumStorageSchema = StorageSchema.describe(
|
|
1250
1276
|
"The upper limit for data storage the cache is set to use. You can specify a size value from 1 GB to 5000 GB."
|
|
1251
1277
|
);
|
|
1252
|
-
var EcpuSchema =
|
|
1278
|
+
var EcpuSchema = z27.number().int().min(1e3).max(15e6);
|
|
1253
1279
|
var MinimumEcpuSchema = EcpuSchema.describe(
|
|
1254
1280
|
"The minimum number of ECPUs the cache can consume per second. You can specify a integer from 1,000 to 15,000,000."
|
|
1255
1281
|
);
|
|
1256
1282
|
var MaximumEcpuSchema = EcpuSchema.describe(
|
|
1257
1283
|
"The maximum number of ECPUs the cache can consume per second. You can specify a integer from 1,000 to 15,000,000."
|
|
1258
1284
|
);
|
|
1259
|
-
var CachesSchema =
|
|
1285
|
+
var CachesSchema = z27.record(
|
|
1260
1286
|
ResourceIdSchema,
|
|
1261
|
-
|
|
1287
|
+
z27.object({
|
|
1262
1288
|
minStorage: MinimumStorageSchema.optional(),
|
|
1263
1289
|
maxStorage: MaximumStorageSchema.optional(),
|
|
1264
1290
|
minECPU: MinimumEcpuSchema.optional(),
|
|
1265
1291
|
maxECPU: MaximumEcpuSchema.optional(),
|
|
1266
|
-
snapshotRetentionLimit:
|
|
1292
|
+
snapshotRetentionLimit: z27.number().int().positive().default(1)
|
|
1267
1293
|
})
|
|
1268
1294
|
).optional().describe("Define the caches in your stack. For access to the cache put your functions inside the global VPC.");
|
|
1269
1295
|
|
|
1270
1296
|
// src/feature/command/schema.ts
|
|
1271
|
-
import { z as
|
|
1272
|
-
var CommandSchema =
|
|
1273
|
-
|
|
1297
|
+
import { z as z28 } from "zod";
|
|
1298
|
+
var CommandSchema = z28.union([
|
|
1299
|
+
z28.object({
|
|
1274
1300
|
file: LocalFileSchema,
|
|
1275
|
-
handler:
|
|
1276
|
-
description:
|
|
1301
|
+
handler: z28.string().default("default").describe("The name of the handler that needs to run"),
|
|
1302
|
+
description: z28.string().optional().describe("A description of the command")
|
|
1277
1303
|
// options: z.record(ResourceIdSchema, OptionSchema).optional(),
|
|
1278
1304
|
// arguments: z.record(ResourceIdSchema, ArgumentSchema).optional(),
|
|
1279
1305
|
}),
|
|
@@ -1283,22 +1309,22 @@ var CommandSchema = z27.union([
|
|
|
1283
1309
|
description: void 0
|
|
1284
1310
|
}))
|
|
1285
1311
|
]);
|
|
1286
|
-
var CommandsSchema =
|
|
1312
|
+
var CommandsSchema = z28.record(ResourceIdSchema, CommandSchema).optional().describe("Define the custom commands for your stack.");
|
|
1287
1313
|
|
|
1288
1314
|
// src/feature/config/schema.ts
|
|
1289
|
-
import { z as
|
|
1290
|
-
var ConfigNameSchema =
|
|
1291
|
-
var ConfigsSchema =
|
|
1315
|
+
import { z as z29 } from "zod";
|
|
1316
|
+
var ConfigNameSchema = z29.string().regex(/[a-z0-9\-]/g, "Invalid config name");
|
|
1317
|
+
var ConfigsSchema = z29.array(ConfigNameSchema).optional().describe("Define the config values for your stack.");
|
|
1292
1318
|
|
|
1293
1319
|
// src/feature/cron/schema/index.ts
|
|
1294
|
-
import { z as
|
|
1320
|
+
import { z as z31 } from "zod";
|
|
1295
1321
|
|
|
1296
1322
|
// src/feature/cron/schema/schedule.ts
|
|
1297
|
-
import { z as
|
|
1323
|
+
import { z as z30 } from "zod";
|
|
1298
1324
|
import { awsCronExpressionValidator } from "aws-cron-expression-validator";
|
|
1299
|
-
var RateExpressionSchema =
|
|
1325
|
+
var RateExpressionSchema = z30.custom(
|
|
1300
1326
|
(value) => {
|
|
1301
|
-
return
|
|
1327
|
+
return z30.string().regex(/^[0-9]+ (seconds?|minutes?|hours?|days?)$/).refine((rate) => {
|
|
1302
1328
|
const [str] = rate.split(" ");
|
|
1303
1329
|
const number = parseInt(str);
|
|
1304
1330
|
return number > 0;
|
|
@@ -1314,9 +1340,9 @@ var RateExpressionSchema = z29.custom(
|
|
|
1314
1340
|
}
|
|
1315
1341
|
return `rate(${rate})`;
|
|
1316
1342
|
});
|
|
1317
|
-
var CronExpressionSchema =
|
|
1343
|
+
var CronExpressionSchema = z30.custom(
|
|
1318
1344
|
(value) => {
|
|
1319
|
-
return
|
|
1345
|
+
return z30.string().safeParse(value).success;
|
|
1320
1346
|
},
|
|
1321
1347
|
{ message: "Invalid cron expression" }
|
|
1322
1348
|
).superRefine((value, ctx) => {
|
|
@@ -1325,12 +1351,12 @@ var CronExpressionSchema = z29.custom(
|
|
|
1325
1351
|
} catch (error) {
|
|
1326
1352
|
if (error instanceof Error) {
|
|
1327
1353
|
ctx.addIssue({
|
|
1328
|
-
code:
|
|
1354
|
+
code: z30.ZodIssueCode.custom,
|
|
1329
1355
|
message: `Invalid cron expression: ${error.message}`
|
|
1330
1356
|
});
|
|
1331
1357
|
} else {
|
|
1332
1358
|
ctx.addIssue({
|
|
1333
|
-
code:
|
|
1359
|
+
code: z30.ZodIssueCode.custom,
|
|
1334
1360
|
message: "Invalid cron expression"
|
|
1335
1361
|
});
|
|
1336
1362
|
}
|
|
@@ -1341,28 +1367,32 @@ var CronExpressionSchema = z29.custom(
|
|
|
1341
1367
|
var ScheduleExpressionSchema = RateExpressionSchema.or(CronExpressionSchema);
|
|
1342
1368
|
|
|
1343
1369
|
// src/feature/cron/schema/index.ts
|
|
1344
|
-
var
|
|
1370
|
+
var RetryAttemptsSchema4 = z31.number().int().min(0).max(2).describe(
|
|
1371
|
+
"The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 2."
|
|
1372
|
+
);
|
|
1373
|
+
var CronsSchema = z31.record(
|
|
1345
1374
|
ResourceIdSchema,
|
|
1346
|
-
|
|
1347
|
-
enabled:
|
|
1375
|
+
z31.object({
|
|
1376
|
+
enabled: z31.boolean().default(true).describe("If the cron is enabled."),
|
|
1348
1377
|
consumer: FunctionSchema.describe("The consuming lambda function properties."),
|
|
1349
1378
|
schedule: ScheduleExpressionSchema.describe(
|
|
1350
1379
|
'The scheduling expression.\n\nexample: "0 20 * * ? *"\nexample: "5 minutes"'
|
|
1351
1380
|
),
|
|
1352
|
-
payload:
|
|
1381
|
+
payload: z31.unknown().optional().describe("The JSON payload that will be passed to the consumer."),
|
|
1382
|
+
retryAttempts: RetryAttemptsSchema4.default(2)
|
|
1353
1383
|
})
|
|
1354
1384
|
).optional().describe(`Define the cron jobs in your stack.`);
|
|
1355
1385
|
|
|
1356
1386
|
// src/feature/search/schema.ts
|
|
1357
1387
|
import { gibibytes as gibibytes3 } from "@awsless/size";
|
|
1358
|
-
import { z as
|
|
1359
|
-
var VersionSchema =
|
|
1388
|
+
import { z as z32 } from "zod";
|
|
1389
|
+
var VersionSchema = z32.union([
|
|
1360
1390
|
//
|
|
1361
|
-
|
|
1362
|
-
|
|
1391
|
+
z32.enum(["2.13", "2.11", "2.9", "2.7", "2.5", "2.3", "1.3"]),
|
|
1392
|
+
z32.string()
|
|
1363
1393
|
]).describe("Specify the OpenSearch engine version.");
|
|
1364
|
-
var TypeSchema =
|
|
1365
|
-
|
|
1394
|
+
var TypeSchema = z32.union([
|
|
1395
|
+
z32.enum([
|
|
1366
1396
|
"t3.small",
|
|
1367
1397
|
"t3.medium",
|
|
1368
1398
|
"m3.medium",
|
|
@@ -1436,13 +1466,13 @@ var TypeSchema = z31.union([
|
|
|
1436
1466
|
"r6gd.12xlarge",
|
|
1437
1467
|
"r6gd.16xlarge"
|
|
1438
1468
|
]),
|
|
1439
|
-
|
|
1469
|
+
z32.string()
|
|
1440
1470
|
]).describe("Instance type of data nodes in the cluster.");
|
|
1441
|
-
var CountSchema =
|
|
1471
|
+
var CountSchema = z32.number().int().min(1).describe("Number of instances in the cluster.");
|
|
1442
1472
|
var StorageSizeSchema = SizeSchema.refine(sizeMin(gibibytes3(10)), "Minimum storage size is 10 GB").refine(sizeMax(gibibytes3(100)), "Maximum storage size is 100 GB").describe("The size of the function's /tmp directory. You can specify a size value from 512 MB to 10 GiB.");
|
|
1443
|
-
var SearchsSchema =
|
|
1473
|
+
var SearchsSchema = z32.record(
|
|
1444
1474
|
ResourceIdSchema,
|
|
1445
|
-
|
|
1475
|
+
z32.object({
|
|
1446
1476
|
type: TypeSchema.default("t3.small"),
|
|
1447
1477
|
count: CountSchema.default(1),
|
|
1448
1478
|
version: VersionSchema.default("2.13"),
|
|
@@ -1453,12 +1483,12 @@ var SearchsSchema = z31.record(
|
|
|
1453
1483
|
).optional().describe("Define the search instances in your stack. Backed by OpenSearch.");
|
|
1454
1484
|
|
|
1455
1485
|
// src/feature/site/schema.ts
|
|
1456
|
-
import { z as
|
|
1486
|
+
import { z as z34 } from "zod";
|
|
1457
1487
|
|
|
1458
1488
|
// src/config/schema/local-entry.ts
|
|
1459
1489
|
import { stat as stat3 } from "fs/promises";
|
|
1460
|
-
import { z as
|
|
1461
|
-
var LocalEntrySchema =
|
|
1490
|
+
import { z as z33 } from "zod";
|
|
1491
|
+
var LocalEntrySchema = z33.union([
|
|
1462
1492
|
RelativePathSchema.refine(async (path) => {
|
|
1463
1493
|
try {
|
|
1464
1494
|
const s = await stat3(path);
|
|
@@ -1467,7 +1497,7 @@ var LocalEntrySchema = z32.union([
|
|
|
1467
1497
|
return false;
|
|
1468
1498
|
}
|
|
1469
1499
|
}, `File or directory doesn't exist`),
|
|
1470
|
-
|
|
1500
|
+
z33.object({
|
|
1471
1501
|
nocheck: RelativePathSchema.describe(
|
|
1472
1502
|
"Specifies a local file or directory without checking if the file or directory exists."
|
|
1473
1503
|
)
|
|
@@ -1475,21 +1505,21 @@ var LocalEntrySchema = z32.union([
|
|
|
1475
1505
|
]);
|
|
1476
1506
|
|
|
1477
1507
|
// src/feature/site/schema.ts
|
|
1478
|
-
var SitesSchema =
|
|
1508
|
+
var SitesSchema = z34.record(
|
|
1479
1509
|
ResourceIdSchema,
|
|
1480
|
-
|
|
1510
|
+
z34.object({
|
|
1481
1511
|
router: ResourceIdSchema.describe("The router id to link your site with."),
|
|
1482
1512
|
path: RouteSchema2.describe("The path inside the router to link your site to."),
|
|
1483
|
-
build:
|
|
1484
|
-
command:
|
|
1513
|
+
build: z34.object({
|
|
1514
|
+
command: z34.string().describe(
|
|
1485
1515
|
`Specifies the files and directories to generate the cache key for your custom build command.`
|
|
1486
1516
|
),
|
|
1487
|
-
cacheKey:
|
|
1517
|
+
cacheKey: z34.union([LocalEntrySchema.transform((v) => [v]), LocalEntrySchema.array()]).describe(
|
|
1488
1518
|
`Specifies the files and directories to generate the cache key for your custom build command.`
|
|
1489
1519
|
),
|
|
1490
|
-
configs:
|
|
1520
|
+
configs: z34.string().array().optional().describe("Define the config values for your build command.")
|
|
1491
1521
|
}).optional().describe(`Specifies the build process for sites that need a build step.`),
|
|
1492
|
-
static:
|
|
1522
|
+
static: z34.union([LocalDirectorySchema, z34.boolean()]).optional().describe(
|
|
1493
1523
|
"Specifies the path to the static files directory. Additionally you can also pass `true` when you don't have local static files, but still want to make an S3 bucket."
|
|
1494
1524
|
),
|
|
1495
1525
|
ssr: FunctionSchema.optional().describe("Specifies the file that will render the site on the server.")
|
|
@@ -1497,45 +1527,45 @@ var SitesSchema = z33.record(
|
|
|
1497
1527
|
).optional().describe("Define the sites in your stack.");
|
|
1498
1528
|
|
|
1499
1529
|
// src/feature/store/schema.ts
|
|
1500
|
-
import { z as
|
|
1501
|
-
var StoresSchema =
|
|
1502
|
-
|
|
1530
|
+
import { z as z35 } from "zod";
|
|
1531
|
+
var StoresSchema = z35.union([
|
|
1532
|
+
z35.array(ResourceIdSchema).transform((list) => {
|
|
1503
1533
|
const stores = {};
|
|
1504
1534
|
for (const key of list) {
|
|
1505
1535
|
stores[key] = {};
|
|
1506
1536
|
}
|
|
1507
1537
|
return stores;
|
|
1508
1538
|
}),
|
|
1509
|
-
|
|
1539
|
+
z35.record(
|
|
1510
1540
|
ResourceIdSchema,
|
|
1511
|
-
|
|
1541
|
+
z35.object({
|
|
1512
1542
|
static: LocalDirectorySchema.optional().describe("Specifies the path to the static files directory."),
|
|
1513
|
-
versioning:
|
|
1514
|
-
events:
|
|
1543
|
+
versioning: z35.boolean().default(false).describe("Enable versioning of your store."),
|
|
1544
|
+
events: z35.object({
|
|
1515
1545
|
// create
|
|
1516
|
-
"created:*":
|
|
1546
|
+
"created:*": TaskSchema.optional().describe(
|
|
1517
1547
|
"Subscribe to notifications regardless of the API that was used to create an object."
|
|
1518
1548
|
),
|
|
1519
|
-
"created:put":
|
|
1549
|
+
"created:put": TaskSchema.optional().describe(
|
|
1520
1550
|
"Subscribe to notifications when an object is created using the PUT API operation."
|
|
1521
1551
|
),
|
|
1522
|
-
"created:post":
|
|
1552
|
+
"created:post": TaskSchema.optional().describe(
|
|
1523
1553
|
"Subscribe to notifications when an object is created using the POST API operation."
|
|
1524
1554
|
),
|
|
1525
|
-
"created:copy":
|
|
1555
|
+
"created:copy": TaskSchema.optional().describe(
|
|
1526
1556
|
"Subscribe to notifications when an object is created using the COPY API operation."
|
|
1527
1557
|
),
|
|
1528
|
-
"created:upload":
|
|
1558
|
+
"created:upload": TaskSchema.optional().describe(
|
|
1529
1559
|
"Subscribe to notifications when an object multipart upload has been completed."
|
|
1530
1560
|
),
|
|
1531
1561
|
// remove
|
|
1532
|
-
"removed:*":
|
|
1562
|
+
"removed:*": TaskSchema.optional().describe(
|
|
1533
1563
|
"Subscribe to notifications when an object is deleted or a delete marker for a versioned object is created."
|
|
1534
1564
|
),
|
|
1535
|
-
"removed:delete":
|
|
1565
|
+
"removed:delete": TaskSchema.optional().describe(
|
|
1536
1566
|
"Subscribe to notifications when an object is deleted"
|
|
1537
1567
|
),
|
|
1538
|
-
"removed:marker":
|
|
1568
|
+
"removed:marker": TaskSchema.optional().describe(
|
|
1539
1569
|
"Subscribe to notifications when a delete marker for a versioned object is created."
|
|
1540
1570
|
)
|
|
1541
1571
|
}).optional().describe("Describes the store events you want to subscribe too.")
|
|
@@ -1544,30 +1574,30 @@ var StoresSchema = z34.union([
|
|
|
1544
1574
|
]).optional().describe("Define the stores in your stack.");
|
|
1545
1575
|
|
|
1546
1576
|
// src/feature/icon/schema.ts
|
|
1547
|
-
import { z as
|
|
1577
|
+
import { z as z36 } from "zod";
|
|
1548
1578
|
var staticOriginSchema = LocalDirectorySchema.describe(
|
|
1549
1579
|
"Specifies the path to a local image directory that will be uploaded in S3."
|
|
1550
1580
|
);
|
|
1551
1581
|
var functionOriginSchema = FunctionSchema.describe(
|
|
1552
1582
|
"Specifies the file that will be called when an image isn't found in the (cache) bucket."
|
|
1553
1583
|
);
|
|
1554
|
-
var IconsSchema =
|
|
1584
|
+
var IconsSchema = z36.record(
|
|
1555
1585
|
ResourceIdSchema,
|
|
1556
|
-
|
|
1586
|
+
z36.object({
|
|
1557
1587
|
// domain: ResourceIdSchema.describe('The domain id to link your site with.').optional(),
|
|
1558
1588
|
// subDomain: z.string().optional(),
|
|
1559
1589
|
router: ResourceIdSchema.describe("The router id to link your icon proxy."),
|
|
1560
1590
|
path: RouteSchema2.describe("The path inside the router to link your icon proxy to."),
|
|
1561
1591
|
log: LogSchema.optional(),
|
|
1562
1592
|
cacheDuration: DurationSchema.optional().describe("The cache duration of the cached icons."),
|
|
1563
|
-
preserveIds:
|
|
1564
|
-
symbols:
|
|
1565
|
-
origin:
|
|
1566
|
-
|
|
1593
|
+
preserveIds: z36.boolean().optional().default(false).describe("Preserve the IDs of the icons."),
|
|
1594
|
+
symbols: z36.boolean().optional().default(false).describe(`Convert the SVG's to SVG symbols.`),
|
|
1595
|
+
origin: z36.union([
|
|
1596
|
+
z36.object({
|
|
1567
1597
|
static: staticOriginSchema,
|
|
1568
1598
|
function: functionOriginSchema.optional()
|
|
1569
1599
|
}),
|
|
1570
|
-
|
|
1600
|
+
z36.object({
|
|
1571
1601
|
static: staticOriginSchema.optional(),
|
|
1572
1602
|
function: functionOriginSchema
|
|
1573
1603
|
})
|
|
@@ -1594,13 +1624,13 @@ var IconsSchema = z35.record(
|
|
|
1594
1624
|
).optional().describe("Define an svg icon proxy in your stack. Store, optimize, and deliver svg icons at scale.");
|
|
1595
1625
|
|
|
1596
1626
|
// src/feature/image/schema.ts
|
|
1597
|
-
import { z as
|
|
1598
|
-
var transformationOptionsSchema =
|
|
1599
|
-
width:
|
|
1600
|
-
height:
|
|
1601
|
-
fit:
|
|
1602
|
-
position:
|
|
1603
|
-
quality:
|
|
1627
|
+
import { z as z37 } from "zod";
|
|
1628
|
+
var transformationOptionsSchema = z37.object({
|
|
1629
|
+
width: z37.number().int().positive().optional(),
|
|
1630
|
+
height: z37.number().int().positive().optional(),
|
|
1631
|
+
fit: z37.enum(["cover", "contain", "fill", "inside", "outside"]).optional(),
|
|
1632
|
+
position: z37.enum(["top", "right top", "right", "right bottom", "bottom", "left bottom", "left", "left top", "center"]).optional(),
|
|
1633
|
+
quality: z37.number().int().min(1).max(100).optional()
|
|
1604
1634
|
});
|
|
1605
1635
|
var staticOriginSchema2 = LocalDirectorySchema.describe(
|
|
1606
1636
|
"Specifies the path to a local image directory that will be uploaded in S3."
|
|
@@ -1608,38 +1638,38 @@ var staticOriginSchema2 = LocalDirectorySchema.describe(
|
|
|
1608
1638
|
var functionOriginSchema2 = FunctionSchema.describe(
|
|
1609
1639
|
"Specifies the file that will be called when an image isn't found in the (cache) bucket."
|
|
1610
1640
|
);
|
|
1611
|
-
var ImagesSchema =
|
|
1641
|
+
var ImagesSchema = z37.record(
|
|
1612
1642
|
ResourceIdSchema,
|
|
1613
|
-
|
|
1643
|
+
z37.object({
|
|
1614
1644
|
// domain: ResourceIdSchema.describe('The domain id to link your site with.').optional(),
|
|
1615
1645
|
// subDomain: z.string().optional(),
|
|
1616
1646
|
router: ResourceIdSchema.describe("The router id to link your image proxy."),
|
|
1617
1647
|
path: RouteSchema2.describe("The path inside the router to link your image proxy to."),
|
|
1618
1648
|
log: LogSchema.optional(),
|
|
1619
1649
|
cacheDuration: DurationSchema.optional().describe("Cache duration of the cached images."),
|
|
1620
|
-
presets:
|
|
1621
|
-
extensions:
|
|
1622
|
-
jpg:
|
|
1623
|
-
mozjpeg:
|
|
1624
|
-
progressive:
|
|
1650
|
+
presets: z37.record(z37.string(), transformationOptionsSchema).describe("Named presets for image transformations"),
|
|
1651
|
+
extensions: z37.object({
|
|
1652
|
+
jpg: z37.object({
|
|
1653
|
+
mozjpeg: z37.boolean().optional(),
|
|
1654
|
+
progressive: z37.boolean().optional()
|
|
1625
1655
|
}).optional(),
|
|
1626
|
-
webp:
|
|
1627
|
-
effort:
|
|
1628
|
-
lossless:
|
|
1629
|
-
nearLossless:
|
|
1656
|
+
webp: z37.object({
|
|
1657
|
+
effort: z37.number().int().min(1).max(10).default(7).optional(),
|
|
1658
|
+
lossless: z37.boolean().optional(),
|
|
1659
|
+
nearLossless: z37.boolean().optional()
|
|
1630
1660
|
}).optional(),
|
|
1631
|
-
png:
|
|
1632
|
-
compressionLevel:
|
|
1661
|
+
png: z37.object({
|
|
1662
|
+
compressionLevel: z37.number().int().min(0).max(9).default(6).optional()
|
|
1633
1663
|
}).optional()
|
|
1634
1664
|
}).refine((data) => {
|
|
1635
1665
|
return Object.keys(data).length > 0;
|
|
1636
1666
|
}, "At least one extension must be defined.").describe("Specify the allowed extensions."),
|
|
1637
|
-
origin:
|
|
1638
|
-
|
|
1667
|
+
origin: z37.union([
|
|
1668
|
+
z37.object({
|
|
1639
1669
|
static: staticOriginSchema2,
|
|
1640
1670
|
function: functionOriginSchema2.optional()
|
|
1641
1671
|
}),
|
|
1642
|
-
|
|
1672
|
+
z37.object({
|
|
1643
1673
|
static: staticOriginSchema2.optional(),
|
|
1644
1674
|
function: functionOriginSchema2
|
|
1645
1675
|
})
|
|
@@ -1654,7 +1684,7 @@ var ImagesSchema = z36.record(
|
|
|
1654
1684
|
).optional().describe("Define an image proxy in your stack. Store, transform, optimize, and deliver images at scale.");
|
|
1655
1685
|
|
|
1656
1686
|
// src/feature/metric/schema.ts
|
|
1657
|
-
import { z as
|
|
1687
|
+
import { z as z38 } from "zod";
|
|
1658
1688
|
var ops = {
|
|
1659
1689
|
">": "GreaterThanThreshold",
|
|
1660
1690
|
">=": "GreaterThanOrEqualToThreshold",
|
|
@@ -1668,15 +1698,15 @@ var stats = {
|
|
|
1668
1698
|
min: "Minimum",
|
|
1669
1699
|
max: "Maximum"
|
|
1670
1700
|
};
|
|
1671
|
-
var WhereSchema =
|
|
1672
|
-
|
|
1701
|
+
var WhereSchema = z38.union([
|
|
1702
|
+
z38.string().regex(/(count|avg|sum|min|max) (>|>=|<|<=) (\d)/, "Invalid where query").transform((where) => {
|
|
1673
1703
|
const [stat4, op, value] = where.split(" ");
|
|
1674
1704
|
return { stat: stat4, op, value: parseFloat(value) };
|
|
1675
1705
|
}),
|
|
1676
|
-
|
|
1677
|
-
stat:
|
|
1678
|
-
op:
|
|
1679
|
-
value:
|
|
1706
|
+
z38.object({
|
|
1707
|
+
stat: z38.enum(["count", "avg", "sum", "min", "max"]),
|
|
1708
|
+
op: z38.enum([">", ">=", "<", "<="]),
|
|
1709
|
+
value: z38.number()
|
|
1680
1710
|
})
|
|
1681
1711
|
]).transform((where) => {
|
|
1682
1712
|
return {
|
|
@@ -1685,39 +1715,39 @@ var WhereSchema = z37.union([
|
|
|
1685
1715
|
value: where.value
|
|
1686
1716
|
};
|
|
1687
1717
|
});
|
|
1688
|
-
var AlarmSchema =
|
|
1689
|
-
description:
|
|
1718
|
+
var AlarmSchema = z38.object({
|
|
1719
|
+
description: z38.string().optional(),
|
|
1690
1720
|
where: WhereSchema,
|
|
1691
1721
|
period: DurationSchema,
|
|
1692
|
-
minDataPoints:
|
|
1693
|
-
trigger:
|
|
1722
|
+
minDataPoints: z38.number().int().default(1),
|
|
1723
|
+
trigger: z38.union([EmailSchema.transform((v) => [v]), EmailSchema.array(), FunctionSchema])
|
|
1694
1724
|
});
|
|
1695
|
-
var MetricsSchema =
|
|
1725
|
+
var MetricsSchema = z38.record(
|
|
1696
1726
|
ResourceIdSchema,
|
|
1697
|
-
|
|
1698
|
-
type:
|
|
1727
|
+
z38.object({
|
|
1728
|
+
type: z38.enum(["number", "size", "duration"]),
|
|
1699
1729
|
alarms: AlarmSchema.array().optional()
|
|
1700
1730
|
})
|
|
1701
1731
|
).optional().describe("Define the metrics in your stack.");
|
|
1702
1732
|
|
|
1703
1733
|
// src/feature/table/schema.ts
|
|
1704
1734
|
import { minutes as minutes5, seconds as seconds4 } from "@awsless/duration";
|
|
1705
|
-
import { z as
|
|
1706
|
-
var KeySchema =
|
|
1707
|
-
var TablesSchema =
|
|
1735
|
+
import { z as z39 } from "zod";
|
|
1736
|
+
var KeySchema = z39.string().min(1).max(255);
|
|
1737
|
+
var TablesSchema = z39.record(
|
|
1708
1738
|
ResourceIdSchema,
|
|
1709
|
-
|
|
1739
|
+
z39.object({
|
|
1710
1740
|
hash: KeySchema.describe(
|
|
1711
1741
|
"Specifies the name of the partition / hash key that makes up the primary key for the table."
|
|
1712
1742
|
),
|
|
1713
1743
|
sort: KeySchema.optional().describe(
|
|
1714
1744
|
"Specifies the name of the range / sort key that makes up the primary key for the table."
|
|
1715
1745
|
),
|
|
1716
|
-
fields:
|
|
1746
|
+
fields: z39.record(z39.string(), z39.enum(["string", "number", "binary"])).optional().describe(
|
|
1717
1747
|
'A list of attributes that describe the key schema for the table and indexes. If no attribute field is defined we default to "string".'
|
|
1718
1748
|
),
|
|
1719
|
-
class:
|
|
1720
|
-
pointInTimeRecovery:
|
|
1749
|
+
class: z39.enum(["standard", "standard-infrequent-access"]).default("standard").describe("The table class of the table."),
|
|
1750
|
+
pointInTimeRecovery: z39.boolean().default(false).describe("Indicates whether point in time recovery is enabled on the table."),
|
|
1721
1751
|
ttl: KeySchema.optional().describe(
|
|
1722
1752
|
[
|
|
1723
1753
|
"The name of the TTL attribute used to store the expiration time for items in the table.",
|
|
@@ -1725,8 +1755,8 @@ var TablesSchema = z38.record(
|
|
|
1725
1755
|
].join("\n")
|
|
1726
1756
|
),
|
|
1727
1757
|
// deletionProtection: DeletionProtectionSchema.optional(),
|
|
1728
|
-
stream:
|
|
1729
|
-
type:
|
|
1758
|
+
stream: z39.object({
|
|
1759
|
+
type: z39.enum(["keys-only", "new-image", "old-image", "new-and-old-images"]).describe(
|
|
1730
1760
|
[
|
|
1731
1761
|
"When an item in the table is modified, you can determines what information is written to the stream for this table.",
|
|
1732
1762
|
"Valid values are:",
|
|
@@ -1736,7 +1766,7 @@ var TablesSchema = z38.record(
|
|
|
1736
1766
|
"- new-and-old-images - Both the new and the old item images of the item are written to the stream."
|
|
1737
1767
|
].join("\n")
|
|
1738
1768
|
),
|
|
1739
|
-
batchSize:
|
|
1769
|
+
batchSize: z39.number().min(1).max(1e4).default(1).describe(
|
|
1740
1770
|
[
|
|
1741
1771
|
"The maximum number of records in each batch that Lambda pulls from your stream and sends to your function.",
|
|
1742
1772
|
"Lambda passes all of the records in the batch to the function in a single call, up to the payload limit for synchronous invocation (6 MB).",
|
|
@@ -1752,17 +1782,20 @@ var TablesSchema = z38.record(
|
|
|
1752
1782
|
"You can specify a duration from 1 seconds to 5 minutes."
|
|
1753
1783
|
].join("\n")
|
|
1754
1784
|
),
|
|
1755
|
-
maxRecordAge: DurationSchema.refine(
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1785
|
+
// maxRecordAge: DurationSchema.refine(
|
|
1786
|
+
// durationMin(seconds(1)),
|
|
1787
|
+
// 'Minimum record age duration is 1 second'
|
|
1788
|
+
// )
|
|
1789
|
+
// .refine(durationMax(minutes(1)), 'Maximum record age duration is 1 minute')
|
|
1790
|
+
// .default('60 seconds')
|
|
1791
|
+
// .describe(
|
|
1792
|
+
// [
|
|
1793
|
+
// 'Discard records older than the specified age.',
|
|
1794
|
+
// 'The maximum valid value for maximum record age is 60s.',
|
|
1795
|
+
// 'The default value is 60s',
|
|
1796
|
+
// ].join('\n')
|
|
1797
|
+
// ),
|
|
1798
|
+
retryAttempts: z39.number().min(-1).max(1e4).default(2).describe(
|
|
1766
1799
|
[
|
|
1767
1800
|
"Discard records after the specified number of retries.",
|
|
1768
1801
|
"-1 will sets the maximum number of retries to infinite.",
|
|
@@ -1771,7 +1804,7 @@ var TablesSchema = z38.record(
|
|
|
1771
1804
|
"The default value is 2"
|
|
1772
1805
|
].join("\n")
|
|
1773
1806
|
),
|
|
1774
|
-
concurrencyPerShard:
|
|
1807
|
+
concurrencyPerShard: z39.number().min(1).max(10).default(1).describe(
|
|
1775
1808
|
[
|
|
1776
1809
|
"The number of batches to process concurrently from each shard.",
|
|
1777
1810
|
"You can specify a number from 1 to 10."
|
|
@@ -1781,16 +1814,16 @@ var TablesSchema = z38.record(
|
|
|
1781
1814
|
}).optional().describe(
|
|
1782
1815
|
"The settings for the DynamoDB table stream, which capture changes to items stored in the table."
|
|
1783
1816
|
),
|
|
1784
|
-
indexes:
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
hash:
|
|
1817
|
+
indexes: z39.record(
|
|
1818
|
+
z39.string(),
|
|
1819
|
+
z39.object({
|
|
1820
|
+
hash: z39.union([KeySchema.transform((v) => [v]), KeySchema.array()]).describe(
|
|
1788
1821
|
"Specifies the name of the partition / hash key that makes up the primary key for the global secondary index."
|
|
1789
1822
|
),
|
|
1790
|
-
sort:
|
|
1823
|
+
sort: z39.union([KeySchema.transform((v) => [v]), KeySchema.array()]).optional().describe(
|
|
1791
1824
|
"Specifies the name of the range / sort key that makes up the primary key for the global secondary index."
|
|
1792
1825
|
),
|
|
1793
|
-
projection:
|
|
1826
|
+
projection: z39.enum(["all", "keys-only"]).default("all").describe(
|
|
1794
1827
|
[
|
|
1795
1828
|
"The set of attributes that are projected into the index:",
|
|
1796
1829
|
"- all - All of the table attributes are projected into the index.",
|
|
@@ -1803,29 +1836,6 @@ var TablesSchema = z38.record(
|
|
|
1803
1836
|
})
|
|
1804
1837
|
).optional().describe("Define the tables in your stack.");
|
|
1805
1838
|
|
|
1806
|
-
// src/feature/task/schema.ts
|
|
1807
|
-
import { z as z39 } from "zod";
|
|
1808
|
-
var RetryAttemptsSchema3 = z39.number().int().min(0).max(2).describe(
|
|
1809
|
-
"The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 2."
|
|
1810
|
-
);
|
|
1811
|
-
var TaskSchema = z39.union([
|
|
1812
|
-
LocalFileSchema.transform((file) => ({
|
|
1813
|
-
consumer: {
|
|
1814
|
-
code: {
|
|
1815
|
-
file,
|
|
1816
|
-
minify: true,
|
|
1817
|
-
external: []
|
|
1818
|
-
}
|
|
1819
|
-
},
|
|
1820
|
-
retryAttempts: void 0
|
|
1821
|
-
})),
|
|
1822
|
-
z39.object({
|
|
1823
|
-
consumer: FunctionSchema,
|
|
1824
|
-
retryAttempts: RetryAttemptsSchema3.optional()
|
|
1825
|
-
})
|
|
1826
|
-
]);
|
|
1827
|
-
var TasksSchema = z39.record(ResourceIdSchema, TaskSchema).optional().describe("Define the tasks in your stack.");
|
|
1828
|
-
|
|
1829
1839
|
// src/feature/test/schema.ts
|
|
1830
1840
|
import { z as z40 } from "zod";
|
|
1831
1841
|
var TestsSchema = z40.union([
|