@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.
- package/dist/client/index.js +1 -1
- 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.js +160 -21
- package/dist/server/flow-surfaces/catalog.js +9 -5
- package/dist/server/flow-surfaces/chart-config.js +29 -6
- package/dist/server/flow-surfaces/contract-guard.js +39 -5
- package/dist/server/flow-surfaces/default-block-actions.js +2 -0
- package/dist/server/flow-surfaces/errors.d.ts +15 -0
- package/dist/server/flow-surfaces/errors.js +49 -3
- package/dist/server/flow-surfaces/filter-group.d.ts +7 -1
- package/dist/server/flow-surfaces/filter-group.js +175 -71
- package/dist/server/flow-surfaces/public-data-surface-default-filter.js +2 -1
- package/dist/server/flow-surfaces/runjs-authoring/ast/bindings.d.ts +66 -0
- package/dist/server/flow-surfaces/runjs-authoring/ast/bindings.js +661 -0
- package/dist/server/flow-surfaces/runjs-authoring/ast/execution.d.ts +20 -0
- package/dist/server/flow-surfaces/runjs-authoring/ast/execution.js +275 -0
- package/dist/server/flow-surfaces/runjs-authoring/ast/parser.d.ts +16 -0
- package/dist/server/flow-surfaces/runjs-authoring/ast/parser.js +130 -0
- package/dist/server/flow-surfaces/runjs-authoring/ast/react-values.d.ts +20 -0
- package/dist/server/flow-surfaces/runjs-authoring/ast/react-values.js +401 -0
- package/dist/server/flow-surfaces/runjs-authoring/ast/request-config.d.ts +21 -0
- package/dist/server/flow-surfaces/runjs-authoring/ast/request-config.js +199 -0
- package/dist/server/flow-surfaces/runjs-authoring/ast/source.d.ts +70 -0
- package/dist/server/flow-surfaces/runjs-authoring/ast/source.js +895 -0
- package/dist/server/flow-surfaces/runjs-authoring/ast/static-bindings.d.ts +23 -0
- package/dist/server/flow-surfaces/runjs-authoring/ast/static-bindings.js +618 -0
- package/dist/server/flow-surfaces/runjs-authoring/ast/static-values.d.ts +196 -0
- package/dist/server/flow-surfaces/runjs-authoring/ast/static-values.js +1777 -0
- package/dist/server/flow-surfaces/runjs-authoring/ast/walk.d.ts +10 -0
- package/dist/server/flow-surfaces/runjs-authoring/ast/walk.js +55 -0
- package/dist/server/flow-surfaces/runjs-authoring/collectors.d.ts +12 -0
- package/dist/server/flow-surfaces/runjs-authoring/collectors.js +589 -0
- package/dist/server/flow-surfaces/runjs-authoring/index.d.ts +2 -25
- package/dist/server/flow-surfaces/runjs-authoring/index.js +5 -11138
- package/dist/server/flow-surfaces/runjs-authoring/inspect.d.ts +13 -0
- package/dist/server/flow-surfaces/runjs-authoring/inspect.js +149 -0
- package/dist/server/flow-surfaces/runjs-authoring/internal-types.d.ts +333 -0
- package/dist/server/flow-surfaces/runjs-authoring/internal-types.js +36 -0
- package/dist/server/flow-surfaces/runjs-authoring/rules.js +2 -0
- package/dist/server/flow-surfaces/runjs-authoring/runtime/constants.d.ts +67 -0
- package/dist/server/flow-surfaces/runjs-authoring/runtime/constants.js +757 -0
- package/dist/server/flow-surfaces/runjs-authoring/runtime/errors.d.ts +22 -0
- package/dist/server/flow-surfaces/runjs-authoring/runtime/errors.js +91 -0
- package/dist/server/flow-surfaces/runjs-authoring/runtime/source-budget.d.ts +16 -0
- package/dist/server/flow-surfaces/runjs-authoring/runtime/source-budget.js +115 -0
- package/dist/server/flow-surfaces/runjs-authoring/runtime/surface.d.ts +19 -0
- package/dist/server/flow-surfaces/runjs-authoring/runtime/surface.js +140 -0
- package/dist/server/flow-surfaces/runjs-authoring/runtime/types.d.ts +91 -0
- package/dist/server/flow-surfaces/runjs-authoring/runtime/types.js +24 -0
- package/dist/server/flow-surfaces/runjs-authoring/scan/ctx-api.d.ts +138 -0
- package/dist/server/flow-surfaces/runjs-authoring/scan/ctx-api.js +1779 -0
- package/dist/server/flow-surfaces/runjs-authoring/scan/filter.d.ts +10 -0
- package/dist/server/flow-surfaces/runjs-authoring/scan/filter.js +1583 -0
- package/dist/server/flow-surfaces/runjs-authoring/scan/index.d.ts +195 -0
- package/dist/server/flow-surfaces/runjs-authoring/scan/index.js +463 -0
- package/dist/server/flow-surfaces/runjs-authoring/scan/react-render.d.ts +48 -0
- package/dist/server/flow-surfaces/runjs-authoring/scan/react-render.js +379 -0
- package/dist/server/flow-surfaces/runjs-authoring/scan/react.d.ts +26 -0
- package/dist/server/flow-surfaces/runjs-authoring/scan/react.js +1441 -0
- package/dist/server/flow-surfaces/runjs-authoring/scan/resource.d.ts +23 -0
- package/dist/server/flow-surfaces/runjs-authoring/scan/resource.js +1427 -0
- package/dist/server/flow-surfaces/runjs-authoring/scan/source-patterns.d.ts +91 -0
- package/dist/server/flow-surfaces/runjs-authoring/scan/source-patterns.js +889 -0
- package/dist/server/flow-surfaces/runjs-authoring/types.d.ts +1 -1
- package/dist/server/flow-surfaces/runjs-authoring/unknown-global-stop/index.d.ts +10 -0
- package/dist/server/flow-surfaces/runjs-authoring/unknown-global-stop/index.js +40 -0
- package/dist/server/flow-surfaces/runjs-authoring/validators/index.d.ts +12 -0
- package/dist/server/flow-surfaces/runjs-authoring/validators/index.js +887 -0
- package/dist/server/flow-surfaces/service-helpers.d.ts +29 -0
- package/dist/server/flow-surfaces/service-helpers.js +105 -0
- package/dist/server/flow-surfaces/service-utils.d.ts +15 -3
- package/dist/server/flow-surfaces/service-utils.js +5 -4
- package/dist/server/flow-surfaces/service.d.ts +4 -0
- package/dist/server/flow-surfaces/service.js +360 -30
- package/dist/server/flow-surfaces/types.d.ts +3 -0
- package/dist/server/repository.d.ts +15 -1
- package/dist/server/repository.js +262 -23
- package/dist/server/template/contexts.d.ts +2 -0
- package/dist/server/template/contexts.js +34 -0
- package/dist/server/template/resolver.js +233 -22
- package/dist/swagger/flow-surfaces.d.ts +175 -0
- package/dist/swagger/flow-surfaces.js +130 -51
- package/dist/swagger/index.d.ts +175 -0
- package/package.json +2 -2
|
@@ -42,6 +42,16 @@ __export(resolver_exports, {
|
|
|
42
42
|
module.exports = __toCommonJS(resolver_exports);
|
|
43
43
|
var import_ses = require("ses");
|
|
44
44
|
var import_lodash = __toESM(require("lodash"));
|
|
45
|
+
var import_utils = require("@nocobase/utils");
|
|
46
|
+
var import_contexts = require("./contexts");
|
|
47
|
+
const BLOCKED_SANDBOX_KEYS = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
|
|
48
|
+
const sandboxProxyCache = /* @__PURE__ */ new WeakMap();
|
|
49
|
+
const sandboxProxyMeta = /* @__PURE__ */ new WeakMap();
|
|
50
|
+
const EMPTY_SANDBOX_CONTEXT = {
|
|
51
|
+
getSandboxKeys: () => [],
|
|
52
|
+
getSandboxValue: () => void 0
|
|
53
|
+
};
|
|
54
|
+
let resolverLockdownReady = false;
|
|
45
55
|
async function resolveJsonTemplate(template, ctx) {
|
|
46
56
|
const compile = async (source) => {
|
|
47
57
|
if (typeof source === "string" && /\{\{.*?\}\}/.test(source)) {
|
|
@@ -75,6 +85,210 @@ async function replacePlaceholders(input, ctx) {
|
|
|
75
85
|
}
|
|
76
86
|
return result;
|
|
77
87
|
}
|
|
88
|
+
function isObjectLike(value) {
|
|
89
|
+
return value !== null && (typeof value === "object" || typeof value === "function");
|
|
90
|
+
}
|
|
91
|
+
function isTrustedPromise(value) {
|
|
92
|
+
return value instanceof Promise;
|
|
93
|
+
}
|
|
94
|
+
function isBlockedSandboxKey(key) {
|
|
95
|
+
return typeof key === "string" && BLOCKED_SANDBOX_KEYS.has(key);
|
|
96
|
+
}
|
|
97
|
+
function getSandboxDataDescriptor(source, key) {
|
|
98
|
+
if (isBlockedSandboxKey(key) || typeof key === "symbol") return void 0;
|
|
99
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(source, key);
|
|
100
|
+
if (!descriptor || !("value" in descriptor)) return void 0;
|
|
101
|
+
if (key === "then" && typeof descriptor.value === "function") return void 0;
|
|
102
|
+
return descriptor;
|
|
103
|
+
}
|
|
104
|
+
function getPrimitiveDataDescriptor(source, key) {
|
|
105
|
+
if (source == null || isObjectLike(source)) return void 0;
|
|
106
|
+
return getSandboxDataDescriptor(Object(source), key);
|
|
107
|
+
}
|
|
108
|
+
function isSandboxContextSource(value) {
|
|
109
|
+
return value === EMPTY_SANDBOX_CONTEXT || value instanceof import_contexts.ServerBaseContext;
|
|
110
|
+
}
|
|
111
|
+
function wrapSandboxValue(value) {
|
|
112
|
+
if (isTrustedPromise(value)) {
|
|
113
|
+
return Promise.prototype.then.call(value, (resolved) => wrapSandboxValue(resolved));
|
|
114
|
+
}
|
|
115
|
+
if (!isObjectLike(value)) return value;
|
|
116
|
+
if (sandboxProxyMeta.has(value)) return value;
|
|
117
|
+
const cached = sandboxProxyCache.get(value);
|
|
118
|
+
if (cached) return cached;
|
|
119
|
+
const kind = isSandboxContextSource(value) ? "context" : typeof value === "function" ? "function" : "data";
|
|
120
|
+
const proxy = kind === "context" ? createSandboxContextProxy(value) : kind === "function" ? createSandboxFunctionProxy(value) : createSandboxDataProxy(value);
|
|
121
|
+
sandboxProxyCache.set(value, proxy);
|
|
122
|
+
sandboxProxyMeta.set(proxy, { kind, source: value });
|
|
123
|
+
return proxy;
|
|
124
|
+
}
|
|
125
|
+
function wrapRootSandboxContext(ctx) {
|
|
126
|
+
return wrapSandboxValue(isSandboxContextSource(ctx) ? ctx : EMPTY_SANDBOX_CONTEXT);
|
|
127
|
+
}
|
|
128
|
+
function ensureResolverLockdown() {
|
|
129
|
+
if (resolverLockdownReady) return;
|
|
130
|
+
(0, import_utils.lockdownSes)({
|
|
131
|
+
consoleTaming: "unsafe",
|
|
132
|
+
errorTaming: "unsafe",
|
|
133
|
+
overrideTaming: "moderate",
|
|
134
|
+
stackFiltering: "verbose"
|
|
135
|
+
});
|
|
136
|
+
resolverLockdownReady = true;
|
|
137
|
+
}
|
|
138
|
+
function createSandboxContextProxy(source) {
|
|
139
|
+
return new Proxy(/* @__PURE__ */ Object.create(null), {
|
|
140
|
+
get: (_target, key) => {
|
|
141
|
+
if (isBlockedSandboxKey(key) || typeof key !== "string") return void 0;
|
|
142
|
+
if (!source.getSandboxKeys().includes(key)) return void 0;
|
|
143
|
+
return wrapSandboxValue(source.getSandboxValue(key));
|
|
144
|
+
},
|
|
145
|
+
has: (_target, key) => typeof key === "string" && source.getSandboxKeys().includes(key),
|
|
146
|
+
ownKeys: () => source.getSandboxKeys(),
|
|
147
|
+
getOwnPropertyDescriptor: (_target, key) => {
|
|
148
|
+
if (isBlockedSandboxKey(key) || typeof key !== "string" || !source.getSandboxKeys().includes(key)) {
|
|
149
|
+
return void 0;
|
|
150
|
+
}
|
|
151
|
+
return {
|
|
152
|
+
configurable: true,
|
|
153
|
+
enumerable: true,
|
|
154
|
+
value: wrapSandboxValue(source.getSandboxValue(key))
|
|
155
|
+
};
|
|
156
|
+
},
|
|
157
|
+
getPrototypeOf: () => null,
|
|
158
|
+
set: () => false,
|
|
159
|
+
defineProperty: () => false,
|
|
160
|
+
deleteProperty: () => false
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
function createSandboxFunctionProxy(source) {
|
|
164
|
+
const callable = (...args) => Reflect.apply(source, void 0, args);
|
|
165
|
+
return new Proxy(callable, {
|
|
166
|
+
apply: (_target, _thisArg, argArray) => wrapSandboxValue(Reflect.apply(source, void 0, argArray)),
|
|
167
|
+
get: (_target, key) => {
|
|
168
|
+
if (key === "length" || key === "name") return Reflect.get(source, key);
|
|
169
|
+
return void 0;
|
|
170
|
+
},
|
|
171
|
+
has: (_target, key) => key === "length" || key === "name",
|
|
172
|
+
ownKeys: () => [],
|
|
173
|
+
getOwnPropertyDescriptor: () => void 0,
|
|
174
|
+
getPrototypeOf: () => null,
|
|
175
|
+
set: () => false,
|
|
176
|
+
defineProperty: () => false,
|
|
177
|
+
deleteProperty: () => false
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
function createSandboxDataProxy(source) {
|
|
181
|
+
const target = Array.isArray(source) ? new Array(source.length) : /* @__PURE__ */ Object.create(null);
|
|
182
|
+
return new Proxy(target, {
|
|
183
|
+
get: (_target, key) => {
|
|
184
|
+
const descriptor = getSandboxDataDescriptor(source, key);
|
|
185
|
+
if (!descriptor) return void 0;
|
|
186
|
+
const value = descriptor.value;
|
|
187
|
+
return typeof value === "function" ? wrapSandboxValue(value.bind(source)) : wrapSandboxValue(value);
|
|
188
|
+
},
|
|
189
|
+
has: (_target, key) => {
|
|
190
|
+
if (isBlockedSandboxKey(key) || typeof key !== "string") return false;
|
|
191
|
+
return !!getSandboxDataDescriptor(source, key);
|
|
192
|
+
},
|
|
193
|
+
ownKeys: () => {
|
|
194
|
+
const keys = Reflect.ownKeys(source).filter((key) => {
|
|
195
|
+
if (typeof key !== "string" || isBlockedSandboxKey(key)) return false;
|
|
196
|
+
return !!getSandboxDataDescriptor(source, key);
|
|
197
|
+
});
|
|
198
|
+
if (Array.isArray(source) && !keys.includes("length")) keys.push("length");
|
|
199
|
+
return keys;
|
|
200
|
+
},
|
|
201
|
+
getOwnPropertyDescriptor: (proxyTarget, key) => {
|
|
202
|
+
if (isBlockedSandboxKey(key) || typeof key === "symbol") return void 0;
|
|
203
|
+
if (Array.isArray(source) && key === "length") {
|
|
204
|
+
return Reflect.getOwnPropertyDescriptor(proxyTarget, key);
|
|
205
|
+
}
|
|
206
|
+
const descriptor = getSandboxDataDescriptor(source, key);
|
|
207
|
+
if (!descriptor) return void 0;
|
|
208
|
+
return {
|
|
209
|
+
configurable: true,
|
|
210
|
+
enumerable: descriptor.enumerable,
|
|
211
|
+
writable: false,
|
|
212
|
+
value: wrapSandboxValue(descriptor.value)
|
|
213
|
+
};
|
|
214
|
+
},
|
|
215
|
+
getPrototypeOf: () => null,
|
|
216
|
+
set: () => false,
|
|
217
|
+
defineProperty: () => false,
|
|
218
|
+
deleteProperty: () => false
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
async function unwrapSandboxValue(value, seen = /* @__PURE__ */ new WeakMap()) {
|
|
222
|
+
const resolved = isTrustedPromise(value) ? await value : value;
|
|
223
|
+
if (!isObjectLike(resolved)) return resolved;
|
|
224
|
+
const meta = sandboxProxyMeta.get(resolved);
|
|
225
|
+
if ((meta == null ? void 0 : meta.kind) === "function" || typeof resolved === "function") return void 0;
|
|
226
|
+
const source = (meta == null ? void 0 : meta.source) ?? resolved;
|
|
227
|
+
if (!isObjectLike(source)) return source;
|
|
228
|
+
if (seen.has(source)) return seen.get(source);
|
|
229
|
+
if (isSandboxContextSource(source)) {
|
|
230
|
+
const out2 = {};
|
|
231
|
+
seen.set(source, out2);
|
|
232
|
+
for (const key of source.getSandboxKeys()) {
|
|
233
|
+
if (BLOCKED_SANDBOX_KEYS.has(key)) continue;
|
|
234
|
+
out2[key] = await unwrapSandboxValue(wrapSandboxValue(source.getSandboxValue(key)), seen);
|
|
235
|
+
}
|
|
236
|
+
return out2;
|
|
237
|
+
}
|
|
238
|
+
if (Array.isArray(source)) {
|
|
239
|
+
const out2 = [];
|
|
240
|
+
seen.set(source, out2);
|
|
241
|
+
const lengthDescriptor = Reflect.getOwnPropertyDescriptor(source, "length");
|
|
242
|
+
const length = typeof (lengthDescriptor == null ? void 0 : lengthDescriptor.value) === "number" ? lengthDescriptor.value : 0;
|
|
243
|
+
for (let index = 0; index < length; index++) {
|
|
244
|
+
const descriptor = Reflect.getOwnPropertyDescriptor(source, String(index));
|
|
245
|
+
if (!descriptor || !("value" in descriptor)) continue;
|
|
246
|
+
out2.push(await unwrapSandboxValue(descriptor.value, seen));
|
|
247
|
+
}
|
|
248
|
+
return out2;
|
|
249
|
+
}
|
|
250
|
+
if (source instanceof Date) return source;
|
|
251
|
+
const out = {};
|
|
252
|
+
seen.set(source, out);
|
|
253
|
+
for (const key of Object.keys(source)) {
|
|
254
|
+
if (BLOCKED_SANDBOX_KEYS.has(key)) continue;
|
|
255
|
+
const descriptor = getSandboxDataDescriptor(source, key);
|
|
256
|
+
if (!descriptor) continue;
|
|
257
|
+
out[key] = await unwrapSandboxValue(descriptor.value, seen);
|
|
258
|
+
}
|
|
259
|
+
return out;
|
|
260
|
+
}
|
|
261
|
+
function getRootSandboxValue(ctx, key) {
|
|
262
|
+
if (BLOCKED_SANDBOX_KEYS.has(key)) return void 0;
|
|
263
|
+
if (isSandboxContextSource(ctx)) {
|
|
264
|
+
if (!ctx.getSandboxKeys().includes(key)) return void 0;
|
|
265
|
+
return wrapSandboxValue(ctx.getSandboxValue(key));
|
|
266
|
+
}
|
|
267
|
+
return void 0;
|
|
268
|
+
}
|
|
269
|
+
async function getSandboxProperty(value, key) {
|
|
270
|
+
if (BLOCKED_SANDBOX_KEYS.has(key)) return void 0;
|
|
271
|
+
const resolved = isTrustedPromise(value) ? await value : value;
|
|
272
|
+
if (resolved == null) return void 0;
|
|
273
|
+
const meta = isObjectLike(resolved) ? sandboxProxyMeta.get(resolved) : void 0;
|
|
274
|
+
const source = (meta == null ? void 0 : meta.source) ?? resolved;
|
|
275
|
+
if (isSandboxContextSource(source)) {
|
|
276
|
+
if (!source.getSandboxKeys().includes(key)) return void 0;
|
|
277
|
+
return wrapSandboxValue(source.getSandboxValue(key));
|
|
278
|
+
}
|
|
279
|
+
if (typeof source === "function") {
|
|
280
|
+
return key === "length" || key === "name" ? Reflect.get(source, key) : void 0;
|
|
281
|
+
}
|
|
282
|
+
if (!isObjectLike(source)) {
|
|
283
|
+
const descriptor2 = getPrimitiveDataDescriptor(source, key);
|
|
284
|
+
if (!descriptor2 || typeof descriptor2.value === "function") return void 0;
|
|
285
|
+
return wrapSandboxValue(descriptor2.value);
|
|
286
|
+
}
|
|
287
|
+
const descriptor = getSandboxDataDescriptor(source, key);
|
|
288
|
+
if (!descriptor) return void 0;
|
|
289
|
+
const current = descriptor.value;
|
|
290
|
+
return typeof current === "function" ? wrapSandboxValue(current.bind(source)) : wrapSandboxValue(current);
|
|
291
|
+
}
|
|
78
292
|
async function evaluate(expr, ctx) {
|
|
79
293
|
try {
|
|
80
294
|
const raw = expr.trim();
|
|
@@ -84,40 +298,36 @@ async function evaluate(expr, ctx) {
|
|
|
84
298
|
if (dotOnly) {
|
|
85
299
|
const first = dotOnly[1];
|
|
86
300
|
const rest = dotOnly[2];
|
|
87
|
-
const base =
|
|
88
|
-
if (!rest) return base;
|
|
301
|
+
const base = getRootSandboxValue(ctx, first);
|
|
302
|
+
if (!rest) return await unwrapSandboxValue(wrapSandboxValue(base));
|
|
89
303
|
const resolved = await asyncGetValuesByPath(base, rest);
|
|
90
304
|
if (typeof resolved !== "undefined" || !rest.includes("-")) {
|
|
91
|
-
return resolved;
|
|
305
|
+
return await unwrapSandboxValue(resolved);
|
|
92
306
|
}
|
|
93
307
|
}
|
|
94
308
|
const transformed = preprocessExpression(raw);
|
|
309
|
+
ensureResolverLockdown();
|
|
95
310
|
const compartment = new Compartment({
|
|
96
|
-
ctx,
|
|
97
|
-
__get: (varName, path) => getAtPath(ctx, varName, path)
|
|
98
|
-
console
|
|
311
|
+
ctx: wrapRootSandboxContext(ctx),
|
|
312
|
+
__get: wrapSandboxValue((varName, path) => getAtPath(ctx, varName, path))
|
|
99
313
|
});
|
|
100
314
|
const wrapped = `(async () => { try { return ${transformed}; } catch (e) { return undefined; } })()`;
|
|
101
|
-
return await compartment.evaluate(wrapped);
|
|
315
|
+
return await unwrapSandboxValue(await compartment.evaluate(wrapped));
|
|
102
316
|
} catch (_2) {
|
|
103
317
|
return void 0;
|
|
104
318
|
}
|
|
105
319
|
}
|
|
106
320
|
async function getAtPath(ctx, varName, path) {
|
|
107
321
|
try {
|
|
108
|
-
let current =
|
|
322
|
+
let current = getRootSandboxValue(ctx, varName);
|
|
109
323
|
if (!path) return current;
|
|
110
324
|
const norm = String(path || "").replace(/^\./, "");
|
|
111
325
|
const segments = import_lodash.default.toPath(norm);
|
|
112
326
|
for (const seg of segments) {
|
|
113
327
|
if (current == null) return void 0;
|
|
114
|
-
|
|
115
|
-
if (val && typeof val["then"] === "function") {
|
|
116
|
-
val = await val;
|
|
117
|
-
}
|
|
118
|
-
current = val;
|
|
328
|
+
current = await getSandboxProperty(current, seg);
|
|
119
329
|
}
|
|
120
|
-
return current;
|
|
330
|
+
return wrapSandboxValue(current);
|
|
121
331
|
} catch (_2) {
|
|
122
332
|
return void 0;
|
|
123
333
|
}
|
|
@@ -134,18 +344,19 @@ async function asyncGetValuesByPath(obj, path, defaultValue) {
|
|
|
134
344
|
if (Array.isArray(currentValue)) {
|
|
135
345
|
shouldReturnArray = true;
|
|
136
346
|
const rest = keys.slice(i).join(".");
|
|
137
|
-
const parts = await Promise.all(
|
|
347
|
+
const parts = await Promise.all(
|
|
348
|
+
Array.prototype.map.call(currentValue, (el) => asyncGetValuesByPath(el, rest, defaultValue))
|
|
349
|
+
);
|
|
138
350
|
for (const p of parts) {
|
|
139
|
-
if (Array.isArray(p))
|
|
140
|
-
|
|
351
|
+
if (Array.isArray(p)) {
|
|
352
|
+
for (let index = 0; index < p.length; index++) {
|
|
353
|
+
if (typeof p[index] !== "undefined") result.push(p[index]);
|
|
354
|
+
}
|
|
355
|
+
} else if (typeof p !== "undefined") result.push(p);
|
|
141
356
|
}
|
|
142
357
|
break;
|
|
143
358
|
}
|
|
144
|
-
|
|
145
|
-
if (val && typeof val.then === "function") {
|
|
146
|
-
val = await val;
|
|
147
|
-
}
|
|
148
|
-
currentValue = val;
|
|
359
|
+
currentValue = await getSandboxProperty(currentValue, key);
|
|
149
360
|
if (i === keys.length - 1) {
|
|
150
361
|
result.push(currentValue);
|
|
151
362
|
}
|
|
@@ -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;
|