@cruba/crubal 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/README.md +30 -2
- package/dist/bin/crubal.js +70 -4
- package/dist/bin/crubal.js.map +1 -1
- package/dist/src/access.d.ts +126 -0
- package/dist/src/access.js +517 -0
- package/dist/src/access.js.map +1 -0
- package/dist/src/arrival.d.ts +55 -0
- package/dist/src/arrival.js +124 -0
- package/dist/src/arrival.js.map +1 -0
- package/dist/src/bundle.d.ts +66 -0
- package/dist/src/bundle.js +753 -0
- package/dist/src/bundle.js.map +1 -0
- package/dist/src/conditions.d.ts +7 -1
- package/dist/src/conditions.js +52 -11
- package/dist/src/conditions.js.map +1 -1
- package/dist/src/corpus.js +568 -34
- package/dist/src/corpus.js.map +1 -1
- package/dist/src/defs.d.ts +37 -2
- package/dist/src/defs.js +95 -14
- package/dist/src/defs.js.map +1 -1
- package/dist/src/dictionary.d.ts +15 -0
- package/dist/src/dictionary.js +72 -13
- package/dist/src/dictionary.js.map +1 -1
- package/dist/src/exchange.d.ts +202 -11
- package/dist/src/exchange.js +759 -45
- package/dist/src/exchange.js.map +1 -1
- package/dist/src/forms.d.ts +16 -0
- package/dist/src/forms.js +169 -0
- package/dist/src/forms.js.map +1 -0
- package/dist/src/index.d.ts +18 -6
- package/dist/src/index.js +17 -5
- package/dist/src/index.js.map +1 -1
- package/dist/src/lifecycle.d.ts +84 -0
- package/dist/src/lifecycle.js +415 -0
- package/dist/src/lifecycle.js.map +1 -0
- package/dist/src/log.d.ts +78 -0
- package/dist/src/log.js +506 -0
- package/dist/src/log.js.map +1 -0
- package/dist/src/migrate.d.ts +24 -1
- package/dist/src/migrate.js +104 -9
- package/dist/src/migrate.js.map +1 -1
- package/dist/src/model.d.ts +33 -1
- package/dist/src/model.js +158 -2
- package/dist/src/model.js.map +1 -1
- package/dist/src/packages.d.ts +44 -0
- package/dist/src/packages.js +137 -3
- package/dist/src/packages.js.map +1 -1
- package/dist/src/print-text.js +22 -0
- package/dist/src/print-text.js.map +1 -1
- package/dist/src/publish.d.ts +27 -0
- package/dist/src/publish.js +275 -0
- package/dist/src/publish.js.map +1 -0
- package/dist/src/read-text.d.ts +2 -0
- package/dist/src/read-text.js +72 -4
- package/dist/src/read-text.js.map +1 -1
- package/dist/src/records.d.ts +31 -0
- package/dist/src/records.js +72 -0
- package/dist/src/records.js.map +1 -0
- package/dist/src/review.d.ts +22 -0
- package/dist/src/review.js +198 -0
- package/dist/src/review.js.map +1 -0
- package/dist/src/rules.d.ts +34 -2
- package/dist/src/rules.js +147 -22
- package/dist/src/rules.js.map +1 -1
- package/dist/src/schedule.d.ts +24 -0
- package/dist/src/schedule.js +126 -0
- package/dist/src/schedule.js.map +1 -0
- package/dist/src/std-packages.d.ts +9 -0
- package/dist/src/std-packages.js +268 -0
- package/dist/src/std-packages.js.map +1 -0
- package/dist/src/store.d.ts +38 -7
- package/dist/src/store.js +166 -24
- package/dist/src/store.js.map +1 -1
- package/dist/src/tree.d.ts +3 -0
- package/dist/src/tree.js +36 -0
- package/dist/src/tree.js.map +1 -1
- package/dist/src/units-table.d.ts +1 -0
- package/dist/src/units-table.js +200 -0
- package/dist/src/units-table.js.map +1 -0
- package/dist/src/units.d.ts +42 -4
- package/dist/src/units.js +91 -30
- package/dist/src/units.js.map +1 -1
- package/dist/src/views.d.ts +108 -6
- package/dist/src/views.js +389 -64
- package/dist/src/views.js.map +1 -1
- package/package.json +5 -3
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
// schedule.ts: scheduled triggers (spec 7.11). A schedule is a contract's `when`: `every day at 03:00`,
|
|
2
|
+
// `every hour`, `every 15 minutes`, `every monday at 09:00`, `every month on 1 at 00:00`, with an optional
|
|
3
|
+
// zone on the time of day. Ticks are computed from the schedule and the caller's `now`, never remembered by
|
|
4
|
+
// a clock, so every store agrees on them.
|
|
5
|
+
import { CrubalError } from "./tree.js";
|
|
6
|
+
const WEEKDAYS = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"];
|
|
7
|
+
export function isSchedule(when) {
|
|
8
|
+
return !!when && /^every /.test(when.trim());
|
|
9
|
+
}
|
|
10
|
+
/** Read a schedule, or refuse it in plain words. */
|
|
11
|
+
export function readSchedule(text, line) {
|
|
12
|
+
let s = text.trim();
|
|
13
|
+
let zone;
|
|
14
|
+
const z = s.match(/\s*\[zone: ([^\]]+)\]$/);
|
|
15
|
+
if (z) {
|
|
16
|
+
zone = z[1].trim();
|
|
17
|
+
s = s.slice(0, z.index).trim();
|
|
18
|
+
}
|
|
19
|
+
const base = { text: text.trim(), ...(zone ? { zone } : {}) };
|
|
20
|
+
let m = s.match(/^every (\d+) (minutes?|hours?)$/);
|
|
21
|
+
if (m) {
|
|
22
|
+
const every = Number(m[1]);
|
|
23
|
+
if (every < 1)
|
|
24
|
+
throw new CrubalError(`a schedule repeats at least every 1: ${text}`, line);
|
|
25
|
+
return { ...base, unit: m[2].startsWith("minute") ? "minutes" : "hours", every, minute: 0 };
|
|
26
|
+
}
|
|
27
|
+
m = s.match(/^every (minute|hour)$/);
|
|
28
|
+
if (m)
|
|
29
|
+
return { ...base, unit: m[1] === "minute" ? "minutes" : "hours", every: 1, minute: 0 };
|
|
30
|
+
const time = (t) => {
|
|
31
|
+
const tm = (t ?? "00:00").match(/^(\d{2}):(\d{2})$/);
|
|
32
|
+
if (!tm || Number(tm[1]) > 23 || Number(tm[2]) > 59)
|
|
33
|
+
throw new CrubalError(`a time of day is hh:mm: ${text}`, line);
|
|
34
|
+
return Number(tm[1]) * 60 + Number(tm[2]);
|
|
35
|
+
};
|
|
36
|
+
m = s.match(/^every day(?: at (\S+))?$/);
|
|
37
|
+
if (m)
|
|
38
|
+
return { ...base, unit: "day", every: 1, minute: time(m[1]) };
|
|
39
|
+
m = s.match(/^every (sunday|monday|tuesday|wednesday|thursday|friday|saturday)(?: at (\S+))?$/);
|
|
40
|
+
if (m)
|
|
41
|
+
return { ...base, unit: "week", every: 1, minute: time(m[2]), weekday: WEEKDAYS.indexOf(m[1]) };
|
|
42
|
+
m = s.match(/^every month on (\d{1,2})(?: at (\S+))?$/);
|
|
43
|
+
if (m) {
|
|
44
|
+
const d = Number(m[1]);
|
|
45
|
+
if (d < 1 || d > 28)
|
|
46
|
+
throw new CrubalError(`a monthly schedule names a day from 1 to 28, so every month has it: ${text}`, line);
|
|
47
|
+
return { ...base, unit: "month", every: 1, minute: time(m[2]), monthday: d };
|
|
48
|
+
}
|
|
49
|
+
throw new CrubalError(`can't read the schedule "${text}": every N minutes|hours, every day at hh:mm, every <weekday> at hh:mm, every month on D at hh:mm`, line);
|
|
50
|
+
}
|
|
51
|
+
const MIN = 60_000;
|
|
52
|
+
/** The wall-clock parts of an instant in a zone. */
|
|
53
|
+
function partsIn(ms, zone) {
|
|
54
|
+
const dt = new Date(ms);
|
|
55
|
+
if (!zone)
|
|
56
|
+
return { y: dt.getUTCFullYear(), mo: dt.getUTCMonth() + 1, d: dt.getUTCDate(), h: dt.getUTCHours(), mi: dt.getUTCMinutes(), wd: dt.getUTCDay() };
|
|
57
|
+
const f = new Intl.DateTimeFormat("en-US", { timeZone: zone, hourCycle: "h23", year: "numeric", month: "numeric", day: "numeric", hour: "numeric", minute: "numeric", weekday: "short" });
|
|
58
|
+
const p = {};
|
|
59
|
+
for (const x of f.formatToParts(dt))
|
|
60
|
+
p[x.type] = x.value;
|
|
61
|
+
return { y: Number(p.year), mo: Number(p.month), d: Number(p.day), h: Number(p.hour), mi: Number(p.minute), wd: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"].indexOf(p.weekday ?? "Sun") };
|
|
62
|
+
}
|
|
63
|
+
/** The instant of a wall-clock date and minute in a zone (UTC when none). */
|
|
64
|
+
function instantOf(y, mo, d, minute, zone) {
|
|
65
|
+
const guess = Date.UTC(y, mo - 1, d, Math.floor(minute / 60), minute % 60);
|
|
66
|
+
if (!zone)
|
|
67
|
+
return guess;
|
|
68
|
+
// Correct the UTC guess by the zone's offset at that moment (one more pass settles a DST edge).
|
|
69
|
+
let ms = guess;
|
|
70
|
+
for (let i = 0; i < 2; i++) {
|
|
71
|
+
const p = partsIn(ms, zone);
|
|
72
|
+
const local = Date.UTC(p.y, p.mo - 1, p.d, p.h, p.mi);
|
|
73
|
+
ms += guess - local;
|
|
74
|
+
}
|
|
75
|
+
return ms;
|
|
76
|
+
}
|
|
77
|
+
export function moment(ms) {
|
|
78
|
+
return new Date(ms).toISOString().replace(/:00\.000Z$/, "Z").replace(/\.000Z$/, "Z");
|
|
79
|
+
}
|
|
80
|
+
export function instant(s) {
|
|
81
|
+
const ms = Date.parse(s);
|
|
82
|
+
if (Number.isNaN(ms))
|
|
83
|
+
throw new CrubalError(`not a moment: ${s}`);
|
|
84
|
+
return ms;
|
|
85
|
+
}
|
|
86
|
+
/** The first tick strictly after `after` (a moment). */
|
|
87
|
+
export function nextTick(sch, after) {
|
|
88
|
+
const a = instant(after);
|
|
89
|
+
if (sch.unit === "minutes" || sch.unit === "hours") {
|
|
90
|
+
const step = sch.every * (sch.unit === "minutes" ? MIN : 60 * MIN);
|
|
91
|
+
return moment((Math.floor(a / step) + 1) * step);
|
|
92
|
+
}
|
|
93
|
+
const p = partsIn(a, sch.zone);
|
|
94
|
+
for (let i = 0; i < 400; i++) {
|
|
95
|
+
const day = new Date(Date.UTC(p.y, p.mo - 1, p.d + i));
|
|
96
|
+
const y = day.getUTCFullYear();
|
|
97
|
+
const mo = day.getUTCMonth() + 1;
|
|
98
|
+
const d = day.getUTCDate();
|
|
99
|
+
const wd = day.getUTCDay();
|
|
100
|
+
if (sch.unit === "week" && wd !== sch.weekday)
|
|
101
|
+
continue;
|
|
102
|
+
if (sch.unit === "month" && d !== sch.monthday)
|
|
103
|
+
continue;
|
|
104
|
+
const t = instantOf(y, mo, d, sch.minute, sch.zone);
|
|
105
|
+
if (t > a)
|
|
106
|
+
return moment(t);
|
|
107
|
+
}
|
|
108
|
+
throw new CrubalError(`no tick of "${sch.text}" within 400 days of ${after}`);
|
|
109
|
+
}
|
|
110
|
+
/** Every tick after `after` and at or before `now`, in order. With no `after` the schedule hasn't begun: none. */
|
|
111
|
+
export function ticksDue(sch, after, now) {
|
|
112
|
+
const out = [];
|
|
113
|
+
if (after === undefined)
|
|
114
|
+
return out;
|
|
115
|
+
let cur = after;
|
|
116
|
+
const end = instant(now);
|
|
117
|
+
for (let i = 0; i < 100_000; i++) {
|
|
118
|
+
const t = nextTick(sch, cur);
|
|
119
|
+
if (instant(t) > end)
|
|
120
|
+
break;
|
|
121
|
+
out.push(t);
|
|
122
|
+
cur = t;
|
|
123
|
+
}
|
|
124
|
+
return out;
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=schedule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schedule.js","sourceRoot":"","sources":["../../src/schedule.ts"],"names":[],"mappings":"AAAA,wGAAwG;AACxG,2GAA2G;AAC3G,4GAA4G;AAC5G,0CAA0C;AAE1C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAkBxC,MAAM,QAAQ,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;AAEhG,MAAM,UAAU,UAAU,CAAC,IAAwB;IACjD,OAAO,CAAC,CAAC,IAAI,IAAI,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;AAC/C,CAAC;AAED,oDAAoD;AACpD,MAAM,UAAU,YAAY,CAAC,IAAY,EAAE,IAAa;IACtD,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IACpB,IAAI,IAAwB,CAAC;IAC7B,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC5C,IAAI,CAAC,EAAE,CAAC;QACN,IAAI,GAAI,CAAC,CAAC,CAAC,CAAY,CAAC,IAAI,EA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,CAAC;QACZ,GAAG,GAAG,CAAC,CAAC;IACV,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Dictionary } from "./defs.ts";
|
|
2
|
+
/** The standard packages' text, by name: core, units and party. */
|
|
3
|
+
export declare const STANDARD_PACKAGES: {
|
|
4
|
+
readonly core: string;
|
|
5
|
+
readonly units: string;
|
|
6
|
+
readonly party: string;
|
|
7
|
+
};
|
|
8
|
+
/** A dictionary holding the three standard packages' definitions, to read an adopter's packages onto. */
|
|
9
|
+
export declare function standardDefinitions(into?: Dictionary): Dictionary;
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
// std-packages.ts: the text of the standard packages (spec 11.7), as published in std/. Generated by
|
|
2
|
+
// `npm run embed` in packages/crubal; a test refuses a copy that has drifted from the files. An adopter reads
|
|
3
|
+
// these into a dictionary before its own packages, as a publish does (11.4).
|
|
4
|
+
import { emptyDictionary, readDefinitions } from "./defs.js";
|
|
5
|
+
/** The standard packages' text, by name: core, units and party. */
|
|
6
|
+
export const STANDARD_PACKAGES = {
|
|
7
|
+
core: `// crubal.com/core: the core's own names (chapter 11.7). The envelope lines, origins and audiences are fixed
|
|
8
|
+
// by the specification; the facets below are the core facets every package may use as crubal:<name>.
|
|
9
|
+
package: core /2026-10-14
|
|
10
|
+
owner: crubal.com
|
|
11
|
+
label: CRUBAL core
|
|
12
|
+
crubal: 2
|
|
13
|
+
licence: CC-BY-4.0
|
|
14
|
+
|
|
15
|
+
facet: notables
|
|
16
|
+
type: compound
|
|
17
|
+
pick: any
|
|
18
|
+
label: Notables
|
|
19
|
+
describe: Facts true of this one record that no class asks for: signed, misprint, edition number. A key that recurs across enough records is proposed as a facet (chapter 9.5).
|
|
20
|
+
facets:
|
|
21
|
+
key$80
|
|
22
|
+
value$
|
|
23
|
+
|
|
24
|
+
facet: count
|
|
25
|
+
type: number
|
|
26
|
+
label: Count
|
|
27
|
+
describe: How many identical things a fungible part holds (chapter 5.6).
|
|
28
|
+
|
|
29
|
+
facet: items
|
|
30
|
+
type: link
|
|
31
|
+
pick: any
|
|
32
|
+
ordered: yes
|
|
33
|
+
label: Items
|
|
34
|
+
describe: The records a hand-made list holds, in its order (chapter 12.2). A view shows the list with select: list.
|
|
35
|
+
|
|
36
|
+
facet: clonedFrom
|
|
37
|
+
type: link
|
|
38
|
+
label: Cloned from
|
|
39
|
+
describe: The record this one was adopted from, when a whole record was made one's own (chapter 8.2).
|
|
40
|
+
`,
|
|
41
|
+
units: `// crubal.com/units: the units table (chapter 1.4.3, 11.9). Units are reference records of the kind "measure";
|
|
42
|
+
// currencies are records of the kind "currency". Readers fold the spellings and convert within a dimension.
|
|
43
|
+
package: units /2026-10-15
|
|
44
|
+
owner: crubal.com
|
|
45
|
+
label: Units and currencies
|
|
46
|
+
crubal: 2
|
|
47
|
+
licence: CC-BY-4.0
|
|
48
|
+
|
|
49
|
+
kind: measure
|
|
50
|
+
levels: measure
|
|
51
|
+
base: Measure
|
|
52
|
+
|
|
53
|
+
kind: currency
|
|
54
|
+
levels: currency
|
|
55
|
+
base: Currency
|
|
56
|
+
|
|
57
|
+
facet: dimension
|
|
58
|
+
type: choice
|
|
59
|
+
values: time, length, mass, volume, area, temperature, data, count
|
|
60
|
+
describe: The dimension a unit measures; units convert only within one. The list grows by versions of this package.
|
|
61
|
+
|
|
62
|
+
facet: factor
|
|
63
|
+
type: number
|
|
64
|
+
describe: How many of the dimension's base unit one of this unit is (s, m, kg, L, m2, K, B, each).
|
|
65
|
+
|
|
66
|
+
facet: offset
|
|
67
|
+
type: number
|
|
68
|
+
describe: For a unit whose zero isn't the base's (°C, °F): the base-unit amount at this unit's zero. An amount in base units is amount × factor + offset.
|
|
69
|
+
|
|
70
|
+
facet: spellings
|
|
71
|
+
type: text
|
|
72
|
+
pick: any
|
|
73
|
+
describe: Other ways intake may write this unit; folded case-insensitively.
|
|
74
|
+
|
|
75
|
+
facet: uncefact
|
|
76
|
+
type: text
|
|
77
|
+
label: UN/CEFACT code
|
|
78
|
+
describe: The unit's UN/CEFACT Recommendation 20 code, for borders that use it. Never a spelling.
|
|
79
|
+
|
|
80
|
+
facet: rounding
|
|
81
|
+
type: number
|
|
82
|
+
describe: On a dimension's base unit record: the decimal places a conversion keeps when the facet states none.
|
|
83
|
+
|
|
84
|
+
facet: places
|
|
85
|
+
type: number
|
|
86
|
+
describe: A currency's decimal places (ISO 4217 minor units).
|
|
87
|
+
|
|
88
|
+
facet: name
|
|
89
|
+
type: text
|
|
90
|
+
|
|
91
|
+
class: Measure
|
|
92
|
+
for: measure
|
|
93
|
+
facets:
|
|
94
|
+
!dimension
|
|
95
|
+
!factor
|
|
96
|
+
offset
|
|
97
|
+
rounding
|
|
98
|
+
spellings
|
|
99
|
+
uncefact
|
|
100
|
+
|
|
101
|
+
class: Currency
|
|
102
|
+
for: currency
|
|
103
|
+
facets:
|
|
104
|
+
!name
|
|
105
|
+
!places
|
|
106
|
+
`,
|
|
107
|
+
party: `// crubal.com/party: who acts. The three caller kinds, what any adopter needs of them, and the facets that
|
|
108
|
+
// access reads. Authentication stays in the host; roles and presets stay in the adopter's package.
|
|
109
|
+
package: party /2026-10-16
|
|
110
|
+
owner: crubal.com
|
|
111
|
+
label: Parties
|
|
112
|
+
crubal: 2
|
|
113
|
+
licence: CC-BY-4.0
|
|
114
|
+
prefixes:
|
|
115
|
+
schema: https://schema.org/
|
|
116
|
+
|
|
117
|
+
kind: person
|
|
118
|
+
levels: person
|
|
119
|
+
base: Person
|
|
120
|
+
schema:
|
|
121
|
+
person: schema:Person
|
|
122
|
+
kind: organization
|
|
123
|
+
levels: organization
|
|
124
|
+
base: Organization
|
|
125
|
+
schema:
|
|
126
|
+
organization: schema:Organization
|
|
127
|
+
kind: system
|
|
128
|
+
levels: system
|
|
129
|
+
base: System
|
|
130
|
+
schema:
|
|
131
|
+
system: schema:SoftwareApplication
|
|
132
|
+
|
|
133
|
+
// Any party
|
|
134
|
+
!name$200 =schema:name
|
|
135
|
+
image^ =schema:image
|
|
136
|
+
url$ =schema:url
|
|
137
|
+
email$ =schema:email
|
|
138
|
+
phone$ =schema:telephone
|
|
139
|
+
description$ =schema:description
|
|
140
|
+
roles&role*
|
|
141
|
+
memberOf&organization* =schema:memberOf
|
|
142
|
+
|
|
143
|
+
// People
|
|
144
|
+
givenName$ =schema:givenName
|
|
145
|
+
familyName$ =schema:familyName
|
|
146
|
+
locale$ // BCP 47: en-GB
|
|
147
|
+
timezone$ // IANA: Europe/London
|
|
148
|
+
signedUp@ymdhm
|
|
149
|
+
|
|
150
|
+
// Organizations
|
|
151
|
+
legalName$ =schema:legalName
|
|
152
|
+
domain$ unique // the owner domain when the organization is one
|
|
153
|
+
taxId$ =schema:taxID
|
|
154
|
+
facet: address
|
|
155
|
+
type: compound
|
|
156
|
+
same-as: schema:address
|
|
157
|
+
facets:
|
|
158
|
+
street$ =schema:streetAddress
|
|
159
|
+
locality$ =schema:addressLocality
|
|
160
|
+
region$ =schema:addressRegion
|
|
161
|
+
postalCode$ =schema:postalCode
|
|
162
|
+
country$ =schema:addressCountry // ISO 3166-1 alpha-2
|
|
163
|
+
|
|
164
|
+
// Systems
|
|
165
|
+
operator&organization // who runs it
|
|
166
|
+
systemKind{utility|partner|agent}
|
|
167
|
+
scheme{oauth2|apikey|basic|none}
|
|
168
|
+
scopes$* // what was granted
|
|
169
|
+
requests$* // the menu items it asked for (14.9)
|
|
170
|
+
connection{connected|expired|revoked}
|
|
171
|
+
connectedAt@ymdhm
|
|
172
|
+
version$
|
|
173
|
+
|
|
174
|
+
class: Person
|
|
175
|
+
for: person
|
|
176
|
+
facets:
|
|
177
|
+
!name
|
|
178
|
+
givenName
|
|
179
|
+
familyName
|
|
180
|
+
image
|
|
181
|
+
email
|
|
182
|
+
phone
|
|
183
|
+
locale
|
|
184
|
+
timezone
|
|
185
|
+
roles
|
|
186
|
+
memberOf
|
|
187
|
+
signedUp
|
|
188
|
+
class: Organization
|
|
189
|
+
for: organization
|
|
190
|
+
facets:
|
|
191
|
+
!name
|
|
192
|
+
legalName
|
|
193
|
+
domain
|
|
194
|
+
url
|
|
195
|
+
email
|
|
196
|
+
phone
|
|
197
|
+
address
|
|
198
|
+
image
|
|
199
|
+
description
|
|
200
|
+
taxId
|
|
201
|
+
class: System
|
|
202
|
+
for: system
|
|
203
|
+
facets:
|
|
204
|
+
!name
|
|
205
|
+
operator
|
|
206
|
+
systemKind
|
|
207
|
+
url
|
|
208
|
+
scheme
|
|
209
|
+
scopes
|
|
210
|
+
requests
|
|
211
|
+
connection
|
|
212
|
+
connectedAt
|
|
213
|
+
version
|
|
214
|
+
roles
|
|
215
|
+
|
|
216
|
+
// Contact details and tax identity are for the owner's people, never for the public or other members.
|
|
217
|
+
rule: emailIsPrivate
|
|
218
|
+
for: everywhere
|
|
219
|
+
strength: must
|
|
220
|
+
then: email shown to staff
|
|
221
|
+
rule: phoneIsPrivate
|
|
222
|
+
for: everywhere
|
|
223
|
+
strength: must
|
|
224
|
+
then: phone shown to staff
|
|
225
|
+
rule: addressIsPrivate
|
|
226
|
+
for: everywhere
|
|
227
|
+
strength: must
|
|
228
|
+
then: address shown to staff
|
|
229
|
+
rule: taxIdIsPrivate
|
|
230
|
+
for: everywhere
|
|
231
|
+
strength: must
|
|
232
|
+
then: taxId shown to staff
|
|
233
|
+
|
|
234
|
+
// The host writes the connection through this form (host.md). The form is the party package's so every host
|
|
235
|
+
// writes the same record; the edge that grants what the system asked for is the adopter's (14.9).
|
|
236
|
+
contract: connect
|
|
237
|
+
kind: form
|
|
238
|
+
origin: observed
|
|
239
|
+
needs:
|
|
240
|
+
!name
|
|
241
|
+
scheme
|
|
242
|
+
scopes
|
|
243
|
+
requests
|
|
244
|
+
connection
|
|
245
|
+
connectedAt
|
|
246
|
+
|
|
247
|
+
// A person keeps their own details. Who may run it is the adopter's edge (consume on their own record).
|
|
248
|
+
contract: profile
|
|
249
|
+
kind: form
|
|
250
|
+
origin: declared
|
|
251
|
+
needs:
|
|
252
|
+
!name
|
|
253
|
+
givenName
|
|
254
|
+
familyName
|
|
255
|
+
image
|
|
256
|
+
email
|
|
257
|
+
phone
|
|
258
|
+
locale
|
|
259
|
+
timezone
|
|
260
|
+
`,
|
|
261
|
+
};
|
|
262
|
+
/** A dictionary holding the three standard packages' definitions, to read an adopter's packages onto. */
|
|
263
|
+
export function standardDefinitions(into = emptyDictionary()) {
|
|
264
|
+
for (const text of [STANDARD_PACKAGES.core, STANDARD_PACKAGES.units, STANDARD_PACKAGES.party])
|
|
265
|
+
readDefinitions(text, into);
|
|
266
|
+
return into;
|
|
267
|
+
}
|
|
268
|
+
//# sourceMappingURL=std-packages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"std-packages.js","sourceRoot":"","sources":["../../src/std-packages.ts"],"names":[],"mappings":"AAAA,qGAAqG;AACrG,8GAA8G;AAC9G,6EAA6E;AAE7E,OAAO,EAAmB,eAAe,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE9E,mEAAmE;AACnE,MAAM,CAAC,MAAM,iBAAiB,GAA8E;IAC1G,IAAI,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCP;IACC,KAAK,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiER;IACC,KAAK,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyJR;CACA,CAAC;AAEF,yGAAyG;AACzG,MAAM,UAAU,mBAAmB,CAAC,OAAmB,eAAe,EAAE;IACtE,KAAK,MAAM,IAAI,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,CAAC,KAAK,EAAE,iBAAiB,CAAC,KAAK,CAAC;QAAE,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC3H,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/src/store.d.ts
CHANGED
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
import { type ClassLine, type Dictionary } from "./defs.ts";
|
|
2
2
|
import type { Json, JsonObject, Record, Source } from "./model.ts";
|
|
3
3
|
export declare function sha256(text: string): string;
|
|
4
|
-
/**
|
|
4
|
+
/** A write's hash: SHA-256 of its canonical form; a redacted write's hash is what it carries (8.5.2). */
|
|
5
|
+
export declare function writeHash(w: Json): string;
|
|
6
|
+
/**
|
|
7
|
+
* An entry's hash (8.5): SHA-256 of its canonical form without `sig`, each write replaced by `sha256:` and
|
|
8
|
+
* its own hash, so a redacted write leaves the entry's hash where it was. A redacted entry's hash is what it
|
|
9
|
+
* carries.
|
|
10
|
+
*/
|
|
5
11
|
export declare function entryHash(entry: JsonObject): string;
|
|
6
12
|
/** Published keys by owner domain: `{ "test.example": { "alg": "Ed25519", "public": "<base64url>" } }`. */
|
|
13
|
+
/** A published signing key (11.7): with `from` and `until` when it was rotated, so it still verifies what it signed. */
|
|
14
|
+
export type Key = {
|
|
15
|
+
alg: string;
|
|
16
|
+
public: string;
|
|
17
|
+
from?: string;
|
|
18
|
+
until?: string;
|
|
19
|
+
};
|
|
7
20
|
export type Keys = {
|
|
8
|
-
[owner: string]:
|
|
9
|
-
alg: string;
|
|
10
|
-
public: string;
|
|
11
|
-
};
|
|
21
|
+
[owner: string]: Key | Key[];
|
|
12
22
|
};
|
|
23
|
+
/** The owner's key in force at a moment: the one whose span holds `at`, else an undated one, else the latest. */
|
|
24
|
+
export declare function keyFor(keys: Keys, owner: string, at?: string): Key | undefined;
|
|
13
25
|
/** Does `sig` (base64url) verify over the entry's hash bytes with the owner's Ed25519 key? */
|
|
14
26
|
export declare function verifySig(entry: JsonObject, owner: string, keys: Keys): boolean;
|
|
15
27
|
/** Check a chain's links, and, when the owner's key is known, every entry's signature (8.5). */
|
|
@@ -32,6 +44,12 @@ export type Contract = {
|
|
|
32
44
|
prefix?: string;
|
|
33
45
|
reads: MapLine[];
|
|
34
46
|
writes: MapLine[];
|
|
47
|
+
/** A store contract's one map (7.3): `reads` and `writes` are derived from it. */
|
|
48
|
+
stores: MapLine[];
|
|
49
|
+
/** An offer's terms (7.8): reshare, expires, revocable, and what else the package names. */
|
|
50
|
+
terms: {
|
|
51
|
+
[term: string]: string;
|
|
52
|
+
};
|
|
35
53
|
ignore: string[];
|
|
36
54
|
keepRaw: string[];
|
|
37
55
|
absorb: boolean;
|
|
@@ -46,6 +64,10 @@ export type Contract = {
|
|
|
46
64
|
to?: string;
|
|
47
65
|
mode?: string;
|
|
48
66
|
undo?: string;
|
|
67
|
+
/** The field of their payload that is their own ID for the thing (9.2a). */
|
|
68
|
+
ref?: string;
|
|
69
|
+
/** For a send contract that carries projection streams (12.6.2): the views. */
|
|
70
|
+
stream: string[];
|
|
49
71
|
/** Every part as written, with its line, for the publish checks. */
|
|
50
72
|
parts: {
|
|
51
73
|
[k: string]: string;
|
|
@@ -112,8 +134,11 @@ export type Who = {
|
|
|
112
134
|
*/
|
|
113
135
|
export declare function land(r: Record, intake: {
|
|
114
136
|
outcomes: IntakeOutcome[];
|
|
115
|
-
contract?: string;
|
|
116
|
-
|
|
137
|
+
contract?: string; /** a person's write through a form (11.3): ranks as `person` */
|
|
138
|
+
person?: boolean;
|
|
139
|
+
}, source: Source, trust?: string[], facetTrust?: Map<string, string[]>,
|
|
140
|
+
/** The facets declared `transitions: yes` (4.2): a later value of equal or higher trust replaces, never conflicts. */
|
|
141
|
+
transitions?: Set<string>): Record;
|
|
117
142
|
export type PartMatch = {
|
|
118
143
|
parts: JsonObject[];
|
|
119
144
|
review: JsonObject[];
|
|
@@ -131,3 +156,9 @@ export type Observation = JsonObject & {
|
|
|
131
156
|
};
|
|
132
157
|
/** Validate a value from observations: independent witnesses for and against, vetoes, and the state. */
|
|
133
158
|
export declare function validate(r: Record, address: string, observations: Observation[], confirmAt?: number, splitAt?: number): JsonObject;
|
|
159
|
+
/**
|
|
160
|
+
* Version splits proposed (9.7.3): for each value an address's observations contradict, a cluster of at
|
|
161
|
+
* least `splitAt` instances agreeing with each other is a review item `split:<record>`; nothing splits
|
|
162
|
+
* on its own.
|
|
163
|
+
*/
|
|
164
|
+
export declare function proposeSplit(records: Record[], observations: Observation[], splitAt?: number): JsonObject[];
|