@fjall/generator 2.9.1 → 2.12.0

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/.minified CHANGED
@@ -1 +1 @@
1
- 137 files minified at 2026-06-02T21:42:57.717Z
1
+ 138 files minified at 2026-06-09T10:15:45.698Z
@@ -158,7 +158,8 @@ export declare function parseAndConvert(code: string): {
158
158
  }> | undefined;
159
159
  secretsImport?: Record<string, {
160
160
  id: string;
161
- name: string;
161
+ name?: string | undefined;
162
+ arn?: string | undefined;
162
163
  field?: string | undefined;
163
164
  }> | undefined;
164
165
  command?: string[] | undefined;
@@ -0,0 +1,40 @@
1
+ import { type Result } from "../../types/Result.js";
2
+ import type { LinesChanged, ParseError } from "../types.js";
3
+ export interface AppendAccountToStageOptions {
4
+ /** Stage / array key to append into (e.g. "production", "security"). */
5
+ stage: string;
6
+ /** Account display name to append (e.g. "ProductionEu"). */
7
+ displayName: string;
8
+ /** Top-level const to target. Defaults to "ACCOUNTS". */
9
+ constName?: string;
10
+ /**
11
+ * Parent object holding per-stage arrays in the nested shape. Defaults to
12
+ * "workloads". A flat top-level array key (e.g. "security") takes precedence
13
+ * when present, so this only applies to nested stages.
14
+ */
15
+ nestedKey?: string;
16
+ filePath?: string;
17
+ }
18
+ export interface AppendAccountToStageSuccess {
19
+ content: string;
20
+ linesChanged: LinesChanged;
21
+ /** True when displayName was already present (idempotent no-op). */
22
+ skipped?: boolean;
23
+ }
24
+ export interface ConstNotFoundError {
25
+ kind: "ConstNotFoundError";
26
+ constName: string;
27
+ }
28
+ export interface StageNotFoundError {
29
+ kind: "StageNotFoundError";
30
+ constName: string;
31
+ stage: string;
32
+ knownStages: string[];
33
+ }
34
+ export interface InvalidStageTargetError {
35
+ kind: "InvalidStageTargetError";
36
+ stage: string;
37
+ reason: string;
38
+ }
39
+ export type AppendAccountToStageError = ParseError | ConstNotFoundError | StageNotFoundError | InvalidStageTargetError;
40
+ export declare function appendAccountToStage(content: string, options: AppendAccountToStageOptions): Result<AppendAccountToStageSuccess, AppendAccountToStageError>;
@@ -0,0 +1 @@
1
+ import{failure as u,success as p}from"../../types/Result.js";import{DEFAULT_FILE_PATH as P,computeLinesDelta as T,extractProgramBody as x}from"../_internal.js";import{buildObjectProperty as k,detectQuoteStyle as b,parse as h,printFile as D}from"../fileRewriter/index.js";import{makeStringLiteral as C,toAstValue as F}from"./addResource/propertyBuilder.js";import{astToLiteral as L,isNodeShape as c,readKeyName as m}from"./modifyResource/literalConversion.js";const w="ACCOUNTS",I="workloads";function Y(e,r){const n=r.filePath??P,t=r.constName??w,a=r.nestedKey??I,{stage:i,displayName:o}=r,s=h(e,n);if(!s.success)return u(s.error);const f=x(s.data);if(f===void 0)return u({kind:"InvalidStageTargetError",stage:i,reason:"recast File is missing program.body"});const y=V(f,t);if(y===void 0)return u({kind:"ConstNotFoundError",constName:t});const l=b(s.data),d=K(y,{constName:t,stage:i,nestedKey:a,displayName:o,quoteStyle:l});if(!d.success)return u(d.error);if(d.data.created)return N(s.data,e);const A=d.data.array;return A.elements.some(v=>c(v)&&L(v)===o)?p({content:e,linesChanged:{added:0,removed:0},skipped:!0}):(A.elements.push(C(o,l)),N(s.data,e))}function N(e,r){const n=D(e,r);return p({content:n,linesChanged:T(r,n)})}function K(e,r){const{constName:n,stage:t,nestedKey:a,displayName:i,quoteStyle:o}=r,s=g(e,t);if(s!==void 0)return S(s.value)?p({created:!1,array:s.value}):u({kind:"InvalidStageTargetError",stage:t,reason:`Top-level "${t}" is not an array literal.`});const f=g(e,a);if(f!==void 0&&E(f.value)){const y=f.value,l=g(y,t);if(l!==void 0)return S(l.value)?p({created:!1,array:l.value}):u({kind:"InvalidStageTargetError",stage:t,reason:`Nested "${a}.${t}" is not an array literal.`});const d=O(y,t,i,o);return d.success?p({created:!0}):u(d.error)}return u({kind:"StageNotFoundError",constName:n,stage:t,knownStages:U(e,a)})}function O(e,r,n,t){const a=F([n],t);if(a===void 0)return u({kind:"InvalidStageTargetError",stage:r,reason:`Unable to build an array literal for "${r}".`});const i=k(r,a,t);return e.properties[e.properties.length-1]?.extra?.trailingComma===!0&&(i.extra={...i.extra??{},trailingComma:!0}),e.properties.push(i),p(void 0)}function V(e,r){for(const n of e){const t=_(n);if(t===void 0)continue;const a=t.declarations;if(Array.isArray(a))for(const i of a){if(!c(i)||i.type!=="VariableDeclarator")continue;const o=i.id,s=$(i.init);if(c(o)&&o.type==="Identifier"&&o.name===r&&E(s))return s}}}function _(e){if(e.type==="VariableDeclaration")return e;if(e.type==="ExportNamedDeclaration"){const r=e.declaration;if(c(r)&&r.type==="VariableDeclaration")return r}}function $(e){let r=e;for(;c(r)&&(r.type==="TSAsExpression"||r.type==="TSSatisfiesExpression");)r=r.expression;return r}function g(e,r){return e.properties.find(n=>(n.type==="Property"||n.type==="ObjectProperty")&&n.shorthand!==!0&&n.computed!==!0&&m(n.key)===r)}function U(e,r){const n=[];for(const t of e.properties){if(t.type!=="Property"&&t.type!=="ObjectProperty")continue;const a=m(t.key);if(a!==void 0)if(a===r&&E(t.value))for(const i of t.value.properties){const o=m(i.key);o!==void 0&&n.push(`${r}.${o}`)}else S(t.value)&&n.push(a)}return n}function E(e){return c(e)&&e.type==="ObjectExpression"&&Array.isArray(e.properties)}function S(e){return c(e)&&e.type==="ArrayExpression"&&Array.isArray(e.elements)}export{Y as appendAccountToStage};
@@ -1,6 +1,7 @@
1
1
  export { addResource, type AddResourceCallContext, type AddResourceError, type AddResourceSuccess, } from "./edits/addResource.js";
2
2
  export { removeResource, type RemoveResourceError, type RemoveResourceSuccess, } from "./edits/removeResource.js";
3
3
  export { modifyResource, type ModifyResourceCallContext, type ModifyResourceError, type ModifyResourceSuccess, } from "./edits/modifyResource.js";
4
+ export { appendAccountToStage, type AppendAccountToStageError, type AppendAccountToStageOptions, type AppendAccountToStageSuccess, } from "./edits/appendAccountToStage.js";
4
5
  export { addVpcPeer, modifyVpcPeer, removeVpcPeer, type VpcPeerAddOptions, type VpcPeerModifyOptions, type VpcPeerOrchestratorSuccess, type VpcPeerRemoveOptions, } from "./edits/vpcPeer.js";
5
6
  export { addVpcPeerAccepter, modifyVpcPeerAccepter, removeVpcPeerAccepter, type VpcPeerAccepterAddOptions, type VpcPeerAccepterModifyOptions, type VpcPeerAccepterOrchestratorSuccess, type VpcPeerAccepterRemoveOptions, } from "./edits/vpcPeerAccepter.js";
6
7
  export { addCrossPlanConnection, modifyCrossPlanConnection, removeCrossPlanConnection, type CrossPlanConnectionAddOptions, type CrossPlanConnectionModifyOptions, type CrossPlanConnectionOrchestratorSuccess, type CrossPlanConnectionRemoveOptions, } from "./edits/crossPlanConnection.js";
@@ -1 +1 @@
1
- import{addResource as o}from"./edits/addResource.js";import{removeResource as c}from"./edits/removeResource.js";import{modifyResource as p}from"./edits/modifyResource.js";import{addVpcPeer as a,modifyVpcPeer as n,removeVpcPeer as d}from"./edits/vpcPeer.js";import{addVpcPeerAccepter as l,modifyVpcPeerAccepter as f,removeVpcPeerAccepter as u}from"./edits/vpcPeerAccepter.js";import{addCrossPlanConnection as E,modifyCrossPlanConnection as x,removeCrossPlanConnection as R}from"./edits/crossPlanConnection.js";import{resolveDriftPolicy as C}from"./edits/driftPolicy.js";import{listResources as A}from"./listResources.js";import{parse as b}from"./fileRewriter/parse.js";import{CrossPlanConnectionResourcePlanSchema as h,VpcPeerAccepterResourcePlanSchema as y,VpcPeerResourcePlanSchema as D}from"../schemas/index.js";import{detectDrift as F,mergeProperties as G,snapshotProperties as N}from"./drift/index.js";import{computeLinesDelta as L}from"./_internal.js";import{ResourceNameSchema as g,StatementTypeSchema as B}from"./types.js";import{CODEMOD_ERROR_KINDS as K}from"./telemetry/errorKinds.js";import{buildEgressBlockedEvent as U,buildFiredEvent as j,buildGateFailedEvent as q,buildGatePassedEvent as w,buildRejectedEvent as z,buildSucceededEvent as H,buildTimeoutEvent as J,estimateCostUsd as Q,FALLBACK_EVENTS as W,GATE_EVENTS as X,PARSE_GATE as Y,RUNTIME_GATE as Z,runFallback as $,shouldTryFallback as ee}from"./llmFallback/index.js";export{K as CODEMOD_ERROR_KINDS,h as CrossPlanConnectionResourcePlanSchema,W as FALLBACK_EVENTS,X as GATE_EVENTS,Y as PARSE_GATE,Z as RUNTIME_GATE,g as ResourceNameSchema,B as StatementTypeSchema,y as VpcPeerAccepterResourcePlanSchema,D as VpcPeerResourcePlanSchema,E as addCrossPlanConnection,o as addResource,a as addVpcPeer,l as addVpcPeerAccepter,U as buildEgressBlockedEvent,j as buildFiredEvent,q as buildGateFailedEvent,w as buildGatePassedEvent,z as buildRejectedEvent,H as buildSucceededEvent,J as buildTimeoutEvent,L as computeLinesDelta,F as detectDrift,Q as estimateCostUsd,A as listResources,G as mergeProperties,x as modifyCrossPlanConnection,p as modifyResource,n as modifyVpcPeer,f as modifyVpcPeerAccepter,b as parse,R as removeCrossPlanConnection,c as removeResource,d as removeVpcPeer,u as removeVpcPeerAccepter,C as resolveDriftPolicy,$ as runFallback,ee as shouldTryFallback,N as snapshotProperties};
1
+ import{addResource as o}from"./edits/addResource.js";import{removeResource as c}from"./edits/removeResource.js";import{modifyResource as m}from"./edits/modifyResource.js";import{appendAccountToStage as a}from"./edits/appendAccountToStage.js";import{addVpcPeer as d,modifyVpcPeer as i,removeVpcPeer as l}from"./edits/vpcPeer.js";import{addVpcPeerAccepter as u,modifyVpcPeerAccepter as P,removeVpcPeerAccepter as E}from"./edits/vpcPeerAccepter.js";import{addCrossPlanConnection as R,modifyCrossPlanConnection as v,removeCrossPlanConnection as S}from"./edits/crossPlanConnection.js";import{resolveDriftPolicy as C}from"./edits/driftPolicy.js";import{listResources as V}from"./listResources.js";import{parse as h}from"./fileRewriter/parse.js";import{CrossPlanConnectionResourcePlanSchema as D,VpcPeerAccepterResourcePlanSchema as _,VpcPeerResourcePlanSchema as F}from"../schemas/index.js";import{detectDrift as N,mergeProperties as g,snapshotProperties as k}from"./drift/index.js";import{computeLinesDelta as O}from"./_internal.js";import{ResourceNameSchema as I,StatementTypeSchema as K}from"./types.js";import{CODEMOD_ERROR_KINDS as U}from"./telemetry/errorKinds.js";import{buildEgressBlockedEvent as q,buildFiredEvent as w,buildGateFailedEvent as z,buildGatePassedEvent as H,buildRejectedEvent as J,buildSucceededEvent as Q,buildTimeoutEvent as W,estimateCostUsd as X,FALLBACK_EVENTS as Y,GATE_EVENTS as Z,PARSE_GATE as $,RUNTIME_GATE as ee,runFallback as re,shouldTryFallback as oe}from"./llmFallback/index.js";export{U as CODEMOD_ERROR_KINDS,D as CrossPlanConnectionResourcePlanSchema,Y as FALLBACK_EVENTS,Z as GATE_EVENTS,$ as PARSE_GATE,ee as RUNTIME_GATE,I as ResourceNameSchema,K as StatementTypeSchema,_ as VpcPeerAccepterResourcePlanSchema,F as VpcPeerResourcePlanSchema,R as addCrossPlanConnection,o as addResource,d as addVpcPeer,u as addVpcPeerAccepter,a as appendAccountToStage,q as buildEgressBlockedEvent,w as buildFiredEvent,z as buildGateFailedEvent,H as buildGatePassedEvent,J as buildRejectedEvent,Q as buildSucceededEvent,W as buildTimeoutEvent,O as computeLinesDelta,N as detectDrift,X as estimateCostUsd,V as listResources,g as mergeProperties,v as modifyCrossPlanConnection,m as modifyResource,i as modifyVpcPeer,P as modifyVpcPeerAccepter,h as parse,S as removeCrossPlanConnection,c as removeResource,l as removeVpcPeer,E as removeVpcPeerAccepter,C as resolveDriftPolicy,re as runFallback,oe as shouldTryFallback,k as snapshotProperties};
@@ -524,7 +524,8 @@ export declare const ApplicationResourcePlanSchema: z.ZodObject<{
524
524
  }, z.core.$strict>]>]>>>;
525
525
  secretsImport: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
526
526
  id: z.ZodString;
527
- name: z.ZodString;
527
+ name: z.ZodOptional<z.ZodString>;
528
+ arn: z.ZodOptional<z.ZodString>;
528
529
  field: z.ZodOptional<z.ZodString>;
529
530
  }, z.core.$strict>>>;
530
531
  command: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -68,7 +68,8 @@ export declare const EnvironmentRecordSchema: z.ZodRecord<z.ZodString, z.ZodUnio
68
68
  */
69
69
  export declare const SecretImportSchema: z.ZodObject<{
70
70
  id: z.ZodString;
71
- name: z.ZodString;
71
+ name: z.ZodOptional<z.ZodString>;
72
+ arn: z.ZodOptional<z.ZodString>;
72
73
  field: z.ZodOptional<z.ZodString>;
73
74
  }, z.core.$strict>;
74
75
  /**
@@ -76,7 +77,8 @@ export declare const SecretImportSchema: z.ZodObject<{
76
77
  */
77
78
  export declare const SecretsImportRecordSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
78
79
  id: z.ZodString;
79
- name: z.ZodString;
80
+ name: z.ZodOptional<z.ZodString>;
81
+ arn: z.ZodOptional<z.ZodString>;
80
82
  field: z.ZodOptional<z.ZodString>;
81
83
  }, z.core.$strict>>;
82
84
  /**
@@ -1,2 +1,2 @@
1
- import{z as e}from"zod";import{VALIDATION_PATTERNS as o,VALIDATION_MESSAGES as t}from"../validation/patterns.js";import{APP_TYPES as i,PATTERN_TYPE_VALUES as s,MIN_PORT as p,MAX_PORT as E,BACKUP_VAULT_TIERS as A,GOVERNANCE_PRESETS as N}from"./constants.js";import{regions as _}from"../aws/regions.js";const P=n=>e.union([e.literal(!1),n]),L={check:n=>n.minCapacity!==void 0&&n.maxCapacity!==void 0?n.minCapacity<=n.maxCapacity:!0,params:{message:t.CAPACITY_CONSTRAINT.MIN_LTE_MAX,path:["maxCapacity"]}},y=n=>e.number().int(t.MEMORY_LIMIT.INTEGER).min(n,n===128?t.MEMORY_LIMIT.MIN_128:t.MEMORY_LIMIT.MIN_512).max(30720,t.MEMORY_LIMIT.MAX),D=e.string().min(1,t.REQUIRED.RESOURCE_NAME).max(63,t.MAX_LENGTH.RESOURCE_NAME).regex(o.RESOURCE_NAME,t.RESOURCE_NAME),U=e.string().min(1,t.REQUIRED.BUCKET_NAME).max(63,t.MAX_LENGTH.BUCKET_NAME).regex(o.BUCKET_NAME,t.BUCKET_NAME),V=e.string().min(1,t.REQUIRED.DATABASE_NAME).max(63,t.MAX_LENGTH.DATABASE_NAME).regex(o.DATABASE_NAME,t.DATABASE_NAME);function c(n){return e.string().min(2,t.IDENTIFIER_MIN_LENGTH).max(50,n).regex(o.IDENTIFIER,t.IDENTIFIER).refine(r=>!r.endsWith("-"),{message:t.IDENTIFIER_NO_TRAILING_HYPHEN}).refine(r=>!r.includes("--"),{message:t.IDENTIFIER_NO_CONSECUTIVE_HYPHENS})}const j=c(t.MAX_LENGTH.APP_NAME),G=e.number().int(t.PORT.INTEGER).min(p,t.PORT.MIN).max(E,t.PORT.MAX),B=e.object({key:e.string(),sourceText:e.string()}).strict(),g=e.object({__identifier:e.string()}).strict(),T=e.object({__expression:e.string()}).strict(),I=e.object({__call:e.string()}).strict(),S=e.union([g,T,I]),l=e.union([e.string(),e.number(),e.boolean(),S]),H=e.record(e.string().regex(o.ENV_VAR_NAME,t.ENV_VAR_NAME),l),x=e.object({id:e.string(),name:e.string(),field:e.string().optional()}).strict(),Y=e.record(e.string(),x),X=e.record(e.string(),e.unknown()),k=e.enum(i).describe(`Application type must be one of: ${i.join(", ")}`),F=e.enum(s).describe(`OpenNext deployment pattern: ${s.join(", ")}`),M=e.enum(["before-imports","after-imports","after-app-init","after-tags","after-resource","end-of-file"]),R=e.enum(["import","app-init","tags","database","compute","storage","network","messaging","cdn","pattern","vpc-peer","vpc-peer-accepter","cross-plan-connection","custom"]),K=e.object({sourceText:e.string(),position:M,afterManagedResource:e.object({type:R,name:e.string().optional()}).strict().optional(),originalLine:e.number().int().optional(),leadingComments:e.array(e.string()).optional(),orphaned:e.boolean().optional(),orphanedComment:e.string().optional()}).strict(),$=e.union([e.object({tier:e.enum(A)}).strict(),e.literal(!1)]),v=e.union([e.object({instanceType:e.string().optional()}).strict(),e.literal(!1)]),u=c(t.MAX_LENGTH.ORGANISATION_NAME),h=e.string().regex(o.EMAIL,t.EMAIL),m=e.string().refine(n=>_.includes(n),{message:t.REGION}),Q=e.object({name:u,email:h,accountName:e.string().optional(),primaryRegion:m.optional().default("us-east-1"),secondaryRegions:e.array(m).optional(),security:e.enum(N).optional(),force:e.boolean().optional()}).strict();function w(n){return n.issues.map(a=>`${a.path.length>0?`${a.path.join(".")}: `:""}${a.message}`).join(`
2
- `)}export{j as AppNameSchema,k as AppTypeSchema,R as AstStatementTypeSchema,$ as BackupConfigSchema,U as BucketNameSchema,L as CAPACITY_REFINEMENT,I as CallValueSchema,K as CustomCodeBlockSchema,M as CustomCodePositionSchema,V as DatabaseNameSchema,h as EmailSchema,H as EnvironmentRecordSchema,l as EnvironmentValueSchema,T as ExpressionValueSchema,B as ExtraPropertySchema,g as IdentifierValueSchema,X as MetadataRecordSchema,Q as OrganisationGeneratorSchema,u as OrganisationNameSchema,F as PatternSchema,G as PortSchema,m as RegionSchema,D as ResourceNameSchema,x as SecretImportSchema,Y as SecretsImportRecordSchema,S as SpecialValueSchema,v as TunnelConfigSchema,w as getZodErrorMessage,y as memoryLimitMiBSchema,P as optionalOrDisabled};
1
+ import{z as e}from"zod";import{VALIDATION_PATTERNS as o,VALIDATION_MESSAGES as t}from"../validation/patterns.js";import{APP_TYPES as i,PATTERN_TYPE_VALUES as s,MIN_PORT as p,MAX_PORT as E,BACKUP_VAULT_TIERS as A,GOVERNANCE_PRESETS as N}from"./constants.js";import{regions as g}from"../aws/regions.js";const P=n=>e.union([e.literal(!1),n]),y={check:n=>n.minCapacity!==void 0&&n.maxCapacity!==void 0?n.minCapacity<=n.maxCapacity:!0,params:{message:t.CAPACITY_CONSTRAINT.MIN_LTE_MAX,path:["maxCapacity"]}},L=n=>e.number().int(t.MEMORY_LIMIT.INTEGER).min(n,n===128?t.MEMORY_LIMIT.MIN_128:t.MEMORY_LIMIT.MIN_512).max(30720,t.MEMORY_LIMIT.MAX),D=e.string().min(1,t.REQUIRED.RESOURCE_NAME).max(63,t.MAX_LENGTH.RESOURCE_NAME).regex(o.RESOURCE_NAME,t.RESOURCE_NAME),U=e.string().min(1,t.REQUIRED.BUCKET_NAME).max(63,t.MAX_LENGTH.BUCKET_NAME).regex(o.BUCKET_NAME,t.BUCKET_NAME),V=e.string().min(1,t.REQUIRED.DATABASE_NAME).max(63,t.MAX_LENGTH.DATABASE_NAME).regex(o.DATABASE_NAME,t.DATABASE_NAME);function c(n){return e.string().min(2,t.IDENTIFIER_MIN_LENGTH).max(50,n).regex(o.IDENTIFIER,t.IDENTIFIER).refine(r=>!r.endsWith("-"),{message:t.IDENTIFIER_NO_TRAILING_HYPHEN}).refine(r=>!r.includes("--"),{message:t.IDENTIFIER_NO_CONSECUTIVE_HYPHENS})}const j=c(t.MAX_LENGTH.APP_NAME),G=e.number().int(t.PORT.INTEGER).min(p,t.PORT.MIN).max(E,t.PORT.MAX),B=e.object({key:e.string(),sourceText:e.string()}).strict(),_=e.object({__identifier:e.string()}).strict(),T=e.object({__expression:e.string()}).strict(),l=e.object({__call:e.string()}).strict(),I=e.union([_,T,l]),S=e.union([e.string(),e.number(),e.boolean(),I]),H=e.record(e.string().regex(o.ENV_VAR_NAME,t.ENV_VAR_NAME),S),u=e.object({id:e.string(),name:e.string().optional(),arn:e.string().optional(),field:e.string().optional()}).strict().refine(n=>n.name!==void 0!=(n.arn!==void 0),{message:"secretsImport requires exactly one of `name` or `arn`."}),Y=e.record(e.string(),u),X=e.record(e.string(),e.unknown()),k=e.enum(i).describe(`Application type must be one of: ${i.join(", ")}`),F=e.enum(s).describe(`OpenNext deployment pattern: ${s.join(", ")}`),x=e.enum(["before-imports","after-imports","after-app-init","after-tags","after-resource","end-of-file"]),M=e.enum(["import","app-init","tags","database","compute","storage","network","messaging","cdn","pattern","vpc-peer","vpc-peer-accepter","cross-plan-connection","custom"]),K=e.object({sourceText:e.string(),position:x,afterManagedResource:e.object({type:M,name:e.string().optional()}).strict().optional(),originalLine:e.number().int().optional(),leadingComments:e.array(e.string()).optional(),orphaned:e.boolean().optional(),orphanedComment:e.string().optional()}).strict(),$=e.union([e.object({tier:e.enum(A)}).strict(),e.literal(!1)]),v=e.union([e.object({instanceType:e.string().optional()}).strict(),e.literal(!1)]),R=c(t.MAX_LENGTH.ORGANISATION_NAME),h=e.string().regex(o.EMAIL,t.EMAIL),m=e.string().refine(n=>g.includes(n),{message:t.REGION}),Q=e.object({name:R,email:h,accountName:e.string().optional(),primaryRegion:m.optional().default("us-east-1"),secondaryRegions:e.array(m).optional(),security:e.enum(N).optional(),force:e.boolean().optional()}).strict();function w(n){return n.issues.map(a=>`${a.path.length>0?`${a.path.join(".")}: `:""}${a.message}`).join(`
2
+ `)}export{j as AppNameSchema,k as AppTypeSchema,M as AstStatementTypeSchema,$ as BackupConfigSchema,U as BucketNameSchema,y as CAPACITY_REFINEMENT,l as CallValueSchema,K as CustomCodeBlockSchema,x as CustomCodePositionSchema,V as DatabaseNameSchema,h as EmailSchema,H as EnvironmentRecordSchema,S as EnvironmentValueSchema,T as ExpressionValueSchema,B as ExtraPropertySchema,_ as IdentifierValueSchema,X as MetadataRecordSchema,Q as OrganisationGeneratorSchema,R as OrganisationNameSchema,F as PatternSchema,G as PortSchema,m as RegionSchema,D as ResourceNameSchema,u as SecretImportSchema,Y as SecretsImportRecordSchema,I as SpecialValueSchema,v as TunnelConfigSchema,w as getZodErrorMessage,L as memoryLimitMiBSchema,P as optionalOrDisabled};
@@ -79,7 +79,8 @@ export declare const ContainerConfigSchema: z.ZodObject<{
79
79
  }, z.core.$strict>]>]>>>;
80
80
  secretsImport: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
81
81
  id: z.ZodString;
82
- name: z.ZodString;
82
+ name: z.ZodOptional<z.ZodString>;
83
+ arn: z.ZodOptional<z.ZodString>;
83
84
  field: z.ZodOptional<z.ZodString>;
84
85
  }, z.core.$strict>>>;
85
86
  command: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -170,7 +171,8 @@ export declare const EcsServiceConfigSchema: z.ZodObject<{
170
171
  }, z.core.$strict>]>]>>>;
171
172
  secretsImport: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
172
173
  id: z.ZodString;
173
- name: z.ZodString;
174
+ name: z.ZodOptional<z.ZodString>;
175
+ arn: z.ZodOptional<z.ZodString>;
174
176
  field: z.ZodOptional<z.ZodString>;
175
177
  }, z.core.$strict>>>;
176
178
  command: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -299,7 +301,8 @@ export declare const ComputeResourcePlanSchema: z.ZodObject<{
299
301
  }, z.core.$strict>]>]>>>;
300
302
  secretsImport: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
301
303
  id: z.ZodString;
302
- name: z.ZodString;
304
+ name: z.ZodOptional<z.ZodString>;
305
+ arn: z.ZodOptional<z.ZodString>;
303
306
  field: z.ZodOptional<z.ZodString>;
304
307
  }, z.core.$strict>>>;
305
308
  command: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -640,7 +643,8 @@ export declare const ComputeGeneratorSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
640
643
  }, z.core.$strict>]>]>>>;
641
644
  secretsImport: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
642
645
  id: z.ZodString;
643
- name: z.ZodString;
646
+ name: z.ZodOptional<z.ZodString>;
647
+ arn: z.ZodOptional<z.ZodString>;
644
648
  field: z.ZodOptional<z.ZodString>;
645
649
  }, z.core.$strict>>>;
646
650
  command: z.ZodOptional<z.ZodArray<z.ZodString>>;
@@ -76,7 +76,7 @@ export declare const MAX_ECS_CAPACITY = 1000;
76
76
  export declare const MAX_SCALING_CAPACITY = 100;
77
77
  export declare const MAX_WARM_POOL_SIZE = 100;
78
78
  export declare const DEFAULT_WARM_POOL_MIN_SIZE = 1;
79
- export declare const DEFAULT_WARM_POOL_REUSE_ON_SCALE_IN = true;
79
+ export declare const DEFAULT_WARM_POOL_REUSE_ON_SCALE_IN = false;
80
80
  export declare const DEFAULT_CONTAINER_PORT = 3000;
81
81
  export declare const DEFAULT_EC2_INSTANCE_TYPE: "t4g.micro";
82
82
  /** AWS Secrets Manager recommended rotation interval (days) */
@@ -1 +1 @@
1
- const t=Object.freeze({RESOURCE_SUFFIXES:Object.freeze({storage:"Storage",database:"Database",cluster:"Cluster",function:"Function",instance:"Instance",compute:"Compute"})});import{DATABASE_TYPES as q}from"./sharedTypes.js";const g=["ecs","lambda","ec2"],x=Object.freeze({ECS:"ecs",LAMBDA:"lambda",EC2:"ec2"}),o=["code","container"],l=Object.freeze({CODE:"code",CONTAINER:"container"}),E=["ARM_64","X86_64"],c="ARM_64",A=["NONE","AWS_IAM"],T=["public","internal"],_=["CPU","MEMORY"],n=["ARM","STANDARD"],s=["Instance","Aurora"],S=["postgresql","mysql"],p=["foundation","compliance","hardened"];import{ECS_CAPACITY_PROVIDERS as y}from"./sharedTypes.js";const P="FARGATE",a=["payload","nextjs"],O=new Set(a);import{APP_TYPES as Z,CUSTOM_TIER as h}from"./sharedTypes.js";const R=["t3.nano","t3.micro","t3.small","t3.medium","t3.large","t3.xlarge","t3.2xlarge","t3a.nano","t3a.micro","t3a.small","t3a.medium","t3a.large","t3a.xlarge","t3a.2xlarge","t4g.nano","t4g.micro","t4g.small","t4g.medium","t4g.large","t4g.xlarge","t4g.2xlarge","c5.large","c5.xlarge","c5.2xlarge","c5.4xlarge","c5.9xlarge","c5.12xlarge","c5.18xlarge","c5.24xlarge","c5a.large","c5a.xlarge","c5a.2xlarge","c5a.4xlarge","c5a.8xlarge","c5a.12xlarge","c5a.16xlarge","c5a.24xlarge","c6g.medium","c6g.large","c6g.xlarge","c6g.2xlarge","c6g.4xlarge","c6g.8xlarge","c6g.12xlarge","c6g.16xlarge","r5.large","r5.xlarge","r5.2xlarge","r5.4xlarge","r5.8xlarge","r5.12xlarge","r5.16xlarge","r5.24xlarge","r5a.large","r5a.xlarge","r5a.2xlarge","r5a.4xlarge","r5a.8xlarge","r5a.12xlarge","r5a.16xlarge","r5a.24xlarge","r6g.medium","r6g.large","r6g.xlarge","r6g.2xlarge","r6g.4xlarge","r6g.8xlarge","r6g.12xlarge","r6g.16xlarge","i3.large","i3.xlarge","i3.2xlarge","i3.4xlarge","i3.8xlarge","i3.16xlarge","p3.2xlarge","p3.8xlarge","p3.16xlarge","g4dn.xlarge","g4dn.2xlarge","g4dn.4xlarge","g4dn.8xlarge","g4dn.12xlarge","g4dn.16xlarge","m5.large","m5.xlarge","m5.2xlarge","m5.4xlarge","m5.8xlarge","m5.12xlarge","m5.16xlarge","m5.24xlarge","m5a.large","m5a.xlarge","m5a.2xlarge","m5a.4xlarge","m5a.8xlarge","m5a.12xlarge","m5a.16xlarge","m5a.24xlarge"],C=[0,1,5,10,15,30,60];function m(e,r){return e.includes(r)}const I=1,M=65535,N=35255,D=128,L=10240,U=1,Y=900,i=1,d=1e3,u=100,F=100,f=1,B=!0,b=3e3,G="t4g.micro",H=30,X=["GET","POST","PUT","DELETE","HEAD","OPTIONS","PATCH"],V=["standard","assets","upload","website"],j=["AES256","KMS"];import{BACKUP_VAULT_TIERS as v}from"./sharedTypes.js";export{n as AMI_HARDWARE_TYPES,Z as APP_TYPES,v as BACKUP_VAULT_TIERS,E as COMPUTE_ARCHITECTURES,x as COMPUTE_TYPE,g as COMPUTE_TYPES,h as CUSTOM_TIER,S as DATABASE_ENGINES,q as DATABASE_TYPES,t as DEFAULTS,P as DEFAULT_CAPACITY_PROVIDER,c as DEFAULT_COMPUTE_ARCHITECTURE,b as DEFAULT_CONTAINER_PORT,N as DEFAULT_DATABASE_PORT,G as DEFAULT_EC2_INSTANCE_TYPE,H as DEFAULT_SECRET_ROTATION_DAYS,f as DEFAULT_WARM_POOL_MIN_SIZE,B as DEFAULT_WARM_POOL_REUSE_ON_SCALE_IN,l as DEPLOYMENT_TYPE,o as DEPLOYMENT_TYPES,R as EC2_INSTANCE_TYPES,y as ECS_CAPACITY_PROVIDERS,A as FUNCTION_URL_AUTH_TYPES,p as GOVERNANCE_PRESETS,X as HTTP_METHODS,T as LOAD_BALANCER_TYPES,d as MAX_ECS_CAPACITY,L as MAX_LAMBDA_MEMORY,Y as MAX_LAMBDA_TIMEOUT,M as MAX_PORT,u as MAX_SCALING_CAPACITY,F as MAX_WARM_POOL_SIZE,i as MIN_ECS_CAPACITY,D as MIN_LAMBDA_MEMORY,U as MIN_LAMBDA_TIMEOUT,I as MIN_PORT,s as PATTERN_DATABASE_TYPES,O as PATTERN_TYPES,a as PATTERN_TYPE_VALUES,j as S3_ENCRYPTION_TYPES,_ as SCALING_TYPES,V as STORAGE_PRESET_TYPES,C as VALID_MONITORING_INTERVALS,m as constIncludes};
1
+ const t=Object.freeze({RESOURCE_SUFFIXES:Object.freeze({storage:"Storage",database:"Database",cluster:"Cluster",function:"Function",instance:"Instance",compute:"Compute"})});import{DATABASE_TYPES as q}from"./sharedTypes.js";const g=["ecs","lambda","ec2"],x=Object.freeze({ECS:"ecs",LAMBDA:"lambda",EC2:"ec2"}),o=["code","container"],l=Object.freeze({CODE:"code",CONTAINER:"container"}),E=["ARM_64","X86_64"],c="ARM_64",A=["NONE","AWS_IAM"],T=["public","internal"],_=["CPU","MEMORY"],n=["ARM","STANDARD"],s=["Instance","Aurora"],S=["postgresql","mysql"],p=["foundation","compliance","hardened"];import{ECS_CAPACITY_PROVIDERS as y}from"./sharedTypes.js";const P="FARGATE",a=["payload","nextjs"],O=new Set(a);import{APP_TYPES as Z,CUSTOM_TIER as h}from"./sharedTypes.js";const R=["t3.nano","t3.micro","t3.small","t3.medium","t3.large","t3.xlarge","t3.2xlarge","t3a.nano","t3a.micro","t3a.small","t3a.medium","t3a.large","t3a.xlarge","t3a.2xlarge","t4g.nano","t4g.micro","t4g.small","t4g.medium","t4g.large","t4g.xlarge","t4g.2xlarge","c5.large","c5.xlarge","c5.2xlarge","c5.4xlarge","c5.9xlarge","c5.12xlarge","c5.18xlarge","c5.24xlarge","c5a.large","c5a.xlarge","c5a.2xlarge","c5a.4xlarge","c5a.8xlarge","c5a.12xlarge","c5a.16xlarge","c5a.24xlarge","c6g.medium","c6g.large","c6g.xlarge","c6g.2xlarge","c6g.4xlarge","c6g.8xlarge","c6g.12xlarge","c6g.16xlarge","r5.large","r5.xlarge","r5.2xlarge","r5.4xlarge","r5.8xlarge","r5.12xlarge","r5.16xlarge","r5.24xlarge","r5a.large","r5a.xlarge","r5a.2xlarge","r5a.4xlarge","r5a.8xlarge","r5a.12xlarge","r5a.16xlarge","r5a.24xlarge","r6g.medium","r6g.large","r6g.xlarge","r6g.2xlarge","r6g.4xlarge","r6g.8xlarge","r6g.12xlarge","r6g.16xlarge","i3.large","i3.xlarge","i3.2xlarge","i3.4xlarge","i3.8xlarge","i3.16xlarge","p3.2xlarge","p3.8xlarge","p3.16xlarge","g4dn.xlarge","g4dn.2xlarge","g4dn.4xlarge","g4dn.8xlarge","g4dn.12xlarge","g4dn.16xlarge","m5.large","m5.xlarge","m5.2xlarge","m5.4xlarge","m5.8xlarge","m5.12xlarge","m5.16xlarge","m5.24xlarge","m5a.large","m5a.xlarge","m5a.2xlarge","m5a.4xlarge","m5a.8xlarge","m5a.12xlarge","m5a.16xlarge","m5a.24xlarge"],C=[0,1,5,10,15,30,60];function m(e,r){return e.includes(r)}const I=1,M=65535,N=35255,D=128,L=10240,U=1,Y=900,i=1,d=1e3,u=100,F=100,f=1,B=!1,b=3e3,G="t4g.micro",H=30,X=["GET","POST","PUT","DELETE","HEAD","OPTIONS","PATCH"],V=["standard","assets","upload","website"],j=["AES256","KMS"];import{BACKUP_VAULT_TIERS as v}from"./sharedTypes.js";export{n as AMI_HARDWARE_TYPES,Z as APP_TYPES,v as BACKUP_VAULT_TIERS,E as COMPUTE_ARCHITECTURES,x as COMPUTE_TYPE,g as COMPUTE_TYPES,h as CUSTOM_TIER,S as DATABASE_ENGINES,q as DATABASE_TYPES,t as DEFAULTS,P as DEFAULT_CAPACITY_PROVIDER,c as DEFAULT_COMPUTE_ARCHITECTURE,b as DEFAULT_CONTAINER_PORT,N as DEFAULT_DATABASE_PORT,G as DEFAULT_EC2_INSTANCE_TYPE,H as DEFAULT_SECRET_ROTATION_DAYS,f as DEFAULT_WARM_POOL_MIN_SIZE,B as DEFAULT_WARM_POOL_REUSE_ON_SCALE_IN,l as DEPLOYMENT_TYPE,o as DEPLOYMENT_TYPES,R as EC2_INSTANCE_TYPES,y as ECS_CAPACITY_PROVIDERS,A as FUNCTION_URL_AUTH_TYPES,p as GOVERNANCE_PRESETS,X as HTTP_METHODS,T as LOAD_BALANCER_TYPES,d as MAX_ECS_CAPACITY,L as MAX_LAMBDA_MEMORY,Y as MAX_LAMBDA_TIMEOUT,M as MAX_PORT,u as MAX_SCALING_CAPACITY,F as MAX_WARM_POOL_SIZE,i as MIN_ECS_CAPACITY,D as MIN_LAMBDA_MEMORY,U as MIN_LAMBDA_TIMEOUT,I as MIN_PORT,s as PATTERN_DATABASE_TYPES,O as PATTERN_TYPES,a as PATTERN_TYPE_VALUES,j as S3_ENCRYPTION_TYPES,_ as SCALING_TYPES,V as STORAGE_PRESET_TYPES,C as VALID_MONITORING_INTERVALS,m as constIncludes};
@@ -1 +1 @@
1
- export declare const GENERATOR_VERSION = "2.9.0";
1
+ export declare const GENERATOR_VERSION = "2.11.1";
@@ -1 +1 @@
1
- const E="2.9.0";export{E as GENERATOR_VERSION};
1
+ const E="2.11.1";export{E as GENERATOR_VERSION};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fjall/generator",
3
- "version": "2.9.1",
3
+ "version": "2.12.0",
4
4
  "description": "Pure infrastructure generation logic for Fjall",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",
@@ -43,7 +43,7 @@
43
43
  },
44
44
  "license": "SEE LICENSE IN LICENSE",
45
45
  "dependencies": {
46
- "@fjall/util": "^2.9.1",
46
+ "@fjall/util": "^2.12.0",
47
47
  "ast-types": "^0.16.1",
48
48
  "recast": "^0.23.11",
49
49
  "ts-morph": "^28.0.0",
@@ -59,5 +59,5 @@
59
59
  "typescript-eslint": "^8.59.1",
60
60
  "vitest": "^4.1.5"
61
61
  },
62
- "gitHead": "a97423cf3df727994364a0907fa2b5c544a86b0d"
62
+ "gitHead": "dca39a47da956d3d94c689dd782fe285d711d25e"
63
63
  }