@owlmeans/state 0.1.18-rc.2 → 0.1.18-rc.21
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 +175 -48
- package/agent-meta/manifest.json +2 -2
- package/agent-meta/skills/state/SKILL.md +202 -19
- package/build/errors.d.ts +12 -5
- package/build/errors.d.ts.map +1 -1
- package/build/errors.js +16 -13
- package/build/errors.js.map +1 -1
- package/build/helper.d.ts +16 -0
- package/build/helper.d.ts.map +1 -0
- package/build/helper.js +14 -0
- package/build/helper.js.map +1 -0
- package/build/index.d.ts +2 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -1
- package/build/index.js.map +1 -1
- package/build/resource.d.ts +11 -4
- package/build/resource.d.ts.map +1 -1
- package/build/resource.js +332 -151
- package/build/resource.js.map +1 -1
- package/build/types.d.ts +98 -29
- package/build/types.d.ts.map +1 -1
- package/build/utils/model.d.ts +22 -2
- package/build/utils/model.d.ts.map +1 -1
- package/build/utils/model.js +26 -22
- package/build/utils/model.js.map +1 -1
- package/package.json +5 -4
- package/src/errors.ts +16 -13
- package/src/helper.ts +17 -0
- package/src/index.ts +2 -1
- package/src/resource.ts +407 -166
- package/src/types.ts +103 -30
- package/src/utils/model.ts +48 -28
- package/tests/resource.spec.ts +419 -0
- package/tsconfig.json +6 -1
- package/build/.gitkeep +0 -0
- package/build/consts.d.ts +0 -3
- package/build/consts.d.ts.map +0 -1
- package/build/consts.js +0 -3
- package/build/consts.js.map +0 -1
- package/build/utils/index.d.ts +0 -2
- package/build/utils/index.d.ts.map +0 -1
- package/build/utils/index.js +0 -2
- package/build/utils/index.js.map +0 -1
- package/src/consts.ts +0 -3
- package/src/utils/index.ts +0 -2
package/build/index.d.ts
CHANGED
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,mBAAmB,YAAY,CAAA;AAE/B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,mBAAmB,YAAY,CAAA;AAE/B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA"}
|
package/build/index.js
CHANGED
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA"}
|
package/build/resource.d.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
|
+
import type { BasicConfig as Config, BasicContext as Context } from '@owlmeans/context';
|
|
1
2
|
import type { ResourceRecord } from '@owlmeans/resource';
|
|
2
|
-
import type { StateResource, StateResourceAppend } from './types.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import type { StateConfig, StateResource, StateResourceAppend } from './types.js';
|
|
4
|
+
export declare const createStateResource: <T extends ResourceRecord>(alias?: string, cfg?: StateConfig<T>) => StateResource<T>;
|
|
5
|
+
/**
|
|
6
|
+
* Register a state resource on the context and expose `getStateResource`.
|
|
7
|
+
*
|
|
8
|
+
* Idempotent: appending the same alias twice keeps the resource that is already there, so a
|
|
9
|
+
* setup that runs more than once does not drop what the store has collected. The first alias
|
|
10
|
+
* appended is the one `getStateResource()` answers with when it is called without one.
|
|
11
|
+
*/
|
|
12
|
+
export declare const appendStateResource: <C extends Config, T extends Context<C>, R extends ResourceRecord = ResourceRecord>(ctx: T, alias?: string, cfg?: StateConfig<R>) => T & StateResourceAppend;
|
|
6
13
|
//# sourceMappingURL=resource.d.ts.map
|
package/build/resource.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,IAAI,MAAM,EAAE,YAAY,IAAI,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAKvF,OAAO,KAAK,EAC2B,cAAc,EAEpD,MAAM,oBAAoB,CAAA;AAG3B,OAAO,KAAK,EACV,WAAW,EAA0B,aAAa,EAAE,mBAAmB,EACxE,MAAM,YAAY,CAAA;AAgCnB,eAAO,MAAM,mBAAmB,GAAI,CAAC,SAAS,cAAc,UACnD,MAAM,QAAgB,WAAW,CAAC,CAAC,CAAC,KAC1C,aAAa,CAAC,CAAC,CA8ZjB,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,GAC9B,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,cAAc,GAAG,cAAc,OAC5E,CAAC,UAAS,MAAM,QAAgB,WAAW,CAAC,CAAC,CAAC,KAAG,CAAC,GAAG,mBAa3D,CAAA"}
|
package/build/resource.js
CHANGED
|
@@ -1,200 +1,381 @@
|
|
|
1
1
|
import { appendContextual } from '@owlmeans/context';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { StateListenerError } from './errors.js';
|
|
2
|
+
import { applyQuery, filterRecords, firstMatch, RecordExists, sortRecords, UnknownRecordError, UnsupportedArgumentError } from '@owlmeans/resource';
|
|
3
|
+
import { StateConfigError } from './errors.js';
|
|
5
4
|
import { createStateModel } from './utils/model.js';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
/**
|
|
6
|
+
* The one slot of a `single` resource. It is a KEY and never a value: nothing writes it into a
|
|
7
|
+
* record, so a single resource's record still carries whatever id it arrived with, or none.
|
|
8
|
+
*/
|
|
9
|
+
const SOLE = '';
|
|
10
|
+
/** The channel writes publish on, and the one a subscriber gets when it names none. */
|
|
11
|
+
const CHANGES = 'changes';
|
|
12
|
+
/** The alias a context's first state resource takes when nothing else is asked for. */
|
|
13
|
+
const STATE = 'state';
|
|
14
|
+
/** Milliseconds until a subscription expires: a number is seconds from now, a Date the instant. */
|
|
15
|
+
const expiresIn = (ttl) => ttl instanceof Date ? ttl.getTime() - Date.now() : ttl * 1000;
|
|
16
|
+
export const createStateResource = (alias = STATE, cfg) => {
|
|
17
|
+
const config = { ...cfg };
|
|
18
|
+
const idField = (config.id ?? 'id');
|
|
19
|
+
const single = config.single === true;
|
|
20
|
+
const store = new Map();
|
|
21
|
+
/** One registry per kind of subscriber: a key, a query, and the change stream. */
|
|
22
|
+
const watchers = new Map();
|
|
23
|
+
const queries = new Set();
|
|
24
|
+
const subscribers = new Set();
|
|
25
|
+
/**
|
|
26
|
+
* The model handed out for a key, kept until the record behind it is replaced. React compares
|
|
27
|
+
* snapshots by reference, so rebuilding a model on every unrelated write would re-render every
|
|
28
|
+
* screen bound to the store.
|
|
29
|
+
*/
|
|
30
|
+
const models = new Map();
|
|
31
|
+
const records = () => [...store.values()];
|
|
32
|
+
/**
|
|
33
|
+
* The key a record is filed under.
|
|
34
|
+
*
|
|
35
|
+
* @throws {StateConfigError} `NoId` — nothing here mints ids, so a record without one is
|
|
36
|
+
* misfiled rather than new.
|
|
37
|
+
*/
|
|
38
|
+
const keyOf = (record) => {
|
|
39
|
+
if (single) {
|
|
40
|
+
return SOLE;
|
|
41
|
+
}
|
|
42
|
+
const id = record[idField];
|
|
43
|
+
if (typeof id !== 'string' || id === '') {
|
|
44
|
+
throw new StateConfigError(StateConfigError.NoId);
|
|
45
|
+
}
|
|
46
|
+
return id;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* The key an id addresses.
|
|
50
|
+
*
|
|
51
|
+
* @throws {StateConfigError} `NonSingle` — an absent id on a resource that holds many records.
|
|
52
|
+
*/
|
|
53
|
+
const keyFor = (id) => {
|
|
54
|
+
if (id == null) {
|
|
55
|
+
if (!single) {
|
|
56
|
+
throw new StateConfigError(StateConfigError.NonSingle);
|
|
57
|
+
}
|
|
58
|
+
return SOLE;
|
|
59
|
+
}
|
|
60
|
+
return single ? SOLE : id;
|
|
15
61
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
62
|
+
/** The key a record already in the store is filed under — its id is known to be there. */
|
|
63
|
+
const storedKey = (record) => single ? SOLE : record[idField];
|
|
64
|
+
/**
|
|
65
|
+
* A read by id. On a single resource the one record answers only to its own id, so asking for
|
|
66
|
+
* a different one is a miss rather than the sole record under a wrong name.
|
|
67
|
+
*/
|
|
68
|
+
const read = (id) => {
|
|
69
|
+
const record = store.get(keyFor(id));
|
|
70
|
+
if (record == null) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
const own = record[idField];
|
|
74
|
+
if (single && own != null && own !== id) {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
return record;
|
|
78
|
+
};
|
|
79
|
+
const first = (idOrWhere, opts) => typeof idOrWhere === 'string' ? read(idOrWhere) : firstMatch(records(), idOrWhere, opts);
|
|
80
|
+
/** The store keeps no expiring records, so a ttl would be silently dropped. */
|
|
81
|
+
const refuseTtl = (opts) => {
|
|
82
|
+
if (opts?.ttl != null) {
|
|
83
|
+
throw new UnsupportedArgumentError('ttl');
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
const modelFor = (key) => {
|
|
87
|
+
const record = store.get(key);
|
|
88
|
+
const cached = models.get(key);
|
|
89
|
+
if (cached != null && cached.from === record) {
|
|
90
|
+
return cached.model;
|
|
91
|
+
}
|
|
92
|
+
const id = record?.[idField] ?? (key === SOLE ? undefined : key);
|
|
93
|
+
const model = createStateModel({
|
|
94
|
+
id,
|
|
95
|
+
record,
|
|
96
|
+
default: config.default,
|
|
97
|
+
write: async (value) => {
|
|
98
|
+
const next = { ...value };
|
|
99
|
+
if (!single) {
|
|
100
|
+
next[idField] = key;
|
|
25
101
|
}
|
|
102
|
+
return write(key, next);
|
|
103
|
+
},
|
|
104
|
+
drop: async () => {
|
|
105
|
+
const removed = store.get(key);
|
|
106
|
+
if (removed == null) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
store.delete(key);
|
|
110
|
+
notify('remove', [[key, removed]]);
|
|
26
111
|
}
|
|
27
112
|
});
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
113
|
+
models.set(key, { from: record, model });
|
|
114
|
+
return model;
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* The model for "nothing is addressed yet" — one instance, reused.
|
|
118
|
+
*
|
|
119
|
+
* It must be the SAME reference every time: a React subscriber compares snapshots by identity,
|
|
120
|
+
* and a freshly built model would read as a change on every render and loop. Writing through it
|
|
121
|
+
* is refused rather than silently dropped, because a caller that writes without an id has lost
|
|
122
|
+
* track of which record it meant.
|
|
123
|
+
*/
|
|
124
|
+
let blank;
|
|
125
|
+
const emptyModel = () => blank ??= createStateModel({
|
|
126
|
+
id: undefined,
|
|
127
|
+
record: undefined,
|
|
128
|
+
default: config.default,
|
|
129
|
+
write: async () => { throw new StateConfigError(StateConfigError.NoId); },
|
|
130
|
+
drop: async () => { throw new StateConfigError(StateConfigError.NoId); }
|
|
131
|
+
});
|
|
132
|
+
const queryModels = (watch) => sortRecords(filterRecords(records(), watch.where), watch.opts?.sort)
|
|
133
|
+
.map(record => modelFor(storedKey(record)));
|
|
134
|
+
const same = (left, right) => left.length === right.length && left.every((model, index) => model === right[index]);
|
|
135
|
+
/** Deliver on one channel. Returns what the handlers gave back, for a caller that awaits. */
|
|
136
|
+
const deliver = (event, channel) => {
|
|
137
|
+
const delivered = [];
|
|
138
|
+
for (const subscription of [...subscribers]) {
|
|
139
|
+
if (subscription.channel !== channel) {
|
|
140
|
+
continue;
|
|
32
141
|
}
|
|
33
|
-
|
|
34
|
-
|
|
142
|
+
if (subscription.once) {
|
|
143
|
+
subscribers.delete(subscription);
|
|
144
|
+
if (subscription.timer != null) {
|
|
145
|
+
clearTimeout(subscription.timer);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
delivered.push(subscription.handler(event));
|
|
149
|
+
}
|
|
150
|
+
return delivered;
|
|
35
151
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
152
|
+
/**
|
|
153
|
+
* Tell everyone what changed. Key watchers hear only about their own record; every live query
|
|
154
|
+
* is re-evaluated, because a write can move a record into a set it was not in and deciding
|
|
155
|
+
* whether it did is the same work as re-running the query.
|
|
156
|
+
*/
|
|
157
|
+
const notify = (type, changed) => {
|
|
158
|
+
if (changed.length < 1) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
for (const [key] of changed) {
|
|
162
|
+
const listeners = watchers.get(key);
|
|
163
|
+
if (listeners == null) {
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
const model = modelFor(key);
|
|
167
|
+
for (const listener of [...listeners]) {
|
|
168
|
+
listener(model);
|
|
169
|
+
}
|
|
39
170
|
}
|
|
40
|
-
for (const
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
171
|
+
for (const watch of [...queries]) {
|
|
172
|
+
const current = queryModels(watch);
|
|
173
|
+
if (same(watch.last, current)) {
|
|
174
|
+
continue;
|
|
175
|
+
}
|
|
176
|
+
watch.last = current;
|
|
177
|
+
watch.listener(current);
|
|
178
|
+
}
|
|
179
|
+
deliver({ type, records: changed.map(([, record]) => record) }, CHANGES);
|
|
180
|
+
/**
|
|
181
|
+
* A key nobody watches and nothing is stored under has no model worth keeping — otherwise the
|
|
182
|
+
* cache grows with every record the store ever held. A watched key keeps its entry, so an
|
|
183
|
+
* empty model stays the same object and a screen bound to a deleted record does not re-render
|
|
184
|
+
* on every unrelated write.
|
|
185
|
+
*/
|
|
186
|
+
for (const [key] of changed) {
|
|
187
|
+
if (!store.has(key) && !watchers.has(key)) {
|
|
188
|
+
models.delete(key);
|
|
45
189
|
}
|
|
46
190
|
}
|
|
47
191
|
};
|
|
192
|
+
const write = (key, record) => {
|
|
193
|
+
const value = { ...record };
|
|
194
|
+
store.set(key, value);
|
|
195
|
+
notify('set', [[key, value]]);
|
|
196
|
+
return value;
|
|
197
|
+
};
|
|
48
198
|
const resource = appendContextual(alias, {
|
|
49
|
-
|
|
50
|
-
|
|
199
|
+
config,
|
|
200
|
+
get: async (idOrWhere, opts) => {
|
|
201
|
+
const record = first(idOrWhere, opts);
|
|
51
202
|
if (record == null) {
|
|
52
|
-
throw new UnknownRecordError(
|
|
203
|
+
throw new UnknownRecordError(typeof idOrWhere === 'string' ? idOrWhere : 'criteria');
|
|
53
204
|
}
|
|
54
205
|
return record;
|
|
55
206
|
},
|
|
56
|
-
load: async (
|
|
57
|
-
|
|
58
|
-
|
|
207
|
+
load: async (idOrWhere, opts) => first(idOrWhere, opts),
|
|
208
|
+
/** Unpaged unless a size is asked for: a screen reading the store expects all of it. */
|
|
209
|
+
list: async (where, opts) => {
|
|
210
|
+
if (opts?.page != null && opts.size == null) {
|
|
211
|
+
throw new UnsupportedArgumentError('page-without-size');
|
|
59
212
|
}
|
|
60
|
-
|
|
61
|
-
throw new UnsupportedArgumentError(`${location}:get:opts`);
|
|
62
|
-
}
|
|
63
|
-
const record = store[id];
|
|
64
|
-
if (record == null) {
|
|
65
|
-
return null;
|
|
66
|
-
}
|
|
67
|
-
return record;
|
|
68
|
-
},
|
|
69
|
-
list: async (criteria, opts) => {
|
|
70
|
-
if (criteria != null) {
|
|
71
|
-
throw new UnsupportedArgumentError(`${location}:list:criteria`);
|
|
72
|
-
}
|
|
73
|
-
if (opts != null) {
|
|
74
|
-
throw new UnsupportedArgumentError(`${location}:list:opts`);
|
|
75
|
-
}
|
|
76
|
-
const result = {
|
|
77
|
-
items: Object.entries(store).map(([, record]) => record)
|
|
78
|
-
};
|
|
79
|
-
return result;
|
|
80
|
-
},
|
|
81
|
-
save: async (record, opts) => {
|
|
82
|
-
const id = record.id ?? DEFAULT_ID;
|
|
83
|
-
if (store[id] != null) {
|
|
84
|
-
return resource.update(record, opts);
|
|
85
|
-
}
|
|
86
|
-
return resource.create(record, opts);
|
|
213
|
+
return applyQuery(records(), where, opts);
|
|
87
214
|
},
|
|
215
|
+
count: async (where) => filterRecords(records(), where).length,
|
|
88
216
|
create: async (record, opts) => {
|
|
89
|
-
|
|
90
|
-
|
|
217
|
+
refuseTtl(opts);
|
|
218
|
+
const key = keyOf(record);
|
|
219
|
+
if (store.has(key)) {
|
|
220
|
+
throw new RecordExists(key === SOLE ? alias : key);
|
|
91
221
|
}
|
|
92
|
-
|
|
93
|
-
throw new RecordExists(record.id);
|
|
94
|
-
}
|
|
95
|
-
if (opts != null) {
|
|
96
|
-
throw new UnsupportedArgumentError(`${location}:create:opts`);
|
|
97
|
-
}
|
|
98
|
-
store[record.id] = record;
|
|
99
|
-
_notifyListeners(store[record.id]);
|
|
100
|
-
_notifyGlobalListeners([store[record.id]]);
|
|
101
|
-
return record;
|
|
222
|
+
return write(key, record);
|
|
102
223
|
},
|
|
224
|
+
/** Replaces the stored record rather than merging into it, as the contract says. */
|
|
103
225
|
update: async (record, opts) => {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
record.id = DEFAULT_ID;
|
|
226
|
+
refuseTtl(opts);
|
|
227
|
+
const key = keyOf(record);
|
|
228
|
+
if (!store.has(key)) {
|
|
229
|
+
throw new UnknownRecordError(key === SOLE ? alias : key);
|
|
109
230
|
}
|
|
110
|
-
|
|
111
|
-
if (reference == null) {
|
|
112
|
-
throw new UnknownRecordError(record.id);
|
|
113
|
-
}
|
|
114
|
-
Object.assign(reference, record);
|
|
115
|
-
_notifyListeners(reference);
|
|
116
|
-
_notifyGlobalListeners([reference]);
|
|
117
|
-
return reference;
|
|
231
|
+
return write(key, record);
|
|
118
232
|
},
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
const record =
|
|
233
|
+
save: async (record, opts) => {
|
|
234
|
+
refuseTtl(opts);
|
|
235
|
+
return write(keyOf(record), record);
|
|
236
|
+
},
|
|
237
|
+
delete: async (id) => {
|
|
238
|
+
const record = read(id);
|
|
125
239
|
if (record == null) {
|
|
126
240
|
return null;
|
|
127
241
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
delete store[_id];
|
|
132
|
-
_notifyListeners(record);
|
|
133
|
-
_notifyGlobalListeners([record]);
|
|
242
|
+
const key = keyFor(id);
|
|
243
|
+
store.delete(key);
|
|
244
|
+
notify('remove', [[key, record]]);
|
|
134
245
|
return record;
|
|
135
246
|
},
|
|
136
|
-
|
|
137
|
-
const
|
|
138
|
-
if (_id == null) {
|
|
139
|
-
throw new MisshapedRecord('id');
|
|
140
|
-
}
|
|
141
|
-
const record = await resource.delete(_id, opts);
|
|
247
|
+
take: async (id) => {
|
|
248
|
+
const record = await resource.delete(id);
|
|
142
249
|
if (record == null) {
|
|
143
|
-
throw new UnknownRecordError(
|
|
250
|
+
throw new UnknownRecordError(id);
|
|
144
251
|
}
|
|
145
252
|
return record;
|
|
146
253
|
},
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
const records = ids.map(id => {
|
|
151
|
-
if (store[id] == null) {
|
|
152
|
-
store[id] = { ...params.default, id };
|
|
153
|
-
}
|
|
154
|
-
return createStateModel(store[id], resource);
|
|
155
|
-
});
|
|
156
|
-
if (params._systemId != null) {
|
|
157
|
-
const key = `${params._systemId}:${ids.join(",")}`;
|
|
158
|
-
if (systemToListeners[key] != null) {
|
|
159
|
-
return [_usubscribe(params), records];
|
|
160
|
-
}
|
|
161
|
-
systemToListeners[key] = params.listener;
|
|
254
|
+
purge: async (where) => {
|
|
255
|
+
if (where == null || Object.keys(where).length < 1) {
|
|
256
|
+
throw new UnsupportedArgumentError('purge:empty-criteria');
|
|
162
257
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
258
|
+
const removed = filterRecords(records(), where)
|
|
259
|
+
.map((record) => [storedKey(record), record]);
|
|
260
|
+
for (const [key] of removed) {
|
|
261
|
+
store.delete(key);
|
|
262
|
+
}
|
|
263
|
+
notify('remove', removed);
|
|
264
|
+
return removed.length;
|
|
265
|
+
},
|
|
266
|
+
/**
|
|
267
|
+
* The store is rewritten before anything is told about it, so a subscriber never sees the
|
|
268
|
+
* half-applied set. On a `single` resource every record lands in the one slot, which means a
|
|
269
|
+
* list of several collapses to the last of them.
|
|
270
|
+
*/
|
|
271
|
+
replace: async (list) => {
|
|
272
|
+
const written = list.map((record) => [keyOf(record), { ...record }]);
|
|
273
|
+
const keys = new Set(written.map(([key]) => key));
|
|
274
|
+
const dropped = [...store.entries()].filter(([key]) => !keys.has(key));
|
|
275
|
+
for (const [key] of dropped) {
|
|
276
|
+
store.delete(key);
|
|
277
|
+
}
|
|
278
|
+
for (const [key, record] of written) {
|
|
279
|
+
store.set(key, record);
|
|
280
|
+
}
|
|
281
|
+
notify('remove', dropped);
|
|
282
|
+
notify('set', written);
|
|
176
283
|
},
|
|
177
|
-
|
|
178
|
-
|
|
284
|
+
clear: async () => {
|
|
285
|
+
const dropped = [...store.entries()];
|
|
286
|
+
store.clear();
|
|
287
|
+
notify('remove', dropped);
|
|
288
|
+
},
|
|
289
|
+
watch: (id, listener) => {
|
|
290
|
+
/**
|
|
291
|
+
* Watching before there is anything to watch is a RENDERING state, not a mistake.
|
|
292
|
+
*
|
|
293
|
+
* A screen binds to `useStoreModel(project.record.id)` while the project is still loading,
|
|
294
|
+
* so the id is legitimately absent for the first renders. Treating that as the
|
|
295
|
+
* configuration error it would be on `load()` or `save()` crashes the component tree over
|
|
296
|
+
* data that is simply not here yet. So an absent id on a listed resource watches nothing
|
|
297
|
+
* and reports an empty model; the error stays where it means something — a direct read or
|
|
298
|
+
* write with no id, which cannot be anything but a mistake.
|
|
299
|
+
*/
|
|
300
|
+
if (id == null && !single) {
|
|
301
|
+
listener(emptyModel());
|
|
302
|
+
return () => { };
|
|
303
|
+
}
|
|
304
|
+
const key = keyFor(id);
|
|
305
|
+
let listeners = watchers.get(key);
|
|
306
|
+
if (listeners == null) {
|
|
307
|
+
listeners = new Set();
|
|
308
|
+
watchers.set(key, listeners);
|
|
309
|
+
}
|
|
310
|
+
const bound = listeners;
|
|
311
|
+
bound.add(listener);
|
|
312
|
+
/**
|
|
313
|
+
* Seeded before `watch` returns, and seeded with nothing when the store holds nothing: an
|
|
314
|
+
* id subscription creates NO record, so a screen bound to an unknown id gets an empty
|
|
315
|
+
* model rather than putting a blank row into every list reading the same store.
|
|
316
|
+
*/
|
|
317
|
+
listener(modelFor(key));
|
|
318
|
+
/**
|
|
319
|
+
* The cached model outlives the subscription on purpose. A React subscriber takes its first
|
|
320
|
+
* snapshot by watching and stopping again, and a rebuilt model would read as a changed value
|
|
321
|
+
* the moment it subscribes for real. Keys the store no longer holds are dropped on the next
|
|
322
|
+
* change to them instead.
|
|
323
|
+
*/
|
|
179
324
|
return () => {
|
|
180
|
-
|
|
181
|
-
if (
|
|
182
|
-
|
|
325
|
+
bound.delete(listener);
|
|
326
|
+
if (bound.size < 1) {
|
|
327
|
+
watchers.delete(key);
|
|
183
328
|
}
|
|
184
329
|
};
|
|
185
330
|
},
|
|
186
|
-
|
|
187
|
-
|
|
331
|
+
query: (where, listener, opts) => {
|
|
332
|
+
const watch = { where, opts, listener, last: [] };
|
|
333
|
+
queries.add(watch);
|
|
334
|
+
watch.last = queryModels(watch);
|
|
335
|
+
listener(watch.last);
|
|
336
|
+
return () => { queries.delete(watch); };
|
|
337
|
+
},
|
|
338
|
+
/**
|
|
339
|
+
* Writes announce themselves on the default channel, so publishing is for what the store
|
|
340
|
+
* cannot know it did — a change that arrived from elsewhere, or a channel of a caller's own.
|
|
341
|
+
*/
|
|
342
|
+
publish: async (value, channel) => {
|
|
343
|
+
await Promise.all(deliver(value, channel ?? CHANGES));
|
|
344
|
+
},
|
|
345
|
+
subscribe: async (handler, opts) => {
|
|
346
|
+
const subscription = {
|
|
347
|
+
handler, channel: opts?.channel ?? CHANGES, once: opts?.once === true
|
|
348
|
+
};
|
|
349
|
+
subscribers.add(subscription);
|
|
350
|
+
const stop = async () => {
|
|
351
|
+
subscribers.delete(subscription);
|
|
352
|
+
if (subscription.timer != null) {
|
|
353
|
+
clearTimeout(subscription.timer);
|
|
354
|
+
subscription.timer = undefined;
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
if (opts?.ttl != null) {
|
|
358
|
+
subscription.timer = setTimeout(() => void stop(), expiresIn(opts.ttl));
|
|
359
|
+
}
|
|
360
|
+
return stop;
|
|
188
361
|
}
|
|
189
362
|
});
|
|
190
363
|
return resource;
|
|
191
364
|
};
|
|
192
|
-
|
|
193
|
-
|
|
365
|
+
/**
|
|
366
|
+
* Register a state resource on the context and expose `getStateResource`.
|
|
367
|
+
*
|
|
368
|
+
* Idempotent: appending the same alias twice keeps the resource that is already there, so a
|
|
369
|
+
* setup that runs more than once does not drop what the store has collected. The first alias
|
|
370
|
+
* appended is the one `getStateResource()` answers with when it is called without one.
|
|
371
|
+
*/
|
|
372
|
+
export const appendStateResource = (ctx, alias = STATE, cfg) => {
|
|
194
373
|
const _ctx = ctx;
|
|
195
|
-
_ctx.
|
|
374
|
+
if (!_ctx.hasResource(alias)) {
|
|
375
|
+
_ctx.registerResource(createStateResource(alias, cfg));
|
|
376
|
+
}
|
|
196
377
|
if (_ctx.getStateResource == null) {
|
|
197
|
-
_ctx.getStateResource =
|
|
378
|
+
_ctx.getStateResource = ((_alias) => ctx.resource(_alias ?? alias));
|
|
198
379
|
}
|
|
199
380
|
return _ctx;
|
|
200
381
|
};
|
package/build/resource.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource.js","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAA;AAGhH,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAGnD,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAA2B,KAAK,GAAW,aAAa,EAAoB,EAAE;IAC/G,MAAM,QAAQ,GAAG,kBAAkB,KAAK,EAAE,CAAA;IAE1C,MAAM,KAAK,GAAwB,EAAE,CAAA;IACrC,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAiC,CAAA;IACjE,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAA8B,CAAA;IAC9D,MAAM,eAAe,GAAuB,EAAE,CAAA;IAC9C,MAAM,iBAAiB,GAAqC,EAAE,CAAA;IAI9D,MAAM,sBAAsB,GAAG,CAAC,OAAY,EAAE,EAAE;QAC9C,eAAe,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAC1C,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,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