@map-colonies/mc-utils 1.3.0 → 1.4.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/README.md +67 -67
- package/dist/arrays/index.d.ts +2 -0
- package/dist/arrays/index.d.ts.map +1 -0
- package/dist/arrays/index.js +14 -0
- package/dist/arrays/index.js.map +1 -0
- package/dist/arrays/subGroups.d.ts +9 -0
- package/dist/arrays/subGroups.d.ts.map +1 -0
- package/dist/arrays/subGroups.js +139 -0
- package/dist/arrays/subGroups.js.map +1 -0
- package/dist/geo/geoIntersection.d.ts +13 -0
- package/dist/geo/geoIntersection.d.ts.map +1 -0
- package/dist/geo/geoIntersection.js +28 -0
- package/dist/geo/geoIntersection.js.map +1 -0
- package/dist/geo/index.d.ts +4 -1
- package/dist/geo/index.d.ts.map +1 -1
- package/dist/geo/index.js +4 -1
- package/dist/geo/index.js.map +1 -1
- package/dist/geo/tileBatcher.d.ts +9 -0
- package/dist/geo/tileBatcher.d.ts.map +1 -0
- package/dist/geo/tileBatcher.js +168 -0
- package/dist/geo/tileBatcher.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/package.json +76 -76
- package/CHANGELOG.md +0 -49
package/README.md
CHANGED
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
# mc-utils
|
|
2
|
-
this is general utilities for usage in Map Colonies project.
|
|
3
|
-
|
|
4
|
-
# included components
|
|
5
|
-
- [http client](#http-client)
|
|
6
|
-
|
|
7
|
-
# usage
|
|
8
|
-
## http client
|
|
9
|
-
this is abstract base class for sending http request with logging and request retries.
|
|
10
|
-
|
|
11
|
-
this class constructor requires the following parameters:
|
|
12
|
-
- [ILogger](#ilogger) instance.
|
|
13
|
-
- base url to use for all requests.
|
|
14
|
-
- optional name for target service to be used in logs.
|
|
15
|
-
- optional [retry configuration](#ihttpretryconfig).
|
|
16
|
-
|
|
17
|
-
the class have the following protected attributes
|
|
18
|
-
-```axiosOptions``` the options used by axios when sending requests
|
|
19
|
-
|
|
20
|
-
the class have the protected methods for sending http requests:
|
|
21
|
-
- ```protected async get<T>(url: string, queryParams?: Record<string, unknown>, retryConfig?: IAxiosRetryConfig, auth?: AxiosBasicCredentials, headers?: unknown): Promise<T>```
|
|
22
|
-
- ```protected async post<T>(url: string, body?: unknown, queryParams?: Record<string, unknown>, retryConfig?: IAxiosRetryConfig, auth?: AxiosBasicCredentials, headers?: unknown): Promise<T>```
|
|
23
|
-
- ```protected async put<T>(url: string, body?: unknown, queryParams?: Record<string, unknown>, retryConfig?: IAxiosRetryConfig, auth?: AxiosBasicCredentials, headers?: unknown): Promise<T>```
|
|
24
|
-
- ```protected async delete<T>(url: string, queryParams?: Record<string, unknown>, retryConfig?: IAxiosRetryConfig, auth?: AxiosBasicCredentials, headers?: unknown): Promise<T>```
|
|
25
|
-
- ```protected async head<T>(url: string, queryParams?: Record<string, unknown>, retryConfig?: IAxiosRetryConfig, auth?: AxiosBasicCredentials, headers?: unknown): Promise<T>```
|
|
26
|
-
- ```protected async options<T>(url: string, queryParams?: Record<string, unknown>, retryConfig?: IAxiosRetryConfig, auth?: AxiosBasicCredentials, headers?: unknown): Promise<T>```
|
|
27
|
-
- ```protected async patch<T>(url: string, body?: unknown, queryParams?: Record<string, unknown>, retryConfig?: IAxiosRetryConfig, auth?: AxiosBasicCredentials, headers?: unknown): Promise<T>```
|
|
28
|
-
|
|
29
|
-
function parameters list:
|
|
30
|
-
- `url`: url path to send the request to (not including the base url).
|
|
31
|
-
- `body`: optional object to be used as request body (in relevant request types).
|
|
32
|
-
- `queryParams`: optional dictionary with query parameters and value.
|
|
33
|
-
- `retryConfig`: optional override to the class retry configuration.
|
|
34
|
-
- `auth`: optional basic authentication object (username, password).
|
|
35
|
-
- `headers`: optional headers to proceed to the request.
|
|
36
|
-
|
|
37
|
-
usage example:
|
|
38
|
-
```typescript
|
|
39
|
-
class myServiceClient extends HttpClient {
|
|
40
|
-
public constructor(logger: ILogger){
|
|
41
|
-
super(logger,'https://myService.com','myService',{
|
|
42
|
-
attempts: 3,
|
|
43
|
-
delay: 'exponential',
|
|
44
|
-
shouldResetTimeout: true
|
|
45
|
-
})
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
public async getName(): string {
|
|
49
|
-
const name = await this.get<string>('api/name',{queryParam1: 'name'});
|
|
50
|
-
return name;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
```
|
|
54
|
-
# models
|
|
55
|
-
## ILogger
|
|
56
|
-
logger interface
|
|
57
|
-
with the flowing log methods
|
|
58
|
-
- ``` error(message:string) ```
|
|
59
|
-
- ```warn(message:string)```
|
|
60
|
-
- ```info(message: string)```
|
|
61
|
-
- ```debug(message: string)```
|
|
62
|
-
|
|
63
|
-
## IHttpRetryConfig
|
|
64
|
-
http requests retry configuration interface with the following attributes:
|
|
65
|
-
- ```attempts``` - the number of request to send until valid response (not 500+ status code). this value must be integer and greater then 0.
|
|
66
|
-
- ```delay``` - the amount of time in ms to wait between attempts (for constant delay) or ```'exponential'``` for exponential backoff.
|
|
67
|
-
- ```shouldResetTimeout``` boolean value to indicate if the request timeout should be for each request (true) or global for all attempts (false)
|
|
1
|
+
# mc-utils
|
|
2
|
+
this is general utilities for usage in Map Colonies project.
|
|
3
|
+
|
|
4
|
+
# included components
|
|
5
|
+
- [http client](#http-client)
|
|
6
|
+
|
|
7
|
+
# usage
|
|
8
|
+
## http client
|
|
9
|
+
this is abstract base class for sending http request with logging and request retries.
|
|
10
|
+
|
|
11
|
+
this class constructor requires the following parameters:
|
|
12
|
+
- [ILogger](#ilogger) instance.
|
|
13
|
+
- base url to use for all requests.
|
|
14
|
+
- optional name for target service to be used in logs.
|
|
15
|
+
- optional [retry configuration](#ihttpretryconfig).
|
|
16
|
+
|
|
17
|
+
the class have the following protected attributes
|
|
18
|
+
-```axiosOptions``` the options used by axios when sending requests
|
|
19
|
+
|
|
20
|
+
the class have the protected methods for sending http requests:
|
|
21
|
+
- ```protected async get<T>(url: string, queryParams?: Record<string, unknown>, retryConfig?: IAxiosRetryConfig, auth?: AxiosBasicCredentials, headers?: unknown): Promise<T>```
|
|
22
|
+
- ```protected async post<T>(url: string, body?: unknown, queryParams?: Record<string, unknown>, retryConfig?: IAxiosRetryConfig, auth?: AxiosBasicCredentials, headers?: unknown): Promise<T>```
|
|
23
|
+
- ```protected async put<T>(url: string, body?: unknown, queryParams?: Record<string, unknown>, retryConfig?: IAxiosRetryConfig, auth?: AxiosBasicCredentials, headers?: unknown): Promise<T>```
|
|
24
|
+
- ```protected async delete<T>(url: string, queryParams?: Record<string, unknown>, retryConfig?: IAxiosRetryConfig, auth?: AxiosBasicCredentials, headers?: unknown): Promise<T>```
|
|
25
|
+
- ```protected async head<T>(url: string, queryParams?: Record<string, unknown>, retryConfig?: IAxiosRetryConfig, auth?: AxiosBasicCredentials, headers?: unknown): Promise<T>```
|
|
26
|
+
- ```protected async options<T>(url: string, queryParams?: Record<string, unknown>, retryConfig?: IAxiosRetryConfig, auth?: AxiosBasicCredentials, headers?: unknown): Promise<T>```
|
|
27
|
+
- ```protected async patch<T>(url: string, body?: unknown, queryParams?: Record<string, unknown>, retryConfig?: IAxiosRetryConfig, auth?: AxiosBasicCredentials, headers?: unknown): Promise<T>```
|
|
28
|
+
|
|
29
|
+
function parameters list:
|
|
30
|
+
- `url`: url path to send the request to (not including the base url).
|
|
31
|
+
- `body`: optional object to be used as request body (in relevant request types).
|
|
32
|
+
- `queryParams`: optional dictionary with query parameters and value.
|
|
33
|
+
- `retryConfig`: optional override to the class retry configuration.
|
|
34
|
+
- `auth`: optional basic authentication object (username, password).
|
|
35
|
+
- `headers`: optional headers to proceed to the request.
|
|
36
|
+
|
|
37
|
+
usage example:
|
|
38
|
+
```typescript
|
|
39
|
+
class myServiceClient extends HttpClient {
|
|
40
|
+
public constructor(logger: ILogger){
|
|
41
|
+
super(logger,'https://myService.com','myService',{
|
|
42
|
+
attempts: 3,
|
|
43
|
+
delay: 'exponential',
|
|
44
|
+
shouldResetTimeout: true
|
|
45
|
+
})
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
public async getName(): string {
|
|
49
|
+
const name = await this.get<string>('api/name',{queryParam1: 'name'});
|
|
50
|
+
return name;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
# models
|
|
55
|
+
## ILogger
|
|
56
|
+
logger interface
|
|
57
|
+
with the flowing log methods
|
|
58
|
+
- ``` error(message:string) ```
|
|
59
|
+
- ```warn(message:string)```
|
|
60
|
+
- ```info(message: string)```
|
|
61
|
+
- ```debug(message: string)```
|
|
62
|
+
|
|
63
|
+
## IHttpRetryConfig
|
|
64
|
+
http requests retry configuration interface with the following attributes:
|
|
65
|
+
- ```attempts``` - the number of request to send until valid response (not 500+ status code). this value must be integer and greater then 0.
|
|
66
|
+
- ```delay``` - the amount of time in ms to wait between attempts (for constant delay) or ```'exponential'``` for exponential backoff.
|
|
67
|
+
- ```shouldResetTimeout``` boolean value to indicate if the request timeout should be for each request (true) or global for all attempts (false)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/arrays/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
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("./subGroups"), exports);
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/arrays/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8CAA4B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* split group into unique sub groups ordered by size from largest to smallest
|
|
3
|
+
* @param group input group
|
|
4
|
+
* @param maxLength length of the largest sub group return. must be <= group.length
|
|
5
|
+
* @param includeOnlyMaxLength indicates if function will return only sub groups in the specified "maxLength" or smaller groups as well. default: false
|
|
6
|
+
*/
|
|
7
|
+
declare function subGroupsGen<T>(group: T[], maxLength: number, includeOnlyMaxLength?: boolean): Generator<T[]>;
|
|
8
|
+
export { subGroupsGen };
|
|
9
|
+
//# sourceMappingURL=subGroups.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subGroups.d.ts","sourceRoot":"","sources":["../../src/arrays/subGroups.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,iBAAU,YAAY,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,oBAAoB,UAAQ,GAAG,SAAS,CAAC,CAAC,EAAE,CAAC,CAoBrG;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
3
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
4
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
5
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
6
|
+
function step(op) {
|
|
7
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
8
|
+
while (_) try {
|
|
9
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
10
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
11
|
+
switch (op[0]) {
|
|
12
|
+
case 0: case 1: t = op; break;
|
|
13
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
14
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
15
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
16
|
+
default:
|
|
17
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
18
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
19
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
20
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
21
|
+
if (t[2]) _.ops.pop();
|
|
22
|
+
_.trys.pop(); continue;
|
|
23
|
+
}
|
|
24
|
+
op = body.call(thisArg, _);
|
|
25
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
26
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
var __values = (this && this.__values) || function(o) {
|
|
30
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
31
|
+
if (m) return m.call(o);
|
|
32
|
+
if (o && typeof o.length === "number") return {
|
|
33
|
+
next: function () {
|
|
34
|
+
if (o && i >= o.length) o = void 0;
|
|
35
|
+
return { value: o && o[i++], done: !o };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
39
|
+
};
|
|
40
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
41
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
42
|
+
if (!m) return o;
|
|
43
|
+
var i = m.call(o), r, ar = [], e;
|
|
44
|
+
try {
|
|
45
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
46
|
+
}
|
|
47
|
+
catch (error) { e = { error: error }; }
|
|
48
|
+
finally {
|
|
49
|
+
try {
|
|
50
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
51
|
+
}
|
|
52
|
+
finally { if (e) throw e.error; }
|
|
53
|
+
}
|
|
54
|
+
return ar;
|
|
55
|
+
};
|
|
56
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
57
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
58
|
+
if (ar || !(i in from)) {
|
|
59
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
60
|
+
ar[i] = from[i];
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
64
|
+
};
|
|
65
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
66
|
+
exports.subGroupsGen = void 0;
|
|
67
|
+
/**
|
|
68
|
+
* split group into unique sub groups ordered by size from largest to smallest
|
|
69
|
+
* @param group input group
|
|
70
|
+
* @param maxLength length of the largest sub group return. must be <= group.length
|
|
71
|
+
* @param includeOnlyMaxLength indicates if function will return only sub groups in the specified "maxLength" or smaller groups as well. default: false
|
|
72
|
+
*/
|
|
73
|
+
function subGroupsGen(group, maxLength, includeOnlyMaxLength) {
|
|
74
|
+
var lengthDif, i, subLayers, subPermutations, subPermutations_1, subPermutations_1_1, subPermutation, e_1_1;
|
|
75
|
+
var e_1, _a;
|
|
76
|
+
if (includeOnlyMaxLength === void 0) { includeOnlyMaxLength = false; }
|
|
77
|
+
return __generator(this, function (_b) {
|
|
78
|
+
switch (_b.label) {
|
|
79
|
+
case 0:
|
|
80
|
+
if (!(maxLength === 0)) return [3 /*break*/, 2];
|
|
81
|
+
return [4 /*yield*/, []];
|
|
82
|
+
case 1:
|
|
83
|
+
_b.sent();
|
|
84
|
+
return [3 /*break*/, 16];
|
|
85
|
+
case 2:
|
|
86
|
+
if (!(group.length === maxLength)) return [3 /*break*/, 4];
|
|
87
|
+
return [4 /*yield*/, group];
|
|
88
|
+
case 3:
|
|
89
|
+
_b.sent();
|
|
90
|
+
return [3 /*break*/, 14];
|
|
91
|
+
case 4:
|
|
92
|
+
lengthDif = group.length - maxLength;
|
|
93
|
+
i = 0;
|
|
94
|
+
_b.label = 5;
|
|
95
|
+
case 5:
|
|
96
|
+
if (!(i <= lengthDif)) return [3 /*break*/, 14];
|
|
97
|
+
subLayers = group.slice(i + 1);
|
|
98
|
+
subPermutations = subGroupsGen(subLayers, maxLength - 1);
|
|
99
|
+
_b.label = 6;
|
|
100
|
+
case 6:
|
|
101
|
+
_b.trys.push([6, 11, 12, 13]);
|
|
102
|
+
subPermutations_1 = (e_1 = void 0, __values(subPermutations)), subPermutations_1_1 = subPermutations_1.next();
|
|
103
|
+
_b.label = 7;
|
|
104
|
+
case 7:
|
|
105
|
+
if (!!subPermutations_1_1.done) return [3 /*break*/, 10];
|
|
106
|
+
subPermutation = subPermutations_1_1.value;
|
|
107
|
+
return [4 /*yield*/, __spreadArray([group[i]], __read(subPermutation), false)];
|
|
108
|
+
case 8:
|
|
109
|
+
_b.sent();
|
|
110
|
+
_b.label = 9;
|
|
111
|
+
case 9:
|
|
112
|
+
subPermutations_1_1 = subPermutations_1.next();
|
|
113
|
+
return [3 /*break*/, 7];
|
|
114
|
+
case 10: return [3 /*break*/, 13];
|
|
115
|
+
case 11:
|
|
116
|
+
e_1_1 = _b.sent();
|
|
117
|
+
e_1 = { error: e_1_1 };
|
|
118
|
+
return [3 /*break*/, 13];
|
|
119
|
+
case 12:
|
|
120
|
+
try {
|
|
121
|
+
if (subPermutations_1_1 && !subPermutations_1_1.done && (_a = subPermutations_1.return)) _a.call(subPermutations_1);
|
|
122
|
+
}
|
|
123
|
+
finally { if (e_1) throw e_1.error; }
|
|
124
|
+
return [7 /*endfinally*/];
|
|
125
|
+
case 13:
|
|
126
|
+
i++;
|
|
127
|
+
return [3 /*break*/, 5];
|
|
128
|
+
case 14:
|
|
129
|
+
if (!(maxLength > 1 && !includeOnlyMaxLength)) return [3 /*break*/, 16];
|
|
130
|
+
return [5 /*yield**/, __values(subGroupsGen(group, maxLength - 1))];
|
|
131
|
+
case 15:
|
|
132
|
+
_b.sent();
|
|
133
|
+
_b.label = 16;
|
|
134
|
+
case 16: return [2 /*return*/];
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
exports.subGroupsGen = subGroupsGen;
|
|
139
|
+
//# sourceMappingURL=subGroups.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subGroups.js","sourceRoot":"","sources":["../../src/arrays/subGroups.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;GAKG;AACH,SAAU,YAAY,CAAI,KAAU,EAAE,SAAiB,EAAE,oBAA4B;;;IAA5B,qCAAA,EAAA,4BAA4B;;;;qBAC/E,CAAA,SAAS,KAAK,CAAC,CAAA,EAAf,wBAAe;gBACjB,qBAAM,EAAE,EAAA;;gBAAR,SAAQ,CAAC;;;qBAEL,CAAA,KAAK,CAAC,MAAM,KAAK,SAAS,CAAA,EAA1B,wBAA0B;gBAC5B,qBAAM,KAAK,EAAA;;gBAAX,SAAW,CAAC;;;gBAEN,SAAS,GAAG,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC;gBAClC,CAAC,GAAG,CAAC;;;qBAAE,CAAA,CAAC,IAAI,SAAS,CAAA;gBACtB,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;gBAC/B,eAAe,GAAG,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,CAAC,CAAC,CAAC;;;;gBAClC,mCAAA,SAAA,eAAe,CAAA,CAAA;;;;gBAAjC,cAAc;gBACvB,oCAAO,KAAK,CAAC,CAAC,CAAC,UAAK,cAAc,WAAC;;gBAAnC,SAAmC,CAAC;;;;;;;;;;;;;;;;;gBAJR,CAAC,EAAE,CAAA;;;qBAQjC,CAAA,SAAS,GAAG,CAAC,IAAI,CAAC,oBAAoB,CAAA,EAAtC,yBAAsC;gBACxC,sBAAA,SAAO,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,CAAC,CAAC,CAAA,EAAA;;gBAAzC,SAAyC,CAAC;;;;;CAG/C;AAEQ,oCAAY"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Feature, MultiPolygon, Polygon } from '@turf/turf';
|
|
2
|
+
/**
|
|
3
|
+
* tuft intersect supported footprint types
|
|
4
|
+
*/
|
|
5
|
+
declare type Footprint = Polygon | MultiPolygon | Feature<Polygon | MultiPolygon>;
|
|
6
|
+
/**
|
|
7
|
+
* return the intersection footprint of all specified footprints or null when there is no intersection
|
|
8
|
+
* @param footprints footprint list to intersect
|
|
9
|
+
* @returns intersection footprint or null
|
|
10
|
+
*/
|
|
11
|
+
declare const multiIntersect: (footprints: Footprint[]) => Footprint | null;
|
|
12
|
+
export { multiIntersect, Footprint };
|
|
13
|
+
//# sourceMappingURL=geoIntersection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geoIntersection.d.ts","sourceRoot":"","sources":["../../src/geo/geoIntersection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAa,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAEvE;;GAEG;AACH,OAAO,MAAM,SAAS,GAAG,OAAO,GAAG,YAAY,GAAG,OAAO,CAAC,OAAO,GAAG,YAAY,CAAC,CAAC;AAElF;;;;GAIG;AACH,QAAA,MAAM,cAAc,eAAgB,SAAS,EAAE,KAAG,SAAS,GAAG,IAe7D,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.multiIntersect = void 0;
|
|
4
|
+
var turf_1 = require("@turf/turf");
|
|
5
|
+
/**
|
|
6
|
+
* return the intersection footprint of all specified footprints or null when there is no intersection
|
|
7
|
+
* @param footprints footprint list to intersect
|
|
8
|
+
* @returns intersection footprint or null
|
|
9
|
+
*/
|
|
10
|
+
var multiIntersect = function (footprints) {
|
|
11
|
+
if (footprints.length === 0) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
else if (footprints.length === 1) {
|
|
15
|
+
return footprints[0];
|
|
16
|
+
}
|
|
17
|
+
var intersection = footprints[0];
|
|
18
|
+
for (var i = 1; i < footprints.length; i++) {
|
|
19
|
+
var curIntersection = (0, turf_1.intersect)(intersection, footprints[i]);
|
|
20
|
+
if (curIntersection === null) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
intersection = curIntersection;
|
|
24
|
+
}
|
|
25
|
+
return intersection;
|
|
26
|
+
};
|
|
27
|
+
exports.multiIntersect = multiIntersect;
|
|
28
|
+
//# sourceMappingURL=geoIntersection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"geoIntersection.js","sourceRoot":"","sources":["../../src/geo/geoIntersection.ts"],"names":[],"mappings":";;;AAAA,mCAAuE;AAOvE;;;;GAIG;AACH,IAAM,cAAc,GAAG,UAAC,UAAuB;IAC7C,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;QAC3B,OAAO,IAAI,CAAC;KACb;SAAM,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE;QAClC,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC;KACtB;IACD,IAAI,YAAY,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;IACjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAC1C,IAAM,eAAe,GAAG,IAAA,gBAAS,EAAC,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/D,IAAI,eAAe,KAAK,IAAI,EAAE;YAC5B,OAAO,IAAI,CAAC;SACb;QACD,YAAY,GAAG,eAAe,CAAC;KAChC;IACD,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC;AAEO,wCAAc"}
|
package/dist/geo/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export * from './bboxUtils';
|
|
2
2
|
export * from './geoConvertor';
|
|
3
3
|
export * from './geoHash';
|
|
4
|
-
export * from './
|
|
4
|
+
export * from './geoIntersection';
|
|
5
|
+
export * from './tileBatcher';
|
|
5
6
|
export * from './tileRanger';
|
|
7
|
+
export * from './tiles';
|
|
8
|
+
export * from './tilesGenerator';
|
|
6
9
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/geo/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/geo/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/geo/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC"}
|
package/dist/geo/index.js
CHANGED
|
@@ -13,6 +13,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
13
13
|
__exportStar(require("./bboxUtils"), exports);
|
|
14
14
|
__exportStar(require("./geoConvertor"), exports);
|
|
15
15
|
__exportStar(require("./geoHash"), exports);
|
|
16
|
-
__exportStar(require("./
|
|
16
|
+
__exportStar(require("./geoIntersection"), exports);
|
|
17
|
+
__exportStar(require("./tileBatcher"), exports);
|
|
17
18
|
__exportStar(require("./tileRanger"), exports);
|
|
19
|
+
__exportStar(require("./tiles"), exports);
|
|
20
|
+
__exportStar(require("./tilesGenerator"), exports);
|
|
18
21
|
//# sourceMappingURL=index.js.map
|
package/dist/geo/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/geo/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8CAA4B;AAC5B,iDAA+B;AAC/B,4CAA0B;AAC1B,0CAAwB;AACxB
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/geo/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8CAA4B;AAC5B,iDAA+B;AAC/B,4CAA0B;AAC1B,oDAAkC;AAClC,gDAA8B;AAC9B,+CAA6B;AAC7B,0CAAwB;AACxB,mDAAiC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ITileRange } from '../models/interfaces/geo/iTile';
|
|
2
|
+
/**
|
|
3
|
+
* split collection of tile ranges to batches based on tile count
|
|
4
|
+
* @param batchSize amount of tile per batch
|
|
5
|
+
* @param ranges iterable collection of tile ranges
|
|
6
|
+
*/
|
|
7
|
+
declare function tileBatchGenerator(batchSize: number, ranges: Iterable<ITileRange>): Generator<ITileRange[]>;
|
|
8
|
+
export { tileBatchGenerator };
|
|
9
|
+
//# sourceMappingURL=tileBatcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tileBatcher.d.ts","sourceRoot":"","sources":["../../src/geo/tileBatcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAE5D;;;;GAIG;AACH,iBAAU,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC,GAAG,SAAS,CAAC,UAAU,EAAE,CAAC,CAmFrG;AAED,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
3
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
4
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
5
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
6
|
+
function step(op) {
|
|
7
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
8
|
+
while (_) try {
|
|
9
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
10
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
11
|
+
switch (op[0]) {
|
|
12
|
+
case 0: case 1: t = op; break;
|
|
13
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
14
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
15
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
16
|
+
default:
|
|
17
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
18
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
19
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
20
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
21
|
+
if (t[2]) _.ops.pop();
|
|
22
|
+
_.trys.pop(); continue;
|
|
23
|
+
}
|
|
24
|
+
op = body.call(thisArg, _);
|
|
25
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
26
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
var __values = (this && this.__values) || function(o) {
|
|
30
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
31
|
+
if (m) return m.call(o);
|
|
32
|
+
if (o && typeof o.length === "number") return {
|
|
33
|
+
next: function () {
|
|
34
|
+
if (o && i >= o.length) o = void 0;
|
|
35
|
+
return { value: o && o[i++], done: !o };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
39
|
+
};
|
|
40
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
+
exports.tileBatchGenerator = void 0;
|
|
42
|
+
/**
|
|
43
|
+
* split collection of tile ranges to batches based on tile count
|
|
44
|
+
* @param batchSize amount of tile per batch
|
|
45
|
+
* @param ranges iterable collection of tile ranges
|
|
46
|
+
*/
|
|
47
|
+
function tileBatchGenerator(batchSize, ranges) {
|
|
48
|
+
var targetRanges, requiredForFullBatch, ranges_1, ranges_1_1, range, dx, dy, reminderX, remaining, requiredLines, yRange, endX, e_1_1;
|
|
49
|
+
var e_1, _a;
|
|
50
|
+
return __generator(this, function (_b) {
|
|
51
|
+
switch (_b.label) {
|
|
52
|
+
case 0:
|
|
53
|
+
targetRanges = [];
|
|
54
|
+
requiredForFullBatch = batchSize;
|
|
55
|
+
_b.label = 1;
|
|
56
|
+
case 1:
|
|
57
|
+
_b.trys.push([1, 11, 12, 13]);
|
|
58
|
+
ranges_1 = __values(ranges), ranges_1_1 = ranges_1.next();
|
|
59
|
+
_b.label = 2;
|
|
60
|
+
case 2:
|
|
61
|
+
if (!!ranges_1_1.done) return [3 /*break*/, 10];
|
|
62
|
+
range = ranges_1_1.value;
|
|
63
|
+
dx = range.maxX - range.minX;
|
|
64
|
+
dy = range.maxY - range.minY;
|
|
65
|
+
if (dx === 0 || dy === 0) {
|
|
66
|
+
return [3 /*break*/, 9];
|
|
67
|
+
}
|
|
68
|
+
reminderX = range.maxX;
|
|
69
|
+
_b.label = 3;
|
|
70
|
+
case 3:
|
|
71
|
+
if (!(range.minY < range.maxY)) return [3 /*break*/, 9];
|
|
72
|
+
if (!(reminderX < range.maxX)) return [3 /*break*/, 6];
|
|
73
|
+
remaining = range.maxX - reminderX;
|
|
74
|
+
if (!(remaining > requiredForFullBatch)) return [3 /*break*/, 5];
|
|
75
|
+
targetRanges.push({
|
|
76
|
+
minX: reminderX,
|
|
77
|
+
maxX: reminderX + requiredForFullBatch,
|
|
78
|
+
minY: range.minY,
|
|
79
|
+
maxY: range.minY + 1,
|
|
80
|
+
zoom: range.zoom,
|
|
81
|
+
});
|
|
82
|
+
return [4 /*yield*/, targetRanges];
|
|
83
|
+
case 4:
|
|
84
|
+
_b.sent();
|
|
85
|
+
reminderX += requiredForFullBatch;
|
|
86
|
+
targetRanges = [];
|
|
87
|
+
requiredForFullBatch = batchSize;
|
|
88
|
+
return [3 /*break*/, 3];
|
|
89
|
+
case 5:
|
|
90
|
+
targetRanges.push({
|
|
91
|
+
minX: reminderX,
|
|
92
|
+
maxX: reminderX + remaining,
|
|
93
|
+
minY: range.minY,
|
|
94
|
+
maxY: range.minY + 1,
|
|
95
|
+
zoom: range.zoom,
|
|
96
|
+
});
|
|
97
|
+
range.minY++;
|
|
98
|
+
reminderX += remaining;
|
|
99
|
+
requiredForFullBatch -= remaining;
|
|
100
|
+
dy--;
|
|
101
|
+
_b.label = 6;
|
|
102
|
+
case 6:
|
|
103
|
+
requiredLines = Math.floor(requiredForFullBatch / dx);
|
|
104
|
+
yRange = Math.min(requiredLines, dy);
|
|
105
|
+
if (yRange > 0) {
|
|
106
|
+
targetRanges.push({
|
|
107
|
+
minX: range.minX,
|
|
108
|
+
maxX: range.maxX,
|
|
109
|
+
minY: range.minY,
|
|
110
|
+
maxY: range.minY + yRange,
|
|
111
|
+
zoom: range.zoom,
|
|
112
|
+
});
|
|
113
|
+
range.minY += yRange;
|
|
114
|
+
dy -= yRange;
|
|
115
|
+
requiredForFullBatch -= yRange * dx;
|
|
116
|
+
}
|
|
117
|
+
//add partial lines beginning
|
|
118
|
+
if (requiredForFullBatch > 0 && range.minY < range.maxY) {
|
|
119
|
+
endX = Math.min(range.minX + requiredForFullBatch, range.maxX);
|
|
120
|
+
targetRanges.push({
|
|
121
|
+
minX: range.minX,
|
|
122
|
+
maxX: endX,
|
|
123
|
+
minY: range.minY,
|
|
124
|
+
maxY: range.minY + 1,
|
|
125
|
+
zoom: range.zoom,
|
|
126
|
+
});
|
|
127
|
+
requiredForFullBatch -= endX - range.minX;
|
|
128
|
+
if (endX < range.maxX) {
|
|
129
|
+
reminderX = endX;
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
range.minY++;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
if (!(requiredForFullBatch === 0)) return [3 /*break*/, 8];
|
|
136
|
+
return [4 /*yield*/, targetRanges];
|
|
137
|
+
case 7:
|
|
138
|
+
_b.sent();
|
|
139
|
+
targetRanges = [];
|
|
140
|
+
requiredForFullBatch = batchSize;
|
|
141
|
+
_b.label = 8;
|
|
142
|
+
case 8: return [3 /*break*/, 3];
|
|
143
|
+
case 9:
|
|
144
|
+
ranges_1_1 = ranges_1.next();
|
|
145
|
+
return [3 /*break*/, 2];
|
|
146
|
+
case 10: return [3 /*break*/, 13];
|
|
147
|
+
case 11:
|
|
148
|
+
e_1_1 = _b.sent();
|
|
149
|
+
e_1 = { error: e_1_1 };
|
|
150
|
+
return [3 /*break*/, 13];
|
|
151
|
+
case 12:
|
|
152
|
+
try {
|
|
153
|
+
if (ranges_1_1 && !ranges_1_1.done && (_a = ranges_1.return)) _a.call(ranges_1);
|
|
154
|
+
}
|
|
155
|
+
finally { if (e_1) throw e_1.error; }
|
|
156
|
+
return [7 /*endfinally*/];
|
|
157
|
+
case 13:
|
|
158
|
+
if (!(targetRanges.length > 0)) return [3 /*break*/, 15];
|
|
159
|
+
return [4 /*yield*/, targetRanges];
|
|
160
|
+
case 14:
|
|
161
|
+
_b.sent();
|
|
162
|
+
_b.label = 15;
|
|
163
|
+
case 15: return [2 /*return*/];
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
exports.tileBatchGenerator = tileBatchGenerator;
|
|
168
|
+
//# sourceMappingURL=tileBatcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tileBatcher.js","sourceRoot":"","sources":["../../src/geo/tileBatcher.ts"],"names":[],"mappings":"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"}
|
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,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,OAAO,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,iBAAiB,CAAC;AAChC,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -13,4 +13,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
13
13
|
__exportStar(require("./models"), exports);
|
|
14
14
|
__exportStar(require("./communication"), exports);
|
|
15
15
|
__exportStar(require("./geo"), exports);
|
|
16
|
+
__exportStar(require("./arrays"), exports);
|
|
16
17
|
//# 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,2CAAyB;AACzB,kDAAgC;AAChC,wCAAsB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAyB;AACzB,kDAAgC;AAChC,wCAAsB;AACtB,2CAAyB"}
|
package/package.json
CHANGED
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@map-colonies/mc-utils",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "This is template for map colonies typescript packages",
|
|
5
|
-
"main": "./dist/index.js",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"test:unit": "jest --config=./tests/configurations/unit/jest.config.js",
|
|
8
|
-
"test:integration": "jest --config=./tests/configurations/integration/jest.config.js",
|
|
9
|
-
"format": "prettier --check .",
|
|
10
|
-
"format:fix": "prettier --write .",
|
|
11
|
-
"prelint:fix": "npm run format:fix",
|
|
12
|
-
"prelint": "npm run format",
|
|
13
|
-
"lint": "eslint .",
|
|
14
|
-
"lint:fix": "eslint --fix .",
|
|
15
|
-
"release": "standard-version",
|
|
16
|
-
"test": "npm run test:unit && npm run test:integration",
|
|
17
|
-
"prebuild": "npm run clean",
|
|
18
|
-
"build": "tsc --project tsconfig.build.json",
|
|
19
|
-
"start": "npm run build && cd dist && node ./index.js",
|
|
20
|
-
"clean": "rimraf dist",
|
|
21
|
-
"prepack": "npm run build"
|
|
22
|
-
},
|
|
23
|
-
"repository": {
|
|
24
|
-
"type": "git",
|
|
25
|
-
"url": "git+https://github.com/MapColonies/mc-utils.git"
|
|
26
|
-
},
|
|
27
|
-
"author": "MapColonies",
|
|
28
|
-
"license": "ISC",
|
|
29
|
-
"bugs": {
|
|
30
|
-
"url": "https://github.com/MapColonies/mc-utils/issues"
|
|
31
|
-
},
|
|
32
|
-
"husky": {
|
|
33
|
-
"hooks": {
|
|
34
|
-
"pre-commit": "pretty-quick --staged",
|
|
35
|
-
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
"files": [
|
|
39
|
-
"dist/**/*"
|
|
40
|
-
],
|
|
41
|
-
"homepage": "https://github.com/MapColonies/mc-utils#readme",
|
|
42
|
-
"devDependencies": {
|
|
43
|
-
"@commitlint/cli": "^11.0.0",
|
|
44
|
-
"@commitlint/config-conventional": "^11.0.0",
|
|
45
|
-
"@map-colonies/eslint-config": "^2.2.0",
|
|
46
|
-
"@map-colonies/prettier-config": "0.0.1",
|
|
47
|
-
"@types/express": "^4.17.13",
|
|
48
|
-
"@types/jest": "^26.0.19",
|
|
49
|
-
"@types/lodash": "^4.14.171",
|
|
50
|
-
"@types/ngeohash": "^0.6.3",
|
|
51
|
-
"@types/node": "^14.14.12",
|
|
52
|
-
"commitlint": "^11.0.0",
|
|
53
|
-
"cz-conventional-changelog": "^3.3.0",
|
|
54
|
-
"eslint": "^7.8.1",
|
|
55
|
-
"husky": "^4.3.5",
|
|
56
|
-
"jest": "^26.6.3",
|
|
57
|
-
"jest-create-mock-instance": "^1.1.0",
|
|
58
|
-
"jest-html-reporters": "^2.1.2",
|
|
59
|
-
"prettier": "^2.2.1",
|
|
60
|
-
"pretty-quick": "^3.1.0",
|
|
61
|
-
"standard-version": "^9.3.0",
|
|
62
|
-
"ts-jest": "^26.4.4",
|
|
63
|
-
"ts-node": "^9.1.1",
|
|
64
|
-
"typedoc": "^0.
|
|
65
|
-
"typescript": "^4.2.4"
|
|
66
|
-
},
|
|
67
|
-
"dependencies": {
|
|
68
|
-
"@map-colonies/error-types": "^1.1.0",
|
|
69
|
-
"@turf/turf": "^6.5.0",
|
|
70
|
-
"axios": "^0.21.1",
|
|
71
|
-
"axios-retry": "^3.1.9",
|
|
72
|
-
"http-status-codes": "^2.1.4",
|
|
73
|
-
"lodash": "^4.17.21",
|
|
74
|
-
"ngeohash": "^0.6.3"
|
|
75
|
-
}
|
|
76
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@map-colonies/mc-utils",
|
|
3
|
+
"version": "1.4.0",
|
|
4
|
+
"description": "This is template for map colonies typescript packages",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"test:unit": "jest --config=./tests/configurations/unit/jest.config.js",
|
|
8
|
+
"test:integration": "jest --config=./tests/configurations/integration/jest.config.js",
|
|
9
|
+
"format": "prettier --check .",
|
|
10
|
+
"format:fix": "prettier --write .",
|
|
11
|
+
"prelint:fix": "npm run format:fix",
|
|
12
|
+
"prelint": "npm run format",
|
|
13
|
+
"lint": "eslint .",
|
|
14
|
+
"lint:fix": "eslint --fix .",
|
|
15
|
+
"release": "standard-version",
|
|
16
|
+
"test": "npm run test:unit && npm run test:integration",
|
|
17
|
+
"prebuild": "npm run clean",
|
|
18
|
+
"build": "tsc --project tsconfig.build.json",
|
|
19
|
+
"start": "npm run build && cd dist && node ./index.js",
|
|
20
|
+
"clean": "rimraf dist",
|
|
21
|
+
"prepack": "npm run build"
|
|
22
|
+
},
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/MapColonies/mc-utils.git"
|
|
26
|
+
},
|
|
27
|
+
"author": "MapColonies",
|
|
28
|
+
"license": "ISC",
|
|
29
|
+
"bugs": {
|
|
30
|
+
"url": "https://github.com/MapColonies/mc-utils/issues"
|
|
31
|
+
},
|
|
32
|
+
"husky": {
|
|
33
|
+
"hooks": {
|
|
34
|
+
"pre-commit": "pretty-quick --staged",
|
|
35
|
+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"files": [
|
|
39
|
+
"dist/**/*"
|
|
40
|
+
],
|
|
41
|
+
"homepage": "https://github.com/MapColonies/mc-utils#readme",
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@commitlint/cli": "^11.0.0",
|
|
44
|
+
"@commitlint/config-conventional": "^11.0.0",
|
|
45
|
+
"@map-colonies/eslint-config": "^2.2.0",
|
|
46
|
+
"@map-colonies/prettier-config": "0.0.1",
|
|
47
|
+
"@types/express": "^4.17.13",
|
|
48
|
+
"@types/jest": "^26.0.19",
|
|
49
|
+
"@types/lodash": "^4.14.171",
|
|
50
|
+
"@types/ngeohash": "^0.6.3",
|
|
51
|
+
"@types/node": "^14.14.12",
|
|
52
|
+
"commitlint": "^11.0.0",
|
|
53
|
+
"cz-conventional-changelog": "^3.3.0",
|
|
54
|
+
"eslint": "^7.8.1",
|
|
55
|
+
"husky": "^4.3.5",
|
|
56
|
+
"jest": "^26.6.3",
|
|
57
|
+
"jest-create-mock-instance": "^1.1.0",
|
|
58
|
+
"jest-html-reporters": "^2.1.2",
|
|
59
|
+
"prettier": "^2.2.1",
|
|
60
|
+
"pretty-quick": "^3.1.0",
|
|
61
|
+
"standard-version": "^9.3.0",
|
|
62
|
+
"ts-jest": "^26.4.4",
|
|
63
|
+
"ts-node": "^9.1.1",
|
|
64
|
+
"typedoc": "^0.22.10",
|
|
65
|
+
"typescript": "^4.2.4"
|
|
66
|
+
},
|
|
67
|
+
"dependencies": {
|
|
68
|
+
"@map-colonies/error-types": "^1.1.0",
|
|
69
|
+
"@turf/turf": "^6.5.0",
|
|
70
|
+
"axios": "^0.21.1",
|
|
71
|
+
"axios-retry": "^3.1.9",
|
|
72
|
+
"http-status-codes": "^2.1.4",
|
|
73
|
+
"lodash": "^4.17.21",
|
|
74
|
+
"ngeohash": "^0.6.3"
|
|
75
|
+
}
|
|
76
|
+
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
|
-
|
|
5
|
-
## [1.3.0](https://github.com/MapColonies/mc-utils/compare/v1.1.2...v1.3.0) (2021-12-30)
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
### Features
|
|
9
|
-
|
|
10
|
-
* support basic auth and external headers ([#7](https://github.com/MapColonies/mc-utils/issues/7)) ([26b0c5d](https://github.com/MapColonies/mc-utils/commit/26b0c5d79ab38c6346de611dd415cf9e64bf1123))
|
|
11
|
-
|
|
12
|
-
## [1.2.0](https://github.com/MapColonies/mc-utils/compare/v1.1.2...v1.2.0) (2021-12-01)
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
### Features
|
|
16
|
-
|
|
17
|
-
* support basic auth and external headers ([#7](https://github.com/MapColonies/mc-utils/issues/7)) ([26b0c5d](https://github.com/MapColonies/mc-utils/commit/26b0c5d79ab38c6346de611dd415cf9e64bf1123))
|
|
18
|
-
|
|
19
|
-
### [1.1.2](https://github.com/MapColonies/mc-utils/compare/v1.1.0...v1.1.2) (2021-08-31)
|
|
20
|
-
|
|
21
|
-
### [1.1.1](https://github.com/MapColonies/mc-utils/compare/v1.1.0...v1.1.1) (2021-08-31)
|
|
22
|
-
|
|
23
|
-
## [1.1.0](https://github.com/MapColonies/mc-utils/compare/v1.0.2...v1.1.0) (2021-08-12)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
### Features
|
|
27
|
-
|
|
28
|
-
* Tile calculations ([#5](https://github.com/MapColonies/mc-utils/issues/5)) ([ea4c5ac](https://github.com/MapColonies/mc-utils/commit/ea4c5ac0941c7ee3d7c999e4034c0c44339db643))
|
|
29
|
-
|
|
30
|
-
### [1.0.2](https://github.com/MapColonies/mc-utils/compare/v1.0.1...v1.0.2) (2021-08-05)
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
### Bug Fixes
|
|
34
|
-
|
|
35
|
-
* prepublish for npm v7 ([#4](https://github.com/MapColonies/mc-utils/issues/4)) ([382bf72](https://github.com/MapColonies/mc-utils/commit/382bf7236622668fd213bfa86911288d33cb24da))
|
|
36
|
-
|
|
37
|
-
### [1.0.1](https://github.com/MapColonies/mc-utils/compare/v1.0.0...v1.0.1) (2021-08-05)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
### Bug Fixes
|
|
41
|
-
|
|
42
|
-
* release command ([#2](https://github.com/MapColonies/mc-utils/issues/2)) ([8bad6a9](https://github.com/MapColonies/mc-utils/commit/8bad6a98de6359aa94ca22723a5ab7968e8b22a1))
|
|
43
|
-
|
|
44
|
-
## 1.0.0 (2021-07-28)
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
### Features
|
|
48
|
-
|
|
49
|
-
* added http client ([#1](https://github.com/MapColonies/mc-utils/issues/1)) ([48ebf45](https://github.com/MapColonies/mc-utils/commit/48ebf45a62f07ae71cb1b23e8a6ad662da56590f))
|