@fjall/generator 2.29.0 → 2.30.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.
- package/dist/.minified +1 -1
- package/dist/src/ast/astTestHelpers.d.ts +24 -1
- package/dist/src/ast/parsers/resources/astPatternParser.d.ts +116 -62
- package/dist/src/ast/parsers/resources/astPatternParser.js +1 -1
- package/dist/src/codemod/registry.js +1 -1
- package/dist/src/detection/index.d.ts +3 -3
- package/dist/src/generation/generatePatternCode.js +21 -20
- package/dist/src/planning/index.d.ts +1 -0
- package/dist/src/planning/index.js +1 -1
- package/dist/src/planning/staticSitePlanning.d.ts +39 -0
- package/dist/src/planning/staticSitePlanning.js +1 -0
- package/dist/src/schemas/applicationSchemas.d.ts +37 -0
- package/dist/src/schemas/applicationSchemas.js +1 -1
- package/dist/src/schemas/baseSchemas.d.ts +1 -0
- package/dist/src/schemas/constants.d.ts +5 -6
- package/dist/src/schemas/constants.js +1 -1
- package/dist/src/schemas/patternSchemas.d.ts +116 -0
- package/dist/src/schemas/patternSchemas.js +1 -1
- package/dist/src/validation/validationMessages.d.ts +4 -0
- package/dist/src/validation/validationMessages.js +1 -1
- package/dist/src/validation/validationPatterns.d.ts +1 -0
- package/dist/src/validation/validationPatterns.js +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/package.json +4 -3
package/dist/.minified
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
143 files minified at 2026-07-16T01:01:48.624Z
|
|
@@ -330,8 +330,31 @@ export declare function parseAndConvert(code: string): {
|
|
|
330
330
|
sourceText: string;
|
|
331
331
|
}[] | undefined;
|
|
332
332
|
}[];
|
|
333
|
-
pattern?: "payload" | "nextjs" | undefined;
|
|
333
|
+
pattern?: "payload" | "nextjs" | "staticsite" | undefined;
|
|
334
334
|
patternConfig?: {
|
|
335
|
+
type: "staticsite";
|
|
336
|
+
name: string;
|
|
337
|
+
source: string;
|
|
338
|
+
build: {
|
|
339
|
+
command: string;
|
|
340
|
+
outputDir: string;
|
|
341
|
+
};
|
|
342
|
+
routing?: "multipage" | "spa" | undefined;
|
|
343
|
+
security?: {
|
|
344
|
+
headers?: boolean | undefined;
|
|
345
|
+
contentSecurityPolicy?: string | undefined;
|
|
346
|
+
} | undefined;
|
|
347
|
+
domain?: string | undefined;
|
|
348
|
+
forms?: {
|
|
349
|
+
to: string;
|
|
350
|
+
from?: string | undefined;
|
|
351
|
+
corsOrigin?: string | undefined;
|
|
352
|
+
maxConcurrency?: number | undefined;
|
|
353
|
+
} | undefined;
|
|
354
|
+
cdn?: {
|
|
355
|
+
behaviours?: unknown[] | undefined;
|
|
356
|
+
} | undefined;
|
|
357
|
+
} | {
|
|
335
358
|
type: "payload";
|
|
336
359
|
name: string;
|
|
337
360
|
domain?: string | undefined;
|
|
@@ -1,86 +1,140 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Read-only AST parser for the pattern section of infrastructure.ts (payload
|
|
3
|
-
* and
|
|
2
|
+
* Read-only AST parser for the pattern section of infrastructure.ts (payload,
|
|
3
|
+
* nextjs, and staticsite). Used by fjall list and by the deploy-worker's
|
|
4
4
|
* convertToResourcePlan. Write paths live in src/codemod/. Do not add mutation
|
|
5
5
|
* helpers here.
|
|
6
6
|
*/
|
|
7
7
|
import * as ts from "typescript";
|
|
8
8
|
import type { ApplicationResourcePlan } from "../../../schemas/resourceSchemas.js";
|
|
9
|
+
import { type StaticSiteRouting } from "@fjall/util";
|
|
9
10
|
/** Parsed Lambda function configuration */
|
|
10
11
|
export interface ParsedLambdaConfig {
|
|
11
12
|
memorySize?: number;
|
|
12
13
|
timeout?: number;
|
|
13
14
|
ephemeralStorageSize?: number;
|
|
14
15
|
}
|
|
15
|
-
/**
|
|
16
|
-
|
|
16
|
+
/** Fields shared by every parsed pattern resource */
|
|
17
|
+
interface ParsedPatternResourceBase {
|
|
17
18
|
variableName?: string;
|
|
18
19
|
constructId: string;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
20
|
+
node: ts.Node;
|
|
21
|
+
}
|
|
22
|
+
/** Parsed OpenNext (payload / nextjs) pattern config */
|
|
23
|
+
export interface ParsedOpenNextPatternConfig {
|
|
24
|
+
name: string;
|
|
25
|
+
domain?: string;
|
|
26
|
+
database?: {
|
|
27
|
+
type?: "Instance" | "Aurora";
|
|
28
|
+
databaseName?: string;
|
|
29
|
+
databaseEngine?: "postgresql" | "mysql";
|
|
30
|
+
deletionProtection?: boolean;
|
|
31
|
+
backupRetention?: number;
|
|
32
|
+
port?: number;
|
|
33
|
+
publiclyAccessible?: boolean;
|
|
34
|
+
allowedIpCidr?: string;
|
|
35
|
+
instanceType?: string;
|
|
36
|
+
allocatedStorage?: number;
|
|
37
|
+
multiAz?: boolean;
|
|
38
|
+
allowVpcAccess?: boolean;
|
|
39
|
+
monitoringInterval?: number;
|
|
40
|
+
preferredMaintenanceWindow?: string;
|
|
41
|
+
snapshotIdentifier?: string;
|
|
42
|
+
snapshotUsername?: string;
|
|
43
|
+
readReplica?: object | false;
|
|
44
|
+
writer?: object;
|
|
45
|
+
readers?: object | false;
|
|
46
|
+
databaseInsights?: object | false;
|
|
47
|
+
proxy?: object | false;
|
|
48
|
+
credentials?: object;
|
|
49
|
+
encryption?: object;
|
|
50
|
+
};
|
|
51
|
+
compute?: {
|
|
52
|
+
server?: ParsedLambdaConfig;
|
|
53
|
+
imageOptimisation?: ParsedLambdaConfig;
|
|
54
|
+
revalidation?: ParsedLambdaConfig;
|
|
55
|
+
};
|
|
56
|
+
storage?: {
|
|
57
|
+
assets?: {
|
|
58
|
+
versioned?: boolean;
|
|
52
59
|
};
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
versioned?: boolean;
|
|
56
|
-
};
|
|
57
|
-
cache?: {
|
|
58
|
-
versioned?: boolean;
|
|
59
|
-
};
|
|
60
|
-
media?: {
|
|
61
|
-
versioned?: boolean;
|
|
62
|
-
};
|
|
60
|
+
cache?: {
|
|
61
|
+
versioned?: boolean;
|
|
63
62
|
};
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
visibilityTimeout?: number;
|
|
67
|
-
messageRetentionPeriod?: number;
|
|
68
|
-
maxMessageSize?: number;
|
|
69
|
-
deadLetterQueue?: {
|
|
70
|
-
enabled?: boolean;
|
|
71
|
-
maxReceiveCount?: number;
|
|
72
|
-
} | false;
|
|
73
|
-
};
|
|
63
|
+
media?: {
|
|
64
|
+
versioned?: boolean;
|
|
74
65
|
};
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
66
|
+
};
|
|
67
|
+
messaging?: {
|
|
68
|
+
revalidationQueue?: {
|
|
69
|
+
visibilityTimeout?: number;
|
|
70
|
+
messageRetentionPeriod?: number;
|
|
71
|
+
maxMessageSize?: number;
|
|
72
|
+
deadLetterQueue?: {
|
|
73
|
+
enabled?: boolean;
|
|
74
|
+
maxReceiveCount?: number;
|
|
75
|
+
} | false;
|
|
78
76
|
};
|
|
79
|
-
environment?: Record<string, string>;
|
|
80
77
|
};
|
|
81
|
-
|
|
78
|
+
cdn?: {
|
|
79
|
+
domainNames?: string[];
|
|
80
|
+
certificateArn?: string;
|
|
81
|
+
};
|
|
82
|
+
environment?: Record<string, string>;
|
|
82
83
|
}
|
|
84
|
+
/**
|
|
85
|
+
* Parsed static-site pattern config.
|
|
86
|
+
*
|
|
87
|
+
* `source`, `build.*` and `forms.to` are REQUIRED by the Zod config, yet they
|
|
88
|
+
* are optional here — because a field the parser cannot read is a different
|
|
89
|
+
* thing from a field the user omitted. `source: SOURCE_DIR` (a const
|
|
90
|
+
* reference, valid TypeScript) is unreadable, not empty. Defaulting it to `""`
|
|
91
|
+
* would let a codemod round-trip re-emit `source: ""` over the user's line and
|
|
92
|
+
* silently destroy their config; leaving it absent makes `applyPatternConfig`
|
|
93
|
+
* refuse the round-trip and say so.
|
|
94
|
+
*/
|
|
95
|
+
export interface ParsedStaticSitePatternConfig {
|
|
96
|
+
name: string;
|
|
97
|
+
source?: string;
|
|
98
|
+
build?: {
|
|
99
|
+
command?: string;
|
|
100
|
+
outputDir?: string;
|
|
101
|
+
};
|
|
102
|
+
routing?: StaticSiteRouting;
|
|
103
|
+
security?: {
|
|
104
|
+
headers?: boolean;
|
|
105
|
+
contentSecurityPolicy?: string;
|
|
106
|
+
};
|
|
107
|
+
domain?: string;
|
|
108
|
+
forms?: {
|
|
109
|
+
to?: string;
|
|
110
|
+
from?: string;
|
|
111
|
+
corsOrigin?: string;
|
|
112
|
+
maxConcurrency?: number;
|
|
113
|
+
};
|
|
114
|
+
cdn?: {
|
|
115
|
+
behaviours?: unknown[];
|
|
116
|
+
};
|
|
117
|
+
/**
|
|
118
|
+
* Field paths that were PRESENT in the literal but resolved to a const
|
|
119
|
+
* reference / expression the parser could not reduce (`corsOrigin: SITE_URL`).
|
|
120
|
+
* Distinct from an absent optional field: re-emitting the extracted config
|
|
121
|
+
* would silently erase the user's line, so `applyPatternConfig` refuses to
|
|
122
|
+
* round-trip a config carrying any. Absent keys never appear here.
|
|
123
|
+
*/
|
|
124
|
+
unreadableFields?: string[];
|
|
125
|
+
}
|
|
126
|
+
export interface ParsedOpenNextPatternResource extends ParsedPatternResourceBase {
|
|
127
|
+
type: "payload" | "nextjs";
|
|
128
|
+
config: ParsedOpenNextPatternConfig;
|
|
129
|
+
}
|
|
130
|
+
export interface ParsedStaticSitePatternResource extends ParsedPatternResourceBase {
|
|
131
|
+
type: "staticsite";
|
|
132
|
+
config: ParsedStaticSitePatternConfig;
|
|
133
|
+
}
|
|
134
|
+
/** Parsed pattern resource from app.addPattern(PatternFactory.build(...)) */
|
|
135
|
+
export type ParsedPatternResource = ParsedOpenNextPatternResource | ParsedStaticSitePatternResource;
|
|
83
136
|
/** Find pattern resources from app.addPattern(PatternFactory.build(...)) calls */
|
|
84
137
|
export declare function findPatternResources(sourceFile: ts.SourceFile): ParsedPatternResource[];
|
|
85
138
|
/** Apply pattern config to plan */
|
|
86
139
|
export declare function applyPatternConfig(plan: ApplicationResourcePlan, patternResources: ParsedPatternResource[]): void;
|
|
140
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as
|
|
1
|
+
import*as y from"typescript";import{STATIC_SITE_ROUTING_VALUES as P}from"@fjall/util";import{asBoolean as p,asNumber as s,asString as o,asStringArray as v,asStringUnion as h,asObjectOrFalse as g,collectFromAst as I,extractSubConfig as u,extractVariableName as _,isFactoryBuildCall as C,isFactoryMethodCall as F,isParsedObject as O,isPlainObject as D,parseObjectLiteral as E,parseOptionalConfig as d,typed as S}from"../common/astCommonParser.js";import{parseDeadLetterQueueConfig as L}from"./astMessagingParser.js";const N=["Instance","Aurora"],z=["postgresql","mysql"];function x(t){if(!O(t))return;const e={...t.memorySize!==void 0&&{memorySize:s(t.memorySize)},...t.timeout!==void 0&&{timeout:s(t.timeout)},...t.ephemeralStorageSize!==void 0&&{ephemeralStorageSize:s(t.ephemeralStorageSize)}};return Object.keys(e).length>0?e:void 0}function R(t){return u(t,"database",e=>({type:h(e.type,N),databaseName:o(e.databaseName),databaseEngine:h(e.databaseEngine,z),deletionProtection:p(e.deletionProtection),backupRetention:s(e.backupRetention),port:s(e.port),publiclyAccessible:p(e.publiclyAccessible),allowedIpCidr:o(e.allowedIpCidr),instanceType:o(e.instanceType),allocatedStorage:s(e.allocatedStorage),multiAz:p(e.multiAz),allowVpcAccess:p(e.allowVpcAccess),monitoringInterval:s(e.monitoringInterval),preferredMaintenanceWindow:o(e.preferredMaintenanceWindow),snapshotIdentifier:o(e.snapshotIdentifier),snapshotUsername:o(e.snapshotUsername),readReplica:g(e.readReplica),writer:d(e.writer,S()),readers:g(e.readers),databaseInsights:g(e.databaseInsights),proxy:g(e.proxy),credentials:d(e.credentials,S()),encryption:d(e.encryption,S())}))}function T(t){return u(t,"compute",e=>({server:d(e.server,x),imageOptimisation:d(e.imageOptimisation,x),revalidation:d(e.revalidation,x)}))}function k(t){const e=n=>({versioned:p(n.versioned)});return u(t,"storage",n=>({assets:d(n.assets,e),cache:d(n.cache,e),media:d(n.media,e)}))}function j(t){return u(t,"messaging",e=>({revalidationQueue:d(e.revalidationQueue,n=>({visibilityTimeout:s(n.visibilityTimeout),messageRetentionPeriod:s(n.messageRetentionPeriod),maxMessageSize:s(n.maxMessageSize),deadLetterQueue:L(n.deadLetterQueue)}))}))}function U(t){return u(t,"cdn",e=>({domainNames:v(e.domainNames),certificateArn:o(e.certificateArn)}))}function V(t){return u(t,"environment",e=>{const n=Object.fromEntries(Object.entries(e).filter(r=>typeof r[1]=="string"));return Object.keys(n).length>0?n:void 0})}function M(t,e){const n=B(t);return{name:e,source:o(t.source),build:u(t,"build",r=>({command:o(r.command),outputDir:o(r.outputDir)})),routing:h(t.routing,P),security:u(t,"security",r=>({headers:p(r.headers),contentSecurityPolicy:o(r.contentSecurityPolicy)})),domain:o(t.domain),forms:u(t,"forms",r=>({to:o(r.to),from:o(r.from),corsOrigin:o(r.corsOrigin),maxConcurrency:s(r.maxConcurrency)})),cdn:u(t,"cdn",r=>({behaviours:Array.isArray(r.behaviours)?r.behaviours:void 0})),...n.length>0&&{unreadableFields:n}}}function A(t){return D(t)&&("__identifier"in t||"__expression"in t||"__call"in t||"__unknown"in t)}function B(t){const e=[],n=(i,a)=>{A(i)&&e.push(a)};n(t.source,"source"),n(t.routing,"routing"),n(t.domain,"domain");const r=[[t.build,"build",["command","outputDir"]],[t.security,"security",["headers","contentSecurityPolicy"]],[t.forms,"forms",["to","from","corsOrigin","maxConcurrency"]],[t.cdn,"cdn",["behaviours"]]];for(const[i,a,c]of r)if(A(i))e.push(a);else if(O(i))for(const m of c)n(i[m],`${a}.${m}`);return e}function f(t){return t!==void 0&&t!==""}function b(t,e){return new Error(`Static-site pattern '${t}' in infrastructure.ts: Fjall could not read ${e.join(", ")} as inline literal(s). Fjall reads these fields out of the file and writes them back, so they must be written inline (source: "./site"), not as a variable or an expression.`)}function Q(t,e){const n=e.to;if(!f(n))throw b(t,["forms.to"]);return{to:n,...e.from!==void 0&&{from:e.from},...e.corsOrigin!==void 0&&{corsOrigin:e.corsOrigin},...e.maxConcurrency!==void 0&&{maxConcurrency:e.maxConcurrency}}}function $(t,e){if(t.arguments.length<2)return null;const n=t.arguments[0],r=t.arguments[1];if(!y.isStringLiteral(n)||!y.isObjectLiteralExpression(r))return null;const i=n.text,a=E(r),c=a.type,m=_(e),l=o(a.name);return l?c==="payload"||c==="nextjs"?{variableName:m,constructId:i,type:c,config:{name:l,domain:o(a.domain),database:R(a),compute:T(a),storage:k(a),messaging:j(a),cdn:U(a),environment:V(a)},node:t}:c==="staticsite"?{variableName:m,constructId:i,type:"staticsite",config:M(a,l),node:t}:null:null}function K(t){return I(t,e=>{if(!y.isCallExpression(e)||!F(e,"addPattern"))return null;const n=e.arguments[0];return C(n,"PatternFactory")?$(n,e):null})}function Y(t,e){if(!e||e.length===0)return;const n=e[0];if(t.pattern=n.type,n.type==="staticsite"){const{config:i}=n,a=i.source,c=i.build?.command,m=i.build?.outputDir;if(i.unreadableFields!==void 0)throw b(i.name,i.unreadableFields);if(!f(a)||!f(c)||!f(m)){const l=[];throw f(a)||l.push("source"),f(c)||l.push("build.command"),f(m)||l.push("build.outputDir"),b(i.name,l)}t.patternConfig={type:"staticsite",name:i.name,source:a,build:{command:c,outputDir:m},routing:i.routing,security:i.security,domain:i.domain,...i.forms!==void 0&&{forms:Q(i.name,i.forms)},cdn:i.cdn};return}const{config:r}=n;t.patternConfig={type:n.type,name:r.name,domain:r.domain,database:r.database,compute:r.compute,storage:r.storage,messaging:r.messaging,cdn:r.cdn,environment:r.environment}}export{Y as applyPatternConfig,K as findPatternResources};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as c}from"zod";import{CDNResourcePlanSchema as
|
|
1
|
+
import{z as c}from"zod";import{CDNResourcePlanSchema as l,ComputeResourcePlanSchema as d,CrossPlanConnectionResourcePlanSchema as S,DatabaseResourcePlanSchema as h,NetworkResourcePlanSchema as y,NextJSPatternConfigSchema as P,OrganisationResourcePlanSchema as F,PayloadPatternConfigSchema as f,S3ResourcePlanSchema as C,SQSResourcePlanSchema as E,StaticSitePatternConfigSchema as R,VpcPeerAccepterResourcePlanSchema as b,VpcPeerResourcePlanSchema as _}from"../schemas/index.js";import{failure as T}from"../types/Result.js";const n={database:"DatabaseFactory",storage:"StorageFactory",compute:"ComputeFactory",messaging:"MessagingFactory",cdn:"CdnFactory",network:"NetworkFactory",pattern:"PatternFactory","vpc-peer":"VpcPeerFactory","vpc-peer-accepter":"VpcPeerAccepterFactory","cross-plan-connection":"CrossPlanConnectionFactory",organisation:"OrganisationFactory"};function r(e){const{name:t,...o}=e.shape;return c.object(o).partial().strict()}const v=r(h),k=r(C),w=(()=>{const{name:e,...t}=d.shape;return c.object(t).partial().strict()})(),x=r(E),N=r(l),j=r(y),A=(()=>{const{name:e,type:t,cdn:o,...i}=f.shape,{name:M,type:Y,cdn:Q,...m}=P.shape,{name:$,type:z,domain:J,cdn:g,...u}=R.shape;return c.object({...i,...m,...u,cdn:c.union([o,g])}).partial().strict()})(),O=r(_),D=r(b),V=r(S),B=r(F);function s(e,t){return T({kind:"SemanticQueryError",reason:`StatementTypeEntry.${e} for ${t} is not wired; existing types dispatch through the shared locator/generator.`})}function G(e){return{factoryIdentifier:e,findByShape:()=>s("locator.findByShape",e),validateContext:()=>s("locator.validateContext",e)}}function I(e){return{build:()=>{const t=s("generator.build",e);throw new Error(t.success?"unreachable":t.error.reason)}}}function a(e,t){return{factoryIdentifier:e,locator:G(e),generator:I(e),schemaFragment:t}}const p={database:a(n.database,v),storage:a(n.storage,k),compute:a(n.compute,w),messaging:a(n.messaging,x),cdn:a(n.cdn,N),network:a(n.network,j),pattern:a(n.pattern,A),"vpc-peer":a(n["vpc-peer"],O),"vpc-peer-accepter":a(n["vpc-peer-accepter"],D),"cross-plan-connection":a(n["cross-plan-connection"],V),organisation:a(n.organisation,B)},H=Object.keys(p);function K(e){const t=Object.keys(p);for(const o of t)if(p[o].factoryIdentifier===e)return o}export{H as REGISTERED_STATEMENT_TYPES,p as STATEMENT_REGISTRY,K as findTypeByIdentifier};
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
import { z } from "zod";
|
|
14
14
|
export declare const FRAMEWORK_VALUES: readonly ["nextjs", "payload", "nextjs+payload", "express", "remix", "astro", "unknown"];
|
|
15
15
|
export declare const FrameworkSchema: z.ZodEnum<{
|
|
16
|
+
unknown: "unknown";
|
|
16
17
|
payload: "payload";
|
|
17
18
|
nextjs: "nextjs";
|
|
18
|
-
unknown: "unknown";
|
|
19
19
|
"nextjs+payload": "nextjs+payload";
|
|
20
20
|
express: "express";
|
|
21
21
|
remix: "remix";
|
|
@@ -34,9 +34,9 @@ export type MonorepoTool = z.infer<typeof MonorepoToolSchema>;
|
|
|
34
34
|
export declare const AppDetectionSchema: z.ZodObject<{
|
|
35
35
|
relativePath: z.ZodString;
|
|
36
36
|
framework: z.ZodEnum<{
|
|
37
|
+
unknown: "unknown";
|
|
37
38
|
payload: "payload";
|
|
38
39
|
nextjs: "nextjs";
|
|
39
|
-
unknown: "unknown";
|
|
40
40
|
"nextjs+payload": "nextjs+payload";
|
|
41
41
|
express: "express";
|
|
42
42
|
remix: "remix";
|
|
@@ -65,9 +65,9 @@ export declare const RepositoryDetectionSchema: z.ZodObject<{
|
|
|
65
65
|
apps: z.ZodArray<z.ZodObject<{
|
|
66
66
|
relativePath: z.ZodString;
|
|
67
67
|
framework: z.ZodEnum<{
|
|
68
|
+
unknown: "unknown";
|
|
68
69
|
payload: "payload";
|
|
69
70
|
nextjs: "nextjs";
|
|
70
|
-
unknown: "unknown";
|
|
71
71
|
"nextjs+payload": "nextjs+payload";
|
|
72
72
|
express: "express";
|
|
73
73
|
remix: "remix";
|
|
@@ -1,33 +1,34 @@
|
|
|
1
|
-
import{toPascalCase as
|
|
2
|
-
${t}${
|
|
3
|
-
${t}${
|
|
4
|
-
${t}${
|
|
5
|
-
${t}${
|
|
6
|
-
${t}${
|
|
7
|
-
${t}type: "${
|
|
8
|
-
${t}backupRetention: ${
|
|
9
|
-
${t}deletionProtection: ${
|
|
10
|
-
database: {${
|
|
11
|
-
},`}function
|
|
1
|
+
import{toPascalCase as y,formatValue as p}from"./common.js";import{PATTERN_REGISTRY as f}from"@fjall/util";const a=Object.freeze({database:{type:"Instance",backupRetention:7,deletionProtection:!0},compute:{server:{memorySize:1536,timeout:30},imageOptimisation:{memorySize:1536,timeout:30},revalidation:{memorySize:768,timeout:300}}});function s(n,e,t){return e===void 0?"":`
|
|
2
|
+
${t}${n}: ${e},`}function m(n,e,t){return e===void 0?"":`
|
|
3
|
+
${t}${n}: ${JSON.stringify(e)},`}function d(n,e,t){return e===void 0?"":e===!1?`
|
|
4
|
+
${t}${n}: false,`:`
|
|
5
|
+
${t}${n}: ${p(e,t)},`}function r(n,e,t){return e===void 0||Object.keys(e).length===0?"":`
|
|
6
|
+
${t}${n}: ${p(e,t)},`}function $(n){const e=n??{},t=" ",c=e.type??a.database.type,o=e.backupRetention??a.database.backupRetention,u=e.deletionProtection??a.database.deletionProtection;let i=`
|
|
7
|
+
${t}type: "${c}",`;return i+=m("databaseName",e.databaseName,t),i+=m("databaseEngine",e.databaseEngine,t),c==="Instance"&&e.instanceType!==void 0&&(i+=m("instanceType",e.instanceType,t)),i+=s("allocatedStorage",e.allocatedStorage,t),i+=s("port",e.port,t),i+=`
|
|
8
|
+
${t}backupRetention: ${o},`,i+=`
|
|
9
|
+
${t}deletionProtection: ${u},`,i+=s("publiclyAccessible",e.publiclyAccessible,t),i+=m("allowedIpCidr",e.allowedIpCidr,t),i+=s("multiAz",e.multiAz,t),i+=s("allowVpcAccess",e.allowVpcAccess,t),i+=s("monitoringInterval",e.monitoringInterval,t),i+=m("preferredMaintenanceWindow",e.preferredMaintenanceWindow,t),i+=m("snapshotIdentifier",e.snapshotIdentifier,t),i+=m("snapshotUsername",e.snapshotUsername,t),i+=d("readReplica",e.readReplica,t),i+=r("writer",e.writer,t),i+=d("readers",e.readers,t),i+=d("databaseInsights",e.databaseInsights,t),i+=d("proxy",e.proxy,t),i+=r("credentials",e.credentials,t),i+=r("encryption",e.encryption,t),`
|
|
10
|
+
database: {${i}
|
|
11
|
+
},`}function b(n){const e=n??{},t=e.server?.memorySize??a.compute.server.memorySize,c=e.server?.timeout??a.compute.server.timeout,o=e.imageOptimisation?.memorySize??a.compute.imageOptimisation.memorySize,u=e.imageOptimisation?.timeout??a.compute.imageOptimisation.timeout,i=e.revalidation?.memorySize??a.compute.revalidation.memorySize,l=e.revalidation?.timeout??a.compute.revalidation.timeout;return`
|
|
12
12
|
compute: {
|
|
13
13
|
server: {
|
|
14
14
|
memorySize: ${t},
|
|
15
|
-
timeout: ${
|
|
15
|
+
timeout: ${c},
|
|
16
16
|
},
|
|
17
17
|
imageOptimisation: {
|
|
18
|
-
memorySize: ${
|
|
19
|
-
timeout: ${
|
|
18
|
+
memorySize: ${o},
|
|
19
|
+
timeout: ${u},
|
|
20
20
|
},
|
|
21
21
|
revalidation: {
|
|
22
|
-
memorySize: ${
|
|
22
|
+
memorySize: ${i},
|
|
23
23
|
timeout: ${l},
|
|
24
24
|
},
|
|
25
|
-
},`}function g(
|
|
26
|
-
|
|
25
|
+
},`}function g(n){return r("storage",n," ")}function S(n){return r("messaging",n," ")}function v(n){return r("cdn",n," ")}function z(n){return r("environment",n," ")}function I(n){const e=" ";let t="";return t+=m("source",n.source,e),t+=r("build",n.build,e),t+=m("routing",n.routing,e),t+=r("security",n.security,e),n.domain!==void 0&&n.domain!==""&&(t+=`
|
|
26
|
+
${e}domain: ${JSON.stringify(n.domain)},`),t+=r("forms",n.forms,e),t+=r("cdn",n.cdn,e),t}function k(n){if(!n.patternConfig)return"";const e=n.patternConfig;let o=`app.addPattern(
|
|
27
|
+
PatternFactory.build("${`${y(e.name)}${f[e.type].constructIdSuffix}`}", {
|
|
27
28
|
type: "${e.type}",
|
|
28
|
-
name: "${e.name}",`;return e.domain!==void 0&&e.domain!==""&&(o+=`
|
|
29
|
-
domain: "${e.domain}",`),
|
|
29
|
+
name: "${e.name}",`;return e.type==="payload"||e.type==="nextjs"?(e.domain!==void 0&&e.domain!==""&&(o+=`
|
|
30
|
+
domain: "${e.domain}",`),o+=$(e.database),o+=b(e.compute),o+=g(e.storage),o+=S(e.messaging),o+=v(e.cdn),o+=z(e.environment)):o+=I(e),o+=`
|
|
30
31
|
})
|
|
31
32
|
);
|
|
32
33
|
|
|
33
|
-
`,o}export{a as OPENNEXT_DEFAULTS,
|
|
34
|
+
`,o}export{a as OPENNEXT_DEFAULTS,k as generatePatternCodeWithComments};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { planApplicationResources, toUserServiceConfigs, type GenerationOptions, generateInfrastructureFromPlan, } from "./resourcePlanning.js";
|
|
2
2
|
export { type OpenNextResourceOptions, planOpenNextResources, } from "./openNextPlanning.js";
|
|
3
|
+
export { type StaticSiteResourceOptions, planStaticSiteResources, } from "./staticSitePlanning.js";
|
|
3
4
|
export { type ConnectionType, applyComputeConnections, applyServiceConnections, } from "./resourceConnections.js";
|
|
4
5
|
export { type AddableResourceType, type AddResourceOptions, type DatabaseAddOptions, type ProxyAddOptions, type S3AddOptions, type NetworkAddOptions, type EcsComputeAddOptions, type LambdaComputeAddOptions, type CdnAddOptions, type TunnelAddOptions, addResourceToPlan, validateResourceAddition, listAvailableResources, } from "./resourceAddition.js";
|
|
5
6
|
export { type ResourceChangeResult, generateResourceChange, } from "./generateResourceChange.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{planApplicationResources as r,toUserServiceConfigs as
|
|
1
|
+
import{planApplicationResources as r,toUserServiceConfigs as t,generateInfrastructureFromPlan as n}from"./resourcePlanning.js";import{planOpenNextResources as p}from"./openNextPlanning.js";import{planStaticSiteResources as c}from"./staticSitePlanning.js";import{applyComputeConnections as l,applyServiceConnections as u}from"./resourceConnections.js";import{addResourceToPlan as m,validateResourceAddition as x,listAvailableResources as R}from"./resourceAddition.js";import{generateResourceChange as C}from"./generateResourceChange.js";export{m as addResourceToPlan,l as applyComputeConnections,u as applyServiceConnections,n as generateInfrastructureFromPlan,C as generateResourceChange,R as listAvailableResources,r as planApplicationResources,p as planOpenNextResources,c as planStaticSiteResources,t as toUserServiceConfigs,x as validateResourceAddition};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type Result } from "../types/Result.js";
|
|
2
|
+
import type { ApplicationResourcePlan } from "../schemas/resourceSchemas.js";
|
|
3
|
+
import { type StaticSiteBuildConfig, type StaticSiteCdnConfig, type StaticSiteFormsConfig, type StaticSiteRouting, type StaticSiteSecurityConfig } from "../schemas/resourceSchemas.js";
|
|
4
|
+
/**
|
|
5
|
+
* Options for planning a static-site application.
|
|
6
|
+
*
|
|
7
|
+
* A static site is a networkless app (design §13) — it has no tier, database,
|
|
8
|
+
* compute or VPC, so none of the OpenNext tier-preset machinery applies. The
|
|
9
|
+
* plan carries only the pattern config; the CDK `StaticSite` construct owns the
|
|
10
|
+
* private-S3 + CloudFront/OAC topology.
|
|
11
|
+
*/
|
|
12
|
+
export interface StaticSiteResourceOptions {
|
|
13
|
+
/** Repo root the build runs in and assets are uploaded from. */
|
|
14
|
+
source: string;
|
|
15
|
+
/** Build command + output directory (both required — deploy SSoT). */
|
|
16
|
+
build: StaticSiteBuildConfig;
|
|
17
|
+
/** Clean-URL rewriting ("multipage") or SPA fallback ("spa"). */
|
|
18
|
+
routing?: StaticSiteRouting;
|
|
19
|
+
/** Custom domain (auto-creates certificate + DNS). Required for forms. */
|
|
20
|
+
domain?: string;
|
|
21
|
+
/** Security-header configuration. */
|
|
22
|
+
security?: StaticSiteSecurityConfig;
|
|
23
|
+
/** Contact-form configuration (SES-backed Lambda). Requires `domain`. */
|
|
24
|
+
forms?: StaticSiteFormsConfig;
|
|
25
|
+
/** Advanced per-path CDN behaviour passthrough. */
|
|
26
|
+
cdn?: StaticSiteCdnConfig;
|
|
27
|
+
/** Resource tags. */
|
|
28
|
+
tags?: Record<string, string>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Plan the resources for a static-site application.
|
|
32
|
+
*
|
|
33
|
+
* Unlike `planOpenNextResources` there is no tier preset to merge: a
|
|
34
|
+
* static site provisions no database/compute/network, so the plan is just the
|
|
35
|
+
* validated pattern config plus empty resource arrays. Placement onto the CDN
|
|
36
|
+
* stack (rather than a compute stack) is decided later by the factory's
|
|
37
|
+
* `stackPlacement` marker, not here.
|
|
38
|
+
*/
|
|
39
|
+
export declare function planStaticSiteResources(appName: string, options: StaticSiteResourceOptions): Result<ApplicationResourcePlan, Error>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{success as n,failure as c}from"../types/Result.js";import{StaticSitePatternConfigSchema as i}from"../schemas/resourceSchemas.js";function s(t,e){const a={type:"staticsite",name:t,source:e.source,build:e.build,...e.routing!==void 0&&{routing:e.routing},...e.security!==void 0&&{security:e.security},...e.domain!==void 0&&{domain:e.domain},...e.forms!==void 0&&{forms:e.forms},...e.cdn!==void 0&&{cdn:e.cdn}},r=i.safeParse(a);return r.success?n({appName:t,type:"standard",pattern:"staticsite",patternConfig:r.data,database:[],s3:[],compute:[],tags:e.tags??{}}):c(new Error(`Invalid static-site pattern config: ${r.error.message}`))}export{s as planStaticSiteResources};
|
|
@@ -17,6 +17,7 @@ export declare const ApplicationResourcePlanSchema: z.ZodObject<{
|
|
|
17
17
|
pattern: z.ZodOptional<z.ZodEnum<{
|
|
18
18
|
payload: "payload";
|
|
19
19
|
nextjs: "nextjs";
|
|
20
|
+
staticsite: "staticsite";
|
|
20
21
|
}>>;
|
|
21
22
|
patternConfig: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
22
23
|
type: z.ZodLiteral<"payload">;
|
|
@@ -260,6 +261,32 @@ export declare const ApplicationResourcePlanSchema: z.ZodObject<{
|
|
|
260
261
|
certificateArn: z.ZodOptional<z.ZodString>;
|
|
261
262
|
}, z.core.$strict>>;
|
|
262
263
|
environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
264
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
265
|
+
type: z.ZodLiteral<"staticsite">;
|
|
266
|
+
name: z.ZodString;
|
|
267
|
+
source: z.ZodString;
|
|
268
|
+
build: z.ZodObject<{
|
|
269
|
+
command: z.ZodString;
|
|
270
|
+
outputDir: z.ZodString;
|
|
271
|
+
}, z.core.$strict>;
|
|
272
|
+
routing: z.ZodOptional<z.ZodEnum<{
|
|
273
|
+
multipage: "multipage";
|
|
274
|
+
spa: "spa";
|
|
275
|
+
}>>;
|
|
276
|
+
security: z.ZodOptional<z.ZodObject<{
|
|
277
|
+
headers: z.ZodOptional<z.ZodBoolean>;
|
|
278
|
+
contentSecurityPolicy: z.ZodOptional<z.ZodString>;
|
|
279
|
+
}, z.core.$strict>>;
|
|
280
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
281
|
+
forms: z.ZodOptional<z.ZodObject<{
|
|
282
|
+
to: z.ZodString;
|
|
283
|
+
from: z.ZodOptional<z.ZodString>;
|
|
284
|
+
corsOrigin: z.ZodOptional<z.ZodString>;
|
|
285
|
+
maxConcurrency: z.ZodOptional<z.ZodNumber>;
|
|
286
|
+
}, z.core.$strict>>;
|
|
287
|
+
cdn: z.ZodOptional<z.ZodObject<{
|
|
288
|
+
behaviours: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
289
|
+
}, z.core.$strict>>;
|
|
263
290
|
}, z.core.$strict>], "type">>;
|
|
264
291
|
owner: z.ZodOptional<z.ZodString>;
|
|
265
292
|
tags: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
@@ -883,6 +910,7 @@ export declare const ApplicationGeneratorSchema: z.ZodObject<{
|
|
|
883
910
|
pattern: z.ZodOptional<z.ZodEnum<{
|
|
884
911
|
payload: "payload";
|
|
885
912
|
nextjs: "nextjs";
|
|
913
|
+
staticsite: "staticsite";
|
|
886
914
|
}>>;
|
|
887
915
|
patternTier: z.ZodOptional<z.ZodEnum<{
|
|
888
916
|
standard: "standard";
|
|
@@ -891,6 +919,15 @@ export declare const ApplicationGeneratorSchema: z.ZodObject<{
|
|
|
891
919
|
custom: "custom";
|
|
892
920
|
}>>;
|
|
893
921
|
patternDomain: z.ZodOptional<z.ZodString>;
|
|
922
|
+
source: z.ZodOptional<z.ZodString>;
|
|
923
|
+
buildCommand: z.ZodOptional<z.ZodString>;
|
|
924
|
+
outputDir: z.ZodOptional<z.ZodString>;
|
|
925
|
+
routing: z.ZodOptional<z.ZodEnum<{
|
|
926
|
+
multipage: "multipage";
|
|
927
|
+
spa: "spa";
|
|
928
|
+
}>>;
|
|
929
|
+
formsTo: z.ZodOptional<z.ZodString>;
|
|
930
|
+
corsOrigin: z.ZodOptional<z.ZodString>;
|
|
894
931
|
customDatabase: z.ZodOptional<z.ZodObject<{
|
|
895
932
|
type: z.ZodEnum<{
|
|
896
933
|
Aurora: "Aurora";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as o}from"zod";import{VALIDATION_MESSAGES as
|
|
1
|
+
import{z as o}from"zod";import{VALIDATION_MESSAGES as t,VALIDATION_PATTERNS as e}from"../validation/patterns.js";import{AppNameSchema as n,AppTypeSchema as r,PatternSchema as i,CustomCodeBlockSchema as s,BackupConfigSchema as p,TunnelConfigSchema as c,ResourceNameSchema as l}from"./baseSchemas.js";import{DatabaseResourcePlanSchema as u,ClickHouseResourcePlanSchema as S}from"./databaseSchemas.js";import{NetworkResourcePlanSchema as d,AdditionalNetworkResourcePlanSchema as g,NetworkConfigSchema as h}from"./networkSchemas.js";import{S3ResourcePlanSchema as f}from"./storageSchemas.js";import{SQSResourcePlanSchema as R}from"./messagingSchemas.js";import{CDNResourcePlanSchema as A}from"./cdnSchemas.js";import{ComputeResourcePlanSchema as D,ApplicationServiceConfigSchema as E}from"./computeSchemas.js";import{DynamoDBResourcePlanSchema as I}from"./databaseSchemas.js";import{PatternConfigSchema as C,PatternTierSchema as P,StaticSiteRoutingSchema as y,CustomPatternDatabaseSchema as T,CustomPatternComputeSchema as N}from"./patternSchemas.js";const Q=o.object({appName:n,type:r,pattern:i.optional(),patternConfig:C.optional(),owner:o.string().optional(),tags:o.record(o.string(),o.string()).optional(),vpcId:o.string().optional(),network:d.optional(),backup:p.optional(),tunnel:c.optional(),additionalNetworks:o.array(g).optional(),database:o.array(u),s3:o.array(f),compute:o.array(D),dynamodb:o.array(I).optional(),clickhouse:o.array(S).optional(),sqs:o.array(R).optional(),cdn:A.optional(),customCodeBlocks:o.array(s).optional(),additionalManagedImports:o.array(o.object({moduleSpecifier:o.string(),namedImports:o.array(o.string()),defaultImport:o.string().optional()}).strict()).optional()}).strict(),j=o.object({name:n,type:r,pattern:i.optional(),patternTier:P.optional(),patternDomain:o.string().optional(),source:o.string().min(1,t.REQUIRED.SOURCE).optional(),buildCommand:o.string().min(1,t.REQUIRED.BUILD_COMMAND).optional(),outputDir:o.string().min(1,t.REQUIRED.OUTPUT_DIR).optional(),routing:y.optional(),formsTo:o.string().min(1,t.REQUIRED.FORMS_TO).regex(e.EMAIL,t.EMAIL).optional(),corsOrigin:o.string().regex(e.HTTP_ORIGIN,"corsOrigin must be an exact origin such as https://example.com (no path, no trailing slash)").optional(),customDatabase:T.optional(),customCompute:N.optional(),region:o.string().optional(),owner:o.string().optional(),includeDatabase:o.boolean().optional(),databaseName:o.string().min(1,t.DATABASE.NAME.REQUIRED).max(63,t.DATABASE.NAME.MAX_LENGTH).optional(),vpcId:o.string().optional(),network:h.optional(),services:o.array(E).optional(),snapshotIdentifier:o.string().optional(),snapshotUsername:o.string().optional()}).strict().superRefine((a,m)=>{a.formsTo!==void 0&&(a.patternDomain!==void 0&&a.patternDomain!==""||m.addIssue({code:"custom",path:["patternDomain"],message:"A domain is required when forms are enabled: SES sends only from a verified identity, and the site's domain is the identity the pattern verifies"}))}),G=o.object({name:l,localResource:o.string().min(1),remoteApp:o.string().min(1),remoteResource:o.string().min(1),permission:o.enum(["read","write","read-write"]),remoteArn:o.string().optional()}).strict();export{j as ApplicationGeneratorSchema,Q as ApplicationResourcePlanSchema,G as CrossPlanConnectionResourcePlanSchema};
|
|
@@ -47,13 +47,12 @@ export { ECS_CAPACITY_PROVIDERS, type EcsCapacityProvider, } from "./sharedTypes
|
|
|
47
47
|
import type { EcsCapacityProvider } from "./sharedTypes.js";
|
|
48
48
|
export declare const DEFAULT_CAPACITY_PROVIDER: EcsCapacityProvider;
|
|
49
49
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* -
|
|
50
|
+
* The pattern vocabulary and its dispatch registry live in `@fjall/util` — the
|
|
51
|
+
* lowest package every consumer (generator, CDK constructs, deploy-core, CLI)
|
|
52
|
+
* already depends on. Re-exported here so the generator's long-standing
|
|
53
|
+
* `import { PatternType } from "@fjall/generator"` surface is unchanged.
|
|
53
54
|
*/
|
|
54
|
-
export
|
|
55
|
-
export type PatternType = (typeof PATTERN_TYPE_VALUES)[number];
|
|
56
|
-
export declare const PATTERN_TYPES: ReadonlySet<string>;
|
|
55
|
+
export { PATTERN_TYPE_VALUES, type PatternType, PATTERN_TYPES, isPatternType, PATTERN_REGISTRY, type PatternDescriptor, type PatternArtefact, type PatternStackPlacement, OPENNEXT_PATTERN_TYPES, type OpenNextPatternType, isOpenNextPatternType, } from "@fjall/util";
|
|
57
56
|
export { APP_TYPES, CUSTOM_TIER, type AppType } from "./sharedTypes.js";
|
|
58
57
|
export declare const EC2_INSTANCE_TYPES: readonly ["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"];
|
|
59
58
|
export type EC2InstanceType = (typeof EC2_INSTANCE_TYPES)[number];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a=Object.freeze({RESOURCE_SUFFIXES:Object.freeze({storage:"Storage",database:"Database",cluster:"Cluster",function:"Function",instance:"Instance",compute:"Compute"})});import{DATABASE_TYPES as z}from"./sharedTypes.js";const t=["ecs","lambda","ec2"],g=Object.freeze({ECS:"ecs",LAMBDA:"lambda",EC2:"ec2"}),x=["code","container"],o=Object.freeze({CODE:"code",CONTAINER:"container"}),l=["ARM_64","X86_64"],E="ARM_64",T=["NONE","AWS_IAM"],A=["public","internal"],c=["CPU","MEMORY"],_=["ARM","STANDARD"],n=["Instance","Aurora"],s=["postgresql","mysql"],P=["foundation","compliance","hardened"];import{ECS_CAPACITY_PROVIDERS as q}from"./sharedTypes.js";const S="FARGATE";import{PATTERN_TYPE_VALUES as K,PATTERN_TYPES as Z,isPatternType as h,PATTERN_REGISTRY as w,OPENNEXT_PATTERN_TYPES as k,isOpenNextPatternType as v}from"@fjall/util";import{APP_TYPES as Q,CUSTOM_TIER as $}from"./sharedTypes.js";const p=["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"],O=[0,1,5,10,15,30,60];function R(e,r){return e.includes(r)}const N=1,m=65535,C=Object.freeze({postgresql:5432,mysql:3306}),I=128,M=10240,D=1,Y=900,L=1,i=1e3,U=100,d=100,u=1,f=!1,F=3e3,b="t4g.micro",B=30,G=["GET","POST","PUT","DELETE","HEAD","OPTIONS","PATCH"],X=["standard","assets","upload","website"],H=["AES256","KMS"];import{BACKUP_VAULT_TIERS as re}from"./sharedTypes.js";export{_ as AMI_HARDWARE_TYPES,Q as APP_TYPES,re as BACKUP_VAULT_TIERS,l as COMPUTE_ARCHITECTURES,g as COMPUTE_TYPE,t as COMPUTE_TYPES,$ as CUSTOM_TIER,s as DATABASE_ENGINES,z as DATABASE_TYPES,a as DEFAULTS,S as DEFAULT_CAPACITY_PROVIDER,E as DEFAULT_COMPUTE_ARCHITECTURE,F as DEFAULT_CONTAINER_PORT,b as DEFAULT_EC2_INSTANCE_TYPE,B as DEFAULT_SECRET_ROTATION_DAYS,u as DEFAULT_WARM_POOL_MIN_SIZE,f as DEFAULT_WARM_POOL_REUSE_ON_SCALE_IN,o as DEPLOYMENT_TYPE,x as DEPLOYMENT_TYPES,p as EC2_INSTANCE_TYPES,q as ECS_CAPACITY_PROVIDERS,C as ENGINE_DEFAULT_DATABASE_PORTS,T as FUNCTION_URL_AUTH_TYPES,P as GOVERNANCE_PRESETS,G as HTTP_METHODS,A as LOAD_BALANCER_TYPES,i as MAX_ECS_CAPACITY,M as MAX_LAMBDA_MEMORY,Y as MAX_LAMBDA_TIMEOUT,m as MAX_PORT,U as MAX_SCALING_CAPACITY,d as MAX_WARM_POOL_SIZE,L as MIN_ECS_CAPACITY,I as MIN_LAMBDA_MEMORY,D as MIN_LAMBDA_TIMEOUT,N as MIN_PORT,k as OPENNEXT_PATTERN_TYPES,n as PATTERN_DATABASE_TYPES,w as PATTERN_REGISTRY,Z as PATTERN_TYPES,K as PATTERN_TYPE_VALUES,H as S3_ENCRYPTION_TYPES,c as SCALING_TYPES,X as STORAGE_PRESET_TYPES,O as VALID_MONITORING_INTERVALS,R as constIncludes,v as isOpenNextPatternType,h as isPatternType};
|
|
@@ -411,6 +411,96 @@ export declare const NextJSPatternConfigSchema: z.ZodObject<{
|
|
|
411
411
|
}, z.core.$strict>>;
|
|
412
412
|
environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
413
413
|
}, z.core.$strict>;
|
|
414
|
+
/**
|
|
415
|
+
* Routing mode for a static site: "multipage" (clean-URL `.html` rewriting)
|
|
416
|
+
* or "spa" (single-page-app fallback to index.html). The accept-set is derived
|
|
417
|
+
* from `@fjall/util` — the CDN construct reads the same tuple, so a third mode
|
|
418
|
+
* cannot be added to one side alone.
|
|
419
|
+
*/
|
|
420
|
+
export declare const StaticSiteRoutingSchema: z.ZodEnum<{
|
|
421
|
+
multipage: "multipage";
|
|
422
|
+
spa: "spa";
|
|
423
|
+
}>;
|
|
424
|
+
export type StaticSiteRouting = z.infer<typeof StaticSiteRoutingSchema>;
|
|
425
|
+
/**
|
|
426
|
+
* Build configuration — the single source of truth read by both the CDK
|
|
427
|
+
* construct (`outputDir` is uploaded) and the deploy-core builder (`command`
|
|
428
|
+
* runs in `source`). Both fields are required.
|
|
429
|
+
*/
|
|
430
|
+
export declare const StaticSiteBuildConfigSchema: z.ZodObject<{
|
|
431
|
+
command: z.ZodString;
|
|
432
|
+
outputDir: z.ZodString;
|
|
433
|
+
}, z.core.$strict>;
|
|
434
|
+
export type StaticSiteBuildConfig = z.infer<typeof StaticSiteBuildConfigSchema>;
|
|
435
|
+
/**
|
|
436
|
+
* Security-header configuration for a static site.
|
|
437
|
+
*/
|
|
438
|
+
export declare const StaticSiteSecurityConfigSchema: z.ZodObject<{
|
|
439
|
+
headers: z.ZodOptional<z.ZodBoolean>;
|
|
440
|
+
contentSecurityPolicy: z.ZodOptional<z.ZodString>;
|
|
441
|
+
}, z.core.$strict>;
|
|
442
|
+
export type StaticSiteSecurityConfig = z.infer<typeof StaticSiteSecurityConfigSchema>;
|
|
443
|
+
/**
|
|
444
|
+
* Contact-form configuration. Requires a custom `domain`: SES may only send
|
|
445
|
+
* *from* a verified identity, and the site's domain is the identity the pattern
|
|
446
|
+
* verifies.
|
|
447
|
+
*
|
|
448
|
+
* `to` and `from` are separate axes and must not be conflated. `to` is where
|
|
449
|
+
* submissions land and is unconstrained — a personal Gmail address is the
|
|
450
|
+
* common case. `from` is the envelope sender and MUST sit at the verified
|
|
451
|
+
* domain; it defaults to `noreply@<domain>`. The submitter's own address goes
|
|
452
|
+
* in Reply-To at send time, so replying from the inbox reaches them.
|
|
453
|
+
*/
|
|
454
|
+
export declare const StaticSiteFormsConfigSchema: z.ZodObject<{
|
|
455
|
+
to: z.ZodString;
|
|
456
|
+
from: z.ZodOptional<z.ZodString>;
|
|
457
|
+
corsOrigin: z.ZodOptional<z.ZodString>;
|
|
458
|
+
maxConcurrency: z.ZodOptional<z.ZodNumber>;
|
|
459
|
+
}, z.core.$strict>;
|
|
460
|
+
export type StaticSiteFormsConfig = z.infer<typeof StaticSiteFormsConfigSchema>;
|
|
461
|
+
/**
|
|
462
|
+
* CDN configuration for a static site — advanced per-path override passthrough.
|
|
463
|
+
* `behaviours` mirror the CDK `SmartCdnBehaviour[]` escape hatch; they are
|
|
464
|
+
* captured and re-emitted verbatim rather than modelled field-by-field.
|
|
465
|
+
*/
|
|
466
|
+
export declare const StaticSiteCdnConfigSchema: z.ZodObject<{
|
|
467
|
+
behaviours: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
468
|
+
}, z.core.$strict>;
|
|
469
|
+
export type StaticSiteCdnConfig = z.infer<typeof StaticSiteCdnConfigSchema>;
|
|
470
|
+
/**
|
|
471
|
+
* Static-site pattern configuration.
|
|
472
|
+
*
|
|
473
|
+
* Serves a pre-built folder from a private S3 bucket behind CloudFront with
|
|
474
|
+
* OAC. No compute/database/network — a static site is its own networkless app.
|
|
475
|
+
*/
|
|
476
|
+
export declare const StaticSitePatternConfigSchema: z.ZodObject<{
|
|
477
|
+
type: z.ZodLiteral<"staticsite">;
|
|
478
|
+
name: z.ZodString;
|
|
479
|
+
source: z.ZodString;
|
|
480
|
+
build: z.ZodObject<{
|
|
481
|
+
command: z.ZodString;
|
|
482
|
+
outputDir: z.ZodString;
|
|
483
|
+
}, z.core.$strict>;
|
|
484
|
+
routing: z.ZodOptional<z.ZodEnum<{
|
|
485
|
+
multipage: "multipage";
|
|
486
|
+
spa: "spa";
|
|
487
|
+
}>>;
|
|
488
|
+
security: z.ZodOptional<z.ZodObject<{
|
|
489
|
+
headers: z.ZodOptional<z.ZodBoolean>;
|
|
490
|
+
contentSecurityPolicy: z.ZodOptional<z.ZodString>;
|
|
491
|
+
}, z.core.$strict>>;
|
|
492
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
493
|
+
forms: z.ZodOptional<z.ZodObject<{
|
|
494
|
+
to: z.ZodString;
|
|
495
|
+
from: z.ZodOptional<z.ZodString>;
|
|
496
|
+
corsOrigin: z.ZodOptional<z.ZodString>;
|
|
497
|
+
maxConcurrency: z.ZodOptional<z.ZodNumber>;
|
|
498
|
+
}, z.core.$strict>>;
|
|
499
|
+
cdn: z.ZodOptional<z.ZodObject<{
|
|
500
|
+
behaviours: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
501
|
+
}, z.core.$strict>>;
|
|
502
|
+
}, z.core.$strict>;
|
|
503
|
+
export type StaticSitePatternConfig = z.infer<typeof StaticSitePatternConfigSchema>;
|
|
414
504
|
/**
|
|
415
505
|
* Pattern configuration discriminated union.
|
|
416
506
|
* Extensible for future patterns (Remix, etc.)
|
|
@@ -657,6 +747,32 @@ export declare const PatternConfigSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
657
747
|
certificateArn: z.ZodOptional<z.ZodString>;
|
|
658
748
|
}, z.core.$strict>>;
|
|
659
749
|
environment: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
750
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
751
|
+
type: z.ZodLiteral<"staticsite">;
|
|
752
|
+
name: z.ZodString;
|
|
753
|
+
source: z.ZodString;
|
|
754
|
+
build: z.ZodObject<{
|
|
755
|
+
command: z.ZodString;
|
|
756
|
+
outputDir: z.ZodString;
|
|
757
|
+
}, z.core.$strict>;
|
|
758
|
+
routing: z.ZodOptional<z.ZodEnum<{
|
|
759
|
+
multipage: "multipage";
|
|
760
|
+
spa: "spa";
|
|
761
|
+
}>>;
|
|
762
|
+
security: z.ZodOptional<z.ZodObject<{
|
|
763
|
+
headers: z.ZodOptional<z.ZodBoolean>;
|
|
764
|
+
contentSecurityPolicy: z.ZodOptional<z.ZodString>;
|
|
765
|
+
}, z.core.$strict>>;
|
|
766
|
+
domain: z.ZodOptional<z.ZodString>;
|
|
767
|
+
forms: z.ZodOptional<z.ZodObject<{
|
|
768
|
+
to: z.ZodString;
|
|
769
|
+
from: z.ZodOptional<z.ZodString>;
|
|
770
|
+
corsOrigin: z.ZodOptional<z.ZodString>;
|
|
771
|
+
maxConcurrency: z.ZodOptional<z.ZodNumber>;
|
|
772
|
+
}, z.core.$strict>>;
|
|
773
|
+
cdn: z.ZodOptional<z.ZodObject<{
|
|
774
|
+
behaviours: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
775
|
+
}, z.core.$strict>>;
|
|
660
776
|
}, z.core.$strict>], "type">;
|
|
661
777
|
/**
|
|
662
778
|
* Pattern tier schema for OpenNext patterns (Payload, Next.js).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as
|
|
1
|
+
import{z as t}from"zod";import{VALIDATION_MESSAGES as o,VALIDATION_PATTERNS as n}from"../validation/patterns.js";import{BackupRetentionSchema as c,MonitoringIntervalSchema as T,DatabasePortSchema as u,ProxyConfigOrFalseSchema as R,ReadReplicaConfigOrFalseSchema as M,AuroraWriterConfigSchema as b,AuroraReadersConfigOrFalseSchema as f,DatabaseInsightsConfigOrFalseSchema as h,CredentialsConfigSchema as N,EncryptionConfigSchema as C}from"./databaseSchemas.js";import{LambdaMemorySchema as l}from"./computeSchemas.js";import{PATTERN_DATABASE_TYPES as p,DATABASE_ENGINES as O}from"./constants.js";import{STATIC_SITE_ROUTING_VALUES as _,isAddressAtDomain as x}from"@fjall/util";const a=t.object({memorySize:l.optional(),timeout:t.number().int(o.LAMBDA.TIMEOUT.INTEGER).min(1,o.LAMBDA.TIMEOUT.MIN).max(900,o.LAMBDA.TIMEOUT.MAX).optional(),ephemeralStorageSize:t.number().int(o.EPHEMERAL_STORAGE.INTEGER).min(512,o.EPHEMERAL_STORAGE.MIN).max(10240,o.EPHEMERAL_STORAGE.MAX).optional()}).strict(),E=t.object({type:t.enum(p).optional(),databaseName:t.string().optional(),databaseEngine:t.enum(O).optional(),deletionProtection:t.boolean().optional(),backupRetention:c.optional(),port:u.optional(),publiclyAccessible:t.boolean().optional(),allowedIpCidr:t.string().optional(),instanceType:t.string().optional(),allocatedStorage:t.number().int(o.ALLOCATED_STORAGE.INTEGER).min(20,o.ALLOCATED_STORAGE.MIN).max(65536,o.ALLOCATED_STORAGE.MAX).optional(),multiAz:t.boolean().optional(),readReplica:M.optional(),writer:b.optional(),readers:f.optional(),allowVpcAccess:t.boolean().optional(),monitoringInterval:T.optional(),preferredMaintenanceWindow:t.string().optional(),databaseInsights:h.optional(),proxy:R.optional(),credentials:N.optional(),encryption:C.optional(),snapshotIdentifier:t.string().optional(),snapshotUsername:t.string().optional()}).strict(),S=t.object({server:a.optional(),imageOptimisation:a.optional(),revalidation:a.optional()}).strict(),r=t.object({versioned:t.boolean().optional()}).strict(),d=t.object({assets:r.optional(),cache:r.optional(),media:r.optional()}).strict(),y=t.object({visibilityTimeout:t.number().int(o.SQS.VISIBILITY_TIMEOUT.INTEGER).min(0,o.SQS.VISIBILITY_TIMEOUT.MIN).max(43200,o.SQS.VISIBILITY_TIMEOUT.MAX).optional(),messageRetentionPeriod:t.number().int(o.SQS.RETENTION_PERIOD.INTEGER).min(60,o.SQS.RETENTION_PERIOD.MIN).max(1209600,o.SQS.RETENTION_PERIOD.MAX).optional(),maxMessageSize:t.number().int(o.MAX_MESSAGE_SIZE.INTEGER).min(1024,o.MAX_MESSAGE_SIZE.MIN).max(262144,o.MAX_MESSAGE_SIZE.MAX).optional(),deadLetterQueue:t.union([t.literal(!1),t.object({enabled:t.boolean().optional(),maxReceiveCount:t.number().int(o.DLQ.MAX_RECEIVE_COUNT.INTEGER).min(1,o.DLQ.MAX_RECEIVE_COUNT.MIN).max(1e3,o.DLQ.MAX_RECEIVE_COUNT.MAX).optional()}).strict()]).optional()}).strict(),A=t.object({revalidationQueue:y.optional()}).strict(),I=t.object({domainNames:t.array(t.string()).optional(),certificateArn:t.string().optional()}).strict(),g=t.record(t.string().regex(n.ENV_VAR_NAME,o.ENV_VAR_NAME),t.string()).optional(),P=t.object({type:t.literal("payload"),name:t.string().min(1,o.REQUIRED.PATTERN_NAME),domain:t.string().optional(),database:E.optional(),compute:S.optional(),storage:d.optional(),messaging:A.optional(),cdn:I.optional(),environment:g}).strict(),D=t.object({type:t.literal("nextjs"),name:t.string().min(1,o.REQUIRED.PATTERN_NAME),domain:t.string().optional(),database:E.optional(),compute:S.optional(),storage:d.optional(),messaging:A.optional(),cdn:I.optional(),environment:g}).strict(),L=t.enum(_),U=t.object({command:t.string().min(1,o.REQUIRED.BUILD_COMMAND),outputDir:t.string().min(1,o.REQUIRED.OUTPUT_DIR)}).strict(),G=t.object({headers:t.boolean().optional(),contentSecurityPolicy:t.string().optional()}).strict(),j=t.object({to:t.string().min(1,o.REQUIRED.FORMS_TO).regex(n.EMAIL,o.EMAIL),from:t.string().regex(n.EMAIL,o.EMAIL).optional(),corsOrigin:t.string().regex(n.HTTP_ORIGIN,"corsOrigin must be an exact origin such as https://example.com (no path, no trailing slash)").optional(),maxConcurrency:t.number().int().min(1).max(100).optional()}).strict(),Q=t.object({behaviours:t.array(t.unknown()).optional()}).strict(),v=t.object({type:t.literal("staticsite"),name:t.string().min(1,o.REQUIRED.PATTERN_NAME),source:t.string().min(1,o.REQUIRED.SOURCE),build:U,routing:L.optional(),security:G.optional(),domain:t.string().optional(),forms:j.optional(),cdn:Q.optional()}).strict().superRefine((i,s)=>{if(i.forms===void 0)return;const e=i.domain;if(e===void 0||e===""){s.addIssue({code:"custom",path:["domain"],message:"A domain is required when forms are enabled: SES sends only from a verified identity, and the site's domain is the identity the pattern verifies"});return}const m=i.forms.from;m!==void 0&&!x(m,e)&&s.addIssue({code:"custom",path:["forms","from"],message:`forms.from must be an address at ${e} (the verified SES identity) \u2014 for example noreply@${e}. Use forms.to for the recipient.`})}),k=t.discriminatedUnion("type",[P,D,v]),H=t.enum(["lightweight","standard","resilient","custom"]),Y=t.object({type:t.enum(p),instanceType:t.string().optional(),backupRetention:c.optional(),deletionProtection:t.boolean().optional(),encryption:t.union([t.object({useCMK:t.literal(!0)}).strict(),t.literal(!1)]).optional()}).strict(),Z=t.object({memorySize:l.optional(),timeout:t.number().int(o.LAMBDA.TIMEOUT.INTEGER).min(1,o.LAMBDA.TIMEOUT.MIN).max(900,o.LAMBDA.TIMEOUT.MAX).optional()}).strict();export{Z as CustomPatternComputeSchema,Y as CustomPatternDatabaseSchema,D as NextJSPatternConfigSchema,k as PatternConfigSchema,a as PatternLambdaConfigSchema,y as PatternQueueConfigSchema,r as PatternStorageBucketConfigSchema,H as PatternTierSchema,I as PayloadCdnConfigSchema,S as PayloadComputeConfigSchema,E as PayloadDatabaseConfigSchema,A as PayloadMessagingConfigSchema,P as PayloadPatternConfigSchema,d as PayloadStorageConfigSchema,U as StaticSiteBuildConfigSchema,Q as StaticSiteCdnConfigSchema,j as StaticSiteFormsConfigSchema,v as StaticSitePatternConfigSchema,L as StaticSiteRoutingSchema,G as StaticSiteSecurityConfigSchema};
|
|
@@ -29,6 +29,10 @@ export declare const VALIDATION_MESSAGES: Readonly<{
|
|
|
29
29
|
readonly CONTAINER_NAME: "Container name is required";
|
|
30
30
|
readonly GROUP: "Group is required";
|
|
31
31
|
readonly PATTERN_NAME: "Pattern name is required";
|
|
32
|
+
readonly SOURCE: "Source directory is required";
|
|
33
|
+
readonly BUILD_COMMAND: "Build command is required";
|
|
34
|
+
readonly OUTPUT_DIR: "Output directory is required";
|
|
35
|
+
readonly FORMS_TO: "Forms recipient address is required";
|
|
32
36
|
readonly ROUTING_PATH: "Routing path is required";
|
|
33
37
|
readonly RESOURCE_REFERENCE: "Resource reference is required";
|
|
34
38
|
readonly RESOURCE_TYPE: "Resource type is required";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SECRET_NAME_ERROR as e,SSM_COMPONENT_ERROR as t}from"@fjall/util";const n=Object.freeze({IDENTIFIER:"Must start with a letter, contain only letters, numbers, and hyphens",NEW_APP_NAME:"Must start with a lowercase letter and contain only lowercase 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:e,SSM_COMPONENT:t,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",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{n as VALIDATION_MESSAGES};
|
|
1
|
+
import{SECRET_NAME_ERROR as e,SSM_COMPONENT_ERROR as t}from"@fjall/util";const n=Object.freeze({IDENTIFIER:"Must start with a letter, contain only letters, numbers, and hyphens",NEW_APP_NAME:"Must start with a lowercase letter and contain only lowercase 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:e,SSM_COMPONENT:t,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",GROUP:"Group is required",PATTERN_NAME:"Pattern name is required",SOURCE:"Source directory is required",BUILD_COMMAND:"Build command is required",OUTPUT_DIR:"Output directory is required",FORMS_TO:"Forms recipient address 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{n as VALIDATION_MESSAGES};
|
|
@@ -12,6 +12,7 @@ export declare const VALIDATION_PATTERNS: Readonly<{
|
|
|
12
12
|
readonly EMAIL: RegExp;
|
|
13
13
|
readonly DOCKER_IMAGE: RegExp;
|
|
14
14
|
readonly DOMAIN: RegExp;
|
|
15
|
+
readonly HTTP_ORIGIN: RegExp;
|
|
15
16
|
readonly PASCAL_CASE: RegExp;
|
|
16
17
|
readonly AWS_ACCOUNT_ID: RegExp;
|
|
17
18
|
readonly VPC_ID: RegExp;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{SECRET_NAME_PATTERN as
|
|
1
|
+
import{SECRET_NAME_PATTERN as s,SSM_COMPONENT_PATTERN as A}from"@fjall/util";const _=/^[a-zA-Z][a-zA-Z0-9-]*$/,u=A.source.replace(/^\^|\$$/g,""),i=Object.freeze({IDENTIFIER:_,NEW_APP_NAME:/^[a-z][a-z0-9-]*$/,RESOURCE_NAME:/^[a-zA-Z][a-zA-Z0-9]*$/,ECS_SERVICE_NAME:_,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:new RegExp(`^(?:/${u})+$`),SECRET_NAME:s,SSM_COMPONENT:A,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,HTTP_ORIGIN:/^https?:\/\/[a-z0-9.-]+(:\d+)?$/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 z(t){const a=/^rate\((\d+) (minute|minutes|hour|hours|day|days)\)$/.exec(t);if(!a)return;const n=a[1],e=a[2];if(n===void 0||e===void 0)return;const E=parseInt(n,10);if(!Number.isFinite(E)||E<1)return;const r=e==="minute"||e==="hour"||e==="day";if(!(r&&E!==1)&&!(!r&&E===1))return e==="minute"||e==="minutes"?{everyMs:E*6e4}:e==="hour"||e==="hours"?{everyMs:E*60*6e4}:{everyMs:E*24*60*6e4}}export{i as VALIDATION_PATTERNS,z as parseRateExpression};
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const GENERATOR_VERSION = "2.
|
|
1
|
+
export declare const GENERATOR_VERSION = "2.30.3";
|
package/dist/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const E="2.
|
|
1
|
+
const E="2.30.3";export{E as GENERATOR_VERSION};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fjall/generator",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.30.3",
|
|
4
4
|
"description": "Pure infrastructure generation logic for Fjall",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"scripts": {
|
|
33
33
|
"clean": "rm -rf ./dist ./sourcemaps",
|
|
34
34
|
"build": "npm run clean && tsc && node ../scripts/minify-dist.mjs dist",
|
|
35
|
+
"prepack": "node ../scripts/check-dist-freshness.mjs",
|
|
35
36
|
"watch": "npm run build && tsc --watch --preserveWatchOutput",
|
|
36
37
|
"watch:only": "tsc --watch --preserveWatchOutput",
|
|
37
38
|
"typecheck": "tsc --noEmit",
|
|
@@ -47,7 +48,7 @@
|
|
|
47
48
|
},
|
|
48
49
|
"license": "SEE LICENSE IN LICENSE",
|
|
49
50
|
"dependencies": {
|
|
50
|
-
"@fjall/util": "^2.
|
|
51
|
+
"@fjall/util": "^2.30.3",
|
|
51
52
|
"ast-types": "^0.16.1",
|
|
52
53
|
"recast": "^0.23.11",
|
|
53
54
|
"ts-morph": "^28.0.0",
|
|
@@ -63,5 +64,5 @@
|
|
|
63
64
|
"typescript-eslint": "^8.59.1",
|
|
64
65
|
"vitest": "^4.1.5"
|
|
65
66
|
},
|
|
66
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "d398edc0c0edf661d7ab6e5a47623529f68dfd2a"
|
|
67
68
|
}
|