@dcl/opscli 1.0.0-1824517621.commit-3be0afd

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,54 @@
1
+ # @decentraland/opscli
2
+
3
+ Operations command line tool. You must login with NPM and your github user to use this command line.
4
+
5
+ ## Login with Github to private NPM registry:
6
+
7
+ ```
8
+ $ npm login --scope=@decentraland --registry=https://npm.pkg.github.com
9
+
10
+ > Username: USERNAME
11
+ > Password: TOKEN
12
+ > Email: PUBLIC-EMAIL-ADDRESS
13
+ ```
14
+
15
+ More info: https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry
16
+
17
+ ### `query-rollout`
18
+
19
+ Usage:
20
+
21
+ ```
22
+ $ npx @decentraland/opscli@next query-rollout --domain play.decentraland.zone --rolloutName _site
23
+
24
+ Current rollouts for domain "play.decentraland.zone" for this request
25
+ ┌─────────────────────┬────────────┬─────────────────────────┬───────────────────────────────────┐
26
+ │ (index) │ percentage │ prefix │ version │
27
+ ├─────────────────────┼────────────┼─────────────────────────┼───────────────────────────────────┤
28
+ │ _site │ 100 │ '@dcl/explorer-website' │ '0.0.1-1133229304.commit-901ee9a' │
29
+ │ @dcl/kernel │ 100 │ '@dcl/kernel' │ '1.0.0-1133249286.commit-a9ca05e' │
30
+ │ @dcl/unity-renderer │ 100 │ '@dcl/unity-renderer' │ '1.0.10553' │
31
+ └─────────────────────┴────────────┴─────────────────────────┴───────────────────────────────────┘
32
+ Raw data for rollout "_site" for domain "play.decentraland.zone"
33
+ ┌─────────┬────────────┬───────────────────────────────────┐
34
+ │ (index) │ percentage │ version │
35
+ ├─────────┼────────────┼───────────────────────────────────┤
36
+ │ 0 │ 100 │ '0.0.1-1133229304.commit-901ee9a' │
37
+ │ 1 │ 100 │ '0.0.1-1129066963.commit-a6c2178' │
38
+ │ 2 │ 100 │ '0.0.1-1125482159.commit-645a9e8' │
39
+ │ 3 │ 100 │ '0.0.1-1124920935.commit-57e48a2' │
40
+ │ 4 │ 100 │ '0.0.1-1121248349.commit-0568cf7' │
41
+ │ 5 │ 100 │ '0.0.1-1120296389.commit-cd95321' │
42
+ │ 6 │ 100 │ '0.0.1-1120045215.commit-7d17a4e' │
43
+ │ 7 │ 100 │ '0.0.1-1117962007.commit-cd75435' │
44
+ │ 8 │ 100 │ '0.0.1-1117258971.commit-bee96ab' │
45
+ │ 9 │ 100 │ '0.0.1-1114103774.commit-cfe9ba9' │
46
+ │ 10 │ 100 │ '0.0.1-1114086203.commit-cc86da6' │
47
+ │ 11 │ 100 │ '0.0.1-1105802712.commit-80b54a0' │
48
+ │ 12 │ 100 │ '0.0.1-1105772932.commit-ff46bfb' │
49
+ │ 13 │ 100 │ '0.0.1-1105284880.commit-32d26de' │
50
+ │ 14 │ 100 │ '0.0.1-1094578839.commit-e8461eb' │
51
+ │ 15 │ 100 │ '0.0.1-1092142520.commit-746716e' │
52
+ │ 16 │ 100 │ '0.0.1-1091984380.commit-77a1383' │
53
+ └─────────┴────────────┴───────────────────────────────────┘
54
+ ```
package/dist/bin.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ export declare class CliError extends Error {
3
+ }
4
+ //# sourceMappingURL=bin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AAEA,qBAAa,QAAS,SAAQ,KAAK;CAAG"}
package/dist/bin.js ADDED
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.CliError = void 0;
5
+ class CliError extends Error {
6
+ }
7
+ exports.CliError = CliError;
8
+ const commands = {
9
+ "query-rollout": "./commands/query-rollout",
10
+ "wearables-consistency": "./commands/wearables-consistency",
11
+ "pointer-consistency": "./commands/pointer-consistency",
12
+ };
13
+ async function main() {
14
+ const commandName = process.argv[2];
15
+ if (!commandName || !commands[commandName]) {
16
+ throw new CliError("Invalid command. Possible are:\n" +
17
+ Object.keys(commands)
18
+ .map(($) => " npx @dcl/opscli " + $ + "\n")
19
+ .join(""));
20
+ }
21
+ const fn = require(commands[commandName]).default;
22
+ await fn();
23
+ }
24
+ main().catch((err) => {
25
+ if (err instanceof CliError) {
26
+ console.log(err.message);
27
+ }
28
+ else {
29
+ console.error(err);
30
+ }
31
+ process.exit(1);
32
+ });
33
+ //# sourceMappingURL=bin.js.map
@@ -0,0 +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;CACxD,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"}
@@ -0,0 +1,2 @@
1
+ export default function (): Promise<void>;
2
+ //# sourceMappingURL=pointer-consistency.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pointer-consistency.d.ts","sourceRoot":"","sources":["../../src/commands/pointer-consistency.ts"],"names":[],"mappings":"AAIA,0CA0BC"}
@@ -0,0 +1,32 @@
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 assert_1 = require("../helpers/assert");
8
+ const catalysts_1 = require("../helpers/catalysts");
9
+ async function default_1() {
10
+ const args = arg_1.default({
11
+ "--pointer": String,
12
+ });
13
+ const pointer = assert_1.assert(args["--pointer"], "--pointer is missing");
14
+ const catalysts = await catalysts_1.daoCatalysts();
15
+ console.log(` Got ${catalysts.length} catalysts`);
16
+ console.log(`> Fetching wearables in every catalyst`);
17
+ for (let { baseUrl } of catalysts) {
18
+ try {
19
+ const result = await catalysts_1.fetchEntityByPointer(baseUrl, pointer);
20
+ console.log(" " +
21
+ result.baseUrl.padEnd(45, ' ') +
22
+ new Date(result.deployments[0]?.entityTimestamp).toISOString() +
23
+ " " +
24
+ result.deployments[0]?.entityId);
25
+ }
26
+ catch (err) {
27
+ console.log(" " + baseUrl.padEnd(45, ' ') + err.message);
28
+ }
29
+ }
30
+ }
31
+ exports.default = default_1;
32
+ //# sourceMappingURL=pointer-consistency.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pointer-consistency.js","sourceRoot":"","sources":["../../src/commands/pointer-consistency.ts"],"names":[],"mappings":";;;;;AAAA,8CAAqB;AACrB,8CAA0C;AAC1C,oDAAkG;AAEnF,KAAK;IAClB,MAAM,IAAI,GAAG,aAAG,CAAC;QACf,WAAW,EAAE,MAAM;KACpB,CAAC,CAAA;IAEF,MAAM,OAAO,GAAG,eAAM,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,sBAAsB,CAAC,CAAA;IAEjE,MAAM,SAAS,GAAG,MAAM,wBAAY,EAAE,CAAA;IAEtC,OAAO,CAAC,GAAG,CAAC,SAAS,SAAS,CAAC,MAAM,YAAY,CAAC,CAAA;IAClD,OAAO,CAAC,GAAG,CAAC,wCAAwC,CAAC,CAAA;IAErD,KAAK,IAAI,EAAE,OAAO,EAAE,IAAI,SAAS,EAAE;QACjC,IAAI;YACF,MAAM,MAAM,GAAG,MAAM,gCAAoB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;YAC3D,OAAO,CAAC,GAAG,CACT,IAAI;gBACF,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,CAAC;gBAC9B,IAAI,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,WAAW,EAAE;gBAC9D,GAAG;gBACH,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,QAAQ,CAClC,CAAA;SACF;QAAC,OAAO,GAAQ,EAAE;YACjB,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC,CAAA;SAC1D;KACF;AACH,CAAC;AA1BD,4BA0BC"}
@@ -0,0 +1,3 @@
1
+ declare const _default: () => Promise<void>;
2
+ export default _default;
3
+ //# sourceMappingURL=query-rollout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-rollout.d.ts","sourceRoot":"","sources":["../../src/commands/query-rollout.ts"],"names":[],"mappings":";AAIA,wBAiCC"}
@@ -0,0 +1,34 @@
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 assert_1 = require("../helpers/assert");
8
+ const rollouts_1 = require("../helpers/rollouts");
9
+ exports.default = async () => {
10
+ const args = arg_1.default({
11
+ "--domain": String,
12
+ "--rolloutName": String,
13
+ });
14
+ const domain = args["--domain"];
15
+ assert_1.assert(domain, "--domain is missing");
16
+ const rollouts = await rollouts_1.checkRollouts(domain);
17
+ console.group(`Current rollouts for domain "${domain}" for this request`);
18
+ console.table(rollouts.map);
19
+ console.groupEnd();
20
+ const rolloutName = args["--rolloutName"];
21
+ if (rolloutName) {
22
+ console.group(`Raw data for rollout "${rolloutName}" for domain "${domain}"`);
23
+ const rollout = rollouts.rollout.records[rolloutName];
24
+ // Simulate the distribution for 1000 sessions
25
+ let totalSessions = 1000.0;
26
+ for (let i = 0; i < rollout.length; ++i) {
27
+ rollout[i].each1000sessions = Math.round((totalSessions * rollout[i].percentage) / 100.0);
28
+ totalSessions -= rollout[i].each1000sessions;
29
+ }
30
+ console.table(rollout, ["percentage", "version", "each1000sessions"]);
31
+ console.groupEnd();
32
+ }
33
+ };
34
+ //# sourceMappingURL=query-rollout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-rollout.js","sourceRoot":"","sources":["../../src/commands/query-rollout.ts"],"names":[],"mappings":";;;;;AAAA,8CAAqB;AACrB,8CAA0C;AAC1C,kDAAmD;AAEnD,kBAAe,KAAK,IAAI,EAAE;IACxB,MAAM,IAAI,GAAG,aAAG,CAAC;QACf,UAAU,EAAE,MAAM;QAClB,eAAe,EAAE,MAAM;KACxB,CAAC,CAAA;IAEF,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAE,CAAA;IAEhC,eAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAA;IAErC,MAAM,QAAQ,GAAG,MAAM,wBAAa,CAAC,MAAM,CAAC,CAAA;IAE5C,OAAO,CAAC,KAAK,CAAC,gCAAgC,MAAM,oBAAoB,CAAC,CAAA;IACzE,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;IAC3B,OAAO,CAAC,QAAQ,EAAE,CAAA;IAElB,MAAM,WAAW,GAAG,IAAI,CAAC,eAAe,CAAC,CAAA;IAEzC,IAAI,WAAW,EAAE;QACf,OAAO,CAAC,KAAK,CAAC,yBAAyB,WAAW,iBAAiB,MAAM,GAAG,CAAC,CAAA;QAE7E,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,CAAA;QAErD,8CAA8C;QAC9C,IAAI,aAAa,GAAG,MAAM,CAAA;QAC1B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;YACvC,OAAO,CAAC,CAAC,CAAC,CAAC,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,aAAa,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,KAAK,CAAC,CAAA;YACzF,aAAa,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAA;SAC7C;QAED,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,YAAY,EAAE,SAAS,EAAE,kBAAkB,CAAC,CAAC,CAAA;QACrE,OAAO,CAAC,QAAQ,EAAE,CAAA;KACnB;AACH,CAAC,CAAA"}
@@ -0,0 +1,2 @@
1
+ export default function (): Promise<void>;
2
+ //# sourceMappingURL=wearables-consistency.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wearables-consistency.d.ts","sourceRoot":"","sources":["../../src/commands/wearables-consistency.ts"],"names":[],"mappings":"AAKA,0CAqBC"}
@@ -0,0 +1,28 @@
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 assert_1 = require("../helpers/assert");
8
+ const catalysts_1 = require("../helpers/catalysts");
9
+ async function default_1() {
10
+ const args = arg_1.default({
11
+ "--address": String,
12
+ });
13
+ const address = assert_1.assert(args["--address"], "--address is missing");
14
+ const catalysts = await catalysts_1.daoCatalysts();
15
+ console.log(` Got ${catalysts.length} catalysts`);
16
+ console.log(`> Fetching wearables in every catalyst`);
17
+ const results = await Promise.allSettled(catalysts.map(($) => catalysts_1.fetchWearablesByAddress($.baseUrl, address)));
18
+ for (let result of results) {
19
+ if (result.status == "fulfilled") {
20
+ console.log(' ' + result.value.baseUrl + ": " + result.value.wearables.length);
21
+ }
22
+ else {
23
+ console.error(result.reason);
24
+ }
25
+ }
26
+ }
27
+ exports.default = default_1;
28
+ //# sourceMappingURL=wearables-consistency.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wearables-consistency.js","sourceRoot":"","sources":["../../src/commands/wearables-consistency.ts"],"names":[],"mappings":";;;;;AAAA,8CAAqB;AAErB,8CAA0C;AAC1C,oDAA4E;AAE7D,KAAK;IAClB,MAAM,IAAI,GAAG,aAAG,CAAC;QACf,WAAW,EAAE,MAAM;KACpB,CAAC,CAAA;IAEF,MAAM,OAAO,GAAG,eAAM,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,sBAAsB,CAAC,CAAA;IAEjE,MAAM,SAAS,GAAG,MAAM,wBAAY,EAAE,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,mCAAuB,CAAC,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAA;IAE3G,KAAK,IAAI,MAAM,IAAI,OAAO,EAAE;QAC1B,IAAI,MAAM,CAAC,MAAM,IAAI,WAAW,EAAE;YAChC,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"}
@@ -0,0 +1,2 @@
1
+ export declare function assert<T>(cond: T | undefined | null | false | 0 | "", message: string): T | never;
2
+ //# sourceMappingURL=assert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert.d.ts","sourceRoot":"","sources":["../../src/helpers/assert.ts"],"names":[],"mappings":"AAAA,wBAAgB,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,SAAS,GAAG,IAAI,GAAG,KAAK,GAAG,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,CAAC,GAAG,KAAK,CAGjG"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.assert = void 0;
4
+ function assert(cond, message) {
5
+ if (!cond)
6
+ throw new Error(message);
7
+ return cond;
8
+ }
9
+ exports.assert = assert;
10
+ //# sourceMappingURL=assert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert.js","sourceRoot":"","sources":["../../src/helpers/assert.ts"],"names":[],"mappings":";;;AAAA,SAAgB,MAAM,CAAI,IAA2C,EAAE,OAAe;IACpF,IAAI,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAA;IACnC,OAAO,IAAK,CAAA;AACd,CAAC;AAHD,wBAGC"}
@@ -0,0 +1,29 @@
1
+ export declare type DAOCatalyst = {
2
+ baseUrl: string;
3
+ owner: string;
4
+ id: string;
5
+ };
6
+ export declare function daoCatalysts(): Promise<Array<DAOCatalyst>>;
7
+ export declare function fetchWearablesByAddress(baseUrl: string, address: string): Promise<{
8
+ baseUrl: string;
9
+ wearables: {
10
+ urn: string;
11
+ amount: number;
12
+ }[];
13
+ }>;
14
+ export declare function fetchEntityByPointer(baseUrl: string, pointer: string): Promise<{
15
+ baseUrl: string;
16
+ deployments: {
17
+ entityId: string;
18
+ entityVersion: string;
19
+ entityType: string;
20
+ entityTimestamp: number;
21
+ metadata: unknown;
22
+ pointers: string[];
23
+ content: {
24
+ key: string;
25
+ hash: string;
26
+ }[];
27
+ }[];
28
+ }>;
29
+ //# sourceMappingURL=catalysts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalysts.d.ts","sourceRoot":"","sources":["../../src/helpers/catalysts.ts"],"names":[],"mappings":"AAEA,oBAAY,WAAW,GAAG;IACxB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,EAAE,EAAE,MAAM,CAAA;CACX,CAAA;AAED,wBAAsB,YAAY,IAAI,OAAO,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAGhE;AAED,wBAAsB,uBAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;;;aAKvD,MAAM;gBAAU,MAAM;;GAE5C;AAED,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;;;kBAM3D,MAAM;uBACD,MAAM;oBACT,MAAM;yBACD,MAAM;kBACb,OAAO;kBACP,MAAM,EAAE;iBACT;YAAC,GAAG,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAC,EAAE;;GAG3C"}
@@ -0,0 +1,27 @@
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
+ exports.fetchEntityByPointer = exports.fetchWearablesByAddress = exports.daoCatalysts = void 0;
7
+ const node_fetch_1 = __importDefault(require("node-fetch"));
8
+ async function daoCatalysts() {
9
+ console.log("> Fetching DAO catalysts");
10
+ return await node_fetch_1.default("https://peer.decentraland.org/lambdas/contracts/servers").then(($) => $.json());
11
+ }
12
+ exports.daoCatalysts = daoCatalysts;
13
+ async function fetchWearablesByAddress(baseUrl, address) {
14
+ return {
15
+ baseUrl,
16
+ wearables: (await node_fetch_1.default(`${baseUrl}/lambdas/collections/wearables-by-owner/${address}`).then(($) => $.json())),
17
+ };
18
+ }
19
+ exports.fetchWearablesByAddress = fetchWearablesByAddress;
20
+ async function fetchEntityByPointer(baseUrl, pointer) {
21
+ return {
22
+ baseUrl,
23
+ deployments: (await node_fetch_1.default(`${baseUrl}/content/deployments?pointer=${encodeURIComponent(pointer)}&onlyCurrentlyPointed=true`).then(($) => $.json()).then($ => $.deployments)),
24
+ };
25
+ }
26
+ exports.fetchEntityByPointer = fetchEntityByPointer;
27
+ //# sourceMappingURL=catalysts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalysts.js","sourceRoot":"","sources":["../../src/helpers/catalysts.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA8B;AAQvB,KAAK,UAAU,YAAY;IAChC,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAA;IACvC,OAAO,MAAM,oBAAK,CAAC,yDAAyD,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAA;AACrG,CAAC;AAHD,oCAGC;AAEM,KAAK,UAAU,uBAAuB,CAAC,OAAe,EAAE,OAAe;IAC5E,OAAO;QACL,OAAO;QACP,SAAS,EAAE,CAAC,MAAM,oBAAK,CAAC,GAAG,OAAO,2CAA2C,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CACjG,CAAC,CAAC,IAAI,EAAE,CACT,CAA2C;KAC7C,CAAA;AACH,CAAC;AAPD,0DAOC;AAEM,KAAK,UAAU,oBAAoB,CAAC,OAAe,EAAE,OAAe;IACzE,OAAO;QACL,OAAO;QACP,WAAW,EAAE,CAAC,MAAM,oBAAK,CAAC,GAAG,OAAO,gCAAgC,kBAAkB,CAAC,OAAO,CAAC,4BAA4B,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CACtI,CAAC,CAAC,IAAI,EAAE,CACT,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,CAQvB;KACJ,CAAA;AACH,CAAC;AAfD,oDAeC"}
@@ -0,0 +1,18 @@
1
+ declare type Rollout = {
2
+ percentage: number;
3
+ prefix: string;
4
+ version: string;
5
+ each1000sessions: number;
6
+ };
7
+ declare type Rollouts = {
8
+ map: Record<string, Rollout>;
9
+ rollout: {
10
+ records: Record<string, [Rollout]>;
11
+ };
12
+ };
13
+ /**
14
+ * @public
15
+ */
16
+ export declare function checkRollouts(domain: string): Promise<Rollouts>;
17
+ export {};
18
+ //# sourceMappingURL=rollouts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rollouts.d.ts","sourceRoot":"","sources":["../../src/helpers/rollouts.ts"],"names":[],"mappings":"AAEA,aAAK,OAAO,GAAG;IACb,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,gBAAgB,EAAE,MAAM,CAAA;CACzB,CAAA;AAED,aAAK,QAAQ,GAAG;IACd,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC5B,OAAO,EAAE;QACP,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,CAAC,CAAA;KACnC,CAAA;CACF,CAAA;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAKrE"}
@@ -0,0 +1,19 @@
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
+ exports.checkRollouts = void 0;
7
+ const node_fetch_1 = __importDefault(require("node-fetch"));
8
+ /**
9
+ * @public
10
+ */
11
+ async function checkRollouts(domain) {
12
+ const url = `https://${domain}`;
13
+ const res = await node_fetch_1.default(url, { headers: { "x-debug-rollouts": "true" } });
14
+ if (!res.ok)
15
+ throw new Error("Non-ok response from " + url);
16
+ return res.json();
17
+ }
18
+ exports.checkRollouts = checkRollouts;
19
+ //# sourceMappingURL=rollouts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rollouts.js","sourceRoot":"","sources":["../../src/helpers/rollouts.ts"],"names":[],"mappings":";;;;;;AAAA,4DAA8B;AAgB9B;;GAEG;AACI,KAAK,UAAU,aAAa,CAAC,MAAc;IAChD,MAAM,GAAG,GAAG,WAAW,MAAM,EAAE,CAAA;IAC/B,MAAM,GAAG,GAAG,MAAM,oBAAK,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,EAAE,kBAAkB,EAAE,MAAM,EAAE,EAAE,CAAC,CAAA;IACzE,IAAI,CAAC,GAAG,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,GAAG,GAAG,CAAC,CAAA;IAC3D,OAAO,GAAG,CAAC,IAAI,EAAE,CAAA;AACnB,CAAC;AALD,sCAKC"}
@@ -0,0 +1,2 @@
1
+ export declare type Command = () => Promise<void>;
2
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/helpers/types.ts"],"names":[],"mappings":"AAAA,oBAAY,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/helpers/types.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@dcl/opscli",
3
+ "version": "1.0.0-1824517621.commit-3be0afd",
4
+ "description": "base component",
5
+ "bin": "dist/bin.js",
6
+ "main": "dist/index.js",
7
+ "typings": "dist/index.d.ts",
8
+ "scripts": {
9
+ "prestart": "make build-ts",
10
+ "start": "./dist/bin.js"
11
+ },
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git+https://github.com/decentraland/opscli.git"
15
+ },
16
+ "keywords": [],
17
+ "author": "",
18
+ "license": "Apache-2.0",
19
+ "bugs": {
20
+ "url": "https://github.com/decentraland/opscli/issues"
21
+ },
22
+ "prettier": {
23
+ "printWidth": 120,
24
+ "semi": false
25
+ },
26
+ "homepage": "https://github.com/decentraland/opscli#readme",
27
+ "devDependencies": {
28
+ "@microsoft/api-extractor": "^7.17.0",
29
+ "@types/jest": "^26.0.23",
30
+ "@types/node": "^14.17.4",
31
+ "@types/node-fetch": "^2.5.12",
32
+ "jest": "^27.0.6",
33
+ "ts-jest": "^27.0.3",
34
+ "typescript": "^4.3.5"
35
+ },
36
+ "dependencies": {
37
+ "arg": "^5.0.0",
38
+ "node-fetch": "^2.6.1"
39
+ },
40
+ "files": [
41
+ "dist"
42
+ ],
43
+ "commit": "3be0afd8e46461b21177cca4aed857305e1ec97a"
44
+ }