@equinor/fusion-framework-vite-plugin-spa 5.2.0 → 5.2.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/README.md CHANGED
@@ -401,7 +401,7 @@ FUSION_SPA_MSAL_TENANT_ID=my-tenant-id
401
401
  FUSION_SPA_MSAL_CLIENT_ID=my-client-id
402
402
  FUSION_SPA_MSAL_REDIRECT_URI=https://my-app.com/auth-callback
403
403
  FUSION_SPA_MSAL_REQUIRES_AUTH=true
404
- # Set to skip Entra ID and sign in a mock user instead — for CI/Playwright runs
404
+ # Set to skip Entra ID and sign in a mock user instead — use together with a mock server (see below)
405
405
  FUSION_SPA_MSAL_MOCK=true
406
406
  # Optional: standalone mock-server origin used for session-scoped token acquisition
407
407
  FUSION_SPA_MSAL_MOCK_SERVER_URL=http://localhost:4010
@@ -421,15 +421,30 @@ FUSION_SPA_SERVICE_WORKER_RESOURCES=[{"url":"/app-proxy","rewrite":"/@fusion-api
421
421
 
422
422
  ## Running Against a Mock Client (CI / Playwright)
423
423
 
424
+ Run CI and Playwright suites against the standalone mock server, so both authentication and
425
+ service discovery stay local:
426
+
427
+ ```sh
428
+ ffc mock-server ./mocks --port 4010
429
+ ffc app dev --mock http://localhost:4010
430
+ ```
431
+
424
432
  Setting `FUSION_SPA_MSAL_MOCK=true` swaps the real MSAL client for
425
433
  `@equinor/fusion-framework-module-msal/mock`, which signs in a default mock user with no
426
- Entra ID redirects, popups, or network calls. This is the recommended way to run the dev
427
- server headlessly in GitHub Actions or a Playwright suite.
434
+ Entra ID redirects or popups. Mock tokens are unsigned, so real Fusion services reject them.
435
+ `ffc app dev` and `ffc app serve` therefore also send service discovery to the mock server
436
+ whenever mock auth is on — `FUSION_SPA_MSAL_MOCK_SERVER_URL`, or `http://localhost:4010` when
437
+ only `FUSION_SPA_MSAL_MOCK` is set.
428
438
 
429
439
  ```sh
430
440
  FUSION_SPA_MSAL_MOCK=true
431
441
  ```
432
442
 
443
+ > [!IMPORTANT]
444
+ > A direct Vite setup must point `FUSION_SPA_SERVICE_DISCOVERY_URL` (or the dev server's
445
+ > service discovery URL) at the mock server too. Otherwise every page load sends a mock token
446
+ > to real service discovery and fails with `401`.
447
+
433
448
  By default the mock signs in a generic `Test User`. To select and switch users at runtime, start
434
449
  the standalone mock server with the browser origin explicitly allowed, then point the app at it:
435
450
 
@@ -1124,22 +1124,11 @@ function globalErrorHandler(ex) {
1124
1124
  * SPDX-License-Identifier: Apache-2.0
1125
1125
  */
1126
1126
  // this is autogenerated file, see scripts/version-update.js
1127
- const VERSION$1 = '2.11.0';
1127
+ const VERSION$1 = '2.12.0';
1128
1128
 
1129
1129
  /*
1130
1130
  * Copyright The OpenTelemetry Authors
1131
- *
1132
- * Licensed under the Apache License, Version 2.0 (the "License");
1133
- * you may not use this file except in compliance with the License.
1134
- * You may obtain a copy of the License at
1135
- *
1136
- * https://www.apache.org/licenses/LICENSE-2.0
1137
- *
1138
- * Unless required by applicable law or agreed to in writing, software
1139
- * distributed under the License is distributed on an "AS IS" BASIS,
1140
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1141
- * See the License for the specific language governing permissions and
1142
- * limitations under the License.
1131
+ * SPDX-License-Identifier: Apache-2.0
1143
1132
  */
1144
1133
  //----------------------------------------------------------------------------------------------------------
1145
1134
  // DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates/registry/stable/attributes.ts.j2
@@ -1163,6 +1152,12 @@ const VERSION$1 = '2.11.0';
1163
1152
  * When `error.type` is set to a type (e.g., an exception type), its
1164
1153
  * canonical class name identifying the type within the artifact **SHOULD** be used.
1165
1154
  *
1155
+ * If the recorded error type is a wrapper that is not meaningful for
1156
+ * failure classification, instrumentation **MAY** use the type of the inner
1157
+ * error instead. For example, in Go, errors created with `fmt.Errorf`
1158
+ * using `%w` **MAY** be unwrapped when the wrapper type does not help
1159
+ * classify the failure.
1160
+ *
1166
1161
  * Instrumentations **SHOULD** document the list of errors they report.
1167
1162
  *
1168
1163
  * The cardinality of `error.type` within one instrumentation library **SHOULD** be low.
@@ -1178,7 +1173,7 @@ const VERSION$1 = '2.11.0';
1178
1173
  * - Use a domain-specific attribute
1179
1174
  * - Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not.
1180
1175
  */
1181
- const ATTR_ERROR_TYPE$2 = 'error.type';
1176
+ const ATTR_ERROR_TYPE$1 = 'error.type';
1182
1177
  /**
1183
1178
  * The exception message.
1184
1179
  *
@@ -1189,20 +1184,26 @@ const ATTR_ERROR_TYPE$2 = 'error.type';
1189
1184
  *
1190
1185
  * > This attribute may contain sensitive information.
1191
1186
  */
1192
- const ATTR_EXCEPTION_MESSAGE$1 = 'exception.message';
1187
+ const ATTR_EXCEPTION_MESSAGE = 'exception.message';
1193
1188
  /**
1194
1189
  * A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG.
1195
1190
  *
1196
1191
  * @example "Exception in thread "main" java.lang.RuntimeException: Test exception\\n at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\n at com.example.GenerateTrace.main(GenerateTrace.java:5)\\n"
1197
1192
  */
1198
- const ATTR_EXCEPTION_STACKTRACE$1 = 'exception.stacktrace';
1193
+ const ATTR_EXCEPTION_STACKTRACE = 'exception.stacktrace';
1199
1194
  /**
1200
1195
  * The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it.
1201
1196
  *
1202
1197
  * @example java.net.ConnectException
1203
1198
  * @example OSError
1199
+ *
1200
+ * @note If the recorded exception type is a wrapper that is not meaningful for
1201
+ * failure classification, instrumentation **MAY** use the type of the inner
1202
+ * exception instead. For example, in Go, errors created with `fmt.Errorf`
1203
+ * using `%w` **MAY** be unwrapped when the wrapper type does not help
1204
+ * classify the failure.
1204
1205
  */
1205
- const ATTR_EXCEPTION_TYPE$1 = 'exception.type';
1206
+ const ATTR_EXCEPTION_TYPE = 'exception.type';
1206
1207
  /**
1207
1208
  * HTTP request method.
1208
1209
  *
@@ -1268,10 +1269,19 @@ const ATTR_SERVER_ADDRESS$1 = 'server.address';
1268
1269
  * @note When observed from the client side, and when communicating through an intermediary, `server.port` **SHOULD** represent the server port behind any intermediaries, for example proxies, if it's available.
1269
1270
  */
1270
1271
  const ATTR_SERVER_PORT$1 = 'server.port';
1272
+ /**
1273
+ * Logical name of the service.
1274
+ *
1275
+ * @example shoppingcart
1276
+ *
1277
+ * @note **MUST** be the same for all instances of horizontally scaled services. If the value was not specified, SDKs **MUST** fallback to `unknown_service:` concatenated with the process executable name, e.g. `unknown_service:bash`. If the process executable name is not available, the value **MUST** be set to `unknown_service`.
1278
+ * The process executable name is the name of the process executable, the same value as described by the [`process.executable.name`](process.md) resource attribute.
1279
+ */
1280
+ const ATTR_SERVICE_NAME = 'service.name';
1271
1281
  /**
1272
1282
  * The language of the telemetry SDK.
1273
1283
  */
1274
- const ATTR_TELEMETRY_SDK_LANGUAGE$1 = 'telemetry.sdk.language';
1284
+ const ATTR_TELEMETRY_SDK_LANGUAGE = 'telemetry.sdk.language';
1275
1285
  /**
1276
1286
  * Enum value "webjs" for attribute {@link ATTR_TELEMETRY_SDK_LANGUAGE}.
1277
1287
  */
@@ -1288,13 +1298,13 @@ const TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS = "webjs";
1288
1298
  * The identifier `opentelemetry` is reserved and **MUST NOT** be used in this case.
1289
1299
  * All custom identifiers **SHOULD** be stable across different versions of an implementation.
1290
1300
  */
1291
- const ATTR_TELEMETRY_SDK_NAME$1 = 'telemetry.sdk.name';
1301
+ const ATTR_TELEMETRY_SDK_NAME = 'telemetry.sdk.name';
1292
1302
  /**
1293
1303
  * The version string of the telemetry SDK.
1294
1304
  *
1295
1305
  * @example 1.2.3
1296
1306
  */
1297
- const ATTR_TELEMETRY_SDK_VERSION$1 = 'telemetry.sdk.version';
1307
+ const ATTR_TELEMETRY_SDK_VERSION = 'telemetry.sdk.version';
1298
1308
  /**
1299
1309
  * Absolute URL describing a network resource according to [RFC3986](https://www.rfc-editor.org/rfc/rfc3986)
1300
1310
  *
@@ -1315,8 +1325,9 @@ const ATTR_TELEMETRY_SDK_VERSION$1 = 'telemetry.sdk.version';
1315
1325
  * Query string values for the following keys **SHOULD** be redacted by default and replaced by the
1316
1326
  * value `REDACTED`:
1317
1327
  *
1318
- * - [`AWSAccessKeyId`](https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth)
1319
- * - [`Signature`](https://docs.aws.amazon.com/AmazonS3/latest/userguide/RESTAuthentication.html#RESTAuthenticationQueryStringAuth)
1328
+ * - [`X-Amz-Signature`](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv-authentication-methods.html)
1329
+ * - [`X-Amz-Credential`](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv-authentication-methods.html)
1330
+ * - [`X-Amz-Security-Token`](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_sigv-authentication-methods.html)
1320
1331
  * - [`sig`](https://learn.microsoft.com/azure/storage/common/storage-sas-overview#sas-token)
1321
1332
  * - [`X-Goog-Signature`](https://cloud.google.com/storage/docs/access-control/signed-urls)
1322
1333
  *
@@ -1369,10 +1380,10 @@ const ATTR_PROCESS_RUNTIME_NAME = 'process.runtime.name';
1369
1380
  */
1370
1381
  /** Constants describing the SDK in use */
1371
1382
  const SDK_INFO = {
1372
- [ATTR_TELEMETRY_SDK_NAME$1]: 'opentelemetry',
1383
+ [ATTR_TELEMETRY_SDK_NAME]: 'opentelemetry',
1373
1384
  [ATTR_PROCESS_RUNTIME_NAME]: 'browser',
1374
- [ATTR_TELEMETRY_SDK_LANGUAGE$1]: TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS,
1375
- [ATTR_TELEMETRY_SDK_VERSION$1]: VERSION$1,
1385
+ [ATTR_TELEMETRY_SDK_LANGUAGE]: TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS,
1386
+ [ATTR_TELEMETRY_SDK_VERSION]: VERSION$1,
1376
1387
  };
1377
1388
 
1378
1389
  /*
@@ -1961,14 +1972,14 @@ const ATTR_SERVER_PORT = 'server.port';
1961
1972
  * - Use a domain-specific attribute
1962
1973
  * - Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not.
1963
1974
  */
1964
- const ATTR_ERROR_TYPE$1 = 'error.type';
1975
+ const ATTR_ERROR_TYPE = 'error.type';
1965
1976
 
1966
1977
  /*
1967
1978
  * Copyright The OpenTelemetry Authors
1968
1979
  * SPDX-License-Identifier: Apache-2.0
1969
1980
  */
1970
1981
  // this is autogenerated file, see scripts/version-update.js
1971
- const VERSION = '0.222.0';
1982
+ const VERSION = '0.223.0';
1972
1983
 
1973
1984
  /*
1974
1985
  * Copyright The OpenTelemetry Authors
@@ -2056,7 +2067,7 @@ class ExporterMetrics {
2056
2067
  const exportedAttrs = error
2057
2068
  ? {
2058
2069
  ...this.standardAttrs,
2059
- [ATTR_ERROR_TYPE$1]: error instanceof Error ? error.name : 'export_failed',
2070
+ [ATTR_ERROR_TYPE]: error instanceof Error ? error.name : 'export_failed',
2060
2071
  }
2061
2072
  : this.standardAttrs;
2062
2073
  this.exported.add(numItems, exportedAttrs);
@@ -2088,117 +2099,6 @@ function createNoopLogger() {
2088
2099
  return NOOP_LOGGER;
2089
2100
  }
2090
2101
 
2091
- /*
2092
- * Copyright The OpenTelemetry Authors
2093
- * SPDX-License-Identifier: Apache-2.0
2094
- */
2095
- //----------------------------------------------------------------------------------------------------------
2096
- // DO NOT EDIT, this is an Auto-generated file from scripts/semconv/templates/registry/stable/attributes.ts.j2
2097
- //----------------------------------------------------------------------------------------------------------
2098
- /**
2099
- * ASP.NET Core exception middleware handling result.
2100
- *
2101
- * @example handled
2102
- * @example unhandled
2103
- */
2104
- /**
2105
- * Describes a class of error the operation ended with.
2106
- *
2107
- * @example timeout
2108
- * @example java.net.UnknownHostException
2109
- * @example server_certificate_invalid
2110
- * @example 500
2111
- *
2112
- * @note The `error.type` **SHOULD** be predictable, and **SHOULD** have low cardinality.
2113
- *
2114
- * When `error.type` is set to a type (e.g., an exception type), its
2115
- * canonical class name identifying the type within the artifact **SHOULD** be used.
2116
- *
2117
- * If the recorded error type is a wrapper that is not meaningful for
2118
- * failure classification, instrumentation **MAY** use the type of the inner
2119
- * error instead. For example, in Go, errors created with `fmt.Errorf`
2120
- * using `%w` **MAY** be unwrapped when the wrapper type does not help
2121
- * classify the failure.
2122
- *
2123
- * Instrumentations **SHOULD** document the list of errors they report.
2124
- *
2125
- * The cardinality of `error.type` within one instrumentation library **SHOULD** be low.
2126
- * Telemetry consumers that aggregate data from multiple instrumentation libraries and applications
2127
- * should be prepared for `error.type` to have high cardinality at query time when no
2128
- * additional filters are applied.
2129
- *
2130
- * If the operation has completed successfully, instrumentations **SHOULD NOT** set `error.type`.
2131
- *
2132
- * If a specific domain defines its own set of error identifiers (such as HTTP or RPC status codes),
2133
- * it's **RECOMMENDED** to:
2134
- *
2135
- * - Use a domain-specific attribute
2136
- * - Set `error.type` to capture all errors, regardless of whether they are defined within the domain-specific set or not.
2137
- */
2138
- const ATTR_ERROR_TYPE = 'error.type';
2139
- /**
2140
- * The exception message.
2141
- *
2142
- * @example Division by zero
2143
- * @example Can't convert 'int' object to str implicitly
2144
- *
2145
- * @note > [!WARNING]
2146
- *
2147
- * > This attribute may contain sensitive information.
2148
- */
2149
- const ATTR_EXCEPTION_MESSAGE = 'exception.message';
2150
- /**
2151
- * A stacktrace as a string in the natural representation for the language runtime. The representation is to be determined and documented by each language SIG.
2152
- *
2153
- * @example "Exception in thread "main" java.lang.RuntimeException: Test exception\\n at com.example.GenerateTrace.methodB(GenerateTrace.java:13)\\n at com.example.GenerateTrace.methodA(GenerateTrace.java:9)\\n at com.example.GenerateTrace.main(GenerateTrace.java:5)\\n"
2154
- */
2155
- const ATTR_EXCEPTION_STACKTRACE = 'exception.stacktrace';
2156
- /**
2157
- * The type of the exception (its fully-qualified class name, if applicable). The dynamic type of the exception should be preferred over the static type in languages that support it.
2158
- *
2159
- * @example java.net.ConnectException
2160
- * @example OSError
2161
- *
2162
- * @note If the recorded exception type is a wrapper that is not meaningful for
2163
- * failure classification, instrumentation **MAY** use the type of the inner
2164
- * exception instead. For example, in Go, errors created with `fmt.Errorf`
2165
- * using `%w` **MAY** be unwrapped when the wrapper type does not help
2166
- * classify the failure.
2167
- */
2168
- const ATTR_EXCEPTION_TYPE = 'exception.type';
2169
- /**
2170
- * Logical name of the service.
2171
- *
2172
- * @example shoppingcart
2173
- *
2174
- * @note **MUST** be the same for all instances of horizontally scaled services. If the value was not specified, SDKs **MUST** fallback to `unknown_service:` concatenated with the process executable name, e.g. `unknown_service:bash`. If the process executable name is not available, the value **MUST** be set to `unknown_service`.
2175
- * The process executable name is the name of the process executable, the same value as described by the [`process.executable.name`](process.md) resource attribute.
2176
- */
2177
- const ATTR_SERVICE_NAME = 'service.name';
2178
- /**
2179
- * The language of the telemetry SDK.
2180
- */
2181
- const ATTR_TELEMETRY_SDK_LANGUAGE = 'telemetry.sdk.language';
2182
- /**
2183
- * The name of the telemetry SDK as defined above.
2184
- *
2185
- * @example opentelemetry
2186
- *
2187
- * @note The OpenTelemetry SDK **MUST** set the `telemetry.sdk.name` attribute to `opentelemetry`.
2188
- * If another SDK, like a fork or a vendor-provided implementation, is used, this SDK **MUST** set the
2189
- * `telemetry.sdk.name` attribute to the fully-qualified class or module name of this SDK's main entry point
2190
- * or another suitable identifier depending on the language.
2191
- * The identifier `opentelemetry` is reserved and **MUST NOT** be used in this case.
2192
- * All custom identifiers **SHOULD** be stable across different versions of an implementation.
2193
- */
2194
- const ATTR_TELEMETRY_SDK_NAME = 'telemetry.sdk.name';
2195
- /**
2196
- * The version string of the telemetry SDK.
2197
- *
2198
- * @example 1.2.3
2199
- */
2200
- const ATTR_TELEMETRY_SDK_VERSION = 'telemetry.sdk.version';
2201
-
2202
2102
  /*
2203
2103
  * Copyright The OpenTelemetry Authors
2204
2104
  * SPDX-License-Identifier: Apache-2.0
@@ -2858,5 +2758,5 @@ function createLegacyOtlpBrowserExportDelegate(config, serializer, metricsCompon
2858
2758
  return createOtlpFetchExportDelegate(options, serializer, createLegacyOtlpBrowserExporterMetrics(metricsComponentType, exporterMetricsHelper, options.url, config.selfObsMeterProvider));
2859
2759
  }
2860
2760
 
2861
- export { toAnyValue as $, ATTR_EXCEPTION_TYPE as A, BindOnceFuture as B, ContextAPI as C, DiagAPI as D, createNoopMeter as E, suppressTracing as F, ExportResultCode as G, defaultResource as H, INVALID_SPAN_CONTEXT as I, JSON_ENCODER as J, isValidTraceId as K, hrTimeToNanoseconds as L, timeInputToHrTime as M, NOOP_METER as N, OTLPExporterBase as O, ATTR_URL_FULL as P, ATTR_USER_AGENT_ORIGINAL as Q, ROOT_CONTEXT as R, ATTR_HTTP_RESPONSE_STATUS_CODE$1 as S, TraceFlags as T, ATTR_SERVER_ADDRESS$1 as U, ATTR_SERVER_PORT$1 as V, ATTR_ERROR_TYPE$2 as W, ATTR_HTTP_REQUEST_METHOD as X, ATTR_HTTP_REQUEST_METHOD_ORIGINAL as Y, ProxyTracerProvider as Z, resourceFromAttributes as _, isSpanContextValid as a, ATTR_EXCEPTION_MESSAGE$1 as a0, ATTR_EXCEPTION_TYPE$1 as a1, ATTR_EXCEPTION_STACKTRACE$1 as a2, createNoopLogger as a3, NoopLogger as b, createContextKey as c, diag as d, NOOP_LOGGER as e, createInstrumentationScope as f, getGlobal as g, createResource as h, isTracingSuppressed as i, toAttributes as j, createLegacyOtlpBrowserExportDelegate as k, isTimeInput as l, hrTimeDuration as m, hrTime as n, otperformance as o, millisToHrTime as p, isTimeInputHrTime as q, registerGlobal as r, addHrTimes as s, trace as t, unregisterGlobal as u, ATTR_EXCEPTION_MESSAGE as v, ATTR_EXCEPTION_STACKTRACE as w, context as x, globalErrorHandler as y, ATTR_ERROR_TYPE as z };
2862
- //# sourceMappingURL=create-legacy-browser-delegate-B4z_676L.js.map
2761
+ export { createNoopLogger as $, ATTR_EXCEPTION_TYPE as A, BindOnceFuture as B, ContextAPI as C, DiagAPI as D, createNoopMeter as E, suppressTracing as F, ExportResultCode as G, defaultResource as H, INVALID_SPAN_CONTEXT as I, JSON_ENCODER as J, isValidTraceId as K, ATTR_URL_FULL as L, ATTR_USER_AGENT_ORIGINAL as M, NOOP_METER as N, OTLPExporterBase as O, hrTimeToNanoseconds as P, timeInputToHrTime as Q, ROOT_CONTEXT as R, ATTR_HTTP_RESPONSE_STATUS_CODE$1 as S, TraceFlags as T, ATTR_SERVER_ADDRESS$1 as U, ATTR_SERVER_PORT$1 as V, ATTR_HTTP_REQUEST_METHOD as W, ATTR_HTTP_REQUEST_METHOD_ORIGINAL as X, ProxyTracerProvider as Y, resourceFromAttributes as Z, toAnyValue as _, isSpanContextValid as a, NoopLogger as b, createContextKey as c, diag as d, NOOP_LOGGER as e, createInstrumentationScope as f, getGlobal as g, createResource as h, isTracingSuppressed as i, toAttributes as j, createLegacyOtlpBrowserExportDelegate as k, isTimeInput as l, hrTimeDuration as m, hrTime as n, otperformance as o, millisToHrTime as p, isTimeInputHrTime as q, registerGlobal as r, addHrTimes as s, trace as t, unregisterGlobal as u, ATTR_EXCEPTION_MESSAGE as v, ATTR_EXCEPTION_STACKTRACE as w, context as x, globalErrorHandler as y, ATTR_ERROR_TYPE$1 as z };
2762
+ //# sourceMappingURL=create-legacy-browser-delegate-4GII-R4B.js.map