@fluid-app/portal-sdk 0.1.147 → 0.1.149

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 (41) hide show
  1. package/dist/{ContactsScreen-CRwQbaPg.mjs → ContactsScreen-DtABz7O7.mjs} +2 -2
  2. package/dist/ContactsScreen-DtABz7O7.mjs.map +1 -0
  3. package/dist/{ContactsScreen-TDXVil2l.cjs → ContactsScreen-DuKE5ruf.cjs} +1 -1
  4. package/dist/{ContactsScreen-D7EBGdu1.cjs → ContactsScreen-psnV3fcP.cjs} +2 -2
  5. package/dist/ContactsScreen-psnV3fcP.cjs.map +1 -0
  6. package/dist/{MessagingScreen-D6jmQG0E.cjs → MessagingScreen-B5lqBpVo.cjs} +1 -1
  7. package/dist/{MessagingScreen-BG-eib6U.cjs → MessagingScreen-DSU_xyHK.cjs} +2 -2
  8. package/dist/MessagingScreen-DSU_xyHK.cjs.map +1 -0
  9. package/dist/{MessagingScreen-Bt0wmxDg.mjs → MessagingScreen-gbTy8V_o.mjs} +2 -2
  10. package/dist/MessagingScreen-gbTy8V_o.mjs.map +1 -0
  11. package/dist/{ProductsScreen-D6grDsLg.mjs → ProductsScreen--hkyw5c3.mjs} +9 -16
  12. package/dist/ProductsScreen--hkyw5c3.mjs.map +1 -0
  13. package/dist/{ProductsScreen-BYziWeSs.cjs → ProductsScreen-C8wwsfu0.cjs} +14 -21
  14. package/dist/ProductsScreen-C8wwsfu0.cjs.map +1 -0
  15. package/dist/{ProductsScreen-V6jOhd4m.cjs → ProductsScreen-DG_SMNs5.cjs} +2 -2
  16. package/dist/{ProductsScreen-CMpMLotN.mjs → ProductsScreen-IbgDLX51.mjs} +7 -2
  17. package/dist/{ShareablesScreen-BpOu1VpJ.cjs → ShareablesScreen-B0JMhiKA.cjs} +41 -26
  18. package/dist/ShareablesScreen-B0JMhiKA.cjs.map +1 -0
  19. package/dist/{ShareablesScreen-7W63bXCs.mjs → ShareablesScreen-B8ZsEkgi.mjs} +32 -17
  20. package/dist/ShareablesScreen-B8ZsEkgi.mjs.map +1 -0
  21. package/dist/{ShareablesScreen-DvCp2TyE.mjs → ShareablesScreen-C2zLeoy7.mjs} +8 -2
  22. package/dist/{ShareablesScreen-Do-aNX-x.cjs → ShareablesScreen-Caf2fI3S.cjs} +2 -2
  23. package/dist/index.cjs +13 -13
  24. package/dist/index.d.cts.map +1 -1
  25. package/dist/index.d.mts.map +1 -1
  26. package/dist/index.mjs +13 -13
  27. package/dist/{use-account-clients-DdEdLQc1.mjs → use-portal-shareables-api-CCRQARQM.mjs} +60 -28
  28. package/dist/use-portal-shareables-api-CCRQARQM.mjs.map +1 -0
  29. package/dist/{use-account-clients-Db7XdaFV.cjs → use-portal-shareables-api-CwSezl14.cjs} +65 -57
  30. package/dist/use-portal-shareables-api-CwSezl14.cjs.map +1 -0
  31. package/package.json +18 -17
  32. package/dist/ContactsScreen-CRwQbaPg.mjs.map +0 -1
  33. package/dist/ContactsScreen-D7EBGdu1.cjs.map +0 -1
  34. package/dist/MessagingScreen-BG-eib6U.cjs.map +0 -1
  35. package/dist/MessagingScreen-Bt0wmxDg.mjs.map +0 -1
  36. package/dist/ProductsScreen-BYziWeSs.cjs.map +0 -1
  37. package/dist/ProductsScreen-D6grDsLg.mjs.map +0 -1
  38. package/dist/ShareablesScreen-7W63bXCs.mjs.map +0 -1
  39. package/dist/ShareablesScreen-BpOu1VpJ.cjs.map +0 -1
  40. package/dist/use-account-clients-Db7XdaFV.cjs.map +0 -1
  41. package/dist/use-account-clients-DdEdLQc1.mjs.map +0 -1
@@ -1,11 +1,13 @@
1
1
  const require_chunk = require("./chunk-9hOWP6kD.cjs");
2
2
  const require_FluidProvider = require("./FluidProvider-C6WODD6y.cjs");
3
+ const require_PortalTenantClientProvider = require("./PortalTenantClientProvider-B_cJW53Y.cjs");
3
4
  const require_src = require("./src-DvJ4o9Sq.cjs");
4
5
  const require_ScreenHeaderContext = require("./ScreenHeaderContext-DRIKmM2G.cjs");
5
6
  const require_dist$3 = require("./dist-C-JA9EGF.cjs");
6
7
  const require_es = require("./es-D_ZSl548.cjs");
7
8
  const require_SearchSort = require("./SearchSort-29u6qhlf.cjs");
8
9
  const require_dist$4 = require("./dist-CAB6oMLL.cjs");
10
+ const require_use_portal_products_client = require("./use-portal-products-client-CYenp38s.cjs");
9
11
  const require_dist$5 = require("./dist-Mf7Sx86H.cjs");
10
12
  let react = require("react");
11
13
  react = require_chunk.__toESM(react);
@@ -8865,6 +8867,36 @@ function ProductsApp({ countryCode, companyLogoUrl, fetchProducts, fetchProduct,
8865
8867
  });
8866
8868
  }
8867
8869
  //#endregion
8870
+ //#region src/account/use-account-clients.ts
8871
+ /**
8872
+ * Ensures baseUrl ends with /api.
8873
+ * Uncovered endpoints (e.g. /countries, points ledgers) use paths without the
8874
+ * /api prefix, so the base URL must include it.
8875
+ */
8876
+ function withApiPrefix(baseUrl) {
8877
+ const base = baseUrl.replace(/\/+$/, "");
8878
+ return base.endsWith("/api") ? base : `${base}/api`;
8879
+ }
8880
+ /**
8881
+ * Generic SDK fetch client for endpoints not covered by domain-specific clients
8882
+ * (e.g. /countries, /v202506/customers/:id/points_ledgers).
8883
+ *
8884
+ * **Documented exception to the `usePortalTenantClient()` rule.**
8885
+ * This client requires `/api` in the base URL because its consumers
8886
+ * (products-api-client, shareables-core) call paths like `/company/v1/products`
8887
+ * and `/user_companies/:id/favorites/toggle.json` that are served under the
8888
+ * `/api` prefix. The shared portal-tenant client intentionally omits `/api`
8889
+ * because generated BFF namespace functions already include it in their paths.
8890
+ */
8891
+ function useSdkClient() {
8892
+ const { config } = require_FluidProvider.useFluidContext();
8893
+ return (0, react.useMemo)(() => require_FluidProvider.createFetchClient({
8894
+ baseUrl: withApiPrefix(config.baseUrl),
8895
+ onAuthError: config.onAuthError,
8896
+ credentials: "include"
8897
+ }), [config.baseUrl, config.onAuthError]);
8898
+ }
8899
+ //#endregion
8868
8900
  //#region ../../api-clients/portal-tenant-content/src/namespaces/portal_tenant_content.ts
8869
8901
  /**
8870
8902
  * List media (own uploads and company media)
@@ -9826,34 +9858,34 @@ function createPortalTenantProductMediaShareablesAdapter(source) {
9826
9858
  } };
9827
9859
  }
9828
9860
  //#endregion
9829
- //#region src/account/use-account-clients.ts
9830
- /**
9831
- * Ensures baseUrl ends with /api.
9832
- * Uncovered endpoints (e.g. /countries, points ledgers) use paths without the
9833
- * /api prefix, so the base URL must include it.
9834
- */
9835
- function withApiPrefix(baseUrl) {
9836
- const base = baseUrl.replace(/\/+$/, "");
9837
- return base.endsWith("/api") ? base : `${base}/api`;
9838
- }
9861
+ //#region src/shareables/use-portal-shareables-api.ts
9839
9862
  /**
9840
- * Generic SDK fetch client for endpoints not covered by domain-specific clients
9841
- * (e.g. /countries, /v202506/customers/:id/points_ledgers).
9842
- *
9843
- * **Documented exception to the `usePortalTenantClient()` rule.**
9844
- * This client requires `/api` in the base URL because its consumers
9845
- * (products-api-client, shareables-core) call paths like `/company/v1/products`
9846
- * and `/user_companies/:id/favorites/toggle.json` that are served under the
9847
- * `/api` prefix. The shared portal-tenant client intentionally omits `/api`
9848
- * because generated BFF namespace functions already include it in their paths.
9863
+ * Composes all ShareablesApi adapters from the portal-tenant BFF client.
9864
+ * Screens consume this hook instead of importing adapter factories directly.
9849
9865
  */
9850
- function useSdkClient() {
9851
- const { config } = require_FluidProvider.useFluidContext();
9852
- return (0, react.useMemo)(() => require_FluidProvider.createFetchClient({
9853
- baseUrl: withApiPrefix(config.baseUrl),
9854
- onAuthError: config.onAuthError,
9855
- credentials: "include"
9856
- }), [config.baseUrl, config.onAuthError]);
9866
+ function usePortalShareablesApi() {
9867
+ const client = require_PortalTenantClientProvider.usePortalTenantClient();
9868
+ const portalProductsApi = require_use_portal_products_client.usePortalProductsClient();
9869
+ const media = (0, react.useMemo)(() => createPortalTenantMediaShareablesAdapter(client), [client]);
9870
+ const playlists = (0, react.useMemo)(() => createPortalTenantPlaylistsShareablesAdapter(client), [client]);
9871
+ const fileResources = (0, react.useMemo)(() => createPortalTenantFilesShareablesAdapter(client), [client]);
9872
+ const share = (0, react.useMemo)(() => createPortalTenantSharesShareablesAdapter(client), [client]);
9873
+ const productMedia = (0, react.useMemo)(() => createPortalTenantProductMediaShareablesAdapter(portalProductsApi), [portalProductsApi]);
9874
+ return (0, react.useMemo)(() => ({
9875
+ media,
9876
+ playlists,
9877
+ fileResources,
9878
+ share,
9879
+ productMedia,
9880
+ productsApi: portalProductsApi
9881
+ }), [
9882
+ media,
9883
+ playlists,
9884
+ fileResources,
9885
+ share,
9886
+ productMedia,
9887
+ portalProductsApi
9888
+ ]);
9857
9889
  }
9858
9890
  //#endregion
9859
9891
  Object.defineProperty(exports, "ProductsApp", {
@@ -9886,42 +9918,12 @@ Object.defineProperty(exports, "ShareablesUIProvider", {
9886
9918
  return ShareablesUIProvider;
9887
9919
  }
9888
9920
  });
9889
- Object.defineProperty(exports, "createPortalTenantFilesShareablesAdapter", {
9890
- enumerable: true,
9891
- get: function() {
9892
- return createPortalTenantFilesShareablesAdapter;
9893
- }
9894
- });
9895
- Object.defineProperty(exports, "createPortalTenantMediaShareablesAdapter", {
9896
- enumerable: true,
9897
- get: function() {
9898
- return createPortalTenantMediaShareablesAdapter;
9899
- }
9900
- });
9901
9921
  Object.defineProperty(exports, "createPortalTenantPlaylistsAdapter", {
9902
9922
  enumerable: true,
9903
9923
  get: function() {
9904
9924
  return createPortalTenantPlaylistsAdapter;
9905
9925
  }
9906
9926
  });
9907
- Object.defineProperty(exports, "createPortalTenantPlaylistsShareablesAdapter", {
9908
- enumerable: true,
9909
- get: function() {
9910
- return createPortalTenantPlaylistsShareablesAdapter;
9911
- }
9912
- });
9913
- Object.defineProperty(exports, "createPortalTenantProductMediaShareablesAdapter", {
9914
- enumerable: true,
9915
- get: function() {
9916
- return createPortalTenantProductMediaShareablesAdapter;
9917
- }
9918
- });
9919
- Object.defineProperty(exports, "createPortalTenantSharesShareablesAdapter", {
9920
- enumerable: true,
9921
- get: function() {
9922
- return createPortalTenantSharesShareablesAdapter;
9923
- }
9924
- });
9925
9927
  Object.defineProperty(exports, "dam_asset_paths_create", {
9926
9928
  enumerable: true,
9927
9929
  get: function() {
@@ -9946,6 +9948,12 @@ Object.defineProperty(exports, "dam_query", {
9946
9948
  return dam_query;
9947
9949
  }
9948
9950
  });
9951
+ Object.defineProperty(exports, "usePortalShareablesApi", {
9952
+ enumerable: true,
9953
+ get: function() {
9954
+ return usePortalShareablesApi;
9955
+ }
9956
+ });
9949
9957
  Object.defineProperty(exports, "useSdkClient", {
9950
9958
  enumerable: true,
9951
9959
  get: function() {
@@ -9953,4 +9961,4 @@ Object.defineProperty(exports, "useSdkClient", {
9953
9961
  }
9954
9962
  });
9955
9963
 
9956
- //# sourceMappingURL=use-account-clients-Db7XdaFV.cjs.map
9964
+ //# sourceMappingURL=use-portal-shareables-api-CwSezl14.cjs.map