domain0 0.3.3 → 0.4.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.
- package/README.md +17 -6
- package/dist/contracts.cjs +1 -1811
- package/dist/contracts.cjs.map +1 -1
- package/dist/contracts.d.cts +2 -2
- package/dist/contracts.d.mts +2 -2
- package/dist/contracts.mjs +1 -1665
- package/dist/contracts.mjs.map +1 -1
- package/dist/error-1Gob8Pup.cjs +2 -0
- package/dist/{error-BB4-lyc4.cjs.map → error-1Gob8Pup.cjs.map} +1 -1
- package/dist/error-szz6-UFL.mjs +2 -0
- package/dist/{error-Cyd6a9ay.mjs.map → error-szz6-UFL.mjs.map} +1 -1
- package/dist/{index-sSrRFTnm.d.cts → index-DzGqFq0D.d.cts} +1678 -128
- package/dist/{index-sSrRFTnm.d.mts → index-DzGqFq0D.d.mts} +1678 -128
- package/dist/index.cjs +1 -245
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +1 -90
- package/dist/index.mjs.map +1 -1
- package/dist/sdk-BbUuEwzs.mjs +148 -0
- package/dist/sdk-BbUuEwzs.mjs.map +1 -0
- package/dist/{sdk-B10fN-QP.d.mts → sdk-CkEDIlsq.d.cts} +8 -9
- package/dist/{sdk-DYR5Itru.d.cts → sdk-D2QNoMIg.d.mts} +8 -9
- package/dist/sdk-Dv22iteS.cjs +148 -0
- package/dist/sdk-Dv22iteS.cjs.map +1 -0
- package/dist/server.cjs +1 -102
- package/dist/server.cjs.map +1 -1
- package/dist/server.mjs +1 -101
- package/dist/server.mjs.map +1 -1
- package/dist/ui.cjs +1 -12
- package/dist/ui.d.cts +22 -3
- package/dist/ui.d.mts +22 -3
- package/dist/ui.mjs +1 -2
- package/package.json +7 -1
- package/dist/error-BB4-lyc4.cjs +0 -48
- package/dist/error-Cyd6a9ay.mjs +0 -31
- package/dist/sdk-CoOrU3ZT.mjs +0 -4178
- package/dist/sdk-CoOrU3ZT.mjs.map +0 -1
- package/dist/sdk-DJqGGxgC.cjs +0 -4255
- package/dist/sdk-DJqGGxgC.cjs.map +0 -1
package/README.md
CHANGED
|
@@ -286,12 +286,14 @@ it to resolve records in the browser. Conditional intent is resolved by the
|
|
|
286
286
|
backend when the provider is selected, preventing a caller from claiming a
|
|
287
287
|
capability the provider has not proved.
|
|
288
288
|
|
|
289
|
-
The framework-neutral UI exposes fully typed `onStepChange`, `onSuccess`,
|
|
290
|
-
`onClose` lifecycle callbacks. Step events are
|
|
291
|
-
once per open modal session, and
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
289
|
+
The framework-neutral UI exposes fully typed `onStepChange`, `onSuccess`,
|
|
290
|
+
`onFailure`, `onError`, and `onClose` lifecycle callbacks. Step events are
|
|
291
|
+
deduplicated, success is emitted once per open modal session, and each failed
|
|
292
|
+
connection revision emits once. SDK errors are classified into sanitized
|
|
293
|
+
configuration, API, transport, protocol, and unexpected variants. Close events
|
|
294
|
+
separate their interaction `trigger` from the final success, failure,
|
|
295
|
+
cancellation, or incomplete `outcome`. The lower-level `onConnectionChange`
|
|
296
|
+
observer is revision-aware and does not repeat an unchanged connection.
|
|
295
297
|
|
|
296
298
|
For an Entri-style high-level lifecycle, use the singleton `domain0` export or
|
|
297
299
|
create an isolated instance with `createDomain0()`. `connectDomain()` mounts
|
|
@@ -401,6 +403,8 @@ await domain0.connectDomain({
|
|
|
401
403
|
onEvent: (event) => {
|
|
402
404
|
switch (event.type) {
|
|
403
405
|
case 'success':
|
|
406
|
+
case 'failure':
|
|
407
|
+
case 'error':
|
|
404
408
|
case 'close':
|
|
405
409
|
case 'step_change':
|
|
406
410
|
case 'manual_setup_documentation_click':
|
|
@@ -419,6 +423,13 @@ await domain0.connectDomain({
|
|
|
419
423
|
})
|
|
420
424
|
```
|
|
421
425
|
|
|
426
|
+
`failure` means the persisted connection workflow entered
|
|
427
|
+
`failed_retryable` or `failed_terminal`. `error` means the SDK itself could not
|
|
428
|
+
complete an operation. The distinction lets hosts offer connection recovery
|
|
429
|
+
without treating network or integration faults as domain-state transitions.
|
|
430
|
+
Error events contain stable safe codes, retryability, and an API request ID
|
|
431
|
+
when available; raw causes and provider responses are never emitted.
|
|
432
|
+
|
|
422
433
|
Providing `onRequestClose` intercepts only the in-widget Close button. The
|
|
423
434
|
modal remains open until the host closes it, and `onClose` fires only after the
|
|
424
435
|
real close. Manual-guide events fire only from the manual instructions screen.
|