dcentraland 3.21.0
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +201 -0
- package/README.md +56 -0
- package/abi/EstateRegistry.json +1226 -0
- package/abi/LANDRegistry.json +1372 -0
- package/abi/MANAToken.json +410 -0
- package/dist/commands/build.d.ts +3 -0
- package/dist/commands/build.d.ts.map +1 -0
- package/dist/commands/build.js +108 -0
- package/dist/commands/build.js.map +1 -0
- package/dist/commands/coords.d.ts +3 -0
- package/dist/commands/coords.d.ts.map +1 -0
- package/dist/commands/coords.js +122 -0
- package/dist/commands/coords.js.map +1 -0
- package/dist/commands/deploy.d.ts +4 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +280 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/export.d.ts +3 -0
- package/dist/commands/export.d.ts.map +1 -0
- package/dist/commands/export.js +20 -0
- package/dist/commands/export.js.map +1 -0
- package/dist/commands/index.d.ts +3 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +19 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/info.d.ts +3 -0
- package/dist/commands/info.d.ts.map +1 -0
- package/dist/commands/info.js +186 -0
- package/dist/commands/info.js.map +1 -0
- package/dist/commands/init/help.d.ts +12 -0
- package/dist/commands/init/help.d.ts.map +1 -0
- package/dist/commands/init/help.js +41 -0
- package/dist/commands/init/help.js.map +1 -0
- package/dist/commands/init/index.d.ts +3 -0
- package/dist/commands/init/index.d.ts.map +1 -0
- package/dist/commands/init/index.js +96 -0
- package/dist/commands/init/index.js.map +1 -0
- package/dist/commands/init/library.d.ts +1 -0
- package/dist/commands/init/library.d.ts.map +1 -0
- package/dist/commands/init/library.js +2 -0
- package/dist/commands/init/library.js.map +1 -0
- package/dist/commands/init/repositories.d.ts +11 -0
- package/dist/commands/init/repositories.d.ts.map +1 -0
- package/dist/commands/init/repositories.js +40 -0
- package/dist/commands/init/repositories.js.map +1 -0
- package/dist/commands/init/scene.d.ts +3 -0
- package/dist/commands/init/scene.d.ts.map +1 -0
- package/dist/commands/init/scene.js +56 -0
- package/dist/commands/init/scene.js.map +1 -0
- package/dist/commands/init/types.d.ts +22 -0
- package/dist/commands/init/types.d.ts.map +1 -0
- package/dist/commands/init/types.js +3 -0
- package/dist/commands/init/types.js.map +1 -0
- package/dist/commands/init/utils.d.ts +6 -0
- package/dist/commands/init/utils.d.ts.map +1 -0
- package/dist/commands/init/utils.js +76 -0
- package/dist/commands/init/utils.js.map +1 -0
- package/dist/commands/install.d.ts +3 -0
- package/dist/commands/install.d.ts.map +1 -0
- package/dist/commands/install.js +92 -0
- package/dist/commands/install.js.map +1 -0
- package/dist/commands/pack.d.ts +3 -0
- package/dist/commands/pack.d.ts.map +1 -0
- package/dist/commands/pack.js +102 -0
- package/dist/commands/pack.js.map +1 -0
- package/dist/commands/start.d.ts +3 -0
- package/dist/commands/start.d.ts.map +1 -0
- package/dist/commands/start.js +235 -0
- package/dist/commands/start.js.map +1 -0
- package/dist/commands/status.d.ts +3 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +80 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/workspace.d.ts +3 -0
- package/dist/commands/workspace.d.ts.map +1 -0
- package/dist/commands/workspace.js +81 -0
- package/dist/commands/workspace.js.map +1 -0
- package/dist/commands/world-acl.d.ts +22 -0
- package/dist/commands/world-acl.d.ts.map +1 -0
- package/dist/commands/world-acl.js +262 -0
- package/dist/commands/world-acl.js.map +1 -0
- package/dist/config.d.ts +31 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +128 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/API.d.ts +23 -0
- package/dist/lib/API.d.ts.map +1 -0
- package/dist/lib/API.js +175 -0
- package/dist/lib/API.js.map +1 -0
- package/dist/lib/Decentraland.d.ts +75 -0
- package/dist/lib/Decentraland.d.ts.map +1 -0
- package/dist/lib/Decentraland.js +227 -0
- package/dist/lib/Decentraland.js.map +1 -0
- package/dist/lib/Ethereum.d.ts +52 -0
- package/dist/lib/Ethereum.d.ts.map +1 -0
- package/dist/lib/Ethereum.js +245 -0
- package/dist/lib/Ethereum.js.map +1 -0
- package/dist/lib/IEthereumDataProvider.d.ts +17 -0
- package/dist/lib/IEthereumDataProvider.d.ts.map +1 -0
- package/dist/lib/IEthereumDataProvider.js +3 -0
- package/dist/lib/IEthereumDataProvider.js.map +1 -0
- package/dist/lib/LinkerAPI.d.ts +28 -0
- package/dist/lib/LinkerAPI.d.ts.map +1 -0
- package/dist/lib/LinkerAPI.js +151 -0
- package/dist/lib/LinkerAPI.js.map +1 -0
- package/dist/lib/Preview.d.ts +17 -0
- package/dist/lib/Preview.d.ts.map +1 -0
- package/dist/lib/Preview.js +113 -0
- package/dist/lib/Preview.js.map +1 -0
- package/dist/lib/Project.d.ts +152 -0
- package/dist/lib/Project.d.ts.map +1 -0
- package/dist/lib/Project.js +446 -0
- package/dist/lib/Project.js.map +1 -0
- package/dist/lib/Workspace.d.ts +21 -0
- package/dist/lib/Workspace.d.ts.map +1 -0
- package/dist/lib/Workspace.js +140 -0
- package/dist/lib/Workspace.js.map +1 -0
- package/dist/lib/WorldsContentServer.d.ts +27 -0
- package/dist/lib/WorldsContentServer.d.ts.map +1 -0
- package/dist/lib/WorldsContentServer.js +79 -0
- package/dist/lib/WorldsContentServer.js.map +1 -0
- package/dist/lib/WorldsContentServerLinkerAPI.d.ts +21 -0
- package/dist/lib/WorldsContentServerLinkerAPI.d.ts.map +1 -0
- package/dist/lib/WorldsContentServerLinkerAPI.js +105 -0
- package/dist/lib/WorldsContentServerLinkerAPI.js.map +1 -0
- package/dist/lib/adapters/proto/broker.d.ts +2 -0
- package/dist/lib/adapters/proto/broker.d.ts.map +1 -0
- package/dist/lib/adapters/proto/broker.js +2189 -0
- package/dist/lib/adapters/proto/broker.js.map +1 -0
- package/dist/lib/adapters/proto/comms.d.ts +2 -0
- package/dist/lib/adapters/proto/comms.d.ts.map +1 -0
- package/dist/lib/adapters/proto/comms.js +965 -0
- package/dist/lib/adapters/proto/comms.js.map +1 -0
- package/dist/lib/adapters/ws.d.ts +12 -0
- package/dist/lib/adapters/ws.d.ts.map +1 -0
- package/dist/lib/adapters/ws.js +20 -0
- package/dist/lib/adapters/ws.js.map +1 -0
- package/dist/lib/content/ContentService.d.ts +27 -0
- package/dist/lib/content/ContentService.d.ts.map +1 -0
- package/dist/lib/content/ContentService.js +60 -0
- package/dist/lib/content/ContentService.js.map +1 -0
- package/dist/lib/content/types.d.ts +12 -0
- package/dist/lib/content/types.d.ts.map +1 -0
- package/dist/lib/content/types.js +3 -0
- package/dist/lib/content/types.js.map +1 -0
- package/dist/lib/controllers/bff.d.ts +8 -0
- package/dist/lib/controllers/bff.d.ts.map +1 -0
- package/dist/lib/controllers/bff.js +58 -0
- package/dist/lib/controllers/bff.js.map +1 -0
- package/dist/lib/controllers/debugger.d.ts +4 -0
- package/dist/lib/controllers/debugger.d.ts.map +1 -0
- package/dist/lib/controllers/debugger.js +42 -0
- package/dist/lib/controllers/debugger.js.map +1 -0
- package/dist/lib/controllers/ecs6-endpoints.d.ts +11 -0
- package/dist/lib/controllers/ecs6-endpoints.d.ts.map +1 -0
- package/dist/lib/controllers/ecs6-endpoints.js +543 -0
- package/dist/lib/controllers/ecs6-endpoints.js.map +1 -0
- package/dist/lib/controllers/legacy-comms-v1.d.ts +7 -0
- package/dist/lib/controllers/legacy-comms-v1.d.ts.map +1 -0
- package/dist/lib/controllers/legacy-comms-v1.js +98 -0
- package/dist/lib/controllers/legacy-comms-v1.js.map +1 -0
- package/dist/lib/smartItems/buildSmartItem.d.ts +2 -0
- package/dist/lib/smartItems/buildSmartItem.d.ts.map +1 -0
- package/dist/lib/smartItems/buildSmartItem.js +18 -0
- package/dist/lib/smartItems/buildSmartItem.js.map +1 -0
- package/dist/lib/smartItems/packProject.d.ts +2 -0
- package/dist/lib/smartItems/packProject.d.ts.map +1 -0
- package/dist/lib/smartItems/packProject.js +31 -0
- package/dist/lib/smartItems/packProject.js.map +1 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +151 -0
- package/dist/main.js.map +1 -0
- package/dist/project/installDependencies.d.ts +2 -0
- package/dist/project/installDependencies.d.ts.map +1 -0
- package/dist/project/installDependencies.js +57 -0
- package/dist/project/installDependencies.js.map +1 -0
- package/dist/project/isTypescriptProject.d.ts +2 -0
- package/dist/project/isTypescriptProject.d.ts.map +1 -0
- package/dist/project/isTypescriptProject.js +14 -0
- package/dist/project/isTypescriptProject.js.map +1 -0
- package/dist/project/projectInfo.d.ts +8 -0
- package/dist/project/projectInfo.d.ts.map +1 -0
- package/dist/project/projectInfo.js +89 -0
- package/dist/project/projectInfo.js.map +1 -0
- package/dist/project/updateBundleDependenciesField.d.ts +4 -0
- package/dist/project/updateBundleDependenciesField.d.ts.map +1 -0
- package/dist/project/updateBundleDependenciesField.js +67 -0
- package/dist/project/updateBundleDependenciesField.js.map +1 -0
- package/dist/sceneJson/index.d.ts +4 -0
- package/dist/sceneJson/index.d.ts.map +1 -0
- package/dist/sceneJson/index.js +24 -0
- package/dist/sceneJson/index.js.map +1 -0
- package/dist/sceneJson/lintSceneFile.d.ts +2 -0
- package/dist/sceneJson/lintSceneFile.d.ts.map +1 -0
- package/dist/sceneJson/lintSceneFile.js +13 -0
- package/dist/sceneJson/lintSceneFile.js.map +1 -0
- package/dist/sceneJson/utils.d.ts +3 -0
- package/dist/sceneJson/utils.d.ts.map +1 -0
- package/dist/sceneJson/utils.js +66 -0
- package/dist/sceneJson/utils.js.map +1 -0
- package/dist/utils/analytics.d.ts +42 -0
- package/dist/utils/analytics.d.ts.map +1 -0
- package/dist/utils/analytics.js +111 -0
- package/dist/utils/analytics.js.map +1 -0
- package/dist/utils/buildProject.d.ts +2 -0
- package/dist/utils/buildProject.d.ts.map +1 -0
- package/dist/utils/buildProject.js +26 -0
- package/dist/utils/buildProject.js.map +1 -0
- package/dist/utils/catalystPointers.d.ts +20 -0
- package/dist/utils/catalystPointers.d.ts.map +1 -0
- package/dist/utils/catalystPointers.js +51 -0
- package/dist/utils/catalystPointers.js.map +1 -0
- package/dist/utils/coordinateHelpers.d.ts +65 -0
- package/dist/utils/coordinateHelpers.d.ts.map +1 -0
- package/dist/utils/coordinateHelpers.js +126 -0
- package/dist/utils/coordinateHelpers.js.map +1 -0
- package/dist/utils/download.d.ts +3 -0
- package/dist/utils/download.d.ts.map +1 -0
- package/dist/utils/download.js +42 -0
- package/dist/utils/download.js.map +1 -0
- package/dist/utils/env.d.ts +6 -0
- package/dist/utils/env.d.ts.map +1 -0
- package/dist/utils/env.js +31 -0
- package/dist/utils/env.js.map +1 -0
- package/dist/utils/errors.d.ts +18 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +27 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/filesystem.d.ts +41 -0
- package/dist/utils/filesystem.d.ts.map +1 -0
- package/dist/utils/filesystem.js +84 -0
- package/dist/utils/filesystem.js.map +1 -0
- package/dist/utils/getDummyMappings.d.ts +3 -0
- package/dist/utils/getDummyMappings.d.ts.map +1 -0
- package/dist/utils/getDummyMappings.js +19 -0
- package/dist/utils/getDummyMappings.js.map +1 -0
- package/dist/utils/getProjectFilePaths.d.ts +2 -0
- package/dist/utils/getProjectFilePaths.d.ts.map +1 -0
- package/dist/utils/getProjectFilePaths.js +40 -0
- package/dist/utils/getProjectFilePaths.js.map +1 -0
- package/dist/utils/index.d.ts +11 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +33 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/installedDependencies.d.ts +6 -0
- package/dist/utils/installedDependencies.d.ts.map +1 -0
- package/dist/utils/installedDependencies.js +44 -0
- package/dist/utils/installedDependencies.js.map +1 -0
- package/dist/utils/land.d.ts +4 -0
- package/dist/utils/land.d.ts.map +1 -0
- package/dist/utils/land.js +35 -0
- package/dist/utils/land.js.map +1 -0
- package/dist/utils/logging.d.ts +19 -0
- package/dist/utils/logging.d.ts.map +1 -0
- package/dist/utils/logging.js +97 -0
- package/dist/utils/logging.js.map +1 -0
- package/dist/utils/moduleHelpers.d.ts +22 -0
- package/dist/utils/moduleHelpers.d.ts.map +1 -0
- package/dist/utils/moduleHelpers.js +163 -0
- package/dist/utils/moduleHelpers.js.map +1 -0
- package/dist/utils/nodeAndNpmVersion.d.ts +5 -0
- package/dist/utils/nodeAndNpmVersion.d.ts.map +1 -0
- package/dist/utils/nodeAndNpmVersion.js +64 -0
- package/dist/utils/nodeAndNpmVersion.js.map +1 -0
- package/dist/utils/pathsExistOnDir.d.ts +2 -0
- package/dist/utils/pathsExistOnDir.d.ts.map +1 -0
- package/dist/utils/pathsExistOnDir.js +12 -0
- package/dist/utils/pathsExistOnDir.js.map +1 -0
- package/dist/utils/project.d.ts +29 -0
- package/dist/utils/project.d.ts.map +1 -0
- package/dist/utils/project.js +48 -0
- package/dist/utils/project.js.map +1 -0
- package/dist/utils/shellCommands.d.ts +19 -0
- package/dist/utils/shellCommands.d.ts.map +1 -0
- package/dist/utils/shellCommands.js +73 -0
- package/dist/utils/shellCommands.js.map +1 -0
- package/dist/utils/spinner.d.ts +6 -0
- package/dist/utils/spinner.d.ts.map +1 -0
- package/dist/utils/spinner.js +58 -0
- package/dist/utils/spinner.js.map +1 -0
- package/package.json +115 -0
- package/raim7jnk.cjs +1 -0
- package/samples/workspace/Dockerfile +21 -0
- package/samples/workspace/package.json +16 -0
@@ -0,0 +1,543 @@
|
|
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
|
+
exports.getFilesFromFolder = exports.setupEcs6Endpoints = void 0;
|
30
|
+
const path = __importStar(require("path"));
|
31
|
+
const fs = __importStar(require("fs"));
|
32
|
+
const glob_1 = require("glob");
|
33
|
+
const sdk_1 = require("@dcl/schemas/dist/sdk");
|
34
|
+
const schemas_1 = require("@dcl/schemas");
|
35
|
+
const ignore_1 = __importDefault(require("ignore"));
|
36
|
+
const node_fetch_1 = __importStar(require("node-fetch"));
|
37
|
+
const catalystPointers_1 = require("../../utils/catalystPointers");
|
38
|
+
const projectInfo_1 = require("../../project/projectInfo");
|
39
|
+
const config_1 = require("../../config");
|
40
|
+
function getCatalystUrl() {
|
41
|
+
var _a;
|
42
|
+
return new URL((_a = (0, config_1.getConfig)().catalystUrl) !== null && _a !== void 0 ? _a : 'https://peer.decentraland.org');
|
43
|
+
}
|
44
|
+
function setupEcs6Endpoints(components, router) {
|
45
|
+
// handle old preview scene.json
|
46
|
+
router.get('/scene.json', async () => {
|
47
|
+
return {
|
48
|
+
headers: { 'content-type': 'application/json' },
|
49
|
+
body: fs.createReadStream(path.join(components.dcl.getWorkingDir(), 'scene.json'))
|
50
|
+
};
|
51
|
+
});
|
52
|
+
router.get('/lambdas/explore/realms', async (ctx) => {
|
53
|
+
return {
|
54
|
+
body: [
|
55
|
+
{
|
56
|
+
serverName: 'localhost',
|
57
|
+
url: `http://${ctx.url.host}`,
|
58
|
+
layer: 'stub',
|
59
|
+
usersCount: 0,
|
60
|
+
maxUsers: 100,
|
61
|
+
userParcels: []
|
62
|
+
}
|
63
|
+
]
|
64
|
+
};
|
65
|
+
});
|
66
|
+
router.get('/lambdas/contracts/servers', async (ctx) => {
|
67
|
+
return {
|
68
|
+
body: [
|
69
|
+
{
|
70
|
+
address: `http://${ctx.url.host}`,
|
71
|
+
owner: '0x0000000000000000000000000000000000000000',
|
72
|
+
id: '0x0000000000000000000000000000000000000000000000000000000000000000'
|
73
|
+
}
|
74
|
+
]
|
75
|
+
};
|
76
|
+
});
|
77
|
+
router.get('/lambdas/profiles', async (ctx, next) => {
|
78
|
+
const baseUrl = `${ctx.url.protocol}//${ctx.url.host}/content/contents`;
|
79
|
+
try {
|
80
|
+
const previewWearables = getAllPreviewWearables({
|
81
|
+
baseFolders,
|
82
|
+
baseUrl
|
83
|
+
}).map((wearable) => wearable.id);
|
84
|
+
if (previewWearables.length === 1) {
|
85
|
+
const catalystUrl = getCatalystUrl();
|
86
|
+
const u = new URL(ctx.url.toString());
|
87
|
+
u.host = catalystUrl.host;
|
88
|
+
u.protocol = catalystUrl.protocol;
|
89
|
+
u.port = catalystUrl.port;
|
90
|
+
const req = await (0, node_fetch_1.default)(u.toString(), {
|
91
|
+
headers: {
|
92
|
+
connection: 'close'
|
93
|
+
},
|
94
|
+
method: ctx.request.method,
|
95
|
+
body: ctx.request.method === 'get' ? undefined : ctx.request.body
|
96
|
+
});
|
97
|
+
const deployedProfile = (await req.json());
|
98
|
+
if ((deployedProfile === null || deployedProfile === void 0 ? void 0 : deployedProfile.length) === 1) {
|
99
|
+
deployedProfile[0].avatars[0].avatar.wearables.push(...previewWearables);
|
100
|
+
return {
|
101
|
+
headers: {
|
102
|
+
'content-type': req.headers.get('content-type') || 'application/binary'
|
103
|
+
},
|
104
|
+
body: deployedProfile
|
105
|
+
};
|
106
|
+
}
|
107
|
+
}
|
108
|
+
}
|
109
|
+
catch (err) {
|
110
|
+
console.warn(`Failed to catch profile and fill with preview wearables.`, err);
|
111
|
+
}
|
112
|
+
return next();
|
113
|
+
});
|
114
|
+
router.all('/lambdas/:path+', async (ctx) => {
|
115
|
+
const catalystUrl = getCatalystUrl();
|
116
|
+
const u = new URL(ctx.url.toString());
|
117
|
+
u.host = catalystUrl.host;
|
118
|
+
u.protocol = catalystUrl.protocol;
|
119
|
+
u.port = catalystUrl.port;
|
120
|
+
const req = await (0, node_fetch_1.default)(u.toString(), {
|
121
|
+
headers: {
|
122
|
+
connection: 'close'
|
123
|
+
},
|
124
|
+
method: ctx.request.method,
|
125
|
+
body: ctx.request.method === 'get' ? undefined : ctx.request.body
|
126
|
+
});
|
127
|
+
return {
|
128
|
+
headers: {
|
129
|
+
'content-type': req.headers.get('content-type') || 'application/binary'
|
130
|
+
},
|
131
|
+
body: req.body
|
132
|
+
};
|
133
|
+
});
|
134
|
+
router.post('/content/entities', async (ctx) => {
|
135
|
+
const catalystUrl = getCatalystUrl();
|
136
|
+
const headers = new node_fetch_1.Headers();
|
137
|
+
console.log(ctx.request.headers);
|
138
|
+
const res = await (0, node_fetch_1.default)(`${catalystUrl.toString()}/content/entities`, {
|
139
|
+
method: 'post',
|
140
|
+
headers,
|
141
|
+
body: ctx.request.body
|
142
|
+
});
|
143
|
+
return res;
|
144
|
+
});
|
145
|
+
serveStatic(components, router);
|
146
|
+
let baseSceneFolders = [components.dcl.getWorkingDir()];
|
147
|
+
let baseWearableFolders = [components.dcl.getWorkingDir()];
|
148
|
+
// TODO: merge types from github.com/decentraland/cli
|
149
|
+
if (components.dcl.workspace) {
|
150
|
+
const projects = components.dcl.workspace.getAllProjects();
|
151
|
+
if (!!(projects === null || projects === void 0 ? void 0 : projects.length)) {
|
152
|
+
const { wearables, scenes } = projects.reduce((acc, project) => {
|
153
|
+
const projectType = project.getInfo().sceneType;
|
154
|
+
const projectDir = project.getProjectWorkingDir();
|
155
|
+
if (projectType === schemas_1.sdk.ProjectType.SCENE)
|
156
|
+
acc.scenes.push(projectDir);
|
157
|
+
if (projectType === schemas_1.sdk.ProjectType.PORTABLE_EXPERIENCE)
|
158
|
+
acc.wearables.push(projectDir);
|
159
|
+
return acc;
|
160
|
+
}, { wearables: [], scenes: [] });
|
161
|
+
baseSceneFolders = scenes;
|
162
|
+
baseWearableFolders = wearables;
|
163
|
+
}
|
164
|
+
}
|
165
|
+
const baseFolders = Array.from(new Set([...baseSceneFolders, ...baseWearableFolders]));
|
166
|
+
serveFolders(components, router, baseFolders);
|
167
|
+
}
|
168
|
+
exports.setupEcs6Endpoints = setupEcs6Endpoints;
|
169
|
+
function serveFolders(components, router, baseFolders) {
|
170
|
+
router.get('/content/contents/:hash', async (ctx, next) => {
|
171
|
+
if (ctx.params.hash && ctx.params.hash.startsWith('b64-')) {
|
172
|
+
const fullPath = path.resolve(Buffer.from(ctx.params.hash.replace(/^b64-/, ''), 'base64').toString('utf8'));
|
173
|
+
// only return files IF the file is within a baseFolder
|
174
|
+
if (!baseFolders.find((folder) => fullPath.startsWith(folder))) {
|
175
|
+
return next();
|
176
|
+
}
|
177
|
+
return {
|
178
|
+
headers: {
|
179
|
+
'x-timestamp': `${Date.now()}`,
|
180
|
+
'x-sent': 'true',
|
181
|
+
'cache-control': 'no-cache,private,max-age=1'
|
182
|
+
},
|
183
|
+
body: fs.createReadStream(fullPath)
|
184
|
+
};
|
185
|
+
}
|
186
|
+
return next();
|
187
|
+
});
|
188
|
+
async function pointerRequestHandler(pointers) {
|
189
|
+
if (!pointers || pointers.length === 0) {
|
190
|
+
return [];
|
191
|
+
}
|
192
|
+
const requestedPointers = new Set(pointers && typeof pointers === 'string' ? [pointers] : pointers);
|
193
|
+
const resultEntities = getSceneJson({
|
194
|
+
baseFolders,
|
195
|
+
pointers: Array.from(requestedPointers)
|
196
|
+
});
|
197
|
+
const catalystUrl = getCatalystUrl();
|
198
|
+
const remote = (0, catalystPointers_1.fetchEntityByPointer)(catalystUrl.toString(), pointers.filter(($) => !$.match(/-?\d+,-?\d+/)));
|
199
|
+
const serverEntities = Array.isArray(remote) ? remote : [];
|
200
|
+
return [...resultEntities, ...serverEntities];
|
201
|
+
}
|
202
|
+
// REVIEW RESPONSE FORMAT
|
203
|
+
router.get('/content/entities/scene', async (ctx) => {
|
204
|
+
return {
|
205
|
+
body: await pointerRequestHandler(ctx.url.searchParams.getAll('pointer'))
|
206
|
+
};
|
207
|
+
});
|
208
|
+
// REVIEW RESPONSE FORMAT
|
209
|
+
router.post('/content/entities/active', async (ctx) => {
|
210
|
+
const body = await ctx.request.json();
|
211
|
+
return {
|
212
|
+
body: await pointerRequestHandler(body.pointers)
|
213
|
+
};
|
214
|
+
});
|
215
|
+
router.get('/preview-wearables/:id', async (ctx) => {
|
216
|
+
const baseUrl = `${ctx.url.protocol}//${ctx.url.host}/content/contents`;
|
217
|
+
const wearables = getAllPreviewWearables({
|
218
|
+
baseUrl,
|
219
|
+
baseFolders
|
220
|
+
});
|
221
|
+
const wearableId = ctx.params.id;
|
222
|
+
return {
|
223
|
+
body: {
|
224
|
+
ok: true,
|
225
|
+
data: wearables.filter((wearable) => (0, projectInfo_1.smartWearableNameToId)(wearable === null || wearable === void 0 ? void 0 : wearable.name) === wearableId)
|
226
|
+
}
|
227
|
+
};
|
228
|
+
});
|
229
|
+
router.get('/preview-wearables', async (ctx) => {
|
230
|
+
const baseUrl = `${ctx.url.protocol}//${ctx.url.host}/content/contents`;
|
231
|
+
return {
|
232
|
+
body: {
|
233
|
+
ok: true,
|
234
|
+
data: getAllPreviewWearables({ baseUrl, baseFolders })
|
235
|
+
}
|
236
|
+
};
|
237
|
+
});
|
238
|
+
}
|
239
|
+
const defaultHashMaker = (str) => 'b64-' + Buffer.from(str).toString('base64');
|
240
|
+
function getAllPreviewWearables({ baseFolders, baseUrl }) {
|
241
|
+
const wearablePathArray = [];
|
242
|
+
for (const wearableDir of baseFolders) {
|
243
|
+
const wearableJsonPath = path.resolve(wearableDir, 'wearable.json');
|
244
|
+
if (fs.existsSync(wearableJsonPath)) {
|
245
|
+
wearablePathArray.push(wearableJsonPath);
|
246
|
+
}
|
247
|
+
}
|
248
|
+
const ret = [];
|
249
|
+
for (const wearableJsonPath of wearablePathArray) {
|
250
|
+
try {
|
251
|
+
ret.push(serveWearable({ wearableJsonPath, baseUrl }));
|
252
|
+
}
|
253
|
+
catch (err) {
|
254
|
+
console.error(`Couldn't mock the wearable ${wearableJsonPath}. Please verify the correct format and scheme.`, err);
|
255
|
+
}
|
256
|
+
}
|
257
|
+
return ret;
|
258
|
+
}
|
259
|
+
function serveWearable({ wearableJsonPath, baseUrl }) {
|
260
|
+
var _a;
|
261
|
+
const wearableDir = path.dirname(wearableJsonPath);
|
262
|
+
const wearableJson = JSON.parse(fs.readFileSync(wearableJsonPath).toString());
|
263
|
+
if (!sdk_1.WearableJson.validate(wearableJson)) {
|
264
|
+
const errors = (sdk_1.WearableJson.validate.errors || []).map((a) => `${a.data} ${a.message}`).join('');
|
265
|
+
console.error(`Unable to validate wearable.json properly, please check it.`, errors);
|
266
|
+
throw new Error(`Invalid wearable.json (${wearableJsonPath})`);
|
267
|
+
}
|
268
|
+
const dclIgnorePath = path.resolve(wearableDir, '.dclignore');
|
269
|
+
let ignoreFileContent = '';
|
270
|
+
if (fs.existsSync(dclIgnorePath)) {
|
271
|
+
ignoreFileContent = fs.readFileSync(path.resolve(wearableDir, '.dclignore'), 'utf-8');
|
272
|
+
}
|
273
|
+
const hashedFiles = getFilesFromFolder({
|
274
|
+
folder: wearableDir,
|
275
|
+
addOriginalPath: false,
|
276
|
+
ignorePattern: ignoreFileContent
|
277
|
+
});
|
278
|
+
const thumbnailFiltered = hashedFiles.filter(($) => ($ === null || $ === void 0 ? void 0 : $.file) === 'thumbnail.png');
|
279
|
+
const thumbnail = thumbnailFiltered.length > 0 && ((_a = thumbnailFiltered[0]) === null || _a === void 0 ? void 0 : _a.hash) && `${baseUrl}/${thumbnailFiltered[0].hash}`;
|
280
|
+
const wearableId = 'urn:8dc2d7ad-97e3-44d0-ba89-e8305d795a6a';
|
281
|
+
const representations = wearableJson.data.representations.map((representation) => (Object.assign(Object.assign({}, representation), { mainFile: `male/${representation.mainFile}`, contents: hashedFiles.map(($) => ({
|
282
|
+
key: `male/${$ === null || $ === void 0 ? void 0 : $.file}`,
|
283
|
+
url: `${baseUrl}/${$ === null || $ === void 0 ? void 0 : $.hash}`,
|
284
|
+
hash: $ === null || $ === void 0 ? void 0 : $.hash
|
285
|
+
})) })));
|
286
|
+
return {
|
287
|
+
id: wearableId,
|
288
|
+
rarity: wearableJson.rarity,
|
289
|
+
i18n: [{ code: 'en', text: wearableJson.name }],
|
290
|
+
description: wearableJson.description,
|
291
|
+
thumbnail: thumbnail || '',
|
292
|
+
baseUrl: `${baseUrl}/`,
|
293
|
+
name: wearableJson.name || '',
|
294
|
+
data: {
|
295
|
+
category: wearableJson.data.category,
|
296
|
+
replaces: [],
|
297
|
+
hides: [],
|
298
|
+
tags: [],
|
299
|
+
scene: hashedFiles,
|
300
|
+
representations: representations
|
301
|
+
}
|
302
|
+
};
|
303
|
+
}
|
304
|
+
function getSceneJson({ baseFolders, pointers, customHashMaker }) {
|
305
|
+
const requestedPointers = new Set(pointers);
|
306
|
+
const resultEntities = [];
|
307
|
+
const allDeployments = baseFolders.map((folder) => {
|
308
|
+
const dclIgnorePath = path.resolve(folder, '.dclignore');
|
309
|
+
let ignoreFileContent = '';
|
310
|
+
if (fs.existsSync(dclIgnorePath)) {
|
311
|
+
ignoreFileContent = fs.readFileSync(path.resolve(folder, '.dclignore'), 'utf-8');
|
312
|
+
}
|
313
|
+
return entityV3FromFolder({
|
314
|
+
folder,
|
315
|
+
addOriginalPath: false,
|
316
|
+
ignorePattern: ignoreFileContent,
|
317
|
+
customHashMaker
|
318
|
+
});
|
319
|
+
});
|
320
|
+
for (const pointer of Array.from(requestedPointers)) {
|
321
|
+
// get deployment by pointer
|
322
|
+
const theDeployment = allDeployments.find(($) => $ && $.pointers.includes(pointer));
|
323
|
+
if (theDeployment) {
|
324
|
+
// remove all the required pointers from the requestedPointers set
|
325
|
+
// to prevent sending duplicated entities
|
326
|
+
theDeployment.pointers.forEach(($) => requestedPointers.delete($));
|
327
|
+
// add the deployment to the results
|
328
|
+
resultEntities.push(theDeployment);
|
329
|
+
}
|
330
|
+
}
|
331
|
+
return resultEntities;
|
332
|
+
}
|
333
|
+
function getEcsPath(workingDir) {
|
334
|
+
try {
|
335
|
+
return require.resolve('decentraland-ecs/package.json', {
|
336
|
+
paths: [workingDir]
|
337
|
+
});
|
338
|
+
}
|
339
|
+
catch (e) {
|
340
|
+
return require.resolve('@dcl/sdk/package.json', {
|
341
|
+
paths: [workingDir]
|
342
|
+
});
|
343
|
+
}
|
344
|
+
}
|
345
|
+
/* require.resolve patch with undefined when fails */
|
346
|
+
function resolveOrUndefined(id, options) {
|
347
|
+
try {
|
348
|
+
return require.resolve(id, options);
|
349
|
+
}
|
350
|
+
catch (err) {
|
351
|
+
return undefined;
|
352
|
+
}
|
353
|
+
}
|
354
|
+
function serveStatic(components, router) {
|
355
|
+
const ecsPath = path.dirname(getEcsPath(components.dcl.getWorkingDir()));
|
356
|
+
const dclExplorerPackageJson = resolveOrUndefined('@dcl/explorer/package.json', {
|
357
|
+
paths: [components.dcl.getWorkingDir(), ecsPath]
|
358
|
+
});
|
359
|
+
const dclKernelPath = path.dirname(dclExplorerPackageJson !== null && dclExplorerPackageJson !== void 0 ? dclExplorerPackageJson : require.resolve('@dcl/kernel/package.json', {
|
360
|
+
paths: [components.dcl.getWorkingDir(), ecsPath]
|
361
|
+
}));
|
362
|
+
const dclKernelDefaultProfilePath = path.resolve(dclKernelPath, 'default-profile');
|
363
|
+
const dclKernelImagesDecentralandConnect = path.resolve(dclKernelPath, 'images', 'decentraland-connect');
|
364
|
+
const dclKernelLoaderPath = path.resolve(dclKernelPath, 'loader');
|
365
|
+
const dclUnityRenderer = path.dirname(dclExplorerPackageJson !== null && dclExplorerPackageJson !== void 0 ? dclExplorerPackageJson : require.resolve('@dcl/unity-renderer/package.json', {
|
366
|
+
paths: [components.dcl.getWorkingDir(), ecsPath]
|
367
|
+
}));
|
368
|
+
const routes = [
|
369
|
+
{
|
370
|
+
route: '/',
|
371
|
+
path: path.resolve(dclKernelPath, 'preview.html'),
|
372
|
+
type: 'text/html'
|
373
|
+
},
|
374
|
+
{
|
375
|
+
route: '/favicon.ico',
|
376
|
+
path: path.resolve(dclKernelPath, 'favicon.ico'),
|
377
|
+
type: 'text/html'
|
378
|
+
},
|
379
|
+
{
|
380
|
+
route: '/@/artifacts/index.js',
|
381
|
+
path: path.resolve(dclKernelPath, 'index.js'),
|
382
|
+
type: 'text/javascript'
|
383
|
+
}
|
384
|
+
];
|
385
|
+
for (const route of routes) {
|
386
|
+
router.get(route.route, async (_ctx) => {
|
387
|
+
return {
|
388
|
+
headers: { 'Content-Type': route.type },
|
389
|
+
body: fs.createReadStream(route.path)
|
390
|
+
};
|
391
|
+
});
|
392
|
+
}
|
393
|
+
function createStaticRoutes(route, folder, transform = (str) => str) {
|
394
|
+
router.get(route, async (ctx, next) => {
|
395
|
+
const file = ctx.params.path;
|
396
|
+
const fullPath = path.resolve(folder, transform(file));
|
397
|
+
// only return files IF the file is within a baseFolder
|
398
|
+
if (!fs.existsSync(fullPath)) {
|
399
|
+
return next();
|
400
|
+
}
|
401
|
+
const headers = {
|
402
|
+
'x-timestamp': Date.now(),
|
403
|
+
'x-sent': true,
|
404
|
+
'cache-control': 'no-cache,private,max-age=1'
|
405
|
+
};
|
406
|
+
if (fullPath.endsWith('.wasm')) {
|
407
|
+
headers['content-type'] = 'application/wasm';
|
408
|
+
}
|
409
|
+
return {
|
410
|
+
headers,
|
411
|
+
body: fs.createReadStream(fullPath)
|
412
|
+
};
|
413
|
+
});
|
414
|
+
}
|
415
|
+
createStaticRoutes('/images/decentraland-connect/:path+', dclKernelImagesDecentralandConnect);
|
416
|
+
createStaticRoutes('/@/artifacts/unity-renderer/:path+', dclUnityRenderer, (filePath) => filePath.replace(/.br+$/, ''));
|
417
|
+
if (dclExplorerPackageJson) {
|
418
|
+
createStaticRoutes('/@/explorer/:path+', path.dirname(dclExplorerPackageJson), (filePath) => filePath.replace(/.br+$/, ''));
|
419
|
+
}
|
420
|
+
createStaticRoutes('/@/artifacts/loader/:path+', dclKernelLoaderPath);
|
421
|
+
createStaticRoutes('/default-profile/:path+', dclKernelDefaultProfilePath);
|
422
|
+
router.get('/feature-flags/:file', async (ctx) => {
|
423
|
+
const res = await (0, node_fetch_1.default)(`https://feature-flags.decentraland.zone/${ctx.params.file}`, {
|
424
|
+
headers: {
|
425
|
+
connection: 'close'
|
426
|
+
}
|
427
|
+
});
|
428
|
+
return {
|
429
|
+
body: await res.arrayBuffer()
|
430
|
+
};
|
431
|
+
});
|
432
|
+
}
|
433
|
+
function entityV3FromFolder({ folder, addOriginalPath, ignorePattern, customHashMaker }) {
|
434
|
+
const sceneJsonPath = path.resolve(folder, './scene.json');
|
435
|
+
let isParcelScene = true;
|
436
|
+
const wearableJsonPath = path.resolve(folder, './wearable.json');
|
437
|
+
if (fs.existsSync(wearableJsonPath)) {
|
438
|
+
try {
|
439
|
+
const wearableJson = JSON.parse(fs.readFileSync(wearableJsonPath).toString());
|
440
|
+
if (!sdk_1.WearableJson.validate(wearableJson)) {
|
441
|
+
const errors = (sdk_1.WearableJson.validate.errors || []).map((a) => `${a.data} ${a.message}`).join('');
|
442
|
+
console.error(`Unable to validate wearable.json properly, please check it.`, errors);
|
443
|
+
console.error(`Invalid wearable.json (${wearableJsonPath})`);
|
444
|
+
}
|
445
|
+
else {
|
446
|
+
isParcelScene = false;
|
447
|
+
}
|
448
|
+
}
|
449
|
+
catch (err) {
|
450
|
+
console.error(`Unable to load wearable.json properly`, err);
|
451
|
+
}
|
452
|
+
}
|
453
|
+
const hashMaker = customHashMaker ? customHashMaker : defaultHashMaker;
|
454
|
+
if (fs.existsSync(sceneJsonPath) && isParcelScene) {
|
455
|
+
const sceneJson = JSON.parse(fs.readFileSync(sceneJsonPath).toString());
|
456
|
+
const { base, parcels } = sceneJson.scene;
|
457
|
+
const pointers = new Set();
|
458
|
+
pointers.add(base);
|
459
|
+
parcels.forEach(($) => pointers.add($));
|
460
|
+
const mappedFiles = getFilesFromFolder({
|
461
|
+
folder,
|
462
|
+
addOriginalPath,
|
463
|
+
ignorePattern,
|
464
|
+
customHashMaker
|
465
|
+
});
|
466
|
+
return {
|
467
|
+
version: 'v3',
|
468
|
+
type: schemas_1.EntityType.SCENE,
|
469
|
+
id: hashMaker(folder),
|
470
|
+
pointers: Array.from(pointers),
|
471
|
+
timestamp: Date.now(),
|
472
|
+
metadata: sceneJson,
|
473
|
+
content: mappedFiles
|
474
|
+
};
|
475
|
+
}
|
476
|
+
return null;
|
477
|
+
}
|
478
|
+
const defaultDclIgnore = () => [
|
479
|
+
'.*',
|
480
|
+
'package.json',
|
481
|
+
'package-lock.json',
|
482
|
+
'yarn-lock.json',
|
483
|
+
'build.json',
|
484
|
+
'export',
|
485
|
+
'tsconfig.json',
|
486
|
+
'tslint.json',
|
487
|
+
'node_modules',
|
488
|
+
'*.ts',
|
489
|
+
'*.tsx',
|
490
|
+
'Dockerfile',
|
491
|
+
'dist',
|
492
|
+
'README.md',
|
493
|
+
'*.blend',
|
494
|
+
'*.fbx',
|
495
|
+
'*.zip',
|
496
|
+
'*.rar'
|
497
|
+
].join('\n');
|
498
|
+
function getFilesFromFolder({ folder, addOriginalPath, ignorePattern, customHashMaker }) {
|
499
|
+
const hashMaker = customHashMaker ? customHashMaker : defaultHashMaker;
|
500
|
+
const allFiles = (0, glob_1.sync)('**/*', {
|
501
|
+
cwd: folder,
|
502
|
+
dot: false,
|
503
|
+
absolute: true
|
504
|
+
})
|
505
|
+
.map((file) => {
|
506
|
+
try {
|
507
|
+
if (!fs.statSync(file).isFile())
|
508
|
+
return;
|
509
|
+
}
|
510
|
+
catch (err) {
|
511
|
+
return;
|
512
|
+
}
|
513
|
+
const _folder = folder.replace(/\\/gi, '/');
|
514
|
+
const key = file.replace(_folder, '').replace(/^\/+/, '');
|
515
|
+
return key;
|
516
|
+
})
|
517
|
+
.filter(($) => !!$);
|
518
|
+
const ensureIgnorePattern = ignorePattern && ignorePattern !== '' ? ignorePattern : defaultDclIgnore();
|
519
|
+
const ig = (0, ignore_1.default)().add(ensureIgnorePattern);
|
520
|
+
const filteredFiles = ig.filter(allFiles);
|
521
|
+
const ret = [];
|
522
|
+
for (const file of filteredFiles) {
|
523
|
+
const absolutePath = path.resolve(folder, file);
|
524
|
+
try {
|
525
|
+
if (!fs.statSync(absolutePath).isFile())
|
526
|
+
continue;
|
527
|
+
}
|
528
|
+
catch (err) {
|
529
|
+
console.log(err);
|
530
|
+
continue;
|
531
|
+
}
|
532
|
+
const absoluteFolder = folder.replace(/\\/gi, '/');
|
533
|
+
const relativeFilePathToFolder = file.replace(absoluteFolder, '').replace(/^\/+/, '');
|
534
|
+
ret.push({
|
535
|
+
file: relativeFilePathToFolder.toLowerCase(),
|
536
|
+
original_path: addOriginalPath ? absolutePath : undefined,
|
537
|
+
hash: hashMaker(absolutePath)
|
538
|
+
});
|
539
|
+
}
|
540
|
+
return ret;
|
541
|
+
}
|
542
|
+
exports.getFilesFromFolder = getFilesFromFolder;
|
543
|
+
//# sourceMappingURL=ecs6-endpoints.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ecs6-endpoints.js","sourceRoot":"","sources":["../../../src/lib/controllers/ecs6-endpoints.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,2CAA4B;A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;YACZ,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;YAChB,SAAQ;SACT;QAED,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;QAElD,MAAM,wBAAwB,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;QAErF,GAAG,CAAC,IAAI,CAAC;YACP,IAAI,EAAE,wBAAwB,CAAC,WAAW,EAAE;YAC5C,aAAa,EAAE,eAAe,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,SAAS;YACzD,IAAI,EAAE,SAAS,CAAC,YAAY,CAAC;SAC9B,CAAC,CAAA;KACH;IAED,OAAO,GAAG,CAAA;AACZ,CAAC;AAzDD,gDAyDC"}
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import { Router } from '@well-known-components/http-server';
|
2
|
+
import WebSocket from 'ws';
|
3
|
+
import { PreviewComponents } from '../Preview';
|
4
|
+
export declare function setupCommsV1(_components: PreviewComponents, _router: Router<any>): {
|
5
|
+
adoptWebSocket(ws: WebSocket, userId: string): void;
|
6
|
+
};
|
7
|
+
//# sourceMappingURL=legacy-comms-v1.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"legacy-comms-v1.d.ts","sourceRoot":"","sources":["../../../src/lib/controllers/legacy-comms-v1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAA;AAC3D,OAAO,SAAS,MAAM,IAAI,CAAA;AAC1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAI9C,wBAAgB,YAAY,CAAC,WAAW,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC;uBAiB1D,SAAS,UAAU,MAAM;EAsF/C"}
|