@kyro-cms/core 0.12.15 → 0.12.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/README.md +1 -1
  2. package/dist/WebhookService-ByrpAI4d.d.ts +143 -0
  3. package/dist/WebhookService-i-Kl3dvf.d.cts +143 -0
  4. package/dist/api-handler-graphql.cjs +1 -1
  5. package/dist/api-handler-graphql.d.cts +6 -0
  6. package/dist/api-handler-graphql.d.ts +6 -0
  7. package/dist/api-handler-graphql.js +1 -1
  8. package/dist/api-handler-trpc.cjs +1 -1
  9. package/dist/api-handler-trpc.d.cts +5 -0
  10. package/dist/api-handler-trpc.d.ts +5 -0
  11. package/dist/api-handler-trpc.js +1 -1
  12. package/dist/api-handler.cjs +1 -1
  13. package/dist/api-handler.d.cts +7 -0
  14. package/dist/api-handler.d.ts +7 -0
  15. package/dist/api-handler.js +1 -1
  16. package/dist/base-iyJTfH-3.d.cts +74 -0
  17. package/dist/base-oUSURe4_.d.ts +74 -0
  18. package/dist/{chunk-IQYP3DDJ.cjs → chunk-BIJHVTNO.cjs} +2 -2
  19. package/dist/{chunk-NI7S5JMH.js → chunk-CIA3BVH3.js} +5 -5
  20. package/dist/{chunk-ZZIGN5PZ.js → chunk-I4ZACL66.js} +1 -1
  21. package/dist/{chunk-M5JUPA7G.cjs → chunk-LMIBASPC.cjs} +5 -5
  22. package/dist/{chunk-RY3BG3AN.cjs → chunk-RL36RMMG.cjs} +1 -1
  23. package/dist/{chunk-DTSYK7KK.js → chunk-YFRLT77I.js} +2 -2
  24. package/dist/cli/index.cjs +0 -0
  25. package/dist/cli/index.d.cts +1 -0
  26. package/dist/cli/index.d.ts +1 -0
  27. package/dist/client.d.cts +12 -0
  28. package/dist/client.d.ts +12 -0
  29. package/dist/drizzle/index.d.cts +169 -0
  30. package/dist/drizzle/index.d.ts +169 -0
  31. package/dist/fields/index.d.cts +7 -0
  32. package/dist/fields/index.d.ts +7 -0
  33. package/dist/graphql/index.d.cts +57 -0
  34. package/dist/graphql/index.d.ts +57 -0
  35. package/dist/index-Bz9JqRGI.d.cts +86 -0
  36. package/dist/index-Bz9JqRGI.d.ts +86 -0
  37. package/dist/index-DNy8jbA2.d.cts +282 -0
  38. package/dist/index-DVDMEql7.d.ts +282 -0
  39. package/dist/index.cjs +26 -19
  40. package/dist/index.d.cts +1446 -0
  41. package/dist/index.d.ts +1446 -0
  42. package/dist/index.js +26 -19
  43. package/dist/integration.d.cts +14 -0
  44. package/dist/integration.d.ts +14 -0
  45. package/dist/mongodb/index.d.cts +134 -0
  46. package/dist/mongodb/index.d.ts +134 -0
  47. package/dist/rest/index.cjs +1 -1
  48. package/dist/rest/index.d.cts +56 -0
  49. package/dist/rest/index.d.ts +56 -0
  50. package/dist/rest/index.js +1 -1
  51. package/dist/richtext-DrhORshE.d.cts +5 -0
  52. package/dist/richtext-DrhORshE.d.ts +5 -0
  53. package/dist/templates/index.d.cts +107 -0
  54. package/dist/templates/index.d.ts +107 -0
  55. package/dist/trpc/index.d.cts +142 -0
  56. package/dist/trpc/index.d.ts +142 -0
  57. package/dist/types-BcZiluXL.d.cts +569 -0
  58. package/dist/types-CpjuXbe7.d.cts +150 -0
  59. package/dist/types-CpjuXbe7.d.ts +150 -0
  60. package/dist/types-Dc8VAPhF.d.ts +569 -0
  61. package/dist/types-euTszc-1.d.cts +294 -0
  62. package/dist/types-euTszc-1.d.ts +294 -0
  63. package/dist/ws/index.d.cts +88 -0
  64. package/dist/ws/index.d.ts +88 -0
  65. package/package.json +24 -25
package/README.md CHANGED
@@ -111,7 +111,7 @@ Kyro preserves Astro compatibility with two entrypoints:
111
111
 
112
112
  Kyro is designed as a modular ecosystem:
113
113
  - `kyro-connect` — Universal, type-safe API client and codegen for any framework.
114
- - `kyro-rich-text-react` — A headless React component for rendering Kyro's Tiptap JSON content.
114
+ - `kyro-rich-text-react` — A headless React component for rendering Kyro's Richtext JSON content.
115
115
  ---
116
116
 
117
117
  ## Example usage
@@ -0,0 +1,143 @@
1
+ import { B as BaseAdapter } from './types-Dc8VAPhF.js';
2
+
3
+ declare const WEBHOOK_EVENTS: {
4
+ readonly COLLECTION_CREATE: "collection.create";
5
+ readonly COLLECTION_UPDATE: "collection.update";
6
+ readonly COLLECTION_DELETE: "collection.delete";
7
+ readonly MEDIA_UPLOAD: "media.upload";
8
+ readonly MEDIA_DELETE: "media.delete";
9
+ readonly AUTH_LOGIN: "auth.login";
10
+ readonly AUTH_REGISTER: "auth.register";
11
+ readonly AUTH_LOGOUT: "auth.logout";
12
+ readonly ORDER_CREATED: "order.created";
13
+ readonly ORDER_PAID: "order.paid";
14
+ readonly ORDER_SHIPPED: "order.shipped";
15
+ readonly ORDER_DELIVERED: "order.delivered";
16
+ };
17
+ type WebhookEvent = (typeof WEBHOOK_EVENTS)[keyof typeof WEBHOOK_EVENTS];
18
+ declare const ALL_WEBHOOK_EVENTS: WebhookEvent[];
19
+ type WebhookActionType = "generic" | "github-push";
20
+ interface WebhookActionConfig {
21
+ githubOwner?: string;
22
+ githubRepo?: string;
23
+ githubBranch?: string;
24
+ }
25
+ interface WebhookConfig {
26
+ id: string;
27
+ name: string;
28
+ url: string;
29
+ events: WebhookEvent[];
30
+ collections?: string[];
31
+ status: "active" | "inactive" | "error";
32
+ secret?: string;
33
+ headers?: Record<string, string>;
34
+ action?: WebhookActionType;
35
+ config?: WebhookActionConfig;
36
+ lastTriggered?: string;
37
+ lastError?: string;
38
+ createdAt: string;
39
+ updatedAt: string;
40
+ }
41
+ interface CreateWebhookData {
42
+ name: string;
43
+ url: string;
44
+ events: (WebhookEvent | "create" | "update" | "delete")[];
45
+ collections?: string[];
46
+ status?: "active" | "inactive";
47
+ secret?: string;
48
+ headers?: Record<string, string>;
49
+ action?: WebhookActionType;
50
+ config?: WebhookActionConfig;
51
+ }
52
+ interface UpdateWebhookData {
53
+ name?: string;
54
+ url?: string;
55
+ events?: (WebhookEvent | "create" | "update" | "delete")[];
56
+ collections?: string[];
57
+ status?: "active" | "inactive" | "error";
58
+ secret?: string;
59
+ headers?: Record<string, string>;
60
+ action?: WebhookActionType;
61
+ config?: WebhookActionConfig;
62
+ lastTriggered?: string | null;
63
+ lastError?: string | null;
64
+ }
65
+ interface WebhookPayload {
66
+ id: string;
67
+ event: WebhookEvent;
68
+ timestamp: string;
69
+ collection?: string;
70
+ operation?: "create" | "update" | "delete";
71
+ data?: unknown;
72
+ previousData?: unknown;
73
+ user?: {
74
+ id: string;
75
+ email?: string;
76
+ role?: string;
77
+ };
78
+ tenantId?: string;
79
+ metadata?: Record<string, unknown>;
80
+ }
81
+ interface WebhookDelivery {
82
+ id: string;
83
+ webhookId: string;
84
+ event: WebhookEvent;
85
+ payload: WebhookPayload;
86
+ attempt: number;
87
+ status: "pending" | "success" | "failed" | "retrying";
88
+ responseStatus?: number;
89
+ responseBody?: string;
90
+ error?: string;
91
+ duration?: number;
92
+ createdAt: string;
93
+ deliveredAt?: string;
94
+ nextRetryAt?: string;
95
+ }
96
+ interface WebhookTriggerResult {
97
+ deliveryId: string;
98
+ webhookId: string;
99
+ event: WebhookEvent;
100
+ status: "queued" | "success" | "failed";
101
+ responseStatus?: number;
102
+ duration?: number;
103
+ error?: string;
104
+ }
105
+ declare const WEBHOOK_COLLECTION = "_webhooks";
106
+ declare const WEBHOOK_DELIVERY_COLLECTION = "_webhook_deliveries";
107
+ interface DeliveryResult {
108
+ success: boolean;
109
+ status: number;
110
+ statusText?: string;
111
+ body?: string;
112
+ duration: number;
113
+ error?: string;
114
+ }
115
+ interface DeliveryOptions {
116
+ timeout?: number;
117
+ maxRetries?: number;
118
+ retryDelay?: number;
119
+ onRetry?: (attempt: number, error: string) => void;
120
+ onSuccess?: (result: DeliveryResult) => void;
121
+ onFailure?: (error: string) => void;
122
+ }
123
+
124
+ declare class WebhookService {
125
+ private db;
126
+ constructor(db: BaseAdapter);
127
+ getWebhooks(filters?: {
128
+ status?: string;
129
+ event?: WebhookEvent;
130
+ }): Promise<WebhookConfig[]>;
131
+ getWebhookById(id: string): Promise<WebhookConfig | null>;
132
+ createWebhook(data: CreateWebhookData): Promise<WebhookConfig>;
133
+ updateWebhook(id: string, data: UpdateWebhookData): Promise<WebhookConfig | null>;
134
+ deleteWebhook(id: string): Promise<void>;
135
+ trigger(event: WebhookEvent, payloadData: Omit<WebhookPayload, "id" | "event" | "timestamp">): Promise<WebhookTriggerResult[]>;
136
+ triggerWebhook(webhook: WebhookConfig, payload: WebhookPayload): Promise<WebhookTriggerResult>;
137
+ testWebhook(webhookId: string): Promise<WebhookTriggerResult | null>;
138
+ getDeliveryHistory(webhookId: string, limit?: number): Promise<WebhookDelivery[]>;
139
+ retryDelivery(deliveryId: string): Promise<WebhookTriggerResult | null>;
140
+ }
141
+ declare function createWebhookService(db: BaseAdapter): WebhookService;
142
+
143
+ 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 };
@@ -0,0 +1,143 @@
1
+ import { B as BaseAdapter } from './types-BcZiluXL.cjs';
2
+
3
+ declare const WEBHOOK_EVENTS: {
4
+ readonly COLLECTION_CREATE: "collection.create";
5
+ readonly COLLECTION_UPDATE: "collection.update";
6
+ readonly COLLECTION_DELETE: "collection.delete";
7
+ readonly MEDIA_UPLOAD: "media.upload";
8
+ readonly MEDIA_DELETE: "media.delete";
9
+ readonly AUTH_LOGIN: "auth.login";
10
+ readonly AUTH_REGISTER: "auth.register";
11
+ readonly AUTH_LOGOUT: "auth.logout";
12
+ readonly ORDER_CREATED: "order.created";
13
+ readonly ORDER_PAID: "order.paid";
14
+ readonly ORDER_SHIPPED: "order.shipped";
15
+ readonly ORDER_DELIVERED: "order.delivered";
16
+ };
17
+ type WebhookEvent = (typeof WEBHOOK_EVENTS)[keyof typeof WEBHOOK_EVENTS];
18
+ declare const ALL_WEBHOOK_EVENTS: WebhookEvent[];
19
+ type WebhookActionType = "generic" | "github-push";
20
+ interface WebhookActionConfig {
21
+ githubOwner?: string;
22
+ githubRepo?: string;
23
+ githubBranch?: string;
24
+ }
25
+ interface WebhookConfig {
26
+ id: string;
27
+ name: string;
28
+ url: string;
29
+ events: WebhookEvent[];
30
+ collections?: string[];
31
+ status: "active" | "inactive" | "error";
32
+ secret?: string;
33
+ headers?: Record<string, string>;
34
+ action?: WebhookActionType;
35
+ config?: WebhookActionConfig;
36
+ lastTriggered?: string;
37
+ lastError?: string;
38
+ createdAt: string;
39
+ updatedAt: string;
40
+ }
41
+ interface CreateWebhookData {
42
+ name: string;
43
+ url: string;
44
+ events: (WebhookEvent | "create" | "update" | "delete")[];
45
+ collections?: string[];
46
+ status?: "active" | "inactive";
47
+ secret?: string;
48
+ headers?: Record<string, string>;
49
+ action?: WebhookActionType;
50
+ config?: WebhookActionConfig;
51
+ }
52
+ interface UpdateWebhookData {
53
+ name?: string;
54
+ url?: string;
55
+ events?: (WebhookEvent | "create" | "update" | "delete")[];
56
+ collections?: string[];
57
+ status?: "active" | "inactive" | "error";
58
+ secret?: string;
59
+ headers?: Record<string, string>;
60
+ action?: WebhookActionType;
61
+ config?: WebhookActionConfig;
62
+ lastTriggered?: string | null;
63
+ lastError?: string | null;
64
+ }
65
+ interface WebhookPayload {
66
+ id: string;
67
+ event: WebhookEvent;
68
+ timestamp: string;
69
+ collection?: string;
70
+ operation?: "create" | "update" | "delete";
71
+ data?: unknown;
72
+ previousData?: unknown;
73
+ user?: {
74
+ id: string;
75
+ email?: string;
76
+ role?: string;
77
+ };
78
+ tenantId?: string;
79
+ metadata?: Record<string, unknown>;
80
+ }
81
+ interface WebhookDelivery {
82
+ id: string;
83
+ webhookId: string;
84
+ event: WebhookEvent;
85
+ payload: WebhookPayload;
86
+ attempt: number;
87
+ status: "pending" | "success" | "failed" | "retrying";
88
+ responseStatus?: number;
89
+ responseBody?: string;
90
+ error?: string;
91
+ duration?: number;
92
+ createdAt: string;
93
+ deliveredAt?: string;
94
+ nextRetryAt?: string;
95
+ }
96
+ interface WebhookTriggerResult {
97
+ deliveryId: string;
98
+ webhookId: string;
99
+ event: WebhookEvent;
100
+ status: "queued" | "success" | "failed";
101
+ responseStatus?: number;
102
+ duration?: number;
103
+ error?: string;
104
+ }
105
+ declare const WEBHOOK_COLLECTION = "_webhooks";
106
+ declare const WEBHOOK_DELIVERY_COLLECTION = "_webhook_deliveries";
107
+ interface DeliveryResult {
108
+ success: boolean;
109
+ status: number;
110
+ statusText?: string;
111
+ body?: string;
112
+ duration: number;
113
+ error?: string;
114
+ }
115
+ interface DeliveryOptions {
116
+ timeout?: number;
117
+ maxRetries?: number;
118
+ retryDelay?: number;
119
+ onRetry?: (attempt: number, error: string) => void;
120
+ onSuccess?: (result: DeliveryResult) => void;
121
+ onFailure?: (error: string) => void;
122
+ }
123
+
124
+ declare class WebhookService {
125
+ private db;
126
+ constructor(db: BaseAdapter);
127
+ getWebhooks(filters?: {
128
+ status?: string;
129
+ event?: WebhookEvent;
130
+ }): Promise<WebhookConfig[]>;
131
+ getWebhookById(id: string): Promise<WebhookConfig | null>;
132
+ createWebhook(data: CreateWebhookData): Promise<WebhookConfig>;
133
+ updateWebhook(id: string, data: UpdateWebhookData): Promise<WebhookConfig | null>;
134
+ deleteWebhook(id: string): Promise<void>;
135
+ trigger(event: WebhookEvent, payloadData: Omit<WebhookPayload, "id" | "event" | "timestamp">): Promise<WebhookTriggerResult[]>;
136
+ triggerWebhook(webhook: WebhookConfig, payload: WebhookPayload): Promise<WebhookTriggerResult>;
137
+ testWebhook(webhookId: string): Promise<WebhookTriggerResult | null>;
138
+ getDeliveryHistory(webhookId: string, limit?: number): Promise<WebhookDelivery[]>;
139
+ retryDelivery(deliveryId: string): Promise<WebhookTriggerResult | null>;
140
+ }
141
+ declare function createWebhookService(db: BaseAdapter): WebhookService;
142
+
143
+ 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 chunkRY3BG3AN_cjs=require('./chunk-RY3BG3AN.cjs');require('./chunk-IQYP3DDJ.cjs'),require('./chunk-QMQXKCCQ.cjs'),require('./chunk-65G73T7Z.cjs'),require('./chunk-KD7LUCFY.cjs'),require('./chunk-WMZEULS2.cjs'),require('./chunk-HS2KNFAB.cjs'),require('./chunk-M5JUPA7G.cjs'),require('./chunk-GCQTSPX6.cjs'),require('./chunk-WIZ6C5QZ.cjs'),require('./chunk-GO34AOBZ.cjs'),require('./chunk-HOP4D5XZ.cjs'),require('./chunk-HVXO3OFB.cjs'),require('./chunk-XUONID6O.cjs'),require('./chunk-NY47CFVP.cjs'),require('./chunk-G3J2EU5D.cjs'),require('./chunk-4ORJMSJU.cjs'),require('./chunk-3ZFRP5M2.cjs'),require('./chunk-GYQMNXXW.cjs'),require('./chunk-MIOMMB23.cjs'),require('./chunk-RYIEE2TH.cjs'),require('./chunk-HHH4XNNS.cjs'),require('./chunk-EJDIR56C.cjs'),require('./chunk-D5P2IPGX.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 chunkRY3BG3AN_cjs.a.db.findOne({collection:"_globals_access-settings",where:{},draft:!0}))?.apiAccess?.graphqlEnabled??p.graphqlEnabled}catch{return true}}var l=async e=>{if(await chunkRY3BG3AN_cjs.b(),!await o())return r();let t=await chunkRY3BG3AN_cjs.a.getGraphQL().fetch(e.request,e.locals);return n(t)},u=async e=>{if(await chunkRY3BG3AN_cjs.b(),!await o())return r();let t=await chunkRY3BG3AN_cjs.a.getGraphQL().fetch(e.request,e.locals);return n(t)};exports.GET=u;exports.POST=l;
1
+ 'use strict';var chunkRL36RMMG_cjs=require('./chunk-RL36RMMG.cjs');require('./chunk-BIJHVTNO.cjs'),require('./chunk-QMQXKCCQ.cjs'),require('./chunk-65G73T7Z.cjs'),require('./chunk-KD7LUCFY.cjs'),require('./chunk-WMZEULS2.cjs'),require('./chunk-HS2KNFAB.cjs'),require('./chunk-LMIBASPC.cjs'),require('./chunk-GCQTSPX6.cjs'),require('./chunk-WIZ6C5QZ.cjs'),require('./chunk-GO34AOBZ.cjs'),require('./chunk-HOP4D5XZ.cjs'),require('./chunk-HVXO3OFB.cjs'),require('./chunk-XUONID6O.cjs'),require('./chunk-NY47CFVP.cjs'),require('./chunk-G3J2EU5D.cjs'),require('./chunk-4ORJMSJU.cjs'),require('./chunk-3ZFRP5M2.cjs'),require('./chunk-GYQMNXXW.cjs'),require('./chunk-MIOMMB23.cjs'),require('./chunk-RYIEE2TH.cjs'),require('./chunk-HHH4XNNS.cjs'),require('./chunk-EJDIR56C.cjs'),require('./chunk-D5P2IPGX.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 chunkRL36RMMG_cjs.a.db.findOne({collection:"_globals_access-settings",where:{},draft:!0}))?.apiAccess?.graphqlEnabled??p.graphqlEnabled}catch{return true}}var l=async e=>{if(await chunkRL36RMMG_cjs.b(),!await o())return r();let t=await chunkRL36RMMG_cjs.a.getGraphQL().fetch(e.request,e.locals);return n(t)},u=async e=>{if(await chunkRL36RMMG_cjs.b(),!await o())return r();let t=await chunkRL36RMMG_cjs.a.getGraphQL().fetch(e.request,e.locals);return n(t)};exports.GET=u;exports.POST=l;
@@ -0,0 +1,6 @@
1
+ import { APIRoute } from 'astro';
2
+
3
+ declare const POST: APIRoute;
4
+ declare const GET: APIRoute;
5
+
6
+ export { GET, POST };
@@ -0,0 +1,6 @@
1
+ import { APIRoute } from 'astro';
2
+
3
+ declare const POST: APIRoute;
4
+ declare const GET: APIRoute;
5
+
6
+ export { GET, POST };
@@ -1 +1 @@
1
- import {b,a}from'./chunk-ZZIGN5PZ.js';import'./chunk-DTSYK7KK.js';import'./chunk-O62KJ2J7.js';import'./chunk-NZ35PV5R.js';import'./chunk-5SEHX7ON.js';import'./chunk-ISCIUG37.js';import'./chunk-PP7W5UKL.js';import'./chunk-NI7S5JMH.js';import'./chunk-6NGUY76Y.js';import'./chunk-K6WUOU6P.js';import'./chunk-IETGL7WJ.js';import'./chunk-IKOXCJYO.js';import'./chunk-NRLIGDYF.js';import'./chunk-I67R6MR5.js';import'./chunk-HLSB2MCK.js';import'./chunk-GKYEJ2UF.js';import'./chunk-PP5S2UBV.js';import'./chunk-3RR6IV5I.js';import'./chunk-RHCWCG3O.js';import'./chunk-OG7CNQGU.js';import'./chunk-W6P4N3Z7.js';import'./chunk-IZCTG4RG.js';import'./chunk-TQNM4C7H.js';import'./chunk-6SPPR5JZ.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
+ import {b,a}from'./chunk-I4ZACL66.js';import'./chunk-YFRLT77I.js';import'./chunk-O62KJ2J7.js';import'./chunk-NZ35PV5R.js';import'./chunk-5SEHX7ON.js';import'./chunk-ISCIUG37.js';import'./chunk-PP7W5UKL.js';import'./chunk-CIA3BVH3.js';import'./chunk-6NGUY76Y.js';import'./chunk-K6WUOU6P.js';import'./chunk-IETGL7WJ.js';import'./chunk-IKOXCJYO.js';import'./chunk-NRLIGDYF.js';import'./chunk-I67R6MR5.js';import'./chunk-HLSB2MCK.js';import'./chunk-GKYEJ2UF.js';import'./chunk-PP5S2UBV.js';import'./chunk-3RR6IV5I.js';import'./chunk-RHCWCG3O.js';import'./chunk-OG7CNQGU.js';import'./chunk-W6P4N3Z7.js';import'./chunk-IZCTG4RG.js';import'./chunk-TQNM4C7H.js';import'./chunk-6SPPR5JZ.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 chunkRY3BG3AN_cjs=require('./chunk-RY3BG3AN.cjs');require('./chunk-IQYP3DDJ.cjs'),require('./chunk-QMQXKCCQ.cjs'),require('./chunk-65G73T7Z.cjs'),require('./chunk-KD7LUCFY.cjs'),require('./chunk-WMZEULS2.cjs'),require('./chunk-HS2KNFAB.cjs'),require('./chunk-M5JUPA7G.cjs'),require('./chunk-GCQTSPX6.cjs'),require('./chunk-WIZ6C5QZ.cjs'),require('./chunk-GO34AOBZ.cjs'),require('./chunk-HOP4D5XZ.cjs'),require('./chunk-HVXO3OFB.cjs'),require('./chunk-XUONID6O.cjs'),require('./chunk-NY47CFVP.cjs'),require('./chunk-G3J2EU5D.cjs'),require('./chunk-4ORJMSJU.cjs'),require('./chunk-3ZFRP5M2.cjs'),require('./chunk-GYQMNXXW.cjs'),require('./chunk-MIOMMB23.cjs'),require('./chunk-RYIEE2TH.cjs'),require('./chunk-HHH4XNNS.cjs'),require('./chunk-EJDIR56C.cjs'),require('./chunk-D5P2IPGX.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 chunkRY3BG3AN_cjs.a.db.findOne({collection:"_globals_access-settings",where:{},draft:!0}))?.apiAccess?.trpcEnabled??r.trpcEnabled}catch{return true}}var i=async e=>(await chunkRY3BG3AN_cjs.b(),await s()?chunkRY3BG3AN_cjs.a.getTRPC().fetch(e.request,e.locals):n());exports.ALL=i;
1
+ 'use strict';var chunkRL36RMMG_cjs=require('./chunk-RL36RMMG.cjs');require('./chunk-BIJHVTNO.cjs'),require('./chunk-QMQXKCCQ.cjs'),require('./chunk-65G73T7Z.cjs'),require('./chunk-KD7LUCFY.cjs'),require('./chunk-WMZEULS2.cjs'),require('./chunk-HS2KNFAB.cjs'),require('./chunk-LMIBASPC.cjs'),require('./chunk-GCQTSPX6.cjs'),require('./chunk-WIZ6C5QZ.cjs'),require('./chunk-GO34AOBZ.cjs'),require('./chunk-HOP4D5XZ.cjs'),require('./chunk-HVXO3OFB.cjs'),require('./chunk-XUONID6O.cjs'),require('./chunk-NY47CFVP.cjs'),require('./chunk-G3J2EU5D.cjs'),require('./chunk-4ORJMSJU.cjs'),require('./chunk-3ZFRP5M2.cjs'),require('./chunk-GYQMNXXW.cjs'),require('./chunk-MIOMMB23.cjs'),require('./chunk-RYIEE2TH.cjs'),require('./chunk-HHH4XNNS.cjs'),require('./chunk-EJDIR56C.cjs'),require('./chunk-D5P2IPGX.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 chunkRL36RMMG_cjs.a.db.findOne({collection:"_globals_access-settings",where:{},draft:!0}))?.apiAccess?.trpcEnabled??r.trpcEnabled}catch{return true}}var i=async e=>(await chunkRL36RMMG_cjs.b(),await s()?chunkRL36RMMG_cjs.a.getTRPC().fetch(e.request,e.locals):n());exports.ALL=i;
@@ -0,0 +1,5 @@
1
+ import { APIRoute } from 'astro';
2
+
3
+ declare const ALL: APIRoute;
4
+
5
+ export { ALL };
@@ -0,0 +1,5 @@
1
+ import { APIRoute } from 'astro';
2
+
3
+ declare const ALL: APIRoute;
4
+
5
+ export { ALL };
@@ -1 +1 @@
1
- import {b,a}from'./chunk-ZZIGN5PZ.js';import'./chunk-DTSYK7KK.js';import'./chunk-O62KJ2J7.js';import'./chunk-NZ35PV5R.js';import'./chunk-5SEHX7ON.js';import'./chunk-ISCIUG37.js';import'./chunk-PP7W5UKL.js';import'./chunk-NI7S5JMH.js';import'./chunk-6NGUY76Y.js';import'./chunk-K6WUOU6P.js';import'./chunk-IETGL7WJ.js';import'./chunk-IKOXCJYO.js';import'./chunk-NRLIGDYF.js';import'./chunk-I67R6MR5.js';import'./chunk-HLSB2MCK.js';import'./chunk-GKYEJ2UF.js';import'./chunk-PP5S2UBV.js';import'./chunk-3RR6IV5I.js';import'./chunk-RHCWCG3O.js';import'./chunk-OG7CNQGU.js';import'./chunk-W6P4N3Z7.js';import'./chunk-IZCTG4RG.js';import'./chunk-TQNM4C7H.js';import'./chunk-6SPPR5JZ.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};
1
+ import {b,a}from'./chunk-I4ZACL66.js';import'./chunk-YFRLT77I.js';import'./chunk-O62KJ2J7.js';import'./chunk-NZ35PV5R.js';import'./chunk-5SEHX7ON.js';import'./chunk-ISCIUG37.js';import'./chunk-PP7W5UKL.js';import'./chunk-CIA3BVH3.js';import'./chunk-6NGUY76Y.js';import'./chunk-K6WUOU6P.js';import'./chunk-IETGL7WJ.js';import'./chunk-IKOXCJYO.js';import'./chunk-NRLIGDYF.js';import'./chunk-I67R6MR5.js';import'./chunk-HLSB2MCK.js';import'./chunk-GKYEJ2UF.js';import'./chunk-PP5S2UBV.js';import'./chunk-3RR6IV5I.js';import'./chunk-RHCWCG3O.js';import'./chunk-OG7CNQGU.js';import'./chunk-W6P4N3Z7.js';import'./chunk-IZCTG4RG.js';import'./chunk-TQNM4C7H.js';import'./chunk-6SPPR5JZ.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};
@@ -1 +1 @@
1
- 'use strict';var chunkRY3BG3AN_cjs=require('./chunk-RY3BG3AN.cjs');require('./chunk-IQYP3DDJ.cjs'),require('./chunk-QMQXKCCQ.cjs'),require('./chunk-65G73T7Z.cjs'),require('./chunk-KD7LUCFY.cjs'),require('./chunk-WMZEULS2.cjs'),require('./chunk-HS2KNFAB.cjs'),require('./chunk-M5JUPA7G.cjs'),require('./chunk-GCQTSPX6.cjs'),require('./chunk-WIZ6C5QZ.cjs'),require('./chunk-GO34AOBZ.cjs'),require('./chunk-HOP4D5XZ.cjs'),require('./chunk-HVXO3OFB.cjs'),require('./chunk-XUONID6O.cjs'),require('./chunk-NY47CFVP.cjs'),require('./chunk-G3J2EU5D.cjs'),require('./chunk-4ORJMSJU.cjs'),require('./chunk-3ZFRP5M2.cjs'),require('./chunk-GYQMNXXW.cjs'),require('./chunk-MIOMMB23.cjs'),require('./chunk-RYIEE2TH.cjs'),require('./chunk-HHH4XNNS.cjs'),require('./chunk-EJDIR56C.cjs'),require('./chunk-D5P2IPGX.cjs'),require('./chunk-Q3Q7BJVQ.cjs'),require('./chunk-AHSFSERC.cjs');Object.defineProperty(exports,"ALL",{enumerable:true,get:function(){return chunkRY3BG3AN_cjs.c}});Object.defineProperty(exports,"kyroInstance",{enumerable:true,get:function(){return chunkRY3BG3AN_cjs.a}});Object.defineProperty(exports,"warmKyroInstance",{enumerable:true,get:function(){return chunkRY3BG3AN_cjs.b}});
1
+ 'use strict';var chunkRL36RMMG_cjs=require('./chunk-RL36RMMG.cjs');require('./chunk-BIJHVTNO.cjs'),require('./chunk-QMQXKCCQ.cjs'),require('./chunk-65G73T7Z.cjs'),require('./chunk-KD7LUCFY.cjs'),require('./chunk-WMZEULS2.cjs'),require('./chunk-HS2KNFAB.cjs'),require('./chunk-LMIBASPC.cjs'),require('./chunk-GCQTSPX6.cjs'),require('./chunk-WIZ6C5QZ.cjs'),require('./chunk-GO34AOBZ.cjs'),require('./chunk-HOP4D5XZ.cjs'),require('./chunk-HVXO3OFB.cjs'),require('./chunk-XUONID6O.cjs'),require('./chunk-NY47CFVP.cjs'),require('./chunk-G3J2EU5D.cjs'),require('./chunk-4ORJMSJU.cjs'),require('./chunk-3ZFRP5M2.cjs'),require('./chunk-GYQMNXXW.cjs'),require('./chunk-MIOMMB23.cjs'),require('./chunk-RYIEE2TH.cjs'),require('./chunk-HHH4XNNS.cjs'),require('./chunk-EJDIR56C.cjs'),require('./chunk-D5P2IPGX.cjs'),require('./chunk-Q3Q7BJVQ.cjs'),require('./chunk-AHSFSERC.cjs');Object.defineProperty(exports,"ALL",{enumerable:true,get:function(){return chunkRL36RMMG_cjs.c}});Object.defineProperty(exports,"kyroInstance",{enumerable:true,get:function(){return chunkRL36RMMG_cjs.a}});Object.defineProperty(exports,"warmKyroInstance",{enumerable:true,get:function(){return chunkRL36RMMG_cjs.b}});
@@ -0,0 +1,7 @@
1
+ import { APIRoute } from 'astro';
2
+
3
+ declare let kyroInstance: any;
4
+ declare function warmKyroInstance(): Promise<void>;
5
+ declare const ALL: APIRoute;
6
+
7
+ export { ALL, kyroInstance, warmKyroInstance };
@@ -0,0 +1,7 @@
1
+ import { APIRoute } from 'astro';
2
+
3
+ declare let kyroInstance: any;
4
+ declare function warmKyroInstance(): Promise<void>;
5
+ declare const ALL: APIRoute;
6
+
7
+ export { ALL, kyroInstance, warmKyroInstance };
@@ -1 +1 @@
1
- export{c as ALL,a as kyroInstance,b as warmKyroInstance}from'./chunk-ZZIGN5PZ.js';import'./chunk-DTSYK7KK.js';import'./chunk-O62KJ2J7.js';import'./chunk-NZ35PV5R.js';import'./chunk-5SEHX7ON.js';import'./chunk-ISCIUG37.js';import'./chunk-PP7W5UKL.js';import'./chunk-NI7S5JMH.js';import'./chunk-6NGUY76Y.js';import'./chunk-K6WUOU6P.js';import'./chunk-IETGL7WJ.js';import'./chunk-IKOXCJYO.js';import'./chunk-NRLIGDYF.js';import'./chunk-I67R6MR5.js';import'./chunk-HLSB2MCK.js';import'./chunk-GKYEJ2UF.js';import'./chunk-PP5S2UBV.js';import'./chunk-3RR6IV5I.js';import'./chunk-RHCWCG3O.js';import'./chunk-OG7CNQGU.js';import'./chunk-W6P4N3Z7.js';import'./chunk-IZCTG4RG.js';import'./chunk-TQNM4C7H.js';import'./chunk-6SPPR5JZ.js';import'./chunk-KDNYHLD2.js';import'./chunk-5J6HXUF6.js';
1
+ export{c as ALL,a as kyroInstance,b as warmKyroInstance}from'./chunk-I4ZACL66.js';import'./chunk-YFRLT77I.js';import'./chunk-O62KJ2J7.js';import'./chunk-NZ35PV5R.js';import'./chunk-5SEHX7ON.js';import'./chunk-ISCIUG37.js';import'./chunk-PP7W5UKL.js';import'./chunk-CIA3BVH3.js';import'./chunk-6NGUY76Y.js';import'./chunk-K6WUOU6P.js';import'./chunk-IETGL7WJ.js';import'./chunk-IKOXCJYO.js';import'./chunk-NRLIGDYF.js';import'./chunk-I67R6MR5.js';import'./chunk-HLSB2MCK.js';import'./chunk-GKYEJ2UF.js';import'./chunk-PP5S2UBV.js';import'./chunk-3RR6IV5I.js';import'./chunk-RHCWCG3O.js';import'./chunk-OG7CNQGU.js';import'./chunk-W6P4N3Z7.js';import'./chunk-IZCTG4RG.js';import'./chunk-TQNM4C7H.js';import'./chunk-6SPPR5JZ.js';import'./chunk-KDNYHLD2.js';import'./chunk-5J6HXUF6.js';
@@ -0,0 +1,74 @@
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-BcZiluXL.cjs';
2
+ import { F as Field, m as RelationshipField, U as UploadField } from './types-euTszc-1.cjs';
3
+
4
+ declare abstract class AbstractBaseAdapter implements BaseAdapter {
5
+ protected collections: Map<string, CollectionConfig>;
6
+ protected globals: Map<string, GlobalConfig>;
7
+ protected connected: boolean;
8
+ protected tenantContext?: TenantContext;
9
+ abstract connect(): Promise<void>;
10
+ abstract disconnect(): Promise<void>;
11
+ setTenantContext(context: TenantContext | undefined): void;
12
+ getTenantContext(): TenantContext | undefined;
13
+ init(collections: CollectionConfig[], globals?: GlobalConfig[]): Promise<void>;
14
+ abstract find<T>(args: FindArgs): Promise<FindResult<T>>;
15
+ abstract findByID<T>(args: FindByIDArgs): Promise<T | null>;
16
+ abstract create<T>(args: CreateArgs): Promise<T>;
17
+ abstract update<T>(args: UpdateArgs): Promise<T>;
18
+ abstract delete<T>(args: DeleteArgs): Promise<T>;
19
+ abstract count(args: {
20
+ collection: string;
21
+ where?: Record<string, any>;
22
+ tenantId?: string;
23
+ }): Promise<number>;
24
+ abstract findOne(args: {
25
+ collection: string;
26
+ where: Record<string, any>;
27
+ tenantId?: string;
28
+ draft?: boolean;
29
+ }): Promise<any>;
30
+ abstract findVersions(args: FindVersionsArgs): Promise<FindResult<VersionRecord>>;
31
+ abstract findVersionByID(args: {
32
+ collection: string;
33
+ versionId: string;
34
+ tenantId?: string;
35
+ }): Promise<VersionRecord | null>;
36
+ abstract createVersion<T = Record<string, any>>(args: CreateVersionArgs<T>): Promise<VersionRecord<T>>;
37
+ abstract updateLatestVersion<T = Record<string, any>>(args: CreateVersionArgs<T>): Promise<VersionRecord<T>>;
38
+ abstract deleteVersions(args: {
39
+ collection: string;
40
+ documentId: string;
41
+ keepLatest?: number;
42
+ tenantId?: string;
43
+ }): Promise<void>;
44
+ migrate?(): Promise<void>;
45
+ rollback?(): Promise<void>;
46
+ transaction?<T>(fn: (tx: any) => Promise<T>): Promise<T>;
47
+ protected getCollection(slug: string): CollectionConfig;
48
+ protected applyTenantFilter(where?: Record<string, any>, tenantId?: string): Record<string, any>;
49
+ protected getTableName(slug: string): string;
50
+ protected prepareData(data: Record<string, any>, collection: CollectionConfig): Record<string, any>;
51
+ protected processRelationships(data: Record<string, any>, fields: Field[], depth: number): Record<string, any>;
52
+ protected parseSort(sort?: string): {
53
+ field: string;
54
+ direction: 'asc' | 'desc';
55
+ };
56
+ protected calculatePagination(page: number, limit: number, totalDocs: number): {
57
+ totalDocs: number;
58
+ limit: number;
59
+ totalPages: number;
60
+ page: number;
61
+ pagingCounter: number;
62
+ hasPrevPage: boolean;
63
+ hasNextPage: boolean;
64
+ prevPage: number | null;
65
+ nextPage: number | null;
66
+ };
67
+ protected selectFields(data: Record<string, any>, select?: string[]): Record<string, any>;
68
+ protected isRelationshipField(field: Field): field is RelationshipField;
69
+ protected isUploadField(field: Field): field is UploadField;
70
+ protected getRelationshipFields(fields: Field[]): RelationshipField[];
71
+ protected getUploadFields(fields: Field[]): UploadField[];
72
+ }
73
+
74
+ export { AbstractBaseAdapter as A };
@@ -0,0 +1,74 @@
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-Dc8VAPhF.js';
2
+ import { F as Field, m as RelationshipField, U as UploadField } from './types-euTszc-1.js';
3
+
4
+ declare abstract class AbstractBaseAdapter implements BaseAdapter {
5
+ protected collections: Map<string, CollectionConfig>;
6
+ protected globals: Map<string, GlobalConfig>;
7
+ protected connected: boolean;
8
+ protected tenantContext?: TenantContext;
9
+ abstract connect(): Promise<void>;
10
+ abstract disconnect(): Promise<void>;
11
+ setTenantContext(context: TenantContext | undefined): void;
12
+ getTenantContext(): TenantContext | undefined;
13
+ init(collections: CollectionConfig[], globals?: GlobalConfig[]): Promise<void>;
14
+ abstract find<T>(args: FindArgs): Promise<FindResult<T>>;
15
+ abstract findByID<T>(args: FindByIDArgs): Promise<T | null>;
16
+ abstract create<T>(args: CreateArgs): Promise<T>;
17
+ abstract update<T>(args: UpdateArgs): Promise<T>;
18
+ abstract delete<T>(args: DeleteArgs): Promise<T>;
19
+ abstract count(args: {
20
+ collection: string;
21
+ where?: Record<string, any>;
22
+ tenantId?: string;
23
+ }): Promise<number>;
24
+ abstract findOne(args: {
25
+ collection: string;
26
+ where: Record<string, any>;
27
+ tenantId?: string;
28
+ draft?: boolean;
29
+ }): Promise<any>;
30
+ abstract findVersions(args: FindVersionsArgs): Promise<FindResult<VersionRecord>>;
31
+ abstract findVersionByID(args: {
32
+ collection: string;
33
+ versionId: string;
34
+ tenantId?: string;
35
+ }): Promise<VersionRecord | null>;
36
+ abstract createVersion<T = Record<string, any>>(args: CreateVersionArgs<T>): Promise<VersionRecord<T>>;
37
+ abstract updateLatestVersion<T = Record<string, any>>(args: CreateVersionArgs<T>): Promise<VersionRecord<T>>;
38
+ abstract deleteVersions(args: {
39
+ collection: string;
40
+ documentId: string;
41
+ keepLatest?: number;
42
+ tenantId?: string;
43
+ }): Promise<void>;
44
+ migrate?(): Promise<void>;
45
+ rollback?(): Promise<void>;
46
+ transaction?<T>(fn: (tx: any) => Promise<T>): Promise<T>;
47
+ protected getCollection(slug: string): CollectionConfig;
48
+ protected applyTenantFilter(where?: Record<string, any>, tenantId?: string): Record<string, any>;
49
+ protected getTableName(slug: string): string;
50
+ protected prepareData(data: Record<string, any>, collection: CollectionConfig): Record<string, any>;
51
+ protected processRelationships(data: Record<string, any>, fields: Field[], depth: number): Record<string, any>;
52
+ protected parseSort(sort?: string): {
53
+ field: string;
54
+ direction: 'asc' | 'desc';
55
+ };
56
+ protected calculatePagination(page: number, limit: number, totalDocs: number): {
57
+ totalDocs: number;
58
+ limit: number;
59
+ totalPages: number;
60
+ page: number;
61
+ pagingCounter: number;
62
+ hasPrevPage: boolean;
63
+ hasNextPage: boolean;
64
+ prevPage: number | null;
65
+ nextPage: number | null;
66
+ };
67
+ protected selectFields(data: Record<string, any>, select?: string[]): Record<string, any>;
68
+ protected isRelationshipField(field: Field): field is RelationshipField;
69
+ protected isUploadField(field: Field): field is UploadField;
70
+ protected getRelationshipFields(fields: Field[]): RelationshipField[];
71
+ protected getUploadFields(fields: Field[]): UploadField[];
72
+ }
73
+
74
+ export { AbstractBaseAdapter as A };