@fjall/generator 16.0.1 → 18.0.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/.build-source-hash +16 -16
- package/dist/.minified +1 -1
- package/dist/src/ast/astTestHelpers.d.ts +4 -0
- package/dist/src/ast/domain/astDomainParser.d.ts +1 -0
- package/dist/src/ast/domain/astDomainParser.js +1 -1
- package/dist/src/ast/parsers/resources/astClickHouseParser.d.ts +4 -0
- package/dist/src/ast/parsers/resources/astClickHouseParser.js +1 -1
- package/dist/src/dns/bindParser.d.ts +0 -10
- package/dist/src/dns/bindParser.js +2 -2
- package/dist/src/dns/domainRecords.d.ts +4 -0
- package/dist/src/dns/domainRecords.js +1 -1
- package/dist/src/dns/index.d.ts +1 -1
- package/dist/src/dns/index.js +1 -1
- package/dist/src/dns/tsEmitter.js +1 -1
- package/dist/src/generation/database.js +24 -20
- package/dist/src/planning/planBuilders.js +1 -1
- package/dist/src/presets/clickhouseTierPreset.d.ts +13 -2
- package/dist/src/presets/tierPresets.js +1 -1
- package/dist/src/schemas/applicationSchemas.d.ts +4 -0
- package/dist/src/schemas/databaseSchemas.d.ts +86 -4
- package/dist/src/schemas/databaseSchemas.js +1 -1
- package/dist/src/validation/validationMessages.d.ts +21 -1
- package/dist/src/validation/validationMessages.js +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/package.json +2 -2
package/dist/.build-source-hash
CHANGED
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
"package.json",
|
|
10
10
|
"tsconfig.json"
|
|
11
11
|
],
|
|
12
|
-
"hash": "
|
|
12
|
+
"hash": "35b7c1ecdcc2b19211b80ec98d9f69ce5bf68f428dfa9d422cb9b8597ad94939",
|
|
13
13
|
"files": {
|
|
14
14
|
"src/ast/astTestHelpers.ts": "026cac849eb88bdb",
|
|
15
|
-
"src/ast/domain/astDomainParser.ts": "
|
|
15
|
+
"src/ast/domain/astDomainParser.ts": "a88b990396db0a46",
|
|
16
16
|
"src/ast/index.ts": "48c73220502e5201",
|
|
17
17
|
"src/ast/mutation/astCodeInjection.ts": "c1ebf483fb1e2332",
|
|
18
18
|
"src/ast/mutation/astExpressionEvaluator.ts": "6082789268b91212",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"src/ast/parsers/orchestrator/astInfrastructureParser.ts": "07fd7a94796ebf5f",
|
|
24
24
|
"src/ast/parsers/orchestrator/astPlanConverter.ts": "8e8ceedc328f4181",
|
|
25
25
|
"src/ast/parsers/resources/astCdnParser.ts": "726b298b0b580d68",
|
|
26
|
-
"src/ast/parsers/resources/astClickHouseParser.ts": "
|
|
26
|
+
"src/ast/parsers/resources/astClickHouseParser.ts": "52dda31086619b09",
|
|
27
27
|
"src/ast/parsers/resources/astComputeConnectionParser.ts": "e0f1533845f3ce8a",
|
|
28
28
|
"src/ast/parsers/resources/astComputeParser.ts": "8caa5cc22af1913a",
|
|
29
29
|
"src/ast/parsers/resources/astComputeParserHelpers.ts": "4763a0f0afbd4880",
|
|
@@ -112,12 +112,12 @@
|
|
|
112
112
|
"src/codemod/validationGate/index.ts": "bbe1f460330a11cf",
|
|
113
113
|
"src/codemod/validationGate/types.ts": "4a1cfa054e3383d5",
|
|
114
114
|
"src/detection/index.ts": "b4ad9a935564cb3e",
|
|
115
|
-
"src/dns/bindParser.ts": "
|
|
115
|
+
"src/dns/bindParser.ts": "2b463c4dd1395ae5",
|
|
116
116
|
"src/dns/bindWriter.ts": "c296911ce5aef77c",
|
|
117
117
|
"src/dns/domainFileGenerator.ts": "cb03cd1a6b1bf452",
|
|
118
|
-
"src/dns/domainRecords.ts": "
|
|
119
|
-
"src/dns/index.ts": "
|
|
120
|
-
"src/dns/tsEmitter.ts": "
|
|
118
|
+
"src/dns/domainRecords.ts": "8bdfcb0b3b32a000",
|
|
119
|
+
"src/dns/index.ts": "5a0173ea07707af3",
|
|
120
|
+
"src/dns/tsEmitter.ts": "8e56a893773c1c07",
|
|
121
121
|
"src/dns/types.ts": "82d6db9d7d26dbc2",
|
|
122
122
|
"src/generation/common.ts": "50bbd875b9dd737e",
|
|
123
123
|
"src/generation/compute.ts": "068f6fa241838b25",
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
"src/generation/compute/lambda.ts": "932a45cdc26a5730",
|
|
127
127
|
"src/generation/compute/shared.ts": "3724d4bfe92cfcb7",
|
|
128
128
|
"src/generation/connectionWiring.ts": "9afb0227f2584ab2",
|
|
129
|
-
"src/generation/database.ts": "
|
|
129
|
+
"src/generation/database.ts": "c28a0dbabf91b6a3",
|
|
130
130
|
"src/generation/generatePatternCode.ts": "afed698418d90aee",
|
|
131
131
|
"src/generation/index.ts": "915500e352c2bab6",
|
|
132
132
|
"src/generation/infrastructure.ts": "0ac7c1954a02b2cc",
|
|
@@ -139,16 +139,16 @@
|
|
|
139
139
|
"src/planning/generateResourceChange.ts": "1c6411f9a12e7acb",
|
|
140
140
|
"src/planning/index.ts": "8ef807b31c43310c",
|
|
141
141
|
"src/planning/openNextPlanning.ts": "4af9cb9061f7d21e",
|
|
142
|
-
"src/planning/planBuilders.ts": "
|
|
142
|
+
"src/planning/planBuilders.ts": "2c5a92dbaab57e1d",
|
|
143
143
|
"src/planning/resourceAddition.ts": "7d0320620a74fdcd",
|
|
144
144
|
"src/planning/resourceConnections.ts": "a6b7db8f733e560f",
|
|
145
145
|
"src/planning/resourcePlanning.ts": "d6bb9fa8e1419908",
|
|
146
146
|
"src/planning/staticSitePlanning.ts": "242af1e9618821ab",
|
|
147
|
-
"src/presets/clickhouseTierPreset.ts": "
|
|
147
|
+
"src/presets/clickhouseTierPreset.ts": "1758d991c81d769a",
|
|
148
148
|
"src/presets/index.ts": "8332c0198b2a6fe9",
|
|
149
149
|
"src/presets/patternTierPresets.ts": "f4fc368fc623aae4",
|
|
150
150
|
"src/presets/storagePresets.ts": "5df2d4d7d21a66d8",
|
|
151
|
-
"src/presets/tierPresets.ts": "
|
|
151
|
+
"src/presets/tierPresets.ts": "d1a43f07288b4012",
|
|
152
152
|
"src/presets/tierTypes.ts": "6526373876daacf0",
|
|
153
153
|
"src/projection/compute.ts": "66ea8ee6011ad615",
|
|
154
154
|
"src/projection/index.ts": "3ddb1d53f5781805",
|
|
@@ -164,7 +164,7 @@
|
|
|
164
164
|
"src/schemas/cdnSchemas.ts": "16784f15894c62ba",
|
|
165
165
|
"src/schemas/computeSchemas.ts": "7105193fd34c8bcb",
|
|
166
166
|
"src/schemas/constants.ts": "b0abe53d7a42feb0",
|
|
167
|
-
"src/schemas/databaseSchemas.ts": "
|
|
167
|
+
"src/schemas/databaseSchemas.ts": "7d33a96789cbfdb5",
|
|
168
168
|
"src/schemas/devRolePolicies.ts": "6ca70fb20f5fbebc",
|
|
169
169
|
"src/schemas/index.ts": "a1500a885048074b",
|
|
170
170
|
"src/schemas/instanceTypeArchitecture.ts": "6bf38031a54a4620",
|
|
@@ -179,13 +179,13 @@
|
|
|
179
179
|
"src/types/Result.ts": "6a078a91fc3072e3",
|
|
180
180
|
"src/util/errorUtils.ts": "c021c57804424a5d",
|
|
181
181
|
"src/validation/patterns.ts": "f9629eafdad7ac3e",
|
|
182
|
-
"src/validation/validationMessages.ts": "
|
|
182
|
+
"src/validation/validationMessages.ts": "d08297f78d39f57c",
|
|
183
183
|
"src/validation/validationPatterns.ts": "865f3d688975b7c8",
|
|
184
|
-
"src/version.ts": "
|
|
184
|
+
"src/version.ts": "7e417d9ccd9cddc9",
|
|
185
185
|
"../scripts/minify-dist.mjs": "6b2e4b0df8aec601",
|
|
186
|
-
"package.json": "
|
|
186
|
+
"package.json": "206bde701cfbbe55",
|
|
187
187
|
"tsconfig.json": "1929cf3f99fe9b1e"
|
|
188
188
|
},
|
|
189
|
-
"outputHash": "
|
|
189
|
+
"outputHash": "25b64dc189ffa3b615648307935c3c2c8d3ce5f3410edf70b62dfee314c4f164",
|
|
190
190
|
"outputFileCount": 343
|
|
191
191
|
}
|
package/dist/.minified
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
171 files minified at 2026-08-
|
|
1
|
+
171 files minified at 2026-08-23T08:31:45.330Z
|
|
@@ -677,11 +677,15 @@ export declare function parseAndConvert(code: string): {
|
|
|
677
677
|
type: "ClickHouse";
|
|
678
678
|
databaseName: string;
|
|
679
679
|
instanceType?: string | undefined;
|
|
680
|
+
storageGb?: number | undefined;
|
|
681
|
+
iops?: number | undefined;
|
|
682
|
+
throughputMbps?: number | undefined;
|
|
680
683
|
coldTier?: false | {
|
|
681
684
|
mode: "s3";
|
|
682
685
|
} | undefined;
|
|
683
686
|
optimiseSchedule?: string | false | undefined;
|
|
684
687
|
backupSchedule?: string | false | undefined;
|
|
688
|
+
backupVerify?: false | undefined;
|
|
685
689
|
backupRetentionDays?: number | undefined;
|
|
686
690
|
variableName?: string | undefined;
|
|
687
691
|
extraProperties?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var T=Object.defineProperty;var u=(n,e)=>T(n,"name",{value:e,configurable:!0});import*as m from"typescript";import{parseObjectLiteral as E,asString as f,asStringUnion as h,asStringArray as k,asBoolean as D,asNumber as L,isCallRef as j,isParsedObject as S}from"../parsers/common/astCommonParser.js";import{success as l,failure as a}from"../../types/Result.js";import{DnsRecordTypeSchema as O}from"../../dns/types.js";import{DomainRegistrarSchema as C,DomainDeployPhaseSchema as Z,AliasRecordTypeSchema as F,RecordConstructIdSchema as V,RecordIdsModeSchema as P,TYPED_FJALL_TARGET_KINDS as z}from"../../dns/domainRecords.js";const N=C.options,x=Z.options,I=P.options,M=O.options,q=F.options;function B(n){const e=[],t=u(r=>{if(m.isNewExpression(r)&&J(r.expression)){const d=U(r);d!==void 0&&e.push(d)}m.forEachChild(r,t)},"visit");if(t(n),e.length===0)return l(void 0);if(e.length>1)return a(new Error(`Expected exactly one 'new Domain(...)' call per infrastructure file, found ${e.length}`));const i=e[0];return i?l(i):l(void 0)}u(B,"findDomainConstructCall");function J(n){return m.isIdentifier(n)&&n.text==="Domain"}u(J,"isDomainIdentifier");function U(n){const e=n.arguments;if(!e||e.length<3)return;const t=e[0],i=e[1],r=e[2];if(!t||!i||!r||!m.isObjectLiteralExpression(r))return;const d=w(n);if(d===void 0)return;const o=G(n),s=m.isStringLiteral(i)?i.text:void 0;return{callExpression:n,containingStatement:d,propsObjectLiteral:r,domainVarId:o,scopeArgumentText:t.getText(),constructIdLiteral:s}}u(U,"buildMatch");function w(n){let e=n;for(;e!==void 0;){if(m.isExpressionStatement(e)||m.isVariableStatement(e))return e;e=e.parent}}u(w,"findContainingTopLevelStatement");function G(n){let e=n.parent;for(;e!==void 0;){if(m.isVariableDeclaration(e)&&m.isIdentifier(e.name)&&e.initializer===n)return e.name.text;e=e.parent}}u(G,"extractDomainVarId");function Y(n){switch(n.kind){case"registrar_required":return"'registrar' property is required";case"registrar_unsupported":return`'registrar' must be one of ${N.join(", ")}, got ${JSON.stringify(n.value)}`;case"missing_field":return`'${n.field}' property is required`;case"invalid_literal":return`'${n.field}' ${n.reason}`;case"removed_field":return`'${n.field}' was removed from the Domain API \u2014 ${n.cure}`}}u(Y,"errorMessage");const K="declare the delegated child as its own Domain with registrar: 'external-delegated' and set 'parentDelegationRoleArn' (the CLI injects it via ManagedDomainBinding.delegationRoleArn); the child UPSERTs its NS records into the parent zone";function H(n){const e=E(n),t=h(e.registrar,N);if(t===void 0){const c=e.registrar;if(c===void 0)return a({kind:"registrar_required"});const p=typeof c=="string"?c:y(c);return a({kind:"registrar_unsupported",value:p})}const i=f(e.zoneName);if(i===void 0)return a({kind:"missing_field",field:"zoneName"});const r=h(e.recordIds,I);if(e.recordIds!==void 0&&r===void 0)return a({kind:"invalid_literal",field:"recordIds",reason:`must be one of ${I.map(c=>`'${c}'`).join(", ")}`});const d=Q(e.records);if(!d.success)return d;const o=te(e.certificates);if(!o.success)return o;if(e.delegations!==void 0)return a({kind:"removed_field",field:"delegations",cure:K});const s={zoneName:i,recordIds:r,description:f(e.description),costAllocationEnvironment:f(e.costAllocationEnvironment),tags:re(e.tags),records:d.data,certificates:o.data};switch(t){case"route53":return l({...s,registrar:t,hostedZoneId:f(e.hostedZoneId)});case"external-delegated":{const c=f(e.delegatedSubdomain);if(c===void 0)return a({kind:"missing_field",field:"delegatedSubdomain"});const p=f(e.hostedZoneId);if(e.hostedZoneId!==void 0&&p===void 0)return a({kind:"invalid_literal",field:"hostedZoneId",reason:"must be a literal string zone id on external-delegated \u2014 dynamic expressions cannot be round-tripped"});const _=k(e.adoptedNameServers);if(e.adoptedNameServers!==void 0&&_===void 0)return a({kind:"invalid_literal",field:"adoptedNameServers",reason:"must be an array of literal NS hostname strings \u2014 the parent NS UPSERT writes them verbatim"});if(p===void 0!=(_===void 0))return a({kind:"invalid_literal",field:p===void 0?"hostedZoneId":"adoptedNameServers",reason:"adopting an existing child zone requires hostedZoneId and adoptedNameServers together (both-or-neither) \u2014 an imported zone exposes no name-server attribute at synth"});const A=f(e.parentDelegationRoleArn);if(e.parentDelegationRoleArn!==void 0&&A===void 0)return a({kind:"invalid_literal",field:"parentDelegationRoleArn",reason:"must be a literal string ARN (VD2-a) \u2014 the CLI injects it via ManagedDomainBinding.delegationRoleArn; dynamic expressions such as Fn.importValue are not supported"});const b=h(e.phase,x);return e.phase!==void 0&&b===void 0?a({kind:"invalid_literal",field:"phase",reason:`must be one of ${x.map($=>`'${$}'`).join(", ")}`}):l({...s,registrar:t,delegatedSubdomain:c,hostedZoneId:p,adoptedNameServers:_,parentDelegationRoleArn:A,phase:b})}case"external-records":return l({...s,registrar:t})}}u(H,"parseDomainProps");function ue(n){return Y(n)}u(ue,"parseDomainErrorMessage");function ce(n,e,t){const i=m.createSourceFile(e,n,m.ScriptTarget.Latest,!0,m.ScriptKind.TS),r=B(i);if(!r.success)return a(new Error(r.error.message));if(r.data===void 0)return a(new Error(`Domain '${t}': no 'new Domain(...)' call found in ${e} \u2014 the file is not a Fjall domain component.`));const d=H(r.data.propsObjectLiteral);return d.success?l(d.data):a(new Error(`Domain '${t}': infrastructure.ts could not be parsed (${d.error.kind}).`))}u(ce,"parseDomainInfrastructureSource");function Q(n){if(n===void 0)return l([]);if(!Array.isArray(n))return a({kind:"invalid_literal",field:"records",reason:"must be an array"});const e=[];for(let t=0;t<n.length;t++){const i=n[t];if(!S(i))return a({kind:"invalid_literal",field:`records[${t}]`,reason:"must be an object literal"});const r=W(i,t);if(!r.success)return r;e.push(r.data)}return l(e)}u(Q,"parseRecordsArray");function W(n,e){const t=f(n.type),i=f(n.name);if(t===void 0)return a({kind:"missing_field",field:`records[${e}].type`});if(i===void 0)return a({kind:"missing_field",field:`records[${e}].name`});const r=f(n.id);if(n.id!==void 0&&(r===void 0||!V.safeParse(r).success))return a({kind:"invalid_literal",field:`records[${e}].id`,reason:"must be a literal alphanumeric string starting with a letter \u2014 it becomes a CloudFormation logical-ID segment"});if(n.target!==void 0){if(!q.some(p=>p===t))return a({kind:"invalid_literal",field:`records[${e}]`,reason:`alias records must have type 'A' or 'AAAA', got '${t}'`});const c=ee(n.target);return l({kind:"alias",type:t,name:i,target:c,...r!==void 0?{id:r}:{}})}if(!M.some(c=>c===t))return a({kind:"invalid_literal",field:`records[${e}]`,reason:`unsupported record type '${t}'`});const d=X(n.value);if(d===void 0)return a({kind:"invalid_literal",field:`records[${e}].value`,reason:`must be a string or array of strings (got ${JSON.stringify(n.value)})`});const o=L(n.ttl),s={kind:"standard",type:t,name:i,value:d,...o!==void 0?{ttl:o}:{},...r!==void 0?{id:r}:{}};return l(s)}u(W,"parseRecord");function X(n){if(n===void 0)return;if(typeof n=="string")return n;const e=k(n);if(e!==void 0)return e}u(X,"parseRecordValue");function ee(n){if(j(n))return ne(n);if(S(n)){const e=h(n.kind,z);if(e==="ecs"||e==="cdn"){const t=f(n.appName);if(t!==void 0)return{kind:e,appName:t}}if(e==="bucket"){const t=f(n.bucketName);if(t!==void 0)return{kind:e,bucketName:t}}if(e==="custom"){const t=f(n.dnsName),i=f(n.hostedZoneId);if(t!==void 0&&i!==void 0)return{kind:e,dnsName:t,hostedZoneId:i}}}return{kind:"unresolved",sourceText:y(n)}}u(ee,"parseTarget");function ne(n){const e=n.__call.trim(),t=e.match(/^([A-Za-z_][\w$]*)\s*\(([\s\S]*)\)\s*$/);if(!t)return{kind:"unresolved",sourceText:e};const i=t[1],r=t[2]??"",d=v(r);switch(i){case"fjallApp":{const o=g(d,0);if(o===void 0)return{kind:"dynamic",sourceText:e};if(d.length<2)return{kind:"ecs",appName:o};const s=g(d,1);return s===void 0?{kind:"dynamic",sourceText:e}:{kind:"ecs",appName:o,computeName:s}}case"fjallCdn":{const o=g(d,0);return o===void 0?{kind:"dynamic",sourceText:e}:{kind:"cdn",appName:o}}case"fjallBucket":{const o=g(d,0);return o===void 0?{kind:"dynamic",sourceText:e}:{kind:"bucket",bucketName:o}}case"aliasTo":{if(d.length>=2){const o=g(d,0),s=g(d,1);return o!==void 0&&s!==void 0?{kind:"custom",dnsName:o,hostedZoneId:s}:{kind:"dynamic",sourceText:e}}if(d.length===1){const o=d[0]?.trim()??"",s=R(o,"dnsName"),c=R(o,"hostedZoneId");return s!==void 0&&c!==void 0?{kind:"custom",dnsName:s,hostedZoneId:c}:{kind:"dynamic",sourceText:e}}return{kind:"unresolved",sourceText:e}}default:return{kind:"unresolved",sourceText:e}}}u(ne,"resolveCallRefTarget");function v(n){const e=[];let t=0,i=null,r="";for(let o=0;o<n.length;o++){const s=n[o];if(i!==null){if(r+=s,s==="\\"&&o+1<n.length){const c=n[o+1];c!==void 0&&(r+=c,o+=1);continue}s===i&&(i=null);continue}if(s==='"'||s==="'"||s==="`"){i=s,r+=s;continue}if(s==="("||s==="{"||s==="["){t+=1,r+=s;continue}if(s===")"||s==="}"||s==="]"){t-=1,r+=s;continue}if(s===","&&t===0){e.push(r.trim()),r="";continue}r+=s}const d=r.trim();return d.length>0&&e.push(d),e}u(v,"splitTopLevelArgs");function g(n,e){const t=n[e];if(t===void 0)return;const i=t.trim();if(i.length<2)return;const r=i[0],d=i[i.length-1];if(r===d&&!(r!=='"'&&r!=="'"&&r!=="`"))return i.slice(1,-1)}u(g,"extractStringLiteralArg");function R(n,e){const t=n.trim().replace(/^\{|\}$/g,""),i=v(t);for(const r of i){const d=r.indexOf(":");if(d<0||r.slice(0,d).trim().replace(/["'`]/g,"")!==e)continue;const s=r.slice(d+1).trim();return g([s],0)}}u(R,"extractObjectFieldString");function te(n){if(n===void 0)return l([]);if(!Array.isArray(n))return a({kind:"invalid_literal",field:"certificates",reason:"must be an array"});const e=[];for(let t=0;t<n.length;t++){const i=n[t];if(typeof i=="string"){e.push({domainName:i});continue}if(!S(i))return a({kind:"invalid_literal",field:`certificates[${t}]`,reason:"must be a string or object literal"});const r=f(i.domainName);if(r===void 0)return a({kind:"missing_field",field:`certificates[${t}].domainName`});const d=k(i.subjectAlternativeNames),o=D(i.transparencyLogging),s=D(i.cloudFront);if(i.cloudFront!==void 0&&s===void 0)return a({kind:"invalid_literal",field:`certificates[${t}].cloudFront`,reason:"must be a boolean literal \u2014 the CloudFront designation drives the zone-level us-east-1 export contract and cannot be round-tripped from a dynamic expression"});e.push({domainName:r,...d!==void 0?{subjectAlternativeNames:d}:{},...o!==void 0?{transparencyLogging:o}:{},...s!==void 0?{cloudFront:s}:{}})}return l(e)}u(te,"parseCertificatesArray");function re(n){if(n===void 0||!S(n))return;const e={};for(const[t,i]of Object.entries(n)){const r=f(i);r!==void 0&&(e[t]=r)}return Object.keys(e).length===0?void 0:e}u(re,"parseStringRecord");function y(n){if(n===void 0)return"undefined";if(n===null)return"null";if(typeof n=="string")return JSON.stringify(n);if(typeof n=="number"||typeof n=="boolean")return String(n);if(Array.isArray(n))return`[${n.map(e=>y(e)).join(", ")}]`;if(typeof n=="object"){if("__call"in n)return String(n.__call);if("__identifier"in n)return String(n.__identifier);if("__expression"in n)return String(n.__expression);if("__unknown"in n)return String(n.__unknown)}return String(n)}u(y,"stringifyParsedValue");export{B as findDomainConstructCall,ue as parseDomainErrorMessage,ce as parseDomainInfrastructureSource,H as parseDomainProps,v as splitTopLevelArgs};
|
|
1
|
+
var T=Object.defineProperty;var u=(n,e)=>T(n,"name",{value:e,configurable:!0});import*as m from"typescript";import{parseObjectLiteral as E,asString as f,asStringUnion as h,asStringArray as k,asBoolean as N,asNumber as L,isCallRef as j,isParsedObject as S}from"../parsers/common/astCommonParser.js";import{success as l,failure as a}from"../../types/Result.js";import{DnsRecordTypeSchema as O}from"../../dns/types.js";import{DomainRegistrarSchema as C,DomainDeployPhaseSchema as Z,AliasRecordTypeSchema as F,RecordConstructIdSchema as V,RecordIdsModeSchema as P,TYPED_FJALL_TARGET_KINDS as z}from"../../dns/domainRecords.js";const x=C.options,D=Z.options,I=P.options,M=O.options,q=F.options;function B(n){const e=[],t=u(r=>{if(m.isNewExpression(r)&&J(r.expression)){const d=U(r);d!==void 0&&e.push(d)}m.forEachChild(r,t)},"visit");if(t(n),e.length===0)return l(void 0);if(e.length>1)return a(new Error(`Expected exactly one 'new Domain(...)' call per infrastructure file, found ${e.length}`));const i=e[0];return i?l(i):l(void 0)}u(B,"findDomainConstructCall");function J(n){return m.isIdentifier(n)&&n.text==="Domain"}u(J,"isDomainIdentifier");function U(n){const e=n.arguments;if(!e||e.length<3)return;const t=e[0],i=e[1],r=e[2];if(!t||!i||!r||!m.isObjectLiteralExpression(r))return;const d=G(n);if(d===void 0)return;const o=Y(n),s=m.isStringLiteral(i)?i.text:void 0;return{callExpression:n,containingStatement:d,propsObjectLiteral:r,domainVarId:o,scopeArgumentText:t.getText(),constructIdLiteral:s}}u(U,"buildMatch");function G(n){let e=n;for(;e!==void 0;){if(m.isExpressionStatement(e)||m.isVariableStatement(e))return e;e=e.parent}}u(G,"findContainingTopLevelStatement");function Y(n){let e=n.parent;for(;e!==void 0;){if(m.isVariableDeclaration(e)&&m.isIdentifier(e.name)&&e.initializer===n)return e.name.text;e=e.parent}}u(Y,"extractDomainVarId");function w(n){switch(n.kind){case"registrar_required":return"'registrar' property is required";case"registrar_unsupported":return`'registrar' must be one of ${x.join(", ")}, got ${JSON.stringify(n.value)}`;case"missing_field":return`'${n.field}' property is required`;case"invalid_literal":return`'${n.field}' ${n.reason}`;case"removed_field":return`'${n.field}' was removed from the Domain API \u2014 ${n.cure}`}}u(w,"errorMessage");const K="declare the delegated child as its own Domain with registrar: 'external-delegated' and set 'parentDelegationRoleArn' (the CLI injects it via ManagedDomainBinding.delegationRoleArn); the child UPSERTs its NS records into the parent zone";function H(n){const e=E(n),t=h(e.registrar,x);if(t===void 0){const c=e.registrar;if(c===void 0)return a({kind:"registrar_required"});const p=typeof c=="string"?c:y(c);return a({kind:"registrar_unsupported",value:p})}const i=f(e.zoneName);if(i===void 0)return a({kind:"missing_field",field:"zoneName"});const r=h(e.recordIds,I);if(e.recordIds!==void 0&&r===void 0)return a({kind:"invalid_literal",field:"recordIds",reason:`must be one of ${I.map(c=>`'${c}'`).join(", ")}`});const d=Q(e.records);if(!d.success)return d;const o=te(e.certificates);if(!o.success)return o;if(e.delegations!==void 0)return a({kind:"removed_field",field:"delegations",cure:K});const s={zoneName:i,recordIds:r,description:f(e.description),costAllocationEnvironment:f(e.costAllocationEnvironment),tags:re(e.tags),records:d.data,certificates:o.data};switch(t){case"route53":return l({...s,registrar:t,hostedZoneId:f(e.hostedZoneId)});case"external-delegated":{const c=f(e.delegatedSubdomain);if(c===void 0)return a({kind:"missing_field",field:"delegatedSubdomain"});const p=f(e.hostedZoneId);if(e.hostedZoneId!==void 0&&p===void 0)return a({kind:"invalid_literal",field:"hostedZoneId",reason:"must be a literal string zone id on external-delegated \u2014 dynamic expressions cannot be round-tripped"});const _=k(e.adoptedNameServers);if(e.adoptedNameServers!==void 0&&_===void 0)return a({kind:"invalid_literal",field:"adoptedNameServers",reason:"must be an array of literal NS hostname strings \u2014 the parent NS UPSERT writes them verbatim"});if(p===void 0!=(_===void 0))return a({kind:"invalid_literal",field:p===void 0?"hostedZoneId":"adoptedNameServers",reason:"adopting an existing child zone requires hostedZoneId and adoptedNameServers together (both-or-neither) \u2014 an imported zone exposes no name-server attribute at synth"});const A=f(e.parentDelegationRoleArn);if(e.parentDelegationRoleArn!==void 0&&A===void 0)return a({kind:"invalid_literal",field:"parentDelegationRoleArn",reason:"must be a literal string ARN (VD2-a) \u2014 the CLI injects it via ManagedDomainBinding.delegationRoleArn; dynamic expressions such as Fn.importValue are not supported"});const b=h(e.phase,D);return e.phase!==void 0&&b===void 0?a({kind:"invalid_literal",field:"phase",reason:`must be one of ${D.map($=>`'${$}'`).join(", ")}`}):l({...s,registrar:t,delegatedSubdomain:c,hostedZoneId:p,adoptedNameServers:_,parentDelegationRoleArn:A,phase:b})}case"external-records":return l({...s,registrar:t})}}u(H,"parseDomainProps");function ue(n){return w(n)}u(ue,"parseDomainErrorMessage");function ce(n,e,t){const i=m.createSourceFile(e,n,m.ScriptTarget.Latest,!0,m.ScriptKind.TS),r=B(i);if(!r.success)return a(new Error(r.error.message));if(r.data===void 0)return a(new Error(`Domain '${t}': no 'new Domain(...)' call found in ${e} \u2014 the file is not a Fjall domain component.`));const d=H(r.data.propsObjectLiteral);return d.success?l(d.data):a(new Error(`Domain '${t}': infrastructure.ts could not be parsed (${d.error.kind}).`))}u(ce,"parseDomainInfrastructureSource");function Q(n){if(n===void 0)return l([]);if(!Array.isArray(n))return a({kind:"invalid_literal",field:"records",reason:"must be an array"});const e=[];for(let t=0;t<n.length;t++){const i=n[t];if(!S(i))return a({kind:"invalid_literal",field:`records[${t}]`,reason:"must be an object literal"});const r=W(i,t);if(!r.success)return r;e.push(r.data)}return l(e)}u(Q,"parseRecordsArray");function W(n,e){const t=f(n.type),i=f(n.name);if(t===void 0)return a({kind:"missing_field",field:`records[${e}].type`});if(i===void 0)return a({kind:"missing_field",field:`records[${e}].name`});const r=f(n.id);if(n.id!==void 0&&(r===void 0||!V.safeParse(r).success))return a({kind:"invalid_literal",field:`records[${e}].id`,reason:"must be a literal alphanumeric string starting with a letter \u2014 it becomes a CloudFormation logical-ID segment"});if(n.target!==void 0){if(!q.some(p=>p===t))return a({kind:"invalid_literal",field:`records[${e}]`,reason:`alias records must have type 'A' or 'AAAA', got '${t}'`});const c=ee(n.target);return l({kind:"alias",type:t,name:i,target:c,...r!==void 0?{id:r}:{}})}if(!M.some(c=>c===t))return a({kind:"invalid_literal",field:`records[${e}]`,reason:`unsupported record type '${t}'`});const d=X(n.value);if(d===void 0)return a({kind:"invalid_literal",field:`records[${e}].value`,reason:`must be a string or array of strings (got ${JSON.stringify(n.value)})`});const o=L(n.ttl),s={kind:"standard",type:t,name:i,value:d,...o!==void 0?{ttl:o}:{},...r!==void 0?{id:r}:{}};return l(s)}u(W,"parseRecord");function X(n){if(n===void 0)return;if(typeof n=="string")return n;const e=k(n);if(e!==void 0)return e}u(X,"parseRecordValue");function ee(n){if(j(n))return ne(n);if(S(n)){const e=h(n.kind,z);if(e==="ecs"||e==="cdn"){const t=f(n.appName);if(t!==void 0)return{kind:e,appName:t}}if(e==="bucket"){const t=f(n.appName),i=f(n.bucketName);if(t!==void 0&&i!==void 0)return{kind:e,appName:t,bucketName:i}}if(e==="custom"){const t=f(n.dnsName),i=f(n.hostedZoneId);if(t!==void 0&&i!==void 0)return{kind:e,dnsName:t,hostedZoneId:i}}}return{kind:"unresolved",sourceText:y(n)}}u(ee,"parseTarget");function ne(n){const e=n.__call.trim(),t=e.match(/^([A-Za-z_][\w$]*)\s*\(([\s\S]*)\)\s*$/);if(!t)return{kind:"unresolved",sourceText:e};const i=t[1],r=t[2]??"",d=v(r);switch(i){case"fjallApp":{const o=g(d,0);if(o===void 0)return{kind:"dynamic",sourceText:e};if(d.length<2)return{kind:"ecs",appName:o};const s=g(d,1);return s===void 0?{kind:"dynamic",sourceText:e}:{kind:"ecs",appName:o,computeName:s}}case"fjallCdn":{const o=g(d,0);return o===void 0?{kind:"dynamic",sourceText:e}:{kind:"cdn",appName:o}}case"fjallBucket":{if(d.length<2)return{kind:"unresolved",sourceText:e};const o=g(d,0),s=g(d,1);return o===void 0||s===void 0?{kind:"dynamic",sourceText:e}:{kind:"bucket",appName:o,bucketName:s}}case"aliasTo":{if(d.length>=2){const o=g(d,0),s=g(d,1);return o!==void 0&&s!==void 0?{kind:"custom",dnsName:o,hostedZoneId:s}:{kind:"dynamic",sourceText:e}}if(d.length===1){const o=d[0]?.trim()??"",s=R(o,"dnsName"),c=R(o,"hostedZoneId");return s!==void 0&&c!==void 0?{kind:"custom",dnsName:s,hostedZoneId:c}:{kind:"dynamic",sourceText:e}}return{kind:"unresolved",sourceText:e}}default:return{kind:"unresolved",sourceText:e}}}u(ne,"resolveCallRefTarget");function v(n){const e=[];let t=0,i=null,r="";for(let o=0;o<n.length;o++){const s=n[o];if(i!==null){if(r+=s,s==="\\"&&o+1<n.length){const c=n[o+1];c!==void 0&&(r+=c,o+=1);continue}s===i&&(i=null);continue}if(s==='"'||s==="'"||s==="`"){i=s,r+=s;continue}if(s==="("||s==="{"||s==="["){t+=1,r+=s;continue}if(s===")"||s==="}"||s==="]"){t-=1,r+=s;continue}if(s===","&&t===0){e.push(r.trim()),r="";continue}r+=s}const d=r.trim();return d.length>0&&e.push(d),e}u(v,"splitTopLevelArgs");function g(n,e){const t=n[e];if(t===void 0)return;const i=t.trim();if(i.length<2)return;const r=i[0],d=i[i.length-1];if(r===d&&!(r!=='"'&&r!=="'"&&r!=="`"))return i.slice(1,-1)}u(g,"extractStringLiteralArg");function R(n,e){const t=n.trim().replace(/^\{|\}$/g,""),i=v(t);for(const r of i){const d=r.indexOf(":");if(d<0||r.slice(0,d).trim().replace(/["'`]/g,"")!==e)continue;const s=r.slice(d+1).trim();return g([s],0)}}u(R,"extractObjectFieldString");function te(n){if(n===void 0)return l([]);if(!Array.isArray(n))return a({kind:"invalid_literal",field:"certificates",reason:"must be an array"});const e=[];for(let t=0;t<n.length;t++){const i=n[t];if(typeof i=="string"){e.push({domainName:i});continue}if(!S(i))return a({kind:"invalid_literal",field:`certificates[${t}]`,reason:"must be a string or object literal"});const r=f(i.domainName);if(r===void 0)return a({kind:"missing_field",field:`certificates[${t}].domainName`});const d=k(i.subjectAlternativeNames),o=N(i.transparencyLogging),s=N(i.cloudFront);if(i.cloudFront!==void 0&&s===void 0)return a({kind:"invalid_literal",field:`certificates[${t}].cloudFront`,reason:"must be a boolean literal \u2014 the CloudFront designation drives the zone-level us-east-1 export contract and cannot be round-tripped from a dynamic expression"});e.push({domainName:r,...d!==void 0?{subjectAlternativeNames:d}:{},...o!==void 0?{transparencyLogging:o}:{},...s!==void 0?{cloudFront:s}:{}})}return l(e)}u(te,"parseCertificatesArray");function re(n){if(n===void 0||!S(n))return;const e={};for(const[t,i]of Object.entries(n)){const r=f(i);r!==void 0&&(e[t]=r)}return Object.keys(e).length===0?void 0:e}u(re,"parseStringRecord");function y(n){if(n===void 0)return"undefined";if(n===null)return"null";if(typeof n=="string")return JSON.stringify(n);if(typeof n=="number"||typeof n=="boolean")return String(n);if(Array.isArray(n))return`[${n.map(e=>y(e)).join(", ")}]`;if(typeof n=="object"){if("__call"in n)return String(n.__call);if("__identifier"in n)return String(n.__identifier);if("__expression"in n)return String(n.__expression);if("__unknown"in n)return String(n.__unknown)}return String(n)}u(y,"stringifyParsedValue");export{B as findDomainConstructCall,ue as parseDomainErrorMessage,ce as parseDomainInfrastructureSource,H as parseDomainProps,v as splitTopLevelArgs};
|
|
@@ -12,11 +12,15 @@ export interface ParsedClickHouseResource {
|
|
|
12
12
|
resourceName: string;
|
|
13
13
|
databaseName: string;
|
|
14
14
|
instanceType?: string;
|
|
15
|
+
storageGb?: number;
|
|
16
|
+
iops?: number;
|
|
17
|
+
throughputMbps?: number;
|
|
15
18
|
coldTier?: {
|
|
16
19
|
mode: "s3";
|
|
17
20
|
} | false;
|
|
18
21
|
optimiseSchedule?: string | false;
|
|
19
22
|
backupSchedule?: string | false;
|
|
23
|
+
backupVerify?: false;
|
|
20
24
|
backupRetentionDays?: number;
|
|
21
25
|
extraProperties?: ExtraProperty[];
|
|
22
26
|
node: ts.Node;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var h=Object.defineProperty;var p=(a,e)=>h(a,"name",{value:e,configurable:!0});import*as c from"typescript";import{asNumber as n,asString as o,captureExtraProperties as N,isParsedObject as T,omitUndefined as x,parseObjectLiteral as C}from"../common/astCommonParser.js";const v=new Set(["type","databaseName","instanceType","storageGb","iops","throughputMbps","coldTier","optimiseSchedule","backupSchedule","backupVerify","backupRetentionDays"]);function G(a){const e=a.node;if(!c.isCallExpression(e))return null;const r=e.arguments[0];if(!c.isCallExpression(r)||r.arguments.length<2)return null;const l=r.arguments[1];if(!c.isObjectLiteralExpression(l))return null;const i=C(l),t={resourceName:a.resourceName,databaseName:a.databaseName,node:a.node};a.variableName&&(t.variableName=a.variableName);const d=o(i.instanceType);d&&(t.instanceType=d);const b=n(i.storageGb);b!==void 0&&(t.storageGb=b);const f=n(i.iops);f!==void 0&&(t.iops=f);const m=n(i.throughputMbps);m!==void 0&&(t.throughputMbps=m);const u=i.coldTier;u===!1?t.coldTier=!1:T(u)&&o(u.mode)==="s3"&&(t.coldTier={mode:"s3"});const g=i.optimiseSchedule;if(g===!1)t.optimiseSchedule=!1;else{const s=o(g);s&&(t.optimiseSchedule=s)}const k=i.backupSchedule;if(k===!1)t.backupSchedule=!1;else{const s=o(k);s&&(t.backupSchedule=s)}i.backupVerify===!1&&(t.backupVerify=!1);const S=n(i.backupRetentionDays);S!==void 0&&(t.backupRetentionDays=S);const y=N(i,v);return y.length>0&&(t.extraProperties=y),t}p(G,"extractClickHouseFields");function M(a){if(a.length!==0)return a.map(e=>({name:e.resourceName,type:"ClickHouse",databaseName:e.databaseName,...x({instanceType:e.instanceType,storageGb:e.storageGb,iops:e.iops,throughputMbps:e.throughputMbps,coldTier:e.coldTier,optimiseSchedule:e.optimiseSchedule,backupSchedule:e.backupSchedule,backupVerify:e.backupVerify,backupRetentionDays:e.backupRetentionDays,variableName:e.variableName,extraProperties:e.extraProperties})}))}p(M,"convertClickHouseResources");export{M as convertClickHouseResources,G as extractClickHouseFields};
|
|
@@ -1,13 +1,3 @@
|
|
|
1
1
|
import { type Result } from "../types/Result.js";
|
|
2
2
|
import type { ParsedZoneFile } from "./types.js";
|
|
3
3
|
export declare function parseZoneFile(content: string): Result<ParsedZoneFile, Error>;
|
|
4
|
-
/**
|
|
5
|
-
* Resolve an ALIAS value (e.g. "fjall:ecs:my-app") to a target DNS name
|
|
6
|
-
* using a map of app outputs. Returns undefined if the alias cannot be resolved.
|
|
7
|
-
*
|
|
8
|
-
* Alias format: fjall:<type>:<name>
|
|
9
|
-
* - fjall:ecs:<name> — resolves to ALB DNS name
|
|
10
|
-
* - fjall:cdn:<name> — resolves to CloudFront domain name
|
|
11
|
-
* - fjall:s3:<name> — resolves to S3 website endpoint
|
|
12
|
-
*/
|
|
13
|
-
export declare function resolveAlias(alias: string, appOutputs: Map<string, string>): string | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var m=Object.defineProperty;var c=(e,n)=>m(e,"name",{value:n,configurable:!0});import{success as A,failure as I}from"../types/Result.js";import{DnsRecordTypeSchema as T,BIND_DIRECTIVES as d,ALIAS_PREFIX as E}from"./types.js";const v=new Set(T.options);function L(e){return v.has(e.toUpperCase())}c(L,"isRecordType");function C(e){return e.endsWith(".")?e.slice(0,-1):e}c(C,"stripTrailingDot");function R(e){let n=!1;for(let t=0;t<e.length;t++)if(e[t]==='"')n=!n;else if(e[t]===";"&&!n)return e.slice(0,t).trimEnd();return e}c(R,"stripInlineComment");function D(e,n){const t=e.slice(n).join(" "),s=[];let
|
|
2
|
-
`);let t,s=300;const
|
|
1
|
+
var m=Object.defineProperty;var c=(e,n)=>m(e,"name",{value:n,configurable:!0});import{success as A,failure as I}from"../types/Result.js";import{DnsRecordTypeSchema as T,BIND_DIRECTIVES as d,ALIAS_PREFIX as E}from"./types.js";const v=new Set(T.options);function L(e){return v.has(e.toUpperCase())}c(L,"isRecordType");function C(e){return e.endsWith(".")?e.slice(0,-1):e}c(C,"stripTrailingDot");function R(e){let n=!1;for(let t=0;t<e.length;t++)if(e[t]==='"')n=!n;else if(e[t]===";"&&!n)return e.slice(0,t).trimEnd();return e}c(R,"stripInlineComment");function D(e,n){const t=e.slice(n).join(" "),s=[];let r="",i=!1;for(const o of t)o==='"'?(i&&(s.push(r),r=""),i=!i):i&&(r+=o);return s.join(" ")}c(D,"parseTxtValue");function S(e){const n=/;\s*auto\s*$/.test(e),s=e.replace(/;\s*auto\s*$/,"").trim().match(/^\$FJALL-DELEGATE\s+(\S+)\s+TO\s+(\S+)$/i);if(s)return{subdomain:s[1],targetAccount:s[2],auto:n}}c(S,"parseDelegateDirective");function $(e){if(e.length<2)return;const n=e[1],t=e.slice(2);return{domainName:n,subjectAlternativeNames:t}}c($,"parseCertDirective");function w(e){const n=[];let t="",s=!1;for(const r of e)r==='"'?(s=!s,t+=r):/\s/.test(r)&&!s?t.length>0&&(n.push(t),t=""):t+=r;return t.length>0&&n.push(t),n}c(w,"tokenise");function j(e){if(e.length<2)return;let n=0;const t=e[n++];let s,r;for(;n<e.length&&r===void 0;){const o=e[n].toUpperCase();if(o==="IN")n++;else if(L(o))r=o,n++;else if(/^\d+$/.test(e[n]))s=parseInt(e[n],10),n++;else return}if(!r)return;const i=e.slice(n);switch(r){case"MX":{if(i.length<2)return;const o=parseInt(i[0],10),f=i.slice(1).join(" ");return{name:t,type:r,ttl:s,value:f,priority:o}}case"SRV":{if(i.length<4)return;const o=parseInt(i[0],10),f=parseInt(i[1],10),a=parseInt(i[2],10),p=i[3];return{name:t,type:r,ttl:s,value:p,priority:o,weight:f,port:a}}case"TXT":{const o=D(e,n);return{name:t,type:r,ttl:s,value:o}}case"CAA":{const o=i.join(" ");return{name:t,type:r,ttl:s,value:o}}case"A":case"AAAA":{if(i.length===0)return;if(i[0].toUpperCase()==="ALIAS"){if(i.length<2)return;const f=i.slice(1).join(" ");return{name:t,type:r,ttl:s,value:`${E}${f}`}}return{name:t,type:r,ttl:s,value:i[0]}}default:return i.length===0?void 0:{name:t,type:r,ttl:s,value:i[0]}}}c(j,"parseRecord");function U(e){const n=e.split(`
|
|
2
|
+
`);let t,s=300;const r=[],i=[],o=[];for(const f of n){const a=f.trim();if(a===""||a.startsWith(";"))continue;if(a.toUpperCase().startsWith(d.FJALL_DELEGATE)){const l=S(a);l&&i.push(l);continue}const p=R(a);if(p==="")continue;const u=w(p);if(u.length===0)continue;const h=u[0].toUpperCase();if(h===d.ORIGIN){if(u.length<2)continue;t=C(u[1]);continue}if(h===d.TTL){if(u.length<2)continue;s=parseInt(u[1],10);continue}if(h===d.FJALL_CERT){const l=$(u);l&&o.push(l);continue}const g=j(u);g&&r.push(g)}return t?A({origin:t,ttl:s,records:r,delegations:i,certificates:o}):I(new Error("Missing $ORIGIN directive"))}c(U,"parseZoneFile");export{U as parseZoneFile};
|
|
@@ -8,6 +8,7 @@ export declare const TypedFjallTargetSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
|
|
|
8
8
|
appName: z.ZodString;
|
|
9
9
|
}, z.core.$strict>, z.ZodObject<{
|
|
10
10
|
kind: z.ZodLiteral<"bucket">;
|
|
11
|
+
appName: z.ZodString;
|
|
11
12
|
bucketName: z.ZodString;
|
|
12
13
|
}, z.core.$strict>, z.ZodObject<{
|
|
13
14
|
kind: z.ZodLiteral<"custom">;
|
|
@@ -81,6 +82,7 @@ export declare const ParsedAliasRecordSchema: z.ZodObject<{
|
|
|
81
82
|
appName: z.ZodString;
|
|
82
83
|
}, z.core.$strict>, z.ZodObject<{
|
|
83
84
|
kind: z.ZodLiteral<"bucket">;
|
|
85
|
+
appName: z.ZodString;
|
|
84
86
|
bucketName: z.ZodString;
|
|
85
87
|
}, z.core.$strict>, z.ZodObject<{
|
|
86
88
|
kind: z.ZodLiteral<"custom">;
|
|
@@ -121,6 +123,7 @@ export declare const ParsedDnsRecordSchema: z.ZodDiscriminatedUnion<[z.ZodObject
|
|
|
121
123
|
appName: z.ZodString;
|
|
122
124
|
}, z.core.$strict>, z.ZodObject<{
|
|
123
125
|
kind: z.ZodLiteral<"bucket">;
|
|
126
|
+
appName: z.ZodString;
|
|
124
127
|
bucketName: z.ZodString;
|
|
125
128
|
}, z.core.$strict>, z.ZodObject<{
|
|
126
129
|
kind: z.ZodLiteral<"custom">;
|
|
@@ -198,6 +201,7 @@ export declare const ParsedDomainRecordsSchema: z.ZodObject<{
|
|
|
198
201
|
appName: z.ZodString;
|
|
199
202
|
}, z.core.$strict>, z.ZodObject<{
|
|
200
203
|
kind: z.ZodLiteral<"bucket">;
|
|
204
|
+
appName: z.ZodString;
|
|
201
205
|
bucketName: z.ZodString;
|
|
202
206
|
}, z.core.$strict>, z.ZodObject<{
|
|
203
207
|
kind: z.ZodLiteral<"custom">;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as e}from"zod";const r=e.discriminatedUnion("kind",[e.object({kind:e.literal("ecs"),appName:e.string(),computeName:e.string().min(1).optional()}).strict(),e.object({kind:e.literal("cdn"),appName:e.string()}).strict(),e.object({kind:e.literal("bucket"),bucketName:e.string()}).strict(),e.object({kind:e.literal("custom"),dnsName:e.string(),hostedZoneId:e.string()}).strict()]),p=r.options.map(t=>t.shape.kind.value),n=e.enum(["A","AAAA"]),o=e.enum(["route53","external-delegated","external-records"]),u=e.enum(["zone","full"]),a=e.string().regex(/^[A-Za-z][A-Za-z0-9]*$/),i=e.object({kind:e.literal("standard"),type:e.enum(["A","AAAA","CNAME","MX","TXT","NS","SRV","CAA"]),name:e.string(),value:e.union([e.string(),e.array(e.string())]),ttl:e.number().int().positive().optional(),id:a.optional()}).strict(),s=e.object({kind:e.literal("alias"),type:n,name:e.string(),target:r,id:a.optional()}).strict(),d=e.discriminatedUnion("kind",[i,s]),c=e.object({domainName:e.string(),subjectAlternativeNames:e.array(e.string()).optional(),transparencyLogging:e.boolean().optional(),cloudFront:e.boolean().optional()}).strict(),l=e.object({subdomain:e.string(),toAccount:e.string(),auto:e.boolean().optional()}).strict(),m=e.enum(["indexed","stable"]),x=e.object({zoneName:e.string(),registrar:o,recordIds:m.optional(),hostedZoneId:e.string().optional(),delegatedSubdomain:e.string().optional(),adoptedNameServers:e.array(e.string().min(1)).min(1).optional(),records:e.array(d),certificates:e.array(c),delegations:e.array(l)}).strict().refine(t=>t.registrar!=="external-delegated"||t.delegatedSubdomain!==void 0,{message:"external-delegated requires delegatedSubdomain"}).refine(t=>t.registrar!=="external-records"||t.delegations.length===0,{message:"external-records forbids delegations"}).refine(t=>t.registrar==="external-delegated"||t.adoptedNameServers===void 0,{message:"adoptedNameServers requires registrar external-delegated"}).refine(t=>t.registrar!=="external-delegated"||t.hostedZoneId===void 0==(t.adoptedNameServers===void 0),{message:"external-delegated adoption requires hostedZoneId and adoptedNameServers together (both-or-neither)"});export{n as AliasRecordTypeSchema,u as DomainDeployPhaseSchema,o as DomainRegistrarSchema,s as ParsedAliasRecordSchema,c as ParsedCertificateSchema,d as ParsedDnsRecordSchema,x as ParsedDomainRecordsSchema,i as ParsedStandardRecordSchema,l as ParsedSubdomainDelegationSchema,a as RecordConstructIdSchema,m as RecordIdsModeSchema,p as TYPED_FJALL_TARGET_KINDS,r as TypedFjallTargetSchema};
|
|
1
|
+
import{z as e}from"zod";const r=e.discriminatedUnion("kind",[e.object({kind:e.literal("ecs"),appName:e.string(),computeName:e.string().min(1).optional()}).strict(),e.object({kind:e.literal("cdn"),appName:e.string()}).strict(),e.object({kind:e.literal("bucket"),appName:e.string(),bucketName:e.string()}).strict(),e.object({kind:e.literal("custom"),dnsName:e.string(),hostedZoneId:e.string()}).strict()]),p=r.options.map(t=>t.shape.kind.value),n=e.enum(["A","AAAA"]),o=e.enum(["route53","external-delegated","external-records"]),u=e.enum(["zone","full"]),a=e.string().regex(/^[A-Za-z][A-Za-z0-9]*$/),i=e.object({kind:e.literal("standard"),type:e.enum(["A","AAAA","CNAME","MX","TXT","NS","SRV","CAA"]),name:e.string(),value:e.union([e.string(),e.array(e.string())]),ttl:e.number().int().positive().optional(),id:a.optional()}).strict(),s=e.object({kind:e.literal("alias"),type:n,name:e.string(),target:r,id:a.optional()}).strict(),d=e.discriminatedUnion("kind",[i,s]),c=e.object({domainName:e.string(),subjectAlternativeNames:e.array(e.string()).optional(),transparencyLogging:e.boolean().optional(),cloudFront:e.boolean().optional()}).strict(),l=e.object({subdomain:e.string(),toAccount:e.string(),auto:e.boolean().optional()}).strict(),m=e.enum(["indexed","stable"]),x=e.object({zoneName:e.string(),registrar:o,recordIds:m.optional(),hostedZoneId:e.string().optional(),delegatedSubdomain:e.string().optional(),adoptedNameServers:e.array(e.string().min(1)).min(1).optional(),records:e.array(d),certificates:e.array(c),delegations:e.array(l)}).strict().refine(t=>t.registrar!=="external-delegated"||t.delegatedSubdomain!==void 0,{message:"external-delegated requires delegatedSubdomain"}).refine(t=>t.registrar!=="external-records"||t.delegations.length===0,{message:"external-records forbids delegations"}).refine(t=>t.registrar==="external-delegated"||t.adoptedNameServers===void 0,{message:"adoptedNameServers requires registrar external-delegated"}).refine(t=>t.registrar!=="external-delegated"||t.hostedZoneId===void 0==(t.adoptedNameServers===void 0),{message:"external-delegated adoption requires hostedZoneId and adoptedNameServers together (both-or-neither)"});export{n as AliasRecordTypeSchema,u as DomainDeployPhaseSchema,o as DomainRegistrarSchema,s as ParsedAliasRecordSchema,c as ParsedCertificateSchema,d as ParsedDnsRecordSchema,x as ParsedDomainRecordsSchema,i as ParsedStandardRecordSchema,l as ParsedSubdomainDelegationSchema,a as RecordConstructIdSchema,m as RecordIdsModeSchema,p as TYPED_FJALL_TARGET_KINDS,r as TypedFjallTargetSchema};
|
package/dist/src/dns/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from "./types.js";
|
|
2
2
|
export * from "./domainRecords.js";
|
|
3
|
-
export { parseZoneFile
|
|
3
|
+
export { parseZoneFile } from "./bindParser.js";
|
|
4
4
|
export { generateZoneFile } from "./bindWriter.js";
|
|
5
5
|
export { type GeneratedFile, type DomainGenerationOptions, generateDomainFiles, } from "./domainFileGenerator.js";
|
|
6
6
|
export { type EmitDomainTsOptions, emitDomainTs, emitRecordObjectText, } from "./tsEmitter.js";
|
package/dist/src/dns/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export*from"./types.js";export*from"./domainRecords.js";import{parseZoneFile as m
|
|
1
|
+
export*from"./types.js";export*from"./domainRecords.js";import{parseZoneFile as m}from"./bindParser.js";import{generateZoneFile as p}from"./bindWriter.js";import{generateDomainFiles as f}from"./domainFileGenerator.js";import{emitDomainTs as a,emitRecordObjectText as l}from"./tsEmitter.js";export{a as emitDomainTs,l as emitRecordObjectText,f as generateDomainFiles,p as generateZoneFile,m as parseZoneFile};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var A=Object.defineProperty;var o=(e,n)=>A(e,"name",{value:n,configurable:!0});import{getDomainStackName as k,toPascalCase as D}from"@fjall/util";const O=["A","AAAA","CNAME","MX","TXT","NS","SRV","CAA"],J=new Map(O.map((e,n)=>[e,n]));function b(e,n){return e==="@"&&n!=="@"?-1:e!=="@"&&n==="@"?1:e.localeCompare(n)}o(b,"compareName");function C(e,n){const t=Array.isArray(e)?e.join(`
|
|
2
2
|
`):e,i=Array.isArray(n)?n.join(`
|
|
3
|
-
`):n;return t.localeCompare(i)}o(C,"compareValue");function p(e){const n=e.kind==="standard"?0:1,t=J.get(e.type)??99;return[n,t,e.name]}o(p,"recordSortKey");function R(e){return[...e].sort((n,t)=>{const[i,c,f]=p(n),[s,d,m]=p(t);if(i!==s)return i-s;if(c!==d)return c-d;const u=b(f,m);return u!==0?u:n.kind==="standard"&&t.kind==="standard"?C(n.value,t.value):0})}o(R,"sortRecords");function I(e){return Array.isArray(e)?`[${e.map(t=>JSON.stringify(t)).join(", ")}]`:JSON.stringify(e)}o(I,"formatValue");function P(e){const n=[`type: ${JSON.stringify(e.type)}`,`name: ${JSON.stringify(e.name)}`];return e.id!==void 0&&n.push(`id: ${JSON.stringify(e.id)}`),n.push(`value: ${I(e.value)}`),e.ttl!==void 0&&n.push(`ttl: ${e.ttl}`),`{ ${n.join(", ")} }`}o(P,"emitStandardRecord");function v(e){switch(e.kind){case"ecs":return e.computeName===void 0?`fjallApp(${JSON.stringify(e.appName)})`:`fjallApp(${JSON.stringify(e.appName)}, ${JSON.stringify(e.computeName)})`;case"cdn":return`fjallCdn(${JSON.stringify(e.appName)})`;case"bucket":return`fjallBucket(${JSON.stringify(e.bucketName)})`;case"custom":return`aliasTo(${JSON.stringify(e.dnsName)}, ${JSON.stringify(e.hostedZoneId)})`}}o(v,"emitAliasTarget");function x(e){const n=[`type: ${JSON.stringify(e.type)}`,`name: ${JSON.stringify(e.name)}`];return e.id!==void 0&&n.push(`id: ${JSON.stringify(e.id)}`),n.push(`target: ${v(e.target)}`),`{ ${n.join(", ")} }`}o(x,"emitAliasRecord");function T(e){return e.kind==="standard"?P(e):x(e)}o(T,"emitRecordObjectText");function w(e){return` ${T(e)},`}o(w,"emitRecord");function z(e){const n=[`domainName: ${JSON.stringify(e.domainName)}`];if(e.subjectAlternativeNames&&e.subjectAlternativeNames.length>0){const t=e.subjectAlternativeNames.map(i=>JSON.stringify(i)).join(", ");n.push(`subjectAlternativeNames: [${t}]`)}return e.transparencyLogging!==void 0&&n.push(`transparencyLogging: ${e.transparencyLogging}`),e.cloudFront!==void 0&&n.push(`cloudFront: ${e.cloudFront}`),` { ${n.join(", ")} },`}o(z,"emitCertificate");function B(e,n){if(n.length===0)return"";const t=["","// Delegations (D8 \u2014 child writes NS; no parent-side records here):"];for(const i of n)t.push(`// ${i.subdomain}.${e} \u2192 deploy a Domain { registrar: "external-delegated",`,`// zoneName: ${JSON.stringify(e)}, delegatedSubdomain: ${JSON.stringify(i.subdomain)} }`,`// in account ${JSON.stringify(i.toAccount)}; the CLI injects parentDelegationRoleArn`,"// (ManagedDomainBinding.delegationRoleArn) and the child UPSERTs its NS into this zone.");return t.join(`
|
|
3
|
+
`):n;return t.localeCompare(i)}o(C,"compareValue");function p(e){const n=e.kind==="standard"?0:1,t=J.get(e.type)??99;return[n,t,e.name]}o(p,"recordSortKey");function R(e){return[...e].sort((n,t)=>{const[i,c,f]=p(n),[s,d,m]=p(t);if(i!==s)return i-s;if(c!==d)return c-d;const u=b(f,m);return u!==0?u:n.kind==="standard"&&t.kind==="standard"?C(n.value,t.value):0})}o(R,"sortRecords");function I(e){return Array.isArray(e)?`[${e.map(t=>JSON.stringify(t)).join(", ")}]`:JSON.stringify(e)}o(I,"formatValue");function P(e){const n=[`type: ${JSON.stringify(e.type)}`,`name: ${JSON.stringify(e.name)}`];return e.id!==void 0&&n.push(`id: ${JSON.stringify(e.id)}`),n.push(`value: ${I(e.value)}`),e.ttl!==void 0&&n.push(`ttl: ${e.ttl}`),`{ ${n.join(", ")} }`}o(P,"emitStandardRecord");function v(e){switch(e.kind){case"ecs":return e.computeName===void 0?`fjallApp(${JSON.stringify(e.appName)})`:`fjallApp(${JSON.stringify(e.appName)}, ${JSON.stringify(e.computeName)})`;case"cdn":return`fjallCdn(${JSON.stringify(e.appName)})`;case"bucket":return`fjallBucket(${JSON.stringify(e.appName)}, ${JSON.stringify(e.bucketName)})`;case"custom":return`aliasTo(${JSON.stringify(e.dnsName)}, ${JSON.stringify(e.hostedZoneId)})`}}o(v,"emitAliasTarget");function x(e){const n=[`type: ${JSON.stringify(e.type)}`,`name: ${JSON.stringify(e.name)}`];return e.id!==void 0&&n.push(`id: ${JSON.stringify(e.id)}`),n.push(`target: ${v(e.target)}`),`{ ${n.join(", ")} }`}o(x,"emitAliasRecord");function T(e){return e.kind==="standard"?P(e):x(e)}o(T,"emitRecordObjectText");function w(e){return` ${T(e)},`}o(w,"emitRecord");function z(e){const n=[`domainName: ${JSON.stringify(e.domainName)}`];if(e.subjectAlternativeNames&&e.subjectAlternativeNames.length>0){const t=e.subjectAlternativeNames.map(i=>JSON.stringify(i)).join(", ");n.push(`subjectAlternativeNames: [${t}]`)}return e.transparencyLogging!==void 0&&n.push(`transparencyLogging: ${e.transparencyLogging}`),e.cloudFront!==void 0&&n.push(`cloudFront: ${e.cloudFront}`),` { ${n.join(", ")} },`}o(z,"emitCertificate");function B(e,n){if(n.length===0)return"";const t=["","// Delegations (D8 \u2014 child writes NS; no parent-side records here):"];for(const i of n)t.push(`// ${i.subdomain}.${e} \u2192 deploy a Domain { registrar: "external-delegated",`,`// zoneName: ${JSON.stringify(e)}, delegatedSubdomain: ${JSON.stringify(i.subdomain)} }`,`// in account ${JSON.stringify(i.toAccount)}; the CLI injects parentDelegationRoleArn`,"// (ManagedDomainBinding.delegationRoleArn) and the child UPSERTs its NS into this zone.");return t.join(`
|
|
4
4
|
`)+`
|
|
5
5
|
`}o(B,"emitDelegationGuidance");function F(e){const n={fjallApp:!1,fjallCdn:!1,fjallBucket:!1,aliasTo:!1};for(const t of e)if(t.kind==="alias")switch(t.target.kind){case"ecs":n.fjallApp=!0;break;case"cdn":n.fjallCdn=!0;break;case"bucket":n.fjallBucket=!0;break;case"custom":n.aliasTo=!0;break}return n}o(F,"computeUsedHelpers");function L(e){const n=["App","Domain"];return e.aliasTo&&n.push("aliasTo"),e.fjallApp&&n.push("fjallApp"),e.fjallBucket&&n.push("fjallBucket"),e.fjallCdn&&n.push("fjallCdn"),`import {
|
|
6
6
|
${n.map(i=>` ${i},`).join(`
|
|
@@ -1,26 +1,30 @@
|
|
|
1
|
-
var
|
|
2
|
-
secondaryRegions: [${h(e.secondaryRegions)}],`),n+=
|
|
3
|
-
`:""}${
|
|
4
|
-
${f.factory}.build(${s(
|
|
1
|
+
var y=Object.defineProperty;var t=(e,n)=>y(e,"name",{value:n,configurable:!0});import{buildProperty as r,connectionEnvSuffix as m,formatValue as a,getVariableName as p,emitExtraProperties as g,escapeStringLiteral as s,formatStringArray as h,emitProductionAlertsTopicSpread as A}from"./common.js";import{DATABASE_INVOCATION as f}from"./statementInvocation.js";import{DATABASE_SSL_VALUE as b,buildConnectionWiringEntries as x,renderWiringValueSource as S}from"./connectionWiring.js";import{CREDENTIAL_KEYS as U,DATABASE_ACCESSORS as z,DATABASE_ENV_VARS as F,DATABASE_SSL_VALUE as O}from"./connectionWiring.js";function $(e,n){const o=n.connectedDatabase;return o?.length?e.database.filter(i=>o.includes(i.name)):[]}t($,"getConnectedDatabases");function k(e){const n=[];for(const[o,i]of e.entries()){const u=p(i),d=m(o);for(const c of x("database",d))n.push({key:c.key,expression:S(c.value,u),isSecret:c.target==="secretsImport"})}return n}t(k,"generateDatabaseEnvVarEntries");function P(e){return`connections: [${e.map(o=>p(o)).join(", ")}],`}t(P,"formatConnectionsCode");function E(e){return e.expression===s(b)?b:{__expression:e.expression}}t(E,"toDatabaseEnvVarValue");function G(e,n){const o={},i={};if(!n.needsConnection||!n.connectedDatabase?.length)return{env:o,secrets:i};const u=$(e,n),d=k(u);for(const c of d){const l=E(c);c.isSecret?i[c.key]={__expression:c.expression}:o[c.key]=l}return{env:o,secrets:i}}t(G,"buildDatabaseEnvVars");function D(e){let n="";return n+=r(e.port!==void 0,"port",e.port),n+=r(e.deletionProtection!==void 0,"deletionProtection",e.deletionProtection),n+=r(e.snapshotIdentifier!==void 0,"snapshotIdentifier",e.snapshotIdentifier,"string"),n+=r(e.snapshotUsername!==void 0,"snapshotUsername",e.snapshotUsername,"string"),n+=r(e.monitoringInterval!==void 0,"monitoringInterval",e.monitoringInterval),n}t(D,"generateDatabaseSharedProps");function I(e){if(e.type!=="Instance")return"";let n="";return n+=r(e.instanceType!==void 0,"instanceType",e.instanceType,"string"),n+=r(e.allocatedStorage!==void 0,"allocatedStorage",e.allocatedStorage),n+=r(e.multiAz!==void 0,"multiAz",e.multiAz),n+=r(e.publiclyAccessible!==void 0,"publiclyAccessible",e.publiclyAccessible),n+=r(e.encryption!==void 0,"encryption",e.encryption,"object"),n+=r(e.databaseInsights!==void 0,"databaseInsights",e.databaseInsights,"boolean-or-object"),n+=r(e.proxy!==void 0,"proxy",e.proxy,"boolean-or-object"),n+=r(e.readReplica!==void 0,"readReplica",e.readReplica,"boolean-or-object"),n+=r(e.credentials!==void 0,"credentials",e.credentials,"object"),n+=r(e.backupRetention!==void 0,"backupRetention",e.backupRetention),n}t(I,"generateDatabaseInstanceProps");function R(e){if(e.type!=="Aurora"&&e.type!=="GlobalAurora")return"";let n="";return n+=r(e.encryption!==void 0,"encryption",e.encryption,"object"),n+=r(e.databaseInsights!==void 0,"databaseInsights",e.databaseInsights,"boolean-or-object"),n+=r(e.proxy!==void 0,"proxy",e.proxy,"boolean-or-object"),n+=r(e.credentials!==void 0,"credentials",e.credentials,"object"),n+=r(e.writer!==void 0,"writer",e.writer,"object"),n+=r(e.readers!==void 0,"readers",e.readers,"boolean-or-object"),n+=r(e.backupRetention!==void 0,"backupRetention",e.backupRetention),n+=r(e.preferredMaintenanceWindow!==void 0,"preferredMaintenanceWindow",e.preferredMaintenanceWindow,"string"),n}t(R,"generateDatabaseAuroraProps");function V(e){if(e.type!=="GlobalAurora")return"";let n="";return n+=r(e.primaryRegion!==void 0,"primaryRegion",e.primaryRegion,"string"),e.secondaryRegions!==void 0&&e.secondaryRegions.length>0&&(n+=`
|
|
2
|
+
secondaryRegions: [${h(e.secondaryRegions)}],`),n+=r(e.globalClusterIdentifier!==void 0,"globalClusterIdentifier",e.globalClusterIdentifier,"string"),n+=r(e.enableGlobalWriteForwarding!==void 0,"enableGlobalWriteForwarding",e.enableGlobalWriteForwarding),n}t(V,"generateDatabaseGlobalAuroraProps");function C(e,n){return n.compute.some(o=>o.needsConnection&&o.connectedDatabase?.includes(e.name))}t(C,"databaseNeedsVariable");function M(e){if(e.database.length===0)return"";let n="";for(let o=0;o<e.database.length;o++){const i=e.database[o],u=p(i),d=C(i,e),c=o>0,l=d?`const ${u} = `:"";n+=`${c?`
|
|
3
|
+
`:""}${l}app.${f.appMethod}(
|
|
4
|
+
${f.factory}.build(${s(i.name)}, {
|
|
5
5
|
vpc: app.getVpc(),
|
|
6
|
-
type: ${s(
|
|
7
|
-
databaseName: ${s(
|
|
8
|
-
engine: ${
|
|
9
|
-
databaseEngine: ${s(
|
|
10
|
-
alarms: false,`:typeof
|
|
11
|
-
alarms: ${a(
|
|
6
|
+
type: ${s(i.type)},
|
|
7
|
+
databaseName: ${s(i.databaseName)},`,i.engineExpression?n+=`
|
|
8
|
+
engine: ${i.engineExpression},`:i.databaseEngine&&(n+=`
|
|
9
|
+
databaseEngine: ${s(i.databaseEngine)},`),n+=D(i),n+=I(i),n+=R(i),n+=V(i),n+=g(i.extraProperties),i.alarms===!1?n+=`
|
|
10
|
+
alarms: false,`:typeof i.alarms=="object"&&(n+=`
|
|
11
|
+
alarms: ${a(i.alarms," ")},`),i.type!=="GlobalAurora"&&(n+=A()),n+=`
|
|
12
12
|
})
|
|
13
13
|
);
|
|
14
|
-
`}return n}t(
|
|
15
|
-
`:"",
|
|
16
|
-
${f.factory}.build(${s(
|
|
14
|
+
`}return n}t(M,"generateDatabaseCode");function W(e){if(!e.clickhouse||e.clickhouse.length===0)return"";let n="";for(let o=0;o<e.clickhouse.length;o++){const i=e.clickhouse[o],u=p(i),d=T(i,e),c=o>0?`
|
|
15
|
+
`:"",l=d?`const ${u} = `:"";n+=`${c}${l}app.${f.appMethod}(
|
|
16
|
+
${f.factory}.build(${s(i.name)}, {
|
|
17
17
|
type: "ClickHouse",
|
|
18
|
-
databaseName: ${s(
|
|
19
|
-
instanceType: ${s(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
databaseName: ${s(i.databaseName)},`,i.instanceType!==void 0&&(n+=`
|
|
19
|
+
instanceType: ${s(i.instanceType)},`),i.storageGb!==void 0&&(n+=`
|
|
20
|
+
storageGb: ${i.storageGb},`),i.iops!==void 0&&(n+=`
|
|
21
|
+
iops: ${i.iops},`),i.throughputMbps!==void 0&&(n+=`
|
|
22
|
+
throughputMbps: ${i.throughputMbps},`),i.coldTier!==void 0&&(n+=`
|
|
23
|
+
coldTier: ${a(i.coldTier," ")},`),i.optimiseSchedule!==void 0&&(n+=`
|
|
24
|
+
optimiseSchedule: ${a(i.optimiseSchedule," ")},`),i.backupSchedule!==void 0&&(n+=`
|
|
25
|
+
backupSchedule: ${a(i.backupSchedule," ")},`),i.backupVerify!==void 0&&(n+=`
|
|
26
|
+
backupVerify: ${a(i.backupVerify," ")},`),i.backupRetentionDays!==void 0&&(n+=`
|
|
27
|
+
backupRetentionDays: ${i.backupRetentionDays},`),n+=g(i.extraProperties),n+=`
|
|
24
28
|
})
|
|
25
29
|
);
|
|
26
|
-
`}return n}t(
|
|
30
|
+
`}return n}t(W,"generateClickHouseCode");function T(e,n){return n.compute.some(o=>o.connectedDatabase?.includes(e.name))}t(T,"clickhouseNeedsVariable");export{U as CREDENTIAL_KEYS,z as DATABASE_ACCESSORS,F as DATABASE_ENV_VARS,O as DATABASE_SSL_VALUE,G as buildDatabaseEnvVars,T as clickhouseNeedsVariable,C as databaseNeedsVariable,P as formatConnectionsCode,W as generateClickHouseCode,M as generateDatabaseCode,k as generateDatabaseEnvVarEntries,$ as getConnectedDatabases,E as toDatabaseEnvVarValue};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var c=Object.defineProperty;var t=(a,e)=>c(a,"name",{value:e,configurable:!0});import{STORAGE_PRESETS as u}from"../presets/storagePresets.js";function s(a,...e){const n={};for(const r of e)a[r]!==void 0&&(n[r]=a[r]);return n}t(s,"pickDefined");function b(a,e){const n={name:a,type:e.databaseType,databaseName:e.databaseName,...s(e,"databaseInsights","port","proxy","credentials","encryption","deletionProtection")};switch(e.databaseType){case"Instance":return{...n,...s(e,"instanceType","multiAz","readReplica","publiclyAccessible","backupRetention","allocatedStorage","snapshotIdentifier","snapshotUsername")};case"Aurora":return{...n,...s(e,"writer","readers","backupRetention","preferredMaintenanceWindow","monitoringInterval","snapshotIdentifier","snapshotUsername")};case"GlobalAurora":return{...n,primaryRegion:e.primaryRegion,...e.secondaryRegions&&e.secondaryRegions.length>0&&{secondaryRegions:e.secondaryRegions},...s(e,"globalClusterIdentifier","enableGlobalWriteForwarding","writer","readers","backupRetention","preferredMaintenanceWindow","monitoringInterval","snapshotIdentifier","snapshotUsername")};default:return e}}t(b,"buildRelationalResourcePlan");function m(a){return`${a}Database`}t(m,"defaultRelationalDatabaseName");function
|
|
1
|
+
var c=Object.defineProperty;var t=(a,e)=>c(a,"name",{value:e,configurable:!0});import{STORAGE_PRESETS as u}from"../presets/storagePresets.js";function s(a,...e){const n={};for(const r of e)a[r]!==void 0&&(n[r]=a[r]);return n}t(s,"pickDefined");function b(a,e){const n={name:a,type:e.databaseType,databaseName:e.databaseName,...s(e,"databaseInsights","port","proxy","credentials","encryption","deletionProtection")};switch(e.databaseType){case"Instance":return{...n,...s(e,"instanceType","multiAz","readReplica","publiclyAccessible","backupRetention","allocatedStorage","snapshotIdentifier","snapshotUsername")};case"Aurora":return{...n,...s(e,"writer","readers","backupRetention","preferredMaintenanceWindow","monitoringInterval","snapshotIdentifier","snapshotUsername")};case"GlobalAurora":return{...n,primaryRegion:e.primaryRegion,...e.secondaryRegions&&e.secondaryRegions.length>0&&{secondaryRegions:e.secondaryRegions},...s(e,"globalClusterIdentifier","enableGlobalWriteForwarding","writer","readers","backupRetention","preferredMaintenanceWindow","monitoringInterval","snapshotIdentifier","snapshotUsername")};default:return e}}t(b,"buildRelationalResourcePlan");function m(a){return`${a}Database`}t(m,"defaultRelationalDatabaseName");function p(a,e){return`Database name '${a}' already exists in ${e}. Please choose a different database name.`}t(p,"duplicateDatabaseNameMessage");function f(a,e){const n=a.find(o=>o.name===e.databaseName||o.databaseName===e.databaseName);if(!n)return{ok:!1,message:`Database '${e.databaseName}' not found. Available databases: ${a.map(o=>o.name).join(", ")||"none"}`};if(n.proxy!==void 0&&n.proxy!==!1)return{ok:!1,message:`Database '${n.name}' already has RDS Proxy enabled.`};const r=s(e,"maxConnections","maxIdleConnections","connectionBorrowTimeout","requireTLS");return{ok:!0,database:n,proxyValue:Object.keys(r).length>0?r:{}}}t(f,"resolveProxyAddition");function y(a,e){return{name:a,type:"ClickHouse",databaseName:e.databaseName,...s(e,"instanceType","storageGb","iops","throughputMbps","coldTier","optimiseSchedule","backupSchedule","backupVerify","backupRetentionDays")}}t(y,"buildClickHouseResourcePlan");function g(a,e,n){const r=e.storagePreset??"standard",o=u[r],i=n===0?"":`${n+1}`;return{name:a,bucketName:e.bucketName,variableName:`bucket${i}`,...o,...s(e,"publicReadAccess","websiteHosting","backupVaultTier","versioned","encryption","kmsKeyArn","cors")}}t(g,"buildS3ResourcePlan");export{y as buildClickHouseResourcePlan,b as buildRelationalResourcePlan,g as buildS3ResourcePlan,m as defaultRelationalDatabaseName,p as duplicateDatabaseNameMessage,s as pickDefined,f as resolveProxyAddition};
|
|
@@ -9,9 +9,20 @@
|
|
|
9
9
|
* The R2 cold tier from the original construct was dropped per D12; only the
|
|
10
10
|
* S3 cold tier (`{ mode: "s3" }`) is valid.
|
|
11
11
|
*/
|
|
12
|
+
import type { ClickHouseInstanceType } from "@fjall/util/clickhouse";
|
|
12
13
|
export interface ClickHouseTierPreset {
|
|
13
|
-
/** EC2 instance type (default per tier).
|
|
14
|
-
|
|
14
|
+
/** EC2 instance type (default per tier). Typed against the shared
|
|
15
|
+
* vocabulary so a preset naming a type the construct does not support
|
|
16
|
+
* fails to compile — the resilient/enterprise tiers shipped exactly that
|
|
17
|
+
* drift (`m6g.*`), and every scaffold from them died at synth. */
|
|
18
|
+
instanceType?: ClickHouseInstanceType;
|
|
19
|
+
/** EBS data-volume size in GiB (default per tier). */
|
|
20
|
+
storageGb?: number;
|
|
21
|
+
/** Provisioned gp3 IOPS. No tier sets it — the baseline is included in the
|
|
22
|
+
* volume price and the default workload is not IOPS-bound. */
|
|
23
|
+
iops?: number;
|
|
24
|
+
/** Provisioned gp3 throughput in MiB/s. No tier sets it, as with `iops`. */
|
|
25
|
+
throughputMbps?: number;
|
|
15
26
|
/**
|
|
16
27
|
* Cold tier configuration. `false` disables; `{ mode: "s3" }` enables an
|
|
17
28
|
* S3-backed cold tier per D12.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var C=Object.defineProperty;var r=(e,t)=>C(e,"name",{value:t,configurable:!0});import{TIER_NAMES as f}from"../schemas/sharedTypes.js";import{TIER_NAMES as P,CUSTOM_TIER as R,APP_TYPES as G}from"../schemas/sharedTypes.js";const s="service",u="0 4 * * ? *",p="0 5 * * ? *",n=Object.freeze({tinkerer:{displayName:"Tinkerer",description:"Free tier eligible, minimal cost for experimentation",database:{Instance:{instanceType:"t4g.micro",multiAz:!1,proxy:!1,readReplica:!1,publiclyAccessible:!0},Aurora:null,GlobalAurora:null,ClickHouse:null},compute:{ecs:{services:[{name:s,capacityProvider:"EC2",desiredCount:1,minCapacity:1,maxCapacity:1,ec2Config:{instanceType:"t4g.micro",amiHardwareType:"ARM",minCapacity:1,maxCapacity:1,memoryLimitMiB:400}}],cluster:{directAccess:!0}},lambda:{timeout:30,memory:128}},network:{maxAzs:2,natGateways:!1,flowLogs:!1},backup:!1},lightweight:{displayName:"Lightweight",description:"Streamlined single-AZ deployment for cost efficiency",database:{Instance:{instanceType:"t4g.small",multiAz:!1},Aurora:{readers:!1},GlobalAurora:null,ClickHouse:null},compute:{ecs:{services:[{name:s,capacityProvider:"FARGATE_SPOT",cpu:256,memoryLimitMiB:512,desiredCount:1,minCapacity:1,maxCapacity:3}]},lambda:{timeout:30,memory:256}},network:{maxAzs:2,natGateways:{count:1},flowLogs:!1},backup:!1},standard:{displayName:"Standard",description:"Production-ready with sensible defaults",database:{Instance:{instanceType:"t4g.large"},Aurora:{readers:{count:1}},GlobalAurora:{readers:{count:1}},ClickHouse:{instanceType:"t4g.medium",coldTier:{mode:"s3"},optimiseSchedule:u,backupSchedule:p,backupRetentionDays:14}},compute:{ecs:{services:[{name:s,capacityProvider:"FARGATE",cpu:512,memoryLimitMiB:1024,desiredCount:2,minCapacity:2,maxCapacity:5}]},lambda:{timeout:60,memory:256}},network:{maxAzs:3,natGateways:{count:1},flowLogs:{},vpcEndpoints:{interface:{ecr:!0}}},backup:!1},resilient:{displayName:"Resilient",description:"High availability with enhanced monitoring and scaling",database:{Instance:{instanceType:"r7g.large",encryption:{storageKey:{useCMK:!0}},databaseInsights:{mode:"advanced",encryptionKey:{useCMK:!0}},proxy:{requireTLS:!0}},Aurora:{readers:{count:2},encryption:{storageKey:{useCMK:!0}},databaseInsights:{mode:"advanced",encryptionKey:{useCMK:!0}},proxy:{requireTLS:!0},backupRetention:30},GlobalAurora:{readers:{count:2},encryption:{storageKey:{useCMK:!0}},databaseInsights:{mode:"advanced",encryptionKey:{useCMK:!0}},proxy:{requireTLS:!0},backupRetention:30,enableGlobalWriteForwarding:!0},ClickHouse:{instanceType:"
|
|
1
|
+
var C=Object.defineProperty;var r=(e,t)=>C(e,"name",{value:t,configurable:!0});import{TIER_NAMES as f}from"../schemas/sharedTypes.js";import{TIER_NAMES as P,CUSTOM_TIER as R,APP_TYPES as G}from"../schemas/sharedTypes.js";const s="service",u="cron(0 4 * * ? *)",p="cron(0 5 * * ? *)",n=Object.freeze({tinkerer:{displayName:"Tinkerer",description:"Free tier eligible, minimal cost for experimentation",database:{Instance:{instanceType:"t4g.micro",multiAz:!1,proxy:!1,readReplica:!1,publiclyAccessible:!0},Aurora:null,GlobalAurora:null,ClickHouse:null},compute:{ecs:{services:[{name:s,capacityProvider:"EC2",desiredCount:1,minCapacity:1,maxCapacity:1,ec2Config:{instanceType:"t4g.micro",amiHardwareType:"ARM",minCapacity:1,maxCapacity:1,memoryLimitMiB:400}}],cluster:{directAccess:!0}},lambda:{timeout:30,memory:128}},network:{maxAzs:2,natGateways:!1,flowLogs:!1},backup:!1},lightweight:{displayName:"Lightweight",description:"Streamlined single-AZ deployment for cost efficiency",database:{Instance:{instanceType:"t4g.small",multiAz:!1},Aurora:{readers:!1},GlobalAurora:null,ClickHouse:null},compute:{ecs:{services:[{name:s,capacityProvider:"FARGATE_SPOT",cpu:256,memoryLimitMiB:512,desiredCount:1,minCapacity:1,maxCapacity:3}]},lambda:{timeout:30,memory:256}},network:{maxAzs:2,natGateways:{count:1},flowLogs:!1},backup:!1},standard:{displayName:"Standard",description:"Production-ready with sensible defaults",database:{Instance:{instanceType:"t4g.large"},Aurora:{readers:{count:1}},GlobalAurora:{readers:{count:1}},ClickHouse:{instanceType:"t4g.medium",coldTier:{mode:"s3"},optimiseSchedule:u,backupSchedule:p,backupRetentionDays:14}},compute:{ecs:{services:[{name:s,capacityProvider:"FARGATE",cpu:512,memoryLimitMiB:1024,desiredCount:2,minCapacity:2,maxCapacity:5}]},lambda:{timeout:60,memory:256}},network:{maxAzs:3,natGateways:{count:1},flowLogs:{},vpcEndpoints:{interface:{ecr:!0}}},backup:!1},resilient:{displayName:"Resilient",description:"High availability with enhanced monitoring and scaling",database:{Instance:{instanceType:"r7g.large",encryption:{storageKey:{useCMK:!0}},databaseInsights:{mode:"advanced",encryptionKey:{useCMK:!0}},proxy:{requireTLS:!0}},Aurora:{readers:{count:2},encryption:{storageKey:{useCMK:!0}},databaseInsights:{mode:"advanced",encryptionKey:{useCMK:!0}},proxy:{requireTLS:!0},backupRetention:30},GlobalAurora:{readers:{count:2},encryption:{storageKey:{useCMK:!0}},databaseInsights:{mode:"advanced",encryptionKey:{useCMK:!0}},proxy:{requireTLS:!0},backupRetention:30,enableGlobalWriteForwarding:!0},ClickHouse:{instanceType:"m7g.large",coldTier:{mode:"s3"},optimiseSchedule:u,backupSchedule:p,backupRetentionDays:14}},compute:{ecs:{services:[{name:s,capacityProvider:"FARGATE",cpu:1024,memoryLimitMiB:2048,desiredCount:4,minCapacity:4,maxCapacity:20}]},lambda:{timeout:120,memory:512}},network:{maxAzs:3,natGateways:{count:3},flowLogs:{retentionDays:90},vpcEndpoints:{interface:{ecr:!0,secretsManager:!0}}},backup:{tier:"resilient"}},enterprise:{displayName:"Enterprise",description:"Maximum capability with all features enabled",database:{Instance:{instanceType:"r7g.xlarge",encryption:{storageKey:{useCMK:!0}},databaseInsights:{mode:"advanced",encryptionKey:{useCMK:!0}},proxy:{requireTLS:!0},readReplica:{}},Aurora:{readers:{count:2},encryption:{storageKey:{useCMK:!0}},databaseInsights:{mode:"advanced",encryptionKey:{useCMK:!0}},proxy:{requireTLS:!0},backupRetention:35},GlobalAurora:{readers:{count:2},encryption:{storageKey:{useCMK:!0}},databaseInsights:{mode:"advanced",encryptionKey:{useCMK:!0}},proxy:{requireTLS:!0},backupRetention:35,enableGlobalWriteForwarding:!0},ClickHouse:{instanceType:"m7g.xlarge",coldTier:{mode:"s3"},optimiseSchedule:u,backupSchedule:p,backupRetentionDays:30}},compute:{ecs:{services:[{name:s,capacityProvider:"FARGATE",cpu:2048,memoryLimitMiB:4096,desiredCount:6,minCapacity:6,maxCapacity:100}]},lambda:{timeout:300,memory:1024}},network:{maxAzs:3,natGateways:{count:3},flowLogs:{destination:"s3",retentionDays:365},vpcEndpoints:{interface:{ecr:!0,secretsManager:!0,kms:!0,cloudwatchLogs:!0}}},backup:{tier:"enterprise"}}});function E(e,t){return n[e].database[t]}r(E,"getDatabasePreset");function v(e){return n[e].compute.ecs}r(v,"getEcsPreset");function h(e){return n[e].network}r(h,"getNetworkPreset");function T(e){return f.filter(t=>n[t].database[e]!==null)}r(T,"getAvailableTiersForDatabase");function L(e){return T(e).map(t=>({label:n[t].displayName,value:t,description:n[t].description}))}r(L,"getTierOptionsForDatabase");function M(e){switch(e){case"tinkerer":case"lightweight":case"standard":return"Instance";case"resilient":case"enterprise":return"Aurora"}}r(M,"getDefaultDatabaseTypeForTier");function S(e,t){const o=n[e].compute.ecs,i=o.services[0],m=!o.cluster?.directAccess&&o.cluster?.loadBalancer!==!1,y=t.filter(a=>a.serviceType!=="worker").length,b=t.findIndex(a=>a.serviceType!=="worker");return t.map((a,l)=>{const d=l===b,g=a.serviceType==="worker";let c;return m&&!g&&(a.routing?c=a.routing:y>1&&(c={path:d?"/*":`/${a.name.toLowerCase()}/*`,...d?{}:{priority:100+l}})),{name:a.name,capacityProvider:i.capacityProvider,ec2Config:i.ec2Config,cpu:i.cpu,memoryLimitMiB:i.memoryLimitMiB,desiredCount:i.desiredCount,minCapacity:i.minCapacity,maxCapacity:i.maxCapacity,routing:c}})}r(S,"applyTierDefaultsToServices");export{G as APP_TYPES,R as CUSTOM_TIER,P as TIER_NAMES,n as TIER_PRESETS,S as applyTierDefaultsToServices,T as getAvailableTiersForDatabase,E as getDatabasePreset,M as getDefaultDatabaseTypeForTier,v as getEcsPreset,h as getNetworkPreset,L as getTierOptionsForDatabase};
|
|
@@ -811,11 +811,15 @@ export declare const ApplicationResourcePlanSchema: z.ZodObject<{
|
|
|
811
811
|
type: z.ZodLiteral<"ClickHouse">;
|
|
812
812
|
databaseName: z.ZodString;
|
|
813
813
|
instanceType: z.ZodOptional<z.ZodString>;
|
|
814
|
+
storageGb: z.ZodOptional<z.ZodNumber>;
|
|
815
|
+
iops: z.ZodOptional<z.ZodNumber>;
|
|
816
|
+
throughputMbps: z.ZodOptional<z.ZodNumber>;
|
|
814
817
|
coldTier: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
815
818
|
mode: z.ZodLiteral<"s3">;
|
|
816
819
|
}, z.core.$strict>, z.ZodLiteral<false>]>>;
|
|
817
820
|
optimiseSchedule: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
|
|
818
821
|
backupSchedule: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
|
|
822
|
+
backupVerify: z.ZodOptional<z.ZodLiteral<false>>;
|
|
819
823
|
backupRetentionDays: z.ZodOptional<z.ZodNumber>;
|
|
820
824
|
variableName: z.ZodOptional<z.ZodString>;
|
|
821
825
|
extraProperties: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -1,7 +1,49 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export type { DatabaseType } from "./constants.js";
|
|
3
|
-
/**
|
|
3
|
+
/** RDS automated-backup retention. Range: 1-35 days — the AWS cap on the
|
|
4
|
+
* automated-backup mechanism. ClickHouse keeps backups as S3 objects and
|
|
5
|
+
* does not share this ceiling; it has its own schema below. */
|
|
4
6
|
export declare const BackupRetentionSchema: z.ZodNumber;
|
|
7
|
+
/** ClickHouse data-volume size in GiB. Bounds live in `@fjall/util` because
|
|
8
|
+
* the construct enforces the same pair at synth — see the drift note there. */
|
|
9
|
+
export declare const ClickHouseStorageSchema: z.ZodNumber;
|
|
10
|
+
export type ClickHouseStorage = z.infer<typeof ClickHouseStorageSchema>;
|
|
11
|
+
/** ClickHouse gp3 provisioned IOPS / throughput — the RDS "provisioned
|
|
12
|
+
* IOPS / storage throughput" knobs. Only each value's own band is checkable
|
|
13
|
+
* here; the 4 IOPS per MiB/s and 500 IOPS per GiB couplings need the other
|
|
14
|
+
* value and the size in view, and a discriminated-union member cannot carry
|
|
15
|
+
* a `.refine`, so the construct enforces them at synth with the same bounds. */
|
|
16
|
+
export declare const ClickHouseIopsSchema: z.ZodNumber;
|
|
17
|
+
export type ClickHouseIops = z.infer<typeof ClickHouseIopsSchema>;
|
|
18
|
+
export declare const ClickHouseThroughputSchema: z.ZodNumber;
|
|
19
|
+
export type ClickHouseThroughput = z.infer<typeof ClickHouseThroughputSchema>;
|
|
20
|
+
/** ClickHouse EC2 instance type. The vocabulary lives in `@fjall/util`
|
|
21
|
+
* because the construct keys its hardware-spec table on the same tuple —
|
|
22
|
+
* see the drift note there: the resilient/enterprise presets once shipped
|
|
23
|
+
* `m6g.*` types the construct never supported, so every scaffold from
|
|
24
|
+
* those tiers failed at synth. Validating here surfaces the error at
|
|
25
|
+
* scaffold time with the legal values named. */
|
|
26
|
+
export declare const ClickHouseInstanceTypeSchema: z.ZodEnum<{
|
|
27
|
+
"t4g.medium": "t4g.medium";
|
|
28
|
+
"m7g.medium": "m7g.medium";
|
|
29
|
+
"m8g.medium": "m8g.medium";
|
|
30
|
+
"r7g.medium": "r7g.medium";
|
|
31
|
+
"r8g.medium": "r8g.medium";
|
|
32
|
+
"m7g.large": "m7g.large";
|
|
33
|
+
"m8g.large": "m8g.large";
|
|
34
|
+
"r7g.large": "r7g.large";
|
|
35
|
+
"r8g.large": "r8g.large";
|
|
36
|
+
"m7g.xlarge": "m7g.xlarge";
|
|
37
|
+
"m8g.xlarge": "m8g.xlarge";
|
|
38
|
+
"r7g.xlarge": "r7g.xlarge";
|
|
39
|
+
"r8g.xlarge": "r8g.xlarge";
|
|
40
|
+
}>;
|
|
41
|
+
export type ClickHouseInstanceTypeOption = z.infer<typeof ClickHouseInstanceTypeSchema>;
|
|
42
|
+
/** ClickHouse backup retention in days. Bounds live in `@fjall/util`
|
|
43
|
+
* because the construct enforces the same pair at synth — see the drift
|
|
44
|
+
* note there, which this knob is the reason for. */
|
|
45
|
+
export declare const ClickHouseBackupRetentionSchema: z.ZodNumber;
|
|
46
|
+
export type ClickHouseBackupRetention = z.infer<typeof ClickHouseBackupRetentionSchema>;
|
|
5
47
|
/** Reusable monitoring interval validation. Must be one of: 0, 1, 5, 10, 15, 30, 60. */
|
|
6
48
|
export declare const MonitoringIntervalSchema: z.ZodNumber;
|
|
7
49
|
/** Reusable database port validation. Range: 1024-65535. */
|
|
@@ -207,7 +249,7 @@ export declare const DatabaseResourcePlanSchema: z.ZodObject<{
|
|
|
207
249
|
* - Instance: instanceType, multiAz, readReplica
|
|
208
250
|
* - Aurora: writer, readers, backupRetention
|
|
209
251
|
* - GlobalAurora: primaryRegion (required!), secondaryRegions, enableGlobalWriteForwarding
|
|
210
|
-
* - ClickHouse: instanceType, coldTier, optimiseSchedule, backupSchedule, backupRetentionDays
|
|
252
|
+
* - ClickHouse: instanceType, storageGb, iops, throughputMbps, coldTier, optimiseSchedule, backupSchedule, backupVerify, backupRetentionDays
|
|
211
253
|
*/
|
|
212
254
|
export declare const DatabaseGeneratorSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
213
255
|
appName: z.ZodString;
|
|
@@ -400,12 +442,30 @@ export declare const DatabaseGeneratorSchema: z.ZodDiscriminatedUnion<[z.ZodObje
|
|
|
400
442
|
connectToServices: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
401
443
|
}, z.core.$strict>>;
|
|
402
444
|
databaseType: z.ZodLiteral<"ClickHouse">;
|
|
403
|
-
instanceType: z.ZodOptional<z.
|
|
445
|
+
instanceType: z.ZodOptional<z.ZodEnum<{
|
|
446
|
+
"t4g.medium": "t4g.medium";
|
|
447
|
+
"m7g.medium": "m7g.medium";
|
|
448
|
+
"m8g.medium": "m8g.medium";
|
|
449
|
+
"r7g.medium": "r7g.medium";
|
|
450
|
+
"r8g.medium": "r8g.medium";
|
|
451
|
+
"m7g.large": "m7g.large";
|
|
452
|
+
"m8g.large": "m8g.large";
|
|
453
|
+
"r7g.large": "r7g.large";
|
|
454
|
+
"r8g.large": "r8g.large";
|
|
455
|
+
"m7g.xlarge": "m7g.xlarge";
|
|
456
|
+
"m8g.xlarge": "m8g.xlarge";
|
|
457
|
+
"r7g.xlarge": "r7g.xlarge";
|
|
458
|
+
"r8g.xlarge": "r8g.xlarge";
|
|
459
|
+
}>>;
|
|
460
|
+
storageGb: z.ZodOptional<z.ZodNumber>;
|
|
461
|
+
iops: z.ZodOptional<z.ZodNumber>;
|
|
462
|
+
throughputMbps: z.ZodOptional<z.ZodNumber>;
|
|
404
463
|
coldTier: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
405
464
|
mode: z.ZodLiteral<"s3">;
|
|
406
465
|
}, z.core.$strict>, z.ZodLiteral<false>]>>;
|
|
407
466
|
optimiseSchedule: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
|
|
408
467
|
backupSchedule: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
|
|
468
|
+
backupVerify: z.ZodOptional<z.ZodLiteral<false>>;
|
|
409
469
|
backupRetentionDays: z.ZodOptional<z.ZodNumber>;
|
|
410
470
|
}, z.core.$strict>], "databaseType">;
|
|
411
471
|
export declare const DatabaseGeneratorSchemaFromUI: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
@@ -599,12 +659,30 @@ export declare const DatabaseGeneratorSchemaFromUI: z.ZodDiscriminatedUnion<[z.Z
|
|
|
599
659
|
}, z.core.$strict>>;
|
|
600
660
|
resourceName: z.ZodString;
|
|
601
661
|
databaseType: z.ZodLiteral<"ClickHouse">;
|
|
602
|
-
instanceType: z.ZodOptional<z.
|
|
662
|
+
instanceType: z.ZodOptional<z.ZodEnum<{
|
|
663
|
+
"t4g.medium": "t4g.medium";
|
|
664
|
+
"m7g.medium": "m7g.medium";
|
|
665
|
+
"m8g.medium": "m8g.medium";
|
|
666
|
+
"r7g.medium": "r7g.medium";
|
|
667
|
+
"r8g.medium": "r8g.medium";
|
|
668
|
+
"m7g.large": "m7g.large";
|
|
669
|
+
"m8g.large": "m8g.large";
|
|
670
|
+
"r7g.large": "r7g.large";
|
|
671
|
+
"r8g.large": "r8g.large";
|
|
672
|
+
"m7g.xlarge": "m7g.xlarge";
|
|
673
|
+
"m8g.xlarge": "m8g.xlarge";
|
|
674
|
+
"r7g.xlarge": "r7g.xlarge";
|
|
675
|
+
"r8g.xlarge": "r8g.xlarge";
|
|
676
|
+
}>>;
|
|
677
|
+
storageGb: z.ZodOptional<z.ZodNumber>;
|
|
678
|
+
iops: z.ZodOptional<z.ZodNumber>;
|
|
679
|
+
throughputMbps: z.ZodOptional<z.ZodNumber>;
|
|
603
680
|
coldTier: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
604
681
|
mode: z.ZodLiteral<"s3">;
|
|
605
682
|
}, z.core.$strict>, z.ZodLiteral<false>]>>;
|
|
606
683
|
optimiseSchedule: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
|
|
607
684
|
backupSchedule: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
|
|
685
|
+
backupVerify: z.ZodOptional<z.ZodLiteral<false>>;
|
|
608
686
|
backupRetentionDays: z.ZodOptional<z.ZodNumber>;
|
|
609
687
|
}, z.core.$strict>], "databaseType">;
|
|
610
688
|
/**
|
|
@@ -689,11 +767,15 @@ export declare const ClickHouseResourcePlanSchema: z.ZodObject<{
|
|
|
689
767
|
type: z.ZodLiteral<"ClickHouse">;
|
|
690
768
|
databaseName: z.ZodString;
|
|
691
769
|
instanceType: z.ZodOptional<z.ZodString>;
|
|
770
|
+
storageGb: z.ZodOptional<z.ZodNumber>;
|
|
771
|
+
iops: z.ZodOptional<z.ZodNumber>;
|
|
772
|
+
throughputMbps: z.ZodOptional<z.ZodNumber>;
|
|
692
773
|
coldTier: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
693
774
|
mode: z.ZodLiteral<"s3">;
|
|
694
775
|
}, z.core.$strict>, z.ZodLiteral<false>]>>;
|
|
695
776
|
optimiseSchedule: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
|
|
696
777
|
backupSchedule: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodLiteral<false>]>>;
|
|
778
|
+
backupVerify: z.ZodOptional<z.ZodLiteral<false>>;
|
|
697
779
|
backupRetentionDays: z.ZodOptional<z.ZodNumber>;
|
|
698
780
|
variableName: z.ZodOptional<z.ZodString>;
|
|
699
781
|
extraProperties: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{z as e}from"zod";import{VALIDATION_PATTERNS as I,VALIDATION_MESSAGES as o}from"../validation/patterns.js";import{DATABASE_TYPES as A,VALID_MONITORING_INTERVALS as M,DATABASE_ENGINES as y,constIncludes as h}from"./constants.js";import{optionalOrDisabled as i,ResourceNameSchema as t,AppNameSchema as c,DatabaseNameSchema as f,ExtraPropertySchema as l}from"./baseSchemas.js";import{RdsAlarmConfigSchema as G}from"./alarmSchemas.js";const a=e.number().int(o.BACKUP_RETENTION.INTEGER).min(1,o.BACKUP_RETENTION.MIN).max(35,o.BACKUP_RETENTION.MAX),p=e.number().int(o.MONITORING_INTERVAL.INTEGER).refine(n=>h(M,n),{message:o.MONITORING_INTERVAL.VALUES}),b=e.number().int(o.DATABASE.PORT.INTEGER).min(1024,o.DATABASE.PORT.MIN).max(65535,o.DATABASE.PORT.MAX),F=e.enum(A).describe(`Database type must be one of: ${A.join(", ")}`),U=e.object({maxConnections:e.number().int(o.MAX_CONNECTIONS.INTEGER).min(1,o.MAX_CONNECTIONS.MIN).max(100,o.MAX_CONNECTIONS.MAX).optional(),maxIdleConnections:e.number().int(o.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.INTEGER).min(0,o.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.MIN).max(100,o.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.MAX).optional(),connectionBorrowTimeout:e.number().int(o.PROXY_CONFIG.BORROW_TIMEOUT.INTEGER).min(1,o.PROXY_CONFIG.BORROW_TIMEOUT.MIN).max(3600,o.PROXY_CONFIG.BORROW_TIMEOUT.MAX).optional(),requireTLS:e.boolean().optional()}).strict().describe("RDS Proxy configuration"),X=e.object({instanceType:e.string().optional(),availabilityZone:e.string().optional()}).strict().describe("Read replica configuration"),B=e.object({automaticallyAfterDays:e.number().int(o.ROTATION.INTEGER).min(1,o.ROTATION.MIN).max(365,o.ROTATION.MAX).optional()}).strict().describe("Secret rotation configuration"),T=e.object({username:e.string().min(1,o.REQUIRED.USERNAME).max(63,o.USERNAME.MAX_LENGTH).optional(),secretRotation:B.optional()}).strict().describe("Database credentials configuration"),R=i(U),d=i(X),P=e.object({scaleWithWriter:e.boolean().optional(),enableDatabaseInsights:e.boolean().optional(),identifierSuffix:e.string().min(1,o.IDENTIFIER_SUFFIX.REQUIRED).max(50,o.IDENTIFIER_SUFFIX.MAX_LENGTH).optional(),availabilityZone:e.string().optional()}).strict().describe("Configuration for a single Aurora reader instance"),m=e.object({enableDatabaseInsights:e.boolean().optional(),identifierSuffix:e.string().min(1,o.IDENTIFIER_SUFFIX.REQUIRED).max(50,o.IDENTIFIER_SUFFIX.MAX_LENGTH).optional(),availabilityZone:e.string().optional()}).strict().describe("Configuration for Aurora writer instance"),j=e.object({count:e.number().int(o.READER.COUNT.INTEGER).min(0,o.READER.COUNT.MIN).max(15,o.READER.COUNT.MAX).optional(),instances:e.array(P).max(15,o.READER_INSTANCES.MAX).optional(),defaultEnableDatabaseInsights:e.boolean().optional()}).strict().refine(n=>!(n.count!==void 0&&n.instances!==void 0),{message:o.READER_INSTANCES.COUNT_OR_INSTANCES,path:["count"]}).describe("Aurora readers configuration"),E=i(j),L=e.object({awsManaged:e.literal(!0)}).strict(),k=e.object({useCMK:e.literal(!0)}).strict(),S=e.union([L,k]),v=e.object({mode:e.enum(["standard","advanced"]).optional(),encryptionKey:S.optional()}).strict().describe("Database Insights configuration"),g=i(v),u=e.object({storageKey:S.optional()}).strict().describe("Encryption configuration (DESTRUCTIVE to change storageKey)"),ne=e.object({name:t,type:F,databaseName:e.string().min(1,o.REQUIRED.DATABASE_NAME),instanceType:e.string().optional(),allocatedStorage:e.number().optional(),multiAz:e.boolean().optional(),publiclyAccessible:e.boolean().optional(),databaseInsights:g.optional(),port:b.optional(),deletionProtection:e.boolean().optional(),proxy:R.optional(),credentials:T.optional(),readReplica:d.optional(),encryption:u.optional(),writer:m.optional(),readers:E.optional(),backupRetention:a.optional(),preferredMaintenanceWindow:e.string().optional(),monitoringInterval:p.optional(),primaryRegion:e.string().optional(),secondaryRegions:e.array(e.string()).optional(),globalClusterIdentifier:e.string().optional(),enableGlobalWriteForwarding:e.boolean().optional(),snapshotIdentifier:e.string().optional(),snapshotUsername:e.string().optional(),databaseEngine:e.enum(y).optional(),engineExpression:e.string().optional(),variableName:e.string().optional(),extraProperties:e.array(l).optional(),alarms:G.optional()}).strict(),r=e.object({appName:c,nameProvidedByFlag:e.boolean().optional(),databaseName:e.string().min(1,o.REQUIRED.DATABASE_NAME).max(63,o.MAX_LENGTH.DATABASE_NAME).regex(I.DATABASE_NAME,o.DATABASE_NAME),resourceName:t.optional(),connectionConfig:e.object({connectToCompute:e.array(e.string()).optional(),connectToServices:e.array(e.string()).optional()}).strict().optional(),databaseInsights:g.optional(),port:b.optional(),proxy:R.optional(),credentials:T.optional(),encryption:u.optional(),deletionProtection:e.boolean().optional()}).strict(),O={databaseType:e.literal("Instance"),instanceType:e.string().optional(),multiAz:e.boolean().optional(),readReplica:d.optional(),publiclyAccessible:e.boolean().optional(),backupRetention:a.optional(),allocatedStorage:e.number().optional(),snapshotIdentifier:e.string().optional(),snapshotUsername:e.string().optional()},C={databaseType:e.literal("Aurora"),writer:m.optional(),readers:E.optional(),backupRetention:a.optional(),preferredMaintenanceWindow:e.string().optional(),monitoringInterval:p.optional(),snapshotIdentifier:e.string().optional(),snapshotUsername:e.string().optional()},D={databaseType:e.literal("GlobalAurora"),primaryRegion:e.string().min(1,o.GLOBAL_AURORA.PRIMARY_REGION_REQUIRED),secondaryRegions:e.array(e.string()).optional(),globalClusterIdentifier:e.string().optional(),enableGlobalWriteForwarding:e.boolean().optional(),writer:m.optional(),readers:E.optional(),backupRetention:a.optional(),preferredMaintenanceWindow:e.string().optional(),monitoringInterval:p.optional(),snapshotIdentifier:e.string().optional(),snapshotUsername:e.string().optional()},_=e.object({appName:c,nameProvidedByFlag:e.boolean().optional(),databaseName:e.string().min(1,o.REQUIRED.DATABASE_NAME).max(63,o.MAX_LENGTH.DATABASE_NAME).regex(I.DATABASE_NAME,o.DATABASE_NAME),resourceName:t.optional(),connectionConfig:e.object({connectToCompute:e.array(e.string()).optional(),connectToServices:e.array(e.string()).optional()}).strict().optional()}).strict(),x={databaseType:e.literal("ClickHouse"),instanceType:e.string().optional(),coldTier:e.union([e.object({mode:e.literal("s3")}).strict(),e.literal(!1)]).optional(),optimiseSchedule:e.union([e.string(),e.literal(!1)]).optional(),backupSchedule:e.union([e.string(),e.literal(!1)]).optional(),backupRetentionDays:a.optional()},Y=r.extend(O).strict(),K=r.extend(C).strict(),W=r.extend(D).strict(),w=_.extend(x).strict(),ie=e.discriminatedUnion("databaseType",[Y,K,W,w]),N=r.extend({resourceName:t}).strict(),H=N.extend(O).strict(),Q=N.extend(C).strict(),V=N.extend(D).strict(),z=_.extend({resourceName:t}).strict(),Z=z.extend(x).strict(),re=e.discriminatedUnion("databaseType",[H,Q,V,Z]),se=e.object({appName:c,databaseName:e.string().min(1,o.REQUIRED.DATABASE_NAME),maxConnections:e.number().int(o.MAX_CONNECTIONS.INTEGER).min(1,o.MAX_CONNECTIONS.MIN).max(100,o.MAX_CONNECTIONS.MAX).optional(),maxIdleConnections:e.number().int(o.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.INTEGER).min(0,o.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.MIN).max(100,o.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.MAX).optional(),connectionBorrowTimeout:e.number().int(o.PROXY_CONFIG.BORROW_TIMEOUT.INTEGER).min(1,o.PROXY_CONFIG.BORROW_TIMEOUT.MIN).max(3600,o.PROXY_CONFIG.BORROW_TIMEOUT.MAX).optional(),requireTLS:e.boolean().optional(),nameProvidedByFlag:e.boolean().optional()}).strict(),q=["S","N","B"],s=e.object({name:e.string(),type:e.enum(q)}).strict(),ce=e.object({name:t,partitionKey:s,sortKey:s.optional(),globalSecondaryIndexes:e.array(e.object({indexName:e.string(),partitionKey:s,sortKey:s.optional()}).strict()).optional(),ttlAttribute:e.string().optional(),stream:e.boolean().optional(),variableName:e.string().optional(),extraProperties:e.array(l).optional()}).strict(),$=e.object({mode:e.literal("s3")}).strict(),le=e.object({name:t,type:e.literal("ClickHouse"),databaseName:f,instanceType:e.string().optional(),coldTier:e.union([$,e.literal(!1)]).optional(),optimiseSchedule:e.union([e.string(),e.literal(!1)]).optional(),backupSchedule:e.union([e.string(),e.literal(!1)]).optional(),backupRetentionDays:a.optional(),variableName:e.string().optional(),extraProperties:e.array(l).optional()}).strict();export{se as AddProxyGeneratorSchema,P as AuroraReaderConfigSchema,E as AuroraReadersConfigOrFalseSchema,j as AuroraReadersConfigSchema,m as AuroraWriterConfigSchema,L as AwsManagedKeySchema,a as BackupRetentionSchema,le as ClickHouseResourcePlanSchema,T as CredentialsConfigSchema,k as CustomerManagedKeyMarkerSchema,ie as DatabaseGeneratorSchema,re as DatabaseGeneratorSchemaFromUI,g as DatabaseInsightsConfigOrFalseSchema,v as DatabaseInsightsConfigSchema,b as DatabasePortSchema,ne as DatabaseResourcePlanSchema,F as DatabaseTypeSchema,ce as DynamoDBResourcePlanSchema,u as EncryptionConfigSchema,S as EncryptionKeySpecSchema,p as MonitoringIntervalSchema,R as ProxyConfigOrFalseSchema,U as ProxyConfigSchema,d as ReadReplicaConfigOrFalseSchema,X as ReadReplicaConfigSchema,B as SecretRotationConfigSchema};
|
|
1
|
+
import{z as o}from"zod";import{VALIDATION_PATTERNS as N,VALIDATION_MESSAGES as e}from"../validation/patterns.js";import{DATABASE_TYPES as A,VALID_MONITORING_INTERVALS as G,DATABASE_ENGINES as f,constIncludes as P}from"./constants.js";import{optionalOrDisabled as n,ResourceNameSchema as t,AppNameSchema as c,DatabaseNameSchema as X,ExtraPropertySchema as l}from"./baseSchemas.js";import{RdsAlarmConfigSchema as B}from"./alarmSchemas.js";import{CLICKHOUSE_INSTANCE_TYPES as H,CLICKHOUSE_MAX_BACKUP_RETENTION_DAYS as F,CLICKHOUSE_MAX_IOPS as L,CLICKHOUSE_MAX_STORAGE_GB as K,CLICKHOUSE_MAX_THROUGHPUT_MBPS as k,CLICKHOUSE_MIN_BACKUP_RETENTION_DAYS as j,CLICKHOUSE_MIN_IOPS as Y,CLICKHOUSE_MIN_STORAGE_GB as v,CLICKHOUSE_MIN_THROUGHPUT_MBPS as W}from"@fjall/util/clickhouse";const i=o.number().int(e.BACKUP_RETENTION.INTEGER).min(1,e.BACKUP_RETENTION.MIN).max(35,e.BACKUP_RETENTION.MAX),S=o.number().int(e.CLICKHOUSE_STORAGE.INTEGER).min(v,e.CLICKHOUSE_STORAGE.MIN).max(K,e.CLICKHOUSE_STORAGE.MAX),T=o.number().int(e.CLICKHOUSE_IOPS.INTEGER).min(Y,e.CLICKHOUSE_IOPS.MIN).max(L,e.CLICKHOUSE_IOPS.MAX),b=o.number().int(e.CLICKHOUSE_THROUGHPUT.INTEGER).min(W,e.CLICKHOUSE_THROUGHPUT.MIN).max(k,e.CLICKHOUSE_THROUGHPUT.MAX),w=o.enum(H),O=o.number().int(e.CLICKHOUSE_BACKUP_RETENTION.INTEGER).min(j,e.CLICKHOUSE_BACKUP_RETENTION.MIN).max(F,e.CLICKHOUSE_BACKUP_RETENTION.MAX),p=o.number().int(e.MONITORING_INTERVAL.INTEGER).refine(a=>P(G,a),{message:e.MONITORING_INTERVAL.VALUES}),R=o.number().int(e.DATABASE.PORT.INTEGER).min(1024,e.DATABASE.PORT.MIN).max(65535,e.DATABASE.PORT.MAX),V=o.enum(A).describe(`Database type must be one of: ${A.join(", ")}`),Q=o.object({maxConnections:o.number().int(e.MAX_CONNECTIONS.INTEGER).min(1,e.MAX_CONNECTIONS.MIN).max(100,e.MAX_CONNECTIONS.MAX).optional(),maxIdleConnections:o.number().int(e.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.INTEGER).min(0,e.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.MIN).max(100,e.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.MAX).optional(),connectionBorrowTimeout:o.number().int(e.PROXY_CONFIG.BORROW_TIMEOUT.INTEGER).min(1,e.PROXY_CONFIG.BORROW_TIMEOUT.MIN).max(3600,e.PROXY_CONFIG.BORROW_TIMEOUT.MAX).optional(),requireTLS:o.boolean().optional()}).strict().describe("RDS Proxy configuration"),z=o.object({instanceType:o.string().optional(),availabilityZone:o.string().optional()}).strict().describe("Read replica configuration"),Z=o.object({automaticallyAfterDays:o.number().int(e.ROTATION.INTEGER).min(1,e.ROTATION.MIN).max(365,e.ROTATION.MAX).optional()}).strict().describe("Secret rotation configuration"),C=o.object({username:o.string().min(1,e.REQUIRED.USERNAME).max(63,e.USERNAME.MAX_LENGTH).optional(),secretRotation:Z.optional()}).strict().describe("Database credentials configuration"),u=n(Q),d=n(z),q=o.object({scaleWithWriter:o.boolean().optional(),enableDatabaseInsights:o.boolean().optional(),identifierSuffix:o.string().min(1,e.IDENTIFIER_SUFFIX.REQUIRED).max(50,e.IDENTIFIER_SUFFIX.MAX_LENGTH).optional(),availabilityZone:o.string().optional()}).strict().describe("Configuration for a single Aurora reader instance"),m=o.object({enableDatabaseInsights:o.boolean().optional(),identifierSuffix:o.string().min(1,e.IDENTIFIER_SUFFIX.REQUIRED).max(50,e.IDENTIFIER_SUFFIX.MAX_LENGTH).optional(),availabilityZone:o.string().optional()}).strict().describe("Configuration for Aurora writer instance"),$=o.object({count:o.number().int(e.READER.COUNT.INTEGER).min(0,e.READER.COUNT.MIN).max(15,e.READER.COUNT.MAX).optional(),instances:o.array(q).max(15,e.READER_INSTANCES.MAX).optional(),defaultEnableDatabaseInsights:o.boolean().optional()}).strict().refine(a=>!(a.count!==void 0&&a.instances!==void 0),{message:e.READER_INSTANCES.COUNT_OR_INSTANCES,path:["count"]}).describe("Aurora readers configuration"),E=n($),J=o.object({awsManaged:o.literal(!0)}).strict(),oo=o.object({useCMK:o.literal(!0)}).strict(),g=o.union([J,oo]),eo=o.object({mode:o.enum(["standard","advanced"]).optional(),encryptionKey:g.optional()}).strict().describe("Database Insights configuration"),_=n(eo),M=o.object({storageKey:g.optional()}).strict().describe("Encryption configuration (DESTRUCTIVE to change storageKey)"),Oo=o.object({name:t,type:V,databaseName:o.string().min(1,e.REQUIRED.DATABASE_NAME),instanceType:o.string().optional(),allocatedStorage:o.number().optional(),multiAz:o.boolean().optional(),publiclyAccessible:o.boolean().optional(),databaseInsights:_.optional(),port:R.optional(),deletionProtection:o.boolean().optional(),proxy:u.optional(),credentials:C.optional(),readReplica:d.optional(),encryption:M.optional(),writer:m.optional(),readers:E.optional(),backupRetention:i.optional(),preferredMaintenanceWindow:o.string().optional(),monitoringInterval:p.optional(),primaryRegion:o.string().optional(),secondaryRegions:o.array(o.string()).optional(),globalClusterIdentifier:o.string().optional(),enableGlobalWriteForwarding:o.boolean().optional(),snapshotIdentifier:o.string().optional(),snapshotUsername:o.string().optional(),databaseEngine:o.enum(f).optional(),engineExpression:o.string().optional(),variableName:o.string().optional(),extraProperties:o.array(l).optional(),alarms:B.optional()}).strict(),r=o.object({appName:c,nameProvidedByFlag:o.boolean().optional(),databaseName:o.string().min(1,e.REQUIRED.DATABASE_NAME).max(63,e.MAX_LENGTH.DATABASE_NAME).regex(N.DATABASE_NAME,e.DATABASE_NAME),resourceName:t.optional(),connectionConfig:o.object({connectToCompute:o.array(o.string()).optional(),connectToServices:o.array(o.string()).optional()}).strict().optional(),databaseInsights:_.optional(),port:R.optional(),proxy:u.optional(),credentials:C.optional(),encryption:M.optional(),deletionProtection:o.boolean().optional()}).strict(),x={databaseType:o.literal("Instance"),instanceType:o.string().optional(),multiAz:o.boolean().optional(),readReplica:d.optional(),publiclyAccessible:o.boolean().optional(),backupRetention:i.optional(),allocatedStorage:o.number().optional(),snapshotIdentifier:o.string().optional(),snapshotUsername:o.string().optional()},D={databaseType:o.literal("Aurora"),writer:m.optional(),readers:E.optional(),backupRetention:i.optional(),preferredMaintenanceWindow:o.string().optional(),monitoringInterval:p.optional(),snapshotIdentifier:o.string().optional(),snapshotUsername:o.string().optional()},h={databaseType:o.literal("GlobalAurora"),primaryRegion:o.string().min(1,e.GLOBAL_AURORA.PRIMARY_REGION_REQUIRED),secondaryRegions:o.array(o.string()).optional(),globalClusterIdentifier:o.string().optional(),enableGlobalWriteForwarding:o.boolean().optional(),writer:m.optional(),readers:E.optional(),backupRetention:i.optional(),preferredMaintenanceWindow:o.string().optional(),monitoringInterval:p.optional(),snapshotIdentifier:o.string().optional(),snapshotUsername:o.string().optional()},U=o.object({appName:c,nameProvidedByFlag:o.boolean().optional(),databaseName:o.string().min(1,e.REQUIRED.DATABASE_NAME).max(63,e.MAX_LENGTH.DATABASE_NAME).regex(N.DATABASE_NAME,e.DATABASE_NAME),resourceName:t.optional(),connectionConfig:o.object({connectToCompute:o.array(o.string()).optional(),connectToServices:o.array(o.string()).optional()}).strict().optional()}).strict(),y={databaseType:o.literal("ClickHouse"),instanceType:w.optional(),storageGb:S.optional(),iops:T.optional(),throughputMbps:b.optional(),coldTier:o.union([o.object({mode:o.literal("s3")}).strict(),o.literal(!1)]).optional(),optimiseSchedule:o.union([o.string(),o.literal(!1)]).optional(),backupSchedule:o.union([o.string(),o.literal(!1)]).optional(),backupVerify:o.literal(!1).optional(),backupRetentionDays:O.optional()},to=r.extend(x).strict(),ao=r.extend(D).strict(),no=r.extend(h).strict(),io=U.extend(y).strict(),Ro=o.discriminatedUnion("databaseType",[to,ao,no,io]),I=r.extend({resourceName:t}).strict(),ro=I.extend(x).strict(),so=I.extend(D).strict(),co=I.extend(h).strict(),lo=U.extend({resourceName:t}).strict(),po=lo.extend(y).strict(),Co=o.discriminatedUnion("databaseType",[ro,so,co,po]),uo=o.object({appName:c,databaseName:o.string().min(1,e.REQUIRED.DATABASE_NAME),maxConnections:o.number().int(e.MAX_CONNECTIONS.INTEGER).min(1,e.MAX_CONNECTIONS.MIN).max(100,e.MAX_CONNECTIONS.MAX).optional(),maxIdleConnections:o.number().int(e.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.INTEGER).min(0,e.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.MIN).max(100,e.PROXY_CONFIG.MAX_IDLE_CONNECTIONS.MAX).optional(),connectionBorrowTimeout:o.number().int(e.PROXY_CONFIG.BORROW_TIMEOUT.INTEGER).min(1,e.PROXY_CONFIG.BORROW_TIMEOUT.MIN).max(3600,e.PROXY_CONFIG.BORROW_TIMEOUT.MAX).optional(),requireTLS:o.boolean().optional(),nameProvidedByFlag:o.boolean().optional()}).strict(),mo=["S","N","B"],s=o.object({name:o.string(),type:o.enum(mo)}).strict(),go=o.object({name:t,partitionKey:s,sortKey:s.optional(),globalSecondaryIndexes:o.array(o.object({indexName:o.string(),partitionKey:s,sortKey:s.optional()}).strict()).optional(),ttlAttribute:o.string().optional(),stream:o.boolean().optional(),variableName:o.string().optional(),extraProperties:o.array(l).optional()}).strict(),Eo=o.object({mode:o.literal("s3")}).strict(),_o=o.object({name:t,type:o.literal("ClickHouse"),databaseName:X,instanceType:o.string().optional(),storageGb:S.optional(),iops:T.optional(),throughputMbps:b.optional(),coldTier:o.union([Eo,o.literal(!1)]).optional(),optimiseSchedule:o.union([o.string(),o.literal(!1)]).optional(),backupSchedule:o.union([o.string(),o.literal(!1)]).optional(),backupVerify:o.literal(!1).optional(),backupRetentionDays:O.optional(),variableName:o.string().optional(),extraProperties:o.array(l).optional()}).strict();export{uo as AddProxyGeneratorSchema,q as AuroraReaderConfigSchema,E as AuroraReadersConfigOrFalseSchema,$ as AuroraReadersConfigSchema,m as AuroraWriterConfigSchema,J as AwsManagedKeySchema,i as BackupRetentionSchema,O as ClickHouseBackupRetentionSchema,w as ClickHouseInstanceTypeSchema,T as ClickHouseIopsSchema,_o as ClickHouseResourcePlanSchema,S as ClickHouseStorageSchema,b as ClickHouseThroughputSchema,C as CredentialsConfigSchema,oo as CustomerManagedKeyMarkerSchema,Ro as DatabaseGeneratorSchema,Co as DatabaseGeneratorSchemaFromUI,_ as DatabaseInsightsConfigOrFalseSchema,eo as DatabaseInsightsConfigSchema,R as DatabasePortSchema,Oo as DatabaseResourcePlanSchema,V as DatabaseTypeSchema,go as DynamoDBResourcePlanSchema,M as EncryptionConfigSchema,g as EncryptionKeySpecSchema,p as MonitoringIntervalSchema,u as ProxyConfigOrFalseSchema,Q as ProxyConfigSchema,d as ReadReplicaConfigOrFalseSchema,z as ReadReplicaConfigSchema,Z as SecretRotationConfigSchema};
|
|
@@ -124,10 +124,30 @@ export declare const VALIDATION_MESSAGES: Readonly<{
|
|
|
124
124
|
readonly MAX_LENGTH: "Database name must be 63 characters or less";
|
|
125
125
|
};
|
|
126
126
|
};
|
|
127
|
+
readonly CLICKHOUSE_STORAGE: {
|
|
128
|
+
readonly INTEGER: "ClickHouse storage must be a whole number of GiB";
|
|
129
|
+
readonly MIN: "ClickHouse storage must be at least 100 GiB";
|
|
130
|
+
readonly MAX: "ClickHouse storage cannot exceed 16384 GiB (the gp3 ceiling)";
|
|
131
|
+
};
|
|
132
|
+
readonly CLICKHOUSE_IOPS: {
|
|
133
|
+
readonly INTEGER: "ClickHouse iops must be a whole number";
|
|
134
|
+
readonly MIN: "ClickHouse iops must be at least 3000 (the gp3 baseline)";
|
|
135
|
+
readonly MAX: "ClickHouse iops cannot exceed 80000 (the gp3 ceiling)";
|
|
136
|
+
};
|
|
137
|
+
readonly CLICKHOUSE_THROUGHPUT: {
|
|
138
|
+
readonly INTEGER: "ClickHouse throughputMbps must be a whole number of MiB/s";
|
|
139
|
+
readonly MIN: "ClickHouse throughputMbps must be at least 125 MiB/s (the gp3 baseline)";
|
|
140
|
+
readonly MAX: "ClickHouse throughputMbps cannot exceed 2000 MiB/s (the gp3 ceiling)";
|
|
141
|
+
};
|
|
127
142
|
readonly BACKUP_RETENTION: {
|
|
128
143
|
readonly INTEGER: "Backup retention must be an integer";
|
|
129
144
|
readonly MIN: "Backup retention must be at least 1 day";
|
|
130
|
-
readonly MAX: "Backup retention cannot exceed 35 days";
|
|
145
|
+
readonly MAX: "Backup retention cannot exceed 35 days (the RDS automated-backup ceiling)";
|
|
146
|
+
};
|
|
147
|
+
readonly CLICKHOUSE_BACKUP_RETENTION: {
|
|
148
|
+
readonly INTEGER: "ClickHouse backup retention must be an integer number of days";
|
|
149
|
+
readonly MIN: "ClickHouse backup retention must be at least 1 day";
|
|
150
|
+
readonly MAX: "ClickHouse backup retention cannot exceed 3650 days";
|
|
131
151
|
};
|
|
132
152
|
readonly SQS: {
|
|
133
153
|
readonly VISIBILITY_TIMEOUT: {
|
|
@@ -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",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",CONNECTED_RESOURCE_NAME:"Connected resource names must not be empty"},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";import{CLICKHOUSE_MAX_BACKUP_RETENTION_DAYS as a,CLICKHOUSE_MAX_IOPS as n,CLICKHOUSE_MAX_STORAGE_GB as s,CLICKHOUSE_MAX_THROUGHPUT_MBPS as i,CLICKHOUSE_MIN_BACKUP_RETENTION_DAYS as r,CLICKHOUSE_MIN_IOPS as o,CLICKHOUSE_MIN_STORAGE_GB as c,CLICKHOUSE_MIN_THROUGHPUT_MBPS as E}from"@fjall/util/clickhouse";const M=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",CONNECTED_RESOURCE_NAME:"Connected resource names must not be empty"},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"}},CLICKHOUSE_STORAGE:{INTEGER:"ClickHouse storage must be a whole number of GiB",MIN:`ClickHouse storage must be at least ${c} GiB`,MAX:`ClickHouse storage cannot exceed ${s} GiB (the gp3 ceiling)`},CLICKHOUSE_IOPS:{INTEGER:"ClickHouse iops must be a whole number",MIN:`ClickHouse iops must be at least ${o} (the gp3 baseline)`,MAX:`ClickHouse iops cannot exceed ${n} (the gp3 ceiling)`},CLICKHOUSE_THROUGHPUT:{INTEGER:"ClickHouse throughputMbps must be a whole number of MiB/s",MIN:`ClickHouse throughputMbps must be at least ${E} MiB/s (the gp3 baseline)`,MAX:`ClickHouse throughputMbps cannot exceed ${i} MiB/s (the gp3 ceiling)`},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 (the RDS automated-backup ceiling)"},CLICKHOUSE_BACKUP_RETENTION:{INTEGER:"ClickHouse backup retention must be an integer number of days",MIN:`ClickHouse backup retention must be at least ${r} day`,MAX:`ClickHouse backup retention cannot exceed ${a} 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{M as VALIDATION_MESSAGES};
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const GENERATOR_VERSION = "
|
|
1
|
+
export declare const GENERATOR_VERSION = "18.0.0";
|
package/dist/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const E="
|
|
1
|
+
const E="18.0.0";export{E as GENERATOR_VERSION};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fjall/generator",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "18.0.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/fjall-tech/fjall.git",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"license": "SEE LICENSE IN LICENSE",
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@babel/parser": "^7.29.8",
|
|
61
|
-
"@fjall/util": "^
|
|
61
|
+
"@fjall/util": "^18.0.0",
|
|
62
62
|
"ast-types": "^0.16.1",
|
|
63
63
|
"recast": "^0.23.12",
|
|
64
64
|
"ts-morph": "^28.0.0",
|