@graview/core 0.2.11 → 0.2.13
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 +4 -1
- package/dist/ago-words.d.ts +3 -0
- package/dist/ago-words.d.ts.map +1 -0
- package/dist/ago-words.js +14 -0
- package/dist/ago-words.js.map +1 -0
- package/dist/app-places.d.ts.map +1 -1
- package/dist/app-places.js +2 -1
- package/dist/app-places.js.map +1 -1
- package/dist/binding.d.ts +25 -2
- package/dist/binding.d.ts.map +1 -1
- package/dist/binding.js +141 -47
- package/dist/binding.js.map +1 -1
- package/dist/blocks.d.ts +1 -1
- package/dist/blocks.d.ts.map +1 -1
- package/dist/blocks.js +1 -1
- package/dist/blocks.js.map +1 -1
- package/dist/catalog.d.ts +2 -0
- package/dist/catalog.d.ts.map +1 -1
- package/dist/catalog.js +9 -2
- package/dist/catalog.js.map +1 -1
- package/dist/changed-once.d.ts +32 -0
- package/dist/changed-once.d.ts.map +1 -0
- package/dist/changed-once.js +41 -0
- package/dist/changed-once.js.map +1 -0
- package/dist/cli/check/lenses.d.ts.map +1 -1
- package/dist/cli/check/lenses.js +21 -1
- package/dist/cli/check/lenses.js.map +1 -1
- package/dist/cli/document-schema.d.ts.map +1 -1
- package/dist/cli/document-schema.js +30 -1
- package/dist/cli/document-schema.js.map +1 -1
- package/dist/describe.d.ts +1 -0
- package/dist/describe.d.ts.map +1 -1
- package/dist/describe.js +2 -0
- package/dist/describe.js.map +1 -1
- package/dist/document/act-findings.d.ts +1 -1
- package/dist/document/act-findings.d.ts.map +1 -1
- package/dist/document/act-findings.js +32 -1
- package/dist/document/act-findings.js.map +1 -1
- package/dist/document/blocks.d.ts.map +1 -1
- package/dist/document/blocks.js +2 -2
- package/dist/document/blocks.js.map +1 -1
- package/dist/document/compile.d.ts.map +1 -1
- package/dist/document/compile.js +4 -0
- package/dist/document/compile.js.map +1 -1
- package/dist/document/compiled.d.ts.map +1 -1
- package/dist/document/compiled.js +6 -1
- package/dist/document/compiled.js.map +1 -1
- package/dist/document/describe-place.d.ts.map +1 -1
- package/dist/document/describe-place.js +19 -3
- package/dist/document/describe-place.js.map +1 -1
- package/dist/document/described.d.ts +14 -4
- package/dist/document/described.d.ts.map +1 -1
- package/dist/document/described.js +0 -6
- package/dist/document/described.js.map +1 -1
- package/dist/document/diff.d.ts +26 -1
- package/dist/document/diff.d.ts.map +1 -1
- package/dist/document/diff.js +55 -4
- package/dist/document/diff.js.map +1 -1
- package/dist/document/edit.d.ts +31 -1
- package/dist/document/edit.d.ts.map +1 -1
- package/dist/document/edit.js +212 -5
- package/dist/document/edit.js.map +1 -1
- package/dist/document/graview-template.d.ts.map +1 -1
- package/dist/document/graview-template.js +7 -0
- package/dist/document/graview-template.js.map +1 -1
- package/dist/document/index.d.ts +2 -2
- package/dist/document/index.d.ts.map +1 -1
- package/dist/document/to-document.d.ts.map +1 -1
- package/dist/document/to-document.js +4 -0
- package/dist/document/to-document.js.map +1 -1
- package/dist/document.schema.json +190 -6
- package/dist/field-sight.d.ts.map +1 -1
- package/dist/field-sight.js +2 -0
- package/dist/field-sight.js.map +1 -1
- package/dist/geo.d.ts +23 -0
- package/dist/geo.d.ts.map +1 -0
- package/dist/geo.js +29 -0
- package/dist/geo.js.map +1 -0
- package/dist/index.d.ts +9 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/lenses-that-list.d.ts.map +1 -1
- package/dist/lenses-that-list.js +1 -1
- package/dist/lenses-that-list.js.map +1 -1
- package/dist/map-point.d.ts +11 -0
- package/dist/map-point.d.ts.map +1 -0
- package/dist/map-point.js +21 -0
- package/dist/map-point.js.map +1 -0
- package/dist/map-words.d.ts +19 -0
- package/dist/map-words.d.ts.map +1 -0
- package/dist/map-words.js +36 -0
- package/dist/map-words.js.map +1 -0
- package/dist/mutations/define-mutation.d.ts +8 -0
- package/dist/mutations/define-mutation.d.ts.map +1 -1
- package/dist/mutations/define-mutation.js +16 -1
- package/dist/mutations/define-mutation.js.map +1 -1
- package/dist/mutations/form.d.ts.map +1 -1
- package/dist/mutations/form.js +3 -1
- package/dist/mutations/form.js.map +1 -1
- package/dist/ops/declines.d.ts +3 -0
- package/dist/ops/declines.d.ts.map +1 -1
- package/dist/ops/declines.js +6 -2
- package/dist/ops/declines.js.map +1 -1
- package/dist/permissions/sight.d.ts +3 -0
- package/dist/permissions/sight.d.ts.map +1 -1
- package/dist/permissions/sight.js.map +1 -1
- package/dist/place-points.d.ts +22 -0
- package/dist/place-points.d.ts.map +1 -0
- package/dist/place-points.js +36 -0
- package/dist/place-points.js.map +1 -0
- package/dist/places.d.ts +33 -0
- package/dist/places.d.ts.map +1 -1
- package/dist/places.js +60 -0
- package/dist/places.js.map +1 -1
- package/dist/publish.d.ts +1 -0
- package/dist/publish.d.ts.map +1 -1
- package/dist/publishing.d.ts +14 -0
- package/dist/publishing.d.ts.map +1 -1
- package/dist/publishing.js +30 -1
- package/dist/publishing.js.map +1 -1
- package/dist/revisions/problems.d.ts +3 -1
- package/dist/revisions/problems.d.ts.map +1 -1
- package/dist/revisions/problems.js +3 -3
- package/dist/revisions/problems.js.map +1 -1
- package/dist/schema/file-fields.d.ts +14 -1
- package/dist/schema/file-fields.d.ts.map +1 -1
- package/dist/schema/file-fields.js +28 -8
- package/dist/schema/file-fields.js.map +1 -1
- package/dist/schema/files.d.ts +64 -0
- package/dist/schema/files.d.ts.map +1 -1
- package/dist/schema/files.js +14 -1
- package/dist/schema/files.js.map +1 -1
- package/dist/schema/geo-field.d.ts +7 -0
- package/dist/schema/geo-field.d.ts.map +1 -0
- package/dist/schema/geo-field.js +19 -0
- package/dist/schema/geo-field.js.map +1 -0
- package/dist/schema/json-schema.d.ts +0 -5
- package/dist/schema/json-schema.d.ts.map +1 -1
- package/dist/schema/json-schema.js +17 -0
- package/dist/schema/json-schema.js.map +1 -1
- package/dist/seen.d.ts.map +1 -1
- package/dist/seen.js +5 -3
- package/dist/seen.js.map +1 -1
- package/dist/store.d.ts +15 -0
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +44 -11
- package/dist/store.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/views/far-kinds.d.ts +51 -0
- package/dist/views/far-kinds.d.ts.map +1 -0
- package/dist/views/far-kinds.js +57 -0
- package/dist/views/far-kinds.js.map +1 -0
- package/dist/views/types.d.ts +22 -0
- package/dist/views/types.d.ts.map +1 -1
- package/dist/views/types.js.map +1 -1
- package/dist/who.js +2 -2
- package/dist/who.js.map +1 -1
- package/dist/words.d.ts +2 -0
- package/dist/words.d.ts.map +1 -1
- package/dist/words.js +2 -0
- package/dist/words.js.map +1 -1
- package/dist/workflow-shape.d.ts +13 -1
- package/dist/workflow-shape.d.ts.map +1 -1
- package/dist/workflow-shape.js.map +1 -1
- package/dist/workflows/findings.d.ts.map +1 -1
- package/dist/workflows/findings.js.map +1 -1
- package/dist/workflows/on-the-map.d.ts +2 -2
- package/dist/workflows/on-the-map.d.ts.map +1 -1
- package/dist/workflows/on-the-map.js +2 -13
- package/dist/workflows/on-the-map.js.map +1 -1
- package/dist/workflows/step-act.js +2 -2
- package/dist/workflows/step-act.js.map +1 -1
- package/dist/workflows/step-publish.d.ts +4 -0
- package/dist/workflows/step-publish.d.ts.map +1 -0
- package/dist/workflows/step-publish.js +41 -0
- package/dist/workflows/step-publish.js.map +1 -0
- package/dist/workflows/steps.d.ts +1 -0
- package/dist/workflows/steps.d.ts.map +1 -1
- package/dist/workflows/steps.js +2 -0
- package/dist/workflows/steps.js.map +1 -1
- package/dist/workflows/world.d.ts +2 -0
- package/dist/workflows/world.d.ts.map +1 -1
- package/dist/workflows/world.js +3 -0
- package/dist/workflows/world.js.map +1 -1
- package/dist/workflows.d.ts +2 -1
- package/dist/workflows.d.ts.map +1 -1
- package/dist/workflows.js +1 -0
- package/dist/workflows.js.map +1 -1
- package/package.json +1 -1
package/dist/store.js
CHANGED
|
@@ -13,7 +13,7 @@ import { LabelIndex, refusalFor } from "./labels.js";
|
|
|
13
13
|
import { heldRefKinds, nodeRefArgs } from "./mutations/node-ref.js";
|
|
14
14
|
import { verifyFold } from "./integrity.js";
|
|
15
15
|
import { evaluate } from "./invariants/engine.js";
|
|
16
|
-
import { compileMutation, mintPersonId } from "./mutations/define-mutation.js";
|
|
16
|
+
import { compileMutation, emptyRecordsLeftOut, mintPersonId } from "./mutations/define-mutation.js";
|
|
17
17
|
import { wouldRun } from "./mutations/would-run.js";
|
|
18
18
|
import { actSpelledAs, nearestAct } from "./mutations/act-spelling.js";
|
|
19
19
|
import { InvalidArguments } from "./mutations/invalid-arguments.js";
|
|
@@ -35,7 +35,7 @@ import { MOST_PROPOSED, PROPOSE_CHANGES, proposeChangesMutation } from "./mutati
|
|
|
35
35
|
import { namesUnseen, redact } from "./ops/withheld.js";
|
|
36
36
|
import { writersBehind } from "./ops/writers.js";
|
|
37
37
|
import { nounOf, withArticle } from "./schema/define-node.js";
|
|
38
|
-
import { behind, fieldsJudged, mayKeepField, partialSight, recordsOf, sees } from "./permissions/sight.js";
|
|
38
|
+
import { behind, FIELD_SIGHT, fieldsJudged, mayKeepField, partialSight, recordsOf, sees } from "./permissions/sight.js";
|
|
39
39
|
import { PermissionDeniedError } from "./permissions/types.js";
|
|
40
40
|
import { checkUndo, UndoBlockedError, undoneInverses, undoPrimitives } from "./ops/undo.js";
|
|
41
41
|
import { validateGraph } from "./validate-graph.js";
|
|
@@ -328,7 +328,8 @@ export class Store {
|
|
|
328
328
|
// A store that knows its app's zone begins on the day there, so the first turn of the day says what it moved.
|
|
329
329
|
if (this.dayTimeZone)
|
|
330
330
|
this.ticked = { day: isoToday(this.dayTimeZone), on: isoToday(this.dayTimeZone) };
|
|
331
|
-
|
|
331
|
+
// Who sees a place sees its point, and no one else (`place-points.ts`, taught to the store by field sight).
|
|
332
|
+
this.policy = FIELD_SIGHT.points?.(options.policy, options.schema) ?? options.policy;
|
|
332
333
|
this.publishing = options.publishing;
|
|
333
334
|
this.tidying = options.tidying;
|
|
334
335
|
this.votes = options.votes;
|
|
@@ -660,7 +661,10 @@ export class Store {
|
|
|
660
661
|
/** A call with its act's name as the store spells it, so the log and every check read the one name. */
|
|
661
662
|
spelledCall(call) {
|
|
662
663
|
const name = this.spelled(call.name);
|
|
663
|
-
|
|
664
|
+
// A record argument the act may go without, sent as "", is no value: never a record looked for (`emptyRecordsLeftOut`).
|
|
665
|
+
const input = this.mutations.get(name)?.input;
|
|
666
|
+
const args = input ? emptyRecordsLeftOut(input, call.args) : call.args;
|
|
667
|
+
return name === call.name && args === call.args ? call : { ...call, name, args };
|
|
664
668
|
}
|
|
665
669
|
/** Off by module, or a derived act of a kind the workspace has off. */
|
|
666
670
|
mutationDisabled(mutation) {
|
|
@@ -747,15 +751,44 @@ export class Store {
|
|
|
747
751
|
* `$me` will be, so it is rehearsed: nothing is kept, and asking makes nobody.
|
|
748
752
|
*/
|
|
749
753
|
if (verdict.ok && this.personFor(principal) && this.policy?.grants.some((grant) => grant.ownEnd)) {
|
|
750
|
-
|
|
754
|
+
const refusal = this.refusedOncePersonMade(call, principal);
|
|
755
|
+
if (refusal)
|
|
756
|
+
return { ok: false, refusal };
|
|
757
|
+
}
|
|
758
|
+
return verdict;
|
|
759
|
+
}
|
|
760
|
+
/**
|
|
761
|
+
* WHAT `apply` REFUSES OF A CALL FOR WHO MAY ONCE A PROFILE'S PERSON IS
|
|
762
|
+
* MADE, telling nobody. Judged on the copy `wouldDo` keeps with the person
|
|
763
|
+
* made (`withPersonMade`), one for every call asked while this store's
|
|
764
|
+
* `version` stands: the several bar asks it of every chosen record for
|
|
765
|
+
* every act, and a copy each was thousands of copies. `apply` asks who may
|
|
766
|
+
* and what an agent was declared able to do again once the person is
|
|
767
|
+
* there, and nothing else it refuses for who may reads that person, so the
|
|
768
|
+
* copy answers as a rehearsal of the call would. The rest is rehearsed
|
|
769
|
+
* whole, as before: a call naming a record made in its own change, a
|
|
770
|
+
* proposal (its calls judged with what they make resolved), the app's own
|
|
771
|
+
* actor (what people said it may not do is judged as its call compiles),
|
|
772
|
+
* and a profile `apply` would not take as given.
|
|
773
|
+
*/
|
|
774
|
+
refusedOncePersonMade(call, principal) {
|
|
775
|
+
const as = withValidProfile(principal);
|
|
776
|
+
try {
|
|
777
|
+
const proposing = this.proposer !== undefined && this.mutations.get(this.spelled(call.name)) === this.proposer;
|
|
778
|
+
if (namesMade(call) || proposing || isAutomated(as) || !this.personFor(as))
|
|
751
779
|
this.rehearsal().applying([call], { author: principal });
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
780
|
+
else {
|
|
781
|
+
const twin = this.withPersonMade(as);
|
|
782
|
+
const spelled = twin.spelledCall(call);
|
|
783
|
+
twin.permittedTo(spelled, as);
|
|
784
|
+
twin.declaredTo(spelled, as);
|
|
756
785
|
}
|
|
757
786
|
}
|
|
758
|
-
|
|
787
|
+
catch (error) {
|
|
788
|
+
if (error instanceof PermissionDeniedError)
|
|
789
|
+
return error.refusal;
|
|
790
|
+
}
|
|
791
|
+
return undefined;
|
|
759
792
|
}
|
|
760
793
|
/** What `permits` answers from the grants alone; on an undo, a call already made, so it asks no record of who took it back. */
|
|
761
794
|
judged(call, principal, undoing = false) {
|
|
@@ -1901,7 +1934,7 @@ export class Store {
|
|
|
1901
1934
|
(permitted(call, as), declared(call, as));
|
|
1902
1935
|
const definition = this.mutation(call.name);
|
|
1903
1936
|
if (definition === this.publisher) {
|
|
1904
|
-
const op = PUBLISHING.op(this, { id: this.nextId(), at: this.now() }, call, batch, as, options);
|
|
1937
|
+
const op = PUBLISHING.op(this, { id: this.nextId(), at: this.now() }, call, batch, as, { ...options, ...given("lineage", lined) });
|
|
1905
1938
|
ops.push(op);
|
|
1906
1939
|
intents.push(op.intent);
|
|
1907
1940
|
continue;
|