@mountaya/studio 0.1.0 → 0.2.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/CHANGELOG.md +30 -0
- package/dist/agent/index.cjs +2561 -2815
- package/dist/agent/index.cjs.map +1 -1
- package/dist/agent/index.d.cts +766 -786
- package/dist/agent/index.d.ts +766 -786
- package/dist/agent/index.js +2553 -2790
- package/dist/agent/index.js.map +1 -1
- package/dist/chunk-3Oi_Zrtm.js +9 -0
- package/dist/chunk-3Oi_Zrtm.js.map +1 -0
- package/dist/chunk-B18OPIu_.js +6 -0
- package/dist/chunk-B18OPIu_.js.map +1 -0
- package/dist/chunk-B5Uz3Qct.cjs +15 -0
- package/dist/chunk-B5Uz3Qct.cjs.map +1 -0
- package/dist/chunk-BBEJwkd3.d.cts +839 -0
- package/dist/chunk-BIEc_SkR.cjs +29 -0
- package/dist/chunk-BIEc_SkR.cjs.map +1 -0
- package/dist/chunk-BKMFOe-N.js +171 -0
- package/dist/chunk-BKMFOe-N.js.map +1 -0
- package/dist/chunk-BP4uy7E1.d.ts +11583 -0
- package/dist/chunk-BSHTsFiB.js +1403 -0
- package/dist/chunk-BSHTsFiB.js.map +1 -0
- package/dist/chunk-BTUUABGI.js +17 -0
- package/dist/chunk-BTUUABGI.js.map +1 -0
- package/dist/chunk-BaPiaz5X.cjs +115 -0
- package/dist/chunk-BaPiaz5X.cjs.map +1 -0
- package/dist/chunk-BeCVpkYr.cjs +542 -0
- package/dist/chunk-BeCVpkYr.cjs.map +1 -0
- package/dist/chunk-BgngsvK8.cjs +6202 -0
- package/dist/chunk-BgngsvK8.cjs.map +1 -0
- package/dist/chunk-BhInd7CJ.d.cts +253 -0
- package/dist/chunk-Bn6ZbxkS.cjs +27 -0
- package/dist/chunk-By9ZnkVI.js +60 -0
- package/dist/chunk-By9ZnkVI.js.map +1 -0
- package/dist/chunk-BzqPhxsz.cjs +367 -0
- package/dist/chunk-BzqPhxsz.cjs.map +1 -0
- package/dist/chunk-C2mMX81q.d.ts +443 -0
- package/dist/chunk-C2rr9Q0V.cjs +1402 -0
- package/dist/chunk-C2rr9Q0V.cjs.map +1 -0
- package/dist/{directorThreads-CqmvsV8b.d.cts → chunk-CDJCbwIQ.d.cts} +20 -22
- package/dist/chunk-CLGvBOVH.d.cts +1654 -0
- package/dist/chunk-COdw1dc6.d.ts +525 -0
- package/dist/chunk-CQCJnT2i.d.ts +511 -0
- package/dist/chunk-CSyHY67q.cjs +353 -0
- package/dist/chunk-CSyHY67q.cjs.map +1 -0
- package/dist/chunk-CiK1Iqrv.js +950 -0
- package/dist/chunk-CiK1Iqrv.js.map +1 -0
- package/dist/chunk-CmJBgSwZ.cjs +24 -0
- package/dist/chunk-CmJBgSwZ.cjs.map +1 -0
- package/dist/chunk-CnrsRK2u.cjs +83 -0
- package/dist/chunk-CnrsRK2u.cjs.map +1 -0
- package/dist/chunk-Co782_9r.js +326 -0
- package/dist/chunk-Co782_9r.js.map +1 -0
- package/dist/chunk-Csr3KDpZ.cjs +32 -0
- package/dist/chunk-Csr3KDpZ.cjs.map +1 -0
- package/dist/chunk-CwkmccXv.js +89 -0
- package/dist/chunk-CwkmccXv.js.map +1 -0
- package/dist/chunk-D0Q4iL9B.cjs +255 -0
- package/dist/chunk-D0Q4iL9B.cjs.map +1 -0
- package/dist/chunk-DFwiSzUS.cjs +72 -0
- package/dist/chunk-DFwiSzUS.cjs.map +1 -0
- package/dist/chunk-DIFayl2P.d.cts +443 -0
- package/dist/chunk-DIGF58ux.d.cts +525 -0
- package/dist/chunk-DKuuuld5.js +101 -0
- package/dist/chunk-DKuuuld5.js.map +1 -0
- package/dist/chunk-DMePkFEo.js +5054 -0
- package/dist/chunk-DMePkFEo.js.map +1 -0
- package/dist/chunk-DO5SIBgu.js +305 -0
- package/dist/chunk-DO5SIBgu.js.map +1 -0
- package/dist/chunk-DOQ_7eE5.d.ts +6662 -0
- package/dist/{tabs-B2nRO4p_.d.ts → chunk-DThaaNeb.d.cts} +2 -2
- package/dist/{tabs-B2nRO4p_.d.cts → chunk-DThaaNeb.d.ts} +2 -2
- package/dist/{directorThreads-CqmvsV8b.d.ts → chunk-DUQzjUJy.d.ts} +20 -22
- package/dist/chunk-DX37IPhV.cjs +1903 -0
- package/dist/chunk-DX37IPhV.cjs.map +1 -0
- package/dist/chunk-Damps5Tk.cjs +155 -0
- package/dist/chunk-Damps5Tk.cjs.map +1 -0
- package/dist/chunk-DbK5PhpJ.d.ts +1654 -0
- package/dist/chunk-De0vAASv.d.ts +253 -0
- package/dist/chunk-DhSZ7YZt.d.cts +6662 -0
- package/dist/chunk-DjEvqvPA.cjs +43 -0
- package/dist/chunk-DjEvqvPA.cjs.map +1 -0
- package/dist/{saveFile-j-1kkApx.d.cts → chunk-DkwDzwvu.d.cts} +7 -9
- package/dist/{saveFile-j-1kkApx.d.ts → chunk-DkwDzwvu.d.ts} +7 -9
- package/dist/chunk-Dmszv9If.js +71 -0
- package/dist/chunk-Dmszv9If.js.map +1 -0
- package/dist/chunk-Dp_ftNWY.d.cts +511 -0
- package/dist/chunk-DsHQySz0.js +31 -0
- package/dist/chunk-DsHQySz0.js.map +1 -0
- package/dist/chunk-DwoUyHHh.js +281 -0
- package/dist/chunk-DwoUyHHh.js.map +1 -0
- package/dist/chunk-IaIDQflj.d.cts +2315 -0
- package/dist/chunk-IaIDQflj.d.ts +2315 -0
- package/dist/chunk-cVXLsZfL.d.ts +839 -0
- package/dist/chunk-mIaCX9EJ.d.cts +11583 -0
- package/dist/chunk-nJQxbOwQ.cjs +8962 -0
- package/dist/chunk-nJQxbOwQ.cjs.map +1 -0
- package/dist/chunk-o9jaxhCO.js +8852 -0
- package/dist/chunk-o9jaxhCO.js.map +1 -0
- package/dist/chunk-p-Tt_Lwz.js +14 -0
- package/dist/chunk-p-Tt_Lwz.js.map +1 -0
- package/dist/engines/index.cjs +2046 -3401
- package/dist/engines/index.cjs.map +1 -1
- package/dist/engines/index.d.cts +1510 -1550
- package/dist/engines/index.d.ts +1510 -1550
- package/dist/engines/index.js +2039 -3380
- package/dist/engines/index.js.map +1 -1
- package/dist/handlers/index.cjs +47 -93
- package/dist/handlers/index.cjs.map +1 -1
- package/dist/handlers/index.d.cts +61 -103
- package/dist/handlers/index.d.ts +61 -103
- package/dist/handlers/index.js +27 -36
- package/dist/handlers/index.js.map +1 -1
- package/dist/index.cjs +3347 -4398
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -7297
- package/dist/index.d.ts +8 -7297
- package/dist/index.js +2997 -3187
- package/dist/index.js.map +1 -1
- package/dist/plugins/index.cjs +482 -949
- package/dist/plugins/index.cjs.map +1 -1
- package/dist/plugins/index.d.cts +44 -61
- package/dist/plugins/index.d.ts +44 -61
- package/dist/plugins/index.js +471 -915
- package/dist/plugins/index.js.map +1 -1
- package/dist/seams/index.cjs +77 -140
- package/dist/seams/index.cjs.map +1 -1
- package/dist/seams/index.d.cts +125 -158
- package/dist/seams/index.d.ts +125 -158
- package/dist/seams/index.js +41 -71
- package/dist/seams/index.js.map +1 -1
- package/dist/strings/fr/index.cjs +2130 -2116
- package/dist/strings/fr/index.cjs.map +1 -1
- package/dist/strings/fr/index.d.cts +3 -5
- package/dist/strings/fr/index.d.ts +3 -5
- package/dist/strings/fr/index.js +2125 -2114
- package/dist/strings/fr/index.js.map +1 -1
- package/dist/strings/index.cjs +2331 -2625
- package/dist/strings/index.cjs.map +1 -1
- package/dist/strings/index.d.cts +3 -731
- package/dist/strings/index.d.ts +3 -731
- package/dist/strings/index.js +2324 -2615
- package/dist/strings/index.js.map +1 -1
- package/dist/testing/index.cjs +214 -276
- package/dist/testing/index.cjs.map +1 -1
- package/dist/testing/index.d.cts +61 -121
- package/dist/testing/index.d.ts +61 -121
- package/dist/testing/index.js +208 -273
- package/dist/testing/index.js.map +1 -1
- package/dist/time/index.cjs +23 -23
- package/dist/time/index.cjs.map +1 -1
- package/dist/time/index.d.cts +5 -7
- package/dist/time/index.d.ts +5 -7
- package/dist/time/index.js +18 -21
- package/dist/time/index.js.map +1 -1
- package/package.json +14 -15
- package/src/agent/rules/stateDelta.ts +1 -0
- package/src/agent/stores/agentThreads.ts +1 -4
- package/src/bus/rules/bus.ts +1 -2
- package/src/bus/rules/defineRegistry.ts +3 -5
- package/src/bus/rules/types.ts +6 -7
- package/src/chrome/stores/uiStore.ts +4 -2
- package/src/embed/rules/fieldDependencies.ts +2 -0
- package/src/embed/rules/safetyRules.ts +2 -0
- package/src/embed/rules/tableCode.ts +4 -3
- package/src/index.ts +6 -27
- package/src/itinerary/rules/import.ts +6 -8
- package/src/plugins/contracts/plugin.ts +4 -2
- package/src/seams/rules/formatters.ts +5 -3
- package/src/testing/index.ts +1 -5
- package/src/viewer/rules/platformViewer.ts +1 -0
- package/dist/bus-BwiNiXdH.d.ts +0 -514
- package/dist/bus-DzmhPwdK.d.cts +0 -514
- package/dist/chainModel-B23pEP_1.d.cts +0 -127
- package/dist/chainModel-B23pEP_1.d.ts +0 -127
- package/dist/chunk-2HFY7ETU.js +0 -5721
- package/dist/chunk-2HFY7ETU.js.map +0 -1
- package/dist/chunk-355TOXSB.js +0 -72
- package/dist/chunk-355TOXSB.js.map +0 -1
- package/dist/chunk-4ZCUZVSV.js +0 -10275
- package/dist/chunk-4ZCUZVSV.js.map +0 -1
- package/dist/chunk-6HEKY3NF.js +0 -95
- package/dist/chunk-6HEKY3NF.js.map +0 -1
- package/dist/chunk-7GFLGGBX.cjs +0 -8
- package/dist/chunk-7GFLGGBX.cjs.map +0 -1
- package/dist/chunk-7NBRCENN.cjs +0 -19
- package/dist/chunk-7NBRCENN.cjs.map +0 -1
- package/dist/chunk-AF5GCXE3.js +0 -8
- package/dist/chunk-AF5GCXE3.js.map +0 -1
- package/dist/chunk-CJDIFRGZ.cjs +0 -2005
- package/dist/chunk-CJDIFRGZ.cjs.map +0 -1
- package/dist/chunk-CNPZY7N3.js +0 -349
- package/dist/chunk-CNPZY7N3.js.map +0 -1
- package/dist/chunk-DZJHTWSF.cjs +0 -45
- package/dist/chunk-DZJHTWSF.cjs.map +0 -1
- package/dist/chunk-EABIHHWA.js +0 -42
- package/dist/chunk-EABIHHWA.js.map +0 -1
- package/dist/chunk-EKZWV6RS.cjs +0 -415
- package/dist/chunk-EKZWV6RS.cjs.map +0 -1
- package/dist/chunk-EOKRXXAC.cjs +0 -24
- package/dist/chunk-EOKRXXAC.cjs.map +0 -1
- package/dist/chunk-F73W2ZTJ.js +0 -1126
- package/dist/chunk-F73W2ZTJ.js.map +0 -1
- package/dist/chunk-H4DVOZ5O.js +0 -1897
- package/dist/chunk-H4DVOZ5O.js.map +0 -1
- package/dist/chunk-HI52PBFT.cjs +0 -10314
- package/dist/chunk-HI52PBFT.cjs.map +0 -1
- package/dist/chunk-IDBXFBLG.cjs +0 -1225
- package/dist/chunk-IDBXFBLG.cjs.map +0 -1
- package/dist/chunk-LBWTJZUJ.js +0 -297
- package/dist/chunk-LBWTJZUJ.js.map +0 -1
- package/dist/chunk-NCLA6DKD.cjs +0 -310
- package/dist/chunk-NCLA6DKD.cjs.map +0 -1
- package/dist/chunk-O4MC5DPD.js +0 -19
- package/dist/chunk-O4MC5DPD.js.map +0 -1
- package/dist/chunk-OP37FKW6.cjs +0 -98
- package/dist/chunk-OP37FKW6.cjs.map +0 -1
- package/dist/chunk-OQSYFH3Z.cjs +0 -5945
- package/dist/chunk-OQSYFH3Z.cjs.map +0 -1
- package/dist/chunk-PACIO4NS.cjs +0 -26
- package/dist/chunk-PACIO4NS.cjs.map +0 -1
- package/dist/chunk-PSZ2R3TC.cjs +0 -75
- package/dist/chunk-PSZ2R3TC.cjs.map +0 -1
- package/dist/chunk-QFO5CZG2.cjs +0 -136
- package/dist/chunk-QFO5CZG2.cjs.map +0 -1
- package/dist/chunk-QL63MUEW.cjs +0 -140
- package/dist/chunk-QL63MUEW.cjs.map +0 -1
- package/dist/chunk-RFUPPVZO.js +0 -17
- package/dist/chunk-RFUPPVZO.js.map +0 -1
- package/dist/chunk-RPG2LWMP.js +0 -23
- package/dist/chunk-RPG2LWMP.js.map +0 -1
- package/dist/chunk-TIBXK6B7.cjs +0 -12
- package/dist/chunk-TIBXK6B7.cjs.map +0 -1
- package/dist/chunk-UU65VNEV.js +0 -381
- package/dist/chunk-UU65VNEV.js.map +0 -1
- package/dist/chunk-VGX6TR2I.js +0 -209
- package/dist/chunk-VGX6TR2I.js.map +0 -1
- package/dist/chunk-WUTDDBVP.js +0 -130
- package/dist/chunk-WUTDDBVP.js.map +0 -1
- package/dist/chunk-WVQQLKCI.cjs +0 -224
- package/dist/chunk-WVQQLKCI.cjs.map +0 -1
- package/dist/chunk-WZYXG3SE.js +0 -111
- package/dist/chunk-WZYXG3SE.js.map +0 -1
- package/dist/chunk-XDI2X3KE.js +0 -6
- package/dist/chunk-XDI2X3KE.js.map +0 -1
- package/dist/chunk-XKHLRIC7.cjs +0 -381
- package/dist/chunk-XKHLRIC7.cjs.map +0 -1
- package/dist/context-DNtd2WUv.d.cts +0 -11666
- package/dist/context-DgB72Bur.d.ts +0 -11666
- package/dist/en-Bu4Ti9Ev.d.cts +0 -2315
- package/dist/en-Bu4Ti9Ev.d.ts +0 -2315
- package/dist/shareLink-B6hlt942.d.ts +0 -144
- package/dist/shareLink-C7rIMb7x.d.ts +0 -527
- package/dist/shareLink-CnTxxXjp.d.cts +0 -144
- package/dist/shareLink-DyZVYH2V.d.cts +0 -527
- package/dist/studioPlugin-C3C7VjMy.d.ts +0 -847
- package/dist/studioPlugin-Cf3OBNUv.d.cts +0 -847
- package/dist/types-BzJRV6UI.d.cts +0 -845
- package/dist/types-BzJRV6UI.d.ts +0 -845
- package/dist/zoneForm-CdYNtnnA.d.cts +0 -320
- package/dist/zoneForm-mG85yt5e.d.ts +0 -320
|
@@ -0,0 +1,525 @@
|
|
|
1
|
+
import { a as StudioToolContext, io as StudioToolInputs, oo as StudioToolOutputs, yi as ShareLinkTarget } from "./chunk-BP4uy7E1.js";
|
|
2
|
+
import { Jt as ToolFailure, Zt as ToolResultOf } from "./chunk-DbK5PhpJ.js";
|
|
3
|
+
import { d as ShareLinkActions, p as ShareLinkScope } from "./chunk-C2mMX81q.js";
|
|
4
|
+
/** The tools a share link runs, by name. */
|
|
5
|
+
type ShareLinkTool = "studio.shareLink.disable" | "studio.shareLink.mint" | "studio.shareLink.rotate";
|
|
6
|
+
/**
|
|
7
|
+
* ShareLinkDispatch runs one of the tools a share link runs in the given context, and resolves
|
|
8
|
+
* with the tool's result.
|
|
9
|
+
*
|
|
10
|
+
* The result holds that tool's own data, as {@link StudioToolOutputs} states it: an `ok` answer
|
|
11
|
+
* of a mint and of a reset holds the share token, which is never empty. So the dispatch a host
|
|
12
|
+
* hands over is one typed by the studio's outputs: a bus built with `StudioToolInputs` and
|
|
13
|
+
* `StudioToolOutputs`, or a binding's own dispatch that answers each verb's data.
|
|
14
|
+
*
|
|
15
|
+
* The type is all that holds a host's own dispatch to that, and a bus parses no answer. So the
|
|
16
|
+
* engine reads the token through `mintedShareToken`, whose rule for a token is the contract's:
|
|
17
|
+
* an `ok` answer that holds none is no link. A mint answered so is the failure with nothing to
|
|
18
|
+
* word (see {@link ShareLinkFailure}), and a reset answered so resolves `"refused"` (see
|
|
19
|
+
* {@link ShareLinkEngine.rotate}).
|
|
20
|
+
*
|
|
21
|
+
* It takes the context because a reset and a disable run in one the engine layers its own
|
|
22
|
+
* confirm gate over (see {@link ShareLinkEngine.rotate}). A tool bus's dispatch never rejects: a
|
|
23
|
+
* refusal is a result whose `ok` is false. One that throws or rejects all the same is answered
|
|
24
|
+
* as a refusal the engine builds from what was thrown, and never reaches the engine's caller. A
|
|
25
|
+
* host holding a bus writes it as `(context, name, input) => bus.dispatch(context, name, input)`.
|
|
26
|
+
*/
|
|
27
|
+
type ShareLinkDispatch = <TName extends ShareLinkTool>(context: StudioToolContext, name: TName, input: StudioToolInputs[TName]) => Promise<ToolResultOf<StudioToolOutputs, TName>>;
|
|
28
|
+
/**
|
|
29
|
+
* ShareLinkReadResult is what a read of a share link answers: the link's token, null where the
|
|
30
|
+
* resource has none set, or the refusal.
|
|
31
|
+
*/
|
|
32
|
+
type ShareLinkReadResult = {
|
|
33
|
+
readonly ok: true;
|
|
34
|
+
/** The link's token, or null where no link is set. Never empty. */
|
|
35
|
+
readonly token: string | null;
|
|
36
|
+
} | ToolFailure;
|
|
37
|
+
/**
|
|
38
|
+
* ShareLinkRead reads a resource's share link without setting one, in the given context, and
|
|
39
|
+
* resolves with what it found.
|
|
40
|
+
*
|
|
41
|
+
* `readShareLink` of `@mountaya/studio/handlers` is the studio's own: it reads an itinerary's link
|
|
42
|
+
* through the context's persistence and a collection's through its client, and answers a
|
|
43
|
+
* refusal rather than throwing. A read of the host's own is held to the same answer by its type
|
|
44
|
+
* alone, so the engine holds an `ok` token to the contract's rule for one (a token that is empty
|
|
45
|
+
* is no link) and answers one that throws or rejects as the refusal it builds from what was
|
|
46
|
+
* thrown.
|
|
47
|
+
*
|
|
48
|
+
* A read and not a dispatch, because opening a share surface changes nothing: no verb runs, no
|
|
49
|
+
* confirmation is asked, and the token it finds enters no transcript.
|
|
50
|
+
*/
|
|
51
|
+
type ShareLinkRead = (context: StudioToolContext, target: ShareLinkTarget) => Promise<ShareLinkReadResult>;
|
|
52
|
+
/**
|
|
53
|
+
* ShareLinkConfig is what a share link reads from its host, all of it replaceable mid-life
|
|
54
|
+
* through {@link ShareLinkEngine.configure}.
|
|
55
|
+
*/
|
|
56
|
+
interface ShareLinkConfig {
|
|
57
|
+
/**
|
|
58
|
+
* Whether the viewer holds the edit grant on the resource, which reading, creating, resetting
|
|
59
|
+
* and disabling its link all need: a write role in the organization that owns it, or, for a
|
|
60
|
+
* personal resource, its authorship. False while the record that answers is loading. No read
|
|
61
|
+
* is sent without it, so a viewer whose role reads only is never handed a link, nor asked to
|
|
62
|
+
* meet the refusal the API would answer.
|
|
63
|
+
*/
|
|
64
|
+
readonly canManage: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* The tool context the link's tools and its read run in. Read when one is run, so the one
|
|
67
|
+
* configured last is the one used, and never copied: a reset and a disable run in a layer over
|
|
68
|
+
* it, which keeps its late-bound seams resolving when they are read.
|
|
69
|
+
*/
|
|
70
|
+
readonly context: StudioToolContext;
|
|
71
|
+
/** Runs the link's tools. Read when a tool is run, so the one configured last is the one used. */
|
|
72
|
+
readonly dispatch: ShareLinkDispatch;
|
|
73
|
+
/**
|
|
74
|
+
* Reads the link without setting one. Read when the link is asked for, so the one configured
|
|
75
|
+
* last is the one used. `readShareLink` of `@mountaya/studio/handlers` is the studio's own.
|
|
76
|
+
*/
|
|
77
|
+
readonly read: ShareLinkRead;
|
|
78
|
+
/**
|
|
79
|
+
* Whether the resource can hold a link at all. Only `"organization"` is ever sent a read or a
|
|
80
|
+
* create, and only for a viewer who holds `canManage`.
|
|
81
|
+
*/
|
|
82
|
+
readonly scope: ShareLinkScope;
|
|
83
|
+
/**
|
|
84
|
+
* The resource the link is for. Compared by kind and id: one that differs is another question,
|
|
85
|
+
* so the engine drops what it held and reads again.
|
|
86
|
+
*/
|
|
87
|
+
readonly target: ShareLinkTarget;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* ShareLinkEngineOptions is the {@link ShareLinkConfig} an engine starts with, plus the one
|
|
91
|
+
* setting that is fixed for its life.
|
|
92
|
+
*/
|
|
93
|
+
interface ShareLinkEngineOptions extends ShareLinkConfig {
|
|
94
|
+
/**
|
|
95
|
+
* The link's token when the host already holds it, so a surface shows the link from its first
|
|
96
|
+
* frame. The first subscriber still reads the link, which confirms the token, replaces one that
|
|
97
|
+
* was reset elsewhere, or drops one that was disabled elsewhere.
|
|
98
|
+
*
|
|
99
|
+
* @default null
|
|
100
|
+
*/
|
|
101
|
+
readonly token?: string | null | undefined;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* ShareLinkFailure is a read or a create that gave no answer, as a surface shows it: the refusal
|
|
105
|
+
* to word and whether offering a retry would be honest.
|
|
106
|
+
*/
|
|
107
|
+
interface ShareLinkFailure {
|
|
108
|
+
/**
|
|
109
|
+
* The refusal, for a surface to word with its `detail` or with `mapToolError`. Null when the
|
|
110
|
+
* request gave nothing to word: a read or a dispatch that threw or rejected, or an `ok` answer
|
|
111
|
+
* that holds no token. A surface shows its own generic line for that one.
|
|
112
|
+
*/
|
|
113
|
+
readonly failure: ToolFailure | null;
|
|
114
|
+
/**
|
|
115
|
+
* Whether asking again could answer, by `isRetryableShareLinkFailure`. Always true for a
|
|
116
|
+
* failure with nothing to word, since a second attempt there is as good as the first.
|
|
117
|
+
*/
|
|
118
|
+
readonly retryable: boolean;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* ShareLinkSnapshot is what a {@link ShareLinkEngine} answers: the link, and what the engine has
|
|
122
|
+
* decided about it.
|
|
123
|
+
*
|
|
124
|
+
* It names the target it answers for, so a reader holding one knows which resource the link
|
|
125
|
+
* opens and never takes one resource's link for another's.
|
|
126
|
+
*/
|
|
127
|
+
interface ShareLinkSnapshot {
|
|
128
|
+
/**
|
|
129
|
+
* What Reset and Disable are worth offering, by `shareLinkActions` over the configured
|
|
130
|
+
* capability and scope and the token held. {@link ShareLinkEngine.rotate} and
|
|
131
|
+
* {@link ShareLinkEngine.disable} run only what reads `"ready"` here.
|
|
132
|
+
*
|
|
133
|
+
* While either is in flight, from its call to its answer and its confirmation being asked
|
|
134
|
+
* included, neither is offered: what would read `"ready"` reads `"waiting"`, since one link
|
|
135
|
+
* runs one action at a time. A refusal and an absence read as they do.
|
|
136
|
+
*/
|
|
137
|
+
readonly actions: ShareLinkActions;
|
|
138
|
+
/**
|
|
139
|
+
* The management action whose request is running, or null. It is set when the confirmation is
|
|
140
|
+
* approved, never while it is asked, so a surface spins a control over the request alone. One
|
|
141
|
+
* link runs one action at a time, so it names the only one in flight.
|
|
142
|
+
*/
|
|
143
|
+
readonly busy: keyof ShareLinkActions | null;
|
|
144
|
+
/**
|
|
145
|
+
* What last happened to the link through this engine, or null while nothing has: `"read"` once
|
|
146
|
+
* a read answered, the link or that none is set, `"minted"` once a create answered with a link,
|
|
147
|
+
* `"rotated"` and `"disabled"` once a reset and a disable settled. A surface with a live region
|
|
148
|
+
* announces it: the swap from a placeholder to a link, or from one link to another, is
|
|
149
|
+
* otherwise silent.
|
|
150
|
+
*/
|
|
151
|
+
readonly change: "disabled" | "minted" | "read" | "rotated" | null;
|
|
152
|
+
/**
|
|
153
|
+
* Whether the engine knows if a link is set for the target: a read or a create answered, a
|
|
154
|
+
* reset or a disable settled, or the host handed a token over. While it is false a null `token`
|
|
155
|
+
* says nothing. Once it is true a null `token` is a resource with no link, which a surface
|
|
156
|
+
* offers to create through {@link ShareLinkEngine.mint}.
|
|
157
|
+
*/
|
|
158
|
+
readonly known: boolean;
|
|
159
|
+
/**
|
|
160
|
+
* Why the latest create gave no link, or null. It leaves when a create is asked again, when a
|
|
161
|
+
* reset settles, when a disable sent after that create settles, and with the target it was
|
|
162
|
+
* about.
|
|
163
|
+
*/
|
|
164
|
+
readonly mintFailure: ShareLinkFailure | null;
|
|
165
|
+
/** Whether a create is in flight. */
|
|
166
|
+
readonly minting: boolean;
|
|
167
|
+
/**
|
|
168
|
+
* Why the latest read gave no answer, or null. It leaves when the link is read again, when a
|
|
169
|
+
* create, a reset or a disable sent after that read settles, and with the target it was about.
|
|
170
|
+
*
|
|
171
|
+
* Until one of those it reads beside whatever token is held: a link the host handed over whose
|
|
172
|
+
* confirming read failed is still the link a surface shows, with the failure and its retry.
|
|
173
|
+
*/
|
|
174
|
+
readonly readFailure: ShareLinkFailure | null;
|
|
175
|
+
/** Whether a read is in flight. */
|
|
176
|
+
readonly reading: boolean;
|
|
177
|
+
/** The resource the snapshot answers for. One object until the target changes by kind or id. */
|
|
178
|
+
readonly target: ShareLinkTarget;
|
|
179
|
+
/** The link's token, or null while there is no link, or none is known yet (see `known`). */
|
|
180
|
+
readonly token: string | null;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* ShareLinkActionOutcome is what a reset or a disable came to, for the surface that asked:
|
|
184
|
+
*
|
|
185
|
+
* - `"settled"`: the link is as the reader asked. `linkWasActive` is false when a disable found
|
|
186
|
+
* no link to revoke (see `isShareLinkDisableSettled`), which a surface reports in other words.
|
|
187
|
+
* - `"refused"`: the verb failed. `failure` is the refusal to word. A dispatch that threw or
|
|
188
|
+
* rejected is one too, classified as the tool bus classifies a handler that throws: `internal`
|
|
189
|
+
* unless the thrown value carries a status the bus knows. So is a reset answered `ok` with no
|
|
190
|
+
* token, which is `internal`.
|
|
191
|
+
* - `"withheld"`: the confirmation was refused or left to expire, so no verb ran. There is
|
|
192
|
+
* nothing to report: the reader got what they chose.
|
|
193
|
+
* - `"skipped"`: the engine ran nothing, because the action was not `"ready"`, an action of
|
|
194
|
+
* this link was already in flight, or nobody was watching.
|
|
195
|
+
*/
|
|
196
|
+
type ShareLinkActionOutcome = {
|
|
197
|
+
readonly failure: ToolFailure;
|
|
198
|
+
readonly status: "refused";
|
|
199
|
+
} | {
|
|
200
|
+
readonly linkWasActive: boolean;
|
|
201
|
+
readonly status: "settled";
|
|
202
|
+
} | {
|
|
203
|
+
readonly status: "skipped";
|
|
204
|
+
} | {
|
|
205
|
+
readonly status: "withheld";
|
|
206
|
+
};
|
|
207
|
+
/**
|
|
208
|
+
* ShareLinkEngine is the machine behind a resource's share link: it reads the link once somebody
|
|
209
|
+
* watches, keeps the token, that none is set, or the reason it could not tell, and creates,
|
|
210
|
+
* resets and disables the link through the tool bus when the reader asks.
|
|
211
|
+
*
|
|
212
|
+
* What it does, in the order a surface meets it:
|
|
213
|
+
*
|
|
214
|
+
* - **The read.** The first subscriber reads the link of an `"organization"` resource through
|
|
215
|
+
* `read`, which sets nothing, so opening a surface hands no link out. A `"pending"` scope holds
|
|
216
|
+
* the read until the record answers, and a `"personal"` one is never sent it: the API creates
|
|
217
|
+
* no link for one. Nor is a viewer without the edit grant (`canManage` false): the API answers
|
|
218
|
+
* their read 403, and the snapshot's `actions` already say they may not act on a link. A grant
|
|
219
|
+
* that lands later, once the roster that answers it has, sends the read then.
|
|
220
|
+
* - **No link.** A read that finds none leaves the snapshot `known` with no token, and
|
|
221
|
+
* {@link ShareLinkEngine.mint} creates one through `studio.shareLink.mint` when the reader asks.
|
|
222
|
+
* - **A refusal.** A read or a create that gave no answer is the snapshot's `readFailure` or
|
|
223
|
+
* `mintFailure`, with whether a retry is worth offering (`isRetryableShareLinkFailure`).
|
|
224
|
+
* Nothing retries by itself: {@link ShareLinkEngine.read} and {@link ShareLinkEngine.mint} ask
|
|
225
|
+
* again.
|
|
226
|
+
* - **Reset and Disable.** {@link ShareLinkEngine.rotate} and {@link ShareLinkEngine.disable}
|
|
227
|
+
* run what the snapshot's `actions` report `"ready"`, one at a time, and resolve with what
|
|
228
|
+
* each came to. The tool bus asks the confirmation. A withheld one leaves nothing to report:
|
|
229
|
+
* no verb ran, nothing spun, and the actions that waited while it was asked are offered again.
|
|
230
|
+
*
|
|
231
|
+
* Every write goes through `dispatch`, so a person pressing a control and an agent calling the
|
|
232
|
+
* same tools drive one link. Each write's answer is the link as it now stands, so the engine
|
|
233
|
+
* takes it from there and reads nothing again: a create, a reset and a disable each cost one
|
|
234
|
+
* request.
|
|
235
|
+
*
|
|
236
|
+
* The lifecycle is the listeners. Constructing one runs nothing; the first subscriber reads the
|
|
237
|
+
* link; the last unsubscribe parks. A parked engine runs no command and drops the answer of a
|
|
238
|
+
* read that lands on it, so the next subscriber reads again. React's StrictMode mounts,
|
|
239
|
+
* unmounts and mounts again before any answer can land, which parks and resumes around the one
|
|
240
|
+
* read in flight and reads once. A create, a reset or a disable in flight at a park is a write
|
|
241
|
+
* that happened, so its answer is kept. {@link ShareLinkEngine.dispose} is the latch, for an
|
|
242
|
+
* owner that is not a component.
|
|
243
|
+
*
|
|
244
|
+
* A read or a create and a reset or a disable can be in flight together, and their answers land
|
|
245
|
+
* in any order. Which answer the link stands on is decided by what each request does, and where
|
|
246
|
+
* that leaves a doubt, by the order the requests left in: a read and a create leave when they
|
|
247
|
+
* are sent, a reset or a disable when its confirmation is approved.
|
|
248
|
+
*
|
|
249
|
+
* - **A reset outranks every read and create in flight with it.** Neither issues another link
|
|
250
|
+
* where one is set, so the token a reset answers with is the newest whichever the server ran
|
|
251
|
+
* first. The reset's token stands whatever they answered before it, and one still in flight
|
|
252
|
+
* when the reset settles has its answer dropped: it may carry the token the reset retired. A
|
|
253
|
+
* reset answered `ok` with no token outranks them as well, since the server may have made it,
|
|
254
|
+
* and the engine then reads the link that stands.
|
|
255
|
+
* - **A disable outranks the requests sent before it, and yields to one sent after it.** A read
|
|
256
|
+
* or a create sent first may carry the token the disable revoked, so its answer is dropped. One
|
|
257
|
+
* sent after the disable left answers the link as it stands once the disable has run, so it is
|
|
258
|
+
* kept whichever answer lands first, and the disable's own outcome still says what the verb
|
|
259
|
+
* came to. The order the two left in is the order the engine takes the server to have run them
|
|
260
|
+
* in, which is the most a client can know of it.
|
|
261
|
+
* - **A later answer outranks an earlier one.** A read or a create whose answer lands after the
|
|
262
|
+
* answer of one sent later is dropped, so a read that set out before a create never takes back
|
|
263
|
+
* the link the create made.
|
|
264
|
+
*
|
|
265
|
+
* A request whose answer is dropped stops the snapshot reading `reading` or `minting`, unless one
|
|
266
|
+
* of its kind sent after it is still out, and leaves the token, the `change` and the absence of a
|
|
267
|
+
* failure the write left.
|
|
268
|
+
*
|
|
269
|
+
* A listener is told through `notifyListeners`: one that throws stops neither the engine nor the
|
|
270
|
+
* listeners after it, and its fault reaches the program as an uncaught error on a microtask.
|
|
271
|
+
*
|
|
272
|
+
* It keeps no time: nothing here is debounced, throttled or timed out, so the engine takes no
|
|
273
|
+
* `Clock` and arms no timer.
|
|
274
|
+
*
|
|
275
|
+
* @example
|
|
276
|
+
* ```ts
|
|
277
|
+
* declare const context: StudioToolContext;
|
|
278
|
+
* declare const read: ShareLinkRead;
|
|
279
|
+
* declare function render(snapshot: ShareLinkSnapshot): void;
|
|
280
|
+
* declare function report(failure: ToolFailure): void;
|
|
281
|
+
*
|
|
282
|
+
* const link = new ShareLinkEngine({
|
|
283
|
+
* canManage: true,
|
|
284
|
+
* context,
|
|
285
|
+
* dispatch: (context, name, input) => bus.dispatch(context, name, input),
|
|
286
|
+
* read,
|
|
287
|
+
* scope: "organization",
|
|
288
|
+
* target: { id: "itin-1", kind: "itinerary" },
|
|
289
|
+
* });
|
|
290
|
+
* const release = link.subscribe(() => render(link.getSnapshot()));
|
|
291
|
+
*
|
|
292
|
+
* const outcome = await link.rotate();
|
|
293
|
+
* if (outcome.status === "refused") {
|
|
294
|
+
* report(outcome.failure);
|
|
295
|
+
* }
|
|
296
|
+
* release();
|
|
297
|
+
* ```
|
|
298
|
+
*/
|
|
299
|
+
declare class ShareLinkEngine {
|
|
300
|
+
private config;
|
|
301
|
+
/** The target the state below answers for, replaced only by one that differs by kind or id. */
|
|
302
|
+
private target;
|
|
303
|
+
private token;
|
|
304
|
+
private known;
|
|
305
|
+
private readFailure;
|
|
306
|
+
private mintFailure;
|
|
307
|
+
private change;
|
|
308
|
+
private reading;
|
|
309
|
+
private minting;
|
|
310
|
+
/**
|
|
311
|
+
* Whether the link has been read under this target, so that no later subscriber reads again:
|
|
312
|
+
* its token, that none is set, its failure or its read in flight is what the engine holds. A
|
|
313
|
+
* settled disable raises it, since its reader asked for no link.
|
|
314
|
+
*/
|
|
315
|
+
private asked;
|
|
316
|
+
/**
|
|
317
|
+
* The action called under this target and not yet answered, a confirmation being asked
|
|
318
|
+
* included, or null. One slot, because a link takes one management action at a time.
|
|
319
|
+
*/
|
|
320
|
+
private acting;
|
|
321
|
+
/** Whether the confirmation of {@link acting} was approved, so its request is running. */
|
|
322
|
+
private running;
|
|
323
|
+
/** Counts the targets answered for: an answer sent under an earlier one is ignored. */
|
|
324
|
+
private epoch;
|
|
325
|
+
/**
|
|
326
|
+
* Counts the requests that left, a read and a create when they are sent and a reset or a
|
|
327
|
+
* disable at its approval, so each one holds its place in the order they were sent.
|
|
328
|
+
*/
|
|
329
|
+
private sent;
|
|
330
|
+
/**
|
|
331
|
+
* The highest place a settled write outranks, or zero while none has settled: a read or a
|
|
332
|
+
* create sent at or before it has its answer dropped. A reset outranks every request sent by the
|
|
333
|
+
* time it settles, and a disable the ones sent before it.
|
|
334
|
+
*/
|
|
335
|
+
private outranked;
|
|
336
|
+
/**
|
|
337
|
+
* The place of the read or the create whose answer the engine holds, or zero while it holds
|
|
338
|
+
* none of theirs.
|
|
339
|
+
*/
|
|
340
|
+
private answeredAt;
|
|
341
|
+
/** The place of the latest read whose answer landed while nobody watched, or zero. */
|
|
342
|
+
private unheard;
|
|
343
|
+
/** The place of the read whose failure the engine holds, or zero while it holds none. */
|
|
344
|
+
private readFailedAt;
|
|
345
|
+
/** The place of the create whose failure the engine holds, or zero while it holds none. */
|
|
346
|
+
private mintFailedAt;
|
|
347
|
+
/** The place of the read sent last, or zero before any, which `reading` follows. */
|
|
348
|
+
private latestRead;
|
|
349
|
+
/** The place of the create sent last, or zero before any, which `minting` follows. */
|
|
350
|
+
private latestMint;
|
|
351
|
+
private snapshot;
|
|
352
|
+
private readonly subscriptions;
|
|
353
|
+
/** Whether nobody is watching. A parked engine asks for nothing and runs no command. */
|
|
354
|
+
private parked;
|
|
355
|
+
private disposed;
|
|
356
|
+
/**
|
|
357
|
+
* Constructing one holds the options and does nothing else: nothing is read and no tool is run.
|
|
358
|
+
* A React binding constructs during a render React is free to throw away, and a constructor
|
|
359
|
+
* with a side effect would leave the discarded copy reading.
|
|
360
|
+
*/
|
|
361
|
+
constructor(options: ShareLinkEngineOptions);
|
|
362
|
+
/** getSnapshot returns the current answer, by reference and stable between changes. */
|
|
363
|
+
getSnapshot(): ShareLinkSnapshot;
|
|
364
|
+
/**
|
|
365
|
+
* subscribe registers a listener for every change of the snapshot, and returns its own
|
|
366
|
+
* unsubscribe, which is idempotent.
|
|
367
|
+
*
|
|
368
|
+
* The first listener resumes the engine, which reads the link unless it already has, and the
|
|
369
|
+
* last one leaving parks it. That is the whole lifecycle a component can express correctly:
|
|
370
|
+
* React tears an effect down and sets it up again with the same object under StrictMode, so a
|
|
371
|
+
* latch here would leave a live surface bound to a dead engine. Each call is its own
|
|
372
|
+
* subscription, so two owners subscribing one shared function each hold the engine until they
|
|
373
|
+
* release it.
|
|
374
|
+
*/
|
|
375
|
+
subscribe(listener: () => void): () => void;
|
|
376
|
+
/**
|
|
377
|
+
* configure replaces the configuration, and tells its listeners only when the answer changed.
|
|
378
|
+
*
|
|
379
|
+
* A binding calls it on every render, so an unchanged configuration costs a comparison. A
|
|
380
|
+
* changed capability or scope moves the snapshot's `actions`, and a scope that turns
|
|
381
|
+
* `"organization"` sends the read a `"pending"` one held. A target that differs by kind or id
|
|
382
|
+
* is another question: the token, what the engine knew, the failures and the latest change are
|
|
383
|
+
* dropped, the answer of anything in flight for the previous target is ignored, an action still
|
|
384
|
+
* running for it holds back none of the new target's, and the link is read again. A parked
|
|
385
|
+
* engine keeps the configuration for its next subscriber.
|
|
386
|
+
*/
|
|
387
|
+
configure(config: ShareLinkConfig): void;
|
|
388
|
+
/**
|
|
389
|
+
* dispose parks the engine and drops every listener, for good.
|
|
390
|
+
*
|
|
391
|
+
* Idempotent, and every call after it is a no-op rather than an error: an owner torn down
|
|
392
|
+
* mid-request should not have to guard the calls it already queued. A request in flight still
|
|
393
|
+
* reaches the tool it was sent to; its answer changes nothing here.
|
|
394
|
+
*/
|
|
395
|
+
dispose(): void;
|
|
396
|
+
/**
|
|
397
|
+
* read reads the link again, and resolves once that read has answered.
|
|
398
|
+
*
|
|
399
|
+
* The first subscriber reads by itself. This is the retry a surface offers under a
|
|
400
|
+
* `readFailure` whose `retryable` is true. The previous failure leaves the snapshot while the
|
|
401
|
+
* read is in flight, so a surface shows its pending state.
|
|
402
|
+
*
|
|
403
|
+
* It does nothing, and resolves at once, while a read is in flight, while the scope is not
|
|
404
|
+
* `"organization"`, while the viewer does not hold `canManage`, while parked, and after
|
|
405
|
+
* {@link ShareLinkEngine.dispose}. It never rejects.
|
|
406
|
+
*/
|
|
407
|
+
read(): Promise<void>;
|
|
408
|
+
/**
|
|
409
|
+
* mint creates the link through `studio.shareLink.mint`, and resolves once that create has
|
|
410
|
+
* answered: the reader's Create, which a surface offers once the snapshot is `known` with no
|
|
411
|
+
* token. The verb gets or creates, so a link made elsewhere in the meantime is the one it
|
|
412
|
+
* answers, and no URL already handed out is retired. A refusal is the snapshot's `mintFailure`,
|
|
413
|
+
* and asking again is its retry.
|
|
414
|
+
*
|
|
415
|
+
* It does nothing, and resolves at once, while a create is in flight, while a link is held,
|
|
416
|
+
* while a reset or a disable of this link is in flight, while the scope is not
|
|
417
|
+
* `"organization"`, while the viewer does not hold `canManage`, while parked, and after
|
|
418
|
+
* {@link ShareLinkEngine.dispose}. It never rejects.
|
|
419
|
+
*/
|
|
420
|
+
mint(): Promise<void>;
|
|
421
|
+
/**
|
|
422
|
+
* rotate resets the link through `studio.shareLink.rotate`: the token held is retired, every
|
|
423
|
+
* URL carrying it stops working, and the snapshot takes the one issued in its place.
|
|
424
|
+
*
|
|
425
|
+
* The tool bus asks the confirmation inside the dispatch, so the tool runs in a context whose
|
|
426
|
+
* confirm gate the engine layers over the configured one: the snapshot's `busy` turns
|
|
427
|
+
* `"rotate"` when the gate approves, never while it is asked. A context with no confirm gate
|
|
428
|
+
* refuses, as the bus does for one.
|
|
429
|
+
*
|
|
430
|
+
* It runs only while the snapshot's `actions.rotate` is `"ready"`, which it is not while a
|
|
431
|
+
* reset or a disable of this target is in flight (one whose confirmation is still asked
|
|
432
|
+
* included), and while somebody is watching; otherwise it resolves `"skipped"`. One at a time,
|
|
433
|
+
* because two writes side by side would leave the token to whichever answer landed last. A
|
|
434
|
+
* refusal leaves the link, the latest change and a read's or a create's failure as they were.
|
|
435
|
+
* An answer that lands once the engine answers for another target, or after
|
|
436
|
+
* {@link ShareLinkEngine.dispose}, changes nothing either, and the outcome still says what the
|
|
437
|
+
* verb came to.
|
|
438
|
+
*
|
|
439
|
+
* It never rejects. A `dispatch` that throws or rejects resolves `"refused"` with the failure
|
|
440
|
+
* the tool bus builds for a handler that throws, and leaves the reset free to be asked again.
|
|
441
|
+
* So does an `ok` answer that holds no token, with the `internal` refusal the verb gives for a
|
|
442
|
+
* link that holds none: its sentence says the link held may no longer open. The engine then
|
|
443
|
+
* reads the link that stands, and drops the answer of a read or a create sent before the reset,
|
|
444
|
+
* which may carry the link it retired. That read is sent as the first one is, to a watched
|
|
445
|
+
* engine under the `"organization"` scope: a parked engine sends it for its next subscriber,
|
|
446
|
+
* and another scope once it turns `"organization"`.
|
|
447
|
+
*/
|
|
448
|
+
rotate(): Promise<ShareLinkActionOutcome>;
|
|
449
|
+
/**
|
|
450
|
+
* disable revokes the link through `studio.shareLink.disable`: every URL carrying its token
|
|
451
|
+
* stops working, and the snapshot holds no token and knows that none is set. No later
|
|
452
|
+
* subscriber reads it again; {@link ShareLinkEngine.mint} creates another.
|
|
453
|
+
*
|
|
454
|
+
* On a `"personal"` resource a `not-found` answer settles it too, with `linkWasActive` false:
|
|
455
|
+
* no link was active, which is what the reader asked for (`isShareLinkDisableSettled`).
|
|
456
|
+
*
|
|
457
|
+
* The confirmation, the `busy` flag (`"disable"`) and the conditions it runs under are
|
|
458
|
+
* {@link ShareLinkEngine.rotate}'s, read off `actions.disable`.
|
|
459
|
+
*/
|
|
460
|
+
disable(): Promise<ShareLinkActionOutcome>;
|
|
461
|
+
/** ask sends the first read of a target, once a scope that can hold a link is known. */
|
|
462
|
+
private ask;
|
|
463
|
+
/**
|
|
464
|
+
* mayAsk reports whether the link may be read or created as configured: the resource is an
|
|
465
|
+
* organization's, and the viewer holds the edit grant every request of its link needs.
|
|
466
|
+
*/
|
|
467
|
+
private mayAsk;
|
|
468
|
+
/**
|
|
469
|
+
* runAsk sends one read or one create and keeps its answer, unless the engine has moved on by
|
|
470
|
+
* then or a write sent after it has settled.
|
|
471
|
+
*/
|
|
472
|
+
private runAsk;
|
|
473
|
+
/** sendRead reads the link through the configured read, a throw answered as a refusal. */
|
|
474
|
+
private sendRead;
|
|
475
|
+
/** sendMint creates the link through the bus, a dispatch that throws answered as a refusal. */
|
|
476
|
+
private sendMint;
|
|
477
|
+
/** act runs one management action and settles the snapshot with its answer. */
|
|
478
|
+
private act;
|
|
479
|
+
/**
|
|
480
|
+
* settleRotate ends a reset with its answer. The token it issued is the newest whatever a read
|
|
481
|
+
* or a create answered or will answer, so every request sent by now is outranked.
|
|
482
|
+
*
|
|
483
|
+
* An `ok` answer that holds no token is refused as the verb refuses a link that holds none,
|
|
484
|
+
* and the engine was handed no link to show. The server answered `ok` all the same, so it may
|
|
485
|
+
* have retired the link held: every read and create sent by now is outranked, since its answer
|
|
486
|
+
* may carry that link, and the engine reads which link stands
|
|
487
|
+
* ({@link ShareLinkEngine.readStandingLink}). Until that read answers, the link and the latest
|
|
488
|
+
* change read as they did.
|
|
489
|
+
*/
|
|
490
|
+
private settleRotate;
|
|
491
|
+
/**
|
|
492
|
+
* readStandingLink reads which link stands, once a reset answered `ok` with no token.
|
|
493
|
+
*
|
|
494
|
+
* It is sent while somebody watches a resource whose scope is `"organization"`, the one scope a
|
|
495
|
+
* read is sent under, for a viewer who holds the grant. On a parked engine, and under a scope or
|
|
496
|
+
* a grant that takes no read by now, the question is left open: the next subscriber asks it,
|
|
497
|
+
* or the configuration that takes one does. An engine that was disposed, or that answers for
|
|
498
|
+
* another target by now, asks nothing.
|
|
499
|
+
*/
|
|
500
|
+
private readStandingLink;
|
|
501
|
+
/**
|
|
502
|
+
* settleDisable ends a disable with its answer, judged under the scope it was sent under and
|
|
503
|
+
* at the place it left in.
|
|
504
|
+
*/
|
|
505
|
+
private settleDisable;
|
|
506
|
+
/**
|
|
507
|
+
* refuse ends an action whose verb did not run or failed, and answers what it came to:
|
|
508
|
+
* `"withheld"` for a confirmation nobody approved, `"refused"` with the failure otherwise.
|
|
509
|
+
* Nothing in the snapshot changes but the action in flight.
|
|
510
|
+
*/
|
|
511
|
+
private refuse;
|
|
512
|
+
/**
|
|
513
|
+
* finish ends the action in flight: an action may be called again, and the snapshot stops
|
|
514
|
+
* spinning and takes what `apply` writes, in one change. An engine that was disposed, or that
|
|
515
|
+
* answers for another target by now, keeps everything as it is: the action it holds, if any,
|
|
516
|
+
* is the new target's.
|
|
517
|
+
*/
|
|
518
|
+
private finish;
|
|
519
|
+
/** compose assembles the snapshot the engine's state stands for now. */
|
|
520
|
+
private compose;
|
|
521
|
+
/** publish replaces the snapshot when the state moved it, and tells every listener. */
|
|
522
|
+
private publish;
|
|
523
|
+
}
|
|
524
|
+
export { ShareLinkEngineOptions as a, ShareLinkReadResult as c, ShareLinkEngine as i, ShareLinkSnapshot as l, ShareLinkConfig as n, ShareLinkFailure as o, ShareLinkDispatch as r, ShareLinkRead as s, ShareLinkActionOutcome as t };
|
|
525
|
+
//# sourceMappingURL=chunk-COdw1dc6.d.ts.map
|