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.
- package/README.md +51 -20
- package/dist/CRArray/class.d.ts +3 -0
- package/dist/CRArray/class.js +147 -30
- package/dist/CRText/class.d.ts +4 -1
- package/dist/CRText/class.js +70 -17
- package/dist/Dacument/class.d.ts +30 -3
- package/dist/Dacument/class.js +362 -92
- package/dist/Dacument/types.d.ts +24 -1
- package/dist/Dacument/types.js +3 -1
- package/package.json +3 -3
package/dist/Dacument/class.d.ts
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
import { type AclAssignment, type
|
|
1
|
+
import { type AclAssignment, type ActorInfoUpdate, type DacumentEventMap, type DocFieldAccess, type DocSnapshot, type RoleKeys, type RolePublicKeys, type SchemaDefinition, type SchemaId, type SignedOp, type VerificationResult, type VerifyActorIntegrityOptions, type Role, array, map, record, register, set, text } from "./types.js";
|
|
2
|
+
type ResetStateInfo = {
|
|
3
|
+
ts: AclAssignment["stamp"];
|
|
4
|
+
by: string;
|
|
5
|
+
newDocId: string;
|
|
6
|
+
reason?: string;
|
|
7
|
+
};
|
|
2
8
|
export declare class Dacument<S extends SchemaDefinition> {
|
|
3
9
|
private static actorInfo?;
|
|
4
10
|
private static actorSigner?;
|
|
5
|
-
static
|
|
11
|
+
private static actorInfoPrevious?;
|
|
12
|
+
static setActorInfo(info: ActorInfoUpdate): Promise<void>;
|
|
6
13
|
private static requireActorInfo;
|
|
7
14
|
private static requireActorSigner;
|
|
8
15
|
private static signActorToken;
|
|
9
16
|
private static isValidActorId;
|
|
17
|
+
private static actorInfoForPublicKey;
|
|
10
18
|
private static assertActorKeyJwk;
|
|
11
19
|
private static assertActorPrivateKey;
|
|
12
20
|
private static assertActorPublicKey;
|
|
@@ -17,7 +25,7 @@ export declare class Dacument<S extends SchemaDefinition> {
|
|
|
17
25
|
static set: typeof set;
|
|
18
26
|
static map: typeof map;
|
|
19
27
|
static record: typeof record;
|
|
20
|
-
static computeSchemaId
|
|
28
|
+
private static computeSchemaId;
|
|
21
29
|
static create<Schema extends SchemaDefinition>(params: {
|
|
22
30
|
schema: Schema;
|
|
23
31
|
docId?: string;
|
|
@@ -48,6 +56,7 @@ export declare class Dacument<S extends SchemaDefinition> {
|
|
|
48
56
|
private readonly actorSigByToken;
|
|
49
57
|
private readonly appliedTokens;
|
|
50
58
|
private currentRole;
|
|
59
|
+
private resetState;
|
|
51
60
|
private readonly revokedCrdtByField;
|
|
52
61
|
private readonly deleteStampsByField;
|
|
53
62
|
private readonly tombstoneStampsByField;
|
|
@@ -60,6 +69,10 @@ export declare class Dacument<S extends SchemaDefinition> {
|
|
|
60
69
|
private actorKeyPublishPending;
|
|
61
70
|
private lastGcBarrier;
|
|
62
71
|
private snapshotFieldValues;
|
|
72
|
+
private resetError;
|
|
73
|
+
private assertNotReset;
|
|
74
|
+
private currentRoleFor;
|
|
75
|
+
private roleAt;
|
|
63
76
|
private recordActorSig;
|
|
64
77
|
readonly acl: {
|
|
65
78
|
setRole: (actorId: string, role: Role) => void;
|
|
@@ -78,7 +91,16 @@ export declare class Dacument<S extends SchemaDefinition> {
|
|
|
78
91
|
removeEventListener<K extends keyof DacumentEventMap>(type: K, listener: (event: DacumentEventMap[K]) => void): void;
|
|
79
92
|
flush(): Promise<void>;
|
|
80
93
|
snapshot(): DocSnapshot;
|
|
94
|
+
getResetState(): ResetStateInfo | null;
|
|
81
95
|
selfRevoke(): void;
|
|
96
|
+
accessReset(options?: {
|
|
97
|
+
reason?: string;
|
|
98
|
+
}): Promise<{
|
|
99
|
+
newDoc: DacumentDoc<S>;
|
|
100
|
+
oldDocOps: SignedOp[];
|
|
101
|
+
newDocSnapshot: DocSnapshot;
|
|
102
|
+
roleKeys: RoleKeys;
|
|
103
|
+
}>;
|
|
82
104
|
verifyActorIntegrity(options?: VerifyActorIntegrityOptions): Promise<VerificationResult>;
|
|
83
105
|
merge(input: SignedOp | SignedOp[] | string | string[]): Promise<{
|
|
84
106
|
accepted: SignedOp[];
|
|
@@ -86,6 +108,7 @@ export declare class Dacument<S extends SchemaDefinition> {
|
|
|
86
108
|
}>;
|
|
87
109
|
private rebuildFromVerified;
|
|
88
110
|
private maybePublishActorKey;
|
|
111
|
+
private actorSignatureKey;
|
|
89
112
|
private ack;
|
|
90
113
|
private scheduleAck;
|
|
91
114
|
private computeGcBarrier;
|
|
@@ -116,6 +139,7 @@ export declare class Dacument<S extends SchemaDefinition> {
|
|
|
116
139
|
private capturePatches;
|
|
117
140
|
private queueLocalOp;
|
|
118
141
|
private queueActorOp;
|
|
142
|
+
private applyResetPayload;
|
|
119
143
|
private applyRemotePayload;
|
|
120
144
|
private applyAclPayload;
|
|
121
145
|
private applyRegisterPayload;
|
|
@@ -139,9 +163,11 @@ export declare class Dacument<S extends SchemaDefinition> {
|
|
|
139
163
|
private recordValue;
|
|
140
164
|
private mapValue;
|
|
141
165
|
private fieldValue;
|
|
166
|
+
private materializeSchema;
|
|
142
167
|
private emitEvent;
|
|
143
168
|
private emitMerge;
|
|
144
169
|
private emitRevoked;
|
|
170
|
+
private emitReset;
|
|
145
171
|
private emitError;
|
|
146
172
|
private canWriteField;
|
|
147
173
|
private canWriteAcl;
|
|
@@ -154,3 +180,4 @@ export declare class Dacument<S extends SchemaDefinition> {
|
|
|
154
180
|
private assertSchemaKeys;
|
|
155
181
|
}
|
|
156
182
|
export type DacumentDoc<S extends SchemaDefinition> = Dacument<S> & DocFieldAccess<S>;
|
|
183
|
+
export {};
|