@next-core/brick-container 3.24.17 → 3.25.1
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.html +1 -1
- package/dist/main.713586ae.js +2 -0
- package/dist/{main.8930f0b2.js.map → main.713586ae.js.map} +1 -1
- package/dist/{polyfill.cab80574.js → polyfill.7bd3acdf.js} +1 -1
- package/package.json +2 -2
- package/serve/env.js +66 -1
- package/serve/index.js +4 -0
- package/serve/localProxy.js +82 -0
- package/serve/tokenManager.js +209 -0
- package/dist/main.8930f0b2.js +0 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@next-core/brick-container",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.25.1",
|
|
4
4
|
"description": "Brick Container Server",
|
|
5
5
|
"homepage": "https://github.com/easyops-cn/next-core/tree/v3/packages/brick-container",
|
|
6
6
|
"license": "GPL-3.0",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"@next-core/runtime": "*",
|
|
76
76
|
"@next-core/utils": "*"
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "75a534c3ddc816eb364a3f8141ef3c2c307badf6"
|
|
79
79
|
}
|
package/serve/env.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { existsSync } from "node:fs";
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import meow from "meow";
|
|
4
4
|
import chalk from "chalk";
|
|
5
5
|
import glob from "glob";
|
|
6
|
+
import yaml from "js-yaml";
|
|
6
7
|
import { getLocalBrickPackageNames } from "@next-core/serve-helpers";
|
|
7
8
|
import { getSizeCheckApp } from "./utils/sizeCheck.js";
|
|
8
9
|
|
|
@@ -24,7 +25,9 @@ const cli = meow(
|
|
|
24
25
|
--live-reload Enable live reload (currently only for local micro-apps)
|
|
25
26
|
--size-check Enable size-check mode
|
|
26
27
|
--cookie-same-site-none Append "Same-Site: none" for cookies
|
|
28
|
+
--https Enable serving by https (auto-generates self-signed cert if missing)
|
|
27
29
|
--verbose Print verbose logs
|
|
30
|
+
--proxy-config Specify custom proxy config file path (defaults to "dev.proxy.yaml" in project root)
|
|
28
31
|
--help Show help message
|
|
29
32
|
--version Show brick container version
|
|
30
33
|
`,
|
|
@@ -72,9 +75,15 @@ const cli = meow(
|
|
|
72
75
|
sizeCheck: {
|
|
73
76
|
type: "boolean",
|
|
74
77
|
},
|
|
78
|
+
https: {
|
|
79
|
+
type: "boolean",
|
|
80
|
+
},
|
|
75
81
|
verbose: {
|
|
76
82
|
type: "boolean",
|
|
77
83
|
},
|
|
84
|
+
proxyConfig: {
|
|
85
|
+
type: "string",
|
|
86
|
+
},
|
|
78
87
|
},
|
|
79
88
|
allowUnknownFlags: false,
|
|
80
89
|
}
|
|
@@ -123,6 +132,26 @@ export async function getEnv(rootDir, runtimeFlags) {
|
|
|
123
132
|
}
|
|
124
133
|
}
|
|
125
134
|
|
|
135
|
+
if (!https && flags.https) {
|
|
136
|
+
const keyPath = path.join(rootDir, "dev-https.key");
|
|
137
|
+
const certPath = path.join(rootDir, "dev-https.cert");
|
|
138
|
+
|
|
139
|
+
if (!existsSync(keyPath) || !existsSync(certPath)) {
|
|
140
|
+
const { execSync } = await import("node:child_process");
|
|
141
|
+
const san = `DNS:localhost${flags.host !== "localhost" ? ",IP:" + flags.host : ""}`;
|
|
142
|
+
console.log(chalk.cyan("Auto-generating self-signed certificate..."));
|
|
143
|
+
execSync(
|
|
144
|
+
`openssl req -x509 -newkey rsa:2048 -keyout "${keyPath}" -out "${certPath}" -days 365 -nodes -subj "/CN=localhost" -addext "subjectAltName=${san}"`,
|
|
145
|
+
{ stdio: "inherit" }
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
https = {
|
|
150
|
+
key: readFileSync(keyPath, "utf8"),
|
|
151
|
+
cert: readFileSync(certPath, "utf8"),
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
|
|
126
155
|
const env = {
|
|
127
156
|
rootDir,
|
|
128
157
|
useSubdir: flags.subdir,
|
|
@@ -159,6 +188,7 @@ export async function getEnv(rootDir, runtimeFlags) {
|
|
|
159
188
|
sizeCheck: flags.sizeCheck,
|
|
160
189
|
sizeCheckFilter,
|
|
161
190
|
verbose: flags.verbose,
|
|
191
|
+
localProxies: getLocalProxies(rootDir, flags.proxyConfig),
|
|
162
192
|
};
|
|
163
193
|
|
|
164
194
|
env.localMocks = localMocks?.map((mock) => ({
|
|
@@ -222,9 +252,44 @@ export async function getEnv(rootDir, runtimeFlags) {
|
|
|
222
252
|
env.useRemote || !env.useLocalContainer ? env.server : "N/A"
|
|
223
253
|
);
|
|
224
254
|
|
|
255
|
+
if (
|
|
256
|
+
env.localProxies.proxies &&
|
|
257
|
+
Object.keys(env.localProxies.proxies).length > 0
|
|
258
|
+
) {
|
|
259
|
+
console.log();
|
|
260
|
+
console.log("local proxies:", env.localProxies.proxies);
|
|
261
|
+
if (env.localProxies.auth) {
|
|
262
|
+
console.log(
|
|
263
|
+
"local proxy auth: clientId=%s, org=%s, user=%s",
|
|
264
|
+
env.localProxies.auth.clientId,
|
|
265
|
+
env.localProxies.auth.org,
|
|
266
|
+
env.localProxies.auth.user
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
225
271
|
return env;
|
|
226
272
|
}
|
|
227
273
|
|
|
274
|
+
function getLocalProxies(rootDir, customPath) {
|
|
275
|
+
const proxyConfigPath = customPath
|
|
276
|
+
? path.resolve(customPath)
|
|
277
|
+
: path.join(rootDir, "dev.proxy.yaml");
|
|
278
|
+
if (existsSync(proxyConfigPath)) {
|
|
279
|
+
console.log(chalk.cyan("proxy config:"), proxyConfigPath);
|
|
280
|
+
const content = yaml.load(readFileSync(proxyConfigPath, "utf8"));
|
|
281
|
+
if (!content) return {};
|
|
282
|
+
if (content.proxies) {
|
|
283
|
+
return content;
|
|
284
|
+
}
|
|
285
|
+
return { proxies: content };
|
|
286
|
+
}
|
|
287
|
+
if (customPath) {
|
|
288
|
+
console.error(chalk.red("proxy config not found:"), proxyConfigPath);
|
|
289
|
+
}
|
|
290
|
+
return {};
|
|
291
|
+
}
|
|
292
|
+
|
|
228
293
|
function getServerPath(server) {
|
|
229
294
|
if (server) {
|
|
230
295
|
if (!server.startsWith("http://") && !server.startsWith("https://")) {
|
package/serve/index.js
CHANGED
|
@@ -16,6 +16,7 @@ import {
|
|
|
16
16
|
getPreMiddlewares,
|
|
17
17
|
} from "./middlewares/getMiddlewares.js";
|
|
18
18
|
import liveReloadServer from "./utils/liveReloadServer.js";
|
|
19
|
+
import { setupLocalProxies } from "./localProxy.js";
|
|
19
20
|
|
|
20
21
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
21
22
|
|
|
@@ -55,6 +56,9 @@ for (const middleware of middlewares) {
|
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
58
|
|
|
59
|
+
// Register local service proxies before remote proxies.
|
|
60
|
+
setupLocalProxies(app, env);
|
|
61
|
+
|
|
58
62
|
const proxy = getProxy(env, getRawIndexHtml);
|
|
59
63
|
|
|
60
64
|
const browseHappyHtml = "browse-happy.html";
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { createProxyMiddleware } from "http-proxy-middleware";
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
import { getToken } from "./tokenManager.js";
|
|
4
|
+
|
|
5
|
+
export function setupLocalProxies(app, env) {
|
|
6
|
+
const config = env.localProxies;
|
|
7
|
+
if (!config || !config.proxies || Object.keys(config.proxies).length === 0) {
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const { proxies, auth } = config;
|
|
12
|
+
const org = auth && auth.org;
|
|
13
|
+
const user = auth && auth.user;
|
|
14
|
+
const serverUrl = env.server;
|
|
15
|
+
|
|
16
|
+
if (auth && !auth.token) {
|
|
17
|
+
getToken(serverUrl, auth).catch((e) =>
|
|
18
|
+
console.error(
|
|
19
|
+
chalk.red("[local-proxy]"),
|
|
20
|
+
"Token pre-warm failed:",
|
|
21
|
+
e.message
|
|
22
|
+
)
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
for (const [pathPattern, target] of Object.entries(proxies)) {
|
|
27
|
+
const gatewayPath = pathPattern.startsWith("/")
|
|
28
|
+
? pathPattern
|
|
29
|
+
: `/api/gateway/${pathPattern}`;
|
|
30
|
+
const fullPath = `${env.baseHref}${gatewayPath.slice(1)}`;
|
|
31
|
+
|
|
32
|
+
const proxy = createProxyMiddleware({
|
|
33
|
+
target,
|
|
34
|
+
secure: false,
|
|
35
|
+
changeOrigin: true,
|
|
36
|
+
logger: {
|
|
37
|
+
info() {},
|
|
38
|
+
warn(...args) {
|
|
39
|
+
return console.warn(...args);
|
|
40
|
+
},
|
|
41
|
+
error(...args) {
|
|
42
|
+
return console.error(...args);
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
pathRewrite: { [`^${fullPath}`]: "" },
|
|
46
|
+
on: {
|
|
47
|
+
proxyReq: (proxyReq) => {
|
|
48
|
+
if (org && !proxyReq.getHeader("org")) {
|
|
49
|
+
proxyReq.setHeader("org", String(org));
|
|
50
|
+
}
|
|
51
|
+
if (user && !proxyReq.getHeader("user")) {
|
|
52
|
+
proxyReq.setHeader("user", user);
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
app.use(fullPath, async (req, res, next) => {
|
|
59
|
+
console.log(
|
|
60
|
+
chalk.cyan("[local-proxy]"),
|
|
61
|
+
chalk.green(pathPattern) + chalk.white(":"),
|
|
62
|
+
chalk.yellow(req.method),
|
|
63
|
+
chalk.white(req.url)
|
|
64
|
+
);
|
|
65
|
+
if (auth) {
|
|
66
|
+
try {
|
|
67
|
+
const token = await getToken(serverUrl, auth);
|
|
68
|
+
if (token) {
|
|
69
|
+
req.headers["authorization"] = `Bearer ${token}`;
|
|
70
|
+
}
|
|
71
|
+
} catch (e) {
|
|
72
|
+
console.error(
|
|
73
|
+
chalk.red("[local-proxy]"),
|
|
74
|
+
"Failed to get token:",
|
|
75
|
+
e.message
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
proxy(req, res, next);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import crypto from "node:crypto";
|
|
2
|
+
import https from "node:https";
|
|
3
|
+
import http from "node:http";
|
|
4
|
+
import { URL } from "node:url";
|
|
5
|
+
import chalk from "chalk";
|
|
6
|
+
|
|
7
|
+
const TOKEN_CACHE_TTL = 1800 * 1000;
|
|
8
|
+
const CREDENTIALS_CACHE_TTL = 3600 * 1000;
|
|
9
|
+
const DEFAULT_APP_ID = "api_gateway";
|
|
10
|
+
const GATEWAY_INNER_PORT = 8107;
|
|
11
|
+
const GATEWAY_SERVICE_PATH = "/api/gateway/user_service.apikey";
|
|
12
|
+
|
|
13
|
+
let _tokenCache = null;
|
|
14
|
+
let _credentialsCache = null;
|
|
15
|
+
|
|
16
|
+
function generateSignature(
|
|
17
|
+
method,
|
|
18
|
+
urlPath,
|
|
19
|
+
query,
|
|
20
|
+
contentType,
|
|
21
|
+
clientId,
|
|
22
|
+
secret,
|
|
23
|
+
timestamp
|
|
24
|
+
) {
|
|
25
|
+
const keyList = Object.keys(query)
|
|
26
|
+
.filter((k) => k !== "signature")
|
|
27
|
+
.sort();
|
|
28
|
+
|
|
29
|
+
const queryParts = [];
|
|
30
|
+
for (const key of keyList) {
|
|
31
|
+
const val = query[key];
|
|
32
|
+
if (Array.isArray(val)) {
|
|
33
|
+
for (const v of val) {
|
|
34
|
+
queryParts.push(`${key}${v}`);
|
|
35
|
+
}
|
|
36
|
+
} else {
|
|
37
|
+
queryParts.push(`${key}${val}`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const data = [
|
|
42
|
+
method,
|
|
43
|
+
urlPath,
|
|
44
|
+
queryParts.join(""),
|
|
45
|
+
contentType,
|
|
46
|
+
clientId,
|
|
47
|
+
secret,
|
|
48
|
+
timestamp,
|
|
49
|
+
].join("\n");
|
|
50
|
+
return crypto.createHmac("sha256", secret).update(data).digest("hex");
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function httpRequest(fullUrl, options, body) {
|
|
54
|
+
return new Promise((resolve, reject) => {
|
|
55
|
+
const parsed = new URL(fullUrl);
|
|
56
|
+
const mod = parsed.protocol === "https:" ? https : http;
|
|
57
|
+
|
|
58
|
+
if (body) {
|
|
59
|
+
options.headers = options.headers || {};
|
|
60
|
+
options.headers["Content-Length"] = Buffer.byteLength(body);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const req = mod.request(
|
|
64
|
+
fullUrl,
|
|
65
|
+
{ ...options, rejectUnauthorized: false, timeout: 30000 },
|
|
66
|
+
(res) => {
|
|
67
|
+
let data = "";
|
|
68
|
+
res.on("data", (chunk) => (data += chunk));
|
|
69
|
+
res.on("end", () => {
|
|
70
|
+
if (res.statusCode !== 200) {
|
|
71
|
+
return reject(new Error(`HTTP ${res.statusCode}: ${data}`));
|
|
72
|
+
}
|
|
73
|
+
try {
|
|
74
|
+
resolve(JSON.parse(data));
|
|
75
|
+
} catch (e) {
|
|
76
|
+
reject(new Error(`JSON parse error: ${e.message}`));
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
req.on("error", (e) => reject(new Error(`network error: ${e.message}`)));
|
|
82
|
+
req.on("timeout", () => {
|
|
83
|
+
req.destroy();
|
|
84
|
+
reject(new Error("request timeout"));
|
|
85
|
+
});
|
|
86
|
+
req.end(body || undefined);
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function getInnerGatewayUrl(serverUrl) {
|
|
91
|
+
const parsed = new URL(serverUrl);
|
|
92
|
+
return `http://${parsed.hostname}:${GATEWAY_INNER_PORT}${GATEWAY_SERVICE_PATH}`;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
async function createServerApiKey(serverUrl, clientId) {
|
|
96
|
+
const now = Date.now();
|
|
97
|
+
if (_credentialsCache && now < _credentialsCache.expireAt) {
|
|
98
|
+
return _credentialsCache.value;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const timestamp = String(Math.floor(now / 1000));
|
|
102
|
+
const servicePath = "/api/v1/apikey/server";
|
|
103
|
+
const signature = generateSignature(
|
|
104
|
+
"POST",
|
|
105
|
+
servicePath,
|
|
106
|
+
{},
|
|
107
|
+
"application/json",
|
|
108
|
+
clientId,
|
|
109
|
+
clientId,
|
|
110
|
+
timestamp
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
const baseUrl = getInnerGatewayUrl(serverUrl);
|
|
114
|
+
const fullUrl = `${baseUrl}${servicePath}`;
|
|
115
|
+
console.log(
|
|
116
|
+
chalk.cyan("[token-manager]"),
|
|
117
|
+
"Creating server apikey for",
|
|
118
|
+
clientId,
|
|
119
|
+
"(via inner port)"
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
const data = await httpRequest(
|
|
123
|
+
fullUrl,
|
|
124
|
+
{
|
|
125
|
+
method: "POST",
|
|
126
|
+
headers: {
|
|
127
|
+
"Content-Type": "application/json",
|
|
128
|
+
"X-Timestamp": timestamp,
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
JSON.stringify({ clientId, signature })
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
const secret = data.data?.secret;
|
|
135
|
+
if (!secret) {
|
|
136
|
+
throw new Error(
|
|
137
|
+
`CreateServerApiKey: unexpected response: ${JSON.stringify(data)}`
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const value = { clientId, secret };
|
|
142
|
+
_credentialsCache = { value, expireAt: now + CREDENTIALS_CACHE_TTL };
|
|
143
|
+
return value;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
async function requestToken(serverUrl, clientId, secret, user, org) {
|
|
147
|
+
const timestamp = String(Math.floor(Date.now() / 1000));
|
|
148
|
+
const servicePath = `/api/v1/apikey/request_token/client_id/${encodeURIComponent(
|
|
149
|
+
clientId
|
|
150
|
+
)}`;
|
|
151
|
+
|
|
152
|
+
const query = { user: user || "defaultUser", org: String(org) };
|
|
153
|
+
query.signature = generateSignature(
|
|
154
|
+
"GET",
|
|
155
|
+
servicePath,
|
|
156
|
+
query,
|
|
157
|
+
"",
|
|
158
|
+
clientId,
|
|
159
|
+
secret,
|
|
160
|
+
timestamp
|
|
161
|
+
);
|
|
162
|
+
|
|
163
|
+
const qs = Object.entries(query)
|
|
164
|
+
.map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`)
|
|
165
|
+
.join("&");
|
|
166
|
+
|
|
167
|
+
const baseUrl = getInnerGatewayUrl(serverUrl);
|
|
168
|
+
const fullUrl = `${baseUrl}${servicePath}?${qs}`;
|
|
169
|
+
const data = await httpRequest(fullUrl, {
|
|
170
|
+
method: "GET",
|
|
171
|
+
headers: { "X-Timestamp": timestamp },
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
if (data.code !== 0 || !data.data) {
|
|
175
|
+
throw new Error(
|
|
176
|
+
`RequestToken: unexpected response: ${JSON.stringify(data)}`
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
return data.data.token || "";
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export async function getToken(serverUrl, auth) {
|
|
183
|
+
if (auth.token) {
|
|
184
|
+
return auth.token;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
const appId = auth.appId || DEFAULT_APP_ID;
|
|
188
|
+
const clientId = `easyops_server_${appId}`;
|
|
189
|
+
|
|
190
|
+
const now = Date.now();
|
|
191
|
+
if (_tokenCache && now < _tokenCache.expireAt) {
|
|
192
|
+
return _tokenCache.token;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
const creds = await createServerApiKey(serverUrl, clientId);
|
|
196
|
+
const token = await requestToken(
|
|
197
|
+
serverUrl,
|
|
198
|
+
creds.clientId,
|
|
199
|
+
creds.secret,
|
|
200
|
+
auth.user,
|
|
201
|
+
auth.org
|
|
202
|
+
);
|
|
203
|
+
_tokenCache = { token, expireAt: now + TOKEN_CACHE_TTL };
|
|
204
|
+
console.log(
|
|
205
|
+
chalk.green("[token-manager]"),
|
|
206
|
+
"Token acquired, cached for 30 minutes"
|
|
207
|
+
);
|
|
208
|
+
return token;
|
|
209
|
+
}
|
package/dist/main.8930f0b2.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";var e,t,r,n,o,a,i,l,u,c,s,f,d,h,p,m,b,v,y,g,x,w,_,k,S,j={2585:()=>{},4861:(e,t,r)=>{r.a(e,(async(e,t)=>{try{if(r(2585),r(6118),r(8898),window.BRICK_NEXT_VERSIONS={"brick-container":"3.24.17"},window.MOCK_DATE)try{const{set:e}=await r.e(621).then(r.t.bind(r,3132,23));e(window.MOCK_DATE)}catch(e){console.error("Mock date failed:",e)}r.e(668).then(r.bind(r,5046)),t()}catch(e){t(e)}}),1)},6118:()=>{},8898:()=>{}},E={};function O(e){var t=E[e];if(void 0!==t)return t.exports;var r=E[e]={id:e,loaded:!1,exports:{}};return j[e].call(r.exports,r,r.exports,O),r.loaded=!0,r.exports}O.m=j,O.c=E,e="function"==typeof Symbol?Symbol("webpack queues"):"__webpack_queues__",t="function"==typeof Symbol?Symbol("webpack exports"):"__webpack_exports__",r="function"==typeof Symbol?Symbol("webpack error"):"__webpack_error__",n=e=>{e&&e.d<1&&(e.d=1,e.forEach((e=>e.r--)),e.forEach((e=>e.r--?e.r++:e())))},O.a=(o,a,i)=>{var l;i&&((l=[]).d=-1);var u,c,s,f=new Set,d=o.exports,h=new Promise(((e,t)=>{s=t,c=e}));h[t]=d,h[e]=e=>(l&&e(l),f.forEach(e),h.catch((e=>{}))),o.exports=h,a((o=>{var a;u=(o=>o.map((o=>{if(null!==o&&"object"==typeof o){if(o[e])return o;if(o.then){var a=[];a.d=0,o.then((e=>{i[t]=e,n(a)}),(e=>{i[r]=e,n(a)}));var i={};return i[e]=e=>e(a),i}}var l={};return l[e]=e=>{},l[t]=o,l})))(o);var i=()=>u.map((e=>{if(e[r])throw e[r];return e[t]})),c=new Promise((t=>{(a=()=>t(i)).r=0;var r=e=>e!==l&&!f.has(e)&&(f.add(e),e&&!e.d&&(a.r++,e.push(a)));u.map((t=>t[e](r)))}));return a.r?c:i()}),(e=>(e?s(h[r]=e):c(d),n(l)))),l&&l.d<0&&(l.d=0)},O.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return O.d(t,{a:t}),t},a=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,O.t=function(e,t){if(1&t&&(e=this(e)),8&t)return e;if("object"==typeof e&&e){if(4&t&&e.__esModule)return e;if(16&t&&"function"==typeof e.then)return e}var r=Object.create(null);O.r(r);var n={};o=o||[null,a({}),a([]),a(a)];for(var i=2&t&&e;"object"==typeof i&&!~o.indexOf(i);i=a(i))Object.getOwnPropertyNames(i).forEach((t=>n[t]=()=>e[t]));return n.default=()=>e,O.d(r,n),r},O.d=(e,t)=>{for(var r in t)O.o(t,r)&&!O.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},O.f={},O.e=e=>Promise.all(Object.keys(O.f).reduce(((t,r)=>(O.f[r](e,t),t)),[])),O.u=e=>({621:"mockdate",668:"all"}[e]+"."+{621:"85073b97",668:"cdbcb286"}[e]+".js"),O.miniCssF=e=>"all.ae8498c8.css",O.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),O.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i={},l="@next-core/brick-container:",O.l=(e,t,r,n)=>{if(i[e])i[e].push(t);else{var o,a;if(void 0!==r)for(var u=document.getElementsByTagName("script"),c=0;c<u.length;c++){var s=u[c];if(s.getAttribute("src")==e||s.getAttribute("data-webpack")==l+r){o=s;break}}o||(a=!0,(o=document.createElement("script")).charset="utf-8",o.timeout=120,O.nc&&o.setAttribute("nonce",O.nc),o.setAttribute("data-webpack",l+r),o.src=e),i[e]=[t];var f=(t,r)=>{o.onerror=o.onload=null,clearTimeout(d);var n=i[e];if(delete i[e],o.parentNode&&o.parentNode.removeChild(o),n&&n.forEach((e=>e(r))),t)return t(r)},d=setTimeout(f.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=f.bind(null,o.onerror),o.onload=f.bind(null,o.onload),a&&document.head.appendChild(o)}},O.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},O.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),O.j=792,(()=>{O.S={};var e={},t={};O.I=(r,n)=>{n||(n=[]);var o=t[r];if(o||(o=t[r]={}),!(n.indexOf(o)>=0)){if(n.push(o),e[r])return e[r];O.o(O.S,r)||(O.S[r]={});var a=O.S[r],i="@next-core/brick-container",l=(e,t,r,n)=>{var o=a[e]=a[e]||{},l=o[t];(!l||!l.loaded&&(!n!=!l.eager?n:i>l.from))&&(o[t]={get:r,from:i,eager:!!n})},u=[];return"default"===r&&(l("@babel/parser","7.27.5",(()=>O.e(668).then((()=>()=>O(6773))))),l("@easyops-cn/brick-next-pipes","0.7.6",(()=>O.e(668).then((()=>()=>O(4306))))),l("@next-core/cook","2.5.14",(()=>O.e(668).then((()=>()=>O(8382))))),l("@next-core/easyops-runtime","0.15.35",(()=>O.e(668).then((()=>()=>O(970))))),l("@next-core/http","1.2.16",(()=>O.e(668).then((()=>()=>O(3032))))),l("@next-core/i18n","1.0.93",(()=>O.e(668).then((()=>()=>O(6319))))),l("@next-core/inject","1.0.65",(()=>O.e(668).then((()=>()=>O(6095))))),l("@next-core/loader","1.6.21",(()=>O.e(668).then((()=>()=>O(9321))))),l("@next-core/pipes","2.0.38",(()=>O.e(668).then((()=>()=>O(8604))))),l("@next-core/runtime","1.72.10",(()=>O.e(668).then((()=>()=>O(4046))))),l("@next-core/supply","2.3.11",(()=>O.e(668).then((()=>()=>O(5702))))),l("@next-core/theme","1.6.1",(()=>O.e(668).then((()=>()=>O(90))))),l("@next-core/utils/general","1.8.11",(()=>O.e(668).then((()=>()=>O(763))))),l("@next-core/utils/storyboard","1.8.11",(()=>O.e(668).then((()=>()=>O(4395))))),l("history","4.10.1",(()=>O.e(668).then((()=>()=>O(9669))))),l("i18next-browser-languagedetector","7.2.2",(()=>O.e(668).then((()=>()=>O(726))))),l("i18next","22.5.1",(()=>O.e(668).then((()=>()=>O(843))))),l("js-yaml","3.14.1",(()=>O.e(668).then((()=>()=>O(9515))))),l("lodash","4.17.21",(()=>O.e(668).then((()=>()=>O(5250))))),l("moment/locale/zh-cn.js","2.30.1",(()=>O.e(668).then((()=>()=>O(1329))))),l("moment","2.30.1",(()=>O.e(668).then((()=>()=>O(9420)))))),e[r]=u.length?Promise.all(u).then((()=>e[r]=1)):1}}})(),(()=>{var e;O.g.importScripts&&(e=O.g.location+"");var t=O.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),O.p=e})(),u=e=>{var t=e=>e.split(".").map((e=>+e==e?+e:e)),r=/^([^-+]+)?(?:-([^+]+))?(?:\+(.+))?$/.exec(e),n=r[1]?t(r[1]):[];return r[2]&&(n.length++,n.push.apply(n,t(r[2]))),r[3]&&(n.push([]),n.push.apply(n,t(r[3]))),n},c=(e,t)=>{e=u(e),t=u(t);for(var r=0;;){if(r>=e.length)return r<t.length&&"u"!=(typeof t[r])[0];var n=e[r],o=(typeof n)[0];if(r>=t.length)return"u"==o;var a=t[r],i=(typeof a)[0];if(o!=i)return"o"==o&&"n"==i||"s"==i||"u"==o;if("o"!=o&&"u"!=o&&n!=a)return n<a;r++}},s=e=>{var t=e[0],r="";if(1===e.length)return"*";if(t+.5){r+=0==t?">=":-1==t?"<":1==t?"^":2==t?"~":t>0?"=":"!=";for(var n=1,o=1;o<e.length;o++)n--,r+="u"==(typeof(i=e[o]))[0]?"-":(n>0?".":"")+(n=2,i);return r}var a=[];for(o=1;o<e.length;o++){var i=e[o];a.push(0===i?"not("+l()+")":1===i?"("+l()+" || "+l()+")":2===i?a.pop()+" "+a.pop():s(i))}return l();function l(){return a.pop().replace(/^\((.+)\)$/,"$1")}},f=(e,t)=>{if(0 in e){t=u(t);var r=e[0],n=r<0;n&&(r=-r-1);for(var o=0,a=1,i=!0;;a++,o++){var l,c,s=a<e.length?(typeof e[a])[0]:"";if(o>=t.length||"o"==(c=(typeof(l=t[o]))[0]))return!i||("u"==s?a>r&&!n:""==s!=n);if("u"==c){if(!i||"u"!=s)return!1}else if(i)if(s==c)if(a<=r){if(l!=e[a])return!1}else{if(n?l>e[a]:l<e[a])return!1;l!=e[a]&&(i=!1)}else if("s"!=s&&"n"!=s){if(n||a<=r)return!1;i=!1,a--}else{if(a<=r||c<s!=n)return!1;i=!1}else"s"!=s&&"n"!=s&&(i=!1,a--)}}var d=[],h=d.pop.bind(d);for(o=1;o<e.length;o++){var p=e[o];d.push(1==p?h()|h():2==p?h()&h():p?f(p,t):!h())}return!!h()},d=(e,t)=>e&&O.o(e,t),h=e=>(e.loaded=1,e.get()),p=e=>Object.keys(e).reduce(((t,r)=>(e[r].eager&&(t[r]=e[r]),t)),{}),m=(e,t,r)=>{var n=r?p(e[t]):e[t];return Object.keys(n).reduce(((e,t)=>!e||!n[e].loaded&&c(e,t)?t:e),0)},b=(e,t,r,n)=>"Unsatisfied version "+r+" from "+(r&&e[t][r].from)+" of shared singleton module "+t+" (required "+s(n)+")",v=e=>{throw new Error(e)},y=e=>{"undefined"!=typeof console&&console.warn&&console.warn(e)},g=(e,t,r)=>r?r():((e,t)=>v("Shared module "+t+" doesn't exist in shared scope "+e))(e,t),x=(e=>function(t,r,n,o,a){var i=O.I(t);return i&&i.then&&!n?i.then(e.bind(e,t,O.S[t],r,!1,o,a)):e(t,O.S[t],r,n,o,a)})(((e,t,r,n,o,a)=>{if(!d(t,r))return g(e,r,a);var i=m(t,r,n);return f(o,i)||y(b(t,r,i,o)),h(t[r][i])})),w={},_={1727:()=>x("default","@next-core/theme",!1,[1,1,6,1],(()=>O.e(668).then((()=>()=>O(90))))),3647:()=>x("default","@next-core/runtime",!1,[0],(()=>O.e(668).then((()=>()=>O(4046))))),7551:()=>x("default","@next-core/http",!1,[0],(()=>O.e(668).then((()=>()=>O(3032))))),8046:()=>x("default","@next-core/i18n",!1,[1,1,0,93],(()=>O.e(668).then((()=>()=>O(6319))))),9755:()=>x("default","@next-core/easyops-runtime",!1,[2,0,15,35],(()=>O.e(668).then((()=>()=>O(970))))),1030:()=>x("default","lodash",!1,[1,4,17,21],(()=>O.e(668).then((()=>()=>O(5250))))),4113:()=>x("default","@next-core/utils/general",!1,[0],(()=>O.e(668).then((()=>()=>O(763))))),1060:()=>x("default","js-yaml",!1,[1,3,14,1],(()=>O.e(668).then((()=>()=>O(9515))))),8577:()=>x("default","@next-core/loader",!1,[1,1,6,21],(()=>O.e(668).then((()=>()=>O(9321))))),5069:()=>x("default","@next-core/utils/storyboard",!1,[0],(()=>O.e(668).then((()=>()=>O(4395))))),1858:()=>x("default","moment/locale/zh-cn.js",!1,[0],(()=>O.e(668).then((()=>()=>O(1329))))),1916:()=>x("default","moment",!1,[0],(()=>O.e(668).then((()=>()=>O(9420))))),5630:()=>x("default","i18next",!1,[0],(()=>O.e(668).then((()=>()=>O(843))))),1732:()=>x("default","history",!1,[0],(()=>O.e(668).then((()=>()=>O(9669))))),848:()=>x("default","i18next-browser-languagedetector",!1,[0],(()=>O.e(668).then((()=>()=>O(726))))),8303:()=>x("default","@next-core/cook",!1,[0],(()=>O.e(668).then((()=>()=>O(8382))))),3575:()=>x("default","@next-core/inject",!1,[0],(()=>O.e(668).then((()=>()=>O(6095))))),8319:()=>x("default","@next-core/supply",!1,[0],(()=>O.e(668).then((()=>()=>O(5702))))),5285:()=>x("default","@next-core/pipes",!1,[0],(()=>O.e(668).then((()=>()=>O(8604))))),580:()=>x("default","@babel/parser",!1,[0],(()=>O.e(668).then((()=>()=>O(6773))))),8377:()=>x("default","@easyops-cn/brick-next-pipes",!1,[0],(()=>O.e(668).then((()=>()=>O(4306)))))},k={668:[1727,3647,7551,8046,9755,1030,4113,1060,8577,5069,1858,1916,5630,1732,848,8303,3575,8319,5285,580,8377]},S={},O.f.consumes=(e,t)=>{O.o(k,e)&&k[e].forEach((e=>{if(O.o(w,e))return t.push(w[e]);if(!S[e]){var r=t=>{w[e]=0,O.m[e]=r=>{delete O.c[e],r.exports=t()}};S[e]=!0;var n=t=>{delete w[e],O.m[e]=r=>{throw delete O.c[e],t}};try{var o=_[e]();o.then?t.push(w[e]=o.then(r).catch(n)):r(o)}catch(e){n(e)}}}))},(()=>{if("undefined"!=typeof document){var e={792:0};O.f.miniCss=(t,r)=>{e[t]?r.push(e[t]):0!==e[t]&&{668:1}[t]&&r.push(e[t]=(e=>new Promise(((t,r)=>{var n=O.miniCssF(e),o=O.p+n;if(((e,t)=>{for(var r=document.getElementsByTagName("link"),n=0;n<r.length;n++){var o=(i=r[n]).getAttribute("data-href")||i.getAttribute("href");if("stylesheet"===i.rel&&(o===e||o===t))return i}var a=document.getElementsByTagName("style");for(n=0;n<a.length;n++){var i;if((o=(i=a[n]).getAttribute("data-href"))===e||o===t)return i}})(n,o))return t();((e,t,r,n,o)=>{var a=document.createElement("link");a.rel="stylesheet",a.type="text/css",O.nc&&(a.nonce=O.nc),a.onerror=a.onload=r=>{if(a.onerror=a.onload=null,"load"===r.type)n();else{var i=r&&r.type,l=r&&r.target&&r.target.href||t,u=new Error("Loading CSS chunk "+e+" failed.\n("+i+": "+l+")");u.name="ChunkLoadError",u.code="CSS_CHUNK_LOAD_FAILED",u.type=i,u.request=l,a.parentNode&&a.parentNode.removeChild(a),o(u)}},a.href=t,document.head.appendChild(a)})(e,o,0,t,r)})))(t).then((()=>{e[t]=0}),(r=>{throw delete e[t],r})))}}})(),(()=>{var e={792:0};O.f.j=(t,r)=>{var n=O.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else{var o=new Promise(((r,o)=>n=e[t]=[r,o]));r.push(n[2]=o);var a=O.p+O.u(t),i=new Error;O.l(a,(r=>{if(O.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var o=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;i.message="Loading chunk "+t+" failed.\n("+o+": "+a+")",i.name="ChunkLoadError",i.type=o,i.request=a,n[1](i)}}),"chunk-"+t,t)}};var t=(t,r)=>{var n,o,[a,i,l]=r,u=0;if(a.some((t=>0!==e[t]))){for(n in i)O.o(i,n)&&(O.m[n]=i[n]);l&&l(O)}for(t&&t(r);u<a.length;u++)o=a[u],O.o(e,o)&&e[o]&&e[o][0](),e[o]=0},r=globalThis.webpackChunk_next_core_brick_container=globalThis.webpackChunk_next_core_brick_container||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})(),O(4861)})();
|
|
2
|
-
//# sourceMappingURL=main.8930f0b2.js.map
|