owservable 0.8.39 → 0.8.41
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/lib/_enums/store.type.enum.d.ts +6 -6
- package/lib/_enums/store.type.enum.js +9 -9
- package/lib/_types/connection.manager.refresh.type.d.ts +9 -9
- package/lib/_types/connection.manager.refresh.type.js +2 -2
- package/lib/_types/cronjob.type.d.ts +7 -7
- package/lib/_types/cronjob.type.js +2 -2
- package/lib/_types/store.scope.type.d.ts +2 -2
- package/lib/_types/store.scope.type.js +2 -2
- package/lib/_types/store.subscription.config.type.d.ts +15 -15
- package/lib/_types/store.subscription.config.type.js +2 -2
- package/lib/_types/store.subscription.update.type.d.ts +9 -9
- package/lib/_types/store.subscription.update.type.js +2 -2
- package/lib/_types/subscription.methods.type.d.ts +6 -6
- package/lib/_types/subscription.methods.type.js +2 -2
- package/lib/_types/watcher.type.d.ts +6 -5
- package/lib/_types/watcher.type.js +2 -2
- package/lib/_types/worker.type.d.ts +5 -5
- package/lib/_types/worker.type.js +2 -2
- package/lib/auth/i.connection.manager.d.ts +9 -9
- package/lib/auth/i.connection.manager.js +2 -2
- package/lib/functions/action/add.action.cronjobs.d.ts +1 -1
- package/lib/functions/action/add.action.cronjobs.js +25 -25
- package/lib/functions/action/add.action.watchers.d.ts +1 -1
- package/lib/functions/action/add.action.watchers.js +22 -22
- package/lib/functions/action/add.action.workers.d.ts +1 -1
- package/lib/functions/action/add.action.workers.js +22 -22
- package/lib/functions/execute/execute.cronjob.d.ts +3 -3
- package/lib/functions/execute/execute.cronjob.js +12 -12
- package/lib/functions/execute/execute.on.files.recursively.d.ts +2 -2
- package/lib/functions/execute/execute.on.files.recursively.js +17 -17
- package/lib/functions/execute/execute.processes.in.folder.d.ts +2 -2
- package/lib/functions/execute/execute.processes.in.folder.js +10 -10
- package/lib/functions/execute/execute.watcher.d.ts +3 -3
- package/lib/functions/execute/execute.watcher.js +16 -11
- package/lib/functions/execute/execute.watcher.js.map +1 -1
- package/lib/functions/execute/execute.worker.d.ts +3 -3
- package/lib/functions/execute/execute.worker.js +11 -11
- package/lib/functions/initiate.cronjobs.d.ts +2 -2
- package/lib/functions/initiate.cronjobs.js +8 -8
- package/lib/functions/initiate.watchers.d.ts +2 -2
- package/lib/functions/initiate.watchers.js +8 -8
- package/lib/functions/initiate.workers.d.ts +2 -2
- package/lib/functions/initiate.workers.js +8 -8
- package/lib/middleware/data.middleware.map.d.ts +7 -7
- package/lib/middleware/data.middleware.map.js +18 -18
- package/lib/middleware/data.middleware.map.js.map +1 -1
- package/lib/mongodb/collections.models.map.d.ts +8 -8
- package/lib/mongodb/collections.models.map.js +22 -22
- package/lib/mongodb/collections.models.map.js.map +1 -1
- package/lib/mongodb/functions/index/add.both.indices.to.attributes.d.ts +3 -3
- package/lib/mongodb/functions/index/add.both.indices.to.attributes.js +8 -8
- package/lib/mongodb/functions/index/add.down.indices.to.attributes.d.ts +3 -3
- package/lib/mongodb/functions/index/add.down.indices.to.attributes.js +5 -5
- package/lib/mongodb/functions/index/add.index.to.attributes.d.ts +3 -3
- package/lib/mongodb/functions/index/add.index.to.attributes.js +11 -11
- package/lib/mongodb/functions/index/add.up.and.down.indices.to.attributes.d.ts +3 -3
- package/lib/mongodb/functions/index/add.up.and.down.indices.to.attributes.js +9 -9
- package/lib/mongodb/functions/index/add.up.indices.to.attributes.d.ts +3 -3
- package/lib/mongodb/functions/index/add.up.indices.to.attributes.js +5 -5
- package/lib/mongodb/functions/observable.database.d.ts +3 -3
- package/lib/mongodb/functions/observable.database.js +22 -22
- package/lib/mongodb/functions/observable.model.d.ts +4 -4
- package/lib/mongodb/functions/observable.model.js +41 -41
- package/lib/mongodb/functions/process.models.d.ts +2 -2
- package/lib/mongodb/functions/process.models.js +40 -40
- package/lib/mongodb/mongodb.connector.d.ts +7 -7
- package/lib/mongodb/mongodb.connector.js +51 -51
- package/lib/owservable.client.d.ts +23 -23
- package/lib/owservable.client.js +162 -162
- package/lib/owservable.d.ts +41 -41
- package/lib/owservable.js +63 -63
- package/lib/store/a.store.d.ts +37 -37
- package/lib/store/a.store.js +126 -126
- package/lib/store/collection.store.d.ts +8 -8
- package/lib/store/collection.store.js +111 -112
- package/lib/store/collection.store.js.map +1 -1
- package/lib/store/count.store.d.ts +7 -7
- package/lib/store/count.store.js +46 -46
- package/lib/store/document.store.d.ts +12 -12
- package/lib/store/document.store.js +134 -135
- package/lib/store/document.store.js.map +1 -1
- package/lib/store/factories/store.factory.d.ts +4 -4
- package/lib/store/factories/store.factory.js +15 -15
- package/package.json +8 -8
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
declare enum EStoreType {
|
|
2
|
-
DOCUMENT = 0,
|
|
3
|
-
COLLECTION = 1,
|
|
4
|
-
COUNT = 2
|
|
5
|
-
}
|
|
6
|
-
export default EStoreType;
|
|
1
|
+
declare enum EStoreType {
|
|
2
|
+
DOCUMENT = 0,
|
|
3
|
+
COLLECTION = 1,
|
|
4
|
+
COUNT = 2
|
|
5
|
+
}
|
|
6
|
+
export default EStoreType;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var EStoreType;
|
|
4
|
-
(function (EStoreType) {
|
|
5
|
-
EStoreType[EStoreType["DOCUMENT"] = 0] = "DOCUMENT";
|
|
6
|
-
EStoreType[EStoreType["COLLECTION"] = 1] = "COLLECTION";
|
|
7
|
-
EStoreType[EStoreType["COUNT"] = 2] = "COUNT";
|
|
8
|
-
})(EStoreType || (EStoreType = {}));
|
|
9
|
-
exports.default = EStoreType;
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var EStoreType;
|
|
4
|
+
(function (EStoreType) {
|
|
5
|
+
EStoreType[EStoreType["DOCUMENT"] = 0] = "DOCUMENT";
|
|
6
|
+
EStoreType[EStoreType["COLLECTION"] = 1] = "COLLECTION";
|
|
7
|
+
EStoreType[EStoreType["COUNT"] = 2] = "COUNT";
|
|
8
|
+
})(EStoreType || (EStoreType = {}));
|
|
9
|
+
exports.default = EStoreType;
|
|
10
10
|
//# sourceMappingURL=store.type.enum.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
type ConnectionManagerRefreshType = {
|
|
2
|
-
type: 'refresh';
|
|
3
|
-
payload: {
|
|
4
|
-
jwt: string;
|
|
5
|
-
user: any;
|
|
6
|
-
};
|
|
7
|
-
refresh_in: number;
|
|
8
|
-
};
|
|
9
|
-
export default ConnectionManagerRefreshType;
|
|
1
|
+
type ConnectionManagerRefreshType = {
|
|
2
|
+
type: 'refresh';
|
|
3
|
+
payload: {
|
|
4
|
+
jwt: string;
|
|
5
|
+
user: any;
|
|
6
|
+
};
|
|
7
|
+
refresh_in: number;
|
|
8
|
+
};
|
|
9
|
+
export default ConnectionManagerRefreshType;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=connection.manager.refresh.type.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
type CronJobType = {
|
|
2
|
-
schedule: string;
|
|
3
|
-
job: () => void;
|
|
4
|
-
options?: any;
|
|
5
|
-
init?: () => Promise<void>;
|
|
6
|
-
};
|
|
7
|
-
export default CronJobType;
|
|
1
|
+
type CronJobType = {
|
|
2
|
+
schedule: string;
|
|
3
|
+
job: () => void;
|
|
4
|
+
options?: any;
|
|
5
|
+
init?: () => Promise<void>;
|
|
6
|
+
};
|
|
7
|
+
export default CronJobType;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=cronjob.type.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
type StoreScopeType = 'count' | 'one' | 'many';
|
|
2
|
-
export default StoreScopeType;
|
|
1
|
+
type StoreScopeType = 'count' | 'one' | 'many';
|
|
2
|
+
export default StoreScopeType;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=store.scope.type.js.map
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
type StoreSubscriptionConfigType = {
|
|
2
|
-
subscriptionId?: string;
|
|
3
|
-
query: any;
|
|
4
|
-
sort?: any;
|
|
5
|
-
fields?: any;
|
|
6
|
-
skip?: number;
|
|
7
|
-
page?: number;
|
|
8
|
-
pageSize?: number;
|
|
9
|
-
strict: false;
|
|
10
|
-
incremental: false;
|
|
11
|
-
populates?: any;
|
|
12
|
-
virtuals?: any;
|
|
13
|
-
delay?: number;
|
|
14
|
-
};
|
|
15
|
-
export default StoreSubscriptionConfigType;
|
|
1
|
+
type StoreSubscriptionConfigType = {
|
|
2
|
+
subscriptionId?: string;
|
|
3
|
+
query: any;
|
|
4
|
+
sort?: any;
|
|
5
|
+
fields?: any;
|
|
6
|
+
skip?: number;
|
|
7
|
+
page?: number;
|
|
8
|
+
pageSize?: number;
|
|
9
|
+
strict: false;
|
|
10
|
+
incremental: false;
|
|
11
|
+
populates?: any;
|
|
12
|
+
virtuals?: any;
|
|
13
|
+
delay?: number;
|
|
14
|
+
};
|
|
15
|
+
export default StoreSubscriptionConfigType;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=store.subscription.config.type.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import StoreScopeType from './store.scope.type';
|
|
2
|
-
import StoreSubscriptionConfigType from './store.subscription.config.type';
|
|
3
|
-
type StoreSubscriptionUpdateType = {
|
|
4
|
-
target: string;
|
|
5
|
-
scope: StoreScopeType;
|
|
6
|
-
config: StoreSubscriptionConfigType;
|
|
7
|
-
observe: string;
|
|
8
|
-
};
|
|
9
|
-
export default StoreSubscriptionUpdateType;
|
|
1
|
+
import StoreScopeType from './store.scope.type';
|
|
2
|
+
import StoreSubscriptionConfigType from './store.subscription.config.type';
|
|
3
|
+
type StoreSubscriptionUpdateType = {
|
|
4
|
+
target: string;
|
|
5
|
+
scope: StoreScopeType;
|
|
6
|
+
config: StoreSubscriptionConfigType;
|
|
7
|
+
observe: string;
|
|
8
|
+
};
|
|
9
|
+
export default StoreSubscriptionUpdateType;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=store.subscription.update.type.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
type SubscriptionMethodsType = {
|
|
2
|
-
next: (value: any) => void;
|
|
3
|
-
error?: (err: any) => void;
|
|
4
|
-
complete?: () => void;
|
|
5
|
-
};
|
|
6
|
-
export default SubscriptionMethodsType;
|
|
1
|
+
type SubscriptionMethodsType = {
|
|
2
|
+
next: (value: any) => void;
|
|
3
|
+
error?: (err: any) => void;
|
|
4
|
+
complete?: () => void;
|
|
5
|
+
};
|
|
6
|
+
export default SubscriptionMethodsType;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=subscription.methods.type.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
type WatcherType = {
|
|
2
|
-
init?: () => Promise<void>;
|
|
3
|
-
watch: () => void;
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
type WatcherType = {
|
|
2
|
+
init?: () => Promise<void>;
|
|
3
|
+
watch: () => void;
|
|
4
|
+
waitForInit?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export default WatcherType;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=watcher.type.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
type WorkerType = {
|
|
2
|
-
init?: () => Promise<void>;
|
|
3
|
-
work: () => void;
|
|
4
|
-
};
|
|
5
|
-
export default WorkerType;
|
|
1
|
+
type WorkerType = {
|
|
2
|
+
init?: () => Promise<void>;
|
|
3
|
+
work: () => void;
|
|
4
|
+
};
|
|
5
|
+
export default WorkerType;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=worker.type.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import ConnectionManagerRefreshType from '../_types/connection.manager.refresh.type';
|
|
2
|
-
export default interface IConnectionManager {
|
|
3
|
-
user(): any;
|
|
4
|
-
connected(jwt: any): void;
|
|
5
|
-
ping(ping: number): void;
|
|
6
|
-
location(location: string): void;
|
|
7
|
-
disconnected(): void;
|
|
8
|
-
checkSession(): Promise<ConnectionManagerRefreshType> | ConnectionManagerRefreshType;
|
|
9
|
-
}
|
|
1
|
+
import ConnectionManagerRefreshType from '../_types/connection.manager.refresh.type';
|
|
2
|
+
export default interface IConnectionManager {
|
|
3
|
+
user(): any;
|
|
4
|
+
connected(jwt: any): void;
|
|
5
|
+
ping(ping: number): void;
|
|
6
|
+
location(location: string): void;
|
|
7
|
+
disconnected(): void;
|
|
8
|
+
checkSession(): Promise<ConnectionManagerRefreshType> | ConnectionManagerRefreshType;
|
|
9
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=i.connection.manager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function addActionCronjobs(root: string, folderName: string): void;
|
|
1
|
+
export default function addActionCronjobs(root: string, folderName: string): void;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const lodash_1 = require("lodash");
|
|
4
|
-
const folders_1 = require("@owservable/folders");
|
|
5
|
-
const execute_cronjob_1 = require("../execute/execute.cronjob");
|
|
6
|
-
function addActionCronjobs(root, folderName) {
|
|
7
|
-
const actionPaths = (0, folders_1.listSubfoldersFilesByFolderName)(root, folderName);
|
|
8
|
-
for (const actionPath of actionPaths) {
|
|
9
|
-
console.log(' - [@owservable] Initializing cronjob action', actionPath);
|
|
10
|
-
const ActionClass = require(actionPath).default;
|
|
11
|
-
const action = new ActionClass();
|
|
12
|
-
if ((0, lodash_1.isFunction)(action.schedule) && (0, lodash_1.isFunction)(action.asCronjob)) {
|
|
13
|
-
const job = {
|
|
14
|
-
schedule: action.schedule(),
|
|
15
|
-
job: action.asCronjob
|
|
16
|
-
};
|
|
17
|
-
if ((0, lodash_1.isFunction)(action.cronjobOptions))
|
|
18
|
-
(0, lodash_1.set)(job, 'options', action.cronjobOptions());
|
|
19
|
-
if ((0, lodash_1.isFunction)(action.asCronjobInit))
|
|
20
|
-
(0, lodash_1.set)(job, 'init', action.asCronjobInit());
|
|
21
|
-
(0, execute_cronjob_1.default)(job);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
exports.default = addActionCronjobs;
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const lodash_1 = require("lodash");
|
|
4
|
+
const folders_1 = require("@owservable/folders");
|
|
5
|
+
const execute_cronjob_1 = require("../execute/execute.cronjob");
|
|
6
|
+
function addActionCronjobs(root, folderName) {
|
|
7
|
+
const actionPaths = (0, folders_1.listSubfoldersFilesByFolderName)(root, folderName);
|
|
8
|
+
for (const actionPath of actionPaths) {
|
|
9
|
+
console.log(' - [@owservable] Initializing cronjob action', actionPath);
|
|
10
|
+
const ActionClass = require(actionPath).default;
|
|
11
|
+
const action = new ActionClass();
|
|
12
|
+
if ((0, lodash_1.isFunction)(action.schedule) && (0, lodash_1.isFunction)(action.asCronjob)) {
|
|
13
|
+
const job = {
|
|
14
|
+
schedule: action.schedule(),
|
|
15
|
+
job: action.asCronjob
|
|
16
|
+
};
|
|
17
|
+
if ((0, lodash_1.isFunction)(action.cronjobOptions))
|
|
18
|
+
(0, lodash_1.set)(job, 'options', action.cronjobOptions());
|
|
19
|
+
if ((0, lodash_1.isFunction)(action.asCronjobInit))
|
|
20
|
+
(0, lodash_1.set)(job, 'init', action.asCronjobInit());
|
|
21
|
+
(0, execute_cronjob_1.default)(job);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.default = addActionCronjobs;
|
|
26
26
|
//# sourceMappingURL=add.action.cronjobs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function addActionWatchers(root: string, folderName: string): void;
|
|
1
|
+
export default function addActionWatchers(root: string, folderName: string): void;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const lodash_1 = require("lodash");
|
|
4
|
-
const folders_1 = require("@owservable/folders");
|
|
5
|
-
const execute_watcher_1 = require("../execute/execute.watcher");
|
|
6
|
-
function addActionWatchers(root, folderName) {
|
|
7
|
-
const actionPaths = (0, folders_1.listSubfoldersFilesByFolderName)(root, folderName);
|
|
8
|
-
for (const actionPath of actionPaths) {
|
|
9
|
-
console.log(' - [@owservable] Initializing watcher action', actionPath);
|
|
10
|
-
const ActionClass = require(actionPath).default;
|
|
11
|
-
const action = new ActionClass();
|
|
12
|
-
if ((0, lodash_1.isFunction)(action.asWatcher)) {
|
|
13
|
-
const job = {
|
|
14
|
-
watch: action.asWatcher
|
|
15
|
-
};
|
|
16
|
-
if ((0, lodash_1.isFunction)(action.asWatcherInit))
|
|
17
|
-
(0, lodash_1.set)(job, 'init', action.asWatcherInit());
|
|
18
|
-
(0, execute_watcher_1.default)(job);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
exports.default = addActionWatchers;
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const lodash_1 = require("lodash");
|
|
4
|
+
const folders_1 = require("@owservable/folders");
|
|
5
|
+
const execute_watcher_1 = require("../execute/execute.watcher");
|
|
6
|
+
function addActionWatchers(root, folderName) {
|
|
7
|
+
const actionPaths = (0, folders_1.listSubfoldersFilesByFolderName)(root, folderName);
|
|
8
|
+
for (const actionPath of actionPaths) {
|
|
9
|
+
console.log(' - [@owservable] Initializing watcher action', actionPath);
|
|
10
|
+
const ActionClass = require(actionPath).default;
|
|
11
|
+
const action = new ActionClass();
|
|
12
|
+
if ((0, lodash_1.isFunction)(action.asWatcher)) {
|
|
13
|
+
const job = {
|
|
14
|
+
watch: action.asWatcher
|
|
15
|
+
};
|
|
16
|
+
if ((0, lodash_1.isFunction)(action.asWatcherInit))
|
|
17
|
+
(0, lodash_1.set)(job, 'init', action.asWatcherInit());
|
|
18
|
+
(0, execute_watcher_1.default)(job);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = addActionWatchers;
|
|
23
23
|
//# sourceMappingURL=add.action.watchers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function addActionWorkers(root: string, folderName: string): void;
|
|
1
|
+
export default function addActionWorkers(root: string, folderName: string): void;
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const lodash_1 = require("lodash");
|
|
4
|
-
const folders_1 = require("@owservable/folders");
|
|
5
|
-
const execute_worker_1 = require("../execute/execute.worker");
|
|
6
|
-
function addActionWorkers(root, folderName) {
|
|
7
|
-
const actionPaths = (0, folders_1.listSubfoldersFilesByFolderName)(root, folderName);
|
|
8
|
-
for (const actionPath of actionPaths) {
|
|
9
|
-
console.log(' - [@owservable] Initializing worker action', actionPath);
|
|
10
|
-
const ActionClass = require(actionPath).default;
|
|
11
|
-
const action = new ActionClass();
|
|
12
|
-
if ((0, lodash_1.isFunction)(action.asWorker)) {
|
|
13
|
-
const job = {
|
|
14
|
-
work: action.asWorker
|
|
15
|
-
};
|
|
16
|
-
if ((0, lodash_1.isFunction)(action.asWorkerInit))
|
|
17
|
-
(0, lodash_1.set)(job, 'init', action.asWorkerInit());
|
|
18
|
-
(0, execute_worker_1.default)(job);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
exports.default = addActionWorkers;
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const lodash_1 = require("lodash");
|
|
4
|
+
const folders_1 = require("@owservable/folders");
|
|
5
|
+
const execute_worker_1 = require("../execute/execute.worker");
|
|
6
|
+
function addActionWorkers(root, folderName) {
|
|
7
|
+
const actionPaths = (0, folders_1.listSubfoldersFilesByFolderName)(root, folderName);
|
|
8
|
+
for (const actionPath of actionPaths) {
|
|
9
|
+
console.log(' - [@owservable] Initializing worker action', actionPath);
|
|
10
|
+
const ActionClass = require(actionPath).default;
|
|
11
|
+
const action = new ActionClass();
|
|
12
|
+
if ((0, lodash_1.isFunction)(action.asWorker)) {
|
|
13
|
+
const job = {
|
|
14
|
+
work: action.asWorker
|
|
15
|
+
};
|
|
16
|
+
if ((0, lodash_1.isFunction)(action.asWorkerInit))
|
|
17
|
+
(0, lodash_1.set)(job, 'init', action.asWorkerInit());
|
|
18
|
+
(0, execute_worker_1.default)(job);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = addActionWorkers;
|
|
23
23
|
//# sourceMappingURL=add.action.workers.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import CronJobType from '../../_types/cronjob.type';
|
|
2
|
-
declare const executeCronjob: (obj: CronJobType) => void;
|
|
3
|
-
export default executeCronjob;
|
|
1
|
+
import CronJobType from '../../_types/cronjob.type';
|
|
2
|
+
declare const executeCronjob: (obj: CronJobType) => void;
|
|
3
|
+
export default executeCronjob;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const cron = require("node-cron");
|
|
4
|
-
const lodash_1 = require("lodash");
|
|
5
|
-
const executeCronjob = (obj) => {
|
|
6
|
-
const { schedule, job, options, init } = obj;
|
|
7
|
-
if ((0, lodash_1.isFunction)(init))
|
|
8
|
-
init().then(() => cron.schedule(schedule, job, options));
|
|
9
|
-
else
|
|
10
|
-
cron.schedule(schedule, job, options);
|
|
11
|
-
};
|
|
12
|
-
exports.default = executeCronjob;
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const cron = require("node-cron");
|
|
4
|
+
const lodash_1 = require("lodash");
|
|
5
|
+
const executeCronjob = (obj) => {
|
|
6
|
+
const { schedule, job, options, init } = obj;
|
|
7
|
+
if ((0, lodash_1.isFunction)(init))
|
|
8
|
+
init().then(() => cron.schedule(schedule, job, options));
|
|
9
|
+
else
|
|
10
|
+
cron.schedule(schedule, job, options);
|
|
11
|
+
};
|
|
12
|
+
exports.default = executeCronjob;
|
|
13
13
|
//# sourceMappingURL=execute.cronjob.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const executeOnFilesRecursively: (folder: string, execute: Function) => void;
|
|
2
|
-
export default executeOnFilesRecursively;
|
|
1
|
+
declare const executeOnFilesRecursively: (folder: string, execute: Function) => void;
|
|
2
|
+
export default executeOnFilesRecursively;
|
|
@@ -1,18 +1,18 @@
|
|
|
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 executeOnFilesRecursively = (folder, execute) => {
|
|
7
|
-
const children = fs.readdirSync(folder);
|
|
8
|
-
const files = (0, lodash_1.filter)(children, (name) => !fs.lstatSync(path.join(folder, name)).isDirectory());
|
|
9
|
-
(0, lodash_1.each)(files, (file) => {
|
|
10
|
-
const absoluteFilePath = path.join(folder, file);
|
|
11
|
-
const obj = require(absoluteFilePath).default;
|
|
12
|
-
execute(obj);
|
|
13
|
-
});
|
|
14
|
-
const folders = (0, lodash_1.filter)(children, (name) => fs.lstatSync(path.join(folder, name)).isDirectory());
|
|
15
|
-
(0, lodash_1.each)(folders, (sub) => executeOnFilesRecursively(path.join(folder, sub), execute));
|
|
16
|
-
};
|
|
17
|
-
exports.default = executeOnFilesRecursively;
|
|
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 executeOnFilesRecursively = (folder, execute) => {
|
|
7
|
+
const children = fs.readdirSync(folder);
|
|
8
|
+
const files = (0, lodash_1.filter)(children, (name) => !fs.lstatSync(path.join(folder, name)).isDirectory());
|
|
9
|
+
(0, lodash_1.each)(files, (file) => {
|
|
10
|
+
const absoluteFilePath = path.join(folder, file);
|
|
11
|
+
const obj = require(absoluteFilePath).default;
|
|
12
|
+
execute(obj);
|
|
13
|
+
});
|
|
14
|
+
const folders = (0, lodash_1.filter)(children, (name) => fs.lstatSync(path.join(folder, name)).isDirectory());
|
|
15
|
+
(0, lodash_1.each)(folders, (sub) => executeOnFilesRecursively(path.join(folder, sub), execute));
|
|
16
|
+
};
|
|
17
|
+
exports.default = executeOnFilesRecursively;
|
|
18
18
|
//# sourceMappingURL=execute.on.files.recursively.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const executeProcessesInFolder: (root: string, folder: string, execute: Function) => void;
|
|
2
|
-
export default executeProcessesInFolder;
|
|
1
|
+
declare const executeProcessesInFolder: (root: string, folder: string, execute: Function) => void;
|
|
2
|
+
export default executeProcessesInFolder;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const lodash_1 = require("lodash");
|
|
4
|
-
const folders_1 = require("@owservable/folders");
|
|
5
|
-
const execute_on_files_recursively_1 = require("./execute.on.files.recursively");
|
|
6
|
-
const executeProcessesInFolder = (root, folder, execute) => {
|
|
7
|
-
const folders = (0, folders_1.listSubfoldersByName)(root, folder);
|
|
8
|
-
(0, lodash_1.each)(folders, (folder) => (0, execute_on_files_recursively_1.default)(folder, execute));
|
|
9
|
-
};
|
|
10
|
-
exports.default = executeProcessesInFolder;
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const lodash_1 = require("lodash");
|
|
4
|
+
const folders_1 = require("@owservable/folders");
|
|
5
|
+
const execute_on_files_recursively_1 = require("./execute.on.files.recursively");
|
|
6
|
+
const executeProcessesInFolder = (root, folder, execute) => {
|
|
7
|
+
const folders = (0, folders_1.listSubfoldersByName)(root, folder);
|
|
8
|
+
(0, lodash_1.each)(folders, (folder) => (0, execute_on_files_recursively_1.default)(folder, execute));
|
|
9
|
+
};
|
|
10
|
+
exports.default = executeProcessesInFolder;
|
|
11
11
|
//# sourceMappingURL=execute.processes.in.folder.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import WatcherType from '../../_types/watcher.type';
|
|
2
|
-
declare const executeWatcher: (obj: WatcherType) => void;
|
|
3
|
-
export default executeWatcher;
|
|
1
|
+
import WatcherType from '../../_types/watcher.type';
|
|
2
|
+
declare const executeWatcher: (obj: WatcherType) => void;
|
|
3
|
+
export default executeWatcher;
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const lodash_1 = require("lodash");
|
|
4
|
-
const executeWatcher = (obj) => {
|
|
5
|
-
const { init, watch } = obj;
|
|
6
|
-
if (
|
|
7
|
-
init
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const lodash_1 = require("lodash");
|
|
4
|
+
const executeWatcher = (obj) => {
|
|
5
|
+
const { init, watch, waitForInit = false } = obj;
|
|
6
|
+
if (true !== waitForInit) {
|
|
7
|
+
init === null || init === void 0 ? void 0 : init().then(() => null);
|
|
8
|
+
watch === null || watch === void 0 ? void 0 : watch();
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
if ((0, lodash_1.isFunction)(init))
|
|
12
|
+
init().then(() => watch === null || watch === void 0 ? void 0 : watch());
|
|
13
|
+
else
|
|
14
|
+
watch === null || watch === void 0 ? void 0 : watch();
|
|
15
|
+
};
|
|
16
|
+
exports.default = executeWatcher;
|
|
12
17
|
//# sourceMappingURL=execute.watcher.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute.watcher.js","sourceRoot":"","sources":["../../../src/functions/execute/execute.watcher.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,mCAAkC;AAIlC,MAAM,cAAc,GAAG,CAAC,GAAgB,EAAE,EAAE;IAC3C,MAAM,EAAC,IAAI,EAAE,KAAK,EAAC,GAAG,GAAG,CAAC;
|
|
1
|
+
{"version":3,"file":"execute.watcher.js","sourceRoot":"","sources":["../../../src/functions/execute/execute.watcher.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,mCAAkC;AAIlC,MAAM,cAAc,GAAG,CAAC,GAAgB,EAAE,EAAE;IAC3C,MAAM,EAAC,IAAI,EAAE,KAAK,EAAE,WAAW,GAAG,KAAK,EAAC,GAAG,GAAG,CAAC;IAE/C,IAAI,IAAI,KAAK,WAAW,EAAE;QACzB,IAAI,aAAJ,IAAI,uBAAJ,IAAI,GAAK,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;QAC1B,KAAK,aAAL,KAAK,uBAAL,KAAK,EAAI,CAAC;QACV,OAAO;KACP;IAED,IAAI,IAAA,mBAAU,EAAC,IAAI,CAAC;QAAE,IAAI,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,EAAI,CAAC,CAAC;;QAC9C,KAAK,aAAL,KAAK,uBAAL,KAAK,EAAI,CAAC;AAChB,CAAC,CAAC;AACF,kBAAe,cAAc,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import WorkerType from '../../_types/worker.type';
|
|
2
|
-
declare const executeWorker: (obj: WorkerType) => void;
|
|
3
|
-
export default executeWorker;
|
|
1
|
+
import WorkerType from '../../_types/worker.type';
|
|
2
|
+
declare const executeWorker: (obj: WorkerType) => void;
|
|
3
|
+
export default executeWorker;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const lodash_1 = require("lodash");
|
|
4
|
-
const executeWorker = (obj) => {
|
|
5
|
-
const { init, work } = obj;
|
|
6
|
-
if ((0, lodash_1.isFunction)(init))
|
|
7
|
-
init().then(() => work === null || work === void 0 ? void 0 : work());
|
|
8
|
-
else
|
|
9
|
-
work === null || work === void 0 ? void 0 : work();
|
|
10
|
-
};
|
|
11
|
-
exports.default = executeWorker;
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const lodash_1 = require("lodash");
|
|
4
|
+
const executeWorker = (obj) => {
|
|
5
|
+
const { init, work } = obj;
|
|
6
|
+
if ((0, lodash_1.isFunction)(init))
|
|
7
|
+
init().then(() => work === null || work === void 0 ? void 0 : work());
|
|
8
|
+
else
|
|
9
|
+
work === null || work === void 0 ? void 0 : work();
|
|
10
|
+
};
|
|
11
|
+
exports.default = executeWorker;
|
|
12
12
|
//# sourceMappingURL=execute.worker.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const initiateCronjobs: (root: string, folder?: string) => void;
|
|
2
|
-
export default initiateCronjobs;
|
|
1
|
+
declare const initiateCronjobs: (root: string, folder?: string) => void;
|
|
2
|
+
export default initiateCronjobs;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const execute_cronjob_1 = require("./execute/execute.cronjob");
|
|
4
|
-
const execute_processes_in_folder_1 = require("./execute/execute.processes.in.folder");
|
|
5
|
-
const initiateCronjobs = (root, folder = 'cronjobs') => {
|
|
6
|
-
(0, execute_processes_in_folder_1.default)(root, folder, execute_cronjob_1.default);
|
|
7
|
-
};
|
|
8
|
-
exports.default = initiateCronjobs;
|
|
1
|
+
'use strict';
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const execute_cronjob_1 = require("./execute/execute.cronjob");
|
|
4
|
+
const execute_processes_in_folder_1 = require("./execute/execute.processes.in.folder");
|
|
5
|
+
const initiateCronjobs = (root, folder = 'cronjobs') => {
|
|
6
|
+
(0, execute_processes_in_folder_1.default)(root, folder, execute_cronjob_1.default);
|
|
7
|
+
};
|
|
8
|
+
exports.default = initiateCronjobs;
|
|
9
9
|
//# sourceMappingURL=initiate.cronjobs.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const initiateWatchers: (root: string, folder?: string) => void;
|
|
2
|
-
export default initiateWatchers;
|
|
1
|
+
declare const initiateWatchers: (root: string, folder?: string) => void;
|
|
2
|
+
export default initiateWatchers;
|