@fluid-app/portal-sdk 0.1.177 → 0.1.179

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 (70) hide show
  1. package/dist/{FluidProvider-C6NlPdMA.mjs → FluidProvider-Bjlw3uIJ.mjs} +66 -114
  2. package/dist/FluidProvider-Bjlw3uIJ.mjs.map +1 -0
  3. package/dist/{FluidProvider-MjOyxZEf.cjs → FluidProvider-XHTzXe-E.cjs} +65 -119
  4. package/dist/FluidProvider-XHTzXe-E.cjs.map +1 -0
  5. package/dist/{MessagingScreen-DRzVl0ux.cjs → MessagingScreen-BcpCwuYL.cjs} +2 -2
  6. package/dist/{MessagingScreen-DRzVl0ux.cjs.map → MessagingScreen-BcpCwuYL.cjs.map} +1 -1
  7. package/dist/{MessagingScreen-BNXVwQwN.mjs → MessagingScreen-CxWUaN04.mjs} +2 -2
  8. package/dist/{MessagingScreen-BNXVwQwN.mjs.map → MessagingScreen-CxWUaN04.mjs.map} +1 -1
  9. package/dist/{MessagingScreen-fMLfvDCY.cjs → MessagingScreen-D35g9qBs.cjs} +2 -2
  10. package/dist/{OrdersScreen-Dz4XHnSA.mjs → OrdersScreen-BYs3uo-1.mjs} +2 -2
  11. package/dist/{OrdersScreen-Dz4XHnSA.mjs.map → OrdersScreen-BYs3uo-1.mjs.map} +1 -1
  12. package/dist/{OrdersScreen-DI1un1xT.cjs → OrdersScreen-COGBqaif.cjs} +1 -1
  13. package/dist/{OrdersScreen-DBaIwXoT.cjs → OrdersScreen-tEz4rZn_.cjs} +2 -2
  14. package/dist/{OrdersScreen-DBaIwXoT.cjs.map → OrdersScreen-tEz4rZn_.cjs.map} +1 -1
  15. package/dist/{PortalContentApiProvider-BvreyuHL.cjs → PortalContentApiProvider-BBGpjTFn.cjs} +11 -12
  16. package/dist/{PortalContentApiProvider-BvreyuHL.cjs.map → PortalContentApiProvider-BBGpjTFn.cjs.map} +1 -1
  17. package/dist/{PortalContentApiProvider-mXe3JFMW.mjs → PortalContentApiProvider-D15sSN1l.mjs} +11 -12
  18. package/dist/{PortalContentApiProvider-mXe3JFMW.mjs.map → PortalContentApiProvider-D15sSN1l.mjs.map} +1 -1
  19. package/dist/{PortalProductsApiProvider-BXmVqeTK.mjs → PortalProductsApiProvider-BALswRao.mjs} +2 -2
  20. package/dist/{PortalProductsApiProvider-BXmVqeTK.mjs.map → PortalProductsApiProvider-BALswRao.mjs.map} +1 -1
  21. package/dist/{PortalProductsApiProvider-jbh8K-Yu.cjs → PortalProductsApiProvider-Duj-EjQj.cjs} +2 -2
  22. package/dist/{PortalProductsApiProvider-jbh8K-Yu.cjs.map → PortalProductsApiProvider-Duj-EjQj.cjs.map} +1 -1
  23. package/dist/{ProductsScreen-4PpCihOF.mjs → ProductsScreen-08MJy-SJ.mjs} +5 -3
  24. package/dist/{ProductsScreen-B3zrg-M4.mjs → ProductsScreen-BnS0MbzY.mjs} +3 -3
  25. package/dist/{ProductsScreen-B3zrg-M4.mjs.map → ProductsScreen-BnS0MbzY.mjs.map} +1 -1
  26. package/dist/{ProductsScreen-BJ_OpulB.cjs → ProductsScreen-CWqkme1L.cjs} +3 -3
  27. package/dist/{ProductsScreen-BJ_OpulB.cjs.map → ProductsScreen-CWqkme1L.cjs.map} +1 -1
  28. package/dist/{ProductsScreen-BxFPdYyG.cjs → ProductsScreen-DjzkmBOS.cjs} +3 -3
  29. package/dist/{ProfileScreen-OhOlDDDj.cjs → ProfileScreen-C-8qFmXB.cjs} +2 -2
  30. package/dist/{ProfileScreen-OhOlDDDj.cjs.map → ProfileScreen-C-8qFmXB.cjs.map} +1 -1
  31. package/dist/{ProfileScreen-D6tv5Qp8.mjs → ProfileScreen-CQJyNrls.mjs} +2 -2
  32. package/dist/{ProfileScreen-D6tv5Qp8.mjs.map → ProfileScreen-CQJyNrls.mjs.map} +1 -1
  33. package/dist/{ProfileScreen-4BbG1vpk.cjs → ProfileScreen-CZDMIHZ9.cjs} +2 -2
  34. package/dist/{ShareablesScreen-D0hdY5cY.cjs → ShareablesScreen-BZG-rFuT.cjs} +3 -3
  35. package/dist/{ShareablesScreen-BVb5BkiC.cjs → ShareablesScreen-B_tGIt_X.cjs} +3 -3
  36. package/dist/{ShareablesScreen-BVb5BkiC.cjs.map → ShareablesScreen-B_tGIt_X.cjs.map} +1 -1
  37. package/dist/{ShareablesScreen-xak6DHSf.mjs → ShareablesScreen-jHqnOgXM.mjs} +5 -3
  38. package/dist/{ShareablesScreen-DCbx4JwR.mjs → ShareablesScreen-svmMjJII.mjs} +3 -3
  39. package/dist/{ShareablesScreen-DCbx4JwR.mjs.map → ShareablesScreen-svmMjJII.mjs.map} +1 -1
  40. package/dist/{ShopScreen-BYEB_E5B.cjs → ShopScreen-BeuMn_38.cjs} +3 -3
  41. package/dist/{ShopScreen-DmkJgGqK.mjs → ShopScreen-ChzQkJ1u.mjs} +3 -3
  42. package/dist/{ShopScreen-DmkJgGqK.mjs.map → ShopScreen-ChzQkJ1u.mjs.map} +1 -1
  43. package/dist/{ShopScreen-2Fm9c-Nc.cjs → ShopScreen-GBG7PGT3.cjs} +3 -3
  44. package/dist/{ShopScreen-2Fm9c-Nc.cjs.map → ShopScreen-GBG7PGT3.cjs.map} +1 -1
  45. package/dist/{SubscriptionsScreen-B3Z13alr.mjs → SubscriptionsScreen-BCxNFOZv.mjs} +2 -2
  46. package/dist/{SubscriptionsScreen-B3Z13alr.mjs.map → SubscriptionsScreen-BCxNFOZv.mjs.map} +1 -1
  47. package/dist/{SubscriptionsScreen-Cdf_XKwQ.cjs → SubscriptionsScreen-CYIUXxrJ.cjs} +1 -1
  48. package/dist/{SubscriptionsScreen-C_U6YU-s.cjs → SubscriptionsScreen-Dr0FmZZH.cjs} +2 -2
  49. package/dist/{SubscriptionsScreen-C_U6YU-s.cjs.map → SubscriptionsScreen-Dr0FmZZH.cjs.map} +1 -1
  50. package/dist/index.cjs +75 -76
  51. package/dist/index.cjs.map +1 -1
  52. package/dist/index.d.cts +110 -20
  53. package/dist/index.d.cts.map +1 -1
  54. package/dist/index.d.mts +110 -20
  55. package/dist/index.d.mts.map +1 -1
  56. package/dist/index.mjs +75 -76
  57. package/dist/index.mjs.map +1 -1
  58. package/dist/{portal_tenant-5kK658sL.cjs → portal_tenant-CvP7rhIy.cjs} +1 -33
  59. package/dist/{portal_tenant-5kK658sL.cjs.map → portal_tenant-CvP7rhIy.cjs.map} +1 -1
  60. package/dist/{portal_tenant-vEh8wfqU.mjs → portal_tenant-Vkge0BiD.mjs} +2 -22
  61. package/dist/{portal_tenant-vEh8wfqU.mjs.map → portal_tenant-Vkge0BiD.mjs.map} +1 -1
  62. package/dist/{portal_tenant_content-DZ8AqoU_.cjs → portal_tenant_content-Bq8PD-Sz.cjs} +1 -17
  63. package/dist/portal_tenant_content-Bq8PD-Sz.cjs.map +1 -0
  64. package/dist/{portal_tenant_content-5fNROcju.mjs → portal_tenant_content-C8DCQLR3.mjs} +2 -12
  65. package/dist/portal_tenant_content-C8DCQLR3.mjs.map +1 -0
  66. package/package.json +17 -17
  67. package/dist/FluidProvider-C6NlPdMA.mjs.map +0 -1
  68. package/dist/FluidProvider-MjOyxZEf.cjs.map +0 -1
  69. package/dist/portal_tenant_content-5fNROcju.mjs.map +0 -1
  70. package/dist/portal_tenant_content-DZ8AqoU_.cjs.map +0 -1
@@ -4,8 +4,8 @@ const require_account_api_context = require("./account-api-context-DZP9IiGg.cjs"
4
4
  const require_store_api_context = require("./store-api-context-D1gZn22Z.cjs");
5
5
  const require_mysite_api_context = require("./mysite-api-context-CilZcDS4.cjs");
6
6
  const require_countries_api_context = require("./countries-api-context-G-NW4BoH.cjs");
7
- const require_portal_tenant = require("./portal_tenant-5kK658sL.cjs");
8
- const require_portal_tenant_content = require("./portal_tenant_content-DZ8AqoU_.cjs");
7
+ const require_portal_tenant = require("./portal_tenant-CvP7rhIy.cjs");
8
+ const require_portal_tenant_content = require("./portal_tenant_content-Bq8PD-Sz.cjs");
9
9
  const require_PortalTenantClientProvider = require("./PortalTenantClientProvider-CVv-4rQ9.cjs");
10
10
  const require_registry_context = require("./registry-context-CyQ7qh6B.cjs");
11
11
  const require_EmbedWidget = require("./EmbedWidget-DMkeMXMy.cjs");
@@ -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;
@@ -723,6 +708,9 @@ function createFetchClient(config) {
723
708
  function throwIfAborted(signal) {
724
709
  if (signal?.aborted) throw new DOMException("Aborted", "AbortError");
725
710
  }
711
+ function bffNotSupported(op) {
712
+ throw new Error(`[portal-tenant-adapter] "${op}" is not available on the portal-tenant BFF. Wire the legacy adapter for this feature, or re-add the endpoint to the BFF spec.`);
713
+ }
726
714
  /**
727
715
  * Map a BFF order response to the port's NormalizedOrder shape.
728
716
  * Centralizes the boundary between BFF wire format and our canonical type
@@ -775,23 +763,11 @@ function toNormalizedSubscription(raw) {
775
763
  */
776
764
  function createDataSourceApiAdapter(client, contentClient) {
777
765
  return {
778
- async fetchMostShared(_repId, options) {
779
- throwIfAborted(options.signal);
780
- const params = { shareable_type: options.shareableType };
781
- if (options.limit != null) params.limit = options.limit;
782
- if (options.period && options.period !== "all") params.period = options.period;
783
- const response = await require_portal_tenant.analytics_most_share_visits(client, params);
784
- throwIfAborted(options.signal);
785
- return response.resources ?? [];
766
+ async fetchMostShared(_repId, _options) {
767
+ bffNotSupported("fetchMostShared");
786
768
  },
787
- async fetchMostViewed(_repId, options) {
788
- throwIfAborted(options.signal);
789
- const params = { shareable_type: options.shareableType };
790
- if (options.limit != null) params.limit = options.limit;
791
- if (options.period && options.period !== "all") params.period = options.period;
792
- const response = await require_portal_tenant.analytics_most_viewed(client, params);
793
- throwIfAborted(options.signal);
794
- return response.resources ?? [];
769
+ async fetchMostViewed(_repId, _options) {
770
+ bffNotSupported("fetchMostViewed");
795
771
  },
796
772
  async fetchOrders(_customerId, options) {
797
773
  throwIfAborted(options?.signal);
@@ -844,16 +820,7 @@ function createDataSourceApiAdapter(client, contentClient) {
844
820
  ...pack
845
821
  };
846
822
  }
847
- case "Page": {
848
- const response = await require_portal_tenant_content.pages_show(contentClient, id);
849
- throwIfAborted(signal);
850
- const page = response.page;
851
- if (!page) throw new Error(`Page ${id} not found`);
852
- return {
853
- shareable_type: "Page",
854
- ...page
855
- };
856
- }
823
+ case "Page": bffNotSupported("fetchResource(\"Page\")");
857
824
  case "Library": {
858
825
  const response = await require_portal_tenant_content.playlists_show(contentClient, id);
859
826
  throwIfAborted(signal);
@@ -878,52 +845,48 @@ function createDataSourceApiAdapter(client, contentClient) {
878
845
  };
879
846
  }
880
847
  //#endregion
881
- //#region ../../api-clients/fluidos/src/namespaces/fluid_os.ts
882
- /**
883
- * Get active Fluid OS definition
884
- * Retrieve the active Fluid OS definition manifest for a specific platform
885
- *
886
- * @param client - Fetch client instance
887
- * @param params - params
888
- */
889
- async function getFluidOSManifest(client, params) {
890
- return client.get(`/api/fluid_os/definitions/active`, params);
891
- }
892
- //#endregion
893
- //#region src/adapters/fluidos-api-adapter.ts
894
- /** Create a FluidOsReadApi adapter backed by a FetchClient. */
895
- function createFluidOsReadAdapter(client) {
896
- return { getManifest: (params) => getFluidOSManifest(client, params) };
897
- }
898
- //#endregion
899
848
  //#region src/adapters/app-definition-api-adapter.ts
900
- function mapManifest(raw) {
901
- return {
902
- id: raw.definition_id ?? 0,
903
- name: raw.name ?? "",
904
- version: raw.published_version?.toString() ?? null,
905
- components: [],
906
- active: true
907
- };
908
- }
909
849
  /**
910
850
  * Creates an AppDefinitionApi adapter backed by the portal-tenant BFF client.
911
851
  *
912
- * Maps the generated portal-tenant `app_manifest_show` response to the
913
- * `AppDefinitionApi` port, applying runtime defaults for optional BFF fields
914
- * 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`.
915
855
  */
916
856
  function createAppDefinitionApiAdapter(client) {
917
- return { fetchDefinition: async () => {
857
+ async function fetchManifest() {
918
858
  const response = await require_portal_tenant.app_manifest_show(client);
919
859
  return {
920
- definition: mapManifest(response.manifest ?? {}),
860
+ manifest: response.manifest,
921
861
  meta: {
922
862
  request_id: response.meta?.request_id ?? "",
923
863
  timestamp: response.meta?.timestamp ?? ""
924
864
  }
925
865
  };
926
- } };
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
+ };
927
890
  }
928
891
  //#endregion
929
892
  //#region src/adapters/account-api-adapter.ts
@@ -1429,8 +1392,8 @@ async function mysite_links_bulk_reorder(client, body) {
1429
1392
  return client.patch(`/api/mysite/links/bulk`, body);
1430
1393
  }
1431
1394
  /**
1432
- * List MySite favorite products
1433
- * Returns the member's MySite favorite products.
1395
+ * List MySite favorites
1396
+ * Returns the member's MySite favorites (products, playlists, etc.).
1434
1397
  *
1435
1398
  * @param client - Fetch client instance
1436
1399
  * @param [params] - params
@@ -2561,14 +2524,6 @@ function FluidProvider({ config, children, queryClient, initialTheme, themeConta
2561
2524
  }, []);
2562
2525
  const configRef = (0, react.useRef)(config);
2563
2526
  configRef.current = config;
2564
- const fluidOsFetchClient = (0, react.useMemo)(() => createFetchClient({
2565
- baseUrl: configRef.current.baseUrl,
2566
- ...configRef.current.getAuthToken ? { getAuthToken: () => configRef.current.getAuthToken?.() ?? null } : {},
2567
- onAuthError: () => configRef.current.onAuthError?.(),
2568
- defaultHeaders: configRef.current.defaultHeaders,
2569
- credentials: "include"
2570
- }), [config.baseUrl]);
2571
- const fluidOsApi = (0, react.useMemo)(() => createFluidOsReadAdapter(fluidOsFetchClient), [fluidOsFetchClient]);
2572
2527
  const csrfToken = typeof document !== "undefined" ? document.querySelector("meta[name=\"csrf-token\"]")?.getAttribute("content") : null;
2573
2528
  const portalTenantClient = (0, react.useMemo)(() => createFetchClient({
2574
2529
  baseUrl: configRef.current.baseUrl,
@@ -2610,32 +2565,29 @@ function FluidProvider({ config, children, queryClient, initialTheme, themeConta
2610
2565
  value: contextValue,
2611
2566
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_PortalTenantClientProvider.PortalTenantClientProvider, {
2612
2567
  value: portalTenantClient,
2613
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FluidOsApiProvider, {
2614
- value: fluidOsApi,
2615
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AppDefinitionApiProvider, {
2616
- value: appDefinitionApi,
2617
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_account_api_context.AccountApiProvider, {
2618
- value: accountApi,
2619
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_store_api_context.StoreApiProvider, {
2620
- value: storeApi,
2621
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PayApiProvider, {
2622
- value: payApi,
2623
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_countries_api_context.CountriesApiProvider, {
2624
- value: countriesApi,
2625
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LanguagesApiProvider, {
2626
- value: languagesApi,
2627
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_mysite_api_context.MySiteApiProvider, {
2628
- value: mysiteApi,
2629
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ScreenRenderer.DataSourceApiProvider, {
2630
- value: dataSourceApi,
2631
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProviderStack, {
2632
- baseUrl: dataSourceBaseUrl,
2633
- getApiHeaders,
2634
- variables: effectiveVariables,
2635
- registry,
2636
- themeProviderProps,
2637
- children
2638
- })
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
2639
2591
  })
2640
2592
  })
2641
2593
  })
@@ -2911,12 +2863,6 @@ Object.defineProperty(exports, "useFluidContext", {
2911
2863
  return useFluidContext;
2912
2864
  }
2913
2865
  });
2914
- Object.defineProperty(exports, "useFluidOsApi", {
2915
- enumerable: true,
2916
- get: function() {
2917
- return useFluidOsApi;
2918
- }
2919
- });
2920
2866
  Object.defineProperty(exports, "useLanguagesApi", {
2921
2867
  enumerable: true,
2922
2868
  get: function() {
@@ -2942,4 +2888,4 @@ Object.defineProperty(exports, "widgetPropertySchemas", {
2942
2888
  }
2943
2889
  });
2944
2890
 
2945
- //# sourceMappingURL=FluidProvider-MjOyxZEf.cjs.map
2891
+ //# sourceMappingURL=FluidProvider-XHTzXe-E.cjs.map