ezlogs-nextjs 0.2.0 → 0.3.1

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 (51) hide show
  1. package/README.md +53 -16
  2. package/bin/install-triggers.cjs +73 -11
  3. package/dist/actors/index.cjs +5 -37
  4. package/dist/actors/index.js +2 -34
  5. package/dist/chunk-C5OSM557.js +39 -0
  6. package/dist/chunk-CE3R7DVB.js +1127 -0
  7. package/dist/chunk-CU45I2WR.js +498 -0
  8. package/dist/chunk-DKRNNI4I.js +180 -0
  9. package/dist/chunk-SIAA4J6H.js +17 -0
  10. package/dist/chunk-UQHEW6ER.js +119 -0
  11. package/dist/chunk-UWHYJH4M.cjs +126 -0
  12. package/dist/chunk-V5YNKKTG.cjs +42 -0
  13. package/dist/chunk-WASXTDLW.cjs +1151 -0
  14. package/dist/chunk-Y5NSHKWQ.cjs +182 -0
  15. package/dist/chunk-YX2XPLOA.cjs +508 -0
  16. package/dist/chunk-ZDSQYCYV.cjs +21 -0
  17. package/dist/db/drizzle.cjs +6 -713
  18. package/dist/db/drizzle.js +5 -712
  19. package/dist/db/prisma.cjs +52 -763
  20. package/dist/db/prisma.d.cts +3 -1
  21. package/dist/db/prisma.d.ts +3 -1
  22. package/dist/db/prisma.js +38 -749
  23. package/dist/db/supabase.cjs +21 -728
  24. package/dist/db/supabase.js +14 -721
  25. package/dist/index.cjs +204 -2181
  26. package/dist/index.js +107 -2090
  27. package/dist/jobs/bullmq.cjs +61 -552
  28. package/dist/jobs/bullmq.d.cts +8 -3
  29. package/dist/jobs/bullmq.d.ts +8 -3
  30. package/dist/jobs/bullmq.js +58 -549
  31. package/dist/jobs/inngest.cjs +23 -561
  32. package/dist/jobs/inngest.d.cts +7 -5
  33. package/dist/jobs/inngest.d.ts +7 -5
  34. package/dist/jobs/inngest.js +19 -557
  35. package/dist/jobs/supabase-queues.cjs +17 -603
  36. package/dist/jobs/supabase-queues.js +12 -598
  37. package/dist/jobs/trigger.cjs +18 -587
  38. package/dist/jobs/trigger.js +16 -585
  39. package/dist/jobs/upstash-workflow.cjs +62 -584
  40. package/dist/jobs/upstash-workflow.d.cts +17 -2
  41. package/dist/jobs/upstash-workflow.d.ts +17 -2
  42. package/dist/jobs/upstash-workflow.js +59 -582
  43. package/dist/nextjs-plugin/index.cjs +1 -1
  44. package/dist/nextjs-plugin/index.js +1 -1
  45. package/dist/nextjs-plugin/loader.cjs +21 -25
  46. package/dist/nextjs-plugin/loader.js +1 -5
  47. package/dist/triggers/index.cjs +40 -1234
  48. package/dist/triggers/index.d.cts +7 -2
  49. package/dist/triggers/index.d.ts +7 -2
  50. package/dist/triggers/index.js +6 -1221
  51. package/package.json +4 -1
@@ -8,6 +8,16 @@ interface QStashPublishRequest {
8
8
  body?: unknown;
9
9
  headers?: Record<string, string>;
10
10
  }
11
+ interface WorkflowClientLike {
12
+ trigger?: Function;
13
+ }
14
+ /**
15
+ * Patches `trigger` on the user's `@upstash/workflow` Client so each
16
+ * started run (single or batch) carries the current correlation id to
17
+ * every step. A caller-supplied `x-ezlogs-correlation-id` header wins.
18
+ * No-op outside a captured request. Idempotent.
19
+ */
20
+ declare function wrapWorkflowClient<T extends WorkflowClientLike>(client: T): T;
11
21
  /**
12
22
  * Patches `publishJSON` and `publish` on the user's QStash client so
13
23
  * outbound requests carry the current correlation id forward to the
@@ -25,7 +35,12 @@ declare function wrapQStashClient<T extends QStashClientLike>(client: T): T;
25
35
  * Reads runtime metadata from Upstash's request headers:
26
36
  * - Upstash-Workflow-Runid -> job_id
27
37
  * - Upstash-Retried -> retry_count
28
- * - the wrapped X-Correlation-ID (forwarded by QStash) -> correlation_id
38
+ * - x-ezlogs-correlation-id (stamped by wrapWorkflowClient /
39
+ * wrapQStashClient, agent id format only), else the correlation
40
+ * id inside a run id minted by wrapWorkflowClient -> correlation_id
41
+ *
42
+ * DB writes inside `work` are tagged with that correlation id and
43
+ * emitted when it finishes, so they join the same action.
29
44
  *
30
45
  * Returns the result of `work()`. Re-throws on failure so the user's
31
46
  * Workflow retry / failure-routing semantics still work.
@@ -54,4 +69,4 @@ declare function emitUpstashWorkflowEvent(input: {
54
69
  startedAt?: Date;
55
70
  }): void;
56
71
 
57
- export { captureWorkflowRequest, emitUpstashWorkflowEvent, wrapQStashClient };
72
+ export { captureWorkflowRequest, emitUpstashWorkflowEvent, wrapQStashClient, wrapWorkflowClient };
@@ -8,6 +8,16 @@ interface QStashPublishRequest {
8
8
  body?: unknown;
9
9
  headers?: Record<string, string>;
10
10
  }
11
+ interface WorkflowClientLike {
12
+ trigger?: Function;
13
+ }
14
+ /**
15
+ * Patches `trigger` on the user's `@upstash/workflow` Client so each
16
+ * started run (single or batch) carries the current correlation id to
17
+ * every step. A caller-supplied `x-ezlogs-correlation-id` header wins.
18
+ * No-op outside a captured request. Idempotent.
19
+ */
20
+ declare function wrapWorkflowClient<T extends WorkflowClientLike>(client: T): T;
11
21
  /**
12
22
  * Patches `publishJSON` and `publish` on the user's QStash client so
13
23
  * outbound requests carry the current correlation id forward to the
@@ -25,7 +35,12 @@ declare function wrapQStashClient<T extends QStashClientLike>(client: T): T;
25
35
  * Reads runtime metadata from Upstash's request headers:
26
36
  * - Upstash-Workflow-Runid -> job_id
27
37
  * - Upstash-Retried -> retry_count
28
- * - the wrapped X-Correlation-ID (forwarded by QStash) -> correlation_id
38
+ * - x-ezlogs-correlation-id (stamped by wrapWorkflowClient /
39
+ * wrapQStashClient, agent id format only), else the correlation
40
+ * id inside a run id minted by wrapWorkflowClient -> correlation_id
41
+ *
42
+ * DB writes inside `work` are tagged with that correlation id and
43
+ * emitted when it finishes, so they join the same action.
29
44
  *
30
45
  * Returns the result of `work()`. Re-throws on failure so the user's
31
46
  * Workflow retry / failure-routing semantics still work.
@@ -54,4 +69,4 @@ declare function emitUpstashWorkflowEvent(input: {
54
69
  startedAt?: Date;
55
70
  }): void;
56
71
 
57
- export { captureWorkflowRequest, emitUpstashWorkflowEvent, wrapQStashClient };
72
+ export { captureWorkflowRequest, emitUpstashWorkflowEvent, wrapQStashClient, wrapWorkflowClient };