@tanstack/offline-transactions 1.0.65 → 1.1.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 (52) hide show
  1. package/README.md +81 -2
  2. package/dist/cjs/OfflineExecutor.cjs +74 -93
  3. package/dist/cjs/OfflineExecutor.cjs.map +1 -1
  4. package/dist/cjs/OfflineExecutor.d.cts +6 -0
  5. package/dist/cjs/api/OfflineAction.cjs +4 -15
  6. package/dist/cjs/api/OfflineAction.cjs.map +1 -1
  7. package/dist/cjs/api/OfflineTransaction.cjs +54 -51
  8. package/dist/cjs/api/OfflineTransaction.cjs.map +1 -1
  9. package/dist/cjs/api/OfflineTransaction.d.cts +2 -0
  10. package/dist/cjs/executor/KeyScheduler.cjs +12 -38
  11. package/dist/cjs/executor/KeyScheduler.cjs.map +1 -1
  12. package/dist/cjs/executor/TransactionExecutor.cjs +119 -134
  13. package/dist/cjs/executor/TransactionExecutor.cjs.map +1 -1
  14. package/dist/cjs/outbox/OutboxManager.cjs +48 -77
  15. package/dist/cjs/outbox/OutboxManager.cjs.map +1 -1
  16. package/dist/cjs/types.cjs.map +1 -1
  17. package/dist/cjs/types.d.cts +10 -0
  18. package/dist/esm/OfflineExecutor.d.ts +6 -0
  19. package/dist/esm/OfflineExecutor.js +74 -93
  20. package/dist/esm/OfflineExecutor.js.map +1 -1
  21. package/dist/esm/api/OfflineAction.js +4 -15
  22. package/dist/esm/api/OfflineAction.js.map +1 -1
  23. package/dist/esm/api/OfflineTransaction.d.ts +2 -0
  24. package/dist/esm/api/OfflineTransaction.js +54 -51
  25. package/dist/esm/api/OfflineTransaction.js.map +1 -1
  26. package/dist/esm/executor/KeyScheduler.js +12 -38
  27. package/dist/esm/executor/KeyScheduler.js.map +1 -1
  28. package/dist/esm/executor/TransactionExecutor.js +120 -135
  29. package/dist/esm/executor/TransactionExecutor.js.map +1 -1
  30. package/dist/esm/outbox/OutboxManager.js +48 -77
  31. package/dist/esm/outbox/OutboxManager.js.map +1 -1
  32. package/dist/esm/types.d.ts +10 -0
  33. package/dist/esm/types.js.map +1 -1
  34. package/package.json +2 -2
  35. package/skills/offline/SKILL.md +73 -5
  36. package/src/OfflineExecutor.ts +97 -113
  37. package/src/api/OfflineAction.ts +4 -22
  38. package/src/api/OfflineTransaction.ts +78 -64
  39. package/src/executor/KeyScheduler.ts +18 -47
  40. package/src/executor/TransactionExecutor.ts +148 -162
  41. package/src/outbox/OutboxManager.ts +54 -86
  42. package/src/types.ts +10 -0
  43. package/dist/cjs/retry/NonRetriableError.d.cts +0 -1
  44. package/dist/cjs/telemetry/tracer.cjs +0 -27
  45. package/dist/cjs/telemetry/tracer.cjs.map +0 -1
  46. package/dist/cjs/telemetry/tracer.d.cts +0 -30
  47. package/dist/esm/retry/NonRetriableError.d.ts +0 -1
  48. package/dist/esm/telemetry/tracer.d.ts +0 -30
  49. package/dist/esm/telemetry/tracer.js +0 -27
  50. package/dist/esm/telemetry/tracer.js.map +0 -1
  51. package/src/retry/NonRetriableError.ts +0 -1
  52. package/src/telemetry/tracer.ts +0 -66
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const noopSpan = {
4
- setAttribute: () => {
5
- },
6
- setAttributes: () => {
7
- },
8
- setStatus: () => {
9
- },
10
- recordException: () => {
11
- },
12
- end: () => {
13
- }
14
- };
15
- async function withSpan(name, attrs, fn, _options) {
16
- return await fn(noopSpan);
17
- }
18
- async function withNestedSpan(name, attrs, fn, _options) {
19
- return await fn(noopSpan);
20
- }
21
- function withSyncSpan(name, attrs, fn, _options) {
22
- return fn(noopSpan);
23
- }
24
- exports.withNestedSpan = withNestedSpan;
25
- exports.withSpan = withSpan;
26
- exports.withSyncSpan = withSyncSpan;
27
- //# sourceMappingURL=tracer.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tracer.cjs","sources":["../../../src/telemetry/tracer.ts"],"sourcesContent":["export interface SpanAttrs {\n [key: string]: string | number | boolean | undefined\n}\n\ninterface WithSpanOptions {\n parentContext?: any\n}\n\n// No-op span implementation\nconst noopSpan = {\n setAttribute: () => {},\n setAttributes: () => {},\n setStatus: () => {},\n recordException: () => {},\n end: () => {},\n}\n\n/**\n * Lightweight span wrapper with error handling.\n * No-op implementation - telemetry has been removed.\n *\n * By default, creates spans at the current context level (siblings).\n * Use withNestedSpan if you want parent-child relationships.\n */\nexport async function withSpan<T>(\n name: string,\n attrs: SpanAttrs,\n fn: (span: any) => Promise<T>,\n _options?: WithSpanOptions,\n): Promise<T> {\n return await fn(noopSpan)\n}\n\n/**\n * Like withSpan but propagates context so child spans nest properly.\n * No-op implementation - telemetry has been removed.\n */\nexport async function withNestedSpan<T>(\n name: string,\n attrs: SpanAttrs,\n fn: (span: any) => Promise<T>,\n _options?: WithSpanOptions,\n): Promise<T> {\n return await fn(noopSpan)\n}\n\n/**\n * Creates a synchronous span for non-async operations\n * No-op implementation - telemetry has been removed.\n */\nexport function withSyncSpan<T>(\n name: string,\n attrs: SpanAttrs,\n fn: (span: any) => T,\n _options?: WithSpanOptions,\n): T {\n return fn(noopSpan)\n}\n\n/**\n * Get the current tracer instance\n * No-op implementation - telemetry has been removed.\n */\nexport function getTracer() {\n return null\n}\n"],"names":[],"mappings":";;AASA,MAAM,WAAW;AAAA,EACf,cAAc,MAAM;AAAA,EAAC;AAAA,EACrB,eAAe,MAAM;AAAA,EAAC;AAAA,EACtB,WAAW,MAAM;AAAA,EAAC;AAAA,EAClB,iBAAiB,MAAM;AAAA,EAAC;AAAA,EACxB,KAAK,MAAM;AAAA,EAAC;AACd;AASA,eAAsB,SACpB,MACA,OACA,IACA,UACY;AACZ,SAAO,MAAM,GAAG,QAAQ;AAC1B;AAMA,eAAsB,eACpB,MACA,OACA,IACA,UACY;AACZ,SAAO,MAAM,GAAG,QAAQ;AAC1B;AAMO,SAAS,aACd,MACA,OACA,IACA,UACG;AACH,SAAO,GAAG,QAAQ;AACpB;;;;"}
@@ -1,30 +0,0 @@
1
- export interface SpanAttrs {
2
- [key: string]: string | number | boolean | undefined;
3
- }
4
- interface WithSpanOptions {
5
- parentContext?: any;
6
- }
7
- /**
8
- * Lightweight span wrapper with error handling.
9
- * No-op implementation - telemetry has been removed.
10
- *
11
- * By default, creates spans at the current context level (siblings).
12
- * Use withNestedSpan if you want parent-child relationships.
13
- */
14
- export declare function withSpan<T>(name: string, attrs: SpanAttrs, fn: (span: any) => Promise<T>, _options?: WithSpanOptions): Promise<T>;
15
- /**
16
- * Like withSpan but propagates context so child spans nest properly.
17
- * No-op implementation - telemetry has been removed.
18
- */
19
- export declare function withNestedSpan<T>(name: string, attrs: SpanAttrs, fn: (span: any) => Promise<T>, _options?: WithSpanOptions): Promise<T>;
20
- /**
21
- * Creates a synchronous span for non-async operations
22
- * No-op implementation - telemetry has been removed.
23
- */
24
- export declare function withSyncSpan<T>(name: string, attrs: SpanAttrs, fn: (span: any) => T, _options?: WithSpanOptions): T;
25
- /**
26
- * Get the current tracer instance
27
- * No-op implementation - telemetry has been removed.
28
- */
29
- export declare function getTracer(): null;
30
- export {};
@@ -1 +0,0 @@
1
- export { NonRetriableError } from '../types.js';
@@ -1,30 +0,0 @@
1
- export interface SpanAttrs {
2
- [key: string]: string | number | boolean | undefined;
3
- }
4
- interface WithSpanOptions {
5
- parentContext?: any;
6
- }
7
- /**
8
- * Lightweight span wrapper with error handling.
9
- * No-op implementation - telemetry has been removed.
10
- *
11
- * By default, creates spans at the current context level (siblings).
12
- * Use withNestedSpan if you want parent-child relationships.
13
- */
14
- export declare function withSpan<T>(name: string, attrs: SpanAttrs, fn: (span: any) => Promise<T>, _options?: WithSpanOptions): Promise<T>;
15
- /**
16
- * Like withSpan but propagates context so child spans nest properly.
17
- * No-op implementation - telemetry has been removed.
18
- */
19
- export declare function withNestedSpan<T>(name: string, attrs: SpanAttrs, fn: (span: any) => Promise<T>, _options?: WithSpanOptions): Promise<T>;
20
- /**
21
- * Creates a synchronous span for non-async operations
22
- * No-op implementation - telemetry has been removed.
23
- */
24
- export declare function withSyncSpan<T>(name: string, attrs: SpanAttrs, fn: (span: any) => T, _options?: WithSpanOptions): T;
25
- /**
26
- * Get the current tracer instance
27
- * No-op implementation - telemetry has been removed.
28
- */
29
- export declare function getTracer(): null;
30
- export {};
@@ -1,27 +0,0 @@
1
- const noopSpan = {
2
- setAttribute: () => {
3
- },
4
- setAttributes: () => {
5
- },
6
- setStatus: () => {
7
- },
8
- recordException: () => {
9
- },
10
- end: () => {
11
- }
12
- };
13
- async function withSpan(name, attrs, fn, _options) {
14
- return await fn(noopSpan);
15
- }
16
- async function withNestedSpan(name, attrs, fn, _options) {
17
- return await fn(noopSpan);
18
- }
19
- function withSyncSpan(name, attrs, fn, _options) {
20
- return fn(noopSpan);
21
- }
22
- export {
23
- withNestedSpan,
24
- withSpan,
25
- withSyncSpan
26
- };
27
- //# sourceMappingURL=tracer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tracer.js","sources":["../../../src/telemetry/tracer.ts"],"sourcesContent":["export interface SpanAttrs {\n [key: string]: string | number | boolean | undefined\n}\n\ninterface WithSpanOptions {\n parentContext?: any\n}\n\n// No-op span implementation\nconst noopSpan = {\n setAttribute: () => {},\n setAttributes: () => {},\n setStatus: () => {},\n recordException: () => {},\n end: () => {},\n}\n\n/**\n * Lightweight span wrapper with error handling.\n * No-op implementation - telemetry has been removed.\n *\n * By default, creates spans at the current context level (siblings).\n * Use withNestedSpan if you want parent-child relationships.\n */\nexport async function withSpan<T>(\n name: string,\n attrs: SpanAttrs,\n fn: (span: any) => Promise<T>,\n _options?: WithSpanOptions,\n): Promise<T> {\n return await fn(noopSpan)\n}\n\n/**\n * Like withSpan but propagates context so child spans nest properly.\n * No-op implementation - telemetry has been removed.\n */\nexport async function withNestedSpan<T>(\n name: string,\n attrs: SpanAttrs,\n fn: (span: any) => Promise<T>,\n _options?: WithSpanOptions,\n): Promise<T> {\n return await fn(noopSpan)\n}\n\n/**\n * Creates a synchronous span for non-async operations\n * No-op implementation - telemetry has been removed.\n */\nexport function withSyncSpan<T>(\n name: string,\n attrs: SpanAttrs,\n fn: (span: any) => T,\n _options?: WithSpanOptions,\n): T {\n return fn(noopSpan)\n}\n\n/**\n * Get the current tracer instance\n * No-op implementation - telemetry has been removed.\n */\nexport function getTracer() {\n return null\n}\n"],"names":[],"mappings":"AASA,MAAM,WAAW;AAAA,EACf,cAAc,MAAM;AAAA,EAAC;AAAA,EACrB,eAAe,MAAM;AAAA,EAAC;AAAA,EACtB,WAAW,MAAM;AAAA,EAAC;AAAA,EAClB,iBAAiB,MAAM;AAAA,EAAC;AAAA,EACxB,KAAK,MAAM;AAAA,EAAC;AACd;AASA,eAAsB,SACpB,MACA,OACA,IACA,UACY;AACZ,SAAO,MAAM,GAAG,QAAQ;AAC1B;AAMA,eAAsB,eACpB,MACA,OACA,IACA,UACY;AACZ,SAAO,MAAM,GAAG,QAAQ;AAC1B;AAMO,SAAS,aACd,MACA,OACA,IACA,UACG;AACH,SAAO,GAAG,QAAQ;AACpB;"}
@@ -1 +0,0 @@
1
- export { NonRetriableError } from '../types'
@@ -1,66 +0,0 @@
1
- export interface SpanAttrs {
2
- [key: string]: string | number | boolean | undefined
3
- }
4
-
5
- interface WithSpanOptions {
6
- parentContext?: any
7
- }
8
-
9
- // No-op span implementation
10
- const noopSpan = {
11
- setAttribute: () => {},
12
- setAttributes: () => {},
13
- setStatus: () => {},
14
- recordException: () => {},
15
- end: () => {},
16
- }
17
-
18
- /**
19
- * Lightweight span wrapper with error handling.
20
- * No-op implementation - telemetry has been removed.
21
- *
22
- * By default, creates spans at the current context level (siblings).
23
- * Use withNestedSpan if you want parent-child relationships.
24
- */
25
- export async function withSpan<T>(
26
- name: string,
27
- attrs: SpanAttrs,
28
- fn: (span: any) => Promise<T>,
29
- _options?: WithSpanOptions,
30
- ): Promise<T> {
31
- return await fn(noopSpan)
32
- }
33
-
34
- /**
35
- * Like withSpan but propagates context so child spans nest properly.
36
- * No-op implementation - telemetry has been removed.
37
- */
38
- export async function withNestedSpan<T>(
39
- name: string,
40
- attrs: SpanAttrs,
41
- fn: (span: any) => Promise<T>,
42
- _options?: WithSpanOptions,
43
- ): Promise<T> {
44
- return await fn(noopSpan)
45
- }
46
-
47
- /**
48
- * Creates a synchronous span for non-async operations
49
- * No-op implementation - telemetry has been removed.
50
- */
51
- export function withSyncSpan<T>(
52
- name: string,
53
- attrs: SpanAttrs,
54
- fn: (span: any) => T,
55
- _options?: WithSpanOptions,
56
- ): T {
57
- return fn(noopSpan)
58
- }
59
-
60
- /**
61
- * Get the current tracer instance
62
- * No-op implementation - telemetry has been removed.
63
- */
64
- export function getTracer() {
65
- return null
66
- }