@flamingo-stack/openframe-frontend-core 0.0.741 → 0.0.742

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 (76) hide show
  1. package/dist/{chunk-BV5WZVOP.cjs → chunk-32Q7K5OP.cjs} +254 -254
  2. package/dist/{chunk-I6UE6YVM.cjs → chunk-3LW43GIJ.cjs} +6 -6
  3. package/dist/{chunk-VA7OMDZO.cjs → chunk-4FWURR3W.cjs} +50 -50
  4. package/dist/{chunk-EKGL5K5K.cjs → chunk-4LDU32OB.cjs} +17 -17
  5. package/dist/{chunk-IK2RJUEA.cjs → chunk-4PKORVOX.cjs} +724 -724
  6. package/dist/{chunk-4XL4YEZM.cjs → chunk-54EA4RLX.cjs} +8 -8
  7. package/dist/{chunk-YXKB5WRE.cjs → chunk-5MH6BRPY.cjs} +36 -36
  8. package/dist/{chunk-PQ2M7P2U.cjs → chunk-5TCIRWHL.cjs} +9 -9
  9. package/dist/{chunk-7ZFCR7UY.cjs → chunk-ABLUMGCI.cjs} +3 -3
  10. package/dist/{chunk-PX7FY655.cjs → chunk-ASMNNSUQ.cjs} +3 -3
  11. package/dist/{chunk-HF7Z2E4W.cjs → chunk-BI3XBCQX.cjs} +2 -2
  12. package/dist/{chunk-SA7LDEVJ.cjs → chunk-CSJO7ZGN.cjs} +3 -3
  13. package/dist/{chunk-VOX4E6AX.cjs → chunk-DGFDBPO7.cjs} +7 -5
  14. package/dist/{chunk-YQ37ZCD2.cjs → chunk-DNFSMVXJ.cjs} +16 -16
  15. package/dist/{chunk-B3XBJCOD.cjs → chunk-H3UA7UY5.cjs} +7 -7
  16. package/dist/{chunk-JFS6TZDX.cjs → chunk-HDBY2URA.cjs} +64 -64
  17. package/dist/{chunk-QEUGYHFB.cjs → chunk-HIRVNBX5.cjs} +20 -20
  18. package/dist/{chunk-ZJPDGVA6.cjs → chunk-ISJXKKYW.cjs} +28 -28
  19. package/dist/{chunk-FICJS5OA.cjs → chunk-KTPR66EE.cjs} +4 -4
  20. package/dist/{chunk-FQN6STIM.cjs → chunk-L34TKFTS.cjs} +20 -20
  21. package/dist/{chunk-AAFW4STC.cjs → chunk-LU7TD6QS.cjs} +5 -5
  22. package/dist/{chunk-3HPB4H4C.cjs → chunk-NTGIQP7O.cjs} +7 -7
  23. package/dist/{chunk-WBANGORJ.cjs → chunk-OBODY7F3.cjs} +3 -3
  24. package/dist/{chunk-GABDE3FM.cjs → chunk-OWGLRE74.cjs} +19 -19
  25. package/dist/{chunk-CWRVTQUO.cjs → chunk-PS6T65KA.cjs} +101 -101
  26. package/dist/{chunk-IFS4AH77.cjs → chunk-QYLIHZKZ.cjs} +10 -10
  27. package/dist/{chunk-GVTDVS5U.cjs → chunk-R34JD6NP.cjs} +3 -3
  28. package/dist/{chunk-LZ6NOVXX.cjs → chunk-R6SCSV2I.cjs} +103 -103
  29. package/dist/{chunk-XJ36TEGE.cjs → chunk-T433HSL6.cjs} +47 -47
  30. package/dist/{chunk-DSVNFRY5.cjs → chunk-U2O5YQRP.cjs} +38 -38
  31. package/dist/{chunk-O67V3HJR.cjs → chunk-URVIPSAJ.cjs} +24 -24
  32. package/dist/{chunk-HYBMADYO.cjs → chunk-UWHCRIQQ.cjs} +22 -22
  33. package/dist/{chunk-GSWQZX23.cjs → chunk-UY6A6TEY.cjs} +2 -2
  34. package/dist/{chunk-ITPEFCQ2.cjs → chunk-UZLRSFGG.cjs} +32 -32
  35. package/dist/{chunk-DUVOQHQI.cjs → chunk-W2RM764D.cjs} +7 -7
  36. package/dist/{chunk-NTJE6SM6.cjs → chunk-WI2OTGKC.cjs} +2 -2
  37. package/dist/{chunk-SFY4UYPY.cjs → chunk-WIHHA54J.cjs} +44 -44
  38. package/dist/{chunk-YRE3O65E.cjs → chunk-XAA5EZ5T.cjs} +12 -12
  39. package/dist/{chunk-KLI4OSRA.cjs → chunk-YQGDXH3M.cjs} +2 -2
  40. package/dist/{chunk-ZYOS7LVQ.cjs → chunk-Z2DQYKZA.cjs} +89 -89
  41. package/dist/{chunk-5SVOGLNK.cjs → chunk-ZIFYSLIM.cjs} +6 -6
  42. package/dist/{cloud-tenants-MVJK52I2.cjs → cloud-tenants-6ICAL3HO.cjs} +24 -24
  43. package/dist/components/case-studies/index.cjs +37 -37
  44. package/dist/components/chat/index.cjs +17 -17
  45. package/dist/components/contact/index.cjs +25 -25
  46. package/dist/components/docs/index.cjs +28 -28
  47. package/dist/components/embeds/index.cjs +25 -25
  48. package/dist/components/faq/index.cjs +26 -26
  49. package/dist/components/features/index.cjs +24 -24
  50. package/dist/components/help-center-pages/index.cjs +144 -144
  51. package/dist/components/index.cjs +85 -85
  52. package/dist/components/meeting-scheduler/index.cjs +74 -74
  53. package/dist/components/navigation/index.cjs +27 -27
  54. package/dist/components/onboarding-guides/index.cjs +27 -27
  55. package/dist/components/product-demo/index.cjs +9 -9
  56. package/dist/components/related-content/index.cjs +12 -12
  57. package/dist/components/tickets/index.cjs +30 -30
  58. package/dist/components/ui/index.cjs +24 -24
  59. package/dist/{devices-W3S7Q2PG.cjs → devices-OFP2IBKN.cjs} +25 -25
  60. package/dist/{embeddable-chat-6JKKFQEB.cjs → embeddable-chat-4C22MGNC.cjs} +92 -92
  61. package/dist/hooks/index.cjs +10 -10
  62. package/dist/index.cjs +30 -30
  63. package/dist/{knowledge-AIYQ4FC3.cjs → knowledge-KKBCSNUA.cjs} +25 -25
  64. package/dist/{logs-7SHJ2ARE.cjs → logs-X2GRNO57.cjs} +32 -32
  65. package/dist/{policies-EIZJ5SUP.cjs → policies-35BXKB6P.cjs} +28 -28
  66. package/dist/{remote-session-BZMNE6D2.cjs → remote-session-N4PJB5FW.cjs} +10 -10
  67. package/dist/{scripts-J2FWC7E4.cjs → scripts-KQYVQOLU.cjs} +31 -31
  68. package/dist/{software-update-QAMNASVF.cjs → software-update-ED33WSKT.cjs} +28 -28
  69. package/dist/{tickets-board-CEDHD3KB.cjs → tickets-board-O753S4ZB.cjs} +14 -14
  70. package/dist/utils/embed-authed-fetch.d.ts +33 -0
  71. package/dist/utils/embed-authed-fetch.d.ts.map +1 -1
  72. package/dist/utils/embed-authed-fetch.js +3 -1
  73. package/dist/utils/index.cjs +3 -1
  74. package/dist/{video-file-player-ZH2ILAPO.cjs → video-file-player-QZ3YOLHO.cjs} +2 -2
  75. package/package.json +1 -1
  76. package/src/utils/embed-authed-fetch.ts +42 -1
@@ -15,26 +15,26 @@ var _chunkDKOLQPE7cjs = require('./chunk-DKOLQPE7.cjs');
15
15
 
16
16
 
17
17
 
18
- var _chunkIK2RJUEAcjs = require('./chunk-IK2RJUEA.cjs');
19
- require('./chunk-O67V3HJR.cjs');
20
- require('./chunk-3HPB4H4C.cjs');
18
+ var _chunk4PKORVOXcjs = require('./chunk-4PKORVOX.cjs');
19
+ require('./chunk-URVIPSAJ.cjs');
20
+ require('./chunk-NTGIQP7O.cjs');
21
21
 
22
22
 
23
- var _chunkDSVNFRY5cjs = require('./chunk-DSVNFRY5.cjs');
23
+ var _chunkU2O5YQRPcjs = require('./chunk-U2O5YQRP.cjs');
24
24
  require('./chunk-HQQE74RO.cjs');
25
25
  require('./chunk-DEY6XXGO.cjs');
26
- require('./chunk-VA7OMDZO.cjs');
27
- require('./chunk-AAFW4STC.cjs');
26
+ require('./chunk-4FWURR3W.cjs');
27
+ require('./chunk-LU7TD6QS.cjs');
28
28
  require('./chunk-24I6RFVU.cjs');
29
29
  require('./chunk-A6P6DHEZ.cjs');
30
30
  require('./chunk-MZ4KBSH7.cjs');
31
- require('./chunk-KLI4OSRA.cjs');
31
+ require('./chunk-YQGDXH3M.cjs');
32
32
  require('./chunk-YUMFVQIN.cjs');
33
- require('./chunk-CWRVTQUO.cjs');
34
- require('./chunk-BV5WZVOP.cjs');
35
- require('./chunk-GABDE3FM.cjs');
33
+ require('./chunk-PS6T65KA.cjs');
34
+ require('./chunk-32Q7K5OP.cjs');
35
+ require('./chunk-OWGLRE74.cjs');
36
36
  require('./chunk-3RFQPQ7Z.cjs');
37
- require('./chunk-PQ2M7P2U.cjs');
37
+ require('./chunk-5TCIRWHL.cjs');
38
38
  require('./chunk-B27QEHYR.cjs');
39
39
  require('./chunk-ZOZR3QI2.cjs');
40
40
  require('./chunk-OMV5S5PI.cjs');
@@ -1824,20 +1824,20 @@ require('./chunk-LMBYZITR.cjs');
1824
1824
  require('./chunk-TMVC7S2R.cjs');
1825
1825
  require('./chunk-IYHH5EIO.cjs');
1826
1826
  require('./chunk-XIBCMGBW.cjs');
1827
- require('./chunk-DUVOQHQI.cjs');
1828
- require('./chunk-SA7LDEVJ.cjs');
1829
- require('./chunk-NTJE6SM6.cjs');
1827
+ require('./chunk-W2RM764D.cjs');
1828
+ require('./chunk-CSJO7ZGN.cjs');
1829
+ require('./chunk-WI2OTGKC.cjs');
1830
1830
  require('./chunk-JKX2C3I2.cjs');
1831
1831
  require('./chunk-7DNL734S.cjs');
1832
1832
  require('./chunk-WWUSFOJ7.cjs');
1833
1833
  require('./chunk-SKI6NKOE.cjs');
1834
1834
  require('./chunk-EWPR7662.cjs');
1835
- require('./chunk-YRE3O65E.cjs');
1836
- require('./chunk-YXKB5WRE.cjs');
1837
- require('./chunk-IFS4AH77.cjs');
1835
+ require('./chunk-XAA5EZ5T.cjs');
1836
+ require('./chunk-5MH6BRPY.cjs');
1837
+ require('./chunk-QYLIHZKZ.cjs');
1838
1838
  require('./chunk-63N4FN5V.cjs');
1839
- require('./chunk-GSWQZX23.cjs');
1840
- require('./chunk-7ZFCR7UY.cjs');
1839
+ require('./chunk-UY6A6TEY.cjs');
1840
+ require('./chunk-ABLUMGCI.cjs');
1841
1841
  require('./chunk-S5C3OZCO.cjs');
1842
1842
  require('./chunk-32ASZMTV.cjs');
1843
1843
  require('./chunk-OOYBIS7D.cjs');
@@ -1847,11 +1847,11 @@ require('./chunk-ORO54HDF.cjs');
1847
1847
  require('./chunk-RUHKTWGB.cjs');
1848
1848
  require('./chunk-BLH2SFOO.cjs');
1849
1849
  require('./chunk-I5MSCD57.cjs');
1850
- require('./chunk-PX7FY655.cjs');
1850
+ require('./chunk-ASMNNSUQ.cjs');
1851
1851
  require('./chunk-CW3ML76U.cjs');
1852
- require('./chunk-GVTDVS5U.cjs');
1853
- require('./chunk-FICJS5OA.cjs');
1854
- require('./chunk-VOX4E6AX.cjs');
1852
+ require('./chunk-R34JD6NP.cjs');
1853
+ require('./chunk-KTPR66EE.cjs');
1854
+ require('./chunk-DGFDBPO7.cjs');
1855
1855
  require('./chunk-HOTM4UM6.cjs');
1856
1856
  require('./chunk-UJ7AXHRZ.cjs');
1857
1857
  require('./chunk-HTRILBJD.cjs');
@@ -1920,14 +1920,14 @@ var noop = () => {
1920
1920
  var HIDDEN_WHEN_COMPACT = ["organization"];
1921
1921
  function StaticPackageField({ value }) {
1922
1922
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1923
- _chunkDSVNFRY5cjs.Autocomplete,
1923
+ _chunkU2O5YQRPcjs.Autocomplete,
1924
1924
  {
1925
- label: _chunkIK2RJUEAcjs.PACKAGE_SEARCH_LABEL,
1925
+ label: _chunk4PKORVOXcjs.PACKAGE_SEARCH_LABEL,
1926
1926
  labelVariant: "large",
1927
1927
  options: value ? [{ value: value.id, label: value.name, description: _nullishCoalesce(value.description, () => ( void 0)) }] : [],
1928
1928
  value: _nullishCoalesce(_optionalChain([value, 'optionalAccess', _ => _.id]), () => ( null)),
1929
1929
  onChange: noop,
1930
- placeholder: _chunkIK2RJUEAcjs.PACKAGE_SEARCH_PLACEHOLDER
1930
+ placeholder: _chunk4PKORVOXcjs.PACKAGE_SEARCH_PLACEHOLDER
1931
1931
  }
1932
1932
  );
1933
1933
  }
@@ -1941,7 +1941,7 @@ function SoftwareUpdateScreen({ compact = false }) {
1941
1941
  [fixture.devices, fixture.selectedIds]
1942
1942
  );
1943
1943
  return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "h-full bg-ods-bg pt-[var(--spacing-system-l)]", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "h-full", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1944
- _chunkIK2RJUEAcjs.SoftwareActionForm,
1944
+ _chunk4PKORVOXcjs.SoftwareActionForm,
1945
1945
  {
1946
1946
  action: fixture.action,
1947
1947
  showHeader: false,
@@ -1953,7 +1953,7 @@ function SoftwareUpdateScreen({ compact = false }) {
1953
1953
  initialValues: fixture.initialValues,
1954
1954
  renderPackageSearch,
1955
1955
  renderDevicePicker: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
1956
- _chunkIK2RJUEAcjs.DeviceSelector,
1956
+ _chunk4PKORVOXcjs.DeviceSelector,
1957
1957
  {
1958
1958
  devices: selected,
1959
1959
  loading: false,
@@ -10,9 +10,9 @@ var _chunkDKOLQPE7cjs = require('./chunk-DKOLQPE7.cjs');
10
10
 
11
11
 
12
12
 
13
- var _chunkO67V3HJRcjs = require('./chunk-O67V3HJR.cjs');
14
- require('./chunk-AAFW4STC.cjs');
15
- require('./chunk-GABDE3FM.cjs');
13
+ var _chunkURVIPSAJcjs = require('./chunk-URVIPSAJ.cjs');
14
+ require('./chunk-LU7TD6QS.cjs');
15
+ require('./chunk-OWGLRE74.cjs');
16
16
  require('./chunk-B27QEHYR.cjs');
17
17
  require('./chunk-ZOZR3QI2.cjs');
18
18
  require('./chunk-OMV5S5PI.cjs');
@@ -1802,11 +1802,11 @@ require('./chunk-LMBYZITR.cjs');
1802
1802
  require('./chunk-TMVC7S2R.cjs');
1803
1803
  require('./chunk-IYHH5EIO.cjs');
1804
1804
  require('./chunk-XIBCMGBW.cjs');
1805
- require('./chunk-NTJE6SM6.cjs');
1805
+ require('./chunk-WI2OTGKC.cjs');
1806
1806
  require('./chunk-WWUSFOJ7.cjs');
1807
1807
  require('./chunk-SKI6NKOE.cjs');
1808
- require('./chunk-IFS4AH77.cjs');
1809
- require('./chunk-7ZFCR7UY.cjs');
1808
+ require('./chunk-QYLIHZKZ.cjs');
1809
+ require('./chunk-ABLUMGCI.cjs');
1810
1810
  require('./chunk-S5C3OZCO.cjs');
1811
1811
  require('./chunk-32ASZMTV.cjs');
1812
1812
  require('./chunk-OOYBIS7D.cjs');
@@ -1814,9 +1814,9 @@ require('./chunk-4IYNDV3G.cjs');
1814
1814
  require('./chunk-6VOOPMP5.cjs');
1815
1815
  require('./chunk-ORO54HDF.cjs');
1816
1816
  require('./chunk-RUHKTWGB.cjs');
1817
- require('./chunk-PX7FY655.cjs');
1818
- require('./chunk-FICJS5OA.cjs');
1819
- require('./chunk-VOX4E6AX.cjs');
1817
+ require('./chunk-ASMNNSUQ.cjs');
1818
+ require('./chunk-KTPR66EE.cjs');
1819
+ require('./chunk-DGFDBPO7.cjs');
1820
1820
  require('./chunk-HOTM4UM6.cjs');
1821
1821
  require('./chunk-L2RMTGOK.cjs');
1822
1822
  require('./chunk-Z74QE57T.cjs');
@@ -1839,7 +1839,7 @@ function buildTicketsBoardFixture(cast) {
1839
1839
  const dana = assignee(cast.person("dana"));
1840
1840
  const alex = assignee(cast.person("alex"));
1841
1841
  return [
1842
- _chunkO67V3HJRcjs.columnFromTicketStatus.call(void 0, "ACTIVE", [
1842
+ _chunkURVIPSAJcjs.columnFromTicketStatus.call(void 0, "ACTIVE", [
1843
1843
  ticket("tk-1051", "Printer offline at the front desk", "ACTIVE", {
1844
1844
  ticketNumber: "1051",
1845
1845
  agent: "fae",
@@ -1857,7 +1857,7 @@ function buildTicketsBoardFixture(cast) {
1857
1857
  tags: ["onboarding"]
1858
1858
  })
1859
1859
  ]),
1860
- _chunkO67V3HJRcjs.columnFromTicketStatus.call(void 0, "TECH_REQUIRED", [
1860
+ _chunkURVIPSAJcjs.columnFromTicketStatus.call(void 0, "TECH_REQUIRED", [
1861
1861
  ticket("tk-1049", "Acrobat Pro for Maya", "TECH_REQUIRED", {
1862
1862
  ticketNumber: "1049",
1863
1863
  agent: "fae",
@@ -1881,7 +1881,7 @@ function buildTicketsBoardFixture(cast) {
1881
1881
  escalatedByUser: true
1882
1882
  })
1883
1883
  ]),
1884
- _chunkO67V3HJRcjs.columnFromTicketStatus.call(void 0, "ON_HOLD", [
1884
+ _chunkURVIPSAJcjs.columnFromTicketStatus.call(void 0, "ON_HOLD", [
1885
1885
  ticket("tk-1046", "Replace the conference room display", "ON_HOLD", {
1886
1886
  ticketNumber: "1046",
1887
1887
  organizationName: _chunkDKOLQPE7cjs.DEMO_ORGANIZATIONS.acme.name,
@@ -1890,7 +1890,7 @@ function buildTicketsBoardFixture(cast) {
1890
1890
  activity: { kind: "waiting-external" }
1891
1891
  })
1892
1892
  ]),
1893
- _chunkO67V3HJRcjs.columnFromTicketStatus.call(void 0,
1893
+ _chunkURVIPSAJcjs.columnFromTicketStatus.call(void 0,
1894
1894
  "RESOLVED",
1895
1895
  [
1896
1896
  ticket("tk-1048", "Slow laptop", "RESOLVED", {
@@ -1926,7 +1926,7 @@ function TicketsBoardScreen({ compact = false }) {
1926
1926
  const cast = _chunkSTEJZPIOcjs.useProductDemoCast.call(void 0, );
1927
1927
  const board = _react.useMemo.call(void 0, () => buildTicketsBoardFixture(cast), [cast]);
1928
1928
  const columns = compact ? board.filter((column) => column.id !== "ON_HOLD") : board;
1929
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "h-full bg-ods-bg p-[var(--spacing-system-m)]", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkO67V3HJRcjs.Board, { columns, onChange: noop, initialCollapsed: compact ? void 0 : FOLDED }) });
1929
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "h-full bg-ods-bg p-[var(--spacing-system-m)]", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkURVIPSAJcjs.Board, { columns, onChange: noop, initialCollapsed: compact ? void 0 : FOLDED }) });
1930
1930
  }
1931
1931
 
1932
1932
 
@@ -58,6 +58,34 @@ export interface EmbedAuthAdapter {
58
58
  * host's own auth layer, not to this fetch wrapper.
59
59
  */
60
60
  refresh?: () => Promise<boolean>;
61
+ /**
62
+ * Optional guard, run before every request goes out — the first attempt
63
+ * and the retry after a `refresh`. Throw — or reject — to refuse the
64
+ * request: `embedAuthedFetch` rejects with that error and nothing reaches
65
+ * the network.
66
+ *
67
+ * For a host-wide state that makes every request pointless. openframe's
68
+ * mobile force-update is the case it exists for: once the gateway has
69
+ * refused this client build, every later request is refused locally, so no
70
+ * surface's retry or reconnect loop keeps hitting the gateway. Runs inside
71
+ * the returned promise (after the synchronous same-origin guard), so
72
+ * callers see a rejection, never a synchronous throw.
73
+ */
74
+ beforeRequest?: () => void | Promise<void>;
75
+ /**
76
+ * Optional response hook, run on every response (the post-refresh retry's
77
+ * too) BEFORE the 401 self-heal. Throw — or reject — to fail the request
78
+ * with that error: `embedAuthedFetch` rejects with it, and neither
79
+ * `refresh` nor a retry runs. Return to let the response continue through
80
+ * the wrapper unchanged.
81
+ *
82
+ * For a status the host handles app-wide rather than per surface — e.g.
83
+ * openframe's gateway answering `426 Upgrade Required` to a too-old mobile
84
+ * build, which swaps the whole app for an "update required" screen and
85
+ * must never be retried or read as an auth failure. Read the body from
86
+ * `response.clone()`: once the hook returns, the caller reads the original.
87
+ */
88
+ onResponse?: (response: Response) => void | Promise<void>;
61
89
  /**
62
90
  * Exact extra origins (`scheme://host[:port]`, as produced by `URL.origin`)
63
91
  * the same-origin guard additionally accepts. The guard normally rejects
@@ -166,6 +194,11 @@ export declare function needsBearerAssetFetch(url: string): boolean;
166
194
  * no longer need a host-side `window.fetch` monkey-patch to survive an
167
195
  * expired access token mid-chat. With no adapter (or no `refresh`), the
168
196
  * 401 passes straight through unchanged.
197
+ *
198
+ * **Host hooks:** an adapter's `beforeRequest` may refuse a request before it
199
+ * is sent, and its `onResponse` sees every response ahead of the 401
200
+ * self-heal and may fail the request instead (see their docs). Without them
201
+ * the wrapper behaves exactly as described above.
169
202
  */
170
203
  export declare function embedAuthedFetch(url: string, init?: RequestInit): Promise<Response>;
171
204
  //# sourceMappingURL=embed-authed-fetch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"embed-authed-fetch.d.ts","sourceRoot":"","sources":["../../src/utils/embed-authed-fetch.ts"],"names":[],"mappings":"AA4BA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;4EAMwE;IACxE,UAAU,CAAC,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACtD;;6EAEyE;IACzE,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACjC;;;;;;;;;;;OAWG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAC;CAClD;AA0BD;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,GAAG,IAAI,CAS1E;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAE7C;AAED;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAE/E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAiB1D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAkCvF"}
1
+ {"version":3,"file":"embed-authed-fetch.d.ts","sourceRoot":"","sources":["../../src/utils/embed-authed-fetch.ts"],"names":[],"mappings":"AA4BA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;4EAMwE;IACxE,UAAU,CAAC,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACtD;;6EAEyE;IACzE,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC;;;;;;;;;;;;;;;;;;;OAmBG;IACH,OAAO,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACjC;;;;;;;;;;;;OAYG;IACH,aAAa,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C;;;;;;;;;;;;OAYG;IACH,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D;;;;;;;;;;;OAWG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B;;;;;;;;OAQG;IACH,SAAS,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAC;CAClD;AA0BD;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,GAAG,IAAI,CAS1E;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAE7C;AAED;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAE/E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAiB1D;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,GAAE,WAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAkCvF"}
@@ -82,8 +82,9 @@ function dedupedRefresh() {
82
82
  return inFlightRefresh;
83
83
  }
84
84
  async function fetchWithRefresh(url, init, baseHeaders, isRetry) {
85
- const { url: authedUrl, headers } = applyProxyAuth(url, { ...baseHeaders });
86
85
  const adapter = getRegisteredAuthAdapter();
86
+ await adapter?.beforeRequest?.();
87
+ const { url: authedUrl, headers } = applyProxyAuth(url, { ...baseHeaders });
87
88
  if (adapter?.getHeaders) {
88
89
  for (const [k, v] of Object.entries(adapter.getHeaders())) {
89
90
  if (v !== void 0) headers[k] = v;
@@ -100,6 +101,7 @@ async function fetchWithRefresh(url, init, baseHeaders, isRetry) {
100
101
  // `SameSite=None` must be configured server-side for that to work).
101
102
  credentials
102
103
  });
104
+ await adapter?.onResponse?.(response);
103
105
  if (response.status === 401 && !isRetry && adapter?.refresh) {
104
106
  const refreshed = await dedupedRefresh();
105
107
  if (refreshed) {
@@ -83337,8 +83337,9 @@ function dedupedRefresh() {
83337
83337
  return inFlightRefresh;
83338
83338
  }
83339
83339
  async function fetchWithRefresh(url, init, baseHeaders, isRetry) {
83340
- const { url: authedUrl, headers } = applyProxyAuth(url, { ...baseHeaders });
83341
83340
  const adapter2 = getRegisteredAuthAdapter();
83341
+ await adapter2?.beforeRequest?.();
83342
+ const { url: authedUrl, headers } = applyProxyAuth(url, { ...baseHeaders });
83342
83343
  if (adapter2?.getHeaders) {
83343
83344
  for (const [k, v] of Object.entries(adapter2.getHeaders())) {
83344
83345
  if (v !== void 0) headers[k] = v;
@@ -83355,6 +83356,7 @@ async function fetchWithRefresh(url, init, baseHeaders, isRetry) {
83355
83356
  // `SameSite=None` must be configured server-side for that to work).
83356
83357
  credentials
83357
83358
  });
83359
+ await adapter2?.onResponse?.(response);
83358
83360
  if (response.status === 401 && !isRetry && adapter2?.refresh) {
83359
83361
  const refreshed = await dedupedRefresh();
83360
83362
  if (refreshed) {
@@ -19,7 +19,7 @@ require('./chunk-4IYNDV3G.cjs');
19
19
  require('./chunk-CW3ML76U.cjs');
20
20
 
21
21
 
22
- var _chunkVOX4E6AXcjs = require('./chunk-VOX4E6AX.cjs');
22
+ var _chunkDGFDBPO7cjs = require('./chunk-DGFDBPO7.cjs');
23
23
  require('./chunk-UJ7AXHRZ.cjs');
24
24
 
25
25
 
@@ -406,7 +406,7 @@ function FilePlayer({
406
406
  const hover = useHoverPlayback(mediaRef, sound, { playOnHover, playWhenHovered, mutedIntent });
407
407
  const health = usePlaybackHealth(mediaRef, url, !chromeless);
408
408
  useIosNativeVideoFullscreen(mediaRef);
409
- const captions = _chunkVOX4E6AXcjs.useAuthedAssetSrc.call(void 0, captionsUrl, "text/vtt, */*");
409
+ const captions = _chunkDGFDBPO7cjs.useAuthedAssetSrc.call(void 0, captionsUrl, "text/vtt, */*");
410
410
  const player = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
411
411
  _muxplayerreact2.default,
412
412
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flamingo-stack/openframe-frontend-core",
3
- "version": "0.0.741",
3
+ "version": "0.0.742",
4
4
  "description": "Shared design system and components for all Flamingo platforms",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -86,6 +86,34 @@ export interface EmbedAuthAdapter {
86
86
  * host's own auth layer, not to this fetch wrapper.
87
87
  */
88
88
  refresh?: () => Promise<boolean>;
89
+ /**
90
+ * Optional guard, run before every request goes out — the first attempt
91
+ * and the retry after a `refresh`. Throw — or reject — to refuse the
92
+ * request: `embedAuthedFetch` rejects with that error and nothing reaches
93
+ * the network.
94
+ *
95
+ * For a host-wide state that makes every request pointless. openframe's
96
+ * mobile force-update is the case it exists for: once the gateway has
97
+ * refused this client build, every later request is refused locally, so no
98
+ * surface's retry or reconnect loop keeps hitting the gateway. Runs inside
99
+ * the returned promise (after the synchronous same-origin guard), so
100
+ * callers see a rejection, never a synchronous throw.
101
+ */
102
+ beforeRequest?: () => void | Promise<void>;
103
+ /**
104
+ * Optional response hook, run on every response (the post-refresh retry's
105
+ * too) BEFORE the 401 self-heal. Throw — or reject — to fail the request
106
+ * with that error: `embedAuthedFetch` rejects with it, and neither
107
+ * `refresh` nor a retry runs. Return to let the response continue through
108
+ * the wrapper unchanged.
109
+ *
110
+ * For a status the host handles app-wide rather than per surface — e.g.
111
+ * openframe's gateway answering `426 Upgrade Required` to a too-old mobile
112
+ * build, which swaps the whole app for an "update required" screen and
113
+ * must never be retried or read as an auth failure. Read the body from
114
+ * `response.clone()`: once the hook returns, the caller reads the original.
115
+ */
116
+ onResponse?: (response: Response) => void | Promise<void>;
89
117
  /**
90
118
  * Exact extra origins (`scheme://host[:port]`, as produced by `URL.origin`)
91
119
  * the same-origin guard additionally accepts. The guard normally rejects
@@ -253,6 +281,11 @@ export function needsBearerAssetFetch(url: string): boolean {
253
281
  * no longer need a host-side `window.fetch` monkey-patch to survive an
254
282
  * expired access token mid-chat. With no adapter (or no `refresh`), the
255
283
  * 401 passes straight through unchanged.
284
+ *
285
+ * **Host hooks:** an adapter's `beforeRequest` may refuse a request before it
286
+ * is sent, and its `onResponse` sees every response ahead of the 401
287
+ * self-heal and may fail the request instead (see their docs). Without them
288
+ * the wrapper behaves exactly as described above.
256
289
  */
257
290
  export function embedAuthedFetch(url: string, init: RequestInit = {}): Promise<Response> {
258
291
  // Same-origin guard runs SYNCHRONOUSLY (not awaited inside the async
@@ -354,6 +387,11 @@ async function fetchWithRefresh(
354
387
  baseHeaders: Record<string, string>,
355
388
  isRetry: boolean,
356
389
  ): Promise<Response> {
390
+ const adapter = getRegisteredAuthAdapter();
391
+ // Per attempt, so a retry after `refresh` is refused too when the host's
392
+ // state changed while the refresh was in flight.
393
+ await adapter?.beforeRequest?.();
394
+
357
395
  // Re-run the merge each attempt: `applyProxyAuth` reads the latest stored
358
396
  // proxy creds and `getHeaders()` reads the latest bearer, so a retry after
359
397
  // refresh carries the rotated token rather than the stale one. `{...baseHeaders}`
@@ -365,7 +403,6 @@ async function fetchWithRefresh(
365
403
  // is the host's explicit "this is my auth model" override, intentionally
366
404
  // last-writer-wins. When no adapter is registered, this is a zero-cost
367
405
  // no-op (object spread of `{}`).
368
- const adapter = getRegisteredAuthAdapter();
369
406
  if (adapter?.getHeaders) {
370
407
  // Filter `undefined` values — the adapter type allows them so consumers
371
408
  // don't have to narrow `{ Authorization: token ? '…' : undefined }`-shaped
@@ -387,6 +424,10 @@ async function fetchWithRefresh(
387
424
  credentials,
388
425
  });
389
426
 
427
+ // Ahead of the 401 self-heal: a status the host claims by throwing must
428
+ // never reach `refresh` or a retry.
429
+ await adapter?.onResponse?.(response);
430
+
390
431
  // 401 self-heal: refresh the token once and retry. Only when an adapter
391
432
  // opted into `refresh`, and only on the first attempt — a 401 on the
392
433
  // retry means the fresh token is also unauthorized, so surface it.