@dcl/schemas 4.14.1 → 4.14.2-20220608182026.commit-46a9277

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
package/dist/schemas.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import Ajv from 'ajv';
2
2
  import { ErrorObject } from 'ajv';
3
3
  import { JSONSchemaType } from 'ajv';
4
+ import { KeywordDefinition } from 'ajv';
4
5
 
5
6
  /**
6
7
  * Common structure to use types as values in TS.
@@ -207,6 +208,21 @@ export declare namespace AvatarInfo {
207
208
  const validate: ValidateFunction<AvatarInfo>;
208
209
  }
209
210
 
211
+ /**
212
+ * @public
213
+ *
214
+ * Describes common properties to an item of a collection.
215
+ */
216
+ declare type BaseItem = DisplayableDeployment & {
217
+ id: string;
218
+ name: string;
219
+ description: string;
220
+ i18n: I18N[];
221
+ thumbnail: string;
222
+ image: string;
223
+ metrics?: Metrics;
224
+ };
225
+
210
226
  export declare type Bid = {
211
227
  id: string;
212
228
  bidAddress: string;
@@ -260,6 +276,18 @@ export declare namespace BodyShape {
260
276
  const validate: ValidateFunction<BodyShape>;
261
277
  }
262
278
 
279
+ /** @alpha */
280
+ declare enum BodyShape_2 {
281
+ MALE = "urn:decentraland:off-chain:base-avatars:BaseMale",
282
+ FEMALE = "urn:decentraland:off-chain:base-avatars:BaseFemale"
283
+ }
284
+
285
+ /** @alpha */
286
+ declare namespace BodyShape_2 {
287
+ const schema: JSONSchema<BodyShape_2>;
288
+ const validate: ValidateFunction<BodyShape_2>;
289
+ }
290
+
263
291
  /**
264
292
  * Different supported chain ids
265
293
  * @alpha
@@ -437,6 +465,19 @@ export declare type DisplayableDeployment = {
437
465
  menuBarIcon?: string;
438
466
  };
439
467
 
468
+ /** @alpha */
469
+ export declare type Emote = EmoteADR74;
470
+
471
+ /** @alpha */
472
+ export declare namespace Emote {
473
+ const schema: JSONSchema<Emote>;
474
+ const validate: ValidateFunction<EmoteADR74>;
475
+ }
476
+
477
+ declare type EmoteADR74 = BaseItem & (StandardProps | ThirdPartyProps) & {
478
+ emoteDataADR74: EmoteDataADR74;
479
+ };
480
+
440
481
  export declare enum EmoteCategory {
441
482
  SIMPLE = "simple",
442
483
  LOOP = "loop"
@@ -447,6 +488,30 @@ export declare namespace EmoteCategory {
447
488
  const validate: ValidateFunction<EmoteCategory>;
448
489
  }
449
490
 
491
+ export declare type EmoteDataADR74 = {
492
+ category: EmoteCategory;
493
+ representations: EmoteRepresentationADR74[];
494
+ tags: string[];
495
+ };
496
+
497
+ export declare namespace EmoteDataADR74 {
498
+ const schema: JSONSchema<EmoteDataADR74>;
499
+ const validate: ValidateFunction<EmoteDataADR74>;
500
+ }
501
+
502
+ /** @alpha */
503
+ export declare type EmoteRepresentationADR74 = {
504
+ bodyShapes: BodyShape_2[];
505
+ mainFile: string;
506
+ contents: string[];
507
+ };
508
+
509
+ /** @alpha */
510
+ export declare namespace EmoteRepresentationADR74 {
511
+ const schema: JSONSchema<EmoteRepresentationADR74>;
512
+ const validate: ValidateFunction<EmoteRepresentationADR74>;
513
+ }
514
+
450
515
  /**
451
516
  * Internal representation of an entity in the catalyst.
452
517
  *
@@ -479,7 +544,8 @@ export declare enum EntityType {
479
544
  SCENE = "scene",
480
545
  PROFILE = "profile",
481
546
  WEARABLE = "wearable",
482
- STORE = "store"
547
+ STORE = "store",
548
+ EMOTE = "emote"
483
549
  }
484
550
 
485
551
  /**
@@ -510,7 +576,7 @@ export declare namespace FeatureToggles {
510
576
  * Generates a validator for a specific JSON schema of a type T
511
577
  * @public
512
578
  */
513
- export declare function generateValidator<T>(schema: JSONSchema<T>): ValidateFunction<T>;
579
+ export declare function generateValidator<T>(schema: JSONSchema<T>, keywordDefinitions?: KeywordDefinition[]): ValidateFunction<T>;
514
580
 
515
581
  /**
516
582
  * Get chain id by chain name
@@ -583,6 +649,10 @@ export declare namespace IPFSv2 {
583
649
  */
584
650
  export declare function isInsideWorldLimits(x: number, y: number): boolean;
585
651
 
652
+ export declare function isStandard<T extends BaseItem>(item: T): item is T & StandardProps;
653
+
654
+ export declare function isThirdParty<T extends BaseItem>(item: T): item is T & ThirdPartyProps;
655
+
586
656
  export declare type Item = {
587
657
  id: string;
588
658
  name: string;
@@ -946,7 +1016,7 @@ export declare namespace PreviewCamera {
946
1016
  export declare type PreviewConfig = {
947
1017
  wearable?: WearableDefinition;
948
1018
  wearables: WearableDefinition[];
949
- bodyShape: WearableBodyShape;
1019
+ bodyShape: BodyShape_2;
950
1020
  skin: string;
951
1021
  hair: string;
952
1022
  eyes: string;
@@ -1026,7 +1096,7 @@ export declare type PreviewOptions = {
1026
1096
  tokenId?: string | null;
1027
1097
  itemId?: string | null;
1028
1098
  profile?: string | null;
1029
- bodyShape?: WearableBodyShape | null;
1099
+ bodyShape?: BodyShape_2 | null;
1030
1100
  skin?: string | null;
1031
1101
  hair?: string | null;
1032
1102
  eyes?: string | null;
@@ -1331,8 +1401,10 @@ export declare namespace SpawnPoint {
1331
1401
  const validate: ValidateFunction<SpawnPoint>;
1332
1402
  }
1333
1403
 
1334
- /** @alpha */
1335
- export declare type StandardWearable = Omit<WithRequired<Wearable, 'collectionAddress' | 'rarity'>, 'merkleProof' | 'content'>;
1404
+ export declare type StandardProps = {
1405
+ collectionAddress: string;
1406
+ rarity: Rarity;
1407
+ };
1336
1408
 
1337
1409
  export declare type Store = {
1338
1410
  id: string;
@@ -1354,7 +1426,10 @@ export declare namespace Store {
1354
1426
  const validate: ValidateFunction<Store>;
1355
1427
  }
1356
1428
 
1357
- export declare type ThirdPartyWearable = Omit<WithRequired<Wearable, 'merkleProof'>, 'rarity' | 'collectionAddress'>;
1429
+ export declare type ThirdPartyProps = {
1430
+ merkleProof: MerkleProof;
1431
+ content: Record<string, string>;
1432
+ };
1358
1433
 
1359
1434
  /** @public @deprecated */
1360
1435
  declare const UPDATE = "update";
@@ -1399,10 +1474,7 @@ export declare type ValidWorldRange = {
1399
1474
  };
1400
1475
 
1401
1476
  /** @alpha */
1402
- export declare type Wearable = DisplayableDeployment & {
1403
- id: string;
1404
- name: string;
1405
- description: string;
1477
+ export declare type Wearable = BaseItem & {
1406
1478
  data: {
1407
1479
  replaces: WearableCategory[];
1408
1480
  hides: WearableCategory[];
@@ -1410,15 +1482,7 @@ export declare type Wearable = DisplayableDeployment & {
1410
1482
  representations: WearableRepresentation[];
1411
1483
  category: WearableCategory;
1412
1484
  };
1413
- i18n: I18N[];
1414
- thumbnail: string;
1415
- image: string;
1416
- rarity?: Rarity;
1417
- collectionAddress?: string;
1418
- metrics?: Metrics;
1419
- content?: Record<string, string>;
1420
- merkleProof?: MerkleProof;
1421
- };
1485
+ } & (StandardProps | ThirdPartyProps);
1422
1486
 
1423
1487
  /** @alpha */
1424
1488
  export declare namespace Wearable {
@@ -1436,18 +1500,6 @@ export declare namespace Wearable {
1436
1500
  const validate: ValidateFunction<Wearable>;
1437
1501
  }
1438
1502
 
1439
- /** @alpha */
1440
- export declare enum WearableBodyShape {
1441
- MALE = "urn:decentraland:off-chain:base-avatars:BaseMale",
1442
- FEMALE = "urn:decentraland:off-chain:base-avatars:BaseFemale"
1443
- }
1444
-
1445
- /** @alpha */
1446
- export declare namespace WearableBodyShape {
1447
- const schema: JSONSchema<WearableBodyShape>;
1448
- const validate: ValidateFunction<WearableBodyShape>;
1449
- }
1450
-
1451
1503
  export declare enum WearableCategory {
1452
1504
  EYEBROWS = "eyebrows",
1453
1505
  EYES = "eyes",
@@ -1501,7 +1553,7 @@ export declare type WearableId = string;
1501
1553
 
1502
1554
  /** @alpha */
1503
1555
  export declare type WearableRepresentation = {
1504
- bodyShapes: WearableBodyShape[];
1556
+ bodyShapes: BodyShape_2[];
1505
1557
  mainFile: string;
1506
1558
  contents: string[];
1507
1559
  overrideHides: WearableCategory[];
@@ -1514,10 +1566,6 @@ export declare namespace WearableRepresentation {
1514
1566
  const validate: ValidateFunction<WearableRepresentation>;
1515
1567
  }
1516
1568
 
1517
- export declare type WithRequired<T, K extends keyof T> = T & {
1518
- [P in K]-?: T[P];
1519
- };
1520
-
1521
1569
  /**
1522
1570
  * World
1523
1571
  * @alpha
@@ -1,4 +1,4 @@
1
- import Ajv, { ErrorObject, JSONSchemaType } from 'ajv';
1
+ import Ajv, { ErrorObject, JSONSchemaType, KeywordDefinition } from 'ajv';
2
2
  export { Ajv };
3
3
  /**
4
4
  * This type is a subset of AJV's ValidateFunction, it exists to make
@@ -27,7 +27,7 @@ export declare type AbstractTypedSchema<T> = {
27
27
  * Generates a validator for a specific JSON schema of a type T
28
28
  * @public
29
29
  */
30
- export declare function generateValidator<T>(schema: JSONSchema<T>): ValidateFunction<T>;
30
+ export declare function generateValidator<T>(schema: JSONSchema<T>, keywordDefinitions?: KeywordDefinition[]): ValidateFunction<T>;
31
31
  /**
32
32
  * Validates a type with a schema in a functional way.
33
33
  * @public
@@ -1 +1 @@
1
- {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,EAAE,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AAItD,OAAO,EAAE,GAAG,EAAE,CAAA;AAEd;;;;;GA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AC,IAAI,cAAc,CAAC,CAAC,CAAC,CAAA;AAE7C;;;GAGG;AACH,oBAAY,mBAAmB,CAAC,CAAC,IAAI;IACnC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,CAAA;IACrB,QAAQ,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAA;CAC9B,CAAA;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,EACrB,kBAAkB,CAAC,EAAE,iBAAiB,EAAE,GACvC,gBAAgB,CAAC,CAAC,CAAC,CAOrB;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,OAAO,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,EACjD,KAAK,EAAE,CAAC,WAGT"}
@@ -12,10 +12,11 @@ const ajv_errors_1 = __importDefault(require("ajv-errors"));
12
12
  * Generates a validator for a specific JSON schema of a type T
13
13
  * @public
14
14
  */
15
- function generateValidator(schema) {
16
- const ajv = new ajv_1.default({ allErrors: true });
15
+ function generateValidator(schema, keywordDefinitions) {
16
+ const ajv = new ajv_1.default({ $data: true, allErrors: true });
17
17
  (0, ajv_keywords_1.default)(ajv);
18
- (0, ajv_errors_1.default)(ajv);
18
+ (0, ajv_errors_1.default)(ajv, { singleError: true });
19
+ keywordDefinitions === null || keywordDefinitions === void 0 ? void 0 : keywordDefinitions.forEach((kw) => ajv.addKeyword(kw));
19
20
  return ajv.compile(schema);
20
21
  }
21
22
  exports.generateValidator = generateValidator;
@@ -1 +1 @@
1
- {"version":3,"file":"validation.js","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAsD;AAI7C,cAJF,aAAG,CAIE;AAHZ,gEAAuC;AACvC,4DAAmC;AA8BnC;;;GAGG;AACH,SAAgB,iBAAiB,CAC/B,MAAqB;IAErB,MAAM,GAAG,GAAG,IAAI,aAAG,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IACxC,IAAA,sBAAY,EAAC,GAAG,CAAC,CAAA;IACjB,IAAA,oBAAU,EAAC,GAAG,CAAC,CAAA;IAEf,OAAO,GAAG,CAAC,OAAO,CAAI,MAAM,CAAC,CAAA;AAC/B,CAAC;AARD,8CAQC;AAED;;;GAGG;AACH,SAAgB,YAAY,CAC1B,OAAiD,EACjD,KAAQ;IAER,OAAO,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;AAChC,CAAC;AALD,oCAKC"}
1
+ {"version":3,"file":"validation.js","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAyE;AAIhE,cAJF,aAAG,CAIE;AAHZ,gEAAuC;AACvC,4DAAmC;AA8BnC;;;GAGG;AACH,SAAgB,iBAAiB,CAC/B,MAAqB,EACrB,kBAAwC;IAExC,MAAM,GAAG,GAAG,IAAI,aAAG,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IACrD,IAAA,sBAAY,EAAC,GAAG,CAAC,CAAA;IACjB,IAAA,oBAAU,EAAC,GAAG,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,CAAA;IACtC,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAA;IAEvD,OAAO,GAAG,CAAC,OAAO,CAAI,MAAM,CAAC,CAAA;AAC/B,CAAC;AAVD,8CAUC;AAED;;;GAGG;AACH,SAAgB,YAAY,CAC1B,OAAiD,EACjD,KAAQ;IAER,OAAO,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;AAChC,CAAC;AALD,oCAKC"}
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.14.1",
2
+ "version": "4.14.2-20220608182026.commit-46a9277",
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": "8983783d08bed185a1439f4bf94501da6c0a5962"
35
+ "commit": "46a9277fa85c477a32a0989fbf333ccb214d6d11"
36
36
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"emote-category.d.ts","sourceRoot":"","sources":["../../src/dapps/emote-category.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,UAAU,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAE/E,oBAAY,aAAa;IACvB,MAAM,WAAW;IACjB,IAAI,SAAS;CACd;AAED,yBAAiB,aAAa,CAAC;IACtB,MAAM,MAAM,EAAE,UAAU,CAAC,aAAa,CAG5C,CAAA;IAEM,MAAM,QAAQ,EAAE,gBAAgB,CAAC,aAAa,CAC1B,CAAA;CAC5B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"emote-category.js","sourceRoot":"","sources":["../../src/dapps/emote-category.ts"],"names":[],"mappings":";;;AAAA,8CAA+E;AAE/E,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,kCAAiB,CAAA;IACjB,8BAAa,CAAA;AACf,CAAC,EAHW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAGxB;AAED,WAAiB,aAAa;IACf,oBAAM,GAA8B;QAC/C,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC;KACnC,CAAA;IAEY,sBAAQ,GACnB,IAAA,8BAAiB,EAAC,cAAA,MAAM,CAAC,CAAA;AAC7B,CAAC,EARgB,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAQ7B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../src/platform/wearables/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"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../../src/platform/wearables/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"}
@@ -1,7 +0,0 @@
1
- export { I18N } from './i18n';
2
- export { Locale } from './locale';
3
- export { Metrics } from './metrics';
4
- export { WearableRepresentation } from './representation';
5
- export { WearableBodyShape } from './wearable-body-shape';
6
- export { Wearable, ThirdPartyWearable, StandardWearable } from './wearable';
7
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
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,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Wearable = exports.WearableBodyShape = exports.WearableRepresentation = exports.Metrics = exports.Locale = exports.I18N = void 0;
4
- var i18n_1 = require("./i18n");
5
- Object.defineProperty(exports, "I18N", { enumerable: true, get: function () { return i18n_1.I18N; } });
6
- var locale_1 = require("./locale");
7
- Object.defineProperty(exports, "Locale", { enumerable: true, get: function () { return locale_1.Locale; } });
8
- var metrics_1 = require("./metrics");
9
- Object.defineProperty(exports, "Metrics", { enumerable: true, get: function () { return metrics_1.Metrics; } });
10
- var representation_1 = require("./representation");
11
- Object.defineProperty(exports, "WearableRepresentation", { enumerable: true, get: function () { return representation_1.WearableRepresentation; } });
12
- var wearable_body_shape_1 = require("./wearable-body-shape");
13
- Object.defineProperty(exports, "WearableBodyShape", { enumerable: true, get: function () { return wearable_body_shape_1.WearableBodyShape; } });
14
- var wearable_1 = require("./wearable");
15
- Object.defineProperty(exports, "Wearable", { enumerable: true, get: function () { return wearable_1.Wearable; } });
16
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
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 +0,0 @@
1
- {"version":3,"file":"locale.d.ts","sourceRoot":"","sources":["../../../src/platform/wearables/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"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"locale.js","sourceRoot":"","sources":["../../../src/platform/wearables/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"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../../../src/platform/wearables/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"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../../src/platform/wearables/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"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"representation.d.ts","sourceRoot":"","sources":["../../../src/platform/wearables/representation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAChE,OAAO,EAEL,UAAU,EACV,gBAAgB,EACjB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAEzD,aAAa;AACb,oBAAY,sBAAsB,GAAG;IACnC,UAAU,EAAE,iBAAiB,EAAE,CAAA;IAC/B,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,CAqCrD,CAAA;IAIM,MAAM,QAAQ,EAAE,gBAAgB,CAAC,sBAAsB,CAIH,CAAA;CAC5D"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"representation.js","sourceRoot":"","sources":["../../../src/platform/wearables/representation.ts"],"names":[],"mappings":";;;AAAA,qEAAgE;AAChE,iDAIyB;AACzB,+DAAyD;AAWzD,aAAa;AACb,IAAiB,sBAAsB,CA+CtC;AA/CD,WAAiB,sBAAsB;IACxB,6BAAM,GAAuC;QACxD,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,UAAU,EAAE;gBACV,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,uCAAiB,CAAC,MAAM;gBAC/B,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;aAClB;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;IAED,MAAM,eAAe,GACnB,IAAA,8BAAiB,EAAC,uBAAA,MAAM,CAAC,CAAA;IACd,+BAAQ,GAA6C,CAChE,cAAmB,EACuB,EAAE,CAC5C,eAAe,CAAC,cAAc,CAAC;QAC/B,cAAc,CAAC,QAAQ,CAAC,QAAQ,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAA;AAC7D,CAAC,EA/CgB,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QA+CtC"}
@@ -1,12 +0,0 @@
1
- import { JSONSchema, ValidateFunction } from '../../validation';
2
- /** @alpha */
3
- export declare enum WearableBodyShape {
4
- MALE = "urn:decentraland:off-chain:base-avatars:BaseMale",
5
- FEMALE = "urn:decentraland:off-chain:base-avatars:BaseFemale"
6
- }
7
- /** @alpha */
8
- export declare namespace WearableBodyShape {
9
- const schema: JSONSchema<WearableBodyShape>;
10
- const validate: ValidateFunction<WearableBodyShape>;
11
- }
12
- //# sourceMappingURL=wearable-body-shape.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wearable-body-shape.d.ts","sourceRoot":"","sources":["../../../src/platform/wearables/wearable-body-shape.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,gBAAgB,EACjB,MAAM,kBAAkB,CAAA;AAEzB,aAAa;AACb,oBAAY,iBAAiB;IAC3B,IAAI,qDAAqD;IACzD,MAAM,uDAAuD;CAC9D;AAED,aAAa;AACb,yBAAiB,iBAAiB,CAAC;IAC1B,MAAM,MAAM,EAAE,UAAU,CAAC,iBAAiB,CAGhD,CAAA;IAEM,MAAM,QAAQ,EAAE,gBAAgB,CAAC,iBAAiB,CAC9B,CAAA;CAC5B"}
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WearableBodyShape = void 0;
4
- const validation_1 = require("../../validation");
5
- /** @alpha */
6
- var WearableBodyShape;
7
- (function (WearableBodyShape) {
8
- WearableBodyShape["MALE"] = "urn:decentraland:off-chain:base-avatars:BaseMale";
9
- WearableBodyShape["FEMALE"] = "urn:decentraland:off-chain:base-avatars:BaseFemale";
10
- })(WearableBodyShape = exports.WearableBodyShape || (exports.WearableBodyShape = {}));
11
- /** @alpha */
12
- (function (WearableBodyShape) {
13
- WearableBodyShape.schema = {
14
- type: 'string',
15
- enum: Object.values(WearableBodyShape)
16
- };
17
- WearableBodyShape.validate = (0, validation_1.generateValidator)(WearableBodyShape.schema);
18
- })(WearableBodyShape = exports.WearableBodyShape || (exports.WearableBodyShape = {}));
19
- //# sourceMappingURL=wearable-body-shape.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wearable-body-shape.js","sourceRoot":"","sources":["../../../src/platform/wearables/wearable-body-shape.ts"],"names":[],"mappings":";;;AAAA,iDAIyB;AAEzB,aAAa;AACb,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,8EAAyD,CAAA;IACzD,kFAA6D,CAAA;AAC/D,CAAC,EAHW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAG5B;AAED,aAAa;AACb,WAAiB,iBAAiB;IACnB,wBAAM,GAAkC;QACnD,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC;KACvC,CAAA;IAEY,0BAAQ,GACnB,IAAA,8BAAiB,EAAC,kBAAA,MAAM,CAAC,CAAA;AAC7B,CAAC,EARgB,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAQjC"}
@@ -1,51 +0,0 @@
1
- import { JSONSchema, ValidateFunction } from '../../validation';
2
- import { Rarity } from '../../dapps/rarity';
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';
10
- /** @alpha */
11
- export declare type Wearable = DisplayableDeployment & {
12
- id: string;
13
- name: string;
14
- description: string;
15
- data: {
16
- replaces: WearableCategory[];
17
- hides: WearableCategory[];
18
- tags: string[];
19
- representations: WearableRepresentation[];
20
- category: WearableCategory;
21
- };
22
- i18n: I18N[];
23
- thumbnail: string;
24
- image: string;
25
- rarity?: Rarity;
26
- collectionAddress?: string;
27
- metrics?: Metrics;
28
- content?: Record<string, string>;
29
- merkleProof?: MerkleProof;
30
- };
31
- /** @alpha */
32
- export declare type StandardWearable = Omit<WithRequired<Wearable, 'collectionAddress' | 'rarity'>, 'merkleProof' | 'content'>;
33
- export declare type ThirdPartyWearable = Omit<WithRequired<Wearable, 'merkleProof'>, 'rarity' | 'collectionAddress'>;
34
- export declare const isStandard: (wearable: Wearable) => wearable is StandardWearable;
35
- export declare const isThirdParty: (wearable: Wearable) => wearable is ThirdPartyWearable;
36
- /** @alpha */
37
- export declare namespace Wearable {
38
- const schema: JSONSchema<Wearable>;
39
- /**
40
- * Validates that the wearable metadata complies with the standard or third party wearable, and doesn't have repeated locales.
41
- * Some fields are defined as optional but those are validated to be present as standard XOR third party:
42
- * Standard Wearables should contain:
43
- * - collectionAddress
44
- * - rarity
45
- * Third Party Wearables should contain:
46
- * - merkleProof
47
- * - content
48
- */
49
- const validate: ValidateFunction<Wearable>;
50
- }
51
- //# sourceMappingURL=wearable.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wearable.d.ts","sourceRoot":"","sources":["../../../src/platform/wearables/wearable.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,gBAAgB,EACjB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAChE,OAAO,EAAE,IAAI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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,CAoGvC,CAAA;IAED;;;;;;;;;OASG;IACI,MAAM,QAAQ,EAAE,gBAAgB,CAAC,QAAQ,CAA6B,CAAA;CAC9E"}
@@ -1,138 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Wearable = exports.isThirdParty = exports.isStandard = void 0;
4
- const validation_1 = require("../../validation");
5
- const rarity_1 = require("../../dapps/rarity");
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
- return wearable.merkleProof.hashingKeys.every((key) => wearable.hasOwnProperty(key));
18
- };
19
- const validateStandardWearable = (rarity, collectionAddress) => rarity_1.Rarity.validate(rarity) && !!collectionAddress;
20
- const isStandard = (wearable) => validateStandardWearable(wearable.rarity, wearable.collectionAddress);
21
- exports.isStandard = isStandard;
22
- const isThirdParty = (wearable) => validateThirdParty(wearable);
23
- exports.isThirdParty = isThirdParty;
24
- /** @alpha */
25
- var Wearable;
26
- (function (Wearable) {
27
- Wearable.schema = {
28
- type: 'object',
29
- properties: {
30
- ...displayable_1.displayableProperties,
31
- id: {
32
- type: 'string'
33
- },
34
- description: {
35
- type: 'string'
36
- },
37
- collectionAddress: {
38
- type: 'string',
39
- nullable: true
40
- },
41
- rarity: {
42
- ...rarity_1.Rarity.schema,
43
- nullable: true
44
- },
45
- name: {
46
- type: 'string'
47
- },
48
- i18n: {
49
- type: 'array',
50
- items: i18n_1.I18N.schema,
51
- minItems: 1,
52
- uniqueItemProperties: ['code'],
53
- errorMessage: '${0#} array should not have duplicates for "code"'
54
- },
55
- data: {
56
- type: 'object',
57
- properties: {
58
- replaces: {
59
- type: 'array',
60
- items: wearable_category_1.WearableCategory.schema
61
- },
62
- hides: {
63
- type: 'array',
64
- items: wearable_category_1.WearableCategory.schema
65
- },
66
- tags: {
67
- type: 'array',
68
- items: {
69
- type: 'string',
70
- minLength: 1
71
- }
72
- },
73
- representations: {
74
- type: 'array',
75
- items: representation_1.WearableRepresentation.schema,
76
- minItems: 1
77
- },
78
- category: wearable_category_1.WearableCategory.schema
79
- },
80
- required: ['replaces', 'hides', 'tags', 'representations', 'category']
81
- },
82
- thumbnail: {
83
- type: 'string'
84
- },
85
- image: {
86
- type: 'string'
87
- },
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
- }
102
- },
103
- additionalProperties: true,
104
- required: [
105
- 'id',
106
- 'description',
107
- 'name',
108
- 'data',
109
- 'thumbnail',
110
- 'image',
111
- 'i18n'
112
- ],
113
- oneOf: [
114
- {
115
- required: ['collectionAddress', 'rarity'],
116
- prohibited: ['merkleProof', 'content'],
117
- errorMessage: 'for standard wearables "merkleProof" and "content" are not allowed'
118
- },
119
- {
120
- required: ['merkleProof', 'content'],
121
- prohibited: ['collectionAddress', 'rarity'],
122
- errorMessage: 'for third party wearables "collectionAddress" and "rarity" are not allowed'
123
- }
124
- ]
125
- };
126
- /**
127
- * Validates that the wearable metadata complies with the standard or third party wearable, and doesn't have repeated locales.
128
- * Some fields are defined as optional but those are validated to be present as standard XOR third party:
129
- * Standard Wearables should contain:
130
- * - collectionAddress
131
- * - rarity
132
- * Third Party Wearables should contain:
133
- * - merkleProof
134
- * - content
135
- */
136
- Wearable.validate = (0, validation_1.generateValidator)(Wearable.schema);
137
- })(Wearable = exports.Wearable || (exports.Wearable = {}));
138
- //# sourceMappingURL=wearable.js.map
@@ -1 +0,0 @@
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;AAoC5C,MAAM,kBAAkB,GAAG,CAAC,QAAkB,EAAE,EAAE;IAChD,IAAI,CAAC,yBAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC;QAAE,OAAO,KAAK,CAAA;IAC7D,IAAI,QAAQ,CAAC,WAAW,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAA;IAC/D,OAAO,QAAQ,CAAC,WAAW,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CACpD,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAC7B,CAAA;AACH,CAAC,CAAA;AAED,MAAM,wBAAwB,GAAG,CAC/B,MAAe,EACf,iBAA0B,EAC1B,EAAE,CAAC,eAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,iBAAiB,CAAA;AAE5C,MAAM,UAAU,GAAG,CAAC,QAAkB,EAAgC,EAAE,CAC7E,wBAAwB,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAA;AAD1D,QAAA,UAAU,cACgD;AAEhE,MAAM,YAAY,GAAG,CAC1B,QAAkB,EACc,EAAE,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAA;AAFpD,QAAA,YAAY,gBAEwC;AAEjE,aAAa;AACb,IAAiB,QAAQ,CAkHxB;AAlHD,WAAiB,QAAQ;IAC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