@kyro-cms/core 0.10.17 → 0.10.20
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-DpRB940h.d.ts → WebhookService-DREfF5Hm.d.ts} +1 -1
- package/dist/{WebhookService-Dj8pJ3sp.d.cts → WebhookService-Di_wX9gK.d.cts} +1 -1
- 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-BjyoF6da.d.cts → base-CH7d01Yw.d.cts} +2 -2
- package/dist/{base-C2YR8lWt.d.ts → base-DRK_7V46.d.ts} +2 -2
- package/dist/chunk-3RU6COLP.js +21 -0
- package/dist/chunk-4YYBWCDJ.js +1 -0
- package/dist/chunk-AG5BPMS5.js +86 -0
- package/dist/chunk-AWDITIFN.js +1 -0
- package/dist/chunk-BRJ77NA4.cjs +1 -0
- package/dist/{chunk-44TYUUC6.cjs → chunk-DAQ2HLAB.cjs} +1 -1
- package/dist/chunk-HFU3VAUC.js +2 -0
- package/dist/{chunk-N3PMDG7U.js → chunk-IH6MAFNI.js} +1 -1
- package/dist/{chunk-VKXQUYYV.js → chunk-MBUUNROA.js} +14 -14
- package/dist/chunk-OO6WEHO2.cjs +3 -0
- package/dist/chunk-PCEJHAJD.js +3 -0
- package/dist/chunk-QVQNJPIZ.cjs +21 -0
- package/dist/chunk-T7IBSF5R.cjs +2 -0
- package/dist/chunk-TYOVXKQP.js +2 -0
- package/dist/chunk-U6R2W2SL.js +1 -0
- package/dist/chunk-V3M6TGVT.cjs +86 -0
- package/dist/chunk-V6LRMDKN.cjs +1 -0
- package/dist/chunk-W4ZDETHA.cjs +1 -0
- package/dist/chunk-WMY7BDPK.cjs +2 -0
- package/dist/{chunk-6CLRVJPP.cjs → chunk-X3RRRWIN.cjs} +14 -14
- package/dist/cli/index.cjs +3 -3
- package/dist/cli/index.js +3 -3
- package/dist/client.d.cts +2 -2
- package/dist/client.d.ts +2 -2
- package/dist/drizzle/index.cjs +1 -1
- package/dist/drizzle/index.d.cts +3 -3
- package/dist/drizzle/index.d.ts +3 -3
- package/dist/drizzle/index.js +1 -1
- package/dist/fields/index.d.cts +1 -1
- package/dist/fields/index.d.ts +1 -1
- package/dist/graphql/index.cjs +1 -1
- package/dist/graphql/index.d.cts +3 -3
- package/dist/graphql/index.d.ts +3 -3
- package/dist/graphql/index.js +1 -1
- package/dist/{index-DuuUzWBq.d.cts → index-B52AAXcJ.d.cts} +2 -2
- package/dist/{index-DXr33e0x.d.ts → index-BTFBhepB.d.ts} +2 -2
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +9 -9
- package/dist/index.d.ts +9 -9
- package/dist/index.js +1 -1
- package/dist/mongodb/index.cjs +1 -1
- package/dist/mongodb/index.d.cts +3 -3
- package/dist/mongodb/index.d.ts +3 -3
- package/dist/mongodb/index.js +1 -1
- package/dist/rest/index.cjs +1 -1
- package/dist/rest/index.d.cts +4 -4
- package/dist/rest/index.d.ts +4 -4
- 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 +3 -3
- package/dist/trpc/index.d.ts +3 -3
- package/dist/trpc/index.js +1 -1
- package/dist/{types-BzH3_rtP.d.ts → types-BH7tjlpR.d.ts} +1 -1
- package/dist/{types-CY_iNunL.d.cts → types-BMu-234T.d.cts} +1 -1
- package/dist/{types-C_rVxU2T.d.cts → types-C9izrwhZ.d.cts} +4 -0
- package/dist/{types-C_rVxU2T.d.ts → types-C9izrwhZ.d.ts} +4 -0
- package/package.json +1 -1
- package/dist/chunk-3RUOCZ4Y.cjs +0 -3
- package/dist/chunk-7N6NKCRT.js +0 -1
- package/dist/chunk-CIE3XMLH.cjs +0 -2
- package/dist/chunk-CVVW4LXZ.cjs +0 -1
- package/dist/chunk-DV4LFLPL.cjs +0 -1
- package/dist/chunk-G3DZDZIP.js +0 -86
- package/dist/chunk-G6A7OSIG.js +0 -2
- package/dist/chunk-IGLFKSXH.cjs +0 -21
- package/dist/chunk-ISWMETHJ.cjs +0 -1
- package/dist/chunk-PDSHJVCT.cjs +0 -86
- package/dist/chunk-R6UUTH3T.js +0 -2
- package/dist/chunk-S5SJ2ARG.js +0 -3
- package/dist/chunk-SB33D472.js +0 -21
- package/dist/chunk-UDSJGML2.cjs +0 -2
- package/dist/chunk-UVTS2IWM.js +0 -1
- package/dist/chunk-ZAQOSRP6.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
'use strict';var
|
|
2
|
-
`)}var
|
|
1
|
+
'use strict';var chunkW4ZDETHA_cjs=require('./chunk-W4ZDETHA.cjs'),drizzleOrm=require('drizzle-orm'),pgCore=require('drizzle-orm/pg-core'),sqliteCore=require('drizzle-orm/sqlite-core'),postgresJs=require('drizzle-orm/postgres-js'),oe=require('postgres'),crypto=require('crypto'),promises=require('fs/promises'),path=require('path'),module$1=require('module');var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var oe__default=/*#__PURE__*/_interopDefault(oe);var M=false;function D(p,s="postgres"){switch(p.type){case "text":case "email":case "password":case "color":return s==="sqlite"?"text":"varchar";case "textarea":case "code":case "markdown":case "secret":return "text";case "number":return p.integer?"integer":"decimal";case "checkbox":return "boolean";case "date":return "timestamp";case "select":case "radio":return s==="sqlite"?"text":"varchar";case "richtext":case "json":case "array":case "group":case "blocks":case "row":case "collapsible":case "tabs":return "jsonb";case "relationship":return s==="sqlite"?"text":"varchar";case "upload":return "jsonb";default:return "jsonb"}}function Ae(p,s="postgres"){let n=p.slug.replace(/-/g,"_"),e=[];e.push(`export const ${n} = pgTable('${n}', {`),e.push(" id: uuid('id').primaryKey().defaultRandom(),");for(let t of p.fields){if(t.name==="id")continue;let o=D(t,s),r=t.required,a=` ${t.name}: pg.${o}('${t.name}')`;t.unique&&(a+=".unique()"),r||(a+=".nullable()"),t.defaultValue!==void 0&&(typeof t.defaultValue=="string"?a+=`.default('${t.defaultValue}')`:typeof t.defaultValue=="boolean"?a+=`.default(${t.defaultValue})`:a+=`.default(sql\`${JSON.stringify(t.defaultValue)}\`)`),a+=",",e.push(a);}return p.timestamps&&(e.push(" createdAt: pg.timestamp('created_at').defaultNow(),"),e.push(" updatedAt: pg.timestamp('updated_at').defaultNow(),")),e.push(` status: ${s==="sqlite"?"sqlite":"pg"}.varchar('status').default('draft'),`),e.push(` hasDraft: ${s==="sqlite"?"sqlite":"pg"}.boolean('hasDraft').default(false),`),e.push("});"),e.join(`
|
|
2
|
+
`)}var S=class extends chunkW4ZDETHA_cjs.a{client;schema;dialect;connectionString;versionsTableReady=false;constructor(s){if(super(),this.schema=s.schema||{},s.connectionString){this.connectionString=s.connectionString;let n=s.connectionString.toLowerCase();n.startsWith("postgres://")||n.startsWith("postgresql://")?this.dialect="postgres":n.includes(".db")||n.includes("sqlite")||n.includes("file:")?this.dialect="sqlite":this.dialect=s.type||"postgres";}else this.client=s.client,this.dialect=s.type||"sqlite";}prepareData(s,n){let e=super.prepareData(s,n);e.createdAt&&typeof e.createdAt=="string"&&(e.createdAt=new Date(e.createdAt)),e.updatedAt&&typeof e.updatedAt=="string"&&(e.updatedAt=new Date(e.updatedAt));for(let t of n.fields)if(t.type==="date"&&t.name){let o=e[t.name];o&&typeof o=="string"&&(e[t.name]=new Date(o));}for(let t of n.fields){let r=D(t,this.dialect)==="jsonb";if(t.type==="tabs"&&"tabs"in t&&t.name){let a=s[t.name];if(a&&typeof a=="object"){let i={};for(let[c,u]of Object.entries(a)){let d=t.tabs.flatMap(h=>h.fields).find(h=>h.name===c);(d?.type==="upload"||d?.type==="image"||d?.type==="list"||d?.type==="relationship-block")&&u?i[c]=Array.isArray(u)||typeof u=="object"?JSON.stringify(u):u:i[c]=u;}e[t.name]=r?i:JSON.stringify(i);}}if((t.type==="upload"||t.type==="image"||t.type==="list"||t.type==="relationship-block")&&t.name){let a=s[t.name];a&&(e[t.name]=r?a:Array.isArray(a)||typeof a=="object"?JSON.stringify(a):a);}}for(let t of n.fields)if(t.name&&e[t.name]===""){let o=D(t,this.dialect);(o==="timestamp"||o==="jsonb"||o==="decimal"||o==="integer"||o==="numeric"||o==="boolean")&&(e[t.name]=null);}return e}async connect(){if(this.connectionString&&!this.client){if(this.dialect==="postgres"){let{default:s}=await import('postgres'),{drizzle:n}=await import('drizzle-orm/postgres-js'),e=s(this.connectionString,{onnotice:()=>{}});this.client=n(e,{schema:this.schema});}else if(this.dialect==="sqlite"){let{default:s}=await import('better-sqlite3'),{drizzle:n}=await import('drizzle-orm/better-sqlite3'),e=new s(this.connectionString.replace("file:",""));this.client=n(e,{schema:this.schema});}}this.connected=true;}async init(s,n=[]){if(await super.init(s,n),this.connectionString&&!this.client&&await this.connect(),this.client&&!M){for(let t of s){let o=this.getTableName(t.slug);this.schema[o]||(this.schema[o]=this.createTableFromConfig(t));}await this.ensureCollectionTables(s);let e=n.map(t=>({slug:`_globals_${t.slug}`,fields:t.fields,label:t.label}));for(let t of e){let o=this.getTableName(t.slug);this.schema[o]||(this.schema[o]=this.createTableFromConfig(t,true)),this.collections.has(t.slug)||this.collections.set(t.slug,t);}await this.ensureCollectionTables(e),M=true;}}createTableFromConfig(s,n=false){let e=this.getTableName(s.slug),t={id:n?pgCore.text("id").primaryKey():pgCore.uuid("id").primaryKey().defaultRandom()};for(let o of s.fields){if(!o.name||o.name==="id")continue;let r=D(o,this.dialect),a=o.name.replace(/-/g,"_"),i=a.replace(/([A-Z])/g,"_$1").toLowerCase(),c;if(this.dialect==="sqlite")switch(r){case "varchar":case "text":c=sqliteCore.text(i);break;case "integer":c=sqliteCore.integer(i);break;case "decimal":case "numeric":c=sqliteCore.numeric(i);break;case "boolean":c=sqliteCore.integer(i,{mode:"boolean"});break;case "timestamp":c=sqliteCore.text(i);break;case "jsonb":c=sqliteCore.text(i);break;default:c=sqliteCore.text(i);}else switch(r){case "varchar":c=pgCore.varchar(i,{length:255});break;case "integer":c=pgCore.integer(i);break;case "decimal":c=pgCore.decimal(i);break;case "boolean":c=pgCore.boolean(i);break;case "timestamp":c=pgCore.timestamp(i);break;case "jsonb":c=pgCore.jsonb(i);break;default:c=pgCore.text(i);}o.required||(c=c.default(null)),t[a]=c;}return t.createdAt||(t.createdAt=this.dialect==="sqlite"?sqliteCore.text("created_at").default(new Date().toISOString()):pgCore.timestamp("created_at").defaultNow()),t.updatedAt||(t.updatedAt=this.dialect==="sqlite"?sqliteCore.text("updated_at").default(new Date().toISOString()):pgCore.timestamp("updated_at").defaultNow()),t.status=this.dialect==="sqlite"?sqliteCore.text("status").default("draft"):pgCore.varchar("status",{length:20}).default("draft"),t.hasDraft=this.dialect==="sqlite"?sqliteCore.integer("hasDraft",{mode:"boolean"}).default(false):pgCore.boolean("hasDraft").default(false),this.dialect==="sqlite"?sqliteCore.sqliteTable(e,t):pgCore.pgTable(e,t)}async ensureCollectionTables(s){let n=[];for(let e of s){let t=e.slug.startsWith("_globals_"),o=this.getTableName(e.slug),r=this.generateCreateColumns(e),a=e.fields.some(d=>d.name==="createdAt"),i=e.fields.some(d=>d.name==="updatedAt"),c=e.fields.some(d=>d.name==="status"),u=e.fields.some(d=>d.name==="hasDraft");if(this.dialect==="postgres"){let d=t?'"id" TEXT PRIMARY KEY':'"id" UUID PRIMARY KEY DEFAULT gen_random_uuid()';n.push(`
|
|
3
3
|
CREATE TABLE IF NOT EXISTS "${o}" (
|
|
4
|
-
${
|
|
4
|
+
${d},
|
|
5
5
|
${r}
|
|
6
6
|
${a?"":'"created_at" TIMESTAMP NOT NULL DEFAULT NOW(),'}
|
|
7
7
|
${i?"":'"updated_at" TIMESTAMP NOT NULL DEFAULT NOW(),'}
|
|
@@ -18,27 +18,27 @@
|
|
|
18
18
|
${u?"":'"hasDraft" INTEGER DEFAULT 0'}
|
|
19
19
|
)
|
|
20
20
|
`);}if(n.length>0)if(this.dialect==="postgres")await this.client.execute(drizzleOrm.sql.raw(n.join(`;
|
|
21
|
-
`)));else for(let e of n)await this.client.execute(drizzleOrm.sql.raw(e));for(let e of s){let t=this.getTableName(e.slug);t==="users"||t==="audit_logs"||await this.syncTableColumns(e,t);}}getColumnSqlDefinition(s,n){let e=
|
|
22
|
-
`)));}if(this.dialect==="postgres")for(let r of s.fields){if(!r.name||r.name==="id")continue;let a=
|
|
23
|
-
`)+(n.length>0?",":"")}async disconnect(){this.connected=false;}async find(s){let{collection:n,where:e={},sort:t,limit:o=10,page:r=1,tenantID:a,select:i,draft:c}=s,u=this.getCollection(n),
|
|
21
|
+
`)));else for(let e of n)await this.client.execute(drizzleOrm.sql.raw(e));for(let e of s){let t=this.getTableName(e.slug);t==="users"||t==="audit_logs"||await this.syncTableColumns(e,t);}}getColumnSqlDefinition(s,n){let e=D(s,n),t=s.name.replace(/-/g,"_").replace(/([A-Z])/g,"_$1").toLowerCase(),o=this.columnSqlType(e,n);return `"${t}" ${o} DEFAULT NULL`}columnSqlType(s,n){if(n==="sqlite")switch(s){case "varchar":return "TEXT";case "text":return "TEXT";case "integer":return "INTEGER";case "decimal":case "numeric":return "NUMERIC";case "boolean":return "INTEGER";case "timestamp":return "TEXT";case "jsonb":return "TEXT";default:return "TEXT"}switch(s){case "varchar":return "VARCHAR(255)";case "text":return "TEXT";case "integer":return "INTEGER";case "decimal":case "numeric":return "DECIMAL";case "boolean":return "BOOLEAN";case "timestamp":return "TIMESTAMP";case "jsonb":return "JSONB";default:return "TEXT"}}getExpectedColumnDefs(s,n){let e={},t=s.slug.startsWith("_globals_"),o=s.fields.some(c=>c.name==="createdAt"),r=s.fields.some(c=>c.name==="updatedAt"),a=s.fields.some(c=>c.name==="status"),i=s.fields.some(c=>c.name==="hasDraft");this.dialect==="postgres"?(e.id=t?'"id" TEXT PRIMARY KEY':'"id" UUID PRIMARY KEY DEFAULT gen_random_uuid()',o||(e.created_at='"created_at" TIMESTAMP DEFAULT NULL'),r||(e.updated_at='"updated_at" TIMESTAMP DEFAULT NULL'),a||(e.status='"status" VARCHAR(20) DEFAULT NULL'),i||(e.hasDraft='"hasDraft" BOOLEAN DEFAULT NULL')):(e.id='"id" TEXT PRIMARY KEY',o||(e.created_at='"created_at" TEXT DEFAULT NULL'),r||(e.updated_at='"updated_at" TEXT DEFAULT NULL'),a||(e.status='"status" TEXT DEFAULT NULL'),i||(e.hasDraft='"hasDraft" INTEGER DEFAULT NULL'));for(let c of s.fields){if(!c.name||c.name==="id")continue;let u=this.getColumnSqlDefinition(c,this.dialect),d=c.name.replace(/-/g,"_").replace(/([A-Z])/g,"_$1").toLowerCase();e[d]=u;}return e}async syncTableColumns(s,n){let e;try{if(this.dialect==="postgres"){let r=await this.client.execute(drizzleOrm.sql`SELECT column_name, data_type, character_maximum_length FROM information_schema.columns WHERE table_name = ${n}`);e=new Map(r.map(a=>[a.column_name,{type:a.data_type,maxLen:a.character_maximum_length}]));}else {let r=await this.client.execute(drizzleOrm.sql`PRAGMA table_info("${drizzleOrm.sql.raw(n)}")`);e=new Map(r.map(a=>[a.name,{type:a.type,maxLen:null}]));}}catch{return}let t=this.getExpectedColumnDefs(s,n),o=Object.keys(t).filter(r=>!e.has(r));if(o.length>0){let r=o.map(a=>`ALTER TABLE "${n}" ADD COLUMN ${t[a]}`);await this.executeRaw(drizzleOrm.sql.raw(r.join(`;
|
|
22
|
+
`)));}if(this.dialect==="postgres")for(let r of s.fields){if(!r.name||r.name==="id")continue;let a=D(r,this.dialect),i=r.name.replace(/-/g,"_").replace(/([A-Z])/g,"_$1").toLowerCase(),c=e.get(i);!c||c.type!=="character varying"||(a==="text"?await this.executeRaw(drizzleOrm.sql.raw(`ALTER TABLE "${n}" ALTER COLUMN "${i}" TYPE TEXT`)):a==="jsonb"&&(await this.executeRaw(drizzleOrm.sql.raw(`ALTER TABLE "${n}" ALTER COLUMN "${i}" DROP DEFAULT`)),await this.executeRaw(drizzleOrm.sql.raw(`ALTER TABLE "${n}" ALTER COLUMN "${i}" TYPE JSONB USING (CASE WHEN "${i}" IS NULL THEN NULL WHEN "${i}"::text ~ '^\\s*\\{' THEN "${i}"::jsonb ELSE jsonb_build_object('id', "${i}"::text) END)`))));}}generateCreateColumns(s){let n=[];for(let e of s.fields){if(!e.name||e.name==="id")continue;let t=D(e,this.dialect),o=e.name.replace(/-/g,"_").replace(/([A-Z])/g,"_$1").toLowerCase(),r=e.required?"NOT NULL":"DEFAULT NULL",a;if(this.dialect==="sqlite")switch(t){case "varchar":case "text":a=`TEXT ${r}`;break;case "integer":a=`INTEGER ${r}`;break;case "decimal":case "numeric":a=`NUMERIC ${r}`;break;case "boolean":a=`INTEGER ${r}`;break;case "timestamp":a=`TEXT ${r}`;break;case "jsonb":a=`TEXT ${r}`;break;default:a=`TEXT ${r}`;}else switch(t){case "varchar":a=`VARCHAR(255) ${r}`;break;case "integer":a=`INTEGER ${r}`;break;case "decimal":a=`DECIMAL ${r}`;break;case "boolean":a=`BOOLEAN ${r}`;break;case "timestamp":a=`TIMESTAMP ${r}`;break;case "jsonb":a=`JSONB ${r}`;break;default:a=`TEXT ${r}`;}n.push(`"${o}" ${a}`);}return n.join(`,
|
|
23
|
+
`)+(n.length>0?",":"")}async disconnect(){this.connected=false;}async find(s){let{collection:n,where:e={},sort:t,limit:o=10,page:r=1,tenantID:a,select:i,draft:c}=s,u=this.getCollection(n),d=this.getTable(n),T={...e};this.tenantContext&&u.tenantScoped&&(T=chunkW4ZDETHA_cjs.c({where:T},n,this.tenantContext,chunkW4ZDETHA_cjs.b).where||{});let h=this.buildWhereClause(T,u,d,a),m=u.fields.find(f=>f.name==="status"),g=m?.type==="select"&&m.options?.some(f=>f.value==="published");!c&&d.status&&g&&h.push(drizzleOrm.eq(d.status,"published"));let E=this.parseSort(t),R=!c&&d.status&&g?{...T,status:"published"}:T,j=await this.count({collection:n,where:R,tenantID:a}),B=(r-1)*o,v=[];try{let f=d[E.field]||d.createdAt||d.id,N=E.direction==="asc"?f:drizzleOrm.desc(f),b=this.client.select().from(d);h.length>0&&(b=b.where(drizzleOrm.and(...h))),v=await b.orderBy(N).limit(o).offset(B);}catch(f){console.error("[DrizzleAdapter] Query error:",f);}let _=v.map(f=>this.processResult(f,u));return this.tenantContext&&!this.tenantContext.isSuperAdmin&&(_=_.filter(f=>chunkW4ZDETHA_cjs.d(f,n,this.tenantContext,chunkW4ZDETHA_cjs.b))),c&&(_=await Promise.all(_.map(async f=>{let N=await this.executeRaw(drizzleOrm.sql`
|
|
24
24
|
SELECT * FROM kyro_versions
|
|
25
25
|
WHERE collection_slug = ${n}
|
|
26
|
-
AND document_id = ${
|
|
26
|
+
AND document_id = ${f.id}
|
|
27
27
|
ORDER BY created_at DESC
|
|
28
28
|
LIMIT 1
|
|
29
|
-
`);if(
|
|
29
|
+
`);if(N.length>0){let b=N[0],X=typeof b.data=="string"?JSON.parse(b.data):b.data;return {...f,...X,status:f.status}}return f}))),{docs:_,...this.calculatePagination(r,o,j)}}async findByID(s){let{collection:n,id:e,tenantID:t,draft:o}=s,r=this.getCollection(n),a=this.getTable(n);if(this.tenantContext&&r.tenantScoped){let m={id:e,tenantId:this.tenantContext.tenantId};if(!chunkW4ZDETHA_cjs.d(m,n,this.tenantContext,chunkW4ZDETHA_cjs.b))return null}let i=[drizzleOrm.eq(a.id,e)];t&&a.tenantId&&i.push(drizzleOrm.eq(a.tenantId,t));let c=r.fields.find(m=>m.name==="status"),u=c?.type==="select"&&c.options?.some(m=>m.value==="published");!o&&a.status&&u&&i.push(drizzleOrm.eq(a.status,"published"));let d=i.length>1?drizzleOrm.and(...i):i[0],T=await this.client.select().from(a).where(d);if(T.length===0)return null;let h=this.processResult(T[0],r);if(o){let m=await this.executeRaw(drizzleOrm.sql`
|
|
30
30
|
SELECT * FROM kyro_versions
|
|
31
31
|
WHERE collection_slug = ${n}
|
|
32
|
-
AND document_id = ${
|
|
32
|
+
AND document_id = ${h.id}
|
|
33
33
|
ORDER BY created_at DESC
|
|
34
34
|
LIMIT 1
|
|
35
|
-
`);if(
|
|
35
|
+
`);if(m.length>0){let g=m[0],E=typeof g.data=="string"?JSON.parse(g.data):g.data;h={...h,...E,status:h.status};}}return h}async create(s){let{collection:n,data:e,tenantID:t}=s,o=this.getCollection(n),r=this.getTable(n),a=this.prepareData(e,o);t&&(a.tenantId=t);let i=await this.client.insert(r).values(a).returning();return this.processResult(i[0],o)}async update(s){let{collection:n,id:e,data:t,tenantID:o}=s,r=this.getCollection(n),a=this.getTable(n),i=this.prepareData(t,r);delete i.id;let c=[drizzleOrm.eq(a.id,e)];o&&a.tenantId&&c.push(drizzleOrm.eq(a.tenantId,o));let u=await this.client.update(a).set(i).where(drizzleOrm.and(...c)).returning();if(u.length===0)throw new Error(`Document not found: ${n}/${e}`);return this.processResult(u[0],r)}async delete(s){let{collection:n,id:e,tenantID:t}=s,o=this.getCollection(n),r=this.getTable(n),a=[drizzleOrm.eq(r.id,e)];t&&r.tenantId&&a.push(drizzleOrm.eq(r.tenantId,t));let i=await this.client.delete(r).where(drizzleOrm.and(...a)).returning();if(i.length===0)throw new Error(`Document not found: ${n}/${e}`);return this.processResult(i[0],o)}async count(s){let{collection:n,where:e={},tenantID:t}=s,o=this.getCollection(n),r=this.getTable(n),a=this.buildWhereClause(e,o,r,t);try{let i=this.client.select({count:drizzleOrm.sql`count(*)`}).from(r);a.length>0&&(i=i.where(drizzleOrm.and(...a)));let c=await i;return Number(c[0]?.count||0)}catch{return 0}}async findOne(s){let{collection:n,where:e={},tenantID:t,draft:o}=s;if(n.startsWith("_globals_")){let a=n.replace("_globals_",""),i=this.globals.get(a);if(!i)throw new Error(`Global "${a}" not found`);let c=this.getTable(n),u=this.client.select().from(c),d=i.fields.find(g=>g.name==="status"),T=d?.type==="select"&&d.options?.some(g=>g.value==="published");!o&&c.status&&T&&(u=u.where(drizzleOrm.eq(c.status,"published")));let h=await u.limit(1);if(h.length===0)return null;let m=this.processResult(h[0],i);if(o){let g=await this.executeRaw(drizzleOrm.sql`
|
|
36
36
|
SELECT * FROM kyro_versions
|
|
37
37
|
WHERE collection_slug = ${n}
|
|
38
38
|
AND document_id = ${a}
|
|
39
39
|
ORDER BY created_at DESC
|
|
40
40
|
LIMIT 1
|
|
41
|
-
`);if(
|
|
41
|
+
`);if(g.length>0){let E=g[0],R=typeof E.data=="string"?JSON.parse(E.data):E.data;m={...m,...R,status:m.status};}}return m}return (await this.find({...s,limit:1})).docs[0]||null}async findVersions(s){await this.ensureVersionsTable();let{collection:n,documentId:e,limit:t=10,page:o=1,tenantID:r}=s,a=(o-1)*t,i=await this.executeRaw(drizzleOrm.sql`
|
|
42
42
|
SELECT count(*) as count
|
|
43
43
|
FROM kyro_versions
|
|
44
44
|
WHERE collection_slug = ${n}
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
ORDER BY created_at DESC
|
|
56
56
|
LIMIT ${t}
|
|
57
57
|
OFFSET ${a}
|
|
58
|
-
`)).map(
|
|
58
|
+
`)).map(d=>({...d,data:typeof d.data=="string"?JSON.parse(d.data):d.data})),...this.calculatePagination(o,t,c)}}async findVersionByID(s){await this.ensureVersionsTable();let n=await this.executeRaw(drizzleOrm.sql`
|
|
59
59
|
SELECT * FROM kyro_versions
|
|
60
60
|
WHERE id = ${s.versionId}
|
|
61
61
|
AND collection_slug = ${s.collection}
|
|
@@ -129,5 +129,5 @@
|
|
|
129
129
|
created_at text NOT NULL,
|
|
130
130
|
updated_at text NOT NULL
|
|
131
131
|
)
|
|
132
|
-
`,await this.executeRaw(drizzleOrm.sql.raw(s));try{this.dialect==="postgres"?await this.executeRaw(drizzleOrm.sql.raw("ALTER TABLE kyro_versions ADD COLUMN IF NOT EXISTS autosave integer NOT NULL DEFAULT 0")):await this.executeRaw(drizzleOrm.sql.raw("ALTER TABLE kyro_versions ADD COLUMN autosave integer NOT NULL DEFAULT 0"));}catch{}this.versionsTableReady=true;}async executeRaw(s){let n=await this.client.execute(s);return Array.isArray(n)?n:Array.isArray(n?.rows)?n.rows:Array.isArray(n?.[0])?n[0]:[]}};function
|
|
133
|
-
exports.a=
|
|
132
|
+
`,await this.executeRaw(drizzleOrm.sql.raw(s));try{this.dialect==="postgres"?await this.executeRaw(drizzleOrm.sql.raw("ALTER TABLE kyro_versions ADD COLUMN IF NOT EXISTS autosave integer NOT NULL DEFAULT 0")):await this.executeRaw(drizzleOrm.sql.raw("ALTER TABLE kyro_versions ADD COLUMN autosave integer NOT NULL DEFAULT 0"));}catch{}this.versionsTableReady=true;}async executeRaw(s){let n=await this.client.execute(s);return Array.isArray(n)?n:Array.isArray(n?.rows)?n.rows:Array.isArray(n?.[0])?n[0]:[]}};function De(p){return new S(p)}var fe=module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('chunk-X3RRRWIN.cjs', document.baseURI).href))),pe="node:sqlite",{DatabaseSync:he}=fe(pe);function me(){return process.env.DB_TYPE==="postgres"?"postgres":"sqlite"}function P(){return crypto.randomBytes(16).toString("hex")}async function $e(){let p=me();if(p==="sqlite"){let r=path.resolve(process.cwd(),"data","kyro.db");await promises.mkdir(path.dirname(r),{recursive:true});let a=new he(r);return a.exec("PRAGMA journal_mode = WAL"),{db:a,dialect:p,genId:P}}let s=process.env.DATABASE_URL||"postgresql://postgres:postgres@localhost:5432/kyro_cms",n=parseInt(process.env.DB_POOL_MAX||"10",10),e=process.env.DB_SSL==="true",t=oe__default.default(s,{max:n,ssl:e?"require":false,onnotice:()=>{}});return {db:postgresJs.drizzle(t),dialect:p,genId:P}}async function Se(p,s){}async function ve(p){let{roles:s}=await import('./schema-HIUSHSUI.cjs');await p.insert(s).values({name:"super_admin",level:100,inherits:[],description:"Full system access across all tenants",isSystem:true}).onConflictDoNothing();}
|
|
133
|
+
exports.a=D;exports.b=Ae;exports.c=S;exports.d=De;exports.e=P;exports.f=$e;exports.g=Se;exports.h=ve;
|
package/dist/cli/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
'use strict';require('../chunk-AHSFSERC.cjs');var commander=require('commander'),fs=require('fs'),path=require('path'),url=require('url'),glob=require('glob');var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;function y(e){switch(e.type){case "text":case "email":case "password":case "textarea":case "color":case "code":case "markdown":case "date":case "richtext":case "json":return e.hasMany?"string[]":"string";case "number":return e.hasMany?"number[]":"number";case "checkbox":return "boolean";case "select":case "radio":if(e.options){let t=e.options.map(r=>`'${r.value}'`).join(" | ");return e.hasMany?`(${t})[]`:t}return e.hasMany?"string[]":"string";case "relationship":if(Array.isArray(e.relationTo)){let t=e.relationTo.map(r=>`${m(r)} | string`).join(" | ");return e.hasMany?`(${t})[]`:`(${t})`}let n=e.relationTo||"unknown";return e.hasMany?`(${m(n)} | string)[]`:`${m(n)} | string`;case "upload":return e.hasMany?"(Media | string)[]":"Media | string";case "array":return e.fields&&e.fields.length>0?`Array<{
|
|
2
|
+
'use strict';require('../chunk-AHSFSERC.cjs');var commander=require('commander'),fs=require('fs'),path=require('path'),url=require('url'),glob=require('glob');var _documentCurrentScript=typeof document!=='undefined'?document.currentScript:null;function y(e){switch(e.type){case "text":case "email":case "password":case "textarea":case "color":case "code":case "markdown":case "date":case "richtext":case "json":return e.hasMany?"string[]":"string";case "number":return e.hasMany?"number[]":"number";case "checkbox":return "boolean";case "select":case "radio":if(e.options){let t=e.options.map(r=>`'${r.value}'`).join(" | ");return e.hasMany?`(${t})[]`:t}return e.hasMany?"string[]":"string";case "relationship":if(Array.isArray(e.relationTo)){if(e.relationTo.includes("*"))return e.hasMany?"any[]":"any";let t=e.relationTo.map(r=>`${m(r)} | string`).join(" | ");return e.hasMany?`(${t})[]`:`(${t})`}let n=e.relationTo||"unknown";return n==="*"?e.hasMany?"any[]":"any":e.hasMany?`(${m(n)} | string)[]`:`${m(n)} | string`;case "upload":return e.hasMany?"(Media | string)[]":"Media | string";case "array":return e.fields&&e.fields.length>0?`Array<{
|
|
3
3
|
${e.fields.filter(r=>r.name).map(r=>{let o=y(r);return ` ${r.name}${r.required?"":"?"}: ${o};`}).join(`
|
|
4
4
|
`)}
|
|
5
5
|
}>`:"Record<string, any>[]";case "group":return e.fields&&e.fields.length>0?`{
|
|
@@ -145,7 +145,7 @@ export interface Block {
|
|
|
145
145
|
[key: string]: any;
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
`;for(let t of e){let r=m(t.slug),o=t.fields.filter(s=>s.name).map(s=>{let
|
|
148
|
+
`;for(let t of e){let r=m(t.slug),o=t.fields.filter(s=>s.name).map(s=>{let a=y(s);return ` ${s.name}${s.required?"":"?"}: ${a};`});o.unshift(" id: string;"),o.push(" createdAt: string;"),o.push(" updatedAt: string;"),n+=`export interface ${r} {
|
|
149
149
|
${o.join(`
|
|
150
150
|
`)}
|
|
151
151
|
}
|
|
@@ -208,4 +208,4 @@ ${e.map(t=>{let r=m(t.slug);return ` ${C(t.slug)}: {
|
|
|
208
208
|
`)}
|
|
209
209
|
};
|
|
210
210
|
}
|
|
211
|
-
`,n}function K(){return new commander.Command("generate").description("Generate TypeScript types from collection configs").option("-c, --config <path>","Path to config file or directory","./src/kyro").option("-o, --output <path>","Output file path","./src/types/kyro.d.ts").option("-w, --watch","Watch for changes and regenerate").option("--url <url>","URL of a running Kyro CMS instance (enables remote mode)").option("--api-key <key>","API key for authentication (required with --url)").action(async n=>{if(n.url){n.url||(console.error("\u274C --url is required when using --api"),process.exit(1)),n.apiKey||(console.error("\u274C --api-key is required when using --api"),process.exit(1));let o=path.resolve(n.output);try{let s=await q(n.url,n.apiKey),
|
|
211
|
+
`,n}function K(){return new commander.Command("generate").description("Generate TypeScript types from collection configs").option("-c, --config <path>","Path to config file or directory","./src/kyro").option("-o, --output <path>","Output file path","./src/types/kyro.d.ts").option("-w, --watch","Watch for changes and regenerate").option("--url <url>","URL of a running Kyro CMS instance (enables remote mode)").option("--api-key <key>","API key for authentication (required with --url)").action(async n=>{if(n.url){n.url||(console.error("\u274C --url is required when using --api"),process.exit(1)),n.apiKey||(console.error("\u274C --api-key is required when using --api"),process.exit(1));let o=path.resolve(n.output);try{let s=await q(n.url,n.apiKey),a=D(s),d=path.join(o,"..");fs.existsSync(d)||fs.mkdirSync(d,{recursive:!0}),fs.writeFileSync(o,a);}catch(s){console.error("\u274C Error:",s.message),process.exit(1);}return}let t=path.resolve(n.config),r=path.resolve(n.output);try{let o=await glob.glob(`${t}/**/*.{ts,js}`);o.length===0&&(console.error("\u274C No config files found at:",t),process.exit(1));let s=[];for(let i of o)try{let l=await import(i),u=Object.values(l).filter(c=>c&&c.slug&&c.fields);s.push(...u);}catch{console.warn(`\u26A0\uFE0F Could not parse: ${i}`);}s.length===0&&(console.error("\u274C No valid collection configs found"),process.exit(1));let a=T(s),d=path.join(r,"..");if(fs.existsSync(d)||fs.mkdirSync(d,{recursive:!0}),fs.writeFileSync(r,a),n.watch){let{watch:i}=await import('fs');i(t,{recursive:!0},async(l,u)=>{let c=[];for(let S of o)try{let k=await import(S+`?t=${Date.now()}`),v=Object.values(k).filter(h=>h&&h.slug&&h.fields);c.push(...v);}catch{}let f=T(c);fs.writeFileSync(r,f);});}}catch(o){console.error("\u274C Error:",o.message),process.exit(1);}})}var L=url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))),N=path.dirname(L),P="0.1.0";try{P=JSON.parse(fs.readFileSync(path.join(N,"../../package.json"),"utf-8")).version;}catch{}var p=new commander.Command;p.name("kyro").description("Kyro CMS - Astro-native headless CMS").version(P);p.command("dev").description("Start Kyro CMS development server").option("-p, --port <port>","Port to run on","4321").option("-h, --host <host>","Host to bind to","localhost").action(async e=>{let{exec:n}=await import('child_process'),t=n(`astro dev --port ${e.port} --host ${e.host}`,{env:{...process.env,NODE_NO_WARNINGS:"1"}});t.stdout?.on("data",r=>process.stdout.write(r)),t.stderr?.on("data",r=>process.stderr.write(r)),process.on("SIGINT",()=>{t.kill("SIGINT"),process.exit(0);}),process.on("SIGTERM",()=>{t.kill("SIGTERM"),process.exit(0);});});p.addCommand(K());var g=p.command("db").description("Database management commands");g.command("generate").description("Generate migrations from schema").action(async()=>{let{exec:e}=await import('child_process');e("npx drizzle-kit generate",(n,t,r)=>{n&&(console.error("\u274C Generation failed:",n.message),process.exit(1));});});g.command("migrate").description("Run database migrations").action(async()=>{let{exec:e}=await import('child_process');e("npx drizzle-kit migrate",(n,t,r)=>{n&&(console.error("\u274C Migration failed:",n.message),process.exit(1));});});g.command("push").description("Push schema to database (development)").action(async()=>{let{exec:e}=await import('child_process');e("npx drizzle-kit push",(n,t,r)=>{n&&(console.error("\u274C Push failed:",n.message),process.exit(1));});});g.command("seed").description("Seed database with initial data").action(async()=>{let{exec:e}=await import('child_process');e("npx tsx src/database/drizzle/seed.ts",(n,t,r)=>{n&&(console.error("\u274C Seeding failed:",n.message),process.exit(1));});});g.command("studio").description("Open Drizzle Studio").action(async()=>{let{exec:e}=await import('child_process');e("npx drizzle-kit studio",(n,t,r)=>{n&&(console.error("\u274C Studio failed:",n.message),process.exit(1));});});var F=p.command("auth").description("Authentication management commands");F.command("bootstrap").description("Create initial admin user").option("-e, --email <email>","Admin email",process.env.KYRO_ADMIN_EMAIL).option("-p, --password <password>","Admin password",process.env.KYRO_ADMIN_PASSWORD).option("-r, --role <role>","Admin role",process.env.KYRO_ADMIN_ROLE||"admin").action(async e=>{(!e.email||!e.password)&&(console.error("\u274C Email and password are required. Set KYRO_ADMIN_EMAIL and KYRO_ADMIN_PASSWORD env vars or use -e and -p options."),process.exit(1));try{let{bootstrapAdmin:n}=await import('../bootstrap-OHGQGMRV.cjs'),t=process.env.DATABASE_URL||"",r=t.toLowerCase().startsWith("postgres://")||t.toLowerCase().startsWith("postgresql://"),o=t.toLowerCase().startsWith("mongodb://")||t.toLowerCase().startsWith("mongodb+srv://"),s=!t||t.includes(".db")||t.includes("sqlite")||t.includes("file:"),a;if(r){let{PostgresAuthAdapter:i}=await import('../postgres-auth-adapter-JKDYYULH.cjs'),{drizzle:l}=await import('drizzle-orm/postgres-js'),{default:u}=await import('postgres'),c=u(t,{max:1,onnotice:()=>{}}),f=l(c);a=new i({db:f});}else if(o){let{MongoDBAuthAdapter:i}=await import('../mongo-auth-adapter-YPONSOCY.cjs'),{MongoClient:l}=await import('mongodb'),u=new l(t);await u.connect();let c=u.db();a=new i({db:c});}else {let{SQLiteAuthAdapter:i}=await import('../sqlite-adapter-Z3IBBI4X.cjs'),l=process.env.KYRO_AUTH_DB_PATH||"./data/auth.db";a=new i({path:l});}a.connect&&await a.connect();let d=await n({authAdapter:a,adminEmail:e.email,adminPassword:e.password,adminRole:e.role});a.disconnect&&await a.disconnect(),d.success||(console.error("\u274C Failed to create admin:",d.error),process.exit(1));}catch(n){console.error("\u274C Bootstrap failed:",n),process.exit(1);}});p.command("health").description("Check system health").action(async()=>{let e=process.env.DATABASE_URL||"",n=e.toLowerCase().startsWith("postgres://")||e.toLowerCase().startsWith("postgresql://"),t=e.toLowerCase().startsWith("mongodb://")||e.toLowerCase().startsWith("mongodb+srv://"),r=!e||e.includes(".db")||e.includes("sqlite")||e.includes("file:");if(n)try{let{default:o}=await import('postgres'),s=o(e,{max:1,onnotice:()=>{}});await s.unsafe("SELECT 1"),await s.end();}catch{}else if(t)try{let{MongoClient:o}=await import('mongodb'),s=new o(e);await s.connect(),await s.db().admin().ping(),await s.close();}catch{}else if(r)try{let o=process.env.KYRO_AUTH_DB_PATH||"./data/auth.db",{existsSync:s}=await import('fs');s(o);}catch{}});p.parse();process.argv.slice(2).length||p.outputHelp();
|
package/dist/cli/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import'../chunk-5J6HXUF6.js';import {Command}from'commander';import {readFileSync,existsSync,mkdirSync,writeFileSync}from'fs';import {dirname,join,resolve}from'path';import {fileURLToPath}from'url';import {glob}from'glob';function y(e){switch(e.type){case "text":case "email":case "password":case "textarea":case "color":case "code":case "markdown":case "date":case "richtext":case "json":return e.hasMany?"string[]":"string";case "number":return e.hasMany?"number[]":"number";case "checkbox":return "boolean";case "select":case "radio":if(e.options){let t=e.options.map(r=>`'${r.value}'`).join(" | ");return e.hasMany?`(${t})[]`:t}return e.hasMany?"string[]":"string";case "relationship":if(Array.isArray(e.relationTo)){let t=e.relationTo.map(r=>`${m(r)} | string`).join(" | ");return e.hasMany?`(${t})[]`:`(${t})`}let n=e.relationTo||"unknown";return e.hasMany?`(${m(n)} | string)[]`:`${m(n)} | string`;case "upload":return e.hasMany?"(Media | string)[]":"Media | string";case "array":return e.fields&&e.fields.length>0?`Array<{
|
|
2
|
+
import'../chunk-5J6HXUF6.js';import {Command}from'commander';import {readFileSync,existsSync,mkdirSync,writeFileSync}from'fs';import {dirname,join,resolve}from'path';import {fileURLToPath}from'url';import {glob}from'glob';function y(e){switch(e.type){case "text":case "email":case "password":case "textarea":case "color":case "code":case "markdown":case "date":case "richtext":case "json":return e.hasMany?"string[]":"string";case "number":return e.hasMany?"number[]":"number";case "checkbox":return "boolean";case "select":case "radio":if(e.options){let t=e.options.map(r=>`'${r.value}'`).join(" | ");return e.hasMany?`(${t})[]`:t}return e.hasMany?"string[]":"string";case "relationship":if(Array.isArray(e.relationTo)){if(e.relationTo.includes("*"))return e.hasMany?"any[]":"any";let t=e.relationTo.map(r=>`${m(r)} | string`).join(" | ");return e.hasMany?`(${t})[]`:`(${t})`}let n=e.relationTo||"unknown";return n==="*"?e.hasMany?"any[]":"any":e.hasMany?`(${m(n)} | string)[]`:`${m(n)} | string`;case "upload":return e.hasMany?"(Media | string)[]":"Media | string";case "array":return e.fields&&e.fields.length>0?`Array<{
|
|
3
3
|
${e.fields.filter(r=>r.name).map(r=>{let o=y(r);return ` ${r.name}${r.required?"":"?"}: ${o};`}).join(`
|
|
4
4
|
`)}
|
|
5
5
|
}>`:"Record<string, any>[]";case "group":return e.fields&&e.fields.length>0?`{
|
|
@@ -145,7 +145,7 @@ export interface Block {
|
|
|
145
145
|
[key: string]: any;
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
`;for(let t of e){let r=m(t.slug),o=t.fields.filter(s=>s.name).map(s=>{let
|
|
148
|
+
`;for(let t of e){let r=m(t.slug),o=t.fields.filter(s=>s.name).map(s=>{let a=y(s);return ` ${s.name}${s.required?"":"?"}: ${a};`});o.unshift(" id: string;"),o.push(" createdAt: string;"),o.push(" updatedAt: string;"),n+=`export interface ${r} {
|
|
149
149
|
${o.join(`
|
|
150
150
|
`)}
|
|
151
151
|
}
|
|
@@ -208,4 +208,4 @@ ${e.map(t=>{let r=m(t.slug);return ` ${C(t.slug)}: {
|
|
|
208
208
|
`)}
|
|
209
209
|
};
|
|
210
210
|
}
|
|
211
|
-
`,n}function K(){return new Command("generate").description("Generate TypeScript types from collection configs").option("-c, --config <path>","Path to config file or directory","./src/kyro").option("-o, --output <path>","Output file path","./src/types/kyro.d.ts").option("-w, --watch","Watch for changes and regenerate").option("--url <url>","URL of a running Kyro CMS instance (enables remote mode)").option("--api-key <key>","API key for authentication (required with --url)").action(async n=>{if(n.url){n.url||(console.error("\u274C --url is required when using --api"),process.exit(1)),n.apiKey||(console.error("\u274C --api-key is required when using --api"),process.exit(1));let o=resolve(n.output);try{let s=await q(n.url,n.apiKey),
|
|
211
|
+
`,n}function K(){return new Command("generate").description("Generate TypeScript types from collection configs").option("-c, --config <path>","Path to config file or directory","./src/kyro").option("-o, --output <path>","Output file path","./src/types/kyro.d.ts").option("-w, --watch","Watch for changes and regenerate").option("--url <url>","URL of a running Kyro CMS instance (enables remote mode)").option("--api-key <key>","API key for authentication (required with --url)").action(async n=>{if(n.url){n.url||(console.error("\u274C --url is required when using --api"),process.exit(1)),n.apiKey||(console.error("\u274C --api-key is required when using --api"),process.exit(1));let o=resolve(n.output);try{let s=await q(n.url,n.apiKey),a=D(s),d=join(o,"..");existsSync(d)||mkdirSync(d,{recursive:!0}),writeFileSync(o,a);}catch(s){console.error("\u274C Error:",s.message),process.exit(1);}return}let t=resolve(n.config),r=resolve(n.output);try{let o=await glob(`${t}/**/*.{ts,js}`);o.length===0&&(console.error("\u274C No config files found at:",t),process.exit(1));let s=[];for(let i of o)try{let l=await import(i),u=Object.values(l).filter(c=>c&&c.slug&&c.fields);s.push(...u);}catch{console.warn(`\u26A0\uFE0F Could not parse: ${i}`);}s.length===0&&(console.error("\u274C No valid collection configs found"),process.exit(1));let a=T(s),d=join(r,"..");if(existsSync(d)||mkdirSync(d,{recursive:!0}),writeFileSync(r,a),n.watch){let{watch:i}=await import('fs');i(t,{recursive:!0},async(l,u)=>{let c=[];for(let S of o)try{let k=await import(S+`?t=${Date.now()}`),v=Object.values(k).filter(h=>h&&h.slug&&h.fields);c.push(...v);}catch{}let f=T(c);writeFileSync(r,f);});}}catch(o){console.error("\u274C Error:",o.message),process.exit(1);}})}var L=fileURLToPath(import.meta.url),N=dirname(L),P="0.1.0";try{P=JSON.parse(readFileSync(join(N,"../../package.json"),"utf-8")).version;}catch{}var p=new Command;p.name("kyro").description("Kyro CMS - Astro-native headless CMS").version(P);p.command("dev").description("Start Kyro CMS development server").option("-p, --port <port>","Port to run on","4321").option("-h, --host <host>","Host to bind to","localhost").action(async e=>{let{exec:n}=await import('child_process'),t=n(`astro dev --port ${e.port} --host ${e.host}`,{env:{...process.env,NODE_NO_WARNINGS:"1"}});t.stdout?.on("data",r=>process.stdout.write(r)),t.stderr?.on("data",r=>process.stderr.write(r)),process.on("SIGINT",()=>{t.kill("SIGINT"),process.exit(0);}),process.on("SIGTERM",()=>{t.kill("SIGTERM"),process.exit(0);});});p.addCommand(K());var g=p.command("db").description("Database management commands");g.command("generate").description("Generate migrations from schema").action(async()=>{let{exec:e}=await import('child_process');e("npx drizzle-kit generate",(n,t,r)=>{n&&(console.error("\u274C Generation failed:",n.message),process.exit(1));});});g.command("migrate").description("Run database migrations").action(async()=>{let{exec:e}=await import('child_process');e("npx drizzle-kit migrate",(n,t,r)=>{n&&(console.error("\u274C Migration failed:",n.message),process.exit(1));});});g.command("push").description("Push schema to database (development)").action(async()=>{let{exec:e}=await import('child_process');e("npx drizzle-kit push",(n,t,r)=>{n&&(console.error("\u274C Push failed:",n.message),process.exit(1));});});g.command("seed").description("Seed database with initial data").action(async()=>{let{exec:e}=await import('child_process');e("npx tsx src/database/drizzle/seed.ts",(n,t,r)=>{n&&(console.error("\u274C Seeding failed:",n.message),process.exit(1));});});g.command("studio").description("Open Drizzle Studio").action(async()=>{let{exec:e}=await import('child_process');e("npx drizzle-kit studio",(n,t,r)=>{n&&(console.error("\u274C Studio failed:",n.message),process.exit(1));});});var F=p.command("auth").description("Authentication management commands");F.command("bootstrap").description("Create initial admin user").option("-e, --email <email>","Admin email",process.env.KYRO_ADMIN_EMAIL).option("-p, --password <password>","Admin password",process.env.KYRO_ADMIN_PASSWORD).option("-r, --role <role>","Admin role",process.env.KYRO_ADMIN_ROLE||"admin").action(async e=>{(!e.email||!e.password)&&(console.error("\u274C Email and password are required. Set KYRO_ADMIN_EMAIL and KYRO_ADMIN_PASSWORD env vars or use -e and -p options."),process.exit(1));try{let{bootstrapAdmin:n}=await import('../bootstrap-IVQWSJXZ.js'),t=process.env.DATABASE_URL||"",r=t.toLowerCase().startsWith("postgres://")||t.toLowerCase().startsWith("postgresql://"),o=t.toLowerCase().startsWith("mongodb://")||t.toLowerCase().startsWith("mongodb+srv://"),s=!t||t.includes(".db")||t.includes("sqlite")||t.includes("file:"),a;if(r){let{PostgresAuthAdapter:i}=await import('../postgres-auth-adapter-33QOIRXT.js'),{drizzle:l}=await import('drizzle-orm/postgres-js'),{default:u}=await import('postgres'),c=u(t,{max:1,onnotice:()=>{}}),f=l(c);a=new i({db:f});}else if(o){let{MongoDBAuthAdapter:i}=await import('../mongo-auth-adapter-LG5O4LIH.js'),{MongoClient:l}=await import('mongodb'),u=new l(t);await u.connect();let c=u.db();a=new i({db:c});}else {let{SQLiteAuthAdapter:i}=await import('../sqlite-adapter-FP45QCYK.js'),l=process.env.KYRO_AUTH_DB_PATH||"./data/auth.db";a=new i({path:l});}a.connect&&await a.connect();let d=await n({authAdapter:a,adminEmail:e.email,adminPassword:e.password,adminRole:e.role});a.disconnect&&await a.disconnect(),d.success||(console.error("\u274C Failed to create admin:",d.error),process.exit(1));}catch(n){console.error("\u274C Bootstrap failed:",n),process.exit(1);}});p.command("health").description("Check system health").action(async()=>{let e=process.env.DATABASE_URL||"",n=e.toLowerCase().startsWith("postgres://")||e.toLowerCase().startsWith("postgresql://"),t=e.toLowerCase().startsWith("mongodb://")||e.toLowerCase().startsWith("mongodb+srv://"),r=!e||e.includes(".db")||e.includes("sqlite")||e.includes("file:");if(n)try{let{default:o}=await import('postgres'),s=o(e,{max:1,onnotice:()=>{}});await s.unsafe("SELECT 1"),await s.end();}catch{}else if(t)try{let{MongoClient:o}=await import('mongodb'),s=new o(e);await s.connect(),await s.db().admin().ping(),await s.close();}catch{}else if(r)try{let o=process.env.KYRO_AUTH_DB_PATH||"./data/auth.db",{existsSync:s}=await import('fs');s(o);}catch{}});p.parse();process.argv.slice(2).length||p.outputHelp();
|
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-BMu-234T.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-C9izrwhZ.cjs';
|
|
3
3
|
export { renderRichText, richTextStyles } from './fields/index.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-BH7tjlpR.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-C9izrwhZ.js';
|
|
3
3
|
export { renderRichText, richTextStyles } from './fields/index.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/drizzle/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';require('../chunk-4ORJMSJU.cjs');var
|
|
1
|
+
'use strict';require('../chunk-4ORJMSJU.cjs');var chunkX3RRRWIN_cjs=require('../chunk-X3RRRWIN.cjs'),chunkGYQMNXXW_cjs=require('../chunk-GYQMNXXW.cjs');require('../chunk-MIOMMB23.cjs'),require('../chunk-W4ZDETHA.cjs'),require('../chunk-Q3Q7BJVQ.cjs'),require('../chunk-AHSFSERC.cjs');Object.defineProperty(exports,"DrizzleAdapter",{enumerable:true,get:function(){return chunkX3RRRWIN_cjs.c}});Object.defineProperty(exports,"collectionToDrizzleSchema",{enumerable:true,get:function(){return chunkX3RRRWIN_cjs.b}});Object.defineProperty(exports,"createDatabase",{enumerable:true,get:function(){return chunkX3RRRWIN_cjs.f}});Object.defineProperty(exports,"createDrizzleAdapter",{enumerable:true,get:function(){return chunkX3RRRWIN_cjs.d}});Object.defineProperty(exports,"fieldToDrizzleType",{enumerable:true,get:function(){return chunkX3RRRWIN_cjs.a}});Object.defineProperty(exports,"runMigrations",{enumerable:true,get:function(){return chunkX3RRRWIN_cjs.g}});Object.defineProperty(exports,"seedDefaultRoles",{enumerable:true,get:function(){return chunkX3RRRWIN_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-CH7d01Yw.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-BMu-234T.cjs';
|
|
3
|
+
import { F as Field } from '../types-C9izrwhZ.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
|
|
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-DRK_7V46.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-BH7tjlpR.js';
|
|
3
|
+
import { F as Field } from '../types-C9izrwhZ.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
|
|
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-MBUUNROA.js';export{a as PostgresAuthAdapter}from'../chunk-RHCWCG3O.js';import'../chunk-OG7CNQGU.js';import'../chunk-4YYBWCDJ.js';import'../chunk-KDNYHLD2.js';import'../chunk-5J6HXUF6.js';
|
package/dist/fields/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { r as ALL_FIELD_TYPES, Y as ActionField, A as ArrayField, B as BaseField, a as Block, b as BlockAdmin, c as BlockImage, d as BlocksField, Z as ButtonField, s 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, F as Field, i as FieldAdmin, j as FieldType, G as GroupField, _ as Hook, I as ImageField, J as JSONField, L as LAYOUT_FIELD_TYPES, $ as ListField, M as MarkdownField, N as NumberField, t as PRIMITIVE_FIELD_TYPES, P as PasswordField, u 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, a0 as TextFieldVariant, q as TextareaField, U as UploadField, V as ValidateOptions, a1 as createRelationshipFieldConfig, v as isArrayField, w as isBlocksField, x as isGroupField, y as isImageField, z as isLayoutField, H as isNumberField, K as isRelationshipField, O as isRichTextField, Q as isSelectField, W as isTextField, X as isUploadField } from '../types-
|
|
1
|
+
export { r as ALL_FIELD_TYPES, Y as ActionField, A as ArrayField, B as BaseField, a as Block, b as BlockAdmin, c as BlockImage, d as BlocksField, Z as ButtonField, s 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, F as Field, i as FieldAdmin, j as FieldType, G as GroupField, _ as Hook, I as ImageField, J as JSONField, L as LAYOUT_FIELD_TYPES, $ as ListField, M as MarkdownField, N as NumberField, t as PRIMITIVE_FIELD_TYPES, P as PasswordField, u 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, a0 as TextFieldVariant, q as TextareaField, U as UploadField, V as ValidateOptions, a1 as createRelationshipFieldConfig, v as isArrayField, w as isBlocksField, x as isGroupField, y as isImageField, z as isLayoutField, H as isNumberField, K as isRelationshipField, O as isRichTextField, Q as isSelectField, W as isTextField, X as isUploadField } from '../types-C9izrwhZ.cjs';
|
|
2
2
|
|
|
3
3
|
declare const richTextStyles: string;
|
|
4
4
|
declare function normalizeRichTextValue<T>(value: T): T;
|
package/dist/fields/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { r as ALL_FIELD_TYPES, Y as ActionField, A as ArrayField, B as BaseField, a as Block, b as BlockAdmin, c as BlockImage, d as BlocksField, Z as ButtonField, s 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, F as Field, i as FieldAdmin, j as FieldType, G as GroupField, _ as Hook, I as ImageField, J as JSONField, L as LAYOUT_FIELD_TYPES, $ as ListField, M as MarkdownField, N as NumberField, t as PRIMITIVE_FIELD_TYPES, P as PasswordField, u 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, a0 as TextFieldVariant, q as TextareaField, U as UploadField, V as ValidateOptions, a1 as createRelationshipFieldConfig, v as isArrayField, w as isBlocksField, x as isGroupField, y as isImageField, z as isLayoutField, H as isNumberField, K as isRelationshipField, O as isRichTextField, Q as isSelectField, W as isTextField, X as isUploadField } from '../types-
|
|
1
|
+
export { r as ALL_FIELD_TYPES, Y as ActionField, A as ArrayField, B as BaseField, a as Block, b as BlockAdmin, c as BlockImage, d as BlocksField, Z as ButtonField, s 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, F as Field, i as FieldAdmin, j as FieldType, G as GroupField, _ as Hook, I as ImageField, J as JSONField, L as LAYOUT_FIELD_TYPES, $ as ListField, M as MarkdownField, N as NumberField, t as PRIMITIVE_FIELD_TYPES, P as PasswordField, u 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, a0 as TextFieldVariant, q as TextareaField, U as UploadField, V as ValidateOptions, a1 as createRelationshipFieldConfig, v as isArrayField, w as isBlocksField, x as isGroupField, y as isImageField, z as isLayoutField, H as isNumberField, K as isRelationshipField, O as isRichTextField, Q as isSelectField, W as isTextField, X as isUploadField } from '../types-C9izrwhZ.js';
|
|
2
2
|
|
|
3
3
|
declare const richTextStyles: string;
|
|
4
4
|
declare function normalizeRichTextValue<T>(value: T): T;
|
package/dist/graphql/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkT7IBSF5R_cjs=require('../chunk-T7IBSF5R.cjs');require('../chunk-NY47CFVP.cjs'),require('../chunk-Q3Q7BJVQ.cjs'),require('../chunk-AHSFSERC.cjs');Object.defineProperty(exports,"RelationLoader",{enumerable:true,get:function(){return chunkT7IBSF5R_cjs.a}});Object.defineProperty(exports,"buildGraphQLSchema",{enumerable:true,get:function(){return chunkT7IBSF5R_cjs.c}});Object.defineProperty(exports,"createGraphQLSchema",{enumerable:true,get:function(){return chunkT7IBSF5R_cjs.d}});Object.defineProperty(exports,"depthLimit",{enumerable:true,get:function(){return chunkT7IBSF5R_cjs.b}});Object.defineProperty(exports,"printSchema",{enumerable:true,get:function(){return chunkT7IBSF5R_cjs.e}});
|
package/dist/graphql/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { GraphQLSchema } from 'graphql';
|
|
2
2
|
export { printSchema } from 'graphql';
|
|
3
|
-
import { B as BaseAdapter, i as User, R as Request } from '../types-
|
|
4
|
-
import { R as Registry } from '../index-
|
|
5
|
-
import '../types-
|
|
3
|
+
import { B as BaseAdapter, i as User, R as Request } from '../types-BMu-234T.cjs';
|
|
4
|
+
import { R as Registry } from '../index-B52AAXcJ.cjs';
|
|
5
|
+
import '../types-C9izrwhZ.cjs';
|
|
6
6
|
import 'zod';
|
|
7
7
|
|
|
8
8
|
interface LoaderOptions {
|
package/dist/graphql/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { GraphQLSchema } from 'graphql';
|
|
2
2
|
export { printSchema } from 'graphql';
|
|
3
|
-
import { B as BaseAdapter, i as User, R as Request } from '../types-
|
|
4
|
-
import { R as Registry } from '../index-
|
|
5
|
-
import '../types-
|
|
3
|
+
import { B as BaseAdapter, i as User, R as Request } from '../types-BH7tjlpR.js';
|
|
4
|
+
import { R as Registry } from '../index-BTFBhepB.js';
|
|
5
|
+
import '../types-C9izrwhZ.js';
|
|
6
6
|
import 'zod';
|
|
7
7
|
|
|
8
8
|
interface LoaderOptions {
|
package/dist/graphql/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as RelationLoader,c as buildGraphQLSchema,d as createGraphQLSchema,b as depthLimit,e as printSchema}from'../chunk-
|
|
1
|
+
export{a as RelationLoader,c as buildGraphQLSchema,d as createGraphQLSchema,b as depthLimit,e as printSchema}from'../chunk-HFU3VAUC.js';import'../chunk-HLSB2MCK.js';import'../chunk-KDNYHLD2.js';import'../chunk-5J6HXUF6.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CollectionConfig, G as GlobalConfig, P as PluginConfig } from './types-
|
|
2
|
-
import { F as Field } from './types-
|
|
1
|
+
import { C as CollectionConfig, G as GlobalConfig, P as PluginConfig } from './types-BMu-234T.cjs';
|
|
2
|
+
import { F as Field } from './types-C9izrwhZ.cjs';
|
|
3
3
|
import { ZodTypeAny } from 'zod';
|
|
4
4
|
|
|
5
5
|
interface S3CompatibleConfig {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as CollectionConfig, G as GlobalConfig, P as PluginConfig } from './types-
|
|
2
|
-
import { F as Field } from './types-
|
|
1
|
+
import { C as CollectionConfig, G as GlobalConfig, P as PluginConfig } from './types-BH7tjlpR.js';
|
|
2
|
+
import { F as Field } from './types-C9izrwhZ.js';
|
|
3
3
|
import { ZodTypeAny } from 'zod';
|
|
4
4
|
|
|
5
5
|
interface S3CompatibleConfig {
|