@dcl/opscli 1.0.0-1824565127.commit-b293887 → 1.0.0-18911655998.commit-4d154df
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 +148 -1
- package/dist/bin.d.ts.map +1 -1
- package/dist/bin.js +35 -8
- package/dist/bin.js.map +1 -1
- package/dist/commands/check-ab-conversion.d.ts +3 -0
- package/dist/commands/check-ab-conversion.d.ts.map +1 -0
- package/dist/commands/check-ab-conversion.js +66 -0
- package/dist/commands/check-ab-conversion.js.map +1 -0
- package/dist/commands/circleci.d.ts +2 -0
- package/dist/commands/circleci.d.ts.map +1 -0
- package/dist/commands/circleci.js +33 -0
- package/dist/commands/circleci.js.map +1 -0
- package/dist/commands/concat-snapshots.d.ts +3 -0
- package/dist/commands/concat-snapshots.d.ts.map +1 -0
- package/dist/commands/concat-snapshots.js +69 -0
- package/dist/commands/concat-snapshots.js.map +1 -0
- package/dist/commands/deploy-entity.d.ts +3 -0
- package/dist/commands/deploy-entity.d.ts.map +1 -0
- package/dist/commands/deploy-entity.js +90 -0
- package/dist/commands/deploy-entity.js.map +1 -0
- package/dist/commands/download-entity.d.ts +3 -0
- package/dist/commands/download-entity.d.ts.map +1 -0
- package/dist/commands/download-entity.js +50 -0
- package/dist/commands/download-entity.js.map +1 -0
- package/dist/commands/parameters-manager.d.ts +2 -0
- package/dist/commands/parameters-manager.d.ts.map +1 -0
- package/dist/commands/parameters-manager.js +56 -0
- package/dist/commands/parameters-manager.js.map +1 -0
- package/dist/commands/pointer-consistency.d.ts.map +1 -1
- package/dist/commands/pointer-consistency.js +54 -13
- package/dist/commands/pointer-consistency.js.map +1 -1
- package/dist/commands/query-rollout.js +10 -10
- package/dist/commands/query-rollout.js.map +1 -1
- package/dist/commands/queue-ab-conversion-about.d.ts +3 -0
- package/dist/commands/queue-ab-conversion-about.d.ts.map +1 -0
- package/dist/commands/queue-ab-conversion-about.js +61 -0
- package/dist/commands/queue-ab-conversion-about.js.map +1 -0
- package/dist/commands/queue-ab-conversion-snapshot.d.ts +3 -0
- package/dist/commands/queue-ab-conversion-snapshot.d.ts.map +1 -0
- package/dist/commands/queue-ab-conversion-snapshot.js +228 -0
- package/dist/commands/queue-ab-conversion-snapshot.js.map +1 -0
- package/dist/commands/queue-ab-conversion.d.ts +3 -0
- package/dist/commands/queue-ab-conversion.d.ts.map +1 -0
- package/dist/commands/queue-ab-conversion.js +80 -0
- package/dist/commands/queue-ab-conversion.js.map +1 -0
- package/dist/commands/secret-manager.d.ts +2 -0
- package/dist/commands/secret-manager.d.ts.map +1 -0
- package/dist/commands/secret-manager.js +73 -0
- package/dist/commands/secret-manager.js.map +1 -0
- package/dist/commands/update-renderer-upm.d.ts +3 -0
- package/dist/commands/update-renderer-upm.d.ts.map +1 -0
- package/dist/commands/update-renderer-upm.js +49 -0
- package/dist/commands/update-renderer-upm.js.map +1 -0
- package/dist/commands/wearables-consistency.d.ts.map +1 -1
- package/dist/commands/wearables-consistency.js +8 -8
- package/dist/commands/wearables-consistency.js.map +1 -1
- package/dist/helpers/ago.d.ts +2 -0
- package/dist/helpers/ago.d.ts.map +1 -0
- package/dist/helpers/ago.js +35 -0
- package/dist/helpers/ago.js.map +1 -0
- package/dist/helpers/assert.d.ts +1 -1
- package/dist/helpers/asset-bundles.d.ts +11 -0
- package/dist/helpers/asset-bundles.d.ts.map +1 -0
- package/dist/helpers/asset-bundles.js +40 -0
- package/dist/helpers/asset-bundles.js.map +1 -0
- package/dist/helpers/catalysts.d.ts +2 -1
- package/dist/helpers/catalysts.d.ts.map +1 -1
- package/dist/helpers/catalysts.js +7 -8
- package/dist/helpers/catalysts.js.map +1 -1
- package/dist/helpers/downloads.d.ts +6 -0
- package/dist/helpers/downloads.d.ts.map +1 -0
- package/dist/helpers/downloads.js +48 -0
- package/dist/helpers/downloads.js.map +1 -0
- package/dist/helpers/env-domains.d.ts +2 -0
- package/dist/helpers/env-domains.d.ts.map +1 -0
- package/dist/helpers/env-domains.js +18 -0
- package/dist/helpers/env-domains.js.map +1 -0
- package/dist/helpers/fileWriter.d.ts +7 -0
- package/dist/helpers/fileWriter.d.ts.map +1 -0
- package/dist/helpers/fileWriter.js +86 -0
- package/dist/helpers/fileWriter.js.map +1 -0
- package/dist/helpers/parse-utils.d.ts +7 -0
- package/dist/helpers/parse-utils.d.ts.map +1 -0
- package/dist/helpers/parse-utils.js +64 -0
- package/dist/helpers/parse-utils.js.map +1 -0
- package/dist/helpers/parseEntityUrn.d.ts +6 -0
- package/dist/helpers/parseEntityUrn.d.ts.map +1 -0
- package/dist/helpers/parseEntityUrn.js +23 -0
- package/dist/helpers/parseEntityUrn.js.map +1 -0
- package/dist/helpers/recurse-folder.d.ts +2 -0
- package/dist/helpers/recurse-folder.d.ts.map +1 -0
- package/dist/helpers/recurse-folder.js +40 -0
- package/dist/helpers/recurse-folder.js.map +1 -0
- package/dist/helpers/rollouts.d.ts +4 -6
- package/dist/helpers/rollouts.d.ts.map +1 -1
- package/dist/helpers/rollouts.js +3 -6
- package/dist/helpers/rollouts.js.map +1 -1
- package/dist/helpers/sign-gpg.d.ts +3 -0
- package/dist/helpers/sign-gpg.d.ts.map +1 -0
- package/dist/helpers/sign-gpg.js +41 -0
- package/dist/helpers/sign-gpg.js.map +1 -0
- package/dist/helpers/types.d.ts +1 -1
- package/dist/helpers/types.d.ts.map +1 -1
- package/package.json +23 -14
package/README.md
CHANGED
|
@@ -4,12 +4,159 @@ Operations command line tool.
|
|
|
4
4
|
|
|
5
5
|
## Commands
|
|
6
6
|
|
|
7
|
+
### Validate deployment consistency
|
|
8
|
+
|
|
9
|
+
Check the active deployment by pointer on every catalyst, usage:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
npx @dcl/opscli pointer-consistency --pointer "0,0"
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### Schedule asset bundle conversion
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
npx @dcl/opscli queue-ab-conversion \
|
|
19
|
+
--pointer "0,0" \
|
|
20
|
+
--pointer="110,10" \
|
|
21
|
+
--cid "110,10" \
|
|
22
|
+
--token <ACCESS_TOKEN> \
|
|
23
|
+
[--platform webgl] \
|
|
24
|
+
[--platform mac] \
|
|
25
|
+
[--platform windows] \
|
|
26
|
+
[--ab-server https://ab-admin.decentraland.org] \
|
|
27
|
+
[--content-server https://peer.decentraland.org/content]
|
|
28
|
+
```
|
|
29
|
+
> If no platform is specified, it runs for all platforms. Also, more than one can be specified at a time.
|
|
30
|
+
|
|
31
|
+
> For dev, use `--ab-server https://ab-admin.decentraland.zone`.
|
|
32
|
+
|
|
33
|
+
### Schedule asset bundle conversion of all worlds
|
|
34
|
+
```
|
|
35
|
+
npx @dcl/opscli queue-ab-conversion-snapshot \
|
|
36
|
+
--snapshot worlds \
|
|
37
|
+
[--platform webgl] \
|
|
38
|
+
[--platform mac] \
|
|
39
|
+
[--platform windows] \
|
|
40
|
+
--token <ACCESS_TOKEN> \
|
|
41
|
+
[--ab-server https://ab-admin.decentraland.org]
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Schedule asset bundle conversion of a specific world by name
|
|
45
|
+
```
|
|
46
|
+
npx @dcl/opscli queue-ab-conversion-snapshot \
|
|
47
|
+
--snapshot worlds \
|
|
48
|
+
[--platform webgl] \
|
|
49
|
+
[--platform mac] \
|
|
50
|
+
[--platform windows] \
|
|
51
|
+
--token <ACCESS_TOKEN> \
|
|
52
|
+
[--ab-server https://ab-admin.decentraland.org]
|
|
53
|
+
[--world-name <world-name.dcl.eth>]
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Schedule asset bundle conversion from custom about
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
npx @dcl/opscli queue-ab-conversion-about \
|
|
60
|
+
--token <ACCESS_TOKEN> \
|
|
61
|
+
[--platform webgl] \
|
|
62
|
+
[--platform mac] \
|
|
63
|
+
[--platform windows] \
|
|
64
|
+
--about-url https://sdk-team-cdn.decentraland.org/ipfs/goerli-plaza-main/about \
|
|
65
|
+
[--ab-server https://ab-admin.decentraland.org]
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Check the status of conversion
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
npx @dcl/opscli check-ab-conversion \
|
|
72
|
+
--pointer "0,0" \
|
|
73
|
+
--pointer "110,10" \
|
|
74
|
+
[--cid "bafy....."]
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### `query-rollout`
|
|
78
|
+
|
|
79
|
+
Usage:
|
|
80
|
+
|
|
81
|
+
```
|
|
82
|
+
$ npx @dcl/opscli query-rollout --domain play.decentraland.zone --rolloutName _site
|
|
83
|
+
|
|
84
|
+
Current rollouts for domain "play.decentraland.zone" for this request
|
|
85
|
+
┌─────────────────────┬────────────┬─────────────────────────┬───────────────────────────────────┐
|
|
86
|
+
│ (index) │ percentage │ prefix │ version │
|
|
87
|
+
├─────────────────────┼────────────┼─────────────────────────┼───────────────────────────────────┤
|
|
88
|
+
│ _site │ 100 │ '@dcl/explorer-website' │ '0.0.1-1133229304.commit-901ee9a' │
|
|
89
|
+
│ @dcl/kernel │ 100 │ '@dcl/kernel' │ '1.0.0-1133249286.commit-a9ca05e' │
|
|
90
|
+
│ @dcl/unity-renderer │ 100 │ '@dcl/unity-renderer' │ '1.0.10553' │
|
|
91
|
+
└─────────────────────┴────────────┴─────────────────────────┴───────────────────────────────────┘
|
|
92
|
+
Raw data for rollout "_site" for domain "play.decentraland.zone"
|
|
93
|
+
┌─────────┬────────────┬───────────────────────────────────┐
|
|
94
|
+
│ (index) │ percentage │ version │
|
|
95
|
+
├─────────┼────────────┼───────────────────────────────────┤
|
|
96
|
+
│ 0 │ 100 │ '0.0.1-1133229304.commit-901ee9a' │
|
|
97
|
+
│ 1 │ 100 │ '0.0.1-1129066963.commit-a6c2178' │
|
|
98
|
+
│ 2 │ 100 │ '0.0.1-1125482159.commit-645a9e8' │
|
|
99
|
+
│ 3 │ 100 │ '0.0.1-1124920935.commit-57e48a2' │
|
|
100
|
+
│ 4 │ 100 │ '0.0.1-1121248349.commit-0568cf7' │
|
|
101
|
+
│ 5 │ 100 │ '0.0.1-1120296389.commit-cd95321' │
|
|
102
|
+
│ 6 │ 100 │ '0.0.1-1120045215.commit-7d17a4e' │
|
|
103
|
+
│ 7 │ 100 │ '0.0.1-1117962007.commit-cd75435' │
|
|
104
|
+
│ 8 │ 100 │ '0.0.1-1117258971.commit-bee96ab' │
|
|
105
|
+
│ 9 │ 100 │ '0.0.1-1114103774.commit-cfe9ba9' │
|
|
106
|
+
│ 10 │ 100 │ '0.0.1-1114086203.commit-cc86da6' │
|
|
107
|
+
│ 11 │ 100 │ '0.0.1-1105802712.commit-80b54a0' │
|
|
108
|
+
│ 12 │ 100 │ '0.0.1-1105772932.commit-ff46bfb' │
|
|
109
|
+
│ 13 │ 100 │ '0.0.1-1105284880.commit-32d26de' │
|
|
110
|
+
│ 14 │ 100 │ '0.0.1-1094578839.commit-e8461eb' │
|
|
111
|
+
│ 15 │ 100 │ '0.0.1-1092142520.commit-746716e' │
|
|
112
|
+
│ 16 │ 100 │ '0.0.1-1091984380.commit-77a1383' │
|
|
113
|
+
└─────────┴────────────┴───────────────────────────────────┘
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
### `download-entity`
|
|
119
|
+
|
|
120
|
+
Downloads a specific entity from a content server, as specified in https://adr.decentraland.org/adr/ADR-79
|
|
121
|
+
|
|
122
|
+
It creates an extra file named `.metadata` including the deployment metadata. Which in some cases (wearables) is not present as a file in the deployed entity.
|
|
123
|
+
|
|
124
|
+
In the specified folder, it will create one
|
|
125
|
+
|
|
126
|
+
```
|
|
127
|
+
$ npx @dcl/opscli download-entity \
|
|
128
|
+
--content-server https://play.decentraland.org/content \
|
|
129
|
+
--pointer=0,0 \
|
|
130
|
+
--pointer=urn:decentraland:off-chain:base-avatars:brown_pants \
|
|
131
|
+
--out ~/Downloads
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### `deploy-entity`
|
|
135
|
+
|
|
136
|
+
Deploys an entity to a content server
|
|
137
|
+
|
|
138
|
+
- `--pointer` Pointers of the entities, can be used many times, e.g. `--pointer=0,0 --pointer=0,1`
|
|
139
|
+
- `--entity-type` Entity type
|
|
140
|
+
- `--private-key` or `PRIVATE_KEY` env var
|
|
141
|
+
- `--dry` do everything except publishing the entity
|
|
142
|
+
- `--folder` to deploy, root level paths starting with `.` will be ignored, i.e. for .git folder. the `.metadata` file is required to create the entity
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
$ npx @dcl/opscli deploy-entity \
|
|
146
|
+
--dry \
|
|
147
|
+
--content-server https://peer.decentraland.org/content \
|
|
148
|
+
--entity-type wearable \
|
|
149
|
+
--folder=urn:decentraland:off-chain:base-avatars:brown_pants \
|
|
150
|
+
--pointer=urn:decentraland:off-chain:base-avatars:brown_pants \
|
|
151
|
+
--private-key=bde921a4a4abc644cced18f632aed0b3d34b1b36bc16fd97721ade1b7178cfff
|
|
152
|
+
```
|
|
153
|
+
|
|
7
154
|
### `query-rollout`
|
|
8
155
|
|
|
9
156
|
Usage:
|
|
10
157
|
|
|
11
158
|
```
|
|
12
|
-
$ npx @dcl/opscli
|
|
159
|
+
$ npx @dcl/opscli query-rollout --domain play.decentraland.zone --rolloutName _site
|
|
13
160
|
|
|
14
161
|
Current rollouts for domain "play.decentraland.zone" for this request
|
|
15
162
|
┌─────────────────────┬────────────┬─────────────────────────┬───────────────────────────────────┐
|
package/dist/bin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AAiBA,qBAAa,QAAS,SAAQ,KAAK;CAAG"}
|
package/dist/bin.js
CHANGED
|
@@ -1,25 +1,52 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
3
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
7
|
exports.CliError = void 0;
|
|
8
|
+
const query_rollout_1 = __importDefault(require("./commands/query-rollout"));
|
|
9
|
+
const wearables_consistency_1 = __importDefault(require("./commands/wearables-consistency"));
|
|
10
|
+
const pointer_consistency_1 = __importDefault(require("./commands/pointer-consistency"));
|
|
11
|
+
const update_renderer_upm_1 = __importDefault(require("./commands/update-renderer-upm"));
|
|
12
|
+
const secret_manager_1 = __importDefault(require("./commands/secret-manager"));
|
|
13
|
+
const parameters_manager_1 = __importDefault(require("./commands/parameters-manager"));
|
|
14
|
+
const download_entity_1 = __importDefault(require("./commands/download-entity"));
|
|
15
|
+
const deploy_entity_1 = __importDefault(require("./commands/deploy-entity"));
|
|
16
|
+
const queue_ab_conversion_1 = __importDefault(require("./commands/queue-ab-conversion"));
|
|
17
|
+
const queue_ab_conversion_snapshot_1 = __importDefault(require("./commands/queue-ab-conversion-snapshot"));
|
|
18
|
+
const queue_ab_conversion_about_1 = __importDefault(require("./commands/queue-ab-conversion-about"));
|
|
19
|
+
const check_ab_conversion_1 = __importDefault(require("./commands/check-ab-conversion"));
|
|
20
|
+
const circleci_1 = __importDefault(require("./commands/circleci"));
|
|
21
|
+
const concat_snapshots_1 = __importDefault(require("./commands/concat-snapshots"));
|
|
5
22
|
class CliError extends Error {
|
|
6
23
|
}
|
|
7
24
|
exports.CliError = CliError;
|
|
8
25
|
const commands = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
26
|
+
'query-rollout': query_rollout_1.default,
|
|
27
|
+
'wearables-consistency': wearables_consistency_1.default,
|
|
28
|
+
'pointer-consistency': pointer_consistency_1.default,
|
|
29
|
+
'update-renderer-upm': update_renderer_upm_1.default,
|
|
30
|
+
'secret-manager': secret_manager_1.default,
|
|
31
|
+
'parameters-manager': parameters_manager_1.default,
|
|
32
|
+
'download-entity': download_entity_1.default,
|
|
33
|
+
'deploy-entity': deploy_entity_1.default,
|
|
34
|
+
'queue-ab-conversion': queue_ab_conversion_1.default,
|
|
35
|
+
'queue-ab-conversion-snapshot': queue_ab_conversion_snapshot_1.default,
|
|
36
|
+
'queue-ab-conversion-about': queue_ab_conversion_about_1.default,
|
|
37
|
+
'check-ab-conversion': check_ab_conversion_1.default,
|
|
38
|
+
circleci: circleci_1.default,
|
|
39
|
+
'concat-snapshots': concat_snapshots_1.default
|
|
12
40
|
};
|
|
13
41
|
async function main() {
|
|
14
42
|
const commandName = process.argv[2];
|
|
15
43
|
if (!commandName || !commands[commandName]) {
|
|
16
|
-
throw new CliError(
|
|
44
|
+
throw new CliError('Invalid command. Possible are:\n' +
|
|
17
45
|
Object.keys(commands)
|
|
18
|
-
.map(($) =>
|
|
19
|
-
.join(
|
|
46
|
+
.map(($) => ' npx @dcl/opscli ' + $ + '\n')
|
|
47
|
+
.join(''));
|
|
20
48
|
}
|
|
21
|
-
|
|
22
|
-
await fn();
|
|
49
|
+
await commands[commandName]();
|
|
23
50
|
}
|
|
24
51
|
main().catch((err) => {
|
|
25
52
|
if (err instanceof CliError) {
|
package/dist/bin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";;;;;;;AAEA,6EAAmD;AACnD,6FAAmE;AACnE,yFAA+D;AAC/D,yFAA8D;AAC9D,+EAAqD;AACrD,uFAA6D;AAC7D,iFAAuD;AACvD,6EAAmD;AACnD,yFAA8D;AAC9D,2GAA+E;AAC/E,qGAAyE;AACzE,yFAA8D;AAC9D,mEAA0C;AAC1C,mFAAyD;AAEzD,MAAa,QAAS,SAAQ,KAAK;CAA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"file":"check-ab-conversion.d.ts","sourceRoot":"","sources":["../../src/commands/check-ab-conversion.ts"],"names":[],"mappings":";AAMA,wBAmEC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const schemas_1 = require("@dcl/schemas");
|
|
7
|
+
const arg_1 = __importDefault(require("arg"));
|
|
8
|
+
const undici_1 = require("undici");
|
|
9
|
+
const assert_1 = require("../helpers/assert");
|
|
10
|
+
const downloads_1 = require("../helpers/downloads");
|
|
11
|
+
exports.default = async () => {
|
|
12
|
+
const args = (0, arg_1.default)({
|
|
13
|
+
'--cid': [String],
|
|
14
|
+
'--pointer': [String],
|
|
15
|
+
'--content-server': String,
|
|
16
|
+
'--ab-cdn': String
|
|
17
|
+
});
|
|
18
|
+
const pointers = args['--pointer'] || [];
|
|
19
|
+
const cids = args['--cid'] || [];
|
|
20
|
+
const abServer = args['--ab-cdn'] || 'https://ab-cdn.decentraland.org';
|
|
21
|
+
(0, assert_1.assert)(pointers.length > 0 || cids.length > 0, '--pointer or --cid are required');
|
|
22
|
+
const contentUrl = (args['--content-server'] || 'https://peer.decentraland.org/content').replace(/\/$/, '');
|
|
23
|
+
const entityIdsToConvert = [];
|
|
24
|
+
if (pointers.length) {
|
|
25
|
+
for (const entity of await (0, downloads_1.getActiveEntities)(pointers, contentUrl)) {
|
|
26
|
+
entityIdsToConvert.push({ entityId: entity.id, pointers: entity.pointers });
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
for (const cid of cids) {
|
|
30
|
+
if (schemas_1.IPFSv1.validate(cid) || schemas_1.IPFSv2.validate(cid)) {
|
|
31
|
+
entityIdsToConvert.push({ entityId: cid, pointers: ['?'] });
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
console.log(`! Invalid CID: ${cid}. It will be ignored`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const check = async (entityId, pointers, promise) => {
|
|
38
|
+
if (!promise.ok) {
|
|
39
|
+
const failManifest = await (0, undici_1.fetch)(`${abServer}/manifest/${entityId}_failed.json`);
|
|
40
|
+
if (failManifest.ok) {
|
|
41
|
+
const manifest = (await failManifest.json());
|
|
42
|
+
console.log(`🟠 ${entityId} (${pointers[0]}): Failed. Version=${manifest.version} ExitCode=${manifest.exitCode} Date=${manifest.date} Log=${manifest.log}`);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
console.log(`🔴 ${entityId} (${pointers[0]}): Not converted!`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
const manifest = (await promise.json());
|
|
50
|
+
console.log(`🟢 ${entityId} (${pointers[0]}): Version=${manifest.version} ExitCode=${manifest.exitCode} Date=${manifest.date}`);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
for (const { entityId, pointers } of entityIdsToConvert) {
|
|
54
|
+
const result = await (0, undici_1.fetch)(`${abServer}/manifest/${entityId}.json`);
|
|
55
|
+
const resultWindows = await (0, undici_1.fetch)(`${abServer}/manifest/${entityId}_windows.json`);
|
|
56
|
+
const resultMac = await (0, undici_1.fetch)(`${abServer}/manifest/${entityId}_mac.json`);
|
|
57
|
+
console.log('WEBGL');
|
|
58
|
+
await check(entityId, pointers, result);
|
|
59
|
+
console.log('WINDOWS');
|
|
60
|
+
await check(entityId, pointers, resultWindows);
|
|
61
|
+
console.log('MAC');
|
|
62
|
+
await check(entityId, pointers, resultMac);
|
|
63
|
+
}
|
|
64
|
+
console.log(`Finished!`);
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=check-ab-conversion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check-ab-conversion.js","sourceRoot":"","sources":["../../src/commands/check-ab-conversion.ts"],"names":[],"mapp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AC,CAAA;QACnE,MAAM,aAAa,GAAG,MAAM,IAAA,cAAK,EAAC,GAAG,QAAQ,aAAa,QAAQ,eAAe,CAAC,CAAA;QAClF,MAAM,SAAS,GAAG,MAAM,IAAA,cAAK,EAAC,GAAG,QAAQ,aAAa,QAAQ,WAAW,CAAC,CAAA;QAE1E,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QACpB,MAAM,KAAK,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAA;QAEvC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;QACtB,MAAM,KAAK,CAAC,QAAQ,EAAE,QAAQ,EAAE,aAAa,CAAC,CAAA;QAE9C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QAClB,MAAM,KAAK,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAA;KAC3C;IAED,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;AAC1B,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"circleci.d.ts","sourceRoot":"","sources":["../../src/commands/circleci.ts"],"names":[],"mappings":"AAMA,0CA2BC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const arg_1 = __importDefault(require("arg"));
|
|
7
|
+
const undici_1 = require("undici");
|
|
8
|
+
const assert_1 = require("../helpers/assert");
|
|
9
|
+
const env_domains_1 = require("../helpers/env-domains");
|
|
10
|
+
const sign_gpg_1 = require("../helpers/sign-gpg");
|
|
11
|
+
async function default_1() {
|
|
12
|
+
const args = (0, arg_1.default)({
|
|
13
|
+
'--repo': String,
|
|
14
|
+
'--branch': String
|
|
15
|
+
});
|
|
16
|
+
const repo = (0, assert_1.assert)(args['--repo'], '--repo is missing');
|
|
17
|
+
const branch = (0, assert_1.assert)(args['--branch'], '--branch is missing');
|
|
18
|
+
const envDomain = (0, env_domains_1.tldFromEnv)('prd');
|
|
19
|
+
const signed = await (0, sign_gpg_1.signGpgCleartext)(`${repo}\n${branch}`);
|
|
20
|
+
console.log('> Starting the pipeline...');
|
|
21
|
+
const res = await (0, undici_1.fetch)(`https://ops-lambdas.decentraland.${envDomain}/circleci`, {
|
|
22
|
+
method: 'POST',
|
|
23
|
+
body: signed.toString()
|
|
24
|
+
});
|
|
25
|
+
const response = await res.text();
|
|
26
|
+
if (res.status !== 200) {
|
|
27
|
+
throw new Error(`An error has occured while uploading the secret: ${response}`);
|
|
28
|
+
}
|
|
29
|
+
console.log(' OK! Response:');
|
|
30
|
+
console.log(response);
|
|
31
|
+
}
|
|
32
|
+
exports.default = default_1;
|
|
33
|
+
//# sourceMappingURL=circleci.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"circleci.js","sourceRoot":"","sources":["../../src/commands/circleci.ts"],"names":[],"mappings":";;;;;AAAA,8CAAqB;AACrB,mCAA8B;AAC9B,8CAA0C;AAC1C,wDAAmD;AACnD,kDAAsD;AAEvC,KAAK;IAClB,MAAM,IAAI,GAAG,IAAA,aAAG,EAAC;QACf,QAAQ,EAAE,MAAM;QAChB,UAAU,EAAE,MAAM;KACnB,CAAC,CAAA;IAEF,MAAM,IAAI,GAAG,IAAA,eAAM,EAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,mBAAmB,CAAC,CAAA;IACxD,MAAM,MAAM,GAAG,IAAA,eAAM,EAAC,IAAI,CAAC,UAAU,CAAC,EAAE,qBAAqB,CAAC,CAAA;IAC9D,MAAM,SAAS,GAAG,IAAA,wBAAU,EAAC,KAAK,CAAC,CAAA;IAEnC,MAAM,MAAM,GAAG,MAAM,IAAA,2BAAgB,EAAC,GAAG,IAAI,KAAK,MAAM,EAAE,CAAC,CAAA;IAE3D,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAA;IACzC,MAAM,GAAG,GAAG,MAAM,IAAA,cAAK,EAAC,oCAAoC,SAAS,WAAW,EAAE;QAChF,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,MAAM,CAAC,QAAQ,EAAE;KACxB,CAAC,CAAA;IAEF,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,IAAI,EAAE,CAAA;IAEjC,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG,EAAE;QACtB,MAAM,IAAI,KAAK,CAAC,oDAAoD,QAAQ,EAAE,CAAC,CAAA;KAChF;IAED,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;IAE9B,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;AACvB,CAAC;AA3BD,4BA2BC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"concat-snapshots.d.ts","sourceRoot":"","sources":["../../src/commands/concat-snapshots.ts"],"names":[],"mappings":";AA2BA,wBA8CC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const arg_1 = __importDefault(require("arg"));
|
|
7
|
+
const undici_1 = require("undici");
|
|
8
|
+
const bin_1 = require("../bin");
|
|
9
|
+
const assert_1 = require("../helpers/assert");
|
|
10
|
+
const fileWriter_1 = require("../helpers/fileWriter");
|
|
11
|
+
async function* streamEntitiesFromSnapshot(contentUrl, snapshotHash) {
|
|
12
|
+
console.log(`fetching: ${contentUrl}/contents/${snapshotHash}`);
|
|
13
|
+
const jsonNdReq = await (0, undici_1.fetch)(`${contentUrl}/contents/${snapshotHash}`);
|
|
14
|
+
if (!jsonNdReq.ok)
|
|
15
|
+
throw new bin_1.CliError(`Invalid response from ${contentUrl}/contents/${snapshotHash}`);
|
|
16
|
+
const jsonNd = await jsonNdReq.text();
|
|
17
|
+
const len = jsonNd.length;
|
|
18
|
+
console.log(` File length ${(len / 1024 / 1024).toFixed(1)}MB`);
|
|
19
|
+
let currentCursor = 0;
|
|
20
|
+
let nextCursor = 0;
|
|
21
|
+
while ((nextCursor = jsonNd.indexOf('\n', currentCursor + 1)) !== -1) {
|
|
22
|
+
const line = jsonNd.substring(currentCursor, nextCursor);
|
|
23
|
+
currentCursor = nextCursor;
|
|
24
|
+
if (line.trim().startsWith('{')) {
|
|
25
|
+
yield line;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
const ALL_TYPES_ARG = 'all-types';
|
|
30
|
+
exports.default = async () => {
|
|
31
|
+
const args = (0, arg_1.default)({
|
|
32
|
+
'--entity-type': String,
|
|
33
|
+
'--content-server': String,
|
|
34
|
+
'--output-file': String
|
|
35
|
+
});
|
|
36
|
+
const entityType = args['--entity-type'];
|
|
37
|
+
(0, assert_1.assert)(!!entityType, '--entity-type is missing');
|
|
38
|
+
const outputFile = args['--output-file'];
|
|
39
|
+
(0, assert_1.assert)(!!outputFile, '--output-file is missing');
|
|
40
|
+
console.log(`> Parameters:`);
|
|
41
|
+
const contentUrl = (args['--content-server'] || 'https://peer.decentraland.zone/content').replace(/\/$/, '');
|
|
42
|
+
console.log(` Entity type: ${entityType}`);
|
|
43
|
+
console.log(` Content server: ${contentUrl}`);
|
|
44
|
+
console.log(`> Fetching snapshots ${contentUrl}/snapshots`);
|
|
45
|
+
const snapshotsReq = await (0, undici_1.fetch)(`${contentUrl}/snapshots`);
|
|
46
|
+
if (!snapshotsReq.ok)
|
|
47
|
+
throw new bin_1.CliError(`Invalid snapshot response from ${contentUrl}/snapshot`);
|
|
48
|
+
const snapshotsJson = (await snapshotsReq.json());
|
|
49
|
+
for (const snapshot of snapshotsJson) {
|
|
50
|
+
if (!('hash' in snapshot)) {
|
|
51
|
+
throw new bin_1.CliError(`Invalid snapshot ${snapshot}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const snapshotHashes = snapshotsJson.map((s) => s.hash);
|
|
55
|
+
console.log(snapshotHashes);
|
|
56
|
+
const newSnapshotFile = await (0, fileWriter_1.createFileWriter)(outputFile || '');
|
|
57
|
+
await newSnapshotFile.appendDebounced('### Decentraland json snapshot\n');
|
|
58
|
+
for (const snapshotHash of snapshotHashes) {
|
|
59
|
+
for await (const snapshotElem of streamEntitiesFromSnapshot(contentUrl, snapshotHash)) {
|
|
60
|
+
const entity = JSON.parse(snapshotElem);
|
|
61
|
+
if (entityType === ALL_TYPES_ARG || entity.entityType === entityType) {
|
|
62
|
+
await newSnapshotFile.appendDebounced(JSON.stringify(entity) + '\n');
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
await newSnapshotFile.close();
|
|
67
|
+
console.log(`Finished!`);
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=concat-snapshots.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"concat-snapshots.js","sourceRoot":"","sources":["../../src/commands/concat-snapshots.ts"],"names":[],"mappings":";;;;;AACA,8CAAqB;AACrB,mCAA8B;AAC9B,gCAAiC;AACjC,8CAA0C;AAC1C,sDAAwD;AAExD,KAAK,SAAS,CAAC,CAAC,0BAA0B,CAAC,UAAkB,EAAE,YAAoB;IACjF,OAAO,CAAC,GAAG,CAAC,aAAa,UAAU,aAAa,YAAY,EAAE,CAAC,CAAA;IAC/D,MAAM,SAAS,GAAG,MAAM,IAAA,cAAK,EAAC,GAAG,UAAU,aAAa,YAAY,EAAE,CAAC,CAAA;IACvE,IAAI,CAAC,SAAS,CAAC,EAAE;QAAE,MAAM,IAAI,cAAQ,CAAC,yBAAyB,UAAU,aAAa,YAAY,EAAE,CAAC,CAAA;IACrG,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,IAAI,EAAE,CAAA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,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAA;aACrE;SACF;KACF;IACD,MAAM,eAAe,CAAC,KAAK,EAAE,CAAA;IAE7B,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;AAC1B,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy-entity.d.ts","sourceRoot":"","sources":["../../src/commands/deploy-entity.ts"],"names":[],"mappings":";AAeA,wBAuFC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const promises_1 = require("fs/promises");
|
|
7
|
+
const eth_crypto_1 = __importDefault(require("eth-crypto"));
|
|
8
|
+
const dcl_catalyst_client_1 = require("dcl-catalyst-client");
|
|
9
|
+
const crypto_1 = require("@dcl/crypto");
|
|
10
|
+
const eth_connect_1 = require("eth-connect");
|
|
11
|
+
const crypto_2 = require("@dcl/crypto/dist/crypto");
|
|
12
|
+
const path_1 = __importDefault(require("path"));
|
|
13
|
+
const fs_1 = require("fs");
|
|
14
|
+
const bin_1 = require("../bin");
|
|
15
|
+
const arg_1 = __importDefault(require("arg"));
|
|
16
|
+
const console_1 = require("console");
|
|
17
|
+
const recurse_folder_1 = require("../helpers/recurse-folder");
|
|
18
|
+
const fetch_component_1 = require("@well-known-components/fetch-component");
|
|
19
|
+
exports.default = async () => {
|
|
20
|
+
const args = (0, arg_1.default)({
|
|
21
|
+
'--folder': String,
|
|
22
|
+
'--private-key': String,
|
|
23
|
+
'--entity-type': String,
|
|
24
|
+
'--pointer': [String],
|
|
25
|
+
'--content-server': String,
|
|
26
|
+
'--dry': Boolean
|
|
27
|
+
});
|
|
28
|
+
const folder = path_1.default.resolve(args['--folder'] || process.cwd());
|
|
29
|
+
const entityType = args['--entity-type'];
|
|
30
|
+
(0, console_1.assert)(entityType, 'An --entity-type must be provided');
|
|
31
|
+
const pointers = args['--pointer'];
|
|
32
|
+
(0, console_1.assert)(pointers.length > 0, '--pointer is missing');
|
|
33
|
+
console.log(`> Deploying entity in folder: ${folder}`);
|
|
34
|
+
console.log(` Entity type: ${entityType}`);
|
|
35
|
+
console.log(` Pointers: ${pointers.join(',')}`);
|
|
36
|
+
const contentUrl = (args['--content-server'] || 'https://peer.decentraland.org/content').replace(/\/$/, '');
|
|
37
|
+
console.log(` Content server: ${contentUrl}`);
|
|
38
|
+
const fetch = (0, fetch_component_1.createFetchComponent)();
|
|
39
|
+
const client = (0, dcl_catalyst_client_1.createContentClient)({ url: contentUrl, fetcher: fetch });
|
|
40
|
+
const files = new Map();
|
|
41
|
+
console.log(` Content files:`);
|
|
42
|
+
for await (const fullPath of (0, recurse_folder_1.recurseFolder)(folder)) {
|
|
43
|
+
// NOTE: this may not work on windows machines because of path separators
|
|
44
|
+
const file = path_1.default.relative(folder, fullPath);
|
|
45
|
+
if (file.startsWith('.'))
|
|
46
|
+
continue; // ignore dotfiles and git
|
|
47
|
+
console.log(` - ${file}`);
|
|
48
|
+
files.set(file, await (0, promises_1.readFile)(fullPath));
|
|
49
|
+
}
|
|
50
|
+
const metadataPath = path_1.default.join(folder, '.metadata');
|
|
51
|
+
if (!(0, fs_1.existsSync)(metadataPath)) {
|
|
52
|
+
throw new bin_1.CliError(`File ${metadataPath} doesn't exist`);
|
|
53
|
+
}
|
|
54
|
+
const metadataFile = await (0, promises_1.readFile)(metadataPath);
|
|
55
|
+
const metadata = JSON.parse(metadataFile.toString());
|
|
56
|
+
const deploymentEntity = await dcl_catalyst_client_1.DeploymentBuilder.buildEntity({
|
|
57
|
+
type: entityType,
|
|
58
|
+
pointers,
|
|
59
|
+
files,
|
|
60
|
+
metadata,
|
|
61
|
+
timestamp: new Date().getTime()
|
|
62
|
+
});
|
|
63
|
+
console.log(` EntityId: ${deploymentEntity.entityId}`);
|
|
64
|
+
console.log(` Hashes: ${Array.from(deploymentEntity.files.keys()).join(',')}`);
|
|
65
|
+
const privateKey = args['--private-key'] || process.env.PRIVATE_KEY;
|
|
66
|
+
(0, console_1.assert)(privateKey, 'Missing --private-key or PRIVATE_KEY env var');
|
|
67
|
+
const sig = (0, crypto_2.ethSign)((0, eth_connect_1.hexToBytes)(privateKey), 'test');
|
|
68
|
+
const address = (0, crypto_2.recoverAddressFromEthSignature)(sig, 'test');
|
|
69
|
+
console.log(` Signer address: ${address}`);
|
|
70
|
+
const messageHash = crypto_1.Authenticator.createEthereumMessageHash(deploymentEntity.entityId);
|
|
71
|
+
const signature = eth_crypto_1.default.sign(privateKey, Buffer.from(messageHash).toString('hex'));
|
|
72
|
+
const authChain = crypto_1.Authenticator.createSimpleAuthChain(deploymentEntity.entityId, address, signature);
|
|
73
|
+
console.log(` Auth chain: ${JSON.stringify(authChain)}`);
|
|
74
|
+
if (!args['--dry']) {
|
|
75
|
+
try {
|
|
76
|
+
const result = await client.deploy({
|
|
77
|
+
entityId: deploymentEntity.entityId,
|
|
78
|
+
authChain: authChain,
|
|
79
|
+
files: deploymentEntity.files
|
|
80
|
+
});
|
|
81
|
+
console.log('> Done. Result:');
|
|
82
|
+
console.log(result);
|
|
83
|
+
}
|
|
84
|
+
catch (e) {
|
|
85
|
+
console.error(e);
|
|
86
|
+
throw new bin_1.CliError(`Error deploying entity ${deploymentEntity.entityId} on ${pointers}`);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
//# sourceMappingURL=deploy-entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy-entity.js","sourceRoot":"","sources":["../../src/commands/deploy-entity.ts"],"names":[],"mappings":";;;;;AAAA,0CAAsC;AACtC,4DAAkC;AAClC,6DAA4E;AAC5E,wCAA2C;AAC3C,6CAAwC;AACxC,oDAAiF;AACjF,gDAAuB;AACvB,2BAA+B;AAC/B,g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CAAC,MAAM,CAAC,CAAA;SACpB;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;YAChB,MAAM,IAAI,cAAQ,CAAC,0BAA0B,gBAAgB,CAAC,QAAQ,OAAO,QAAQ,EAAE,CAAC,CAAA;SACzF;KACF;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"download-entity.d.ts","sourceRoot":"","sources":["../../src/commands/download-entity.ts"],"names":[],"mappings":";AAKA,wBAqBC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const arg_1 = __importDefault(require("arg"));
|
|
30
|
+
const path_1 = __importStar(require("path"));
|
|
31
|
+
const assert_1 = require("../helpers/assert");
|
|
32
|
+
const downloads_1 = require("../helpers/downloads");
|
|
33
|
+
exports.default = async () => {
|
|
34
|
+
const args = (0, arg_1.default)({
|
|
35
|
+
'--pointer': [String],
|
|
36
|
+
'--content-server': String,
|
|
37
|
+
'--out': String
|
|
38
|
+
});
|
|
39
|
+
const pointers = args['--pointer'];
|
|
40
|
+
(0, assert_1.assert)(pointers.length > 0, '--pointer is missing');
|
|
41
|
+
const server = (args['--content-server'] || 'https://peer.decentraland.org/content').replace(/\/$/, '');
|
|
42
|
+
const out = args['--out'] || process.cwd();
|
|
43
|
+
const entities = await (0, downloads_1.getActiveEntities)(pointers, server);
|
|
44
|
+
for (const entity of entities) {
|
|
45
|
+
const destFolder = (0, path_1.join)((0, path_1.resolve)(out), entity.pointers[0]) + path_1.default.sep;
|
|
46
|
+
console.log(`\nDownloading entity with pointers ${entity.pointers.join(',')} into ${destFolder}`);
|
|
47
|
+
await (0, downloads_1.downloadEntityAndMetadata)(entity, server, destFolder);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=download-entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"download-entity.js","sourceRoot":"","sources":["../../src/commands/download-entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAqB;AACrB,6CAA0C;AAC1C,8CAA0C;AAC1C,oDAAmF;AAEnF,kBAAe,KAAK,IAAI,EAAE;IACxB,MAAM,IAAI,GAAG,IAAA,aAAG,EAAC;QACf,WAAW,EAAE,CAAC,MAAM,CAAC;QACrB,kBAAkB,EAAE,MAAM;QAC1B,OAAO,EAAE,M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