@dcl/opscli 1.0.0-3097989545.commit-80fe4dc → 1.0.0-34383266436.commit-41a928d

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 (94) hide show
  1. package/README.md +117 -1
  2. package/dist/bin.d.ts.map +1 -1
  3. package/dist/bin.js +37 -11
  4. package/dist/bin.js.map +1 -1
  5. package/dist/commands/check-ab-conversion.d.ts +3 -0
  6. package/dist/commands/check-ab-conversion.d.ts.map +1 -0
  7. package/dist/commands/check-ab-conversion.js +63 -0
  8. package/dist/commands/check-ab-conversion.js.map +1 -0
  9. package/dist/commands/circleci.d.ts +2 -0
  10. package/dist/commands/circleci.d.ts.map +1 -0
  11. package/dist/commands/circleci.js +33 -0
  12. package/dist/commands/circleci.js.map +1 -0
  13. package/dist/commands/concat-snapshots.d.ts +3 -0
  14. package/dist/commands/concat-snapshots.d.ts.map +1 -0
  15. package/dist/commands/concat-snapshots.js +69 -0
  16. package/dist/commands/concat-snapshots.js.map +1 -0
  17. package/dist/commands/deploy-entity.d.ts +3 -0
  18. package/dist/commands/deploy-entity.d.ts.map +1 -0
  19. package/dist/commands/deploy-entity.js +90 -0
  20. package/dist/commands/deploy-entity.js.map +1 -0
  21. package/dist/commands/download-entity.d.ts +3 -0
  22. package/dist/commands/download-entity.d.ts.map +1 -0
  23. package/dist/commands/download-entity.js +50 -0
  24. package/dist/commands/download-entity.js.map +1 -0
  25. package/dist/commands/parameters-manager.d.ts.map +1 -1
  26. package/dist/commands/parameters-manager.js +30 -15
  27. package/dist/commands/parameters-manager.js.map +1 -1
  28. package/dist/commands/pointer-consistency.d.ts.map +1 -1
  29. package/dist/commands/pointer-consistency.js +111 -14
  30. package/dist/commands/pointer-consistency.js.map +1 -1
  31. package/dist/commands/query-rollout.js +8 -8
  32. package/dist/commands/query-rollout.js.map +1 -1
  33. package/dist/commands/queue-ab-conversion-about.d.ts +3 -0
  34. package/dist/commands/queue-ab-conversion-about.d.ts.map +1 -0
  35. package/dist/commands/queue-ab-conversion-about.js +61 -0
  36. package/dist/commands/queue-ab-conversion-about.js.map +1 -0
  37. package/dist/commands/queue-ab-conversion-snapshot.d.ts +3 -0
  38. package/dist/commands/queue-ab-conversion-snapshot.d.ts.map +1 -0
  39. package/dist/commands/queue-ab-conversion-snapshot.js +228 -0
  40. package/dist/commands/queue-ab-conversion-snapshot.js.map +1 -0
  41. package/dist/commands/queue-ab-conversion.d.ts +3 -0
  42. package/dist/commands/queue-ab-conversion.d.ts.map +1 -0
  43. package/dist/commands/queue-ab-conversion.js +80 -0
  44. package/dist/commands/queue-ab-conversion.js.map +1 -0
  45. package/dist/commands/secret-manager.d.ts.map +1 -1
  46. package/dist/commands/secret-manager.js +46 -22
  47. package/dist/commands/secret-manager.js.map +1 -1
  48. package/dist/commands/update-renderer-upm.d.ts.map +1 -1
  49. package/dist/commands/update-renderer-upm.js +14 -14
  50. package/dist/commands/update-renderer-upm.js.map +1 -1
  51. package/dist/commands/wearables-consistency.js +5 -5
  52. package/dist/commands/wearables-consistency.js.map +1 -1
  53. package/dist/commands/world-ab-status.d.ts +2 -0
  54. package/dist/commands/world-ab-status.d.ts.map +1 -0
  55. package/dist/commands/world-ab-status.js +108 -0
  56. package/dist/commands/world-ab-status.js.map +1 -0
  57. package/dist/helpers/ago.js +10 -10
  58. package/dist/helpers/ago.js.map +1 -1
  59. package/dist/helpers/assert.d.ts +1 -1
  60. package/dist/helpers/asset-bundles.d.ts +12 -0
  61. package/dist/helpers/asset-bundles.d.ts.map +1 -0
  62. package/dist/helpers/asset-bundles.js +45 -0
  63. package/dist/helpers/asset-bundles.js.map +1 -0
  64. package/dist/helpers/catalysts.d.ts +1 -1
  65. package/dist/helpers/catalysts.d.ts.map +1 -1
  66. package/dist/helpers/catalysts.js +4 -4
  67. package/dist/helpers/downloads.d.ts +6 -0
  68. package/dist/helpers/downloads.d.ts.map +1 -0
  69. package/dist/helpers/downloads.js +48 -0
  70. package/dist/helpers/downloads.js.map +1 -0
  71. package/dist/helpers/env-domains.d.ts +1 -1
  72. package/dist/helpers/env-domains.js +9 -9
  73. package/dist/helpers/fileWriter.d.ts +7 -0
  74. package/dist/helpers/fileWriter.d.ts.map +1 -0
  75. package/dist/helpers/fileWriter.js +86 -0
  76. package/dist/helpers/fileWriter.js.map +1 -0
  77. package/dist/helpers/parse-utils.js +11 -7
  78. package/dist/helpers/parse-utils.js.map +1 -1
  79. package/dist/helpers/parseEntityUrn.d.ts +6 -0
  80. package/dist/helpers/parseEntityUrn.d.ts.map +1 -0
  81. package/dist/helpers/parseEntityUrn.js +23 -0
  82. package/dist/helpers/parseEntityUrn.js.map +1 -0
  83. package/dist/helpers/recurse-folder.d.ts +2 -0
  84. package/dist/helpers/recurse-folder.d.ts.map +1 -0
  85. package/dist/helpers/recurse-folder.js +40 -0
  86. package/dist/helpers/recurse-folder.js.map +1 -0
  87. package/dist/helpers/rollouts.d.ts +4 -6
  88. package/dist/helpers/rollouts.d.ts.map +1 -1
  89. package/dist/helpers/rollouts.js +2 -2
  90. package/dist/helpers/rollouts.js.map +1 -1
  91. package/dist/helpers/sign-gpg.js +5 -5
  92. package/dist/helpers/types.d.ts +1 -1
  93. package/dist/helpers/types.d.ts.map +1 -1
  94. package/package.json +22 -13
package/README.md CHANGED
@@ -6,10 +6,89 @@ 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
+
21
+ ### Check world asset bundle status
22
+
23
+ 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.
24
+
25
+ ```
26
+ npx @dcl/opscli world-ab-status --world "dalkia.dcl.eth"
27
+ npx @dcl/opscli world-ab-status --world "dalkia.dcl.eth" --env zone
28
+ ```
29
+
30
+ - `--world` World name (e.g. `"dalkia.dcl.eth"`)
31
+ - `--env` Environment: `org` (default), `today`, or `zone`
32
+
33
+ ### Schedule asset bundle conversion
34
+
35
+ ```
36
+ npx @dcl/opscli queue-ab-conversion \
37
+ --pointer "0,0" \
38
+ --pointer="110,10" \
39
+ --cid "110,10" \
40
+ --token <ACCESS_TOKEN> \
41
+ [--platform mac] \
42
+ [--platform windows] \
43
+ [--ab-server https://ab-admin.decentraland.org] \
44
+ [--content-server https://peer.decentraland.org/content]
45
+ ```
46
+ > **Note:** WebGL has been decommissioned and is no longer a valid platform target. Valid platforms are `windows`, `mac` and `abgen`.
47
+ > If no platform is specified, it runs for the default platforms (`windows`, `mac`). More than one can be specified at a time.
48
+ >
49
+ > `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.
50
+
51
+ > For dev, use `--ab-server https://ab-admin.decentraland.zone`.
52
+
53
+ ### Schedule asset bundle conversion of all worlds
54
+ ```
55
+ npx @dcl/opscli queue-ab-conversion-snapshot \
56
+ --snapshot worlds \
57
+ [--platform mac] \
58
+ [--platform windows] \
59
+ --token <ACCESS_TOKEN> \
60
+ [--ab-server https://ab-admin.decentraland.org]
61
+ ```
62
+
63
+ ### Schedule asset bundle conversion of a specific world by name
64
+ ```
65
+ npx @dcl/opscli queue-ab-conversion-snapshot \
66
+ --snapshot worlds \
67
+ [--platform mac] \
68
+ [--platform windows] \
69
+ --token <ACCESS_TOKEN> \
70
+ [--ab-server https://ab-admin.decentraland.org]
71
+ [--world-name <world-name.dcl.eth>]
72
+ ```
73
+
74
+ ### Schedule asset bundle conversion from custom about
75
+
76
+ ```
77
+ npx @dcl/opscli queue-ab-conversion-about \
78
+ --token <ACCESS_TOKEN> \
79
+ [--platform mac] \
80
+ [--platform windows] \
81
+ --about-url https://sdk-team-cdn.decentraland.org/ipfs/goerli-plaza-main/about \
82
+ [--ab-server https://ab-admin.decentraland.org]
83
+ ```
84
+
85
+ ### Check the status of conversion
86
+
87
+ ```
88
+ npx @dcl/opscli check-ab-conversion \
89
+ --pointer "0,0" \
90
+ --pointer "110,10" \
91
+ [--cid "bafy....."]
13
92
  ```
14
93
 
15
94
  ### `query-rollout`
@@ -52,6 +131,43 @@ Raw data for rollout "_site" for domain "play.decentraland.zone"
52
131
  ```
53
132
 
54
133
 
134
+
135
+ ### `download-entity`
136
+
137
+ Downloads a specific entity from a content server, as specified in https://adr.decentraland.org/adr/ADR-79
138
+
139
+ 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.
140
+
141
+ In the specified folder, it will create one
142
+
143
+ ```
144
+ $ npx @dcl/opscli download-entity \
145
+ --content-server https://play.decentraland.org/content \
146
+ --pointer=0,0 \
147
+ --pointer=urn:decentraland:off-chain:base-avatars:brown_pants \
148
+ --out ~/Downloads
149
+ ```
150
+
151
+ ### `deploy-entity`
152
+
153
+ Deploys an entity to a content server
154
+
155
+ - `--pointer` Pointers of the entities, can be used many times, e.g. `--pointer=0,0 --pointer=0,1`
156
+ - `--entity-type` Entity type
157
+ - `--private-key` or `PRIVATE_KEY` env var
158
+ - `--dry` do everything except publishing the entity
159
+ - `--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
160
+
161
+ ```
162
+ $ npx @dcl/opscli deploy-entity \
163
+ --dry \
164
+ --content-server https://peer.decentraland.org/content \
165
+ --entity-type wearable \
166
+ --folder=urn:decentraland:off-chain:base-avatars:brown_pants \
167
+ --pointer=urn:decentraland:off-chain:base-avatars:brown_pants \
168
+ --private-key=bde921a4a4abc644cced18f632aed0b3d34b1b36bc16fd97721ade1b7178cfff
169
+ ```
170
+
55
171
  ### `query-rollout`
56
172
 
57
173
  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":";AAkBA,qBAAa,QAAS,SAAQ,KAAK;CAAG"}
package/dist/bin.js CHANGED
@@ -1,28 +1,54 @@
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"));
5
23
  class CliError extends Error {
6
24
  }
7
25
  exports.CliError = CliError;
8
26
  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"
27
+ 'query-rollout': query_rollout_1.default,
28
+ 'wearables-consistency': wearables_consistency_1.default,
29
+ 'pointer-consistency': pointer_consistency_1.default,
30
+ 'update-renderer-upm': update_renderer_upm_1.default,
31
+ 'secret-manager': secret_manager_1.default,
32
+ 'parameters-manager': parameters_manager_1.default,
33
+ 'download-entity': download_entity_1.default,
34
+ 'deploy-entity': deploy_entity_1.default,
35
+ 'queue-ab-conversion': queue_ab_conversion_1.default,
36
+ 'queue-ab-conversion-snapshot': queue_ab_conversion_snapshot_1.default,
37
+ 'queue-ab-conversion-about': queue_ab_conversion_about_1.default,
38
+ 'check-ab-conversion': check_ab_conversion_1.default,
39
+ circleci: circleci_1.default,
40
+ 'concat-snapshots': concat_snapshots_1.default,
41
+ 'world-ab-status': world_ab_status_1.default
15
42
  };
16
43
  async function main() {
17
44
  const commandName = process.argv[2];
18
45
  if (!commandName || !commands[commandName]) {
19
- throw new CliError("Invalid command. Possible are:\n" +
46
+ throw new CliError('Invalid command. Possible are:\n' +
20
47
  Object.keys(commands)
21
- .map(($) => " npx @dcl/opscli " + $ + "\n")
22
- .join(""));
48
+ .map(($) => ' npx @dcl/opscli ' + $ + '\n')
49
+ .join(''));
23
50
  }
24
- const fn = require(commands[commandName]).default;
25
- await fn();
51
+ await commands[commandName]();
26
52
  }
27
53
  main().catch((err) => {
28
54
  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,CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";;;;;;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AE,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,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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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,CAA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AK,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;AAClC,6DAA4E;AAC5E,wCAA2C;AAC3C,6CAAwC;AACxC,oDAAiF;AACjF,gDAAuB;AACvB,2BAA+B;AAC/B,gCAAiC;AACjC,8CAAqB;AACrB,qCAAgC;AAChC,8DAAyD;AACzD,4EAA6E;AAG7E,kBAAe,KAAK,IAAI,EAAE;IACxB,MAAM,IAAI,GAAG,IAAA,aAAG,EAAC;QACf,UAAU,EAAE,MAAM;QAClB,eAAe,EAAE,MAAM;QACvB,eAAe,EAAE,MAAM;QACvB,WAAW,EAAE,CAAC,MAAM,CAAC;QACrB,kBAAkB,EAAE,MAAM;QAC1B,OAAO,EAAE,OAAO;KACjB,CAAC,CAAA;IAEF,MAAM,MAAM,GAAG,cAAI,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;IAC9D,MA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C,GAAG,CAAC,iCAAiC,OAAO,EAAE,CAAC,CAAA;IAEvD,MAAM,WAAW,GAAG,sBAAa,CAAC,yBAAyB,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAA;IACtF,MAAM,SAAS,GAAG,oBAAS,CAAC,IAAI,CAAC,UAAW,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAA;IACvF,MAAM,SAAS,GAAG,sBAAa,CAAC,qBAAqB,CAAC,gBAAgB,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC,CAAA;IACpG,OAAO,CAAC,GAAG,CAAC,iCAAiC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;IAEzE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;QAClB,IAAI;YACF,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;gBACjC,QAAQ,EAAE,gBAAgB,CAAC,QAAQ;gBACnC,SAAS,EAAE,SAAS;gBACpB,KAAK,EAAE,gBAAgB,CAAC,KAAK;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"}
@@ -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,MAAM;KAChB,CAAC,CAAA;IAEF,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAE,CAAA;IAEnC,IAAA,eAAM,EAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,sBAAsB,CAAC,CAAA;IAEnD,MAAM,MAAM,GAAG,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,uCAAuC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;IACvG,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,GAAG,EAAE,CAAA;IAE1C,MAAM,QAAQ,GAAG,MAAM,IAAA,6BAAiB,EAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;IAE1D,KAAK,MAAM,MAAM,IAAI,QAAQ,EAAE;QAC7B,MAAM,UAAU,GAAG,IAAA,WAAI,EAAC,IAAA,cAAO,EAAC,GAAG,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,cAAI,CAAC,GAAG,CAAA;QACpE,OAAO,CAAC,GAAG,CAAC,sCAAsC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,UAAU,EAAE,CAAC,CAAA;QACjG,MAAM,IAAA,qCAAyB,EAAC,MAAM,EAAE,MAAM,EAAE,UAAU,CAAC,CAAA;KAC5D;AACH,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"parameters-manager.d.ts","sourceRoot":"","sources":["../../src/commands/parameters-manager.ts"],"names":[],"mappings":"AAMA,0CAqCC"}
1
+ {"version":3,"file":"parameters-manager.d.ts","sourceRoot":"","sources":["../../src/commands/parameters-manager.ts"],"names":[],"mappings":"AAMA,0CAsDC"}