@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BaseAdapter } from './types-
|
|
1
|
+
import { B as BaseAdapter } from './types-BowAPGjD.cjs';
|
|
2
2
|
|
|
3
3
|
declare const WEBHOOK_EVENTS: {
|
|
4
4
|
readonly COLLECTION_CREATE: "collection.create";
|
|
@@ -16,6 +16,16 @@ declare const WEBHOOK_EVENTS: {
|
|
|
16
16
|
};
|
|
17
17
|
type WebhookEvent = (typeof WEBHOOK_EVENTS)[keyof typeof WEBHOOK_EVENTS];
|
|
18
18
|
declare const ALL_WEBHOOK_EVENTS: WebhookEvent[];
|
|
19
|
+
type WebhookActionType = "generic" | "github-dispatch" | "dokploy-deploy" | "coolify-deploy";
|
|
20
|
+
interface WebhookActionConfig {
|
|
21
|
+
githubOwner?: string;
|
|
22
|
+
githubRepo?: string;
|
|
23
|
+
githubEventType?: string;
|
|
24
|
+
dokployProjectId?: string;
|
|
25
|
+
dokployBranch?: string;
|
|
26
|
+
coolifyProjectUuid?: string;
|
|
27
|
+
coolifyEnvironmentName?: string;
|
|
28
|
+
}
|
|
19
29
|
interface WebhookConfig {
|
|
20
30
|
id: string;
|
|
21
31
|
name: string;
|
|
@@ -25,6 +35,8 @@ interface WebhookConfig {
|
|
|
25
35
|
status: "active" | "inactive" | "error";
|
|
26
36
|
secret?: string;
|
|
27
37
|
headers?: Record<string, string>;
|
|
38
|
+
action?: WebhookActionType;
|
|
39
|
+
config?: WebhookActionConfig;
|
|
28
40
|
lastTriggered?: string;
|
|
29
41
|
lastError?: string;
|
|
30
42
|
createdAt: string;
|
|
@@ -38,6 +50,8 @@ interface CreateWebhookData {
|
|
|
38
50
|
status?: "active" | "inactive";
|
|
39
51
|
secret?: string;
|
|
40
52
|
headers?: Record<string, string>;
|
|
53
|
+
action?: WebhookActionType;
|
|
54
|
+
config?: WebhookActionConfig;
|
|
41
55
|
}
|
|
42
56
|
interface UpdateWebhookData {
|
|
43
57
|
name?: string;
|
|
@@ -47,6 +61,8 @@ interface UpdateWebhookData {
|
|
|
47
61
|
status?: "active" | "inactive" | "error";
|
|
48
62
|
secret?: string;
|
|
49
63
|
headers?: Record<string, string>;
|
|
64
|
+
action?: WebhookActionType;
|
|
65
|
+
config?: WebhookActionConfig;
|
|
50
66
|
lastTriggered?: string | null;
|
|
51
67
|
lastError?: string | null;
|
|
52
68
|
}
|
|
@@ -92,6 +108,22 @@ interface WebhookTriggerResult {
|
|
|
92
108
|
}
|
|
93
109
|
declare const WEBHOOK_COLLECTION = "_webhooks";
|
|
94
110
|
declare const WEBHOOK_DELIVERY_COLLECTION = "_webhook_deliveries";
|
|
111
|
+
interface DeliveryResult {
|
|
112
|
+
success: boolean;
|
|
113
|
+
status: number;
|
|
114
|
+
statusText?: string;
|
|
115
|
+
body?: string;
|
|
116
|
+
duration: number;
|
|
117
|
+
error?: string;
|
|
118
|
+
}
|
|
119
|
+
interface DeliveryOptions {
|
|
120
|
+
timeout?: number;
|
|
121
|
+
maxRetries?: number;
|
|
122
|
+
retryDelay?: number;
|
|
123
|
+
onRetry?: (attempt: number, error: string) => void;
|
|
124
|
+
onSuccess?: (result: DeliveryResult) => void;
|
|
125
|
+
onFailure?: (error: string) => void;
|
|
126
|
+
}
|
|
95
127
|
|
|
96
128
|
declare class WebhookService {
|
|
97
129
|
private db;
|
|
@@ -112,4 +144,4 @@ declare class WebhookService {
|
|
|
112
144
|
}
|
|
113
145
|
declare function createWebhookService(db: BaseAdapter): WebhookService;
|
|
114
146
|
|
|
115
|
-
export { ALL_WEBHOOK_EVENTS as A, type CreateWebhookData as C, type UpdateWebhookData as U, type WebhookPayload as W, type WebhookDelivery as a, type WebhookConfig as b,
|
|
147
|
+
export { ALL_WEBHOOK_EVENTS as A, type CreateWebhookData as C, type DeliveryResult as D, type UpdateWebhookData as U, type WebhookPayload as W, type WebhookDelivery as a, type WebhookConfig as b, type DeliveryOptions as c, WebhookService as d, WEBHOOK_COLLECTION as e, WEBHOOK_DELIVERY_COLLECTION as f, WEBHOOK_EVENTS as g, type WebhookEvent as h, type WebhookTriggerResult as i, createWebhookService as j };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as BaseAdapter } from './types-
|
|
1
|
+
import { B as BaseAdapter } from './types-Bj3d_ys8.js';
|
|
2
2
|
|
|
3
3
|
declare const WEBHOOK_EVENTS: {
|
|
4
4
|
readonly COLLECTION_CREATE: "collection.create";
|
|
@@ -16,6 +16,16 @@ declare const WEBHOOK_EVENTS: {
|
|
|
16
16
|
};
|
|
17
17
|
type WebhookEvent = (typeof WEBHOOK_EVENTS)[keyof typeof WEBHOOK_EVENTS];
|
|
18
18
|
declare const ALL_WEBHOOK_EVENTS: WebhookEvent[];
|
|
19
|
+
type WebhookActionType = "generic" | "github-dispatch" | "dokploy-deploy" | "coolify-deploy";
|
|
20
|
+
interface WebhookActionConfig {
|
|
21
|
+
githubOwner?: string;
|
|
22
|
+
githubRepo?: string;
|
|
23
|
+
githubEventType?: string;
|
|
24
|
+
dokployProjectId?: string;
|
|
25
|
+
dokployBranch?: string;
|
|
26
|
+
coolifyProjectUuid?: string;
|
|
27
|
+
coolifyEnvironmentName?: string;
|
|
28
|
+
}
|
|
19
29
|
interface WebhookConfig {
|
|
20
30
|
id: string;
|
|
21
31
|
name: string;
|
|
@@ -25,6 +35,8 @@ interface WebhookConfig {
|
|
|
25
35
|
status: "active" | "inactive" | "error";
|
|
26
36
|
secret?: string;
|
|
27
37
|
headers?: Record<string, string>;
|
|
38
|
+
action?: WebhookActionType;
|
|
39
|
+
config?: WebhookActionConfig;
|
|
28
40
|
lastTriggered?: string;
|
|
29
41
|
lastError?: string;
|
|
30
42
|
createdAt: string;
|
|
@@ -38,6 +50,8 @@ interface CreateWebhookData {
|
|
|
38
50
|
status?: "active" | "inactive";
|
|
39
51
|
secret?: string;
|
|
40
52
|
headers?: Record<string, string>;
|
|
53
|
+
action?: WebhookActionType;
|
|
54
|
+
config?: WebhookActionConfig;
|
|
41
55
|
}
|
|
42
56
|
interface UpdateWebhookData {
|
|
43
57
|
name?: string;
|
|
@@ -47,6 +61,8 @@ interface UpdateWebhookData {
|
|
|
47
61
|
status?: "active" | "inactive" | "error";
|
|
48
62
|
secret?: string;
|
|
49
63
|
headers?: Record<string, string>;
|
|
64
|
+
action?: WebhookActionType;
|
|
65
|
+
config?: WebhookActionConfig;
|
|
50
66
|
lastTriggered?: string | null;
|
|
51
67
|
lastError?: string | null;
|
|
52
68
|
}
|
|
@@ -92,6 +108,22 @@ interface WebhookTriggerResult {
|
|
|
92
108
|
}
|
|
93
109
|
declare const WEBHOOK_COLLECTION = "_webhooks";
|
|
94
110
|
declare const WEBHOOK_DELIVERY_COLLECTION = "_webhook_deliveries";
|
|
111
|
+
interface DeliveryResult {
|
|
112
|
+
success: boolean;
|
|
113
|
+
status: number;
|
|
114
|
+
statusText?: string;
|
|
115
|
+
body?: string;
|
|
116
|
+
duration: number;
|
|
117
|
+
error?: string;
|
|
118
|
+
}
|
|
119
|
+
interface DeliveryOptions {
|
|
120
|
+
timeout?: number;
|
|
121
|
+
maxRetries?: number;
|
|
122
|
+
retryDelay?: number;
|
|
123
|
+
onRetry?: (attempt: number, error: string) => void;
|
|
124
|
+
onSuccess?: (result: DeliveryResult) => void;
|
|
125
|
+
onFailure?: (error: string) => void;
|
|
126
|
+
}
|
|
95
127
|
|
|
96
128
|
declare class WebhookService {
|
|
97
129
|
private db;
|
|
@@ -112,4 +144,4 @@ declare class WebhookService {
|
|
|
112
144
|
}
|
|
113
145
|
declare function createWebhookService(db: BaseAdapter): WebhookService;
|
|
114
146
|
|
|
115
|
-
export { ALL_WEBHOOK_EVENTS as A, type CreateWebhookData as C, type UpdateWebhookData as U, type WebhookPayload as W, type WebhookDelivery as a, type WebhookConfig as b,
|
|
147
|
+
export { ALL_WEBHOOK_EVENTS as A, type CreateWebhookData as C, type DeliveryResult as D, type UpdateWebhookData as U, type WebhookPayload as W, type WebhookDelivery as a, type WebhookConfig as b, type DeliveryOptions as c, WebhookService as d, WEBHOOK_COLLECTION as e, WEBHOOK_DELIVERY_COLLECTION as f, WEBHOOK_EVENTS as g, type WebhookEvent as h, type WebhookTriggerResult as i, createWebhookService as j };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkFKTZLM2C_cjs=require('./chunk-FKTZLM2C.cjs');require('./chunk-HQND27DT.cjs'),require('./chunk-UJNSOOYZ.cjs'),require('./chunk-65G73T7Z.cjs'),require('./chunk-KD7LUCFY.cjs'),require('./chunk-ER2PUSHG.cjs'),require('./chunk-HS2KNFAB.cjs'),require('./chunk-APQOYPRT.cjs'),require('./chunk-AJAZ7D3W.cjs'),require('./chunk-WIZ6C5QZ.cjs'),require('./chunk-GFU7AOI3.cjs'),require('./chunk-ET6NN2V2.cjs'),require('./chunk-HVXO3OFB.cjs'),require('./chunk-WE46GGL4.cjs'),require('./chunk-NY47CFVP.cjs'),require('./chunk-G3J2EU5D.cjs'),require('./chunk-4ORJMSJU.cjs'),require('./chunk-5KGQOTLK.cjs'),require('./chunk-GYQMNXXW.cjs'),require('./chunk-MIOMMB23.cjs'),require('./chunk-UBHFUFD4.cjs'),require('./chunk-UCCFT5OO.cjs'),require('./chunk-ATLSIYRH.cjs'),require('./chunk-EJDIR56C.cjs'),require('./chunk-Q3Q7BJVQ.cjs'),require('./chunk-AHSFSERC.cjs');function n(e){return new Response(e.body,e)}var p={graphqlEnabled:false,trpcEnabled:false,wsEnabled:false,requireAuth:false};function r(){return new Response(JSON.stringify({error:"GraphQL is disabled"}),{status:503,headers:{"Content-Type":"application/json"}})}async function o(){try{return (await chunkFKTZLM2C_cjs.a.db.findOne({collection:"_globals_access-settings",where:{},draft:!0}))?.apiAccess?.graphqlEnabled??p.graphqlEnabled}catch{return true}}var l=async e=>{if(await chunkFKTZLM2C_cjs.b(),!await o())return r();let t=await chunkFKTZLM2C_cjs.a.getGraphQL().fetch(e.request,e.locals);return n(t)},u=async e=>{if(await chunkFKTZLM2C_cjs.b(),!await o())return r();let t=await chunkFKTZLM2C_cjs.a.getGraphQL().fetch(e.request,e.locals);return n(t)};exports.GET=u;exports.POST=l;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b,a}from'./chunk-
|
|
1
|
+
import {b,a}from'./chunk-BRAWV32L.js';import'./chunk-WRSQOKRF.js';import'./chunk-FO3HLBC7.js';import'./chunk-NZ35PV5R.js';import'./chunk-5SEHX7ON.js';import'./chunk-5BPMMIAQ.js';import'./chunk-PP7W5UKL.js';import'./chunk-QMPMY2WI.js';import'./chunk-7WOX27LK.js';import'./chunk-K6WUOU6P.js';import'./chunk-AE6GXUT7.js';import'./chunk-2W4FK6CJ.js';import'./chunk-NRLIGDYF.js';import'./chunk-KG7V6O2Z.js';import'./chunk-HLSB2MCK.js';import'./chunk-GKYEJ2UF.js';import'./chunk-PP5S2UBV.js';import'./chunk-76RLJA6S.js';import'./chunk-RHCWCG3O.js';import'./chunk-OG7CNQGU.js';import'./chunk-QRXDCV6K.js';import'./chunk-YPDRUVWG.js';import'./chunk-P7CESLDJ.js';import'./chunk-TQNM4C7H.js';import'./chunk-KDNYHLD2.js';import'./chunk-5J6HXUF6.js';function n(e){return new Response(e.body,e)}var p={graphqlEnabled:false,trpcEnabled:false,wsEnabled:false,requireAuth:false};function r(){return new Response(JSON.stringify({error:"GraphQL is disabled"}),{status:503,headers:{"Content-Type":"application/json"}})}async function o(){try{return (await a.db.findOne({collection:"_globals_access-settings",where:{},draft:!0}))?.apiAccess?.graphqlEnabled??p.graphqlEnabled}catch{return true}}var l=async e=>{if(await b(),!await o())return r();let t=await a.getGraphQL().fetch(e.request,e.locals);return n(t)},u=async e=>{if(await b(),!await o())return r();let t=await a.getGraphQL().fetch(e.request,e.locals);return n(t)};export{u as GET,l as POST};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkFKTZLM2C_cjs=require('./chunk-FKTZLM2C.cjs');require('./chunk-HQND27DT.cjs'),require('./chunk-UJNSOOYZ.cjs'),require('./chunk-65G73T7Z.cjs'),require('./chunk-KD7LUCFY.cjs'),require('./chunk-ER2PUSHG.cjs'),require('./chunk-HS2KNFAB.cjs'),require('./chunk-APQOYPRT.cjs'),require('./chunk-AJAZ7D3W.cjs'),require('./chunk-WIZ6C5QZ.cjs'),require('./chunk-GFU7AOI3.cjs'),require('./chunk-ET6NN2V2.cjs'),require('./chunk-HVXO3OFB.cjs'),require('./chunk-WE46GGL4.cjs'),require('./chunk-NY47CFVP.cjs'),require('./chunk-G3J2EU5D.cjs'),require('./chunk-4ORJMSJU.cjs'),require('./chunk-5KGQOTLK.cjs'),require('./chunk-GYQMNXXW.cjs'),require('./chunk-MIOMMB23.cjs'),require('./chunk-UBHFUFD4.cjs'),require('./chunk-UCCFT5OO.cjs'),require('./chunk-ATLSIYRH.cjs'),require('./chunk-EJDIR56C.cjs'),require('./chunk-Q3Q7BJVQ.cjs'),require('./chunk-AHSFSERC.cjs');function n(){return new Response(JSON.stringify({error:"tRPC is disabled"}),{status:503,headers:{"Content-Type":"application/json"}})}var r={graphqlEnabled:false,trpcEnabled:false,wsEnabled:false,requireAuth:false};async function s(){try{return (await chunkFKTZLM2C_cjs.a.db.findOne({collection:"_globals_access-settings",where:{},draft:!0}))?.apiAccess?.trpcEnabled??r.trpcEnabled}catch{return true}}var i=async e=>(await chunkFKTZLM2C_cjs.b(),await s()?chunkFKTZLM2C_cjs.a.getTRPC().fetch(e.request,e.locals):n());exports.ALL=i;
|
package/dist/api-handler-trpc.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b,a}from'./chunk-
|
|
1
|
+
import {b,a}from'./chunk-BRAWV32L.js';import'./chunk-WRSQOKRF.js';import'./chunk-FO3HLBC7.js';import'./chunk-NZ35PV5R.js';import'./chunk-5SEHX7ON.js';import'./chunk-5BPMMIAQ.js';import'./chunk-PP7W5UKL.js';import'./chunk-QMPMY2WI.js';import'./chunk-7WOX27LK.js';import'./chunk-K6WUOU6P.js';import'./chunk-AE6GXUT7.js';import'./chunk-2W4FK6CJ.js';import'./chunk-NRLIGDYF.js';import'./chunk-KG7V6O2Z.js';import'./chunk-HLSB2MCK.js';import'./chunk-GKYEJ2UF.js';import'./chunk-PP5S2UBV.js';import'./chunk-76RLJA6S.js';import'./chunk-RHCWCG3O.js';import'./chunk-OG7CNQGU.js';import'./chunk-QRXDCV6K.js';import'./chunk-YPDRUVWG.js';import'./chunk-P7CESLDJ.js';import'./chunk-TQNM4C7H.js';import'./chunk-KDNYHLD2.js';import'./chunk-5J6HXUF6.js';function n(){return new Response(JSON.stringify({error:"tRPC is disabled"}),{status:503,headers:{"Content-Type":"application/json"}})}var r={graphqlEnabled:false,trpcEnabled:false,wsEnabled:false,requireAuth:false};async function s(){try{return (await a.db.findOne({collection:"_globals_access-settings",where:{},draft:!0}))?.apiAccess?.trpcEnabled??r.trpcEnabled}catch{return true}}var i=async e=>(await b(),await s()?a.getTRPC().fetch(e.request,e.locals):n());export{i as ALL};
|
package/dist/api-handler.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkFKTZLM2C_cjs=require('./chunk-FKTZLM2C.cjs');require('./chunk-HQND27DT.cjs'),require('./chunk-UJNSOOYZ.cjs'),require('./chunk-65G73T7Z.cjs'),require('./chunk-KD7LUCFY.cjs'),require('./chunk-ER2PUSHG.cjs'),require('./chunk-HS2KNFAB.cjs'),require('./chunk-APQOYPRT.cjs'),require('./chunk-AJAZ7D3W.cjs'),require('./chunk-WIZ6C5QZ.cjs'),require('./chunk-GFU7AOI3.cjs'),require('./chunk-ET6NN2V2.cjs'),require('./chunk-HVXO3OFB.cjs'),require('./chunk-WE46GGL4.cjs'),require('./chunk-NY47CFVP.cjs'),require('./chunk-G3J2EU5D.cjs'),require('./chunk-4ORJMSJU.cjs'),require('./chunk-5KGQOTLK.cjs'),require('./chunk-GYQMNXXW.cjs'),require('./chunk-MIOMMB23.cjs'),require('./chunk-UBHFUFD4.cjs'),require('./chunk-UCCFT5OO.cjs'),require('./chunk-ATLSIYRH.cjs'),require('./chunk-EJDIR56C.cjs'),require('./chunk-Q3Q7BJVQ.cjs'),require('./chunk-AHSFSERC.cjs');Object.defineProperty(exports,"ALL",{enumerable:true,get:function(){return chunkFKTZLM2C_cjs.c}});Object.defineProperty(exports,"kyroInstance",{enumerable:true,get:function(){return chunkFKTZLM2C_cjs.a}});Object.defineProperty(exports,"warmKyroInstance",{enumerable:true,get:function(){return chunkFKTZLM2C_cjs.b}});
|
package/dist/api-handler.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{c as ALL,a as kyroInstance,b as warmKyroInstance}from'./chunk-
|
|
1
|
+
export{c as ALL,a as kyroInstance,b as warmKyroInstance}from'./chunk-BRAWV32L.js';import'./chunk-WRSQOKRF.js';import'./chunk-FO3HLBC7.js';import'./chunk-NZ35PV5R.js';import'./chunk-5SEHX7ON.js';import'./chunk-5BPMMIAQ.js';import'./chunk-PP7W5UKL.js';import'./chunk-QMPMY2WI.js';import'./chunk-7WOX27LK.js';import'./chunk-K6WUOU6P.js';import'./chunk-AE6GXUT7.js';import'./chunk-2W4FK6CJ.js';import'./chunk-NRLIGDYF.js';import'./chunk-KG7V6O2Z.js';import'./chunk-HLSB2MCK.js';import'./chunk-GKYEJ2UF.js';import'./chunk-PP5S2UBV.js';import'./chunk-76RLJA6S.js';import'./chunk-RHCWCG3O.js';import'./chunk-OG7CNQGU.js';import'./chunk-QRXDCV6K.js';import'./chunk-YPDRUVWG.js';import'./chunk-P7CESLDJ.js';import'./chunk-TQNM4C7H.js';import'./chunk-KDNYHLD2.js';import'./chunk-5J6HXUF6.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BaseAdapter, C as CollectionConfig, G as GlobalConfig, T as TenantContext, F as FindArgs, b as FindResult, c as FindByIDArgs, d as CreateArgs, e as UpdateArgs, D as DeleteArgs, f as FindVersionsArgs, g as VersionRecord, h as CreateVersionArgs } from './types-
|
|
2
|
-
import { F as Field, k as RelationshipField, U as UploadField } from './types-
|
|
1
|
+
import { B as BaseAdapter, C as CollectionConfig, G as GlobalConfig, T as TenantContext, F as FindArgs, b as FindResult, c as FindByIDArgs, d as CreateArgs, e as UpdateArgs, D as DeleteArgs, f as FindVersionsArgs, g as VersionRecord, h as CreateVersionArgs } from './types-Bj3d_ys8.js';
|
|
2
|
+
import { F as Field, k as RelationshipField, U as UploadField } from './types-fvldOd92.js';
|
|
3
3
|
|
|
4
4
|
declare abstract class AbstractBaseAdapter implements BaseAdapter {
|
|
5
5
|
protected collections: Map<string, CollectionConfig>;
|
|
@@ -19,19 +19,19 @@ declare abstract class AbstractBaseAdapter implements BaseAdapter {
|
|
|
19
19
|
abstract count(args: {
|
|
20
20
|
collection: string;
|
|
21
21
|
where?: Record<string, any>;
|
|
22
|
-
|
|
22
|
+
tenantId?: string;
|
|
23
23
|
}): Promise<number>;
|
|
24
24
|
abstract findOne(args: {
|
|
25
25
|
collection: string;
|
|
26
26
|
where: Record<string, any>;
|
|
27
|
-
|
|
27
|
+
tenantId?: string;
|
|
28
28
|
draft?: boolean;
|
|
29
29
|
}): Promise<any>;
|
|
30
30
|
abstract findVersions(args: FindVersionsArgs): Promise<FindResult<VersionRecord>>;
|
|
31
31
|
abstract findVersionByID(args: {
|
|
32
32
|
collection: string;
|
|
33
33
|
versionId: string;
|
|
34
|
-
|
|
34
|
+
tenantId?: string;
|
|
35
35
|
}): Promise<VersionRecord | null>;
|
|
36
36
|
abstract createVersion<T = Record<string, any>>(args: CreateVersionArgs<T>): Promise<VersionRecord<T>>;
|
|
37
37
|
abstract updateLatestVersion<T = Record<string, any>>(args: CreateVersionArgs<T>): Promise<VersionRecord<T>>;
|
|
@@ -39,13 +39,13 @@ declare abstract class AbstractBaseAdapter implements BaseAdapter {
|
|
|
39
39
|
collection: string;
|
|
40
40
|
documentId: string;
|
|
41
41
|
keepLatest?: number;
|
|
42
|
-
|
|
42
|
+
tenantId?: string;
|
|
43
43
|
}): Promise<void>;
|
|
44
44
|
migrate?(): Promise<void>;
|
|
45
45
|
rollback?(): Promise<void>;
|
|
46
46
|
transaction?<T>(fn: (tx: any) => Promise<T>): Promise<T>;
|
|
47
47
|
protected getCollection(slug: string): CollectionConfig;
|
|
48
|
-
protected applyTenantFilter(where?: Record<string, any>,
|
|
48
|
+
protected applyTenantFilter(where?: Record<string, any>, tenantId?: string): Record<string, any>;
|
|
49
49
|
protected getTableName(slug: string): string;
|
|
50
50
|
protected prepareData(data: Record<string, any>, collection: CollectionConfig): Record<string, any>;
|
|
51
51
|
protected processRelationships(data: Record<string, any>, fields: Field[], depth: number): Record<string, any>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as BaseAdapter, C as CollectionConfig, G as GlobalConfig, T as TenantContext, F as FindArgs, b as FindResult, c as FindByIDArgs, d as CreateArgs, e as UpdateArgs, D as DeleteArgs, f as FindVersionsArgs, g as VersionRecord, h as CreateVersionArgs } from './types-
|
|
2
|
-
import { F as Field, k as RelationshipField, U as UploadField } from './types-
|
|
1
|
+
import { B as BaseAdapter, C as CollectionConfig, G as GlobalConfig, T as TenantContext, F as FindArgs, b as FindResult, c as FindByIDArgs, d as CreateArgs, e as UpdateArgs, D as DeleteArgs, f as FindVersionsArgs, g as VersionRecord, h as CreateVersionArgs } from './types-BowAPGjD.cjs';
|
|
2
|
+
import { F as Field, k as RelationshipField, U as UploadField } from './types-fvldOd92.cjs';
|
|
3
3
|
|
|
4
4
|
declare abstract class AbstractBaseAdapter implements BaseAdapter {
|
|
5
5
|
protected collections: Map<string, CollectionConfig>;
|
|
@@ -19,19 +19,19 @@ declare abstract class AbstractBaseAdapter implements BaseAdapter {
|
|
|
19
19
|
abstract count(args: {
|
|
20
20
|
collection: string;
|
|
21
21
|
where?: Record<string, any>;
|
|
22
|
-
|
|
22
|
+
tenantId?: string;
|
|
23
23
|
}): Promise<number>;
|
|
24
24
|
abstract findOne(args: {
|
|
25
25
|
collection: string;
|
|
26
26
|
where: Record<string, any>;
|
|
27
|
-
|
|
27
|
+
tenantId?: string;
|
|
28
28
|
draft?: boolean;
|
|
29
29
|
}): Promise<any>;
|
|
30
30
|
abstract findVersions(args: FindVersionsArgs): Promise<FindResult<VersionRecord>>;
|
|
31
31
|
abstract findVersionByID(args: {
|
|
32
32
|
collection: string;
|
|
33
33
|
versionId: string;
|
|
34
|
-
|
|
34
|
+
tenantId?: string;
|
|
35
35
|
}): Promise<VersionRecord | null>;
|
|
36
36
|
abstract createVersion<T = Record<string, any>>(args: CreateVersionArgs<T>): Promise<VersionRecord<T>>;
|
|
37
37
|
abstract updateLatestVersion<T = Record<string, any>>(args: CreateVersionArgs<T>): Promise<VersionRecord<T>>;
|
|
@@ -39,13 +39,13 @@ declare abstract class AbstractBaseAdapter implements BaseAdapter {
|
|
|
39
39
|
collection: string;
|
|
40
40
|
documentId: string;
|
|
41
41
|
keepLatest?: number;
|
|
42
|
-
|
|
42
|
+
tenantId?: string;
|
|
43
43
|
}): Promise<void>;
|
|
44
44
|
migrate?(): Promise<void>;
|
|
45
45
|
rollback?(): Promise<void>;
|
|
46
46
|
transaction?<T>(fn: (tx: any) => Promise<T>): Promise<T>;
|
|
47
47
|
protected getCollection(slug: string): CollectionConfig;
|
|
48
|
-
protected applyTenantFilter(where?: Record<string, any>,
|
|
48
|
+
protected applyTenantFilter(where?: Record<string, any>, tenantId?: string): Record<string, any>;
|
|
49
49
|
protected getTableName(slug: string): string;
|
|
50
50
|
protected prepareData(data: Record<string, any>, collection: CollectionConfig): Record<string, any>;
|
|
51
51
|
protected processRelationships(data: Record<string, any>, fields: Field[], depth: number): Record<string, any>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import {a}from'./chunk-NZ35PV5R.js';import {b as b$1}from'./chunk-AE6GXUT7.js';var x={};var C={};var S={},le=[];var h={},ae=[];var R={};var j={slug:"media",label:"Media Library",admin:{useAsTitle:"title",defaultColumns:["thumbnailUrl","title","type","fileSize","createdAt"],group:"content"},access:{read:()=>true,create:()=>true,update:()=>true,delete:()=>true},fields:[{name:"title",type:"text",label:"Title",required:true,admin:{description:"Descriptive title for the file"}},{name:"filename",type:"text",label:"Filename",required:true,admin:{readOnly:true,description:"System filename (auto-generated)"}},{name:"originalName",type:"text",label:"Original Name",admin:{readOnly:true}},{name:"alt",type:"text",label:"Alt Text",admin:{description:"Alternative text for images (accessibility)"}},{name:"caption",type:"richtext",label:"Caption",admin:{description:"Optional caption or description"}},{name:"type",type:"select",label:"File Type",required:true,defaultValue:"document",options:[{label:"Image",value:"image"},{label:"Video",value:"video"},{label:"Audio",value:"audio"},{label:"Document",value:"document"},{label:"Archive",value:"archive"},{label:"Other",value:"other"}],admin:{readOnly:true}},{name:"mimeType",type:"text",label:"MIME Type",admin:{readOnly:true}},{name:"url",type:"text",label:"URL",required:true,admin:{readOnly:true,description:"Public URL of the file"}},{name:"thumbnailUrl",type:"text",label:"Thumbnail URL",admin:{readOnly:true}},{name:"width",type:"number",label:"Width",admin:{readOnly:true,description:"Width in pixels (for images/videos)"}},{name:"height",type:"number",label:"Height",admin:{readOnly:true,description:"Height in pixels (for images/videos)"}},{name:"fileSize",type:"number",label:"File Size",admin:{readOnly:true,description:"Size in bytes"}},{name:"folder",type:"text",label:"Folder",admin:{description:"Folder path for organization (e.g., /products, /blog)"}},{name:"tags",type:"array",label:"Tags",fields:[{name:"tag",type:"text",label:"Tag"}]},{name:"focalPoint",type:"group",label:"Focal Point",admin:{description:"Point of interest for cropping"},fields:[{name:"x",type:"number",label:"X",defaultValue:50},{name:"y",type:"number",label:"Y",defaultValue:50}]},{name:"metadata",type:"json",label:"Metadata",admin:{readOnly:true,description:"Additional file metadata (EXIF, etc.)"}},{name:"provider",type:"select",label:"Storage Provider",defaultValue:"local",options:[{label:"Local",value:"local"},{label:"AWS S3",value:"s3"},{label:"Cloudinary",value:"cloudinary"},{label:"Imgix",value:"imgix"}],admin:{readOnly:true}},{name:"status",type:"select",label:"Status",defaultValue:"active",options:[{label:"Active",value:"active"},{label:"Archived",value:"archived"}]},{name:"createdAt",type:"date",label:"Created",admin:{readOnly:true}},{name:"updatedAt",type:"date",label:"Last Modified",admin:{readOnly:true}}]},v=[j];var H={slug:"menu",label:"Menu",singularLabel:"Menu Item",admin:{useAsTitle:"title",defaultColumns:["title","menuLocation"]},fields:[{name:"title",type:"text",label:"Title",required:true},{name:"menuLocation",type:"select",label:"Location",options:[{label:"Choose Location",value:""},{label:"Header",value:"header"},{label:"Footer",value:"footer"},{label:"Sidebar",value:"sidebar"},{label:"Primary",value:"primary"},{label:"Secondary",value:"secondary"}],required:true,admin:{position:"sidebar"}},{name:"order",type:"number",label:"Order",admin:{position:"sidebar"}},{name:"menu",type:"group",fields:[{name:"menuItem",label:"Menu Item",type:"array",fields:[{name:"linkType",type:"select",label:"Type",options:[{label:"Internal",value:"internal"},{label:"External",value:"external"}]},{name:"internalTarget",type:"relationship",label:"Target",relationTo:["pages","posts"],admin:{condition:{field:"linkType",equals:"internal"}}},{name:"externalUrl",type:"text",label:"URL",admin:{condition:{field:"linkType",equals:"external"}}}]}]}]},M={menu:H};var K={slug:"posts",label:"Posts",labelPlural:"Posts",singularLabel:"Post",admin:{useAsTitle:"title",defaultColumns:["title","slug","status","createdAt","updatedAt"],description:"Blog posts and articles"},seo:true,fields:[{name:"tabs",type:"tabs",tabs:[{label:"Content",fields:[{name:"title",type:"text",required:true,label:"Title",admin:{description:"The main title of the post as it will appear publicly."}},{name:"content",type:"richtext",label:"Content"},{name:"excerpt",type:"textarea",label:"Excerpt",admin:{description:"A short summary of the post."}}]},{label:"Meta",fields:[{name:"category",type:"relationship",label:"Category",relationTo:"categories",admin:{description:"Select the primary category this post belongs to."}},{name:"relatedPosts",type:"array",label:"Related Posts",fields:[{name:"post",type:"relationship",relationTo:"posts",label:"Post"}],admin:{description:"Select posts related to this one."}}]}]},{name:"slug",type:"text",required:true,label:"Slug",admin:{description:"The URL-friendly identifier for the post.",position:"sidebar",autoGenerate:"title"}},{name:"tags",type:"list",label:"Tags",admin:{description:"Add keywords to help categorize your post.",position:"sidebar"}},{name:"authors",type:"array",label:"Authors",fields:[{name:"user",type:"relationship",label:"User",relationTo:"users"}],admin:{description:"Select one or more authors for this post.",position:"sidebar"}},{name:"featured",type:"checkbox",label:"Featured",defaultValue:false,admin:{description:"Highlight this post as a featured article.",position:"sidebar"}},{name:"featuredImage",type:"upload",label:"Featured Image",relationTo:"media",admin:{description:"The primary visual used to represent this post.",position:"sidebar"}},{name:"readTime",type:"number",label:"Read Time (mins)",admin:{description:"Estimated reading time in minutes.",position:"sidebar",readOnly:true}}],hooks:{beforeChange:[({data:e})=>{if(e?.content){let i="",l=a=>{a.type==="text"&&a.text&&(i+=a.text+" "),a.content&&Array.isArray(a.content)&&a.content.forEach(l);};typeof e.content=="object"&&e.content!==null?l(e.content):typeof e.content=="string"&&(i=e.content.replace(/<[^>]*>?/gm," "));let q=i.trim().split(/\s+/).filter(a=>a.length>0);e.readTime=Math.max(1,Math.ceil(q.length/200));}else e.readTime=0;return e}]},timestamps:true,versions:{drafts:true,maxPerDoc:10}},B={posts:K};function t(e){return {...e,fields:[...[],...e.fields,...be]}}var ie=[{name:"text",type:"text",label:"Label"},{name:"url",type:"text",label:"URL"}],d={name:"buttons",type:"array",label:"Action Buttons",fields:ie},oe={slug:"headingElement",label:"Heading",admin:{group:"Basic Content Elements",description:"Section heading"},fields:[{name:"content",type:"text",label:"Content"}]},ne={slug:"textElement",label:"Text",admin:{group:"Basic Content Elements",description:"Plain text paragraph"},fields:[{name:"content",type:"textarea",label:"Content"}]},re={slug:"imageElement",label:"Image",admin:{group:"Basic Content Elements",description:"Single image"},fields:[{name:"image",type:"upload",label:"Image",relationTo:"media"}]},se={slug:"richtextElement",label:"Rich Text",admin:{group:"Basic Content Elements",description:"Formatted rich text content"},fields:[{name:"content",type:"richtext",label:"Content"}]},me={slug:"buttonElement",label:"Button",admin:{group:"Basic Content Elements",description:"Call-to-action button"},fields:[{name:"buttonData",type:"group",label:"Button",admin:{inline:true},fields:[{name:"text",type:"text",label:"Label"},{name:"url",type:"text",label:"URL"}]}]},ue={slug:"videoElement",label:"Video",admin:{group:"Basic Content Elements",description:"Embedded video player"},fields:[{name:"url",type:"text",label:"Video URL"},{name:"file",type:"upload",label:"Video File",relationTo:"media"},{name:"caption",type:"text",label:"Caption"}]},pe={slug:"listElement",label:"List",admin:{group:"Basic Content Elements",description:"Bulleted or numbered list"},fields:[{name:"items",type:"array",label:"Items",fields:[{name:"text",type:"text",label:"Item Text"}]}]},de=[oe,ne,re,se,me,ue,pe],ce={name:"elements",type:"blocks",label:"Extra Content Elements",blocks:de,admin:{pickerMode:"dropdown"}},be=[ce],ye=t({slug:"hero",admin:{group:"Structural Sections",description:"Primary landing section with heading, text, media & CTA"},label:"Hero Section",fields:[{name:"isMultiScreen",type:"checkbox",label:"Enable Carousel",defaultValue:false},{name:"multiSlides",type:"group",label:"Multi Slides",admin:{condition:{field:"isMultiScreen",equals:true}},fields:[{name:"multiSlides",type:"array",label:"Hero Slides",fields:[{name:"title",type:"text",label:"Heading"},{name:"subtitle",type:"textarea",label:"Subheading"},{name:"backgroundImage",type:"upload",label:"Background Image",relationTo:"media"},d]}]},{name:"singleSlide",type:"group",label:"Single Slide",admin:{condition:{field:"isMultiScreen",equals:false}},fields:[{name:"title",type:"text",label:"Heading"},{name:"subtitle",type:"textarea",label:"Subheading"},{name:"backgroundImage",type:"upload",label:"Background Image",relationTo:"media"},d]}]}),ge=t({slug:"card",admin:{group:"Structural Sections",description:"Modular card block featuring title, text, and optional media"},label:"Card Block",fields:[{name:"isMultiCard",type:"checkbox",label:"Enable Multicard Layout",defaultValue:false},{name:"multiCards",type:"group",label:"Multi Cards",admin:{condition:{field:"isMultiCard",equals:true}},fields:[{name:"cards",type:"array",label:"Cards List",fields:[{name:"title",type:"text",label:"Title"},{name:"description",type:"textarea",label:"Description"},{name:"image",type:"upload",label:"Image",relationTo:"media"},{name:"icon",type:"icon",label:"Icon"},{name:"linkText",type:"text",label:"Link Text"},{name:"link",type:"text",label:"URL"}]}]},{name:"singleCard",type:"group",label:"Single Card",admin:{condition:{field:"isMultiCard",equals:false}},fields:[{name:"title",type:"text",label:"Title"},{name:"description",type:"textarea",label:"Description"},{name:"image",type:"upload",label:"Image",relationTo:"media"},{name:"icon",type:"icon",label:"Icon"},{name:"linkText",type:"text",label:"Link Text"},{name:"link",type:"text",label:"URL"}]}]});t({slug:"text",admin:{group:"Basic Content Elements",description:"Rich text content"},label:"Text Block",fields:[{name:"content",type:"richtext",label:"Content"}]});t({slug:"image",admin:{group:"Basic Content Elements",description:"Image upload container"},label:"Image",fields:[{name:"image",type:"upload",label:"Image",relationTo:"media"},{name:"caption",type:"text",label:"Caption"},{name:"alt",type:"text",label:"Alt Text"},{name:"aspectRatio",type:"select",label:"Aspect Ratio",defaultValue:"original",options:[{label:"Original",value:"original"},{label:"16:9 Landscape",value:"16-9"},{label:"4:3 Classic",value:"4-3"},{label:"1:1 Square",value:"1-1"},{label:"2:3 Portrait",value:"2-3"}]},{name:"enableLightbox",type:"checkbox",label:"Enable Zoom / Lightbox",defaultValue:false}]});var fe=t({slug:"featureSplit",admin:{group:"Structural Sections",description:"Side-by-side text and media layout"},label:"Feature Split (Text & Media)",fields:[{name:"title",type:"text",label:"Title"},{name:"description",type:"textarea",label:"Description"},{name:"checkpoints",type:"array",label:"Value Checkpoints",fields:[{name:"title",type:"text",label:"Checkpoint Title"},{name:"description",type:"textarea",label:"Checkpoint Description"},{name:"icon",type:"icon",label:"Icon Name"},{name:"image",type:"upload",label:"Image",relationTo:"media"},{name:"itemUrl",type:"text",label:"Link URL"},{name:"itemText",type:"text",label:"Link Text"}]},{name:"images",type:"array",label:"Images",fields:[{name:"image",type:"upload",label:"Image",relationTo:"media"}]},d]}),xe=t({slug:"featureGrid",admin:{group:"Marketing Grids",description:"Multi-column grid showcasing features or services"},label:"Feature Grid",fields:[{name:"title",type:"text",label:"Section Heading"},{name:"subtitle",type:"textarea",label:"Section Subtitle"},{name:"features",type:"array",label:"Features List",fields:[{name:"title",type:"text",label:"Title"},{name:"description",type:"textarea",label:"Description"},{name:"icon",type:"icon",label:"Icon Name"},{name:"image",type:"upload",label:"Feature Image",relationTo:"media"},{name:"itemUrl",type:"text",label:"Card Redirection URL"}]}]}),Ce=t({slug:"ctaBanner",admin:{group:"Structural Sections",description:"High-impact call-to-action banner"},label:"CTA Banner",fields:[{name:"title",type:"text",label:"Headline"},{name:"subtitle",type:"textarea",label:"Subheading"},{name:"backgroundImage",type:"upload",label:"Background Image",relationTo:"media"},d]}),Se=t({slug:"testimonials",admin:{group:"Marketing Grids",description:"Customer reviews and quotes carousel"},label:"Testimonials",fields:[{name:"title",type:"text",label:"Section Heading"},{name:"subtitle",type:"text",label:"Section Subheading"},{name:"items",type:"array",label:"Testimonials",fields:[{name:"authorName",type:"text",label:"Author Name"},{name:"quote",type:"textarea",label:"Quote"},{name:"rating",type:"select",label:"Star Rating",defaultValue:"5",options:[{label:"5 Stars",value:"5"},{label:"4 Stars",value:"4"},{label:"3 Stars",value:"3"},{label:"2 Stars",value:"2"},{label:"1 Star",value:"1"}]},{name:"authorRole",type:"text",label:"Author Role"},{name:"avatar",type:"upload",label:"Avatar",relationTo:"media"},{name:"companyLogo",type:"upload",label:"Company Logo",relationTo:"media"}]}]}),he=t({slug:"faq",admin:{group:"Lead Capture & Interactive",description:"Expandable list of frequently asked questions"},label:"FAQ Section",fields:[{name:"title",type:"text",label:"Section Heading"},{name:"items",type:"array",label:"Questions List",fields:[{name:"tag",type:"text",label:"Category Tag (e.g. billing, account)"},{name:"question",type:"text",label:"Question"},{name:"answer",type:"textarea",label:"Answer"}]},{name:"footerTitle",type:"text",label:"Footer Heading (e.g. Still have questions?)"},{name:"footerCtaUrl",type:"text",label:"Footer CTA Redirection URL"}]}),ve=t({slug:"stats",admin:{group:"Marketing Grids",description:"Grid displaying key numerical metrics and stats"},label:"Stats / Metrics",fields:[{name:"title",type:"text",label:"Section Heading"},{name:"description",type:"textarea",label:"Description"},{name:"items",type:"array",label:"Stats List",fields:[{name:"prefix",type:"text",label:"Value Prefix (e.g. + or $)"},{name:"value",type:"text",label:"Value (e.g. 99.9 or 5M)"},{name:"suffix",type:"text",label:"Value Suffix (e.g. % or users)"},{name:"label",type:"text",label:"Label (e.g. Uptime)"},{name:"description",type:"textarea",label:"Context Description"}]}]}),Te=t({slug:"logoCloud",admin:{group:"Structural Sections",description:"Showcase for partner and client company logos"},label:"Logo Cloud / Partners",fields:[{name:"title",type:"text",label:"Section Heading"},{name:"logos",type:"array",label:"Logos List",fields:[{name:"name",type:"text",label:"Company Name"},{name:"logo",type:"upload",label:"Logo Image",relationTo:"media"},{name:"url",type:"text",label:"Website URL"}]}]}),ke=t({slug:"pricing",admin:{group:"Marketing Grids",description:"Tiered pricing plans with feature comparisons"},label:"Pricing Plans",fields:[{name:"title",type:"text",label:"Section Heading"},{name:"subtitle",type:"textarea",label:"Section Subtitle"},{name:"annualDiscount",type:"text",label:"Annual Promo Tag (e.g. Save 20%)"},{name:"plans",type:"array",label:"Pricing Plans",fields:[{name:"popularBadgeText",type:"text",label:"Plan Badge (e.g. MOST POPULAR)"},{name:"name",type:"text",label:"Plan Name"},{name:"description",type:"textarea",label:"Plan Description"},{name:"currency",type:"text",label:"Plan Currency (e.g. $)",defaultValue:"$"},{name:"price",type:"text",label:"Price (e.g. 29)"},{name:"billingPeriod",type:"text",label:"Billing Period (e.g. /mo)"},{name:"features",type:"list",label:"Features Checklist"},d,{name:"footnote",type:"text",label:"Footnote note (e.g. *cancel anytime)"},{name:"isFeatured",type:"checkbox",label:"Highlight Plan (Featured)",defaultValue:false}]}]}),Pe=t({slug:"team",admin:{group:"Marketing Grids",description:"Showcase of team members with photos and roles"},label:"Team Showcase",fields:[{name:"title",type:"text",label:"Section Heading"},{name:"subtitle",type:"textarea",label:"Section Subtitle"},{name:"members",type:"array",label:"Team Members",fields:[{name:"name",type:"text",label:"Member Name"},{name:"role",type:"text",label:"Role / Position"},{name:"department",type:"text",label:"Department / Team tag (e.g. engineering, design)"},{name:"avatar",type:"upload",label:"Avatar Image",relationTo:"media"},{name:"bio",type:"textarea",label:"Brief Bio"},{name:"twitterUrl",type:"text",label:"Twitter URL"},{name:"linkedinUrl",type:"text",label:"LinkedIn URL"},{name:"githubUrl",type:"text",label:"GitHub URL"},{name:"websiteUrl",type:"text",label:"Website URL"}]}]}),Ae=t({slug:"recentFeed",admin:{group:"Dynamic Content",description:"Hand-picked showcase of items"},label:"Hand-Picked Feed",fields:[{name:"title",type:"text",label:"Section Heading"},{name:"subtitle",type:"textarea",label:"Section Subtitle"},{name:"selectedItems",type:"relationship",label:"Feed Items",relationTo:"*",hasMany:true},d]}),Le=t({slug:"processSteps",admin:{group:"Lead Capture & Interactive",description:"Numbered sequence illustrating a process or workflow"},label:"Process Steps / Timeline",fields:[{name:"title",type:"text",label:"Section Heading"},{name:"subtitle",type:"textarea",label:"Section Subtitle"},{name:"steps",type:"array",label:"Steps",fields:[{name:"stepNumber",type:"text",label:"Step Number (e.g. 01)"},{name:"icon",type:"upload",label:"Step Icon / Image",relationTo:"media"},{name:"title",type:"text",label:"Step Title"},{name:"description",type:"textarea",label:"Description"}]}]}),Ge=t({slug:"formEmbed",admin:{group:"Lead Capture & Interactive",description:"Embeddable interactive forms for lead capture"},label:"Form Embed",fields:[{name:"title",type:"text",label:"Form Title"},{name:"subtitle",type:"textarea",label:"Form Subtitle"},{name:"form",type:"relationship",relationTo:"forms",label:"Form",required:true}]}),Ee=t({slug:"videoShowcase",admin:{group:"Structural Sections",description:"Cinematic video player with custom thumbnail"},label:"Cinematic Video Showcase",fields:[{name:"title",type:"text",label:"Section Heading"},{name:"subtitle",type:"textarea",label:"Section Subtitle"},{name:"coverImage",type:"upload",label:"Cinematic Cover Image (Thumbnail)",relationTo:"media"},{name:"videoUrl",type:"text",label:"Video Embed URL (YouTube / Vimeo / MP4)"},{name:"videoTitle",type:"text",label:"Video Title (for accessibility & hover text)"},{name:"durationBadge",type:"text",label:"Duration Badge (e.g. '\u25B6 2:34')"},{name:"isLightbox",type:"checkbox",label:"Open in Cinematic Lightbox Modal",defaultValue:true},{name:"autoplay",type:"checkbox",label:"Autoplay Video (muted)",defaultValue:false}]}),z=[ye,ge,fe,xe,Ce,Se,he,ve,Te,ke,Pe,Ae,Le,Ge,Ee];var W={slug:"pages",label:"Pages",labelPlural:"Pages",singularLabel:"Page",admin:{useAsTitle:"title",defaultColumns:["title","slug","status","updatedAt"],description:"Standard web pages"},seo:true,fields:[{name:"tabs",type:"tabs",tabs:[{label:"Content",fields:[{name:"title",type:"text",required:true,label:"Title",admin:{description:"The main title of the page as it will appear publicly."}},{name:"content",type:"blocks",label:"Content",blocks:z}]},{label:"Meta",fields:[]}]},{name:"slug",type:"text",required:true,label:"Slug",admin:{position:"sidebar",autoGenerate:"title"}},{name:"featuredImage",type:"upload",label:"Featured Image",relationTo:"media",admin:{position:"sidebar"}}],timestamps:true,versions:{drafts:true,maxPerDoc:10}},F={pages:W};var Y={slug:"categories",label:"Categories",labelPlural:"Categories",singularLabel:"Category",admin:{useAsTitle:"name",defaultColumns:["name","slug"],description:"Post categories",layout:"split"},fields:[{name:"name",type:"text",required:true,label:"Name"},{name:"description",type:"textarea",label:"Description"},{name:"slug",type:"text",required:true,label:"Slug",admin:{position:"sidebar",autoGenerate:"name"}},{name:"icon",type:"upload",label:"Icon",relationTo:"media",admin:{position:"sidebar"}},{name:"parent",type:"relationship",label:"Parent Category",relationTo:"categories",admin:{position:"sidebar"}},{name:"order",type:"number",label:"Order",defaultValue:0,admin:{position:"sidebar"}}],timestamps:true,versions:{drafts:true,maxPerDoc:5}},V={categories:Y},X={slug:"product-categories",label:"Product Categories",labelPlural:"Product Categories",singularLabel:"Product Category",admin:{useAsTitle:"name",defaultColumns:["name","slug"],description:"Product categories for organizing your catalog"},fields:[{name:"name",type:"text",required:true,label:"Name"},{name:"slug",type:"text",required:true,label:"Slug",admin:{position:"sidebar",autoGenerate:"name"}},{name:"description",type:"textarea",label:"Description"},{name:"image",type:"text",label:"Image URL"},{name:"parent",type:"relationship",label:"Parent Category",relationTo:"product-categories",admin:{position:"sidebar"}}],timestamps:true,versions:{drafts:true,maxPerDoc:5}},T={"product-categories":X};var J={slug:"products",label:"Products",labelPlural:"Products",singularLabel:"Product",admin:{useAsTitle:"title",defaultColumns:["title","slug","price","inventory"],description:"E-commerce products"},seo:true,fields:[{name:"tabs",type:"tabs",tabs:[{label:"Content",fields:[{name:"title",type:"text",required:true,label:"Title"},{name:"description",type:"richtext",label:"Description"}]},{label:"Inventory & Pricing",fields:[{name:"price",type:"number",required:true,label:"Price"},{name:"compareAtPrice",type:"number",label:"Compare at Price",admin:{description:"Original price for sale display"}},{name:"costPrice",type:"number",label:"Cost Price",admin:{description:"For profit calculation"}},{name:"sku",type:"text",required:true,label:"SKU"},{name:"barcode",type:"text",label:"Barcode"},{name:"inventory",type:"number",label:"Inventory",defaultValue:0},{name:"images",type:"array",label:"Images",fields:[{name:"url",type:"text",label:"URL"},{name:"alt",type:"text",label:"Alt Text"}]},{name:"category",type:"relationship",label:"Category",relationTo:"product-categories"}]}]},{name:"slug",type:"text",required:true,label:"Slug",admin:{position:"sidebar",autoGenerate:"title"}}],timestamps:true,versions:{drafts:true}},k={products:J};var Q={slug:"customers",label:"Customers",labelPlural:"Customers",singularLabel:"Customer",admin:{useAsTitle:"email",defaultColumns:["email","firstName","lastName","createdAt","updatedAt"],description:"Customer accounts"},fields:[{name:"email",type:"email",required:true,label:"Email"},{name:"firstName",type:"text",label:"First Name"},{name:"lastName",type:"text",label:"Last Name"},{name:"phone",type:"text",label:"Phone"},{name:"addresses",type:"array",label:"Addresses",fields:[{name:"type",type:"text",label:"Type"},{name:"line1",type:"text",label:"Address Line 1"},{name:"line2",type:"text",label:"Address Line 2"},{name:"city",type:"text",label:"City"},{name:"state",type:"text",label:"State"},{name:"postalCode",type:"text",label:"Postal Code"},{name:"country",type:"text",label:"Country"}]},{name:"slug",type:"text",required:true,label:"Slug",admin:{position:"sidebar",autoGenerate:"email"}}],timestamps:true,versions:{drafts:true,maxPerDoc:5}},P={customers:Q};var _={slug:"orders",label:"Orders",labelPlural:"Orders",singularLabel:"Order",admin:{useAsTitle:"orderNumber",defaultColumns:["orderNumber","customer","status","total","createdAt","updatedAt"],description:"Customer orders"},fields:[{name:"orderNumber",type:"text",required:true,label:"Order Number"},{name:"customer",type:"relationship",required:true,label:"Customer",relationTo:"customers"},{name:"paymentStatus",type:"select",label:"Payment Status",options:[{label:"Pending",value:"pending"},{label:"Paid",value:"paid"},{label:"Failed",value:"failed"},{label:"Refunded",value:"refunded"}],defaultValue:"pending"},{name:"items",type:"array",label:"Items",fields:[{name:"product",type:"text",label:"Product"},{name:"quantity",type:"number",label:"Quantity"},{name:"unitPrice",type:"number",label:"Unit Price"},{name:"total",type:"number",label:"Total"}]},{name:"subtotal",type:"number",required:true,label:"Subtotal"},{name:"tax",type:"number",label:"Tax"},{name:"shipping",type:"number",label:"Shipping"},{name:"discount",type:"number",label:"Discount"},{name:"total",type:"number",required:true,label:"Total"},{name:"notes",type:"richtext",label:"Notes"},{name:"slug",type:"text",required:true,label:"Slug",admin:{position:"sidebar",autoGenerate:"orderNumber"}}],timestamps:true,versions:{drafts:true,maxPerDoc:10}},A={orders:_};var $={slug:"coupons",label:"Coupons",labelPlural:"Coupons",singularLabel:"Coupon",admin:{useAsTitle:"code",defaultColumns:["code","type","value","active","expiresAt"],description:"Discount codes and promotions"},fields:[{name:"code",type:"text",required:true,label:"Code"},{name:"type",type:"select",required:true,label:"Type",options:[{label:"Percentage",value:"percentage"},{label:"Fixed Amount",value:"fixed"},{label:"Free Shipping",value:"freeShipping"}]},{name:"value",type:"number",label:"Value"},{name:"minPurchase",type:"number",label:"Minimum Purchase"},{name:"maxDiscount",type:"number",label:"Max Discount"},{name:"usageLimit",type:"number",label:"Usage Limit"},{name:"usedCount",type:"number",defaultValue:0,label:"Used Count"},{name:"startsAt",type:"date",label:"Starts At"},{name:"expiresAt",type:"date",label:"Expires At"},{name:"active",type:"checkbox",defaultValue:true,label:"Active"}],timestamps:true,versions:{drafts:true,maxPerDoc:5}},L={coupons:$};var Z={slug:"forms",label:"Forms",labelPlural:"Forms",singularLabel:"Form",admin:{useAsTitle:"name",defaultColumns:["name","slug","updatedAt"],description:"Reusable form definitions"},fields:[{name:"name",type:"text",required:true,label:"Name"},{name:"subtitle",type:"textarea",label:"Subtitle"},{name:"slug",type:"text",required:true,label:"Slug",admin:{position:"sidebar",autoGenerate:"name"}},{name:"submitButtonText",type:"text",label:"Submit Button Text",defaultValue:"Submit",admin:{position:"sidebar"}},{name:"consentCheckboxText",type:"text",label:"Consent Agreement label (e.g. I agree to terms)",admin:{position:"sidebar"}},{name:"redirectUrl",type:"text",label:"Success Redirect URL",admin:{position:"sidebar"}},{name:"fields",type:"array",label:"Form Fields",fields:[{name:"fieldName",type:"text",label:"Field API Name (e.g. company)"},{name:"inputType",type:"select",label:"Input Type",defaultValue:"text",options:[{label:"Text input",value:"text"},{label:"Email input",value:"email"},{label:"Phone number input",value:"tel"},{label:"Multi-line textarea",value:"textarea"},{label:"Checkbox selector",value:"checkbox"}]},{name:"placeholder",type:"text",label:"Input Placeholder Text"},{name:"isRequired",type:"checkbox",label:"Make this field required",defaultValue:false}]},{name:"entries",type:"relationship",relationTo:"form-entries",hasMany:true,label:"Entries",admin:{description:"Form submissions linked to this form."}}],timestamps:true,versions:{drafts:true,maxPerDoc:5}},O={forms:Z};var ee={slug:"form-entries",label:"Form Entries",labelPlural:"Form Entries",singularLabel:"Form Entry",admin:{useAsTitle:"id",defaultColumns:["id","form","createdAt","ipAddress"],description:"Form submission entries"},access:{create:()=>true},fields:[{name:"form",type:"relationship",relationTo:"forms",required:true,label:"Form",admin:{position:"sidebar",readOnly:true,description:"The form this entry belongs to."}},{name:"data",type:"json",label:"Submitted Data",admin:{readOnly:true,description:"All field values submitted with this entry."}},{name:"ipAddress",type:"text",label:"IP Address",admin:{position:"sidebar",readOnly:true,description:"The IP address of the submitter."}}],timestamps:true},U={"form-entries":ee};var o={slug:"site-settings",label:"Site Settings",admin:{group:"settings"},access:{read:()=>true,update:()=>true},fields:[{name:"siteName",type:"text",label:"Site Name",required:true,admin:{}},{name:"siteDescription",type:"textarea",label:"Site Description",admin:{placeholder:"Enter a brief description of your site for SEO and search results."}},{name:"siteUrl",type:"text",label:"Site URL",admin:{}},{name:"analyticsEnabled",type:"checkbox",label:"Enable Analytics & Tracking",defaultValue:false},{name:"analytics",type:"group",label:"Tracking Configurations",admin:{condition:{field:"analyticsEnabled",equals:true}},fields:[{name:"googleAnalyticsId",type:"text",label:"Google Analytics ID"},{name:"googleTagManagerId",type:"text",label:"Google Tag Manager ID"},{name:"plausibleDomain",type:"text",label:"Plausible Domain"},{name:"mixpanelToken",type:"password",label:"Mixpanel Token"}]},{name:"mapApiKey",type:"password",label:"Map API Key",admin:{description:"API Key for Map Integrations (Google Maps, Mapbox, etc.)"}},{name:"enableHeaderFooterElements",type:"checkbox",label:"Enable Header and Footer Elements",defaultValue:false},{name:"headerFooterSettings",type:"group",label:"Header & Footer Settings",admin:{condition:{field:"enableHeaderFooterElements",equals:true}},fields:[{name:"headerBlocks",type:"blocks",label:"Header Elements",blocks:[{slug:"text",label:"Text Paragraph",fields:[{name:"text",type:"text",label:"Text Content",required:true}]},{slug:"textarea",label:"Text Area",fields:[{name:"text",type:"textarea",label:"Text Content",required:true}]},{slug:"form",label:"Form Selection",fields:[{name:"form",type:"relationship",label:"Select Form",relationTo:"forms",required:true}]},{slug:"button",label:"Button Link",fields:[{name:"label",type:"text",label:"Button Label",required:true},{name:"url",type:"text",label:"URL",required:true}]},{slug:"image",label:"Image Upload",fields:[{name:"image",type:"upload",label:"Image",relationTo:"media"},{name:"alt",type:"text",label:"Alt Text"},{name:"linkUrl",type:"text",label:"Link URL"}]}]},{name:"footerBlocks",type:"blocks",label:"Footer Elements",blocks:[{slug:"text",label:"Text Paragraph",fields:[{name:"text",type:"text",label:"Text Content",required:true}]},{slug:"textarea",label:"Text Area",fields:[{name:"text",type:"textarea",label:"Text Content",required:true}]},{slug:"form",label:"Form Selection",fields:[{name:"form",type:"relationship",label:"Select Form",relationTo:"forms",required:true}]},{slug:"button",label:"Button Link",fields:[{name:"label",type:"text",label:"Button Label",required:true},{name:"url",type:"text",label:"URL",required:true}]},{slug:"image",label:"Image Upload",fields:[{name:"image",type:"upload",label:"Image",relationTo:"media"},{name:"alt",type:"text",label:"Alt Text"},{name:"linkUrl",type:"text",label:"Link URL"}]}]}]}]};var n={slug:"seo-settings",label:"SEO Settings",admin:{group:"settings"},access:{read:()=>true,update:()=>true},fields:[{name:"seoMode",type:"select",label:"Visibility Mode",defaultValue:"simple",options:[{label:"Simple (Basic Meta)",value:"simple"},{label:"Advanced (Full Technical SEO)",value:"advanced"}],admin:{description:"Switch to advanced mode to control robots.txt, canonical URLs, and deep metadata."}},{name:"defaultTitle",type:"text",label:"Default Title",admin:{}},{name:"defaultDescription",type:"textarea",label:"Default Description",admin:{}},{name:"defaultOgImage",type:"upload",label:"Default OG Image",relationTo:"media"},{name:"titleTemplate",type:"text",label:"Title Template",defaultValue:"{{title}} | {{siteName}}",admin:{}},{name:"siteNameInTitle",type:"checkbox",label:"Include Site Name in Title",defaultValue:true},{name:"separator",type:"text",label:"Title Separator",defaultValue:" | ",admin:{}},{name:"meta",type:"group",label:"Technical Meta Settings",admin:{condition:{field:"seoMode",equals:"advanced"}},fields:[{name:"robots",type:"text",label:"Robots Meta",defaultValue:"index, follow"},{name:"canonicalUrl",type:"text",label:"Canonical URL"},{name:"ogType",type:"select",label:"Default OG Type",defaultValue:"website",options:[{label:"Website",value:"website"},{label:"Article",value:"article"},{label:"Product",value:"product"},{label:"Book",value:"book"},{label:"Music",value:"music"},{label:"Video",value:"video"}]}]},{name:"enableSitemap",type:"checkbox",label:"Enable XML Sitemap",defaultValue:true},{name:"sitemap",type:"group",label:"Sitemap Configuration",admin:{condition:{and:[{field:"enableSitemap",equals:true},{field:"seoMode",equals:"advanced"}]}},fields:[{name:"sitemapUrls",type:"number",label:"Sitemap URL Limit",defaultValue:5e4}]},{name:"robotsTxt",type:"textarea",label:"Custom robots.txt",admin:{condition:{field:"seoMode",equals:"advanced"}}},{name:"social",type:"group",label:"Social Media",fields:[{name:"twitterHandle",type:"text",label:"Twitter/X Handle",admin:{}},{name:"twitterCardType",type:"select",label:"Twitter Card Type",defaultValue:"summary_large_image",options:[{label:"Summary",value:"summary"},{label:"Summary with Large Image",value:"summary_large_image"},{label:"App",value:"app"},{label:"Player",value:"player"}]},{name:"fbAppId",type:"text",label:"Facebook App ID"}]},{name:"advanced",type:"group",label:"Advanced",fields:[{name:"jsonLdEnabled",type:"checkbox",label:"Enable JSON-LD",defaultValue:true,admin:{}},{name:"breadcrumbsEnabled",type:"checkbox",label:"Enable Breadcrumbs",defaultValue:true},{name:"paginationSize",type:"number",label:"Default Pagination Size",defaultValue:10}]}]};var r={slug:"brand-settings",label:"Brand Settings",admin:{group:"settings",description:"Manage global brand identity, logos, contact information, and social links."},access:{read:()=>true,update:()=>true},fields:[{name:"identity",type:"group",label:"Brand Identity",fields:[{name:"primaryLogo",type:"upload",label:"Primary Logo",relationTo:"media"},{name:"darkLogo",type:"upload",label:"Dark Logo (Optional)",relationTo:"media",admin:{description:"Used for dark mode layouts."}},{name:"favicon",type:"upload",label:"Favicon",relationTo:"media"}]},{name:"companyInfo",type:"group",label:"Contact & Company Information",fields:[{name:"companyName",type:"text",label:"Company Name"},{name:"address",type:"textarea",label:"Physical Address"},{name:"phone",type:"text",label:"Phone Number"},{name:"email",type:"text",label:"Public Email Address"}]},{name:"businessHours",type:"array",label:"Business Hours",fields:[{name:"day",type:"text",label:"Day / Range",admin:{description:"e.g., Mon - Fri"}},{name:"hours",type:"text",label:"Hours",admin:{description:"e.g., 9:00 AM - 5:00 PM"}}]},{name:"socialLinks",type:"array",label:"Social Media Profiles",fields:[{name:"platform",type:"select",label:"Platform",options:[{label:"Facebook",value:"facebook"},{label:"Twitter / X",value:"twitter"},{label:"Instagram",value:"instagram"},{label:"LinkedIn",value:"linkedin"},{label:"YouTube",value:"youtube"},{label:"TikTok",value:"tiktok"},{label:"GitHub",value:"github"},{label:"Other",value:"other"}]},{name:"url",type:"text",label:"Profile URL"}]}]};var m={slug:"email-settings",label:"Email Settings",admin:{group:"settings"},access:{read:()=>true,update:()=>true},fields:[{name:"fromName",type:"text",label:"From Name",admin:{}},{name:"fromEmail",type:"email",label:"From Email",required:true,admin:{}},{name:"replyTo",type:"email",label:"Reply-To Email",admin:{}},{name:"provider",type:"select",label:"Email Provider",defaultValue:"smtp",options:[{label:"SMTP (Standard)",value:"smtp"},{label:"Resend",value:"resend"},{label:"SendGrid",value:"sendgrid"},{label:"Mailgun",value:"mailgun"},{label:"AWS SES",value:"ses"}]},{name:"smtp",type:"group",label:"SMTP Settings",admin:{condition:{field:"provider",equals:"smtp"}},fields:[{name:"smtpService",type:"select",label:"SMTP Service",defaultValue:"custom",options:[{label:"Custom SMTP",value:"custom"},{label:"Gmail",value:"gmail"},{label:"Outlook / Office 365",value:"outlook"},{label:"Brevo (Sendinblue)",value:"brevo"},{label:"Mailgun (SMTP)",value:"mailgun-smtp"},{label:"SendGrid (SMTP)",value:"sendgrid-smtp"},{label:"Mandrill / Mailchimp",value:"mandrill"}],admin:{description:"Selecting a known service will pre-configure host and port settings."}},{name:"host",type:"text",label:"Host",admin:{condition:{field:"smtpService",equals:"custom"},placeholder:"smtp.example.com"}},{name:"port",type:"number",label:"Port",defaultValue:587,admin:{condition:{field:"smtpService",equals:"custom"}}},{name:"username",type:"text",label:"Username"},{name:"password",type:"password",label:"Password"},{name:"secure",type:"checkbox",label:"Use TLS/SSL",defaultValue:true}]},{name:"resend",type:"group",label:"Resend Settings",admin:{condition:{field:"provider",equals:"resend"}},fields:[{name:"apiKey",type:"password",label:"API Key",required:true}]},{name:"sendgrid",type:"group",label:"SendGrid Settings",admin:{condition:{field:"provider",equals:"sendgrid"}},fields:[{name:"apiKey",type:"password",label:"API Key",required:true}]},{name:"mailgun",type:"group",label:"Mailgun Settings",admin:{condition:{field:"provider",equals:"mailgun"}},fields:[{name:"apiKey",type:"password",label:"API Key",required:true},{name:"domain",type:"text",label:"Domain",required:true},{name:"region",type:"select",label:"Region",defaultValue:"us",options:[{label:"US (United States)",value:"us"},{label:"EU (Europe)",value:"eu"}]}]},{name:"ses",type:"group",label:"AWS SES Settings",admin:{condition:{field:"provider",equals:"ses"}},fields:[{name:"accessKeyId",type:"text",label:"Access Key ID",required:true},{name:"secretAccessKey",type:"password",label:"Secret Access Key",required:true},{name:"region",type:"text",label:"Region",defaultValue:"us-east-1",admin:{placeholder:"us-east-1"}}]},{name:"testEmailSection",type:"row",label:"Test Email",admin:{description:"Enter an email address to send a test email."},fields:[{name:"testEmail",type:"email",label:"Email",admin:{width:"300px"}},{name:"sendTestEmail",type:"action",label:"Send Test Email",admin:{action:"/api/globals/email-settings/test",method:"POST"}}]}]};var u={slug:"access-settings",label:"Access Control",admin:{group:"settings"},access:{read:()=>true,update:()=>true},fields:[{name:"enablePublicAccess",type:"checkbox",label:"Enable Public Access",defaultValue:true,admin:{}},{name:"defaultCollectionAccess",type:"select",label:"Default Collection Access",defaultValue:"read",options:[{label:"Read Only",value:"read"},{label:"Read & Create",value:"create"},{label:"Read & Create & Update",value:"update"},{label:"Full Access",value:"admin"},{label:"No Access",value:"none"}],admin:{}},{name:"apiAccess",type:"group",label:"API Access",fields:[{name:"graphqlEnabled",type:"checkbox",label:"Enable GraphQL",defaultValue:false},{name:"trpcEnabled",type:"checkbox",label:"Enable tRPC",defaultValue:false},{name:"wsEnabled",type:"checkbox",label:"Enable WebSocket",defaultValue:false},{name:"requireAuth",type:"checkbox",label:"Require Authentication",defaultValue:false},{name:"cors",type:"group",label:"CORS Settings",admin:{condition:{field:"apiAccess.graphqlEnabled",equals:true}},fields:[{name:"allowedOrigins",type:"textarea",label:"Allowed Origins (one per line)",admin:{placeholder:`https://example.com
|
|
2
|
+
https://app.example.com`}}]}]},{name:"rateLimiting",type:"group",label:"Rate Limiting Configuration",admin:{condition:{field:"rateLimiting.enabled",equals:true}},fields:[{name:"enabled",type:"checkbox",label:"Enable Global Rate Limiting",defaultValue:true},{name:"maxRequests",type:"number",label:"Max Requests",defaultValue:100,admin:{condition:{field:"enabled",equals:true}}},{name:"windowMs",type:"number",label:"Window (ms)",defaultValue:6e4,admin:{condition:{field:"enabled",equals:true}}}]}]};var qe=[{label:"United States",value:"US"},{label:"United Kingdom",value:"GB"},{label:"Canada",value:"CA"},{label:"Australia",value:"AU"},{label:"Germany",value:"DE"},{label:"France",value:"FR"},{label:"Netherlands",value:"NL"},{label:"Belgium",value:"BE"},{label:"Spain",value:"ES"},{label:"Italy",value:"IT"},{label:"Portugal",value:"PT"},{label:"Sweden",value:"SE"},{label:"Norway",value:"NO"},{label:"Denmark",value:"DK"},{label:"Finland",value:"FI"},{label:"Austria",value:"AT"},{label:"Switzerland",value:"CH"},{label:"Japan",value:"JP"},{label:"South Korea",value:"KR"},{label:"China",value:"CN"},{label:"India",value:"IN"},{label:"Brazil",value:"BR"},{label:"Mexico",value:"MX"}],c={slug:"store-settings",label:"Store Settings",admin:{group:"settings"},access:{read:()=>true,update:()=>true},fields:[{name:"storeName",type:"text",label:"Store Name",required:true},{name:"storeEmail",type:"email",label:"Contact Email",required:true},{name:"storePhone",type:"text",label:"Phone Number"},{name:"address",type:"group",label:"Store Address",fields:[{name:"street",type:"text",label:"Street Address"},{name:"city",type:"text",label:"City"},{name:"state",type:"text",label:"State/Province"},{name:"postalCode",type:"text",label:"Postal Code"},{name:"country",type:"select",label:"Country",options:qe}]},{name:"currency",type:"group",label:"Currency",fields:[{name:"code",type:"select",label:"Currency Code",defaultValue:"USD",options:[{label:"USD - US Dollar",value:"USD"},{label:"EUR - Euro",value:"EUR"},{label:"GBP - British Pound",value:"GBP"},{label:"CAD - Canadian Dollar",value:"CAD"},{label:"AUD - Australian Dollar",value:"AUD"},{label:"JPY - Japanese Yen",value:"JPY"},{label:"CNY - Chinese Yuan",value:"CNY"},{label:"INR - Indian Rupee",value:"INR"},{label:"BRL - Brazilian Real",value:"BRL"},{label:"MXN - Mexican Peso",value:"MXN"}]},{name:"symbol",type:"text",label:"Symbol",defaultValue:"$"},{name:"position",type:"select",label:"Symbol Position",defaultValue:"before",options:[{label:"Before amount",value:"before"},{label:"After amount",value:"after"}]},{name:"decimals",type:"number",label:"Decimal Places",defaultValue:2}]},{name:"tax",type:"group",label:"Tax Logistics",admin:{condition:{field:"tax.enabled",equals:true}},fields:[{name:"enabled",type:"checkbox",label:"Enable Tax",defaultValue:true},{name:"rate",type:"number",label:"Tax Rate (%)",admin:{placeholder:"10",condition:{field:"enabled",equals:true}}},{name:"includedInPrice",type:"checkbox",label:"Tax Included in Prices",admin:{condition:{field:"enabled",equals:true}}},{name:"taxId",type:"text",label:"Tax ID / VAT Number",admin:{condition:{field:"enabled",equals:true}}}]},{name:"shipping",type:"group",label:"Shipping Logic",admin:{condition:{or:[{field:"shipping.enableLocalPickup",equals:true},{field:"shipping.flatRate",greaterThan:0}]}},fields:[{name:"enableLocalPickup",type:"checkbox",label:"Enable Local Pickup",defaultValue:true},{name:"flatRate",type:"number",label:"Flat Rate Shipping Fee",admin:{}},{name:"freeShippingThreshold",type:"number",label:"Free Shipping Minimum",admin:{condition:{field:"flatRate",greaterThan:0}}}]},{name:"orders",type:"group",label:"Orders",fields:[{name:"orderNumberPrefix",type:"text",label:"Order Number Prefix",defaultValue:"ORD",admin:{}},{name:"allowGuestCheckout",type:"checkbox",label:"Allow Guest Checkout",defaultValue:true},{name:"requirePhone",type:"checkbox",label:"Require Phone Number",defaultValue:true}]}]};var b={slug:"payment-settings",label:"Payment Settings",admin:{group:"settings"},access:{read:()=>true,update:()=>true},fields:[{name:"testMode",type:"checkbox",label:"Test Mode",defaultValue:true,admin:{}},{name:"provider",type:"select",label:"Primary Payment Provider",defaultValue:"stripe",options:[{label:"Stripe",value:"stripe"},{label:"PayPal",value:"paypal"},{label:"Square",value:"square"},{label:"Manual Methods Only",value:"manual"}]},{name:"stripe",type:"group",label:"Stripe",admin:{condition:{field:"provider",equals:"stripe"}},fields:[{name:"enabled",type:"checkbox",label:"Enable Stripe",defaultValue:false},{name:"publishableKey",type:"text",label:"Publishable Key",admin:{placeholder:"pk_live_..."}},{name:"secretKey",type:"password",label:"Secret Key"},{name:"webhookSecret",type:"password",label:"Webhook Secret",admin:{}}]},{name:"paypal",type:"group",label:"PayPal",admin:{condition:{field:"provider",equals:"paypal"}},fields:[{name:"enabled",type:"checkbox",label:"Enable PayPal",defaultValue:false},{name:"clientId",type:"text",label:"Client ID"},{name:"clientSecret",type:"password",label:"Client Secret"},{name:"mode",type:"select",label:"Mode",defaultValue:"sandbox",options:[{label:"Sandbox (Test)",value:"sandbox"},{label:"Live",value:"live"}]}]},{name:"square",type:"group",label:"Square",admin:{condition:{field:"provider",equals:"square"}},fields:[{name:"enabled",type:"checkbox",label:"Enable Square",defaultValue:false},{name:"applicationId",type:"text",label:"Application ID"},{name:"accessToken",type:"password",label:"Access Token"},{name:"locationId",type:"text",label:"Location ID"}]},{name:"methods",type:"group",label:"Manual Payment Methods",fields:[{name:"cod",type:"checkbox",label:"Cash on Delivery",defaultValue:true},{name:"bankTransfer",type:"checkbox",label:"Bank Transfer",defaultValue:true},{name:"cash",type:"checkbox",label:"Cash (Local Pickup)",defaultValue:true},{name:"check",type:"checkbox",label:"Check",defaultValue:false}]},{name:"bankTransfer",type:"group",label:"Bank Transfer Details",admin:{},fields:[{name:"bankName",type:"text",label:"Bank Name"},{name:"accountName",type:"text",label:"Account Name"},{name:"accountNumber",type:"text",label:"Account Number"},{name:"routingNumber",type:"text",label:"Routing/Sort Code"},{name:"iban",type:"text",label:"IBAN"},{name:"swift",type:"text",label:"SWIFT/BIC"}]}]};var p={slug:"system",label:"System",admin:{group:"settings",description:"Core system configuration and secrets"},access:{read:()=>true,update:()=>true},fields:[{name:"appSecret",type:"secret",label:"App Secret",required:false,admin:{description:"Auto-generated master secret used for encryption and auth. Auto-created if empty on load.",readOnly:true}},{name:"encryptionKey",type:"text",label:"Encryption Key",required:false,admin:{description:"Auto-generated key for data encryption at rest.",readOnly:true}},{name:"sessionMaxAge",type:"number",label:"Session Max Age (days)",required:false,defaultValue:7,admin:{description:"Maximum session duration in days"}},{name:"maxSessionsPerUser",type:"number",label:"Max Sessions Per User",required:false,defaultValue:3,admin:{description:"Maximum concurrent sessions allowed per user"}}]};var G=[o,n,r,m,a,u,c,b,p],y=[o,n,r,m,a,u,p],w={[o.slug]:o,[n.slug]:n,[r.slug]:r,[m.slug]:m,[a.slug]:a,[u.slug]:u,[c.slug]:c,[b.slug]:b,[p.slug]:p};function D(e){switch(e){case "minimal":return [o,n,r];case "starter":case "blog":return y;case "ecommerce":case "kitchen-sink":return G;default:return y}}function g(e){let i=new Map;for(let l of e)i.has(l.slug)||i.set(l.slug,l);return Array.from(i.values())}var te=[...Object.values(B),...Object.values(F),...Object.values(V),...Object.values(O),...Object.values(U)],E=[...te,...v,...Object.values(b$1),...Object.values(M)],tl={minimal:g([...Object.values(x),...te]),starter:g([...Object.values(C),...E]),blog:g([...Object.values(S),...E]),ecommerce:g([...Object.values(h),...Object.values(k),...Object.values(P),...Object.values(A),...Object.values(L),...Object.values(T),...E]),"kitchen-sink":g([...Object.values(x),...Object.values(C),...Object.values(S),...Object.values(h),...Object.values(R),...Object.values(k),...Object.values(P),...Object.values(A),...Object.values(L),...Object.values(T),...E])};function al(e){let i=e.collections?[...e.collections]:[],l=e.globals?[...e.globals]:[];e.includeMedia!==false&&i.push(...v);let q=e.template?D(e.template):y;if(e.includeSettings){if(e.includeSettings==="all")l.push(...G);else if(e.includeSettings==="core")l.push(...y);else if(Array.isArray(e.includeSettings))for(let a of e.includeSettings){let f=w[a];f&&l.push(f);}}else (!e.globals||e.globals.length===0)&&l.push(...q);if(e.excludeSettings&&e.excludeSettings.length>0){let a=new Set(e.excludeSettings),f=l.filter(N=>!a.has(N.slug)&&!a.has(N.label?.toLowerCase().replace(/\s+/g,"-")||""));l.length=0,l.push(...f);}return {collections:i.length>0?i:void 0,globals:l.length>0?l:void 0}}
|
|
3
|
+
export{L as A,Z as B,O as C,ee as D,U as E,o as F,n as G,r as H,m as I,u as J,c as K,b as L,p as M,G as N,y as O,w as P,D as Q,tl as R,al as S,x as a,C as b,S as c,le as d,h as e,ae as f,R as g,j as h,v as i,H as j,M as k,K as l,B as m,W as n,F as o,Y as p,V as q,X as r,T as s,J as t,k as u,Q as v,P as w,_ as x,A as y,$ as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {d,o,a,b,c}from'./chunk-
|
|
1
|
+
import {d,o,a,b,c}from'./chunk-KG7V6O2Z.js';import {f,e,g}from'./chunk-HLSB2MCK.js';async function T(e$1){let a=o(e$1.db),t={db:e$1.db,registry:e$1.registry,req:e$1.req,user:e$1.user,tenantId:e$1.tenantId,webhookService:a,settings:e$1.settings},n=f(e$1.req);if(n){let r=await e(n,e$1.db,async o=>{try{return await e$1.db.findByID({collection:"users",id:o})||null}catch{return null}});r.valid&&(t.user=r.user||e$1.user,t.tenantId=r.tenantId||e$1.tenantId,t.apiKey=g(r));}return t}var W={_media:{create:d.MEDIA_UPLOAD,update:d.MEDIA_UPLOAD,delete:d.MEDIA_DELETE}};function A(e,a){let t=W[e];return t?t[a]:`collection.${a}`}async function C(e,a,t){if(e.webhookService)try{await e.webhookService.trigger(a,{collection:t.collection,operation:t.operation,data:t.data,previousData:t.previousData,user:e.user?{id:e.user.id,email:e.user.email,role:e.user.role}:void 0,tenantId:e.tenantId});}catch(n){console.error(`[Webhook] Failed to trigger ${a}:`,n);}}function m(e,a){if(!(!e||typeof e!="object"))for(let t of a){if(!t.name||!(t.name in e))continue;if(e[t.name]===""&&(t.type==="text"||t.type==="textarea"||t.type==="code"||t.type==="markdown"||t.type==="email"||t.type==="password"||t.type==="color"||(e[t.name]=null)),t.type==="tabs"&&t.name&&Array.isArray(t.tabs)&&e[t.name]&&typeof e[t.name]=="object")for(let r of t.tabs)Array.isArray(r.fields)&&m(e[t.name],r.fields);else if((t.type==="group"||t.type==="collapsible")&&t.name&&Array.isArray(t.fields)&&e[t.name]&&typeof e[t.name]=="object")m(e[t.name],t.fields);else if(t.type==="array"&&t.name&&Array.isArray(t.fields)&&Array.isArray(e[t.name]))for(let r of e[t.name])r&&typeof r=="object"&&m(r,t.fields);else if(t.type==="blocks"&&t.name&&Array.isArray(t.blocks)&&Array.isArray(e[t.name]))for(let r of e[t.name]){if(!r||typeof r!="object")continue;let o=r.type||r.blockType;if(!o)continue;let s=t.blocks.find(i=>i.slug===o);if(!s||!Array.isArray(s.fields))continue;let c=r.data&&typeof r.data=="object"?r.data:r;m(c,s.fields);}}}async function p(e,a,t){let n=await b(e,a,{user:t.user,req:t.req,tenantId:t.tenantId,apiKey:t.apiKey});if(!n.allowed)throw new Error(n.error||"Access denied");t.tenantId&&t.db.setTenantContext({tenantId:t.tenantId,userId:t.user?.id??"",role:t.user?.role,isSuperAdmin:t.user?.role==="super_admin"});}function D(e){return async a$1=>{let{collection:t,where:n,sort:r,limit:o,page:s,depth:c,select:i,draft:d}=a$1,u=e.registry.getCollection(t);if(await p(u,"read",e),u.hooks?.beforeRead)for(let f of u.hooks.beforeRead)await f({collection:t,req:e.req,user:e.user,tenantId:e.tenantId,operation:"read",where:n});let l=d??!!e.user,g=await e.db.find({collection:t,where:n||{},sort:r,limit:o||10,page:s||1,depth:c||0,tenantId:e.tenantId,select:i,draft:l});if(u.hooks?.afterRead)for(let f of g.docs)for(let w of u.hooks.afterRead)await w({collection:t,doc:f,req:e.req,user:e.user,tenantId:e.tenantId,operation:"read"});return await a(g.docs,u.fields,e.db,e.registry,1,c||0),g}}function R(e){return async a$1=>{let{collection:t,id:n,depth:r,select:o,draft:s}=a$1,c=e.registry.getCollection(t);await p(c,"read",e);let i=s??!!e.user,d=await e.db.findByID({collection:t,id:n,depth:r||0,tenantId:e.tenantId,select:o,draft:i});if(!d)throw new Error(`Document not found: ${t}/${n}`);if(c.hooks?.afterRead)for(let u of c.hooks.afterRead)await u({collection:t,doc:d,req:e.req,user:e.user,tenantId:e.tenantId,operation:"read",id:n});return await a([d],c.fields,e.db,e.registry,1,r||0),d}}function q(e){return async a=>{let{collection:t,data:n,depth:r,select:o}=a,s=e.registry.getCollection(t);await p(s,"create",e);let i=e.registry.getCreateZodSchema(t).parse(n);if(s.tenantScoped&&e.tenantId&&(i.tenantId=e.tenantId),s.hooks?.beforeValidate)for(let u of s.hooks.beforeValidate){let l=await u({collection:t,data:i,req:e.req,user:e.user,tenantId:e.tenantId,operation:"create"});l&&Object.assign(i,l);}if(s.hooks?.beforeChange)for(let u of s.hooks.beforeChange){let l=await u({collection:t,data:i,req:e.req,user:e.user,tenantId:e.tenantId,operation:"create"});l&&Object.assign(i,l);}let d=await e.db.create({collection:t,data:i,depth:r||0,tenantId:e.tenantId,select:o});if(s.hooks?.afterChange)for(let u of s.hooks.afterChange)await u({collection:t,doc:d,data:i,req:e.req,user:e.user,tenantId:e.tenantId,operation:"create"});return await C(e,A(t,"create"),{collection:t,data:d,operation:"create"}),{doc:d}}}function P(e){return async a=>{let{collection:t,id:n,data:r,depth:o,select:s,baseUpdatedAt:c}=a,i=e.registry.getCollection(t);await p(i,"update",e);let d=await e.db.findByID({collection:t,id:n,tenantId:e.tenantId,draft:true});if(!d)throw new Error(`Document not found: ${t}/${n}`);if(c&&d.updatedAt&&c!==d.updatedAt)throw new Error(`Revision conflict: document has changed since ${c}. Current updatedAt: ${d.updatedAt}`);m(r,i.fields);let l=e.registry.getUpdateZodSchema(t).parse(r);if(i.tenantScoped&&e.tenantId&&(l.tenantId=e.tenantId),i.hooks?.beforeValidate)for(let b of i.hooks.beforeValidate){let h=await b({collection:t,data:l,originalDoc:d,req:e.req,user:e.user,tenantId:e.tenantId,operation:"update",id:n});h&&Object.assign(l,h);}if(i.hooks?.beforeChange)for(let b of i.hooks.beforeChange){let h=await b({collection:t,data:l,originalDoc:d,req:e.req,user:e.user,tenantId:e.tenantId,operation:"update",id:n});h&&Object.assign(l,h);}let g=e.req&&typeof e.req.headers?.get=="function"&&e.req.headers.get("x-draft")==="true"||a.draft===true,f=i.versions?.drafts===true,w=e.req?.query?.autosave==="true"||e.req?.url?.includes("autosave=true")||a.autosave===true,y;if(f&&g?(await e.db.createVersion({collection:t,documentId:n,data:l,status:"draft",autosave:w,createdBy:e.user?.id,tenantId:e.tenantId}),y=await e.db.findByID({collection:t,id:n,tenantId:e.tenantId,draft:true})):f?(y=await e.db.update({collection:t,id:n,data:{...l,status:"published"},depth:o||0,tenantId:e.tenantId,select:s}),await e.db.createVersion({collection:t,documentId:n,data:l,status:"published",createdBy:e.user?.id,tenantId:e.tenantId})):y=await e.db.update({collection:t,id:n,data:l,depth:o||0,tenantId:e.tenantId,select:s}),i.hooks?.afterChange)for(let b of i.hooks.afterChange)await b({collection:t,doc:y,data:l,originalDoc:d,req:e.req,user:e.user,tenantId:e.tenantId,operation:"update",id:n});return await C(e,A(t,"update"),{collection:t,data:y,previousData:d,operation:"update"}),{doc:y}}}function v(e){return async a=>{let{collection:t,id:n}=a,r=e.registry.getCollection(t);await p(r,"delete",e);let o=await e.db.findByID({collection:t,id:n,tenantId:e.tenantId,draft:true});if(!o)throw new Error(`Document not found: ${t}/${n}`);if(r.hooks?.beforeDelete)for(let c of r.hooks.beforeDelete)await c({collection:t,doc:o,req:e.req,user:e.user,tenantId:e.tenantId,operation:"delete",id:n});let s=await e.db.delete({collection:t,id:n,tenantId:e.tenantId});if(r.hooks?.afterDelete)for(let c of r.hooks.afterDelete)await c({collection:t,doc:s,req:e.req,user:e.user,tenantId:e.tenantId,operation:"delete",id:n});return await C(e,A(t,"delete"),{collection:t,data:s,previousData:o,operation:"delete"}),{doc:s,message:"Deleted successfully"}}}function K(e){return async a=>{let{collection:t,where:n}=a,r=e.registry.getCollection(t);return await p(r,"read",e),{totalDocs:await e.db.count({collection:t,where:n||{},tenantId:e.tenantId})}}}async function U(e,a,t){let n=await c(e,a,{user:t.user,req:t.req,tenantId:t.tenantId});if(!n.allowed)throw new Error(n.error||"Access denied");t.tenantId&&t.db.setTenantContext({tenantId:t.tenantId,userId:t.user?.id??"",role:t.user?.role,isSuperAdmin:t.user?.role==="super_admin"});}function $(e){let a={},t=e.registry.getCollections();for(let r of t){let o=r.slug;a[o]={find:D(e),findByID:R(e),create:q(e),update:P(e),delete:v(e),count:K(e)};}let n=e.registry.getGlobals();for(let r of n){let o=r.slug;a[`_globals_${o}`]={get:async()=>(await U(r,"read",e),await e.db.findOne({collection:`_globals_${o}`,where:{},tenantId:e.tenantId})),update:async s=>{await U(r,"update",e);let i=e.registry.getZodSchema(o).parse(s.data),d=await e.db.findOne({collection:`_globals_${o}`,where:{},tenantId:e.tenantId,draft:true}),u;return d?u=await e.db.update({collection:`_globals_${o}`,id:d.id,data:i,tenantId:e.tenantId}):u=await e.db.create({collection:`_globals_${o}`,data:{...i,id:o},tenantId:e.tenantId}),u}};}return a}function O(e){if(e.settings?.access?.apiAccess?.trpcEnabled===false)throw new Error("tRPC API is disabled");return $(e)}export{T as a,D as b,R as c,q as d,P as e,v as f,K as g,$ as h,O as i};
|