@axa-fr/oidc-client 7.27.11 → 7.27.12

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
@@ -434,6 +434,36 @@ pnpm start
434
434
 
435
435
  ```
436
436
 
437
+ ## Service worker protocol
438
+
439
+ The `postMessage` protocol used between `OidcClient` and the service worker
440
+ is publicly documented and versioned. Typed message constants, payload
441
+ helpers and storage key conventions are exported from
442
+ `@axa-fr/oidc-client` (and from
443
+ `@axa-fr/oidc-client-service-worker/protocol`):
444
+
445
+ ```ts
446
+ import {
447
+ OidcClient,
448
+ PROTOCOL_VERSION,
449
+ ServiceWorkerMessageType,
450
+ buildSecuredTokenPlaceholder,
451
+ TOKEN_PLACEHOLDERS,
452
+ } from '@axa-fr/oidc-client';
453
+
454
+ const oidcClient = OidcClient.get();
455
+
456
+ const { state } = await oidcClient.signalServiceWorker<{ state: string }>({
457
+ type: ServiceWorkerMessageType.GET_STATE,
458
+ configurationName: 'default',
459
+ data: null,
460
+ });
461
+ ```
462
+
463
+ See [`PROTOCOL.md`](../oidc-client-service-worker/PROTOCOL.md) in the
464
+ service-worker package for the full specification, including stability
465
+ guarantees and per-message payload shapes.
466
+
437
467
  ## How It Works
438
468
 
439
469
  This component is a pure vanilla JS OIDC client library agnostic to any framework.
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ export type { ServiceWorkerSignalMessage, ServiceWorkerSignalOptions } from './initWorker.js';
2
+ export { signalServiceWorkerAsync } from './initWorker.js';
1
3
  export type { ILOidcLocation } from './location.js';
2
4
  export { OidcLocation } from './location.js';
3
5
  export { getFetchDefault } from './oidc.js';
@@ -5,6 +7,8 @@ export type { OidcUserInfo } from './oidcClient.js';
5
7
  export { OidcClient } from './oidcClient.js';
6
8
  export type { Tokens } from './parseTokens.js';
7
9
  export { TokenRenewMode } from './parseTokens.js';
10
+ export type { ServiceWorkerMessage, ServiceWorkerMessageTypeKey, ServiceWorkerMessageTypeValue, ServiceWorkerResponse, } from './protocol.js';
11
+ export { buildDpopSecuredPlaceholder, buildSecuredTokenPlaceholder, buildStorageKey, DPOP_TOKEN_PLACEHOLDER_PREFIX, isServiceWorkerMessageType, PROTOCOL_VERSION, ServiceWorkerMessageType, STORAGE_KEY_PREFIX, SW_CONTROLLER_CHANGE_RELOAD_COUNT_KEY, TOKEN_PLACEHOLDERS, } from './protocol.js';
8
12
  export { getParseQueryStringFromLocation, getPath } from './route-utils';
9
13
  export type { AuthorityConfiguration, Fetch, OidcConfiguration, StringMap } from './types.js';
10
14
  export { TokenAutomaticRenewMode } from './types.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,YAAY,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,+BAA+B,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACzE,YAAY,EAAE,sBAAsB,EAAE,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC9F,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAC9F,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,YAAY,EAAE,cA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