@awsless/awsless 0.0.266 → 0.0.268
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/bin.js +932 -614
- package/dist/build-json-schema.js +505 -443
- package/dist/server.js +12 -1
- package/dist/stack.json +1 -1
- package/package.json +11 -9
|
@@ -2,7 +2,10 @@
|
|
|
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 z28 } from "zod";
|
|
6
|
+
|
|
7
|
+
// src/feature/auth/schema.ts
|
|
8
|
+
import { z as z7 } from "zod";
|
|
6
9
|
|
|
7
10
|
// src/config/schema/resource-id.ts
|
|
8
11
|
import { paramCase } from "change-case";
|
|
@@ -202,306 +205,121 @@ var FunctionDefaultSchema = z5.object({
|
|
|
202
205
|
permissions: PermissionsSchema.optional()
|
|
203
206
|
}).default({});
|
|
204
207
|
|
|
205
|
-
// src/
|
|
206
|
-
var OnFailureSchema = FunctionSchema.optional().describe(
|
|
207
|
-
"Defining a onFailure handler will add a global onFailure handler for the following resources:\n- Async lambda functions\n- SQS queues\n- DynamoDB streams"
|
|
208
|
-
);
|
|
209
|
-
|
|
210
|
-
// src/feature/config/schema.ts
|
|
208
|
+
// src/config/schema/email.ts
|
|
211
209
|
import { z as z6 } from "zod";
|
|
212
|
-
var
|
|
213
|
-
var ConfigsSchema = z6.array(ConfigNameSchema).optional().describe("Define the config values for your stack.");
|
|
210
|
+
var EmailSchema = z6.string().email();
|
|
214
211
|
|
|
215
|
-
// src/feature/
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
)
|
|
220
|
-
|
|
212
|
+
// src/feature/auth/schema.ts
|
|
213
|
+
var TriggersSchema = z7.object({
|
|
214
|
+
beforeToken: FunctionSchema.optional().describe("A pre jwt token generation AWS Lambda trigger."),
|
|
215
|
+
beforeLogin: FunctionSchema.optional().describe("A pre user login AWS Lambda trigger."),
|
|
216
|
+
afterLogin: FunctionSchema.optional().describe("A post user login AWS Lambda trigger."),
|
|
217
|
+
beforeRegister: FunctionSchema.optional().describe("A pre user register AWS Lambda trigger."),
|
|
218
|
+
afterRegister: FunctionSchema.optional().describe("A post user register AWS Lambda trigger."),
|
|
219
|
+
customMessage: FunctionSchema.optional().describe("A custom message AWS Lambda trigger."),
|
|
220
|
+
// /** A custom email sender AWS Lambda trigger */
|
|
221
|
+
// emailSender: FunctionSchema.optional(),
|
|
222
|
+
defineChallenge: FunctionSchema.optional().describe("Defines the authentication challenge."),
|
|
223
|
+
createChallenge: FunctionSchema.optional().describe("Creates an authentication challenge."),
|
|
224
|
+
verifyChallenge: FunctionSchema.optional().describe("Verifies the authentication challenge response.")
|
|
225
|
+
}).describe("Specifies the configuration for AWS Lambda triggers.");
|
|
226
|
+
var AuthSchema = z7.record(
|
|
221
227
|
ResourceIdSchema,
|
|
222
228
|
z7.object({
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
auth: z7.union([
|
|
226
|
-
ResourceIdSchema,
|
|
227
|
-
z7.object({
|
|
228
|
-
authorizer: FunctionSchema,
|
|
229
|
-
ttl: AuthorizerTtl.default("1 hour")
|
|
230
|
-
})
|
|
231
|
-
]).optional(),
|
|
232
|
-
// authorization: z.object({
|
|
233
|
-
// authorizer: FunctionSchema,
|
|
234
|
-
// ttl: DurationSchema.default('1 hour'),
|
|
235
|
-
// }).optional(),
|
|
236
|
-
resolver: LocalFileSchema.optional()
|
|
229
|
+
access: z7.boolean().default(false).describe("Give access to every function in this stack to your cognito instance."),
|
|
230
|
+
triggers: TriggersSchema.optional()
|
|
237
231
|
})
|
|
238
|
-
).describe(
|
|
239
|
-
var
|
|
232
|
+
).optional().describe("Define the auth triggers in your stack.");
|
|
233
|
+
var AuthDefaultSchema = z7.record(
|
|
240
234
|
ResourceIdSchema,
|
|
241
235
|
z7.object({
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
// FieldName
|
|
249
|
-
z7.string(),
|
|
250
|
-
z7.union([
|
|
251
|
-
FunctionSchema.transform((consumer) => ({
|
|
252
|
-
consumer
|
|
253
|
-
})),
|
|
254
|
-
z7.object({
|
|
255
|
-
consumer: FunctionSchema,
|
|
256
|
-
resolver: LocalFileSchema.optional()
|
|
257
|
-
})
|
|
258
|
-
])
|
|
236
|
+
allowUserRegistration: z7.boolean().default(true).describe("Specifies whether users can create an user account or if only the administrator can."),
|
|
237
|
+
messaging: z7.object({
|
|
238
|
+
fromEmail: EmailSchema.describe("Specifies the sender's email address."),
|
|
239
|
+
fromName: z7.string().optional().describe("Specifies the sender's name."),
|
|
240
|
+
replyTo: EmailSchema.optional().describe(
|
|
241
|
+
"The destination to which the receiver of the email should reply."
|
|
259
242
|
)
|
|
260
|
-
).describe("The
|
|
243
|
+
}).optional().describe("The email configuration for sending messages."),
|
|
244
|
+
// secret: z.boolean().default(false).describe('Specifies whether you want to generate a client secret.'),
|
|
245
|
+
username: z7.object({
|
|
246
|
+
emailAlias: z7.boolean().default(true).describe("Allow the user email to be used as username."),
|
|
247
|
+
caseSensitive: z7.boolean().default(false).describe(
|
|
248
|
+
"Specifies whether username case sensitivity will be enabled. When usernames and email addresses are case insensitive, users can sign in as the same user when they enter a different capitalization of their user name."
|
|
249
|
+
)
|
|
250
|
+
}).default({}).describe("The username policy."),
|
|
251
|
+
password: z7.object({
|
|
252
|
+
minLength: z7.number().int().min(6).max(99).default(12).describe("Required users to have at least the minimum password length."),
|
|
253
|
+
uppercase: z7.boolean().default(true).describe("Required users to use at least one uppercase letter in their password."),
|
|
254
|
+
lowercase: z7.boolean().default(true).describe("Required users to use at least one lowercase letter in their password."),
|
|
255
|
+
numbers: z7.boolean().default(true).describe("Required users to use at least one number in their password."),
|
|
256
|
+
symbols: z7.boolean().default(true).describe("Required users to use at least one symbol in their password."),
|
|
257
|
+
temporaryPasswordValidity: DurationSchema.default("7 days").describe(
|
|
258
|
+
"The duration a temporary password is valid. If the user doesn't sign in during this time, an administrator must reset their password."
|
|
259
|
+
)
|
|
260
|
+
}).default({}).describe("The password policy."),
|
|
261
|
+
validity: z7.object({
|
|
262
|
+
idToken: DurationSchema.default("1 hour").describe(
|
|
263
|
+
"The ID token time limit. After this limit expires, your user can't use their ID token."
|
|
264
|
+
),
|
|
265
|
+
accessToken: DurationSchema.default("1 hour").describe(
|
|
266
|
+
"The access token time limit. After this limit expires, your user can't use their access token."
|
|
267
|
+
),
|
|
268
|
+
refreshToken: DurationSchema.default("365 days").describe(
|
|
269
|
+
"The refresh token time limit. After this limit expires, your user can't use their refresh token."
|
|
270
|
+
)
|
|
271
|
+
}).default({}).describe("Specifies the validity duration for every JWT token."),
|
|
272
|
+
triggers: TriggersSchema.optional()
|
|
261
273
|
})
|
|
262
|
-
).describe("Define the
|
|
274
|
+
).default({}).describe("Define the authenticatable users in your app.");
|
|
263
275
|
|
|
264
|
-
// src/feature/
|
|
276
|
+
// src/feature/cache/schema.ts
|
|
265
277
|
import { z as z8 } from "zod";
|
|
266
|
-
var
|
|
267
|
-
|
|
278
|
+
var TypeSchema = z8.enum([
|
|
279
|
+
"t4g.small",
|
|
280
|
+
"t4g.medium",
|
|
281
|
+
"r6g.large",
|
|
282
|
+
"r6g.xlarge",
|
|
283
|
+
"r6g.2xlarge",
|
|
284
|
+
"r6g.4xlarge",
|
|
285
|
+
"r6g.8xlarge",
|
|
286
|
+
"r6g.12xlarge",
|
|
287
|
+
"r6g.16xlarge",
|
|
288
|
+
"r6gd.xlarge",
|
|
289
|
+
"r6gd.2xlarge",
|
|
290
|
+
"r6gd.4xlarge",
|
|
291
|
+
"r6gd.8xlarge"
|
|
292
|
+
]);
|
|
293
|
+
var PortSchema = z8.number().int().min(1).max(5e4);
|
|
294
|
+
var ShardsSchema = z8.number().int().min(0).max(100);
|
|
295
|
+
var ReplicasPerShardSchema = z8.number().int().min(0).max(5);
|
|
296
|
+
var EngineSchema = z8.enum(["7.0", "6.2"]);
|
|
297
|
+
var CachesSchema = z8.record(
|
|
268
298
|
ResourceIdSchema,
|
|
269
299
|
z8.object({
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
),
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
)
|
|
276
|
-
fields: z8.record(z8.string(), z8.enum(["string", "number", "binary"])).optional().describe(
|
|
277
|
-
'A list of attributes that describe the key schema for the table and indexes. If no attribute field is defined we default to "string".'
|
|
278
|
-
),
|
|
279
|
-
class: z8.enum(["standard", "standard-infrequent-access"]).default("standard").describe("The table class of the table."),
|
|
280
|
-
pointInTimeRecovery: z8.boolean().default(false).describe("Indicates whether point in time recovery is enabled on the table."),
|
|
281
|
-
timeToLiveAttribute: KeySchema.optional().describe(
|
|
282
|
-
"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."
|
|
283
|
-
),
|
|
284
|
-
stream: z8.object({
|
|
285
|
-
type: z8.enum(["keys-only", "new-image", "old-image", "new-and-old-images"]).describe(
|
|
286
|
-
"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."
|
|
287
|
-
),
|
|
288
|
-
consumer: FunctionSchema.describe("The consuming lambda function for the stream")
|
|
289
|
-
}).optional().describe(
|
|
290
|
-
"The settings for the DynamoDB table stream, which capture changes to items stored in the table."
|
|
291
|
-
),
|
|
292
|
-
indexes: z8.record(
|
|
293
|
-
z8.string(),
|
|
294
|
-
z8.object({
|
|
295
|
-
/** Specifies the name of the partition / hash key that makes up the primary key for the global secondary index. */
|
|
296
|
-
hash: KeySchema,
|
|
297
|
-
/** Specifies the name of the range / sort key that makes up the primary key for the global secondary index. */
|
|
298
|
-
sort: KeySchema.optional(),
|
|
299
|
-
/** The set of attributes that are projected into the index:
|
|
300
|
-
* - all - All of the table attributes are projected into the index.
|
|
301
|
-
* - keys-only - Only the index and primary keys are projected into the index.
|
|
302
|
-
* @default 'all'
|
|
303
|
-
*/
|
|
304
|
-
projection: z8.enum(["all", "keys-only"]).default("all")
|
|
305
|
-
})
|
|
306
|
-
).optional().describe("Specifies the global secondary indexes to be created on the table.")
|
|
300
|
+
type: TypeSchema.default("t4g.small"),
|
|
301
|
+
port: PortSchema.default(6379),
|
|
302
|
+
shards: ShardsSchema.default(1),
|
|
303
|
+
replicasPerShard: ReplicasPerShardSchema.default(1),
|
|
304
|
+
engine: EngineSchema.default("7.0"),
|
|
305
|
+
dataTiering: z8.boolean().default(false)
|
|
307
306
|
})
|
|
308
|
-
).optional().describe("Define the
|
|
307
|
+
).optional().describe("Define the caches in your stack. For access to the cache put your functions inside the global VPC.");
|
|
309
308
|
|
|
310
|
-
// src/feature/
|
|
309
|
+
// src/feature/config/schema.ts
|
|
311
310
|
import { z as z9 } from "zod";
|
|
312
|
-
var
|
|
313
|
-
|
|
314
|
-
const stores = {};
|
|
315
|
-
for (const key of list) {
|
|
316
|
-
stores[key] = {};
|
|
317
|
-
}
|
|
318
|
-
return stores;
|
|
319
|
-
}),
|
|
320
|
-
z9.record(
|
|
321
|
-
ResourceIdSchema,
|
|
322
|
-
z9.object({
|
|
323
|
-
// cors: CorsSchema,
|
|
324
|
-
versioning: z9.boolean().default(false).describe("Enable versioning of your store."),
|
|
325
|
-
events: z9.object({
|
|
326
|
-
// create
|
|
327
|
-
"created:*": FunctionSchema.optional().describe(
|
|
328
|
-
"Subscribe to notifications regardless of the API that was used to create an object."
|
|
329
|
-
),
|
|
330
|
-
"created:put": FunctionSchema.optional().describe(
|
|
331
|
-
"Subscribe to notifications when an object is created using the PUT API operation."
|
|
332
|
-
),
|
|
333
|
-
"created:post": FunctionSchema.optional().describe(
|
|
334
|
-
"Subscribe to notifications when an object is created using the POST API operation."
|
|
335
|
-
),
|
|
336
|
-
"created:copy": FunctionSchema.optional().describe(
|
|
337
|
-
"Subscribe to notifications when an object is created using the COPY API operation."
|
|
338
|
-
),
|
|
339
|
-
"created:upload": FunctionSchema.optional().describe(
|
|
340
|
-
"Subscribe to notifications when an object multipart upload has been completed."
|
|
341
|
-
),
|
|
342
|
-
// remove
|
|
343
|
-
"removed:*": FunctionSchema.optional().describe(
|
|
344
|
-
"Subscribe to notifications when an object is deleted or a delete marker for a versioned object is created."
|
|
345
|
-
),
|
|
346
|
-
"removed:delete": FunctionSchema.optional().describe(
|
|
347
|
-
"Subscribe to notifications when an object is deleted"
|
|
348
|
-
),
|
|
349
|
-
"removed:marker": FunctionSchema.optional().describe(
|
|
350
|
-
"Subscribe to notifications when a delete marker for a versioned object is created."
|
|
351
|
-
)
|
|
352
|
-
}).optional().describe("Describes the store events you want to subscribe too.")
|
|
353
|
-
})
|
|
354
|
-
)
|
|
355
|
-
]).optional().describe("Define the stores in your stack.");
|
|
356
|
-
|
|
357
|
-
// src/feature/queue/schema.ts
|
|
358
|
-
import { z as z10 } from "zod";
|
|
359
|
-
import { days as days2, hours, minutes as minutes2, seconds as seconds2 } from "@awsless/duration";
|
|
360
|
-
import { kibibytes } from "@awsless/size";
|
|
361
|
-
var RetentionPeriodSchema = DurationSchema.refine(
|
|
362
|
-
durationMin(minutes2(1)),
|
|
363
|
-
"Minimum retention period is 1 minute"
|
|
364
|
-
).refine(durationMax(days2(14)), "Maximum retention period is 14 days").describe(
|
|
365
|
-
"The number of seconds that Amazon SQS retains a message. You can specify a duration from 1 minute to 14 days."
|
|
366
|
-
);
|
|
367
|
-
var VisibilityTimeoutSchema = DurationSchema.refine(
|
|
368
|
-
durationMax(hours(12)),
|
|
369
|
-
"Maximum visibility timeout is 12 hours"
|
|
370
|
-
).describe(
|
|
371
|
-
"The length of time during which a message will be unavailable after a message is delivered from the queue. This blocks other components from receiving the same message and gives the initial component time to process and delete the message from the queue. You can specify a duration from 0 to 12 hours."
|
|
372
|
-
);
|
|
373
|
-
var DeliveryDelaySchema = DurationSchema.refine(
|
|
374
|
-
durationMax(minutes2(15)),
|
|
375
|
-
"Maximum delivery delay is 15 minutes"
|
|
376
|
-
).describe(
|
|
377
|
-
"The time in seconds for which the delivery of all messages in the queue is delayed. You can specify a duration from 0 to 15 minutes."
|
|
378
|
-
);
|
|
379
|
-
var ReceiveMessageWaitTimeSchema = DurationSchema.refine(
|
|
380
|
-
durationMin(seconds2(1)),
|
|
381
|
-
"Minimum receive message wait time is 1 second"
|
|
382
|
-
).refine(durationMax(seconds2(20)), "Maximum receive message wait time is 20 seconds").describe(
|
|
383
|
-
"Specifies the duration, that the ReceiveMessage action call waits until a message is in the queue in order to include it in the response, rather than returning an empty response if a message isn't yet available. You can specify a duration from 1 to 20 seconds. Short polling is used as the default."
|
|
384
|
-
);
|
|
385
|
-
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(
|
|
386
|
-
"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."
|
|
387
|
-
);
|
|
388
|
-
var BatchSizeSchema = z10.number().int().min(1, "Minimum batch size is 1").max(1e4, "Maximum batch size is 10000").describe(
|
|
389
|
-
"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."
|
|
390
|
-
);
|
|
391
|
-
var MaxConcurrencySchema = z10.number().int().min(2, "Minimum max concurrency is 2").max(1e3, "Maximum max concurrency is 1000").describe(
|
|
392
|
-
"Limits the number of concurrent instances that the queue worker can invoke. You can specify an integer from 2 to 1000."
|
|
393
|
-
);
|
|
394
|
-
var MaxBatchingWindow = DurationSchema.refine(
|
|
395
|
-
durationMax(minutes2(5)),
|
|
396
|
-
"Maximum max batching window is 5 minutes"
|
|
397
|
-
).describe(
|
|
398
|
-
"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."
|
|
399
|
-
);
|
|
400
|
-
var QueueDefaultSchema = z10.object({
|
|
401
|
-
retentionPeriod: RetentionPeriodSchema.default("7 days"),
|
|
402
|
-
visibilityTimeout: VisibilityTimeoutSchema.default("30 seconds"),
|
|
403
|
-
deliveryDelay: DeliveryDelaySchema.default("0 seconds"),
|
|
404
|
-
receiveMessageWaitTime: ReceiveMessageWaitTimeSchema.optional(),
|
|
405
|
-
maxMessageSize: MaxMessageSizeSchema.default("256 KB"),
|
|
406
|
-
batchSize: BatchSizeSchema.default(10),
|
|
407
|
-
maxConcurrency: MaxConcurrencySchema.optional(),
|
|
408
|
-
maxBatchingWindow: MaxBatchingWindow.optional()
|
|
409
|
-
}).default({});
|
|
410
|
-
var QueuesSchema = z10.record(
|
|
411
|
-
ResourceIdSchema,
|
|
412
|
-
z10.union([
|
|
413
|
-
LocalFileSchema.transform((file) => ({
|
|
414
|
-
consumer: {
|
|
415
|
-
file
|
|
416
|
-
}
|
|
417
|
-
})),
|
|
418
|
-
z10.object({
|
|
419
|
-
consumer: FunctionSchema.describe("he consuming lambda function properties."),
|
|
420
|
-
retentionPeriod: RetentionPeriodSchema.optional(),
|
|
421
|
-
visibilityTimeout: VisibilityTimeoutSchema.optional(),
|
|
422
|
-
deliveryDelay: DeliveryDelaySchema.optional(),
|
|
423
|
-
receiveMessageWaitTime: ReceiveMessageWaitTimeSchema.optional(),
|
|
424
|
-
maxMessageSize: MaxMessageSizeSchema.optional(),
|
|
425
|
-
batchSize: BatchSizeSchema.optional(),
|
|
426
|
-
maxConcurrency: MaxConcurrencySchema.optional(),
|
|
427
|
-
maxBatchingWindow: MaxBatchingWindow.optional()
|
|
428
|
-
})
|
|
429
|
-
])
|
|
430
|
-
).optional().describe("Define the queues in your stack.");
|
|
431
|
-
|
|
432
|
-
// src/feature/pubsub/schema.ts
|
|
433
|
-
import { z as z11 } from "zod";
|
|
434
|
-
var PubSubSchema = z11.record(
|
|
435
|
-
ResourceIdSchema,
|
|
436
|
-
z11.object({
|
|
437
|
-
sql: z11.string().describe("The SQL statement used to query the IOT topic."),
|
|
438
|
-
sqlVersion: z11.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
|
-
consumer: FunctionSchema.describe("The consuming lambda function properties.")
|
|
440
|
-
})
|
|
441
|
-
).optional().describe("Define the pubsub subscriber in your stack.");
|
|
442
|
-
|
|
443
|
-
// src/feature/rest/schema.ts
|
|
444
|
-
import { z as z13 } from "zod";
|
|
445
|
-
|
|
446
|
-
// src/config/schema/route.ts
|
|
447
|
-
import { z as z12 } from "zod";
|
|
448
|
-
var RouteSchema = z12.union([
|
|
449
|
-
z12.string().regex(/^(POST|GET|PUT|DELETE|HEAD|OPTIONS)(\s\/[a-z0-9\+\_\-\/\{\}]*)$/gi, "Invalid route"),
|
|
450
|
-
z12.literal("$default")
|
|
451
|
-
]);
|
|
452
|
-
|
|
453
|
-
// src/feature/rest/schema.ts
|
|
454
|
-
var RestDefaultSchema = z13.record(
|
|
455
|
-
ResourceIdSchema,
|
|
456
|
-
z13.object({
|
|
457
|
-
domain: ResourceIdSchema.describe("The domain id to link your API with.").optional(),
|
|
458
|
-
subDomain: z13.string().optional()
|
|
459
|
-
})
|
|
460
|
-
).optional().describe("Define your global REST API's.");
|
|
461
|
-
var RestSchema = z13.record(ResourceIdSchema, z13.record(RouteSchema, FunctionSchema)).optional().describe("Define routes in your stack for your global REST API.");
|
|
462
|
-
|
|
463
|
-
// src/feature/test/schema.ts
|
|
464
|
-
import { z as z15 } from "zod";
|
|
465
|
-
|
|
466
|
-
// src/config/schema/local-directory.ts
|
|
467
|
-
import { stat as stat2 } from "fs/promises";
|
|
468
|
-
import { z as z14 } from "zod";
|
|
469
|
-
var LocalDirectorySchema = z14.string().transform((path) => resolvePath(path)).refine(async (path) => {
|
|
470
|
-
try {
|
|
471
|
-
const s = await stat2(path);
|
|
472
|
-
return s.isDirectory();
|
|
473
|
-
} catch (error) {
|
|
474
|
-
return false;
|
|
475
|
-
}
|
|
476
|
-
}, `Directory doesn't exist`);
|
|
477
|
-
|
|
478
|
-
// src/feature/test/schema.ts
|
|
479
|
-
var TestsSchema = z15.union([LocalDirectorySchema.transform((v) => [v]), LocalDirectorySchema.array()]).describe("Define the location of your tests for your stack.").optional();
|
|
480
|
-
|
|
481
|
-
// src/feature/topic/schema.ts
|
|
482
|
-
import { paramCase as paramCase2 } from "change-case";
|
|
483
|
-
import { z as z17 } from "zod";
|
|
484
|
-
|
|
485
|
-
// src/config/schema/email.ts
|
|
486
|
-
import { z as z16 } from "zod";
|
|
487
|
-
var EmailSchema = z16.string().email();
|
|
488
|
-
|
|
489
|
-
// src/feature/topic/schema.ts
|
|
490
|
-
var TopicNameSchema = z17.string().min(3).max(256).regex(/^[a-z0-9\-]+$/i, "Invalid topic name").transform((value) => paramCase2(value)).describe("Define event topic name.");
|
|
491
|
-
var TopicsSchema = z17.array(TopicNameSchema).refine((topics) => {
|
|
492
|
-
return topics.length === new Set(topics).size;
|
|
493
|
-
}, "Must be a list of unique topic names").optional().describe("Define the event topics to publish too in your stack.");
|
|
494
|
-
var SubscribersSchema = z17.record(TopicNameSchema, z17.union([EmailSchema, FunctionSchema])).optional().describe("Define the event topics to subscribe too in your stack.");
|
|
311
|
+
var ConfigNameSchema = z9.string().regex(/[a-z0-9\-]/g, "Invalid config name");
|
|
312
|
+
var ConfigsSchema = z9.array(ConfigNameSchema).optional().describe("Define the config values for your stack.");
|
|
495
313
|
|
|
496
314
|
// src/feature/cron/schema/index.ts
|
|
497
|
-
import { z as
|
|
315
|
+
import { z as z11 } from "zod";
|
|
498
316
|
|
|
499
317
|
// src/feature/cron/schema/schedule.ts
|
|
500
|
-
import { z as
|
|
318
|
+
import { z as z10 } from "zod";
|
|
501
319
|
import { awsCronExpressionValidator } from "aws-cron-expression-validator";
|
|
502
|
-
var RateExpressionSchema =
|
|
320
|
+
var RateExpressionSchema = z10.custom(
|
|
503
321
|
(value) => {
|
|
504
|
-
return
|
|
322
|
+
return z10.string().regex(/^[0-9]+ (seconds?|minutes?|hours?|days?)$/).refine((rate) => {
|
|
505
323
|
const [str] = rate.split(" ");
|
|
506
324
|
const number = parseInt(str);
|
|
507
325
|
return number > 0;
|
|
@@ -517,9 +335,9 @@ var RateExpressionSchema = z18.custom(
|
|
|
517
335
|
}
|
|
518
336
|
return `rate(${rate})`;
|
|
519
337
|
});
|
|
520
|
-
var CronExpressionSchema =
|
|
338
|
+
var CronExpressionSchema = z10.custom(
|
|
521
339
|
(value) => {
|
|
522
|
-
return
|
|
340
|
+
return z10.string().safeParse(value).success;
|
|
523
341
|
},
|
|
524
342
|
{ message: "Invalid cron expression" }
|
|
525
343
|
).superRefine((value, ctx) => {
|
|
@@ -528,12 +346,12 @@ var CronExpressionSchema = z18.custom(
|
|
|
528
346
|
} catch (error) {
|
|
529
347
|
if (error instanceof Error) {
|
|
530
348
|
ctx.addIssue({
|
|
531
|
-
code:
|
|
349
|
+
code: z10.ZodIssueCode.custom,
|
|
532
350
|
message: `Invalid cron expression: ${error.message}`
|
|
533
351
|
});
|
|
534
352
|
} else {
|
|
535
353
|
ctx.addIssue({
|
|
536
|
-
code:
|
|
354
|
+
code: z10.ZodIssueCode.custom,
|
|
537
355
|
message: "Invalid cron expression"
|
|
538
356
|
});
|
|
539
357
|
}
|
|
@@ -544,134 +362,246 @@ var CronExpressionSchema = z18.custom(
|
|
|
544
362
|
var ScheduleExpressionSchema = RateExpressionSchema.or(CronExpressionSchema);
|
|
545
363
|
|
|
546
364
|
// src/feature/cron/schema/index.ts
|
|
547
|
-
var CronsSchema =
|
|
365
|
+
var CronsSchema = z11.record(
|
|
548
366
|
ResourceIdSchema,
|
|
549
|
-
|
|
550
|
-
enabled:
|
|
367
|
+
z11.object({
|
|
368
|
+
enabled: z11.boolean().default(true).describe("If the cron is enabled."),
|
|
551
369
|
consumer: FunctionSchema.describe("The consuming lambda function properties."),
|
|
552
370
|
schedule: ScheduleExpressionSchema.describe(
|
|
553
371
|
'The scheduling expression.\n\nexample: "0 20 * * ? *"\nexample: "5 minutes"'
|
|
554
372
|
),
|
|
555
|
-
payload:
|
|
373
|
+
payload: z11.unknown().optional().describe("The JSON payload that will be passed to the consumer.")
|
|
556
374
|
})
|
|
557
375
|
).optional();
|
|
558
376
|
|
|
559
|
-
// src/feature/
|
|
560
|
-
import { z as
|
|
561
|
-
var
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
"r6g.xlarge",
|
|
566
|
-
"r6g.2xlarge",
|
|
567
|
-
"r6g.4xlarge",
|
|
568
|
-
"r6g.8xlarge",
|
|
569
|
-
"r6g.12xlarge",
|
|
570
|
-
"r6g.16xlarge",
|
|
571
|
-
"r6gd.xlarge",
|
|
572
|
-
"r6gd.2xlarge",
|
|
573
|
-
"r6gd.4xlarge",
|
|
574
|
-
"r6gd.8xlarge"
|
|
575
|
-
]);
|
|
576
|
-
var PortSchema = z20.number().int().min(1).max(5e4);
|
|
577
|
-
var ShardsSchema = z20.number().int().min(0).max(100);
|
|
578
|
-
var ReplicasPerShardSchema = z20.number().int().min(0).max(5);
|
|
579
|
-
var EngineSchema = z20.enum(["7.0", "6.2"]);
|
|
580
|
-
var CachesSchema = z20.record(
|
|
581
|
-
ResourceIdSchema,
|
|
582
|
-
z20.object({
|
|
583
|
-
type: TypeSchema.default("t4g.small"),
|
|
584
|
-
port: PortSchema.default(6379),
|
|
585
|
-
shards: ShardsSchema.default(1),
|
|
586
|
-
replicasPerShard: ReplicasPerShardSchema.default(1),
|
|
587
|
-
engine: EngineSchema.default("7.0"),
|
|
588
|
-
dataTiering: z20.boolean().default(false)
|
|
589
|
-
})
|
|
590
|
-
).optional().describe("Define the caches in your stack. For access to the cache put your functions inside the global VPC.");
|
|
591
|
-
|
|
592
|
-
// src/feature/auth/schema.ts
|
|
593
|
-
import { z as z21 } from "zod";
|
|
594
|
-
var TriggersSchema = z21.object({
|
|
595
|
-
beforeToken: FunctionSchema.optional().describe("A pre jwt token generation AWS Lambda trigger."),
|
|
596
|
-
beforeLogin: FunctionSchema.optional().describe("A pre user login AWS Lambda trigger."),
|
|
597
|
-
afterLogin: FunctionSchema.optional().describe("A post user login AWS Lambda trigger."),
|
|
598
|
-
beforeRegister: FunctionSchema.optional().describe("A pre user register AWS Lambda trigger."),
|
|
599
|
-
afterRegister: FunctionSchema.optional().describe("A post user register AWS Lambda trigger."),
|
|
600
|
-
customMessage: FunctionSchema.optional().describe("A custom message AWS Lambda trigger."),
|
|
601
|
-
// /** A custom email sender AWS Lambda trigger */
|
|
602
|
-
// emailSender: FunctionSchema.optional(),
|
|
603
|
-
defineChallenge: FunctionSchema.optional().describe("Defines the authentication challenge."),
|
|
604
|
-
createChallenge: FunctionSchema.optional().describe("Creates an authentication challenge."),
|
|
605
|
-
verifyChallenge: FunctionSchema.optional().describe("Verifies the authentication challenge response.")
|
|
606
|
-
}).describe("Specifies the configuration for AWS Lambda triggers.");
|
|
607
|
-
var AuthSchema = z21.record(
|
|
377
|
+
// src/feature/graphql/schema.ts
|
|
378
|
+
import { z as z12 } from "zod";
|
|
379
|
+
var AuthorizerTtl = DurationSchema.describe(
|
|
380
|
+
`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
|
+
);
|
|
382
|
+
var GraphQLDefaultSchema = z12.record(
|
|
608
383
|
ResourceIdSchema,
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
384
|
+
z12.object({
|
|
385
|
+
domain: ResourceIdSchema.describe("The domain id to link your API with.").optional(),
|
|
386
|
+
subDomain: z12.string().optional(),
|
|
387
|
+
auth: z12.union([
|
|
388
|
+
ResourceIdSchema,
|
|
389
|
+
z12.object({
|
|
390
|
+
authorizer: FunctionSchema,
|
|
391
|
+
ttl: AuthorizerTtl.default("1 hour")
|
|
392
|
+
})
|
|
393
|
+
]).optional(),
|
|
394
|
+
// authorization: z.object({
|
|
395
|
+
// authorizer: FunctionSchema,
|
|
396
|
+
// ttl: DurationSchema.default('1 hour'),
|
|
397
|
+
// }).optional(),
|
|
398
|
+
resolver: LocalFileSchema.optional()
|
|
612
399
|
})
|
|
613
|
-
).
|
|
614
|
-
var
|
|
400
|
+
).describe(`Define the global GraphQL API's.`).optional();
|
|
401
|
+
var GraphQLSchema = z12.record(
|
|
615
402
|
ResourceIdSchema,
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
uppercase: z21.boolean().default(true).describe("Required users to use at least one uppercase letter in their password."),
|
|
635
|
-
lowercase: z21.boolean().default(true).describe("Required users to use at least one lowercase letter in their password."),
|
|
636
|
-
numbers: z21.boolean().default(true).describe("Required users to use at least one number in their password."),
|
|
637
|
-
symbols: z21.boolean().default(true).describe("Required users to use at least one symbol in their password."),
|
|
638
|
-
temporaryPasswordValidity: DurationSchema.default("7 days").describe(
|
|
639
|
-
"The duration a temporary password is valid. If the user doesn't sign in during this time, an administrator must reset their password."
|
|
640
|
-
)
|
|
641
|
-
}).default({}).describe("The password policy."),
|
|
642
|
-
validity: z21.object({
|
|
643
|
-
idToken: DurationSchema.default("1 hour").describe(
|
|
644
|
-
"The ID token time limit. After this limit expires, your user can't use their ID token."
|
|
645
|
-
),
|
|
646
|
-
accessToken: DurationSchema.default("1 hour").describe(
|
|
647
|
-
"The access token time limit. After this limit expires, your user can't use their access token."
|
|
648
|
-
),
|
|
649
|
-
refreshToken: DurationSchema.default("365 days").describe(
|
|
650
|
-
"The refresh token time limit. After this limit expires, your user can't use their refresh token."
|
|
403
|
+
z12.object({
|
|
404
|
+
// schema: z.union([LocalFileSchema.transform(v => [v]), z.array(LocalFileSchema).min(1)]).optional(),
|
|
405
|
+
schema: LocalFileSchema.describe("The graphql schema file."),
|
|
406
|
+
resolvers: z12.record(
|
|
407
|
+
// TypeName
|
|
408
|
+
z12.string(),
|
|
409
|
+
z12.record(
|
|
410
|
+
// FieldName
|
|
411
|
+
z12.string(),
|
|
412
|
+
z12.union([
|
|
413
|
+
FunctionSchema.transform((consumer) => ({
|
|
414
|
+
consumer
|
|
415
|
+
})),
|
|
416
|
+
z12.object({
|
|
417
|
+
consumer: FunctionSchema,
|
|
418
|
+
resolver: LocalFileSchema.optional()
|
|
419
|
+
})
|
|
420
|
+
])
|
|
651
421
|
)
|
|
652
|
-
|
|
653
|
-
triggers: TriggersSchema.optional()
|
|
422
|
+
).describe("The resolvers for your global GraphQL API.").optional()
|
|
654
423
|
})
|
|
655
|
-
).
|
|
424
|
+
).describe("Define the schema & resolvers in your stack for your global GraphQL API.").optional();
|
|
656
425
|
|
|
657
426
|
// src/feature/http/schema.ts
|
|
658
|
-
import { z as
|
|
659
|
-
var
|
|
660
|
-
var HttpDefaultSchema =
|
|
427
|
+
import { z as z13 } from "zod";
|
|
428
|
+
var RouteSchema = z13.string().regex(/^(POST|GET|PUT|DELETE|HEAD|OPTIONS)(\s\/[a-z0-9\+\_\-\/\{\}]*)$/gi, "Invalid route").transform((v) => v);
|
|
429
|
+
var HttpDefaultSchema = z13.record(
|
|
661
430
|
ResourceIdSchema,
|
|
662
|
-
|
|
431
|
+
z13.object({
|
|
663
432
|
domain: ResourceIdSchema.describe("The domain id to link your API with."),
|
|
664
|
-
subDomain:
|
|
433
|
+
subDomain: z13.string().optional()
|
|
665
434
|
// auth: ResourceIdSchema.optional(),
|
|
666
435
|
})
|
|
667
436
|
).optional().describe("Define your global HTTP API's.");
|
|
668
|
-
var HttpSchema =
|
|
437
|
+
var HttpSchema = z13.record(ResourceIdSchema, z13.record(RouteSchema, FunctionSchema)).optional().describe("Define routes in your stack for your global HTTP API.");
|
|
438
|
+
|
|
439
|
+
// src/feature/instance/schema.ts
|
|
440
|
+
import { z as z15 } from "zod";
|
|
441
|
+
|
|
442
|
+
// src/config/schema/local-directory.ts
|
|
443
|
+
import { stat as stat2 } from "fs/promises";
|
|
444
|
+
import { z as z14 } from "zod";
|
|
445
|
+
var LocalDirectorySchema = z14.string().transform((path) => resolvePath(path)).refine(async (path) => {
|
|
446
|
+
try {
|
|
447
|
+
const s = await stat2(path);
|
|
448
|
+
return s.isDirectory();
|
|
449
|
+
} catch (error) {
|
|
450
|
+
return false;
|
|
451
|
+
}
|
|
452
|
+
}, `Directory doesn't exist`);
|
|
453
|
+
|
|
454
|
+
// src/feature/instance/schema.ts
|
|
455
|
+
var ImageSchema = z15.string().regex(/^ami\-[0-9a-f]+/).describe("The ID of the AMI.");
|
|
456
|
+
var TypeSchema2 = z15.enum([
|
|
457
|
+
"t3.nano",
|
|
458
|
+
"t3.micro",
|
|
459
|
+
"t3.small",
|
|
460
|
+
"t3.medium",
|
|
461
|
+
"t3.large",
|
|
462
|
+
"t3.xlarge",
|
|
463
|
+
"t3.2xlarge",
|
|
464
|
+
"t4g.nano",
|
|
465
|
+
"t4g.micro",
|
|
466
|
+
"t4g.small",
|
|
467
|
+
"t4g.medium",
|
|
468
|
+
"t4g.large",
|
|
469
|
+
"t4g.xlarge",
|
|
470
|
+
"t4g.2xlarge",
|
|
471
|
+
"g4ad.xlarge"
|
|
472
|
+
]).describe(`The instance type.`);
|
|
473
|
+
var CommandSchema = z15.string().describe(`The script you want to execute when the instance starts up.`);
|
|
474
|
+
var CodeSchema = LocalDirectorySchema.describe(`The code directory that will be deployed to your instance.`);
|
|
475
|
+
var ConnectSchema = z15.boolean().describe("Allows you to connect to all instances with an Instance Connect Endpoint.");
|
|
476
|
+
var InstanceDefaultSchema = z15.object({
|
|
477
|
+
connect: ConnectSchema.default(false)
|
|
478
|
+
}).default({}).describe("Define the default settings for all instances in your stacks.");
|
|
479
|
+
var InstancesSchema = z15.record(
|
|
480
|
+
ResourceIdSchema,
|
|
481
|
+
z15.object({
|
|
482
|
+
image: ImageSchema,
|
|
483
|
+
type: TypeSchema2,
|
|
484
|
+
code: CodeSchema,
|
|
485
|
+
command: CommandSchema.optional()
|
|
486
|
+
})
|
|
487
|
+
).optional().describe("Define the instances in your stack.");
|
|
488
|
+
|
|
489
|
+
// src/feature/on-failure/schema.ts
|
|
490
|
+
var OnFailureSchema = FunctionSchema.optional().describe(
|
|
491
|
+
"Defining a onFailure handler will add a global onFailure handler for the following resources:\n- Async lambda functions\n- SQS queues\n- DynamoDB streams"
|
|
492
|
+
);
|
|
493
|
+
|
|
494
|
+
// src/feature/pubsub/schema.ts
|
|
495
|
+
import { z as z16 } from "zod";
|
|
496
|
+
var PubSubSchema = z16.record(
|
|
497
|
+
ResourceIdSchema,
|
|
498
|
+
z16.object({
|
|
499
|
+
sql: z16.string().describe("The SQL statement used to query the IOT topic."),
|
|
500
|
+
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."),
|
|
501
|
+
consumer: FunctionSchema.describe("The consuming lambda function properties.")
|
|
502
|
+
})
|
|
503
|
+
).optional().describe("Define the pubsub subscriber in your stack.");
|
|
504
|
+
|
|
505
|
+
// src/feature/queue/schema.ts
|
|
506
|
+
import { z as z17 } from "zod";
|
|
507
|
+
import { days as days2, hours, minutes as minutes2, seconds as seconds2 } from "@awsless/duration";
|
|
508
|
+
import { kibibytes } from "@awsless/size";
|
|
509
|
+
var RetentionPeriodSchema = DurationSchema.refine(
|
|
510
|
+
durationMin(minutes2(1)),
|
|
511
|
+
"Minimum retention period is 1 minute"
|
|
512
|
+
).refine(durationMax(days2(14)), "Maximum retention period is 14 days").describe(
|
|
513
|
+
"The number of seconds that Amazon SQS retains a message. You can specify a duration from 1 minute to 14 days."
|
|
514
|
+
);
|
|
515
|
+
var VisibilityTimeoutSchema = DurationSchema.refine(
|
|
516
|
+
durationMax(hours(12)),
|
|
517
|
+
"Maximum visibility timeout is 12 hours"
|
|
518
|
+
).describe(
|
|
519
|
+
"The length of time during which a message will be unavailable after a message is delivered from the queue. This blocks other components from receiving the same message and gives the initial component time to process and delete the message from the queue. You can specify a duration from 0 to 12 hours."
|
|
520
|
+
);
|
|
521
|
+
var DeliveryDelaySchema = DurationSchema.refine(
|
|
522
|
+
durationMax(minutes2(15)),
|
|
523
|
+
"Maximum delivery delay is 15 minutes"
|
|
524
|
+
).describe(
|
|
525
|
+
"The time in seconds for which the delivery of all messages in the queue is delayed. You can specify a duration from 0 to 15 minutes."
|
|
526
|
+
);
|
|
527
|
+
var ReceiveMessageWaitTimeSchema = DurationSchema.refine(
|
|
528
|
+
durationMin(seconds2(1)),
|
|
529
|
+
"Minimum receive message wait time is 1 second"
|
|
530
|
+
).refine(durationMax(seconds2(20)), "Maximum receive message wait time is 20 seconds").describe(
|
|
531
|
+
"Specifies the duration, that the ReceiveMessage action call waits until a message is in the queue in order to include it in the response, rather than returning an empty response if a message isn't yet available. You can specify a duration from 1 to 20 seconds. Short polling is used as the default."
|
|
532
|
+
);
|
|
533
|
+
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(
|
|
534
|
+
"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."
|
|
535
|
+
);
|
|
536
|
+
var BatchSizeSchema = z17.number().int().min(1, "Minimum batch size is 1").max(1e4, "Maximum batch size is 10000").describe(
|
|
537
|
+
"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."
|
|
538
|
+
);
|
|
539
|
+
var MaxConcurrencySchema = z17.number().int().min(2, "Minimum max concurrency is 2").max(1e3, "Maximum max concurrency is 1000").describe(
|
|
540
|
+
"Limits the number of concurrent instances that the queue worker can invoke. You can specify an integer from 2 to 1000."
|
|
541
|
+
);
|
|
542
|
+
var MaxBatchingWindow = DurationSchema.refine(
|
|
543
|
+
durationMax(minutes2(5)),
|
|
544
|
+
"Maximum max batching window is 5 minutes"
|
|
545
|
+
).describe(
|
|
546
|
+
"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."
|
|
547
|
+
);
|
|
548
|
+
var QueueDefaultSchema = z17.object({
|
|
549
|
+
retentionPeriod: RetentionPeriodSchema.default("7 days"),
|
|
550
|
+
visibilityTimeout: VisibilityTimeoutSchema.default("30 seconds"),
|
|
551
|
+
deliveryDelay: DeliveryDelaySchema.default("0 seconds"),
|
|
552
|
+
receiveMessageWaitTime: ReceiveMessageWaitTimeSchema.optional(),
|
|
553
|
+
maxMessageSize: MaxMessageSizeSchema.default("256 KB"),
|
|
554
|
+
batchSize: BatchSizeSchema.default(10),
|
|
555
|
+
maxConcurrency: MaxConcurrencySchema.optional(),
|
|
556
|
+
maxBatchingWindow: MaxBatchingWindow.optional()
|
|
557
|
+
}).default({});
|
|
558
|
+
var QueuesSchema = z17.record(
|
|
559
|
+
ResourceIdSchema,
|
|
560
|
+
z17.union([
|
|
561
|
+
LocalFileSchema.transform((file) => ({
|
|
562
|
+
consumer: {
|
|
563
|
+
file
|
|
564
|
+
}
|
|
565
|
+
})),
|
|
566
|
+
z17.object({
|
|
567
|
+
consumer: FunctionSchema.describe("he consuming lambda function properties."),
|
|
568
|
+
retentionPeriod: RetentionPeriodSchema.optional(),
|
|
569
|
+
visibilityTimeout: VisibilityTimeoutSchema.optional(),
|
|
570
|
+
deliveryDelay: DeliveryDelaySchema.optional(),
|
|
571
|
+
receiveMessageWaitTime: ReceiveMessageWaitTimeSchema.optional(),
|
|
572
|
+
maxMessageSize: MaxMessageSizeSchema.optional(),
|
|
573
|
+
batchSize: BatchSizeSchema.optional(),
|
|
574
|
+
maxConcurrency: MaxConcurrencySchema.optional(),
|
|
575
|
+
maxBatchingWindow: MaxBatchingWindow.optional()
|
|
576
|
+
})
|
|
577
|
+
])
|
|
578
|
+
).optional().describe("Define the queues in your stack.");
|
|
579
|
+
|
|
580
|
+
// src/feature/rest/schema.ts
|
|
581
|
+
import { z as z19 } from "zod";
|
|
582
|
+
|
|
583
|
+
// src/config/schema/route.ts
|
|
584
|
+
import { z as z18 } from "zod";
|
|
585
|
+
var RouteSchema2 = z18.union([
|
|
586
|
+
z18.string().regex(/^(POST|GET|PUT|DELETE|HEAD|OPTIONS)(\s\/[a-z0-9\+\_\-\/\{\}]*)$/gi, "Invalid route"),
|
|
587
|
+
z18.literal("$default")
|
|
588
|
+
]);
|
|
589
|
+
|
|
590
|
+
// src/feature/rest/schema.ts
|
|
591
|
+
var RestDefaultSchema = z19.record(
|
|
592
|
+
ResourceIdSchema,
|
|
593
|
+
z19.object({
|
|
594
|
+
domain: ResourceIdSchema.describe("The domain id to link your API with.").optional(),
|
|
595
|
+
subDomain: z19.string().optional()
|
|
596
|
+
})
|
|
597
|
+
).optional().describe("Define your global REST API's.");
|
|
598
|
+
var RestSchema = z19.record(ResourceIdSchema, z19.record(RouteSchema2, FunctionSchema)).optional().describe("Define routes in your stack for your global REST API.");
|
|
669
599
|
|
|
670
600
|
// src/feature/search/schema.ts
|
|
671
|
-
import { z as
|
|
601
|
+
import { z as z20 } from "zod";
|
|
672
602
|
import { gibibytes as gibibytes2 } from "@awsless/size";
|
|
673
|
-
var VersionSchema =
|
|
674
|
-
var
|
|
603
|
+
var VersionSchema = z20.enum(["2.13", "2.11", "2.9", "2.7", "2.5", "2.3", "1.3"]);
|
|
604
|
+
var TypeSchema3 = z20.enum([
|
|
675
605
|
"t3.small",
|
|
676
606
|
"t3.medium",
|
|
677
607
|
"t3.large",
|
|
@@ -772,41 +702,41 @@ var TypeSchema2 = z23.enum([
|
|
|
772
702
|
"r6gd.16xlarge"
|
|
773
703
|
]);
|
|
774
704
|
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.");
|
|
775
|
-
var SearchsSchema =
|
|
705
|
+
var SearchsSchema = z20.record(
|
|
776
706
|
ResourceIdSchema,
|
|
777
|
-
|
|
778
|
-
type:
|
|
779
|
-
count:
|
|
707
|
+
z20.object({
|
|
708
|
+
type: TypeSchema3.default("t3.small"),
|
|
709
|
+
count: z20.number().int().min(1).default(1),
|
|
780
710
|
version: VersionSchema.default("2.13"),
|
|
781
711
|
storage: StorageSizeSchema.default("10 GB"),
|
|
782
|
-
vpc:
|
|
712
|
+
vpc: z20.boolean().default(false)
|
|
783
713
|
})
|
|
784
714
|
).optional().describe("Define the search instances in your stack. Backed by OpenSearch.");
|
|
785
715
|
|
|
786
716
|
// src/feature/site/schema.ts
|
|
787
|
-
import { z as
|
|
788
|
-
var ErrorResponsePathSchema =
|
|
717
|
+
import { z as z21 } from "zod";
|
|
718
|
+
var ErrorResponsePathSchema = z21.string().describe(
|
|
789
719
|
"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."
|
|
790
720
|
);
|
|
791
|
-
var StatusCodeSchema =
|
|
721
|
+
var StatusCodeSchema = z21.number().int().positive().optional().describe(
|
|
792
722
|
"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."
|
|
793
723
|
);
|
|
794
724
|
var MinTTLSchema = DurationSchema.describe(
|
|
795
725
|
"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."
|
|
796
726
|
);
|
|
797
|
-
var ErrorResponseSchema =
|
|
727
|
+
var ErrorResponseSchema = z21.union([
|
|
798
728
|
ErrorResponsePathSchema,
|
|
799
|
-
|
|
729
|
+
z21.object({
|
|
800
730
|
path: ErrorResponsePathSchema,
|
|
801
731
|
statusCode: StatusCodeSchema.optional(),
|
|
802
732
|
minTTL: MinTTLSchema.optional()
|
|
803
733
|
})
|
|
804
734
|
]).optional();
|
|
805
|
-
var SitesSchema =
|
|
735
|
+
var SitesSchema = z21.record(
|
|
806
736
|
ResourceIdSchema,
|
|
807
|
-
|
|
737
|
+
z21.object({
|
|
808
738
|
domain: ResourceIdSchema.describe("The domain id to link your site with."),
|
|
809
|
-
subDomain:
|
|
739
|
+
subDomain: z21.string().optional(),
|
|
810
740
|
// bind: z
|
|
811
741
|
// .object({
|
|
812
742
|
// auth: z.array(ResourceIdSchema),
|
|
@@ -829,7 +759,7 @@ var SitesSchema = z24.record(
|
|
|
829
759
|
// build: z.string().optional(),
|
|
830
760
|
// }),
|
|
831
761
|
// ]),
|
|
832
|
-
errors:
|
|
762
|
+
errors: z21.object({
|
|
833
763
|
400: ErrorResponseSchema.describe("Customize a `400 Bad Request` response."),
|
|
834
764
|
403: ErrorResponseSchema.describe("Customize a `403 Forbidden` response."),
|
|
835
765
|
404: ErrorResponseSchema.describe("Customize a `404 Not Found` response."),
|
|
@@ -842,16 +772,16 @@ var SitesSchema = z24.record(
|
|
|
842
772
|
503: ErrorResponseSchema.describe("Customize a `503 Service Unavailable` response."),
|
|
843
773
|
504: ErrorResponseSchema.describe("Customize a `504 Gateway Timeout` response.")
|
|
844
774
|
}).optional().describe("Customize the error responses for specific HTTP status codes."),
|
|
845
|
-
cors:
|
|
846
|
-
override:
|
|
775
|
+
cors: z21.object({
|
|
776
|
+
override: z21.boolean().default(false),
|
|
847
777
|
maxAge: DurationSchema.default("365 days"),
|
|
848
|
-
exposeHeaders:
|
|
849
|
-
credentials:
|
|
850
|
-
headers:
|
|
851
|
-
origins:
|
|
852
|
-
methods:
|
|
778
|
+
exposeHeaders: z21.string().array().optional(),
|
|
779
|
+
credentials: z21.boolean().default(false),
|
|
780
|
+
headers: z21.string().array().default(["*"]),
|
|
781
|
+
origins: z21.string().array().default(["*"]),
|
|
782
|
+
methods: z21.enum(["GET", "DELETE", "HEAD", "OPTIONS", "PATCH", "POST", "PUT", "ALL"]).array().default(["ALL"])
|
|
853
783
|
}).optional().describe("Define the cors headers."),
|
|
854
|
-
security:
|
|
784
|
+
security: z21.object({
|
|
855
785
|
// contentSecurityPolicy: z.object({
|
|
856
786
|
// override: z.boolean().default(false),
|
|
857
787
|
// policy: z.string(),
|
|
@@ -893,16 +823,132 @@ var SitesSchema = z24.record(
|
|
|
893
823
|
// reportUri?: string
|
|
894
824
|
// }
|
|
895
825
|
}).optional().describe("Define the security policy."),
|
|
896
|
-
cache:
|
|
897
|
-
cookies:
|
|
898
|
-
headers:
|
|
899
|
-
queries:
|
|
826
|
+
cache: z21.object({
|
|
827
|
+
cookies: z21.string().array().optional().describe("Specifies the cookies that CloudFront includes in the cache key."),
|
|
828
|
+
headers: z21.string().array().optional().describe("Specifies the headers that CloudFront includes in the cache key."),
|
|
829
|
+
queries: z21.string().array().optional().describe("Specifies the query values that CloudFront includes in the cache key.")
|
|
900
830
|
}).optional().describe(
|
|
901
831
|
"Specifies the cookies, headers, and query values that CloudFront includes in the cache key."
|
|
902
832
|
)
|
|
903
833
|
})
|
|
904
834
|
).optional().describe("Define the sites in your stack.");
|
|
905
835
|
|
|
836
|
+
// src/feature/store/schema.ts
|
|
837
|
+
import { z as z22 } from "zod";
|
|
838
|
+
var StoresSchema = z22.union([
|
|
839
|
+
z22.array(ResourceIdSchema).transform((list) => {
|
|
840
|
+
const stores = {};
|
|
841
|
+
for (const key of list) {
|
|
842
|
+
stores[key] = {};
|
|
843
|
+
}
|
|
844
|
+
return stores;
|
|
845
|
+
}),
|
|
846
|
+
z22.record(
|
|
847
|
+
ResourceIdSchema,
|
|
848
|
+
z22.object({
|
|
849
|
+
// cors: CorsSchema,
|
|
850
|
+
versioning: z22.boolean().default(false).describe("Enable versioning of your store."),
|
|
851
|
+
events: z22.object({
|
|
852
|
+
// create
|
|
853
|
+
"created:*": FunctionSchema.optional().describe(
|
|
854
|
+
"Subscribe to notifications regardless of the API that was used to create an object."
|
|
855
|
+
),
|
|
856
|
+
"created:put": FunctionSchema.optional().describe(
|
|
857
|
+
"Subscribe to notifications when an object is created using the PUT API operation."
|
|
858
|
+
),
|
|
859
|
+
"created:post": FunctionSchema.optional().describe(
|
|
860
|
+
"Subscribe to notifications when an object is created using the POST API operation."
|
|
861
|
+
),
|
|
862
|
+
"created:copy": FunctionSchema.optional().describe(
|
|
863
|
+
"Subscribe to notifications when an object is created using the COPY API operation."
|
|
864
|
+
),
|
|
865
|
+
"created:upload": FunctionSchema.optional().describe(
|
|
866
|
+
"Subscribe to notifications when an object multipart upload has been completed."
|
|
867
|
+
),
|
|
868
|
+
// remove
|
|
869
|
+
"removed:*": FunctionSchema.optional().describe(
|
|
870
|
+
"Subscribe to notifications when an object is deleted or a delete marker for a versioned object is created."
|
|
871
|
+
),
|
|
872
|
+
"removed:delete": FunctionSchema.optional().describe(
|
|
873
|
+
"Subscribe to notifications when an object is deleted"
|
|
874
|
+
),
|
|
875
|
+
"removed:marker": FunctionSchema.optional().describe(
|
|
876
|
+
"Subscribe to notifications when a delete marker for a versioned object is created."
|
|
877
|
+
)
|
|
878
|
+
}).optional().describe("Describes the store events you want to subscribe too.")
|
|
879
|
+
})
|
|
880
|
+
)
|
|
881
|
+
]).optional().describe("Define the stores in your stack.");
|
|
882
|
+
|
|
883
|
+
// src/feature/stream/schema.ts
|
|
884
|
+
import { z as z23 } from "zod";
|
|
885
|
+
var LatencyModeSchema = z23.enum(["low", "normal"]).describe(
|
|
886
|
+
`Channel latency mode. Valid values:
|
|
887
|
+
- normal: Use "normal" to broadcast and deliver live video up to Full HD.
|
|
888
|
+
- low: Use "low" for near real-time interactions with viewers.`
|
|
889
|
+
);
|
|
890
|
+
var TypeSchema4 = z23.enum(["standard", "basic", "advanced-sd", "advanced-hd"]).describe(`The channel type, which determines the allowable resolution and bitrate.
|
|
891
|
+
If you exceed the allowable resolution or bitrate, the stream probably will disconnect immediately. Valid values:
|
|
892
|
+
- 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.
|
|
893
|
+
- 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.
|
|
894
|
+
- 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.
|
|
895
|
+
- 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.
|
|
896
|
+
`);
|
|
897
|
+
var StreamsSchema = z23.record(
|
|
898
|
+
ResourceIdSchema,
|
|
899
|
+
z23.object({
|
|
900
|
+
type: TypeSchema4.default("standard"),
|
|
901
|
+
// preset: PresetSchema.optional(),
|
|
902
|
+
latencyMode: LatencyModeSchema.default("low")
|
|
903
|
+
})
|
|
904
|
+
).optional().describe("Define the streams in your stack.");
|
|
905
|
+
|
|
906
|
+
// src/feature/table/schema.ts
|
|
907
|
+
import { z as z24 } from "zod";
|
|
908
|
+
var KeySchema = z24.string().min(1).max(255);
|
|
909
|
+
var TablesSchema = z24.record(
|
|
910
|
+
ResourceIdSchema,
|
|
911
|
+
z24.object({
|
|
912
|
+
hash: KeySchema.describe(
|
|
913
|
+
"Specifies the name of the partition / hash key that makes up the primary key for the table."
|
|
914
|
+
),
|
|
915
|
+
sort: KeySchema.optional().describe(
|
|
916
|
+
"Specifies the name of the range / sort key that makes up the primary key for the table."
|
|
917
|
+
),
|
|
918
|
+
fields: z24.record(z24.string(), z24.enum(["string", "number", "binary"])).optional().describe(
|
|
919
|
+
'A list of attributes that describe the key schema for the table and indexes. If no attribute field is defined we default to "string".'
|
|
920
|
+
),
|
|
921
|
+
class: z24.enum(["standard", "standard-infrequent-access"]).default("standard").describe("The table class of the table."),
|
|
922
|
+
pointInTimeRecovery: z24.boolean().default(false).describe("Indicates whether point in time recovery is enabled on the table."),
|
|
923
|
+
timeToLiveAttribute: KeySchema.optional().describe(
|
|
924
|
+
"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."
|
|
925
|
+
),
|
|
926
|
+
stream: z24.object({
|
|
927
|
+
type: z24.enum(["keys-only", "new-image", "old-image", "new-and-old-images"]).describe(
|
|
928
|
+
"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."
|
|
929
|
+
),
|
|
930
|
+
consumer: FunctionSchema.describe("The consuming lambda function for the stream")
|
|
931
|
+
}).optional().describe(
|
|
932
|
+
"The settings for the DynamoDB table stream, which capture changes to items stored in the table."
|
|
933
|
+
),
|
|
934
|
+
indexes: z24.record(
|
|
935
|
+
z24.string(),
|
|
936
|
+
z24.object({
|
|
937
|
+
/** Specifies the name of the partition / hash key that makes up the primary key for the global secondary index. */
|
|
938
|
+
hash: KeySchema,
|
|
939
|
+
/** Specifies the name of the range / sort key that makes up the primary key for the global secondary index. */
|
|
940
|
+
sort: KeySchema.optional(),
|
|
941
|
+
/** The set of attributes that are projected into the index:
|
|
942
|
+
* - all - All of the table attributes are projected into the index.
|
|
943
|
+
* - keys-only - Only the index and primary keys are projected into the index.
|
|
944
|
+
* @default 'all'
|
|
945
|
+
*/
|
|
946
|
+
projection: z24.enum(["all", "keys-only"]).default("all")
|
|
947
|
+
})
|
|
948
|
+
).optional().describe("Specifies the global secondary indexes to be created on the table.")
|
|
949
|
+
})
|
|
950
|
+
).optional().describe("Define the tables in your stack.");
|
|
951
|
+
|
|
906
952
|
// src/feature/task/schema.ts
|
|
907
953
|
import { z as z25 } from "zod";
|
|
908
954
|
var RetryAttemptsSchema2 = z25.number().int().min(0).max(2).describe(
|
|
@@ -920,13 +966,26 @@ var TaskSchema = z25.union([
|
|
|
920
966
|
]);
|
|
921
967
|
var TasksSchema = z25.record(ResourceIdSchema, TaskSchema).optional().describe("Define the tasks in your stack.");
|
|
922
968
|
|
|
969
|
+
// src/feature/test/schema.ts
|
|
970
|
+
import { z as z26 } from "zod";
|
|
971
|
+
var TestsSchema = z26.union([LocalDirectorySchema.transform((v) => [v]), LocalDirectorySchema.array()]).describe("Define the location of your tests for your stack.").optional();
|
|
972
|
+
|
|
973
|
+
// src/feature/topic/schema.ts
|
|
974
|
+
import { paramCase as paramCase2 } from "change-case";
|
|
975
|
+
import { z as z27 } from "zod";
|
|
976
|
+
var TopicNameSchema = z27.string().min(3).max(256).regex(/^[a-z0-9\-]+$/i, "Invalid topic name").transform((value) => paramCase2(value)).describe("Define event topic name.");
|
|
977
|
+
var TopicsSchema = z27.array(TopicNameSchema).refine((topics) => {
|
|
978
|
+
return topics.length === new Set(topics).size;
|
|
979
|
+
}, "Must be a list of unique topic names").optional().describe("Define the event topics to publish too in your stack.");
|
|
980
|
+
var SubscribersSchema = z27.record(TopicNameSchema, z27.union([EmailSchema, FunctionSchema])).optional().describe("Define the event topics to subscribe too in your stack.");
|
|
981
|
+
|
|
923
982
|
// src/config/stack.ts
|
|
924
983
|
var DependsSchema = ResourceIdSchema.array().optional().describe("Define the stacks that this stack is depended on.");
|
|
925
984
|
var NameSchema = ResourceIdSchema.refine((name) => !["base"].includes(name), {
|
|
926
985
|
message: `Stack name can't be a reserved name.`
|
|
927
986
|
}).describe("Stack name.");
|
|
928
|
-
var StackSchema =
|
|
929
|
-
$schema:
|
|
987
|
+
var StackSchema = z28.object({
|
|
988
|
+
$schema: z28.string().optional(),
|
|
930
989
|
name: NameSchema,
|
|
931
990
|
depends: DependsSchema,
|
|
932
991
|
onFailure: OnFailureSchema,
|
|
@@ -940,9 +999,11 @@ var StackSchema = z26.object({
|
|
|
940
999
|
topics: TopicsSchema,
|
|
941
1000
|
subscribers: SubscribersSchema,
|
|
942
1001
|
functions: FunctionsSchema,
|
|
1002
|
+
instances: InstancesSchema,
|
|
943
1003
|
tasks: TasksSchema,
|
|
944
1004
|
tables: TablesSchema,
|
|
945
1005
|
stores: StoresSchema,
|
|
1006
|
+
streams: StreamsSchema,
|
|
946
1007
|
queues: QueuesSchema,
|
|
947
1008
|
pubsub: PubSubSchema,
|
|
948
1009
|
searchs: SearchsSchema,
|
|
@@ -951,10 +1012,31 @@ var StackSchema = z26.object({
|
|
|
951
1012
|
});
|
|
952
1013
|
|
|
953
1014
|
// src/config/app.ts
|
|
1015
|
+
import { z as z31 } from "zod";
|
|
1016
|
+
|
|
1017
|
+
// src/feature/domain/schema.ts
|
|
954
1018
|
import { z as z29 } from "zod";
|
|
1019
|
+
var DomainNameSchema = z29.string().regex(/[a-z\-\_\.]/g, "Invalid domain name").describe(
|
|
1020
|
+
"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."
|
|
1021
|
+
);
|
|
1022
|
+
var DNSTypeSchema = z29.enum(["A", "AAAA", "CAA", "CNAME", "DS", "MX", "NAPTR", "NS", "PTR", "SOA", "SPF", "SRV", "TXT"]).describe("The DNS record type.");
|
|
1023
|
+
var TTLSchema = DurationSchema.describe("The resource record cache time to live (TTL).");
|
|
1024
|
+
var RecordsSchema = z29.string().array().describe("One or more values that correspond with the value that you specified for the Type property.");
|
|
1025
|
+
var DomainsDefaultSchema = z29.record(
|
|
1026
|
+
ResourceIdSchema,
|
|
1027
|
+
z29.object({
|
|
1028
|
+
domain: DomainNameSchema.describe("Define the domain name"),
|
|
1029
|
+
dns: z29.object({
|
|
1030
|
+
name: DomainNameSchema.optional(),
|
|
1031
|
+
type: DNSTypeSchema,
|
|
1032
|
+
ttl: TTLSchema,
|
|
1033
|
+
records: RecordsSchema
|
|
1034
|
+
}).array().optional().describe("Define the domain dns records")
|
|
1035
|
+
})
|
|
1036
|
+
).optional().describe("Define the domains for your application.");
|
|
955
1037
|
|
|
956
1038
|
// src/config/schema/region.ts
|
|
957
|
-
import { z as
|
|
1039
|
+
import { z as z30 } from "zod";
|
|
958
1040
|
var US = ["us-east-2", "us-east-1", "us-west-1", "us-west-2"];
|
|
959
1041
|
var AF = ["af-south-1"];
|
|
960
1042
|
var AP = [
|
|
@@ -983,44 +1065,24 @@ var EU = [
|
|
|
983
1065
|
var ME = ["me-south-1", "me-central-1"];
|
|
984
1066
|
var SA = ["sa-east-1"];
|
|
985
1067
|
var regions = [...US, ...AF, ...AP, ...CA, ...EU, ...ME, ...SA];
|
|
986
|
-
var RegionSchema =
|
|
987
|
-
|
|
988
|
-
// src/feature/domain/schema.ts
|
|
989
|
-
import { z as z28 } from "zod";
|
|
990
|
-
var DomainNameSchema = z28.string().regex(/[a-z\-\_\.]/g, "Invalid domain name").describe(
|
|
991
|
-
"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."
|
|
992
|
-
);
|
|
993
|
-
var DNSTypeSchema = z28.enum(["A", "AAAA", "CAA", "CNAME", "DS", "MX", "NAPTR", "NS", "PTR", "SOA", "SPF", "SRV", "TXT"]).describe("The DNS record type.");
|
|
994
|
-
var TTLSchema = DurationSchema.describe("The resource record cache time to live (TTL).");
|
|
995
|
-
var RecordsSchema = z28.string().array().describe("One or more values that correspond with the value that you specified for the Type property.");
|
|
996
|
-
var DomainsDefaultSchema = z28.record(
|
|
997
|
-
ResourceIdSchema,
|
|
998
|
-
z28.object({
|
|
999
|
-
domain: DomainNameSchema.describe("Define the domain name"),
|
|
1000
|
-
dns: z28.object({
|
|
1001
|
-
name: DomainNameSchema.optional(),
|
|
1002
|
-
type: DNSTypeSchema,
|
|
1003
|
-
ttl: TTLSchema,
|
|
1004
|
-
records: RecordsSchema
|
|
1005
|
-
}).array().optional().describe("Define the domain dns records")
|
|
1006
|
-
})
|
|
1007
|
-
).optional().describe("Define the domains for your application.");
|
|
1068
|
+
var RegionSchema = z30.enum(regions);
|
|
1008
1069
|
|
|
1009
1070
|
// src/config/app.ts
|
|
1010
|
-
var AppSchema =
|
|
1011
|
-
$schema:
|
|
1071
|
+
var AppSchema = z31.object({
|
|
1072
|
+
$schema: z31.string().optional(),
|
|
1012
1073
|
name: ResourceIdSchema.describe("App name."),
|
|
1013
1074
|
region: RegionSchema.describe("The AWS region to deploy to."),
|
|
1014
|
-
profile:
|
|
1075
|
+
profile: z31.string().describe("The AWS profile to deploy to."),
|
|
1015
1076
|
// stage: z
|
|
1016
1077
|
// .string()
|
|
1017
1078
|
// .regex(/^[a-z]+$/)
|
|
1018
1079
|
// .default('prod')
|
|
1019
1080
|
// .describe('The deployment stage.'),
|
|
1020
|
-
defaults:
|
|
1081
|
+
defaults: z31.object({
|
|
1021
1082
|
auth: AuthDefaultSchema,
|
|
1022
1083
|
domains: DomainsDefaultSchema,
|
|
1023
1084
|
function: FunctionDefaultSchema,
|
|
1085
|
+
instance: InstanceDefaultSchema,
|
|
1024
1086
|
queue: QueueDefaultSchema,
|
|
1025
1087
|
graphql: GraphQLDefaultSchema,
|
|
1026
1088
|
http: HttpDefaultSchema,
|