@kyro-cms/core 0.12.11 → 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 (47) hide show
  1. package/package.json +3 -3
  2. package/dist/WebhookService-ByrpAI4d.d.ts +0 -143
  3. package/dist/WebhookService-i-Kl3dvf.d.cts +0 -143
  4. package/dist/api-handler-graphql.d.cts +0 -6
  5. package/dist/api-handler-graphql.d.ts +0 -6
  6. package/dist/api-handler-trpc.d.cts +0 -5
  7. package/dist/api-handler-trpc.d.ts +0 -5
  8. package/dist/api-handler.d.cts +0 -7
  9. package/dist/api-handler.d.ts +0 -7
  10. package/dist/base-iyJTfH-3.d.cts +0 -74
  11. package/dist/base-oUSURe4_.d.ts +0 -74
  12. package/dist/cli/index.d.cts +0 -1
  13. package/dist/cli/index.d.ts +0 -1
  14. package/dist/client.d.cts +0 -12
  15. package/dist/client.d.ts +0 -12
  16. package/dist/drizzle/index.d.cts +0 -169
  17. package/dist/drizzle/index.d.ts +0 -169
  18. package/dist/fields/index.d.cts +0 -7
  19. package/dist/fields/index.d.ts +0 -7
  20. package/dist/graphql/index.d.cts +0 -57
  21. package/dist/graphql/index.d.ts +0 -57
  22. package/dist/index-Bz9JqRGI.d.cts +0 -86
  23. package/dist/index-Bz9JqRGI.d.ts +0 -86
  24. package/dist/index-DNy8jbA2.d.cts +0 -282
  25. package/dist/index-DVDMEql7.d.ts +0 -282
  26. package/dist/index.d.cts +0 -1246
  27. package/dist/index.d.ts +0 -1246
  28. package/dist/integration.d.cts +0 -14
  29. package/dist/integration.d.ts +0 -14
  30. package/dist/mongodb/index.d.cts +0 -134
  31. package/dist/mongodb/index.d.ts +0 -134
  32. package/dist/rest/index.d.cts +0 -56
  33. package/dist/rest/index.d.ts +0 -56
  34. package/dist/richtext-DrhORshE.d.cts +0 -5
  35. package/dist/richtext-DrhORshE.d.ts +0 -5
  36. package/dist/templates/index.d.cts +0 -107
  37. package/dist/templates/index.d.ts +0 -107
  38. package/dist/trpc/index.d.cts +0 -142
  39. package/dist/trpc/index.d.ts +0 -142
  40. package/dist/types-BcZiluXL.d.cts +0 -569
  41. package/dist/types-CpjuXbe7.d.cts +0 -150
  42. package/dist/types-CpjuXbe7.d.ts +0 -150
  43. package/dist/types-Dc8VAPhF.d.ts +0 -569
  44. package/dist/types-euTszc-1.d.cts +0 -294
  45. package/dist/types-euTszc-1.d.ts +0 -294
  46. package/dist/ws/index.d.cts +0 -88
  47. package/dist/ws/index.d.ts +0 -88
@@ -1,88 +0,0 @@
1
- import { WebSocket, WebSocketServer } from 'ws';
2
-
3
- type EventHandler = (data: any) => void | Promise<void>;
4
- declare class PubSub {
5
- private channels;
6
- private maxListeners;
7
- constructor(maxListeners?: number);
8
- subscribe(channel: string, handler: EventHandler): () => void;
9
- publish(channel: string, data: any): void;
10
- hasSubscribers(channel: string): boolean;
11
- getSubscriberCount(channel: string): number;
12
- getChannels(): string[];
13
- clear(): void;
14
- }
15
- interface KyroEvent {
16
- type: 'create' | 'update' | 'delete';
17
- collection: string;
18
- doc?: any;
19
- originalDoc?: any;
20
- id?: string;
21
- tenantId?: string;
22
- timestamp: string;
23
- user?: any;
24
- }
25
- declare class KyroPubSub extends PubSub {
26
- private registry;
27
- constructor(registry: any, maxListeners?: number);
28
- publishCollectionEvent(collection: string, event: KyroEvent): void;
29
- subscribeToCollection(collection: string, handler: EventHandler): () => void;
30
- subscribeToCollectionEvent(collection: string, eventType: 'create' | 'update' | 'delete', handler: EventHandler): () => void;
31
- subscribeToTenant(tenantId: string, handler: EventHandler): () => void;
32
- subscribeToTenantCollection(tenantId: string, collection: string, handler: EventHandler): () => void;
33
- subscribeToAllCollections(handler: EventHandler): () => void;
34
- createAfterChangeHook(collection: string): (args: any) => Promise<void>;
35
- createAfterDeleteHook(collection: string): (args: any) => Promise<void>;
36
- autoRegisterHooks(): void;
37
- }
38
-
39
- interface WSServerOptions {
40
- port?: number;
41
- pubsub: KyroPubSub;
42
- maxConnections?: number;
43
- pingInterval?: number;
44
- requireAuth?: boolean;
45
- verifyToken?: (token: string) => Promise<any>;
46
- }
47
- interface WSSubscription {
48
- channel: string;
49
- unsubscribe: () => void;
50
- }
51
- interface WSClient {
52
- id: string;
53
- ws: WebSocket;
54
- subscriptions: Map<string, WSSubscription>;
55
- authenticated: boolean;
56
- user?: any;
57
- tenantId?: string;
58
- connectedAt: Date;
59
- lastActivity: Date;
60
- }
61
- declare class KyroWSServer {
62
- private wss;
63
- private clients;
64
- private pubsub;
65
- private options;
66
- private pingTimer?;
67
- constructor(options: WSServerOptions);
68
- private setupServer;
69
- private handleMessage;
70
- private handleAuthenticate;
71
- private handleSubscribe;
72
- private handleUnsubscribe;
73
- private handleUnsubscribeAll;
74
- private handleList;
75
- private handleDisconnect;
76
- private sendToClient;
77
- private generateClientId;
78
- private startPingInterval;
79
- broadcast(channel: string, data: any): void;
80
- getConnectedClients(): WSClient[];
81
- getClientCount(): number;
82
- getSubscriptionCount(): number;
83
- close(): Promise<void>;
84
- getServer(): WebSocketServer;
85
- }
86
- declare function createWSServer(options: WSServerOptions): KyroWSServer;
87
-
88
- export { type EventHandler, type KyroEvent, KyroPubSub, KyroWSServer, PubSub, type WSClient, type WSServerOptions, createWSServer };