@dcl/schemas 4.14.1 → 4.15.0

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.
Files changed (124) hide show
  1. package/README.md +7 -4
  2. package/dist/dapps/item.d.ts +1 -1
  3. package/dist/dapps/item.d.ts.map +1 -1
  4. package/dist/dapps/nft.d.ts +1 -1
  5. package/dist/dapps/nft.d.ts.map +1 -1
  6. package/dist/dapps/nft.js +2 -2
  7. package/dist/dapps/nft.js.map +1 -1
  8. package/dist/dapps/preview/preview-config.d.ts +2 -2
  9. package/dist/dapps/preview/preview-config.d.ts.map +1 -1
  10. package/dist/dapps/preview/preview-options.d.ts +2 -2
  11. package/dist/dapps/preview/preview-options.d.ts.map +1 -1
  12. package/dist/dapps/preview/representation-definition.d.ts +1 -1
  13. package/dist/dapps/preview/representation-definition.d.ts.map +1 -1
  14. package/dist/dapps/preview/wearable-definition.d.ts +1 -1
  15. package/dist/dapps/preview/wearable-definition.d.ts.map +1 -1
  16. package/dist/index.d.ts +0 -1
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +1 -3
  19. package/dist/index.js.map +1 -1
  20. package/dist/misc/index.d.ts +0 -3
  21. package/dist/misc/index.d.ts.map +1 -1
  22. package/dist/platform/entity.d.ts +2 -1
  23. package/dist/platform/entity.d.ts.map +1 -1
  24. package/dist/platform/entity.js +1 -0
  25. package/dist/platform/entity.js.map +1 -1
  26. package/dist/platform/index.d.ts +1 -1
  27. package/dist/platform/index.d.ts.map +1 -1
  28. package/dist/platform/index.js +1 -1
  29. package/dist/platform/index.js.map +1 -1
  30. package/dist/platform/item/base-item.d.ts +19 -0
  31. package/dist/platform/item/base-item.d.ts.map +1 -0
  32. package/dist/platform/item/base-item.js +45 -0
  33. package/dist/platform/item/base-item.js.map +1 -0
  34. package/dist/platform/item/body-shape.d.ts +12 -0
  35. package/dist/platform/item/body-shape.d.ts.map +1 -0
  36. package/dist/platform/item/body-shape.js +19 -0
  37. package/dist/platform/item/body-shape.js.map +1 -0
  38. package/dist/platform/item/emote/adr74/emote-data-adr74.d.ts +13 -0
  39. package/dist/platform/item/emote/adr74/emote-data-adr74.d.ts.map +1 -0
  40. package/dist/platform/item/emote/adr74/emote-data-adr74.js +31 -0
  41. package/dist/platform/item/emote/adr74/emote-data-adr74.js.map +1 -0
  42. package/dist/platform/item/emote/adr74/representation-adr74.d.ts +14 -0
  43. package/dist/platform/item/emote/adr74/representation-adr74.d.ts.map +1 -0
  44. package/dist/platform/item/emote/adr74/representation-adr74.js +41 -0
  45. package/dist/platform/item/emote/adr74/representation-adr74.js.map +1 -0
  46. package/dist/{dapps → platform/item/emote}/emote-category.d.ts +1 -1
  47. package/dist/platform/item/emote/emote-category.d.ts.map +1 -0
  48. package/dist/{dapps → platform/item/emote}/emote-category.js +1 -1
  49. package/dist/platform/item/emote/emote-category.js.map +1 -0
  50. package/dist/platform/item/emote/emote.d.ts +16 -0
  51. package/dist/platform/item/emote/emote.d.ts.map +1 -0
  52. package/dist/platform/item/emote/emote.js +56 -0
  53. package/dist/platform/item/emote/emote.js.map +1 -0
  54. package/dist/platform/item/emote/index.d.ts +5 -0
  55. package/dist/platform/item/emote/index.d.ts.map +1 -0
  56. package/dist/platform/item/emote/index.js +12 -0
  57. package/dist/platform/item/emote/index.js.map +1 -0
  58. package/dist/platform/{wearables → item}/i18n.d.ts +0 -0
  59. package/dist/platform/item/i18n.d.ts.map +1 -0
  60. package/dist/platform/{wearables → item}/i18n.js +0 -0
  61. package/dist/platform/item/i18n.js.map +1 -0
  62. package/dist/platform/item/index.d.ts +9 -0
  63. package/dist/platform/item/index.d.ts.map +1 -0
  64. package/dist/platform/item/index.js +32 -0
  65. package/dist/platform/item/index.js.map +1 -0
  66. package/dist/platform/{wearables → item}/locale.d.ts +0 -0
  67. package/dist/platform/item/locale.d.ts.map +1 -0
  68. package/dist/platform/{wearables → item}/locale.js +0 -0
  69. package/dist/platform/item/locale.js.map +1 -0
  70. package/dist/platform/{wearables → item}/metrics.d.ts +0 -0
  71. package/dist/platform/item/metrics.d.ts.map +1 -0
  72. package/dist/platform/{wearables → item}/metrics.js +0 -0
  73. package/dist/platform/item/metrics.js.map +1 -0
  74. package/dist/platform/item/standard-props.d.ts +16 -0
  75. package/dist/platform/item/standard-props.d.ts.map +1 -0
  76. package/dist/platform/item/standard-props.js +25 -0
  77. package/dist/platform/item/standard-props.js.map +1 -0
  78. package/dist/platform/item/third-party-props.d.ts +20 -0
  79. package/dist/platform/item/third-party-props.d.ts.map +1 -0
  80. package/dist/platform/item/third-party-props.js +33 -0
  81. package/dist/platform/item/third-party-props.js.map +1 -0
  82. package/dist/platform/item/wearable/index.d.ts +3 -0
  83. package/dist/platform/item/wearable/index.d.ts.map +1 -0
  84. package/dist/platform/item/wearable/index.js +8 -0
  85. package/dist/platform/item/wearable/index.js.map +1 -0
  86. package/dist/platform/{wearables → item/wearable}/representation.d.ts +4 -4
  87. package/dist/platform/item/wearable/representation.d.ts.map +1 -0
  88. package/dist/platform/{wearables → item/wearable}/representation.js +9 -8
  89. package/dist/platform/item/wearable/representation.js.map +1 -0
  90. package/dist/platform/item/wearable/wearable.d.ts +32 -0
  91. package/dist/platform/item/wearable/wearable.d.ts.map +1 -0
  92. package/dist/platform/item/wearable/wearable.js +80 -0
  93. package/dist/platform/item/wearable/wearable.js.map +1 -0
  94. package/dist/platform/merkle-tree/merkle-proof.d.ts.map +1 -1
  95. package/dist/platform/merkle-tree/merkle-proof.js +2 -1
  96. package/dist/platform/merkle-tree/merkle-proof.js.map +1 -1
  97. package/dist/schemas.d.ts +85 -37
  98. package/dist/validation.d.ts +2 -2
  99. package/dist/validation.d.ts.map +1 -1
  100. package/dist/validation.js +4 -3
  101. package/dist/validation.js.map +1 -1
  102. package/package.json +2 -2
  103. package/dist/dapps/emote-category.d.ts.map +0 -1
  104. package/dist/dapps/emote-category.js.map +0 -1
  105. package/dist/platform/wearables/i18n.d.ts.map +0 -1
  106. package/dist/platform/wearables/i18n.js.map +0 -1
  107. package/dist/platform/wearables/index.d.ts +0 -7
  108. package/dist/platform/wearables/index.d.ts.map +0 -1
  109. package/dist/platform/wearables/index.js +0 -16
  110. package/dist/platform/wearables/index.js.map +0 -1
  111. package/dist/platform/wearables/locale.d.ts.map +0 -1
  112. package/dist/platform/wearables/locale.js.map +0 -1
  113. package/dist/platform/wearables/metrics.d.ts.map +0 -1
  114. package/dist/platform/wearables/metrics.js.map +0 -1
  115. package/dist/platform/wearables/representation.d.ts.map +0 -1
  116. package/dist/platform/wearables/representation.js.map +0 -1
  117. package/dist/platform/wearables/wearable-body-shape.d.ts +0 -12
  118. package/dist/platform/wearables/wearable-body-shape.d.ts.map +0 -1
  119. package/dist/platform/wearables/wearable-body-shape.js +0 -19
  120. package/dist/platform/wearables/wearable-body-shape.js.map +0 -1
  121. package/dist/platform/wearables/wearable.d.ts +0 -51
  122. package/dist/platform/wearables/wearable.d.ts.map +0 -1
  123. package/dist/platform/wearables/wearable.js +0 -138
  124. package/dist/platform/wearables/wearable.js.map +0 -1
@@ -0,0 +1,16 @@
1
+ import { JSONSchema } from '../../../validation';
2
+ import { BaseItem } from '../base-item';
3
+ import { StandardProps } from '../standard-props';
4
+ import { ThirdPartyProps } from '../third-party-props';
5
+ import { EmoteDataADR74 } from './adr74/emote-data-adr74';
6
+ export declare type EmoteADR74 = BaseItem & (StandardProps | ThirdPartyProps) & {
7
+ emoteDataADR74: EmoteDataADR74;
8
+ };
9
+ /** @alpha */
10
+ export declare type Emote = EmoteADR74;
11
+ /** @alpha */
12
+ export declare namespace Emote {
13
+ const schema: JSONSchema<Emote>;
14
+ const validate: import("../../../validation").ValidateFunction<EmoteADR74>;
15
+ }
16
+ //# sourceMappingURL=emote.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Emote = void 0;
4
+ const __1 = require("..");
5
+ const validation_1 = require("../../../validation");
6
+ const base_item_1 = require("../base-item");
7
+ const standard_props_1 = require("../standard-props");
8
+ const third_party_props_1 = require("../third-party-props");
9
+ const emote_data_adr74_1 = require("./adr74/emote-data-adr74");
10
+ /** @alpha */
11
+ var Emote;
12
+ (function (Emote) {
13
+ Emote.schema = {
14
+ type: 'object',
15
+ properties: {
16
+ ...base_item_1.baseItemProperties,
17
+ ...standard_props_1.standardProperties,
18
+ ...third_party_props_1.thirdPartyProps,
19
+ emoteDataADR74: emote_data_adr74_1.EmoteDataADR74.schema
20
+ },
21
+ additionalProperties: true,
22
+ required: [...base_item_1.requiredBaseItemProps],
23
+ oneOf: [
24
+ {
25
+ required: ['emoteDataADR74'],
26
+ // Emotes of ADR74 must be standard XOR thirdparty
27
+ oneOf: [
28
+ {
29
+ required: ['collectionAddress', 'rarity'],
30
+ prohibited: ['merkleProof', 'content'],
31
+ errorMessage: 'standard properties conditions are not met'
32
+ },
33
+ {
34
+ required: ['merkleProof', 'content'],
35
+ _isThirdParty: true,
36
+ prohibited: ['collectionAddress', 'rarity'],
37
+ errorMessage: 'thirdparty properties conditions are not met'
38
+ }
39
+ ],
40
+ errorMessage: {
41
+ oneOf: 'emote should have either standard or thirdparty properties'
42
+ }
43
+ }
44
+ ],
45
+ errorMessage: {
46
+ oneOf: 'emote should have "emoteDataADR74" and match its schema'
47
+ }
48
+ };
49
+ const _isThirdPartyKeywordDef = {
50
+ keyword: '_isThirdParty',
51
+ validate: (schema, data) => !schema || (0, __1.isThirdParty)(data),
52
+ errors: false
53
+ };
54
+ Emote.validate = (0, validation_1.generateValidator)(Emote.schema, [_isThirdPartyKeywordDef]);
55
+ })(Emote = exports.Emote || (exports.Emote = {}));
56
+ //# sourceMappingURL=emote.js.map
@@ -0,0 +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,4CAA4C;qBAC3D;oBACD;wBACE,QAAQ,EAAE,CAAC,aAAa,EAAE,SAAS,CAAC;wBACpC,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,EA7CgB,KAAK,GAAL,aAAK,KAAL,aAAK,QA6CrB"}
@@ -0,0 +1,5 @@
1
+ export { Emote } from './emote';
2
+ export { EmoteRepresentationADR74 } from './adr74/representation-adr74';
3
+ export { EmoteDataADR74 } from './adr74/emote-data-adr74';
4
+ export { EmoteCategory } from './emote-category';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/platform/item/emote/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAA;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EmoteCategory = exports.EmoteDataADR74 = exports.EmoteRepresentationADR74 = exports.Emote = void 0;
4
+ var emote_1 = require("./emote");
5
+ Object.defineProperty(exports, "Emote", { enumerable: true, get: function () { return emote_1.Emote; } });
6
+ var representation_adr74_1 = require("./adr74/representation-adr74");
7
+ Object.defineProperty(exports, "EmoteRepresentationADR74", { enumerable: true, get: function () { return representation_adr74_1.EmoteRepresentationADR74; } });
8
+ var emote_data_adr74_1 = require("./adr74/emote-data-adr74");
9
+ Object.defineProperty(exports, "EmoteDataADR74", { enumerable: true, get: function () { return emote_data_adr74_1.EmoteDataADR74; } });
10
+ var emote_category_1 = require("./emote-category");
11
+ Object.defineProperty(exports, "EmoteCategory", { enumerable: true, get: function () { return emote_category_1.EmoteCategory; } });
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/item/emote/index.ts"],"names":[],"mappings":";;;AAAA,iCAA+B;AAAtB,8FAAA,KAAK,OAAA;AACd,qEAAuE;AAA9D,gIAAA,wBAAwB,OAAA;AACjC,6DAAyD;AAAhD,kHAAA,cAAc,OAAA;AACvB,mDAAgD;AAAvC,+GAAA,aAAa,OAAA"}
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../src/platform/item/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,gBAAgB,EACjB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,aAAa;AACb,oBAAY,IAAI,GAAG;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED,aAAa;AACb,yBAAiB,IAAI,CAAC;IACb,MAAM,MAAM,EAAE,UAAU,CAAC,IAAI,CAUnC,CAAA;IAEM,MAAM,QAAQ,EAAE,gBAAgB,CAAC,IAAI,CAA6B,CAAA;CAC1E"}
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../../src/platform/item/i18n.ts"],"names":[],"mappings":";;;AAAA,iDAIyB;AACzB,qCAAiC;AAQjC,aAAa;AACb,IAAiB,IAAI,CAcpB;AAdD,WAAiB,IAAI;IACN,WAAM,GAAqB;QACtC,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,IAAI,EAAE,eAAM,CAAC,MAAM;YACnB,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;aACf;SACF;QACD,oBAAoB,EAAE,IAAI;QAC1B,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;KAC3B,CAAA;IAEY,aAAQ,GAA2B,IAAA,8BAAiB,EAAC,KAAA,MAAM,CAAC,CAAA;AAC3E,CAAC,EAdgB,IAAI,GAAJ,YAAI,KAAJ,YAAI,QAcpB"}
@@ -0,0 +1,9 @@
1
+ export { I18N } from './i18n';
2
+ export { Locale } from './locale';
3
+ export { Metrics } from './metrics';
4
+ export { BodyShape } from './body-shape';
5
+ export { StandardProps, isStandard } from './standard-props';
6
+ export { ThirdPartyProps, isThirdParty } from './third-party-props';
7
+ export * from './wearable';
8
+ export * from './emote';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/platform/item/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,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC5D,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AACnE,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA"}
@@ -0,0 +1,32 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.isThirdParty = exports.isStandard = exports.BodyShape = exports.Metrics = exports.Locale = exports.I18N = void 0;
18
+ var i18n_1 = require("./i18n");
19
+ Object.defineProperty(exports, "I18N", { enumerable: true, get: function () { return i18n_1.I18N; } });
20
+ var locale_1 = require("./locale");
21
+ Object.defineProperty(exports, "Locale", { enumerable: true, get: function () { return locale_1.Locale; } });
22
+ var metrics_1 = require("./metrics");
23
+ Object.defineProperty(exports, "Metrics", { enumerable: true, get: function () { return metrics_1.Metrics; } });
24
+ var body_shape_1 = require("./body-shape");
25
+ Object.defineProperty(exports, "BodyShape", { enumerable: true, get: function () { return body_shape_1.BodyShape; } });
26
+ var standard_props_1 = require("./standard-props");
27
+ Object.defineProperty(exports, "isStandard", { enumerable: true, get: function () { return standard_props_1.isStandard; } });
28
+ var third_party_props_1 = require("./third-party-props");
29
+ Object.defineProperty(exports, "isThirdParty", { enumerable: true, get: function () { return third_party_props_1.isThirdParty; } });
30
+ __exportStar(require("./wearable"), exports);
31
+ __exportStar(require("./emote"), exports);
32
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platform/item/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,+BAA6B;AAApB,4FAAA,IAAI,OAAA;AACb,mCAAiC;AAAxB,gGAAA,MAAM,OAAA;AACf,qCAAmC;AAA1B,kGAAA,OAAO,OAAA;AAChB,2CAAwC;AAA/B,uGAAA,SAAS,OAAA;AAClB,mDAA4D;AAApC,4GAAA,UAAU,OAAA;AAClC,yDAAmE;AAAzC,iHAAA,YAAY,OAAA;AACtC,6CAA0B;AAC1B,0CAAuB"}
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locale.d.ts","sourceRoot":"","sources":["../../../src/platform/item/locale.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,gBAAgB,EACjB,MAAM,kBAAkB,CAAA;AAEzB,aAAa;AACb,oBAAY,MAAM;IAChB,EAAE,OAAO;IACT,EAAE,OAAO;CACV;AAED,aAAa;AACb,yBAAiB,MAAM,CAAC;IACf,MAAM,MAAM,EAAE,UAAU,CAAC,MAAM,CAGrC,CAAA;IAEM,MAAM,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CAA6B,CAAA;CAC5E"}
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locale.js","sourceRoot":"","sources":["../../../src/platform/item/locale.ts"],"names":[],"mappings":";;;AAAA,iDAIyB;AAEzB,aAAa;AACb,IAAY,MAGX;AAHD,WAAY,MAAM;IAChB,mBAAS,CAAA;IACT,mBAAS,CAAA;AACX,CAAC,EAHW,MAAM,GAAN,cAAM,KAAN,cAAM,QAGjB;AAED,aAAa;AACb,WAAiB,MAAM;IACR,aAAM,GAAuB;QACxC,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;KAC5B,CAAA;IAEY,eAAQ,GAA6B,IAAA,8BAAiB,EAAC,OAAA,MAAM,CAAC,CAAA;AAC7E,CAAC,EAPgB,MAAM,GAAN,cAAM,KAAN,cAAM,QAOtB"}
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../../../src/platform/item/metrics.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,gBAAgB,EACjB,MAAM,kBAAkB,CAAA;AAEzB,aAAa;AACb,oBAAY,OAAO,GAAG;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,aAAa;AACb,yBAAiB,OAAO,CAAC;IAChB,MAAM,MAAM,EAAE,UAAU,CAAC,OAAO,CA8BtC,CAAA;IAEM,MAAM,QAAQ,EAAE,gBAAgB,CAAC,OAAO,CAA6B,CAAA;CAC7E"}
File without changes
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../../src/platform/item/metrics.ts"],"names":[],"mappings":";;;AAAA,iDAIyB;AAYzB,aAAa;AACb,IAAiB,OAAO,CAkCvB;AAlCD,WAAiB,OAAO;IACT,cAAM,GAAwB;QACzC,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;aACf;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;aACf;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;aACf;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;aACf;YACD,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;aACf;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;aACf;SACF;QACD,QAAQ,EAAE;YACR,WAAW;YACX,WAAW;YACX,UAAU;YACV,QAAQ;YACR,QAAQ;YACR,UAAU;SACX;KACF,CAAA;IAEY,gBAAQ,GAA8B,IAAA,8BAAiB,EAAC,QAAA,MAAM,CAAC,CAAA;AAC9E,CAAC,EAlCgB,OAAO,GAAP,eAAO,KAAP,eAAO,QAkCvB"}
@@ -0,0 +1,16 @@
1
+ import { Rarity } from '../../dapps/rarity';
2
+ import { BaseItem } from './base-item';
3
+ import { JSONSchema } from '../../validation';
4
+ export declare type StandardProps = {
5
+ collectionAddress: string;
6
+ rarity: Rarity;
7
+ };
8
+ export declare const standardProperties: {
9
+ readonly collectionAddress: {
10
+ readonly type: "string";
11
+ readonly nullable: false;
12
+ };
13
+ readonly rarity: JSONSchema<Rarity>;
14
+ };
15
+ export declare function isStandard<T extends BaseItem>(item: T): item is T & StandardProps;
16
+ //# sourceMappingURL=standard-props.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standard-props.d.ts","sourceRoot":"","sources":["../../../src/platform/item/standard-props.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAGL,UAAU,EACX,MAAM,kBAAkB,CAAA;AAEzB,oBAAY,aAAa,GAAG;IAC1B,iBAAiB,EAAE,MAAM,CAAA;IACzB,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,eAAO,MAAM,kBAAkB;;;;;;CAMrB,CAAA;AAYV,wBAAgB,UAAU,CAAC,CAAC,SAAS,QAAQ,EAC3C,IAAI,EAAE,CAAC,GACN,IAAI,IAAI,CAAC,GAAG,aAAa,CAE3B"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isStandard = exports.standardProperties = void 0;
4
+ const rarity_1 = require("../../dapps/rarity");
5
+ const validation_1 = require("../../validation");
6
+ exports.standardProperties = {
7
+ collectionAddress: {
8
+ type: 'string',
9
+ nullable: false
10
+ },
11
+ rarity: rarity_1.Rarity.schema
12
+ };
13
+ const schema = {
14
+ type: 'object',
15
+ properties: {
16
+ ...exports.standardProperties
17
+ },
18
+ required: ['collectionAddress', 'rarity']
19
+ };
20
+ const validate = (0, validation_1.generateValidator)(schema);
21
+ function isStandard(item) {
22
+ return validate(item);
23
+ }
24
+ exports.isStandard = isStandard;
25
+ //# sourceMappingURL=standard-props.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"standard-props.js","sourceRoot":"","sources":["../../../src/platform/item/standard-props.ts"],"names":[],"mappings":";;;AAAA,+CAA2C;AAE3C,iDAIyB;AAOZ,QAAA,kBAAkB,GAAG;IAChC,iBAAiB,EAAE;QACjB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,KAAK;KAChB;IACD,MAAM,EAAE,eAAM,CAAC,MAAM;CACb,CAAA;AAEV,MAAM,MAAM,GAA8B;IACxC,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,GAAG,0BAAkB;KACtB;IACD,QAAQ,EAAE,CAAC,mBAAmB,EAAE,QAAQ,CAAC;CAC1C,CAAA;AAED,MAAM,QAAQ,GAAoC,IAAA,8BAAiB,EAAC,MAAM,CAAC,CAAA;AAE3E,SAAgB,UAAU,CACxB,IAAO;IAEP,OAAO,QAAQ,CAAC,IAAI,CAAC,CAAA;AACvB,CAAC;AAJD,gCAIC"}
@@ -0,0 +1,20 @@
1
+ import { JSONSchema } from '../../validation';
2
+ import { MerkleProof } from '../merkle-tree/merkle-proof';
3
+ import { BaseItem } from './base-item';
4
+ export declare type ThirdPartyProps = {
5
+ merkleProof: MerkleProof;
6
+ content: Record<string, string>;
7
+ };
8
+ export declare const thirdPartyProps: {
9
+ readonly merkleProof: JSONSchema<MerkleProof>;
10
+ readonly content: {
11
+ readonly type: "object";
12
+ readonly nullable: false;
13
+ readonly additionalProperties: {
14
+ readonly type: "string";
15
+ };
16
+ readonly required: any[];
17
+ };
18
+ };
19
+ export declare function isThirdParty<T extends BaseItem>(item: T): item is T & ThirdPartyProps;
20
+ //# sourceMappingURL=third-party-props.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isThirdParty = exports.thirdPartyProps = void 0;
4
+ const validation_1 = require("../../validation");
5
+ const merkle_proof_1 = require("../merkle-tree/merkle-proof");
6
+ exports.thirdPartyProps = {
7
+ merkleProof: merkle_proof_1.MerkleProof.schema,
8
+ content: {
9
+ type: 'object',
10
+ nullable: false,
11
+ additionalProperties: { type: 'string' },
12
+ required: []
13
+ }
14
+ };
15
+ const schema = {
16
+ type: 'object',
17
+ properties: {
18
+ ...exports.thirdPartyProps
19
+ },
20
+ required: ['merkleProof', 'content']
21
+ };
22
+ const validate = (0, validation_1.generateValidator)(schema);
23
+ 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;
31
+ }
32
+ exports.isThirdParty = isThirdParty;
33
+ //# sourceMappingURL=third-party-props.js.map
@@ -0,0 +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"}
@@ -0,0 +1,3 @@
1
+ export { WearableRepresentation } from './representation';
2
+ export { Wearable } from './wearable';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/platform/item/wearable/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Wearable = exports.WearableRepresentation = void 0;
4
+ var representation_1 = require("./representation");
5
+ Object.defineProperty(exports, "WearableRepresentation", { enumerable: true, get: function () { return representation_1.WearableRepresentation; } });
6
+ var wearable_1 = require("./wearable");
7
+ Object.defineProperty(exports, "Wearable", { enumerable: true, get: function () { return wearable_1.Wearable; } });
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/platform/item/wearable/index.ts"],"names":[],"mappings":";;;AAAA,mDAAyD;AAAhD,wHAAA,sBAAsB,OAAA;AAC/B,uCAAqC;AAA5B,oGAAA,QAAQ,OAAA"}
@@ -1,9 +1,9 @@
1
- import { WearableCategory } from '../../dapps/wearable-category';
2
- import { JSONSchema, ValidateFunction } from '../../validation';
3
- import { WearableBodyShape } from './wearable-body-shape';
1
+ import { WearableCategory } from '../../../dapps/wearable-category';
2
+ import { JSONSchema, ValidateFunction } from '../../../validation';
3
+ import { BodyShape } from '../body-shape';
4
4
  /** @alpha */
5
5
  export declare type WearableRepresentation = {
6
- bodyShapes: WearableBodyShape[];
6
+ bodyShapes: BodyShape[];
7
7
  mainFile: string;
8
8
  contents: string[];
9
9
  overrideHides: WearableCategory[];
@@ -0,0 +1 @@
1
+ {"version":3,"file":"representation.d.ts","sourceRoot":"","sources":["../../../../src/platform/item/wearable/representation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AACnE,OAAO,EAEL,UAAU,EACV,gBAAgB,EACjB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAEzC,aAAa;AACb,oBAAY,sBAAsB,GAAG;IACnC,UAAU,EAAE,SAAS,EAAE,CAAA;IACvB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,aAAa,EAAE,gBAAgB,EAAE,CAAA;IACjC,gBAAgB,EAAE,gBAAgB,EAAE,CAAA;CACrC,CAAA;AAED,aAAa;AACb,yBAAiB,sBAAsB,CAAC;IAC/B,MAAM,MAAM,EAAE,UAAU,CAAC,sBAAsB,CAwCrD,CAAA;IAEM,MAAM,QAAQ,EAAE,gBAAgB,CAAC,sBAAsB,CACnC,CAAA;CAC5B"}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.WearableRepresentation = void 0;
4
- const wearable_category_1 = require("../../dapps/wearable-category");
5
- const validation_1 = require("../../validation");
6
- const wearable_body_shape_1 = require("./wearable-body-shape");
4
+ const wearable_category_1 = require("../../../dapps/wearable-category");
5
+ const validation_1 = require("../../../validation");
6
+ const body_shape_1 = require("../body-shape");
7
7
  /** @alpha */
8
8
  var WearableRepresentation;
9
9
  (function (WearableRepresentation) {
@@ -12,7 +12,7 @@ var WearableRepresentation;
12
12
  properties: {
13
13
  bodyShapes: {
14
14
  type: 'array',
15
- items: wearable_body_shape_1.WearableBodyShape.schema,
15
+ items: body_shape_1.BodyShape.schema,
16
16
  minItems: 1,
17
17
  uniqueItems: true
18
18
  },
@@ -26,7 +26,10 @@ var WearableRepresentation;
26
26
  type: 'string'
27
27
  },
28
28
  minItems: 1,
29
- uniqueItems: true
29
+ uniqueItems: true,
30
+ contains: {
31
+ const: { $data: '2/mainFile' }
32
+ }
30
33
  },
31
34
  overrideHides: {
32
35
  type: 'array',
@@ -45,8 +48,6 @@ var WearableRepresentation;
45
48
  'overrideReplaces'
46
49
  ]
47
50
  };
48
- const schemaValidator = (0, validation_1.generateValidator)(WearableRepresentation.schema);
49
- WearableRepresentation.validate = (representation) => schemaValidator(representation) &&
50
- representation.contents.includes(representation.mainFile);
51
+ WearableRepresentation.validate = (0, validation_1.generateValidator)(WearableRepresentation.schema);
51
52
  })(WearableRepresentation = exports.WearableRepresentation || (exports.WearableRepresentation = {}));
52
53
  //# sourceMappingURL=representation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"representation.js","sourceRoot":"","sources":["../../../../src/platform/item/wearable/representation.ts"],"names":[],"mappings":";;;AAAA,wEAAmE;AACnE,oDAI4B;AAC5B,8CAAyC;AAWzC,aAAa;AACb,IAAiB,sBAAsB,CA6CtC;AA7CD,WAAiB,sBAAsB;IACxB,6BAAM,GAAuC;QACxD,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,UAAU,EAAE;gBACV,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,sBAAS,CAAC,MAAM;gBACvB,QAAQ,EAAE,CAAC;gBACX,WAAW,EAAE,IAAI;aAClB;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,SAAS,EAAE,CAAC;aACb;YACD,QAAQ,EAAE;gBACR,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;iBACf;gBACD,QAAQ,EAAE,CAAC;gBACX,WAAW,EAAE,IAAI;gBACjB,QAAQ,EAAE;oBACR,KAAK,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE;iBAC/B;aACF;YACD,aAAa,EAAE;gBACb,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,oCAAgB,CAAC,MAAM;aAC/B;YACD,gBAAgB,EAAE;gBAChB,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,oCAAgB,CAAC,MAAM;aAC/B;SACF;QACD,QAAQ,EAAE;YACR,YAAY;YACZ,UAAU;YACV,UAAU;YACV,eAAe;YACf,kBAAkB;SACnB;KACF,CAAA;IAEY,+BAAQ,GACnB,IAAA,8BAAiB,EAAC,uBAAA,MAAM,CAAC,CAAA;AAC7B,CAAC,EA7CgB,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QA6CtC"}
@@ -0,0 +1,32 @@
1
+ import { JSONSchema } from '../../../validation';
2
+ import { WearableCategory } from '../../../dapps/wearable-category';
3
+ import { WearableRepresentation } from './representation';
4
+ import { BaseItem } from '../base-item';
5
+ import { StandardProps } from '../standard-props';
6
+ import { ThirdPartyProps } from '../third-party-props';
7
+ /** @alpha */
8
+ export declare type Wearable = BaseItem & {
9
+ data: {
10
+ replaces: WearableCategory[];
11
+ hides: WearableCategory[];
12
+ tags: string[];
13
+ representations: WearableRepresentation[];
14
+ category: WearableCategory;
15
+ };
16
+ } & (StandardProps | ThirdPartyProps);
17
+ /** @alpha */
18
+ export declare namespace Wearable {
19
+ const schema: JSONSchema<Wearable>;
20
+ /**
21
+ * Validates that the wearable metadata complies with the standard or third party wearable, and doesn't have repeated locales.
22
+ * Some fields are defined as optional but those are validated to be present as standard XOR third party:
23
+ * Standard Wearables should contain:
24
+ * - collectionAddress
25
+ * - rarity
26
+ * Third Party Wearables should contain:
27
+ * - merkleProof
28
+ * - content
29
+ */
30
+ const validate: import("../../../validation").ValidateFunction<Wearable>;
31
+ }
32
+ //# sourceMappingURL=wearable.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Wearable = void 0;
4
+ const validation_1 = require("../../../validation");
5
+ const wearable_category_1 = require("../../../dapps/wearable-category");
6
+ const representation_1 = require("./representation");
7
+ const base_item_1 = require("../base-item");
8
+ const standard_props_1 = require("../standard-props");
9
+ const third_party_props_1 = require("../third-party-props");
10
+ /** @alpha */
11
+ var Wearable;
12
+ (function (Wearable) {
13
+ Wearable.schema = {
14
+ type: 'object',
15
+ properties: {
16
+ ...base_item_1.baseItemProperties,
17
+ ...standard_props_1.standardProperties,
18
+ ...third_party_props_1.thirdPartyProps,
19
+ data: {
20
+ type: 'object',
21
+ properties: {
22
+ replaces: {
23
+ type: 'array',
24
+ items: wearable_category_1.WearableCategory.schema
25
+ },
26
+ hides: {
27
+ type: 'array',
28
+ items: wearable_category_1.WearableCategory.schema
29
+ },
30
+ tags: {
31
+ type: 'array',
32
+ items: {
33
+ type: 'string',
34
+ minLength: 1
35
+ }
36
+ },
37
+ representations: {
38
+ type: 'array',
39
+ items: representation_1.WearableRepresentation.schema,
40
+ minItems: 1
41
+ },
42
+ category: wearable_category_1.WearableCategory.schema
43
+ },
44
+ required: ['replaces', 'hides', 'tags', 'representations', 'category']
45
+ }
46
+ },
47
+ additionalProperties: true,
48
+ required: [...base_item_1.requiredBaseItemProps, 'data'],
49
+ oneOf: [
50
+ {
51
+ required: ['collectionAddress', 'rarity'],
52
+ prohibited: ['merkleProof', 'content'],
53
+ errorMessage: 'for standard wearables "merkleProof" and "content" are not allowed'
54
+ },
55
+ {
56
+ required: ['merkleProof', 'content'],
57
+ _isThirdParty: true,
58
+ prohibited: ['collectionAddress', 'rarity'],
59
+ errorMessage: 'for third party wearables "collectionAddress" and "rarity" are not allowed'
60
+ }
61
+ ]
62
+ };
63
+ const _isThirdPartyKeywordDef = {
64
+ keyword: '_isThirdParty',
65
+ validate: (schema, data) => !schema || (0, third_party_props_1.isThirdParty)(data),
66
+ errors: false
67
+ };
68
+ /**
69
+ * Validates that the wearable metadata complies with the standard or third party wearable, and doesn't have repeated locales.
70
+ * Some fields are defined as optional but those are validated to be present as standard XOR third party:
71
+ * Standard Wearables should contain:
72
+ * - collectionAddress
73
+ * - rarity
74
+ * Third Party Wearables should contain:
75
+ * - merkleProof
76
+ * - content
77
+ */
78
+ Wearable.validate = (0, validation_1.generateValidator)(Wearable.schema, [_isThirdPartyKeywordDef]);
79
+ })(Wearable = exports.Wearable || (exports.Wearable = {}));
80
+ //# sourceMappingURL=wearable.js.map
@@ -0,0 +1 @@
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,CAuExB;AAvED,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;gBACtC,YAAY,EACV,oEAAoE;aACvE;YACD;gBACE,QAAQ,EAAE,CAAC,aAAa,EAAE,SAAS,CAAC;gBACpC,aAAa,EAAE,IAAI;gBACnB,UAAU,EAAE,CAAC,mBAAmB,EAAE,QAAQ,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 +1 @@
1
- {"version":3,"file":"merkle-proof.d.ts","sourceRoot":"","sources":["../../../src/platform/merkle-tree/merkle-proof.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,gBAAgB,EACjB,MAAM,kBAAkB,CAAA;AAEzB;;;GAGG;AACH,oBAAY,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAED;;;GAGG;AACH,yBAAiB,WAAW,CAAC;IACpB,MAAM,MAAM,EAAE,UAAU,CAAC,WAAW,CAwB1C,CAAA;IAEM,MAAM,QAAQ,EAAE,gBAAgB,CAAC,WAAW,CACxB,CAAA;CAC5B"}
1
+ {"version":3,"file":"merkle-proof.d.ts","sourceRoot":"","sources":["../../../src/platform/merkle-tree/merkle-proof.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,gBAAgB,EACjB,MAAM,kBAAkB,CAAA;AAEzB;;;GAGG;AACH,oBAAY,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAED;;;GAGG;AACH,yBAAiB,WAAW,CAAC;IACpB,MAAM,MAAM,EAAE,UAAU,CAAC,WAAW,CAyB1C,CAAA;IAEM,MAAM,QAAQ,EAAE,gBAAgB,CAAC,WAAW,CACxB,CAAA;CAC5B"}
@@ -15,7 +15,8 @@ var MerkleProof;
15
15
  type: 'array',
16
16
  items: {
17
17
  type: 'string'
18
- }
18
+ },
19
+ minItems: 1
19
20
  },
20
21
  index: {
21
22
  type: 'number'
@@ -1 +1 @@
1
- {"version":3,"file":"merkle-proof.js","sourceRoot":"","sources":["../../../src/platform/merkle-tree/merkle-proof.ts"],"names":[],"mappings":";;;AAAA,iDAIyB;AAazB;;;GAGG;AACH,IAAiB,WAAW,CA6B3B;AA7BD,WAAiB,WAAW;IACb,kBAAM,GAA4B;QAC7C,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;iBACf;aACF;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;aACf;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;iBACf;aACF;YACD,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;aACf;SACF;QACD,QAAQ,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,CAAC;QACzD,oBAAoB,EAAE,IAAI;KAC3B,CAAA;IAEY,oBAAQ,GACnB,IAAA,8BAAiB,EAAC,YAAA,MAAM,CAAC,CAAA;AAC7B,CAAC,EA7BgB,WAAW,GAAX,mBAAW,KAAX,mBAAW,QA6B3B"}
1
+ {"version":3,"file":"merkle-proof.js","sourceRoot":"","sources":["../../../src/platform/merkle-tree/merkle-proof.ts"],"names":[],"mappings":";;;AAAA,iDAIyB;AAazB;;;GAGG;AACH,IAAiB,WAAW,CA8B3B;AA9BD,WAAiB,WAAW;IACb,kBAAM,GAA4B;QAC7C,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,KAAK,EAAE;gBACL,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;iBACf;gBACD,QAAQ,EAAE,CAAC;aACZ;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;aACf;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;iBACf;aACF;YACD,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;aACf;SACF;QACD,QAAQ,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,CAAC;QACzD,oBAAoB,EAAE,IAAI;KAC3B,CAAA;IAEY,oBAAQ,GACnB,IAAA,8BAAiB,EAAC,YAAA,MAAM,CAAC,CAAA;AAC7B,CAAC,EA9BgB,WAAW,GAAX,mBAAW,KAAX,mBAAW,QA8B3B"}