@cloudbase/database 0.9.22 → 0.10.0-alpha.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/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +101 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +210 -0
- package/coverage/lcov.info +0 -0
- package/dist/commonjs/aggregate.js +3 -3
- package/dist/commonjs/collection.d.ts +1 -1
- package/dist/commonjs/collection.js +5 -2
- package/dist/commonjs/command.d.ts +5 -5
- package/dist/commonjs/command.js +9 -8
- package/dist/commonjs/commands/logic.js +3 -2
- package/dist/commonjs/commands/query.js +11 -8
- package/dist/commonjs/commands/update.js +1 -0
- package/dist/commonjs/config/error.config.js +1 -0
- package/dist/commonjs/const/code.js +1 -0
- package/dist/commonjs/constant.d.ts +7 -7
- package/dist/commonjs/constant.js +1 -0
- package/dist/commonjs/document.js +11 -10
- package/dist/commonjs/geo/index.js +20 -9
- package/dist/commonjs/geo/lineString.d.ts +1 -1
- package/dist/commonjs/geo/lineString.js +7 -6
- package/dist/commonjs/geo/multiLineString.d.ts +1 -1
- package/dist/commonjs/geo/multiLineString.js +7 -6
- package/dist/commonjs/geo/multiPoint.d.ts +1 -1
- package/dist/commonjs/geo/multiPoint.js +7 -6
- package/dist/commonjs/geo/multiPolygon.d.ts +1 -1
- package/dist/commonjs/geo/multiPolygon.js +7 -6
- package/dist/commonjs/geo/point.d.ts +1 -1
- package/dist/commonjs/geo/point.js +4 -3
- package/dist/commonjs/geo/polygon.d.ts +1 -1
- package/dist/commonjs/geo/polygon.js +8 -7
- package/dist/commonjs/helper/symbol.js +16 -4
- package/dist/commonjs/index.d.ts +9 -2
- package/dist/commonjs/index.js +19 -4
- package/dist/commonjs/lib/util.js +4 -3
- package/dist/commonjs/operator-map.js +1 -0
- package/dist/commonjs/query.js +10 -9
- package/dist/commonjs/regexp/index.d.ts +1 -1
- package/dist/commonjs/regexp/index.js +2 -1
- package/dist/commonjs/serializer/common.d.ts +2 -2
- package/dist/commonjs/serializer/common.js +23 -17
- package/dist/commonjs/serializer/datatype.d.ts +2 -2
- package/dist/commonjs/serializer/datatype.js +20 -14
- package/dist/commonjs/serializer/query.d.ts +1 -1
- package/dist/commonjs/serializer/query.js +24 -23
- package/dist/commonjs/serializer/update.d.ts +1 -1
- package/dist/commonjs/serializer/update.js +12 -11
- package/dist/commonjs/serverDate/index.d.ts +1 -1
- package/dist/commonjs/serverDate/index.js +3 -2
- package/dist/commonjs/transaction/collection.d.ts +1 -1
- package/dist/commonjs/transaction/collection.js +5 -2
- package/dist/commonjs/transaction/document.d.ts +1 -1
- package/dist/commonjs/transaction/document.js +5 -5
- package/dist/commonjs/transaction/index.js +3 -2
- package/dist/commonjs/transaction/query.js +1 -0
- package/dist/commonjs/typings/index.d.ts +3 -3
- package/dist/commonjs/typings/realtime.d.ts +16 -16
- package/dist/commonjs/util.js +1 -0
- package/dist/commonjs/utils/error.d.ts +2 -1
- package/dist/commonjs/utils/error.js +15 -9
- package/dist/commonjs/utils/symbol.js +5 -4
- package/dist/commonjs/utils/type.d.ts +1 -1
- package/dist/commonjs/utils/type.js +23 -11
- package/dist/commonjs/utils/utils.js +6 -3
- package/dist/commonjs/validate.js +1 -0
- package/dist/esm/aggregate.d.ts.map +1 -0
- package/dist/esm/aggregate.js +3 -3
- package/dist/esm/collection.d.ts +1 -1
- package/dist/esm/collection.d.ts.map +1 -0
- package/dist/esm/collection.js +4 -2
- package/dist/esm/command.d.ts +5 -5
- package/dist/esm/command.d.ts.map +1 -0
- package/dist/esm/commands/logic.d.ts.map +1 -0
- package/dist/esm/commands/query.d.ts.map +1 -0
- package/dist/esm/commands/query.js +8 -6
- package/dist/esm/commands/update.d.ts.map +1 -0
- package/dist/esm/config/app.config.d.ts.map +1 -0
- package/dist/esm/config/error.config.d.ts.map +1 -0
- package/dist/esm/const/code.d.ts.map +1 -0
- package/dist/esm/constant.d.ts +7 -7
- package/dist/esm/constant.d.ts.map +1 -0
- package/dist/esm/document.d.ts.map +1 -0
- package/dist/esm/document.js +2 -2
- package/dist/esm/geo/index.d.ts.map +1 -0
- package/dist/esm/geo/interface.d.ts.map +1 -0
- package/dist/esm/geo/interface.js +1 -0
- package/dist/esm/geo/lineString.d.ts +1 -1
- package/dist/esm/geo/lineString.d.ts.map +1 -0
- package/dist/esm/geo/lineString.js +3 -3
- package/dist/esm/geo/multiLineString.d.ts +1 -1
- package/dist/esm/geo/multiLineString.d.ts.map +1 -0
- package/dist/esm/geo/multiLineString.js +3 -3
- package/dist/esm/geo/multiPoint.d.ts +1 -1
- package/dist/esm/geo/multiPoint.d.ts.map +1 -0
- package/dist/esm/geo/multiPoint.js +3 -3
- package/dist/esm/geo/multiPolygon.d.ts +1 -1
- package/dist/esm/geo/multiPolygon.d.ts.map +1 -0
- package/dist/esm/geo/multiPolygon.js +3 -3
- package/dist/esm/geo/point.d.ts +1 -1
- package/dist/esm/geo/point.d.ts.map +1 -0
- package/dist/esm/geo/point.js +2 -2
- package/dist/esm/geo/polygon.d.ts +1 -1
- package/dist/esm/geo/polygon.d.ts.map +1 -0
- package/dist/esm/geo/polygon.js +4 -4
- package/dist/esm/helper/symbol.d.ts.map +1 -0
- package/dist/esm/index.d.ts +9 -2
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +15 -1
- package/dist/esm/lib/util.d.ts.map +1 -0
- package/dist/esm/lib/util.js +1 -2
- package/dist/esm/operator-map.d.ts.map +1 -0
- package/dist/esm/query.d.ts.map +1 -0
- package/dist/esm/query.js +4 -4
- package/dist/esm/regexp/index.d.ts +1 -1
- package/dist/esm/regexp/index.d.ts.map +1 -0
- package/dist/esm/regexp/index.js +1 -1
- package/dist/esm/serializer/common.d.ts +2 -2
- package/dist/esm/serializer/common.d.ts.map +1 -0
- package/dist/esm/serializer/common.js +15 -10
- package/dist/esm/serializer/datatype.d.ts +2 -2
- package/dist/esm/serializer/datatype.d.ts.map +1 -0
- package/dist/esm/serializer/datatype.js +12 -7
- package/dist/esm/serializer/query.d.ts +1 -1
- package/dist/esm/serializer/query.d.ts.map +1 -0
- package/dist/esm/serializer/query.js +2 -2
- package/dist/esm/serializer/update.d.ts +1 -1
- package/dist/esm/serializer/update.d.ts.map +1 -0
- package/dist/esm/serverDate/index.d.ts +1 -1
- package/dist/esm/serverDate/index.d.ts.map +1 -0
- package/dist/esm/serverDate/index.js +2 -2
- package/dist/esm/transaction/collection.d.ts +1 -1
- package/dist/esm/transaction/collection.d.ts.map +1 -0
- package/dist/esm/transaction/collection.js +4 -2
- package/dist/esm/transaction/document.d.ts +1 -1
- package/dist/esm/transaction/document.d.ts.map +1 -0
- package/dist/esm/transaction/document.js +2 -3
- package/dist/esm/transaction/index.d.ts.map +1 -0
- package/dist/esm/transaction/index.js +2 -2
- package/dist/esm/transaction/query.d.ts.map +1 -0
- package/dist/esm/typings/index.d.ts +3 -3
- package/dist/esm/typings/index.d.ts.map +1 -0
- package/dist/esm/typings/index.js +1 -0
- package/dist/esm/typings/realtime.d.ts +16 -16
- package/dist/esm/typings/realtime.d.ts.map +1 -0
- package/dist/esm/typings/realtime.js +1 -0
- package/dist/esm/util.d.ts.map +1 -0
- package/dist/esm/utils/error.d.ts +2 -1
- package/dist/esm/utils/error.d.ts.map +1 -0
- package/dist/esm/utils/error.js +7 -5
- package/dist/esm/utils/msg.d.ts.map +1 -0
- package/dist/esm/utils/symbol.d.ts.map +1 -0
- package/dist/esm/utils/symbol.js +4 -4
- package/dist/esm/utils/type.d.ts +1 -1
- package/dist/esm/utils/type.d.ts.map +1 -0
- package/dist/esm/utils/utils.d.ts.map +1 -0
- package/dist/esm/utils/utils.js +1 -1
- package/dist/esm/validate.d.ts.map +1 -0
- package/jest.config.js +14 -0
- package/package.json +9 -4
- package/src/aggregate.ts +1 -1
- package/src/document.ts +1 -1
- package/src/index.ts +40 -4
- package/src/lib/util.ts +1 -2
- package/src/query.ts +4 -4
- package/src/transaction/index.ts +1 -1
- package/src/utils/utils.ts +1 -1
- package/tests/index.test.ts +111 -0
- package/tsconfig.esm.json +2 -1
- package/tsconfig.json +14 -5
- package/tsconfig.test.json +15 -0
- package/.trunk/configs/.markdownlint.yaml +0 -10
- package/.trunk/trunk.yaml +0 -26
|
@@ -1,17 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isPlainObject = exports.isInternalObject = exports.isRegExp = exports.isDate = exports.isArray = exports.isFunction = exports.isPromise = exports.isNumber = exports.isString = exports.isObject = exports.getType = void 0;
|
|
3
4
|
var symbol_1 = require("./symbol");
|
|
4
|
-
|
|
5
|
-
exports.
|
|
6
|
-
|
|
7
|
-
exports.
|
|
8
|
-
|
|
9
|
-
exports.
|
|
10
|
-
|
|
11
|
-
exports.
|
|
12
|
-
|
|
13
|
-
exports.
|
|
14
|
-
|
|
5
|
+
var getType = function (x) { return Object.prototype.toString.call(x).slice(8, -1).toLowerCase(); };
|
|
6
|
+
exports.getType = getType;
|
|
7
|
+
var isObject = function (x) { return (0, exports.getType)(x) === 'object'; };
|
|
8
|
+
exports.isObject = isObject;
|
|
9
|
+
var isString = function (x) { return (0, exports.getType)(x) === 'string'; };
|
|
10
|
+
exports.isString = isString;
|
|
11
|
+
var isNumber = function (x) { return (0, exports.getType)(x) === 'number'; };
|
|
12
|
+
exports.isNumber = isNumber;
|
|
13
|
+
var isPromise = function (x) { return (0, exports.getType)(x) === 'promise'; };
|
|
14
|
+
exports.isPromise = isPromise;
|
|
15
|
+
var isFunction = function (x) { return typeof x === 'function'; };
|
|
16
|
+
exports.isFunction = isFunction;
|
|
17
|
+
var isArray = function (x) { return Array.isArray(x); };
|
|
18
|
+
exports.isArray = isArray;
|
|
19
|
+
var isDate = function (x) { return (0, exports.getType)(x) === 'date'; };
|
|
20
|
+
exports.isDate = isDate;
|
|
21
|
+
var isRegExp = function (x) { return (0, exports.getType)(x) === 'regexp'; };
|
|
22
|
+
exports.isRegExp = isRegExp;
|
|
23
|
+
var isInternalObject = function (x) { return x && (x._internalType instanceof symbol_1.InternalSymbol); };
|
|
24
|
+
exports.isInternalObject = isInternalObject;
|
|
25
|
+
var isPlainObject = function (obj) {
|
|
15
26
|
if (typeof obj !== 'object' || obj === null)
|
|
16
27
|
return false;
|
|
17
28
|
var proto = obj;
|
|
@@ -20,3 +31,4 @@ exports.isPlainObject = function (obj) {
|
|
|
20
31
|
}
|
|
21
32
|
return Object.getPrototypeOf(obj) === proto;
|
|
22
33
|
};
|
|
34
|
+
exports.isPlainObject = isPlainObject;
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getWsInstance = exports.autoCount = exports.sleep = void 0;
|
|
3
4
|
var __1 = require("../");
|
|
4
|
-
|
|
5
|
+
var sleep = function (ms) {
|
|
5
6
|
if (ms === void 0) { ms = 0; }
|
|
6
7
|
return new Promise(function (r) { return setTimeout(r, ms); });
|
|
7
8
|
};
|
|
9
|
+
exports.sleep = sleep;
|
|
8
10
|
var counters = {};
|
|
9
|
-
|
|
11
|
+
var autoCount = function (domain) {
|
|
10
12
|
if (domain === void 0) { domain = 'any'; }
|
|
11
13
|
if (!counters[domain]) {
|
|
12
14
|
counters[domain] = 0;
|
|
13
15
|
}
|
|
14
16
|
return counters[domain]++;
|
|
15
17
|
};
|
|
18
|
+
exports.autoCount = autoCount;
|
|
16
19
|
var wsList = {};
|
|
17
20
|
function getWsInstance(db) {
|
|
18
21
|
if (!__1.Db.wsClientClass) {
|
|
@@ -26,7 +29,7 @@ function getWsInstance(db) {
|
|
|
26
29
|
docSizeLimit: 1000,
|
|
27
30
|
realtimePingInterval: 10000,
|
|
28
31
|
realtimePongWaitTimeout: 5000,
|
|
29
|
-
request:
|
|
32
|
+
request: __1.Db.createRequest(db.config)
|
|
30
33
|
}
|
|
31
34
|
}
|
|
32
35
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregate.d.ts","sourceRoot":"","sources":["../../src/aggregate.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,OAAO,OAAO,WAAW;IAC9B,GAAG,EAAE,GAAG,CAAA;IACR,QAAQ,EAAE,GAAG,CAAA;IACb,OAAO,EAAE,GAAG,EAAE,CAAA;IACd,eAAe,EAAE,MAAM,CAAA;gBACX,EAAE,CAAC,KAAA,EAAE,cAAc,CAAC,KAAA;IAU1B,GAAG;IAiBT,MAAM;IAIN,IAAI;;;IAQJ,KAAK,CAAC,KAAK,KAAA,EAAE,KAAK,KAAA;IAQlB,SAAS,CAAC,KAAK,KAAA;IAIf,MAAM,CAAC,KAAK,KAAA;IAIZ,UAAU,CAAC,KAAK,KAAA;IAIhB,KAAK,CAAC,KAAK,KAAA;IAIX,OAAO,CAAC,KAAK,KAAA;IAcb,KAAK,CAAC,KAAK,KAAA;IAIX,KAAK,CAAC,KAAK,KAAA;IAIX,KAAK,CAAC,KAAK,KAAA;IAIX,OAAO,CAAC,KAAK,KAAA;IAIb,MAAM,CAAC,KAAK,KAAA;IAIZ,WAAW,CAAC,KAAK,KAAA;IAIjB,MAAM,CAAC,KAAK,KAAA;IAIZ,IAAI,CAAC,KAAK,KAAA;IAIV,IAAI,CAAC,KAAK,KAAA;IAIV,WAAW,CAAC,KAAK,KAAA;IAIjB,MAAM,CAAC,KAAK,KAAA;CAGb"}
|
package/dist/esm/aggregate.js
CHANGED
|
@@ -13,7 +13,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
13
13
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
14
|
function step(op) {
|
|
15
15
|
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
-
while (_) try {
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
17
|
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;
|
|
18
18
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
19
|
switch (op[0]) {
|
|
@@ -43,7 +43,7 @@ var Aggregation = (function () {
|
|
|
43
43
|
this._stages = [];
|
|
44
44
|
if (db && collectionName) {
|
|
45
45
|
this._db = db;
|
|
46
|
-
this._request =
|
|
46
|
+
this._request = Db.createRequest(this._db.config);
|
|
47
47
|
this._collectionName = collectionName;
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -87,7 +87,7 @@ var Aggregation = (function () {
|
|
|
87
87
|
};
|
|
88
88
|
Aggregation.prototype._pipe = function (stage, param) {
|
|
89
89
|
this._stages.push({
|
|
90
|
-
stageKey: "$"
|
|
90
|
+
stageKey: "$".concat(stage),
|
|
91
91
|
stageValue: JSON.stringify(param)
|
|
92
92
|
});
|
|
93
93
|
return this;
|
package/dist/esm/collection.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { DocumentReference } from './document';
|
|
|
2
2
|
import { Query } from './query';
|
|
3
3
|
import Aggregation from './aggregate';
|
|
4
4
|
export declare class CollectionReference extends Query {
|
|
5
|
-
|
|
5
|
+
get name(): string;
|
|
6
6
|
doc(docID?: string | number): DocumentReference;
|
|
7
7
|
add(data: Object, callback?: any): Promise<any>;
|
|
8
8
|
aggregate(): Aggregation;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../src/collection.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,WAAW,MAAM,aAAa,CAAA;AAOrC,qBAAa,mBAAoB,SAAQ,KAAK;aAiBxC,IAAI;IASR,GAAG,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,iBAAiB;IAY/C,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAK/C,SAAS;CAGV"}
|
package/dist/esm/collection.js
CHANGED
|
@@ -2,10 +2,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
2
2
|
var extendStatics = function (d, b) {
|
|
3
3
|
extendStatics = Object.setPrototypeOf ||
|
|
4
4
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
6
|
return extendStatics(d, b);
|
|
7
7
|
};
|
|
8
8
|
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
9
11
|
extendStatics(d, b);
|
|
10
12
|
function __() { this.constructor = d; }
|
|
11
13
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -23,7 +25,7 @@ var CollectionReference = (function (_super) {
|
|
|
23
25
|
get: function () {
|
|
24
26
|
return this._coll;
|
|
25
27
|
},
|
|
26
|
-
enumerable:
|
|
28
|
+
enumerable: false,
|
|
27
29
|
configurable: true
|
|
28
30
|
});
|
|
29
31
|
CollectionReference.prototype.doc = function (docID) {
|
package/dist/esm/command.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { QueryCommand } from './commands/query';
|
|
|
2
2
|
import { LogicCommand } from './commands/logic';
|
|
3
3
|
import { UpdateCommand } from './commands/update';
|
|
4
4
|
import Aggregation from './aggregate';
|
|
5
|
-
export
|
|
5
|
+
export type IQueryCondition = Record<string, any> | LogicCommand;
|
|
6
6
|
export declare const Command: {
|
|
7
7
|
eq(val: any): QueryCommand;
|
|
8
8
|
neq(val: any): QueryCommand;
|
|
@@ -20,10 +20,10 @@ export declare const Command: {
|
|
|
20
20
|
geoNear(val: any): QueryCommand;
|
|
21
21
|
geoWithin(val: any): QueryCommand;
|
|
22
22
|
geoIntersects(val: any): QueryCommand;
|
|
23
|
-
and(...__expressions__:
|
|
24
|
-
nor(...__expressions__:
|
|
25
|
-
or(...__expressions__:
|
|
26
|
-
not(...__expressions__:
|
|
23
|
+
and(...__expressions__: IQueryCondition[]): LogicCommand;
|
|
24
|
+
nor(...__expressions__: IQueryCondition[]): LogicCommand;
|
|
25
|
+
or(...__expressions__: IQueryCondition[]): LogicCommand;
|
|
26
|
+
not(...__expressions__: IQueryCondition[]): LogicCommand;
|
|
27
27
|
set(val: any): UpdateCommand;
|
|
28
28
|
remove(): UpdateCommand;
|
|
29
29
|
inc(val: number): UpdateCommand;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA0B,MAAM,kBAAkB,CAAA;AACvE,OAAO,EAAE,YAAY,EAA0B,MAAM,kBAAkB,CAAA;AACvE,OAAO,EAAE,aAAa,EAA2B,MAAM,mBAAmB,CAAA;AAE1E,OAAO,WAAW,MAAM,aAAa,CAAA;AAIrC,oBAAY,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,YAAY,CAAA;AAEhE,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwUnB,CAAA;AAED,cAAM,mBAAmB;gBACX,IAAI,KAAA,EAAE,KAAK,KAAA;CAGxB;AAED,cAAM,kBAAkB;gBACV,IAAI,KAAA,EAAE,KAAK,KAAA;CAGxB;AAED,eAAe,OAAO,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logic.d.ts","sourceRoot":"","sources":["../../../src/commands/logic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAiD,MAAM,kBAAkB,CAAA;AAGhG,eAAO,MAAM,GAAG,QAAQ,CAAA;AACxB,eAAO,MAAM,EAAE,OAAO,CAAA;AACtB,eAAO,MAAM,GAAG,QAAQ,CAAA;AACxB,eAAO,MAAM,GAAG,QAAQ,CAAA;AAExB,oBAAY,sBAAsB;IAChC,GAAG,QAAQ;IACX,EAAE,OAAO;IACT,GAAG,QAAQ;IACX,GAAG,QAAQ;CACZ;AAED,qBAAa,YAAY;IAEhB,SAAS,EAAE,MAAM,GAAG,cAAc,CAAA;IAClC,QAAQ,EAAE,sBAAsB,GAAG,MAAM,CAAA;IACzC,QAAQ,EAAE,GAAG,EAAE,CAAA;IACf,aAAa,iBAAuB;gBAE/B,QAAQ,EAAE,sBAAsB,GAAG,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,cAAc;IA2DzG,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,YAAY;IAiB9C,GAAG,CAAC,GAAG,eAAe,EAAE,YAAY,EAAE;IAUtC,EAAE,CAAC,GAAG,eAAe,EAAE,YAAY,EAAE;CAgBtC;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,YAAY,CAElE;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,YAAY,CAEvE;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/commands/query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,cAAc,EAAwB,MAAM,kBAAkB,CAAA;AACvE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAGpG,eAAO,MAAM,EAAE,OAAO,CAAA;AACtB,eAAO,MAAM,GAAG,QAAQ,CAAA;AACxB,eAAO,MAAM,EAAE,OAAO,CAAA;AACtB,eAAO,MAAM,GAAG,QAAQ,CAAA;AACxB,eAAO,MAAM,EAAE,OAAO,CAAA;AACtB,eAAO,MAAM,GAAG,QAAQ,CAAA;AACxB,eAAO,MAAM,EAAE,OAAO,CAAA;AACtB,eAAO,MAAM,GAAG,QAAQ,CAAA;AACxB,eAAO,MAAM,GAAG,QAAQ,CAAA;AACxB,eAAO,MAAM,UAAU,cAAc,CAAA;AACrC,eAAO,MAAM,MAAM,WAAW,CAAA;AAC9B,eAAO,MAAM,IAAI,SAAS,CAAA;AAC1B,eAAO,MAAM,GAAG,QAAQ,CAAA;AAExB,oBAAY,sBAAsB;IAChC,EAAE,OAAO;IACT,GAAG,QAAQ;IACX,EAAE,OAAO;IACT,GAAG,QAAQ;IACX,EAAE,OAAO;IACT,GAAG,QAAQ;IACX,EAAE,OAAO;IACT,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,UAAU,cAAc;IACxB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,QAAQ,YAAY;IACpB,UAAU,cAAc;IACxB,cAAc,kBAAkB;CACjC;AAED,qBAAa,YAAa,SAAQ,YAAY;IACrC,QAAQ,EAAE,sBAAsB,CAAC;gBAGtC,QAAQ,EAAE,sBAAsB,EAChC,QAAQ,EAAE,GAAG,EACb,SAAS,CAAC,EAAE,MAAM,GAAG,cAAc;IAOrC,MAAM;;;IAcN,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,YAAY;IAK9C,EAAE,CAAC,GAAG,EAAE,GAAG;IAKX,GAAG,CAAC,GAAG,EAAE,GAAG;IAKZ,EAAE,CAAC,GAAG,EAAE,GAAG;IAKX,GAAG,CAAC,GAAG,EAAE,GAAG;IAKZ,EAAE,CAAC,GAAG,EAAE,GAAG;IAKX,GAAG,CAAC,GAAG,EAAE,GAAG;IAKZ,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE;IAKd,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE;IAKf,OAAO,CAAC,GAAG,EAAE,eAAe;IAkB5B,SAAS,CAAC,GAAG,EAAE,iBAAiB;IAUhC,aAAa,CAAC,GAAG,EAAE,qBAAqB;CAgBzC;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,YAAY,CAElE;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,YAAY,CAEvE;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,YAAY,CAEvE;AAED,eAAe,YAAY,CAAA;AAE3B,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,KAAK,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,OAAO,GAAG,YAAY,CAAC;CAClC;AAED,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,KAAK,GAAG,UAAU,GAAG,OAAO,GAAG,UAAU,GAAG,eAAe,GAAG,YAAY,CAAC;CACtF"}
|
|
@@ -2,10 +2,12 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
2
2
|
var extendStatics = function (d, b) {
|
|
3
3
|
extendStatics = Object.setPrototypeOf ||
|
|
4
4
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
-
function (d, b) { for (var p in b) if (
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
6
|
return extendStatics(d, b);
|
|
7
7
|
};
|
|
8
8
|
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
9
11
|
extendStatics(d, b);
|
|
10
12
|
function __() { this.constructor = d; }
|
|
11
13
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
@@ -107,20 +109,20 @@ var QueryCommand = (function (_super) {
|
|
|
107
109
|
};
|
|
108
110
|
QueryCommand.prototype.geoNear = function (val) {
|
|
109
111
|
if (!(val.geometry instanceof Point)) {
|
|
110
|
-
throw new TypeError("\"geometry\" must be of type Point. Received type "
|
|
112
|
+
throw new TypeError("\"geometry\" must be of type Point. Received type ".concat(typeof val.geometry));
|
|
111
113
|
}
|
|
112
114
|
if (val.maxDistance !== undefined && !isNumber(val.maxDistance)) {
|
|
113
|
-
throw new TypeError("\"maxDistance\" must be of type Number. Received type "
|
|
115
|
+
throw new TypeError("\"maxDistance\" must be of type Number. Received type ".concat(typeof val.maxDistance));
|
|
114
116
|
}
|
|
115
117
|
if (val.minDistance !== undefined && !isNumber(val.minDistance)) {
|
|
116
|
-
throw new TypeError("\"minDistance\" must be of type Number. Received type "
|
|
118
|
+
throw new TypeError("\"minDistance\" must be of type Number. Received type ".concat(typeof val.minDistance));
|
|
117
119
|
}
|
|
118
120
|
var command = new QueryCommand(QUERY_COMMANDS_LITERAL.GEO_NEAR, [val], this.fieldName);
|
|
119
121
|
return this.and(command);
|
|
120
122
|
};
|
|
121
123
|
QueryCommand.prototype.geoWithin = function (val) {
|
|
122
124
|
if (!(val.geometry instanceof MultiPolygon) && !(val.geometry instanceof Polygon)) {
|
|
123
|
-
throw new TypeError("\"geometry\" must be of type Polygon or MultiPolygon. Received type "
|
|
125
|
+
throw new TypeError("\"geometry\" must be of type Polygon or MultiPolygon. Received type ".concat(typeof val.geometry));
|
|
124
126
|
}
|
|
125
127
|
var command = new QueryCommand(QUERY_COMMANDS_LITERAL.GEO_WITHIN, [val], this.fieldName);
|
|
126
128
|
return this.and(command);
|
|
@@ -132,7 +134,7 @@ var QueryCommand = (function (_super) {
|
|
|
132
134
|
!(val.geometry instanceof MultiPoint) &&
|
|
133
135
|
!(val.geometry instanceof MultiLineString) &&
|
|
134
136
|
!(val.geometry instanceof MultiPolygon)) {
|
|
135
|
-
throw new TypeError("\"geometry\" must be of type Point, LineString, Polygon, MultiPoint, MultiLineString or MultiPolygon. Received type "
|
|
137
|
+
throw new TypeError("\"geometry\" must be of type Point, LineString, Polygon, MultiPoint, MultiLineString or MultiPolygon. Received type ".concat(typeof val.geometry));
|
|
136
138
|
}
|
|
137
139
|
var command = new QueryCommand(QUERY_COMMANDS_LITERAL.GEO_INTERSECTS, [val], this.fieldName);
|
|
138
140
|
return this.and(command);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../src/commands/update.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAkD,MAAM,kBAAkB,CAAA;AAEjG,oBAAY,uBAAuB;IACjC,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,IAAI,SAAS;IACb,QAAQ,YAAY;IACpB,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,UAAU,aAAa;IACvB,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,GAAG,QAAQ;IACX,GAAG,QAAQ;CACZ;AAED,qBAAa,aAAa;IAEjB,SAAS,EAAE,MAAM,GAAG,cAAc,CAAA;IAClC,QAAQ,EAAE,uBAAuB,CAAA;IACjC,QAAQ,EAAE,GAAG,CAAA;IACb,aAAa,iBAAwB;gBAEhC,QAAQ,EAAE,uBAAuB,EAAE,QAAQ,CAAC,EAAE,GAAG,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,cAAc;IAclG,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa;CAIhD;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,aAAa,CAEpE;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,aAAa,CAEzE;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.config.d.ts","sourceRoot":"","sources":["../../../src/config/app.config.ts"],"names":[],"mappings":";;;;;AAAA,wBAUC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.config.d.ts","sourceRoot":"","sources":["../../../src/config/error.config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;CAiCtD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../../../src/const/code.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoClB,CAAA"}
|
package/dist/esm/constant.d.ts
CHANGED
|
@@ -25,9 +25,9 @@ declare const FieldType: {
|
|
|
25
25
|
ServerDate: string;
|
|
26
26
|
BsonDate: string;
|
|
27
27
|
};
|
|
28
|
-
|
|
28
|
+
type OrderByDirection = 'desc' | 'asc';
|
|
29
29
|
declare const OrderDirectionList: string[];
|
|
30
|
-
|
|
30
|
+
type WhereFilterOp = '<' | '<=' | '==' | '>=' | '>';
|
|
31
31
|
declare const WhereFilterOpList: string[];
|
|
32
32
|
declare enum Opeartor {
|
|
33
33
|
lt = "<",
|
|
@@ -37,11 +37,11 @@ declare enum Opeartor {
|
|
|
37
37
|
eq = "=="
|
|
38
38
|
}
|
|
39
39
|
declare const OperatorMap: {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
"==": string;
|
|
41
|
+
"<": string;
|
|
42
|
+
"<=": string;
|
|
43
|
+
">": string;
|
|
44
|
+
">=": string;
|
|
45
45
|
};
|
|
46
46
|
declare const UpdateOperatorList: string[];
|
|
47
47
|
declare enum QueryType {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constant.d.ts","sourceRoot":"","sources":["../../src/constant.ts"],"names":[],"mappings":"AASA,aAAK,SAAS;IACZ,UAAU,qCAAY;IACtB,aAAa,+CAAY;IACzB,UAAU,yCAAW;IACrB,cAAc,+CAAY;IAC1B,aAAa,oBAAoB;IACjC,mBAAmB,2DAAc;IACjC,oBAAoB,gFAAyB;CAC9C;AAKD,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;CAiBd,CAAA;AAKD,aAAK,gBAAgB,GAAG,MAAM,GAAG,KAAK,CAAA;AAKtC,QAAA,MAAM,kBAAkB,UAAkB,CAAA;AAK1C,aAAK,aAAa,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,GAAG,CAAA;AAKnD,QAAA,MAAM,iBAAiB,UAA+B,CAAA;AAKtD,aAAK,QAAQ;IACX,EAAE,MAAM;IACR,EAAE,MAAM;IACR,GAAG,OAAO;IACV,GAAG,OAAO;IACV,EAAE,OAAO;CACV;AAMD,QAAA,MAAM,WAAW;;;;;;CAMhB,CAAA;AAED,QAAA,MAAM,kBAAkB,UAYvB,CAAA;AAMD,aAAK,SAAS;IACZ,KAAK,UAAU;IACf,GAAG,QAAQ;CACZ;AAED,OAAO,EACL,SAAS,EACT,SAAS,EACT,aAAa,EACb,iBAAiB,EACjB,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,SAAS,EACV,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../src/document.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AASnE,qBAAa,iBAAiB;IAI5B,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;IAK5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAuF3B,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAsF/C,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,GAAG;IAqDnC,MAAM,CAAC,QAAQ,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAiCpC,GAAG,CAAC,QAAQ,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAkCjC,KAAK,CAAC,UAAU,EAAE,MAAM,GAAG,iBAAiB;IAc5C,KAAK,iDAWJ;CACF"}
|
package/dist/esm/document.js
CHANGED
|
@@ -19,8 +19,8 @@ import { QueryType } from './constant';
|
|
|
19
19
|
import { getWsInstance } from './utils/utils';
|
|
20
20
|
var DocumentReference = (function () {
|
|
21
21
|
function DocumentReference(db, coll, docID, projection) {
|
|
22
|
-
var _this = this;
|
|
23
22
|
if (projection === void 0) { projection = {}; }
|
|
23
|
+
var _this = this;
|
|
24
24
|
this.watch = function (options) {
|
|
25
25
|
var ws = getWsInstance(_this._db);
|
|
26
26
|
return ws.watch(__assign(__assign({}, options), { envId: _this._db.config.env, collectionName: _this._coll, query: JSON.stringify({
|
|
@@ -30,7 +30,7 @@ var DocumentReference = (function () {
|
|
|
30
30
|
this._db = db;
|
|
31
31
|
this._coll = coll;
|
|
32
32
|
this.id = docID;
|
|
33
|
-
this.request =
|
|
33
|
+
this.request = Db.createRequest(this._db.config);
|
|
34
34
|
this.projection = projection;
|
|
35
35
|
}
|
|
36
36
|
DocumentReference.prototype.create = function (data, callback) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/geo/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,gBAAgB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../../src/geo/interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAChC;AAED,MAAM,WAAW,qBAAqB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAA;CAClC;AAED,MAAM,WAAW,kBAAkB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,CAAA;CACpC;AAED,MAAM,WAAW,qBAAqB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAA;CAClC;AAED,MAAM,WAAW,0BAA0B;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,CAAA;CACpC;AAED,MAAM,WAAW,uBAAuB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,CAAA;CACtC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -15,5 +15,5 @@ export declare class LineString {
|
|
|
15
15
|
};
|
|
16
16
|
static validate(lineString: ISerializedLineString): boolean;
|
|
17
17
|
static isClosed(lineString: LineString): boolean;
|
|
18
|
-
|
|
18
|
+
get _internalType(): import("../utils/symbol").InternalSymbol;
|
|
19
19
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lineString.d.ts","sourceRoot":"","sources":["../../../src/geo/lineString.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAOnD,qBAAa,UAAU;IAEnB,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,CAAA;gBAOZ,MAAM,EAAE,KAAK,EAAE;IAgB3B,KAAK,CAAC,GAAG,KAAA;;;;;;IAST,MAAM;;;;IAON,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,qBAAqB;IAYjD,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,UAAU;aASlC,aAAa;CAGpB"}
|
|
@@ -15,14 +15,14 @@ import { isArray, isNumber } from '../utils/type';
|
|
|
15
15
|
var LineString = (function () {
|
|
16
16
|
function LineString(points) {
|
|
17
17
|
if (!isArray(points)) {
|
|
18
|
-
throw new TypeError("\"points\" must be of type Point[]. Received type "
|
|
18
|
+
throw new TypeError("\"points\" must be of type Point[]. Received type ".concat(typeof points));
|
|
19
19
|
}
|
|
20
20
|
if (points.length < 2) {
|
|
21
21
|
throw new Error('"points" must contain 2 points at least');
|
|
22
22
|
}
|
|
23
23
|
points.forEach(function (point) {
|
|
24
24
|
if (!(point instanceof Point)) {
|
|
25
|
-
throw new TypeError("\"points\" must be of type Point[]. Received type "
|
|
25
|
+
throw new TypeError("\"points\" must be of type Point[]. Received type ".concat(typeof point, "[]"));
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
this.points = points;
|
|
@@ -75,7 +75,7 @@ var LineString = (function () {
|
|
|
75
75
|
get: function () {
|
|
76
76
|
return SYMBOL_GEO_LINE_STRING;
|
|
77
77
|
},
|
|
78
|
-
enumerable:
|
|
78
|
+
enumerable: false,
|
|
79
79
|
configurable: true
|
|
80
80
|
});
|
|
81
81
|
return LineString;
|
|
@@ -14,5 +14,5 @@ export declare class MultiLineString {
|
|
|
14
14
|
coordinates: number[][][];
|
|
15
15
|
};
|
|
16
16
|
static validate(multiLineString: ISerializedMultiLineString): boolean;
|
|
17
|
-
|
|
17
|
+
get _internalType(): import("../utils/symbol").InternalSymbol;
|
|
18
18
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multiLineString.d.ts","sourceRoot":"","sources":["../../../src/geo/multiLineString.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,0BAA0B,EAAE,MAAM,aAAa,CAAA;AAQxD,qBAAa,eAAe;IAExB,QAAQ,CAAC,KAAK,EAAE,UAAU,EAAE,CAAA;gBAOhB,KAAK,EAAE,UAAU,EAAE;IAgB/B,KAAK,CAAC,GAAG,KAAA;;;;;;IAWT,MAAM;;;;IASN,MAAM,CAAC,QAAQ,CAAC,eAAe,EAAE,0BAA0B;aAcvD,aAAa;CAGpB"}
|
|
@@ -15,14 +15,14 @@ import { LineString } from './lineString';
|
|
|
15
15
|
var MultiLineString = (function () {
|
|
16
16
|
function MultiLineString(lines) {
|
|
17
17
|
if (!isArray(lines)) {
|
|
18
|
-
throw new TypeError("\"lines\" must be of type LineString[]. Received type "
|
|
18
|
+
throw new TypeError("\"lines\" must be of type LineString[]. Received type ".concat(typeof lines));
|
|
19
19
|
}
|
|
20
20
|
if (lines.length === 0) {
|
|
21
21
|
throw new Error('Polygon must contain 1 linestring at least');
|
|
22
22
|
}
|
|
23
23
|
lines.forEach(function (line) {
|
|
24
24
|
if (!(line instanceof LineString)) {
|
|
25
|
-
throw new TypeError("\"lines\" must be of type LineString[]. Received type "
|
|
25
|
+
throw new TypeError("\"lines\" must be of type LineString[]. Received type ".concat(typeof line, "[]"));
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
this.lines = lines;
|
|
@@ -84,7 +84,7 @@ var MultiLineString = (function () {
|
|
|
84
84
|
get: function () {
|
|
85
85
|
return SYMBOL_GEO_MULTI_LINE_STRING;
|
|
86
86
|
},
|
|
87
|
-
enumerable:
|
|
87
|
+
enumerable: false,
|
|
88
88
|
configurable: true
|
|
89
89
|
});
|
|
90
90
|
return MultiLineString;
|
|
@@ -14,5 +14,5 @@ export declare class MultiPoint {
|
|
|
14
14
|
coordinates: number[][];
|
|
15
15
|
};
|
|
16
16
|
static validate(multiPoint: ISerializedMultiPoint): boolean;
|
|
17
|
-
|
|
17
|
+
get _internalType(): import("../utils/symbol").InternalSymbol;
|
|
18
18
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multiPoint.d.ts","sourceRoot":"","sources":["../../../src/geo/multiPoint.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAE/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAOnD,qBAAa,UAAU;IAEnB,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,CAAA;gBAOZ,MAAM,EAAE,KAAK,EAAE;IAgB3B,KAAK,CAAC,GAAG,KAAA;;;;;;IAST,MAAM;;;;IAON,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,qBAAqB;aAY7C,aAAa;CAGpB"}
|
|
@@ -15,14 +15,14 @@ import { isArray, isNumber } from '../utils/type';
|
|
|
15
15
|
var MultiPoint = (function () {
|
|
16
16
|
function MultiPoint(points) {
|
|
17
17
|
if (!isArray(points)) {
|
|
18
|
-
throw new TypeError("\"points\" must be of type Point[]. Received type "
|
|
18
|
+
throw new TypeError("\"points\" must be of type Point[]. Received type ".concat(typeof points));
|
|
19
19
|
}
|
|
20
20
|
if (points.length === 0) {
|
|
21
21
|
throw new Error('"points" must contain 1 point at least');
|
|
22
22
|
}
|
|
23
23
|
points.forEach(function (point) {
|
|
24
24
|
if (!(point instanceof Point)) {
|
|
25
|
-
throw new TypeError("\"points\" must be of type Point[]. Received type "
|
|
25
|
+
throw new TypeError("\"points\" must be of type Point[]. Received type ".concat(typeof point, "[]"));
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
this.points = points;
|
|
@@ -68,7 +68,7 @@ var MultiPoint = (function () {
|
|
|
68
68
|
get: function () {
|
|
69
69
|
return SYMBOL_GEO_MULTI_POINT;
|
|
70
70
|
},
|
|
71
|
-
enumerable:
|
|
71
|
+
enumerable: false,
|
|
72
72
|
configurable: true
|
|
73
73
|
});
|
|
74
74
|
return MultiPoint;
|
|
@@ -14,5 +14,5 @@ export declare class MultiPolygon {
|
|
|
14
14
|
coordinates: number[][][][];
|
|
15
15
|
};
|
|
16
16
|
static validate(multiPolygon: ISerializedMultiPolygon): boolean;
|
|
17
|
-
|
|
17
|
+
get _internalType(): import("../utils/symbol").InternalSymbol;
|
|
18
18
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multiPolygon.d.ts","sourceRoot":"","sources":["../../../src/geo/multiPolygon.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAQrD,qBAAa,YAAY;IAErB,QAAQ,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAA;gBAOhB,QAAQ,EAAE,OAAO,EAAE;IAgB/B,KAAK,CAAC,GAAG,KAAA;;;;;;IAaT,MAAM;;;;IAWN,MAAM,CAAC,QAAQ,CAAC,YAAY,EAAE,uBAAuB;aAgBjD,aAAa;CAGpB"}
|
|
@@ -16,7 +16,7 @@ var MultiPolygon = (function () {
|
|
|
16
16
|
function MultiPolygon(polygons) {
|
|
17
17
|
var e_1, _a;
|
|
18
18
|
if (!isArray(polygons)) {
|
|
19
|
-
throw new TypeError("\"polygons\" must be of type Polygon[]. Received type "
|
|
19
|
+
throw new TypeError("\"polygons\" must be of type Polygon[]. Received type ".concat(typeof polygons));
|
|
20
20
|
}
|
|
21
21
|
if (polygons.length === 0) {
|
|
22
22
|
throw new Error('MultiPolygon must contain 1 polygon at least');
|
|
@@ -25,7 +25,7 @@ var MultiPolygon = (function () {
|
|
|
25
25
|
for (var polygons_1 = __values(polygons), polygons_1_1 = polygons_1.next(); !polygons_1_1.done; polygons_1_1 = polygons_1.next()) {
|
|
26
26
|
var polygon = polygons_1_1.value;
|
|
27
27
|
if (!(polygon instanceof Polygon)) {
|
|
28
|
-
throw new TypeError("\"polygon\" must be of type Polygon[]. Received type "
|
|
28
|
+
throw new TypeError("\"polygon\" must be of type Polygon[]. Received type ".concat(typeof polygon, "[]"));
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -111,7 +111,7 @@ var MultiPolygon = (function () {
|
|
|
111
111
|
get: function () {
|
|
112
112
|
return SYMBOL_GEO_POLYGON;
|
|
113
113
|
},
|
|
114
|
-
enumerable:
|
|
114
|
+
enumerable: false,
|
|
115
115
|
configurable: true
|
|
116
116
|
});
|
|
117
117
|
return MultiPolygon;
|
package/dist/esm/geo/point.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"point.d.ts","sourceRoot":"","sources":["../../../src/geo/point.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAO9C,qBAAa,KAAK;IAKhB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAM1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;gBAQf,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAQ/C,KAAK,CAAC,GAAG,KAAA;;;;;;IAST,MAAM;;;;IAUN,gBAAgB;IAIhB,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,gBAAgB;aAOnC,aAAa;CAGlB"}
|
package/dist/esm/geo/point.js
CHANGED
|
@@ -27,7 +27,7 @@ var Point = (function () {
|
|
|
27
27
|
};
|
|
28
28
|
};
|
|
29
29
|
Point.prototype.toReadableString = function () {
|
|
30
|
-
return "["
|
|
30
|
+
return "[".concat(this.longitude, ",").concat(this.latitude, "]");
|
|
31
31
|
};
|
|
32
32
|
Point.validate = function (point) {
|
|
33
33
|
return point.type === 'Point' &&
|
|
@@ -39,7 +39,7 @@ var Point = (function () {
|
|
|
39
39
|
get: function () {
|
|
40
40
|
return SYMBOL_GEO_POINT;
|
|
41
41
|
},
|
|
42
|
-
enumerable:
|
|
42
|
+
enumerable: false,
|
|
43
43
|
configurable: true
|
|
44
44
|
});
|
|
45
45
|
return Point;
|
|
@@ -15,5 +15,5 @@ export declare class Polygon {
|
|
|
15
15
|
};
|
|
16
16
|
static validate(polygon: ISerializedPolygon): boolean;
|
|
17
17
|
static isCloseLineString(lineString: any): boolean;
|
|
18
|
-
|
|
18
|
+
get _internalType(): import("../utils/symbol").InternalSymbol;
|
|
19
19
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polygon.d.ts","sourceRoot":"","sources":["../../../src/geo/polygon.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAOhD,qBAAa,OAAO;IAEhB,QAAQ,CAAC,KAAK,EAAE,UAAU,EAAE,CAAA;gBAOhB,KAAK,EAAE,UAAU,EAAE;IAmB/B,KAAK,CAAC,GAAG,KAAA;;;;;;IAWT,MAAM;;;;IASN,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,kBAAkB;IAiB3C,MAAM,CAAC,iBAAiB,CAAC,UAAU,KAAA;aAW/B,aAAa;CAGpB"}
|
package/dist/esm/geo/polygon.js
CHANGED
|
@@ -15,17 +15,17 @@ import { LineString } from './lineString';
|
|
|
15
15
|
var Polygon = (function () {
|
|
16
16
|
function Polygon(lines) {
|
|
17
17
|
if (!isArray(lines)) {
|
|
18
|
-
throw new TypeError("\"lines\" must be of type LineString[]. Received type "
|
|
18
|
+
throw new TypeError("\"lines\" must be of type LineString[]. Received type ".concat(typeof lines));
|
|
19
19
|
}
|
|
20
20
|
if (lines.length === 0) {
|
|
21
21
|
throw new Error('Polygon must contain 1 linestring at least');
|
|
22
22
|
}
|
|
23
23
|
lines.forEach(function (line) {
|
|
24
24
|
if (!(line instanceof LineString)) {
|
|
25
|
-
throw new TypeError("\"lines\" must be of type LineString[]. Received type "
|
|
25
|
+
throw new TypeError("\"lines\" must be of type LineString[]. Received type ".concat(typeof line, "[]"));
|
|
26
26
|
}
|
|
27
27
|
if (!LineString.isClosed(line)) {
|
|
28
|
-
throw new Error("LineString "
|
|
28
|
+
throw new Error("LineString ".concat(line.points.map(function (p) { return p.toReadableString(); }), " is not a closed cycle"));
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
this.lines = lines;
|
|
@@ -98,7 +98,7 @@ var Polygon = (function () {
|
|
|
98
98
|
get: function () {
|
|
99
99
|
return SYMBOL_GEO_MULTI_POLYGON;
|
|
100
100
|
},
|
|
101
|
-
enumerable:
|
|
101
|
+
enumerable: false,
|
|
102
102
|
configurable: true
|
|
103
103
|
});
|
|
104
104
|
return Polygon;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"symbol.d.ts","sourceRoot":"","sources":["../../../src/helper/symbol.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,iBAAiB,CAAA;AAC5C,cAAc,iBAAiB,CAAA;AAE/B,eAAO,MAAM,uBAAuB,gBAAyC,CAAA;AAE7E,eAAO,MAAM,qBAAqB,gBAAuC,CAAA;AACzE,eAAO,MAAM,oBAAoB,gBAAsC,CAAA;AACvE,eAAO,MAAM,oBAAoB,gBAAsC,CAAA;AAEvE,eAAO,MAAM,gBAAgB,gBAAkC,CAAA;AAC/D,eAAO,MAAM,sBAAsB,gBAA+C,CAAA;AAClF,eAAO,MAAM,kBAAkB,gBAA2C,CAAA;AAC1E,eAAO,MAAM,sBAAsB,gBAA+C,CAAA;AAClF,eAAO,MAAM,4BAA4B,gBAAqD,CAAA;AAC9F,eAAO,MAAM,wBAAwB,gBAAiD,CAAA;AAEtF,eAAO,MAAM,kBAAkB,gBAAoC,CAAA;AAEnE,eAAO,MAAM,aAAa,gBAA+B,CAAA"}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { Point } from './geo/point';
|
|
2
2
|
import { CollectionReference } from './collection';
|
|
3
3
|
import { Command } from './command';
|
|
4
|
+
export interface IDbConfig {
|
|
5
|
+
env?: string;
|
|
6
|
+
instance?: string;
|
|
7
|
+
database?: string;
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}
|
|
4
10
|
interface GeoTeyp {
|
|
5
11
|
Point: typeof Point;
|
|
6
12
|
}
|
|
@@ -17,7 +23,7 @@ export declare class Db {
|
|
|
17
23
|
logicCommand: any;
|
|
18
24
|
updateCommand: any;
|
|
19
25
|
queryCommand: any;
|
|
20
|
-
config:
|
|
26
|
+
config: IDbConfig;
|
|
21
27
|
static ws: any;
|
|
22
28
|
static reqClass: any;
|
|
23
29
|
static wsClass: any;
|
|
@@ -27,7 +33,8 @@ export declare class Db {
|
|
|
27
33
|
static dataVersion: string;
|
|
28
34
|
static runtime: string;
|
|
29
35
|
static appSecretInfo: any;
|
|
30
|
-
|
|
36
|
+
static createRequest(config: IDbConfig): any;
|
|
37
|
+
constructor(config?: IDbConfig);
|
|
31
38
|
collection(collName: string): CollectionReference;
|
|
32
39
|
createCollection(collName: string): any;
|
|
33
40
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAEnC,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAWnC,UAAU,OAAO;IACf,KAAK,EAAE,OAAO,KAAK,CAAA;CACpB;AAED,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAC/B,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAO9C,qBAAa,EAAE;IAIb,GAAG,EAAE,OAAO,CAAA;IAKZ,OAAO,EAAE,OAAO,OAAO,CAAA;IAEvB,MAAM,EAAE,GAAG,CAAA;IAEX,UAAU,EAAE,GAAG,CAAA;IAEf,gBAAgB,EAAE,GAAG,CAAA;IAErB,cAAc,EAAE,GAAG,CAAA;IAEnB,YAAY,EAAE,GAAG,CAAA;IAEjB,aAAa,EAAE,GAAG,CAAA;IAElB,YAAY,EAAE,GAAG,CAAA;IASjB,MAAM,EAAE,GAAG,CAAA;IAEX,MAAM,CAAC,EAAE,EAAE,GAAG,CAAA;IAEd,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAA;IAEpB,MAAM,CAAC,OAAO,EAAE,GAAG,CAAA;IAEnB,MAAM,CAAC,aAAa,EAAE,GAAG,CAAA;IAGzB,MAAM,CAAC,UAAU,EAAE,QAAQ,CAAA;IAE3B,MAAM,CAAC,cAAc,EAAE,QAAQ,CAAA;IAE/B,MAAM,CAAC,WAAW,EAAE,MAAM,CAAA;IAE1B,MAAM,CAAC,OAAO,EAAE,MAAM,CAAA;IAEtB,MAAM,CAAC,aAAa,EAAE,GAAG,CAAA;gBAEb,MAAM,CAAC,EAAE,GAAG;IAoBxB,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,mBAAmB;IAUjD,gBAAgB,CAAC,QAAQ,EAAE,MAAM;CASlC"}
|