@equinor/fusion-framework-cli 10.0.0-beta-8c92234668d5f4b20de0650ff947f3afeb7c335c → 10.0.0-next-9f6eec8c5a4cb3dd430fc6bee227442a3dc28bb8
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/CHANGELOG.md +399 -6
- package/README.md +31 -9
- package/dist/bin/build-application.js +22 -1
- package/dist/bin/build-application.js.map +1 -1
- package/dist/bin/bundle-application.js +8 -11
- package/dist/bin/bundle-application.js.map +1 -1
- package/dist/bin/create-dev-serve.js +89 -117
- package/dist/bin/create-dev-serve.js.map +1 -1
- package/dist/bin/create-export-config.js +54 -12
- package/dist/bin/create-export-config.js.map +1 -1
- package/dist/bin/create-export-manifest.js +44 -36
- package/dist/bin/create-export-manifest.js.map +1 -1
- package/dist/bin/dev-portal/AppLoader.js +23 -0
- package/dist/bin/dev-portal/AppLoader.js.map +1 -1
- package/dist/bin/dev-portal/ContextSelector/ContextSelector.js +17 -2
- package/dist/bin/dev-portal/ContextSelector/ContextSelector.js.map +1 -1
- package/dist/bin/dev-portal/ContextSelector/useContextResolver.js +35 -1
- package/dist/bin/dev-portal/ContextSelector/useContextResolver.js.map +1 -1
- package/dist/bin/dev-portal/Header.js +1 -0
- package/dist/bin/dev-portal/Header.js.map +1 -1
- package/dist/bin/dev-portal/PersonSideSheet/index.js +4 -0
- package/dist/bin/dev-portal/PersonSideSheet/index.js.map +1 -1
- package/dist/bin/dev-portal/PersonSideSheet/sheets/FeatureSheetContent.js +4 -0
- package/dist/bin/dev-portal/PersonSideSheet/sheets/FeatureSheetContent.js.map +1 -1
- package/dist/bin/dev-portal/PersonSideSheet/sheets/FeatureTogglerApp.js +3 -0
- package/dist/bin/dev-portal/PersonSideSheet/sheets/FeatureTogglerApp.js.map +1 -1
- package/dist/bin/dev-portal/PersonSideSheet/sheets/FeatureTogglerPortal.js +3 -0
- package/dist/bin/dev-portal/PersonSideSheet/sheets/FeatureTogglerPortal.js.map +1 -1
- package/dist/bin/dev-portal/PersonSideSheet/sheets/LandingSheetContent.js +3 -0
- package/dist/bin/dev-portal/PersonSideSheet/sheets/LandingSheetContent.js.map +1 -1
- package/dist/bin/dev-portal/Router.js +3 -0
- package/dist/bin/dev-portal/Router.js.map +1 -1
- package/dist/bin/dev-portal/config.js +7 -2
- package/dist/bin/dev-portal/config.js.map +1 -1
- package/dist/bin/dev-portal/useAppContextNavigation.js +27 -6
- package/dist/bin/dev-portal/useAppContextNavigation.js.map +1 -1
- package/dist/bin/main.app.js +32 -19
- package/dist/bin/main.app.js.map +1 -1
- package/dist/bin/main.js +3 -0
- package/dist/bin/main.js.map +1 -1
- package/dist/bin/public/assets/index-CwGBhRCD.js +5235 -0
- package/dist/bin/public/index.html +1 -1
- package/dist/bin/publish-application.js +75 -20
- package/dist/bin/publish-application.js.map +1 -1
- package/dist/bin/tag-application.js +52 -16
- package/dist/bin/tag-application.js.map +1 -1
- package/dist/bin/upload-application.js +47 -14
- package/dist/bin/upload-application.js.map +1 -1
- package/dist/bin/utils/{execute-commant.js → execute-command.js} +5 -2
- package/dist/bin/utils/execute-command.js.map +1 -0
- package/dist/bin/utils/format.js +1 -1
- package/dist/bin/utils/format.js.map +1 -1
- package/dist/bin/utils/getEndpointUrl.js +49 -0
- package/dist/bin/utils/getEndpointUrl.js.map +1 -0
- package/dist/bin/utils/index.js +14 -0
- package/dist/bin/utils/index.js.map +1 -0
- package/dist/bin/utils/isAppRegistered.js +32 -0
- package/dist/bin/utils/isAppRegistered.js.map +1 -0
- package/dist/bin/utils/load-app-config.js +1 -0
- package/dist/bin/utils/load-app-config.js.map +1 -1
- package/dist/bin/utils/load-manifest.js +9 -4
- package/dist/bin/utils/load-manifest.js.map +1 -1
- package/dist/bin/utils/proxy-request-logger.js +34 -0
- package/dist/bin/utils/proxy-request-logger.js.map +1 -0
- package/dist/bin/utils/publishAppConfig.js +36 -0
- package/dist/bin/utils/publishAppConfig.js.map +1 -0
- package/dist/bin/utils/requireToken.js +10 -0
- package/dist/bin/utils/requireToken.js.map +1 -0
- package/dist/bin/utils/spinner.js +10 -0
- package/dist/bin/utils/spinner.js.map +1 -1
- package/dist/bin/utils/tagAppBundle.js +35 -0
- package/dist/bin/utils/tagAppBundle.js.map +1 -0
- package/dist/bin/utils/uploadAppBundle.js +54 -0
- package/dist/bin/utils/uploadAppBundle.js.map +1 -0
- package/dist/lib/app-config.js +3 -1
- package/dist/lib/app-config.js.map +1 -1
- package/dist/lib/app-manifest.js +97 -15
- package/dist/lib/app-manifest.js.map +1 -1
- package/dist/lib/app-package.js +52 -5
- package/dist/lib/app-package.js.map +1 -1
- package/dist/lib/plugins/app-assets/app-asset-plugin.js +102 -0
- package/dist/lib/plugins/app-assets/app-asset-plugin.js.map +1 -0
- package/dist/lib/plugins/app-assets/emit-asset.js +41 -0
- package/dist/lib/plugins/app-assets/emit-asset.js.map +1 -0
- package/dist/lib/plugins/app-assets/extension-filter-pattern.js +20 -0
- package/dist/lib/plugins/app-assets/extension-filter-pattern.js.map +1 -0
- package/dist/lib/plugins/app-assets/index.js +4 -0
- package/dist/lib/plugins/app-assets/index.js.map +1 -0
- package/dist/lib/plugins/app-assets/read-asset-content.js +34 -0
- package/dist/lib/plugins/app-assets/read-asset-content.js.map +1 -0
- package/dist/lib/plugins/app-assets/resolve-asset-id.js +63 -0
- package/dist/lib/plugins/app-assets/resolve-asset-id.js.map +1 -0
- package/dist/lib/plugins/app-assets/static.js +15 -0
- package/dist/lib/plugins/app-assets/static.js.map +1 -0
- package/dist/lib/plugins/app-proxy/app-proxy-plugin.js +127 -0
- package/dist/lib/plugins/app-proxy/app-proxy-plugin.js.map +1 -0
- package/dist/lib/plugins/app-proxy/index.js +2 -0
- package/dist/lib/plugins/app-proxy/index.js.map +1 -0
- package/dist/lib/plugins/external-public/external-public-plugin.js +103 -0
- package/dist/lib/plugins/external-public/external-public-plugin.js.map +1 -0
- package/dist/lib/plugins/external-public/index.js +2 -0
- package/dist/lib/plugins/external-public/index.js.map +1 -0
- package/dist/lib/utils/assert.js +2 -1
- package/dist/lib/utils/assert.js.map +1 -1
- package/dist/lib/utils/config.js +5 -0
- package/dist/lib/utils/config.js.map +1 -1
- package/dist/lib/vite-config.js +4 -4
- package/dist/lib/vite-config.js.map +1 -1
- package/dist/lib/vite-logger.js +2 -0
- package/dist/lib/vite-logger.js.map +1 -1
- package/dist/types/bin/build-application.d.ts +4 -3
- package/dist/types/bin/create-dev-serve.d.ts +1 -1
- package/dist/types/bin/create-export-config.d.ts +3 -3
- package/dist/types/bin/create-export-manifest.d.ts +6 -9
- package/dist/types/bin/dev-portal/AppLoader.d.ts +7 -0
- package/dist/types/bin/dev-portal/ContextSelector/ContextSelector.d.ts +5 -0
- package/dist/types/bin/dev-portal/ContextSelector/useContextResolver.d.ts +6 -0
- package/dist/types/bin/dev-portal/FusionLogo.d.ts +0 -1
- package/dist/types/bin/dev-portal/PersonSideSheet/index.d.ts +4 -0
- package/dist/types/bin/dev-portal/PersonSideSheet/sheets/FeatureSheetContent.d.ts +4 -0
- package/dist/types/bin/dev-portal/PersonSideSheet/sheets/FeatureTogglerApp.d.ts +3 -0
- package/dist/types/bin/dev-portal/PersonSideSheet/sheets/FeatureTogglerPortal.d.ts +3 -0
- package/dist/types/bin/dev-portal/PersonSideSheet/sheets/LandingSheetContent.d.ts +3 -0
- package/dist/types/bin/dev-portal/PersonSideSheet/sheets/Styled.d.ts +4 -5
- package/dist/types/bin/dev-portal/useAppContextNavigation.d.ts +4 -0
- package/dist/types/bin/publish-application.d.ts +1 -1
- package/dist/types/bin/tag-application.d.ts +1 -1
- package/dist/types/bin/upload-application.d.ts +1 -1
- package/dist/types/bin/utils/execute-command.d.ts +8 -0
- package/dist/types/bin/utils/format.d.ts +0 -2
- package/dist/types/bin/utils/getEndpointUrl.d.ts +10 -0
- package/dist/types/bin/utils/index.d.ts +14 -0
- package/dist/types/bin/utils/isAppRegistered.d.ts +7 -0
- package/dist/types/bin/utils/load-app-config.d.ts +1 -1
- package/dist/types/bin/utils/load-manifest.d.ts +3 -2
- package/dist/types/bin/utils/proxy-request-logger.d.ts +15 -0
- package/dist/types/bin/utils/publishAppConfig.d.ts +9 -0
- package/dist/types/bin/utils/requireToken.d.ts +4 -0
- package/dist/types/bin/utils/spinner.d.ts +1 -0
- package/dist/types/bin/utils/tagAppBundle.d.ts +7 -0
- package/dist/types/bin/utils/uploadAppBundle.d.ts +7 -0
- package/dist/types/lib/app-config.d.ts +1 -1
- package/dist/types/lib/app-manifest.d.ts +30 -2
- package/dist/types/lib/app-package.d.ts +34 -3
- package/dist/types/lib/plugins/app-assets/app-asset-plugin.d.ts +36 -0
- package/dist/types/lib/plugins/app-assets/emit-asset.d.ts +18 -0
- package/dist/types/lib/plugins/app-assets/extension-filter-pattern.d.ts +14 -0
- package/dist/types/lib/plugins/app-assets/index.d.ts +3 -0
- package/dist/types/lib/plugins/app-assets/read-asset-content.d.ts +14 -0
- package/dist/types/lib/plugins/app-assets/resolve-asset-id.d.ts +16 -0
- package/dist/types/lib/plugins/app-assets/static.d.ts +5 -0
- package/dist/types/lib/plugins/app-proxy/app-proxy-plugin.d.ts +70 -0
- package/dist/types/lib/plugins/app-proxy/index.d.ts +1 -0
- package/dist/types/lib/plugins/external-public/external-public-plugin.d.ts +30 -0
- package/dist/types/lib/plugins/external-public/index.d.ts +1 -0
- package/dist/types/lib/utils/assert.d.ts +2 -2
- package/dist/types/lib/utils/config.d.ts +7 -1
- package/dist/types/lib/utils/expect.d.ts +1 -1
- package/dist/types/lib/vite-config.d.ts +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/version.js +2 -1
- package/dist/version.js.map +1 -1
- package/package.json +49 -35
- package/dist/bin/dev-proxy.js +0 -89
- package/dist/bin/dev-proxy.js.map +0 -1
- package/dist/bin/public/assets/index-DGTu1kLV.js +0 -3482
- package/dist/bin/utils/app-api.js +0 -169
- package/dist/bin/utils/app-api.js.map +0 -1
- package/dist/bin/utils/execute-commant.js.map +0 -1
- package/dist/index.js +0 -12
- package/dist/index.js.map +0 -1
- package/dist/types/bin/dev-proxy.d.ts +0 -26
- package/dist/types/bin/utils/app-api.d.ts +0 -8
- package/dist/types/bin/utils/execute-commant.d.ts +0 -8
- package/dist/types/index.d.ts +0 -4
|
@@ -8,7 +8,7 @@ export declare const resolveViteConfig: (options?: FindConfigOptions & {
|
|
|
8
8
|
export declare const createAppViteConfig: (env: ConfigExecuterEnv, options?: FindConfigOptions & {
|
|
9
9
|
file?: string;
|
|
10
10
|
}) => Promise<{
|
|
11
|
-
config
|
|
11
|
+
config?: UserConfig;
|
|
12
12
|
path?: string;
|
|
13
13
|
} | void>;
|
|
14
14
|
export declare const resolveEntryPoint: (cwd?: string, dir?: string, opt?: {
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "9.
|
|
1
|
+
export declare const version = "9.13.1";
|
package/dist/version.js
CHANGED
package/dist/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/fusion-framework-cli",
|
|
3
|
-
"version": "10.0.0-
|
|
3
|
+
"version": "10.0.0-next-9f6eec8c5a4cb3dd430fc6bee227442a3dc28bb8",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"Fusion",
|
|
6
6
|
"Fusion Framework",
|
|
@@ -21,74 +21,88 @@
|
|
|
21
21
|
".": {
|
|
22
22
|
"types": "./dist/types/lib/index.d.ts",
|
|
23
23
|
"import": "./dist/lib/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./plugin-app-assets": {
|
|
26
|
+
"types": "./dist/types/bin/plugins/app-assets/index.d.ts",
|
|
27
|
+
"import": "./dist/lib/plugins/app-assets/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./plugin-app-proxy": {
|
|
30
|
+
"types": "./dist/types/lib/plugins/app-proxy/index.d.ts",
|
|
31
|
+
"import": "./dist/lib/plugins/app-proxy/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./plugin-external-public": {
|
|
34
|
+
"types": "./dist/types/lib/plugins/external-public/index.d.ts",
|
|
35
|
+
"import": "./dist/lib/plugins/external-public/index.js"
|
|
24
36
|
}
|
|
25
37
|
},
|
|
26
38
|
"dependencies": {
|
|
27
|
-
"@equinor/eds-core-react": "^0.38.0",
|
|
28
|
-
"@equinor/eds-icons": "^0.21.0",
|
|
29
|
-
"@equinor/eds-tokens": "^0.9.2",
|
|
30
|
-
"@equinor/fusion-wc-chip": "^1.2.1",
|
|
31
|
-
"@equinor/fusion-wc-person": "^2.6.7",
|
|
32
|
-
"@types/adm-zip": "^0.5.0",
|
|
33
|
-
"@types/semver": "^7.5.0",
|
|
34
39
|
"@vitejs/plugin-react": "^4.0.4",
|
|
35
40
|
"adm-zip": "^0.5.10",
|
|
36
41
|
"chalk": "^5.3.0",
|
|
37
42
|
"commander": "^12.0.0",
|
|
38
43
|
"deepmerge": "^4.3.1",
|
|
39
|
-
"express": "^4.18.2",
|
|
40
|
-
"express-rate-limit": "^7.0.0",
|
|
41
44
|
"find-up": "^7.0.0",
|
|
42
|
-
"http-proxy-middleware": "^2.0.6",
|
|
43
45
|
"is-mergeable-object": "^1.1.1",
|
|
46
|
+
"loader-utils": "^3.3.1",
|
|
47
|
+
"mime": "^4.0.4",
|
|
48
|
+
"node-fetch": "^3.3.2",
|
|
44
49
|
"ora": "^8.0.1",
|
|
45
50
|
"portfinder": "^1.0.32",
|
|
46
51
|
"pretty-bytes": "^6.1.1",
|
|
47
52
|
"read-package-up": "^11.0.0",
|
|
48
53
|
"semver": "^7.5.4",
|
|
49
|
-
"vite": "^5.
|
|
54
|
+
"vite": "^5.4.3",
|
|
50
55
|
"vite-plugin-environment": "^1.1.3",
|
|
51
56
|
"vite-plugin-restart": "^0.4.0",
|
|
52
|
-
"vite-tsconfig-paths": "^4.2.0"
|
|
53
|
-
"@equinor/fusion-framework-app": "^9.1.1",
|
|
54
|
-
"@equinor/fusion-observable": "^8.3.1",
|
|
55
|
-
"@equinor/fusion-framework-module-feature-flag": "^1.1.3",
|
|
56
|
-
"@equinor/fusion-framework-react-components-people-provider": "^1.4.0"
|
|
57
|
+
"vite-tsconfig-paths": "^4.2.0"
|
|
57
58
|
},
|
|
58
59
|
"devDependencies": {
|
|
59
|
-
"@equinor/
|
|
60
|
+
"@equinor/eds-core-react": "^0.41.2",
|
|
61
|
+
"@equinor/eds-icons": "^0.21.0",
|
|
62
|
+
"@equinor/eds-tokens": "^0.9.2",
|
|
63
|
+
"@equinor/eslint-config-fusion-react": "^2.0.1",
|
|
64
|
+
"@equinor/fusion-react-context-selector": "^0.6.6",
|
|
60
65
|
"@equinor/fusion-react-progress-indicator": "^0.3.0",
|
|
61
|
-
"@equinor/fusion-react-side-sheet": "1.3.
|
|
66
|
+
"@equinor/fusion-react-side-sheet": "1.3.3",
|
|
62
67
|
"@equinor/fusion-react-styles": "^0.6.0",
|
|
68
|
+
"@equinor/fusion-wc-chip": "^1.2.1",
|
|
69
|
+
"@equinor/fusion-wc-person": "^3.0.1",
|
|
63
70
|
"@material-ui/styles": "^4.11.5",
|
|
64
|
-
"@types/
|
|
71
|
+
"@types/adm-zip": "^0.5.0",
|
|
72
|
+
"@types/loader-utils": "^2.0.6",
|
|
65
73
|
"@types/node": "^20.11.14",
|
|
66
74
|
"@types/react": "^18.2.50",
|
|
67
75
|
"@types/react-dom": "^18.2.7",
|
|
76
|
+
"@types/rollup": "^0.54.0",
|
|
77
|
+
"@types/semver": "^7.5.0",
|
|
78
|
+
"eslint-plugin-rxjs": "^5.0.3",
|
|
68
79
|
"react": "^18.2.0",
|
|
69
80
|
"react-dom": "^18.2.0",
|
|
70
81
|
"react-router-dom": "^6.15.0",
|
|
71
|
-
"rollup": "^4.
|
|
82
|
+
"rollup": "^4.22.4",
|
|
72
83
|
"rxjs": "^7.8.1",
|
|
73
84
|
"styled-components": "^6.0.7",
|
|
74
|
-
"typescript": "^5.4
|
|
75
|
-
"@equinor/fusion-framework": "^7.2.
|
|
76
|
-
"@equinor/fusion-framework-
|
|
77
|
-
"@equinor/fusion-framework-
|
|
78
|
-
"@equinor/fusion-framework-module-
|
|
79
|
-
"@equinor/fusion-framework-module-
|
|
80
|
-
"@equinor/fusion-framework-module-
|
|
81
|
-
"@equinor/fusion-framework-module-msal": "^3.1.
|
|
82
|
-
"@equinor/fusion-framework-module-navigation": "^4.0.
|
|
83
|
-
"@equinor/fusion-framework-module-services": "^4.1.
|
|
84
|
-
"@equinor/fusion-framework-react": "^7.
|
|
85
|
-
"@equinor/fusion-framework-react-components-bookmark": "^0.
|
|
86
|
-
"@equinor/fusion-framework-react-module-bookmark": "^2.1.
|
|
87
|
-
"@equinor/fusion-
|
|
85
|
+
"typescript": "^5.5.4",
|
|
86
|
+
"@equinor/fusion-framework": "^7.2.8",
|
|
87
|
+
"@equinor/fusion-framework-module-bookmark": "^1.2.12",
|
|
88
|
+
"@equinor/fusion-framework-app": "^9.1.10-next-9f6eec8c5a4cb3dd430fc6bee227442a3dc28bb8",
|
|
89
|
+
"@equinor/fusion-framework-module-context": "^5.0.12",
|
|
90
|
+
"@equinor/fusion-framework-module-app": "^6.0.0-next-9f6eec8c5a4cb3dd430fc6bee227442a3dc28bb8",
|
|
91
|
+
"@equinor/fusion-framework-module-feature-flag": "^1.1.9",
|
|
92
|
+
"@equinor/fusion-framework-module-msal": "^3.1.5",
|
|
93
|
+
"@equinor/fusion-framework-module-navigation": "^4.0.7",
|
|
94
|
+
"@equinor/fusion-framework-module-services": "^4.1.5",
|
|
95
|
+
"@equinor/fusion-framework-react": "^7.3.0-next-9f6eec8c5a4cb3dd430fc6bee227442a3dc28bb8",
|
|
96
|
+
"@equinor/fusion-framework-react-components-bookmark": "^0.5.2-next-9f6eec8c5a4cb3dd430fc6bee227442a3dc28bb8",
|
|
97
|
+
"@equinor/fusion-framework-react-module-bookmark": "^2.1.18-next-9f6eec8c5a4cb3dd430fc6bee227442a3dc28bb8",
|
|
98
|
+
"@equinor/fusion-framework-react-components-people-provider": "^1.4.9-next-9f6eec8c5a4cb3dd430fc6bee227442a3dc28bb8",
|
|
99
|
+
"@equinor/fusion-observable": "^8.4.1",
|
|
100
|
+
"@equinor/fusion-query": "^5.1.3"
|
|
88
101
|
},
|
|
89
102
|
"scripts": {
|
|
90
103
|
"prebuild": "pnpm build:source",
|
|
91
104
|
"build": "pnpm build:source && pnpm build:dev-server",
|
|
105
|
+
"build:clean": "rm -rf dist && rm -f tsconfig.tsbuildinfo && pnpm build",
|
|
92
106
|
"build:source": "tsc -b",
|
|
93
107
|
"build:dev-server": "vite build"
|
|
94
108
|
}
|
package/dist/bin/dev-proxy.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import express from 'express';
|
|
11
|
-
import { createProxyMiddleware, responseInterceptor, } from 'http-proxy-middleware';
|
|
12
|
-
import { Spinner } from './utils/spinner.js';
|
|
13
|
-
import chalk, { formatPath } from './utils/format.js';
|
|
14
|
-
const appsProxyName = 'apps-proxy';
|
|
15
|
-
const appsProxyURI = 'https://fusion-s-apps-ci.azurewebsites.net/';
|
|
16
|
-
const createResponseInterceptor = (cb) => {
|
|
17
|
-
return responseInterceptor((responseBuffer, proxyRes, req, res) => __awaiter(void 0, void 0, void 0, function* () {
|
|
18
|
-
var _a, _b, _c;
|
|
19
|
-
res.setHeader('x-proxy-status-message', (_a = proxyRes.statusMessage) !== null && _a !== void 0 ? _a : '');
|
|
20
|
-
res.setHeader('x-proxy-status-code', (_b = proxyRes.statusCode) !== null && _b !== void 0 ? _b : '');
|
|
21
|
-
const { response, statusCode, path } = (_c = (yield Promise.resolve(cb(req.params, proxyRes, Number(proxyRes.statusCode) < 400 &&
|
|
22
|
-
JSON.parse(responseBuffer.toString('utf8')))))) !== null && _c !== void 0 ? _c : {};
|
|
23
|
-
if (statusCode) {
|
|
24
|
-
res.statusCode = statusCode;
|
|
25
|
-
}
|
|
26
|
-
if (response) {
|
|
27
|
-
path && res.setHeader('x-interceptor-handler', path);
|
|
28
|
-
return JSON.stringify(response);
|
|
29
|
-
}
|
|
30
|
-
return responseBuffer;
|
|
31
|
-
}));
|
|
32
|
-
};
|
|
33
|
-
export const createDevProxy = (handler, options) => {
|
|
34
|
-
var _a;
|
|
35
|
-
const proxyOptions = Object.assign({
|
|
36
|
-
changeOrigin: true,
|
|
37
|
-
selfHandleResponse: true,
|
|
38
|
-
onProxyReq: (proxyReq) => {
|
|
39
|
-
proxyReq.appendHeader('api-version', '1.0-preview');
|
|
40
|
-
const spinner = Spinner.Clone();
|
|
41
|
-
spinner.ora.suffixText = formatPath([proxyReq.protocol, '//', proxyReq.host, proxyReq.path].join(''));
|
|
42
|
-
spinner.start('proxy request');
|
|
43
|
-
proxyReq.on('response', (res) => {
|
|
44
|
-
var _a;
|
|
45
|
-
if (Number(res.statusCode) < 400) {
|
|
46
|
-
spinner.succeed();
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
spinner.warn(chalk.yellow((_a = res.statusMessage) !== null && _a !== void 0 ? _a : `${res.statusCode} `));
|
|
50
|
-
}
|
|
51
|
-
spinner.stop();
|
|
52
|
-
});
|
|
53
|
-
proxyReq.on('error', () => {
|
|
54
|
-
spinner.fail();
|
|
55
|
-
});
|
|
56
|
-
},
|
|
57
|
-
}, { staticAssets: options.staticAssets });
|
|
58
|
-
const app = express();
|
|
59
|
-
app.disable('x-powered-by');
|
|
60
|
-
(_a = options.staticAssets) === null || _a === void 0 ? void 0 : _a.forEach((asset) => {
|
|
61
|
-
app.use(express.static(asset.path, asset.options));
|
|
62
|
-
});
|
|
63
|
-
app.use('/_discovery/environments/current', createProxyMiddleware(Object.assign(Object.assign({ target: options.target }, proxyOptions), { onProxyRes: responseInterceptor((responseBuffer, _proxyRes, req) => __awaiter(void 0, void 0, void 0, function* () {
|
|
64
|
-
const response = JSON.parse(responseBuffer.toString('utf8'));
|
|
65
|
-
response.environmentName = 'DEVELOPMENT';
|
|
66
|
-
const appProxy = response.services.find((x) => x.key === appsProxyName);
|
|
67
|
-
if (appProxy) {
|
|
68
|
-
appProxy.uri = appsProxyURI;
|
|
69
|
-
response.services = response.services.filter((x) => x.key !== appsProxyName);
|
|
70
|
-
response.services.push(Object.assign(Object.assign({}, appProxy), { uri: new URL('/', req.headers.referer).href }));
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
response.services.push({
|
|
74
|
-
key: appsProxyName,
|
|
75
|
-
type: 'Service',
|
|
76
|
-
serviceName: null,
|
|
77
|
-
uri: new URL('/', req.headers.referer).href,
|
|
78
|
-
internal: false,
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
return JSON.stringify(response);
|
|
82
|
-
})) })));
|
|
83
|
-
app.use(`/apps-proxy/apps/:appKey/builds/:tag/config`, createProxyMiddleware(Object.assign(Object.assign({ pathRewrite: { '^/apps-proxy': '' } }, proxyOptions), { target: appsProxyURI, onProxyRes: createResponseInterceptor(handler.onConfigResponse) })));
|
|
84
|
-
app.use(`/apps-proxy/apps/:appKey`, createProxyMiddleware(Object.assign(Object.assign({ pathRewrite: { '^/apps-proxy': '' } }, proxyOptions), { target: appsProxyURI, onProxyRes: createResponseInterceptor(handler.onManifestResponse) })));
|
|
85
|
-
app.use(`/apps-proxy/apps`, createProxyMiddleware(Object.assign(Object.assign({ pathRewrite: { '^/apps-proxy': '' } }, proxyOptions), { target: appsProxyURI, onProxyRes: createResponseInterceptor(handler.onManifestListResponse) })));
|
|
86
|
-
return app;
|
|
87
|
-
};
|
|
88
|
-
export default createDevProxy;
|
|
89
|
-
//# sourceMappingURL=dev-proxy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dev-proxy.js","sourceRoot":"","sources":["../../src/bin/dev-proxy.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,OAAuC,MAAM,SAAS,CAAC;AAE9D,OAAO,EACH,qBAAqB,EACrB,mBAAmB,GAEtB,MAAM,uBAAuB,CAAC;AAI/B,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAKtD,MAAM,aAAa,GAAG,YAAY,CAAC;AACnC,MAAM,YAAY,GAAG,6CAA6C,CAAC;AAqBnE,MAAM,yBAAyB,GAAG,CAC9B,EAAsF,EACxF,EAAE;IACA,OAAO,mBAAmB,CAAC,CAAO,cAAc,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE;;QACpE,GAAG,CAAC,SAAS,CAAC,wBAAwB,EAAE,MAAA,QAAQ,CAAC,aAAa,mCAAI,EAAE,CAAC,CAAC;QACtE,GAAG,CAAC,SAAS,CAAC,qBAAqB,EAAE,MAAA,QAAQ,CAAC,UAAU,mCAAI,EAAE,CAAC,CAAC;QAChE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,GAChC,MAAA,CAAC,MAAM,OAAO,CAAC,OAAO,CAClB,EAAE,CACG,GAAsB,CAA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