@flowcore/pathways 0.2.1 → 0.2.2

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 (98) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/esm/common/flowcore.type.d.ts +3 -3
  3. package/esm/common/flowcore.type.d.ts.map +1 -1
  4. package/esm/common/index.d.ts +2 -0
  5. package/esm/common/index.d.ts.map +1 -1
  6. package/esm/common/index.js +2 -0
  7. package/esm/compatibility/flowcore-transformer-core.sdk.d.ts +4 -0
  8. package/esm/compatibility/flowcore-transformer-core.sdk.d.ts.map +1 -1
  9. package/esm/compatibility/flowcore-transformer-core.sdk.js +2 -0
  10. package/esm/contracts/index.d.ts +2 -0
  11. package/esm/contracts/index.d.ts.map +1 -1
  12. package/esm/contracts/index.js +2 -0
  13. package/esm/mod.d.ts +2 -0
  14. package/esm/mod.d.ts.map +1 -1
  15. package/esm/mod.js +2 -0
  16. package/esm/pathways/builder.d.ts +87 -0
  17. package/esm/pathways/builder.d.ts.map +1 -1
  18. package/esm/pathways/builder.js +83 -8
  19. package/esm/pathways/index.d.ts +2 -0
  20. package/esm/pathways/index.d.ts.map +1 -1
  21. package/esm/pathways/index.js +2 -0
  22. package/esm/pathways/internal-pathway.state.d.ts +5 -7
  23. package/esm/pathways/internal-pathway.state.d.ts.map +1 -1
  24. package/esm/pathways/internal-pathway.state.js +5 -7
  25. package/esm/pathways/kv/bun-kv-adapter.d.ts +5 -7
  26. package/esm/pathways/kv/bun-kv-adapter.d.ts.map +1 -1
  27. package/esm/pathways/kv/bun-kv-adapter.js +5 -7
  28. package/esm/pathways/kv/kv-adapter.d.ts +7 -7
  29. package/esm/pathways/kv/kv-adapter.js +1 -1
  30. package/esm/pathways/kv/node-kv-adapter.d.ts +6 -8
  31. package/esm/pathways/kv/node-kv-adapter.d.ts.map +1 -1
  32. package/esm/pathways/kv/node-kv-adapter.js +6 -8
  33. package/esm/pathways/logger.d.ts +46 -3
  34. package/esm/pathways/logger.d.ts.map +1 -1
  35. package/esm/pathways/logger.js +45 -3
  36. package/esm/pathways/postgres/index.d.ts +2 -0
  37. package/esm/pathways/postgres/index.d.ts.map +1 -1
  38. package/esm/pathways/postgres/index.js +2 -0
  39. package/esm/pathways/postgres/postgres-adapter.d.ts +20 -29
  40. package/esm/pathways/postgres/postgres-adapter.d.ts.map +1 -1
  41. package/esm/pathways/postgres/postgres-adapter.js +12 -17
  42. package/esm/pathways/postgres/postgres-pathway-state.d.ts +2 -6
  43. package/esm/pathways/postgres/postgres-pathway-state.d.ts.map +1 -1
  44. package/esm/pathways/postgres/postgres-pathway-state.js +2 -4
  45. package/esm/pathways/types.d.ts +48 -3
  46. package/esm/pathways/types.d.ts.map +1 -1
  47. package/esm/router/index.d.ts +17 -11
  48. package/esm/router/index.d.ts.map +1 -1
  49. package/esm/router/index.js +21 -24
  50. package/package.json +2 -2
  51. package/script/common/flowcore.type.d.ts +3 -3
  52. package/script/common/flowcore.type.d.ts.map +1 -1
  53. package/script/common/index.d.ts +2 -0
  54. package/script/common/index.d.ts.map +1 -1
  55. package/script/common/index.js +2 -0
  56. package/script/compatibility/flowcore-transformer-core.sdk.d.ts +4 -0
  57. package/script/compatibility/flowcore-transformer-core.sdk.d.ts.map +1 -1
  58. package/script/compatibility/flowcore-transformer-core.sdk.js +2 -0
  59. package/script/contracts/index.d.ts +2 -0
  60. package/script/contracts/index.d.ts.map +1 -1
  61. package/script/contracts/index.js +2 -0
  62. package/script/mod.d.ts +2 -0
  63. package/script/mod.d.ts.map +1 -1
  64. package/script/mod.js +2 -0
  65. package/script/pathways/builder.d.ts +87 -0
  66. package/script/pathways/builder.d.ts.map +1 -1
  67. package/script/pathways/builder.js +83 -8
  68. package/script/pathways/index.d.ts +2 -0
  69. package/script/pathways/index.d.ts.map +1 -1
  70. package/script/pathways/index.js +2 -0
  71. package/script/pathways/internal-pathway.state.d.ts +5 -7
  72. package/script/pathways/internal-pathway.state.d.ts.map +1 -1
  73. package/script/pathways/internal-pathway.state.js +5 -7
  74. package/script/pathways/kv/bun-kv-adapter.d.ts +5 -7
  75. package/script/pathways/kv/bun-kv-adapter.d.ts.map +1 -1
  76. package/script/pathways/kv/bun-kv-adapter.js +5 -7
  77. package/script/pathways/kv/kv-adapter.d.ts +7 -7
  78. package/script/pathways/kv/kv-adapter.js +1 -1
  79. package/script/pathways/kv/node-kv-adapter.d.ts +6 -8
  80. package/script/pathways/kv/node-kv-adapter.d.ts.map +1 -1
  81. package/script/pathways/kv/node-kv-adapter.js +6 -8
  82. package/script/pathways/logger.d.ts +46 -3
  83. package/script/pathways/logger.d.ts.map +1 -1
  84. package/script/pathways/logger.js +45 -3
  85. package/script/pathways/postgres/index.d.ts +2 -0
  86. package/script/pathways/postgres/index.d.ts.map +1 -1
  87. package/script/pathways/postgres/index.js +2 -0
  88. package/script/pathways/postgres/postgres-adapter.d.ts +20 -29
  89. package/script/pathways/postgres/postgres-adapter.d.ts.map +1 -1
  90. package/script/pathways/postgres/postgres-adapter.js +12 -17
  91. package/script/pathways/postgres/postgres-pathway-state.d.ts +2 -6
  92. package/script/pathways/postgres/postgres-pathway-state.d.ts.map +1 -1
  93. package/script/pathways/postgres/postgres-pathway-state.js +2 -4
  94. package/script/pathways/types.d.ts +48 -3
  95. package/script/pathways/types.d.ts.map +1 -1
  96. package/script/router/index.d.ts +17 -11
  97. package/script/router/index.d.ts.map +1 -1
  98. package/script/router/index.js +21 -24
@@ -2,8 +2,6 @@ import type { PathwayState } from "./types.js";
2
2
  /**
3
3
  * Internal implementation of PathwayState interface that uses KV storage
4
4
  * for tracking processed events to prevent duplicate processing
5
- *
6
- * @implements {PathwayState}
7
5
  */
8
6
  export declare class InternalPathwayState implements PathwayState {
9
7
  /**
@@ -20,21 +18,21 @@ export declare class InternalPathwayState implements PathwayState {
20
18
  * Gets or initializes the KV adapter
21
19
  *
22
20
  * @private
23
- * @returns {Promise<KvAdapter>} The KV adapter instance
21
+ * @returns The KV adapter instance
24
22
  */
25
23
  private getKv;
26
24
  /**
27
25
  * Checks if an event has already been processed
28
26
  *
29
- * @param {string} eventId - The ID of the event to check
30
- * @returns {Promise<boolean>} True if the event has been processed, false otherwise
27
+ * @param eventId The ID of the event to check
28
+ * @returns True if the event has been processed, false otherwise
31
29
  */
32
30
  isProcessed(eventId: string): Promise<boolean>;
33
31
  /**
34
32
  * Marks an event as processed
35
33
  *
36
- * @param {string} eventId - The ID of the event to mark as processed
37
- * @returns {Promise<void>}
34
+ * @param eventId The ID of the event to mark as processed
35
+ * @returns Promise that resolves when the operation completes
38
36
  */
39
37
  setProcessed(eventId: string): Promise<void>;
40
38
  }
@@ -1 +1 @@
1
- {"version":3,"file":"internal-pathway.state.d.ts","sourceRoot":"","sources":["../../src/pathways/internal-pathway.state.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;;;;GAKG;AACH,qBAAa,oBAAqB,YAAW,YAAY;IACvD;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAiB;IAEvD;;;OAGG;IACH,OAAO,CAAC,EAAE,CAA0B;IAEpC;;;;;OAKG;YACW,KAAK;IAOnB;;;;;OAKG;IACG,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAMpD;;;;;OAKG;IACG,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAInD"}
1
+ {"version":3,"file":"internal-pathway.state.d.ts","sourceRoot":"","sources":["../../src/pathways/internal-pathway.state.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C;;;GAGG;AACH,qBAAa,oBAAqB,YAAW,YAAY;IACvD;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAiB;IAEvD;;;OAGG;IACH,OAAO,CAAC,EAAE,CAA0B;IAEpC;;;;;OAKG;YACW,KAAK;IAOnB;;;;;OAKG;IACG,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAMpD;;;;;OAKG;IACG,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAInD"}
@@ -5,8 +5,6 @@ const kv_adapter_js_1 = require("./kv/kv-adapter.js");
5
5
  /**
6
6
  * Internal implementation of PathwayState interface that uses KV storage
7
7
  * for tracking processed events to prevent duplicate processing
8
- *
9
- * @implements {PathwayState}
10
8
  */
11
9
  class InternalPathwayState {
12
10
  constructor() {
@@ -25,7 +23,7 @@ class InternalPathwayState {
25
23
  * Gets or initializes the KV adapter
26
24
  *
27
25
  * @private
28
- * @returns {Promise<KvAdapter>} The KV adapter instance
26
+ * @returns The KV adapter instance
29
27
  */
30
28
  async getKv() {
31
29
  if (!this.kv) {
@@ -36,8 +34,8 @@ class InternalPathwayState {
36
34
  /**
37
35
  * Checks if an event has already been processed
38
36
  *
39
- * @param {string} eventId - The ID of the event to check
40
- * @returns {Promise<boolean>} True if the event has been processed, false otherwise
37
+ * @param eventId The ID of the event to check
38
+ * @returns True if the event has been processed, false otherwise
41
39
  */
42
40
  async isProcessed(eventId) {
43
41
  const kv = await this.getKv();
@@ -47,8 +45,8 @@ class InternalPathwayState {
47
45
  /**
48
46
  * Marks an event as processed
49
47
  *
50
- * @param {string} eventId - The ID of the event to mark as processed
51
- * @returns {Promise<void>}
48
+ * @param eventId The ID of the event to mark as processed
49
+ * @returns Promise that resolves when the operation completes
52
50
  */
53
51
  async setProcessed(eventId) {
54
52
  const kv = await this.getKv();
@@ -3,8 +3,6 @@ import type { KvAdapter } from "./kv-adapter.js";
3
3
  * KV adapter implementation for Bun runtime
4
4
  *
5
5
  * Uses Bun's SQLite-based key-value store for storage
6
- *
7
- * @implements {KvAdapter}
8
6
  */
9
7
  export declare class BunKvAdapter implements KvAdapter {
10
8
  /**
@@ -20,16 +18,16 @@ export declare class BunKvAdapter implements KvAdapter {
20
18
  * Retrieves a value from the Bun KV store
21
19
  *
22
20
  * @template T The expected type of the stored value
23
- * @param {string} key The key to retrieve
24
- * @returns {T | null} The stored value or null if not found
21
+ * @param key The key to retrieve
22
+ * @returns The stored value or null if not found
25
23
  */
26
24
  get<T>(key: string): T | null;
27
25
  /**
28
26
  * Stores a value in the Bun KV store with the specified TTL
29
27
  *
30
- * @param {string} key The key to store the value under
31
- * @param {unknown} value The value to store
32
- * @param {number} ttlMs Time-to-live in milliseconds
28
+ * @param key The key to store the value under
29
+ * @param value The value to store
30
+ * @param ttlMs Time-to-live in milliseconds
33
31
  */
34
32
  set(key: string, value: unknown, ttlMs: number): void;
35
33
  }
@@ -1 +1 @@
1
- {"version":3,"file":"bun-kv-adapter.d.ts","sourceRoot":"","sources":["../../../src/pathways/kv/bun-kv-adapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;;;;;GAMG;AACH,qBAAa,YAAa,YAAW,SAAS;IAC5C;;;OAGG;IACH,OAAO,CAAC,KAAK,CAAoB;IAEjC;;OAEG;;IAKH;;;;;;OAMG;IACH,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI;IAK7B;;;;;;OAMG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;CAGtD"}
1
+ {"version":3,"file":"bun-kv-adapter.d.ts","sourceRoot":"","sources":["../../../src/pathways/kv/bun-kv-adapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;;;GAIG;AACH,qBAAa,YAAa,YAAW,SAAS;IAC5C;;;OAGG;IACH,OAAO,CAAC,KAAK,CAAoB;IAEjC;;OAEG;;IAKH;;;;;;OAMG;IACH,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI;IAK7B;;;;;;OAMG;IACH,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;CAGtD"}
@@ -6,8 +6,6 @@ const bun_sqlite_key_value_1 = require("bun-sqlite-key-value");
6
6
  * KV adapter implementation for Bun runtime
7
7
  *
8
8
  * Uses Bun's SQLite-based key-value store for storage
9
- *
10
- * @implements {KvAdapter}
11
9
  */
12
10
  class BunKvAdapter {
13
11
  /**
@@ -30,8 +28,8 @@ class BunKvAdapter {
30
28
  * Retrieves a value from the Bun KV store
31
29
  *
32
30
  * @template T The expected type of the stored value
33
- * @param {string} key The key to retrieve
34
- * @returns {T | null} The stored value or null if not found
31
+ * @param key The key to retrieve
32
+ * @returns The stored value or null if not found
35
33
  */
36
34
  get(key) {
37
35
  const value = this.store.get(key);
@@ -40,9 +38,9 @@ class BunKvAdapter {
40
38
  /**
41
39
  * Stores a value in the Bun KV store with the specified TTL
42
40
  *
43
- * @param {string} key The key to store the value under
44
- * @param {unknown} value The value to store
45
- * @param {number} ttlMs Time-to-live in milliseconds
41
+ * @param key The key to store the value under
42
+ * @param value The value to store
43
+ * @param ttlMs Time-to-live in milliseconds
46
44
  */
47
45
  set(key, value, ttlMs) {
48
46
  this.store.set(key, value, ttlMs);
@@ -9,17 +9,17 @@ export interface KvAdapter {
9
9
  * Retrieves a value from storage by key
10
10
  *
11
11
  * @template T The expected type of the stored value
12
- * @param {string} key The key to retrieve
13
- * @returns {(Promise<T | null> | T | null)} The stored value or null if not found
12
+ * @param key The key to retrieve
13
+ * @returns The stored value or null if not found
14
14
  */
15
15
  get<T>(key: string): (Promise<T | null> | T | null);
16
16
  /**
17
17
  * Stores a value in storage with the specified key and TTL
18
18
  *
19
- * @param {string} key The key to store the value under
20
- * @param {unknown} value The value to store
21
- * @param {number} ttlMs Time-to-live in milliseconds
22
- * @returns {(Promise<void> | void)}
19
+ * @param key The key to store the value under
20
+ * @param value The value to store
21
+ * @param ttlMs Time-to-live in milliseconds
22
+ * @returns Promise or void when the operation completes
23
23
  */
24
24
  set(key: string, value: unknown, ttlMs: number): (Promise<void> | void);
25
25
  }
@@ -28,7 +28,7 @@ export interface KvAdapter {
28
28
  *
29
29
  * Attempts to use Bun KV adapter if running in Bun, falls back to Node adapter otherwise
30
30
  *
31
- * @returns {Promise<KvAdapter>} A KV adapter instance
31
+ * @returns A KV adapter instance for the current runtime
32
32
  */
33
33
  export declare function createKvAdapter(): Promise<KvAdapter>;
34
34
  //# sourceMappingURL=kv-adapter.d.ts.map
@@ -29,7 +29,7 @@ exports.createKvAdapter = createKvAdapter;
29
29
  *
30
30
  * Attempts to use Bun KV adapter if running in Bun, falls back to Node adapter otherwise
31
31
  *
32
- * @returns {Promise<KvAdapter>} A KV adapter instance
32
+ * @returns A KV adapter instance for the current runtime
33
33
  */
34
34
  async function createKvAdapter() {
35
35
  try {
@@ -3,8 +3,6 @@ import type { KvAdapter } from "./kv-adapter.js";
3
3
  * KV adapter implementation for Node.js runtime
4
4
  *
5
5
  * Uses node-cache for in-memory key-value storage
6
- *
7
- * @implements {KvAdapter}
8
6
  */
9
7
  export declare class NodeKvAdapter implements KvAdapter {
10
8
  /**
@@ -16,17 +14,17 @@ export declare class NodeKvAdapter implements KvAdapter {
16
14
  * Retrieves a value from the Node.js cache
17
15
  *
18
16
  * @template T The expected type of the stored value
19
- * @param {string} key The key to retrieve
20
- * @returns {Promise<T | null>} The stored value or null if not found
17
+ * @param key The key to retrieve
18
+ * @returns The stored value or null if not found
21
19
  */
22
20
  get<T>(key: string): Promise<T | null>;
23
21
  /**
24
22
  * Stores a value in the Node.js cache with the specified TTL
25
23
  *
26
- * @param {string} key The key to store the value under
27
- * @param {unknown} value The value to store
28
- * @param {number} ttlMs Time-to-live in milliseconds
29
- * @returns {Promise<void>}
24
+ * @param key The key to store the value under
25
+ * @param value The value to store
26
+ * @param ttlMs Time-to-live in milliseconds
27
+ * @returns Promise that resolves when the operation completes
30
28
  */
31
29
  set(key: string, value: unknown, ttlMs: number): Promise<void>;
32
30
  }
@@ -1 +1 @@
1
- {"version":3,"file":"node-kv-adapter.d.ts","sourceRoot":"","sources":["../../../src/pathways/kv/node-kv-adapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;;;;;GAMG;AACH,qBAAa,aAAc,YAAW,SAAS;IAC7C;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAmB;IAEtC;;;;;;OAMG;IACG,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAK5C;;;;;;;OAOG;IACG,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGrE"}
1
+ {"version":3,"file":"node-kv-adapter.d.ts","sourceRoot":"","sources":["../../../src/pathways/kv/node-kv-adapter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD;;;;GAIG;AACH,qBAAa,aAAc,YAAW,SAAS;IAC7C;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAmB;IAEtC;;;;;;OAMG;IACG,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAK5C;;;;;;;OAOG;IACG,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGrE"}
@@ -9,8 +9,6 @@ const node_cache_1 = __importDefault(require("node-cache"));
9
9
  * KV adapter implementation for Node.js runtime
10
10
  *
11
11
  * Uses node-cache for in-memory key-value storage
12
- *
13
- * @implements {KvAdapter}
14
12
  */
15
13
  class NodeKvAdapter {
16
14
  constructor() {
@@ -29,8 +27,8 @@ class NodeKvAdapter {
29
27
  * Retrieves a value from the Node.js cache
30
28
  *
31
29
  * @template T The expected type of the stored value
32
- * @param {string} key The key to retrieve
33
- * @returns {Promise<T | null>} The stored value or null if not found
30
+ * @param key The key to retrieve
31
+ * @returns The stored value or null if not found
34
32
  */
35
33
  async get(key) {
36
34
  const result = await this.kv.get(key);
@@ -39,10 +37,10 @@ class NodeKvAdapter {
39
37
  /**
40
38
  * Stores a value in the Node.js cache with the specified TTL
41
39
  *
42
- * @param {string} key The key to store the value under
43
- * @param {unknown} value The value to store
44
- * @param {number} ttlMs Time-to-live in milliseconds
45
- * @returns {Promise<void>}
40
+ * @param key The key to store the value under
41
+ * @param value The value to store
42
+ * @param ttlMs Time-to-live in milliseconds
43
+ * @returns Promise that resolves when the operation completes
46
44
  */
47
45
  async set(key, value, ttlMs) {
48
46
  await this.kv.set(key, value, (ttlMs / 1000));
@@ -23,26 +23,69 @@ export interface Logger {
23
23
  /**
24
24
  * Log error messages
25
25
  * @param message The message to log
26
+ * @param error Optional error object
26
27
  * @param context Optional context data to include
27
28
  */
28
- error(message: string, context?: Record<string, unknown>): void;
29
+ error(message: string, error?: Error, context?: Record<string, unknown>): void;
29
30
  }
30
31
  /**
31
32
  * A default console logger that logs to the console
32
33
  */
33
34
  export declare class ConsoleLogger implements Logger {
35
+ /**
36
+ * Log debug information to the console
37
+ * @param message The message to log
38
+ * @param context Optional context data to include
39
+ */
34
40
  debug(message: string, context?: Record<string, unknown>): void;
41
+ /**
42
+ * Log informational messages to the console
43
+ * @param message The message to log
44
+ * @param context Optional context data to include
45
+ */
35
46
  info(message: string, context?: Record<string, unknown>): void;
47
+ /**
48
+ * Log warning messages to the console
49
+ * @param message The message to log
50
+ * @param context Optional context data to include
51
+ */
36
52
  warn(message: string, context?: Record<string, unknown>): void;
37
- error(message: string, context?: Record<string, unknown>): void;
53
+ /**
54
+ * Log error messages to the console
55
+ * @param message The message to log
56
+ * @param error Optional error object
57
+ * @param context Optional context data to include
58
+ */
59
+ error(message: string, error?: Error, context?: Record<string, unknown>): void;
38
60
  }
39
61
  /**
40
62
  * A no-operation logger that does nothing
41
63
  */
42
64
  export declare class NoopLogger implements Logger {
65
+ /**
66
+ * No-op debug log
67
+ * @param _message The message to log (ignored)
68
+ * @param _context Optional context data (ignored)
69
+ */
43
70
  debug(_message: string, _context?: Record<string, unknown>): void;
71
+ /**
72
+ * No-op info log
73
+ * @param _message The message to log (ignored)
74
+ * @param _context Optional context data (ignored)
75
+ */
44
76
  info(_message: string, _context?: Record<string, unknown>): void;
77
+ /**
78
+ * No-op warning log
79
+ * @param _message The message to log (ignored)
80
+ * @param _context Optional context data (ignored)
81
+ */
45
82
  warn(_message: string, _context?: Record<string, unknown>): void;
46
- error(_message: string, _context?: Record<string, unknown>): void;
83
+ /**
84
+ * No-op error log
85
+ * @param _message The message to log (ignored)
86
+ * @param _error Optional error object (ignored)
87
+ * @param _context Optional context data (ignored)
88
+ */
89
+ error(_message: string, _error?: Error, _context?: Record<string, unknown>): void;
47
90
  }
48
91
  //# sourceMappingURL=logger.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/pathways/logger.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB;;;;OAIG;IACH,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;IAE/D;;;;OAIG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;IAE9D;;;;OAIG;IACH,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OA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AQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAEjE;;;;OAIG;IACH,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAEhE;;;;OAIG;IACH,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAEhE;;;;;OAKG;IACH,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,KAAK,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;CAClF"}
@@ -5,17 +5,38 @@ exports.NoopLogger = exports.ConsoleLogger = void 0;
5
5
  * A default console logger that logs to the console
6
6
  */
7
7
  class ConsoleLogger {
8
+ /**
9
+ * Log debug information to the console
10
+ * @param message The message to log
11
+ * @param context Optional context data to include
12
+ */
8
13
  debug(message, context) {
9
14
  console.debug(message, context ? JSON.stringify(context) : '');
10
15
  }
16
+ /**
17
+ * Log informational messages to the console
18
+ * @param message The message to log
19
+ * @param context Optional context data to include
20
+ */
11
21
  info(message, context) {
12
22
  console.info(message, context ? JSON.stringify(context) : '');
13
23
  }
24
+ /**
25
+ * Log warning messages to the console
26
+ * @param message The message to log
27
+ * @param context Optional context data to include
28
+ */
14
29
  warn(message, context) {
15
30
  console.warn(message, context ? JSON.stringify(context) : '');
16
31
  }
17
- error(message, context) {
18
- console.error(message, context ? JSON.stringify(context) : '');
32
+ /**
33
+ * Log error messages to the console
34
+ * @param message The message to log
35
+ * @param error Optional error object
36
+ * @param context Optional context data to include
37
+ */
38
+ error(message, error, context) {
39
+ console.error(message, error, context ? JSON.stringify(context) : '');
19
40
  }
20
41
  }
21
42
  exports.ConsoleLogger = ConsoleLogger;
@@ -23,9 +44,30 @@ exports.ConsoleLogger = ConsoleLogger;
23
44
  * A no-operation logger that does nothing
24
45
  */
25
46
  class NoopLogger {
47
+ /**
48
+ * No-op debug log
49
+ * @param _message The message to log (ignored)
50
+ * @param _context Optional context data (ignored)
51
+ */
26
52
  debug(_message, _context) { }
53
+ /**
54
+ * No-op info log
55
+ * @param _message The message to log (ignored)
56
+ * @param _context Optional context data (ignored)
57
+ */
27
58
  info(_message, _context) { }
59
+ /**
60
+ * No-op warning log
61
+ * @param _message The message to log (ignored)
62
+ * @param _context Optional context data (ignored)
63
+ */
28
64
  warn(_message, _context) { }
29
- error(_message, _context) { }
65
+ /**
66
+ * No-op error log
67
+ * @param _message The message to log (ignored)
68
+ * @param _error Optional error object (ignored)
69
+ * @param _context Optional context data (ignored)
70
+ */
71
+ error(_message, _error, _context) { }
30
72
  }
31
73
  exports.NoopLogger = NoopLogger;
@@ -3,6 +3,8 @@
3
3
  *
4
4
  * This module exports components for using PostgreSQL as a storage backend
5
5
  * for pathway state and other persistent data.
6
+ *
7
+ * @module
6
8
  */
7
9
  export * from "./postgres-adapter.js";
8
10
  export * from "./postgres-pathway-state.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pathways/postgres/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pathways/postgres/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC"}
@@ -19,6 +19,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
19
19
  *
20
20
  * This module exports components for using PostgreSQL as a storage backend
21
21
  * for pathway state and other persistent data.
22
+ *
23
+ * @module
22
24
  */
23
25
  __exportStar(require("./postgres-adapter.js"), exports);
24
26
  __exportStar(require("./postgres-pathway-state.js"), exports);
@@ -1,7 +1,5 @@
1
1
  /**
2
2
  * Configuration options for PostgreSQL connection
3
- *
4
- * @interface PostgresConfig
5
3
  */
6
4
  export interface PostgresConfig {
7
5
  /** PostgreSQL server hostname */
@@ -21,40 +19,36 @@ export interface PostgresConfig {
21
19
  * Interface for PostgreSQL database operations
22
20
  *
23
21
  * Provides methods for connecting, querying, and executing SQL statements
24
- *
25
- * @interface PostgresAdapter
26
22
  */
27
23
  export interface PostgresAdapter {
28
24
  /**
29
25
  * Establishes a connection to the PostgreSQL database
30
- * @returns {Promise<void>}
26
+ * @returns Promise that resolves when the connection is established
31
27
  */
32
28
  connect(): Promise<void>;
33
29
  /**
34
30
  * Closes the connection to the PostgreSQL database
35
- * @returns {Promise<void>}
31
+ * @returns Promise that resolves when the connection is closed
36
32
  */
37
33
  disconnect(): Promise<void>;
38
34
  /**
39
35
  * Executes a SQL query and returns the results
40
36
  * @template T The expected result type
41
- * @param {string} sql The SQL query to execute
42
- * @param {unknown[]} [params] Optional parameters for the query
43
- * @returns {Promise<T>} The query results
37
+ * @param sql The SQL query to execute
38
+ * @param params Optional parameters for the query
39
+ * @returns Promise that resolves to the query results
44
40
  */
45
41
  query<T>(sql: string, params?: unknown[]): Promise<T>;
46
42
  /**
47
43
  * Executes a SQL statement without returning results
48
- * @param {string} sql The SQL statement to execute
49
- * @param {unknown[]} [params] Optional parameters for the statement
50
- * @returns {Promise<void>}
44
+ * @param sql The SQL statement to execute
45
+ * @param params Optional parameters for the statement
46
+ * @returns Promise that resolves when the statement has been executed
51
47
  */
52
48
  execute(sql: string, params?: unknown[]): Promise<void>;
53
49
  }
54
50
  /**
55
51
  * Implementation of PostgresAdapter using the postgres.js library
56
- *
57
- * @implements {PostgresAdapter}
58
52
  */
59
53
  export declare class PostgresJsAdapter implements PostgresAdapter {
60
54
  /** The postgres.js client factory function */
@@ -68,45 +62,42 @@ export declare class PostgresJsAdapter implements PostgresAdapter {
68
62
  /**
69
63
  * Creates a new PostgresJsAdapter instance
70
64
  *
71
- * @param {PostgresConfig} config The PostgreSQL connection configuration
65
+ * @param config The PostgreSQL connection configuration
72
66
  */
73
67
  constructor(config: PostgresConfig);
74
68
  /**
75
69
  * Establishes a connection to the PostgreSQL database
76
70
  *
77
- * @returns {Promise<void>}
78
- * @throws {Error} If connection fails
71
+ * @returns Promise that resolves when connection is established
72
+ * @throws Error if connection fails
79
73
  */
80
74
  connect(): Promise<void>;
81
75
  /**
82
76
  * Closes the connection to the PostgreSQL database
83
- *
84
- * @returns {Promise<void>}
77
+ * @returns Promise that resolves when the connection is closed
85
78
  */
86
79
  disconnect(): Promise<void>;
87
80
  /**
88
81
  * Executes a SQL query and returns the results
89
- *
90
82
  * @template T The expected result type
91
- * @param {string} sql The SQL query to execute
92
- * @param {unknown[]} [params=[]] Optional parameters for the query
93
- * @returns {Promise<T>} The query results
83
+ * @param sql The SQL query to execute
84
+ * @param params Optional parameters for the query
85
+ * @returns Promise that resolves to the query results
94
86
  */
95
87
  query<T>(sql: string, params?: unknown[]): Promise<T>;
96
88
  /**
97
89
  * Executes a SQL statement without returning results
98
- *
99
- * @param {string} sql The SQL statement to execute
100
- * @param {unknown[]} [params=[]] Optional parameters for the statement
101
- * @returns {Promise<void>}
90
+ * @param sql The SQL statement to execute
91
+ * @param params Optional parameters for the statement
92
+ * @returns Promise that resolves when the statement has been executed
102
93
  */
103
94
  execute(sql: string, params?: unknown[]): Promise<void>;
104
95
  }
105
96
  /**
106
97
  * Creates and initializes a PostgreSQL adapter
107
98
  *
108
- * @param {PostgresConfig} config The PostgreSQL connection configuration
109
- * @returns {Promise<PostgresAdapter>} An initialized PostgreSQL adapter
99
+ * @param config The PostgreSQL connection configuration
100
+ * @returns An initialized PostgreSQL adapter
110
101
  */
111
102
  export declare function createPostgresAdapter(config: PostgresConfig): Promise<PostgresAdapter>;
112
103
  //# sourceMappingURL=postgres-adapter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"postgres-adapter.d.ts","sourceRoot":"","sources":["../../../src/p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QAAQ,CAA+D;IAC/E,oCAAoC;IACpC,OAAO,CAAC,GAAG,CAA+B;IAC1C,mCAAmC;IACnC,OAAO,CAAC,MAAM,CAAiB;IAC/B,yDAAyD;IACzD,OAAO,CAAC,gBAAgB,CAAS;IAEjC;;;;OAIG;gBACS,MAAM,EAAE,cAAc;IAQlC;;;;;OAKG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAW9B;;;OAGG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAOjC;;;;;;OAMG;IACG,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,GAAE,OAAO,EAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IAO/D;;;;;OAKG;IACG,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,GAAE,OAAO,EAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CAMlE;AAED;;;;;GAKG;AACH,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC,CAI5F"}
@@ -27,14 +27,12 @@ exports.PostgresJsAdapter = void 0;
27
27
  exports.createPostgresAdapter = createPostgresAdapter;
28
28
  /**
29
29
  * Implementation of PostgresAdapter using the postgres.js library
30
- *
31
- * @implements {PostgresAdapter}
32
30
  */
33
31
  class PostgresJsAdapter {
34
32
  /**
35
33
  * Creates a new PostgresJsAdapter instance
36
34
  *
37
- * @param {PostgresConfig} config The PostgreSQL connection configuration
35
+ * @param config The PostgreSQL connection configuration
38
36
  */
39
37
  constructor(config) {
40
38
  /** The postgres.js client factory function */
@@ -74,8 +72,8 @@ class PostgresJsAdapter {
74
72
  /**
75
73
  * Establishes a connection to the PostgreSQL database
76
74
  *
77
- * @returns {Promise<void>}
78
- * @throws {Error} If connection fails
75
+ * @returns Promise that resolves when connection is established
76
+ * @throws Error if connection fails
79
77
  */
80
78
  async connect() {
81
79
  try {
@@ -90,8 +88,7 @@ class PostgresJsAdapter {
90
88
  }
91
89
  /**
92
90
  * Closes the connection to the PostgreSQL database
93
- *
94
- * @returns {Promise<void>}
91
+ * @returns Promise that resolves when the connection is closed
95
92
  */
96
93
  async disconnect() {
97
94
  if (this.sql) {
@@ -101,11 +98,10 @@ class PostgresJsAdapter {
101
98
  }
102
99
  /**
103
100
  * Executes a SQL query and returns the results
104
- *
105
101
  * @template T The expected result type
106
- * @param {string} sql The SQL query to execute
107
- * @param {unknown[]} [params=[]] Optional parameters for the query
108
- * @returns {Promise<T>} The query results
102
+ * @param sql The SQL query to execute
103
+ * @param params Optional parameters for the query
104
+ * @returns Promise that resolves to the query results
109
105
  */
110
106
  async query(sql, params = []) {
111
107
  if (!this.sql) {
@@ -115,10 +111,9 @@ class PostgresJsAdapter {
115
111
  }
116
112
  /**
117
113
  * Executes a SQL statement without returning results
118
- *
119
- * @param {string} sql The SQL statement to execute
120
- * @param {unknown[]} [params=[]] Optional parameters for the statement
121
- * @returns {Promise<void>}
114
+ * @param sql The SQL statement to execute
115
+ * @param params Optional parameters for the statement
116
+ * @returns Promise that resolves when the statement has been executed
122
117
  */
123
118
  async execute(sql, params = []) {
124
119
  if (!this.sql) {
@@ -131,8 +126,8 @@ exports.PostgresJsAdapter = PostgresJsAdapter;
131
126
  /**
132
127
  * Creates and initializes a PostgreSQL adapter
133
128
  *
134
- * @param {PostgresConfig} config The PostgreSQL connection configuration
135
- * @returns {Promise<PostgresAdapter>} An initialized PostgreSQL adapter
129
+ * @param config The PostgreSQL connection configuration
130
+ * @returns An initialized PostgreSQL adapter
136
131
  */
137
132
  async function createPostgresAdapter(config) {
138
133
  const adapter = new PostgresJsAdapter(config);