@domino-sdk/relay 1.6.0 → 1.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 (35) hide show
  1. package/dist/action-9Xl0StBg.d.ts +33 -0
  2. package/dist/{activity-mPUN4v5Q.d.ts → activity-CCe1e_7a.d.ts} +115 -115
  3. package/dist/authoring.d.ts +45 -45
  4. package/dist/authoring.js +1 -1
  5. package/dist/{automatic-outcomes-DmuqzQiH.d.ts → automatic-outcomes-Dyk0VTUs.d.ts} +1 -1
  6. package/dist/browser.d.ts +7 -6
  7. package/dist/browser.js +5 -4
  8. package/dist/{chunk-C25TDFHN.js → chunk-2N464DDE.js} +1 -1
  9. package/dist/{chunk-GMPPLZKH.js → chunk-2V74CHDL.js} +191 -191
  10. package/dist/{chunk-6RBF3UDA.js → chunk-734LYHWP.js} +2 -2
  11. package/dist/chunk-ETPL6AAJ.js +98 -0
  12. package/dist/{chunk-ZOUEEK5L.js → chunk-FWSSMSIA.js} +49 -21
  13. package/dist/{chunk-BFZHJA2B.js → chunk-L3QFIRGO.js} +2 -2
  14. package/dist/{client-CQuTAjSs.d.ts → client-CbASImpi.d.ts} +42 -36
  15. package/dist/{groups-D08JtrZu.d.ts → groups-Dvmd4CYk.d.ts} +1 -1
  16. package/dist/{images-D7en0Awp.d.ts → images-Dekv3DYF.d.ts} +1 -1
  17. package/dist/index.d.ts +8 -7
  18. package/dist/index.js +7 -3
  19. package/dist/internal.d.ts +5 -119
  20. package/dist/internal.js +1 -1
  21. package/dist/{offers-BENZl5l5.d.ts → offers-BEGVSOTD.d.ts} +2 -2
  22. package/dist/{pages-CBa-_u_n.d.ts → pages-HmS6eedC.d.ts} +38 -38
  23. package/dist/react/index.d.ts +197 -10
  24. package/dist/react/index.js +253 -111
  25. package/dist/referral-reward-kinds-Flbb1D2q.d.ts +171 -0
  26. package/dist/{schema-BPdHSCAc.d.ts → schema-BCuiO7eD.d.ts} +16 -16
  27. package/dist/schema.d.ts +8 -8
  28. package/dist/schema.js +3 -3
  29. package/dist/server/index.d.ts +592 -45
  30. package/dist/server/index.js +209 -49
  31. package/dist/{sign-in-options-FPKoZMfo.d.ts → sign-in-options-z3wsfizk.d.ts} +2 -2
  32. package/dist/{submission-input-BzIWutQi.d.ts → submission-input-Bs14jIsu.d.ts} +2 -2
  33. package/package.json +1 -1
  34. package/dist/identity-integration-BPovus6e.d.ts +0 -58
  35. /package/dist/{chunk-QGLHZ2E5.js → chunk-5ECM6AWV.js} +0 -0
@@ -0,0 +1,33 @@
1
+ import { R as RequestError } from './request-error-D_dUPLwo.js';
2
+
3
+ /** SDK input convenience; the wire request always carries a key. */
4
+ type OptionalActionId<T> = T extends {
5
+ actionId: string;
6
+ } ? Omit<T, "actionId"> & {
7
+ actionId?: string;
8
+ } : never;
9
+ /** One logical write. Keep this object until its outcome is definite. */
10
+ type RelayAction<T> = {
11
+ /** The pending write's key, also available on its uncertain error as `operationId`. */
12
+ readonly actionId: string | undefined;
13
+ readonly busy: boolean;
14
+ readonly error: RequestError | undefined;
15
+ /**
16
+ * Starts a write with a generated key. While an uncertain write is pending, replays its saved
17
+ * callback instead of accepting a different write. Concurrent calls share one request.
18
+ * Put refreshes and other follow-up work outside the callback.
19
+ */
20
+ run(task: (actionId: string) => Promise<T>): Promise<T>;
21
+ /** Replays the exact pending callback and key, only when the error's recovery is `replay`. */
22
+ retry(): Promise<T>;
23
+ /** Acknowledge an authoritative, definite outcome after reconciliation. Refuses while busy. */
24
+ settle(): boolean;
25
+ };
26
+ /**
27
+ * Owns a mutation key across uncertain answers. A definite success or refusal ends the action;
28
+ * the next `run` gets a new key. `reconcile` failures stay pending and cannot be replayed.
29
+ * In-memory only: persist the key yourself if recovery must survive a reload or process restart.
30
+ */
31
+ declare function createRelayAction<T = unknown>(): RelayAction<T>;
32
+
33
+ export { type OptionalActionId as O, type RelayAction as R, createRelayAction as c };