fjall 2.14.0 → 2.15.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.
|
@@ -428,7 +428,7 @@ ${o}`)}throw r}}function qi(e,t){let n=F.createSourceFile("infrastructure.ts",e,
|
|
|
428
428
|
`;return i.push(`Custom code from line ${t.originalLine} could not be positioned. Added at end of file.`),e+`
|
|
429
429
|
`+r+t.sourceText}function Kf(e,t,n){if(!t||t.length===0)return{content:e,success:!0};try{let i=mx(e),r=_t(i),o=[],a=gR(t),c=e;for(let u of a){let l=yR(i,r,u,n,o);c=vR(c,u,l,o)}return{content:c,success:!0,warnings:o.length>0?o:void 0}}catch(i){return hx(i,e)}}function bR(e,t,n,i){if(!t.afterManagedResource)return null;let r=t.afterManagedResource,o=(r.name&&n?.get(r.name))??r.name,a=e.find(u=>u.type===r.type&&u.resourceName===o);if(a)return a.endPos;let c=e.filter(u=>u.type===r.type&&u.isManaged);return c.length===1?c[0].endPos:(i&&i.push(`Resource ${Hf(t.afterManagedResource.type,t.afterManagedResource.name)} not found. Custom code may be orphaned.`),null)}function yR(e,t,n,i,r){switch(n.position){case"before-imports":return 0;case"after-imports":return dx(t,"import")?.endPos??0;case"after-app-init":return Wf(t,"app-init")?.endPos??null;case"after-tags":return Wf(t,"tags")?.endPos??null;case"after-resource":return bR(t,n,i,r);case"end-of-file":return e.getEnd();default:return null}}function _R(e,t,n){let i=fx(e,t),r=n.sourceText;return r=px(i,r)+r,r.endsWith(`
|
|
430
430
|
`)||(r+=`
|
|
431
|
-
`),r}import*as Gt from"typescript";function rc(e,t){let n=[Nf(e),kf(e),wf(e)];if(Pf(e))n.push(Hs(e),qs(e));else{let r=Rf(e);n.push(qs(e),_f(e),Sf(e),If(e),Af(e),Tf(e),$f(e,r),Cf(e))}let i=n.join("");if(e.customCodeBlocks&&e.customCodeBlocks.length>0){let r=Kf(i,e.customCodeBlocks,t?.resourceMapping);return r.success?Ne(r.content):Ce(new Error(`Custom code injection failed: ${r.error??"unknown error"}`))}return Ne(i)}var
|
|
431
|
+
`),r}import*as Gt from"typescript";function rc(e,t){let n=[Nf(e),kf(e),wf(e)];if(Pf(e))n.push(Hs(e),qs(e));else{let r=Rf(e);n.push(qs(e),_f(e),Sf(e),If(e),Af(e),Tf(e),$f(e,r),Cf(e))}let i=n.join("");if(e.customCodeBlocks&&e.customCodeBlocks.length>0){let r=Kf(i,e.customCodeBlocks,t?.resourceMapping);return r.success?Ne(r.content):Ce(new Error(`Custom code injection failed: ${r.error??"unknown error"}`))}return Ne(i)}var _3=ES("standard");var Xf=s.enum(["A","AAAA","CNAME","MX","TXT","NS","SRV","CAA"]),IR=s.object({name:s.string(),type:Xf,ttl:s.number().optional(),value:s.string(),priority:s.number().optional(),weight:s.number().optional(),port:s.number().optional()}).strict(),AR=s.object({subdomain:s.string(),targetAccount:s.string(),auto:s.boolean()}).strict(),TR=s.object({domainName:s.string(),subjectAlternativeNames:s.array(s.string())}).strict(),V3=s.object({origin:s.string(),ttl:s.number(),records:s.array(IR),delegations:s.array(AR),certificates:s.array(TR)}).strict(),vx=Object.freeze({ORIGIN:"$ORIGIN",TTL:"$TTL",FJALL_DELEGATE:"$FJALL-DELEGATE",FJALL_CERT:"$FJALL-CERT"});var wR=s.discriminatedUnion("kind",[s.object({kind:s.literal("ecs"),appName:s.string()}).strict(),s.object({kind:s.literal("cdn"),appName:s.string()}).strict(),s.object({kind:s.literal("bucket"),bucketName:s.string()}).strict(),s.object({kind:s.literal("custom"),dnsName:s.string(),hostedZoneId:s.string()}).strict()]),kR=s.object({kind:s.literal("standard"),type:s.enum(["A","AAAA","CNAME","MX","TXT","NS","SRV","CAA"]),name:s.string(),value:s.union([s.string(),s.array(s.string())]),ttl:s.number().int().positive().optional()}).strict(),NR=s.object({kind:s.literal("alias"),type:s.enum(["A","AAAA"]),name:s.string(),target:wR}).strict(),CR=s.discriminatedUnion("kind",[kR,NR]),RR=s.object({domainName:s.string(),subjectAlternativeNames:s.array(s.string()).optional(),transparencyLogging:s.boolean().optional()}).strict(),PR=s.object({subdomain:s.string(),toAccount:s.string(),auto:s.boolean().optional()}).strict(),H3=s.object({zoneName:s.string(),registrar:s.enum(["route53","external-delegated","external-records"]),hostedZoneId:s.string().optional(),delegatedSubdomain:s.string().optional(),records:s.array(CR),certificates:s.array(RR),delegations:s.array(PR)}).strict().refine(e=>e.registrar!=="external-delegated"||e.delegatedSubdomain!==void 0,{message:"external-delegated requires delegatedSubdomain"}).refine(e=>e.registrar!=="external-records"||e.delegations.length===0,{message:"external-records forbids delegations"});var Y3=new Set(Xf.options);var i9=JSON.stringify({compilerOptions:{target:"ES2020",module:"commonjs",lib:["es2020","dom"],declaration:!0,strict:!0,noImplicitAny:!0,strictNullChecks:!0,noImplicitThis:!0,alwaysStrict:!0,noUnusedLocals:!1,noUnusedParameters:!1,noImplicitReturns:!0,noFallthroughCasesInSwitch:!1,inlineSourceMap:!0,inlineSources:!0,experimentalDecorators:!0,strictPropertyInitialization:!1,typeRoots:["./node_modules/@types"]},exclude:["node_modules","cdk.out"]},null,2)+`
|
|
432
432
|
`,o9=JSON.stringify({app:"npx ts-node --prefer-ts-exts --transpile-only infrastructure.ts",assetMetadata:!1,pathMetadata:!1,versionReporting:!1,watch:{include:["**"],exclude:["README.md","cdk*.json","**/*.d.ts","**/*.js","tsconfig.json","package*.json","yarn.lock","node_modules","test"]},context:{"@aws-cdk/aws-lambda:recognizeLayerVersion":!0,"@aws-cdk/core:checkSecretUsage":!0,"@aws-cdk/core:target-partitions":["aws","aws-cn"],"@aws-cdk-containers/ecs-service-extensions:enableDefaultLogDriver":!0,"@aws-cdk/aws-ec2:uniqueImdsv2TemplateName":!0,"@aws-cdk/aws-ecs:arnFormatIncludesClusterName":!0,"@aws-cdk/aws-iam:minimizePolicies":!0,"@aws-cdk/core:validateSnapshotRemovalPolicy":!0,"@aws-cdk/aws-codepipeline:crossAccountKeyAliasStackSafeResourceName":!0,"@aws-cdk/aws-s3:createDefaultLoggingPolicy":!0,"@aws-cdk/aws-sns-subscriptions:restrictSqsDescryption":!0,"@aws-cdk/aws-apigateway:disableCloudWatchRole":!0,"@aws-cdk/core:enablePartitionLiterals":!0,"@aws-cdk/aws-events:eventsTargetQueueSameAccount":!0,"@aws-cdk/aws-iam:standardizedServicePrincipals":!0,"@aws-cdk/aws-ecs:disableExplicitDeploymentControllerForCircuitBreaker":!0,"@aws-cdk/aws-iam:importedRoleStackSafeDefaultPolicyName":!0,"@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy":!0,"@aws-cdk/aws-route53-patters:useCertificate":!0,"@aws-cdk/customresources:installLatestAwsSdkDefault":!1,"@aws-cdk/aws-rds:databaseProxyUniqueResourceName":!0,"@aws-cdk/aws-codedeploy:removeAlarmsFromDeploymentGroup":!0,"@aws-cdk/aws-apigateway:authorizerChangeDeploymentLogicalId":!0,"@aws-cdk/aws-ec2:launchTemplateDefaultUserData":!0,"@aws-cdk/aws-secretsmanager:useAttachedSecretResourcePolicyForSecretTargetAttachments":!0,"@aws-cdk/aws-redshift:columnId":!0,"@aws-cdk/aws-stepfunctions-tasks:enableEmrServicePolicyV2":!0,"@aws-cdk/aws-ec2:restrictDefaultSecurityGroup":!0,"@aws-cdk/aws-apigateway:requestValidatorUniqueId":!0,"@aws-cdk/aws-kms:aliasNameRef":!0,"@aws-cdk/aws-autoscaling:generateLaunchTemplateInsteadOfLaunchConfig":!0,"@aws-cdk/core:includePrefixInUniqueNameGeneration":!0,"@aws-cdk/aws-opensearchservice:enableOpensearchMultiAzWithStandby":!0}},null,2)+`
|
|
433
433
|
`;function FR(e,t,n){let i=e.root?bx.join(e.root,t):t;try{if(Tn.existsSync(i)){let r=`${i}.bak`,o=`${r}.tmp`;Tn.writeFileSync(o,n),Tn.renameSync(o,r)}return Ne(void 0)}catch(r){let o=Nt(r);return ss.warn("Generator",`Failed to create backup of ${t}`,{error:Sc(o.message)}),Ce(o)}}function ZR(e,t){try{let n=qi(e,{extractCustomCode:!0}),i=Hi(n,t,{skipValidation:!0});return n.customCodeBlocks?.length&&(i.customCodeBlocks=n.customCodeBlocks),Ne({parsed:n,plan:i})}catch(n){return Ce(Nt(n))}}function BR(e,t){let n=ZR(e,t);if(!n.success)throw new Error(`Failed to parse infrastructure: ${n.error.message}`,{cause:n.error});return n.data}function VR(e,t,n){let i=e.safeParse(t);if(!i.success)throw new Error(`Invalid ${n} generator options:
|
|
434
434
|
${Ss(i.error)}`);return i.data}function GR(e,t){let n=Rn(t),i=e.read(n)?.toString();if(!i)throw new Error(`App '${t}' not found. Expected infrastructure.ts at: ${n}`);return{path:n,content:i}}async function yx(e,t,n,i,r){let o=VR(t,n,i),{path:a,content:c}=GR(e,o.appName),{plan:u}=BR(c,o.appName),l=await r({tree:e,validated:o,plan:u,infrastructurePath:a,content:c}),m=WR(e,a,c,l);if(!m.success)throw new Error(m.error.message,{cause:m.error})}function WR(e,t,n,i){let r=rc(i);if(!r.success)return Ce(r.error);let o=FR(e,t,n);return o.success?(e.write(t,r.data),Ne(void 0)):Ce(new Error(`Failed to create backup: ${o.error.message}`))}var _x=1e3;function Sx(e,t,n){if(!so(e,t,n))return n;let i=n.match(/^(.+?)(\d*)$/);if(!i)return n;let r=i[1],o=i[2]?parseInt(i[2],10)+1:2;for(let a=o;a<=o+_x;a++){let c=`${r}${a}`;if(!so(e,t,c))return c}return`${r}${o+_x}`}var sg=sA(YI(),1);async function JI(e,t,n,i){let r=`Connect to existing ${t}?`,o=`Found ${e} ${t}s. Configure connections?`,a=e===1?n??r:i?.replace("{count}",String(e))??o,c=await(0,sg.default)([{type:"confirm",name:"shouldConnect",message:a,initial:!0}]);return c?c.shouldConnect:!1}async function QI(e,t,n){if(e.length===1)return process.stdout.write(`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "<%= packageName %>",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.15.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {},
|
|
6
6
|
"devDependencies": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"typescript": "~6.0.3"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@fjall/components-infrastructure": "^2.
|
|
12
|
+
"@fjall/components-infrastructure": "^2.15.0",
|
|
13
13
|
"aws-cdk-lib": "^2.251.0",
|
|
14
14
|
"constructs": "^10.6.0"
|
|
15
15
|
}
|