@graview/core 0.2.6 → 0.2.8
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/dist/binding-served.d.ts +3 -1
- package/dist/binding-served.d.ts.map +1 -1
- package/dist/binding-served.js +7 -2
- package/dist/binding-served.js.map +1 -1
- package/dist/binding-ungranted.d.ts +4 -0
- package/dist/binding-ungranted.d.ts.map +1 -1
- package/dist/binding-ungranted.js +15 -4
- package/dist/binding-ungranted.js.map +1 -1
- package/dist/binding.d.ts +49 -1
- package/dist/binding.d.ts.map +1 -1
- package/dist/binding.js +347 -48
- package/dist/binding.js.map +1 -1
- package/dist/cli/check/policy.js +4 -4
- package/dist/cli/check/policy.js.map +1 -1
- package/dist/cli/document-schema.d.ts.map +1 -1
- package/dist/cli/document-schema.js +9 -2
- package/dist/cli/document-schema.js.map +1 -1
- package/dist/document/compile.d.ts.map +1 -1
- package/dist/document/compile.js +35 -9
- package/dist/document/compile.js.map +1 -1
- package/dist/document/compiled.d.ts +2 -1
- package/dist/document/compiled.d.ts.map +1 -1
- package/dist/document/compiled.js +24 -1
- package/dist/document/compiled.js.map +1 -1
- package/dist/document/described.d.ts +2 -0
- package/dist/document/described.d.ts.map +1 -1
- package/dist/document/edit.js +2 -2
- package/dist/document/edit.js.map +1 -1
- package/dist/document/schema.d.ts +19 -4
- package/dist/document/schema.d.ts.map +1 -1
- package/dist/document/schema.js +20 -2
- package/dist/document/schema.js.map +1 -1
- package/dist/document.schema.json +199 -179
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/ops/undo.d.ts.map +1 -1
- package/dist/ops/undo.js +15 -3
- package/dist/ops/undo.js.map +1 -1
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +9 -0
- package/dist/store.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/views/types.d.ts +8 -0
- package/dist/views/types.d.ts.map +1 -1
- package/dist/views/types.js +1 -1
- package/dist/views/types.js.map +1 -1
- package/dist/workflows/findings.d.ts.map +1 -1
- package/dist/workflows/findings.js +15 -2
- package/dist/workflows/findings.js.map +1 -1
- package/package.json +2 -2
package/dist/binding-served.d.ts
CHANGED
|
@@ -6,13 +6,15 @@ import type { Principal, Refusal } from "./permissions/types.js";
|
|
|
6
6
|
export declare const BIND_PERSON = "bind-person";
|
|
7
7
|
/** The name of the act that moves a seat, and what it did, from the record it is bound to onto another (Roadmap f-rebind-after-acting). */
|
|
8
8
|
export declare const REBIND_PERSON = "rebind-person";
|
|
9
|
+
/** The name of the act that binds a seat with a record of its own to a person entered for it, the own record merged in (Roadmap f-merge-own-record-into-person). */
|
|
10
|
+
export declare const BIND_OWN_RECORD = "bind-own-record";
|
|
9
11
|
/** The acts that say whose record a person is: the framework's own, the host's alone, and never an app's. */
|
|
10
12
|
export declare const BINDING_ACTS: readonly string[];
|
|
11
13
|
/** Whether a name is one of the binding acts (`BINDING_ACTS`). */
|
|
12
14
|
export declare const isBindingAct: (name: string | undefined) => boolean;
|
|
13
15
|
/** What `@graview/core/binding` teaches the store when it is loaded, as `PUBLISHING` does for a publish. */
|
|
14
16
|
export interface BindingServed {
|
|
15
|
-
/** The binding act of this name (`bind-person`, `rebind-person`) for this store, or none where no kind is the people. */
|
|
17
|
+
/** The binding act of this name (`bind-person`, `rebind-person`, `bind-own-record`) for this store, or none where no kind is the people. */
|
|
16
18
|
act?: (store: object, name: string) => unknown;
|
|
17
19
|
/** Whether this seat may run this binding: the host's system seat alone, acting for the app's owner; no grant gives it. */
|
|
18
20
|
judged?: (store: object, call: MutationCall, principal: Principal) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binding-served.d.ts","sourceRoot":"","sources":["../src/binding-served.ts"],"names":[],"mappings":"AAUA,OAAO,EAAW,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY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AAU,CAAC,EAAE,EAAE,SAAS,EAAE,KAAK,GAAE,SAAmB,GAAG,SAAS,CAS/E;AAED,gHAAgH;AAChH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS;IAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,OAAO,EAAE,CAAA;CAAE,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,CAEjG;AAED,oJAAoJ;AACpJ,wBAAgB,SAAS,CAAC,SAAS,EAAE,SAAS,GAAG,SAAS,CAIzD"}
|
package/dist/binding-served.js
CHANGED
|
@@ -14,10 +14,12 @@ import { bindable, isSystem, seatPersonOf } from "./permissions/policy.js";
|
|
|
14
14
|
export const BIND_PERSON = "bind-person";
|
|
15
15
|
/** The name of the act that moves a seat, and what it did, from the record it is bound to onto another (Roadmap f-rebind-after-acting). */
|
|
16
16
|
export const REBIND_PERSON = "rebind-person";
|
|
17
|
+
/** The name of the act that binds a seat with a record of its own to a person entered for it, the own record merged in (Roadmap f-merge-own-record-into-person). */
|
|
18
|
+
export const BIND_OWN_RECORD = "bind-own-record";
|
|
17
19
|
/** The acts that say whose record a person is: the framework's own, the host's alone, and never an app's. */
|
|
18
|
-
export const BINDING_ACTS = [BIND_PERSON, REBIND_PERSON];
|
|
20
|
+
export const BINDING_ACTS = [BIND_PERSON, REBIND_PERSON, BIND_OWN_RECORD];
|
|
19
21
|
/** Whether a name is one of the binding acts (`BINDING_ACTS`). */
|
|
20
|
-
export const isBindingAct = (name) => name === BIND_PERSON || name === REBIND_PERSON;
|
|
22
|
+
export const isBindingAct = (name) => name === BIND_PERSON || name === REBIND_PERSON || name === BIND_OWN_RECORD;
|
|
21
23
|
/* One object for the store and `@graview/core/binding`, found by a key every copy agrees on. */
|
|
22
24
|
export const BINDING = (globalThis[Symbol.for("@graview/core:binding")] ??= {});
|
|
23
25
|
/** The op an undo chain begins with: the change itself, however often it was taken back and put back. */
|
|
@@ -37,6 +39,9 @@ export function takesBindingBack(op, get) {
|
|
|
37
39
|
if (op.undoes === undefined)
|
|
38
40
|
return false;
|
|
39
41
|
const root = rootOfChain(op, get);
|
|
42
|
+
// A merge taken back makes the seat its own record's again (Roadmap f-merge-own-record-into-person).
|
|
43
|
+
if (root.mutation?.name === BIND_OWN_RECORD)
|
|
44
|
+
return true;
|
|
40
45
|
return root.mutation?.name === BIND_PERSON && root.mutation.args?.["end"] !== true;
|
|
41
46
|
}
|
|
42
47
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binding-served.js","sourceRoot":"","sources":["../src/binding-served.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAkB,MAAM,uBAAuB,CAAC;AAGhE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAG3E,yEAAyE;AACzE,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC;AAEzC,2IAA2I;AAC3I,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAC;AAE7C,6GAA6G;AAC7G,MAAM,CAAC,MAAM,YAAY,GAAsB,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"binding-served.js","sourceRoot":"","sources":["../src/binding-served.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAkB,MAAM,uBAAuB,CAAC;AAGhE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAG3E,yEAAyE;AACzE,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC;AAEzC,2IAA2I;AAC3I,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAC;AAE7C,oKAAoK;AACpK,MAAM,CAAC,MAAM,eAAe,GAAG,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AAE,EAAE,CAAC,IAAI,KAAK,GAAG,CAAC;AAC9D,CAAC"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/** What each act the framework keeps for binding does, in the words a refusal of an app's act of that name says it with. */
|
|
2
|
+
export declare const bindingActDoes: (act: string) => string;
|
|
3
|
+
/** The sentence an app's or a document's own act under a kept binding name is refused with (`binding-act-taken`). */
|
|
4
|
+
export declare const bindingActTaken: (act: string) => string;
|
|
1
5
|
/** The sentence a grant that names a binding act is refused with. */
|
|
2
6
|
export declare const bindingUngranted: (act?: string) => string;
|
|
3
7
|
//# sourceMappingURL=binding-ungranted.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binding-ungranted.d.ts","sourceRoot":"","sources":["../src/binding-ungranted.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"binding-ungranted.d.ts","sourceRoot":"","sources":["../src/binding-ungranted.ts"],"names":[],"mappings":"AAUA,4HAA4H;AAC5H,eAAO,MAAM,cAAc,GAAI,KAAK,MAAM,KAAG,MAK0B,CAAC;AAExE,qHAAqH;AACrH,eAAO,MAAM,eAAe,GAAI,KAAK,MAAM,KAAG,MAAgG,CAAC;AAE/I,qEAAqE;AACrE,eAAO,MAAM,gBAAgB,GAAI,MAAK,MAAoB,KAAG,MAKkF,CAAC"}
|
|
@@ -1,13 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* WHY NO GRANT NAMES `bind-person` OR `
|
|
3
|
-
* f-invite-binds-existing-person, f-rebind-after-acting
|
|
2
|
+
* WHY NO GRANT NAMES `bind-person`, `rebind-person` OR `bind-own-record`
|
|
3
|
+
* (Roadmap f-invite-binds-existing-person, f-rebind-after-acting,
|
|
4
|
+
* f-merge-own-record-into-person), as the checker, a
|
|
4
5
|
* compile and an edit say it: whose record a person is is the host's to
|
|
5
6
|
* say, as an invitation is accepted or a binding is corrected. Kept out of
|
|
6
7
|
* what a page draws with.
|
|
7
8
|
*/
|
|
8
|
-
import { BIND_PERSON } from "./binding-served.js";
|
|
9
|
+
import { BIND_PERSON, BIND_OWN_RECORD, REBIND_PERSON } from "./binding-served.js";
|
|
10
|
+
/** What each act the framework keeps for binding does, in the words a refusal of an app's act of that name says it with. */
|
|
11
|
+
export const bindingActDoes = (act) => act === REBIND_PERSON
|
|
12
|
+
? "the host's moving of a person bound to the wrong record to the right one"
|
|
13
|
+
: act === BIND_OWN_RECORD
|
|
14
|
+
? "the host's merging of a member's own record into the person entered for them"
|
|
15
|
+
: "the host's binding of an account to the person entered for it";
|
|
16
|
+
/** The sentence an app's or a document's own act under a kept binding name is refused with (`binding-act-taken`). */
|
|
17
|
+
export const bindingActTaken = (act) => `"${act}" is a name the framework keeps for an act of its own, ${bindingActDoes(act)}`;
|
|
9
18
|
/** The sentence a grant that names a binding act is refused with. */
|
|
10
19
|
export const bindingUngranted = (act = BIND_PERSON) => act === BIND_PERSON
|
|
11
20
|
? `"${BIND_PERSON}" is the host's, and no grant gives it: only the host binds an account to the person entered for it, as an invitation is accepted`
|
|
12
|
-
:
|
|
21
|
+
: act === BIND_OWN_RECORD
|
|
22
|
+
? `"${act}" is the host's, and no grant gives it: only the host merges an account's own record into the person entered for it`
|
|
23
|
+
: `"${act}" is the host's, and no grant gives it: only the host moves an account, and what it did, from one person's record to another's`;
|
|
13
24
|
//# sourceMappingURL=binding-ungranted.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binding-ungranted.js","sourceRoot":"","sources":["../src/binding-ungranted.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"binding-ungranted.js","sourceRoot":"","sources":["../src/binding-ungranted.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAElF,4HAA4H;AAC5H,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,GAAW,EAAU,EAAE,CACpD,GAAG,KAAK,aAAa;IACnB,CAAC,CAAC,0EAA0E;IAC5E,CAAC,CAAC,GAAG,KAAK,eAAe;QACvB,CAAC,CAAC,8EAA8E;QAChF,CAAC,CAAC,+DAA+D,CAAC;AAExE,qHAAqH;AACrH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,GAAW,EAAU,EAAE,CAAC,IAAI,GAAG,0DAA0D,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC;AAE/I,qEAAqE;AACrE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAAc,WAAW,EAAU,EAAE,CACpE,GAAG,KAAK,WAAW;IACjB,CAAC,CAAC,IAAI,WAAW,mIAAmI;IACpJ,CAAC,CAAC,GAAG,KAAK,eAAe;QACvB,CAAC,CAAC,IAAI,GAAG,qHAAqH;QAC9H,CAAC,CAAC,IAAI,GAAG,gIAAgI,CAAC"}
|
package/dist/binding.d.ts
CHANGED
|
@@ -1,6 +1,40 @@
|
|
|
1
1
|
import type { Principal } from "./permissions/types.js";
|
|
2
2
|
import type { AnySchema } from "./schema/schema.js";
|
|
3
3
|
import type { ApplyOptions, ApplyResult, Store } from "./store.js";
|
|
4
|
+
/**
|
|
5
|
+
* THE LINKS A MOVE OR A MERGE LEFT BEHIND (Roadmap
|
|
6
|
+
* f-merge-profile-seat-and-links-past-horizon): what a host shows an owner
|
|
7
|
+
* after `rebindPerson` or `mergePerson`. `count` links stayed on the record
|
|
8
|
+
* the person left, `relations` says how many of each relation, and
|
|
9
|
+
* `sentence` says so in words; none when nothing was left (`count` 0,
|
|
10
|
+
* `relations` empty, no `sentence`).
|
|
11
|
+
*/
|
|
12
|
+
export interface LinksLeftBehind {
|
|
13
|
+
readonly count: number;
|
|
14
|
+
readonly relations: Readonly<Record<string, number>>;
|
|
15
|
+
readonly sentence?: string;
|
|
16
|
+
}
|
|
17
|
+
/** What `rebindPerson` and `mergePerson` answer: the change, and the links it left behind (`LinksLeftBehind`). */
|
|
18
|
+
export type PersonMoved<S extends AnySchema> = ApplyResult<S> & {
|
|
19
|
+
readonly leftBehind: LinksLeftBehind;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* THE HOST'S OWN SEAT (Roadmap f-rebind-follow-ups): the system seat a host
|
|
23
|
+
* binds, moves, merges and ends a person's binding as, and takes one back
|
|
24
|
+
* as. Every other system seat is refused those: one a sync or another app
|
|
25
|
+
* writes as, a migration, the app's own actor, a workflow, and one that is
|
|
26
|
+
* only called what the host is. `id` and `name` say who it is in the log.
|
|
27
|
+
*
|
|
28
|
+
* Its mark is a Symbol, kept by the object this returns and its copies in
|
|
29
|
+
* memory, and lost to anything that crosses JSON or RPC: a seat sent from
|
|
30
|
+
* one process to another arrives as an ordinary system seat, and every
|
|
31
|
+
* binding act refuses it. A host calls `hostSeat()` on the side of the wire
|
|
32
|
+
* where the store is, as it runs the binding, and never sends one.
|
|
33
|
+
*/
|
|
34
|
+
export declare function hostSeat(seat?: {
|
|
35
|
+
readonly id?: string;
|
|
36
|
+
readonly name?: string;
|
|
37
|
+
}): Principal;
|
|
4
38
|
/**
|
|
5
39
|
* BIND A JOINING ACCOUNT TO THE PERSON ENTERED FOR IT: what a host calls as
|
|
6
40
|
* an invitation is accepted. `joining` is the seat as the host will serve it
|
|
@@ -36,7 +70,21 @@ export declare function unbindPerson<S extends AnySchema>(store: Store<S>, leavi
|
|
|
36
70
|
* each. Refused (`ActRefusal`, or `PermissionDeniedError` for who may) in a
|
|
37
71
|
* sentence a host can show.
|
|
38
72
|
*/
|
|
39
|
-
export declare function rebindPerson<S extends AnySchema>(store: Store<S>, person: Principal, record: string, options?: ApplyOptions):
|
|
73
|
+
export declare function rebindPerson<S extends AnySchema>(store: Store<S>, person: Principal, record: string, options?: ApplyOptions): PersonMoved<S>;
|
|
74
|
+
/**
|
|
75
|
+
* MERGE A MEMBER'S OWN RECORD INTO THE PERSON ENTERED FOR THEM (Roadmap
|
|
76
|
+
* f-merge-own-record-into-person): what a host calls where `bindPerson`
|
|
77
|
+
* says the account that joined already has its own record. `person` is the
|
|
78
|
+
* seat as the host serves it; `record` the person entered for it, of the
|
|
79
|
+
* people and nobody's. The seat is `record` from now on, every act it did
|
|
80
|
+
* as its own record is said as `record`, its own record's links move to
|
|
81
|
+
* `record`, and its own record is set aside. The `bind-own-record` act, run as
|
|
82
|
+
* `options.author`, the host's own seat (`hostSeat`), as a binding is: one
|
|
83
|
+
* change, which undo takes back whole — until the person has acted as
|
|
84
|
+
* `record`. Refused (`ActRefusal`, or `PermissionDeniedError` for who may)
|
|
85
|
+
* in a sentence a host can show.
|
|
86
|
+
*/
|
|
87
|
+
export declare function mergePerson<S extends AnySchema>(store: Store<S>, person: Principal, record: string, options?: ApplyOptions): PersonMoved<S>;
|
|
40
88
|
/**
|
|
41
89
|
* WHETHER A RECORD MAY BE BOUND, ASKED BEFORE THERE IS A SEAT TO BIND
|
|
42
90
|
* (Roadmap f-binding-dry-run-and-seat-rules): what a host asks as it offers
|
package/dist/binding.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binding.d.ts","sourceRoot":"","sources":["../src/binding.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"binding.d.ts","sourceRoot":"","sources":["../src/binding.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,SAAS,EAAW,MAAM,wBAAwB,CAAC;AAGjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AA2RnE;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACrD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,kHAAkH;AAClH,MAAM,M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