@fluid-app/portal-sdk 0.1.89 → 0.1.91
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--gGSPUDm.cjs → AppDownloadScreen-BtvcE4pE.cjs} +2 -2
- package/dist/{AppDownloadScreen--gGSPUDm.cjs.map → AppDownloadScreen-BtvcE4pE.cjs.map} +1 -1
- package/dist/{AppDownloadScreen-CDMvuvsQ.cjs → AppDownloadScreen-Dx2nilnX.cjs} +3 -3
- package/dist/{AppDownloadScreen-Bt--8jSo.mjs → AppDownloadScreen-RX8GSAyq.mjs} +2 -2
- package/dist/{AppDownloadScreen-Bt--8jSo.mjs.map → AppDownloadScreen-RX8GSAyq.mjs.map} +1 -1
- package/dist/{ContactsScreen-BZOjocjS.cjs → ContactsScreen-CKMZIQlF.cjs} +3 -3
- package/dist/{ContactsScreen-21VYWIsO.mjs → ContactsScreen-DOz11uQ_.mjs} +2 -2
- package/dist/{ContactsScreen-21VYWIsO.mjs.map → ContactsScreen-DOz11uQ_.mjs.map} +1 -1
- package/dist/{ContactsScreen-DH3K85c6.cjs → ContactsScreen-DttcI388.cjs} +2 -2
- package/dist/{ContactsScreen-DH3K85c6.cjs.map → ContactsScreen-DttcI388.cjs.map} +1 -1
- package/dist/{FluidProvider-CRiIzR8g.mjs → FluidProvider-Eohedipr.mjs} +3 -3
- package/dist/{FluidProvider-CRiIzR8g.mjs.map → FluidProvider-Eohedipr.mjs.map} +1 -1
- package/dist/{FluidProvider-Cwh9D2D_.cjs → FluidProvider-Sc51VlLw.cjs} +3 -3
- package/dist/{FluidProvider-Cwh9D2D_.cjs.map → FluidProvider-Sc51VlLw.cjs.map} +1 -1
- package/dist/{MessagingScreen-68mp7aIc.mjs → MessagingScreen-CMxjIURw.mjs} +3 -3
- package/dist/{MessagingScreen-68mp7aIc.mjs.map → MessagingScreen-CMxjIURw.mjs.map} +1 -1
- package/dist/{MessagingScreen-BIFFfpwv.cjs → MessagingScreen-CdHBUykK.cjs} +3 -3
- package/dist/{MessagingScreen-DbXef2ee.mjs → MessagingScreen-Cx0bbvfs.mjs} +3 -3
- package/dist/{MessagingScreen-Cljq2xIQ.cjs → MessagingScreen-r67FUDf1.cjs} +3 -3
- package/dist/{MessagingScreen-Cljq2xIQ.cjs.map → MessagingScreen-r67FUDf1.cjs.map} +1 -1
- package/dist/{MySiteScreen-D5yvFmK3.cjs → MySiteScreen-8lZTZzo0.cjs} +4 -4
- package/dist/{MySiteScreen-YujACNSf.mjs → MySiteScreen-BhdmPFar.mjs} +3 -3
- package/dist/{MySiteScreen-YujACNSf.mjs.map → MySiteScreen-BhdmPFar.mjs.map} +1 -1
- package/dist/{MySiteScreen-C4Ut8wxE.cjs → MySiteScreen-Cy7HpS3z.cjs} +3 -3
- package/dist/{MySiteScreen-C4Ut8wxE.cjs.map → MySiteScreen-Cy7HpS3z.cjs.map} +1 -1
- package/dist/{NestedWidget-zn_USrld.cjs → NestedWidget-BXbQcApb.cjs} +1 -1
- package/dist/{NestedWidget-L8ppxJib.mjs → NestedWidget-CzSHHhEl.mjs} +2 -2
- package/dist/NestedWidget-CzSHHhEl.mjs.map +1 -0
- package/dist/{NestedWidget-BGY4LSQq.cjs → NestedWidget-iootjKIl.cjs} +2 -2
- package/dist/NestedWidget-iootjKIl.cjs.map +1 -0
- package/dist/{OrdersScreen-CPJX2XiN.cjs → OrdersScreen-BaqQzT1F.cjs} +3 -3
- package/dist/{OrdersScreen-CPJX2XiN.cjs.map → OrdersScreen-BaqQzT1F.cjs.map} +1 -1
- package/dist/{OrdersScreen-BkxKQpwS.mjs → OrdersScreen-D0TnBQc5.mjs} +3 -3
- package/dist/{OrdersScreen-BkxKQpwS.mjs.map → OrdersScreen-D0TnBQc5.mjs.map} +1 -1
- package/dist/{OrdersScreen-BiuWTsM3.cjs → OrdersScreen-DCOzHNIy.cjs} +3 -3
- package/dist/{ProductsScreen-BPgkn9BH.mjs → ProductsScreen-2pUHZJop.mjs} +17 -12
- package/dist/ProductsScreen-2pUHZJop.mjs.map +1 -0
- package/dist/{ProductsScreen-DY6tKX9Q.mjs → ProductsScreen-2tlHXemg.mjs} +5 -5
- package/dist/{ProductsScreen-DiaGPT_Q.cjs → ProductsScreen-Ch6f5P2w.cjs} +5 -5
- package/dist/{ProductsScreen-B2BS6FY_.cjs → ProductsScreen-ueEJP0MJ.cjs} +17 -12
- package/dist/ProductsScreen-ueEJP0MJ.cjs.map +1 -0
- package/dist/{ProfileScreen-DKJrpeMw.mjs → ProfileScreen-Age0TtEY.mjs} +3 -3
- package/dist/{ProfileScreen-DKJrpeMw.mjs.map → ProfileScreen-Age0TtEY.mjs.map} +1 -1
- package/dist/{ProfileScreen-ueK01fjb.cjs → ProfileScreen-C8fpr9c3.cjs} +3 -3
- package/dist/{ProfileScreen-ueK01fjb.cjs.map → ProfileScreen-C8fpr9c3.cjs.map} +1 -1
- package/dist/{ProfileScreen-C6qbR0YJ.cjs → ProfileScreen-DEtgeBnE.cjs} +3 -3
- package/dist/{ShareablesScreen-o1VYr_1K.cjs → ShareablesScreen-B6uPSvvK.cjs} +21 -16
- package/dist/ShareablesScreen-B6uPSvvK.cjs.map +1 -0
- package/dist/{ShareablesScreen-CR3YKwZC.cjs → ShareablesScreen-CoPFz5ZB.cjs} +5 -5
- package/dist/{ShareablesScreen-BrLq61Q7.mjs → ShareablesScreen-DBdNgtV1.mjs} +5 -5
- package/dist/{ShareablesScreen-4hhIcSYA.mjs → ShareablesScreen-vFbWhVGF.mjs} +21 -16
- package/dist/ShareablesScreen-vFbWhVGF.mjs.map +1 -0
- package/dist/{ShopScreen-D8z0KYfh.cjs → ShopScreen-BKBaNPsG.cjs} +5 -5
- package/dist/{ShopScreen-D8z0KYfh.cjs.map → ShopScreen-BKBaNPsG.cjs.map} +1 -1
- package/dist/{ShopScreen-CfxPQVZD.mjs → ShopScreen-D-TXRWZR.mjs} +5 -5
- package/dist/{ShopScreen-CfxPQVZD.mjs.map → ShopScreen-D-TXRWZR.mjs.map} +1 -1
- package/dist/{ShopScreen-BVABhBmJ.cjs → ShopScreen-DPZSXS99.cjs} +3 -3
- package/dist/{SubscriptionsScreen-BF4NqbpU.cjs → SubscriptionsScreen-BvS7o_XP.cjs} +3 -3
- package/dist/{SubscriptionsScreen-BF4NqbpU.cjs.map → SubscriptionsScreen-BvS7o_XP.cjs.map} +1 -1
- package/dist/{SubscriptionsScreen-BSDYjJvj.mjs → SubscriptionsScreen-CBqgpat5.mjs} +3 -3
- package/dist/{SubscriptionsScreen-BSDYjJvj.mjs.map → SubscriptionsScreen-CBqgpat5.mjs.map} +1 -1
- package/dist/{SubscriptionsScreen-BRx_ocC3.cjs → SubscriptionsScreen-IbsNz0Ki.cjs} +3 -3
- package/dist/{dist-lO2OG0T5.cjs → dist-BF_4vk1z.cjs} +1 -1
- package/dist/{dist-lO2OG0T5.cjs.map → dist-BF_4vk1z.cjs.map} +1 -1
- 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/{products-CjZof7c2.cjs → products-BKZ1siXg.cjs} +1 -1
- package/dist/{products-CjZof7c2.cjs.map → products-BKZ1siXg.cjs.map} +1 -1
- package/dist/{products-Dkwd_Bh0.mjs → products-DOO1TBcm.mjs} +1 -1
- package/dist/{products-Dkwd_Bh0.mjs.map → products-DOO1TBcm.mjs.map} +1 -1
- package/dist/{sortable.esm-CzzU6kIR.mjs → sortable.esm-Cz-CP2N8.mjs} +1 -1
- package/dist/{sortable.esm-CzzU6kIR.mjs.map → sortable.esm-Cz-CP2N8.mjs.map} +1 -1
- package/dist/{src-bzRRiTN4.cjs → src-BbJs882O.cjs} +58 -41
- package/dist/src-BbJs882O.cjs.map +1 -0
- package/dist/{src-p8DA1dH0.mjs → src-CN7diUEw.mjs} +102 -50
- package/dist/src-CN7diUEw.mjs.map +1 -0
- package/dist/{src-BjmyVJoe.mjs → src-Ih5vEO6p.mjs} +57 -44
- package/dist/src-Ih5vEO6p.mjs.map +1 -0
- package/dist/{src-Dt66UB0B.cjs → src-Zv3-NSUf.cjs} +103 -117
- package/dist/src-Zv3-NSUf.cjs.map +1 -0
- package/dist/{use-account-clients-Bg1xqjMk.mjs → use-account-clients-CSWgrCKK.mjs} +2 -2
- package/dist/{use-account-clients-Bg1xqjMk.mjs.map → use-account-clients-CSWgrCKK.mjs.map} +1 -1
- package/dist/{use-account-clients-BVb_nhg7.cjs → use-account-clients-DaliJYMa.cjs} +2 -2
- package/dist/{use-account-clients-BVb_nhg7.cjs.map → use-account-clients-DaliJYMa.cjs.map} +1 -1
- package/dist/{use-current-user-DFQ8gYkR.cjs → use-current-user-5erIFUd6.cjs} +3 -3
- package/dist/{use-current-user-DFQ8gYkR.cjs.map → use-current-user-5erIFUd6.cjs.map} +1 -1
- package/dist/{use-current-user-DqLNoj-3.mjs → use-current-user-BBQg1iYf.mjs} +3 -3
- package/dist/{use-current-user-DqLNoj-3.mjs.map → use-current-user-BBQg1iYf.mjs.map} +1 -1
- package/dist/{use-customer-account-CY9HqWvJ.mjs → use-customer-account-CRYpHpFM.mjs} +3 -3
- package/dist/{use-customer-account-CY9HqWvJ.mjs.map → use-customer-account-CRYpHpFM.mjs.map} +1 -1
- package/dist/{use-customer-account-D599KeSp.cjs → use-customer-account-Dzdps4By.cjs} +3 -3
- package/dist/{use-customer-account-D599KeSp.cjs.map → use-customer-account-Dzdps4By.cjs.map} +1 -1
- package/dist/{use-fluid-api-DHF7svon.cjs → use-fluid-api-BUitsoDu.cjs} +2 -2
- package/dist/{use-fluid-api-DHF7svon.cjs.map → use-fluid-api-BUitsoDu.cjs.map} +1 -1
- package/dist/{use-fluid-api-CyK8Yoj-.mjs → use-fluid-api-C5ZLs2TP.mjs} +2 -2
- package/dist/{use-fluid-api-CyK8Yoj-.mjs.map → use-fluid-api-C5ZLs2TP.mjs.map} +1 -1
- package/package.json +15 -15
- package/dist/NestedWidget-BGY4LSQq.cjs.map +0 -1
- package/dist/NestedWidget-L8ppxJib.mjs.map +0 -1
- package/dist/ProductsScreen-B2BS6FY_.cjs.map +0 -1
- package/dist/ProductsScreen-BPgkn9BH.mjs.map +0 -1
- package/dist/ShareablesScreen-4hhIcSYA.mjs.map +0 -1
- package/dist/ShareablesScreen-o1VYr_1K.cjs.map +0 -1
- package/dist/src-BjmyVJoe.mjs.map +0 -1
- package/dist/src-Dt66UB0B.cjs.map +0 -1
- package/dist/src-bzRRiTN4.cjs.map +0 -1
- package/dist/src-p8DA1dH0.mjs.map +0 -1
|
@@ -1,52 +1,4 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-9hOWP6kD.cjs");
|
|
2
|
-
//#region ../../shareables/api-client/src/namespaces/playlists.ts
|
|
3
|
-
var playlists_exports = /* @__PURE__ */ require_chunk.__exportAll({
|
|
4
|
-
addItemToPlaylist: () => addItemToPlaylist,
|
|
5
|
-
createPlaylist: () => createPlaylist,
|
|
6
|
-
deletePlaylist: () => deletePlaylist,
|
|
7
|
-
deletePlaylistItem: () => deletePlaylistItem,
|
|
8
|
-
deletePlaylists: () => deletePlaylists,
|
|
9
|
-
getPlaylistById: () => getPlaylistById,
|
|
10
|
-
getPlaylists: () => getPlaylists,
|
|
11
|
-
removeItemsFromPlaylist: () => removeItemsFromPlaylist,
|
|
12
|
-
updatePlaylist: () => updatePlaylist
|
|
13
|
-
});
|
|
14
|
-
const PLAYLISTS_URL = "/v2025-06/playlists";
|
|
15
|
-
async function getPlaylists(client, options) {
|
|
16
|
-
const input = options ? Object.fromEntries(Object.entries(options).filter(([, value]) => value !== void 0)) : void 0;
|
|
17
|
-
return client.get(PLAYLISTS_URL, input);
|
|
18
|
-
}
|
|
19
|
-
async function getPlaylistById(client, id) {
|
|
20
|
-
return client.get(`${PLAYLISTS_URL}/${id}`);
|
|
21
|
-
}
|
|
22
|
-
async function createPlaylist(client, data) {
|
|
23
|
-
return client.post(PLAYLISTS_URL, data);
|
|
24
|
-
}
|
|
25
|
-
async function updatePlaylist(client, id, data) {
|
|
26
|
-
return client.patch(`${PLAYLISTS_URL}/${id}`, data);
|
|
27
|
-
}
|
|
28
|
-
async function addItemToPlaylist(client, id, data) {
|
|
29
|
-
return client.post(`${PLAYLISTS_URL}/${id}/items`, data);
|
|
30
|
-
}
|
|
31
|
-
async function deletePlaylist(client, id) {
|
|
32
|
-
return client.delete(`${PLAYLISTS_URL}/${id}`);
|
|
33
|
-
}
|
|
34
|
-
async function deletePlaylists(client, ids) {
|
|
35
|
-
return Promise.all(ids.map((id) => deletePlaylist(client, id)));
|
|
36
|
-
}
|
|
37
|
-
async function deletePlaylistItem(client, id, item_ids) {
|
|
38
|
-
return client.request(`${PLAYLISTS_URL}/${id}/items`, {
|
|
39
|
-
method: "DELETE",
|
|
40
|
-
body: item_ids
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
async function removeItemsFromPlaylist(client, playlistId, data) {
|
|
44
|
-
return client.request(`${PLAYLISTS_URL}/${playlistId}/items`, {
|
|
45
|
-
method: "DELETE",
|
|
46
|
-
body: data
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
//#endregion
|
|
50
2
|
//#region ../../shareables/api-client/src/namespaces/media.ts
|
|
51
3
|
function transformMediaListItem(item) {
|
|
52
4
|
return {
|
|
@@ -120,6 +72,73 @@ async function createMedia(client, mediaData, repContext) {
|
|
|
120
72
|
if (repContext) return (await client.post("/users/v2025-06/media", mediaData)).medium;
|
|
121
73
|
return (await client.post("/company/media", mediaData)).medium;
|
|
122
74
|
}
|
|
75
|
+
async function updateMedia(client, id, mediaData, language_iso, repContext) {
|
|
76
|
+
if (repContext) return (await client.request(`/users/v2025-06/media/${id}`, {
|
|
77
|
+
method: "PATCH",
|
|
78
|
+
body: mediaData
|
|
79
|
+
})).medium;
|
|
80
|
+
const endpoint = language_iso ? `/company/media/${id}?language_iso=${language_iso}` : `/company/media/${id}`;
|
|
81
|
+
const response = await client.put(endpoint, { medium: mediaData });
|
|
82
|
+
if (response && typeof response === "object" && "data" in response && response.data) return response.data;
|
|
83
|
+
return response;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Delete a media item. The API returns a text response, so we use
|
|
87
|
+
* client.delete and ignore the response body.
|
|
88
|
+
*/
|
|
89
|
+
async function deleteMedia(client, id, repContext) {
|
|
90
|
+
if (repContext) await client.delete(`/users/v2025-06/media/${id}`);
|
|
91
|
+
else await client.delete(`/company/media/${id}`);
|
|
92
|
+
return { success: true };
|
|
93
|
+
}
|
|
94
|
+
//#endregion
|
|
95
|
+
//#region ../../shareables/api-client/src/namespaces/playlists.ts
|
|
96
|
+
var playlists_exports = /* @__PURE__ */ require_chunk.__exportAll({
|
|
97
|
+
addItemToPlaylist: () => addItemToPlaylist,
|
|
98
|
+
createPlaylist: () => createPlaylist,
|
|
99
|
+
deletePlaylist: () => deletePlaylist,
|
|
100
|
+
deletePlaylistItem: () => deletePlaylistItem,
|
|
101
|
+
deletePlaylists: () => deletePlaylists,
|
|
102
|
+
getPlaylistById: () => getPlaylistById,
|
|
103
|
+
getPlaylists: () => getPlaylists,
|
|
104
|
+
removeItemsFromPlaylist: () => removeItemsFromPlaylist,
|
|
105
|
+
updatePlaylist: () => updatePlaylist
|
|
106
|
+
});
|
|
107
|
+
const PLAYLISTS_URL = "/v2025-06/playlists";
|
|
108
|
+
async function getPlaylists(client, options) {
|
|
109
|
+
const input = options ? Object.fromEntries(Object.entries(options).filter(([, value]) => value !== void 0)) : void 0;
|
|
110
|
+
return client.get(PLAYLISTS_URL, input);
|
|
111
|
+
}
|
|
112
|
+
async function getPlaylistById(client, id) {
|
|
113
|
+
return client.get(`${PLAYLISTS_URL}/${id}`);
|
|
114
|
+
}
|
|
115
|
+
async function createPlaylist(client, data) {
|
|
116
|
+
return client.post(PLAYLISTS_URL, data);
|
|
117
|
+
}
|
|
118
|
+
async function updatePlaylist(client, id, data) {
|
|
119
|
+
return client.patch(`${PLAYLISTS_URL}/${id}`, data);
|
|
120
|
+
}
|
|
121
|
+
async function addItemToPlaylist(client, id, data) {
|
|
122
|
+
return client.post(`${PLAYLISTS_URL}/${id}/items`, data);
|
|
123
|
+
}
|
|
124
|
+
async function deletePlaylist(client, id) {
|
|
125
|
+
return client.delete(`${PLAYLISTS_URL}/${id}`);
|
|
126
|
+
}
|
|
127
|
+
async function deletePlaylists(client, ids) {
|
|
128
|
+
return Promise.all(ids.map((id) => deletePlaylist(client, id)));
|
|
129
|
+
}
|
|
130
|
+
async function deletePlaylistItem(client, id, item_ids) {
|
|
131
|
+
return client.request(`${PLAYLISTS_URL}/${id}/items`, {
|
|
132
|
+
method: "DELETE",
|
|
133
|
+
body: item_ids
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
async function removeItemsFromPlaylist(client, playlistId, data) {
|
|
137
|
+
return client.request(`${PLAYLISTS_URL}/${playlistId}/items`, {
|
|
138
|
+
method: "DELETE",
|
|
139
|
+
body: data
|
|
140
|
+
});
|
|
141
|
+
}
|
|
123
142
|
//#endregion
|
|
124
143
|
//#region ../../shareables/api-client/src/namespaces/file-resources.ts
|
|
125
144
|
async function getFileResources(client, params) {
|
|
@@ -153,73 +172,46 @@ async function createShareLink(client, input) {
|
|
|
153
172
|
return (await client.post("/shares.json", requestBody)).link;
|
|
154
173
|
}
|
|
155
174
|
//#endregion
|
|
175
|
+
//#region ../../shareables/api-client/src/adapter.ts
|
|
176
|
+
/**
|
|
177
|
+
* Creates a ShareablesApi-compatible adapter backed by the real API client
|
|
178
|
+
* namespace functions. The returned object satisfies the ShareablesApi interface
|
|
179
|
+
* from @fluid-app/shareables-core via structural typing.
|
|
180
|
+
*
|
|
181
|
+
* @param client - The FetchClient instance for making HTTP requests.
|
|
182
|
+
* @param options - Provider-level configuration (e.g. repContext).
|
|
183
|
+
*/
|
|
184
|
+
function createShareablesApiAdapter(client, options) {
|
|
185
|
+
const repContext = options?.repContext ?? false;
|
|
186
|
+
return {
|
|
187
|
+
media: {
|
|
188
|
+
getMedia: (opts) => getMedia(client, opts, repContext),
|
|
189
|
+
getMediaById: (id, language_iso) => getMediaById(client, id, language_iso, repContext),
|
|
190
|
+
createMedia: (mediaData) => createMedia(client, mediaData, repContext),
|
|
191
|
+
updateMedia: (id, mediaData, language_iso) => updateMedia(client, id, mediaData, language_iso, repContext),
|
|
192
|
+
deleteMedia: (id) => deleteMedia(client, id, repContext)
|
|
193
|
+
},
|
|
194
|
+
playlists: {
|
|
195
|
+
getPlaylists: (opts) => getPlaylists(client, opts),
|
|
196
|
+
getPlaylistById: (id) => getPlaylistById(client, id),
|
|
197
|
+
createPlaylist: (data) => createPlaylist(client, data),
|
|
198
|
+
updatePlaylist: (id, data) => updatePlaylist(client, id, data),
|
|
199
|
+
addItemToPlaylist: (id, data) => addItemToPlaylist(client, id, data),
|
|
200
|
+
removeItemsFromPlaylist: (playlistId, data) => removeItemsFromPlaylist(client, playlistId, data)
|
|
201
|
+
},
|
|
202
|
+
fileResources: { getFileResources: (params) => getFileResources(client, params) },
|
|
203
|
+
productMedia: { getProductMedia: (productId) => getProductMedia(client, productId) },
|
|
204
|
+
share: { createShareLink: (input) => createShareLink(client, input) }
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
//#endregion
|
|
156
208
|
//#region ../../shareables/api-client/src/index.ts
|
|
157
209
|
var src_exports = /* @__PURE__ */ require_chunk.__exportAll({ playlists: () => playlists_exports });
|
|
158
210
|
//#endregion
|
|
159
|
-
Object.defineProperty(exports, "
|
|
160
|
-
enumerable: true,
|
|
161
|
-
get: function() {
|
|
162
|
-
return addItemToPlaylist;
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
Object.defineProperty(exports, "createMedia", {
|
|
166
|
-
enumerable: true,
|
|
167
|
-
get: function() {
|
|
168
|
-
return createMedia;
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
Object.defineProperty(exports, "createPlaylist", {
|
|
211
|
+
Object.defineProperty(exports, "createShareablesApiAdapter", {
|
|
172
212
|
enumerable: true,
|
|
173
213
|
get: function() {
|
|
174
|
-
return
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
Object.defineProperty(exports, "createShareLink", {
|
|
178
|
-
enumerable: true,
|
|
179
|
-
get: function() {
|
|
180
|
-
return createShareLink;
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
Object.defineProperty(exports, "getFileResources", {
|
|
184
|
-
enumerable: true,
|
|
185
|
-
get: function() {
|
|
186
|
-
return getFileResources;
|
|
187
|
-
}
|
|
188
|
-
});
|
|
189
|
-
Object.defineProperty(exports, "getMedia", {
|
|
190
|
-
enumerable: true,
|
|
191
|
-
get: function() {
|
|
192
|
-
return getMedia;
|
|
193
|
-
}
|
|
194
|
-
});
|
|
195
|
-
Object.defineProperty(exports, "getMediaById", {
|
|
196
|
-
enumerable: true,
|
|
197
|
-
get: function() {
|
|
198
|
-
return getMediaById;
|
|
199
|
-
}
|
|
200
|
-
});
|
|
201
|
-
Object.defineProperty(exports, "getPlaylistById", {
|
|
202
|
-
enumerable: true,
|
|
203
|
-
get: function() {
|
|
204
|
-
return getPlaylistById;
|
|
205
|
-
}
|
|
206
|
-
});
|
|
207
|
-
Object.defineProperty(exports, "getPlaylists", {
|
|
208
|
-
enumerable: true,
|
|
209
|
-
get: function() {
|
|
210
|
-
return getPlaylists;
|
|
211
|
-
}
|
|
212
|
-
});
|
|
213
|
-
Object.defineProperty(exports, "getProductMedia", {
|
|
214
|
-
enumerable: true,
|
|
215
|
-
get: function() {
|
|
216
|
-
return getProductMedia;
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
Object.defineProperty(exports, "removeItemsFromPlaylist", {
|
|
220
|
-
enumerable: true,
|
|
221
|
-
get: function() {
|
|
222
|
-
return removeItemsFromPlaylist;
|
|
214
|
+
return createShareablesApiAdapter;
|
|
223
215
|
}
|
|
224
216
|
});
|
|
225
217
|
Object.defineProperty(exports, "src_exports", {
|
|
@@ -228,11 +220,5 @@ Object.defineProperty(exports, "src_exports", {
|
|
|
228
220
|
return src_exports;
|
|
229
221
|
}
|
|
230
222
|
});
|
|
231
|
-
Object.defineProperty(exports, "updatePlaylist", {
|
|
232
|
-
enumerable: true,
|
|
233
|
-
get: function() {
|
|
234
|
-
return updatePlaylist;
|
|
235
|
-
}
|
|
236
|
-
});
|
|
237
223
|
|
|
238
|
-
//# sourceMappingURL=src-
|
|
224
|
+
//# sourceMappingURL=src-Zv3-NSUf.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"src-Zv3-NSUf.cjs","names":["mediaNs.getMedia","mediaNs.getMediaById","mediaNs.createMedia","mediaNs.updateMedia","mediaNs.deleteMedia","playlistsNs.getPlaylists","playlistsNs.getPlaylistById","playlistsNs.createPlaylist","playlistsNs.updatePlaylist","playlistsNs.addItemToPlaylist","playlistsNs.removeItemsFromPlaylist","fileResourcesNs.getFileResources","productMediaNs.getProductMedia","shareNs.createShareLink"],"sources":["../../../shareables/api-client/src/namespaces/media.ts","../../../shareables/api-client/src/namespaces/playlists.ts","../../../shareables/api-client/src/namespaces/file-resources.ts","../../../shareables/api-client/src/namespaces/product-media.ts","../../../shareables/api-client/src/namespaces/share.ts","../../../shareables/api-client/src/adapter.ts","../../../shareables/api-client/src/index.ts"],"sourcesContent":["import type { FetchClient } from \"../lib/fetch-client\";\nimport type { shareables } from \"../generated/shareables\";\n\n// ============================================================================\n// Media - Helper\n// ============================================================================\n\nfunction transformMediaListItem(\n item: shareables.MediaListItem,\n): shareables.MediumResponse {\n return {\n ...item,\n description: item.description,\n created_at: item.description?.created_at || item.created_at,\n };\n}\n\n// ============================================================================\n// Media - List & Get\n// ============================================================================\n\ninterface RepMediaResponse {\n media: shareables.MediaListItem[];\n meta: {\n request_id: string;\n timestamp: string;\n current_page: number;\n total_pages: number;\n total_count: number;\n };\n}\n\nexport async function getMedia(\n client: FetchClient,\n options: shareables.MediaFilters = {},\n repContext?: boolean,\n): Promise<shareables.MediaListResponseWithMeta> {\n if (repContext) {\n const response = await client.get<RepMediaResponse>(\n \"/users/v2025-06/media\",\n options as Record<string, unknown>,\n );\n\n const transformedItems = response.media.map(transformMediaListItem);\n const perPage = options.per_page || 10;\n\n return {\n data: transformedItems,\n status: \"success\",\n media: transformedItems,\n meta: {\n total_count: response.meta.total_count,\n current: response.meta.current_page,\n per_page: perPage,\n pages: response.meta.total_pages,\n next:\n response.meta.current_page < response.meta.total_pages\n ? response.meta.current_page + 1\n : null,\n previous:\n response.meta.current_page > 1\n ? response.meta.current_page - 1\n : null,\n },\n };\n }\n\n const response = await client.get<shareables.MediaListResponseNew>(\n \"/company/media\",\n options as Record<string, unknown>,\n );\n\n let mediaItems: shareables.MediaListItem[] = [];\n let pagination: shareables.MediaPagination = {\n count: 0,\n previous: null,\n next: null,\n pages: 0,\n per_page: 10,\n current: 1,\n };\n\n response.forEach((item) => {\n if (\"items\" in item && Array.isArray(item.items)) {\n mediaItems = item.items;\n }\n if (\"pagination\" in item && item.pagination?.count) {\n pagination = item.pagination;\n }\n });\n\n const transformedItems = mediaItems.map(transformMediaListItem);\n\n return {\n data: transformedItems,\n status: \"success\",\n media: transformedItems,\n meta: {\n ...pagination,\n total_count: pagination.count || mediaItems.length,\n },\n };\n}\n\nexport async function getMediaById(\n client: FetchClient,\n id: number,\n language_iso?: string,\n repContext?: boolean,\n): Promise<shareables.MediaResponseWithMeta> {\n if (repContext) {\n const response = await client.get<{ medium: shareables.MediumResponse }>(\n `/users/v2025-06/media/${id}`,\n );\n return {\n data: response.medium,\n status: \"success\",\n media: response.medium,\n };\n }\n\n const endpoint = language_iso\n ? `/company/media/${id}?language_iso=${language_iso}`\n : `/company/media/${id}`;\n\n const response = await client.get<shareables.MediumResponse>(endpoint);\n\n return {\n data: response,\n status: \"success\",\n media: response,\n };\n}\n\nexport async function getAnnouncementById(\n client: FetchClient,\n id: number,\n): Promise<shareables.AnnouncementResponse> {\n return client.get(`/company/announcements/${id}`);\n}\n\nexport async function getTrainings(\n client: FetchClient,\n options: {\n category_id?: number;\n page?: number;\n per_page?: number;\n } = {},\n): Promise<shareables.MediaListResponseWithMeta> {\n const params: Record<string, string> = {};\n\n if (options.category_id) {\n params[\"filterrific[with_category_id]\"] = options.category_id.toString();\n }\n if (options.page) {\n params.page = options.page.toString();\n }\n if (options.per_page) {\n params.per_page = options.per_page.toString();\n }\n\n const response = await client.get<shareables.MediaListResponseNew>(\n \"/v1/trainings\",\n params,\n );\n\n let mediaItems: shareables.MediaListItem[] = [];\n let pagination: shareables.MediaPagination = {\n count: 0,\n previous: null,\n next: null,\n pages: 0,\n per_page: 20,\n current: 1,\n };\n\n response.forEach((item) => {\n if (\"items\" in item && Array.isArray(item.items)) {\n mediaItems = item.items;\n }\n if (\"pagination\" in item && item.pagination?.count) {\n pagination = item.pagination;\n }\n });\n\n const transformedItems = mediaItems.map(transformMediaListItem);\n\n return {\n data: transformedItems,\n status: \"success\",\n media: transformedItems,\n meta: {\n ...pagination,\n total_count: pagination.count || mediaItems.length,\n },\n };\n}\n\n// ============================================================================\n// Media - Create\n// ============================================================================\n\nexport async function createMedia(\n client: FetchClient,\n mediaData: shareables.MediumUpdate,\n repContext?: boolean,\n): Promise<shareables.MediumResponse> {\n if (repContext) {\n const response = await client.post<{ medium: shareables.MediumResponse }>(\n \"/users/v2025-06/media\",\n mediaData,\n );\n return response.medium;\n }\n\n const response = await client.post<shareables.NewCreateMediaResponse>(\n \"/company/media\",\n mediaData,\n );\n return response.medium;\n}\n\nexport async function createAnnouncement(\n client: FetchClient,\n announcementData: shareables.AnnouncementUpdate,\n): Promise<shareables.AnnouncementResponse> {\n return client.post(\"/company/announcements\", announcementData);\n}\n\n// ============================================================================\n// Media - Update\n// ============================================================================\n\nexport async function updateMedia(\n client: FetchClient,\n id: number,\n mediaData: shareables.MediumUpdate,\n language_iso?: string,\n repContext?: boolean,\n): Promise<shareables.MediumResponse> {\n if (repContext) {\n const response = await client.request<{\n medium: shareables.MediumResponse;\n }>(`/users/v2025-06/media/${id}`, {\n method: \"PATCH\",\n body: mediaData,\n });\n return response.medium;\n }\n\n const endpoint = language_iso\n ? `/company/media/${id}?language_iso=${language_iso}`\n : `/company/media/${id}`;\n\n const response = await client.put<shareables.MediaResponse>(endpoint, {\n medium: mediaData,\n });\n\n if (\n response &&\n typeof response === \"object\" &&\n \"data\" in response &&\n response.data\n ) {\n return response.data as shareables.MediumResponse;\n }\n return response as shareables.MediumResponse;\n}\n\nexport async function updateAnnouncement(\n client: FetchClient,\n id: number,\n announcementData: shareables.AnnouncementUpdate,\n): Promise<shareables.AnnouncementResponse> {\n const response = await client.put<shareables.AnnouncementResponse>(\n `/company/announcements/${id}`,\n announcementData,\n );\n\n if (\n response &&\n typeof response === \"object\" &&\n \"data\" in response &&\n response.data\n ) {\n return response.data as shareables.AnnouncementResponse;\n }\n return response;\n}\n\n// ============================================================================\n// Media - Delete\n// ============================================================================\n\n/**\n * Delete a media item. The API returns a text response, so we use\n * client.delete and ignore the response body.\n */\nexport async function deleteMedia(\n client: FetchClient,\n id: number,\n repContext?: boolean,\n): Promise<{ success: boolean }> {\n if (repContext) {\n await client.delete(`/users/v2025-06/media/${id}`);\n } else {\n await client.delete(`/company/media/${id}`);\n }\n return { success: true };\n}\n\nexport async function deleteAnnouncement(\n client: FetchClient,\n id: number,\n): Promise<{ success: boolean }> {\n await client.delete(`/company/announcements/${id}`);\n return { success: true };\n}\n\nexport async function bulkDeleteAnnouncements(\n client: FetchClient,\n ids: number[],\n): Promise<{ success: boolean }> {\n await client.request(`/company/announcements/bulk_destroy`, {\n method: \"DELETE\",\n body: { ids },\n });\n return { success: true };\n}\n","import type { FetchClient } from \"../lib/fetch-client\";\nimport type { shareables } from \"../generated/shareables\";\n\nconst PLAYLISTS_URL = \"/v2025-06/playlists\";\n\n// ============================================================================\n// Playlists - List & Get\n// ============================================================================\n\nexport type PlaylistsQuery = {\n \"filter[title]\"?: string;\n \"filter[status]\"?: string;\n \"page[cursor]\"?: string;\n \"page[limit]\"?: number;\n sort?: string;\n};\n\nexport async function getPlaylists(\n client: FetchClient,\n options?: PlaylistsQuery,\n): Promise<shareables.GetPlaylistsResponse> {\n const input = options\n ? Object.fromEntries(\n Object.entries(options).filter(([, value]) => value !== undefined),\n )\n : undefined;\n return client.get(PLAYLISTS_URL, input);\n}\n\nexport async function getPlaylistById(\n client: FetchClient,\n id: number,\n): Promise<shareables.GetPlaylistResponse> {\n return client.get(`${PLAYLISTS_URL}/${id}`);\n}\n\n// ============================================================================\n// Playlists - Create & Update\n// ============================================================================\n\nexport async function createPlaylist(\n client: FetchClient,\n data: shareables.CreatePlaylistInput,\n): Promise<shareables.GetPlaylistResponse> {\n return client.post(PLAYLISTS_URL, data);\n}\n\nexport async function updatePlaylist(\n client: FetchClient,\n id: number,\n data: shareables.UpdatePlaylistInput,\n): Promise<shareables.GetPlaylistResponse> {\n return client.patch(`${PLAYLISTS_URL}/${id}`, data);\n}\n\nexport async function addItemToPlaylist(\n client: FetchClient,\n id: number,\n data: shareables.AddItemToPlaylistInput,\n): Promise<shareables.Playlist> {\n return client.post(`${PLAYLISTS_URL}/${id}/items`, data);\n}\n\n// ============================================================================\n// Playlists - Delete\n// ============================================================================\n\nexport async function deletePlaylist(\n client: FetchClient,\n id: number,\n): Promise<void> {\n return client.delete(`${PLAYLISTS_URL}/${id}`);\n}\n\nexport async function deletePlaylists(\n client: FetchClient,\n ids: number[],\n): Promise<void[]> {\n return Promise.all(ids.map((id) => deletePlaylist(client, id)));\n}\n\nexport async function deletePlaylistItem(\n client: FetchClient,\n id: number,\n item_ids: number[],\n): Promise<{\n deleted_at: string;\n meta: { request_id: string; timestamp: string };\n}> {\n return client.request(`${PLAYLISTS_URL}/${id}/items`, {\n method: \"DELETE\",\n body: item_ids,\n });\n}\n\n// ============================================================================\n// Playlists - Remove Items\n// ============================================================================\n\nexport async function removeItemsFromPlaylist(\n client: FetchClient,\n playlistId: number,\n data: shareables.RemoveItemsFromPlaylistInput,\n): Promise<shareables.Playlist> {\n return client.request(`${PLAYLISTS_URL}/${playlistId}/items`, {\n method: \"DELETE\",\n body: data,\n });\n}\n","import type { FetchClient } from \"../lib/fetch-client\";\nimport type { shareables } from \"../generated/shareables\";\n\n// ============================================================================\n// File Resources - List\n// ============================================================================\n\nexport async function getFileResources(\n client: FetchClient,\n params: {\n search_query?: string;\n pageParam?: string;\n pageSize?: string;\n fileTypes?: string[];\n sizeGreaterThan?: number;\n sizeLessThan?: number;\n sortedBy?: string;\n },\n): Promise<shareables.FileResourcesResponse> {\n const qp = new URLSearchParams({\n ...(params.search_query && { search_query: params.search_query }),\n ...(params.pageParam && { page: params.pageParam }),\n ...(params.pageSize && { per_page: params.pageSize }),\n ...(params.sizeGreaterThan && {\n size_greater_than: params.sizeGreaterThan.toString(),\n }),\n ...(params.sizeLessThan && {\n size_less_than: params.sizeLessThan.toString(),\n }),\n ...(params.sortedBy && { sorted_by: params.sortedBy }),\n });\n params.fileTypes?.forEach((type) => {\n qp.append(\"with_types[]\", type);\n });\n\n return client.get(`/file_resources?${qp.toString()}`);\n}\n\n// ============================================================================\n// File Resources - Create\n// ============================================================================\n\nexport async function createFileResource(\n client: FetchClient,\n data: shareables.CreateFileResourceInput,\n): Promise<shareables.CreateFileResourceResponse> {\n return client.post(\"/file_resources\", data);\n}\n\n// ============================================================================\n// File Resources - Update\n// ============================================================================\n\nexport async function updateFileResource(\n client: FetchClient,\n id: number,\n fileResource: shareables.UpdateFileResourceInput,\n): Promise<shareables.FileResource> {\n return client.patch(`/file_resources/${id}`, {\n id: id.toString(),\n file_resource: fileResource,\n });\n}\n\n// ============================================================================\n// File Resources - Delete\n// ============================================================================\n\nexport async function deleteFileResource(\n client: FetchClient,\n id: number,\n): Promise<{ id: number; meta: { request_id: string; timestamp: string } }> {\n return client.delete(`/file_resources/${id}`);\n}\n","import type { FetchClient } from \"../lib/fetch-client\";\nimport type { shareables } from \"../generated/shareables\";\n\n// ============================================================================\n// Product Media - Get\n// ============================================================================\n\nexport async function getProductMedia(\n client: FetchClient,\n productId: number,\n): Promise<shareables.ProductMediaResponse> {\n return client.get(`/v2025-06/products/${productId}/media`);\n}\n\n// ============================================================================\n// Product Media - Type Guards\n// ============================================================================\n\nexport const isWidgetItem = (\n item: shareables.ModalItem,\n): item is { type: \"widget\"; data: shareables.ShareableItem } => {\n return item.type === \"widget\";\n};\n\nexport const isProductItem = (\n item: shareables.ModalItem,\n): item is { type: \"product\"; data: shareables.ProductRef } => {\n return item.type === \"product\";\n};\n\nexport const isMediaItem = (\n item: shareables.ModalItem,\n): item is { type: \"media\"; data: shareables.ProductMedia } => {\n return item.type === \"media\";\n};\n\n// ============================================================================\n// Product Media - Display Helpers\n// ============================================================================\n\nexport const getDisplayTitle = (item: shareables.ModalItem): string => {\n switch (item.type) {\n case \"widget\":\n return item.data.relateable?.title || item.data.title || \"Untitled\";\n case \"product\":\n return item.data.title;\n case \"media\":\n return item.data.title;\n default:\n return \"Untitled\";\n }\n};\n\nexport const getDisplayImage = (item: shareables.ModalItem): string => {\n switch (item.type) {\n case \"widget\":\n return item.data.relateable?.image_url || item.data.image_url || \"\";\n case \"product\":\n return item.data.image_url || \"\";\n case \"media\":\n return item.data.image_url || \"\";\n default:\n return \"\";\n }\n};\n\nexport const getDisplayVideo = (\n item: shareables.ModalItem,\n): string | undefined => {\n switch (item.type) {\n case \"widget\":\n return item.data.relateable?.video_url || item.data.video || undefined;\n case \"product\":\n return undefined;\n case \"media\":\n return item.data.video_url || undefined;\n default:\n return undefined;\n }\n};\n\ntype DescriptionField = string | { body: string } | null | undefined;\n\nexport const getDisplayDescription = (item: shareables.ModalItem): string => {\n switch (item.type) {\n case \"widget\": {\n const widgetDesc = item.data.relateable?.description as DescriptionField;\n if (typeof widgetDesc === \"object\" && widgetDesc?.body) {\n return widgetDesc.body;\n }\n return (\n (typeof widgetDesc === \"string\" ? widgetDesc : \"\") ||\n item.data.description ||\n \"\"\n );\n }\n case \"product\": {\n const productDesc = item.data.description as DescriptionField;\n if (typeof productDesc === \"object\" && productDesc?.body) {\n return productDesc.body;\n }\n return (\n (typeof productDesc === \"string\" ? productDesc : \"\") ||\n item.data.stripped ||\n \"\"\n );\n }\n case \"media\":\n return item.data.description || \"\";\n default:\n return \"\";\n }\n};\n\nexport const isProductType = (item: shareables.ModalItem): boolean => {\n if (isProductItem(item)) {\n return true;\n }\n\n if (isWidgetItem(item)) {\n const relateableType = item.data.relateable_type?.toLowerCase();\n return (\n relateableType === \"product\" ||\n relateableType === \"products\" ||\n relateableType === \"enrollmentpack\" ||\n relateableType === \"enrollment_packs\"\n );\n }\n\n return false;\n};\n\nexport const getProductIds = (item: shareables.ModalItem): number[] => {\n if (isProductItem(item)) {\n return [item.data.id];\n }\n\n if (isWidgetItem(item)) {\n const data = item.data;\n\n const type = data.relateable_type?.toLowerCase();\n if (\n (type === \"enrollmentpack\" || type === \"enrollment_packs\") &&\n data.relateable\n ) {\n const membershipIds =\n data.relateable.membership_products?.map((p) => p.id) || [];\n const subscriptionIds =\n data.relateable.subscription_products?.map((p) => p.id) || [];\n return [...membershipIds, ...subscriptionIds];\n }\n\n if (data.id && data.id !== 0) {\n return [data.id];\n } else if (data.relateable?.id && typeof data.relateable.id === \"number\") {\n return [data.relateable.id];\n }\n return [];\n }\n\n return [];\n};\n","import type { FetchClient } from \"../lib/fetch-client\";\nimport type { shareables } from \"../generated/shareables\";\n\n// ============================================================================\n// Share - List\n// ============================================================================\n\nexport async function getShares(\n client: FetchClient,\n input?: shareables.GetSharesInput,\n): Promise<shareables.SharesListResponse> {\n return client.get(\"/shares.json\", (input || {}) as Record<string, unknown>);\n}\n\n// ============================================================================\n// Share - Create Link\n// ============================================================================\n\nexport async function createShareLink(\n client: FetchClient,\n input: shareables.CreateShareLinkInput,\n): Promise<string> {\n const requestBody = {\n locale: input.locale,\n relateable_type: input.relateableType,\n ...(input.contactId && { contact_id: input.contactId }),\n ...(input.relateableId && { relateable_id: input.relateableId }),\n };\n\n const result = await client.post<shareables.ShareLinkResponse>(\n \"/shares.json\",\n requestBody,\n );\n\n return result.link;\n}\n","import type { FetchClient } from \"./lib/fetch-client\";\nimport * as mediaNs from \"./namespaces/media\";\nimport * as playlistsNs from \"./namespaces/playlists\";\nimport * as fileResourcesNs from \"./namespaces/file-resources\";\nimport * as productMediaNs from \"./namespaces/product-media\";\nimport * as shareNs from \"./namespaces/share\";\n\n/**\n * Creates a ShareablesApi-compatible adapter backed by the real API client\n * namespace functions. The returned object satisfies the ShareablesApi interface\n * from @fluid-app/shareables-core via structural typing.\n *\n * @param client - The FetchClient instance for making HTTP requests.\n * @param options - Provider-level configuration (e.g. repContext).\n */\nexport function createShareablesApiAdapter(\n client: FetchClient,\n options?: { repContext?: boolean },\n) {\n const repContext = options?.repContext ?? false;\n\n return {\n media: {\n getMedia: (opts?: Parameters<typeof mediaNs.getMedia>[1]) =>\n mediaNs.getMedia(client, opts, repContext),\n getMediaById: (id: number, language_iso?: string) =>\n mediaNs.getMediaById(client, id, language_iso, repContext),\n createMedia: (mediaData: Parameters<typeof mediaNs.createMedia>[1]) =>\n mediaNs.createMedia(client, mediaData, repContext),\n updateMedia: (\n id: number,\n mediaData: Parameters<typeof mediaNs.updateMedia>[2],\n language_iso?: string,\n ) => mediaNs.updateMedia(client, id, mediaData, language_iso, repContext),\n deleteMedia: (id: number) => mediaNs.deleteMedia(client, id, repContext),\n },\n playlists: {\n getPlaylists: (opts?: Parameters<typeof playlistsNs.getPlaylists>[1]) =>\n playlistsNs.getPlaylists(client, opts),\n getPlaylistById: (id: number) => playlistsNs.getPlaylistById(client, id),\n createPlaylist: (\n data: Parameters<typeof playlistsNs.createPlaylist>[1],\n ) => playlistsNs.createPlaylist(client, data),\n updatePlaylist: (\n id: number,\n data: Parameters<typeof playlistsNs.updatePlaylist>[2],\n ) => playlistsNs.updatePlaylist(client, id, data),\n addItemToPlaylist: (\n id: number,\n data: Parameters<typeof playlistsNs.addItemToPlaylist>[2],\n ) => playlistsNs.addItemToPlaylist(client, id, data),\n removeItemsFromPlaylist: (\n playlistId: number,\n data: Parameters<typeof playlistsNs.removeItemsFromPlaylist>[2],\n ) => playlistsNs.removeItemsFromPlaylist(client, playlistId, data),\n },\n fileResources: {\n getFileResources: (\n params: Parameters<typeof fileResourcesNs.getFileResources>[1],\n ) => fileResourcesNs.getFileResources(client, params),\n },\n productMedia: {\n getProductMedia: (productId: number) =>\n productMediaNs.getProductMedia(client, productId),\n },\n share: {\n createShareLink: (input: Parameters<typeof shareNs.createShareLink>[1]) =>\n shareNs.createShareLink(client, input),\n },\n };\n}\n","/**\n * @fluid-app/shareables-api-client\n * Type-safe API client for Fluid shareable content services\n */\n\n// Core fetch client (re-exported from @fluid-app/api-client-core for convenience)\nexport {\n createFetchClient,\n ApiError,\n isApiError,\n type FetchClient,\n type FetchClientConfig,\n type RequestOptions,\n} from \"./lib/fetch-client\";\n\n// Export types\nexport type { shareables } from \"./generated/shareables\";\n\n// Adapter factory for dependency inversion\nexport { createShareablesApiAdapter } from \"./adapter\";\n\n// Export namespace clients\nexport * as playlists from \"./namespaces/playlists\";\nexport * as media from \"./namespaces/media\";\nexport * as fileResources from \"./namespaces/file-resources\";\nexport * as files from \"./namespaces/files\";\nexport * as shareablesWidget from \"./namespaces/shareables\";\nexport * as productMedia from \"./namespaces/product-media\";\nexport * as share from \"./namespaces/share\";\nexport * as publicMedia from \"./namespaces/public-media\";\n"],"mappings":"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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { bt as createFetchClient, l as useFluidAuthContext, n as useFluidContext } from "./FluidProvider-
|
|
1
|
+
import { bt as createFetchClient, l as useFluidAuthContext, n as useFluidContext } from "./FluidProvider-Eohedipr.mjs";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
3
|
//#region src/hooks/use-fluid-auth.ts
|
|
4
4
|
/**
|
|
@@ -115,4 +115,4 @@ function useSdkClient() {
|
|
|
115
115
|
//#endregion
|
|
116
116
|
export { useSubscriptionsClient as a, useSdkClient as i, useFluidPayClient as n, useFluidAuth as o, useOrdersClient as r, API_VERSION as t };
|
|
117
117
|
|
|
118
|
-
//# sourceMappingURL=use-account-clients-
|
|
118
|
+
//# sourceMappingURL=use-account-clients-CSWgrCKK.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-account-clients-
|
|
1
|
+
{"version":3,"file":"use-account-clients-CSWgrCKK.mjs","names":["createOrdersFetchClient","createSubscriptionsFetchClient","createFluidPayFetchClient","createCoreFetchClient"],"sources":["../src/hooks/use-fluid-auth.ts","../src/account/use-account-clients.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","import { useMemo } from \"react\";\nimport {\n createFetchClient as createOrdersFetchClient,\n type FetchClient as OrdersFetchClient,\n} from \"@fluid-app/orders-api-client\";\nimport {\n createFetchClient as createSubscriptionsFetchClient,\n type FetchClient as SubscriptionsFetchClient,\n} from \"@fluid-app/subscriptions-api-client\";\nimport {\n createFetchClient as createFluidPayFetchClient,\n type FetchClient as FluidPayFetchClient,\n} from \"@fluid-app/fluid-pay-api-client\";\nimport {\n createFetchClient as createCoreFetchClient,\n type FetchClient as CoreFetchClient,\n} from \"@fluid-app/api-client-core\";\nimport { useFluidContext } from \"../providers/FluidProvider\";\nimport { useFluidAuth } from \"../hooks/use-fluid-auth\";\n\n/** API version prefix for versioned endpoints (e.g. points ledger) */\nexport const API_VERSION = \"/v202506\";\n\n/**\n * Ensures baseUrl ends with /api.\n * Domain-specific API clients (orders, subscriptions, fluid-pay) use endpoint\n * paths without /api (e.g. /fluid_pay/me, /subscriptions), matching fluid-admin's\n * NEXT_PUBLIC_API_URL convention. The portal SDK's config.baseUrl is the domain\n * root (e.g. https://api.fluid.app), so we append /api here.\n */\nfunction withApiPrefix(baseUrl: string): string {\n const base = baseUrl.replace(/\\/+$/, \"\");\n return base.endsWith(\"/api\") ? base : `${base}/api`;\n}\n\nexport function useOrdersClient(): OrdersFetchClient {\n const { config } = useFluidContext();\n const { token } = useFluidAuth();\n\n return useMemo(\n () =>\n createOrdersFetchClient({\n baseUrl: withApiPrefix(config.baseUrl),\n getAuthToken: () => token,\n onAuthError: config.onAuthError,\n }),\n [config.baseUrl, config.onAuthError, token],\n );\n}\n\nexport function useSubscriptionsClient(): SubscriptionsFetchClient {\n const { config } = useFluidContext();\n const { token } = useFluidAuth();\n\n return useMemo(\n () =>\n createSubscriptionsFetchClient({\n baseUrl: withApiPrefix(config.baseUrl),\n getAuthToken: () => token,\n onAuthError: config.onAuthError,\n }),\n [config.baseUrl, config.onAuthError, token],\n );\n}\n\nexport function useFluidPayClient(): FluidPayFetchClient {\n const { config } = useFluidContext();\n const { token } = useFluidAuth();\n\n return useMemo(\n () =>\n createFluidPayFetchClient({\n baseUrl: withApiPrefix(config.baseUrl),\n getAuthToken: () => token,\n onAuthError: config.onAuthError,\n }),\n [config.baseUrl, config.onAuthError, token],\n );\n}\n\n/**\n * Generic SDK fetch client for endpoints not covered by domain-specific clients\n * (e.g. /countries, /v202506/customers/:id/points_ledgers).\n * Uses the same auth/baseUrl/error handling as the domain clients.\n */\nexport function useSdkClient(): CoreFetchClient {\n const { config } = useFluidContext();\n const { token } = useFluidAuth();\n\n return useMemo(\n () =>\n createCoreFetchClient({\n baseUrl: withApiPrefix(config.baseUrl),\n getAuthToken: () => token,\n onAuthError: config.onAuthError,\n }),\n [config.baseUrl, config.onAuthError, token],\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,SAAgB,eAAsC;AACpD,QAAO,qBAAqB;;;;;ACpB9B,MAAa,cAAc;;;;;;;;AAS3B,SAAS,cAAc,SAAyB;CAC9C,MAAM,OAAO,QAAQ,QAAQ,QAAQ,GAAG;AACxC,QAAO,KAAK,SAAS,OAAO,GAAG,OAAO,GAAG,KAAK;;AAGhD,SAAgB,kBAAqC;CACnD,MAAM,EAAE,WAAW,iBAAiB;CACpC,MAAM,EAAE,UAAU,cAAc;AAEhC,QAAO,cAEHA,kBAAwB;EACtB,SAAS,cAAc,OAAO,QAAQ;EACtC,oBAAoB;EACpB,aAAa,OAAO;EACrB,CAAC,EACJ;EAAC,OAAO;EAAS,OAAO;EAAa;EAAM,CAC5C;;AAGH,SAAgB,yBAAmD;CACjE,MAAM,EAAE,WAAW,iBAAiB;CACpC,MAAM,EAAE,UAAU,cAAc;AAEhC,QAAO,cAEHC,kBAA+B;EAC7B,SAAS,cAAc,OAAO,QAAQ;EACtC,oBAAoB;EACpB,aAAa,OAAO;EACrB,CAAC,EACJ;EAAC,OAAO;EAAS,OAAO;EAAa;EAAM,CAC5C;;AAGH,SAAgB,oBAAyC;CACvD,MAAM,EAAE,WAAW,iBAAiB;CACpC,MAAM,EAAE,UAAU,cAAc;AAEhC,QAAO,cAEHC,kBAA0B;EACxB,SAAS,cAAc,OAAO,QAAQ;EACtC,oBAAoB;EACpB,aAAa,OAAO;EACrB,CAAC,EACJ;EAAC,OAAO;EAAS,OAAO;EAAa;EAAM,CAC5C;;;;;;;AAQH,SAAgB,eAAgC;CAC9C,MAAM,EAAE,WAAW,iBAAiB;CACpC,MAAM,EAAE,UAAU,cAAc;AAEhC,QAAO,cAEHC,kBAAsB;EACpB,SAAS,cAAc,OAAO,QAAQ;EACtC,oBAAoB;EACpB,aAAa,OAAO;EACrB,CAAC,EACJ;EAAC,OAAO;EAAS,OAAO;EAAa;EAAM,CAC5C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
require("./chunk-9hOWP6kD.cjs");
|
|
2
|
-
const require_FluidProvider = require("./FluidProvider-
|
|
2
|
+
const require_FluidProvider = require("./FluidProvider-Sc51VlLw.cjs");
|
|
3
3
|
let react = require("react");
|
|
4
4
|
//#region src/hooks/use-fluid-auth.ts
|
|
5
5
|
/**
|
|
@@ -151,4 +151,4 @@ Object.defineProperty(exports, "useSubscriptionsClient", {
|
|
|
151
151
|
}
|
|
152
152
|
});
|
|
153
153
|
|
|
154
|
-
//# sourceMappingURL=use-account-clients-
|
|
154
|
+
//# sourceMappingURL=use-account-clients-DaliJYMa.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-account-clients-
|
|
1
|
+
{"version":3,"file":"use-account-clients-DaliJYMa.cjs","names":["useFluidAuthContext","useFluidContext","createOrdersFetchClient","createSubscriptionsFetchClient","createFluidPayFetchClient","createCoreFetchClient"],"sources":["../src/hooks/use-fluid-auth.ts","../src/account/use-account-clients.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","import { useMemo } from \"react\";\nimport {\n createFetchClient as createOrdersFetchClient,\n type FetchClient as OrdersFetchClient,\n} from \"@fluid-app/orders-api-client\";\nimport {\n createFetchClient as createSubscriptionsFetchClient,\n type FetchClient as SubscriptionsFetchClient,\n} from \"@fluid-app/subscriptions-api-client\";\nimport {\n createFetchClient as createFluidPayFetchClient,\n type FetchClient as FluidPayFetchClient,\n} from \"@fluid-app/fluid-pay-api-client\";\nimport {\n createFetchClient as createCoreFetchClient,\n type FetchClient as CoreFetchClient,\n} from \"@fluid-app/api-client-core\";\nimport { useFluidContext } from \"../providers/FluidProvider\";\nimport { useFluidAuth } from \"../hooks/use-fluid-auth\";\n\n/** API version prefix for versioned endpoints (e.g. points ledger) */\nexport const API_VERSION = \"/v202506\";\n\n/**\n * Ensures baseUrl ends with /api.\n * Domain-specific API clients (orders, subscriptions, fluid-pay) use endpoint\n * paths without /api (e.g. /fluid_pay/me, /subscriptions), matching fluid-admin's\n * NEXT_PUBLIC_API_URL convention. The portal SDK's config.baseUrl is the domain\n * root (e.g. https://api.fluid.app), so we append /api here.\n */\nfunction withApiPrefix(baseUrl: string): string {\n const base = baseUrl.replace(/\\/+$/, \"\");\n return base.endsWith(\"/api\") ? base : `${base}/api`;\n}\n\nexport function useOrdersClient(): OrdersFetchClient {\n const { config } = useFluidContext();\n const { token } = useFluidAuth();\n\n return useMemo(\n () =>\n createOrdersFetchClient({\n baseUrl: withApiPrefix(config.baseUrl),\n getAuthToken: () => token,\n onAuthError: config.onAuthError,\n }),\n [config.baseUrl, config.onAuthError, token],\n );\n}\n\nexport function useSubscriptionsClient(): SubscriptionsFetchClient {\n const { config } = useFluidContext();\n const { token } = useFluidAuth();\n\n return useMemo(\n () =>\n createSubscriptionsFetchClient({\n baseUrl: withApiPrefix(config.baseUrl),\n getAuthToken: () => token,\n onAuthError: config.onAuthError,\n }),\n [config.baseUrl, config.onAuthError, token],\n );\n}\n\nexport function useFluidPayClient(): FluidPayFetchClient {\n const { config } = useFluidContext();\n const { token } = useFluidAuth();\n\n return useMemo(\n () =>\n createFluidPayFetchClient({\n baseUrl: withApiPrefix(config.baseUrl),\n getAuthToken: () => token,\n onAuthError: config.onAuthError,\n }),\n [config.baseUrl, config.onAuthError, token],\n );\n}\n\n/**\n * Generic SDK fetch client for endpoints not covered by domain-specific clients\n * (e.g. /countries, /v202506/customers/:id/points_ledgers).\n * Uses the same auth/baseUrl/error handling as the domain clients.\n */\nexport function useSdkClient(): CoreFetchClient {\n const { config } = useFluidContext();\n const { token } = useFluidAuth();\n\n return useMemo(\n () =>\n createCoreFetchClient({\n baseUrl: withApiPrefix(config.baseUrl),\n getAuthToken: () => token,\n onAuthError: config.onAuthError,\n }),\n [config.baseUrl, config.onAuthError, token],\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwCA,SAAgB,eAAsC;AACpD,QAAOA,sBAAAA,qBAAqB;;;;;ACpB9B,MAAa,cAAc;;;;;;;;AAS3B,SAAS,cAAc,SAAyB;CAC9C,MAAM,OAAO,QAAQ,QAAQ,QAAQ,GAAG;AACxC,QAAO,KAAK,SAAS,OAAO,GAAG,OAAO,GAAG,KAAK;;AAGhD,SAAgB,kBAAqC;CACnD,MAAM,EAAE,WAAWC,sBAAAA,iBAAiB;CACpC,MAAM,EAAE,UAAU,cAAc;AAEhC,SAAA,GAAA,MAAA,eAEIC,sBAAAA,kBAAwB;EACtB,SAAS,cAAc,OAAO,QAAQ;EACtC,oBAAoB;EACpB,aAAa,OAAO;EACrB,CAAC,EACJ;EAAC,OAAO;EAAS,OAAO;EAAa;EAAM,CAC5C;;AAGH,SAAgB,yBAAmD;CACjE,MAAM,EAAE,WAAWD,sBAAAA,iBAAiB;CACpC,MAAM,EAAE,UAAU,cAAc;AAEhC,SAAA,GAAA,MAAA,eAEIE,sBAAAA,kBAA+B;EAC7B,SAAS,cAAc,OAAO,QAAQ;EACtC,oBAAoB;EACpB,aAAa,OAAO;EACrB,CAAC,EACJ;EAAC,OAAO;EAAS,OAAO;EAAa;EAAM,CAC5C;;AAGH,SAAgB,oBAAyC;CACvD,MAAM,EAAE,WAAWF,sBAAAA,iBAAiB;CACpC,MAAM,EAAE,UAAU,cAAc;AAEhC,SAAA,GAAA,MAAA,eAEIG,sBAAAA,kBAA0B;EACxB,SAAS,cAAc,OAAO,QAAQ;EACtC,oBAAoB;EACpB,aAAa,OAAO;EACrB,CAAC,EACJ;EAAC,OAAO;EAAS,OAAO;EAAa;EAAM,CAC5C;;;;;;;AAQH,SAAgB,eAAgC;CAC9C,MAAM,EAAE,WAAWH,sBAAAA,iBAAiB;CACpC,MAAM,EAAE,UAAU,cAAc;AAEhC,SAAA,GAAA,MAAA,eAEII,sBAAAA,kBAAsB;EACpB,SAAS,cAAc,OAAO,QAAQ;EACtC,oBAAoB;EACpB,aAAa,OAAO;EACrB,CAAC,EACJ;EAAC,OAAO;EAAS,OAAO;EAAa;EAAM,CAC5C"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require("./chunk-9hOWP6kD.cjs");
|
|
2
|
-
const require_FluidProvider = require("./FluidProvider-
|
|
3
|
-
const require_use_fluid_api = require("./use-fluid-api-
|
|
2
|
+
const require_FluidProvider = require("./FluidProvider-Sc51VlLw.cjs");
|
|
3
|
+
const require_use_fluid_api = require("./use-fluid-api-BUitsoDu.cjs");
|
|
4
4
|
let react = require("react");
|
|
5
5
|
let _tanstack_react_query = require("@tanstack/react-query");
|
|
6
6
|
//#region src/hooks/query-keys.ts
|
|
@@ -122,4 +122,4 @@ Object.defineProperty(exports, "useCurrentUser", {
|
|
|
122
122
|
}
|
|
123
123
|
});
|
|
124
124
|
|
|
125
|
-
//# sourceMappingURL=use-current-user-
|
|
125
|
+
//# sourceMappingURL=use-current-user-5erIFUd6.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-current-user-
|
|
1
|
+
{"version":3,"file":"use-current-user-5erIFUd6.cjs","names":["useFluidAuthContext","useFluidApi"],"sources":["../src/hooks/query-keys.ts","../src/hooks/use-current-user.ts"],"sourcesContent":["/**\n * Company-scoped query key factory for TanStack Query.\n *\n * All portal SDK query keys are prefixed with [\"company\", companyId, ...]\n * so that switching companies naturally invalidates the entire cache scope.\n *\n * The exported `*_QUERY_KEY` constants (e.g. PROFILE_QUERY_KEY) remain as\n * backwards-compatible base keys. The runtime keys used by hooks include the\n * company prefix via {@link createCompanyQueryKey}.\n */\n\nimport { useCallback, useRef } from \"react\";\nimport { useFluidAuthContext } from \"../providers/FluidAuthProvider\";\n\n/**\n * Create a company-scoped query key by prepending [\"company\", companyId].\n *\n * @param companyId - The company ID from the JWT payload\n * @param baseKey - The base query key segments (e.g. [\"fluid\", \"profile\"])\n * @returns A tuple like [\"company\", 42, \"fluid\", \"profile\"]\n *\n * @example\n * ```ts\n * const key = createCompanyQueryKey(42, \"fluid\", \"profile\");\n * // => [\"company\", 42, \"fluid\", \"profile\"]\n * ```\n */\nexport function createCompanyQueryKey(\n companyId: number,\n ...baseKey: readonly string[]\n): readonly [\"company\", number, ...string[]] {\n return [\"company\", companyId, ...baseKey] as const;\n}\n\n/**\n * Hook that returns a `scopeKey` function bound to the current company ID\n * from the auth context. If the user is not authenticated or has no\n * company_id, the base key is returned unscoped (graceful degradation).\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const { scopeKey } = useCompanyScopedQueryKey();\n * const queryKey = scopeKey(PROFILE_QUERY_KEY);\n * // => [\"company\", 42, \"fluid\", \"profile\"] (when authenticated)\n * // => [\"fluid\", \"profile\"] (fallback)\n * }\n * ```\n */\nexport function useCompanyScopedQueryKey(): {\n readonly companyId: number | undefined;\n readonly scopeKey: <T extends readonly string[]>(\n baseKey: T,\n ) => readonly (string | number)[];\n} {\n const auth = useFluidAuthContext();\n const companyId = auth.user?.company_id;\n\n // Warn (once per component instance) when an authenticated user has no\n // company_id. This is a security-relevant condition: unscoped keys allow\n // cross-company cache collisions. The warning fires in all environments\n // so that it's visible in production logs if a misconfigured JWT is issued.\n const hasWarnedRef = useRef(false);\n if (auth.isAuthenticated && companyId == null && !hasWarnedRef.current) {\n hasWarnedRef.current = true;\n console.warn(\n \"[portal-sdk] Authenticated user has no company_id in JWT. \" +\n \"Query keys will fall back to unscoped keys, which may cause \" +\n \"cross-company cache collisions. Ensure the JWT includes company_id.\",\n );\n }\n\n const scopeKey = useCallback(\n <T extends readonly string[]>(baseKey: T): readonly (string | number)[] => {\n if (companyId != null) {\n return createCompanyQueryKey(companyId, ...baseKey);\n }\n return baseKey;\n },\n [companyId],\n );\n\n return { companyId, scopeKey } as const;\n}\n","import { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { useFluidApi } from \"./use-fluid-api\";\nimport { useCompanyScopedQueryKey } from \"./query-keys\";\nimport type { UserMe } from \"../types/rep\";\n\n/**\n * Base query key for current user data.\n * Kept for backwards compatibility — the runtime key used by the hook\n * includes a company prefix via {@link useCompanyScopedQueryKey}.\n */\nexport const CURRENT_USER_QUERY_KEY = [\"fluid\", \"currentUser\"] as const;\n\n/**\n * Hook to fetch the currently authenticated user's full profile.\n * Returns company, country, and other fields from GET /api/me.\n *\n * @example\n * ```tsx\n * function ShopPage() {\n * const { data: user, isLoading } = useCurrentUser();\n * const subdomain = user?.company?.subdomain;\n * const countryIso = user?.country?.iso ?? \"US\";\n * // ...\n * }\n * ```\n */\nexport function useCurrentUser(): UseQueryResult<UserMe> {\n const api = useFluidApi();\n const { scopeKey } = useCompanyScopedQueryKey();\n\n return useQuery({\n queryKey: scopeKey(CURRENT_USER_QUERY_KEY),\n queryFn: () => api.users.me(),\n staleTime: 5 * 60 * 1000,\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,SAAgB,sBACd,WACA,GAAG,SACwC;AAC3C,QAAO;EAAC;EAAW;EAAW,GAAG;EAAQ;;;;;;;;;;;;;;;;;AAkB3C,SAAgB,2BAKd;CACA,MAAM,OAAOA,sBAAAA,qBAAqB;CAClC,MAAM,YAAY,KAAK,MAAM;CAM7B,MAAM,gBAAA,GAAA,MAAA,QAAsB,MAAM;AAClC,KAAI,KAAK,mBAAmB,aAAa,QAAQ,CAAC,aAAa,SAAS;AACtE,eAAa,UAAU;AACvB,UAAQ,KACN,4LAGD;;AAaH,QAAO;EAAE;EAAW,WAAA,GAAA,MAAA,cATY,YAA6C;AACzE,OAAI,aAAa,KACf,QAAO,sBAAsB,WAAW,GAAG,QAAQ;AAErD,UAAO;KAET,CAAC,UAAU,CACZ;EAE6B;;;;;;;;;ACxEhC,MAAa,yBAAyB,CAAC,SAAS,cAAc;;;;;;;;;;;;;;;AAgB9D,SAAgB,iBAAyC;CACvD,MAAM,MAAMC,sBAAAA,aAAa;CACzB,MAAM,EAAE,aAAa,0BAA0B;AAE/C,SAAA,GAAA,sBAAA,UAAgB;EACd,UAAU,SAAS,uBAAuB;EAC1C,eAAe,IAAI,MAAM,IAAI;EAC7B,WAAW,MAAS;EACrB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as useFluidAuthContext } from "./FluidProvider-
|
|
2
|
-
import { t as useFluidApi } from "./use-fluid-api-
|
|
1
|
+
import { l as useFluidAuthContext } from "./FluidProvider-Eohedipr.mjs";
|
|
2
|
+
import { t as useFluidApi } from "./use-fluid-api-C5ZLs2TP.mjs";
|
|
3
3
|
import { useCallback, useRef } from "react";
|
|
4
4
|
import { useQuery } from "@tanstack/react-query";
|
|
5
5
|
//#region src/hooks/query-keys.ts
|
|
@@ -98,4 +98,4 @@ function useCurrentUser() {
|
|
|
98
98
|
//#endregion
|
|
99
99
|
export { useCompanyScopedQueryKey as i, useCurrentUser as n, createCompanyQueryKey as r, CURRENT_USER_QUERY_KEY as t };
|
|
100
100
|
|
|
101
|
-
//# sourceMappingURL=use-current-user-
|
|
101
|
+
//# sourceMappingURL=use-current-user-BBQg1iYf.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-current-user-
|
|
1
|
+
{"version":3,"file":"use-current-user-BBQg1iYf.mjs","names":[],"sources":["../src/hooks/query-keys.ts","../src/hooks/use-current-user.ts"],"sourcesContent":["/**\n * Company-scoped query key factory for TanStack Query.\n *\n * All portal SDK query keys are prefixed with [\"company\", companyId, ...]\n * so that switching companies naturally invalidates the entire cache scope.\n *\n * The exported `*_QUERY_KEY` constants (e.g. PROFILE_QUERY_KEY) remain as\n * backwards-compatible base keys. The runtime keys used by hooks include the\n * company prefix via {@link createCompanyQueryKey}.\n */\n\nimport { useCallback, useRef } from \"react\";\nimport { useFluidAuthContext } from \"../providers/FluidAuthProvider\";\n\n/**\n * Create a company-scoped query key by prepending [\"company\", companyId].\n *\n * @param companyId - The company ID from the JWT payload\n * @param baseKey - The base query key segments (e.g. [\"fluid\", \"profile\"])\n * @returns A tuple like [\"company\", 42, \"fluid\", \"profile\"]\n *\n * @example\n * ```ts\n * const key = createCompanyQueryKey(42, \"fluid\", \"profile\");\n * // => [\"company\", 42, \"fluid\", \"profile\"]\n * ```\n */\nexport function createCompanyQueryKey(\n companyId: number,\n ...baseKey: readonly string[]\n): readonly [\"company\", number, ...string[]] {\n return [\"company\", companyId, ...baseKey] as const;\n}\n\n/**\n * Hook that returns a `scopeKey` function bound to the current company ID\n * from the auth context. If the user is not authenticated or has no\n * company_id, the base key is returned unscoped (graceful degradation).\n *\n * @example\n * ```tsx\n * function MyComponent() {\n * const { scopeKey } = useCompanyScopedQueryKey();\n * const queryKey = scopeKey(PROFILE_QUERY_KEY);\n * // => [\"company\", 42, \"fluid\", \"profile\"] (when authenticated)\n * // => [\"fluid\", \"profile\"] (fallback)\n * }\n * ```\n */\nexport function useCompanyScopedQueryKey(): {\n readonly companyId: number | undefined;\n readonly scopeKey: <T extends readonly string[]>(\n baseKey: T,\n ) => readonly (string | number)[];\n} {\n const auth = useFluidAuthContext();\n const companyId = auth.user?.company_id;\n\n // Warn (once per component instance) when an authenticated user has no\n // company_id. This is a security-relevant condition: unscoped keys allow\n // cross-company cache collisions. The warning fires in all environments\n // so that it's visible in production logs if a misconfigured JWT is issued.\n const hasWarnedRef = useRef(false);\n if (auth.isAuthenticated && companyId == null && !hasWarnedRef.current) {\n hasWarnedRef.current = true;\n console.warn(\n \"[portal-sdk] Authenticated user has no company_id in JWT. \" +\n \"Query keys will fall back to unscoped keys, which may cause \" +\n \"cross-company cache collisions. Ensure the JWT includes company_id.\",\n );\n }\n\n const scopeKey = useCallback(\n <T extends readonly string[]>(baseKey: T): readonly (string | number)[] => {\n if (companyId != null) {\n return createCompanyQueryKey(companyId, ...baseKey);\n }\n return baseKey;\n },\n [companyId],\n );\n\n return { companyId, scopeKey } as const;\n}\n","import { useQuery, type UseQueryResult } from \"@tanstack/react-query\";\nimport { useFluidApi } from \"./use-fluid-api\";\nimport { useCompanyScopedQueryKey } from \"./query-keys\";\nimport type { UserMe } from \"../types/rep\";\n\n/**\n * Base query key for current user data.\n * Kept for backwards compatibility — the runtime key used by the hook\n * includes a company prefix via {@link useCompanyScopedQueryKey}.\n */\nexport const CURRENT_USER_QUERY_KEY = [\"fluid\", \"currentUser\"] as const;\n\n/**\n * Hook to fetch the currently authenticated user's full profile.\n * Returns company, country, and other fields from GET /api/me.\n *\n * @example\n * ```tsx\n * function ShopPage() {\n * const { data: user, isLoading } = useCurrentUser();\n * const subdomain = user?.company?.subdomain;\n * const countryIso = user?.country?.iso ?? \"US\";\n * // ...\n * }\n * ```\n */\nexport function useCurrentUser(): UseQueryResult<UserMe> {\n const api = useFluidApi();\n const { scopeKey } = useCompanyScopedQueryKey();\n\n return useQuery({\n queryKey: scopeKey(CURRENT_USER_QUERY_KEY),\n queryFn: () => api.users.me(),\n staleTime: 5 * 60 * 1000,\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,SAAgB,sBACd,WACA,GAAG,SACwC;AAC3C,QAAO;EAAC;EAAW;EAAW,GAAG;EAAQ;;;;;;;;;;;;;;;;;AAkB3C,SAAgB,2BAKd;CACA,MAAM,OAAO,qBAAqB;CAClC,MAAM,YAAY,KAAK,MAAM;CAM7B,MAAM,eAAe,OAAO,MAAM;AAClC,KAAI,KAAK,mBAAmB,aAAa,QAAQ,CAAC,aAAa,SAAS;AACtE,eAAa,UAAU;AACvB,UAAQ,KACN,4LAGD;;AAaH,QAAO;EAAE;EAAW,UAVH,aACe,YAA6C;AACzE,OAAI,aAAa,KACf,QAAO,sBAAsB,WAAW,GAAG,QAAQ;AAErD,UAAO;KAET,CAAC,UAAU,CACZ;EAE6B;;;;;;;;;ACxEhC,MAAa,yBAAyB,CAAC,SAAS,cAAc;;;;;;;;;;;;;;;AAgB9D,SAAgB,iBAAyC;CACvD,MAAM,MAAM,aAAa;CACzB,MAAM,EAAE,aAAa,0BAA0B;AAE/C,QAAO,SAAS;EACd,UAAU,SAAS,uBAAuB;EAC1C,eAAe,IAAI,MAAM,IAAI;EAC7B,WAAW,MAAS;EACrB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _t as fetchCustomerAccount } from "./FluidProvider-
|
|
2
|
-
import { n as useFluidPayClient, o as useFluidAuth } from "./use-account-clients-
|
|
1
|
+
import { _t as fetchCustomerAccount } from "./FluidProvider-Eohedipr.mjs";
|
|
2
|
+
import { n as useFluidPayClient, o as useFluidAuth } from "./use-account-clients-CSWgrCKK.mjs";
|
|
3
3
|
import { useQuery } from "@tanstack/react-query";
|
|
4
4
|
//#region src/account/use-customer-account.ts
|
|
5
5
|
function useCustomerAccount({ enabled = true } = {}) {
|
|
@@ -20,4 +20,4 @@ function useCustomerAccount({ enabled = true } = {}) {
|
|
|
20
20
|
//#endregion
|
|
21
21
|
export { useCustomerAccount as t };
|
|
22
22
|
|
|
23
|
-
//# sourceMappingURL=use-customer-account-
|
|
23
|
+
//# sourceMappingURL=use-customer-account-CRYpHpFM.mjs.map
|
package/dist/{use-customer-account-CY9HqWvJ.mjs.map → use-customer-account-CRYpHpFM.mjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-customer-account-
|
|
1
|
+
{"version":3,"file":"use-customer-account-CRYpHpFM.mjs","names":["customersApi.fetchCustomerAccount"],"sources":["../src/account/use-customer-account.ts"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport { customersApi } from \"@fluid-app/fluid-pay-api-client\";\nimport { useFluidAuth } from \"../hooks/use-fluid-auth\";\nimport { useFluidPayClient } from \"./use-account-clients\";\n\nexport function useCustomerAccount({\n enabled = true,\n}: { enabled?: boolean } = {}) {\n const { token, user } = useFluidAuth();\n const fluidPayClient = useFluidPayClient();\n const jwt = token ?? \"\";\n\n const query = useQuery({\n queryKey: [\"fluidPayAccount\", user?.id],\n queryFn: () => customersApi.fetchCustomerAccount(fluidPayClient, jwt),\n enabled: !!jwt && enabled,\n });\n\n return {\n customerId: query.data?.customer?.id,\n isLoadingCustomer: query.isLoading,\n isCustomerError: query.isError,\n };\n}\n"],"mappings":";;;;AAKA,SAAgB,mBAAmB,EACjC,UAAU,SACe,EAAE,EAAE;CAC7B,MAAM,EAAE,OAAO,SAAS,cAAc;CACtC,MAAM,iBAAiB,mBAAmB;CAC1C,MAAM,MAAM,SAAS;CAErB,MAAM,QAAQ,SAAS;EACrB,UAAU,CAAC,mBAAmB,MAAM,GAAG;EACvC,eAAeA,qBAAkC,gBAAgB,IAAI;EACrE,SAAS,CAAC,CAAC,OAAO;EACnB,CAAC;AAEF,QAAO;EACL,YAAY,MAAM,MAAM,UAAU;EAClC,mBAAmB,MAAM;EACzB,iBAAiB,MAAM;EACxB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require("./chunk-9hOWP6kD.cjs");
|
|
2
|
-
const require_FluidProvider = require("./FluidProvider-
|
|
3
|
-
const require_use_account_clients = require("./use-account-clients-
|
|
2
|
+
const require_FluidProvider = require("./FluidProvider-Sc51VlLw.cjs");
|
|
3
|
+
const require_use_account_clients = require("./use-account-clients-DaliJYMa.cjs");
|
|
4
4
|
let _tanstack_react_query = require("@tanstack/react-query");
|
|
5
5
|
//#region src/account/use-customer-account.ts
|
|
6
6
|
function useCustomerAccount({ enabled = true } = {}) {
|
|
@@ -26,4 +26,4 @@ Object.defineProperty(exports, "useCustomerAccount", {
|
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
-
//# sourceMappingURL=use-customer-account-
|
|
29
|
+
//# sourceMappingURL=use-customer-account-Dzdps4By.cjs.map
|
package/dist/{use-customer-account-D599KeSp.cjs.map → use-customer-account-Dzdps4By.cjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-customer-account-
|
|
1
|
+
{"version":3,"file":"use-customer-account-Dzdps4By.cjs","names":["useFluidAuth","useFluidPayClient"],"sources":["../src/account/use-customer-account.ts"],"sourcesContent":["import { useQuery } from \"@tanstack/react-query\";\nimport { customersApi } from \"@fluid-app/fluid-pay-api-client\";\nimport { useFluidAuth } from \"../hooks/use-fluid-auth\";\nimport { useFluidPayClient } from \"./use-account-clients\";\n\nexport function useCustomerAccount({\n enabled = true,\n}: { enabled?: boolean } = {}) {\n const { token, user } = useFluidAuth();\n const fluidPayClient = useFluidPayClient();\n const jwt = token ?? \"\";\n\n const query = useQuery({\n queryKey: [\"fluidPayAccount\", user?.id],\n queryFn: () => customersApi.fetchCustomerAccount(fluidPayClient, jwt),\n enabled: !!jwt && enabled,\n });\n\n return {\n customerId: query.data?.customer?.id,\n isLoadingCustomer: query.isLoading,\n isCustomerError: query.isError,\n };\n}\n"],"mappings":";;;;;AAKA,SAAgB,mBAAmB,EACjC,UAAU,SACe,EAAE,EAAE;CAC7B,MAAM,EAAE,OAAO,SAASA,4BAAAA,cAAc;CACtC,MAAM,iBAAiBC,4BAAAA,mBAAmB;CAC1C,MAAM,MAAM,SAAS;CAErB,MAAM,SAAA,GAAA,sBAAA,UAAiB;EACrB,UAAU,CAAC,mBAAmB,MAAM,GAAG;EACvC,eAAA,sBAAA,qBAAiD,gBAAgB,IAAI;EACrE,SAAS,CAAC,CAAC,OAAO;EACnB,CAAC;AAEF,QAAO;EACL,YAAY,MAAM,MAAM,UAAU;EAClC,mBAAmB,MAAM;EACzB,iBAAiB,MAAM;EACxB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_FluidProvider = require("./FluidProvider-
|
|
1
|
+
const require_FluidProvider = require("./FluidProvider-Sc51VlLw.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-BUitsoDu.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-fluid-api-
|
|
1
|
+
{"version":3,"file":"use-fluid-api-BUitsoDu.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 ProductList() {\n * const api = useFluidApi();\n *\n * const { data: products } = useQuery({\n * queryKey: [\"products\"],\n * queryFn: () => api.products.list(),\n * });\n *\n * return <ul>{products?.map(p => <li key={p.id}>{p.name}</li>)}</ul>;\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 { n as useFluidContext } from "./FluidProvider-
|
|
1
|
+
import { n as useFluidContext } from "./FluidProvider-Eohedipr.mjs";
|
|
2
2
|
//#region src/hooks/use-fluid-api.ts
|
|
3
3
|
/**
|
|
4
4
|
* Hook to access the Fluid API client
|
|
@@ -24,4 +24,4 @@ function useFluidApi() {
|
|
|
24
24
|
//#endregion
|
|
25
25
|
export { useFluidApi as t };
|
|
26
26
|
|
|
27
|
-
//# sourceMappingURL=use-fluid-api-
|
|
27
|
+
//# sourceMappingURL=use-fluid-api-C5ZLs2TP.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-fluid-api-
|
|
1
|
+
{"version":3,"file":"use-fluid-api-C5ZLs2TP.mjs","names":[],"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 ProductList() {\n * const api = useFluidApi();\n *\n * const { data: products } = useQuery({\n * queryKey: [\"products\"],\n * queryFn: () => api.products.list(),\n * });\n *\n * return <ul>{products?.map(p => <li key={p.id}>{p.name}</li>)}</ul>;\n * }\n * ```\n */\nexport function useFluidApi(): FluidClient {\n const { client } = useFluidContext();\n return client;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAoBA,SAAgB,cAA2B;CACzC,MAAM,EAAE,WAAW,iBAAiB;AACpC,QAAO"}
|