@sdlcworks/components 0.0.26 → 0.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{z as q}from"zod";import*as L from"@pulumi/pulumi";var Q;((H)=>{H.aws="aws";H.gcloud="gcloud";H.azure="azure";H.linode="linode";H.hetzner="hetzner";H.cloudflare="cloudflare"})(Q||={});var M;((E)=>{E.ipv4="ipv4";E.ipv6="ipv6";E.domain="domain"})(M||={});var V;((j)=>j.container_image="container_image")(V||={});var K=new Map;function W(b){return b.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase().replace(/-+/g,"-").replace(/^-|-$/g,"")}function X(b){let j=W(b);if(j.length===0)throw new Error("Connection interface name cannot be empty");let B=K.get(j);if(B!==void 0&&B!==b)throw new Error(`Connection interface name collision: '${b}' resolves to '${j}' which is already registered by '${B}'`);return K.set(j,b),j}function Y(b,j){return{name:X(b),schema:j}}function k(b,j){return b.schema.merge(j)}var x=Y("tcp",q.object({url:q.object({type:q.nativeEnum(M),value:q.string()}),publicAccess:q.boolean()})),N=q.object({});function F(b){if(b instanceof q.ZodObject){let j=b.shape,B={};for(let E in j)B[E]=F(j[E]);return q.object(B)}if(b instanceof q.ZodOptional)return F(b.unwrap()).optional();if(b instanceof q.ZodNullable)return F(b.unwrap()).nullable();if(b instanceof q.ZodArray)return q.array(F(b.element));return q.union([b,q.custom((j)=>L.Output.isInstance(j))])}var Z=q.object({metadata:q.object({stateful:q.boolean(),proxiable:q.boolean()}),connectionTypes:q.record(q.string(),q.object({description:q.string().min(5)})),configSchema:q.custom(),deploymentInputSchema:q.custom(),outputSchema:q.custom()});function w(b){return b}var _=q.object({});class ${opts;providers;validationSchema;validationDeploymentInputSchema;declaredConnectionInterfaces=new Map;constructor(b){this.opts=Z.parse(b),this.providers={},this.validationSchema=F(b.configSchema),this.validationDeploymentInputSchema=F(b.deploymentInputSchema)}implement(b,j){return this.providers[b]={...j,stateSchema:j.stateSchema??_,initialState:j.initialState},this}getConnectionSchema(b){return b.schema}createDeclareConnectionInterfacesFn(){return(b)=>{for(let j of b){let B=j.interface.schema,E=F(B),J=E.safeParse(j.data);if(!J.success)throw new Error(`Invalid data for connection interface '${j.interface.name}': ${J.error.message}`);this.declaredConnectionInterfaces.set(j.interface.name,{schema:E,data:j.data})}}}getDeclaredInterfaces(){return this.declaredConnectionInterfaces}}export{W as toCanonicalInterfaceName,k as extendSchema,Y as defineConnectionInterface,w as connectionHandler,M as TCPUrlType,x as TCPCI,$ as InfraComponent,V as DeploymentArtifactType,Q as CloudProvider};
1
+ import{z as j}from"zod";import*as M from"@pulumi/pulumi";var W;((H)=>{H.aws="aws";H.gcloud="gcloud";H.azure="azure";H.linode="linode";H.hetzner="hetzner";H.cloudflare="cloudflare"})(W||={});var Q;((E)=>{E.ipv4="ipv4";E.ipv6="ipv6";E.domain="domain"})(Q||={});var X;((q)=>q.container_image="container_image")(X||={});var L=new Map;function Y(b){return b.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]+/g,"-").toLowerCase().replace(/-+/g,"-").replace(/^-|-$/g,"")}function Z(b){let q=Y(b);if(q.length===0)throw new Error("Connection interface name cannot be empty");let B=L.get(q);if(B!==void 0&&B!==b)throw new Error(`Connection interface name collision: '${b}' resolves to '${q}' which is already registered by '${B}'`);return L.set(q,b),q}function _(b,q){return{name:Z(b),schema:q}}function x(b,q){return b.schema.merge(q)}var N=_("tcp",j.object({url:j.object({type:j.nativeEnum(Q),value:j.string()}),publicAccess:j.boolean()})),w=j.object({});function F(b){if(b instanceof j.ZodObject){let q=b.shape,B={};for(let E in q)B[E]=F(q[E]);return j.object(B)}if(b instanceof j.ZodOptional)return F(b.unwrap()).optional();if(b instanceof j.ZodNullable)return F(b.unwrap()).nullable();if(b instanceof j.ZodDefault)return F(b._def.innerType).default(b._def.defaultValue);if(b instanceof j.ZodArray)return j.array(F(b.element));if(b instanceof j.ZodDiscriminatedUnion){let q=b._def.options.map((B)=>F(B));return j.discriminatedUnion(b._def.discriminator,q)}if(b instanceof j.ZodRecord){let q=b._def.keyType,B=b._def.valueType,E=q?F(q):j.string(),J=B?F(B):j.any();return j.record(E,J)}return j.union([b,j.custom((q)=>M.Output.isInstance(q))])}var $=j.object({metadata:j.object({stateful:j.boolean(),proxiable:j.boolean()}),connectionTypes:j.record(j.string(),j.object({description:j.string().min(5)})),configSchema:j.custom(),deploymentInputSchema:j.custom(),outputSchema:j.custom()});function k(b){return b}var G=j.object({});class K{opts;providers;validationSchema;validationDeploymentInputSchema;declaredConnectionInterfaces=new Map;constructor(b){this.opts=$.parse(b),this.providers={},this.validationSchema=F(b.configSchema),this.validationDeploymentInputSchema=F(b.deploymentInputSchema)}implement(b,q){return this.providers[b]={...q,stateSchema:q.stateSchema??G,initialState:q.initialState},this}getConnectionSchema(b){return b.schema}createDeclareConnectionInterfacesFn(){return(b)=>{for(let q of b){let B=q.interface.schema,E=F(B),J=E.safeParse(q.data);if(!J.success)throw new Error(`Invalid data for connection interface '${q.interface.name}': ${J.error.message}`);this.declaredConnectionInterfaces.set(q.interface.name,{schema:E,data:q.data})}}}getDeclaredInterfaces(){return this.declaredConnectionInterfaces}}export{Y as toCanonicalInterfaceName,x as extendSchema,_ as defineConnectionInterface,k as connectionHandler,Q as TCPUrlType,N as TCPCI,K as InfraComponent,X as DeploymentArtifactType,W as CloudProvider};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sdlcworks/components",
3
- "version": "0.0.26",
3
+ "version": "0.0.27",
4
4
  "module": "dist/index.js",
5
5
  "files": [
6
6
  "dist"