@nodegx/backend 0.1.2 → 0.1.4
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/README.md +14 -0
- package/bin/nodegx-online.js +2 -1
- package/dist/cloud-bundle.cjs +2256 -1021
- package/dist/cloudflare-deploy.cjs +236 -106
- package/dist/package.json +1 -1
- package/dist/worker/worker.mjs +311 -308
- package/package.json +1 -1
|
@@ -251,14 +251,14 @@ var require_model = __commonJS({
|
|
|
251
251
|
};
|
|
252
252
|
Model2.prototype.set = function(name2, value2, args) {
|
|
253
253
|
if (args && args.resolve && name2.indexOf(".") !== -1) {
|
|
254
|
-
var
|
|
254
|
+
var path6 = name2.split(".");
|
|
255
255
|
var model = this;
|
|
256
|
-
for (var i = 0; i <
|
|
257
|
-
var v = model.get(
|
|
256
|
+
for (var i = 0; i < path6.length - 1; i++) {
|
|
257
|
+
var v = model.get(path6[i]);
|
|
258
258
|
if (Model2.instanceOf(v)) model = v;
|
|
259
259
|
else return;
|
|
260
260
|
}
|
|
261
|
-
model.set(
|
|
261
|
+
model.set(path6[path6.length - 1], value2);
|
|
262
262
|
return;
|
|
263
263
|
}
|
|
264
264
|
const forceChange = args && args.forceChange;
|
|
@@ -271,14 +271,14 @@ var require_model = __commonJS({
|
|
|
271
271
|
};
|
|
272
272
|
Model2.prototype.get = function(name2, args) {
|
|
273
273
|
if (args && args.resolve && name2.indexOf(".") !== -1) {
|
|
274
|
-
var
|
|
274
|
+
var path6 = name2.split(".");
|
|
275
275
|
var model = this;
|
|
276
|
-
for (var i = 0; i <
|
|
277
|
-
var v = model.get(
|
|
276
|
+
for (var i = 0; i < path6.length - 1; i++) {
|
|
277
|
+
var v = model.get(path6[i]);
|
|
278
278
|
if (Model2.instanceOf(v)) model = v;
|
|
279
279
|
else return;
|
|
280
280
|
}
|
|
281
|
-
return model.get(
|
|
281
|
+
return model.get(path6[path6.length - 1]);
|
|
282
282
|
}
|
|
283
283
|
return this.data[name2];
|
|
284
284
|
};
|
|
@@ -3117,13 +3117,13 @@ var require_node = __commonJS({
|
|
|
3117
3117
|
const runContext = scope && scope.runContext;
|
|
3118
3118
|
if (!runContext || !runContext.beginStep || !runContext.endStep) return;
|
|
3119
3119
|
const recordValues = !!runContext.recordValues;
|
|
3120
|
-
const
|
|
3120
|
+
const step2 = runContext.beginStep({
|
|
3121
3121
|
nodeId: this.id,
|
|
3122
3122
|
nodeType: this.name,
|
|
3123
3123
|
...recordValues ? { inputs: snapshotInputValues(this) } : {}
|
|
3124
3124
|
});
|
|
3125
|
-
if (
|
|
3126
|
-
runContext.endStep(
|
|
3125
|
+
if (step2 !== void 0 && step2 !== null) {
|
|
3126
|
+
runContext.endStep(step2, {
|
|
3127
3127
|
status: "failure",
|
|
3128
3128
|
code,
|
|
3129
3129
|
message,
|
|
@@ -3261,13 +3261,13 @@ var require_node = __commonJS({
|
|
|
3261
3261
|
this._raisingForOutcome = false;
|
|
3262
3262
|
if (tokenCause && traceContext && traceContext.traceEnabled) traceContext._currentCause = causeBefore;
|
|
3263
3263
|
}
|
|
3264
|
-
const
|
|
3265
|
-
if (
|
|
3264
|
+
const step2 = token.step;
|
|
3265
|
+
if (step2 !== void 0 && step2 !== null) {
|
|
3266
3266
|
token.step = void 0;
|
|
3267
3267
|
const scope = this.nodeScope;
|
|
3268
3268
|
const runContext = scope && scope.runContext;
|
|
3269
3269
|
if (runContext && runContext.endStep) {
|
|
3270
|
-
runContext.endStep(
|
|
3270
|
+
runContext.endStep(step2, {
|
|
3271
3271
|
status: outcome,
|
|
3272
3272
|
code: options && options.code,
|
|
3273
3273
|
message: options && options.message,
|
|
@@ -3742,9 +3742,9 @@ __export(deployCloudflare_exports, {
|
|
|
3742
3742
|
module.exports = __toCommonJS(deployCloudflare_exports);
|
|
3743
3743
|
var import_node_child_process = require("node:child_process");
|
|
3744
3744
|
var crypto4 = __toESM(require("node:crypto"));
|
|
3745
|
-
var
|
|
3745
|
+
var fs6 = __toESM(require("node:fs"));
|
|
3746
3746
|
var os2 = __toESM(require("node:os"));
|
|
3747
|
-
var
|
|
3747
|
+
var path5 = __toESM(require("node:path"));
|
|
3748
3748
|
|
|
3749
3749
|
// ../noodl-runtime/src/nodes/std-library/expression-ports.ts
|
|
3750
3750
|
var EXPRESSION_MATH_ALIASES = [
|
|
@@ -4017,13 +4017,14 @@ function whyNotPrintable(params, body, async) {
|
|
|
4017
4017
|
return void 0;
|
|
4018
4018
|
}
|
|
4019
4019
|
var fnName = (componentName) => componentName.replace(/^\/?#__cloud__\//, "");
|
|
4020
|
-
function collectCode(components) {
|
|
4020
|
+
function collectCode(components, options) {
|
|
4021
|
+
const compile = !options || options.compile !== false;
|
|
4021
4022
|
const byKey = /* @__PURE__ */ new Map();
|
|
4022
4023
|
const refusals = [];
|
|
4023
4024
|
const visit = (component, node) => {
|
|
4024
4025
|
for (const code of codeOfNode(node)) {
|
|
4025
4026
|
const site = { fn: fnName(component.name), nodeId: node.id, type: node.type, port: code.port };
|
|
4026
|
-
const why = whyNotPrintable(code.params, code.body, code.async);
|
|
4027
|
+
const why = compile ? whyNotPrintable(code.params, code.body, code.async) : void 0;
|
|
4027
4028
|
if (why) {
|
|
4028
4029
|
refusals.push({ ...site, reason: why });
|
|
4029
4030
|
continue;
|
|
@@ -4314,11 +4315,11 @@ function namedRoles(config) {
|
|
|
4314
4315
|
// ../nodegx-backend/cloudflare/applyProject.ts
|
|
4315
4316
|
var ApplyError = class extends Error {
|
|
4316
4317
|
};
|
|
4317
|
-
async function must(call, method,
|
|
4318
|
-
const answer = await call(method,
|
|
4318
|
+
async function must(call, method, path6, body) {
|
|
4319
|
+
const answer = await call(method, path6, body);
|
|
4319
4320
|
if (answer.status >= 300) {
|
|
4320
4321
|
const said = answer.json?.error ?? answer.text.slice(0, 600);
|
|
4321
|
-
throw new ApplyError(`${method} /${
|
|
4322
|
+
throw new ApplyError(`${method} /${path6.replace(/^\//, "")} answered ${answer.status}: ${said}`);
|
|
4322
4323
|
}
|
|
4323
4324
|
return answer;
|
|
4324
4325
|
}
|
|
@@ -4419,11 +4420,11 @@ async function applyProject(call, project, options) {
|
|
|
4419
4420
|
function automationsSha256(text) {
|
|
4420
4421
|
return crypto.createHash("sha256").update(text).digest("hex");
|
|
4421
4422
|
}
|
|
4422
|
-
async function must2(call, method,
|
|
4423
|
-
const answer = await call(method,
|
|
4423
|
+
async function must2(call, method, path6, body) {
|
|
4424
|
+
const answer = await call(method, path6, body);
|
|
4424
4425
|
if (answer.status >= 300) {
|
|
4425
4426
|
const said = answer.json?.error ?? answer.text.slice(0, 600);
|
|
4426
|
-
throw new ApplyError(`${method} /${
|
|
4427
|
+
throw new ApplyError(`${method} /${path6.replace(/^\//, "")} answered ${answer.status}: ${said}`);
|
|
4427
4428
|
}
|
|
4428
4429
|
return answer;
|
|
4429
4430
|
}
|
|
@@ -4527,7 +4528,7 @@ ${differences.map((d) => ` - ${d}`).join("\n")}
|
|
|
4527
4528
|
undo.push(() => call("POST", "/admin/workflow-defs", projectWorkflow(w)));
|
|
4528
4529
|
}
|
|
4529
4530
|
} catch (e) {
|
|
4530
|
-
for (const
|
|
4531
|
+
for (const step2 of undo.reverse()) await step2().catch(() => void 0);
|
|
4531
4532
|
throw new ApplyError(
|
|
4532
4533
|
`nodegx.automations.json could not be carried to the backend, so none of it was (the backend's are as they were): ${e.message}`
|
|
4533
4534
|
);
|
|
@@ -5004,6 +5005,67 @@ async function inPublicDns(f, host) {
|
|
|
5004
5005
|
}
|
|
5005
5006
|
}
|
|
5006
5007
|
|
|
5008
|
+
// ../nodegx-backend/cloudflare/guide.ts
|
|
5009
|
+
var GUIDE_URL = "https://the-low-code-foundation.github.io/NodeGX/docs/deploy/cloudflare";
|
|
5010
|
+
var GUIDE_SECTIONS = {
|
|
5011
|
+
signIn: "sign-in",
|
|
5012
|
+
functions: "cloud-functions",
|
|
5013
|
+
site: "the-site",
|
|
5014
|
+
worker: "the-worker",
|
|
5015
|
+
private: "nothing-private",
|
|
5016
|
+
upload: "upload",
|
|
5017
|
+
project: "the-project-onto-the-backend",
|
|
5018
|
+
secrets: "secrets",
|
|
5019
|
+
dashboard: "the-dashboard"
|
|
5020
|
+
};
|
|
5021
|
+
function guideLink(section) {
|
|
5022
|
+
return section ? `${GUIDE_URL}#${GUIDE_SECTIONS[section]}` : GUIDE_URL;
|
|
5023
|
+
}
|
|
5024
|
+
var SECRET_NODE_TYPE = "noodl.cloud.secret";
|
|
5025
|
+
function secretNamesRead(components) {
|
|
5026
|
+
const names = /* @__PURE__ */ new Set();
|
|
5027
|
+
const visit = (n) => {
|
|
5028
|
+
const name2 = n.parameters?.name;
|
|
5029
|
+
if (n.type === SECRET_NODE_TYPE && typeof name2 === "string" && name2.trim()) names.add(name2.trim());
|
|
5030
|
+
(n.children || []).forEach(visit);
|
|
5031
|
+
};
|
|
5032
|
+
components.forEach((c) => (c.nodes || []).forEach(visit));
|
|
5033
|
+
return [...names].sort();
|
|
5034
|
+
}
|
|
5035
|
+
function secretsReport(o) {
|
|
5036
|
+
if (!o.read.length) return [];
|
|
5037
|
+
const setHere = new Set((o.listing?.secrets ?? []).map((s) => s.name));
|
|
5038
|
+
const prefix = o.listing?.envPrefix ?? "NODEGX_SECRET_";
|
|
5039
|
+
for (const v of o.listing?.environment ?? []) if (v.startsWith(prefix)) setHere.add(v.slice(prefix.length));
|
|
5040
|
+
const page = `${o.dashboard}#/secrets`;
|
|
5041
|
+
const signIn = `Sign in there with the adminToken in ${o.credentialFile}.`;
|
|
5042
|
+
if (!o.listing) {
|
|
5043
|
+
return [
|
|
5044
|
+
`Secrets the functions read: ${o.read.join(", ")}. This backend could not be asked which are set.`,
|
|
5045
|
+
`Check them on its Secrets page, ${page}. ${signIn}`,
|
|
5046
|
+
`Help: ${guideLink("secrets")}`
|
|
5047
|
+
];
|
|
5048
|
+
}
|
|
5049
|
+
const missing = o.read.filter((n) => !setHere.has(n));
|
|
5050
|
+
const set = o.read.filter((n) => setHere.has(n));
|
|
5051
|
+
if (!missing.length) return [`Secrets the functions read: ${set.join(", ")}. All are set on this backend.`];
|
|
5052
|
+
const env = new Set(o.inEnvFile);
|
|
5053
|
+
const lines = [
|
|
5054
|
+
`Secrets the functions read: ${o.read.length}. Set on this backend: ${set.length ? set.join(", ") : "none"}.`,
|
|
5055
|
+
`NOT set on this backend: ${missing.join(", ")}. A function that reads one fails until it is set.`
|
|
5056
|
+
];
|
|
5057
|
+
const fromEnv = missing.filter((n) => env.has(n));
|
|
5058
|
+
if (fromEnv.length) {
|
|
5059
|
+
lines.push(`Your app's .env has ${fromEnv.join(", ")}. That file stays on this computer, so copy each value across.`);
|
|
5060
|
+
}
|
|
5061
|
+
lines.push(
|
|
5062
|
+
`A secret does not travel with a deploy. Set each one on the backend's own Secrets page, ${page}, not in Cloudflare's dashboard.`,
|
|
5063
|
+
`${signIn} A redeploy keeps what you set.`,
|
|
5064
|
+
`Help: ${guideLink("secrets")}`
|
|
5065
|
+
);
|
|
5066
|
+
return lines;
|
|
5067
|
+
}
|
|
5068
|
+
|
|
5007
5069
|
// ../nodegx-backend/cloudflare/wranglerConfig.ts
|
|
5008
5070
|
function emailProblem(what, address) {
|
|
5009
5071
|
return /^[^\s@<>"]+@[a-z0-9-]+(\.[a-z0-9-]+)+$/i.test(address) ? null : `${what} "${address}" is not an email address (write it bare, like alerts@example.com).`;
|
|
@@ -5129,12 +5191,58 @@ function spawnFailure(command, error) {
|
|
|
5129
5191
|
return `wrangler could not be started (${command.join(" ")}: ${code || error.message}). Install it with \`npm install -g wrangler@4\` and point the deploy at it with NODEGX_WRANGLER set to its bin/wrangler.js.`;
|
|
5130
5192
|
}
|
|
5131
5193
|
|
|
5194
|
+
// ../nodegx-backend/src/config/projectEnvFile.ts
|
|
5195
|
+
var fs5 = __toESM(require("fs"));
|
|
5196
|
+
var path4 = __toESM(require("path"));
|
|
5197
|
+
|
|
5198
|
+
// ../nodegx-backend/src/config/SecretsStore.ts
|
|
5199
|
+
var FUNCTION_SECRET_NAME_PATTERN = /^[A-Za-z0-9_.-]{1,128}$/;
|
|
5200
|
+
|
|
5201
|
+
// ../nodegx-backend/src/config/projectEnvFile.ts
|
|
5202
|
+
var PROJECT_ENV_FILE = ".env";
|
|
5203
|
+
var LINE = /^(?:export\s+)?([A-Za-z0-9_.-]+)\s*=(.*)$/;
|
|
5204
|
+
function lineValue(raw) {
|
|
5205
|
+
let value2 = raw.trim();
|
|
5206
|
+
if (value2.length >= 2 && (value2[0] === '"' || value2[0] === "'") && value2[value2.length - 1] === value2[0]) {
|
|
5207
|
+
value2 = value2.slice(1, -1);
|
|
5208
|
+
}
|
|
5209
|
+
return value2;
|
|
5210
|
+
}
|
|
5211
|
+
function readText(projectDir) {
|
|
5212
|
+
if (!projectDir) return null;
|
|
5213
|
+
try {
|
|
5214
|
+
return fs5.readFileSync(path4.join(projectDir, PROJECT_ENV_FILE), "utf8");
|
|
5215
|
+
} catch {
|
|
5216
|
+
return null;
|
|
5217
|
+
}
|
|
5218
|
+
}
|
|
5219
|
+
function projectEnvSecretNames(projectDir) {
|
|
5220
|
+
const text = readText(projectDir);
|
|
5221
|
+
if (text === null) return [];
|
|
5222
|
+
const seen = /* @__PURE__ */ new Set();
|
|
5223
|
+
const filled = [];
|
|
5224
|
+
for (const raw of text.split(/\r?\n/)) {
|
|
5225
|
+
const line = raw.trim();
|
|
5226
|
+
if (!line || line.startsWith("#")) continue;
|
|
5227
|
+
const m = LINE.exec(line);
|
|
5228
|
+
if (!m || seen.has(m[1])) continue;
|
|
5229
|
+
seen.add(m[1]);
|
|
5230
|
+
if (FUNCTION_SECRET_NAME_PATTERN.test(m[1]) && lineValue(m[2])) filled.push(m[1]);
|
|
5231
|
+
}
|
|
5232
|
+
return filled.sort();
|
|
5233
|
+
}
|
|
5234
|
+
|
|
5132
5235
|
// ../nodegx-backend/cloudflare/deployCloudflare.ts
|
|
5133
5236
|
var HERE = process.env.NODEGX_CLOUDFLARE_SRC || __dirname;
|
|
5134
|
-
var PACKAGES =
|
|
5237
|
+
var PACKAGES = path5.resolve(HERE, "..", "..");
|
|
5135
5238
|
var DeployError = class extends Error {
|
|
5136
5239
|
};
|
|
5137
5240
|
var say = (line = "") => process.stdout.write(line + "\n");
|
|
5241
|
+
var stage = null;
|
|
5242
|
+
function step(title, section) {
|
|
5243
|
+
stage = section;
|
|
5244
|
+
say(`${title} (help: ${guideLink(section)})`);
|
|
5245
|
+
}
|
|
5138
5246
|
var PROGRAM = process.env.NODEGX_CLOUDFLARE_COMMAND || "deploy.mjs";
|
|
5139
5247
|
var USAGE = `usage: ${PROGRAM} <project> [--name <worker>] [--bucket <r2 bucket> | --no-bucket] [--viewer <folder>]
|
|
5140
5248
|
[--allow-development-engine] [--out <folder>] [--local [--port <n>]] [--make-roles]
|
|
@@ -5154,9 +5262,9 @@ ${USAGE}`);
|
|
|
5154
5262
|
if (a === "--name") o.name = next();
|
|
5155
5263
|
else if (a === "--bucket") o.bucket = next();
|
|
5156
5264
|
else if (a === "--no-bucket") o.bucket = null;
|
|
5157
|
-
else if (a === "--viewer") o.viewer =
|
|
5265
|
+
else if (a === "--viewer") o.viewer = path5.resolve(next());
|
|
5158
5266
|
else if (a === "--allow-development-engine") o.allowDevelopmentEngine = true;
|
|
5159
|
-
else if (a === "--out") o.out =
|
|
5267
|
+
else if (a === "--out") o.out = path5.resolve(next());
|
|
5160
5268
|
else if (a === "--local") o.local = true;
|
|
5161
5269
|
else if (a === "--port") o.port = Number(next());
|
|
5162
5270
|
else if (a === "--make-roles") o.makeRoles = true;
|
|
@@ -5171,7 +5279,7 @@ ${USAGE}`);
|
|
|
5171
5279
|
else if (a === "--account") o.account = next().trim();
|
|
5172
5280
|
else if (a.startsWith("--")) throw new DeployError(`${a} is not an option.
|
|
5173
5281
|
${USAGE}`);
|
|
5174
|
-
else if (!o.project) o.project =
|
|
5282
|
+
else if (!o.project) o.project = path5.resolve(a);
|
|
5175
5283
|
else throw new DeployError(`One project at a time.
|
|
5176
5284
|
${USAGE}`);
|
|
5177
5285
|
}
|
|
@@ -5179,20 +5287,20 @@ ${USAGE}`);
|
|
|
5179
5287
|
return o;
|
|
5180
5288
|
}
|
|
5181
5289
|
function readProject(dir) {
|
|
5182
|
-
const file =
|
|
5183
|
-
if (!
|
|
5184
|
-
const json = JSON.parse(
|
|
5185
|
-
const policyFile =
|
|
5186
|
-
const policyText =
|
|
5290
|
+
const file = path5.join(dir, "nodegx.project.json");
|
|
5291
|
+
if (!fs6.existsSync(file)) throw new DeployError(`${dir} is not a NodeGX project: it has no nodegx.project.json.`);
|
|
5292
|
+
const json = JSON.parse(fs6.readFileSync(file, "utf8"));
|
|
5293
|
+
const policyFile = path5.join(dir, "nodegx.security.json");
|
|
5294
|
+
const policyText = fs6.existsSync(policyFile) ? fs6.readFileSync(policyFile, "utf8") : null;
|
|
5187
5295
|
if (policyText) JSON.parse(policyText);
|
|
5188
|
-
const automationsFile =
|
|
5189
|
-
const automationsText =
|
|
5296
|
+
const automationsFile = path5.join(dir, "nodegx.automations.json");
|
|
5297
|
+
const automationsText = fs6.existsSync(automationsFile) ? fs6.readFileSync(automationsFile, "utf8") : null;
|
|
5190
5298
|
if (automationsText) JSON.parse(automationsText);
|
|
5191
|
-
const envFile =
|
|
5192
|
-
const envValues =
|
|
5299
|
+
const envFile = path5.join(dir, ".env");
|
|
5300
|
+
const envValues = fs6.existsSync(envFile) ? fs6.readFileSync(envFile, "utf8").split("\n").map((l) => l.replace(/^\s*(export\s+)?[A-Za-z_][A-Za-z0-9_]*\s*=\s*/, "").replace(/^['"]|['"]\s*$/g, "").trim()).filter((v) => v.length >= 8) : [];
|
|
5193
5301
|
return {
|
|
5194
5302
|
dir,
|
|
5195
|
-
name: json.name ||
|
|
5303
|
+
name: json.name || path5.basename(dir),
|
|
5196
5304
|
file: json,
|
|
5197
5305
|
policyText,
|
|
5198
5306
|
automationsText,
|
|
@@ -5201,20 +5309,20 @@ function readProject(dir) {
|
|
|
5201
5309
|
};
|
|
5202
5310
|
}
|
|
5203
5311
|
function deploymentsRoot() {
|
|
5204
|
-
return process.env.NODEGX_CLOUDFLARE_HOME ||
|
|
5312
|
+
return process.env.NODEGX_CLOUDFLARE_HOME || path5.join(os2.homedir(), ".nodegx", "cloudflare");
|
|
5205
5313
|
}
|
|
5206
5314
|
function readRecord(dir) {
|
|
5207
|
-
const file =
|
|
5208
|
-
return
|
|
5315
|
+
const file = path5.join(dir, "deployment.json");
|
|
5316
|
+
return fs6.existsSync(file) ? JSON.parse(fs6.readFileSync(file, "utf8")) : null;
|
|
5209
5317
|
}
|
|
5210
5318
|
function writeRecord(dir, record) {
|
|
5211
|
-
const file =
|
|
5212
|
-
|
|
5213
|
-
|
|
5319
|
+
const file = path5.join(dir, "deployment.json");
|
|
5320
|
+
fs6.writeFileSync(file, JSON.stringify(record, null, 2) + "\n", { mode: 384 });
|
|
5321
|
+
fs6.chmodSync(file, 384);
|
|
5214
5322
|
}
|
|
5215
5323
|
function cloudFunctions(projectDir) {
|
|
5216
|
-
const entry = process.env.NODEGX_CLOUD_BUNDLE ||
|
|
5217
|
-
if (!
|
|
5324
|
+
const entry = process.env.NODEGX_CLOUD_BUNDLE || path5.join(PACKAGES, "noodl-mcp", "dist", "cloud-bundle.cjs");
|
|
5325
|
+
if (!fs6.existsSync(entry)) {
|
|
5218
5326
|
throw new DeployError(`The cloud-function bundler is not here (${entry}): run \`npm run build\` in packages/noodl-mcp.`);
|
|
5219
5327
|
}
|
|
5220
5328
|
const run = (0, import_node_child_process.spawnSync)(process.execPath, [entry, projectDir], { encoding: "utf8", maxBuffer: 64 * 1024 * 1024, timeout: 12e4 });
|
|
@@ -5225,8 +5333,8 @@ ${(run.stderr || "").trim() || "no output"}`);
|
|
|
5225
5333
|
var NOT_FOR_THE_HOST = ["DEPLOY.md", "serve.js", "package.json", ".nodegx-deploy.json", "nodegx-config.json"];
|
|
5226
5334
|
var VIEWER_HINT = "\nName a production viewer with --viewer <folder holding noodl.deploy.js>.";
|
|
5227
5335
|
function siteThroughCli(copy, out, allowDev) {
|
|
5228
|
-
const cli = process.env.NODEGX_CLI ||
|
|
5229
|
-
if (!process.env.NODEGX_CLI && process.env.NODEGX_DEPLOY_CLI && !
|
|
5336
|
+
const cli = process.env.NODEGX_CLI || path5.join(PACKAGES, "nodegx-export", "dist", "cli.mjs");
|
|
5337
|
+
if (!process.env.NODEGX_CLI && process.env.NODEGX_DEPLOY_CLI && !fs6.existsSync(cli)) return null;
|
|
5230
5338
|
const args = [cli, "deploy", copy, out];
|
|
5231
5339
|
if (allowDev) args.push("--allow-development-engine");
|
|
5232
5340
|
const run = (0, import_node_child_process.spawnSync)(process.execPath, args, { encoding: "utf8", maxBuffer: 64 * 1024 * 1024 });
|
|
@@ -5238,7 +5346,7 @@ ${(run.stdout + run.stderr).trim()}` + (run.status === 11 ? VIEWER_HINT : ""));
|
|
|
5238
5346
|
}
|
|
5239
5347
|
function siteThroughEngine(copy, out, allowDev) {
|
|
5240
5348
|
const engine = process.env.NODEGX_DEPLOY_CLI;
|
|
5241
|
-
if (!
|
|
5349
|
+
if (!fs6.existsSync(engine)) throw new DeployError(`NODEGX_DEPLOY_CLI is set to ${engine}, and there is nothing there.`);
|
|
5242
5350
|
const args = [engine, copy, out];
|
|
5243
5351
|
if (allowDev) args.push("--allow-development-engine");
|
|
5244
5352
|
const run = (0, import_node_child_process.spawnSync)(process.execPath, args, { encoding: "utf8", maxBuffer: 64 * 1024 * 1024 });
|
|
@@ -5262,45 +5370,45 @@ ${report.blank}`);
|
|
|
5262
5370
|
return notes;
|
|
5263
5371
|
}
|
|
5264
5372
|
function buildSite(project, name2, siteDir, o) {
|
|
5265
|
-
const work =
|
|
5373
|
+
const work = fs6.mkdtempSync(path5.join(os2.tmpdir(), "nodegx-cf-site-"));
|
|
5266
5374
|
try {
|
|
5267
|
-
const copy =
|
|
5268
|
-
|
|
5269
|
-
const json = JSON.parse(
|
|
5375
|
+
const copy = path5.join(work, "project");
|
|
5376
|
+
fs6.cpSync(project.dir, copy, { recursive: true, filter: (src) => !/[/\\](\.git|node_modules|\.previews)$/.test(src) });
|
|
5377
|
+
const json = JSON.parse(fs6.readFileSync(path5.join(copy, "nodegx.project.json"), "utf8"));
|
|
5270
5378
|
json.metadata = { ...json.metadata || {}, cloudservices: { endpoint: "", appId: name2, instanceId: name2, type: "nodegx" } };
|
|
5271
|
-
|
|
5272
|
-
const out =
|
|
5379
|
+
fs6.writeFileSync(path5.join(copy, "nodegx.project.json"), JSON.stringify(json, null, 2));
|
|
5380
|
+
const out = path5.join(work, "site");
|
|
5273
5381
|
const allowDev = !!(o.viewer || o.allowDevelopmentEngine);
|
|
5274
5382
|
const notes = siteThroughCli(copy, out, allowDev) ?? siteThroughEngine(copy, out, allowDev);
|
|
5275
5383
|
if (o.viewer) {
|
|
5276
5384
|
for (const f of ["noodl.deploy.js", "noodl.deploy.js.LICENSE.txt"]) {
|
|
5277
|
-
const from =
|
|
5278
|
-
if (
|
|
5385
|
+
const from = path5.join(o.viewer, f);
|
|
5386
|
+
if (fs6.existsSync(from)) fs6.copyFileSync(from, path5.join(out, f));
|
|
5279
5387
|
else if (f === "noodl.deploy.js") throw new DeployError(`--viewer ${o.viewer} holds no noodl.deploy.js.`);
|
|
5280
5388
|
}
|
|
5281
|
-
const engine = readViewerBuild(
|
|
5389
|
+
const engine = readViewerBuild(path5.join(out, "noodl.deploy.js"));
|
|
5282
5390
|
if (engine.kind !== "production") {
|
|
5283
5391
|
throw new DeployError(`--viewer ${o.viewer} is a DEVELOPMENT build of the viewer: ${engine.reasons.join("; ")}.`);
|
|
5284
5392
|
}
|
|
5285
5393
|
notes.push(`viewer: production, from ${o.viewer} (${(engine.bytes / 1e6).toFixed(2)} MB)`);
|
|
5286
5394
|
}
|
|
5287
|
-
for (const f of NOT_FOR_THE_HOST)
|
|
5288
|
-
const hidden = filesUnder2(out).filter((f) =>
|
|
5289
|
-
for (const f of hidden)
|
|
5290
|
-
if (hidden.length) notes.push(`left out (hidden files are never published): ${hidden.map((f) =>
|
|
5291
|
-
|
|
5292
|
-
|
|
5395
|
+
for (const f of NOT_FOR_THE_HOST) fs6.rmSync(path5.join(out, f), { force: true });
|
|
5396
|
+
const hidden = filesUnder2(out).filter((f) => path5.relative(out, f).split(path5.sep).some((part) => part.startsWith(".")));
|
|
5397
|
+
for (const f of hidden) fs6.rmSync(f, { force: true });
|
|
5398
|
+
if (hidden.length) notes.push(`left out (hidden files are never published): ${hidden.map((f) => path5.relative(out, f)).join(", ")}`);
|
|
5399
|
+
fs6.rmSync(siteDir, { recursive: true, force: true });
|
|
5400
|
+
fs6.cpSync(out, siteDir, { recursive: true });
|
|
5293
5401
|
return notes;
|
|
5294
5402
|
} finally {
|
|
5295
|
-
|
|
5403
|
+
fs6.rmSync(work, { recursive: true, force: true });
|
|
5296
5404
|
}
|
|
5297
5405
|
}
|
|
5298
5406
|
async function bundleWorker(outfile, plugins = [], esbuild = require("esbuild")) {
|
|
5299
|
-
const { shared } = require(
|
|
5300
|
-
const nodeSqlite =
|
|
5407
|
+
const { shared } = require(path5.join(HERE, "..", "scripts", "build.js"));
|
|
5408
|
+
const nodeSqlite = path5.join(HERE, "nodeSqlite.ts");
|
|
5301
5409
|
await esbuild.build({
|
|
5302
5410
|
...shared,
|
|
5303
|
-
entryPoints: [
|
|
5411
|
+
entryPoints: [path5.join(HERE, "worker.ts")],
|
|
5304
5412
|
outfile,
|
|
5305
5413
|
format: "esm",
|
|
5306
5414
|
target: "es2022",
|
|
@@ -5328,35 +5436,35 @@ async function bundleWorker(outfile, plugins = [], esbuild = require("esbuild"))
|
|
|
5328
5436
|
}
|
|
5329
5437
|
var WORKER_OWN_MODULES = ["./printed-code.mjs", "./app.mjs"];
|
|
5330
5438
|
async function buildWorker(distDir, app, printed) {
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5439
|
+
fs6.mkdirSync(distDir, { recursive: true });
|
|
5440
|
+
fs6.writeFileSync(path5.join(distDir, "printed-code.mjs"), printed);
|
|
5441
|
+
fs6.writeFileSync(path5.join(distDir, "app.mjs"), `export default ${JSON.stringify(app)};
|
|
5334
5442
|
`);
|
|
5335
5443
|
const prebuilt = process.env.NODEGX_CLOUDFLARE_WORKER;
|
|
5336
5444
|
if (prebuilt) {
|
|
5337
|
-
if (!
|
|
5338
|
-
|
|
5445
|
+
if (!fs6.existsSync(prebuilt)) throw new DeployError(`The prebuilt Worker is not here (${prebuilt}): this copy of the deploy is incomplete.`);
|
|
5446
|
+
fs6.copyFileSync(prebuilt, path5.join(distDir, "worker.mjs"));
|
|
5339
5447
|
return "prebuilt";
|
|
5340
5448
|
}
|
|
5341
|
-
await bundleWorker(
|
|
5449
|
+
await bundleWorker(path5.join(distDir, "worker.mjs"));
|
|
5342
5450
|
return "bundled";
|
|
5343
5451
|
}
|
|
5344
5452
|
function filesUnder2(dir) {
|
|
5345
5453
|
const out = [];
|
|
5346
5454
|
const walk = (d) => {
|
|
5347
|
-
for (const e of
|
|
5348
|
-
const full =
|
|
5455
|
+
for (const e of fs6.readdirSync(d, { withFileTypes: true })) {
|
|
5456
|
+
const full = path5.join(d, e.name);
|
|
5349
5457
|
if (e.isDirectory()) walk(full);
|
|
5350
5458
|
else out.push(full);
|
|
5351
5459
|
}
|
|
5352
5460
|
};
|
|
5353
|
-
if (
|
|
5461
|
+
if (fs6.existsSync(dir)) walk(dir);
|
|
5354
5462
|
return out;
|
|
5355
5463
|
}
|
|
5356
5464
|
function leaks(files, secrets) {
|
|
5357
5465
|
const found = [];
|
|
5358
5466
|
for (const f of files) {
|
|
5359
|
-
const text =
|
|
5467
|
+
const text = fs6.readFileSync(f, "latin1");
|
|
5360
5468
|
for (const s of secrets) if (s.value && text.includes(s.value)) found.push(`${s.what} is in ${f}`);
|
|
5361
5469
|
}
|
|
5362
5470
|
return found;
|
|
@@ -5431,8 +5539,8 @@ async function applyEverything(base, token, project, functions, makeRoles, where
|
|
|
5431
5539
|
const target = where.local ? "local" : "live";
|
|
5432
5540
|
const automations = await applyAutomations(call, project.automationsText, { installedSha256: where.record.automations?.[target] ?? null });
|
|
5433
5541
|
if (automations.before) {
|
|
5434
|
-
const kept =
|
|
5435
|
-
|
|
5542
|
+
const kept = path5.join(where.dir, `automations.before-${(/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-")}.json`);
|
|
5543
|
+
fs6.writeFileSync(kept, JSON.stringify(automations.before, null, 2) + "\n");
|
|
5436
5544
|
automations.lines.push(`The backend's previous ones are kept in ${kept}.`);
|
|
5437
5545
|
}
|
|
5438
5546
|
for (const l of automations.lines) say(` ${l}`);
|
|
@@ -5449,6 +5557,21 @@ async function applyEverything(base, token, project, functions, makeRoles, where
|
|
|
5449
5557
|
else say(` Cloud functions: unchanged (${result.functions.map((f) => f.name).join(", ")}).`);
|
|
5450
5558
|
if (failed.length) throw new DeployError(`Cloud functions that did not deploy:
|
|
5451
5559
|
${failed.map((f) => ` ${f.name}: ${f.reason}`).join("\n")}`);
|
|
5560
|
+
stage = "secrets";
|
|
5561
|
+
const read = secretNamesRead(functions.parts.bundle?.components ?? []);
|
|
5562
|
+
let listing = null;
|
|
5563
|
+
if (read.length) {
|
|
5564
|
+
const r = await call("GET", "/admin/secrets").catch(() => null);
|
|
5565
|
+
if (r && r.status === 200 && r.json && typeof r.json === "object") listing = r.json;
|
|
5566
|
+
}
|
|
5567
|
+
const lines = secretsReport({
|
|
5568
|
+
read,
|
|
5569
|
+
listing,
|
|
5570
|
+
inEnvFile: projectEnvSecretNames(project.dir),
|
|
5571
|
+
dashboard: `${base}/_admin`,
|
|
5572
|
+
credentialFile: path5.join(where.dir, "deployment.json")
|
|
5573
|
+
});
|
|
5574
|
+
for (const l of lines) say(` ${l}`);
|
|
5452
5575
|
}
|
|
5453
5576
|
function alertFrom(o, before) {
|
|
5454
5577
|
if (o.alertTo === null || o.alertFrom === null) return null;
|
|
@@ -5480,15 +5603,16 @@ async function testAlert(base, record, dir, local = false) {
|
|
|
5480
5603
|
}
|
|
5481
5604
|
}
|
|
5482
5605
|
async function deploy(o) {
|
|
5606
|
+
stage = null;
|
|
5483
5607
|
const project = readProject(o.project);
|
|
5484
5608
|
const root = deploymentsRoot();
|
|
5485
5609
|
const name2 = o.name || (o.out ? readRecord(o.out)?.name : void 0) || workerNameFrom(project.name);
|
|
5486
5610
|
const problem = workerNameProblem(name2);
|
|
5487
5611
|
if (problem) throw new DeployError(problem);
|
|
5488
|
-
const dir = o.out ||
|
|
5489
|
-
|
|
5612
|
+
const dir = o.out || path5.join(root, name2);
|
|
5613
|
+
fs6.mkdirSync(dir, { recursive: true });
|
|
5490
5614
|
const before = readRecord(dir);
|
|
5491
|
-
if (before &&
|
|
5615
|
+
if (before && path5.resolve(before.project) !== path5.resolve(project.dir)) {
|
|
5492
5616
|
throw new DeployError(`${name2} was deployed from ${before.project}, not ${project.dir}. Choose another --name.`);
|
|
5493
5617
|
}
|
|
5494
5618
|
const firstDeploy = !before || !before.deploys.some((d) => d.local === !!o.local);
|
|
@@ -5512,7 +5636,8 @@ async function deploy(o) {
|
|
|
5512
5636
|
if (bad) throw new DeployError(bad);
|
|
5513
5637
|
}
|
|
5514
5638
|
say(`NodeGX \u2192 Cloudflare: "${project.name}" as the Worker ${name2}${o.local ? " (locally, on workerd)" : ""}${firstDeploy ? ", first deploy" : ""}.`);
|
|
5515
|
-
say(
|
|
5639
|
+
say(`The guide to every step below: ${guideLink()}`);
|
|
5640
|
+
step("1. Cloud functions", "functions");
|
|
5516
5641
|
const functions = cloudFunctions(project.dir);
|
|
5517
5642
|
if (functions.parts.failures.length) {
|
|
5518
5643
|
throw new DeployError(`Cloud functions that cannot be bundled:
|
|
@@ -5522,19 +5647,19 @@ ${functions.parts.failures.map((f) => ` ${f.name}: ${f.reason}`).join("\n")}`);
|
|
|
5522
5647
|
const { print, refusals } = collectCode(components);
|
|
5523
5648
|
if (refusals.length) throw new DeployError(refusals.map(refusalSentence).join("\n"));
|
|
5524
5649
|
say(` ${functions.parts.shipped.length} function(s), ${print.length} code text(s) printed.`);
|
|
5525
|
-
|
|
5526
|
-
const siteDir =
|
|
5650
|
+
step("2. The site", "site");
|
|
5651
|
+
const siteDir = path5.join(dir, "site");
|
|
5527
5652
|
for (const n of buildSite(project, name2, siteDir, o)) say(` ${n}`);
|
|
5528
|
-
|
|
5529
|
-
const distDir =
|
|
5530
|
-
|
|
5653
|
+
step("3. The Worker", "worker");
|
|
5654
|
+
const distDir = path5.join(dir, "dist");
|
|
5655
|
+
fs6.rmSync(distDir, { recursive: true, force: true });
|
|
5531
5656
|
const how = await buildWorker(distDir, { appId: name2, appName: project.name, policy: project.policyText, automations: project.automationsText }, printCodeModule(print));
|
|
5532
5657
|
if (how === "prebuilt") say(" the backend: the prebuilt Worker (nothing bundled on this computer); the app's code beside it");
|
|
5533
|
-
|
|
5658
|
+
fs6.writeFileSync(path5.join(dir, "wrangler.toml"), wranglerConfig({ name: name2, bucket: record.bucket, domain: o.local ? null : record.domain, alert: record.alert }));
|
|
5534
5659
|
const uploaded = [...filesUnder2(siteDir), ...filesUnder2(distDir)];
|
|
5535
|
-
const mb = uploaded.reduce((n, f) => n +
|
|
5660
|
+
const mb = uploaded.reduce((n, f) => n + fs6.statSync(f).size, 0) / 1e6;
|
|
5536
5661
|
say(` ${uploaded.length} files to upload, ${mb.toFixed(2)} MB; files in ${record.bucket ? `the bucket ${record.bucket}` : "NO bucket (uploads are lost on a restart)"}.`);
|
|
5537
|
-
|
|
5662
|
+
step("4. Nothing private in what is uploaded", "private");
|
|
5538
5663
|
const found = leaks(uploaded, [{ what: "the admin credential", value: record.adminToken }, ...project.envValues.map((v, i) => ({ what: `.env value ${i + 1}`, value: v }))]);
|
|
5539
5664
|
if (found.length) throw new DeployError(`Refused: ${found.join("; ")}.`);
|
|
5540
5665
|
say(` 0 of ${uploaded.length} files hold the admin credential or a .env value.`);
|
|
@@ -5544,38 +5669,39 @@ ${functions.parts.failures.map((f) => ` ${f.name}: ${f.reason}`).join("\n")}`);
|
|
|
5544
5669
|
return 0;
|
|
5545
5670
|
}
|
|
5546
5671
|
if (o.local) {
|
|
5547
|
-
|
|
5672
|
+
step("5. wrangler dev", "upload");
|
|
5548
5673
|
const port = o.port || 8787;
|
|
5549
|
-
|
|
5674
|
+
fs6.writeFileSync(path5.join(dir, ".dev.vars"), `NODEGX_ADMIN_TOKEN=${record.adminToken}
|
|
5550
5675
|
`, { mode: 384 });
|
|
5551
5676
|
const [cmd, ...pre] = wranglerCommand();
|
|
5552
|
-
const child = (0, import_node_child_process.spawn)(cmd, [...pre, "dev", "--config", "wrangler.toml", "--port", String(port), "--ip", "127.0.0.1", "--persist-to",
|
|
5677
|
+
const child = (0, import_node_child_process.spawn)(cmd, [...pre, "dev", "--config", "wrangler.toml", "--port", String(port), "--ip", "127.0.0.1", "--persist-to", path5.join(dir, ".state")], {
|
|
5553
5678
|
cwd: dir,
|
|
5554
5679
|
stdio: ["ignore", "pipe", "pipe"],
|
|
5555
5680
|
env: { ...process.env, WRANGLER_SEND_METRICS: "false" }
|
|
5556
5681
|
});
|
|
5557
|
-
const log =
|
|
5682
|
+
const log = fs6.createWriteStream(path5.join(dir, "wrangler-dev.log"));
|
|
5558
5683
|
child.stdout.pipe(log);
|
|
5559
5684
|
child.stderr.pipe(log);
|
|
5560
5685
|
const unstarted = new Promise((_, reject) => child.on("error", (e) => reject(new DeployError(spawnFailure([cmd, ...pre], e) ?? String(e)))));
|
|
5561
5686
|
unstarted.catch(() => void 0);
|
|
5562
5687
|
const base = `http://127.0.0.1:${port}`;
|
|
5563
5688
|
await Promise.race([waitFor(`${base}/health`, 90), unstarted]);
|
|
5564
|
-
|
|
5689
|
+
step(`6. The project onto the backend at ${base}`, "project");
|
|
5565
5690
|
await applyEverything(base, record.adminToken, project, functions, firstDeploy || !!o.makeRoles, { dir, record, local: true });
|
|
5566
5691
|
record.deploys.push({ at: (/* @__PURE__ */ new Date()).toISOString(), url: base, local: true });
|
|
5567
5692
|
writeRecord(dir, record);
|
|
5568
5693
|
await testAlert(base, record, dir, true);
|
|
5569
5694
|
say(`
|
|
5570
|
-
Running on workerd at ${base} (log: ${
|
|
5695
|
+
Running on workerd at ${base} (log: ${path5.join(dir, "wrangler-dev.log")}). Ctrl-C stops it; its data stays in ${path5.join(dir, ".state")}.`);
|
|
5571
5696
|
await new Promise((resolve2) => child.on("exit", () => resolve2()));
|
|
5572
5697
|
return 0;
|
|
5573
5698
|
}
|
|
5699
|
+
stage = "signIn";
|
|
5574
5700
|
const route = await chooseRoute(o);
|
|
5575
5701
|
let url;
|
|
5576
5702
|
let domainAnswer = null;
|
|
5577
5703
|
if (route.via === "api") {
|
|
5578
|
-
|
|
5704
|
+
step("5. Up to Cloudflare, through its API, with your NodeGX sign-in", "upload");
|
|
5579
5705
|
const ours = !!before?.deploys.some((d) => !d.local);
|
|
5580
5706
|
const up = await deployThroughApi({
|
|
5581
5707
|
token: route.token,
|
|
@@ -5601,14 +5727,14 @@ Running on workerd at ${base} (log: ${path4.join(dir, "wrangler-dev.log")}). Ctr
|
|
|
5601
5727
|
url = up.url;
|
|
5602
5728
|
domainAnswer = up.domain;
|
|
5603
5729
|
} else {
|
|
5604
|
-
|
|
5730
|
+
step(`5. wrangler deploy (${route.why})`, "upload");
|
|
5605
5731
|
url = wranglerDeploy(dir, record, firstDeploy, mint);
|
|
5606
5732
|
record.url = url;
|
|
5607
5733
|
record.deploys.push({ at: (/* @__PURE__ */ new Date()).toISOString(), url, local: false, via: "wrangler" });
|
|
5608
5734
|
writeRecord(dir, record);
|
|
5609
5735
|
}
|
|
5610
5736
|
await waitFor(`${url}/health`, 60);
|
|
5611
|
-
|
|
5737
|
+
step(`6. The project onto the backend at ${url}`, "project");
|
|
5612
5738
|
await applyEverything(url, record.adminToken, project, functions, firstDeploy || !!o.makeRoles, { dir, record, local: false });
|
|
5613
5739
|
say(`
|
|
5614
5740
|
Online: ${url}`);
|
|
@@ -5622,7 +5748,8 @@ Online: ${url}`);
|
|
|
5622
5748
|
);
|
|
5623
5749
|
}
|
|
5624
5750
|
await testAlert(url, record, dir);
|
|
5625
|
-
say(`The backend's dashboard: ${url}/_admin \u2014 its admin credential is in ${
|
|
5751
|
+
say(`The backend's dashboard: ${url}/_admin \u2014 its admin credential is in ${path5.join(dir, "deployment.json")} (never uploaded).`);
|
|
5752
|
+
say(`What the dashboard is for, and how to sign in to it: ${guideLink("dashboard")}`);
|
|
5626
5753
|
return 0;
|
|
5627
5754
|
}
|
|
5628
5755
|
function wranglerDeploy(dir, record, firstDeploy, mint) {
|
|
@@ -5639,15 +5766,15 @@ ${made.out.trim() || `(wrangler exited ${made.status} and said nothing)`}
|
|
|
5639
5766
|
const deployArgs = ["deploy", "--config", "wrangler.toml"];
|
|
5640
5767
|
let secretsFile = null;
|
|
5641
5768
|
if (mint) {
|
|
5642
|
-
secretsFile =
|
|
5643
|
-
|
|
5769
|
+
secretsFile = path5.join(fs6.mkdtempSync(path5.join(os2.tmpdir(), "nodegx-cf-")), "secrets.json");
|
|
5770
|
+
fs6.writeFileSync(secretsFile, JSON.stringify({ NODEGX_ADMIN_TOKEN: record.adminToken }), { mode: 384 });
|
|
5644
5771
|
deployArgs.push("--secrets-file", secretsFile);
|
|
5645
5772
|
}
|
|
5646
5773
|
let done;
|
|
5647
5774
|
try {
|
|
5648
5775
|
done = wrangler(deployArgs, dir);
|
|
5649
5776
|
} finally {
|
|
5650
|
-
if (secretsFile)
|
|
5777
|
+
if (secretsFile) fs6.rmSync(path5.dirname(secretsFile), { recursive: true, force: true });
|
|
5651
5778
|
}
|
|
5652
5779
|
if (!done.started) throw new DeployError(`${done.out} Nothing on the backend was changed.`);
|
|
5653
5780
|
if (done.status !== 0) throw new DeployError("wrangler deploy failed (above). Nothing on the backend was changed.");
|
|
@@ -5662,6 +5789,9 @@ async function main(argv) {
|
|
|
5662
5789
|
if (e instanceof DeployError || e instanceof ApiDeployError || e?.name === "ApplyError") {
|
|
5663
5790
|
process.stderr.write(`
|
|
5664
5791
|
${e.message}
|
|
5792
|
+
`);
|
|
5793
|
+
process.stderr.write(`
|
|
5794
|
+
Help with this step: ${guideLink(stage ?? void 0)}
|
|
5665
5795
|
`);
|
|
5666
5796
|
return 1;
|
|
5667
5797
|
}
|