@nocobase/plugin-flow-engine 2.1.0-alpha.20 → 2.1.0-alpha.22

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 (50) hide show
  1. package/dist/externalVersion.js +11 -10
  2. package/dist/node_modules/ses/dist/ses.cjs +1 -1
  3. package/dist/node_modules/ses/package.json +1 -1
  4. package/dist/node_modules/zod/index.cjs +1 -1
  5. package/dist/node_modules/zod/package.json +1 -1
  6. package/dist/server/flow-surfaces/action-scope.d.ts +1 -0
  7. package/dist/server/flow-surfaces/action-scope.js +4 -0
  8. package/dist/server/flow-surfaces/apply/compiler.js +1 -1
  9. package/dist/server/flow-surfaces/approval/builder.js +8 -8
  10. package/dist/server/flow-surfaces/blueprint/compile-blocks.js +192 -29
  11. package/dist/server/flow-surfaces/blueprint/defaults.d.ts +26 -0
  12. package/dist/server/flow-surfaces/blueprint/defaults.js +133 -0
  13. package/dist/server/flow-surfaces/blueprint/index.d.ts +1 -1
  14. package/dist/server/flow-surfaces/blueprint/normalize-document.js +121 -1
  15. package/dist/server/flow-surfaces/blueprint/public-types.d.ts +32 -0
  16. package/dist/server/flow-surfaces/builder.d.ts +2 -2
  17. package/dist/server/flow-surfaces/builder.js +148 -50
  18. package/dist/server/flow-surfaces/catalog.js +276 -34
  19. package/dist/server/flow-surfaces/compose-compiler.d.ts +2 -0
  20. package/dist/server/flow-surfaces/compose-compiler.js +5 -1
  21. package/dist/server/flow-surfaces/configure-options.js +88 -12
  22. package/dist/server/flow-surfaces/contract-guard.js +60 -69
  23. package/dist/server/flow-surfaces/default-action-popup.d.ts +11 -1
  24. package/dist/server/flow-surfaces/default-action-popup.js +72 -12
  25. package/dist/server/flow-surfaces/default-block-actions.js +8 -1
  26. package/dist/server/flow-surfaces/filter-group.d.ts +15 -0
  27. package/dist/server/flow-surfaces/filter-group.js +94 -0
  28. package/dist/server/flow-surfaces/index.js +70 -2
  29. package/dist/server/flow-surfaces/node-use-sets.js +6 -1
  30. package/dist/server/flow-surfaces/placement.js +3 -0
  31. package/dist/server/flow-surfaces/public-data-surface-default-filter.d.ts +20 -0
  32. package/dist/server/flow-surfaces/public-data-surface-default-filter.js +111 -0
  33. package/dist/server/flow-surfaces/reaction/registry.d.ts +7 -0
  34. package/dist/server/flow-surfaces/reaction/registry.js +7 -0
  35. package/dist/server/flow-surfaces/service-utils.d.ts +7 -0
  36. package/dist/server/flow-surfaces/service-utils.js +58 -9
  37. package/dist/server/flow-surfaces/service.d.ts +73 -3
  38. package/dist/server/flow-surfaces/service.js +1794 -162
  39. package/dist/server/flow-surfaces/support-matrix.d.ts +5 -2
  40. package/dist/server/flow-surfaces/support-matrix.js +16 -3
  41. package/dist/server/flow-surfaces/surface-context.js +2 -1
  42. package/dist/server/flow-surfaces/template-display.d.ts +20 -0
  43. package/dist/server/flow-surfaces/template-display.js +289 -0
  44. package/dist/server/flow-surfaces/types.d.ts +1 -0
  45. package/dist/swagger/flow-surfaces.d.ts +160 -0
  46. package/dist/swagger/flow-surfaces.examples.d.ts +117 -11
  47. package/dist/swagger/flow-surfaces.examples.js +152 -1
  48. package/dist/swagger/flow-surfaces.js +141 -21
  49. package/dist/swagger/index.d.ts +160 -0
  50. package/package.json +2 -2
@@ -1,11 +1,3 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
1
  export declare const flowSurfaceExamples: {
10
2
  catalog: {
11
3
  target: {
@@ -71,15 +63,38 @@ export declare const flowSurfaceExamples: {
71
63
  }[])[];
72
64
  };
73
65
  actions: string[];
66
+ defaultFilter?: undefined;
74
67
  } | {
75
68
  key: string;
76
69
  type: string;
77
70
  collection: string;
71
+ defaultFilter: {
72
+ logic: string;
73
+ items: {
74
+ path: string;
75
+ operator: string;
76
+ value: string;
77
+ }[];
78
+ };
78
79
  fields: string[];
79
- actions: {
80
+ actions: ({
80
81
  key: string;
81
82
  type: string;
82
- }[];
83
+ settings: {
84
+ defaultFilter: {
85
+ logic: string;
86
+ items: {
87
+ path: string;
88
+ operator: string;
89
+ value: string;
90
+ }[];
91
+ };
92
+ };
93
+ } | {
94
+ key: string;
95
+ type: string;
96
+ settings?: undefined;
97
+ })[];
83
98
  fieldsLayout?: undefined;
84
99
  })[];
85
100
  layout: {
@@ -335,6 +350,7 @@ export declare const flowSurfaceExamples: {
335
350
  }[][];
336
351
  };
337
352
  actions: string[];
353
+ defaultFilter?: undefined;
338
354
  recordActions?: undefined;
339
355
  } | {
340
356
  key: string;
@@ -343,10 +359,30 @@ export declare const flowSurfaceExamples: {
343
359
  dataSourceKey: string;
344
360
  collectionName: string;
345
361
  };
362
+ defaultFilter: {
363
+ logic: string;
364
+ items: {
365
+ path: string;
366
+ operator: string;
367
+ value: string;
368
+ }[];
369
+ };
346
370
  fields: (string | {
347
371
  fieldPath: string;
348
372
  })[];
349
- actions: string[];
373
+ actions: (string | {
374
+ type: string;
375
+ settings: {
376
+ defaultFilter: {
377
+ logic: string;
378
+ items: {
379
+ path: string;
380
+ operator: string;
381
+ value: string;
382
+ }[];
383
+ };
384
+ };
385
+ })[];
350
386
  recordActions: (string | {
351
387
  type: string;
352
388
  popup: {
@@ -424,6 +460,14 @@ export declare const flowSurfaceExamples: {
424
460
  dataSourceKey: string;
425
461
  collectionName: string;
426
462
  };
463
+ defaultFilter: {
464
+ logic: string;
465
+ items: {
466
+ path: string;
467
+ operator: string;
468
+ value: string;
469
+ }[];
470
+ };
427
471
  fields: (string | {
428
472
  fieldPath: string;
429
473
  })[];
@@ -460,6 +504,14 @@ export declare const flowSurfaceExamples: {
460
504
  dataSourceKey: string;
461
505
  collectionName: string;
462
506
  };
507
+ defaultFilter: {
508
+ logic: string;
509
+ items: {
510
+ path: string;
511
+ operator: string;
512
+ value: string;
513
+ }[];
514
+ };
463
515
  fields: (string | {
464
516
  fieldPath: string;
465
517
  })[];
@@ -819,6 +871,37 @@ export declare const flowSurfaceExamples: {
819
871
  binding: string;
820
872
  };
821
873
  };
874
+ addTableBlockWithDefaultFilters: {
875
+ target: {
876
+ uid: string;
877
+ };
878
+ type: string;
879
+ defaultFilter: {
880
+ logic: string;
881
+ items: {
882
+ path: string;
883
+ operator: string;
884
+ value: string;
885
+ }[];
886
+ };
887
+ resourceInit: {
888
+ dataSourceKey: string;
889
+ collectionName: string;
890
+ };
891
+ defaultActionSettings: {
892
+ filter: {
893
+ filterableFieldNames: string[];
894
+ defaultFilter: {
895
+ logic: string;
896
+ items: {
897
+ path: string;
898
+ operator: string;
899
+ value: string;
900
+ }[];
901
+ };
902
+ };
903
+ };
904
+ };
822
905
  addPopupAssociatedBlock: {
823
906
  target: {
824
907
  uid: string;
@@ -1120,6 +1203,14 @@ export declare const flowSurfaceExamples: {
1120
1203
  blocks: ({
1121
1204
  key: string;
1122
1205
  type: string;
1206
+ defaultFilter: {
1207
+ logic: string;
1208
+ items: {
1209
+ path: string;
1210
+ operator: string;
1211
+ value: string;
1212
+ }[];
1213
+ };
1123
1214
  resourceInit: {
1124
1215
  dataSourceKey: string;
1125
1216
  collectionName: string;
@@ -1129,6 +1220,19 @@ export declare const flowSurfaceExamples: {
1129
1220
  pageSize: number;
1130
1221
  content?: undefined;
1131
1222
  };
1223
+ defaultActionSettings: {
1224
+ filter: {
1225
+ filterableFieldNames: string[];
1226
+ defaultFilter: {
1227
+ logic: string;
1228
+ items: {
1229
+ path: string;
1230
+ operator: string;
1231
+ value: string;
1232
+ }[];
1233
+ };
1234
+ };
1235
+ };
1132
1236
  } | {
1133
1237
  key: string;
1134
1238
  type: string;
@@ -1137,7 +1241,9 @@ export declare const flowSurfaceExamples: {
1137
1241
  title?: undefined;
1138
1242
  pageSize?: undefined;
1139
1243
  };
1244
+ defaultFilter?: undefined;
1140
1245
  resourceInit?: undefined;
1246
+ defaultActionSettings?: undefined;
1141
1247
  })[];
1142
1248
  };
1143
1249
  addFields: {
@@ -29,6 +29,26 @@ __export(flow_surfaces_examples_exports, {
29
29
  flowSurfaceExamples: () => flowSurfaceExamples
30
30
  });
31
31
  module.exports = __toCommonJS(flow_surfaces_examples_exports);
32
+ const makePublicBlockDefaultFilter = (items = [
33
+ {
34
+ path: "username",
35
+ operator: "$includes",
36
+ value: ""
37
+ },
38
+ {
39
+ path: "email",
40
+ operator: "$includes",
41
+ value: ""
42
+ },
43
+ {
44
+ path: "status",
45
+ operator: "$eq",
46
+ value: ""
47
+ }
48
+ ]) => ({
49
+ logic: "$and",
50
+ items
51
+ });
32
52
  const flowSurfaceExamples = {
33
53
  catalog: {
34
54
  target: {
@@ -113,8 +133,33 @@ const flowSurfaceExamples = {
113
133
  key: "employeesTable",
114
134
  type: "table",
115
135
  collection: "employees",
136
+ defaultFilter: makePublicBlockDefaultFilter([
137
+ {
138
+ path: "nickname",
139
+ operator: "$includes",
140
+ value: ""
141
+ },
142
+ {
143
+ path: "status",
144
+ operator: "$eq",
145
+ value: ""
146
+ }
147
+ ]),
116
148
  fields: ["nickname", "status", "total"],
117
149
  actions: [
150
+ {
151
+ key: "filterAction",
152
+ type: "filter",
153
+ settings: {
154
+ defaultFilter: makePublicBlockDefaultFilter([
155
+ {
156
+ path: "status",
157
+ operator: "$eq",
158
+ value: "active"
159
+ }
160
+ ])
161
+ }
162
+ },
118
163
  {
119
164
  key: "refreshAction",
120
165
  type: "refresh"
@@ -473,8 +518,26 @@ const flowSurfaceExamples = {
473
518
  dataSourceKey: "main",
474
519
  collectionName: "users"
475
520
  },
521
+ defaultFilter: makePublicBlockDefaultFilter(),
476
522
  fields: ["username", "nickname", { fieldPath: "roles.title" }],
477
- actions: ["filter", "addNew", "refresh", "bulkDelete", "link"],
523
+ actions: [
524
+ {
525
+ type: "filter",
526
+ settings: {
527
+ defaultFilter: makePublicBlockDefaultFilter([
528
+ {
529
+ path: "status",
530
+ operator: "$eq",
531
+ value: "active"
532
+ }
533
+ ])
534
+ }
535
+ },
536
+ "addNew",
537
+ "refresh",
538
+ "bulkDelete",
539
+ "link"
540
+ ],
478
541
  recordActions: [
479
542
  "view",
480
543
  "edit",
@@ -561,6 +624,13 @@ const flowSurfaceExamples = {
561
624
  dataSourceKey: "main",
562
625
  collectionName: "employees"
563
626
  },
627
+ defaultFilter: makePublicBlockDefaultFilter([
628
+ {
629
+ path: "nickname",
630
+ operator: "$includes",
631
+ value: ""
632
+ }
633
+ ]),
564
634
  fields: [
565
635
  "nickname",
566
636
  {
@@ -609,6 +679,13 @@ const flowSurfaceExamples = {
609
679
  dataSourceKey: "main",
610
680
  collectionName: "employees"
611
681
  },
682
+ defaultFilter: makePublicBlockDefaultFilter([
683
+ {
684
+ path: "nickname",
685
+ operator: "$includes",
686
+ value: ""
687
+ }
688
+ ]),
612
689
  fields: [
613
690
  "nickname",
614
691
  {
@@ -988,6 +1065,48 @@ const flowSurfaceExamples = {
988
1065
  binding: "currentRecord"
989
1066
  }
990
1067
  },
1068
+ addTableBlockWithDefaultFilters: {
1069
+ target: {
1070
+ uid: "page-grid-uid"
1071
+ },
1072
+ type: "table",
1073
+ defaultFilter: makePublicBlockDefaultFilter([
1074
+ {
1075
+ path: "username",
1076
+ operator: "$includes",
1077
+ value: "staff"
1078
+ }
1079
+ ]),
1080
+ resourceInit: {
1081
+ dataSourceKey: "main",
1082
+ collectionName: "users"
1083
+ },
1084
+ defaultActionSettings: {
1085
+ filter: {
1086
+ filterableFieldNames: ["username", "email", "status"],
1087
+ defaultFilter: {
1088
+ logic: "$and",
1089
+ items: [
1090
+ {
1091
+ path: "username",
1092
+ operator: "$includes",
1093
+ value: ""
1094
+ },
1095
+ {
1096
+ path: "email",
1097
+ operator: "$includes",
1098
+ value: ""
1099
+ },
1100
+ {
1101
+ path: "status",
1102
+ operator: "$eq",
1103
+ value: ""
1104
+ }
1105
+ ]
1106
+ }
1107
+ }
1108
+ }
1109
+ },
991
1110
  addPopupAssociatedBlock: {
992
1111
  target: {
993
1112
  uid: "association-popup-action-uid"
@@ -1300,6 +1419,13 @@ const flowSurfaceExamples = {
1300
1419
  {
1301
1420
  key: "usersTable",
1302
1421
  type: "table",
1422
+ defaultFilter: makePublicBlockDefaultFilter([
1423
+ {
1424
+ path: "username",
1425
+ operator: "$includes",
1426
+ value: "staff"
1427
+ }
1428
+ ]),
1303
1429
  resourceInit: {
1304
1430
  dataSourceKey: "main",
1305
1431
  collectionName: "users"
@@ -1307,6 +1433,31 @@ const flowSurfaceExamples = {
1307
1433
  settings: {
1308
1434
  title: "Users table",
1309
1435
  pageSize: 50
1436
+ },
1437
+ defaultActionSettings: {
1438
+ filter: {
1439
+ filterableFieldNames: ["username", "email", "status"],
1440
+ defaultFilter: {
1441
+ logic: "$and",
1442
+ items: [
1443
+ {
1444
+ path: "username",
1445
+ operator: "$includes",
1446
+ value: ""
1447
+ },
1448
+ {
1449
+ path: "email",
1450
+ operator: "$includes",
1451
+ value: ""
1452
+ },
1453
+ {
1454
+ path: "status",
1455
+ operator: "$eq",
1456
+ value: ""
1457
+ }
1458
+ ]
1459
+ }
1460
+ }
1310
1461
  }
1311
1462
  },
1312
1463
  {