@procedures/client 0.14.0 → 0.14.1
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/CHANGELOG.md +36 -0
- package/README.md +12 -3
- package/dist/.tsbuildinfo +1 -1
- package/dist/adapters/http/server/body.d.ts +17 -0
- package/dist/adapters/http/server/body.d.ts.map +1 -0
- package/dist/adapters/http/server/body.js +44 -0
- package/dist/adapters/http/server/body.js.map +1 -0
- package/dist/adapters/http/server/cors.d.ts +24 -1
- package/dist/adapters/http/server/cors.d.ts.map +1 -1
- package/dist/adapters/http/server/cors.js +33 -1
- package/dist/adapters/http/server/cors.js.map +1 -1
- package/dist/adapters/http/server/handler.d.ts +3 -1
- package/dist/adapters/http/server/handler.d.ts.map +1 -1
- package/dist/adapters/http/server/handler.js +4 -34
- package/dist/adapters/http/server/handler.js.map +1 -1
- package/dist/browser.d.ts +4 -3
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +4 -1
- package/dist/browser.js.map +1 -1
- package/dist/events/publisher.d.ts.map +1 -1
- package/dist/events/publisher.js +10 -5
- package/dist/events/publisher.js.map +1 -1
- package/dist/events/rows.d.ts +12 -4
- package/dist/events/rows.d.ts.map +1 -1
- package/dist/events/rows.js +13 -16
- package/dist/events/rows.js.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/node.d.ts +10 -1
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +11 -0
- package/dist/node.js.map +1 -1
- package/dist/procedures/collection/admission.d.ts +77 -0
- package/dist/procedures/collection/admission.d.ts.map +1 -0
- package/dist/procedures/collection/admission.js +204 -0
- package/dist/procedures/collection/admission.js.map +1 -0
- package/dist/procedures/collection/changes.d.ts +3 -1
- package/dist/procedures/collection/changes.d.ts.map +1 -1
- package/dist/procedures/collection/changes.js +10 -6
- package/dist/procedures/collection/changes.js.map +1 -1
- package/dist/procedures/collection/index.d.ts +2 -0
- package/dist/procedures/collection/index.d.ts.map +1 -1
- package/dist/procedures/collection/index.js +2 -0
- package/dist/procedures/collection/index.js.map +1 -1
- package/dist/procedures/collection/patch-in-parts.d.ts +15 -0
- package/dist/procedures/collection/patch-in-parts.d.ts.map +1 -0
- package/dist/procedures/collection/patch-in-parts.js +47 -0
- package/dist/procedures/collection/patch-in-parts.js.map +1 -0
- package/dist/procedures/collection/procedures.d.ts +8 -0
- package/dist/procedures/collection/procedures.d.ts.map +1 -1
- package/dist/procedures/collection/procedures.js +54 -77
- package/dist/procedures/collection/procedures.js.map +1 -1
- package/dist/procedures/index.d.ts +2 -2
- package/dist/procedures/index.d.ts.map +1 -1
- package/dist/procedures/index.js +3 -1
- package/dist/procedures/index.js.map +1 -1
- package/dist/procedures/invoke.d.ts +5 -2
- package/dist/procedures/invoke.d.ts.map +1 -1
- package/dist/procedures/invoke.js +5 -1
- package/dist/procedures/invoke.js.map +1 -1
- package/dist/procedures/types.d.ts +7 -0
- package/dist/procedures/types.d.ts.map +1 -1
- package/dist/procedures/types.js.map +1 -1
- package/dist/server/index.d.ts +70 -5
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +26 -3
- package/dist/server/index.js.map +1 -1
- package/package.json +12 -1
- package/src/adapters/http/server/body.ts +43 -0
- package/src/adapters/http/server/cors.ts +42 -1
- package/src/adapters/http/server/handler.ts +7 -32
- package/src/browser.ts +9 -1
- package/src/events/publisher.ts +8 -5
- package/src/events/rows.ts +19 -6
- package/src/index.ts +9 -6
- package/src/node.ts +13 -1
- package/src/procedures/collection/admission.ts +243 -0
- package/src/procedures/collection/changes.ts +11 -5
- package/src/procedures/collection/index.ts +4 -0
- package/src/procedures/collection/patch-in-parts.ts +56 -0
- package/src/procedures/collection/procedures.ts +58 -80
- package/src/procedures/index.ts +7 -0
- package/src/procedures/invoke.ts +7 -2
- package/src/procedures/types.ts +8 -0
- package/src/server/index.ts +94 -17
|
@@ -1 +1 @@
|
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C;CACF"}
|
package/dist/events/rows.d.ts
CHANGED
|
@@ -7,13 +7,20 @@
|
|
|
7
7
|
* reaches a subscriber only through the same filter as a read.
|
|
8
8
|
*
|
|
9
9
|
* The rows are on a symbol key, so they stay in this process: JSON does not take them.
|
|
10
|
+
*
|
|
11
|
+
* The rows can have a rule of their own too (`admit`): the rule of the rows of a collection
|
|
12
|
+
* (roadmap CLI-41). Each subscriber applies it after the filter of the host, with the invocation
|
|
13
|
+
* of its subscription.
|
|
10
14
|
*/
|
|
15
|
+
import type { AdmitItem, Invocation } from "../procedures/invoke.js";
|
|
11
16
|
/** The rows of a published value, and the function that makes the value of the admitted rows. */
|
|
12
17
|
export interface PublishedRows {
|
|
13
18
|
/** The rows that the output filter examines, one at a time. */
|
|
14
19
|
readonly rows: readonly unknown[];
|
|
15
20
|
/** This function gives the value for a subscriber: `admitted[i]` tells if row `i` stays. */
|
|
16
21
|
keep(admitted: readonly boolean[]): unknown;
|
|
22
|
+
/** The rule of the rows themselves, with the invocation of the subscription. A row stays only when it gives true. */
|
|
23
|
+
readonly admit?: AdmitItem | undefined;
|
|
17
24
|
}
|
|
18
25
|
/**
|
|
19
26
|
* This function gives the value with its rows, for the filter of each subscriber. The rows are not
|
|
@@ -23,9 +30,10 @@ export declare function withRows<T extends object>(value: T, rows: PublishedRows
|
|
|
23
30
|
/** The rows of a published value, or undefined for a value without rows. */
|
|
24
31
|
export declare function rowsOf(value: unknown): PublishedRows | undefined;
|
|
25
32
|
/**
|
|
26
|
-
* The value of a published value for one subscriber: each row passes the filter
|
|
27
|
-
*
|
|
28
|
-
*
|
|
33
|
+
* The value of a published value for one subscriber: each row passes the filter of the host and
|
|
34
|
+
* the rule of the rows, and the value keeps the admitted rows. An error of a filter refuses the
|
|
35
|
+
* row. A rule of the rows refuses each row of a subscription without an invocation. Without rows,
|
|
36
|
+
* or without a filter and a rule, the value stays as it is.
|
|
29
37
|
*/
|
|
30
|
-
export declare function admittedValue(value: unknown, admit: ((item: unknown) => Promise<boolean>) | undefined): Promise<unknown>;
|
|
38
|
+
export declare function admittedValue(value: unknown, admit: ((item: unknown) => Promise<boolean>) | undefined, invocation?: Invocation): Promise<unknown>;
|
|
31
39
|
//# sourceMappingURL=rows.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rows.d.ts","sourceRoot":"","sources":["../../src/events/rows.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"rows.d.ts","sourceRoot":"","sources":["../../src/events/rows.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErE,iGAAiG;AACjG,MAAM,WAAW,aAAa;IAC5B,+DAA+D;IAC/D,QAAQ,CAAC,IAAI,EAAE,SAAS,OAAO,EAAE,CAAC;IAClC,4FAA4F;IAC5F,IAAI,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,GAAG,OAAO,CAAC;IAC5C,qHAAqH;IACrH,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACxC;AAKD;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,aAAa,GAAG,CAAC,CAE3E;AAED,4EAA4E;AAC5E,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,aAAa,GAAG,SAAS,CAIhE;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,SAAS,EAAE,UAAU,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,CAUvJ"}
|
package/dist/events/rows.js
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The rows of a published value (roadmap CLI-15).
|
|
3
|
-
*
|
|
4
|
-
* A value on the bus can hold rows of data: the values of a collection change event, for example.
|
|
5
|
-
* The publisher of the remote events gives each row to the output filter of the host (`admitItem`)
|
|
6
|
-
* for each subscriber, and each subscriber gets only the rows that its filter admits. Thus a row
|
|
7
|
-
* reaches a subscriber only through the same filter as a read.
|
|
8
|
-
*
|
|
9
|
-
* The rows are on a symbol key, so they stay in this process: JSON does not take them.
|
|
10
|
-
*/
|
|
11
1
|
/** The key of the rows of a published value. */
|
|
12
2
|
const ROWS = Symbol.for("procedures.publishedRows");
|
|
13
3
|
/**
|
|
@@ -25,15 +15,22 @@ export function rowsOf(value) {
|
|
|
25
15
|
return typeof rows === "object" && rows !== null ? rows : undefined;
|
|
26
16
|
}
|
|
27
17
|
/**
|
|
28
|
-
* The value of a published value for one subscriber: each row passes the filter
|
|
29
|
-
*
|
|
30
|
-
*
|
|
18
|
+
* The value of a published value for one subscriber: each row passes the filter of the host and
|
|
19
|
+
* the rule of the rows, and the value keeps the admitted rows. An error of a filter refuses the
|
|
20
|
+
* row. A rule of the rows refuses each row of a subscription without an invocation. Without rows,
|
|
21
|
+
* or without a filter and a rule, the value stays as it is.
|
|
31
22
|
*/
|
|
32
|
-
export async function admittedValue(value, admit) {
|
|
23
|
+
export async function admittedValue(value, admit, invocation) {
|
|
33
24
|
const rows = rowsOf(value);
|
|
34
|
-
|
|
25
|
+
const own = rows?.admit;
|
|
26
|
+
if (!rows || (!admit && !own))
|
|
35
27
|
return value;
|
|
36
|
-
const
|
|
28
|
+
const admits = async (row) => {
|
|
29
|
+
if (admit && !(await admit(row)))
|
|
30
|
+
return false;
|
|
31
|
+
return !own || (invocation !== undefined && (await own(row, invocation)) === true);
|
|
32
|
+
};
|
|
33
|
+
const admitted = await Promise.all(rows.rows.map((row) => admits(row).catch(() => false)));
|
|
37
34
|
return rows.keep(admitted);
|
|
38
35
|
}
|
|
39
36
|
//# sourceMappingURL=rows.js.map
|
package/dist/events/rows.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rows.js","sourceRoot":"","sources":["../../src/events/rows.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rows.js","sourceRoot":"","sources":["../../src/events/rows.ts"],"names":[],"mappings":"AA0BA,gDAAgD;AAChD,MAAM,IAAI,GAAkB,MAAM,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;AAEnE;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAmB,KAAQ,EAAE,IAAmB;IACtE,OAAO,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;AAChF,CAAC;AAED,4EAA4E;AAC5E,MAAM,UAAU,MAAM,CAAC,KAAc;IACnC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IAClE,MAAM,IAAI,GAAI,KAA8B,CAAC,IAAI,CAAC,CAAC;IACnD,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,CAAC,CAAC,CAAE,IAAsB,CAAC,CAAC,CAAC,SAAS,CAAC;AACzF,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,KAAc,EAAE,KAAwD,EAAE,UAAuB;IACnI,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC3B,MAAM,GAAG,GAAG,IAAI,EAAE,KAAK,CAAC;IACxB,IAAI,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IAC5C,MAAM,MAAM,GAAG,KAAK,EAAE,GAAY,EAAoB,EAAE;QACtD,IAAI,KAAK,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,GAAG,CAAC,CAAC;YAAE,OAAO,KAAK,CAAC;QAC/C,OAAO,CAAC,GAAG,IAAI,CAAC,UAAU,KAAK,SAAS,IAAI,CAAC,MAAM,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC;IACrF,CAAC,CAAC;IACF,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC3F,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC7B,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -5,14 +5,17 @@
|
|
|
5
5
|
* and transport adapters.
|
|
6
6
|
*
|
|
7
7
|
* This entry point is for Node. It exports the browser-safe entry point
|
|
8
|
-
* ("@procedures/client/browser")
|
|
8
|
+
* ("@procedures/client/browser"). It also exports the server transports, which use `http` and
|
|
9
|
+
* `ws`, but these exports are deprecated (CLI-6 step 1). Their entry is "@procedures/client/node".
|
|
10
|
+
* The next MINOR removes them from this entry, so the root imports no `http` and no `ws`.
|
|
9
11
|
*
|
|
10
12
|
* The `WebSocketTransport` of this entry uses the global `WebSocket`, because some applications
|
|
11
13
|
* bundle this entry for a browser. The Node entry "@procedures/client/node" has a
|
|
12
14
|
* `WebSocketTransport` whose sockets are of the `ws` package: a drop ends them at once.
|
|
13
15
|
*/
|
|
14
16
|
export * from "./browser.js";
|
|
15
|
-
export {
|
|
17
|
+
export { defaultServerUrlStrategy, rpcServerUrlStrategy } from "./adapters/http/server/strategies.js";
|
|
18
|
+
export { HttpServerTransport } from "./server/index.js";
|
|
16
19
|
export type { HttpServerTransportOptions, HttpUrlStrategy, } from "./server/index.js";
|
|
17
20
|
export { WebSocketServerTransport } from "./server/index.js";
|
|
18
21
|
export { checkBrowserRequest, hasAmbientCredentials, isLoopbackHost, isLoopbackAddress, hostNameOf } from "./server/browser-guard.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,cAAc,CAAC;AAK7B,OAAO,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAItG,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,YAAY,EACV,0BAA0B,EAC1B,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,cAAc,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACtI,YAAY,EAAE,mBAAmB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAElG,YAAY,EACV,+BAA+B,EAC/B,oBAAoB,EACpB,0BAA0B,EAC1B,gBAAgB,GACjB,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
* and transport adapters.
|
|
6
6
|
*
|
|
7
7
|
* This entry point is for Node. It exports the browser-safe entry point
|
|
8
|
-
* ("@procedures/client/browser")
|
|
8
|
+
* ("@procedures/client/browser"). It also exports the server transports, which use `http` and
|
|
9
|
+
* `ws`, but these exports are deprecated (CLI-6 step 1). Their entry is "@procedures/client/node".
|
|
10
|
+
* The next MINOR removes them from this entry, so the root imports no `http` and no `ws`.
|
|
9
11
|
*
|
|
10
12
|
* The `WebSocketTransport` of this entry uses the global `WebSocket`, because some applications
|
|
11
13
|
* bundle this entry for a browser. The Node entry "@procedures/client/node" has a
|
|
@@ -15,7 +17,11 @@ export * from "./browser.js";
|
|
|
15
17
|
// ============================================================================
|
|
16
18
|
// Server Transports (Node only)
|
|
17
19
|
// ============================================================================
|
|
18
|
-
export {
|
|
20
|
+
export { defaultServerUrlStrategy, rpcServerUrlStrategy } from "./adapters/http/server/strategies.js";
|
|
21
|
+
// Deprecated (CLI-6 step 1): import these from "@procedures/client/node". The next MINOR removes
|
|
22
|
+
// them from the root. ./server/index.ts holds the deprecated aliases, so an editor marks each old
|
|
23
|
+
// import, and each alias is the same class or type as the export of ./node.
|
|
24
|
+
export { HttpServerTransport } from "./server/index.js";
|
|
19
25
|
export { WebSocketServerTransport } from "./server/index.js";
|
|
20
26
|
export { checkBrowserRequest, hasAmbientCredentials, isLoopbackHost, isLoopbackAddress, hostNameOf } from "./server/browser-guard.js";
|
|
21
27
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,cAAc,cAAc,CAAC;AAE7B,+EAA+E;AAC/E,gCAAgC;AAChC,+EAA+E;AAC/E,OAAO,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AACtG,iGAAiG;AACjG,kGAAkG;AAClG,4EAA4E;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAKxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,cAAc,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC"}
|
package/dist/node.d.ts
CHANGED
|
@@ -18,18 +18,27 @@
|
|
|
18
18
|
* The option `addressing` of `procedureHandler` gives the method and the payload of a request
|
|
19
19
|
* (CLI-31). `urlAddressing()` is the default, and `bodyPathAddressing()` reads the path from the
|
|
20
20
|
* body of a single endpoint.
|
|
21
|
+
*
|
|
22
|
+
* The server transports are in this entry too (CLI-6): `HttpServerTransport`, the Express shim
|
|
23
|
+
* over `procedureHandler`, and `WebSocketServerTransport`. The root and `./server` also export
|
|
24
|
+
* them, but these exports are deprecated. The next MINOR removes them, so the root imports no
|
|
25
|
+
* `http` and no `ws`.
|
|
21
26
|
*/
|
|
22
27
|
export { WebSocketTransport } from "./adapters/websocket/client/node.js";
|
|
23
28
|
export type { WebSocketTransportOptions, WebSocketClass } from "./adapters/websocket/client/types.js";
|
|
24
29
|
export { writeNdjsonStream } from "./adapters/http/server/ndjson.js";
|
|
25
30
|
export type { WriteNdjsonStreamOptions, NdjsonError } from "./adapters/http/server/ndjson.js";
|
|
26
31
|
export { procedureHandler } from "./adapters/http/server/handler.js";
|
|
32
|
+
export { readJsonBody, BodyError } from "./adapters/http/server/body.js";
|
|
27
33
|
export type { ProcedureHandlerOptions, NodeProcedureHandler, NodeUrlStrategy, UrlRequest } from "./adapters/http/server/handler.js";
|
|
28
|
-
export type { CorsOptions } from "./adapters/http/server/cors.js";
|
|
34
|
+
export type { CorsOptions, CredentialedCorsOptions } from "./adapters/http/server/cors.js";
|
|
35
|
+
export { credentialedCors } from "./adapters/http/server/cors.js";
|
|
29
36
|
export type { RoutedRequest } from "./adapters/http/server/strategies.js";
|
|
30
37
|
export { defaultServerUrlStrategy, rpcServerUrlStrategy } from "./adapters/http/server/strategies.js";
|
|
31
38
|
export { urlAddressing, bodyPathAddressing } from "./adapters/http/server/addressing.js";
|
|
32
39
|
export type { Addressing, CallAddress, UrlAddressingOptions, BodyPathAddressingOptions } from "./adapters/http/server/addressing.js";
|
|
40
|
+
export { HttpServerTransport } from "./adapters/http/server/transport.js";
|
|
41
|
+
export type { HttpServerTransportOptions, HttpUrlStrategy } from "./adapters/http/server/types.js";
|
|
33
42
|
export { upgradeHandler } from "./adapters/websocket/server/upgrade.js";
|
|
34
43
|
export type { UpgradeHandlerOptions, NodeUpgradeHandler } from "./adapters/websocket/server/upgrade.js";
|
|
35
44
|
export { WebSocketServerTransport } from "./adapters/websocket/server/transport.js";
|
package/dist/node.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AACzE,YAAY,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AACtG,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,YAAY,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC9F,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAErE,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AACzE,YAAY,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AACpI,YAAY,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAE3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,YAAY,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAEtG,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AACzF,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,oBAAoB,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AAErI,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,YAAY,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AACnG,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AACxE,YAAY,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AACxG,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACpF,YAAY,EACV,+BAA+B,EAC/B,oBAAoB,EACpB,0BAA0B,EAC1B,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,sCAAsC,CAAC"}
|
package/dist/node.js
CHANGED
|
@@ -18,13 +18,24 @@
|
|
|
18
18
|
* The option `addressing` of `procedureHandler` gives the method and the payload of a request
|
|
19
19
|
* (CLI-31). `urlAddressing()` is the default, and `bodyPathAddressing()` reads the path from the
|
|
20
20
|
* body of a single endpoint.
|
|
21
|
+
*
|
|
22
|
+
* The server transports are in this entry too (CLI-6): `HttpServerTransport`, the Express shim
|
|
23
|
+
* over `procedureHandler`, and `WebSocketServerTransport`. The root and `./server` also export
|
|
24
|
+
* them, but these exports are deprecated. The next MINOR removes them, so the root imports no
|
|
25
|
+
* `http` and no `ws`.
|
|
21
26
|
*/
|
|
22
27
|
export { WebSocketTransport } from "./adapters/websocket/client/node.js";
|
|
23
28
|
export { writeNdjsonStream } from "./adapters/http/server/ndjson.js";
|
|
24
29
|
export { procedureHandler } from "./adapters/http/server/handler.js";
|
|
30
|
+
// The JSON body of a request, read to a limit: the procedure handler and the MCP face read it so (CLI-35)
|
|
31
|
+
export { readJsonBody, BodyError } from "./adapters/http/server/body.js";
|
|
32
|
+
// The credentialed CORS of the trusted origins of a host, for a route of the app (CLI-49)
|
|
33
|
+
export { credentialedCors } from "./adapters/http/server/cors.js";
|
|
25
34
|
export { defaultServerUrlStrategy, rpcServerUrlStrategy } from "./adapters/http/server/strategies.js";
|
|
26
35
|
// The addressing of a request: the URL (the default), or the path in the body of a single endpoint (CLI-31)
|
|
27
36
|
export { urlAddressing, bodyPathAddressing } from "./adapters/http/server/addressing.js";
|
|
37
|
+
// The server transports (CLI-6): the root and ./server export them only until the next MINOR
|
|
38
|
+
export { HttpServerTransport } from "./adapters/http/server/transport.js";
|
|
28
39
|
export { upgradeHandler } from "./adapters/websocket/server/upgrade.js";
|
|
29
40
|
export { WebSocketServerTransport } from "./adapters/websocket/server/transport.js";
|
|
30
41
|
//# sourceMappingURL=node.js.map
|
package/dist/node.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.js","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"node.js","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAEzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAErE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,0GAA0G;AAC1G,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAGzE,0FAA0F;AAC1F,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAElE,OAAO,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AACtG,4GAA4G;AAC5G,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAEzF,6FAA6F;AAC7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAE1E,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAExE,OAAO,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The rules of the rows of a served collection (roadmap CLI-41). A right can depend on the
|
|
3
|
+
* document: a `when` condition of Graph, or `accessAdmitItem()` of `@procedures/access`. The option
|
|
4
|
+
* `admission` of `createCollectionProcedures()` gives the rules as data:
|
|
5
|
+
*
|
|
6
|
+
* - `admit` examines each row `{ id, value }` that a read gives. It has the shape of `AdmitItem`,
|
|
7
|
+
* the output filter of a host. The change events with values give it the same rows for each
|
|
8
|
+
* subscriber, so the reads and the events obey one rule.
|
|
9
|
+
* - `guard` examines each write `{ op, id, doc, prev }` before the storage changes. A refused write
|
|
10
|
+
* gets `FORBIDDEN` with the reason `write-not-allowed`.
|
|
11
|
+
*
|
|
12
|
+
* The procedures apply the rules in one place: the view of the storage of a call
|
|
13
|
+
* (`admittedStorage()`). Each read and each write of each procedure goes through this view.
|
|
14
|
+
*
|
|
15
|
+
* - A refused row is absent: `get` gives undefined, `has` gives false, and the lists, `size`,
|
|
16
|
+
* `find` and `changes` do not have it. A delta of `changes` puts the id of a refused row in
|
|
17
|
+
* `deleted`, so a copy of the caller drops it.
|
|
18
|
+
* - An error of `admit` fails the read. It does not hide the rows, so a sync does not delete them.
|
|
19
|
+
* - The guard reads the stored item before the write. CLI-16 (`expectedVersion`) closes the gap of
|
|
20
|
+
* a write of another writer between that read and the write.
|
|
21
|
+
* - The rules get the invocation of the call (`ctx.invocation`). A call without an invocation gets
|
|
22
|
+
* no row and makes no write.
|
|
23
|
+
*/
|
|
24
|
+
import { type AdmitItem, type Invocation } from "../invoke.js";
|
|
25
|
+
import type { ProcedureContext } from "../types.js";
|
|
26
|
+
import type { CollectionStorage } from "./storage.js";
|
|
27
|
+
/** A row of a collection: the id and the stored item. The rule `admit` examines one row at a time. */
|
|
28
|
+
export interface CollectionRow {
|
|
29
|
+
readonly id: string;
|
|
30
|
+
readonly value: unknown;
|
|
31
|
+
}
|
|
32
|
+
/** A write of a collection, as the guard examines it. */
|
|
33
|
+
export interface CollectionWrite {
|
|
34
|
+
/**
|
|
35
|
+
* The operation. `setBatch` gives one `set` for each item. `deleteBatch` and `clear` give one
|
|
36
|
+
* `delete` for each id.
|
|
37
|
+
*/
|
|
38
|
+
readonly op: "set" | "patch" | "delete";
|
|
39
|
+
/** The id of the item. */
|
|
40
|
+
readonly id: string;
|
|
41
|
+
/** The item after the write: the value of a `set`, or the merged item of a `patch`. Undefined for a `delete`. */
|
|
42
|
+
readonly doc: unknown;
|
|
43
|
+
/** The stored item before the write. Undefined when the id has no item. */
|
|
44
|
+
readonly prev: unknown;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The guard of the writes of a collection. It gets each write and the invocation of the call. It
|
|
48
|
+
* gives true to permit the write. An error that it throws passes through, and the storage does
|
|
49
|
+
* not change.
|
|
50
|
+
*/
|
|
51
|
+
export type CollectionWriteGuard = (write: CollectionWrite, invocation: Invocation) => boolean | Promise<boolean>;
|
|
52
|
+
/** The rules of the rows of a served collection (roadmap CLI-41). Each rule is optional. */
|
|
53
|
+
export interface CollectionAdmission {
|
|
54
|
+
/**
|
|
55
|
+
* The rule of the rows. It gets each row `{ id, value }` of a read and the invocation of the
|
|
56
|
+
* call, and it gives true to admit the row. The change events with values apply it for each
|
|
57
|
+
* subscriber, with the invocation of the subscription.
|
|
58
|
+
*/
|
|
59
|
+
admit?: AdmitItem | undefined;
|
|
60
|
+
/** The guard of each `set`, `patch` and `delete`, also of the batches and of `clear`. */
|
|
61
|
+
guard?: CollectionWriteGuard | undefined;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* This function tells if the rule of the rows admits a row for a call. Without a rule, it gives
|
|
65
|
+
* true. A call without an invocation gets no row.
|
|
66
|
+
*/
|
|
67
|
+
export declare function admitsRow(admission: CollectionAdmission | undefined, ctx: ProcedureContext, id: string, value: unknown): Promise<boolean>;
|
|
68
|
+
/**
|
|
69
|
+
* This function gives the view of the storage of a call: the storage, with the rules of the
|
|
70
|
+
* collection for each read and each write. Without rules, it gives the storage itself.
|
|
71
|
+
*
|
|
72
|
+
* @param storage - The storage of the call: of the collection, or of its partition
|
|
73
|
+
* @param admission - The rules of the collection
|
|
74
|
+
* @param ctx - The context of the call. The rules get its invocation.
|
|
75
|
+
*/
|
|
76
|
+
export declare function admittedStorage<T>(storage: CollectionStorage<T>, admission: CollectionAdmission | undefined, ctx: ProcedureContext): CollectionStorage<T>;
|
|
77
|
+
//# sourceMappingURL=admission.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admission.d.ts","sourceRoot":"","sources":["../../../src/procedures/collection/admission.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAmB,KAAK,SAAS,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD,OAAO,KAAK,EAAE,iBAAiB,EAAuC,MAAM,cAAc,CAAC;AAG3F,sGAAsG;AACtG,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED,yDAAyD;AACzD,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,QAAQ,CAAC,EAAE,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC;IACxC,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,iHAAiH;IACjH,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;IACtB,2EAA2E;IAC3E,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;CACxB;AAED;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;AAElH,4FAA4F;AAC5F,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAC9B,yFAAyF;IACzF,KAAK,CAAC,EAAE,oBAAoB,GAAG,SAAS,CAAC;CAC1C;AAUD;;;GAGG;AACH,wBAAsB,SAAS,CAAC,SAAS,EAAE,mBAAmB,GAAG,SAAS,EAAE,GAAG,EAAE,gBAAgB,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAK/I;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,mBAAmB,GAAG,SAAS,EAAE,GAAG,EAAE,gBAAgB,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAmHzJ"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The rules of the rows of a served collection (roadmap CLI-41). A right can depend on the
|
|
3
|
+
* document: a `when` condition of Graph, or `accessAdmitItem()` of `@procedures/access`. The option
|
|
4
|
+
* `admission` of `createCollectionProcedures()` gives the rules as data:
|
|
5
|
+
*
|
|
6
|
+
* - `admit` examines each row `{ id, value }` that a read gives. It has the shape of `AdmitItem`,
|
|
7
|
+
* the output filter of a host. The change events with values give it the same rows for each
|
|
8
|
+
* subscriber, so the reads and the events obey one rule.
|
|
9
|
+
* - `guard` examines each write `{ op, id, doc, prev }` before the storage changes. A refused write
|
|
10
|
+
* gets `FORBIDDEN` with the reason `write-not-allowed`.
|
|
11
|
+
*
|
|
12
|
+
* The procedures apply the rules in one place: the view of the storage of a call
|
|
13
|
+
* (`admittedStorage()`). Each read and each write of each procedure goes through this view.
|
|
14
|
+
*
|
|
15
|
+
* - A refused row is absent: `get` gives undefined, `has` gives false, and the lists, `size`,
|
|
16
|
+
* `find` and `changes` do not have it. A delta of `changes` puts the id of a refused row in
|
|
17
|
+
* `deleted`, so a copy of the caller drops it.
|
|
18
|
+
* - An error of `admit` fails the read. It does not hide the rows, so a sync does not delete them.
|
|
19
|
+
* - The guard reads the stored item before the write. CLI-16 (`expectedVersion`) closes the gap of
|
|
20
|
+
* a write of another writer between that read and the write.
|
|
21
|
+
* - The rules get the invocation of the call (`ctx.invocation`). A call without an invocation gets
|
|
22
|
+
* no row and makes no write.
|
|
23
|
+
*/
|
|
24
|
+
import { InvocationError } from "../invoke.js";
|
|
25
|
+
import { applyPatch } from "./query.js";
|
|
26
|
+
import { patchInParts } from "./patch-in-parts.js";
|
|
27
|
+
/** The size of a page of a query of the storage, when the policy gives no `maxLimit`. */
|
|
28
|
+
const QUERY_PAGE = 1000;
|
|
29
|
+
/** The refusal of a write. */
|
|
30
|
+
function writeRefused(ctx, write) {
|
|
31
|
+
return new InvocationError("FORBIDDEN", `The rule of the collection does not permit the ${write.op} of "${write.id}"`, ctx.path, "write-not-allowed");
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* This function tells if the rule of the rows admits a row for a call. Without a rule, it gives
|
|
35
|
+
* true. A call without an invocation gets no row.
|
|
36
|
+
*/
|
|
37
|
+
export async function admitsRow(admission, ctx, id, value) {
|
|
38
|
+
const admit = admission?.admit;
|
|
39
|
+
if (!admit)
|
|
40
|
+
return true;
|
|
41
|
+
const invocation = ctx.invocation;
|
|
42
|
+
return invocation !== undefined && (await admit({ id, value }, invocation)) === true;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* This function gives the view of the storage of a call: the storage, with the rules of the
|
|
46
|
+
* collection for each read and each write. Without rules, it gives the storage itself.
|
|
47
|
+
*
|
|
48
|
+
* @param storage - The storage of the call: of the collection, or of its partition
|
|
49
|
+
* @param admission - The rules of the collection
|
|
50
|
+
* @param ctx - The context of the call. The rules get its invocation.
|
|
51
|
+
*/
|
|
52
|
+
export function admittedStorage(storage, admission, ctx) {
|
|
53
|
+
const admit = admission?.admit;
|
|
54
|
+
const guard = admission?.guard;
|
|
55
|
+
if (!admit && !guard)
|
|
56
|
+
return storage;
|
|
57
|
+
const invocation = ctx.invocation;
|
|
58
|
+
const admits = (id, value) => admitsRow(admission, ctx, id, value);
|
|
59
|
+
/** The entries that the rule admits, in their order. */
|
|
60
|
+
const admitted = async (entries) => {
|
|
61
|
+
if (!admit)
|
|
62
|
+
return entries;
|
|
63
|
+
const keep = await Promise.all(entries.map(([id, value]) => admits(id, value)));
|
|
64
|
+
return entries.filter((_, index) => keep[index]);
|
|
65
|
+
};
|
|
66
|
+
/** The entries of the storage that the rule admits. The rule needs the ids, so the storage must give them. */
|
|
67
|
+
const entries = async () => {
|
|
68
|
+
if (!storage.getEntries)
|
|
69
|
+
throw new Error("The storage cannot give the ids of its items, so the rule of the rows cannot examine them");
|
|
70
|
+
return admitted(await storage.getEntries());
|
|
71
|
+
};
|
|
72
|
+
/** This function throws `FORBIDDEN` unless the guard permits each write. */
|
|
73
|
+
const permit = async (writes) => {
|
|
74
|
+
if (!guard)
|
|
75
|
+
return;
|
|
76
|
+
for (const write of writes) {
|
|
77
|
+
if (invocation === undefined || (await guard(write, invocation)) !== true)
|
|
78
|
+
throw writeRefused(ctx, write);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
const view = {
|
|
82
|
+
async get(id) {
|
|
83
|
+
const value = await storage.get(id);
|
|
84
|
+
return value === undefined || (await admits(id, value)) ? value : undefined;
|
|
85
|
+
},
|
|
86
|
+
async getAll() {
|
|
87
|
+
return admit ? (await entries()).map(([, value]) => value) : storage.getAll();
|
|
88
|
+
},
|
|
89
|
+
async find(predicate) {
|
|
90
|
+
return admit ? (await entries()).map(([, value]) => value).filter(predicate) : storage.find(predicate);
|
|
91
|
+
},
|
|
92
|
+
async has(id) {
|
|
93
|
+
return admit ? (await view.get(id)) !== undefined : storage.has(id);
|
|
94
|
+
},
|
|
95
|
+
async size() {
|
|
96
|
+
return admit ? (await entries()).length : storage.size();
|
|
97
|
+
},
|
|
98
|
+
async getBatch(ids) {
|
|
99
|
+
const found = await storage.getBatch(ids);
|
|
100
|
+
if (!admit)
|
|
101
|
+
return found;
|
|
102
|
+
const kept = await admitted([...found.entries()]);
|
|
103
|
+
return new Map(kept);
|
|
104
|
+
},
|
|
105
|
+
async set(id, value, options) {
|
|
106
|
+
if (guard)
|
|
107
|
+
await permit([{ op: "set", id, doc: value, prev: await storage.get(id) }]);
|
|
108
|
+
return storage.set(id, value, options);
|
|
109
|
+
},
|
|
110
|
+
async delete(id, options) {
|
|
111
|
+
if (guard)
|
|
112
|
+
await permit([{ op: "delete", id, doc: undefined, prev: await storage.get(id) }]);
|
|
113
|
+
return storage.delete(id, options);
|
|
114
|
+
},
|
|
115
|
+
async clear(options) {
|
|
116
|
+
if (!guard)
|
|
117
|
+
return storage.clear(options);
|
|
118
|
+
// Each item is a delete that the guard examines. The storage deletes only the items that it examined.
|
|
119
|
+
if (!storage.getEntries)
|
|
120
|
+
throw new Error("The storage cannot give the ids of its items, so the guard cannot examine a clear");
|
|
121
|
+
const all = await storage.getEntries();
|
|
122
|
+
await permit(all.map(([id, prev]) => ({ op: "delete", id, doc: undefined, prev })));
|
|
123
|
+
if (all.length > 0)
|
|
124
|
+
await storage.deleteBatch(all.map(([id]) => id), options);
|
|
125
|
+
},
|
|
126
|
+
async setBatch(items, options) {
|
|
127
|
+
if (guard) {
|
|
128
|
+
const before = await storage.getBatch(items.map(([id]) => id));
|
|
129
|
+
await permit(items.map(([id, value]) => ({ op: "set", id, doc: value, prev: before.get(id) })));
|
|
130
|
+
}
|
|
131
|
+
return storage.setBatch(items, options);
|
|
132
|
+
},
|
|
133
|
+
async deleteBatch(ids, options) {
|
|
134
|
+
if (guard) {
|
|
135
|
+
const before = await storage.getBatch(ids);
|
|
136
|
+
await permit(ids.map((id) => ({ op: "delete", id, doc: undefined, prev: before.get(id) })));
|
|
137
|
+
}
|
|
138
|
+
return storage.deleteBatch(ids, options);
|
|
139
|
+
},
|
|
140
|
+
async patch(id, fields, options) {
|
|
141
|
+
const check = async (prev, doc) => permit([{ op: "patch", id, doc, prev }]);
|
|
142
|
+
if (!storage.patch)
|
|
143
|
+
return patchInParts(storage, id, fields, options, guard ? check : undefined);
|
|
144
|
+
if (guard) {
|
|
145
|
+
const prev = await storage.get(id);
|
|
146
|
+
// A patch of a missing id changes nothing
|
|
147
|
+
if (prev === undefined)
|
|
148
|
+
return undefined;
|
|
149
|
+
await check(prev, applyPatch(prev, fields));
|
|
150
|
+
}
|
|
151
|
+
return storage.patch(id, fields, options);
|
|
152
|
+
},
|
|
153
|
+
close: () => storage.close(),
|
|
154
|
+
};
|
|
155
|
+
if (storage.getEntries)
|
|
156
|
+
view.getEntries = async () => (admit ? entries() : storage.getEntries());
|
|
157
|
+
if (admit ? storage.getEntries : storage.getIds) {
|
|
158
|
+
view.getIds = async () => (admit ? (await entries()).map(([id]) => id) : storage.getIds());
|
|
159
|
+
}
|
|
160
|
+
if (storage.getChangesSince) {
|
|
161
|
+
view.getChangesSince = async (since) => {
|
|
162
|
+
const changes = await storage.getChangesSince(since);
|
|
163
|
+
if (!admit)
|
|
164
|
+
return changes;
|
|
165
|
+
const changed = await admitted(changes.changed);
|
|
166
|
+
if (changes.full)
|
|
167
|
+
return { ...changes, changed };
|
|
168
|
+
// A delta: the copy of the caller drops each refused row
|
|
169
|
+
const kept = new Set(changed.map(([id]) => id));
|
|
170
|
+
const refused = changes.changed.filter(([id]) => !kept.has(id)).map(([id]) => id);
|
|
171
|
+
return { ...changes, changed, deleted: [...changes.deleted, ...refused] };
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
if (storage.query) {
|
|
175
|
+
view.query = async (selector, options, policy) => admit ? admittedQuery(storage, admitted, selector, options ?? {}, policy) : storage.query(selector, options, policy);
|
|
176
|
+
}
|
|
177
|
+
return view;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* The query of a storage with the rule of the rows. The storage runs the selector and the order,
|
|
181
|
+
* page by page. The skip and the limit count the admitted rows only, so a page of the caller is full.
|
|
182
|
+
*/
|
|
183
|
+
async function admittedQuery(storage, admitted, selector, options, policy) {
|
|
184
|
+
const page = policy?.maxLimit !== undefined && Number.isFinite(policy.maxLimit) ? policy.maxLimit : QUERY_PAGE;
|
|
185
|
+
const skip = options.skip ?? 0;
|
|
186
|
+
const limit = options.limit;
|
|
187
|
+
const out = [];
|
|
188
|
+
let skipped = 0;
|
|
189
|
+
for (let offset = 0;; offset += page) {
|
|
190
|
+
const rows = await storage.query(selector, { ...(options.sort !== undefined && { sort: options.sort }), skip: offset, limit: page }, policy);
|
|
191
|
+
for (const entry of await admitted(rows)) {
|
|
192
|
+
if (skipped < skip) {
|
|
193
|
+
skipped++;
|
|
194
|
+
continue;
|
|
195
|
+
}
|
|
196
|
+
out.push(entry);
|
|
197
|
+
if (limit !== undefined && out.length >= limit)
|
|
198
|
+
return out;
|
|
199
|
+
}
|
|
200
|
+
if (rows.length < page)
|
|
201
|
+
return out;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
//# sourceMappingURL=admission.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admission.js","sourceRoot":"","sources":["../../../src/procedures/collection/admission.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,eAAe,EAAmC,MAAM,cAAc,CAAC;AAEhF,OAAO,EAAE,UAAU,EAA8F,MAAM,YAAY,CAAC;AAEpI,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AA0CnD,yFAAyF;AACzF,MAAM,UAAU,GAAG,IAAI,CAAC;AAExB,8BAA8B;AAC9B,SAAS,YAAY,CAAC,GAAqB,EAAE,KAAsB;IACjE,OAAO,IAAI,eAAe,CAAC,WAAW,EAAE,kDAAkD,KAAK,CAAC,EAAE,QAAQ,KAAK,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;AACxJ,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,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,CAAC,UAAU,CAAC;IAC/G,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC;IAC/B,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAC5B,MAAM,GAAG,GAAuB,EAAE,CAAC;IACnC,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,KAAK,IAAI,MAAM,GAAG,CAAC,GAAI,MAAM,IAAI,IAAI,EAAE,CAAC;QACtC,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,KAAM,CAAC,QAAQ,EAAE,EAAE,GAAG,CAAC,OAAO,CAAC,IAAI,KAAK,SAAS,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,MAAM,CAAC,CAAC;QAC9I,KAAK,MAAM,KAAK,IAAI,MAAM,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YACzC,IAAI,OAAO,GAAG,IAAI,EAAE,CAAC;gBACnB,OAAO,EAAE,CAAC;gBACV,SAAS;YACX,CAAC;YACD,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAChB,IAAI,KAAK,KAAK,SAAS,IAAI,GAAG,CAAC,MAAM,IAAI,KAAK;gBAAE,OAAO,GAAG,CAAC;QAC7D,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,GAAG,IAAI;YAAE,OAAO,GAAG,CAAC;IACrC,CAAC;AACH,CAAC"}
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
* write resolves after its event is on the bus. A failed publish never fails the write.
|
|
25
25
|
*/
|
|
26
26
|
import type { EventBus } from "../../events/types.js";
|
|
27
|
+
import type { AdmitItem } from "../invoke.js";
|
|
27
28
|
import type { StorageChanges } from "./storage.js";
|
|
28
29
|
/**
|
|
29
30
|
* The change event of the writes of a collection, on the topic `collections.<name>` (roadmap
|
|
@@ -82,8 +83,9 @@ interface ChangeLog {
|
|
|
82
83
|
* @param origin - The origin of the write
|
|
83
84
|
* @param write - The write
|
|
84
85
|
* @param values - True: the events carry the values, for the output filter of each subscriber
|
|
86
|
+
* @param admit - The rule of the rows of the collection: each subscriber applies it to the values (roadmap CLI-41)
|
|
85
87
|
*/
|
|
86
|
-
export declare function writeWithChangeEvent<R>(bus: EventBus | undefined, storage: object & ChangeLog, topic: string | undefined, ids: readonly string[] | "*", origin: string | undefined, write: () => Promise<R>, values?: boolean): Promise<R>;
|
|
88
|
+
export declare function writeWithChangeEvent<R>(bus: EventBus | undefined, storage: object & ChangeLog, topic: string | undefined, ids: readonly string[] | "*", origin: string | undefined, write: () => Promise<R>, values?: boolean, admit?: AdmitItem): Promise<R>;
|
|
87
89
|
/**
|
|
88
90
|
* This function starts the chain of the events of a storage at the version of a call of
|
|
89
91
|
* `changes`, when the chain has no version. The subscriber that made the call then applies the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changes.d.ts","sourceRoot":"","sources":["../../../src/procedures/collection/changes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,uFAAuF;IACvF,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,qFAAqF;IACrF,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,iCAAiC;IACjC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;QAAE,QAAQ,CAAC,EAAE,EAAE,MAAM,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