@dcl/schemas 16.1.0 → 16.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/index.d.ts +3 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +19 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/parcel-exceptions.d.ts +13 -0
- package/dist/core/parcel-exceptions.d.ts.map +1 -0
- package/dist/core/parcel-exceptions.js +67 -0
- package/dist/core/parcel-exceptions.js.map +1 -0
- package/dist/core/parcel-validation.d.ts +59 -0
- package/dist/core/parcel-validation.d.ts.map +1 -0
- package/dist/core/parcel-validation.js +116 -0
- package/dist/core/parcel-validation.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/schemas.d.ts +72 -0
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./parcel-validation"), exports);
|
|
18
|
+
__exportStar(require("./parcel-exceptions"), exports);
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAmC;AACnC,sDAAmC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Known exceptions of parcels that are outside the standard limits
|
|
3
|
+
* but are valid in Decentraland
|
|
4
|
+
* @internal
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Checks if a coordinate is in any exception block
|
|
8
|
+
* @param x X coordinate of the parcel
|
|
9
|
+
* @param y Y coordinate of the parcel
|
|
10
|
+
* @returns true if the parcel is in any exception block
|
|
11
|
+
*/
|
|
12
|
+
export declare function isInExceptionBlock(x: number, y: number): boolean;
|
|
13
|
+
//# sourceMappingURL=parcel-exceptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parcel-exceptions.d.ts","sourceRoot":"","sources":["../../src/core/parcel-exceptions.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAqDH;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAEhE"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Known exceptions of parcels that are outside the standard limits
|
|
4
|
+
* but are valid in Decentraland
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.isInExceptionBlock = void 0;
|
|
9
|
+
/**
|
|
10
|
+
* Block 1: Northern border (X=62-150, Y=151-158)
|
|
11
|
+
*
|
|
12
|
+
* Simplified to a rectangular region:
|
|
13
|
+
*
|
|
14
|
+
* X=62 to X=150
|
|
15
|
+
* ↓ ↓
|
|
16
|
+
* Y=158 → █ █ █ █...█ █ █ █
|
|
17
|
+
* Y=... → █ █ █ █...█ █ █ █
|
|
18
|
+
* Y=152 → █ █ █ █...█ █ █ █
|
|
19
|
+
* Y=151 → █ █ █ █...█ █ █ █
|
|
20
|
+
*/
|
|
21
|
+
function isInBlock1(x, y) {
|
|
22
|
+
// Simplified to a single rectangle X=62-150, Y=151-158
|
|
23
|
+
return x >= 62 && x <= 150 && y >= 151 && y <= 158;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Block 2: Northeastern region (X=151-162, Y=144-158)
|
|
27
|
+
*
|
|
28
|
+
* Simplified to a rectangular region:
|
|
29
|
+
*
|
|
30
|
+
* X=151 to X=162
|
|
31
|
+
* ↓ ↓
|
|
32
|
+
* Y=158 → █ █ █ █...█ █ █ █
|
|
33
|
+
* Y=... → █ █ █ █...█ █ █ █
|
|
34
|
+
* Y=145 → █ █ █ █...█ █ █ █
|
|
35
|
+
* Y=144 → █ █ █ █...█ █ █ █
|
|
36
|
+
*/
|
|
37
|
+
function isInBlock2(x, y) {
|
|
38
|
+
// Simplified to a single rectangle X=151-162, Y=144-158
|
|
39
|
+
return x >= 151 && x <= 162 && y >= 144 && y <= 158;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Block 3: Eastern border (X=151-163, Y=59-143)
|
|
43
|
+
*
|
|
44
|
+
* Simplified to a rectangular region:
|
|
45
|
+
*
|
|
46
|
+
* X=151 to X=163
|
|
47
|
+
* ↓ ↓
|
|
48
|
+
* Y=143 → █ █ █ █...█ █ █ █
|
|
49
|
+
* Y=... → █ █ █ █...█ █ █ █
|
|
50
|
+
* Y=60 → █ █ █ █...█ █ █ █
|
|
51
|
+
* Y=59 → █ █ █ █...█ █ █ █
|
|
52
|
+
*/
|
|
53
|
+
function isInBlock3(x, y) {
|
|
54
|
+
// Simplified to a single rectangle X=151-163, Y=59-143
|
|
55
|
+
return x >= 151 && x <= 163 && y >= 59 && y <= 143;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Checks if a coordinate is in any exception block
|
|
59
|
+
* @param x X coordinate of the parcel
|
|
60
|
+
* @param y Y coordinate of the parcel
|
|
61
|
+
* @returns true if the parcel is in any exception block
|
|
62
|
+
*/
|
|
63
|
+
function isInExceptionBlock(x, y) {
|
|
64
|
+
return isInBlock1(x, y) || isInBlock2(x, y) || isInBlock3(x, y);
|
|
65
|
+
}
|
|
66
|
+
exports.isInExceptionBlock = isInExceptionBlock;
|
|
67
|
+
//# sourceMappingURL=parcel-exceptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parcel-exceptions.js","sourceRoot":"","sources":["../../src/core/parcel-exceptions.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH;;;;;;;;;;;GAWG;AACH,SAAS,UAAU,CAAC,CAAS,EAAE,CAAS;IACtC,uDAAuD;IACvD,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,CAAA;AACpD,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAS,UAAU,CAAC,CAAS,EAAE,CAAS;IACtC,wDAAwD;IACxD,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,CAAA;AACrD,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAS,UAAU,CAAC,CAAS,EAAE,CAAS;IACtC,uDAAuD;IACvD,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,GAAG,CAAA;AACpD,CAAC;AAED;;;;;GAKG;AACH,SAAgB,kBAAkB,CAAC,CAAS,EAAE,CAAS;IACrD,OAAO,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AACjE,CAAC;AAFD,gDAEC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { JSONSchema, ValidateFunction } from '../validation';
|
|
2
|
+
import { KeywordDefinition } from 'ajv';
|
|
3
|
+
/**
|
|
4
|
+
* Represents a parcel with X and Y coordinates
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export type Parcel = {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Standard limits for parcels in Decentraland
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export declare const PARCEL_LIMITS: {
|
|
16
|
+
minX: number;
|
|
17
|
+
maxX: number;
|
|
18
|
+
minY: number;
|
|
19
|
+
maxY: number;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Namespace with utilities to validate parcels
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
export declare namespace Parcel {
|
|
26
|
+
/**
|
|
27
|
+
* Custom validation to check if coordinates are within limits
|
|
28
|
+
*/
|
|
29
|
+
const _isInLimits: KeywordDefinition;
|
|
30
|
+
const schema: JSONSchema<Parcel>;
|
|
31
|
+
const validate: ValidateFunction<Parcel>;
|
|
32
|
+
function parcelToString({ x, y }: Parcel): string;
|
|
33
|
+
function stringToParcel(position: string): Parcel | null;
|
|
34
|
+
/**
|
|
35
|
+
* Validates if a string in "x,y" format represents a valid parcel
|
|
36
|
+
*/
|
|
37
|
+
function isParcelStringValid(parcelString: string): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Checks if a parcel is within the standard bounds
|
|
40
|
+
*/
|
|
41
|
+
function isInStandardBounds(parcel: Parcel): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Checks if a parcel is a known exception
|
|
44
|
+
*/
|
|
45
|
+
function isExceptionParcel(parcel: Parcel): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Checks if a parcel is within bounds or is a valid exception
|
|
48
|
+
*/
|
|
49
|
+
function isInBounds(parcel: Parcel): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Validates if a parcel is valid (satisfies the schema and is within bounds or is an exception)
|
|
52
|
+
*/
|
|
53
|
+
function isValid(parcel: Parcel): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Validates if a parcel in string format is valid
|
|
56
|
+
*/
|
|
57
|
+
function isValidString(parcelString: string): boolean;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=parcel-validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parcel-validation.d.ts","sourceRoot":"","sources":["../../src/core/parcel-validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,UAAU,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAEnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,KAAK,CAAA;AAEvC;;;GAGG;AACH,MAAM,MAAM,MAAM,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAE7C;;;GAGG;AACH,eAAO,MAAM,aAAa;;;;;CAKzB,CAAA;AAED;;;GAGG;AACH,yBAAiB,MAAM,CAAC;IACtB;;OAEG;IACI,MAAM,WAAW,EAAE,iBAUzB,CAAA;IAEM,MAAM,MAAM,oBAaI,CAAA;IAEhB,MAAM,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CAAgD,CAAA;IAG9F,SAAgB,cAAc,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAEvD;IAGD,SAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAS9D;IAED;;OAEG;IACH,SAAgB,mBAAmB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAIjE;IAED;;OAEG;IACH,SAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAG1D;IAED;;OAEG;IACH,SAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEzD;IAED;;OAEG;IACH,SAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAElD;IAED;;OAEG;IACH,SAAgB,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE/C;IAED;;OAEG;IACH,SAAgB,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAI3D;CACF"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Parcel = exports.PARCEL_LIMITS = void 0;
|
|
4
|
+
const validation_1 = require("../validation");
|
|
5
|
+
const parcel_exceptions_1 = require("./parcel-exceptions");
|
|
6
|
+
/**
|
|
7
|
+
* Standard limits for parcels in Decentraland
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
exports.PARCEL_LIMITS = {
|
|
11
|
+
minX: -150,
|
|
12
|
+
maxX: 150,
|
|
13
|
+
minY: -150,
|
|
14
|
+
maxY: 150
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Namespace with utilities to validate parcels
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
var Parcel;
|
|
21
|
+
(function (Parcel) {
|
|
22
|
+
/**
|
|
23
|
+
* Custom validation to check if coordinates are within limits
|
|
24
|
+
*/
|
|
25
|
+
Parcel._isInLimits = {
|
|
26
|
+
keyword: '_isInLimits',
|
|
27
|
+
validate: function validate(schema, data) {
|
|
28
|
+
if (!data || typeof data.x !== 'number' || typeof data.y !== 'number') {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
return isInStandardBounds(data) || (0, parcel_exceptions_1.isInExceptionBlock)(data.x, data.y);
|
|
32
|
+
},
|
|
33
|
+
errors: false
|
|
34
|
+
};
|
|
35
|
+
Parcel.schema = {
|
|
36
|
+
type: 'object',
|
|
37
|
+
required: ['x', 'y'],
|
|
38
|
+
properties: {
|
|
39
|
+
x: {
|
|
40
|
+
type: 'number'
|
|
41
|
+
},
|
|
42
|
+
y: {
|
|
43
|
+
type: 'number'
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
_isInLimits: true,
|
|
47
|
+
additionalProperties: false
|
|
48
|
+
};
|
|
49
|
+
Parcel.validate = (0, validation_1.generateLazyValidator)(Parcel.schema, [Parcel._isInLimits]);
|
|
50
|
+
// Converts coordinates to string in "x,y" format
|
|
51
|
+
function parcelToString({ x, y }) {
|
|
52
|
+
return `${x},${y}`;
|
|
53
|
+
}
|
|
54
|
+
Parcel.parcelToString = parcelToString;
|
|
55
|
+
// Converts a string in "x,y" format to a Parcel object
|
|
56
|
+
function stringToParcel(position) {
|
|
57
|
+
const match = position.match(/^(-?\d+),(-?\d+)$/);
|
|
58
|
+
if (!match)
|
|
59
|
+
return null;
|
|
60
|
+
const [, xStr, yStr] = match;
|
|
61
|
+
const x = parseInt(xStr, 10);
|
|
62
|
+
const y = parseInt(yStr, 10);
|
|
63
|
+
return { x, y };
|
|
64
|
+
}
|
|
65
|
+
Parcel.stringToParcel = stringToParcel;
|
|
66
|
+
/**
|
|
67
|
+
* Validates if a string in "x,y" format represents a valid parcel
|
|
68
|
+
*/
|
|
69
|
+
function isParcelStringValid(parcelString) {
|
|
70
|
+
const parcel = stringToParcel(parcelString);
|
|
71
|
+
if (!parcel)
|
|
72
|
+
return false;
|
|
73
|
+
return Parcel.validate(parcel);
|
|
74
|
+
}
|
|
75
|
+
Parcel.isParcelStringValid = isParcelStringValid;
|
|
76
|
+
/**
|
|
77
|
+
* Checks if a parcel is within the standard bounds
|
|
78
|
+
*/
|
|
79
|
+
function isInStandardBounds(parcel) {
|
|
80
|
+
const { x, y } = parcel;
|
|
81
|
+
return x >= exports.PARCEL_LIMITS.minX && x <= exports.PARCEL_LIMITS.maxX && y >= exports.PARCEL_LIMITS.minY && y <= exports.PARCEL_LIMITS.maxY;
|
|
82
|
+
}
|
|
83
|
+
Parcel.isInStandardBounds = isInStandardBounds;
|
|
84
|
+
/**
|
|
85
|
+
* Checks if a parcel is a known exception
|
|
86
|
+
*/
|
|
87
|
+
function isExceptionParcel(parcel) {
|
|
88
|
+
return (0, parcel_exceptions_1.isInExceptionBlock)(parcel.x, parcel.y);
|
|
89
|
+
}
|
|
90
|
+
Parcel.isExceptionParcel = isExceptionParcel;
|
|
91
|
+
/**
|
|
92
|
+
* Checks if a parcel is within bounds or is a valid exception
|
|
93
|
+
*/
|
|
94
|
+
function isInBounds(parcel) {
|
|
95
|
+
return isInStandardBounds(parcel) || isExceptionParcel(parcel);
|
|
96
|
+
}
|
|
97
|
+
Parcel.isInBounds = isInBounds;
|
|
98
|
+
/**
|
|
99
|
+
* Validates if a parcel is valid (satisfies the schema and is within bounds or is an exception)
|
|
100
|
+
*/
|
|
101
|
+
function isValid(parcel) {
|
|
102
|
+
return Parcel.validate(parcel);
|
|
103
|
+
}
|
|
104
|
+
Parcel.isValid = isValid;
|
|
105
|
+
/**
|
|
106
|
+
* Validates if a parcel in string format is valid
|
|
107
|
+
*/
|
|
108
|
+
function isValidString(parcelString) {
|
|
109
|
+
const parcel = stringToParcel(parcelString);
|
|
110
|
+
if (!parcel)
|
|
111
|
+
return false;
|
|
112
|
+
return Parcel.validate(parcel);
|
|
113
|
+
}
|
|
114
|
+
Parcel.isValidString = isValidString;
|
|
115
|
+
})(Parcel = exports.Parcel || (exports.Parcel = {}));
|
|
116
|
+
//# sourceMappingURL=parcel-validation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parcel-validation.js","sourceRoot":"","sources":["../../src/core/parcel-validation.ts"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AC,IAAI,iBAAiB,CAAC,MAAM,CAAC,CAAA;IAChE,CAAC;IAFe,iBAAU,aAEzB,CAAA;IAED;;OAEG;IACH,SAAgB,OAAO,CAAC,MAAc;QACpC,OAAO,OAAA,QAAQ,CAAC,MAAM,CAAC,CAAA;IACzB,CAAC;IAFe,cAAO,UAEtB,CAAA;IAED;;OAEG;IACH,SAAgB,aAAa,CAAC,YAAoB;QAChD,MAAM,MAAM,GAAG,cAAc,CAAC,YAAY,CAAC,CAAA;QAC3C,IAAI,CAAC,MAAM;YAAE,OAAO,KAAK,CAAA;QACzB,OAAO,OAAA,QAAQ,CAAC,MAAM,CAAC,CAAA;IACzB,CAAC;IAJe,oBAAa,gBAI5B,CAAA;AACH,CAAC,EAhGgB,MAAM,GAAN,cAAM,KAAN,cAAM,QAgGtB"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,OAAO,CAAA;AAG5B,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,6BAA6B,CAAA;AAC3C,cAAc,mBAAmB,CAAA;AACjC,cAAc,wBAAwB,CAAA;AACtC,cAAc,cAAc,CAAA;AAC5B,OAAO,EAAE,GAAG,EAAE,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,OAAO,CAAA;AAG5B,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,6BAA6B,CAAA;AAC3C,cAAc,mBAAmB,CAAA;AACjC,cAAc,wBAAwB,CAAA;AACtC,cAAc,cAAc,CAAA;AAC5B,cAAc,QAAQ,CAAA;AACtB,OAAO,EAAE,GAAG,EAAE,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -38,4 +38,5 @@ __exportStar(require("./misc/linker-authorization"), exports);
|
|
|
38
38
|
__exportStar(require("./misc/auth-chain"), exports);
|
|
39
39
|
__exportStar(require("./misc/content-mapping"), exports);
|
|
40
40
|
__exportStar(require("./misc/email"), exports);
|
|
41
|
+
__exportStar(require("./core"), exports);
|
|
41
42
|
//# 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,2CAA4B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA4B;AAYnB,kBAAG;AAVZ,mBAAmB;AACnB,+CAA4B;AAC5B,0CAAuB;AACvB,6CAA0B;AAC1B,yCAAsB;AACtB,8DAA2C;AAC3C,oDAAiC;AACjC,yDAAsC;AACtC,+CAA4B;AAC5B,yCAAsB"}
|
package/dist/schemas.d.ts
CHANGED
|
@@ -1287,6 +1287,19 @@ export declare interface ISceneController {
|
|
|
1287
1287
|
}): Promise<void>;
|
|
1288
1288
|
}
|
|
1289
1289
|
|
|
1290
|
+
/**
|
|
1291
|
+
* Known exceptions of parcels that are outside the standard limits
|
|
1292
|
+
* but are valid in Decentraland
|
|
1293
|
+
* @internal
|
|
1294
|
+
*/
|
|
1295
|
+
/**
|
|
1296
|
+
* Checks if a coordinate is in any exception block
|
|
1297
|
+
* @param x X coordinate of the parcel
|
|
1298
|
+
* @param y Y coordinate of the parcel
|
|
1299
|
+
* @returns true if the parcel is in any exception block
|
|
1300
|
+
*/
|
|
1301
|
+
export declare function isInExceptionBlock(x: number, y: number): boolean;
|
|
1302
|
+
|
|
1290
1303
|
/**
|
|
1291
1304
|
* Check if is inside World Limits
|
|
1292
1305
|
* @alpha
|
|
@@ -2080,6 +2093,65 @@ export declare type PaginatedResponse<T> = {
|
|
|
2080
2093
|
limit: number;
|
|
2081
2094
|
};
|
|
2082
2095
|
|
|
2096
|
+
/**
|
|
2097
|
+
* Represents a parcel with X and Y coordinates
|
|
2098
|
+
* @public
|
|
2099
|
+
*/
|
|
2100
|
+
export declare type Parcel = {
|
|
2101
|
+
x: number;
|
|
2102
|
+
y: number;
|
|
2103
|
+
};
|
|
2104
|
+
|
|
2105
|
+
/**
|
|
2106
|
+
* Namespace with utilities to validate parcels
|
|
2107
|
+
* @public
|
|
2108
|
+
*/
|
|
2109
|
+
export declare namespace Parcel {
|
|
2110
|
+
/**
|
|
2111
|
+
* Custom validation to check if coordinates are within limits
|
|
2112
|
+
*/
|
|
2113
|
+
const _isInLimits: KeywordDefinition;
|
|
2114
|
+
const schema: JSONSchema<Parcel>;
|
|
2115
|
+
const validate: ValidateFunction<Parcel>;
|
|
2116
|
+
export function parcelToString({ x, y }: Parcel): string;
|
|
2117
|
+
export function stringToParcel(position: string): Parcel | null;
|
|
2118
|
+
/**
|
|
2119
|
+
* Validates if a string in "x,y" format represents a valid parcel
|
|
2120
|
+
*/
|
|
2121
|
+
export function isParcelStringValid(parcelString: string): boolean;
|
|
2122
|
+
/**
|
|
2123
|
+
* Checks if a parcel is within the standard bounds
|
|
2124
|
+
*/
|
|
2125
|
+
export function isInStandardBounds(parcel: Parcel): boolean;
|
|
2126
|
+
/**
|
|
2127
|
+
* Checks if a parcel is a known exception
|
|
2128
|
+
*/
|
|
2129
|
+
export function isExceptionParcel(parcel: Parcel): boolean;
|
|
2130
|
+
/**
|
|
2131
|
+
* Checks if a parcel is within bounds or is a valid exception
|
|
2132
|
+
*/
|
|
2133
|
+
export function isInBounds(parcel: Parcel): boolean;
|
|
2134
|
+
/**
|
|
2135
|
+
* Validates if a parcel is valid (satisfies the schema and is within bounds or is an exception)
|
|
2136
|
+
*/
|
|
2137
|
+
export function isValid(parcel: Parcel): boolean;
|
|
2138
|
+
/**
|
|
2139
|
+
* Validates if a parcel in string format is valid
|
|
2140
|
+
*/
|
|
2141
|
+
export function isValidString(parcelString: string): boolean;
|
|
2142
|
+
}
|
|
2143
|
+
|
|
2144
|
+
/**
|
|
2145
|
+
* Standard limits for parcels in Decentraland
|
|
2146
|
+
* @public
|
|
2147
|
+
*/
|
|
2148
|
+
export declare const PARCEL_LIMITS: {
|
|
2149
|
+
minX: number;
|
|
2150
|
+
maxX: number;
|
|
2151
|
+
minY: number;
|
|
2152
|
+
maxY: number;
|
|
2153
|
+
};
|
|
2154
|
+
|
|
2083
2155
|
export declare type PassportOpenedEvent = BaseEvent & {
|
|
2084
2156
|
type: Events.Type.CLIENT;
|
|
2085
2157
|
subType: Events.SubType.Client.PASSPORT_OPENED;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "16.
|
|
2
|
+
"version": "16.2.0",
|
|
3
3
|
"name": "@dcl/schemas",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"typings": "./dist/index.d.ts",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"files": [
|
|
46
46
|
"dist"
|
|
47
47
|
],
|
|
48
|
-
"commit": "
|
|
48
|
+
"commit": "fa10573b10debb68e419af2650652f6eb4b856df"
|
|
49
49
|
}
|