taon 19.0.49 → 19.0.51
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/README.md +160 -160
- package/bin/start.js +279 -279
- package/bin/taon +6 -6
- package/bin/taon-debug +5 -5
- package/bin/taon-debug-brk +5 -5
- package/browser/README.md +24 -24
- package/browser/fesm2022/taon.mjs +60 -9
- package/browser/fesm2022/taon.mjs.map +1 -1
- package/browser/lib/endpoint-context.d.ts +6 -0
- package/browser/lib/models.d.ts +19 -0
- package/browser/package.json +1 -1
- package/env.d.ts +3 -0
- package/environments/angular-node-app/env.angular-node-app.__.d.ts +3 -0
- package/environments/angular-node-app/env.angular-node-app.dev.d.ts +3 -0
- package/environments/angular-node-app/env.angular-node-app.localhost.d.ts +3 -0
- package/environments/angular-node-app/env.angular-node-app.prod.d.ts +3 -0
- package/environments/angular-node-app/env.angular-node-app.stage.d.ts +3 -0
- package/environments/docs-webapp/env.docs-webapp.__.d.ts +3 -0
- package/environments/electron-app/env.electron-app.__.d.ts +3 -0
- package/environments/electron-app/env.electron-app.prod.d.ts +3 -0
- package/environments/mobile-app/env.mobile-app.__.d.ts +3 -0
- package/environments/mobile-app/env.mobile-app.prod.d.ts +3 -0
- package/environments/npm-lib-and-cli-tool/env.npm-lib-and-cli-tool.__.d.ts +3 -0
- package/environments/npm-lib-and-cli-tool/env.npm-lib-and-cli-tool.prod.d.ts +3 -0
- package/environments/vscode-plugin/env.vscode-plugin.__.d.ts +6 -0
- package/environments/vscode-plugin/env.vscode-plugin.prod.d.ts +4 -0
- package/lib/build-info._auto-generated_.d.ts +16 -1
- package/lib/build-info._auto-generated_.js +16 -1
- package/lib/build-info._auto-generated_.js.map +1 -1
- package/lib/create-context.js +15 -0
- package/lib/create-context.js.map +1 -1
- package/lib/endpoint-context.d.ts +6 -0
- package/lib/endpoint-context.js +37 -7
- package/lib/endpoint-context.js.map +1 -1
- package/lib/env/env.angular-node-app.d.ts +1 -0
- package/lib/env/env.angular-node-app.js +3 -2
- package/lib/env/env.angular-node-app.js.map +1 -1
- package/lib/env/env.docs-webapp.d.ts +1 -0
- package/lib/env/env.docs-webapp.js +3 -2
- package/lib/env/env.docs-webapp.js.map +1 -1
- package/lib/env/env.electron-app.d.ts +1 -0
- package/lib/env/env.electron-app.js +3 -2
- package/lib/env/env.electron-app.js.map +1 -1
- package/lib/env/env.mobile-app.d.ts +1 -0
- package/lib/env/env.mobile-app.js +3 -2
- package/lib/env/env.mobile-app.js.map +1 -1
- package/lib/env/env.npm-lib-and-cli-tool.d.ts +1 -0
- package/lib/env/env.npm-lib-and-cli-tool.js +3 -2
- package/lib/env/env.npm-lib-and-cli-tool.js.map +1 -1
- package/lib/env/env.vscode-plugin.d.ts +1 -0
- package/lib/env/env.vscode-plugin.js +3 -2
- package/lib/env/env.vscode-plugin.js.map +1 -1
- package/lib/models.d.ts +19 -0
- package/lib/models.js +3 -0
- package/lib/models.js.map +1 -1
- package/lib/realtime/realtime-client.js +9 -0
- package/lib/realtime/realtime-client.js.map +1 -1
- package/lib/realtime/realtime-server.js +1 -4
- package/lib/realtime/realtime-server.js.map +1 -1
- package/lib/ui/directives/index.d.ts +3 -0
- package/lib/ui/directives/index.js +5 -0
- package/lib/ui/directives/index.js.map +1 -0
- package/lib/ui/directives/safe.pipe.d.ts +7 -0
- package/lib/ui/directives/taon-inject-html.directive.d.ts +6 -0
- package/lib/ui/directives/taon-long-press.directive.d.ts +22 -0
- package/lib/ui/directives/view-mode.d.ts +5 -0
- package/lib/ui/directives/view-mode.js +10 -0
- package/lib/ui/directives/view-mode.js.map +1 -0
- package/lib/ui/index.js +2 -2
- package/lib/ui/taon-admin-mode-configuration/index.js +2 -2
- package/lib/ui/taon-admin-mode-configuration/taon-admin-mode-configuration.component.d.ts +43 -0
- package/lib/ui/taon-admin-mode-configuration/taon-admin.models.d.ts +5 -0
- package/lib/ui/taon-admin-mode-configuration/taon-admin.models.js +3 -0
- package/lib/ui/taon-admin-mode-configuration/taon-admin.models.js.map +1 -0
- package/lib/ui/taon-full-material.module.d.ts +5 -0
- package/lib/ui/taon-github-fork-me-corner/index.d.ts +2 -0
- package/lib/ui/taon-github-fork-me-corner/index.js +5 -0
- package/lib/ui/taon-github-fork-me-corner/index.js.map +1 -0
- package/lib/ui/taon-github-fork-me-corner/taon-github-fork-me-corner.component.d.ts +3 -0
- package/lib/ui/taon-github-fork-me-corner/taon-github-fork-me-corner.module.d.ts +2 -0
- package/lib/ui/taon-github-fork-me-ribbon/index.d.ts +2 -0
- package/lib/ui/taon-github-fork-me-ribbon/index.js +5 -0
- package/lib/ui/taon-github-fork-me-ribbon/index.js.map +1 -0
- package/lib/ui/taon-github-fork-me-ribbon/taon-github-fork-me-ribbon.component.d.ts +3 -0
- package/lib/ui/taon-github-fork-me-ribbon/taon-github-fork-me-ribbon.module.d.ts +2 -0
- package/lib/ui/taon-notifications/index.d.ts +4 -0
- package/lib/ui/taon-notifications/index.js +24 -0
- package/lib/ui/taon-notifications/index.js.map +1 -0
- package/lib/ui/taon-notifications/taon-notifications.component.d.ts +9 -0
- package/lib/ui/taon-notifications/taon-notifications.models.d.ts +6 -0
- package/lib/ui/taon-notifications/taon-notifications.models.js +5 -0
- package/lib/ui/taon-notifications/taon-notifications.models.js.map +1 -0
- package/lib/ui/taon-notifications/taon-notifications.module.d.ts +2 -0
- package/lib/ui/taon-notifications/taon-notifications.service.d.ts +11 -0
- package/lib/ui/taon-progress-bar/index.d.ts +2 -0
- package/lib/ui/taon-progress-bar/index.js +5 -0
- package/lib/ui/taon-progress-bar/index.js.map +1 -0
- package/lib/ui/taon-progress-bar/taon-progress-bar.component.d.ts +13 -0
- package/lib/ui/taon-progress-bar/taon-progress-bar.module.d.ts +2 -0
- package/lib/ui/taon-session-passcode/index.d.ts +1 -0
- package/lib/ui/taon-session-passcode/index.js +5 -0
- package/lib/ui/taon-session-passcode/index.js.map +1 -0
- package/lib/ui/taon-session-passcode/taon-session-passcode.component.d.ts +35 -0
- package/lib/ui/taon-table/index.d.ts +2 -0
- package/lib/ui/taon-table/index.js +5 -0
- package/lib/ui/taon-table/index.js.map +1 -0
- package/lib/ui/taon-table/taon-table.component.d.ts +34 -0
- package/lib/ui/taon-table/taon-table.module.d.ts +2 -0
- package/lib/ui/taon.models.d.ts +11 -0
- package/lib/ui/taon.models.js +3 -0
- package/lib/ui/taon.models.js.map +1 -0
- package/package.json +1 -1
- package/tmp-environment.json +32 -0
- package/websql/README.md +24 -24
- package/websql/fesm2022/taon.mjs +63 -9
- package/websql/fesm2022/taon.mjs.map +1 -1
- package/websql/lib/endpoint-context.d.ts +6 -0
- package/websql/lib/models.d.ts +19 -0
- package/websql/package.json +1 -1
|
@@ -59,6 +59,10 @@ export declare class EndpointContext {
|
|
|
59
59
|
get logFramework(): boolean;
|
|
60
60
|
get logDb(): boolean;
|
|
61
61
|
get logMigrations(): boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Inside docker there is not need for https secure server
|
|
64
|
+
*/
|
|
65
|
+
private isRunningInsideDocker;
|
|
62
66
|
constructor(originalConfig: Models.ContextOptions<any, any, any, any, any, any, any>, configFn: (env: any) => Models.ContextOptions<any, any, any, any, any, any, any>);
|
|
63
67
|
init(options?: {
|
|
64
68
|
initFromRecrusiveContextResovle?: boolean;
|
|
@@ -102,6 +106,7 @@ export declare class EndpointContext {
|
|
|
102
106
|
reinitControllers(): Promise<void>;
|
|
103
107
|
initClasses(): Promise<void>;
|
|
104
108
|
isActiveOn(classInstance: object): boolean;
|
|
109
|
+
get frontendHostUri(): URL;
|
|
105
110
|
get uri(): URL;
|
|
106
111
|
get uriPort(): string | undefined;
|
|
107
112
|
get uriProtocol(): string | undefined;
|
|
@@ -134,6 +139,7 @@ export declare class EndpointContext {
|
|
|
134
139
|
* ipc/udp needs this
|
|
135
140
|
*/
|
|
136
141
|
get contextName(): string;
|
|
142
|
+
get activeContext(): string | null;
|
|
137
143
|
get appId(): string;
|
|
138
144
|
get publicAssets(): {
|
|
139
145
|
serverPath: string;
|
package/browser/lib/models.d.ts
CHANGED
|
@@ -85,10 +85,21 @@ export declare namespace Models {
|
|
|
85
85
|
appId?: string;
|
|
86
86
|
contextName: string;
|
|
87
87
|
/**
|
|
88
|
+
* if defined and different from contextName
|
|
89
|
+
* - context will NOT be initialized
|
|
90
|
+
*/
|
|
91
|
+
activeContext?: string | null;
|
|
92
|
+
/**
|
|
93
|
+
* IMPORTANT! provide full url that starts with http:// or https://
|
|
88
94
|
* host/port for initing backend server
|
|
89
95
|
*/
|
|
90
96
|
host?: string;
|
|
91
97
|
/**
|
|
98
|
+
* Needs to be specified in docker environment only
|
|
99
|
+
*/
|
|
100
|
+
hostPortNumber?: number;
|
|
101
|
+
/**
|
|
102
|
+
* IMPORTANT! provide full url that starts with http:// or https://
|
|
92
103
|
* frontend host only needed when we are
|
|
93
104
|
* using withCredentials for axios
|
|
94
105
|
* and session cookie
|
|
@@ -96,6 +107,11 @@ export declare namespace Models {
|
|
|
96
107
|
*/
|
|
97
108
|
frontendHost?: string;
|
|
98
109
|
/**
|
|
110
|
+
* Needs to be specified in docker environment only
|
|
111
|
+
*/
|
|
112
|
+
frontendHostPortNumber?: number;
|
|
113
|
+
/**
|
|
114
|
+
* IMPORTANT! provide full url that starts with http:// or https://
|
|
99
115
|
* backend way of communication
|
|
100
116
|
* between taon backends/processes
|
|
101
117
|
*/
|
|
@@ -143,7 +159,10 @@ export declare namespace Models {
|
|
|
143
159
|
class MethodConfig {
|
|
144
160
|
methodName: string;
|
|
145
161
|
/**
|
|
162
|
+
* @deprecated don't use in production - keep stuff encapsulated
|
|
146
163
|
* path is global in express app
|
|
164
|
+
* ! BE CAREFUL ! global path IS NOT GLOBAL inside dockerized app
|
|
165
|
+
* (/api/contextName is automatically added to global path in docker)
|
|
147
166
|
*/
|
|
148
167
|
global?: boolean;
|
|
149
168
|
/**
|
package/browser/package.json
CHANGED
package/env.d.ts
ADDED
|
@@ -1,5 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Autogenerated by current cli tool
|
|
3
|
+
*/
|
|
1
4
|
export declare const BUILD_FRAMEWORK_CLI_NAME = "tnp";
|
|
5
|
+
/**
|
|
6
|
+
* This value can be change in taon.jsonc (appId)
|
|
7
|
+
*/
|
|
2
8
|
export declare const APP_ID = "dev.taon.app";
|
|
9
|
+
/**
|
|
10
|
+
* Autogenerated by current cli tool
|
|
11
|
+
*/
|
|
3
12
|
export declare const BUILD_BASE_HREF = "";
|
|
13
|
+
/**
|
|
14
|
+
* This value can be change in taon.jsonc (overrideNpmName)
|
|
15
|
+
*/
|
|
4
16
|
export declare const PROJECT_NPM_NAME = "taon";
|
|
5
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Autogenerated by current cli tool. Use *tnp release* to bump version.
|
|
19
|
+
*/
|
|
20
|
+
export declare const CURRENT_PACKAGE_VERSION = "19.0.51";
|
|
@@ -2,10 +2,25 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CURRENT_PACKAGE_VERSION = exports.PROJECT_NPM_NAME = exports.BUILD_BASE_HREF = exports.APP_ID = exports.BUILD_FRAMEWORK_CLI_NAME = void 0;
|
|
4
4
|
// THIS FILE IS GENERATED - DO NOT MODIFY
|
|
5
|
+
/**
|
|
6
|
+
* Autogenerated by current cli tool
|
|
7
|
+
*/
|
|
5
8
|
exports.BUILD_FRAMEWORK_CLI_NAME = 'tnp';
|
|
9
|
+
/**
|
|
10
|
+
* This value can be change in taon.jsonc (appId)
|
|
11
|
+
*/
|
|
6
12
|
exports.APP_ID = 'dev.taon.app';
|
|
13
|
+
/**
|
|
14
|
+
* Autogenerated by current cli tool
|
|
15
|
+
*/
|
|
7
16
|
exports.BUILD_BASE_HREF = '';
|
|
17
|
+
/**
|
|
18
|
+
* This value can be change in taon.jsonc (overrideNpmName)
|
|
19
|
+
*/
|
|
8
20
|
exports.PROJECT_NPM_NAME = 'taon';
|
|
9
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Autogenerated by current cli tool. Use *tnp release* to bump version.
|
|
23
|
+
*/
|
|
24
|
+
exports.CURRENT_PACKAGE_VERSION = '19.0.51';
|
|
10
25
|
// THIS FILE IS GENERATED - DO NOT MODIFY
|
|
11
26
|
//# sourceMappingURL=build-info._auto-generated_.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-info._auto-generated_.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;AAAA,yCAAyC;
|
|
1
|
+
{"version":3,"file":"build-info._auto-generated_.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;AAAA,yCAAyC;AACzC;;GAEG;AACU,QAAA,wBAAwB,GAAG,KAAK,CAAC;AAC9C;;GAEG;AACU,QAAA,MAAM,GAAG,cAAc,CAAC;AACrC;;GAEG;AACU,QAAA,eAAe,GAAG,EAAE,CAAC;AAClC;;GAEG;AACU,QAAA,gBAAgB,GAAG,MAAM,CAAC;AACvC;;GAEG;AACU,QAAA,uBAAuB,GAAG,SAAS,CAAC;AACjD,yCAAyC"}
|
package/lib/create-context.js
CHANGED
|
@@ -23,6 +23,11 @@ exports.createContextTemplate = createContextTemplate;
|
|
|
23
23
|
*/
|
|
24
24
|
const createContext = (configFn) => {
|
|
25
25
|
let config = configFn({});
|
|
26
|
+
// console.log(
|
|
27
|
+
// `
|
|
28
|
+
// [Taon] Creating context ${config.contextName}...`,
|
|
29
|
+
// {config},
|
|
30
|
+
// );
|
|
26
31
|
const endpointContextRef = new endpoint_context_1.EndpointContext(config, configFn);
|
|
27
32
|
const res = {
|
|
28
33
|
//#region types
|
|
@@ -123,6 +128,16 @@ const createContext = (configFn) => {
|
|
|
123
128
|
return await new Promise(async (resolve, reject) => {
|
|
124
129
|
//#region init in set timeout
|
|
125
130
|
setTimeout(async () => {
|
|
131
|
+
if (lib_1.UtilsOs.isRunningInDocker()) {
|
|
132
|
+
const activeContext = config?.activeContext || null;
|
|
133
|
+
if (lib_1._.isString(activeContext) &&
|
|
134
|
+
activeContext !== '' &&
|
|
135
|
+
activeContext !== config?.contextName) {
|
|
136
|
+
console.warn(`[taon] Context ${endpointContextRef.contextName} is not active context, skipping initialization.`);
|
|
137
|
+
resolve(endpointContextRef);
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
126
141
|
await endpointContextRef.init({
|
|
127
142
|
...overrideOptions,
|
|
128
143
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-context.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;AAAA,iBAAiB;AACjB,
|
|
1
|
+
{"version":3,"file":"create-context.js","sourceRoot":"","sources":[""],"names":[],"mappings":";;;AAAA,iBAAiB;AACjB,sCAAmD;AAEnD,yDAAqD;AAErD,KAAK;AACL,YAAY;AAEZ;;;;GAIG;AACI,MAAM,qBAAqB,GAAG,CAWnC,QAUC,EACD,EAAE;IACF,OAAO,GAAG,EAAE;QACV,OAAO,IAAA,qBAAa,EAQlB,QAAQ,CAAC,CAAC;IACd,CAAC,CAAC;AACJ,CAAC,CAAC;AAlCW,QAAA,qBAAqB,yBAkChC;AAEF;;;GAGG;AACI,MAAM,aAAa,GAAG,CAW3B,QAUC,EACD,EAAE;IACF,IAAI,MAAM,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC1B,eAAe;IACf,MAAM;IAEN,uDAAuD;IACvD,cAAc;IACd,KAAK;IACL,MAAM,kBAAkB,GAAG,IAAI,kCAAe,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAEjE,MAAM,GAAG,GAAG;QACV,eAAe;QACf,KAAK,EAAE;YACL,qBAAqB;YACrB,mBAAmB;YACnB,4BAA4B;YAC5B,KAAK;YACL,4CAA4C;YAC5C,mDAAmD;YACnD,2CAA2C;YAC3C,2CAA2C;YAC3C,oEAAoE;YACpE,0DAA0D;YAC1D,4CAA4C;YAC5C,+CAA+C;YAC/C,8BAA8B;YAC9B,QAAQ;YACR,MAAM;YACN,qEAAqE;YACrE,KAAK;YACL,YAAY;YACZ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AC;oBAED,OAAO,CAAC,kBAAkB,CAAC,CAAC;gBAC9B,CAAC,CAAC,CAAC;gBACH,YAAY;YACd,CAAC,CAAC,CAAC;QACL,CAAC;QACD;;;WAGG;QACH,IAAI,QAAQ;YACV,OAAO;gBACL,IAAI,MAAM;oBACR,OAAO,kBAAkB,CAAC,cAAc,CAAC;gBAC3C,CAAC;gBACD,IAAI,MAAM;oBACR,OAAO,kBAAkB,CAAC,cAAc,CAAC;gBAC3C,CAAC;aACF,CAAC;QACJ,CAAC;KACF,CAAC;IACF,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AAvPW,QAAA,aAAa,iBAuPxB"}
|
|
@@ -61,6 +61,10 @@ export declare class EndpointContext {
|
|
|
61
61
|
get logFramework(): boolean;
|
|
62
62
|
get logDb(): boolean;
|
|
63
63
|
get logMigrations(): boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Inside docker there is not need for https secure server
|
|
66
|
+
*/
|
|
67
|
+
private isRunningInsideDocker;
|
|
64
68
|
constructor(originalConfig: Models.ContextOptions<any, any, any, any, any, any, any>, configFn: (env: any) => Models.ContextOptions<any, any, any, any, any, any, any>);
|
|
65
69
|
init(options?: {
|
|
66
70
|
initFromRecrusiveContextResovle?: boolean;
|
|
@@ -104,6 +108,7 @@ export declare class EndpointContext {
|
|
|
104
108
|
reinitControllers(): Promise<void>;
|
|
105
109
|
initClasses(): Promise<void>;
|
|
106
110
|
isActiveOn(classInstance: object): boolean;
|
|
111
|
+
get frontendHostUri(): URL;
|
|
107
112
|
get uri(): URL;
|
|
108
113
|
get uriPort(): string | undefined;
|
|
109
114
|
get uriProtocol(): string | undefined;
|
|
@@ -136,6 +141,7 @@ export declare class EndpointContext {
|
|
|
136
141
|
* ipc/udp needs this
|
|
137
142
|
*/
|
|
138
143
|
get contextName(): string;
|
|
144
|
+
get activeContext(): string | null;
|
|
139
145
|
get appId(): string;
|
|
140
146
|
get publicAssets(): {
|
|
141
147
|
serverPath: string;
|
package/lib/endpoint-context.js
CHANGED
|
@@ -184,9 +184,14 @@ class EndpointContext {
|
|
|
184
184
|
//#endregion
|
|
185
185
|
//#endregion
|
|
186
186
|
//#region constructor
|
|
187
|
+
/**
|
|
188
|
+
* Inside docker there is not need for https secure server
|
|
189
|
+
*/
|
|
190
|
+
isRunningInsideDocker = false;
|
|
187
191
|
constructor(originalConfig, configFn) {
|
|
188
192
|
this.originalConfig = originalConfig;
|
|
189
193
|
this.configFn = configFn;
|
|
194
|
+
this.isRunningInsideDocker = lib_8.UtilsOs.isRunningInDocker();
|
|
190
195
|
}
|
|
191
196
|
//#endregion
|
|
192
197
|
//#region methods & getters / init
|
|
@@ -393,7 +398,14 @@ class EndpointContext {
|
|
|
393
398
|
//#region @backend
|
|
394
399
|
this.expressApp = express();
|
|
395
400
|
this.initMiddlewares();
|
|
396
|
-
this.
|
|
401
|
+
const shouldStartHttpsSecureServer = this.isHttpServer && !this.isRunningInsideDocker;
|
|
402
|
+
this.logFramework &&
|
|
403
|
+
lib_10.Helpers.info(`
|
|
404
|
+
|
|
405
|
+
Starting server ${shouldStartHttpsSecureServer ? 'with' : 'without'} HTTPS secure server
|
|
406
|
+
|
|
407
|
+
`);
|
|
408
|
+
this.serverTcpUdp = shouldStartHttpsSecureServer
|
|
397
409
|
? new lib_7.https.Server({
|
|
398
410
|
key: this.config.https?.key,
|
|
399
411
|
cert: this.config.https?.cert,
|
|
@@ -447,12 +459,12 @@ class EndpointContext {
|
|
|
447
459
|
console.log(`
|
|
448
460
|
|
|
449
461
|
|
|
450
|
-
IS RUNNING IN DOCKER: ${
|
|
462
|
+
IS RUNNING IN DOCKER: ${this.isRunningInsideDocker}
|
|
451
463
|
|
|
452
464
|
`);
|
|
453
465
|
//#region @websqlFunc
|
|
454
466
|
let databaseConfig = models_1.Models.DatabaseConfig.from({});
|
|
455
|
-
if (
|
|
467
|
+
if (this.isRunningInsideDocker) {
|
|
456
468
|
if (this.USE_MARIADB_MYSQL_IN_DOCKER) {
|
|
457
469
|
// Helpers.info('Running in docker, using in mysql database');
|
|
458
470
|
// // TODO auto resolve database config in docker
|
|
@@ -514,7 +526,7 @@ class EndpointContext {
|
|
|
514
526
|
//#region @backend
|
|
515
527
|
if (lib_8.UtilsOs.isElectron) {
|
|
516
528
|
dbLocationInOs = (0, lib_9.crossPlatformPath)([
|
|
517
|
-
|
|
529
|
+
lib_8.UtilsOs.getRealHomeDir(),
|
|
518
530
|
`.taon/databases-for-electron-apps/${this.appId || lib_10._.snakeCase(process.cwd()).replace(/\_/, '.')}/${this.contextName}.sqlite`,
|
|
519
531
|
]);
|
|
520
532
|
if (!lib_10.Helpers.exists(lib_11.path.dirname(dbLocationInOs))) {
|
|
@@ -583,7 +595,7 @@ class EndpointContext {
|
|
|
583
595
|
}
|
|
584
596
|
if (this.mode === 'backend-frontend(tcp+udp)') {
|
|
585
597
|
return await new Promise(resolve => {
|
|
586
|
-
if (
|
|
598
|
+
if (this.isRunningInsideDocker) {
|
|
587
599
|
// this.displayRoutes(this.expressApp);
|
|
588
600
|
this.serverTcpUdp.listen(Number(this.uriPort), '0.0.0.0', () => {
|
|
589
601
|
lib_10.Helpers.log(`Express server (inside docker) started 0.0.0.0:${this.uriPort}`);
|
|
@@ -1007,6 +1019,13 @@ class EndpointContext {
|
|
|
1007
1019
|
}
|
|
1008
1020
|
//#endregion
|
|
1009
1021
|
//#region methods & getters / uri
|
|
1022
|
+
get frontendHostUri() {
|
|
1023
|
+
const url = this.config?.frontendHost?.startsWith('http')
|
|
1024
|
+
? this.config.frontendHost
|
|
1025
|
+
: `${globalThis?.location?.protocol || 'http:'}//${this.config?.frontendHost}`;
|
|
1026
|
+
const uri = new url_1.URL(url.replace(/\/$/, ''));
|
|
1027
|
+
return uri;
|
|
1028
|
+
}
|
|
1010
1029
|
get uri() {
|
|
1011
1030
|
const url = this.host
|
|
1012
1031
|
? new url_1.URL(this.host)
|
|
@@ -1017,6 +1036,9 @@ class EndpointContext {
|
|
|
1017
1036
|
}
|
|
1018
1037
|
//#endregion
|
|
1019
1038
|
get uriPort() {
|
|
1039
|
+
if (!this.uri?.origin?.includes('localhost')) {
|
|
1040
|
+
return this.config?.hostPortNumber?.toString();
|
|
1041
|
+
}
|
|
1020
1042
|
return this.uri?.port;
|
|
1021
1043
|
}
|
|
1022
1044
|
get uriProtocol() {
|
|
@@ -1073,6 +1095,9 @@ class EndpointContext {
|
|
|
1073
1095
|
return this.config.contextName;
|
|
1074
1096
|
}
|
|
1075
1097
|
//#endregion
|
|
1098
|
+
get activeContext() {
|
|
1099
|
+
return this.config.activeContext || null;
|
|
1100
|
+
}
|
|
1076
1101
|
get appId() {
|
|
1077
1102
|
return this.config.appId;
|
|
1078
1103
|
}
|
|
@@ -1179,7 +1204,7 @@ class EndpointContext {
|
|
|
1179
1204
|
}
|
|
1180
1205
|
else {
|
|
1181
1206
|
if (this.USE_MARIADB_MYSQL_IN_DOCKER) {
|
|
1182
|
-
autoSave = !
|
|
1207
|
+
autoSave = !this.isRunningInsideDocker; // in docker I am using mysql or posgress
|
|
1183
1208
|
}
|
|
1184
1209
|
else {
|
|
1185
1210
|
autoSave = true; // on docker with sqljs I need to save db
|
|
@@ -1320,8 +1345,13 @@ class EndpointContext {
|
|
|
1320
1345
|
const methodConfig = classConfig.methods[methodName];
|
|
1321
1346
|
// debugger
|
|
1322
1347
|
const type = methodConfig.type;
|
|
1348
|
+
// this is quick fix - in docker global path should not be used
|
|
1349
|
+
const globalPathPart = this.isRunningInsideDocker ||
|
|
1350
|
+
!this.frontendHostUri?.origin?.includes('localhost') // fe with domain -> is in docker
|
|
1351
|
+
? `${this.uriPathnameOrNothingIfRoot.replace(/\/$/, '')}/${constants_1.apiPrefix}/${this.contextName}`.replace(/\/\//, '/')
|
|
1352
|
+
: '';
|
|
1323
1353
|
const expressPath = methodConfig.global
|
|
1324
|
-
?
|
|
1354
|
+
? `${globalPathPart}/${methodConfig.path?.replace(/\/$/, '')}`.replace(/\/\//, '/')
|
|
1325
1355
|
: taon_helpers_1.TaonHelpers.getExpressPath(classConfig, methodConfig);
|
|
1326
1356
|
// console.log({ expressPath });
|
|
1327
1357
|
if (lib_10.Helpers.isNode || lib_10.Helpers.isWebSQL) {
|