@haverstack/core 0.42.0 → 0.44.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 +6 -9
- package/dist/access.d.ts +36 -34
- package/dist/access.d.ts.map +1 -1
- package/dist/access.js +51 -100
- package/dist/access.js.map +1 -1
- package/dist/adapter/combine.d.ts.map +1 -1
- package/dist/adapter/combine.js +14 -7
- package/dist/adapter/combine.js.map +1 -1
- package/dist/adapter/copy.d.ts +27 -0
- package/dist/adapter/copy.d.ts.map +1 -0
- package/dist/adapter/copy.js +105 -0
- package/dist/adapter/copy.js.map +1 -0
- package/dist/adapter/index.d.ts +9 -4
- package/dist/adapter/index.d.ts.map +1 -1
- package/dist/adapter/index.js +6 -3
- package/dist/adapter/index.js.map +1 -1
- package/dist/adapter/reach.d.ts +14 -0
- package/dist/adapter/reach.d.ts.map +1 -0
- package/dist/adapter/reach.js +31 -0
- package/dist/adapter/reach.js.map +1 -0
- package/dist/adapter/seed.d.ts +13 -0
- package/dist/adapter/seed.d.ts.map +1 -0
- package/dist/adapter/seed.js +26 -0
- package/dist/adapter/seed.js.map +1 -0
- package/dist/associations/identity.d.ts +18 -42
- package/dist/associations/identity.d.ts.map +1 -1
- package/dist/associations/identity.js +60 -84
- package/dist/associations/identity.js.map +1 -1
- package/dist/associations/validation.d.ts +1 -8
- package/dist/associations/validation.d.ts.map +1 -1
- package/dist/associations/validation.js +3 -30
- package/dist/associations/validation.js.map +1 -1
- package/dist/collection.d.ts +7 -11
- package/dist/collection.d.ts.map +1 -1
- package/dist/collection.js +24 -34
- package/dist/collection.js.map +1 -1
- package/dist/content-match.d.ts +2 -2
- package/dist/content-match.js +2 -2
- package/dist/errors.d.ts +41 -12
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +56 -15
- package/dist/errors.js.map +1 -1
- package/dist/grants.d.ts +18 -6
- package/dist/grants.d.ts.map +1 -1
- package/dist/grants.js +48 -37
- package/dist/grants.js.map +1 -1
- package/dist/hash.d.ts +8 -0
- package/dist/hash.d.ts.map +1 -0
- package/dist/hash.js +14 -0
- package/dist/hash.js.map +1 -0
- package/dist/index.d.ts +6 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/install.d.ts +29 -5
- package/dist/install.d.ts.map +1 -1
- package/dist/install.js +69 -44
- package/dist/install.js.map +1 -1
- package/dist/lazy.d.ts +13 -0
- package/dist/lazy.d.ts.map +1 -0
- package/dist/lazy.js +27 -0
- package/dist/lazy.js.map +1 -0
- package/dist/merge.d.ts +1 -1
- package/dist/merge.js +1 -1
- package/dist/query-validation.d.ts +41 -28
- package/dist/query-validation.d.ts.map +1 -1
- package/dist/query-validation.js +85 -71
- package/dist/query-validation.js.map +1 -1
- package/dist/record-changes.d.ts +12 -36
- package/dist/record-changes.d.ts.map +1 -1
- package/dist/record-changes.js +9 -98
- package/dist/record-changes.js.map +1 -1
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +2 -5
- package/dist/schema.js.map +1 -1
- package/dist/scoped-stack/authority-snapshot.d.ts +37 -0
- package/dist/scoped-stack/authority-snapshot.d.ts.map +1 -0
- package/dist/scoped-stack/authority-snapshot.js +49 -0
- package/dist/scoped-stack/authority-snapshot.js.map +1 -0
- package/dist/scoped-stack/authority.d.ts +69 -51
- package/dist/scoped-stack/authority.d.ts.map +1 -1
- package/dist/scoped-stack/authority.js +189 -153
- package/dist/scoped-stack/authority.js.map +1 -1
- package/dist/scoped-stack/family-policy.d.ts +59 -0
- package/dist/scoped-stack/family-policy.d.ts.map +1 -0
- package/dist/scoped-stack/family-policy.js +68 -0
- package/dist/scoped-stack/family-policy.js.map +1 -0
- package/dist/scoped-stack/scoped-stack.d.ts +73 -86
- package/dist/scoped-stack/scoped-stack.d.ts.map +1 -1
- package/dist/scoped-stack/scoped-stack.js +279 -337
- package/dist/scoped-stack/scoped-stack.js.map +1 -1
- package/dist/scoped-stack/subscription.d.ts +14 -33
- package/dist/scoped-stack/subscription.d.ts.map +1 -1
- package/dist/scoped-stack/subscription.js +16 -57
- package/dist/scoped-stack/subscription.js.map +1 -1
- package/dist/stack/arguments.d.ts +27 -0
- package/dist/stack/arguments.d.ts.map +1 -0
- package/dist/stack/arguments.js +53 -0
- package/dist/stack/arguments.js.map +1 -0
- package/dist/stack/attachments.d.ts +1 -1
- package/dist/stack/attachments.js +1 -1
- package/dist/stack/changes.d.ts +4 -10
- package/dist/stack/changes.d.ts.map +1 -1
- package/dist/stack/changes.js +8 -8
- package/dist/stack/changes.js.map +1 -1
- package/dist/stack/client.d.ts +34 -58
- package/dist/stack/client.d.ts.map +1 -1
- package/dist/stack/field-rules.d.ts +27 -0
- package/dist/stack/field-rules.d.ts.map +1 -0
- package/dist/stack/field-rules.js +50 -0
- package/dist/stack/field-rules.js.map +1 -0
- package/dist/stack/install-app.d.ts +2 -2
- package/dist/stack/install-app.d.ts.map +1 -1
- package/dist/stack/install-app.js +16 -14
- package/dist/stack/install-app.js.map +1 -1
- package/dist/stack/integrity.d.ts +9 -53
- package/dist/stack/integrity.d.ts.map +1 -1
- package/dist/stack/integrity.js +47 -107
- package/dist/stack/integrity.js.map +1 -1
- package/dist/stack/limits.d.ts +1 -1
- package/dist/stack/limits.js +1 -1
- package/dist/stack/reads.d.ts +9 -5
- package/dist/stack/reads.d.ts.map +1 -1
- package/dist/stack/reads.js +24 -4
- package/dist/stack/reads.js.map +1 -1
- package/dist/stack/stack.d.ts +84 -79
- package/dist/stack/stack.d.ts.map +1 -1
- package/dist/stack/stack.js +236 -306
- package/dist/stack/stack.js.map +1 -1
- package/dist/stack/system-types.d.ts.map +1 -1
- package/dist/stack/system-types.js +1 -3
- package/dist/stack/system-types.js.map +1 -1
- package/dist/stack/type-grants.d.ts.map +1 -1
- package/dist/stack/type-grants.js +9 -6
- package/dist/stack/type-grants.js.map +1 -1
- package/dist/stack/write-expectation.d.ts +13 -12
- package/dist/stack/write-expectation.d.ts.map +1 -1
- package/dist/stack/write-expectation.js.map +1 -1
- package/dist/stack/write-gate.d.ts +23 -0
- package/dist/stack/write-gate.d.ts.map +1 -0
- package/dist/stack/write-gate.js +17 -0
- package/dist/stack/write-gate.js.map +1 -0
- package/dist/testing.d.ts +37 -24
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +176 -153
- package/dist/testing.js.map +1 -1
- package/dist/types/adapter.d.ts +115 -43
- package/dist/types/adapter.d.ts.map +1 -1
- package/dist/types/associations.d.ts +1 -17
- package/dist/types/associations.d.ts.map +1 -1
- package/dist/types/associations.js +1 -8
- package/dist/types/associations.js.map +1 -1
- package/dist/types/capabilities.d.ts +8 -8
- package/dist/types/capabilities.d.ts.map +1 -1
- package/dist/types/events.d.ts +3 -8
- package/dist/types/events.d.ts.map +1 -1
- package/dist/types/query.d.ts +4 -4
- package/dist/types/system.d.ts +2 -8
- package/dist/types/system.d.ts.map +1 -1
- package/dist/types/system.js.map +1 -1
- package/dist/validate.d.ts +2 -0
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +2 -1
- package/dist/validate.js.map +1 -1
- package/dist/wire/body.d.ts +32 -9
- package/dist/wire/body.d.ts.map +1 -1
- package/dist/wire/body.js +69 -8
- package/dist/wire/body.js.map +1 -1
- package/dist/wire/index.d.ts +4 -4
- package/dist/wire/index.d.ts.map +1 -1
- package/dist/wire/index.js +3 -3
- package/dist/wire/index.js.map +1 -1
- package/dist/wire/record.d.ts +1 -8
- package/dist/wire/record.d.ts.map +1 -1
- package/dist/wire/record.js +0 -48
- package/dist/wire/record.js.map +1 -1
- package/dist/wire/request.d.ts +18 -18
- package/dist/wire/request.d.ts.map +1 -1
- package/dist/wire/request.js +41 -36
- package/dist/wire/request.js.map +1 -1
- package/package.json +1 -1
- package/dist/stack/identity-bindings.d.ts +0 -13
- package/dist/stack/identity-bindings.d.ts.map +0 -1
- package/dist/stack/identity-bindings.js +0 -36
- package/dist/stack/identity-bindings.js.map +0 -1
package/dist/adapter/index.d.ts
CHANGED
|
@@ -7,11 +7,16 @@
|
|
|
7
7
|
* adapters). Types an app reads too, such as StackCapabilities, live in
|
|
8
8
|
* the root entry point instead: every export has exactly one home.
|
|
9
9
|
*/
|
|
10
|
-
export type { StackAdapter, StackRecordAdapter, StackBlobAdapter, BlobInfo,
|
|
11
|
-
export {
|
|
10
|
+
export type { AdapterQuery, PlainQuery, AdapterSort, StackAdapter, StackRecordAdapter, StackBlobAdapter, BlobInfo, SnapshotOptions, JournalEntryInput, JournalOptions, MutateOptions, AspectWriteOptions, ElementWriteOptions, Reach, RecordHistory, StoreSeed, } from '../types/index.js';
|
|
11
|
+
export { sameAssociationSet } from '../associations/identity.js';
|
|
12
|
+
export { ElementSetMovedError, FormatMismatchError, OwnerMismatchError, softDeletedRefusal, } from '../errors.js';
|
|
12
13
|
export { combineAdapters } from './combine.js';
|
|
13
|
-
export {
|
|
14
|
+
export { copyStack } from './copy.js';
|
|
15
|
+
export type { CreateStore } from './copy.js';
|
|
16
|
+
export { newStoreSeed } from './seed.js';
|
|
17
|
+
export { inReach } from './reach.js';
|
|
18
|
+
export type { ReachedRecord } from './reach.js';
|
|
19
|
+
export { assertQueryCapabilities, assertValidSort, resolveQuery, assertValidAssociationFilters, assertValidJournalQuery, assertValidVersionsQuery, filtersContent, parseContentFilterKey, } from '../query-validation.js';
|
|
14
20
|
export { contentSortEntry, contentSortKey, compareSortEntries, constantSortEntry, sortConstant, } from './sort.js';
|
|
15
21
|
export type { SortEntry } from './sort.js';
|
|
16
|
-
export { AUTHORITY_ASSOCIATION_KINDS, partitionAssociations } from '../associations/identity.js';
|
|
17
22
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/adapter/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,YAAY,EACV,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,QAAQ,EACR,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/adapter/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,YAAY,EACV,YAAY,EACZ,UAAU,EACV,WAAW,EACX,YAAY,EACZ,kBAAkB,EAClB,gBAAgB,EAChB,QAAQ,EACR,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,KAAK,EACL,aAAa,EACb,SAAS,GACV,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,YAAY,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EACL,uBAAuB,EACvB,eAAe,EACf,YAAY,EACZ,6BAA6B,EAC7B,uBAAuB,EACvB,wBAAwB,EACxB,cAAc,EACd,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,GACb,MAAM,WAAW,CAAC;AACnB,YAAY,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/adapter/index.js
CHANGED
|
@@ -7,9 +7,12 @@
|
|
|
7
7
|
* adapters). Types an app reads too, such as StackCapabilities, live in
|
|
8
8
|
* the root entry point instead: every export has exactly one home.
|
|
9
9
|
*/
|
|
10
|
-
export {
|
|
10
|
+
export { sameAssociationSet } from '../associations/identity.js';
|
|
11
|
+
export { ElementSetMovedError, FormatMismatchError, OwnerMismatchError, softDeletedRefusal, } from '../errors.js';
|
|
11
12
|
export { combineAdapters } from './combine.js';
|
|
12
|
-
export {
|
|
13
|
+
export { copyStack } from './copy.js';
|
|
14
|
+
export { newStoreSeed } from './seed.js';
|
|
15
|
+
export { inReach } from './reach.js';
|
|
16
|
+
export { assertQueryCapabilities, assertValidSort, resolveQuery, assertValidAssociationFilters, assertValidJournalQuery, assertValidVersionsQuery, filtersContent, parseContentFilterKey, } from '../query-validation.js';
|
|
13
17
|
export { contentSortEntry, contentSortKey, compareSortEntries, constantSortEntry, sortConstant, } from './sort.js';
|
|
14
|
-
export { AUTHORITY_ASSOCIATION_KINDS, partitionAssociations } from '../associations/identity.js';
|
|
15
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/adapter/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/adapter/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAoBH,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EACL,uBAAuB,EACvB,eAAe,EACf,YAAY,EACZ,6BAA6B,EAC7B,uBAAuB,EACvB,wBAAwB,EACxB,cAAc,EACd,qBAAqB,GACtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,GACb,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Matching a Reach in memory
|
|
3
|
+
* -------------------------------------------------------
|
|
4
|
+
* The one reading of a reach in JavaScript: MemoryAdapter matches a query
|
|
5
|
+
* with it, and ScopedStack asks it of each Record a verb would act on. A
|
|
6
|
+
* SQL adapter states the same conditions in its own query language. See
|
|
7
|
+
* docs/spec/access-control.md § Reach.
|
|
8
|
+
*/
|
|
9
|
+
import type { Reach, StackRecord } from '../types/index.js';
|
|
10
|
+
/** What a reach asks of a Record — all a record yet to be created has to show. */
|
|
11
|
+
export type ReachedRecord = Pick<StackRecord, 'typeId' | 'createdBy' | 'permissions'>;
|
|
12
|
+
/** Whether `record` is inside the reach, matched by its family. */
|
|
13
|
+
export declare function inReach(record: ReachedRecord, reach: Reach): boolean;
|
|
14
|
+
//# sourceMappingURL=reach.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reach.d.ts","sourceRoot":"","sources":["../../src/adapter/reach.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAE5D,kFAAkF;AAClF,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,WAAW,EAAE,QAAQ,GAAG,WAAW,GAAG,aAAa,CAAC,CAAC;AAEtF,mEAAmE;AACnE,wBAAgB,OAAO,CAAC,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAmBpE"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Matching a Reach in memory
|
|
3
|
+
* -------------------------------------------------------
|
|
4
|
+
* The one reading of a reach in JavaScript: MemoryAdapter matches a query
|
|
5
|
+
* with it, and ScopedStack asks it of each Record a verb would act on. A
|
|
6
|
+
* SQL adapter states the same conditions in its own query language. See
|
|
7
|
+
* docs/spec/access-control.md § Reach.
|
|
8
|
+
*/
|
|
9
|
+
import { associationKey } from '../associations/identity.js';
|
|
10
|
+
import { baseIdOf } from '../schema.js';
|
|
11
|
+
/** Whether `record` is inside the reach, matched by its family. */
|
|
12
|
+
export function inReach(record, reach) {
|
|
13
|
+
const family = baseIdOf(record.typeId);
|
|
14
|
+
if (reach.fence && !reach.fence.includes(family))
|
|
15
|
+
return false;
|
|
16
|
+
const within = reach.within;
|
|
17
|
+
if (!within)
|
|
18
|
+
return true;
|
|
19
|
+
if (within.baseIds.includes(family))
|
|
20
|
+
return true;
|
|
21
|
+
const authored = within.authored;
|
|
22
|
+
if (authored &&
|
|
23
|
+
authored.baseIds.includes(family) &&
|
|
24
|
+
record.createdBy?.subjectId === authored.subjectId) {
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
const held = new Set((record.permissions ?? []).map(associationKey));
|
|
28
|
+
held.delete(undefined);
|
|
29
|
+
return within.permissions.some((set) => set.length > 0 && set.every((element) => held.has(associationKey(element))));
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=reach.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reach.js","sourceRoot":"","sources":["../../src/adapter/reach.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAMxC,mEAAmE;AACnE,MAAM,UAAU,OAAO,CAAC,MAAqB,EAAE,KAAY;IACzD,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACvC,IAAI,KAAK,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,KAAK,CAAC;IAC/D,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAC5B,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACzB,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,IAAI,CAAC;IACjD,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;IACjC,IACE,QAAQ;QACR,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;QACjC,MAAM,CAAC,SAAS,EAAE,SAAS,KAAK,QAAQ,CAAC,SAAS,EAClD,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC,CAAC;IACrE,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACvB,OAAO,MAAM,CAAC,WAAW,CAAC,IAAI,CAC5B,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC,CACrF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Store seeds
|
|
3
|
+
* -------------------------------------------------------
|
|
4
|
+
* A store is created holding one Record, `_config`, which says whose stack
|
|
5
|
+
* it is. A seed is that Record with its history: fresh for a new stack, the
|
|
6
|
+
* source's own for a copy, so the one Record every store starts with is
|
|
7
|
+
* written the way every other Record is. See docs/spec/adapters.md
|
|
8
|
+
* § Construction.
|
|
9
|
+
*/
|
|
10
|
+
import type { ConfigContent, StoreSeed } from '../types/index.js';
|
|
11
|
+
/** The seed of a stack that has no past: `_config` at version 1, holding `config`. */
|
|
12
|
+
export declare function newStoreSeed(config: ConfigContent): StoreSeed;
|
|
13
|
+
//# sourceMappingURL=seed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seed.d.ts","sourceRoot":"","sources":["../../src/adapter/seed.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAGlE,sFAAsF;AACtF,wBAAgB,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,SAAS,CAa7D"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Store seeds
|
|
3
|
+
* -------------------------------------------------------
|
|
4
|
+
* A store is created holding one Record, `_config`, which says whose stack
|
|
5
|
+
* it is. A seed is that Record with its history: fresh for a new stack, the
|
|
6
|
+
* source's own for a copy, so the one Record every store starts with is
|
|
7
|
+
* written the way every other Record is. See docs/spec/adapters.md
|
|
8
|
+
* § Construction.
|
|
9
|
+
*/
|
|
10
|
+
import { SYSTEM_TYPES } from '../types/index.js';
|
|
11
|
+
/** The seed of a stack that has no past: `_config` at version 1, holding `config`. */
|
|
12
|
+
export function newStoreSeed(config) {
|
|
13
|
+
const now = new Date();
|
|
14
|
+
return {
|
|
15
|
+
config: {
|
|
16
|
+
id: SYSTEM_TYPES.CONFIG,
|
|
17
|
+
typeId: `${SYSTEM_TYPES.CONFIG}@1`,
|
|
18
|
+
createdAt: now,
|
|
19
|
+
updatedAt: now,
|
|
20
|
+
content: { ...config },
|
|
21
|
+
version: 1,
|
|
22
|
+
},
|
|
23
|
+
history: { versions: [], journal: [] },
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=seed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seed.js","sourceRoot":"","sources":["../../src/adapter/seed.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,sFAAsF;AACtF,MAAM,UAAU,YAAY,CAAC,MAAqB;IAChD,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;IACvB,OAAO;QACL,MAAM,EAAE;YACN,EAAE,EAAE,YAAY,CAAC,MAAM;YACvB,MAAM,EAAE,GAAG,YAAY,CAAC,MAAM,IAAI;YAClC,SAAS,EAAE,GAAG;YACd,SAAS,EAAE,GAAG;YACd,OAAO,EAAE,EAAE,GAAG,MAAM,EAAE;YACtB,OAAO,EAAE,CAAC;SACX;QACD,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;KACvC,CAAC;AACJ,CAAC"}
|
|
@@ -9,19 +9,17 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import type { Association, AssociationChange, AssociationEdit, AuthorityAssociation, DataAssociation, Grantee, RelationshipTarget } from '../types/index.js';
|
|
11
11
|
/**
|
|
12
|
-
* Association identity — what
|
|
12
|
+
* Association identity — what a remove edit matches and a repeat add
|
|
13
13
|
* collides with; the SQLite adapter's primary key. An attachment's
|
|
14
14
|
* `attachmentRecordId` annotates a reference rather than naming one, so it
|
|
15
15
|
* is outside; a group grantee's `role` names a different set of people, so
|
|
16
16
|
* it is inside. See docs/spec/data-model.md § Associations.
|
|
17
17
|
*/
|
|
18
|
+
export declare function associationKey(a: Association): string | undefined;
|
|
19
|
+
/** Whether two associations are the same one — see associationKey(). */
|
|
18
20
|
export declare function associationEqual(a: Association, b: Association): boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Structural equality per grantee arm. `role` is required, so there is no
|
|
21
|
-
* absent-means-any spelling to normalize.
|
|
22
|
-
*/
|
|
23
21
|
export declare function granteeEqual(a: Grantee, b: Grantee): boolean;
|
|
24
|
-
/** Structural equality per target arm — what
|
|
22
|
+
/** Structural equality per target arm — what a remove edit matches on. */
|
|
25
23
|
export declare function targetEqual(a: RelationshipTarget, b: RelationshipTarget): boolean;
|
|
26
24
|
/**
|
|
27
25
|
* Identity plus every annotation outside it, so a write that only re-points
|
|
@@ -30,35 +28,26 @@ export declare function targetEqual(a: RelationshipTarget, b: RelationshipTarget
|
|
|
30
28
|
* this decides whether it says anything new.
|
|
31
29
|
*/
|
|
32
30
|
export declare function associationIdentical(a: Association, b: Association): boolean;
|
|
33
|
-
/**
|
|
34
|
-
* The association kinds that carry authority. Every other kind is data.
|
|
35
|
-
* Storage that partitions by kind in a query reads this list rather than
|
|
36
|
-
* restating it, so a new authority kind can't fall into the data half.
|
|
37
|
-
*/
|
|
38
|
-
export declare const AUTHORITY_ASSOCIATION_KINDS: readonly AuthorityAssociation['kind'][];
|
|
39
31
|
/**
|
|
40
32
|
* Whether an association carries authority rather than data — the partition
|
|
41
33
|
* `StackRecord.permissions` and `StackRecord.associations` project, and the
|
|
42
|
-
* line
|
|
34
|
+
* line the association verbs refuse to cross.
|
|
43
35
|
* See docs/spec/access-control.md § Record-level permissions.
|
|
44
36
|
*/
|
|
45
37
|
export declare function isAuthorityAssociation(a: Association): a is AuthorityAssociation;
|
|
46
38
|
/**
|
|
47
|
-
*
|
|
48
|
-
*
|
|
39
|
+
* What replacing a record's set with `after` moves, one tagged edit each.
|
|
40
|
+
* An entry matching an existing identity displaced it: a `repoint`,
|
|
41
|
+
* carrying the prior association in full as `previous` — the only place
|
|
42
|
+
* an overwritten `attachmentRecordId` survives.
|
|
43
|
+
* See docs/spec/journal.md § The entry.
|
|
49
44
|
*/
|
|
50
|
-
export declare function
|
|
51
|
-
associations: DataAssociation[];
|
|
52
|
-
permissions: AuthorityAssociation[];
|
|
53
|
-
};
|
|
45
|
+
export declare function associationDelta(before: readonly Association[], after: readonly Association[]): AssociationChange[];
|
|
54
46
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
* a `repoint`, carrying the prior association in full as `previous` — the
|
|
58
|
-
* only place an overwritten `attachmentRecordId` survives.
|
|
59
|
-
* See docs/spec/journal.md § The entry.
|
|
47
|
+
* Whether two sets hold the same elements, annotations included, in any
|
|
48
|
+
* order — what an element-set write's `expectSet` is compared by.
|
|
60
49
|
*/
|
|
61
|
-
export declare function
|
|
50
|
+
export declare function sameAssociationSet(a: readonly Association[], b: readonly Association[]): boolean;
|
|
62
51
|
/**
|
|
63
52
|
* The two flat lists a change frame carries, derived from the tagged list.
|
|
64
53
|
* The feed reports what is true now, so a `repoint` appears only under its
|
|
@@ -70,24 +59,11 @@ export declare function feedAssociationDelta(changes: AssociationChange[]): {
|
|
|
70
59
|
added: DataAssociation[];
|
|
71
60
|
removed: DataAssociation[];
|
|
72
61
|
};
|
|
62
|
+
/** The elements an edit list adds. */
|
|
63
|
+
export declare function addsOf(edits: readonly AssociationEdit[]): Association[];
|
|
73
64
|
/**
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
* adapter inherits the same rule.
|
|
77
|
-
* See docs/spec/access-control.md § Storage unifies; the API does not.
|
|
78
|
-
*/
|
|
79
|
-
export declare function assertOneSurface(changes: readonly AssociationEdit[]): void;
|
|
80
|
-
/**
|
|
81
|
-
* The set a list of edits leaves behind: removes first, then adds, an add
|
|
82
|
-
* landing on an identity already held in place. Adds naming one identity
|
|
83
|
-
* collapse, last wins; an add outlives a remove of the same identity.
|
|
84
|
-
* See docs/spec/adapters.md § Amending associations.
|
|
65
|
+
* The set a list of edits leaves behind, an add landing on an identity
|
|
66
|
+
* already held in place. See docs/spec/adapters.md § Editing associations.
|
|
85
67
|
*/
|
|
86
68
|
export declare function applyAssociationEdits(current: Association[], changes: readonly AssociationEdit[]): Association[];
|
|
87
|
-
/**
|
|
88
|
-
* The same op over every element of a list — what associate(),
|
|
89
|
-
* dissociate(), grantAccess() and revokeAccess() hand to the amend verb
|
|
90
|
-
* each is one half of.
|
|
91
|
-
*/
|
|
92
|
-
export declare function editsOf(op: 'add' | 'remove', associations: Association[]): AssociationEdit[];
|
|
93
69
|
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/associations/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../src/associations/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,oBAAoB,EACpB,eAAe,EACf,OAAO,EACP,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAE3B;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,CAajE;AAED,wEAAwE;AACxE,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,GAAG,OAAO,CAGxE;AAYD,wBAAgB,YAAY,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO,CAG5D;AAUD,0EAA0E;AAC1E,wBAAgB,WAAW,CAAC,CAAC,EAAE,kBAAkB,EAAE,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAGjF;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,GAAG,OAAO,CAM5E;AAoBD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,WAAW,GAAG,CAAC,IAAI,oBAAoB,CAEhF;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,SAAS,WAAW,EAAE,EAC9B,KAAK,EAAE,SAAS,WAAW,EAAE,GAC5B,iBAAiB,EAAE,CAcrB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,SAAS,WAAW,EAAE,EAAE,CAAC,EAAE,SAAS,WAAW,EAAE,GAAG,OAAO,CAEhG;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,iBAAiB,EAAE,GAAG;IAClE,KAAK,EAAE,eAAe,EAAE,CAAC;IACzB,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B,CAYA;AAED,sCAAsC;AACtC,wBAAgB,MAAM,CAAC,KAAK,EAAE,SAAS,eAAe,EAAE,GAAG,WAAW,EAAE,CAEvE;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,WAAW,EAAE,EACtB,OAAO,EAAE,SAAS,eAAe,EAAE,GAClC,WAAW,EAAE,CAWf"}
|
|
@@ -7,59 +7,61 @@
|
|
|
7
7
|
* applying edits, the feed — so they answer it with one comparison and
|
|
8
8
|
* can never disagree. See docs/spec/data-model.md § Associations.
|
|
9
9
|
*/
|
|
10
|
-
import { StackBadRequestError } from '../errors.js';
|
|
11
10
|
/**
|
|
12
|
-
* Association identity — what
|
|
11
|
+
* Association identity — what a remove edit matches and a repeat add
|
|
13
12
|
* collides with; the SQLite adapter's primary key. An attachment's
|
|
14
13
|
* `attachmentRecordId` annotates a reference rather than naming one, so it
|
|
15
14
|
* is outside; a group grantee's `role` names a different set of people, so
|
|
16
15
|
* it is inside. See docs/spec/data-model.md § Associations.
|
|
17
16
|
*/
|
|
18
|
-
export function
|
|
19
|
-
//
|
|
17
|
+
export function associationKey(a) {
|
|
18
|
+
// No key, so never "the same one": naming a malformed association is
|
|
20
19
|
// validateAssociation()'s job, which this must reach without throwing.
|
|
21
|
-
if (!a
|
|
22
|
-
return
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
20
|
+
if (!a)
|
|
21
|
+
return undefined;
|
|
22
|
+
const arm = a.kind === 'attachment'
|
|
23
|
+
? [a.fileId]
|
|
24
|
+
: a.kind === 'relationship'
|
|
25
|
+
? targetParts(a.target)
|
|
26
|
+
: a.kind === 'permission'
|
|
27
|
+
? granteeParts(a.grantee)
|
|
28
|
+
: [];
|
|
29
|
+
return arm && JSON.stringify([a.kind, a.label, ...arm]);
|
|
30
|
+
}
|
|
31
|
+
/** Whether two associations are the same one — see associationKey(). */
|
|
32
|
+
export function associationEqual(a, b) {
|
|
33
|
+
const key = associationKey(a);
|
|
34
|
+
return key !== undefined && key === associationKey(b);
|
|
34
35
|
}
|
|
35
36
|
/**
|
|
36
|
-
*
|
|
37
|
+
* A grantee's identity, per arm. `role` is required, so there is no
|
|
37
38
|
* absent-means-any spelling to normalize.
|
|
38
39
|
*/
|
|
40
|
+
function granteeParts(g) {
|
|
41
|
+
if (g?.kind === 'entity')
|
|
42
|
+
return [g.kind, g.entityId];
|
|
43
|
+
if (g?.kind === 'group')
|
|
44
|
+
return [g.kind, g.groupId, g.role];
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
39
47
|
export function granteeEqual(a, b) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
const parts = granteeParts(a);
|
|
49
|
+
return parts !== undefined && JSON.stringify(parts) === JSON.stringify(granteeParts(b));
|
|
50
|
+
}
|
|
51
|
+
/** A target's identity, per arm — an absent `stackUrl` is this stack, as an empty one is. */
|
|
52
|
+
function targetParts(t) {
|
|
53
|
+
if (t?.kind === 'record')
|
|
54
|
+
return [t.kind, t.recordId, t.stackUrl ?? ''];
|
|
55
|
+
if (t?.kind === 'entity')
|
|
56
|
+
return [t.kind, t.entityId];
|
|
57
|
+
if (t?.kind === 'external')
|
|
58
|
+
return [t.kind, t.ns, t.id];
|
|
59
|
+
return undefined;
|
|
50
60
|
}
|
|
51
|
-
/** Structural equality per target arm — what
|
|
61
|
+
/** Structural equality per target arm — what a remove edit matches on. */
|
|
52
62
|
export function targetEqual(a, b) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
if (a.kind === 'record' && b.kind === 'record') {
|
|
56
|
-
return a.recordId === b.recordId && (a.stackUrl ?? '') === (b.stackUrl ?? '');
|
|
57
|
-
}
|
|
58
|
-
if (a.kind === 'entity' && b.kind === 'entity')
|
|
59
|
-
return a.entityId === b.entityId;
|
|
60
|
-
if (a.kind === 'external' && b.kind === 'external')
|
|
61
|
-
return a.ns === b.ns && a.id === b.id;
|
|
62
|
-
return false;
|
|
63
|
+
const parts = targetParts(a);
|
|
64
|
+
return parts !== undefined && JSON.stringify(parts) === JSON.stringify(targetParts(b));
|
|
63
65
|
}
|
|
64
66
|
/**
|
|
65
67
|
* Identity plus every annotation outside it, so a write that only re-points
|
|
@@ -87,39 +89,25 @@ function stripAssociationAnnotation(association) {
|
|
|
87
89
|
const { attachmentRecordId: _attachmentRecordId, ...identity } = association;
|
|
88
90
|
return identity;
|
|
89
91
|
}
|
|
90
|
-
/**
|
|
91
|
-
|
|
92
|
-
* Storage that partitions by kind in a query reads this list rather than
|
|
93
|
-
* restating it, so a new authority kind can't fall into the data half.
|
|
94
|
-
*/
|
|
95
|
-
export const AUTHORITY_ASSOCIATION_KINDS = [
|
|
92
|
+
/** The association kinds that carry authority. Every other kind is data. */
|
|
93
|
+
const AUTHORITY_ASSOCIATION_KINDS = [
|
|
96
94
|
'permission',
|
|
97
95
|
'anyone',
|
|
98
96
|
];
|
|
99
97
|
/**
|
|
100
98
|
* Whether an association carries authority rather than data — the partition
|
|
101
99
|
* `StackRecord.permissions` and `StackRecord.associations` project, and the
|
|
102
|
-
* line
|
|
100
|
+
* line the association verbs refuse to cross.
|
|
103
101
|
* See docs/spec/access-control.md § Record-level permissions.
|
|
104
102
|
*/
|
|
105
103
|
export function isAuthorityAssociation(a) {
|
|
106
104
|
return AUTHORITY_ASSOCIATION_KINDS.includes(a.kind);
|
|
107
105
|
}
|
|
108
106
|
/**
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
return {
|
|
114
|
-
associations: associations.filter((a) => !isAuthorityAssociation(a)),
|
|
115
|
-
permissions: associations.filter(isAuthorityAssociation),
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* What a `changes.associations` list moves against a record's current set,
|
|
120
|
-
* one tagged edit each. An entry matching an existing identity displaced it:
|
|
121
|
-
* a `repoint`, carrying the prior association in full as `previous` — the
|
|
122
|
-
* only place an overwritten `attachmentRecordId` survives.
|
|
107
|
+
* What replacing a record's set with `after` moves, one tagged edit each.
|
|
108
|
+
* An entry matching an existing identity displaced it: a `repoint`,
|
|
109
|
+
* carrying the prior association in full as `previous` — the only place
|
|
110
|
+
* an overwritten `attachmentRecordId` survives.
|
|
123
111
|
* See docs/spec/journal.md § The entry.
|
|
124
112
|
*/
|
|
125
113
|
export function associationDelta(before, after) {
|
|
@@ -135,6 +123,13 @@ export function associationDelta(before, after) {
|
|
|
135
123
|
.filter((b) => !after.some((a) => associationEqual(a, b)))
|
|
136
124
|
.map((association) => ({ op: 'remove', association })));
|
|
137
125
|
}
|
|
126
|
+
/**
|
|
127
|
+
* Whether two sets hold the same elements, annotations included, in any
|
|
128
|
+
* order — what an element-set write's `expectSet` is compared by.
|
|
129
|
+
*/
|
|
130
|
+
export function sameAssociationSet(a, b) {
|
|
131
|
+
return associationDelta(a, b).length === 0;
|
|
132
|
+
}
|
|
138
133
|
/**
|
|
139
134
|
* The two flat lists a change frame carries, derived from the tagged list.
|
|
140
135
|
* The feed reports what is true now, so a `repoint` appears only under its
|
|
@@ -157,24 +152,13 @@ export function feedAssociationDelta(changes) {
|
|
|
157
152
|
}
|
|
158
153
|
return { added, removed };
|
|
159
154
|
}
|
|
160
|
-
/**
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
* adapter inherits the same rule.
|
|
164
|
-
* See docs/spec/access-control.md § Storage unifies; the API does not.
|
|
165
|
-
*/
|
|
166
|
-
export function assertOneSurface(changes) {
|
|
167
|
-
const authority = changes.filter((c) => isAuthorityAssociation(c.association)).length;
|
|
168
|
-
if (authority === 0 || authority === changes.length)
|
|
169
|
-
return;
|
|
170
|
-
throw new StackBadRequestError('An association edit list carries authority or data, never both: permission and anyone ' +
|
|
171
|
-
'elements travel on the permissions surface.');
|
|
155
|
+
/** The elements an edit list adds. */
|
|
156
|
+
export function addsOf(edits) {
|
|
157
|
+
return edits.flatMap((e) => (e.op === 'add' ? [e.association] : []));
|
|
172
158
|
}
|
|
173
159
|
/**
|
|
174
|
-
* The set a list of edits leaves behind
|
|
175
|
-
*
|
|
176
|
-
* collapse, last wins; an add outlives a remove of the same identity.
|
|
177
|
-
* See docs/spec/adapters.md § Amending associations.
|
|
160
|
+
* The set a list of edits leaves behind, an add landing on an identity
|
|
161
|
+
* already held in place. See docs/spec/adapters.md § Editing associations.
|
|
178
162
|
*/
|
|
179
163
|
export function applyAssociationEdits(current, changes) {
|
|
180
164
|
let next = current.filter((a) => !changes.some((c) => c.op === 'remove' && associationEqual(c.association, a)));
|
|
@@ -187,12 +171,4 @@ export function applyAssociationEdits(current, changes) {
|
|
|
187
171
|
}
|
|
188
172
|
return next;
|
|
189
173
|
}
|
|
190
|
-
/**
|
|
191
|
-
* The same op over every element of a list — what associate(),
|
|
192
|
-
* dissociate(), grantAccess() and revokeAccess() hand to the amend verb
|
|
193
|
-
* each is one half of.
|
|
194
|
-
*/
|
|
195
|
-
export function editsOf(op, associations) {
|
|
196
|
-
return associations.map((association) => ({ op, association }));
|
|
197
|
-
}
|
|
198
174
|
//# sourceMappingURL=identity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../../src/associations/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../../src/associations/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAYH;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,CAAc;IAC3C,qEAAqE;IACrE,uEAAuE;IACvE,IAAI,CAAC,CAAC;QAAE,O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,UAAU,qBAAqB,CACnC,OAAsB,EACtB,OAAmC;IAEnC,IAAI,IAAI,GAAG,OAAO,CAAC,MAAM,CACvB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,QAAQ,IAAI,gBAAgB,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CACrF,CAAC;IACF,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,IAAI,CAAC,CAAC,EAAE,KAAK,KAAK;YAAE,SAAS;QAC7B,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC;YACzD,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAC3E,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -56,7 +56,7 @@ export declare function granteeErrors(grantee: unknown, path: string, opts: {
|
|
|
56
56
|
* Refuse an authority element on the data surface. The two halves share
|
|
57
57
|
* storage but never a call, or an app editing tags could replace an ACL it
|
|
58
58
|
* was never shown. Thrown, not collected: the caller named the wrong
|
|
59
|
-
* surface, and wanted
|
|
59
|
+
* surface, and wanted editAccess()/setAccess().
|
|
60
60
|
* See docs/spec/access-control.md § Record-level permissions.
|
|
61
61
|
*/
|
|
62
62
|
export declare function assertDataAssociations(associations: readonly Association[], surface: string): asserts associations is DataAssociation[];
|
|
@@ -80,11 +80,4 @@ export declare function validateAssociations(associations: Association[] | undef
|
|
|
80
80
|
* the journal's word, never a request. See docs/spec/data-model.md § Mutations.
|
|
81
81
|
*/
|
|
82
82
|
export declare function assertAssociationEdits(changes: unknown, surface: string, half: 'data' | 'authority'): asserts changes is AssociationEdit[];
|
|
83
|
-
/**
|
|
84
|
-
* assertAssociationEdits() for the verbs taking a bare list — associate(),
|
|
85
|
-
* grantAccess() and their inverses — asked before wrapping, so problems are
|
|
86
|
-
* reported under `param`, the name the caller used. Same order of checks,
|
|
87
|
-
* so a wrong-surface element is refused as such before duplicates count.
|
|
88
|
-
*/
|
|
89
|
-
export declare function assertAssociationList(associations: unknown, surface: string, param: string, half: 'data' | 'authority'): asserts associations is Association[];
|
|
90
83
|
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../src/associations/validation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,EAEV,WAAW,EACX,eAAe,EAEf,oBAAoB,EACpB,eAAe,EAGf,YAAY,EAKZ,kBAAkB,EAClB,yBAAyB,EAE1B,MAAM,mBAAmB,CAAC;AAY3B,sDAAsD;AACtD,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAI7E,CAAC;AAgBF,qEAAqE;AACrE,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAIxE,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,CAE5E;AAED,2EAA2E;AAC3E,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,S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AC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GACrF,eAAe,EAAE,CA+CnB;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,YAAY,EAAE,SAAS,WAAW,EAAE,EACpC,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,YAAY,IAAI,eAAe,EAAE,CAO3C;AAED;;;;GAIG;AACH,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,SAAS,WAAW,EAAE,EACnC,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,WAAW,IAAI,oBAAoB,EAAE,CAO/C;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,YAAY,EAAE,WAAW,EAAE,GAAG,SAAS,EACvC,IAAI,SAAiB,GACpB,eAAe,EAAE,CAMnB;AAgBD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,GAAG,WAAW,GACzB,OAAO,CAAC,OAAO,IAAI,eAAe,EAAE,CAoCtC"}
|
|
@@ -220,7 +220,7 @@ export function granteeErrors(grantee, path, opts) {
|
|
|
220
220
|
* Refuse an authority element on the data surface. The two halves share
|
|
221
221
|
* storage but never a call, or an app editing tags could replace an ACL it
|
|
222
222
|
* was never shown. Thrown, not collected: the caller named the wrong
|
|
223
|
-
* surface, and wanted
|
|
223
|
+
* surface, and wanted editAccess()/setAccess().
|
|
224
224
|
* See docs/spec/access-control.md § Record-level permissions.
|
|
225
225
|
*/
|
|
226
226
|
export function assertDataAssociations(associations, surface) {
|
|
@@ -228,7 +228,7 @@ export function assertDataAssociations(associations, surface) {
|
|
|
228
228
|
if (!authority)
|
|
229
229
|
return;
|
|
230
230
|
throw new StackBadRequestError(`${surface} does not carry authority: a "${authority.kind}" association belongs to the ` +
|
|
231
|
-
'`permissions` surface — use
|
|
231
|
+
'`permissions` surface — use editAccess() or setAccess().');
|
|
232
232
|
}
|
|
233
233
|
/**
|
|
234
234
|
* The mirror of assertDataAssociations(): the `permissions` surface takes
|
|
@@ -240,7 +240,7 @@ export function assertAuthorityAssociations(permissions, surface) {
|
|
|
240
240
|
if (!data)
|
|
241
241
|
return;
|
|
242
242
|
throw new StackBadRequestError(`${surface} carries authority alone: a "${data.kind}" association belongs to the ` +
|
|
243
|
-
'`associations` surface — use
|
|
243
|
+
'`associations` surface — use editAssociations() or setAssociations().');
|
|
244
244
|
}
|
|
245
245
|
/**
|
|
246
246
|
* Every association in a list, plus the list's own rule: identities are
|
|
@@ -309,31 +309,4 @@ export function assertAssociationEdits(changes, surface, half) {
|
|
|
309
309
|
if (duplicates.length > 0)
|
|
310
310
|
throw new StackValidationError(duplicates, ARGUMENTS_INVALID);
|
|
311
311
|
}
|
|
312
|
-
/**
|
|
313
|
-
* assertAssociationEdits() for the verbs taking a bare list — associate(),
|
|
314
|
-
* grantAccess() and their inverses — asked before wrapping, so problems are
|
|
315
|
-
* reported under `param`, the name the caller used. Same order of checks,
|
|
316
|
-
* so a wrong-surface element is refused as such before duplicates count.
|
|
317
|
-
*/
|
|
318
|
-
export function assertAssociationList(associations, surface, param, half) {
|
|
319
|
-
if (!Array.isArray(associations) || associations.length === 0) {
|
|
320
|
-
throw new StackValidationError([{ path: param, message: `${surface} names at least one association.` }], ARGUMENTS_INVALID);
|
|
321
|
-
}
|
|
322
|
-
const errors = associations.flatMap((raw, i) => typeof raw === 'object' && raw !== null && !Array.isArray(raw)
|
|
323
|
-
? []
|
|
324
|
-
: [{ path: `${param}[${i}]`, message: `${param}[${i}] must be an object.` }]);
|
|
325
|
-
if (errors.length > 0)
|
|
326
|
-
throw new StackValidationError(errors, ARGUMENTS_INVALID);
|
|
327
|
-
const list = associations;
|
|
328
|
-
const shapeErrors = list.flatMap((a, i) => validateAssociation(a, `${param}[${i}]`));
|
|
329
|
-
if (shapeErrors.length > 0)
|
|
330
|
-
throw new StackValidationError(shapeErrors, ARGUMENTS_INVALID);
|
|
331
|
-
if (half === 'data')
|
|
332
|
-
assertDataAssociations(list, surface);
|
|
333
|
-
else
|
|
334
|
-
assertAuthorityAssociations(list, surface);
|
|
335
|
-
const listErrors = validateAssociations(list, param);
|
|
336
|
-
if (listErrors.length > 0)
|
|
337
|
-
throw new StackValidationError(listErrors, ARGUMENTS_INVALID);
|
|
338
|
-
}
|
|
339
312
|
//# sourceMappingURL=validation.js.map
|