@fluid-app/portal-sdk 0.1.178 → 0.1.180

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 (32) hide show
  1. package/dist/{FluidProvider-TKGU3gSm.mjs → FluidProvider-Bjlw3uIJ.mjs} +54 -84
  2. package/dist/FluidProvider-Bjlw3uIJ.mjs.map +1 -0
  3. package/dist/{FluidProvider-CIuinUdw.cjs → FluidProvider-XHTzXe-E.cjs} +53 -89
  4. package/dist/FluidProvider-XHTzXe-E.cjs.map +1 -0
  5. package/dist/{MessagingScreen-CwMR1WJG.cjs → MessagingScreen-BcpCwuYL.cjs} +2 -2
  6. package/dist/{MessagingScreen-CwMR1WJG.cjs.map → MessagingScreen-BcpCwuYL.cjs.map} +1 -1
  7. package/dist/{MessagingScreen-BUC8Fwaz.mjs → MessagingScreen-CxWUaN04.mjs} +2 -2
  8. package/dist/{MessagingScreen-BUC8Fwaz.mjs.map → MessagingScreen-CxWUaN04.mjs.map} +1 -1
  9. package/dist/{MessagingScreen-XzPsvsXP.cjs → MessagingScreen-D35g9qBs.cjs} +2 -2
  10. package/dist/{ProductsScreen-C0KlCDt_.mjs → ProductsScreen-08MJy-SJ.mjs} +2 -0
  11. package/dist/{ProfileScreen-De6Xdkr4.cjs → ProfileScreen-C-8qFmXB.cjs} +2 -2
  12. package/dist/{ProfileScreen-De6Xdkr4.cjs.map → ProfileScreen-C-8qFmXB.cjs.map} +1 -1
  13. package/dist/{ProfileScreen-BuDwsZ3f.mjs → ProfileScreen-CQJyNrls.mjs} +2 -2
  14. package/dist/{ProfileScreen-BuDwsZ3f.mjs.map → ProfileScreen-CQJyNrls.mjs.map} +1 -1
  15. package/dist/{ProfileScreen-CD0p8061.cjs → ProfileScreen-CZDMIHZ9.cjs} +2 -2
  16. package/dist/{ShareablesScreen-_S-OESoe.mjs → ShareablesScreen-jHqnOgXM.mjs} +2 -0
  17. package/dist/{ShopScreen-DqUle1Zv.cjs → ShopScreen-BeuMn_38.cjs} +2 -2
  18. package/dist/{ShopScreen-Bg5pr5RL.mjs → ShopScreen-ChzQkJ1u.mjs} +2 -2
  19. package/dist/{ShopScreen-Bg5pr5RL.mjs.map → ShopScreen-ChzQkJ1u.mjs.map} +1 -1
  20. package/dist/{ShopScreen-z1kE-juB.cjs → ShopScreen-GBG7PGT3.cjs} +2 -2
  21. package/dist/{ShopScreen-z1kE-juB.cjs.map → ShopScreen-GBG7PGT3.cjs.map} +1 -1
  22. package/dist/index.cjs +61 -62
  23. package/dist/index.cjs.map +1 -1
  24. package/dist/index.d.cts +110 -20
  25. package/dist/index.d.cts.map +1 -1
  26. package/dist/index.d.mts +110 -20
  27. package/dist/index.d.mts.map +1 -1
  28. package/dist/index.mjs +65 -66
  29. package/dist/index.mjs.map +1 -1
  30. package/package.json +12 -12
  31. package/dist/FluidProvider-CIuinUdw.cjs.map +0 -1
  32. package/dist/FluidProvider-TKGU3gSm.mjs.map +0 -1
@@ -492,21 +492,6 @@ function createPersister() {
492
492
  });
493
493
  }
494
494
  //#endregion
495
- //#region ../core/src/fluidos-api-context.ts
496
- const FluidOsReadApiContext = (0, react.createContext)(null);
497
- const FluidOsBuilderApiContext = (0, react.createContext)(null);
498
- /** Provider for read-only manifest fetching (used by SDK). */
499
- const FluidOsApiProvider = FluidOsReadApiContext.Provider;
500
- FluidOsBuilderApiContext.Provider;
501
- /** Hook for read-only manifest fetching (used by SDK). */
502
- function useFluidOsApi() {
503
- const builderApi = (0, react.useContext)(FluidOsBuilderApiContext);
504
- const readApi = (0, react.useContext)(FluidOsReadApiContext);
505
- if (builderApi) return builderApi;
506
- if (!readApi) throw new Error("useFluidOsApi must be used within a FluidOsApiProvider or FluidOsBuilderApiProvider");
507
- return readApi;
508
- }
509
- //#endregion
510
495
  //#region ../core/src/app-definition-api-context.ts
511
496
  const AppDefinitionApiContext = (0, react.createContext)(null);
512
497
  const AppDefinitionApiProvider = AppDefinitionApiContext.Provider;
@@ -860,52 +845,48 @@ function createDataSourceApiAdapter(client, contentClient) {
860
845
  };
861
846
  }
862
847
  //#endregion
863
- //#region ../../api-clients/fluidos/src/namespaces/fluid_os.ts
864
- /**
865
- * Get active Fluid OS definition
866
- * Retrieve the active Fluid OS definition manifest for a specific platform
867
- *
868
- * @param client - Fetch client instance
869
- * @param params - params
870
- */
871
- async function getFluidOSManifest(client, params) {
872
- return client.get(`/api/fluid_os/definitions/active`, params);
873
- }
874
- //#endregion
875
- //#region src/adapters/fluidos-api-adapter.ts
876
- /** Create a FluidOsReadApi adapter backed by a FetchClient. */
877
- function createFluidOsReadAdapter(client) {
878
- return { getManifest: (params) => getFluidOSManifest(client, params) };
879
- }
880
- //#endregion
881
848
  //#region src/adapters/app-definition-api-adapter.ts
882
- function mapManifest(raw) {
883
- return {
884
- id: raw.definition_id ?? 0,
885
- name: raw.name ?? "",
886
- version: raw.published_version?.toString() ?? null,
887
- components: [],
888
- active: true
889
- };
890
- }
891
849
  /**
892
850
  * Creates an AppDefinitionApi adapter backed by the portal-tenant BFF client.
893
851
  *
894
- * Maps the generated portal-tenant `app_manifest_show` response to the
895
- * `AppDefinitionApi` port, applying runtime defaults for optional BFF fields
896
- * so TypeScript catches schema drift at compile time via `satisfies`.
852
+ * Maps the generated `app_manifest_show` response to the `AppDefinitionApi`
853
+ * port, applying runtime defaults for optional BFF fields so TypeScript
854
+ * catches schema drift at compile time via `satisfies`.
897
855
  */
898
856
  function createAppDefinitionApiAdapter(client) {
899
- return { fetchDefinition: async () => {
857
+ async function fetchManifest() {
900
858
  const response = await require_portal_tenant.app_manifest_show(client);
901
859
  return {
902
- definition: mapManifest(response.manifest ?? {}),
860
+ manifest: response.manifest,
903
861
  meta: {
904
862
  request_id: response.meta?.request_id ?? "",
905
863
  timestamp: response.meta?.timestamp ?? ""
906
864
  }
907
865
  };
908
- } };
866
+ }
867
+ return {
868
+ fetchManifest,
869
+ fetchDefinition: async () => {
870
+ const { manifest, meta } = await fetchManifest();
871
+ return {
872
+ definition: mapManifestToDefinition(manifest),
873
+ meta
874
+ };
875
+ }
876
+ };
877
+ }
878
+ /**
879
+ * Synthesize the legacy `{ definition }` shape from the new manifest
880
+ * response. Retained only so deprecated callers keep building.
881
+ */
882
+ function mapManifestToDefinition(manifest) {
883
+ return {
884
+ id: manifest.definition_id ?? 0,
885
+ name: manifest.name ?? "",
886
+ version: manifest.published_version?.toString() ?? null,
887
+ components: [],
888
+ active: true
889
+ };
909
890
  }
910
891
  //#endregion
911
892
  //#region src/adapters/account-api-adapter.ts
@@ -2543,14 +2524,6 @@ function FluidProvider({ config, children, queryClient, initialTheme, themeConta
2543
2524
  }, []);
2544
2525
  const configRef = (0, react.useRef)(config);
2545
2526
  configRef.current = config;
2546
- const fluidOsFetchClient = (0, react.useMemo)(() => createFetchClient({
2547
- baseUrl: configRef.current.baseUrl,
2548
- ...configRef.current.getAuthToken ? { getAuthToken: () => configRef.current.getAuthToken?.() ?? null } : {},
2549
- onAuthError: () => configRef.current.onAuthError?.(),
2550
- defaultHeaders: configRef.current.defaultHeaders,
2551
- credentials: "include"
2552
- }), [config.baseUrl]);
2553
- const fluidOsApi = (0, react.useMemo)(() => createFluidOsReadAdapter(fluidOsFetchClient), [fluidOsFetchClient]);
2554
2527
  const csrfToken = typeof document !== "undefined" ? document.querySelector("meta[name=\"csrf-token\"]")?.getAttribute("content") : null;
2555
2528
  const portalTenantClient = (0, react.useMemo)(() => createFetchClient({
2556
2529
  baseUrl: configRef.current.baseUrl,
@@ -2592,32 +2565,29 @@ function FluidProvider({ config, children, queryClient, initialTheme, themeConta
2592
2565
  value: contextValue,
2593
2566
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_PortalTenantClientProvider.PortalTenantClientProvider, {
2594
2567
  value: portalTenantClient,
2595
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FluidOsApiProvider, {
2596
- value: fluidOsApi,
2597
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AppDefinitionApiProvider, {
2598
- value: appDefinitionApi,
2599
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_account_api_context.AccountApiProvider, {
2600
- value: accountApi,
2601
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_store_api_context.StoreApiProvider, {
2602
- value: storeApi,
2603
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PayApiProvider, {
2604
- value: payApi,
2605
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_countries_api_context.CountriesApiProvider, {
2606
- value: countriesApi,
2607
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LanguagesApiProvider, {
2608
- value: languagesApi,
2609
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_mysite_api_context.MySiteApiProvider, {
2610
- value: mysiteApi,
2611
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ScreenRenderer.DataSourceApiProvider, {
2612
- value: dataSourceApi,
2613
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProviderStack, {
2614
- baseUrl: dataSourceBaseUrl,
2615
- getApiHeaders,
2616
- variables: effectiveVariables,
2617
- registry,
2618
- themeProviderProps,
2619
- children
2620
- })
2568
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AppDefinitionApiProvider, {
2569
+ value: appDefinitionApi,
2570
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_account_api_context.AccountApiProvider, {
2571
+ value: accountApi,
2572
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_store_api_context.StoreApiProvider, {
2573
+ value: storeApi,
2574
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PayApiProvider, {
2575
+ value: payApi,
2576
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_countries_api_context.CountriesApiProvider, {
2577
+ value: countriesApi,
2578
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LanguagesApiProvider, {
2579
+ value: languagesApi,
2580
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_mysite_api_context.MySiteApiProvider, {
2581
+ value: mysiteApi,
2582
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ScreenRenderer.DataSourceApiProvider, {
2583
+ value: dataSourceApi,
2584
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProviderStack, {
2585
+ baseUrl: dataSourceBaseUrl,
2586
+ getApiHeaders,
2587
+ variables: effectiveVariables,
2588
+ registry,
2589
+ themeProviderProps,
2590
+ children
2621
2591
  })
2622
2592
  })
2623
2593
  })
@@ -2893,12 +2863,6 @@ Object.defineProperty(exports, "useFluidContext", {
2893
2863
  return useFluidContext;
2894
2864
  }
2895
2865
  });
2896
- Object.defineProperty(exports, "useFluidOsApi", {
2897
- enumerable: true,
2898
- get: function() {
2899
- return useFluidOsApi;
2900
- }
2901
- });
2902
2866
  Object.defineProperty(exports, "useLanguagesApi", {
2903
2867
  enumerable: true,
2904
2868
  get: function() {
@@ -2924,4 +2888,4 @@ Object.defineProperty(exports, "widgetPropertySchemas", {
2924
2888
  }
2925
2889
  });
2926
2890
 
2927
- //# sourceMappingURL=FluidProvider-CIuinUdw.cjs.map
2891
+ //# sourceMappingURL=FluidProvider-XHTzXe-E.cjs.map