@kyro-cms/core 0.11.6 → 0.12.1
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/{WebhookService-BoHm8roq.d.cts → WebhookService-DRQLv_jR.d.cts} +34 -2
- package/dist/{WebhookService-0D8rBDOw.d.ts → WebhookService-DTNKXpXp.d.ts} +34 -2
- package/dist/api-handler-graphql.cjs +1 -1
- package/dist/api-handler-graphql.js +1 -1
- package/dist/api-handler-trpc.cjs +1 -1
- package/dist/api-handler-trpc.js +1 -1
- package/dist/api-handler.cjs +1 -1
- package/dist/api-handler.js +1 -1
- package/dist/{base-D_gWzhL1.d.ts → base-BKGB0Y3W.d.ts} +7 -7
- package/dist/{base-m1Y9PVG6.d.cts → base-Dk6eKGJJ.d.cts} +7 -7
- package/dist/chunk-4RSGPSKQ.js +3 -0
- package/dist/{chunk-GJQH6NV7.js → chunk-5BPMMIAQ.js} +1 -1
- package/dist/chunk-5KGQOTLK.cjs +133 -0
- package/dist/chunk-76RLJA6S.js +133 -0
- package/dist/chunk-APQOYPRT.cjs +86 -0
- package/dist/{chunk-CAD6VWL5.js → chunk-BRAWV32L.js} +1 -1
- package/dist/{chunk-W4ZDETHA.cjs → chunk-EJDIR56C.cjs} +1 -1
- package/dist/{chunk-BDBN4RN6.cjs → chunk-ER2PUSHG.cjs} +1 -1
- package/dist/{chunk-MOMALAYX.cjs → chunk-FKTZLM2C.cjs} +1 -1
- package/dist/{chunk-F7SR5IDT.cjs → chunk-G3J2EU5D.cjs} +1 -1
- package/dist/{chunk-SL3LZQCF.js → chunk-GKYEJ2UF.js} +1 -1
- package/dist/chunk-HQND27DT.cjs +21 -0
- package/dist/chunk-HS2KNFAB.cjs +2 -0
- package/dist/{chunk-PFT4OMNK.js → chunk-INB4LNA6.js} +2 -2
- package/dist/chunk-KG7V6O2Z.js +2 -0
- package/dist/chunk-PP7W5UKL.js +2 -0
- package/dist/chunk-QMPMY2WI.js +86 -0
- package/dist/chunk-RCV2TLOG.cjs +3 -0
- package/dist/chunk-SK2Q4PRV.cjs +90 -0
- package/dist/{chunk-4YYBWCDJ.js → chunk-TQNM4C7H.js} +1 -1
- package/dist/{chunk-DNLO7PK6.cjs → chunk-UCCFT5OO.cjs} +1 -1
- package/dist/chunk-WE46GGL4.cjs +2 -0
- package/dist/chunk-WRSQOKRF.js +21 -0
- package/dist/chunk-YPDRUVWG.js +2 -0
- package/dist/client.cjs +1 -1
- package/dist/client.d.cts +2 -2
- package/dist/client.d.ts +2 -2
- package/dist/client.js +1 -1
- package/dist/drizzle/index.cjs +1 -1
- package/dist/drizzle/index.d.cts +7 -7
- package/dist/drizzle/index.d.ts +7 -7
- package/dist/drizzle/index.js +1 -1
- package/dist/fields/index.cjs +1 -1
- package/dist/fields/index.d.cts +2 -2
- package/dist/fields/index.d.ts +2 -2
- package/dist/fields/index.js +1 -1
- package/dist/graphql/index.cjs +1 -1
- package/dist/graphql/index.d.cts +8 -8
- package/dist/graphql/index.d.ts +8 -8
- package/dist/graphql/index.js +1 -1
- package/dist/{index-DpuTMOei.d.cts → index-cBgeiKp1.d.ts} +7 -2
- package/dist/{index-wsdh-ul-.d.ts → index-yPGko8UV.d.cts} +7 -2
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +19 -35
- package/dist/index.d.ts +19 -35
- package/dist/index.js +2 -2
- package/dist/mongodb/index.cjs +1 -1
- package/dist/mongodb/index.d.cts +7 -7
- package/dist/mongodb/index.d.ts +7 -7
- package/dist/mongodb/index.js +1 -1
- package/dist/rest/index.cjs +1 -1
- package/dist/rest/index.d.cts +6 -6
- package/dist/rest/index.d.ts +6 -6
- package/dist/rest/index.js +1 -1
- package/dist/templates/index.cjs +1 -1
- package/dist/templates/index.d.cts +2 -2
- package/dist/templates/index.d.ts +2 -2
- package/dist/templates/index.js +1 -1
- package/dist/trpc/index.cjs +1 -1
- package/dist/trpc/index.d.cts +5 -5
- package/dist/trpc/index.d.ts +5 -5
- package/dist/trpc/index.js +1 -1
- package/dist/{types-Cxb3Ukwl.d.ts → types-Bj3d_ys8.d.ts} +15 -15
- package/dist/{types-CGQSckv0.d.cts → types-BowAPGjD.d.cts} +15 -15
- package/dist/{types-CIJsFuvf.d.cts → types-fvldOd92.d.cts} +17 -7
- package/dist/{types-CIJsFuvf.d.ts → types-fvldOd92.d.ts} +17 -7
- package/dist/ws/index.cjs +1 -1
- package/dist/ws/index.d.cts +4 -4
- package/dist/ws/index.d.ts +4 -4
- package/dist/ws/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-43U2NBVS.cjs +0 -86
- package/dist/chunk-4FV3HQBI.cjs +0 -1
- package/dist/chunk-6CF7WF64.cjs +0 -90
- package/dist/chunk-7ORSLR3S.js +0 -2
- package/dist/chunk-FCPFEHTM.cjs +0 -3
- package/dist/chunk-FU5JJVYA.js +0 -3
- package/dist/chunk-HM2Y4R77.js +0 -21
- package/dist/chunk-MTFJDAPX.js +0 -133
- package/dist/chunk-O7FYIPJW.cjs +0 -2
- package/dist/chunk-QAJS4EXW.cjs +0 -133
- package/dist/chunk-QEKTGNUJ.cjs +0 -21
- package/dist/chunk-QIP7PY2U.js +0 -1
- package/dist/chunk-V465K673.js +0 -86
- package/dist/chunk-XQPYBNIT.js +0 -2
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
'use strict';var html=require('@tiptap/html'),d=require('@tiptap/starter-kit'),s=require('@tiptap/extension-link'),c=require('@tiptap/extension-image'),p=require('@tiptap/extension-text-align'),x=require('@tiptap/extension-underline'),u=require('@tiptap/extension-highlight'),g=require('@tiptap/extension-task-list'),m=require('@tiptap/extension-task-item'),extensionTextStyle=require('@tiptap/extension-text-style'),y=require('@tiptap/extension-color');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var d__default=/*#__PURE__*/_interopDefault(d);var s__default=/*#__PURE__*/_interopDefault(s);var c__default=/*#__PURE__*/_interopDefault(c);var p__default=/*#__PURE__*/_interopDefault(p);var x__default=/*#__PURE__*/_interopDefault(x);var u__default=/*#__PURE__*/_interopDefault(u);var g__default=/*#__PURE__*/_interopDefault(g);var m__default=/*#__PURE__*/_interopDefault(m);var y__default=/*#__PURE__*/_interopDefault(y);function b(e){return e.type==="text"}function h(e){return e.type==="number"}function k(e){return e.type==="relationship"}function B(e){return e.type==="array"}function R(e){return e.type==="group"}function T(e){return e.type==="blocks"}function w(e){return e.type==="upload"}function I(e){return e.type==="image"}function L(e){return e.type==="richtext"}function A(e){return e.type==="select"}function C(e){return e.type==="row"||e.type==="collapsible"||e.type==="tabs"}function D(e){return e.type==="icon"}var r=["text","number","checkbox","date","email","password","textarea","select","radio","color","icon"],n=["richtext","json","code","upload","image","markdown"],o=["relationship","array","group","blocks"],a=["row","collapsible","tabs"],V=[...r,...n,...o,...a];function S(e,t,i){return {name:e,type:"relationship",relationTo:t,...i,required:i?.required??false}}var G=`
|
|
2
|
+
.kyro-richtext {
|
|
3
|
+
color: inherit;
|
|
4
|
+
line-height: 1.7;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.kyro-richtext > *:first-child {
|
|
8
|
+
margin-top: 0;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.kyro-richtext > *:last-child {
|
|
12
|
+
margin-bottom: 0;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.kyro-richtext p,
|
|
16
|
+
.kyro-richtext ul,
|
|
17
|
+
.kyro-richtext ol,
|
|
18
|
+
.kyro-richtext blockquote,
|
|
19
|
+
.kyro-richtext pre {
|
|
20
|
+
margin: 0 0 1rem;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.kyro-richtext h1,
|
|
24
|
+
.kyro-richtext h2,
|
|
25
|
+
.kyro-richtext h3,
|
|
26
|
+
.kyro-richtext h4,
|
|
27
|
+
.kyro-richtext h5,
|
|
28
|
+
.kyro-richtext h6 {
|
|
29
|
+
margin: 0 0 0.75rem;
|
|
30
|
+
line-height: 1.2;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.kyro-richtext ul,
|
|
34
|
+
.kyro-richtext ol {
|
|
35
|
+
padding-left: 1.5rem;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.kyro-richtext blockquote {
|
|
39
|
+
border-left: 4px solid rgba(148, 163, 184, 0.5);
|
|
40
|
+
margin-left: 0;
|
|
41
|
+
padding-left: 1rem;
|
|
42
|
+
font-style: italic;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.kyro-richtext pre {
|
|
46
|
+
overflow-x: auto;
|
|
47
|
+
border-radius: 0.75rem;
|
|
48
|
+
background: rgba(15, 23, 42, 0.92);
|
|
49
|
+
color: #f8fafc;
|
|
50
|
+
padding: 1rem;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.kyro-richtext code {
|
|
54
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.kyro-richtext img {
|
|
58
|
+
display: block;
|
|
59
|
+
max-width: 100%;
|
|
60
|
+
height: auto;
|
|
61
|
+
border-radius: 0.75rem;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.kyro-richtext ul[data-type="taskList"] {
|
|
65
|
+
list-style: none;
|
|
66
|
+
padding: 0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.kyro-richtext li[data-type="taskItem"] {
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: flex-start;
|
|
72
|
+
gap: 0.5rem;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.kyro-richtext li[data-type="taskItem"] > label {
|
|
76
|
+
user-select: none;
|
|
77
|
+
pointer-events: none;
|
|
78
|
+
margin-top: 0.2rem;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.kyro-richtext li[data-type="taskItem"] > div {
|
|
82
|
+
flex: 1;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.kyro-richtext mark {
|
|
86
|
+
background-color: #fef08a;
|
|
87
|
+
border-radius: 0.25rem;
|
|
88
|
+
padding: 0.125rem 0.25rem;
|
|
89
|
+
}
|
|
90
|
+
`.trim(),f=[d__default.default,s__default.default.configure({openOnClick:false}),c__default.default,p__default.default.configure({types:["heading","paragraph"]}),x__default.default,u__default.default.configure({multicolor:true}),g__default.default,m__default.default.configure({nested:true}),extensionTextStyle.TextStyle,y__default.default];function j(e){return typeof e=="object"&&e!==null?e:{}}function J(e){if(typeof e!="object"||e===null)return "";try{return `<div class="kyro-richtext">${html.generateHTML(e,f)}</div>`}catch(t){return console.error("Failed to render rich text:",t),""}}exports.a=b;exports.b=h;exports.c=k;exports.d=B;exports.e=R;exports.f=T;exports.g=w;exports.h=I;exports.i=L;exports.j=A;exports.k=C;exports.l=D;exports.m=r;exports.n=n;exports.o=o;exports.p=a;exports.q=V;exports.r=S;exports.s=G;exports.t=j;exports.u=J;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-KDNYHLD2.js';var a=class{collections=new Map;globals=new Map;connected=false;tenantContext;setTenantContext(e){this.tenantContext=e;}getTenantContext(){return this.tenantContext}async init(e,n=[]){for(let t of e)this.collections.set(t.slug,t);for(let t of n)this.globals.set(t.slug,t);await this.connect();}getCollection(e){let n=this.collections.get(e);if(!n)throw console.error(`[Adapter] Missing collection "${e}". Available collections:`,Array.from(this.collections.keys())),new Error(`Collection "${e}" not found in adapter`);return n}applyTenantFilter(e={},n){return n?{...e,
|
|
1
|
+
import {b}from'./chunk-KDNYHLD2.js';var a=class{collections=new Map;globals=new Map;connected=false;tenantContext;setTenantContext(e){this.tenantContext=e;}getTenantContext(){return this.tenantContext}async init(e,n=[]){for(let t of e)this.collections.set(t.slug,t);for(let t of n)this.globals.set(t.slug,t);await this.connect();}getCollection(e){let n=this.collections.get(e);if(!n)throw console.error(`[Adapter] Missing collection "${e}". Available collections:`,Array.from(this.collections.keys())),new Error(`Collection "${e}" not found in adapter`);return n}applyTenantFilter(e={},n){return n?{...e,tenantId:{equals:n}}:e}getTableName(e){return e.replace(/-/g,"_")}prepareData(e,n){let t={...e};return n.timestamps&&(t.updatedAt=new Date().toISOString(),t.createdAt||(t.createdAt=new Date().toISOString())),n.auth&&t.password,t}processRelationships(e,n,t){return e}parseSort(e){return e?e.startsWith("-")?{field:e.slice(1),direction:"desc"}:{field:e,direction:"asc"}:{field:"createdAt",direction:"desc"}}calculatePagination(e,n,t){let r=Math.ceil(t/n);return {totalDocs:t,limit:n,totalPages:r,page:e,pagingCounter:(e-1)*n+1,hasPrevPage:e>1,hasNextPage:e<r,prevPage:e>1?e-1:null,nextPage:e<r?e+1:null}}selectFields(e,n){if(!n||n.length===0)return e;let t={};for(let r of n)r in e&&(t[r]=e[r]);return t.id=e.id,t}isRelationshipField(e){return e.type==="relationship"}isUploadField(e){return e.type==="upload"}getRelationshipFields(e){let n=[];for(let t of e)t.type==="relationship"?n.push(t):"fields"in t&&t.fields&&n.push(...this.getRelationshipFields(t.fields));return n}getUploadFields(e){let n=[];for(let t of e)t.type==="upload"?n.push(t):"fields"in t&&t.fields&&n.push(...this.getUploadFields(t.fields));return n}};var s={tenantEnabled:true,tenantField:"tenantId",ownershipRules:{posts:{ownerField:"authorId",bypassRoles:["super_admin","admin","editor"]},pages:{ownerField:"authorId",bypassRoles:["super_admin","admin","editor"]},media:{ownerField:"uploadedBy",bypassRoles:["super_admin","admin","editor"]},orders:{ownerField:"customerId",bypassRoles:["super_admin","admin","editor"]},customers:{ownerField:"id",bypassRoles:["super_admin","admin"]},navigation:{ownerField:"id",bypassRoles:["super_admin","admin"]}}};function d(i,e,n=s){return !n.tenantEnabled||e.isSuperAdmin?i:{...i,where:{...i.where,[n.tenantField]:e.tenantId}}}function l(i,e,n,t=s){let r=t.ownershipRules[e];return !r||r.bypassRoles&&b({role:n.role},r.bypassRoles)?i:r.ownerField==="id"&&n.userId?{...i,where:{...i.where,id:n.userId}}:r.ownerField&&n.userId?{...i,where:{...i.where,[r.ownerField]:n.userId}}:i}function u(i,e,n,t=s){let r=i;return r=d(r,n,t),r=l(r,e,n,t),r}function p(i,e,n,t=s){if(n.isSuperAdmin)return true;if(t.tenantEnabled&&i[t.tenantField]!==n.tenantId)return false;let r=t.ownershipRules[e];return !r||r.bypassRoles&&b({role:n.role},r.bypassRoles)?true:r.ownerField==="id"?i.id===n.userId:r.ownerField?i[r.ownerField]===n.userId:true}export{a,s as b,u as c,p as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkEJDIR56C_cjs=require('./chunk-EJDIR56C.cjs'),crypto=require('crypto');var _=class extends chunkEJDIR56C_cjs.a{client;db;database;connectionString;constructor(i){if(super(),i.connectionString){this.connectionString=i.connectionString;try{let e=new URL(i.connectionString);this.database=e.pathname.replace(/^\//,"")||"kyro_cms";}catch{this.database="kyro_cms";}}else this.client=i.client,this.database=i.database;}async connect(){if(this.connectionString&&!this.client){let{MongoClient:i}=await import('mongodb');this.client=new i(this.connectionString),await this.client.connect();}this.db=this.client.db(this.database),this.connected=true;}async disconnect(){this.client&&(await this.client.close(),this.connected=false);}getMongoCollection(i){if(!this.db)throw new Error("MongoDB not connected");return this.db.collection(i)}async find(i){let{collection:e,where:n={},sort:s,limit:t=10,page:o=1,tenantId:r,select:a,draft:c}=i,u=this.getCollectionConfig(e),f=this.getMongoCollection(e),d={...n};this.tenantContext&&u.tenantScoped&&(d=chunkEJDIR56C_cjs.c({where:d},e,this.tenantContext,chunkEJDIR56C_cjs.b).where||{});let l=this.buildFilter(d,r),g=u.fields.find(h=>h.name==="status"),p=g?.type==="select"&&Array.isArray(g.options)&&g.options.some(h=>h.value==="published");!c&&p&&(l.status="published");let v=this.parseSort(s),R={[v.field]:v.direction==="asc"?1:-1},D=(o-1)*t,[$,x]=await Promise.all([f.find(l).sort(R).skip(D).limit(t).project(this.buildProjection(a)).toArray(),f.countDocuments(l)]),y=$.map(h=>this.processResult(h,u));return this.tenantContext&&!this.tenantContext.isSuperAdmin&&(y=y.filter(h=>chunkEJDIR56C_cjs.d(h,e,this.tenantContext,chunkEJDIR56C_cjs.b))),c&&(y=await Promise.all(y.map(async h=>{let A=await this.getMongoCollection(`${e}_versions`).findOne({document_id:h.id},{sort:{createdAt:-1}});if(A){let S=A.data||{};return {...h,...S,status:h.status}}return h}))),{docs:y,...this.calculatePagination(o,t,x)}}async findByID(i){let{collection:e,id:n,tenantId:s,draft:t}=i,o=this.getCollectionConfig(e),r=this.getMongoCollection(e);if(this.tenantContext&&o.tenantScoped){let l={_id:n,tenantId:this.tenantContext.tenantId};if(!chunkEJDIR56C_cjs.d(l,e,this.tenantContext,chunkEJDIR56C_cjs.b))return null}let a={_id:n};s&&(a.tenantId=s);let c=o.fields.find(l=>l.name==="status"),u=c?.type==="select"&&Array.isArray(c.options)&&c.options.some(l=>l.value==="published");!t&&u&&(a.status="published");let f=await r.findOne(a);if(!f)return null;let d=this.processResult(f,o);if(t){let g=await this.getMongoCollection(`${e}_versions`).findOne({document_id:d.id},{sort:{createdAt:-1}});if(g){let p=g.data||{};d={...d,...p,status:d.status};}}return d}async create(i){let{collection:e,data:n,tenantId:s}=i,t=this.getCollectionConfig(e),o=this.getMongoCollection(e),r={...this.prepareData(n,t),_id:this.generateId()};return s&&(r.tenantId=s),await o.insertOne(r),this.processResult(r,t)}async update(i){let{collection:e,id:n,data:s,tenantId:t}=i,o=this.getCollectionConfig(e),r=this.getMongoCollection(e),a={_id:n};t&&(a.tenantId=t);let c=this.prepareData(s,o),u=await r.findOneAndUpdate(a,{$set:c},{returnDocument:"after"});if(!u)throw new Error(`Document not found: ${e}/${n}`);return this.processResult(u,o)}async delete(i){let{collection:e,id:n,tenantId:s}=i,t=this.getCollectionConfig(e),o=this.getMongoCollection(e),r={_id:n};s&&(r.tenantId=s);let a=await o.findOneAndDelete(r);if(!a)throw new Error(`Document not found: ${e}/${n}`);return this.processResult(a,t)}async count(i){let{collection:e,where:n={},tenantId:s}=i,t=this.getMongoCollection(e),o=this.buildFilter(n,s);return t.countDocuments(o)}async findOne(i){let{collection:e,where:n={},tenantId:s,draft:t}=i,o=this.getCollectionConfig(e),r=this.getMongoCollection(e),a=this.buildFilter(n,s),c=o.fields.find(l=>l.name==="status"),u=c?.type==="select"&&Array.isArray(c.options)&&c.options.some(l=>l.value==="published");!t&&u&&(a.status="published");let f=await r.findOne(a);if(!f)return null;let d=this.processResult(f,o);if(t){let g=await this.getMongoCollection(`${e}_versions`).findOne({document_id:d.id},{sort:{createdAt:-1}});if(g){let p=g.data||{};d={...d,...p,status:d.status};}}return d}async findVersions(i){let{collection:e,documentId:n,sort:s,limit:t=10,page:o=1,tenantId:r}=i,a=this.getMongoCollection(`${e}_versions`),c={document_id:n,autosave:{$ne:true}};r&&(c.tenant_id=r);let u=(o-1)*t,f=this.parseSort(s),d={[f.field]:f.direction==="asc"?1:-1},[l,g]=await Promise.all([a.find(c).sort(d).skip(u).limit(t).toArray(),a.countDocuments(c)]);return {docs:l.map(p=>this.processResult(p,{})),...this.calculatePagination(o,t,g)}}async findVersionByID(i){let{collection:e,versionId:n,tenantId:s}=i,t=this.getMongoCollection(`${e}_versions`),o={_id:n};s&&(o.tenant_id=s);let r=await t.findOne(o);return r?this.processResult(r,{}):null}async createVersion(i){let{collection:e,documentId:n,data:s,status:t,createdBy:o,changeDescription:r,tenantId:a,autosave:c}=i,u=this.getMongoCollection(`${e}_versions`);if(c){let l={document_id:n,collection_slug:e,autosave:true};a&&(l.tenant_id=a);let g=await u.findOne(l);if(g){let p=new Date().toISOString();return await u.updateOne({_id:g._id},{$set:{data:s,status:t,updatedAt:p}}),this.processResult({...g,data:s,status:t,updatedAt:p},{})}}let f=new Date().toISOString(),d={_id:this.generateId(),document_id:n,collection_slug:e,tenant_id:a,data:s,status:t,autosave:c===true,created_by:o,change_description:r,createdAt:f,updatedAt:f};if(await u.insertOne(d),!c){let l=this.getCollectionConfig(e);l.versions?.maxPerDoc&&await this.deleteVersions({collection:e,documentId:n,keepLatest:l.versions.maxPerDoc,tenantId:a});}return this.processResult(d,{})}async updateLatestVersion(i){return this.createVersion({...i,autosave:true})}async deleteVersions(i){let{collection:e,documentId:n,keepLatest:s,tenantId:t}=i,o=this.getMongoCollection(`${e}_versions`);if(s){let r={document_id:n,autosave:{$ne:true}};t&&(r.tenant_id=t);let c=(await o.find(r).sort({createdAt:-1}).limit(s).project({_id:1}).toArray()).map(u=>u._id);c.length>0&&await o.deleteMany({document_id:n,autosave:{$ne:true},_id:{$nin:c},...t?{tenant_id:t}:{}});}else {let r={document_id:n};t&&(r.tenant_id=t),await o.deleteMany(r);}}async migrate(){for(let i of this.collections.values()){let e=this.getMongoCollection(i.slug);await e.createIndex({_id:1}),i.tenantScoped&&await e.createIndex({tenantId:1}),i.timestamps&&await e.createIndex({createdAt:-1});for(let n of i.fields)n.unique&&n.name&&await e.createIndex({[n.name]:1},{unique:true}),n.indexed&&n.name&&await e.createIndex({[n.name]:1});}}getCollectionConfig(i){let e=this.collections.get(i);if(!e)throw new Error(`Collection "${i}" not found`);return e}buildFilter(i={},e){let n={};e&&(n.tenantId=e);for(let[s,t]of Object.entries(i))if(s==="AND"&&Array.isArray(t)){let o=t.map(r=>this.buildFilter(r));Object.assign(n,...o);}else if(s==="OR"&&Array.isArray(t))n.$or=t.map(o=>this.buildFilter(o));else if(typeof t=="object"&&t!==null&&!Array.isArray(t)){let o={};if(t.equals!==void 0){n[s==="id"?"_id":s]=t.equals;continue}t.not_equals!==void 0&&(o.$ne=t.not_equals),t.in!==void 0&&(o.$in=t.in),t.not_in!==void 0&&(o.$nin=t.not_in),t.greater_than!==void 0&&(o.$gt=t.greater_than),t.greater_than_equal!==void 0&&(o.$gte=t.greater_than_equal),t.less_than!==void 0&&(o.$lt=t.less_than),t.less_than_equal!==void 0&&(o.$lte=t.less_than_equal),t.like!==void 0&&(o.$regex=new RegExp(t.like.replace(/%/g,".*"),"i")),t.not_like!==void 0&&(o.$not=new RegExp(t.not_like.replace(/%/g,".*"),"i")),t.contains!==void 0&&(o.$regex=new RegExp(`.*${t.contains}.*`,"i")),t.exists!==void 0&&(o.$exists=t.exists),Object.keys(o).length>0&&(n[s==="id"?"_id":s]=o);}else n[s==="id"?"_id":s]=t;return n}buildProjection(i){if(!i||i.length===0)return;let e={_id:1};for(let n of i)e[n]=1;return e}processResult(i,e){if(!i)return null;let n={...i};return i._id&&(n.id=i._id,delete n._id),delete n.__v,n.createdAt&&(n.createdAt=new Date(n.createdAt).toISOString()),n.updatedAt&&(n.updatedAt=new Date(n.updatedAt).toISOString()),n}generateId(){let i=Date.now().toString(16).padStart(12,"0"),e=crypto.randomBytes(6).toString("hex");return i+e}};function F(w){return new _(w)}
|
|
2
2
|
exports.a=_;exports.b=F;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var chunkNY47CFVP_cjs=require('./chunk-NY47CFVP.cjs'),chunkQ3Q7BJVQ_cjs=require('./chunk-Q3Q7BJVQ.cjs'),crypto=require('crypto');var x={COLLECTION_CREATE:"collection.create",COLLECTION_UPDATE:"collection.update",COLLECTION_DELETE:"collection.delete",MEDIA_UPLOAD:"media.upload",MEDIA_DELETE:"media.delete",AUTH_LOGIN:"auth.login",AUTH_REGISTER:"auth.register",AUTH_LOGOUT:"auth.logout",ORDER_CREATED:"order.created",ORDER_PAID:"order.paid",ORDER_SHIPPED:"order.shipped",ORDER_DELIVERED:"order.delivered"},N=Object.values(x);var g="_webhooks",k="_webhook_deliveries";async function p(r,o,n,e={}){let t=e.timeout||3e4,i=Date.now(),c=new AbortController,a=setTimeout(()=>c.abort(),t);try{let s=await fetch(r,{method:"POST",headers:o,body:n,signal:c.signal});clearTimeout(a);let l=Date.now()-i,u;try{u=(await s.text()).slice(0,1e3);}catch{}let d={success:s.ok,status:s.status,statusText:s.statusText,body:u,duration:l};return d.success&&e.onSuccess?e.onSuccess(d):!d.success&&e.onFailure&&e.onFailure(`HTTP ${s.status}: ${s.statusText}`),d}catch(s){clearTimeout(a);let l=Date.now()-i,u=s.name==="AbortError"?`Request timed out after ${t}ms`:s.message||"Unknown error";return e.onFailure&&e.onFailure(u),{success:false,status:0,duration:l,error:u}}}async function I(r,o,n={}){let e=JSON.stringify(o),t={"Content-Type":"application/json","User-Agent":"Kyro-CMS-Webhook/1.0","X-Webhook-Event":o.event,"X-Webhook-Delivery":o.id,"X-Webhook-Timestamp":o.timestamp,...r.headers||{}};return r.secret&&(t["X-Webhook-Signature"]=R(e,r.secret)),p(r.url,t,e,n)}async function _(r,o,n={}){let e=r.config||{},t=process.env.GITHUB_TOKEN;if(!t)return {success:false,status:0,duration:0,error:"GITHUB_TOKEN environment variable is not set"};if(!e.githubOwner||!e.githubRepo)return {success:false,status:0,duration:0,error:"GitHub owner and repo are required"};let i=e.githubEventType||"kyro-cms-content-update",c=`https://api.github.com/repos/${e.githubOwner}/${e.githubRepo}/dispatches`,a=JSON.stringify({event_type:i,client_payload:{event:o.event,collection:o.collection,operation:o.operation,documentId:o.id,timestamp:o.timestamp,user:o.user}}),s={"Content-Type":"application/json",Accept:"application/vnd.github+json",Authorization:`Bearer ${t}`,"X-GitHub-Api-Version":"2022-11-28","User-Agent":"Kyro-CMS-Webhook/1.0"};return p(c,s,a,n)}async function j(r,o,n={}){let e=r.config||{},t=process.env.DOKPLOY_TOKEN;if(!t)return {success:false,status:0,duration:0,error:"DOKPLOY_TOKEN environment variable is not set"};if(!e.dokployProjectId)return {success:false,status:0,duration:0,error:"Dokploy project ID is required"};let i=process.env.DOKPLOY_HOST||r.url,c=e.dokployBranch||"main",a=i.endsWith("/")?`${i}api/deploy/${e.dokployProjectId}`:`${i}/api/deploy/${e.dokployProjectId}`,s=JSON.stringify({branch:c,force:true}),l={"Content-Type":"application/json",Authorization:`Bearer ${t}`,"User-Agent":"Kyro-CMS-Webhook/1.0"};return p(a,l,s,n)}async function H(r,o,n={}){let e=r.config||{},t=process.env.COOLIFY_TOKEN;if(!t)return {success:false,status:0,duration:0,error:"COOLIFY_TOKEN environment variable is not set"};if(!e.coolifyProjectUuid)return {success:false,status:0,duration:0,error:"Coolify project UUID is required"};let i=process.env.COOLIFY_HOST||r.url,c=e.coolifyEnvironmentName||"production",a=i.endsWith("/")?`${i}api/v1/deploy`:`${i}/api/v1/deploy`,s=JSON.stringify({uuid:e.coolifyProjectUuid,environment:c}),l={"Content-Type":"application/json",Authorization:`Bearer ${t}`,Accept:"application/json","User-Agent":"Kyro-CMS-Webhook/1.0"};return p(a,l,s,n)}var B={generic:I,"github-dispatch":_,"dokploy-deploy":j,"coolify-deploy":H};function E(r){return B[r||"generic"]||B.generic}function R(r,o){return `sha256=${crypto.createHmac("sha256",o).update(r).digest("hex")}`}function w(){return crypto.randomBytes(32).toString("hex")}async function L(r,o,n={}){return E(r.action)(r,o,n)}async function C(r,o,n,e={}){let t=e.maxRetries??5,i=e.retryDelay??1e3,c=null;for(let a=0;a<=t;a++){if(a>0){let s=Math.min(i*Math.pow(2,a-1),3e4);e.onRetry&&e.onRetry(a,`Retrying in ${s}ms...`),await q(s);}if(e.onRetry&&a>0&&e.onRetry(a,`Attempt ${a+1}/${t+1}`),c=await L(r,o,{...e,onRetry:void 0,onSuccess:void 0,onFailure:void 0}),c.success)return c;if(!(c.error?.includes("timed out")&&a<t)&&c.status>=400&&c.status<500)return c}return c||{success:false,status:0,duration:0,error:"All delivery attempts failed"}}function P(r,o,n,e,t,i){return {id:r,webhookId:o,event:n,payload:e,attempt:t,status:i.success?"success":"failed",responseStatus:i.status||void 0,responseBody:i.body,duration:i.duration,error:i.error,createdAt:new Date().toISOString(),deliveredAt:i.success?new Date().toISOString():void 0}}function q(r){return new Promise(o=>setTimeout(o,r))}function G(){return {id:`test_${Date.now()}`,event:"collection.create",timestamp:new Date().toISOString(),collection:"test",operation:"create",data:{message:"This is a test webhook delivery"},user:{id:"system",email:"system@kyro.dev",role:"super_admin"}}}function K(r){let o=new Set,n=[];for(let e of r){let t=e==="create"||e==="update"||e==="delete"?`collection.${e}`:e;o.has(t)||(o.add(t),n.push(t));}return n}var A=class{db;constructor(o){this.db=o;}async getWebhooks(o){let e=(await this.db.find({collection:g,where:o?.status?{status:{equals:o.status}}:{},limit:100,page:1,draft:true})).docs;return o?.event?e.filter(t=>t.events.includes(o.event)):e}async getWebhookById(o){return this.db.findByID({collection:g,id:o,draft:true})}async createWebhook(o){let n=new Date().toISOString(),e=o.secret||w(),t={id:crypto.randomUUID(),name:o.name,url:o.url,events:K(o.events),collections:o.collections||[],status:o.status||"active",secret:e,headers:o.headers||{},action:o.action||"generic",config:o.config||{},createdAt:n,updatedAt:n};return await this.db.create({collection:g,data:t}),t}async updateWebhook(o,n){let e=await this.getWebhookById(o);if(!e)return null;let t={...e,...n,events:n.events?K(n.events):e.events,collections:n.collections!==void 0?n.collections:e.collections,action:n.action!==void 0?n.action:e.action,config:n.config!==void 0?{...e.config,...n.config}:e.config,updatedAt:new Date().toISOString()};return n.secret===""&&"secret"in n&&delete t.secret,await this.db.update({collection:g,id:o,data:t}),t}async deleteWebhook(o){await this.db.delete({collection:g,id:o});}async trigger(o,n){let e=await this.getWebhooks({status:"active",event:o}),t=n.collection,i=e.filter(s=>!s.collections||s.collections.length===0||!t?true:s.collections.includes(t));if(i.length===0)return [];let c={id:`wh_${Date.now()}_${crypto.randomUUID().slice(0,8)}`,event:o,timestamp:new Date().toISOString(),...n},a=[];for(let s of i){let l=await this.triggerWebhook(s,c);a.push(l);}return a}async triggerWebhook(o,n){let e=`dlv_${Date.now()}_${crypto.randomUUID().slice(0,8)}`;try{let t=await C(o,n,e,{maxRetries:5,retryDelay:1e3}),i=P(e,o.id,o.events[0],n,1,t);try{await this.db.create({collection:k,data:i});}catch{console.warn("[WebhookService] Failed to save delivery record:",e);}return t.success?await this.updateWebhook(o.id,{status:"active",lastTriggered:new Date().toISOString()}).catch(()=>{}):await this.updateWebhook(o.id,{status:"error",lastError:t.error}).catch(()=>{}),{deliveryId:e,webhookId:o.id,event:o.events[0],status:t.success?"success":"failed",responseStatus:t.status,duration:t.duration,error:t.error}}catch(t){return {deliveryId:e,webhookId:o.id,event:o.events[0],status:"failed",error:t.message}}}async testWebhook(o){let n=await this.getWebhookById(o);if(!n)return null;let e={id:`test_${Date.now()}`,event:n.events[0]||"collection.create",timestamp:new Date().toISOString(),collection:"test",operation:"create",data:{message:"This is a test webhook delivery from Kyro CMS"},user:{id:"system",email:"system@kyro.dev",role:"super_admin"}};return this.triggerWebhook(n,e)}async getDeliveryHistory(o,n=50){return (await this.db.find({collection:k,where:{webhookId:{equals:o}},sort:"-createdAt",limit:n,page:1})).docs}async retryDelivery(o){let n=await this.db.findByID({collection:k,id:o});if(!n)return null;let e=await this.getWebhookById(n.webhookId);return e?this.triggerWebhook(e,n.payload):null}};function V(r){return new A(r)}function F(r){if(!r)return [];if(typeof r=="string")return [{id:r}];if(Array.isArray(r))return r.map(o=>typeof o=="object"?{id:o.value??o.id??o,relationTo:o.relationTo}:{id:o});if(typeof r=="object"){let o=r.value??r.id??r;if(typeof o=="string")return [{id:o,relationTo:r.relationTo}];if(Array.isArray(o))return o.map(n=>({id:n,relationTo:r.relationTo}))}return []}function W(r,o,n){if(!(!r||typeof r!="object")){for(let e of o)if(!(!e.name&&e.type!=="row"&&e.type!=="collapsible"&&e.type!=="tabs")){if(e.type==="relationship"||e.type==="upload"){let t=r[e.name];if(!t)continue;let i=Array.isArray(e.relationTo)?e.relationTo:[e.relationTo],c=F(t);for(let a of c){if(!a.id)continue;let s=a.relationTo?[a.relationTo]:i;for(let l of s)l!=="*"&&(n.has(l)||n.set(l,new Set),n.get(l).add(a.id));}}else if(e.type==="group"||e.type==="collapsible"||e.type==="row"){let t=e.name?r[e.name]:r;W(t,e.fields||[],n);}else if(e.type==="tabs"&&e.tabs){let t=e.name?r[e.name]:r;for(let i of e.tabs)W(t,i.fields||[],n);}else if(e.type==="array"&&e.name&&Array.isArray(r[e.name]))for(let t of r[e.name])W(t,e.fields||[],n);else if(e.type==="blocks"&&e.name&&Array.isArray(r[e.name]))for(let t of r[e.name]){if(!t||typeof t!="object")continue;let i=t.type||t.blockType;if(!i)continue;let c=e.blocks?.find(a=>a.slug===i);if(c&&Array.isArray(c.fields)){let a=t.data&&typeof t.data=="object"?t.data:t;W(a,c.fields,n);}}}}}function v(r,o,n){if(!(!r||typeof r!="object")){for(let e of o)if(!(!e.name&&e.type!=="row"&&e.type!=="collapsible"&&e.type!=="tabs")){if(e.type==="relationship"||e.type==="upload"){let t=r[e.name];if(!t)continue;let i=Array.isArray(e.relationTo)?e.relationTo:[e.relationTo],c=s=>{r[e.name]=s;},a=(s,l)=>{let u=l?[l]:i;for(let d of u){let y=n.get(d);if(y&&y.has(s))return y.get(s)}return null};if(typeof t=="string"){let s=a(t);c(s||{id:t});}else if(Array.isArray(t))c(t.map(s=>{let l=typeof s=="object"?s.value??s.id:s,u=typeof s=="object"?s.relationTo:void 0,d=a(l,u);return d||{id:l}}));else if(typeof t=="object"){let s=t.value??t.id,l=t.relationTo,u=a(s,l);c(u||{id:s});}}else if(e.type==="group"||e.type==="collapsible"||e.type==="row"){let t=e.name?r[e.name]:r;v(t,e.fields||[],n);}else if(e.type==="tabs"&&e.tabs){let t=e.name?r[e.name]:r;for(let i of e.tabs)v(t,i.fields||[],n);}else if(e.type==="array"&&e.name&&Array.isArray(r[e.name]))for(let t of r[e.name])v(t,e.fields||[],n);else if(e.type==="blocks"&&e.name&&Array.isArray(r[e.name]))for(let t of r[e.name]){if(!t||typeof t!="object")continue;let i=t.type||t.blockType;if(!i)continue;let c=e.blocks?.find(a=>a.slug===i);if(c&&Array.isArray(c.fields)){let a=t.data&&typeof t.data=="object"?t.data:t;v(a,c.fields,n);}}}}}async function Y(r,o,n,e,t=1,i=0){if(!r||r.length===0||t>i)return;let c=new Map;for(let l of r)W(l,o,c);if(c.size===0)return;let a=new Map,s=new Map;for(let[l,u]of c.entries()){if(u.size===0||!e.getCollection(l))continue;let y=new Map,b=Array.from(u),f=[];for(let D of b)try{let m=await n.findByID({collection:l,id:D,draft:!0});m&&(y.set(D,m),f.push(m));}catch{}a.set(l,y),f.length>0&&s.set(l,f);}if(t<i)for(let[l,u]of s.entries()){let d=e.getCollection(l);d&&await Y(u,d.fields,n,e,t+1,i);}for(let l of r)v(l,o,a);}function $(r){return r==="read"?"read":r==="create"?"create":r==="update"?"update":"delete"}function z(r,o){return {none:false,read:r==="read",create:r==="read"||r==="create",update:r==="read"||r==="create"||r==="update",delete:r==="read"||r==="create"||r==="update"||r==="delete",admin:true}[o]||false}async function Ce(r,o,n,e={}){let{user:t,req:i,tenantId:c,apiKey:a}=n,{enablePublicAccess:s=true,defaultAccess:l="none"}=e,u=r.access?.[o];if(u){let y=await chunkNY47CFVP_cjs.a(u,{req:i,user:t,tenantId:c});return y===false?{allowed:false,error:"Access denied",status:403}:typeof y=="object"?{allowed:true,extraWhere:y}:{allowed:true}}if(a?.permissions?.length>0){let y=r.slug,b=$(o),f=`${y}:${b}`;return !chunkNY47CFVP_cjs.h(a.permissions,f)&&!chunkNY47CFVP_cjs.h(a.permissions,`${y}:admin`)?{allowed:false,error:"Access denied: insufficient permissions",status:403}:{allowed:true}}if(t){let y=r.slug,b=$(o),f=`${y}:${b}`,D=chunkQ3Q7BJVQ_cjs.a({id:t.id,email:t.email,role:t.role},f),m=chunkQ3Q7BJVQ_cjs.a({id:t.id,email:t.email,role:t.role},`${y}:admin`);return D||m?{allowed:true}:{allowed:false,error:"Access denied: missing RBAC permission",status:403}}let d=z(o,l);return s&&d?{allowed:true}:{allowed:false,error:"Authentication required",status:401}}async function Pe(r,o,n,e={}){let{user:t,req:i,tenantId:c}=n,{enablePublicAccess:a=true}=e,s=r.access?.[o];if(s)return await chunkNY47CFVP_cjs.a(s,{req:i,user:t,tenantId:c})===false?{allowed:false,error:"Access denied",status:403}:{allowed:true};if(t){let l=`globals:${o}`,u=chunkQ3Q7BJVQ_cjs.a({id:t.id,email:t.email,role:t.role},l),d=chunkQ3Q7BJVQ_cjs.a({id:t.id,email:t.email,role:t.role},"globals:admin");return u||d?{allowed:true}:{allowed:false,error:"Access denied: missing RBAC permission",status:403}}return a?{allowed:true}:{allowed:false,error:"Authentication required",status:401}}
|
|
2
|
+
exports.a=Y;exports.b=Ce;exports.c=Pe;exports.d=x;exports.e=N;exports.f=g;exports.g=k;exports.h=R;exports.i=w;exports.j=L;exports.k=C;exports.l=P;exports.m=G;exports.n=A;exports.o=V;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {a as a$1}from'./chunk-NZ35PV5R.js';import {a}from'./chunk-5SEHX7ON.js';import {a as a$3,i}from'./chunk-5BPMMIAQ.js';import {c as c$1,a as a$2}from'./chunk-PP7W5UKL.js';import {f,s,a as a$5,b as b$2,c as c$3}from'./chunk-QMPMY2WI.js';import {o,f as f$1,g as g$1}from'./chunk-KG7V6O2Z.js';import {d,f as f$2,e,g as g$2}from'./chunk-HLSB2MCK.js';import {b,d as d$1}from'./chunk-GKYEJ2UF.js';import {c}from'./chunk-76RLJA6S.js';import {g}from'./chunk-OG7CNQGU.js';import {a as a$4,c as c$2,b as b$1,d as d$2}from'./chunk-TQNM4C7H.js';import {z as z$1}from'zod';import {createYoga}from'graphql-yoga';import {createRequire}from'module';import {randomBytes}from'crypto';function O(s,e){for(let t of s){if(t.name===e)return true;if("tabs"in t&&t.tabs){for(let n of t.tabs)if(O(n.fields,e))return true}if("fields"in t&&t.fields&&O(t.fields,e))return true}return false}var K=class extends Error{errors;constructor(e){super(`Configuration validation failed:
|
|
2
|
+
${e.join(`
|
|
3
|
+
`)}`),this.name="ConfigValidationError",this.errors=e;}};function V(s){let e=[];if(s.slug?/^[a-z][a-z0-9_-]*$/.test(s.slug)||e.push(`Collection slug "${s.slug}" must be lowercase alphanumeric with dashes`):e.push('Collection is missing a "slug" property'),!s.fields||s.fields.length===0)e.push(`Collection "${s.slug}" has no fields defined`);else {let t=N(s.fields,s.slug);e.push(...t);}if(s.access)for(let[t,n]of Object.entries(s.access))typeof n!="boolean"&&typeof n!="function"&&e.push(`Collection "${s.slug}" has invalid access.${t} (must be boolean or function)`);if(s.admin?.useAsTitle&&(O(s.fields,s.admin.useAsTitle)||e.push(`Collection "${s.slug}" admin.useAsTitle references unknown field "${s.admin.useAsTitle}"`)),s.admin?.defaultColumns)for(let t of s.admin.defaultColumns)O(s.fields,t)||e.push(`Collection "${s.slug}" admin.defaultColumns references unknown field "${t}"`);if(s.upload&&s.upload.fileSize&&s.upload.fileSize<=0&&e.push(`Collection "${s.slug}" upload.fileSize must be positive`),s.versions&&s.versions.maxPerDoc&&s.versions.maxPerDoc<=0&&e.push(`Collection "${s.slug}" versions.maxPerDoc must be positive`),s.auth){let t=s.fields.some(a=>a.name==="email"),n=s.fields.some(a=>a.name==="password");t||e.push(`Collection "${s.slug}" with auth enabled requires an "email" field`),n||e.push(`Collection "${s.slug}" with auth enabled requires a "password" field`);}return e}function B(s){let e=[];if(s.slug?/^[a-z][a-z0-9_-]*$/.test(s.slug)||e.push(`Global slug "${s.slug}" must be lowercase alphanumeric with dashes`):e.push('Global is missing a "slug" property'),!s.fields||s.fields.length===0)e.push(`Global "${s.slug}" has no fields defined`);else {let t=N(s.fields,`global:${s.slug}`);e.push(...t);}return e}function N(s,e){let t=[],n=new Set;for(let a=0;a<s.length;a++){let i=s[a];if(i.type==="row"||i.type==="collapsible"||i.type==="tabs"){if("fields"in i&&i.fields){let r=N(i.fields,e);t.push(...r);}else if("tabs"in i)for(let r of i.tabs){let c=N(r.fields,e);t.push(...c);}continue}let o=i.name;if(!o){t.push(`${e}: Field at index ${a} is missing a "name" property`);continue}if(n.has(o)&&t.push(`${e}: Duplicate field name "${o}"`),n.add(o),/^[a-zA-Z][a-zA-Z0-9_]*$/.test(o)||t.push(`${e}: Field name "${o}" must be alphanumeric with underscores`),!i.type){t.push(`${e}: Field "${o}" is missing a "type" property`);continue}switch(i.type){case "relationship":i.relationTo||t.push(`${e}: Relationship field "${o}" is missing "relationTo"`);break;case "array":if(!i.fields||i.fields.length===0)t.push(`${e}: Array field "${o}" has no fields defined`);else {let r=N(i.fields,`${e}.${o}`);t.push(...r);}break;case "group":if(!i.fields||i.fields.length===0)t.push(`${e}: Group field "${o}" has no fields defined`);else {let r=N(i.fields,`${e}.${o}`);t.push(...r);}break;case "blocks":if(!i.blocks||i.blocks.length===0)t.push(`${e}: Blocks field "${o}" has no blocks defined`);else {let r=Ie(i.blocks,`${e}.${o}`);t.push(...r);}break;case "select":case "radio":if(typeof i.options=="function")break;if((!i.options||i.options.length===0)&&!i.dynamicOptions)t.push(`${e}: ${i.type} field "${o}" has no options defined`);else if(Array.isArray(i.options)){let r=i.options.map(d=>d.value),c=new Set(r);r.length!==c.size&&t.push(`${e}: ${i.type} field "${o}" has duplicate option values`);}break;case "upload":i.relationTo||t.push(`${e}: Upload field "${o}" is missing "relationTo"`);break}"min"in i&&"max"in i&&i.min>i.max&&t.push(`${e}: Field "${o}" has min greater than max`),"minLength"in i&&"maxLength"in i&&i.minLength>i.maxLength&&t.push(`${e}: Field "${o}" has minLength greater than maxLength`),"minRows"in i&&"maxRows"in i&&i.minRows>i.maxRows&&t.push(`${e}: Field "${o}" has minRows greater than maxRows`);}return t}function Ie(s,e){let t=[],n=new Set;for(let a of s){if(!a.slug){t.push(`${e}: Block is missing a "slug" property`);continue}if(n.has(a.slug)&&t.push(`${e}: Duplicate block slug "${a.slug}"`),n.add(a.slug),a.label||t.push(`${e}: Block "${a.slug}" is missing a "label" property`),!a.fields||a.fields.length===0)t.push(`${e}: Block "${a.slug}" has no fields defined`);else {let i=N(a.fields,`${e}.${a.slug}`);t.push(...i);}}return t}function fe(s,e=[]){let t=[],n=new Set;for(let a of s)n.has(a.slug)&&t.push(`Duplicate collection slug "${a.slug}"`),n.add(a.slug);for(let a of e)n.has(a.slug)&&t.push(`Duplicate global slug "${a.slug}"`),n.add(a.slug);for(let a of s){let i=V(a);t.push(...i);}for(let a of e){let i=B(a);t.push(...i);}for(let a of s){let i=$(a.fields,s);t.push(...i);}if(t.length>0)throw new K(t)}function $(s,e){let t=[],n=new Set(e.map(a=>a.slug));for(let a of s){if(a.type==="relationship"){let i=Array.isArray(a.relationTo)?a.relationTo:[a.relationTo];for(let o of i)n.has(o)||console.warn(`[Kyro Config Warning]: Relationship field "${a.name}" references unknown collection "${o}". Select options will not be available until this collection is registered.`);}if(a.type==="upload"){let i=Array.isArray(a.relationTo)?a.relationTo:[a.relationTo];for(let o of i)n.has(o)||t.push(`Upload field "${a.name}" references unknown collection "${o}"`);}if("fields"in a&&a.fields){let i=$(a.fields,e);t.push(...i);}if("tabs"in a)for(let i of a.tabs){let o=$(i.fields,e);t.push(...o);}if("blocks"in a)for(let i of a.blocks){let o=$(i.fields,e);t.push(...o);}}return t}function C(s){switch(s.type){case "text":return $e(s);case "number":return Oe(s);case "checkbox":return Pe(s);case "date":return Le(s);case "email":return ke(s);case "password":return _e(s);case "textarea":return je(s);case "select":return Ze(s);case "radio":return qe(s);case "color":return Ue(s);case "richtext":return Ge(s);case "json":return Ke(s);case "code":return Ve(s);case "upload":return ye(s);case "image":return ye(s);case "markdown":return Be(s);case "relationship":return he(s);case "relationship-block":return he(s);case "array":return Me(s);case "list":return ze(s);case "group":return We(s);case "blocks":return Xe(s);case "row":return Je(s);case "collapsible":return He(s);case "tabs":return Ye(s);default:return z$1.any()}}function $e(s){let e=z$1.string();return s.minLength&&(e=e.min(s.minLength)),s.maxLength&&(e=e.max(s.maxLength)),s.pattern&&(e=e.regex(new RegExp(s.pattern))),s.variant==="email"&&(e=e.email()),s.variant==="url"&&(e=e.url()),s.hasMany&&(e=z$1.array(e)),s.required||(e=e.optional().nullable()),s.validate&&(e=T(e,s.validate)),e}function Oe(s){let e=s.integer?z$1.coerce.number().int():z$1.coerce.number();return s.min!==void 0&&(e=e.min(s.min)),s.max!==void 0&&(e=e.max(s.max)),s.step&&(e=e.refine(t=>Number.isInteger(t/s.step),`Value must be divisible by ${s.step}`)),s.hasMany&&(e=z$1.array(e)),s.required||(e=e.optional().nullable()),s.validate&&(e=T(e,s.validate)),e}function Pe(s){let e=z$1.boolean();return s.required||(e=e.optional().nullable()),s.validate&&(e=T(e,s.validate)),e}function Le(s){let e=z$1.string().refine(t=>!isNaN(Date.parse(t)),"Invalid date format");return s.minDate&&(e=e.refine(t=>new Date(t)>=new Date(s.minDate),`Date must be after ${s.minDate}`)),s.maxDate&&(e=e.refine(t=>new Date(t)<=new Date(s.maxDate),`Date must be before ${s.maxDate}`)),s.required||(e=e.optional().nullable()),s.validate&&(e=T(e,s.validate)),e}function ke(s){let e=z$1.string().email("Invalid email");return s.required||(e=e.optional().nullable()),s.validate&&(e=T(e,s.validate)),e}function _e(s){let e=z$1.string().min(6,"Password must be at least 6 characters");return s.required||(e=e.optional().nullable()),s.validate&&(e=T(e,s.validate)),e}function je(s){let e=z$1.string();return s.minLength&&(e=e.min(s.minLength)),s.maxLength&&(e=e.max(s.maxLength)),s.required||(e=e.optional().nullable()),s.validate&&(e=T(e,s.validate)),e}function Ze(s){let e;if(Array.isArray(s.options)&&s.options.length>0){let t=s.options.map(n=>n.value);s.hasMany?e=z$1.array(z$1.enum(t)):e=z$1.enum(t);}else e=s.hasMany?z$1.array(z$1.string()):z$1.string();return s.required||(e=e.optional().nullable()),s.validate&&(e=T(e,s.validate)),e}function qe(s){let e;if(Array.isArray(s.options)&&s.options.length>0){let t=s.options.map(n=>n.value);e=z$1.enum(t);}else e=z$1.string();return s.required||(e=e.optional().nullable()),s.validate&&(e=T(e,s.validate)),e}function Ue(s){let e=z$1.string();return s.format==="hex"&&(e=e.regex(/^#[0-9A-Fa-f]{6}$/)),s.format==="rgb"&&(e=e.regex(/^rgb\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*\)$/)),s.format==="hsl"&&(e=e.regex(/^hsl\(\s*\d{1,3}\s*,\s*\d{1,3}%\s*,\s*\d{1,3}%\s*\)$/)),s.required||(e=e.optional().nullable()),s.validate&&(e=T(e,s.validate)),e}function Ge(s){let e=z$1.array(z$1.record(z$1.any()));return s.required||(e=e.optional().nullable()),s.validate&&(e=T(e,s.validate)),e}function Ke(s){let e=z$1.union([z$1.record(z$1.any()),z$1.array(z$1.any())]);return s.required||(e=e.optional().nullable()),s.validate&&(e=T(e,s.validate)),e}function Ve(s){let e=z$1.string();return s.required||(e=e.optional().nullable()),s.validate&&(e=T(e,s.validate)),e}function ye(s){let e;if(s.relationTo){let t=z$1.object({id:z$1.string(),url:z$1.string().optional(),filename:z$1.string().optional(),mimeType:z$1.string().optional()});e=z$1.union([z$1.string(),t]);}else e=z$1.string();return s.hasMany&&(e=z$1.array(e)),s.required||(e=e.optional().nullable()),s.validate&&(e=T(e,s.validate)),e}function Be(s){let e=z$1.string();return s.required||(e=e.optional().nullable()),s.validate&&(e=T(e,s.validate)),e}function he(s){let e;return Array.isArray(s.relationTo)?e=z$1.object({relationTo:z$1.enum(s.relationTo),value:z$1.string()}):e=z$1.union([z$1.string(),z$1.object({relationTo:z$1.string(),value:z$1.string()})]),s.hasMany&&(e=z$1.array(e)),s.required||(e=e.optional().nullable()),s.validate&&(e=T(e,s.validate)),e}function Me(s){let e=z$1.object(Object.fromEntries(s.fields.filter(n=>n.name).map(n=>[n.name,C(n)]))).passthrough(),t=z$1.array(e);return s.minRows&&(t=t.min(s.minRows)),s.maxRows&&(t=t.max(s.maxRows)),s.required||(t=t.optional().nullable()),s.validate&&(t=T(t,s.validate)),t}function ze(s){let e=z$1.array(z$1.string());return s.required||(e=e.optional().nullable()),e}function We(s){let e=z$1.object(Object.fromEntries(s.fields.filter(t=>t.name).map(t=>[t.name,C(t)])));return s.required?e:e.optional().nullable()}function Xe(s){let e=s.blocks||[];e.map(i=>z$1.object({blockType:z$1.literal(i.slug),...Object.fromEntries(i.fields.filter(o=>o.name).map(o=>[o.name,C(o)]))}));let n=e.map(i=>i.slug),a;if(n.length>0){let i=z$1.object({blockType:z$1.enum(n)}).catchall(z$1.any()),o=z$1.object({blockType:z$1.string()}).catchall(z$1.any());a=z$1.array(z$1.union([i,o,z$1.record(z$1.any())]));}else a=z$1.array(z$1.union([z$1.object({blockType:z$1.string()}).catchall(z$1.any()),z$1.record(z$1.any())]));return s.minRows&&(a=a.min(s.minRows)),s.maxRows&&(a=a.max(s.maxRows)),s.required||(a=a.optional().nullable()),s.validate&&(a=T(a,s.validate)),a}function Je(s){return z$1.object(Object.fromEntries(s.fields.filter(t=>t.name).map(t=>[t.name,C(t)])))}function He(s){return z$1.object(Object.fromEntries(s.fields.filter(t=>t.name).map(t=>[t.name,C(t)])))}function Ye(s){let e={};for(let t of s.tabs)for(let n of t.fields)n.name&&(e[n.name]=C(n));return z$1.object(e).passthrough().optional()}function T(s,e){return s.refine(async t=>await e(t,{required:false})===true,{message:"Custom validation failed"})}function R(s){let e={};for(let t of s)if(t.name)if(t.type==="tabs"&&"tabs"in t){let n={};for(let a of t.tabs){let i=R(a.fields);Object.assign(n,i);}e[t.name]=z$1.object(n).passthrough().optional();}else if(t.type==="row"&&"fields"in t){let n=R(t.fields);Object.assign(e,n);}else t.type==="collapsible"&&"fields"in t?e[t.name]=z$1.object(R(t.fields)).passthrough().optional():e[t.name]=C(t);return e}function E(s){let e={};for(let t of s)if(t.name)if(t.type==="tabs"&&"tabs"in t){let n={};for(let a of t.tabs){let i=E(a.fields);Object.assign(n,i);}e[t.name]=z$1.object(n).passthrough().optional().nullable();}else if(t.type==="row"&&"fields"in t){let n=E(t.fields);Object.assign(e,n);}else t.type==="collapsible"&&"fields"in t?e[t.name]=z$1.object(E(t.fields)).passthrough().optional().nullable():t.type==="group"&&"fields"in t?e[t.name]=z$1.object(E(t.fields)).passthrough().optional().nullable():e[t.name]=C(t).optional().nullable();return e}function ge(s){let e=R(s.fields);return s.timestamps&&(e.createdAt=z$1.string().optional(),e.updatedAt=z$1.string().optional()),s.tenantScoped&&(e.tenantId=z$1.string().optional()),e.id=z$1.string().optional(),z$1.object(e).passthrough()}function me(s){let e=R(s.fields);return z$1.object(e).passthrough()}function be(s){let e={};for(let t of s.fields)if(t.name)if(t.type==="tabs"&&"tabs"in t){let n={};for(let a of t.tabs)for(let i of a.fields)i.name&&(n[i.name]=C(i).optional().nullable());e[t.name]=z$1.object(n).optional().nullable();}else if(t.type==="row"&&"fields"in t){let n={};for(let a of t.fields)a.name&&(n[a.name]=C(a).optional().nullable());Object.assign(e,n);}else t.type==="collapsible"&&"fields"in t?e[t.name]=z$1.object(E(t.fields)).optional().nullable():t.type==="group"&&"fields"in t?e[t.name]=z$1.object(E(t.fields)).optional().nullable():e[t.name]=C(t).optional().nullable();return z$1.object(e).passthrough()}function Te(s){let e={};for(let t of s.fields)t.name&&(e[t.name]=z$1.object({equals:z$1.any().optional(),not_equals:z$1.any().optional(),in:z$1.array(z$1.any()).optional(),not_in:z$1.array(z$1.any()).optional(),greater_than:z$1.number().optional(),greater_than_equal:z$1.number().optional(),less_than:z$1.number().optional(),less_than_equal:z$1.number().optional(),like:z$1.string().optional(),not_like:z$1.string().optional(),contains:z$1.string().optional(),exists:z$1.boolean().optional()}).optional());return e.AND=z$1.array(z$1.lazy(()=>z$1.object(e))).optional(),e.OR=z$1.array(z$1.lazy(()=>z$1.object(e))).optional(),z$1.object(e).optional()}function Ae(s){let e=R(s.fields);return e.id=z$1.string().optional(),z$1.object(e).passthrough()}function Ce(s){let e={};for(let t of s.fields)if(t.name)if(t.type==="tabs"&&"tabs"in t){let n={};for(let a of t.tabs)for(let i of a.fields)i.name&&(n[i.name]=C(i).optional().nullable());e[t.name]=z$1.object(n).optional().nullable();}else t.type==="collapsible"&&"fields"in t?e[t.name]=z$1.object(E(t.fields)).optional().nullable():t.type==="group"&&"fields"in t?e[t.name]=z$1.object(E(t.fields)).optional().nullable():e[t.name]=C(t).optional().nullable();return z$1.object(e).passthrough()}var D=class{storageProviders=f();collections=new Map;globals=new Map;plugins=[];schemaCache=new Map;initialized=false;addCollection(e){if(this.initialized)throw new Error("Cannot add collections after Registry has been initialized");if(this.collections.has(e.slug)){console.warn(`[Registry] Duplicate collection slug "${e.slug}" \u2014 skipping`);return}let t={...e};for(let a of this.plugins)a.extendCollection&&(t=a.extendCollection(t.slug,t));if(t.seo){let a$1=a(),i=t.fields.find(o=>o.type==="tabs"&&o.name==="tabs");i&&i.tabs?i.tabs.push({label:"SEO Settings",fields:a$1.fields}):t.fields.push(a$1);}t.fields=this.applyFieldDefaults(t);let n=V(t);if(n.length>0)throw new Error(`Invalid collection config: ${n.join(", ")}`);this.collections.set(t.slug,t),this.clearSchemaCache(t.slug);}addCollections(e){for(let t of e)this.addCollection(t);}getCollection(e){return this.collections.get(e)}getCollections(){return Array.from(this.collections.values())}getCollectionSlugs(){return Array.from(this.collections.keys())}hasCollection(e){return this.collections.has(e)}removeCollection(e){if(this.initialized)throw new Error("Cannot remove collections after Registry has been initialized");return this.clearSchemaCache(e),this.collections.delete(e)}addGlobal(e){if(this.initialized)throw new Error("Cannot add globals after Registry has been initialized");this._addGlobalUnsafe(e);}addGlobalPostInit(e){this.globals.has(e.slug)&&this.globals.delete(e.slug),this._addGlobalUnsafe(e);}_addGlobalUnsafe(e){if(this.globals.has(e.slug)){console.warn(`[Registry] Duplicate global slug "${e.slug}" \u2014 skipping`);return}let t=B(e);if(t.length>0)throw new Error(`Invalid global config: ${t.join(", ")}`);let n={...e};for(let a of this.plugins)a.extendGlobal&&(n=a.extendGlobal(n.slug,n));this.globals.set(n.slug,n),this.clearSchemaCache(`global:${n.slug}`);}addGlobals(e){for(let t of e)this.addGlobal(t);}getGlobal(e){return this.globals.get(e)}getGlobals(){return Array.from(this.globals.values())}getGlobalSlugs(){return Array.from(this.globals.keys())}hasGlobal(e){return this.globals.has(e)}removeGlobal(e){if(this.initialized)throw new Error("Cannot remove globals after Registry has been initialized");return this.clearSchemaCache(`global:${e}`),this.globals.delete(e)}addPlugin(e){if(this.initialized)throw new Error("Cannot add plugins after Registry has been initialized");this.plugins.push(e);}getPlugins(){return [...this.plugins]}getZodSchema(e){let t=this.schemaCache.get(e);if(t)return t;let n=this.collections.get(e);if(n){let i=ge(n);return this.schemaCache.set(e,i),i}let a=this.globals.get(e);if(a){let i=Ae(a);return this.schemaCache.set(`global:${e}`,i),i}throw new Error(`No collection or global found with slug "${e}"`)}getCreateZodSchema(e){let t=`${e}:create`,n=this.schemaCache.get(t);if(n)return n;let a=this.collections.get(e);if(a){let i=me(a);return this.schemaCache.set(t,i),i}throw new Error(`No collection found with slug "${e}"`)}getUpdateZodSchema(e){let t=`${e}:update`,n=this.schemaCache.get(t);if(n)return n;let a=this.collections.get(e);if(a){let o=be(a);return this.schemaCache.set(t,o),o}let i=this.globals.get(e);if(i){let o=Ce(i);return this.schemaCache.set(`global:${e}:update`,o),o}throw new Error(`No collection or global found with slug "${e}"`)}getWhereZodSchema(e){let t=`${e}:where`,n=this.schemaCache.get(t);if(n)return n;let a=this.collections.get(e);if(a){let i=Te(a);return this.schemaCache.set(t,i),i}throw new Error(`No collection found with slug "${e}"`)}getFieldZodSchema(e){return C(e)}clearSchemaCache(e){this.schemaCache.delete(e),this.schemaCache.delete(`${e}:create`),this.schemaCache.delete(`${e}:update`),this.schemaCache.delete(`${e}:where`);}applyFieldDefaults(e){let t=[...e.fields];return t.some(n=>n.name==="id")||t.unshift({name:"id",type:"text",admin:{readOnly:true,hidden:true}}),e.tenantScoped&&!t.some(n=>n.name==="tenantId")&&t.push({name:"tenantId",type:"text",required:true,admin:{readOnly:true,hidden:true}}),e.timestamps&&!t.some(n=>n.name==="createdAt")&&(t.push({name:"createdAt",type:"date",admin:{readOnly:true,hidden:true}}),t.push({name:"updatedAt",type:"date",admin:{readOnly:true,hidden:true}})),e.versions?.drafts&&!t.some(n=>n.name==="status")&&t.push({name:"status",type:"select",options:[{value:"draft",label:"Draft"},{value:"published",label:"Published"}],admin:{readOnly:true,hidden:true}}),e.auth&&!t.some(n=>n.name==="password")&&t.push({name:"password",type:"password",required:true,admin:{hidden:true}}),t}getFields(e){let t=this.collections.get(e);if(t)return t.fields;let n=this.globals.get(e);if(n)return n.fields;throw new Error(`No collection or global found with slug "${e}"`)}getFieldMap(e){let t=this.getFields(e),n=new Map,a=i=>{for(let o of i){if(o.name&&n.set(o.name,o),"fields"in o&&o.fields&&a(o.fields),"tabs"in o)for(let r of o.tabs)a(r.fields);if("blocks"in o)for(let r of o.blocks)a(r.fields);}};return a(t),n}getVisibleFields(e){return this.getFields(e).filter(n=>!n.admin?.hidden)}validate(){let e=this.getCollections(),t=this.getGlobals();fe(e,t);}async init(e){this.validate();for(let t of this.plugins)t.init&&await t.init(e||this);this.initialized=true;}isInitialized(){return this.initialized}getPaginationDefaults(e){let t=this.collections.get(e);return {defaultLimit:t?.admin?.pagination?.defaultLimit||10,limits:t?.admin?.pagination?.limits||[10,25,50,100]}}getDefaultSort(e){let n=this.collections.get(e)?.admin?.useAsTitle;return n||"createdAt"}getDefaultColumns(e){let t=this.collections.get(e);return t?.admin?.defaultColumns?t.admin.defaultColumns:this.getVisibleFields(e).slice(0,4).map(a=>a.name)}getAdminTitle(e){let t=this.collections.get(e);return t?.label||t?.admin?.description||e}getAdminLabel(e){let t=this.collections.get(e);return t?.singularLabel||t?.label||e}getAdminGroup(e){return this.collections.get(e)?.admin?.group}getStats(){let e=0;for(let t of this.collections.values())e+=t.fields.length;for(let t of this.globals.values())e+=t.fields.length;return {collections:this.collections.size,globals:this.globals.size,plugins:this.plugins.length,fields:e}}toJSON(){return {collections:this.getCollections(),globals:this.getGlobals()}}},v=null;function Qe(){return v||(v=new D),v}function et(){v=null;}function M(){return v=new D,v}var tt={aws:{type:"aws",configKey:"s3",displayName:"S3 Compatible (AWS, Backblaze, Wasabi, etc.)",configFields:[{name:"bucket",type:"text",label:"Bucket Name",required:true},{name:"region",type:"text",label:"Region",defaultValue:"us-east-1",admin:{placeholder:"us-east-1"}},{name:"accessKeyId",type:"text",label:"Access Key ID",required:true},{name:"secretAccessKey",type:"password",label:"Secret Access Key",required:true},{name:"endpoint",type:"text",label:"Endpoint URL",admin:{placeholder:"https://s3.custom.com"}},{name:"cdnUrl",type:"text",label:"CDN URL",admin:{placeholder:"https://cdn.example.com"}},{name:"prefix",type:"text",label:"Path Prefix",admin:{placeholder:"uploads"}}]},r2:{type:"r2",configKey:"r2",displayName:"Cloudflare R2",configFields:[{name:"accountId",type:"text",label:"Account ID",required:true,admin:{placeholder:"Your Cloudflare Account ID"}},{name:"accessKeyId",type:"text",label:"Access Key ID",required:true},{name:"secretAccessKey",type:"password",label:"Secret Access Key",required:true},{name:"bucket",type:"text",label:"Bucket Name",required:true},{name:"publicDevUrl",type:"text",label:"Public Dev URL ID",admin:{placeholder:"pub-xxxxxxxxxxxxxxxx",description:"Enter ONLY the ID (e.g., pub-b8d8c4cc8bcf4d868ddd95efc1b305aa). Do NOT include https:// or the full URL. Found in R2 Dashboard \u2192 Public Dev URL."}},{name:"cdnUrl",type:"text",label:"Custom CDN URL",admin:{placeholder:"https://assets.example.com (optional)"}},{name:"prefix",type:"text",label:"Path Prefix",admin:{placeholder:"uploads (optional)",description:"Optional prefix for all object keys. Do not use '/' as prefix."}}]},gcs:{type:"gcs",configKey:"gcs",displayName:"Google Cloud Storage",configFields:[{name:"bucket",type:"text",label:"Bucket Name",required:true},{name:"projectId",type:"text",label:"Project ID"},{name:"clientEmail",type:"text",label:"Client Email"},{name:"privateKey",type:"password",label:"Private Key"},{name:"cdnUrl",type:"text",label:"CDN URL"},{name:"prefix",type:"text",label:"Path Prefix"}]},digitalocean:{type:"digitalocean",configKey:"digitalocean",displayName:"DigitalOcean Spaces",configFields:[{name:"bucket",type:"text",label:"Bucket Name",required:true},{name:"region",type:"text",label:"Region",defaultValue:"nyc3"},{name:"accessKeyId",type:"text",label:"Access Key ID",required:true},{name:"secretAccessKey",type:"password",label:"Secret Access Key",required:true},{name:"cdnUrl",type:"text",label:"CDN URL"},{name:"prefix",type:"text",label:"Path Prefix"}]},backblaze:{type:"backblaze",configKey:"backblaze",displayName:"Backblaze B2",configFields:[{name:"bucket",type:"text",label:"Bucket Name",required:true},{name:"accountId",type:"text",label:"Account ID"},{name:"applicationKeyId",type:"text",label:"Application Key ID",required:true},{name:"applicationKey",type:"password",label:"Application Key",required:true},{name:"cdnUrl",type:"text",label:"CDN URL"},{name:"prefix",type:"text",label:"Path Prefix"}]},wasabi:{type:"wasabi",configKey:"wasabi",displayName:"Wasabi",configFields:[{name:"bucket",type:"text",label:"Bucket Name",required:true},{name:"region",type:"text",label:"Region",defaultValue:"us-east-1"},{name:"accessKeyId",type:"text",label:"Access Key ID",required:true},{name:"secretAccessKey",type:"password",label:"Secret Access Key",required:true},{name:"cdnUrl",type:"text",label:"CDN URL"},{name:"prefix",type:"text",label:"Path Prefix"}]}};function st(s,e){switch(s){case "r2":return e?.endpoint||`https://${e?.accountId||""}.r2.cloudflarestorage.com`;case "digitalocean":return e?.endpoint||`https://${e?.region||"nyc3"}.digitaloceanspaces.com`;case "backblaze":return e?.endpoint||"https://s3.backblazeb2.com";case "wasabi":return e?.endpoint||`https://s3.${e?.region||"us-east-1"}.wasabisys.com`;default:return e?.endpoint}}function Se(s,e){return {provider:s,bucket:e?.bucket||"",region:e?.region||"us-east-1",accessKeyId:e?.accessKeyId||e?.clientEmail||e?.applicationKeyId||"",secretAccessKey:e?.secretAccessKey||e?.privateKey||e?.applicationKey||"",endpoint:st(s,e),cdnUrl:e?.cdnUrl,prefix:e?.prefix,accountId:e?.accountId,publicDevUrl:e?.publicDevUrl}}function nt(s,e,t){let n=t[e.configKey]||{};return Se(s,n)}function at(s,e,t){let n=t?.[e.configKey]||t;return Se(s,n)}var Ee={name:"@kyro-cms/storage-s3",version:"1.0.0",description:"S3-compatible storage (AWS R2 GCS DigitalOcean Backblaze Wasabi)",init:s=>{let e=s.registry?.storageProviders;if(!e)return;let t="@kyro-cms/storage-s3";for(let n of Object.values(tt))e.register({type:n.type,displayName:n.displayName,pluginName:t,configKey:n.configKey,configFields:n.configFields,extractConfig:a=>nt(n.type,n,a),extractRawConfig:a=>at(n.type,n,a),factory:a=>a$5(a)});}};var xe={name:"@kyro-cms/storage-cloudinary",version:"1.0.0",description:"Cloudinary image and video storage",init:s=>{let e=s.registry?.storageProviders;e&&e.register({type:"cloudinary",displayName:"Cloudinary",pluginName:"@kyro-cms/storage-cloudinary",configKey:"cloudinary",configFields:[{name:"cloudName",type:"text",label:"Cloud Name",required:true},{name:"apiKey",type:"text",label:"API Key",required:true},{name:"apiSecret",type:"password",label:"API Secret",required:true},{name:"folder",type:"text",label:"Folder",admin:{placeholder:"Optional folder path"}},{name:"uploadPreset",type:"text",label:"Upload Preset (optional)",admin:{placeholder:"Leave empty for signed uploads",description:"If not set, uploads will be signed with API Secret"}}],extractConfig:t=>({cloudName:t.cloudinary?.cloudName||"",apiKey:t.cloudinary?.apiKey||"",apiSecret:t.cloudinary?.apiSecret||"",folder:t.cloudinary?.folder,uploadPreset:t.cloudinary?.uploadPreset}),extractRawConfig:t=>{let n=t?.cloudinary||t;return {cloudName:n?.cloudName||"",apiKey:n?.apiKey||"",apiSecret:n?.apiSecret||"",folder:n?.folder,uploadPreset:n?.uploadPreset}},factory:t=>b$2(t)});}};var Ne={name:"@kyro-cms/storage-ftp",version:"1.0.0",description:"FTP/SFTP storage provider",init:s=>{let e=s.registry?.storageProviders;e&&e.register({type:"ftp",displayName:"FTP",pluginName:"@kyro-cms/storage-ftp",configKey:"ftp",configFields:[{name:"host",type:"text",label:"Host",required:true,admin:{placeholder:"ftp.example.com"}},{name:"port",type:"number",label:"Port",defaultValue:21,admin:{placeholder:"21 for FTP"}},{name:"user",type:"text",label:"Username",required:true},{name:"password",type:"password",label:"Password",required:true},{name:"secure",type:"checkbox",label:"Use TLS/SSL",defaultValue:false,admin:{description:"Enable TLS/SSL for secure connections (FTP only)"}},{name:"baseUrl",type:"text",label:"Base URL",required:true,admin:{placeholder:"https://files.example.com"}},{name:"prefix",type:"text",label:"Path Prefix",admin:{placeholder:"uploads"}}],extractConfig:t=>({host:t.ftp?.host||"",port:t.ftp?.port||21,user:t.ftp?.user||"",password:t.ftp?.password||"",secure:t.ftp?.secure||false,baseUrl:t.ftp?.baseUrl||"",prefix:t.ftp?.prefix,type:"ftp"}),extractRawConfig:t=>{let n=t?.ftp||t;return {host:n?.host||"",port:n?.port||21,user:n?.user||"",password:n?.password||"",secure:n?.secure||false,baseUrl:n?.baseUrl||"",prefix:n?.prefix,type:"ftp"}},factory:t=>c$3(t)});}};var ot=[Ee,xe,Ne];function z(s,e,t){let n=e.split(".");if(n.length===0)return false;let a=n[0],i=n.slice(1).join(".");for(let o of s)if(o.name===a)return i?o.fields&&Array.isArray(o.fields)||o.type==="array"&&o.fields&&Array.isArray(o.fields)?z(o.fields,i,t):false:(Object.assign(o,t),true);return false}function rt(s,e){if(e)for(let t of s){let n=e[t.slug];if(n){let{fields:a,...i}=n;if(t.admin={...t.admin,...i},a&&t.fields&&Array.isArray(t.fields))for(let[o,r]of Object.entries(a))z(t.fields,o,r);}}}var W=class{registry;db;pubsub;webhookService;settings;wsServer;config;constructor(e){this.config=e,this.registry=M(),this.db=e.adapter,this.pubsub=new b(this.registry),this.webhookService=o(this.db);for(let t of ot)this.registry.addPlugin(t);if(e.plugins)for(let t of e.plugins)this.registry.addPlugin(t);e.collections&&e.admin?.collectionOverrides&&rt(e.collections,e.admin.collectionOverrides),e.collections&&this.registry.addCollections(e.collections),e.globals&&this.registry.addGlobals(e.globals);}async init(){await this.registry.init(this),this.registry.addGlobalPostInit(a$1);let e={slug:"plugin-settings",admin:{hidden:true},fields:[{name:"states",type:"json"}]};if(this.registry.addGlobalPostInit(e),!this.db)throw new Error("Database adapter is null \u2014 failed to load at startup. Check the server console for the exact error.");let t={slug:d,fields:[{name:"userId",type:"text",required:true},{name:"name",type:"text",required:true},{name:"key",type:"text",required:true},{name:"keyPrefix",type:"text",required:true},{name:"permissions",type:"json"},{name:"lastUsedAt",type:"date"},{name:"expiresAt",type:"date"}]},n={slug:f$1,fields:[{name:"name",type:"text",required:true},{name:"url",type:"text",required:true},{name:"events",type:"json",required:true},{name:"collections",type:"json"},{name:"status",type:"text",required:true},{name:"secret",type:"text"},{name:"headers",type:"json"},{name:"action",type:"text"},{name:"config",type:"json"},{name:"lastTriggered",type:"date"},{name:"lastError",type:"text"}]},a={slug:g$1,fields:[{name:"webhookId",type:"text",required:true},{name:"event",type:"text",required:true},{name:"payload",type:"json",required:true},{name:"attempt",type:"number",required:true},{name:"status",type:"text",required:true},{name:"responseStatus",type:"number"},{name:"responseBody",type:"text"},{name:"error",type:"text"},{name:"duration",type:"number"},{name:"deliveredAt",type:"date"},{name:"nextRetryAt",type:"date"}]},i=this.registry.getGlobals();if(this.db instanceof c&&this.db.dialect==="postgres"){let o=this.db,r=d.replace(/-/g,"_");o.schema[r]||(o.schema[r]=g);}await this.db.init([...this.registry.getCollections(),t,n,a],i),await this.loadPluginState(),this.pubsub.autoRegisterHooks();}async loadSettings(){if(this.settings)return this.settings;try{let e=await this.db.findOne({collection:"_globals_access-settings",where:{},draft:!0});e&&(this.settings={access:e});}catch{}return this.settings||{}}async loadPluginState(){let e=this.registry.storageProviders,t=e.getAllPluginNames(),n={};try{let a=await this.db.findOne({collection:"_globals_plugin-settings",where:{},draft:!0});a&&a.states&&(n=a.states);}catch{}for(let a of t)n[a]!==void 0&&e.setPluginEnabled(a,n[a]);}getREST(e){let t=typeof this.config.auth=="object"?this.config.auth:null,n=t?.secret,a=t?.checkSession!==false;return s({registry:this.registry,db:this.db,authSecret:n,authAdapter:this.config.authAdapter,checkSession:a,...e,cors:this.config.cors,webhookService:this.webhookService,settings:this.settings})}getGraphQL(e$1){let t=c$1({registry:this.registry,db:this.db,settings:this.settings});return {fetch:createYoga({schema:t,context:async({request:a})=>{let i=f$2(a),o,r;if(i&&this.db){let d=await e(i,this.db);d.user&&(o=d.user,r=g$2(d));}let c=e$1?.tenantId;return {db:this.db,registry:this.registry,user:o,req:a,tenantId:c,apiKey:r,relationLoader:new a$2({db:this.db,tenantId:c,user:o})}},graphiql:this.config.graphQL?.disablePlayground!==true,plugins:[]}).fetch,schema:t}}getTRPC(e){return {fetch:async(t,n)=>{let i$1=new URL(t.url).pathname.replace(/^\/api\/trpc\//,""),[o,...r]=i$1.split("."),c=r.join(".");if(c=c.replace(/\.(query|mutate|subscribe)$/,""),!o||!c)return new Response(JSON.stringify({error:{message:"Invalid tRPC path",code:-32600,data:{code:"BAD_REQUEST",httpStatus:400}}}),{status:400,headers:{"Content-Type":"application/json"}});let d=await a$3({db:this.db,registry:this.registry,req:t,user:e?.user,tenantId:e?.tenantId,settings:this.settings}),p=i(d)[o];if(!p)return new Response(JSON.stringify({error:{message:`Collection '${o}' not found`,code:-32601,data:{code:"NOT_FOUND",httpStatus:404}}}),{status:404,headers:{"Content-Type":"application/json"}});let m=p[c];if(typeof m!="function")return new Response(JSON.stringify({error:{message:`Procedure '${c}' not found`,code:-32601,data:{code:"NOT_FOUND",httpStatus:404}}}),{status:404,headers:{"Content-Type":"application/json"}});try{let y={};if(t.method==="POST"||t.method==="PATCH")y=await t.json().catch(()=>({}));else {let A=new URL(t.url).searchParams.get("input");if(A)try{y=JSON.parse(decodeURIComponent(A));}catch{}}let h=y?.["0"]??y,f=await m({...h,collection:o});return new Response(JSON.stringify({result:{data:f}}),{status:200,headers:{"Content-Type":"application/json"}})}catch(y){let h=y.message||"Internal error",f=h.includes("not found")?404:h.includes("denied")||h.includes("authentication required")?403:h.includes("conflict")?409:500,A=f===404?-32601:f===403?-32001:f===409?-32002:-32603;return new Response(JSON.stringify({error:{message:h,code:A,data:{code:"INTERNAL_SERVER_ERROR",httpStatus:f}}}),{status:f,headers:{"Content-Type":"application/json"}})}},router:null}}getWS(){return this.wsServer}async startWebSocket(e$1){let t=this.settings?.access?.apiAccess;if(t?.wsEnabled===false)return null;let n=async a=>{let i=await e(a,this.db);if(!i.valid)throw new Error(i.error||"Invalid API key");if(!i.user)throw new Error("API key has no associated user");return i.user};return this.wsServer=d$1({pubsub:this.pubsub,port:e$1?.port||8080,requireAuth:e$1?.requireAuth??t?.requireAuth,verifyToken:e$1?.verifyToken||n}),this.wsServer}async shutdown(){this.wsServer&&await this.wsServer.close(),await this.db.disconnect();}};function Ht(s){return new W(s)}var ct=createRequire(import.meta.url),dt="node:sqlite",{DatabaseSync:ut}=ct(dt);function x(s){let e=[];for(let t of s)if(t.type==="tabs"&&"tabs"in t)for(let n of t.tabs)e.push(...x(n.fields));else t.type==="row"&&"fields"in t?e.push(...x(t.fields)):t.type==="collapsible"&&"fields"in t?e.push(...x(t.fields)):e.push(t);return e}function ft(s,e){let t=e,n=s[t.name];if(t.type==="json"||t.type==="richtext"||t.type==="array"||t.type==="group"||t.type==="blocks"||t.type==="list"||t.type==="relationship-block")try{n=n?JSON.parse(n):null;}catch{n=null;}if(t.type==="checkbox"&&(n=!!n),t.type==="date"&&n)try{let a=new Date(n);isNaN(a.getTime())?n=null:n=a.toISOString();}catch{n=null;}if((t.type==="upload"||t.type==="image")&&n)try{let a=JSON.parse(n);Array.isArray(a)?n=a.map(i=>typeof i=="object"&&i!==null?i:{id:i}):n=typeof a=="object"?a:{id:a};}catch{n={id:n};}if(t.type==="relationship"&&n)try{let a=JSON.parse(n);Array.isArray(a),n=a;}catch{n={relationTo:Array.isArray(t.relationTo)?t.relationTo[0]:t.relationTo,value:n};}if(t.type==="list"&&n)try{let a=JSON.parse(n);n=Array.isArray(a)?a:[];}catch{n=[];}if(t.type==="relationship-block"&&n)try{let a=JSON.parse(n);n=Array.isArray(a)?a:[];}catch{n=[];}return n}function Re(s,e){return Array.isArray(s)?s.map(t=>{if(!t||typeof t!="object")return t;let n=t.data?{...t.data}:void 0;if(!n)return t;let a=e.find(i=>i.slug===t.type||i.slug===t.slug);if(!a||!Array.isArray(a.fields))return t;for(let i of a.fields){if(i.name&&(i.type==="upload"||i.type==="image")&&n[i.name]){let o=n[i.name];Array.isArray(o)?n[i.name]=o.map(r=>typeof r=="string"?{id:r}:r):typeof o=="string"&&(n[i.name]={id:o});}if(i.type==="blocks"&&i.name&&n[i.name]){let o=i.blocks||[];n[i.name]=Re(n[i.name],o);}}return {...t,data:n}}):s}function X(s,e){try{return s.prepare(`PRAGMA table_info(${e})`).all().map(n=>n.name)}catch{return []}}var J=class extends a$4{db;path;migrations=new Map;versionsTableName="kyro_versions";constructor(e){super(),this.path=e.path,e.db?this.db=e.db:this.db=null;}async connect(){if(this.db||(this.db=new ut(this.path||":memory:")),this.db&&typeof this.db.prepare=="function"&&!this.db.prepare.__wrapped){let e=this.db.prepare.bind(this.db),t=n=>{let a=e(n),i=o=>typeof o=="boolean"?o?1:0:o===void 0?null:o;return new Proxy(a,{get(o,r,c){if(r==="all")return (...u)=>o.all(...u.map(i));if(r==="get")return (...u)=>o.get(...u.map(i));if(r==="run")return (...u)=>o.run(...u.map(i));let d=Reflect.get(o,r,c);return typeof d=="function"?d.bind(o):d}})};t.__wrapped=true,this.db.prepare=t;}this.db.exec("PRAGMA journal_mode = WAL"),this.db.exec("PRAGMA foreign_keys = ON"),this.connected=true;}async disconnect(){this.db&&this.db.close(),this.connected=false;}ensureTable(e,t){let n=t||this.getTableNameFor(e.slug),a=["id TEXT PRIMARY KEY"];for(let r of x(e.fields)){if(!r.name||r.name==="id")continue;let c=this.fieldToSQL(r);c&&a.push(c);}let i=x(e.fields);i.some(r=>r.name==="createdAt")||a.push(`${this.col("createdAt")} TEXT DEFAULT (datetime('now'))`),i.some(r=>r.name==="updatedAt")||a.push(`${this.col("updatedAt")} TEXT DEFAULT (datetime('now'))`),i.some(r=>r.name==="status")||a.push("status TEXT DEFAULT 'draft'"),i.some(r=>r.name==="hasDraft")||a.push("hasDraft INTEGER DEFAULT 0"),e.tenantScoped&&a.push("tenant_id TEXT NOT NULL");let o=X(this.db,n);if(o.length===0){let r=`CREATE TABLE IF NOT EXISTS ${n} (${a.join(", ")})`;this.db.exec(r),this.db.exec(`CREATE INDEX IF NOT EXISTS idx_${n}_status ON ${n}(status)`);for(let c of x(e.fields))c.name&&c.indexed&&this.db.exec(`CREATE INDEX IF NOT EXISTS idx_${n}_${c.name} ON ${n}(${this.col(c.name)})`),c.name&&c.unique&&this.db.exec(`CREATE UNIQUE INDEX IF NOT EXISTS idx_${n}_${c.name}_unique ON ${n}(${this.col(c.name)})`);}else {let r=new Set(o);for(let c of a){let d=c.split(" ")[0].replace(/^"/,"").replace(/"$/,"");if(!r.has(d)&&d!=="id")try{d==="status"?this.db.exec(`ALTER TABLE ${n} ADD COLUMN ${this.col(d)} TEXT DEFAULT 'published'`):d==="hasDraft"?this.db.exec(`ALTER TABLE ${n} ADD COLUMN ${this.col(d)} INTEGER DEFAULT 0`):this.db.exec(`ALTER TABLE ${n} ADD COLUMN ${this.col(d)} TEXT`);}catch{}}}this.migrations.set(n,true);}ensureVersionsTable(){this.db.exec(`
|
|
4
|
+
CREATE TABLE IF NOT EXISTS ${this.versionsTableName} (
|
|
5
|
+
id TEXT PRIMARY KEY,
|
|
6
|
+
collection_slug TEXT NOT NULL,
|
|
7
|
+
document_id TEXT NOT NULL,
|
|
8
|
+
tenant_id TEXT,
|
|
9
|
+
version INTEGER NOT NULL,
|
|
10
|
+
status TEXT NOT NULL DEFAULT 'draft',
|
|
11
|
+
autosave INTEGER NOT NULL DEFAULT 0,
|
|
12
|
+
data TEXT NOT NULL,
|
|
13
|
+
created_by TEXT,
|
|
14
|
+
change_description TEXT,
|
|
15
|
+
published_at TEXT,
|
|
16
|
+
created_at TEXT DEFAULT (datetime('now')),
|
|
17
|
+
updated_at TEXT DEFAULT (datetime('now'))
|
|
18
|
+
)
|
|
19
|
+
`);try{this.db.exec(`ALTER TABLE ${this.versionsTableName} ADD COLUMN autosave INTEGER NOT NULL DEFAULT 0`);}catch{}this.db.exec(`CREATE INDEX IF NOT EXISTS idx_${this.versionsTableName}_doc ON ${this.versionsTableName}(collection_slug, document_id)`),this.db.exec(`CREATE INDEX IF NOT EXISTS idx_${this.versionsTableName}_status ON ${this.versionsTableName}(status)`),this.db.exec(`CREATE INDEX IF NOT EXISTS idx_${this.versionsTableName}_autosave ON ${this.versionsTableName}(autosave)`);}col(e){return `"${e}"`}fieldToSQL(e){switch(e.type){case "text":case "email":case "password":case "textarea":case "color":case "icon":case "code":case "markdown":case "url":return this.col(e.name)+" TEXT";case "number":return this.col(e.name)+" REAL";case "checkbox":return this.col(e.name)+" INTEGER DEFAULT 0";case "date":return this.col(e.name)+" TEXT";case "select":case "radio":return this.col(e.name)+" TEXT";case "relationship":case "upload":return this.col(e.name)+" TEXT";case "json":case "richtext":case "array":case "group":case "blocks":return this.col(e.name)+" TEXT";default:return null}}parseGlobalsSlug(e){if(e.startsWith("_globals_")){let t=e.replace("_globals_","");return {isGlobal:true,globalSlug:t,tableName:`global_${t.replace(/-/g,"_")}`}}return {isGlobal:false,globalSlug:"",tableName:this.getTableNameFor(e)}}async find(e){let{collection:t,where:n={},sort:a,limit:i=10,page:o=1,tenantId:r,draft:c=false}=e,d=this.parseGlobalsSlug(t),u=d.isGlobal?this.globals.get(d.globalSlug):this.getCollection(t);this.ensureTable(u,d.tableName);let m=`SELECT * FROM ${d.tableName}`,y=[],h=[],f={...n};this.tenantContext&&u.tenantScoped&&(f=c$2({where:f},t,this.tenantContext,b$1).where||{});let A=u.fields.find(b=>b.name==="status"),g=A?.type==="select"&&Array.isArray(A.options)&&A.options.some(b=>b.value==="published");!c&&g&&(h.push("status = ?"),y.push("published")),r&&u.tenantScoped&&(h.push("tenant_id = ?"),y.push(r));for(let[b,S]of Object.entries(f))b==="AND"||b==="OR"||(typeof S=="object"&&S!==null?(S.equals!==void 0&&(h.push(`${this.col(b)} = ?`),y.push(S.equals)),S.in!==void 0&&(h.push(`${this.col(b)} IN (${S.in.map(()=>"?").join(", ")})`),y.push(...S.in)),S.not_equals!==void 0&&(h.push(`${this.col(b)} != ?`),y.push(S.not_equals))):(h.push(`${this.col(b)} = ?`),y.push(S)));h.length>0&&(m+=` WHERE ${h.join(" AND ")}`);let ve=this.col(a?.replace("-","")||"createdAt"),we=a?.startsWith("-")?"DESC":"ASC";m+=` ORDER BY ${ve} ${we}`;let De=m.replace("SELECT *","SELECT COUNT(*) as count"),F=this.db.prepare(De).get(...y)?.count||0;m+=" LIMIT ? OFFSET ?",y.push(i,(o-1)*i);let w=this.db.prepare(m).all(...y).map(b=>this.rowToDoc(b,u));return this.tenantContext&&!this.tenantContext.isSuperAdmin&&(w=w.filter(b=>d$2(b,t,this.tenantContext,b$1))),c&&(w=await Promise.all(w.map(async b=>{let S=this.db.prepare(`SELECT * FROM ${this.versionsTableName} WHERE collection_slug = ? AND document_id = ? AND tenant_id IS NULL ORDER BY version DESC LIMIT 1`).get(t,b.id);if(S){let Fe=S.data?JSON.parse(S.data):{};return {...b,...Fe,status:b.status}}return b}))),{docs:w,totalDocs:F,limit:i,totalPages:Math.ceil(F/i),page:o,pagingCounter:(o-1)*i+1,hasPrevPage:o>1,hasNextPage:o<Math.ceil(F/i),prevPage:o>1?o-1:null,nextPage:o<Math.ceil(F/i)?o+1:null}}async findByID(e){let{collection:t,id:n,tenantId:a,draft:i=false}=e,o=this.parseGlobalsSlug(t),r=o.isGlobal?this.globals.get(o.globalSlug):this.getCollection(t);this.ensureTable(r,o.tableName);let d=`SELECT * FROM ${o.tableName} WHERE id = ?`,u=[n];if(this.tenantContext&&r.tenantScoped){let f={id:n,tenant_id:this.tenantContext.tenantId};if(!d$2(f,t,this.tenantContext,b$1))return null}let p=r.fields.find(f=>f.name==="status"),m=p?.type==="select"&&Array.isArray(p.options)&&p.options.some(f=>f.value==="published");!i&&m&&(d+=" AND status = ?",u.push("published")),a&&r.tenantScoped&&(d+=" AND tenant_id = ?",u.push(a));let y=this.db.prepare(d).get(...u);if(!y)return null;let h=this.rowToDoc(y,r);if(i){let f=this.db.prepare(`SELECT * FROM ${this.versionsTableName} WHERE collection_slug = ? AND document_id = ? AND tenant_id IS NULL ORDER BY version DESC LIMIT 1`).get(t,h.id);if(f){let A=f.data?JSON.parse(f.data):{};h={...h,...A,status:h.status};}}return h}async create(e){let{collection:t,data:n,tenantId:a}=e,i=this.parseGlobalsSlug(t),o=i.isGlobal?this.globals.get(i.globalSlug):this.getCollection(t);this.ensureTable(o,i.tableName);let r=i.tableName,c=i.isGlobal?i.globalSlug:n.id||this.generateId(),d=this.prepareData(n,o);d.id=c,d.created_at=new Date().toISOString(),d.updated_at=new Date().toISOString(),a&&o.tenantScoped&&(d.tenant_id=a);let u=Object.keys(d),p=X(this.db,r),m={};for(let g of u)p.includes(g)&&(m[g]=d[g]);let y=Object.keys(m),h=y.map(g=>this.col(g)),f=y.map(()=>"?").join(", "),A=Object.values(m).map(g=>g!==null&&typeof g=="object"?JSON.stringify(g):g);return this.db.prepare(`INSERT OR REPLACE INTO ${r} (${h.join(", ")}) VALUES (${f})`).run(...A),this.ensureVersionsTable(),this.findByID({collection:t,id:c,tenantId:a,draft:true})}async update(e){let{collection:t,id:n,data:a,tenantId:i}=e,o=this.parseGlobalsSlug(t),r=o.isGlobal?this.globals.get(o.globalSlug):this.getCollection(t);this.ensureTable(r,o.tableName);let c=o.tableName,d=this.prepareData(a,r);d.updated_at=new Date().toISOString();let u=X(this.db,c),p={};for(let g of Object.keys(d))u.includes(g)&&(p[g]=d[g]);let y=Object.keys(p).map(g=>`${this.col(g)} = ?`).join(", "),h=Object.values(p).map(g=>g!==null&&typeof g=="object"?JSON.stringify(g):g),f=`UPDATE ${c} SET ${y} WHERE id = ?`,A=[...h,n];return i&&r.tenantScoped&&(f+=" AND tenant_id = ?",A.push(i)),this.db.prepare(f).run(...A),this.ensureVersionsTable(),this.findByID({collection:t,id:n,tenantId:i,draft:true})}async delete(e){let{collection:t,id:n,tenantId:a}=e,i=this.parseGlobalsSlug(t),o=i.isGlobal?this.globals.get(i.globalSlug):this.getCollection(t);this.ensureTable(o,i.tableName),this.ensureVersionsTable();let r=await this.findByID({collection:t,id:n,tenantId:a,draft:true});if(!r)throw new Error(`Document not found: ${t}/${n}`);let d=`DELETE FROM ${i.tableName} WHERE id = ?`,u=[n];return a&&o.tenantScoped&&(d+=" AND tenant_id = ?",u.push(a)),this.db.prepare(d).run(...u),r}async count(e){let{collection:t,tenantId:n}=e,a=this.parseGlobalsSlug(t),i=a.isGlobal?this.globals.get(a.globalSlug):this.getCollection(t);this.ensureTable(i,a.tableName);let r=`SELECT COUNT(*) as count FROM ${a.tableName}`,c=[];return n&&i.tenantScoped&&(r+=" WHERE tenant_id = ?",c.push(n)),this.db.prepare(r).get(...c)?.count||0}async findOne(e){let t=this.parseGlobalsSlug(e.collection);if(t.isGlobal){let a=this.globals.get(t.globalSlug);if(!a)throw new Error(`Global "${t.globalSlug}" not found in adapter`);this.ensureTable(a,t.tableName);let i=`SELECT * FROM ${t.tableName}`,o=[],r=[],c=a.fields.find(p=>p.name==="status"),d=c?.type==="select"&&Array.isArray(c.options)&&c.options.some(p=>p.value==="published");!e.draft&&a.versions&&d&&o.push("status = 'published'"),o.length>0&&(i+=` WHERE ${o.join(" AND ")}`),i+=" LIMIT 1";let u=this.db.prepare(i).get(...r);if(u){let p=this.rowToDoc(u,a);if(e.draft){let m=this.db.prepare(`SELECT * FROM ${this.versionsTableName} WHERE collection_slug = ? AND document_id = ? AND tenant_id IS NULL ORDER BY version DESC LIMIT 1`).get(e.collection,t.globalSlug);if(m){let y=m.data?JSON.parse(m.data):{};p={...p,...y,status:p.status};}}return p}return null}return (await this.find({...e,limit:1})).docs[0]||null}async findVersions(e){this.ensureVersionsTable();let{collection:t,documentId:n,tenantId:a,limit:i=20,page:o=1}=e,r=["collection_slug = ?","document_id = ?","autosave = 0"],c=[t,n];a?(r.push("tenant_id = ?"),c.push(a)):r.push("tenant_id IS NULL");let d=`WHERE ${r.join(" AND ")}`,p=this.db.prepare(`SELECT COUNT(*) as count FROM ${this.versionsTableName} ${d}`).get(...c)?.count||0,m=(o-1)*i;return {docs:this.db.prepare(`SELECT * FROM ${this.versionsTableName} ${d} ORDER BY version DESC LIMIT ? OFFSET ?`).all(...c,i,m).map(f=>this.rowToVersion(f)),totalDocs:p,limit:i,totalPages:Math.ceil(p/i),page:o,pagingCounter:(o-1)*i+1,hasPrevPage:o>1,hasNextPage:o<Math.ceil(p/i),prevPage:o>1?o-1:null,nextPage:o<Math.ceil(p/i)?o+1:null}}async findVersionByID(e){this.ensureVersionsTable();let t=this.db.prepare(`SELECT * FROM ${this.versionsTableName} WHERE id = ? AND collection_slug = ? LIMIT 1`).get(e.versionId,e.collection);return t?this.rowToVersion(t):null}async createVersion(e){this.ensureVersionsTable();let t=new Date().toISOString();if(e.autosave){let r=`SELECT * FROM ${this.versionsTableName} WHERE collection_slug = ? AND document_id = ? AND autosave = 1`,c=[e.collection,e.documentId];e.tenantId?(r+=" AND tenant_id = ?",c.push(e.tenantId)):r+=" AND tenant_id IS NULL",r+=" LIMIT 1";let d=this.db.prepare(r).get(...c);if(d){this.db.prepare(`UPDATE ${this.versionsTableName} SET data = ?, status = ?, updated_at = ? WHERE id = ?`).run(JSON.stringify(e.data),e.status,t,d.id);let u=await this.findVersionByID({collection:e.collection,versionId:d.id});if(u)return u}}let n=this.generateId(),i=(this.db.prepare(`SELECT version FROM ${this.versionsTableName} WHERE collection_slug = ? AND document_id = ? AND autosave = 0 ORDER BY version DESC LIMIT 1`).get(e.collection,e.documentId)?.version??0)+1;if(this.db.prepare(`INSERT INTO ${this.versionsTableName} (
|
|
20
|
+
id, collection_slug, document_id, tenant_id, version, status, autosave, data, created_by, change_description, published_at, created_at, updated_at
|
|
21
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(n,e.collection,e.documentId,e.tenantId??null,i,e.status,e.autosave?1:0,JSON.stringify(e.data),e.createdBy??null,e.changeDescription??null,e.status==="published"?t:null,t,t),!e.autosave){let c=this.collections.get(e.collection)?.versions?.maxPerDoc;c&&c>0&&await this.deleteVersions({collection:e.collection,documentId:e.documentId,keepLatest:c,tenantId:e.tenantId});}return await this.findVersionByID({collection:e.collection,versionId:n})}async updateLatestVersion(e){return this.createVersion({...e,autosave:true})}async deleteVersions(e){this.ensureVersionsTable();let{collection:t,documentId:n,keepLatest:a,tenantId:i}=e;if(a&&a>0){let o=this.db.prepare(`SELECT id, status, autosave FROM ${this.versionsTableName} WHERE collection_slug = ? AND document_id = ? ORDER BY version DESC`).all(t,n),r=0,c=[];for(let d of o)d.status==="published"||d.autosave===1||(r++,r>a&&c.push(d.id));for(let d of c)this.db.prepare(`DELETE FROM ${this.versionsTableName} WHERE id = ?`).run(d);}else {let o=`DELETE FROM ${this.versionsTableName} WHERE collection_slug = ? AND document_id = ?`,r=[t,n];i&&(o+=" AND tenant_id = ?",r.push(i)),this.db.prepare(o).run(...r);}}rowToVersion(e){return {id:String(e.id),collection:e.collection_slug,documentId:e.document_id,version:e.version,status:e.status,data:e.data?JSON.parse(e.data):{},createdBy:e.created_by??void 0,changeDescription:e.change_description??void 0,publishedAt:e.published_at??null,createdAt:e.created_at,updatedAt:e.updated_at}}prepareData(e,t){let n={},a=x(t.fields),i=(o,r)=>{let c=o;if(c.type==="json"||c.type==="richtext"||c.type==="array"||c.type==="group"||c.type==="blocks"||c.type==="list"||c.type==="relationship-block")return r!=null?JSON.stringify(r):null;if(c.type==="checkbox")return r?1:0;if(c.type==="number")return r!==null&&r!==""?Number(r):null;if(c.type==="upload"||c.type==="image"){if(r==null)return null;if(Array.isArray(r)){let d=r.map(u=>typeof u=="string"?u:typeof u=="object"?u.id||u._id||u:String(u));return JSON.stringify(d)}return typeof r=="string"?r:typeof r=="object"?JSON.stringify(r):String(r)}else if(o.type==="relationship"){if(r==null)return null;if(Array.isArray(r)){let d=r.map(u=>typeof u=="string"?u:typeof u=="object"?JSON.stringify({relationTo:o.relationTo,value:u.id||u}):String(u));return JSON.stringify(d)}return typeof r=="string"?r:typeof r=="object"?JSON.stringify({relationTo:o.relationTo,value:r.id||r}):String(r)}return r};for(let o of a){if(!o.name||o.name==="id"||t.fields.some(d=>d.type==="tabs"&&"tabs"in d&&d.tabs.some(u=>u.fields.some(p=>p.name===o.name))))continue;let c=e[o.name];c!==void 0&&(n[o.name]=i(o,c));}for(let o of t.fields)if(o.type==="tabs"&&"tabs"in o&&o.name){let r=e[o.name];if(r&&typeof r=="object"){for(let c of o.tabs)for(let d of c.fields)if(d.name&&d.name!=="id"){let u=r[d.name];u!==void 0&&(n[d.name]=i(d,u));}}}return n}rowToDoc(e,t){let n={id:e.id};for(let a of x(t.fields)){if(!a.name||a.name==="id")continue;let i=a,o=e[i.name];if(i.type==="json"||i.type==="richtext"||i.type==="array"||i.type==="group"||i.type==="blocks"||i.type==="list"||i.type==="relationship-block")try{o=o?JSON.parse(o):null;}catch{o=null;}if(i.type==="blocks"&&o&&Array.isArray(o)){let r=i.blocks||[];o=Re(o,r);}if(a.type==="checkbox"&&(o=!!o),a.type==="date"&&o)try{let r=new Date(o);isNaN(r.getTime())?(console.warn(`[LocalAdapter] Invalid date value for field "${a.name}":`,o),o=null):o=r.toISOString();}catch{o=null;}if((a.type==="upload"||a.type==="image")&&o)try{let r=JSON.parse(o);Array.isArray(r)?o=r.map(c=>typeof c=="object"&&c!==null?c:{id:c}):o=typeof r=="object"?r:{id:r};}catch{o={id:o};}if(a.type==="relationship"&&o)try{let r=JSON.parse(o);Array.isArray(r),o=r;}catch{o={relationTo:Array.isArray(a.relationTo)?a.relationTo[0]:a.relationTo,value:o};}n[a.name]=o;}for(let a of t.fields)if(!(!a.name||a.name==="id"||a.name==="row"||a.name==="collapsible")&&a.type==="tabs"&&"tabs"in a){let i={};for(let o of a.tabs)for(let r of o.fields)r.name&&r.name!=="id"&&(i[r.name]=ft(e,r));n[a.name]=i;}if(t.timestamps){let a=e.createdAt||e.created_at,i=e.updatedAt||e.updated_at;if(a)try{let o=new Date(a);isNaN(o.getTime())||(n.createdAt=o.toISOString());}catch{}if(i)try{let o=new Date(i);isNaN(o.getTime())||(n.updatedAt=o.toISOString());}catch{}}return t.tenantScoped&&(n.tenantId=e.tenant_id),n.status=e.status??"published",n.hasDraft=e.hasDraft?!!e.hasDraft:false,n}generateId(){let e=Date.now().toString(16).padStart(12,"0"),t=randomBytes(6).toString("hex");return e+t}getMediaById(e){try{let t=this.getTableNameFor("media"),n=this.db.prepare(`SELECT id, url, thumbnail_url FROM ${t} WHERE id = ?`).get(e);if(n)return {id:n.id,url:n.url,thumbnailUrl:n.thumbnail_url||n.url}}catch{}return null}getTableNameFor(e){return e.replace(/-/g,"_")}async migrate(){for(let e of this.collections.values())this.ensureTable(e);}async rollback(){}async transaction(e){return new Promise((t,n)=>{let a=this.db.transaction(async()=>e({db:this.db}));try{let i=a();t(i);}catch(i){n(i);}})}getDatabase(){return this.db}exec(e){this.db.exec(e);}prepare(e){return this.db.prepare(e)}};function ps(s){return new J(s||{})}export{K as a,V as b,B as c,N as d,fe as e,C as f,ge as g,me as h,be as i,Te as j,Ae as k,D as l,Qe as m,et as n,M as o,W as p,Ht as q,J as r,ps as s};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a,c,b,d}from'./chunk-TQNM4C7H.js';import {randomBytes}from'crypto';var _=class extends a{client;db;database;connectionString;constructor(i){if(super(),i.connectionString){this.connectionString=i.connectionString;try{let e=new URL(i.connectionString);this.database=e.pathname.replace(/^\//,"")||"kyro_cms";}catch{this.database="kyro_cms";}}else this.client=i.client,this.database=i.database;}async connect(){if(this.connectionString&&!this.client){let{MongoClient:i}=await import('mongodb');this.client=new i(this.connectionString),await this.client.connect();}this.db=this.client.db(this.database),this.connected=true;}async disconnect(){this.client&&(await this.client.close(),this.connected=false);}getMongoCollection(i){if(!this.db)throw new Error("MongoDB not connected");return this.db.collection(i)}async find(i){let{collection:e,where:n={},sort:s,limit:t=10,page:o=1,tenantId:r,select:a,draft:c$1}=i,u=this.getCollectionConfig(e),f=this.getMongoCollection(e),d$1={...n};this.tenantContext&&u.tenantScoped&&(d$1=c({where:d$1},e,this.tenantContext,b).where||{});let l=this.buildFilter(d$1,r),g=u.fields.find(h=>h.name==="status"),p=g?.type==="select"&&Array.isArray(g.options)&&g.options.some(h=>h.value==="published");!c$1&&p&&(l.status="published");let v=this.parseSort(s),R={[v.field]:v.direction==="asc"?1:-1},D=(o-1)*t,[$,x]=await Promise.all([f.find(l).sort(R).skip(D).limit(t).project(this.buildProjection(a)).toArray(),f.countDocuments(l)]),y=$.map(h=>this.processResult(h,u));return this.tenantContext&&!this.tenantContext.isSuperAdmin&&(y=y.filter(h=>d(h,e,this.tenantContext,b))),c$1&&(y=await Promise.all(y.map(async h=>{let A=await this.getMongoCollection(`${e}_versions`).findOne({document_id:h.id},{sort:{createdAt:-1}});if(A){let S=A.data||{};return {...h,...S,status:h.status}}return h}))),{docs:y,...this.calculatePagination(o,t,x)}}async findByID(i){let{collection:e,id:n,tenantId:s,draft:t}=i,o=this.getCollectionConfig(e),r=this.getMongoCollection(e);if(this.tenantContext&&o.tenantScoped){let l={_id:n,tenantId:this.tenantContext.tenantId};if(!d(l,e,this.tenantContext,b))return null}let a={_id:n};s&&(a.tenantId=s);let c=o.fields.find(l=>l.name==="status"),u=c?.type==="select"&&Array.isArray(c.options)&&c.options.some(l=>l.value==="published");!t&&u&&(a.status="published");let f=await r.findOne(a);if(!f)return null;let d$1=this.processResult(f,o);if(t){let g=await this.getMongoCollection(`${e}_versions`).findOne({document_id:d$1.id},{sort:{createdAt:-1}});if(g){let p=g.data||{};d$1={...d$1,...p,status:d$1.status};}}return d$1}async create(i){let{collection:e,data:n,tenantId:s}=i,t=this.getCollectionConfig(e),o=this.getMongoCollection(e),r={...this.prepareData(n,t),_id:this.generateId()};return s&&(r.tenantId=s),await o.insertOne(r),this.processResult(r,t)}async update(i){let{collection:e,id:n,data:s,tenantId:t}=i,o=this.getCollectionConfig(e),r=this.getMongoCollection(e),a={_id:n};t&&(a.tenantId=t);let c=this.prepareData(s,o),u=await r.findOneAndUpdate(a,{$set:c},{returnDocument:"after"});if(!u)throw new Error(`Document not found: ${e}/${n}`);return this.processResult(u,o)}async delete(i){let{collection:e,id:n,tenantId:s}=i,t=this.getCollectionConfig(e),o=this.getMongoCollection(e),r={_id:n};s&&(r.tenantId=s);let a=await o.findOneAndDelete(r);if(!a)throw new Error(`Document not found: ${e}/${n}`);return this.processResult(a,t)}async count(i){let{collection:e,where:n={},tenantId:s}=i,t=this.getMongoCollection(e),o=this.buildFilter(n,s);return t.countDocuments(o)}async findOne(i){let{collection:e,where:n={},tenantId:s,draft:t}=i,o=this.getCollectionConfig(e),r=this.getMongoCollection(e),a=this.buildFilter(n,s),c=o.fields.find(l=>l.name==="status"),u=c?.type==="select"&&Array.isArray(c.options)&&c.options.some(l=>l.value==="published");!t&&u&&(a.status="published");let f=await r.findOne(a);if(!f)return null;let d=this.processResult(f,o);if(t){let g=await this.getMongoCollection(`${e}_versions`).findOne({document_id:d.id},{sort:{createdAt:-1}});if(g){let p=g.data||{};d={...d,...p,status:d.status};}}return d}async findVersions(i){let{collection:e,documentId:n,sort:s,limit:t=10,page:o=1,tenantId:r}=i,a=this.getMongoCollection(`${e}_versions`),c={document_id:n,autosave:{$ne:true}};r&&(c.tenant_id=r);let u=(o-1)*t,f=this.parseSort(s),d={[f.field]:f.direction==="asc"?1:-1},[l,g]=await Promise.all([a.find(c).sort(d).skip(u).limit(t).toArray(),a.countDocuments(c)]);return {docs:l.map(p=>this.processResult(p,{})),...this.calculatePagination(o,t,g)}}async findVersionByID(i){let{collection:e,versionId:n,tenantId:s}=i,t=this.getMongoCollection(`${e}_versions`),o={_id:n};s&&(o.tenant_id=s);let r=await t.findOne(o);return r?this.processResult(r,{}):null}async createVersion(i){let{collection:e,documentId:n,data:s,status:t,createdBy:o,changeDescription:r,tenantId:a,autosave:c}=i,u=this.getMongoCollection(`${e}_versions`);if(c){let l={document_id:n,collection_slug:e,autosave:true};a&&(l.tenant_id=a);let g=await u.findOne(l);if(g){let p=new Date().toISOString();return await u.updateOne({_id:g._id},{$set:{data:s,status:t,updatedAt:p}}),this.processResult({...g,data:s,status:t,updatedAt:p},{})}}let f=new Date().toISOString(),d={_id:this.generateId(),document_id:n,collection_slug:e,tenant_id:a,data:s,status:t,autosave:c===true,created_by:o,change_description:r,createdAt:f,updatedAt:f};if(await u.insertOne(d),!c){let l=this.getCollectionConfig(e);l.versions?.maxPerDoc&&await this.deleteVersions({collection:e,documentId:n,keepLatest:l.versions.maxPerDoc,tenantId:a});}return this.processResult(d,{})}async updateLatestVersion(i){return this.createVersion({...i,autosave:true})}async deleteVersions(i){let{collection:e,documentId:n,keepLatest:s,tenantId:t}=i,o=this.getMongoCollection(`${e}_versions`);if(s){let r={document_id:n,autosave:{$ne:true}};t&&(r.tenant_id=t);let c=(await o.find(r).sort({createdAt:-1}).limit(s).project({_id:1}).toArray()).map(u=>u._id);c.length>0&&await o.deleteMany({document_id:n,autosave:{$ne:true},_id:{$nin:c},...t?{tenant_id:t}:{}});}else {let r={document_id:n};t&&(r.tenant_id=t),await o.deleteMany(r);}}async migrate(){for(let i of this.collections.values()){let e=this.getMongoCollection(i.slug);await e.createIndex({_id:1}),i.tenantScoped&&await e.createIndex({tenantId:1}),i.timestamps&&await e.createIndex({createdAt:-1});for(let n of i.fields)n.unique&&n.name&&await e.createIndex({[n.name]:1},{unique:true}),n.indexed&&n.name&&await e.createIndex({[n.name]:1});}}getCollectionConfig(i){let e=this.collections.get(i);if(!e)throw new Error(`Collection "${i}" not found`);return e}buildFilter(i={},e){let n={};e&&(n.tenantId=e);for(let[s,t]of Object.entries(i))if(s==="AND"&&Array.isArray(t)){let o=t.map(r=>this.buildFilter(r));Object.assign(n,...o);}else if(s==="OR"&&Array.isArray(t))n.$or=t.map(o=>this.buildFilter(o));else if(typeof t=="object"&&t!==null&&!Array.isArray(t)){let o={};if(t.equals!==void 0){n[s==="id"?"_id":s]=t.equals;continue}t.not_equals!==void 0&&(o.$ne=t.not_equals),t.in!==void 0&&(o.$in=t.in),t.not_in!==void 0&&(o.$nin=t.not_in),t.greater_than!==void 0&&(o.$gt=t.greater_than),t.greater_than_equal!==void 0&&(o.$gte=t.greater_than_equal),t.less_than!==void 0&&(o.$lt=t.less_than),t.less_than_equal!==void 0&&(o.$lte=t.less_than_equal),t.like!==void 0&&(o.$regex=new RegExp(t.like.replace(/%/g,".*"),"i")),t.not_like!==void 0&&(o.$not=new RegExp(t.not_like.replace(/%/g,".*"),"i")),t.contains!==void 0&&(o.$regex=new RegExp(`.*${t.contains}.*`,"i")),t.exists!==void 0&&(o.$exists=t.exists),Object.keys(o).length>0&&(n[s==="id"?"_id":s]=o);}else n[s==="id"?"_id":s]=t;return n}buildProjection(i){if(!i||i.length===0)return;let e={_id:1};for(let n of i)e[n]=1;return e}processResult(i,e){if(!i)return null;let n={...i};return i._id&&(n.id=i._id,delete n._id),delete n.__v,n.createdAt&&(n.createdAt=new Date(n.createdAt).toISOString()),n.updatedAt&&(n.updatedAt=new Date(n.updatedAt).toISOString()),n}generateId(){let i=Date.now().toString(16).padStart(12,"0"),e=randomBytes(6).toString("hex");return i+e}};function F(w){return new _(w)}
|
|
2
|
+
export{_ as a,F as b};
|
package/dist/client.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var chunk2BTRHVT3_cjs=require('./chunk-2BTRHVT3.cjs'),
|
|
1
|
+
'use strict';var chunk2BTRHVT3_cjs=require('./chunk-2BTRHVT3.cjs'),chunkSK2Q4PRV_cjs=require('./chunk-SK2Q4PRV.cjs');require('./chunk-KD7LUCFY.cjs');var chunkHVXO3OFB_cjs=require('./chunk-HVXO3OFB.cjs');require('./chunk-AHSFSERC.cjs');Object.defineProperty(exports,"CSSGenerator",{enumerable:true,get:function(){return chunk2BTRHVT3_cjs.a}});Object.defineProperty(exports,"createAdminStyling",{enumerable:true,get:function(){return chunk2BTRHVT3_cjs.g}});Object.defineProperty(exports,"defaultDarkTheme",{enumerable:true,get:function(){return chunk2BTRHVT3_cjs.d}});Object.defineProperty(exports,"defaultFieldStyling",{enumerable:true,get:function(){return chunk2BTRHVT3_cjs.h}});Object.defineProperty(exports,"defaultLightTheme",{enumerable:true,get:function(){return chunk2BTRHVT3_cjs.c}});Object.defineProperty(exports,"ecommerce2026Theme",{enumerable:true,get:function(){return chunk2BTRHVT3_cjs.e}});Object.defineProperty(exports,"generateCSSVariables",{enumerable:true,get:function(){return chunk2BTRHVT3_cjs.f}});Object.defineProperty(exports,"generateTailwindConfig",{enumerable:true,get:function(){return chunk2BTRHVT3_cjs.b}});Object.defineProperty(exports,"renderRichText",{enumerable:true,get:function(){return chunkSK2Q4PRV_cjs.u}});Object.defineProperty(exports,"richTextStyles",{enumerable:true,get:function(){return chunkSK2Q4PRV_cjs.s}});Object.defineProperty(exports,"createAuditContext",{enumerable:true,get:function(){return chunkHVXO3OFB_cjs.a}});
|
package/dist/client.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { A as AdminConfig, a as AuthConfig, C as CollectionConfig, G as GlobalConfig, I as ImageSize, K as KyroConfig, U as UploadConfig, V as VersionConfig } from './types-
|
|
2
|
-
export { A as ArrayField, B as BaseField, a as Block, b as BlockAdmin, c as BlockImage, d as BlocksField, C as CheckboxField, e as CodeField, f as CollapsibleField, g as ColorField, D as DateField, h as DeclarativeCondition, E as EmailField, F as Field, i as FieldAdmin, j as FieldType, G as GroupField, I as ImageField, J as JSONField, M as MarkdownField, N as NumberField, P as PasswordField, R as RadioField, k as RelationshipField, l as RichTextBlock, m as RichTextField, n as RowField, S as SecretField, o as SelectField, T as TabsField, p as TextField, q as TextareaField, U as UploadField } from './types-
|
|
1
|
+
export { A as AdminConfig, a as AuthConfig, C as CollectionConfig, G as GlobalConfig, I as ImageSize, K as KyroConfig, U as UploadConfig, V as VersionConfig } from './types-BowAPGjD.cjs';
|
|
2
|
+
export { A as ArrayField, B as BaseField, a as Block, b as BlockAdmin, c as BlockImage, d as BlocksField, C as CheckboxField, e as CodeField, f as CollapsibleField, g as ColorField, D as DateField, h as DeclarativeCondition, E as EmailField, F as Field, i as FieldAdmin, j as FieldType, G as GroupField, I as ImageField, J as JSONField, M as MarkdownField, N as NumberField, P as PasswordField, R as RadioField, k as RelationshipField, l as RichTextBlock, m as RichTextField, n as RowField, S as SecretField, o as SelectField, T as TabsField, p as TextField, q as TextareaField, U as UploadField } from './types-fvldOd92.cjs';
|
|
3
3
|
export { r as renderRichText, a as richTextStyles } from './richtext-DrhORshE.cjs';
|
|
4
4
|
export { A as AuthAdapter, a as AuthResult, S as AuthSession, b as AuthTokenConfig, c as AuthUser, J as JWTPayload, L as LoginCredentials, R as RegisterData, S as Session, U as UserRole } from './types-CpjuXbe7.cjs';
|
|
5
5
|
export { A as AdminStylingConfig, C as CSSGenerator, F as FieldStyling, S as StylingConfig, a as StylingMode, T as ThemeBorderRadius, b as ThemeColors, c as ThemeConfig, d as ThemeFonts, e as ThemeShadows, f as ThemeSpacing, g as createAdminStyling, h as defaultDarkTheme, i as defaultFieldStyling, j as defaultLightTheme, k as ecommerce2026Theme, l as generateCSSVariables, m as generateTailwindConfig } from './index-Bz9JqRGI.cjs';
|
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { A as AdminConfig, a as AuthConfig, C as CollectionConfig, G as GlobalConfig, I as ImageSize, K as KyroConfig, U as UploadConfig, V as VersionConfig } from './types-
|
|
2
|
-
export { A as ArrayField, B as BaseField, a as Block, b as BlockAdmin, c as BlockImage, d as BlocksField, C as CheckboxField, e as CodeField, f as CollapsibleField, g as ColorField, D as DateField, h as DeclarativeCondition, E as EmailField, F as Field, i as FieldAdmin, j as FieldType, G as GroupField, I as ImageField, J as JSONField, M as MarkdownField, N as NumberField, P as PasswordField, R as RadioField, k as RelationshipField, l as RichTextBlock, m as RichTextField, n as RowField, S as SecretField, o as SelectField, T as TabsField, p as TextField, q as TextareaField, U as UploadField } from './types-
|
|
1
|
+
export { A as AdminConfig, a as AuthConfig, C as CollectionConfig, G as GlobalConfig, I as ImageSize, K as KyroConfig, U as UploadConfig, V as VersionConfig } from './types-Bj3d_ys8.js';
|
|
2
|
+
export { A as ArrayField, B as BaseField, a as Block, b as BlockAdmin, c as BlockImage, d as BlocksField, C as CheckboxField, e as CodeField, f as CollapsibleField, g as ColorField, D as DateField, h as DeclarativeCondition, E as EmailField, F as Field, i as FieldAdmin, j as FieldType, G as GroupField, I as ImageField, J as JSONField, M as MarkdownField, N as NumberField, P as PasswordField, R as RadioField, k as RelationshipField, l as RichTextBlock, m as RichTextField, n as RowField, S as SecretField, o as SelectField, T as TabsField, p as TextField, q as TextareaField, U as UploadField } from './types-fvldOd92.js';
|
|
3
3
|
export { r as renderRichText, a as richTextStyles } from './richtext-DrhORshE.js';
|
|
4
4
|
export { A as AuthAdapter, a as AuthResult, S as AuthSession, b as AuthTokenConfig, c as AuthUser, J as JWTPayload, L as LoginCredentials, R as RegisterData, S as Session, U as UserRole } from './types-CpjuXbe7.js';
|
|
5
5
|
export { A as AdminStylingConfig, C as CSSGenerator, F as FieldStyling, S as StylingConfig, a as StylingMode, T as ThemeBorderRadius, b as ThemeColors, c as ThemeConfig, d as ThemeFonts, e as ThemeShadows, f as ThemeSpacing, g as createAdminStyling, h as defaultDarkTheme, i as defaultFieldStyling, j as defaultLightTheme, k as ecommerce2026Theme, l as generateCSSVariables, m as generateTailwindConfig } from './index-Bz9JqRGI.js';
|
package/dist/client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as CSSGenerator,g as createAdminStyling,d as defaultDarkTheme,h as defaultFieldStyling,c as defaultLightTheme,e as ecommerce2026Theme,f as generateCSSVariables,b as generateTailwindConfig}from'./chunk-UHFDH3PG.js';export{
|
|
1
|
+
export{a as CSSGenerator,g as createAdminStyling,d as defaultDarkTheme,h as defaultFieldStyling,c as defaultLightTheme,e as ecommerce2026Theme,f as generateCSSVariables,b as generateTailwindConfig}from'./chunk-UHFDH3PG.js';export{u as renderRichText,s as richTextStyles}from'./chunk-INB4LNA6.js';import'./chunk-5SEHX7ON.js';export{a as createAuditContext}from'./chunk-NRLIGDYF.js';import'./chunk-5J6HXUF6.js';
|
package/dist/drizzle/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';require('../chunk-4ORJMSJU.cjs');var
|
|
1
|
+
'use strict';require('../chunk-4ORJMSJU.cjs');var chunk5KGQOTLK_cjs=require('../chunk-5KGQOTLK.cjs'),chunkGYQMNXXW_cjs=require('../chunk-GYQMNXXW.cjs');require('../chunk-MIOMMB23.cjs'),require('../chunk-EJDIR56C.cjs'),require('../chunk-Q3Q7BJVQ.cjs'),require('../chunk-AHSFSERC.cjs');Object.defineProperty(exports,"DrizzleAdapter",{enumerable:true,get:function(){return chunk5KGQOTLK_cjs.c}});Object.defineProperty(exports,"collectionToDrizzleSchema",{enumerable:true,get:function(){return chunk5KGQOTLK_cjs.b}});Object.defineProperty(exports,"createDatabase",{enumerable:true,get:function(){return chunk5KGQOTLK_cjs.f}});Object.defineProperty(exports,"createDrizzleAdapter",{enumerable:true,get:function(){return chunk5KGQOTLK_cjs.d}});Object.defineProperty(exports,"fieldToDrizzleType",{enumerable:true,get:function(){return chunk5KGQOTLK_cjs.a}});Object.defineProperty(exports,"runMigrations",{enumerable:true,get:function(){return chunk5KGQOTLK_cjs.g}});Object.defineProperty(exports,"seedDefaultRoles",{enumerable:true,get:function(){return chunk5KGQOTLK_cjs.h}});Object.defineProperty(exports,"PostgresAuthAdapter",{enumerable:true,get:function(){return chunkGYQMNXXW_cjs.a}});
|
package/dist/drizzle/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as AbstractBaseAdapter } from '../base-
|
|
2
|
-
import { C as CollectionConfig, G as GlobalConfig, F as FindArgs, b as FindResult, c as FindByIDArgs, d as CreateArgs, e as UpdateArgs, D as DeleteArgs } from '../types-
|
|
3
|
-
import { F as Field } from '../types-
|
|
1
|
+
import { A as AbstractBaseAdapter } from '../base-Dk6eKGJJ.cjs';
|
|
2
|
+
import { C as CollectionConfig, G as GlobalConfig, F as FindArgs, b as FindResult, c as FindByIDArgs, d as CreateArgs, e as UpdateArgs, D as DeleteArgs } from '../types-BowAPGjD.cjs';
|
|
3
|
+
import { F as Field } from '../types-fvldOd92.cjs';
|
|
4
4
|
import { PostgresJsDatabase } from 'drizzle-orm/postgres-js';
|
|
5
5
|
import { A as AuthAdapter, U as UserRole, c as AuthUser, S as Session, e as AuditLogFilter, d as AuditLog } from '../types-CpjuXbe7.cjs';
|
|
6
6
|
|
|
@@ -37,19 +37,19 @@ declare class DrizzleAdapter extends AbstractBaseAdapter {
|
|
|
37
37
|
count(args: {
|
|
38
38
|
collection: string;
|
|
39
39
|
where?: Record<string, any>;
|
|
40
|
-
|
|
40
|
+
tenantId?: string;
|
|
41
41
|
}): Promise<number>;
|
|
42
42
|
findOne(args: {
|
|
43
43
|
collection: string;
|
|
44
44
|
where: Record<string, any>;
|
|
45
|
-
|
|
45
|
+
tenantId?: string;
|
|
46
46
|
draft?: boolean;
|
|
47
47
|
}): Promise<any>;
|
|
48
48
|
findVersions(args: any): Promise<FindResult<any>>;
|
|
49
49
|
findVersionByID(args: {
|
|
50
50
|
collection: string;
|
|
51
51
|
versionId: string;
|
|
52
|
-
|
|
52
|
+
tenantId?: string;
|
|
53
53
|
}): Promise<any>;
|
|
54
54
|
createVersion(args: any): Promise<any>;
|
|
55
55
|
updateLatestVersion(args: any): Promise<any>;
|
|
@@ -57,7 +57,7 @@ declare class DrizzleAdapter extends AbstractBaseAdapter {
|
|
|
57
57
|
collection: string;
|
|
58
58
|
documentId: string;
|
|
59
59
|
keepLatest?: number;
|
|
60
|
-
|
|
60
|
+
tenantId?: string;
|
|
61
61
|
}): Promise<void>;
|
|
62
62
|
private getTable;
|
|
63
63
|
private buildWhereClause;
|
package/dist/drizzle/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as AbstractBaseAdapter } from '../base-
|
|
2
|
-
import { C as CollectionConfig, G as GlobalConfig, F as FindArgs, b as FindResult, c as FindByIDArgs, d as CreateArgs, e as UpdateArgs, D as DeleteArgs } from '../types-
|
|
3
|
-
import { F as Field } from '../types-
|
|
1
|
+
import { A as AbstractBaseAdapter } from '../base-BKGB0Y3W.js';
|
|
2
|
+
import { C as CollectionConfig, G as GlobalConfig, F as FindArgs, b as FindResult, c as FindByIDArgs, d as CreateArgs, e as UpdateArgs, D as DeleteArgs } from '../types-Bj3d_ys8.js';
|
|
3
|
+
import { F as Field } from '../types-fvldOd92.js';
|
|
4
4
|
import { PostgresJsDatabase } from 'drizzle-orm/postgres-js';
|
|
5
5
|
import { A as AuthAdapter, U as UserRole, c as AuthUser, S as Session, e as AuditLogFilter, d as AuditLog } from '../types-CpjuXbe7.js';
|
|
6
6
|
|
|
@@ -37,19 +37,19 @@ declare class DrizzleAdapter extends AbstractBaseAdapter {
|
|
|
37
37
|
count(args: {
|
|
38
38
|
collection: string;
|
|
39
39
|
where?: Record<string, any>;
|
|
40
|
-
|
|
40
|
+
tenantId?: string;
|
|
41
41
|
}): Promise<number>;
|
|
42
42
|
findOne(args: {
|
|
43
43
|
collection: string;
|
|
44
44
|
where: Record<string, any>;
|
|
45
|
-
|
|
45
|
+
tenantId?: string;
|
|
46
46
|
draft?: boolean;
|
|
47
47
|
}): Promise<any>;
|
|
48
48
|
findVersions(args: any): Promise<FindResult<any>>;
|
|
49
49
|
findVersionByID(args: {
|
|
50
50
|
collection: string;
|
|
51
51
|
versionId: string;
|
|
52
|
-
|
|
52
|
+
tenantId?: string;
|
|
53
53
|
}): Promise<any>;
|
|
54
54
|
createVersion(args: any): Promise<any>;
|
|
55
55
|
updateLatestVersion(args: any): Promise<any>;
|
|
@@ -57,7 +57,7 @@ declare class DrizzleAdapter extends AbstractBaseAdapter {
|
|
|
57
57
|
collection: string;
|
|
58
58
|
documentId: string;
|
|
59
59
|
keepLatest?: number;
|
|
60
|
-
|
|
60
|
+
tenantId?: string;
|
|
61
61
|
}): Promise<void>;
|
|
62
62
|
private getTable;
|
|
63
63
|
private buildWhereClause;
|
package/dist/drizzle/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import'../chunk-PP5S2UBV.js';export{c as DrizzleAdapter,b as collectionToDrizzleSchema,f as createDatabase,d as createDrizzleAdapter,a as fieldToDrizzleType,g as runMigrations,h as seedDefaultRoles}from'../chunk-
|
|
1
|
+
import'../chunk-PP5S2UBV.js';export{c as DrizzleAdapter,b as collectionToDrizzleSchema,f as createDatabase,d as createDrizzleAdapter,a as fieldToDrizzleType,g as runMigrations,h as seedDefaultRoles}from'../chunk-76RLJA6S.js';export{a as PostgresAuthAdapter}from'../chunk-RHCWCG3O.js';import'../chunk-OG7CNQGU.js';import'../chunk-TQNM4C7H.js';import'../chunk-KDNYHLD2.js';import'../chunk-5J6HXUF6.js';
|
package/dist/fields/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkSK2Q4PRV_cjs=require('../chunk-SK2Q4PRV.cjs'),chunkKD7LUCFY_cjs=require('../chunk-KD7LUCFY.cjs');require('../chunk-AHSFSERC.cjs');Object.defineProperty(exports,"ALL_FIELD_TYPES",{enumerable:true,get:function(){return chunkSK2Q4PRV_cjs.q}});Object.defineProperty(exports,"COMPLEX_FIELD_TYPES",{enumerable:true,get:function(){return chunkSK2Q4PRV_cjs.n}});Object.defineProperty(exports,"LAYOUT_FIELD_TYPES",{enumerable:true,get:function(){return chunkSK2Q4PRV_cjs.p}});Object.defineProperty(exports,"PRIMITIVE_FIELD_TYPES",{enumerable:true,get:function(){return chunkSK2Q4PRV_cjs.m}});Object.defineProperty(exports,"RELATIONAL_FIELD_TYPES",{enumerable:true,get:function(){return chunkSK2Q4PRV_cjs.o}});Object.defineProperty(exports,"createRelationshipFieldConfig",{enumerable:true,get:function(){return chunkSK2Q4PRV_cjs.r}});Object.defineProperty(exports,"isArrayField",{enumerable:true,get:function(){return chunkSK2Q4PRV_cjs.d}});Object.defineProperty(exports,"isBlocksField",{enumerable:true,get:function(){return chunkSK2Q4PRV_cjs.f}});Object.defineProperty(exports,"isGroupField",{enumerable:true,get:function(){return chunkSK2Q4PRV_cjs.e}});Object.defineProperty(exports,"isIconField",{enumerable:true,get:function(){return chunkSK2Q4PRV_cjs.l}});Object.defineProperty(exports,"isImageField",{enumerable:true,get:function(){return chunkSK2Q4PRV_cjs.h}});Object.defineProperty(exports,"isLayoutField",{enumerable:true,get:function(){return chunkSK2Q4PRV_cjs.k}});Object.defineProperty(exports,"isNumberField",{enumerable:true,get:function(){return chunkSK2Q4PRV_cjs.b}});Object.defineProperty(exports,"isRelationshipField",{enumerable:true,get:function(){return chunkSK2Q4PRV_cjs.c}});Object.defineProperty(exports,"isRichTextField",{enumerable:true,get:function(){return chunkSK2Q4PRV_cjs.i}});Object.defineProperty(exports,"isSelectField",{enumerable:true,get:function(){return chunkSK2Q4PRV_cjs.j}});Object.defineProperty(exports,"isTextField",{enumerable:true,get:function(){return chunkSK2Q4PRV_cjs.a}});Object.defineProperty(exports,"isUploadField",{enumerable:true,get:function(){return chunkSK2Q4PRV_cjs.g}});Object.defineProperty(exports,"normalizeRichTextValue",{enumerable:true,get:function(){return chunkSK2Q4PRV_cjs.t}});Object.defineProperty(exports,"renderRichText",{enumerable:true,get:function(){return chunkSK2Q4PRV_cjs.u}});Object.defineProperty(exports,"richTextStyles",{enumerable:true,get:function(){return chunkSK2Q4PRV_cjs.s}});Object.defineProperty(exports,"generateSEOFields",{enumerable:true,get:function(){return chunkKD7LUCFY_cjs.a}});
|
package/dist/fields/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as Field } from '../types-
|
|
2
|
-
export { r as ALL_FIELD_TYPES, s as ActionField, A as ArrayField, B as BaseField, a as Block, b as BlockAdmin, c as BlockImage, d as BlocksField, t as ButtonField, u as COMPLEX_FIELD_TYPES, C as CheckboxField, e as CodeField, f as CollapsibleField, g as ColorField, D as DateField, h as DeclarativeCondition, E as EmailField, i as FieldAdmin, j as FieldType, G as GroupField, H as Hook, I as ImageField, J as JSONField, L as LAYOUT_FIELD_TYPES,
|
|
1
|
+
import { F as Field } from '../types-fvldOd92.cjs';
|
|
2
|
+
export { r as ALL_FIELD_TYPES, s as ActionField, A as ArrayField, B as BaseField, a as Block, b as BlockAdmin, c as BlockImage, d as BlocksField, t as ButtonField, u as COMPLEX_FIELD_TYPES, C as CheckboxField, e as CodeField, f as CollapsibleField, g as ColorField, D as DateField, h as DeclarativeCondition, E as EmailField, i as FieldAdmin, j as FieldType, G as GroupField, H as Hook, v as IconField, I as ImageField, J as JSONField, L as LAYOUT_FIELD_TYPES, w as ListField, M as MarkdownField, N as NumberField, x as PRIMITIVE_FIELD_TYPES, P as PasswordField, y as RELATIONAL_FIELD_TYPES, R as RadioField, k as RelationshipField, l as RichTextBlock, m as RichTextField, n as RowField, S as SecretField, o as SelectField, T as TabsField, p as TextField, z as TextFieldVariant, q as TextareaField, U as UploadField, V as ValidateOptions, K as createRelationshipFieldConfig, O as isArrayField, Q as isBlocksField, W as isGroupField, X as isIconField, Y as isImageField, Z as isLayoutField, _ as isNumberField, $ as isRelationshipField, a0 as isRichTextField, a1 as isSelectField, a2 as isTextField, a3 as isUploadField } from '../types-fvldOd92.cjs';
|
|
3
3
|
export { n as normalizeRichTextValue, r as renderRichText, a as richTextStyles } from '../richtext-DrhORshE.cjs';
|
|
4
4
|
|
|
5
5
|
declare function generateSEOFields(): Field;
|
package/dist/fields/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as Field } from '../types-
|
|
2
|
-
export { r as ALL_FIELD_TYPES, s as ActionField, A as ArrayField, B as BaseField, a as Block, b as BlockAdmin, c as BlockImage, d as BlocksField, t as ButtonField, u as COMPLEX_FIELD_TYPES, C as CheckboxField, e as CodeField, f as CollapsibleField, g as ColorField, D as DateField, h as DeclarativeCondition, E as EmailField, i as FieldAdmin, j as FieldType, G as GroupField, H as Hook, I as ImageField, J as JSONField, L as LAYOUT_FIELD_TYPES,
|
|
1
|
+
import { F as Field } from '../types-fvldOd92.js';
|
|
2
|
+
export { r as ALL_FIELD_TYPES, s as ActionField, A as ArrayField, B as BaseField, a as Block, b as BlockAdmin, c as BlockImage, d as BlocksField, t as ButtonField, u as COMPLEX_FIELD_TYPES, C as CheckboxField, e as CodeField, f as CollapsibleField, g as ColorField, D as DateField, h as DeclarativeCondition, E as EmailField, i as FieldAdmin, j as FieldType, G as GroupField, H as Hook, v as IconField, I as ImageField, J as JSONField, L as LAYOUT_FIELD_TYPES, w as ListField, M as MarkdownField, N as NumberField, x as PRIMITIVE_FIELD_TYPES, P as PasswordField, y as RELATIONAL_FIELD_TYPES, R as RadioField, k as RelationshipField, l as RichTextBlock, m as RichTextField, n as RowField, S as SecretField, o as SelectField, T as TabsField, p as TextField, z as TextFieldVariant, q as TextareaField, U as UploadField, V as ValidateOptions, K as createRelationshipFieldConfig, O as isArrayField, Q as isBlocksField, W as isGroupField, X as isIconField, Y as isImageField, Z as isLayoutField, _ as isNumberField, $ as isRelationshipField, a0 as isRichTextField, a1 as isSelectField, a2 as isTextField, a3 as isUploadField } from '../types-fvldOd92.js';
|
|
3
3
|
export { n as normalizeRichTextValue, r as renderRichText, a as richTextStyles } from '../richtext-DrhORshE.js';
|
|
4
4
|
|
|
5
5
|
declare function generateSEOFields(): Field;
|
package/dist/fields/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{q as ALL_FIELD_TYPES,n as COMPLEX_FIELD_TYPES,p as LAYOUT_FIELD_TYPES,m as PRIMITIVE_FIELD_TYPES,o as RELATIONAL_FIELD_TYPES,r as createRelationshipFieldConfig,d as isArrayField,f as isBlocksField,e as isGroupField,l as isIconField,h as isImageField,k as isLayoutField,b as isNumberField,c as isRelationshipField,i as isRichTextField,j as isSelectField,a as isTextField,g as isUploadField,t as normalizeRichTextValue,u as renderRichText,s as richTextStyles}from'../chunk-INB4LNA6.js';export{a as generateSEOFields}from'../chunk-5SEHX7ON.js';import'../chunk-5J6HXUF6.js';
|
package/dist/graphql/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkHS2KNFAB_cjs=require('../chunk-HS2KNFAB.cjs');require('../chunk-NY47CFVP.cjs'),require('../chunk-Q3Q7BJVQ.cjs'),require('../chunk-AHSFSERC.cjs');Object.defineProperty(exports,"RelationLoader",{enumerable:true,get:function(){return chunkHS2KNFAB_cjs.a}});Object.defineProperty(exports,"buildGraphQLSchema",{enumerable:true,get:function(){return chunkHS2KNFAB_cjs.c}});Object.defineProperty(exports,"createGraphQLSchema",{enumerable:true,get:function(){return chunkHS2KNFAB_cjs.d}});Object.defineProperty(exports,"depthLimit",{enumerable:true,get:function(){return chunkHS2KNFAB_cjs.b}});Object.defineProperty(exports,"printSchema",{enumerable:true,get:function(){return chunkHS2KNFAB_cjs.e}});
|