@awsless/awsless 0.0.287 → 0.0.289
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 +187 -91
- package/dist/build-json-schema.js +179 -160
- package/dist/server.d.ts +16 -1
- package/dist/stack.json +1 -1
- package/package.json +9 -6
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
3
3
|
|
|
4
4
|
// src/config/stack.ts
|
|
5
|
-
import { z as
|
|
5
|
+
import { z as z29 } from "zod";
|
|
6
6
|
|
|
7
7
|
// src/feature/auth/schema.ts
|
|
8
8
|
import { z as z7 } from "zod";
|
|
@@ -306,20 +306,38 @@ var CachesSchema = z8.record(
|
|
|
306
306
|
})
|
|
307
307
|
).optional().describe("Define the caches in your stack. For access to the cache put your functions inside the global VPC.");
|
|
308
308
|
|
|
309
|
-
// src/feature/
|
|
309
|
+
// src/feature/command/schema.ts
|
|
310
310
|
import { z as z9 } from "zod";
|
|
311
|
-
var
|
|
312
|
-
|
|
311
|
+
var CommandSchema = z9.union([
|
|
312
|
+
z9.object({
|
|
313
|
+
file: LocalFileSchema,
|
|
314
|
+
handler: z9.string().default("default"),
|
|
315
|
+
description: z9.string().optional()
|
|
316
|
+
// options: z.record(ResourceIdSchema, OptionSchema).optional(),
|
|
317
|
+
// arguments: z.record(ResourceIdSchema, ArgumentSchema).optional(),
|
|
318
|
+
}),
|
|
319
|
+
z9.string().transform((file) => ({
|
|
320
|
+
file,
|
|
321
|
+
handler: "default",
|
|
322
|
+
description: void 0
|
|
323
|
+
}))
|
|
324
|
+
]);
|
|
325
|
+
var CommandsSchema = z9.record(ResourceIdSchema, CommandSchema).optional().describe("Define the config values for your stack.");
|
|
326
|
+
|
|
327
|
+
// src/feature/config/schema.ts
|
|
328
|
+
import { z as z10 } from "zod";
|
|
329
|
+
var ConfigNameSchema = z10.string().regex(/[a-z0-9\-]/g, "Invalid config name");
|
|
330
|
+
var ConfigsSchema = z10.array(ConfigNameSchema).optional().describe("Define the config values for your stack.");
|
|
313
331
|
|
|
314
332
|
// src/feature/cron/schema/index.ts
|
|
315
|
-
import { z as
|
|
333
|
+
import { z as z12 } from "zod";
|
|
316
334
|
|
|
317
335
|
// src/feature/cron/schema/schedule.ts
|
|
318
|
-
import { z as
|
|
336
|
+
import { z as z11 } from "zod";
|
|
319
337
|
import { awsCronExpressionValidator } from "aws-cron-expression-validator";
|
|
320
|
-
var RateExpressionSchema =
|
|
338
|
+
var RateExpressionSchema = z11.custom(
|
|
321
339
|
(value) => {
|
|
322
|
-
return
|
|
340
|
+
return z11.string().regex(/^[0-9]+ (seconds?|minutes?|hours?|days?)$/).refine((rate) => {
|
|
323
341
|
const [str] = rate.split(" ");
|
|
324
342
|
const number = parseInt(str);
|
|
325
343
|
return number > 0;
|
|
@@ -335,9 +353,9 @@ var RateExpressionSchema = z10.custom(
|
|
|
335
353
|
}
|
|
336
354
|
return `rate(${rate})`;
|
|
337
355
|
});
|
|
338
|
-
var CronExpressionSchema =
|
|
356
|
+
var CronExpressionSchema = z11.custom(
|
|
339
357
|
(value) => {
|
|
340
|
-
return
|
|
358
|
+
return z11.string().safeParse(value).success;
|
|
341
359
|
},
|
|
342
360
|
{ message: "Invalid cron expression" }
|
|
343
361
|
).superRefine((value, ctx) => {
|
|
@@ -346,12 +364,12 @@ var CronExpressionSchema = z10.custom(
|
|
|
346
364
|
} catch (error) {
|
|
347
365
|
if (error instanceof Error) {
|
|
348
366
|
ctx.addIssue({
|
|
349
|
-
code:
|
|
367
|
+
code: z11.ZodIssueCode.custom,
|
|
350
368
|
message: `Invalid cron expression: ${error.message}`
|
|
351
369
|
});
|
|
352
370
|
} else {
|
|
353
371
|
ctx.addIssue({
|
|
354
|
-
code:
|
|
372
|
+
code: z11.ZodIssueCode.custom,
|
|
355
373
|
message: "Invalid cron expression"
|
|
356
374
|
});
|
|
357
375
|
}
|
|
@@ -362,31 +380,31 @@ var CronExpressionSchema = z10.custom(
|
|
|
362
380
|
var ScheduleExpressionSchema = RateExpressionSchema.or(CronExpressionSchema);
|
|
363
381
|
|
|
364
382
|
// src/feature/cron/schema/index.ts
|
|
365
|
-
var CronsSchema =
|
|
383
|
+
var CronsSchema = z12.record(
|
|
366
384
|
ResourceIdSchema,
|
|
367
|
-
|
|
368
|
-
enabled:
|
|
385
|
+
z12.object({
|
|
386
|
+
enabled: z12.boolean().default(true).describe("If the cron is enabled."),
|
|
369
387
|
consumer: FunctionSchema.describe("The consuming lambda function properties."),
|
|
370
388
|
schedule: ScheduleExpressionSchema.describe(
|
|
371
389
|
'The scheduling expression.\n\nexample: "0 20 * * ? *"\nexample: "5 minutes"'
|
|
372
390
|
),
|
|
373
|
-
payload:
|
|
391
|
+
payload: z12.unknown().optional().describe("The JSON payload that will be passed to the consumer.")
|
|
374
392
|
})
|
|
375
393
|
).optional();
|
|
376
394
|
|
|
377
395
|
// src/feature/graphql/schema.ts
|
|
378
|
-
import { z as
|
|
396
|
+
import { z as z13 } from "zod";
|
|
379
397
|
var AuthorizerTtl = DurationSchema.describe(
|
|
380
398
|
`The number of seconds a response should be cached for. The maximum value is one hour (3600 seconds). The Lambda function can override this by returning a ttlOverride key in its response.`
|
|
381
399
|
);
|
|
382
|
-
var GraphQLDefaultSchema =
|
|
400
|
+
var GraphQLDefaultSchema = z13.record(
|
|
383
401
|
ResourceIdSchema,
|
|
384
|
-
|
|
402
|
+
z13.object({
|
|
385
403
|
domain: ResourceIdSchema.describe("The domain id to link your API with.").optional(),
|
|
386
|
-
subDomain:
|
|
387
|
-
auth:
|
|
404
|
+
subDomain: z13.string().optional(),
|
|
405
|
+
auth: z13.union([
|
|
388
406
|
ResourceIdSchema,
|
|
389
|
-
|
|
407
|
+
z13.object({
|
|
390
408
|
authorizer: FunctionSchema,
|
|
391
409
|
ttl: AuthorizerTtl.default("1 hour")
|
|
392
410
|
})
|
|
@@ -398,22 +416,22 @@ var GraphQLDefaultSchema = z12.record(
|
|
|
398
416
|
resolver: LocalFileSchema.optional()
|
|
399
417
|
})
|
|
400
418
|
).describe(`Define the global GraphQL API's.`).optional();
|
|
401
|
-
var GraphQLSchema =
|
|
419
|
+
var GraphQLSchema = z13.record(
|
|
402
420
|
ResourceIdSchema,
|
|
403
|
-
|
|
421
|
+
z13.object({
|
|
404
422
|
// schema: z.union([LocalFileSchema.transform(v => [v]), z.array(LocalFileSchema).min(1)]).optional(),
|
|
405
423
|
schema: LocalFileSchema.describe("The graphql schema file."),
|
|
406
|
-
resolvers:
|
|
424
|
+
resolvers: z13.record(
|
|
407
425
|
// TypeName
|
|
408
|
-
|
|
409
|
-
|
|
426
|
+
z13.string(),
|
|
427
|
+
z13.record(
|
|
410
428
|
// FieldName
|
|
411
|
-
|
|
412
|
-
|
|
429
|
+
z13.string(),
|
|
430
|
+
z13.union([
|
|
413
431
|
FunctionSchema.transform((consumer) => ({
|
|
414
432
|
consumer
|
|
415
433
|
})),
|
|
416
|
-
|
|
434
|
+
z13.object({
|
|
417
435
|
consumer: FunctionSchema,
|
|
418
436
|
resolver: LocalFileSchema.optional()
|
|
419
437
|
})
|
|
@@ -424,25 +442,25 @@ var GraphQLSchema = z12.record(
|
|
|
424
442
|
).describe("Define the schema & resolvers in your stack for your global GraphQL API.").optional();
|
|
425
443
|
|
|
426
444
|
// src/feature/http/schema.ts
|
|
427
|
-
import { z as
|
|
428
|
-
var RouteSchema =
|
|
429
|
-
var HttpDefaultSchema =
|
|
445
|
+
import { z as z14 } from "zod";
|
|
446
|
+
var RouteSchema = z14.string().regex(/^(POST|GET|PUT|DELETE|HEAD|OPTIONS)(\s\/[a-z0-9\+\_\-\/\{\}]*)$/gi, "Invalid route").transform((v) => v);
|
|
447
|
+
var HttpDefaultSchema = z14.record(
|
|
430
448
|
ResourceIdSchema,
|
|
431
|
-
|
|
449
|
+
z14.object({
|
|
432
450
|
domain: ResourceIdSchema.describe("The domain id to link your API with."),
|
|
433
|
-
subDomain:
|
|
451
|
+
subDomain: z14.string().optional()
|
|
434
452
|
// auth: ResourceIdSchema.optional(),
|
|
435
453
|
})
|
|
436
454
|
).optional().describe("Define your global HTTP API's.");
|
|
437
|
-
var HttpSchema =
|
|
455
|
+
var HttpSchema = z14.record(ResourceIdSchema, z14.record(RouteSchema, FunctionSchema)).optional().describe("Define routes in your stack for your global HTTP API.");
|
|
438
456
|
|
|
439
457
|
// src/feature/instance/schema.ts
|
|
440
|
-
import { z as
|
|
458
|
+
import { z as z16 } from "zod";
|
|
441
459
|
|
|
442
460
|
// src/config/schema/local-directory.ts
|
|
443
461
|
import { stat as stat2 } from "fs/promises";
|
|
444
|
-
import { z as
|
|
445
|
-
var LocalDirectorySchema =
|
|
462
|
+
import { z as z15 } from "zod";
|
|
463
|
+
var LocalDirectorySchema = z15.string().transform((path) => resolvePath(path)).refine(async (path) => {
|
|
446
464
|
try {
|
|
447
465
|
const s = await stat2(path);
|
|
448
466
|
return s.isDirectory();
|
|
@@ -452,8 +470,8 @@ var LocalDirectorySchema = z14.string().transform((path) => resolvePath(path)).r
|
|
|
452
470
|
}, `Directory doesn't exist`);
|
|
453
471
|
|
|
454
472
|
// src/feature/instance/schema.ts
|
|
455
|
-
var ImageSchema =
|
|
456
|
-
var TypeSchema2 =
|
|
473
|
+
var ImageSchema = z16.string().regex(/^ami\-[0-9a-f]+/).describe("The ID of the AMI.");
|
|
474
|
+
var TypeSchema2 = z16.enum([
|
|
457
475
|
"t3.nano",
|
|
458
476
|
"t3.micro",
|
|
459
477
|
"t3.small",
|
|
@@ -471,36 +489,36 @@ var TypeSchema2 = z15.enum([
|
|
|
471
489
|
"g4ad.xlarge",
|
|
472
490
|
"g4dn.xlarge"
|
|
473
491
|
]).describe(`The instance type.`);
|
|
474
|
-
var
|
|
492
|
+
var CommandSchema2 = z16.string().describe(`The script you want to execute when the instance starts up.`);
|
|
475
493
|
var CodeSchema = LocalDirectorySchema.describe(`The code directory that will be deployed to your instance.`);
|
|
476
|
-
var ConnectSchema =
|
|
477
|
-
var EnvironmentSchema2 =
|
|
478
|
-
var ActionSchema2 =
|
|
479
|
-
var ActionsSchema2 =
|
|
480
|
-
var ArnSchema2 =
|
|
481
|
-
var WildcardSchema2 =
|
|
482
|
-
var ResourceSchema2 =
|
|
483
|
-
var ResourcesSchema2 =
|
|
484
|
-
var PermissionSchema2 =
|
|
485
|
-
effect:
|
|
494
|
+
var ConnectSchema = z16.boolean().describe("Allows you to connect to all instances with an Instance Connect Endpoint.");
|
|
495
|
+
var EnvironmentSchema2 = z16.record(z16.string(), z16.string()).optional().describe("Environment variable key-value pairs.");
|
|
496
|
+
var ActionSchema2 = z16.string();
|
|
497
|
+
var ActionsSchema2 = z16.union([ActionSchema2.transform((v) => [v]), ActionSchema2.array()]);
|
|
498
|
+
var ArnSchema2 = z16.string().startsWith("arn:");
|
|
499
|
+
var WildcardSchema2 = z16.literal("*");
|
|
500
|
+
var ResourceSchema2 = z16.union([ArnSchema2, WildcardSchema2]).transform((v) => v);
|
|
501
|
+
var ResourcesSchema2 = z16.union([ResourceSchema2.transform((v) => [v]), ResourceSchema2.array()]);
|
|
502
|
+
var PermissionSchema2 = z16.object({
|
|
503
|
+
effect: z16.enum(["allow", "deny"]).default("allow"),
|
|
486
504
|
actions: ActionsSchema2,
|
|
487
505
|
resources: ResourcesSchema2
|
|
488
506
|
});
|
|
489
|
-
var PermissionsSchema2 =
|
|
490
|
-
var InstanceDefaultSchema =
|
|
507
|
+
var PermissionsSchema2 = z16.union([PermissionSchema2.transform((v) => [v]), PermissionSchema2.array()]).describe("Add IAM permissions to your instance.");
|
|
508
|
+
var InstanceDefaultSchema = z16.object({
|
|
491
509
|
connect: ConnectSchema.default(false)
|
|
492
510
|
}).default({}).describe("Define the default settings for all instances in your stacks.");
|
|
493
|
-
var InstancesSchema =
|
|
511
|
+
var InstancesSchema = z16.record(
|
|
494
512
|
ResourceIdSchema,
|
|
495
|
-
|
|
513
|
+
z16.object({
|
|
496
514
|
image: ImageSchema,
|
|
497
515
|
type: TypeSchema2,
|
|
498
516
|
code: CodeSchema,
|
|
499
|
-
user:
|
|
500
|
-
command:
|
|
517
|
+
user: z16.string().default("ec2-user"),
|
|
518
|
+
command: CommandSchema2.optional(),
|
|
501
519
|
environment: EnvironmentSchema2.optional(),
|
|
502
520
|
permissions: PermissionsSchema2.optional(),
|
|
503
|
-
waitForTermination:
|
|
521
|
+
waitForTermination: z16.boolean().default(true)
|
|
504
522
|
})
|
|
505
523
|
).optional().describe("Define the instances in your stack.");
|
|
506
524
|
|
|
@@ -510,18 +528,18 @@ var OnFailureSchema = FunctionSchema.optional().describe(
|
|
|
510
528
|
);
|
|
511
529
|
|
|
512
530
|
// src/feature/pubsub/schema.ts
|
|
513
|
-
import { z as
|
|
514
|
-
var PubSubSchema =
|
|
531
|
+
import { z as z17 } from "zod";
|
|
532
|
+
var PubSubSchema = z17.record(
|
|
515
533
|
ResourceIdSchema,
|
|
516
|
-
|
|
517
|
-
sql:
|
|
518
|
-
sqlVersion:
|
|
534
|
+
z17.object({
|
|
535
|
+
sql: z17.string().describe("The SQL statement used to query the IOT topic."),
|
|
536
|
+
sqlVersion: z17.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."),
|
|
519
537
|
consumer: FunctionSchema.describe("The consuming lambda function properties.")
|
|
520
538
|
})
|
|
521
539
|
).optional().describe("Define the pubsub subscriber in your stack.");
|
|
522
540
|
|
|
523
541
|
// src/feature/queue/schema.ts
|
|
524
|
-
import { z as
|
|
542
|
+
import { z as z18 } from "zod";
|
|
525
543
|
import { days as days2, hours, minutes as minutes2, seconds as seconds2 } from "@awsless/duration";
|
|
526
544
|
import { kibibytes } from "@awsless/size";
|
|
527
545
|
var RetentionPeriodSchema = DurationSchema.refine(
|
|
@@ -551,10 +569,10 @@ var ReceiveMessageWaitTimeSchema = DurationSchema.refine(
|
|
|
551
569
|
var MaxMessageSizeSchema = SizeSchema.refine(sizeMin(kibibytes(1)), "Minimum max message size is 1 KB").refine(sizeMax(kibibytes(256)), "Maximum max message size is 256 KB").describe(
|
|
552
570
|
"The limit of how many bytes that a message can contain before Amazon SQS rejects it. You can specify an size from 1 KB to 256 KB."
|
|
553
571
|
);
|
|
554
|
-
var BatchSizeSchema =
|
|
572
|
+
var BatchSizeSchema = z18.number().int().min(1, "Minimum batch size is 1").max(1e4, "Maximum batch size is 10000").describe(
|
|
555
573
|
"The maximum number of records in each batch that Lambda pulls from your queue and sends to your function. 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). You can specify an integer from 1 to 10000."
|
|
556
574
|
);
|
|
557
|
-
var MaxConcurrencySchema =
|
|
575
|
+
var MaxConcurrencySchema = z18.number().int().min(2, "Minimum max concurrency is 2").max(1e3, "Maximum max concurrency is 1000").describe(
|
|
558
576
|
"Limits the number of concurrent instances that the queue worker can invoke. You can specify an integer from 2 to 1000."
|
|
559
577
|
);
|
|
560
578
|
var MaxBatchingWindow = DurationSchema.refine(
|
|
@@ -563,7 +581,7 @@ var MaxBatchingWindow = DurationSchema.refine(
|
|
|
563
581
|
).describe(
|
|
564
582
|
"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."
|
|
565
583
|
);
|
|
566
|
-
var QueueDefaultSchema =
|
|
584
|
+
var QueueDefaultSchema = z18.object({
|
|
567
585
|
retentionPeriod: RetentionPeriodSchema.default("7 days"),
|
|
568
586
|
visibilityTimeout: VisibilityTimeoutSchema.default("30 seconds"),
|
|
569
587
|
deliveryDelay: DeliveryDelaySchema.default("0 seconds"),
|
|
@@ -573,15 +591,15 @@ var QueueDefaultSchema = z17.object({
|
|
|
573
591
|
maxConcurrency: MaxConcurrencySchema.optional(),
|
|
574
592
|
maxBatchingWindow: MaxBatchingWindow.optional()
|
|
575
593
|
}).default({});
|
|
576
|
-
var QueuesSchema =
|
|
594
|
+
var QueuesSchema = z18.record(
|
|
577
595
|
ResourceIdSchema,
|
|
578
|
-
|
|
596
|
+
z18.union([
|
|
579
597
|
LocalFileSchema.transform((file) => ({
|
|
580
598
|
consumer: {
|
|
581
599
|
file
|
|
582
600
|
}
|
|
583
601
|
})),
|
|
584
|
-
|
|
602
|
+
z18.object({
|
|
585
603
|
consumer: FunctionSchema.describe("he consuming lambda function properties."),
|
|
586
604
|
retentionPeriod: RetentionPeriodSchema.optional(),
|
|
587
605
|
visibilityTimeout: VisibilityTimeoutSchema.optional(),
|
|
@@ -596,30 +614,30 @@ var QueuesSchema = z17.record(
|
|
|
596
614
|
).optional().describe("Define the queues in your stack.");
|
|
597
615
|
|
|
598
616
|
// src/feature/rest/schema.ts
|
|
599
|
-
import { z as
|
|
617
|
+
import { z as z20 } from "zod";
|
|
600
618
|
|
|
601
619
|
// src/config/schema/route.ts
|
|
602
|
-
import { z as
|
|
603
|
-
var RouteSchema2 =
|
|
604
|
-
|
|
605
|
-
|
|
620
|
+
import { z as z19 } from "zod";
|
|
621
|
+
var RouteSchema2 = z19.union([
|
|
622
|
+
z19.string().regex(/^(POST|GET|PUT|DELETE|HEAD|OPTIONS)(\s\/[a-z0-9\+\_\-\/\{\}]*)$/gi, "Invalid route"),
|
|
623
|
+
z19.literal("$default")
|
|
606
624
|
]);
|
|
607
625
|
|
|
608
626
|
// src/feature/rest/schema.ts
|
|
609
|
-
var RestDefaultSchema =
|
|
627
|
+
var RestDefaultSchema = z20.record(
|
|
610
628
|
ResourceIdSchema,
|
|
611
|
-
|
|
629
|
+
z20.object({
|
|
612
630
|
domain: ResourceIdSchema.describe("The domain id to link your API with.").optional(),
|
|
613
|
-
subDomain:
|
|
631
|
+
subDomain: z20.string().optional()
|
|
614
632
|
})
|
|
615
633
|
).optional().describe("Define your global REST API's.");
|
|
616
|
-
var RestSchema =
|
|
634
|
+
var RestSchema = z20.record(ResourceIdSchema, z20.record(RouteSchema2, FunctionSchema)).optional().describe("Define routes in your stack for your global REST API.");
|
|
617
635
|
|
|
618
636
|
// src/feature/search/schema.ts
|
|
619
637
|
import { gibibytes as gibibytes2 } from "@awsless/size";
|
|
620
|
-
import { z as
|
|
621
|
-
var VersionSchema =
|
|
622
|
-
var TypeSchema3 =
|
|
638
|
+
import { z as z21 } from "zod";
|
|
639
|
+
var VersionSchema = z21.enum(["2.13", "2.11", "2.9", "2.7", "2.5", "2.3", "1.3"]);
|
|
640
|
+
var TypeSchema3 = z21.enum([
|
|
623
641
|
"t3.small",
|
|
624
642
|
"t3.medium",
|
|
625
643
|
"m3.medium",
|
|
@@ -694,41 +712,41 @@ var TypeSchema3 = z20.enum([
|
|
|
694
712
|
"r6gd.16xlarge"
|
|
695
713
|
]);
|
|
696
714
|
var StorageSizeSchema = SizeSchema.refine(sizeMin(gibibytes2(10)), "Minimum storage size is 10 GB").refine(sizeMax(gibibytes2(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.");
|
|
697
|
-
var SearchsSchema =
|
|
715
|
+
var SearchsSchema = z21.record(
|
|
698
716
|
ResourceIdSchema,
|
|
699
|
-
|
|
717
|
+
z21.object({
|
|
700
718
|
type: TypeSchema3.default("t3.small"),
|
|
701
|
-
count:
|
|
719
|
+
count: z21.number().int().min(1).default(1),
|
|
702
720
|
version: VersionSchema.default("2.13"),
|
|
703
721
|
storage: StorageSizeSchema.default("10 GB"),
|
|
704
|
-
vpc:
|
|
722
|
+
vpc: z21.boolean().default(false)
|
|
705
723
|
})
|
|
706
724
|
).optional().describe("Define the search instances in your stack. Backed by OpenSearch.");
|
|
707
725
|
|
|
708
726
|
// src/feature/site/schema.ts
|
|
709
|
-
import { z as
|
|
710
|
-
var ErrorResponsePathSchema =
|
|
727
|
+
import { z as z22 } from "zod";
|
|
728
|
+
var ErrorResponsePathSchema = z22.string().describe(
|
|
711
729
|
"The path to the custom error page that you want to return to the viewer when your origin returns the HTTP status code specified.\n - We recommend that you store custom error pages in an Amazon S3 bucket. If you store custom error pages on an HTTP server and the server starts to return 5xx errors, CloudFront can't get the files that you want to return to viewers because the origin server is unavailable."
|
|
712
730
|
);
|
|
713
|
-
var StatusCodeSchema =
|
|
731
|
+
var StatusCodeSchema = z22.number().int().positive().optional().describe(
|
|
714
732
|
"The HTTP status code that you want CloudFront to return to the viewer along with the custom error page. There are a variety of reasons that you might want CloudFront to return a status code different from the status code that your origin returned to CloudFront, for example:\n- Some Internet devices (some firewalls and corporate proxies, for example) intercept HTTP 4xx and 5xx and prevent the response from being returned to the viewer. If you substitute 200, the response typically won't be intercepted.\n- If you don't care about distinguishing among different client errors or server errors, you can specify 400 or 500 as the ResponseCode for all 4xx or 5xx errors.\n- You might want to return a 200 status code (OK) and static website so your customers don't know that your website is down."
|
|
715
733
|
);
|
|
716
734
|
var MinTTLSchema = DurationSchema.describe(
|
|
717
735
|
"The minimum amount of time, that you want to cache the error response. When this time period has elapsed, CloudFront queries your origin to see whether the problem that caused the error has been resolved and the requested object is now available."
|
|
718
736
|
);
|
|
719
|
-
var ErrorResponseSchema =
|
|
737
|
+
var ErrorResponseSchema = z22.union([
|
|
720
738
|
ErrorResponsePathSchema,
|
|
721
|
-
|
|
739
|
+
z22.object({
|
|
722
740
|
path: ErrorResponsePathSchema,
|
|
723
741
|
statusCode: StatusCodeSchema.optional(),
|
|
724
742
|
minTTL: MinTTLSchema.optional()
|
|
725
743
|
})
|
|
726
744
|
]).optional();
|
|
727
|
-
var SitesSchema =
|
|
745
|
+
var SitesSchema = z22.record(
|
|
728
746
|
ResourceIdSchema,
|
|
729
|
-
|
|
747
|
+
z22.object({
|
|
730
748
|
domain: ResourceIdSchema.describe("The domain id to link your site with."),
|
|
731
|
-
subDomain:
|
|
749
|
+
subDomain: z22.string().optional(),
|
|
732
750
|
// bind: z
|
|
733
751
|
// .object({
|
|
734
752
|
// auth: z.array(ResourceIdSchema),
|
|
@@ -751,7 +769,7 @@ var SitesSchema = z21.record(
|
|
|
751
769
|
// build: z.string().optional(),
|
|
752
770
|
// }),
|
|
753
771
|
// ]),
|
|
754
|
-
errors:
|
|
772
|
+
errors: z22.object({
|
|
755
773
|
400: ErrorResponseSchema.describe("Customize a `400 Bad Request` response."),
|
|
756
774
|
403: ErrorResponseSchema.describe("Customize a `403 Forbidden` response."),
|
|
757
775
|
404: ErrorResponseSchema.describe("Customize a `404 Not Found` response."),
|
|
@@ -764,16 +782,16 @@ var SitesSchema = z21.record(
|
|
|
764
782
|
503: ErrorResponseSchema.describe("Customize a `503 Service Unavailable` response."),
|
|
765
783
|
504: ErrorResponseSchema.describe("Customize a `504 Gateway Timeout` response.")
|
|
766
784
|
}).optional().describe("Customize the error responses for specific HTTP status codes."),
|
|
767
|
-
cors:
|
|
768
|
-
override:
|
|
785
|
+
cors: z22.object({
|
|
786
|
+
override: z22.boolean().default(false),
|
|
769
787
|
maxAge: DurationSchema.default("365 days"),
|
|
770
|
-
exposeHeaders:
|
|
771
|
-
credentials:
|
|
772
|
-
headers:
|
|
773
|
-
origins:
|
|
774
|
-
methods:
|
|
788
|
+
exposeHeaders: z22.string().array().optional(),
|
|
789
|
+
credentials: z22.boolean().default(false),
|
|
790
|
+
headers: z22.string().array().default(["*"]),
|
|
791
|
+
origins: z22.string().array().default(["*"]),
|
|
792
|
+
methods: z22.enum(["GET", "DELETE", "HEAD", "OPTIONS", "PATCH", "POST", "PUT", "ALL"]).array().default(["ALL"])
|
|
775
793
|
}).optional().describe("Define the cors headers."),
|
|
776
|
-
security:
|
|
794
|
+
security: z22.object({
|
|
777
795
|
// contentSecurityPolicy: z.object({
|
|
778
796
|
// override: z.boolean().default(false),
|
|
779
797
|
// policy: z.string(),
|
|
@@ -815,10 +833,10 @@ var SitesSchema = z21.record(
|
|
|
815
833
|
// reportUri?: string
|
|
816
834
|
// }
|
|
817
835
|
}).optional().describe("Define the security policy."),
|
|
818
|
-
cache:
|
|
819
|
-
cookies:
|
|
820
|
-
headers:
|
|
821
|
-
queries:
|
|
836
|
+
cache: z22.object({
|
|
837
|
+
cookies: z22.string().array().optional().describe("Specifies the cookies that CloudFront includes in the cache key."),
|
|
838
|
+
headers: z22.string().array().optional().describe("Specifies the headers that CloudFront includes in the cache key."),
|
|
839
|
+
queries: z22.string().array().optional().describe("Specifies the query values that CloudFront includes in the cache key.")
|
|
822
840
|
}).optional().describe(
|
|
823
841
|
"Specifies the cookies, headers, and query values that CloudFront includes in the cache key."
|
|
824
842
|
)
|
|
@@ -826,21 +844,21 @@ var SitesSchema = z21.record(
|
|
|
826
844
|
).optional().describe("Define the sites in your stack.");
|
|
827
845
|
|
|
828
846
|
// src/feature/store/schema.ts
|
|
829
|
-
import { z as
|
|
830
|
-
var StoresSchema =
|
|
831
|
-
|
|
847
|
+
import { z as z23 } from "zod";
|
|
848
|
+
var StoresSchema = z23.union([
|
|
849
|
+
z23.array(ResourceIdSchema).transform((list) => {
|
|
832
850
|
const stores = {};
|
|
833
851
|
for (const key of list) {
|
|
834
852
|
stores[key] = {};
|
|
835
853
|
}
|
|
836
854
|
return stores;
|
|
837
855
|
}),
|
|
838
|
-
|
|
856
|
+
z23.record(
|
|
839
857
|
ResourceIdSchema,
|
|
840
|
-
|
|
858
|
+
z23.object({
|
|
841
859
|
// cors: CorsSchema,
|
|
842
|
-
versioning:
|
|
843
|
-
events:
|
|
860
|
+
versioning: z23.boolean().default(false).describe("Enable versioning of your store."),
|
|
861
|
+
events: z23.object({
|
|
844
862
|
// create
|
|
845
863
|
"created:*": FunctionSchema.optional().describe(
|
|
846
864
|
"Subscribe to notifications regardless of the API that was used to create an object."
|
|
@@ -873,22 +891,22 @@ var StoresSchema = z22.union([
|
|
|
873
891
|
]).optional().describe("Define the stores in your stack.");
|
|
874
892
|
|
|
875
893
|
// src/feature/stream/schema.ts
|
|
876
|
-
import { z as
|
|
877
|
-
var LatencyModeSchema =
|
|
894
|
+
import { z as z24 } from "zod";
|
|
895
|
+
var LatencyModeSchema = z24.enum(["low", "normal"]).describe(
|
|
878
896
|
`Channel latency mode. Valid values:
|
|
879
897
|
- normal: Use "normal" to broadcast and deliver live video up to Full HD.
|
|
880
898
|
- low: Use "low" for near real-time interactions with viewers.`
|
|
881
899
|
);
|
|
882
|
-
var TypeSchema4 =
|
|
900
|
+
var TypeSchema4 = z24.enum(["standard", "basic", "advanced-sd", "advanced-hd"]).describe(`The channel type, which determines the allowable resolution and bitrate.
|
|
883
901
|
If you exceed the allowable resolution or bitrate, the stream probably will disconnect immediately. Valid values:
|
|
884
902
|
- standard: Video is transcoded: multiple qualities are generated from the original input to automatically give viewers the best experience for their devices and network conditions. Transcoding allows higher playback quality across a range of download speeds. Resolution can be up to 1080p and bitrate can be up to 8.5 Mbps. Audio is transcoded only for renditions 360p and below; above that, audio is passed through.
|
|
885
903
|
- basic: Video is transmuxed: Amazon IVS delivers the original input to viewers. The viewer's video-quality choice is limited to the original input. Resolution can be up to 1080p and bitrate can be up to 1.5 Mbps for 480p and up to 3.5 Mbps for resolutions between 480p and 1080p.
|
|
886
904
|
- advanced-sd: Video is transcoded; multiple qualities are generated from the original input, to automatically give viewers the best experience for their devices and network conditions. Input resolution can be up to 1080p and bitrate can be up to 8.5 Mbps; output is capped at SD quality (480p). You can select an optional transcode preset (see below). Audio for all renditions is transcoded, and an audio-only rendition is available.
|
|
887
905
|
- advanced-hd: Video is transcoded; multiple qualities are generated from the original input, to automatically give viewers the best experience for their devices and network conditions. Input resolution can be up to 1080p and bitrate can be up to 8.5 Mbps; output is capped at HD quality (720p). You can select an optional transcode preset (see below). Audio for all renditions is transcoded, and an audio-only rendition is available.
|
|
888
906
|
`);
|
|
889
|
-
var StreamsSchema =
|
|
907
|
+
var StreamsSchema = z24.record(
|
|
890
908
|
ResourceIdSchema,
|
|
891
|
-
|
|
909
|
+
z24.object({
|
|
892
910
|
type: TypeSchema4.default("standard"),
|
|
893
911
|
// preset: PresetSchema.optional(),
|
|
894
912
|
latencyMode: LatencyModeSchema.default("low")
|
|
@@ -896,36 +914,36 @@ var StreamsSchema = z23.record(
|
|
|
896
914
|
).optional().describe("Define the streams in your stack.");
|
|
897
915
|
|
|
898
916
|
// src/feature/table/schema.ts
|
|
899
|
-
import { z as
|
|
900
|
-
var KeySchema =
|
|
901
|
-
var TablesSchema =
|
|
917
|
+
import { z as z25 } from "zod";
|
|
918
|
+
var KeySchema = z25.string().min(1).max(255);
|
|
919
|
+
var TablesSchema = z25.record(
|
|
902
920
|
ResourceIdSchema,
|
|
903
|
-
|
|
921
|
+
z25.object({
|
|
904
922
|
hash: KeySchema.describe(
|
|
905
923
|
"Specifies the name of the partition / hash key that makes up the primary key for the table."
|
|
906
924
|
),
|
|
907
925
|
sort: KeySchema.optional().describe(
|
|
908
926
|
"Specifies the name of the range / sort key that makes up the primary key for the table."
|
|
909
927
|
),
|
|
910
|
-
fields:
|
|
928
|
+
fields: z25.record(z25.string(), z25.enum(["string", "number", "binary"])).optional().describe(
|
|
911
929
|
'A list of attributes that describe the key schema for the table and indexes. If no attribute field is defined we default to "string".'
|
|
912
930
|
),
|
|
913
|
-
class:
|
|
914
|
-
pointInTimeRecovery:
|
|
931
|
+
class: z25.enum(["standard", "standard-infrequent-access"]).default("standard").describe("The table class of the table."),
|
|
932
|
+
pointInTimeRecovery: z25.boolean().default(false).describe("Indicates whether point in time recovery is enabled on the table."),
|
|
915
933
|
timeToLiveAttribute: KeySchema.optional().describe(
|
|
916
934
|
"The name of the TTL attribute used to store the expiration time for items in the table. To update this property, you must first disable TTL and then enable TTL with the new attribute name."
|
|
917
935
|
),
|
|
918
|
-
stream:
|
|
919
|
-
type:
|
|
936
|
+
stream: z25.object({
|
|
937
|
+
type: z25.enum(["keys-only", "new-image", "old-image", "new-and-old-images"]).describe(
|
|
920
938
|
"When an item in the table is modified, stream.type determines what information is written to the stream for this table. Valid values are:\n- keys-only - Only the key attributes of the modified item are written to the stream.\n- new-image - The entire item, as it appears after it was modified, is written to the stream.\n- old-image - The entire item, as it appeared before it was modified, is written to the stream.\n- new-and-old-images - Both the new and the old item images of the item are written to the stream."
|
|
921
939
|
),
|
|
922
940
|
consumer: FunctionSchema.describe("The consuming lambda function for the stream")
|
|
923
941
|
}).optional().describe(
|
|
924
942
|
"The settings for the DynamoDB table stream, which capture changes to items stored in the table."
|
|
925
943
|
),
|
|
926
|
-
indexes:
|
|
927
|
-
|
|
928
|
-
|
|
944
|
+
indexes: z25.record(
|
|
945
|
+
z25.string(),
|
|
946
|
+
z25.object({
|
|
929
947
|
/** Specifies the name of the partition / hash key that makes up the primary key for the global secondary index. */
|
|
930
948
|
hash: KeySchema,
|
|
931
949
|
/** Specifies the name of the range / sort key that makes up the primary key for the global secondary index. */
|
|
@@ -935,51 +953,52 @@ var TablesSchema = z24.record(
|
|
|
935
953
|
* - keys-only - Only the index and primary keys are projected into the index.
|
|
936
954
|
* @default 'all'
|
|
937
955
|
*/
|
|
938
|
-
projection:
|
|
956
|
+
projection: z25.enum(["all", "keys-only"]).default("all")
|
|
939
957
|
})
|
|
940
958
|
).optional().describe("Specifies the global secondary indexes to be created on the table.")
|
|
941
959
|
})
|
|
942
960
|
).optional().describe("Define the tables in your stack.");
|
|
943
961
|
|
|
944
962
|
// src/feature/task/schema.ts
|
|
945
|
-
import { z as
|
|
946
|
-
var RetryAttemptsSchema2 =
|
|
963
|
+
import { z as z26 } from "zod";
|
|
964
|
+
var RetryAttemptsSchema2 = z26.number().int().min(0).max(2).describe(
|
|
947
965
|
"The maximum number of times to retry when the function returns an error. You can specify a number from 0 to 2."
|
|
948
966
|
);
|
|
949
|
-
var TaskSchema =
|
|
967
|
+
var TaskSchema = z26.union([
|
|
950
968
|
LocalFileSchema.transform((file) => ({
|
|
951
969
|
consumer: { file },
|
|
952
970
|
retryAttempts: void 0
|
|
953
971
|
})),
|
|
954
|
-
|
|
972
|
+
z26.object({
|
|
955
973
|
consumer: FunctionSchema,
|
|
956
974
|
retryAttempts: RetryAttemptsSchema2.optional()
|
|
957
975
|
})
|
|
958
976
|
]);
|
|
959
|
-
var TasksSchema =
|
|
977
|
+
var TasksSchema = z26.record(ResourceIdSchema, TaskSchema).optional().describe("Define the tasks in your stack.");
|
|
960
978
|
|
|
961
979
|
// src/feature/test/schema.ts
|
|
962
|
-
import { z as
|
|
963
|
-
var TestsSchema =
|
|
980
|
+
import { z as z27 } from "zod";
|
|
981
|
+
var TestsSchema = z27.union([LocalDirectorySchema.transform((v) => [v]), LocalDirectorySchema.array()]).describe("Define the location of your tests for your stack.").optional();
|
|
964
982
|
|
|
965
983
|
// src/feature/topic/schema.ts
|
|
966
984
|
import { paramCase as paramCase2 } from "change-case";
|
|
967
|
-
import { z as
|
|
968
|
-
var TopicNameSchema =
|
|
969
|
-
var TopicsSchema =
|
|
985
|
+
import { z as z28 } from "zod";
|
|
986
|
+
var TopicNameSchema = z28.string().min(3).max(256).regex(/^[a-z0-9\-]+$/i, "Invalid topic name").transform((value) => paramCase2(value)).describe("Define event topic name.");
|
|
987
|
+
var TopicsSchema = z28.array(TopicNameSchema).refine((topics) => {
|
|
970
988
|
return topics.length === new Set(topics).size;
|
|
971
989
|
}, "Must be a list of unique topic names").optional().describe("Define the event topics to publish too in your stack.");
|
|
972
|
-
var SubscribersSchema =
|
|
990
|
+
var SubscribersSchema = z28.record(TopicNameSchema, z28.union([EmailSchema, FunctionSchema])).optional().describe("Define the event topics to subscribe too in your stack.");
|
|
973
991
|
|
|
974
992
|
// src/config/stack.ts
|
|
975
993
|
var DependsSchema = ResourceIdSchema.array().optional().describe("Define the stacks that this stack is depended on.");
|
|
976
994
|
var NameSchema = ResourceIdSchema.refine((name) => !["base"].includes(name), {
|
|
977
995
|
message: `Stack name can't be a reserved name.`
|
|
978
996
|
}).describe("Stack name.");
|
|
979
|
-
var StackSchema =
|
|
980
|
-
$schema:
|
|
997
|
+
var StackSchema = z29.object({
|
|
998
|
+
$schema: z29.string().optional(),
|
|
981
999
|
name: NameSchema,
|
|
982
1000
|
depends: DependsSchema,
|
|
1001
|
+
commands: CommandsSchema,
|
|
983
1002
|
onFailure: OnFailureSchema,
|
|
984
1003
|
auth: AuthSchema,
|
|
985
1004
|
graphql: GraphQLSchema,
|
|
@@ -1004,21 +1023,21 @@ var StackSchema = z28.object({
|
|
|
1004
1023
|
});
|
|
1005
1024
|
|
|
1006
1025
|
// src/config/app.ts
|
|
1007
|
-
import { z as
|
|
1026
|
+
import { z as z32 } from "zod";
|
|
1008
1027
|
|
|
1009
1028
|
// src/feature/domain/schema.ts
|
|
1010
|
-
import { z as
|
|
1011
|
-
var DomainNameSchema =
|
|
1029
|
+
import { z as z30 } from "zod";
|
|
1030
|
+
var DomainNameSchema = z30.string().regex(/[a-z\-\_\.]/g, "Invalid domain name").describe(
|
|
1012
1031
|
"Enter a fully qualified domain name, for example, www.example.com. You can optionally include a trailing dot. If you omit the trailing dot, Amazon Route 53 assumes that the domain name that you specify is fully qualified. This means that Route 53 treats www.example.com (without a trailing dot) and www.example.com. (with a trailing dot) as identical."
|
|
1013
1032
|
);
|
|
1014
|
-
var DNSTypeSchema =
|
|
1033
|
+
var DNSTypeSchema = z30.enum(["A", "AAAA", "CAA", "CNAME", "DS", "MX", "NAPTR", "NS", "PTR", "SOA", "SPF", "SRV", "TXT"]).describe("The DNS record type.");
|
|
1015
1034
|
var TTLSchema = DurationSchema.describe("The resource record cache time to live (TTL).");
|
|
1016
|
-
var RecordsSchema =
|
|
1017
|
-
var DomainsDefaultSchema =
|
|
1035
|
+
var RecordsSchema = z30.string().array().describe("One or more values that correspond with the value that you specified for the Type property.");
|
|
1036
|
+
var DomainsDefaultSchema = z30.record(
|
|
1018
1037
|
ResourceIdSchema,
|
|
1019
|
-
|
|
1038
|
+
z30.object({
|
|
1020
1039
|
domain: DomainNameSchema.describe("Define the domain name"),
|
|
1021
|
-
dns:
|
|
1040
|
+
dns: z30.object({
|
|
1022
1041
|
name: DomainNameSchema.optional(),
|
|
1023
1042
|
type: DNSTypeSchema,
|
|
1024
1043
|
ttl: TTLSchema,
|
|
@@ -1028,7 +1047,7 @@ var DomainsDefaultSchema = z29.record(
|
|
|
1028
1047
|
).optional().describe("Define the domains for your application.");
|
|
1029
1048
|
|
|
1030
1049
|
// src/config/schema/region.ts
|
|
1031
|
-
import { z as
|
|
1050
|
+
import { z as z31 } from "zod";
|
|
1032
1051
|
var US = ["us-east-2", "us-east-1", "us-west-1", "us-west-2"];
|
|
1033
1052
|
var AF = ["af-south-1"];
|
|
1034
1053
|
var AP = [
|
|
@@ -1057,20 +1076,20 @@ var EU = [
|
|
|
1057
1076
|
var ME = ["me-south-1", "me-central-1"];
|
|
1058
1077
|
var SA = ["sa-east-1"];
|
|
1059
1078
|
var regions = [...US, ...AF, ...AP, ...CA, ...EU, ...ME, ...SA];
|
|
1060
|
-
var RegionSchema =
|
|
1079
|
+
var RegionSchema = z31.enum(regions);
|
|
1061
1080
|
|
|
1062
1081
|
// src/config/app.ts
|
|
1063
|
-
var AppSchema =
|
|
1064
|
-
$schema:
|
|
1082
|
+
var AppSchema = z32.object({
|
|
1083
|
+
$schema: z32.string().optional(),
|
|
1065
1084
|
name: ResourceIdSchema.describe("App name."),
|
|
1066
1085
|
region: RegionSchema.describe("The AWS region to deploy to."),
|
|
1067
|
-
profile:
|
|
1086
|
+
profile: z32.string().describe("The AWS profile to deploy to."),
|
|
1068
1087
|
// stage: z
|
|
1069
1088
|
// .string()
|
|
1070
1089
|
// .regex(/^[a-z]+$/)
|
|
1071
1090
|
// .default('prod')
|
|
1072
1091
|
// .describe('The deployment stage.'),
|
|
1073
|
-
defaults:
|
|
1092
|
+
defaults: z32.object({
|
|
1074
1093
|
auth: AuthDefaultSchema,
|
|
1075
1094
|
domains: DomainsDefaultSchema,
|
|
1076
1095
|
function: FunctionDefaultSchema,
|