@kyro-cms/core 0.3.4 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/README.md +3 -3
  2. package/dist/api-handler.cjs +6 -6
  3. package/dist/api-handler.js +5 -5
  4. package/dist/{chunk-X3CU27OO.cjs → chunk-3FW6WVVP.cjs} +2 -17
  5. package/dist/chunk-3FW6WVVP.cjs.map +1 -0
  6. package/dist/{chunk-CZ3HWX2X.cjs → chunk-3ZZPZYCM.cjs} +42 -67
  7. package/dist/chunk-3ZZPZYCM.cjs.map +1 -0
  8. package/dist/{chunk-6LPNEC6D.js → chunk-C4JJEE42.js} +43 -68
  9. package/dist/chunk-C4JJEE42.js.map +1 -0
  10. package/dist/{chunk-VEI5KQVC.cjs → chunk-FWGHXRRI.cjs} +45 -15
  11. package/dist/chunk-FWGHXRRI.cjs.map +1 -0
  12. package/dist/{chunk-MMYAIYHJ.cjs → chunk-M4GFA2UQ.cjs} +336 -32
  13. package/dist/chunk-M4GFA2UQ.cjs.map +1 -0
  14. package/dist/{chunk-2SJATAN4.js → chunk-OJBK3JYF.js} +336 -32
  15. package/dist/chunk-OJBK3JYF.js.map +1 -0
  16. package/dist/{chunk-XIXGJGQW.js → chunk-SAMZQVC2.js} +44 -14
  17. package/dist/chunk-SAMZQVC2.js.map +1 -0
  18. package/dist/{chunk-B76I67F3.js → chunk-WSCJQI2B.js} +61 -13
  19. package/dist/chunk-WSCJQI2B.js.map +1 -0
  20. package/dist/{chunk-RGIQKTZ7.js → chunk-YMG55RSX.js} +4 -18
  21. package/dist/chunk-YMG55RSX.js.map +1 -0
  22. package/dist/{chunk-DAIBBBOL.cjs → chunk-Z2OVHWHB.cjs} +61 -13
  23. package/dist/chunk-Z2OVHWHB.cjs.map +1 -0
  24. package/dist/drizzle/index.cjs +10 -10
  25. package/dist/drizzle/index.js +2 -2
  26. package/dist/index.cjs +138 -105
  27. package/dist/index.cjs.map +1 -1
  28. package/dist/index.js +77 -44
  29. package/dist/index.js.map +1 -1
  30. package/dist/rest/index.cjs +5 -4
  31. package/dist/rest/index.js +3 -2
  32. package/dist/templates/index.cjs +24 -24
  33. package/dist/templates/index.js +1 -1
  34. package/package.json +2 -14
  35. package/dist/WebhookService-BCpW2dyL.d.ts +0 -112
  36. package/dist/WebhookService-DxYSFvNg.d.cts +0 -112
  37. package/dist/api-handler.d.cts +0 -9
  38. package/dist/api-handler.d.ts +0 -9
  39. package/dist/base-DvvNqnM-.d.cts +0 -73
  40. package/dist/base-eVegJ_Pr.d.ts +0 -73
  41. package/dist/chunk-2SJATAN4.js.map +0 -1
  42. package/dist/chunk-6LPNEC6D.js.map +0 -1
  43. package/dist/chunk-B76I67F3.js.map +0 -1
  44. package/dist/chunk-CZ3HWX2X.cjs.map +0 -1
  45. package/dist/chunk-DAIBBBOL.cjs.map +0 -1
  46. package/dist/chunk-MMYAIYHJ.cjs.map +0 -1
  47. package/dist/chunk-RGIQKTZ7.js.map +0 -1
  48. package/dist/chunk-VEI5KQVC.cjs.map +0 -1
  49. package/dist/chunk-X3CU27OO.cjs.map +0 -1
  50. package/dist/chunk-XIXGJGQW.js.map +0 -1
  51. package/dist/cli/index.d.cts +0 -1
  52. package/dist/cli/index.d.ts +0 -1
  53. package/dist/client.d.cts +0 -12
  54. package/dist/client.d.ts +0 -12
  55. package/dist/drizzle/index.d.cts +0 -135
  56. package/dist/drizzle/index.d.ts +0 -135
  57. package/dist/fields/index.d.cts +0 -27
  58. package/dist/fields/index.d.ts +0 -27
  59. package/dist/graphql/index.d.cts +0 -22
  60. package/dist/graphql/index.d.ts +0 -22
  61. package/dist/index-Bz9JqRGI.d.cts +0 -86
  62. package/dist/index-Bz9JqRGI.d.ts +0 -86
  63. package/dist/index-CLp-DRKA.d.ts +0 -64
  64. package/dist/index-DfO7G4kN.d.cts +0 -64
  65. package/dist/index.d.cts +0 -1361
  66. package/dist/index.d.ts +0 -1361
  67. package/dist/integration.d.cts +0 -27
  68. package/dist/integration.d.ts +0 -27
  69. package/dist/mongodb/index.d.cts +0 -63
  70. package/dist/mongodb/index.d.ts +0 -63
  71. package/dist/mysql-media-AI6YK767.cjs +0 -48
  72. package/dist/mysql-media-AI6YK767.cjs.map +0 -1
  73. package/dist/mysql-media-CDZUS7YX.js +0 -45
  74. package/dist/mysql-media-CDZUS7YX.js.map +0 -1
  75. package/dist/rest/index.d.cts +0 -57
  76. package/dist/rest/index.d.ts +0 -57
  77. package/dist/templates/index.d.cts +0 -59
  78. package/dist/templates/index.d.ts +0 -59
  79. package/dist/trpc/index.d.cts +0 -136
  80. package/dist/trpc/index.d.ts +0 -136
  81. package/dist/types-Bs1up4yP.d.ts +0 -461
  82. package/dist/types-Da83JLDk.d.cts +0 -130
  83. package/dist/types-Da83JLDk.d.ts +0 -130
  84. package/dist/types-J3R9nVsZ.d.cts +0 -461
  85. package/dist/types-VtjUxIMp.d.cts +0 -246
  86. package/dist/types-VtjUxIMp.d.ts +0 -246
  87. package/dist/ws/index.d.cts +0 -88
  88. package/dist/ws/index.d.ts +0 -88
@@ -1,23 +1,24 @@
1
1
  'use strict';
2
2
 
3
- var chunkMMYAIYHJ_cjs = require('../chunk-MMYAIYHJ.cjs');
3
+ var chunkM4GFA2UQ_cjs = require('../chunk-M4GFA2UQ.cjs');
4
4
  require('../chunk-DLHUQO25.cjs');
5
5
  require('../chunk-4PWRCMTQ.cjs');
6
6
  require('../chunk-ADLJSJSN.cjs');
7
7
  require('../chunk-IBG6V56E.cjs');
8
+ require('../chunk-VJT6P4N6.cjs');
8
9
  require('../chunk-R3XIBBAW.cjs');
9
- require('../chunk-X3CU27OO.cjs');
10
+ require('../chunk-3FW6WVVP.cjs');
10
11
  require('../chunk-G7VZBCD6.cjs');
11
12
 
12
13
 
13
14
 
14
15
  Object.defineProperty(exports, "createHonoApp", {
15
16
  enumerable: true,
16
- get: function () { return chunkMMYAIYHJ_cjs.createHonoApp; }
17
+ get: function () { return chunkM4GFA2UQ_cjs.createHonoApp; }
17
18
  });
18
19
  Object.defineProperty(exports, "createRESTAPI", {
19
20
  enumerable: true,
20
- get: function () { return chunkMMYAIYHJ_cjs.createRESTAPI; }
21
+ get: function () { return chunkM4GFA2UQ_cjs.createRESTAPI; }
21
22
  });
22
23
  //# sourceMappingURL=index.cjs.map
23
24
  //# sourceMappingURL=index.cjs.map
@@ -1,10 +1,11 @@
1
- export { createHonoApp, createRESTAPI } from '../chunk-2SJATAN4.js';
1
+ export { createHonoApp, createRESTAPI } from '../chunk-OJBK3JYF.js';
2
2
  import '../chunk-RYDGMBIG.js';
3
3
  import '../chunk-YT7HXXVN.js';
4
4
  import '../chunk-P2YW545G.js';
5
5
  import '../chunk-QXIQWPAP.js';
6
+ import '../chunk-REK7AYOC.js';
6
7
  import '../chunk-SDMNUYVU.js';
7
- import '../chunk-RGIQKTZ7.js';
8
+ import '../chunk-YMG55RSX.js';
8
9
  import '../chunk-Z6ZWNWWR.js';
9
10
  //# sourceMappingURL=index.js.map
10
11
  //# sourceMappingURL=index.js.map
@@ -1,101 +1,101 @@
1
1
  'use strict';
2
2
 
3
- var chunkDAIBBBOL_cjs = require('../chunk-DAIBBBOL.cjs');
3
+ var chunkZ2OVHWHB_cjs = require('../chunk-Z2OVHWHB.cjs');
4
4
  require('../chunk-G7VZBCD6.cjs');
5
5
 
6
6
 
7
7
 
8
8
  Object.defineProperty(exports, "accessSettingsGlobal", {
9
9
  enumerable: true,
10
- get: function () { return chunkDAIBBBOL_cjs.accessSettingsGlobal; }
10
+ get: function () { return chunkZ2OVHWHB_cjs.accessSettingsGlobal; }
11
11
  });
12
12
  Object.defineProperty(exports, "allSettingsGlobals", {
13
13
  enumerable: true,
14
- get: function () { return chunkDAIBBBOL_cjs.allSettingsGlobals; }
14
+ get: function () { return chunkZ2OVHWHB_cjs.allSettingsGlobals; }
15
15
  });
16
16
  Object.defineProperty(exports, "authCollections", {
17
17
  enumerable: true,
18
- get: function () { return chunkDAIBBBOL_cjs.authCollections; }
18
+ get: function () { return chunkZ2OVHWHB_cjs.authCollections; }
19
19
  });
20
20
  Object.defineProperty(exports, "blogCollections", {
21
21
  enumerable: true,
22
- get: function () { return chunkDAIBBBOL_cjs.blogCollections; }
22
+ get: function () { return chunkZ2OVHWHB_cjs.blogCollections; }
23
23
  });
24
24
  Object.defineProperty(exports, "blogGlobals", {
25
25
  enumerable: true,
26
- get: function () { return chunkDAIBBBOL_cjs.blogGlobals; }
26
+ get: function () { return chunkZ2OVHWHB_cjs.blogGlobals; }
27
27
  });
28
28
  Object.defineProperty(exports, "coreSettingsGlobals", {
29
29
  enumerable: true,
30
- get: function () { return chunkDAIBBBOL_cjs.coreSettingsGlobals; }
30
+ get: function () { return chunkZ2OVHWHB_cjs.coreSettingsGlobals; }
31
31
  });
32
32
  Object.defineProperty(exports, "createTemplateConfig", {
33
33
  enumerable: true,
34
- get: function () { return chunkDAIBBBOL_cjs.createTemplateConfig; }
34
+ get: function () { return chunkZ2OVHWHB_cjs.createTemplateConfig; }
35
35
  });
36
36
  Object.defineProperty(exports, "ecommerceCollections", {
37
37
  enumerable: true,
38
- get: function () { return chunkDAIBBBOL_cjs.ecommerceCollections; }
38
+ get: function () { return chunkZ2OVHWHB_cjs.ecommerceCollections; }
39
39
  });
40
40
  Object.defineProperty(exports, "ecommerceGlobals", {
41
41
  enumerable: true,
42
- get: function () { return chunkDAIBBBOL_cjs.ecommerceGlobals; }
42
+ get: function () { return chunkZ2OVHWHB_cjs.ecommerceGlobals; }
43
43
  });
44
44
  Object.defineProperty(exports, "ecommerceSettingsGlobals", {
45
45
  enumerable: true,
46
- get: function () { return chunkDAIBBBOL_cjs.ecommerceSettingsGlobals; }
46
+ get: function () { return chunkZ2OVHWHB_cjs.ecommerceSettingsGlobals; }
47
47
  });
48
48
  Object.defineProperty(exports, "emailSettingsGlobal", {
49
49
  enumerable: true,
50
- get: function () { return chunkDAIBBBOL_cjs.emailSettingsGlobal; }
50
+ get: function () { return chunkZ2OVHWHB_cjs.emailSettingsGlobal; }
51
51
  });
52
52
  Object.defineProperty(exports, "getSettingsForTemplate", {
53
53
  enumerable: true,
54
- get: function () { return chunkDAIBBBOL_cjs.getSettingsForTemplate; }
54
+ get: function () { return chunkZ2OVHWHB_cjs.getSettingsForTemplate; }
55
55
  });
56
56
  Object.defineProperty(exports, "kitchenSinkCollections", {
57
57
  enumerable: true,
58
- get: function () { return chunkDAIBBBOL_cjs.kitchenSinkCollections; }
58
+ get: function () { return chunkZ2OVHWHB_cjs.kitchenSinkCollections; }
59
59
  });
60
60
  Object.defineProperty(exports, "mediaCollection", {
61
61
  enumerable: true,
62
- get: function () { return chunkDAIBBBOL_cjs.mediaCollection; }
62
+ get: function () { return chunkZ2OVHWHB_cjs.mediaCollection; }
63
63
  });
64
64
  Object.defineProperty(exports, "mediaCollections", {
65
65
  enumerable: true,
66
- get: function () { return chunkDAIBBBOL_cjs.mediaCollections; }
66
+ get: function () { return chunkZ2OVHWHB_cjs.mediaCollections; }
67
67
  });
68
68
  Object.defineProperty(exports, "minimalCollections", {
69
69
  enumerable: true,
70
- get: function () { return chunkDAIBBBOL_cjs.minimalCollections; }
70
+ get: function () { return chunkZ2OVHWHB_cjs.minimalCollections; }
71
71
  });
72
72
  Object.defineProperty(exports, "paymentSettingsGlobal", {
73
73
  enumerable: true,
74
- get: function () { return chunkDAIBBBOL_cjs.paymentSettingsGlobal; }
74
+ get: function () { return chunkZ2OVHWHB_cjs.paymentSettingsGlobal; }
75
75
  });
76
76
  Object.defineProperty(exports, "seoSettingsGlobal", {
77
77
  enumerable: true,
78
- get: function () { return chunkDAIBBBOL_cjs.seoSettingsGlobal; }
78
+ get: function () { return chunkZ2OVHWHB_cjs.seoSettingsGlobal; }
79
79
  });
80
80
  Object.defineProperty(exports, "settingsBySlug", {
81
81
  enumerable: true,
82
- get: function () { return chunkDAIBBBOL_cjs.settingsBySlug; }
82
+ get: function () { return chunkZ2OVHWHB_cjs.settingsBySlug; }
83
83
  });
84
84
  Object.defineProperty(exports, "siteSettingsGlobal", {
85
85
  enumerable: true,
86
- get: function () { return chunkDAIBBBOL_cjs.siteSettingsGlobal; }
86
+ get: function () { return chunkZ2OVHWHB_cjs.siteSettingsGlobal; }
87
87
  });
88
88
  Object.defineProperty(exports, "socialSettingsGlobal", {
89
89
  enumerable: true,
90
- get: function () { return chunkDAIBBBOL_cjs.socialSettingsGlobal; }
90
+ get: function () { return chunkZ2OVHWHB_cjs.socialSettingsGlobal; }
91
91
  });
92
92
  Object.defineProperty(exports, "storageSettingsGlobal", {
93
93
  enumerable: true,
94
- get: function () { return chunkDAIBBBOL_cjs.storageSettingsGlobal; }
94
+ get: function () { return chunkZ2OVHWHB_cjs.storageSettingsGlobal; }
95
95
  });
96
96
  Object.defineProperty(exports, "storeSettingsGlobal", {
97
97
  enumerable: true,
98
- get: function () { return chunkDAIBBBOL_cjs.storeSettingsGlobal; }
98
+ get: function () { return chunkZ2OVHWHB_cjs.storeSettingsGlobal; }
99
99
  });
100
100
  //# sourceMappingURL=index.cjs.map
101
101
  //# sourceMappingURL=index.cjs.map
@@ -1,4 +1,4 @@
1
- export { accessSettingsGlobal, allSettingsGlobals, authCollections, blogCollections, blogGlobals, coreSettingsGlobals, createTemplateConfig, ecommerceCollections, ecommerceGlobals, ecommerceSettingsGlobals, emailSettingsGlobal, getSettingsForTemplate, kitchenSinkCollections, mediaCollection, mediaCollections, minimalCollections, paymentSettingsGlobal, seoSettingsGlobal, settingsBySlug, siteSettingsGlobal, socialSettingsGlobal, storageSettingsGlobal, storeSettingsGlobal } from '../chunk-B76I67F3.js';
1
+ export { accessSettingsGlobal, allSettingsGlobals, authCollections, blogCollections, blogGlobals, coreSettingsGlobals, createTemplateConfig, ecommerceCollections, ecommerceGlobals, ecommerceSettingsGlobals, emailSettingsGlobal, getSettingsForTemplate, kitchenSinkCollections, mediaCollection, mediaCollections, minimalCollections, paymentSettingsGlobal, seoSettingsGlobal, settingsBySlug, siteSettingsGlobal, socialSettingsGlobal, storageSettingsGlobal, storeSettingsGlobal } from '../chunk-WSCJQI2B.js';
2
2
  import '../chunk-Z6ZWNWWR.js';
3
3
  //# sourceMappingURL=index.js.map
4
4
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kyro-cms/core",
3
- "version": "0.3.4",
3
+ "version": "0.4.0",
4
4
  "description": "Astro-native headless CMS with multi-database adapters, multi-protocol APIs, and multi-vendor support",
5
5
  "engines": {
6
6
  "node": ">=22"
@@ -151,30 +151,18 @@
151
151
  "@types/jsonwebtoken": "^9.0.9",
152
152
  "@types/node": "^22.13.0",
153
153
  "@types/nodemailer": "^7.0.11",
154
- "@types/pg": "^8.20.0",
155
154
  "@types/ssh2-sftp-client": "^9.0.6",
156
155
  "@types/ws": "^8.18.1",
157
156
  "@typescript-eslint/parser": "^8.59.1",
158
157
  "drizzle-kit": "^0.31.10",
159
158
  "eslint": "^9.20.0",
160
- "mysql2": "^3.12.0",
161
- "pg": "^8.13.1",
162
159
  "prettier": "^3.5.0",
163
160
  "tsup": "^8.4.0",
164
161
  "typescript": "^5.7.3",
165
162
  "typescript-eslint": "^8.59.1",
166
163
  "vitest": "^3.0.0"
167
164
  },
168
- "peerDependencies": {
169
- "mysql2": ">=3.0.0",
165
+ "optionalDependencies": {
170
166
  "pg": ">=8.0.0"
171
- },
172
- "peerDependenciesMeta": {
173
- "pg": {
174
- "optional": true
175
- },
176
- "mysql2": {
177
- "optional": true
178
- }
179
167
  }
180
168
  }
@@ -1,112 +0,0 @@
1
- import { B as BaseAdapter } from './types-Bs1up4yP.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
- interface WebhookConfig {
20
- id: string;
21
- name: string;
22
- url: string;
23
- events: WebhookEvent[];
24
- status: "active" | "inactive" | "error";
25
- secret?: string;
26
- headers?: Record<string, string>;
27
- lastTriggered?: string;
28
- lastError?: string;
29
- createdAt: string;
30
- updatedAt: string;
31
- }
32
- interface CreateWebhookData {
33
- name: string;
34
- url: string;
35
- events: WebhookEvent[];
36
- status?: "active" | "inactive";
37
- secret?: string;
38
- headers?: Record<string, string>;
39
- }
40
- interface UpdateWebhookData {
41
- name?: string;
42
- url?: string;
43
- events?: WebhookEvent[];
44
- status?: "active" | "inactive" | "error";
45
- secret?: string;
46
- headers?: Record<string, string>;
47
- lastTriggered?: string | null;
48
- lastError?: string | null;
49
- }
50
- interface WebhookPayload {
51
- id: string;
52
- event: WebhookEvent;
53
- timestamp: string;
54
- collection?: string;
55
- operation?: "create" | "update" | "delete";
56
- data?: unknown;
57
- previousData?: unknown;
58
- user?: {
59
- id: string;
60
- email?: string;
61
- role?: string;
62
- };
63
- tenantId?: string;
64
- metadata?: Record<string, unknown>;
65
- }
66
- interface WebhookDelivery {
67
- id: string;
68
- webhookId: string;
69
- event: WebhookEvent;
70
- payload: WebhookPayload;
71
- attempt: number;
72
- status: "pending" | "success" | "failed" | "retrying";
73
- responseStatus?: number;
74
- responseBody?: string;
75
- error?: string;
76
- duration?: number;
77
- createdAt: string;
78
- deliveredAt?: string;
79
- nextRetryAt?: string;
80
- }
81
- interface WebhookTriggerResult {
82
- deliveryId: string;
83
- webhookId: string;
84
- event: WebhookEvent;
85
- status: "queued" | "success" | "failed";
86
- responseStatus?: number;
87
- duration?: number;
88
- error?: string;
89
- }
90
- declare const WEBHOOK_COLLECTION = "_webhooks";
91
- declare const WEBHOOK_DELIVERY_COLLECTION = "_webhook_deliveries";
92
-
93
- declare class WebhookService {
94
- private db;
95
- constructor(db: BaseAdapter);
96
- getWebhooks(filters?: {
97
- status?: string;
98
- event?: WebhookEvent;
99
- }): Promise<WebhookConfig[]>;
100
- getWebhookById(id: string): Promise<WebhookConfig | null>;
101
- createWebhook(data: CreateWebhookData): Promise<WebhookConfig>;
102
- updateWebhook(id: string, data: UpdateWebhookData): Promise<WebhookConfig | null>;
103
- deleteWebhook(id: string): Promise<void>;
104
- trigger(event: WebhookEvent, payloadData: Omit<WebhookPayload, "id" | "event" | "timestamp">): Promise<WebhookTriggerResult[]>;
105
- triggerWebhook(webhook: WebhookConfig, payload: WebhookPayload): Promise<WebhookTriggerResult>;
106
- testWebhook(webhookId: string): Promise<WebhookTriggerResult | null>;
107
- getDeliveryHistory(webhookId: string, limit?: number): Promise<WebhookDelivery[]>;
108
- retryDelivery(deliveryId: string): Promise<WebhookTriggerResult | null>;
109
- }
110
- declare function createWebhookService(db: BaseAdapter): WebhookService;
111
-
112
- 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, WEBHOOK_COLLECTION as c, WEBHOOK_DELIVERY_COLLECTION as d, WEBHOOK_EVENTS as e, type WebhookEvent as f, WebhookService as g, type WebhookTriggerResult as h, createWebhookService as i };
@@ -1,112 +0,0 @@
1
- import { B as BaseAdapter } from './types-J3R9nVsZ.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
- interface WebhookConfig {
20
- id: string;
21
- name: string;
22
- url: string;
23
- events: WebhookEvent[];
24
- status: "active" | "inactive" | "error";
25
- secret?: string;
26
- headers?: Record<string, string>;
27
- lastTriggered?: string;
28
- lastError?: string;
29
- createdAt: string;
30
- updatedAt: string;
31
- }
32
- interface CreateWebhookData {
33
- name: string;
34
- url: string;
35
- events: WebhookEvent[];
36
- status?: "active" | "inactive";
37
- secret?: string;
38
- headers?: Record<string, string>;
39
- }
40
- interface UpdateWebhookData {
41
- name?: string;
42
- url?: string;
43
- events?: WebhookEvent[];
44
- status?: "active" | "inactive" | "error";
45
- secret?: string;
46
- headers?: Record<string, string>;
47
- lastTriggered?: string | null;
48
- lastError?: string | null;
49
- }
50
- interface WebhookPayload {
51
- id: string;
52
- event: WebhookEvent;
53
- timestamp: string;
54
- collection?: string;
55
- operation?: "create" | "update" | "delete";
56
- data?: unknown;
57
- previousData?: unknown;
58
- user?: {
59
- id: string;
60
- email?: string;
61
- role?: string;
62
- };
63
- tenantId?: string;
64
- metadata?: Record<string, unknown>;
65
- }
66
- interface WebhookDelivery {
67
- id: string;
68
- webhookId: string;
69
- event: WebhookEvent;
70
- payload: WebhookPayload;
71
- attempt: number;
72
- status: "pending" | "success" | "failed" | "retrying";
73
- responseStatus?: number;
74
- responseBody?: string;
75
- error?: string;
76
- duration?: number;
77
- createdAt: string;
78
- deliveredAt?: string;
79
- nextRetryAt?: string;
80
- }
81
- interface WebhookTriggerResult {
82
- deliveryId: string;
83
- webhookId: string;
84
- event: WebhookEvent;
85
- status: "queued" | "success" | "failed";
86
- responseStatus?: number;
87
- duration?: number;
88
- error?: string;
89
- }
90
- declare const WEBHOOK_COLLECTION = "_webhooks";
91
- declare const WEBHOOK_DELIVERY_COLLECTION = "_webhook_deliveries";
92
-
93
- declare class WebhookService {
94
- private db;
95
- constructor(db: BaseAdapter);
96
- getWebhooks(filters?: {
97
- status?: string;
98
- event?: WebhookEvent;
99
- }): Promise<WebhookConfig[]>;
100
- getWebhookById(id: string): Promise<WebhookConfig | null>;
101
- createWebhook(data: CreateWebhookData): Promise<WebhookConfig>;
102
- updateWebhook(id: string, data: UpdateWebhookData): Promise<WebhookConfig | null>;
103
- deleteWebhook(id: string): Promise<void>;
104
- trigger(event: WebhookEvent, payloadData: Omit<WebhookPayload, "id" | "event" | "timestamp">): Promise<WebhookTriggerResult[]>;
105
- triggerWebhook(webhook: WebhookConfig, payload: WebhookPayload): Promise<WebhookTriggerResult>;
106
- testWebhook(webhookId: string): Promise<WebhookTriggerResult | null>;
107
- getDeliveryHistory(webhookId: string, limit?: number): Promise<WebhookDelivery[]>;
108
- retryDelivery(deliveryId: string): Promise<WebhookTriggerResult | null>;
109
- }
110
- declare function createWebhookService(db: BaseAdapter): WebhookService;
111
-
112
- 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, WEBHOOK_COLLECTION as c, WEBHOOK_DELIVERY_COLLECTION as d, WEBHOOK_EVENTS as e, type WebhookEvent as f, WebhookService as g, type WebhookTriggerResult as h, createWebhookService as i };
@@ -1,9 +0,0 @@
1
- import { APIRoute } from 'astro';
2
-
3
- /**
4
- * Global API Handler for Astro
5
- * This file is injected into the host project at /api/kyro/[...path]
6
- */
7
- declare const ALL: APIRoute;
8
-
9
- export { ALL };
@@ -1,9 +0,0 @@
1
- import { APIRoute } from 'astro';
2
-
3
- /**
4
- * Global API Handler for Astro
5
- * This file is injected into the host project at /api/kyro/[...path]
6
- */
7
- declare const ALL: APIRoute;
8
-
9
- export { ALL };
@@ -1,73 +0,0 @@
1
- import { B as BaseAdapter, C as CollectionConfig, G as GlobalConfig, 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, i as DraftFindArgs, j as DraftSnapshot, k as DraftUpsertArgs, l as DraftDeleteArgs } from './types-J3R9nVsZ.cjs';
2
- import { F as Field, j as RelationshipField, U as UploadField } from './types-VtjUxIMp.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
- abstract connect(): Promise<void>;
9
- abstract disconnect(): Promise<void>;
10
- init(collections: CollectionConfig[], globals?: GlobalConfig[]): Promise<void>;
11
- abstract find<T>(args: FindArgs): Promise<FindResult<T>>;
12
- abstract findByID<T>(args: FindByIDArgs): Promise<T | null>;
13
- abstract create<T>(args: CreateArgs): Promise<T>;
14
- abstract update<T>(args: UpdateArgs): Promise<T>;
15
- abstract delete<T>(args: DeleteArgs): Promise<T>;
16
- abstract count(args: {
17
- collection: string;
18
- where?: Record<string, any>;
19
- tenantID?: string;
20
- }): Promise<number>;
21
- abstract findOne(args: {
22
- collection: string;
23
- where: Record<string, any>;
24
- tenantID?: string;
25
- draft?: boolean;
26
- }): Promise<any>;
27
- abstract findVersions(args: FindVersionsArgs): Promise<FindResult<VersionRecord>>;
28
- abstract findVersionByID(args: {
29
- collection: string;
30
- versionId: string;
31
- tenantID?: string;
32
- }): Promise<VersionRecord | null>;
33
- abstract createVersion<T = Record<string, any>>(args: CreateVersionArgs<T>): Promise<VersionRecord<T>>;
34
- abstract deleteVersions(args: {
35
- collection: string;
36
- documentId: string;
37
- keepLatest?: number;
38
- tenantID?: string;
39
- }): Promise<void>;
40
- abstract findDraft<T>(args: DraftFindArgs): Promise<DraftSnapshot<T> | null>;
41
- abstract upsertDraft<T>(args: DraftUpsertArgs<T>): Promise<DraftSnapshot<T>>;
42
- abstract deleteDraft(args: DraftDeleteArgs): Promise<void>;
43
- migrate?(): Promise<void>;
44
- rollback?(): Promise<void>;
45
- transaction?<T>(fn: (tx: any) => Promise<T>): Promise<T>;
46
- protected getCollection(slug: string): CollectionConfig;
47
- protected applyTenantFilter(where?: Record<string, any>, tenantID?: string): Record<string, any>;
48
- protected getTableName(slug: string): string;
49
- protected prepareData(data: Record<string, any>, collection: CollectionConfig): Record<string, any>;
50
- protected processRelationships(data: Record<string, any>, fields: Field[], depth: number): Record<string, any>;
51
- protected parseSort(sort?: string): {
52
- field: string;
53
- direction: 'asc' | 'desc';
54
- };
55
- protected calculatePagination(page: number, limit: number, totalDocs: number): {
56
- totalDocs: number;
57
- limit: number;
58
- totalPages: number;
59
- page: number;
60
- pagingCounter: number;
61
- hasPrevPage: boolean;
62
- hasNextPage: boolean;
63
- prevPage: number | null;
64
- nextPage: number | null;
65
- };
66
- protected selectFields(data: Record<string, any>, select?: string[]): Record<string, any>;
67
- protected isRelationshipField(field: Field): field is RelationshipField;
68
- protected isUploadField(field: Field): field is UploadField;
69
- protected getRelationshipFields(fields: Field[]): RelationshipField[];
70
- protected getUploadFields(fields: Field[]): UploadField[];
71
- }
72
-
73
- export { AbstractBaseAdapter as A };
@@ -1,73 +0,0 @@
1
- import { B as BaseAdapter, C as CollectionConfig, G as GlobalConfig, 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, i as DraftFindArgs, j as DraftSnapshot, k as DraftUpsertArgs, l as DraftDeleteArgs } from './types-Bs1up4yP.js';
2
- import { F as Field, j as RelationshipField, U as UploadField } from './types-VtjUxIMp.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
- abstract connect(): Promise<void>;
9
- abstract disconnect(): Promise<void>;
10
- init(collections: CollectionConfig[], globals?: GlobalConfig[]): Promise<void>;
11
- abstract find<T>(args: FindArgs): Promise<FindResult<T>>;
12
- abstract findByID<T>(args: FindByIDArgs): Promise<T | null>;
13
- abstract create<T>(args: CreateArgs): Promise<T>;
14
- abstract update<T>(args: UpdateArgs): Promise<T>;
15
- abstract delete<T>(args: DeleteArgs): Promise<T>;
16
- abstract count(args: {
17
- collection: string;
18
- where?: Record<string, any>;
19
- tenantID?: string;
20
- }): Promise<number>;
21
- abstract findOne(args: {
22
- collection: string;
23
- where: Record<string, any>;
24
- tenantID?: string;
25
- draft?: boolean;
26
- }): Promise<any>;
27
- abstract findVersions(args: FindVersionsArgs): Promise<FindResult<VersionRecord>>;
28
- abstract findVersionByID(args: {
29
- collection: string;
30
- versionId: string;
31
- tenantID?: string;
32
- }): Promise<VersionRecord | null>;
33
- abstract createVersion<T = Record<string, any>>(args: CreateVersionArgs<T>): Promise<VersionRecord<T>>;
34
- abstract deleteVersions(args: {
35
- collection: string;
36
- documentId: string;
37
- keepLatest?: number;
38
- tenantID?: string;
39
- }): Promise<void>;
40
- abstract findDraft<T>(args: DraftFindArgs): Promise<DraftSnapshot<T> | null>;
41
- abstract upsertDraft<T>(args: DraftUpsertArgs<T>): Promise<DraftSnapshot<T>>;
42
- abstract deleteDraft(args: DraftDeleteArgs): Promise<void>;
43
- migrate?(): Promise<void>;
44
- rollback?(): Promise<void>;
45
- transaction?<T>(fn: (tx: any) => Promise<T>): Promise<T>;
46
- protected getCollection(slug: string): CollectionConfig;
47
- protected applyTenantFilter(where?: Record<string, any>, tenantID?: string): Record<string, any>;
48
- protected getTableName(slug: string): string;
49
- protected prepareData(data: Record<string, any>, collection: CollectionConfig): Record<string, any>;
50
- protected processRelationships(data: Record<string, any>, fields: Field[], depth: number): Record<string, any>;
51
- protected parseSort(sort?: string): {
52
- field: string;
53
- direction: 'asc' | 'desc';
54
- };
55
- protected calculatePagination(page: number, limit: number, totalDocs: number): {
56
- totalDocs: number;
57
- limit: number;
58
- totalPages: number;
59
- page: number;
60
- pagingCounter: number;
61
- hasPrevPage: boolean;
62
- hasNextPage: boolean;
63
- prevPage: number | null;
64
- nextPage: number | null;
65
- };
66
- protected selectFields(data: Record<string, any>, select?: string[]): Record<string, any>;
67
- protected isRelationshipField(field: Field): field is RelationshipField;
68
- protected isUploadField(field: Field): field is UploadField;
69
- protected getRelationshipFields(fields: Field[]): RelationshipField[];
70
- protected getUploadFields(fields: Field[]): UploadField[];
71
- }
72
-
73
- export { AbstractBaseAdapter as A };