@fluid-app/portal-sdk 0.1.143 → 0.1.144
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-BgG2WT8g.cjs → AppDownloadScreen-CxkoYLT6.cjs} +2 -2
- package/dist/{AppDownloadScreen-BgG2WT8g.cjs.map → AppDownloadScreen-CxkoYLT6.cjs.map} +1 -1
- package/dist/{AppDownloadScreen-CfyCY70_.cjs → AppDownloadScreen-DXZpoE5A.cjs} +2 -2
- package/dist/{AppDownloadScreen-CFBcywVF.mjs → AppDownloadScreen-ga-5O4jr.mjs} +2 -2
- package/dist/{AppDownloadScreen-CFBcywVF.mjs.map → AppDownloadScreen-ga-5O4jr.mjs.map} +1 -1
- package/dist/{ContactsScreen-B0CcTg4i.mjs → ContactsScreen-C-xJcR5X.mjs} +6 -6
- package/dist/{ContactsScreen-B0CcTg4i.mjs.map → ContactsScreen-C-xJcR5X.mjs.map} +1 -1
- package/dist/{ContactsScreen-cq-zMYwU.cjs → ContactsScreen-DYkGu477.cjs} +7 -7
- package/dist/{ContactsScreen-C2SykfSe.cjs → ContactsScreen-RQ1IENFl.cjs} +6 -6
- package/dist/{ContactsScreen-C2SykfSe.cjs.map → ContactsScreen-RQ1IENFl.cjs.map} +1 -1
- package/dist/{FluidProvider-D8lmeIsK.mjs → FluidProvider-Bs9eWShT.mjs} +226 -9
- package/dist/FluidProvider-Bs9eWShT.mjs.map +1 -0
- package/dist/{FluidProvider-9laphShJ.cjs → FluidProvider-DzCUwDPA.cjs} +231 -8
- package/dist/FluidProvider-DzCUwDPA.cjs.map +1 -0
- package/dist/{MessagingScreen-CQGyTGz7.cjs → MessagingScreen-BmAICPkY.cjs} +4 -4
- package/dist/{MessagingScreen-DY8FhtNu.cjs → MessagingScreen-D7hAjWaG.cjs} +5 -5
- package/dist/{MessagingScreen-DY8FhtNu.cjs.map → MessagingScreen-D7hAjWaG.cjs.map} +1 -1
- package/dist/{MessagingScreen-DmwSYXYa.mjs → MessagingScreen-DOcgxDbR.mjs} +4 -4
- package/dist/{MessagingScreen-DmwSYXYa.mjs.map → MessagingScreen-DOcgxDbR.mjs.map} +1 -1
- package/dist/{MySiteScreen-CZf06WvK.cjs → MySiteScreen-BMFJLAwJ.cjs} +2 -2
- package/dist/{MySiteScreen-CZf06WvK.cjs.map → MySiteScreen-BMFJLAwJ.cjs.map} +1 -1
- package/dist/{MySiteScreen-CP4ePv25.mjs → MySiteScreen-BwCQLYBT.mjs} +2 -2
- package/dist/{MySiteScreen-CP4ePv25.mjs.map → MySiteScreen-BwCQLYBT.mjs.map} +1 -1
- package/dist/{MySiteScreen-3uoP4Nro.cjs → MySiteScreen-C_-EPLsj.cjs} +2 -2
- package/dist/{OrdersScreen-B4s3yqWO.cjs → OrdersScreen-DHoIUinY.cjs} +3 -3
- package/dist/{OrdersScreen-B4s3yqWO.cjs.map → OrdersScreen-DHoIUinY.cjs.map} +1 -1
- package/dist/{OrdersScreen-qnOfswUT.cjs → OrdersScreen-DgBe0kl9.cjs} +3 -3
- package/dist/{OrdersScreen-DE1lIZKm.mjs → OrdersScreen-ihhKswAb.mjs} +3 -3
- package/dist/{OrdersScreen-DE1lIZKm.mjs.map → OrdersScreen-ihhKswAb.mjs.map} +1 -1
- package/dist/{ProductsScreen-chLWiA1J.mjs → ProductsScreen-BbgYlCfQ.mjs} +6 -6
- package/dist/{ProductsScreen-chLWiA1J.mjs.map → ProductsScreen-BbgYlCfQ.mjs.map} +1 -1
- package/dist/{ProductsScreen-Bq1Q_T06.cjs → ProductsScreen-BulxEN71.cjs} +7 -7
- package/dist/{ProductsScreen-DA0yNpXn.mjs → ProductsScreen-OPY76KpG.mjs} +6 -7
- package/dist/{ProductsScreen-CC1BM7Ye.cjs → ProductsScreen-snrXLhuy.cjs} +6 -6
- package/dist/{ProductsScreen-CC1BM7Ye.cjs.map → ProductsScreen-snrXLhuy.cjs.map} +1 -1
- package/dist/{ProfileScreen-CxvAKgdU.cjs → ProfileScreen-CES4uRpE.cjs} +2 -2
- package/dist/{ProfileScreen-Dm8EcLVL.cjs → ProfileScreen-CPCkXse4.cjs} +4 -5
- package/dist/{ProfileScreen-Dm8EcLVL.cjs.map → ProfileScreen-CPCkXse4.cjs.map} +1 -1
- package/dist/{ProfileScreen-DmV9jRth.mjs → ProfileScreen-doxUb6Ud.mjs} +3 -4
- package/dist/{ProfileScreen-DmV9jRth.mjs.map → ProfileScreen-doxUb6Ud.mjs.map} +1 -1
- package/dist/{SearchSort-CyeeUmwC.cjs → SearchSort-DOLoubGE.cjs} +1 -1
- package/dist/{SearchSort-CyeeUmwC.cjs.map → SearchSort-DOLoubGE.cjs.map} +1 -1
- package/dist/{SearchSort-BXklP8Pq.mjs → SearchSort-LZm-VfF7.mjs} +1 -1
- package/dist/{SearchSort-BXklP8Pq.mjs.map → SearchSort-LZm-VfF7.mjs.map} +1 -1
- package/dist/{ShareablesScreen-CNmjazDa.cjs → ShareablesScreen-B6-BcjEt.cjs} +7 -7
- package/dist/{ShareablesScreen-B9iGTVVk.mjs → ShareablesScreen-CJk0udFG.mjs} +7 -7
- package/dist/{ShareablesScreen-B9iGTVVk.mjs.map → ShareablesScreen-CJk0udFG.mjs.map} +1 -1
- package/dist/{ShareablesScreen-CVkk0Lpn.cjs → ShareablesScreen-DaQAxGCr.cjs} +7 -7
- package/dist/{ShareablesScreen-CVkk0Lpn.cjs.map → ShareablesScreen-DaQAxGCr.cjs.map} +1 -1
- package/dist/{ShareablesScreen-D7cFD7Sn.mjs → ShareablesScreen-yC7UrhhU.mjs} +6 -7
- package/dist/{ShopScreen-BdyMXm0s.mjs → ShopScreen-B3kyH-AP.mjs} +5 -5
- package/dist/{ShopScreen-BdyMXm0s.mjs.map → ShopScreen-B3kyH-AP.mjs.map} +1 -1
- package/dist/{ShopScreen-B5GJr-kG.cjs → ShopScreen-D6JAjTai.cjs} +5 -5
- package/dist/{ShopScreen-B5GJr-kG.cjs.map → ShopScreen-D6JAjTai.cjs.map} +1 -1
- package/dist/{ShopScreen-Che0Axn9.cjs → ShopScreen-DUpCS4va.cjs} +3 -3
- package/dist/{SubscriptionsScreen-xNd35SPG.cjs → SubscriptionsScreen-CEkKX-O9.cjs} +5 -5
- package/dist/{SubscriptionsScreen-xNd35SPG.cjs.map → SubscriptionsScreen-CEkKX-O9.cjs.map} +1 -1
- package/dist/{SubscriptionsScreen-BqiGuMsz.mjs → SubscriptionsScreen-DlRbMhFz.mjs} +5 -5
- package/dist/{SubscriptionsScreen-BqiGuMsz.mjs.map → SubscriptionsScreen-DlRbMhFz.mjs.map} +1 -1
- package/dist/{SubscriptionsScreen-DHYHBWVD.cjs → SubscriptionsScreen-jpRkUvPY.cjs} +5 -5
- package/dist/{dist-Cl4FsM3V.mjs → dist-B8padP0r.mjs} +2 -2
- package/dist/{dist-Cl4FsM3V.mjs.map → dist-B8padP0r.mjs.map} +1 -1
- package/dist/{dist-CbeLS2R5.cjs → dist-BoyKnTdv.cjs} +2 -2
- package/dist/{dist-CbeLS2R5.cjs.map → dist-BoyKnTdv.cjs.map} +1 -1
- package/dist/{dist-BbS_7TvS.cjs → dist-DRVtlgQ1.cjs} +1 -1
- package/dist/{dist-BbS_7TvS.cjs.map → dist-DRVtlgQ1.cjs.map} +1 -1
- package/dist/{dist-CMGXkSgZ.mjs → dist-NMbUD0qE.mjs} +1 -1
- package/dist/{dist-CMGXkSgZ.mjs.map → dist-NMbUD0qE.mjs.map} +1 -1
- package/dist/{es-BSkb3AZk.cjs → es-DlWO6buB.cjs} +1 -1
- package/dist/{es-BSkb3AZk.cjs.map → es-DlWO6buB.cjs.map} +1 -1
- package/dist/index.cjs +41 -41
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +40 -40
- package/dist/{order-status-badge-DsbuULAc.cjs → order-status-badge-BqoNJ8XK.cjs} +1 -1
- package/dist/{order-status-badge-DsbuULAc.cjs.map → order-status-badge-BqoNJ8XK.cjs.map} +1 -1
- package/dist/{order-status-badge-B-iGmxDO.mjs → order-status-badge-CkvYyjT7.mjs} +1 -1
- package/dist/{order-status-badge-B-iGmxDO.mjs.map → order-status-badge-CkvYyjT7.mjs.map} +1 -1
- package/dist/{portal-tenant-product-media-adapter-y_yCswfv.mjs → portal-tenant-product-media-adapter-BHtx3DdM.mjs} +4 -4
- package/dist/{portal-tenant-product-media-adapter-y_yCswfv.mjs.map → portal-tenant-product-media-adapter-BHtx3DdM.mjs.map} +1 -1
- package/dist/{portal-tenant-product-media-adapter-DmH2iJvp.cjs → portal-tenant-product-media-adapter-qXW0vGG8.cjs} +5 -5
- package/dist/{portal-tenant-product-media-adapter-DmH2iJvp.cjs.map → portal-tenant-product-media-adapter-qXW0vGG8.cjs.map} +1 -1
- package/dist/{use-account-clients-CrfXjWkZ.cjs → use-account-clients-GUakuhX-.cjs} +2 -216
- package/dist/use-account-clients-GUakuhX-.cjs.map +1 -0
- package/dist/{use-account-clients-B6QsWPOL.mjs → use-account-clients-d3FMT7rH.mjs} +3 -211
- package/dist/use-account-clients-d3FMT7rH.mjs.map +1 -0
- package/dist/{use-current-user-tKZEo3eh.mjs → use-current-user-Cjd0lFyc.mjs} +3 -3
- package/dist/{use-current-user-tKZEo3eh.mjs.map → use-current-user-Cjd0lFyc.mjs.map} +1 -1
- package/dist/{use-current-user-BcmQRCRx.cjs → use-current-user-idj1wuKD.cjs} +3 -3
- package/dist/{use-current-user-BcmQRCRx.cjs.map → use-current-user-idj1wuKD.cjs.map} +1 -1
- package/dist/{use-fluid-api-9llkapbM.mjs → use-fluid-api-DdMmBE5K.mjs} +2 -2
- package/dist/{use-fluid-api-9llkapbM.mjs.map → use-fluid-api-DdMmBE5K.mjs.map} +1 -1
- package/dist/{use-fluid-api-Cj5Bow8S.cjs → use-fluid-api-DnDH2bby.cjs} +2 -2
- package/dist/{use-fluid-api-Cj5Bow8S.cjs.map → use-fluid-api-DnDH2bby.cjs.map} +1 -1
- package/dist/{use-fluid-auth-D4NGGBW0.cjs → use-fluid-auth-CcxpIYkI.cjs} +2 -2
- package/dist/{use-fluid-auth-D4NGGBW0.cjs.map → use-fluid-auth-CcxpIYkI.cjs.map} +1 -1
- package/dist/{use-fluid-auth-vb2QMUi4.mjs → use-fluid-auth-_LboeZI9.mjs} +2 -2
- package/dist/{use-fluid-auth-vb2QMUi4.mjs.map → use-fluid-auth-_LboeZI9.mjs.map} +1 -1
- package/dist/{use-portal-products-client-CJjec9vb.mjs → use-portal-products-client-DA7Vop2s.mjs} +2 -2
- package/dist/{use-portal-products-client-CJjec9vb.mjs.map → use-portal-products-client-DA7Vop2s.mjs.map} +1 -1
- package/dist/{use-portal-products-client-3JPetPQU.cjs → use-portal-products-client-DAXn2JSf.cjs} +2 -2
- package/dist/{use-portal-products-client-3JPetPQU.cjs.map → use-portal-products-client-DAXn2JSf.cjs.map} +1 -1
- package/package.json +19 -19
- package/dist/FluidProvider-9laphShJ.cjs.map +0 -1
- package/dist/FluidProvider-D8lmeIsK.mjs.map +0 -1
- package/dist/use-account-clients-B6QsWPOL.mjs.map +0 -1
- package/dist/use-account-clients-CrfXjWkZ.cjs.map +0 -1
- /package/dist/{src-zEMEV1KP.mjs → src-6SxtfYk9.mjs} +0 -0
- /package/dist/{src-CzwiFO_J.cjs → src-ClULVolb.cjs} +0 -0
|
@@ -516,6 +516,15 @@ function useAccountApi() {
|
|
|
516
516
|
return api;
|
|
517
517
|
}
|
|
518
518
|
//#endregion
|
|
519
|
+
//#region ../core/src/pay-api-context.ts
|
|
520
|
+
const PayApiContext = (0, react.createContext)(null);
|
|
521
|
+
const PayApiProvider = PayApiContext.Provider;
|
|
522
|
+
function usePayApi() {
|
|
523
|
+
const api = (0, react.useContext)(PayApiContext);
|
|
524
|
+
if (!api) throw new Error("usePayApi must be used within a PayApiProvider");
|
|
525
|
+
return api;
|
|
526
|
+
}
|
|
527
|
+
//#endregion
|
|
519
528
|
//#region ../../platform/api-client-core/src/fetch-client.ts
|
|
520
529
|
/**
|
|
521
530
|
* API Error class compatible with fluid-admin's ApiError
|
|
@@ -2349,6 +2358,210 @@ function createAccountApiAdapter(client) {
|
|
|
2349
2358
|
};
|
|
2350
2359
|
}
|
|
2351
2360
|
//#endregion
|
|
2361
|
+
//#region ../../api-clients/portal-tenant-pay/src/namespaces/portal_tenant_pay.ts
|
|
2362
|
+
/**
|
|
2363
|
+
* List addresses
|
|
2364
|
+
* Returns addresses associated with the member's customer record in this tenant.
|
|
2365
|
+
*
|
|
2366
|
+
* @param client - Fetch client instance
|
|
2367
|
+
* @param [params] - params
|
|
2368
|
+
*/
|
|
2369
|
+
async function addresses_list(client, params) {
|
|
2370
|
+
return client.get(`/api/pay/addresses`, params);
|
|
2371
|
+
}
|
|
2372
|
+
/**
|
|
2373
|
+
* Create an address
|
|
2374
|
+
* Adds a new address to the member's customer record. If an identical address already exists it is returned instead of creating a duplicate.
|
|
2375
|
+
*
|
|
2376
|
+
* @param client - Fetch client instance
|
|
2377
|
+
* @param body - body
|
|
2378
|
+
*/
|
|
2379
|
+
async function addresses_create(client, body) {
|
|
2380
|
+
return client.post(`/api/pay/addresses`, body);
|
|
2381
|
+
}
|
|
2382
|
+
/**
|
|
2383
|
+
* Update an address
|
|
2384
|
+
* Creates a new address with the merged attributes and discards the old one, preserving references from existing orders.
|
|
2385
|
+
*
|
|
2386
|
+
* @param client - Fetch client instance
|
|
2387
|
+
* @param id - id
|
|
2388
|
+
* @param body - body
|
|
2389
|
+
*/
|
|
2390
|
+
async function addresses_update(client, id, body) {
|
|
2391
|
+
return client.patch(`/api/pay/addresses/${id}`, body);
|
|
2392
|
+
}
|
|
2393
|
+
/**
|
|
2394
|
+
* Delete an address
|
|
2395
|
+
* Removes an address from the member's customer record. The default address cannot be removed.
|
|
2396
|
+
*
|
|
2397
|
+
* @param client - Fetch client instance
|
|
2398
|
+
* @param id - id
|
|
2399
|
+
*/
|
|
2400
|
+
async function addresses_destroy(client, id) {
|
|
2401
|
+
return client.delete(`/api/pay/addresses/${id}`);
|
|
2402
|
+
}
|
|
2403
|
+
/**
|
|
2404
|
+
* List payment methods
|
|
2405
|
+
* Returns displayable payment methods on the member's customer record, excluding Apple Pay sources.
|
|
2406
|
+
*
|
|
2407
|
+
* @param client - Fetch client instance
|
|
2408
|
+
* @param [params] - params
|
|
2409
|
+
*/
|
|
2410
|
+
async function payment_methods_list(client, params) {
|
|
2411
|
+
return client.get(`/api/pay/payment_methods`, params);
|
|
2412
|
+
}
|
|
2413
|
+
/**
|
|
2414
|
+
* Create a payment method
|
|
2415
|
+
* Tokenizes and stores a new payment method via the vault provider. Requires a vault token obtained from the vault credentials endpoint.
|
|
2416
|
+
*
|
|
2417
|
+
* @param client - Fetch client instance
|
|
2418
|
+
* @param body - body
|
|
2419
|
+
*/
|
|
2420
|
+
async function payment_methods_create(client, body) {
|
|
2421
|
+
return client.post(`/api/pay/payment_methods`, body);
|
|
2422
|
+
}
|
|
2423
|
+
/**
|
|
2424
|
+
* Update a payment method
|
|
2425
|
+
* Updates a payment method's attributes. Currently supports setting a payment method as the default.
|
|
2426
|
+
*
|
|
2427
|
+
* @param client - Fetch client instance
|
|
2428
|
+
* @param id - id
|
|
2429
|
+
* @param body - body
|
|
2430
|
+
*/
|
|
2431
|
+
async function payment_methods_update(client, id, body) {
|
|
2432
|
+
return client.patch(`/api/pay/payment_methods/${id}`, body);
|
|
2433
|
+
}
|
|
2434
|
+
/**
|
|
2435
|
+
* Delete a payment method
|
|
2436
|
+
* Removes a payment method from the member's customer record. If the removed method was the default, the default is cleared.
|
|
2437
|
+
*
|
|
2438
|
+
* @param client - Fetch client instance
|
|
2439
|
+
* @param id - id
|
|
2440
|
+
*/
|
|
2441
|
+
async function payment_methods_destroy(client, id) {
|
|
2442
|
+
return client.delete(`/api/pay/payment_methods/${id}`);
|
|
2443
|
+
}
|
|
2444
|
+
/**
|
|
2445
|
+
* Get vault credentials
|
|
2446
|
+
* Returns a short-lived vault token and environment identifier for initializing the client-side payment vault SDK.
|
|
2447
|
+
*
|
|
2448
|
+
* @param client - Fetch client instance
|
|
2449
|
+
|
|
2450
|
+
*/
|
|
2451
|
+
async function payment_methods_vault_show(client) {
|
|
2452
|
+
return client.get(`/api/pay/payment_methods/vault`);
|
|
2453
|
+
}
|
|
2454
|
+
/**
|
|
2455
|
+
* List points ledger entries
|
|
2456
|
+
* Returns loyalty points ledger entries for the member's customer record in this tenant, ordered by most recent first.
|
|
2457
|
+
*
|
|
2458
|
+
* @param client - Fetch client instance
|
|
2459
|
+
* @param [params] - params
|
|
2460
|
+
*/
|
|
2461
|
+
async function points_ledgers_list(client, params) {
|
|
2462
|
+
return client.get(`/api/pay/points_ledgers`, params);
|
|
2463
|
+
}
|
|
2464
|
+
//#endregion
|
|
2465
|
+
//#region src/adapters/pay-api-adapter.ts
|
|
2466
|
+
function mapAddress(raw) {
|
|
2467
|
+
return {
|
|
2468
|
+
id: raw.id ?? 0,
|
|
2469
|
+
street1: raw.street1 ?? "",
|
|
2470
|
+
street2: raw.street2 ?? null,
|
|
2471
|
+
city: raw.city ?? "",
|
|
2472
|
+
state: raw.state ?? "",
|
|
2473
|
+
zip: raw.zip ?? "",
|
|
2474
|
+
country: raw.country ?? "",
|
|
2475
|
+
default: raw.default ?? false,
|
|
2476
|
+
created_at: raw.created_at ?? null,
|
|
2477
|
+
updated_at: raw.updated_at ?? null
|
|
2478
|
+
};
|
|
2479
|
+
}
|
|
2480
|
+
function mapPaymentMethod(raw) {
|
|
2481
|
+
return {
|
|
2482
|
+
id: raw.id ?? 0,
|
|
2483
|
+
type: raw.type ?? "card",
|
|
2484
|
+
brand: raw.brand ?? null,
|
|
2485
|
+
last_four: raw.last_four ?? "",
|
|
2486
|
+
exp_month: raw.exp_month ?? null,
|
|
2487
|
+
exp_year: raw.exp_year ?? null,
|
|
2488
|
+
default: raw.default ?? false,
|
|
2489
|
+
created_at: raw.created_at ?? null,
|
|
2490
|
+
updated_at: raw.updated_at ?? null
|
|
2491
|
+
};
|
|
2492
|
+
}
|
|
2493
|
+
function createPortalTenantPayAdapter(client) {
|
|
2494
|
+
return {
|
|
2495
|
+
fetchAddresses: async () => {
|
|
2496
|
+
const response = await addresses_list(client);
|
|
2497
|
+
return {
|
|
2498
|
+
addresses: (response.addresses ?? []).map(mapAddress),
|
|
2499
|
+
meta: {
|
|
2500
|
+
request_id: response.meta?.request_id ?? "",
|
|
2501
|
+
timestamp: response.meta?.timestamp ?? ""
|
|
2502
|
+
}
|
|
2503
|
+
};
|
|
2504
|
+
},
|
|
2505
|
+
createAddress: async (body) => {
|
|
2506
|
+
await addresses_create(client, body);
|
|
2507
|
+
},
|
|
2508
|
+
updateAddress: async (addressId, body) => {
|
|
2509
|
+
await addresses_update(client, addressId, body);
|
|
2510
|
+
},
|
|
2511
|
+
deleteAddress: async (addressId) => {
|
|
2512
|
+
await addresses_destroy(client, addressId);
|
|
2513
|
+
},
|
|
2514
|
+
fetchPaymentMethods: async () => {
|
|
2515
|
+
const response = await payment_methods_list(client);
|
|
2516
|
+
return {
|
|
2517
|
+
payment_methods: (response.payment_methods ?? []).map(mapPaymentMethod),
|
|
2518
|
+
meta: {
|
|
2519
|
+
request_id: response.meta?.request_id ?? "",
|
|
2520
|
+
timestamp: response.meta?.timestamp ?? ""
|
|
2521
|
+
}
|
|
2522
|
+
};
|
|
2523
|
+
},
|
|
2524
|
+
createPaymentMethod: async (body) => {
|
|
2525
|
+
await payment_methods_create(client, body);
|
|
2526
|
+
},
|
|
2527
|
+
updatePaymentMethod: async (paymentMethodId, body) => {
|
|
2528
|
+
await payment_methods_update(client, paymentMethodId, body);
|
|
2529
|
+
},
|
|
2530
|
+
deletePaymentMethod: async (paymentMethodId) => {
|
|
2531
|
+
await payment_methods_destroy(client, paymentMethodId);
|
|
2532
|
+
},
|
|
2533
|
+
fetchVaultCredentials: async () => {
|
|
2534
|
+
const response = await payment_methods_vault_show(client);
|
|
2535
|
+
return {
|
|
2536
|
+
vault: {
|
|
2537
|
+
token: response.vault?.token ?? null,
|
|
2538
|
+
environment: response.vault?.environment ?? "production"
|
|
2539
|
+
},
|
|
2540
|
+
meta: {
|
|
2541
|
+
request_id: response.meta?.request_id ?? "",
|
|
2542
|
+
timestamp: response.meta?.timestamp ?? ""
|
|
2543
|
+
}
|
|
2544
|
+
};
|
|
2545
|
+
},
|
|
2546
|
+
fetchPointsLedgers: async () => {
|
|
2547
|
+
const response = await points_ledgers_list(client);
|
|
2548
|
+
return {
|
|
2549
|
+
points_ledgers: (response.points_ledgers ?? []).map((entry) => ({
|
|
2550
|
+
id: entry.id ?? 0,
|
|
2551
|
+
amount: entry.amount ?? 0,
|
|
2552
|
+
total_balance: entry.total_balance ?? 0,
|
|
2553
|
+
metadata: entry.metadata ?? null,
|
|
2554
|
+
created_at: entry.created_at ?? ""
|
|
2555
|
+
})),
|
|
2556
|
+
meta: {
|
|
2557
|
+
request_id: response.meta?.request_id ?? "",
|
|
2558
|
+
timestamp: response.meta?.timestamp ?? ""
|
|
2559
|
+
}
|
|
2560
|
+
};
|
|
2561
|
+
}
|
|
2562
|
+
};
|
|
2563
|
+
}
|
|
2564
|
+
//#endregion
|
|
2352
2565
|
//#region src/providers/FluidThemeProvider.tsx
|
|
2353
2566
|
/**
|
|
2354
2567
|
* Theme Provider for Fluid SDK
|
|
@@ -2711,6 +2924,7 @@ function FluidProvider({ config, children, queryClient, initialTheme, themeConta
|
|
|
2711
2924
|
}), [config.baseUrl, csrfToken]);
|
|
2712
2925
|
const appDefinitionApi = (0, react.useMemo)(() => createAppDefinitionApiAdapter(portalTenantClient), [portalTenantClient]);
|
|
2713
2926
|
const accountApi = (0, react.useMemo)(() => createAccountApiAdapter(portalTenantClient), [portalTenantClient]);
|
|
2927
|
+
const payApi = (0, react.useMemo)(() => createPortalTenantPayAdapter(portalTenantClient), [portalTenantClient]);
|
|
2714
2928
|
const contextValue = (0, react.useMemo)(() => ({
|
|
2715
2929
|
client,
|
|
2716
2930
|
config: configRef.current
|
|
@@ -2747,13 +2961,16 @@ function FluidProvider({ config, children, queryClient, initialTheme, themeConta
|
|
|
2747
2961
|
value: appDefinitionApi,
|
|
2748
2962
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AccountApiProvider, {
|
|
2749
2963
|
value: accountApi,
|
|
2750
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2964
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PayApiProvider, {
|
|
2965
|
+
value: payApi,
|
|
2966
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProviderStack, {
|
|
2967
|
+
baseUrl: dataSourceBaseUrl,
|
|
2968
|
+
getApiHeaders,
|
|
2969
|
+
variables: effectiveVariables,
|
|
2970
|
+
registry,
|
|
2971
|
+
themeProviderProps,
|
|
2972
|
+
children
|
|
2973
|
+
})
|
|
2757
2974
|
})
|
|
2758
2975
|
})
|
|
2759
2976
|
})
|
|
@@ -3228,6 +3445,12 @@ Object.defineProperty(exports, "useFluidOsApiOptional", {
|
|
|
3228
3445
|
return useFluidOsApiOptional;
|
|
3229
3446
|
}
|
|
3230
3447
|
});
|
|
3448
|
+
Object.defineProperty(exports, "usePayApi", {
|
|
3449
|
+
enumerable: true,
|
|
3450
|
+
get: function() {
|
|
3451
|
+
return usePayApi;
|
|
3452
|
+
}
|
|
3453
|
+
});
|
|
3231
3454
|
Object.defineProperty(exports, "usePortalTenantClient", {
|
|
3232
3455
|
enumerable: true,
|
|
3233
3456
|
get: function() {
|
|
@@ -3247,4 +3470,4 @@ Object.defineProperty(exports, "widgetPropertySchemas", {
|
|
|
3247
3470
|
}
|
|
3248
3471
|
});
|
|
3249
3472
|
|
|
3250
|
-
//# sourceMappingURL=FluidProvider-
|
|
3473
|
+
//# sourceMappingURL=FluidProvider-DzCUwDPA.cjs.map
|