@fjall/generator 0.96.0 → 0.99.3

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.
Files changed (81) hide show
  1. package/dist/.minified +1 -1
  2. package/dist/src/ast/astClickHouseParser.d.ts +25 -0
  3. package/dist/src/ast/astClickHouseParser.js +1 -0
  4. package/dist/src/ast/astComputeParser.js +1 -1
  5. package/dist/src/ast/astComputeParserHelpers.js +1 -1
  6. package/dist/src/ast/astDatabaseParser.d.ts +5 -2
  7. package/dist/src/ast/astDatabaseParser.js +1 -1
  8. package/dist/src/ast/astInfrastructureParser.d.ts +6 -0
  9. package/dist/src/ast/astInfrastructureParser.js +1 -1
  10. package/dist/src/ast/astPlanConverter.js +2 -2
  11. package/dist/src/ast/astScheduleParser.d.ts +18 -0
  12. package/dist/src/ast/astScheduleParser.js +1 -0
  13. package/dist/src/ast/astTestHelpers.d.ts +40 -6
  14. package/dist/src/codemod/edits/crossPlanConnection.d.ts +2 -6
  15. package/dist/src/codemod/edits/vpcPeer.d.ts +2 -6
  16. package/dist/src/codemod/edits/vpcPeerAccepter.d.ts +2 -5
  17. package/dist/src/codemod/edits/vpcPeerAccepter.js +1 -1
  18. package/dist/src/codemod/index.d.ts +1 -1
  19. package/dist/src/codemod/llmFallback/prompt.js +13 -13
  20. package/dist/src/codemod/llmFallback/tierRunner.js +1 -1
  21. package/dist/src/codemod/types.d.ts +5 -0
  22. package/dist/src/detection/index.d.ts +148 -0
  23. package/dist/src/detection/index.js +1 -0
  24. package/dist/src/generation/common.d.ts +22 -0
  25. package/dist/src/generation/common.js +5 -4
  26. package/dist/src/generation/compute/ec2.d.ts +2 -0
  27. package/dist/src/generation/compute/ec2.js +4 -0
  28. package/dist/src/generation/compute/ecs.d.ts +2 -0
  29. package/dist/src/generation/compute/ecs.js +42 -0
  30. package/dist/src/generation/compute/lambda.d.ts +3 -0
  31. package/dist/src/generation/compute/lambda.js +26 -0
  32. package/dist/src/generation/compute/shared.d.ts +22 -0
  33. package/dist/src/generation/compute/shared.js +4 -0
  34. package/dist/src/generation/compute.d.ts +4 -5
  35. package/dist/src/generation/compute.js +6 -86
  36. package/dist/src/generation/database.d.ts +11 -0
  37. package/dist/src/generation/database.js +23 -12
  38. package/dist/src/generation/index.d.ts +1 -1
  39. package/dist/src/generation/index.js +1 -1
  40. package/dist/src/generation/infrastructure.js +5 -5
  41. package/dist/src/generation/storage.js +30 -30
  42. package/dist/src/index.d.ts +1 -1
  43. package/dist/src/index.js +1 -1
  44. package/dist/src/planning/resourceAddition.d.ts +5 -1
  45. package/dist/src/planning/resourceAddition.js +1 -1
  46. package/dist/src/planning/resourcePlanning.js +1 -1
  47. package/dist/src/presets/clickhouseTierPreset.d.ts +35 -0
  48. package/dist/src/presets/clickhouseTierPreset.js +0 -0
  49. package/dist/src/presets/tierPresets.d.ts +5 -12
  50. package/dist/src/presets/tierPresets.js +1 -1
  51. package/dist/src/presets/tierTypes.d.ts +9 -19
  52. package/dist/src/schemas/applicationSchemas.d.ts +51 -8
  53. package/dist/src/schemas/applicationSchemas.js +1 -1
  54. package/dist/src/schemas/baseSchemas.d.ts +16 -0
  55. package/dist/src/schemas/baseSchemas.js +2 -2
  56. package/dist/src/schemas/computeSchemas.d.ts +108 -14
  57. package/dist/src/schemas/computeSchemas.js +1 -1
  58. package/dist/src/schemas/constants.d.ts +14 -0
  59. package/dist/src/schemas/constants.js +1 -1
  60. package/dist/src/schemas/databaseSchemas.d.ts +80 -0
  61. package/dist/src/schemas/databaseSchemas.js +1 -1
  62. package/dist/src/schemas/networkSchemas.d.ts +7 -6
  63. package/dist/src/schemas/networkSchemas.js +1 -1
  64. package/dist/src/schemas/patternSchemas.js +1 -1
  65. package/dist/src/schemas/sharedTypes.d.ts +1 -1
  66. package/dist/src/schemas/sharedTypes.js +1 -1
  67. package/dist/src/validation/patterns.d.ts +1 -1
  68. package/dist/src/validation/patterns.js +1 -1
  69. package/dist/src/validation/validationMessages.d.ts +5 -4
  70. package/dist/src/validation/validationMessages.js +1 -1
  71. package/dist/src/validation/validationPatterns.d.ts +14 -0
  72. package/dist/src/validation/validationPatterns.js +1 -1
  73. package/dist/src/version.d.ts +1 -1
  74. package/dist/src/version.js +1 -1
  75. package/package.json +19 -13
  76. package/dist/src/codemod/drift/__tests__/fixtures.d.ts +0 -55
  77. package/dist/src/codemod/drift/__tests__/fixtures.js +0 -2
  78. package/dist/src/codemod/llmFallback/__tests__/fixtures.d.ts +0 -5
  79. package/dist/src/codemod/llmFallback/__tests__/fixtures.js +0 -7
  80. package/dist/src/codemod/telemetry/__tests__/errorKinds.fixture.d.ts +0 -1
  81. package/dist/src/codemod/telemetry/__tests__/errorKinds.fixture.js +0 -1
@@ -1 +1 @@
1
- import{z as o}from"zod";import{VALIDATION_MESSAGES as t}from"../validation/patterns.js";import{BackupRetentionSchema as a,MonitoringIntervalSchema as m,DatabasePortSchema as E,ProxyConfigOrFalseSchema as S,ReadReplicaConfigOrFalseSchema as I,AuroraWriterConfigSchema as A,AuroraReadersConfigOrFalseSchema as g,DatabaseInsightsConfigOrFalseSchema as T,CredentialsConfigSchema as M,EncryptionConfigSchema as d}from"./databaseSchemas.js";import{LambdaMemorySchema as i}from"./computeSchemas.js";const e=o.object({memorySize:i.optional(),timeout:o.number().int(t.LAMBDA.TIMEOUT.INTEGER).min(1,t.LAMBDA.TIMEOUT.MIN).max(900,t.LAMBDA.TIMEOUT.MAX).optional(),ephemeralStorageSize:o.number().int(t.EPHEMERAL_STORAGE.INTEGER).min(512,t.EPHEMERAL_STORAGE.MIN).max(10240,t.EPHEMERAL_STORAGE.MAX).optional()}).strict(),r=o.object({type:o.enum(["Instance","Aurora"]).optional(),databaseName:o.string().optional(),databaseEngine:o.enum(["postgresql","mysql"]).optional(),deletionProtection:o.boolean().optional(),backupRetention:a.optional(),port:E.optional(),publiclyAccessible:o.boolean().optional(),allowedIpCidr:o.string().optional(),instanceType:o.string().optional(),allocatedStorage:o.number().int(t.ALLOCATED_STORAGE.INTEGER).min(20,t.ALLOCATED_STORAGE.MIN).max(65536,t.ALLOCATED_STORAGE.MAX).optional(),multiAz:o.boolean().optional(),readReplica:I.optional(),writer:A.optional(),readers:g.optional(),allowVpcAccess:o.boolean().optional(),monitoringInterval:m.optional(),preferredMaintenanceWindow:o.string().optional(),databaseInsights:T.optional(),proxy:S.optional(),credentials:M.optional(),encryption:d.optional(),snapshotIdentifier:o.string().optional(),snapshotUsername:o.string().optional()}).strict(),l=o.object({server:e.optional(),imageOptimisation:e.optional(),revalidation:e.optional()}).strict(),n=o.object({versioned:o.boolean().optional()}).strict(),s=o.object({assets:n.optional(),cache:n.optional(),media:n.optional()}).strict(),b=o.object({visibilityTimeout:o.number().int(t.SQS.VISIBILITY_TIMEOUT.INTEGER).min(0,t.SQS.VISIBILITY_TIMEOUT.MIN).max(43200,t.SQS.VISIBILITY_TIMEOUT.MAX).optional(),messageRetentionPeriod:o.number().int(t.SQS.RETENTION_PERIOD.INTEGER).min(60,t.SQS.RETENTION_PERIOD.MIN).max(1209600,t.SQS.RETENTION_PERIOD.MAX).optional(),maxMessageSize:o.number().int(t.MAX_MESSAGE_SIZE.INTEGER).min(1024,t.MAX_MESSAGE_SIZE.MIN).max(262144,t.MAX_MESSAGE_SIZE.MAX).optional(),deadLetterQueue:o.union([o.literal(!1),o.object({enabled:o.boolean().optional(),maxReceiveCount:o.number().int(t.DLQ.MAX_RECEIVE_COUNT.INTEGER).min(1,t.DLQ.MAX_RECEIVE_COUNT.MIN).max(1e3,t.DLQ.MAX_RECEIVE_COUNT.MAX).optional()}).strict()]).optional()}).strict(),p=o.object({revalidationQueue:b.optional()}).strict(),c=o.object({domainNames:o.array(o.string()).optional(),certificateArn:o.string().optional()}).strict(),u=o.object({type:o.literal("payload"),name:o.string().min(1,t.REQUIRED.PATTERN_NAME),domain:o.string().optional(),database:r.optional(),compute:l.optional(),storage:s.optional(),messaging:p.optional(),cdn:c.optional(),environment:o.record(o.string(),o.string()).optional()}).strict(),R=o.object({type:o.literal("nextjs"),name:o.string().min(1,t.REQUIRED.PATTERN_NAME),domain:o.string().optional(),database:r.optional(),compute:l.optional(),storage:s.optional(),messaging:p.optional(),cdn:c.optional(),environment:o.record(o.string(),o.string()).optional()}).strict(),x=o.discriminatedUnion("type",[u,R]),P=o.enum(["lightweight","standard","resilient","custom"]),f=o.object({type:o.enum(["Instance","Aurora"]),instanceType:o.string().optional(),backupRetention:a.optional(),deletionProtection:o.boolean().optional(),encryption:o.union([o.object({useCMK:o.literal(!0)}).strict(),o.literal(!1)]).optional()}).strict(),_=o.object({memorySize:i.optional(),timeout:o.number().int(t.LAMBDA.TIMEOUT.INTEGER).min(1,t.LAMBDA.TIMEOUT.MIN).max(900,t.LAMBDA.TIMEOUT.MAX).optional()}).strict();export{_ as CustomPatternComputeSchema,f as CustomPatternDatabaseSchema,R as NextJSPatternConfigSchema,x as PatternConfigSchema,e as PatternLambdaConfigSchema,b as PatternQueueConfigSchema,n as PatternStorageBucketConfigSchema,P as PatternTierSchema,c as PayloadCdnConfigSchema,l as PayloadComputeConfigSchema,r as PayloadDatabaseConfigSchema,p as PayloadMessagingConfigSchema,u as PayloadPatternConfigSchema,s as PayloadStorageConfigSchema};
1
+ import{z as o}from"zod";import{VALIDATION_MESSAGES as t,VALIDATION_PATTERNS as S}from"../validation/patterns.js";import{BackupRetentionSchema as a,MonitoringIntervalSchema as A,DatabasePortSchema as T,ProxyConfigOrFalseSchema as I,ReadReplicaConfigOrFalseSchema as g,AuroraWriterConfigSchema as M,AuroraReadersConfigOrFalseSchema as d,DatabaseInsightsConfigOrFalseSchema as b,CredentialsConfigSchema as R,EncryptionConfigSchema as N}from"./databaseSchemas.js";import{LambdaMemorySchema as i}from"./computeSchemas.js";import{PATTERN_DATABASE_TYPES as r,DATABASE_ENGINES as u}from"./constants.js";const e=o.object({memorySize:i.optional(),timeout:o.number().int(t.LAMBDA.TIMEOUT.INTEGER).min(1,t.LAMBDA.TIMEOUT.MIN).max(900,t.LAMBDA.TIMEOUT.MAX).optional(),ephemeralStorageSize:o.number().int(t.EPHEMERAL_STORAGE.INTEGER).min(512,t.EPHEMERAL_STORAGE.MIN).max(10240,t.EPHEMERAL_STORAGE.MAX).optional()}).strict(),l=o.object({type:o.enum(r).optional(),databaseName:o.string().optional(),databaseEngine:o.enum(u).optional(),deletionProtection:o.boolean().optional(),backupRetention:a.optional(),port:T.optional(),publiclyAccessible:o.boolean().optional(),allowedIpCidr:o.string().optional(),instanceType:o.string().optional(),allocatedStorage:o.number().int(t.ALLOCATED_STORAGE.INTEGER).min(20,t.ALLOCATED_STORAGE.MIN).max(65536,t.ALLOCATED_STORAGE.MAX).optional(),multiAz:o.boolean().optional(),readReplica:g.optional(),writer:M.optional(),readers:d.optional(),allowVpcAccess:o.boolean().optional(),monitoringInterval:A.optional(),preferredMaintenanceWindow:o.string().optional(),databaseInsights:b.optional(),proxy:I.optional(),credentials:R.optional(),encryption:N.optional(),snapshotIdentifier:o.string().optional(),snapshotUsername:o.string().optional()}).strict(),p=o.object({server:e.optional(),imageOptimisation:e.optional(),revalidation:e.optional()}).strict(),n=o.object({versioned:o.boolean().optional()}).strict(),m=o.object({assets:n.optional(),cache:n.optional(),media:n.optional()}).strict(),C=o.object({visibilityTimeout:o.number().int(t.SQS.VISIBILITY_TIMEOUT.INTEGER).min(0,t.SQS.VISIBILITY_TIMEOUT.MIN).max(43200,t.SQS.VISIBILITY_TIMEOUT.MAX).optional(),messageRetentionPeriod:o.number().int(t.SQS.RETENTION_PERIOD.INTEGER).min(60,t.SQS.RETENTION_PERIOD.MIN).max(1209600,t.SQS.RETENTION_PERIOD.MAX).optional(),maxMessageSize:o.number().int(t.MAX_MESSAGE_SIZE.INTEGER).min(1024,t.MAX_MESSAGE_SIZE.MIN).max(262144,t.MAX_MESSAGE_SIZE.MAX).optional(),deadLetterQueue:o.union([o.literal(!1),o.object({enabled:o.boolean().optional(),maxReceiveCount:o.number().int(t.DLQ.MAX_RECEIVE_COUNT.INTEGER).min(1,t.DLQ.MAX_RECEIVE_COUNT.MIN).max(1e3,t.DLQ.MAX_RECEIVE_COUNT.MAX).optional()}).strict()]).optional()}).strict(),s=o.object({revalidationQueue:C.optional()}).strict(),c=o.object({domainNames:o.array(o.string()).optional(),certificateArn:o.string().optional()}).strict(),E=o.record(o.string().regex(S.ENV_VAR_NAME,t.ENV_VAR_NAME),o.string()).optional(),_=o.object({type:o.literal("payload"),name:o.string().min(1,t.REQUIRED.PATTERN_NAME),domain:o.string().optional(),database:l.optional(),compute:p.optional(),storage:m.optional(),messaging:s.optional(),cdn:c.optional(),environment:E}).strict(),h=o.object({type:o.literal("nextjs"),name:o.string().min(1,t.REQUIRED.PATTERN_NAME),domain:o.string().optional(),database:l.optional(),compute:p.optional(),storage:m.optional(),messaging:s.optional(),cdn:c.optional(),environment:E}).strict(),y=o.discriminatedUnion("type",[_,h]),D=o.enum(["lightweight","standard","resilient","custom"]),G=o.object({type:o.enum(r),instanceType:o.string().optional(),backupRetention:a.optional(),deletionProtection:o.boolean().optional(),encryption:o.union([o.object({useCMK:o.literal(!0)}).strict(),o.literal(!1)]).optional()}).strict(),U=o.object({memorySize:i.optional(),timeout:o.number().int(t.LAMBDA.TIMEOUT.INTEGER).min(1,t.LAMBDA.TIMEOUT.MIN).max(900,t.LAMBDA.TIMEOUT.MAX).optional()}).strict();export{U as CustomPatternComputeSchema,G as CustomPatternDatabaseSchema,h as NextJSPatternConfigSchema,y as PatternConfigSchema,e as PatternLambdaConfigSchema,C as PatternQueueConfigSchema,n as PatternStorageBucketConfigSchema,D as PatternTierSchema,c as PayloadCdnConfigSchema,p as PayloadComputeConfigSchema,l as PayloadDatabaseConfigSchema,s as PayloadMessagingConfigSchema,_ as PayloadPatternConfigSchema,m as PayloadStorageConfigSchema};
@@ -5,7 +5,7 @@
5
5
  * and presets/tierPresets.ts. Both modules re-export these symbols for backwards
6
6
  * compatibility — consumers can import from either without changes.
7
7
  */
8
- export declare const DATABASE_TYPES: readonly ["Aurora", "Instance", "GlobalAurora"];
8
+ export declare const DATABASE_TYPES: readonly ["Aurora", "Instance", "GlobalAurora", "ClickHouse"];
9
9
  export type DatabaseType = (typeof DATABASE_TYPES)[number];
10
10
  export declare const ECS_CAPACITY_PROVIDERS: readonly ["FARGATE", "FARGATE_SPOT", "EC2"];
11
11
  export type EcsCapacityProvider = (typeof ECS_CAPACITY_PROVIDERS)[number];
@@ -1 +1 @@
1
- const r=["Aurora","Instance","GlobalAurora"],o=["FARGATE","FARGATE_SPOT","EC2"],n=["standard","resilient","enterprise"],t=["tinkerer","lightweight","standard","resilient","enterprise"],e="custom",A=[...t,e];export{A as APP_TYPES,n as BACKUP_VAULT_TIERS,e as CUSTOM_TIER,r as DATABASE_TYPES,o as ECS_CAPACITY_PROVIDERS,t as TIER_NAMES};
1
+ const r=["Aurora","Instance","GlobalAurora","ClickHouse"],o=["FARGATE","FARGATE_SPOT","EC2"],n=["standard","resilient","enterprise"],t=["tinkerer","lightweight","standard","resilient","enterprise"],e="custom",s=[...t,e];export{s as APP_TYPES,n as BACKUP_VAULT_TIERS,e as CUSTOM_TIER,r as DATABASE_TYPES,o as ECS_CAPACITY_PROVIDERS,t as TIER_NAMES};
@@ -1,2 +1,2 @@
1
- export { VALIDATION_PATTERNS, type ValidationPatternKey, } from "./validationPatterns.js";
1
+ export { VALIDATION_PATTERNS, parseRateExpression, type ValidationPatternKey, } from "./validationPatterns.js";
2
2
  export { VALIDATION_MESSAGES, type ValidationMessageKey, } from "./validationMessages.js";
@@ -1 +1 @@
1
- import{VALIDATION_PATTERNS as r}from"./validationPatterns.js";import{VALIDATION_MESSAGES as S}from"./validationMessages.js";export{S as VALIDATION_MESSAGES,r as VALIDATION_PATTERNS};
1
+ import{VALIDATION_PATTERNS as e,parseRateExpression as o}from"./validationPatterns.js";import{VALIDATION_MESSAGES as E}from"./validationMessages.js";export{E as VALIDATION_MESSAGES,e as VALIDATION_PATTERNS,o as parseRateExpression};
@@ -67,7 +67,9 @@ export declare const VALIDATION_MESSAGES: Readonly<{
67
67
  readonly MIN: "Timeout must be at least 1 second";
68
68
  readonly MAX: "Timeout cannot exceed 900 seconds";
69
69
  };
70
+ readonly RUNTIME: "Lambda runtime must contain only letters, digits, dots, underscores, or dashes (e.g. 'NODEJS_20_X' or 'nodejs20.x')";
70
71
  };
72
+ readonly ENV_VAR_NAME: "Environment variable names must start with a letter or underscore and contain only letters, digits, and underscores";
71
73
  readonly PRIORITY: {
72
74
  readonly INTEGER: "Priority must be an integer";
73
75
  readonly MIN: "Priority must be at least 1";
@@ -115,7 +117,7 @@ export declare const VALIDATION_MESSAGES: Readonly<{
115
117
  };
116
118
  readonly NAME: {
117
119
  readonly REQUIRED: "Database name is required";
118
- readonly MAX_LENGTH: "Database name cannot exceed 64 characters";
120
+ readonly MAX_LENGTH: "Database name must be 63 characters or less";
119
121
  };
120
122
  };
121
123
  readonly BACKUP_RETENTION: {
@@ -259,9 +261,6 @@ export declare const VALIDATION_MESSAGES: Readonly<{
259
261
  readonly KMS: {
260
262
  readonly KEY_REQUIRED: "KMS key ARN is required when using KMS encryption";
261
263
  };
262
- readonly WEBSITE_BUCKET: {
263
- readonly DOCUMENTS_REQUIRED: "Website index and error documents are required for website buckets";
264
- };
265
264
  readonly READER_INSTANCES: {
266
265
  readonly MAX: "Cannot have more than 15 reader instances";
267
266
  readonly COUNT_OR_INSTANCES: "Cannot specify both 'count' and 'instances' - use one or the other";
@@ -301,6 +300,7 @@ export declare const VALIDATION_MESSAGES: Readonly<{
301
300
  };
302
301
  readonly REGION: "Invalid AWS region";
303
302
  readonly PASCAL_CASE: "Resource name must start with an uppercase letter and contain only alphanumerics (PascalCase).";
303
+ readonly IMAGE_DOCKER_MUTEX: "image and docker are mutually exclusive";
304
304
  readonly AWS_ACCOUNT_ID: "AWS account id must be exactly 12 digits (no hyphens)";
305
305
  readonly VPC_ID: "VPC id must look like vpc-abc12345";
306
306
  readonly ROLE_ARN: "Role ARN must have the form arn:aws:iam::<account-id>:role/<name>";
@@ -310,5 +310,6 @@ export declare const VALIDATION_MESSAGES: Readonly<{
310
310
  readonly REGION_REQUIRED: "Peer region is required when specified";
311
311
  readonly ROUTE_TABLE_ID_REQUIRED: "Route table id must not be empty";
312
312
  };
313
+ readonly SCHEDULE_EXPRESSION: "Schedule expression must be 'rate(N minute|minutes|hour|hours|day|days)' with N>=1, or 'cron(<6-field AWS expression>)'";
313
314
  }>;
314
315
  export type ValidationMessageKey = keyof typeof VALIDATION_MESSAGES;
@@ -1 +1 @@
1
- const e=Object.freeze({IDENTIFIER:"Must start with a letter, contain only letters, numbers, and hyphens",IDENTIFIER_MIN_LENGTH:"Must be at least 2 characters",IDENTIFIER_NO_TRAILING_HYPHEN:"Must not end with a hyphen",IDENTIFIER_NO_CONSECUTIVE_HYPHENS:"Must not contain consecutive hyphens",RESOURCE_NAME:"Must start with a letter and contain only letters and numbers (PascalCase recommended)",ECS_SERVICE_NAME:"Service name must start with a letter and contain only letters, numbers, and hyphens",BUCKET_NAME:"Bucket name must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens",DATABASE_NAME:"Database name must start with a letter and contain only letters, numbers, and underscores",RESOURCE_TYPE:"Resource type must be in format 'category' or 'category:type'",SSM_PATH:"SSM path must start with / and contain valid namespace segments (e.g., /myapp/ApiCluster/service)",SECRET_NAME:"Secret name must start with a letter or underscore and contain only letters, numbers, underscores, hyphens, or periods",SSM_COMPONENT:"Must start with a letter and contain only letters, numbers, periods, hyphens, or underscores",EMAIL:"Please enter a valid email address",DOMAIN:"Please enter a valid domain (e.g., cms.example.com)",DOCKER_IMAGE:"Invalid Docker image name format",REQUIRED:{APP_NAME:"Application name is required",RESOURCE_NAME:"Resource name is required",BUCKET_NAME:"Bucket name is required",SERVICE_NAME:"Service name is required",NETWORK_NAME:"Network name is required",DATABASE_NAME:"Database name is required",ORGANISATION_NAME:"Organisation name is required",EMAIL:"Email is required",NAME:"Name is required",USERNAME:"Username is required",CONTAINER_NAME:"Container name is required",FIRST_NAME:"First name is required",LAST_NAME:"Last name is required",GROUP:"Group is required",PATTERN_NAME:"Pattern name is required",ROUTING_PATH:"Routing path is required",RESOURCE_REFERENCE:"Resource reference is required",RESOURCE_TYPE:"Resource type is required",VARIANT:"Variant is required",SUBTYPE:"Subtype is required",DEPLOY_TARGET:"Deploy target is required",DESTROY_TARGET:"Destroy target is required"},MAX_LENGTH:{APP_NAME:"Application name must be 50 characters or less",RESOURCE_NAME:"Resource name must be 63 characters or less",BUCKET_NAME:"Bucket name must be 63 characters or less",SERVICE_NAME:"Service name must be 255 characters or less",NETWORK_NAME:"Network name must be 50 characters or less",DATABASE_NAME:"Database name must be 63 characters or less",ORGANISATION_NAME:"Organisation name must be 50 characters or less"},PORT:{INTEGER:"Port must be an integer",MIN:"Port must be at least 1",MAX:"Port cannot exceed 65535"},USERNAME:{MAX_LENGTH:"Username cannot exceed 63 characters"},LAMBDA:{MEMORY:{INTEGER:"Lambda memory must be an integer",MIN:"Memory must be at least 128 MB",MAX:"Memory cannot exceed 10240 MB",MULTIPLE:"Memory must be 128 MB or a multiple of 64 MB"},TIMEOUT:{INTEGER:"Timeout must be an integer",MIN:"Timeout must be at least 1 second",MAX:"Timeout cannot exceed 900 seconds"}},PRIORITY:{INTEGER:"Priority must be an integer",MIN:"Priority must be at least 1",MAX:"Priority cannot exceed 50000"},CAPACITY:{MIN:{INTEGER:"Minimum capacity must be an integer",MIN_0:"Minimum capacity must be at least 0",MIN_1:"Minimum capacity must be at least 1",MAX:"Minimum capacity cannot exceed 100"},MAX:{INTEGER:"Maximum capacity must be an integer",MIN_0:"Maximum capacity must be at least 0",MIN_1:"Maximum capacity must be at least 1",MAX:"Maximum capacity cannot exceed 100"},DESIRED:{INTEGER:"Desired count must be an integer",MIN:"Desired count must be at least 0",MAX:"Desired count cannot exceed 100"},WARM_POOL_REQUIRED:"minCapacity 0 requires a warmPool \u2014 without it, new tasks wait 60-90s for a cold instance launch",WARM_POOL:{MIN_SIZE:{INTEGER:"Warm pool minSize must be an integer",MIN:"Warm pool minSize must be at least 0",MAX:"Warm pool minSize cannot exceed 100"},MIN_SIZE_EXCEEDS_MAX_CAPACITY:"warmPool.minSize cannot exceed maxCapacity \u2014 the warm pool cannot hold more instances than the ASG allows"}},MEMORY_LIMIT:{INTEGER:"Memory limit must be an integer",MIN_512:"Memory limit must be at least 512 MiB",MIN_128:"Memory limit must be at least 128 MiB",MAX:"Memory limit cannot exceed 30720 MiB"},DATABASE:{PORT:{INTEGER:"Database port must be an integer",MIN:"Database port must be at least 1024",MAX:"Database port cannot exceed 65535"},NAME:{REQUIRED:"Database name is required",MAX_LENGTH:"Database name cannot exceed 64 characters"}},BACKUP_RETENTION:{INTEGER:"Backup retention must be an integer",MIN:"Backup retention must be at least 1 day",MAX:"Backup retention cannot exceed 35 days"},SQS:{VISIBILITY_TIMEOUT:{INTEGER:"Visibility timeout must be an integer",MIN:"Visibility timeout must be at least 0 seconds",MAX:"Visibility timeout cannot exceed 43200 seconds (12 hours)"},RETENTION_PERIOD:{INTEGER:"Retention period must be an integer",MIN:"Retention period must be at least 60 seconds",MAX:"Retention period cannot exceed 1209600 seconds (14 days)"}},READER:{COUNT:{INTEGER:"Reader count must be an integer",MIN:"Reader count must be at least 0",MAX:"Reader count cannot exceed 15"}},IDENTIFIER_SUFFIX:{REQUIRED:"Identifier suffix is required when specified",MAX_LENGTH:"Identifier suffix cannot exceed 50 characters"},ROTATION:{INTEGER:"Rotation days must be an integer",MIN:"Rotation interval must be at least 1 day",MAX:"Rotation interval cannot exceed 365 days"},MAX_CONNECTIONS:{INTEGER:"Max connections must be an integer",MIN:"Max connections must be at least 1",MAX:"Max connections cannot exceed 100"},MONITORING_INTERVAL:{INTEGER:"Monitoring interval must be an integer",MIN:"Monitoring interval must be at least 0",MAX:"Monitoring interval cannot exceed 60 seconds",VALUES:"Monitoring interval must be 0, 1, 5, 10, 15, 30, or 60 seconds"},RETENTION_DAYS:{INTEGER:"Retention days must be an integer",MIN:"Retention days must be at least 1",MAX:"Retention days cannot exceed 365"},BATCH_SIZE:{INTEGER:"Batch size must be an integer",MIN:"Batch size must be at least 1",MAX:"Batch size cannot exceed 10000"},SERVICE:{UNIQUE_WITHIN_CLUSTER:"Service names must be unique within a cluster",MIN_REQUIRED:"At least one service is required",ROUTING_REQUIRED:"Multiple services with ports require routing config (path or host)"},PROXY_CONFIG:{MAX_IDLE_CONNECTIONS:{INTEGER:"Max idle connections must be an integer",MIN:"Max idle connections must be at least 0",MAX:"Max idle connections cannot exceed 100"},BORROW_TIMEOUT:{INTEGER:"Connection borrow timeout must be an integer",MIN:"Connection borrow timeout must be at least 1 second",MAX:"Connection borrow timeout cannot exceed 3600 seconds"}},MAX_AZS:{INTEGER:"Max AZs must be an integer",MIN:"Max AZs must be at least 1",MAX:"Max AZs cannot exceed 3"},BATCHING_WINDOW:{INTEGER:"Max batching window must be an integer",MIN:"Max batching window must be at least 0",MAX:"Max batching window cannot exceed 300 seconds"},HEALTH_CHECK:{INTERVAL:{INTEGER:"Health check interval must be an integer",MIN:"Health check interval must be at least 5 seconds",MAX:"Health check interval cannot exceed 300 seconds"},TIMEOUT:{INTEGER:"Health check timeout must be an integer",MIN:"Health check timeout must be at least 2 seconds",MAX:"Health check timeout cannot exceed 60 seconds"},RETRIES:{INTEGER:"Health check retries must be an integer",MIN:"Health check retries must be at least 1",MAX:"Health check retries cannot exceed 10"},START_PERIOD:{INTEGER:"Health check start period must be an integer",MIN:"Health check start period must be at least 0 seconds",MAX:"Health check start period cannot exceed 300 seconds"}},EPHEMERAL_STORAGE:{INTEGER:"Ephemeral storage size must be an integer",MIN:"Ephemeral storage size must be at least 512 MB",MAX:"Ephemeral storage size cannot exceed 10240 MB"},MAX_MESSAGE_SIZE:{INTEGER:"Max message size must be an integer",MIN:"Max message size must be at least 1024 bytes",MAX:"Max message size cannot exceed 262144 bytes (256 KB)"},CAPACITY_CONSTRAINT:{MIN_LTE_MAX:"minCapacity must be less than or equal to maxCapacity"},DIRECT_ACCESS:{NO_DOMAIN:"directAccess cannot be used with domain (no ALB for HTTPS)",NO_LOAD_BALANCER:"directAccess cannot be used with loadBalancer (mutually exclusive)"},GLOBAL_AURORA:{PRIMARY_REGION_REQUIRED:"primaryRegion is required for GlobalAurora databases"},NAT_GATEWAY:{INTEGER:"NAT gateway count must be an integer",MIN:"NAT gateway count must be at least 0",MAX:"NAT gateway count cannot exceed 3"},CIDR_MASK:{INTEGER:"CIDR mask must be an integer",MIN:"CIDR mask must be at least 16",MAX:"CIDR mask cannot exceed 28"},CPU:{INTEGER:"CPU must be an integer",MIN:"CPU must be at least 256 units",MAX:"CPU cannot exceed 4096 units"},KMS:{KEY_REQUIRED:"KMS key ARN is required when using KMS encryption"},WEBSITE_BUCKET:{DOCUMENTS_REQUIRED:"Website index and error documents are required for website buckets"},READER_INSTANCES:{MAX:"Cannot have more than 15 reader instances",COUNT_OR_INSTANCES:"Cannot specify both 'count' and 'instances' - use one or the other"},GENERATOR_CAPACITY:{MIN:{MIN:"Minimum capacity must be at least 1",MAX:"Minimum capacity cannot exceed 1000"},MAX:{MIN:"Maximum capacity must be at least 1",MAX:"Maximum capacity cannot exceed 1000"}},INSTANCE_TYPE:"Unknown instance type. Common types include: t4g.micro, t4g.small, m5.large",ARCHITECTURE_MISMATCH:"Architecture mismatch between instance type and AMI",ALLOCATED_STORAGE:{INTEGER:"Allocated storage must be an integer",MIN:"Allocated storage must be at least 20 GB",MAX:"Allocated storage cannot exceed 65536 GB"},DLQ:{MAX_RECEIVE_COUNT:{INTEGER:"Max receive count must be an integer",MIN:"Max receive count must be at least 1",MAX:"Max receive count cannot exceed 1000"}},ALARM:{PERCENTAGE:{MIN:"Threshold must be at least 1%",MAX:"Threshold must be at most 100%"},FREE_STORAGE_GIB:{MIN:"Free storage threshold must be at least 1 GiB"}},REGION:"Invalid AWS region",PASCAL_CASE:"Resource name must start with an uppercase letter and contain only alphanumerics (PascalCase).",AWS_ACCOUNT_ID:"AWS account id must be exactly 12 digits (no hyphens)",VPC_ID:"VPC id must look like vpc-abc12345",ROLE_ARN:"Role ARN must have the form arn:aws:iam::<account-id>:role/<name>",CIDR:"CIDR must be in dotted-quad/prefix-length form (e.g. 10.0.0.0/16)",VPC_PEER:{MIN_REQUESTER_ACCOUNTS:"At least one requester account id is required",REGION_REQUIRED:"Peer region is required when specified",ROUTE_TABLE_ID_REQUIRED:"Route table id must not be empty"}});export{e as VALIDATION_MESSAGES};
1
+ const e=Object.freeze({IDENTIFIER:"Must start with a letter, contain only letters, numbers, and hyphens",IDENTIFIER_MIN_LENGTH:"Must be at least 2 characters",IDENTIFIER_NO_TRAILING_HYPHEN:"Must not end with a hyphen",IDENTIFIER_NO_CONSECUTIVE_HYPHENS:"Must not contain consecutive hyphens",RESOURCE_NAME:"Must start with a letter and contain only letters and numbers (PascalCase recommended)",ECS_SERVICE_NAME:"Service name must start with a letter and contain only letters, numbers, and hyphens",BUCKET_NAME:"Bucket name must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens",DATABASE_NAME:"Database name must start with a letter and contain only letters, numbers, and underscores",RESOURCE_TYPE:"Resource type must be in format 'category' or 'category:type'",SSM_PATH:"SSM path must start with / and contain valid namespace segments (e.g., /myapp/ApiCluster/service)",SECRET_NAME:"Secret name must start with a letter or underscore and contain only letters, numbers, underscores, hyphens, or periods",SSM_COMPONENT:"Must start with a letter and contain only letters, numbers, periods, hyphens, or underscores",EMAIL:"Please enter a valid email address",DOMAIN:"Please enter a valid domain (e.g., cms.example.com)",DOCKER_IMAGE:"Invalid Docker image name format",REQUIRED:{APP_NAME:"Application name is required",RESOURCE_NAME:"Resource name is required",BUCKET_NAME:"Bucket name is required",SERVICE_NAME:"Service name is required",NETWORK_NAME:"Network name is required",DATABASE_NAME:"Database name is required",ORGANISATION_NAME:"Organisation name is required",EMAIL:"Email is required",NAME:"Name is required",USERNAME:"Username is required",CONTAINER_NAME:"Container name is required",FIRST_NAME:"First name is required",LAST_NAME:"Last name is required",GROUP:"Group is required",PATTERN_NAME:"Pattern name is required",ROUTING_PATH:"Routing path is required",RESOURCE_REFERENCE:"Resource reference is required",RESOURCE_TYPE:"Resource type is required",VARIANT:"Variant is required",SUBTYPE:"Subtype is required",DEPLOY_TARGET:"Deploy target is required",DESTROY_TARGET:"Destroy target is required"},MAX_LENGTH:{APP_NAME:"Application name must be 50 characters or less",RESOURCE_NAME:"Resource name must be 63 characters or less",BUCKET_NAME:"Bucket name must be 63 characters or less",SERVICE_NAME:"Service name must be 255 characters or less",NETWORK_NAME:"Network name must be 50 characters or less",DATABASE_NAME:"Database name must be 63 characters or less",ORGANISATION_NAME:"Organisation name must be 50 characters or less"},PORT:{INTEGER:"Port must be an integer",MIN:"Port must be at least 1",MAX:"Port cannot exceed 65535"},USERNAME:{MAX_LENGTH:"Username cannot exceed 63 characters"},LAMBDA:{MEMORY:{INTEGER:"Lambda memory must be an integer",MIN:"Memory must be at least 128 MB",MAX:"Memory cannot exceed 10240 MB",MULTIPLE:"Memory must be 128 MB or a multiple of 64 MB"},TIMEOUT:{INTEGER:"Timeout must be an integer",MIN:"Timeout must be at least 1 second",MAX:"Timeout cannot exceed 900 seconds"},RUNTIME:"Lambda runtime must contain only letters, digits, dots, underscores, or dashes (e.g. 'NODEJS_20_X' or 'nodejs20.x')"},ENV_VAR_NAME:"Environment variable names must start with a letter or underscore and contain only letters, digits, and underscores",PRIORITY:{INTEGER:"Priority must be an integer",MIN:"Priority must be at least 1",MAX:"Priority cannot exceed 50000"},CAPACITY:{MIN:{INTEGER:"Minimum capacity must be an integer",MIN_0:"Minimum capacity must be at least 0",MIN_1:"Minimum capacity must be at least 1",MAX:"Minimum capacity cannot exceed 100"},MAX:{INTEGER:"Maximum capacity must be an integer",MIN_0:"Maximum capacity must be at least 0",MIN_1:"Maximum capacity must be at least 1",MAX:"Maximum capacity cannot exceed 100"},DESIRED:{INTEGER:"Desired count must be an integer",MIN:"Desired count must be at least 0",MAX:"Desired count cannot exceed 100"},WARM_POOL_REQUIRED:"minCapacity 0 requires a warmPool \u2014 without it, new tasks wait 60-90s for a cold instance launch",WARM_POOL:{MIN_SIZE:{INTEGER:"Warm pool minSize must be an integer",MIN:"Warm pool minSize must be at least 0",MAX:"Warm pool minSize cannot exceed 100"},MIN_SIZE_EXCEEDS_MAX_CAPACITY:"warmPool.minSize cannot exceed maxCapacity \u2014 the warm pool cannot hold more instances than the ASG allows"}},MEMORY_LIMIT:{INTEGER:"Memory limit must be an integer",MIN_512:"Memory limit must be at least 512 MiB",MIN_128:"Memory limit must be at least 128 MiB",MAX:"Memory limit cannot exceed 30720 MiB"},DATABASE:{PORT:{INTEGER:"Database port must be an integer",MIN:"Database port must be at least 1024",MAX:"Database port cannot exceed 65535"},NAME:{REQUIRED:"Database name is required",MAX_LENGTH:"Database name must be 63 characters or less"}},BACKUP_RETENTION:{INTEGER:"Backup retention must be an integer",MIN:"Backup retention must be at least 1 day",MAX:"Backup retention cannot exceed 35 days"},SQS:{VISIBILITY_TIMEOUT:{INTEGER:"Visibility timeout must be an integer",MIN:"Visibility timeout must be at least 0 seconds",MAX:"Visibility timeout cannot exceed 43200 seconds (12 hours)"},RETENTION_PERIOD:{INTEGER:"Retention period must be an integer",MIN:"Retention period must be at least 60 seconds",MAX:"Retention period cannot exceed 1209600 seconds (14 days)"}},READER:{COUNT:{INTEGER:"Reader count must be an integer",MIN:"Reader count must be at least 0",MAX:"Reader count cannot exceed 15"}},IDENTIFIER_SUFFIX:{REQUIRED:"Identifier suffix is required when specified",MAX_LENGTH:"Identifier suffix cannot exceed 50 characters"},ROTATION:{INTEGER:"Rotation days must be an integer",MIN:"Rotation interval must be at least 1 day",MAX:"Rotation interval cannot exceed 365 days"},MAX_CONNECTIONS:{INTEGER:"Max connections must be an integer",MIN:"Max connections must be at least 1",MAX:"Max connections cannot exceed 100"},MONITORING_INTERVAL:{INTEGER:"Monitoring interval must be an integer",MIN:"Monitoring interval must be at least 0",MAX:"Monitoring interval cannot exceed 60 seconds",VALUES:"Monitoring interval must be 0, 1, 5, 10, 15, 30, or 60 seconds"},RETENTION_DAYS:{INTEGER:"Retention days must be an integer",MIN:"Retention days must be at least 1",MAX:"Retention days cannot exceed 365"},BATCH_SIZE:{INTEGER:"Batch size must be an integer",MIN:"Batch size must be at least 1",MAX:"Batch size cannot exceed 10000"},SERVICE:{UNIQUE_WITHIN_CLUSTER:"Service names must be unique within a cluster",MIN_REQUIRED:"At least one service is required",ROUTING_REQUIRED:"Multiple services with ports require routing config (path or host)"},PROXY_CONFIG:{MAX_IDLE_CONNECTIONS:{INTEGER:"Max idle connections must be an integer",MIN:"Max idle connections must be at least 0",MAX:"Max idle connections cannot exceed 100"},BORROW_TIMEOUT:{INTEGER:"Connection borrow timeout must be an integer",MIN:"Connection borrow timeout must be at least 1 second",MAX:"Connection borrow timeout cannot exceed 3600 seconds"}},MAX_AZS:{INTEGER:"Max AZs must be an integer",MIN:"Max AZs must be at least 1",MAX:"Max AZs cannot exceed 3"},BATCHING_WINDOW:{INTEGER:"Max batching window must be an integer",MIN:"Max batching window must be at least 0",MAX:"Max batching window cannot exceed 300 seconds"},HEALTH_CHECK:{INTERVAL:{INTEGER:"Health check interval must be an integer",MIN:"Health check interval must be at least 5 seconds",MAX:"Health check interval cannot exceed 300 seconds"},TIMEOUT:{INTEGER:"Health check timeout must be an integer",MIN:"Health check timeout must be at least 2 seconds",MAX:"Health check timeout cannot exceed 60 seconds"},RETRIES:{INTEGER:"Health check retries must be an integer",MIN:"Health check retries must be at least 1",MAX:"Health check retries cannot exceed 10"},START_PERIOD:{INTEGER:"Health check start period must be an integer",MIN:"Health check start period must be at least 0 seconds",MAX:"Health check start period cannot exceed 300 seconds"}},EPHEMERAL_STORAGE:{INTEGER:"Ephemeral storage size must be an integer",MIN:"Ephemeral storage size must be at least 512 MB",MAX:"Ephemeral storage size cannot exceed 10240 MB"},MAX_MESSAGE_SIZE:{INTEGER:"Max message size must be an integer",MIN:"Max message size must be at least 1024 bytes",MAX:"Max message size cannot exceed 262144 bytes (256 KB)"},CAPACITY_CONSTRAINT:{MIN_LTE_MAX:"minCapacity must be less than or equal to maxCapacity"},DIRECT_ACCESS:{NO_DOMAIN:"directAccess cannot be used with domain (no ALB for HTTPS)",NO_LOAD_BALANCER:"directAccess cannot be used with loadBalancer (mutually exclusive)"},GLOBAL_AURORA:{PRIMARY_REGION_REQUIRED:"primaryRegion is required for GlobalAurora databases"},NAT_GATEWAY:{INTEGER:"NAT gateway count must be an integer",MIN:"NAT gateway count must be at least 0",MAX:"NAT gateway count cannot exceed 3"},CIDR_MASK:{INTEGER:"CIDR mask must be an integer",MIN:"CIDR mask must be at least 16",MAX:"CIDR mask cannot exceed 28"},CPU:{INTEGER:"CPU must be an integer",MIN:"CPU must be at least 256 units",MAX:"CPU cannot exceed 4096 units"},KMS:{KEY_REQUIRED:"KMS key ARN is required when using KMS encryption"},READER_INSTANCES:{MAX:"Cannot have more than 15 reader instances",COUNT_OR_INSTANCES:"Cannot specify both 'count' and 'instances' - use one or the other"},GENERATOR_CAPACITY:{MIN:{MIN:"Minimum capacity must be at least 1",MAX:"Minimum capacity cannot exceed 1000"},MAX:{MIN:"Maximum capacity must be at least 1",MAX:"Maximum capacity cannot exceed 1000"}},INSTANCE_TYPE:"Unknown instance type. Common types include: t4g.micro, t4g.small, m5.large",ARCHITECTURE_MISMATCH:"Architecture mismatch between instance type and AMI",ALLOCATED_STORAGE:{INTEGER:"Allocated storage must be an integer",MIN:"Allocated storage must be at least 20 GB",MAX:"Allocated storage cannot exceed 65536 GB"},DLQ:{MAX_RECEIVE_COUNT:{INTEGER:"Max receive count must be an integer",MIN:"Max receive count must be at least 1",MAX:"Max receive count cannot exceed 1000"}},ALARM:{PERCENTAGE:{MIN:"Threshold must be at least 1%",MAX:"Threshold must be at most 100%"},FREE_STORAGE_GIB:{MIN:"Free storage threshold must be at least 1 GiB"}},REGION:"Invalid AWS region",PASCAL_CASE:"Resource name must start with an uppercase letter and contain only alphanumerics (PascalCase).",IMAGE_DOCKER_MUTEX:"image and docker are mutually exclusive",AWS_ACCOUNT_ID:"AWS account id must be exactly 12 digits (no hyphens)",VPC_ID:"VPC id must look like vpc-abc12345",ROLE_ARN:"Role ARN must have the form arn:aws:iam::<account-id>:role/<name>",CIDR:"CIDR must be in dotted-quad/prefix-length form (e.g. 10.0.0.0/16)",VPC_PEER:{MIN_REQUESTER_ACCOUNTS:"At least one requester account id is required",REGION_REQUIRED:"Peer region is required when specified",ROUTE_TABLE_ID_REQUIRED:"Route table id must not be empty"},SCHEDULE_EXPRESSION:"Schedule expression must be 'rate(N minute|minutes|hour|hours|day|days)' with N>=1, or 'cron(<6-field AWS expression>)'"});export{e as VALIDATION_MESSAGES};
@@ -16,5 +16,19 @@ export declare const VALIDATION_PATTERNS: Readonly<{
16
16
  readonly VPC_ID: RegExp;
17
17
  readonly ROLE_ARN: RegExp;
18
18
  readonly CIDR: RegExp;
19
+ readonly SCHEDULE_EXPRESSION: RegExp;
20
+ readonly LAMBDA_RUNTIME_IDENTIFIER: RegExp;
21
+ readonly ENV_VAR_NAME: RegExp;
19
22
  }>;
20
23
  export type ValidationPatternKey = keyof typeof VALIDATION_PATTERNS;
24
+ /**
25
+ * Parse a `rate(N <unit>)` schedule expression and return the cadence in milliseconds.
26
+ *
27
+ * Returns `undefined` for `cron(...)` expressions or any input that does not match the
28
+ * `rate(...)` form — rate cadence is not derivable from cron grammar. Consumed by
29
+ * EventBridge schedule alarm helpers to compute `expectedTicksPerHour` for the
30
+ * D13 missed-tick `MatchedEvents` alarm (rate schedules only).
31
+ */
32
+ export declare function parseRateExpression(expression: string): {
33
+ everyMs: number;
34
+ } | undefined;
@@ -1 +1 @@
1
- const A=/^[a-zA-Z][a-zA-Z0-9-]*$/,a=Object.freeze({IDENTIFIER:A,RESOURCE_NAME:/^[a-zA-Z][a-zA-Z0-9]*$/,ECS_SERVICE_NAME:A,BUCKET_NAME:/^[a-z][a-z0-9-]*[a-z0-9]$|^[a-z][a-z0-9]*$/,DATABASE_NAME:/^[a-zA-Z][a-zA-Z0-9_]*$/,RESOURCE_TYPE:/^[a-z]+(:[a-z]+)?$/,SSM_PATH:/^\/[a-zA-Z][a-zA-Z0-9-]*(\/[a-zA-Z][a-zA-Z0-9-]*)*$/,SECRET_NAME:/^[a-zA-Z_][a-zA-Z0-9._-]*$/,SSM_COMPONENT:/^[a-zA-Z][a-zA-Z0-9._-]*$/,EMAIL:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,DOCKER_IMAGE:/^[a-z0-9][a-z0-9._-]*[a-z0-9](:[a-z0-9._-]+)?$/,DOMAIN:/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$/i,PASCAL_CASE:/^[A-Z][A-Za-z0-9]*$/,AWS_ACCOUNT_ID:/^\d{12}$/,VPC_ID:/^vpc-[a-z0-9]+$/,ROLE_ARN:/^arn:aws[a-zA-Z-]*:iam::\d{12}:role\/.+$/,CIDR:/^((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\/(3[0-2]|[12]?\d)$/});export{a as VALIDATION_PATTERNS};
1
+ const E=/^[a-zA-Z][a-zA-Z0-9-]*$/,s=Object.freeze({IDENTIFIER:E,RESOURCE_NAME:/^[a-zA-Z][a-zA-Z0-9]*$/,ECS_SERVICE_NAME:E,BUCKET_NAME:/^[a-z][a-z0-9-]*[a-z0-9]$|^[a-z][a-z0-9]*$/,DATABASE_NAME:/^[a-zA-Z][a-zA-Z0-9_]*$/,RESOURCE_TYPE:/^[a-z]+(:[a-z]+)?$/,SSM_PATH:/^\/[a-zA-Z][a-zA-Z0-9-]*(\/[a-zA-Z][a-zA-Z0-9-]*)*$/,SECRET_NAME:/^[a-zA-Z_][a-zA-Z0-9._-]*$/,SSM_COMPONENT:/^[a-zA-Z][a-zA-Z0-9._-]*$/,EMAIL:/^[^\s@]+@[^\s@]+\.[^\s@]+$/,DOCKER_IMAGE:/^[a-z0-9][a-z0-9._-]*[a-z0-9](:[a-z0-9._-]+)?$/,DOMAIN:/^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$/i,PASCAL_CASE:/^[A-Z][A-Za-z0-9]*$/,AWS_ACCOUNT_ID:/^\d{12}$/,VPC_ID:/^vpc-[a-z0-9]+$/,ROLE_ARN:/^arn:aws[a-zA-Z-]*:iam::\d{12}:role\/.+$/,CIDR:/^((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\/(3[0-2]|[12]?\d)$/,SCHEDULE_EXPRESSION:/^(rate\(1 (?:minute|hour|day)\)|rate\((?:[2-9]|[1-9]\d+) (?:minutes|hours|days)\)|cron\([^\s()]+ [^\s()]+ [^\s()]+ [^\s()]+ [^\s()]+ [^\s()]+\))$/,LAMBDA_RUNTIME_IDENTIFIER:/^[A-Za-z0-9._-]+$/,ENV_VAR_NAME:/^[A-Za-z_][A-Za-z0-9_]*$/});function t(z){const n=/^rate\((\d+) (minute|minutes|hour|hours|day|days)\)$/.exec(z);if(!n)return;const A=n[1],a=n[2];if(A===void 0||a===void 0)return;const e=parseInt(A,10);if(!Number.isFinite(e)||e<1)return;const r=a==="minute"||a==="hour"||a==="day";if(!(r&&e!==1)&&!(!r&&e===1))return a==="minute"||a==="minutes"?{everyMs:e*6e4}:a==="hour"||a==="hours"?{everyMs:e*60*6e4}:{everyMs:e*24*60*6e4}}export{s as VALIDATION_PATTERNS,t as parseRateExpression};
@@ -1 +1 @@
1
- export declare const GENERATOR_VERSION = "0.95.0";
1
+ export declare const GENERATOR_VERSION = "0.99.1";
@@ -1 +1 @@
1
- const E="0.95.0";export{E as GENERATOR_VERSION};
1
+ const E="0.99.1";export{E as GENERATOR_VERSION};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fjall/generator",
3
- "version": "0.96.0",
3
+ "version": "0.99.3",
4
4
  "description": "Pure infrastructure generation logic for Fjall",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",
@@ -13,6 +13,10 @@
13
13
  "./codemod": {
14
14
  "types": "./dist/src/codemod/index.d.ts",
15
15
  "default": "./dist/src/codemod/index.js"
16
+ },
17
+ "./detection": {
18
+ "types": "./dist/src/detection/index.d.ts",
19
+ "default": "./dist/src/detection/index.js"
16
20
  }
17
21
  },
18
22
  "files": [
@@ -26,29 +30,31 @@
26
30
  "typecheck": "tsc --noEmit",
27
31
  "test": "vitest run",
28
32
  "test:watch": "vitest",
29
- "lint": "eslint src/codemod",
30
- "format": "prettier --write \"src/**/*.ts\"",
31
- "format:check": "prettier --check \"src/**/*.ts\""
33
+ "lint": "eslint src",
34
+ "lint:fix": "eslint src --fix",
35
+ "format": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json}\"",
36
+ "format:check": "prettier --check \"src/**/*.{ts,tsx,js,jsx,json}\""
32
37
  },
33
38
  "engines": {
34
39
  "node": ">=22.0.0"
35
40
  },
36
41
  "license": "SEE LICENSE IN LICENSE",
37
42
  "dependencies": {
38
- "@fjall/util": "^0.96.0",
43
+ "@fjall/util": "^0.99.3",
39
44
  "ast-types": "^0.16.1",
40
45
  "recast": "^0.23.11",
41
46
  "ts-morph": "^28.0.0",
42
- "typescript": "^5.8.2",
43
- "zod": "^4.3.6"
47
+ "typescript": "^6.0.3",
48
+ "zod": "^4.4.3"
44
49
  },
45
50
  "devDependencies": {
46
- "@eslint/js": "^9.16.0",
47
- "@vitest/coverage-v8": "^4.1.2",
48
- "eslint": "^9.16.0",
51
+ "@eslint/js": "^10.0.1",
52
+ "@types/node": "^25.6.0",
53
+ "@vitest/coverage-v8": "^4.1.5",
54
+ "eslint": "^10.2.1",
49
55
  "fast-check": "^4.7.0",
50
- "typescript-eslint": "^8.19.0",
51
- "vitest": "^4.1.0"
56
+ "typescript-eslint": "^8.59.1",
57
+ "vitest": "^4.1.5"
52
58
  },
53
- "gitHead": "bfbd3625ab029ba77a6571630e0edb85f9d53380"
59
+ "gitHead": "e50d25185d5eab618e2a90622466296fa0cbffe8"
54
60
  }
@@ -1,55 +0,0 @@
1
- import { type PropertyDelta, type ResourceSnapshot } from "../types.js";
2
- /**
3
- * Shared fixture builders for the drift test suite. Keeping these in
4
- * one module means every test can rely on `.strict()` Zod validation
5
- * of the inputs it constructs, removing schema drift risk from the
6
- * suite.
7
- */
8
- interface StorageFixtureOptions {
9
- name?: string;
10
- properties?: Record<string, unknown>;
11
- }
12
- /**
13
- * Build a minimal `.ts` source string that contains a single
14
- * `StorageFactory.build` call-site so the listing + parse path in
15
- * `detect.ts` and `snapshot.ts` has something to locate.
16
- */
17
- export declare function buildStorageSource(options?: StorageFixtureOptions): string;
18
- /**
19
- * Format a JavaScript literal value as source text. Only covers the
20
- * literal kinds that exercise the snapshot extractor's literal path —
21
- * strings, numbers, booleans, nulls, arrays, and plain objects. Raw
22
- * identifier / member-expression values (e.g. `Runtime.NODEJS_20_X`)
23
- * are encoded as `rawExpression`.
24
- */
25
- export declare function formatLiteral(value: unknown): string;
26
- /**
27
- * Tag a string so `formatLiteral` emits it verbatim rather than
28
- * JSON-encoding. Use for construct expressions (`Runtime.NODEJS_20_X`,
29
- * `cdk.Duration.days(14)`) that are not valid JSON literals but must
30
- * appear in the generated source.
31
- */
32
- export interface RawExpression {
33
- raw: string;
34
- }
35
- export declare function raw(expression: string): RawExpression;
36
- /**
37
- * Validate and return a `ResourceSnapshot`. Run through
38
- * `.strict()` so any field-name typo in a test fixture surfaces
39
- * at the boundary instead of silently producing a malformed
40
- * baseline the merge path would interpret incorrectly.
41
- */
42
- export declare function makeSnapshot(properties: Record<string, unknown>, name?: string, type?: ResourceSnapshot["type"]): ResourceSnapshot;
43
- /**
44
- * Validate and return a `PropertyDelta`. Helper for constructing
45
- * golden expected shapes inline without writing a literal object
46
- * that might drift from the schema.
47
- */
48
- export declare function makeDelta(delta: {
49
- property: string;
50
- base?: unknown;
51
- theirs: unknown;
52
- ours: unknown;
53
- verdict: PropertyDelta["verdict"];
54
- }): PropertyDelta;
55
- export {};
@@ -1,2 +0,0 @@
1
- import{PropertyDeltaSchema as f,ResourceSnapshotSchema as c}from"../types.js";const i="Photos";function u(r={}){const n=r.name??i,t=r.properties??{versioned:!0},e=Object.entries(t).map(([p,s])=>` ${p}: ${o(s)},`);return['import { StorageFactory } from "@fjall/components-infrastructure";',"",`StorageFactory.build("${n}", {`,...e,"});",""].join(`
2
- `)}function o(r){if(r===null)return"null";if(typeof r=="string")return JSON.stringify(r);if(typeof r=="number"||typeof r=="boolean")return String(r);if(a(r))return r.raw;if(Array.isArray(r))return`[${r.map(o).join(", ")}]`;if(typeof r=="object"&&r!==null)return`{ ${Object.entries(r).map(([t,e])=>`${t}: ${o(e)}`).join(", ")} }`;throw new Error(`formatLiteral: unsupported value type for ${String(r)}`)}function y(r){return{raw:r}}function a(r){return typeof r=="object"&&r!==null&&"raw"in r&&typeof r.raw=="string"}function S(r,n=i,t="storage"){return c.parse({type:t,name:n,properties:r,schemaVersion:1})}function g(r){return f.parse(r)}export{u as buildStorageSource,o as formatLiteral,g as makeDelta,S as makeSnapshot,y as raw};
@@ -1,5 +0,0 @@
1
- import type { FallbackIntent } from "../types.js";
2
- export declare const TEST_MODEL_ID = "claude-sonnet-4-6";
3
- export declare const TEST_INTENT: FallbackIntent;
4
- export declare const SAFE_CONTENT = "import { StorageFactory } from \"@fjall/components-infrastructure\";\n\nStorageFactory.build(\"Photos\", { versioned: true });\n";
5
- export declare const MODIFIED_CONTENT = "import { StorageFactory } from \"@fjall/components-infrastructure\";\n\nStorageFactory.build(\"Photos\", { versioned: false });\n";
@@ -1,7 +0,0 @@
1
- const o="claude-sonnet-4-6",t={op:"modify",type:"storage",name:"Photos",properties:{versioned:!1}},r=`import { StorageFactory } from "@fjall/components-infrastructure";
2
-
3
- StorageFactory.build("Photos", { versioned: true });
4
- `,e=`import { StorageFactory } from "@fjall/components-infrastructure";
5
-
6
- StorageFactory.build("Photos", { versioned: false });
7
- `;export{e as MODIFIED_CONTENT,r as SAFE_CONTENT,t as TEST_INTENT,o as TEST_MODEL_ID};