@awsless/awsless 0.0.146 → 0.0.148

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/index.js CHANGED
@@ -85,6 +85,9 @@ var getAuthProps = (name) => {
85
85
  const id = constantCase(name);
86
86
  return {
87
87
  name: getAuthName(name),
88
+ // userPoolId: env[`AWSLESS_CLIENT_AUTH_${id}_USER_POOL_ID`]!,
89
+ // clientId: env[`AWSLESS_CLIENT_AUTH_${id}_CLIENT_ID`]!,
90
+ // clientSecret: env[`AWSLESS_CLIENT_AUTH_${id}_CLIENT_SECRET`]!,
88
91
  userPoolId: env[`AUTH_${id}_USER_POOL_ID`],
89
92
  clientId: env[`AUTH_${id}_CLIENT_ID`],
90
93
  clientSecret: env[`AUTH_${id}_CLIENT_SECRET`]
package/dist/json.js CHANGED
@@ -218,9 +218,6 @@ var PermissionSchema = z5.object({
218
218
  resources: z5.string().array()
219
219
  });
220
220
  var PermissionsSchema = z5.union([PermissionSchema, PermissionSchema.array()]).describe("Add IAM permissions to your function.");
221
- var LogSchema = z5.union([z5.boolean(), DurationSchema.refine(durationMin(Duration.days(1)), "Minimum log retention is 1 day")]).describe(
222
- "Enable logging to a CloudWatch log group. Providing a duration value will set the log retention time."
223
- );
224
221
  var WarmSchema = z5.number().int().min(0).max(10).describe(
225
222
  "Specify how many functions you want to warm up each 5 minutes. You can specify a number from 0 to 10."
226
223
  );
@@ -228,6 +225,25 @@ var VPCSchema = z5.boolean().describe("Put the function inside your global VPC."
228
225
  var MinifySchema = z5.boolean().describe("Minify the function code.");
229
226
  var HandlerSchema = z5.string().describe("The name of the exported method within your code that Lambda calls to run your function.");
230
227
  var FileSchema = LocalFileSchema.describe("The file path of the function code.");
228
+ var LogRetentionSchema = DurationSchema.refine(durationMin(Duration.days(1)), "Minimum log retention is 1 day");
229
+ var LogSchema = z5.union([
230
+ z5.boolean(),
231
+ LogRetentionSchema,
232
+ z5.object({
233
+ retention: LogRetentionSchema.describe("The log retention duration."),
234
+ format: z5.enum(["text", "json"]).describe(
235
+ `The format in which Lambda sends your function's application and system logs to CloudWatch. Select between plain text and structured JSON.`
236
+ ).optional(),
237
+ system: z5.enum(["debug", "info", "warn"]).describe(
238
+ "Set this property to filter the system logs for your function that Lambda sends to CloudWatch. Lambda only sends system logs at the selected level of detail and lower, where DEBUG is the highest level and WARN is the lowest."
239
+ ).optional(),
240
+ level: z5.enum(["trace", "debug", "info", "warn", "error", "fatal"]).describe(
241
+ "Set this property to filter the application logs for your function that Lambda sends to CloudWatch. Lambda only sends application logs at the selected level of detail and lower, where TRACE is the highest level and FATAL is the lowest."
242
+ ).optional()
243
+ })
244
+ ]).describe(
245
+ "Enable logging to a CloudWatch log group. Providing a duration value will set the log retention time."
246
+ );
231
247
  var FunctionSchema = z5.union([
232
248
  LocalFileSchema,
233
249
  z5.object({
@@ -254,7 +270,12 @@ var FunctionDefaultSchema = z5.object({
254
270
  minify: MinifySchema.default(true),
255
271
  warm: WarmSchema.default(0),
256
272
  vpc: VPCSchema.default(false),
257
- log: LogSchema.default(false),
273
+ log: LogSchema.default({
274
+ retention: "7 days",
275
+ level: "error",
276
+ system: "warn",
277
+ format: "json"
278
+ }),
258
279
  timeout: TimeoutSchema.default("10 seconds"),
259
280
  runtime: RuntimeSchema.default("nodejs20.x"),
260
281
  memorySize: MemorySizeSchema.default("128 MB"),
@@ -317,6 +338,7 @@ var ScheduleExpressionSchema = RateExpressionSchema.or(CronExpressionSchema);
317
338
  var CronsSchema = z7.record(
318
339
  ResourceIdSchema,
319
340
  z7.object({
341
+ enabled: z7.boolean().default(true).describe("If the cron is enabled."),
320
342
  consumer: FunctionSchema.describe("The consuming lambda function properties."),
321
343
  schedule: ScheduleExpressionSchema.describe(
322
344
  'The scheduling expression.\n\nexample: "0 20 * * ? *"\nexample: "5 minutes"'
@@ -363,7 +385,10 @@ var TriggersSchema = z10.object({
363
385
  var AuthSchema = z10.record(
364
386
  ResourceIdSchema,
365
387
  z10.object({
366
- access: z10.boolean().default(false).describe("Give access to every function in this stack to your cognito instance."),
388
+ // access: z
389
+ // .boolean()
390
+ // .default(false)
391
+ // .describe('Give access to every function in this stack to your cognito instance.'),
367
392
  triggers: TriggersSchema.optional()
368
393
  })
369
394
  ).optional().describe("Define the auth triggers in your stack.");
@@ -692,6 +717,10 @@ var SitesSchema = z23.record(
692
717
  subDomain: z23.string().optional(),
693
718
  static: LocalDirectorySchema.optional().describe("Specifies the path to the static files directory."),
694
719
  ssr: FunctionSchema.optional().describe("Specifies the ssr file."),
720
+ // bind: z.object({
721
+ // auth:
722
+ // h
723
+ // }).optional(),
695
724
  // ssr: z.union([
696
725
  // FunctionSchema.optional(),
697
726
  // z.object({
@@ -866,7 +895,11 @@ var AppSchema = z28.object({
866
895
  name: ResourceIdSchema.describe("App name."),
867
896
  region: RegionSchema.describe("The AWS region to deploy to."),
868
897
  profile: z28.string().describe("The AWS profile to deploy to."),
869
- stage: z28.string().regex(/^[a-z]+$/).default("prod").describe("The deployment stage."),
898
+ // stage: z
899
+ // .string()
900
+ // .regex(/^[a-z]+$/)
901
+ // .default('prod')
902
+ // .describe('The deployment stage.'),
870
903
  defaults: z28.object({
871
904
  auth: AuthDefaultSchema,
872
905
  domains: DomainsDefaultSchema,