owservable 0.8.40 → 0.8.42

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 (82) hide show
  1. package/lib/_enums/store.type.enum.d.ts +6 -6
  2. package/lib/_enums/store.type.enum.js +9 -9
  3. package/lib/_types/connection.manager.refresh.type.d.ts +9 -9
  4. package/lib/_types/connection.manager.refresh.type.js +2 -2
  5. package/lib/_types/cronjob.type.d.ts +7 -7
  6. package/lib/_types/cronjob.type.js +2 -2
  7. package/lib/_types/store.scope.type.d.ts +2 -2
  8. package/lib/_types/store.scope.type.js +2 -2
  9. package/lib/_types/store.subscription.config.type.d.ts +15 -15
  10. package/lib/_types/store.subscription.config.type.js +2 -2
  11. package/lib/_types/store.subscription.update.type.d.ts +9 -9
  12. package/lib/_types/store.subscription.update.type.js +2 -2
  13. package/lib/_types/subscription.methods.type.d.ts +6 -6
  14. package/lib/_types/subscription.methods.type.js +2 -2
  15. package/lib/_types/watcher.type.d.ts +6 -5
  16. package/lib/_types/watcher.type.js +2 -2
  17. package/lib/_types/worker.type.d.ts +5 -5
  18. package/lib/_types/worker.type.js +2 -2
  19. package/lib/auth/i.connection.manager.d.ts +9 -9
  20. package/lib/auth/i.connection.manager.js +2 -2
  21. package/lib/functions/action/add.action.cronjobs.d.ts +1 -1
  22. package/lib/functions/action/add.action.cronjobs.js +25 -25
  23. package/lib/functions/action/add.action.watchers.d.ts +1 -1
  24. package/lib/functions/action/add.action.watchers.js +22 -22
  25. package/lib/functions/action/add.action.workers.d.ts +1 -1
  26. package/lib/functions/action/add.action.workers.js +22 -22
  27. package/lib/functions/execute/execute.cronjob.d.ts +3 -3
  28. package/lib/functions/execute/execute.cronjob.js +12 -12
  29. package/lib/functions/execute/execute.on.files.recursively.d.ts +2 -2
  30. package/lib/functions/execute/execute.on.files.recursively.js +17 -17
  31. package/lib/functions/execute/execute.processes.in.folder.d.ts +2 -2
  32. package/lib/functions/execute/execute.processes.in.folder.js +10 -10
  33. package/lib/functions/execute/execute.watcher.d.ts +3 -3
  34. package/lib/functions/execute/execute.watcher.js +16 -11
  35. package/lib/functions/execute/execute.watcher.js.map +1 -1
  36. package/lib/functions/execute/execute.worker.d.ts +3 -3
  37. package/lib/functions/execute/execute.worker.js +11 -11
  38. package/lib/functions/initiate.cronjobs.d.ts +2 -2
  39. package/lib/functions/initiate.cronjobs.js +8 -8
  40. package/lib/functions/initiate.watchers.d.ts +2 -2
  41. package/lib/functions/initiate.watchers.js +8 -8
  42. package/lib/functions/initiate.workers.d.ts +2 -2
  43. package/lib/functions/initiate.workers.js +8 -8
  44. package/lib/middleware/data.middleware.map.d.ts +7 -7
  45. package/lib/middleware/data.middleware.map.js +18 -18
  46. package/lib/middleware/data.middleware.map.js.map +1 -1
  47. package/lib/mongodb/collections.models.map.d.ts +8 -8
  48. package/lib/mongodb/collections.models.map.js +22 -22
  49. package/lib/mongodb/collections.models.map.js.map +1 -1
  50. package/lib/mongodb/functions/index/add.both.indices.to.attributes.d.ts +3 -3
  51. package/lib/mongodb/functions/index/add.both.indices.to.attributes.js +8 -8
  52. package/lib/mongodb/functions/index/add.down.indices.to.attributes.d.ts +3 -3
  53. package/lib/mongodb/functions/index/add.down.indices.to.attributes.js +5 -5
  54. package/lib/mongodb/functions/index/add.index.to.attributes.d.ts +3 -3
  55. package/lib/mongodb/functions/index/add.index.to.attributes.js +11 -11
  56. package/lib/mongodb/functions/index/add.up.and.down.indices.to.attributes.d.ts +3 -3
  57. package/lib/mongodb/functions/index/add.up.and.down.indices.to.attributes.js +9 -9
  58. package/lib/mongodb/functions/index/add.up.indices.to.attributes.d.ts +3 -3
  59. package/lib/mongodb/functions/index/add.up.indices.to.attributes.js +5 -5
  60. package/lib/mongodb/functions/observable.database.d.ts +3 -3
  61. package/lib/mongodb/functions/observable.database.js +22 -22
  62. package/lib/mongodb/functions/observable.model.d.ts +4 -4
  63. package/lib/mongodb/functions/observable.model.js +41 -41
  64. package/lib/mongodb/functions/process.models.d.ts +2 -2
  65. package/lib/mongodb/functions/process.models.js +40 -40
  66. package/lib/mongodb/mongodb.connector.d.ts +7 -7
  67. package/lib/mongodb/mongodb.connector.js +51 -51
  68. package/lib/owservable.client.d.ts +23 -23
  69. package/lib/owservable.client.js +162 -162
  70. package/lib/owservable.d.ts +41 -41
  71. package/lib/owservable.js +63 -63
  72. package/lib/store/a.store.d.ts +37 -37
  73. package/lib/store/a.store.js +126 -126
  74. package/lib/store/collection.store.d.ts +8 -8
  75. package/lib/store/collection.store.js +111 -111
  76. package/lib/store/count.store.d.ts +7 -7
  77. package/lib/store/count.store.js +46 -46
  78. package/lib/store/document.store.d.ts +12 -12
  79. package/lib/store/document.store.js +134 -134
  80. package/lib/store/factories/store.factory.d.ts +4 -4
  81. package/lib/store/factories/store.factory.js +15 -15
  82. package/package.json +10 -10
@@ -1,9 +1,9 @@
1
- 'use strict';
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const execute_watcher_1 = require("./execute/execute.watcher");
4
- const execute_processes_in_folder_1 = require("./execute/execute.processes.in.folder");
5
- const initiateWatchers = (root, folder = 'watchers') => {
6
- (0, execute_processes_in_folder_1.default)(root, folder, execute_watcher_1.default);
7
- };
8
- exports.default = initiateWatchers;
1
+ 'use strict';
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const execute_watcher_1 = require("./execute/execute.watcher");
4
+ const execute_processes_in_folder_1 = require("./execute/execute.processes.in.folder");
5
+ const initiateWatchers = (root, folder = 'watchers') => {
6
+ (0, execute_processes_in_folder_1.default)(root, folder, execute_watcher_1.default);
7
+ };
8
+ exports.default = initiateWatchers;
9
9
  //# sourceMappingURL=initiate.watchers.js.map
@@ -1,2 +1,2 @@
1
- declare const initiateWorkers: (root: string, folder?: string) => void;
2
- export default initiateWorkers;
1
+ declare const initiateWorkers: (root: string, folder?: string) => void;
2
+ export default initiateWorkers;
@@ -1,9 +1,9 @@
1
- 'use strict';
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const execute_worker_1 = require("./execute/execute.worker");
4
- const execute_processes_in_folder_1 = require("./execute/execute.processes.in.folder");
5
- const initiateWorkers = (root, folder = 'workers') => {
6
- (0, execute_processes_in_folder_1.default)(root, folder, execute_worker_1.default);
7
- };
8
- exports.default = initiateWorkers;
1
+ 'use strict';
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const execute_worker_1 = require("./execute/execute.worker");
4
+ const execute_processes_in_folder_1 = require("./execute/execute.processes.in.folder");
5
+ const initiateWorkers = (root, folder = 'workers') => {
6
+ (0, execute_processes_in_folder_1.default)(root, folder, execute_worker_1.default);
7
+ };
8
+ exports.default = initiateWorkers;
9
9
  //# sourceMappingURL=initiate.workers.js.map
@@ -1,7 +1,7 @@
1
- export default class DataMiddlewareMap {
2
- static addMiddleware(collection: string, processor: Function): void;
3
- static hasMiddleware(collection: string): boolean;
4
- static getMiddleware(collection: string): Function | null;
5
- static keys(): string[];
6
- private static readonly _middlewares;
7
- }
1
+ export default class DataMiddlewareMap {
2
+ static addMiddleware(collection: string, processor: Function): void;
3
+ static hasMiddleware(collection: string): boolean;
4
+ static getMiddleware(collection: string): Function | null;
5
+ static keys(): string[];
6
+ private static readonly _middlewares;
7
+ }
@@ -1,19 +1,19 @@
1
- 'use strict';
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- class DataMiddlewareMap {
4
- static addMiddleware(collection, processor) {
5
- DataMiddlewareMap._middlewares.set(`${collection}`, processor);
6
- }
7
- static hasMiddleware(collection) {
8
- return !!DataMiddlewareMap._middlewares.get(`${collection}`);
9
- }
10
- static getMiddleware(collection) {
11
- return DataMiddlewareMap._middlewares.get(`${collection}`);
12
- }
13
- static keys() {
14
- return Array.from(DataMiddlewareMap._middlewares.keys());
15
- }
16
- }
17
- exports.default = DataMiddlewareMap;
18
- DataMiddlewareMap._middlewares = new Map();
1
+ 'use strict';
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ class DataMiddlewareMap {
4
+ static addMiddleware(collection, processor) {
5
+ DataMiddlewareMap._middlewares.set(`${collection}`, processor);
6
+ }
7
+ static hasMiddleware(collection) {
8
+ return !!DataMiddlewareMap._middlewares.get(`${collection}`);
9
+ }
10
+ static getMiddleware(collection) {
11
+ return DataMiddlewareMap._middlewares.get(`${collection}`);
12
+ }
13
+ static keys() {
14
+ return Array.from(DataMiddlewareMap._middlewares.keys());
15
+ }
16
+ }
17
+ DataMiddlewareMap._middlewares = new Map();
18
+ exports.default = DataMiddlewareMap;
19
19
  //# sourceMappingURL=data.middleware.map.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"data.middleware.map.js","sourceRoot":"","sources":["../../src/middleware/data.middleware.map.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,MAAqB,iBAAiB;IAC9B,MAAM,CAAC,aAAa,CAAC,UAAkB,EAAE,SAAmB;QAClE,iBAAiB,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,UAAU,EAAE,EAAE,SAAS,CAAC,CAAC;IAChE,CAAC;IAEM,MAAM,CAAC,aAAa,CAAC,UAAkB;QAC7C,OAAO,CAAC,CAAC,iBAAiB,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,UAAU,EAAE,CAAC,CAAC;IAC9D,CAAC;IAEM,MAAM,CAAC,aAAa,CAAC,UAAkB;QAC7C,OAAO,iBAAiB,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,UAAU,EAAE,CAAC,CAAC;IAC5D,CAAC;IAEM,MAAM,CAAC,IAAI;QACjB,OAAO,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC;IAC1D,CAAC;;AAfF,oCAkBC;AADwB,8BAAY,GAA0B,IAAI,GAAG,EAAoB,CAAC"}
1
+ {"version":3,"file":"data.middleware.map.js","sourceRoot":"","sources":["../../src/middleware/data.middleware.map.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,MAAqB,iBAAiB;IAC9B,MAAM,CAAC,aAAa,CAAC,UAAkB,EAAE,SAAmB;QAClE,iBAAiB,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,UAAU,EAAE,EAAE,SAAS,CAAC,CAAC;IAChE,CAAC;IAEM,MAAM,CAAC,aAAa,CAAC,UAAkB;QAC7C,OAAO,CAAC,CAAC,iBAAiB,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,UAAU,EAAE,CAAC,CAAC;IAC9D,CAAC;IAEM,MAAM,CAAC,aAAa,CAAC,UAAkB;QAC7C,OAAO,iBAAiB,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,UAAU,EAAE,CAAC,CAAC;IAC5D,CAAC;IAEM,MAAM,CAAC,IAAI;QACjB,OAAO,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC;IAC1D,CAAC;;AAEuB,8BAAY,GAA0B,IAAI,GAAG,EAAoB,CAAC;kBAjBtE,iBAAiB"}
@@ -1,8 +1,8 @@
1
- import { Model } from 'mongoose';
2
- export default class CollectionsModelsMap {
3
- static addCollectionToModelMapping(model: Model<any>): void;
4
- static getModelByCollection(collectionName: string): Model<any> | null;
5
- static keys(): string[];
6
- static values(): string[];
7
- private static readonly _models;
8
- }
1
+ import { Model } from 'mongoose';
2
+ export default class CollectionsModelsMap {
3
+ static addCollectionToModelMapping(model: Model<any>): void;
4
+ static getModelByCollection(collectionName: string): Model<any> | null;
5
+ static keys(): string[];
6
+ static values(): string[];
7
+ private static readonly _models;
8
+ }
@@ -1,23 +1,23 @@
1
- 'use strict';
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const mongoose = require("mongoose");
4
- class CollectionsModelsMap {
5
- static addCollectionToModelMapping(model) {
6
- CollectionsModelsMap._models.set(model.collection.collectionName, model.modelName);
7
- }
8
- static getModelByCollection(collectionName) {
9
- const modelName = CollectionsModelsMap._models.get(collectionName);
10
- if (!modelName)
11
- return null;
12
- return mongoose.model(modelName);
13
- }
14
- static keys() {
15
- return Array.from(CollectionsModelsMap._models.keys());
16
- }
17
- static values() {
18
- return Array.from(CollectionsModelsMap._models.values());
19
- }
20
- }
21
- exports.default = CollectionsModelsMap;
22
- CollectionsModelsMap._models = new Map();
1
+ 'use strict';
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const mongoose = require("mongoose");
4
+ class CollectionsModelsMap {
5
+ static addCollectionToModelMapping(model) {
6
+ CollectionsModelsMap._models.set(model.collection.collectionName, model.modelName);
7
+ }
8
+ static getModelByCollection(collectionName) {
9
+ const modelName = CollectionsModelsMap._models.get(collectionName);
10
+ if (!modelName)
11
+ return null;
12
+ return mongoose.model(modelName);
13
+ }
14
+ static keys() {
15
+ return Array.from(CollectionsModelsMap._models.keys());
16
+ }
17
+ static values() {
18
+ return Array.from(CollectionsModelsMap._models.values());
19
+ }
20
+ }
21
+ CollectionsModelsMap._models = new Map();
22
+ exports.default = CollectionsModelsMap;
23
23
  //# sourceMappingURL=collections.models.map.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"collections.models.map.js","sourceRoot":"","sources":["../../src/mongodb/collections.models.map.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,qCAAqC;AAGrC,MAAqB,oBAAoB;IACjC,MAAM,CAAC,2BAA2B,CAAC,KAAiB;QAC1D,oBAAoB,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,cAAc,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IACpF,CAAC;IAEM,MAAM,CAAC,oBAAoB,CAAC,cAAsB;QACxD,MAAM,SAAS,GAAG,oBAAoB,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QACnE,IAAI,CAAC,SAAS;YAAE,OAAO,IAAI,CAAC;QAC5B,OAAO,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAClC,CAAC;IAEM,MAAM,CAAC,IAAI;QACjB,OAAO,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IACxD,CAAC;IAEM,MAAM,CAAC,MAAM;QACnB,OAAO,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC1D,CAAC;;AAjBF,uCAoBC;AADwB,4BAAO,GAAwB,IAAI,GAAG,EAAkB,CAAC"}
1
+ {"version":3,"file":"collections.models.map.js","sourceRoot":"","sources":["../../src/mongodb/collections.models.map.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,qCAAqC;AAGrC,MAAqB,oBAAoB;IACjC,MAAM,CAAC,2BAA2B,CAAC,KAAiB;QAC1D,oBAAoB,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,cAAc,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IACpF,CAAC;IAEM,MAAM,CAAC,oBAAoB,CAAC,cAAsB;QACxD,MAAM,SAAS,GAAG,oBAAoB,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QACnE,IAAI,CAAC,SAAS;YAAE,OAAO,IAAI,CAAC;QAC5B,OAAO,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAClC,CAAC;IAEM,MAAM,CAAC,IAAI;QACjB,OAAO,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;IACxD,CAAC;IAEM,MAAM,CAAC,MAAM;QACnB,OAAO,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAC1D,CAAC;;AAEuB,4BAAO,GAAwB,IAAI,GAAG,EAAkB,CAAC;kBAnB7D,oBAAoB"}
@@ -1,3 +1,3 @@
1
- import { Schema } from 'mongoose';
2
- declare const addBothIndicesToAttributes: (schema: Schema, attributes: string[]) => void;
3
- export default addBothIndicesToAttributes;
1
+ import { Schema } from 'mongoose';
2
+ declare const addBothIndicesToAttributes: (schema: Schema, attributes: string[]) => void;
3
+ export default addBothIndicesToAttributes;
@@ -1,9 +1,9 @@
1
- 'use strict';
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const add_up_and_down_indices_to_attributes_1 = require("./add.up.and.down.indices.to.attributes");
4
- const addBothIndicesToAttributes = (schema, attributes) => {
5
- console.warn('\n - Calling deprecated function "addUpAndDownIndicesToAttributes"! Please use "addUpAndDownIndicesToAttributes", instead!\n');
6
- (0, add_up_and_down_indices_to_attributes_1.default)(schema, attributes);
7
- };
8
- exports.default = addBothIndicesToAttributes;
1
+ 'use strict';
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const add_up_and_down_indices_to_attributes_1 = require("./add.up.and.down.indices.to.attributes");
4
+ const addBothIndicesToAttributes = (schema, attributes) => {
5
+ console.warn('\n - Calling deprecated function "addUpAndDownIndicesToAttributes"! Please use "addUpAndDownIndicesToAttributes", instead!\n');
6
+ (0, add_up_and_down_indices_to_attributes_1.default)(schema, attributes);
7
+ };
8
+ exports.default = addBothIndicesToAttributes;
9
9
  //# sourceMappingURL=add.both.indices.to.attributes.js.map
@@ -1,3 +1,3 @@
1
- import { Schema } from 'mongoose';
2
- declare const addDownIndicesToAttributes: (schema: Schema, attributes: string[]) => void;
3
- export default addDownIndicesToAttributes;
1
+ import { Schema } from 'mongoose';
2
+ declare const addDownIndicesToAttributes: (schema: Schema, attributes: string[]) => void;
3
+ export default addDownIndicesToAttributes;
@@ -1,6 +1,6 @@
1
- 'use strict';
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const add_index_to_attributes_1 = require("./add.index.to.attributes");
4
- const addDownIndicesToAttributes = (schema, attributes) => (0, add_index_to_attributes_1.default)(schema, attributes, -1);
5
- exports.default = addDownIndicesToAttributes;
1
+ 'use strict';
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const add_index_to_attributes_1 = require("./add.index.to.attributes");
4
+ const addDownIndicesToAttributes = (schema, attributes) => (0, add_index_to_attributes_1.default)(schema, attributes, -1);
5
+ exports.default = addDownIndicesToAttributes;
6
6
  //# sourceMappingURL=add.down.indices.to.attributes.js.map
@@ -1,3 +1,3 @@
1
- import { Schema } from 'mongoose';
2
- declare const addIndexToAttributes: (schema: Schema, attributes: string[], index: 1 | -1) => void;
3
- export default addIndexToAttributes;
1
+ import { Schema } from 'mongoose';
2
+ declare const addIndexToAttributes: (schema: Schema, attributes: string[], index: 1 | -1) => void;
3
+ export default addIndexToAttributes;
@@ -1,12 +1,12 @@
1
- 'use strict';
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const lodash_1 = require("lodash");
4
- const addIndexToAttributes = (schema, attributes, index) => {
5
- (0, lodash_1.each)(attributes, (attribute) => {
6
- const ind = {};
7
- (0, lodash_1.set)(ind, attribute, index);
8
- schema.index(ind);
9
- });
10
- };
11
- exports.default = addIndexToAttributes;
1
+ 'use strict';
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const lodash_1 = require("lodash");
4
+ const addIndexToAttributes = (schema, attributes, index) => {
5
+ (0, lodash_1.each)(attributes, (attribute) => {
6
+ const ind = {};
7
+ (0, lodash_1.set)(ind, attribute, index);
8
+ schema.index(ind);
9
+ });
10
+ };
11
+ exports.default = addIndexToAttributes;
12
12
  //# sourceMappingURL=add.index.to.attributes.js.map
@@ -1,3 +1,3 @@
1
- import { Schema } from 'mongoose';
2
- declare const addUpAndDownIndicesToAttributes: (schema: Schema, attributes: string[]) => void;
3
- export default addUpAndDownIndicesToAttributes;
1
+ import { Schema } from 'mongoose';
2
+ declare const addUpAndDownIndicesToAttributes: (schema: Schema, attributes: string[]) => void;
3
+ export default addUpAndDownIndicesToAttributes;
@@ -1,10 +1,10 @@
1
- 'use strict';
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const add_up_indices_to_attributes_1 = require("./add.up.indices.to.attributes");
4
- const add_down_indices_to_attributes_1 = require("./add.down.indices.to.attributes");
5
- const addUpAndDownIndicesToAttributes = (schema, attributes) => {
6
- (0, add_up_indices_to_attributes_1.default)(schema, attributes);
7
- (0, add_down_indices_to_attributes_1.default)(schema, attributes);
8
- };
9
- exports.default = addUpAndDownIndicesToAttributes;
1
+ 'use strict';
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const add_up_indices_to_attributes_1 = require("./add.up.indices.to.attributes");
4
+ const add_down_indices_to_attributes_1 = require("./add.down.indices.to.attributes");
5
+ const addUpAndDownIndicesToAttributes = (schema, attributes) => {
6
+ (0, add_up_indices_to_attributes_1.default)(schema, attributes);
7
+ (0, add_down_indices_to_attributes_1.default)(schema, attributes);
8
+ };
9
+ exports.default = addUpAndDownIndicesToAttributes;
10
10
  //# sourceMappingURL=add.up.and.down.indices.to.attributes.js.map
@@ -1,3 +1,3 @@
1
- import { Schema } from 'mongoose';
2
- declare const addUpIndicesToAttributes: (schema: Schema, attributes: string[]) => void;
3
- export default addUpIndicesToAttributes;
1
+ import { Schema } from 'mongoose';
2
+ declare const addUpIndicesToAttributes: (schema: Schema, attributes: string[]) => void;
3
+ export default addUpIndicesToAttributes;
@@ -1,6 +1,6 @@
1
- 'use strict';
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const add_index_to_attributes_1 = require("./add.index.to.attributes");
4
- const addUpIndicesToAttributes = (schema, attributes) => (0, add_index_to_attributes_1.default)(schema, attributes, 1);
5
- exports.default = addUpIndicesToAttributes;
1
+ 'use strict';
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const add_index_to_attributes_1 = require("./add.index.to.attributes");
4
+ const addUpIndicesToAttributes = (schema, attributes) => (0, add_index_to_attributes_1.default)(schema, attributes, 1);
5
+ exports.default = addUpIndicesToAttributes;
6
6
  //# sourceMappingURL=add.up.indices.to.attributes.js.map
@@ -1,3 +1,3 @@
1
- import { Subject } from 'rxjs';
2
- declare const observableDatabase: () => Subject<any>;
3
- export default observableDatabase;
1
+ import { Subject } from 'rxjs';
2
+ declare const observableDatabase: () => Subject<any>;
3
+ export default observableDatabase;
@@ -1,23 +1,23 @@
1
- 'use strict';
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const lodash_1 = require("lodash");
4
- const rxjs_1 = require("rxjs");
5
- const mongoose = require("mongoose");
6
- class ObservableDatabase extends rxjs_1.Subject {
7
- static init() {
8
- if (!ObservableDatabase._instance)
9
- ObservableDatabase._instance = new ObservableDatabase();
10
- return ObservableDatabase._instance;
11
- }
12
- constructor() {
13
- super();
14
- const db = mongoose.connection.db;
15
- this._stream = db.watch([], { fullDocument: 'updateLookup' });
16
- this._stream.on('change', (change) => {
17
- this.next((0, lodash_1.pick)(change, ['ns', 'documentKey', 'operationType', 'updateDescription', 'fullDocument']));
18
- });
19
- }
20
- }
21
- const observableDatabase = () => ObservableDatabase.init();
22
- exports.default = observableDatabase;
1
+ 'use strict';
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const lodash_1 = require("lodash");
4
+ const rxjs_1 = require("rxjs");
5
+ const mongoose = require("mongoose");
6
+ class ObservableDatabase extends rxjs_1.Subject {
7
+ static init() {
8
+ if (!ObservableDatabase._instance)
9
+ ObservableDatabase._instance = new ObservableDatabase();
10
+ return ObservableDatabase._instance;
11
+ }
12
+ constructor() {
13
+ super();
14
+ const db = mongoose.connection.db;
15
+ this._stream = db.watch([], { fullDocument: 'updateLookup' });
16
+ this._stream.on('change', (change) => {
17
+ this.next((0, lodash_1.pick)(change, ['ns', 'documentKey', 'operationType', 'updateDescription', 'fullDocument']));
18
+ });
19
+ }
20
+ }
21
+ const observableDatabase = () => ObservableDatabase.init();
22
+ exports.default = observableDatabase;
23
23
  //# sourceMappingURL=observable.database.js.map
@@ -1,4 +1,4 @@
1
- import { Model } from 'mongoose';
2
- import { Subject } from 'rxjs';
3
- declare const observableModel: (model: Model<any>) => Subject<any>;
4
- export default observableModel;
1
+ import { Model } from 'mongoose';
2
+ import { Subject } from 'rxjs';
3
+ declare const observableModel: (model: Model<any>) => Subject<any>;
4
+ export default observableModel;
@@ -1,42 +1,42 @@
1
- 'use strict';
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const lodash_1 = require("lodash");
4
- const rxjs_1 = require("rxjs");
5
- const operators_1 = require("rxjs/operators");
6
- const observable_database_1 = require("./observable.database");
7
- class ObservableModel extends rxjs_1.Subject {
8
- constructor(collection) {
9
- super();
10
- this._collection = collection;
11
- this._subscription = (0, observable_database_1.default)()
12
- .pipe((0, operators_1.filter)((change) => this._pipeFilter(change)))
13
- .subscribe({
14
- next: (change) => this.next((0, lodash_1.pick)(change, ['ns', 'documentKey', 'operationType', 'updateDescription', 'fullDocument']))
15
- });
16
- }
17
- _pipeFilter(change) {
18
- const { ns: { coll } } = change;
19
- return this._collection === coll;
20
- }
21
- }
22
- class ObservableModelsMap {
23
- static init() {
24
- if (!ObservableModelsMap._instance)
25
- ObservableModelsMap._instance = new ObservableModelsMap();
26
- return ObservableModelsMap._instance;
27
- }
28
- static get(model) {
29
- const instance = ObservableModelsMap.init();
30
- const map = instance._map;
31
- const collectionName = model.collection.collectionName;
32
- if (!map.get(collectionName))
33
- map.set(collectionName, new ObservableModel(collectionName));
34
- return map.get(collectionName);
35
- }
36
- constructor() {
37
- this._map = new Map();
38
- }
39
- }
40
- const observableModel = (model) => ObservableModelsMap.get(model);
41
- exports.default = observableModel;
1
+ 'use strict';
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const lodash_1 = require("lodash");
4
+ const rxjs_1 = require("rxjs");
5
+ const operators_1 = require("rxjs/operators");
6
+ const observable_database_1 = require("./observable.database");
7
+ class ObservableModel extends rxjs_1.Subject {
8
+ constructor(collection) {
9
+ super();
10
+ this._collection = collection;
11
+ this._subscription = (0, observable_database_1.default)()
12
+ .pipe((0, operators_1.filter)((change) => this._pipeFilter(change)))
13
+ .subscribe({
14
+ next: (change) => this.next((0, lodash_1.pick)(change, ['ns', 'documentKey', 'operationType', 'updateDescription', 'fullDocument']))
15
+ });
16
+ }
17
+ _pipeFilter(change) {
18
+ const { ns: { coll } } = change;
19
+ return this._collection === coll;
20
+ }
21
+ }
22
+ class ObservableModelsMap {
23
+ static init() {
24
+ if (!ObservableModelsMap._instance)
25
+ ObservableModelsMap._instance = new ObservableModelsMap();
26
+ return ObservableModelsMap._instance;
27
+ }
28
+ static get(model) {
29
+ const instance = ObservableModelsMap.init();
30
+ const map = instance._map;
31
+ const collectionName = model.collection.collectionName;
32
+ if (!map.get(collectionName))
33
+ map.set(collectionName, new ObservableModel(collectionName));
34
+ return map.get(collectionName);
35
+ }
36
+ constructor() {
37
+ this._map = new Map();
38
+ }
39
+ }
40
+ const observableModel = (model) => ObservableModelsMap.get(model);
41
+ exports.default = observableModel;
42
42
  //# sourceMappingURL=observable.model.js.map
@@ -1,2 +1,2 @@
1
- declare const processModels: (root: string, name?: string, exclude?: string | string[]) => void;
2
- export default processModels;
1
+ declare const processModels: (root: string, name?: string, exclude?: string | string[]) => void;
2
+ export default processModels;
@@ -1,41 +1,41 @@
1
- 'use strict';
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const fs = require("fs");
4
- const path = require("path");
5
- const lodash_1 = require("lodash");
6
- const folders_1 = require("@owservable/folders");
7
- const collections_models_map_1 = require("../collections.models.map");
8
- const _processFile = (folder, file) => {
9
- const fullPath = path.join(folder, file);
10
- const model = require(fullPath).default;
11
- if (!model)
12
- throw new Error(`Model not found in ${folder}/${file}`);
13
- collections_models_map_1.default.addCollectionToModelMapping(model);
14
- };
15
- const _isExcluded = (folder, exclude) => {
16
- if (!exclude)
17
- return false;
18
- return (0, lodash_1.isString)(exclude)
19
- ? (0, lodash_1.endsWith)(folder, exclude)
20
- : !!(0, lodash_1.find)(exclude, (e) => (0, lodash_1.endsWith)(folder, e));
21
- };
22
- const _processModels = (folder, exclude) => {
23
- if (_isExcluded(folder, exclude))
24
- return;
25
- const subfolderNames = fs.readdirSync(folder);
26
- const files = (0, lodash_1.filter)(subfolderNames, (fileName) => !fs.lstatSync(path.join(folder, fileName)).isDirectory());
27
- (0, lodash_1.each)(files, (file) => {
28
- const ext = path.extname(file);
29
- if (ext !== '.ts' && ext !== '.js')
30
- return;
31
- _processFile(folder, file);
32
- });
33
- const folders = (0, lodash_1.filter)(subfolderNames, (fileName) => fs.lstatSync(path.join(folder, fileName)).isDirectory());
34
- (0, lodash_1.each)(folders, (sub) => _processModels(path.join(folder, sub), exclude));
35
- };
36
- const processModels = (root, name = 'models', exclude) => {
37
- const folders = (0, folders_1.listSubfoldersByName)(root, name);
38
- (0, lodash_1.each)(folders, (folder) => _processModels(folder, exclude));
39
- };
40
- exports.default = processModels;
1
+ 'use strict';
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const fs = require("fs");
4
+ const path = require("path");
5
+ const lodash_1 = require("lodash");
6
+ const folders_1 = require("@owservable/folders");
7
+ const collections_models_map_1 = require("../collections.models.map");
8
+ const _processFile = (folder, file) => {
9
+ const fullPath = path.join(folder, file);
10
+ const model = require(fullPath).default;
11
+ if (!model)
12
+ throw new Error(`Model not found in ${folder}/${file}`);
13
+ collections_models_map_1.default.addCollectionToModelMapping(model);
14
+ };
15
+ const _isExcluded = (folder, exclude) => {
16
+ if (!exclude)
17
+ return false;
18
+ return (0, lodash_1.isString)(exclude)
19
+ ? (0, lodash_1.endsWith)(folder, exclude)
20
+ : !!(0, lodash_1.find)(exclude, (e) => (0, lodash_1.endsWith)(folder, e));
21
+ };
22
+ const _processModels = (folder, exclude) => {
23
+ if (_isExcluded(folder, exclude))
24
+ return;
25
+ const subfolderNames = fs.readdirSync(folder);
26
+ const files = (0, lodash_1.filter)(subfolderNames, (fileName) => !fs.lstatSync(path.join(folder, fileName)).isDirectory());
27
+ (0, lodash_1.each)(files, (file) => {
28
+ const ext = path.extname(file);
29
+ if (ext !== '.ts' && ext !== '.js')
30
+ return;
31
+ _processFile(folder, file);
32
+ });
33
+ const folders = (0, lodash_1.filter)(subfolderNames, (fileName) => fs.lstatSync(path.join(folder, fileName)).isDirectory());
34
+ (0, lodash_1.each)(folders, (sub) => _processModels(path.join(folder, sub), exclude));
35
+ };
36
+ const processModels = (root, name = 'models', exclude) => {
37
+ const folders = (0, folders_1.listSubfoldersByName)(root, name);
38
+ (0, lodash_1.each)(folders, (folder) => _processModels(folder, exclude));
39
+ };
40
+ exports.default = processModels;
41
41
  //# sourceMappingURL=process.models.js.map
@@ -1,7 +1,7 @@
1
- import { Connection } from 'mongoose';
2
- export default class MongoDBConnector {
3
- static init(mongoDbUri: string): Promise<Connection>;
4
- static get connection(): Connection;
5
- private static _connection;
6
- private constructor();
7
- }
1
+ import { Connection } from 'mongoose';
2
+ export default class MongoDBConnector {
3
+ static init(mongoDbUri: string): Promise<Connection>;
4
+ static get connection(): Connection;
5
+ private static _connection;
6
+ private constructor();
7
+ }