@hapiboo/flux 1.0.0 → 1.0.2
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.
|
@@ -4,7 +4,7 @@ import { FluxObjectCreator } from './types';
|
|
|
4
4
|
export declare namespace fluxApplication {
|
|
5
5
|
function registerModule(module: IFluxModule): void;
|
|
6
6
|
function initialize(dbProvider: IDBProviderFlux): void;
|
|
7
|
-
function start():
|
|
7
|
+
function start(): void;
|
|
8
8
|
namespace repository {
|
|
9
9
|
function initializeModels(): IResponsePromiseVoid;
|
|
10
10
|
function deleteModel(source: FluxObjectCreator, identifier: string): IResponsePromiseVoid;
|
|
@@ -21,17 +21,23 @@ var fluxApplication;
|
|
|
21
21
|
_dbProvider = dbProvider;
|
|
22
22
|
console.info(`Initializing application with ${modules.length} modules and ${models.length} models.`);
|
|
23
23
|
modules.forEach((module) => {
|
|
24
|
-
module.initialize
|
|
24
|
+
if (module.initialize) {
|
|
25
|
+
module.initialize();
|
|
26
|
+
}
|
|
25
27
|
});
|
|
26
28
|
}
|
|
27
29
|
fluxApplication.initialize = initialize;
|
|
28
30
|
function start() {
|
|
29
|
-
|
|
31
|
+
core_1.promise.createDelayedVoidPromise((resolve, reject) => {
|
|
30
32
|
console.info('Starting application...');
|
|
31
33
|
core_1.promise.checkVoid(repository.initializeModels(), reject)
|
|
32
34
|
.then(() => {
|
|
33
35
|
core_1.promise.resolveVoid(startModule([...modules]), resolve, reject);
|
|
34
36
|
});
|
|
37
|
+
}).then(() => {
|
|
38
|
+
console.info('Flux Application started successfully.');
|
|
39
|
+
}).catch((error) => {
|
|
40
|
+
console.error('Error starting Flux Application:', error);
|
|
35
41
|
});
|
|
36
42
|
}
|
|
37
43
|
fluxApplication.start = start;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IFluxIndexInfo, IFluxColumnInfo, IFluxIndexData, IFluxDataModel, IFluxDataModelDefinition, IFluxDataModelWriter, IFluxDataModelReader, IFluxDBFilter, IFluxDBCondition, IFluxDBSubCondition, IFluxObject, IFluxModule, IDBProviderFlux } from './interfaces';
|
|
2
2
|
import { FluxColumn, FluxColumnPrimary, FluxDBFilterLogic, FluxDBFilterOperator, FluxDBFilterOperatorValues, FluxDBFilterOperatorCollection } from './types';
|
|
3
3
|
import { FluxTable, FluxIndex, FluxExposedColumn, FluxIdentifier } from './decorators';
|
|
4
|
-
import { fluxApplication } from './
|
|
4
|
+
import { fluxApplication } from './application';
|
|
5
5
|
import { conditionBuilder } from './conditions';
|
|
6
6
|
export { FluxColumn, FluxColumnPrimary };
|
|
7
7
|
export { IFluxIndexInfo, IFluxColumnInfo, IFluxIndexData };
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "FluxTable", { enumerable: true, get: function ()
|
|
|
9
9
|
Object.defineProperty(exports, "FluxIndex", { enumerable: true, get: function () { return decorators_1.FluxIndex; } });
|
|
10
10
|
Object.defineProperty(exports, "FluxExposedColumn", { enumerable: true, get: function () { return decorators_1.FluxExposedColumn; } });
|
|
11
11
|
Object.defineProperty(exports, "FluxIdentifier", { enumerable: true, get: function () { return decorators_1.FluxIdentifier; } });
|
|
12
|
-
const
|
|
13
|
-
Object.defineProperty(exports, "fluxApplication", { enumerable: true, get: function () { return
|
|
12
|
+
const application_1 = require("./application");
|
|
13
|
+
Object.defineProperty(exports, "fluxApplication", { enumerable: true, get: function () { return application_1.fluxApplication; } });
|
|
14
14
|
const conditions_1 = require("./conditions");
|
|
15
15
|
Object.defineProperty(exports, "conditionBuilder", { enumerable: true, get: function () { return conditions_1.conditionBuilder; } });
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -41,6 +41,7 @@ export interface IFluxDBFilter {
|
|
|
41
41
|
}
|
|
42
42
|
export interface IDBProviderFlux {
|
|
43
43
|
init(model: IFluxDataModelDefinition): IResponsePromiseVoid;
|
|
44
|
+
count(model: IFluxDataModel): IResponsePromise<number>;
|
|
44
45
|
read<T extends IFluxObject>(creator: IFluxDataModelReader<T>): IResponsePromise<T>;
|
|
45
46
|
array<T extends IFluxObject>(creator: IFluxDataModelReader<T>, filter: IFluxDBFilter | undefined, queryLimit: number | undefined): IResponsePromise<T[]>;
|
|
46
47
|
query<T extends IFluxObject>(creator: IFluxDataModelReader<T>, info: IFluxIndexInfo, data: IFluxIndexData, filter: IFluxDBFilter | undefined, queryLimit: number | undefined): IResponsePromise<T[]>;
|
|
@@ -54,6 +55,6 @@ export interface IFluxObject {
|
|
|
54
55
|
export interface IFluxModule {
|
|
55
56
|
name: string;
|
|
56
57
|
models: FluxObjectCreator[];
|
|
57
|
-
initialize()
|
|
58
|
+
initialize?: () => void;
|
|
58
59
|
start?: () => IResponsePromiseVoid;
|
|
59
60
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hapiboo/flux",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "MK13 Studio Hapiboo Flux - Modular Application Services",
|
|
5
5
|
"author": "MK13 Studio",
|
|
6
6
|
"license": "ISC",
|
|
@@ -24,8 +24,10 @@
|
|
|
24
24
|
"typescript-eslint": "^8.51.0"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
|
+
"version-to-publish": "pnpm exec tsx ../../scripts/version_update.ts packages/__flux --publish-version",
|
|
27
28
|
"publish-check": "bash ../../scripts/publish.sh ./",
|
|
29
|
+
"version-to-children": "pnpm exec tsx ../../scripts/version_update.ts packages/__flux --update-children",
|
|
28
30
|
"ci:publish-prepare": "rm -f pnpm-lock.yaml && rm -rf node_modules dist && pnpm install --ignore-workspace --no-frozen-lockfile && eslint 'src/*.ts' && echo \"Linter OK\" && tsc && echo \"Build OK\"",
|
|
29
|
-
"ci:publish": "pnpm ci:publish-prepare && pnpm publish-check"
|
|
31
|
+
"ci:publish": "pnpm ci:publish-prepare && pnpm version-to-publish && pnpm publish-check && pnpm version-to-children"
|
|
30
32
|
}
|
|
31
33
|
}
|