@yudaocode/univer-bases 1.6.218 → 1.6.219

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.
@@ -1,5 +1,5 @@
1
1
  import { Injector, ICommandService, IUniverInstanceService, ICreateUnitOptions } from '@univerjs/core';
2
- import { BaseUnitModel, IBaseUnitData, IBaseTable, IBaseField, BaseFieldType, IBaseFieldConfig, BaseCellValue, BaseViewType, UpdateBaseViewCommand, IBaseViewQueryOverrides, IBaseViewQueryResult, IBaseGanttLayoutResult, IBaseDashboardWidget, IBaseDashboardWidgetResult, IBaseIoAdapter } from '@yudaocode/univer-bases';
2
+ import { BaseUnitModel, IBaseUnitData, IBaseTable, IBaseField, BaseFieldType, IBaseFieldConfig, BaseCellValue, BaseViewType, UpdateBaseViewCommand, IBaseViewQueryOverrides, IBaseViewQueryResult, IBaseGanttLayoutResult, IBaseHierarchicalListResult, IBaseDashboardWidget, IBaseDashboardWidgetResult, IBaseDetailLayout, IBaseAutomationRule, BaseWebhookExecutor, IBaseAutomationRunLog, IBaseRowScopeContext, IBaseIoAdapter } from '@yudaocode/univer-bases';
3
3
  import { FUniver } from '@univerjs/core/facade';
4
4
 
5
5
  declare class FBase {
@@ -66,7 +66,25 @@ declare class FBase {
66
66
  setActiveView(viewId: string, tableId?: string): boolean;
67
67
  queryView(tableId?: string, viewId?: string, overrides?: IBaseViewQueryOverrides): IBaseViewQueryResult;
68
68
  computeGanttTasks(tableId?: string, viewId?: string): IBaseGanttLayoutResult;
69
+ computeHierarchicalList(tableId?: string, viewId?: string): IBaseHierarchicalListResult;
69
70
  computeDashboardWidget(widget: IBaseDashboardWidget): IBaseDashboardWidgetResult;
71
+ updateDetailLayout(detailLayout: IBaseDetailLayout, options?: {
72
+ tableId?: string;
73
+ viewId?: string;
74
+ }): boolean;
75
+ saveAutomationRule(rule: Omit<IBaseAutomationRule, 'id'> & {
76
+ id?: string;
77
+ }): string | null;
78
+ deleteAutomationRule(ruleId: string): boolean;
79
+ toggleAutomationRule(ruleId: string, enabled?: boolean): boolean;
80
+ triggerAutomation(params?: {
81
+ ruleId?: string;
82
+ tableId?: string;
83
+ recordId?: string;
84
+ webhookPayload?: unknown;
85
+ webhookExecutor?: BaseWebhookExecutor;
86
+ }): IBaseAutomationRunLog[];
87
+ applyRowReadScope(context: IBaseRowScopeContext): IBaseUnitData;
70
88
  submitForm(values: Record<string, BaseCellValue>, options?: {
71
89
  tableId?: string;
72
90
  viewId?: string;
@@ -1,5 +1,5 @@
1
1
  import * as _univerjs_core from '@univerjs/core';
2
- import { UnitModel, UniverInstanceType, IMutation, ICommand, Disposable, Plugin, Injector, IUniverInstanceService, ICommandService } from '@univerjs/core';
2
+ import { Disposable, UnitModel, UniverInstanceType, IMutation, ICommand, Plugin, Injector, IUniverInstanceService, ICommandService } from '@univerjs/core';
3
3
  import { Observable } from 'rxjs';
4
4
 
5
5
  declare const UNIVER_BASE_SCHEMA = "univer.base.unit.v1";
@@ -87,7 +87,7 @@ interface IBaseRecord {
87
87
  lastModifiedBy?: string;
88
88
  autoNumber?: number;
89
89
  }
90
- type BaseViewType = 'grid' | 'kanban' | 'calendar' | 'gallery' | 'gantt' | 'timeline' | 'form';
90
+ type BaseViewType = 'grid' | 'kanban' | 'calendar' | 'gallery' | 'gantt' | 'timeline' | 'form' | 'list';
91
91
  type BaseFilterOperator = 'is' | 'isNot' | 'contains' | 'notContains' | 'gt' | 'gte' | 'lt' | 'lte' | 'isEmpty' | 'isNotEmpty';
92
92
  type BaseFilterConjunction = 'and' | 'or';
93
93
  interface IBaseFilterRule {
@@ -123,6 +123,15 @@ interface IBaseFormFieldItem {
123
123
  label?: string;
124
124
  placeholder?: string;
125
125
  helpText?: string;
126
+ visibleWhenConjunction?: BaseFilterConjunction;
127
+ visibleWhen?: IBaseFilterRule[];
128
+ conditionalRequired?: boolean;
129
+ }
130
+ type IBaseFormFieldConfig = IBaseFormFieldItem;
131
+ interface IBaseFormFieldRule {
132
+ visibleWhenConjunction?: BaseFilterConjunction;
133
+ visibleWhen?: IBaseFilterRule[];
134
+ conditionalRequired?: boolean;
126
135
  }
127
136
  interface IBaseFormConfig {
128
137
  title: string;
@@ -131,6 +140,17 @@ interface IBaseFormConfig {
131
140
  submitButtonText?: string;
132
141
  successMessage?: string;
133
142
  fields: IBaseFormFieldItem[];
143
+ fieldRules?: Record<string, IBaseFormFieldRule>;
144
+ }
145
+ interface IBaseDetailSection {
146
+ id: string;
147
+ title: string;
148
+ collapsed?: boolean;
149
+ fieldIds: string[];
150
+ }
151
+ interface IBaseDetailLayout {
152
+ columns?: 1 | 2;
153
+ sections?: IBaseDetailSection[];
134
154
  }
135
155
  interface IBaseView {
136
156
  id: string;
@@ -160,6 +180,10 @@ interface IBaseView {
160
180
  ganttGroupFieldId?: string;
161
181
  ganttZoom?: BaseGanttZoom;
162
182
  formConfig?: IBaseFormConfig;
183
+ listParentFieldId?: string;
184
+ listCollapsedRecordIds?: string[];
185
+ listBadgeFieldIds?: string[];
186
+ detailLayout?: IBaseDetailLayout;
163
187
  }
164
188
  interface IBaseTable {
165
189
  id: string;
@@ -175,6 +199,7 @@ interface IBaseTable {
175
199
  views: Record<string, IBaseView>;
176
200
  activeViewId: string;
177
201
  nextAutoNumber?: number;
202
+ detailLayout?: IBaseDetailLayout;
178
203
  }
179
204
  type BaseDashboardChartType = 'kpi' | 'bar' | 'line' | 'pie' | 'doughnut';
180
205
  type BaseDashboardAggregation = 'count' | 'sum' | 'avg' | 'min' | 'max';
@@ -195,17 +220,101 @@ interface IBaseDashboard {
195
220
  name: string;
196
221
  widgets: IBaseDashboardWidget[];
197
222
  }
223
+ type BaseAutomationTriggerType = 'recordCreated' | 'recordUpdated' | 'fieldChanged' | 'conditionMatched' | 'scheduled' | 'webhookReceived' | 'fieldMatches';
224
+ type BaseAutomationStepType = 'updateRecord' | 'createLinkedRecord' | 'ifElse' | 'loopRecords' | 'httpWebhook' | 'notify';
225
+ type BaseAutomationActionType = BaseAutomationStepType | 'webhook';
226
+ interface IBaseAutomationStep {
227
+ id: string;
228
+ type: BaseAutomationStepType;
229
+ name?: string;
230
+ /** For 'updateRecord': map of fieldId or fieldName -> static value or `{字段名}` / `=FORMULA` */
231
+ fieldUpdates?: Record<string, BaseCellValue>;
232
+ /** For 'createLinkedRecord' */
233
+ targetTableId?: string;
234
+ linkBackFieldId?: string;
235
+ recordCells?: Record<string, BaseCellValue>;
236
+ /** For 'ifElse' */
237
+ conditionConjunction?: BaseFilterConjunction;
238
+ conditions?: IBaseFilterRule[];
239
+ thenSteps?: IBaseAutomationStep[];
240
+ elseSteps?: IBaseAutomationStep[];
241
+ /** For 'loopRecords' */
242
+ loopTableId?: string;
243
+ loopConditionConjunction?: BaseFilterConjunction;
244
+ loopConditions?: IBaseFilterRule[];
245
+ loopSteps?: IBaseAutomationStep[];
246
+ /** For 'httpWebhook' */
247
+ webhookUrl?: string;
248
+ webhookMethod?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
249
+ webhookHeaders?: Record<string, string>;
250
+ webhookBodyTemplate?: unknown;
251
+ /** For 'notify' */
252
+ notifyChannel?: string;
253
+ notifyMessage?: string;
254
+ }
198
255
  interface IBaseAutomationRule {
199
256
  id: string;
200
257
  name: string;
258
+ description?: string;
201
259
  tableId: string;
202
260
  enabled: boolean;
203
- trigger: 'recordCreated' | 'recordUpdated' | 'fieldMatches';
261
+ trigger: BaseAutomationTriggerType;
262
+ triggerFieldIds?: string[];
263
+ /** Backward-compatible single field trigger */
204
264
  triggerFieldId?: string;
205
265
  triggerValue?: unknown;
206
- action: 'updateRecord' | 'notify' | 'webhook';
266
+ conditionConjunction?: BaseFilterConjunction;
267
+ conditions?: IBaseFilterRule[];
268
+ scheduleCron?: string;
269
+ steps?: IBaseAutomationStep[];
270
+ /** Backward-compatible legacy single action */
271
+ action?: BaseAutomationActionType;
207
272
  actionConfig?: Record<string, unknown>;
208
273
  }
274
+ interface IBaseQueuedWebhook {
275
+ id: string;
276
+ ruleId: string;
277
+ ruleName: string;
278
+ url: string;
279
+ method: string;
280
+ headers?: Record<string, string>;
281
+ body: unknown;
282
+ timestamp: string;
283
+ }
284
+ interface IBaseAutomationRunLog {
285
+ id: string;
286
+ ruleId: string;
287
+ ruleName: string;
288
+ tableId?: string;
289
+ recordId?: string;
290
+ trigger?: BaseAutomationTriggerType | 'manual';
291
+ status: 'success' | 'skipped' | 'error';
292
+ executedSteps: number;
293
+ timestamp: string;
294
+ summary: string;
295
+ queuedWebhooks?: IBaseQueuedWebhook[];
296
+ }
297
+ interface IBaseRowAccessRule {
298
+ id: string;
299
+ tableId: string;
300
+ roles?: string[];
301
+ userIds?: string[];
302
+ allowAllRecords?: boolean;
303
+ ownerFieldId?: string;
304
+ filterConjunction?: BaseFilterConjunction;
305
+ filters?: IBaseFilterRule[];
306
+ restrictedFieldIds?: string[];
307
+ maskMode?: 'mask' | 'hide';
308
+ maskValue?: BaseCellValue;
309
+ }
310
+ interface IBaseSyncMapping {
311
+ sourceKeyField?: string;
312
+ targetKeyField?: string;
313
+ fieldMap?: Record<string, string>;
314
+ sourceFilters?: IBaseFilterRule[];
315
+ conflictStrategy?: 'latestWins' | 'sourceWins' | 'targetWins';
316
+ syncTimestamp?: string;
317
+ }
209
318
  interface IBaseUnitData {
210
319
  schema?: string;
211
320
  schemaVersion?: number;
@@ -220,6 +329,8 @@ interface IBaseUnitData {
220
329
  tables: Record<string, IBaseTable>;
221
330
  dashboards?: IBaseDashboard[];
222
331
  automations?: IBaseAutomationRule[];
332
+ automationLogs?: IBaseAutomationRunLog[];
333
+ queuedWebhooks?: IBaseQueuedWebhook[];
223
334
  collaborators?: IBasePerson[];
224
335
  metadata?: Record<string, unknown>;
225
336
  }
@@ -342,6 +453,153 @@ declare function computeFieldSummary(rows: IBaseEvaluatedRow[], field: IBaseFiel
342
453
  declare function queryBaseTableView(unitData: IBaseUnitData, tableId?: string, viewId?: string, overrides?: IBaseViewQueryOverrides): IBaseViewQueryResult;
343
454
  declare function computeBaseDashboardWidget(unitData: IBaseUnitData, widget: IBaseDashboardWidget): IBaseDashboardWidgetResult;
344
455
  declare function computeBaseGanttTasks(unitData: IBaseUnitData, tableId?: string, viewId?: string): IBaseGanttLayoutResult;
456
+ interface IBaseHierarchicalListNode {
457
+ recordId: string;
458
+ parentId: string | null;
459
+ depth: number;
460
+ title: string;
461
+ row: IBaseEvaluatedRow;
462
+ collapsed: boolean;
463
+ cycleDetected: boolean;
464
+ children: IBaseHierarchicalListNode[];
465
+ descendantCount: number;
466
+ }
467
+ interface IBaseHierarchicalListResult {
468
+ table: IBaseTable;
469
+ view: IBaseView;
470
+ parentField: IBaseField | null;
471
+ roots: IBaseHierarchicalListNode[];
472
+ flattenedVisibleNodes: IBaseHierarchicalListNode[];
473
+ totalNodeCount: number;
474
+ maxDepth: number;
475
+ }
476
+ declare function computeBaseHierarchicalList(unitData: IBaseUnitData, tableId?: string, viewId?: string, options?: {
477
+ parentFieldId?: string;
478
+ collapsedRecordIds?: string[];
479
+ overrides?: IBaseViewQueryOverrides;
480
+ }): IBaseHierarchicalListResult;
481
+ declare function isFormFieldVisible(item: IBaseFormFieldItem, values: Record<string, BaseCellValue>, table: IBaseTable, unitData: IBaseUnitData, formConfig?: IBaseFormConfig): boolean;
482
+ declare function isFormFieldRequired(item: IBaseFormFieldItem, values: Record<string, BaseCellValue>, table: IBaseTable, unitData: IBaseUnitData, formConfig?: IBaseFormConfig): boolean;
483
+ interface IResolvedDetailSection {
484
+ id: string;
485
+ title: string;
486
+ collapsed: boolean;
487
+ fields: IBaseField[];
488
+ }
489
+ interface IResolvedDetailLayout {
490
+ columns: 1 | 2;
491
+ sections: IResolvedDetailSection[];
492
+ }
493
+ declare function resolveBaseDetailLayout(table: IBaseTable, view?: IBaseView, explicitLayout?: IBaseDetailLayout): IResolvedDetailLayout;
494
+
495
+ declare const MAX_AUTOMATION_RECURSION_DEPTH = 3;
496
+ interface IBaseWebhookRequest {
497
+ url: string;
498
+ method: string;
499
+ headers?: Record<string, string>;
500
+ body: unknown;
501
+ }
502
+ interface IBaseWebhookResponse {
503
+ status: number;
504
+ data?: unknown;
505
+ }
506
+ type BaseWebhookExecutor = (req: IBaseWebhookRequest) => Promise<IBaseWebhookResponse> | IBaseWebhookResponse;
507
+ interface IBaseAutomationTriggerEvent {
508
+ trigger: BaseAutomationTriggerType | 'manual';
509
+ tableId: string;
510
+ recordId?: string;
511
+ ruleId?: string;
512
+ changedFieldIds?: string[];
513
+ previousCells?: Record<string, BaseCellValue>;
514
+ webhookPayload?: unknown;
515
+ depth?: number;
516
+ }
517
+ interface IBaseAutomationExecutionOptions {
518
+ webhookExecutor?: BaseWebhookExecutor;
519
+ timestamp?: string;
520
+ maxLogs?: number;
521
+ }
522
+ interface IBaseAutomationExecutionResult {
523
+ unitData: IBaseUnitData;
524
+ logs: IBaseAutomationRunLog[];
525
+ queuedWebhooks: IBaseQueuedWebhook[];
526
+ executedRuleIds: string[];
527
+ }
528
+ interface IBaseAutomationService {
529
+ setWebhookExecutor(executor: BaseWebhookExecutor | undefined): void;
530
+ getWebhookExecutor(): BaseWebhookExecutor | undefined;
531
+ }
532
+ declare const IBaseAutomationService: _univerjs_core.IdentifierDecorator<IBaseAutomationService>;
533
+ declare class BaseAutomationService extends Disposable implements IBaseAutomationService {
534
+ private _webhookExecutor;
535
+ setWebhookExecutor(executor: BaseWebhookExecutor | undefined): void;
536
+ getWebhookExecutor(): BaseWebhookExecutor | undefined;
537
+ }
538
+ declare function evaluateAutomationConditions(conditions: IBaseFilterRule[] | undefined, conjunction: BaseFilterConjunction | undefined, unitData: IBaseUnitData, table: IBaseTable, record: IBaseRecord | undefined): boolean;
539
+ declare function interpolateAutomationString(template: string, unitData: IBaseUnitData, table: IBaseTable, record: IBaseRecord | undefined, webhookPayload?: unknown): string;
540
+ declare function interpolateAutomationCellValue(rawTemplate: BaseCellValue, targetField: IBaseField | undefined, unitData: IBaseUnitData, sourceTable: IBaseTable, sourceRecord: IBaseRecord | undefined, webhookPayload?: unknown): BaseCellValue;
541
+ declare function normalizeAutomationSteps(rule: IBaseAutomationRule): IBaseAutomationStep[];
542
+ declare function doesAutomationTriggerMatch(rule: IBaseAutomationRule, event: IBaseAutomationTriggerEvent, unitData: IBaseUnitData, table: IBaseTable, record: IBaseRecord | undefined): {
543
+ triggerMatched: boolean;
544
+ conditionsMatched: boolean;
545
+ };
546
+ /**
547
+ * Synchronous in-place runner used inside Univer `ICommand` transitions so all mutations,
548
+ * created linked records, cascaded updates, and `automationLogs` commit atomically with Undo/Redo.
549
+ */
550
+ declare function runBaseAutomationsInPlaceSync(workingUnit: IBaseUnitData, initialEvent: IBaseAutomationTriggerEvent, options?: IBaseAutomationExecutionOptions): {
551
+ logs: IBaseAutomationRunLog[];
552
+ queuedWebhooks: IBaseQueuedWebhook[];
553
+ executedRuleIds: string[];
554
+ };
555
+ /**
556
+ * Pure async-capable automation execution engine returning a new `IBaseUnitData` snapshot
557
+ * and awaiting any async `webhookExecutor` responses.
558
+ */
559
+ declare function executeBaseAutomations(unitData: IBaseUnitData, initialEvent: IBaseAutomationTriggerEvent, options?: IBaseAutomationExecutionOptions): Promise<IBaseAutomationExecutionResult>;
560
+
561
+ interface IBaseRowScopeContext {
562
+ userId: string;
563
+ userName?: string;
564
+ roles?: string[];
565
+ rules: IBaseRowAccessRule[];
566
+ }
567
+ declare function applyBaseRowReadScope(unitData: IBaseUnitData, context: IBaseRowScopeContext): IBaseUnitData;
568
+ interface IBaseSyncResult {
569
+ targetUnit: IBaseUnitData;
570
+ insertedCount: number;
571
+ updatedCount: number;
572
+ unchangedCount: number;
573
+ totalTargetRecords: number;
574
+ }
575
+ interface IBaseTwoWaySyncResult {
576
+ unitA: IBaseUnitData;
577
+ unitB: IBaseUnitData;
578
+ insertedInA: number;
579
+ updatedInA: number;
580
+ insertedInB: number;
581
+ updatedInB: number;
582
+ conflictsResolved: number;
583
+ }
584
+ interface IBaseMultiSourceMergeResult extends IBaseSyncResult {
585
+ deduplicatedCount: number;
586
+ }
587
+ declare function syncOneWayBaseTable(sourceUnit: IBaseUnitData, sourceTableId: string, targetUnit: IBaseUnitData, targetTableId: string, mapping?: IBaseSyncMapping): IBaseSyncResult;
588
+ declare function syncTwoWayBaseTables(unitA: IBaseUnitData, tableIdA: string, unitB: IBaseUnitData, tableIdB: string, mapping?: IBaseSyncMapping): IBaseTwoWaySyncResult;
589
+ declare function mergeMultipleSourcesIntoBaseTable(sources: Array<{
590
+ unit: IBaseUnitData;
591
+ tableId: string;
592
+ sourceTag?: string;
593
+ }>, targetUnit: IBaseUnitData, targetTableId: string, keyFieldName: string, options?: {
594
+ sourceTagFieldName?: string;
595
+ conflictStrategy?: 'latestWins' | 'firstWins' | 'lastWins';
596
+ syncTimestamp?: string;
597
+ }): IBaseMultiSourceMergeResult;
598
+ declare const syncBaseTables: {
599
+ readonly oneWay: typeof syncOneWayBaseTable;
600
+ readonly twoWay: typeof syncTwoWayBaseTables;
601
+ readonly mergeMultipleSources: typeof mergeMultipleSourcesIntoBaseTable;
602
+ };
345
603
 
346
604
  declare function createSampleProjectBaseData(options?: {
347
605
  id?: string;
@@ -383,7 +641,10 @@ declare class BaseUnitModel extends UnitModel<IBaseUnitData, UniverInstanceType.
383
641
  formatCell(tableId: string, field: IBaseField, value: BaseCellValue): string;
384
642
  queryView(tableId?: string, viewId?: string, overrides?: IBaseViewQueryOverrides): IBaseViewQueryResult;
385
643
  computeGanttTasks(tableId?: string, viewId?: string): IBaseGanttLayoutResult;
644
+ computeHierarchicalList(tableId?: string, viewId?: string): IBaseHierarchicalListResult;
386
645
  computeDashboardWidget(widget: IBaseDashboardWidget): IBaseDashboardWidgetResult;
646
+ getAutomations(): IBaseAutomationRule[];
647
+ getAutomationLogs(): IBaseAutomationRunLog[];
387
648
  __replaceSnapshot(nextSnapshot: IBaseUnitData): void;
388
649
  __applyTablesState(params: {
389
650
  tableOrder: string[];
@@ -391,6 +652,9 @@ declare class BaseUnitModel extends UnitModel<IBaseUnitData, UniverInstanceType.
391
652
  activeTableId?: string;
392
653
  activeViewId?: string;
393
654
  workspaceMode?: 'table' | 'dashboard';
655
+ automations?: IBaseAutomationRule[];
656
+ automationLogs?: IBaseAutomationRunLog[];
657
+ queuedWebhooks?: IBaseQueuedWebhook[];
394
658
  }): void;
395
659
  __setActiveNavigation(params: {
396
660
  activeTableId?: string;
@@ -413,6 +677,9 @@ interface IApplyBaseTablesStateMutationParams {
413
677
  activeTableId?: string;
414
678
  activeViewId?: string;
415
679
  workspaceMode?: 'table' | 'dashboard';
680
+ automations?: IBaseAutomationRule[];
681
+ automationLogs?: IBaseAutomationRunLog[];
682
+ queuedWebhooks?: IBaseQueuedWebhook[];
416
683
  }
417
684
  declare const ApplyBaseTablesStateMutation: IMutation<IApplyBaseTablesStateMutationParams>;
418
685
  interface ISetBaseActiveNavigationMutationParams {
@@ -608,6 +875,43 @@ interface IReplaceBaseSnapshotCommandParams {
608
875
  snapshot: IBaseUnitData;
609
876
  }
610
877
  declare const ReplaceBaseSnapshotCommand: ICommand<IReplaceBaseSnapshotCommandParams>;
878
+ interface IUpdateBaseDetailLayoutCommandParams {
879
+ unitId?: string;
880
+ tableId?: string;
881
+ viewId?: string;
882
+ detailLayout: IBaseDetailLayout;
883
+ }
884
+ declare const UpdateBaseDetailLayoutCommand: ICommand<IUpdateBaseDetailLayoutCommandParams>;
885
+ interface ISaveBaseAutomationRuleCommandParams {
886
+ unitId?: string;
887
+ rule: Omit<IBaseAutomationRule, 'id'> & {
888
+ id?: string;
889
+ };
890
+ onSaved?: (ruleId: string) => void;
891
+ }
892
+ declare const SaveBaseAutomationRuleCommand: ICommand<ISaveBaseAutomationRuleCommandParams>;
893
+ interface IDeleteBaseAutomationRuleCommandParams {
894
+ unitId?: string;
895
+ ruleId: string;
896
+ }
897
+ declare const DeleteBaseAutomationRuleCommand: ICommand<IDeleteBaseAutomationRuleCommandParams>;
898
+ interface IToggleBaseAutomationRuleCommandParams {
899
+ unitId?: string;
900
+ ruleId: string;
901
+ enabled?: boolean;
902
+ }
903
+ declare const ToggleBaseAutomationRuleCommand: ICommand<IToggleBaseAutomationRuleCommandParams>;
904
+ interface ITriggerBaseAutomationCommandParams {
905
+ unitId?: string;
906
+ ruleId?: string;
907
+ tableId?: string;
908
+ recordId?: string;
909
+ trigger?: BaseAutomationTriggerType | 'manual';
910
+ webhookPayload?: unknown;
911
+ webhookExecutor?: BaseWebhookExecutor;
912
+ onExecuted?: (logs: IBaseAutomationRunLog[]) => void;
913
+ }
914
+ declare const TriggerBaseAutomationCommand: ICommand<ITriggerBaseAutomationCommandParams>;
611
915
 
612
916
  declare function parseDelimitedText(text: string, delimiter?: ',' | '\t'): string[][];
613
917
  declare function serializeDelimitedText(rows: ReadonlyArray<ReadonlyArray<string>>, delimiter?: ',' | '\t'): string;
@@ -691,7 +995,7 @@ declare class BaseIoService extends Disposable implements IBaseIoService {
691
995
  saveBase(snapshot: IBaseUnitData): Promise<void>;
692
996
  }
693
997
 
694
- type BaseModalType = null | 'import' | 'export' | 'addField' | 'addView' | 'addWidget' | 'linkPicker';
998
+ type BaseModalType = null | 'import' | 'export' | 'addField' | 'addView' | 'addWidget' | 'linkPicker' | 'automationBuilder';
695
999
  interface ILinkPickerSession {
696
1000
  tableId: string;
697
1001
  recordId: string;
@@ -705,6 +1009,7 @@ interface IBaseSelectionState {
705
1009
  searchQuery: string;
706
1010
  activeModal: BaseModalType;
707
1011
  linkPickerSession: ILinkPickerSession | null;
1012
+ editingAutomationRuleId: string | null;
708
1013
  lastToastMessage: string | null;
709
1014
  }
710
1015
  interface IBaseSelectionService {
@@ -717,6 +1022,7 @@ interface IBaseSelectionService {
717
1022
  setSearchQuery(query: string): void;
718
1023
  openModal(modal: BaseModalType): void;
719
1024
  openLinkPicker(session: ILinkPickerSession | null): void;
1025
+ openAutomationBuilder(ruleId?: string | null): void;
720
1026
  notifyToast(message: string | null): void;
721
1027
  }
722
1028
  declare const IBaseSelectionService: _univerjs_core.IdentifierDecorator<IBaseSelectionService>;
@@ -732,6 +1038,7 @@ declare class BaseSelectionService extends Disposable implements IBaseSelectionS
732
1038
  setSearchQuery(query: string): void;
733
1039
  openModal(modal: BaseModalType): void;
734
1040
  openLinkPicker(session: ILinkPickerSession | null): void;
1041
+ openAutomationBuilder(ruleId?: string | null): void;
735
1042
  notifyToast(message: string | null): void;
736
1043
  }
737
1044
 
@@ -751,6 +1058,8 @@ declare function buildLinearBarcodeBars(value: string): {
751
1058
  interface IUniverBasesConfig {
752
1059
  /** Optional pluggable Import / Export / Save IO adapter */
753
1060
  io?: IBaseIoAdapter;
1061
+ /** Optional pluggable HTTP Webhook executor for automation workflows */
1062
+ webhookExecutor?: BaseWebhookExecutor;
754
1063
  }
755
1064
  declare const UNIVER_BASES_PLUGIN_NAME = "UNIVER_BASES_PLUGIN";
756
1065
  declare class UniverBasesPlugin extends Plugin {
@@ -764,6 +1073,6 @@ declare class UniverBasesPlugin extends Plugin {
764
1073
  onStarting(): void;
765
1074
  }
766
1075
 
767
- declare const VERSION = "1.6.218";
1076
+ declare const VERSION = "1.6.219";
768
1077
 
769
- export { ALL_BASE_FIELD_TYPES, AddBaseDashboardWidgetCommand, AddBaseFieldCommand, AddBaseRecordCommand, AddBaseTableCommand, AddBaseViewCommand, ApplyBaseDashboardsStateMutation, ApplyBaseTablesStateMutation, BASE_ROW_COLOR_PALETTE, BASE_SELECT_PALETTE, type BaseCellValue, type BaseDashboardAggregation, type BaseDashboardChartType, type BaseFieldType, type BaseFilterConjunction, type BaseFilterOperator, type BaseGanttZoom, type BaseIoFormat, BaseIoService, type BaseModalType, type BaseRollupFunction, BaseSelectionService, type BaseSummaryType, BaseUnitModel, type BaseViewType, BatchInsertBaseRecordsCommand, COMPUTED_BASE_FIELD_TYPES, DeleteBaseDashboardWidgetCommand, DeleteBaseFieldCommand, DeleteBaseRecordsCommand, DeleteBaseTableCommand, DeleteBaseViewCommand, type IAddBaseDashboardWidgetCommandParams, type IAddBaseFieldCommandParams, type IAddBaseRecordCommandParams, type IAddBaseTableCommandParams, type IAddBaseViewCommandParams, type IApplyBaseDashboardsStateMutationParams, type IApplyBaseTablesStateMutationParams, type IBarcodeBarSegment, type IBaseAttachment, type IBaseAutomationRule, type IBaseColorRule, type IBaseDashboard, type IBaseDashboardSeriesItem, type IBaseDashboardWidget, type IBaseDashboardWidgetResult, type IBaseEvaluatedRow, type IBaseField, type IBaseFieldConfig, type IBaseFilterRule, type IBaseFormConfig, type IBaseFormFieldItem, type IBaseGanttDependencyEdge, type IBaseGanttLayoutResult, type IBaseGanttTaskItem, type IBaseGroupNode, type IBaseGroupRule, type IBaseIoAdapter, IBaseIoService, type IBasePerson, type IBaseRecord, type IBaseSavedEvent, type IBaseSelectOption, IBaseSelectionService, type IBaseSelectionState, type IBaseSortRule, type IBaseTable, type IBaseUnitData, type IBaseView, type IBaseViewQueryOverrides, type IBaseViewQueryResult, type IBatchInsertBaseRecordsCommandParams, type IDeleteBaseDashboardWidgetCommandParams, type IDeleteBaseFieldCommandParams, type IDeleteBaseRecordsCommandParams, type IDeleteBaseTableCommandParams, type IDeleteBaseViewCommandParams, type IExportBaseCsvOptions, type IExportBaseXlsxOptions, type IImportCsvToTableOptions, type IImportXlsxToBaseOptions, type ILinkPickerSession, type IReorderBaseFieldsCommandParams, type IReplaceBaseSnapshotCommandParams, type IReplaceBaseSnapshotMutationParams, type IResolvedLinkedRecordItem, type ISetActiveBaseTableCommandParams, type ISetActiveBaseViewCommandParams, type ISetBaseActiveNavigationMutationParams, type ISetBaseWorkspaceModeCommandParams, type ISubmitBaseFormResponseCommandParams, type IUniverBasesConfig, type IUpdateBaseDashboardWidgetCommandParams, type IUpdateBaseFieldCommandParams, type IUpdateBaseRecordCommandParams, type IUpdateBaseTableCommandParams, type IUpdateBaseViewCommandParams, ReorderBaseFieldsCommand, ReplaceBaseSnapshotCommand, ReplaceBaseSnapshotMutation, SetActiveBaseTableCommand, SetActiveBaseViewCommand, SetBaseActiveNavigationMutation, SetBaseWorkspaceModeCommand, SubmitBaseFormResponseCommand, UNIVER_BASES_PLUGIN_NAME, UNIVER_BASE_SCHEMA, UNIVER_BASE_SCHEMA_VERSION, UniverBasesPlugin, UpdateBaseDashboardWidgetCommand, UpdateBaseFieldCommand, UpdateBaseRecordCommand, UpdateBaseTableCommand, UpdateBaseViewCommand, VERSION, buildBaseTableFromGridRows, buildLinearBarcodeBars, coerceImportedCellValue, computeBaseDashboardWidget, computeBaseGanttTasks, computeFieldSummary, createDefaultBaseUnitData, createSampleCrmBaseData, createSampleProjectBaseData, evaluateBaseFormula, exportBaseTableToCsv, exportBaseToXlsxBytes, formatBaseCellValue, formatDurationSeconds, importCsvToBaseTable, importXlsxBytesToBase, inferFieldFromColumnSamples, isCellValueEmpty, isComputedBaseField, matchesBaseFilterRule, normalizeLinkIds, parseDelimitedText, queryBaseTableView, resolveBaseCellValue, resolveLinkedRecordItems, roundToPrecision, serializeDelimitedText, toNumericValue };
1078
+ export { ALL_BASE_FIELD_TYPES, AddBaseDashboardWidgetCommand, AddBaseFieldCommand, AddBaseRecordCommand, AddBaseTableCommand, AddBaseViewCommand, ApplyBaseDashboardsStateMutation, ApplyBaseTablesStateMutation, BASE_ROW_COLOR_PALETTE, BASE_SELECT_PALETTE, type BaseAutomationActionType, BaseAutomationService, type BaseAutomationStepType, type BaseAutomationTriggerType, type BaseCellValue, type BaseDashboardAggregation, type BaseDashboardChartType, type BaseFieldType, type BaseFilterConjunction, type BaseFilterOperator, type BaseGanttZoom, type BaseIoFormat, BaseIoService, type BaseModalType, type BaseRollupFunction, BaseSelectionService, type BaseSummaryType, BaseUnitModel, type BaseViewType, type BaseWebhookExecutor, BatchInsertBaseRecordsCommand, COMPUTED_BASE_FIELD_TYPES, DeleteBaseAutomationRuleCommand, DeleteBaseDashboardWidgetCommand, DeleteBaseFieldCommand, DeleteBaseRecordsCommand, DeleteBaseTableCommand, DeleteBaseViewCommand, type IAddBaseDashboardWidgetCommandParams, type IAddBaseFieldCommandParams, type IAddBaseRecordCommandParams, type IAddBaseTableCommandParams, type IAddBaseViewCommandParams, type IApplyBaseDashboardsStateMutationParams, type IApplyBaseTablesStateMutationParams, type IBarcodeBarSegment, type IBaseAttachment, type IBaseAutomationExecutionOptions, type IBaseAutomationExecutionResult, type IBaseAutomationRule, type IBaseAutomationRunLog, IBaseAutomationService, type IBaseAutomationStep, type IBaseAutomationTriggerEvent, type IBaseColorRule, type IBaseDashboard, type IBaseDashboardSeriesItem, type IBaseDashboardWidget, type IBaseDashboardWidgetResult, type IBaseDetailLayout, type IBaseDetailSection, type IBaseEvaluatedRow, type IBaseField, type IBaseFieldConfig, type IBaseFilterRule, type IBaseFormConfig, type IBaseFormFieldConfig, type IBaseFormFieldItem, type IBaseFormFieldRule, type IBaseGanttDependencyEdge, type IBaseGanttLayoutResult, type IBaseGanttTaskItem, type IBaseGroupNode, type IBaseGroupRule, type IBaseHierarchicalListNode, type IBaseHierarchicalListResult, type IBaseIoAdapter, IBaseIoService, type IBaseMultiSourceMergeResult, type IBasePerson, type IBaseQueuedWebhook, type IBaseRecord, type IBaseRowAccessRule, type IBaseRowScopeContext, type IBaseSavedEvent, type IBaseSelectOption, IBaseSelectionService, type IBaseSelectionState, type IBaseSortRule, type IBaseSyncMapping, type IBaseSyncResult, type IBaseTable, type IBaseTwoWaySyncResult, type IBaseUnitData, type IBaseView, type IBaseViewQueryOverrides, type IBaseViewQueryResult, type IBaseWebhookRequest, type IBaseWebhookResponse, type IBatchInsertBaseRecordsCommandParams, type IDeleteBaseAutomationRuleCommandParams, type IDeleteBaseDashboardWidgetCommandParams, type IDeleteBaseFieldCommandParams, type IDeleteBaseRecordsCommandParams, type IDeleteBaseTableCommandParams, type IDeleteBaseViewCommandParams, type IExportBaseCsvOptions, type IExportBaseXlsxOptions, type IImportCsvToTableOptions, type IImportXlsxToBaseOptions, type ILinkPickerSession, type IReorderBaseFieldsCommandParams, type IReplaceBaseSnapshotCommandParams, type IReplaceBaseSnapshotMutationParams, type IResolvedDetailLayout, type IResolvedDetailSection, type IResolvedLinkedRecordItem, type ISaveBaseAutomationRuleCommandParams, type ISetActiveBaseTableCommandParams, type ISetActiveBaseViewCommandParams, type ISetBaseActiveNavigationMutationParams, type ISetBaseWorkspaceModeCommandParams, type ISubmitBaseFormResponseCommandParams, type IToggleBaseAutomationRuleCommandParams, type ITriggerBaseAutomationCommandParams, type IUniverBasesConfig, type IUpdateBaseDashboardWidgetCommandParams, type IUpdateBaseDetailLayoutCommandParams, type IUpdateBaseFieldCommandParams, type IUpdateBaseRecordCommandParams, type IUpdateBaseTableCommandParams, type IUpdateBaseViewCommandParams, MAX_AUTOMATION_RECURSION_DEPTH, ReorderBaseFieldsCommand, ReplaceBaseSnapshotCommand, ReplaceBaseSnapshotMutation, SaveBaseAutomationRuleCommand, SetActiveBaseTableCommand, SetActiveBaseViewCommand, SetBaseActiveNavigationMutation, SetBaseWorkspaceModeCommand, SubmitBaseFormResponseCommand, ToggleBaseAutomationRuleCommand, TriggerBaseAutomationCommand, UNIVER_BASES_PLUGIN_NAME, UNIVER_BASE_SCHEMA, UNIVER_BASE_SCHEMA_VERSION, UniverBasesPlugin, UpdateBaseDashboardWidgetCommand, UpdateBaseDetailLayoutCommand, UpdateBaseFieldCommand, UpdateBaseRecordCommand, UpdateBaseTableCommand, UpdateBaseViewCommand, VERSION, applyBaseRowReadScope, buildBaseTableFromGridRows, buildLinearBarcodeBars, coerceImportedCellValue, computeBaseDashboardWidget, computeBaseGanttTasks, computeBaseHierarchicalList, computeFieldSummary, createDefaultBaseUnitData, createSampleCrmBaseData, createSampleProjectBaseData, doesAutomationTriggerMatch, evaluateAutomationConditions, evaluateBaseFormula, executeBaseAutomations, exportBaseTableToCsv, exportBaseToXlsxBytes, formatBaseCellValue, formatDurationSeconds, importCsvToBaseTable, importXlsxBytesToBase, inferFieldFromColumnSamples, interpolateAutomationCellValue, interpolateAutomationString, isCellValueEmpty, isComputedBaseField, isFormFieldRequired, isFormFieldVisible, matchesBaseFilterRule, mergeMultipleSourcesIntoBaseTable, normalizeAutomationSteps, normalizeLinkIds, parseDelimitedText, queryBaseTableView, resolveBaseCellValue, resolveBaseDetailLayout, resolveLinkedRecordItems, roundToPrecision, runBaseAutomationsInPlaceSync, serializeDelimitedText, syncBaseTables, syncOneWayBaseTable, syncTwoWayBaseTables, toNumericValue };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yudaocode/univer-bases",
3
- "version": "1.6.218",
3
+ "version": "1.6.219",
4
4
  "description": "Univer Bases relational multi-dimensional table unit model, 20+ field types, formula/rollup/lookup engine, commands, and XLSX/CSV codecs",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://github.com/yudaocode/yudao-univer#readme",