@nocobase/plugin-flow-engine 2.1.0-alpha.45 → 2.1.0-alpha.47

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 (96) 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/apply/compiler.js +10 -11
  10. package/dist/server/flow-surfaces/authoring-validation.d.ts +1 -0
  11. package/dist/server/flow-surfaces/authoring-validation.js +773 -26
  12. package/dist/server/flow-surfaces/blueprint/normalize-document.js +5 -1
  13. package/dist/server/flow-surfaces/catalog.js +9 -5
  14. package/dist/server/flow-surfaces/chart-config.js +220 -16
  15. package/dist/server/flow-surfaces/contract-guard.js +40 -6
  16. package/dist/server/flow-surfaces/default-block-actions.js +2 -0
  17. package/dist/server/flow-surfaces/errors.d.ts +15 -0
  18. package/dist/server/flow-surfaces/errors.js +49 -3
  19. package/dist/server/flow-surfaces/event-flow-normalizer.d.ts +19 -0
  20. package/dist/server/flow-surfaces/event-flow-normalizer.js +128 -0
  21. package/dist/server/flow-surfaces/filter-group.d.ts +9 -1
  22. package/dist/server/flow-surfaces/filter-group.js +402 -3
  23. package/dist/server/flow-surfaces/public-data-surface-default-filter.js +2 -1
  24. package/dist/server/flow-surfaces/route-sync.js +19 -2
  25. package/dist/server/flow-surfaces/runjs-authoring/ast/bindings.d.ts +66 -0
  26. package/dist/server/flow-surfaces/runjs-authoring/ast/bindings.js +661 -0
  27. package/dist/server/flow-surfaces/runjs-authoring/ast/execution.d.ts +20 -0
  28. package/dist/server/flow-surfaces/runjs-authoring/ast/execution.js +275 -0
  29. package/dist/server/flow-surfaces/runjs-authoring/ast/parser.d.ts +16 -0
  30. package/dist/server/flow-surfaces/runjs-authoring/ast/parser.js +130 -0
  31. package/dist/server/flow-surfaces/runjs-authoring/ast/react-values.d.ts +20 -0
  32. package/dist/server/flow-surfaces/runjs-authoring/ast/react-values.js +401 -0
  33. package/dist/server/flow-surfaces/runjs-authoring/ast/request-config.d.ts +21 -0
  34. package/dist/server/flow-surfaces/runjs-authoring/ast/request-config.js +199 -0
  35. package/dist/server/flow-surfaces/runjs-authoring/ast/source.d.ts +70 -0
  36. package/dist/server/flow-surfaces/runjs-authoring/ast/source.js +895 -0
  37. package/dist/server/flow-surfaces/runjs-authoring/ast/static-bindings.d.ts +23 -0
  38. package/dist/server/flow-surfaces/runjs-authoring/ast/static-bindings.js +618 -0
  39. package/dist/server/flow-surfaces/runjs-authoring/ast/static-values.d.ts +196 -0
  40. package/dist/server/flow-surfaces/runjs-authoring/ast/static-values.js +1777 -0
  41. package/dist/server/flow-surfaces/runjs-authoring/ast/walk.d.ts +10 -0
  42. package/dist/server/flow-surfaces/runjs-authoring/ast/walk.js +55 -0
  43. package/dist/server/flow-surfaces/runjs-authoring/collectors.d.ts +12 -0
  44. package/dist/server/flow-surfaces/runjs-authoring/collectors.js +589 -0
  45. package/dist/server/flow-surfaces/runjs-authoring/index.d.ts +2 -25
  46. package/dist/server/flow-surfaces/runjs-authoring/index.js +5 -11138
  47. package/dist/server/flow-surfaces/runjs-authoring/inspect.d.ts +13 -0
  48. package/dist/server/flow-surfaces/runjs-authoring/inspect.js +149 -0
  49. package/dist/server/flow-surfaces/runjs-authoring/internal-types.d.ts +333 -0
  50. package/dist/server/flow-surfaces/runjs-authoring/internal-types.js +36 -0
  51. package/dist/server/flow-surfaces/runjs-authoring/rules.js +2 -0
  52. package/dist/server/flow-surfaces/runjs-authoring/runtime/constants.d.ts +67 -0
  53. package/dist/server/flow-surfaces/runjs-authoring/runtime/constants.js +757 -0
  54. package/dist/server/flow-surfaces/runjs-authoring/runtime/errors.d.ts +22 -0
  55. package/dist/server/flow-surfaces/runjs-authoring/runtime/errors.js +91 -0
  56. package/dist/server/flow-surfaces/runjs-authoring/runtime/source-budget.d.ts +16 -0
  57. package/dist/server/flow-surfaces/runjs-authoring/runtime/source-budget.js +115 -0
  58. package/dist/server/flow-surfaces/runjs-authoring/runtime/surface.d.ts +19 -0
  59. package/dist/server/flow-surfaces/runjs-authoring/runtime/surface.js +140 -0
  60. package/dist/server/flow-surfaces/runjs-authoring/runtime/types.d.ts +91 -0
  61. package/dist/server/flow-surfaces/runjs-authoring/runtime/types.js +24 -0
  62. package/dist/server/flow-surfaces/runjs-authoring/scan/ctx-api.d.ts +138 -0
  63. package/dist/server/flow-surfaces/runjs-authoring/scan/ctx-api.js +1779 -0
  64. package/dist/server/flow-surfaces/runjs-authoring/scan/filter.d.ts +10 -0
  65. package/dist/server/flow-surfaces/runjs-authoring/scan/filter.js +1583 -0
  66. package/dist/server/flow-surfaces/runjs-authoring/scan/index.d.ts +195 -0
  67. package/dist/server/flow-surfaces/runjs-authoring/scan/index.js +463 -0
  68. package/dist/server/flow-surfaces/runjs-authoring/scan/react-render.d.ts +48 -0
  69. package/dist/server/flow-surfaces/runjs-authoring/scan/react-render.js +379 -0
  70. package/dist/server/flow-surfaces/runjs-authoring/scan/react.d.ts +26 -0
  71. package/dist/server/flow-surfaces/runjs-authoring/scan/react.js +1441 -0
  72. package/dist/server/flow-surfaces/runjs-authoring/scan/resource.d.ts +23 -0
  73. package/dist/server/flow-surfaces/runjs-authoring/scan/resource.js +1427 -0
  74. package/dist/server/flow-surfaces/runjs-authoring/scan/source-patterns.d.ts +91 -0
  75. package/dist/server/flow-surfaces/runjs-authoring/scan/source-patterns.js +889 -0
  76. package/dist/server/flow-surfaces/runjs-authoring/types.d.ts +1 -1
  77. package/dist/server/flow-surfaces/runjs-authoring/unknown-global-stop/index.d.ts +10 -0
  78. package/dist/server/flow-surfaces/runjs-authoring/unknown-global-stop/index.js +40 -0
  79. package/dist/server/flow-surfaces/runjs-authoring/validators/index.d.ts +12 -0
  80. package/dist/server/flow-surfaces/runjs-authoring/validators/index.js +887 -0
  81. package/dist/server/flow-surfaces/service-helpers.d.ts +29 -0
  82. package/dist/server/flow-surfaces/service-helpers.js +105 -0
  83. package/dist/server/flow-surfaces/service-utils.d.ts +15 -3
  84. package/dist/server/flow-surfaces/service-utils.js +6 -5
  85. package/dist/server/flow-surfaces/service.d.ts +7 -1
  86. package/dist/server/flow-surfaces/service.js +488 -94
  87. package/dist/server/flow-surfaces/types.d.ts +3 -0
  88. package/dist/server/repository.d.ts +15 -1
  89. package/dist/server/repository.js +262 -23
  90. package/dist/server/template/contexts.d.ts +2 -0
  91. package/dist/server/template/contexts.js +34 -0
  92. package/dist/server/template/resolver.js +233 -22
  93. package/dist/swagger/flow-surfaces.d.ts +175 -0
  94. package/dist/swagger/flow-surfaces.js +130 -51
  95. package/dist/swagger/index.d.ts +175 -0
  96. package/package.json +2 -2
@@ -0,0 +1,196 @@
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
+ import type { AstCapabilityAlias, AstIdentifierBinding, AstIdentifierWrite, CtxMethodAlias, CtxRootAlias, RunJsAstInspection, SourceBinding, SourceRange, StaticFilterValueBinding, StaticStringBinding } from '../internal-types';
10
+ export declare function resolveCtxMethodCall(node: any, aliases: CtxMethodAlias[], identifierBindings: AstIdentifierBinding[]): CtxMethodAlias | {
11
+ capability: string;
12
+ method: string;
13
+ };
14
+ export declare function getCtxMethodName(node: any, identifierBindings: AstIdentifierBinding[]): string;
15
+ export declare function getAstStaticPropertyName(node: any): string;
16
+ export declare function getAstStaticMemberKey(node: any): string;
17
+ export declare function isCtxIdentifier(node: any): boolean;
18
+ export declare function isUnshadowedCtxIdentifier(node: any, identifierBindings: AstIdentifierBinding[]): boolean;
19
+ export declare function isCtxRootFromAst(node: any, aliases: CtxRootAlias[], identifierBindings: AstIdentifierBinding[]): any;
20
+ export declare function hasAstActiveBinding(name: string, index: number, identifierBindings: AstIdentifierBinding[]): boolean;
21
+ export declare function isAstCtxApiAliasAssignmentOperator(operator: string): boolean;
22
+ export declare function isAstDefiniteAssignmentOperator(operator: string): boolean;
23
+ export declare function getAstAssignmentTargetScope(target: any, ancestors: any[], sourceLength: number, identifierBindings: AstIdentifierBinding[]): SourceRange;
24
+ export declare function getAstMemberAssignmentTargetScope(target: any, ancestors: any[], sourceLength: number, identifierBindings: AstIdentifierBinding[]): SourceRange;
25
+ export declare function findUnboundCtxMatches(masked: string, pattern: RegExp, bindings: SourceBinding[]): {
26
+ index: number;
27
+ match: string;
28
+ }[];
29
+ export declare function dedupeAstResourceEntries(entries: RunJsAstInspection['invalidResourceTypeCalls']): {
30
+ capability: string;
31
+ expression?: string;
32
+ index: number;
33
+ resourceType?: string;
34
+ ruleId: string;
35
+ }[];
36
+ export declare function resolveAstResourceTypeExpression(node: any, source: string, stringBindings: StaticStringBinding[], identifierBindings: AstIdentifierBinding[]): {
37
+ status: 'resolved';
38
+ value: string;
39
+ } | {
40
+ status: 'unresolved';
41
+ expression: string;
42
+ };
43
+ export declare function resolveAstStaticStringValue(node: any, source: string): string | undefined;
44
+ export declare function resolveAstStaticTemplateLiteralValue(node: any, source: string, stringBindings: StaticStringBinding[], identifierBindings: AstIdentifierBinding[]): string | undefined;
45
+ export declare function resolveAstAliasBinding<T extends SourceRange & {
46
+ name: string;
47
+ }>(name: string, index: number, aliases: T[], identifierBindings: AstIdentifierBinding[]): T | undefined;
48
+ export declare function resolveAstMemberAliasBinding<T extends SourceRange & {
49
+ name: string;
50
+ }>(node: any, aliases: T[], identifierBindings: AstIdentifierBinding[]): T | undefined;
51
+ export declare function getAstMemberAliasLookup(node: any): {
52
+ aliasName: string;
53
+ index: number;
54
+ rootName: string;
55
+ } | undefined;
56
+ export declare function getAstMemberWriteLookup(node: any): {
57
+ aliasName: string;
58
+ index: number;
59
+ rootName: string;
60
+ } | undefined;
61
+ export declare function getAstMemberRootIdentifier(node: any): {
62
+ index: number;
63
+ name: string;
64
+ } | undefined;
65
+ export declare function getAstAliasRootName(name: string): string;
66
+ export declare function resolveAstNamedAliasBinding<T extends SourceRange & {
67
+ name: string;
68
+ }>(name: string, index: number, rootName: string | undefined, aliases: T[], identifierBindings: AstIdentifierBinding[]): T | undefined;
69
+ export declare function resolveAstDynamicAliasBinding<T extends SourceRange & {
70
+ name: string;
71
+ }>(name: string, index: number, rootName: string | undefined, aliases: T[], identifierBindings: AstIdentifierBinding[]): T | undefined;
72
+ export declare function compareAstAliasPrecedence(left: SourceRange & {
73
+ precedenceStart?: number;
74
+ }, right: SourceRange & {
75
+ precedenceStart?: number;
76
+ }): number;
77
+ export declare function getAstAliasPrecedenceStart(alias: SourceRange & {
78
+ precedenceStart?: number;
79
+ }): number;
80
+ export declare function isAstDynamicMemberAliasMatch(patternName: string, name: string): boolean;
81
+ export declare function resolveAstActiveIdentifierBinding(name: string, index: number, identifierBindings: AstIdentifierBinding[]): AstIdentifierBinding | undefined;
82
+ export declare function hasAstShadowBinding(name: string, index: number, alias: SourceRange, identifierBindings: AstIdentifierBinding[]): boolean;
83
+ export declare function addAstFunctionParamBindings(bindings: AstIdentifierBinding[], node: any, sourceLength: number): void;
84
+ export declare function collectAstPatternBindingIdentifiers(node: any, addBinding: (name: string, node: any) => void): void;
85
+ export declare function collectAstObjectPatternAliases(pattern: any, addAlias: (alias: string, member: string, node?: any) => void): void;
86
+ export declare function collectAstObjectPatternPathAliases(pattern: any, addAlias: (alias: string, members: string[], node?: any) => void, parentMembers?: string[]): void;
87
+ export declare function collectAstPatternDefaultValueAliases(pattern: any, addAlias: (alias: string, valueNode: any, aliasNode: any, defaultPattern: any) => void): void;
88
+ export declare function collectAstPatternDefaultValueAliasesWithSource(pattern: any, sourceTarget: any, addAlias: (alias: string, valueNode: any, aliasNode: any, defaultPattern: any, sourceTarget: any) => void): void;
89
+ export declare function collectAstPatternSourceTargets(pattern: any, sourceNode: any, visit: (target: any, sourceTarget: any) => void): void;
90
+ export declare function collectAstPatternCarrierSourceTargets<T extends AstCapabilityAlias>(pattern: any, sourceNode: any, aliases: T[], identifierBindings: AstIdentifierBinding[], visit: (target: {
91
+ sourceAlias?: T;
92
+ sourceTarget?: any;
93
+ target: any;
94
+ targetAliasName: string;
95
+ }) => void): void;
96
+ export declare function collectAstPatternCarrierSourceTargetsFromSourceTarget<T extends AstCapabilityAlias>(pattern: any, sourceTarget: any, aliases: T[], identifierBindings: AstIdentifierBinding[], visit: (target: {
97
+ sourceAlias?: T;
98
+ sourceTarget?: any;
99
+ target: any;
100
+ targetAliasName: string;
101
+ }) => void): void;
102
+ export declare function collectAstPatternSourceTargetsRec(pattern: any, sourceTarget: any, visit: (target: any, sourceTarget: any) => void): void;
103
+ export declare function collectAstPatternRestCarrierSourceTargets<T extends AstCapabilityAlias>(pattern: any, sourceNode: any, aliases: T[], identifierBindings: AstIdentifierBinding[], visit: (target: {
104
+ sourceAlias?: T;
105
+ sourceTarget?: any;
106
+ target: any;
107
+ targetAliasName: string;
108
+ }) => void): void;
109
+ export declare function collectAstPatternRestCarrierSourceTargetsRec<T extends AstCapabilityAlias>(pattern: any, sourceTarget: any, aliases: T[], identifierBindings: AstIdentifierBinding[], visit: (target: {
110
+ sourceAlias?: T;
111
+ sourceTarget?: any;
112
+ target: any;
113
+ targetAliasName: string;
114
+ }) => void): void;
115
+ export declare function collectAstObjectRestCarrierSourceTargets<T extends AstCapabilityAlias>(target: any, sourceTarget: any, excludedMembers: Set<string>, aliases: T[], identifierBindings: AstIdentifierBinding[], visit: (target: {
116
+ sourceAlias?: T;
117
+ sourceTarget?: any;
118
+ target: any;
119
+ targetAliasName: string;
120
+ }) => void): void;
121
+ export declare function collectAstCarrierSourceTargets<T extends AstCapabilityAlias>(target: any, targetAliasName: string, sourceTarget: any, aliases: T[], identifierBindings: AstIdentifierBinding[], visit: (target: {
122
+ sourceAlias?: T;
123
+ sourceTarget?: any;
124
+ target: any;
125
+ targetAliasName: string;
126
+ }) => void): void;
127
+ export declare function collectAstArrayRestCarrierSourceTargets<T extends AstCapabilityAlias>(target: any, sourceTarget: any, restStartIndex: number, aliases: T[], identifierBindings: AstIdentifierBinding[], visit: (target: {
128
+ sourceAlias?: T;
129
+ sourceTarget?: any;
130
+ target: any;
131
+ targetAliasName: string;
132
+ }) => void): void;
133
+ export declare function collectAstRestCarrierAliasCopies<T extends AstCapabilityAlias>(sourceTarget: any, targetAliasName: string, aliases: T[], identifierBindings: AstIdentifierBinding[], visit: (suffix: string, sourceAlias: T) => void): void;
134
+ export declare function collectAstLiteralSpreadCarrierCopies<T extends AstCapabilityAlias>(sourceNode: any, targetAliasName: string, aliases: T[], identifierBindings: AstIdentifierBinding[], visit: (suffix: string, sourceAlias?: T, sourceTarget?: any) => void): void;
135
+ export declare function collectAstCarrierCandidateMembers<T extends AstCapabilityAlias>(sourceNode: any, aliases: T[], identifierBindings: AstIdentifierBinding[]): Set<string>;
136
+ export declare function collectAstObjectSpreadCarrierCopies<T extends AstCapabilityAlias>(sourceNode: any, targetAliasName: string, aliases: T[], identifierBindings: AstIdentifierBinding[], visit: (suffix: string, sourceAlias?: T, sourceTarget?: any) => void, excludedMembers?: Set<string>): void;
137
+ export declare function collectAstDynamicCarrierSourceTargets(sourceNode: any, visit: (suffix: string, sourceTarget: any) => void): void;
138
+ export declare function collectAstArraySpreadCarrierCopies<T extends AstCapabilityAlias>(sourceNode: any, targetAliasName: string, aliases: T[], identifierBindings: AstIdentifierBinding[], visit: (suffix: string, sourceAlias?: T, sourceTarget?: any) => void): void;
139
+ export declare function collectAstStaticCarrierMemberSourceTargets(node: any, visit: (member: string, sourceTarget: any) => void): void;
140
+ export declare function getAstStaticArrayElementCount(node: any): number | undefined;
141
+ export declare function collectAstObjectPatternStaticMembers(pattern: any): Set<string>;
142
+ export declare function getAstPatternTargetAliasLookup(target: any): {
143
+ aliasName: string;
144
+ index: number;
145
+ rootName: string;
146
+ } | undefined;
147
+ export declare function collectAstPatternMemberExpressions(pattern: any, visit: (memberNode: any) => void): void;
148
+ export declare function createAstPatternSourceTarget(node: any): {
149
+ node: any;
150
+ aliasName: string;
151
+ rootName: string;
152
+ index: any;
153
+ };
154
+ export declare function createMaybeAstPatternSourceTarget(node: any): {
155
+ node: any;
156
+ aliasName: string;
157
+ rootName: string;
158
+ index: any;
159
+ };
160
+ export declare function getAstPatternMemberSourceTarget(sourceTarget: any, member: string): any;
161
+ export declare function getAstStaticCarrierMemberSourceTarget(node: any, member: string): any;
162
+ export declare function getAstObjectCarrierMemberSourceTarget(node: any, member: string): any;
163
+ export declare function getAstArrayCarrierMemberSourceTarget(node: any, member: string): any;
164
+ export declare function createAstAmbiguousSourceTarget(sourceTarget: any): any;
165
+ export declare function getAstSpreadMemberSourceTarget(spreadArgument: any, member: string): any;
166
+ export declare function createAstFallbackSourceTarget(fallbackSourceTargets: any[], index: number): {
167
+ fallbackSourceTargets: any[];
168
+ index: number;
169
+ };
170
+ export declare function getAstPatternSourceRoot(node: any): {
171
+ aliasName: string;
172
+ index: number;
173
+ rootName: string;
174
+ } | undefined;
175
+ export declare function getAstStaticCarrierMemberValue(node: any, member: string): any;
176
+ export declare function collectAstKnownCarrierMembers(node: any, visit: (member: string, valueNode: any, aliasNode?: any) => void): void;
177
+ export declare function collectAstStaticCarrierMembers(node: any, visit: (member: string, valueNode: any, aliasNode?: any) => void): void;
178
+ export declare function getAstBindingIdentifierNode(node: any): any;
179
+ export declare function getAstBindingIdentifierName(node: any): string;
180
+ export declare function getAstObjectPatternFromValue(node: any): any | undefined;
181
+ export declare function trimAstAliasesAfterWrites<T extends SourceRange & {
182
+ declarationStart?: number;
183
+ executionScope: SourceRange;
184
+ name: string;
185
+ }>(aliases: T[], writes: AstIdentifierWrite[], identifierBindings: AstIdentifierBinding[]): T[];
186
+ export declare function resolveRunJsStaticString(node: any, source: string, stringBindings: StaticStringBinding[], identifierBindings: AstIdentifierBinding[]): string;
187
+ export declare function resolveRunJsStaticObjectExpression(node: any, identifierBindings: AstIdentifierBinding[], staticFilterValueBindings: StaticFilterValueBinding[]): any;
188
+ export declare function resolveRunJsStaticObjectExpressionRec(node: any, identifierBindings: AstIdentifierBinding[], staticFilterValueBindings: StaticFilterValueBinding[], seen?: Set<StaticFilterValueBinding>): any | undefined;
189
+ export declare function getRunJsObjectProperty(node: any, names: string[], identifierBindings?: AstIdentifierBinding[], staticFilterValueBindings?: StaticFilterValueBinding[]): any;
190
+ export declare function getRunJsObjectPropertyByPath(node: any, members: string[], identifierBindings?: AstIdentifierBinding[], staticFilterValueBindings?: StaticFilterValueBinding[]): any;
191
+ export declare function getRunJsObjectPropertyLookup(node: any, names: string[], identifierBindings?: AstIdentifierBinding[], staticFilterValueBindings?: StaticFilterValueBinding[]): {
192
+ property: any;
193
+ status: 'found';
194
+ } | {
195
+ status: 'missing' | 'unknown';
196
+ };