@qelos/plugin-play 2.0.29 → 3.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.
- package/create-cert.js +1 -1
- package/dist/index.d.ts +2 -26
- package/dist/index.js +2 -10
- package/dist/index.js.map +1 -1
- package/dist/injectables.d.ts +6 -0
- package/dist/injectables.js +5 -0
- package/dist/injectables.js.map +1 -0
- package/dist/manifest.d.ts +1 -0
- package/dist/manifest.js +1 -0
- package/dist/manifest.js.map +1 -1
- package/dist/micro-frontends.d.ts +26 -0
- package/dist/micro-frontends.js +11 -0
- package/dist/micro-frontends.js.map +1 -0
- package/package.json +3 -3
- package/src/endpoints.ts +1 -1
- package/src/index.ts +2 -37
- package/src/injectables.ts +11 -0
- package/src/manifest.ts +1 -0
- package/src/micro-frontends.ts +79 -0
package/create-cert.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const {execSync} = require('child_process');
|
|
2
2
|
|
|
3
|
-
execSync(`cd cert && docker run -v $
|
|
3
|
+
execSync(`cd cert && docker run -v ${process.cwd()}:/certs \\
|
|
4
4
|
-e SSL_SUBJECT=${process.env.HOSTNAME || '0.0.0.0'} stakater/ssl-certs-generator:1.0`, {stdio: 'inherit'});
|
|
5
5
|
|
|
6
6
|
console.log('done.');
|
package/dist/index.d.ts
CHANGED
|
@@ -1,30 +1,6 @@
|
|
|
1
|
-
import { NavBarGroup } from './manifest';
|
|
2
|
-
export interface MicroFrontend {
|
|
3
|
-
name: string;
|
|
4
|
-
description: string;
|
|
5
|
-
url: string;
|
|
6
|
-
roles?: string[];
|
|
7
|
-
route?: {
|
|
8
|
-
name: string;
|
|
9
|
-
path: string;
|
|
10
|
-
navBarPosition: 'top' | 'bottom';
|
|
11
|
-
group?: string;
|
|
12
|
-
iconName?: string;
|
|
13
|
-
iconSvg?: string;
|
|
14
|
-
};
|
|
15
|
-
component?: {
|
|
16
|
-
page: string;
|
|
17
|
-
position: 'top' | 'left' | 'right' | 'bottom';
|
|
18
|
-
};
|
|
19
|
-
modal?: {
|
|
20
|
-
name: string;
|
|
21
|
-
params: string[] | Record<string, string>;
|
|
22
|
-
size: 'sm' | 'md' | 'lg' | 'full';
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
1
|
export { start, configure, registerToHook } from './app';
|
|
26
2
|
export { onRefreshToken, onManifest, onStoreUser, onNewTenant, onCallback } from './handlers';
|
|
27
3
|
export { addEndpoint, addProxyEndpoint } from './endpoints';
|
|
28
4
|
export { getSdkForTenant, getSdk, getSdkForUrl } from './sdk';
|
|
29
|
-
export
|
|
30
|
-
export
|
|
5
|
+
export { addGroupedMicroFrontends, addMicroFrontend, MicroFrontend } from './micro-frontends';
|
|
6
|
+
export { addInjectable, Injectable } from './injectables';
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
import manifest from './manifest';
|
|
2
1
|
export { start, configure, registerToHook } from './app';
|
|
3
2
|
export { onRefreshToken, onManifest, onStoreUser, onNewTenant, onCallback } from './handlers';
|
|
4
3
|
export { addEndpoint, addProxyEndpoint } from './endpoints';
|
|
5
4
|
export { getSdkForTenant, getSdk, getSdkForUrl } from './sdk';
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
export function addGroupedMicroFrontends(group, mfeArray) {
|
|
10
|
-
manifest.navBarGroups.push(group);
|
|
11
|
-
mfeArray.forEach(mfe => {
|
|
12
|
-
addMicroFrontend({ ...mfe, route: { ...mfe.route, group: group.key } });
|
|
13
|
-
});
|
|
14
|
-
}
|
|
5
|
+
export { addGroupedMicroFrontends, addMicroFrontend } from './micro-frontends';
|
|
6
|
+
export { addInjectable } from './injectables';
|
|
15
7
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAE,SAAS,EAAE,cAAc,EAAC,MAAM,OAAO,CAAC;AACvD,OAAO,EAAC,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAC,MAAM,YAAY,CAAC;AAC5F,OAAO,EAAC,WAAW,EAAE,gBAAgB,EAAC,MAAM,aAAa,CAAA;AACzD,OAAO,EAAC,eAAe,EAAE,MAAM,EAAE,YAAY,EAAC,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAC,wBAAwB,EAAE,gBAAgB,EAAgB,MAAM,mBAAmB,CAAC;AAC5F,OAAO,EAAC,aAAa,EAAa,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"injectables.js","sourceRoot":"","sources":["../src/injectables.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAQlC,MAAM,UAAU,aAAa,CAAC,UAAsB;IAClD,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;AACxC,CAAC"}
|
package/dist/manifest.d.ts
CHANGED
package/dist/manifest.js
CHANGED
package/dist/manifest.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,eAAe,CAAC,CAAC;AAErD,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,IAAI,EAAE,GAAG,CAAC,IAAI;IACd,WAAW,EAAE,GAAG,CAAC,WAAW;IAC5B,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,EAAE;IACjC,OAAO,EAAE,GAAG,CAAC,IAAI;IACjB,WAAW,EAAE,oBAAoB;IACjC,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,eAAe;IAC5B,YAAY,EAAE,gBAAgB;IAC9B,cAAc,EAAE,mBAAmB;IACnC,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE,EAAE;IACZ,gBAAgB,EAAE,EAAE;IACpB,YAAY,EAAE,EAAE;IAChB,cAAc,EAAE,EAAE;IAClB,WAAW,EAAE;QACX,eAAe,EAAE,oBAAoB;QACrC,eAAe,EAAE,eAAe;QAChC,cAAc,EAAE,cAAc;KAC/B;CACF,CAAC;AAQF,eAAe,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,eAAe,CAAC,CAAC;AAErD,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,IAAI,EAAE,GAAG,CAAC,IAAI;IACd,WAAW,EAAE,GAAG,CAAC,WAAW;IAC5B,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,EAAE;IACjC,OAAO,EAAE,GAAG,CAAC,IAAI;IACjB,WAAW,EAAE,oBAAoB;IACjC,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,eAAe;IAC5B,YAAY,EAAE,gBAAgB;IAC9B,cAAc,EAAE,mBAAmB;IACnC,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE,EAAE;IACZ,gBAAgB,EAAE,EAAE;IACpB,YAAY,EAAE,EAAE;IAChB,cAAc,EAAE,EAAE;IAClB,WAAW,EAAE,EAAE;IACf,WAAW,EAAE;QACX,eAAe,EAAE,oBAAoB;QACrC,eAAe,EAAE,eAAe;QAChC,cAAc,EAAE,cAAc;KAC/B;CACF,CAAC;AAQF,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { NavBarGroup } from './manifest';
|
|
2
|
+
export interface MicroFrontend {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
url: string;
|
|
6
|
+
roles?: string[];
|
|
7
|
+
route?: {
|
|
8
|
+
name: string;
|
|
9
|
+
path: string;
|
|
10
|
+
navBarPosition: 'top' | 'bottom';
|
|
11
|
+
group?: string;
|
|
12
|
+
iconName?: string;
|
|
13
|
+
iconSvg?: string;
|
|
14
|
+
};
|
|
15
|
+
component?: {
|
|
16
|
+
page: string;
|
|
17
|
+
position: 'top' | 'left' | 'right' | 'bottom';
|
|
18
|
+
};
|
|
19
|
+
modal?: {
|
|
20
|
+
name: string;
|
|
21
|
+
params: string[] | Record<string, string>;
|
|
22
|
+
size: 'sm' | 'md' | 'lg' | 'full';
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export declare function addMicroFrontend(mfe: MicroFrontend): void;
|
|
26
|
+
export declare function addGroupedMicroFrontends(group: NavBarGroup, mfeArray: MicroFrontend[]): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import manifest from './manifest';
|
|
2
|
+
export function addMicroFrontend(mfe) {
|
|
3
|
+
manifest.microFrontends.push(mfe);
|
|
4
|
+
}
|
|
5
|
+
export function addGroupedMicroFrontends(group, mfeArray) {
|
|
6
|
+
manifest.navBarGroups.push(group);
|
|
7
|
+
mfeArray.forEach(mfe => {
|
|
8
|
+
addMicroFrontend({ ...mfe, route: { ...mfe.route, group: group.key } });
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=micro-frontends.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"micro-frontends.js","sourceRoot":"","sources":["../src/micro-frontends.ts"],"names":[],"mappings":"AAAA,OAAO,QAAuB,MAAM,YAAY,CAAC;AA0BjD,MAAM,UAAU,gBAAgB,CAAC,GAAkB;IACjD,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,KAAkB,EAAE,QAAyB;IACpF,QAAQ,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QACrB,gBAAgB,CAAC,EAAC,GAAG,GAAG,EAAE,KAAK,EAAE,EAAC,GAAG,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,EAAC,EAAC,CAAC,CAAA;IACrE,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qelos/plugin-play",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "Play a plugin for Qelos!",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@fastify/cookie": "^8.3.0",
|
|
20
20
|
"@fastify/static": "^6.5.0",
|
|
21
|
-
"@qelos/sdk": "^
|
|
22
|
-
"@qelos/web-sdk": "^
|
|
21
|
+
"@qelos/sdk": "^3.0.1",
|
|
22
|
+
"@qelos/web-sdk": "^3.0.1",
|
|
23
23
|
"fastify": "^4.3.0",
|
|
24
24
|
"jsonwebtoken": "^8.5.1",
|
|
25
25
|
"undici": "^5.8.0"
|
package/src/endpoints.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,41 +1,6 @@
|
|
|
1
|
-
import manifest, {NavBarGroup} from './manifest';
|
|
2
|
-
|
|
3
|
-
export interface MicroFrontend {
|
|
4
|
-
name: string;
|
|
5
|
-
description: string;
|
|
6
|
-
url: string;
|
|
7
|
-
roles?: string[],
|
|
8
|
-
route?: {
|
|
9
|
-
name: string;
|
|
10
|
-
path: string;
|
|
11
|
-
navBarPosition: 'top' | 'bottom';
|
|
12
|
-
group?: string;
|
|
13
|
-
iconName?: string;
|
|
14
|
-
iconSvg?: string;
|
|
15
|
-
};
|
|
16
|
-
component?: {
|
|
17
|
-
page: string;
|
|
18
|
-
position: 'top' | 'left' | 'right' | 'bottom';
|
|
19
|
-
},
|
|
20
|
-
modal?: {
|
|
21
|
-
name: string;
|
|
22
|
-
params: string[] | Record<string, string>; // schema / hints for props
|
|
23
|
-
size: 'sm' | 'md' | 'lg' | 'full'
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
1
|
export {start, configure, registerToHook} from './app';
|
|
28
2
|
export {onRefreshToken, onManifest, onStoreUser, onNewTenant, onCallback} from './handlers';
|
|
29
3
|
export {addEndpoint, addProxyEndpoint} from './endpoints'
|
|
30
4
|
export {getSdkForTenant, getSdk, getSdkForUrl} from './sdk';
|
|
31
|
-
|
|
32
|
-
export
|
|
33
|
-
manifest.microFrontends.push(mfe);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export function addGroupedMicroFrontends(group: NavBarGroup, mfeArray: MicroFrontend[]) {
|
|
37
|
-
manifest.navBarGroups.push(group);
|
|
38
|
-
mfeArray.forEach(mfe => {
|
|
39
|
-
addMicroFrontend({...mfe, route: {...mfe.route, group: group.key}})
|
|
40
|
-
})
|
|
41
|
-
}
|
|
5
|
+
export {addGroupedMicroFrontends, addMicroFrontend, MicroFrontend} from './micro-frontends';
|
|
6
|
+
export {addInjectable, Injectable} from './injectables';
|
package/src/manifest.ts
CHANGED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import manifest, {NavBarGroup} from './manifest';
|
|
2
|
+
import {addProxyEndpoint, QelosRouteParams} from './endpoints';
|
|
3
|
+
|
|
4
|
+
export interface IframeMicroFrontend extends GlobalMicroFrontend {
|
|
5
|
+
url: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface PreDesignedMicroFrontendOptions
|
|
9
|
+
extends Pick<QelosRouteParams, 'verifyToken'>,
|
|
10
|
+
Partial<Pick<QelosRouteParams, 'handler'>>,
|
|
11
|
+
GlobalMicroFrontend {
|
|
12
|
+
use: string;
|
|
13
|
+
fetchUrl?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface PreDesignedMicroFrontend extends Omit<PreDesignedMicroFrontendOptions, 'handler' | 'verifyToken'> {
|
|
17
|
+
fetchUrl: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface GlobalMicroFrontend {
|
|
21
|
+
name: string;
|
|
22
|
+
description: string;
|
|
23
|
+
roles?: string[],
|
|
24
|
+
route?: {
|
|
25
|
+
name: string;
|
|
26
|
+
path: string;
|
|
27
|
+
navBarPosition: 'top' | 'bottom';
|
|
28
|
+
group?: string;
|
|
29
|
+
iconName?: string;
|
|
30
|
+
iconSvg?: string;
|
|
31
|
+
};
|
|
32
|
+
component?: {
|
|
33
|
+
page: string;
|
|
34
|
+
position: 'top' | 'left' | 'right' | 'bottom';
|
|
35
|
+
},
|
|
36
|
+
modal?: {
|
|
37
|
+
name: string;
|
|
38
|
+
params: string[] | Record<string, string>; // schema / hints for props
|
|
39
|
+
size: 'sm' | 'md' | 'lg' | 'full'
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type MicroFrontendOptions = IframeMicroFrontend | PreDesignedMicroFrontendOptions
|
|
44
|
+
export type MicroFrontend = IframeMicroFrontend | PreDesignedMicroFrontend
|
|
45
|
+
|
|
46
|
+
export function addMicroFrontend(mfe: MicroFrontendOptions) {
|
|
47
|
+
mfe = {...mfe}
|
|
48
|
+
let manifestMfe: MicroFrontend;
|
|
49
|
+
if ('use' in mfe) {
|
|
50
|
+
const verifyToken = mfe.verifyToken || true;
|
|
51
|
+
delete mfe.verifyToken;
|
|
52
|
+
|
|
53
|
+
if ('handler' in mfe) {
|
|
54
|
+
const fetchUrl = mfe.fetchUrl || btoa(mfe.name);
|
|
55
|
+
const handler = mfe.handler;
|
|
56
|
+
delete mfe.handler;
|
|
57
|
+
addProxyEndpoint(fetchUrl, {
|
|
58
|
+
handler,
|
|
59
|
+
verifyToken,
|
|
60
|
+
});
|
|
61
|
+
manifestMfe = {
|
|
62
|
+
...mfe as PreDesignedMicroFrontend,
|
|
63
|
+
fetchUrl
|
|
64
|
+
}
|
|
65
|
+
} else if ('fetchUrl' in mfe) {
|
|
66
|
+
manifestMfe = mfe as PreDesignedMicroFrontend;
|
|
67
|
+
}
|
|
68
|
+
} else {
|
|
69
|
+
manifestMfe = mfe;
|
|
70
|
+
}
|
|
71
|
+
manifest.microFrontends.push(manifestMfe);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function addGroupedMicroFrontends(group: NavBarGroup, mfeArray: MicroFrontendOptions[]) {
|
|
75
|
+
manifest.navBarGroups.push(group);
|
|
76
|
+
mfeArray.forEach(mfe => {
|
|
77
|
+
addMicroFrontend({...mfe, route: {...mfe.route, group: group.key}})
|
|
78
|
+
})
|
|
79
|
+
}
|