@powerhousedao/shared 6.0.0-dev.109 → 6.0.0-dev.111
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/{types-faUXKACL.d.ts → actions-3-rhhWx6.d.ts} +1272 -1272
- package/dist/actions-3-rhhWx6.d.ts.map +1 -0
- package/dist/clis/index.d.mts +12 -25
- package/dist/clis/index.d.mts.map +1 -1
- package/dist/clis/index.mjs +2 -13
- package/dist/clis/index.mjs.map +1 -1
- package/dist/document-drive/index.d.ts +148 -148
- package/dist/document-drive/index.d.ts.map +1 -1
- package/dist/document-drive/index.js.map +1 -1
- package/dist/document-model/index.d.ts +2 -2
- package/dist/{index-dg_xL7sp.d.ts → index-BwKTUOh8.d.ts} +2 -2
- package/dist/{index-dg_xL7sp.d.ts.map → index-BwKTUOh8.d.ts.map} +1 -1
- package/dist/processors/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/types-faUXKACL.d.ts.map +0 -1
|
@@ -4,11 +4,6 @@ import { OperationWithContext } from "@powerhousedao/shared/document-model";
|
|
|
4
4
|
import { Kysely, QueryCreator } from "kysely";
|
|
5
5
|
import { FC, ReactNode } from "react";
|
|
6
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
7
|
//#region document-model/signatures.d.ts
|
|
13
8
|
/**
|
|
14
9
|
* A signature of an action.
|
|
@@ -58,906 +53,211 @@ type HashConfig = {
|
|
|
58
53
|
params?: Record<string, unknown>;
|
|
59
54
|
};
|
|
60
55
|
//#endregion
|
|
61
|
-
//#region
|
|
56
|
+
//#region processors/constants.d.ts
|
|
57
|
+
declare const PROCESSOR_APPS: readonly ["connect", "switchboard"];
|
|
58
|
+
declare const DEFAULT_RELATIONAL_PROCESSOR_DB_NAME = "relational-db";
|
|
59
|
+
declare const DEFAULT_ANALYTICS_PROCESSOR_DB_NAME = "analytics-db";
|
|
60
|
+
//#endregion
|
|
61
|
+
//#region processors/types.d.ts
|
|
62
|
+
interface IProcessorHostModule {
|
|
63
|
+
analyticsStore: IAnalyticsStore;
|
|
64
|
+
relationalDb: IRelationalDb;
|
|
65
|
+
processorApp: ProcessorApp;
|
|
66
|
+
config?: Map<string, unknown>;
|
|
67
|
+
}
|
|
62
68
|
/**
|
|
63
|
-
*
|
|
69
|
+
* Filter for matching operations to processors.
|
|
70
|
+
* All fields are optional arrays - when provided, operations must match at least one value in each specified field.
|
|
71
|
+
* When a field is undefined or empty, it matches all values for that field.
|
|
64
72
|
*/
|
|
65
|
-
|
|
73
|
+
type ProcessorFilter = {
|
|
74
|
+
documentType?: string[];
|
|
75
|
+
scope?: string[];
|
|
76
|
+
branch?: string[];
|
|
77
|
+
documentId?: string[];
|
|
78
|
+
};
|
|
66
79
|
/**
|
|
67
|
-
*
|
|
80
|
+
* Describes an object that can process operations.
|
|
68
81
|
*/
|
|
69
|
-
|
|
82
|
+
interface IProcessor {
|
|
83
|
+
/**
|
|
84
|
+
* Processes a list of operations with context.
|
|
85
|
+
* Called when operations match this processor's filter.
|
|
86
|
+
*/
|
|
87
|
+
onOperations(operations: OperationWithContext[]): Promise<void>;
|
|
88
|
+
/**
|
|
89
|
+
* Called when the processor is disconnected.
|
|
90
|
+
* Used to clean up any resources allocated during processor creation.
|
|
91
|
+
*/
|
|
92
|
+
onDisconnect(): Promise<void>;
|
|
93
|
+
}
|
|
70
94
|
/**
|
|
71
|
-
*
|
|
95
|
+
* Relates a processor to its filter configuration.
|
|
72
96
|
*/
|
|
73
|
-
|
|
97
|
+
type ProcessorRecord = {
|
|
98
|
+
processor: IProcessor;
|
|
99
|
+
filter: ProcessorFilter;
|
|
100
|
+
startFrom?: "beginning" | "current";
|
|
101
|
+
};
|
|
74
102
|
/**
|
|
75
|
-
*
|
|
103
|
+
* A factory function that creates processor records for a given drive.
|
|
104
|
+
* Called once per drive when the drive is first detected or when the factory is registered.
|
|
76
105
|
*/
|
|
77
|
-
|
|
106
|
+
type ProcessorFactory = (driveHeader: PHDocumentHeader, processorApp?: ProcessorApp) => ProcessorRecord[] | Promise<ProcessorRecord[]>;
|
|
107
|
+
/** Takes a processor host module and builds processor factories using its context */
|
|
108
|
+
type ProcessorFactoryBuilder = (module: IProcessorHostModule) => Promise<(driveHeader: PHDocumentHeader) => Promise<ProcessorRecord[]>>;
|
|
109
|
+
type ProcessorStatus = "active" | "errored";
|
|
110
|
+
type TrackedProcessor = {
|
|
111
|
+
processorId: string;
|
|
112
|
+
factoryId: string;
|
|
113
|
+
driveId: string;
|
|
114
|
+
processorIndex: number;
|
|
115
|
+
record: ProcessorRecord;
|
|
116
|
+
lastOrdinal: number;
|
|
117
|
+
status: ProcessorStatus;
|
|
118
|
+
lastError: string | undefined;
|
|
119
|
+
lastErrorTimestamp: Date | undefined;
|
|
120
|
+
retry: () => Promise<void>;
|
|
121
|
+
};
|
|
78
122
|
/**
|
|
79
|
-
*
|
|
123
|
+
* Manages processor creation and destruction based on drive operations.
|
|
80
124
|
*/
|
|
81
|
-
|
|
125
|
+
interface IProcessorManager {
|
|
126
|
+
/**
|
|
127
|
+
* Registers a processor factory.
|
|
128
|
+
* Immediately creates processors for all existing drives.
|
|
129
|
+
*/
|
|
130
|
+
registerFactory(identifier: string, factory: ProcessorFactory): Promise<void>;
|
|
131
|
+
/**
|
|
132
|
+
* Unregisters a processor factory and disconnects all processors it created.
|
|
133
|
+
*/
|
|
134
|
+
unregisterFactory(identifier: string): Promise<void>;
|
|
135
|
+
/**
|
|
136
|
+
* Gets a tracked processor by its ID.
|
|
137
|
+
*/
|
|
138
|
+
get(processorId: string): TrackedProcessor | undefined;
|
|
139
|
+
/**
|
|
140
|
+
* Gets all tracked processors.
|
|
141
|
+
*/
|
|
142
|
+
getAll(): TrackedProcessor[];
|
|
143
|
+
}
|
|
144
|
+
type ProcessorApp = (typeof PROCESSOR_APPS)[number];
|
|
145
|
+
type ProcessorApps = readonly ProcessorApp[];
|
|
146
|
+
//#endregion
|
|
147
|
+
//#region processors/relational/types.d.ts
|
|
148
|
+
type IRelationalQueryMethods = "selectFrom" | "selectNoFrom" | "with" | "withRecursive";
|
|
149
|
+
type IRelationalQueryBuilder<Schema = unknown> = Pick<QueryCreator<Schema>, IRelationalQueryMethods> & {
|
|
150
|
+
withSchema: (schema: string) => IRelationalQueryBuilder<Schema>;
|
|
151
|
+
};
|
|
152
|
+
type HashAlgorithms = "fnv1a";
|
|
153
|
+
type IBaseRelationalDb<Schema = unknown> = Kysely<Schema>;
|
|
82
154
|
/**
|
|
83
|
-
*
|
|
84
|
-
|
|
85
|
-
|
|
155
|
+
* The standardized relational database interface for relational db processors.
|
|
156
|
+
* This abstraction provides type-safe database operations while hiding the underlying
|
|
157
|
+
* database framework implementation details.
|
|
158
|
+
**/
|
|
159
|
+
type IRelationalDb<Schema = unknown> = IBaseRelationalDb<Schema> & {
|
|
160
|
+
createNamespace<NamespaceSchema>(namespace: string): Promise<IRelationalDb<ExtractProcessorSchemaOrSelf<NamespaceSchema>>>;
|
|
161
|
+
queryNamespace<NamespaceSchema>(namespace: string): IRelationalQueryBuilder<NamespaceSchema>;
|
|
162
|
+
};
|
|
163
|
+
type ExtractProcessorSchemaOrSelf<TProcessor> = TProcessor extends RelationalDbProcessor<infer TSchema> ? TSchema : TProcessor;
|
|
164
|
+
type RelationalDbProcessorClass<TSchema> = typeof RelationalDbProcessor<TSchema>;
|
|
165
|
+
interface IRelationalDbProcessor<TDatabaseSchema = unknown> extends IProcessor {
|
|
166
|
+
namespace: string;
|
|
167
|
+
query: IRelationalQueryBuilder<TDatabaseSchema>;
|
|
168
|
+
filter: ProcessorFilter;
|
|
169
|
+
initAndUpgrade(): Promise<void>;
|
|
170
|
+
}
|
|
171
|
+
declare const IS_RELATIONAL_DB_PROCESSOR: unique symbol;
|
|
86
172
|
/**
|
|
87
|
-
*
|
|
173
|
+
* Base class for relational db processors that require a relational database storage.
|
|
174
|
+
* This class abstracts database initialization, migration management, and resource cleanup,
|
|
175
|
+
* allowing derived classes to focus on business logic.
|
|
88
176
|
*/
|
|
89
|
-
|
|
177
|
+
declare abstract class RelationalDbProcessor<TDatabaseSchema = unknown> implements IRelationalDbProcessor<TDatabaseSchema> {
|
|
178
|
+
protected _namespace: string;
|
|
179
|
+
protected _filter: ProcessorFilter;
|
|
180
|
+
protected relationalDb: IRelationalDb<TDatabaseSchema>;
|
|
181
|
+
constructor(_namespace: string, _filter: ProcessorFilter, relationalDb: IRelationalDb<TDatabaseSchema>);
|
|
182
|
+
static [IS_RELATIONAL_DB_PROCESSOR]: boolean;
|
|
90
183
|
/**
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
* version to use for reducer execution.
|
|
184
|
+
* Returns the namespace for a given drive id.
|
|
185
|
+
* This method can be overridden by derived classes to provide a custom namespace.
|
|
94
186
|
*/
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
187
|
+
static getNamespace(driveId: string): string;
|
|
188
|
+
static query<Schema>(this: RelationalDbProcessorClass<Schema>, driveId: string, db: IRelationalDb<any>): IRelationalQueryBuilder<Schema>;
|
|
189
|
+
/**
|
|
190
|
+
* Processes a list of operations with context.
|
|
191
|
+
* Called when operations match this processor's filter.
|
|
192
|
+
*/
|
|
193
|
+
abstract onOperations(operations: OperationWithContext[]): Promise<void>;
|
|
194
|
+
/**
|
|
195
|
+
* Returns the filter for the processor.
|
|
196
|
+
* This method can be overridden by derived classes to provide a custom filter.
|
|
197
|
+
*/
|
|
198
|
+
get filter(): ProcessorFilter;
|
|
199
|
+
/**
|
|
200
|
+
* Returns the namespace used by the processor.
|
|
201
|
+
*/
|
|
202
|
+
get namespace(): string;
|
|
203
|
+
get query(): IRelationalQueryBuilder<TDatabaseSchema>;
|
|
204
|
+
/**
|
|
205
|
+
* Abstract method that derived classes must implement.
|
|
206
|
+
* This method is meant to be called on subclasses to initialize and upgrade the database.
|
|
207
|
+
*/
|
|
208
|
+
abstract initAndUpgrade(): Promise<void>;
|
|
209
|
+
/**
|
|
210
|
+
* Called when the processor is disconnected.
|
|
211
|
+
* This method is meant to be overridden by subclasses to clean up resources.
|
|
212
|
+
*/
|
|
213
|
+
abstract onDisconnect(): Promise<void>;
|
|
214
|
+
}
|
|
215
|
+
//#endregion
|
|
216
|
+
//#region processors/relational/utils.d.ts
|
|
102
217
|
/**
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
218
|
+
* Hashes a string to a lowercase base-26 string.
|
|
219
|
+
* @param str The string to hash.
|
|
220
|
+
* @param length The length of the hash. Defaults to 10.
|
|
221
|
+
* @param algorithm The hashing algorithm to use. Defaults to "fnv1a".
|
|
222
|
+
* @returns The hashed string.
|
|
106
223
|
*/
|
|
107
|
-
|
|
224
|
+
declare function hashNamespace(str: string, length?: number): string;
|
|
108
225
|
/**
|
|
109
|
-
*
|
|
226
|
+
* Creates a RelationalDb instance with namespace support.
|
|
227
|
+
* @param baseDb The base RelationalDb instance to enhance.
|
|
228
|
+
* @param baseOptions The default options for namespace creation. Hashes namespace by default.
|
|
229
|
+
* @returns The enhanced RelationalDb instance.
|
|
110
230
|
*/
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
231
|
+
declare function createRelationalDb<Schema>(baseDb: IBaseRelationalDb<Schema>, baseOptions?: NamespaceOptions): IRelationalDb<Schema>;
|
|
232
|
+
type NamespaceOptions = {
|
|
233
|
+
hashNamespace?: boolean;
|
|
114
234
|
};
|
|
115
|
-
declare function
|
|
116
|
-
declare function
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
235
|
+
declare function createNamespacedDb<Schema>(db: IBaseRelationalDb<any>, namespace: string, options?: NamespaceOptions): Promise<IRelationalDb<Schema>>;
|
|
236
|
+
declare function createNamespacedQueryBuilder<Schema>(db: IBaseRelationalDb<any>, namespace: string, options?: NamespaceOptions): IRelationalQueryBuilder<Schema>;
|
|
237
|
+
/**
|
|
238
|
+
* Returns a query builder for a RelationalDb instance.
|
|
239
|
+
* @param query The RelationalDb instance to convert.
|
|
240
|
+
* @returns The IRelationalQueryBuilder instance.
|
|
241
|
+
*/
|
|
242
|
+
declare function relationalDbToQueryBuilder<TSchema>(query: IBaseRelationalDb<TSchema>): IRelationalQueryBuilder<TSchema>;
|
|
121
243
|
//#endregion
|
|
122
|
-
//#region document-model/
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
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
|
-
};
|
|
244
|
+
//#region document-model/upgrades.d.ts
|
|
245
|
+
/** Upgrade reducer transforms a document from one version to another */
|
|
246
|
+
type UpgradeReducer<TFrom extends PHBaseState, TTo extends PHBaseState> = (document: PHDocument<TFrom>, action: Action) => PHDocument<TTo>;
|
|
247
|
+
type ModelVersion = number;
|
|
248
|
+
/** Metadata about a version transition */
|
|
249
|
+
type UpgradeTransition = {
|
|
250
|
+
toVersion: ModelVersion;
|
|
251
|
+
upgradeReducer: UpgradeReducer<any, any>;
|
|
252
|
+
description?: string;
|
|
143
253
|
};
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
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 };
|
|
254
|
+
type TupleMember<T extends readonly unknown[]> = T[number];
|
|
255
|
+
/** Manifest declaring all supported versions and upgrade paths */
|
|
256
|
+
type UpgradeManifest<TVersions extends readonly number[]> = {
|
|
257
|
+
documentType: string;
|
|
258
|
+
latestVersion: TupleMember<TVersions>;
|
|
259
|
+
supportedVersions: TVersions;
|
|
260
|
+
upgrades: { [V in Exclude<TupleMember<TVersions>, 1> as `v${V}`]: UpgradeTransition };
|
|
961
261
|
};
|
|
962
262
|
//#endregion
|
|
963
263
|
//#region document-model/types.d.ts
|
|
@@ -1685,469 +985,1169 @@ type SchemaLoadStateAction = {
|
|
|
1685
985
|
type: Load_State;
|
|
1686
986
|
scope: string;
|
|
1687
987
|
};
|
|
1688
|
-
type LoadStateActionInput = {
|
|
1689
|
-
operations: Scalars["Int"]["input"];
|
|
1690
|
-
state: LoadStateActionStateInput;
|
|
988
|
+
type LoadStateActionInput = {
|
|
989
|
+
operations: Scalars["Int"]["input"];
|
|
990
|
+
state: LoadStateActionStateInput;
|
|
991
|
+
};
|
|
992
|
+
type LoadStateActionStateInput = {
|
|
993
|
+
data?: InputMaybe<Scalars["Unknown"]["input"]>;
|
|
994
|
+
name: Scalars["String"]["input"];
|
|
995
|
+
};
|
|
996
|
+
type MutationLoadStateArgs = {
|
|
997
|
+
input: SchemaLoadStateAction;
|
|
998
|
+
};
|
|
999
|
+
type MutationPruneArgs = {
|
|
1000
|
+
input: SchemaPruneAction;
|
|
1001
|
+
};
|
|
1002
|
+
type MutationRedoArgs = {
|
|
1003
|
+
input: SchemaRedoAction;
|
|
1004
|
+
};
|
|
1005
|
+
type MutationSetNameArgs = {
|
|
1006
|
+
input: SchemaSetNameAction;
|
|
1007
|
+
};
|
|
1008
|
+
type MutationUndoArgs = {
|
|
1009
|
+
input: SchemaUndoAction;
|
|
1010
|
+
};
|
|
1011
|
+
type Prune = "PRUNE";
|
|
1012
|
+
type SchemaPruneAction = {
|
|
1013
|
+
id: Scalars["String"]["output"];
|
|
1014
|
+
timestampUtcMs: Scalars["DateTime"]["output"];
|
|
1015
|
+
input: PruneActionInput;
|
|
1016
|
+
type: Prune;
|
|
1017
|
+
scope: string;
|
|
1018
|
+
};
|
|
1019
|
+
type PruneActionInput = {
|
|
1020
|
+
end?: InputMaybe<Scalars["Int"]["input"]>;
|
|
1021
|
+
start?: InputMaybe<Scalars["Int"]["input"]>;
|
|
1022
|
+
};
|
|
1023
|
+
type Query = {
|
|
1024
|
+
__typename?: "Query";
|
|
1025
|
+
document: Maybe<IDocument>;
|
|
1026
|
+
};
|
|
1027
|
+
type Redo = "REDO";
|
|
1028
|
+
type RedoActionInput = {
|
|
1029
|
+
count: Scalars["Int"]["input"];
|
|
1030
|
+
};
|
|
1031
|
+
type SchemaRedoAction = {
|
|
1032
|
+
id: Scalars["String"]["output"];
|
|
1033
|
+
timestampUtcMs: Scalars["DateTime"]["output"];
|
|
1034
|
+
input: RedoActionInput;
|
|
1035
|
+
type: Redo;
|
|
1036
|
+
scope: string;
|
|
1037
|
+
};
|
|
1038
|
+
type Set_Name = "SET_NAME";
|
|
1039
|
+
type SetNameActionInput = {
|
|
1040
|
+
name: Scalars["String"]["input"];
|
|
1041
|
+
};
|
|
1042
|
+
type SchemaSetNameAction = {
|
|
1043
|
+
id: Scalars["String"]["output"];
|
|
1044
|
+
timestampUtcMs: Scalars["DateTime"]["output"];
|
|
1045
|
+
input: SetNameActionInput;
|
|
1046
|
+
type: Set_Name;
|
|
1047
|
+
scope: "global";
|
|
1048
|
+
};
|
|
1049
|
+
type SetNameOperation = IOperation & {
|
|
1050
|
+
__typename?: "SetNameOperation";
|
|
1051
|
+
hash: Scalars["String"]["output"];
|
|
1052
|
+
index: Scalars["Int"]["output"];
|
|
1053
|
+
input: Scalars["String"]["output"];
|
|
1054
|
+
timestamp: Scalars["DateTime"]["output"];
|
|
1055
|
+
type: Scalars["String"]["output"];
|
|
1056
|
+
};
|
|
1057
|
+
type Undo = "UNDO";
|
|
1058
|
+
type UndoActionInput = {
|
|
1059
|
+
count: Scalars["Int"]["input"];
|
|
1060
|
+
};
|
|
1061
|
+
type SchemaUndoAction = {
|
|
1062
|
+
id: Scalars["String"]["output"];
|
|
1063
|
+
timestampUtcMs: Scalars["DateTime"]["output"];
|
|
1064
|
+
input: UndoActionInput;
|
|
1065
|
+
type: Undo;
|
|
1066
|
+
scope: string;
|
|
1067
|
+
};
|
|
1068
|
+
type SchemaNOOPAction = {
|
|
1069
|
+
id: Scalars["String"]["output"];
|
|
1070
|
+
input: Scalars["Unknown"]["input"];
|
|
1071
|
+
scope: string;
|
|
1072
|
+
timestampUtcMs: Scalars["DateTime"]["output"];
|
|
1073
|
+
type: "NOOP";
|
|
1074
|
+
};
|
|
1075
|
+
type LoadStateAction = Action & {
|
|
1076
|
+
type: "LOAD_STATE";
|
|
1077
|
+
input: LoadStateActionInput;
|
|
1078
|
+
};
|
|
1079
|
+
type PruneAction = Action & {
|
|
1080
|
+
type: "PRUNE";
|
|
1081
|
+
input: PruneActionInput;
|
|
1082
|
+
};
|
|
1083
|
+
type RedoAction = Action & {
|
|
1084
|
+
type: "REDO";
|
|
1085
|
+
input: SchemaRedoAction["input"];
|
|
1086
|
+
};
|
|
1087
|
+
type SetNameAction = Action & {
|
|
1088
|
+
type: "SET_NAME";
|
|
1089
|
+
input: SchemaSetNameAction["input"];
|
|
1090
|
+
};
|
|
1091
|
+
type UndoAction = Action & {
|
|
1092
|
+
type: "UNDO";
|
|
1093
|
+
input: SchemaUndoAction["input"];
|
|
1094
|
+
};
|
|
1095
|
+
type NOOPAction = Action & {
|
|
1096
|
+
type: "NOOP";
|
|
1097
|
+
input: SchemaNOOPAction["input"];
|
|
1098
|
+
};
|
|
1099
|
+
type CreateDocumentActionInput = {
|
|
1100
|
+
model: string;
|
|
1101
|
+
version: 0;
|
|
1102
|
+
documentId: string;
|
|
1103
|
+
signing?: {
|
|
1104
|
+
signature: string;
|
|
1105
|
+
publicKey: JsonWebKey;
|
|
1106
|
+
nonce: string;
|
|
1107
|
+
createdAtUtcIso: string;
|
|
1108
|
+
documentType: string;
|
|
1109
|
+
};
|
|
1110
|
+
slug?: string;
|
|
1111
|
+
name?: string;
|
|
1112
|
+
branch?: string;
|
|
1113
|
+
meta?: Record<string, unknown>;
|
|
1114
|
+
protocolVersions?: {
|
|
1115
|
+
[key: string]: number;
|
|
1116
|
+
};
|
|
1117
|
+
};
|
|
1118
|
+
type UpgradeDocumentActionInput = {
|
|
1119
|
+
model: string;
|
|
1120
|
+
fromVersion: number;
|
|
1121
|
+
toVersion: number;
|
|
1122
|
+
documentId: string;
|
|
1123
|
+
initialState?: object;
|
|
1124
|
+
};
|
|
1125
|
+
type DeleteDocumentActionInput = {
|
|
1126
|
+
documentId: string;
|
|
1127
|
+
propagate?: "none" | "cascade";
|
|
1128
|
+
};
|
|
1129
|
+
type AddRelationshipActionInput = {
|
|
1130
|
+
sourceId: string;
|
|
1131
|
+
targetId: string;
|
|
1132
|
+
relationshipType: string;
|
|
1133
|
+
metadata?: Record<string, unknown>;
|
|
1134
|
+
};
|
|
1135
|
+
type RemoveRelationshipActionInput = {
|
|
1136
|
+
sourceId: string;
|
|
1137
|
+
targetId: string;
|
|
1138
|
+
relationshipType: string;
|
|
1139
|
+
};
|
|
1140
|
+
type CreateDocumentAction = Action & {
|
|
1141
|
+
type: "CREATE_DOCUMENT";
|
|
1142
|
+
input: CreateDocumentActionInput;
|
|
1143
|
+
};
|
|
1144
|
+
type UpgradeDocumentAction = Action & {
|
|
1145
|
+
type: "UPGRADE_DOCUMENT";
|
|
1146
|
+
input: UpgradeDocumentActionInput;
|
|
1147
|
+
};
|
|
1148
|
+
type DeleteDocumentAction = Action & {
|
|
1149
|
+
type: "DELETE_DOCUMENT";
|
|
1150
|
+
input: DeleteDocumentActionInput;
|
|
1151
|
+
};
|
|
1152
|
+
type AddRelationshipAction = Action & {
|
|
1153
|
+
type: "ADD_RELATIONSHIP";
|
|
1154
|
+
input: AddRelationshipActionInput;
|
|
1155
|
+
};
|
|
1156
|
+
type RemoveRelationshipAction = Action & {
|
|
1157
|
+
type: "REMOVE_RELATIONSHIP";
|
|
1158
|
+
input: RemoveRelationshipActionInput;
|
|
1159
|
+
};
|
|
1160
|
+
type DocumentAction = LoadStateAction | PruneAction | RedoAction | SetNameAction | UndoAction | NOOPAction;
|
|
1161
|
+
interface ISignal<TType extends string, TInput> {
|
|
1162
|
+
type: TType;
|
|
1163
|
+
input: TInput;
|
|
1164
|
+
}
|
|
1165
|
+
type ISignalResult<TTYpe, TInput, TResult> = {
|
|
1166
|
+
signal: {
|
|
1167
|
+
type: TTYpe;
|
|
1168
|
+
input: TInput;
|
|
1169
|
+
};
|
|
1170
|
+
result: TResult;
|
|
1171
|
+
};
|
|
1172
|
+
type CreateChildDocumentInput = {
|
|
1173
|
+
id: string;
|
|
1174
|
+
documentType: string;
|
|
1175
|
+
};
|
|
1176
|
+
type CreateChildDocumentSignal = ISignal<"CREATE_CHILD_DOCUMENT", CreateChildDocumentInput>;
|
|
1177
|
+
type DeleteChildDocumentInput = {
|
|
1178
|
+
id: string;
|
|
1179
|
+
};
|
|
1180
|
+
type DeleteChildDocumentSignal = ISignal<"DELETE_CHILD_DOCUMENT", DeleteChildDocumentInput>;
|
|
1181
|
+
type CopyChildDocumentInput = {
|
|
1182
|
+
id: string;
|
|
1183
|
+
newId: string;
|
|
1184
|
+
};
|
|
1185
|
+
type CopyChildDocumentSignal = ISignal<"COPY_CHILD_DOCUMENT", CopyChildDocumentInput>;
|
|
1186
|
+
type Signal = CreateChildDocumentSignal | CopyChildDocumentSignal | DeleteChildDocumentSignal;
|
|
1187
|
+
type SignalDispatch = (signal: Signal) => void;
|
|
1188
|
+
type SignalResult = ISignalResult<CreateChildDocumentSignal["type"], CreateChildDocumentSignal["input"], PHDocument> | ISignalResult<CopyChildDocumentSignal["type"], CopyChildDocumentSignal["input"], boolean> | ISignalResult<DeleteChildDocumentSignal["type"], DeleteChildDocumentSignal["input"], PHDocument>;
|
|
1189
|
+
type SignalResults = {
|
|
1190
|
+
CREATE_CHILD_DOCUMENT: PHDocument;
|
|
1191
|
+
COPY_CHILD_DOCUMENT: PHDocument;
|
|
1192
|
+
DELETE_CHILD_DOCUMENT: boolean;
|
|
1691
1193
|
};
|
|
1692
|
-
type
|
|
1693
|
-
|
|
1694
|
-
|
|
1194
|
+
type SignalType<T extends Signal> = T["type"];
|
|
1195
|
+
type FileInput = string | number[] | Uint8Array | ArrayBuffer | Blob;
|
|
1196
|
+
type ReducerOptions = {
|
|
1197
|
+
/** 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 */
|
|
1198
|
+
ignoreSkipOperations?: boolean; /** if true reuses the provided action resulting state instead of replaying it */
|
|
1199
|
+
reuseOperationResultingState?: boolean; /** if true checks the hashes of the operations */
|
|
1200
|
+
checkHashes?: boolean; /** Options for performing a replay. */
|
|
1201
|
+
replayOptions?: {
|
|
1202
|
+
/** The previously created operation to verify against. */operation: Operation;
|
|
1203
|
+
}; /** Optional parser for the operation resulting state, uses JSON.parse by default */
|
|
1204
|
+
operationResultingStateParser?: <TState>(state: string | null | undefined) => TState;
|
|
1205
|
+
/**
|
|
1206
|
+
* When true (default), the reducer will prune operations (garbage collect) when processing a skip.
|
|
1207
|
+
* When false, it will recompute state for the skip but preserve the existing operations history.
|
|
1208
|
+
*/
|
|
1209
|
+
pruneOnSkip?: boolean; /** The branch being operated on. Defaults to "main". */
|
|
1210
|
+
branch?: string;
|
|
1211
|
+
/**
|
|
1212
|
+
* Protocol version controlling undo/redo behavior.
|
|
1213
|
+
* - Version 1 (default): Legacy behavior with index reuse
|
|
1214
|
+
* - Version 2: Reactor behavior with monotonic indices
|
|
1215
|
+
*/
|
|
1216
|
+
protocolVersion?: number;
|
|
1217
|
+
/**
|
|
1218
|
+
* When true, skip index contiguity validation during replay.
|
|
1219
|
+
* Used for V2 state rebuild where gapped indices are expected.
|
|
1220
|
+
*/
|
|
1221
|
+
skipIndexValidation?: boolean;
|
|
1695
1222
|
};
|
|
1696
|
-
|
|
1697
|
-
|
|
1223
|
+
/**
|
|
1224
|
+
* A pure function that takes an action and the previous state
|
|
1225
|
+
* of the document and returns the new state.
|
|
1226
|
+
*/
|
|
1227
|
+
type Reducer<TState extends PHBaseState = PHBaseState> = (document: PHDocument<TState>, action: Action, dispatch?: SignalDispatch, options?: ReducerOptions) => PHDocument<TState>;
|
|
1228
|
+
type StateReducer<TState extends PHBaseState = PHBaseState> = (state: Draft<TState>, action: Action, dispatch?: SignalDispatch) => TState | undefined;
|
|
1229
|
+
type PHStateReducer<TState extends PHBaseState = PHBaseState> = StateReducer<TState>;
|
|
1230
|
+
type Meta = {
|
|
1231
|
+
preferredEditor?: string;
|
|
1698
1232
|
};
|
|
1699
|
-
|
|
1700
|
-
|
|
1233
|
+
/**
|
|
1234
|
+
* Object that indexes attachments of a Document.
|
|
1235
|
+
*
|
|
1236
|
+
* @remarks
|
|
1237
|
+
* This is used to reduce memory usage to avoid
|
|
1238
|
+
* multiple instances of the binary data of the attachments.
|
|
1239
|
+
*
|
|
1240
|
+
*/
|
|
1241
|
+
type FileRegistry = Record<AttachmentRef, Attachment>;
|
|
1242
|
+
type MappedOperation = {
|
|
1243
|
+
ignore: boolean;
|
|
1244
|
+
operation: Operation;
|
|
1701
1245
|
};
|
|
1702
|
-
type
|
|
1703
|
-
|
|
1246
|
+
type DocumentOperationsIgnoreMap = Record<string, MappedOperation[]>;
|
|
1247
|
+
type ActionSignatureContext = {
|
|
1248
|
+
documentId: string;
|
|
1249
|
+
signer: ActionSigner;
|
|
1250
|
+
action: Action;
|
|
1251
|
+
previousStateHash: string;
|
|
1704
1252
|
};
|
|
1705
|
-
type
|
|
1706
|
-
|
|
1253
|
+
type ActionSigningHandler = (message: Uint8Array) => Promise<Uint8Array>;
|
|
1254
|
+
type ActionVerificationHandler = (publicKey: string, signature: Uint8Array, data: Uint8Array) => Promise<boolean>;
|
|
1255
|
+
/**
|
|
1256
|
+
* Handler for verifying operation signatures.
|
|
1257
|
+
*
|
|
1258
|
+
* @param operation - The operation to verify
|
|
1259
|
+
* @param publicKey - The public key to verify against (from signer.app.key)
|
|
1260
|
+
* @returns Promise that resolves to true if signature is valid, false otherwise
|
|
1261
|
+
*/
|
|
1262
|
+
type SignatureVerificationHandler = (operation: Operation, publicKey: string) => Promise<boolean>;
|
|
1263
|
+
type ENSInfo = {
|
|
1264
|
+
name?: string;
|
|
1265
|
+
avatarUrl?: string;
|
|
1707
1266
|
};
|
|
1708
|
-
type
|
|
1709
|
-
|
|
1267
|
+
type User = {
|
|
1268
|
+
address: `0x${string}`;
|
|
1269
|
+
networkId: string;
|
|
1270
|
+
chainId: number;
|
|
1271
|
+
ens?: ENSInfo;
|
|
1710
1272
|
};
|
|
1711
|
-
type
|
|
1712
|
-
type
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
type: Prune;
|
|
1717
|
-
scope: string;
|
|
1273
|
+
type PartialRecord<K extends keyof any, T> = { [P in K]?: T };
|
|
1274
|
+
type RevisionsFilter = PartialRecord<string, number>;
|
|
1275
|
+
type GetDocumentOptions = ReducerOptions & {
|
|
1276
|
+
revisions?: RevisionsFilter;
|
|
1277
|
+
checkHashes?: boolean;
|
|
1718
1278
|
};
|
|
1719
|
-
type
|
|
1720
|
-
|
|
1721
|
-
|
|
1279
|
+
type ActionErrorCallback = (error: unknown) => void;
|
|
1280
|
+
type EditorDispatch = (action: Action, onErrorCallback?: ActionErrorCallback) => void;
|
|
1281
|
+
type EditorProps = {
|
|
1282
|
+
children?: ReactNode;
|
|
1283
|
+
className?: string;
|
|
1284
|
+
document?: PHDocument;
|
|
1722
1285
|
};
|
|
1723
|
-
type
|
|
1724
|
-
|
|
1725
|
-
|
|
1286
|
+
type SubgraphModule = {
|
|
1287
|
+
id: string;
|
|
1288
|
+
name: string;
|
|
1289
|
+
gql: string;
|
|
1290
|
+
endpoint: string;
|
|
1726
1291
|
};
|
|
1727
|
-
type
|
|
1728
|
-
|
|
1729
|
-
|
|
1292
|
+
type ImportScriptModule = {
|
|
1293
|
+
id: string;
|
|
1294
|
+
name: string;
|
|
1295
|
+
gql: string;
|
|
1296
|
+
endpoint: string;
|
|
1730
1297
|
};
|
|
1731
|
-
type
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1298
|
+
type EditorModule<TProps = any> = {
|
|
1299
|
+
Component: FC<EditorProps & TProps>;
|
|
1300
|
+
documentTypes: string[];
|
|
1301
|
+
config: {
|
|
1302
|
+
id: string;
|
|
1303
|
+
name: string;
|
|
1304
|
+
};
|
|
1737
1305
|
};
|
|
1738
|
-
type
|
|
1739
|
-
|
|
1740
|
-
name:
|
|
1306
|
+
type App = {
|
|
1307
|
+
id: string;
|
|
1308
|
+
name: string;
|
|
1309
|
+
driveEditor?: string;
|
|
1741
1310
|
};
|
|
1742
|
-
type
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1311
|
+
type Manifest = {
|
|
1312
|
+
name: string;
|
|
1313
|
+
description: string;
|
|
1314
|
+
category: string;
|
|
1315
|
+
publisher: {
|
|
1316
|
+
name: string;
|
|
1317
|
+
url: string;
|
|
1318
|
+
};
|
|
1319
|
+
documentModels?: {
|
|
1320
|
+
id: string;
|
|
1321
|
+
name: string;
|
|
1322
|
+
}[];
|
|
1323
|
+
editors?: {
|
|
1324
|
+
id: string;
|
|
1325
|
+
name: string;
|
|
1326
|
+
documentTypes: string[];
|
|
1327
|
+
}[];
|
|
1328
|
+
processors?: {
|
|
1329
|
+
id: string;
|
|
1330
|
+
name: string;
|
|
1331
|
+
}[];
|
|
1332
|
+
subgraphs?: {
|
|
1333
|
+
id: string;
|
|
1334
|
+
name: string;
|
|
1335
|
+
}[];
|
|
1336
|
+
importScripts?: {
|
|
1337
|
+
id: string;
|
|
1338
|
+
name: string;
|
|
1339
|
+
documentTypes: string[];
|
|
1340
|
+
}[];
|
|
1341
|
+
apps?: App[];
|
|
1748
1342
|
};
|
|
1749
|
-
type
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
index: Scalars["Int"]["output"];
|
|
1753
|
-
input: Scalars["String"]["output"];
|
|
1754
|
-
timestamp: Scalars["DateTime"]["output"];
|
|
1755
|
-
type: Scalars["String"]["output"];
|
|
1343
|
+
type ValidationError = {
|
|
1344
|
+
message: string;
|
|
1345
|
+
details: object;
|
|
1756
1346
|
};
|
|
1757
|
-
type
|
|
1758
|
-
type
|
|
1759
|
-
|
|
1347
|
+
type SkipHeaderOperations = Partial<Record<string, number>>;
|
|
1348
|
+
type ReplayDocumentOptions = {
|
|
1349
|
+
checkHashes?: boolean;
|
|
1350
|
+
reuseOperationResultingState?: boolean;
|
|
1351
|
+
operationResultingStateParser?: <TState>(state: string) => TState;
|
|
1352
|
+
skipIndexValidation?: boolean;
|
|
1760
1353
|
};
|
|
1761
|
-
type
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
scope: string;
|
|
1354
|
+
type OperationIndex = {
|
|
1355
|
+
index: number;
|
|
1356
|
+
skip: number;
|
|
1357
|
+
id?: string;
|
|
1358
|
+
timestampUtcMs?: string;
|
|
1767
1359
|
};
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1360
|
+
/**
|
|
1361
|
+
* Parameters used in a document signature.
|
|
1362
|
+
*/
|
|
1363
|
+
type SigningParameters = {
|
|
1364
|
+
documentType: string;
|
|
1365
|
+
createdAtUtcIso: string;
|
|
1366
|
+
/**
|
|
1367
|
+
* The nonce can act as both a salt and a typical nonce.
|
|
1368
|
+
*/
|
|
1369
|
+
nonce: string;
|
|
1774
1370
|
};
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1371
|
+
/**
|
|
1372
|
+
* Describes a signer that can sign both document headers and actions.
|
|
1373
|
+
*/
|
|
1374
|
+
interface ISigner {
|
|
1375
|
+
/** The user associated with the signer */
|
|
1376
|
+
user?: UserActionSigner;
|
|
1377
|
+
/** The app associated with the signer */
|
|
1378
|
+
app?: AppActionSigner;
|
|
1379
|
+
/** The corresponding public key */
|
|
1380
|
+
publicKey: CryptoKey;
|
|
1381
|
+
/**
|
|
1382
|
+
* Signs raw data (used for document header signing).
|
|
1383
|
+
*
|
|
1384
|
+
* @param data - The data to sign.
|
|
1385
|
+
* @returns The signature of the data.
|
|
1386
|
+
*/
|
|
1387
|
+
sign: (data: Uint8Array) => Promise<Uint8Array>;
|
|
1388
|
+
/**
|
|
1389
|
+
* Verifies a signature.
|
|
1390
|
+
*
|
|
1391
|
+
* @param data - The data to verify.
|
|
1392
|
+
* @param signature - The signature to verify.
|
|
1393
|
+
*/
|
|
1394
|
+
verify: (data: Uint8Array, signature: Uint8Array) => Promise<void>;
|
|
1395
|
+
/**
|
|
1396
|
+
* Signs an action (used for operation signing).
|
|
1397
|
+
*
|
|
1398
|
+
* @param action - The action to sign.
|
|
1399
|
+
* @param abortSignal - Optional abort signal to cancel the signing.
|
|
1400
|
+
* @returns The signature tuple.
|
|
1401
|
+
*/
|
|
1402
|
+
signAction: (action: Action, abortSignal?: AbortSignal) => Promise<Signature>;
|
|
1403
|
+
}
|
|
1404
|
+
type IsStateOfType<TState> = (state: unknown) => state is TState;
|
|
1405
|
+
type AssertIsStateOfType<TState> = (state: unknown) => asserts state is TState;
|
|
1406
|
+
type IsDocumentOfType<TState extends PHBaseState> = (document: unknown) => document is PHDocument<TState>;
|
|
1407
|
+
type AssertIsDocumentOfType<TState extends PHBaseState> = (document: unknown) => asserts document is PHDocument<TState>;
|
|
1408
|
+
type PartialState<TState> = TState | Partial<TState>;
|
|
1409
|
+
type CreateState<TState extends PHBaseState = PHBaseState> = (state?: PartialState<TState>) => TState;
|
|
1410
|
+
type SaveToFileHandle = (document: PHDocument, input: FileSystemFileHandle) => void | Promise<void>;
|
|
1411
|
+
type SaveToFile = (document: PHDocument, path: string, name?: string) => string | Promise<string>;
|
|
1412
|
+
type LoadFromInput<TState extends PHBaseState = PHBaseState> = (input: FileInput) => PHDocument<TState> | Promise<PHDocument<TState>>;
|
|
1413
|
+
type LoadFromFile<TState extends PHBaseState = PHBaseState> = (path: string) => PHDocument<TState> | Promise<PHDocument<TState>>;
|
|
1414
|
+
type CreateDocument<TState extends PHBaseState = PHBaseState> = (initialState?: Partial<TState>, createState?: CreateState<TState>) => PHDocument<TState>;
|
|
1415
|
+
type MinimalBackupData = {
|
|
1416
|
+
documentId: string;
|
|
1417
|
+
documentType: string;
|
|
1418
|
+
branch: string;
|
|
1419
|
+
state: PHBaseState;
|
|
1420
|
+
name: string;
|
|
1778
1421
|
};
|
|
1779
|
-
type
|
|
1780
|
-
|
|
1781
|
-
|
|
1422
|
+
type DocumentModelUtils<TState extends PHBaseState = PHBaseState> = {
|
|
1423
|
+
fileExtension: string;
|
|
1424
|
+
createState: CreateState<TState>;
|
|
1425
|
+
createDocument: CreateDocument<TState>;
|
|
1426
|
+
loadFromInput: LoadFromInput<TState>;
|
|
1427
|
+
saveToFileHandle: SaveToFileHandle;
|
|
1428
|
+
isStateOfType: IsStateOfType<TState>;
|
|
1429
|
+
assertIsStateOfType: AssertIsStateOfType<TState>;
|
|
1430
|
+
isDocumentOfType: IsDocumentOfType<TState>;
|
|
1431
|
+
assertIsDocumentOfType: AssertIsDocumentOfType<TState>;
|
|
1782
1432
|
};
|
|
1783
|
-
type
|
|
1784
|
-
|
|
1785
|
-
|
|
1433
|
+
type Actions = Record<string, (...args: any[]) => Action>;
|
|
1434
|
+
type DocumentModelModule<TState extends PHBaseState = PHBaseState> = {
|
|
1435
|
+
/** optional version field, should be made required */version?: number;
|
|
1436
|
+
reducer: Reducer<TState>;
|
|
1437
|
+
actions: Actions;
|
|
1438
|
+
utils: DocumentModelUtils<TState>;
|
|
1439
|
+
documentModel: DocumentModelPHState;
|
|
1786
1440
|
};
|
|
1787
|
-
type
|
|
1788
|
-
|
|
1789
|
-
|
|
1441
|
+
type DocumentModelLib<TState extends PHBaseState = PHBaseState> = {
|
|
1442
|
+
manifest: Manifest;
|
|
1443
|
+
documentModels: DocumentModelModule<TState>[];
|
|
1444
|
+
editors: EditorModule[];
|
|
1445
|
+
subgraphs: SubgraphModule[];
|
|
1446
|
+
importScripts: ImportScriptModule[];
|
|
1447
|
+
upgradeManifests: UpgradeManifest<readonly number[]>[] | undefined;
|
|
1448
|
+
processorFactory: ProcessorFactoryBuilder;
|
|
1790
1449
|
};
|
|
1791
|
-
type
|
|
1792
|
-
|
|
1793
|
-
|
|
1450
|
+
type DocumentModelDocumentModelModule = DocumentModelModule<DocumentModelPHState>;
|
|
1451
|
+
//#endregion
|
|
1452
|
+
//#region document-model/state.d.ts
|
|
1453
|
+
/**
|
|
1454
|
+
* Creates a default PHAuthState
|
|
1455
|
+
*/
|
|
1456
|
+
declare function defaultAuthState(): PHAuthState;
|
|
1457
|
+
/**
|
|
1458
|
+
* Creates a default PHDocumentState
|
|
1459
|
+
*/
|
|
1460
|
+
declare function defaultDocumentState(): PHDocumentState;
|
|
1461
|
+
/**
|
|
1462
|
+
* Creates a default PHBaseState with auth and document properties
|
|
1463
|
+
*/
|
|
1464
|
+
declare function defaultBaseState(): PHBaseState;
|
|
1465
|
+
/**
|
|
1466
|
+
* Creates a PHAuthState with the given properties
|
|
1467
|
+
*/
|
|
1468
|
+
declare function createAuthState(auth?: Partial<PHAuthState>): PHAuthState;
|
|
1469
|
+
/**
|
|
1470
|
+
* Creates a PHDocumentState with the given properties
|
|
1471
|
+
*/
|
|
1472
|
+
declare function createDocumentState(document?: Partial<PHDocumentState>): PHDocumentState;
|
|
1473
|
+
/**
|
|
1474
|
+
* Creates a PHBaseState with the given auth and document properties
|
|
1475
|
+
*/
|
|
1476
|
+
declare function createBaseState(auth?: Partial<PHAuthState>, document?: Partial<PHDocumentState>): PHBaseState;
|
|
1477
|
+
/**
|
|
1478
|
+
* The document state of the document.
|
|
1479
|
+
*/
|
|
1480
|
+
type PHDocumentState = {
|
|
1481
|
+
/**
|
|
1482
|
+
* The current document model schema version of the document. This is used
|
|
1483
|
+
* with the UPGRADE_DOCUMENT operation to specify the DocumentModelModule
|
|
1484
|
+
* version to use for reducer execution.
|
|
1485
|
+
*/
|
|
1486
|
+
version: number; /** Hash configuration for operation state verification */
|
|
1487
|
+
hash: HashConfig; /** True if and only if the document has been deleted */
|
|
1488
|
+
isDeleted?: boolean; /** The timestamp when the document was deleted, in UTC ISO format */
|
|
1489
|
+
deletedAtUtcIso?: string; /** Optional: who deleted the document */
|
|
1490
|
+
deletedBy?: string; /** Optional: reason for deletion */
|
|
1491
|
+
deletionReason?: string;
|
|
1794
1492
|
};
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1493
|
+
/**
|
|
1494
|
+
* The authentication state of the document.
|
|
1495
|
+
*
|
|
1496
|
+
* This has yet to be implemented.
|
|
1497
|
+
*/
|
|
1498
|
+
type PHAuthState = {};
|
|
1499
|
+
/**
|
|
1500
|
+
* The base state of the document.
|
|
1501
|
+
*/
|
|
1502
|
+
type PHBaseState = {
|
|
1503
|
+
/** Carries authentication information. */auth: PHAuthState; /** Carries information about the document. */
|
|
1504
|
+
document: PHDocumentState;
|
|
1798
1505
|
};
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1506
|
+
declare function defaultGlobalState(): DocumentModelGlobalState;
|
|
1507
|
+
declare function defaultLocalState(): DocumentModelLocalState;
|
|
1508
|
+
declare function defaultPHState(): DocumentModelPHState;
|
|
1509
|
+
declare function createGlobalState(state?: Partial<DocumentModelGlobalState>): DocumentModelGlobalState;
|
|
1510
|
+
declare function createLocalState(state?: Partial<DocumentModelLocalState>): DocumentModelLocalState;
|
|
1511
|
+
declare function createState(baseState?: Partial<PHBaseState>, globalState?: Partial<DocumentModelGlobalState>, localState?: Partial<DocumentModelLocalState>): DocumentModelPHState;
|
|
1512
|
+
//#endregion
|
|
1513
|
+
//#region document-model/operations.d.ts
|
|
1514
|
+
declare function setNameOperation<TDocument extends PHDocument>(document: TDocument, input: {
|
|
1515
|
+
name: string;
|
|
1516
|
+
}): TDocument & {
|
|
1517
|
+
header: {
|
|
1518
|
+
name: string;
|
|
1519
|
+
id: string;
|
|
1520
|
+
sig: PHDocumentSignatureInfo;
|
|
1808
1521
|
documentType: string;
|
|
1522
|
+
createdAtUtcIso: string;
|
|
1523
|
+
slug: string;
|
|
1524
|
+
branch: string;
|
|
1525
|
+
revision: {
|
|
1526
|
+
[scope: string]: number;
|
|
1527
|
+
};
|
|
1528
|
+
lastModifiedAtUtcIso: string;
|
|
1529
|
+
protocolVersions?: {
|
|
1530
|
+
[key: string]: number;
|
|
1531
|
+
};
|
|
1532
|
+
meta?: PHDocumentMeta;
|
|
1809
1533
|
};
|
|
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
1534
|
};
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
};
|
|
1835
|
-
type RemoveRelationshipActionInput = {
|
|
1836
|
-
sourceId: string;
|
|
1837
|
-
targetId: string;
|
|
1838
|
-
relationshipType: string;
|
|
1535
|
+
declare function undoOperation<TDocument extends PHDocument>(document: TDocument, action: Action, skip: number): {
|
|
1536
|
+
document: TDocument;
|
|
1537
|
+
action: Action;
|
|
1538
|
+
skip: number;
|
|
1539
|
+
reuseLastOperationIndex: boolean;
|
|
1839
1540
|
};
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1541
|
+
/**
|
|
1542
|
+
* V2 of undoOperation for protocol version 2+.
|
|
1543
|
+
* Key differences from undoOperation:
|
|
1544
|
+
* - Never reuses operation index (always increments)
|
|
1545
|
+
* - Always sets skip=1 (consecutive NOOPs are handled during rebuild/GC)
|
|
1546
|
+
* - No complex skip calculation - simpler model where each UNDO is independent
|
|
1547
|
+
*/
|
|
1548
|
+
declare function undoOperationV2<TDocument extends PHDocument>(document: TDocument, action: Action, skip: number): {
|
|
1549
|
+
document: TDocument;
|
|
1550
|
+
action: Action;
|
|
1551
|
+
skip: number;
|
|
1552
|
+
reuseLastOperationIndex: false;
|
|
1843
1553
|
};
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1554
|
+
declare function redoOperation<TDocument extends PHDocument>(document: TDocument, action: Action, skip: number): {
|
|
1555
|
+
document: TDocument;
|
|
1556
|
+
action: Action;
|
|
1557
|
+
skip: number;
|
|
1558
|
+
reuseLastOperationIndex: boolean;
|
|
1847
1559
|
};
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1560
|
+
declare function loadStateOperation<TState extends PHBaseState>(document: PHDocument<TState>, action: LoadStateActionInput): PHDocument<TState>;
|
|
1561
|
+
/**
|
|
1562
|
+
* An operation that was applied to a {@link BaseDocument}.
|
|
1563
|
+
*
|
|
1564
|
+
* @remarks
|
|
1565
|
+
* Wraps an action with an index, to be added to the operations history of a Document.
|
|
1566
|
+
* The `index` field is used to keep all operations in order and enable replaying the
|
|
1567
|
+
* document's history from the beginning. Note that indices and skips are relative to
|
|
1568
|
+
* a specific reactor. Example below:
|
|
1569
|
+
*
|
|
1570
|
+
* For (index, skip, ts, action)
|
|
1571
|
+
* A - [(0, 0, 1, "A0"), (1, 0, 2, "A1")]
|
|
1572
|
+
* B - [(0, 0, 0, "B0"), (1, 0, 3, "B1")]
|
|
1573
|
+
* ...
|
|
1574
|
+
* B gets A's Operations Scenario:
|
|
1575
|
+
* B' - [(0, 0, 0, "B0"), (1, 0, 3, "B1"), (2, 1, 1, "A0"), (3, 0, 2, "A1"), (4, 0, 3, "B1")]
|
|
1576
|
+
* Then A needs to end up with:
|
|
1577
|
+
* 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")]
|
|
1578
|
+
* So that both A and B end up with the stream of actions (action):
|
|
1579
|
+
* [("B0"), ("A0"), ("A1"), ("B1")]
|
|
1580
|
+
*
|
|
1581
|
+
* @typeParam A - The type of the action.
|
|
1582
|
+
*/
|
|
1583
|
+
type Operation = {
|
|
1584
|
+
/**
|
|
1585
|
+
* This is a stable id, derived from various document and action properties
|
|
1586
|
+
* in deriveOperationId().
|
|
1587
|
+
*
|
|
1588
|
+
* It _cannot_ be an arbitrary string.
|
|
1589
|
+
*
|
|
1590
|
+
* It it also not unique per operation, as reshuffled operations will keep'
|
|
1591
|
+
* the same id they had before they were reshuffled. This means that the
|
|
1592
|
+
* IOperationStore may have multiple operations with the same operation id.
|
|
1593
|
+
**/
|
|
1594
|
+
id: string; /** Position of the operation in the history. This is relative to a specific reactor -- they may not all agree on this value. */
|
|
1595
|
+
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. */
|
|
1596
|
+
skip: number; /** Timestamp of when the operation was added */
|
|
1597
|
+
timestampUtcMs: string; /** Hash of the resulting document data after the operation */
|
|
1598
|
+
hash: string; /** Error message for a failed action */
|
|
1599
|
+
error?: string; /** The resulting state after the operation */
|
|
1600
|
+
resultingState?: string;
|
|
1601
|
+
/**
|
|
1602
|
+
* The action that was applied to the document to produce this operation.
|
|
1603
|
+
*/
|
|
1604
|
+
action: Action;
|
|
1851
1605
|
};
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1606
|
+
/**
|
|
1607
|
+
* The operations history of the document by scope.
|
|
1608
|
+
*
|
|
1609
|
+
* This will be removed in a future release.
|
|
1610
|
+
*
|
|
1611
|
+
* TODO: Type should be Partial<Record<string, Operation[]>>,
|
|
1612
|
+
* but that is a breaking change for codegen + external doc models.
|
|
1613
|
+
*/
|
|
1614
|
+
type DocumentOperations = Record<string, Operation[]>;
|
|
1615
|
+
type OperationContext = {
|
|
1616
|
+
documentId: string;
|
|
1617
|
+
documentType: string;
|
|
1618
|
+
scope: string;
|
|
1619
|
+
branch: string;
|
|
1620
|
+
resultingState?: string;
|
|
1621
|
+
ordinal: number;
|
|
1855
1622
|
};
|
|
1856
|
-
type
|
|
1857
|
-
|
|
1858
|
-
|
|
1623
|
+
type OperationWithContext$1 = {
|
|
1624
|
+
operation: Operation;
|
|
1625
|
+
context: OperationContext;
|
|
1859
1626
|
};
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
type ISignalResult<TTYpe, TInput, TResult> = {
|
|
1866
|
-
signal: {
|
|
1867
|
-
type: TTYpe;
|
|
1868
|
-
input: TInput;
|
|
1869
|
-
};
|
|
1870
|
-
result: TResult;
|
|
1627
|
+
//#endregion
|
|
1628
|
+
//#region document-model/documents.d.ts
|
|
1629
|
+
/** Meta information about the document. */
|
|
1630
|
+
type PHDocumentMeta = {
|
|
1631
|
+
/** The preferred editor for the document. */preferredEditor?: string;
|
|
1871
1632
|
};
|
|
1872
|
-
|
|
1633
|
+
/**
|
|
1634
|
+
* The header of a document.
|
|
1635
|
+
*/
|
|
1636
|
+
type PHDocumentHeader = {
|
|
1637
|
+
/**
|
|
1638
|
+
* The id of the document.
|
|
1639
|
+
*
|
|
1640
|
+
* This is a Ed25519 signature and is immutable.
|
|
1641
|
+
**/
|
|
1873
1642
|
id: string;
|
|
1643
|
+
/**
|
|
1644
|
+
* Information to verify the document creator.
|
|
1645
|
+
*
|
|
1646
|
+
* This is immutable.
|
|
1647
|
+
**/
|
|
1648
|
+
sig: PHDocumentSignatureInfo;
|
|
1649
|
+
/**
|
|
1650
|
+
* The type of the document.
|
|
1651
|
+
*
|
|
1652
|
+
* This is used as part of the signature payload and thus, cannot be changed
|
|
1653
|
+
* after the document header has been created.
|
|
1654
|
+
**/
|
|
1874
1655
|
documentType: string;
|
|
1656
|
+
/**
|
|
1657
|
+
* The timestamp of the creation date of the document, in UTC ISO format.
|
|
1658
|
+
*
|
|
1659
|
+
* This is used as part of the signature payload and thus, cannot be changed
|
|
1660
|
+
* after the document header has been created.
|
|
1661
|
+
**/
|
|
1662
|
+
createdAtUtcIso: string; /** The slug of the document. */
|
|
1663
|
+
slug: string; /** The name of the document. */
|
|
1664
|
+
name: string; /** The branch of this document. */
|
|
1665
|
+
branch: string;
|
|
1666
|
+
/**
|
|
1667
|
+
* The revision of each scope of the document. This object is updated every
|
|
1668
|
+
* time any _other_ scope is updated.
|
|
1669
|
+
*/
|
|
1670
|
+
revision: {
|
|
1671
|
+
[scope: string]: number;
|
|
1672
|
+
};
|
|
1673
|
+
/**
|
|
1674
|
+
* The timestamp of the last change in the document, in UTC ISO format.
|
|
1675
|
+
**/
|
|
1676
|
+
lastModifiedAtUtcIso: string;
|
|
1677
|
+
/**
|
|
1678
|
+
* This is a map from protocol name to version. A protocol can be any set of
|
|
1679
|
+
* rules that are applied to the document.
|
|
1680
|
+
*
|
|
1681
|
+
* Examples of protocols include:
|
|
1682
|
+
*
|
|
1683
|
+
* - "base-reducer"
|
|
1684
|
+
*/
|
|
1685
|
+
protocolVersions?: {
|
|
1686
|
+
[key: string]: number;
|
|
1687
|
+
}; /** Meta information about the document. */
|
|
1688
|
+
meta?: PHDocumentMeta;
|
|
1875
1689
|
};
|
|
1876
|
-
|
|
1877
|
-
type
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
type
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
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;
|
|
1690
|
+
/**
|
|
1691
|
+
* The base type of a document model.
|
|
1692
|
+
*
|
|
1693
|
+
* @remarks
|
|
1694
|
+
* This type is extended by all Document models.
|
|
1695
|
+
*
|
|
1696
|
+
* @typeParam TState - The type of the document state.
|
|
1697
|
+
*/
|
|
1698
|
+
type PHDocument<TState extends PHBaseState = PHBaseState> = {
|
|
1699
|
+
/** The header of the document. */header: PHDocumentHeader; /** The document model specific state. */
|
|
1700
|
+
state: TState;
|
|
1905
1701
|
/**
|
|
1906
|
-
*
|
|
1907
|
-
*
|
|
1702
|
+
* The initial state of the document, enabling replaying operations.
|
|
1703
|
+
*
|
|
1704
|
+
* This will be removed in a future release.
|
|
1908
1705
|
*/
|
|
1909
|
-
|
|
1910
|
-
branch?: string;
|
|
1706
|
+
initialState: TState;
|
|
1911
1707
|
/**
|
|
1912
|
-
*
|
|
1913
|
-
*
|
|
1914
|
-
*
|
|
1708
|
+
* The operations history of the document.
|
|
1709
|
+
*
|
|
1710
|
+
* This will be removed in a future release.
|
|
1915
1711
|
*/
|
|
1916
|
-
|
|
1712
|
+
operations: DocumentOperations;
|
|
1917
1713
|
/**
|
|
1918
|
-
*
|
|
1919
|
-
*
|
|
1714
|
+
* A list of undone operations
|
|
1715
|
+
*
|
|
1716
|
+
* This will be removed in a future release.
|
|
1920
1717
|
*/
|
|
1921
|
-
|
|
1718
|
+
clipboard: Operation[];
|
|
1719
|
+
};
|
|
1720
|
+
declare function isNoopOperation<TOp extends {
|
|
1721
|
+
type: string;
|
|
1722
|
+
skip: number;
|
|
1723
|
+
hash: string;
|
|
1724
|
+
}>(op: Partial<TOp>): boolean;
|
|
1725
|
+
declare function isUndoRedo(action: Action): action is UndoRedoAction;
|
|
1726
|
+
declare function isUndo(action: Action): action is UndoAction;
|
|
1727
|
+
declare function isDocumentAction(action: Action): action is DocumentAction;
|
|
1728
|
+
/**
|
|
1729
|
+
* Important note: it is the responsibility of the caller to set the document type
|
|
1730
|
+
* on the header.
|
|
1731
|
+
*/
|
|
1732
|
+
declare function baseCreateDocument<TState extends PHBaseState = PHBaseState>(createState: CreateState<TState>, initialState?: Partial<TState>): PHDocument<TState>;
|
|
1733
|
+
declare function hashDocumentStateForScope(document: {
|
|
1734
|
+
state: {
|
|
1735
|
+
[key: string]: unknown;
|
|
1736
|
+
};
|
|
1737
|
+
}, scope?: string): string;
|
|
1738
|
+
declare function readOnly<T>(value: T): Readonly<T>;
|
|
1739
|
+
/**
|
|
1740
|
+
* Maps skipped operations in an array of operations.
|
|
1741
|
+
* Skipped operations are operations that are ignored during processing.
|
|
1742
|
+
* @param operations - The array of operations to map.
|
|
1743
|
+
* @param skippedHeadOperations - The number of operations to skip at the head of the array of operations.
|
|
1744
|
+
* @returns An array of mapped operations with ignore flag indicating if the operation is skipped.
|
|
1745
|
+
* @throws Error if the operation index is invalid and there are missing operations.
|
|
1746
|
+
*/
|
|
1747
|
+
declare function mapSkippedOperations(operations: Operation[], skippedHeadOperations?: number): MappedOperation[];
|
|
1748
|
+
/**
|
|
1749
|
+
* V2 version of mapSkippedOperations for protocol version 2+.
|
|
1750
|
+
* In V2, all NOOPs have skip=1 and consecutive NOOPs form chains.
|
|
1751
|
+
* N consecutive NOOPs at any point skip N preceding content operations.
|
|
1752
|
+
*
|
|
1753
|
+
* Algorithm: Process from end to start
|
|
1754
|
+
* - When hitting a NOOP: increment chain length, mark as ignored
|
|
1755
|
+
* - When hitting a non-NOOP:
|
|
1756
|
+
* - If chain > 0: decrement chain, mark as ignored (this op was undone)
|
|
1757
|
+
* - If chain == 0: mark as not ignored (apply this op)
|
|
1758
|
+
*/
|
|
1759
|
+
declare function mapSkippedOperationsV2(operations: Operation[]): MappedOperation[];
|
|
1760
|
+
/**
|
|
1761
|
+
* V2 garbage collect that returns only operations that should be applied for state.
|
|
1762
|
+
* Uses the V2 model where consecutive NOOPs form chains.
|
|
1763
|
+
* Unlike V1 garbageCollect, this preserves ALL operations but marks which to apply.
|
|
1764
|
+
*/
|
|
1765
|
+
declare function garbageCollectV2<TOpIndex extends OperationIndex>(sortedOperations: TOpIndex[]): TOpIndex[];
|
|
1766
|
+
declare function sortMappedOperations(operations: DocumentOperationsIgnoreMap): MappedOperation[];
|
|
1767
|
+
declare function replayDocument<TState extends PHBaseState = PHBaseState>(initialState: TState, operations: DocumentOperations, reducer: Reducer<TState>, header: PHDocumentHeader, dispatch?: SignalDispatch, skipHeaderOperations?: SkipHeaderOperations, options?: ReplayDocumentOptions): PHDocument<TState>;
|
|
1768
|
+
declare function parseResultingState<TState>(state: string | null | undefined): TState;
|
|
1769
|
+
declare enum IntegrityIssueType {
|
|
1770
|
+
UNEXPECTED_INDEX = "UNEXPECTED_INDEX"
|
|
1771
|
+
}
|
|
1772
|
+
declare enum IntegrityIssueSubType {
|
|
1773
|
+
DUPLICATED_INDEX = "DUPLICATED_INDEX",
|
|
1774
|
+
MISSING_INDEX = "MISSING_INDEX"
|
|
1775
|
+
}
|
|
1776
|
+
type IntegrityIssue = {
|
|
1777
|
+
operation: OperationIndex;
|
|
1778
|
+
issue: IntegrityIssueType;
|
|
1779
|
+
category: IntegrityIssueSubType;
|
|
1780
|
+
message: string;
|
|
1781
|
+
};
|
|
1782
|
+
type Reshuffle = (startIndex: OperationIndex, opsA: Operation[], opsB: Operation[]) => Operation[];
|
|
1783
|
+
declare function checkCleanedOperationsIntegrity(sortedOperations: OperationIndex[]): IntegrityIssue[];
|
|
1784
|
+
declare function garbageCollect<TOpIndex extends OperationIndex>(sortedOperations: TOpIndex[]): TOpIndex[];
|
|
1785
|
+
declare function addUndo(sortedOperations: Operation[]): Operation[];
|
|
1786
|
+
declare function sortOperations<TOpIndex extends OperationIndex>(operations: TOpIndex[]): TOpIndex[];
|
|
1787
|
+
declare function reshuffleByTimestamp<TOp extends OperationIndex>(startIndex: OperationIndex, opsA: TOp[], opsB: TOp[]): TOp[];
|
|
1788
|
+
declare function reshuffleByTimestampAndIndex<TOp extends OperationIndex>(startIndex: OperationIndex, opsA: TOp[], opsB: TOp[]): TOp[];
|
|
1789
|
+
declare function operationsAreEqual<TOp extends {
|
|
1790
|
+
index: number;
|
|
1791
|
+
skip: number;
|
|
1792
|
+
type?: string;
|
|
1793
|
+
scope?: string;
|
|
1794
|
+
input?: unknown;
|
|
1795
|
+
}>(op1: TOp, op2: TOp): boolean;
|
|
1796
|
+
declare function attachBranch(trunk: Operation[], newBranch: Operation[]): [Operation[], Operation[]];
|
|
1797
|
+
declare function precedes(op1: OperationIndex, op2: OperationIndex): boolean;
|
|
1798
|
+
declare function split(sortedTargetOperations: Operation[], sortedMergeOperations: Operation[]): [Operation[], Operation[], Operation[]];
|
|
1799
|
+
declare function merge(sortedTargetOperations: Operation[], sortedMergeOperations: Operation[], reshuffle: Reshuffle): Operation[];
|
|
1800
|
+
declare function nextSkipNumber(sortedOperations: OperationIndex[]): number;
|
|
1801
|
+
declare function checkOperationsIntegrity(operations: Operation[]): IntegrityIssue[];
|
|
1802
|
+
declare function groupOperationsByScope(operations: Operation[]): Partial<Record<string, Operation[]>>;
|
|
1803
|
+
type PrepareOperationsResult = {
|
|
1804
|
+
validOperations: Operation[];
|
|
1805
|
+
invalidOperations: Operation[];
|
|
1806
|
+
duplicatedOperations: Operation[];
|
|
1807
|
+
integrityIssues: IntegrityIssue[];
|
|
1922
1808
|
};
|
|
1809
|
+
declare function prepareOperations(operationsHistory: Operation[], newOperations: Operation[]): PrepareOperationsResult;
|
|
1810
|
+
declare function removeExistingOperations(newOperations: Operation[], operationsHistory: Operation[]): Operation[];
|
|
1923
1811
|
/**
|
|
1924
|
-
*
|
|
1925
|
-
*
|
|
1812
|
+
* Skips header operations and returns the remaining operations.
|
|
1813
|
+
*
|
|
1814
|
+
* @param operations - The array of operations.
|
|
1815
|
+
* @param skipHeaderOperation - The skip header operation index.
|
|
1816
|
+
* @returns The remaining operations after skipping header operations.
|
|
1926
1817
|
*/
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1818
|
+
declare function skipHeaderOperations(operations: Operation[], skipHeaderOperation: SkipHeaderOperationIndex): Operation[];
|
|
1819
|
+
declare function garbageCollectDocumentOperations(documentOperations: DocumentOperations): DocumentOperations;
|
|
1820
|
+
/**
|
|
1821
|
+
* Filters out duplicated operations from the target operations array based on their IDs.
|
|
1822
|
+
* If an operation has an ID, it is considered duplicated if there is another operation in the source operations array with the same ID.
|
|
1823
|
+
* If an operation does not have an ID, it is considered unique and will not be filtered out.
|
|
1824
|
+
* @param targetOperations - The array of target operations to filter.
|
|
1825
|
+
* @param sourceOperations - The array of source operations to compare against.
|
|
1826
|
+
* @returns An array of operations with duplicates filtered out.
|
|
1827
|
+
*/
|
|
1828
|
+
declare function filterDuplicatedOperations<T extends {
|
|
1829
|
+
id?: string | number;
|
|
1830
|
+
}>(targetOperations: T[], sourceOperations: T[]): T[];
|
|
1831
|
+
declare function filterDocumentOperationsResultingState(documentOperations?: DocumentOperations): {
|
|
1832
|
+
[x: string]: Operation[] | {
|
|
1833
|
+
id: string;
|
|
1834
|
+
index: number;
|
|
1835
|
+
skip: number;
|
|
1836
|
+
timestampUtcMs: string;
|
|
1837
|
+
hash: string;
|
|
1838
|
+
error?: string;
|
|
1839
|
+
action: Action;
|
|
1840
|
+
}[];
|
|
1932
1841
|
};
|
|
1933
1842
|
/**
|
|
1934
|
-
*
|
|
1843
|
+
* Calculates the difference between two arrays of operations.
|
|
1844
|
+
* Returns an array of operations that are present in `clearedOperationsA` but not in `clearedOperationsB`.
|
|
1845
|
+
*
|
|
1846
|
+
* @template TOp - The type of the operations.
|
|
1847
|
+
* @param {TOp[]} clearedOperationsA - The first array of operations.
|
|
1848
|
+
* @param {TOp[]} clearedOperationsB - The second array of operations.
|
|
1849
|
+
* @returns {TOp[]} - The difference between the two arrays of operations.
|
|
1850
|
+
*/
|
|
1851
|
+
declare function diffOperations<TOp extends OperationIndex>(clearedOperationsA: TOp[], clearedOperationsB: TOp[]): TOp[];
|
|
1852
|
+
declare function getDocumentLastModified(document: PHDocument): string;
|
|
1853
|
+
/**
|
|
1854
|
+
* Updates the document header with the latest revision number and
|
|
1855
|
+
* date of last modification.
|
|
1856
|
+
*
|
|
1857
|
+
* @param document The current state of the document.
|
|
1858
|
+
* @param scope The scope of the operation.
|
|
1859
|
+
* @param lastModifiedTimestamp Optional timestamp to use directly, avoiding a scan of all operations.
|
|
1860
|
+
* @returns The updated document state.
|
|
1861
|
+
*/
|
|
1862
|
+
declare function updateHeaderRevision(document: PHDocument, scope: string, lastModifiedTimestamp?: string): PHDocument;
|
|
1863
|
+
//#endregion
|
|
1864
|
+
//#region document-model/actions.d.ts
|
|
1865
|
+
/**
|
|
1866
|
+
* Cancels the last `count` operations.
|
|
1867
|
+
*
|
|
1868
|
+
* @param count - Number of operations to cancel
|
|
1869
|
+
* @category Actions
|
|
1870
|
+
*/
|
|
1871
|
+
declare const undo: (count?: number, scope?: string) => UndoAction;
|
|
1872
|
+
/**
|
|
1873
|
+
* Cancels the last `count` {@link undo | UNDO} operations.
|
|
1874
|
+
*
|
|
1875
|
+
* @param count - Number of UNDO operations to cancel
|
|
1876
|
+
* @category Actions
|
|
1877
|
+
*/
|
|
1878
|
+
declare const redo: (count?: number, scope?: string) => RedoAction;
|
|
1879
|
+
/**
|
|
1880
|
+
* Joins multiple operations into a single {@link loadState | LOAD_STATE} operation.
|
|
1935
1881
|
*
|
|
1936
1882
|
* @remarks
|
|
1937
|
-
*
|
|
1938
|
-
*
|
|
1883
|
+
* Useful to keep operations history smaller. Operations to prune are selected by index,
|
|
1884
|
+
* similar to the {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice | slice} method in Arrays.
|
|
1939
1885
|
*
|
|
1886
|
+
* @param start - Index of the first operation to prune
|
|
1887
|
+
* @param end - Index of the last operation to prune
|
|
1888
|
+
* @category Actions
|
|
1940
1889
|
*/
|
|
1941
|
-
|
|
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>;
|
|
1890
|
+
declare const prune: (start?: number, end?: number, scope?: string) => SchemaPruneAction;
|
|
1955
1891
|
/**
|
|
1956
|
-
*
|
|
1892
|
+
* Replaces the state of the document.
|
|
1957
1893
|
*
|
|
1958
|
-
* @
|
|
1959
|
-
*
|
|
1960
|
-
*
|
|
1894
|
+
* @remarks
|
|
1895
|
+
* This action shouldn't be used directly. It is dispatched by the {@link prune} action.
|
|
1896
|
+
*
|
|
1897
|
+
* @param state - State to be set in the document.
|
|
1898
|
+
* @param operations - Number of operations that were removed from the previous state.
|
|
1899
|
+
* @category Actions
|
|
1961
1900
|
*/
|
|
1962
|
-
|
|
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;
|
|
1901
|
+
declare const loadState: <TState extends PHBaseState = PHBaseState>(state: TState & {
|
|
1988
1902
|
name: string;
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1903
|
+
}, operations: number) => LoadStateAction;
|
|
1904
|
+
declare const noop: (scope?: string) => NOOPAction;
|
|
1905
|
+
/**
|
|
1906
|
+
* Helper function to be used by action creators.
|
|
1907
|
+
*
|
|
1908
|
+
* @remarks
|
|
1909
|
+
* Creates an action with the given type and input properties. The input
|
|
1910
|
+
* properties default to an empty object.
|
|
1911
|
+
*
|
|
1912
|
+
* @typeParam A - Type of the action to be returned.
|
|
1913
|
+
*
|
|
1914
|
+
* @param type - The type of the action.
|
|
1915
|
+
* @param input - The input properties of the action.
|
|
1916
|
+
* @param attachments - The attachments included in the action.
|
|
1917
|
+
* @param validator - The validator to use for the input properties.
|
|
1918
|
+
* @param scope - The scope of the action, can either be 'global' or 'local'.
|
|
1919
|
+
* @param skip - The number of operations to skip before this new action is applied.
|
|
1920
|
+
*
|
|
1921
|
+
* @throws Error if the type is empty or not a string.
|
|
1922
|
+
*
|
|
1923
|
+
* @returns The new action.
|
|
1924
|
+
*/
|
|
1925
|
+
declare function createAction<TAction extends Action>(type: TAction["type"], input?: TAction["input"], attachments?: TAction["attachments"], validator?: () => {
|
|
1926
|
+
parse(v: unknown): TAction["input"];
|
|
1927
|
+
}, scope?: Action["scope"]): TAction;
|
|
1928
|
+
/**
|
|
1929
|
+
* This function should be used instead of { ...action } to ensure
|
|
1930
|
+
* that extra properties are not included in the action.
|
|
1931
|
+
*/
|
|
1932
|
+
declare const actionFromAction: (action: Action) => Action;
|
|
1933
|
+
declare const operationFromAction: (action: Action, index: number, skip: number, context: OperationContext) => Operation;
|
|
1934
|
+
declare const operationFromOperation: (operation: Operation, index: number, skip: number, context: OperationContext) => Operation;
|
|
1935
|
+
declare const operationWithContext: (operation: Operation, context: ActionContext) => Operation;
|
|
1936
|
+
declare const actionContext: () => ActionContext;
|
|
1937
|
+
declare const actionSigner: (user: UserActionSigner, app: AppActionSigner, signatures?: Signature[]) => ActionSigner;
|
|
1938
|
+
declare function buildOperationSignature(context: ActionSignatureContext, signMethod: ActionSigningHandler): Promise<Signature>;
|
|
1939
|
+
declare function buildSignedAction<TState extends PHBaseState = PHBaseState>(action: Action, reducer: Reducer<TState>, document: PHDocument<TState>, signer: ActionSigner, signHandler: ActionSigningHandler): Promise<Operation>;
|
|
1940
|
+
declare function verifyOperationSignature(signature: Signature, signer: Omit<ActionSigner, "signatures">, verifyHandler: ActionVerificationHandler): Promise<boolean>;
|
|
1941
|
+
/**
|
|
1942
|
+
* Changes the name of the document.
|
|
1943
|
+
*
|
|
1944
|
+
* @param name - The name to be set in the document.
|
|
1945
|
+
* @category Actions
|
|
1946
|
+
*/
|
|
1947
|
+
declare const setName: (name: string | {
|
|
1994
1948
|
name: string;
|
|
1995
|
-
|
|
1996
|
-
|
|
1949
|
+
}) => SetNameAction;
|
|
1950
|
+
declare const setModelName: (input: SetModelNameInput) => SetModelNameAction;
|
|
1951
|
+
declare const setModelId: (input: SetModelIdInput) => SetModelIdAction;
|
|
1952
|
+
declare const setModelExtension: (input: SetModelExtensionInput) => SetModelExtensionAction;
|
|
1953
|
+
declare const setModelDescription: (input: SetModelDescriptionInput) => SetModelDescriptionAction;
|
|
1954
|
+
declare const setAuthorName: (input: SetAuthorNameInput) => SetAuthorNameAction;
|
|
1955
|
+
declare const setAuthorWebsite: (input: SetAuthorWebsiteInput) => SetAuthorWebsiteAction;
|
|
1956
|
+
declare const addModule: (input: AddModuleInput) => AddModuleAction;
|
|
1957
|
+
declare const setModuleName: (input: SetModuleNameInput) => SetModuleNameAction;
|
|
1958
|
+
declare const setModuleDescription: (input: SetModuleDescriptionInput) => SetModuleDescriptionAction;
|
|
1959
|
+
declare const deleteModule: (input: DeleteModuleInput) => DeleteModuleAction;
|
|
1960
|
+
declare const reorderModules: (input: ReorderModulesInput) => ReorderModulesAction;
|
|
1961
|
+
declare const addOperation: (input: AddOperationInput) => AddOperationAction;
|
|
1962
|
+
declare const setOperationName: (input: SetOperationNameInput) => SetOperationNameAction;
|
|
1963
|
+
declare const setOperationScope: (input: SetOperationScopeInput) => SetOperationScopeAction;
|
|
1964
|
+
declare const setOperationSchema: (input: SetOperationSchemaInput) => SetOperationSchemaAction;
|
|
1965
|
+
declare const setOperationDescription: (input: SetOperationDescriptionInput) => SetOperationDescriptionAction;
|
|
1966
|
+
declare const setOperationTemplate: (input: SetOperationTemplateInput) => SetOperationTemplateAction;
|
|
1967
|
+
declare const setOperationReducer: (input: SetOperationReducerInput) => SetOperationReducerAction;
|
|
1968
|
+
declare const moveOperation: (input: MoveOperationInput) => MoveOperationAction;
|
|
1969
|
+
declare const deleteOperation: (input: DeleteOperationInput) => DeleteOperationAction;
|
|
1970
|
+
declare const reorderModuleOperations: (input: ReorderModuleOperationsInput) => ReorderModuleOperationsAction;
|
|
1971
|
+
declare const addOperationError: (input: AddOperationErrorInput) => AddOperationErrorAction;
|
|
1972
|
+
declare const setOperationErrorCode: (input: SetOperationErrorCodeInput) => SetOperationErrorCodeAction;
|
|
1973
|
+
declare const setOperationErrorName: (input: SetOperationErrorNameInput) => SetOperationErrorNameAction;
|
|
1974
|
+
declare const setOperationErrorDescription: (input: SetOperationErrorDescriptionInput) => SetOperationErrorDescriptionAction;
|
|
1975
|
+
declare const setOperationErrorTemplate: (input: SetOperationErrorTemplateInput) => SetOperationErrorTemplateAction;
|
|
1976
|
+
declare const deleteOperationError: (input: DeleteOperationErrorInput) => DeleteOperationErrorAction;
|
|
1977
|
+
declare const reorderOperationErrors: (input: ReorderOperationErrorsInput) => ReorderOperationErrorsAction;
|
|
1978
|
+
declare const addOperationExample: (input: AddOperationExampleInput) => AddOperationExampleAction;
|
|
1979
|
+
declare const updateOperationExample: (input: UpdateOperationExampleInput) => UpdateOperationExampleAction;
|
|
1980
|
+
declare const deleteOperationExample: (input: DeleteOperationExampleInput) => DeleteOperationExampleAction;
|
|
1981
|
+
declare const reorderOperationExamples: (input: ReorderOperationExamplesInput) => ReorderOperationExamplesAction;
|
|
1982
|
+
declare const operationExampleCreators: {
|
|
1983
|
+
addOperationExample: (input: AddOperationExampleInput) => AddOperationExampleAction;
|
|
1984
|
+
updateOperationExample: (input: UpdateOperationExampleInput) => UpdateOperationExampleAction;
|
|
1985
|
+
deleteOperationExample: (input: DeleteOperationExampleInput) => DeleteOperationExampleAction;
|
|
1986
|
+
reorderOperationExamples: (input: ReorderOperationExamplesInput) => ReorderOperationExamplesAction;
|
|
1997
1987
|
};
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
1988
|
+
declare const setStateSchema: (input: SetStateSchemaInput) => SetStateSchemaAction;
|
|
1989
|
+
declare const setInitialState: (input: SetInitialStateInput) => SetInitialStateAction;
|
|
1990
|
+
declare const addStateExample: (input: AddStateExampleInput) => AddStateExampleAction;
|
|
1991
|
+
declare const updateStateExample: (input: UpdateStateExampleInput) => UpdateStateExampleAction;
|
|
1992
|
+
declare const deleteStateExample: (input: DeleteStateExampleInput) => DeleteStateExampleAction;
|
|
1993
|
+
declare const reorderStateExamples: (input: ReorderStateExamplesInput) => ReorderStateExamplesAction;
|
|
1994
|
+
declare const addChangeLogItem: (input: AddChangeLogItemInput) => AddChangeLogItemAction;
|
|
1995
|
+
declare const updateChangeLogItem: (input: UpdateChangeLogItemInput) => UpdateChangeLogItemAction;
|
|
1996
|
+
declare const deleteChangeLogItem: (input: DeleteChangeLogItemInput) => DeleteChangeLogItemAction;
|
|
1997
|
+
declare const reorderChangeLogItems: (input: ReorderChangeLogItemsInput) => ReorderChangeLogItemsAction;
|
|
1998
|
+
declare const releaseNewVersion: () => ReleaseNewVersionAction;
|
|
1999
|
+
declare const baseActions: {
|
|
2000
|
+
setName: (name: string | {
|
|
2001
|
+
name: string;
|
|
2002
|
+
}) => SetNameAction;
|
|
2003
|
+
undo: (count?: number, scope?: string) => UndoAction;
|
|
2004
|
+
redo: (count?: number, scope?: string) => RedoAction;
|
|
2005
|
+
prune: (start?: number, end?: number, scope?: string) => SchemaPruneAction;
|
|
2006
|
+
loadState: <TState extends PHBaseState = PHBaseState>(state: TState & {
|
|
2003
2007
|
name: string;
|
|
2004
|
-
};
|
|
2008
|
+
}, operations: number) => LoadStateAction;
|
|
2009
|
+
noop: (scope?: string) => NOOPAction;
|
|
2005
2010
|
};
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2011
|
+
declare const documentModelActions: {
|
|
2012
|
+
setModelName: (input: SetModelNameInput) => SetModelNameAction;
|
|
2013
|
+
setModelId: (input: SetModelIdInput) => SetModelIdAction;
|
|
2014
|
+
setModelExtension: (input: SetModelExtensionInput) => SetModelExtensionAction;
|
|
2015
|
+
setModelDescription: (input: SetModelDescriptionInput) => SetModelDescriptionAction;
|
|
2016
|
+
setAuthorName: (input: SetAuthorNameInput) => SetAuthorNameAction;
|
|
2017
|
+
setAuthorWebsite: (input: SetAuthorWebsiteInput) => SetAuthorWebsiteAction;
|
|
2018
|
+
addModule: (input: AddModuleInput) => AddModuleAction;
|
|
2019
|
+
setModuleName: (input: SetModuleNameInput) => SetModuleNameAction;
|
|
2020
|
+
setModuleDescription: (input: SetModuleDescriptionInput) => SetModuleDescriptionAction;
|
|
2021
|
+
deleteModule: (input: DeleteModuleInput) => DeleteModuleAction;
|
|
2022
|
+
reorderModules: (input: ReorderModulesInput) => ReorderModulesAction;
|
|
2023
|
+
addOperation: (input: AddOperationInput) => AddOperationAction;
|
|
2024
|
+
setOperationName: (input: SetOperationNameInput) => SetOperationNameAction;
|
|
2025
|
+
setOperationScope: (input: SetOperationScopeInput) => SetOperationScopeAction;
|
|
2026
|
+
setOperationSchema: (input: SetOperationSchemaInput) => SetOperationSchemaAction;
|
|
2027
|
+
setOperationDescription: (input: SetOperationDescriptionInput) => SetOperationDescriptionAction;
|
|
2028
|
+
setOperationTemplate: (input: SetOperationTemplateInput) => SetOperationTemplateAction;
|
|
2029
|
+
setOperationReducer: (input: SetOperationReducerInput) => SetOperationReducerAction;
|
|
2030
|
+
moveOperation: (input: MoveOperationInput) => MoveOperationAction;
|
|
2031
|
+
deleteOperation: (input: DeleteOperationInput) => DeleteOperationAction;
|
|
2032
|
+
reorderModuleOperations: (input: ReorderModuleOperationsInput) => ReorderModuleOperationsAction;
|
|
2033
|
+
addOperationError: (input: AddOperationErrorInput) => AddOperationErrorAction;
|
|
2034
|
+
setOperationErrorCode: (input: SetOperationErrorCodeInput) => SetOperationErrorCodeAction;
|
|
2035
|
+
setOperationErrorName: (input: SetOperationErrorNameInput) => SetOperationErrorNameAction;
|
|
2036
|
+
setOperationErrorDescription: (input: SetOperationErrorDescriptionInput) => SetOperationErrorDescriptionAction;
|
|
2037
|
+
setOperationErrorTemplate: (input: SetOperationErrorTemplateInput) => SetOperationErrorTemplateAction;
|
|
2038
|
+
deleteOperationError: (input: DeleteOperationErrorInput) => DeleteOperationErrorAction;
|
|
2039
|
+
reorderOperationErrors: (input: ReorderOperationErrorsInput) => ReorderOperationErrorsAction;
|
|
2040
|
+
setStateSchema: (input: SetStateSchemaInput) => SetStateSchemaAction;
|
|
2041
|
+
setInitialState: (input: SetInitialStateInput) => SetInitialStateAction;
|
|
2042
|
+
addStateExample: (input: AddStateExampleInput) => AddStateExampleAction;
|
|
2043
|
+
updateStateExample: (input: UpdateStateExampleInput) => UpdateStateExampleAction;
|
|
2044
|
+
deleteStateExample: (input: DeleteStateExampleInput) => DeleteStateExampleAction;
|
|
2045
|
+
reorderStateExamples: (input: ReorderStateExamplesInput) => ReorderStateExamplesAction;
|
|
2046
|
+
addChangeLogItem: (input: AddChangeLogItemInput) => AddChangeLogItemAction;
|
|
2047
|
+
updateChangeLogItem: (input: UpdateChangeLogItemInput) => UpdateChangeLogItemAction;
|
|
2048
|
+
deleteChangeLogItem: (input: DeleteChangeLogItemInput) => DeleteChangeLogItemAction;
|
|
2049
|
+
reorderChangeLogItems: (input: ReorderChangeLogItemsInput) => ReorderChangeLogItemsAction;
|
|
2050
|
+
releaseNewVersion: () => ReleaseNewVersionAction;
|
|
2010
2051
|
};
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2052
|
+
declare const actions: {
|
|
2053
|
+
setModelName: (input: SetModelNameInput) => SetModelNameAction;
|
|
2054
|
+
setModelId: (input: SetModelIdInput) => SetModelIdAction;
|
|
2055
|
+
setModelExtension: (input: SetModelExtensionInput) => SetModelExtensionAction;
|
|
2056
|
+
setModelDescription: (input: SetModelDescriptionInput) => SetModelDescriptionAction;
|
|
2057
|
+
setAuthorName: (input: SetAuthorNameInput) => SetAuthorNameAction;
|
|
2058
|
+
setAuthorWebsite: (input: SetAuthorWebsiteInput) => SetAuthorWebsiteAction;
|
|
2059
|
+
addModule: (input: AddModuleInput) => AddModuleAction;
|
|
2060
|
+
setModuleName: (input: SetModuleNameInput) => SetModuleNameAction;
|
|
2061
|
+
setModuleDescription: (input: SetModuleDescriptionInput) => SetModuleDescriptionAction;
|
|
2062
|
+
deleteModule: (input: DeleteModuleInput) => DeleteModuleAction;
|
|
2063
|
+
reorderModules: (input: ReorderModulesInput) => ReorderModulesAction;
|
|
2064
|
+
addOperation: (input: AddOperationInput) => AddOperationAction;
|
|
2065
|
+
setOperationName: (input: SetOperationNameInput) => SetOperationNameAction;
|
|
2066
|
+
setOperationScope: (input: SetOperationScopeInput) => SetOperationScopeAction;
|
|
2067
|
+
setOperationSchema: (input: SetOperationSchemaInput) => SetOperationSchemaAction;
|
|
2068
|
+
setOperationDescription: (input: SetOperationDescriptionInput) => SetOperationDescriptionAction;
|
|
2069
|
+
setOperationTemplate: (input: SetOperationTemplateInput) => SetOperationTemplateAction;
|
|
2070
|
+
setOperationReducer: (input: SetOperationReducerInput) => SetOperationReducerAction;
|
|
2071
|
+
moveOperation: (input: MoveOperationInput) => MoveOperationAction;
|
|
2072
|
+
deleteOperation: (input: DeleteOperationInput) => DeleteOperationAction;
|
|
2073
|
+
reorderModuleOperations: (input: ReorderModuleOperationsInput) => ReorderModuleOperationsAction;
|
|
2074
|
+
addOperationError: (input: AddOperationErrorInput) => AddOperationErrorAction;
|
|
2075
|
+
setOperationErrorCode: (input: SetOperationErrorCodeInput) => SetOperationErrorCodeAction;
|
|
2076
|
+
setOperationErrorName: (input: SetOperationErrorNameInput) => SetOperationErrorNameAction;
|
|
2077
|
+
setOperationErrorDescription: (input: SetOperationErrorDescriptionInput) => SetOperationErrorDescriptionAction;
|
|
2078
|
+
setOperationErrorTemplate: (input: SetOperationErrorTemplateInput) => SetOperationErrorTemplateAction;
|
|
2079
|
+
deleteOperationError: (input: DeleteOperationErrorInput) => DeleteOperationErrorAction;
|
|
2080
|
+
reorderOperationErrors: (input: ReorderOperationErrorsInput) => ReorderOperationErrorsAction;
|
|
2081
|
+
setStateSchema: (input: SetStateSchemaInput) => SetStateSchemaAction;
|
|
2082
|
+
setInitialState: (input: SetInitialStateInput) => SetInitialStateAction;
|
|
2083
|
+
addStateExample: (input: AddStateExampleInput) => AddStateExampleAction;
|
|
2084
|
+
updateStateExample: (input: UpdateStateExampleInput) => UpdateStateExampleAction;
|
|
2085
|
+
deleteStateExample: (input: DeleteStateExampleInput) => DeleteStateExampleAction;
|
|
2086
|
+
reorderStateExamples: (input: ReorderStateExamplesInput) => ReorderStateExamplesAction;
|
|
2087
|
+
addChangeLogItem: (input: AddChangeLogItemInput) => AddChangeLogItemAction;
|
|
2088
|
+
updateChangeLogItem: (input: UpdateChangeLogItemInput) => UpdateChangeLogItemAction;
|
|
2089
|
+
deleteChangeLogItem: (input: DeleteChangeLogItemInput) => DeleteChangeLogItemAction;
|
|
2090
|
+
reorderChangeLogItems: (input: ReorderChangeLogItemsInput) => ReorderChangeLogItemsAction;
|
|
2091
|
+
releaseNewVersion: () => ReleaseNewVersionAction;
|
|
2092
|
+
setName: (name: string | {
|
|
2034
2093
|
name: string;
|
|
2035
|
-
}
|
|
2036
|
-
|
|
2037
|
-
|
|
2094
|
+
}) => SetNameAction;
|
|
2095
|
+
undo: (count?: number, scope?: string) => UndoAction;
|
|
2096
|
+
redo: (count?: number, scope?: string) => RedoAction;
|
|
2097
|
+
prune: (start?: number, end?: number, scope?: string) => SchemaPruneAction;
|
|
2098
|
+
loadState: <TState extends PHBaseState = PHBaseState>(state: TState & {
|
|
2038
2099
|
name: string;
|
|
2039
|
-
|
|
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;
|
|
2100
|
+
}, operations: number) => LoadStateAction;
|
|
2101
|
+
noop: (scope?: string) => NOOPAction;
|
|
2059
2102
|
};
|
|
2060
2103
|
/**
|
|
2061
|
-
*
|
|
2104
|
+
* The context of an action.
|
|
2062
2105
|
*/
|
|
2063
|
-
type
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
/**
|
|
2067
|
-
|
|
2068
|
-
*/
|
|
2069
|
-
nonce: string;
|
|
2106
|
+
type ActionContext = {
|
|
2107
|
+
/** The index of the previous operation, showing intended ordering. */prevOpIndex?: number; /** The hash of the previous operation, showing intended state. */
|
|
2108
|
+
prevOpHash?: string; /** A nonce, to cover specific signing attacks and to prevent replay attacks from no-ops. */
|
|
2109
|
+
nonce?: string; /** The signer of the action. */
|
|
2110
|
+
signer?: ActionSigner;
|
|
2070
2111
|
};
|
|
2071
2112
|
/**
|
|
2072
|
-
*
|
|
2113
|
+
* Defines the basic structure of an action.
|
|
2073
2114
|
*/
|
|
2074
|
-
|
|
2075
|
-
/** The
|
|
2076
|
-
|
|
2077
|
-
/** The
|
|
2078
|
-
|
|
2079
|
-
|
|
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>;
|
|
2115
|
+
type Action = {
|
|
2116
|
+
/** The id of the action. This is distinct from the operation id. */id: string; /** The name of the action. */
|
|
2117
|
+
type: string; /** The timestamp of the action. */
|
|
2118
|
+
timestampUtcMs: string; /** The payload of the action. */
|
|
2119
|
+
input: unknown; /** The scope of the action */
|
|
2120
|
+
scope: string;
|
|
2095
2121
|
/**
|
|
2096
|
-
*
|
|
2122
|
+
* The attachments included in the action.
|
|
2097
2123
|
*
|
|
2098
|
-
*
|
|
2099
|
-
* @param abortSignal - Optional abort signal to cancel the signing.
|
|
2100
|
-
* @returns The signature tuple.
|
|
2124
|
+
* This will be refactored in a future release.
|
|
2101
2125
|
*/
|
|
2102
|
-
|
|
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;
|
|
2126
|
+
attachments?: AttachmentInput[]; /** The context of the action. */
|
|
2127
|
+
context?: ActionContext;
|
|
2121
2128
|
};
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
isDocumentOfType: IsDocumentOfType<TState>;
|
|
2131
|
-
assertIsDocumentOfType: AssertIsDocumentOfType<TState>;
|
|
2129
|
+
/**
|
|
2130
|
+
* The attributes stored for a file. Namely, attachments of a document.
|
|
2131
|
+
*/
|
|
2132
|
+
type Attachment = {
|
|
2133
|
+
/** The binary data of the attachment in Base64 */data: string; /** The MIME type of the attachment */
|
|
2134
|
+
mimeType: string;
|
|
2135
|
+
extension?: string | null;
|
|
2136
|
+
fileName?: string | null;
|
|
2132
2137
|
};
|
|
2133
|
-
type
|
|
2134
|
-
|
|
2135
|
-
/** optional version field, should be made required */version?: number;
|
|
2136
|
-
reducer: Reducer<TState>;
|
|
2137
|
-
actions: Actions;
|
|
2138
|
-
utils: DocumentModelUtils<TState>;
|
|
2139
|
-
documentModel: DocumentModelPHState;
|
|
2138
|
+
type AttachmentInput = Attachment & {
|
|
2139
|
+
hash: string;
|
|
2140
2140
|
};
|
|
2141
|
-
type
|
|
2142
|
-
|
|
2143
|
-
documentModels: DocumentModelModule<TState>[];
|
|
2144
|
-
editors: EditorModule[];
|
|
2145
|
-
subgraphs: SubgraphModule[];
|
|
2146
|
-
importScripts: ImportScriptModule[];
|
|
2147
|
-
upgradeManifests: UpgradeManifest<readonly number[]>[] | undefined;
|
|
2148
|
-
processorFactory: ProcessorFactoryBuilder;
|
|
2141
|
+
type ActionWithAttachment = Action & {
|
|
2142
|
+
attachments: AttachmentInput[];
|
|
2149
2143
|
};
|
|
2150
|
-
|
|
2144
|
+
/**
|
|
2145
|
+
* String type representing an attachment in a Document.
|
|
2146
|
+
*
|
|
2147
|
+
* @remarks
|
|
2148
|
+
* Attachment string is formatted as `attachment://<filename>`.
|
|
2149
|
+
*/
|
|
2150
|
+
type AttachmentRef = string;
|
|
2151
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=
|
|
2152
|
+
export { setName as $, ReorderOperationExamplesAction as $a, MutationReorderOperationExamplesArgs as $i, CreateChildDocumentInput as $n, SetOperationScopeInput as $o, Exact as $r, ProcessorFactory as $s, sortMappedOperations as $t, noop as A, PHStateReducer as Aa, MoveOperationAction as Ai, ActionVerificationHandler as An, SetModuleDescriptionInput as Ao, DocumentModelLib as Ar, ValidationError as As, garbageCollectDocumentOperations as At, reorderModules as B, Reducer as Ba, MutationDeleteModuleArgs as Bi, AddOperationExampleInput as Bn, SetOperationErrorDescriptionAction as Bo, DocumentModelOperationOperations as Br, HashAlgorithms as Bs, mapSkippedOperationsV2 as Bt, deleteOperation as C, MutationUpdateOperationExampleArgs as Ca, MakeOptional as Ci, defaultDocumentState as Cn, SetModelExtensionAction as Co, DocumentModelAction as Cr, UpdateOperationExampleAction as Cs, baseCreateDocument as Ct, documentModelActions as D, OperationIndex as Da, Meta as Di, ActionErrorCallback as Dn, SetModelNameAction as Do, DocumentModelHeaderAction as Dr, UpgradeDocumentAction as Ds, filterDocumentOperationsResultingState as Dt, deleteStateExample as E, OperationErrorSpecification as Ea, Maybe as Ei, defaultPHState as En, SetModelIdInput as Eo, DocumentModelGlobalState as Er, UpdateStateExampleInput as Es, diffOperations as Et, prune as F, PruneActionInput as Fa, MutationAddOperationArgs as Fi, AddModuleInput as Fn, SetNameOperation as Fo, DocumentModelOperationAction as Fr, createNamespacedQueryBuilder as Fs, isDocumentAction as Ft, setAuthorWebsite as G, ReorderChangeLogItemsAction as Ga, MutationLoadStateArgs as Gi, AddStateExampleInput as Gn, SetOperationErrorTemplateInput as Go, DocumentModelVersioningAction as Gr, IRelationalQueryMethods as Gs, precedes as Gt, reorderOperationExamples as H, ReleaseNewVersionAction as Ha, MutationDeleteOperationErrorArgs as Hi, AddRelationshipAction as Hn, SetOperationErrorNameAction as Ho, DocumentModelStateAction as Hr, IRelationalDb as Hs, nextSkipNumber as Ht, redo as I, Query as Ia, MutationAddOperationErrorArgs as Ii, AddOperationAction as In, SetOperationDescriptionAction as Io, DocumentModelOperationErrorAction as Ir, createRelationalDb as Is, isNoopOperation as It, setModelExtension as J, ReorderModuleOperationsInput as Ja, MutationRedoArgs as Ji, AssertIsStateOfType as Jn, SetOperationReducerAction as Jo, DocumentSpecification as Jr, IProcessor as Js, removeExistingOperations as Jt, setInitialState as K, ReorderChangeLogItemsInput as Ka, MutationMoveOperationArgs as Ki, App as Kn, SetOperationNameAction as Ko, DocumentModelVersioningOperations as Kr, RelationalDbProcessor as Ks, prepareOperations as Kt, releaseNewVersion as L, Redo as La, MutationAddOperationExampleArgs as Li, AddOperationErrorAction as Ln, SetOperationDescriptionInput as Lo, DocumentModelOperationErrorOperations as Lr, hashNamespace as Ls, isUndo as Lt, operationFromAction as M, PartialState as Ma, Mutation as Mi, AddChangeLogItemAction as Mn, SetModuleNameInput as Mo, DocumentModelModule as Mr, UpgradeReducer as Ms, getDocumentLastModified as Mt, operationFromOperation as N, Prune as Na, MutationAddChangeLogItemInputArgs as Ni, AddChangeLogItemInput as Nn, SetNameAction as No, DocumentModelModuleAction as Nr, UpgradeTransition as Ns, groupOperationsByScope as Nt, loadState as O, OperationSpecification as Oa, MinimalBackupData as Oi, ActionSignatureContext as On, SetModelNameInput as Oo, DocumentModelHeaderOperations as Or, UpgradeDocumentActionInput as Os, filterDuplicatedOperations as Ot, operationWithContext as P, PruneAction as Pa, MutationAddModuleArgs as Pi, AddModuleAction as Pn, SetNameActionInput as Po, DocumentModelModuleOperations as Pr, createNamespacedDb as Ps, hashDocumentStateForScope as Pt, setModuleName as Q, ReorderOperationErrorsInput as Qa, MutationReorderOperationErrorsArgs as Qi, CopyChildDocumentSignal as Qn, SetOperationScopeAction as Qo, EditorProps as Qr, ProcessorApps as Qs, skipHeaderOperations as Qt, reorderChangeLogItems as R, RedoAction as Ra, MutationAddStateExampleArgs as Ri, AddOperationErrorInput as Rn, SetOperationErrorCodeAction as Ro, DocumentModelOperationExampleAction as Rr, relationalDbToQueryBuilder as Rs, isUndoRedo as Rt, deleteModule as S, MutationUpdateChangeLogItemInputArgs as Sa, MakeMaybe as Si, defaultBaseState as Sn, SetModelDescriptionInput as So, DocumentFile as Sr, UpdateChangeLogItemInput as Ss, attachBranch as St, deleteOperationExample as T, NOOPAction as Ta, MappedOperation as Ti, defaultLocalState as Tn, SetModelIdAction as To, DocumentModelDocumentModelModule as Tr, UpdateStateExampleAction as Ts, checkOperationsIntegrity as Tt, reorderStateExamples as U, RemoveRelationshipAction as Ua, MutationDeleteOperationExampleArgs as Ui, AddRelationshipActionInput as Un, SetOperationErrorNameInput as Uo, DocumentModelStateOperations as Ur, IRelationalDbProcessor as Us, operationsAreEqual as Ut, reorderOperationErrors as V, ReducerOptions as Va, MutationDeleteOperationArgs as Vi, AddOperationInput as Vn, SetOperationErrorDescriptionInput as Vo, DocumentModelPHState as Vr, IBaseRelationalDb as Vs, merge as Vt, setAuthorName as W, RemoveRelationshipActionInput as Wa, MutationDeleteStateExampleArgs as Wi, AddStateExampleAction as Wn, SetOperationErrorTemplateAction as Wo, DocumentModelUtils as Wr, IRelationalQueryBuilder as Ws, parseResultingState as Wt, setModelName as X, ReorderModulesInput as Xa, MutationReorderModuleOperationsArgs as Xi, CodeExample as Xn, SetOperationSchemaAction as Xo, EditorDispatch as Xr, IProcessorManager as Xs, reshuffleByTimestamp as Xt, setModelId as Y, ReorderModulesAction as Ya, MutationReorderChangeLogItemsInputArgs as Yi, Author as Yn, SetOperationReducerInput as Yo, ENSInfo as Yr, IProcessorHostModule as Ys, replayDocument as Yt, setModuleDescription as Z, ReorderOperationErrorsAction as Za, MutationReorderModulesArgs as Zi, CopyChildDocumentInput as Zn, SetOperationSchemaInput as Zo, EditorModule as Zr, ProcessorApp as Zs, reshuffleByTimestampAndIndex as Zt, baseActions as _, MutationSetOperationReducerArgs as _a, LoadStateAction as _i, createDocumentState as _n, SetAuthorWebsiteAction as _o, DeleteOperationExampleInput as _r, Undo as _s, IntegrityIssueType as _t, AttachmentInput as a, MutationSetModelExtensionArgs as aa, DEFAULT_ANALYTICS_PROCESSOR_DB_NAME as ac, IDocument as ai, OperationContext as an, SaveToFile as ao, DeleteChangeLogItemAction as ar, Signal as as, setOperationName as at, createAction as b, MutationSetStateSchemaArgs as ba, Load_State as bi, createState as bn, SetInitialStateInput as bo, DeleteStateExampleInput as br, UndoRedoAction as bs, PHDocumentMeta as bt, actionFromAction as c, MutationSetModuleDescriptionArgs as ca, ActionSigner as cc, ISignalResult as ci, redoOperation as cn, SchemaLoadStateAction as co, DeleteChildDocumentSignal as cr, SignalResults as cs, setOperationScope as ct, addChangeLogItem as d, MutationSetOperationDescriptionArgs as da, PHDocumentSignatureInfo as dc, Incremental as di, undoOperationV2 as dn, SchemaRedoAction as do, DeleteModuleAction as dr, SigningParameters as ds, undo as dt, MutationReorderStateExamplesArgs as ea, ProcessorFactoryBuilder as ec, FileInput as ei, sortOperations as en, ReorderOperationExamplesInput as eo, CreateChildDocumentSignal as er, SetOperationTemplateAction as es, setOperationDescription as et, addModule as f, MutationSetOperationErrorCodeArgs as fa, Signature as fc, InputMaybe as fi, PHAuthState as fn, SchemaSetNameAction as fo, DeleteModuleInput as fr, SkipHeaderOperationIndex as fs, updateChangeLogItem as ft, addStateExample as g, MutationSetOperationNameArgs as ga, LoadFromInput as gi, createBaseState as gn, SetAuthorNameInput as go, DeleteOperationExampleAction as gr, SubgraphModule as gs, IntegrityIssueSubType as gt, addOperationExample as h, MutationSetOperationErrorTemplateArgs as ha, LoadFromFile as hi, createAuthState as hn, SetAuthorNameAction as ho, DeleteOperationErrorInput as hr, StateReducer as hs, verifyOperationSignature as ht, Attachment as i, MutationSetModelDescriptionArgs as ia, TrackedProcessor as ic, ID as ii, Operation as in, RevisionsFilter as io, CreateState as ir, Set_Name as is, setOperationErrorTemplate as it, operationExampleCreators as j, PartialRecord as ja, MoveOperationInput as ji, Actions as jn, SetModuleNameAction as jo, DocumentModelLocalState as jr, UpgradeManifest as js, garbageCollectV2 as jt, moveOperation as k, OperationsByScope as ka, ModuleSpecification as ki, ActionSigningHandler as kn, SetModuleDescriptionAction as ko, DocumentModelInput as kr, User as ks, garbageCollect as kt, actionSigner as l, MutationSetModuleNameArgs as la, AppActionSigner as lc, ISigner as li, setNameOperation as ln, SchemaNOOPAction as lo, DeleteDocumentAction as lr, SignalType as ls, setOperationTemplate as lt, addOperationError as m, MutationSetOperationErrorNameArgs as ma, IsStateOfType as mi, PHDocumentState as mn, ScopeState as mo, DeleteOperationErrorAction as mr, State as ms, updateStateExample as mt, ActionContext as n, MutationSetAuthorWebsiteArgs as na, ProcessorRecord as nc, GetDocumentOptions as ni, updateHeaderRevision as nn, ReorderStateExamplesInput as no, CreateDocumentAction as nr, SetStateSchemaAction as ns, setOperationErrorDescription as nt, AttachmentRef as o, MutationSetModelIdArgs as oa, DEFAULT_RELATIONAL_PROCESSOR_DB_NAME as oc, IOperation as oi, OperationWithContext$1 as on, SaveToFileHandle as oo, DeleteChangeLogItemInput as or, SignalDispatch as os, setOperationReducer as ot, addOperation as p, MutationSetOperationErrorDescriptionArgs as pa, UserActionSigner as pc, IsDocumentOfType as pi, PHBaseState as pn, SchemaUndoAction as po, DeleteOperationAction as pr, SkipHeaderOperations as ps, updateOperationExample as pt, setModelDescription as q, ReorderModuleOperationsAction as qa, MutationPruneArgs as qi, AssertIsDocumentOfType as qn, SetOperationNameInput as qo, DocumentOperationsIgnoreMap as qr, RelationalDbProcessorClass as qs, readOnly as qt, ActionWithAttachment as r, MutationSetInitialStateArgs as ra, ProcessorStatus as rc, IAction as ri, DocumentOperations as rn, ReplayDocumentOptions as ro, CreateDocumentActionInput as rr, SetStateSchemaInput as rs, setOperationErrorName as rt, actionContext as s, MutationSetModelNameArgs as sa, PROCESSOR_APPS as sc, ISignal as si, loadStateOperation as sn, Scalars as so, DeleteChildDocumentInput as sr, SignalResult as ss, setOperationSchema as st, Action as t, MutationSetAuthorNameArgs as ta, ProcessorFilter as tc, FileRegistry as ti, split as tn, ReorderStateExamplesAction as to, CreateDocument as tr, SetOperationTemplateInput as ts, setOperationErrorCode as tt, actions as u, MutationSetNameArgs as ua, HashConfig as uc, ImportScriptModule as ui, undoOperation as un, SchemaPruneAction as uo, DeleteDocumentActionInput as ur, SignatureVerificationHandler as us, setStateSchema as ut, buildOperationSignature as v, MutationSetOperationSchemaArgs as va, LoadStateActionInput as vi, createGlobalState as vn, SetAuthorWebsiteInput as vo, DeleteOperationInput as vr, UndoAction as vs, PHDocument as vt, deleteOperationError as w, MutationUpdateStateExampleArgs as wa, Manifest as wi, defaultGlobalState as wn, SetModelExtensionInput as wo, DocumentModelDocument as wr, UpdateOperationExampleInput as ws, checkCleanedOperationsIntegrity as wt, deleteChangeLogItem as x, MutationUndoArgs as xa, MakeEmpty as xi, defaultAuthState as xn, SetModelDescriptionAction as xo, DocumentAction as xr, UpdateChangeLogItemAction as xs, addUndo as xt, buildSignedAction as y, MutationSetOperationTemplateArgs as ya, LoadStateActionStateInput as yi, createLocalState as yn, SetInitialStateAction as yo, DeleteStateExampleAction as yr, UndoActionInput as ys, PHDocumentHeader as yt, reorderModuleOperations as z, RedoActionInput as za, MutationDeleteChangeLogItemInputArgs as zi, AddOperationExampleAction as zn, SetOperationErrorCodeInput as zo, DocumentModelOperationExampleOperations as zr, ExtractProcessorSchemaOrSelf as zs, mapSkippedOperations as zt };
|
|
2153
|
+
//# sourceMappingURL=actions-3-rhhWx6.d.ts.map
|