@equinor/fusion-framework-module-msal 10.0.2 → 11.0.0-next.0
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 +163 -0
- package/README.md +17 -368
- package/dist/esm/MsalConfigurator.js +176 -88
- package/dist/esm/MsalConfigurator.js.map +1 -1
- package/dist/esm/__tests__/MsalConfigurator.test.js +75 -0
- package/dist/esm/__tests__/MsalConfigurator.test.js.map +1 -1
- package/dist/esm/__tests__/create-proxy-provider.test.js +53 -0
- package/dist/esm/__tests__/create-proxy-provider.test.js.map +1 -0
- package/dist/esm/__tests__/mock/msal-mock.test.js +399 -0
- package/dist/esm/__tests__/mock/msal-mock.test.js.map +1 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/mock/MsalMockClient.js +467 -0
- package/dist/esm/mock/MsalMockClient.js.map +1 -0
- package/dist/esm/mock/MsalMockConfigurator.js +187 -0
- package/dist/esm/mock/MsalMockConfigurator.js.map +1 -0
- package/dist/esm/mock/create-mock-token.js +60 -0
- package/dist/esm/mock/create-mock-token.js.map +1 -0
- package/dist/esm/mock/create-msal-mock-client.js +20 -0
- package/dist/esm/mock/create-msal-mock-client.js.map +1 -0
- package/dist/esm/mock/decode-jwt-segment.js +22 -0
- package/dist/esm/mock/decode-jwt-segment.js.map +1 -0
- package/dist/esm/mock/index.js +30 -0
- package/dist/esm/mock/index.js.map +1 -0
- package/dist/esm/mock/module.js +38 -0
- package/dist/esm/mock/module.js.map +1 -0
- package/dist/esm/msal-config-schema.js +37 -0
- package/dist/esm/msal-config-schema.js.map +1 -0
- package/dist/esm/telemetry-config-schema.js +16 -0
- package/dist/esm/telemetry-config-schema.js.map +1 -0
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/esm/versioning/resolve-version.js +0 -1
- package/dist/esm/versioning/resolve-version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/MsalConfigurator.d.ts +96 -20
- package/dist/types/__tests__/create-proxy-provider.test.d.ts +1 -0
- package/dist/types/__tests__/mock/msal-mock.test.d.ts +1 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/mock/MsalMockClient.d.ts +270 -0
- package/dist/types/mock/MsalMockConfigurator.d.ts +156 -0
- package/dist/types/mock/create-mock-token.d.ts +54 -0
- package/dist/types/mock/create-msal-mock-client.d.ts +14 -0
- package/dist/types/mock/decode-jwt-segment.d.ts +13 -0
- package/dist/types/mock/index.d.ts +29 -0
- package/dist/types/mock/module.d.ts +35 -0
- package/dist/types/msal-config-schema.d.ts +64 -0
- package/dist/types/telemetry-config-schema.d.ts +8 -0
- package/dist/types/version.d.ts +1 -1
- package/docs/api-reference.md +85 -0
- package/docs/auth-code-flow.md +86 -0
- package/docs/migration-v2-to-v4.md +115 -0
- package/docs/testing.md +167 -0
- package/docs/troubleshooting.md +17 -0
- package/docs/version-management.md +67 -0
- package/package.json +12 -5
- package/src/MsalConfigurator.ts +202 -115
- package/src/__tests__/MsalConfigurator.test.ts +106 -0
- package/src/__tests__/create-proxy-provider.test.ts +77 -0
- package/src/__tests__/mock/msal-mock.test.ts +544 -0
- package/src/index.ts +6 -0
- package/src/mock/MsalMockClient.ts +599 -0
- package/src/mock/MsalMockConfigurator.ts +241 -0
- package/src/mock/create-mock-token.ts +92 -0
- package/src/mock/create-msal-mock-client.ts +25 -0
- package/src/mock/decode-jwt-segment.ts +22 -0
- package/src/mock/index.ts +29 -0
- package/src/mock/module.ts +54 -0
- package/src/msal-config-schema.ts +81 -0
- package/src/telemetry-config-schema.ts +25 -0
- package/src/version.ts +1 -1
- package/src/versioning/resolve-version.ts +0 -1
- package/vitest.config.ts +1 -1
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Encodes a value as base64url without padding, as used in JWT segments.
|
|
3
|
+
*
|
|
4
|
+
* @param value - Raw string to encode.
|
|
5
|
+
* @returns The base64url representation.
|
|
6
|
+
*/
|
|
7
|
+
const base64Url = (value) => {
|
|
8
|
+
// btoa operates on latin1; encodeURIComponent round-trip keeps non-ASCII names intact
|
|
9
|
+
const bytes = new TextEncoder().encode(value);
|
|
10
|
+
let binary = '';
|
|
11
|
+
// Iterate over encoded bytes so Unicode claims are preserved before base64url encoding.
|
|
12
|
+
for (const byte of bytes) {
|
|
13
|
+
binary += String.fromCharCode(byte);
|
|
14
|
+
}
|
|
15
|
+
return btoa(binary).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Creates a structurally valid, unsigned JWT for use in tests.
|
|
19
|
+
*
|
|
20
|
+
* The token has three base64url segments and decodes to the supplied claims, so
|
|
21
|
+
* code that splits, decodes, or inspects token claims behaves exactly as it does
|
|
22
|
+
* in production. The signature segment is a fixed placeholder — the token is
|
|
23
|
+
* **not** cryptographically valid and will be rejected by any real service.
|
|
24
|
+
*
|
|
25
|
+
* @remarks
|
|
26
|
+
* Timestamps default to a fixed issue time and a one-hour lifetime so repeated
|
|
27
|
+
* runs produce byte-identical tokens. A test that needs an expired token can set
|
|
28
|
+
* `exp` in the past.
|
|
29
|
+
*
|
|
30
|
+
* @param claims - Claims to embed in the token payload.
|
|
31
|
+
* @returns An unsigned JWT string in `header.payload.signature` form.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```typescript
|
|
35
|
+
* const token = createMockToken({ name: 'Test User', scp: 'Files.Read' });
|
|
36
|
+
* const [, payload] = token.split('.');
|
|
37
|
+
* JSON.parse(decodeJwtSegment(payload)).name; // 'Test User'
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export const createMockToken = (claims = {}) => {
|
|
41
|
+
const header = { alg: 'none', typ: 'JWT' };
|
|
42
|
+
// Fixed default clock keeps generated tokens byte-identical between runs
|
|
43
|
+
const issuedAt = claims.iat ?? 1_700_000_000;
|
|
44
|
+
const payload = {
|
|
45
|
+
iss: 'https://login.microsoftonline.com/fusion-test-tenant/v2.0',
|
|
46
|
+
aud: 'fusion-test-client',
|
|
47
|
+
tid: 'fusion-test-tenant',
|
|
48
|
+
oid: 'fusion-test-user',
|
|
49
|
+
iat: issuedAt,
|
|
50
|
+
nbf: issuedAt,
|
|
51
|
+
exp: issuedAt + 3600,
|
|
52
|
+
...claims,
|
|
53
|
+
};
|
|
54
|
+
return [
|
|
55
|
+
base64Url(JSON.stringify(header)),
|
|
56
|
+
base64Url(JSON.stringify(payload)),
|
|
57
|
+
'fusion-test-signature',
|
|
58
|
+
].join('.');
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=create-mock-token.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-mock-token.js","sourceRoot":"","sources":["../../../src/mock/create-mock-token.ts"],"names":[],"mappings":"AA+BA;;;;;GAKG;AACH,MAAM,SAAS,GAAG,CAAC,KAAa,EAAU,EAAE;IAC1C,sFAAsF;IACtF,MAAM,KAAK,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9C,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,wFAAwF;IACxF,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IACD,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACjF,CAAC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,MAAM,GAAoB,EAAE,EAAU,EAAE;IACtE,MAAM,MAAM,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC;IAC3C,yEAAyE;IACzE,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,IAAI,aAAa,CAAC;IAC7C,MAAM,OAAO,GAAoB;QAC/B,GAAG,EAAE,2DAA2D;QAChE,GAAG,EAAE,oBAAoB;QACzB,GAAG,EAAE,oBAAoB;QACzB,GAAG,EAAE,kBAAkB;QACvB,GAAG,EAAE,QAAQ;QACb,GAAG,EAAE,QAAQ;QACb,GAAG,EAAE,QAAQ,GAAG,IAAI;QACpB,GAAG,MAAM;KACV,CAAC;IAEF,OAAO;QACL,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QACjC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QAClC,uBAAuB;KACxB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACd,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { MsalMockClient } from './MsalMockClient';
|
|
2
|
+
/**
|
|
3
|
+
* Convenience helper that creates a mock client instance.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* The class form is preferred for a more familiar configuration pattern.
|
|
7
|
+
*
|
|
8
|
+
* @param config - The same client configuration the real client is built from.
|
|
9
|
+
* @param user - Optional user to sign in, applied after construction.
|
|
10
|
+
* @returns A client that resolves tokens in-process.
|
|
11
|
+
*/
|
|
12
|
+
export const createMsalMockClient = (config, user) => {
|
|
13
|
+
const client = new MsalMockClient(config);
|
|
14
|
+
// Apply the optional identity after construction so the helper matches setUser semantics.
|
|
15
|
+
if (user) {
|
|
16
|
+
client.setUser(user);
|
|
17
|
+
}
|
|
18
|
+
return client;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=create-msal-mock-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-msal-mock-client.js","sourceRoot":"","sources":["../../../src/mock/create-msal-mock-client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAqB,MAAM,kBAAkB,CAAC;AAErE;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,MAAwB,EACxB,IAAmB,EACN,EAAE;IACf,MAAM,MAAM,GAAG,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC;IAC1C,0FAA0F;IAC1F,IAAI,IAAI,EAAE,CAAC;QACT,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decodes a base64url segment of a {@link createMockToken} JWT back to its JSON string.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Plain `atob` alone mangles non-ASCII claims: it treats its output as latin1,
|
|
6
|
+
* while segments are UTF-8 encoded. This reverses that encoding and also
|
|
7
|
+
* restores the standard base64 alphabet/padding `atob` expects.
|
|
8
|
+
*
|
|
9
|
+
* @param segment - A base64url segment, e.g. from splitting a JWT on `.`.
|
|
10
|
+
* @returns The decoded UTF-8 string.
|
|
11
|
+
*/
|
|
12
|
+
export function decodeJwtSegment(segment) {
|
|
13
|
+
const base64 = segment
|
|
14
|
+
.replace(/-/g, '+')
|
|
15
|
+
.replace(/_/g, '/')
|
|
16
|
+
.padEnd(segment.length + ((4 - (segment.length % 4)) % 4), '=');
|
|
17
|
+
const binary = atob(base64);
|
|
18
|
+
const bytes = Uint8Array.from(binary, (char) => char.charCodeAt(0));
|
|
19
|
+
return new TextDecoder().decode(bytes);
|
|
20
|
+
}
|
|
21
|
+
export default decodeJwtSegment;
|
|
22
|
+
//# sourceMappingURL=decode-jwt-segment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decode-jwt-segment.js","sourceRoot":"","sources":["../../../src/mock/decode-jwt-segment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gBAAgB,CAAC,OAAe;IAC9C,MAAM,MAAM,GAAG,OAAO;SACnB,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;SAClB,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;SAClB,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAClE,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5B,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IACpE,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACzC,CAAC;AAED,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mock MSAL for tests: real provider, real configurator, fake client.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Substituting the client is the smallest change that removes Entra ID from a test.
|
|
6
|
+
* Everything above it — scope resolution, silent-first token acquisition, account
|
|
7
|
+
* handling, proxy providers, telemetry — is the production code path.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* import { enableMsalMock } from '@equinor/fusion-framework-module-msal/mock';
|
|
12
|
+
*
|
|
13
|
+
* // default mock user
|
|
14
|
+
* enableMsalMock(configurator);
|
|
15
|
+
*
|
|
16
|
+
* // or a specific one
|
|
17
|
+
* enableMsalMock(configurator, (builder) => {
|
|
18
|
+
* builder.setAccount({ name: 'Ada Lovelace', signedOut: true });
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @packageDocumentation
|
|
23
|
+
*/
|
|
24
|
+
export { MsalMockClient } from './MsalMockClient';
|
|
25
|
+
export { createMsalMockClient } from './create-msal-mock-client';
|
|
26
|
+
export { MsalMockConfigurator } from './MsalMockConfigurator';
|
|
27
|
+
export { enableMsalMock, msalMockModule } from './module';
|
|
28
|
+
export { createMockToken } from './create-mock-token';
|
|
29
|
+
export { decodeJwtSegment } from './decode-jwt-segment';
|
|
30
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/mock/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,cAAc,EAAqB,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAyB,MAAM,UAAU,CAAC;AACjF,OAAO,EAAE,eAAe,EAAwB,MAAM,qBAAqB,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { module } from '../module';
|
|
2
|
+
import { MsalMockConfigurator } from './MsalMockConfigurator';
|
|
3
|
+
/**
|
|
4
|
+
* The MSAL module with a mock client instead of a live connection to Entra ID.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* Only `configure` differs from the real module. `initialize` is the production
|
|
8
|
+
* one, untouched, so proxy providers, host-provider hoisting and provider
|
|
9
|
+
* initialization all behave exactly as they do in production — and a test
|
|
10
|
+
* observes the real start-up path rather than a rehearsal of it.
|
|
11
|
+
*/
|
|
12
|
+
export const msalMockModule = {
|
|
13
|
+
...module,
|
|
14
|
+
configure: () => new MsalMockConfigurator(),
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Enables MSAL against a mock client, so a test needs no credentials and no network.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* Registered last, this replaces whichever auth module the configurator already
|
|
21
|
+
* carries, so it works on a `FrameworkConfigurator` that pre-registers the real one.
|
|
22
|
+
*
|
|
23
|
+
* @param configurator - The modules configurator to register on.
|
|
24
|
+
* @param configure - Optional callback to override the default mock client.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* enableMsalMock(configurator, (builder) => {
|
|
29
|
+
* builder.setAccount({ name: 'Ada Lovelace' });
|
|
30
|
+
* });
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export const enableMsalMock = (
|
|
34
|
+
// biome-ignore lint/suspicious/noExplicitAny: must be any to support all module types
|
|
35
|
+
configurator, configure) => {
|
|
36
|
+
configurator.addConfig({ module: msalMockModule, configure });
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../src/mock/module.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAmB,MAAM,WAAW,CAAC;AAEpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,cAAc,GAAe;IACxC,GAAG,MAAM;IACT,SAAS,EAAE,GAAG,EAAE,CAAC,IAAI,oBAAoB,EAAE;CAC5C,CAAC;AAUF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;AAC5B,sFAAsF;AACtF,YAA4C,EAC5C,SAA4B,EACtB,EAAE;IACR,YAAY,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,cAAc,EAAE,SAAS,EAEzD,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
import semver from 'semver';
|
|
3
|
+
import { CacheLookupPolicy } from '@azure/msal-browser';
|
|
4
|
+
import { TelemetryConfigSchema } from './telemetry-config-schema';
|
|
5
|
+
/**
|
|
6
|
+
* Zod schema for MSAL module configuration validation.
|
|
7
|
+
*
|
|
8
|
+
* @remarks
|
|
9
|
+
* Kept in its own module so the configuration can be extended at its source.
|
|
10
|
+
* The schema itself describes what reaches `MsalProvider` and strips anything
|
|
11
|
+
* else; keys a variant of this module needs only while the configuration is
|
|
12
|
+
* being built are declared on {@link MsalConfigExtension} instead.
|
|
13
|
+
*/
|
|
14
|
+
export const MsalConfigSchema = z.object({
|
|
15
|
+
client: z.custom().optional(),
|
|
16
|
+
provider: z.custom().optional(),
|
|
17
|
+
requiresAuth: z.boolean().optional(),
|
|
18
|
+
redirectUri: z.string().optional(),
|
|
19
|
+
loginHint: z.string().optional(),
|
|
20
|
+
authCode: z.string().optional(),
|
|
21
|
+
cacheLookupPolicy: z
|
|
22
|
+
.custom((val) => typeof val === 'number' &&
|
|
23
|
+
Object.values(CacheLookupPolicy).includes(val))
|
|
24
|
+
.optional(),
|
|
25
|
+
version: z.string().transform((value, ctx) => {
|
|
26
|
+
const coerced = semver.coerce(value);
|
|
27
|
+
// `semver.coerce` returns `null` for an unparseable version; without this guard it
|
|
28
|
+
// would silently become the literal string "null" instead of failing validation.
|
|
29
|
+
if (!coerced) {
|
|
30
|
+
ctx.addIssue({ code: z.ZodIssueCode.custom, message: 'Invalid MSAL module version' });
|
|
31
|
+
return z.NEVER;
|
|
32
|
+
}
|
|
33
|
+
return coerced.version;
|
|
34
|
+
}),
|
|
35
|
+
telemetry: TelemetryConfigSchema,
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=msal-config-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"msal-config-schema.js","sourceRoot":"","sources":["../../src/msal-config-schema.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AACpB,OAAO,MAAM,MAAM,QAAQ,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,EAAE,qBAAqB;CACjC,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import z from 'zod';
|
|
2
|
+
import { version } from './version';
|
|
3
|
+
/**
|
|
4
|
+
* Zod schema for telemetry configuration validation.
|
|
5
|
+
*
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export const TelemetryConfigSchema = z.object({
|
|
9
|
+
provider: z.custom().optional(),
|
|
10
|
+
metadata: z.record(z.string(), z.unknown()).optional().default({
|
|
11
|
+
module: 'msal',
|
|
12
|
+
version,
|
|
13
|
+
}),
|
|
14
|
+
scope: z.array(z.string()).optional().default(['framework', 'authentication']),
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=telemetry-config-schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"telemetry-config-schema.js","sourceRoot":"","sources":["../../src/telemetry-config-schema.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAsB,CAAC,QAAQ,EAAE;IACnD,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC;QAC7D,MAAM,EAAE,MAAM;QACd,OAAO;KACR,CAAC;IACF,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC;CAC/E,CAAC,CAAC"}
|
package/dist/esm/version.js
CHANGED
package/dist/esm/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,CAAC,MAAM,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC"}
|
|
@@ -24,7 +24,6 @@ import { version as latestVersionString } from '../version';
|
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
26
|
function mapVersionToEnumVersion(version) {
|
|
27
|
-
console.log('Resolving version:', version);
|
|
28
27
|
const coercedVersion = semver.coerce(version);
|
|
29
28
|
// An uncoercible version string cannot be mapped to a module version
|
|
30
29
|
if (!coercedVersion) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-version.js","sourceRoot":"","sources":["../../../src/versioning/resolve-version.ts"],"names":[],"mappings":"AAAA,OAAO,MAAuB,MAAM,QAAQ,CAAC;AAE7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAS,uBAAuB,CAAC,OAAwB;IACvD,
|
|
1
|
+
{"version":3,"file":"resolve-version.js","sourceRoot":"","sources":["../../../src/versioning/resolve-version.ts"],"names":[],"mappings":"AAAA,OAAO,MAAuB,MAAM,QAAQ,CAAC;AAE7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,SAAS,uBA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