@zimmerstack/connect 0.6.0 → 0.9.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 (51) hide show
  1. package/AGENTS.md +269 -15
  2. package/README.md +451 -18
  3. package/dist/cjs/client.d.ts +503 -13
  4. package/dist/cjs/client.js +743 -45
  5. package/dist/cjs/doctor.d.ts +86 -0
  6. package/dist/cjs/doctor.js +689 -0
  7. package/dist/cjs/errors.d.ts +6 -2
  8. package/dist/cjs/errors.js +7 -2
  9. package/dist/cjs/generated.d.ts +2921 -207
  10. package/dist/cjs/generated.js +222 -8
  11. package/dist/cjs/grid.d.ts +6 -1
  12. package/dist/cjs/grid.js +8 -0
  13. package/dist/cjs/index.d.ts +14 -5
  14. package/dist/cjs/index.js +41 -1
  15. package/dist/cjs/key.d.ts +39 -0
  16. package/dist/cjs/key.js +85 -0
  17. package/dist/cjs/money.d.ts +81 -0
  18. package/dist/cjs/money.js +172 -0
  19. package/dist/cjs/notices.d.ts +44 -0
  20. package/dist/cjs/notices.js +64 -0
  21. package/dist/cjs/shownOnce.d.ts +42 -0
  22. package/dist/cjs/shownOnce.js +83 -0
  23. package/dist/cjs/webhooks.d.ts +182 -3
  24. package/dist/cjs/webhooks.js +75 -1
  25. package/dist/esm/client.d.ts +503 -13
  26. package/dist/esm/client.js +741 -45
  27. package/dist/esm/doctor.d.ts +86 -0
  28. package/dist/esm/doctor.js +685 -0
  29. package/dist/esm/errors.d.ts +6 -2
  30. package/dist/esm/errors.js +7 -2
  31. package/dist/esm/generated.d.ts +2921 -207
  32. package/dist/esm/generated.js +221 -7
  33. package/dist/esm/grid.d.ts +6 -1
  34. package/dist/esm/grid.js +7 -0
  35. package/dist/esm/index.d.ts +14 -5
  36. package/dist/esm/index.js +8 -3
  37. package/dist/esm/key.d.ts +39 -0
  38. package/dist/esm/key.js +81 -0
  39. package/dist/esm/mcp/cli.js +88 -9
  40. package/dist/esm/mcp/reference.generated.js +4464 -974
  41. package/dist/esm/mcp/server.d.ts +14 -6
  42. package/dist/esm/mcp/server.js +451 -25
  43. package/dist/esm/money.d.ts +81 -0
  44. package/dist/esm/money.js +161 -0
  45. package/dist/esm/notices.d.ts +44 -0
  46. package/dist/esm/notices.js +56 -0
  47. package/dist/esm/shownOnce.d.ts +42 -0
  48. package/dist/esm/shownOnce.js +77 -0
  49. package/dist/esm/webhooks.d.ts +182 -3
  50. package/dist/esm/webhooks.js +69 -0
  51. package/package.json +1 -1
@@ -16,12 +16,16 @@ export declare class ZimmerStackError extends Error {
16
16
  readonly details: unknown;
17
17
  /** Seconds until the same request can pass, when the API said so (429 and 503). */
18
18
  readonly retryAfterSeconds: number | undefined;
19
+ /** The same as a moment: when the request can pass. Set with `retryAfterSeconds`; schedule your retry for it. */
20
+ readonly freesAt: Date | undefined;
19
21
  /** Which budget refused, on a RATE_LIMITED (writes, cells-hour, modifier-changes-day, …). */
20
22
  readonly scope: string | undefined;
21
23
  /**
22
24
  * true when the same request may pass later (a used-up budget, a fault on ZimmerStack's side, a
23
- * network failure). The client has already retried what was worth holding a request open for;
24
- * anything false is a verdict on the request itself: fix it, never resend it.
25
+ * network failure). The client has already retried what was worth holding a request open for, and
26
+ * only where sending again was safe: a refusal for a budget always, a fault or a network failure only
27
+ * for a read or a write that carries an idempotency key. Anything false is a verdict on the request
28
+ * itself: fix it, never resend it.
25
29
  */
26
30
  readonly retryable: boolean;
27
31
  /** The operation that failed, as the contract names it: "PUT /rates". Never contains the key. */
@@ -15,12 +15,16 @@ export class ZimmerStackError extends Error {
15
15
  details;
16
16
  /** Seconds until the same request can pass, when the API said so (429 and 503). */
17
17
  retryAfterSeconds;
18
+ /** The same as a moment: when the request can pass. Set with `retryAfterSeconds`; schedule your retry for it. */
19
+ freesAt;
18
20
  /** Which budget refused, on a RATE_LIMITED (writes, cells-hour, modifier-changes-day, …). */
19
21
  scope;
20
22
  /**
21
23
  * true when the same request may pass later (a used-up budget, a fault on ZimmerStack's side, a
22
- * network failure). The client has already retried what was worth holding a request open for;
23
- * anything false is a verdict on the request itself: fix it, never resend it.
24
+ * network failure). The client has already retried what was worth holding a request open for, and
25
+ * only where sending again was safe: a refusal for a budget always, a fault or a network failure only
26
+ * for a read or a write that carries an idempotency key. Anything false is a verdict on the request
27
+ * itself: fix it, never resend it.
24
28
  */
25
29
  retryable;
26
30
  /** The operation that failed, as the contract names it: "PUT /rates". Never contains the key. */
@@ -32,6 +36,7 @@ export class ZimmerStackError extends Error {
32
36
  this.code = init.code;
33
37
  this.details = init.details;
34
38
  this.retryAfterSeconds = init.retryAfterSeconds;
39
+ this.freesAt = init.retryAfterSeconds === undefined ? undefined : new Date(Date.now() + init.retryAfterSeconds * 1000);
35
40
  this.scope = init.scope;
36
41
  this.retryable = init.retryable;
37
42
  this.operation = init.operation;