@servicetitan/mfe-shell-toolkit 0.0.1 → 0.1.6

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.
Files changed (117) hide show
  1. package/dist/auth/header-interceptor.d.ts +32 -0
  2. package/dist/auth/header-interceptor.d.ts.map +1 -0
  3. package/dist/auth/header-interceptor.js +72 -0
  4. package/dist/auth/header-interceptor.js.map +1 -0
  5. package/dist/auth/index.d.ts +8 -0
  6. package/dist/auth/index.d.ts.map +1 -0
  7. package/dist/auth/index.js +5 -0
  8. package/dist/auth/index.js.map +1 -0
  9. package/dist/auth/jwt-provisioner.d.ts +27 -0
  10. package/dist/auth/jwt-provisioner.d.ts.map +1 -0
  11. package/dist/auth/jwt-provisioner.js +128 -0
  12. package/dist/auth/jwt-provisioner.js.map +1 -0
  13. package/dist/auth/jwt.d.ts +8 -0
  14. package/dist/auth/jwt.d.ts.map +1 -0
  15. package/dist/auth/jwt.js +19 -0
  16. package/dist/auth/jwt.js.map +1 -0
  17. package/dist/auth/jwt.test.d.ts +2 -0
  18. package/dist/auth/jwt.test.d.ts.map +1 -0
  19. package/dist/auth/jwt.test.js +28 -0
  20. package/dist/auth/jwt.test.js.map +1 -0
  21. package/dist/auth/token-store.d.ts +12 -0
  22. package/dist/auth/token-store.d.ts.map +1 -0
  23. package/dist/auth/token-store.js +10 -0
  24. package/dist/auth/token-store.js.map +1 -0
  25. package/dist/index.d.ts +7 -0
  26. package/dist/index.d.ts.map +1 -0
  27. package/dist/index.js +14 -0
  28. package/dist/index.js.map +1 -0
  29. package/dist/ld/feature-flags-panel.d.ts +25 -0
  30. package/dist/ld/feature-flags-panel.d.ts.map +1 -0
  31. package/dist/ld/feature-flags-panel.js +27 -0
  32. package/dist/ld/feature-flags-panel.js.map +1 -0
  33. package/dist/ld/index.d.ts +5 -0
  34. package/dist/ld/index.d.ts.map +1 -0
  35. package/dist/ld/index.js +3 -0
  36. package/dist/ld/index.js.map +1 -0
  37. package/dist/ld/ld-service.d.ts +19 -0
  38. package/dist/ld/ld-service.d.ts.map +1 -0
  39. package/dist/ld/ld-service.js +57 -0
  40. package/dist/ld/ld-service.js.map +1 -0
  41. package/dist/mock/api-interceptor.d.ts +29 -0
  42. package/dist/mock/api-interceptor.d.ts.map +1 -0
  43. package/dist/mock/api-interceptor.js +76 -0
  44. package/dist/mock/api-interceptor.js.map +1 -0
  45. package/dist/mock/helpers.d.ts +11 -0
  46. package/dist/mock/helpers.d.ts.map +1 -0
  47. package/dist/mock/helpers.js +34 -0
  48. package/dist/mock/helpers.js.map +1 -0
  49. package/dist/mock/index.d.ts +4 -0
  50. package/dist/mock/index.d.ts.map +1 -0
  51. package/dist/mock/index.js +3 -0
  52. package/dist/mock/index.js.map +1 -0
  53. package/dist/shell-host/host-tokens.d.ts +2 -0
  54. package/dist/shell-host/host-tokens.d.ts.map +1 -0
  55. package/dist/shell-host/host-tokens.js +13 -0
  56. package/dist/shell-host/host-tokens.js.map +1 -0
  57. package/dist/shell-host/index.d.ts +5 -0
  58. package/dist/shell-host/index.d.ts.map +1 -0
  59. package/dist/shell-host/index.js +3 -0
  60. package/dist/shell-host/index.js.map +1 -0
  61. package/dist/shell-host/mfe-load-error-fallback.d.ts +15 -0
  62. package/dist/shell-host/mfe-load-error-fallback.d.ts.map +1 -0
  63. package/dist/shell-host/mfe-load-error-fallback.js +15 -0
  64. package/dist/shell-host/mfe-load-error-fallback.js.map +1 -0
  65. package/dist/shell-host/mfe-loader.d.ts +22 -0
  66. package/dist/shell-host/mfe-loader.d.ts.map +1 -0
  67. package/dist/shell-host/mfe-loader.js +14 -0
  68. package/dist/shell-host/mfe-loader.js.map +1 -0
  69. package/dist/store/index.d.ts +3 -0
  70. package/dist/store/index.d.ts.map +1 -0
  71. package/dist/store/index.js +3 -0
  72. package/dist/store/index.js.map +1 -0
  73. package/dist/store/store.d.ts +22 -0
  74. package/dist/store/store.d.ts.map +1 -0
  75. package/dist/store/store.js +117 -0
  76. package/dist/store/store.js.map +1 -0
  77. package/dist/store/store.test.d.ts +2 -0
  78. package/dist/store/store.test.d.ts.map +1 -0
  79. package/dist/store/store.test.js +106 -0
  80. package/dist/store/store.test.js.map +1 -0
  81. package/dist/store/use-store.d.ts +5 -0
  82. package/dist/store/use-store.d.ts.map +1 -0
  83. package/dist/store/use-store.js +11 -0
  84. package/dist/store/use-store.js.map +1 -0
  85. package/dist/toolbar/combobox-dropdown.d.ts +23 -0
  86. package/dist/toolbar/combobox-dropdown.d.ts.map +1 -0
  87. package/dist/toolbar/combobox-dropdown.js +24 -0
  88. package/dist/toolbar/combobox-dropdown.js.map +1 -0
  89. package/dist/toolbar/index.d.ts +8 -0
  90. package/dist/toolbar/index.d.ts.map +1 -0
  91. package/dist/toolbar/index.js +5 -0
  92. package/dist/toolbar/index.js.map +1 -0
  93. package/dist/toolbar/panel.d.ts +12 -0
  94. package/dist/toolbar/panel.d.ts.map +1 -0
  95. package/dist/toolbar/panel.js +33 -0
  96. package/dist/toolbar/panel.js.map +1 -0
  97. package/dist/toolbar/styles.d.ts +27 -0
  98. package/dist/toolbar/styles.d.ts.map +1 -0
  99. package/dist/toolbar/styles.js +138 -0
  100. package/dist/toolbar/styles.js.map +1 -0
  101. package/dist/toolbar/use-search-combobox.d.ts +57 -0
  102. package/dist/toolbar/use-search-combobox.d.ts.map +1 -0
  103. package/dist/toolbar/use-search-combobox.js +153 -0
  104. package/dist/toolbar/use-search-combobox.js.map +1 -0
  105. package/dist/version-picker/index.d.ts +5 -0
  106. package/dist/version-picker/index.d.ts.map +1 -0
  107. package/dist/version-picker/index.js +3 -0
  108. package/dist/version-picker/index.js.map +1 -0
  109. package/dist/version-picker/mfe-source-list.d.ts +18 -0
  110. package/dist/version-picker/mfe-source-list.d.ts.map +1 -0
  111. package/dist/version-picker/mfe-source-list.js +92 -0
  112. package/dist/version-picker/mfe-source-list.js.map +1 -0
  113. package/dist/version-picker/verdaccio-client.d.ts +33 -0
  114. package/dist/version-picker/verdaccio-client.d.ts.map +1 -0
  115. package/dist/version-picker/verdaccio-client.js +56 -0
  116. package/dist/version-picker/verdaccio-client.js.map +1 -0
  117. package/package.json +71 -2
@@ -0,0 +1,32 @@
1
+ export interface HeaderInterceptorConfig {
2
+ /** Whether this request should get headers attached at all (origin/path match). */
3
+ isMatch(url: URL): boolean;
4
+ /**
5
+ * Computed fresh on every matching request. Only headers not already present on the request
6
+ * are set — a caller-supplied header always wins over an injected one.
7
+ */
8
+ headersFor(url: URL): Record<string, string>;
9
+ }
10
+ declare const ATTACH_FLAG: "__mfeShellAttachHeaders";
11
+ declare global {
12
+ interface XMLHttpRequest {
13
+ [ATTACH_FLAG]?: URL;
14
+ }
15
+ }
16
+ /**
17
+ * Monkey-patches both `window.fetch` and `XMLHttpRequest` so requests matching `config.isMatch`
18
+ * get whatever headers `config.headersFor` computes attached — the mechanism behind both a
19
+ * JWT-bearer auth strategy (headers = `{ Authorization: Bearer <token> }`) and a static
20
+ * header-injection strategy (headers = a config-driven map, e.g. `X-Auth-Request-Email` or
21
+ * `ST-Api-Key`/`ST-Environment-Id`). Patching both transports matters because a bundled MFE's own
22
+ * HTTP client may use either depending on its build (axios can be configured to use either).
23
+ *
24
+ * Call this once. Call it BEFORE any api-interceptor that rewrites a BFF-relative URL to the real
25
+ * upstream origin — the fetch-wrapper chain runs last-registered-outermost (whatever installs last
26
+ * sees a call first), so installing the URL-rewriter LAST makes it the outer layer that rewrites
27
+ * the URL before this one's `isMatch` ever runs, letting `isMatch` match against the real upstream
28
+ * origin instead of the original same-origin BFF path.
29
+ */
30
+ export declare function installHeaderInterceptor(config: HeaderInterceptorConfig): void;
31
+ export {};
32
+ //# sourceMappingURL=header-interceptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"header-interceptor.d.ts","sourceRoot":"","sources":["../../src/auth/header-interceptor.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,uBAAuB;IACpC,mFAAmF;IACnF,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,OAAO,CAAC;IAC3B;;;OAGG;IACH,UAAU,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChD;AAED,QAAA,MAAM,WAAW,EAAG,yBAAkC,CAAC;AAEvD,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,cAAc;QACpB,CAAC,WAAW,CAAC,CAAC,EAAE,GAAG,CAAC;KACvB;CACJ;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,uBAAuB,GAAG,IAAI,CAG9E"}
@@ -0,0 +1,72 @@
1
+ const ATTACH_FLAG = '__mfeShellAttachHeaders';
2
+ /**
3
+ * Monkey-patches both `window.fetch` and `XMLHttpRequest` so requests matching `config.isMatch`
4
+ * get whatever headers `config.headersFor` computes attached — the mechanism behind both a
5
+ * JWT-bearer auth strategy (headers = `{ Authorization: Bearer <token> }`) and a static
6
+ * header-injection strategy (headers = a config-driven map, e.g. `X-Auth-Request-Email` or
7
+ * `ST-Api-Key`/`ST-Environment-Id`). Patching both transports matters because a bundled MFE's own
8
+ * HTTP client may use either depending on its build (axios can be configured to use either).
9
+ *
10
+ * Call this once. Call it BEFORE any api-interceptor that rewrites a BFF-relative URL to the real
11
+ * upstream origin — the fetch-wrapper chain runs last-registered-outermost (whatever installs last
12
+ * sees a call first), so installing the URL-rewriter LAST makes it the outer layer that rewrites
13
+ * the URL before this one's `isMatch` ever runs, letting `isMatch` match against the real upstream
14
+ * origin instead of the original same-origin BFF path.
15
+ */
16
+ export function installHeaderInterceptor(config) {
17
+ patchFetch(config);
18
+ patchXhr(config);
19
+ }
20
+ function resolveUrl(input) {
21
+ try {
22
+ return new URL(input, window.location.href);
23
+ }
24
+ catch (_a) {
25
+ return null;
26
+ }
27
+ }
28
+ function patchFetch(config) {
29
+ const originalFetch = window.fetch.bind(window);
30
+ window.fetch = (input, init) => {
31
+ var _a;
32
+ const rawUrl = typeof input === 'string' ? input : input instanceof URL ? input.href : input.url;
33
+ const url = resolveUrl(rawUrl);
34
+ if (!url || !config.isMatch(url)) {
35
+ return originalFetch(input, init);
36
+ }
37
+ const baseHeaders = (_a = init === null || init === void 0 ? void 0 : init.headers) !== null && _a !== void 0 ? _a : (input instanceof Request ? input.headers : undefined);
38
+ const headers = new Headers(baseHeaders);
39
+ for (const [name, value] of Object.entries(config.headersFor(url))) {
40
+ if (!headers.has(name)) {
41
+ headers.set(name, value);
42
+ }
43
+ }
44
+ return originalFetch(input, { ...init, headers });
45
+ };
46
+ }
47
+ function patchXhr(config) {
48
+ const proto = XMLHttpRequest.prototype;
49
+ const originalOpen = proto.open;
50
+ const originalSend = proto.send;
51
+ proto.open = function open(method, url, async, username, password) {
52
+ const resolved = resolveUrl(url);
53
+ this[ATTACH_FLAG] = resolved && config.isMatch(resolved) ? resolved : undefined;
54
+ return originalOpen.call(this, method, url, async !== null && async !== void 0 ? async : true, username !== null && username !== void 0 ? username : null, password !== null && password !== void 0 ? password : null);
55
+ };
56
+ proto.send = function send(body) {
57
+ const matchedUrl = this[ATTACH_FLAG];
58
+ if (matchedUrl) {
59
+ for (const [name, value] of Object.entries(config.headersFor(matchedUrl))) {
60
+ // Header may already be sent (e.g. a CORS preflight in flight) — ignore.
61
+ try {
62
+ this.setRequestHeader(name, value);
63
+ }
64
+ catch (_a) {
65
+ // ignore
66
+ }
67
+ }
68
+ }
69
+ return originalSend.call(this, body !== null && body !== void 0 ? body : null);
70
+ };
71
+ }
72
+ //# sourceMappingURL=header-interceptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"header-interceptor.js","sourceRoot":"","sources":["../../src/auth/header-interceptor.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,GAAG,yBAAkC,CAAC;AAQvD;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,wBAAwB,CAAC,MAA+B;IACpE,UAAU,CAAC,MAAM,CAAC,CAAC;IACnB,QAAQ,CAAC,MAAM,CAAC,CAAC;AACrB,CAAC;AA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gBAAgB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;gBACvC,CAAC;gBAAC,WAAM,CAAC;oBACL,SAAS;gBACb,CAAC;YACL,CAAC;QACL,CAAC;QACD,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,aAAJ,IAAI,cAAJ,IAAI,GAAI,IAAI,CAAC,CAAC;IACjD,CAAC,CAAC;AACN,CAAC"}
@@ -0,0 +1,8 @@
1
+ export { decodeJwtPayload } from './jwt';
2
+ export { installHeaderInterceptor } from './header-interceptor';
3
+ export type { HeaderInterceptorConfig } from './header-interceptor';
4
+ export { createTokenStore, clearToken } from './token-store';
5
+ export type { TokenState } from './token-store';
6
+ export { createJwtProvisioner } from './jwt-provisioner';
7
+ export type { JwtProvisioner, JwtProvisionerConfig } from './jwt-provisioner';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC7D,YAAY,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,YAAY,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { decodeJwtPayload } from './jwt';
2
+ export { installHeaderInterceptor } from './header-interceptor';
3
+ export { createTokenStore, clearToken } from './token-store';
4
+ export { createJwtProvisioner } from './jwt-provisioner';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AACzC,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { Store } from '../store/store';
2
+ import { TokenState } from './token-store';
3
+ export interface JwtProvisionerConfig {
4
+ tokenStore: Store<TokenState>;
5
+ /** Builds the claims payload for the current selection. Return `null` when there isn't enough picked yet to mint (e.g. no tenant selected) — the provisioner then skips minting and leaves any prior token in place. */
6
+ buildClaims(): Record<string, unknown> | null;
7
+ /** Full URL to POST claims to. Return `null` when not configured yet. */
8
+ mintUrl(): string | null;
9
+ /** Registers a callback the provisioner re-evaluates mint-worthiness on. Call your store's own `subscribe` inside this. */
10
+ subscribe(onChange: () => void): void;
11
+ }
12
+ export interface JwtProvisioner {
13
+ /** Mints immediately if the cached token is missing/expiring soon, then subscribes for future re-mints. Idempotent. */
14
+ start(): void;
15
+ /** Force a re-mint (e.g. from a toolbar "Refresh token" button). */
16
+ refresh(): Promise<void>;
17
+ }
18
+ /**
19
+ * Owns the lifecycle of a shell-minted JWT: mints on startup if needed, re-mints whenever the
20
+ * caller's claims actually change (deduped by comparing the claims JSON + mint URL against the
21
+ * last successfully sent pair, not merely "some event fired"), coalesces rapid-fire changes into
22
+ * one trailing re-mint with the latest value instead of minting once per change, and proactively
23
+ * schedules a refresh ahead of the token's own `exp` claim so the MFE never sees a 401 from an
24
+ * expired token under normal use.
25
+ */
26
+ export declare function createJwtProvisioner(config: JwtProvisionerConfig): JwtProvisioner;
27
+ //# sourceMappingURL=jwt-provisioner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jwt-provisioner.d.ts","sourceRoot":"","sources":["../../src/auth/jwt-provisioner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAK3C,MAAM,WAAW,oBAAoB;IACjC,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAC9B,wNAAwN;IACxN,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC9C,yEAAyE;IACzE,OAAO,IAAI,MAAM,GAAG,IAAI,CAAC;IACzB,2HAA2H;IAC3H,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI,CAAC;CACzC;AAED,MAAM,WAAW,cAAc;IAC3B,uHAAuH;IACvH,KAAK,IAAI,IAAI,CAAC;IACd,oEAAoE;IACpE,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC5B;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,oBAAoB,GAAG,cAAc,CA2HjF"}
@@ -0,0 +1,128 @@
1
+ import { decodeJwtPayload } from './jwt';
2
+ /** Refresh this many ms before the token's `exp` so a slightly slow request still rides. */
3
+ const REFRESH_HEADROOM_MS = 60000;
4
+ /**
5
+ * Owns the lifecycle of a shell-minted JWT: mints on startup if needed, re-mints whenever the
6
+ * caller's claims actually change (deduped by comparing the claims JSON + mint URL against the
7
+ * last successfully sent pair, not merely "some event fired"), coalesces rapid-fire changes into
8
+ * one trailing re-mint with the latest value instead of minting once per change, and proactively
9
+ * schedules a refresh ahead of the token's own `exp` claim so the MFE never sees a 401 from an
10
+ * expired token under normal use.
11
+ */
12
+ export function createJwtProvisioner(config) {
13
+ const { tokenStore, buildClaims, mintUrl, subscribe } = config;
14
+ let refreshTimer = null;
15
+ let inFlight = null;
16
+ /*
17
+ * Set when a re-mint is requested while one is already in flight. Without this, a change that
18
+ * arrives mid-flight would be silently dropped — e.g. typing "555" into an override field fires
19
+ * a change per keystroke; only the mint kicked off by the first keystroke would reach the wire,
20
+ * minting for an intermediate value instead of the final one.
21
+ */
22
+ let mintAgainRequested = false;
23
+ let started = false;
24
+ let lastSentClaimsJson = null;
25
+ let lastMintUrl = null;
26
+ function isExpired(expiresAt) {
27
+ if (expiresAt === null) {
28
+ return true;
29
+ }
30
+ return expiresAt - Date.now() < REFRESH_HEADROOM_MS;
31
+ }
32
+ function readJwtExpiry(token) {
33
+ const payload = decodeJwtPayload(token);
34
+ return typeof (payload === null || payload === void 0 ? void 0 : payload.exp) === 'number' ? payload.exp * 1000 : null;
35
+ }
36
+ function clearRefreshTimer() {
37
+ if (refreshTimer !== null) {
38
+ clearTimeout(refreshTimer);
39
+ refreshTimer = null;
40
+ }
41
+ }
42
+ function scheduleRefresh(expiresAt) {
43
+ clearRefreshTimer();
44
+ const delay = Math.max(1000, expiresAt - Date.now() - REFRESH_HEADROOM_MS);
45
+ refreshTimer = setTimeout(() => {
46
+ void mintNow();
47
+ }, delay);
48
+ }
49
+ function mintNow() {
50
+ if (inFlight) {
51
+ mintAgainRequested = true;
52
+ return inFlight;
53
+ }
54
+ const url = mintUrl();
55
+ const claims = buildClaims();
56
+ if (!url || claims === null) {
57
+ return Promise.resolve();
58
+ }
59
+ clearRefreshTimer();
60
+ inFlight = (async () => {
61
+ try {
62
+ const response = await fetch(url, {
63
+ method: 'POST',
64
+ credentials: 'include',
65
+ headers: { 'Content-Type': 'text/plain' },
66
+ body: JSON.stringify(claims),
67
+ });
68
+ if (!response.ok) {
69
+ const text = await response.text().catch(() => '');
70
+ throw new Error(`${response.status} ${response.statusText}${text ? `\n${text}` : ''}`);
71
+ }
72
+ const json = (await response.json());
73
+ const expiresAt = readJwtExpiry(json.token);
74
+ tokenStore.set({ token: json.token, expiresAt, error: null });
75
+ lastSentClaimsJson = JSON.stringify(claims);
76
+ lastMintUrl = url;
77
+ if (expiresAt !== null) {
78
+ scheduleRefresh(expiresAt);
79
+ }
80
+ }
81
+ catch (e) {
82
+ const msg = e instanceof Error ? e.message : String(e);
83
+ tokenStore.set({ ...tokenStore.get(), error: msg });
84
+ }
85
+ finally {
86
+ inFlight = null;
87
+ if (mintAgainRequested) {
88
+ mintAgainRequested = false;
89
+ void mintNow();
90
+ }
91
+ }
92
+ })();
93
+ return inFlight;
94
+ }
95
+ function handlePossibleChange() {
96
+ const url = mintUrl();
97
+ const claims = buildClaims();
98
+ if (!url || claims === null) {
99
+ return;
100
+ }
101
+ const claimsJson = JSON.stringify(claims);
102
+ if (claimsJson === lastSentClaimsJson && url === lastMintUrl) {
103
+ return;
104
+ }
105
+ void mintNow();
106
+ }
107
+ return {
108
+ start() {
109
+ if (started) {
110
+ return;
111
+ }
112
+ started = true;
113
+ subscribe(handlePossibleChange);
114
+ const cached = tokenStore.get();
115
+ if (!cached.token || isExpired(cached.expiresAt)) {
116
+ handlePossibleChange();
117
+ }
118
+ else {
119
+ // isExpired(null) is always true, so reaching here guarantees expiresAt is non-null.
120
+ scheduleRefresh(cached.expiresAt);
121
+ }
122
+ },
123
+ refresh() {
124
+ return mintNow();
125
+ },
126
+ };
127
+ }
128
+ //# sourceMappingURL=jwt-provisioner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jwt-provisioner.js","sourceRoot":"","sources":["../../src/auth/jwt-provisioner.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAGzC,4FAA4F;AAC5F,MAAM,mBAAmB,GAAG,KAAM,CAAC;AAmBnC;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAA4B;IAC7D,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;IAE/D,IAAI,YAAY,GAAyC,IAAI,CAAC;IAC9D,IAAI,QAAQ,GAAyB,IAAI,CAAC;IAC1C;;;;;OAKG;IACH,IAAI,kBAAkB,GAAG,KAAK,CAAC;IAC/B,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,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eAAe,CAAC,MAAM,CAAC,SAAU,CAAC,CAAC;YACvC,CAAC;QACL,CAAC;QACD,OAAO;YACH,OAAO,OAAO,EAAE,CAAC;QACrB,CAAC;KACJ,CAAC;AACN,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Decodes the payload segment of an unverified JWT — used both to read an `exp` claim for refresh
3
+ * scheduling and to render a decoded payload in an auth panel.
4
+ *
5
+ * Never verifies the signature. Returns `null` if the input isn't a well-formed JWT.
6
+ */
7
+ export declare function decodeJwtPayload<T = unknown>(token: string): T | null;
8
+ //# sourceMappingURL=jwt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jwt.d.ts","sourceRoot":"","sources":["../../src/auth/jwt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,GAAG,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,CASrE"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Decodes the payload segment of an unverified JWT — used both to read an `exp` claim for refresh
3
+ * scheduling and to render a decoded payload in an auth panel.
4
+ *
5
+ * Never verifies the signature. Returns `null` if the input isn't a well-formed JWT.
6
+ */
7
+ export function decodeJwtPayload(token) {
8
+ var _a;
9
+ try {
10
+ const segment = (_a = token.split('.')[1]) !== null && _a !== void 0 ? _a : '';
11
+ const padLen = (4 - (segment.length % 4)) % 4;
12
+ const standard = (segment + '='.repeat(padLen)).replace(/-/g, '+').replace(/_/g, '/');
13
+ return JSON.parse(atob(standard));
14
+ }
15
+ catch (_b) {
16
+ return null;
17
+ }
18
+ }
19
+ //# sourceMappingURL=jwt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jwt.js","sourceRoot":"","sources":["../../src/auth/jwt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAc,KAAa;;IACvD,IAAI,CAAC;QACD,MAAM,OAAO,GAAG,MAAA,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,mCAAI,EAAE,CAAC;QAC1C,MAAM,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QAC9C,MAAM,QAAQ,GAAG,CAAC,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;QACtF,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAM,CAAC;IAC3C,CAAC;IAAC,WAAM,CAAC;QACL,OAAO,IAAI,CAAC;IAChB,CAAC;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=jwt.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jwt.test.d.ts","sourceRoot":"","sources":["../../src/auth/jwt.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,28 @@
1
+ import { decodeJwtPayload } from './jwt';
2
+ function toBase64Url(json) {
3
+ return btoa(JSON.stringify(json)).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '');
4
+ }
5
+ function fakeJwt(payload) {
6
+ return `${toBase64Url({ alg: 'none' })}.${toBase64Url(payload)}.signature-not-checked`;
7
+ }
8
+ describe('decodeJwtPayload', () => {
9
+ it('decodes a well-formed payload segment', () => {
10
+ expect(decodeJwtPayload(fakeJwt({ sub: 'user-1', exp: 123 }))).toEqual({ sub: 'user-1', exp: 123 });
11
+ });
12
+ it('decodes payloads whose base64url length needs padding', () => {
13
+ // Deliberately pick payloads whose base64 length isn't a multiple of 4 once unpadded.
14
+ expect(decodeJwtPayload(fakeJwt({ a: 1 }))).toEqual({ a: 1 });
15
+ expect(decodeJwtPayload(fakeJwt({ ab: 12 }))).toEqual({ ab: 12 });
16
+ });
17
+ it('returns null for a token with no payload segment', () => {
18
+ expect(decodeJwtPayload('only-one-segment')).toBeNull();
19
+ });
20
+ it('returns null for a payload segment that is not valid base64', () => {
21
+ expect(decodeJwtPayload('header.not!valid!base64.sig')).toBeNull();
22
+ });
23
+ it('returns null for a payload segment that decodes but is not valid JSON', () => {
24
+ const notJson = btoa('not-json-at-all');
25
+ expect(decodeJwtPayload(`header.${notJson}.sig`)).toBeNull();
26
+ });
27
+ });
28
+ //# sourceMappingURL=jwt.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jwt.test.js","sourceRoot":"","sources":["../../src/auth/jwt.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAEzC,SAAS,WAAW,CAAC,IAAa;IAC9B,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;AACjG,CAAC;AAED,SAAS,OAAO,CAAC,OAAgB;IAC7B,OAAO,GAAG,WAAW,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,IAAI,WAAW,CAAC,OAAO,CAAC,wBAAwB,CAAC;AAC3F,CAAC;AAED,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAC9B,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE;QAC7C,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;IACxG,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uDAAuD,EAAE,GAAG,EAAE;QAC7D,sFAAsF;QACtF,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;QAC9D,MAAM,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;QACxD,MAAM,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;IAC5D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6DAA6D,EAAE,GAAG,EAAE;QACnE,MAAM,CAAC,gBAAgB,CAAC,6BAA6B,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;IACvE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uEAAuE,EAAE,GAAG,EAAE;QAC7E,MAAM,OAAO,GAAG,IAAI,CAAC,iBAAiB,CAAC,CAAC;QACxC,MAAM,CAAC,gBAAgB,CAAC,UAAU,OAAO,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;IACjE,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { Store } from '../store/store';
2
+ export interface TokenState {
3
+ token: string | null;
4
+ /** Epoch ms when the token's `exp` claim says it stops being valid. */
5
+ expiresAt: number | null;
6
+ /** Last mint error surface for an auth panel. Cleared on a successful mint. */
7
+ error: string | null;
8
+ }
9
+ /** A persisted {@link Store} for one minted token's lifecycle. `persistKey` should be unique per shell, e.g. `"my-shell:token"`. */
10
+ export declare function createTokenStore(persistKey: string): Store<TokenState>;
11
+ export declare function clearToken(tokenStore: Store<TokenState>): void;
12
+ //# sourceMappingURL=token-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token-store.d.ts","sourceRoot":"","sources":["../../src/auth/token-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,MAAM,WAAW,UAAU;IACvB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,uEAAuE;IACvE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,+EAA+E;IAC/E,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAID,oIAAoI;AACpI,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,CAEtE;AAED,wBAAgB,UAAU,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,GAAG,IAAI,CAE9D"}
@@ -0,0 +1,10 @@
1
+ import { Store } from '../store/store';
2
+ const EMPTY = { token: null, expiresAt: null, error: null };
3
+ /** A persisted {@link Store} for one minted token's lifecycle. `persistKey` should be unique per shell, e.g. `"my-shell:token"`. */
4
+ export function createTokenStore(persistKey) {
5
+ return new Store(EMPTY, persistKey);
6
+ }
7
+ export function clearToken(tokenStore) {
8
+ tokenStore.set(EMPTY);
9
+ }
10
+ //# sourceMappingURL=token-store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"token-store.js","sourceRoot":"","sources":["../../src/auth/token-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAUvC,MAAM,KAAK,GAAe,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAExE,oIAAoI;AACpI,MAAM,UAAU,gBAAgB,CAAC,UAAkB;IAC/C,OAAO,IAAI,KAAK,CAAa,KAAK,EAAE,UAAU,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,UAA6B;IACpD,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,7 @@
1
+ export * from './store';
2
+ export * from './shell-host';
3
+ export * from './toolbar';
4
+ export * from './version-picker';
5
+ export * from './mock';
6
+ export * from './auth';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,14 @@
1
+ /*
2
+ * The `ld` module is deliberately NOT re-exported here — it imports `@servicetitan/launchdarkly-service`
3
+ * and `launchdarkly-js-client-sdk` at the module level, both optional peer dependencies. Importing
4
+ * anything from this root barrel must never force a consumer that doesn't use LaunchDarkly to
5
+ * resolve those packages. Consumers that do want it import it directly:
6
+ * import { createShellLDService, FeatureFlagsPanel } from '@servicetitan/mfe-shell-toolkit/dist/ld';
7
+ */
8
+ export * from './store';
9
+ export * from './shell-host';
10
+ export * from './toolbar';
11
+ export * from './version-picker';
12
+ export * from './mock';
13
+ export * from './auth';
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { FC } from 'react';
2
+ export interface KnownFlag {
3
+ key: string;
4
+ label: string;
5
+ type?: 'boolean' | 'number';
6
+ }
7
+ export interface FeatureFlagsPanelProps {
8
+ /**
9
+ * Flags the shell knows about by name, rendered with a friendly boolean/number control.
10
+ * Deliberately explicit rather than introspected from the MFE package — an MFE source can be
11
+ * pointed at any published bundle via the version picker, so the shell can't assume it's
12
+ * running the flag set the currently-checked-out MFE source declares. Anything else can still
13
+ * be overridden via the free-form "Custom overrides" rows.
14
+ */
15
+ knownFlags: readonly KnownFlag[];
16
+ overridesEnabled: boolean;
17
+ overrides: Record<string, string>;
18
+ onOverridesEnabledChange: (enabled: boolean) => void;
19
+ onSetOverride: (key: string, rawValue: string) => void;
20
+ onRemoveOverride: (key: string) => void;
21
+ /** Remount the MFE so its LaunchDarkly client picks up the current overrides. */
22
+ onReload: () => void;
23
+ }
24
+ export declare const FeatureFlagsPanel: FC<FeatureFlagsPanelProps>;
25
+ //# sourceMappingURL=feature-flags-panel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feature-flags-panel.d.ts","sourceRoot":"","sources":["../../src/ld/feature-flags-panel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAe,EAAE,EAAsB,MAAM,OAAO,CAAC;AAW5D,MAAM,WAAW,SAAS;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAC;CAC/B;AAED,MAAM,WAAW,sBAAsB;IACnC;;;;;;OAMG;IACH,UAAU,EAAE,SAAS,SAAS,EAAE,CAAC;IACjC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,wBAAwB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACrD,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACvD,gBAAgB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,iFAAiF;IACjF,QAAQ,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CA8IxD,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Fragment, useState } from 'react';
3
+ import { FieldLabel, Panel } from '../toolbar/panel';
4
+ import { buttonStyle, fieldStyle, flagLabelStyle, helpTextStyle, inlineFieldRowStyle, toggleLabelStyle, } from '../toolbar/styles';
5
+ export const FeatureFlagsPanel = ({ knownFlags, overridesEnabled, overrides, onOverridesEnabledChange, onSetOverride, onRemoveOverride, onReload, }) => {
6
+ const [newKey, setNewKey] = useState('');
7
+ const [newValue, setNewValue] = useState('');
8
+ const addCustomOverride = () => {
9
+ const key = newKey.trim();
10
+ if (!key || key in overrides) {
11
+ return;
12
+ }
13
+ onSetOverride(key, newValue);
14
+ setNewKey('');
15
+ setNewValue('');
16
+ };
17
+ const knownFlagKeys = new Set(knownFlags.map(f => f.key));
18
+ const customEntries = Object.entries(overrides).filter(([key]) => !knownFlagKeys.has(key));
19
+ return (_jsxs(Panel, { title: "Feature flags", children: [_jsxs("label", { style: toggleLabelStyle, children: [_jsx("input", { type: "checkbox", checked: overridesEnabled, onChange: e => onOverridesEnabledChange(e.target.checked) }), _jsxs("span", { children: [_jsx("strong", { children: "Override flags" }), _jsx("span", { style: { ...helpTextStyle, display: 'block', margin: '0.15rem 0 0' }, children: "When on, the MFE's LaunchDarkly client serves the values below for any overridden key and falls through to real LaunchDarkly evaluation for everything else." })] })] }), overridesEnabled ? (_jsxs(Fragment, { children: [_jsx(FieldLabel, { children: "Known flags" }), knownFlags.map(({ key, label, type = 'boolean' }) => {
20
+ const isOverridden = key in overrides;
21
+ const boolValue = overrides[key] === 'true';
22
+ return (_jsxs("div", { style: { marginBottom: '0.4rem' }, children: [_jsxs("label", { style: flagLabelStyle, children: [_jsx("input", { type: "checkbox", checked: isOverridden, onChange: e => e.target.checked
23
+ ? onSetOverride(key, type === 'number' ? '0' : 'true')
24
+ : onRemoveOverride(key) }), _jsxs("span", { children: [label, " ", _jsx("code", { style: { opacity: 0.6 }, children: key })] })] }), isOverridden && type === 'boolean' && (_jsxs("label", { style: { ...flagLabelStyle, marginLeft: '1.4rem' }, children: [_jsx("input", { type: "checkbox", checked: boolValue, onChange: e => onSetOverride(key, String(e.target.checked)) }), _jsxs("span", { children: ["value: ", String(boolValue)] })] })), isOverridden && type === 'number' && (_jsxs("label", { style: { ...flagLabelStyle, marginLeft: '1.4rem' }, children: [_jsx("span", { children: "value:" }), _jsx("input", { type: "number", value: overrides[key], onChange: e => onSetOverride(key, e.target.value), style: { ...fieldStyle, width: '5rem', marginLeft: '0.4rem' } })] }))] }, key));
25
+ }), _jsx(FieldLabel, { children: "Custom overrides" }), _jsxs("p", { style: helpTextStyle, children: ["Any other flag key. Values are parsed as JSON (", _jsx("code", { children: "true" }), ", ", _jsx("code", { children: "\"foo\"" }), ",", ' ', _jsx("code", { children: "42" }), ", ", _jsx("code", { children: '{"a":1}' }), ") \u2014 falls back to the raw string if parsing fails."] }), customEntries.map(([key, rawValue]) => (_jsxs("div", { style: inlineFieldRowStyle, children: [_jsx("code", { style: { ...fieldStyle, flex: '0 0 auto', minWidth: '8ch' }, children: key }), _jsx("input", { value: rawValue, onChange: (e) => onSetOverride(key, e.target.value), style: fieldStyle }), _jsx("button", { type: "button", onClick: () => onRemoveOverride(key), style: buttonStyle, title: "Remove override", children: "\u00D7" })] }, key))), _jsxs("div", { style: { ...inlineFieldRowStyle, marginTop: '0.4rem' }, children: [_jsx("input", { value: newKey, onChange: e => setNewKey(e.target.value), placeholder: "flag key", style: fieldStyle }), _jsx("input", { value: newValue, onChange: e => setNewValue(e.target.value), placeholder: "value", style: fieldStyle }), _jsx("button", { type: "button", onClick: addCustomOverride, style: buttonStyle, title: "Add override", children: "+" })] }), _jsx("button", { type: "button", onClick: onReload, style: { ...buttonStyle, width: '100%', marginTop: '0.75rem' }, title: "Remount the MFE so its LaunchDarkly client picks up the current overrides", children: "Reload MFE with flag overrides" })] })) : null] }));
26
+ };
27
+ //# sourceMappingURL=feature-flags-panel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feature-flags-panel.js","sourceRoot":"","sources":["../../src/ld/feature-flags-panel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAmB,QAAQ,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EACH,WAAW,EACX,UAAU,EACV,cAAc,EACd,aAAa,EACb,mBAAmB,EACnB,gBAAgB,GACnB,MAAM,mBAAmB,CAAC;AA0B3B,MAAM,CAAC,MAAM,iBAAiB,GAA+B,CAAC,EAC1D,UAAU,EACV,gBAAgB,EAChB,SAAS,EACT,wBAAwB,EACxB,aAAa,EACb,gBAAgB,EAChB,QAAQ,GACX,EAAE,EAAE;IACD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IACzC,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAE7C,MAAM,iBAAiB,GAAG,GAAS,EAAE;QACjC,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;QAC1B,IAAI,CAAC,GAAG,IAAI,GAAG,IAAI,SAAS,EAAE,CAAC;YAC3B,OAAO;QACX,CAAC;QACD,aAAa,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QAC7B,SAAS,CAAC,EAAE,CAAC,CAAC;QACd,WAAW,CAAC,EAAE,CAAC,CAAC;IACpB,CAAC,CAAC;IAEF,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1D,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,MAA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
+ export { FeatureFlagsPanel } from './feature-flags-panel';
4
+ export type { FeatureFlagsPanelProps, KnownFlag } from './feature-flags-panel';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ld/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,YAAY,EAAE,sBAAsB,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { createShellLDService } from './ld-service';
2
+ export { FeatureFlagsPanel } from './feature-flags-panel';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ld/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { LDService } from '@servicetitan/launchdarkly-service';
2
+ export interface LdOverrideState {
3
+ /** The context key to scope the LD client to (e.g. the current tenant slug/id). */
4
+ contextKey: string;
5
+ /** `LDContext.kind` — defaults to `'tenant'` if omitted. */
6
+ contextKind?: string;
7
+ overridesEnabled: boolean;
8
+ /** Raw override values, each parsed as JSON (falling back to the raw string on parse failure). */
9
+ overrides: Record<string, string>;
10
+ }
11
+ /**
12
+ * Hands an MFE an `LDClient` scoped by whatever the shell currently has selected (typically the
13
+ * current tenant), ignoring whatever context the MFE itself would otherwise pass — the shell owns
14
+ * this context so the MFE can stay generic about where its LD context comes from. `getState` is
15
+ * read fresh on every `getClient()` call, which fires exactly once per Loader mount, so a "Reload
16
+ * MFE" action already picks up the current selection without any extra plumbing.
17
+ */
18
+ export declare function createShellLDService(clientSideId: string, getState: () => LdOverrideState): LDService;
19
+ //# sourceMappingURL=ld-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ld-service.d.ts","sourceRoot":"","sources":["../../src/ld/ld-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAG5E,MAAM,WAAW,eAAe;IAC5B,mFAAmF;IACnF,UAAU,EAAE,MAAM,CAAC;IACnB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,kGAAkG;IAClG,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrC;AAsCD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,eAAe,GAAG,SAAS,CAiBrG"}