@cloudbase/database 0.9.22 → 0.10.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.
Files changed (176) hide show
  1. package/coverage/lcov-report/base.css +224 -0
  2. package/coverage/lcov-report/block-navigation.js +87 -0
  3. package/coverage/lcov-report/favicon.png +0 -0
  4. package/coverage/lcov-report/index.html +101 -0
  5. package/coverage/lcov-report/prettify.css +1 -0
  6. package/coverage/lcov-report/prettify.js +2 -0
  7. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  8. package/coverage/lcov-report/sorter.js +210 -0
  9. package/coverage/lcov.info +0 -0
  10. package/dist/commonjs/aggregate.js +3 -3
  11. package/dist/commonjs/collection.d.ts +1 -1
  12. package/dist/commonjs/collection.js +5 -2
  13. package/dist/commonjs/command.d.ts +5 -5
  14. package/dist/commonjs/command.js +9 -8
  15. package/dist/commonjs/commands/logic.js +3 -2
  16. package/dist/commonjs/commands/query.js +11 -8
  17. package/dist/commonjs/commands/update.js +1 -0
  18. package/dist/commonjs/config/error.config.js +1 -0
  19. package/dist/commonjs/const/code.js +1 -0
  20. package/dist/commonjs/constant.d.ts +7 -7
  21. package/dist/commonjs/constant.js +1 -0
  22. package/dist/commonjs/document.js +11 -10
  23. package/dist/commonjs/geo/index.js +20 -9
  24. package/dist/commonjs/geo/lineString.d.ts +1 -1
  25. package/dist/commonjs/geo/lineString.js +7 -6
  26. package/dist/commonjs/geo/multiLineString.d.ts +1 -1
  27. package/dist/commonjs/geo/multiLineString.js +7 -6
  28. package/dist/commonjs/geo/multiPoint.d.ts +1 -1
  29. package/dist/commonjs/geo/multiPoint.js +7 -6
  30. package/dist/commonjs/geo/multiPolygon.d.ts +1 -1
  31. package/dist/commonjs/geo/multiPolygon.js +7 -6
  32. package/dist/commonjs/geo/point.d.ts +1 -1
  33. package/dist/commonjs/geo/point.js +4 -3
  34. package/dist/commonjs/geo/polygon.d.ts +1 -1
  35. package/dist/commonjs/geo/polygon.js +8 -7
  36. package/dist/commonjs/helper/symbol.js +16 -4
  37. package/dist/commonjs/index.d.ts +9 -2
  38. package/dist/commonjs/index.js +19 -4
  39. package/dist/commonjs/lib/util.js +4 -3
  40. package/dist/commonjs/operator-map.js +1 -0
  41. package/dist/commonjs/query.js +10 -9
  42. package/dist/commonjs/regexp/index.d.ts +1 -1
  43. package/dist/commonjs/regexp/index.js +2 -1
  44. package/dist/commonjs/serializer/common.d.ts +2 -2
  45. package/dist/commonjs/serializer/common.js +23 -17
  46. package/dist/commonjs/serializer/datatype.d.ts +2 -2
  47. package/dist/commonjs/serializer/datatype.js +20 -14
  48. package/dist/commonjs/serializer/query.d.ts +1 -1
  49. package/dist/commonjs/serializer/query.js +24 -23
  50. package/dist/commonjs/serializer/update.d.ts +1 -1
  51. package/dist/commonjs/serializer/update.js +12 -11
  52. package/dist/commonjs/serverDate/index.d.ts +1 -1
  53. package/dist/commonjs/serverDate/index.js +3 -2
  54. package/dist/commonjs/transaction/collection.d.ts +1 -1
  55. package/dist/commonjs/transaction/collection.js +5 -2
  56. package/dist/commonjs/transaction/document.d.ts +1 -1
  57. package/dist/commonjs/transaction/document.js +5 -5
  58. package/dist/commonjs/transaction/index.js +3 -2
  59. package/dist/commonjs/transaction/query.js +1 -0
  60. package/dist/commonjs/typings/index.d.ts +3 -3
  61. package/dist/commonjs/typings/realtime.d.ts +16 -16
  62. package/dist/commonjs/util.js +1 -0
  63. package/dist/commonjs/utils/error.d.ts +2 -1
  64. package/dist/commonjs/utils/error.js +15 -9
  65. package/dist/commonjs/utils/symbol.js +5 -4
  66. package/dist/commonjs/utils/type.d.ts +1 -1
  67. package/dist/commonjs/utils/type.js +23 -11
  68. package/dist/commonjs/utils/utils.js +6 -3
  69. package/dist/commonjs/validate.js +1 -0
  70. package/dist/esm/aggregate.d.ts.map +1 -0
  71. package/dist/esm/aggregate.js +3 -3
  72. package/dist/esm/collection.d.ts +1 -1
  73. package/dist/esm/collection.d.ts.map +1 -0
  74. package/dist/esm/collection.js +4 -2
  75. package/dist/esm/command.d.ts +5 -5
  76. package/dist/esm/command.d.ts.map +1 -0
  77. package/dist/esm/commands/logic.d.ts.map +1 -0
  78. package/dist/esm/commands/query.d.ts.map +1 -0
  79. package/dist/esm/commands/query.js +8 -6
  80. package/dist/esm/commands/update.d.ts.map +1 -0
  81. package/dist/esm/config/app.config.d.ts.map +1 -0
  82. package/dist/esm/config/error.config.d.ts.map +1 -0
  83. package/dist/esm/const/code.d.ts.map +1 -0
  84. package/dist/esm/constant.d.ts +7 -7
  85. package/dist/esm/constant.d.ts.map +1 -0
  86. package/dist/esm/document.d.ts.map +1 -0
  87. package/dist/esm/document.js +2 -2
  88. package/dist/esm/geo/index.d.ts.map +1 -0
  89. package/dist/esm/geo/interface.d.ts.map +1 -0
  90. package/dist/esm/geo/interface.js +1 -0
  91. package/dist/esm/geo/lineString.d.ts +1 -1
  92. package/dist/esm/geo/lineString.d.ts.map +1 -0
  93. package/dist/esm/geo/lineString.js +3 -3
  94. package/dist/esm/geo/multiLineString.d.ts +1 -1
  95. package/dist/esm/geo/multiLineString.d.ts.map +1 -0
  96. package/dist/esm/geo/multiLineString.js +3 -3
  97. package/dist/esm/geo/multiPoint.d.ts +1 -1
  98. package/dist/esm/geo/multiPoint.d.ts.map +1 -0
  99. package/dist/esm/geo/multiPoint.js +3 -3
  100. package/dist/esm/geo/multiPolygon.d.ts +1 -1
  101. package/dist/esm/geo/multiPolygon.d.ts.map +1 -0
  102. package/dist/esm/geo/multiPolygon.js +3 -3
  103. package/dist/esm/geo/point.d.ts +1 -1
  104. package/dist/esm/geo/point.d.ts.map +1 -0
  105. package/dist/esm/geo/point.js +2 -2
  106. package/dist/esm/geo/polygon.d.ts +1 -1
  107. package/dist/esm/geo/polygon.d.ts.map +1 -0
  108. package/dist/esm/geo/polygon.js +4 -4
  109. package/dist/esm/helper/symbol.d.ts.map +1 -0
  110. package/dist/esm/index.d.ts +9 -2
  111. package/dist/esm/index.d.ts.map +1 -0
  112. package/dist/esm/index.js +15 -1
  113. package/dist/esm/lib/util.d.ts.map +1 -0
  114. package/dist/esm/lib/util.js +1 -2
  115. package/dist/esm/operator-map.d.ts.map +1 -0
  116. package/dist/esm/query.d.ts.map +1 -0
  117. package/dist/esm/query.js +4 -4
  118. package/dist/esm/regexp/index.d.ts +1 -1
  119. package/dist/esm/regexp/index.d.ts.map +1 -0
  120. package/dist/esm/regexp/index.js +1 -1
  121. package/dist/esm/serializer/common.d.ts +2 -2
  122. package/dist/esm/serializer/common.d.ts.map +1 -0
  123. package/dist/esm/serializer/common.js +15 -10
  124. package/dist/esm/serializer/datatype.d.ts +2 -2
  125. package/dist/esm/serializer/datatype.d.ts.map +1 -0
  126. package/dist/esm/serializer/datatype.js +12 -7
  127. package/dist/esm/serializer/query.d.ts +1 -1
  128. package/dist/esm/serializer/query.d.ts.map +1 -0
  129. package/dist/esm/serializer/query.js +2 -2
  130. package/dist/esm/serializer/update.d.ts +1 -1
  131. package/dist/esm/serializer/update.d.ts.map +1 -0
  132. package/dist/esm/serverDate/index.d.ts +1 -1
  133. package/dist/esm/serverDate/index.d.ts.map +1 -0
  134. package/dist/esm/serverDate/index.js +2 -2
  135. package/dist/esm/transaction/collection.d.ts +1 -1
  136. package/dist/esm/transaction/collection.d.ts.map +1 -0
  137. package/dist/esm/transaction/collection.js +4 -2
  138. package/dist/esm/transaction/document.d.ts +1 -1
  139. package/dist/esm/transaction/document.d.ts.map +1 -0
  140. package/dist/esm/transaction/document.js +2 -3
  141. package/dist/esm/transaction/index.d.ts.map +1 -0
  142. package/dist/esm/transaction/index.js +2 -2
  143. package/dist/esm/transaction/query.d.ts.map +1 -0
  144. package/dist/esm/typings/index.d.ts +3 -3
  145. package/dist/esm/typings/index.d.ts.map +1 -0
  146. package/dist/esm/typings/index.js +1 -0
  147. package/dist/esm/typings/realtime.d.ts +16 -16
  148. package/dist/esm/typings/realtime.d.ts.map +1 -0
  149. package/dist/esm/typings/realtime.js +1 -0
  150. package/dist/esm/util.d.ts.map +1 -0
  151. package/dist/esm/utils/error.d.ts +2 -1
  152. package/dist/esm/utils/error.d.ts.map +1 -0
  153. package/dist/esm/utils/error.js +7 -5
  154. package/dist/esm/utils/msg.d.ts.map +1 -0
  155. package/dist/esm/utils/symbol.d.ts.map +1 -0
  156. package/dist/esm/utils/symbol.js +4 -4
  157. package/dist/esm/utils/type.d.ts +1 -1
  158. package/dist/esm/utils/type.d.ts.map +1 -0
  159. package/dist/esm/utils/utils.d.ts.map +1 -0
  160. package/dist/esm/utils/utils.js +1 -1
  161. package/dist/esm/validate.d.ts.map +1 -0
  162. package/jest.config.js +14 -0
  163. package/package.json +9 -4
  164. package/src/aggregate.ts +1 -1
  165. package/src/document.ts +1 -1
  166. package/src/index.ts +40 -4
  167. package/src/lib/util.ts +1 -2
  168. package/src/query.ts +4 -4
  169. package/src/transaction/index.ts +1 -1
  170. package/src/utils/utils.ts +1 -1
  171. package/tests/index.test.ts +111 -0
  172. package/tsconfig.esm.json +2 -1
  173. package/tsconfig.json +14 -5
  174. package/tsconfig.test.json +15 -0
  175. package/.trunk/configs/.markdownlint.yaml +0 -10
  176. 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
- exports.getType = function (x) { return Object.prototype.toString.call(x).slice(8, -1).toLowerCase(); };
5
- exports.isObject = function (x) { return exports.getType(x) === 'object'; };
6
- exports.isString = function (x) { return exports.getType(x) === 'string'; };
7
- exports.isNumber = function (x) { return exports.getType(x) === 'number'; };
8
- exports.isPromise = function (x) { return exports.getType(x) === 'promise'; };
9
- exports.isFunction = function (x) { return typeof x === 'function'; };
10
- exports.isArray = function (x) { return Array.isArray(x); };
11
- exports.isDate = function (x) { return exports.getType(x) === 'date'; };
12
- exports.isRegExp = function (x) { return exports.getType(x) === 'regexp'; };
13
- exports.isInternalObject = function (x) { return x && (x._internalType instanceof symbol_1.InternalSymbol); };
14
- exports.isPlainObject = function (obj) {
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
- exports.sleep = function (ms) {
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
- exports.autoCount = function (domain) {
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: new __1.Db.reqClass(db.config)
32
+ request: __1.Db.createRequest(db.config)
30
33
  }
31
34
  }
32
35
  });
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Validate = void 0;
3
4
  var constant_1 = require("./constant");
4
5
  var util_1 = require("./util");
5
6
  var Validate = (function () {
@@ -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"}
@@ -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 = new Db.reqClass(this._db.config);
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: "$" + stage,
90
+ stageKey: "$".concat(stage),
91
91
  stageValue: JSON.stringify(param)
92
92
  });
93
93
  return this;
@@ -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
- readonly name: string;
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"}
@@ -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 (b.hasOwnProperty(p)) d[p] = b[p]; };
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: true,
28
+ enumerable: false,
27
29
  configurable: true
28
30
  });
29
31
  CollectionReference.prototype.doc = function (docID) {
@@ -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 declare type IQueryCondition = Record<string, any> | LogicCommand;
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__: import("./serializer/datatype").IQueryCondition[]): LogicCommand;
24
- nor(...__expressions__: import("./serializer/datatype").IQueryCondition[]): LogicCommand;
25
- or(...__expressions__: import("./serializer/datatype").IQueryCondition[]): LogicCommand;
26
- not(...__expressions__: import("./serializer/datatype").IQueryCondition[]): LogicCommand;
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 (b.hasOwnProperty(p)) d[p] = b[p]; };
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 " + typeof val.geometry);
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 " + typeof val.maxDistance);
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 " + typeof val.minDistance);
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 " + typeof val.geometry);
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 " + typeof val.geometry);
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"}
@@ -25,9 +25,9 @@ declare const FieldType: {
25
25
  ServerDate: string;
26
26
  BsonDate: string;
27
27
  };
28
- declare type OrderByDirection = 'desc' | 'asc';
28
+ type OrderByDirection = 'desc' | 'asc';
29
29
  declare const OrderDirectionList: string[];
30
- declare type WhereFilterOp = '<' | '<=' | '==' | '>=' | '>';
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
- [Opeartor.eq]: string;
41
- [Opeartor.lt]: string;
42
- [Opeartor.lte]: string;
43
- [Opeartor.gt]: string;
44
- [Opeartor.gte]: string;
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"}
@@ -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 = new Db.reqClass(this._db.config);
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
- readonly _internalType: import("../utils/symbol").InternalSymbol;
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 " + typeof points);
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 " + typeof point + "[]");
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: true,
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
- readonly _internalType: import("../utils/symbol").InternalSymbol;
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 " + typeof lines);
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 " + typeof line + "[]");
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: true,
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
- readonly _internalType: import("../utils/symbol").InternalSymbol;
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 " + typeof points);
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 " + typeof point + "[]");
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: true,
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
- readonly _internalType: import("../utils/symbol").InternalSymbol;
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 " + typeof polygons);
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 " + typeof polygon + "[]");
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: true,
114
+ enumerable: false,
115
115
  configurable: true
116
116
  });
117
117
  return MultiPolygon;
@@ -15,5 +15,5 @@ export declare class Point {
15
15
  };
16
16
  toReadableString(): string;
17
17
  static validate(point: ISerializedPoint): boolean;
18
- readonly _internalType: import("../utils/symbol").InternalSymbol;
18
+ get _internalType(): import("../utils/symbol").InternalSymbol;
19
19
  }
@@ -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"}
@@ -27,7 +27,7 @@ var Point = (function () {
27
27
  };
28
28
  };
29
29
  Point.prototype.toReadableString = function () {
30
- return "[" + this.longitude + "," + this.latitude + "]";
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: true,
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
- readonly _internalType: import("../utils/symbol").InternalSymbol;
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"}
@@ -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 " + typeof lines);
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 " + typeof line + "[]");
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 " + line.points.map(function (p) { return p.toReadableString(); }) + " is not a closed cycle");
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: true,
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"}
@@ -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: any;
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
- constructor(config?: any);
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"}