@fluid-app/portal-sdk 0.1.129 → 0.1.130
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.
- package/dist/{AppDownloadScreen-DTxo4z3_.cjs → AppDownloadScreen-ChKim_6A.cjs} +2 -2
- package/dist/{AppDownloadScreen-DTxo4z3_.cjs.map → AppDownloadScreen-ChKim_6A.cjs.map} +1 -1
- package/dist/{AppDownloadScreen-BoGSdsJk.mjs → AppDownloadScreen-DGHd6hYM.mjs} +2 -2
- package/dist/{AppDownloadScreen-BoGSdsJk.mjs.map → AppDownloadScreen-DGHd6hYM.mjs.map} +1 -1
- package/dist/{AppDownloadScreen-Chxavsr_.cjs → AppDownloadScreen-DpyV1tJw.cjs} +2 -2
- package/dist/{ContactsScreen-BKOHursc.mjs → ContactsScreen-Bcea6126.mjs} +3 -3
- package/dist/{ContactsScreen-BKOHursc.mjs.map → ContactsScreen-Bcea6126.mjs.map} +1 -1
- package/dist/{ContactsScreen-DN8Qt2Ih.cjs → ContactsScreen-CsIGZaWy.cjs} +4 -4
- package/dist/{ContactsScreen-DN8Qt2Ih.cjs.map → ContactsScreen-CsIGZaWy.cjs.map} +1 -1
- package/dist/{ContactsScreen-FrVLbjGO.cjs → ContactsScreen-OBDC1046.cjs} +4 -4
- package/dist/{FluidProvider-CgTeGUnF.mjs → FluidProvider-BJQSXofR.mjs} +198 -615
- package/dist/FluidProvider-BJQSXofR.mjs.map +1 -0
- package/dist/{FluidProvider-BMMu_rp3.cjs → FluidProvider-DvqnkjZI.cjs} +196 -625
- package/dist/FluidProvider-DvqnkjZI.cjs.map +1 -0
- package/dist/{MessagingScreen-Bvq3Dd5i.mjs → MessagingScreen-B48ksZOJ.mjs} +3 -3
- package/dist/{MessagingScreen-Bvq3Dd5i.mjs.map → MessagingScreen-B48ksZOJ.mjs.map} +1 -1
- package/dist/{MessagingScreen-DMDXiH97.mjs → MessagingScreen-COGo4S9K.mjs} +2 -2
- package/dist/{MessagingScreen-DgbNN4BF.cjs → MessagingScreen-DYgiatey.cjs} +3 -3
- package/dist/{MessagingScreen-DgbNN4BF.cjs.map → MessagingScreen-DYgiatey.cjs.map} +1 -1
- package/dist/{MessagingScreen-bzzXjQMu.cjs → MessagingScreen-QyUOxYXl.cjs} +2 -2
- package/dist/{MySiteScreen-nV8x9xyy.cjs → MySiteScreen-ByIJ6CkU.cjs} +2 -2
- package/dist/{MySiteScreen-nV8x9xyy.cjs.map → MySiteScreen-ByIJ6CkU.cjs.map} +1 -1
- package/dist/{MySiteScreen-BJH5-RNT.mjs → MySiteScreen-DZ0ru6Bn.mjs} +2 -2
- package/dist/{MySiteScreen-BJH5-RNT.mjs.map → MySiteScreen-DZ0ru6Bn.mjs.map} +1 -1
- package/dist/{MySiteScreen-CYZpUYTn.cjs → MySiteScreen-DrWUJJiH.cjs} +2 -2
- package/dist/{OrdersScreen-BL__flBE.cjs → OrdersScreen-CkvoeTvK.cjs} +3 -3
- package/dist/OrdersScreen-D_7TJgZ4.mjs +561 -0
- package/dist/OrdersScreen-D_7TJgZ4.mjs.map +1 -0
- package/dist/OrdersScreen-DyYYjl9I.cjs +568 -0
- package/dist/OrdersScreen-DyYYjl9I.cjs.map +1 -0
- package/dist/{ProductsScreen-BIYHPaBZ.cjs → ProductsScreen-B8NmyIJy.cjs} +3 -3
- package/dist/{ProductsScreen-COwahI-V.mjs → ProductsScreen-CMnhqsSA.mjs} +5 -5
- package/dist/{ProductsScreen-COwahI-V.mjs.map → ProductsScreen-CMnhqsSA.mjs.map} +1 -1
- package/dist/{ProductsScreen-D6h-r9ht.mjs → ProductsScreen-DzNmbwVi.mjs} +3 -3
- package/dist/{ProductsScreen-C8UfVLRr.cjs → ProductsScreen-Z1hx1YZQ.cjs} +5 -5
- package/dist/{ProductsScreen-C8UfVLRr.cjs.map → ProductsScreen-Z1hx1YZQ.cjs.map} +1 -1
- package/dist/{ProfileScreen-CZp_NrjO.cjs → ProfileScreen-B81Ovmh_.cjs} +2 -2
- package/dist/{ProfileScreen-FYGHStqM.cjs → ProfileScreen-CYTxOGeW.cjs} +526 -137
- package/dist/ProfileScreen-CYTxOGeW.cjs.map +1 -0
- package/dist/{ProfileScreen-BKRn8AqI.mjs → ProfileScreen-QOXtyrJi.mjs} +522 -133
- package/dist/ProfileScreen-QOXtyrJi.mjs.map +1 -0
- package/dist/{ShareablesScreen-BEPVTMeI.cjs → ShareablesScreen-1HpfEjyd.cjs} +7 -7
- package/dist/{ShareablesScreen-BEPVTMeI.cjs.map → ShareablesScreen-1HpfEjyd.cjs.map} +1 -1
- package/dist/{ShareablesScreen-BrC5LGtU.cjs → ShareablesScreen-BXO8MpAy.cjs} +3 -3
- package/dist/{ShareablesScreen-BXzxUg0E.mjs → ShareablesScreen-DSsMJJh_.mjs} +7 -7
- package/dist/{ShareablesScreen-BXzxUg0E.mjs.map → ShareablesScreen-DSsMJJh_.mjs.map} +1 -1
- package/dist/{ShareablesScreen-aMnwEOAH.mjs → ShareablesScreen-Oo3jMHX6.mjs} +3 -3
- package/dist/{ShopScreen-CHH0cx2P.cjs → ShopScreen-BDcWpmi7.cjs} +4 -4
- package/dist/{ShopScreen-CHH0cx2P.cjs.map → ShopScreen-BDcWpmi7.cjs.map} +1 -1
- package/dist/{ShopScreen-8OQhLeLt.cjs → ShopScreen-CWxOPn7H.cjs} +2 -2
- package/dist/{ShopScreen-Yi9sOX_2.mjs → ShopScreen-DsReuJ7P.mjs} +4 -4
- package/dist/{ShopScreen-Yi9sOX_2.mjs.map → ShopScreen-DsReuJ7P.mjs.map} +1 -1
- package/dist/{SubscriptionsScreen-oApGaq11.cjs → SubscriptionsScreen-B8mLGt5-.cjs} +27 -10
- package/dist/SubscriptionsScreen-B8mLGt5-.cjs.map +1 -0
- package/dist/{SubscriptionsScreen-C2F3HNJS.cjs → SubscriptionsScreen-C2zbEjMC.cjs} +4 -4
- package/dist/{SubscriptionsScreen-CZ-1jSO2.mjs → SubscriptionsScreen-DZxLo4up.mjs} +21 -4
- package/dist/SubscriptionsScreen-DZxLo4up.mjs.map +1 -0
- package/dist/index.cjs +37 -37
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +37 -37
- package/dist/order-status-badge-KooNqnAs.mjs +262 -0
- package/dist/order-status-badge-KooNqnAs.mjs.map +1 -0
- package/dist/order-status-badge-cwqA8dZ-.cjs +304 -0
- package/dist/order-status-badge-cwqA8dZ-.cjs.map +1 -0
- package/dist/portal_tenant-CP5Ce8Jn.cjs +261 -0
- package/dist/portal_tenant-CP5Ce8Jn.cjs.map +1 -0
- package/dist/portal_tenant-CWy4Zg2t.mjs +166 -0
- package/dist/portal_tenant-CWy4Zg2t.mjs.map +1 -0
- package/dist/src-BOIW-KES.mjs +3 -0
- package/dist/src-CzwiFO_J.cjs +3 -0
- package/dist/{src-BMUEjfhg.mjs → src-Dgo44BGe.mjs} +1 -1
- package/dist/{src-BMUEjfhg.mjs.map → src-Dgo44BGe.mjs.map} +1 -1
- package/dist/{src-BJdOxgpp.cjs → src-DkhHoxnS.cjs} +1 -1
- package/dist/{src-BJdOxgpp.cjs.map → src-DkhHoxnS.cjs.map} +1 -1
- package/dist/use-account-clients-Dim60sir.mjs +451 -0
- package/dist/use-account-clients-Dim60sir.mjs.map +1 -0
- package/dist/use-account-clients-DoJW3KTx.cjs +481 -0
- package/dist/use-account-clients-DoJW3KTx.cjs.map +1 -0
- package/dist/{use-current-user-DCk55_Qn.mjs → use-current-user-Baxj7HJt.mjs} +3 -3
- package/dist/{use-current-user-DCk55_Qn.mjs.map → use-current-user-Baxj7HJt.mjs.map} +1 -1
- package/dist/{use-current-user-BR5_zaoZ.cjs → use-current-user-BcZWV7oU.cjs} +3 -3
- package/dist/{use-current-user-BR5_zaoZ.cjs.map → use-current-user-BcZWV7oU.cjs.map} +1 -1
- package/dist/{use-fluid-api-CmCAH10d.mjs → use-fluid-api-BP05Cf-f.mjs} +2 -2
- package/dist/{use-fluid-api-CmCAH10d.mjs.map → use-fluid-api-BP05Cf-f.mjs.map} +1 -1
- package/dist/{use-fluid-api-C1KeHB7q.cjs → use-fluid-api-Ds8BInAZ.cjs} +2 -2
- package/dist/{use-fluid-api-C1KeHB7q.cjs.map → use-fluid-api-Ds8BInAZ.cjs.map} +1 -1
- package/dist/{use-fluid-auth-BQEV7ylM.mjs → use-fluid-auth-C-Qpl8j4.mjs} +2 -2
- package/dist/{use-fluid-auth-BQEV7ylM.mjs.map → use-fluid-auth-C-Qpl8j4.mjs.map} +1 -1
- package/dist/{use-fluid-auth-CyKaXLbW.cjs → use-fluid-auth-sGNMgfnt.cjs} +2 -2
- package/dist/{use-fluid-auth-CyKaXLbW.cjs.map → use-fluid-auth-sGNMgfnt.cjs.map} +1 -1
- package/dist/{use-portal-products-client-pptYMuSw.cjs → use-portal-products-client-DKYkBjm-.cjs} +7 -48
- package/dist/use-portal-products-client-DKYkBjm-.cjs.map +1 -0
- package/dist/{use-portal-products-client-BL1xVtex.mjs → use-portal-products-client-s2qtZjhU.mjs} +3 -44
- package/dist/use-portal-products-client-s2qtZjhU.mjs.map +1 -0
- package/package.json +13 -12
- package/dist/FluidProvider-BMMu_rp3.cjs.map +0 -1
- package/dist/FluidProvider-CgTeGUnF.mjs.map +0 -1
- package/dist/OrdersScreen-BLb3_KtI.mjs +0 -176
- package/dist/OrdersScreen-BLb3_KtI.mjs.map +0 -1
- package/dist/OrdersScreen-uL3mRk1h.cjs +0 -183
- package/dist/OrdersScreen-uL3mRk1h.cjs.map +0 -1
- package/dist/ProfileScreen-BKRn8AqI.mjs.map +0 -1
- package/dist/ProfileScreen-FYGHStqM.cjs.map +0 -1
- package/dist/SubscriptionsScreen-CZ-1jSO2.mjs.map +0 -1
- package/dist/SubscriptionsScreen-oApGaq11.cjs.map +0 -1
- package/dist/order-detail-DHXdE4Cl.cjs +0 -961
- package/dist/order-detail-DHXdE4Cl.cjs.map +0 -1
- package/dist/order-detail-iZm_R0TX.mjs +0 -931
- package/dist/order-detail-iZm_R0TX.mjs.map +0 -1
- package/dist/src-BJSTFxSO.mjs +0 -1
- package/dist/src-DMVR26Fk.cjs +0 -1
- package/dist/use-account-clients-CL6rr17o.cjs +0 -214
- package/dist/use-account-clients-CL6rr17o.cjs.map +0 -1
- package/dist/use-account-clients-CMjRB5On.mjs +0 -190
- package/dist/use-account-clients-CMjRB5On.mjs.map +0 -1
- package/dist/use-customer-account-BAolVc3q.mjs +0 -22
- package/dist/use-customer-account-BAolVc3q.mjs.map +0 -1
- package/dist/use-customer-account-DSsXbcme.cjs +0 -28
- package/dist/use-customer-account-DSsXbcme.cjs.map +0 -1
- package/dist/use-portal-products-client-BL1xVtex.mjs.map +0 -1
- package/dist/use-portal-products-client-pptYMuSw.cjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_FluidProvider = require("./FluidProvider-
|
|
1
|
+
const require_FluidProvider = require("./FluidProvider-DvqnkjZI.cjs");
|
|
2
2
|
//#region src/hooks/use-fluid-api.ts
|
|
3
3
|
/**
|
|
4
4
|
* Hook to access the Fluid API client
|
|
@@ -29,4 +29,4 @@ Object.defineProperty(exports, "useFluidApi", {
|
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
|
|
32
|
-
//# sourceMappingURL=use-fluid-api-
|
|
32
|
+
//# sourceMappingURL=use-fluid-api-Ds8BInAZ.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-fluid-api-
|
|
1
|
+
{"version":3,"file":"use-fluid-api-Ds8BInAZ.cjs","names":["useFluidContext"],"sources":["../src/hooks/use-fluid-api.ts"],"sourcesContent":["import { useFluidContext } from \"../providers/FluidProvider\";\nimport type { FluidClient } from \"../client/fluid-client\";\n\n/**\n * Hook to access the Fluid API client\n *\n * @example\n * ```tsx\n * function UserInfo() {\n * const api = useFluidApi();\n *\n * const { data: user } = useQuery({\n * queryKey: [\"me\"],\n * queryFn: () => api.users.me(),\n * });\n *\n * return <p>Hello, {user?.name}</p>;\n * }\n * ```\n */\nexport function useFluidApi(): FluidClient {\n const { client } = useFluidContext();\n return client;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAoBA,SAAgB,cAA2B;CACzC,MAAM,EAAE,WAAWA,sBAAAA,iBAAiB;AACpC,QAAO"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as useFluidAuthContext } from "./FluidProvider-
|
|
1
|
+
import { l as useFluidAuthContext } from "./FluidProvider-BJQSXofR.mjs";
|
|
2
2
|
//#region src/hooks/use-fluid-auth.ts
|
|
3
3
|
/**
|
|
4
4
|
* useFluidAuth Hook
|
|
@@ -42,4 +42,4 @@ function useFluidAuth() {
|
|
|
42
42
|
//#endregion
|
|
43
43
|
export { useFluidAuth as t };
|
|
44
44
|
|
|
45
|
-
//# sourceMappingURL=use-fluid-auth-
|
|
45
|
+
//# sourceMappingURL=use-fluid-auth-C-Qpl8j4.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-fluid-auth-
|
|
1
|
+
{"version":3,"file":"use-fluid-auth-C-Qpl8j4.mjs","names":[],"sources":["../src/hooks/use-fluid-auth.ts"],"sourcesContent":["/**\n * useFluidAuth Hook\n *\n * Provides access to authentication state and utilities.\n * This is the primary hook for interacting with auth in components.\n */\n\nimport { useFluidAuthContext } from \"../providers/FluidAuthProvider\";\nimport type { FluidAuthContextValue } from \"../auth/types\";\n\n/**\n * Hook to access authentication state and utilities.\n *\n * Must be used within a `FluidAuthProvider`.\n *\n * @returns Authentication context with user info, loading state, and utilities\n * @throws Error if used outside FluidAuthProvider\n *\n * @example\n * ```tsx\n * function UserProfile() {\n * const { isAuthenticated, isLoading, user, clearAuth } = useFluidAuth();\n *\n * if (isLoading) {\n * return <Spinner />;\n * }\n *\n * if (!isAuthenticated) {\n * return <p>Please log in</p>;\n * }\n *\n * return (\n * <div>\n * <p>Welcome, {user.full_name}!</p>\n * <button onClick={clearAuth}>Log out</button>\n * </div>\n * );\n * }\n * ```\n */\nexport function useFluidAuth(): FluidAuthContextValue {\n return useFluidAuthContext();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,SAAgB,eAAsC;AACpD,QAAO,qBAAqB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_FluidProvider = require("./FluidProvider-
|
|
1
|
+
const require_FluidProvider = require("./FluidProvider-DvqnkjZI.cjs");
|
|
2
2
|
//#region src/hooks/use-fluid-auth.ts
|
|
3
3
|
/**
|
|
4
4
|
* useFluidAuth Hook
|
|
@@ -47,4 +47,4 @@ Object.defineProperty(exports, "useFluidAuth", {
|
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
49
|
|
|
50
|
-
//# sourceMappingURL=use-fluid-auth-
|
|
50
|
+
//# sourceMappingURL=use-fluid-auth-sGNMgfnt.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-fluid-auth-
|
|
1
|
+
{"version":3,"file":"use-fluid-auth-sGNMgfnt.cjs","names":["useFluidAuthContext"],"sources":["../src/hooks/use-fluid-auth.ts"],"sourcesContent":["/**\n * useFluidAuth Hook\n *\n * Provides access to authentication state and utilities.\n * This is the primary hook for interacting with auth in components.\n */\n\nimport { useFluidAuthContext } from \"../providers/FluidAuthProvider\";\nimport type { FluidAuthContextValue } from \"../auth/types\";\n\n/**\n * Hook to access authentication state and utilities.\n *\n * Must be used within a `FluidAuthProvider`.\n *\n * @returns Authentication context with user info, loading state, and utilities\n * @throws Error if used outside FluidAuthProvider\n *\n * @example\n * ```tsx\n * function UserProfile() {\n * const { isAuthenticated, isLoading, user, clearAuth } = useFluidAuth();\n *\n * if (isLoading) {\n * return <Spinner />;\n * }\n *\n * if (!isAuthenticated) {\n * return <p>Please log in</p>;\n * }\n *\n * return (\n * <div>\n * <p>Welcome, {user.full_name}!</p>\n * <button onClick={clearAuth}>Log out</button>\n * </div>\n * );\n * }\n * ```\n */\nexport function useFluidAuth(): FluidAuthContextValue {\n return useFluidAuthContext();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,SAAgB,eAAsC;AACpD,QAAOA,sBAAAA,qBAAqB"}
|
package/dist/{use-portal-products-client-pptYMuSw.cjs → use-portal-products-client-DKYkBjm-.cjs}
RENAMED
|
@@ -1,48 +1,7 @@
|
|
|
1
1
|
require("./chunk-9hOWP6kD.cjs");
|
|
2
|
-
const require_FluidProvider = require("./FluidProvider-
|
|
2
|
+
const require_FluidProvider = require("./FluidProvider-DvqnkjZI.cjs");
|
|
3
|
+
const require_portal_tenant = require("./portal_tenant-CP5Ce8Jn.cjs");
|
|
3
4
|
let react = require("react");
|
|
4
|
-
//#region ../../api-clients/portal-tenant/src/namespaces/portal_tenant.ts
|
|
5
|
-
/**
|
|
6
|
-
* List products
|
|
7
|
-
* Returns a paginated list of products available in the tenant company's catalog.
|
|
8
|
-
*
|
|
9
|
-
* @param client - Fetch client instance
|
|
10
|
-
* @param [params] - params
|
|
11
|
-
*/
|
|
12
|
-
async function products_list(client, params) {
|
|
13
|
-
return client.get(`/api/products`, params);
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Get a product
|
|
17
|
-
* Returns a single product by ID with its variants.
|
|
18
|
-
*
|
|
19
|
-
* @param client - Fetch client instance
|
|
20
|
-
* @param id - id
|
|
21
|
-
*/
|
|
22
|
-
async function products_show(client, id) {
|
|
23
|
-
return client.get(`/api/products/${id}`);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Search products
|
|
27
|
-
* Searches the tenant company's product catalog by keyword, returning paginated results.
|
|
28
|
-
*
|
|
29
|
-
* @param client - Fetch client instance
|
|
30
|
-
* @param [params] - params
|
|
31
|
-
*/
|
|
32
|
-
async function products_search(client, params) {
|
|
33
|
-
return client.get(`/api/products/search`, params);
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* List product media
|
|
37
|
-
* Returns all media (images, videos) attached to a product.
|
|
38
|
-
*
|
|
39
|
-
* @param client - Fetch client instance
|
|
40
|
-
* @param id - id
|
|
41
|
-
*/
|
|
42
|
-
async function products_media_list(client, id) {
|
|
43
|
-
return client.get(`/api/products/${id}/media`);
|
|
44
|
-
}
|
|
45
|
-
//#endregion
|
|
46
5
|
//#region ../../products/api-client/src/portal-tenant-adapter.ts
|
|
47
6
|
/**
|
|
48
7
|
* Creates a PortalProductsApi-compatible adapter from a portal-tenant FetchClient.
|
|
@@ -58,7 +17,7 @@ async function products_media_list(client, id) {
|
|
|
58
17
|
function createPortalProductsApiAdapter(client) {
|
|
59
18
|
return {
|
|
60
19
|
listProducts: async (params) => {
|
|
61
|
-
const response = await products_list(client, {
|
|
20
|
+
const response = await require_portal_tenant.products_list(client, {
|
|
62
21
|
"page[cursor]": params?.cursor,
|
|
63
22
|
"page[limit]": params?.limit
|
|
64
23
|
});
|
|
@@ -68,14 +27,14 @@ function createPortalProductsApiAdapter(client) {
|
|
|
68
27
|
};
|
|
69
28
|
},
|
|
70
29
|
getProduct: async (id) => {
|
|
71
|
-
const response = await products_show(client, id);
|
|
30
|
+
const response = await require_portal_tenant.products_show(client, id);
|
|
72
31
|
return {
|
|
73
32
|
product: response.product ?? {},
|
|
74
33
|
meta: response.meta
|
|
75
34
|
};
|
|
76
35
|
},
|
|
77
36
|
searchProducts: async (query, params) => {
|
|
78
|
-
const response = await products_search(client, {
|
|
37
|
+
const response = await require_portal_tenant.products_search(client, {
|
|
79
38
|
q: query,
|
|
80
39
|
"page[cursor]": params?.cursor,
|
|
81
40
|
"page[limit]": params?.limit
|
|
@@ -86,7 +45,7 @@ function createPortalProductsApiAdapter(client) {
|
|
|
86
45
|
};
|
|
87
46
|
},
|
|
88
47
|
getProductMedia: async (productId) => {
|
|
89
|
-
const response = await products_media_list(client, productId);
|
|
48
|
+
const response = await require_portal_tenant.products_media_list(client, productId);
|
|
90
49
|
return {
|
|
91
50
|
media: response.media ?? [],
|
|
92
51
|
meta: response.meta
|
|
@@ -113,4 +72,4 @@ Object.defineProperty(exports, "usePortalProductsClient", {
|
|
|
113
72
|
}
|
|
114
73
|
});
|
|
115
74
|
|
|
116
|
-
//# sourceMappingURL=use-portal-products-client-
|
|
75
|
+
//# sourceMappingURL=use-portal-products-client-DKYkBjm-.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-portal-products-client-DKYkBjm-.cjs","names":["useFluidContext","createFetchClient"],"sources":["../../../products/api-client/src/portal-tenant-adapter.ts","../src/products/use-portal-products-client.ts"],"sourcesContent":["import type {\n PortalProductsApi,\n portalProducts,\n} from \"@fluid-app/products-core\";\nimport type { FetchClient } from \"./lib/fetch-client\";\nimport { portalTenant } from \"@fluid-app/portal-tenant-api-client\";\n\n/**\n * Creates a PortalProductsApi-compatible adapter from a portal-tenant FetchClient.\n *\n * This bridges the auto-generated portal-tenant API client to the abstract\n * PortalProductsApi interface defined in @fluid-app/products-core, closing\n * over the FetchClient so consumers don't need to pass it per-call.\n *\n * Each method maps the BFF response to the port type at runtime rather than\n * using type assertions, so TypeScript catches schema drift between the\n * generated client and the hand-authored port types at compile time.\n */\nexport function createPortalProductsApiAdapter(\n client: FetchClient,\n): PortalProductsApi {\n return {\n listProducts: async (params) => {\n const response = await portalTenant.products_list(client, {\n \"page[cursor]\": params?.cursor,\n \"page[limit]\": params?.limit,\n });\n return {\n products: response.products ?? [],\n meta: response.meta,\n } satisfies portalProducts.PortalProductsResponse;\n },\n\n getProduct: async (id) => {\n const response = await portalTenant.products_show(client, id);\n return {\n product: response.product ?? {},\n meta: response.meta,\n } satisfies portalProducts.PortalProductResponse;\n },\n\n searchProducts: async (query, params) => {\n const response = await portalTenant.products_search(client, {\n q: query,\n \"page[cursor]\": params?.cursor,\n \"page[limit]\": params?.limit,\n });\n return {\n products: response.products ?? [],\n meta: response.meta,\n } satisfies portalProducts.PortalProductsResponse;\n },\n\n getProductMedia: async (productId) => {\n const response = await portalTenant.products_media_list(\n client,\n productId,\n );\n return {\n media: response.media ?? [],\n meta: response.meta,\n } satisfies portalProducts.PortalProductMediaResponse;\n },\n };\n}\n","import { useMemo } from \"react\";\nimport type { PortalProductsApi } from \"@fluid-app/products-core\";\nimport { createPortalProductsApiAdapter } from \"@fluid-app/products-api-client\";\nimport { createFetchClient } from \"@fluid-app/portal-tenant-api-client\";\nimport { useFluidContext } from \"../providers/FluidProvider\";\n\nexport function usePortalProductsClient(): PortalProductsApi {\n const { config } = useFluidContext();\n\n return useMemo(() => {\n // Portal-tenant endpoints already include /api in their paths\n // (e.g. client.get('/api/products')), so the base URL must NOT\n // have /api appended — otherwise we get double /api/api.\n const client = createFetchClient({\n baseUrl: config.baseUrl.replace(/\\/+$/, \"\"),\n onAuthError: config.onAuthError,\n });\n return createPortalProductsApiAdapter(client);\n }, [config.baseUrl, config.onAuthError]);\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAkBA,SAAgB,+BACd,QACmB;AACnB,QAAO;EACL,cAAc,OAAO,WAAW;GAC9B,MAAM,WAAW,MAAA,sBAAA,cAAiC,QAAQ;IACxD,gBAAgB,QAAQ;IACxB,eAAe,QAAQ;IACxB,CAAC;AACF,UAAO;IACL,UAAU,SAAS,YAAY,EAAE;IACjC,MAAM,SAAS;IAChB;;EAGH,YAAY,OAAO,OAAO;GACxB,MAAM,WAAW,MAAA,sBAAA,cAAiC,QAAQ,GAAG;AAC7D,UAAO;IACL,SAAS,SAAS,WAAW,EAAE;IAC/B,MAAM,SAAS;IAChB;;EAGH,gBAAgB,OAAO,OAAO,WAAW;GACvC,MAAM,WAAW,MAAA,sBAAA,gBAAmC,QAAQ;IAC1D,GAAG;IACH,gBAAgB,QAAQ;IACxB,eAAe,QAAQ;IACxB,CAAC;AACF,UAAO;IACL,UAAU,SAAS,YAAY,EAAE;IACjC,MAAM,SAAS;IAChB;;EAGH,iBAAiB,OAAO,cAAc;GACpC,MAAM,WAAW,MAAA,sBAAA,oBACf,QACA,UACD;AACD,UAAO;IACL,OAAO,SAAS,SAAS,EAAE;IAC3B,MAAM,SAAS;IAChB;;EAEJ;;;;ACzDH,SAAgB,0BAA6C;CAC3D,MAAM,EAAE,WAAWA,sBAAAA,iBAAiB;AAEpC,SAAA,GAAA,MAAA,eAAqB;AAQnB,SAAO,+BAJQC,sBAAAA,kBAAkB;GAC/B,SAAS,OAAO,QAAQ,QAAQ,QAAQ,GAAG;GAC3C,aAAa,OAAO;GACrB,CAAC,CAC2C;IAC5C,CAAC,OAAO,SAAS,OAAO,YAAY,CAAC"}
|
package/dist/{use-portal-products-client-BL1xVtex.mjs → use-portal-products-client-s2qtZjhU.mjs}
RENAMED
|
@@ -1,47 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as useFluidContext, rt as createFetchClient } from "./FluidProvider-BJQSXofR.mjs";
|
|
2
|
+
import { a as products_list, c as products_show, o as products_media_list, s as products_search } from "./portal_tenant-CWy4Zg2t.mjs";
|
|
2
3
|
import { useMemo } from "react";
|
|
3
|
-
//#region ../../api-clients/portal-tenant/src/namespaces/portal_tenant.ts
|
|
4
|
-
/**
|
|
5
|
-
* List products
|
|
6
|
-
* Returns a paginated list of products available in the tenant company's catalog.
|
|
7
|
-
*
|
|
8
|
-
* @param client - Fetch client instance
|
|
9
|
-
* @param [params] - params
|
|
10
|
-
*/
|
|
11
|
-
async function products_list(client, params) {
|
|
12
|
-
return client.get(`/api/products`, params);
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Get a product
|
|
16
|
-
* Returns a single product by ID with its variants.
|
|
17
|
-
*
|
|
18
|
-
* @param client - Fetch client instance
|
|
19
|
-
* @param id - id
|
|
20
|
-
*/
|
|
21
|
-
async function products_show(client, id) {
|
|
22
|
-
return client.get(`/api/products/${id}`);
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Search products
|
|
26
|
-
* Searches the tenant company's product catalog by keyword, returning paginated results.
|
|
27
|
-
*
|
|
28
|
-
* @param client - Fetch client instance
|
|
29
|
-
* @param [params] - params
|
|
30
|
-
*/
|
|
31
|
-
async function products_search(client, params) {
|
|
32
|
-
return client.get(`/api/products/search`, params);
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* List product media
|
|
36
|
-
* Returns all media (images, videos) attached to a product.
|
|
37
|
-
*
|
|
38
|
-
* @param client - Fetch client instance
|
|
39
|
-
* @param id - id
|
|
40
|
-
*/
|
|
41
|
-
async function products_media_list(client, id) {
|
|
42
|
-
return client.get(`/api/products/${id}/media`);
|
|
43
|
-
}
|
|
44
|
-
//#endregion
|
|
45
4
|
//#region ../../products/api-client/src/portal-tenant-adapter.ts
|
|
46
5
|
/**
|
|
47
6
|
* Creates a PortalProductsApi-compatible adapter from a portal-tenant FetchClient.
|
|
@@ -107,4 +66,4 @@ function usePortalProductsClient() {
|
|
|
107
66
|
//#endregion
|
|
108
67
|
export { usePortalProductsClient as t };
|
|
109
68
|
|
|
110
|
-
//# sourceMappingURL=use-portal-products-client-
|
|
69
|
+
//# sourceMappingURL=use-portal-products-client-s2qtZjhU.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-portal-products-client-s2qtZjhU.mjs","names":["portalTenant.products_list","portalTenant.products_show","portalTenant.products_search","portalTenant.products_media_list"],"sources":["../../../products/api-client/src/portal-tenant-adapter.ts","../src/products/use-portal-products-client.ts"],"sourcesContent":["import type {\n PortalProductsApi,\n portalProducts,\n} from \"@fluid-app/products-core\";\nimport type { FetchClient } from \"./lib/fetch-client\";\nimport { portalTenant } from \"@fluid-app/portal-tenant-api-client\";\n\n/**\n * Creates a PortalProductsApi-compatible adapter from a portal-tenant FetchClient.\n *\n * This bridges the auto-generated portal-tenant API client to the abstract\n * PortalProductsApi interface defined in @fluid-app/products-core, closing\n * over the FetchClient so consumers don't need to pass it per-call.\n *\n * Each method maps the BFF response to the port type at runtime rather than\n * using type assertions, so TypeScript catches schema drift between the\n * generated client and the hand-authored port types at compile time.\n */\nexport function createPortalProductsApiAdapter(\n client: FetchClient,\n): PortalProductsApi {\n return {\n listProducts: async (params) => {\n const response = await portalTenant.products_list(client, {\n \"page[cursor]\": params?.cursor,\n \"page[limit]\": params?.limit,\n });\n return {\n products: response.products ?? [],\n meta: response.meta,\n } satisfies portalProducts.PortalProductsResponse;\n },\n\n getProduct: async (id) => {\n const response = await portalTenant.products_show(client, id);\n return {\n product: response.product ?? {},\n meta: response.meta,\n } satisfies portalProducts.PortalProductResponse;\n },\n\n searchProducts: async (query, params) => {\n const response = await portalTenant.products_search(client, {\n q: query,\n \"page[cursor]\": params?.cursor,\n \"page[limit]\": params?.limit,\n });\n return {\n products: response.products ?? [],\n meta: response.meta,\n } satisfies portalProducts.PortalProductsResponse;\n },\n\n getProductMedia: async (productId) => {\n const response = await portalTenant.products_media_list(\n client,\n productId,\n );\n return {\n media: response.media ?? [],\n meta: response.meta,\n } satisfies portalProducts.PortalProductMediaResponse;\n },\n };\n}\n","import { useMemo } from \"react\";\nimport type { PortalProductsApi } from \"@fluid-app/products-core\";\nimport { createPortalProductsApiAdapter } from \"@fluid-app/products-api-client\";\nimport { createFetchClient } from \"@fluid-app/portal-tenant-api-client\";\nimport { useFluidContext } from \"../providers/FluidProvider\";\n\nexport function usePortalProductsClient(): PortalProductsApi {\n const { config } = useFluidContext();\n\n return useMemo(() => {\n // Portal-tenant endpoints already include /api in their paths\n // (e.g. client.get('/api/products')), so the base URL must NOT\n // have /api appended — otherwise we get double /api/api.\n const client = createFetchClient({\n baseUrl: config.baseUrl.replace(/\\/+$/, \"\"),\n onAuthError: config.onAuthError,\n });\n return createPortalProductsApiAdapter(client);\n }, [config.baseUrl, config.onAuthError]);\n}\n"],"mappings":";;;;;;;;;;;;;;;AAkBA,SAAgB,+BACd,QACmB;AACnB,QAAO;EACL,cAAc,OAAO,WAAW;GAC9B,MAAM,WAAW,MAAMA,cAA2B,QAAQ;IACxD,gBAAgB,QAAQ;IACxB,eAAe,QAAQ;IACxB,CAAC;AACF,UAAO;IACL,UAAU,SAAS,YAAY,EAAE;IACjC,MAAM,SAAS;IAChB;;EAGH,YAAY,OAAO,OAAO;GACxB,MAAM,WAAW,MAAMC,cAA2B,QAAQ,GAAG;AAC7D,UAAO;IACL,SAAS,SAAS,WAAW,EAAE;IAC/B,MAAM,SAAS;IAChB;;EAGH,gBAAgB,OAAO,OAAO,WAAW;GACvC,MAAM,WAAW,MAAMC,gBAA6B,QAAQ;IAC1D,GAAG;IACH,gBAAgB,QAAQ;IACxB,eAAe,QAAQ;IACxB,CAAC;AACF,UAAO;IACL,UAAU,SAAS,YAAY,EAAE;IACjC,MAAM,SAAS;IAChB;;EAGH,iBAAiB,OAAO,cAAc;GACpC,MAAM,WAAW,MAAMC,oBACrB,QACA,UACD;AACD,UAAO;IACL,OAAO,SAAS,SAAS,EAAE;IAC3B,MAAM,SAAS;IAChB;;EAEJ;;;;ACzDH,SAAgB,0BAA6C;CAC3D,MAAM,EAAE,WAAW,iBAAiB;AAEpC,QAAO,cAAc;AAQnB,SAAO,+BAJQ,kBAAkB;GAC/B,SAAS,OAAO,QAAQ,QAAQ,QAAQ,GAAG;GAC3C,aAAa,OAAO;GACrB,CAAC,CAC2C;IAC5C,CAAC,OAAO,SAAS,OAAO,YAAY,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-app/portal-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.130",
|
|
4
4
|
"description": "SDK for building custom Fluid portals",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -73,47 +73,48 @@
|
|
|
73
73
|
"zod": "4.3.5",
|
|
74
74
|
"@fluid-app/api-client-core": "0.1.0",
|
|
75
75
|
"@fluid-app/auth": "0.1.0",
|
|
76
|
-
"@fluid-app/company-switcher-core": "0.1.0",
|
|
77
|
-
"@fluid-app/company-switcher-ui": "0.1.0",
|
|
78
76
|
"@fluid-app/cart-ui": "0.1.13",
|
|
77
|
+
"@fluid-app/company-switcher-ui": "0.1.0",
|
|
78
|
+
"@fluid-app/company-switcher-core": "0.1.0",
|
|
79
79
|
"@fluid-app/contacts-api-client": "0.1.0",
|
|
80
|
-
"@fluid-app/contacts-core": "0.1.0",
|
|
81
80
|
"@fluid-app/contacts-ui": "0.1.0",
|
|
82
81
|
"@fluid-app/file-picker-api-client": "0.1.0",
|
|
83
|
-
"@fluid-app/
|
|
82
|
+
"@fluid-app/contacts-core": "0.1.0",
|
|
84
83
|
"@fluid-app/fluid-pay-api-client": "0.1.0",
|
|
84
|
+
"@fluid-app/fluid-pay-core": "0.1.0",
|
|
85
85
|
"@fluid-app/fluidos-api-client": "0.1.0",
|
|
86
|
-
"@fluid-app/messaging-api-client": "0.1.0",
|
|
87
86
|
"@fluid-app/messaging-core": "0.1.0",
|
|
88
87
|
"@fluid-app/messaging-ui": "0.1.0",
|
|
88
|
+
"@fluid-app/messaging-api-client": "0.1.0",
|
|
89
89
|
"@fluid-app/mysite-ui": "0.1.0",
|
|
90
90
|
"@fluid-app/orders-api-client": "0.1.0",
|
|
91
91
|
"@fluid-app/orders-core": "0.1.0",
|
|
92
92
|
"@fluid-app/orders-ui": "0.1.0",
|
|
93
|
-
"@fluid-app/permissions": "0.1.0",
|
|
94
93
|
"@fluid-app/portal-app-download-ui": "0.1.0",
|
|
94
|
+
"@fluid-app/permissions": "0.1.0",
|
|
95
95
|
"@fluid-app/portal-core": "0.1.23",
|
|
96
96
|
"@fluid-app/portal-preview": "0.1.0",
|
|
97
97
|
"@fluid-app/portal-pro-upgrade-ui": "0.1.0",
|
|
98
98
|
"@fluid-app/portal-react": "0.1.0",
|
|
99
99
|
"@fluid-app/portal-tenant-api-client": "0.1.0",
|
|
100
|
-
"@fluid-app/portal-tenant-contacts-api-client": "0.1.0",
|
|
101
100
|
"@fluid-app/portal-tenant-mysite-api-client": "0.1.0",
|
|
101
|
+
"@fluid-app/portal-tenant-contacts-api-client": "0.1.0",
|
|
102
102
|
"@fluid-app/portal-widgets": "0.1.22",
|
|
103
103
|
"@fluid-app/products-api-client": "0.1.0",
|
|
104
104
|
"@fluid-app/products-core": "0.1.0",
|
|
105
|
+
"@fluid-app/portal-tenant-pay-api-client": "0.1.0",
|
|
105
106
|
"@fluid-app/profile-core": "0.1.0",
|
|
106
|
-
"@fluid-app/profile-ui": "0.1.0",
|
|
107
107
|
"@fluid-app/query-persister": "0.1.0",
|
|
108
|
-
"@fluid-app/
|
|
108
|
+
"@fluid-app/profile-ui": "0.1.0",
|
|
109
109
|
"@fluid-app/shareables-core": "0.1.0",
|
|
110
|
+
"@fluid-app/shareables-api-client": "0.1.0",
|
|
110
111
|
"@fluid-app/shareables-ui": "0.1.0",
|
|
111
112
|
"@fluid-app/shop-ui": "0.1.0",
|
|
112
|
-
"@fluid-app/store-api-client": "0.1.0",
|
|
113
113
|
"@fluid-app/subscriptions-api-client": "0.1.0",
|
|
114
|
+
"@fluid-app/store-api-client": "0.1.0",
|
|
114
115
|
"@fluid-app/subscriptions-core": "0.1.0",
|
|
115
|
-
"@fluid-app/subscriptions-ui": "0.1.0",
|
|
116
116
|
"@fluid-app/typescript-config": "0.0.0",
|
|
117
|
+
"@fluid-app/subscriptions-ui": "0.1.0",
|
|
117
118
|
"@fluid-app/ui-primitives": "0.1.13"
|
|
118
119
|
},
|
|
119
120
|
"peerDependencies": {
|