@nocobase/plugin-flow-engine 2.2.0-alpha.7 → 2.2.0-alpha.9
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.
- package/dist/ai/docs/runjs/context/ai.md +206 -0
- package/dist/externalVersion.js +9 -9
- package/dist/node_modules/@ant-design/icons-svg/package.json +1 -1
- package/dist/node_modules/acorn/package.json +1 -1
- package/dist/node_modules/acorn-jsx/package.json +1 -1
- package/dist/node_modules/acorn-walk/package.json +1 -1
- package/dist/node_modules/ses/package.json +1 -1
- package/dist/node_modules/zod/package.json +1 -1
- package/dist/server/flow-surfaces/authoring-validation.d.ts +2 -1
- package/dist/server/flow-surfaces/authoring-validation.js +16 -10
- package/dist/server/flow-surfaces/blueprint/compile-plan.js +19 -15
- package/dist/server/flow-surfaces/blueprint/normalize-document.js +18 -2
- package/dist/server/flow-surfaces/blueprint/public-types.d.ts +1 -0
- package/dist/server/flow-surfaces/constants.d.ts +9 -2
- package/dist/server/flow-surfaces/constants.js +1 -0
- package/dist/server/flow-surfaces/errors.d.ts +2 -2
- package/dist/server/flow-surfaces/errors.js +4 -4
- package/dist/server/flow-surfaces/navigation-targets.d.ts +73 -0
- package/dist/server/flow-surfaces/navigation-targets.js +439 -0
- package/dist/server/flow-surfaces/runjs-authoring/runtime/constants.js +1 -0
- package/dist/server/flow-surfaces/service.d.ts +14 -2
- package/dist/server/flow-surfaces/service.js +464 -110
- package/dist/server/variables/records.js +7 -2
- package/dist/swagger/flow-surfaces.d.ts +96 -0
- package/dist/swagger/flow-surfaces.js +88 -7
- package/dist/swagger/index.d.ts +96 -0
- package/package.json +2 -2
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "ctx.ai"
|
|
3
|
+
description: "Use ctx.ai in RunJS to trigger AI employee tasks, either with inline task content or with tasks configured on an AI employee action."
|
|
4
|
+
keywords: "ctx.ai,AI employee,triggerTask,triggerModelTask,RunJS,NocoBase"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# ctx.ai
|
|
8
|
+
|
|
9
|
+
Use `ctx.ai` in RunJS to trigger **AI employee tasks**. It works well in JSBlock, JSAction, and other interactions where a button, form, or business flow needs to hand work to a specific AI employee.
|
|
10
|
+
|
|
11
|
+
`ctx.ai` only triggers tasks. It does not return the execution result of the AI employee task. After the call, the task enters the AI employee conversation flow, and the result is handled by the AI employee session.
|
|
12
|
+
|
|
13
|
+
:::warning Note
|
|
14
|
+
|
|
15
|
+
`ctx.ai` is provided by the AI plugin. If the AI plugin is not enabled, or the current RunJS environment has not loaded the corresponding client capability, `ctx.ai` may not exist. You can check `ctx.ai?.triggerTask` or `ctx.ai?.triggerModelTask` before calling it.
|
|
16
|
+
|
|
17
|
+
:::
|
|
18
|
+
|
|
19
|
+
## Methods
|
|
20
|
+
|
|
21
|
+
### ctx.ai.triggerTask()
|
|
22
|
+
|
|
23
|
+
Trigger an AI employee task directly.
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
ctx.ai.triggerTask(options: TriggerTaskOptions): void
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
| Parameter | Type | Description |
|
|
30
|
+
|------|------|------|
|
|
31
|
+
| `aiEmployee` | `string \| AIEmployee` | AI employee. When a string is passed, NocoBase matches `AIEmployee.username` exactly, and the AI employee must be accessible to the current user. |
|
|
32
|
+
| `tasks` | `Task[]` | Tasks to trigger. |
|
|
33
|
+
| `open` | `boolean` | Whether to open the AI employee conversation panel. |
|
|
34
|
+
| `auto` | `boolean` | Whether to use the auto-trigger semantics of an AI employee action. |
|
|
35
|
+
|
|
36
|
+
Common `Task` fields:
|
|
37
|
+
|
|
38
|
+
| Field | Type | Description |
|
|
39
|
+
|------|------|------|
|
|
40
|
+
| `title` | `string` | Task title. |
|
|
41
|
+
| `message.system` | `string` | System message, used to constrain the AI employee's role and output requirements. |
|
|
42
|
+
| `message.user` | `string` | User message, which is the main instruction for this task. |
|
|
43
|
+
| `message.workContext` | `ContextItem[]` | Page block context used by the task. |
|
|
44
|
+
| `autoSend` | `boolean` | Whether to send the task message automatically. |
|
|
45
|
+
| `webSearch` | `boolean` | Whether Web search is allowed for this task. |
|
|
46
|
+
| `model` | `{ llmService: string; model: string } \| null` | Model used by this task. |
|
|
47
|
+
| `skillSettings` | `SkillSettings` | Skills and tools available to this task. |
|
|
48
|
+
|
|
49
|
+
### Add Page Block Context
|
|
50
|
+
|
|
51
|
+
`message.workContext` currently passes page blocks. Put the FlowModel uid of the target page block into it:
|
|
52
|
+
|
|
53
|
+
```ts
|
|
54
|
+
message: {
|
|
55
|
+
user: 'Review the current users table and summarize operational risks.',
|
|
56
|
+
workContext: [
|
|
57
|
+
{
|
|
58
|
+
type: 'flow-model',
|
|
59
|
+
uid: 'USERS_TABLE_BLOCK_UID',
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
| Field | Description |
|
|
66
|
+
|------|------|
|
|
67
|
+
| `type` | Fixed to `flow-model`, meaning this item is a page block context. |
|
|
68
|
+
| `uid` | FlowModel uid of the page block, such as a table block, detail block, or chart block. |
|
|
69
|
+
|
|
70
|
+
If you want to use the current JSBlock itself as context, use the current model uid:
|
|
71
|
+
|
|
72
|
+
```ts
|
|
73
|
+
workContext: [
|
|
74
|
+
{
|
|
75
|
+
type: 'flow-model',
|
|
76
|
+
uid: ctx.model.uid,
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Usually, `message.workContext` should be placed inside the `message` of a concrete task. `triggerModelTask()` reuses the task configured on the target AI employee action, so it also reads `message.workContext` from that task.
|
|
82
|
+
|
|
83
|
+
### Specify Model
|
|
84
|
+
|
|
85
|
+
`model` specifies the model for a single task. If omitted, the AI employee's default model configuration is used. Passing `null` means no task-level model is specified.
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
model: {
|
|
89
|
+
llmService: 'openai-main',
|
|
90
|
+
model: 'gpt-4.1',
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Configure Skills / Tools
|
|
95
|
+
|
|
96
|
+
`skillSettings` specifies the skills and tools available to a single task. If omitted, the AI employee's own capability configuration is used.
|
|
97
|
+
|
|
98
|
+
```ts
|
|
99
|
+
skillSettings: {
|
|
100
|
+
skillsVersion: 2,
|
|
101
|
+
toolsVersion: 2,
|
|
102
|
+
skills: ['business-analysis-report'],
|
|
103
|
+
tools: ['businessReportGenerator'],
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
To explicitly disable all skills or tools for this task, pass empty arrays and keep the version fields:
|
|
108
|
+
|
|
109
|
+
```ts
|
|
110
|
+
skillSettings: {
|
|
111
|
+
skillsVersion: 2,
|
|
112
|
+
toolsVersion: 2,
|
|
113
|
+
skills: [],
|
|
114
|
+
tools: [],
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
The following example asks `viz` to generate a handoff brief and opens the AI employee conversation panel:
|
|
119
|
+
|
|
120
|
+
```ts
|
|
121
|
+
if (!ctx.ai?.triggerTask) {
|
|
122
|
+
ctx.message.error(ctx.t('AI employee task API is not available.'));
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
ctx.ai.triggerTask({
|
|
127
|
+
aiEmployee: 'viz',
|
|
128
|
+
open: true,
|
|
129
|
+
tasks: [
|
|
130
|
+
{
|
|
131
|
+
title: ctx.t('Daily operations handoff brief'),
|
|
132
|
+
message: {
|
|
133
|
+
system:
|
|
134
|
+
'You prepare reusable daily operations handoff briefs. Focus on risks, blockers, decisions, owners, and next actions.',
|
|
135
|
+
user: [
|
|
136
|
+
"Prepare today's operations handoff brief.",
|
|
137
|
+
'Cover customer escalations, SLA risks, approvals, and follow-up owners.',
|
|
138
|
+
'Return a concise brief that can be posted to the team channel.',
|
|
139
|
+
].join('\n'),
|
|
140
|
+
},
|
|
141
|
+
autoSend: true,
|
|
142
|
+
webSearch: false,
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
ctx.message.success(ctx.t('AI employee task triggered.'));
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
If `aiEmployee` is a string, NocoBase matches accessible AI employees by `username` exactly. If no match is found, the task is not triggered and a warning is printed to the console.
|
|
151
|
+
|
|
152
|
+
### ctx.ai.triggerModelTask()
|
|
153
|
+
|
|
154
|
+
Read a task from an AI employee action model on the page and trigger it.
|
|
155
|
+
|
|
156
|
+
```ts
|
|
157
|
+
ctx.ai.triggerModelTask(uid: string, taskIndex: number, options?: TriggerModelTaskOptions): void
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
| Parameter | Type | Description |
|
|
161
|
+
|------|------|------|
|
|
162
|
+
| `uid` | `string` | FlowModel uid of the AI employee action. |
|
|
163
|
+
| `taskIndex` | `number` | Task index, starting from `0`. |
|
|
164
|
+
| `options.open` | `boolean` | Whether to open the AI employee conversation panel. |
|
|
165
|
+
| `options.auto` | `boolean` | Whether to use the auto-trigger semantics of an AI employee action. |
|
|
166
|
+
|
|
167
|
+
This method reads the AI employee and task configuration from the target model. It is useful when the task has already been configured on an AI employee action on the page, and RunJS only needs to trigger it.
|
|
168
|
+
|
|
169
|
+
```ts
|
|
170
|
+
if (!ctx.ai?.triggerModelTask) {
|
|
171
|
+
ctx.message.error(ctx.t('AI employee task API is not available.'));
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
const weeklyReviewActionUid = 'AI_EMPLOYEE_ACTION_MODEL_UID';
|
|
176
|
+
|
|
177
|
+
ctx.ai.triggerModelTask(weeklyReviewActionUid, 0, {
|
|
178
|
+
open: true,
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
ctx.message.success(ctx.t('Configured AI employee task triggered.'));
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
If the target model does not exist, has no AI employee configured, or the specified index has no task, no task is triggered and a warning is printed to the console.
|
|
185
|
+
|
|
186
|
+
## Which Method to Use
|
|
187
|
+
|
|
188
|
+
| Scenario | Recommended method |
|
|
189
|
+
|------|------|
|
|
190
|
+
| Task content is assembled dynamically in RunJS, such as from form values. | `ctx.ai.triggerTask()` |
|
|
191
|
+
| The task has already been configured on an AI employee action on the page, and RunJS only triggers it. | `ctx.ai.triggerModelTask()` |
|
|
192
|
+
| Business users need to adjust task content without changing code. | `ctx.ai.triggerModelTask()` |
|
|
193
|
+
| The AI employee, prompt, or sending behavior needs to be decided at runtime. | `ctx.ai.triggerTask()` |
|
|
194
|
+
|
|
195
|
+
## Notes
|
|
196
|
+
|
|
197
|
+
- `triggerTask()` and `triggerModelTask()` are fire-and-forget. They do not return the execution result of the AI employee task.
|
|
198
|
+
- `aiEmployee` strings only match `AIEmployee.username` exactly. They do not match nicknames, job titles, or translated names.
|
|
199
|
+
- `triggerModelTask()` uses a `0`-based `taskIndex`.
|
|
200
|
+
- `triggerModelTask()` reads task configuration from the target AI employee action model. If the task needs work context, configure `message.workContext` on that task.
|
|
201
|
+
|
|
202
|
+
## Related
|
|
203
|
+
|
|
204
|
+
- [ctx.message](./message.md): Show lightweight prompts before and after triggering tasks.
|
|
205
|
+
- [ctx.render](./render.md): Render buttons or forms in JSBlock.
|
|
206
|
+
- [ctx.model](./model.md): Get current FlowModel information.
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,16 +8,16 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "2.2.0-alpha.
|
|
11
|
+
"@nocobase/client": "2.2.0-alpha.9",
|
|
12
12
|
"lodash": "4.18.1",
|
|
13
|
-
"@nocobase/database": "2.2.0-alpha.
|
|
14
|
-
"@nocobase/data-source-manager": "2.2.0-alpha.
|
|
15
|
-
"@nocobase/resourcer": "2.2.0-alpha.
|
|
16
|
-
"@nocobase/utils": "2.2.0-alpha.
|
|
17
|
-
"@nocobase/cache": "2.2.0-alpha.
|
|
18
|
-
"@nocobase/server": "2.2.0-alpha.
|
|
19
|
-
"@nocobase/actions": "2.2.0-alpha.
|
|
13
|
+
"@nocobase/database": "2.2.0-alpha.9",
|
|
14
|
+
"@nocobase/data-source-manager": "2.2.0-alpha.9",
|
|
15
|
+
"@nocobase/resourcer": "2.2.0-alpha.9",
|
|
16
|
+
"@nocobase/utils": "2.2.0-alpha.9",
|
|
17
|
+
"@nocobase/cache": "2.2.0-alpha.9",
|
|
18
|
+
"@nocobase/server": "2.2.0-alpha.9",
|
|
19
|
+
"@nocobase/actions": "2.2.0-alpha.9",
|
|
20
20
|
"sequelize": "6.35.2",
|
|
21
21
|
"@formily/json-schema": "2.3.7",
|
|
22
|
-
"@nocobase/ai": "2.2.0-alpha.
|
|
22
|
+
"@nocobase/ai": "2.2.0-alpha.9"
|
|
23
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@ant-design/icons-svg","version":"4.3.1","sideEffects":false,"description":"Abstract nodes for ant design icons.","contributors":["HeskeyBaozi <hezhiyu233@foxmail.com>"],"homepage":"https://github.com/ant-design/ant-design-icons/","license":"MIT","main":"lib/index.js","module":"es/index.js","files":["lib","es","inline-svg","inline-namespaced-svg"],"repository":{"type":"git","url":"git+https://github.com/ant-design/ant-design-icons.git"},"scripts":{"g":"npm run generate","generate":"cross-env NODE_ENV=production gulp --require ts-node/register/transpile-only","type-check":"tsc --noEmit","build:es":"tsc --project tsconfig.build.json --module esnext --outDir es","build:lib":"tsc --project tsconfig.build.json --module commonjs --outDir lib","build":"cross-env NODE_ENV=production && npm run build:es && npm run build:lib","test":"cross-env NODE_ENV=test && npm run test:unit","test:unit":"jest","prepublishOnly":"npm run test && npm run g && npm run build && npm run type-check && npm run digest","digest":"node scripts/digest.js"},"bugs":{"url":"https://github.com/ant-design/ant-design-icons/issues"},"devDependencies":{"@babel/core":"^7.8.6","@babel/preset-env":"^7.8.6","@babel/preset-typescript":"^7.8.3","@rgrove/parse-xml":"^2.0.2","@types/gulp":"^4.0.6","@types/gulp-concat":"^0.0.32","@types/gulp-rename":"^0.0.33","@types/jest":"^25.1.3","@types/lodash.camelcase":"^4.3.6","@types/lodash.template":"^4.4.6","@types/lodash.upperfirst":"^4.3.6","@types/node":"^13.9.3","@types/ramda":"^0.26.43","@types/rgrove__parse-xml":"^1.1.0","@types/svgo":"^1.3.1","@types/through2":"^2.0.34","@typescript-eslint/eslint-plugin":"^2.21.0","@typescript-eslint/parser":"^2.21.0","babel-jest":"^25.1.0","cross-env":"^7.0.0","del":"^5.1.0","eslint":"^7.16.0","globby":"^11.0.0","gulp":"^4.0.2","gulp-clone":"^2.0.1","gulp-concat":"^2.6.1","gulp-header":"^2.0.9","gulp-rename":"^2.0.0","jest":"^25.1.0","lodash.camelcase":"^4.3.0","lodash.template":"^4.5.0","lodash.upperfirst":"^4.3.1","ramda":"^0.27.0","svgo":"^1.3.2","through2":"^3.0.1","ts-node":"^8.6.2","typescript":"^4.0.0","vinyl":"^2.2.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_lastModified":"2026-07-
|
|
1
|
+
{"name":"@ant-design/icons-svg","version":"4.3.1","sideEffects":false,"description":"Abstract nodes for ant design icons.","contributors":["HeskeyBaozi <hezhiyu233@foxmail.com>"],"homepage":"https://github.com/ant-design/ant-design-icons/","license":"MIT","main":"lib/index.js","module":"es/index.js","files":["lib","es","inline-svg","inline-namespaced-svg"],"repository":{"type":"git","url":"git+https://github.com/ant-design/ant-design-icons.git"},"scripts":{"g":"npm run generate","generate":"cross-env NODE_ENV=production gulp --require ts-node/register/transpile-only","type-check":"tsc --noEmit","build:es":"tsc --project tsconfig.build.json --module esnext --outDir es","build:lib":"tsc --project tsconfig.build.json --module commonjs --outDir lib","build":"cross-env NODE_ENV=production && npm run build:es && npm run build:lib","test":"cross-env NODE_ENV=test && npm run test:unit","test:unit":"jest","prepublishOnly":"npm run test && npm run g && npm run build && npm run type-check && npm run digest","digest":"node scripts/digest.js"},"bugs":{"url":"https://github.com/ant-design/ant-design-icons/issues"},"devDependencies":{"@babel/core":"^7.8.6","@babel/preset-env":"^7.8.6","@babel/preset-typescript":"^7.8.3","@rgrove/parse-xml":"^2.0.2","@types/gulp":"^4.0.6","@types/gulp-concat":"^0.0.32","@types/gulp-rename":"^0.0.33","@types/jest":"^25.1.3","@types/lodash.camelcase":"^4.3.6","@types/lodash.template":"^4.4.6","@types/lodash.upperfirst":"^4.3.6","@types/node":"^13.9.3","@types/ramda":"^0.26.43","@types/rgrove__parse-xml":"^1.1.0","@types/svgo":"^1.3.1","@types/through2":"^2.0.34","@typescript-eslint/eslint-plugin":"^2.21.0","@typescript-eslint/parser":"^2.21.0","babel-jest":"^25.1.0","cross-env":"^7.0.0","del":"^5.1.0","eslint":"^7.16.0","globby":"^11.0.0","gulp":"^4.0.2","gulp-clone":"^2.0.1","gulp-concat":"^2.6.1","gulp-header":"^2.0.9","gulp-rename":"^2.0.0","jest":"^25.1.0","lodash.camelcase":"^4.3.0","lodash.template":"^4.5.0","lodash.upperfirst":"^4.3.1","ramda":"^0.27.0","svgo":"^1.3.2","through2":"^3.0.1","ts-node":"^8.6.2","typescript":"^4.0.0","vinyl":"^2.2.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"_lastModified":"2026-07-16T13:01:52.856Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"acorn","description":"ECMAScript parser","homepage":"https://github.com/acornjs/acorn","main":"dist/acorn.js","types":"dist/acorn.d.ts","module":"dist/acorn.mjs","exports":{".":[{"import":"./dist/acorn.mjs","require":"./dist/acorn.js","default":"./dist/acorn.js"},"./dist/acorn.js"],"./package.json":"./package.json"},"version":"8.11.2","engines":{"node":">=0.4.0"},"maintainers":[{"name":"Marijn Haverbeke","email":"marijnh@gmail.com","web":"https://marijnhaverbeke.nl"},{"name":"Ingvar Stepanyan","email":"me@rreverser.com","web":"https://rreverser.com/"},{"name":"Adrian Heine","web":"http://adrianheine.de"}],"repository":{"type":"git","url":"https://github.com/acornjs/acorn.git"},"license":"MIT","scripts":{"prepare":"cd ..; npm run build:main"},"bin":{"acorn":"./bin/acorn"},"_lastModified":"2026-07-
|
|
1
|
+
{"name":"acorn","description":"ECMAScript parser","homepage":"https://github.com/acornjs/acorn","main":"dist/acorn.js","types":"dist/acorn.d.ts","module":"dist/acorn.mjs","exports":{".":[{"import":"./dist/acorn.mjs","require":"./dist/acorn.js","default":"./dist/acorn.js"},"./dist/acorn.js"],"./package.json":"./package.json"},"version":"8.11.2","engines":{"node":">=0.4.0"},"maintainers":[{"name":"Marijn Haverbeke","email":"marijnh@gmail.com","web":"https://marijnhaverbeke.nl"},{"name":"Ingvar Stepanyan","email":"me@rreverser.com","web":"https://rreverser.com/"},{"name":"Adrian Heine","web":"http://adrianheine.de"}],"repository":{"type":"git","url":"https://github.com/acornjs/acorn.git"},"license":"MIT","scripts":{"prepare":"cd ..; npm run build:main"},"bin":{"acorn":"./bin/acorn"},"_lastModified":"2026-07-16T13:01:53.740Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"acorn-jsx","description":"Modern, fast React.js JSX parser","homepage":"https://github.com/acornjs/acorn-jsx","version":"5.3.2","maintainers":[{"name":"Ingvar Stepanyan","email":"me@rreverser.com","web":"http://rreverser.com/"}],"repository":{"type":"git","url":"https://github.com/acornjs/acorn-jsx"},"license":"MIT","scripts":{"test":"node test/run.js"},"peerDependencies":{"acorn":"^6.0.0 || ^7.0.0 || ^8.0.0"},"devDependencies":{"acorn":"^8.0.1"},"_lastModified":"2026-07-
|
|
1
|
+
{"name":"acorn-jsx","description":"Modern, fast React.js JSX parser","homepage":"https://github.com/acornjs/acorn-jsx","version":"5.3.2","maintainers":[{"name":"Ingvar Stepanyan","email":"me@rreverser.com","web":"http://rreverser.com/"}],"repository":{"type":"git","url":"https://github.com/acornjs/acorn-jsx"},"license":"MIT","scripts":{"test":"node test/run.js"},"peerDependencies":{"acorn":"^6.0.0 || ^7.0.0 || ^8.0.0"},"devDependencies":{"acorn":"^8.0.1"},"_lastModified":"2026-07-16T13:01:54.126Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"acorn-walk","description":"ECMAScript (ESTree) AST walker","homepage":"https://github.com/acornjs/acorn","main":"dist/walk.js","types":"dist/walk.d.ts","module":"dist/walk.mjs","exports":{".":[{"import":"./dist/walk.mjs","require":"./dist/walk.js","default":"./dist/walk.js"},"./dist/walk.js"],"./package.json":"./package.json"},"version":"8.3.4","engines":{"node":">=0.4.0"},"dependencies":{"acorn":"^8.11.0"},"maintainers":[{"name":"Marijn Haverbeke","email":"marijnh@gmail.com","web":"https://marijnhaverbeke.nl"},{"name":"Ingvar Stepanyan","email":"me@rreverser.com","web":"https://rreverser.com/"},{"name":"Adrian Heine","web":"http://adrianheine.de"}],"repository":{"type":"git","url":"https://github.com/acornjs/acorn.git"},"scripts":{"prepare":"cd ..; npm run build:walk"},"license":"MIT","_lastModified":"2026-07-
|
|
1
|
+
{"name":"acorn-walk","description":"ECMAScript (ESTree) AST walker","homepage":"https://github.com/acornjs/acorn","main":"dist/walk.js","types":"dist/walk.d.ts","module":"dist/walk.mjs","exports":{".":[{"import":"./dist/walk.mjs","require":"./dist/walk.js","default":"./dist/walk.js"},"./dist/walk.js"],"./package.json":"./package.json"},"version":"8.3.4","engines":{"node":">=0.4.0"},"dependencies":{"acorn":"^8.11.0"},"maintainers":[{"name":"Marijn Haverbeke","email":"marijnh@gmail.com","web":"https://marijnhaverbeke.nl"},{"name":"Ingvar Stepanyan","email":"me@rreverser.com","web":"https://rreverser.com/"},{"name":"Adrian Heine","web":"http://adrianheine.de"}],"repository":{"type":"git","url":"https://github.com/acornjs/acorn.git"},"scripts":{"prepare":"cd ..; npm run build:walk"},"license":"MIT","_lastModified":"2026-07-16T13:01:54.230Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"ses","version":"1.14.0","description":"Hardened JavaScript for Fearless Cooperation","keywords":["lockdown","harden","Compartment","assert","security","confinement","isolation","object capabilities","ocaps","secure execution","third-party code","prototype pollution","supply-chain attack","plugin"],"author":"Agoric","license":"Apache-2.0","homepage":"https://github.com/Agoric/SES-shim/tree/master/packages/ses#readme","repository":{"type":"git","url":"git+https://github.com/endojs/endo.git","directory":"packages/ses"},"bugs":{"url":"https://github.com/endojs/endo/issues"},"type":"module","main":"./dist/ses.cjs","module":"./index.js","unpkg":"./dist/ses.umd.js","types":"./types.d.ts","exports":{".":{"import":{"types":"./types.d.ts","xs":"./src-xs/index.js","default":"./index.js"},"require":{"types":"./dist/types.d.cts","default":"./dist/ses.cjs"}},"./lockdown":{"import":{"types":"./types.d.ts","default":"./index.js"},"require":{"types":"./dist/types.d.cts","default":"./dist/ses.cjs"}},"./hermes":{"require":{"types":"./dist/types.d.cts","default":"./dist/ses-hermes.cjs"}},"./tools.js":"./tools.js","./assert-shim.js":"./assert-shim.js","./lockdown-shim.js":{"xs":"./src-xs/lockdown-shim.js","default":"./lockdown-shim.js"},"./compartment-shim.js":{"xs":"./src-xs/compartment-shim.js","default":"./compartment-shim.js"},"./console-shim.js":"./console-shim.js","./package.json":"./package.json"},"scripts":{"build:vanilla":"node scripts/bundle.js","build:hermes":"node scripts/bundle.js hermes","build":"yarn build:vanilla && yarn build:hermes","clean":"rm -rf dist","cover":"c8 ava","demo":"python3 -m http.server","lint":"yarn lint:types && yarn lint:eslint","lint-fix":"eslint --fix .","lint:eslint":"eslint .","lint:types":"tsc","prepare":"npm run clean && npm run build","qt":"ava","test":"tsd && ava","test:hermes":"./scripts/hermes-test.sh","test:xs":"xst dist/ses.umd.js test/_lockdown-safe.js && node scripts/generate-test-xs.js && xst tmp/test-xs.js && rm -rf tmp","postpack":"git clean -fX \"*.d.ts*\" \"*.d.cts*\" \"*.d.mts*\" \"*.tsbuildinfo\""},"dependencies":{"@endo/cache-map":"^1.1.0","@endo/env-options":"^1.1.11","@endo/immutable-arraybuffer":"^1.1.2"},"devDependencies":{"@babel/generator":"^7.26.3","@babel/parser":"~7.26.2","@babel/traverse":"~7.25.9","@babel/types":"~7.26.0","@endo/compartment-mapper":"^1.6.3","@endo/module-source":"^1.3.3","@endo/test262-runner":"^0.1.48","@types/babel__traverse":"^7.20.5","ava":"^6.1.3","babel-eslint":"^10.1.0","c8":"^7.14.0","core-js":"^3.31.0","eslint":"^8.57.1","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^9.1.0","eslint-plugin-eslint-comments":"^3.2.0","eslint-plugin-import":"^2.31.0","hermes-engine-cli":"^0.12.0","prettier":"^3.5.3","terser":"^5.16.6","tsd":"^0.31.2","typescript":"~5.8.3"},"files":["./*.d.ts","./*.js","./*.map","LICENSE*","SECURITY*","dist","lib","src","tools"],"publishConfig":{"access":"public"},"eslintConfig":{"extends":["plugin:@endo/ses"]},"ava":{"files":["test/**/*.test.*"],"timeout":"2m"},"typeCoverage":{"atLeast":81.17},"gitHead":"9815aea9541f241389d2135c6097a7442bdffa17","_lastModified":"2026-07-
|
|
1
|
+
{"name":"ses","version":"1.14.0","description":"Hardened JavaScript for Fearless Cooperation","keywords":["lockdown","harden","Compartment","assert","security","confinement","isolation","object capabilities","ocaps","secure execution","third-party code","prototype pollution","supply-chain attack","plugin"],"author":"Agoric","license":"Apache-2.0","homepage":"https://github.com/Agoric/SES-shim/tree/master/packages/ses#readme","repository":{"type":"git","url":"git+https://github.com/endojs/endo.git","directory":"packages/ses"},"bugs":{"url":"https://github.com/endojs/endo/issues"},"type":"module","main":"./dist/ses.cjs","module":"./index.js","unpkg":"./dist/ses.umd.js","types":"./types.d.ts","exports":{".":{"import":{"types":"./types.d.ts","xs":"./src-xs/index.js","default":"./index.js"},"require":{"types":"./dist/types.d.cts","default":"./dist/ses.cjs"}},"./lockdown":{"import":{"types":"./types.d.ts","default":"./index.js"},"require":{"types":"./dist/types.d.cts","default":"./dist/ses.cjs"}},"./hermes":{"require":{"types":"./dist/types.d.cts","default":"./dist/ses-hermes.cjs"}},"./tools.js":"./tools.js","./assert-shim.js":"./assert-shim.js","./lockdown-shim.js":{"xs":"./src-xs/lockdown-shim.js","default":"./lockdown-shim.js"},"./compartment-shim.js":{"xs":"./src-xs/compartment-shim.js","default":"./compartment-shim.js"},"./console-shim.js":"./console-shim.js","./package.json":"./package.json"},"scripts":{"build:vanilla":"node scripts/bundle.js","build:hermes":"node scripts/bundle.js hermes","build":"yarn build:vanilla && yarn build:hermes","clean":"rm -rf dist","cover":"c8 ava","demo":"python3 -m http.server","lint":"yarn lint:types && yarn lint:eslint","lint-fix":"eslint --fix .","lint:eslint":"eslint .","lint:types":"tsc","prepare":"npm run clean && npm run build","qt":"ava","test":"tsd && ava","test:hermes":"./scripts/hermes-test.sh","test:xs":"xst dist/ses.umd.js test/_lockdown-safe.js && node scripts/generate-test-xs.js && xst tmp/test-xs.js && rm -rf tmp","postpack":"git clean -fX \"*.d.ts*\" \"*.d.cts*\" \"*.d.mts*\" \"*.tsbuildinfo\""},"dependencies":{"@endo/cache-map":"^1.1.0","@endo/env-options":"^1.1.11","@endo/immutable-arraybuffer":"^1.1.2"},"devDependencies":{"@babel/generator":"^7.26.3","@babel/parser":"~7.26.2","@babel/traverse":"~7.25.9","@babel/types":"~7.26.0","@endo/compartment-mapper":"^1.6.3","@endo/module-source":"^1.3.3","@endo/test262-runner":"^0.1.48","@types/babel__traverse":"^7.20.5","ava":"^6.1.3","babel-eslint":"^10.1.0","c8":"^7.14.0","core-js":"^3.31.0","eslint":"^8.57.1","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^9.1.0","eslint-plugin-eslint-comments":"^3.2.0","eslint-plugin-import":"^2.31.0","hermes-engine-cli":"^0.12.0","prettier":"^3.5.3","terser":"^5.16.6","tsd":"^0.31.2","typescript":"~5.8.3"},"files":["./*.d.ts","./*.js","./*.map","LICENSE*","SECURITY*","dist","lib","src","tools"],"publishConfig":{"access":"public"},"eslintConfig":{"extends":["plugin:@endo/ses"]},"ava":{"files":["test/**/*.test.*"],"timeout":"2m"},"typeCoverage":{"atLeast":81.17},"gitHead":"9815aea9541f241389d2135c6097a7442bdffa17","_lastModified":"2026-07-16T13:01:53.369Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"zod","version":"4.3.5","type":"module","license":"MIT","author":"Colin McDonnell <zod@colinhacks.com>","description":"TypeScript-first schema declaration and validation library with static type inference","homepage":"https://zod.dev","llms":"https://zod.dev/llms.txt","llmsFull":"https://zod.dev/llms-full.txt","mcpServer":"https://mcp.inkeep.com/zod/mcp","funding":"https://github.com/sponsors/colinhacks","sideEffects":false,"files":["src","**/*.js","**/*.mjs","**/*.cjs","**/*.d.ts","**/*.d.mts","**/*.d.cts","**/package.json"],"keywords":["typescript","schema","validation","type","inference"],"main":"./index.cjs","types":"./index.d.cts","module":"./index.js","zshy":{"exports":{"./package.json":"./package.json",".":"./src/index.ts","./mini":"./src/mini/index.ts","./locales":"./src/locales/index.ts","./v3":"./src/v3/index.ts","./v4":"./src/v4/index.ts","./v4-mini":"./src/v4-mini/index.ts","./v4/mini":"./src/v4/mini/index.ts","./v4/core":"./src/v4/core/index.ts","./v4/locales":"./src/v4/locales/index.ts","./v4/locales/*":"./src/v4/locales/*"},"conditions":{"@zod/source":"src"}},"exports":{"./package.json":"./package.json",".":{"@zod/source":"./src/index.ts","types":"./index.d.cts","import":"./index.js","require":"./index.cjs"},"./mini":{"@zod/source":"./src/mini/index.ts","types":"./mini/index.d.cts","import":"./mini/index.js","require":"./mini/index.cjs"},"./locales":{"@zod/source":"./src/locales/index.ts","types":"./locales/index.d.cts","import":"./locales/index.js","require":"./locales/index.cjs"},"./v3":{"@zod/source":"./src/v3/index.ts","types":"./v3/index.d.cts","import":"./v3/index.js","require":"./v3/index.cjs"},"./v4":{"@zod/source":"./src/v4/index.ts","types":"./v4/index.d.cts","import":"./v4/index.js","require":"./v4/index.cjs"},"./v4-mini":{"@zod/source":"./src/v4-mini/index.ts","types":"./v4-mini/index.d.cts","import":"./v4-mini/index.js","require":"./v4-mini/index.cjs"},"./v4/mini":{"@zod/source":"./src/v4/mini/index.ts","types":"./v4/mini/index.d.cts","import":"./v4/mini/index.js","require":"./v4/mini/index.cjs"},"./v4/core":{"@zod/source":"./src/v4/core/index.ts","types":"./v4/core/index.d.cts","import":"./v4/core/index.js","require":"./v4/core/index.cjs"},"./v4/locales":{"@zod/source":"./src/v4/locales/index.ts","types":"./v4/locales/index.d.cts","import":"./v4/locales/index.js","require":"./v4/locales/index.cjs"},"./v4/locales/*":{"@zod/source":"./src/v4/locales/*","types":"./v4/locales/*","import":"./v4/locales/*","require":"./v4/locales/*"}},"repository":{"type":"git","url":"git+https://github.com/colinhacks/zod.git"},"bugs":{"url":"https://github.com/colinhacks/zod/issues"},"support":{"backing":{"npm-funding":true}},"scripts":{"clean":"git clean -xdf . -e node_modules","build":"zshy --project tsconfig.build.json","postbuild":"tsx ../../scripts/write-stub-package-jsons.ts && pnpm biome check --write .","test:watch":"pnpm vitest","test":"pnpm vitest run","prepublishOnly":"tsx ../../scripts/check-versions.ts"},"_lastModified":"2026-07-
|
|
1
|
+
{"name":"zod","version":"4.3.5","type":"module","license":"MIT","author":"Colin McDonnell <zod@colinhacks.com>","description":"TypeScript-first schema declaration and validation library with static type inference","homepage":"https://zod.dev","llms":"https://zod.dev/llms.txt","llmsFull":"https://zod.dev/llms-full.txt","mcpServer":"https://mcp.inkeep.com/zod/mcp","funding":"https://github.com/sponsors/colinhacks","sideEffects":false,"files":["src","**/*.js","**/*.mjs","**/*.cjs","**/*.d.ts","**/*.d.mts","**/*.d.cts","**/package.json"],"keywords":["typescript","schema","validation","type","inference"],"main":"./index.cjs","types":"./index.d.cts","module":"./index.js","zshy":{"exports":{"./package.json":"./package.json",".":"./src/index.ts","./mini":"./src/mini/index.ts","./locales":"./src/locales/index.ts","./v3":"./src/v3/index.ts","./v4":"./src/v4/index.ts","./v4-mini":"./src/v4-mini/index.ts","./v4/mini":"./src/v4/mini/index.ts","./v4/core":"./src/v4/core/index.ts","./v4/locales":"./src/v4/locales/index.ts","./v4/locales/*":"./src/v4/locales/*"},"conditions":{"@zod/source":"src"}},"exports":{"./package.json":"./package.json",".":{"@zod/source":"./src/index.ts","types":"./index.d.cts","import":"./index.js","require":"./index.cjs"},"./mini":{"@zod/source":"./src/mini/index.ts","types":"./mini/index.d.cts","import":"./mini/index.js","require":"./mini/index.cjs"},"./locales":{"@zod/source":"./src/locales/index.ts","types":"./locales/index.d.cts","import":"./locales/index.js","require":"./locales/index.cjs"},"./v3":{"@zod/source":"./src/v3/index.ts","types":"./v3/index.d.cts","import":"./v3/index.js","require":"./v3/index.cjs"},"./v4":{"@zod/source":"./src/v4/index.ts","types":"./v4/index.d.cts","import":"./v4/index.js","require":"./v4/index.cjs"},"./v4-mini":{"@zod/source":"./src/v4-mini/index.ts","types":"./v4-mini/index.d.cts","import":"./v4-mini/index.js","require":"./v4-mini/index.cjs"},"./v4/mini":{"@zod/source":"./src/v4/mini/index.ts","types":"./v4/mini/index.d.cts","import":"./v4/mini/index.js","require":"./v4/mini/index.cjs"},"./v4/core":{"@zod/source":"./src/v4/core/index.ts","types":"./v4/core/index.d.cts","import":"./v4/core/index.js","require":"./v4/core/index.cjs"},"./v4/locales":{"@zod/source":"./src/v4/locales/index.ts","types":"./v4/locales/index.d.cts","import":"./v4/locales/index.js","require":"./v4/locales/index.cjs"},"./v4/locales/*":{"@zod/source":"./src/v4/locales/*","types":"./v4/locales/*","import":"./v4/locales/*","require":"./v4/locales/*"}},"repository":{"type":"git","url":"git+https://github.com/colinhacks/zod.git"},"bugs":{"url":"https://github.com/colinhacks/zod/issues"},"support":{"backing":{"npm-funding":true}},"scripts":{"clean":"git clean -xdf . -e node_modules","build":"zshy --project tsconfig.build.json","postbuild":"tsx ../../scripts/write-stub-package-jsons.ts && pnpm biome check --write .","test:watch":"pnpm vitest","test":"pnpm vitest run","prepublishOnly":"tsx ../../scripts/check-versions.ts"},"_lastModified":"2026-07-16T13:01:55.135Z"}
|
|
@@ -13,8 +13,9 @@ export interface FlowSurfaceAuthoringValidationContext {
|
|
|
13
13
|
applyBlueprintScriptAssets?: Record<string, any>;
|
|
14
14
|
getCollection?: (dataSourceKey: string, collectionName: string) => any;
|
|
15
15
|
getDefaultFieldGroups?: (dataSourceKey: string, collectionName: string) => any;
|
|
16
|
-
findMenuGroupRoutesByTitle?: (title: string, transaction?: any, layoutUid?: string | string[]) => Promise<any[]>;
|
|
16
|
+
findMenuGroupRoutesByTitle?: (title: string, transaction?: any, layoutUid?: string | string[], portalUid?: string) => Promise<any[]>;
|
|
17
17
|
getUiLayoutTypeByUid?: (layoutUid: string, transaction?: any) => Promise<string | undefined>;
|
|
18
|
+
getPortalLayoutTypeByUid?: (portalUid: string, transaction?: any) => Promise<string | undefined>;
|
|
18
19
|
transaction?: any;
|
|
19
20
|
hostBlockType?: string;
|
|
20
21
|
hostCollectionName?: string;
|
|
@@ -540,7 +540,7 @@ function pushChartBadRequestAuthoringError(errors, error, fallbackPath) {
|
|
|
540
540
|
});
|
|
541
541
|
}
|
|
542
542
|
async function collectNavigationGroupErrors(actionName, values, context, errors) {
|
|
543
|
-
var _a, _b;
|
|
543
|
+
var _a, _b, _c;
|
|
544
544
|
if (actionName !== "applyBlueprint" || (values == null ? void 0 : values.mode) !== "create" || !_.isPlainObject((_a = values == null ? void 0 : values.navigation) == null ? void 0 : _a.group)) {
|
|
545
545
|
return;
|
|
546
546
|
}
|
|
@@ -555,7 +555,8 @@ async function collectNavigationGroupErrors(actionName, values, context, errors)
|
|
|
555
555
|
return;
|
|
556
556
|
}
|
|
557
557
|
const layoutUid = String(((_b = values == null ? void 0 : values.navigation) == null ? void 0 : _b.layoutUid) || "").trim() || void 0;
|
|
558
|
-
const
|
|
558
|
+
const portalUid = String(((_c = values == null ? void 0 : values.navigation) == null ? void 0 : _c.portalUid) || "").trim() || void 0;
|
|
559
|
+
const matchedRoutes = await context.findMenuGroupRoutesByTitle(groupTitle, context.transaction, layoutUid, portalUid);
|
|
559
560
|
const rootMatchedRoutes = filterRootMenuGroupRoutes(matchedRoutes);
|
|
560
561
|
if (rootMatchedRoutes.length <= 1) {
|
|
561
562
|
return;
|
|
@@ -572,7 +573,7 @@ async function collectNavigationGroupErrors(actionName, values, context, errors)
|
|
|
572
573
|
});
|
|
573
574
|
}
|
|
574
575
|
async function collectNavigationIconErrors(actionName, values, context, errors) {
|
|
575
|
-
var _a, _b, _c, _d;
|
|
576
|
+
var _a, _b, _c, _d, _e;
|
|
576
577
|
if (actionName !== "applyBlueprint" || (values == null ? void 0 : values.mode) !== "create") {
|
|
577
578
|
return;
|
|
578
579
|
}
|
|
@@ -580,9 +581,10 @@ async function collectNavigationIconErrors(actionName, values, context, errors)
|
|
|
580
581
|
const group = _.isPlainObject((_a = values == null ? void 0 : values.navigation) == null ? void 0 : _a.group) ? values.navigation.group : null;
|
|
581
582
|
const groupRouteId = String((group == null ? void 0 : group.routeId) || "").trim();
|
|
582
583
|
const layoutUid = String(((_b = values == null ? void 0 : values.navigation) == null ? void 0 : _b.layoutUid) || "").trim() || void 0;
|
|
584
|
+
const portalUid = String(((_c = values == null ? void 0 : values.navigation) == null ? void 0 : _c.portalUid) || "").trim() || void 0;
|
|
583
585
|
if (!isMobileCreateNavigation && group && !groupRouteId && group.hideInMenu !== true) {
|
|
584
586
|
const groupIcon = String(group.icon || "").trim();
|
|
585
|
-
if (!groupIcon && await shouldRequireNewNavigationGroupIcon(group, context, layoutUid)) {
|
|
587
|
+
if (!groupIcon && await shouldRequireNewNavigationGroupIcon(group, context, layoutUid, portalUid)) {
|
|
586
588
|
pushAuthoringError(errors, {
|
|
587
589
|
path: "$.navigation.group.icon",
|
|
588
590
|
ruleId: "navigation-icon-required",
|
|
@@ -611,7 +613,7 @@ async function collectNavigationIconErrors(actionName, values, context, errors)
|
|
|
611
613
|
}
|
|
612
614
|
});
|
|
613
615
|
}
|
|
614
|
-
const item = _.isPlainObject((
|
|
616
|
+
const item = _.isPlainObject((_d = values == null ? void 0 : values.navigation) == null ? void 0 : _d.item) ? values.navigation.item : null;
|
|
615
617
|
const itemIcon = String((item == null ? void 0 : item.icon) || "").trim();
|
|
616
618
|
if (itemIcon && !isValidAntDesignIconName(itemIcon)) {
|
|
617
619
|
pushAuthoringError(errors, {
|
|
@@ -623,7 +625,7 @@ async function collectNavigationIconErrors(actionName, values, context, errors)
|
|
|
623
625
|
}
|
|
624
626
|
});
|
|
625
627
|
}
|
|
626
|
-
const pageIcon = String(((
|
|
628
|
+
const pageIcon = String(((_e = values == null ? void 0 : values.page) == null ? void 0 : _e.icon) || "").trim();
|
|
627
629
|
if (pageIcon && !isValidAntDesignIconName(pageIcon)) {
|
|
628
630
|
pushAuthoringError(errors, {
|
|
629
631
|
path: "$.page.icon",
|
|
@@ -636,19 +638,23 @@ async function collectNavigationIconErrors(actionName, values, context, errors)
|
|
|
636
638
|
}
|
|
637
639
|
}
|
|
638
640
|
async function isApplyBlueprintMobileCreateNavigation(values, context) {
|
|
639
|
-
var _a;
|
|
640
|
-
const
|
|
641
|
+
var _a, _b;
|
|
642
|
+
const portalUid = String(((_a = values == null ? void 0 : values.navigation) == null ? void 0 : _a.portalUid) || "").trim();
|
|
643
|
+
if (portalUid && context.getPortalLayoutTypeByUid) {
|
|
644
|
+
return await context.getPortalLayoutTypeByUid(portalUid, context.transaction) === "mobile";
|
|
645
|
+
}
|
|
646
|
+
const layoutUid = String(((_b = values == null ? void 0 : values.navigation) == null ? void 0 : _b.layoutUid) || "").trim();
|
|
641
647
|
if (!layoutUid || !context.getUiLayoutTypeByUid) {
|
|
642
648
|
return false;
|
|
643
649
|
}
|
|
644
650
|
return await context.getUiLayoutTypeByUid(layoutUid, context.transaction) === "mobile";
|
|
645
651
|
}
|
|
646
|
-
async function shouldRequireNewNavigationGroupIcon(group, context, layoutUid) {
|
|
652
|
+
async function shouldRequireNewNavigationGroupIcon(group, context, layoutUid, portalUid) {
|
|
647
653
|
const groupTitle = String((group == null ? void 0 : group.title) || "").trim();
|
|
648
654
|
if (!groupTitle || !context.findMenuGroupRoutesByTitle) {
|
|
649
655
|
return true;
|
|
650
656
|
}
|
|
651
|
-
const matchedRoutes = await context.findMenuGroupRoutesByTitle(groupTitle, context.transaction, layoutUid);
|
|
657
|
+
const matchedRoutes = await context.findMenuGroupRoutesByTitle(groupTitle, context.transaction, layoutUid, portalUid);
|
|
652
658
|
return filterRootMenuGroupRoutes(matchedRoutes).length === 0;
|
|
653
659
|
}
|
|
654
660
|
function filterRootMenuGroupRoutes(routes) {
|
|
@@ -83,21 +83,23 @@ function buildTabSelectorFromUid(uid) {
|
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
85
|
function compileCreatePlan(document, getCollection) {
|
|
86
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C;
|
|
86
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D;
|
|
87
87
|
const steps = [];
|
|
88
88
|
const chrome = buildPageChrome(document);
|
|
89
89
|
const layoutUid = (_a = document.navigation) == null ? void 0 : _a.layoutUid;
|
|
90
|
-
|
|
90
|
+
const portalUid = (_b = document.navigation) == null ? void 0 : _b.portalUid;
|
|
91
|
+
if (import_lodash.default.isPlainObject((_c = document.navigation) == null ? void 0 : _c.group) && import_lodash.default.isUndefined(document.navigation.group.routeId)) {
|
|
91
92
|
steps.push({
|
|
92
93
|
id: CREATE_MENU_GROUP_STEP_ID,
|
|
93
94
|
action: "createMenu",
|
|
94
95
|
values: (0, import_service_utils.buildDefinedPayload)({
|
|
95
96
|
layoutUid,
|
|
96
|
-
|
|
97
|
+
portalUid,
|
|
98
|
+
title: (_e = (_d = document.navigation) == null ? void 0 : _d.group) == null ? void 0 : _e.title,
|
|
97
99
|
type: "group",
|
|
98
|
-
icon: (
|
|
99
|
-
tooltip: (
|
|
100
|
-
hideInMenu: (
|
|
100
|
+
icon: (_g = (_f = document.navigation) == null ? void 0 : _f.group) == null ? void 0 : _g.icon,
|
|
101
|
+
tooltip: (_i = (_h = document.navigation) == null ? void 0 : _h.group) == null ? void 0 : _i.tooltip,
|
|
102
|
+
hideInMenu: (_k = (_j = document.navigation) == null ? void 0 : _j.group) == null ? void 0 : _k.hideInMenu
|
|
101
103
|
})
|
|
102
104
|
});
|
|
103
105
|
}
|
|
@@ -106,12 +108,13 @@ function compileCreatePlan(document, getCollection) {
|
|
|
106
108
|
action: "createMenu",
|
|
107
109
|
values: (0, import_service_utils.buildDefinedPayload)({
|
|
108
110
|
layoutUid,
|
|
109
|
-
|
|
111
|
+
portalUid,
|
|
112
|
+
title: ((_m = (_l = document.navigation) == null ? void 0 : _l.item) == null ? void 0 : _m.title) || chrome.pageTitle,
|
|
110
113
|
type: "item",
|
|
111
|
-
icon: ((
|
|
112
|
-
tooltip: (
|
|
113
|
-
hideInMenu: (
|
|
114
|
-
parentMenuRouteId: import_lodash.default.isUndefined((
|
|
114
|
+
icon: ((_o = (_n = document.navigation) == null ? void 0 : _n.item) == null ? void 0 : _o.icon) || ((_p = document.page) == null ? void 0 : _p.icon) || "FileOutlined",
|
|
115
|
+
tooltip: (_r = (_q = document.navigation) == null ? void 0 : _q.item) == null ? void 0 : _r.tooltip,
|
|
116
|
+
hideInMenu: (_t = (_s = document.navigation) == null ? void 0 : _s.item) == null ? void 0 : _t.hideInMenu,
|
|
117
|
+
parentMenuRouteId: import_lodash.default.isUndefined((_v = (_u = document.navigation) == null ? void 0 : _u.group) == null ? void 0 : _v.routeId) ? ((_x = (_w = document.navigation) == null ? void 0 : _w.group) == null ? void 0 : _x.title) ? { step: CREATE_MENU_GROUP_STEP_ID, path: "routeId" } : void 0 : (_z = (_y = document.navigation) == null ? void 0 : _y.group) == null ? void 0 : _z.routeId
|
|
115
118
|
})
|
|
116
119
|
});
|
|
117
120
|
steps.push({
|
|
@@ -119,13 +122,14 @@ function compileCreatePlan(document, getCollection) {
|
|
|
119
122
|
action: "createPage",
|
|
120
123
|
values: (0, import_service_utils.buildDefinedPayload)({
|
|
121
124
|
layoutUid,
|
|
125
|
+
portalUid,
|
|
122
126
|
menuRouteId: { step: CREATE_MENU_ITEM_STEP_ID, path: "routeId" },
|
|
123
127
|
title: chrome.pageTitle,
|
|
124
|
-
icon: (
|
|
125
|
-
documentTitle: (
|
|
126
|
-
enableHeader: (
|
|
128
|
+
icon: (_A = document.page) == null ? void 0 : _A.icon,
|
|
129
|
+
documentTitle: (_B = document.page) == null ? void 0 : _B.documentTitle,
|
|
130
|
+
enableHeader: (_C = document.page) == null ? void 0 : _C.enableHeader,
|
|
127
131
|
enableTabs: chrome.enableTabs,
|
|
128
|
-
displayTitle: (
|
|
132
|
+
displayTitle: (_D = document.page) == null ? void 0 : _D.displayTitle,
|
|
129
133
|
tabTitle: chrome.tabTitle,
|
|
130
134
|
tabIcon: chrome.tabIcon,
|
|
131
135
|
tabDocumentTitle: chrome.tabDocumentTitle,
|
|
@@ -132,9 +132,25 @@ function normalizeNavigation(input) {
|
|
|
132
132
|
return void 0;
|
|
133
133
|
}
|
|
134
134
|
(0, import_private_utils.assertPlainObject)(input, "flowSurfaces applyBlueprint navigation");
|
|
135
|
-
(0, import_private_utils.assertOnlyAllowedKeys)(input, "flowSurfaces applyBlueprint navigation", ["layoutUid", "group", "item"]);
|
|
135
|
+
(0, import_private_utils.assertOnlyAllowedKeys)(input, "flowSurfaces applyBlueprint navigation", ["layoutUid", "portalUid", "group", "item"]);
|
|
136
|
+
const layoutUid = (0, import_private_utils.readOptionalString)(input.layoutUid);
|
|
137
|
+
const portalUid = (0, import_private_utils.readOptionalString)(input.portalUid);
|
|
138
|
+
if (layoutUid && portalUid) {
|
|
139
|
+
(0, import_errors.throwBadRequest)(
|
|
140
|
+
`flowSurfaces applyBlueprint navigation.layoutUid and navigation.portalUid are mutually exclusive`,
|
|
141
|
+
{
|
|
142
|
+
ruleId: "navigation-target-mutually-exclusive",
|
|
143
|
+
path: "$.navigation.portalUid",
|
|
144
|
+
details: {
|
|
145
|
+
layoutUid,
|
|
146
|
+
portalUid
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
);
|
|
150
|
+
}
|
|
136
151
|
const normalized = (0, import_service_utils.buildDefinedPayload)({
|
|
137
|
-
layoutUid
|
|
152
|
+
layoutUid,
|
|
153
|
+
portalUid,
|
|
138
154
|
group: import_lodash.default.isUndefined(input.group) ? void 0 : (() => {
|
|
139
155
|
(0, import_private_utils.assertPlainObject)(input.group, "flowSurfaces applyBlueprint navigation.group");
|
|
140
156
|
(0, import_private_utils.assertOnlyAllowedKeys)(input.group, "flowSurfaces applyBlueprint navigation.group", [
|
|
@@ -52,6 +52,13 @@ export declare const FLOW_SURFACE_ACTION_DEFINITIONS: {
|
|
|
52
52
|
readonly mutate: false;
|
|
53
53
|
readonly valueSource: "default";
|
|
54
54
|
};
|
|
55
|
+
readonly listNavigationTargets: {
|
|
56
|
+
readonly method: "post";
|
|
57
|
+
readonly read: true;
|
|
58
|
+
readonly transaction: false;
|
|
59
|
+
readonly mutate: false;
|
|
60
|
+
readonly valueSource: "default";
|
|
61
|
+
};
|
|
55
62
|
readonly getReactionMeta: {
|
|
56
63
|
readonly method: "post";
|
|
57
64
|
readonly read: true;
|
|
@@ -380,7 +387,7 @@ type SelectFlowSurfaceActionNames<TFlag extends keyof FlowSurfaceActionDefinitio
|
|
|
380
387
|
[K in FlowSurfacesActionName]: (typeof FLOW_SURFACE_ACTION_DEFINITIONS)[K][TFlag] extends true ? K : never;
|
|
381
388
|
}[FlowSurfacesActionName];
|
|
382
389
|
type FlowSurfaceMutateActionName = SelectFlowSurfaceActionNames<'mutate'>;
|
|
383
|
-
export declare const FLOW_SURFACES_ACTION_NAMES: ("setFieldValueRules" | "setBlockLinkageRules" | "setFieldLinkageRules" | "setActionLinkageRules" | "context" | "get" | "configure" | "apply" | "createPage" | "addTab" | "addPopupTab" | "addBlock" | "addField" | "addAction" | "addRecordAction" | "compose" | "createMenu" | "catalog" | "describeSurface" | "exportBlueprint" | "getReactionMeta" | "applyBlueprint" | "applyApprovalBlueprint" | "listTemplates" | "getTemplate" | "saveTemplate" | "updateTemplate" | "destroyTemplate" | "convertTemplateToCopy" | "updateMenu" | "destroyPage" | "updateTab" | "moveTab" | "removeTab" | "updatePopupTab" | "movePopupTab" | "removePopupTab" | "addBlocks" | "addFields" | "addActions" | "addRecordActions" | "updateSettings" | "getEventFlowMeta" | "addEventFlow" | "setEventFlow" | "removeEventFlow" | "setEventFlows" | "setLayout" | "moveNode" | "removeNode" | "mutate")[];
|
|
390
|
+
export declare const FLOW_SURFACES_ACTION_NAMES: ("setFieldValueRules" | "setBlockLinkageRules" | "setFieldLinkageRules" | "setActionLinkageRules" | "context" | "get" | "configure" | "apply" | "createPage" | "addTab" | "addPopupTab" | "addBlock" | "addField" | "addAction" | "addRecordAction" | "compose" | "createMenu" | "catalog" | "describeSurface" | "exportBlueprint" | "listNavigationTargets" | "getReactionMeta" | "applyBlueprint" | "applyApprovalBlueprint" | "listTemplates" | "getTemplate" | "saveTemplate" | "updateTemplate" | "destroyTemplate" | "convertTemplateToCopy" | "updateMenu" | "destroyPage" | "updateTab" | "moveTab" | "removeTab" | "updatePopupTab" | "movePopupTab" | "removePopupTab" | "addBlocks" | "addFields" | "addActions" | "addRecordActions" | "updateSettings" | "getEventFlowMeta" | "addEventFlow" | "setEventFlow" | "removeEventFlow" | "setEventFlows" | "setLayout" | "moveNode" | "removeNode" | "mutate")[];
|
|
384
391
|
export declare const FLOW_SURFACES_READ_ACTION_NAMES: SelectFlowSurfaceActionNames<"read">[];
|
|
385
392
|
export declare const FLOW_SURFACE_MUTATE_OP_TYPES: FlowSurfaceMutateActionName[];
|
|
386
|
-
export declare const FLOW_SURFACES_ACTION_METHODS: Record<"setFieldValueRules" | "setBlockLinkageRules" | "setFieldLinkageRules" | "setActionLinkageRules" | "context" | "get" | "configure" | "apply" | "createPage" | "addTab" | "addPopupTab" | "addBlock" | "addField" | "addAction" | "addRecordAction" | "compose" | "createMenu" | "catalog" | "describeSurface" | "exportBlueprint" | "getReactionMeta" | "applyBlueprint" | "applyApprovalBlueprint" | "listTemplates" | "getTemplate" | "saveTemplate" | "updateTemplate" | "destroyTemplate" | "convertTemplateToCopy" | "updateMenu" | "destroyPage" | "updateTab" | "moveTab" | "removeTab" | "updatePopupTab" | "movePopupTab" | "removePopupTab" | "addBlocks" | "addFields" | "addActions" | "addRecordActions" | "updateSettings" | "getEventFlowMeta" | "addEventFlow" | "setEventFlow" | "removeEventFlow" | "setEventFlows" | "setLayout" | "moveNode" | "removeNode" | "mutate", FlowSurfaceActionMethod>;
|
|
393
|
+
export declare const FLOW_SURFACES_ACTION_METHODS: Record<"setFieldValueRules" | "setBlockLinkageRules" | "setFieldLinkageRules" | "setActionLinkageRules" | "context" | "get" | "configure" | "apply" | "createPage" | "addTab" | "addPopupTab" | "addBlock" | "addField" | "addAction" | "addRecordAction" | "compose" | "createMenu" | "catalog" | "describeSurface" | "exportBlueprint" | "listNavigationTargets" | "getReactionMeta" | "applyBlueprint" | "applyApprovalBlueprint" | "listTemplates" | "getTemplate" | "saveTemplate" | "updateTemplate" | "destroyTemplate" | "convertTemplateToCopy" | "updateMenu" | "destroyPage" | "updateTab" | "moveTab" | "removeTab" | "updatePopupTab" | "movePopupTab" | "removePopupTab" | "addBlocks" | "addFields" | "addActions" | "addRecordActions" | "updateSettings" | "getEventFlowMeta" | "addEventFlow" | "setEventFlow" | "removeEventFlow" | "setEventFlows" | "setLayout" | "moveNode" | "removeNode" | "mutate", FlowSurfaceActionMethod>;
|
|
@@ -41,6 +41,7 @@ const FLOW_SURFACE_ACTION_DEFINITIONS = {
|
|
|
41
41
|
get: { method: "get", read: true, transaction: false, mutate: false, valueSource: "read" },
|
|
42
42
|
describeSurface: { method: "post", read: true, transaction: false, mutate: false, valueSource: "default" },
|
|
43
43
|
exportBlueprint: { method: "post", read: true, transaction: false, mutate: false, valueSource: "default" },
|
|
44
|
+
listNavigationTargets: { method: "post", read: true, transaction: false, mutate: false, valueSource: "default" },
|
|
44
45
|
getReactionMeta: { method: "post", read: true, transaction: false, mutate: false, valueSource: "default" },
|
|
45
46
|
setFieldValueRules: { method: "post", read: false, transaction: true, mutate: false, valueSource: "default" },
|
|
46
47
|
setBlockLinkageRules: { method: "post", read: false, transaction: true, mutate: false, valueSource: "default" },
|
|
@@ -37,7 +37,7 @@ export declare class FlowSurfaceBadRequestError extends FlowSurfaceError {
|
|
|
37
37
|
constructor(message: string, code?: string, options?: FlowSurfaceErrorOptions);
|
|
38
38
|
}
|
|
39
39
|
export declare class FlowSurfaceForbiddenError extends FlowSurfaceError {
|
|
40
|
-
constructor(message: string, code?: string);
|
|
40
|
+
constructor(message: string, code?: string, options?: FlowSurfaceErrorOptions);
|
|
41
41
|
}
|
|
42
42
|
export declare class FlowSurfaceConflictError extends FlowSurfaceError {
|
|
43
43
|
constructor(message: string, code?: string);
|
|
@@ -76,6 +76,6 @@ export declare function toFlowSurfaceErrorItem(error: FlowSurfaceError): FlowSur
|
|
|
76
76
|
export declare function normalizeFlowSurfaceError(error: unknown): FlowSurfaceError;
|
|
77
77
|
export declare function throwBadRequest(message: string, codeOrOptions?: string | FlowSurfaceErrorOptions, options?: FlowSurfaceErrorOptions): never;
|
|
78
78
|
export declare function throwAggregateBadRequest(errors: FlowSurfaceErrorItemInput[]): never;
|
|
79
|
-
export declare function throwForbidden(message: string, code?: string): never;
|
|
79
|
+
export declare function throwForbidden(message: string, code?: string, options?: FlowSurfaceErrorOptions): never;
|
|
80
80
|
export declare function throwConflict(message: string, code?: string): never;
|
|
81
81
|
export declare function throwInternalError(message: string, code?: string): never;
|
|
@@ -69,8 +69,8 @@ class FlowSurfaceBadRequestError extends FlowSurfaceError {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
class FlowSurfaceForbiddenError extends FlowSurfaceError {
|
|
72
|
-
constructor(message, code = "FLOW_SURFACE_FORBIDDEN") {
|
|
73
|
-
super(message, 403, "forbidden", code);
|
|
72
|
+
constructor(message, code = "FLOW_SURFACE_FORBIDDEN", options = {}) {
|
|
73
|
+
super(message, 403, "forbidden", code, options);
|
|
74
74
|
this.name = "FlowSurfaceForbiddenError";
|
|
75
75
|
}
|
|
76
76
|
}
|
|
@@ -159,8 +159,8 @@ function throwBadRequest(message, codeOrOptions, options = {}) {
|
|
|
159
159
|
function throwAggregateBadRequest(errors) {
|
|
160
160
|
throw new FlowSurfaceAggregateError(errors);
|
|
161
161
|
}
|
|
162
|
-
function throwForbidden(message, code) {
|
|
163
|
-
throw new FlowSurfaceForbiddenError(message, code);
|
|
162
|
+
function throwForbidden(message, code, options = {}) {
|
|
163
|
+
throw new FlowSurfaceForbiddenError(message, code, options);
|
|
164
164
|
}
|
|
165
165
|
function throwConflict(message, code) {
|
|
166
166
|
throw new FlowSurfaceConflictError(message, code);
|