@equinor/fusion-framework-cli 14.0.1 → 14.0.3
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/dist/esm/version.js
CHANGED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formats an HTTP 401 or 403 response into a clear, actionable CLI error message.
|
|
3
|
+
*
|
|
4
|
+
* Returns `undefined` for status codes that are not auth-related so callers
|
|
5
|
+
* can fall through to their existing error handling.
|
|
6
|
+
*
|
|
7
|
+
* @param status - The HTTP response status code.
|
|
8
|
+
* @param context - A short, human-readable description of the failed operation
|
|
9
|
+
* (e.g. `"upload bundle for my-app"`, `"tag my-app@1.0.0"`).
|
|
10
|
+
* @returns A formatted error string, or `undefined` if the status is not 401/403.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const msg = formatAuthError(401, 'upload bundle for my-app');
|
|
15
|
+
* if (msg) {
|
|
16
|
+
* log.error(msg);
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare function formatAuthError(status: number, context: string): string | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Detects whether an error is (or wraps) an authentication/authorization failure.
|
|
23
|
+
*
|
|
24
|
+
* Checks for:
|
|
25
|
+
* - `SilentTokenAcquisitionError` (MSAL token refresh failure)
|
|
26
|
+
* - HTTP response errors with 401/403 status (including `HttpJsonResponseError`
|
|
27
|
+
* from the JSON selector when a service returns an auth error page)
|
|
28
|
+
* - Errors whose cause chain contains one of the above
|
|
29
|
+
*
|
|
30
|
+
* Returns `undefined` when the error is not auth-related, so callers can
|
|
31
|
+
* fall through to generic error handling.
|
|
32
|
+
*
|
|
33
|
+
* @param error - The caught error value.
|
|
34
|
+
* @param context - A short description of the failed operation (e.g. `"check registration for my-app"`).
|
|
35
|
+
* @returns A formatted error string, or `undefined` if the error is not an auth failure.
|
|
36
|
+
*/
|
|
37
|
+
export declare function formatTokenAcquisitionError(error: unknown, context: string): string | undefined;
|
|
@@ -12,3 +12,4 @@ export { Spinner } from './spinner.js';
|
|
|
12
12
|
export { ConsoleLogger } from './ConsoleLogger.js';
|
|
13
13
|
export { createDevServerConfig, createDevServer, type CreateDevServerOptions, } from './create-dev-server.js';
|
|
14
14
|
export { defaultHeaders } from './defaultHeaders.js';
|
|
15
|
+
export { formatAuthError, formatTokenAcquisitionError } from './format-auth-error.js';
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "14.0.
|
|
1
|
+
export declare const version = "14.0.3";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/fusion-framework-cli",
|
|
3
|
-
"version": "14.0.
|
|
3
|
+
"version": "14.0.3",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"Fusion",
|
|
6
6
|
"Fusion Framework",
|
|
@@ -95,6 +95,7 @@
|
|
|
95
95
|
},
|
|
96
96
|
"dependencies": {
|
|
97
97
|
"@types/inquirer": "^9.0.9",
|
|
98
|
+
"chalk": "^5.6.0",
|
|
98
99
|
"commander": "^14.0.1",
|
|
99
100
|
"deepmerge": "^4.3.1",
|
|
100
101
|
"dotenv": "^17.3.1",
|
|
@@ -110,10 +111,10 @@
|
|
|
110
111
|
"vite": "^8.0.0",
|
|
111
112
|
"vite-tsconfig-paths": "^6.0.4",
|
|
112
113
|
"zod": "^4.3.6",
|
|
114
|
+
"@equinor/fusion-framework-dev-portal": "5.0.1",
|
|
113
115
|
"@equinor/fusion-framework-dev-server": "2.0.0",
|
|
114
|
-
"@equinor/fusion-framework-dev-portal": "5.0.0",
|
|
115
|
-
"@equinor/fusion-framework-vite-plugin-raw-imports": "2.0.0",
|
|
116
116
|
"@equinor/fusion-framework-module-msal-node": "4.0.0",
|
|
117
|
+
"@equinor/fusion-framework-vite-plugin-raw-imports": "2.0.0",
|
|
117
118
|
"@equinor/fusion-imports": "2.0.0"
|
|
118
119
|
},
|
|
119
120
|
"devDependencies": {
|
|
@@ -128,7 +129,6 @@
|
|
|
128
129
|
"@vitest/coverage-v8": "^4.0.18",
|
|
129
130
|
"adm-zip": "^0.5.10",
|
|
130
131
|
"ajv": "^8.17.1",
|
|
131
|
-
"chalk": "^5.6.0",
|
|
132
132
|
"is-ci": "^4.1.0",
|
|
133
133
|
"normalize-package-data": "^8.0.0",
|
|
134
134
|
"open": "^11.0.0",
|
|
@@ -138,11 +138,11 @@
|
|
|
138
138
|
"type-fest": "^5.0.0",
|
|
139
139
|
"typescript": "^5.9.3",
|
|
140
140
|
"vitest": "^4.1.0",
|
|
141
|
-
"@equinor/fusion-framework-module
|
|
141
|
+
"@equinor/fusion-framework-module": "6.0.0",
|
|
142
142
|
"@equinor/fusion-framework-module-app": "8.0.0",
|
|
143
|
+
"@equinor/fusion-framework-module-http": "8.0.0",
|
|
143
144
|
"@equinor/fusion-framework-module-service-discovery": "10.0.0",
|
|
144
|
-
"@equinor/fusion-framework-react-router": "1.0.2"
|
|
145
|
-
"@equinor/fusion-framework-module": "6.0.0"
|
|
145
|
+
"@equinor/fusion-framework-react-router": "1.0.2"
|
|
146
146
|
},
|
|
147
147
|
"peerDependenciesMeta": {
|
|
148
148
|
"typescript": {
|