@l-etabli/events 0.1.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 (115) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +16 -0
  3. package/dist/adapters/in-memory/InMemoryEventBus.cjs +128 -0
  4. package/dist/adapters/in-memory/InMemoryEventBus.cjs.map +1 -0
  5. package/dist/adapters/in-memory/InMemoryEventBus.d.cts +16 -0
  6. package/dist/adapters/in-memory/InMemoryEventBus.d.ts +16 -0
  7. package/dist/adapters/in-memory/InMemoryEventBus.mjs +104 -0
  8. package/dist/adapters/in-memory/InMemoryEventBus.mjs.map +1 -0
  9. package/dist/adapters/in-memory/InMemoryEventQueries.cjs +44 -0
  10. package/dist/adapters/in-memory/InMemoryEventQueries.cjs.map +1 -0
  11. package/dist/adapters/in-memory/InMemoryEventQueries.d.cts +10 -0
  12. package/dist/adapters/in-memory/InMemoryEventQueries.d.ts +10 -0
  13. package/dist/adapters/in-memory/InMemoryEventQueries.mjs +20 -0
  14. package/dist/adapters/in-memory/InMemoryEventQueries.mjs.map +1 -0
  15. package/dist/adapters/in-memory/InMemoryEventRepository.cjs +68 -0
  16. package/dist/adapters/in-memory/InMemoryEventRepository.cjs.map +1 -0
  17. package/dist/adapters/in-memory/InMemoryEventRepository.d.cts +16 -0
  18. package/dist/adapters/in-memory/InMemoryEventRepository.d.ts +16 -0
  19. package/dist/adapters/in-memory/InMemoryEventRepository.mjs +43 -0
  20. package/dist/adapters/in-memory/InMemoryEventRepository.mjs.map +1 -0
  21. package/dist/adapters/in-memory/index.cjs +43 -0
  22. package/dist/adapters/in-memory/index.cjs.map +1 -0
  23. package/dist/adapters/in-memory/index.d.cts +18 -0
  24. package/dist/adapters/in-memory/index.d.ts +18 -0
  25. package/dist/adapters/in-memory/index.mjs +18 -0
  26. package/dist/adapters/in-memory/index.mjs.map +1 -0
  27. package/dist/adapters/kysely/KyselyEventQueries.cjs +47 -0
  28. package/dist/adapters/kysely/KyselyEventQueries.cjs.map +1 -0
  29. package/dist/adapters/kysely/KyselyEventQueries.d.cts +8 -0
  30. package/dist/adapters/kysely/KyselyEventQueries.d.ts +8 -0
  31. package/dist/adapters/kysely/KyselyEventQueries.mjs +23 -0
  32. package/dist/adapters/kysely/KyselyEventQueries.mjs.map +1 -0
  33. package/dist/adapters/kysely/KyselyEventRepository.cjs +53 -0
  34. package/dist/adapters/kysely/KyselyEventRepository.cjs.map +1 -0
  35. package/dist/adapters/kysely/KyselyEventRepository.d.cts +8 -0
  36. package/dist/adapters/kysely/KyselyEventRepository.d.ts +8 -0
  37. package/dist/adapters/kysely/KyselyEventRepository.mjs +29 -0
  38. package/dist/adapters/kysely/KyselyEventRepository.mjs.map +1 -0
  39. package/dist/adapters/kysely/index.cjs +32 -0
  40. package/dist/adapters/kysely/index.cjs.map +1 -0
  41. package/dist/adapters/kysely/index.d.cts +7 -0
  42. package/dist/adapters/kysely/index.d.ts +7 -0
  43. package/dist/adapters/kysely/index.mjs +7 -0
  44. package/dist/adapters/kysely/index.mjs.map +1 -0
  45. package/dist/adapters/kysely/migration.cjs +38 -0
  46. package/dist/adapters/kysely/migration.cjs.map +1 -0
  47. package/dist/adapters/kysely/migration.d.cts +6 -0
  48. package/dist/adapters/kysely/migration.d.ts +6 -0
  49. package/dist/adapters/kysely/migration.mjs +13 -0
  50. package/dist/adapters/kysely/migration.mjs.map +1 -0
  51. package/dist/adapters/kysely/types.cjs +17 -0
  52. package/dist/adapters/kysely/types.cjs.map +1 -0
  53. package/dist/adapters/kysely/types.d.cts +34 -0
  54. package/dist/adapters/kysely/types.d.ts +34 -0
  55. package/dist/adapters/kysely/types.mjs +1 -0
  56. package/dist/adapters/kysely/types.mjs.map +1 -0
  57. package/dist/createEventCrawler.cjs +102 -0
  58. package/dist/createEventCrawler.cjs.map +1 -0
  59. package/dist/createEventCrawler.d.cts +56 -0
  60. package/dist/createEventCrawler.d.ts +56 -0
  61. package/dist/createEventCrawler.mjs +78 -0
  62. package/dist/createEventCrawler.mjs.map +1 -0
  63. package/dist/createNewEvent.cjs +43 -0
  64. package/dist/createNewEvent.cjs.map +1 -0
  65. package/dist/createNewEvent.d.cts +61 -0
  66. package/dist/createNewEvent.d.ts +61 -0
  67. package/dist/createNewEvent.mjs +19 -0
  68. package/dist/createNewEvent.mjs.map +1 -0
  69. package/dist/index.cjs +27 -0
  70. package/dist/index.cjs.map +1 -0
  71. package/dist/index.d.cts +10 -0
  72. package/dist/index.d.ts +10 -0
  73. package/dist/index.mjs +4 -0
  74. package/dist/index.mjs.map +1 -0
  75. package/dist/ports/EventBus.cjs +17 -0
  76. package/dist/ports/EventBus.cjs.map +1 -0
  77. package/dist/ports/EventBus.d.cts +35 -0
  78. package/dist/ports/EventBus.d.ts +35 -0
  79. package/dist/ports/EventBus.mjs +1 -0
  80. package/dist/ports/EventBus.mjs.map +1 -0
  81. package/dist/ports/EventQueries.cjs +17 -0
  82. package/dist/ports/EventQueries.cjs.map +1 -0
  83. package/dist/ports/EventQueries.d.cts +24 -0
  84. package/dist/ports/EventQueries.d.ts +24 -0
  85. package/dist/ports/EventQueries.mjs +1 -0
  86. package/dist/ports/EventQueries.mjs.map +1 -0
  87. package/dist/ports/EventRepository.cjs +17 -0
  88. package/dist/ports/EventRepository.cjs.map +1 -0
  89. package/dist/ports/EventRepository.d.cts +43 -0
  90. package/dist/ports/EventRepository.d.ts +43 -0
  91. package/dist/ports/EventRepository.mjs +1 -0
  92. package/dist/ports/EventRepository.mjs.map +1 -0
  93. package/dist/types.cjs +17 -0
  94. package/dist/types.cjs.map +1 -0
  95. package/dist/types.d.cts +84 -0
  96. package/dist/types.d.ts +84 -0
  97. package/dist/types.mjs +1 -0
  98. package/dist/types.mjs.map +1 -0
  99. package/package.json +68 -0
  100. package/src/adapters/in-memory/InMemoryEventBus.ts +165 -0
  101. package/src/adapters/in-memory/InMemoryEventQueries.ts +30 -0
  102. package/src/adapters/in-memory/InMemoryEventRepository.ts +61 -0
  103. package/src/adapters/in-memory/index.ts +19 -0
  104. package/src/adapters/kysely/KyselyEventQueries.ts +35 -0
  105. package/src/adapters/kysely/KyselyEventRepository.ts +44 -0
  106. package/src/adapters/kysely/index.ts +3 -0
  107. package/src/adapters/kysely/migration.ts +39 -0
  108. package/src/adapters/kysely/types.ts +37 -0
  109. package/src/createEventCrawler.ts +139 -0
  110. package/src/createNewEvent.ts +87 -0
  111. package/src/index.ts +7 -0
  112. package/src/ports/EventBus.ts +37 -0
  113. package/src/ports/EventQueries.ts +25 -0
  114. package/src/ports/EventRepository.ts +49 -0
  115. package/src/types.ts +100 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/adapters/in-memory/index.ts"],"sourcesContent":["import type { DefaultContext, GenericEvent } from \"../../types.ts\";\nimport { createInMemoryEventQueries } from \"./InMemoryEventQueries.ts\";\nimport {\n createInMemoryEventRepository,\n createInMemoryWithUow,\n} from \"./InMemoryEventRepository.ts\";\n\nexport * from \"./InMemoryEventBus.ts\";\nexport * from \"./InMemoryEventQueries.ts\";\nexport * from \"./InMemoryEventRepository.ts\";\n\nexport const createInMemoryEventRepositoryAndQueries = <\n Event extends GenericEvent<string, unknown, DefaultContext>,\n>() => {\n const { eventRepository, helpers } = createInMemoryEventRepository<Event>();\n const { eventQueries } = createInMemoryEventQueries<Event>(helpers);\n const { withUow } = createInMemoryWithUow<Event>(eventRepository);\n return { eventRepository, eventQueries, helpers, withUow };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kCAA2C;AAC3C,qCAGO;AAEP,8BAAc,kCAPd;AAQA,8BAAc,sCARd;AASA,8BAAc,yCATd;AAWO,MAAM,0CAA0C,MAEhD;AACL,QAAM,EAAE,iBAAiB,QAAQ,QAAI,8DAAqC;AAC1E,QAAM,EAAE,aAAa,QAAI,wDAAkC,OAAO;AAClE,QAAM,EAAE,QAAQ,QAAI,sDAA6B,eAAe;AAChE,SAAO,EAAE,iBAAiB,cAAc,SAAS,QAAQ;AAC3D;","names":[]}
@@ -0,0 +1,18 @@
1
+ import { InMemoryEventRepositoryHelpers } from './InMemoryEventRepository.cjs';
2
+ export { createInMemoryEventRepository, createInMemoryWithUow } from './InMemoryEventRepository.cjs';
3
+ import { GenericEvent, DefaultContext } from '../../types.cjs';
4
+ import { EventQueries } from '../../ports/EventQueries.cjs';
5
+ import { EventRepository, WithEventsUow } from '../../ports/EventRepository.cjs';
6
+ export { createInMemoryEventBus } from './InMemoryEventBus.cjs';
7
+ export { createInMemoryEventQueries } from './InMemoryEventQueries.cjs';
8
+ import '../../createNewEvent.cjs';
9
+ import '../../ports/EventBus.cjs';
10
+
11
+ declare const createInMemoryEventRepositoryAndQueries: <Event extends GenericEvent<string, unknown, DefaultContext>>() => {
12
+ eventRepository: EventRepository<Event>;
13
+ eventQueries: EventQueries<Event>;
14
+ helpers: InMemoryEventRepositoryHelpers<Event>;
15
+ withUow: WithEventsUow<Event>;
16
+ };
17
+
18
+ export { InMemoryEventRepositoryHelpers, createInMemoryEventRepositoryAndQueries };
@@ -0,0 +1,18 @@
1
+ import { InMemoryEventRepositoryHelpers } from './InMemoryEventRepository.js';
2
+ export { createInMemoryEventRepository, createInMemoryWithUow } from './InMemoryEventRepository.js';
3
+ import { GenericEvent, DefaultContext } from '../../types.js';
4
+ import { EventQueries } from '../../ports/EventQueries.js';
5
+ import { EventRepository, WithEventsUow } from '../../ports/EventRepository.js';
6
+ export { createInMemoryEventBus } from './InMemoryEventBus.js';
7
+ export { createInMemoryEventQueries } from './InMemoryEventQueries.js';
8
+ import '../../createNewEvent.js';
9
+ import '../../ports/EventBus.js';
10
+
11
+ declare const createInMemoryEventRepositoryAndQueries: <Event extends GenericEvent<string, unknown, DefaultContext>>() => {
12
+ eventRepository: EventRepository<Event>;
13
+ eventQueries: EventQueries<Event>;
14
+ helpers: InMemoryEventRepositoryHelpers<Event>;
15
+ withUow: WithEventsUow<Event>;
16
+ };
17
+
18
+ export { InMemoryEventRepositoryHelpers, createInMemoryEventRepositoryAndQueries };
@@ -0,0 +1,18 @@
1
+ import { createInMemoryEventQueries } from "./InMemoryEventQueries.ts.mjs";
2
+ import {
3
+ createInMemoryEventRepository,
4
+ createInMemoryWithUow
5
+ } from "./InMemoryEventRepository.ts.mjs";
6
+ export * from "./InMemoryEventBus.ts.mjs";
7
+ export * from "./InMemoryEventQueries.ts.mjs";
8
+ export * from "./InMemoryEventRepository.ts.mjs";
9
+ const createInMemoryEventRepositoryAndQueries = () => {
10
+ const { eventRepository, helpers } = createInMemoryEventRepository();
11
+ const { eventQueries } = createInMemoryEventQueries(helpers);
12
+ const { withUow } = createInMemoryWithUow(eventRepository);
13
+ return { eventRepository, eventQueries, helpers, withUow };
14
+ };
15
+ export {
16
+ createInMemoryEventRepositoryAndQueries
17
+ };
18
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/adapters/in-memory/index.ts"],"sourcesContent":["import type { DefaultContext, GenericEvent } from '../../types.ts.mjs';\nimport { createInMemoryEventQueries } from './InMemoryEventQueries.ts.mjs';\nimport {\n createInMemoryEventRepository,\n createInMemoryWithUow,\n} from './InMemoryEventRepository.ts.mjs';\n\nexport * from './InMemoryEventBus.ts.mjs';\nexport * from './InMemoryEventQueries.ts.mjs';\nexport * from './InMemoryEventRepository.ts.mjs';\n\nexport const createInMemoryEventRepositoryAndQueries = <\n Event extends GenericEvent<string, unknown, DefaultContext>,\n>() => {\n const { eventRepository, helpers } = createInMemoryEventRepository<Event>();\n const { eventQueries } = createInMemoryEventQueries<Event>(helpers);\n const { withUow } = createInMemoryWithUow<Event>(eventRepository);\n return { eventRepository, eventQueries, helpers, withUow };\n};\n"],"mappings":"AACA,SAAS,kCAAkC;AAC3C;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAEP,cAAc;AACd,cAAc;AACd,cAAc;AAEP,MAAM,0CAA0C,MAEhD;AACL,QAAM,EAAE,iBAAiB,QAAQ,IAAI,8BAAqC;AAC1E,QAAM,EAAE,aAAa,IAAI,2BAAkC,OAAO;AAClE,QAAM,EAAE,QAAQ,IAAI,sBAA6B,eAAe;AAChE,SAAO,EAAE,iBAAiB,cAAc,SAAS,QAAQ;AAC3D;","names":[]}
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var KyselyEventQueries_exports = {};
20
+ __export(KyselyEventQueries_exports, {
21
+ createKyselyEventQueries: () => createKyselyEventQueries
22
+ });
23
+ module.exports = __toCommonJS(KyselyEventQueries_exports);
24
+ var import_kysely = require("kysely");
25
+ const createKyselyEventQueries = (db) => ({
26
+ getEvents: async ({ filters, limit }) => {
27
+ let query = db.selectFrom("events").selectAll().where("status", "in", filters.statuses).limit(limit);
28
+ if (filters.context) {
29
+ for (const [key, value] of Object.entries(filters.context)) {
30
+ query = query.where(import_kysely.sql`context->>${key} = ${value}`);
31
+ }
32
+ }
33
+ const rows = await query.execute();
34
+ return rows.map(
35
+ (row) => ({
36
+ ...row,
37
+ context: row.context ?? void 0,
38
+ priority: row.priority ?? void 0
39
+ })
40
+ );
41
+ }
42
+ });
43
+ // Annotate the CommonJS export names for ESM import in node:
44
+ 0 && (module.exports = {
45
+ createKyselyEventQueries
46
+ });
47
+ //# sourceMappingURL=KyselyEventQueries.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/adapters/kysely/KyselyEventQueries.ts"],"sourcesContent":["import type { Kysely, SqlBool } from \"kysely\";\nimport { sql } from \"kysely\";\nimport type { EventQueries } from \"../../ports/EventQueries.ts\";\nimport type { DefaultContext, GenericEvent } from \"../../types.ts\";\nimport type { EventsTable } from \"./types.ts\";\n\nexport const createKyselyEventQueries = <\n Event extends GenericEvent<string, unknown, DefaultContext>,\n>(\n db: Kysely<EventsTable>,\n): EventQueries<Event> => ({\n getEvents: async ({ filters, limit }) => {\n let query = db\n .selectFrom(\"events\")\n .selectAll()\n .where(\"status\", \"in\", filters.statuses)\n .limit(limit);\n\n if (filters.context) {\n for (const [key, value] of Object.entries(filters.context)) {\n query = query.where(sql<SqlBool>`context->>${key} = ${value}`);\n }\n }\n\n const rows = await query.execute();\n return rows.map(\n (row) =>\n ({\n ...row,\n context: row.context ?? undefined,\n priority: row.priority ?? undefined,\n }) as Event,\n );\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,oBAAoB;AAKb,MAAM,2BAA2B,CAGtC,QACyB;AAAA,EACzB,WAAW,OAAO,EAAE,SAAS,MAAM,MAAM;AACvC,QAAI,QAAQ,GACT,WAAW,QAAQ,EACnB,UAAU,EACV,MAAM,UAAU,MAAM,QAAQ,QAAQ,EACtC,MAAM,KAAK;AAEd,QAAI,QAAQ,SAAS;AACnB,iBAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,QAAQ,OAAO,GAAG;AAC1D,gBAAQ,MAAM,MAAM,8BAAyB,GAAG,MAAM,KAAK,EAAE;AAAA,MAC/D;AAAA,IACF;AAEA,UAAM,OAAO,MAAM,MAAM,QAAQ;AACjC,WAAO,KAAK;AAAA,MACV,CAAC,SACE;AAAA,QACC,GAAG;AAAA,QACH,SAAS,IAAI,WAAW;AAAA,QACxB,UAAU,IAAI,YAAY;AAAA,MAC5B;AAAA,IACJ;AAAA,EACF;AACF;","names":[]}
@@ -0,0 +1,8 @@
1
+ import { Kysely } from 'kysely';
2
+ import { EventQueries } from '../../ports/EventQueries.cjs';
3
+ import { GenericEvent, DefaultContext } from '../../types.cjs';
4
+ import { EventsTable } from './types.cjs';
5
+
6
+ declare const createKyselyEventQueries: <Event extends GenericEvent<string, unknown, DefaultContext>>(db: Kysely<EventsTable>) => EventQueries<Event>;
7
+
8
+ export { createKyselyEventQueries };
@@ -0,0 +1,8 @@
1
+ import { Kysely } from 'kysely';
2
+ import { EventQueries } from '../../ports/EventQueries.js';
3
+ import { GenericEvent, DefaultContext } from '../../types.js';
4
+ import { EventsTable } from './types.js';
5
+
6
+ declare const createKyselyEventQueries: <Event extends GenericEvent<string, unknown, DefaultContext>>(db: Kysely<EventsTable>) => EventQueries<Event>;
7
+
8
+ export { createKyselyEventQueries };
@@ -0,0 +1,23 @@
1
+ import { sql } from "kysely";
2
+ const createKyselyEventQueries = (db) => ({
3
+ getEvents: async ({ filters, limit }) => {
4
+ let query = db.selectFrom("events").selectAll().where("status", "in", filters.statuses).limit(limit);
5
+ if (filters.context) {
6
+ for (const [key, value] of Object.entries(filters.context)) {
7
+ query = query.where(sql`context->>${key} = ${value}`);
8
+ }
9
+ }
10
+ const rows = await query.execute();
11
+ return rows.map(
12
+ (row) => ({
13
+ ...row,
14
+ context: row.context ?? void 0,
15
+ priority: row.priority ?? void 0
16
+ })
17
+ );
18
+ }
19
+ });
20
+ export {
21
+ createKyselyEventQueries
22
+ };
23
+ //# sourceMappingURL=KyselyEventQueries.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/adapters/kysely/KyselyEventQueries.ts"],"sourcesContent":["import type { Kysely, SqlBool } from \"kysely\";\nimport { sql } from \"kysely\";\nimport type { EventQueries } from '../../ports/EventQueries.ts.mjs';\nimport type { DefaultContext, GenericEvent } from '../../types.ts.mjs';\nimport type { EventsTable } from './types.ts.mjs';\n\nexport const createKyselyEventQueries = <\n Event extends GenericEvent<string, unknown, DefaultContext>,\n>(\n db: Kysely<EventsTable>,\n): EventQueries<Event> => ({\n getEvents: async ({ filters, limit }) => {\n let query = db\n .selectFrom(\"events\")\n .selectAll()\n .where(\"status\", \"in\", filters.statuses)\n .limit(limit);\n\n if (filters.context) {\n for (const [key, value] of Object.entries(filters.context)) {\n query = query.where(sql<SqlBool>`context->>${key} = ${value}`);\n }\n }\n\n const rows = await query.execute();\n return rows.map(\n (row) =>\n ({\n ...row,\n context: row.context ?? undefined,\n priority: row.priority ?? undefined,\n }) as Event,\n );\n },\n});\n"],"mappings":"AACA,SAAS,WAAW;AAKb,MAAM,2BAA2B,CAGtC,QACyB;AAAA,EACzB,WAAW,OAAO,EAAE,SAAS,MAAM,MAAM;AACvC,QAAI,QAAQ,GACT,WAAW,QAAQ,EACnB,UAAU,EACV,MAAM,UAAU,MAAM,QAAQ,QAAQ,EACtC,MAAM,KAAK;AAEd,QAAI,QAAQ,SAAS;AACnB,iBAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,QAAQ,OAAO,GAAG;AAC1D,gBAAQ,MAAM,MAAM,gBAAyB,GAAG,MAAM,KAAK,EAAE;AAAA,MAC/D;AAAA,IACF;AAEA,UAAM,OAAO,MAAM,MAAM,QAAQ;AACjC,WAAO,KAAK;AAAA,MACV,CAAC,SACE;AAAA,QACC,GAAG;AAAA,QACH,SAAS,IAAI,WAAW;AAAA,QACxB,UAAU,IAAI,YAAY;AAAA,MAC5B;AAAA,IACJ;AAAA,EACF;AACF;","names":[]}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var KyselyEventRepository_exports = {};
20
+ __export(KyselyEventRepository_exports, {
21
+ createKyselyEventRepository: () => createKyselyEventRepository
22
+ });
23
+ module.exports = __toCommonJS(KyselyEventRepository_exports);
24
+ const createKyselyEventRepository = (db) => ({
25
+ save: async (event) => {
26
+ await db.insertInto("events").values(event).onConflict(
27
+ (oc) => oc.column("id").doUpdateSet({
28
+ topic: event.topic,
29
+ payload: event.payload,
30
+ context: event.context,
31
+ status: event.status,
32
+ triggeredByUserId: event.triggeredByUserId,
33
+ occurredAt: event.occurredAt,
34
+ publications: event.publications,
35
+ priority: event.priority
36
+ })
37
+ ).execute();
38
+ },
39
+ saveNewEventsBatch: async (events) => {
40
+ if (events.length === 0) return;
41
+ await db.insertInto("events").values(events).execute();
42
+ },
43
+ markEventsAsInProcess: async (events) => {
44
+ if (events.length === 0) return;
45
+ const ids = events.map((e) => e.id);
46
+ await db.updateTable("events").set({ status: "in-process" }).where("id", "in", ids).execute();
47
+ }
48
+ });
49
+ // Annotate the CommonJS export names for ESM import in node:
50
+ 0 && (module.exports = {
51
+ createKyselyEventRepository
52
+ });
53
+ //# sourceMappingURL=KyselyEventRepository.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/adapters/kysely/KyselyEventRepository.ts"],"sourcesContent":["import type { Kysely } from \"kysely\";\nimport type { EventRepository } from \"../../ports/EventRepository.ts\";\nimport type { DefaultContext, GenericEvent } from \"../../types.ts\";\nimport type { EventsTable } from \"./types.ts\";\n\nexport const createKyselyEventRepository = <\n Event extends GenericEvent<string, unknown, DefaultContext>,\n>(\n db: Kysely<EventsTable>,\n): EventRepository<Event> => ({\n save: async (event) => {\n await db\n .insertInto(\"events\")\n .values(event)\n .onConflict((oc) =>\n oc.column(\"id\").doUpdateSet({\n topic: event.topic,\n payload: event.payload,\n context: event.context,\n status: event.status,\n triggeredByUserId: event.triggeredByUserId,\n occurredAt: event.occurredAt,\n publications: event.publications,\n priority: event.priority,\n }),\n )\n .execute();\n },\n\n saveNewEventsBatch: async (events) => {\n if (events.length === 0) return;\n await db.insertInto(\"events\").values(events).execute();\n },\n\n markEventsAsInProcess: async (events) => {\n if (events.length === 0) return;\n const ids = events.map((e) => e.id);\n await db\n .updateTable(\"events\")\n .set({ status: \"in-process\" })\n .where(\"id\", \"in\", ids)\n .execute();\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKO,MAAM,8BAA8B,CAGzC,QAC4B;AAAA,EAC5B,MAAM,OAAO,UAAU;AACrB,UAAM,GACH,WAAW,QAAQ,EACnB,OAAO,KAAK,EACZ;AAAA,MAAW,CAAC,OACX,GAAG,OAAO,IAAI,EAAE,YAAY;AAAA,QAC1B,OAAO,MAAM;AAAA,QACb,SAAS,MAAM;AAAA,QACf,SAAS,MAAM;AAAA,QACf,QAAQ,MAAM;AAAA,QACd,mBAAmB,MAAM;AAAA,QACzB,YAAY,MAAM;AAAA,QAClB,cAAc,MAAM;AAAA,QACpB,UAAU,MAAM;AAAA,MAClB,CAAC;AAAA,IACH,EACC,QAAQ;AAAA,EACb;AAAA,EAEA,oBAAoB,OAAO,WAAW;AACpC,QAAI,OAAO,WAAW,EAAG;AACzB,UAAM,GAAG,WAAW,QAAQ,EAAE,OAAO,MAAM,EAAE,QAAQ;AAAA,EACvD;AAAA,EAEA,uBAAuB,OAAO,WAAW;AACvC,QAAI,OAAO,WAAW,EAAG;AACzB,UAAM,MAAM,OAAO,IAAI,CAAC,MAAM,EAAE,EAAE;AAClC,UAAM,GACH,YAAY,QAAQ,EACpB,IAAI,EAAE,QAAQ,aAAa,CAAC,EAC5B,MAAM,MAAM,MAAM,GAAG,EACrB,QAAQ;AAAA,EACb;AACF;","names":[]}
@@ -0,0 +1,8 @@
1
+ import { Kysely } from 'kysely';
2
+ import { EventRepository } from '../../ports/EventRepository.cjs';
3
+ import { GenericEvent, DefaultContext } from '../../types.cjs';
4
+ import { EventsTable } from './types.cjs';
5
+
6
+ declare const createKyselyEventRepository: <Event extends GenericEvent<string, unknown, DefaultContext>>(db: Kysely<EventsTable>) => EventRepository<Event>;
7
+
8
+ export { createKyselyEventRepository };
@@ -0,0 +1,8 @@
1
+ import { Kysely } from 'kysely';
2
+ import { EventRepository } from '../../ports/EventRepository.js';
3
+ import { GenericEvent, DefaultContext } from '../../types.js';
4
+ import { EventsTable } from './types.js';
5
+
6
+ declare const createKyselyEventRepository: <Event extends GenericEvent<string, unknown, DefaultContext>>(db: Kysely<EventsTable>) => EventRepository<Event>;
7
+
8
+ export { createKyselyEventRepository };
@@ -0,0 +1,29 @@
1
+ const createKyselyEventRepository = (db) => ({
2
+ save: async (event) => {
3
+ await db.insertInto("events").values(event).onConflict(
4
+ (oc) => oc.column("id").doUpdateSet({
5
+ topic: event.topic,
6
+ payload: event.payload,
7
+ context: event.context,
8
+ status: event.status,
9
+ triggeredByUserId: event.triggeredByUserId,
10
+ occurredAt: event.occurredAt,
11
+ publications: event.publications,
12
+ priority: event.priority
13
+ })
14
+ ).execute();
15
+ },
16
+ saveNewEventsBatch: async (events) => {
17
+ if (events.length === 0) return;
18
+ await db.insertInto("events").values(events).execute();
19
+ },
20
+ markEventsAsInProcess: async (events) => {
21
+ if (events.length === 0) return;
22
+ const ids = events.map((e) => e.id);
23
+ await db.updateTable("events").set({ status: "in-process" }).where("id", "in", ids).execute();
24
+ }
25
+ });
26
+ export {
27
+ createKyselyEventRepository
28
+ };
29
+ //# sourceMappingURL=KyselyEventRepository.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/adapters/kysely/KyselyEventRepository.ts"],"sourcesContent":["import type { Kysely } from \"kysely\";\nimport type { EventRepository } from '../../ports/EventRepository.ts.mjs';\nimport type { DefaultContext, GenericEvent } from '../../types.ts.mjs';\nimport type { EventsTable } from './types.ts.mjs';\n\nexport const createKyselyEventRepository = <\n Event extends GenericEvent<string, unknown, DefaultContext>,\n>(\n db: Kysely<EventsTable>,\n): EventRepository<Event> => ({\n save: async (event) => {\n await db\n .insertInto(\"events\")\n .values(event)\n .onConflict((oc) =>\n oc.column(\"id\").doUpdateSet({\n topic: event.topic,\n payload: event.payload,\n context: event.context,\n status: event.status,\n triggeredByUserId: event.triggeredByUserId,\n occurredAt: event.occurredAt,\n publications: event.publications,\n priority: event.priority,\n }),\n )\n .execute();\n },\n\n saveNewEventsBatch: async (events) => {\n if (events.length === 0) return;\n await db.insertInto(\"events\").values(events).execute();\n },\n\n markEventsAsInProcess: async (events) => {\n if (events.length === 0) return;\n const ids = events.map((e) => e.id);\n await db\n .updateTable(\"events\")\n .set({ status: \"in-process\" })\n .where(\"id\", \"in\", ids)\n .execute();\n },\n});\n"],"mappings":"AAKO,MAAM,8BAA8B,CAGzC,QAC4B;AAAA,EAC5B,MAAM,OAAO,UAAU;AACrB,UAAM,GACH,WAAW,QAAQ,EACnB,OAAO,KAAK,EACZ;AAAA,MAAW,CAAC,OACX,GAAG,OAAO,IAAI,EAAE,YAAY;AAAA,QAC1B,OAAO,MAAM;AAAA,QACb,SAAS,MAAM;AAAA,QACf,SAAS,MAAM;AAAA,QACf,QAAQ,MAAM;AAAA,QACd,mBAAmB,MAAM;AAAA,QACzB,YAAY,MAAM;AAAA,QAClB,cAAc,MAAM;AAAA,QACpB,UAAU,MAAM;AAAA,MAClB,CAAC;AAAA,IACH,EACC,QAAQ;AAAA,EACb;AAAA,EAEA,oBAAoB,OAAO,WAAW;AACpC,QAAI,OAAO,WAAW,EAAG;AACzB,UAAM,GAAG,WAAW,QAAQ,EAAE,OAAO,MAAM,EAAE,QAAQ;AAAA,EACvD;AAAA,EAEA,uBAAuB,OAAO,WAAW;AACvC,QAAI,OAAO,WAAW,EAAG;AACzB,UAAM,MAAM,OAAO,IAAI,CAAC,MAAM,EAAE,EAAE;AAClC,UAAM,GACH,YAAY,QAAQ,EACpB,IAAI,EAAE,QAAQ,aAAa,CAAC,EAC5B,MAAM,MAAM,MAAM,GAAG,EACrB,QAAQ;AAAA,EACb;AACF;","names":[]}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var kysely_exports = {};
20
+ __export(kysely_exports, {
21
+ createKyselyEventQueries: () => import_KyselyEventQueries.createKyselyEventQueries,
22
+ createKyselyEventRepository: () => import_KyselyEventRepository.createKyselyEventRepository
23
+ });
24
+ module.exports = __toCommonJS(kysely_exports);
25
+ var import_KyselyEventQueries = require("./KyselyEventQueries.ts");
26
+ var import_KyselyEventRepository = require("./KyselyEventRepository.ts");
27
+ // Annotate the CommonJS export names for ESM import in node:
28
+ 0 && (module.exports = {
29
+ createKyselyEventQueries,
30
+ createKyselyEventRepository
31
+ });
32
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/adapters/kysely/index.ts"],"sourcesContent":["export { createKyselyEventQueries } from \"./KyselyEventQueries.ts\";\nexport { createKyselyEventRepository } from \"./KyselyEventRepository.ts\";\nexport type { EventsTable, TypedEventsTable } from \"./types.ts\";\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gCAAyC;AACzC,mCAA4C;","names":[]}
@@ -0,0 +1,7 @@
1
+ export { createKyselyEventQueries } from './KyselyEventQueries.cjs';
2
+ export { createKyselyEventRepository } from './KyselyEventRepository.cjs';
3
+ export { EventsTable, TypedEventsTable } from './types.cjs';
4
+ import 'kysely';
5
+ import '../../ports/EventQueries.cjs';
6
+ import '../../types.cjs';
7
+ import '../../ports/EventRepository.cjs';
@@ -0,0 +1,7 @@
1
+ export { createKyselyEventQueries } from './KyselyEventQueries.js';
2
+ export { createKyselyEventRepository } from './KyselyEventRepository.js';
3
+ export { EventsTable, TypedEventsTable } from './types.js';
4
+ import 'kysely';
5
+ import '../../ports/EventQueries.js';
6
+ import '../../types.js';
7
+ import '../../ports/EventRepository.js';
@@ -0,0 +1,7 @@
1
+ import { createKyselyEventQueries } from "./KyselyEventQueries.ts.mjs";
2
+ import { createKyselyEventRepository } from "./KyselyEventRepository.ts.mjs";
3
+ export {
4
+ createKyselyEventQueries,
5
+ createKyselyEventRepository
6
+ };
7
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/adapters/kysely/index.ts"],"sourcesContent":["export { createKyselyEventQueries } from './KyselyEventQueries.ts.mjs';\nexport { createKyselyEventRepository } from './KyselyEventRepository.ts.mjs';\nexport type { EventsTable, TypedEventsTable } from './types.ts.mjs';\n"],"mappings":"AAAA,SAAS,gCAAgC;AACzC,SAAS,mCAAmC;","names":[]}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var migration_exports = {};
20
+ __export(migration_exports, {
21
+ down: () => down,
22
+ up: () => up
23
+ });
24
+ module.exports = __toCommonJS(migration_exports);
25
+ async function up(db) {
26
+ await db.schema.createTable("events").addColumn("id", "text", (col) => col.primaryKey()).addColumn("topic", "text", (col) => col.notNull()).addColumn("payload", "jsonb", (col) => col.notNull()).addColumn("context", "jsonb").addColumn("status", "text", (col) => col.notNull()).addColumn("triggeredByUserId", "text", (col) => col.notNull()).addColumn("occurredAt", "timestamptz", (col) => col.notNull()).addColumn("publications", "jsonb", (col) => col.notNull().defaultTo("[]")).addColumn("priority", "integer").execute();
27
+ await db.schema.createIndex("events_status_idx").on("events").column("status").execute();
28
+ await db.schema.createIndex("events_topic_idx").on("events").column("topic").execute();
29
+ }
30
+ async function down(db) {
31
+ await db.schema.dropTable("events").execute();
32
+ }
33
+ // Annotate the CommonJS export names for ESM import in node:
34
+ 0 && (module.exports = {
35
+ down,
36
+ up
37
+ });
38
+ //# sourceMappingURL=migration.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/adapters/kysely/migration.ts"],"sourcesContent":["import type { Kysely } from \"kysely\";\n\nexport async function up(db: Kysely<unknown>): Promise<void> {\n await db.schema\n .createTable(\"events\")\n .addColumn(\"id\", \"text\", (col) => col.primaryKey())\n .addColumn(\"topic\", \"text\", (col) => col.notNull())\n .addColumn(\"payload\", \"jsonb\", (col) => col.notNull())\n .addColumn(\"context\", \"jsonb\")\n .addColumn(\"status\", \"text\", (col) => col.notNull())\n .addColumn(\"triggeredByUserId\", \"text\", (col) => col.notNull())\n .addColumn(\"occurredAt\", \"timestamptz\", (col) => col.notNull())\n .addColumn(\"publications\", \"jsonb\", (col) => col.notNull().defaultTo(\"[]\"))\n .addColumn(\"priority\", \"integer\")\n .execute();\n\n await db.schema\n .createIndex(\"events_status_idx\")\n .on(\"events\")\n .column(\"status\")\n .execute();\n\n await db.schema\n .createIndex(\"events_topic_idx\")\n .on(\"events\")\n .column(\"topic\")\n .execute();\n\n // Add B-tree indexes for context keys you query frequently.\n // Kysely's .column() doesn't support expressions, use raw SQL:\n //\n // await sql`CREATE INDEX events_context_user_id_idx ON events ((context->>'userId'))`.execute(db);\n // await sql`CREATE INDEX events_context_tenant_id_idx ON events ((context->>'tenantId'))`.execute(db);\n // await sql`CREATE INDEX events_context_project_id_idx ON events ((context->>'projectId'))`.execute(db);\n}\n\nexport async function down(db: Kysely<unknown>): Promise<void> {\n await db.schema.dropTable(\"events\").execute();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,eAAsB,GAAG,IAAoC;AAC3D,QAAM,GAAG,OACN,YAAY,QAAQ,EACpB,UAAU,MAAM,QAAQ,CAAC,QAAQ,IAAI,WAAW,CAAC,EACjD,UAAU,SAAS,QAAQ,CAAC,QAAQ,IAAI,QAAQ,CAAC,EACjD,UAAU,WAAW,SAAS,CAAC,QAAQ,IAAI,QAAQ,CAAC,EACpD,UAAU,WAAW,OAAO,EAC5B,UAAU,UAAU,QAAQ,CAAC,QAAQ,IAAI,QAAQ,CAAC,EAClD,UAAU,qBAAqB,QAAQ,CAAC,QAAQ,IAAI,QAAQ,CAAC,EAC7D,UAAU,cAAc,eAAe,CAAC,QAAQ,IAAI,QAAQ,CAAC,EAC7D,UAAU,gBAAgB,SAAS,CAAC,QAAQ,IAAI,QAAQ,EAAE,UAAU,IAAI,CAAC,EACzE,UAAU,YAAY,SAAS,EAC/B,QAAQ;AAEX,QAAM,GAAG,OACN,YAAY,mBAAmB,EAC/B,GAAG,QAAQ,EACX,OAAO,QAAQ,EACf,QAAQ;AAEX,QAAM,GAAG,OACN,YAAY,kBAAkB,EAC9B,GAAG,QAAQ,EACX,OAAO,OAAO,EACd,QAAQ;AAQb;AAEA,eAAsB,KAAK,IAAoC;AAC7D,QAAM,GAAG,OAAO,UAAU,QAAQ,EAAE,QAAQ;AAC9C;","names":[]}
@@ -0,0 +1,6 @@
1
+ import { Kysely } from 'kysely';
2
+
3
+ declare function up(db: Kysely<unknown>): Promise<void>;
4
+ declare function down(db: Kysely<unknown>): Promise<void>;
5
+
6
+ export { down, up };
@@ -0,0 +1,6 @@
1
+ import { Kysely } from 'kysely';
2
+
3
+ declare function up(db: Kysely<unknown>): Promise<void>;
4
+ declare function down(db: Kysely<unknown>): Promise<void>;
5
+
6
+ export { down, up };
@@ -0,0 +1,13 @@
1
+ async function up(db) {
2
+ await db.schema.createTable("events").addColumn("id", "text", (col) => col.primaryKey()).addColumn("topic", "text", (col) => col.notNull()).addColumn("payload", "jsonb", (col) => col.notNull()).addColumn("context", "jsonb").addColumn("status", "text", (col) => col.notNull()).addColumn("triggeredByUserId", "text", (col) => col.notNull()).addColumn("occurredAt", "timestamptz", (col) => col.notNull()).addColumn("publications", "jsonb", (col) => col.notNull().defaultTo("[]")).addColumn("priority", "integer").execute();
3
+ await db.schema.createIndex("events_status_idx").on("events").column("status").execute();
4
+ await db.schema.createIndex("events_topic_idx").on("events").column("topic").execute();
5
+ }
6
+ async function down(db) {
7
+ await db.schema.dropTable("events").execute();
8
+ }
9
+ export {
10
+ down,
11
+ up
12
+ };
13
+ //# sourceMappingURL=migration.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/adapters/kysely/migration.ts"],"sourcesContent":["import type { Kysely } from \"kysely\";\n\nexport async function up(db: Kysely<unknown>): Promise<void> {\n await db.schema\n .createTable(\"events\")\n .addColumn(\"id\", \"text\", (col) => col.primaryKey())\n .addColumn(\"topic\", \"text\", (col) => col.notNull())\n .addColumn(\"payload\", \"jsonb\", (col) => col.notNull())\n .addColumn(\"context\", \"jsonb\")\n .addColumn(\"status\", \"text\", (col) => col.notNull())\n .addColumn(\"triggeredByUserId\", \"text\", (col) => col.notNull())\n .addColumn(\"occurredAt\", \"timestamptz\", (col) => col.notNull())\n .addColumn(\"publications\", \"jsonb\", (col) => col.notNull().defaultTo(\"[]\"))\n .addColumn(\"priority\", \"integer\")\n .execute();\n\n await db.schema\n .createIndex(\"events_status_idx\")\n .on(\"events\")\n .column(\"status\")\n .execute();\n\n await db.schema\n .createIndex(\"events_topic_idx\")\n .on(\"events\")\n .column(\"topic\")\n .execute();\n\n // Add B-tree indexes for context keys you query frequently.\n // Kysely's .column() doesn't support expressions, use raw SQL:\n //\n // await sql`CREATE INDEX events_context_user_id_idx ON events ((context->>'userId'))`.execute(db);\n // await sql`CREATE INDEX events_context_tenant_id_idx ON events ((context->>'tenantId'))`.execute(db);\n // await sql`CREATE INDEX events_context_project_id_idx ON events ((context->>'projectId'))`.execute(db);\n}\n\nexport async function down(db: Kysely<unknown>): Promise<void> {\n await db.schema.dropTable(\"events\").execute();\n}\n"],"mappings":"AAEA,eAAsB,GAAG,IAAoC;AAC3D,QAAM,GAAG,OACN,YAAY,QAAQ,EACpB,UAAU,MAAM,QAAQ,CAAC,QAAQ,IAAI,WAAW,CAAC,EACjD,UAAU,SAAS,QAAQ,CAAC,QAAQ,IAAI,QAAQ,CAAC,EACjD,UAAU,WAAW,SAAS,CAAC,QAAQ,IAAI,QAAQ,CAAC,EACpD,UAAU,WAAW,OAAO,EAC5B,UAAU,UAAU,QAAQ,CAAC,QAAQ,IAAI,QAAQ,CAAC,EAClD,UAAU,qBAAqB,QAAQ,CAAC,QAAQ,IAAI,QAAQ,CAAC,EAC7D,UAAU,cAAc,eAAe,CAAC,QAAQ,IAAI,QAAQ,CAAC,EAC7D,UAAU,gBAAgB,SAAS,CAAC,QAAQ,IAAI,QAAQ,EAAE,UAAU,IAAI,CAAC,EACzE,UAAU,YAAY,SAAS,EAC/B,QAAQ;AAEX,QAAM,GAAG,OACN,YAAY,mBAAmB,EAC/B,GAAG,QAAQ,EACX,OAAO,QAAQ,EACf,QAAQ;AAEX,QAAM,GAAG,OACN,YAAY,kBAAkB,EAC9B,GAAG,QAAQ,EACX,OAAO,OAAO,EACd,QAAQ;AAQb;AAEA,eAAsB,KAAK,IAAoC;AAC7D,QAAM,GAAG,OAAO,UAAU,QAAQ,EAAE,QAAQ;AAC9C;","names":[]}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+ var types_exports = {};
16
+ module.exports = __toCommonJS(types_exports);
17
+ //# sourceMappingURL=types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/adapters/kysely/types.ts"],"sourcesContent":["import type {\n DefaultContext,\n EventPublication,\n EventStatus,\n GenericEvent,\n} from \"../../types.ts\";\n\nexport type EventsTable = {\n events: {\n id: string;\n topic: string;\n payload: unknown;\n context: unknown;\n status: EventStatus;\n triggeredByUserId: string;\n occurredAt: Date;\n publications: EventPublication[];\n priority: number | null;\n };\n};\n\nexport type TypedEventsTable<\n Event extends GenericEvent<string, unknown, DefaultContext>,\n Topic extends Event[\"topic\"] = Event[\"topic\"],\n> = {\n events: {\n id: string;\n topic: Topic;\n payload: Extract<Event, { topic: Topic }>[\"payload\"];\n context: Extract<Event, { topic: Topic }>[\"context\"] | null;\n status: EventStatus;\n triggeredByUserId: string;\n occurredAt: Date;\n publications: EventPublication[];\n priority: number | null;\n };\n};\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
@@ -0,0 +1,34 @@
1
+ import { EventStatus, EventPublication, GenericEvent, DefaultContext } from '../../types.cjs';
2
+
3
+ type EventsTable = {
4
+ events: {
5
+ id: string;
6
+ topic: string;
7
+ payload: unknown;
8
+ context: unknown;
9
+ status: EventStatus;
10
+ triggeredByUserId: string;
11
+ occurredAt: Date;
12
+ publications: EventPublication[];
13
+ priority: number | null;
14
+ };
15
+ };
16
+ type TypedEventsTable<Event extends GenericEvent<string, unknown, DefaultContext>, Topic extends Event["topic"] = Event["topic"]> = {
17
+ events: {
18
+ id: string;
19
+ topic: Topic;
20
+ payload: Extract<Event, {
21
+ topic: Topic;
22
+ }>["payload"];
23
+ context: Extract<Event, {
24
+ topic: Topic;
25
+ }>["context"] | null;
26
+ status: EventStatus;
27
+ triggeredByUserId: string;
28
+ occurredAt: Date;
29
+ publications: EventPublication[];
30
+ priority: number | null;
31
+ };
32
+ };
33
+
34
+ export type { EventsTable, TypedEventsTable };
@@ -0,0 +1,34 @@
1
+ import { EventStatus, EventPublication, GenericEvent, DefaultContext } from '../../types.js';
2
+
3
+ type EventsTable = {
4
+ events: {
5
+ id: string;
6
+ topic: string;
7
+ payload: unknown;
8
+ context: unknown;
9
+ status: EventStatus;
10
+ triggeredByUserId: string;
11
+ occurredAt: Date;
12
+ publications: EventPublication[];
13
+ priority: number | null;
14
+ };
15
+ };
16
+ type TypedEventsTable<Event extends GenericEvent<string, unknown, DefaultContext>, Topic extends Event["topic"] = Event["topic"]> = {
17
+ events: {
18
+ id: string;
19
+ topic: Topic;
20
+ payload: Extract<Event, {
21
+ topic: Topic;
22
+ }>["payload"];
23
+ context: Extract<Event, {
24
+ topic: Topic;
25
+ }>["context"] | null;
26
+ status: EventStatus;
27
+ triggeredByUserId: string;
28
+ occurredAt: Date;
29
+ publications: EventPublication[];
30
+ priority: number | null;
31
+ };
32
+ };
33
+
34
+ export type { EventsTable, TypedEventsTable };
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}