@stonecrop/stonecrop 0.6.2 → 0.7.0
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/src/index.d.ts +4 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +5 -0
- package/dist/src/schema-validator.d.ts +132 -0
- package/dist/src/schema-validator.d.ts.map +1 -0
- package/dist/src/schema-validator.js +315 -0
- package/dist/src/tsdoc-metadata.json +1 -1
- package/dist/stonecrop.d.ts +187 -72
- package/dist/stonecrop.js +1095 -884
- package/dist/stonecrop.js.map +1 -1
- package/dist/stonecrop.umd.cjs +3 -7
- package/dist/stonecrop.umd.cjs.map +1 -1
- package/package.json +20 -20
- package/src/index.ts +9 -0
- package/src/schema-validator.ts +427 -0
package/dist/stonecrop.d.ts
CHANGED
|
@@ -2,25 +2,14 @@ import type { AnyStateNodeConfig } from 'xstate';
|
|
|
2
2
|
import { Component } from 'vue';
|
|
3
3
|
import { ComputedRef } from 'vue';
|
|
4
4
|
import { CSSProperties } from 'vue';
|
|
5
|
-
import { HSTOperation as HSTOperation_2 } from './types';
|
|
6
|
-
import { HSTOperation as HSTOperation_3 } from '..';
|
|
7
|
-
import { HSTOperationInput as HSTOperationInput_2 } from './types';
|
|
8
|
-
import { HSTOperationType as HSTOperationType_2 } from './types';
|
|
9
|
-
import { HSTOperationType as HSTOperationType_3 } from '..';
|
|
10
5
|
import { List } from 'immutable';
|
|
11
6
|
import { Map as Map_2 } from 'immutable';
|
|
12
|
-
import { OperationLogSnapshot as OperationLogSnapshot_2 } from './types';
|
|
13
|
-
import { OperationLogSnapshot as OperationLogSnapshot_3 } from '..';
|
|
14
|
-
import { OperationSource as OperationSource_2 } from './types';
|
|
15
|
-
import { OperationSource as OperationSource_3 } from '..';
|
|
16
7
|
import { Plugin as Plugin_2 } from 'vue';
|
|
17
8
|
import { Ref } from 'vue';
|
|
18
9
|
import { Router } from 'vue-router';
|
|
19
10
|
import type { ShallowRef } from 'vue';
|
|
20
11
|
import { Store } from 'pinia';
|
|
21
12
|
import { StoreDefinition } from 'pinia';
|
|
22
|
-
import { UndoRedoState as UndoRedoState_2 } from './types';
|
|
23
|
-
import { UndoRedoState as UndoRedoState_3 } from '..';
|
|
24
13
|
import type { UnknownMachineConfig } from 'xstate';
|
|
25
14
|
import { useElementBounding } from '@vueuse/core';
|
|
26
15
|
import { WritableComputedRef } from 'vue';
|
|
@@ -184,7 +173,7 @@ export declare type ComponentProps = {
|
|
|
184
173
|
* Indicate whether elements inside the component are read-only
|
|
185
174
|
* @public
|
|
186
175
|
*/
|
|
187
|
-
|
|
176
|
+
readOnly?: boolean;
|
|
188
177
|
/**
|
|
189
178
|
* Set a unique identifier for elements inside the component
|
|
190
179
|
* @public
|
|
@@ -318,7 +307,7 @@ name: string;
|
|
|
318
307
|
align?: CanvasTextAlign | undefined;
|
|
319
308
|
edit?: boolean | undefined;
|
|
320
309
|
label?: string | undefined;
|
|
321
|
-
|
|
310
|
+
fieldtype?: string | undefined;
|
|
322
311
|
width?: string | undefined;
|
|
323
312
|
pinned?: boolean | undefined;
|
|
324
313
|
resizable?: boolean | undefined;
|
|
@@ -342,7 +331,7 @@ name: string;
|
|
|
342
331
|
align?: CanvasTextAlign | undefined;
|
|
343
332
|
edit?: boolean | undefined;
|
|
344
333
|
label?: string | undefined;
|
|
345
|
-
|
|
334
|
+
fieldtype?: string | undefined;
|
|
346
335
|
width?: string | undefined;
|
|
347
336
|
pinned?: boolean | undefined;
|
|
348
337
|
resizable?: boolean | undefined;
|
|
@@ -612,7 +601,7 @@ name: string;
|
|
|
612
601
|
align?: CanvasTextAlign | undefined;
|
|
613
602
|
edit?: boolean | undefined;
|
|
614
603
|
label?: string | undefined;
|
|
615
|
-
|
|
604
|
+
fieldtype?: string | undefined;
|
|
616
605
|
width?: string | undefined;
|
|
617
606
|
pinned?: boolean | undefined;
|
|
618
607
|
resizable?: boolean | undefined;
|
|
@@ -636,7 +625,7 @@ name: string;
|
|
|
636
625
|
align?: CanvasTextAlign | undefined;
|
|
637
626
|
edit?: boolean | undefined;
|
|
638
627
|
label?: string | undefined;
|
|
639
|
-
|
|
628
|
+
fieldtype?: string | undefined;
|
|
640
629
|
width?: string | undefined;
|
|
641
630
|
pinned?: boolean | undefined;
|
|
642
631
|
resizable?: boolean | undefined;
|
|
@@ -906,7 +895,7 @@ name: string;
|
|
|
906
895
|
align?: CanvasTextAlign | undefined;
|
|
907
896
|
edit?: boolean | undefined;
|
|
908
897
|
label?: string | undefined;
|
|
909
|
-
|
|
898
|
+
fieldtype?: string | undefined;
|
|
910
899
|
width?: string | undefined;
|
|
911
900
|
pinned?: boolean | undefined;
|
|
912
901
|
resizable?: boolean | undefined;
|
|
@@ -930,7 +919,7 @@ name: string;
|
|
|
930
919
|
align?: CanvasTextAlign | undefined;
|
|
931
920
|
edit?: boolean | undefined;
|
|
932
921
|
label?: string | undefined;
|
|
933
|
-
|
|
922
|
+
fieldtype?: string | undefined;
|
|
934
923
|
width?: string | undefined;
|
|
935
924
|
pinned?: boolean | undefined;
|
|
936
925
|
resizable?: boolean | undefined;
|
|
@@ -1196,6 +1185,15 @@ updateGanttBar: (event: GanttDragEvent) => void;
|
|
|
1196
1185
|
updateRows: (newRows: TableRow[]) => void;
|
|
1197
1186
|
}, "clearFilter" | "closeModal" | "createConnection" | "deleteConnection" | "getCellData" | "getCellDisplayValue" | "getConnectionsForBar" | "getFormattedValue" | "getHandlesForBar" | "getHeaderCellStyle" | "getIndent" | "getRowExpandSymbol" | "isRowGantt" | "isRowVisible" | "registerConnectionHandle" | "registerGanttBar" | "resizeColumn" | "setCellData" | "setCellText" | "setFilter" | "sortByColumn" | "toggleRowExpand" | "unregisterConnectionHandle" | "unregisterGanttBar" | "updateGanttBar" | "updateRows">>;
|
|
1198
1187
|
|
|
1188
|
+
/**
|
|
1189
|
+
* Creates a validator with the given registry
|
|
1190
|
+
* @param registry - Registry instance
|
|
1191
|
+
* @param options - Additional validator options
|
|
1192
|
+
* @returns SchemaValidator instance
|
|
1193
|
+
* @public
|
|
1194
|
+
*/
|
|
1195
|
+
export declare function createValidator(registry: Registry, options?: Partial<ValidatorOptions>): SchemaValidator;
|
|
1196
|
+
|
|
1199
1197
|
/**
|
|
1200
1198
|
* Cross-tab message payload
|
|
1201
1199
|
* @public
|
|
@@ -2172,6 +2170,48 @@ export declare type Schema = {
|
|
|
2172
2170
|
*/
|
|
2173
2171
|
export declare type SchemaTypes = FormSchema | TableSchema | FieldsetSchema;
|
|
2174
2172
|
|
|
2173
|
+
/**
|
|
2174
|
+
* Schema validator class
|
|
2175
|
+
* @public
|
|
2176
|
+
*/
|
|
2177
|
+
export declare class SchemaValidator {
|
|
2178
|
+
private options;
|
|
2179
|
+
/**
|
|
2180
|
+
* Creates a new SchemaValidator instance
|
|
2181
|
+
* @param options - Validator configuration options
|
|
2182
|
+
*/
|
|
2183
|
+
constructor(options?: ValidatorOptions);
|
|
2184
|
+
/**
|
|
2185
|
+
* Validates a complete doctype schema
|
|
2186
|
+
* @param doctype - Doctype name
|
|
2187
|
+
* @param schema - Schema fields (List or Array)
|
|
2188
|
+
* @param workflow - Optional workflow configuration
|
|
2189
|
+
* @param actions - Optional actions map
|
|
2190
|
+
* @returns Validation result
|
|
2191
|
+
*/
|
|
2192
|
+
validate(doctype: string, schema: List<SchemaTypes> | SchemaTypes[] | undefined, workflow?: AnyStateNodeConfig, actions?: Map_2<string, string[]> | Map<string, string[]>): ValidationResult;
|
|
2193
|
+
/**
|
|
2194
|
+
* Validates that required schema properties are present
|
|
2195
|
+
* @internal
|
|
2196
|
+
*/
|
|
2197
|
+
private validateRequiredProperties;
|
|
2198
|
+
/**
|
|
2199
|
+
* Validates Link field targets exist in registry
|
|
2200
|
+
* @internal
|
|
2201
|
+
*/
|
|
2202
|
+
private validateLinkFields;
|
|
2203
|
+
/**
|
|
2204
|
+
* Validates workflow state machine configuration
|
|
2205
|
+
* @internal
|
|
2206
|
+
*/
|
|
2207
|
+
private validateWorkflow;
|
|
2208
|
+
/**
|
|
2209
|
+
* Validates that actions are registered in the FieldTriggerEngine
|
|
2210
|
+
* @internal
|
|
2211
|
+
*/
|
|
2212
|
+
private validateActionRegistration;
|
|
2213
|
+
}
|
|
2214
|
+
|
|
2175
2215
|
/**
|
|
2176
2216
|
* Configure rollback behavior for a specific field trigger
|
|
2177
2217
|
* @param doctype - The doctype name
|
|
@@ -2204,7 +2244,7 @@ export declare class Stonecrop {
|
|
|
2204
2244
|
getOperationLogStore(): Store<"hst-operation-log", Pick<{
|
|
2205
2245
|
operations: Ref< {
|
|
2206
2246
|
id: string;
|
|
2207
|
-
type:
|
|
2247
|
+
type: HSTOperationType;
|
|
2208
2248
|
path: string;
|
|
2209
2249
|
fieldname: string;
|
|
2210
2250
|
beforeValue: any;
|
|
@@ -2212,7 +2252,7 @@ export declare class Stonecrop {
|
|
|
2212
2252
|
doctype: string;
|
|
2213
2253
|
recordId?: string | undefined;
|
|
2214
2254
|
timestamp: Date;
|
|
2215
|
-
source?:
|
|
2255
|
+
source?: OperationSource | undefined;
|
|
2216
2256
|
reversible: boolean;
|
|
2217
2257
|
irreversibleReason?: string | undefined;
|
|
2218
2258
|
transition?: string | undefined;
|
|
@@ -2226,9 +2266,9 @@ export declare class Stonecrop {
|
|
|
2226
2266
|
metadata?: Record<string, any> | undefined;
|
|
2227
2267
|
parentOperationId?: string | undefined;
|
|
2228
2268
|
childOperationIds?: string[] | undefined;
|
|
2229
|
-
}[],
|
|
2269
|
+
}[], HSTOperation[] | {
|
|
2230
2270
|
id: string;
|
|
2231
|
-
type:
|
|
2271
|
+
type: HSTOperationType;
|
|
2232
2272
|
path: string;
|
|
2233
2273
|
fieldname: string;
|
|
2234
2274
|
beforeValue: any;
|
|
@@ -2236,7 +2276,7 @@ export declare class Stonecrop {
|
|
|
2236
2276
|
doctype: string;
|
|
2237
2277
|
recordId?: string | undefined;
|
|
2238
2278
|
timestamp: Date;
|
|
2239
|
-
source?:
|
|
2279
|
+
source?: OperationSource | undefined;
|
|
2240
2280
|
reversible: boolean;
|
|
2241
2281
|
irreversibleReason?: string | undefined;
|
|
2242
2282
|
transition?: string | undefined;
|
|
@@ -2259,7 +2299,7 @@ export declare class Stonecrop {
|
|
|
2259
2299
|
enablePersistence?: boolean | undefined;
|
|
2260
2300
|
persistenceKeyPrefix?: string | undefined;
|
|
2261
2301
|
userId?: string | undefined;
|
|
2262
|
-
operationFilter?: ((operation:
|
|
2302
|
+
operationFilter?: ((operation: HSTOperation) => boolean) | undefined;
|
|
2263
2303
|
}, OperationLogConfig | {
|
|
2264
2304
|
maxOperations?: number | undefined;
|
|
2265
2305
|
enableCrossTabSync?: boolean | undefined;
|
|
@@ -2267,30 +2307,30 @@ export declare class Stonecrop {
|
|
|
2267
2307
|
enablePersistence?: boolean | undefined;
|
|
2268
2308
|
persistenceKeyPrefix?: string | undefined;
|
|
2269
2309
|
userId?: string | undefined;
|
|
2270
|
-
operationFilter?: ((operation:
|
|
2310
|
+
operationFilter?: ((operation: HSTOperation) => boolean) | undefined;
|
|
2271
2311
|
}>;
|
|
2272
2312
|
clientId: Ref<string, string>;
|
|
2273
|
-
undoRedoState: ComputedRef<
|
|
2313
|
+
undoRedoState: ComputedRef<UndoRedoState>;
|
|
2274
2314
|
canUndo: ComputedRef<boolean>;
|
|
2275
2315
|
canRedo: ComputedRef<boolean>;
|
|
2276
2316
|
undoCount: ComputedRef<number>;
|
|
2277
2317
|
redoCount: ComputedRef<number>;
|
|
2278
2318
|
configure: (options: Partial<OperationLogConfig>) => void;
|
|
2279
|
-
addOperation: (operation:
|
|
2319
|
+
addOperation: (operation: HSTOperationInput, source?: OperationSource) => string;
|
|
2280
2320
|
startBatch: () => void;
|
|
2281
2321
|
commitBatch: (description?: string) => string | null;
|
|
2282
2322
|
cancelBatch: () => void;
|
|
2283
2323
|
undo: (store: HSTNode) => boolean;
|
|
2284
2324
|
redo: (store: HSTNode) => boolean;
|
|
2285
2325
|
clear: () => void;
|
|
2286
|
-
getOperationsFor: (doctype: string, recordId?: string) =>
|
|
2287
|
-
getSnapshot: () =>
|
|
2326
|
+
getOperationsFor: (doctype: string, recordId?: string) => HSTOperation[];
|
|
2327
|
+
getSnapshot: () => OperationLogSnapshot;
|
|
2288
2328
|
markIrreversible: (operationId: string, reason: string) => void;
|
|
2289
2329
|
logAction: (doctype: string, actionName: string, recordIds?: string[], result?: "success" | "failure" | "pending", error?: string) => string;
|
|
2290
2330
|
}, "operations" | "clientId" | "currentIndex" | "config">, Pick<{
|
|
2291
2331
|
operations: Ref< {
|
|
2292
2332
|
id: string;
|
|
2293
|
-
type:
|
|
2333
|
+
type: HSTOperationType;
|
|
2294
2334
|
path: string;
|
|
2295
2335
|
fieldname: string;
|
|
2296
2336
|
beforeValue: any;
|
|
@@ -2298,7 +2338,7 @@ export declare class Stonecrop {
|
|
|
2298
2338
|
doctype: string;
|
|
2299
2339
|
recordId?: string | undefined;
|
|
2300
2340
|
timestamp: Date;
|
|
2301
|
-
source?:
|
|
2341
|
+
source?: OperationSource | undefined;
|
|
2302
2342
|
reversible: boolean;
|
|
2303
2343
|
irreversibleReason?: string | undefined;
|
|
2304
2344
|
transition?: string | undefined;
|
|
@@ -2312,9 +2352,9 @@ export declare class Stonecrop {
|
|
|
2312
2352
|
metadata?: Record<string, any> | undefined;
|
|
2313
2353
|
parentOperationId?: string | undefined;
|
|
2314
2354
|
childOperationIds?: string[] | undefined;
|
|
2315
|
-
}[],
|
|
2355
|
+
}[], HSTOperation[] | {
|
|
2316
2356
|
id: string;
|
|
2317
|
-
type:
|
|
2357
|
+
type: HSTOperationType;
|
|
2318
2358
|
path: string;
|
|
2319
2359
|
fieldname: string;
|
|
2320
2360
|
beforeValue: any;
|
|
@@ -2322,7 +2362,7 @@ export declare class Stonecrop {
|
|
|
2322
2362
|
doctype: string;
|
|
2323
2363
|
recordId?: string | undefined;
|
|
2324
2364
|
timestamp: Date;
|
|
2325
|
-
source?:
|
|
2365
|
+
source?: OperationSource | undefined;
|
|
2326
2366
|
reversible: boolean;
|
|
2327
2367
|
irreversibleReason?: string | undefined;
|
|
2328
2368
|
transition?: string | undefined;
|
|
@@ -2345,7 +2385,7 @@ export declare class Stonecrop {
|
|
|
2345
2385
|
enablePersistence?: boolean | undefined;
|
|
2346
2386
|
persistenceKeyPrefix?: string | undefined;
|
|
2347
2387
|
userId?: string | undefined;
|
|
2348
|
-
operationFilter?: ((operation:
|
|
2388
|
+
operationFilter?: ((operation: HSTOperation) => boolean) | undefined;
|
|
2349
2389
|
}, OperationLogConfig | {
|
|
2350
2390
|
maxOperations?: number | undefined;
|
|
2351
2391
|
enableCrossTabSync?: boolean | undefined;
|
|
@@ -2353,30 +2393,30 @@ export declare class Stonecrop {
|
|
|
2353
2393
|
enablePersistence?: boolean | undefined;
|
|
2354
2394
|
persistenceKeyPrefix?: string | undefined;
|
|
2355
2395
|
userId?: string | undefined;
|
|
2356
|
-
operationFilter?: ((operation:
|
|
2396
|
+
operationFilter?: ((operation: HSTOperation) => boolean) | undefined;
|
|
2357
2397
|
}>;
|
|
2358
2398
|
clientId: Ref<string, string>;
|
|
2359
|
-
undoRedoState: ComputedRef<
|
|
2399
|
+
undoRedoState: ComputedRef<UndoRedoState>;
|
|
2360
2400
|
canUndo: ComputedRef<boolean>;
|
|
2361
2401
|
canRedo: ComputedRef<boolean>;
|
|
2362
2402
|
undoCount: ComputedRef<number>;
|
|
2363
2403
|
redoCount: ComputedRef<number>;
|
|
2364
2404
|
configure: (options: Partial<OperationLogConfig>) => void;
|
|
2365
|
-
addOperation: (operation:
|
|
2405
|
+
addOperation: (operation: HSTOperationInput, source?: OperationSource) => string;
|
|
2366
2406
|
startBatch: () => void;
|
|
2367
2407
|
commitBatch: (description?: string) => string | null;
|
|
2368
2408
|
cancelBatch: () => void;
|
|
2369
2409
|
undo: (store: HSTNode) => boolean;
|
|
2370
2410
|
redo: (store: HSTNode) => boolean;
|
|
2371
2411
|
clear: () => void;
|
|
2372
|
-
getOperationsFor: (doctype: string, recordId?: string) =>
|
|
2373
|
-
getSnapshot: () =>
|
|
2412
|
+
getOperationsFor: (doctype: string, recordId?: string) => HSTOperation[];
|
|
2413
|
+
getSnapshot: () => OperationLogSnapshot;
|
|
2374
2414
|
markIrreversible: (operationId: string, reason: string) => void;
|
|
2375
2415
|
logAction: (doctype: string, actionName: string, recordIds?: string[], result?: "success" | "failure" | "pending", error?: string) => string;
|
|
2376
2416
|
}, "undoRedoState" | "canUndo" | "canRedo" | "undoCount" | "redoCount">, Pick<{
|
|
2377
2417
|
operations: Ref< {
|
|
2378
2418
|
id: string;
|
|
2379
|
-
type:
|
|
2419
|
+
type: HSTOperationType;
|
|
2380
2420
|
path: string;
|
|
2381
2421
|
fieldname: string;
|
|
2382
2422
|
beforeValue: any;
|
|
@@ -2384,7 +2424,7 @@ export declare class Stonecrop {
|
|
|
2384
2424
|
doctype: string;
|
|
2385
2425
|
recordId?: string | undefined;
|
|
2386
2426
|
timestamp: Date;
|
|
2387
|
-
source?:
|
|
2427
|
+
source?: OperationSource | undefined;
|
|
2388
2428
|
reversible: boolean;
|
|
2389
2429
|
irreversibleReason?: string | undefined;
|
|
2390
2430
|
transition?: string | undefined;
|
|
@@ -2398,9 +2438,9 @@ export declare class Stonecrop {
|
|
|
2398
2438
|
metadata?: Record<string, any> | undefined;
|
|
2399
2439
|
parentOperationId?: string | undefined;
|
|
2400
2440
|
childOperationIds?: string[] | undefined;
|
|
2401
|
-
}[],
|
|
2441
|
+
}[], HSTOperation[] | {
|
|
2402
2442
|
id: string;
|
|
2403
|
-
type:
|
|
2443
|
+
type: HSTOperationType;
|
|
2404
2444
|
path: string;
|
|
2405
2445
|
fieldname: string;
|
|
2406
2446
|
beforeValue: any;
|
|
@@ -2408,7 +2448,7 @@ export declare class Stonecrop {
|
|
|
2408
2448
|
doctype: string;
|
|
2409
2449
|
recordId?: string | undefined;
|
|
2410
2450
|
timestamp: Date;
|
|
2411
|
-
source?:
|
|
2451
|
+
source?: OperationSource | undefined;
|
|
2412
2452
|
reversible: boolean;
|
|
2413
2453
|
irreversibleReason?: string | undefined;
|
|
2414
2454
|
transition?: string | undefined;
|
|
@@ -2431,7 +2471,7 @@ export declare class Stonecrop {
|
|
|
2431
2471
|
enablePersistence?: boolean | undefined;
|
|
2432
2472
|
persistenceKeyPrefix?: string | undefined;
|
|
2433
2473
|
userId?: string | undefined;
|
|
2434
|
-
operationFilter?: ((operation:
|
|
2474
|
+
operationFilter?: ((operation: HSTOperation) => boolean) | undefined;
|
|
2435
2475
|
}, OperationLogConfig | {
|
|
2436
2476
|
maxOperations?: number | undefined;
|
|
2437
2477
|
enableCrossTabSync?: boolean | undefined;
|
|
@@ -2439,24 +2479,24 @@ export declare class Stonecrop {
|
|
|
2439
2479
|
enablePersistence?: boolean | undefined;
|
|
2440
2480
|
persistenceKeyPrefix?: string | undefined;
|
|
2441
2481
|
userId?: string | undefined;
|
|
2442
|
-
operationFilter?: ((operation:
|
|
2482
|
+
operationFilter?: ((operation: HSTOperation) => boolean) | undefined;
|
|
2443
2483
|
}>;
|
|
2444
2484
|
clientId: Ref<string, string>;
|
|
2445
|
-
undoRedoState: ComputedRef<
|
|
2485
|
+
undoRedoState: ComputedRef<UndoRedoState>;
|
|
2446
2486
|
canUndo: ComputedRef<boolean>;
|
|
2447
2487
|
canRedo: ComputedRef<boolean>;
|
|
2448
2488
|
undoCount: ComputedRef<number>;
|
|
2449
2489
|
redoCount: ComputedRef<number>;
|
|
2450
2490
|
configure: (options: Partial<OperationLogConfig>) => void;
|
|
2451
|
-
addOperation: (operation:
|
|
2491
|
+
addOperation: (operation: HSTOperationInput, source?: OperationSource) => string;
|
|
2452
2492
|
startBatch: () => void;
|
|
2453
2493
|
commitBatch: (description?: string) => string | null;
|
|
2454
2494
|
cancelBatch: () => void;
|
|
2455
2495
|
undo: (store: HSTNode) => boolean;
|
|
2456
2496
|
redo: (store: HSTNode) => boolean;
|
|
2457
2497
|
clear: () => void;
|
|
2458
|
-
getOperationsFor: (doctype: string, recordId?: string) =>
|
|
2459
|
-
getSnapshot: () =>
|
|
2498
|
+
getOperationsFor: (doctype: string, recordId?: string) => HSTOperation[];
|
|
2499
|
+
getSnapshot: () => OperationLogSnapshot;
|
|
2460
2500
|
markIrreversible: (operationId: string, reason: string) => void;
|
|
2461
2501
|
logAction: (doctype: string, actionName: string, recordIds?: string[], result?: "success" | "failure" | "pending", error?: string) => string;
|
|
2462
2502
|
}, "undo" | "redo" | "configure" | "addOperation" | "startBatch" | "commitBatch" | "cancelBatch" | "clear" | "getOperationsFor" | "getSnapshot" | "markIrreversible" | "logAction">>;
|
|
@@ -2581,15 +2621,12 @@ export declare interface TableColumn {
|
|
|
2581
2621
|
*/
|
|
2582
2622
|
label?: string;
|
|
2583
2623
|
/**
|
|
2584
|
-
* The
|
|
2585
|
-
*
|
|
2586
|
-
* - `Select` - the column contains a select input
|
|
2587
|
-
* - `Date` - the column contains a date input
|
|
2588
|
-
* - `component` - the column contains a custom component
|
|
2624
|
+
* The semantic field type of the column. Uses the same StonecropFieldType enum as forms.
|
|
2625
|
+
* Common values: 'Data', 'Text', 'Int', 'Float', 'Date', 'Select', 'Link', 'Check', etc.
|
|
2589
2626
|
*
|
|
2590
|
-
* @
|
|
2627
|
+
* @public
|
|
2591
2628
|
*/
|
|
2592
|
-
|
|
2629
|
+
fieldtype?: string;
|
|
2593
2630
|
/**
|
|
2594
2631
|
* The width of the column. This can be a number (in pixels) or a string (in CSS units).
|
|
2595
2632
|
*
|
|
@@ -3079,7 +3116,7 @@ export declare interface UndoRedoState {
|
|
|
3079
3116
|
export declare function useOperationLog(config?: Partial<OperationLogConfig>): {
|
|
3080
3117
|
operations: Ref< {
|
|
3081
3118
|
id: string;
|
|
3082
|
-
type:
|
|
3119
|
+
type: HSTOperationType;
|
|
3083
3120
|
path: string;
|
|
3084
3121
|
fieldname: string;
|
|
3085
3122
|
beforeValue: any;
|
|
@@ -3087,7 +3124,7 @@ export declare function useOperationLog(config?: Partial<OperationLogConfig>): {
|
|
|
3087
3124
|
doctype: string;
|
|
3088
3125
|
recordId?: string | undefined;
|
|
3089
3126
|
timestamp: Date;
|
|
3090
|
-
source?:
|
|
3127
|
+
source?: OperationSource | undefined;
|
|
3091
3128
|
reversible: boolean;
|
|
3092
3129
|
irreversibleReason?: string | undefined;
|
|
3093
3130
|
transition?: string | undefined;
|
|
@@ -3101,9 +3138,9 @@ export declare function useOperationLog(config?: Partial<OperationLogConfig>): {
|
|
|
3101
3138
|
metadata?: Record<string, any> | undefined;
|
|
3102
3139
|
parentOperationId?: string | undefined;
|
|
3103
3140
|
childOperationIds?: string[] | undefined;
|
|
3104
|
-
}[],
|
|
3141
|
+
}[], HSTOperation[] | {
|
|
3105
3142
|
id: string;
|
|
3106
|
-
type:
|
|
3143
|
+
type: HSTOperationType;
|
|
3107
3144
|
path: string;
|
|
3108
3145
|
fieldname: string;
|
|
3109
3146
|
beforeValue: any;
|
|
@@ -3111,7 +3148,7 @@ export declare function useOperationLog(config?: Partial<OperationLogConfig>): {
|
|
|
3111
3148
|
doctype: string;
|
|
3112
3149
|
recordId?: string | undefined;
|
|
3113
3150
|
timestamp: Date;
|
|
3114
|
-
source?:
|
|
3151
|
+
source?: OperationSource | undefined;
|
|
3115
3152
|
reversible: boolean;
|
|
3116
3153
|
irreversibleReason?: string | undefined;
|
|
3117
3154
|
transition?: string | undefined;
|
|
@@ -3127,7 +3164,7 @@ export declare function useOperationLog(config?: Partial<OperationLogConfig>): {
|
|
|
3127
3164
|
childOperationIds?: string[] | undefined;
|
|
3128
3165
|
}[]>;
|
|
3129
3166
|
currentIndex: Ref<number, number>;
|
|
3130
|
-
undoRedoState: ComputedRef<
|
|
3167
|
+
undoRedoState: ComputedRef<UndoRedoState>;
|
|
3131
3168
|
canUndo: ComputedRef<boolean>;
|
|
3132
3169
|
canRedo: ComputedRef<boolean>;
|
|
3133
3170
|
undoCount: ComputedRef<number>;
|
|
@@ -3138,8 +3175,8 @@ export declare function useOperationLog(config?: Partial<OperationLogConfig>): {
|
|
|
3138
3175
|
commitBatch: (description?: string) => string | null;
|
|
3139
3176
|
cancelBatch: () => void;
|
|
3140
3177
|
clear: () => void;
|
|
3141
|
-
getOperationsFor: (doctype: string, recordId?: string) =>
|
|
3142
|
-
getSnapshot: () =>
|
|
3178
|
+
getOperationsFor: (doctype: string, recordId?: string) => HSTOperation[];
|
|
3179
|
+
getSnapshot: () => OperationLogSnapshot;
|
|
3143
3180
|
markIrreversible: (operationId: string, reason: string) => void;
|
|
3144
3181
|
logAction: (doctype: string, actionName: string, recordIds?: string[], result?: "success" | "failure" | "pending", error?: string) => string;
|
|
3145
3182
|
configure: (options: Partial<OperationLogConfig>) => void;
|
|
@@ -3154,7 +3191,7 @@ export declare function useOperationLog(config?: Partial<OperationLogConfig>): {
|
|
|
3154
3191
|
export declare const useOperationLogStore: StoreDefinition<"hst-operation-log", Pick<{
|
|
3155
3192
|
operations: Ref< {
|
|
3156
3193
|
id: string;
|
|
3157
|
-
type:
|
|
3194
|
+
type: HSTOperationType;
|
|
3158
3195
|
path: string;
|
|
3159
3196
|
fieldname: string;
|
|
3160
3197
|
beforeValue: any;
|
|
@@ -3178,7 +3215,7 @@ parentOperationId?: string | undefined;
|
|
|
3178
3215
|
childOperationIds?: string[] | undefined;
|
|
3179
3216
|
}[], HSTOperation[] | {
|
|
3180
3217
|
id: string;
|
|
3181
|
-
type:
|
|
3218
|
+
type: HSTOperationType;
|
|
3182
3219
|
path: string;
|
|
3183
3220
|
fieldname: string;
|
|
3184
3221
|
beforeValue: any;
|
|
@@ -3240,7 +3277,7 @@ logAction: (doctype: string, actionName: string, recordIds?: string[], result?:
|
|
|
3240
3277
|
}, "operations" | "clientId" | "currentIndex" | "config">, Pick<{
|
|
3241
3278
|
operations: Ref< {
|
|
3242
3279
|
id: string;
|
|
3243
|
-
type:
|
|
3280
|
+
type: HSTOperationType;
|
|
3244
3281
|
path: string;
|
|
3245
3282
|
fieldname: string;
|
|
3246
3283
|
beforeValue: any;
|
|
@@ -3264,7 +3301,7 @@ parentOperationId?: string | undefined;
|
|
|
3264
3301
|
childOperationIds?: string[] | undefined;
|
|
3265
3302
|
}[], HSTOperation[] | {
|
|
3266
3303
|
id: string;
|
|
3267
|
-
type:
|
|
3304
|
+
type: HSTOperationType;
|
|
3268
3305
|
path: string;
|
|
3269
3306
|
fieldname: string;
|
|
3270
3307
|
beforeValue: any;
|
|
@@ -3326,7 +3363,7 @@ logAction: (doctype: string, actionName: string, recordIds?: string[], result?:
|
|
|
3326
3363
|
}, "undoRedoState" | "canUndo" | "canRedo" | "undoCount" | "redoCount">, Pick<{
|
|
3327
3364
|
operations: Ref< {
|
|
3328
3365
|
id: string;
|
|
3329
|
-
type:
|
|
3366
|
+
type: HSTOperationType;
|
|
3330
3367
|
path: string;
|
|
3331
3368
|
fieldname: string;
|
|
3332
3369
|
beforeValue: any;
|
|
@@ -3350,7 +3387,7 @@ parentOperationId?: string | undefined;
|
|
|
3350
3387
|
childOperationIds?: string[] | undefined;
|
|
3351
3388
|
}[], HSTOperation[] | {
|
|
3352
3389
|
id: string;
|
|
3353
|
-
type:
|
|
3390
|
+
type: HSTOperationType;
|
|
3354
3391
|
path: string;
|
|
3355
3392
|
fieldname: string;
|
|
3356
3393
|
beforeValue: any;
|
|
@@ -3452,6 +3489,84 @@ export declare function useStonecrop(options: {
|
|
|
3452
3489
|
*/
|
|
3453
3490
|
export declare function useUndoRedoShortcuts(hstStore: HSTNode, enabled?: boolean): void;
|
|
3454
3491
|
|
|
3492
|
+
/**
|
|
3493
|
+
* Quick validation helper
|
|
3494
|
+
* @param doctype - Doctype name
|
|
3495
|
+
* @param schema - Schema fields
|
|
3496
|
+
* @param registry - Registry instance
|
|
3497
|
+
* @param workflow - Optional workflow configuration
|
|
3498
|
+
* @param actions - Optional actions map
|
|
3499
|
+
* @returns Validation result
|
|
3500
|
+
* @public
|
|
3501
|
+
*/
|
|
3502
|
+
export declare function validateSchema(doctype: string, schema: List<SchemaTypes> | SchemaTypes[] | undefined, registry: Registry, workflow?: AnyStateNodeConfig, actions?: Map_2<string, string[]> | Map<string, string[]>): ValidationResult;
|
|
3503
|
+
|
|
3504
|
+
/**
|
|
3505
|
+
* Validation issue
|
|
3506
|
+
* @public
|
|
3507
|
+
*/
|
|
3508
|
+
export declare interface ValidationIssue {
|
|
3509
|
+
/** Severity level */
|
|
3510
|
+
severity: ValidationSeverity;
|
|
3511
|
+
/** Validation rule that failed */
|
|
3512
|
+
rule: string;
|
|
3513
|
+
/** Human-readable message */
|
|
3514
|
+
message: string;
|
|
3515
|
+
/** Doctype name */
|
|
3516
|
+
doctype?: string;
|
|
3517
|
+
/** Field name if applicable */
|
|
3518
|
+
fieldname?: string;
|
|
3519
|
+
/** Additional context */
|
|
3520
|
+
context?: Record<string, unknown>;
|
|
3521
|
+
}
|
|
3522
|
+
|
|
3523
|
+
/**
|
|
3524
|
+
* Validation result
|
|
3525
|
+
* @public
|
|
3526
|
+
*/
|
|
3527
|
+
export declare interface ValidationResult {
|
|
3528
|
+
/** Whether validation passed (no blocking errors) */
|
|
3529
|
+
valid: boolean;
|
|
3530
|
+
/** List of validation issues */
|
|
3531
|
+
issues: ValidationIssue[];
|
|
3532
|
+
/** Count of errors */
|
|
3533
|
+
errorCount: number;
|
|
3534
|
+
/** Count of warnings */
|
|
3535
|
+
warningCount: number;
|
|
3536
|
+
/** Count of info messages */
|
|
3537
|
+
infoCount: number;
|
|
3538
|
+
}
|
|
3539
|
+
|
|
3540
|
+
/**
|
|
3541
|
+
* Validation severity levels
|
|
3542
|
+
* @public
|
|
3543
|
+
*/
|
|
3544
|
+
export declare enum ValidationSeverity {
|
|
3545
|
+
/** Blocking error that prevents save */
|
|
3546
|
+
ERROR = "error",
|
|
3547
|
+
/** Advisory warning that allows save */
|
|
3548
|
+
WARNING = "warning",
|
|
3549
|
+
/** Informational message */
|
|
3550
|
+
INFO = "info"
|
|
3551
|
+
}
|
|
3552
|
+
|
|
3553
|
+
/**
|
|
3554
|
+
* Schema validator options
|
|
3555
|
+
* @public
|
|
3556
|
+
*/
|
|
3557
|
+
export declare interface ValidatorOptions {
|
|
3558
|
+
/** Registry instance for doctype lookups */
|
|
3559
|
+
registry?: Registry;
|
|
3560
|
+
/** Whether to validate Link field targets */
|
|
3561
|
+
validateLinkTargets?: boolean;
|
|
3562
|
+
/** Whether to validate workflow reachability */
|
|
3563
|
+
validateWorkflows?: boolean;
|
|
3564
|
+
/** Whether to validate action registration */
|
|
3565
|
+
validateActions?: boolean;
|
|
3566
|
+
/** Whether to validate required schema properties */
|
|
3567
|
+
validateRequiredProperties?: boolean;
|
|
3568
|
+
}
|
|
3569
|
+
|
|
3455
3570
|
/**
|
|
3456
3571
|
* Batch operation helper
|
|
3457
3572
|
* Wraps a function execution in a batch operation
|