@powerhousedao/shared 6.0.0-dev.104 → 6.0.0-dev.106
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/dist/analytics/index.d.ts +42 -4
- package/dist/analytics/index.d.ts.map +1 -1
- package/dist/analytics/index.js +307 -4
- package/dist/analytics/index.js.map +1 -1
- package/dist/clis/index.d.mts +1271 -0
- package/dist/clis/index.d.mts.map +1 -0
- package/dist/clis/index.mjs +6801 -0
- package/dist/clis/index.mjs.map +1 -0
- package/dist/connect/index.d.ts +866 -1
- package/dist/connect/index.d.ts.map +1 -1
- package/dist/connect/index.js +254 -1
- package/dist/connect/index.js.map +1 -1
- package/dist/constants.d.ts +8 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +41 -0
- package/dist/constants.js.map +1 -0
- package/dist/document-drive/index.d.ts +546 -0
- package/dist/document-drive/index.d.ts.map +1 -0
- package/dist/document-drive/index.js +956 -0
- package/dist/document-drive/index.js.map +1 -0
- package/dist/document-model/index.d.ts +3 -5
- package/dist/document-model/index.js +3408 -2
- package/dist/document-model/index.js.map +1 -1
- package/dist/index-dg_xL7sp.d.ts +567 -0
- package/dist/index-dg_xL7sp.d.ts.map +1 -0
- package/dist/processors/index.d.ts +2 -5
- package/dist/processors/index.js +116 -3
- package/dist/processors/index.js.map +1 -1
- package/dist/registry/index.d.ts +46 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/index.js +0 -0
- package/dist/types-DWXYsIF1.d.ts +158 -0
- package/dist/types-DWXYsIF1.d.ts.map +1 -0
- package/dist/types-faUXKACL.d.ts +2153 -0
- package/dist/types-faUXKACL.d.ts.map +1 -0
- package/package.json +44 -4
- package/dist/analytics/analytics-path.d.ts +0 -36
- package/dist/analytics/analytics-path.d.ts.map +0 -1
- package/dist/analytics/analytics-path.js +0 -170
- package/dist/analytics/analytics-path.js.map +0 -1
- package/dist/analytics/analytics-period.d.ts +0 -40
- package/dist/analytics/analytics-period.d.ts.map +0 -1
- package/dist/analytics/analytics-period.js +0 -204
- package/dist/analytics/analytics-period.js.map +0 -1
- package/dist/analytics/constants.d.ts +0 -35
- package/dist/analytics/constants.d.ts.map +0 -1
- package/dist/analytics/constants.js +0 -40
- package/dist/analytics/constants.js.map +0 -1
- package/dist/analytics/types.d.ts +0 -85
- package/dist/analytics/types.d.ts.map +0 -1
- package/dist/analytics/types.js +0 -2
- package/dist/analytics/types.js.map +0 -1
- package/dist/connect/env-config.d.ts +0 -862
- package/dist/connect/env-config.d.ts.map +0 -1
- package/dist/connect/env-config.js +0 -525
- package/dist/connect/env-config.js.map +0 -1
- package/dist/document-model/core/actions.d.ts +0 -62
- package/dist/document-model/core/actions.d.ts.map +0 -1
- package/dist/document-model/core/actions.js +0 -2
- package/dist/document-model/core/actions.js.map +0 -1
- package/dist/document-model/core/constants.d.ts +0 -6
- package/dist/document-model/core/constants.d.ts.map +0 -1
- package/dist/document-model/core/constants.js +0 -8
- package/dist/document-model/core/constants.js.map +0 -1
- package/dist/document-model/core/documents.d.ts +0 -102
- package/dist/document-model/core/documents.d.ts.map +0 -1
- package/dist/document-model/core/documents.js +0 -2
- package/dist/document-model/core/documents.js.map +0 -1
- package/dist/document-model/core/operations.d.ts +0 -74
- package/dist/document-model/core/operations.d.ts.map +0 -1
- package/dist/document-model/core/operations.js +0 -2
- package/dist/document-model/core/operations.js.map +0 -1
- package/dist/document-model/core/ph-types.d.ts +0 -7
- package/dist/document-model/core/ph-types.d.ts.map +0 -1
- package/dist/document-model/core/ph-types.js +0 -2
- package/dist/document-model/core/ph-types.js.map +0 -1
- package/dist/document-model/core/signatures.d.ts +0 -52
- package/dist/document-model/core/signatures.d.ts.map +0 -1
- package/dist/document-model/core/signatures.js +0 -2
- package/dist/document-model/core/signatures.js.map +0 -1
- package/dist/document-model/core/state.d.ts +0 -38
- package/dist/document-model/core/state.d.ts.map +0 -1
- package/dist/document-model/core/state.js +0 -2
- package/dist/document-model/core/state.js.map +0 -1
- package/dist/document-model/core/types.d.ts +0 -533
- package/dist/document-model/core/types.d.ts.map +0 -1
- package/dist/document-model/core/types.js +0 -2
- package/dist/document-model/core/types.js.map +0 -1
- package/dist/document-model/core/upgrades.d.ts +0 -24
- package/dist/document-model/core/upgrades.d.ts.map +0 -1
- package/dist/document-model/core/upgrades.js +0 -2
- package/dist/document-model/core/upgrades.js.map +0 -1
- package/dist/document-model/index.d.ts.map +0 -1
- package/dist/document-model/types.d.ts +0 -97
- package/dist/document-model/types.d.ts.map +0 -1
- package/dist/document-model/types.js +0 -2
- package/dist/document-model/types.js.map +0 -1
- package/dist/processors/constants.d.ts +0 -4
- package/dist/processors/constants.d.ts.map +0 -1
- package/dist/processors/constants.js +0 -4
- package/dist/processors/constants.js.map +0 -1
- package/dist/processors/drive-analytics/document-processor.d.ts +0 -10
- package/dist/processors/drive-analytics/document-processor.d.ts.map +0 -1
- package/dist/processors/drive-analytics/document-processor.js +0 -43
- package/dist/processors/drive-analytics/document-processor.js.map +0 -1
- package/dist/processors/drive-analytics/drive-processor.d.ts +0 -10
- package/dist/processors/drive-analytics/drive-processor.d.ts.map +0 -1
- package/dist/processors/drive-analytics/drive-processor.js +0 -85
- package/dist/processors/drive-analytics/drive-processor.js.map +0 -1
- package/dist/processors/drive-analytics/index.d.ts +0 -10
- package/dist/processors/drive-analytics/index.d.ts.map +0 -1
- package/dist/processors/drive-analytics/index.js +0 -28
- package/dist/processors/drive-analytics/index.js.map +0 -1
- package/dist/processors/drive-analytics/types.d.ts +0 -3
- package/dist/processors/drive-analytics/types.d.ts.map +0 -1
- package/dist/processors/drive-analytics/types.js +0 -2
- package/dist/processors/drive-analytics/types.js.map +0 -1
- package/dist/processors/index.d.ts.map +0 -1
- package/dist/processors/relational/types.d.ts +0 -72
- package/dist/processors/relational/types.d.ts.map +0 -1
- package/dist/processors/relational/types.js +0 -45
- package/dist/processors/relational/types.js.map +0 -1
- package/dist/processors/relational/utils.d.ts +0 -29
- package/dist/processors/relational/utils.d.ts.map +0 -1
- package/dist/processors/relational/utils.js +0 -67
- package/dist/processors/relational/utils.js.map +0 -1
- package/dist/processors/types.d.ts +0 -90
- package/dist/processors/types.d.ts.map +0 -1
- package/dist/processors/types.js +0 -2
- package/dist/processors/types.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
|
@@ -0,0 +1,2153 @@
|
|
|
1
|
+
import { f as IAnalyticsStore } from "./types-DWXYsIF1.js";
|
|
2
|
+
import { Draft } from "mutative";
|
|
3
|
+
import { OperationWithContext } from "@powerhousedao/shared/document-model";
|
|
4
|
+
import { Kysely, QueryCreator } from "kysely";
|
|
5
|
+
import { FC, ReactNode } from "react";
|
|
6
|
+
|
|
7
|
+
//#region processors/constants.d.ts
|
|
8
|
+
declare const PROCESSOR_APPS: readonly ["connect", "switchboard"];
|
|
9
|
+
declare const DEFAULT_RELATIONAL_PROCESSOR_DB_NAME = "relational-db";
|
|
10
|
+
declare const DEFAULT_ANALYTICS_PROCESSOR_DB_NAME = "analytics-db";
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region document-model/signatures.d.ts
|
|
13
|
+
/**
|
|
14
|
+
* A signature of an action.
|
|
15
|
+
*
|
|
16
|
+
* This will be refactored in a future release.
|
|
17
|
+
*/
|
|
18
|
+
type Signature = [string, string, string, string, string];
|
|
19
|
+
/**
|
|
20
|
+
* A user action signer.
|
|
21
|
+
*/
|
|
22
|
+
type UserActionSigner = {
|
|
23
|
+
address: string;
|
|
24
|
+
networkId: string;
|
|
25
|
+
chainId: number;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* An app action signer.
|
|
29
|
+
*/
|
|
30
|
+
type AppActionSigner = {
|
|
31
|
+
name: string;
|
|
32
|
+
key: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* An action signer.
|
|
36
|
+
*/
|
|
37
|
+
type ActionSigner = {
|
|
38
|
+
user: UserActionSigner;
|
|
39
|
+
app: AppActionSigner;
|
|
40
|
+
signatures: Signature[];
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Information to verify the document creator.
|
|
44
|
+
*/
|
|
45
|
+
type PHDocumentSignatureInfo = {
|
|
46
|
+
/**
|
|
47
|
+
* The public key of the document creator.
|
|
48
|
+
**/
|
|
49
|
+
publicKey: JsonWebKey; /** The nonce that was appended to the message to create the signature. */
|
|
50
|
+
nonce: string;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Configuration for hashing document state in operations.
|
|
54
|
+
*/
|
|
55
|
+
type HashConfig = {
|
|
56
|
+
/** The hashing algorithm to use (e.g., "sha1", "sha256") */algorithm: string; /** The encoding format for the hash output (e.g., "base64", "hex") */
|
|
57
|
+
encoding: string; /** Optional algorithm-specific parameters */
|
|
58
|
+
params?: Record<string, unknown>;
|
|
59
|
+
};
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region document-model/state.d.ts
|
|
62
|
+
/**
|
|
63
|
+
* Creates a default PHAuthState
|
|
64
|
+
*/
|
|
65
|
+
declare function defaultAuthState(): PHAuthState;
|
|
66
|
+
/**
|
|
67
|
+
* Creates a default PHDocumentState
|
|
68
|
+
*/
|
|
69
|
+
declare function defaultDocumentState(): PHDocumentState;
|
|
70
|
+
/**
|
|
71
|
+
* Creates a default PHBaseState with auth and document properties
|
|
72
|
+
*/
|
|
73
|
+
declare function defaultBaseState(): PHBaseState;
|
|
74
|
+
/**
|
|
75
|
+
* Creates a PHAuthState with the given properties
|
|
76
|
+
*/
|
|
77
|
+
declare function createAuthState(auth?: Partial<PHAuthState>): PHAuthState;
|
|
78
|
+
/**
|
|
79
|
+
* Creates a PHDocumentState with the given properties
|
|
80
|
+
*/
|
|
81
|
+
declare function createDocumentState(document?: Partial<PHDocumentState>): PHDocumentState;
|
|
82
|
+
/**
|
|
83
|
+
* Creates a PHBaseState with the given auth and document properties
|
|
84
|
+
*/
|
|
85
|
+
declare function createBaseState(auth?: Partial<PHAuthState>, document?: Partial<PHDocumentState>): PHBaseState;
|
|
86
|
+
/**
|
|
87
|
+
* The document state of the document.
|
|
88
|
+
*/
|
|
89
|
+
type PHDocumentState = {
|
|
90
|
+
/**
|
|
91
|
+
* The current document model schema version of the document. This is used
|
|
92
|
+
* with the UPGRADE_DOCUMENT operation to specify the DocumentModelModule
|
|
93
|
+
* version to use for reducer execution.
|
|
94
|
+
*/
|
|
95
|
+
version: number; /** Hash configuration for operation state verification */
|
|
96
|
+
hash: HashConfig; /** True if and only if the document has been deleted */
|
|
97
|
+
isDeleted?: boolean; /** The timestamp when the document was deleted, in UTC ISO format */
|
|
98
|
+
deletedAtUtcIso?: string; /** Optional: who deleted the document */
|
|
99
|
+
deletedBy?: string; /** Optional: reason for deletion */
|
|
100
|
+
deletionReason?: string;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* The authentication state of the document.
|
|
104
|
+
*
|
|
105
|
+
* This has yet to be implemented.
|
|
106
|
+
*/
|
|
107
|
+
type PHAuthState = {};
|
|
108
|
+
/**
|
|
109
|
+
* The base state of the document.
|
|
110
|
+
*/
|
|
111
|
+
type PHBaseState = {
|
|
112
|
+
/** Carries authentication information. */auth: PHAuthState; /** Carries information about the document. */
|
|
113
|
+
document: PHDocumentState;
|
|
114
|
+
};
|
|
115
|
+
declare function defaultGlobalState(): DocumentModelGlobalState;
|
|
116
|
+
declare function defaultLocalState(): DocumentModelLocalState;
|
|
117
|
+
declare function defaultPHState(): DocumentModelPHState;
|
|
118
|
+
declare function createGlobalState(state?: Partial<DocumentModelGlobalState>): DocumentModelGlobalState;
|
|
119
|
+
declare function createLocalState(state?: Partial<DocumentModelLocalState>): DocumentModelLocalState;
|
|
120
|
+
declare function createState(baseState?: Partial<PHBaseState>, globalState?: Partial<DocumentModelGlobalState>, localState?: Partial<DocumentModelLocalState>): DocumentModelPHState;
|
|
121
|
+
//#endregion
|
|
122
|
+
//#region document-model/operations.d.ts
|
|
123
|
+
declare function setNameOperation<TDocument extends PHDocument>(document: TDocument, input: {
|
|
124
|
+
name: string;
|
|
125
|
+
}): TDocument & {
|
|
126
|
+
header: {
|
|
127
|
+
name: string;
|
|
128
|
+
id: string;
|
|
129
|
+
sig: PHDocumentSignatureInfo;
|
|
130
|
+
documentType: string;
|
|
131
|
+
createdAtUtcIso: string;
|
|
132
|
+
slug: string;
|
|
133
|
+
branch: string;
|
|
134
|
+
revision: {
|
|
135
|
+
[scope: string]: number;
|
|
136
|
+
};
|
|
137
|
+
lastModifiedAtUtcIso: string;
|
|
138
|
+
protocolVersions?: {
|
|
139
|
+
[key: string]: number;
|
|
140
|
+
};
|
|
141
|
+
meta?: PHDocumentMeta;
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
declare function undoOperation<TDocument extends PHDocument>(document: TDocument, action: Action, skip: number): {
|
|
145
|
+
document: TDocument;
|
|
146
|
+
action: Action;
|
|
147
|
+
skip: number;
|
|
148
|
+
reuseLastOperationIndex: boolean;
|
|
149
|
+
};
|
|
150
|
+
/**
|
|
151
|
+
* V2 of undoOperation for protocol version 2+.
|
|
152
|
+
* Key differences from undoOperation:
|
|
153
|
+
* - Never reuses operation index (always increments)
|
|
154
|
+
* - Always sets skip=1 (consecutive NOOPs are handled during rebuild/GC)
|
|
155
|
+
* - No complex skip calculation - simpler model where each UNDO is independent
|
|
156
|
+
*/
|
|
157
|
+
declare function undoOperationV2<TDocument extends PHDocument>(document: TDocument, action: Action, skip: number): {
|
|
158
|
+
document: TDocument;
|
|
159
|
+
action: Action;
|
|
160
|
+
skip: number;
|
|
161
|
+
reuseLastOperationIndex: false;
|
|
162
|
+
};
|
|
163
|
+
declare function redoOperation<TDocument extends PHDocument>(document: TDocument, action: Action, skip: number): {
|
|
164
|
+
document: TDocument;
|
|
165
|
+
action: Action;
|
|
166
|
+
skip: number;
|
|
167
|
+
reuseLastOperationIndex: boolean;
|
|
168
|
+
};
|
|
169
|
+
declare function loadStateOperation<TState extends PHBaseState>(document: PHDocument<TState>, action: LoadStateActionInput): PHDocument<TState>;
|
|
170
|
+
/**
|
|
171
|
+
* An operation that was applied to a {@link BaseDocument}.
|
|
172
|
+
*
|
|
173
|
+
* @remarks
|
|
174
|
+
* Wraps an action with an index, to be added to the operations history of a Document.
|
|
175
|
+
* The `index` field is used to keep all operations in order and enable replaying the
|
|
176
|
+
* document's history from the beginning. Note that indices and skips are relative to
|
|
177
|
+
* a specific reactor. Example below:
|
|
178
|
+
*
|
|
179
|
+
* For (index, skip, ts, action)
|
|
180
|
+
* A - [(0, 0, 1, "A0"), (1, 0, 2, "A1")]
|
|
181
|
+
* B - [(0, 0, 0, "B0"), (1, 0, 3, "B1")]
|
|
182
|
+
* ...
|
|
183
|
+
* B gets A's Operations Scenario:
|
|
184
|
+
* B' - [(0, 0, 0, "B0"), (1, 0, 3, "B1"), (2, 1, 1, "A0"), (3, 0, 2, "A1"), (4, 0, 3, "B1")]
|
|
185
|
+
* Then A needs to end up with:
|
|
186
|
+
* A' - [(0, 0, 1, "A0"), (1, 0, 2, "A1"), (2, 2, 0, "B0"), (3, 0, 1, "A0"), (4, 0, 2, "A1"), (5, 0, 3, "B1")]
|
|
187
|
+
* So that both A and B end up with the stream of actions (action):
|
|
188
|
+
* [("B0"), ("A0"), ("A1"), ("B1")]
|
|
189
|
+
*
|
|
190
|
+
* @typeParam A - The type of the action.
|
|
191
|
+
*/
|
|
192
|
+
type Operation = {
|
|
193
|
+
/**
|
|
194
|
+
* This is a stable id, derived from various document and action properties
|
|
195
|
+
* in deriveOperationId().
|
|
196
|
+
*
|
|
197
|
+
* It _cannot_ be an arbitrary string.
|
|
198
|
+
*
|
|
199
|
+
* It it also not unique per operation, as reshuffled operations will keep'
|
|
200
|
+
* the same id they had before they were reshuffled. This means that the
|
|
201
|
+
* IOperationStore may have multiple operations with the same operation id.
|
|
202
|
+
**/
|
|
203
|
+
id: string; /** Position of the operation in the history. This is relative to a specific reactor -- they may not all agree on this value. */
|
|
204
|
+
index: number; /** The number of operations skipped with this Operation. This is relative to a specific reactor -- they may not all agree on this value. */
|
|
205
|
+
skip: number; /** Timestamp of when the operation was added */
|
|
206
|
+
timestampUtcMs: string; /** Hash of the resulting document data after the operation */
|
|
207
|
+
hash: string; /** Error message for a failed action */
|
|
208
|
+
error?: string; /** The resulting state after the operation */
|
|
209
|
+
resultingState?: string;
|
|
210
|
+
/**
|
|
211
|
+
* The action that was applied to the document to produce this operation.
|
|
212
|
+
*/
|
|
213
|
+
action: Action;
|
|
214
|
+
};
|
|
215
|
+
/**
|
|
216
|
+
* The operations history of the document by scope.
|
|
217
|
+
*
|
|
218
|
+
* This will be removed in a future release.
|
|
219
|
+
*
|
|
220
|
+
* TODO: Type should be Partial<Record<string, Operation[]>>,
|
|
221
|
+
* but that is a breaking change for codegen + external doc models.
|
|
222
|
+
*/
|
|
223
|
+
type DocumentOperations = Record<string, Operation[]>;
|
|
224
|
+
type OperationContext = {
|
|
225
|
+
documentId: string;
|
|
226
|
+
documentType: string;
|
|
227
|
+
scope: string;
|
|
228
|
+
branch: string;
|
|
229
|
+
resultingState?: string;
|
|
230
|
+
ordinal: number;
|
|
231
|
+
};
|
|
232
|
+
type OperationWithContext$1 = {
|
|
233
|
+
operation: Operation;
|
|
234
|
+
context: OperationContext;
|
|
235
|
+
};
|
|
236
|
+
//#endregion
|
|
237
|
+
//#region document-model/actions.d.ts
|
|
238
|
+
/**
|
|
239
|
+
* Cancels the last `count` operations.
|
|
240
|
+
*
|
|
241
|
+
* @param count - Number of operations to cancel
|
|
242
|
+
* @category Actions
|
|
243
|
+
*/
|
|
244
|
+
declare const undo: (count?: number, scope?: string) => UndoAction;
|
|
245
|
+
/**
|
|
246
|
+
* Cancels the last `count` {@link undo | UNDO} operations.
|
|
247
|
+
*
|
|
248
|
+
* @param count - Number of UNDO operations to cancel
|
|
249
|
+
* @category Actions
|
|
250
|
+
*/
|
|
251
|
+
declare const redo: (count?: number, scope?: string) => RedoAction;
|
|
252
|
+
/**
|
|
253
|
+
* Joins multiple operations into a single {@link loadState | LOAD_STATE} operation.
|
|
254
|
+
*
|
|
255
|
+
* @remarks
|
|
256
|
+
* Useful to keep operations history smaller. Operations to prune are selected by index,
|
|
257
|
+
* similar to the {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice | slice} method in Arrays.
|
|
258
|
+
*
|
|
259
|
+
* @param start - Index of the first operation to prune
|
|
260
|
+
* @param end - Index of the last operation to prune
|
|
261
|
+
* @category Actions
|
|
262
|
+
*/
|
|
263
|
+
declare const prune: (start?: number, end?: number, scope?: string) => SchemaPruneAction;
|
|
264
|
+
/**
|
|
265
|
+
* Replaces the state of the document.
|
|
266
|
+
*
|
|
267
|
+
* @remarks
|
|
268
|
+
* This action shouldn't be used directly. It is dispatched by the {@link prune} action.
|
|
269
|
+
*
|
|
270
|
+
* @param state - State to be set in the document.
|
|
271
|
+
* @param operations - Number of operations that were removed from the previous state.
|
|
272
|
+
* @category Actions
|
|
273
|
+
*/
|
|
274
|
+
declare const loadState: <TState extends PHBaseState = PHBaseState>(state: TState & {
|
|
275
|
+
name: string;
|
|
276
|
+
}, operations: number) => LoadStateAction;
|
|
277
|
+
declare const noop: (scope?: string) => NOOPAction;
|
|
278
|
+
/**
|
|
279
|
+
* Helper function to be used by action creators.
|
|
280
|
+
*
|
|
281
|
+
* @remarks
|
|
282
|
+
* Creates an action with the given type and input properties. The input
|
|
283
|
+
* properties default to an empty object.
|
|
284
|
+
*
|
|
285
|
+
* @typeParam A - Type of the action to be returned.
|
|
286
|
+
*
|
|
287
|
+
* @param type - The type of the action.
|
|
288
|
+
* @param input - The input properties of the action.
|
|
289
|
+
* @param attachments - The attachments included in the action.
|
|
290
|
+
* @param validator - The validator to use for the input properties.
|
|
291
|
+
* @param scope - The scope of the action, can either be 'global' or 'local'.
|
|
292
|
+
* @param skip - The number of operations to skip before this new action is applied.
|
|
293
|
+
*
|
|
294
|
+
* @throws Error if the type is empty or not a string.
|
|
295
|
+
*
|
|
296
|
+
* @returns The new action.
|
|
297
|
+
*/
|
|
298
|
+
declare function createAction<TAction extends Action>(type: TAction["type"], input?: TAction["input"], attachments?: TAction["attachments"], validator?: () => {
|
|
299
|
+
parse(v: unknown): TAction["input"];
|
|
300
|
+
}, scope?: Action["scope"]): TAction;
|
|
301
|
+
/**
|
|
302
|
+
* This function should be used instead of { ...action } to ensure
|
|
303
|
+
* that extra properties are not included in the action.
|
|
304
|
+
*/
|
|
305
|
+
declare const actionFromAction: (action: Action) => Action;
|
|
306
|
+
declare const operationFromAction: (action: Action, index: number, skip: number, context: OperationContext) => Operation;
|
|
307
|
+
declare const operationFromOperation: (operation: Operation, index: number, skip: number, context: OperationContext) => Operation;
|
|
308
|
+
declare const operationWithContext: (operation: Operation, context: ActionContext) => Operation;
|
|
309
|
+
declare const actionContext: () => ActionContext;
|
|
310
|
+
declare const actionSigner: (user: UserActionSigner, app: AppActionSigner, signatures?: Signature[]) => ActionSigner;
|
|
311
|
+
declare function buildOperationSignature(context: ActionSignatureContext, signMethod: ActionSigningHandler): Promise<Signature>;
|
|
312
|
+
declare function buildSignedAction<TState extends PHBaseState = PHBaseState>(action: Action, reducer: Reducer<TState>, document: PHDocument<TState>, signer: ActionSigner, signHandler: ActionSigningHandler): Promise<Operation>;
|
|
313
|
+
declare function verifyOperationSignature(signature: Signature, signer: Omit<ActionSigner, "signatures">, verifyHandler: ActionVerificationHandler): Promise<boolean>;
|
|
314
|
+
/**
|
|
315
|
+
* Changes the name of the document.
|
|
316
|
+
*
|
|
317
|
+
* @param name - The name to be set in the document.
|
|
318
|
+
* @category Actions
|
|
319
|
+
*/
|
|
320
|
+
declare const setName: (name: string | {
|
|
321
|
+
name: string;
|
|
322
|
+
}) => SetNameAction;
|
|
323
|
+
declare const setModelName: (input: SetModelNameInput) => SetModelNameAction;
|
|
324
|
+
declare const setModelId: (input: SetModelIdInput) => SetModelIdAction;
|
|
325
|
+
declare const setModelExtension: (input: SetModelExtensionInput) => SetModelExtensionAction;
|
|
326
|
+
declare const setModelDescription: (input: SetModelDescriptionInput) => SetModelDescriptionAction;
|
|
327
|
+
declare const setAuthorName: (input: SetAuthorNameInput) => SetAuthorNameAction;
|
|
328
|
+
declare const setAuthorWebsite: (input: SetAuthorWebsiteInput) => SetAuthorWebsiteAction;
|
|
329
|
+
declare const addModule: (input: AddModuleInput) => AddModuleAction;
|
|
330
|
+
declare const setModuleName: (input: SetModuleNameInput) => SetModuleNameAction;
|
|
331
|
+
declare const setModuleDescription: (input: SetModuleDescriptionInput) => SetModuleDescriptionAction;
|
|
332
|
+
declare const deleteModule: (input: DeleteModuleInput) => DeleteModuleAction;
|
|
333
|
+
declare const reorderModules: (input: ReorderModulesInput) => ReorderModulesAction;
|
|
334
|
+
declare const addOperation: (input: AddOperationInput) => AddOperationAction;
|
|
335
|
+
declare const setOperationName: (input: SetOperationNameInput) => SetOperationNameAction;
|
|
336
|
+
declare const setOperationScope: (input: SetOperationScopeInput) => SetOperationScopeAction;
|
|
337
|
+
declare const setOperationSchema: (input: SetOperationSchemaInput) => SetOperationSchemaAction;
|
|
338
|
+
declare const setOperationDescription: (input: SetOperationDescriptionInput) => SetOperationDescriptionAction;
|
|
339
|
+
declare const setOperationTemplate: (input: SetOperationTemplateInput) => SetOperationTemplateAction;
|
|
340
|
+
declare const setOperationReducer: (input: SetOperationReducerInput) => SetOperationReducerAction;
|
|
341
|
+
declare const moveOperation: (input: MoveOperationInput) => MoveOperationAction;
|
|
342
|
+
declare const deleteOperation: (input: DeleteOperationInput) => DeleteOperationAction;
|
|
343
|
+
declare const reorderModuleOperations: (input: ReorderModuleOperationsInput) => ReorderModuleOperationsAction;
|
|
344
|
+
declare const addOperationError: (input: AddOperationErrorInput) => AddOperationErrorAction;
|
|
345
|
+
declare const setOperationErrorCode: (input: SetOperationErrorCodeInput) => SetOperationErrorCodeAction;
|
|
346
|
+
declare const setOperationErrorName: (input: SetOperationErrorNameInput) => SetOperationErrorNameAction;
|
|
347
|
+
declare const setOperationErrorDescription: (input: SetOperationErrorDescriptionInput) => SetOperationErrorDescriptionAction;
|
|
348
|
+
declare const setOperationErrorTemplate: (input: SetOperationErrorTemplateInput) => SetOperationErrorTemplateAction;
|
|
349
|
+
declare const deleteOperationError: (input: DeleteOperationErrorInput) => DeleteOperationErrorAction;
|
|
350
|
+
declare const reorderOperationErrors: (input: ReorderOperationErrorsInput) => ReorderOperationErrorsAction;
|
|
351
|
+
declare const addOperationExample: (input: AddOperationExampleInput) => AddOperationExampleAction;
|
|
352
|
+
declare const updateOperationExample: (input: UpdateOperationExampleInput) => UpdateOperationExampleAction;
|
|
353
|
+
declare const deleteOperationExample: (input: DeleteOperationExampleInput) => DeleteOperationExampleAction;
|
|
354
|
+
declare const reorderOperationExamples: (input: ReorderOperationExamplesInput) => ReorderOperationExamplesAction;
|
|
355
|
+
declare const operationExampleCreators: {
|
|
356
|
+
addOperationExample: (input: AddOperationExampleInput) => AddOperationExampleAction;
|
|
357
|
+
updateOperationExample: (input: UpdateOperationExampleInput) => UpdateOperationExampleAction;
|
|
358
|
+
deleteOperationExample: (input: DeleteOperationExampleInput) => DeleteOperationExampleAction;
|
|
359
|
+
reorderOperationExamples: (input: ReorderOperationExamplesInput) => ReorderOperationExamplesAction;
|
|
360
|
+
};
|
|
361
|
+
declare const setStateSchema: (input: SetStateSchemaInput) => SetStateSchemaAction;
|
|
362
|
+
declare const setInitialState: (input: SetInitialStateInput) => SetInitialStateAction;
|
|
363
|
+
declare const addStateExample: (input: AddStateExampleInput) => AddStateExampleAction;
|
|
364
|
+
declare const updateStateExample: (input: UpdateStateExampleInput) => UpdateStateExampleAction;
|
|
365
|
+
declare const deleteStateExample: (input: DeleteStateExampleInput) => DeleteStateExampleAction;
|
|
366
|
+
declare const reorderStateExamples: (input: ReorderStateExamplesInput) => ReorderStateExamplesAction;
|
|
367
|
+
declare const addChangeLogItem: (input: AddChangeLogItemInput) => AddChangeLogItemAction;
|
|
368
|
+
declare const updateChangeLogItem: (input: UpdateChangeLogItemInput) => UpdateChangeLogItemAction;
|
|
369
|
+
declare const deleteChangeLogItem: (input: DeleteChangeLogItemInput) => DeleteChangeLogItemAction;
|
|
370
|
+
declare const reorderChangeLogItems: (input: ReorderChangeLogItemsInput) => ReorderChangeLogItemsAction;
|
|
371
|
+
declare const releaseNewVersion: () => ReleaseNewVersionAction;
|
|
372
|
+
declare const baseActions: {
|
|
373
|
+
setName: (name: string | {
|
|
374
|
+
name: string;
|
|
375
|
+
}) => SetNameAction;
|
|
376
|
+
undo: (count?: number, scope?: string) => UndoAction;
|
|
377
|
+
redo: (count?: number, scope?: string) => RedoAction;
|
|
378
|
+
prune: (start?: number, end?: number, scope?: string) => SchemaPruneAction;
|
|
379
|
+
loadState: <TState extends PHBaseState = PHBaseState>(state: TState & {
|
|
380
|
+
name: string;
|
|
381
|
+
}, operations: number) => LoadStateAction;
|
|
382
|
+
noop: (scope?: string) => NOOPAction;
|
|
383
|
+
};
|
|
384
|
+
declare const documentModelActions: {
|
|
385
|
+
setModelName: (input: SetModelNameInput) => SetModelNameAction;
|
|
386
|
+
setModelId: (input: SetModelIdInput) => SetModelIdAction;
|
|
387
|
+
setModelExtension: (input: SetModelExtensionInput) => SetModelExtensionAction;
|
|
388
|
+
setModelDescription: (input: SetModelDescriptionInput) => SetModelDescriptionAction;
|
|
389
|
+
setAuthorName: (input: SetAuthorNameInput) => SetAuthorNameAction;
|
|
390
|
+
setAuthorWebsite: (input: SetAuthorWebsiteInput) => SetAuthorWebsiteAction;
|
|
391
|
+
addModule: (input: AddModuleInput) => AddModuleAction;
|
|
392
|
+
setModuleName: (input: SetModuleNameInput) => SetModuleNameAction;
|
|
393
|
+
setModuleDescription: (input: SetModuleDescriptionInput) => SetModuleDescriptionAction;
|
|
394
|
+
deleteModule: (input: DeleteModuleInput) => DeleteModuleAction;
|
|
395
|
+
reorderModules: (input: ReorderModulesInput) => ReorderModulesAction;
|
|
396
|
+
addOperation: (input: AddOperationInput) => AddOperationAction;
|
|
397
|
+
setOperationName: (input: SetOperationNameInput) => SetOperationNameAction;
|
|
398
|
+
setOperationScope: (input: SetOperationScopeInput) => SetOperationScopeAction;
|
|
399
|
+
setOperationSchema: (input: SetOperationSchemaInput) => SetOperationSchemaAction;
|
|
400
|
+
setOperationDescription: (input: SetOperationDescriptionInput) => SetOperationDescriptionAction;
|
|
401
|
+
setOperationTemplate: (input: SetOperationTemplateInput) => SetOperationTemplateAction;
|
|
402
|
+
setOperationReducer: (input: SetOperationReducerInput) => SetOperationReducerAction;
|
|
403
|
+
moveOperation: (input: MoveOperationInput) => MoveOperationAction;
|
|
404
|
+
deleteOperation: (input: DeleteOperationInput) => DeleteOperationAction;
|
|
405
|
+
reorderModuleOperations: (input: ReorderModuleOperationsInput) => ReorderModuleOperationsAction;
|
|
406
|
+
addOperationError: (input: AddOperationErrorInput) => AddOperationErrorAction;
|
|
407
|
+
setOperationErrorCode: (input: SetOperationErrorCodeInput) => SetOperationErrorCodeAction;
|
|
408
|
+
setOperationErrorName: (input: SetOperationErrorNameInput) => SetOperationErrorNameAction;
|
|
409
|
+
setOperationErrorDescription: (input: SetOperationErrorDescriptionInput) => SetOperationErrorDescriptionAction;
|
|
410
|
+
setOperationErrorTemplate: (input: SetOperationErrorTemplateInput) => SetOperationErrorTemplateAction;
|
|
411
|
+
deleteOperationError: (input: DeleteOperationErrorInput) => DeleteOperationErrorAction;
|
|
412
|
+
reorderOperationErrors: (input: ReorderOperationErrorsInput) => ReorderOperationErrorsAction;
|
|
413
|
+
setStateSchema: (input: SetStateSchemaInput) => SetStateSchemaAction;
|
|
414
|
+
setInitialState: (input: SetInitialStateInput) => SetInitialStateAction;
|
|
415
|
+
addStateExample: (input: AddStateExampleInput) => AddStateExampleAction;
|
|
416
|
+
updateStateExample: (input: UpdateStateExampleInput) => UpdateStateExampleAction;
|
|
417
|
+
deleteStateExample: (input: DeleteStateExampleInput) => DeleteStateExampleAction;
|
|
418
|
+
reorderStateExamples: (input: ReorderStateExamplesInput) => ReorderStateExamplesAction;
|
|
419
|
+
addChangeLogItem: (input: AddChangeLogItemInput) => AddChangeLogItemAction;
|
|
420
|
+
updateChangeLogItem: (input: UpdateChangeLogItemInput) => UpdateChangeLogItemAction;
|
|
421
|
+
deleteChangeLogItem: (input: DeleteChangeLogItemInput) => DeleteChangeLogItemAction;
|
|
422
|
+
reorderChangeLogItems: (input: ReorderChangeLogItemsInput) => ReorderChangeLogItemsAction;
|
|
423
|
+
releaseNewVersion: () => ReleaseNewVersionAction;
|
|
424
|
+
};
|
|
425
|
+
declare const actions: {
|
|
426
|
+
setModelName: (input: SetModelNameInput) => SetModelNameAction;
|
|
427
|
+
setModelId: (input: SetModelIdInput) => SetModelIdAction;
|
|
428
|
+
setModelExtension: (input: SetModelExtensionInput) => SetModelExtensionAction;
|
|
429
|
+
setModelDescription: (input: SetModelDescriptionInput) => SetModelDescriptionAction;
|
|
430
|
+
setAuthorName: (input: SetAuthorNameInput) => SetAuthorNameAction;
|
|
431
|
+
setAuthorWebsite: (input: SetAuthorWebsiteInput) => SetAuthorWebsiteAction;
|
|
432
|
+
addModule: (input: AddModuleInput) => AddModuleAction;
|
|
433
|
+
setModuleName: (input: SetModuleNameInput) => SetModuleNameAction;
|
|
434
|
+
setModuleDescription: (input: SetModuleDescriptionInput) => SetModuleDescriptionAction;
|
|
435
|
+
deleteModule: (input: DeleteModuleInput) => DeleteModuleAction;
|
|
436
|
+
reorderModules: (input: ReorderModulesInput) => ReorderModulesAction;
|
|
437
|
+
addOperation: (input: AddOperationInput) => AddOperationAction;
|
|
438
|
+
setOperationName: (input: SetOperationNameInput) => SetOperationNameAction;
|
|
439
|
+
setOperationScope: (input: SetOperationScopeInput) => SetOperationScopeAction;
|
|
440
|
+
setOperationSchema: (input: SetOperationSchemaInput) => SetOperationSchemaAction;
|
|
441
|
+
setOperationDescription: (input: SetOperationDescriptionInput) => SetOperationDescriptionAction;
|
|
442
|
+
setOperationTemplate: (input: SetOperationTemplateInput) => SetOperationTemplateAction;
|
|
443
|
+
setOperationReducer: (input: SetOperationReducerInput) => SetOperationReducerAction;
|
|
444
|
+
moveOperation: (input: MoveOperationInput) => MoveOperationAction;
|
|
445
|
+
deleteOperation: (input: DeleteOperationInput) => DeleteOperationAction;
|
|
446
|
+
reorderModuleOperations: (input: ReorderModuleOperationsInput) => ReorderModuleOperationsAction;
|
|
447
|
+
addOperationError: (input: AddOperationErrorInput) => AddOperationErrorAction;
|
|
448
|
+
setOperationErrorCode: (input: SetOperationErrorCodeInput) => SetOperationErrorCodeAction;
|
|
449
|
+
setOperationErrorName: (input: SetOperationErrorNameInput) => SetOperationErrorNameAction;
|
|
450
|
+
setOperationErrorDescription: (input: SetOperationErrorDescriptionInput) => SetOperationErrorDescriptionAction;
|
|
451
|
+
setOperationErrorTemplate: (input: SetOperationErrorTemplateInput) => SetOperationErrorTemplateAction;
|
|
452
|
+
deleteOperationError: (input: DeleteOperationErrorInput) => DeleteOperationErrorAction;
|
|
453
|
+
reorderOperationErrors: (input: ReorderOperationErrorsInput) => ReorderOperationErrorsAction;
|
|
454
|
+
setStateSchema: (input: SetStateSchemaInput) => SetStateSchemaAction;
|
|
455
|
+
setInitialState: (input: SetInitialStateInput) => SetInitialStateAction;
|
|
456
|
+
addStateExample: (input: AddStateExampleInput) => AddStateExampleAction;
|
|
457
|
+
updateStateExample: (input: UpdateStateExampleInput) => UpdateStateExampleAction;
|
|
458
|
+
deleteStateExample: (input: DeleteStateExampleInput) => DeleteStateExampleAction;
|
|
459
|
+
reorderStateExamples: (input: ReorderStateExamplesInput) => ReorderStateExamplesAction;
|
|
460
|
+
addChangeLogItem: (input: AddChangeLogItemInput) => AddChangeLogItemAction;
|
|
461
|
+
updateChangeLogItem: (input: UpdateChangeLogItemInput) => UpdateChangeLogItemAction;
|
|
462
|
+
deleteChangeLogItem: (input: DeleteChangeLogItemInput) => DeleteChangeLogItemAction;
|
|
463
|
+
reorderChangeLogItems: (input: ReorderChangeLogItemsInput) => ReorderChangeLogItemsAction;
|
|
464
|
+
releaseNewVersion: () => ReleaseNewVersionAction;
|
|
465
|
+
setName: (name: string | {
|
|
466
|
+
name: string;
|
|
467
|
+
}) => SetNameAction;
|
|
468
|
+
undo: (count?: number, scope?: string) => UndoAction;
|
|
469
|
+
redo: (count?: number, scope?: string) => RedoAction;
|
|
470
|
+
prune: (start?: number, end?: number, scope?: string) => SchemaPruneAction;
|
|
471
|
+
loadState: <TState extends PHBaseState = PHBaseState>(state: TState & {
|
|
472
|
+
name: string;
|
|
473
|
+
}, operations: number) => LoadStateAction;
|
|
474
|
+
noop: (scope?: string) => NOOPAction;
|
|
475
|
+
};
|
|
476
|
+
/**
|
|
477
|
+
* The context of an action.
|
|
478
|
+
*/
|
|
479
|
+
type ActionContext = {
|
|
480
|
+
/** The index of the previous operation, showing intended ordering. */prevOpIndex?: number; /** The hash of the previous operation, showing intended state. */
|
|
481
|
+
prevOpHash?: string; /** A nonce, to cover specific signing attacks and to prevent replay attacks from no-ops. */
|
|
482
|
+
nonce?: string; /** The signer of the action. */
|
|
483
|
+
signer?: ActionSigner;
|
|
484
|
+
};
|
|
485
|
+
/**
|
|
486
|
+
* Defines the basic structure of an action.
|
|
487
|
+
*/
|
|
488
|
+
type Action = {
|
|
489
|
+
/** The id of the action. This is distinct from the operation id. */id: string; /** The name of the action. */
|
|
490
|
+
type: string; /** The timestamp of the action. */
|
|
491
|
+
timestampUtcMs: string; /** The payload of the action. */
|
|
492
|
+
input: unknown; /** The scope of the action */
|
|
493
|
+
scope: string;
|
|
494
|
+
/**
|
|
495
|
+
* The attachments included in the action.
|
|
496
|
+
*
|
|
497
|
+
* This will be refactored in a future release.
|
|
498
|
+
*/
|
|
499
|
+
attachments?: AttachmentInput[]; /** The context of the action. */
|
|
500
|
+
context?: ActionContext;
|
|
501
|
+
};
|
|
502
|
+
/**
|
|
503
|
+
* The attributes stored for a file. Namely, attachments of a document.
|
|
504
|
+
*/
|
|
505
|
+
type Attachment = {
|
|
506
|
+
/** The binary data of the attachment in Base64 */data: string; /** The MIME type of the attachment */
|
|
507
|
+
mimeType: string;
|
|
508
|
+
extension?: string | null;
|
|
509
|
+
fileName?: string | null;
|
|
510
|
+
};
|
|
511
|
+
type AttachmentInput = Attachment & {
|
|
512
|
+
hash: string;
|
|
513
|
+
};
|
|
514
|
+
type ActionWithAttachment = Action & {
|
|
515
|
+
attachments: AttachmentInput[];
|
|
516
|
+
};
|
|
517
|
+
/**
|
|
518
|
+
* String type representing an attachment in a Document.
|
|
519
|
+
*
|
|
520
|
+
* @remarks
|
|
521
|
+
* Attachment string is formatted as `attachment://<filename>`.
|
|
522
|
+
*/
|
|
523
|
+
type AttachmentRef = string;
|
|
524
|
+
//#endregion
|
|
525
|
+
//#region document-model/documents.d.ts
|
|
526
|
+
/** Meta information about the document. */
|
|
527
|
+
type PHDocumentMeta = {
|
|
528
|
+
/** The preferred editor for the document. */preferredEditor?: string;
|
|
529
|
+
};
|
|
530
|
+
/**
|
|
531
|
+
* The header of a document.
|
|
532
|
+
*/
|
|
533
|
+
type PHDocumentHeader = {
|
|
534
|
+
/**
|
|
535
|
+
* The id of the document.
|
|
536
|
+
*
|
|
537
|
+
* This is a Ed25519 signature and is immutable.
|
|
538
|
+
**/
|
|
539
|
+
id: string;
|
|
540
|
+
/**
|
|
541
|
+
* Information to verify the document creator.
|
|
542
|
+
*
|
|
543
|
+
* This is immutable.
|
|
544
|
+
**/
|
|
545
|
+
sig: PHDocumentSignatureInfo;
|
|
546
|
+
/**
|
|
547
|
+
* The type of the document.
|
|
548
|
+
*
|
|
549
|
+
* This is used as part of the signature payload and thus, cannot be changed
|
|
550
|
+
* after the document header has been created.
|
|
551
|
+
**/
|
|
552
|
+
documentType: string;
|
|
553
|
+
/**
|
|
554
|
+
* The timestamp of the creation date of the document, in UTC ISO format.
|
|
555
|
+
*
|
|
556
|
+
* This is used as part of the signature payload and thus, cannot be changed
|
|
557
|
+
* after the document header has been created.
|
|
558
|
+
**/
|
|
559
|
+
createdAtUtcIso: string; /** The slug of the document. */
|
|
560
|
+
slug: string; /** The name of the document. */
|
|
561
|
+
name: string; /** The branch of this document. */
|
|
562
|
+
branch: string;
|
|
563
|
+
/**
|
|
564
|
+
* The revision of each scope of the document. This object is updated every
|
|
565
|
+
* time any _other_ scope is updated.
|
|
566
|
+
*/
|
|
567
|
+
revision: {
|
|
568
|
+
[scope: string]: number;
|
|
569
|
+
};
|
|
570
|
+
/**
|
|
571
|
+
* The timestamp of the last change in the document, in UTC ISO format.
|
|
572
|
+
**/
|
|
573
|
+
lastModifiedAtUtcIso: string;
|
|
574
|
+
/**
|
|
575
|
+
* This is a map from protocol name to version. A protocol can be any set of
|
|
576
|
+
* rules that are applied to the document.
|
|
577
|
+
*
|
|
578
|
+
* Examples of protocols include:
|
|
579
|
+
*
|
|
580
|
+
* - "base-reducer"
|
|
581
|
+
*/
|
|
582
|
+
protocolVersions?: {
|
|
583
|
+
[key: string]: number;
|
|
584
|
+
}; /** Meta information about the document. */
|
|
585
|
+
meta?: PHDocumentMeta;
|
|
586
|
+
};
|
|
587
|
+
/**
|
|
588
|
+
* The base type of a document model.
|
|
589
|
+
*
|
|
590
|
+
* @remarks
|
|
591
|
+
* This type is extended by all Document models.
|
|
592
|
+
*
|
|
593
|
+
* @typeParam TState - The type of the document state.
|
|
594
|
+
*/
|
|
595
|
+
type PHDocument<TState extends PHBaseState = PHBaseState> = {
|
|
596
|
+
/** The header of the document. */header: PHDocumentHeader; /** The document model specific state. */
|
|
597
|
+
state: TState;
|
|
598
|
+
/**
|
|
599
|
+
* The initial state of the document, enabling replaying operations.
|
|
600
|
+
*
|
|
601
|
+
* This will be removed in a future release.
|
|
602
|
+
*/
|
|
603
|
+
initialState: TState;
|
|
604
|
+
/**
|
|
605
|
+
* The operations history of the document.
|
|
606
|
+
*
|
|
607
|
+
* This will be removed in a future release.
|
|
608
|
+
*/
|
|
609
|
+
operations: DocumentOperations;
|
|
610
|
+
/**
|
|
611
|
+
* A list of undone operations
|
|
612
|
+
*
|
|
613
|
+
* This will be removed in a future release.
|
|
614
|
+
*/
|
|
615
|
+
clipboard: Operation[];
|
|
616
|
+
};
|
|
617
|
+
declare function isNoopOperation<TOp extends {
|
|
618
|
+
type: string;
|
|
619
|
+
skip: number;
|
|
620
|
+
hash: string;
|
|
621
|
+
}>(op: Partial<TOp>): boolean;
|
|
622
|
+
declare function isUndoRedo(action: Action): action is UndoRedoAction;
|
|
623
|
+
declare function isUndo(action: Action): action is UndoAction;
|
|
624
|
+
declare function isDocumentAction(action: Action): action is DocumentAction;
|
|
625
|
+
/**
|
|
626
|
+
* Important note: it is the responsibility of the caller to set the document type
|
|
627
|
+
* on the header.
|
|
628
|
+
*/
|
|
629
|
+
declare function baseCreateDocument<TState extends PHBaseState = PHBaseState>(createState: CreateState<TState>, initialState?: Partial<TState>): PHDocument<TState>;
|
|
630
|
+
declare function hashDocumentStateForScope(document: {
|
|
631
|
+
state: {
|
|
632
|
+
[key: string]: unknown;
|
|
633
|
+
};
|
|
634
|
+
}, scope?: string): string;
|
|
635
|
+
declare function readOnly<T>(value: T): Readonly<T>;
|
|
636
|
+
/**
|
|
637
|
+
* Maps skipped operations in an array of operations.
|
|
638
|
+
* Skipped operations are operations that are ignored during processing.
|
|
639
|
+
* @param operations - The array of operations to map.
|
|
640
|
+
* @param skippedHeadOperations - The number of operations to skip at the head of the array of operations.
|
|
641
|
+
* @returns An array of mapped operations with ignore flag indicating if the operation is skipped.
|
|
642
|
+
* @throws Error if the operation index is invalid and there are missing operations.
|
|
643
|
+
*/
|
|
644
|
+
declare function mapSkippedOperations(operations: Operation[], skippedHeadOperations?: number): MappedOperation[];
|
|
645
|
+
/**
|
|
646
|
+
* V2 version of mapSkippedOperations for protocol version 2+.
|
|
647
|
+
* In V2, all NOOPs have skip=1 and consecutive NOOPs form chains.
|
|
648
|
+
* N consecutive NOOPs at any point skip N preceding content operations.
|
|
649
|
+
*
|
|
650
|
+
* Algorithm: Process from end to start
|
|
651
|
+
* - When hitting a NOOP: increment chain length, mark as ignored
|
|
652
|
+
* - When hitting a non-NOOP:
|
|
653
|
+
* - If chain > 0: decrement chain, mark as ignored (this op was undone)
|
|
654
|
+
* - If chain == 0: mark as not ignored (apply this op)
|
|
655
|
+
*/
|
|
656
|
+
declare function mapSkippedOperationsV2(operations: Operation[]): MappedOperation[];
|
|
657
|
+
/**
|
|
658
|
+
* V2 garbage collect that returns only operations that should be applied for state.
|
|
659
|
+
* Uses the V2 model where consecutive NOOPs form chains.
|
|
660
|
+
* Unlike V1 garbageCollect, this preserves ALL operations but marks which to apply.
|
|
661
|
+
*/
|
|
662
|
+
declare function garbageCollectV2<TOpIndex extends OperationIndex>(sortedOperations: TOpIndex[]): TOpIndex[];
|
|
663
|
+
declare function sortMappedOperations(operations: DocumentOperationsIgnoreMap): MappedOperation[];
|
|
664
|
+
declare function replayDocument<TState extends PHBaseState = PHBaseState>(initialState: TState, operations: DocumentOperations, reducer: Reducer<TState>, header: PHDocumentHeader, dispatch?: SignalDispatch, skipHeaderOperations?: SkipHeaderOperations, options?: ReplayDocumentOptions): PHDocument<TState>;
|
|
665
|
+
declare function parseResultingState<TState>(state: string | null | undefined): TState;
|
|
666
|
+
declare enum IntegrityIssueType {
|
|
667
|
+
UNEXPECTED_INDEX = "UNEXPECTED_INDEX"
|
|
668
|
+
}
|
|
669
|
+
declare enum IntegrityIssueSubType {
|
|
670
|
+
DUPLICATED_INDEX = "DUPLICATED_INDEX",
|
|
671
|
+
MISSING_INDEX = "MISSING_INDEX"
|
|
672
|
+
}
|
|
673
|
+
type IntegrityIssue = {
|
|
674
|
+
operation: OperationIndex;
|
|
675
|
+
issue: IntegrityIssueType;
|
|
676
|
+
category: IntegrityIssueSubType;
|
|
677
|
+
message: string;
|
|
678
|
+
};
|
|
679
|
+
type Reshuffle = (startIndex: OperationIndex, opsA: Operation[], opsB: Operation[]) => Operation[];
|
|
680
|
+
declare function checkCleanedOperationsIntegrity(sortedOperations: OperationIndex[]): IntegrityIssue[];
|
|
681
|
+
declare function garbageCollect<TOpIndex extends OperationIndex>(sortedOperations: TOpIndex[]): TOpIndex[];
|
|
682
|
+
declare function addUndo(sortedOperations: Operation[]): Operation[];
|
|
683
|
+
declare function sortOperations<TOpIndex extends OperationIndex>(operations: TOpIndex[]): TOpIndex[];
|
|
684
|
+
declare function reshuffleByTimestamp<TOp extends OperationIndex>(startIndex: OperationIndex, opsA: TOp[], opsB: TOp[]): TOp[];
|
|
685
|
+
declare function reshuffleByTimestampAndIndex<TOp extends OperationIndex>(startIndex: OperationIndex, opsA: TOp[], opsB: TOp[]): TOp[];
|
|
686
|
+
declare function operationsAreEqual<TOp extends {
|
|
687
|
+
index: number;
|
|
688
|
+
skip: number;
|
|
689
|
+
type?: string;
|
|
690
|
+
scope?: string;
|
|
691
|
+
input?: unknown;
|
|
692
|
+
}>(op1: TOp, op2: TOp): boolean;
|
|
693
|
+
declare function attachBranch(trunk: Operation[], newBranch: Operation[]): [Operation[], Operation[]];
|
|
694
|
+
declare function precedes(op1: OperationIndex, op2: OperationIndex): boolean;
|
|
695
|
+
declare function split(sortedTargetOperations: Operation[], sortedMergeOperations: Operation[]): [Operation[], Operation[], Operation[]];
|
|
696
|
+
declare function merge(sortedTargetOperations: Operation[], sortedMergeOperations: Operation[], reshuffle: Reshuffle): Operation[];
|
|
697
|
+
declare function nextSkipNumber(sortedOperations: OperationIndex[]): number;
|
|
698
|
+
declare function checkOperationsIntegrity(operations: Operation[]): IntegrityIssue[];
|
|
699
|
+
declare function groupOperationsByScope(operations: Operation[]): Partial<Record<string, Operation[]>>;
|
|
700
|
+
type PrepareOperationsResult = {
|
|
701
|
+
validOperations: Operation[];
|
|
702
|
+
invalidOperations: Operation[];
|
|
703
|
+
duplicatedOperations: Operation[];
|
|
704
|
+
integrityIssues: IntegrityIssue[];
|
|
705
|
+
};
|
|
706
|
+
declare function prepareOperations(operationsHistory: Operation[], newOperations: Operation[]): PrepareOperationsResult;
|
|
707
|
+
declare function removeExistingOperations(newOperations: Operation[], operationsHistory: Operation[]): Operation[];
|
|
708
|
+
/**
|
|
709
|
+
* Skips header operations and returns the remaining operations.
|
|
710
|
+
*
|
|
711
|
+
* @param operations - The array of operations.
|
|
712
|
+
* @param skipHeaderOperation - The skip header operation index.
|
|
713
|
+
* @returns The remaining operations after skipping header operations.
|
|
714
|
+
*/
|
|
715
|
+
declare function skipHeaderOperations(operations: Operation[], skipHeaderOperation: SkipHeaderOperationIndex): Operation[];
|
|
716
|
+
declare function garbageCollectDocumentOperations(documentOperations: DocumentOperations): DocumentOperations;
|
|
717
|
+
/**
|
|
718
|
+
* Filters out duplicated operations from the target operations array based on their IDs.
|
|
719
|
+
* If an operation has an ID, it is considered duplicated if there is another operation in the source operations array with the same ID.
|
|
720
|
+
* If an operation does not have an ID, it is considered unique and will not be filtered out.
|
|
721
|
+
* @param targetOperations - The array of target operations to filter.
|
|
722
|
+
* @param sourceOperations - The array of source operations to compare against.
|
|
723
|
+
* @returns An array of operations with duplicates filtered out.
|
|
724
|
+
*/
|
|
725
|
+
declare function filterDuplicatedOperations<T extends {
|
|
726
|
+
id?: string | number;
|
|
727
|
+
}>(targetOperations: T[], sourceOperations: T[]): T[];
|
|
728
|
+
declare function filterDocumentOperationsResultingState(documentOperations?: DocumentOperations): {
|
|
729
|
+
[x: string]: Operation[] | {
|
|
730
|
+
id: string;
|
|
731
|
+
index: number;
|
|
732
|
+
skip: number;
|
|
733
|
+
timestampUtcMs: string;
|
|
734
|
+
hash: string;
|
|
735
|
+
error?: string;
|
|
736
|
+
action: Action;
|
|
737
|
+
}[];
|
|
738
|
+
};
|
|
739
|
+
/**
|
|
740
|
+
* Calculates the difference between two arrays of operations.
|
|
741
|
+
* Returns an array of operations that are present in `clearedOperationsA` but not in `clearedOperationsB`.
|
|
742
|
+
*
|
|
743
|
+
* @template TOp - The type of the operations.
|
|
744
|
+
* @param {TOp[]} clearedOperationsA - The first array of operations.
|
|
745
|
+
* @param {TOp[]} clearedOperationsB - The second array of operations.
|
|
746
|
+
* @returns {TOp[]} - The difference between the two arrays of operations.
|
|
747
|
+
*/
|
|
748
|
+
declare function diffOperations<TOp extends OperationIndex>(clearedOperationsA: TOp[], clearedOperationsB: TOp[]): TOp[];
|
|
749
|
+
declare function getDocumentLastModified(document: PHDocument): string;
|
|
750
|
+
/**
|
|
751
|
+
* Updates the document header with the latest revision number and
|
|
752
|
+
* date of last modification.
|
|
753
|
+
*
|
|
754
|
+
* @param document The current state of the document.
|
|
755
|
+
* @param scope The scope of the operation.
|
|
756
|
+
* @param lastModifiedTimestamp Optional timestamp to use directly, avoiding a scan of all operations.
|
|
757
|
+
* @returns The updated document state.
|
|
758
|
+
*/
|
|
759
|
+
declare function updateHeaderRevision(document: PHDocument, scope: string, lastModifiedTimestamp?: string): PHDocument;
|
|
760
|
+
//#endregion
|
|
761
|
+
//#region processors/types.d.ts
|
|
762
|
+
interface IProcessorHostModule {
|
|
763
|
+
analyticsStore: IAnalyticsStore;
|
|
764
|
+
relationalDb: IRelationalDb;
|
|
765
|
+
processorApp: ProcessorApp;
|
|
766
|
+
config?: Map<string, unknown>;
|
|
767
|
+
}
|
|
768
|
+
/**
|
|
769
|
+
* Filter for matching operations to processors.
|
|
770
|
+
* All fields are optional arrays - when provided, operations must match at least one value in each specified field.
|
|
771
|
+
* When a field is undefined or empty, it matches all values for that field.
|
|
772
|
+
*/
|
|
773
|
+
type ProcessorFilter = {
|
|
774
|
+
documentType?: string[];
|
|
775
|
+
scope?: string[];
|
|
776
|
+
branch?: string[];
|
|
777
|
+
documentId?: string[];
|
|
778
|
+
};
|
|
779
|
+
/**
|
|
780
|
+
* Describes an object that can process operations.
|
|
781
|
+
*/
|
|
782
|
+
interface IProcessor {
|
|
783
|
+
/**
|
|
784
|
+
* Processes a list of operations with context.
|
|
785
|
+
* Called when operations match this processor's filter.
|
|
786
|
+
*/
|
|
787
|
+
onOperations(operations: OperationWithContext[]): Promise<void>;
|
|
788
|
+
/**
|
|
789
|
+
* Called when the processor is disconnected.
|
|
790
|
+
* Used to clean up any resources allocated during processor creation.
|
|
791
|
+
*/
|
|
792
|
+
onDisconnect(): Promise<void>;
|
|
793
|
+
}
|
|
794
|
+
/**
|
|
795
|
+
* Relates a processor to its filter configuration.
|
|
796
|
+
*/
|
|
797
|
+
type ProcessorRecord = {
|
|
798
|
+
processor: IProcessor;
|
|
799
|
+
filter: ProcessorFilter;
|
|
800
|
+
startFrom?: "beginning" | "current";
|
|
801
|
+
};
|
|
802
|
+
/**
|
|
803
|
+
* A factory function that creates processor records for a given drive.
|
|
804
|
+
* Called once per drive when the drive is first detected or when the factory is registered.
|
|
805
|
+
*/
|
|
806
|
+
type ProcessorFactory = (driveHeader: PHDocumentHeader, processorApp?: ProcessorApp) => ProcessorRecord[] | Promise<ProcessorRecord[]>;
|
|
807
|
+
/** Takes a processor host module and builds processor factories using its context */
|
|
808
|
+
type ProcessorFactoryBuilder = (module: IProcessorHostModule) => Promise<(driveHeader: PHDocumentHeader) => Promise<ProcessorRecord[]>>;
|
|
809
|
+
type ProcessorStatus = "active" | "errored";
|
|
810
|
+
type TrackedProcessor = {
|
|
811
|
+
processorId: string;
|
|
812
|
+
factoryId: string;
|
|
813
|
+
driveId: string;
|
|
814
|
+
processorIndex: number;
|
|
815
|
+
record: ProcessorRecord;
|
|
816
|
+
lastOrdinal: number;
|
|
817
|
+
status: ProcessorStatus;
|
|
818
|
+
lastError: string | undefined;
|
|
819
|
+
lastErrorTimestamp: Date | undefined;
|
|
820
|
+
retry: () => Promise<void>;
|
|
821
|
+
};
|
|
822
|
+
/**
|
|
823
|
+
* Manages processor creation and destruction based on drive operations.
|
|
824
|
+
*/
|
|
825
|
+
interface IProcessorManager {
|
|
826
|
+
/**
|
|
827
|
+
* Registers a processor factory.
|
|
828
|
+
* Immediately creates processors for all existing drives.
|
|
829
|
+
*/
|
|
830
|
+
registerFactory(identifier: string, factory: ProcessorFactory): Promise<void>;
|
|
831
|
+
/**
|
|
832
|
+
* Unregisters a processor factory and disconnects all processors it created.
|
|
833
|
+
*/
|
|
834
|
+
unregisterFactory(identifier: string): Promise<void>;
|
|
835
|
+
/**
|
|
836
|
+
* Gets a tracked processor by its ID.
|
|
837
|
+
*/
|
|
838
|
+
get(processorId: string): TrackedProcessor | undefined;
|
|
839
|
+
/**
|
|
840
|
+
* Gets all tracked processors.
|
|
841
|
+
*/
|
|
842
|
+
getAll(): TrackedProcessor[];
|
|
843
|
+
}
|
|
844
|
+
type ProcessorApp = (typeof PROCESSOR_APPS)[number];
|
|
845
|
+
type ProcessorApps = readonly ProcessorApp[];
|
|
846
|
+
//#endregion
|
|
847
|
+
//#region processors/relational/types.d.ts
|
|
848
|
+
type IRelationalQueryMethods = "selectFrom" | "selectNoFrom" | "with" | "withRecursive";
|
|
849
|
+
type IRelationalQueryBuilder<Schema = unknown> = Pick<QueryCreator<Schema>, IRelationalQueryMethods> & {
|
|
850
|
+
withSchema: (schema: string) => IRelationalQueryBuilder<Schema>;
|
|
851
|
+
};
|
|
852
|
+
type HashAlgorithms = "fnv1a";
|
|
853
|
+
type IBaseRelationalDb<Schema = unknown> = Kysely<Schema>;
|
|
854
|
+
/**
|
|
855
|
+
* The standardized relational database interface for relational db processors.
|
|
856
|
+
* This abstraction provides type-safe database operations while hiding the underlying
|
|
857
|
+
* database framework implementation details.
|
|
858
|
+
**/
|
|
859
|
+
type IRelationalDb<Schema = unknown> = IBaseRelationalDb<Schema> & {
|
|
860
|
+
createNamespace<NamespaceSchema>(namespace: string): Promise<IRelationalDb<ExtractProcessorSchemaOrSelf<NamespaceSchema>>>;
|
|
861
|
+
queryNamespace<NamespaceSchema>(namespace: string): IRelationalQueryBuilder<NamespaceSchema>;
|
|
862
|
+
};
|
|
863
|
+
type ExtractProcessorSchemaOrSelf<TProcessor> = TProcessor extends RelationalDbProcessor<infer TSchema> ? TSchema : TProcessor;
|
|
864
|
+
type RelationalDbProcessorClass<TSchema> = typeof RelationalDbProcessor<TSchema>;
|
|
865
|
+
interface IRelationalDbProcessor<TDatabaseSchema = unknown> extends IProcessor {
|
|
866
|
+
namespace: string;
|
|
867
|
+
query: IRelationalQueryBuilder<TDatabaseSchema>;
|
|
868
|
+
filter: ProcessorFilter;
|
|
869
|
+
initAndUpgrade(): Promise<void>;
|
|
870
|
+
}
|
|
871
|
+
declare const IS_RELATIONAL_DB_PROCESSOR: unique symbol;
|
|
872
|
+
/**
|
|
873
|
+
* Base class for relational db processors that require a relational database storage.
|
|
874
|
+
* This class abstracts database initialization, migration management, and resource cleanup,
|
|
875
|
+
* allowing derived classes to focus on business logic.
|
|
876
|
+
*/
|
|
877
|
+
declare abstract class RelationalDbProcessor<TDatabaseSchema = unknown> implements IRelationalDbProcessor<TDatabaseSchema> {
|
|
878
|
+
protected _namespace: string;
|
|
879
|
+
protected _filter: ProcessorFilter;
|
|
880
|
+
protected relationalDb: IRelationalDb<TDatabaseSchema>;
|
|
881
|
+
constructor(_namespace: string, _filter: ProcessorFilter, relationalDb: IRelationalDb<TDatabaseSchema>);
|
|
882
|
+
static [IS_RELATIONAL_DB_PROCESSOR]: boolean;
|
|
883
|
+
/**
|
|
884
|
+
* Returns the namespace for a given drive id.
|
|
885
|
+
* This method can be overridden by derived classes to provide a custom namespace.
|
|
886
|
+
*/
|
|
887
|
+
static getNamespace(driveId: string): string;
|
|
888
|
+
static query<Schema>(this: RelationalDbProcessorClass<Schema>, driveId: string, db: IRelationalDb<any>): IRelationalQueryBuilder<Schema>;
|
|
889
|
+
/**
|
|
890
|
+
* Processes a list of operations with context.
|
|
891
|
+
* Called when operations match this processor's filter.
|
|
892
|
+
*/
|
|
893
|
+
abstract onOperations(operations: OperationWithContext[]): Promise<void>;
|
|
894
|
+
/**
|
|
895
|
+
* Returns the filter for the processor.
|
|
896
|
+
* This method can be overridden by derived classes to provide a custom filter.
|
|
897
|
+
*/
|
|
898
|
+
get filter(): ProcessorFilter;
|
|
899
|
+
/**
|
|
900
|
+
* Returns the namespace used by the processor.
|
|
901
|
+
*/
|
|
902
|
+
get namespace(): string;
|
|
903
|
+
get query(): IRelationalQueryBuilder<TDatabaseSchema>;
|
|
904
|
+
/**
|
|
905
|
+
* Abstract method that derived classes must implement.
|
|
906
|
+
* This method is meant to be called on subclasses to initialize and upgrade the database.
|
|
907
|
+
*/
|
|
908
|
+
abstract initAndUpgrade(): Promise<void>;
|
|
909
|
+
/**
|
|
910
|
+
* Called when the processor is disconnected.
|
|
911
|
+
* This method is meant to be overridden by subclasses to clean up resources.
|
|
912
|
+
*/
|
|
913
|
+
abstract onDisconnect(): Promise<void>;
|
|
914
|
+
}
|
|
915
|
+
//#endregion
|
|
916
|
+
//#region processors/relational/utils.d.ts
|
|
917
|
+
/**
|
|
918
|
+
* Hashes a string to a lowercase base-26 string.
|
|
919
|
+
* @param str The string to hash.
|
|
920
|
+
* @param length The length of the hash. Defaults to 10.
|
|
921
|
+
* @param algorithm The hashing algorithm to use. Defaults to "fnv1a".
|
|
922
|
+
* @returns The hashed string.
|
|
923
|
+
*/
|
|
924
|
+
declare function hashNamespace(str: string, length?: number): string;
|
|
925
|
+
/**
|
|
926
|
+
* Creates a RelationalDb instance with namespace support.
|
|
927
|
+
* @param baseDb The base RelationalDb instance to enhance.
|
|
928
|
+
* @param baseOptions The default options for namespace creation. Hashes namespace by default.
|
|
929
|
+
* @returns The enhanced RelationalDb instance.
|
|
930
|
+
*/
|
|
931
|
+
declare function createRelationalDb<Schema>(baseDb: IBaseRelationalDb<Schema>, baseOptions?: NamespaceOptions): IRelationalDb<Schema>;
|
|
932
|
+
type NamespaceOptions = {
|
|
933
|
+
hashNamespace?: boolean;
|
|
934
|
+
};
|
|
935
|
+
declare function createNamespacedDb<Schema>(db: IBaseRelationalDb<any>, namespace: string, options?: NamespaceOptions): Promise<IRelationalDb<Schema>>;
|
|
936
|
+
declare function createNamespacedQueryBuilder<Schema>(db: IBaseRelationalDb<any>, namespace: string, options?: NamespaceOptions): IRelationalQueryBuilder<Schema>;
|
|
937
|
+
/**
|
|
938
|
+
* Returns a query builder for a RelationalDb instance.
|
|
939
|
+
* @param query The RelationalDb instance to convert.
|
|
940
|
+
* @returns The IRelationalQueryBuilder instance.
|
|
941
|
+
*/
|
|
942
|
+
declare function relationalDbToQueryBuilder<TSchema>(query: IBaseRelationalDb<TSchema>): IRelationalQueryBuilder<TSchema>;
|
|
943
|
+
//#endregion
|
|
944
|
+
//#region document-model/upgrades.d.ts
|
|
945
|
+
/** Upgrade reducer transforms a document from one version to another */
|
|
946
|
+
type UpgradeReducer<TFrom extends PHBaseState, TTo extends PHBaseState> = (document: PHDocument<TFrom>, action: Action) => PHDocument<TTo>;
|
|
947
|
+
type ModelVersion = number;
|
|
948
|
+
/** Metadata about a version transition */
|
|
949
|
+
type UpgradeTransition = {
|
|
950
|
+
toVersion: ModelVersion;
|
|
951
|
+
upgradeReducer: UpgradeReducer<any, any>;
|
|
952
|
+
description?: string;
|
|
953
|
+
};
|
|
954
|
+
type TupleMember<T extends readonly unknown[]> = T[number];
|
|
955
|
+
/** Manifest declaring all supported versions and upgrade paths */
|
|
956
|
+
type UpgradeManifest<TVersions extends readonly number[]> = {
|
|
957
|
+
documentType: string;
|
|
958
|
+
latestVersion: TupleMember<TVersions>;
|
|
959
|
+
supportedVersions: TVersions;
|
|
960
|
+
upgrades: { [V in Exclude<TupleMember<TVersions>, 1> as `v${V}`]: UpgradeTransition };
|
|
961
|
+
};
|
|
962
|
+
//#endregion
|
|
963
|
+
//#region document-model/types.d.ts
|
|
964
|
+
type State = {
|
|
965
|
+
examples: CodeExample[];
|
|
966
|
+
initialValue: string;
|
|
967
|
+
schema: string;
|
|
968
|
+
};
|
|
969
|
+
type ScopeState = {
|
|
970
|
+
global: State;
|
|
971
|
+
local: State;
|
|
972
|
+
};
|
|
973
|
+
type Author = {
|
|
974
|
+
name: string;
|
|
975
|
+
website: string | null;
|
|
976
|
+
};
|
|
977
|
+
type OperationErrorSpecification = {
|
|
978
|
+
code: string | null;
|
|
979
|
+
description: string | null;
|
|
980
|
+
id: ID;
|
|
981
|
+
name: string | null;
|
|
982
|
+
template: string | null;
|
|
983
|
+
};
|
|
984
|
+
type CodeExample = {
|
|
985
|
+
id: ID;
|
|
986
|
+
value: string;
|
|
987
|
+
};
|
|
988
|
+
type OperationSpecification = {
|
|
989
|
+
description: string | null;
|
|
990
|
+
errors: OperationErrorSpecification[];
|
|
991
|
+
examples: CodeExample[];
|
|
992
|
+
id: ID;
|
|
993
|
+
name: string | null;
|
|
994
|
+
reducer: string | null;
|
|
995
|
+
schema: string | null;
|
|
996
|
+
template: string | null;
|
|
997
|
+
scope: string;
|
|
998
|
+
};
|
|
999
|
+
type ModuleSpecification = {
|
|
1000
|
+
description: string | null;
|
|
1001
|
+
id: ID;
|
|
1002
|
+
name: string;
|
|
1003
|
+
operations: OperationSpecification[];
|
|
1004
|
+
};
|
|
1005
|
+
type DocumentSpecification = {
|
|
1006
|
+
changeLog: string[];
|
|
1007
|
+
modules: ModuleSpecification[];
|
|
1008
|
+
state: ScopeState;
|
|
1009
|
+
version: number;
|
|
1010
|
+
};
|
|
1011
|
+
type DocumentModelGlobalState = {
|
|
1012
|
+
author: Author;
|
|
1013
|
+
description: string;
|
|
1014
|
+
extension: string;
|
|
1015
|
+
id: string;
|
|
1016
|
+
name: string;
|
|
1017
|
+
specifications: DocumentSpecification[];
|
|
1018
|
+
};
|
|
1019
|
+
type DocumentModelLocalState = {};
|
|
1020
|
+
type DocumentModelPHState = PHBaseState & {
|
|
1021
|
+
global: DocumentModelGlobalState;
|
|
1022
|
+
local: DocumentModelLocalState;
|
|
1023
|
+
};
|
|
1024
|
+
type DocumentModelDocument = PHDocument<DocumentModelPHState>;
|
|
1025
|
+
type DocumentModelAction = DocumentModelHeaderAction | DocumentModelVersioningAction | DocumentModelModuleAction | DocumentModelOperationErrorAction | DocumentModelOperationExampleAction | DocumentModelOperationAction | DocumentModelStateAction;
|
|
1026
|
+
type AddChangeLogItemInput = {
|
|
1027
|
+
__typename?: "AddChangeLogItemInput";
|
|
1028
|
+
content: Scalars["String"]["output"];
|
|
1029
|
+
id: Scalars["ID"]["output"];
|
|
1030
|
+
insertBefore: Maybe<Scalars["ID"]["output"]>;
|
|
1031
|
+
};
|
|
1032
|
+
type AddModuleInput = {
|
|
1033
|
+
description?: InputMaybe<Scalars["String"]["input"]>;
|
|
1034
|
+
id: Scalars["ID"]["input"];
|
|
1035
|
+
name: Scalars["String"]["input"];
|
|
1036
|
+
};
|
|
1037
|
+
type AddOperationErrorInput = {
|
|
1038
|
+
errorCode?: InputMaybe<Scalars["String"]["input"]>;
|
|
1039
|
+
errorDescription?: InputMaybe<Scalars["String"]["input"]>;
|
|
1040
|
+
errorName?: InputMaybe<Scalars["String"]["input"]>;
|
|
1041
|
+
errorTemplate?: InputMaybe<Scalars["String"]["input"]>;
|
|
1042
|
+
id: Scalars["ID"]["input"];
|
|
1043
|
+
operationId: Scalars["ID"]["input"];
|
|
1044
|
+
};
|
|
1045
|
+
type AddOperationExampleInput = {
|
|
1046
|
+
example: Scalars["String"]["input"];
|
|
1047
|
+
id: Scalars["ID"]["input"];
|
|
1048
|
+
operationId: Scalars["ID"]["input"];
|
|
1049
|
+
};
|
|
1050
|
+
type AddOperationInput = {
|
|
1051
|
+
description?: InputMaybe<Scalars["String"]["input"]>;
|
|
1052
|
+
id: Scalars["ID"]["input"];
|
|
1053
|
+
moduleId: Scalars["ID"]["input"];
|
|
1054
|
+
name: Scalars["String"]["input"];
|
|
1055
|
+
reducer?: InputMaybe<Scalars["String"]["input"]>;
|
|
1056
|
+
schema?: InputMaybe<Scalars["String"]["input"]>;
|
|
1057
|
+
template?: InputMaybe<Scalars["String"]["input"]>;
|
|
1058
|
+
scope?: InputMaybe<string>;
|
|
1059
|
+
};
|
|
1060
|
+
type AddStateExampleInput = {
|
|
1061
|
+
scope: Scalars["String"]["input"];
|
|
1062
|
+
example: Scalars["String"]["input"];
|
|
1063
|
+
id: Scalars["ID"]["input"];
|
|
1064
|
+
insertBefore?: InputMaybe<Scalars["ID"]["input"]>;
|
|
1065
|
+
};
|
|
1066
|
+
type DeleteChangeLogItemInput = {
|
|
1067
|
+
__typename?: "DeleteChangeLogItemInput";
|
|
1068
|
+
id: Scalars["ID"]["output"];
|
|
1069
|
+
};
|
|
1070
|
+
type DeleteModuleInput = {
|
|
1071
|
+
id: Scalars["ID"]["input"];
|
|
1072
|
+
};
|
|
1073
|
+
type DeleteOperationErrorInput = {
|
|
1074
|
+
id: Scalars["ID"]["input"];
|
|
1075
|
+
};
|
|
1076
|
+
type DeleteOperationExampleInput = {
|
|
1077
|
+
id: Scalars["ID"]["input"];
|
|
1078
|
+
};
|
|
1079
|
+
type DeleteOperationInput = {
|
|
1080
|
+
id: Scalars["ID"]["input"];
|
|
1081
|
+
};
|
|
1082
|
+
type DeleteStateExampleInput = {
|
|
1083
|
+
scope: Scalars["String"]["input"];
|
|
1084
|
+
id: Scalars["ID"]["input"];
|
|
1085
|
+
};
|
|
1086
|
+
type DocumentModelInput = AddChangeLogItemInput | AddModuleInput | AddOperationErrorInput | AddOperationExampleInput | AddOperationInput | AddStateExampleInput | DeleteChangeLogItemInput | DeleteModuleInput | DeleteOperationErrorInput | DeleteOperationExampleInput | DeleteOperationInput | DeleteStateExampleInput | MoveOperationInput | ReorderChangeLogItemsInput | ReorderModuleOperationsInput | ReorderModulesInput | ReorderOperationErrorsInput | ReorderOperationExamplesInput | ReorderStateExamplesInput | SetAuthorNameInput | SetAuthorWebsiteInput | SetInitialStateInput | SetModelDescriptionInput | SetModelExtensionInput | SetModelIdInput | SetModelNameInput | SetModuleDescriptionInput | SetModuleNameInput | SetOperationDescriptionInput | SetOperationErrorCodeInput | SetOperationErrorDescriptionInput | SetOperationErrorNameInput | SetOperationErrorTemplateInput | SetOperationNameInput | SetOperationReducerInput | SetOperationSchemaInput | SetOperationTemplateInput | SetStateSchemaInput | UpdateChangeLogItemInput | UpdateOperationExampleInput | UpdateStateExampleInput;
|
|
1087
|
+
type MoveOperationInput = {
|
|
1088
|
+
newModuleId: Scalars["ID"]["input"];
|
|
1089
|
+
operationId: Scalars["ID"]["input"];
|
|
1090
|
+
};
|
|
1091
|
+
type Mutation = {
|
|
1092
|
+
__typename?: "Mutation";
|
|
1093
|
+
addChangeLogItemInput: DocumentModelGlobalState;
|
|
1094
|
+
addModule: DocumentModelGlobalState;
|
|
1095
|
+
addOperation: DocumentModelGlobalState;
|
|
1096
|
+
addOperationError: DocumentModelGlobalState;
|
|
1097
|
+
addOperationExample: DocumentModelGlobalState;
|
|
1098
|
+
addStateExample: DocumentModelGlobalState;
|
|
1099
|
+
deleteChangeLogItemInput: DocumentModelGlobalState;
|
|
1100
|
+
deleteModule: DocumentModelGlobalState;
|
|
1101
|
+
deleteOperation: DocumentModelGlobalState;
|
|
1102
|
+
deleteOperationError: DocumentModelGlobalState;
|
|
1103
|
+
deleteOperationExample: DocumentModelGlobalState;
|
|
1104
|
+
deleteStateExample: DocumentModelGlobalState;
|
|
1105
|
+
moveOperation: DocumentModelGlobalState;
|
|
1106
|
+
releaseNewVersion: DocumentModelGlobalState;
|
|
1107
|
+
reorderChangeLogItemsInput: DocumentModelGlobalState;
|
|
1108
|
+
reorderModuleOperations: DocumentModelGlobalState;
|
|
1109
|
+
reorderModules: DocumentModelGlobalState;
|
|
1110
|
+
reorderOperationErrors: DocumentModelGlobalState;
|
|
1111
|
+
reorderOperationExamples: DocumentModelGlobalState;
|
|
1112
|
+
reorderStateExamples: DocumentModelGlobalState;
|
|
1113
|
+
setAuthorName: DocumentModelGlobalState;
|
|
1114
|
+
setAuthorWebsite: DocumentModelGlobalState;
|
|
1115
|
+
setInitialState: DocumentModelGlobalState;
|
|
1116
|
+
setModelDescription: DocumentModelGlobalState;
|
|
1117
|
+
setModelExtension: DocumentModelGlobalState;
|
|
1118
|
+
setModelId: DocumentModelGlobalState;
|
|
1119
|
+
setModelName: DocumentModelGlobalState;
|
|
1120
|
+
setModuleDescription: DocumentModelGlobalState;
|
|
1121
|
+
setModuleName: DocumentModelGlobalState;
|
|
1122
|
+
setOperationDescription: DocumentModelGlobalState;
|
|
1123
|
+
setOperationErrorCode: DocumentModelGlobalState;
|
|
1124
|
+
setOperationErrorDescription: DocumentModelGlobalState;
|
|
1125
|
+
setOperationErrorName: DocumentModelGlobalState;
|
|
1126
|
+
setOperationErrorTemplate: DocumentModelGlobalState;
|
|
1127
|
+
setOperationName: DocumentModelGlobalState;
|
|
1128
|
+
setOperationReducer: DocumentModelGlobalState;
|
|
1129
|
+
setOperationSchema: DocumentModelGlobalState;
|
|
1130
|
+
setOperationTemplate: DocumentModelGlobalState;
|
|
1131
|
+
setStateSchema: DocumentModelGlobalState;
|
|
1132
|
+
updateChangeLogItemInput: DocumentModelGlobalState;
|
|
1133
|
+
updateOperationExample: DocumentModelGlobalState;
|
|
1134
|
+
updateStateExample: DocumentModelGlobalState;
|
|
1135
|
+
};
|
|
1136
|
+
type MutationAddChangeLogItemInputArgs = {
|
|
1137
|
+
input?: InputMaybe<AddChangeLogItemInput>;
|
|
1138
|
+
};
|
|
1139
|
+
type MutationAddModuleArgs = {
|
|
1140
|
+
input: AddModuleInput;
|
|
1141
|
+
};
|
|
1142
|
+
type MutationAddOperationArgs = {
|
|
1143
|
+
input: AddOperationInput;
|
|
1144
|
+
};
|
|
1145
|
+
type MutationAddOperationErrorArgs = {
|
|
1146
|
+
input: AddOperationErrorInput;
|
|
1147
|
+
};
|
|
1148
|
+
type MutationAddOperationExampleArgs = {
|
|
1149
|
+
input: AddOperationExampleInput;
|
|
1150
|
+
};
|
|
1151
|
+
type MutationAddStateExampleArgs = {
|
|
1152
|
+
input: AddStateExampleInput;
|
|
1153
|
+
};
|
|
1154
|
+
type MutationDeleteChangeLogItemInputArgs = {
|
|
1155
|
+
input?: InputMaybe<DeleteChangeLogItemInput>;
|
|
1156
|
+
};
|
|
1157
|
+
type MutationDeleteModuleArgs = {
|
|
1158
|
+
input: DeleteModuleInput;
|
|
1159
|
+
};
|
|
1160
|
+
type MutationDeleteOperationArgs = {
|
|
1161
|
+
input: DeleteOperationInput;
|
|
1162
|
+
};
|
|
1163
|
+
type MutationDeleteOperationErrorArgs = {
|
|
1164
|
+
input: DeleteOperationErrorInput;
|
|
1165
|
+
};
|
|
1166
|
+
type MutationDeleteOperationExampleArgs = {
|
|
1167
|
+
input: DeleteOperationExampleInput;
|
|
1168
|
+
};
|
|
1169
|
+
type MutationDeleteStateExampleArgs = {
|
|
1170
|
+
input: DeleteStateExampleInput;
|
|
1171
|
+
};
|
|
1172
|
+
type MutationMoveOperationArgs = {
|
|
1173
|
+
input: MoveOperationInput;
|
|
1174
|
+
};
|
|
1175
|
+
type MutationReorderChangeLogItemsInputArgs = {
|
|
1176
|
+
input?: InputMaybe<ReorderChangeLogItemsInput>;
|
|
1177
|
+
};
|
|
1178
|
+
type MutationReorderModuleOperationsArgs = {
|
|
1179
|
+
input: ReorderModuleOperationsInput;
|
|
1180
|
+
};
|
|
1181
|
+
type MutationReorderModulesArgs = {
|
|
1182
|
+
input: ReorderModulesInput;
|
|
1183
|
+
};
|
|
1184
|
+
type MutationReorderOperationErrorsArgs = {
|
|
1185
|
+
input: ReorderOperationErrorsInput;
|
|
1186
|
+
};
|
|
1187
|
+
type MutationReorderOperationExamplesArgs = {
|
|
1188
|
+
input: ReorderOperationExamplesInput;
|
|
1189
|
+
};
|
|
1190
|
+
type MutationReorderStateExamplesArgs = {
|
|
1191
|
+
input: ReorderStateExamplesInput;
|
|
1192
|
+
};
|
|
1193
|
+
type MutationSetAuthorNameArgs = {
|
|
1194
|
+
input: SetAuthorNameInput;
|
|
1195
|
+
};
|
|
1196
|
+
type MutationSetAuthorWebsiteArgs = {
|
|
1197
|
+
input: SetAuthorWebsiteInput;
|
|
1198
|
+
};
|
|
1199
|
+
type MutationSetInitialStateArgs = {
|
|
1200
|
+
input: SetInitialStateInput;
|
|
1201
|
+
};
|
|
1202
|
+
type MutationSetModelDescriptionArgs = {
|
|
1203
|
+
input: SetModelDescriptionInput;
|
|
1204
|
+
};
|
|
1205
|
+
type MutationSetModelExtensionArgs = {
|
|
1206
|
+
input: SetModelExtensionInput;
|
|
1207
|
+
};
|
|
1208
|
+
type MutationSetModelIdArgs = {
|
|
1209
|
+
input: SetModelIdInput;
|
|
1210
|
+
};
|
|
1211
|
+
type MutationSetModelNameArgs = {
|
|
1212
|
+
input: SetModelNameInput;
|
|
1213
|
+
};
|
|
1214
|
+
type MutationSetModuleDescriptionArgs = {
|
|
1215
|
+
input: SetModuleDescriptionInput;
|
|
1216
|
+
};
|
|
1217
|
+
type MutationSetModuleNameArgs = {
|
|
1218
|
+
input: SetModuleNameInput;
|
|
1219
|
+
};
|
|
1220
|
+
type MutationSetOperationDescriptionArgs = {
|
|
1221
|
+
input: SetOperationDescriptionInput;
|
|
1222
|
+
};
|
|
1223
|
+
type MutationSetOperationErrorCodeArgs = {
|
|
1224
|
+
input: SetOperationErrorCodeInput;
|
|
1225
|
+
};
|
|
1226
|
+
type MutationSetOperationErrorDescriptionArgs = {
|
|
1227
|
+
input: SetOperationErrorDescriptionInput;
|
|
1228
|
+
};
|
|
1229
|
+
type MutationSetOperationErrorNameArgs = {
|
|
1230
|
+
input: SetOperationErrorNameInput;
|
|
1231
|
+
};
|
|
1232
|
+
type MutationSetOperationErrorTemplateArgs = {
|
|
1233
|
+
input: SetOperationErrorTemplateInput;
|
|
1234
|
+
};
|
|
1235
|
+
type MutationSetOperationNameArgs = {
|
|
1236
|
+
input: SetOperationNameInput;
|
|
1237
|
+
};
|
|
1238
|
+
type MutationSetOperationReducerArgs = {
|
|
1239
|
+
input: SetOperationReducerInput;
|
|
1240
|
+
};
|
|
1241
|
+
type MutationSetOperationSchemaArgs = {
|
|
1242
|
+
input: SetOperationSchemaInput;
|
|
1243
|
+
};
|
|
1244
|
+
type MutationSetOperationTemplateArgs = {
|
|
1245
|
+
input: SetOperationTemplateInput;
|
|
1246
|
+
};
|
|
1247
|
+
type MutationSetStateSchemaArgs = {
|
|
1248
|
+
input: SetStateSchemaInput;
|
|
1249
|
+
};
|
|
1250
|
+
type MutationUpdateChangeLogItemInputArgs = {
|
|
1251
|
+
input?: InputMaybe<UpdateChangeLogItemInput>;
|
|
1252
|
+
};
|
|
1253
|
+
type MutationUpdateOperationExampleArgs = {
|
|
1254
|
+
input: UpdateOperationExampleInput;
|
|
1255
|
+
};
|
|
1256
|
+
type MutationUpdateStateExampleArgs = {
|
|
1257
|
+
input: UpdateStateExampleInput;
|
|
1258
|
+
};
|
|
1259
|
+
type ReorderChangeLogItemsInput = {
|
|
1260
|
+
__typename?: "ReorderChangeLogItemsInput";
|
|
1261
|
+
order: Array<Scalars["ID"]["output"]>;
|
|
1262
|
+
};
|
|
1263
|
+
type ReorderModuleOperationsInput = {
|
|
1264
|
+
moduleId: Scalars["ID"]["input"];
|
|
1265
|
+
order: Array<Scalars["ID"]["input"]>;
|
|
1266
|
+
};
|
|
1267
|
+
type ReorderModulesInput = {
|
|
1268
|
+
order: Array<Scalars["ID"]["input"]>;
|
|
1269
|
+
};
|
|
1270
|
+
type ReorderOperationErrorsInput = {
|
|
1271
|
+
operationId: Scalars["ID"]["input"];
|
|
1272
|
+
order: Array<Scalars["ID"]["input"]>;
|
|
1273
|
+
};
|
|
1274
|
+
type ReorderOperationExamplesInput = {
|
|
1275
|
+
operationId: Scalars["ID"]["input"];
|
|
1276
|
+
order: Array<Scalars["ID"]["input"]>;
|
|
1277
|
+
};
|
|
1278
|
+
type ReorderStateExamplesInput = {
|
|
1279
|
+
scope: Scalars["String"]["input"];
|
|
1280
|
+
order: Array<Scalars["ID"]["input"]>;
|
|
1281
|
+
};
|
|
1282
|
+
type SetAuthorNameInput = {
|
|
1283
|
+
authorName: Scalars["String"]["input"];
|
|
1284
|
+
};
|
|
1285
|
+
type SetAuthorWebsiteInput = {
|
|
1286
|
+
authorWebsite: Scalars["String"]["input"];
|
|
1287
|
+
};
|
|
1288
|
+
type SetInitialStateInput = {
|
|
1289
|
+
scope: Scalars["String"]["input"];
|
|
1290
|
+
initialValue: Scalars["String"]["input"];
|
|
1291
|
+
};
|
|
1292
|
+
type SetModelDescriptionInput = {
|
|
1293
|
+
description: Scalars["String"]["input"];
|
|
1294
|
+
};
|
|
1295
|
+
type SetModelExtensionInput = {
|
|
1296
|
+
extension: Scalars["String"]["input"];
|
|
1297
|
+
};
|
|
1298
|
+
type SetModelIdInput = {
|
|
1299
|
+
id: Scalars["String"]["input"];
|
|
1300
|
+
};
|
|
1301
|
+
type SetModelNameInput = {
|
|
1302
|
+
name: Scalars["String"]["input"];
|
|
1303
|
+
};
|
|
1304
|
+
type SetModuleDescriptionInput = {
|
|
1305
|
+
description?: InputMaybe<Scalars["String"]["input"]>;
|
|
1306
|
+
id: Scalars["ID"]["input"];
|
|
1307
|
+
};
|
|
1308
|
+
type SetModuleNameInput = {
|
|
1309
|
+
id: Scalars["ID"]["input"];
|
|
1310
|
+
name?: InputMaybe<Scalars["String"]["input"]>;
|
|
1311
|
+
};
|
|
1312
|
+
type SetOperationDescriptionInput = {
|
|
1313
|
+
description?: InputMaybe<Scalars["String"]["input"]>;
|
|
1314
|
+
id: Scalars["ID"]["input"];
|
|
1315
|
+
};
|
|
1316
|
+
type SetOperationErrorCodeInput = {
|
|
1317
|
+
errorCode?: InputMaybe<Scalars["String"]["input"]>;
|
|
1318
|
+
id: Scalars["ID"]["input"];
|
|
1319
|
+
};
|
|
1320
|
+
type SetOperationErrorDescriptionInput = {
|
|
1321
|
+
errorDescription?: InputMaybe<Scalars["String"]["input"]>;
|
|
1322
|
+
id: Scalars["ID"]["input"];
|
|
1323
|
+
};
|
|
1324
|
+
type SetOperationErrorNameInput = {
|
|
1325
|
+
errorName?: InputMaybe<Scalars["String"]["input"]>;
|
|
1326
|
+
id: Scalars["ID"]["input"];
|
|
1327
|
+
};
|
|
1328
|
+
type SetOperationErrorTemplateInput = {
|
|
1329
|
+
errorTemplate?: InputMaybe<Scalars["String"]["input"]>;
|
|
1330
|
+
id: Scalars["ID"]["input"];
|
|
1331
|
+
};
|
|
1332
|
+
type SetOperationNameInput = {
|
|
1333
|
+
id: Scalars["ID"]["input"];
|
|
1334
|
+
name?: InputMaybe<Scalars["String"]["input"]>;
|
|
1335
|
+
};
|
|
1336
|
+
type SetOperationScopeInput = {
|
|
1337
|
+
id: Scalars["ID"]["input"];
|
|
1338
|
+
scope?: InputMaybe<string>;
|
|
1339
|
+
};
|
|
1340
|
+
type SetOperationReducerInput = {
|
|
1341
|
+
id: Scalars["ID"]["input"];
|
|
1342
|
+
reducer?: InputMaybe<Scalars["String"]["input"]>;
|
|
1343
|
+
};
|
|
1344
|
+
type SetOperationSchemaInput = {
|
|
1345
|
+
id: Scalars["ID"]["input"];
|
|
1346
|
+
schema?: InputMaybe<Scalars["String"]["input"]>;
|
|
1347
|
+
};
|
|
1348
|
+
type SetOperationTemplateInput = {
|
|
1349
|
+
id: Scalars["ID"]["input"];
|
|
1350
|
+
template?: InputMaybe<Scalars["String"]["input"]>;
|
|
1351
|
+
};
|
|
1352
|
+
type SetStateSchemaInput = {
|
|
1353
|
+
scope: Scalars["String"]["input"];
|
|
1354
|
+
schema: Scalars["String"]["input"];
|
|
1355
|
+
};
|
|
1356
|
+
type UpdateChangeLogItemInput = {
|
|
1357
|
+
__typename?: "UpdateChangeLogItemInput";
|
|
1358
|
+
id: Scalars["ID"]["output"];
|
|
1359
|
+
newContent: Scalars["String"]["output"];
|
|
1360
|
+
};
|
|
1361
|
+
type UpdateOperationExampleInput = {
|
|
1362
|
+
example: Scalars["String"]["input"];
|
|
1363
|
+
id: Scalars["ID"]["input"];
|
|
1364
|
+
};
|
|
1365
|
+
type UpdateStateExampleInput = {
|
|
1366
|
+
scope: Scalars["String"]["input"];
|
|
1367
|
+
id: Scalars["ID"]["input"];
|
|
1368
|
+
newExample: Scalars["String"]["input"];
|
|
1369
|
+
};
|
|
1370
|
+
type SetModelNameAction = Action & {
|
|
1371
|
+
type: "SET_MODEL_NAME";
|
|
1372
|
+
input: SetModelNameInput;
|
|
1373
|
+
};
|
|
1374
|
+
type SetModelIdAction = Action & {
|
|
1375
|
+
type: "SET_MODEL_ID";
|
|
1376
|
+
input: SetModelIdInput;
|
|
1377
|
+
};
|
|
1378
|
+
type SetModelExtensionAction = Action & {
|
|
1379
|
+
type: "SET_MODEL_EXTENSION";
|
|
1380
|
+
input: SetModelExtensionInput;
|
|
1381
|
+
};
|
|
1382
|
+
type SetModelDescriptionAction = Action & {
|
|
1383
|
+
type: "SET_MODEL_DESCRIPTION";
|
|
1384
|
+
input: SetModelDescriptionInput;
|
|
1385
|
+
};
|
|
1386
|
+
type SetAuthorNameAction = Action & {
|
|
1387
|
+
type: "SET_AUTHOR_NAME";
|
|
1388
|
+
input: SetAuthorNameInput;
|
|
1389
|
+
};
|
|
1390
|
+
type SetAuthorWebsiteAction = Action & {
|
|
1391
|
+
type: "SET_AUTHOR_WEBSITE";
|
|
1392
|
+
input: SetAuthorWebsiteInput;
|
|
1393
|
+
};
|
|
1394
|
+
type DocumentModelHeaderAction = SetModelNameAction | SetModelIdAction | SetModelExtensionAction | SetModelDescriptionAction | SetAuthorNameAction | SetAuthorWebsiteAction;
|
|
1395
|
+
type AddModuleAction = Action & {
|
|
1396
|
+
type: "ADD_MODULE";
|
|
1397
|
+
input: AddModuleInput;
|
|
1398
|
+
};
|
|
1399
|
+
type SetModuleNameAction = Action & {
|
|
1400
|
+
type: "SET_MODULE_NAME";
|
|
1401
|
+
input: SetModuleNameInput;
|
|
1402
|
+
};
|
|
1403
|
+
type SetModuleDescriptionAction = Action & {
|
|
1404
|
+
type: "SET_MODULE_DESCRIPTION";
|
|
1405
|
+
input: SetModuleDescriptionInput;
|
|
1406
|
+
};
|
|
1407
|
+
type DeleteModuleAction = Action & {
|
|
1408
|
+
type: "DELETE_MODULE";
|
|
1409
|
+
input: DeleteModuleInput;
|
|
1410
|
+
};
|
|
1411
|
+
type ReorderModulesAction = Action & {
|
|
1412
|
+
type: "REORDER_MODULES";
|
|
1413
|
+
input: ReorderModulesInput;
|
|
1414
|
+
};
|
|
1415
|
+
type DocumentModelModuleAction = AddModuleAction | SetModuleNameAction | SetModuleDescriptionAction | DeleteModuleAction | ReorderModulesAction;
|
|
1416
|
+
type AddOperationAction = Action & {
|
|
1417
|
+
type: "ADD_OPERATION";
|
|
1418
|
+
input: AddOperationInput;
|
|
1419
|
+
};
|
|
1420
|
+
type SetOperationNameAction = Action & {
|
|
1421
|
+
type: "SET_OPERATION_NAME";
|
|
1422
|
+
input: SetOperationNameInput;
|
|
1423
|
+
};
|
|
1424
|
+
type SetOperationScopeAction = Action & {
|
|
1425
|
+
type: "SET_OPERATION_SCOPE";
|
|
1426
|
+
input: SetOperationScopeInput;
|
|
1427
|
+
};
|
|
1428
|
+
type SetOperationSchemaAction = Action & {
|
|
1429
|
+
type: "SET_OPERATION_SCHEMA";
|
|
1430
|
+
input: SetOperationSchemaInput;
|
|
1431
|
+
};
|
|
1432
|
+
type SetOperationDescriptionAction = Action & {
|
|
1433
|
+
type: "SET_OPERATION_DESCRIPTION";
|
|
1434
|
+
input: SetOperationDescriptionInput;
|
|
1435
|
+
};
|
|
1436
|
+
type SetOperationTemplateAction = Action & {
|
|
1437
|
+
type: "SET_OPERATION_TEMPLATE";
|
|
1438
|
+
input: SetOperationTemplateInput;
|
|
1439
|
+
};
|
|
1440
|
+
type SetOperationReducerAction = Action & {
|
|
1441
|
+
type: "SET_OPERATION_REDUCER";
|
|
1442
|
+
input: SetOperationReducerInput;
|
|
1443
|
+
};
|
|
1444
|
+
type MoveOperationAction = Action & {
|
|
1445
|
+
type: "MOVE_OPERATION";
|
|
1446
|
+
input: MoveOperationInput;
|
|
1447
|
+
};
|
|
1448
|
+
type DeleteOperationAction = Action & {
|
|
1449
|
+
type: "DELETE_OPERATION";
|
|
1450
|
+
input: DeleteOperationInput;
|
|
1451
|
+
};
|
|
1452
|
+
type ReorderModuleOperationsAction = Action & {
|
|
1453
|
+
type: "REORDER_MODULE_OPERATIONS";
|
|
1454
|
+
input: ReorderModuleOperationsInput;
|
|
1455
|
+
};
|
|
1456
|
+
type DocumentModelOperationAction = AddOperationAction | SetOperationNameAction | SetOperationScopeAction | SetOperationSchemaAction | SetOperationDescriptionAction | SetOperationTemplateAction | SetOperationReducerAction | MoveOperationAction | DeleteOperationAction | ReorderModuleOperationsAction;
|
|
1457
|
+
type AddOperationErrorAction = Action & {
|
|
1458
|
+
type: "ADD_OPERATION_ERROR";
|
|
1459
|
+
input: AddOperationErrorInput;
|
|
1460
|
+
};
|
|
1461
|
+
type SetOperationErrorCodeAction = Action & {
|
|
1462
|
+
type: "SET_OPERATION_ERROR_CODE";
|
|
1463
|
+
input: SetOperationErrorCodeInput;
|
|
1464
|
+
};
|
|
1465
|
+
type SetOperationErrorNameAction = Action & {
|
|
1466
|
+
type: "SET_OPERATION_ERROR_NAME";
|
|
1467
|
+
input: SetOperationErrorNameInput;
|
|
1468
|
+
};
|
|
1469
|
+
type SetOperationErrorDescriptionAction = Action & {
|
|
1470
|
+
type: "SET_OPERATION_ERROR_DESCRIPTION";
|
|
1471
|
+
input: SetOperationErrorDescriptionInput;
|
|
1472
|
+
};
|
|
1473
|
+
type SetOperationErrorTemplateAction = Action & {
|
|
1474
|
+
type: "SET_OPERATION_ERROR_TEMPLATE";
|
|
1475
|
+
input: SetOperationErrorTemplateInput;
|
|
1476
|
+
};
|
|
1477
|
+
type DeleteOperationErrorAction = Action & {
|
|
1478
|
+
type: "DELETE_OPERATION_ERROR";
|
|
1479
|
+
input: DeleteOperationErrorInput;
|
|
1480
|
+
};
|
|
1481
|
+
type ReorderOperationErrorsAction = Action & {
|
|
1482
|
+
type: "REORDER_OPERATION_ERRORS";
|
|
1483
|
+
input: ReorderOperationErrorsInput;
|
|
1484
|
+
};
|
|
1485
|
+
type DocumentModelOperationErrorAction = AddOperationErrorAction | SetOperationErrorCodeAction | SetOperationErrorNameAction | SetOperationErrorDescriptionAction | SetOperationErrorTemplateAction | DeleteOperationErrorAction | ReorderOperationErrorsAction;
|
|
1486
|
+
type AddOperationExampleAction = Action & {
|
|
1487
|
+
type: "ADD_OPERATION_EXAMPLE";
|
|
1488
|
+
input: AddOperationExampleInput;
|
|
1489
|
+
};
|
|
1490
|
+
type UpdateOperationExampleAction = Action & {
|
|
1491
|
+
type: "UPDATE_OPERATION_EXAMPLE";
|
|
1492
|
+
input: UpdateOperationExampleInput;
|
|
1493
|
+
};
|
|
1494
|
+
type DeleteOperationExampleAction = Action & {
|
|
1495
|
+
type: "DELETE_OPERATION_EXAMPLE";
|
|
1496
|
+
input: DeleteOperationExampleInput;
|
|
1497
|
+
};
|
|
1498
|
+
type ReorderOperationExamplesAction = Action & {
|
|
1499
|
+
type: "REORDER_OPERATION_EXAMPLES";
|
|
1500
|
+
input: ReorderOperationExamplesInput;
|
|
1501
|
+
};
|
|
1502
|
+
type DocumentModelOperationExampleAction = AddOperationExampleAction | UpdateOperationExampleAction | DeleteOperationExampleAction | ReorderOperationExamplesAction;
|
|
1503
|
+
type SetStateSchemaAction = Action & {
|
|
1504
|
+
type: "SET_STATE_SCHEMA";
|
|
1505
|
+
input: SetStateSchemaInput;
|
|
1506
|
+
};
|
|
1507
|
+
type SetInitialStateAction = Action & {
|
|
1508
|
+
type: "SET_INITIAL_STATE";
|
|
1509
|
+
input: SetInitialStateInput;
|
|
1510
|
+
};
|
|
1511
|
+
type AddStateExampleAction = Action & {
|
|
1512
|
+
type: "ADD_STATE_EXAMPLE";
|
|
1513
|
+
input: AddStateExampleInput;
|
|
1514
|
+
};
|
|
1515
|
+
type UpdateStateExampleAction = Action & {
|
|
1516
|
+
type: "UPDATE_STATE_EXAMPLE";
|
|
1517
|
+
input: UpdateStateExampleInput;
|
|
1518
|
+
};
|
|
1519
|
+
type DeleteStateExampleAction = Action & {
|
|
1520
|
+
type: "DELETE_STATE_EXAMPLE";
|
|
1521
|
+
input: DeleteStateExampleInput;
|
|
1522
|
+
};
|
|
1523
|
+
type ReorderStateExamplesAction = Action & {
|
|
1524
|
+
type: "REORDER_STATE_EXAMPLES";
|
|
1525
|
+
input: ReorderStateExamplesInput;
|
|
1526
|
+
};
|
|
1527
|
+
type DocumentModelStateAction = SetStateSchemaAction | SetInitialStateAction | AddStateExampleAction | UpdateStateExampleAction | DeleteStateExampleAction | ReorderStateExamplesAction;
|
|
1528
|
+
type AddChangeLogItemAction = Action & {
|
|
1529
|
+
type: "ADD_CHANGE_LOG_ITEM";
|
|
1530
|
+
input: AddChangeLogItemInput;
|
|
1531
|
+
};
|
|
1532
|
+
type UpdateChangeLogItemAction = Action & {
|
|
1533
|
+
type: "UPDATE_CHANGE_LOG_ITEM";
|
|
1534
|
+
input: UpdateChangeLogItemInput;
|
|
1535
|
+
};
|
|
1536
|
+
type DeleteChangeLogItemAction = Action & {
|
|
1537
|
+
type: "DELETE_CHANGE_LOG_ITEM";
|
|
1538
|
+
input: DeleteChangeLogItemInput;
|
|
1539
|
+
};
|
|
1540
|
+
type ReorderChangeLogItemsAction = Action & {
|
|
1541
|
+
type: "REORDER_CHANGE_LOG_ITEMS";
|
|
1542
|
+
input: ReorderChangeLogItemsInput;
|
|
1543
|
+
};
|
|
1544
|
+
type ReleaseNewVersionAction = Action & {
|
|
1545
|
+
type: "RELEASE_NEW_VERSION";
|
|
1546
|
+
input: {};
|
|
1547
|
+
};
|
|
1548
|
+
type DocumentModelVersioningAction = AddChangeLogItemAction | UpdateChangeLogItemAction | DeleteChangeLogItemAction | ReorderChangeLogItemsAction | ReleaseNewVersionAction;
|
|
1549
|
+
interface DocumentModelHeaderOperations {
|
|
1550
|
+
setModelNameOperation: (state: DocumentModelGlobalState, action: SetModelNameAction) => void;
|
|
1551
|
+
setModelIdOperation: (state: DocumentModelGlobalState, action: SetModelIdAction) => void;
|
|
1552
|
+
setModelExtensionOperation: (state: DocumentModelGlobalState, action: SetModelExtensionAction) => void;
|
|
1553
|
+
setModelDescriptionOperation: (state: DocumentModelGlobalState, action: SetModelDescriptionAction) => void;
|
|
1554
|
+
setAuthorNameOperation: (state: DocumentModelGlobalState, action: SetAuthorNameAction) => void;
|
|
1555
|
+
setAuthorWebsiteOperation: (state: DocumentModelGlobalState, action: SetAuthorWebsiteAction) => void;
|
|
1556
|
+
}
|
|
1557
|
+
interface DocumentModelModuleOperations {
|
|
1558
|
+
addModuleOperation: (state: DocumentModelGlobalState, action: AddModuleAction) => void;
|
|
1559
|
+
setModuleNameOperation: (state: DocumentModelGlobalState, action: SetModuleNameAction) => void;
|
|
1560
|
+
setModuleDescriptionOperation: (state: DocumentModelGlobalState, action: SetModuleDescriptionAction) => void;
|
|
1561
|
+
deleteModuleOperation: (state: DocumentModelGlobalState, action: DeleteModuleAction) => void;
|
|
1562
|
+
reorderModulesOperation: (state: DocumentModelGlobalState, action: ReorderModulesAction) => void;
|
|
1563
|
+
}
|
|
1564
|
+
type DocumentModelOperationOperations = {
|
|
1565
|
+
addOperationOperation: (state: DocumentModelGlobalState, action: AddOperationAction) => void;
|
|
1566
|
+
setOperationNameOperation: (state: DocumentModelGlobalState, action: SetOperationNameAction) => void;
|
|
1567
|
+
setOperationScopeOperation: (state: DocumentModelGlobalState, action: SetOperationScopeAction) => void;
|
|
1568
|
+
setOperationSchemaOperation: (state: DocumentModelGlobalState, action: SetOperationSchemaAction) => void;
|
|
1569
|
+
setOperationDescriptionOperation: (state: DocumentModelGlobalState, action: SetOperationDescriptionAction) => void;
|
|
1570
|
+
setOperationTemplateOperation: (state: DocumentModelGlobalState, action: SetOperationTemplateAction) => void;
|
|
1571
|
+
setOperationReducerOperation: (state: DocumentModelGlobalState, action: SetOperationReducerAction) => void;
|
|
1572
|
+
moveOperationOperation: (state: DocumentModelGlobalState, action: MoveOperationAction) => void;
|
|
1573
|
+
deleteOperationOperation: (state: DocumentModelGlobalState, action: DeleteOperationAction) => void;
|
|
1574
|
+
reorderModuleOperationsOperation: (state: DocumentModelGlobalState, action: ReorderModuleOperationsAction) => void;
|
|
1575
|
+
};
|
|
1576
|
+
interface DocumentModelOperationErrorOperations {
|
|
1577
|
+
addOperationErrorOperation: (state: DocumentModelGlobalState, action: AddOperationErrorAction) => void;
|
|
1578
|
+
setOperationErrorCodeOperation: (state: DocumentModelGlobalState, action: SetOperationErrorCodeAction) => void;
|
|
1579
|
+
setOperationErrorNameOperation: (state: DocumentModelGlobalState, action: SetOperationErrorNameAction) => void;
|
|
1580
|
+
setOperationErrorDescriptionOperation: (state: DocumentModelGlobalState, action: SetOperationErrorDescriptionAction) => void;
|
|
1581
|
+
setOperationErrorTemplateOperation: (state: DocumentModelGlobalState, action: SetOperationErrorTemplateAction) => void;
|
|
1582
|
+
deleteOperationErrorOperation: (state: DocumentModelGlobalState, action: DeleteOperationErrorAction) => void;
|
|
1583
|
+
reorderOperationErrorsOperation: (state: DocumentModelGlobalState, action: ReorderOperationErrorsAction) => void;
|
|
1584
|
+
}
|
|
1585
|
+
interface DocumentModelOperationExampleOperations {
|
|
1586
|
+
addOperationExampleOperation: (state: DocumentModelGlobalState, action: AddOperationExampleAction) => void;
|
|
1587
|
+
updateOperationExampleOperation: (state: DocumentModelGlobalState, action: UpdateOperationExampleAction) => void;
|
|
1588
|
+
deleteOperationExampleOperation: (state: DocumentModelGlobalState, action: DeleteOperationExampleAction) => void;
|
|
1589
|
+
reorderOperationExamplesOperation: (state: DocumentModelGlobalState, action: ReorderOperationExamplesAction) => void;
|
|
1590
|
+
}
|
|
1591
|
+
interface DocumentModelStateOperations {
|
|
1592
|
+
setStateSchemaOperation: (state: DocumentModelGlobalState, action: SetStateSchemaAction) => void;
|
|
1593
|
+
setInitialStateOperation: (state: DocumentModelGlobalState, action: SetInitialStateAction) => void;
|
|
1594
|
+
addStateExampleOperation: (state: DocumentModelGlobalState, action: AddStateExampleAction) => void;
|
|
1595
|
+
updateStateExampleOperation: (state: DocumentModelGlobalState, action: UpdateStateExampleAction) => void;
|
|
1596
|
+
deleteStateExampleOperation: (state: DocumentModelGlobalState, action: DeleteStateExampleAction) => void;
|
|
1597
|
+
reorderStateExamplesOperation: (state: DocumentModelGlobalState, action: ReorderStateExamplesAction) => void;
|
|
1598
|
+
}
|
|
1599
|
+
interface DocumentModelVersioningOperations {
|
|
1600
|
+
addChangeLogItemOperation: (state: DocumentModelGlobalState, action: AddChangeLogItemAction) => void;
|
|
1601
|
+
updateChangeLogItemOperation: (state: DocumentModelGlobalState, action: UpdateChangeLogItemAction) => void;
|
|
1602
|
+
deleteChangeLogItemOperation: (state: DocumentModelGlobalState, action: DeleteChangeLogItemAction) => void;
|
|
1603
|
+
reorderChangeLogItemsOperation: (state: DocumentModelGlobalState, action: ReorderChangeLogItemsAction) => void;
|
|
1604
|
+
releaseNewVersionOperation: (state: DocumentModelGlobalState, action: ReleaseNewVersionAction) => void;
|
|
1605
|
+
}
|
|
1606
|
+
type Maybe<T> = T | null;
|
|
1607
|
+
type InputMaybe<T> = T | null | undefined;
|
|
1608
|
+
type Exact<T extends Record<string, unknown>> = { [K in keyof T]: T[K] };
|
|
1609
|
+
type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
|
|
1610
|
+
type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
|
|
1611
|
+
type MakeEmpty<T extends Record<string, unknown>, K extends keyof T> = { [_ in K]?: never };
|
|
1612
|
+
type Incremental<T> = T | { [P in keyof T]?: P extends " $fragmentName" | "__typename" ? T[P] : never };
|
|
1613
|
+
/** All built-in and custom scalars, mapped to their actual values */
|
|
1614
|
+
type Scalars = {
|
|
1615
|
+
ID: {
|
|
1616
|
+
input: string;
|
|
1617
|
+
output: string;
|
|
1618
|
+
};
|
|
1619
|
+
String: {
|
|
1620
|
+
input: string;
|
|
1621
|
+
output: string;
|
|
1622
|
+
};
|
|
1623
|
+
Boolean: {
|
|
1624
|
+
input: boolean;
|
|
1625
|
+
output: boolean;
|
|
1626
|
+
};
|
|
1627
|
+
Int: {
|
|
1628
|
+
input: number;
|
|
1629
|
+
output: number;
|
|
1630
|
+
};
|
|
1631
|
+
Float: {
|
|
1632
|
+
input: number;
|
|
1633
|
+
output: number;
|
|
1634
|
+
};
|
|
1635
|
+
Address: {
|
|
1636
|
+
input: `${string}:0x${string}`;
|
|
1637
|
+
output: `${string}:0x${string}`;
|
|
1638
|
+
};
|
|
1639
|
+
Attachment: {
|
|
1640
|
+
input: string;
|
|
1641
|
+
output: string;
|
|
1642
|
+
};
|
|
1643
|
+
DateTime: {
|
|
1644
|
+
input: string;
|
|
1645
|
+
output: string;
|
|
1646
|
+
};
|
|
1647
|
+
Unknown: {
|
|
1648
|
+
input: unknown;
|
|
1649
|
+
output: unknown;
|
|
1650
|
+
};
|
|
1651
|
+
};
|
|
1652
|
+
type ID = string;
|
|
1653
|
+
type OperationsByScope = Partial<Record<string, Operation[]>>;
|
|
1654
|
+
type SkipHeaderOperationIndex = Partial<Pick<OperationIndex, "index">> & Pick<OperationIndex, "skip">;
|
|
1655
|
+
type UndoRedoAction = SchemaRedoAction | SchemaUndoAction;
|
|
1656
|
+
type DocumentFile = {
|
|
1657
|
+
__typename?: "DocumentFile";
|
|
1658
|
+
data: Scalars["String"]["output"];
|
|
1659
|
+
extension: Maybe<Scalars["String"]["output"]>;
|
|
1660
|
+
fileName: Maybe<Scalars["String"]["output"]>;
|
|
1661
|
+
mimeType: Scalars["String"]["output"];
|
|
1662
|
+
};
|
|
1663
|
+
type IAction = {
|
|
1664
|
+
type: Scalars["String"]["output"];
|
|
1665
|
+
};
|
|
1666
|
+
type IDocument = {
|
|
1667
|
+
created: Scalars["DateTime"]["output"];
|
|
1668
|
+
documentType: Scalars["String"]["output"];
|
|
1669
|
+
lastModified: Scalars["DateTime"]["output"];
|
|
1670
|
+
name: Scalars["String"]["output"];
|
|
1671
|
+
operations: Array<IOperation>;
|
|
1672
|
+
revision: Scalars["Int"]["output"];
|
|
1673
|
+
};
|
|
1674
|
+
type IOperation = {
|
|
1675
|
+
hash: Scalars["String"]["output"];
|
|
1676
|
+
index: Scalars["Int"]["output"];
|
|
1677
|
+
timestampUtcMs: Scalars["DateTime"]["output"];
|
|
1678
|
+
type: Scalars["String"]["output"];
|
|
1679
|
+
};
|
|
1680
|
+
type Load_State = "LOAD_STATE";
|
|
1681
|
+
type SchemaLoadStateAction = {
|
|
1682
|
+
id: Scalars["String"]["output"];
|
|
1683
|
+
timestampUtcMs: Scalars["DateTime"]["output"];
|
|
1684
|
+
input: LoadStateActionInput;
|
|
1685
|
+
type: Load_State;
|
|
1686
|
+
scope: string;
|
|
1687
|
+
};
|
|
1688
|
+
type LoadStateActionInput = {
|
|
1689
|
+
operations: Scalars["Int"]["input"];
|
|
1690
|
+
state: LoadStateActionStateInput;
|
|
1691
|
+
};
|
|
1692
|
+
type LoadStateActionStateInput = {
|
|
1693
|
+
data?: InputMaybe<Scalars["Unknown"]["input"]>;
|
|
1694
|
+
name: Scalars["String"]["input"];
|
|
1695
|
+
};
|
|
1696
|
+
type MutationLoadStateArgs = {
|
|
1697
|
+
input: SchemaLoadStateAction;
|
|
1698
|
+
};
|
|
1699
|
+
type MutationPruneArgs = {
|
|
1700
|
+
input: SchemaPruneAction;
|
|
1701
|
+
};
|
|
1702
|
+
type MutationRedoArgs = {
|
|
1703
|
+
input: SchemaRedoAction;
|
|
1704
|
+
};
|
|
1705
|
+
type MutationSetNameArgs = {
|
|
1706
|
+
input: SchemaSetNameAction;
|
|
1707
|
+
};
|
|
1708
|
+
type MutationUndoArgs = {
|
|
1709
|
+
input: SchemaUndoAction;
|
|
1710
|
+
};
|
|
1711
|
+
type Prune = "PRUNE";
|
|
1712
|
+
type SchemaPruneAction = {
|
|
1713
|
+
id: Scalars["String"]["output"];
|
|
1714
|
+
timestampUtcMs: Scalars["DateTime"]["output"];
|
|
1715
|
+
input: PruneActionInput;
|
|
1716
|
+
type: Prune;
|
|
1717
|
+
scope: string;
|
|
1718
|
+
};
|
|
1719
|
+
type PruneActionInput = {
|
|
1720
|
+
end?: InputMaybe<Scalars["Int"]["input"]>;
|
|
1721
|
+
start?: InputMaybe<Scalars["Int"]["input"]>;
|
|
1722
|
+
};
|
|
1723
|
+
type Query = {
|
|
1724
|
+
__typename?: "Query";
|
|
1725
|
+
document: Maybe<IDocument>;
|
|
1726
|
+
};
|
|
1727
|
+
type Redo = "REDO";
|
|
1728
|
+
type RedoActionInput = {
|
|
1729
|
+
count: Scalars["Int"]["input"];
|
|
1730
|
+
};
|
|
1731
|
+
type SchemaRedoAction = {
|
|
1732
|
+
id: Scalars["String"]["output"];
|
|
1733
|
+
timestampUtcMs: Scalars["DateTime"]["output"];
|
|
1734
|
+
input: RedoActionInput;
|
|
1735
|
+
type: Redo;
|
|
1736
|
+
scope: string;
|
|
1737
|
+
};
|
|
1738
|
+
type Set_Name = "SET_NAME";
|
|
1739
|
+
type SetNameActionInput = {
|
|
1740
|
+
name: Scalars["String"]["input"];
|
|
1741
|
+
};
|
|
1742
|
+
type SchemaSetNameAction = {
|
|
1743
|
+
id: Scalars["String"]["output"];
|
|
1744
|
+
timestampUtcMs: Scalars["DateTime"]["output"];
|
|
1745
|
+
input: SetNameActionInput;
|
|
1746
|
+
type: Set_Name;
|
|
1747
|
+
scope: "global";
|
|
1748
|
+
};
|
|
1749
|
+
type SetNameOperation = IOperation & {
|
|
1750
|
+
__typename?: "SetNameOperation";
|
|
1751
|
+
hash: Scalars["String"]["output"];
|
|
1752
|
+
index: Scalars["Int"]["output"];
|
|
1753
|
+
input: Scalars["String"]["output"];
|
|
1754
|
+
timestamp: Scalars["DateTime"]["output"];
|
|
1755
|
+
type: Scalars["String"]["output"];
|
|
1756
|
+
};
|
|
1757
|
+
type Undo = "UNDO";
|
|
1758
|
+
type UndoActionInput = {
|
|
1759
|
+
count: Scalars["Int"]["input"];
|
|
1760
|
+
};
|
|
1761
|
+
type SchemaUndoAction = {
|
|
1762
|
+
id: Scalars["String"]["output"];
|
|
1763
|
+
timestampUtcMs: Scalars["DateTime"]["output"];
|
|
1764
|
+
input: UndoActionInput;
|
|
1765
|
+
type: Undo;
|
|
1766
|
+
scope: string;
|
|
1767
|
+
};
|
|
1768
|
+
type SchemaNOOPAction = {
|
|
1769
|
+
id: Scalars["String"]["output"];
|
|
1770
|
+
input: Scalars["Unknown"]["input"];
|
|
1771
|
+
scope: string;
|
|
1772
|
+
timestampUtcMs: Scalars["DateTime"]["output"];
|
|
1773
|
+
type: "NOOP";
|
|
1774
|
+
};
|
|
1775
|
+
type LoadStateAction = Action & {
|
|
1776
|
+
type: "LOAD_STATE";
|
|
1777
|
+
input: LoadStateActionInput;
|
|
1778
|
+
};
|
|
1779
|
+
type PruneAction = Action & {
|
|
1780
|
+
type: "PRUNE";
|
|
1781
|
+
input: PruneActionInput;
|
|
1782
|
+
};
|
|
1783
|
+
type RedoAction = Action & {
|
|
1784
|
+
type: "REDO";
|
|
1785
|
+
input: SchemaRedoAction["input"];
|
|
1786
|
+
};
|
|
1787
|
+
type SetNameAction = Action & {
|
|
1788
|
+
type: "SET_NAME";
|
|
1789
|
+
input: SchemaSetNameAction["input"];
|
|
1790
|
+
};
|
|
1791
|
+
type UndoAction = Action & {
|
|
1792
|
+
type: "UNDO";
|
|
1793
|
+
input: SchemaUndoAction["input"];
|
|
1794
|
+
};
|
|
1795
|
+
type NOOPAction = Action & {
|
|
1796
|
+
type: "NOOP";
|
|
1797
|
+
input: SchemaNOOPAction["input"];
|
|
1798
|
+
};
|
|
1799
|
+
type CreateDocumentActionInput = {
|
|
1800
|
+
model: string;
|
|
1801
|
+
version: 0;
|
|
1802
|
+
documentId: string;
|
|
1803
|
+
signing?: {
|
|
1804
|
+
signature: string;
|
|
1805
|
+
publicKey: JsonWebKey;
|
|
1806
|
+
nonce: string;
|
|
1807
|
+
createdAtUtcIso: string;
|
|
1808
|
+
documentType: string;
|
|
1809
|
+
};
|
|
1810
|
+
slug?: string;
|
|
1811
|
+
name?: string;
|
|
1812
|
+
branch?: string;
|
|
1813
|
+
meta?: Record<string, unknown>;
|
|
1814
|
+
protocolVersions?: {
|
|
1815
|
+
[key: string]: number;
|
|
1816
|
+
};
|
|
1817
|
+
};
|
|
1818
|
+
type UpgradeDocumentActionInput = {
|
|
1819
|
+
model: string;
|
|
1820
|
+
fromVersion: number;
|
|
1821
|
+
toVersion: number;
|
|
1822
|
+
documentId: string;
|
|
1823
|
+
initialState?: object;
|
|
1824
|
+
};
|
|
1825
|
+
type DeleteDocumentActionInput = {
|
|
1826
|
+
documentId: string;
|
|
1827
|
+
propagate?: "none" | "cascade";
|
|
1828
|
+
};
|
|
1829
|
+
type AddRelationshipActionInput = {
|
|
1830
|
+
sourceId: string;
|
|
1831
|
+
targetId: string;
|
|
1832
|
+
relationshipType: string;
|
|
1833
|
+
metadata?: Record<string, unknown>;
|
|
1834
|
+
};
|
|
1835
|
+
type RemoveRelationshipActionInput = {
|
|
1836
|
+
sourceId: string;
|
|
1837
|
+
targetId: string;
|
|
1838
|
+
relationshipType: string;
|
|
1839
|
+
};
|
|
1840
|
+
type CreateDocumentAction = Action & {
|
|
1841
|
+
type: "CREATE_DOCUMENT";
|
|
1842
|
+
input: CreateDocumentActionInput;
|
|
1843
|
+
};
|
|
1844
|
+
type UpgradeDocumentAction = Action & {
|
|
1845
|
+
type: "UPGRADE_DOCUMENT";
|
|
1846
|
+
input: UpgradeDocumentActionInput;
|
|
1847
|
+
};
|
|
1848
|
+
type DeleteDocumentAction = Action & {
|
|
1849
|
+
type: "DELETE_DOCUMENT";
|
|
1850
|
+
input: DeleteDocumentActionInput;
|
|
1851
|
+
};
|
|
1852
|
+
type AddRelationshipAction = Action & {
|
|
1853
|
+
type: "ADD_RELATIONSHIP";
|
|
1854
|
+
input: AddRelationshipActionInput;
|
|
1855
|
+
};
|
|
1856
|
+
type RemoveRelationshipAction = Action & {
|
|
1857
|
+
type: "REMOVE_RELATIONSHIP";
|
|
1858
|
+
input: RemoveRelationshipActionInput;
|
|
1859
|
+
};
|
|
1860
|
+
type DocumentAction = LoadStateAction | PruneAction | RedoAction | SetNameAction | UndoAction | NOOPAction;
|
|
1861
|
+
interface ISignal<TType extends string, TInput> {
|
|
1862
|
+
type: TType;
|
|
1863
|
+
input: TInput;
|
|
1864
|
+
}
|
|
1865
|
+
type ISignalResult<TTYpe, TInput, TResult> = {
|
|
1866
|
+
signal: {
|
|
1867
|
+
type: TTYpe;
|
|
1868
|
+
input: TInput;
|
|
1869
|
+
};
|
|
1870
|
+
result: TResult;
|
|
1871
|
+
};
|
|
1872
|
+
type CreateChildDocumentInput = {
|
|
1873
|
+
id: string;
|
|
1874
|
+
documentType: string;
|
|
1875
|
+
};
|
|
1876
|
+
type CreateChildDocumentSignal = ISignal<"CREATE_CHILD_DOCUMENT", CreateChildDocumentInput>;
|
|
1877
|
+
type DeleteChildDocumentInput = {
|
|
1878
|
+
id: string;
|
|
1879
|
+
};
|
|
1880
|
+
type DeleteChildDocumentSignal = ISignal<"DELETE_CHILD_DOCUMENT", DeleteChildDocumentInput>;
|
|
1881
|
+
type CopyChildDocumentInput = {
|
|
1882
|
+
id: string;
|
|
1883
|
+
newId: string;
|
|
1884
|
+
};
|
|
1885
|
+
type CopyChildDocumentSignal = ISignal<"COPY_CHILD_DOCUMENT", CopyChildDocumentInput>;
|
|
1886
|
+
type Signal = CreateChildDocumentSignal | CopyChildDocumentSignal | DeleteChildDocumentSignal;
|
|
1887
|
+
type SignalDispatch = (signal: Signal) => void;
|
|
1888
|
+
type SignalResult = ISignalResult<CreateChildDocumentSignal["type"], CreateChildDocumentSignal["input"], PHDocument> | ISignalResult<CopyChildDocumentSignal["type"], CopyChildDocumentSignal["input"], boolean> | ISignalResult<DeleteChildDocumentSignal["type"], DeleteChildDocumentSignal["input"], PHDocument>;
|
|
1889
|
+
type SignalResults = {
|
|
1890
|
+
CREATE_CHILD_DOCUMENT: PHDocument;
|
|
1891
|
+
COPY_CHILD_DOCUMENT: PHDocument;
|
|
1892
|
+
DELETE_CHILD_DOCUMENT: boolean;
|
|
1893
|
+
};
|
|
1894
|
+
type SignalType<T extends Signal> = T["type"];
|
|
1895
|
+
type FileInput = string | number[] | Uint8Array | ArrayBuffer | Blob;
|
|
1896
|
+
type ReducerOptions = {
|
|
1897
|
+
/** The number of operations to skip before this new action is applied. This overrides the skip count in the operation. */skip?: number; /** When true the skip count is ignored and the action is applied regardless of the skip count */
|
|
1898
|
+
ignoreSkipOperations?: boolean; /** if true reuses the provided action resulting state instead of replaying it */
|
|
1899
|
+
reuseOperationResultingState?: boolean; /** if true checks the hashes of the operations */
|
|
1900
|
+
checkHashes?: boolean; /** Options for performing a replay. */
|
|
1901
|
+
replayOptions?: {
|
|
1902
|
+
/** The previously created operation to verify against. */operation: Operation;
|
|
1903
|
+
}; /** Optional parser for the operation resulting state, uses JSON.parse by default */
|
|
1904
|
+
operationResultingStateParser?: <TState>(state: string | null | undefined) => TState;
|
|
1905
|
+
/**
|
|
1906
|
+
* When true (default), the reducer will prune operations (garbage collect) when processing a skip.
|
|
1907
|
+
* When false, it will recompute state for the skip but preserve the existing operations history.
|
|
1908
|
+
*/
|
|
1909
|
+
pruneOnSkip?: boolean; /** The branch being operated on. Defaults to "main". */
|
|
1910
|
+
branch?: string;
|
|
1911
|
+
/**
|
|
1912
|
+
* Protocol version controlling undo/redo behavior.
|
|
1913
|
+
* - Version 1 (default): Legacy behavior with index reuse
|
|
1914
|
+
* - Version 2: Reactor behavior with monotonic indices
|
|
1915
|
+
*/
|
|
1916
|
+
protocolVersion?: number;
|
|
1917
|
+
/**
|
|
1918
|
+
* When true, skip index contiguity validation during replay.
|
|
1919
|
+
* Used for V2 state rebuild where gapped indices are expected.
|
|
1920
|
+
*/
|
|
1921
|
+
skipIndexValidation?: boolean;
|
|
1922
|
+
};
|
|
1923
|
+
/**
|
|
1924
|
+
* A pure function that takes an action and the previous state
|
|
1925
|
+
* of the document and returns the new state.
|
|
1926
|
+
*/
|
|
1927
|
+
type Reducer<TState extends PHBaseState = PHBaseState> = (document: PHDocument<TState>, action: Action, dispatch?: SignalDispatch, options?: ReducerOptions) => PHDocument<TState>;
|
|
1928
|
+
type StateReducer<TState extends PHBaseState = PHBaseState> = (state: Draft<TState>, action: Action, dispatch?: SignalDispatch) => TState | undefined;
|
|
1929
|
+
type PHStateReducer<TState extends PHBaseState = PHBaseState> = StateReducer<TState>;
|
|
1930
|
+
type Meta = {
|
|
1931
|
+
preferredEditor?: string;
|
|
1932
|
+
};
|
|
1933
|
+
/**
|
|
1934
|
+
* Object that indexes attachments of a Document.
|
|
1935
|
+
*
|
|
1936
|
+
* @remarks
|
|
1937
|
+
* This is used to reduce memory usage to avoid
|
|
1938
|
+
* multiple instances of the binary data of the attachments.
|
|
1939
|
+
*
|
|
1940
|
+
*/
|
|
1941
|
+
type FileRegistry = Record<AttachmentRef, Attachment>;
|
|
1942
|
+
type MappedOperation = {
|
|
1943
|
+
ignore: boolean;
|
|
1944
|
+
operation: Operation;
|
|
1945
|
+
};
|
|
1946
|
+
type DocumentOperationsIgnoreMap = Record<string, MappedOperation[]>;
|
|
1947
|
+
type ActionSignatureContext = {
|
|
1948
|
+
documentId: string;
|
|
1949
|
+
signer: ActionSigner;
|
|
1950
|
+
action: Action;
|
|
1951
|
+
previousStateHash: string;
|
|
1952
|
+
};
|
|
1953
|
+
type ActionSigningHandler = (message: Uint8Array) => Promise<Uint8Array>;
|
|
1954
|
+
type ActionVerificationHandler = (publicKey: string, signature: Uint8Array, data: Uint8Array) => Promise<boolean>;
|
|
1955
|
+
/**
|
|
1956
|
+
* Handler for verifying operation signatures.
|
|
1957
|
+
*
|
|
1958
|
+
* @param operation - The operation to verify
|
|
1959
|
+
* @param publicKey - The public key to verify against (from signer.app.key)
|
|
1960
|
+
* @returns Promise that resolves to true if signature is valid, false otherwise
|
|
1961
|
+
*/
|
|
1962
|
+
type SignatureVerificationHandler = (operation: Operation, publicKey: string) => Promise<boolean>;
|
|
1963
|
+
type ENSInfo = {
|
|
1964
|
+
name?: string;
|
|
1965
|
+
avatarUrl?: string;
|
|
1966
|
+
};
|
|
1967
|
+
type User = {
|
|
1968
|
+
address: `0x${string}`;
|
|
1969
|
+
networkId: string;
|
|
1970
|
+
chainId: number;
|
|
1971
|
+
ens?: ENSInfo;
|
|
1972
|
+
};
|
|
1973
|
+
type PartialRecord<K extends keyof any, T> = { [P in K]?: T };
|
|
1974
|
+
type RevisionsFilter = PartialRecord<string, number>;
|
|
1975
|
+
type GetDocumentOptions = ReducerOptions & {
|
|
1976
|
+
revisions?: RevisionsFilter;
|
|
1977
|
+
checkHashes?: boolean;
|
|
1978
|
+
};
|
|
1979
|
+
type ActionErrorCallback = (error: unknown) => void;
|
|
1980
|
+
type EditorDispatch = (action: Action, onErrorCallback?: ActionErrorCallback) => void;
|
|
1981
|
+
type EditorProps = {
|
|
1982
|
+
children?: ReactNode;
|
|
1983
|
+
className?: string;
|
|
1984
|
+
document?: PHDocument;
|
|
1985
|
+
};
|
|
1986
|
+
type SubgraphModule = {
|
|
1987
|
+
id: string;
|
|
1988
|
+
name: string;
|
|
1989
|
+
gql: string;
|
|
1990
|
+
endpoint: string;
|
|
1991
|
+
};
|
|
1992
|
+
type ImportScriptModule = {
|
|
1993
|
+
id: string;
|
|
1994
|
+
name: string;
|
|
1995
|
+
gql: string;
|
|
1996
|
+
endpoint: string;
|
|
1997
|
+
};
|
|
1998
|
+
type EditorModule<TProps = any> = {
|
|
1999
|
+
Component: FC<EditorProps & TProps>;
|
|
2000
|
+
documentTypes: string[];
|
|
2001
|
+
config: {
|
|
2002
|
+
id: string;
|
|
2003
|
+
name: string;
|
|
2004
|
+
};
|
|
2005
|
+
};
|
|
2006
|
+
type App = {
|
|
2007
|
+
id: string;
|
|
2008
|
+
name: string;
|
|
2009
|
+
driveEditor?: string;
|
|
2010
|
+
};
|
|
2011
|
+
type Manifest = {
|
|
2012
|
+
name: string;
|
|
2013
|
+
description: string;
|
|
2014
|
+
category: string;
|
|
2015
|
+
publisher: {
|
|
2016
|
+
name: string;
|
|
2017
|
+
url: string;
|
|
2018
|
+
};
|
|
2019
|
+
documentModels?: {
|
|
2020
|
+
id: string;
|
|
2021
|
+
name: string;
|
|
2022
|
+
}[];
|
|
2023
|
+
editors?: {
|
|
2024
|
+
id: string;
|
|
2025
|
+
name: string;
|
|
2026
|
+
documentTypes: string[];
|
|
2027
|
+
}[];
|
|
2028
|
+
processors?: {
|
|
2029
|
+
id: string;
|
|
2030
|
+
name: string;
|
|
2031
|
+
}[];
|
|
2032
|
+
subgraphs?: {
|
|
2033
|
+
id: string;
|
|
2034
|
+
name: string;
|
|
2035
|
+
}[];
|
|
2036
|
+
importScripts?: {
|
|
2037
|
+
id: string;
|
|
2038
|
+
name: string;
|
|
2039
|
+
documentTypes: string[];
|
|
2040
|
+
}[];
|
|
2041
|
+
apps?: App[];
|
|
2042
|
+
};
|
|
2043
|
+
type ValidationError = {
|
|
2044
|
+
message: string;
|
|
2045
|
+
details: object;
|
|
2046
|
+
};
|
|
2047
|
+
type SkipHeaderOperations = Partial<Record<string, number>>;
|
|
2048
|
+
type ReplayDocumentOptions = {
|
|
2049
|
+
checkHashes?: boolean;
|
|
2050
|
+
reuseOperationResultingState?: boolean;
|
|
2051
|
+
operationResultingStateParser?: <TState>(state: string) => TState;
|
|
2052
|
+
skipIndexValidation?: boolean;
|
|
2053
|
+
};
|
|
2054
|
+
type OperationIndex = {
|
|
2055
|
+
index: number;
|
|
2056
|
+
skip: number;
|
|
2057
|
+
id?: string;
|
|
2058
|
+
timestampUtcMs?: string;
|
|
2059
|
+
};
|
|
2060
|
+
/**
|
|
2061
|
+
* Parameters used in a document signature.
|
|
2062
|
+
*/
|
|
2063
|
+
type SigningParameters = {
|
|
2064
|
+
documentType: string;
|
|
2065
|
+
createdAtUtcIso: string;
|
|
2066
|
+
/**
|
|
2067
|
+
* The nonce can act as both a salt and a typical nonce.
|
|
2068
|
+
*/
|
|
2069
|
+
nonce: string;
|
|
2070
|
+
};
|
|
2071
|
+
/**
|
|
2072
|
+
* Describes a signer that can sign both document headers and actions.
|
|
2073
|
+
*/
|
|
2074
|
+
interface ISigner {
|
|
2075
|
+
/** The user associated with the signer */
|
|
2076
|
+
user?: UserActionSigner;
|
|
2077
|
+
/** The app associated with the signer */
|
|
2078
|
+
app?: AppActionSigner;
|
|
2079
|
+
/** The corresponding public key */
|
|
2080
|
+
publicKey: CryptoKey;
|
|
2081
|
+
/**
|
|
2082
|
+
* Signs raw data (used for document header signing).
|
|
2083
|
+
*
|
|
2084
|
+
* @param data - The data to sign.
|
|
2085
|
+
* @returns The signature of the data.
|
|
2086
|
+
*/
|
|
2087
|
+
sign: (data: Uint8Array) => Promise<Uint8Array>;
|
|
2088
|
+
/**
|
|
2089
|
+
* Verifies a signature.
|
|
2090
|
+
*
|
|
2091
|
+
* @param data - The data to verify.
|
|
2092
|
+
* @param signature - The signature to verify.
|
|
2093
|
+
*/
|
|
2094
|
+
verify: (data: Uint8Array, signature: Uint8Array) => Promise<void>;
|
|
2095
|
+
/**
|
|
2096
|
+
* Signs an action (used for operation signing).
|
|
2097
|
+
*
|
|
2098
|
+
* @param action - The action to sign.
|
|
2099
|
+
* @param abortSignal - Optional abort signal to cancel the signing.
|
|
2100
|
+
* @returns The signature tuple.
|
|
2101
|
+
*/
|
|
2102
|
+
signAction: (action: Action, abortSignal?: AbortSignal) => Promise<Signature>;
|
|
2103
|
+
}
|
|
2104
|
+
type IsStateOfType<TState> = (state: unknown) => state is TState;
|
|
2105
|
+
type AssertIsStateOfType<TState> = (state: unknown) => asserts state is TState;
|
|
2106
|
+
type IsDocumentOfType<TState extends PHBaseState> = (document: unknown) => document is PHDocument<TState>;
|
|
2107
|
+
type AssertIsDocumentOfType<TState extends PHBaseState> = (document: unknown) => asserts document is PHDocument<TState>;
|
|
2108
|
+
type PartialState<TState> = TState | Partial<TState>;
|
|
2109
|
+
type CreateState<TState extends PHBaseState = PHBaseState> = (state?: PartialState<TState>) => TState;
|
|
2110
|
+
type SaveToFileHandle = (document: PHDocument, input: FileSystemFileHandle) => void | Promise<void>;
|
|
2111
|
+
type SaveToFile = (document: PHDocument, path: string, name?: string) => string | Promise<string>;
|
|
2112
|
+
type LoadFromInput<TState extends PHBaseState = PHBaseState> = (input: FileInput) => PHDocument<TState> | Promise<PHDocument<TState>>;
|
|
2113
|
+
type LoadFromFile<TState extends PHBaseState = PHBaseState> = (path: string) => PHDocument<TState> | Promise<PHDocument<TState>>;
|
|
2114
|
+
type CreateDocument<TState extends PHBaseState = PHBaseState> = (initialState?: Partial<TState>, createState?: CreateState<TState>) => PHDocument<TState>;
|
|
2115
|
+
type MinimalBackupData = {
|
|
2116
|
+
documentId: string;
|
|
2117
|
+
documentType: string;
|
|
2118
|
+
branch: string;
|
|
2119
|
+
state: PHBaseState;
|
|
2120
|
+
name: string;
|
|
2121
|
+
};
|
|
2122
|
+
type DocumentModelUtils<TState extends PHBaseState = PHBaseState> = {
|
|
2123
|
+
fileExtension: string;
|
|
2124
|
+
createState: CreateState<TState>;
|
|
2125
|
+
createDocument: CreateDocument<TState>;
|
|
2126
|
+
loadFromInput: LoadFromInput<TState>;
|
|
2127
|
+
saveToFileHandle: SaveToFileHandle;
|
|
2128
|
+
isStateOfType: IsStateOfType<TState>;
|
|
2129
|
+
assertIsStateOfType: AssertIsStateOfType<TState>;
|
|
2130
|
+
isDocumentOfType: IsDocumentOfType<TState>;
|
|
2131
|
+
assertIsDocumentOfType: AssertIsDocumentOfType<TState>;
|
|
2132
|
+
};
|
|
2133
|
+
type Actions = Record<string, (...args: any[]) => Action>;
|
|
2134
|
+
type DocumentModelModule<TState extends PHBaseState = PHBaseState> = {
|
|
2135
|
+
/** optional version field, should be made required */version?: number;
|
|
2136
|
+
reducer: Reducer<TState>;
|
|
2137
|
+
actions: Actions;
|
|
2138
|
+
utils: DocumentModelUtils<TState>;
|
|
2139
|
+
documentModel: DocumentModelPHState;
|
|
2140
|
+
};
|
|
2141
|
+
type DocumentModelLib<TState extends PHBaseState = PHBaseState> = {
|
|
2142
|
+
manifest: Manifest;
|
|
2143
|
+
documentModels: DocumentModelModule<TState>[];
|
|
2144
|
+
editors: EditorModule[];
|
|
2145
|
+
subgraphs: SubgraphModule[];
|
|
2146
|
+
importScripts: ImportScriptModule[];
|
|
2147
|
+
upgradeManifests: UpgradeManifest<readonly number[]>[] | undefined;
|
|
2148
|
+
processorFactory: ProcessorFactoryBuilder;
|
|
2149
|
+
};
|
|
2150
|
+
type DocumentModelDocumentModelModule = DocumentModelModule<DocumentModelPHState>;
|
|
2151
|
+
//#endregion
|
|
2152
|
+
export { DocumentModelDocumentModelModule as $, isNoopOperation as $a, UpdateStateExampleAction as $i, NOOPAction as $n, operationWithContext as $o, SetModelIdAction as $r, defaultAuthState as $s, MappedOperation as $t, CreateDocumentAction as A, ProcessorRecord as Aa, SetStateSchemaAction as Ai, MutationSetAuthorWebsiteArgs as An, addChangeLogItem as Ao, ReorderStateExamplesInput as Ar, undo as As, GetDocumentOptions as At, DeleteModuleInput as B, baseCreateDocument as Ba, SkipHeaderOperationIndex as Bi, MutationSetOperationErrorCodeArgs as Bn, deleteChangeLogItem as Bo, SchemaSetNameAction as Br, redoOperation as Bs, InputMaybe as Bt, Author as C, IProcessorHostModule as Ca, SetOperationReducerInput as Ci, MutationReorderChangeLogItemsInputArgs as Cn, Attachment as Co, ReorderModulesAction as Cr, setOperationErrorTemplate as Cs, ENSInfo as Ct, CreateChildDocumentInput as D, ProcessorFactory as Da, SetOperationScopeInput as Di, MutationReorderOperationExamplesArgs as Dn, actionFromAction as Do, ReorderOperationExamplesAction as Dr, setOperationScope as Ds, Exact as Dt, CopyChildDocumentSignal as E, ProcessorApps as Ea, SetOperationScopeAction as Ei, MutationReorderOperationErrorsArgs as En, actionContext as Eo, ReorderOperationErrorsInput as Er, setOperationSchema as Es, EditorProps as Et, DeleteChildDocumentInput as F, PHDocument as Fa, SignalResult as Fi, MutationSetModelNameArgs as Fn, addStateExample as Fo, Scalars as Fr, DocumentOperations as Fs, ISignal as Ft, DeleteOperationExampleInput as G, filterDuplicatedOperations as Ga, Undo as Gi, MutationSetOperationReducerArgs as Gn, deleteStateExample as Go, SetAuthorWebsiteAction as Gr, PHBaseState as Gs, LoadStateAction as Gt, DeleteOperationErrorAction as H, checkOperationsIntegrity as Ha, State as Hi, MutationSetOperationErrorNameArgs as Hn, deleteOperation as Ho, ScopeState as Hr, undoOperation as Hs, IsStateOfType as Ht, DeleteChildDocumentSignal as I, PHDocumentHeader as Ia, SignalResults as Ii, MutationSetModuleDescriptionArgs as In, baseActions as Io, SchemaLoadStateAction as Ir, Operation as Is, ISignalResult as It, DeleteStateExampleInput as J, garbageCollectV2 as Ja, UndoRedoAction as Ji, MutationSetStateSchemaArgs as Jn, moveOperation as Jo, SetInitialStateInput as Jr, createBaseState as Js, Load_State as Jt, DeleteOperationInput as K, garbageCollect as Ka, UndoAction as Ki, MutationSetOperationSchemaArgs as Kn, documentModelActions as Ko, SetAuthorWebsiteInput as Kr, PHDocumentState as Ks, LoadStateActionInput as Kt, DeleteDocumentAction as L, PHDocumentMeta as La, SignalType as Li, MutationSetModuleNameArgs as Ln, buildOperationSignature as Lo, SchemaNOOPAction as Lr, OperationContext as Ls, ISigner as Lt, CreateState as M, TrackedProcessor as Ma, Set_Name as Mi, MutationSetModelDescriptionArgs as Mn, addOperation as Mo, RevisionsFilter as Mr, updateOperationExample as Ms, ID as Mt, DeleteChangeLogItemAction as N, IntegrityIssueSubType as Na, Signal as Ni, MutationSetModelExtensionArgs as Nn, addOperationError as No, SaveToFile as Nr, updateStateExample as Ns, IDocument as Nt, CreateChildDocumentSignal as O, ProcessorFactoryBuilder as Oa, SetOperationTemplateAction as Oi, MutationReorderStateExamplesArgs as On, actionSigner as Oo, ReorderOperationExamplesInput as Or, setOperationTemplate as Os, FileInput as Ot, DeleteChangeLogItemInput as P, IntegrityIssueType as Pa, SignalDispatch as Pi, MutationSetModelIdArgs as Pn, addOperationExample as Po, SaveToFileHandle as Pr, verifyOperationSignature as Ps, IOperation as Pt, DocumentModelDocument as Q, isDocumentAction as Qa, UpdateOperationExampleInput as Qi, MutationUpdateStateExampleArgs as Qn, operationFromOperation as Qo, SetModelExtensionInput as Qr, createState as Qs, Manifest as Qt, DeleteDocumentActionInput as R, addUndo as Ra, SignatureVerificationHandler as Ri, MutationSetNameArgs as Rn, buildSignedAction as Ro, SchemaPruneAction as Rr, OperationWithContext$1 as Rs, ImportScriptModule as Rt, AssertIsStateOfType as S, IProcessor as Sa, SetOperationReducerAction as Si, MutationRedoArgs as Sn, ActionWithAttachment as So, ReorderModuleOperationsInput as Sr, setOperationErrorName as Ss, DocumentSpecification as St, CopyChildDocumentInput as T, ProcessorApp as Ta, SetOperationSchemaInput as Ti, MutationReorderModulesArgs as Tn, AttachmentRef as To, ReorderOperationErrorsAction as Tr, setOperationReducer as Ts, EditorModule as Tt, DeleteOperationErrorInput as U, diffOperations as Ua, StateReducer as Ui, MutationSetOperationErrorTemplateArgs as Un, deleteOperationError as Uo, SetAuthorNameAction as Ur, undoOperationV2 as Us, LoadFromFile as Ut, DeleteOperationAction as V, checkCleanedOperationsIntegrity as Va, SkipHeaderOperations as Vi, MutationSetOperationErrorDescriptionArgs as Vn, deleteModule as Vo, SchemaUndoAction as Vr, setNameOperation as Vs, IsDocumentOfType as Vt, DeleteOperationExampleAction as W, filterDocumentOperationsResultingState as Wa, SubgraphModule as Wi, MutationSetOperationNameArgs as Wn, deleteOperationExample as Wo, SetAuthorNameInput as Wr, PHAuthState as Ws, LoadFromInput as Wt, DocumentFile as X, groupOperationsByScope as Xa, UpdateChangeLogItemInput as Xi, MutationUpdateChangeLogItemInputArgs as Xn, operationExampleCreators as Xo, SetModelDescriptionInput as Xr, createGlobalState as Xs, MakeMaybe as Xt, DocumentAction as Y, getDocumentLastModified as Ya, UpdateChangeLogItemAction as Yi, MutationUndoArgs as Yn, noop as Yo, SetModelDescriptionAction as Yr, createDocumentState as Ys, MakeEmpty as Yt, DocumentModelAction as Z, hashDocumentStateForScope as Za, UpdateOperationExampleAction as Zi, MutationUpdateOperationExampleArgs as Zn, operationFromAction as Zo, SetModelExtensionAction as Zr, createLocalState as Zs, MakeOptional as Zt, AddRelationshipActionInput as _, IRelationalDbProcessor as _a, SetOperationErrorNameInput as _i, MutationDeleteOperationExampleArgs as _n, sortOperations as _o, RemoveRelationshipAction as _r, setModuleName as _s, DocumentModelStateOperations as _t, Actions as a, UpgradeManifest as aa, ActionSigner as ac, SetModuleNameAction as ai, MoveOperationInput as an, nextSkipNumber as ao, PartialRecord as ar, reorderModules as as, DocumentModelLocalState as at, App as b, RelationalDbProcessor as ba, SetOperationNameAction as bi, MutationMoveOperationArgs as bn, Action as bo, ReorderChangeLogItemsInput as br, setOperationErrorCode as bs, DocumentModelVersioningOperations as bt, AddModuleAction as c, createNamespacedDb as ca, PHDocumentSignatureInfo as cc, SetNameActionInput as ci, MutationAddModuleArgs as cn, precedes as co, PruneAction as cr, reorderStateExamples as cs, DocumentModelModuleOperations as ct, AddOperationErrorAction as d, hashNamespace as da, DEFAULT_ANALYTICS_PROCESSOR_DB_NAME as dc, SetOperationDescriptionInput as di, MutationAddOperationExampleArgs as dn, removeExistingOperations as do, Redo as dr, setInitialState as ds, DocumentModelOperationErrorOperations as dt, UpdateStateExampleInput as ea, defaultBaseState as ec, SetModelIdInput as ei, Maybe as en, isUndo as eo, OperationErrorSpecification as er, prune as es, DocumentModelGlobalState as et, AddOperationErrorInput as f, relationalDbToQueryBuilder as fa, DEFAULT_RELATIONAL_PROCESSOR_DB_NAME as fc, SetOperationErrorCodeAction as fi, MutationAddStateExampleArgs as fn, replayDocument as fo, RedoAction as fr, setModelDescription as fs, DocumentModelOperationExampleAction as ft, AddRelationshipAction as g, IRelationalDb as ga, SetOperationErrorNameAction as gi, MutationDeleteOperationErrorArgs as gn, sortMappedOperations as go, ReleaseNewVersionAction as gr, setModuleDescription as gs, DocumentModelStateAction as gt, AddOperationInput as h, IBaseRelationalDb as ha, SetOperationErrorDescriptionInput as hi, MutationDeleteOperationArgs as hn, skipHeaderOperations as ho, ReducerOptions as hr, setModelName as hs, DocumentModelPHState as ht, ActionVerificationHandler as i, ValidationError as ia, defaultPHState as ic, SetModuleDescriptionInput as ii, MoveOperationAction as in, merge as io, PHStateReducer as ir, reorderModuleOperations as is, DocumentModelLib as it, CreateDocumentActionInput as j, ProcessorStatus as ja, SetStateSchemaInput as ji, MutationSetInitialStateArgs as jn, addModule as jo, ReplayDocumentOptions as jr, updateChangeLogItem as js, IAction as jt, CreateDocument as k, ProcessorFilter as ka, SetOperationTemplateInput as ki, MutationSetAuthorNameArgs as kn, actions as ko, ReorderStateExamplesAction as kr, setStateSchema as ks, FileRegistry as kt, AddModuleInput as l, createNamespacedQueryBuilder as la, Signature as lc, SetNameOperation as li, MutationAddOperationArgs as ln, prepareOperations as lo, PruneActionInput as lr, setAuthorName as ls, DocumentModelOperationAction as lt, AddOperationExampleInput as m, HashAlgorithms as ma, SetOperationErrorDescriptionAction as mi, MutationDeleteModuleArgs as mn, reshuffleByTimestampAndIndex as mo, Reducer as mr, setModelId as ms, DocumentModelOperationOperations as mt, ActionSignatureContext as n, UpgradeDocumentActionInput as na, defaultGlobalState as nc, SetModelNameInput as ni, MinimalBackupData as nn, mapSkippedOperations as no, OperationSpecification as nr, releaseNewVersion as ns, DocumentModelHeaderOperations as nt, AddChangeLogItemAction as o, UpgradeReducer as oa, AppActionSigner as oc, SetModuleNameInput as oi, Mutation as on, operationsAreEqual as oo, PartialState as or, reorderOperationErrors as os, DocumentModelModule as ot, AddOperationExampleAction as p, ExtractProcessorSchemaOrSelf as pa, PROCESSOR_APPS as pc, SetOperationErrorCodeInput as pi, MutationDeleteChangeLogItemInputArgs as pn, reshuffleByTimestamp as po, RedoActionInput as pr, setModelExtension as ps, DocumentModelOperationExampleOperations as pt, DeleteStateExampleAction as q, garbageCollectDocumentOperations as qa, UndoActionInput as qi, MutationSetOperationTemplateArgs as qn, loadState as qo, SetInitialStateAction as qr, createAuthState as qs, LoadStateActionStateInput as qt, ActionSigningHandler as r, User as ra, defaultLocalState as rc, SetModuleDescriptionAction as ri, ModuleSpecification as rn, mapSkippedOperationsV2 as ro, OperationsByScope as rr, reorderChangeLogItems as rs, DocumentModelInput as rt, AddChangeLogItemInput as s, UpgradeTransition as sa, HashConfig as sc, SetNameAction as si, MutationAddChangeLogItemInputArgs as sn, parseResultingState as so, Prune as sr, reorderOperationExamples as ss, DocumentModelModuleAction as st, ActionErrorCallback as t, UpgradeDocumentAction as ta, defaultDocumentState as tc, SetModelNameAction as ti, Meta as tn, isUndoRedo as to, OperationIndex as tr, redo as ts, DocumentModelHeaderAction as tt, AddOperationAction as u, createRelationalDb as ua, UserActionSigner as uc, SetOperationDescriptionAction as ui, MutationAddOperationErrorArgs as un, readOnly as uo, Query as ur, setAuthorWebsite as us, DocumentModelOperationErrorAction as ut, AddStateExampleAction as v, IRelationalQueryBuilder as va, SetOperationErrorTemplateAction as vi, MutationDeleteStateExampleArgs as vn, split as vo, RemoveRelationshipActionInput as vr, setName as vs, DocumentModelUtils as vt, CodeExample as w, IProcessorManager as wa, SetOperationSchemaAction as wi, MutationReorderModuleOperationsArgs as wn, AttachmentInput as wo, ReorderModulesInput as wr, setOperationName as ws, EditorDispatch as wt, AssertIsDocumentOfType as x, RelationalDbProcessorClass as xa, SetOperationNameInput as xi, MutationPruneArgs as xn, ActionContext as xo, ReorderModuleOperationsAction as xr, setOperationErrorDescription as xs, DocumentOperationsIgnoreMap as xt, AddStateExampleInput as y, IRelationalQueryMethods as ya, SetOperationErrorTemplateInput as yi, MutationLoadStateArgs as yn, updateHeaderRevision as yo, ReorderChangeLogItemsAction as yr, setOperationDescription as ys, DocumentModelVersioningAction as yt, DeleteModuleAction as z, attachBranch as za, SigningParameters as zi, MutationSetOperationDescriptionArgs as zn, createAction as zo, SchemaRedoAction as zr, loadStateOperation as zs, Incremental as zt };
|
|
2153
|
+
//# sourceMappingURL=types-faUXKACL.d.ts.map
|