@awsless/awsless 0.0.658 → 0.0.660
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 +393 -366
- package/dist/build-json-schema.js +170 -181
- package/dist/prebuild/icon/HASH +1 -1
- package/dist/prebuild/icon/bundle.zip +0 -0
- package/dist/prebuild/image/HASH +1 -1
- package/dist/prebuild/image/bundle.zip +0 -0
- package/dist/prebuild/on-error-log/HASH +1 -0
- package/dist/prebuild/on-error-log/bundle.zip +0 -0
- package/dist/prebuild/on-failure/HASH +1 -1
- package/dist/prebuild/on-failure/bundle.zip +0 -0
- package/dist/prebuild/rpc/HASH +1 -1
- package/dist/prebuild/rpc/bundle.zip +0 -0
- package/dist/prebuild.js +2 -1
- package/dist/server.d.ts +15 -2
- package/dist/server.js +20 -5
- package/package.json +14 -14
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// cli/build-json-schema.ts
|
|
2
|
-
import { writeFileSync } from "
|
|
3
|
-
import { join as join2 } from "
|
|
2
|
+
import { writeFileSync } from "fs";
|
|
3
|
+
import { join as join2 } from "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 z25 } from "zod";
|
|
8
8
|
|
|
9
9
|
// src/feature/alert/schema.ts
|
|
10
10
|
import { kebabCase } from "change-case";
|
|
@@ -362,19 +362,41 @@ var LayerSchema = z13.record(
|
|
|
362
362
|
])
|
|
363
363
|
).optional().describe("Define the lambda layers in your stack.");
|
|
364
364
|
|
|
365
|
-
// src/feature/
|
|
365
|
+
// src/feature/task/schema.ts
|
|
366
366
|
import { z as z14 } from "zod";
|
|
367
|
-
var
|
|
367
|
+
var RetryAttemptsSchema = z14.number().int().min(0).max(2).describe(
|
|
368
|
+
"The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 2."
|
|
369
|
+
);
|
|
370
|
+
var TaskSchema = z14.union([
|
|
371
|
+
FunctionSchema.transform((consumer) => ({
|
|
372
|
+
consumer,
|
|
373
|
+
retryAttempts: 2
|
|
374
|
+
})),
|
|
375
|
+
z14.object({
|
|
376
|
+
consumer: FunctionSchema,
|
|
377
|
+
retryAttempts: RetryAttemptsSchema.default(2)
|
|
378
|
+
})
|
|
379
|
+
]);
|
|
380
|
+
var TasksSchema = z14.record(ResourceIdSchema, TaskSchema).optional().describe("Define the tasks in your stack.");
|
|
381
|
+
|
|
382
|
+
// src/feature/on-error-log/schema.ts
|
|
383
|
+
var OnErrorLogDefaultSchema = TaskSchema.optional().describe(
|
|
384
|
+
"Define a subscription on all Lambda functions logs."
|
|
385
|
+
);
|
|
386
|
+
|
|
387
|
+
// src/feature/on-failure/schema.ts
|
|
388
|
+
import { z as z15 } from "zod";
|
|
389
|
+
var NotifySchema = z15.union([
|
|
368
390
|
//
|
|
369
391
|
EmailSchema.transform((v) => [v]),
|
|
370
392
|
EmailSchema.array()
|
|
371
393
|
]).describe("Receive an email notification when consuming failure entries goes wrong.");
|
|
372
|
-
var OnFailureDefaultSchema =
|
|
394
|
+
var OnFailureDefaultSchema = z15.union([
|
|
373
395
|
FunctionSchema.transform((consumer) => ({
|
|
374
396
|
consumer,
|
|
375
397
|
notify: []
|
|
376
398
|
})),
|
|
377
|
-
|
|
399
|
+
z15.object({
|
|
378
400
|
consumer: FunctionSchema,
|
|
379
401
|
notify: NotifySchema.optional()
|
|
380
402
|
})
|
|
@@ -390,20 +412,6 @@ var OnFailureDefaultSchema = z14.union([
|
|
|
390
412
|
].join("\n")
|
|
391
413
|
);
|
|
392
414
|
|
|
393
|
-
// src/feature/on-log/schema.ts
|
|
394
|
-
import { z as z15 } from "zod";
|
|
395
|
-
var FilterSchema = z15.enum(["trace", "debug", "info", "warn", "error", "fatal"]).array().describe("The log level that will gets delivered to the consumer.");
|
|
396
|
-
var OnLogDefaultSchema = z15.union([
|
|
397
|
-
FunctionSchema.transform((consumer) => ({
|
|
398
|
-
consumer,
|
|
399
|
-
filter: ["error", "fatal"]
|
|
400
|
-
})),
|
|
401
|
-
z15.object({
|
|
402
|
-
consumer: FunctionSchema,
|
|
403
|
-
filter: FilterSchema
|
|
404
|
-
})
|
|
405
|
-
]).optional().describe("Define a subscription on all Lambda functions logs.");
|
|
406
|
-
|
|
407
415
|
// src/feature/pubsub/schema.ts
|
|
408
416
|
import { z as z16 } from "zod";
|
|
409
417
|
var DomainSchema = ResourceIdSchema.describe("The domain id to link your Pubsub API with.");
|
|
@@ -428,7 +436,7 @@ var PubSubDefaultSchema = z16.record(
|
|
|
428
436
|
// .optional(),
|
|
429
437
|
})
|
|
430
438
|
).optional().describe("Define the pubsub subscriber in your stack.");
|
|
431
|
-
var
|
|
439
|
+
var RetryAttemptsSchema2 = z16.number().int().min(0).max(2).describe(
|
|
432
440
|
"The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 2."
|
|
433
441
|
);
|
|
434
442
|
var PubSubSchema = z16.record(
|
|
@@ -437,7 +445,7 @@ var PubSubSchema = z16.record(
|
|
|
437
445
|
sql: z16.string().describe("The SQL statement used to query the IOT topic."),
|
|
438
446
|
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."),
|
|
439
447
|
consumer: FunctionSchema.describe("The consuming lambda function properties."),
|
|
440
|
-
retryAttempts:
|
|
448
|
+
retryAttempts: RetryAttemptsSchema2.default(2)
|
|
441
449
|
})
|
|
442
450
|
).optional().describe("Define the pubsub subscriber in your stack.");
|
|
443
451
|
|
|
@@ -484,7 +492,7 @@ var MaxBatchingWindow = DurationSchema.refine(
|
|
|
484
492
|
).describe(
|
|
485
493
|
"The maximum amount of time, that Lambda spends gathering records before invoking the function. You can specify an duration from 0 seconds to 5 minutes."
|
|
486
494
|
);
|
|
487
|
-
var
|
|
495
|
+
var RetryAttemptsSchema3 = z17.number().int().min(0).max(999).describe(
|
|
488
496
|
"The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 999."
|
|
489
497
|
);
|
|
490
498
|
var QueueDefaultSchema = z17.object({
|
|
@@ -496,7 +504,7 @@ var QueueDefaultSchema = z17.object({
|
|
|
496
504
|
batchSize: BatchSizeSchema.default(10),
|
|
497
505
|
maxConcurrency: MaxConcurrencySchema.optional(),
|
|
498
506
|
maxBatchingWindow: MaxBatchingWindow.optional(),
|
|
499
|
-
retryAttempts:
|
|
507
|
+
retryAttempts: RetryAttemptsSchema3.default(2)
|
|
500
508
|
}).default({});
|
|
501
509
|
var QueueSchema = z17.object({
|
|
502
510
|
consumer: FunctionSchema.optional().describe("The consuming lambda function properties."),
|
|
@@ -508,7 +516,7 @@ var QueueSchema = z17.object({
|
|
|
508
516
|
batchSize: BatchSizeSchema.optional(),
|
|
509
517
|
maxConcurrency: MaxConcurrencySchema.optional(),
|
|
510
518
|
maxBatchingWindow: MaxBatchingWindow.optional(),
|
|
511
|
-
retryAttempts:
|
|
519
|
+
retryAttempts: RetryAttemptsSchema3.optional()
|
|
512
520
|
});
|
|
513
521
|
var QueuesSchema = z17.record(
|
|
514
522
|
ResourceIdSchema,
|
|
@@ -904,34 +912,15 @@ var InstanceDefaultSchema = z22.object({
|
|
|
904
912
|
|
|
905
913
|
// src/feature/topic/schema.ts
|
|
906
914
|
import { kebabCase as kebabCase3 } from "change-case";
|
|
907
|
-
import { z as z24 } from "zod";
|
|
908
|
-
|
|
909
|
-
// src/feature/task/schema.ts
|
|
910
915
|
import { z as z23 } from "zod";
|
|
911
|
-
var
|
|
912
|
-
|
|
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) => {
|
|
916
|
+
var TopicNameSchema = z23.string().min(3).max(256).regex(/^[a-z0-9\-]+$/i, "Invalid topic name").transform((value) => kebabCase3(value)).describe("Define event topic name.");
|
|
917
|
+
var TopicsDefaultSchema = z23.array(TopicNameSchema).refine((topics) => {
|
|
929
918
|
return topics.length === new Set(topics).size;
|
|
930
919
|
}, "Must be a list of unique topic names").optional().describe("Define the event topics for your app.");
|
|
931
|
-
var SubscribersSchema =
|
|
920
|
+
var SubscribersSchema = z23.record(TopicNameSchema, TaskSchema).optional().describe("Define the event topics to subscribe too in your stack.");
|
|
932
921
|
|
|
933
922
|
// src/config/schema/region.ts
|
|
934
|
-
import { z as
|
|
923
|
+
import { z as z24 } from "zod";
|
|
935
924
|
var US = ["us-east-2", "us-east-1", "us-west-1", "us-west-2"];
|
|
936
925
|
var AF = ["af-south-1"];
|
|
937
926
|
var AP = [
|
|
@@ -960,16 +949,16 @@ var EU = [
|
|
|
960
949
|
var ME = ["me-south-1", "me-central-1"];
|
|
961
950
|
var SA = ["sa-east-1"];
|
|
962
951
|
var regions = [...US, ...AF, ...AP, ...CA, ...EU, ...ME, ...SA];
|
|
963
|
-
var RegionSchema =
|
|
952
|
+
var RegionSchema = z24.enum(regions);
|
|
964
953
|
|
|
965
954
|
// src/config/app.ts
|
|
966
|
-
var AppSchema =
|
|
967
|
-
$schema:
|
|
955
|
+
var AppSchema = z25.object({
|
|
956
|
+
$schema: z25.string().optional(),
|
|
968
957
|
name: ResourceIdSchema.describe("App name."),
|
|
969
958
|
region: RegionSchema.describe("The AWS region to deploy to."),
|
|
970
|
-
profile:
|
|
971
|
-
protect:
|
|
972
|
-
removal:
|
|
959
|
+
profile: z25.string().describe("The AWS profile to deploy to."),
|
|
960
|
+
protect: z25.boolean().default(false).describe("Protect your app & stacks from being deleted."),
|
|
961
|
+
removal: z25.enum(["remove", "retain"]).default("remove").describe(
|
|
973
962
|
[
|
|
974
963
|
"Configure how your resources are handled when they have to be removed.",
|
|
975
964
|
"",
|
|
@@ -983,9 +972,9 @@ var AppSchema = z26.object({
|
|
|
983
972
|
// .default('prod')
|
|
984
973
|
// .describe('The deployment stage.'),
|
|
985
974
|
// onFailure: OnFailureSchema,
|
|
986
|
-
defaults:
|
|
975
|
+
defaults: z25.object({
|
|
987
976
|
onFailure: OnFailureDefaultSchema,
|
|
988
|
-
|
|
977
|
+
onErrorLog: OnErrorLogDefaultSchema,
|
|
989
978
|
auth: AuthDefaultSchema,
|
|
990
979
|
domains: DomainsDefaultSchema,
|
|
991
980
|
function: FunctionDefaultSchema,
|
|
@@ -1260,11 +1249,11 @@ var createStagePatchJsonSchema = (baseSchema, title) => {
|
|
|
1260
1249
|
};
|
|
1261
1250
|
|
|
1262
1251
|
// src/config/stack.ts
|
|
1263
|
-
import { z as
|
|
1252
|
+
import { z as z40 } from "zod";
|
|
1264
1253
|
|
|
1265
1254
|
// src/feature/cache/schema.ts
|
|
1266
1255
|
import { gibibytes as gibibytes2 } from "@awsless/size";
|
|
1267
|
-
import { z as
|
|
1256
|
+
import { z as z26 } from "zod";
|
|
1268
1257
|
var StorageSchema = SizeSchema.refine(sizeMin(gibibytes2(1)), "Minimum storage size is 1 GB").refine(
|
|
1269
1258
|
sizeMax(gibibytes2(5e3)),
|
|
1270
1259
|
"Maximum storage size is 5000 GB"
|
|
@@ -1275,31 +1264,31 @@ var MinimumStorageSchema = StorageSchema.describe(
|
|
|
1275
1264
|
var MaximumStorageSchema = StorageSchema.describe(
|
|
1276
1265
|
"The upper limit for data storage the cache is set to use. You can specify a size value from 1 GB to 5000 GB."
|
|
1277
1266
|
);
|
|
1278
|
-
var EcpuSchema =
|
|
1267
|
+
var EcpuSchema = z26.number().int().min(1e3).max(15e6);
|
|
1279
1268
|
var MinimumEcpuSchema = EcpuSchema.describe(
|
|
1280
1269
|
"The minimum number of ECPUs the cache can consume per second. You can specify a integer from 1,000 to 15,000,000."
|
|
1281
1270
|
);
|
|
1282
1271
|
var MaximumEcpuSchema = EcpuSchema.describe(
|
|
1283
1272
|
"The maximum number of ECPUs the cache can consume per second. You can specify a integer from 1,000 to 15,000,000."
|
|
1284
1273
|
);
|
|
1285
|
-
var CachesSchema =
|
|
1274
|
+
var CachesSchema = z26.record(
|
|
1286
1275
|
ResourceIdSchema,
|
|
1287
|
-
|
|
1276
|
+
z26.object({
|
|
1288
1277
|
minStorage: MinimumStorageSchema.optional(),
|
|
1289
1278
|
maxStorage: MaximumStorageSchema.optional(),
|
|
1290
1279
|
minECPU: MinimumEcpuSchema.optional(),
|
|
1291
1280
|
maxECPU: MaximumEcpuSchema.optional(),
|
|
1292
|
-
snapshotRetentionLimit:
|
|
1281
|
+
snapshotRetentionLimit: z26.number().int().positive().default(1)
|
|
1293
1282
|
})
|
|
1294
1283
|
).optional().describe("Define the caches in your stack. For access to the cache put your functions inside the global VPC.");
|
|
1295
1284
|
|
|
1296
1285
|
// src/feature/command/schema.ts
|
|
1297
|
-
import { z as
|
|
1298
|
-
var CommandSchema =
|
|
1299
|
-
|
|
1286
|
+
import { z as z27 } from "zod";
|
|
1287
|
+
var CommandSchema = z27.union([
|
|
1288
|
+
z27.object({
|
|
1300
1289
|
file: LocalFileSchema,
|
|
1301
|
-
handler:
|
|
1302
|
-
description:
|
|
1290
|
+
handler: z27.string().default("default").describe("The name of the handler that needs to run"),
|
|
1291
|
+
description: z27.string().optional().describe("A description of the command")
|
|
1303
1292
|
// options: z.record(ResourceIdSchema, OptionSchema).optional(),
|
|
1304
1293
|
// arguments: z.record(ResourceIdSchema, ArgumentSchema).optional(),
|
|
1305
1294
|
}),
|
|
@@ -1309,22 +1298,22 @@ var CommandSchema = z28.union([
|
|
|
1309
1298
|
description: void 0
|
|
1310
1299
|
}))
|
|
1311
1300
|
]);
|
|
1312
|
-
var CommandsSchema =
|
|
1301
|
+
var CommandsSchema = z27.record(ResourceIdSchema, CommandSchema).optional().describe("Define the custom commands for your stack.");
|
|
1313
1302
|
|
|
1314
1303
|
// src/feature/config/schema.ts
|
|
1315
|
-
import { z as
|
|
1316
|
-
var ConfigNameSchema =
|
|
1317
|
-
var ConfigsSchema =
|
|
1304
|
+
import { z as z28 } from "zod";
|
|
1305
|
+
var ConfigNameSchema = z28.string().regex(/[a-z0-9\-]/g, "Invalid config name");
|
|
1306
|
+
var ConfigsSchema = z28.array(ConfigNameSchema).optional().describe("Define the config values for your stack.");
|
|
1318
1307
|
|
|
1319
1308
|
// src/feature/cron/schema/index.ts
|
|
1320
|
-
import { z as
|
|
1309
|
+
import { z as z30 } from "zod";
|
|
1321
1310
|
|
|
1322
1311
|
// src/feature/cron/schema/schedule.ts
|
|
1323
|
-
import { z as
|
|
1312
|
+
import { z as z29 } from "zod";
|
|
1324
1313
|
import { awsCronExpressionValidator } from "aws-cron-expression-validator";
|
|
1325
|
-
var RateExpressionSchema =
|
|
1314
|
+
var RateExpressionSchema = z29.custom(
|
|
1326
1315
|
(value) => {
|
|
1327
|
-
return
|
|
1316
|
+
return z29.string().regex(/^[0-9]+ (seconds?|minutes?|hours?|days?)$/).refine((rate) => {
|
|
1328
1317
|
const [str] = rate.split(" ");
|
|
1329
1318
|
const number = parseInt(str);
|
|
1330
1319
|
return number > 0;
|
|
@@ -1340,9 +1329,9 @@ var RateExpressionSchema = z30.custom(
|
|
|
1340
1329
|
}
|
|
1341
1330
|
return `rate(${rate})`;
|
|
1342
1331
|
});
|
|
1343
|
-
var CronExpressionSchema =
|
|
1332
|
+
var CronExpressionSchema = z29.custom(
|
|
1344
1333
|
(value) => {
|
|
1345
|
-
return
|
|
1334
|
+
return z29.string().safeParse(value).success;
|
|
1346
1335
|
},
|
|
1347
1336
|
{ message: "Invalid cron expression" }
|
|
1348
1337
|
).superRefine((value, ctx) => {
|
|
@@ -1351,12 +1340,12 @@ var CronExpressionSchema = z30.custom(
|
|
|
1351
1340
|
} catch (error) {
|
|
1352
1341
|
if (error instanceof Error) {
|
|
1353
1342
|
ctx.addIssue({
|
|
1354
|
-
code:
|
|
1343
|
+
code: z29.ZodIssueCode.custom,
|
|
1355
1344
|
message: `Invalid cron expression: ${error.message}`
|
|
1356
1345
|
});
|
|
1357
1346
|
} else {
|
|
1358
1347
|
ctx.addIssue({
|
|
1359
|
-
code:
|
|
1348
|
+
code: z29.ZodIssueCode.custom,
|
|
1360
1349
|
message: "Invalid cron expression"
|
|
1361
1350
|
});
|
|
1362
1351
|
}
|
|
@@ -1367,32 +1356,32 @@ var CronExpressionSchema = z30.custom(
|
|
|
1367
1356
|
var ScheduleExpressionSchema = RateExpressionSchema.or(CronExpressionSchema);
|
|
1368
1357
|
|
|
1369
1358
|
// src/feature/cron/schema/index.ts
|
|
1370
|
-
var RetryAttemptsSchema4 =
|
|
1359
|
+
var RetryAttemptsSchema4 = z30.number().int().min(0).max(2).describe(
|
|
1371
1360
|
"The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 2."
|
|
1372
1361
|
);
|
|
1373
|
-
var CronsSchema =
|
|
1362
|
+
var CronsSchema = z30.record(
|
|
1374
1363
|
ResourceIdSchema,
|
|
1375
|
-
|
|
1376
|
-
enabled:
|
|
1364
|
+
z30.object({
|
|
1365
|
+
enabled: z30.boolean().default(true).describe("If the cron is enabled."),
|
|
1377
1366
|
consumer: FunctionSchema.describe("The consuming lambda function properties."),
|
|
1378
1367
|
schedule: ScheduleExpressionSchema.describe(
|
|
1379
1368
|
'The scheduling expression.\n\nexample: "0 20 * * ? *"\nexample: "5 minutes"'
|
|
1380
1369
|
),
|
|
1381
|
-
payload:
|
|
1370
|
+
payload: z30.unknown().optional().describe("The JSON payload that will be passed to the consumer."),
|
|
1382
1371
|
retryAttempts: RetryAttemptsSchema4.default(2)
|
|
1383
1372
|
})
|
|
1384
1373
|
).optional().describe(`Define the cron jobs in your stack.`);
|
|
1385
1374
|
|
|
1386
1375
|
// src/feature/search/schema.ts
|
|
1387
1376
|
import { gibibytes as gibibytes3 } from "@awsless/size";
|
|
1388
|
-
import { z as
|
|
1389
|
-
var VersionSchema =
|
|
1377
|
+
import { z as z31 } from "zod";
|
|
1378
|
+
var VersionSchema = z31.union([
|
|
1390
1379
|
//
|
|
1391
|
-
|
|
1392
|
-
|
|
1380
|
+
z31.enum(["2.13", "2.11", "2.9", "2.7", "2.5", "2.3", "1.3"]),
|
|
1381
|
+
z31.string()
|
|
1393
1382
|
]).describe("Specify the OpenSearch engine version.");
|
|
1394
|
-
var TypeSchema =
|
|
1395
|
-
|
|
1383
|
+
var TypeSchema = z31.union([
|
|
1384
|
+
z31.enum([
|
|
1396
1385
|
"t3.small",
|
|
1397
1386
|
"t3.medium",
|
|
1398
1387
|
"m3.medium",
|
|
@@ -1466,13 +1455,13 @@ var TypeSchema = z32.union([
|
|
|
1466
1455
|
"r6gd.12xlarge",
|
|
1467
1456
|
"r6gd.16xlarge"
|
|
1468
1457
|
]),
|
|
1469
|
-
|
|
1458
|
+
z31.string()
|
|
1470
1459
|
]).describe("Instance type of data nodes in the cluster.");
|
|
1471
|
-
var CountSchema =
|
|
1460
|
+
var CountSchema = z31.number().int().min(1).describe("Number of instances in the cluster.");
|
|
1472
1461
|
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.");
|
|
1473
|
-
var SearchsSchema =
|
|
1462
|
+
var SearchsSchema = z31.record(
|
|
1474
1463
|
ResourceIdSchema,
|
|
1475
|
-
|
|
1464
|
+
z31.object({
|
|
1476
1465
|
type: TypeSchema.default("t3.small"),
|
|
1477
1466
|
count: CountSchema.default(1),
|
|
1478
1467
|
version: VersionSchema.default("2.13"),
|
|
@@ -1483,12 +1472,12 @@ var SearchsSchema = z32.record(
|
|
|
1483
1472
|
).optional().describe("Define the search instances in your stack. Backed by OpenSearch.");
|
|
1484
1473
|
|
|
1485
1474
|
// src/feature/site/schema.ts
|
|
1486
|
-
import { z as
|
|
1475
|
+
import { z as z33 } from "zod";
|
|
1487
1476
|
|
|
1488
1477
|
// src/config/schema/local-entry.ts
|
|
1489
1478
|
import { stat as stat3 } from "fs/promises";
|
|
1490
|
-
import { z as
|
|
1491
|
-
var LocalEntrySchema =
|
|
1479
|
+
import { z as z32 } from "zod";
|
|
1480
|
+
var LocalEntrySchema = z32.union([
|
|
1492
1481
|
RelativePathSchema.refine(async (path) => {
|
|
1493
1482
|
try {
|
|
1494
1483
|
const s = await stat3(path);
|
|
@@ -1497,7 +1486,7 @@ var LocalEntrySchema = z33.union([
|
|
|
1497
1486
|
return false;
|
|
1498
1487
|
}
|
|
1499
1488
|
}, `File or directory doesn't exist`),
|
|
1500
|
-
|
|
1489
|
+
z32.object({
|
|
1501
1490
|
nocheck: RelativePathSchema.describe(
|
|
1502
1491
|
"Specifies a local file or directory without checking if the file or directory exists."
|
|
1503
1492
|
)
|
|
@@ -1505,21 +1494,21 @@ var LocalEntrySchema = z33.union([
|
|
|
1505
1494
|
]);
|
|
1506
1495
|
|
|
1507
1496
|
// src/feature/site/schema.ts
|
|
1508
|
-
var SitesSchema =
|
|
1497
|
+
var SitesSchema = z33.record(
|
|
1509
1498
|
ResourceIdSchema,
|
|
1510
|
-
|
|
1499
|
+
z33.object({
|
|
1511
1500
|
router: ResourceIdSchema.describe("The router id to link your site with."),
|
|
1512
1501
|
path: RouteSchema2.describe("The path inside the router to link your site to."),
|
|
1513
|
-
build:
|
|
1514
|
-
command:
|
|
1502
|
+
build: z33.object({
|
|
1503
|
+
command: z33.string().describe(
|
|
1515
1504
|
`Specifies the files and directories to generate the cache key for your custom build command.`
|
|
1516
1505
|
),
|
|
1517
|
-
cacheKey:
|
|
1506
|
+
cacheKey: z33.union([LocalEntrySchema.transform((v) => [v]), LocalEntrySchema.array()]).describe(
|
|
1518
1507
|
`Specifies the files and directories to generate the cache key for your custom build command.`
|
|
1519
1508
|
),
|
|
1520
|
-
configs:
|
|
1509
|
+
configs: z33.string().array().optional().describe("Define the config values for your build command.")
|
|
1521
1510
|
}).optional().describe(`Specifies the build process for sites that need a build step.`),
|
|
1522
|
-
static:
|
|
1511
|
+
static: z33.union([LocalDirectorySchema, z33.boolean()]).optional().describe(
|
|
1523
1512
|
"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."
|
|
1524
1513
|
),
|
|
1525
1514
|
ssr: FunctionSchema.optional().describe("Specifies the file that will render the site on the server.")
|
|
@@ -1527,21 +1516,21 @@ var SitesSchema = z34.record(
|
|
|
1527
1516
|
).optional().describe("Define the sites in your stack.");
|
|
1528
1517
|
|
|
1529
1518
|
// src/feature/store/schema.ts
|
|
1530
|
-
import { z as
|
|
1531
|
-
var StoresSchema =
|
|
1532
|
-
|
|
1519
|
+
import { z as z34 } from "zod";
|
|
1520
|
+
var StoresSchema = z34.union([
|
|
1521
|
+
z34.array(ResourceIdSchema).transform((list) => {
|
|
1533
1522
|
const stores = {};
|
|
1534
1523
|
for (const key of list) {
|
|
1535
1524
|
stores[key] = {};
|
|
1536
1525
|
}
|
|
1537
1526
|
return stores;
|
|
1538
1527
|
}),
|
|
1539
|
-
|
|
1528
|
+
z34.record(
|
|
1540
1529
|
ResourceIdSchema,
|
|
1541
|
-
|
|
1530
|
+
z34.object({
|
|
1542
1531
|
static: LocalDirectorySchema.optional().describe("Specifies the path to the static files directory."),
|
|
1543
|
-
versioning:
|
|
1544
|
-
events:
|
|
1532
|
+
versioning: z34.boolean().default(false).describe("Enable versioning of your store."),
|
|
1533
|
+
events: z34.object({
|
|
1545
1534
|
// create
|
|
1546
1535
|
"created:*": TaskSchema.optional().describe(
|
|
1547
1536
|
"Subscribe to notifications regardless of the API that was used to create an object."
|
|
@@ -1574,30 +1563,30 @@ var StoresSchema = z35.union([
|
|
|
1574
1563
|
]).optional().describe("Define the stores in your stack.");
|
|
1575
1564
|
|
|
1576
1565
|
// src/feature/icon/schema.ts
|
|
1577
|
-
import { z as
|
|
1566
|
+
import { z as z35 } from "zod";
|
|
1578
1567
|
var staticOriginSchema = LocalDirectorySchema.describe(
|
|
1579
1568
|
"Specifies the path to a local image directory that will be uploaded in S3."
|
|
1580
1569
|
);
|
|
1581
1570
|
var functionOriginSchema = FunctionSchema.describe(
|
|
1582
1571
|
"Specifies the file that will be called when an image isn't found in the (cache) bucket."
|
|
1583
1572
|
);
|
|
1584
|
-
var IconsSchema =
|
|
1573
|
+
var IconsSchema = z35.record(
|
|
1585
1574
|
ResourceIdSchema,
|
|
1586
|
-
|
|
1575
|
+
z35.object({
|
|
1587
1576
|
// domain: ResourceIdSchema.describe('The domain id to link your site with.').optional(),
|
|
1588
1577
|
// subDomain: z.string().optional(),
|
|
1589
1578
|
router: ResourceIdSchema.describe("The router id to link your icon proxy."),
|
|
1590
1579
|
path: RouteSchema2.describe("The path inside the router to link your icon proxy to."),
|
|
1591
1580
|
log: LogSchema.optional(),
|
|
1592
1581
|
cacheDuration: DurationSchema.optional().describe("The cache duration of the cached icons."),
|
|
1593
|
-
preserveIds:
|
|
1594
|
-
symbols:
|
|
1595
|
-
origin:
|
|
1596
|
-
|
|
1582
|
+
preserveIds: z35.boolean().optional().default(false).describe("Preserve the IDs of the icons."),
|
|
1583
|
+
symbols: z35.boolean().optional().default(false).describe(`Convert the SVG's to SVG symbols.`),
|
|
1584
|
+
origin: z35.union([
|
|
1585
|
+
z35.object({
|
|
1597
1586
|
static: staticOriginSchema,
|
|
1598
1587
|
function: functionOriginSchema.optional()
|
|
1599
1588
|
}),
|
|
1600
|
-
|
|
1589
|
+
z35.object({
|
|
1601
1590
|
static: staticOriginSchema.optional(),
|
|
1602
1591
|
function: functionOriginSchema
|
|
1603
1592
|
})
|
|
@@ -1624,13 +1613,13 @@ var IconsSchema = z36.record(
|
|
|
1624
1613
|
).optional().describe("Define an svg icon proxy in your stack. Store, optimize, and deliver svg icons at scale.");
|
|
1625
1614
|
|
|
1626
1615
|
// src/feature/image/schema.ts
|
|
1627
|
-
import { z as
|
|
1628
|
-
var transformationOptionsSchema =
|
|
1629
|
-
width:
|
|
1630
|
-
height:
|
|
1631
|
-
fit:
|
|
1632
|
-
position:
|
|
1633
|
-
quality:
|
|
1616
|
+
import { z as z36 } from "zod";
|
|
1617
|
+
var transformationOptionsSchema = z36.object({
|
|
1618
|
+
width: z36.number().int().positive().optional(),
|
|
1619
|
+
height: z36.number().int().positive().optional(),
|
|
1620
|
+
fit: z36.enum(["cover", "contain", "fill", "inside", "outside"]).optional(),
|
|
1621
|
+
position: z36.enum(["top", "right top", "right", "right bottom", "bottom", "left bottom", "left", "left top", "center"]).optional(),
|
|
1622
|
+
quality: z36.number().int().min(1).max(100).optional()
|
|
1634
1623
|
});
|
|
1635
1624
|
var staticOriginSchema2 = LocalDirectorySchema.describe(
|
|
1636
1625
|
"Specifies the path to a local image directory that will be uploaded in S3."
|
|
@@ -1638,38 +1627,38 @@ var staticOriginSchema2 = LocalDirectorySchema.describe(
|
|
|
1638
1627
|
var functionOriginSchema2 = FunctionSchema.describe(
|
|
1639
1628
|
"Specifies the file that will be called when an image isn't found in the (cache) bucket."
|
|
1640
1629
|
);
|
|
1641
|
-
var ImagesSchema =
|
|
1630
|
+
var ImagesSchema = z36.record(
|
|
1642
1631
|
ResourceIdSchema,
|
|
1643
|
-
|
|
1632
|
+
z36.object({
|
|
1644
1633
|
// domain: ResourceIdSchema.describe('The domain id to link your site with.').optional(),
|
|
1645
1634
|
// subDomain: z.string().optional(),
|
|
1646
1635
|
router: ResourceIdSchema.describe("The router id to link your image proxy."),
|
|
1647
1636
|
path: RouteSchema2.describe("The path inside the router to link your image proxy to."),
|
|
1648
1637
|
log: LogSchema.optional(),
|
|
1649
1638
|
cacheDuration: DurationSchema.optional().describe("Cache duration of the cached images."),
|
|
1650
|
-
presets:
|
|
1651
|
-
extensions:
|
|
1652
|
-
jpg:
|
|
1653
|
-
mozjpeg:
|
|
1654
|
-
progressive:
|
|
1639
|
+
presets: z36.record(z36.string(), transformationOptionsSchema).describe("Named presets for image transformations"),
|
|
1640
|
+
extensions: z36.object({
|
|
1641
|
+
jpg: z36.object({
|
|
1642
|
+
mozjpeg: z36.boolean().optional(),
|
|
1643
|
+
progressive: z36.boolean().optional()
|
|
1655
1644
|
}).optional(),
|
|
1656
|
-
webp:
|
|
1657
|
-
effort:
|
|
1658
|
-
lossless:
|
|
1659
|
-
nearLossless:
|
|
1645
|
+
webp: z36.object({
|
|
1646
|
+
effort: z36.number().int().min(1).max(10).default(7).optional(),
|
|
1647
|
+
lossless: z36.boolean().optional(),
|
|
1648
|
+
nearLossless: z36.boolean().optional()
|
|
1660
1649
|
}).optional(),
|
|
1661
|
-
png:
|
|
1662
|
-
compressionLevel:
|
|
1650
|
+
png: z36.object({
|
|
1651
|
+
compressionLevel: z36.number().int().min(0).max(9).default(6).optional()
|
|
1663
1652
|
}).optional()
|
|
1664
1653
|
}).refine((data) => {
|
|
1665
1654
|
return Object.keys(data).length > 0;
|
|
1666
1655
|
}, "At least one extension must be defined.").describe("Specify the allowed extensions."),
|
|
1667
|
-
origin:
|
|
1668
|
-
|
|
1656
|
+
origin: z36.union([
|
|
1657
|
+
z36.object({
|
|
1669
1658
|
static: staticOriginSchema2,
|
|
1670
1659
|
function: functionOriginSchema2.optional()
|
|
1671
1660
|
}),
|
|
1672
|
-
|
|
1661
|
+
z36.object({
|
|
1673
1662
|
static: staticOriginSchema2.optional(),
|
|
1674
1663
|
function: functionOriginSchema2
|
|
1675
1664
|
})
|
|
@@ -1684,7 +1673,7 @@ var ImagesSchema = z37.record(
|
|
|
1684
1673
|
).optional().describe("Define an image proxy in your stack. Store, transform, optimize, and deliver images at scale.");
|
|
1685
1674
|
|
|
1686
1675
|
// src/feature/metric/schema.ts
|
|
1687
|
-
import { z as
|
|
1676
|
+
import { z as z37 } from "zod";
|
|
1688
1677
|
var ops = {
|
|
1689
1678
|
">": "GreaterThanThreshold",
|
|
1690
1679
|
">=": "GreaterThanOrEqualToThreshold",
|
|
@@ -1698,15 +1687,15 @@ var stats = {
|
|
|
1698
1687
|
min: "Minimum",
|
|
1699
1688
|
max: "Maximum"
|
|
1700
1689
|
};
|
|
1701
|
-
var WhereSchema =
|
|
1702
|
-
|
|
1690
|
+
var WhereSchema = z37.union([
|
|
1691
|
+
z37.string().regex(/(count|avg|sum|min|max) (>|>=|<|<=) (\d)/, "Invalid where query").transform((where) => {
|
|
1703
1692
|
const [stat4, op, value] = where.split(" ");
|
|
1704
1693
|
return { stat: stat4, op, value: parseFloat(value) };
|
|
1705
1694
|
}),
|
|
1706
|
-
|
|
1707
|
-
stat:
|
|
1708
|
-
op:
|
|
1709
|
-
value:
|
|
1695
|
+
z37.object({
|
|
1696
|
+
stat: z37.enum(["count", "avg", "sum", "min", "max"]),
|
|
1697
|
+
op: z37.enum([">", ">=", "<", "<="]),
|
|
1698
|
+
value: z37.number()
|
|
1710
1699
|
})
|
|
1711
1700
|
]).transform((where) => {
|
|
1712
1701
|
return {
|
|
@@ -1715,39 +1704,39 @@ var WhereSchema = z38.union([
|
|
|
1715
1704
|
value: where.value
|
|
1716
1705
|
};
|
|
1717
1706
|
});
|
|
1718
|
-
var AlarmSchema =
|
|
1719
|
-
description:
|
|
1707
|
+
var AlarmSchema = z37.object({
|
|
1708
|
+
description: z37.string().optional(),
|
|
1720
1709
|
where: WhereSchema,
|
|
1721
1710
|
period: DurationSchema,
|
|
1722
|
-
minDataPoints:
|
|
1723
|
-
trigger:
|
|
1711
|
+
minDataPoints: z37.number().int().default(1),
|
|
1712
|
+
trigger: z37.union([EmailSchema.transform((v) => [v]), EmailSchema.array(), FunctionSchema])
|
|
1724
1713
|
});
|
|
1725
|
-
var MetricsSchema =
|
|
1714
|
+
var MetricsSchema = z37.record(
|
|
1726
1715
|
ResourceIdSchema,
|
|
1727
|
-
|
|
1728
|
-
type:
|
|
1716
|
+
z37.object({
|
|
1717
|
+
type: z37.enum(["number", "size", "duration"]),
|
|
1729
1718
|
alarms: AlarmSchema.array().optional()
|
|
1730
1719
|
})
|
|
1731
1720
|
).optional().describe("Define the metrics in your stack.");
|
|
1732
1721
|
|
|
1733
1722
|
// src/feature/table/schema.ts
|
|
1734
1723
|
import { minutes as minutes5, seconds as seconds4 } from "@awsless/duration";
|
|
1735
|
-
import { z as
|
|
1736
|
-
var KeySchema =
|
|
1737
|
-
var TablesSchema =
|
|
1724
|
+
import { z as z38 } from "zod";
|
|
1725
|
+
var KeySchema = z38.string().min(1).max(255);
|
|
1726
|
+
var TablesSchema = z38.record(
|
|
1738
1727
|
ResourceIdSchema,
|
|
1739
|
-
|
|
1728
|
+
z38.object({
|
|
1740
1729
|
hash: KeySchema.describe(
|
|
1741
1730
|
"Specifies the name of the partition / hash key that makes up the primary key for the table."
|
|
1742
1731
|
),
|
|
1743
1732
|
sort: KeySchema.optional().describe(
|
|
1744
1733
|
"Specifies the name of the range / sort key that makes up the primary key for the table."
|
|
1745
1734
|
),
|
|
1746
|
-
fields:
|
|
1735
|
+
fields: z38.record(z38.string(), z38.enum(["string", "number", "binary"])).optional().describe(
|
|
1747
1736
|
'A list of attributes that describe the key schema for the table and indexes. If no attribute field is defined we default to "string".'
|
|
1748
1737
|
),
|
|
1749
|
-
class:
|
|
1750
|
-
pointInTimeRecovery:
|
|
1738
|
+
class: z38.enum(["standard", "standard-infrequent-access"]).default("standard").describe("The table class of the table."),
|
|
1739
|
+
pointInTimeRecovery: z38.boolean().default(false).describe("Indicates whether point in time recovery is enabled on the table."),
|
|
1751
1740
|
ttl: KeySchema.optional().describe(
|
|
1752
1741
|
[
|
|
1753
1742
|
"The name of the TTL attribute used to store the expiration time for items in the table.",
|
|
@@ -1755,8 +1744,8 @@ var TablesSchema = z39.record(
|
|
|
1755
1744
|
].join("\n")
|
|
1756
1745
|
),
|
|
1757
1746
|
// deletionProtection: DeletionProtectionSchema.optional(),
|
|
1758
|
-
stream:
|
|
1759
|
-
type:
|
|
1747
|
+
stream: z38.object({
|
|
1748
|
+
type: z38.enum(["keys-only", "new-image", "old-image", "new-and-old-images"]).describe(
|
|
1760
1749
|
[
|
|
1761
1750
|
"When an item in the table is modified, you can determines what information is written to the stream for this table.",
|
|
1762
1751
|
"Valid values are:",
|
|
@@ -1766,7 +1755,7 @@ var TablesSchema = z39.record(
|
|
|
1766
1755
|
"- new-and-old-images - Both the new and the old item images of the item are written to the stream."
|
|
1767
1756
|
].join("\n")
|
|
1768
1757
|
),
|
|
1769
|
-
batchSize:
|
|
1758
|
+
batchSize: z38.number().min(1).max(1e4).default(1).describe(
|
|
1770
1759
|
[
|
|
1771
1760
|
"The maximum number of records in each batch that Lambda pulls from your stream and sends to your function.",
|
|
1772
1761
|
"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).",
|
|
@@ -1795,7 +1784,7 @@ var TablesSchema = z39.record(
|
|
|
1795
1784
|
// 'The default value is 60s',
|
|
1796
1785
|
// ].join('\n')
|
|
1797
1786
|
// ),
|
|
1798
|
-
retryAttempts:
|
|
1787
|
+
retryAttempts: z38.number().min(-1).max(1e4).default(2).describe(
|
|
1799
1788
|
[
|
|
1800
1789
|
"Discard records after the specified number of retries.",
|
|
1801
1790
|
"-1 will sets the maximum number of retries to infinite.",
|
|
@@ -1804,7 +1793,7 @@ var TablesSchema = z39.record(
|
|
|
1804
1793
|
"The default value is 2"
|
|
1805
1794
|
].join("\n")
|
|
1806
1795
|
),
|
|
1807
|
-
concurrencyPerShard:
|
|
1796
|
+
concurrencyPerShard: z38.number().min(1).max(10).default(1).describe(
|
|
1808
1797
|
[
|
|
1809
1798
|
"The number of batches to process concurrently from each shard.",
|
|
1810
1799
|
"You can specify a number from 1 to 10."
|
|
@@ -1814,16 +1803,16 @@ var TablesSchema = z39.record(
|
|
|
1814
1803
|
}).optional().describe(
|
|
1815
1804
|
"The settings for the DynamoDB table stream, which capture changes to items stored in the table."
|
|
1816
1805
|
),
|
|
1817
|
-
indexes:
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
hash:
|
|
1806
|
+
indexes: z38.record(
|
|
1807
|
+
z38.string(),
|
|
1808
|
+
z38.object({
|
|
1809
|
+
hash: z38.union([KeySchema.transform((v) => [v]), KeySchema.array()]).describe(
|
|
1821
1810
|
"Specifies the name of the partition / hash key that makes up the primary key for the global secondary index."
|
|
1822
1811
|
),
|
|
1823
|
-
sort:
|
|
1812
|
+
sort: z38.union([KeySchema.transform((v) => [v]), KeySchema.array()]).optional().describe(
|
|
1824
1813
|
"Specifies the name of the range / sort key that makes up the primary key for the global secondary index."
|
|
1825
1814
|
),
|
|
1826
|
-
projection:
|
|
1815
|
+
projection: z38.enum(["all", "keys-only"]).default("all").describe(
|
|
1827
1816
|
[
|
|
1828
1817
|
"The set of attributes that are projected into the index:",
|
|
1829
1818
|
"- all - All of the table attributes are projected into the index.",
|
|
@@ -1837,12 +1826,12 @@ var TablesSchema = z39.record(
|
|
|
1837
1826
|
).optional().describe("Define the tables in your stack.");
|
|
1838
1827
|
|
|
1839
1828
|
// src/feature/test/schema.ts
|
|
1840
|
-
import { z as
|
|
1841
|
-
var TestsSchema =
|
|
1829
|
+
import { z as z39 } from "zod";
|
|
1830
|
+
var TestsSchema = z39.union([
|
|
1842
1831
|
//
|
|
1843
1832
|
LocalDirectorySchema.transform((v) => [v]),
|
|
1844
1833
|
LocalDirectorySchema.array(),
|
|
1845
|
-
|
|
1834
|
+
z39.literal(false)
|
|
1846
1835
|
]).describe("Define the location of your tests for your stack.").optional();
|
|
1847
1836
|
|
|
1848
1837
|
// src/config/stack.ts
|
|
@@ -1850,8 +1839,8 @@ var DependsSchema = ResourceIdSchema.array().optional().describe("Define the sta
|
|
|
1850
1839
|
var NameSchema = ResourceIdSchema.refine((name) => !["base", "hostedzones"].includes(name), {
|
|
1851
1840
|
message: `Stack name can't be a reserved name.`
|
|
1852
1841
|
}).describe("Stack name.");
|
|
1853
|
-
var StackSchema =
|
|
1854
|
-
$schema:
|
|
1842
|
+
var StackSchema = z40.object({
|
|
1843
|
+
$schema: z40.string().optional(),
|
|
1855
1844
|
name: NameSchema,
|
|
1856
1845
|
depends: DependsSchema,
|
|
1857
1846
|
commands: CommandsSchema,
|