@heybox/hb-sdk 0.5.16 → 0.5.17
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 +5 -3
- package/dist/cli-chunks/{remote-CdEyGDRq.cjs → context-mav2gs13.cjs} +52 -1583
- package/dist/cli-chunks/{create-DUwSoYT4.cjs → create-CPIjDM-n.cjs} +1 -1
- package/dist/cli-chunks/{dev-78XBGRX3.cjs → dev-Cr2u9ajy.cjs} +126 -31
- package/dist/cli-chunks/{doctor-CHrjGIQ1.cjs → doctor-mIgvLfLl.cjs} +1 -1
- package/dist/cli-chunks/{index-B7Ys8ljY.cjs → index-DHWEoki_.cjs} +3 -3
- package/dist/cli-chunks/{index-B-lA2GE7.cjs → index-Dor8wa6R.cjs} +16 -14
- package/dist/cli-chunks/{login-CP6xdTYa.cjs → login-B63QgKed.cjs} +2 -2
- package/dist/cli-chunks/remote-Dksa9s5M.cjs +1603 -0
- package/dist/cli-chunks/{session-Cfl5cGf8.cjs → session-BMSThs93.cjs} +12 -4
- package/dist/cli.cjs +1 -1
- package/dist/devtools/mock-host/main.js +145 -46
- package/package.json +1 -1
- package/skill/SKILL.md +1 -1
- package/skill/references/api-root.md +4 -2
- package/skill/references/cli.md +3 -3
- package/skill/skill.json +4 -4
|
@@ -5,7 +5,7 @@ var fs = require('node:fs/promises');
|
|
|
5
5
|
var path = require('node:path');
|
|
6
6
|
var require$$0 = require('fs');
|
|
7
7
|
var require$$1 = require('path');
|
|
8
|
-
var index = require('./index-
|
|
8
|
+
var index = require('./index-Dor8wa6R.cjs');
|
|
9
9
|
require('node:module');
|
|
10
10
|
require('os');
|
|
11
11
|
require('readline');
|
|
@@ -9,7 +9,8 @@ var node_url = require('node:url');
|
|
|
9
9
|
var net = require('node:net');
|
|
10
10
|
var node_http = require('node:http');
|
|
11
11
|
var browser = require('./browser-RAy8e8cV.cjs');
|
|
12
|
-
var index = require('./index-
|
|
12
|
+
var index = require('./index-Dor8wa6R.cjs');
|
|
13
|
+
var context = require('./context-mav2gs13.cjs');
|
|
13
14
|
require('node:process');
|
|
14
15
|
require('node:buffer');
|
|
15
16
|
require('node:util');
|
|
@@ -23,6 +24,10 @@ require('events');
|
|
|
23
24
|
require('stream');
|
|
24
25
|
require('buffer');
|
|
25
26
|
require('util');
|
|
27
|
+
require('./session-BMSThs93.cjs');
|
|
28
|
+
require('node:crypto');
|
|
29
|
+
require('fs');
|
|
30
|
+
require('constants');
|
|
26
31
|
|
|
27
32
|
class Locked extends Error {
|
|
28
33
|
constructor(port) {
|
|
@@ -202,7 +207,7 @@ function createPortCandidates(startPort, count) {
|
|
|
202
207
|
}
|
|
203
208
|
|
|
204
209
|
const MINI_PROGRAM_URL_QUERY_PARAM$1 = 'mini_url';
|
|
205
|
-
const
|
|
210
|
+
const MOCK_HOST_BOOTSTRAP_PATH = '/__hb_sdk_bootstrap__';
|
|
206
211
|
const MOCK_NETWORK_PROXY_PATH = '/__hb_sdk_mock_network__';
|
|
207
212
|
const MOCK_NETWORK_PROXY_BODY_LIMIT = 1024 * 1024;
|
|
208
213
|
const DEV_LISTEN_HOST$1 = '0.0.0.0';
|
|
@@ -216,12 +221,17 @@ const MOCK_HOST_ROOT_CANDIDATES = [
|
|
|
216
221
|
async function startMiniProgramMockHostServer(options) {
|
|
217
222
|
const root = options.root ?? resolveMiniProgramMockHostRoot(options.rootCandidates);
|
|
218
223
|
assertCompleteMiniProgramMockHostRoot(root);
|
|
219
|
-
const
|
|
220
|
-
appUrl: options.appUrl,
|
|
224
|
+
const bootstrapJson = serializeMockHostBootstrap({
|
|
221
225
|
defaultLanAddressId: options.defaultLanAddressId,
|
|
222
|
-
fetchImpl: options.fetchImpl ?? fetch,
|
|
223
226
|
lanAddresses: options.lanAddresses ?? [],
|
|
224
227
|
macAppProtocol: options.macAppProtocol,
|
|
228
|
+
nativeAppLaunchUnavailableReason: options.nativeAppLaunchUnavailableReason,
|
|
229
|
+
runtimePermissions: options.runtimePermissions,
|
|
230
|
+
});
|
|
231
|
+
const server = createMiniProgramMockHostServer(root, {
|
|
232
|
+
appUrl: options.appUrl,
|
|
233
|
+
bootstrapJson,
|
|
234
|
+
fetchImpl: options.fetchImpl ?? fetch,
|
|
225
235
|
});
|
|
226
236
|
const port = await listenHttpServer(server, {
|
|
227
237
|
port: options.port,
|
|
@@ -237,8 +247,9 @@ async function startMiniProgramMockHostServer(options) {
|
|
|
237
247
|
port,
|
|
238
248
|
root,
|
|
239
249
|
server,
|
|
240
|
-
url:
|
|
250
|
+
url: createMiniProgramMockHostUrlWithHost({
|
|
241
251
|
appUrl: options.appUrl,
|
|
252
|
+
host: LOCAL_DEV_URL_HOST$1,
|
|
242
253
|
port,
|
|
243
254
|
}),
|
|
244
255
|
};
|
|
@@ -261,12 +272,6 @@ function isCompleteMiniProgramMockHostRoot(root) {
|
|
|
261
272
|
function createMissingMockHostError() {
|
|
262
273
|
return new Error('未找到完整的 hb-sdk mock host 静态产物。请先执行 @heybox/hb-sdk 的 build:mock-host。');
|
|
263
274
|
}
|
|
264
|
-
function createMiniProgramMockHostUrl(options) {
|
|
265
|
-
return createMiniProgramMockHostUrlWithHost({
|
|
266
|
-
...options,
|
|
267
|
-
host: LOCAL_DEV_URL_HOST$1,
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
275
|
function createMiniProgramMockHostNetworkUrls(options) {
|
|
271
276
|
return (options.lanAddresses ?? []).map((address) => createMiniProgramMockHostUrlWithHost({
|
|
272
277
|
appUrl: address.appUrl,
|
|
@@ -279,6 +284,18 @@ function createMiniProgramMockHostUrlWithHost(options) {
|
|
|
279
284
|
url.searchParams.set(MINI_PROGRAM_URL_QUERY_PARAM$1, options.appUrl);
|
|
280
285
|
return url.toString();
|
|
281
286
|
}
|
|
287
|
+
function serializeMockHostBootstrap(bootstrap) {
|
|
288
|
+
const serialized = JSON.stringify(bootstrap);
|
|
289
|
+
if (serialized === undefined) {
|
|
290
|
+
throw new TypeError('Mock host bootstrap must be JSON serializable');
|
|
291
|
+
}
|
|
292
|
+
const serializedBootstrap = JSON.parse(serialized);
|
|
293
|
+
if (bootstrap.runtimePermissions !== undefined &&
|
|
294
|
+
!Object.prototype.hasOwnProperty.call(serializedBootstrap, 'runtimePermissions')) {
|
|
295
|
+
throw new TypeError('Runtime permission snapshot must be JSON serializable');
|
|
296
|
+
}
|
|
297
|
+
return serialized;
|
|
298
|
+
}
|
|
282
299
|
function createMiniProgramMockHostServer(root, runtime) {
|
|
283
300
|
return node_http.createServer(async (request, response) => {
|
|
284
301
|
const requestUrl = new URL(request.url, 'http://localhost');
|
|
@@ -294,12 +311,8 @@ function createMiniProgramMockHostServer(root, runtime) {
|
|
|
294
311
|
response.end();
|
|
295
312
|
return;
|
|
296
313
|
}
|
|
297
|
-
if (pathname ===
|
|
298
|
-
|
|
299
|
-
defaultLanAddressId: runtime.defaultLanAddressId,
|
|
300
|
-
lanAddresses: runtime.lanAddresses,
|
|
301
|
-
macAppProtocol: runtime.macAppProtocol,
|
|
302
|
-
});
|
|
314
|
+
if (pathname === MOCK_HOST_BOOTSTRAP_PATH) {
|
|
315
|
+
writeSerializedJsonResponse(response, 200, runtime.bootstrapJson);
|
|
303
316
|
return;
|
|
304
317
|
}
|
|
305
318
|
if (pathname === MOCK_NETWORK_PROXY_PATH) {
|
|
@@ -488,6 +501,13 @@ function writeJsonResponse(response, status, body) {
|
|
|
488
501
|
});
|
|
489
502
|
response.end(body === undefined ? '' : JSON.stringify(body));
|
|
490
503
|
}
|
|
504
|
+
function writeSerializedJsonResponse(response, status, body) {
|
|
505
|
+
response.writeHead(status, {
|
|
506
|
+
'content-type': 'application/json; charset=utf-8',
|
|
507
|
+
'cache-control': 'no-store',
|
|
508
|
+
});
|
|
509
|
+
response.end(body);
|
|
510
|
+
}
|
|
491
511
|
function safeJsonParse(text) {
|
|
492
512
|
try {
|
|
493
513
|
return JSON.parse(text);
|
|
@@ -589,12 +609,14 @@ function createMobileAppQrPayload(appUrl, options = {}) {
|
|
|
589
609
|
}
|
|
590
610
|
function createMiniProgramDevShellOpenWindowPayload(appUrl, options = {}) {
|
|
591
611
|
const devShellUrl = options.encodeMiniUrl === false
|
|
592
|
-
? createPartiallyEncodedMiniProgramDevShellUrl(appUrl, options
|
|
593
|
-
: createEncodedMiniProgramDevShellUrl(appUrl, options
|
|
612
|
+
? createPartiallyEncodedMiniProgramDevShellUrl(appUrl, options)
|
|
613
|
+
: createEncodedMiniProgramDevShellUrl(appUrl, options);
|
|
614
|
+
const miniProgramId = options.miniProgramId?.trim();
|
|
594
615
|
return {
|
|
595
616
|
protocol_type: 'openWindow',
|
|
596
617
|
full_screen: true,
|
|
597
618
|
mini_program: '1',
|
|
619
|
+
...(miniProgramId ? { mini_program_id: miniProgramId } : {}),
|
|
598
620
|
navigation_bar: {
|
|
599
621
|
title: '',
|
|
600
622
|
},
|
|
@@ -605,18 +627,26 @@ function createMiniProgramDevShellOpenWindowPayload(appUrl, options = {}) {
|
|
|
605
627
|
},
|
|
606
628
|
};
|
|
607
629
|
}
|
|
608
|
-
function createPartiallyEncodedMiniProgramDevShellUrl(appUrl,
|
|
630
|
+
function createPartiallyEncodedMiniProgramDevShellUrl(appUrl, options) {
|
|
609
631
|
let devShellUrl = `${MINI_PROGRAM_DEV_SHELL_URL}?${MINI_PROGRAM_URL_QUERY_PARAM}=${appUrl}`;
|
|
610
|
-
|
|
611
|
-
|
|
632
|
+
const miniProgramId = options.miniProgramId?.trim();
|
|
633
|
+
if (miniProgramId) {
|
|
634
|
+
devShellUrl += `&mini_program_id=${encodeURIComponent(miniProgramId)}`;
|
|
635
|
+
}
|
|
636
|
+
if (hasRuntimeUrl(options.runtimeUrl)) {
|
|
637
|
+
devShellUrl += `&${MINI_PROGRAM_RUNTIME_URL_QUERY_PARAM}=${encodeURIComponent(options.runtimeUrl)}`;
|
|
612
638
|
}
|
|
613
639
|
return devShellUrl;
|
|
614
640
|
}
|
|
615
|
-
function createEncodedMiniProgramDevShellUrl(appUrl,
|
|
641
|
+
function createEncodedMiniProgramDevShellUrl(appUrl, options) {
|
|
616
642
|
const devShellUrl = new URL(MINI_PROGRAM_DEV_SHELL_URL);
|
|
617
643
|
devShellUrl.searchParams.set(MINI_PROGRAM_URL_QUERY_PARAM, appUrl);
|
|
618
|
-
|
|
619
|
-
|
|
644
|
+
const miniProgramId = options.miniProgramId?.trim();
|
|
645
|
+
if (miniProgramId) {
|
|
646
|
+
devShellUrl.searchParams.set('mini_program_id', miniProgramId);
|
|
647
|
+
}
|
|
648
|
+
if (hasRuntimeUrl(options.runtimeUrl)) {
|
|
649
|
+
devShellUrl.searchParams.set(MINI_PROGRAM_RUNTIME_URL_QUERY_PARAM, options.runtimeUrl);
|
|
620
650
|
}
|
|
621
651
|
return devShellUrl.toString();
|
|
622
652
|
}
|
|
@@ -651,6 +681,12 @@ async function runDevCommand(options, runtime = {}) {
|
|
|
651
681
|
port: appPort,
|
|
652
682
|
};
|
|
653
683
|
const projectRoot = findProjectRoot(runtime.cwd ?? process.cwd());
|
|
684
|
+
const devLaunchContext = await loadDevLaunchContext({
|
|
685
|
+
env: runtime.env,
|
|
686
|
+
fetchImpl,
|
|
687
|
+
logger,
|
|
688
|
+
projectRoot,
|
|
689
|
+
});
|
|
654
690
|
const vite = await logger.task('正在加载项目 Vite', () => loadProjectVite(projectRoot), { successText: '已加载项目 Vite' });
|
|
655
691
|
const appServer = await logger.task('正在创建 Vite dev server', () => withManagedDevOutputEnv(() => vite.createServer(createViteServerOptions(projectRoot, resolvedOptions)), runtime.env), { successText: '已创建 Vite dev server' });
|
|
656
692
|
await logger.task('正在启动 Vite dev server', () => appServer.listen(appPort), {
|
|
@@ -662,6 +698,7 @@ async function runDevCommand(options, runtime = {}) {
|
|
|
662
698
|
const lanAddresses = createLanAddressCandidates({
|
|
663
699
|
appUrl,
|
|
664
700
|
interfaces: networkInterfaceSnapshot,
|
|
701
|
+
miniProgramId: devLaunchContext.miniProgramId,
|
|
665
702
|
runtimeUrl: options.runtimeUrl,
|
|
666
703
|
viteNetworkUrls: appServer.resolvedUrls?.network ?? [],
|
|
667
704
|
});
|
|
@@ -674,10 +711,17 @@ async function runDevCommand(options, runtime = {}) {
|
|
|
674
711
|
getPort: getPortImpl,
|
|
675
712
|
defaultLanAddressId: lanAddresses[0]?.id,
|
|
676
713
|
lanAddresses,
|
|
677
|
-
macAppProtocol:
|
|
714
|
+
macAppProtocol: devLaunchContext.miniProgramId
|
|
715
|
+
? createMacAppProtocol(appUrl, {
|
|
716
|
+
miniProgramId: devLaunchContext.miniProgramId,
|
|
717
|
+
runtimeUrl: options.runtimeUrl,
|
|
718
|
+
})
|
|
719
|
+
: undefined,
|
|
720
|
+
nativeAppLaunchUnavailableReason: devLaunchContext.nativeAppLaunchUnavailableReason,
|
|
678
721
|
port: options.mockPort ?? DEFAULT_MOCK_PORT,
|
|
679
722
|
root: runtime.mockHostRoot,
|
|
680
723
|
rootCandidates: runtime.mockHostRootCandidates,
|
|
724
|
+
runtimePermissions: devLaunchContext.runtimePermissions,
|
|
681
725
|
}), { successText: 'Mock runtime host 已启动' });
|
|
682
726
|
}
|
|
683
727
|
catch (error) {
|
|
@@ -688,14 +732,57 @@ async function runDevCommand(options, runtime = {}) {
|
|
|
688
732
|
logger.success('Mock runtime host 已就绪');
|
|
689
733
|
logger.info(`Mock runtime host: ${mockHost.url}`);
|
|
690
734
|
logger.info(`Mini program URL: ${appUrl}`);
|
|
691
|
-
|
|
692
|
-
|
|
735
|
+
if (devLaunchContext.miniProgramId) {
|
|
736
|
+
logger.info('Mac APP: use the button in Mock runtime host');
|
|
737
|
+
logger.info('Mobile APP: scan the QR code in Mock runtime host');
|
|
738
|
+
}
|
|
739
|
+
else {
|
|
740
|
+
logger.warn(`Mac/Mobile APP 真机调试不可用:${devLaunchContext.nativeAppLaunchUnavailableReason}`);
|
|
741
|
+
}
|
|
693
742
|
if (options.open !== false) {
|
|
694
743
|
logger.debug('正在打开浏览器调试页');
|
|
695
744
|
void openUrl(mockHost.url);
|
|
696
745
|
}
|
|
697
746
|
installShutdownHandlers(closers, runtime.process ?? process);
|
|
698
747
|
}
|
|
748
|
+
async function loadDevLaunchContext(options) {
|
|
749
|
+
const miniProgramId = await context.readBoundMiniProgramId(options.projectRoot);
|
|
750
|
+
if (!miniProgramId) {
|
|
751
|
+
const nativeAppLaunchUnavailableReason = '当前项目未绑定小程序。请先运行 hb-sdk remote create 或 hb-sdk remote bind <mini-program-id>。';
|
|
752
|
+
options.logger.warn(`未读取到远端 Runtime 权限,Mock runtime 将默认拒绝受管能力:${nativeAppLaunchUnavailableReason}`);
|
|
753
|
+
return { nativeAppLaunchUnavailableReason };
|
|
754
|
+
}
|
|
755
|
+
try {
|
|
756
|
+
const { detail, miniProgramId: verifiedMiniProgramId } = await options.logger.task('正在读取远端小程序权限', () => context.getBoundMiniProgram({
|
|
757
|
+
cwd: options.projectRoot,
|
|
758
|
+
env: options.env,
|
|
759
|
+
fetchImpl: options.fetchImpl,
|
|
760
|
+
}), { successText: '已读取远端小程序权限' });
|
|
761
|
+
return { miniProgramId: verifiedMiniProgramId, runtimePermissions: detail.runtime_permissions };
|
|
762
|
+
}
|
|
763
|
+
catch (error) {
|
|
764
|
+
if (!canFallbackToDefaultRuntimePermissions(error)) {
|
|
765
|
+
throw error;
|
|
766
|
+
}
|
|
767
|
+
options.logger.warn(`未读取到远端 Runtime 权限,Mock runtime 将默认拒绝受管能力:${index.readErrorMessage(error)}`);
|
|
768
|
+
return {
|
|
769
|
+
nativeAppLaunchUnavailableReason: '当前绑定尚未通过开发者权限验证。请先运行 hb-sdk login,并确认网络可用后重试。',
|
|
770
|
+
};
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
function canFallbackToDefaultRuntimePermissions(error) {
|
|
774
|
+
if (error instanceof context.MiniProgramProjectBindingError) {
|
|
775
|
+
return error.code === 'MINI_PROGRAM_UNBOUND';
|
|
776
|
+
}
|
|
777
|
+
if (error instanceof TypeError && error.message === 'fetch failed') {
|
|
778
|
+
return true;
|
|
779
|
+
}
|
|
780
|
+
if (error instanceof index.CliError) {
|
|
781
|
+
return (error.httpStatus === 429 ||
|
|
782
|
+
(error.httpStatus !== undefined && error.httpStatus >= 500 && error.httpStatus < 600));
|
|
783
|
+
}
|
|
784
|
+
return error instanceof Error && 'code' in error && error.code === 'AUTH_SESSION_MISSING';
|
|
785
|
+
}
|
|
699
786
|
function findProjectRoot(startDir) {
|
|
700
787
|
let current = path.resolve(startDir);
|
|
701
788
|
while (true) {
|
|
@@ -878,6 +965,9 @@ async function closeAll(closers) {
|
|
|
878
965
|
await Promise.allSettled(closers.map((close) => close()));
|
|
879
966
|
}
|
|
880
967
|
function createLanAddressCandidates(options) {
|
|
968
|
+
if (!options.miniProgramId) {
|
|
969
|
+
return [];
|
|
970
|
+
}
|
|
881
971
|
const viteNetworkUrlByHost = new Map(options.viteNetworkUrls
|
|
882
972
|
.map((url) => [readUrlHost(url), url])
|
|
883
973
|
.filter((entry) => Boolean(entry[0])));
|
|
@@ -895,10 +985,15 @@ function createLanAddressCandidates(options) {
|
|
|
895
985
|
};
|
|
896
986
|
const runtimeUrl = rewriteLoopbackUrlHost(options.runtimeUrl, address);
|
|
897
987
|
if (runtimeUrl !== undefined) {
|
|
898
|
-
candidate.mobileAppQrPayload = createMobileAppQrPayload(appUrl, {
|
|
988
|
+
candidate.mobileAppQrPayload = createMobileAppQrPayload(appUrl, {
|
|
989
|
+
miniProgramId: options.miniProgramId,
|
|
990
|
+
runtimeUrl,
|
|
991
|
+
});
|
|
899
992
|
}
|
|
900
993
|
else {
|
|
901
|
-
candidate.mobileAppQrPayload = createMobileAppQrPayload(appUrl
|
|
994
|
+
candidate.mobileAppQrPayload = createMobileAppQrPayload(appUrl, {
|
|
995
|
+
miniProgramId: options.miniProgramId,
|
|
996
|
+
});
|
|
902
997
|
}
|
|
903
998
|
return candidate;
|
|
904
999
|
})
|
|
@@ -4,7 +4,7 @@ var fs$1 = require('node:fs');
|
|
|
4
4
|
var fs = require('node:fs/promises');
|
|
5
5
|
var os = require('node:os');
|
|
6
6
|
var path = require('node:path');
|
|
7
|
-
var index = require('./index-
|
|
7
|
+
var index = require('./index-Dor8wa6R.cjs');
|
|
8
8
|
require('node:module');
|
|
9
9
|
require('path');
|
|
10
10
|
require('os');
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index$2 = require('./index-
|
|
3
|
+
var index$2 = require('./index-Dor8wa6R.cjs');
|
|
4
4
|
var require$$0$2 = require('fs');
|
|
5
5
|
var require$$2$1 = require('crypto');
|
|
6
6
|
var require$$1$2 = require('path');
|
|
7
7
|
var require$$0$3 = require('assert');
|
|
8
8
|
var require$$4$2 = require('events');
|
|
9
9
|
var require$$1$1 = require('util');
|
|
10
|
-
var
|
|
10
|
+
var context$1 = require('./context-mav2gs13.cjs');
|
|
11
11
|
var require$$0$5 = require('net');
|
|
12
12
|
var require$$0$4 = require('url');
|
|
13
13
|
var require$$2$2 = require('http');
|
|
@@ -13707,7 +13707,7 @@ function requireSource () {
|
|
|
13707
13707
|
const ajv_1 = requireAjv$1();
|
|
13708
13708
|
const ajv_formats_1 = requireDist();
|
|
13709
13709
|
const debounceFn = requireDebounceFn();
|
|
13710
|
-
const semver =
|
|
13710
|
+
const semver = context$1.requireSemver();
|
|
13711
13711
|
const onetime = index$2.requireOnetime();
|
|
13712
13712
|
const encryptionAlgorithm = 'aes-256-cbc';
|
|
13713
13713
|
const createPlainObject = () => {
|
|
@@ -234,19 +234,19 @@ function requireArgument () {
|
|
|
234
234
|
|
|
235
235
|
var command = {};
|
|
236
236
|
|
|
237
|
-
const require$5 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-
|
|
237
|
+
const require$5 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-Dor8wa6R.cjs', document.baseURI).href)));
|
|
238
238
|
function __require$4() { return require$5("node:events"); }
|
|
239
239
|
|
|
240
|
-
const require$4 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-
|
|
240
|
+
const require$4 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-Dor8wa6R.cjs', document.baseURI).href)));
|
|
241
241
|
function __require$3() { return require$4("node:child_process"); }
|
|
242
242
|
|
|
243
|
-
const require$3 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-
|
|
243
|
+
const require$3 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-Dor8wa6R.cjs', document.baseURI).href)));
|
|
244
244
|
function __require$2() { return require$3("node:path"); }
|
|
245
245
|
|
|
246
|
-
const require$2 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-
|
|
246
|
+
const require$2 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-Dor8wa6R.cjs', document.baseURI).href)));
|
|
247
247
|
function __require$1() { return require$2("node:fs"); }
|
|
248
248
|
|
|
249
|
-
const require$1 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-
|
|
249
|
+
const require$1 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('cli-chunks/index-Dor8wa6R.cjs', document.baseURI).href)));
|
|
250
250
|
function __require() { return require$1("node:process"); }
|
|
251
251
|
|
|
252
252
|
var help = {};
|
|
@@ -13068,10 +13068,12 @@ async function pathExists$1(filePath) {
|
|
|
13068
13068
|
}
|
|
13069
13069
|
|
|
13070
13070
|
class CliError extends Error {
|
|
13071
|
+
httpStatus;
|
|
13071
13072
|
verboseMessage;
|
|
13072
|
-
constructor(message, verboseMessage) {
|
|
13073
|
+
constructor(message, verboseMessage, options = {}) {
|
|
13073
13074
|
super(message);
|
|
13074
13075
|
this.name = 'CliError';
|
|
13076
|
+
this.httpStatus = options.httpStatus;
|
|
13075
13077
|
this.verboseMessage = verboseMessage;
|
|
13076
13078
|
}
|
|
13077
13079
|
}
|
|
@@ -13094,7 +13096,7 @@ function readErrorMessage(error, options = {}) {
|
|
|
13094
13096
|
}
|
|
13095
13097
|
|
|
13096
13098
|
const CLI_VERSION_PLACEHOLDER = ['__HB', 'SDK', 'CLI', 'VERSION__'].join('_');
|
|
13097
|
-
const BUILT_CLI_VERSION = '0.5.
|
|
13099
|
+
const BUILT_CLI_VERSION = '0.5.17';
|
|
13098
13100
|
const PACKAGE_JSON_CANDIDATES = [
|
|
13099
13101
|
path.resolve(__dirname, '..', '..', 'package.json'),
|
|
13100
13102
|
path.resolve(__dirname, '..', 'package.json'),
|
|
@@ -13411,31 +13413,31 @@ function createCommandLoggerResolver(options) {
|
|
|
13411
13413
|
};
|
|
13412
13414
|
}
|
|
13413
13415
|
const defaultClearLoginStatus = async (...args) => {
|
|
13414
|
-
const { clearLoginStatus } = await Promise.resolve().then(function () { return require('./login-
|
|
13416
|
+
const { clearLoginStatus } = await Promise.resolve().then(function () { return require('./login-B63QgKed.cjs'); });
|
|
13415
13417
|
return clearLoginStatus(...args);
|
|
13416
13418
|
};
|
|
13417
13419
|
const defaultLoginToHeybox = async (...args) => {
|
|
13418
|
-
const { loginToHeybox } = await Promise.resolve().then(function () { return require('./login-
|
|
13420
|
+
const { loginToHeybox } = await Promise.resolve().then(function () { return require('./login-B63QgKed.cjs'); });
|
|
13419
13421
|
return loginToHeybox(...args);
|
|
13420
13422
|
};
|
|
13421
13423
|
const defaultPrintLoginStatus = async (...args) => {
|
|
13422
|
-
const { printLoginStatus } = await Promise.resolve().then(function () { return require('./login-
|
|
13424
|
+
const { printLoginStatus } = await Promise.resolve().then(function () { return require('./login-B63QgKed.cjs'); });
|
|
13423
13425
|
return printLoginStatus(...args);
|
|
13424
13426
|
};
|
|
13425
13427
|
const defaultRunCreateCommand = async (...args) => {
|
|
13426
|
-
const { runCreateCommand } = await Promise.resolve().then(function () { return require('./create-
|
|
13428
|
+
const { runCreateCommand } = await Promise.resolve().then(function () { return require('./create-CPIjDM-n.cjs'); });
|
|
13427
13429
|
return runCreateCommand(...args);
|
|
13428
13430
|
};
|
|
13429
13431
|
const defaultRunDevCommand = async (...args) => {
|
|
13430
|
-
const { runDevCommand } = await Promise.resolve().then(function () { return require('./dev-
|
|
13432
|
+
const { runDevCommand } = await Promise.resolve().then(function () { return require('./dev-Cr2u9ajy.cjs'); });
|
|
13431
13433
|
return runDevCommand(...args);
|
|
13432
13434
|
};
|
|
13433
13435
|
const defaultRunDoctorCommand = async (...args) => {
|
|
13434
|
-
const { runDoctorCommand } = await Promise.resolve().then(function () { return require('./doctor-
|
|
13436
|
+
const { runDoctorCommand } = await Promise.resolve().then(function () { return require('./doctor-mIgvLfLl.cjs'); });
|
|
13435
13437
|
return runDoctorCommand(...args);
|
|
13436
13438
|
};
|
|
13437
13439
|
const defaultRunRemoteCommand = async (...args) => {
|
|
13438
|
-
const { runRemoteCommand } = await Promise.resolve().then(function () { return require('./remote-
|
|
13440
|
+
const { runRemoteCommand } = await Promise.resolve().then(function () { return require('./remote-Dksa9s5M.cjs'); });
|
|
13439
13441
|
return runRemoteCommand(...args);
|
|
13440
13442
|
};
|
|
13441
13443
|
function resolveStandaloneLogger(options, verbose) {
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
var promises = require('node:readline/promises');
|
|
4
4
|
var node_crypto = require('node:crypto');
|
|
5
5
|
var node_http = require('node:http');
|
|
6
|
-
var session = require('./session-
|
|
6
|
+
var session = require('./session-BMSThs93.cjs');
|
|
7
7
|
var browser = require('./browser-RAy8e8cV.cjs');
|
|
8
|
-
var index = require('./index-
|
|
8
|
+
var index = require('./index-Dor8wa6R.cjs');
|
|
9
9
|
require('node:path');
|
|
10
10
|
require('fs');
|
|
11
11
|
require('constants');
|