@dcl/opscli 1.0.0-10506530876.commit-764fb71 → 1.0.0-10507092676.commit-a604d88
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/dist/bin.d.ts.map +1 -1
- package/dist/bin.js +42 -18
- package/dist/bin.js.map +1 -1
- package/dist/commands/check-ab-conversion.d.ts.map +1 -1
- package/dist/commands/check-ab-conversion.js +14 -14
- package/dist/commands/check-ab-conversion.js.map +1 -1
- package/dist/commands/circleci.js +10 -10
- package/dist/commands/circleci.js.map +1 -1
- package/dist/commands/concat-snapshots.js +12 -12
- package/dist/commands/concat-snapshots.js.map +1 -1
- package/dist/commands/deploy-entity.d.ts.map +1 -1
- package/dist/commands/deploy-entity.js +28 -26
- package/dist/commands/deploy-entity.js.map +1 -1
- package/dist/commands/download-entity.js +7 -7
- package/dist/commands/parameters-manager.js +22 -22
- package/dist/commands/parameters-manager.js.map +1 -1
- package/dist/commands/pointer-consistency.js +8 -8
- package/dist/commands/pointer-consistency.js.map +1 -1
- package/dist/commands/query-rollout.js +6 -6
- package/dist/commands/queue-ab-conversion-about.js +17 -17
- package/dist/commands/queue-ab-conversion-snapshot.d.ts.map +1 -1
- package/dist/commands/queue-ab-conversion-snapshot.js +39 -38
- package/dist/commands/queue-ab-conversion-snapshot.js.map +1 -1
- package/dist/commands/queue-ab-conversion.d.ts.map +1 -1
- package/dist/commands/queue-ab-conversion.js +20 -18
- package/dist/commands/queue-ab-conversion.js.map +1 -1
- package/dist/commands/secret-manager.js +28 -28
- package/dist/commands/secret-manager.js.map +1 -1
- package/dist/commands/update-renderer-upm.d.ts.map +1 -1
- package/dist/commands/update-renderer-upm.js +14 -14
- package/dist/commands/update-renderer-upm.js.map +1 -1
- package/dist/commands/wearables-consistency.js +5 -5
- package/dist/commands/wearables-consistency.js.map +1 -1
- package/dist/helpers/ago.js +10 -10
- package/dist/helpers/ago.js.map +1 -1
- package/dist/helpers/assert.d.ts +1 -1
- package/dist/helpers/asset-bundles.d.ts +1 -1
- package/dist/helpers/asset-bundles.d.ts.map +1 -1
- package/dist/helpers/asset-bundles.js +10 -9
- package/dist/helpers/asset-bundles.js.map +1 -1
- package/dist/helpers/catalysts.js +4 -4
- package/dist/helpers/downloads.d.ts +1 -1
- package/dist/helpers/downloads.js +6 -6
- package/dist/helpers/env-domains.js +9 -9
- package/dist/helpers/fileWriter.d.ts.map +1 -1
- package/dist/helpers/fileWriter.js +4 -1
- package/dist/helpers/fileWriter.js.map +1 -1
- package/dist/helpers/parse-utils.js +6 -6
- package/dist/helpers/parse-utils.js.map +1 -1
- package/dist/helpers/parseEntityUrn.d.ts.map +1 -1
- package/dist/helpers/parseEntityUrn.js.map +1 -1
- package/dist/helpers/rollouts.d.ts.map +1 -1
- package/dist/helpers/rollouts.js +2 -2
- package/dist/helpers/sign-gpg.js +5 -5
- package/package.json +18 -13
|
@@ -12,18 +12,18 @@ const bin_1 = require("../bin");
|
|
|
12
12
|
const parseEntityUrn_1 = require("../helpers/parseEntityUrn");
|
|
13
13
|
exports.default = async () => {
|
|
14
14
|
const args = (0, arg_1.default)({
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
'--about-url': String,
|
|
16
|
+
'--ab-server': String,
|
|
17
|
+
'--token': String,
|
|
18
|
+
'--force': Boolean,
|
|
19
|
+
'--prioritize': Boolean
|
|
20
20
|
});
|
|
21
|
-
const aboutUrl = args[
|
|
22
|
-
const token = args[
|
|
23
|
-
const abServer = args[
|
|
24
|
-
const force = args[
|
|
25
|
-
const shouldPrioritize = !!args[
|
|
26
|
-
(0, assert_1.assert)(!!token,
|
|
21
|
+
const aboutUrl = args['--about-url'];
|
|
22
|
+
const token = args['--token'];
|
|
23
|
+
const abServer = args['--ab-server'] || asset_bundles_1.multiPlatformFlag;
|
|
24
|
+
const force = args['--force'] || false;
|
|
25
|
+
const shouldPrioritize = !!args['--prioritize'];
|
|
26
|
+
(0, assert_1.assert)(!!token, '--token is missing');
|
|
27
27
|
console.log(`> Parameters:`);
|
|
28
28
|
console.log(` Asset bundle server: ${abServer}`);
|
|
29
29
|
console.log(` Force rebuild: ${force}`);
|
|
@@ -42,13 +42,13 @@ exports.default = async () => {
|
|
|
42
42
|
authChain: [
|
|
43
43
|
{
|
|
44
44
|
type: schemas_1.AuthLinkType.SIGNER,
|
|
45
|
-
payload:
|
|
46
|
-
signature:
|
|
47
|
-
}
|
|
48
|
-
]
|
|
45
|
+
payload: '0x0000000000000000000000000000000000000000',
|
|
46
|
+
signature: ''
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
49
|
},
|
|
50
|
-
contentServerUrls: [parsed.baseUrl ||
|
|
51
|
-
force
|
|
50
|
+
contentServerUrls: [parsed.baseUrl || 'https://peer.decentraland.org/content'],
|
|
51
|
+
force
|
|
52
52
|
}, token, shouldPrioritize);
|
|
53
53
|
console.log(` Result: ${JSON.stringify(result)}`);
|
|
54
54
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue-ab-conversion-snapshot.d.ts","sourceRoot":"","sources":["../../src/commands/queue-ab-conversion-snapshot.ts"],"names":[],"mappings":";AAWA,
|
|
1
|
+
{"version":3,"file":"queue-ab-conversion-snapshot.d.ts","sourceRoot":"","sources":["../../src/commands/queue-ab-conversion-snapshot.ts"],"names":[],"mappings":";AAWA,wBAmGC"}
|
|
@@ -14,29 +14,29 @@ const process_1 = require("process");
|
|
|
14
14
|
// PROCESS AN ENTIRE SNAPSHOT
|
|
15
15
|
exports.default = async () => {
|
|
16
16
|
const args = (0, arg_1.default)({
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
17
|
+
'--snapshot': String,
|
|
18
|
+
'--world-name': String,
|
|
19
|
+
'--content-server': String,
|
|
20
|
+
'--start-position': String,
|
|
21
|
+
'--start-date': String,
|
|
22
|
+
'--grep': String,
|
|
23
|
+
'--ab-server': String,
|
|
24
|
+
'--token': String,
|
|
25
|
+
'--prioritize': Boolean
|
|
26
26
|
});
|
|
27
|
-
const snapshot = args[
|
|
28
|
-
const token = args[
|
|
29
|
-
const abServer = args[
|
|
30
|
-
const shouldPrioritize = !!args[
|
|
31
|
-
(0, assert_1.assert)(!!snapshot,
|
|
32
|
-
(0, assert_1.assert)(!!token,
|
|
27
|
+
const snapshot = args['--snapshot'] || 'wearable';
|
|
28
|
+
const token = args['--token'];
|
|
29
|
+
const abServer = args['--ab-server'] || asset_bundles_1.multiPlatformFlag;
|
|
30
|
+
const shouldPrioritize = !!args['--prioritize'];
|
|
31
|
+
(0, assert_1.assert)(!!snapshot, '--snapshot is missing');
|
|
32
|
+
(0, assert_1.assert)(!!token, '--token is missing');
|
|
33
33
|
console.log(`> Parameters:`);
|
|
34
|
-
const contentUrl = (args[
|
|
34
|
+
const contentUrl = (args['--content-server'] || 'https://peer.decentraland.org/content').replace(/\/$/, '');
|
|
35
35
|
console.log(` Entity type: ${snapshot}`);
|
|
36
36
|
console.log(` Content server: ${contentUrl}`);
|
|
37
37
|
console.log(` Asset bundle server: ${abServer}`);
|
|
38
|
-
if (snapshot
|
|
39
|
-
|
|
38
|
+
if (snapshot === 'worlds') {
|
|
39
|
+
const specificWorld = args['--world-name'];
|
|
40
40
|
if (specificWorld) {
|
|
41
41
|
await processWorld(abServer, token, specificWorld, shouldPrioritize);
|
|
42
42
|
}
|
|
@@ -50,9 +50,9 @@ exports.default = async () => {
|
|
|
50
50
|
const snapshotReq = await (0, undici_1.fetch)(`${contentUrl}/snapshots`);
|
|
51
51
|
if (!snapshotReq.ok)
|
|
52
52
|
throw new bin_1.CliError(`Invalid snapshot response from ${contentUrl}/snapshots`);
|
|
53
|
-
const snapshotsJson = await snapshotReq.json();
|
|
53
|
+
const snapshotsJson = (await snapshotReq.json());
|
|
54
54
|
const startDate = (args['--start-date'] ? new Date(args['--start-date']).getTime() : 0) || -1;
|
|
55
|
-
|
|
55
|
+
const snapshotEntitiesToProcess = Array();
|
|
56
56
|
// select valid snapshots based on the start date
|
|
57
57
|
for (let i = 0; i < snapshotsJson.length; i++) {
|
|
58
58
|
const value = snapshotsJson[i];
|
|
@@ -62,13 +62,12 @@ exports.default = async () => {
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
const snapshotsCount = snapshotEntitiesToProcess.length;
|
|
65
|
-
if (snapshotsCount
|
|
65
|
+
if (snapshotsCount === 0) {
|
|
66
66
|
throw new bin_1.CliError(`No snapshot entity found at time ${startDate}`);
|
|
67
67
|
}
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
const argStartPosition = args['--start-position'];
|
|
69
|
+
const argGrep = args['--grep'];
|
|
70
70
|
let shouldSkipUntilStartPosition = argStartPosition || false;
|
|
71
|
-
let lastEntity = "";
|
|
72
71
|
for (let i = 0; i < snapshotsCount; i++) {
|
|
73
72
|
const hash = snapshotEntitiesToProcess[i].hash;
|
|
74
73
|
const numberOfEntities = snapshotEntitiesToProcess[i].numberOfEntities;
|
|
@@ -81,14 +80,14 @@ exports.default = async () => {
|
|
|
81
80
|
return;
|
|
82
81
|
const entity = JSON.parse(line);
|
|
83
82
|
if (shouldSkipUntilStartPosition) {
|
|
84
|
-
if (entity.entityId
|
|
83
|
+
if (entity.entityId === argStartPosition) {
|
|
85
84
|
shouldSkipUntilStartPosition = false;
|
|
86
85
|
}
|
|
87
86
|
else {
|
|
88
87
|
return;
|
|
89
88
|
}
|
|
90
89
|
}
|
|
91
|
-
if (startDate <= entity.entityTimestamp && entity.entityType
|
|
90
|
+
if (startDate <= entity.entityTimestamp && entity.entityType === snapshot) {
|
|
92
91
|
await tryRetryQueueConversion(abServer, entity.entityId, contentUrl, token, shouldPrioritize);
|
|
93
92
|
console.log(` (${i + 1}/${snapshotsCount}) [${percent}%]`, entity.entityId, entity.pointers[0]);
|
|
94
93
|
}
|
|
@@ -101,13 +100,13 @@ exports.default = async () => {
|
|
|
101
100
|
console.log(`Finished!`);
|
|
102
101
|
};
|
|
103
102
|
const processWorlds = async (abServer, token, prioritize) => {
|
|
104
|
-
console.log(
|
|
103
|
+
console.log('Processing worlds.');
|
|
105
104
|
const worldsIndexUrl = 'https://worlds-content-server.decentraland.org/index';
|
|
106
105
|
const worldsContentUrl = 'https://worlds-content-server.decentraland.org/';
|
|
107
106
|
const worldsReq = await (0, undici_1.fetch)(worldsIndexUrl);
|
|
108
107
|
if (!worldsReq.ok)
|
|
109
108
|
throw new bin_1.CliError(`Invalid response from ${worldsIndexUrl}`);
|
|
110
|
-
const worldsJson = await worldsReq.json();
|
|
109
|
+
const worldsJson = (await worldsReq.json());
|
|
111
110
|
if (!worldsJson.data)
|
|
112
111
|
throw new bin_1.CliError(`Json has invalid format`);
|
|
113
112
|
const worlds = worldsJson.data;
|
|
@@ -131,13 +130,12 @@ const processWorld = async (abServer, token, worldName, prioritize) => {
|
|
|
131
130
|
const worldsReq = await (0, undici_1.fetch)(worldsIndexUrl);
|
|
132
131
|
if (!worldsReq.ok)
|
|
133
132
|
throw new bin_1.CliError(`Invalid response from ${worldsIndexUrl}`);
|
|
134
|
-
const worldsJson = await worldsReq.json();
|
|
133
|
+
const worldsJson = (await worldsReq.json());
|
|
135
134
|
if (!worldsJson.data)
|
|
136
135
|
throw new bin_1.CliError(`Json has invalid format`);
|
|
137
136
|
const worlds = worldsJson.data;
|
|
138
|
-
const worldsCount = worlds.length;
|
|
139
137
|
if (worldName) {
|
|
140
|
-
const world = worlds.find(f => f.name
|
|
138
|
+
const world = worlds.find((f) => f.name === worldName);
|
|
141
139
|
if (!world) {
|
|
142
140
|
console.error(`World ${worldName} was not found in index. Cannot process.`);
|
|
143
141
|
}
|
|
@@ -161,20 +159,22 @@ const tryRetryQueueConversion = async (abServer, entityId, contentUrl, token, pr
|
|
|
161
159
|
try {
|
|
162
160
|
await (0, asset_bundles_1.queueConversions)(abServer, {
|
|
163
161
|
entity: {
|
|
164
|
-
entityId: entityId,
|
|
162
|
+
entityId: entityId,
|
|
163
|
+
authChain: [
|
|
165
164
|
{
|
|
166
165
|
type: schemas_1.AuthLinkType.SIGNER,
|
|
167
166
|
payload: '0x0000000000000000000000000000000000000000',
|
|
168
167
|
signature: ''
|
|
169
168
|
}
|
|
170
169
|
]
|
|
171
|
-
},
|
|
170
|
+
},
|
|
171
|
+
contentServerUrls: [contentUrl]
|
|
172
172
|
}, token, prioritize);
|
|
173
173
|
}
|
|
174
174
|
catch (error) {
|
|
175
175
|
console.log(`> Unexpected error, retrying in 5 seconds...`);
|
|
176
|
-
await new Promise(f => setTimeout(f, 5000));
|
|
177
|
-
tryRetryQueueConversion(abServer, entityId, contentUrl, token, prioritize, retryCount + 1);
|
|
176
|
+
await new Promise((f) => setTimeout(f, 5000));
|
|
177
|
+
await tryRetryQueueConversion(abServer, entityId, contentUrl, token, prioritize, retryCount + 1);
|
|
178
178
|
}
|
|
179
179
|
};
|
|
180
180
|
const processSnapshot = async (url, processLine, retryCount = 0, skipToIndex = -1) => {
|
|
@@ -187,9 +187,10 @@ const processSnapshot = async (url, processLine, retryCount = 0, skipToIndex = -
|
|
|
187
187
|
let index = 0;
|
|
188
188
|
try {
|
|
189
189
|
const response = await (0, undici_1.fetch)(url);
|
|
190
|
-
if (!response.ok)
|
|
190
|
+
if (!response.ok) {
|
|
191
191
|
throw new bin_1.CliError(`Invalid response from ${url}`);
|
|
192
|
-
|
|
192
|
+
}
|
|
193
|
+
for await (const data of response.body ?? []) {
|
|
193
194
|
const chunk = decoder.write(data);
|
|
194
195
|
const lines = (remaining + chunk).split('\n');
|
|
195
196
|
if (!chunk.endsWith('\n')) {
|
|
@@ -216,7 +217,7 @@ const processSnapshot = async (url, processLine, retryCount = 0, skipToIndex = -
|
|
|
216
217
|
}
|
|
217
218
|
catch (error) {
|
|
218
219
|
console.error(`Failed downloading snapshot ${url}: ${error} \n - Retrying in 5 seconds...`);
|
|
219
|
-
await new Promise(f => setTimeout(f, 5000));
|
|
220
|
+
await new Promise((f) => setTimeout(f, 5000));
|
|
220
221
|
await processSnapshot(url, processLine, retryCount + 1, index);
|
|
221
222
|
}
|
|
222
223
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue-ab-conversion-snapshot.js","sourceRoot":"","sources":["../../src/commands/queue-ab-conversion-snapshot.ts"],"names":[],"mappings":";;;;;AAAA,0CAA2C;AAC3C,8CAAqB;AACrB,mCAA8B;AAC9B,gCAAiC;AACjC,8CAA0C;AAC1C,4DAA8E;AAC9E,mDAA8C;AAC9C,qCAA8B;AAE9B,6BAA6B;AAE7B,kBAAe,KAAK,IAAI,EAAE;IACxB,MAAM,IAAI,GAAG,IAAA,aAAG,EAAC;QACf,YAAY,EAAE,MAAM;QACpB,cAAc,EAAE,MAAM;QACtB,kBAAkB,EAAE,MAAM;QAC1B,kBAAkB,EAAE,MAAM;QAC1B,cAAc,EAAE,MAAM;QACtB,QAAQ,EAAE,MAAM;QAChB,aAAa,EAAE,MAAM;QACrB,SAAS,EAAE,MAAM;QACjB,cAAc,EAAE,OAAO;KACxB,CAAC,CAAA;IAEF,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,IAAI,UAAU,CAAA;IACjD,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAE,CAAA;IAC9B,MAAM,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,iCAAiB,CAAA;IACzD,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"queue-ab-conversion-snapshot.js","sourceRoot":"","sources":["../../src/commands/queue-ab-conversion-snapshot.ts"],"names":[],"mappings":";;;;;AAAA,0CAA2C;AAC3C,8CAAqB;AACrB,mCAA8B;AAC9B,gCAAiC;AACjC,8CAA0C;AAC1C,4DAA8E;AAC9E,mDAA8C;AAC9C,qCAA8B;AAE9B,6BAA6B;AAE7B,kBAAe,KAAK,IAAI,EAAE;IACxB,MA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AAS,GAAG,KAAK,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;YAE7C,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;gBACzB,SAAS,GAAG,KAAK,CAAC,GAAG,EAAG,CAAA;aACzB;iBAAM;gBACL,SAAS,GAAG,EAAE,CAAA;aACf;YAED,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;gBACxB,IAAI,WAAW,GAAG,CAAC,IAAI,WAAW,IAAI,KAAK,EAAE;oBAC3C,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;wBAC/B,MAAM,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;qBAC/B;iBACF;gBACD,KAAK,EAAE,CAAA;gBACP,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,CAAA;aACnC;SACF;QAED,IAAI,SAAS,EAAE;YACb,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;gBACpC,MAAM,WAAW,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;aACpC;SACF;KACF;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,KAAK,CAAC,+BAA+B,GAAG,KAAK,KAAK,qCAAqC,CAAC,CAAA;QAChG,MAAM,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAA;QAC7C,MAAM,eAAe,CAAC,GAAG,EAAE,WAAW,EAAE,UAAU,GAAG,CAAC,EAAE,KAAK,CAAC,CAAA;KAC/D;AACH,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue-ab-conversion.d.ts","sourceRoot":"","sources":["../../src/commands/queue-ab-conversion.ts"],"names":[],"mappings":";AAMA,
|
|
1
|
+
{"version":3,"file":"queue-ab-conversion.d.ts","sourceRoot":"","sources":["../../src/commands/queue-ab-conversion.ts"],"names":[],"mappings":";AAMA,wBAmEC"}
|
|
@@ -10,24 +10,24 @@ const asset_bundles_1 = require("../helpers/asset-bundles");
|
|
|
10
10
|
const downloads_1 = require("../helpers/downloads");
|
|
11
11
|
exports.default = async () => {
|
|
12
12
|
const args = (0, arg_1.default)({
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
'--cid': [String],
|
|
14
|
+
'--pointer': [String],
|
|
15
|
+
'--content-server': String,
|
|
16
|
+
'--ab-server': String,
|
|
17
|
+
'--token': String,
|
|
18
|
+
'--prioritize': Boolean
|
|
19
19
|
});
|
|
20
|
-
const pointers = args[
|
|
21
|
-
const cids = args[
|
|
22
|
-
const token = args[
|
|
23
|
-
const abServer = args[
|
|
24
|
-
const shouldPrioritize = !!args[
|
|
25
|
-
(0, assert_1.assert)(!!token,
|
|
26
|
-
(0, assert_1.assert)(pointers.length > 0 || cids.length > 0,
|
|
20
|
+
const pointers = args['--pointer'] || [];
|
|
21
|
+
const cids = args['--cid'] || [];
|
|
22
|
+
const token = args['--token'];
|
|
23
|
+
const abServer = args['--ab-server'] || asset_bundles_1.multiPlatformFlag;
|
|
24
|
+
const shouldPrioritize = !!args['--prioritize'];
|
|
25
|
+
(0, assert_1.assert)(!!token, '--token is missing');
|
|
26
|
+
(0, assert_1.assert)(pointers.length > 0 || cids.length > 0, '--pointer or --cid are required');
|
|
27
27
|
console.log(`> Parameters:`);
|
|
28
|
-
pointers.length && console.log(` Pointers: ${pointers.join(
|
|
29
|
-
cids.length && console.log(` CIDs: ${cids.join(
|
|
30
|
-
const contentUrl = (args[
|
|
28
|
+
pointers.length && console.log(` Pointers: ${pointers.join(',')}`);
|
|
29
|
+
cids.length && console.log(` CIDs: ${cids.join(',')}`);
|
|
30
|
+
const contentUrl = (args['--content-server'] || 'https://peer.decentraland.org/content').replace(/\/$/, '');
|
|
31
31
|
console.log(` Content server: ${contentUrl}`);
|
|
32
32
|
console.log(` Asset bundle server: ${abServer}`);
|
|
33
33
|
const entityIdsToConvert = [];
|
|
@@ -49,14 +49,16 @@ exports.default = async () => {
|
|
|
49
49
|
console.log(`> Scheduling conversion of entity ${entity}`);
|
|
50
50
|
const result = await (0, asset_bundles_1.queueConversions)(abServer, {
|
|
51
51
|
entity: {
|
|
52
|
-
entityId: entity,
|
|
52
|
+
entityId: entity,
|
|
53
|
+
authChain: [
|
|
53
54
|
{
|
|
54
55
|
type: schemas_1.AuthLinkType.SIGNER,
|
|
55
56
|
payload: '0x0000000000000000000000000000000000000000',
|
|
56
57
|
signature: ''
|
|
57
58
|
}
|
|
58
59
|
]
|
|
59
|
-
},
|
|
60
|
+
},
|
|
61
|
+
contentServerUrls: [contentUrl]
|
|
60
62
|
}, token, shouldPrioritize);
|
|
61
63
|
console.log(` Result: ${JSON.stringify(result)}`);
|
|
62
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue-ab-conversion.js","sourceRoot":"","sources":["../../src/commands/queue-ab-conversion.ts"],"names":[],"mappings":";;;;;AAAA,0CAA2D;AAC3D,8CAAqB;AACrB,8CAA0C;AAC1C,4DAA8E;AAC9E,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,aAAa,EAAE,MAAM;QACrB,SAAS,EAAE,MAAM;QACjB,cAAc,EAAE,OAAO;KACxB,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,KAAK,GAAG,IAAI,CAAC,SAAS,CAAE,CAAA;I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AI,CAAC,GAAG,CAAC,CAAA;SAC7B;aAAM;YACL,OAAO,CAAC,GAAG,CAAC,kBAAkB,GAAG,sBAAsB,CAAC,CAAA;SACzD;KACF;IAED,KAAK,MAAM,MAAM,IAAI,kBAAkB,EAAE;QACvC,OAAO,CAAC,GAAG,CAAC,qCAAqC,MAAM,EAAE,CAAC,CAAA;QAC1D,MAAM,MAAM,GAAG,MAAM,IAAA,gCAAgB,EACnC,QAAQ,EACR;YACE,MAAM,EAAE;gBACN,QAAQ,EAAE,MAAM;gBAChB,SAAS,EAAE;oBACT;wBACE,IAAI,EAAE,sBAAY,CAAC,MAAM;wBACzB,OAAO,EAAE,4CAA4C;wBACrD,SAAS,EAAE,EAAE;qBACd;iBACF;aACF;YACD,iBAAiB,EAAE,CAAC,UAAU,CAAC;SAChC,EACD,KAAK,EACL,gBAAgB,CACjB,CAAA;QACD,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;KACnD;IAED,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;AAC1B,CAAC,CAAA"}
|
|
@@ -11,62 +11,62 @@ const env_domains_1 = require("../helpers/env-domains");
|
|
|
11
11
|
const sign_gpg_1 = require("../helpers/sign-gpg");
|
|
12
12
|
async function default_1() {
|
|
13
13
|
const args = (0, arg_1.default)({
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
'--env': String,
|
|
15
|
+
'--name': String,
|
|
16
|
+
'--secretFile': String,
|
|
17
|
+
'--secret': String,
|
|
18
|
+
'--update': Boolean,
|
|
19
|
+
'--delete': Boolean
|
|
20
20
|
});
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const hasSecretValue = !!args[
|
|
24
|
-
const hasSecretFile = !!args[
|
|
25
|
-
const hasUpdate = !!args[
|
|
26
|
-
const hasDelete = !!args[
|
|
21
|
+
const env = (0, assert_1.assert)(args['--env'], '--env is missing');
|
|
22
|
+
const name = (0, assert_1.assert)(args['--name'], '--name is missing');
|
|
23
|
+
const hasSecretValue = !!args['--secret'];
|
|
24
|
+
const hasSecretFile = !!args['--secretFile'];
|
|
25
|
+
const hasUpdate = !!args['--update'];
|
|
26
|
+
const hasDelete = !!args['--delete'];
|
|
27
27
|
if (hasSecretValue && hasSecretFile) {
|
|
28
|
-
throw new Error(
|
|
28
|
+
throw new Error('Cannot use both --secretFile and --secret');
|
|
29
29
|
}
|
|
30
30
|
if (hasDelete && (hasSecretFile || hasSecretValue)) {
|
|
31
|
-
throw new Error(
|
|
31
|
+
throw new Error('Cannot use --delete with --secretFile or --secret');
|
|
32
32
|
}
|
|
33
33
|
if (hasDelete && hasUpdate) {
|
|
34
|
-
throw new Error(
|
|
34
|
+
throw new Error('Cannot use --delete with --update');
|
|
35
35
|
}
|
|
36
36
|
if (!hasDelete && !hasSecretValue && !hasSecretFile) {
|
|
37
|
-
throw new Error(
|
|
37
|
+
throw new Error('You must provide either --secretFile, --secret or --delete');
|
|
38
38
|
}
|
|
39
|
-
let secretContent =
|
|
39
|
+
let secretContent = '';
|
|
40
40
|
if (hasDelete) {
|
|
41
|
-
secretContent =
|
|
41
|
+
secretContent = '';
|
|
42
42
|
}
|
|
43
43
|
else if (hasSecretValue) {
|
|
44
|
-
secretContent = args[
|
|
44
|
+
secretContent = args['--secret'];
|
|
45
45
|
}
|
|
46
46
|
else if (hasSecretFile) {
|
|
47
|
-
secretContent = (await promises_1.default.readFile(args[
|
|
47
|
+
secretContent = (await promises_1.default.readFile(args['--secretFile'])).toString();
|
|
48
48
|
}
|
|
49
|
-
const fileContent = [env, name, secretContent].join(
|
|
49
|
+
const fileContent = [env, name, secretContent].join('\n');
|
|
50
50
|
const envDomain = (0, env_domains_1.tldFromEnv)(env);
|
|
51
51
|
const signed = await (0, sign_gpg_1.signGpgCleartext)(fileContent);
|
|
52
52
|
if (hasDelete) {
|
|
53
|
-
console.log(
|
|
53
|
+
console.log('> Deleting the secrets...');
|
|
54
54
|
}
|
|
55
55
|
else {
|
|
56
|
-
console.log(
|
|
56
|
+
console.log('> Uploading the secrets...');
|
|
57
57
|
}
|
|
58
58
|
const res = await (0, undici_1.fetch)(`https://ops-lambdas.decentraland.${envDomain}/secrets-manager`, {
|
|
59
|
-
method: hasDelete ?
|
|
60
|
-
body: signed.toString()
|
|
59
|
+
method: hasDelete ? 'DELETE' : hasUpdate ? 'PUT' : 'POST',
|
|
60
|
+
body: signed.toString()
|
|
61
61
|
});
|
|
62
62
|
const response = await res.text();
|
|
63
|
-
if (res.status
|
|
64
|
-
if (response.includes(
|
|
63
|
+
if (res.status !== 200) {
|
|
64
|
+
if (response.includes('ResourceExistsException')) {
|
|
65
65
|
throw new Error("That secret already exists, please use '--update' if you want to update it");
|
|
66
66
|
}
|
|
67
67
|
throw new Error(`An error has occured while uploading the secret: ${response}`);
|
|
68
68
|
}
|
|
69
|
-
console.log(
|
|
69
|
+
console.log(' OK! Response:');
|
|
70
70
|
console.log(response);
|
|
71
71
|
}
|
|
72
72
|
exports.default = default_1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secret-manager.js","sourceRoot":"","sources":["../../src/commands/secret-manager.ts"],"names":[],"mappings":";;;;;AAAA,8CAAqB;AACrB,2DAA4B;AAC5B,mCAA8B;AAC9B,8CAA0C;AAC1C,wDAAmD;AACnD,kDAAsD;AAEvC,KAAK;IAClB,MAAM,IAAI,GAAG,IAAA,aAAG,EAAC;QACf,OAAO,EAAE,MAAM;QACf,QAAQ,EAAE,MAAM;QAChB,cAAc,EAAE,MAAM;QACtB,UAAU,EAAE,MAAM;QAClB,UAAU,EAAE,OAAO;QACnB,UAAU,EAAE,OAAO;KACpB,CAAC,CAAA;IAEF,
|
|
1
|
+
{"version":3,"file":"secret-manager.js","sourceRoot":"","sources":["../../src/commands/secret-manager.ts"],"names":[],"mappings":";;;;;AAAA,8CAAqB;AACrB,2DAA4B;AAC5B,mCA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,GAAG,CAAC,QAAQ,CAAC,CAAA;AACvB,CAAC;AAzED,4BAyEC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-renderer-upm.d.ts","sourceRoot":"","sources":["../../src/commands/update-renderer-upm.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"update-renderer-upm.d.ts","sourceRoot":"","sources":["../../src/commands/update-renderer-upm.ts"],"names":[],"mappings":";AAsBA,wBA0CC"}
|
|
@@ -8,40 +8,40 @@ const assert_1 = require("../helpers/assert");
|
|
|
8
8
|
const simple_git_1 = __importDefault(require("simple-git"));
|
|
9
9
|
const bin_1 = require("../bin");
|
|
10
10
|
const parse_utils_1 = require("../helpers/parse-utils");
|
|
11
|
-
const git = (0, simple_git_1.default)(process.cwd(), { binary:
|
|
11
|
+
const git = (0, simple_git_1.default)(process.cwd(), { binary: 'git' });
|
|
12
12
|
const getLastCommitHash = async (branch) => {
|
|
13
|
-
const list = await git.listRemote([
|
|
13
|
+
const list = await git.listRemote(['https://github.com/decentraland/unity-renderer.git', branch]);
|
|
14
14
|
if (!list) {
|
|
15
15
|
throw new bin_1.CliError(`'${branch}' is not a valid branch.\n`);
|
|
16
16
|
}
|
|
17
|
-
return list.split(
|
|
17
|
+
return list.split('\t')[0];
|
|
18
18
|
};
|
|
19
19
|
exports.default = async () => {
|
|
20
20
|
const args = (0, arg_1.default)({
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
'--branch': String,
|
|
22
|
+
'--path': String
|
|
23
23
|
});
|
|
24
|
-
const branch = args[
|
|
25
|
-
const path = `${process.cwd()}/${args[
|
|
26
|
-
(0, assert_1.assert)(branch || path,
|
|
27
|
-
(0, assert_1.assert)((0, parse_utils_1.validDesktopLocation)(),
|
|
24
|
+
const branch = args['--branch'];
|
|
25
|
+
const path = `${process.cwd()}/${args['--path']}`;
|
|
26
|
+
(0, assert_1.assert)(branch || path, '--branch and --path are missing');
|
|
27
|
+
(0, assert_1.assert)((0, parse_utils_1.validDesktopLocation)(), 'Invalid explorer-desktop location. Please set your terminal to a valid explorer-desktop repository.');
|
|
28
28
|
if (branch) {
|
|
29
29
|
const commitHash = await getLastCommitHash(branch);
|
|
30
30
|
const gitUrl = `git+https://github.com/decentraland/unity-renderer.git?path=unity-renderer/Assets#${branch}`;
|
|
31
31
|
(0, parse_utils_1.changeJSONFile)(parse_utils_1.packagesLockPath, (content) => {
|
|
32
|
-
content[
|
|
33
|
-
content[
|
|
32
|
+
content['dependencies']['com.decentraland.unity-renderer']['hash'] = commitHash;
|
|
33
|
+
content['dependencies']['com.decentraland.unity-renderer']['version'] = gitUrl;
|
|
34
34
|
});
|
|
35
35
|
(0, parse_utils_1.changeJSONFile)(parse_utils_1.manifestPath, (content) => {
|
|
36
|
-
content[
|
|
36
|
+
content['dependencies']['com.decentraland.unity-renderer'] = gitUrl;
|
|
37
37
|
});
|
|
38
38
|
console.log(`Done! unity-renderer remote branch=${branch} hash=${commitHash}`);
|
|
39
39
|
}
|
|
40
40
|
else if (path) {
|
|
41
41
|
const upmPath = (0, parse_utils_1.getUPMRendererPath)(path);
|
|
42
|
-
(0, assert_1.assert)(upmPath,
|
|
42
|
+
(0, assert_1.assert)(upmPath, 'Invalid file path. Please, set the location for the unity-render UPM');
|
|
43
43
|
(0, parse_utils_1.changeJSONFile)(parse_utils_1.manifestPath, (content) => {
|
|
44
|
-
content[
|
|
44
|
+
content['dependencies']['com.decentraland.unity-renderer'] = `file:${upmPath}`;
|
|
45
45
|
});
|
|
46
46
|
console.log(`Done! unity-renderer local file=${upmPath}`);
|
|
47
47
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-renderer-upm.js","sourceRoot":"","sources":["../../src/commands/update-renderer-upm.ts"],"names":[],"mappings":";;;;;AAAA,8CAAqB;AACrB,8CAA0C;AAC1C,4DAAiD;AACjD,gCAAiC;AACjC,
|
|
1
|
+
{"version":3,"file":"update-renderer-upm.js","sourceRoot":"","sources":["../../src/commands/update-renderer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CAAiC,CAAC,CAAC,MAAM,CAAC,GAAG,UAAU,CAAA;YAC/E,OAAO,CAAC,cAAc,CAAC,CAAC,iCAAiC,CAAC,CAAC,SAAS,CAAC,GAAG,MAAM,CAAA;QAChF,CAAC,CAAC,CAAA;QAEF,IAAA,4BAAc,EAAC,0BAAY,EAAE,CAAC,OAAY,EAAO,EAAE;YACjD,OAAO,CAAC,cAAc,CAAC,CAAC,iCAAiC,CAAC,GAAG,MAAM,CAAA;QACrE,CAAC,CAAC,CAAA;QAEF,OAAO,CAAC,GAAG,CAAC,sCAAsC,MAAM,SAAS,UAAU,EAAE,CAAC,CAAA;KAC/E;SAAM,IAAI,IAAI,EAAE;QACf,MAAM,OAAO,GAAG,IAAA,gCAAkB,EAAC,IAAI,CAAC,CAAA;QAExC,IAAA,eAAM,EAAC,OAAO,EAAE,sEAAsE,CAAC,CAAA;QAEvF,IAAA,4BAAc,EAAC,0BAAY,EAAE,CAAC,OAAY,EAAO,EAAE;YACjD,OAAO,CAAC,cAAc,CAAC,CAAC,iCAAiC,CAAC,GAAG,QAAQ,OAAO,EAAE,CAAA;QAChF,CAAC,CAAC,CAAA;QAEF,OAAO,CAAC,GAAG,CAAC,mCAAmC,OAAO,EAAE,CAAC,CAAA;KAC1D;AACH,CAAC,CAAA"}
|
|
@@ -8,16 +8,16 @@ const assert_1 = require("../helpers/assert");
|
|
|
8
8
|
const catalysts_1 = require("../helpers/catalysts");
|
|
9
9
|
async function default_1() {
|
|
10
10
|
const args = (0, arg_1.default)({
|
|
11
|
-
|
|
11
|
+
'--address': String
|
|
12
12
|
});
|
|
13
|
-
const address = (0, assert_1.assert)(args[
|
|
13
|
+
const address = (0, assert_1.assert)(args['--address'], '--address is missing');
|
|
14
14
|
const catalysts = await (0, catalysts_1.daoCatalysts)();
|
|
15
15
|
console.log(` Got ${catalysts.length} catalysts`);
|
|
16
16
|
console.log(`> Fetching wearables in every catalyst`);
|
|
17
17
|
const results = await Promise.allSettled(catalysts.map(($) => (0, catalysts_1.fetchWearablesByAddress)($.baseUrl, address)));
|
|
18
|
-
for (
|
|
19
|
-
if (result.status
|
|
20
|
-
console.log(' ' + result.value.baseUrl +
|
|
18
|
+
for (const result of results) {
|
|
19
|
+
if (result.status === 'fulfilled') {
|
|
20
|
+
console.log(' ' + result.value.baseUrl + ': ' + result.value.wearables.length);
|
|
21
21
|
}
|
|
22
22
|
else {
|
|
23
23
|
console.error(result.reason);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wearables-consistency.js","sourceRoot":"","sources":["../../src/commands/wearables-consistency.ts"],"names":[],"mappings":";;;;;AAAA,8CAAqB;AACrB,8CAA0C;AAC1C,oDAA4E;AAE7D,KAAK;IAClB,MAAM,IAAI,GAAG,IAAA,aAAG,EAAC;QACf,WAAW,EAAE,MAAM;KACpB,CAAC,CAAA;IAEF,MAAM,OAAO,GAAG,IAAA,eAAM,EAAC,IAAI,CAAC,WAAW,CAAC,EAAE,sBAAsB,CAAC,CAAA;IAEjE,MAAM,SAAS,GAAG,MAAM,IAAA,wBAAY,GAAE,CAAA;IAEtC,OAAO,CAAC,GAAG,CAAC,SAAS,SAAS,CAAC,MAAM,YAAY,CAAC,CAAA;IAClD,OAAO,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAA;IAErD,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,mCAAuB,EAAC,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAA;IAE3G,KAAK,
|
|
1
|
+
{"version":3,"file":"wearables-consistency.js","sourceRoot":"","sources":["../../src/commands/wearables-consistency.ts"],"names":[],"mappings":";;;;;AAAA,8CAAqB;AACrB,8CAA0C;AAC1C,oDAA4E;AAE7D,KAAK;IAClB,MAAM,IAAI,GAAG,IAAA,aAAG,EAAC;QACf,WAAW,EAAE,MAAM;KACpB,CAAC,CAAA;IAEF,MAAM,OAAO,GAAG,IAAA,eAAM,EAAC,IAAI,CAAC,WAAW,CAAC,EAAE,sBAAsB,CAAC,CAAA;IAEjE,MAAM,SAAS,GAAG,MAAM,IAAA,wBAAY,GAAE,CAAA;IAEtC,OAAO,CAAC,GAAG,CAAC,SAAS,SAAS,CAAC,MAAM,YAAY,CAAC,CAAA;IAClD,OAAO,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAA;IAErD,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,mCAAuB,EAAC,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAA;IAE3G,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;QAC5B,IAAI,MAAM,CAAC,MAAM,KAAK,WAAW,EAAE;YACjC,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,GAAG,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAA;SAChF;aAAM;YACL,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;SAC7B;KACF;AACH,CAAC;AArBD,4BAqBC"}
|
package/dist/helpers/ago.js
CHANGED
|
@@ -2,21 +2,21 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ago = void 0;
|
|
4
4
|
function format(diff, divisor, unit, past, future, isInTheFuture) {
|
|
5
|
-
|
|
5
|
+
const val = Math.round(Math.abs(diff) / divisor);
|
|
6
6
|
if (isInTheFuture)
|
|
7
|
-
return val <= 1 ? future :
|
|
8
|
-
return val <= 1 ? past : val +
|
|
7
|
+
return val <= 1 ? future : 'in ' + val + ' ' + unit + 's';
|
|
8
|
+
return val <= 1 ? past : val + ' ' + unit + 's ago';
|
|
9
9
|
}
|
|
10
10
|
const units = [
|
|
11
|
-
{ max: 2760000, value: 60000, name:
|
|
12
|
-
{ max: 72000000, value: 3600000, name:
|
|
13
|
-
{ max: 518400000, value: 86400000, name:
|
|
14
|
-
{ max: 2419200000, value: 604800000, name:
|
|
15
|
-
{ max: 28512000000, value: 2592000000, name:
|
|
11
|
+
{ max: 2760000, value: 60000, name: 'minute', past: 'a minute ago', future: 'in a minute' },
|
|
12
|
+
{ max: 72000000, value: 3600000, name: 'hour', past: 'an hour ago', future: 'in an hour' },
|
|
13
|
+
{ max: 518400000, value: 86400000, name: 'day', past: 'yesterday', future: 'tomorrow' },
|
|
14
|
+
{ max: 2419200000, value: 604800000, name: 'week', past: 'last week', future: 'in a week' },
|
|
15
|
+
{ max: 28512000000, value: 2592000000, name: 'month', past: 'last month', future: 'in a month' } // max: 11 months
|
|
16
16
|
];
|
|
17
17
|
function ago(date, max) {
|
|
18
18
|
const diff = Date.now() - date.getTime();
|
|
19
|
-
for (
|
|
19
|
+
for (let i = 0; i < units.length; i++) {
|
|
20
20
|
if (Math.abs(diff) < units[i].max || (max && units[i].name === max)) {
|
|
21
21
|
return format(diff, units[i].value, units[i].name, units[i].past, units[i].future, diff < 0);
|
|
22
22
|
}
|
|
@@ -29,7 +29,7 @@ function ago(date, max) {
|
|
|
29
29
|
// name: 'year',
|
|
30
30
|
// past: 'last year'
|
|
31
31
|
// }
|
|
32
|
-
return format(diff, 31536000000,
|
|
32
|
+
return format(diff, 31536000000, 'year', 'last year', 'in a year', diff < 0);
|
|
33
33
|
}
|
|
34
34
|
exports.ago = ago;
|
|
35
35
|
//# sourceMappingURL=ago.js.map
|