dacument 1.1.0 → 1.2.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.
@@ -32,6 +32,10 @@ export type ActorInfo = {
32
32
  privateKeyJwk: JsonWebKey;
33
33
  publicKeyJwk: JsonWebKey;
34
34
  };
35
+ export type ActorInfoUpdate = ActorInfo & {
36
+ currentPrivateKeyJwk?: JsonWebKey;
37
+ currentPublicKeyJwk?: JsonWebKey;
38
+ };
35
39
  export type RegisterSchema<T extends JsTypeName = JsTypeName> = {
36
40
  crdt: "register";
37
41
  jsType: T;
@@ -69,7 +73,7 @@ export type RecordSchema<T extends JsTypeName = JsTypeName> = {
69
73
  export type FieldSchema = RegisterSchema | TextSchema | ArraySchema | SetSchema | MapSchema | RecordSchema;
70
74
  export type SchemaDefinition = Record<string, FieldSchema>;
71
75
  export type SchemaId = string;
72
- export type OpKind = "acl.set" | "register.set" | "text.patch" | "array.patch" | "map.patch" | "set.patch" | "record.patch" | "ack";
76
+ export type OpKind = "acl.set" | "register.set" | "text.patch" | "array.patch" | "map.patch" | "set.patch" | "record.patch" | "ack" | "reset";
73
77
  export type OpPayload = {
74
78
  iss: string;
75
79
  sub: string;
@@ -84,6 +88,16 @@ export type SignedOp = {
84
88
  token: string;
85
89
  actorSig?: string;
86
90
  };
91
+ export type ResetPatch = {
92
+ newDocId: string;
93
+ reason?: string;
94
+ };
95
+ export type ResetState = {
96
+ ts: HLCStamp;
97
+ by: string;
98
+ newDocId: string;
99
+ reason?: string;
100
+ };
87
101
  export type DacumentChangeEvent = {
88
102
  type: "change";
89
103
  ops: SignedOp[];
@@ -106,11 +120,20 @@ export type DacumentRevokedEvent = {
106
120
  by: string;
107
121
  stamp: HLCStamp;
108
122
  };
123
+ export type DacumentResetEvent = {
124
+ type: "reset";
125
+ oldDocId: string;
126
+ newDocId: string;
127
+ ts: HLCStamp;
128
+ by: string;
129
+ reason?: string;
130
+ };
109
131
  export type DacumentEventMap = {
110
132
  change: DacumentChangeEvent;
111
133
  merge: DacumentMergeEvent;
112
134
  error: DacumentErrorEvent;
113
135
  revoked: DacumentRevokedEvent;
136
+ reset: DacumentResetEvent;
114
137
  };
115
138
  export type AclAssignment = {
116
139
  id: string;
@@ -2,8 +2,10 @@ export function isJsValue(value) {
2
2
  if (value === null)
3
3
  return true;
4
4
  const valueType = typeof value;
5
- if (valueType === "string" || valueType === "number" || valueType === "boolean")
5
+ if (valueType === "string" || valueType === "boolean")
6
6
  return true;
7
+ if (valueType === "number")
8
+ return Number.isFinite(value);
7
9
  if (Array.isArray(value))
8
10
  return value.every(isJsValue);
9
11
  if (valueType === "object") {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dacument",
3
- "version": "1.1.0",
4
- "description": "Schema-driven CRDT document with signed ops, role-based ACLs, and optional per-actor verification.",
3
+ "version": "1.2.1",
4
+ "description": "Schema-driven CRDT document with signed ops, role-based ACLs, and per-actor auditability.",
5
5
  "keywords": [
6
6
  "crdt",
7
7
  "document",
@@ -52,7 +52,7 @@
52
52
  "dependencies": {
53
53
  "bytecodec": "^2.1.0",
54
54
  "uuid": "^13.0.0",
55
- "zeyra": "^2.1.0"
55
+ "zeyra": "^2.2.0"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@types/node": "^25.0.3",