@kyro-cms/core 0.12.10 → 0.12.15

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 (90) hide show
  1. package/dist/api-handler-graphql.cjs +1 -1
  2. package/dist/api-handler-graphql.js +1 -1
  3. package/dist/api-handler-trpc.cjs +1 -1
  4. package/dist/api-handler-trpc.js +1 -1
  5. package/dist/api-handler.cjs +1 -1
  6. package/dist/api-handler.js +1 -1
  7. package/dist/{bootstrap-4W4342G2.js → bootstrap-A3OBR3YI.js} +1 -1
  8. package/dist/bootstrap-YLGVKTQS.cjs +1 -0
  9. package/dist/{chunk-EYUT6MOM.cjs → chunk-2NJR2B4W.cjs} +2 -2
  10. package/dist/chunk-3RR6IV5I.js +133 -0
  11. package/dist/chunk-3ZFRP5M2.cjs +133 -0
  12. package/dist/{chunk-7WOX27LK.js → chunk-6NGUY76Y.js} +22 -22
  13. package/dist/chunk-DTSYK7KK.js +21 -0
  14. package/dist/{chunk-5B7GPMJI.js → chunk-FGSIHWQJ.js} +1 -1
  15. package/dist/{chunk-AJAZ7D3W.cjs → chunk-GCQTSPX6.cjs} +22 -22
  16. package/dist/chunk-GO34AOBZ.cjs +1 -0
  17. package/dist/chunk-IETGL7WJ.js +1 -0
  18. package/dist/chunk-IQYP3DDJ.cjs +21 -0
  19. package/dist/chunk-M5JUPA7G.cjs +86 -0
  20. package/dist/chunk-NI7S5JMH.js +86 -0
  21. package/dist/{chunk-MSTTFMCM.js → chunk-O62KJ2J7.js} +1 -1
  22. package/dist/{chunk-AMOXD7EJ.cjs → chunk-QMQXKCCQ.cjs} +1 -1
  23. package/dist/{chunk-WHK4LW6V.cjs → chunk-RY3BG3AN.cjs} +1 -1
  24. package/dist/{chunk-NTZACLOF.js → chunk-ZZIGN5PZ.js} +1 -1
  25. package/dist/cli/index.cjs +1 -1
  26. package/dist/cli/index.js +1 -1
  27. package/dist/drizzle/index.cjs +1 -1
  28. package/dist/drizzle/index.js +1 -1
  29. package/dist/index.cjs +2 -2
  30. package/dist/index.js +1 -1
  31. package/dist/rest/index.cjs +1 -1
  32. package/dist/rest/index.js +1 -1
  33. package/dist/templates/index.cjs +1 -1
  34. package/dist/templates/index.js +1 -1
  35. package/package.json +3 -3
  36. package/dist/WebhookService-ByrpAI4d.d.ts +0 -143
  37. package/dist/WebhookService-i-Kl3dvf.d.cts +0 -143
  38. package/dist/api-handler-graphql.d.cts +0 -6
  39. package/dist/api-handler-graphql.d.ts +0 -6
  40. package/dist/api-handler-trpc.d.cts +0 -5
  41. package/dist/api-handler-trpc.d.ts +0 -5
  42. package/dist/api-handler.d.cts +0 -7
  43. package/dist/api-handler.d.ts +0 -7
  44. package/dist/base-iyJTfH-3.d.cts +0 -74
  45. package/dist/base-oUSURe4_.d.ts +0 -74
  46. package/dist/bootstrap-ZGTRVWYE.cjs +0 -1
  47. package/dist/chunk-4JW6IVU5.js +0 -86
  48. package/dist/chunk-5YW2WHXR.cjs +0 -133
  49. package/dist/chunk-AE6GXUT7.js +0 -1
  50. package/dist/chunk-GFU7AOI3.cjs +0 -1
  51. package/dist/chunk-J5SP3Y2H.js +0 -133
  52. package/dist/chunk-NUUPBDZC.js +0 -21
  53. package/dist/chunk-OTFVOKH3.cjs +0 -21
  54. package/dist/chunk-PFHIBSOU.cjs +0 -86
  55. package/dist/cli/index.d.cts +0 -1
  56. package/dist/cli/index.d.ts +0 -1
  57. package/dist/client.d.cts +0 -12
  58. package/dist/client.d.ts +0 -12
  59. package/dist/drizzle/index.d.cts +0 -168
  60. package/dist/drizzle/index.d.ts +0 -168
  61. package/dist/fields/index.d.cts +0 -7
  62. package/dist/fields/index.d.ts +0 -7
  63. package/dist/graphql/index.d.cts +0 -57
  64. package/dist/graphql/index.d.ts +0 -57
  65. package/dist/index-Bz9JqRGI.d.cts +0 -86
  66. package/dist/index-Bz9JqRGI.d.ts +0 -86
  67. package/dist/index-DNy8jbA2.d.cts +0 -282
  68. package/dist/index-DVDMEql7.d.ts +0 -282
  69. package/dist/index.d.cts +0 -1246
  70. package/dist/index.d.ts +0 -1246
  71. package/dist/integration.d.cts +0 -14
  72. package/dist/integration.d.ts +0 -14
  73. package/dist/mongodb/index.d.cts +0 -134
  74. package/dist/mongodb/index.d.ts +0 -134
  75. package/dist/rest/index.d.cts +0 -56
  76. package/dist/rest/index.d.ts +0 -56
  77. package/dist/richtext-DrhORshE.d.cts +0 -5
  78. package/dist/richtext-DrhORshE.d.ts +0 -5
  79. package/dist/templates/index.d.cts +0 -107
  80. package/dist/templates/index.d.ts +0 -107
  81. package/dist/trpc/index.d.cts +0 -142
  82. package/dist/trpc/index.d.ts +0 -142
  83. package/dist/types-BcZiluXL.d.cts +0 -569
  84. package/dist/types-CpjuXbe7.d.cts +0 -150
  85. package/dist/types-CpjuXbe7.d.ts +0 -150
  86. package/dist/types-Dc8VAPhF.d.ts +0 -569
  87. package/dist/types-euTszc-1.d.cts +0 -294
  88. package/dist/types-euTszc-1.d.ts +0 -294
  89. package/dist/ws/index.d.cts +0 -88
  90. package/dist/ws/index.d.ts +0 -88
@@ -1,143 +0,0 @@
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,6 +0,0 @@
1
- import { APIRoute } from 'astro';
2
-
3
- declare const POST: APIRoute;
4
- declare const GET: APIRoute;
5
-
6
- export { GET, POST };
@@ -1,6 +0,0 @@
1
- import { APIRoute } from 'astro';
2
-
3
- declare const POST: APIRoute;
4
- declare const GET: APIRoute;
5
-
6
- export { GET, POST };
@@ -1,5 +0,0 @@
1
- import { APIRoute } from 'astro';
2
-
3
- declare const ALL: APIRoute;
4
-
5
- export { ALL };
@@ -1,5 +0,0 @@
1
- import { APIRoute } from 'astro';
2
-
3
- declare const ALL: APIRoute;
4
-
5
- export { ALL };
@@ -1,7 +0,0 @@
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,7 +0,0 @@
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,74 +0,0 @@
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 };
@@ -1,74 +0,0 @@
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 };
@@ -1 +0,0 @@
1
- 'use strict';var chunkAMOXD7EJ_cjs=require('./chunk-AMOXD7EJ.cjs');require('./chunk-AJAZ7D3W.cjs'),require('./chunk-WIZ6C5QZ.cjs'),require('./chunk-HOP4D5XZ.cjs'),require('./chunk-AHSFSERC.cjs');Object.defineProperty(exports,"autoBootstrap",{enumerable:true,get:function(){return chunkAMOXD7EJ_cjs.d}});Object.defineProperty(exports,"bootstrapAdmin",{enumerable:true,get:function(){return chunkAMOXD7EJ_cjs.a}});Object.defineProperty(exports,"bootstrapWithRetry",{enumerable:true,get:function(){return chunkAMOXD7EJ_cjs.e}});Object.defineProperty(exports,"checkBootstrapRequired",{enumerable:true,get:function(){return chunkAMOXD7EJ_cjs.b}});Object.defineProperty(exports,"getBootstrapFromEnv",{enumerable:true,get:function(){return chunkAMOXD7EJ_cjs.c}});