@dcl/opscli 1.0.0-3097989545.commit-80fe4dc → 1.0.0-34505710176.commit-d00f7bd

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.
Files changed (102) hide show
  1. package/README.md +151 -1
  2. package/dist/bin.d.ts.map +1 -1
  3. package/dist/bin.js +39 -11
  4. package/dist/bin.js.map +1 -1
  5. package/dist/commands/ab-queue-status.d.ts +2 -0
  6. package/dist/commands/ab-queue-status.d.ts.map +1 -0
  7. package/dist/commands/ab-queue-status.js +40 -0
  8. package/dist/commands/ab-queue-status.js.map +1 -0
  9. package/dist/commands/check-ab-conversion.d.ts +3 -0
  10. package/dist/commands/check-ab-conversion.d.ts.map +1 -0
  11. package/dist/commands/check-ab-conversion.js +63 -0
  12. package/dist/commands/check-ab-conversion.js.map +1 -0
  13. package/dist/commands/circleci.d.ts +2 -0
  14. package/dist/commands/circleci.d.ts.map +1 -0
  15. package/dist/commands/circleci.js +33 -0
  16. package/dist/commands/circleci.js.map +1 -0
  17. package/dist/commands/concat-snapshots.d.ts +3 -0
  18. package/dist/commands/concat-snapshots.d.ts.map +1 -0
  19. package/dist/commands/concat-snapshots.js +69 -0
  20. package/dist/commands/concat-snapshots.js.map +1 -0
  21. package/dist/commands/deploy-entity.d.ts +3 -0
  22. package/dist/commands/deploy-entity.d.ts.map +1 -0
  23. package/dist/commands/deploy-entity.js +90 -0
  24. package/dist/commands/deploy-entity.js.map +1 -0
  25. package/dist/commands/download-entity.d.ts +3 -0
  26. package/dist/commands/download-entity.d.ts.map +1 -0
  27. package/dist/commands/download-entity.js +50 -0
  28. package/dist/commands/download-entity.js.map +1 -0
  29. package/dist/commands/parameters-manager.d.ts.map +1 -1
  30. package/dist/commands/parameters-manager.js +30 -15
  31. package/dist/commands/parameters-manager.js.map +1 -1
  32. package/dist/commands/pointer-consistency.d.ts.map +1 -1
  33. package/dist/commands/pointer-consistency.js +94 -14
  34. package/dist/commands/pointer-consistency.js.map +1 -1
  35. package/dist/commands/query-rollout.js +8 -8
  36. package/dist/commands/query-rollout.js.map +1 -1
  37. package/dist/commands/queue-ab-conversion-about.d.ts +3 -0
  38. package/dist/commands/queue-ab-conversion-about.d.ts.map +1 -0
  39. package/dist/commands/queue-ab-conversion-about.js +61 -0
  40. package/dist/commands/queue-ab-conversion-about.js.map +1 -0
  41. package/dist/commands/queue-ab-conversion-snapshot.d.ts +3 -0
  42. package/dist/commands/queue-ab-conversion-snapshot.d.ts.map +1 -0
  43. package/dist/commands/queue-ab-conversion-snapshot.js +228 -0
  44. package/dist/commands/queue-ab-conversion-snapshot.js.map +1 -0
  45. package/dist/commands/queue-ab-conversion.d.ts +3 -0
  46. package/dist/commands/queue-ab-conversion.d.ts.map +1 -0
  47. package/dist/commands/queue-ab-conversion.js +80 -0
  48. package/dist/commands/queue-ab-conversion.js.map +1 -0
  49. package/dist/commands/secret-manager.d.ts.map +1 -1
  50. package/dist/commands/secret-manager.js +46 -22
  51. package/dist/commands/secret-manager.js.map +1 -1
  52. package/dist/commands/update-renderer-upm.d.ts.map +1 -1
  53. package/dist/commands/update-renderer-upm.js +14 -14
  54. package/dist/commands/update-renderer-upm.js.map +1 -1
  55. package/dist/commands/wearables-consistency.js +5 -5
  56. package/dist/commands/wearables-consistency.js.map +1 -1
  57. package/dist/commands/world-ab-status.d.ts +2 -0
  58. package/dist/commands/world-ab-status.d.ts.map +1 -0
  59. package/dist/commands/world-ab-status.js +85 -0
  60. package/dist/commands/world-ab-status.js.map +1 -0
  61. package/dist/helpers/ab-registry.d.ts +10 -0
  62. package/dist/helpers/ab-registry.d.ts.map +1 -0
  63. package/dist/helpers/ab-registry.js +55 -0
  64. package/dist/helpers/ab-registry.js.map +1 -0
  65. package/dist/helpers/ago.js +10 -10
  66. package/dist/helpers/ago.js.map +1 -1
  67. package/dist/helpers/assert.d.ts +1 -1
  68. package/dist/helpers/asset-bundles.d.ts +12 -0
  69. package/dist/helpers/asset-bundles.d.ts.map +1 -0
  70. package/dist/helpers/asset-bundles.js +45 -0
  71. package/dist/helpers/asset-bundles.js.map +1 -0
  72. package/dist/helpers/catalysts.d.ts +1 -1
  73. package/dist/helpers/catalysts.d.ts.map +1 -1
  74. package/dist/helpers/catalysts.js +4 -4
  75. package/dist/helpers/downloads.d.ts +6 -0
  76. package/dist/helpers/downloads.d.ts.map +1 -0
  77. package/dist/helpers/downloads.js +48 -0
  78. package/dist/helpers/downloads.js.map +1 -0
  79. package/dist/helpers/env-domains.d.ts +1 -1
  80. package/dist/helpers/env-domains.js +9 -9
  81. package/dist/helpers/fileWriter.d.ts +7 -0
  82. package/dist/helpers/fileWriter.d.ts.map +1 -0
  83. package/dist/helpers/fileWriter.js +86 -0
  84. package/dist/helpers/fileWriter.js.map +1 -0
  85. package/dist/helpers/parse-utils.js +11 -7
  86. package/dist/helpers/parse-utils.js.map +1 -1
  87. package/dist/helpers/parseEntityUrn.d.ts +6 -0
  88. package/dist/helpers/parseEntityUrn.d.ts.map +1 -0
  89. package/dist/helpers/parseEntityUrn.js +23 -0
  90. package/dist/helpers/parseEntityUrn.js.map +1 -0
  91. package/dist/helpers/recurse-folder.d.ts +2 -0
  92. package/dist/helpers/recurse-folder.d.ts.map +1 -0
  93. package/dist/helpers/recurse-folder.js +40 -0
  94. package/dist/helpers/recurse-folder.js.map +1 -0
  95. package/dist/helpers/rollouts.d.ts +4 -6
  96. package/dist/helpers/rollouts.d.ts.map +1 -1
  97. package/dist/helpers/rollouts.js +2 -2
  98. package/dist/helpers/rollouts.js.map +1 -1
  99. package/dist/helpers/sign-gpg.js +5 -5
  100. package/dist/helpers/types.d.ts +1 -1
  101. package/dist/helpers/types.d.ts.map +1 -1
  102. package/package.json +22 -13
package/README.md CHANGED
@@ -6,10 +6,123 @@ Operations command line tool.
6
6
 
7
7
  ### Validate deployment consistency
8
8
 
9
- Check the active deployment by pointer on every catalyst, usage:
9
+ Check the active deployment by pointer on every catalyst, verify convergence across catalysts, and check asset bundle status via the asset bundle registry.
10
10
 
11
11
  ```
12
12
  npx @dcl/opscli pointer-consistency --pointer "0,0"
13
+ npx @dcl/opscli pointer-consistency --pointer "0,0" --env zone
14
+ npx @dcl/opscli pointer-consistency --cid "bafkrei..."
15
+ ```
16
+
17
+ - `--pointer` Scene pointer coordinate (e.g. `"0,0"`)
18
+ - `--cid` Entity ID to resolve the pointer from (alternative to `--pointer`)
19
+ - `--env` Environment: `org` (default), `today`, or `zone`
20
+ - `--registry` Which registry to read: `unity` (default) or `abgen` — see [asset bundle registries](#asset-bundle-registries)
21
+
22
+ ### Check world asset bundle status
23
+
24
+ Check asset bundle conversion status for all scenes in a world. Fetches scenes from the worlds-content-server, queries the asset bundle registry, and reports entity ID match, global status, and per-platform versions.
25
+
26
+ ```
27
+ npx @dcl/opscli world-ab-status --world "dalkia.dcl.eth"
28
+ npx @dcl/opscli world-ab-status --world "dalkia.dcl.eth" --env zone
29
+ npx @dcl/opscli world-ab-status --world "dalkia.dcl.eth" --registry abgen
30
+ ```
31
+
32
+ - `--world` World name (e.g. `"dalkia.dcl.eth"`)
33
+ - `--env` Environment: `org` (default), `today`, or `zone`
34
+ - `--registry` Which registry to read: `unity` (default) or `abgen` — see [asset bundle registries](#asset-bundle-registries)
35
+
36
+ ### Check the conversion queue
37
+
38
+ Report how many jobs are pending per platform queue, and optionally where given entities sit in them.
39
+
40
+ ```
41
+ npx @dcl/opscli ab-queue-status
42
+ npx @dcl/opscli ab-queue-status --env zone --registry abgen
43
+ npx @dcl/opscli ab-queue-status --cid "bafkrei..." --cid "bafkrei..."
44
+ ```
45
+
46
+ - `--env` Environment: `org` (default), `today`, or `zone`
47
+ - `--registry` Which registry's queue to read: `unity` (default) or `abgen`
48
+ - `--cid` Entity ID to locate in each queue; repeatable. Positions are 1-indexed — the next entity to convert is `#1`
49
+
50
+ ### Asset bundle registries
51
+
52
+ The Unity converters and the abgen generator publish to two separate registries:
53
+
54
+ | Registry | Base URL | Environments |
55
+ |---|---|---|
56
+ | `unity` (default) | `https://asset-bundle-registry.decentraland.<env>` | `org`, `today`, `zone` |
57
+ | `abgen` | `https://asset-bundle-registry-abgen.decentraland.<env>` | `org`, `zone` |
58
+
59
+ `--registry abgen` on `today` is rejected: abgen has no queue there and the hostname does not resolve.
60
+
61
+ The two count bundle versions in **separate series** — abgen is in the `v1000`s while the Unity
62
+ converters are in the `v40`s — so an abgen `v1003` is not "newer" than a Unity `v49`.
63
+
64
+ Both registries still return a `webgl` platform key, empty or years stale. It is decommissioned and
65
+ the status commands do not report it.
66
+
67
+ ### Schedule asset bundle conversion
68
+
69
+ ```
70
+ npx @dcl/opscli queue-ab-conversion \
71
+ --pointer "0,0" \
72
+ --pointer="110,10" \
73
+ --cid "110,10" \
74
+ --token <ACCESS_TOKEN> \
75
+ [--platform mac] \
76
+ [--platform windows] \
77
+ [--ab-server https://ab-admin.decentraland.org] \
78
+ [--content-server https://peer.decentraland.org/content]
79
+ ```
80
+ > **Note:** WebGL has been decommissioned and is no longer a valid platform target. Valid platforms are `windows`, `mac` and `abgen`.
81
+ > If no platform is specified, it runs for the default platforms (`windows`, `mac`). More than one can be specified at a time.
82
+ >
83
+ > `abgen` is not an OS: it routes the job to the abgen generator (the Rust asset-bundle pipeline), which converts every platform it supports in a single job. It is opt-in only — never included by default — and requires the target environment's ab-admin to have the abgen queue configured (currently `org` and `zone`; `today` has no abgen and returns a 400). `--prioritize` is accepted but abgen has a single queue with no priority lane, and `--animation`/`--doISS` are Unity-only and ignored by abgen.
84
+
85
+ > For dev, use `--ab-server https://ab-admin.decentraland.zone`.
86
+
87
+ ### Schedule asset bundle conversion of all worlds
88
+ ```
89
+ npx @dcl/opscli queue-ab-conversion-snapshot \
90
+ --snapshot worlds \
91
+ [--platform mac] \
92
+ [--platform windows] \
93
+ --token <ACCESS_TOKEN> \
94
+ [--ab-server https://ab-admin.decentraland.org]
95
+ ```
96
+
97
+ ### Schedule asset bundle conversion of a specific world by name
98
+ ```
99
+ npx @dcl/opscli queue-ab-conversion-snapshot \
100
+ --snapshot worlds \
101
+ [--platform mac] \
102
+ [--platform windows] \
103
+ --token <ACCESS_TOKEN> \
104
+ [--ab-server https://ab-admin.decentraland.org]
105
+ [--world-name <world-name.dcl.eth>]
106
+ ```
107
+
108
+ ### Schedule asset bundle conversion from custom about
109
+
110
+ ```
111
+ npx @dcl/opscli queue-ab-conversion-about \
112
+ --token <ACCESS_TOKEN> \
113
+ [--platform mac] \
114
+ [--platform windows] \
115
+ --about-url https://sdk-team-cdn.decentraland.org/ipfs/goerli-plaza-main/about \
116
+ [--ab-server https://ab-admin.decentraland.org]
117
+ ```
118
+
119
+ ### Check the status of conversion
120
+
121
+ ```
122
+ npx @dcl/opscli check-ab-conversion \
123
+ --pointer "0,0" \
124
+ --pointer "110,10" \
125
+ [--cid "bafy....."]
13
126
  ```
14
127
 
15
128
  ### `query-rollout`
@@ -52,6 +165,43 @@ Raw data for rollout "_site" for domain "play.decentraland.zone"
52
165
  ```
53
166
 
54
167
 
168
+
169
+ ### `download-entity`
170
+
171
+ Downloads a specific entity from a content server, as specified in https://adr.decentraland.org/adr/ADR-79
172
+
173
+ 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.
174
+
175
+ In the specified folder, it will create one
176
+
177
+ ```
178
+ $ npx @dcl/opscli download-entity \
179
+ --content-server https://play.decentraland.org/content \
180
+ --pointer=0,0 \
181
+ --pointer=urn:decentraland:off-chain:base-avatars:brown_pants \
182
+ --out ~/Downloads
183
+ ```
184
+
185
+ ### `deploy-entity`
186
+
187
+ Deploys an entity to a content server
188
+
189
+ - `--pointer` Pointers of the entities, can be used many times, e.g. `--pointer=0,0 --pointer=0,1`
190
+ - `--entity-type` Entity type
191
+ - `--private-key` or `PRIVATE_KEY` env var
192
+ - `--dry` do everything except publishing the entity
193
+ - `--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
194
+
195
+ ```
196
+ $ npx @dcl/opscli deploy-entity \
197
+ --dry \
198
+ --content-server https://peer.decentraland.org/content \
199
+ --entity-type wearable \
200
+ --folder=urn:decentraland:off-chain:base-avatars:brown_pants \
201
+ --pointer=urn:decentraland:off-chain:base-avatars:brown_pants \
202
+ --private-key=bde921a4a4abc644cced18f632aed0b3d34b1b36bc16fd97721ade1b7178cfff
203
+ ```
204
+
55
205
  ### `query-rollout`
56
206
 
57
207
  Usage:
package/dist/bin.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AAEA,qBAAa,QAAS,SAAQ,KAAK;CAAG"}
1
+ {"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AAmBA,qBAAa,QAAS,SAAQ,KAAK;CAAG"}
package/dist/bin.js CHANGED
@@ -1,28 +1,56 @@
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"));
22
+ const world_ab_status_1 = __importDefault(require("./commands/world-ab-status"));
23
+ const ab_queue_status_1 = __importDefault(require("./commands/ab-queue-status"));
5
24
  class CliError extends Error {
6
25
  }
7
26
  exports.CliError = CliError;
8
27
  const commands = {
9
- "query-rollout": "./commands/query-rollout",
10
- "wearables-consistency": "./commands/wearables-consistency",
11
- "pointer-consistency": "./commands/pointer-consistency",
12
- "update-renderer-upm": "./commands/update-renderer-upm",
13
- "secret-manager": "./commands/secret-manager",
14
- "parameters-manager": "./commands/parameters-manager"
28
+ 'query-rollout': query_rollout_1.default,
29
+ 'wearables-consistency': wearables_consistency_1.default,
30
+ 'pointer-consistency': pointer_consistency_1.default,
31
+ 'update-renderer-upm': update_renderer_upm_1.default,
32
+ 'secret-manager': secret_manager_1.default,
33
+ 'parameters-manager': parameters_manager_1.default,
34
+ 'download-entity': download_entity_1.default,
35
+ 'deploy-entity': deploy_entity_1.default,
36
+ 'queue-ab-conversion': queue_ab_conversion_1.default,
37
+ 'queue-ab-conversion-snapshot': queue_ab_conversion_snapshot_1.default,
38
+ 'queue-ab-conversion-about': queue_ab_conversion_about_1.default,
39
+ 'check-ab-conversion': check_ab_conversion_1.default,
40
+ circleci: circleci_1.default,
41
+ 'concat-snapshots': concat_snapshots_1.default,
42
+ 'world-ab-status': world_ab_status_1.default,
43
+ 'ab-queue-status': ab_queue_status_1.default
15
44
  };
16
45
  async function main() {
17
46
  const commandName = process.argv[2];
18
47
  if (!commandName || !commands[commandName]) {
19
- throw new CliError("Invalid command. Possible are:\n" +
48
+ throw new CliError('Invalid command. Possible are:\n' +
20
49
  Object.keys(commands)
21
- .map(($) => " npx @dcl/opscli " + $ + "\n")
22
- .join(""));
50
+ .map(($) => ' npx @dcl/opscli ' + $ + '\n')
51
+ .join(''));
23
52
  }
24
- const fn = require(commands[commandName]).default;
25
- await fn();
53
+ await commands[commandName]();
26
54
  }
27
55
  main().catch((err) => {
28
56
  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":";;;;AAEA,MAAa,QAAS,SAAQ,KAAK;CAAG;AAAtC,4BAAsC;AAEtC,MAAM,QAAQ,GAAG;IACf,eAAe,EAAE,0BAA0B;IAC3C,uBAAuB,EAAE,kCAAkC;IAC3D,qBAAqB,EAAE,gCAAgC;IACvD,qBAAqB,EAAE,gCAAgC;IACvD,gBAAgB,EAAE,2BAA2B;IAC7C,oBAAoB,EAAE,+BAA+B;CACtD,CAAA;AAED,KAAK,UAAU,IAAI;IACjB,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAA0B,CAAA;IAE5D,IAAI,CAAC,WAAW,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE;QAC1C,MAAM,IAAI,QAAQ,CAChB,kCAAkC;YAChC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC;iBAClB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,oBAAoB,GAAG,CAAC,GAAG,IAAI,CAAC;iBAC3C,IAAI,CAAC,EAAE,CAAC,CACd,CAAA;KACF;IAED,MAAM,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAA;IAEjD,MAAM,EAAE,EAAE,CAAA;AACZ,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,IAAI,GAAG,YAAY,QAAQ,EAAE;QAC3B,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;KACzB;SAAM;QACL,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;KACnB;IACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAA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C,CACd,CAAA;KACF;IAED,MAAM,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAA;AAC/B,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,IAAI,GAAG,YAAY,QAAQ,EAAE;QAC3B,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;KACzB;SAAM;QACL,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;KACnB;IACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export default function (): Promise<void>;
2
+ //# sourceMappingURL=ab-queue-status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ab-queue-status.d.ts","sourceRoot":"","sources":["../../src/commands/ab-queue-status.ts"],"names":[],"mappings":"AASA,0CAqCC"}
@@ -0,0 +1,40 @@
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 ab_registry_1 = require("../helpers/ab-registry");
10
+ async function default_1() {
11
+ const args = (0, arg_1.default)({
12
+ '--env': String,
13
+ '--registry': String,
14
+ '--cid': [String]
15
+ });
16
+ const env = args['--env'] || 'org';
17
+ const registry = (0, ab_registry_1.parseRegistry)(args['--registry'], env);
18
+ const cids = args['--cid'] || [];
19
+ const response = await (0, undici_1.fetch)(`${(0, ab_registry_1.registryUrlFor)(registry, env)}/queues/status`);
20
+ if (!response.ok) {
21
+ throw new bin_1.CliError(`! Registry returned ${response.status} for /queues/status`);
22
+ }
23
+ const queues = (await response.json());
24
+ console.log(`> Queue status [${registry}] (${env})`);
25
+ for (const platform of ab_registry_1.REPORTED_PLATFORMS) {
26
+ const jobs = queues[`${platform}PendingJobs`];
27
+ if (!jobs) {
28
+ console.log(` ${platform.padEnd(10)} no queue reported`);
29
+ continue;
30
+ }
31
+ console.log(` ${platform.padEnd(10)} ${jobs.length} pending job(s)`);
32
+ // Positions are 1-indexed: the next entity to be converted is #1.
33
+ for (const cid of cids) {
34
+ const index = jobs.indexOf(cid);
35
+ console.log(` ${cid}: ${index === -1 ? 'not in queue' : `position #${index + 1} of ${jobs.length}`}`);
36
+ }
37
+ }
38
+ }
39
+ exports.default = default_1;
40
+ //# sourceMappingURL=ab-queue-status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ab-queue-status.js","sourceRoot":"","sources":["../../src/commands/ab-queue-status.ts"],"names":[],"mappings":";;;;;AAAA,8CAAqB;AACrB,mCAA8B;AAC9B,gCAAiC;AACjC,wDAA0F;AAM3E,KAAK;IAClB,MAAM,IAAI,GAAG,IAAA,aAAG,EAAC;QACf,OAAO,EAAE,MAAM;QACf,YAAY,EAAE,MAAM;QACpB,OAAO,EAAE,CAAC,MAAM,CAAC;KAClB,CAAC,CAAA;IAEF,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,KAAK,CAAA;IAClC,MAAM,QAAQ,GAAG,IAAA,2BAAa,EAAC,IAAI,CAAC,YAAY,CAAC,EAAE,GAAG,CAAC,CAAA;IACvD,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAA;IAEhC,MAAM,QAAQ,GAAG,MAAM,IAAA,cAAK,EAAC,GAAG,IAAA,4BAAc,EAAC,QAAQ,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAA;IAE9E,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;QAChB,MAAM,IAAI,cAAQ,CAAC,uBAAuB,QAAQ,CAAC,MAAM,qBAAqB,CAAC,CAAA;KAChF;IAED,MAAM,MAAM,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAgB,CAAA;IAErD,OAAO,CAAC,GAAG,CAAC,mBAAmB,QAAQ,MAAM,GAAG,GAAG,CAAC,CAAA;IAEpD,KAAK,MAAM,QAAQ,IAAI,gCAAkB,EAAE;QACzC,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,QAAQ,aAAa,CAAC,CAAA;QAE7C,IAAI,CAAC,IAAI,EAAE;YACT,OAAO,CAAC,GAAG,CAAC,KAAK,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,oBAAoB,CAAC,CAAA;YACzD,SAAQ;SACT;QAED,OAAO,CAAC,GAAG,CAAC,KAAK,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,MAAM,iBAAiB,CAAC,CAAA;QAErE,kEAAkE;QAClE,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;YACtB,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;YAC/B,OAAO,CAAC,GAAG,CAAC,OAAO,GAAG,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,aAAa,KAAK,GAAG,CAAC,OAAO,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;SACzG;KACF;AACH,CAAC;AArCD,4BAqCC"}
@@ -0,0 +1,3 @@
1
+ declare const _default: () => Promise<void>;
2
+ export default _default;
3
+ //# sourceMappingURL=check-ab-conversion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check-ab-conversion.d.ts","sourceRoot":"","sources":["../../src/commands/check-ab-conversion.ts"],"names":[],"mappings":";AAMA,wBA+DC"}
@@ -0,0 +1,63 @@
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 resultWindows = await (0, undici_1.fetch)(`${abServer}/manifest/${entityId}_windows.json`);
55
+ const resultMac = await (0, undici_1.fetch)(`${abServer}/manifest/${entityId}_mac.json`);
56
+ console.log('WINDOWS');
57
+ await check(entityId, pointers, resultWindows);
58
+ console.log('MAC');
59
+ await check(entityId, pointers, resultMac);
60
+ }
61
+ console.log(`Finished!`);
62
+ };
63
+ //# 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":[],"mappings":";;;;;AAAA,0CAA6C;AAC7C,8CAAqB;AACrB,mCAAwC;AACxC,8CAA0C;AAC1C,oDAAwD;AAExD,kBAAe,KAAK,IAAI,EAAE;IACxB,MAAM,IAAI,GAAG,IAAA,aAAG,EAAC;QACf,OAAO,EAAE,CAAC,MAAM,CAAC;QACjB,WAAW,EAAE,CAAC,MAAM,CAAC;QACrB,kBAAkB,EAAE,MAAM;QAC1B,UAAU,EAAE,MAAM;KACnB,CAAC,CAAA;IAEF,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAA;IACxC,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAA;IAChC,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,iCAAiC,CAAA;IAEtE,IAAA,eAAM,EAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,iCAAiC,CAAC,CAAA;IAEjF,MAAM,UAAU,GAAG,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,uCAAuC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;IAE3G,MAAM,kBAAkB,GAA+C,EAAE,CAAA;IAEzE,IAAI,QAAQ,CAAC,MAAM,EAAE;QACnB,KAAK,MAAM,MAAM,IAAI,MAAM,IAAA,6BAAiB,EAAC,QAAQ,EAAE,UAAU,CAAC,EAAE;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CACT,MAAM,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,QAAQ,CAAC,OAAO,aAAa,QAAQ,CAAC,QAAQ,SAAS,QAAQ,CAAC,IAAI,EAAE,CACnH,CAAA;SACF;IACH,CAAC,CAAA;IAED,KAAK,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,kBAAkB,EAAE;QACvD,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,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,2 @@
1
+ export default function (): Promise<void>;
2
+ //# sourceMappingURL=circleci.d.ts.map
@@ -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,3 @@
1
+ declare const _default: () => Promise<void>;
2
+ export default _default;
3
+ //# sourceMappingURL=concat-snapshots.d.ts.map
@@ -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;IACrC,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAA;IACzB,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;IAChE,IAAI,aAAa,GAAG,CAAC,CAAA;IACrB,IAAI,UAAU,GAAG,CAAC,CAAA;IAClB,OAAO,CAAC,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,aAAa,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE;QACpE,MAAM,IAAI,GAAG,MAAM,CAAC,SAAS,CAAC,aAAa,EAAE,UAAU,CAAC,CAAA;QACxD,aAAa,GAAG,UAAU,CAAA;QAC1B,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,GAA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YACzB,MAAM,IAAI,cAAQ,CAAC,oBAAoB,QAAQ,EAAE,CAAC,CAAA;SACnD;KACF;IAED,MAAM,cAAc,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;IAC5D,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;IAC3B,MAAM,eAAe,GAAG,MAAM,IAAA,6BAAgB,EAAC,UAAU,IAAI,EAAE,CAAC,CAAA;IAChE,MAAM,eAAe,CAAC,eAAe,CAAC,kCAAkC,CAAC,CAAA;IACzE,KAAK,MAAM,YAAY,IAAI,cAAc,EAAE;QACzC,IAAI,KAAK,EAAE,MAAM,YAAY,IAAI,0BAA0B,CAAC,UAAU,EAAE,YAAY,CAAC,EAAE;YACrF,MAAM,MAAM,GAA2B,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;YAC/D,IAAI,UAAU,KAAK,aAAa,IAAI,MAAM,CAAC,UAAU,KAAK,UAAU,EAAE;gBACpE,MAAM,eAAe,CAAC,eAAe,CAAC,IAAI,CAAC,SAAS,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,3 @@
1
+ declare const _default: () => Promise<void>;
2
+ export default _default;
3
+ //# sourceMappingURL=deploy-entity.d.ts.map
@@ -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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AAK;aAC9B,CAAC,CAAA;YACF,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;YAC9B,OAAO,CAAC,GAAG,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,3 @@
1
+ declare const _default: () => Promise<void>;
2
+ export default _default;
3
+ //# sourceMappingURL=download-entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"download-entity.d.ts","sourceRoot":"","sources":["../../src/commands/download-entity.ts"],"names":[],"mappings":";AAKA,wBAqBC"}