@dcl/schemas 1.7.0 → 1.7.1-20210921181546.commit-b869b84

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/dist/index.d.ts CHANGED
@@ -15,4 +15,5 @@ export { Rarity } from './dapps/rarity';
15
15
  export { WearableCategory } from './dapps/wearable-category';
16
16
  export { World, ValidWorldRange, getWorld, isInsideWorldLimits, } from './dapps/world';
17
17
  export * from './platform';
18
+ export * from './misc';
18
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAA;AAG5B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACxE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC5D,OAAO,EACL,KAAK,EACL,eAAe,EACf,QAAQ,EACR,mBAAmB,GACpB,MAAM,eAAe,CAAA;AAEtB,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,cAAc,CAAA;AAG5B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACxE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC5D,OAAO,EACL,KAAK,EACL,eAAe,EACf,QAAQ,EACR,mBAAmB,GACpB,MAAM,eAAe,CAAA;AAEtB,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA"}
package/dist/index.js CHANGED
@@ -50,4 +50,5 @@ Object.defineProperty(exports, "World", { enumerable: true, get: function () { r
50
50
  Object.defineProperty(exports, "getWorld", { enumerable: true, get: function () { return world_1.getWorld; } });
51
51
  Object.defineProperty(exports, "isInsideWorldLimits", { enumerable: true, get: function () { return world_1.isInsideWorldLimits; } });
52
52
  __exportStar(require("./platform"), exports);
53
+ __exportStar(require("./misc"), exports);
53
54
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,+CAA4B;AAE5B,uBAAuB;AACvB,mCAAiC;AAAxB,0FAAA,GAAG,OAAA;AACZ,iDAA8C;AAArC,uGAAA,SAAS,OAAA;AAClB,6CAAwE;AAA/D,mGAAA,OAAO,OAAA;AAAE,wGAAA,YAAY,OAAA;AAAE,0GAAA,cAAc,OAAA;AAC9C,iDAA0D;AAAjD,uGAAA,SAAS,OAAA;AAAE,wGAAA,UAAU,OAAA;AAC9B,6CAA2C;AAAlC,oGAAA,QAAQ,OAAA;AACjB,qCAAmC;AAA1B,4FAAA,IAAI,OAAA;AACb,yDAAsD;AAA7C,+GAAA,aAAa,OAAA;AACtB,+DAA2D;AAAlD,oHAAA,eAAe,OAAA;AACxB,2CAAyC;AAAhC,kGAAA,OAAO,OAAA;AAChB,qDAAkD;AAAzC,2GAAA,WAAW,OAAA;AACpB,mCAAiC;AAAxB,0FAAA,GAAG,OAAA;AACZ,uCAAqC;AAA5B,8FAAA,KAAK,OAAA;AACd,yCAAuC;AAA9B,gGAAA,MAAM,OAAA;AACf,+DAA4D;AAAnD,qHAAA,gBAAgB,OAAA;AACzB,uCAKsB;AAJpB,8FAAA,KAAK,OAAA;AAEL,iGAAA,QAAQ,OAAA;AACR,4GAAA,mBAAmB,OAAA;AAGrB,6CAA0B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mBAAmB;AACnB,+CAA4B;AAE5B,uBAAuB;AACvB,mCAAiC;AAAxB,0FAAA,GAAG,OAAA;AACZ,iDAA8C;AAArC,uGAAA,SAAS,OAAA;AAClB,6CAAwE;AAA/D,mGAAA,OAAO,OAAA;AAAE,wGAAA,YAAY,OAAA;AAAE,0GAAA,cAAc,OAAA;AAC9C,iDAA0D;AAAjD,uGAAA,SAAS,OAAA;AAAE,wGAAA,UAAU,OAAA;AAC9B,6CAA2C;AAAlC,oGAAA,QAAQ,OAAA;AACjB,qCAAmC;AAA1B,4FAAA,IAAI,OAAA;AACb,yDAAsD;AAA7C,+GAAA,aAAa,OAAA;AACtB,+DAA2D;AAAlD,oHAAA,eAAe,OAAA;AACxB,2CAAyC;AAAhC,kGAAA,OAAO,OAAA;AAChB,qDAAkD;AAAzC,2GAAA,WAAW,OAAA;AACpB,mCAAiC;AAAxB,0FAAA,GAAG,OAAA;AACZ,uCAAqC;AAA5B,8FAAA,KAAK,OAAA;AACd,yCAAuC;AAA9B,gGAAA,MAAM,OAAA;AACf,+DAA4D;AAAnD,qHAAA,gBAAgB,OAAA;AACzB,uCAKsB;AAJpB,8FAAA,KAAK,OAAA;AAEL,iGAAA,QAAQ,OAAA;AACR,4GAAA,mBAAmB,OAAA;AAGrB,6CAA0B;AAC1B,yCAAsB"}
@@ -0,0 +1,36 @@
1
+ import { JSONSchema, ValidateFunction } from "..";
2
+ /**
3
+ * Color3 is a data type that describes a color using R, G and B components
4
+ * @alpha
5
+ */
6
+ export declare type Color3 = {
7
+ r: number;
8
+ g: number;
9
+ b: number;
10
+ };
11
+ /**
12
+ * Color3
13
+ * @alpha
14
+ */
15
+ export declare namespace Color3 {
16
+ const schema: JSONSchema<Color3>;
17
+ const validate: ValidateFunction<Color3>;
18
+ }
19
+ /**
20
+ * @alpha
21
+ */
22
+ export declare type WearableId = string;
23
+ /**
24
+ * EthAddress is a data type that describes an Ethereum address
25
+ * @alpha
26
+ */
27
+ export declare type EthAddress = string;
28
+ /**
29
+ * EthAddress
30
+ * @alpha
31
+ */
32
+ export declare namespace EthAddress {
33
+ const schema: JSONSchema<EthAddress>;
34
+ const validate: ValidateFunction<EthAddress>;
35
+ }
36
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/misc/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,UAAU,EAAE,gBAAgB,EAAE,MAAM,IAAI,CAAA;AAEpE;;;GAGG;AACH,oBAAY,MAAM,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAExD;;;GAGG;AACH,yBAAiB,MAAM,CAAC;IACf,MAAM,MAAM,EAAE,UAAU,CAAC,MAAM,CAoBrC,CAAA;IAEM,MAAM,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CACtB,CAAA;CACzB;AACD;;GAEG;AACH,oBAAY,UAAU,GAAG,MAAM,CAAA;AAE/B;;;GAGG;AACH,oBAAY,UAAU,GAAG,MAAM,CAAA;AAE/B;;;GAGG;AACH,yBAAiB,UAAU,CAAC;IACnB,MAAM,MAAM,EAAE,UAAU,CAAC,UAAU,CAGzC,CAAA;IAEM,MAAM,QAAQ,EAAE,gBAAgB,CAAC,UAAU,CACrB,CAAA;CAC9B"}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EthAddress = exports.Color3 = void 0;
4
+ const __1 = require("..");
5
+ /**
6
+ * Color3
7
+ * @alpha
8
+ */
9
+ var Color3;
10
+ (function (Color3) {
11
+ Color3.schema = {
12
+ type: 'object',
13
+ required: ['r', 'g', 'b'],
14
+ properties: {
15
+ r: {
16
+ type: 'number',
17
+ minimum: 0,
18
+ maximum: 1
19
+ },
20
+ g: {
21
+ type: 'number',
22
+ minimum: 0,
23
+ maximum: 1
24
+ },
25
+ b: {
26
+ type: 'number',
27
+ minimum: 0,
28
+ maximum: 1
29
+ },
30
+ }
31
+ };
32
+ const schemaValidator = __1.generateValidator(Color3.schema);
33
+ Color3.validate = (color) => schemaValidator(color);
34
+ })(Color3 = exports.Color3 || (exports.Color3 = {}));
35
+ /**
36
+ * EthAddress
37
+ * @alpha
38
+ */
39
+ var EthAddress;
40
+ (function (EthAddress) {
41
+ EthAddress.schema = {
42
+ type: 'string',
43
+ pattern: '^0x[a-fA-F0-9]{40}$'
44
+ };
45
+ const schemaValidator = __1.generateValidator(EthAddress.schema);
46
+ EthAddress.validate = (ethAddress) => schemaValidator(ethAddress);
47
+ })(EthAddress = exports.EthAddress || (exports.EthAddress = {}));
48
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/misc/index.ts"],"names":[],"mappings":";;;AAAA,0BAAoE;AAQpE;;;GAGG;AACH,IAAiB,MAAM,CAyBtB;AAzBD,WAAiB,MAAM;IACR,aAAM,GAAuB;QACxC,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;QACzB,UAAU,EAAE;YACV,CAAC,EAAE;gBACD,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,CAAC;gBACV,OAAO,EAAE,CAAC;aACX;YACD,CAAC,EAAE;gBACD,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,CAAC;gBACV,OAAO,EAAE,CAAC;aACX;YACD,CAAC,EAAE;gBACD,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,CAAC;gBACV,OAAO,EAAE,CAAC;aACX;SACF;KACF,CAAA;IACD,MAAM,eAAe,GAA6B,qBAAiB,CAAC,OAAA,MAAM,CAAC,CAAC;IAC/D,eAAQ,GAA6B,CAAC,KAAU,EAAmB,EAAE,CAChF,eAAe,CAAC,KAAK,CAAC,CAAA;AAC1B,CAAC,EAzBgB,MAAM,GAAN,cAAM,KAAN,cAAM,QAyBtB;AAYD;;;GAGG;AACH,IAAiB,UAAU,CAQ1B;AARD,WAAiB,UAAU;IACZ,iBAAM,GAA2B;QAC5C,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,qBAAqB;KAC/B,CAAA;IACD,MAAM,eAAe,GAAiC,qBAAiB,CAAC,WAAA,MAAM,CAAC,CAAC;IACnE,mBAAQ,GAAiC,CAAC,UAAe,EAA4B,EAAE,CAClG,eAAe,CAAC,UAAU,CAAC,CAAA;AAC/B,CAAC,EARgB,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAQ1B"}
@@ -1,3 +1,4 @@
1
+ export * from './profile';
1
2
  export * from './scene';
2
3
  export * from './wearables';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/platform/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/platform/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA"}
@@ -10,6 +10,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
10
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./profile"), exports);
13
14
  __exportStar(require("./scene"), exports);
14
15
  __exportStar(require("./wearables"), exports);
15
16
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/platform/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAAuB;AACvB,8CAA2B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/platform/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAAyB;AACzB,0CAAuB;AACvB,8CAA2B"}
@@ -0,0 +1,73 @@
1
+ import { Color3, EthAddress, WearableId } from "../../misc";
2
+ import { JSONSchema, ValidateFunction } from "../../validation";
3
+ /**
4
+ * Snapshots
5
+ * @alpha
6
+ */
7
+ export declare type Snapshots = {
8
+ face: string;
9
+ face256: string;
10
+ face128: string;
11
+ body: string;
12
+ };
13
+ /**
14
+ * Snapshots
15
+ * @alpha
16
+ */
17
+ export declare namespace Snapshots {
18
+ const schema: JSONSchema<Snapshots>;
19
+ const validate: ValidateFunction<Snapshots>;
20
+ }
21
+ /**
22
+ * AvatarInfo
23
+ * @alpha
24
+ */
25
+ export declare type AvatarInfo = {
26
+ bodyShape: WearableId;
27
+ eyes: {
28
+ color: Color3;
29
+ };
30
+ hair: {
31
+ color: Color3;
32
+ };
33
+ skin: {
34
+ color: Color3;
35
+ };
36
+ wearables: WearableId[];
37
+ snapshots: Snapshots;
38
+ };
39
+ /**
40
+ * AvatarInfo
41
+ * @alpha
42
+ */
43
+ export declare namespace AvatarInfo {
44
+ const schema: JSONSchema<AvatarInfo>;
45
+ const validate: ValidateFunction<AvatarInfo>;
46
+ }
47
+ /**
48
+ * Avatar represents a profile avatar
49
+ * @alpha
50
+ */
51
+ export declare type Avatar = {
52
+ userId: string;
53
+ name: string;
54
+ description: string;
55
+ ethAddress: EthAddress;
56
+ version: number;
57
+ tutorialStep: number;
58
+ email?: string;
59
+ blocked?: string[];
60
+ muted?: string[];
61
+ interests?: string[];
62
+ hasClaimedName: boolean;
63
+ avatar: AvatarInfo;
64
+ };
65
+ /**
66
+ * Avatar
67
+ * @alpha
68
+ */
69
+ export declare namespace Avatar {
70
+ const schema: JSONSchema<Avatar>;
71
+ const validate: ValidateFunction<Avatar>;
72
+ }
73
+ //# sourceMappingURL=avatar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"avatar.d.ts","sourceRoot":"","sources":["../../../src/platform/profile/avatar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC3D,OAAO,EAAqB,UAAU,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAElF;;;GAGG;AACH,oBAAY,S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A;AAED;;;GAGG;AACH,yBAAiB,MAAM,CAAC;IACf,MAAM,MAAM,EAAE,UAAU,CAAC,MAAM,CAoDrC,CAAA;IAEM,MAAM,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CACrB,CAAA;CAC1B"}
@@ -0,0 +1,142 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Avatar = exports.AvatarInfo = exports.Snapshots = void 0;
4
+ const misc_1 = require("../../misc");
5
+ const validation_1 = require("../../validation");
6
+ /**
7
+ * Snapshots
8
+ * @alpha
9
+ */
10
+ var Snapshots;
11
+ (function (Snapshots) {
12
+ Snapshots.schema = {
13
+ type: 'object',
14
+ required: ['face', 'face128', 'face256', 'body'],
15
+ properties: {
16
+ face: {
17
+ type: 'string'
18
+ },
19
+ face256: {
20
+ type: 'string'
21
+ },
22
+ face128: {
23
+ type: 'string'
24
+ },
25
+ body: {
26
+ type: 'string'
27
+ }
28
+ }
29
+ };
30
+ const schemaValidator = validation_1.generateValidator(Snapshots.schema);
31
+ Snapshots.validate = (snapshots) => schemaValidator(snapshots);
32
+ })(Snapshots = exports.Snapshots || (exports.Snapshots = {}));
33
+ /**
34
+ * AvatarInfo
35
+ * @alpha
36
+ */
37
+ var AvatarInfo;
38
+ (function (AvatarInfo) {
39
+ AvatarInfo.schema = {
40
+ type: 'object',
41
+ required: ['bodyShape', 'eyes', 'hair', 'skin'],
42
+ properties: {
43
+ bodyShape: {
44
+ type: 'string'
45
+ },
46
+ eyes: {
47
+ type: 'object',
48
+ required: ['color'],
49
+ properties: {
50
+ color: misc_1.Color3.schema
51
+ }
52
+ },
53
+ hair: {
54
+ type: 'object',
55
+ required: ['color'],
56
+ properties: {
57
+ color: misc_1.Color3.schema
58
+ }
59
+ },
60
+ skin: {
61
+ type: 'object',
62
+ required: ['color'],
63
+ properties: {
64
+ color: misc_1.Color3.schema
65
+ }
66
+ },
67
+ wearables: {
68
+ type: 'array',
69
+ items: {
70
+ type: 'string'
71
+ }
72
+ },
73
+ snapshots: Snapshots.schema
74
+ },
75
+ additionalProperties: true
76
+ };
77
+ const schemaValidator = validation_1.generateValidator(AvatarInfo.schema);
78
+ AvatarInfo.validate = (avatarInfo) => schemaValidator(avatarInfo);
79
+ })(AvatarInfo = exports.AvatarInfo || (exports.AvatarInfo = {}));
80
+ /**
81
+ * Avatar
82
+ * @alpha
83
+ */
84
+ var Avatar;
85
+ (function (Avatar) {
86
+ Avatar.schema = {
87
+ type: 'object',
88
+ required: ['name', 'description', 'ethAddress', 'version', 'tutorialStep', 'avatar'],
89
+ properties: {
90
+ userId: {
91
+ type: 'string'
92
+ },
93
+ name: {
94
+ type: 'string'
95
+ },
96
+ description: {
97
+ type: 'string'
98
+ },
99
+ ethAddress: misc_1.EthAddress.schema,
100
+ version: {
101
+ type: 'number'
102
+ },
103
+ tutorialStep: {
104
+ type: 'number'
105
+ },
106
+ email: {
107
+ type: 'string',
108
+ nullable: true
109
+ },
110
+ blocked: {
111
+ type: 'array',
112
+ items: {
113
+ type: 'string'
114
+ },
115
+ nullable: true
116
+ },
117
+ muted: {
118
+ type: 'array',
119
+ items: {
120
+ type: 'string'
121
+ },
122
+ nullable: true
123
+ },
124
+ interests: {
125
+ type: 'array',
126
+ items: {
127
+ type: 'string'
128
+ },
129
+ nullable: true
130
+ },
131
+ hasClaimedName: {
132
+ type: 'boolean',
133
+ nullable: true
134
+ },
135
+ avatar: AvatarInfo.schema,
136
+ },
137
+ additionalProperties: true,
138
+ };
139
+ const schemaValidator = validation_1.generateValidator(Avatar.schema);
140
+ Avatar.validate = (avatar) => schemaValidator(avatar);
141
+ })(Avatar = exports.Avatar || (exports.Avatar = {}));
142
+ //# sourceMappingURL=avatar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"avatar.js","sourceRoot":"","sources":["../../../src/platform/profile/avatar.ts"],"names":[],"mappings":";;;AAAA,qCAA2D;AAC3D,iDAAkF;AAalF;;;GAGG;AACH,IAAiB,SAAS,CAsBzB;AAt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AAE;gBACT,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;iBACf;gBACD,QAAQ,EAAE,IAAI;aACf;YACD,cAAc,EAAE;gBACd,IAAI,EAAE,SAAS;gBACf,QAAQ,EAAE,IAAI;aACf;YACD,MAAM,EAAE,UAAU,CAAC,MAAM;SAC1B;QACD,oBAAoB,EAAE,IAAI;KAC3B,CAAA;IACD,MAAM,eAAe,GAA6B,8BAAiB,CAAC,OAAA,MAAM,CAAC,CAAC;IAC/D,eAAQ,GAA6B,CAAC,MAAW,EAAoB,EAAE,CAClF,eAAe,CAAC,MAAM,CAAC,CAAA;AAC3B,CAAC,EAzDgB,MAAM,GAAN,cAAM,KAAN,cAAM,QAyDtB"}
@@ -0,0 +1,3 @@
1
+ export * from './avatar';
2
+ export * from './profile';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/platform/profile/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ __exportStar(require("./avatar"), exports);
14
+ __exportStar(require("./profile"), exports);
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/platform/profile/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAwB;AACxB,4CAAyB"}
@@ -0,0 +1,18 @@
1
+ import { JSONSchema, ValidateFunction } from "../../validation";
2
+ import { Avatar } from "./avatar";
3
+ /**
4
+ * Profile containing one or multiple avatars
5
+ * @alpha
6
+ */
7
+ export declare type Profile = {
8
+ avatars: Avatar[];
9
+ };
10
+ /**
11
+ * Profile
12
+ * @alpha
13
+ */
14
+ export declare namespace Profile {
15
+ const schema: JSONSchema<Profile>;
16
+ const validate: ValidateFunction<Profile>;
17
+ }
18
+ //# sourceMappingURL=profile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../../src/platform/profile/profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,UAAU,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAClF,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC;;;GAGG;AACH,oBAAY,OAAO,GAAG;IACpB,OAAO,EAAE,MAAM,EAAE,CAAA;CAClB,CAAA;AAED;;;GAGG;AACH,yBAAiB,OAAO,CAAC;IAChB,MAAM,MAAM,EAAE,UAAU,CAAC,OAAO,CAUtC,CAAA;IAEM,MAAM,QAAQ,EAAE,gBAAgB,CAAC,OAAO,CACrB,CAAA;CAC3B"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Profile = void 0;
4
+ const validation_1 = require("../../validation");
5
+ const avatar_1 = require("./avatar");
6
+ /**
7
+ * Profile
8
+ * @alpha
9
+ */
10
+ var Profile;
11
+ (function (Profile) {
12
+ Profile.schema = {
13
+ type: 'object',
14
+ required: ['avatars'],
15
+ properties: {
16
+ avatars: {
17
+ type: 'array',
18
+ items: avatar_1.Avatar.schema
19
+ }
20
+ },
21
+ additionalProperties: true
22
+ };
23
+ const schemaValidator = validation_1.generateValidator(Profile.schema);
24
+ Profile.validate = (profile) => schemaValidator(profile);
25
+ })(Profile = exports.Profile || (exports.Profile = {}));
26
+ //# sourceMappingURL=profile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile.js","sourceRoot":"","sources":["../../../src/platform/profile/profile.ts"],"names":[],"mappings":";;;AAAA,iDAAkF;AAClF,qCAAkC;AAUlC;;;GAGG;AACH,IAAiB,OAAO,CAevB;AAfD,WAAiB,OAAO;IACT,cAAM,GAAwB;QACzC,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,CAAC,SAAS,CAAC;QACrB,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,eAAM,CAAC,MAAM;aACrB;SACF;QACD,oBAAoB,EAAE,IAAI;KAC3B,CAAA;IACD,MAAM,eAAe,GAA8B,8BAAiB,CAAC,QAAA,MAAM,CAAC,CAAC;IAChE,gBAAQ,GAA8B,CAAC,OAAY,EAAsB,EAAE,CACtF,eAAe,CAAC,OAAO,CAAC,CAAA;AAC5B,CAAC,EAfgB,OAAO,GAAP,eAAO,KAAP,eAAO,QAevB"}
package/dist/schemas.d.ts CHANGED
@@ -12,6 +12,62 @@ export declare type AbstractTypedSchema<T> = {
12
12
  };
13
13
  export { Ajv }
14
14
 
15
+ /**
16
+ * Avatar represents a profile avatar
17
+ * @alpha
18
+ */
19
+ export declare type Avatar = {
20
+ userId: string;
21
+ name: string;
22
+ description: string;
23
+ ethAddress: EthAddress;
24
+ version: number;
25
+ tutorialStep: number;
26
+ email?: string;
27
+ blocked?: string[];
28
+ muted?: string[];
29
+ interests?: string[];
30
+ hasClaimedName: boolean;
31
+ avatar: AvatarInfo;
32
+ };
33
+
34
+ /**
35
+ * Avatar
36
+ * @alpha
37
+ */
38
+ export declare namespace Avatar {
39
+ const schema: JSONSchema<Avatar>;
40
+ const validate: ValidateFunction<Avatar>;
41
+ }
42
+
43
+ /**
44
+ * AvatarInfo
45
+ * @alpha
46
+ */
47
+ export declare type AvatarInfo = {
48
+ bodyShape: WearableId;
49
+ eyes: {
50
+ color: Color3;
51
+ };
52
+ hair: {
53
+ color: Color3;
54
+ };
55
+ skin: {
56
+ color: Color3;
57
+ };
58
+ wearables: WearableId[];
59
+ snapshots: Snapshots;
60
+ };
61
+
62
+ /**
63
+ * AvatarInfo
64
+ * @alpha
65
+ */
66
+ export declare namespace AvatarInfo {
67
+ const schema: JSONSchema<AvatarInfo>;
68
+ const validate: ValidateFunction<AvatarInfo>;
69
+ }
70
+
15
71
  export declare type Bid = {
16
72
  id: string;
17
73
  bidder: string;
@@ -89,6 +145,25 @@ export declare namespace ChainName {
89
145
  const validate: ValidateFunction<ChainName>;
90
146
  }
91
147
 
148
+ /**
149
+ * Color3 is a data type that describes a color using R, G and B components
150
+ * @alpha
151
+ */
152
+ export declare type Color3 = {
153
+ r: number;
154
+ g: number;
155
+ b: number;
156
+ };
157
+
158
+ /**
159
+ * Color3
160
+ * @alpha
161
+ */
162
+ export declare namespace Color3 {
163
+ const schema: JSONSchema<Color3>;
164
+ const validate: ValidateFunction<Color3>;
165
+ }
166
+
92
167
  export declare type Contract = {
93
168
  name: string;
94
169
  address: string;
@@ -102,6 +177,21 @@ export declare namespace Contract {
102
177
  const validate: ValidateFunction<Contract>;
103
178
  }
104
179
 
180
+ /**
181
+ * EthAddress is a data type that describes an Ethereum address
182
+ * @alpha
183
+ */
184
+ export declare type EthAddress = string;
185
+
186
+ /**
187
+ * EthAddress
188
+ * @alpha
189
+ */
190
+ export declare namespace EthAddress {
191
+ const schema: JSONSchema<EthAddress>;
192
+ const validate: ValidateFunction<EthAddress>;
193
+ }
194
+
105
195
  /** @alpha */
106
196
  export declare type FeatureToggles = Record<string, "enabled" | "disabled">;
107
197
 
@@ -353,6 +443,23 @@ export declare namespace Order {
353
443
  const validate: ValidateFunction<Order>;
354
444
  }
355
445
 
446
+ /**
447
+ * Profile containing one or multiple avatars
448
+ * @alpha
449
+ */
450
+ export declare type Profile = {
451
+ avatars: Avatar[];
452
+ };
453
+
454
+ /**
455
+ * Profile
456
+ * @alpha
457
+ */
458
+ export declare namespace Profile {
459
+ const schema: JSONSchema<Profile>;
460
+ const validate: ValidateFunction<Profile>;
461
+ }
462
+
356
463
  export declare enum Rarity {
357
464
  UNIQUE = "unique",
358
465
  MYTHIC = "mythic",
@@ -420,6 +527,26 @@ declare type SinglePosition = {
420
527
  z: number;
421
528
  };
422
529
 
530
+ /**
531
+ * Snapshots
532
+ * @alpha
533
+ */
534
+ export declare type Snapshots = {
535
+ face: string;
536
+ face256: string;
537
+ face128: string;
538
+ body: string;
539
+ };
540
+
541
+ /**
542
+ * Snapshots
543
+ * @alpha
544
+ */
545
+ export declare namespace Snapshots {
546
+ const schema: JSONSchema<Snapshots>;
547
+ const validate: ValidateFunction<Snapshots>;
548
+ }
549
+
423
550
  /** @alpha */
424
551
  export declare type Source = {
425
552
  version?: number;
@@ -545,6 +672,11 @@ export declare namespace WearableCategory {
545
672
  const validate: ValidateFunction<WearableCategory>;
546
673
  }
547
674
 
675
+ /**
676
+ * @alpha
677
+ */
678
+ export declare type WearableId = string;
679
+
548
680
  /** @alpha */
549
681
  export declare type WearableRepresentation = {
550
682
  bodyShapes: WearableBodyShape[];
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.7.0",
2
+ "version": "1.7.1-20210921181546.commit-b869b84",
3
3
  "name": "@dcl/schemas",
4
4
  "main": "./dist/index.js",
5
5
  "typings": "./dist/index.d.ts",
@@ -25,5 +25,5 @@
25
25
  "files": [
26
26
  "dist"
27
27
  ],
28
- "commit": "88d0da77339bc06a4385be4fd9f9ea4fbd8f2b48"
28
+ "commit": "b869b841f3efb64f3f16a46d452860e16720cf79"
29
29
  }