@baseplate-dev/project-builder-web 0.1.2 → 0.2.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/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-DeLjV85y.js +2 -0
- package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-DeLjV85y.js.map +1 -0
- package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib-CEcnKpIc.js +5 -0
- package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib-CEcnKpIc.js.map +1 -0
- package/dist/assets/__federation_shared_@baseplate-dev/ui-components-BngA7Gbo.js +46 -0
- package/dist/assets/__federation_shared_@baseplate-dev/ui-components-BngA7Gbo.js.map +1 -0
- package/dist/assets/{_virtual___federation_fn_import-Dy9UIuGh.js → _virtual___federation_fn_import-DTGz4eK3.js} +2 -2
- package/dist/assets/{_virtual___federation_fn_import-Dy9UIuGh.js.map → _virtual___federation_fn_import-DTGz4eK3.js.map} +1 -1
- package/dist/assets/capitalize-gOJXDbsR.js +2 -0
- package/dist/assets/capitalize-gOJXDbsR.js.map +1 -0
- package/dist/assets/index-BM00URXH.js +78 -0
- package/dist/assets/index-BM00URXH.js.map +1 -0
- package/dist/assets/index-BievMsrf.css +1 -0
- package/dist/assets/{index.esm-hwiNhM7-.js → index.esm-BCWxrcvn.js} +2 -2
- package/dist/assets/{index.esm-hwiNhM7-.js.map → index.esm-BCWxrcvn.js.map} +1 -1
- package/dist/assets/model-merger-xMPe_PFP.js +2 -0
- package/dist/assets/model-merger-xMPe_PFP.js.map +1 -0
- package/dist/assets/not-empty-CxPFIhu9.js +2 -0
- package/dist/assets/not-empty-CxPFIhu9.js.map +1 -0
- package/dist/index.html +6 -5
- package/package.json +20 -7
- package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-Ctbly4ZZ.js +0 -2
- package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib/web-Ctbly4ZZ.js.map +0 -1
- package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib-BHHYg2H_.js +0 -5
- package/dist/assets/__federation_shared_@baseplate-dev/project-builder-lib-BHHYg2H_.js.map +0 -1
- package/dist/assets/__federation_shared_@baseplate-dev/ui-components-CmzFub-E.js +0 -46
- package/dist/assets/__federation_shared_@baseplate-dev/ui-components-CmzFub-E.js.map +0 -1
- package/dist/assets/index-BK9gSEM3.css +0 -1
- package/dist/assets/index-D6_Hw_qm.js +0 -2
- package/dist/assets/index-D6_Hw_qm.js.map +0 -1
- package/dist/assets/index-DnBjawZO.js +0 -78
- package/dist/assets/index-DnBjawZO.js.map +0 -1
- package/dist/assets/model-utils-C4ofeY6G.js +0 -2
- package/dist/assets/model-utils-C4ofeY6G.js.map +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as p}from"./_virtual___federation_fn_import-Dy9UIuGh.js";let T=t=>crypto.getRandomValues(new Uint8Array(t)),S=(t,e,n)=>{let r=(2<<Math.log2(t.length-1))-1,i=-~(1.6*r*e/t.length);return(o=e)=>{let s="";for(;;){let a=n(i),u=i|0;for(;u--;)if(s+=t[a[u]&r]||"",s.length>=o)return s}}},$=(t,e=21)=>S(t,e|0,T);const I="0123456789",O="abcdefghijklmnopqrstuvwxyz",z="ABCDEFGHIJKLMNOPQRSTUVWXYZ",M=$(`${I}${O}${z}_`,12);function W(t=12){return M(t)}const{z:l}=await p("zod"),F=/^[a-z0-9-]+$/,b=/^[A-Z][a-zA-Z0-9]*$/,B=/^[a-z][a-zA-Z0-9]*$/,j=/^[A-Z][A-Z0-9_]*$/,D={KEBAB_CASE:l.string().regex(F),PASCAL_CASE:l.string().regex(b),CAMEL_CASE:l.string().regex(B),CONSTANT_CASE:l.string().regex(j)};function Pe(t,e){return{spec:t,implementation:e}}function be(t,e){const{platforms:n,defaultInitializer:r}=e??{};return{type:"plugin-spec",name:t,platforms:n&&(Array.isArray(n)?n:[n]),isOptional:!1,optional(){return{...this,isOptional:!0}},defaultInitializer:r}}class Z{constructor(e,n,r){Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"parentType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"prefix",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.prefix=n??e.split("/").pop()??e}generateNewId(){return`${this.prefix}:${W()}`}fromUid(e){if(e)return`${this.prefix}:${e}`}toUid(e){return e.split(":")[1]}isId(e){return e.startsWith(`${this.prefix}:`)}}function U(t,e){const{parentType:n,prefix:r}=e??{};return new Z(t,r,n)}const G=Symbol("zod-plugin"),{ZodType:L}=await p("zod");class m extends L{_parse(e){const n={pluginStore:this._def.pluginStore};return this._def.innerType._parse({...e,parent:{...e.parent,common:{...e.parent.common,[G]:n}}})}get pluginStore(){return this._def.pluginStore}}Object.defineProperty(m,"create",{enumerable:!0,configurable:!0,writable:!0,value:(t,e)=>new m({innerType:t,pluginStore:e})});function xe(t,e){return m.create(t,e)}function K(t){switch(typeof t){case"number":case"symbol":return!1;case"string":return t.includes(".")||t.includes("[")||t.includes("]")}}function X(t){return Object.is(t,-0)?"-0":t.toString()}function x(t){const e=[],n=t.length;if(n===0)return e;let r=0,i="",o="",s=!1;for(t.charCodeAt(0)===46&&(e.push(""),r++);r<n;){const a=t[r];o?a==="\\"&&r+1<n?(r++,i+=t[r]):a===o?o="":i+=a:s?a==='"'||a==="'"?o=a:a==="]"?(s=!1,e.push(i),i=""):i+=a:a==="["?(s=!0,i&&(e.push(i),i="")):a==="."?i&&(e.push(i),i=""):i+=a,r++}return i&&e.push(i),e}function c(t,e,n){if(t==null)return n;switch(typeof e){case"string":{const r=t[e];return r===void 0?K(e)?c(t,x(e),n):n:r}case"number":case"symbol":{typeof e=="number"&&(e=X(e));const r=t[e];return r===void 0?n:r}default:{if(Array.isArray(e))return q(t,e,n);Object.is(e?.valueOf(),-0)?e="-0":e=String(e);const r=t[e];return r===void 0?n:r}}}function q(t,e,n){if(e.length===0)return n;let r=t;for(let i=0;i<e.length;i++){if(r==null)return n;r=r[e[i]]}return r===void 0?n:r}const k=/^(?:0|[1-9]\d*)$/;function H(t,e=Number.MAX_SAFE_INTEGER){switch(typeof t){case"number":return Number.isInteger(t)&&t>=0&&t<e;case"symbol":return!1;case"string":return k.test(t)}}function w(t,e,n){const r=Array.isArray(e)?e:typeof e=="string"?x(e):[e];let i=t;for(let s=0;s<r.length-1;s++){const a=r[s],u=r[s+1];i[a]==null&&(i[a]=H(u)?[]:{}),i=i[a]}const o=r[r.length-1];return i[o]=n,t}const{z:J,ZodType:E}=await p("zod"),Q=J.string().min(1);function _(t){return t instanceof Promise}function we(t){return t}class Y{constructor(e,n,r){Object.defineProperty(this,"references",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"entitiesWithNameResolver",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pathPrefix",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"context",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pathMap",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.references=[],this.entitiesWithNameResolver=[],this.pathPrefix=e,this.context=n,this.pathMap=new Map,this.data=r}_constructPathWithoutPrefix(e){return e?e.split(".").map(r=>/^[0-9]+$/.test(r)?Number.parseInt(r,10):r):[]}_constructPath(e){return e?[...this.pathPrefix,...this._constructPathWithoutPrefix(e)]:this.pathPrefix}_constructPathWithContext(e,n){if(typeof e=="string")return this._constructPath(e);const r=this.context.pathMap.get(e.context);if(!r)throw new Error(`Could not find context for ${e.context} from ${this.pathPrefix.join(".")}`);if(r.type!==n)throw new Error(`Attempted to retrieve context for ${e.context} from ${this.pathPrefix.join(".")} expecting ${n.name}, but found ${r.type.name}`);return r.path}addReference(e){if(!e.type.parentType&&e.parentPath)throw new Error("Parent path does nothing since reference does not have parent");if(e.type.parentType&&!e.parentPath)throw new Error("Parent path required if reference type has parent type");const n=this._constructPathWithoutPrefix(e.path),r=n.length===0?this.data:c(this.data,n);if(r==null)return;const i=this._constructPath(e.path);this.references.push({type:e.type,path:i,parentPath:e.parentPath&&e.type.parentType&&this._constructPathWithContext(e.parentPath,e.type.parentType),onDelete:e.onDelete}),e.addContext&&this._addPathToContext(i,e.type,e.addContext)}addEntity(e){const n=this._constructPath(e.path),r=e.idPath?this._constructPathWithoutPrefix(e.idPath):[...this._constructPathWithoutPrefix(e.path),"id"],i=c(this.data,r)??e.type.generateNewId();if(c(this.data,r)||w(this.data,r,i),!e.type.isId(i))throw new Error(`Invalid id: ${i} for entity ${e.type.name}`);const s=(e.getNameResolver??(u=>c(u,"name")))(this.data),a={id:i,type:e.type,path:n,idPath:[...this.pathPrefix,...r],parentPath:e.parentPath&&e.type.parentType&&this._constructPathWithContext(e.parentPath,e.type.parentType)};this.entitiesWithNameResolver.push({...a,nameResolver:typeof s=="string"?{resolveName:()=>s}:s}),e.addContext&&this._addPathToContext([...this.pathPrefix,...r],e.type,e.addContext)}_addPathToContext(e,n,r){if(this.pathMap.has(r))throw new Error(`Context path already defined for ${r} at ${this.pathPrefix.join(".")}`);this.pathMap.set(r,{path:e,type:n})}addPathToContext(e,n,r){this._addPathToContext(this._constructPath(e),n,r)}}const y=Symbol("zod-ref");class f extends E{_parse(e){const r=e.parent.common[y];if(!r||!this._def.builder)return this._def.innerType._parse(e);const i=new Y(e.path,r.context,e.data);this._def.builder(i,e.data),r.references.push(...i.references),r.entitiesWithNameResolver.push(...i.entitiesWithNameResolver);const o=this._def.innerType._parse({...e,path:e.path,parent:{...e.parent,common:{...e.parent.common,[y]:{...r,context:{...r.context,pathMap:new Map([...r.context.pathMap,...i.pathMap])}}}}});function s(a){if(a.status==="aborted")return a;for(const u of i.entitiesWithNameResolver)w(a.value,u.idPath.slice(e.path.length),u.id);return a}return _(o)?o.then(s):s(o)}innerType(){return this._def.innerType}addEntity(e){return f.create(this,(n,r)=>{n.addEntity(typeof e=="function"?e(r):e)})}addReference(e){return f.create(this,(n,r)=>{n.addReference(typeof e=="function"?e(r):e)})}refBuilder(e){return f.create(this,e)}}Object.defineProperty(f,"create",{enumerable:!0,configurable:!0,writable:!0,value:(t,e)=>new f({innerType:t,builder:e})});function Ee(t,e){return f.create(t,e)}function V(t,e){return f.create(t).addReference(e)}function ee(t,e){return f.create(t.setKey("id",Q)).addEntity(e)}class P extends E{_parse(e){const n={context:{pathMap:new Map},references:[],entitiesWithNameResolver:[]},r=this._def.innerType._parse({...e,parent:{...e.parent,common:{...e.parent.common,[y]:n}}});function i(o){return o.status==="aborted"?o:{...o,value:{data:o.value,entitiesWithNameResolver:n.entitiesWithNameResolver,references:n.references}}}return _(r)?r.then(i):i(r)}}Object.defineProperty(P,"create",{enumerable:!0,configurable:!0,writable:!0,value:t=>new P({innerType:t})});const{z:d}=await p("zod"),h=U("feature"),v=D.KEBAB_CASE,te=ee(d.object({name:d.string().min(1).refine(t=>t.split("/").every(e=>v.safeParse(e).success),{message:"Feature name must be lowercase and contain only letters, numbers, and dashes"}),parentRef:V(d.string().nullish(),{type:h,onDelete:"DELETE_PARENT"})}),{type:h}),_e=d.array(te).default([]);function re(t){return t.features.filter(e=>!e.parentRef)}function R(t,e){return t.features.find(n=>n.id===e)}function g(t,e){const n=R(t,e);if(!n)throw new Error(`Could not find feature with ID ${e}`);return n}function ne(t,e){return t.features.filter(n=>n.parentRef===e)}function C(t){return t.name.split("/").pop()??""}function ie(t,e){const n=g(t,e);return C(n)}function ae(t,e){return g(t,e).name}function se(t){return t.split("/").every(n=>v.safeParse(n).success)}function oe(t,e){if(h.isId(e))return e;const n=e.split("/");let r="",i=null;for(const o of n){const s=t.features.find(u=>u.name===o&&u.parentRef===i),a=[r,o].filter(Boolean).join("/");if(s)i=s.id;else{const u={id:h.generateNewId(),name:a,parentRef:i};t.features.push(u),i=u.id}r=a}if(!i)throw new Error("Failed to create feature");return i}function A(t,e){return t.features.find(n=>n.name===e)}function ue(t,e){return A(t,e)?.id??e}const ve={getRootFeatures:re,getFeatureById:R,getFeatureByIdOrThrow:g,getFeatureChildren:ne,getFeatureName:C,getFeatureNameById:ie,getFeaturePathById:ae,validateFeatureName:se,ensureFeatureByNameRecursively:oe,getFeatureByName:A,getFeatureIdByNameOrDefault:ue};function N(t,e){return t.models.find(n=>n.id===e)}function fe(t,e){const n=N(t,e);if(!n)throw new Error(`Could not find model with ID ${e}`);return n}function ce(t,e){const n=t.model.fields.find(r=>r.id===e);if(!n)throw new Error(`Could not find field with ID ${e}`);return n}function le(t,e){return t.models.flatMap(n=>n.model.relations?.filter(r=>r.modelRef===e).map(r=>({model:n,relation:r}))??[])}function de(t,e){return t.models.filter(n=>n.featureRef===e)}function he(t){return t.model.primaryKeyFieldRefs}function pe(t){return!!t.service.create.enabled||!!t.service.update.enabled||!!t.service.delete.enabled||t.service.transformers.length>0}function me(t){return b.test(t)}function ye(t,e){return t.models.find(n=>n.name===e)?.id??e}const Re={byId:N,byIdOrThrow:fe,getScalarFieldById:ce,getRelationsToModel:le,getModelsForFeature:de,getModelIdFields:he,hasService:pe,validateModelName:me,getModelIdByNameOrDefault:ye};export{D as C,Z as D,ve as F,Re as M,P as Z,U as a,V as b,be as c,ee as d,we as e,f,c as g,h,Ee as i,Q as j,_e as k,xe as l,m,Pe as n,Y as o,v as p,te as q,w as s,G as z};
|
|
2
|
-
//# sourceMappingURL=model-utils-C4ofeY6G.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"model-utils-C4ofeY6G.js","sources":["../../../../node_modules/.pnpm/nanoid@5.0.9/node_modules/nanoid/index.browser.js","../../../utils/dist/string/random-uid.js","../../../utils/dist/validators/case-validators.js","../../../project-builder-lib/dist/plugins/spec/types.js","../../../project-builder-lib/dist/references/types.js","../../../project-builder-lib/dist/plugins/schema/common.js","../../../project-builder-lib/dist/plugins/schema/parser.js","../../../../node_modules/.pnpm/es-toolkit@1.31.0/node_modules/es-toolkit/dist/compat/_internal/isDeepKey.mjs","../../../../node_modules/.pnpm/es-toolkit@1.31.0/node_modules/es-toolkit/dist/compat/_internal/toKey.mjs","../../../../node_modules/.pnpm/es-toolkit@1.31.0/node_modules/es-toolkit/dist/compat/util/toPath.mjs","../../../../node_modules/.pnpm/es-toolkit@1.31.0/node_modules/es-toolkit/dist/compat/object/get.mjs","../../../../node_modules/.pnpm/es-toolkit@1.31.0/node_modules/es-toolkit/dist/compat/_internal/isIndex.mjs","../../../../node_modules/.pnpm/es-toolkit@1.31.0/node_modules/es-toolkit/dist/compat/object/set.mjs","../../../project-builder-lib/dist/references/ref-builder.js","../../../project-builder-lib/dist/schema/features/feature.js","../../../project-builder-lib/dist/definition/feature/feature-utils.js","../../../project-builder-lib/dist/definition/model/model-utils.js"],"sourcesContent":["import { urlAlphabet as scopedUrlAlphabet } from './url-alphabet/index.js'\nexport { urlAlphabet } from './url-alphabet/index.js'\nexport let random = bytes => crypto.getRandomValues(new Uint8Array(bytes))\nexport let customRandom = (alphabet, defaultSize, getRandom) => {\n let mask = (2 << Math.log2(alphabet.length - 1)) - 1\n let step = -~((1.6 * mask * defaultSize) / alphabet.length)\n return (size = defaultSize) => {\n let id = ''\n while (true) {\n let bytes = getRandom(step)\n let j = step | 0\n while (j--) {\n id += alphabet[bytes[j] & mask] || ''\n if (id.length >= size) return id\n }\n }\n }\n}\nexport let customAlphabet = (alphabet, size = 21) =>\n customRandom(alphabet, size | 0, random)\nexport let nanoid = (size = 21) => {\n let id = ''\n let bytes = crypto.getRandomValues(new Uint8Array((size |= 0)))\n while (size--) {\n id += scopedUrlAlphabet[bytes[size] & 63]\n }\n return id\n}\n","import { customAlphabet } from 'nanoid';\nconst NUMBERS = '0123456789';\nconst LOWERCASE = 'abcdefghijklmnopqrstuvwxyz';\nconst UPPERCASE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n/**\n * Use custom ID generator for characters that be easily selected\n */\nconst customNanoid = customAlphabet(`${NUMBERS}${LOWERCASE}${UPPERCASE}_`, 12);\n/**\n * Generate a random ID string made up of numbers, lowercase, and uppercase letters\n * @returns A random ID string\n */\nexport function randomUid(length = 12) {\n return customNanoid(length);\n}\n//# sourceMappingURL=random-uid.js.map","import { z } from 'zod';\n/**\n * Regex for validating kebab case, e.g. \"my-project\".\n */\nexport const KEBAB_CASE_REGEX = /^[a-z0-9-]+$/;\n/**\n * Regex for validating pascal case, e.g. \"MyProject\".\n */\nexport const PASCAL_CASE_REGEX = /^[A-Z][a-zA-Z0-9]*$/;\n/**\n * Regex for validating camel case, e.g. \"myProject\".\n */\nexport const CAMEL_CASE_REGEX = /^[a-z][a-zA-Z0-9]*$/;\n/**\n * Regex for validating constant case, e.g. \"MY_PROJECT\".\n */\nexport const CONSTANT_CASE_REGEX = /^[A-Z][A-Z0-9_]*$/;\nexport const CASE_VALIDATORS = {\n /**\n * Zod validator for validating kebab case, e.g. \"my-project\".\n */\n KEBAB_CASE: z.string().regex(KEBAB_CASE_REGEX),\n /**\n * Zod validator for validating pascal case, e.g. \"MyProject\".\n */\n PASCAL_CASE: z.string().regex(PASCAL_CASE_REGEX),\n /**\n * Zod validator for validating camel case, e.g. \"myProject\".\n */\n CAMEL_CASE: z.string().regex(CAMEL_CASE_REGEX),\n /**\n * Zod validator for validating constant case, e.g. \"MY_PROJECT\".\n */\n CONSTANT_CASE: z.string().regex(CONSTANT_CASE_REGEX),\n};\n//# sourceMappingURL=case-validators.js.map","export function createInitializedPluginSpec(spec, implementation) {\n return { spec, implementation };\n}\nexport function createPluginSpec(name, options) {\n const { platforms, defaultInitializer } = options ?? {};\n return {\n type: 'plugin-spec',\n name,\n platforms: platforms && (Array.isArray(platforms) ? platforms : [platforms]),\n isOptional: false,\n optional() {\n return { ...this, isOptional: true };\n },\n defaultInitializer,\n };\n}\n//# sourceMappingURL=types.js.map","import { randomUid } from '@baseplate-dev/utils';\n/**\n * Definition of an entity type.\n */\nexport class DefinitionEntityType {\n /**\n * Creates a new entity type.\n *\n * @param name - The name of the entity type.\n * @param prefix - The prefix of the entity type to use in the ID, defaults to the name.\n * @param parentType - The type of the parent entity if any\n */\n constructor(name, prefix, parentType) {\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: name\n });\n Object.defineProperty(this, \"parentType\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: parentType\n });\n Object.defineProperty(this, \"prefix\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.prefix = prefix ?? name.split('/').pop() ?? name;\n }\n /**\n * Generates a new ID for the entity type.\n *\n * @returns The new ID.\n */\n generateNewId() {\n return `${this.prefix}:${randomUid()}`;\n }\n fromUid(uid) {\n if (!uid) {\n return undefined;\n }\n return `${this.prefix}:${uid}`;\n }\n toUid(id) {\n return id.split(':')[1];\n }\n isId(id) {\n return id.startsWith(`${this.prefix}:`);\n }\n}\nexport function createEntityType(name, options) {\n const { parentType, prefix } = options ?? {};\n return new DefinitionEntityType(name, prefix, parentType);\n}\n//# sourceMappingURL=types.js.map","export const zodPluginSymbol = Symbol('zod-plugin');\n//# sourceMappingURL=common.js.map","/**\n * Zod Plugin Wrapper\n *\n * Used for initializing the zod parsing with plugins\n */\nimport { ZodType } from 'zod';\nimport { zodPluginSymbol } from './common.js';\nexport class ZodPluginWrapper extends ZodType {\n _parse(input) {\n // run builder\n const pluginContext = {\n pluginStore: this._def.pluginStore,\n };\n return this._def.innerType._parse({\n ...input,\n parent: {\n ...input.parent,\n common: {\n ...input.parent.common,\n [zodPluginSymbol]: pluginContext,\n },\n },\n });\n }\n get pluginStore() {\n return this._def.pluginStore;\n }\n}\nObject.defineProperty(ZodPluginWrapper, \"create\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (type, pluginStore) => new ZodPluginWrapper({\n innerType: type,\n pluginStore,\n })\n});\nexport function zPluginWrapper(type, pluginStore) {\n return ZodPluginWrapper.create(type, pluginStore);\n}\n//# sourceMappingURL=parser.js.map","function isDeepKey(key) {\n switch (typeof key) {\n case 'number':\n case 'symbol': {\n return false;\n }\n case 'string': {\n return key.includes('.') || key.includes('[') || key.includes(']');\n }\n }\n}\n\nexport { isDeepKey };\n","function toKey(value) {\n if (Object.is(value, -0)) {\n return '-0';\n }\n return value.toString();\n}\n\nexport { toKey };\n","function toPath(deepKey) {\n const result = [];\n const length = deepKey.length;\n if (length === 0) {\n return result;\n }\n let index = 0;\n let key = '';\n let quoteChar = '';\n let bracket = false;\n if (deepKey.charCodeAt(0) === 46) {\n result.push('');\n index++;\n }\n while (index < length) {\n const char = deepKey[index];\n if (quoteChar) {\n if (char === '\\\\' && index + 1 < length) {\n index++;\n key += deepKey[index];\n }\n else if (char === quoteChar) {\n quoteChar = '';\n }\n else {\n key += char;\n }\n }\n else if (bracket) {\n if (char === '\"' || char === \"'\") {\n quoteChar = char;\n }\n else if (char === ']') {\n bracket = false;\n result.push(key);\n key = '';\n }\n else {\n key += char;\n }\n }\n else {\n if (char === '[') {\n bracket = true;\n if (key) {\n result.push(key);\n key = '';\n }\n }\n else if (char === '.') {\n if (key) {\n result.push(key);\n key = '';\n }\n }\n else {\n key += char;\n }\n }\n index++;\n }\n if (key) {\n result.push(key);\n }\n return result;\n}\n\nexport { toPath };\n","import { isDeepKey } from '../_internal/isDeepKey.mjs';\nimport { toKey } from '../_internal/toKey.mjs';\nimport { toPath } from '../util/toPath.mjs';\n\nfunction get(object, path, defaultValue) {\n if (object == null) {\n return defaultValue;\n }\n switch (typeof path) {\n case 'string': {\n const result = object[path];\n if (result === undefined) {\n if (isDeepKey(path)) {\n return get(object, toPath(path), defaultValue);\n }\n else {\n return defaultValue;\n }\n }\n return result;\n }\n case 'number':\n case 'symbol': {\n if (typeof path === 'number') {\n path = toKey(path);\n }\n const result = object[path];\n if (result === undefined) {\n return defaultValue;\n }\n return result;\n }\n default: {\n if (Array.isArray(path)) {\n return getWithPath(object, path, defaultValue);\n }\n if (Object.is(path?.valueOf(), -0)) {\n path = '-0';\n }\n else {\n path = String(path);\n }\n const result = object[path];\n if (result === undefined) {\n return defaultValue;\n }\n return result;\n }\n }\n}\nfunction getWithPath(object, path, defaultValue) {\n if (path.length === 0) {\n return defaultValue;\n }\n let current = object;\n for (let index = 0; index < path.length; index++) {\n if (current == null) {\n return defaultValue;\n }\n current = current[path[index]];\n }\n if (current === undefined) {\n return defaultValue;\n }\n return current;\n}\n\nexport { get };\n","const IS_UNSIGNED_INTEGER = /^(?:0|[1-9]\\d*)$/;\nfunction isIndex(value, length = Number.MAX_SAFE_INTEGER) {\n switch (typeof value) {\n case 'number': {\n return Number.isInteger(value) && value >= 0 && value < length;\n }\n case 'symbol': {\n return false;\n }\n case 'string': {\n return IS_UNSIGNED_INTEGER.test(value);\n }\n }\n}\n\nexport { isIndex };\n","import { isIndex } from '../_internal/isIndex.mjs';\nimport { toPath } from '../util/toPath.mjs';\n\nfunction set(obj, path, value) {\n const resolvedPath = Array.isArray(path) ? path : typeof path === 'string' ? toPath(path) : [path];\n let current = obj;\n for (let i = 0; i < resolvedPath.length - 1; i++) {\n const key = resolvedPath[i];\n const nextKey = resolvedPath[i + 1];\n if (current[key] == null) {\n current[key] = isIndex(nextKey) ? [] : {};\n }\n current = current[key];\n }\n const lastKey = resolvedPath[resolvedPath.length - 1];\n current[lastKey] = value;\n return obj;\n}\n\nexport { set };\n","import { get, set } from 'es-toolkit/compat';\nimport { z, ZodType } from 'zod';\n/**\n * Zod reference ID schema: a string with a minimum length of 1.\n */\nexport const zRefId = z.string().min(1);\n/**\n * Determines whether the given object is a Promise.\n * @param object - The value to test.\n * @returns True if the value is a Promise, false otherwise.\n */\nfunction isPromise(object) {\n return object instanceof Promise;\n}\n/**\n * Creates a definition entity name resolver.\n * @param entityNameResolver - The entity name resolver.\n * @returns The definition entity name resolver.\n */\nexport function createDefinitionEntityNameResolver(entityNameResolver) {\n return entityNameResolver;\n}\n/**\n * ZodRefBuilder is responsible for constructing reference paths, and registering\n * references and entities as defined in a Zod schema.\n *\n * The builder uses a prefix (usually the current parsing path) and context (a\n * shared map for resolving relative references) to build complete reference paths.\n *\n * @template TInput - The type of the input data being parsed.\n */\nexport class ZodRefBuilder {\n /**\n * Creates a new builder instance.\n * @param pathPrefix - The starting path for all references.\n * @param context - Shared context including a path map and deserialize flag.\n * @param data - The data being parsed.\n */\n constructor(pathPrefix, context, data) {\n Object.defineProperty(this, \"references\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"entitiesWithNameResolver\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"pathPrefix\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"context\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"pathMap\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n Object.defineProperty(this, \"data\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: void 0\n });\n this.references = [];\n this.entitiesWithNameResolver = [];\n this.pathPrefix = pathPrefix;\n this.context = context;\n this.pathMap = new Map();\n this.data = data;\n }\n /**\n * Converts a dot-separated string path into an array of keys.\n * @param path - A string (e.g. \"a.b.0.c\") representing the path.\n * @returns An array of keys (numbers for numeric strings, otherwise strings).\n */\n _constructPathWithoutPrefix(path) {\n if (!path)\n return [];\n const pathComponents = path\n .split('.')\n .map((key) => (/^[0-9]+$/.test(key) ? Number.parseInt(key, 10) : key));\n return pathComponents;\n }\n /**\n * Prepends the builder's path prefix to the provided path.\n * @param path - The dot-separated path string.\n * @returns The complete reference path as an array.\n */\n _constructPath(path) {\n if (!path)\n return this.pathPrefix;\n return [...this.pathPrefix, ...this._constructPathWithoutPrefix(path)];\n }\n /**\n * Constructs a reference path that may be defined directly as a string or indirectly\n * via a context object. If a context object is provided, the function looks up the\n * actual path from the builder's context.\n *\n * @param path - Either a dot-separated string path or an object with a context key.\n * @param expectedEntityType - The entity type expected for this context.\n * @returns The resolved reference path.\n * @throws If the context cannot be found or its type does not match.\n */\n _constructPathWithContext(path, expectedEntityType) {\n if (typeof path === 'string') {\n return this._constructPath(path);\n }\n // Lookup the context for the given key.\n const pathContext = this.context.pathMap.get(path.context);\n if (!pathContext) {\n throw new Error(`Could not find context for ${path.context} from ${this.pathPrefix.join('.')}`);\n }\n if (pathContext.type !== expectedEntityType) {\n throw new Error(`Attempted to retrieve context for ${path.context} from ${this.pathPrefix.join('.')} expecting ${expectedEntityType.name}, but found ${pathContext.type.name}`);\n }\n return pathContext.path;\n }\n /**\n * Registers a reference based on the provided input definition.\n *\n * Flow:\n * 1. Validate that the parent path is provided if required (and vice versa).\n * 2. Compute the reference path; if the path is empty, use the entire data.\n * 3. If the referenced value is null or undefined, skip adding the reference.\n * 4. Otherwise, add the reference and, if requested, register its context.\n *\n * @param reference - The reference definition.\n * @throws If parent path usage is incorrect.\n */\n addReference(reference) {\n if (!reference.type.parentType && reference.parentPath) {\n throw new Error(`Parent path does nothing since reference does not have parent`);\n }\n if (reference.type.parentType && !reference.parentPath) {\n throw new Error(`Parent path required if reference type has parent type`);\n }\n // Compute the path without prefix once.\n const refPathWithoutPrefix = this._constructPathWithoutPrefix(reference.path);\n // If the path is empty, use the entire data; otherwise, retrieve the value.\n const refValue = refPathWithoutPrefix.length === 0\n ? this.data\n : get(this.data, refPathWithoutPrefix);\n if (refValue === undefined || refValue === null)\n return;\n const fullPath = this._constructPath(reference.path);\n this.references.push({\n type: reference.type,\n path: fullPath,\n parentPath: reference.parentPath &&\n reference.type.parentType &&\n this._constructPathWithContext(reference.parentPath, reference.type.parentType),\n onDelete: reference.onDelete,\n });\n // Optionally, add this path to the shared context.\n if (reference.addContext) {\n this._addPathToContext(fullPath, reference.type, reference.addContext);\n }\n }\n /**\n * Registers an entity based on the provided definition.\n *\n * Flow:\n * 1. Validate that not both a name and a name reference path are provided.\n * 2. Compute the full entity path.\n * 3. Resolve the entity ID:\n * - Use the provided idPath if available; otherwise, default to appending 'id'\n * to the entity path.\n * - If no id is found, generate a new one.\n * 4. Resolve the entity name:\n * - Use the provided resolveName if available; otherwise, default to using the\n * name path.\n * 5. Register the entity in either the direct entities list or the name-ref list.\n * 6. Optionally, add the entity’s id path to the shared context.\n *\n * @param entity - The entity definition.\n * @throws If both name and nameRefPath are provided or if no name is resolved.\n */\n addEntity(entity) {\n // Build the full path for the entity.\n const path = this._constructPath(entity.path);\n // Resolve the id path: if provided use it; otherwise, assume the id is at \"entity.path.id\"\n const idPath = entity.idPath\n ? this._constructPathWithoutPrefix(entity.idPath)\n : [...this._constructPathWithoutPrefix(entity.path), 'id'];\n // TODO [>=0.9.16] Remove the fallback to generateNewId once a new version is released and manual setter\n const id = get(this.data, idPath) ??\n entity.type.generateNewId();\n if (!get(this.data, idPath)) {\n set(this.data, idPath, id);\n }\n if (!entity.type.isId(id)) {\n throw new Error(`Invalid id: ${id} for entity ${entity.type.name}`);\n }\n // Resolve the name: if getNameResolver is provided, use it to build the name resolver; otherwise,\n // use the default name resolver.\n const getNameResolver = entity.getNameResolver ?? ((value) => get(value, 'name'));\n const nameResolver = getNameResolver(this.data);\n // Base entity definition shared between regular entities and those with a name reference.\n const entityBase = {\n id,\n type: entity.type,\n path,\n idPath: [...this.pathPrefix, ...idPath],\n parentPath: entity.parentPath &&\n entity.type.parentType &&\n this._constructPathWithContext(entity.parentPath, entity.type.parentType),\n };\n this.entitiesWithNameResolver.push({\n ...entityBase,\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- needed to allow more specific generic typed to be put in here\n nameResolver: typeof nameResolver === 'string'\n ? { resolveName: () => nameResolver }\n : nameResolver,\n });\n // Optionally add the id path to the context.\n if (entity.addContext) {\n this._addPathToContext([...this.pathPrefix, ...idPath], entity.type, entity.addContext);\n }\n }\n /**\n * Registers a given path into the builder's context map.\n * @param path - The full reference path.\n * @param type - The entity type associated with the path.\n * @param context - A unique key to identify this context.\n * @throws If the context key is already registered.\n */\n _addPathToContext(path, type, context) {\n if (this.pathMap.has(context)) {\n throw new Error(`Context path already defined for ${context} at ${this.pathPrefix.join('.')}`);\n }\n this.pathMap.set(context, { path, type });\n }\n /**\n * Convenience method that builds a full path from a dot-separated string and\n * adds it to the context.\n * @param path - The dot-separated string path.\n * @param type - The entity type.\n * @param context - The context key.\n */\n addPathToContext(path, type, context) {\n this._addPathToContext(this._constructPath(path), type, context);\n }\n}\n/**\n * Unique symbol used to store ZodRef context in the parent’s common context.\n */\nconst zodRefSymbol = Symbol('zod-ref');\n/**\n * ZodRef wraps an inner Zod type and enhances it with the ability to register\n * and process entity references. During parsing, it delegates to a builder (if present)\n * to collect references and entities before delegating to the inner type.\n *\n * @template T - The inner Zod type.\n */\nexport class ZodRef extends ZodType {\n /**\n * The core parse method that:\n * 1. Retrieves (or creates) the builder context from the parent.\n * 2. Runs the builder function (if present) to register references/entities.\n * 3. Delegates parsing to the inner type.\n * 4. Transforms the output to replace entity id placeholders with generated ids.\n *\n * @param input - The Zod parse input.\n * @returns The parse result.\n */\n _parse(input) {\n const context = input.parent.common;\n // If no builder context or builder function exists, simply parse using the inner type.\n const zodRefContext = context[zodRefSymbol];\n if (!zodRefContext || !this._def.builder) {\n return this._def.innerType._parse(input);\n }\n // Create a new builder instance for the current parsing context.\n const builder = new ZodRefBuilder(input.path, zodRefContext.context, input.data);\n // Execute the builder function to register references/entities.\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n this._def.builder(builder, input.data);\n zodRefContext.references.push(...builder.references);\n zodRefContext.entitiesWithNameResolver.push(...builder.entitiesWithNameResolver);\n // Re-parse using the inner type but merge the updated context.\n const parseOutput = this._def.innerType._parse({\n ...input,\n path: input.path,\n parent: {\n ...input.parent,\n common: {\n ...input.parent.common,\n [zodRefSymbol]: {\n ...zodRefContext,\n context: {\n ...zodRefContext.context,\n // Merge new context entries from the builder.\n pathMap: new Map([\n ...zodRefContext.context.pathMap,\n ...builder.pathMap,\n ]),\n },\n },\n },\n },\n });\n /**\n * Transforms the output of the inner parse by iterating through all registered\n * entities and assigning the id to the corresponding path in the output in case\n * it was generated by the builder.\n *\n * @param output - The result from the inner parse.\n * @returns The transformed parse output.\n */\n function transformParseOutput(output) {\n if (output.status === 'aborted')\n return output;\n // For each entity, assign the id to the corresponding path in the output\n // in the event that it was generated by the builder.\n for (const entity of builder.entitiesWithNameResolver) {\n set(output.value, entity.idPath.slice(input.path.length), entity.id);\n }\n return output;\n }\n // If the parse result is a Promise, attach the transformation asynchronously.\n if (isPromise(parseOutput)) {\n return parseOutput.then(transformParseOutput);\n }\n return transformParseOutput(parseOutput);\n }\n /**\n * Returns the inner Zod type.\n * @returns The wrapped inner Zod type.\n */\n innerType() {\n return this._def.innerType;\n }\n /**\n * Adds an entity registration to the current ZodRef.\n *\n * @param entity - Either an entity definition or a function that returns one.\n * @returns A new ZodRef instance with the entity registration added.\n */\n addEntity(entity) {\n return ZodRef.create(this, (builder, data) => {\n builder.addEntity(typeof entity === 'function' ? entity(data) : entity);\n });\n }\n /**\n * Adds a reference registration to the current ZodRef.\n *\n * @param reference - Either a reference definition or a function that returns one.\n * @returns A new ZodRef instance with the reference registration added.\n */\n addReference(reference) {\n return ZodRef.create(this, (builder, data) => {\n builder.addReference(typeof reference === 'function' ? reference(data) : reference);\n });\n }\n /**\n * Applies a custom builder function to the ZodRef.\n * @param builder - The builder function that registers additional references/entities.\n * @returns A new ZodRef instance with the builder applied.\n */\n refBuilder(builder) {\n return ZodRef.create(this, builder);\n }\n}\n/**\n * Creates a new ZodRef instance wrapping a given Zod type with an optional builder.\n * @param type - The inner Zod type.\n * @param builder - Optional builder function to register references/entities.\n * @returns A new ZodRef instance.\n */\nObject.defineProperty(ZodRef, \"create\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (type, builder) => new ZodRef({\n innerType: type,\n builder,\n })\n});\n/**\n * Convenience function for creating a ZodRef using a schema and an optional builder.\n * @param schema - The base Zod schema.\n * @param builder - Optional builder function.\n * @returns A new ZodRef instance.\n */\nexport function zRefBuilder(schema, builder) {\n return ZodRef.create(schema, builder);\n}\n/**\n * Convenience function for creating a ZodRef with a reference added.\n * @param schema - The base Zod schema.\n * @param reference - Either a reference definition or a function returning one.\n * @returns A new ZodRef instance with the reference registration.\n */\nexport function zRef(schema, reference) {\n return ZodRef.create(schema).addReference(reference);\n}\n/**\n * Convenience function for creating a ZodRef that registers an entity.\n * This function also sets the id key on the schema using zRefId.\n *\n * @template TObject - The Zod object type.\n * @template TEntityType - The entity type.\n * @template TPath - The path type.\n * @param schema - The base Zod object schema.\n * @param entity - Either an entity definition or a function returning one.\n * @returns A new ZodRef instance with the entity registration.\n */\nexport function zEnt(schema, entity) {\n // Set the \"id\" key on the schema using zRefId and then register the entity.\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-explicit-any\n return ZodRef.create(schema.setKey('id', zRefId)).addEntity(entity);\n}\n/**\n * ZodRefWrapper is used for initializing parsing that collects references and entities.\n *\n * @template T - The inner Zod type.\n */\nexport class ZodRefWrapper extends ZodType {\n /**\n * Core parse method that:\n * 1. Initializes a fresh reference context.\n * 2. Parses using the inner type while injecting the context.\n * 3. Returns a payload containing the parsed data, along with references and entities.\n *\n * @param input - The parse input.\n * @returns The parsed payload.\n */\n _parse(input) {\n // Initialize the reference context.\n const refContext = {\n context: {\n pathMap: new Map(),\n },\n references: [],\n entitiesWithNameResolver: [],\n };\n // Inject the refContext into the parent's common context and parse the inner type.\n const parseOutput = this._def.innerType._parse({\n ...input,\n parent: {\n ...input.parent,\n common: {\n ...input.parent.common,\n [zodRefSymbol]: refContext,\n },\n },\n });\n function transformParseOutput(output) {\n if (output.status === 'aborted')\n return output;\n return {\n ...output,\n value: {\n data: output.value,\n entitiesWithNameResolver: refContext.entitiesWithNameResolver,\n references: refContext.references,\n },\n };\n }\n if (isPromise(parseOutput)) {\n return parseOutput.then(transformParseOutput);\n }\n return transformParseOutput(parseOutput);\n }\n}\n/**\n * Creates a new ZodRefWrapper instance.\n * @param type - The inner Zod type.\n * @param options - Options for the ZodRefWrapper.\n * @param options.skipReferenceNameResolution - Flag to skip resolving references to names (serialized definitions use resolved name references).\n * @param options.allowInvalidReferences - Flag to allow invalid references (used for testing deletes).\n * @returns A new instance of ZodRefWrapper.\n */\nObject.defineProperty(ZodRefWrapper, \"create\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: (type) => new ZodRefWrapper({\n innerType: type,\n })\n});\n//# sourceMappingURL=ref-builder.js.map","import { CASE_VALIDATORS } from '@baseplate-dev/utils';\nimport { z } from 'zod';\nimport { createEntityType, zEnt, zRef } from '#src/references/index.js';\nexport const featureEntityType = createEntityType('feature');\nexport const featureNameSchema = CASE_VALIDATORS.KEBAB_CASE;\nexport const featureSchema = zEnt(z.object({\n name: z\n .string()\n .min(1)\n .refine((name) => name\n .split('/')\n .every((part) => featureNameSchema.safeParse(part).success), {\n message: 'Feature name must be lowercase and contain only letters, numbers, and dashes',\n }),\n parentRef: zRef(z.string().nullish(), {\n type: featureEntityType,\n onDelete: 'DELETE_PARENT',\n }),\n}), { type: featureEntityType });\nexport const featuresSchema = z.array(featureSchema).default([]);\n//# sourceMappingURL=feature.js.map","import { featureEntityType, featureNameSchema } from '#src/schema/index.js';\nfunction getRootFeatures(projectDefinition) {\n return projectDefinition.features.filter((f) => !f.parentRef);\n}\nfunction getFeatureById(projectDefinition, featureId) {\n return projectDefinition.features.find((f) => f.id === featureId);\n}\nfunction getFeatureByIdOrThrow(projectDefinition, featureId) {\n const feature = getFeatureById(projectDefinition, featureId);\n if (!feature) {\n throw new Error(`Could not find feature with ID ${featureId}`);\n }\n return feature;\n}\nfunction getFeatureChildren(projectDefinition, featureId) {\n return projectDefinition.features.filter((f) => f.parentRef === featureId);\n}\nfunction getFeatureName(featureConfig) {\n return featureConfig.name.split('/').pop() ?? '';\n}\nfunction getFeatureNameById(projectDefinition, featureId) {\n const feature = getFeatureByIdOrThrow(projectDefinition, featureId);\n return getFeatureName(feature);\n}\nfunction getFeaturePathById(projectDefinition, featureId) {\n const feature = getFeatureByIdOrThrow(projectDefinition, featureId);\n return feature.name;\n}\nfunction validateFeatureName(name) {\n const nameParts = name.split('/');\n return nameParts.every((part) => featureNameSchema.safeParse(part).success);\n}\nfunction ensureFeatureByNameRecursively(projectDefinition, nameOrId) {\n if (featureEntityType.isId(nameOrId)) {\n return nameOrId;\n }\n const nameParts = nameOrId.split('/');\n let lastName = '';\n let parentRef = null;\n for (const part of nameParts) {\n const feature = projectDefinition.features.find((f) => f.name === part && f.parentRef === parentRef);\n const name = [lastName, part].filter(Boolean).join('/');\n if (feature) {\n parentRef = feature.id;\n }\n else {\n const newFeature = {\n id: featureEntityType.generateNewId(),\n name,\n parentRef,\n };\n projectDefinition.features.push(newFeature);\n parentRef = newFeature.id;\n }\n lastName = name;\n }\n if (!parentRef) {\n throw new Error('Failed to create feature');\n }\n return parentRef;\n}\nfunction getFeatureByName(projectDefinition, name) {\n return projectDefinition.features.find((f) => f.name === name);\n}\nfunction getFeatureIdByNameOrDefault(projectDefinition, name) {\n return getFeatureByName(projectDefinition, name)?.id ?? name;\n}\nexport const FeatureUtils = {\n getRootFeatures,\n getFeatureById,\n getFeatureByIdOrThrow,\n getFeatureChildren,\n getFeatureName,\n getFeatureNameById,\n getFeaturePathById,\n validateFeatureName,\n ensureFeatureByNameRecursively,\n getFeatureByName,\n getFeatureIdByNameOrDefault,\n};\n//# sourceMappingURL=feature-utils.js.map","import { PASCAL_CASE_REGEX } from '@baseplate-dev/utils';\nfunction byId(projectDefinition, id) {\n return projectDefinition.models.find((m) => m.id === id);\n}\nfunction byIdOrThrow(projectDefinition, id) {\n const model = byId(projectDefinition, id);\n if (!model) {\n throw new Error(`Could not find model with ID ${id}`);\n }\n return model;\n}\nfunction getScalarFieldById(model, id) {\n const field = model.model.fields.find((f) => f.id === id);\n if (!field) {\n throw new Error(`Could not find field with ID ${id}`);\n }\n return field;\n}\nfunction getRelationsToModel(projectDefinition, modelId) {\n return projectDefinition.models.flatMap((m) => m.model.relations\n ?.filter((r) => r.modelRef === modelId)\n .map((r) => ({ model: m, relation: r })) ?? []);\n}\nfunction getModelsForFeature(projectDefinition, featureId) {\n return projectDefinition.models.filter((m) => m.featureRef === featureId);\n}\nfunction getModelIdFields(model) {\n return model.model.primaryKeyFieldRefs;\n}\nfunction hasService(model) {\n return (!!model.service.create.enabled ||\n !!model.service.update.enabled ||\n !!model.service.delete.enabled ||\n model.service.transformers.length > 0);\n}\nfunction validateModelName(name) {\n return PASCAL_CASE_REGEX.test(name);\n}\n/**\n * Returns the ID of a model by name, or the name if no model is found.\n * @param projectDefinition - The project definition.\n * @param name - The name of the model.\n * @returns The ID of the model, or the name if no model is found.\n */\nfunction getModelIdByNameOrDefault(projectDefinition, name) {\n return projectDefinition.models.find((m) => m.name === name)?.id ?? name;\n}\nexport const ModelUtils = {\n byId,\n byIdOrThrow,\n getScalarFieldById,\n getRelationsToModel,\n getModelsForFeature,\n getModelIdFields,\n hasService,\n validateModelName,\n getModelIdByNameOrDefault,\n};\n//# sourceMappingURL=model-utils.js.map"],"names":["random","bytes","customRandom","alphabet","defaultSize","getRandom","mask","step","size","id","j","customAlphabet","NUMBERS","LOWERCASE","UPPERCASE","customNanoid","randomUid","length","z","importShared","KEBAB_CASE_REGEX","PASCAL_CASE_REGEX","CAMEL_CASE_REGEX","CONSTANT_CASE_REGEX","CASE_VALIDATORS","createInitializedPluginSpec","spec","implementation","createPluginSpec","name","options","platforms","defaultInitializer","DefinitionEntityType","prefix","parentType","uid","createEntityType","zodPluginSymbol","ZodType","ZodPluginWrapper","input","pluginContext","type","pluginStore","zPluginWrapper","isDeepKey","key","toKey","value","toPath","deepKey","result","index","quoteChar","bracket","char","get","object","path","defaultValue","getWithPath","current","IS_UNSIGNED_INTEGER","isIndex","set","obj","resolvedPath","i","nextKey","lastKey","zRefId","isPromise","createDefinitionEntityNameResolver","entityNameResolver","ZodRefBuilder","pathPrefix","context","data","expectedEntityType","pathContext","reference","refPathWithoutPrefix","refValue","fullPath","entity","idPath","nameResolver","entityBase","zodRefSymbol","ZodRef","zodRefContext","builder","parseOutput","transformParseOutput","output","zRefBuilder","schema","zRef","zEnt","ZodRefWrapper","refContext","featureEntityType","featureNameSchema","featureSchema","part","featuresSchema","getRootFeatures","projectDefinition","f","getFeatureById","featureId","getFeatureByIdOrThrow","feature","getFeatureChildren","getFeatureName","featureConfig","getFeatureNameById","getFeaturePathById","validateFeatureName","ensureFeatureByNameRecursively","nameOrId","nameParts","lastName","parentRef","newFeature","getFeatureByName","getFeatureIdByNameOrDefault","FeatureUtils","byId","m","byIdOrThrow","model","getScalarFieldById","field","getRelationsToModel","modelId","getModelsForFeature","getModelIdFields","hasService","validateModelName","getModelIdByNameOrDefault","ModelUtils"],"mappings":"kEAEO,IAAIA,EAASC,GAAS,OAAO,gBAAgB,IAAI,WAAWA,CAAK,CAAC,EAC9DC,EAAe,CAACC,EAAUC,EAAaC,IAAc,CAC9D,IAAIC,GAAQ,GAAK,KAAK,KAAKH,EAAS,OAAS,CAAC,GAAK,EAC/CI,EAAO,CAAC,EAAG,IAAMD,EAAOF,EAAeD,EAAS,QACpD,MAAO,CAACK,EAAOJ,IAAgB,CAC7B,IAAIK,EAAK,GACT,OAAa,CACX,IAAIR,EAAQI,EAAUE,CAAI,EACtBG,EAAIH,EAAO,EACf,KAAOG,KAEL,GADAD,GAAMN,EAASF,EAAMS,CAAC,EAAIJ,CAAI,GAAK,GAC/BG,EAAG,QAAUD,EAAM,OAAOC,CAEtC,CACA,CACA,EACWE,EAAiB,CAACR,EAAUK,EAAO,KAC5CN,EAAaC,EAAUK,EAAO,EAAGR,CAAM,EClBzC,MAAMY,EAAU,aACVC,EAAY,6BACZC,EAAY,6BAIZC,EAAeJ,EAAe,GAAGC,CAAO,GAAGC,CAAS,GAAGC,CAAS,IAAK,EAAE,EAKtE,SAASE,EAAUC,EAAS,GAAI,CACnC,OAAOF,EAAaE,CAAM,CAC9B,CCdA,KAAA,CAAA,EAAAC,CAAA,EAAA,MAAAC,EAAA,KAAA,EAIaC,EAA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