@dcl/sdk 7.0.0-2947735169.commit-65163b3 → 7.0.0-2965783764.commit-18f9e1c

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.
@@ -0,0 +1,8 @@
1
+ syntax = "proto3";
2
+
3
+ import "common/id.proto";
4
+ option (ecs_component_id) = 1081;
5
+
6
+ message PBVisibilityComponent {
7
+ optional bool visible = 1; // default=true
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcl/sdk",
3
- "version": "7.0.0-2947735169.commit-65163b3",
3
+ "version": "7.0.0-2965783764.commit-18f9e1c",
4
4
  "description": "",
5
5
  "main": "dist/src/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -27,8 +27,8 @@
27
27
  "src/cli/**/*.js"
28
28
  ],
29
29
  "dependencies": {
30
- "@dcl/amd": "6.11.5-2947735169.commit-65163b3",
31
- "@dcl/build-ecs": "6.11.5-2947735169.commit-65163b3",
30
+ "@dcl/amd": "6.11.5-2965783764.commit-18f9e1c",
31
+ "@dcl/build-ecs": "6.11.5-2965783764.commit-18f9e1c",
32
32
  "@dcl/kernel": "1.0.0-2638443584.commit-696a74b",
33
33
  "@dcl/posix": "^1.0.4",
34
34
  "@dcl/schemas": "4.8.0",
@@ -38,5 +38,5 @@
38
38
  "ignore": "^5.1.8"
39
39
  },
40
40
  "minCliVersion": "3.10.2",
41
- "commit": "65163b3206ed65d673422785c0699b4eb874165d"
41
+ "commit": "18f9e1c12d82955fce52e4a1d825a3d7c9950301"
42
42
  }
@@ -47,7 +47,7 @@ var mockCatalyst = function (app, baseFolders) {
47
47
  res.json([
48
48
  {
49
49
  serverName: 'localhost',
50
- url: "http://" + req.get('host'),
50
+ url: "http://".concat(req.get('host')),
51
51
  layer: 'stub',
52
52
  usersCount: 0,
53
53
  maxUsers: 100,
@@ -58,7 +58,7 @@ var mockCatalyst = function (app, baseFolders) {
58
58
  app.get('/lambdas/contracts/servers', function (req, res) {
59
59
  res.json([
60
60
  {
61
- address: "http://" + req.get('host'),
61
+ address: "http://".concat(req.get('host')),
62
62
  owner: '0x0000000000000000000000000000000000000000',
63
63
  id: '0x0000000000000000000000000000000000000000000000000000000000000000'
64
64
  }
@@ -70,7 +70,7 @@ var mockCatalyst = function (app, baseFolders) {
70
70
  return __generator(this, function (_b) {
71
71
  switch (_b.label) {
72
72
  case 0:
73
- baseUrl = req.protocol + "://" + req.get('host') + "/content/contents";
73
+ baseUrl = "".concat(req.protocol, "://").concat(req.get('host'), "/content/contents");
74
74
  _b.label = 1;
75
75
  case 1:
76
76
  _b.trys.push([1, 6, , 7]);
@@ -81,7 +81,7 @@ var mockCatalyst = function (app, baseFolders) {
81
81
  case 2:
82
82
  previewWearables = _b.sent();
83
83
  if (!(previewWearables.length === 1)) return [3 /*break*/, 5];
84
- return [4 /*yield*/, fetch("https://peer.decentraland.org" + req.originalUrl)];
84
+ return [4 /*yield*/, fetch("https://peer.decentraland.org".concat(req.originalUrl))];
85
85
  case 3: return [4 /*yield*/, (_b.sent()).json()];
86
86
  case 4:
87
87
  deployedProfile = _b.sent();
@@ -275,7 +275,7 @@ var downloadFile = function (url, path, timeout_seg) {
275
275
  setTimeout(function () {
276
276
  if (!finished) {
277
277
  request.destroy();
278
- reject(new Error("Timeout " + url));
278
+ reject(new Error("Timeout ".concat(url)));
279
279
  }
280
280
  }, timeout_seg * 1000);
281
281
  })];
@@ -60,15 +60,15 @@ var serveWearable = function (_a) {
60
60
  var wearableJson = JSON.parse(fs.readFileSync(wearableJsonPath).toString());
61
61
  if (!(0, exports.wearableValidator)(wearableJson)) {
62
62
  var errors = (exports.wearableValidator.errors || [])
63
- .map(function (a) { return a.dataPath + " " + a.message; })
63
+ .map(function (a) { return "".concat(a.dataPath, " ").concat(a.message); })
64
64
  .join('');
65
65
  if (errors.length > 0) {
66
- console.error("Unable to validate '" + wearableJsonPath + "' properly, please check it: " + errors);
66
+ console.error("Unable to validate '".concat(wearableJsonPath, "' properly, please check it: ").concat(errors));
67
67
  }
68
68
  else {
69
- console.error("Unable to validate '" + wearableJsonPath + "' properly, please check it.");
69
+ console.error("Unable to validate '".concat(wearableJsonPath, "' properly, please check it."));
70
70
  }
71
- throw new Error("Invalid wearable.json (" + wearableJson + ")");
71
+ throw new Error("Invalid wearable.json (".concat(wearableJson, ")"));
72
72
  }
73
73
  else {
74
74
  }
@@ -85,10 +85,10 @@ var serveWearable = function (_a) {
85
85
  var thumbnailFiltered = hashedFiles.filter(function ($) { return ($ === null || $ === void 0 ? void 0 : $.file) === wearableJson.thumbnail; });
86
86
  var thumbnail = thumbnailFiltered.length > 0 &&
87
87
  ((_b = thumbnailFiltered[0]) === null || _b === void 0 ? void 0 : _b.hash) &&
88
- baseUrl + "/" + thumbnailFiltered[0].hash;
88
+ "".concat(baseUrl, "/").concat(thumbnailFiltered[0].hash);
89
89
  var wearableJsonWithContents = __assign(__assign({}, wearableJson), { baseUrl: baseUrl, thumbnail: thumbnail, data: __assign(__assign({}, wearableJson.data), { thumbnail: thumbnail, scene: hashedFiles, baseUrl: baseUrl, representations: wearableJson.data.representations.map(function (representation) { return (__assign(__assign({}, representation), { contents: hashedFiles.map(function (file) { return ({
90
- key: "" + (file === null || file === void 0 ? void 0 : file.file),
91
- url: baseUrl + "/" + (file === null || file === void 0 ? void 0 : file.hash)
90
+ key: "".concat(file === null || file === void 0 ? void 0 : file.file),
91
+ url: "".concat(baseUrl, "/").concat(file === null || file === void 0 ? void 0 : file.hash)
92
92
  }); }) })); }) }) });
93
93
  return wearableJsonWithContents;
94
94
  };
@@ -109,7 +109,7 @@ var getAllPreviewWearables = function (_a) {
109
109
  ret.push(serveWearable({ wearableJsonPath: wearableJsonPath, baseUrl: baseUrl }));
110
110
  }
111
111
  catch (err) {
112
- console.error("Couldn't mock the wearable " + wearableJsonPath + ". Please verify the correct format and scheme.", err);
112
+ console.error("Couldn't mock the wearable ".concat(wearableJsonPath, ". Please verify the correct format and scheme."), err);
113
113
  }
114
114
  }
115
115
  return ret;
@@ -119,7 +119,7 @@ var mockPreviewWearables = function (app, baseFolders) {
119
119
  app.use('/preview-wearables/:id', function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
120
120
  var baseUrl, wearables, wearableId;
121
121
  return __generator(this, function (_a) {
122
- baseUrl = req.protocol + "://" + req.get('host') + "/content/contents";
122
+ baseUrl = "".concat(req.protocol, "://").concat(req.get('host'), "/content/contents");
123
123
  wearables = (0, exports.getAllPreviewWearables)({
124
124
  baseUrl: baseUrl,
125
125
  baseFolders: baseFolders
@@ -134,7 +134,7 @@ var mockPreviewWearables = function (app, baseFolders) {
134
134
  app.use('/preview-wearables', function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
135
135
  var baseUrl;
136
136
  return __generator(this, function (_a) {
137
- baseUrl = req.protocol + "://" + req.get('host') + "/content/contents";
137
+ baseUrl = "".concat(req.protocol, "://").concat(req.get('host'), "/content/contents");
138
138
  return [2 /*return*/, res.json({
139
139
  ok: true,
140
140
  data: (0, exports.getAllPreviewWearables)({ baseUrl: baseUrl, baseFolders: baseFolders })
package/src/setupProxy.js CHANGED
@@ -151,7 +151,7 @@ var setupProxy = function (dcl, app) {
151
151
  var featureFlagResponse, featureFlagBody;
152
152
  return __generator(this, function (_a) {
153
153
  switch (_a.label) {
154
- case 0: return [4 /*yield*/, fetch("https://feature-flags.decentraland.zone/" + req.params.file)];
154
+ case 0: return [4 /*yield*/, fetch("https://feature-flags.decentraland.zone/".concat(req.params.file))];
155
155
  case 1:
156
156
  featureFlagResponse = _a.sent();
157
157
  return [4 /*yield*/, featureFlagResponse.json()];
@@ -250,6 +250,8 @@ declare namespace Components {
250
250
  const TextShape: ComponentDefinition<ISchema<PBTextShape>, PBTextShape>;
251
251
  /** @public */
252
252
  const UiText: ComponentDefinition<ISchema<PBUiText>, PBUiText>;
253
+ /** @public */
254
+ const VisibilityComponent: ComponentDefinition<ISchema<PBVisibilityComponent>, PBVisibilityComponent>;
253
255
  }
254
256
 
255
257
  /**
@@ -405,14 +407,36 @@ declare interface CreateByteBufferOptions {
405
407
  /** @public */
406
408
  declare const CylinderShape: ComponentDefinition<ISchema<PBCylinderShape>, PBCylinderShape>;
407
409
 
410
+ /**
411
+ * @public
412
+ */
413
+ declare type DeepReadonly<T> = T extends ReadonlyPrimitive ? T : T extends Map<infer K, infer V> ? DeepReadonlyMap<K, V> : T extends Set<infer M> ? DeepReadonlySet<M> : DeepReadonlyObject<T>;
414
+
408
415
  /**
409
416
  * Make each field readonly deeply
410
417
  * @public
411
418
  */
412
- declare type DeepReadonly<T> = {
413
- readonly [P in keyof T]: DeepReadonly<T[P]>;
419
+ declare type DeepReadonly_2<T> = {
420
+ readonly [P in keyof T]: DeepReadonly_2<T[P]>;
421
+ };
422
+
423
+ /**
424
+ * @public
425
+ */
426
+ declare type DeepReadonlyMap<K, V> = ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>>;
427
+
428
+ /**
429
+ * @public
430
+ */
431
+ declare type DeepReadonlyObject<T> = {
432
+ readonly [K in keyof T]: DeepReadonly<T[K]>;
414
433
  };
415
434
 
435
+ /**
436
+ * @public
437
+ */
438
+ declare type DeepReadonlySet<T> = ReadonlySet<DeepReadonly<T>>;
439
+
416
440
  declare function defineSdkComponents(engine: PreEngine): {
417
441
  Transform: ComponentDefinition<ISchema<TransformType>, Partial<TransformType>>;
418
442
  MeshRenderer: ComponentDefinition<ISchema<PBMeshRenderer>, Partial<PBMeshRenderer>>;
@@ -438,6 +462,7 @@ declare function defineSdkComponents(engine: PreEngine): {
438
462
  SphereShape: ComponentDefinition<ISchema<PBSphereShape>, PBSphereShape>;
439
463
  TextShape: ComponentDefinition<ISchema<PBTextShape>, PBTextShape>;
440
464
  UiText: ComponentDefinition<ISchema<PBUiText>, PBUiText>;
465
+ VisibilityComponent: ComponentDefinition<ISchema<PBVisibilityComponent>, PBVisibilityComponent>;
441
466
  };
442
467
 
443
468
  /**
@@ -459,10 +484,6 @@ declare type EcsResult<T extends ISchema> = T extends ISchema ? ReturnType<T['de
459
484
  */
460
485
  declare function Engine({ transports }?: IEngineParams): IEngine;
461
486
 
462
- /**
463
- * @alpha * This file initialization is an alpha one. This is based on the old-ecs
464
- * init and it'll be changing.
465
- */
466
487
  declare const engine: IEngine;
467
488
 
468
489
  /**
@@ -567,7 +588,7 @@ declare type IEngine = {
567
588
  *
568
589
  * ```
569
590
  */
570
- defineComponent<T extends Spec, ConstructorType = Partial<Result<T>>>(spec: Spec, componentId: number, constructorDefault?: Partial<Result<T>>): ComponentDefinition<ISchema<Result<T>>, ConstructorType>;
591
+ defineComponent<T extends Spec, ConstructorType = Partial<Result<T>>>(spec: T, componentId: number, constructorDefault?: Partial<Result<T>>): ComponentDefinition<ISchema<Result<T>>, ConstructorType>;
571
592
  /**
572
593
  * Define a component and add it to the engine.
573
594
  * @param spec An object with schema fields
@@ -598,11 +619,11 @@ declare type IEngine = {
598
619
  * Example:
599
620
  * ```ts
600
621
  * for (const [entity, boxShape, transform] of engine.getEntitiesWith(BoxShape, Transform)) {
601
- * // the properties of boxShape and transform are read only
622
+ * // the properties of boxShape and transform are read only
602
623
  * }
603
624
  * ```
604
625
  */
605
- getEntitiesWith<T extends [ComponentDefinition, ...ComponentDefinition[]]>(...components: T): Iterable<[Entity, ...DeepReadonly<ComponentSchema<T>>]>;
626
+ getEntitiesWith<T extends [ComponentDefinition, ...ComponentDefinition[]]>(...components: T): Iterable<[Entity, ...ReadonlyComponentSchema<T>]>;
606
627
  baseComponents: SdkComponents;
607
628
  };
608
629
 
@@ -698,7 +719,7 @@ declare namespace Matrix {
698
719
  _isIdentity3x2Dirty: boolean;
699
720
  _m: Matrix4x4;
700
721
  };
701
- type ReadonlyMatrix = DeepReadonly<MutableMatrix>;
722
+ type ReadonlyMatrix = DeepReadonly_2<MutableMatrix>;
702
723
  /**
703
724
  * Gets the internal data of the matrix
704
725
  */
@@ -1717,6 +1738,11 @@ declare interface PBUiText {
1717
1738
  textColor: Color3 | undefined;
1718
1739
  }
1719
1740
 
1741
+ declare interface PBVisibilityComponent {
1742
+ /** default=true */
1743
+ visible?: boolean | undefined;
1744
+ }
1745
+
1720
1746
  /**
1721
1747
  * Represens a plane by the equation ax + by + cz + d = 0
1722
1748
  * @public
@@ -1732,7 +1758,7 @@ declare namespace Plane {
1732
1758
  */
1733
1759
  d: number;
1734
1760
  };
1735
- type ReadonlyPlane = DeepReadonly<MutablePlane>;
1761
+ type ReadonlyPlane = DeepReadonly_2<MutablePlane>;
1736
1762
  /**
1737
1763
  * Creates a Plane object according to the given floats a, b, c, d and the plane equation : ax + by + cz + d = 0
1738
1764
  * @param a - a component of the plane
@@ -1852,7 +1878,7 @@ declare function preEngine(): {
1852
1878
  removeSystem: (selector: string | Update) => boolean;
1853
1879
  defineComponent: <T extends Spec, ConstructorType = Partial<Result<T>>>(spec: T, componentId: number, constructorDefault?: ConstructorType | undefined) => ComponentDefinition<ISchema<Result<T>>, ConstructorType>;
1854
1880
  defineComponentFromSchema: <T_1 extends ISchema<any>, ConstructorType_1 = EcsResult<T_1>>(spec: T_1, componentId: number, constructorDefault?: ConstructorType_1 | undefined) => ComponentDefinition<T_1, ConstructorType_1>;
1855
- getEntitiesWith: <T_2 extends [ComponentDefinition<ISchema<any>, any>, ...ComponentDefinition<ISchema<any>, any>[]]>(...components: T_2) => Iterable<[Entity, ...DeepReadonly<ComponentSchema<T_2>>]>;
1881
+ getEntitiesWith: <T_2 extends [ComponentDefinition<ISchema<any>, any>, ...ComponentDefinition<ISchema<any>, any>[]]>(...components: T_2) => Iterable<[Entity, ...ReadonlyComponentSchema<T_2>]>;
1856
1882
  getComponent: <T_3 extends ISchema<any>>(componentId: number) => ComponentDefinition<T_3, EcsResult<T_3>>;
1857
1883
  removeComponentDefinition: (componentId: number) => void;
1858
1884
  };
@@ -1873,7 +1899,7 @@ declare namespace Quaternion {
1873
1899
  /**
1874
1900
  * @public
1875
1901
  */
1876
- export type ReadonlyQuaternion = DeepReadonly<MutableQuaternion>;
1902
+ export type ReadonlyQuaternion = DeepReadonly_2<MutableQuaternion>;
1877
1903
  /**
1878
1904
  * Creates a new Quaternion from the given floats
1879
1905
  * @param x - defines the first component (0 by default)
@@ -2027,6 +2053,18 @@ declare namespace Quaternion {
2027
2053
  */
2028
2054
  declare const RAD2DEG: number;
2029
2055
 
2056
+ /**
2057
+ * @public
2058
+ */
2059
+ declare type ReadonlyComponentSchema<T extends [ComponentDefinition, ...ComponentDefinition[]]> = {
2060
+ [K in keyof T]: T[K] extends ComponentDefinition ? ReturnType<T[K]['get']> : never;
2061
+ };
2062
+
2063
+ /**
2064
+ * @public
2065
+ */
2066
+ declare type ReadonlyPrimitive = number | string | number[] | string[] | boolean | boolean[];
2067
+
2030
2068
  declare type ReceiveMessage = {
2031
2069
  type: WireMessage.Enum;
2032
2070
  entity: Entity;
@@ -2191,7 +2229,7 @@ declare namespace Vector3 {
2191
2229
  /**
2192
2230
  * @public
2193
2231
  */
2194
- export type ReadonlyVector3 = DeepReadonly<MutableVector3>;
2232
+ export type ReadonlyVector3 = DeepReadonly_2<MutableVector3>;
2195
2233
  /**
2196
2234
  * Creates a new Vector3 object from the given x, y, z (floats) coordinates.
2197
2235
  * @param x - defines the first coordinates (on X axis)
@@ -2385,6 +2423,9 @@ declare interface Vector3_2 {
2385
2423
  z: number;
2386
2424
  }
2387
2425
 
2426
+ /** @public */
2427
+ declare const VisibilityComponent: ComponentDefinition<ISchema<PBVisibilityComponent>, PBVisibilityComponent>;
2428
+
2388
2429
  declare namespace WireMessage {
2389
2430
  enum Enum {
2390
2431
  RESERVED = 0,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "target": "es2018",
3
+ "target": "es2020",
4
4
  "module": "amd",
5
5
  "moduleResolution": "classic",
6
6
  "pretty": true,
@@ -37,4 +37,4 @@
37
37
  "."
38
38
  ]
39
39
  }
40
- }
40
+ }