@stonecrop/stonecrop 0.11.0 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/package.json +4 -4
  2. package/dist/composable.js +0 -1
  3. package/dist/composables/use-lazy-link-state.js +0 -125
  4. package/dist/composables/use-stonecrop.js +0 -476
  5. package/dist/operation-log-DB-dGNT9.js +0 -593
  6. package/dist/operation-log-DB-dGNT9.js.map +0 -1
  7. package/dist/src/composable.d.ts +0 -11
  8. package/dist/src/composable.d.ts.map +0 -1
  9. package/dist/src/composable.js +0 -477
  10. package/dist/src/composables/operation-log.js +0 -224
  11. package/dist/src/composables/stonecrop.js +0 -574
  12. package/dist/src/composables/use-lazy-link-state.d.ts +0 -25
  13. package/dist/src/composables/use-lazy-link-state.d.ts.map +0 -1
  14. package/dist/src/composables/use-stonecrop.d.ts +0 -93
  15. package/dist/src/composables/use-stonecrop.d.ts.map +0 -1
  16. package/dist/src/composables/useNestedSchema.d.ts +0 -110
  17. package/dist/src/composables/useNestedSchema.d.ts.map +0 -1
  18. package/dist/src/composables/useNestedSchema.js +0 -155
  19. package/dist/src/doctype.js +0 -234
  20. package/dist/src/exceptions.js +0 -16
  21. package/dist/src/field-triggers.js +0 -567
  22. package/dist/src/index.js +0 -23
  23. package/dist/src/plugins/index.js +0 -96
  24. package/dist/src/registry.js +0 -246
  25. package/dist/src/schema-validator.js +0 -315
  26. package/dist/src/stonecrop.js +0 -339
  27. package/dist/src/stores/data.d.ts +0 -11
  28. package/dist/src/stores/data.d.ts.map +0 -1
  29. package/dist/src/stores/hst.js +0 -495
  30. package/dist/src/stores/index.js +0 -12
  31. package/dist/src/stores/operation-log.js +0 -568
  32. package/dist/src/stores/xstate.d.ts +0 -31
  33. package/dist/src/stores/xstate.d.ts.map +0 -1
  34. package/dist/src/tsdoc-metadata.json +0 -11
  35. package/dist/src/types/field-triggers.js +0 -4
  36. package/dist/src/types/index.js +0 -4
  37. package/dist/src/types/operation-log.js +0 -0
  38. package/dist/src/types/registry.js +0 -0
  39. package/dist/src/utils.d.ts +0 -24
  40. package/dist/src/utils.d.ts.map +0 -1
  41. package/dist/stonecrop.css +0 -1
  42. package/dist/stonecrop.umd.cjs +0 -6
  43. package/dist/stonecrop.umd.cjs.map +0 -1
  44. package/dist/stores/data.js +0 -7
  45. package/dist/stores/xstate.js +0 -29
  46. package/dist/tests/setup.d.ts +0 -5
  47. package/dist/tests/setup.d.ts.map +0 -1
  48. package/dist/tests/setup.js +0 -15
  49. package/dist/utils.js +0 -46
@@ -1,568 +0,0 @@
1
- import { defineStore } from 'pinia';
2
- import { ref, computed, watch } from 'vue';
3
- import { useLocalStorage } from '@vueuse/core';
4
- /**
5
- * Generate a UUID using crypto API or fallback
6
- */
7
- function generateId() {
8
- if (typeof crypto !== 'undefined' && crypto.randomUUID) {
9
- return crypto.randomUUID();
10
- }
11
- // Fallback for environments without crypto.randomUUID
12
- return `${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
13
- }
14
- function serializeForBroadcast(message) {
15
- const serialized = {
16
- type: message.type,
17
- clientId: message.clientId,
18
- timestamp: message.timestamp.toISOString(),
19
- };
20
- if (message.operation) {
21
- serialized.operation = {
22
- ...message.operation,
23
- timestamp: message.operation.timestamp.toISOString(),
24
- };
25
- }
26
- if (message.operations) {
27
- serialized.operations = message.operations.map(op => ({
28
- ...op,
29
- timestamp: op.timestamp.toISOString(),
30
- }));
31
- }
32
- return serialized;
33
- }
34
- /**
35
- * Deserialize a message from BroadcastChannel
36
- * Converts ISO strings back to Date objects
37
- */
38
- function deserializeFromBroadcast(serialized) {
39
- const message = {
40
- type: serialized.type,
41
- clientId: serialized.clientId,
42
- timestamp: new Date(serialized.timestamp),
43
- };
44
- if (serialized.operation) {
45
- message.operation = {
46
- ...serialized.operation,
47
- timestamp: new Date(serialized.operation.timestamp),
48
- };
49
- }
50
- if (serialized.operations) {
51
- message.operations = serialized.operations.map(op => ({
52
- ...op,
53
- timestamp: new Date(op.timestamp),
54
- }));
55
- }
56
- return message;
57
- }
58
- /**
59
- * Global HST Operation Log Store
60
- * Tracks all mutations with full metadata for undo/redo, sync, and audit
61
- *
62
- * @public
63
- */
64
- export const useOperationLogStore = defineStore('hst-operation-log', () => {
65
- // Configuration
66
- const config = ref({
67
- maxOperations: 100,
68
- enableCrossTabSync: true,
69
- autoSyncInterval: 30000,
70
- enablePersistence: false,
71
- persistenceKeyPrefix: 'stonecrop-ops',
72
- });
73
- // State
74
- const operations = ref([]);
75
- const currentIndex = ref(-1); // Points to the last applied operation
76
- const clientId = ref(generateId());
77
- const batchMode = ref(false);
78
- const currentBatch = ref([]);
79
- const currentBatchId = ref(null);
80
- // Computed
81
- const canUndo = computed(() => {
82
- // Can undo if there are operations and we're not at the beginning
83
- if (currentIndex.value < 0)
84
- return false;
85
- // Check if the operation at currentIndex is reversible
86
- const operation = operations.value[currentIndex.value];
87
- return operation?.reversible ?? false;
88
- });
89
- const canRedo = computed(() => {
90
- // Can redo if there are operations ahead of current index
91
- return currentIndex.value < operations.value.length - 1;
92
- });
93
- const undoCount = computed(() => {
94
- let count = 0;
95
- for (let i = currentIndex.value; i >= 0; i--) {
96
- if (operations.value[i]?.reversible)
97
- count++;
98
- else
99
- break;
100
- }
101
- return count;
102
- });
103
- const redoCount = computed(() => {
104
- return operations.value.length - 1 - currentIndex.value;
105
- });
106
- const undoRedoState = computed(() => ({
107
- canUndo: canUndo.value,
108
- canRedo: canRedo.value,
109
- undoCount: undoCount.value,
110
- redoCount: redoCount.value,
111
- currentIndex: currentIndex.value,
112
- }));
113
- // Core Methods
114
- /**
115
- * Configure the operation log
116
- */
117
- function configure(options) {
118
- config.value = { ...config.value, ...options };
119
- // Set up persistence if enabled
120
- if (config.value.enablePersistence) {
121
- loadFromPersistence();
122
- setupPersistenceWatcher();
123
- }
124
- // Set up cross-tab sync if enabled
125
- if (config.value.enableCrossTabSync) {
126
- setupCrossTabSync();
127
- }
128
- }
129
- /**
130
- * Add an operation to the log
131
- */
132
- function addOperation(operation, source = 'user') {
133
- const fullOperation = {
134
- ...operation,
135
- id: generateId(),
136
- timestamp: new Date(),
137
- source: source,
138
- userId: config.value.userId,
139
- };
140
- // Apply filter if configured
141
- if (config.value.operationFilter && !config.value.operationFilter(fullOperation)) {
142
- return fullOperation.id;
143
- }
144
- // If in batch mode, collect operations
145
- if (batchMode.value) {
146
- currentBatch.value.push(fullOperation);
147
- return fullOperation.id;
148
- }
149
- // Remove any operations after current index (they become invalid after new operation)
150
- if (currentIndex.value < operations.value.length - 1) {
151
- operations.value = operations.value.slice(0, currentIndex.value + 1);
152
- }
153
- // Add new operation
154
- operations.value.push(fullOperation);
155
- currentIndex.value++;
156
- // Enforce max operations limit
157
- if (config.value.maxOperations && operations.value.length > config.value.maxOperations) {
158
- const overflow = operations.value.length - config.value.maxOperations;
159
- operations.value = operations.value.slice(overflow);
160
- currentIndex.value -= overflow;
161
- }
162
- // Broadcast to other tabs
163
- if (config.value.enableCrossTabSync) {
164
- broadcastOperation(fullOperation);
165
- }
166
- return fullOperation.id;
167
- }
168
- /**
169
- * Start batch mode - collect multiple operations
170
- */
171
- function startBatch() {
172
- batchMode.value = true;
173
- currentBatch.value = [];
174
- currentBatchId.value = generateId();
175
- }
176
- /**
177
- * Commit batch - create a single batch operation
178
- */
179
- function commitBatch(description) {
180
- if (!batchMode.value || currentBatch.value.length === 0) {
181
- batchMode.value = false;
182
- currentBatch.value = [];
183
- currentBatchId.value = null;
184
- return null;
185
- }
186
- const batchId = currentBatchId.value;
187
- const allReversible = currentBatch.value.every(op => op.reversible);
188
- // Create parent batch operation
189
- const batchOperation = {
190
- id: batchId,
191
- type: 'batch',
192
- path: '', // Batch doesn't have a single path
193
- fieldname: '',
194
- beforeValue: null,
195
- afterValue: null,
196
- doctype: currentBatch.value[0]?.doctype || '',
197
- timestamp: new Date(),
198
- source: 'user',
199
- reversible: allReversible,
200
- irreversibleReason: allReversible ? undefined : 'Contains irreversible operations',
201
- childOperationIds: currentBatch.value.map(op => op.id),
202
- metadata: { description },
203
- };
204
- // Add parent operation ID to all children
205
- currentBatch.value.forEach(op => {
206
- op.parentOperationId = batchId;
207
- });
208
- // Add all operations to the log
209
- operations.value.push(...currentBatch.value, batchOperation);
210
- currentIndex.value = operations.value.length - 1;
211
- // Broadcast batch
212
- if (config.value.enableCrossTabSync) {
213
- broadcastBatch(currentBatch.value, batchOperation);
214
- }
215
- // Reset batch state
216
- const result = batchId;
217
- batchMode.value = false;
218
- currentBatch.value = [];
219
- currentBatchId.value = null;
220
- return result;
221
- }
222
- /**
223
- * Cancel batch mode without committing
224
- */
225
- function cancelBatch() {
226
- batchMode.value = false;
227
- currentBatch.value = [];
228
- currentBatchId.value = null;
229
- }
230
- /**
231
- * Undo the last operation
232
- */
233
- function undo(store) {
234
- if (!canUndo.value)
235
- return false;
236
- const operation = operations.value[currentIndex.value];
237
- if (!operation.reversible) {
238
- // Warn about irreversible operation
239
- if (typeof console !== 'undefined' && operation.irreversibleReason) {
240
- // eslint-disable-next-line no-console
241
- console.warn('Cannot undo irreversible operation:', operation.irreversibleReason);
242
- }
243
- return false;
244
- }
245
- try {
246
- // Handle batch operations
247
- if (operation.type === 'batch' && operation.childOperationIds) {
248
- // Undo all child operations in reverse order
249
- for (let i = operation.childOperationIds.length - 1; i >= 0; i--) {
250
- const childId = operation.childOperationIds[i];
251
- const childOp = operations.value.find(op => op.id === childId);
252
- if (childOp) {
253
- revertOperation(childOp, store);
254
- }
255
- }
256
- }
257
- else {
258
- // Undo single operation
259
- revertOperation(operation, store);
260
- }
261
- currentIndex.value--;
262
- // Broadcast undo to other tabs
263
- if (config.value.enableCrossTabSync) {
264
- broadcastUndo(operation);
265
- }
266
- return true;
267
- }
268
- catch (error) {
269
- // Log error in development
270
- if (typeof console !== 'undefined') {
271
- // eslint-disable-next-line no-console
272
- console.error('Undo failed:', error);
273
- }
274
- return false;
275
- }
276
- }
277
- /**
278
- * Redo the next operation
279
- */
280
- function redo(store) {
281
- if (!canRedo.value)
282
- return false;
283
- const operation = operations.value[currentIndex.value + 1];
284
- try {
285
- // Handle batch operations
286
- if (operation.type === 'batch' && operation.childOperationIds) {
287
- // Redo all child operations in order
288
- for (const childId of operation.childOperationIds) {
289
- const childOp = operations.value.find(op => op.id === childId);
290
- if (childOp) {
291
- applyOperation(childOp, store);
292
- }
293
- }
294
- }
295
- else {
296
- // Redo single operation
297
- applyOperation(operation, store);
298
- }
299
- currentIndex.value++;
300
- // Broadcast redo to other tabs
301
- if (config.value.enableCrossTabSync) {
302
- broadcastRedo(operation);
303
- }
304
- return true;
305
- }
306
- catch (error) {
307
- // Log error in development
308
- if (typeof console !== 'undefined') {
309
- // eslint-disable-next-line no-console
310
- console.error('Redo failed:', error);
311
- }
312
- return false;
313
- }
314
- }
315
- /**
316
- * Revert an operation (apply beforeValue)
317
- */
318
- function revertOperation(operation, store) {
319
- // Both 'set' and 'delete' operations can be reverted by setting to beforeValue
320
- if ((operation.type === 'set' || operation.type === 'delete') && store && typeof store.set === 'function') {
321
- store.set(operation.path, operation.beforeValue, 'undo');
322
- }
323
- // Note: 'transition' operations are marked as non-reversible, so they won't reach here
324
- // Note: 'batch' operations are handled separately in the undo function
325
- }
326
- /**
327
- * Apply an operation (apply afterValue)
328
- */
329
- function applyOperation(operation, store) {
330
- // Both 'set' and 'delete' operations can be applied by setting to afterValue
331
- if ((operation.type === 'set' || operation.type === 'delete') && store && typeof store.set === 'function') {
332
- store.set(operation.path, operation.afterValue, 'redo');
333
- }
334
- // Note: 'transition' operations are marked as non-reversible, so they won't reach here
335
- // Note: 'batch' operations are handled separately in the redo function
336
- }
337
- /**
338
- * Get operation log snapshot for debugging
339
- */
340
- function getSnapshot() {
341
- const reversibleOps = operations.value.filter(op => op.reversible).length;
342
- const timestamps = operations.value.map(op => op.timestamp);
343
- return {
344
- operations: [...operations.value],
345
- currentIndex: currentIndex.value,
346
- totalOperations: operations.value.length,
347
- reversibleOperations: reversibleOps,
348
- irreversibleOperations: operations.value.length - reversibleOps,
349
- oldestOperation: timestamps.length > 0 ? new Date(Math.min(...timestamps.map(t => t.getTime()))) : undefined,
350
- newestOperation: timestamps.length > 0 ? new Date(Math.max(...timestamps.map(t => t.getTime()))) : undefined,
351
- };
352
- }
353
- /**
354
- * Clear all operations
355
- */
356
- function clear() {
357
- operations.value = [];
358
- currentIndex.value = -1;
359
- }
360
- /**
361
- * Get operations for a specific doctype and recordId
362
- */
363
- function getOperationsFor(doctype, recordId) {
364
- return operations.value.filter(op => op.doctype === doctype && (recordId === undefined || op.recordId === recordId));
365
- }
366
- /**
367
- * Mark an operation as irreversible
368
- * @param operationId - The ID of the operation to mark
369
- * @param reason - The reason why the operation is irreversible
370
- */
371
- function markIrreversible(operationId, reason) {
372
- const operation = operations.value.find(op => op.id === operationId);
373
- if (operation) {
374
- operation.reversible = false;
375
- operation.irreversibleReason = reason;
376
- }
377
- }
378
- /**
379
- * Log an action execution (stateless actions like print, email, etc.)
380
- * These operations are tracked but typically not reversible
381
- * @param doctype - The doctype the action was executed on
382
- * @param actionName - The name of the action that was executed
383
- * @param recordIds - Optional array of record IDs the action was executed on
384
- * @param result - The result of the action execution
385
- * @param error - Optional error message if action failed
386
- * @returns The operation ID
387
- */
388
- function logAction(doctype, actionName, recordIds, result = 'success', error) {
389
- const operation = {
390
- type: 'action',
391
- path: recordIds && recordIds.length > 0 ? `${doctype}.${recordIds[0]}` : doctype,
392
- fieldname: '',
393
- beforeValue: null,
394
- afterValue: null,
395
- doctype,
396
- recordId: recordIds && recordIds.length > 0 ? recordIds[0] : undefined,
397
- reversible: false, // Actions are typically not reversible
398
- actionName,
399
- actionRecordIds: recordIds,
400
- actionResult: result,
401
- actionError: error,
402
- };
403
- return addOperation(operation);
404
- }
405
- // Cross-tab synchronization
406
- let broadcastChannel = null;
407
- function setupCrossTabSync() {
408
- if (typeof window === 'undefined' || !window.BroadcastChannel)
409
- return;
410
- broadcastChannel = new BroadcastChannel('stonecrop-operation-log');
411
- broadcastChannel.addEventListener('message', (event) => {
412
- const rawMessage = event.data;
413
- if (!rawMessage || typeof rawMessage !== 'object')
414
- return;
415
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
416
- const message = deserializeFromBroadcast(rawMessage);
417
- // Ignore messages from this tab
418
- if (message.clientId === clientId.value)
419
- return;
420
- if (message.type === 'operation' && message.operation) {
421
- // Add operation from another tab
422
- operations.value.push({ ...message.operation, source: 'sync' });
423
- currentIndex.value = operations.value.length - 1;
424
- }
425
- else if (message.type === 'operation' && message.operations) {
426
- // Add batch operations from another tab
427
- operations.value.push(...message.operations.map(op => ({ ...op, source: 'sync' })));
428
- currentIndex.value = operations.value.length - 1;
429
- }
430
- });
431
- }
432
- function broadcastOperation(operation) {
433
- if (!broadcastChannel)
434
- return;
435
- const message = {
436
- type: 'operation',
437
- operation,
438
- clientId: clientId.value,
439
- timestamp: new Date(),
440
- };
441
- broadcastChannel.postMessage(serializeForBroadcast(message));
442
- }
443
- function broadcastBatch(childOps, batchOp) {
444
- if (!broadcastChannel)
445
- return;
446
- const message = {
447
- type: 'operation',
448
- operations: [...childOps, batchOp],
449
- clientId: clientId.value,
450
- timestamp: new Date(),
451
- };
452
- broadcastChannel.postMessage(serializeForBroadcast(message));
453
- }
454
- function broadcastUndo(operation) {
455
- if (!broadcastChannel)
456
- return;
457
- const message = {
458
- type: 'undo',
459
- operation,
460
- clientId: clientId.value,
461
- timestamp: new Date(),
462
- };
463
- broadcastChannel.postMessage(serializeForBroadcast(message));
464
- }
465
- function broadcastRedo(operation) {
466
- if (!broadcastChannel)
467
- return;
468
- const message = {
469
- type: 'redo',
470
- operation,
471
- clientId: clientId.value,
472
- timestamp: new Date(),
473
- };
474
- broadcastChannel.postMessage(serializeForBroadcast(message));
475
- }
476
- const persistedData = useLocalStorage('stonecrop-ops-operations', null, {
477
- serializer: {
478
- read: (v) => {
479
- try {
480
- const data = JSON.parse(v);
481
- return data;
482
- }
483
- catch {
484
- return null;
485
- }
486
- },
487
- write: (v) => {
488
- if (!v)
489
- return '';
490
- return JSON.stringify(v);
491
- },
492
- },
493
- });
494
- function loadFromPersistence() {
495
- if (typeof window === 'undefined')
496
- return;
497
- try {
498
- const data = persistedData.value;
499
- if (data && Array.isArray(data.operations)) {
500
- operations.value = data.operations.map(op => ({
501
- ...op,
502
- timestamp: new Date(op.timestamp),
503
- }));
504
- currentIndex.value = data.currentIndex ?? -1;
505
- }
506
- }
507
- catch (error) {
508
- // Log error in development
509
- if (typeof console !== 'undefined') {
510
- // eslint-disable-next-line no-console
511
- console.error('Failed to load operations from persistence:', error);
512
- }
513
- }
514
- }
515
- function saveToPersistence() {
516
- if (typeof window === 'undefined')
517
- return;
518
- try {
519
- persistedData.value = {
520
- operations: operations.value.map(op => ({
521
- ...op,
522
- timestamp: op.timestamp.toISOString(),
523
- })),
524
- currentIndex: currentIndex.value,
525
- };
526
- }
527
- catch (error) {
528
- // Log error in development
529
- if (typeof console !== 'undefined') {
530
- // eslint-disable-next-line no-console
531
- console.error('Failed to save operations to persistence:', error);
532
- }
533
- }
534
- }
535
- function setupPersistenceWatcher() {
536
- watch([operations, currentIndex], () => {
537
- if (config.value.enablePersistence) {
538
- saveToPersistence();
539
- }
540
- }, { deep: true });
541
- }
542
- return {
543
- // State
544
- operations,
545
- currentIndex,
546
- config,
547
- clientId,
548
- undoRedoState,
549
- // Computed
550
- canUndo,
551
- canRedo,
552
- undoCount,
553
- redoCount,
554
- // Methods
555
- configure,
556
- addOperation,
557
- startBatch,
558
- commitBatch,
559
- cancelBatch,
560
- undo,
561
- redo,
562
- clear,
563
- getOperationsFor,
564
- getSnapshot,
565
- markIrreversible,
566
- logAction,
567
- };
568
- });
@@ -1,31 +0,0 @@
1
- export declare const counterMachine: import("xstate").StateMachine<{
2
- count: number;
3
- }, any, import("xstate").AnyEventObject, {
4
- value: any;
5
- context: {
6
- count: number;
7
- };
8
- }, import("xstate").BaseActionObject, import("xstate").ServiceMap, import("xstate").ResolveTypegenMeta<import("xstate").TypegenDisabled, import("xstate").AnyEventObject, import("xstate").BaseActionObject, import("xstate").ServiceMap>>;
9
- export declare const useCounterStore: import("pinia").StoreDefinition<string, Pick<import("pinia-xstate").Store<import("xstate").StateMachine<{
10
- count: number;
11
- }, any, import("xstate").AnyEventObject, {
12
- value: any;
13
- context: {
14
- count: number;
15
- };
16
- }, import("xstate").BaseActionObject, import("xstate").ServiceMap, import("xstate").ResolveTypegenMeta<import("xstate").TypegenDisabled, import("xstate").AnyEventObject, import("xstate").BaseActionObject, import("xstate").ServiceMap>>>, "state" | "actor">, Pick<import("pinia-xstate").Store<import("xstate").StateMachine<{
17
- count: number;
18
- }, any, import("xstate").AnyEventObject, {
19
- value: any;
20
- context: {
21
- count: number;
22
- };
23
- }, import("xstate").BaseActionObject, import("xstate").ServiceMap, import("xstate").ResolveTypegenMeta<import("xstate").TypegenDisabled, import("xstate").AnyEventObject, import("xstate").BaseActionObject, import("xstate").ServiceMap>>>, "state">, Pick<import("pinia-xstate").Store<import("xstate").StateMachine<{
24
- count: number;
25
- }, any, import("xstate").AnyEventObject, {
26
- value: any;
27
- context: {
28
- count: number;
29
- };
30
- }, import("xstate").BaseActionObject, import("xstate").ServiceMap, import("xstate").ResolveTypegenMeta<import("xstate").TypegenDisabled, import("xstate").AnyEventObject, import("xstate").BaseActionObject, import("xstate").ServiceMap>>>, "state" | "send">>;
31
- //# sourceMappingURL=xstate.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"xstate.d.ts","sourceRoot":"","sources":["../../../src/stores/xstate.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc;;;;;;;0OA0B1B,CAAA;AAGD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;+PAAyD,CAAA"}
@@ -1,11 +0,0 @@
1
- // This file is read by tools that parse documentation comments conforming to the TSDoc standard.
2
- // It should be published with your NPM package. It should not be tracked by Git.
3
- {
4
- "tsdocVersion": "0.12",
5
- "toolPackages": [
6
- {
7
- "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.57.0"
9
- }
10
- ]
11
- }
@@ -1,4 +0,0 @@
1
- /**
2
- * Field-level action trigger system types
3
- * @public
4
- */
@@ -1,4 +0,0 @@
1
- // Re-export types
2
- export * from './field-triggers';
3
- export * from './registry';
4
- export * from './operation-log';
File without changes
File without changes
@@ -1,24 +0,0 @@
1
- import { type SchemaTypes } from '@stonecrop/aform';
2
- import type { HSTNode } from './stores/hst';
3
- /**
4
- * Recursively collect nested data from HST using pre-resolved schemas.
5
- *
6
- * Walks through a resolved schema and collects all values from the HST store,
7
- * including nested 1:1 Doctype fields and 1:many child arrays.
8
- *
9
- * @param resolvedSchema - The already-resolved schema (with nested schemas embedded)
10
- * @param basePath - The base path in HST (e.g., "customer.123.address")
11
- * @param hstStore - The HST store instance
12
- * @returns The collected data object with all nested fields
13
- *
14
- * @example
15
- * ```ts
16
- * const addressSchema = registry.resolveSchema(addressDoctype.schema)
17
- * const addressData = collectNestedData(addressSchema, 'customer.123.address', hstStore)
18
- * // Returns: { street: '123 Main St', city: 'Portland', ... }
19
- * ```
20
- *
21
- * @public
22
- */
23
- export declare function collectNestedData(resolvedSchema: SchemaTypes[], basePath: string, hstStore: HSTNode): Record<string, unknown>;
24
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,KAAK,WAAW,EAEhB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAE3C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,iBAAiB,CAChC,cAAc,EAAE,WAAW,EAAE,EAC7B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,OAAO,GACf,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAkCzB"}