@dxos/cli 0.5.9-main.1cc8373 → 0.5.9-main.1ea2105
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/oclif.manifest.json +2 -241
- package/package.json +27 -27
- package/dist/src/commands/profile/import.d.ts +0 -20
- package/dist/src/commands/profile/import.d.ts.map +0 -1
- package/dist/src/commands/profile/import.js +0 -95
- package/dist/src/commands/profile/import.js.map +0 -1
- package/dist/src/commands/profile/inspect.d.ts +0 -20
- package/dist/src/commands/profile/inspect.d.ts.map +0 -1
- package/dist/src/commands/profile/inspect.js +0 -63
- package/dist/src/commands/profile/inspect.js.map +0 -1
package/oclif.manifest.json
CHANGED
|
@@ -3605,245 +3605,6 @@
|
|
|
3605
3605
|
"index.js"
|
|
3606
3606
|
]
|
|
3607
3607
|
},
|
|
3608
|
-
"profile:import": {
|
|
3609
|
-
"aliases": [],
|
|
3610
|
-
"args": {},
|
|
3611
|
-
"description": "Import profile.",
|
|
3612
|
-
"flags": {
|
|
3613
|
-
"json": {
|
|
3614
|
-
"description": "Output as JSON.",
|
|
3615
|
-
"name": "json",
|
|
3616
|
-
"allowNo": false,
|
|
3617
|
-
"type": "boolean"
|
|
3618
|
-
},
|
|
3619
|
-
"verbose": {
|
|
3620
|
-
"char": "v",
|
|
3621
|
-
"description": "Verbose output",
|
|
3622
|
-
"name": "verbose",
|
|
3623
|
-
"allowNo": false,
|
|
3624
|
-
"type": "boolean"
|
|
3625
|
-
},
|
|
3626
|
-
"dry-run": {
|
|
3627
|
-
"description": "Dry run.",
|
|
3628
|
-
"name": "dry-run",
|
|
3629
|
-
"allowNo": false,
|
|
3630
|
-
"type": "boolean"
|
|
3631
|
-
},
|
|
3632
|
-
"profile": {
|
|
3633
|
-
"description": "User profile.",
|
|
3634
|
-
"env": "DX_PROFILE",
|
|
3635
|
-
"name": "profile",
|
|
3636
|
-
"default": "default",
|
|
3637
|
-
"hasDynamicHelp": false,
|
|
3638
|
-
"multiple": false,
|
|
3639
|
-
"type": "option"
|
|
3640
|
-
},
|
|
3641
|
-
"config": {
|
|
3642
|
-
"aliases": [
|
|
3643
|
-
"c"
|
|
3644
|
-
],
|
|
3645
|
-
"dependsOn": [
|
|
3646
|
-
"profile"
|
|
3647
|
-
],
|
|
3648
|
-
"description": "Config file.",
|
|
3649
|
-
"env": "DX_CONFIG",
|
|
3650
|
-
"name": "config",
|
|
3651
|
-
"default": "/home/runner/.config/dx/profile/default.yml",
|
|
3652
|
-
"hasDynamicHelp": false,
|
|
3653
|
-
"helpValue": "path",
|
|
3654
|
-
"multiple": false,
|
|
3655
|
-
"type": "option"
|
|
3656
|
-
},
|
|
3657
|
-
"timeout": {
|
|
3658
|
-
"aliases": [
|
|
3659
|
-
"t"
|
|
3660
|
-
],
|
|
3661
|
-
"description": "Timeout (ms).",
|
|
3662
|
-
"name": "timeout",
|
|
3663
|
-
"default": 60000,
|
|
3664
|
-
"hasDynamicHelp": false,
|
|
3665
|
-
"multiple": false,
|
|
3666
|
-
"type": "option"
|
|
3667
|
-
},
|
|
3668
|
-
"target": {
|
|
3669
|
-
"description": "Target websocket server.",
|
|
3670
|
-
"name": "target",
|
|
3671
|
-
"hasDynamicHelp": false,
|
|
3672
|
-
"multiple": false,
|
|
3673
|
-
"type": "option"
|
|
3674
|
-
},
|
|
3675
|
-
"agent": {
|
|
3676
|
-
"description": "Run command with agent.",
|
|
3677
|
-
"env": "DX_NO_AGENT",
|
|
3678
|
-
"name": "agent",
|
|
3679
|
-
"allowNo": true,
|
|
3680
|
-
"type": "boolean"
|
|
3681
|
-
},
|
|
3682
|
-
"json-log": {
|
|
3683
|
-
"description": "When running in foreground, log JSON format",
|
|
3684
|
-
"name": "json-log",
|
|
3685
|
-
"allowNo": false,
|
|
3686
|
-
"type": "boolean"
|
|
3687
|
-
},
|
|
3688
|
-
"json-logfile": {
|
|
3689
|
-
"description": "JSON log file destination, or 'stdout' or 'stderr'",
|
|
3690
|
-
"name": "json-logfile",
|
|
3691
|
-
"default": "stderr",
|
|
3692
|
-
"hasDynamicHelp": false,
|
|
3693
|
-
"multiple": false,
|
|
3694
|
-
"type": "option"
|
|
3695
|
-
},
|
|
3696
|
-
"file": {
|
|
3697
|
-
"description": "Archive filename.",
|
|
3698
|
-
"name": "file",
|
|
3699
|
-
"required": true,
|
|
3700
|
-
"hasDynamicHelp": false,
|
|
3701
|
-
"multiple": false,
|
|
3702
|
-
"type": "option"
|
|
3703
|
-
},
|
|
3704
|
-
"data-dir": {
|
|
3705
|
-
"description": "Storage directory.",
|
|
3706
|
-
"name": "data-dir",
|
|
3707
|
-
"hasDynamicHelp": false,
|
|
3708
|
-
"multiple": false,
|
|
3709
|
-
"type": "option"
|
|
3710
|
-
}
|
|
3711
|
-
},
|
|
3712
|
-
"hasDynamicHelp": false,
|
|
3713
|
-
"hiddenAliases": [],
|
|
3714
|
-
"id": "profile:import",
|
|
3715
|
-
"pluginAlias": "@dxos/cli",
|
|
3716
|
-
"pluginName": "@dxos/cli",
|
|
3717
|
-
"pluginType": "core",
|
|
3718
|
-
"strict": true,
|
|
3719
|
-
"isESM": false,
|
|
3720
|
-
"relativePath": [
|
|
3721
|
-
"dist",
|
|
3722
|
-
"src",
|
|
3723
|
-
"commands",
|
|
3724
|
-
"profile",
|
|
3725
|
-
"import.js"
|
|
3726
|
-
]
|
|
3727
|
-
},
|
|
3728
|
-
"profile:inspect": {
|
|
3729
|
-
"aliases": [],
|
|
3730
|
-
"args": {},
|
|
3731
|
-
"description": "Import profile.",
|
|
3732
|
-
"flags": {
|
|
3733
|
-
"json": {
|
|
3734
|
-
"description": "Output as JSON.",
|
|
3735
|
-
"name": "json",
|
|
3736
|
-
"allowNo": false,
|
|
3737
|
-
"type": "boolean"
|
|
3738
|
-
},
|
|
3739
|
-
"verbose": {
|
|
3740
|
-
"char": "v",
|
|
3741
|
-
"description": "Verbose output",
|
|
3742
|
-
"name": "verbose",
|
|
3743
|
-
"allowNo": false,
|
|
3744
|
-
"type": "boolean"
|
|
3745
|
-
},
|
|
3746
|
-
"dry-run": {
|
|
3747
|
-
"description": "Dry run.",
|
|
3748
|
-
"name": "dry-run",
|
|
3749
|
-
"allowNo": false,
|
|
3750
|
-
"type": "boolean"
|
|
3751
|
-
},
|
|
3752
|
-
"profile": {
|
|
3753
|
-
"description": "User profile.",
|
|
3754
|
-
"env": "DX_PROFILE",
|
|
3755
|
-
"name": "profile",
|
|
3756
|
-
"default": "default",
|
|
3757
|
-
"hasDynamicHelp": false,
|
|
3758
|
-
"multiple": false,
|
|
3759
|
-
"type": "option"
|
|
3760
|
-
},
|
|
3761
|
-
"config": {
|
|
3762
|
-
"aliases": [
|
|
3763
|
-
"c"
|
|
3764
|
-
],
|
|
3765
|
-
"dependsOn": [
|
|
3766
|
-
"profile"
|
|
3767
|
-
],
|
|
3768
|
-
"description": "Config file.",
|
|
3769
|
-
"env": "DX_CONFIG",
|
|
3770
|
-
"name": "config",
|
|
3771
|
-
"default": "/home/runner/.config/dx/profile/default.yml",
|
|
3772
|
-
"hasDynamicHelp": false,
|
|
3773
|
-
"helpValue": "path",
|
|
3774
|
-
"multiple": false,
|
|
3775
|
-
"type": "option"
|
|
3776
|
-
},
|
|
3777
|
-
"timeout": {
|
|
3778
|
-
"aliases": [
|
|
3779
|
-
"t"
|
|
3780
|
-
],
|
|
3781
|
-
"description": "Timeout (ms).",
|
|
3782
|
-
"name": "timeout",
|
|
3783
|
-
"default": 60000,
|
|
3784
|
-
"hasDynamicHelp": false,
|
|
3785
|
-
"multiple": false,
|
|
3786
|
-
"type": "option"
|
|
3787
|
-
},
|
|
3788
|
-
"target": {
|
|
3789
|
-
"description": "Target websocket server.",
|
|
3790
|
-
"name": "target",
|
|
3791
|
-
"hasDynamicHelp": false,
|
|
3792
|
-
"multiple": false,
|
|
3793
|
-
"type": "option"
|
|
3794
|
-
},
|
|
3795
|
-
"agent": {
|
|
3796
|
-
"description": "Run command with agent.",
|
|
3797
|
-
"env": "DX_NO_AGENT",
|
|
3798
|
-
"name": "agent",
|
|
3799
|
-
"allowNo": true,
|
|
3800
|
-
"type": "boolean"
|
|
3801
|
-
},
|
|
3802
|
-
"json-log": {
|
|
3803
|
-
"description": "When running in foreground, log JSON format",
|
|
3804
|
-
"name": "json-log",
|
|
3805
|
-
"allowNo": false,
|
|
3806
|
-
"type": "boolean"
|
|
3807
|
-
},
|
|
3808
|
-
"json-logfile": {
|
|
3809
|
-
"description": "JSON log file destination, or 'stdout' or 'stderr'",
|
|
3810
|
-
"name": "json-logfile",
|
|
3811
|
-
"default": "stderr",
|
|
3812
|
-
"hasDynamicHelp": false,
|
|
3813
|
-
"multiple": false,
|
|
3814
|
-
"type": "option"
|
|
3815
|
-
},
|
|
3816
|
-
"file": {
|
|
3817
|
-
"description": "Archive filename.",
|
|
3818
|
-
"name": "file",
|
|
3819
|
-
"required": true,
|
|
3820
|
-
"hasDynamicHelp": false,
|
|
3821
|
-
"multiple": false,
|
|
3822
|
-
"type": "option"
|
|
3823
|
-
},
|
|
3824
|
-
"storage": {
|
|
3825
|
-
"description": "List storage entries.",
|
|
3826
|
-
"name": "storage",
|
|
3827
|
-
"allowNo": false,
|
|
3828
|
-
"type": "boolean"
|
|
3829
|
-
}
|
|
3830
|
-
},
|
|
3831
|
-
"hasDynamicHelp": false,
|
|
3832
|
-
"hiddenAliases": [],
|
|
3833
|
-
"id": "profile:inspect",
|
|
3834
|
-
"pluginAlias": "@dxos/cli",
|
|
3835
|
-
"pluginName": "@dxos/cli",
|
|
3836
|
-
"pluginType": "core",
|
|
3837
|
-
"strict": true,
|
|
3838
|
-
"isESM": false,
|
|
3839
|
-
"relativePath": [
|
|
3840
|
-
"dist",
|
|
3841
|
-
"src",
|
|
3842
|
-
"commands",
|
|
3843
|
-
"profile",
|
|
3844
|
-
"inspect.js"
|
|
3845
|
-
]
|
|
3846
|
-
},
|
|
3847
3608
|
"shell": {
|
|
3848
3609
|
"aliases": [],
|
|
3849
3610
|
"args": {},
|
|
@@ -5233,7 +4994,7 @@
|
|
|
5233
4994
|
"name": {
|
|
5234
4995
|
"description": "Tunnel name",
|
|
5235
4996
|
"name": "name",
|
|
5236
|
-
"default": "
|
|
4997
|
+
"default": "fillet-batman-berlin-video",
|
|
5237
4998
|
"hasDynamicHelp": false,
|
|
5238
4999
|
"multiple": false,
|
|
5239
5000
|
"type": "option"
|
|
@@ -5866,5 +5627,5 @@
|
|
|
5866
5627
|
]
|
|
5867
5628
|
}
|
|
5868
5629
|
},
|
|
5869
|
-
"version": "0.5.9-main.
|
|
5630
|
+
"version": "0.5.9-main.1ea2105"
|
|
5870
5631
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/cli",
|
|
3
|
-
"version": "0.5.9-main.
|
|
3
|
+
"version": "0.5.9-main.1ea2105",
|
|
4
4
|
"description": "DXOS CLI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dxos",
|
|
@@ -52,32 +52,32 @@
|
|
|
52
52
|
"uuid": "^8.3.2",
|
|
53
53
|
"ws": "^8.14.2",
|
|
54
54
|
"wtfnode": "^0.9.1",
|
|
55
|
-
"@dxos/agent": "0.5.9-main.
|
|
56
|
-
"@dxos/bare-template": "0.5.9-main.
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/client-protocol": "0.5.9-main.
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/client
|
|
63
|
-
"@dxos/config": "0.5.9-main.
|
|
64
|
-
"@dxos/context": "0.5.9-main.
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/functions": "0.5.9-main.
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/
|
|
69
|
-
"@dxos/
|
|
70
|
-
"@dxos/
|
|
71
|
-
"@dxos/
|
|
72
|
-
"@dxos/observability": "0.5.9-main.
|
|
73
|
-
"@dxos/
|
|
74
|
-
"@dxos/
|
|
75
|
-
"@dxos/
|
|
76
|
-
"@dxos/
|
|
77
|
-
"@dxos/
|
|
78
|
-
"@dxos/
|
|
79
|
-
"@dxos/
|
|
80
|
-
"@dxos/util": "0.5.9-main.
|
|
55
|
+
"@dxos/agent": "0.5.9-main.1ea2105",
|
|
56
|
+
"@dxos/bare-template": "0.5.9-main.1ea2105",
|
|
57
|
+
"@dxos/cli-base": "0.5.9-main.1ea2105",
|
|
58
|
+
"@dxos/async": "0.5.9-main.1ea2105",
|
|
59
|
+
"@dxos/cli-composer": "0.5.9-main.1ea2105",
|
|
60
|
+
"@dxos/client-protocol": "0.5.9-main.1ea2105",
|
|
61
|
+
"@dxos/client-services": "0.5.9-main.1ea2105",
|
|
62
|
+
"@dxos/client": "0.5.9-main.1ea2105",
|
|
63
|
+
"@dxos/config": "0.5.9-main.1ea2105",
|
|
64
|
+
"@dxos/context": "0.5.9-main.1ea2105",
|
|
65
|
+
"@dxos/debug": "0.5.9-main.1ea2105",
|
|
66
|
+
"@dxos/functions": "0.5.9-main.1ea2105",
|
|
67
|
+
"@dxos/echo-schema": "0.5.9-main.1ea2105",
|
|
68
|
+
"@dxos/hello-template": "0.5.9-main.1ea2105",
|
|
69
|
+
"@dxos/log": "0.5.9-main.1ea2105",
|
|
70
|
+
"@dxos/network-manager": "0.5.9-main.1ea2105",
|
|
71
|
+
"@dxos/invariant": "0.5.9-main.1ea2105",
|
|
72
|
+
"@dxos/observability": "0.5.9-main.1ea2105",
|
|
73
|
+
"@dxos/node-std": "0.5.9-main.1ea2105",
|
|
74
|
+
"@dxos/plate": "0.5.9-main.1ea2105",
|
|
75
|
+
"@dxos/protocols": "0.5.9-main.1ea2105",
|
|
76
|
+
"@dxos/random": "0.5.9-main.1ea2105",
|
|
77
|
+
"@dxos/process": "0.5.9-main.1ea2105",
|
|
78
|
+
"@dxos/rpc": "0.5.9-main.1ea2105",
|
|
79
|
+
"@dxos/tasks-template": "0.5.9-main.1ea2105",
|
|
80
|
+
"@dxos/util": "0.5.9-main.1ea2105"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@effect/schema": "^0.67.16",
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { BaseCommand } from '../../base';
|
|
2
|
-
export default class Import extends BaseCommand<typeof Import> {
|
|
3
|
-
static description: string;
|
|
4
|
-
static flags: {
|
|
5
|
-
file: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
6
|
-
'data-dir': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
|
-
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
-
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
|
-
'dry-run': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
-
profile: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
-
config: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
-
timeout: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
-
target: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
|
-
agent: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
|
-
'json-log': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
16
|
-
'json-logfile': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
17
|
-
};
|
|
18
|
-
run(): Promise<any>;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=import.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"import.d.ts","sourceRoot":"","sources":["../../../../src/commands/profile/import.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,WAAW,CAAC,OAAO,MAAM,CAAC;IAC5D,OAAgB,WAAW,SAAqB;IAChD,OAAgB,KAAK;;;;;;;;;;;;;MASnB;IAEI,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;CAiD1B"}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
//
|
|
3
|
-
// Copyright 2022 DXOS.org
|
|
4
|
-
//
|
|
5
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
-
}
|
|
11
|
-
Object.defineProperty(o, k2, desc);
|
|
12
|
-
}) : (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
o[k2] = m[k];
|
|
15
|
-
}));
|
|
16
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
-
}) : function(o, v) {
|
|
19
|
-
o["default"] = v;
|
|
20
|
-
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
-
if (mod && mod.__esModule) return mod;
|
|
23
|
-
var result = {};
|
|
24
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
-
__setModuleDefault(result, mod);
|
|
26
|
-
return result;
|
|
27
|
-
};
|
|
28
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
|
-
};
|
|
31
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
-
const core_1 = require("@oclif/core");
|
|
33
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
34
|
-
const fs_1 = require("fs");
|
|
35
|
-
const promises_1 = require("fs/promises");
|
|
36
|
-
const inquirer_1 = require("inquirer");
|
|
37
|
-
const path_1 = require("path");
|
|
38
|
-
const log_1 = require("@dxos/log");
|
|
39
|
-
const base_1 = require("../../base");
|
|
40
|
-
class Import extends base_1.BaseCommand {
|
|
41
|
-
async run() {
|
|
42
|
-
const { profile, file, 'dry-run': dryRun, 'data-dir': storageDir } = this.flags;
|
|
43
|
-
const { createLevel, createStorageObjects, importProfileData, decodeProfileArchive } = await Promise.resolve().then(() => __importStar(require('@dxos/client-services')));
|
|
44
|
-
let storageConfig;
|
|
45
|
-
if (!storageDir) {
|
|
46
|
-
this.log('will overwrite profile', { profile });
|
|
47
|
-
const { confirm } = await (0, inquirer_1.prompt)({
|
|
48
|
-
type: 'confirm',
|
|
49
|
-
name: 'confirm',
|
|
50
|
-
default: false,
|
|
51
|
-
message: (0, chalk_1.default) `{red Delete all data? {white (Profile: ${profile})}}`,
|
|
52
|
-
});
|
|
53
|
-
if (!confirm) {
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
storageConfig = this.clientConfig.get('runtime.client.storage');
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
const fullPath = (0, path_1.resolve)(storageDir);
|
|
60
|
-
this.log('importing into', { path: fullPath });
|
|
61
|
-
storageConfig = {
|
|
62
|
-
persistent: true,
|
|
63
|
-
dataRoot: fullPath,
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
if ((0, fs_1.existsSync)(storageConfig.dataRoot)) {
|
|
67
|
-
log_1.log.error('data directory already exists', { path: storageConfig.dataRoot }, { file: "packages/devtools/cli/src/commands/profile/import.ts", line: 60, scope: this, bugcheck: "If you see this message then it means that the source code preprocessor for @dxos/log is broken. It probably has misinterpreted an unrelated call for a logger invocation.", callSite: (fn, args) => fn(...args) });
|
|
68
|
-
throw new Error('Data directory already exists');
|
|
69
|
-
}
|
|
70
|
-
const data = await (0, promises_1.readFile)(file);
|
|
71
|
-
const archive = decodeProfileArchive(data);
|
|
72
|
-
this.log('importing archive', { entries: archive.storage.length });
|
|
73
|
-
if (dryRun) {
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
const { storage } = createStorageObjects(storageConfig);
|
|
77
|
-
const level = await createLevel(storageConfig);
|
|
78
|
-
this.log('begin profile import', { storageConfig });
|
|
79
|
-
await importProfileData({ storage, level }, archive);
|
|
80
|
-
this.log('done profile import');
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
Import.description = 'Import profile.';
|
|
84
|
-
Import.flags = {
|
|
85
|
-
...base_1.BaseCommand.flags,
|
|
86
|
-
file: core_1.Flags.string({
|
|
87
|
-
description: 'Archive filename.',
|
|
88
|
-
required: true,
|
|
89
|
-
}),
|
|
90
|
-
'data-dir': core_1.Flags.string({
|
|
91
|
-
description: 'Storage directory.',
|
|
92
|
-
}),
|
|
93
|
-
};
|
|
94
|
-
exports.default = Import;
|
|
95
|
-
//# sourceMappingURL=import.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"import.js","sourceRoot":"","sources":["../../../../src/commands/profile/import.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { BaseCommand } from '../../base';
|
|
2
|
-
export default class Inspect extends BaseCommand<typeof Inspect> {
|
|
3
|
-
static description: string;
|
|
4
|
-
static flags: {
|
|
5
|
-
file: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
6
|
-
storage: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
-
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
-
verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
|
-
'dry-run': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
-
profile: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
-
config: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
-
timeout: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
-
target: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
|
-
agent: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
|
-
'json-log': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
16
|
-
'json-logfile': import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
17
|
-
};
|
|
18
|
-
run(): Promise<any>;
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=inspect.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../../../src/commands/profile/inspect.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,WAAW,CAAC,OAAO,OAAO,CAAC;IAC9D,OAAgB,WAAW,SAAqB;IAChD,OAAgB,KAAK;;;;;;;;;;;;;MAUnB;IAEI,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;CAoB1B"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
//
|
|
3
|
-
// Copyright 2022 DXOS.org
|
|
4
|
-
//
|
|
5
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
-
}
|
|
11
|
-
Object.defineProperty(o, k2, desc);
|
|
12
|
-
}) : (function(o, m, k, k2) {
|
|
13
|
-
if (k2 === undefined) k2 = k;
|
|
14
|
-
o[k2] = m[k];
|
|
15
|
-
}));
|
|
16
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
-
}) : function(o, v) {
|
|
19
|
-
o["default"] = v;
|
|
20
|
-
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
-
if (mod && mod.__esModule) return mod;
|
|
23
|
-
var result = {};
|
|
24
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
-
__setModuleDefault(result, mod);
|
|
26
|
-
return result;
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const core_1 = require("@oclif/core");
|
|
30
|
-
const promises_1 = require("fs/promises");
|
|
31
|
-
const protocols_1 = require("@dxos/protocols");
|
|
32
|
-
const util_1 = require("@dxos/util");
|
|
33
|
-
const base_1 = require("../../base");
|
|
34
|
-
class Inspect extends base_1.BaseCommand {
|
|
35
|
-
async run() {
|
|
36
|
-
const { file, storage } = this.flags;
|
|
37
|
-
const { decodeProfileArchive } = await Promise.resolve().then(() => __importStar(require('@dxos/client-services')));
|
|
38
|
-
const data = await (0, promises_1.readFile)(file);
|
|
39
|
-
const archive = decodeProfileArchive(data);
|
|
40
|
-
console.log(archive.meta);
|
|
41
|
-
if (storage) {
|
|
42
|
-
console.log('\nStorage entires:\n');
|
|
43
|
-
for (const entry of archive.storage) {
|
|
44
|
-
const key = typeof entry.key === 'string' ? entry.key : JSON.stringify((0, util_1.arrayToBuffer)(entry.key).toString()).slice(1, -1);
|
|
45
|
-
console.log(` ${protocols_1.ProfileArchiveEntryType[entry.type]} ${key}`);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
Inspect.description = 'Import profile.';
|
|
51
|
-
Inspect.flags = {
|
|
52
|
-
...base_1.BaseCommand.flags,
|
|
53
|
-
file: core_1.Flags.string({
|
|
54
|
-
description: 'Archive filename.',
|
|
55
|
-
required: true,
|
|
56
|
-
}),
|
|
57
|
-
storage: core_1.Flags.boolean({
|
|
58
|
-
description: 'List storage entries.',
|
|
59
|
-
default: false,
|
|
60
|
-
}),
|
|
61
|
-
};
|
|
62
|
-
exports.default = Inspect;
|
|
63
|
-
//# sourceMappingURL=inspect.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inspect.js","sourceRoot":"","sources":["../../../../src/commands/profile/inspect.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,sCAAoC;AACpC,0CAAuC;AAEvC,+CAA0D;AAC1D,qCAA2C;AAE3C,qCAAyC;AAEzC,MAAqB,OAAQ,SAAQ,kBAA2B;IAc9D,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAErC,MAAM,EAAE,oBAAoB,EAAE,GAAG,wDAAa,uBAAuB,GAAC,CAAC;QAEvE,MAAM,IAAI,GAAG,MAAM,IAAA,mBAAQ,EAAC,IAAI,CAAC,CAAC;QAClC,MAAM,OAAO,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAE3C,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAE1B,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;YACpC,KAAK,MAAM,KAAK,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;gBACpC,MAAM,GAAG,GACP,OAAO,KAAK,CAAC,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAA,oBAAa,EAAC,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;gBAE/G,OAAO,CAAC,GAAG,CAAC,KAAK,mCAAuB,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC;YACjE,CAAC;QACH,CAAC;IACH,CAAC;;AAhCe,mBAAW,GAAG,iBAAiB,CAAC;AAChC,aAAK,GAAG;IACtB,GAAG,kBAAW,CAAC,KAAK;IACpB,IAAI,EAAE,YAAK,CAAC,MAAM,CAAC;QACjB,WAAW,EAAE,mBAAmB;QAChC,QAAQ,EAAE,IAAI;KACf,CAAC;IACF,OAAO,EAAE,YAAK,CAAC,OAAO,CAAC;QACrB,WAAW,EAAE,uBAAuB;QACpC,OAAO,EAAE,KAAK;KACf,CAAC;CACH,CAAC;kBAZiB,OAAO"}
|