@nocobase/plugin-flow-engine 2.1.0-beta.43 → 2.1.0-beta.45

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 (90) hide show
  1. package/dist/client/index.js +1 -1
  2. package/dist/externalVersion.js +9 -9
  3. package/dist/node_modules/@ant-design/icons-svg/package.json +1 -1
  4. package/dist/node_modules/acorn/package.json +1 -1
  5. package/dist/node_modules/acorn-jsx/package.json +1 -1
  6. package/dist/node_modules/acorn-walk/package.json +1 -1
  7. package/dist/node_modules/ses/package.json +1 -1
  8. package/dist/node_modules/zod/package.json +1 -1
  9. package/dist/server/flow-surfaces/authoring-validation.js +160 -21
  10. package/dist/server/flow-surfaces/catalog.js +9 -5
  11. package/dist/server/flow-surfaces/chart-config.js +29 -6
  12. package/dist/server/flow-surfaces/contract-guard.js +39 -5
  13. package/dist/server/flow-surfaces/default-block-actions.js +2 -0
  14. package/dist/server/flow-surfaces/errors.d.ts +15 -0
  15. package/dist/server/flow-surfaces/errors.js +49 -3
  16. package/dist/server/flow-surfaces/filter-group.d.ts +7 -1
  17. package/dist/server/flow-surfaces/filter-group.js +175 -71
  18. package/dist/server/flow-surfaces/public-data-surface-default-filter.js +2 -1
  19. package/dist/server/flow-surfaces/runjs-authoring/ast/bindings.d.ts +66 -0
  20. package/dist/server/flow-surfaces/runjs-authoring/ast/bindings.js +661 -0
  21. package/dist/server/flow-surfaces/runjs-authoring/ast/execution.d.ts +20 -0
  22. package/dist/server/flow-surfaces/runjs-authoring/ast/execution.js +275 -0
  23. package/dist/server/flow-surfaces/runjs-authoring/ast/parser.d.ts +16 -0
  24. package/dist/server/flow-surfaces/runjs-authoring/ast/parser.js +130 -0
  25. package/dist/server/flow-surfaces/runjs-authoring/ast/react-values.d.ts +20 -0
  26. package/dist/server/flow-surfaces/runjs-authoring/ast/react-values.js +401 -0
  27. package/dist/server/flow-surfaces/runjs-authoring/ast/request-config.d.ts +21 -0
  28. package/dist/server/flow-surfaces/runjs-authoring/ast/request-config.js +199 -0
  29. package/dist/server/flow-surfaces/runjs-authoring/ast/source.d.ts +70 -0
  30. package/dist/server/flow-surfaces/runjs-authoring/ast/source.js +895 -0
  31. package/dist/server/flow-surfaces/runjs-authoring/ast/static-bindings.d.ts +23 -0
  32. package/dist/server/flow-surfaces/runjs-authoring/ast/static-bindings.js +618 -0
  33. package/dist/server/flow-surfaces/runjs-authoring/ast/static-values.d.ts +196 -0
  34. package/dist/server/flow-surfaces/runjs-authoring/ast/static-values.js +1777 -0
  35. package/dist/server/flow-surfaces/runjs-authoring/ast/walk.d.ts +10 -0
  36. package/dist/server/flow-surfaces/runjs-authoring/ast/walk.js +55 -0
  37. package/dist/server/flow-surfaces/runjs-authoring/collectors.d.ts +12 -0
  38. package/dist/server/flow-surfaces/runjs-authoring/collectors.js +589 -0
  39. package/dist/server/flow-surfaces/runjs-authoring/index.d.ts +2 -25
  40. package/dist/server/flow-surfaces/runjs-authoring/index.js +5 -11138
  41. package/dist/server/flow-surfaces/runjs-authoring/inspect.d.ts +13 -0
  42. package/dist/server/flow-surfaces/runjs-authoring/inspect.js +149 -0
  43. package/dist/server/flow-surfaces/runjs-authoring/internal-types.d.ts +333 -0
  44. package/dist/server/flow-surfaces/runjs-authoring/internal-types.js +36 -0
  45. package/dist/server/flow-surfaces/runjs-authoring/rules.js +2 -0
  46. package/dist/server/flow-surfaces/runjs-authoring/runtime/constants.d.ts +67 -0
  47. package/dist/server/flow-surfaces/runjs-authoring/runtime/constants.js +757 -0
  48. package/dist/server/flow-surfaces/runjs-authoring/runtime/errors.d.ts +22 -0
  49. package/dist/server/flow-surfaces/runjs-authoring/runtime/errors.js +91 -0
  50. package/dist/server/flow-surfaces/runjs-authoring/runtime/source-budget.d.ts +16 -0
  51. package/dist/server/flow-surfaces/runjs-authoring/runtime/source-budget.js +115 -0
  52. package/dist/server/flow-surfaces/runjs-authoring/runtime/surface.d.ts +19 -0
  53. package/dist/server/flow-surfaces/runjs-authoring/runtime/surface.js +140 -0
  54. package/dist/server/flow-surfaces/runjs-authoring/runtime/types.d.ts +91 -0
  55. package/dist/server/flow-surfaces/runjs-authoring/runtime/types.js +24 -0
  56. package/dist/server/flow-surfaces/runjs-authoring/scan/ctx-api.d.ts +138 -0
  57. package/dist/server/flow-surfaces/runjs-authoring/scan/ctx-api.js +1779 -0
  58. package/dist/server/flow-surfaces/runjs-authoring/scan/filter.d.ts +10 -0
  59. package/dist/server/flow-surfaces/runjs-authoring/scan/filter.js +1583 -0
  60. package/dist/server/flow-surfaces/runjs-authoring/scan/index.d.ts +195 -0
  61. package/dist/server/flow-surfaces/runjs-authoring/scan/index.js +463 -0
  62. package/dist/server/flow-surfaces/runjs-authoring/scan/react-render.d.ts +48 -0
  63. package/dist/server/flow-surfaces/runjs-authoring/scan/react-render.js +379 -0
  64. package/dist/server/flow-surfaces/runjs-authoring/scan/react.d.ts +26 -0
  65. package/dist/server/flow-surfaces/runjs-authoring/scan/react.js +1441 -0
  66. package/dist/server/flow-surfaces/runjs-authoring/scan/resource.d.ts +23 -0
  67. package/dist/server/flow-surfaces/runjs-authoring/scan/resource.js +1427 -0
  68. package/dist/server/flow-surfaces/runjs-authoring/scan/source-patterns.d.ts +91 -0
  69. package/dist/server/flow-surfaces/runjs-authoring/scan/source-patterns.js +889 -0
  70. package/dist/server/flow-surfaces/runjs-authoring/types.d.ts +1 -1
  71. package/dist/server/flow-surfaces/runjs-authoring/unknown-global-stop/index.d.ts +10 -0
  72. package/dist/server/flow-surfaces/runjs-authoring/unknown-global-stop/index.js +40 -0
  73. package/dist/server/flow-surfaces/runjs-authoring/validators/index.d.ts +12 -0
  74. package/dist/server/flow-surfaces/runjs-authoring/validators/index.js +887 -0
  75. package/dist/server/flow-surfaces/service-helpers.d.ts +29 -0
  76. package/dist/server/flow-surfaces/service-helpers.js +105 -0
  77. package/dist/server/flow-surfaces/service-utils.d.ts +15 -3
  78. package/dist/server/flow-surfaces/service-utils.js +5 -4
  79. package/dist/server/flow-surfaces/service.d.ts +4 -0
  80. package/dist/server/flow-surfaces/service.js +360 -30
  81. package/dist/server/flow-surfaces/types.d.ts +3 -0
  82. package/dist/server/repository.d.ts +15 -1
  83. package/dist/server/repository.js +262 -23
  84. package/dist/server/template/contexts.d.ts +2 -0
  85. package/dist/server/template/contexts.js +34 -0
  86. package/dist/server/template/resolver.js +233 -22
  87. package/dist/swagger/flow-surfaces.d.ts +175 -0
  88. package/dist/swagger/flow-surfaces.js +130 -51
  89. package/dist/swagger/index.d.ts +175 -0
  90. package/package.json +2 -2
@@ -203,6 +203,114 @@ function jsonContent(schema, example) {
203
203
  }
204
204
  };
205
205
  }
206
+ function flowSurfaceErrorItemSchema() {
207
+ return {
208
+ type: "object",
209
+ properties: {
210
+ index: {
211
+ type: "integer",
212
+ description: "Optional 1-based position in an aggregate authoring errors[] response",
213
+ example: 1
214
+ },
215
+ code: {
216
+ type: "string",
217
+ description: "Stable machine-readable error code",
218
+ example: "FLOW_SURFACE_BAD_REQUEST"
219
+ },
220
+ message: {
221
+ type: "string",
222
+ description: "Human-readable error message for the caller"
223
+ },
224
+ status: {
225
+ type: "integer",
226
+ description: "HTTP status mapped from the FlowSurfaces error",
227
+ example: 400
228
+ },
229
+ type: {
230
+ type: "string",
231
+ description: "Error category such as bad_request, forbidden, conflict or internal_error",
232
+ example: "bad_request",
233
+ enum: ["bad_request", "forbidden", "conflict", "internal_error"]
234
+ },
235
+ path: {
236
+ type: "string",
237
+ description: "Optional JSON-path-like request location for validation errors",
238
+ example: "$.changes.titleField"
239
+ },
240
+ ruleId: {
241
+ type: "string",
242
+ description: "Optional stable machine-readable validation rule id",
243
+ example: "relation-titleField-unreadable"
244
+ },
245
+ details: {
246
+ type: "object",
247
+ description: "Optional structured context that helps callers repair the request",
248
+ additionalProperties: true,
249
+ example: {
250
+ action: "configure",
251
+ fieldPath: "manager",
252
+ titleField: "id",
253
+ targetCollection: "employees",
254
+ invalidReason: "id",
255
+ availableFields: ["nickname", "title"],
256
+ suggestion: "Use one of: nickname, title."
257
+ }
258
+ }
259
+ },
260
+ required: ["message", "type", "code", "status"],
261
+ additionalProperties: false
262
+ };
263
+ }
264
+ function flowSurfaceAggregateRepairDetailsSchema() {
265
+ return {
266
+ type: "object",
267
+ description: "Optional aggregate authoring repair contract. When present, callers should fix every listed child error before retrying the same write.",
268
+ properties: {
269
+ errorCount: {
270
+ type: "integer",
271
+ description: "Number of child errors in the aggregate response",
272
+ example: 2
273
+ },
274
+ mustFixAllErrorsBeforeRetry: {
275
+ type: "boolean",
276
+ example: true
277
+ },
278
+ retryPolicy: {
279
+ type: "string",
280
+ example: "fix_all_errors_before_retry_same_write"
281
+ },
282
+ sameWriteRetryRequired: {
283
+ type: "boolean",
284
+ example: true
285
+ },
286
+ agentInstruction: {
287
+ type: "string",
288
+ description: "Human-readable repair instruction for agentic callers"
289
+ },
290
+ requiredBlockPolicy: {
291
+ type: "object",
292
+ properties: {
293
+ requiredBlockTypes: {
294
+ type: "array",
295
+ items: {
296
+ type: "string"
297
+ }
298
+ },
299
+ fixStrategy: {
300
+ type: "string",
301
+ example: "repair_same_block_type"
302
+ },
303
+ doNotReplaceOrDrop: {
304
+ type: "boolean",
305
+ example: true
306
+ }
307
+ },
308
+ additionalProperties: true
309
+ }
310
+ },
311
+ additionalProperties: true
312
+ };
313
+ }
206
314
  function requestBody(schemaName, example, description) {
207
315
  return {
208
316
  required: true,
@@ -5010,6 +5118,16 @@ const schemas = {
5010
5118
  type: {
5011
5119
  type: "string",
5012
5120
  enum: ["bad_request", "forbidden", "conflict", "internal_error"]
5121
+ },
5122
+ errorCount: {
5123
+ type: "integer",
5124
+ description: "Present for aggregate authoring failures and equal to errors.length"
5125
+ },
5126
+ details: flowSurfaceAggregateRepairDetailsSchema(),
5127
+ errors: {
5128
+ type: "array",
5129
+ description: "Present for aggregate item failures; contains the structured child authoring errors",
5130
+ items: flowSurfaceErrorItemSchema()
5013
5131
  }
5014
5132
  },
5015
5133
  required: ["message", "type", "code", "status"],
@@ -5938,59 +6056,20 @@ const schemas = {
5938
6056
  ]
5939
6057
  },
5940
6058
  properties: {
6059
+ message: {
6060
+ type: "string",
6061
+ description: "Present for aggregate authoring failures and summarizes the full validation batch",
6062
+ example: "flowSurfaces authoring validation failed with 2 error(s); fix all errors before retrying the same write"
6063
+ },
6064
+ errorCount: {
6065
+ type: "integer",
6066
+ description: "Present for aggregate authoring failures and equal to errors.length",
6067
+ example: 2
6068
+ },
6069
+ details: flowSurfaceAggregateRepairDetailsSchema(),
5941
6070
  errors: {
5942
6071
  type: "array",
5943
- items: {
5944
- type: "object",
5945
- properties: {
5946
- code: {
5947
- type: "string",
5948
- description: "Stable machine-readable error code",
5949
- example: "FLOW_SURFACE_BAD_REQUEST"
5950
- },
5951
- message: {
5952
- type: "string",
5953
- description: "Human-readable error message for the caller"
5954
- },
5955
- status: {
5956
- type: "integer",
5957
- description: "HTTP status mapped from the FlowSurfaces error",
5958
- example: 400
5959
- },
5960
- type: {
5961
- type: "string",
5962
- description: "Error category such as bad_request, forbidden, conflict or internal_error",
5963
- example: "bad_request",
5964
- enum: ["bad_request", "forbidden", "conflict", "internal_error"]
5965
- },
5966
- path: {
5967
- type: "string",
5968
- description: "Optional JSON-path-like request location for validation errors",
5969
- example: "$.changes.titleField"
5970
- },
5971
- ruleId: {
5972
- type: "string",
5973
- description: "Optional stable machine-readable validation rule id",
5974
- example: "relation-titleField-unreadable"
5975
- },
5976
- details: {
5977
- type: "object",
5978
- description: "Optional structured context that helps callers repair the request",
5979
- additionalProperties: true,
5980
- example: {
5981
- action: "configure",
5982
- fieldPath: "manager",
5983
- titleField: "id",
5984
- targetCollection: "employees",
5985
- invalidReason: "id",
5986
- availableFields: ["nickname", "title"],
5987
- suggestion: "Use one of: nickname, title."
5988
- }
5989
- }
5990
- },
5991
- required: ["message", "type", "code", "status"],
5992
- additionalProperties: false
5993
- }
6072
+ items: flowSurfaceErrorItemSchema()
5994
6073
  }
5995
6074
  },
5996
6075
  additionalProperties: true
@@ -4001,6 +4001,118 @@ declare const _default: {
4001
4001
  type: string;
4002
4002
  enum: string[];
4003
4003
  };
4004
+ errorCount: {
4005
+ type: string;
4006
+ description: string;
4007
+ };
4008
+ details: {
4009
+ type: string;
4010
+ description: string;
4011
+ properties: {
4012
+ errorCount: {
4013
+ type: string;
4014
+ description: string;
4015
+ example: number;
4016
+ };
4017
+ mustFixAllErrorsBeforeRetry: {
4018
+ type: string;
4019
+ example: boolean;
4020
+ };
4021
+ retryPolicy: {
4022
+ type: string;
4023
+ example: string;
4024
+ };
4025
+ sameWriteRetryRequired: {
4026
+ type: string;
4027
+ example: boolean;
4028
+ };
4029
+ agentInstruction: {
4030
+ type: string;
4031
+ description: string;
4032
+ };
4033
+ requiredBlockPolicy: {
4034
+ type: string;
4035
+ properties: {
4036
+ requiredBlockTypes: {
4037
+ type: string;
4038
+ items: {
4039
+ type: string;
4040
+ };
4041
+ };
4042
+ fixStrategy: {
4043
+ type: string;
4044
+ example: string;
4045
+ };
4046
+ doNotReplaceOrDrop: {
4047
+ type: string;
4048
+ example: boolean;
4049
+ };
4050
+ };
4051
+ additionalProperties: boolean;
4052
+ };
4053
+ };
4054
+ additionalProperties: boolean;
4055
+ };
4056
+ errors: {
4057
+ type: string;
4058
+ description: string;
4059
+ items: {
4060
+ type: string;
4061
+ properties: {
4062
+ index: {
4063
+ type: string;
4064
+ description: string;
4065
+ example: number;
4066
+ };
4067
+ code: {
4068
+ type: string;
4069
+ description: string;
4070
+ example: string;
4071
+ };
4072
+ message: {
4073
+ type: string;
4074
+ description: string;
4075
+ };
4076
+ status: {
4077
+ type: string;
4078
+ description: string;
4079
+ example: number;
4080
+ };
4081
+ type: {
4082
+ type: string;
4083
+ description: string;
4084
+ example: string;
4085
+ enum: string[];
4086
+ };
4087
+ path: {
4088
+ type: string;
4089
+ description: string;
4090
+ example: string;
4091
+ };
4092
+ ruleId: {
4093
+ type: string;
4094
+ description: string;
4095
+ example: string;
4096
+ };
4097
+ details: {
4098
+ type: string;
4099
+ description: string;
4100
+ additionalProperties: boolean;
4101
+ example: {
4102
+ action: string;
4103
+ fieldPath: string;
4104
+ titleField: string;
4105
+ targetCollection: string;
4106
+ invalidReason: string;
4107
+ availableFields: string[];
4108
+ suggestion: string;
4109
+ };
4110
+ };
4111
+ };
4112
+ required: string[];
4113
+ additionalProperties: boolean;
4114
+ };
4115
+ };
4004
4116
  };
4005
4117
  required: string[];
4006
4118
  additionalProperties: boolean;
@@ -5250,11 +5362,74 @@ declare const _default: {
5250
5362
  }[];
5251
5363
  };
5252
5364
  properties: {
5365
+ message: {
5366
+ type: string;
5367
+ description: string;
5368
+ example: string;
5369
+ };
5370
+ errorCount: {
5371
+ type: string;
5372
+ description: string;
5373
+ example: number;
5374
+ };
5375
+ details: {
5376
+ type: string;
5377
+ description: string;
5378
+ properties: {
5379
+ errorCount: {
5380
+ type: string;
5381
+ description: string;
5382
+ example: number;
5383
+ };
5384
+ mustFixAllErrorsBeforeRetry: {
5385
+ type: string;
5386
+ example: boolean;
5387
+ };
5388
+ retryPolicy: {
5389
+ type: string;
5390
+ example: string;
5391
+ };
5392
+ sameWriteRetryRequired: {
5393
+ type: string;
5394
+ example: boolean;
5395
+ };
5396
+ agentInstruction: {
5397
+ type: string;
5398
+ description: string;
5399
+ };
5400
+ requiredBlockPolicy: {
5401
+ type: string;
5402
+ properties: {
5403
+ requiredBlockTypes: {
5404
+ type: string;
5405
+ items: {
5406
+ type: string;
5407
+ };
5408
+ };
5409
+ fixStrategy: {
5410
+ type: string;
5411
+ example: string;
5412
+ };
5413
+ doNotReplaceOrDrop: {
5414
+ type: string;
5415
+ example: boolean;
5416
+ };
5417
+ };
5418
+ additionalProperties: boolean;
5419
+ };
5420
+ };
5421
+ additionalProperties: boolean;
5422
+ };
5253
5423
  errors: {
5254
5424
  type: string;
5255
5425
  items: {
5256
5426
  type: string;
5257
5427
  properties: {
5428
+ index: {
5429
+ type: string;
5430
+ description: string;
5431
+ example: number;
5432
+ };
5258
5433
  code: {
5259
5434
  type: string;
5260
5435
  description: string;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "displayName.zh-CN": "前端流引擎",
5
5
  "description": "",
6
6
  "description.zh-CN": "",
7
- "version": "2.1.0-beta.43",
7
+ "version": "2.1.0-beta.45",
8
8
  "main": "./dist/server/index.js",
9
9
  "license": "Apache-2.0",
10
10
  "devDependencies": {
@@ -26,5 +26,5 @@
26
26
  "@nocobase/test": "2.x",
27
27
  "@nocobase/utils": "2.x"
28
28
  },
29
- "gitHead": "6d7750e2373bf2451d246de88cc1f62491685e18"
29
+ "gitHead": "42587115fc34c3eb01ef2b2549f1c998e5708318"
30
30
  }