@dcl/schemas 3.10.0 → 3.10.1-20220318140447.commit-5126641
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 +1 -1
- package/dist/platform/wearables/base-wearable.d.ts +29 -0
- package/dist/platform/wearables/base-wearable.d.ts.map +1 -0
- package/dist/platform/wearables/base-wearable.js +79 -0
- package/dist/platform/wearables/base-wearable.js.map +1 -0
- package/dist/platform/wearables/index.d.ts +1 -0
- package/dist/platform/wearables/index.d.ts.map +1 -1
- package/dist/platform/wearables/index.js +3 -1
- package/dist/platform/wearables/index.js.map +1 -1
- package/dist/platform/wearables/tp-wearable.d.ts +14 -0
- package/dist/platform/wearables/tp-wearable.d.ts.map +1 -0
- package/dist/platform/wearables/tp-wearable.js +28 -0
- package/dist/platform/wearables/tp-wearable.js.map +1 -0
- package/dist/platform/wearables/wearable.d.ts +3 -20
- package/dist/platform/wearables/wearable.d.ts.map +1 -1
- package/dist/platform/wearables/wearable.js +7 -74
- package/dist/platform/wearables/wearable.js.map +1 -1
- package/dist/schemas.d.ts +38 -15
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -50,7 +50,7 @@ It is recommended that if you are a stakeholder of the interoperable parts of De
|
|
|
50
50
|
|
|
51
51
|
## Making changes
|
|
52
52
|
|
|
53
|
-
To make sure everybody is aware of changes in types, we have a process of api-extraction using https://api-extractor.com. It creates [a report file](report/schemas.api.md) that should be reviewed upon every change and
|
|
53
|
+
To make sure everybody is aware of changes in types, we have a process of api-extraction using https://api-extractor.com. It creates [a report file](report/schemas.api.md) that should be reviewed upon every change and committed as part of the PR.
|
|
54
54
|
|
|
55
55
|
To generate the file with your changes run `npm run build && npm run refresh-api`.
|
|
56
56
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { JSONSchema, ValidateFunction } from '../../validation';
|
|
2
|
+
import { WearableCategory } from '../../dapps/wearable-category';
|
|
3
|
+
import { I18N } from './i18n';
|
|
4
|
+
import { WearableRepresentation } from './representation';
|
|
5
|
+
import { Metrics } from './metrics';
|
|
6
|
+
import { DisplayableDeployment } from '../shared/displayable';
|
|
7
|
+
/** @alpha */
|
|
8
|
+
export declare type BaseWearable = DisplayableDeployment & {
|
|
9
|
+
id: string;
|
|
10
|
+
descriptions: I18N[];
|
|
11
|
+
names: I18N[];
|
|
12
|
+
data: {
|
|
13
|
+
replaces: WearableCategory[];
|
|
14
|
+
hides: WearableCategory[];
|
|
15
|
+
tags: string[];
|
|
16
|
+
representations: WearableRepresentation[];
|
|
17
|
+
category: WearableCategory;
|
|
18
|
+
};
|
|
19
|
+
thumbnail: string;
|
|
20
|
+
image: string;
|
|
21
|
+
metrics?: Metrics;
|
|
22
|
+
};
|
|
23
|
+
/** @alpha */
|
|
24
|
+
export declare namespace BaseWearable {
|
|
25
|
+
const schema: JSONSchema<BaseWearable>;
|
|
26
|
+
const validateDuplicatedLocales: (i18ns: I18N[]) => boolean;
|
|
27
|
+
const validate: ValidateFunction<BaseWearable>;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=base-wearable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-wearable.d.ts","sourceRoot":"","sources":["../../../src/platform/wearables/base-wearable.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,gBAAgB,EACjB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EACL,qBAAqB,EAEtB,MAAM,uBAAuB,CAAA;AAE9B,aAAa;AACb,oBAAY,YAAY,GAAG,qBAAqB,GAAG;IACjD,EAAE,EAAE,MAAM,CAAA;IACV,YAAY,EAAE,IAAI,EAAE,CAAA;IACpB,KAAK,EAAE,IAAI,EAAE,CAAA;IACb,IAAI,EAAE;QACJ,QAAQ,EAAE,gBAAgB,EAAE,CAAA;QAC5B,KAAK,EAAE,gBAAgB,EAAE,CAAA;QACzB,IAAI,EAAE,MAAM,EAAE,CAAA;QACd,eAAe,EAAE,sBAAsB,EAAE,CAAA;QACzC,QAAQ,EAAE,gBAAgB,CAAA;KAC3B,CAAA;IACD,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,aAAa;AACb,yBAAiB,YAAY,CAAC;IACrB,MAAM,MAAM,EAAE,UAAU,CAAC,YAAY,CA0D3C,CAAA;IAGM,MAAM,yBAAyB,UAAW,IAAI,EAAE,YAIpD,CAAA;IAII,MAAM,QAAQ,EAAE,gBAAgB,CAAC,YAAY,CAKT,CAAA;CAC5C"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseWearable = void 0;
|
|
4
|
+
const validation_1 = require("../../validation");
|
|
5
|
+
const wearable_category_1 = require("../../dapps/wearable-category");
|
|
6
|
+
const i18n_1 = require("./i18n");
|
|
7
|
+
const representation_1 = require("./representation");
|
|
8
|
+
const metrics_1 = require("./metrics");
|
|
9
|
+
const displayable_1 = require("../shared/displayable");
|
|
10
|
+
/** @alpha */
|
|
11
|
+
var BaseWearable;
|
|
12
|
+
(function (BaseWearable) {
|
|
13
|
+
BaseWearable.schema = {
|
|
14
|
+
type: 'object',
|
|
15
|
+
properties: {
|
|
16
|
+
...displayable_1.displayableProperties,
|
|
17
|
+
id: {
|
|
18
|
+
type: 'string'
|
|
19
|
+
},
|
|
20
|
+
descriptions: {
|
|
21
|
+
type: 'array',
|
|
22
|
+
items: i18n_1.I18N.schema,
|
|
23
|
+
minItems: 1
|
|
24
|
+
},
|
|
25
|
+
names: {
|
|
26
|
+
type: 'array',
|
|
27
|
+
items: i18n_1.I18N.schema,
|
|
28
|
+
minItems: 1
|
|
29
|
+
},
|
|
30
|
+
data: {
|
|
31
|
+
type: 'object',
|
|
32
|
+
properties: {
|
|
33
|
+
replaces: {
|
|
34
|
+
type: 'array',
|
|
35
|
+
items: wearable_category_1.WearableCategory.schema
|
|
36
|
+
},
|
|
37
|
+
hides: {
|
|
38
|
+
type: 'array',
|
|
39
|
+
items: wearable_category_1.WearableCategory.schema
|
|
40
|
+
},
|
|
41
|
+
tags: {
|
|
42
|
+
type: 'array',
|
|
43
|
+
items: {
|
|
44
|
+
type: 'string',
|
|
45
|
+
minLength: 1
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
representations: {
|
|
49
|
+
type: 'array',
|
|
50
|
+
items: representation_1.WearableRepresentation.schema,
|
|
51
|
+
minItems: 1
|
|
52
|
+
},
|
|
53
|
+
category: wearable_category_1.WearableCategory.schema
|
|
54
|
+
},
|
|
55
|
+
additionalProperties: false,
|
|
56
|
+
required: ['replaces', 'hides', 'tags', 'representations', 'category']
|
|
57
|
+
},
|
|
58
|
+
thumbnail: {
|
|
59
|
+
type: 'string'
|
|
60
|
+
},
|
|
61
|
+
image: {
|
|
62
|
+
type: 'string'
|
|
63
|
+
},
|
|
64
|
+
metrics: {
|
|
65
|
+
...metrics_1.Metrics.schema,
|
|
66
|
+
nullable: true
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
additionalProperties: false,
|
|
70
|
+
required: ['id', 'descriptions', 'names', 'data', 'thumbnail', 'image']
|
|
71
|
+
};
|
|
72
|
+
// Returns true only if there are no entries with the same locale
|
|
73
|
+
BaseWearable.validateDuplicatedLocales = (i18ns) => i18ns.every(({ code }, index) => i18ns.findIndex((i18n) => i18n.code === code) === index);
|
|
74
|
+
const schemaValidator = (0, validation_1.generateValidator)(BaseWearable.schema);
|
|
75
|
+
BaseWearable.validate = (wearable) => schemaValidator(wearable) &&
|
|
76
|
+
BaseWearable.validateDuplicatedLocales(wearable.descriptions) &&
|
|
77
|
+
BaseWearable.validateDuplicatedLocales(wearable.names);
|
|
78
|
+
})(BaseWearable = exports.BaseWearable || (exports.BaseWearable = {}));
|
|
79
|
+
//# sourceMappingURL=base-wearable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-wearable.js","sourceRoot":"","sources":["../../../src/platform/wearables/base-wearable.ts"],"names":[],"mappings":";;;AAAA,iDAIyB;AACzB,qEAAgE;AAChE,iCAA6B;AAC7B,qDAAyD;AACzD,uCAAmC;AACnC,uDAG8B;AAmB9B,aAAa;AACb,IAAiB,YAAY,CA4E5B;AA5ED,WAAiB,YAAY;IACd,mBAAM,GAA6B;QAC9C,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,GAAG,mCAAqB;YACxB,EAAE,EAAE;gBACF,IAAI,EAAE,QAAQ;aACf;YACD,YAAY,EAAE;gBACZ,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,WAAI,CAAC,MAAM;gBAClB,QAAQ,EAAE,CAAC;aACZ;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,WAAI,CAAC,MAAM;gBAClB,QAAQ,EAAE,CAAC;aACZ;YACD,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,QAAQ,EAAE;wBACR,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE,oCAAgB,CAAC,MAAM;qBAC/B;oBACD,KAAK,EAAE;wBACL,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,oBAAoB,EAAE,KAAK;gBAC3B,QAAQ,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,UAAU,CAAC;aACvE;YACD,SAAS,EAAE;gBACT,IAAI,EAAE,QAAQ;aACf;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;aACf;YACD,OAAO,EAAE;gBACP,GAAG,iBAAO,CAAC,MAAM;gBACjB,QAAQ,EAAE,IAAI;aACf;SACF;QACD,oBAAoB,EAAE,KAAK;QAC3B,QAAQ,EAAE,CAAC,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC;KACxE,CAAA;IAED,iEAAiE;IACpD,sCAAyB,GAAG,CAAC,KAAa,EAAE,EAAE,CACzD,KAAK,CAAC,KAAK,CACT,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,CAClB,KAAK,CAAC,SAAS,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,KAAK,KAAK,CAC1D,CAAA;IAEH,MAAM,eAAe,GACnB,IAAA,8BAAiB,EAAC,aAAA,MAAM,CAAC,CAAA;IACd,qBAAQ,GAAmC,CACtD,QAAa,EACa,EAAE,CAC5B,eAAe,CAAC,QAAQ,CAAC;QACzB,aAAA,yBAAyB,CAAC,QAAQ,CAAC,YAAY,CAAC;QAChD,aAAA,yBAAyB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;AAC7C,CAAC,EA5EgB,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QA4E5B"}
|
|
@@ -4,4 +4,5 @@ export { Metrics } from './metrics';
|
|
|
4
4
|
export { WearableRepresentation } from './representation';
|
|
5
5
|
export { WearableBodyShape } from './wearable-body-shape';
|
|
6
6
|
export { Wearable } from './wearable';
|
|
7
|
+
export { TPWearable } from './tp-wearable';
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/platform/wearables/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/platform/wearables/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Wearable = exports.WearableBodyShape = exports.WearableRepresentation = exports.Metrics = exports.Locale = exports.I18N = void 0;
|
|
3
|
+
exports.TPWearable = exports.Wearable = exports.WearableBodyShape = exports.WearableRepresentation = exports.Metrics = exports.Locale = exports.I18N = void 0;
|
|
4
4
|
var i18n_1 = require("./i18n");
|
|
5
5
|
Object.defineProperty(exports, "I18N", { enumerable: true, get: function () { return i18n_1.I18N; } });
|
|
6
6
|
var locale_1 = require("./locale");
|
|
@@ -13,4 +13,6 @@ var wearable_body_shape_1 = require("./wearable-body-shape");
|
|
|
13
13
|
Object.defineProperty(exports, "WearableBodyShape", { enumerable: true, get: function () { return wearable_body_shape_1.WearableBodyShape; } });
|
|
14
14
|
var wearable_1 = require("./wearable");
|
|
15
15
|
Object.defineProperty(exports, "Wearable", { enumerable: true, get: function () { return wearable_1.Wearable; } });
|
|
16
|
+
var tp_wearable_1 = require("./tp-wearable");
|
|
17
|
+
Object.defineProperty(exports, "TPWearable", { enumerable: true, get: function () { return tp_wearable_1.TPWearable; } });
|
|
16
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platform/wearables/index.ts"],"names":[],"mappings":";;;AAAA,+BAA6B;AAApB,4FAAA,IAAI,OAAA;AACb,mCAAiC;AAAxB,gGAAA,MAAM,OAAA;AACf,qCAAmC;AAA1B,kGAAA,OAAO,OAAA;AAChB,mDAAyD;AAAhD,wHAAA,sBAAsB,OAAA;AAC/B,6DAAyD;AAAhD,wHAAA,iBAAiB,OAAA;AAC1B,uCAAqC;AAA5B,oGAAA,QAAQ,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platform/wearables/index.ts"],"names":[],"mappings":";;;AAAA,+BAA6B;AAApB,4FAAA,IAAI,OAAA;AACb,mCAAiC;AAAxB,gGAAA,MAAM,OAAA;AACf,qCAAmC;AAA1B,kGAAA,OAAO,OAAA;AAChB,mDAAyD;AAAhD,wHAAA,sBAAsB,OAAA;AAC/B,6DAAyD;AAAhD,wHAAA,iBAAiB,OAAA;AAC1B,uCAAqC;AAA5B,oGAAA,QAAQ,OAAA;AACjB,6CAA0C;AAAjC,yGAAA,UAAU,OAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { JSONSchema, ValidateFunction } from '../../validation';
|
|
2
|
+
import { MerkleProof } from '../merkle-tree';
|
|
3
|
+
import { BaseWearable } from './base-wearable';
|
|
4
|
+
/** @alpha */
|
|
5
|
+
export declare type TPWearable = BaseWearable & {
|
|
6
|
+
content: Record<string, string>;
|
|
7
|
+
merkleProof: MerkleProof;
|
|
8
|
+
};
|
|
9
|
+
/** @alpha */
|
|
10
|
+
export declare namespace TPWearable {
|
|
11
|
+
const schema: JSONSchema<TPWearable>;
|
|
12
|
+
const validate: ValidateFunction<TPWearable>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=tp-wearable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tp-wearable.d.ts","sourceRoot":"","sources":["../../../src/platform/wearables/tp-wearable.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,gBAAgB,EACjB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C,aAAa;AACb,oBAAY,UAAU,GAAG,YAAY,GAAG;IACtC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,WAAW,EAAE,WAAW,CAAA;CACzB,CAAA;AAED,aAAa;AACb,yBAAiB,UAAU,CAAC;IACnB,MAAM,MAAM,EAAE,UAAU,CAAC,UAAU,CAYzC,CAAA;IAIM,MAAM,QAAQ,EAAE,gBAAgB,CAAC,UAAU,CAKM,CAAA;CACzD"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TPWearable = void 0;
|
|
4
|
+
const validation_1 = require("../../validation");
|
|
5
|
+
const merkle_tree_1 = require("../merkle-tree");
|
|
6
|
+
const base_wearable_1 = require("./base-wearable");
|
|
7
|
+
/** @alpha */
|
|
8
|
+
var TPWearable;
|
|
9
|
+
(function (TPWearable) {
|
|
10
|
+
TPWearable.schema = {
|
|
11
|
+
...base_wearable_1.BaseWearable.schema,
|
|
12
|
+
properties: {
|
|
13
|
+
...base_wearable_1.BaseWearable.schema.properties,
|
|
14
|
+
content: {
|
|
15
|
+
type: 'object',
|
|
16
|
+
additionalProperties: { type: 'string' },
|
|
17
|
+
required: []
|
|
18
|
+
},
|
|
19
|
+
merkleProof: merkle_tree_1.MerkleProof.schema
|
|
20
|
+
},
|
|
21
|
+
required: [...base_wearable_1.BaseWearable.schema.required, 'content']
|
|
22
|
+
};
|
|
23
|
+
const schemaValidator = (0, validation_1.generateValidator)(TPWearable.schema);
|
|
24
|
+
TPWearable.validate = (wearable) => schemaValidator(wearable) &&
|
|
25
|
+
base_wearable_1.BaseWearable.validateDuplicatedLocales(wearable.descriptions) &&
|
|
26
|
+
base_wearable_1.BaseWearable.validateDuplicatedLocales(wearable.names);
|
|
27
|
+
})(TPWearable = exports.TPWearable || (exports.TPWearable = {}));
|
|
28
|
+
//# sourceMappingURL=tp-wearable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tp-wearable.js","sourceRoot":"","sources":["../../../src/platform/wearables/tp-wearable.ts"],"names":[],"mappings":";;;AAAA,iDAIyB;AACzB,gDAA4C;AAC5C,mDAA8C;AAQ9C,aAAa;AACb,IAAiB,UAAU,CAuB1B;AAvBD,WAAiB,UAAU;IACZ,iBAAM,GAA2B;QAC5C,GAAG,4BAAY,CAAC,MAAM;QACtB,UAAU,EAAE;YACV,GAAG,4BAAY,CAAC,MAAM,CAAC,UAAW;YAClC,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,oBAAoB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACxC,QAAQ,EAAE,EAAE;aACb;YACD,WAAW,EAAE,yBAAW,CAAC,MAAM;SAChC;QACD,QAAQ,EAAE,CAAC,GAAG,4BAAY,CAAC,MAAM,CAAC,QAAQ,EAAE,SAAS,CAAC;KACvD,CAAA;IAED,MAAM,eAAe,GACnB,IAAA,8BAAiB,EAAC,WAAA,MAAM,CAAC,CAAA;IACd,mBAAQ,GAAiC,CACpD,QAAa,EACW,EAAE,CAC1B,eAAe,CAAC,QAAQ,CAAC;QACzB,4BAAY,CAAC,yBAAyB,CAAC,QAAQ,CAAC,YAAY,CAAC;QAC7D,4BAAY,CAAC,yBAAyB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;AAC1D,CAAC,EAvBgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAuB1B"}
|
|
@@ -1,27 +1,10 @@
|
|
|
1
1
|
import { JSONSchema, ValidateFunction } from '../../validation';
|
|
2
2
|
import { Rarity } from '../../dapps/rarity';
|
|
3
|
-
import {
|
|
4
|
-
import { I18N } from './i18n';
|
|
5
|
-
import { WearableRepresentation } from './representation';
|
|
6
|
-
import { Metrics } from './metrics';
|
|
7
|
-
import { DisplayableDeployment } from '../shared/displayable';
|
|
3
|
+
import { BaseWearable } from './base-wearable';
|
|
8
4
|
/** @alpha */
|
|
9
|
-
export declare type Wearable =
|
|
10
|
-
id: string;
|
|
11
|
-
descriptions: I18N[];
|
|
12
|
-
collectionAddress: string;
|
|
5
|
+
export declare type Wearable = BaseWearable & {
|
|
13
6
|
rarity: Rarity;
|
|
14
|
-
|
|
15
|
-
data: {
|
|
16
|
-
replaces: WearableCategory[];
|
|
17
|
-
hides: WearableCategory[];
|
|
18
|
-
tags: string[];
|
|
19
|
-
representations: WearableRepresentation[];
|
|
20
|
-
category: WearableCategory;
|
|
21
|
-
};
|
|
22
|
-
thumbnail: string;
|
|
23
|
-
image: string;
|
|
24
|
-
metrics?: Metrics;
|
|
7
|
+
collectionAddress: string;
|
|
25
8
|
};
|
|
26
9
|
/** @alpha */
|
|
27
10
|
export declare namespace Wearable {
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C,aAAa;AACb,oBAAY,QAAQ,GAAG,YAAY,GAAG;IACpC,MAAM,EAAE,MAAM,CAAA;IACd,iBAAiB,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED,aAAa;AACb,yBAAiB,QAAQ,CAAC;IACjB,MAAM,MAAM,EAAE,UAAU,CAAC,QAAQ,CAUvC,CAAA;IAGM,MAAM,QAAQ,EAAE,gBAAgB,CAAC,QAAQ,CAKQ,CAAA;CACzD"}
|
|
@@ -3,91 +3,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Wearable = void 0;
|
|
4
4
|
const validation_1 = require("../../validation");
|
|
5
5
|
const rarity_1 = require("../../dapps/rarity");
|
|
6
|
-
const
|
|
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");
|
|
6
|
+
const base_wearable_1 = require("./base-wearable");
|
|
11
7
|
/** @alpha */
|
|
12
8
|
var Wearable;
|
|
13
9
|
(function (Wearable) {
|
|
14
10
|
Wearable.schema = {
|
|
15
|
-
|
|
11
|
+
...base_wearable_1.BaseWearable.schema,
|
|
16
12
|
properties: {
|
|
17
|
-
...
|
|
18
|
-
id: {
|
|
19
|
-
type: 'string'
|
|
20
|
-
},
|
|
21
|
-
descriptions: {
|
|
22
|
-
type: 'array',
|
|
23
|
-
items: i18n_1.I18N.schema,
|
|
24
|
-
minItems: 1
|
|
25
|
-
},
|
|
13
|
+
...base_wearable_1.BaseWearable.schema.properties,
|
|
26
14
|
collectionAddress: {
|
|
27
15
|
type: 'string'
|
|
28
16
|
},
|
|
29
|
-
rarity: rarity_1.Rarity.schema
|
|
30
|
-
names: {
|
|
31
|
-
type: 'array',
|
|
32
|
-
items: i18n_1.I18N.schema,
|
|
33
|
-
minItems: 1
|
|
34
|
-
},
|
|
35
|
-
data: {
|
|
36
|
-
type: 'object',
|
|
37
|
-
properties: {
|
|
38
|
-
replaces: {
|
|
39
|
-
type: 'array',
|
|
40
|
-
items: wearable_category_1.WearableCategory.schema
|
|
41
|
-
},
|
|
42
|
-
hides: {
|
|
43
|
-
type: 'array',
|
|
44
|
-
items: wearable_category_1.WearableCategory.schema
|
|
45
|
-
},
|
|
46
|
-
tags: {
|
|
47
|
-
type: 'array',
|
|
48
|
-
items: {
|
|
49
|
-
type: 'string',
|
|
50
|
-
minLength: 1
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
representations: {
|
|
54
|
-
type: 'array',
|
|
55
|
-
items: representation_1.WearableRepresentation.schema,
|
|
56
|
-
minItems: 1
|
|
57
|
-
},
|
|
58
|
-
category: wearable_category_1.WearableCategory.schema
|
|
59
|
-
},
|
|
60
|
-
additionalProperties: false,
|
|
61
|
-
required: ['replaces', 'hides', 'tags', 'representations', 'category']
|
|
62
|
-
},
|
|
63
|
-
thumbnail: {
|
|
64
|
-
type: 'string'
|
|
65
|
-
},
|
|
66
|
-
image: {
|
|
67
|
-
type: 'string'
|
|
68
|
-
},
|
|
69
|
-
metrics: {
|
|
70
|
-
...metrics_1.Metrics.schema,
|
|
71
|
-
nullable: true
|
|
72
|
-
}
|
|
17
|
+
rarity: rarity_1.Rarity.schema
|
|
73
18
|
},
|
|
74
|
-
|
|
75
|
-
required: [
|
|
76
|
-
'id',
|
|
77
|
-
'descriptions',
|
|
78
|
-
'collectionAddress',
|
|
79
|
-
'rarity',
|
|
80
|
-
'names',
|
|
81
|
-
'data',
|
|
82
|
-
'thumbnail',
|
|
83
|
-
'image'
|
|
84
|
-
]
|
|
19
|
+
required: [...base_wearable_1.BaseWearable.schema.required, 'collectionAddress', 'rarity']
|
|
85
20
|
};
|
|
86
21
|
const schemaValidator = (0, validation_1.generateValidator)(Wearable.schema);
|
|
87
22
|
Wearable.validate = (wearable) => schemaValidator(wearable) &&
|
|
88
|
-
validateDuplicatedLocales(wearable.descriptions) &&
|
|
89
|
-
validateDuplicatedLocales(wearable.names);
|
|
90
|
-
// Returns true only if there are no entries with the same locale
|
|
91
|
-
const validateDuplicatedLocales = (i18ns) => i18ns.every(({ code }, index) => i18ns.findIndex((i18n) => i18n.code === code) === index);
|
|
23
|
+
base_wearable_1.BaseWearable.validateDuplicatedLocales(wearable.descriptions) &&
|
|
24
|
+
base_wearable_1.BaseWearable.validateDuplicatedLocales(wearable.names);
|
|
92
25
|
})(Wearable = exports.Wearable || (exports.Wearable = {}));
|
|
93
26
|
//# sourceMappingURL=wearable.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wearable.js","sourceRoot":"","sources":["../../../src/platform/wearables/wearable.ts"],"names":[],"mappings":";;;AAAA,iDAIyB;AACzB,+CAA2C;AAC3C,
|
|
1
|
+
{"version":3,"file":"wearable.js","sourceRoot":"","sources":["../../../src/platform/wearables/wearable.ts"],"names":[],"mappings":";;;AAAA,iDAIyB;AACzB,+CAA2C;AAC3C,mDAA8C;AAQ9C,aAAa;AACb,IAAiB,QAAQ,CAoBxB;AApBD,WAAiB,QAAQ;IACV,eAAM,GAAyB;QAC1C,GAAG,4BAAY,CAAC,MAAM;QACtB,UAAU,EAAE;YACV,GAAG,4BAAY,CAAC,MAAM,CAAC,UAAW;YAClC,iBAAiB,EAAE;gBACjB,IAAI,EAAE,QAAQ;aACf;YACD,MAAM,EAAE,eAAM,CAAC,MAAM;SACtB;QACD,QAAQ,EAAE,CAAC,GAAG,4BAAY,CAAC,MAAM,CAAC,QAAQ,EAAE,mBAAmB,EAAE,QAAQ,CAAC;KAC3E,CAAA;IAED,MAAM,eAAe,GAA+B,IAAA,8BAAiB,EAAC,SAAA,MAAM,CAAC,CAAA;IAChE,iBAAQ,GAA+B,CAClD,QAAa,EACS,EAAE,CACxB,eAAe,CAAC,QAAQ,CAAC;QACzB,4BAAY,CAAC,yBAAyB,CAAC,QAAQ,CAAC,YAAY,CAAC;QAC7D,4BAAY,CAAC,yBAAyB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;AAC1D,CAAC,EApBgB,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAoBxB"}
|
package/dist/schemas.d.ts
CHANGED
|
@@ -134,6 +134,30 @@ export declare namespace AvatarInfo {
|
|
|
134
134
|
const validate: ValidateFunction<AvatarInfo>;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
+
/** @alpha */
|
|
138
|
+
declare type BaseWearable = DisplayableDeployment & {
|
|
139
|
+
id: string;
|
|
140
|
+
descriptions: I18N[];
|
|
141
|
+
names: I18N[];
|
|
142
|
+
data: {
|
|
143
|
+
replaces: WearableCategory[];
|
|
144
|
+
hides: WearableCategory[];
|
|
145
|
+
tags: string[];
|
|
146
|
+
representations: WearableRepresentation[];
|
|
147
|
+
category: WearableCategory;
|
|
148
|
+
};
|
|
149
|
+
thumbnail: string;
|
|
150
|
+
image: string;
|
|
151
|
+
metrics?: Metrics;
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
/** @alpha */
|
|
155
|
+
declare namespace BaseWearable {
|
|
156
|
+
const schema: JSONSchema<BaseWearable>;
|
|
157
|
+
const validateDuplicatedLocales: (i18ns: I18N[]) => boolean;
|
|
158
|
+
const validate: ValidateFunction<BaseWearable>;
|
|
159
|
+
}
|
|
160
|
+
|
|
137
161
|
export declare type Bid = {
|
|
138
162
|
id: string;
|
|
139
163
|
bidAddress: string;
|
|
@@ -1025,6 +1049,18 @@ export declare namespace Store {
|
|
|
1025
1049
|
const validate: ValidateFunction<Store>;
|
|
1026
1050
|
}
|
|
1027
1051
|
|
|
1052
|
+
/** @alpha */
|
|
1053
|
+
export declare type TPWearable = BaseWearable & {
|
|
1054
|
+
content: Record<string, string>;
|
|
1055
|
+
merkleProof: MerkleProof;
|
|
1056
|
+
};
|
|
1057
|
+
|
|
1058
|
+
/** @alpha */
|
|
1059
|
+
export declare namespace TPWearable {
|
|
1060
|
+
const schema: JSONSchema<TPWearable>;
|
|
1061
|
+
const validate: ValidateFunction<TPWearable>;
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1028
1064
|
/** @public @deprecated */
|
|
1029
1065
|
declare const UPDATE = "update";
|
|
1030
1066
|
|
|
@@ -1068,22 +1104,9 @@ export declare type ValidWorldRange = {
|
|
|
1068
1104
|
};
|
|
1069
1105
|
|
|
1070
1106
|
/** @alpha */
|
|
1071
|
-
export declare type Wearable =
|
|
1072
|
-
id: string;
|
|
1073
|
-
descriptions: I18N[];
|
|
1074
|
-
collectionAddress: string;
|
|
1107
|
+
export declare type Wearable = BaseWearable & {
|
|
1075
1108
|
rarity: Rarity;
|
|
1076
|
-
|
|
1077
|
-
data: {
|
|
1078
|
-
replaces: WearableCategory[];
|
|
1079
|
-
hides: WearableCategory[];
|
|
1080
|
-
tags: string[];
|
|
1081
|
-
representations: WearableRepresentation[];
|
|
1082
|
-
category: WearableCategory;
|
|
1083
|
-
};
|
|
1084
|
-
thumbnail: string;
|
|
1085
|
-
image: string;
|
|
1086
|
-
metrics?: Metrics;
|
|
1109
|
+
collectionAddress: string;
|
|
1087
1110
|
};
|
|
1088
1111
|
|
|
1089
1112
|
/** @alpha */
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "3.10.
|
|
2
|
+
"version": "3.10.1-20220318140447.commit-5126641",
|
|
3
3
|
"name": "@dcl/schemas",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"typings": "./dist/index.d.ts",
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
"files": [
|
|
29
29
|
"dist"
|
|
30
30
|
],
|
|
31
|
-
"commit": "
|
|
31
|
+
"commit": "5126641989fc6b7f1dcd8b3535d4670942dc9f83"
|
|
32
32
|
}
|