@dcl/schemas 3.13.0 → 3.13.1-20220324151840.commit-5164516

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.
@@ -46,4 +46,7 @@ export declare namespace IPFSv2 {
46
46
  const schema: JSONSchema<IPFSv2>;
47
47
  const validate: ValidateFunction<IPFSv2>;
48
48
  }
49
+ export declare type WithRequired<T, K extends keyof T> = T & {
50
+ [P in K]-?: T[P];
51
+ };
49
52
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/misc/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,UAAU,EAAE,gBAAgB,EAAE,MAAM,IAAI,CAAA;AAEpE;;;GAGG;AACH,oBAAY,MAAM,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAExD;;;GAGG;AACH,yBAAiB,MAAM,CAAC;IACf,MAAM,MAAM,EAAE,UAAU,CAAC,MAAM,CAoBrC,CAAA;IAEM,MAAM,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CAEF,CAAA;CAC7C;AACD;;GAEG;AACH,oBAAY,UAAU,GAAG,MAAM,CAAA;AAE/B;;;GAGG;AACH,oBAAY,UAAU,GAAG,MAAM,CAAA;AAE/B;;;GAGG;AACH,yBAAiB,UAAU,CAAC;IACnB,MAAM,MAAM,EAAE,UAAU,CAAC,UAAU,CAGzC,CAAA;IAGM,MAAM,QAAQ,EAAE,gBAAgB,CAAC,UAAU,CAEQ,CAAA;CAC3D;AAED;;;GAGG;AACH,oBAAY,MAAM,GAAG,MAAM,CAAA;AAE3B;;;GAGG;AACH,yBAAiB,MAAM,CAAC;IACf,MAAM,MAAM,EAAE,UAAU,CAAC,MAAM,CAGrC,CAAA;IAEM,MAAM,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CAEJ,CAAA;CAC3C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/misc/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,UAAU,EAAE,gBAAgB,EAAE,MAAM,IAAI,CAAA;AAEpE;;;GAGG;AACH,oBAAY,MAAM,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAExD;;;GAGG;AACH,yBAAiB,MAAM,CAAC;IACf,MAAM,MAAM,EAAE,UAAU,CAAC,MAAM,CAoBrC,CAAA;IAEM,MAAM,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CAEF,CAAA;CAC7C;AACD;;GAEG;AACH,oBAAY,UAAU,GAAG,MAAM,CAAA;AAE/B;;;GAGG;AACH,oBAAY,UAAU,GAAG,MAAM,CAAA;AAE/B;;;GAGG;AACH,yBAAiB,UAAU,CAAC;IACnB,MAAM,MAAM,EAAE,UAAU,CAAC,UAAU,CAGzC,CAAA;IAGM,MAAM,QAAQ,EAAE,gBAAgB,CAAC,UAAU,CAEQ,CAAA;CAC3D;AAED;;;GAGG;AACH,oBAAY,MAAM,GAAG,MAAM,CAAA;AAE3B;;;GAGG;AACH,yBAAiB,MAAM,CAAC;IACf,MAAM,MAAM,EAAE,UAAU,CAAC,MAAM,CAGrC,CAAA;IAEM,MAAM,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CAEJ,CAAA;CAC3C;AAED,oBAAY,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,CAAC,GAAG;KAAG,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,CAAA"}
@@ -3,6 +3,5 @@ export { Locale } from './locale';
3
3
  export { Metrics } from './metrics';
4
4
  export { WearableRepresentation } from './representation';
5
5
  export { WearableBodyShape } from './wearable-body-shape';
6
- export { Wearable } from './wearable';
7
- export { TPWearable } from './tp-wearable';
6
+ export { Wearable, ThirdPartyWearable, StandardWearable } from './wearable';
8
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/platform/wearables/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/platform/wearables/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TPWearable = exports.Wearable = exports.WearableBodyShape = exports.WearableRepresentation = exports.Metrics = exports.Locale = exports.I18N = void 0;
3
+ exports.Wearable = exports.WearableBodyShape = exports.WearableRepresentation = exports.Metrics = exports.Locale = exports.I18N = void 0;
4
4
  var i18n_1 = require("./i18n");
5
5
  Object.defineProperty(exports, "I18N", { enumerable: true, get: function () { return i18n_1.I18N; } });
6
6
  var locale_1 = require("./locale");
@@ -13,6 +13,4 @@ var wearable_body_shape_1 = require("./wearable-body-shape");
13
13
  Object.defineProperty(exports, "WearableBodyShape", { enumerable: true, get: function () { return wearable_body_shape_1.WearableBodyShape; } });
14
14
  var wearable_1 = require("./wearable");
15
15
  Object.defineProperty(exports, "Wearable", { enumerable: true, get: function () { return wearable_1.Wearable; } });
16
- var tp_wearable_1 = require("./tp-wearable");
17
- Object.defineProperty(exports, "TPWearable", { enumerable: true, get: function () { return tp_wearable_1.TPWearable; } });
18
16
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platform/wearables/index.ts"],"names":[],"mappings":";;;AAAA,+BAA6B;AAApB,4FAAA,IAAI,OAAA;AACb,mCAAiC;AAAxB,gGAAA,MAAM,OAAA;AACf,qCAAmC;AAA1B,kGAAA,OAAO,OAAA;AAChB,mDAAyD;AAAhD,wHAAA,sBAAsB,OAAA;AAC/B,6DAAyD;AAAhD,wHAAA,iBAAiB,OAAA;AAC1B,uCAAqC;AAA5B,oGAAA,QAAQ,OAAA;AACjB,6CAA0C;AAAjC,yGAAA,UAAU,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platform/wearables/index.ts"],"names":[],"mappings":";;;AAAA,+BAA6B;AAApB,4FAAA,IAAI,OAAA;AACb,mCAAiC;AAAxB,gGAAA,MAAM,OAAA;AACf,qCAAmC;AAA1B,kGAAA,OAAO,OAAA;AAChB,mDAAyD;AAAhD,wHAAA,sBAAsB,OAAA;AAC/B,6DAAyD;AAAhD,wHAAA,iBAAiB,OAAA;AAC1B,uCAA2E;AAAlE,oGAAA,QAAQ,OAAA"}
@@ -1,14 +1,49 @@
1
1
  import { JSONSchema, ValidateFunction } from '../../validation';
2
2
  import { Rarity } from '../../dapps/rarity';
3
- import { BaseWearable } from './base-wearable';
3
+ import { WearableCategory } from '../../dapps/wearable-category';
4
+ import { I18N } from './i18n';
5
+ import { WearableRepresentation } from './representation';
6
+ import { Metrics } from './metrics';
7
+ import { DisplayableDeployment } from '../shared/displayable';
8
+ import { MerkleProof } from '../merkle-tree';
9
+ import { WithRequired } from '../../misc';
4
10
  /** @alpha */
5
- export declare type Wearable = BaseWearable & {
6
- rarity: Rarity;
7
- collectionAddress: string;
11
+ export declare type Wearable = DisplayableDeployment & {
12
+ id: string;
13
+ descriptions: I18N[];
14
+ collectionAddress?: string;
15
+ rarity?: Rarity;
16
+ names: I18N[];
17
+ data: {
18
+ replaces: WearableCategory[];
19
+ hides: WearableCategory[];
20
+ tags: string[];
21
+ representations: WearableRepresentation[];
22
+ category: WearableCategory;
23
+ };
24
+ thumbnail: string;
25
+ image: string;
26
+ metrics?: Metrics;
27
+ content?: Record<string, string>;
28
+ merkleProof?: MerkleProof;
8
29
  };
9
30
  /** @alpha */
31
+ export declare type StandardWearable = Omit<WithRequired<Wearable, 'collectionAddress' | 'rarity'>, 'merkleProof' | 'content'>;
32
+ export declare type ThirdPartyWearable = Omit<WithRequired<Wearable, 'merkleProof'>, 'rarity' | 'collectionAddress'>;
33
+ export declare const isStandard: (wearable: Wearable) => wearable is StandardWearable;
34
+ export declare const isThirdParty: (wearable: Wearable) => wearable is ThirdPartyWearable;
35
+ /** @alpha */
10
36
  export declare namespace Wearable {
11
37
  const schema: JSONSchema<Wearable>;
38
+ /**
39
+ * Validates that the wearable metadata complies with the standard or third party wearable, and doesn't have repeated locales.
40
+ * Some fields are defined as optional but those are validated to be present as standard XOR third party:
41
+ * Standard Wearables should contain:
42
+ * - collectionAddress
43
+ * - rarity
44
+ * Third Party Wearables should contain:
45
+ * - merkleProof
46
+ */
12
47
  const validate: ValidateFunction<Wearable>;
13
48
  }
14
49
  //# sourceMappingURL=wearable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"wearable.d.ts","sourceRoot":"","sources":["../../../src/platform/wearables/wearable.ts"],"names":[],"mappings":"AAAA,OAAO,EAE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,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;IACD,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAChC,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B,CAAA;AAED,aAAa;AACb,oBAAY,gBAAgB,GAAG,IAAI,CACjC,YAAY,CAAC,QAAQ,EAAE,mBAAmB,GAAG,QAAQ,CAAC,EACtD,aAAa,GAAG,SAAS,CAC1B,CAAA;AAED,oBAAY,kBAAkB,GAAG,IAAI,CACnC,YAAY,CAAC,QAAQ,EAAE,aAAa,CAAC,EACrC,QAAQ,GAAG,mBAAmB,CAC/B,CAAA;AAmBD,eAAO,MAAM,UAAU,aAAc,QAAQ,iCAC0B,CAAA;AAEvE,eAAO,MAAM,YAAY,aACb,QAAQ,mCAC6C,CAAA;AAEjE,aAAa;AACb,yBAAiB,QAAQ,CAAC;IACjB,MAAM,MAAM,EAAE,UAAU,CAAC,QAAQ,CA4EvC,CAAA;IAID;;;;;;;;OAQG;IACI,MAAM,QAAQ,EAAE,gBAAgB,CAAC,QAAQ,CAS7C,CAAA;CAUJ"}
@@ -1,26 +1,124 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Wearable = void 0;
3
+ exports.Wearable = exports.isThirdParty = exports.isStandard = void 0;
4
4
  const validation_1 = require("../../validation");
5
5
  const rarity_1 = require("../../dapps/rarity");
6
- const base_wearable_1 = require("./base-wearable");
6
+ const wearable_category_1 = require("../../dapps/wearable-category");
7
+ const i18n_1 = require("./i18n");
8
+ const representation_1 = require("./representation");
9
+ const metrics_1 = require("./metrics");
10
+ const displayable_1 = require("../shared/displayable");
11
+ const merkle_tree_1 = require("../merkle-tree");
12
+ const validateThirdParty = (wearable) => {
13
+ if (!merkle_tree_1.MerkleProof.validate(wearable.merkleProof))
14
+ return false;
15
+ if (wearable.merkleProof.hashingKeys.length === 0)
16
+ return false;
17
+ const containsAllKeys = wearable.merkleProof.hashingKeys.every((key) => wearable.hasOwnProperty(key));
18
+ const proofIsNotEmpty = wearable.merkleProof.proof.length > 0;
19
+ return containsAllKeys && proofIsNotEmpty;
20
+ };
21
+ const validateStandardWearable = (rarity, collectionAddress) => rarity_1.Rarity.validate(rarity) && !!collectionAddress;
22
+ const isStandard = (wearable) => validateStandardWearable(wearable.rarity, wearable.collectionAddress);
23
+ exports.isStandard = isStandard;
24
+ const isThirdParty = (wearable) => validateThirdParty(wearable);
25
+ exports.isThirdParty = isThirdParty;
7
26
  /** @alpha */
8
27
  var Wearable;
9
28
  (function (Wearable) {
10
29
  Wearable.schema = {
11
- ...base_wearable_1.BaseWearable.schema,
30
+ type: 'object',
12
31
  properties: {
13
- ...base_wearable_1.BaseWearable.schema.properties,
32
+ ...displayable_1.displayableProperties,
33
+ id: {
34
+ type: 'string'
35
+ },
36
+ descriptions: {
37
+ type: 'array',
38
+ items: i18n_1.I18N.schema,
39
+ minItems: 1
40
+ },
14
41
  collectionAddress: {
42
+ type: 'string',
43
+ nullable: true
44
+ },
45
+ rarity: {
46
+ ...rarity_1.Rarity.schema,
47
+ nullable: true
48
+ },
49
+ names: {
50
+ type: 'array',
51
+ items: i18n_1.I18N.schema,
52
+ minItems: 1
53
+ },
54
+ data: {
55
+ type: 'object',
56
+ properties: {
57
+ replaces: {
58
+ type: 'array',
59
+ items: wearable_category_1.WearableCategory.schema
60
+ },
61
+ hides: {
62
+ type: 'array',
63
+ items: wearable_category_1.WearableCategory.schema
64
+ },
65
+ tags: {
66
+ type: 'array',
67
+ items: {
68
+ type: 'string',
69
+ minLength: 1
70
+ }
71
+ },
72
+ representations: {
73
+ type: 'array',
74
+ items: representation_1.WearableRepresentation.schema,
75
+ minItems: 1
76
+ },
77
+ category: wearable_category_1.WearableCategory.schema
78
+ },
79
+ additionalProperties: false,
80
+ required: ['replaces', 'hides', 'tags', 'representations', 'category']
81
+ },
82
+ thumbnail: {
83
+ type: 'string'
84
+ },
85
+ image: {
15
86
  type: 'string'
16
87
  },
17
- rarity: rarity_1.Rarity.schema
88
+ metrics: {
89
+ ...metrics_1.Metrics.schema,
90
+ nullable: true
91
+ },
92
+ merkleProof: {
93
+ ...merkle_tree_1.MerkleProof.schema,
94
+ nullable: true
95
+ },
96
+ content: {
97
+ type: 'object',
98
+ nullable: true,
99
+ additionalProperties: { type: 'string' },
100
+ required: []
101
+ }
18
102
  },
19
- required: [...base_wearable_1.BaseWearable.schema.required, 'collectionAddress', 'rarity']
103
+ additionalProperties: true,
104
+ required: ['id', 'descriptions', 'names', 'data', 'thumbnail', 'image']
20
105
  };
21
106
  const schemaValidator = (0, validation_1.generateValidator)(Wearable.schema);
107
+ /**
108
+ * Validates that the wearable metadata complies with the standard or third party wearable, and doesn't have repeated locales.
109
+ * Some fields are defined as optional but those are validated to be present as standard XOR third party:
110
+ * Standard Wearables should contain:
111
+ * - collectionAddress
112
+ * - rarity
113
+ * Third Party Wearables should contain:
114
+ * - merkleProof
115
+ */
22
116
  Wearable.validate = (wearable) => schemaValidator(wearable) &&
23
- base_wearable_1.BaseWearable.validateDuplicatedLocales(wearable.descriptions) &&
24
- base_wearable_1.BaseWearable.validateDuplicatedLocales(wearable.names);
117
+ validateDuplicatedLocales(wearable.descriptions) &&
118
+ validateDuplicatedLocales(wearable.names) &&
119
+ XOR(validateStandardWearable(wearable.rarity, wearable.collectionAddress), validateThirdParty(wearable));
120
+ const XOR = (b1, b2) => (b1 && !b2) || (b2 && !b1);
121
+ // Returns true only if there are no entries with the same locale
122
+ const validateDuplicatedLocales = (i18ns) => i18ns.every(({ code }, index) => i18ns.findIndex((i18n) => i18n.code === code) === index);
25
123
  })(Wearable = exports.Wearable || (exports.Wearable = {}));
26
124
  //# sourceMappingURL=wearable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"wearable.js","sourceRoot":"","sources":["../../../src/platform/wearables/wearable.ts"],"names":[],"mappings":";;;AAAA,iDAIyB;AACzB,+CAA2C;AAC3C,mDAA8C;AAQ9C,aAAa;AACb,IAAiB,QAAQ,CAoBxB;AApBD,WAAiB,QAAQ;IACV,eAAM,GAAyB;QAC1C,GAAG,4BAAY,CAAC,MAAM;QACtB,UAAU,EAAE;YACV,GAAG,4BAAY,CAAC,MAAM,CAAC,UAAW;YAClC,iBAAiB,EAAE;gBACjB,IAAI,EAAE,QAAQ;aACf;YACD,MAAM,EAAE,eAAM,CAAC,MAAM;SACtB;QACD,QAAQ,EAAE,CAAC,GAAG,4BAAY,CAAC,MAAM,CAAC,QAAQ,EAAE,mBAAmB,EAAE,QAAQ,CAAC;KAC3E,CAAA;IAED,MAAM,eAAe,GAA+B,IAAA,8BAAiB,EAAC,SAAA,MAAM,CAAC,CAAA;IAChE,iBAAQ,GAA+B,CAClD,QAAa,EACS,EAAE,CACxB,eAAe,CAAC,QAAQ,CAAC;QACzB,4BAAY,CAAC,yBAAyB,CAAC,QAAQ,CAAC,YAAY,CAAC;QAC7D,4BAAY,CAAC,yBAAyB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;AAC1D,CAAC,EApBgB,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAoBxB"}
1
+ {"version":3,"file":"wearable.js","sourceRoot":"","sources":["../../../src/platform/wearables/wearable.ts"],"names":[],"mappings":";;;AAAA,iDAIyB;AACzB,+CAA2C;AAC3C,qEAAgE;AAChE,iCAA6B;AAC7B,qDAAyD;AACzD,uCAAmC;AACnC,uDAG8B;AAC9B,gDAA4C;AAmC5C,MAAM,kBAAkB,GAAG,CAAC,QAAkB,EAAE,EAAE;IAChD,IAAI,CAAC,yBAAW,CAAC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Q,EAAE,EAAE;aACb;SACF;QACD,oBAAoB,EAAE,IAAI;QAC1B,QAAQ,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC;KACxE,CAAA;IAED,MAAM,eAAe,GAA+B,IAAA,8BAAiB,EAAC,SAAA,MAAM,CAAC,CAAA;IAE7E;;;;;;;;OAQG;IACU,iBAAQ,GAA+B,CAClD,QAAa,EACS,EAAE,CACxB,eAAe,CAAC,QAAQ,CAAC;QACzB,yBAAyB,CAAC,QAAQ,CAAC,YAAY,CAAC;QAChD,yBAAyB,CAAC,QAAQ,CAAC,KAAK,CAAC;QACzC,GAAG,CACD,wBAAwB,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,iBAAiB,CAAC,EACrE,kBAAkB,CAAC,QAAQ,CAAC,CAC7B,CAAA;IAEH,MAAM,GAAG,GAAG,CAAC,EAAW,EAAE,EAAW,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC,CAAA;IAEpE,iEAAiE;IACjE,MAAM,yBAAyB,GAAG,CAAC,KAAa,EAAE,EAAE,CAClD,KAAK,CAAC,KAAK,CACT,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,CAClB,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,KAAK,CAC1D,CAAA;AACL,CAAC,EA7GgB,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QA6GxB"}
package/dist/schemas.d.ts CHANGED
@@ -134,30 +134,6 @@ export declare namespace AvatarInfo {
134
134
  const validate: ValidateFunction<AvatarInfo>;
135
135
  }
136
136
 
137
- /** @alpha */
138
- declare type BaseWearable = DisplayableDeployment & {
139
- id: string;
140
- descriptions: I18N[];
141
- names: I18N[];
142
- data: {
143
- replaces: WearableCategory[];
144
- hides: WearableCategory[];
145
- tags: string[];
146
- representations: WearableRepresentation[];
147
- category: WearableCategory;
148
- };
149
- thumbnail: string;
150
- image: string;
151
- metrics?: Metrics;
152
- };
153
-
154
- /** @alpha */
155
- declare namespace BaseWearable {
156
- const schema: JSONSchema<BaseWearable>;
157
- const validateDuplicatedLocales: (i18ns: I18N[]) => boolean;
158
- const validate: ValidateFunction<BaseWearable>;
159
- }
160
-
161
137
  export declare type Bid = {
162
138
  id: string;
163
139
  bidAddress: string;
@@ -1051,6 +1027,9 @@ export declare namespace SpawnPoint {
1051
1027
  const validate: ValidateFunction<SpawnPoint>;
1052
1028
  }
1053
1029
 
1030
+ /** @alpha */
1031
+ export declare type StandardWearable = Omit<WithRequired<Wearable, 'collectionAddress' | 'rarity'>, 'merkleProof' | 'content'>;
1032
+
1054
1033
  export declare type Store = {
1055
1034
  id: string;
1056
1035
  owner: string;
@@ -1071,17 +1050,7 @@ export declare namespace Store {
1071
1050
  const validate: ValidateFunction<Store>;
1072
1051
  }
1073
1052
 
1074
- /** @alpha */
1075
- export declare type TPWearable = BaseWearable & {
1076
- content: Record<string, string>;
1077
- merkleProof: MerkleProof;
1078
- };
1079
-
1080
- /** @alpha */
1081
- export declare namespace TPWearable {
1082
- const schema: JSONSchema<TPWearable>;
1083
- const validate: ValidateFunction<TPWearable>;
1084
- }
1053
+ export declare type ThirdPartyWearable = Omit<WithRequired<Wearable, 'merkleProof'>, 'rarity' | 'collectionAddress'>;
1085
1054
 
1086
1055
  /** @public @deprecated */
1087
1056
  declare const UPDATE = "update";
@@ -1126,14 +1095,38 @@ export declare type ValidWorldRange = {
1126
1095
  };
1127
1096
 
1128
1097
  /** @alpha */
1129
- export declare type Wearable = BaseWearable & {
1130
- rarity: Rarity;
1131
- collectionAddress: string;
1098
+ export declare type Wearable = DisplayableDeployment & {
1099
+ id: string;
1100
+ descriptions: I18N[];
1101
+ collectionAddress?: string;
1102
+ rarity?: Rarity;
1103
+ names: I18N[];
1104
+ data: {
1105
+ replaces: WearableCategory[];
1106
+ hides: WearableCategory[];
1107
+ tags: string[];
1108
+ representations: WearableRepresentation[];
1109
+ category: WearableCategory;
1110
+ };
1111
+ thumbnail: string;
1112
+ image: string;
1113
+ metrics?: Metrics;
1114
+ content?: Record<string, string>;
1115
+ merkleProof?: MerkleProof;
1132
1116
  };
1133
1117
 
1134
1118
  /** @alpha */
1135
1119
  export declare namespace Wearable {
1136
1120
  const schema: JSONSchema<Wearable>;
1121
+ /**
1122
+ * Validates that the wearable metadata complies with the standard or third party wearable, and doesn't have repeated locales.
1123
+ * Some fields are defined as optional but those are validated to be present as standard XOR third party:
1124
+ * Standard Wearables should contain:
1125
+ * - collectionAddress
1126
+ * - rarity
1127
+ * Third Party Wearables should contain:
1128
+ * - merkleProof
1129
+ */
1137
1130
  const validate: ValidateFunction<Wearable>;
1138
1131
  }
1139
1132
 
@@ -1203,6 +1196,10 @@ export declare namespace WearableRepresentation {
1203
1196
  const validate: ValidateFunction<WearableRepresentation>;
1204
1197
  }
1205
1198
 
1199
+ export declare type WithRequired<T, K extends keyof T> = T & {
1200
+ [P in K]-?: T[P];
1201
+ };
1202
+
1206
1203
  /**
1207
1204
  * World
1208
1205
  * @alpha
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.13.0",
2
+ "version": "3.13.1-20220324151840.commit-5164516",
3
3
  "name": "@dcl/schemas",
4
4
  "main": "./dist/index.js",
5
5
  "typings": "./dist/index.d.ts",
@@ -28,5 +28,5 @@
28
28
  "files": [
29
29
  "dist"
30
30
  ],
31
- "commit": "a85e64ab631474d55a3032992dcca57e0d5af9f8"
31
+ "commit": "51645160840df671bd999ede83b62718039fc8f5"
32
32
  }
@@ -1,29 +0,0 @@
1
- import { JSONSchema, ValidateFunction } from '../../validation';
2
- import { WearableCategory } from '../../dapps/wearable-category';
3
- import { I18N } from './i18n';
4
- import { WearableRepresentation } from './representation';
5
- import { Metrics } from './metrics';
6
- import { DisplayableDeployment } from '../shared/displayable';
7
- /** @alpha */
8
- export declare type BaseWearable = DisplayableDeployment & {
9
- id: string;
10
- descriptions: I18N[];
11
- names: I18N[];
12
- data: {
13
- replaces: WearableCategory[];
14
- hides: WearableCategory[];
15
- tags: string[];
16
- representations: WearableRepresentation[];
17
- category: WearableCategory;
18
- };
19
- thumbnail: string;
20
- image: string;
21
- metrics?: Metrics;
22
- };
23
- /** @alpha */
24
- export declare namespace BaseWearable {
25
- const schema: JSONSchema<BaseWearable>;
26
- const validateDuplicatedLocales: (i18ns: I18N[]) => boolean;
27
- const validate: ValidateFunction<BaseWearable>;
28
- }
29
- //# sourceMappingURL=base-wearable.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base-wearable.d.ts","sourceRoot":"","sources":["../../../src/platform/wearables/base-wearable.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,gBAAgB,EACjB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EACL,qBAAqB,EAEtB,MAAM,uBAAuB,CAAA;AAE9B,aAAa;AACb,oBAAY,YAAY,GAAG,qBAAqB,GAAG;IACjD,EAAE,EAAE,MAAM,CAAA;IACV,YAAY,EAAE,IAAI,EAAE,CAAA;IACpB,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,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;IACD,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,aAAa;AACb,yBAAiB,YAAY,CAAC;IACrB,MAAM,MAAM,EAAE,UAAU,CAAC,YAAY,CA0D3C,CAAA;IAGM,MAAM,yBAAyB,UAAW,IAAI,EAAE,YAIpD,CAAA;IAII,MAAM,QAAQ,EAAE,gBAAgB,CAAC,YAAY,CAKT,CAAA;CAC5C"}
@@ -1,79 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BaseWearable = void 0;
4
- const validation_1 = require("../../validation");
5
- const wearable_category_1 = require("../../dapps/wearable-category");
6
- const i18n_1 = require("./i18n");
7
- const representation_1 = require("./representation");
8
- const metrics_1 = require("./metrics");
9
- const displayable_1 = require("../shared/displayable");
10
- /** @alpha */
11
- var BaseWearable;
12
- (function (BaseWearable) {
13
- BaseWearable.schema = {
14
- type: 'object',
15
- properties: {
16
- ...displayable_1.displayableProperties,
17
- id: {
18
- type: 'string'
19
- },
20
- descriptions: {
21
- type: 'array',
22
- items: i18n_1.I18N.schema,
23
- minItems: 1
24
- },
25
- names: {
26
- type: 'array',
27
- items: i18n_1.I18N.schema,
28
- minItems: 1
29
- },
30
- data: {
31
- type: 'object',
32
- properties: {
33
- replaces: {
34
- type: 'array',
35
- items: wearable_category_1.WearableCategory.schema
36
- },
37
- hides: {
38
- type: 'array',
39
- items: wearable_category_1.WearableCategory.schema
40
- },
41
- tags: {
42
- type: 'array',
43
- items: {
44
- type: 'string',
45
- minLength: 1
46
- }
47
- },
48
- representations: {
49
- type: 'array',
50
- items: representation_1.WearableRepresentation.schema,
51
- minItems: 1
52
- },
53
- category: wearable_category_1.WearableCategory.schema
54
- },
55
- additionalProperties: false,
56
- required: ['replaces', 'hides', 'tags', 'representations', 'category']
57
- },
58
- thumbnail: {
59
- type: 'string'
60
- },
61
- image: {
62
- type: 'string'
63
- },
64
- metrics: {
65
- ...metrics_1.Metrics.schema,
66
- nullable: true
67
- }
68
- },
69
- additionalProperties: false,
70
- required: ['id', 'descriptions', 'names', 'data', 'thumbnail', 'image']
71
- };
72
- // Returns true only if there are no entries with the same locale
73
- BaseWearable.validateDuplicatedLocales = (i18ns) => i18ns.every(({ code }, index) => i18ns.findIndex((i18n) => i18n.code === code) === index);
74
- const schemaValidator = (0, validation_1.generateValidator)(BaseWearable.schema);
75
- BaseWearable.validate = (wearable) => schemaValidator(wearable) &&
76
- BaseWearable.validateDuplicatedLocales(wearable.descriptions) &&
77
- BaseWearable.validateDuplicatedLocales(wearable.names);
78
- })(BaseWearable = exports.BaseWearable || (exports.BaseWearable = {}));
79
- //# sourceMappingURL=base-wearable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base-wearable.js","sourceRoot":"","sources":["../../../src/platform/wearables/base-wearable.ts"],"names":[],"mappings":";;;AAAA,iDAIyB;AACzB,qEAAgE;AAChE,iCAA6B;AAC7B,qDAAyD;AACzD,uCAAmC;AACnC,uDAG8B;AAmB9B,aAAa;AACb,IAAiB,YAAY,CA4E5B;AA5ED,WAAiB,YAAY;IACd,mBAAM,GAA6B;QAC9C,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,GAAG,mCAAqB;YACxB,EAAE,EAAE;gBACF,IAAI,EAAE,QAAQ;aACf;YACD,YAAY,EAAE;gBACZ,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,WAAI,CAAC,MAAM;gBAClB,QAAQ,EAAE,CAAC;aACZ;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,WAAI,CAAC,MAAM;gBAClB,QAAQ,EAAE,CAAC;aACZ;YACD,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,IAA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C;QAChD,aAAA,yBAAyB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;AAC7C,CAAC,EA5EgB,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QA4E5B"}
@@ -1,14 +0,0 @@
1
- import { JSONSchema, ValidateFunction } from '../../validation';
2
- import { MerkleProof } from '../merkle-tree';
3
- import { BaseWearable } from './base-wearable';
4
- /** @alpha */
5
- export declare type TPWearable = BaseWearable & {
6
- content: Record<string, string>;
7
- merkleProof: MerkleProof;
8
- };
9
- /** @alpha */
10
- export declare namespace TPWearable {
11
- const schema: JSONSchema<TPWearable>;
12
- const validate: ValidateFunction<TPWearable>;
13
- }
14
- //# sourceMappingURL=tp-wearable.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tp-wearable.d.ts","sourceRoot":"","sources":["../../../src/platform/wearables/tp-wearable.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,gBAAgB,EACjB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C,aAAa;AACb,oBAAY,UAAU,GAAG,YAAY,GAAG;IACtC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,WAAW,EAAE,WAAW,CAAA;CACzB,CAAA;AAED,aAAa;AACb,yBAAiB,UAAU,CAAC;IACnB,MAAM,MAAM,EAAE,UAAU,CAAC,UAAU,CAYzC,CAAA;IAIM,MAAM,QAAQ,EAAE,gBAAgB,CAAC,UAAU,CAKM,CAAA;CACzD"}
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TPWearable = void 0;
4
- const validation_1 = require("../../validation");
5
- const merkle_tree_1 = require("../merkle-tree");
6
- const base_wearable_1 = require("./base-wearable");
7
- /** @alpha */
8
- var TPWearable;
9
- (function (TPWearable) {
10
- TPWearable.schema = {
11
- ...base_wearable_1.BaseWearable.schema,
12
- properties: {
13
- ...base_wearable_1.BaseWearable.schema.properties,
14
- content: {
15
- type: 'object',
16
- additionalProperties: { type: 'string' },
17
- required: []
18
- },
19
- merkleProof: merkle_tree_1.MerkleProof.schema
20
- },
21
- required: [...base_wearable_1.BaseWearable.schema.required, 'content']
22
- };
23
- const schemaValidator = (0, validation_1.generateValidator)(TPWearable.schema);
24
- TPWearable.validate = (wearable) => schemaValidator(wearable) &&
25
- base_wearable_1.BaseWearable.validateDuplicatedLocales(wearable.descriptions) &&
26
- base_wearable_1.BaseWearable.validateDuplicatedLocales(wearable.names);
27
- })(TPWearable = exports.TPWearable || (exports.TPWearable = {}));
28
- //# sourceMappingURL=tp-wearable.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tp-wearable.js","sourceRoot":"","sources":["../../../src/platform/wearables/tp-wearable.ts"],"names":[],"mappings":";;;AAAA,iDAIyB;AACzB,gDAA4C;AAC5C,mDAA8C;AAQ9C,aAAa;AACb,IAAiB,UAAU,CAuB1B;AAvBD,WAAiB,UAAU;IACZ,iBAAM,GAA2B;QAC5C,GAAG,4BAAY,CAAC,MAAM;QACtB,UAAU,EAAE;YACV,GAAG,4BAAY,CAAC,MAAM,CAAC,UAAW;YAClC,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,oBAAoB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACxC,QAAQ,EAAE,EAAE;aACb;YACD,WAAW,EAAE,yBAAW,CAAC,MAAM;SAChC;QACD,QAAQ,EAAE,CAAC,GAAG,4BAAY,CAAC,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC;KACvD,CAAA;IAED,MAAM,eAAe,GACnB,IAAA,8BAAiB,EAAC,WAAA,MAAM,CAAC,CAAA;IACd,mBAAQ,GAAiC,CACpD,QAAa,EACW,EAAE,CAC1B,eAAe,CAAC,QAAQ,CAAC;QACzB,4BAAY,CAAC,yBAAyB,CAAC,QAAQ,CAAC,YAAY,CAAC;QAC7D,4BAAY,CAAC,yBAAyB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;AAC1D,CAAC,EAvBgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAuB1B"}