@dcl/schemas 4.14.0 → 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.
- package/README.md +7 -4
- package/dist/dapps/item.d.ts +1 -1
- package/dist/dapps/item.d.ts.map +1 -1
- package/dist/dapps/nft.d.ts +1 -1
- package/dist/dapps/nft.d.ts.map +1 -1
- package/dist/dapps/nft.js +2 -2
- package/dist/dapps/nft.js.map +1 -1
- package/dist/dapps/preview/index.js +5 -1
- package/dist/dapps/preview/index.js.map +1 -1
- package/dist/dapps/preview/preview-config.d.ts +2 -2
- package/dist/dapps/preview/preview-config.d.ts.map +1 -1
- package/dist/dapps/preview/preview-options.d.ts +2 -2
- package/dist/dapps/preview/preview-options.d.ts.map +1 -1
- package/dist/dapps/preview/representation-definition.d.ts +1 -1
- package/dist/dapps/preview/representation-definition.d.ts.map +1 -1
- package/dist/dapps/preview/wearable-definition.d.ts +1 -1
- package/dist/dapps/preview/wearable-definition.d.ts.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/dist/misc/auth-chain.d.ts +2 -2
- package/dist/misc/auth-chain.d.ts.map +1 -1
- package/dist/misc/auth-chain.js +3 -2
- package/dist/misc/auth-chain.js.map +1 -1
- package/dist/misc/index.d.ts +0 -3
- package/dist/misc/index.d.ts.map +1 -1
- package/dist/platform/entity.d.ts +2 -1
- package/dist/platform/entity.d.ts.map +1 -1
- package/dist/platform/entity.js +1 -0
- package/dist/platform/entity.js.map +1 -1
- package/dist/platform/index.d.ts +1 -1
- package/dist/platform/index.d.ts.map +1 -1
- package/dist/platform/index.js +6 -2
- package/dist/platform/index.js.map +1 -1
- package/dist/platform/item/base-item.d.ts +19 -0
- package/dist/platform/item/base-item.d.ts.map +1 -0
- package/dist/platform/item/base-item.js +45 -0
- package/dist/platform/item/base-item.js.map +1 -0
- package/dist/platform/item/body-shape.d.ts +12 -0
- package/dist/platform/item/body-shape.d.ts.map +1 -0
- package/dist/platform/item/body-shape.js +19 -0
- package/dist/platform/item/body-shape.js.map +1 -0
- package/dist/platform/item/emote/adr74/emote-data-adr74.d.ts +13 -0
- package/dist/platform/item/emote/adr74/emote-data-adr74.d.ts.map +1 -0
- package/dist/platform/item/emote/adr74/emote-data-adr74.js +31 -0
- package/dist/platform/item/emote/adr74/emote-data-adr74.js.map +1 -0
- package/dist/platform/item/emote/adr74/representation-adr74.d.ts +14 -0
- package/dist/platform/item/emote/adr74/representation-adr74.d.ts.map +1 -0
- package/dist/platform/item/emote/adr74/representation-adr74.js +41 -0
- package/dist/platform/item/emote/adr74/representation-adr74.js.map +1 -0
- package/dist/{dapps → platform/item/emote}/emote-category.d.ts +1 -1
- package/dist/platform/item/emote/emote-category.d.ts.map +1 -0
- package/dist/{dapps → platform/item/emote}/emote-category.js +1 -1
- package/dist/platform/item/emote/emote-category.js.map +1 -0
- package/dist/platform/item/emote/emote.d.ts +16 -0
- package/dist/platform/item/emote/emote.d.ts.map +1 -0
- package/dist/platform/item/emote/emote.js +56 -0
- package/dist/platform/item/emote/emote.js.map +1 -0
- package/dist/platform/item/emote/index.d.ts +5 -0
- package/dist/platform/item/emote/index.d.ts.map +1 -0
- package/dist/platform/item/emote/index.js +12 -0
- package/dist/platform/item/emote/index.js.map +1 -0
- package/dist/platform/{wearables → item}/i18n.d.ts +0 -0
- package/dist/platform/item/i18n.d.ts.map +1 -0
- package/dist/platform/{wearables → item}/i18n.js +0 -0
- package/dist/platform/item/i18n.js.map +1 -0
- package/dist/platform/item/index.d.ts +9 -0
- package/dist/platform/item/index.d.ts.map +1 -0
- package/dist/platform/item/index.js +32 -0
- package/dist/platform/item/index.js.map +1 -0
- package/dist/platform/{wearables → item}/locale.d.ts +0 -0
- package/dist/platform/item/locale.d.ts.map +1 -0
- package/dist/platform/{wearables → item}/locale.js +0 -0
- package/dist/platform/item/locale.js.map +1 -0
- package/dist/platform/{wearables → item}/metrics.d.ts +0 -0
- package/dist/platform/item/metrics.d.ts.map +1 -0
- package/dist/platform/{wearables → item}/metrics.js +0 -0
- package/dist/platform/item/metrics.js.map +1 -0
- package/dist/platform/item/standard-props.d.ts +16 -0
- package/dist/platform/item/standard-props.d.ts.map +1 -0
- package/dist/platform/item/standard-props.js +25 -0
- package/dist/platform/item/standard-props.js.map +1 -0
- package/dist/platform/item/third-party-props.d.ts +20 -0
- package/dist/platform/item/third-party-props.d.ts.map +1 -0
- package/dist/platform/item/third-party-props.js +33 -0
- package/dist/platform/item/third-party-props.js.map +1 -0
- package/dist/platform/item/wearable/index.d.ts +3 -0
- package/dist/platform/item/wearable/index.d.ts.map +1 -0
- package/dist/platform/item/wearable/index.js +8 -0
- package/dist/platform/item/wearable/index.js.map +1 -0
- package/dist/platform/{wearables → item/wearable}/representation.d.ts +4 -4
- package/dist/platform/item/wearable/representation.d.ts.map +1 -0
- package/dist/platform/{wearables → item/wearable}/representation.js +9 -8
- package/dist/platform/item/wearable/representation.js.map +1 -0
- package/dist/platform/item/wearable/wearable.d.ts +32 -0
- package/dist/platform/item/wearable/wearable.d.ts.map +1 -0
- package/dist/platform/item/wearable/wearable.js +80 -0
- package/dist/platform/item/wearable/wearable.js.map +1 -0
- package/dist/platform/merkle-tree/index.js +5 -1
- package/dist/platform/merkle-tree/index.js.map +1 -1
- package/dist/platform/merkle-tree/merkle-proof.d.ts.map +1 -1
- package/dist/platform/merkle-tree/merkle-proof.js +2 -1
- package/dist/platform/merkle-tree/merkle-proof.js.map +1 -1
- package/dist/platform/profile/index.js +5 -1
- package/dist/platform/profile/index.js.map +1 -1
- package/dist/schemas.d.ts +87 -39
- package/dist/sdk/index.js +5 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/project/index.js +5 -1
- package/dist/sdk/project/index.js.map +1 -1
- package/dist/sdk/ws/index.js +5 -1
- package/dist/sdk/ws/index.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/dist/validation.d.ts +2 -2
- package/dist/validation.d.ts.map +1 -1
- package/dist/validation.js +4 -3
- package/dist/validation.js.map +1 -1
- package/package.json +2 -2
- package/dist/dapps/emote-category.d.ts.map +0 -1
- package/dist/dapps/emote-category.js.map +0 -1
- package/dist/platform/wearables/i18n.d.ts.map +0 -1
- package/dist/platform/wearables/i18n.js.map +0 -1
- package/dist/platform/wearables/index.d.ts +0 -7
- package/dist/platform/wearables/index.d.ts.map +0 -1
- package/dist/platform/wearables/index.js +0 -16
- package/dist/platform/wearables/index.js.map +0 -1
- package/dist/platform/wearables/locale.d.ts.map +0 -1
- package/dist/platform/wearables/locale.js.map +0 -1
- package/dist/platform/wearables/metrics.d.ts.map +0 -1
- package/dist/platform/wearables/metrics.js.map +0 -1
- package/dist/platform/wearables/representation.d.ts.map +0 -1
- package/dist/platform/wearables/representation.js.map +0 -1
- package/dist/platform/wearables/wearable-body-shape.d.ts +0 -12
- package/dist/platform/wearables/wearable-body-shape.d.ts.map +0 -1
- package/dist/platform/wearables/wearable-body-shape.js +0 -19
- package/dist/platform/wearables/wearable-body-shape.js.map +0 -1
- package/dist/platform/wearables/wearable.d.ts +0 -51
- package/dist/platform/wearables/wearable.d.ts.map +0 -1
- package/dist/platform/wearables/wearable.js +0 -138
- package/dist/platform/wearables/wearable.js.map +0 -1
|
@@ -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,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