@arronqzy/blueprint-dsl 1.0.16 → 1.0.18
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/index.cjs +595 -67
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +129 -1
- package/dist/index.d.ts +129 -1
- package/dist/index.js +583 -68
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,146 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
// src/messages.ts
|
|
4
|
+
var ZH_CN = {
|
|
5
|
+
invalidJson: "\u4E0D\u662F\u6709\u6548 JSON\uFF1A{reason}",
|
|
6
|
+
invalidFormat: "\u683C\u5F0F\u65E0\u6548",
|
|
7
|
+
jsonInvalid: "JSON \u683C\u5F0F\u65E0\u6548",
|
|
8
|
+
jsonEmpty: "JSON \u4E0D\u80FD\u4E3A\u7A7A",
|
|
9
|
+
jsonRootMustBeContainer: "JSON \u6839\u8282\u70B9\u5FC5\u987B\u662F object \u6216 array",
|
|
10
|
+
contentEmpty: "\u5185\u5BB9\u4E3A\u7A7A",
|
|
11
|
+
contentRequired: "\u5185\u5BB9\u4E0D\u80FD\u4E3A\u7A7A",
|
|
12
|
+
codeRequired: "\u4EE3\u7801\u4E0D\u80FD\u4E3A\u7A7A",
|
|
13
|
+
javascriptSyntaxError: "JavaScript \u8BED\u6CD5\u9519\u8BEF",
|
|
14
|
+
logicUpdateRequired: "\u9700\u8981\u5B9A\u4E49 update(input) \u51FD\u6570",
|
|
15
|
+
apiItemMustBeObject: "apis[{index}] \u5FC5\u987B\u662F\u5BF9\u8C61",
|
|
16
|
+
apiItemFieldRequired: "apis[{index}].{field} \u5FC5\u586B\u4E14\u4E3A\u975E\u7A7A\u5B57\u7B26\u4E32",
|
|
17
|
+
apiItemMethodInvalid: "apis[{index}].method \u5FC5\u987B\u662F {methods} \u4E4B\u4E00",
|
|
18
|
+
apiItemFieldStringMap: "apis[{index}].{field} \u5FC5\u987B\u662F string \u5B57\u5178",
|
|
19
|
+
apiItemFieldString: "apis[{index}].{field} \u5FC5\u987B\u662F\u5B57\u7B26\u4E32",
|
|
20
|
+
apiRootMustBeObject: "\u6839\u8282\u70B9\u5FC5\u987B\u662F\u5BF9\u8C61",
|
|
21
|
+
apiVersionMismatch: "version \u5FC5\u987B\u4E3A {version}",
|
|
22
|
+
apiNameRequired: "name \u5FC5\u586B\u4E14\u4E3A\u975E\u7A7A\u5B57\u7B26\u4E32",
|
|
23
|
+
apiBaseUrlString: "baseUrl \u5FC5\u987B\u662F\u5B57\u7B26\u4E32",
|
|
24
|
+
apiListMustBeArray: "apis \u5FC5\u987B\u662F\u6570\u7EC4",
|
|
25
|
+
apiListEmpty: "apis \u81F3\u5C11\u5305\u542B\u4E00\u6761\u63A5\u53E3",
|
|
26
|
+
apiNameDuplicated: "\u63A5\u53E3\u540D\u79F0\u91CD\u590D\uFF1A{name}",
|
|
27
|
+
apiTemplateName: "\u793A\u4F8B\u63A5\u53E3\u96C6\u5408",
|
|
28
|
+
apiTemplateListUsers: "\u83B7\u53D6\u7528\u6237\u5217\u8868",
|
|
29
|
+
apiTemplateListUsersDesc: "\u5206\u9875\u67E5\u8BE2\u7528\u6237\uFF1Bpage / tenant / token \u53EF\u7528 Scope \u6A21\u7248",
|
|
30
|
+
apiTemplateCreateUser: "\u521B\u5EFA\u7528\u6237",
|
|
31
|
+
apiTemplateCreateUserDesc: "\u521B\u5EFA\u7528\u6237\uFF1BURL \u4E0E body \u5747\u652F\u6301 Scope \u6A21\u7248",
|
|
32
|
+
apiTemplateGetUser: "\u83B7\u53D6\u7528\u6237\u8BE6\u60C5",
|
|
33
|
+
apiTemplateGetUserDesc: "\u6309 id \u67E5\u8BE2\uFF1B\u8DEF\u5F84\u91CC\u53EF\u76F4\u63A5\u5199 Scope \u6A21\u7248",
|
|
34
|
+
fetchUrlMissing: "\u8BF7\u6C42 URL \u672A\u914D\u7F6E",
|
|
35
|
+
fetchBodyInvalidJson: "\u8BF7\u6C42\u4F53\u4E0D\u662F\u6709\u6548 JSON\uFF1A{reason}",
|
|
36
|
+
fetchResponseInvalidJson: "\u54CD\u5E94\u4E0D\u662F\u6709\u6548\u7684 JSON",
|
|
37
|
+
fetchAborted: "\u8BF7\u6C42\u5DF2\u4E2D\u6B62",
|
|
38
|
+
fetchTimeout: "\u8BF7\u6C42\u8D85\u65F6\uFF08{ms}ms\uFF09",
|
|
39
|
+
headersTemplateNotObject: "\u8BF7\u6C42\u5934\u6A21\u677F\u89E3\u6790\u540E\u4E0D\u662F\u6709\u6548\u7684 JSON \u5BF9\u8C61",
|
|
40
|
+
headersNotObject: "\u8BF7\u6C42\u5934\u4E0D\u662F\u6709\u6548\u7684 JSON \u5BF9\u8C61",
|
|
41
|
+
swaggerInvalid: "Swagger \u6587\u6863\u683C\u5F0F\u65E0\u6548",
|
|
42
|
+
openApiNoOperations: "\u672A\u5728 OpenAPI \u6587\u6863\u4E2D\u627E\u5230\u63A5\u53E3",
|
|
43
|
+
swagger2NoOperations: "\u672A\u5728 Swagger 2.0 \u6587\u6863\u4E2D\u627E\u5230\u63A5\u53E3",
|
|
44
|
+
swaggerUnsupported: "\u4EC5\u652F\u6301 OpenAPI 3.x \u4E0E Swagger 2.0 \u6587\u6863",
|
|
45
|
+
storageUnsupported: "\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301 {storage}",
|
|
46
|
+
storageKeyEmpty: "\u5B58\u50A8\u5199\u5165 key \u89E3\u6790\u4E3A\u7A7A",
|
|
47
|
+
clockCountPositive: "\u8F93\u51FA\u6B21\u6570\u987B\u5927\u4E8E 0",
|
|
48
|
+
clockIntervalPositive: "\u5F53\u524D\u914D\u7F6E\u4E0B\u65F6\u949F\u4FE1\u53F7\u95F4\u9694\u987B\u5927\u4E8E 0 \u79D2",
|
|
49
|
+
lifecycleSignalMissing: "\u751F\u547D\u5468\u671F\u4FE1\u53F7\u7F3A\u5931",
|
|
50
|
+
blueprintCycle: "\u84DD\u56FE\u5F15\u7528\u5B58\u5728\u6B7B\u5FAA\u73AF\uFF1A{path}",
|
|
51
|
+
debugMustStartFromLifecycle: "\u8C03\u8BD5\u4F1A\u8BDD\u53EA\u80FD\u4ECE\u751F\u547D\u5468\u671F\u8282\u70B9\u5F00\u59CB",
|
|
52
|
+
nodeRemoved: "\u8282\u70B9\u5DF2\u4ECE\u84DD\u56FE\u4E2D\u79FB\u9664",
|
|
53
|
+
clockNeedsTrue: "\u65F6\u949F\u8282\u70B9\u9700\u8981\u6536\u5230\u771F\u4FE1\u53F7\u540E\u624D\u4F1A\u542F\u52A8",
|
|
54
|
+
blueprintNeedsTrue: "\u84DD\u56FE\u8282\u70B9\u9700\u8981\u6536\u5230\u771F\u4FE1\u53F7\u540E\u624D\u4F1A\u6267\u884C",
|
|
55
|
+
blueprintNotSelected: "\u672A\u9009\u62E9\u84DD\u56FE\u5E93\u4E2D\u7684\u84DD\u56FE",
|
|
56
|
+
blueprintResolverMissing: "\u84DD\u56FE\u5E93\u89E3\u6790\u5668\u672A\u914D\u7F6E",
|
|
57
|
+
blueprintRecordMissing: "\u84DD\u56FE\u5E93\u8BB0\u5F55\u4E0D\u5B58\u5728: {id}",
|
|
58
|
+
fetchNoUpstream: "\u6570\u636E\u6E90\u8282\u70B9\u672A\u6536\u5230\u4E0A\u6E38\u8F93\u51FA\uFF0C\u8BF7\u786E\u8BA4\u8FDE\u7EBF\u4E0E\u4E0A\u6E38\u8282\u70B9\u5DF2\u6267\u884C",
|
|
59
|
+
fetchNeedsTrue: "\u6570\u636E\u6E90\u8282\u70B9\u9700\u8981\u6536\u5230\u771F\u4FE1\u53F7\u540E\u624D\u4F1A\u53D1\u8D77\u8BF7\u6C42",
|
|
60
|
+
jsonNeedsTrue: "JSON \u8282\u70B9\u9700\u8981\u6536\u5230\u771F\u4FE1\u53F7\u540E\u624D\u4F1A\u89E3\u6790",
|
|
61
|
+
storageNeedsTrue: "\u5B58\u50A8\u8282\u70B9\u9700\u8981\u6536\u5230\u771F\u4FE1\u53F7\u540E\u624D\u4F1A\u8BFB\u5199\u7F13\u5B58",
|
|
62
|
+
andNeedsBothTrue: "\u5E76\u8FD0\u7B97\uFF1A\u4E24\u4E2A\u8F93\u5165\u987B\u5747\u4E3A\u771F\u4FE1\u53F7"
|
|
63
|
+
};
|
|
64
|
+
var EN_US = {
|
|
65
|
+
invalidJson: "Invalid JSON: {reason}",
|
|
66
|
+
invalidFormat: "invalid format",
|
|
67
|
+
jsonInvalid: "Invalid JSON",
|
|
68
|
+
jsonEmpty: "JSON cannot be empty",
|
|
69
|
+
jsonRootMustBeContainer: "JSON root must be an object or array",
|
|
70
|
+
contentEmpty: "Content is empty",
|
|
71
|
+
contentRequired: "Content cannot be empty",
|
|
72
|
+
codeRequired: "Code cannot be empty",
|
|
73
|
+
javascriptSyntaxError: "JavaScript syntax error",
|
|
74
|
+
logicUpdateRequired: "An update(input) function is required",
|
|
75
|
+
apiItemMustBeObject: "apis[{index}] must be an object",
|
|
76
|
+
apiItemFieldRequired: "apis[{index}].{field} is required and must be a non-empty string",
|
|
77
|
+
apiItemMethodInvalid: "apis[{index}].method must be one of {methods}",
|
|
78
|
+
apiItemFieldStringMap: "apis[{index}].{field} must be a string map",
|
|
79
|
+
apiItemFieldString: "apis[{index}].{field} must be a string",
|
|
80
|
+
apiRootMustBeObject: "Root must be an object",
|
|
81
|
+
apiVersionMismatch: "version must be {version}",
|
|
82
|
+
apiNameRequired: "name is required and must be a non-empty string",
|
|
83
|
+
apiBaseUrlString: "baseUrl must be a string",
|
|
84
|
+
apiListMustBeArray: "apis must be an array",
|
|
85
|
+
apiListEmpty: "apis must contain at least one API",
|
|
86
|
+
apiNameDuplicated: "Duplicate API name: {name}",
|
|
87
|
+
apiTemplateName: "Sample API collection",
|
|
88
|
+
apiTemplateListUsers: "List users",
|
|
89
|
+
apiTemplateListUsersDesc: "Paged user query; page / tenant / token accept Scope templates",
|
|
90
|
+
apiTemplateCreateUser: "Create user",
|
|
91
|
+
apiTemplateCreateUserDesc: "Create a user; URL and body both accept Scope templates",
|
|
92
|
+
apiTemplateGetUser: "Get user detail",
|
|
93
|
+
apiTemplateGetUserDesc: "Query by id; Scope templates can be used directly in the path",
|
|
94
|
+
fetchUrlMissing: "Request URL is not configured",
|
|
95
|
+
fetchBodyInvalidJson: "Request body is not valid JSON: {reason}",
|
|
96
|
+
fetchResponseInvalidJson: "Response is not valid JSON",
|
|
97
|
+
fetchAborted: "Request aborted",
|
|
98
|
+
fetchTimeout: "Request timed out ({ms}ms)",
|
|
99
|
+
headersTemplateNotObject: "Headers template does not resolve to a JSON object",
|
|
100
|
+
headersNotObject: "Headers are not a valid JSON object",
|
|
101
|
+
swaggerInvalid: "Invalid Swagger document",
|
|
102
|
+
openApiNoOperations: "No operations found in the OpenAPI document",
|
|
103
|
+
swagger2NoOperations: "No operations found in the Swagger 2.0 document",
|
|
104
|
+
swaggerUnsupported: "Only OpenAPI 3.x and Swagger 2.0 documents are supported",
|
|
105
|
+
storageUnsupported: "{storage} is not available in this environment",
|
|
106
|
+
storageKeyEmpty: "Storage write key resolved to empty",
|
|
107
|
+
clockCountPositive: "Output count must be greater than 0",
|
|
108
|
+
clockIntervalPositive: "Clock interval must be greater than 0 seconds with the current config",
|
|
109
|
+
lifecycleSignalMissing: "Lifecycle signal is missing",
|
|
110
|
+
blueprintCycle: "Blueprint references form a cycle: {path}",
|
|
111
|
+
debugMustStartFromLifecycle: "A debug session can only start from a lifecycle node",
|
|
112
|
+
nodeRemoved: "Node was removed from the blueprint",
|
|
113
|
+
clockNeedsTrue: "Clock node starts only after receiving a true signal",
|
|
114
|
+
blueprintNeedsTrue: "Blueprint node runs only after receiving a true signal",
|
|
115
|
+
blueprintNotSelected: "No blueprint selected from the library",
|
|
116
|
+
blueprintResolverMissing: "Blueprint library resolver is not configured",
|
|
117
|
+
blueprintRecordMissing: "Blueprint library record not found: {id}",
|
|
118
|
+
fetchNoUpstream: "Data source node received no upstream output; check the connection and that upstream nodes ran",
|
|
119
|
+
fetchNeedsTrue: "Data source node sends the request only after receiving a true signal",
|
|
120
|
+
jsonNeedsTrue: "JSON node parses only after receiving a true signal",
|
|
121
|
+
storageNeedsTrue: "Storage node reads/writes only after receiving a true signal",
|
|
122
|
+
andNeedsBothTrue: "AND: both inputs must be true signals"
|
|
123
|
+
};
|
|
124
|
+
var CATALOGS = {
|
|
125
|
+
"zh-CN": ZH_CN,
|
|
126
|
+
"en-US": EN_US
|
|
127
|
+
};
|
|
128
|
+
var currentLocale = "zh-CN";
|
|
129
|
+
function setBlueprintDslLocale(locale) {
|
|
130
|
+
currentLocale = locale;
|
|
131
|
+
}
|
|
132
|
+
function getBlueprintDslLocale() {
|
|
133
|
+
return currentLocale;
|
|
134
|
+
}
|
|
135
|
+
function dslMessage(key, params) {
|
|
136
|
+
const template = CATALOGS[currentLocale][key];
|
|
137
|
+
if (!params) return template;
|
|
138
|
+
return template.replace(
|
|
139
|
+
/\{(\w+)\}/g,
|
|
140
|
+
(match, name) => name in params ? String(params[name]) : match
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
|
|
3
144
|
// src/lifecycle.ts
|
|
4
145
|
var PAGE_LIFECYCLE_PHASES = [
|
|
5
146
|
"created",
|
|
@@ -139,7 +280,7 @@ function registerDefaultBehaviors(registry) {
|
|
|
139
280
|
registry.registerJS("lifecycle-emit", async ({ token, io }) => {
|
|
140
281
|
const lifecycle = token.scope.vars.get(LIFECYCLE_SIGNAL_KEY);
|
|
141
282
|
if (!lifecycle) {
|
|
142
|
-
io.setOutput("out", createFalseSignal("
|
|
283
|
+
io.setOutput("out", createFalseSignal(dslMessage("lifecycleSignalMissing")));
|
|
143
284
|
} else if (lifecycle.phase === "blueprintActivated") {
|
|
144
285
|
io.setOutput(
|
|
145
286
|
"out",
|
|
@@ -974,7 +1115,7 @@ function hasExplicitUrlScheme(url) {
|
|
|
974
1115
|
function resolveFetchRequestUrl(config) {
|
|
975
1116
|
const rawUrl = config.url?.trim() ?? "";
|
|
976
1117
|
if (!rawUrl) {
|
|
977
|
-
throw new Error("
|
|
1118
|
+
throw new Error(dslMessage("fetchUrlMissing"));
|
|
978
1119
|
}
|
|
979
1120
|
if (hasExplicitUrlScheme(rawUrl)) {
|
|
980
1121
|
return rawUrl;
|
|
@@ -1004,7 +1145,7 @@ function linkAbortSignal(controller, external) {
|
|
|
1004
1145
|
async function executeFetch(config, options) {
|
|
1005
1146
|
const rawUrl = config.url?.trim();
|
|
1006
1147
|
if (!rawUrl) {
|
|
1007
|
-
throw new Error("
|
|
1148
|
+
throw new Error(dslMessage("fetchUrlMissing"));
|
|
1008
1149
|
}
|
|
1009
1150
|
const url = resolveFetchRequestUrl(config);
|
|
1010
1151
|
const method = config.method ?? "GET";
|
|
@@ -1015,7 +1156,9 @@ async function executeFetch(config, options) {
|
|
|
1015
1156
|
JSON.parse(body);
|
|
1016
1157
|
} catch (error) {
|
|
1017
1158
|
throw new Error(
|
|
1018
|
-
|
|
1159
|
+
dslMessage("fetchBodyInvalidJson", {
|
|
1160
|
+
reason: error instanceof Error ? error.message : dslMessage("invalidFormat")
|
|
1161
|
+
})
|
|
1019
1162
|
);
|
|
1020
1163
|
}
|
|
1021
1164
|
}
|
|
@@ -1056,7 +1199,7 @@ async function executeFetch(config, options) {
|
|
|
1056
1199
|
if (options?.allowHttpError) {
|
|
1057
1200
|
data = text;
|
|
1058
1201
|
} else {
|
|
1059
|
-
throw new Error("
|
|
1202
|
+
throw new Error(dslMessage("fetchResponseInvalidJson"));
|
|
1060
1203
|
}
|
|
1061
1204
|
}
|
|
1062
1205
|
}
|
|
@@ -1076,9 +1219,9 @@ async function executeFetch(config, options) {
|
|
|
1076
1219
|
} catch (error) {
|
|
1077
1220
|
if (error instanceof Error && error.name === "AbortError") {
|
|
1078
1221
|
if (options?.signal?.aborted) {
|
|
1079
|
-
throw new Error("
|
|
1222
|
+
throw new Error(dslMessage("fetchAborted"));
|
|
1080
1223
|
}
|
|
1081
|
-
throw new Error(
|
|
1224
|
+
throw new Error(dslMessage("fetchTimeout", { ms: timeoutMs }));
|
|
1082
1225
|
}
|
|
1083
1226
|
throw error;
|
|
1084
1227
|
} finally {
|
|
@@ -1087,6 +1230,376 @@ async function executeFetch(config, options) {
|
|
|
1087
1230
|
}
|
|
1088
1231
|
}
|
|
1089
1232
|
|
|
1233
|
+
// src/template-docs.ts
|
|
1234
|
+
var zh = (zhCN, enUS) => ({
|
|
1235
|
+
"zh-CN": zhCN,
|
|
1236
|
+
"en-US": enUS
|
|
1237
|
+
});
|
|
1238
|
+
var TEMPLATE_DOC_LINK_RE = /\{(?:scope|system)[^}]*\}|\b(?:scope|system)\?\.[\w$]+(?:\?\.[\w$]+)*/g;
|
|
1239
|
+
var SYSTEM_SECTIONS = /* @__PURE__ */ new Set(["time", "math", "location"]);
|
|
1240
|
+
var SCOPE_FIELDS = /* @__PURE__ */ new Set(["value", "id", "name", "type"]);
|
|
1241
|
+
function docText(text, locale) {
|
|
1242
|
+
return locale === "en-US" ? text["en-US"] : text["zh-CN"];
|
|
1243
|
+
}
|
|
1244
|
+
function resolveTemplateDocTarget(token) {
|
|
1245
|
+
const inner = (token.startsWith("{") ? token.slice(1, -1) : token).trim();
|
|
1246
|
+
const root = inner.startsWith("system") ? "system" : "scope";
|
|
1247
|
+
const member = /^(?:system|scope)\?\.([A-Za-z_$][\w$]*)/.exec(inner)?.[1];
|
|
1248
|
+
if (root === "system") {
|
|
1249
|
+
return {
|
|
1250
|
+
root,
|
|
1251
|
+
sectionId: member && SYSTEM_SECTIONS.has(member) ? member : "overview"
|
|
1252
|
+
};
|
|
1253
|
+
}
|
|
1254
|
+
if (inner.includes("[...")) return { root, sectionId: "spread" };
|
|
1255
|
+
if (member && SCOPE_FIELDS.has(member)) return { root, sectionId: "fields" };
|
|
1256
|
+
if (member) return { root, sectionId: "multi" };
|
|
1257
|
+
return { root, sectionId: "overview" };
|
|
1258
|
+
}
|
|
1259
|
+
function splitTemplateDocLinks(text) {
|
|
1260
|
+
const pieces = [];
|
|
1261
|
+
let last = 0;
|
|
1262
|
+
for (const match of text.matchAll(TEMPLATE_DOC_LINK_RE)) {
|
|
1263
|
+
const index = match.index ?? 0;
|
|
1264
|
+
if (index > last) {
|
|
1265
|
+
pieces.push({ type: "text", text: text.slice(last, index) });
|
|
1266
|
+
}
|
|
1267
|
+
const token = match[0];
|
|
1268
|
+
const target = resolveTemplateDocTarget(token);
|
|
1269
|
+
pieces.push({ type: "link", text: token, ...target });
|
|
1270
|
+
last = index + token.length;
|
|
1271
|
+
}
|
|
1272
|
+
if (last < text.length) {
|
|
1273
|
+
pieces.push({ type: "text", text: text.slice(last) });
|
|
1274
|
+
}
|
|
1275
|
+
if (pieces.length === 0) pieces.push({ type: "text", text });
|
|
1276
|
+
return pieces;
|
|
1277
|
+
}
|
|
1278
|
+
var TEMPLATE_DOC_CHROME = {
|
|
1279
|
+
searchPlaceholder: zh("\u641C\u7D22\u540D\u79F0\u3001\u7528\u6CD5\u6216\u4F8B\u5B50", "Search name, usage, or examples"),
|
|
1280
|
+
empty: zh("\u6CA1\u6709\u5339\u914D\u7684\u8BF4\u660E", "No matching docs"),
|
|
1281
|
+
examples: zh("\u4F8B\u5B50", "Examples"),
|
|
1282
|
+
members: zh("\u6210\u5458", "Members"),
|
|
1283
|
+
current: zh("\u5F53\u524D", "Opened from"),
|
|
1284
|
+
pluginNote: zh(
|
|
1285
|
+
"\u8054\u60F3\u91CC\u8FD8\u4F1A\u51FA\u73B0 weekday\u3001isoWeek\u3001quarter\u3001fromNow\u3001calendar\u3001utc\u3001isLeapYear\u3001toArray\u3001toObject \u7B49\u540D\u5B57\u3002\u5F53\u524D\u6253\u5305\u7684\u662F dayjs \u6838\u5FC3\uFF0C\u6CA1\u6709\u6302\u8FD9\u4E9B\u63D2\u4EF6\uFF0C\u5199\u8FDB\u6A21\u677F\u4E0D\u4F1A\u751F\u6548\u3002",
|
|
1286
|
+
"Autocomplete may also list weekday, isoWeek, quarter, fromNow, calendar, utc, isLeapYear, toArray, and toObject. The bundled dayjs is core-only, so those plugin methods do nothing in templates."
|
|
1287
|
+
)
|
|
1288
|
+
};
|
|
1289
|
+
var TIME_MEMBERS = [
|
|
1290
|
+
{ name: "format", summary: zh("\u6309\u683C\u5F0F\u4E32\u8F93\u51FA\u6587\u672C\u3002\u5E38\u7528 YYYY-MM-DD HH:mm:ss\u3002", "Format as text. Common pattern: YYYY-MM-DD HH:mm:ss."), usage: "{system?.time?.format('YYYY-MM-DD HH:mm:ss')}" },
|
|
1291
|
+
{ name: "add", summary: zh("\u52A0\u4E0A\u4E00\u6BB5\u65F6\u95F4\u3002\u5355\u4F4D\uFF1Ayear\u3001month\u3001week\u3001day\u3001hour\u3001minute\u3001second\u3001millisecond\u3002", "Add a duration. Units: year, month, week, day, hour, minute, second, millisecond."), usage: "{system?.time?.add(1,'hour')}" },
|
|
1292
|
+
{ name: "subtract", summary: zh("\u51CF\u53BB\u4E00\u6BB5\u65F6\u95F4\uFF0C\u5355\u4F4D\u540C add\u3002", "Subtract a duration. Same units as add."), usage: "{system?.time?.subtract(7,'d')}" },
|
|
1293
|
+
{ name: "startOf", summary: zh("\u5BF9\u9F50\u5230\u8BE5\u5355\u4F4D\u7684\u8D77\u70B9\uFF0C\u5982\u5F53\u5929 00:00\u3001\u5F53\u6708 1 \u65E5\u3002", "Snap to the start of a unit, such as today 00:00 or the 1st of the month."), usage: "{system?.time?.startOf('day')}" },
|
|
1294
|
+
{ name: "endOf", summary: zh("\u5BF9\u9F50\u5230\u8BE5\u5355\u4F4D\u7684\u7EC8\u70B9\uFF0C\u5982\u5F53\u5929 23:59:59.999\u3002", "Snap to the end of a unit, such as today 23:59:59.999."), usage: "{system?.time?.endOf('month')}" },
|
|
1295
|
+
{ name: "valueOf", summary: zh("\u6BEB\u79D2\u65F6\u95F4\u6233\u3002", "Unix timestamp in milliseconds."), usage: "{system?.time?.valueOf()}" },
|
|
1296
|
+
{ name: "unix", summary: zh("\u79D2\u7EA7\u65F6\u95F4\u6233\u3002", "Unix timestamp in seconds."), usage: "{system?.time?.unix()}" },
|
|
1297
|
+
{ name: "diff", summary: zh("\u4E0E\u53E6\u4E00\u4E2A\u65F6\u95F4\u7684\u5DEE\u503C\u3002\u7B2C\u4E09\u53C2 true \u65F6\u4FDD\u7559\u5C0F\u6570\u3002", "Difference from another time. Pass true as the third argument for a float."), usage: "{system?.time?.diff(scope?.value,'hour',true)}" },
|
|
1298
|
+
{ name: "set", summary: zh("\u628A\u67D0\u4E2A\u5355\u4F4D\u8BBE\u6210\u6307\u5B9A\u6570\u5B57\uFF0C\u8FD4\u56DE\u65B0\u65F6\u95F4\u3002", "Set one unit to a number and return a new time."), usage: "{system?.time?.set('hour', 8)}" },
|
|
1299
|
+
{ name: "get", summary: zh("\u8BFB\u53D6\u67D0\u4E2A\u5355\u4F4D\u3002month \u4ECE 0 \u5F00\u59CB\u3002", "Read one unit. month is 0-based."), usage: "{system?.time?.get('year')}" },
|
|
1300
|
+
{ name: "year", summary: zh("\u5E74\u3002\u4E0D\u4F20\u53C2\u662F\u8BFB\u53D6\uFF0C\u4F20\u6570\u5B57\u662F\u8BBE\u7F6E\u3002", "Year. No argument reads it; a number sets it."), usage: "{system?.time?.year()}" },
|
|
1301
|
+
{ name: "month", summary: zh("\u6708\uFF0C0 \u662F\u4E00\u6708\u3002", "Month. 0 is January."), usage: "{system?.time?.month()}" },
|
|
1302
|
+
{ name: "date", summary: zh("\u65E5\uFF0C1\u201331\u3002", "Day of month, 1\u201331."), usage: "{system?.time?.date()}" },
|
|
1303
|
+
{ name: "day", summary: zh("\u661F\u671F\uFF0C0 \u662F\u5468\u65E5\u3002", "Day of week. 0 is Sunday."), usage: "{system?.time?.day()}" },
|
|
1304
|
+
{ name: "hour", summary: zh("\u65F6\uFF0C0\u201323\u3002", "Hour, 0\u201323."), usage: "{system?.time?.hour()}" },
|
|
1305
|
+
{ name: "minute", summary: zh("\u5206\u3002", "Minute."), usage: "{system?.time?.minute()}" },
|
|
1306
|
+
{ name: "second", summary: zh("\u79D2\u3002", "Second."), usage: "{system?.time?.second()}" },
|
|
1307
|
+
{ name: "millisecond", summary: zh("\u6BEB\u79D2\u3002", "Millisecond."), usage: "{system?.time?.millisecond()}" },
|
|
1308
|
+
{ name: "daysInMonth", summary: zh("\u8FD9\u4E2A\u6708\u6709\u591A\u5C11\u5929\u3002", "How many days are in this month."), usage: "{system?.time?.daysInMonth()}" },
|
|
1309
|
+
{ name: "toISOString", summary: zh("ISO 8601 \u5B57\u7B26\u4E32\u3002\u4E0D\u8C03\u7528\u65B9\u6CD5\u3001\u76F4\u63A5\u5199 {system?.time} \u65F6\uFF0C\u5D4C\u8FDB\u5B57\u7B26\u4E32\u4E5F\u4F1A\u53D8\u6210 ISO \u65F6\u95F4\u3002", "ISO 8601 string. A bare {system?.time} inside a string also becomes an ISO time."), usage: "{system?.time?.toISOString()}" },
|
|
1310
|
+
{ name: "toJSON", summary: zh("\u540C toISOString\uFF0C\u4FBF\u4E8E\u653E\u8FDB JSON\u3002", "Same as toISOString, suitable inside JSON."), usage: "{system?.time?.toJSON()}" },
|
|
1311
|
+
{ name: "toDate", summary: zh("\u53D8\u6210 JS Date\u3002\u7EE7\u7EED\u5D4C\u5728\u5B57\u7B26\u4E32\u91CC\u65F6\u4F1A\u53D8\u6210\u65E5\u671F\u6587\u672C\u3002", "Native JS Date. Inside a string it becomes date text."), usage: "{system?.time?.toDate()}" },
|
|
1312
|
+
{ name: "toString", summary: zh("UTC \u65E5\u671F\u5B57\u7B26\u4E32\u3002", "UTC date string."), usage: "{system?.time?.toString()}" },
|
|
1313
|
+
{ name: "utcOffset", summary: zh("\u5F53\u524D\u65F6\u533A\u76F8\u5BF9 UTC \u7684\u5206\u949F\u504F\u79FB\u3002", "Local timezone offset from UTC, in minutes."), usage: "{system?.time?.utcOffset()}" },
|
|
1314
|
+
{ name: "isBefore", summary: zh("\u662F\u5426\u65E9\u4E8E\u53E6\u4E00\u4E2A\u65F6\u95F4\u3002", "Whether this time is before another."), usage: "{system?.time?.isBefore(scope?.value)}" },
|
|
1315
|
+
{ name: "isAfter", summary: zh("\u662F\u5426\u665A\u4E8E\u53E6\u4E00\u4E2A\u65F6\u95F4\u3002", "Whether this time is after another."), usage: "{system?.time?.isAfter(scope?.value)}" },
|
|
1316
|
+
{ name: "isSame", summary: zh("\u662F\u5426\u540C\u4E00\u65F6\u523B\u3002\u7B2C\u4E8C\u53C2\u53EF\u6307\u5B9A\u6BD4\u8F83\u5230\u54EA\u4E00\u7EA7\uFF0C\u5982 'day'\u3002", "Whether two times match. The second argument can limit the unit, such as 'day'."), usage: "{system?.time?.isSame(scope?.value,'day')}" },
|
|
1317
|
+
{ name: "isValid", summary: zh("\u5F53\u524D\u65F6\u95F4\u5BF9\u8C61\u662F\u5426\u6709\u6548\u3002", "Whether this time is valid."), usage: "{system?.time?.isValid()}" },
|
|
1318
|
+
{ name: "clone", summary: zh("\u590D\u5236\u4E00\u4EFD\uFF0C\u907F\u514D\u540E\u7EED\u4FEE\u6539\u5F71\u54CD\u539F\u503C\u3002", "Copy so later changes do not affect the original."), usage: "{system?.time?.clone()}" },
|
|
1319
|
+
{ name: "locale", summary: zh("\u8BFB\u53D6\u6216\u5207\u6362 dayjs \u8BED\u8A00\u3002\u5F53\u524D\u53EA\u5185\u7F6E\u4E86 en\u3002", "Read or switch the dayjs locale. Only en is bundled."), usage: "{system?.time?.locale()}" }
|
|
1320
|
+
];
|
|
1321
|
+
var MATH_MEMBERS = [
|
|
1322
|
+
{ name: "E", summary: zh("\u81EA\u7136\u5BF9\u6570\u7684\u5E95\uFF0C\u7EA6 2.718\u3002", "Base of the natural logarithm, about 2.718."), usage: "{system?.math?.E}" },
|
|
1323
|
+
{ name: "LN10", summary: zh("10 \u7684\u81EA\u7136\u5BF9\u6570\u3002", "Natural log of 10."), usage: "{system?.math?.LN10}" },
|
|
1324
|
+
{ name: "LN2", summary: zh("2 \u7684\u81EA\u7136\u5BF9\u6570\u3002", "Natural log of 2."), usage: "{system?.math?.LN2}" },
|
|
1325
|
+
{ name: "LOG10E", summary: zh("\u4EE5 10 \u4E3A\u5E95\uFF0Ce \u7684\u5BF9\u6570\u3002", "Base-10 log of e."), usage: "{system?.math?.LOG10E}" },
|
|
1326
|
+
{ name: "LOG2E", summary: zh("\u4EE5 2 \u4E3A\u5E95\uFF0Ce \u7684\u5BF9\u6570\u3002", "Base-2 log of e."), usage: "{system?.math?.LOG2E}" },
|
|
1327
|
+
{ name: "PI", summary: zh("\u5706\u5468\u7387\u3002", "Pi."), usage: "{system?.math?.PI}" },
|
|
1328
|
+
{ name: "SQRT1_2", summary: zh("1/2 \u7684\u5E73\u65B9\u6839\uFF0C\u7EA6 0.707\u3002", "Square root of 1/2, about 0.707."), usage: "{system?.math?.SQRT1_2}" },
|
|
1329
|
+
{ name: "SQRT2", summary: zh("2 \u7684\u5E73\u65B9\u6839\uFF0C\u7EA6 1.414\u3002", "Square root of 2, about 1.414."), usage: "{system?.math?.SQRT2}" },
|
|
1330
|
+
{ name: "abs", summary: zh("\u7EDD\u5BF9\u503C\u3002", "Absolute value."), usage: "{system?.math?.abs(scope?.value||-3)}" },
|
|
1331
|
+
{ name: "acos", summary: zh("\u53CD\u4F59\u5F26\uFF0C\u7ED3\u679C\u662F\u5F27\u5EA6\u3002", "Arc cosine, in radians."), usage: "{system?.math?.acos(0.5)}" },
|
|
1332
|
+
{ name: "acosh", summary: zh("\u53CD\u53CC\u66F2\u4F59\u5F26\u3002", "Inverse hyperbolic cosine."), usage: "{system?.math?.acosh(2)}" },
|
|
1333
|
+
{ name: "asin", summary: zh("\u53CD\u6B63\u5F26\uFF0C\u7ED3\u679C\u662F\u5F27\u5EA6\u3002", "Arc sine, in radians."), usage: "{system?.math?.asin(0.5)}" },
|
|
1334
|
+
{ name: "asinh", summary: zh("\u53CD\u53CC\u66F2\u6B63\u5F26\u3002", "Inverse hyperbolic sine."), usage: "{system?.math?.asinh(1)}" },
|
|
1335
|
+
{ name: "atan", summary: zh("\u53CD\u6B63\u5207\uFF0C\u7ED3\u679C\u662F\u5F27\u5EA6\u3002", "Arc tangent, in radians."), usage: "{system?.math?.atan(1)}" },
|
|
1336
|
+
{ name: "atan2", summary: zh("\u7531 y\u3001x \u8BA1\u7B97\u65B9\u4F4D\u89D2\uFF08\u5F27\u5EA6\uFF09\u3002", "Angle from y and x, in radians."), usage: "{system?.math?.atan2(1, 1)}" },
|
|
1337
|
+
{ name: "atanh", summary: zh("\u53CD\u53CC\u66F2\u6B63\u5207\u3002", "Inverse hyperbolic tangent."), usage: "{system?.math?.atanh(0.5)}" },
|
|
1338
|
+
{ name: "cbrt", summary: zh("\u7ACB\u65B9\u6839\u3002", "Cube root."), usage: "{system?.math?.cbrt(8)}" },
|
|
1339
|
+
{ name: "ceil", summary: zh("\u5411\u4E0A\u53D6\u6574\u3002", "Round up."), usage: "{system?.math?.ceil(1.2)}" },
|
|
1340
|
+
{ name: "clz32", summary: zh("32 \u4F4D\u6574\u6570\u7684\u524D\u5BFC\u96F6\u4E2A\u6570\u3002", "Leading zero bits of a 32-bit integer."), usage: "{system?.math?.clz32(1)}" },
|
|
1341
|
+
{ name: "cos", summary: zh("\u4F59\u5F26\uFF0C\u53C2\u6570\u662F\u5F27\u5EA6\u3002", "Cosine. Argument is radians."), usage: "{system?.math?.cos(system?.math?.PI)}" },
|
|
1342
|
+
{ name: "cosh", summary: zh("\u53CC\u66F2\u4F59\u5F26\u3002", "Hyperbolic cosine."), usage: "{system?.math?.cosh(0)}" },
|
|
1343
|
+
{ name: "exp", summary: zh("e \u7684 x \u6B21\u65B9\u3002", "e raised to x."), usage: "{system?.math?.exp(1)}" },
|
|
1344
|
+
{ name: "expm1", summary: zh("e^x - 1\uFF0Cx \u63A5\u8FD1 0 \u65F6\u66F4\u7CBE\u786E\u3002", "e^x - 1, more accurate when x is near 0."), usage: "{system?.math?.expm1(1)}" },
|
|
1345
|
+
{ name: "floor", summary: zh("\u5411\u4E0B\u53D6\u6574\u3002", "Round down."), usage: "{system?.math?.floor(system?.math?.random()*100)}" },
|
|
1346
|
+
{ name: "fround", summary: zh("\u820D\u5165\u5230\u6700\u63A5\u8FD1\u7684 32 \u4F4D\u6D6E\u70B9\u6570\u3002", "Round to the nearest 32-bit float."), usage: "{system?.math?.fround(1.337)}" },
|
|
1347
|
+
{ name: "hypot", summary: zh("\u5404\u53C2\u6570\u5E73\u65B9\u548C\u7684\u5E73\u65B9\u6839\u3002", "Square root of the sum of squares."), usage: "{system?.math?.hypot(3, 4)}" },
|
|
1348
|
+
{ name: "imul", summary: zh("32 \u4F4D\u6574\u6570\u76F8\u4E58\u3002", "32-bit integer multiplication."), usage: "{system?.math?.imul(2, 4)}" },
|
|
1349
|
+
{ name: "log", summary: zh("\u81EA\u7136\u5BF9\u6570\u3002", "Natural logarithm."), usage: "{system?.math?.log(system?.math?.E)}" },
|
|
1350
|
+
{ name: "log10", summary: zh("\u4EE5 10 \u4E3A\u5E95\u7684\u5BF9\u6570\u3002", "Base-10 logarithm."), usage: "{system?.math?.log10(100)}" },
|
|
1351
|
+
{ name: "log1p", summary: zh("ln(1 + x)\uFF0Cx \u63A5\u8FD1 0 \u65F6\u66F4\u7CBE\u786E\u3002", "ln(1 + x), more accurate when x is near 0."), usage: "{system?.math?.log1p(1)}" },
|
|
1352
|
+
{ name: "log2", summary: zh("\u4EE5 2 \u4E3A\u5E95\u7684\u5BF9\u6570\u3002", "Base-2 logarithm."), usage: "{system?.math?.log2(8)}" },
|
|
1353
|
+
{ name: "max", summary: zh("\u53D6\u66F4\u5927\u7684\u6570\uFF0C\u53EF\u4F20\u591A\u4E2A\u3002", "The larger number. Accepts several arguments."), usage: "{system?.math?.max(scope?.value||0, 0)}" },
|
|
1354
|
+
{ name: "min", summary: zh("\u53D6\u66F4\u5C0F\u7684\u6570\uFF0C\u53EF\u4F20\u591A\u4E2A\u3002", "The smaller number. Accepts several arguments."), usage: "{system?.math?.min(scope?.value||0, 100)}" },
|
|
1355
|
+
{ name: "pow", summary: zh("x \u7684 y \u6B21\u65B9\u3002", "x raised to y."), usage: "{system?.math?.pow(2, 8)}" },
|
|
1356
|
+
{ name: "random", summary: zh("\u5927\u4E8E\u7B49\u4E8E 0\u3001\u5C0F\u4E8E 1 \u7684\u968F\u673A\u6570\u3002", "A random number, 0 inclusive and 1 exclusive."), usage: "{system?.math?.random()}" },
|
|
1357
|
+
{ name: "round", summary: zh("\u56DB\u820D\u4E94\u5165\u5230\u6574\u6570\u3002", "Round to the nearest integer."), usage: "{system?.math?.round(1.5)}" },
|
|
1358
|
+
{ name: "sign", summary: zh("\u6B63\u6570 1\uFF0C\u8D1F\u6570 -1\uFF0C\u96F6 0\u3002", "1, -1, or 0 according to the sign."), usage: "{system?.math?.sign(-4)}" },
|
|
1359
|
+
{ name: "sin", summary: zh("\u6B63\u5F26\uFF0C\u53C2\u6570\u662F\u5F27\u5EA6\u3002", "Sine. Argument is radians."), usage: "{system?.math?.sin(0)}" },
|
|
1360
|
+
{ name: "sinh", summary: zh("\u53CC\u66F2\u6B63\u5F26\u3002", "Hyperbolic sine."), usage: "{system?.math?.sinh(1)}" },
|
|
1361
|
+
{ name: "sqrt", summary: zh("\u5E73\u65B9\u6839\u3002", "Square root."), usage: "{system?.math?.sqrt(9)}" },
|
|
1362
|
+
{ name: "tan", summary: zh("\u6B63\u5207\uFF0C\u53C2\u6570\u662F\u5F27\u5EA6\u3002", "Tangent. Argument is radians."), usage: "{system?.math?.tan(0)}" },
|
|
1363
|
+
{ name: "tanh", summary: zh("\u53CC\u66F2\u6B63\u5207\u3002", "Hyperbolic tangent."), usage: "{system?.math?.tanh(1)}" },
|
|
1364
|
+
{ name: "trunc", summary: zh("\u53BB\u6389\u5C0F\u6570\uFF0C\u5411 0 \u53D6\u6574\u3002", "Drop the fraction toward 0."), usage: "{system?.math?.trunc(-1.9)}" }
|
|
1365
|
+
];
|
|
1366
|
+
var LOCATION_MEMBERS = [
|
|
1367
|
+
{ name: "href", summary: zh("\u5B8C\u6574\u5730\u5740\uFF0C\u542B\u534F\u8BAE\u3001\u8DEF\u5F84\u3001\u67E5\u8BE2\u548C\u54C8\u5E0C\u3002", "Full URL, including protocol, path, query, and hash."), usage: "{system?.location?.href}" },
|
|
1368
|
+
{ name: "origin", summary: zh("\u6E90\uFF1A\u534F\u8BAE + \u4E3B\u673A + \u7AEF\u53E3\u3002", "Origin: protocol, host, and port."), usage: "{system?.location?.origin}" },
|
|
1369
|
+
{ name: "protocol", summary: zh("\u534F\u8BAE\uFF0C\u5E26\u5192\u53F7\uFF0C\u5982 https:\u3002", "Protocol with a colon, such as https:."), usage: "{system?.location?.protocol}" },
|
|
1370
|
+
{ name: "host", summary: zh("\u4E3B\u673A\uFF0C\u5305\u542B\u7AEF\u53E3\uFF08\u9ED8\u8BA4\u7AEF\u53E3\u4F1A\u7701\u7565\uFF09\u3002", "Host, including a non-default port."), usage: "{system?.location?.host}" },
|
|
1371
|
+
{ name: "hostname", summary: zh("\u4E3B\u673A\u540D\uFF0C\u4E0D\u542B\u7AEF\u53E3\u3002", "Hostname, without the port."), usage: "{system?.location?.hostname}" },
|
|
1372
|
+
{ name: "port", summary: zh("\u7AEF\u53E3\u3002\u9ED8\u8BA4\u7AEF\u53E3\u65F6\u662F\u7A7A\u5B57\u7B26\u4E32\u3002", "Port. Empty when it is the default port."), usage: "{system?.location?.port}" },
|
|
1373
|
+
{ name: "pathname", summary: zh("\u8DEF\u5F84\uFF0C\u4EE5 / \u5F00\u5934\u3002", "Path, starting with /."), usage: "{system?.location?.pathname}" },
|
|
1374
|
+
{ name: "search", summary: zh("\u67E5\u8BE2\u4E32\uFF0C\u4EE5 ? \u5F00\u5934\uFF1B\u6CA1\u6709\u67E5\u8BE2\u65F6\u662F\u7A7A\u5B57\u7B26\u4E32\u3002", "Query string, starting with ?. Empty when there is no query."), usage: "{system?.location?.search}" },
|
|
1375
|
+
{ name: "hash", summary: zh("\u54C8\u5E0C\uFF0C\u4EE5 # \u5F00\u5934\uFF1B\u6CA1\u6709\u54C8\u5E0C\u65F6\u662F\u7A7A\u5B57\u7B26\u4E32\u3002", "Hash, starting with #. Empty when there is no hash."), usage: "{system?.location?.hash}" },
|
|
1376
|
+
{ name: "ancestorOrigins", summary: zh("\u9875\u9762\u88AB\u5D4C\u5165\u65F6\uFF0C\u7956\u5148\u9875\u9762\u7684\u6E90\u5217\u8868\u3002\u666E\u901A\u6253\u5F00\u65F6\u901A\u5E38\u4E3A\u7A7A\u3002", "Origins of ancestor pages when this page is embedded. Usually empty otherwise."), usage: "{system?.location?.ancestorOrigins}" },
|
|
1377
|
+
{ name: "toString", summary: zh("\u540C href\u3002", "Same as href."), usage: "{system?.location?.toString()}" },
|
|
1378
|
+
{ name: "assign", summary: zh("\u8DF3\u8F6C\u5230\u65B0\u5730\u5740\uFF0C\u5E76\u7559\u4E0B\u5386\u53F2\u8BB0\u5F55\u3002\u4F1A\u79BB\u5F00\u5F53\u524D\u9875\uFF0C\u6A21\u677F\u91CC\u4E00\u822C\u4E0D\u8981\u8C03\u7528\u3002", "Navigate and keep history. This leaves the page, so avoid it in templates."), usage: "{system?.location?.assign('https://example.com')}" },
|
|
1379
|
+
{ name: "replace", summary: zh("\u8DF3\u8F6C\u5230\u65B0\u5730\u5740\uFF0C\u5E76\u66FF\u6362\u5F53\u524D\u5386\u53F2\u3002\u4F1A\u79BB\u5F00\u5F53\u524D\u9875\uFF0C\u6A21\u677F\u91CC\u4E00\u822C\u4E0D\u8981\u8C03\u7528\u3002", "Navigate and replace the current history entry. This leaves the page."), usage: "{system?.location?.replace('https://example.com')}" },
|
|
1380
|
+
{ name: "reload", summary: zh("\u5237\u65B0\u5F53\u524D\u9875\u3002\u6A21\u677F\u91CC\u4E00\u822C\u4E0D\u8981\u8C03\u7528\u3002", "Reload the page. Avoid calling it from a template."), usage: "{system?.location?.reload()}" }
|
|
1381
|
+
];
|
|
1382
|
+
var TEMPLATE_DOC_BOOKS = {
|
|
1383
|
+
system: {
|
|
1384
|
+
root: "system",
|
|
1385
|
+
title: zh("\u7CFB\u7EDF\u53D8\u91CF system", "System variable system"),
|
|
1386
|
+
intro: zh(
|
|
1387
|
+
"system \u662F\u6A21\u677F\u91CC\u7684\u5DE5\u5177\u7BB1\uFF0C\u6BCF\u6B21\u6C42\u503C\u90FD\u4F1A\u91CD\u65B0\u53D6\u5F53\u524D\u65F6\u95F4\u548C\u5F53\u524D\u9875\u9762\u5730\u5740\u3002\u5B83\u548C scope \u53EF\u4EE5\u5199\u5728\u540C\u4E00\u4E2A\u8868\u8FBE\u5F0F\u91CC\u3002",
|
|
1388
|
+
"system is the template toolbox. Each evaluation reads the current time and the current page URL again. It can share an expression with scope."
|
|
1389
|
+
),
|
|
1390
|
+
sections: [
|
|
1391
|
+
{
|
|
1392
|
+
id: "overview",
|
|
1393
|
+
title: zh("\u662F\u4EC0\u4E48", "What it is"),
|
|
1394
|
+
body: zh(
|
|
1395
|
+
"\u5199\u5728\u82B1\u62EC\u53F7\u91CC\u624D\u4F1A\u6C42\u503C\uFF0C\u4F8B\u5982 {system?.time}\u3002\u4E09\u4E2A\u5165\u53E3\uFF1Atime \u662F\u5F53\u524D\u65F6\u95F4\uFF08dayjs\uFF09\uFF0Cmath \u662F JavaScript \u7684 Math\uFF0Clocation \u662F\u5F53\u524D\u9875\u7684\u5730\u5740\u3002\u975E\u6D4F\u89C8\u5668\u73AF\u5883\u91CC location \u662F\u7A7A\u7684\u5360\u4F4D\uFF0C\u4E0D\u4F1A\u629B\u9519\u3002",
|
|
1396
|
+
"Values are computed only inside braces, for example {system?.time}. There are three entries: time is the current dayjs time, math is JavaScript Math, and location is the current page URL. Outside a browser, location is an empty stub and does not throw."
|
|
1397
|
+
),
|
|
1398
|
+
examples: ["{system?.time}", "{system?.math?.PI}", "{system?.location?.origin}"]
|
|
1399
|
+
},
|
|
1400
|
+
{
|
|
1401
|
+
id: "syntax",
|
|
1402
|
+
title: zh("\u600E\u4E48\u5199", "How to write it"),
|
|
1403
|
+
body: zh(
|
|
1404
|
+
"?. \u8868\u793A\u8FD9\u4E00\u622A\u6CA1\u6709\u503C\u5C31\u505C\u4E0B\u6765\uFF0C\u4E0D\u518D\u5F80\u4E0B\u53D6\u3002|| \u8868\u793A\u5DE6\u8FB9\u662F\u7A7A\u503C\u65F6\u6539\u7528\u53F3\u8FB9\uFF0C\u4F8B\u5982 scope?.value?.days||7\u3002\u62EC\u53F7\u53EF\u4EE5\u8C03\u7528\u65B9\u6CD5\u3002\u82B1\u62EC\u53F7\u91CC\u9762\u4E0D\u80FD\u518D\u5199 }\u3002\u653E\u8FDB\u666E\u901A\u5B57\u7B26\u4E32\u65F6\uFF0C\u7ED3\u679C\u4F1A\u53D8\u6210\u6587\u672C\uFF1Bdayjs \u4F1A\u53D8\u6210 ISO \u65F6\u95F4\u3002\u653E\u5728 JSON \u7684\u503C\u4F4D\u7F6E\uFF08\u5F15\u53F7\u5916\u9762\uFF09\u65F6\uFF0C\u6570\u5B57\u3001\u5BF9\u8C61\u3001\u6570\u7EC4\u4F1A\u6309 JSON \u63D2\u5165\u3002",
|
|
1405
|
+
"?. stops when a step is missing. || uses the right-hand value when the left is empty, for example scope?.value?.days||7. Parentheses call methods. A brace expression cannot contain another }. Inside a plain string the result becomes text, and a dayjs value becomes an ISO time. In a JSON value position, outside quotes, numbers, objects, and arrays are inserted as JSON."
|
|
1406
|
+
),
|
|
1407
|
+
examples: [
|
|
1408
|
+
"{system?.time?.format('YYYY-MM-DD')}",
|
|
1409
|
+
"{system?.time?.subtract(scope?.value?.days||7,'d')}",
|
|
1410
|
+
"{system?.math?.floor(system?.math?.random()*100)}",
|
|
1411
|
+
"{system?.time?.subtract(system?.math?.random(),'d')}"
|
|
1412
|
+
]
|
|
1413
|
+
},
|
|
1414
|
+
{
|
|
1415
|
+
id: "time",
|
|
1416
|
+
title: zh("time \u5F53\u524D\u65F6\u95F4", "time, the current time"),
|
|
1417
|
+
body: zh(
|
|
1418
|
+
"system?.time \u662F\u6C42\u503C\u8FD9\u4E00\u523B\u7684 dayjs \u5BF9\u8C61\u3002\u5355\u4F4D\u53EF\u4EE5\u7528\u5168\u79F0\uFF0C\u4E5F\u53EF\u4EE5\u7528\u7B80\u5199\uFF1Ayear/y\u3001month/M\u3001week/w\u3001day/d\u3001hour/h\u3001minute/m\u3001second/s\u3001millisecond/ms\u3002month \u4ECE 0 \u5F00\u59CB\u3002format \u91CC YYYY \u662F\u5E74\uFF0CMM \u662F\u6708\uFF0CDD \u662F\u65E5\uFF0CHH \u662F 24 \u5C0F\u65F6\uFF0Cmm \u662F\u5206\uFF0Css \u662F\u79D2\uFF0CSSS \u662F\u6BEB\u79D2\u3002",
|
|
1419
|
+
"system?.time is a dayjs object for the moment of evaluation. Units accept full names or short forms: year/y, month/M, week/w, day/d, hour/h, minute/m, second/s, millisecond/ms. month is 0-based. In format, YYYY is the year, MM the month, DD the day, HH the hour (24), mm the minute, ss the second, and SSS the millisecond."
|
|
1420
|
+
),
|
|
1421
|
+
examples: [
|
|
1422
|
+
"{system?.time}",
|
|
1423
|
+
"{system?.time?.format('YYYY-MM-DD HH:mm:ss')}",
|
|
1424
|
+
"{system?.time?.subtract(7,'d')?.format('YYYY-MM-DD')}",
|
|
1425
|
+
"{system?.time?.add(1,'hour')?.startOf('hour')}",
|
|
1426
|
+
"{system?.time?.startOf('day')?.valueOf()}"
|
|
1427
|
+
],
|
|
1428
|
+
members: TIME_MEMBERS
|
|
1429
|
+
},
|
|
1430
|
+
{
|
|
1431
|
+
id: "math",
|
|
1432
|
+
title: zh("math \u6570\u5B66", "math"),
|
|
1433
|
+
body: zh(
|
|
1434
|
+
"system?.math \u5C31\u662F JavaScript \u7684 Math\u3002\u5E38\u6570\u76F4\u63A5\u53D6\uFF0C\u51FD\u6570\u8981\u52A0\u62EC\u53F7\u3002\u4E09\u89D2\u51FD\u6570\u7684\u53C2\u6570\u662F\u5F27\u5EA6\uFF0C\u4E0D\u662F\u89D2\u5EA6\u3002",
|
|
1435
|
+
"system?.math is JavaScript Math. Read constants directly, and call functions with parentheses. Trig functions take radians, not degrees."
|
|
1436
|
+
),
|
|
1437
|
+
examples: [
|
|
1438
|
+
"{system?.math?.PI}",
|
|
1439
|
+
"{system?.math?.random()}",
|
|
1440
|
+
"{system?.math?.floor(1.8)}",
|
|
1441
|
+
"{system?.math?.max(scope?.value||0, 0)}",
|
|
1442
|
+
"{system?.math?.round(system?.math?.random()*10)}"
|
|
1443
|
+
],
|
|
1444
|
+
members: MATH_MEMBERS
|
|
1445
|
+
},
|
|
1446
|
+
{
|
|
1447
|
+
id: "location",
|
|
1448
|
+
title: zh("location \u5F53\u524D\u9875\u9762\u5730\u5740", "location, the page URL"),
|
|
1449
|
+
body: zh(
|
|
1450
|
+
"system?.location \u662F\u5F53\u524D\u9875\u7684 Location\u3002\u6A21\u677F\u91CC\u7528\u5B83\u6765\u62FC\u5730\u5740\u3001\u8BFB\u8DEF\u5F84\u548C\u67E5\u8BE2\u4E32\u3002assign\u3001replace\u3001reload \u4F1A\u8DF3\u8F6C\u6216\u5237\u65B0\u9875\u9762\uFF0C\u4E0D\u8981\u5199\u8FDB\u4F1A\u53CD\u590D\u6C42\u503C\u7684\u6A21\u677F\u3002",
|
|
1451
|
+
"system?.location is the current page Location. Use it to build URLs or read the path and query. assign, replace, and reload navigate or reload the page, so do not put them in a template that evaluates repeatedly."
|
|
1452
|
+
),
|
|
1453
|
+
examples: [
|
|
1454
|
+
"{system?.location?.origin}",
|
|
1455
|
+
"{system?.location?.pathname}",
|
|
1456
|
+
"{system?.location?.href}",
|
|
1457
|
+
"https://api.example.com{system?.location?.pathname}"
|
|
1458
|
+
],
|
|
1459
|
+
members: LOCATION_MEMBERS
|
|
1460
|
+
}
|
|
1461
|
+
]
|
|
1462
|
+
},
|
|
1463
|
+
scope: {
|
|
1464
|
+
root: "scope",
|
|
1465
|
+
title: zh("\u6D41\u7A0B\u6570\u636E scope", "Workflow data scope"),
|
|
1466
|
+
intro: zh(
|
|
1467
|
+
"scope \u662F\u84DD\u56FE\u91CC\u8282\u70B9\u4E4B\u95F4\u4F20\u9012\u7684\u4E1A\u52A1\u6570\u636E\u3002\u4E0A\u6E38\u8FD8\u6CA1\u8FDE\u4E0A\u6216\u8FD8\u6CA1\u8DD1\u8FC7\u65F6\uFF0C\u5BF9\u5E94\u5B57\u6BB5\u662F\u7A7A\u7684\uFF0C\u7528 ?. \u548C || \u53EF\u4EE5\u907F\u514D\u6574\u6BB5\u8868\u8FBE\u5F0F\u65AD\u6389\u3002",
|
|
1468
|
+
"scope is the business data passed between blueprint nodes. Before an upstream node is connected or has run, fields are empty. ?. and || keep the expression from breaking."
|
|
1469
|
+
),
|
|
1470
|
+
sections: [
|
|
1471
|
+
{
|
|
1472
|
+
id: "overview",
|
|
1473
|
+
title: zh("\u662F\u4EC0\u4E48", "What it is"),
|
|
1474
|
+
body: zh(
|
|
1475
|
+
"scope \u53EA\u5728\u82B1\u62EC\u53F7\u8868\u8FBE\u5F0F\u91CC\u751F\u6548\uFF0C\u4F8B\u5982 {scope?.value}\u3002\u5B83\u63CF\u8FF0\u7684\u662F\u8FD9\u6761\u8FDE\u7EBF\u4F20\u4E0B\u6765\u7684\u6570\u636E\uFF0C\u4E0D\u662F\u5168\u5C40\u53D8\u91CF\u3002\u53EF\u4EE5\u548C system \u5199\u5728\u4E00\u8D77\uFF0C\u7528\u7CFB\u7EDF\u65F6\u95F4\u3001\u6570\u5B66\u6216\u5730\u5740\u53BB\u52A0\u5DE5\u4E0A\u6E38\u6570\u636E\u3002",
|
|
1476
|
+
"scope works inside brace expressions, for example {scope?.value}. It is the data on this connection, not a global variable. Combine it with system when the upstream data needs the current time, math, or the page URL."
|
|
1477
|
+
),
|
|
1478
|
+
examples: ["{scope?.value}", "{scope?.name||''}", "{scope?.a||0}"]
|
|
1479
|
+
},
|
|
1480
|
+
{
|
|
1481
|
+
id: "fields",
|
|
1482
|
+
title: zh("\u5355\u8DEF\u4E0A\u6E38", "One upstream node"),
|
|
1483
|
+
body: zh(
|
|
1484
|
+
"\u53EA\u6709\u4E00\u6761\u4E0A\u6E38\u8FDE\u7EBF\u65F6\uFF0C\u6570\u636E\u76F4\u63A5\u6302\u5728 scope \u4E0A\u3002value \u662F\u4E0A\u6E38\u8F93\u51FA\uFF1Bid\u3001name\u3001type \u662F\u4E0A\u6E38\u8282\u70B9\u81EA\u5DF1\u7684\u4FE1\u606F\uFF0C\u8282\u70B9\u8FD8\u6CA1\u6267\u884C\u65F6\u8FD9\u4E09\u9879\u4E5F\u5DF2\u7ECF\u6709\u503C\u3002value \u5982\u679C\u662F\u5BF9\u8C61\uFF0C\u53EF\u4EE5\u7EE7\u7EED\u5F80\u4E0B\u53D6\uFF0C\u4F8B\u5982 token\u3001headers\u3002",
|
|
1485
|
+
"With a single upstream connection, data sits directly on scope. value is the upstream output. id, name, and type describe that node and are available before it runs. When value is an object, keep reading into it, for example token or headers."
|
|
1486
|
+
),
|
|
1487
|
+
examples: [
|
|
1488
|
+
"{scope?.value}",
|
|
1489
|
+
"{scope?.id}",
|
|
1490
|
+
"{scope?.name}",
|
|
1491
|
+
"{scope?.type}",
|
|
1492
|
+
"{scope?.value?.token}",
|
|
1493
|
+
"{scope?.value?.headers}",
|
|
1494
|
+
"Bearer {scope?.value?.token}"
|
|
1495
|
+
],
|
|
1496
|
+
members: [
|
|
1497
|
+
{ name: "value", summary: zh("\u4E0A\u6E38\u8282\u70B9\u7684\u8F93\u51FA\u3002\u5BF9\u8C61\u53EF\u4EE5\u7EE7\u7EED\u7528 ?. \u53D6\u5B57\u6BB5\u3002", "Output of the upstream node. Use ?. to read fields when it is an object."), usage: "{scope?.value}" },
|
|
1498
|
+
{ name: "id", summary: zh("\u4E0A\u6E38\u8282\u70B9 id\u3002", "Upstream node id."), usage: "{scope?.id}" },
|
|
1499
|
+
{ name: "name", summary: zh("\u4E0A\u6E38\u8282\u70B9\u540D\u79F0\u3002", "Upstream node name."), usage: "{scope?.name}" },
|
|
1500
|
+
{ name: "type", summary: zh("\u4E0A\u6E38\u8282\u70B9\u7C7B\u578B\u3002", "Upstream node type."), usage: "{scope?.type}" }
|
|
1501
|
+
]
|
|
1502
|
+
},
|
|
1503
|
+
{
|
|
1504
|
+
id: "multi",
|
|
1505
|
+
title: zh("\u591A\u8DEF\u4E0A\u6E38", "Several upstream nodes"),
|
|
1506
|
+
body: zh(
|
|
1507
|
+
"\u6709\u591A\u6761\u4E0A\u6E38\u8FDE\u7EBF\u65F6\uFF0C\u6309\u4E0A\u6E38\u8282\u70B9 id \u5206\u7EC4\uFF0C\u4E0D\u518D\u628A value \u76F4\u63A5\u653E\u5728 scope \u6839\u4E0A\u3002\u5148\u5199\u8282\u70B9 id\uFF0C\u518D\u53D6 value \u6216\u8282\u70B9\u4FE1\u606F\u3002",
|
|
1508
|
+
"With several upstream connections, values are grouped by upstream node id. value is no longer on the scope root. Write the node id first, then value or the node fields."
|
|
1509
|
+
),
|
|
1510
|
+
examples: [
|
|
1511
|
+
"{scope?.node_abc?.value}",
|
|
1512
|
+
"{scope?.node_abc?.name}",
|
|
1513
|
+
"{scope?.node_abc?.value?.id}"
|
|
1514
|
+
]
|
|
1515
|
+
},
|
|
1516
|
+
{
|
|
1517
|
+
id: "fallback",
|
|
1518
|
+
title: zh("\u7F3A\u7701\u548C\u5360\u4F4D", "Missing values"),
|
|
1519
|
+
body: zh(
|
|
1520
|
+
"?. \u5728\u4E2D\u95F4\u4EFB\u4F55\u4E00\u622A\u6CA1\u6709\u503C\u65F6\u505C\u6B62\uFF0C\u6574\u6BB5\u7ED3\u679C\u4E3A\u7A7A\u3002|| \u5728\u5DE6\u8FB9\u662F null\u3001undefined\u30010 \u6216\u7A7A\u5B57\u7B26\u4E32\u65F6\u91C7\u7528\u53F3\u8FB9\u3002\u6570\u5B57\u7F3A\u7701\u5E38\u7528 ||0\uFF0C\u6587\u672C\u7F3A\u7701\u5E38\u7528 ||''\u3002",
|
|
1521
|
+
"?. stops when any step is missing, and the whole result is empty. || uses the right side when the left is null, undefined, 0, or an empty string. ||0 is the usual number fallback, and ||'' is the usual text fallback."
|
|
1522
|
+
),
|
|
1523
|
+
examples: ["{scope?.a||0}", "{scope?.name||''}", "{scope?.value?.days||7}"]
|
|
1524
|
+
},
|
|
1525
|
+
{
|
|
1526
|
+
id: "nesting",
|
|
1527
|
+
title: zh("\u548C system \u4E00\u8D77\u7528", "Using it with system"),
|
|
1528
|
+
body: zh(
|
|
1529
|
+
"\u540C\u4E00\u4E2A\u82B1\u62EC\u53F7\u91CC\u53EF\u4EE5\u540C\u65F6\u51FA\u73B0 scope \u548C system\u3002scope \u63D0\u4F9B\u4E1A\u52A1\u6570\u5B57\u6216\u6587\u672C\uFF0Csystem \u63D0\u4F9B\u65F6\u95F4\u3001\u6570\u5B66\u548C\u5730\u5740\u3002",
|
|
1530
|
+
"scope and system can share one brace expression. scope supplies the business value, and system supplies time, math, and the page URL."
|
|
1531
|
+
),
|
|
1532
|
+
examples: [
|
|
1533
|
+
"{system?.time?.subtract(scope?.value?.days||7,'d')}",
|
|
1534
|
+
"{system?.math?.max(scope?.value||0, 0)}",
|
|
1535
|
+
"{system?.location?.origin}{scope?.value?.path}"
|
|
1536
|
+
]
|
|
1537
|
+
},
|
|
1538
|
+
{
|
|
1539
|
+
id: "spread",
|
|
1540
|
+
title: zh("\u6570\u7EC4\u5C55\u5F00", "Array spread"),
|
|
1541
|
+
body: zh(
|
|
1542
|
+
"[...{scope?.\u8DEF\u5F84}] \u7528\u6765\u5C55\u5F00\u6570\u7EC4\u3002\u5199\u5728\u666E\u901A\u6587\u672C\u91CC\u65F6\uFF0C\u5404\u9879\u7528\u9017\u53F7\u62FC\u6210\u4E00\u4E2A\u5B57\u7B26\u4E32\u3002\u5199\u5728\u56FE\u8868\u7C7B\u76EE\u8FD9\u7C7B\u6570\u7EC4\u5B57\u6BB5\u91CC\u65F6\uFF0C\u4F1A\u5C55\u5F00\u6210\u591A\u9879\uFF0C\u4F8B\u5982 3 \u6761\u6570\u636E\u53D8\u6210 3 \u4E2A\u7C7B\u76EE\u3002system \u4E0D\u80FD\u8FD9\u6837\u5C55\u5F00\u3002",
|
|
1543
|
+
"[...{scope?.path}] spreads an array. In plain text, items are joined with commas. In an array field such as chart categories, they become separate items, so 3 rows become 3 categories. system cannot be spread this way."
|
|
1544
|
+
),
|
|
1545
|
+
examples: ["[...{scope?.a?.b}]", "[...{scope?.data?.data?.statusName}]", "[...{scope?.labels}]"]
|
|
1546
|
+
},
|
|
1547
|
+
{
|
|
1548
|
+
id: "json",
|
|
1549
|
+
title: zh("\u5199\u8FDB JSON", "Inside JSON"),
|
|
1550
|
+
body: zh(
|
|
1551
|
+
'\u8BF7\u6C42\u5934\u3001\u8BF7\u6C42\u4F53\u3001JSON \u8282\u70B9\u90FD\u6309\u8FD9\u6BB5\u89C4\u5219\u5904\u7406\u3002\u6A21\u677F\u5728\u5F15\u53F7\u91CC\u9762\u65F6\uFF0C\u53EA\u66FF\u6362\u6210\u6587\u672C\u3002\u6A21\u677F\u5728\u503C\u7684\u4F4D\u7F6E\u3001\u5F15\u53F7\u5916\u9762\u65F6\uFF0C\u5BF9\u8C61\u548C\u6570\u7EC4\u4F1A\u53D8\u6210 JSON\u3002\u6574\u6BB5\u5B57\u6BB5\u4E5F\u53EF\u4EE5\u76F4\u63A5\u5199\u6210\u4E00\u4E2A scope \u8868\u8FBE\u5F0F\uFF0C\u7528\u4E0A\u6E38\u5BF9\u8C61\u5145\u5F53\u8BF7\u6C42\u5934\u6216\u8BF7\u6C42\u4F53\u3002\u82B1\u62EC\u53F7\u91CC\u7684\u5F15\u53F7\u8BF7\u7528\u82F1\u6587 "\u3002',
|
|
1552
|
+
'Headers, bodies, and JSON nodes follow this rule. A template inside quotes is replaced as text. A template in a value position, outside quotes, inserts objects and arrays as JSON. A whole field can also be one scope expression, so an upstream object becomes the headers or body. Use straight " quotes inside braces.'
|
|
1553
|
+
),
|
|
1554
|
+
examples: [
|
|
1555
|
+
'{"Authorization":"Bearer {scope?.value?.token}"}',
|
|
1556
|
+
'{"id":"{scope?.value?.id}"}',
|
|
1557
|
+
"{scope?.value?.headers}",
|
|
1558
|
+
'{"at":"{system?.time?.toISOString()}"}'
|
|
1559
|
+
]
|
|
1560
|
+
}
|
|
1561
|
+
]
|
|
1562
|
+
}
|
|
1563
|
+
};
|
|
1564
|
+
function sectionSearchText(section) {
|
|
1565
|
+
return [
|
|
1566
|
+
section.title["zh-CN"],
|
|
1567
|
+
section.title["en-US"],
|
|
1568
|
+
section.body["zh-CN"],
|
|
1569
|
+
section.body["en-US"],
|
|
1570
|
+
...section.examples ?? [],
|
|
1571
|
+
...(section.members ?? []).flatMap((member) => [
|
|
1572
|
+
member.name,
|
|
1573
|
+
member.summary["zh-CN"],
|
|
1574
|
+
member.summary["en-US"],
|
|
1575
|
+
member.usage ?? ""
|
|
1576
|
+
])
|
|
1577
|
+
].join("\n").toLowerCase();
|
|
1578
|
+
}
|
|
1579
|
+
var request = null;
|
|
1580
|
+
var nonce = 0;
|
|
1581
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
1582
|
+
function emitTemplateDoc() {
|
|
1583
|
+
listeners.forEach((listener) => listener());
|
|
1584
|
+
}
|
|
1585
|
+
function getTemplateDocRequest() {
|
|
1586
|
+
return request;
|
|
1587
|
+
}
|
|
1588
|
+
function subscribeTemplateDoc(listener) {
|
|
1589
|
+
listeners.add(listener);
|
|
1590
|
+
return () => listeners.delete(listener);
|
|
1591
|
+
}
|
|
1592
|
+
function openTemplateDoc(input) {
|
|
1593
|
+
nonce += 1;
|
|
1594
|
+
request = { ...input, nonce };
|
|
1595
|
+
emitTemplateDoc();
|
|
1596
|
+
}
|
|
1597
|
+
function closeTemplateDoc() {
|
|
1598
|
+
if (!request) return;
|
|
1599
|
+
request = null;
|
|
1600
|
+
emitTemplateDoc();
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1090
1603
|
// src/scope-autocomplete.ts
|
|
1091
1604
|
function getValueAtPath(root, path) {
|
|
1092
1605
|
let current = root;
|
|
@@ -1424,7 +1937,7 @@ function parseJsonText(text) {
|
|
|
1424
1937
|
} catch (error) {
|
|
1425
1938
|
return {
|
|
1426
1939
|
ok: false,
|
|
1427
|
-
error: error instanceof Error ? error.message : "
|
|
1940
|
+
error: error instanceof Error ? error.message : dslMessage("jsonInvalid")
|
|
1428
1941
|
};
|
|
1429
1942
|
}
|
|
1430
1943
|
}
|
|
@@ -1432,7 +1945,7 @@ function validateFetchJsonText(text, options) {
|
|
|
1432
1945
|
const trimmed = text.trim();
|
|
1433
1946
|
if (!trimmed) {
|
|
1434
1947
|
if (options?.allowEmpty === false) {
|
|
1435
|
-
return { ok: false, error: "
|
|
1948
|
+
return { ok: false, error: dslMessage("contentRequired") };
|
|
1436
1949
|
}
|
|
1437
1950
|
return { ok: true };
|
|
1438
1951
|
}
|
|
@@ -1477,13 +1990,13 @@ function getFetchHeadersValidationError(config, scope) {
|
|
|
1477
1990
|
if (isWholeScopeExpression(raw) || hasScopeTemplate(raw)) {
|
|
1478
1991
|
if (scope === void 0) return null;
|
|
1479
1992
|
const parsed2 = parseFetchHeadersJson(raw, scope);
|
|
1480
|
-
if (!parsed2) return "
|
|
1993
|
+
if (!parsed2) return dslMessage("headersTemplateNotObject");
|
|
1481
1994
|
return null;
|
|
1482
1995
|
}
|
|
1483
1996
|
const result = validateFetchJsonText(raw);
|
|
1484
1997
|
if (!result.ok) return result.error;
|
|
1485
1998
|
const parsed = parseFetchHeadersJson(raw, scope);
|
|
1486
|
-
if (!parsed) return "
|
|
1999
|
+
if (!parsed) return dslMessage("headersNotObject");
|
|
1487
2000
|
return null;
|
|
1488
2001
|
}
|
|
1489
2002
|
function isWholeScopeExpression(text) {
|
|
@@ -1808,7 +2321,7 @@ function lintJsonString(jsonString) {
|
|
|
1808
2321
|
const raw = jsonString ?? "";
|
|
1809
2322
|
const trimmed = raw.trim();
|
|
1810
2323
|
if (!trimmed) {
|
|
1811
|
-
return { ok: false, error: "
|
|
2324
|
+
return { ok: false, error: dslMessage("jsonEmpty"), ranges: [] };
|
|
1812
2325
|
}
|
|
1813
2326
|
const suspectRanges = findSuspectCharRanges(raw);
|
|
1814
2327
|
const trimStart = raw.indexOf(trimmed);
|
|
@@ -1818,13 +2331,13 @@ function lintJsonString(jsonString) {
|
|
|
1818
2331
|
if (value === null || typeof value !== "object") {
|
|
1819
2332
|
return {
|
|
1820
2333
|
ok: false,
|
|
1821
|
-
error: "
|
|
2334
|
+
error: dslMessage("jsonRootMustBeContainer"),
|
|
1822
2335
|
ranges: mergeRanges(suspectRanges)
|
|
1823
2336
|
};
|
|
1824
2337
|
}
|
|
1825
2338
|
return { ok: true, value };
|
|
1826
2339
|
} catch (error) {
|
|
1827
|
-
const message = error instanceof Error ? error.message : "
|
|
2340
|
+
const message = error instanceof Error ? error.message : dslMessage("jsonInvalid");
|
|
1828
2341
|
const ranges = [...suspectRanges];
|
|
1829
2342
|
const fromEngine = extractJsonErrorPosition(message, trimmed);
|
|
1830
2343
|
const fromScan = findJsonSyntaxErrorOffset(trimmed);
|
|
@@ -2025,7 +2538,7 @@ function requireStorage(accessors, kind) {
|
|
|
2025
2538
|
const target = kind === "session" ? accessors?.session : accessors?.local;
|
|
2026
2539
|
if (!target) {
|
|
2027
2540
|
throw new Error(
|
|
2028
|
-
kind === "session" ? "
|
|
2541
|
+
kind === "session" ? dslMessage("storageUnsupported", { storage: "sessionStorage" }) : dslMessage("storageUnsupported", { storage: "localStorage" })
|
|
2029
2542
|
);
|
|
2030
2543
|
}
|
|
2031
2544
|
return target;
|
|
@@ -2038,7 +2551,7 @@ function executeStorageConfig(config, incomingScope, accessors) {
|
|
|
2038
2551
|
const serialized = serializeStorageValue(value);
|
|
2039
2552
|
const key = resolveStorageKey(normalized.set.key, incomingScope);
|
|
2040
2553
|
if (!key) {
|
|
2041
|
-
throw new Error("
|
|
2554
|
+
throw new Error(dslMessage("storageKeyEmpty"));
|
|
2042
2555
|
}
|
|
2043
2556
|
for (const kind of normalized.set.storages) {
|
|
2044
2557
|
requireStorage(store, kind).setItem(key, serialized);
|
|
@@ -2078,7 +2591,7 @@ function compileLogicRunner(sourceCode) {
|
|
|
2078
2591
|
`"use strict";
|
|
2079
2592
|
${sourceCode}
|
|
2080
2593
|
if (typeof update !== "function") {
|
|
2081
|
-
throw new TypeError(
|
|
2594
|
+
throw new TypeError(dslMessage("logicUpdateRequired"));
|
|
2082
2595
|
}
|
|
2083
2596
|
return update(input);`
|
|
2084
2597
|
);
|
|
@@ -2086,7 +2599,7 @@ return update(input);`
|
|
|
2086
2599
|
function validateLogicSourceCode(sourceCode) {
|
|
2087
2600
|
const raw = sourceCode?.trim();
|
|
2088
2601
|
if (!raw) {
|
|
2089
|
-
return { ok: false, error: "
|
|
2602
|
+
return { ok: false, error: dslMessage("codeRequired") };
|
|
2090
2603
|
}
|
|
2091
2604
|
try {
|
|
2092
2605
|
compileLogicRunner(raw);
|
|
@@ -2094,7 +2607,7 @@ function validateLogicSourceCode(sourceCode) {
|
|
|
2094
2607
|
} catch (error) {
|
|
2095
2608
|
return {
|
|
2096
2609
|
ok: false,
|
|
2097
|
-
error: error instanceof Error ? error.message : "
|
|
2610
|
+
error: error instanceof Error ? error.message : dslMessage("javascriptSyntaxError")
|
|
2098
2611
|
};
|
|
2099
2612
|
}
|
|
2100
2613
|
}
|
|
@@ -2130,11 +2643,11 @@ function normalizeClockConfig(config) {
|
|
|
2130
2643
|
function validateClockScheduleConfig(config) {
|
|
2131
2644
|
const normalized = normalizeClockConfig(config);
|
|
2132
2645
|
if (normalized.outputCount <= 0) {
|
|
2133
|
-
return { ok: false, error: "
|
|
2646
|
+
return { ok: false, error: dslMessage("clockCountPositive") };
|
|
2134
2647
|
}
|
|
2135
2648
|
const needsInterval = normalized.outputCount > 1 || normalized.outputCount === 1 && !normalized.emitImmediately;
|
|
2136
2649
|
if (needsInterval && normalized.intervalSeconds <= 0) {
|
|
2137
|
-
return { ok: false, error: "
|
|
2650
|
+
return { ok: false, error: dslMessage("clockIntervalPositive") };
|
|
2138
2651
|
}
|
|
2139
2652
|
return { ok: true };
|
|
2140
2653
|
}
|
|
@@ -2423,24 +2936,24 @@ function parseSwaggerV2(spec, docsUrl) {
|
|
|
2423
2936
|
}
|
|
2424
2937
|
function parseSwaggerDocument(spec, docsUrl) {
|
|
2425
2938
|
if (!spec || typeof spec !== "object") {
|
|
2426
|
-
throw new Error("
|
|
2939
|
+
throw new Error(dslMessage("swaggerInvalid"));
|
|
2427
2940
|
}
|
|
2428
2941
|
const document2 = spec;
|
|
2429
2942
|
if (typeof document2.openapi === "string") {
|
|
2430
2943
|
const parsed = parseOpenApiV3(document2, docsUrl);
|
|
2431
2944
|
if (parsed.endpoints.length === 0) {
|
|
2432
|
-
throw new Error("
|
|
2945
|
+
throw new Error(dslMessage("openApiNoOperations"));
|
|
2433
2946
|
}
|
|
2434
2947
|
return parsed;
|
|
2435
2948
|
}
|
|
2436
2949
|
if (document2.swagger === "2.0" || document2.swagger === 2) {
|
|
2437
2950
|
const parsed = parseSwaggerV2(document2, docsUrl);
|
|
2438
2951
|
if (parsed.endpoints.length === 0) {
|
|
2439
|
-
throw new Error("
|
|
2952
|
+
throw new Error(dslMessage("swagger2NoOperations"));
|
|
2440
2953
|
}
|
|
2441
2954
|
return parsed;
|
|
2442
2955
|
}
|
|
2443
|
-
throw new Error("
|
|
2956
|
+
throw new Error(dslMessage("swaggerUnsupported"));
|
|
2444
2957
|
}
|
|
2445
2958
|
function buildEndpointFullUrl(apiBaseUrl, pathOrEndpoint) {
|
|
2446
2959
|
const path = typeof pathOrEndpoint === "string" ? pathOrEndpoint : pathOrEndpoint.path;
|
|
@@ -2480,28 +2993,28 @@ function isPlainStringRecord(value) {
|
|
|
2480
2993
|
}
|
|
2481
2994
|
function normalizeEndpoint(raw, index) {
|
|
2482
2995
|
if (!raw || typeof raw !== "object" || Array.isArray(raw)) {
|
|
2483
|
-
return
|
|
2996
|
+
return dslMessage("apiItemMustBeObject", { index });
|
|
2484
2997
|
}
|
|
2485
2998
|
const item = raw;
|
|
2486
2999
|
const name = typeof item.name === "string" ? item.name.trim() : "";
|
|
2487
|
-
if (!name) return
|
|
3000
|
+
if (!name) return dslMessage("apiItemFieldRequired", { index, field: "name" });
|
|
2488
3001
|
const url = typeof item.url === "string" ? item.url.trim() : "";
|
|
2489
|
-
if (!url) return
|
|
3002
|
+
if (!url) return dslMessage("apiItemFieldRequired", { index, field: "url" });
|
|
2490
3003
|
const methodRaw = typeof item.method === "string" ? item.method.trim().toUpperCase() : "";
|
|
2491
3004
|
if (!HTTP_METHOD_SET.has(methodRaw)) {
|
|
2492
|
-
return
|
|
3005
|
+
return dslMessage("apiItemMethodInvalid", { index, methods: FETCH_HTTP_METHODS.join(" / ") });
|
|
2493
3006
|
}
|
|
2494
3007
|
if (item.params !== void 0 && !isPlainStringRecord(item.params)) {
|
|
2495
|
-
return
|
|
3008
|
+
return dslMessage("apiItemFieldStringMap", { index, field: "params" });
|
|
2496
3009
|
}
|
|
2497
3010
|
if (item.headers !== void 0 && !isPlainStringRecord(item.headers)) {
|
|
2498
|
-
return
|
|
3011
|
+
return dslMessage("apiItemFieldStringMap", { index, field: "headers" });
|
|
2499
3012
|
}
|
|
2500
3013
|
if (item.body !== void 0 && typeof item.body !== "string") {
|
|
2501
|
-
return
|
|
3014
|
+
return dslMessage("apiItemFieldString", { index, field: "body" });
|
|
2502
3015
|
}
|
|
2503
3016
|
if (item.description !== void 0 && typeof item.description !== "string") {
|
|
2504
|
-
return
|
|
3017
|
+
return dslMessage("apiItemFieldString", { index, field: "description" });
|
|
2505
3018
|
}
|
|
2506
3019
|
return {
|
|
2507
3020
|
name,
|
|
@@ -2515,26 +3028,26 @@ function normalizeEndpoint(raw, index) {
|
|
|
2515
3028
|
}
|
|
2516
3029
|
function validateApiCollectionDocument(input) {
|
|
2517
3030
|
if (!input || typeof input !== "object" || Array.isArray(input)) {
|
|
2518
|
-
return { ok: false, error: "
|
|
3031
|
+
return { ok: false, error: dslMessage("apiRootMustBeObject") };
|
|
2519
3032
|
}
|
|
2520
3033
|
const root = input;
|
|
2521
3034
|
const version = root.version;
|
|
2522
3035
|
if (version !== API_COLLECTION_DOCUMENT_VERSION && version !== "1") {
|
|
2523
3036
|
return {
|
|
2524
3037
|
ok: false,
|
|
2525
|
-
error:
|
|
3038
|
+
error: dslMessage("apiVersionMismatch", { version: API_COLLECTION_DOCUMENT_VERSION })
|
|
2526
3039
|
};
|
|
2527
3040
|
}
|
|
2528
3041
|
const name = typeof root.name === "string" ? root.name.trim() : "";
|
|
2529
|
-
if (!name) return { ok: false, error: "
|
|
3042
|
+
if (!name) return { ok: false, error: dslMessage("apiNameRequired") };
|
|
2530
3043
|
if (root.baseUrl !== void 0 && typeof root.baseUrl !== "string") {
|
|
2531
|
-
return { ok: false, error: "
|
|
3044
|
+
return { ok: false, error: dslMessage("apiBaseUrlString") };
|
|
2532
3045
|
}
|
|
2533
3046
|
if (!Array.isArray(root.apis)) {
|
|
2534
|
-
return { ok: false, error: "
|
|
3047
|
+
return { ok: false, error: dslMessage("apiListMustBeArray") };
|
|
2535
3048
|
}
|
|
2536
3049
|
if (root.apis.length === 0) {
|
|
2537
|
-
return { ok: false, error: "
|
|
3050
|
+
return { ok: false, error: dslMessage("apiListEmpty") };
|
|
2538
3051
|
}
|
|
2539
3052
|
const apis = [];
|
|
2540
3053
|
const nameSet = /* @__PURE__ */ new Set();
|
|
@@ -2544,7 +3057,7 @@ function validateApiCollectionDocument(input) {
|
|
|
2544
3057
|
return { ok: false, error: normalized };
|
|
2545
3058
|
}
|
|
2546
3059
|
if (nameSet.has(normalized.name)) {
|
|
2547
|
-
return { ok: false, error:
|
|
3060
|
+
return { ok: false, error: dslMessage("apiNameDuplicated", { name: normalized.name }) };
|
|
2548
3061
|
}
|
|
2549
3062
|
nameSet.add(normalized.name);
|
|
2550
3063
|
apis.push(normalized);
|
|
@@ -2561,14 +3074,16 @@ function validateApiCollectionDocument(input) {
|
|
|
2561
3074
|
}
|
|
2562
3075
|
function parseApiCollectionJson(text) {
|
|
2563
3076
|
const trimmed = text.trim();
|
|
2564
|
-
if (!trimmed) return { ok: false, error: "
|
|
3077
|
+
if (!trimmed) return { ok: false, error: dslMessage("contentEmpty") };
|
|
2565
3078
|
let parsed;
|
|
2566
3079
|
try {
|
|
2567
3080
|
parsed = JSON.parse(trimmed);
|
|
2568
3081
|
} catch (error) {
|
|
2569
3082
|
return {
|
|
2570
3083
|
ok: false,
|
|
2571
|
-
error:
|
|
3084
|
+
error: dslMessage("invalidJson", {
|
|
3085
|
+
reason: error instanceof Error ? error.message : dslMessage("invalidFormat")
|
|
3086
|
+
})
|
|
2572
3087
|
};
|
|
2573
3088
|
}
|
|
2574
3089
|
const validated = validateApiCollectionDocument(parsed);
|
|
@@ -2594,11 +3109,11 @@ function apiCollectionToListItem(record) {
|
|
|
2594
3109
|
function getApiCollectionTemplateDocument() {
|
|
2595
3110
|
return {
|
|
2596
3111
|
version: API_COLLECTION_DOCUMENT_VERSION,
|
|
2597
|
-
name: "
|
|
3112
|
+
name: dslMessage("apiTemplateName"),
|
|
2598
3113
|
baseUrl: "https://api.example.com",
|
|
2599
3114
|
apis: [
|
|
2600
3115
|
{
|
|
2601
|
-
name: "
|
|
3116
|
+
name: dslMessage("apiTemplateListUsers"),
|
|
2602
3117
|
method: "GET",
|
|
2603
3118
|
url: "/users",
|
|
2604
3119
|
params: {
|
|
@@ -2610,22 +3125,22 @@ function getApiCollectionTemplateDocument() {
|
|
|
2610
3125
|
Accept: "application/json",
|
|
2611
3126
|
Authorization: "Bearer {scope?.value?.token}"
|
|
2612
3127
|
},
|
|
2613
|
-
description: "
|
|
3128
|
+
description: dslMessage("apiTemplateListUsersDesc")
|
|
2614
3129
|
},
|
|
2615
3130
|
{
|
|
2616
|
-
name: "
|
|
3131
|
+
name: dslMessage("apiTemplateCreateUser"),
|
|
2617
3132
|
method: "POST",
|
|
2618
3133
|
url: "/tenants/{scope?.value?.tenant}/users",
|
|
2619
3134
|
headers: { "Content-Type": "application/json" },
|
|
2620
3135
|
body: '{\n "name": "{scope?.value?.name}",\n "role": "member"\n}',
|
|
2621
|
-
description: "
|
|
3136
|
+
description: dslMessage("apiTemplateCreateUserDesc")
|
|
2622
3137
|
},
|
|
2623
3138
|
{
|
|
2624
|
-
name: "
|
|
3139
|
+
name: dslMessage("apiTemplateGetUser"),
|
|
2625
3140
|
method: "GET",
|
|
2626
3141
|
url: "/users/{scope?.value?.id}",
|
|
2627
3142
|
headers: { Accept: "application/json" },
|
|
2628
|
-
description: "
|
|
3143
|
+
description: dslMessage("apiTemplateGetUserDesc")
|
|
2629
3144
|
}
|
|
2630
3145
|
]
|
|
2631
3146
|
};
|
|
@@ -2930,7 +3445,7 @@ function collectBlueprintLibraryRefs(graph) {
|
|
|
2930
3445
|
}
|
|
2931
3446
|
function formatBlueprintCycleMessage(cycleIds, resolveName) {
|
|
2932
3447
|
const labels = cycleIds.map((id) => resolveName?.(id) ?? id);
|
|
2933
|
-
return
|
|
3448
|
+
return dslMessage("blueprintCycle", { path: labels.join(" \u2192 ") });
|
|
2934
3449
|
}
|
|
2935
3450
|
async function detectBlueprintReferenceCycle(options) {
|
|
2936
3451
|
const {
|
|
@@ -3001,9 +3516,9 @@ function detectRuntimeBlueprintCycle(callStack, targetLibraryBlueprintId, resolv
|
|
|
3001
3516
|
|
|
3002
3517
|
// src/runtime/clock-active-registry.ts
|
|
3003
3518
|
var activeClockNodeIds = /* @__PURE__ */ new Set();
|
|
3004
|
-
var
|
|
3519
|
+
var listeners2 = /* @__PURE__ */ new Set();
|
|
3005
3520
|
function emit() {
|
|
3006
|
-
|
|
3521
|
+
listeners2.forEach((listener) => listener());
|
|
3007
3522
|
}
|
|
3008
3523
|
function markClockNodeActive(nodeId) {
|
|
3009
3524
|
if (activeClockNodeIds.has(nodeId)) return;
|
|
@@ -3021,8 +3536,8 @@ function getActiveClockNodeIds() {
|
|
|
3021
3536
|
return [...activeClockNodeIds];
|
|
3022
3537
|
}
|
|
3023
3538
|
function subscribeActiveClockNodes(listener) {
|
|
3024
|
-
|
|
3025
|
-
return () =>
|
|
3539
|
+
listeners2.add(listener);
|
|
3540
|
+
return () => listeners2.delete(listener);
|
|
3026
3541
|
}
|
|
3027
3542
|
|
|
3028
3543
|
// src/runtime/clock-scheduler.ts
|
|
@@ -3390,7 +3905,7 @@ var BlueprintGraphRunner = class _BlueprintGraphRunner {
|
|
|
3390
3905
|
stopAllClockSchedules();
|
|
3391
3906
|
const node = this.requireNode(lifecycleNodeId);
|
|
3392
3907
|
if (node.nodeType !== LIFECYCLE_NODE_TYPE) {
|
|
3393
|
-
throw new Error("
|
|
3908
|
+
throw new Error(dslMessage("debugMustStartFromLifecycle"));
|
|
3394
3909
|
}
|
|
3395
3910
|
this.outputs.clear();
|
|
3396
3911
|
this.traceEntries = [];
|
|
@@ -3591,7 +4106,7 @@ var BlueprintGraphRunner = class _BlueprintGraphRunner {
|
|
|
3591
4106
|
const runExecutor = executor ?? this.debugExecutor ?? this.createExecutor(this.debugQueue ?? []);
|
|
3592
4107
|
if (!this.syncTokenFromGraph(token)) {
|
|
3593
4108
|
return this.appendDebugTraceEntry(token, nodeLabelById, startedAt, {
|
|
3594
|
-
error: "
|
|
4109
|
+
error: dslMessage("nodeRemoved")
|
|
3595
4110
|
});
|
|
3596
4111
|
}
|
|
3597
4112
|
try {
|
|
@@ -3652,7 +4167,7 @@ var BlueprintGraphRunner = class _BlueprintGraphRunner {
|
|
|
3652
4167
|
}
|
|
3653
4168
|
if (!isTrueSignal(input)) {
|
|
3654
4169
|
return finishWithOutput(
|
|
3655
|
-
createFalseSignal("
|
|
4170
|
+
createFalseSignal(dslMessage("clockNeedsTrue"))
|
|
3656
4171
|
);
|
|
3657
4172
|
}
|
|
3658
4173
|
const validation = validateClockScheduleConfig(normalized);
|
|
@@ -3727,19 +4242,19 @@ var BlueprintGraphRunner = class _BlueprintGraphRunner {
|
|
|
3727
4242
|
if (!isTrueSignal(input)) {
|
|
3728
4243
|
io.setOutput(
|
|
3729
4244
|
"out",
|
|
3730
|
-
createFalseSignal("
|
|
4245
|
+
createFalseSignal(dslMessage("blueprintNeedsTrue"))
|
|
3731
4246
|
);
|
|
3732
4247
|
io.emitFlow("out");
|
|
3733
4248
|
return;
|
|
3734
4249
|
}
|
|
3735
4250
|
const libraryId = node.libraryBlueprintId;
|
|
3736
4251
|
if (!libraryId) {
|
|
3737
|
-
io.setOutput("out", createFalseSignal("
|
|
4252
|
+
io.setOutput("out", createFalseSignal(dslMessage("blueprintNotSelected")));
|
|
3738
4253
|
io.emitFlow("out");
|
|
3739
4254
|
return;
|
|
3740
4255
|
}
|
|
3741
4256
|
if (!runner.resolveLibraryBlueprint) {
|
|
3742
|
-
io.setOutput("out", createFalseSignal("
|
|
4257
|
+
io.setOutput("out", createFalseSignal(dslMessage("blueprintResolverMissing")));
|
|
3743
4258
|
io.emitFlow("out");
|
|
3744
4259
|
return;
|
|
3745
4260
|
}
|
|
@@ -3762,7 +4277,7 @@ var BlueprintGraphRunner = class _BlueprintGraphRunner {
|
|
|
3762
4277
|
if (!nestedGraph) {
|
|
3763
4278
|
io.setOutput(
|
|
3764
4279
|
"out",
|
|
3765
|
-
createFalseSignal(
|
|
4280
|
+
createFalseSignal(dslMessage("blueprintRecordMissing", { id: libraryId }))
|
|
3766
4281
|
);
|
|
3767
4282
|
io.emitFlow("out");
|
|
3768
4283
|
return;
|
|
@@ -3814,7 +4329,7 @@ var BlueprintGraphRunner = class _BlueprintGraphRunner {
|
|
|
3814
4329
|
io.setOutput(
|
|
3815
4330
|
"out",
|
|
3816
4331
|
createFalseSignal(
|
|
3817
|
-
input === void 0 ? "
|
|
4332
|
+
input === void 0 ? dslMessage("fetchNoUpstream") : dslMessage("fetchNeedsTrue")
|
|
3818
4333
|
)
|
|
3819
4334
|
);
|
|
3820
4335
|
io.emitFlow("out");
|
|
@@ -3835,7 +4350,7 @@ var BlueprintGraphRunner = class _BlueprintGraphRunner {
|
|
|
3835
4350
|
}
|
|
3836
4351
|
const bodyError = getFetchBodyValidationError(config.body, config.body);
|
|
3837
4352
|
if (bodyError) {
|
|
3838
|
-
throw new Error(
|
|
4353
|
+
throw new Error(dslMessage("fetchBodyInvalidJson", { reason: bodyError }));
|
|
3839
4354
|
}
|
|
3840
4355
|
resolveFetchRequestUrl(config);
|
|
3841
4356
|
const result = await executeFetch(config, {
|
|
@@ -3891,7 +4406,7 @@ var BlueprintGraphRunner = class _BlueprintGraphRunner {
|
|
|
3891
4406
|
if (!isTrueSignal(input)) {
|
|
3892
4407
|
io.setOutput(
|
|
3893
4408
|
"out",
|
|
3894
|
-
createFalseSignal("
|
|
4409
|
+
createFalseSignal(dslMessage("jsonNeedsTrue"))
|
|
3895
4410
|
);
|
|
3896
4411
|
io.emitFlow("out");
|
|
3897
4412
|
return;
|
|
@@ -3933,7 +4448,7 @@ var BlueprintGraphRunner = class _BlueprintGraphRunner {
|
|
|
3933
4448
|
if (!isTrueSignal(input)) {
|
|
3934
4449
|
io.setOutput(
|
|
3935
4450
|
"out",
|
|
3936
|
-
createFalseSignal("
|
|
4451
|
+
createFalseSignal(dslMessage("storageNeedsTrue"))
|
|
3937
4452
|
);
|
|
3938
4453
|
io.emitFlow("out");
|
|
3939
4454
|
return;
|
|
@@ -3978,7 +4493,7 @@ var BlueprintGraphRunner = class _BlueprintGraphRunner {
|
|
|
3978
4493
|
if (!isTrueSignal(input)) {
|
|
3979
4494
|
io.setOutput(
|
|
3980
4495
|
"out",
|
|
3981
|
-
createFalseSignal("
|
|
4496
|
+
createFalseSignal(dslMessage("clockNeedsTrue"))
|
|
3982
4497
|
);
|
|
3983
4498
|
io.emitFlow("out");
|
|
3984
4499
|
return;
|
|
@@ -4016,7 +4531,7 @@ var BlueprintGraphRunner = class _BlueprintGraphRunner {
|
|
|
4016
4531
|
} else {
|
|
4017
4532
|
io.setOutput(
|
|
4018
4533
|
"out",
|
|
4019
|
-
createFalseSignal("
|
|
4534
|
+
createFalseSignal(dslMessage("andNeedsBothTrue"))
|
|
4020
4535
|
);
|
|
4021
4536
|
}
|
|
4022
4537
|
io.emitFlow("out");
|
|
@@ -4251,6 +4766,8 @@ exports.STORAGE_NODE_TYPE = STORAGE_NODE_TYPE;
|
|
|
4251
4766
|
exports.SYSTEM_LOCATION_KEYS = SYSTEM_LOCATION_KEYS;
|
|
4252
4767
|
exports.SYSTEM_MATH_KEYS = SYSTEM_MATH_KEYS;
|
|
4253
4768
|
exports.SYSTEM_TIME_METHOD_NAMES = SYSTEM_TIME_METHOD_NAMES;
|
|
4769
|
+
exports.TEMPLATE_DOC_BOOKS = TEMPLATE_DOC_BOOKS;
|
|
4770
|
+
exports.TEMPLATE_DOC_CHROME = TEMPLATE_DOC_CHROME;
|
|
4254
4771
|
exports.TEMPLATE_ROOT_NAMES = TEMPLATE_ROOT_NAMES;
|
|
4255
4772
|
exports.UI_EVENT_PAYLOAD_KEY = UI_EVENT_PAYLOAD_KEY;
|
|
4256
4773
|
exports.VIEW_EVENT_SIGNAL_KEY = VIEW_EVENT_SIGNAL_KEY;
|
|
@@ -4276,6 +4793,7 @@ exports.buildIncomingNodeScope = buildIncomingNodeScope;
|
|
|
4276
4793
|
exports.buildScopeExpression = buildScopeExpression;
|
|
4277
4794
|
exports.clearClockSessionAbort = clearClockSessionAbort;
|
|
4278
4795
|
exports.clockNodeDefinition = clockNodeDefinition;
|
|
4796
|
+
exports.closeTemplateDoc = closeTemplateDoc;
|
|
4279
4797
|
exports.collectArmedViewEventBindings = collectArmedViewEventBindings;
|
|
4280
4798
|
exports.collectArmedViewEventNodeIds = collectArmedViewEventNodeIds;
|
|
4281
4799
|
exports.collectBlueprintLibraryRefs = collectBlueprintLibraryRefs;
|
|
@@ -4295,8 +4813,10 @@ exports.defaultLogicNodeDefinition = defaultLogicNodeDefinition;
|
|
|
4295
4813
|
exports.deserializeStorageValue = deserializeStorageValue;
|
|
4296
4814
|
exports.detectBlueprintReferenceCycle = detectBlueprintReferenceCycle;
|
|
4297
4815
|
exports.detectRuntimeBlueprintCycle = detectRuntimeBlueprintCycle;
|
|
4816
|
+
exports.docText = docText;
|
|
4298
4817
|
exports.downloadApiCollectionTemplate = downloadApiCollectionTemplate;
|
|
4299
4818
|
exports.draftFetchHeadersText = draftFetchHeadersText;
|
|
4819
|
+
exports.dslMessage = dslMessage;
|
|
4300
4820
|
exports.evaluateScopeExpression = evaluateScopeExpression;
|
|
4301
4821
|
exports.evaluateScopeTemplate = evaluateScopeTemplate;
|
|
4302
4822
|
exports.evaluateScopeTemplateInJson = evaluateScopeTemplateInJson;
|
|
@@ -4315,6 +4835,7 @@ exports.formatClockTime = formatClockTime;
|
|
|
4315
4835
|
exports.getActiveClockNodeIds = getActiveClockNodeIds;
|
|
4316
4836
|
exports.getApiCollectionTemplateDocument = getApiCollectionTemplateDocument;
|
|
4317
4837
|
exports.getApiCollectionTemplateJson = getApiCollectionTemplateJson;
|
|
4838
|
+
exports.getBlueprintDslLocale = getBlueprintDslLocale;
|
|
4318
4839
|
exports.getClockTickDelayOffsetMs = getClockTickDelayOffsetMs;
|
|
4319
4840
|
exports.getClockTickWaitMs = getClockTickWaitMs;
|
|
4320
4841
|
exports.getFetchBodyValidationError = getFetchBodyValidationError;
|
|
@@ -4322,6 +4843,7 @@ exports.getFetchHeadersValidationError = getFetchHeadersValidationError;
|
|
|
4322
4843
|
exports.getNodeDefinition = getNodeDefinition;
|
|
4323
4844
|
exports.getScopeAutocompleteSuggestions = getScopeAutocompleteSuggestions;
|
|
4324
4845
|
exports.getSystemAutocompleteTree = getSystemAutocompleteTree;
|
|
4846
|
+
exports.getTemplateDocRequest = getTemplateDocRequest;
|
|
4325
4847
|
exports.hasScopeTemplate = hasScopeTemplate;
|
|
4326
4848
|
exports.hasTemplateExpression = hasTemplateExpression;
|
|
4327
4849
|
exports.isClockNodeActive = isClockNodeActive;
|
|
@@ -4347,6 +4869,7 @@ exports.normalizeClockConfig = normalizeClockConfig;
|
|
|
4347
4869
|
exports.normalizeFetchRequestConfig = normalizeFetchRequestConfig;
|
|
4348
4870
|
exports.normalizeStorageConfig = normalizeStorageConfig;
|
|
4349
4871
|
exports.normalizeViewEventConfig = normalizeViewEventConfig;
|
|
4872
|
+
exports.openTemplateDoc = openTemplateDoc;
|
|
4350
4873
|
exports.parseApiCollectionJson = parseApiCollectionJson;
|
|
4351
4874
|
exports.parseFetchHeadersJson = parseFetchHeadersJson;
|
|
4352
4875
|
exports.parseJsonConfig = parseJsonConfig;
|
|
@@ -4364,17 +4887,22 @@ exports.resolveFetchRequestUrl = resolveFetchRequestUrl;
|
|
|
4364
4887
|
exports.resolveFetchScopeAutocompleteRoot = resolveFetchScopeAutocompleteRoot;
|
|
4365
4888
|
exports.resolveStorageKey = resolveStorageKey;
|
|
4366
4889
|
exports.resolveStorageWriteValue = resolveStorageWriteValue;
|
|
4890
|
+
exports.resolveTemplateDocTarget = resolveTemplateDocTarget;
|
|
4367
4891
|
exports.scheduleClockOutputs = scheduleClockOutputs;
|
|
4892
|
+
exports.sectionSearchText = sectionSearchText;
|
|
4368
4893
|
exports.serializeStorageValue = serializeStorageValue;
|
|
4369
4894
|
exports.serializeTraceValue = serializeTraceValue;
|
|
4895
|
+
exports.setBlueprintDslLocale = setBlueprintDslLocale;
|
|
4370
4896
|
exports.snapshotDomEvent = snapshotDomEvent;
|
|
4371
4897
|
exports.snapshotViewEventNode = snapshotViewEventNode;
|
|
4898
|
+
exports.splitTemplateDocLinks = splitTemplateDocLinks;
|
|
4372
4899
|
exports.startClockSchedule = startClockSchedule;
|
|
4373
4900
|
exports.stopAllClockSchedules = stopAllClockSchedules;
|
|
4374
4901
|
exports.stopClockSchedule = stopClockSchedule;
|
|
4375
4902
|
exports.storageNodeDefinition = storageNodeDefinition;
|
|
4376
4903
|
exports.stringifyScopeValue = stringifyScopeValue;
|
|
4377
4904
|
exports.subscribeActiveClockNodes = subscribeActiveClockNodes;
|
|
4905
|
+
exports.subscribeTemplateDoc = subscribeTemplateDoc;
|
|
4378
4906
|
exports.toApiCollectionSyncResult = toApiCollectionSyncResult;
|
|
4379
4907
|
exports.uniqueStorageKinds = uniqueStorageKinds;
|
|
4380
4908
|
exports.validateApiCollectionDocument = validateApiCollectionDocument;
|