@dcl/schemas 5.0.2 → 5.0.4-20220617172312.commit-d076a8b

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 CHANGED
@@ -1,19 +1,34 @@
1
1
  # common-schemas
2
2
 
3
+ Decentraland data structure interfaces and validators for TypeScript-based projects.
4
+
5
+ Install it with:
3
6
  ```bash
4
7
  npm i @dcl/schemas
5
8
  ```
6
9
 
7
- ### Design considerations
10
+ ## Design Guidelines
11
+
12
+ - Prevent type problems across projects
13
+ - Fail as early as possible, aim for compile-time
14
+ - Preserve user optionality through runtime helpers
15
+ - Prefer no-cost implementations and allow no-dependency import
16
+ - Code is written once, read hundreds of times
8
17
 
9
- - The main entrypoint of the library export types only (and the helper functions to prevent lockin)
18
+ Implementation decisions:
19
+
20
+ - The main entrypoint should only export types
10
21
  - Every type is also a namespace
11
22
  - Type names are PascalCase
12
23
  - Validators and schemas are camelCase
13
24
 
14
- ## Generating types, validators and schemas
25
+ ### Collaborator's Guide
26
+
27
+ #### Generating types, validators and schemas
15
28
 
16
- We will export types that also act as values. We do that using the "namespaces" of typescript. That is, every type is also a JS object, including two properties: `schema` and `validate`. It can also be a const, but a namespace _sounds_ better.
29
+ This library export types that also act as values. This is achieved through TypeScript's [`namespaces`](https://www.typescriptlang.org/docs/handbook/namespaces.html). This means that every type imported from this library can also be used as a JS object. These types will include two properties named `schema` and `validate`. `namespaces` in typescript can be considered "`cost` imports".
30
+
31
+ #### Example Type Definition
17
32
 
18
33
  ```ts
19
34
  // Declare type
@@ -36,12 +51,11 @@ export namespace MyType {
36
51
  }
37
52
  ```
38
53
 
39
- In that sense, MyType can be both used as type `const a: MyType` and as object `MyType.validate(a)`.
54
+ MyType can now be both used as type `const a: MyType` or as an object `MyType.validate(a)`.
40
55
 
41
- Beware that `validate` has type `ValidateFunction<T>` which `ajv` creates automatically. When writing new
42
- validations always try to implement it as an ajv validation, even if custom code is needed. See [here](https://ajv.js.org/keywords.html#define-keyword-with-code-generation-function).
56
+ Beware that `validate` has type `ValidateFunction<T>` which `ajv` creates automatically. When writing new validations always try to implement it as an ajv validation, even if custom code is needed. See [here](https://ajv.js.org/keywords.html#define-keyword-with-code-generation-function).
43
57
 
44
- In particular, don't fall in the trap of doing this:
58
+ Particularly, beware of using the library like this, because reports by the `validator.validate` function are lost and never returned to the caller.
45
59
 
46
60
  ```ts
47
61
  const validator = generateValidator<MyType>(schema);
@@ -49,28 +63,23 @@ export const validate = (mt: MyType) =>
49
63
  validator.validate(mt) && otherValidations(mt);
50
64
  ```
51
65
 
52
- By doing this, all the errors reported by the `validator.validate` function are lost and never returned
53
- to the caller.
54
-
55
- ## Type ownership
66
+ #### Code ownership
56
67
 
57
68
  Please add types and schemas of your domain into the `src/<team>` folder, also add your team to the [CODEOWNERS](.github/CODEOWNERS) repository to make sure nobody accidentally changes it without your team noticing it.
58
69
 
59
- ## Informing changes
60
-
61
- Please notify about changes to the schemas to the teams by adding the whole team (i.e. `@decentraland/dapps`) as reviewers of the pull requests.
70
+ #### Informing changes
62
71
 
63
- It is recommended that if you are a stakeholder of the interoperable parts of Decentraland, you are subscribed to this repository (wathing it in the button up right).
72
+ Please notify about changes to the schemas to relevant teams by adding the whole team (i.e. `@decentraland/dapps`) as reviewers of the pull requests.
64
73
 
65
- ## Making changes
74
+ It is recommended to subscribe to this repository (using the `Watch` function) if you use any internal part of the Decentraland ecosystem.
66
75
 
67
- To make sure everybody is aware of changes in types, we have a process of api-extraction using https://api-extractor.com. It creates [a report file](report/schemas.api.md) that should be reviewed upon every change and committed as part of the PR.
76
+ #### Making changes
68
77
 
69
- To generate the file with your changes run `npm run refresh-api`.
78
+ To make sure the relevant persons and groups are aware of changes in these types, there's an api-extraction process executed with https://api-extractor.com that creates [a report file](report/schemas.api.md) for review between commits. It gets included as part of PRs for easier read.
70
79
 
71
- In the CI, `npm run check-api` is executed to verify the generated file matches the exported types.
80
+ To generate the file before submitting a PR, run `npm run refresh-api`. This is executed by the CI by runnig `npm run check-api`. It also verifies that the generated file matches the exported types.
72
81
 
73
- ## Versions and publishing
82
+ ## Versioning and Publishing
74
83
 
75
84
  Versions are handled manually using Github releases and semver.
76
85
 
@@ -1 +1 @@
1
- {"version":3,"file":"emote.d.ts","sourceRoot":"","sources":["../../../../src/platform/item/emote/emote.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACnE,OAAO,EACL,QAAQ,EAGT,MAAM,cAAc,CAAA;AACrB,OAAO,EAAsB,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACrE,OAAO,EAAmB,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAEzD,oBAAY,UAAU,GAAG,QAAQ,GAC/B,CAAC,aAAa,GAAG,eAAe,CAAC,GAAG;IAAE,cAAc,EAAE,cAAc,CAAA;CAAE,CAAA;AAExE,aAAa;AACb,oBAAY,KAAK,GAAG,UAAU,CAAA;AAE9B,aAAa;AACb,yBAAiB,KAAK,CAAC;IACd,MAAM,MAAM,EAAE,UAAU,CAAC,KAAK,CAmCpC,CAAA;IAQM,MAAM,QAAQ,4DAAuD,CAAA;CAC7E"}
1
+ {"version":3,"file":"emote.d.ts","sourceRoot":"","sources":["../../../../src/platform/item/emote/emote.ts"],"names":[],"mappings":"AACA,OAAO,EAAqB,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACnE,OAAO,EACL,QAAQ,EAGT,MAAM,cAAc,CAAA;AACrB,OAAO,EAAsB,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACrE,OAAO,EAAmB,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAEzD,oBAAY,UAAU,GAAG,QAAQ,GAC/B,CAAC,aAAa,GAAG,eAAe,CAAC,GAAG;IAAE,cAAc,EAAE,cAAc,CAAA;CAAE,CAAA;AAExE,aAAa;AACb,oBAAY,KAAK,GAAG,UAAU,CAAA;AAE9B,aAAa;AACb,yBAAiB,KAAK,CAAC;IACd,MAAM,MAAM,EAAE,UAAU,CAAC,KAAK,CA8CpC,CAAA;IAQM,MAAM,QAAQ,4DAAuD,CAAA;CAC7E"}
@@ -31,7 +31,18 @@ var Emote;
31
31
  errorMessage: 'standard properties conditions are not met'
32
32
  },
33
33
  {
34
- required: ['merkleProof', 'content'],
34
+ required: [
35
+ 'merkleProof',
36
+ /* MerkleProof emote required Keys (might be redundant) */
37
+ 'content',
38
+ 'id',
39
+ 'name',
40
+ 'description',
41
+ 'i18n',
42
+ 'image',
43
+ 'thumbnail',
44
+ 'emoteDataADR74'
45
+ ],
35
46
  _isThirdParty: true,
36
47
  prohibited: ['collectionAddress', 'rarity'],
37
48
  errorMessage: 'thirdparty properties conditions are not met'
@@ -1 +1 @@
1
- {"version":3,"file":"emote.js","sourceRoot":"","sources":["../../../../src/platform/item/emote/emote.ts"],"names":[],"mappings":";;;AAAA,0BAAiC;AACjC,oDAAmE;AACnE,4CAIqB;AACrB,sDAAqE;AACrE,4DAAuE;AACvE,+DAAyD;AAQzD,aAAa;AACb,IAAiB,KAAK,CA6CrB;AA7CD,WAAiB,KAAK;IACP,YAAM,GAAsB;QACvC,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,GAAG,8BAAkB;YACrB,GAAG,mCAAkB;YACrB,GAAG,mCAAe;YAClB,cAAc,EAAE,iCAAc,CAAC,MAAM;SACtC;QACD,oBAAoB,EAAE,IAAI;QAC1B,QAAQ,EAAE,CAAC,GAAG,iCAAqB,CAAC;QACpC,KAAK,EAAE;YACL;gBACE,QAAQ,EAAE,CAAC,gBAAgB,CAAC;gBAC5B,kDAAkD;gBAClD,KAAK,EAAE;oBACL;wBACE,QAAQ,EAAE,CAAC,mBAAmB,EAAE,QAAQ,CAAC;wBACzC,UAAU,EAAE,CAAC,aAAa,EAAE,SAAS,CAAC;wBACtC,YAAY,EAAE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wBACE,QAAQ,EAAE,CAAC,mBAAmB,EAAE,QAAQ,CAAC;wBACzC,UAAU,EAAE,CAAC,aAAa,EAAE,SAAS,CAAC;wBACtC,YAAY,EAAE,4CAA4C;qBAC3D;oBACD;wBACE,QAAQ,EAAE;4BACR,aAAa;4BACb,0DAA0D;4BAC1D,SAAS;4BACT,IAAI;4BACJ,MAAM;4BACN,aAAa;4BACb,MAAM;4BACN,OAAO;4BACP,WAAW;4BACX,gBAAgB;yBACjB;wBACD,aAAa,EAAE,IAAI;wBACnB,UAAU,EAAE,CAAC,mBAAmB,EAAE,QAAQ,CAAC;wBAC3C,YAAY,EAAE,8CAA8C;qBAC7D;iBACF;gBACD,YAAY,EAAE;oBACZ,KAAK,EAAE,4DAA4D;iBACpE;aACF;SACF;QACD,YAAY,EAAE;YACZ,KAAK,EAAE,yDAAyD;SACjE;KACF,CAAA;IAED,MAAM,uBAAuB,GAAG;QAC9B,OAAO,EAAE,eAAe;QACxB,QAAQ,EAAE,CAAC,MAAe,EAAE,IAAS,EAAE,EAAE,CAAC,CAAC,MAAM,IAAI,IAAA,gBAAY,EAAC,IAAI,CAAC;QACvE,MAAM,EAAE,KAAK;KACd,CAAA;IAEY,cAAQ,GAAG,IAAA,8BAAiB,EAAC,MAAA,MAAM,EAAE,CAAC,uBAAuB,CAAC,CAAC,CAAA;AAC9E,CAAC,EAxDgB,KAAK,GAAL,aAAK,KAAL,aAAK,QAwDrB"}
@@ -1 +1 @@
1
- {"version":3,"file":"third-party-props.d.ts","sourceRoot":"","sources":["../../../src/platform/item/third-party-props.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EAEX,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,oBAAY,eAAe,GAAG;IAC5B,WAAW,EAAE,WAAW,CAAA;IACxB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAChC,CAAA;AAED,eAAO,MAAM,eAAe;;;;;;;;;;CAQlB,CAAA;AAYV,wBAAgB,YAAY,CAAC,CAAC,SAAS,QAAQ,EAC7C,IAAI,EAAE,CAAC,GACN,IAAI,IAAI,CAAC,GAAG,eAAe,CAU7B"}
1
+ {"version":3,"file":"third-party-props.d.ts","sourceRoot":"","sources":["../../../src/platform/item/third-party-props.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EAEX,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,oBAAY,eAAe,GAAG;IAC5B,WAAW,EAAE,WAAW,CAAA;IACxB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAChC,CAAA;AAED,eAAO,MAAM,eAAe;;;;;;;;;;CAQlB,CAAA;AA6BV,wBAAgB,YAAY,CAAC,CAAC,SAAS,QAAQ,EAC7C,IAAI,EAAE,CAAC,GACN,IAAI,IAAI,CAAC,GAAG,eAAe,CAE7B"}
@@ -17,17 +17,26 @@ const schema = {
17
17
  properties: {
18
18
  ...exports.thirdPartyProps
19
19
  },
20
- required: ['merkleProof', 'content']
20
+ required: ['merkleProof', 'content'],
21
+ _containsHashingKeys: true
21
22
  };
22
- const validate = (0, validation_1.generateValidator)(schema);
23
+ const _containsHashingKeys = {
24
+ keyword: '_containsHashingKeys',
25
+ validate: (schema, data) => {
26
+ var _a;
27
+ const itemAsThirdParty = data;
28
+ if ((_a = itemAsThirdParty === null || itemAsThirdParty === void 0 ? void 0 : itemAsThirdParty.merkleProof) === null || _a === void 0 ? void 0 : _a.hashingKeys) {
29
+ return itemAsThirdParty.merkleProof.hashingKeys.every((key) => itemAsThirdParty.hasOwnProperty(key));
30
+ }
31
+ return false;
32
+ },
33
+ errors: false
34
+ };
35
+ const validate = (0, validation_1.generateValidator)(schema, [
36
+ _containsHashingKeys
37
+ ]);
23
38
  function isThirdParty(item) {
24
- const isValid = validate(item);
25
- if (!isValid) {
26
- return isValid;
27
- }
28
- const itemAsThirdParty = item;
29
- const containsAllKeys = itemAsThirdParty.merkleProof.hashingKeys.every((key) => itemAsThirdParty.hasOwnProperty(key));
30
- return containsAllKeys;
39
+ return validate(item);
31
40
  }
32
41
  exports.isThirdParty = isThirdParty;
33
42
  //# sourceMappingURL=third-party-props.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"third-party-props.js","sourceRoot":"","sources":["../../../src/platform/item/third-party-props.ts"],"names":[],"mappings":";;;AAAA,iDAIyB;AACzB,8DAAyD;AAQ5C,QAAA,eAAe,GAAG;IAC7B,WAAW,EAAE,0BAAW,CAAC,MAAM;IAC/B,OAAO,EAAE;QACP,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,KAAK;QACf,oBAAoB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACxC,QAAQ,EAAE,EAAW;KACtB;CACO,CAAA;AAEV,MAAM,MAAM,GAAgC;IAC1C,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,GAAG,uBAAe;KACnB;IACD,QAAQ,EAAE,CAAC,aAAa,EAAE,SAAS,CAAC;CACrC,CAAA;AAED,MAAM,QAAQ,GAAsC,IAAA,8BAAiB,EAAC,MAAM,CAAC,CAAA;AAE7E,SAAgB,YAAY,CAC1B,IAAO;IAEP,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;IAC9B,IAAI,CAAC,OAAO,EAAE;QACZ,OAAO,OAAO,CAAA;KACf;IACD,MAAM,gBAAgB,GAAG,IAA2B,CAAA;IACpD,MAAM,eAAe,GAAG,gBAAgB,CAAC,WAAW,CAAC,WAAW,CAAC,KAAK,CACpE,CAAC,GAAG,EAAE,EAAE,CAAC,gBAAgB,CAAC,cAAc,CAAC,GAAG,CAAC,CAC9C,CAAA;IACD,OAAO,eAAe,CAAA;AACxB,CAAC;AAZD,oCAYC"}
1
+ {"version":3,"file":"third-party-props.js","sourceRoot":"","sources":["../../../src/platform/item/third-party-props.ts"],"names":[],"mappings":";;;AAAA,iDAIyB;AACzB,8DAAyD;AAQ5C,QAAA,eAAe,GAAG;IAC7B,WAAW,EAAE,0BAAW,CAAC,MAAM;IAC/B,OAAO,EAAE;QACP,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,KAAK;QACf,oBAAoB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;QACxC,QAAQ,EAAE,EAAW;KACtB;CACO,CAAA;AAEV,MAAM,MAAM,GAAgC;IAC1C,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,GAAG,uBAAe;KACnB;IACD,QAAQ,EAAE,CAAC,aAAa,EAAE,SAAS,CAAC;IACpC,oBAAoB,EAAE,IAAI;CAC3B,CAAA;AAED,MAAM,oBAAoB,GAAG;IAC3B,OAAO,EAAE,sBAAsB;IAC/B,QAAQ,EAAE,CAAC,MAAe,EAAE,IAAS,EAAE,EAAE;;QACvC,MAAM,gBAAgB,GAAG,IAAuB,CAAA;QAChD,IAAI,MAAA,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAE,WAAW,0CAAE,WAAW,EAAE;YAC9C,OAAO,gBAAgB,CAAC,WAAW,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAC5D,gBAAgB,CAAC,cAAc,CAAC,GAAG,CAAC,CACrC,CAAA;SACF;QACD,OAAO,KAAK,CAAA;IACd,CAAC;IACD,MAAM,EAAE,KAAK;CACd,CAAA;AAED,MAAM,QAAQ,GAAsC,IAAA,8BAAiB,EAAC,MAAM,EAAE;IAC5E,oBAAoB;CACrB,CAAC,CAAA;AAEF,SAAgB,YAAY,CAC1B,IAAO;IAEP,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAA;AACvB,CAAC;AAJD,oCAIC"}
@@ -1 +1 @@
1
- {"version":3,"file":"wearable.d.ts","sourceRoot":"","sources":["../../../../src/platform/item/wearable/wearable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,EACL,QAAQ,EAGT,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,aAAa,EAAsB,MAAM,mBAAmB,CAAA;AACrE,OAAO,EAEL,eAAe,EAEhB,MAAM,sBAAsB,CAAA;AAE7B,aAAa;AACb,oBAAY,QAAQ,GAAG,QAAQ,GAAG;IAChC,IAAI,EAAE;QACJ,QAAQ,EAAE,gBAAgB,EAAE,CAAA;QAC5B,KAAK,EAAE,gBAAgB,EAAE,CAAA;QACzB,IAAI,EAAE,MAAM,EAAE,CAAA;QACd,eAAe,EAAE,sBAAsB,EAAE,CAAA;QACzC,QAAQ,EAAE,gBAAgB,CAAA;KAC3B,CAAA;CACF,GAAG,CAAC,aAAa,GAAG,eAAe,CAAC,CAAA;AAErC,aAAa;AACb,yBAAiB,QAAQ,CAAC;IACjB,MAAM,MAAM,EAAE,UAAU,CAAC,QAAQ,CAmDvC,CAAA;IAQD;;;;;;;;;OASG;IACI,MAAM,QAAQ,0DAAuD,CAAA;CAC7E"}
1
+ {"version":3,"file":"wearable.d.ts","sourceRoot":"","sources":["../../../../src/platform/item/wearable/wearable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,UAAU,EAAE,MAAM,qBAAqB,CAAA;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AACnE,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,EACL,QAAQ,EAGT,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,aAAa,EAAsB,MAAM,mBAAmB,CAAA;AACrE,OAAO,EAEL,eAAe,EAEhB,MAAM,sBAAsB,CAAA;AAE7B,aAAa;AACb,oBAAY,QAAQ,GAAG,QAAQ,GAAG;IAChC,IAAI,EAAE;QACJ,QAAQ,EAAE,gBAAgB,EAAE,CAAA;QAC5B,KAAK,EAAE,gBAAgB,EAAE,CAAA;QACzB,IAAI,EAAE,MAAM,EAAE,CAAA;QACd,eAAe,EAAE,sBAAsB,EAAE,CAAA;QACzC,QAAQ,EAAE,gBAAgB,CAAA;KAC3B,CAAA;CACF,GAAG,CAAC,aAAa,GAAG,eAAe,CAAC,CAAA;AAErC,aAAa;AACb,yBAAiB,QAAQ,CAAC;IACjB,MAAM,MAAM,EAAE,UAAU,CAAC,QAAQ,CA6DvC,CAAA;IAQD;;;;;;;;;OASG;IACI,MAAM,QAAQ,0DAAuD,CAAA;CAC7E"}
@@ -49,16 +49,28 @@ var Wearable;
49
49
  oneOf: [
50
50
  {
51
51
  required: ['collectionAddress', 'rarity'],
52
- prohibited: ['merkleProof', 'content'],
53
- errorMessage: 'for standard wearables "merkleProof" and "content" are not allowed'
52
+ prohibited: ['merkleProof', 'content']
54
53
  },
55
54
  {
56
- required: ['merkleProof', 'content'],
57
- _isThirdParty: true,
55
+ required: [
56
+ 'merkleProof',
57
+ /* MerkleProof emote required Keys (might be redundant) */
58
+ 'content',
59
+ 'id',
60
+ 'name',
61
+ 'description',
62
+ 'i18n',
63
+ 'image',
64
+ 'thumbnail',
65
+ 'data'
66
+ ],
58
67
  prohibited: ['collectionAddress', 'rarity'],
59
- errorMessage: 'for third party wearables "collectionAddress" and "rarity" are not allowed'
68
+ _isThirdParty: true
60
69
  }
61
- ]
70
+ ],
71
+ errorMessage: {
72
+ oneOf: 'either standard XOR thirdparty properties conditions must be met'
73
+ }
62
74
  };
63
75
  const _isThirdPartyKeywordDef = {
64
76
  keyword: '_isThirdParty',
@@ -1 +1 @@
1
- {"version":3,"file":"wearable.js","sourceRoot":"","sources":["../../../../src/platform/item/wearable/wearable.ts"],"names":[],"mappings":";;;AAAA,oDAAmE;AACnE,wEA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AQ,CAAC;gBAC3C,YAAY,EACV,4EAA4E;aAC/E;SACF;KACF,CAAA;IAED,MAAM,uBAAuB,GAAG;QAC9B,OAAO,EAAE,eAAe;QACxB,QAAQ,EAAE,CAAC,MAAe,EAAE,IAAS,EAAE,EAAE,CAAC,CAAC,MAAM,IAAI,IAAA,gCAAY,EAAC,IAAI,CAAC;QACvE,MAAM,EAAE,KAAK;KACd,CAAA;IAED;;;;;;;;;OASG;IACU,iBAAQ,GAAG,IAAA,8BAAiB,EAAC,SAAA,MAAM,EAAE,CAAC,uBAAuB,CAAC,CAAC,CAAA;AAC9E,CAAC,EAvEgB,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAuExB"}
1
+ {"version":3,"file":"wearable.js","sourceRoot":"","sources":["../../../../src/platform/item/wearable/wearable.ts"],"names":[],"mappings":";;;AAAA,oDAAmE;AACnE,wEAAmE;AACnE,qDAAyD;AACzD,4CAIqB;AACrB,sDAAqE;AACrE,4DAI6B;AAa7B,aAAa;AACb,IAAiB,QAAQ,CAiFxB;AAjFD,WAAiB,QAAQ;IACV,eAAM,GAAyB;QAC1C,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,GAAG,8BAAkB;YACrB,GAAG,mCAAkB;YACrB,GAAG,mCAAe;YAClB,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,QAAQ,EAAE;wBACR,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE,oCAAgB,CAAC,MAAM;qBAC/B;oBACD,KAAK,EAAE;wBACL,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE,oCAAgB,CAAC,MAAM;qBAC/B;oBACD,IAAI,EAAE;wBACJ,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE;4BACL,IAAI,EAAE,QAAQ;4BACd,SAAS,EAAE,CAAC;yBACb;qBACF;oBACD,eAAe,EAAE;wBACf,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE,uCAAsB,CAAC,MAAM;wBACpC,QAAQ,EAAE,CAAC;qBACZ;oBACD,QAAQ,EAAE,oCAAgB,CAAC,MAAM;iBAClC;gBACD,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,UAAU,CAAC;aACvE;SACF;QACD,oBAAoB,EAAE,IAAI;QAC1B,QAAQ,EAAE,CAAC,GAAG,iCAAqB,EAAE,MAAM,CAAC;QAC5C,KAAK,EAAE;YACL;gBACE,QAAQ,EAAE,CAAC,mBAAmB,EAAE,QAAQ,CAAC;gBACzC,UAAU,EAAE,CAAC,aAAa,EAAE,SAAS,CAAC;aACvC;YACD;gBACE,QAAQ,EAAE;oBACR,aAAa;oBACb,0DAA0D;oBAC1D,SAAS;oBACT,IAAI;oBACJ,MAAM;oBACN,aAAa;oBACb,MAAM;oBACN,OAAO;oBACP,WAAW;oBACX,MAAM;iBACP;gBACD,UAAU,EAAE,CAAC,mBAAmB,EAAE,QAAQ,CAAC;gBAC3C,aAAa,EAAE,IAAI;aACpB;SACF;QACD,YAAY,EAAE;YACZ,KAAK,EAAE,kEAAkE;SAC1E;KACF,CAAA;IAED,MAAM,uBAAuB,GAAG;QAC9B,OAAO,EAAE,eAAe;QACxB,QAAQ,EAAE,CAAC,MAAe,EAAE,IAAS,EAAE,EAAE,CAAC,CAAC,MAAM,IAAI,IAAA,gCAAY,EAAC,IAAI,CAAC;QACvE,MAAM,EAAE,KAAK;KACd,CAAA;IAED;;;;;;;;;OASG;IACU,iBAAQ,GAAG,IAAA,8BAAiB,EAAC,SAAA,MAAM,EAAE,CAAC,uBAAuB,CAAC,CAAC,CAAA;AAC9E,CAAC,EAjFgB,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAiFxB"}
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.0.2",
2
+ "version": "5.0.4-20220617172312.commit-d076a8b",
3
3
  "name": "@dcl/schemas",
4
4
  "main": "./dist/index.js",
5
5
  "typings": "./dist/index.d.ts",
@@ -32,5 +32,5 @@
32
32
  "files": [
33
33
  "dist"
34
34
  ],
35
- "commit": "2865d41f8ea13f68871c14b83be4708b8eb57c8c"
35
+ "commit": "d076a8b3f21c4dcbaaa8f07e79eb86d28eed8993"
36
36
  }