@mdbase-dev/connect-protocol 0.1.0-beta.120 → 0.1.0-beta.123
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.
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { CollectionFileDescriptor } from "./files.js";
|
|
2
|
+
export declare const CHANGE_EVENT_KINDS: {
|
|
3
|
+
readonly "mdbase.record.created": "record.created";
|
|
4
|
+
readonly "mdbase.record.modified": "record.updated";
|
|
5
|
+
readonly "mdbase.record.deleted": "record.deleted";
|
|
6
|
+
readonly "mdbase.record.renamed": "record.renamed";
|
|
7
|
+
readonly "mdbase.type.changed": "schema.changed";
|
|
8
|
+
readonly "mdbase.config.changed": "config.changed";
|
|
9
|
+
readonly "mdbase.contract.changed": "contract.changed";
|
|
10
|
+
readonly "mdbase.view.changed": "view.changed";
|
|
11
|
+
readonly "mdbase.view_source.changed": "view.changed";
|
|
12
|
+
readonly "mdbase.resource.changed": "file.changed";
|
|
13
|
+
readonly "mdbase.file.put": "file.put";
|
|
14
|
+
readonly "mdbase.file.remove": "file.removed";
|
|
15
|
+
readonly file_put: "file.put";
|
|
16
|
+
readonly file_remove: "file.removed";
|
|
17
|
+
readonly "mdbase.collection.invalidated": "gap";
|
|
18
|
+
};
|
|
19
|
+
export type KnownCollectionChangeType = keyof typeof CHANGE_EVENT_KINDS;
|
|
20
|
+
/** Optional metadata: older authorities may omit fields; null means unavailable. */
|
|
21
|
+
export interface RecordChangePayload {
|
|
22
|
+
path?: string | null;
|
|
23
|
+
from?: string | null;
|
|
24
|
+
to?: string | null;
|
|
25
|
+
previous_revision?: string | null;
|
|
26
|
+
revision?: string | null;
|
|
27
|
+
previous_types?: string[] | null;
|
|
28
|
+
types?: string[] | null;
|
|
29
|
+
changed_fields?: string[] | null;
|
|
30
|
+
body_changed?: boolean | null;
|
|
31
|
+
before?: Record<string, unknown> | null;
|
|
32
|
+
after?: Record<string, unknown> | null;
|
|
33
|
+
}
|
|
34
|
+
/** Optional metadata: older authorities may omit fields; null means unavailable. */
|
|
35
|
+
export interface ResourceChangePayload {
|
|
36
|
+
name?: string | null;
|
|
37
|
+
path?: string | null;
|
|
38
|
+
previous_revision?: string | null;
|
|
39
|
+
revision?: string | null;
|
|
40
|
+
reason?: string | null;
|
|
41
|
+
}
|
|
42
|
+
/** Optional metadata: older authorities may omit fields; null means unavailable. */
|
|
43
|
+
export interface FileChangePayload {
|
|
44
|
+
file?: CollectionFileDescriptor | null;
|
|
45
|
+
file_id?: string | null;
|
|
46
|
+
previous_path?: string | null;
|
|
47
|
+
revision?: string | null;
|
|
48
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// Generated by scripts/generate-change-events.mjs. Do not edit directly.
|
|
2
|
+
export const CHANGE_EVENT_KINDS = {
|
|
3
|
+
"mdbase.record.created": "record.created",
|
|
4
|
+
"mdbase.record.modified": "record.updated",
|
|
5
|
+
"mdbase.record.deleted": "record.deleted",
|
|
6
|
+
"mdbase.record.renamed": "record.renamed",
|
|
7
|
+
"mdbase.type.changed": "schema.changed",
|
|
8
|
+
"mdbase.config.changed": "config.changed",
|
|
9
|
+
"mdbase.contract.changed": "contract.changed",
|
|
10
|
+
"mdbase.view.changed": "view.changed",
|
|
11
|
+
"mdbase.view_source.changed": "view.changed",
|
|
12
|
+
"mdbase.resource.changed": "file.changed",
|
|
13
|
+
"mdbase.file.put": "file.put",
|
|
14
|
+
"mdbase.file.remove": "file.removed",
|
|
15
|
+
"file_put": "file.put",
|
|
16
|
+
"file_remove": "file.removed",
|
|
17
|
+
"mdbase.collection.invalidated": "gap"
|
|
18
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import type { ApplicationAuthorizationProof } from "./application-authorization.
|
|
|
8
8
|
export * from "./connect-problems.generated.js";
|
|
9
9
|
export * from "./files.js";
|
|
10
10
|
export * from "./operations.js";
|
|
11
|
+
export * from "./change-events.generated.js";
|
|
11
12
|
export * from "./mutation-fingerprint.js";
|
|
12
13
|
export * from "./compatibility.js";
|
|
13
14
|
export * from "./capabilities.js";
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import { YAML_DOCUMENT_RECORDS_CAPABILITY } from "./collection-setup.js";
|
|
|
3
3
|
export * from "./connect-problems.generated.js";
|
|
4
4
|
export * from "./files.js";
|
|
5
5
|
export * from "./operations.js";
|
|
6
|
+
export * from "./change-events.generated.js";
|
|
6
7
|
export * from "./mutation-fingerprint.js";
|
|
7
8
|
export * from "./compatibility.js";
|
|
8
9
|
export * from "./capabilities.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mdbase-dev/connect-protocol",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
3
|
+
"version": "0.1.0-beta.123",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.json",
|
|
39
|
-
"test": "node --test test/*.test.mjs && node ../../scripts/generate-connect-problems.mjs --check && node ../../scripts/generate-operation-catalog.mjs --check && node ../../scripts/generate-application-capabilities.mjs --check",
|
|
39
|
+
"test": "node --test test/*.test.mjs && node ../../scripts/generate-change-events.mjs --check && node ../../scripts/generate-connect-problems.mjs --check && node ../../scripts/generate-operation-catalog.mjs --check && node ../../scripts/generate-application-capabilities.mjs --check",
|
|
40
40
|
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"events": {
|
|
4
|
+
"mdbase.record.created": "record.created",
|
|
5
|
+
"mdbase.record.modified": "record.updated",
|
|
6
|
+
"mdbase.record.deleted": "record.deleted",
|
|
7
|
+
"mdbase.record.renamed": "record.renamed",
|
|
8
|
+
"mdbase.type.changed": "schema.changed",
|
|
9
|
+
"mdbase.config.changed": "config.changed",
|
|
10
|
+
"mdbase.contract.changed": "contract.changed",
|
|
11
|
+
"mdbase.view.changed": "view.changed",
|
|
12
|
+
"mdbase.view_source.changed": "view.changed",
|
|
13
|
+
"mdbase.resource.changed": "file.changed",
|
|
14
|
+
"mdbase.file.put": "file.put",
|
|
15
|
+
"mdbase.file.remove": "file.removed",
|
|
16
|
+
"file_put": "file.put",
|
|
17
|
+
"file_remove": "file.removed",
|
|
18
|
+
"mdbase.collection.invalidated": "gap"
|
|
19
|
+
},
|
|
20
|
+
"payloads": {
|
|
21
|
+
"RecordChangePayload": {
|
|
22
|
+
"path": "string",
|
|
23
|
+
"from": "string",
|
|
24
|
+
"to": "string",
|
|
25
|
+
"previous_revision": "string",
|
|
26
|
+
"revision": "string",
|
|
27
|
+
"previous_types": "strings",
|
|
28
|
+
"types": "strings",
|
|
29
|
+
"changed_fields": "strings",
|
|
30
|
+
"body_changed": "boolean",
|
|
31
|
+
"before": "object",
|
|
32
|
+
"after": "object"
|
|
33
|
+
},
|
|
34
|
+
"ResourceChangePayload": {
|
|
35
|
+
"name": "string",
|
|
36
|
+
"path": "string",
|
|
37
|
+
"previous_revision": "string",
|
|
38
|
+
"revision": "string",
|
|
39
|
+
"reason": "string"
|
|
40
|
+
},
|
|
41
|
+
"FileChangePayload": {
|
|
42
|
+
"file": "file",
|
|
43
|
+
"file_id": "string",
|
|
44
|
+
"previous_path": "string",
|
|
45
|
+
"revision": "string"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|