@fluid-app/portal-sdk 0.1.142 → 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.
Files changed (111) hide show
  1. package/dist/{AppDownloadScreen-CO-wctCB.cjs → AppDownloadScreen-CxkoYLT6.cjs} +2 -2
  2. package/dist/{AppDownloadScreen-CO-wctCB.cjs.map → AppDownloadScreen-CxkoYLT6.cjs.map} +1 -1
  3. package/dist/{AppDownloadScreen-nz3fgOVF.cjs → AppDownloadScreen-DXZpoE5A.cjs} +2 -2
  4. package/dist/{AppDownloadScreen-Df1OPjkx.mjs → AppDownloadScreen-ga-5O4jr.mjs} +2 -2
  5. package/dist/{AppDownloadScreen-Df1OPjkx.mjs.map → AppDownloadScreen-ga-5O4jr.mjs.map} +1 -1
  6. package/dist/{ContactsScreen-cWDFP8e-.mjs → ContactsScreen-C-xJcR5X.mjs} +6 -6
  7. package/dist/{ContactsScreen-cWDFP8e-.mjs.map → ContactsScreen-C-xJcR5X.mjs.map} +1 -1
  8. package/dist/{ContactsScreen-gJB99SIY.cjs → ContactsScreen-DYkGu477.cjs} +7 -7
  9. package/dist/{ContactsScreen-BPeQemgG.cjs → ContactsScreen-RQ1IENFl.cjs} +6 -6
  10. package/dist/{ContactsScreen-BPeQemgG.cjs.map → ContactsScreen-RQ1IENFl.cjs.map} +1 -1
  11. package/dist/{FluidProvider-BIoYteOA.mjs → FluidProvider-Bs9eWShT.mjs} +279 -9
  12. package/dist/FluidProvider-Bs9eWShT.mjs.map +1 -0
  13. package/dist/{FluidProvider-DAe8xcAD.cjs → FluidProvider-DzCUwDPA.cjs} +290 -20
  14. package/dist/FluidProvider-DzCUwDPA.cjs.map +1 -0
  15. package/dist/{MessagingScreen-BsABB4tn.cjs → MessagingScreen-BmAICPkY.cjs} +4 -4
  16. package/dist/{MessagingScreen-BgY-m0Pm.cjs → MessagingScreen-D7hAjWaG.cjs} +5 -5
  17. package/dist/{MessagingScreen-BgY-m0Pm.cjs.map → MessagingScreen-D7hAjWaG.cjs.map} +1 -1
  18. package/dist/{MessagingScreen-DKXOCrBj.mjs → MessagingScreen-DOcgxDbR.mjs} +4 -4
  19. package/dist/{MessagingScreen-DKXOCrBj.mjs.map → MessagingScreen-DOcgxDbR.mjs.map} +1 -1
  20. package/dist/{MySiteScreen-DVjRy-nI.cjs → MySiteScreen-BMFJLAwJ.cjs} +2 -2
  21. package/dist/{MySiteScreen-DVjRy-nI.cjs.map → MySiteScreen-BMFJLAwJ.cjs.map} +1 -1
  22. package/dist/{MySiteScreen-D8lFT21T.mjs → MySiteScreen-BwCQLYBT.mjs} +2 -2
  23. package/dist/{MySiteScreen-D8lFT21T.mjs.map → MySiteScreen-BwCQLYBT.mjs.map} +1 -1
  24. package/dist/{MySiteScreen-BTF8MZCU.cjs → MySiteScreen-C_-EPLsj.cjs} +2 -2
  25. package/dist/{OrdersScreen-CbCus7pT.cjs → OrdersScreen-DHoIUinY.cjs} +3 -3
  26. package/dist/{OrdersScreen-CbCus7pT.cjs.map → OrdersScreen-DHoIUinY.cjs.map} +1 -1
  27. package/dist/{OrdersScreen-BB_n4hgl.cjs → OrdersScreen-DgBe0kl9.cjs} +3 -3
  28. package/dist/{OrdersScreen-BHtq-tvn.mjs → OrdersScreen-ihhKswAb.mjs} +3 -3
  29. package/dist/{OrdersScreen-BHtq-tvn.mjs.map → OrdersScreen-ihhKswAb.mjs.map} +1 -1
  30. package/dist/{ProductsScreen-CU8nGFN5.mjs → ProductsScreen-BbgYlCfQ.mjs} +6 -6
  31. package/dist/{ProductsScreen-CU8nGFN5.mjs.map → ProductsScreen-BbgYlCfQ.mjs.map} +1 -1
  32. package/dist/{ProductsScreen-CP29k8Z3.cjs → ProductsScreen-BulxEN71.cjs} +7 -7
  33. package/dist/{ProductsScreen-DSgwSnVj.mjs → ProductsScreen-OPY76KpG.mjs} +6 -6
  34. package/dist/{ProductsScreen-CuMgdka9.cjs → ProductsScreen-snrXLhuy.cjs} +6 -6
  35. package/dist/{ProductsScreen-CuMgdka9.cjs.map → ProductsScreen-snrXLhuy.cjs.map} +1 -1
  36. package/dist/{ProfileScreen-CjrhOuY3.cjs → ProfileScreen-CES4uRpE.cjs} +2 -2
  37. package/dist/{ProfileScreen-CDZ632ue.cjs → ProfileScreen-CPCkXse4.cjs} +5 -6
  38. package/dist/{ProfileScreen-CDZ632ue.cjs.map → ProfileScreen-CPCkXse4.cjs.map} +1 -1
  39. package/dist/{ProfileScreen-BajH0_kR.mjs → ProfileScreen-doxUb6Ud.mjs} +3 -4
  40. package/dist/{ProfileScreen-BajH0_kR.mjs.map → ProfileScreen-doxUb6Ud.mjs.map} +1 -1
  41. package/dist/{SearchSort-CyeeUmwC.cjs → SearchSort-DOLoubGE.cjs} +1 -1
  42. package/dist/{SearchSort-CyeeUmwC.cjs.map → SearchSort-DOLoubGE.cjs.map} +1 -1
  43. package/dist/{SearchSort-BXklP8Pq.mjs → SearchSort-LZm-VfF7.mjs} +1 -1
  44. package/dist/{SearchSort-BXklP8Pq.mjs.map → SearchSort-LZm-VfF7.mjs.map} +1 -1
  45. package/dist/{ShareablesScreen-acj-gCLe.cjs → ShareablesScreen-B6-BcjEt.cjs} +7 -7
  46. package/dist/{ShareablesScreen-F3ockfKE.mjs → ShareablesScreen-CJk0udFG.mjs} +7 -7
  47. package/dist/{ShareablesScreen-F3ockfKE.mjs.map → ShareablesScreen-CJk0udFG.mjs.map} +1 -1
  48. package/dist/{ShareablesScreen-ITLkfDHV.cjs → ShareablesScreen-DaQAxGCr.cjs} +7 -7
  49. package/dist/{ShareablesScreen-ITLkfDHV.cjs.map → ShareablesScreen-DaQAxGCr.cjs.map} +1 -1
  50. package/dist/{ShareablesScreen-B63fbgRJ.mjs → ShareablesScreen-yC7UrhhU.mjs} +6 -6
  51. package/dist/{ShopScreen-DdIlnLcB.mjs → ShopScreen-B3kyH-AP.mjs} +5 -5
  52. package/dist/{ShopScreen-DdIlnLcB.mjs.map → ShopScreen-B3kyH-AP.mjs.map} +1 -1
  53. package/dist/{ShopScreen-3Z-9TKeI.cjs → ShopScreen-D6JAjTai.cjs} +5 -5
  54. package/dist/{ShopScreen-3Z-9TKeI.cjs.map → ShopScreen-D6JAjTai.cjs.map} +1 -1
  55. package/dist/{ShopScreen-Bit0Fdgr.cjs → ShopScreen-DUpCS4va.cjs} +3 -3
  56. package/dist/{SubscriptionsScreen-DV5RUV66.cjs → SubscriptionsScreen-CEkKX-O9.cjs} +5 -5
  57. package/dist/{SubscriptionsScreen-DV5RUV66.cjs.map → SubscriptionsScreen-CEkKX-O9.cjs.map} +1 -1
  58. package/dist/{SubscriptionsScreen-B2-iZojm.mjs → SubscriptionsScreen-DlRbMhFz.mjs} +5 -5
  59. package/dist/{SubscriptionsScreen-B2-iZojm.mjs.map → SubscriptionsScreen-DlRbMhFz.mjs.map} +1 -1
  60. package/dist/{SubscriptionsScreen-01RuJl73.cjs → SubscriptionsScreen-jpRkUvPY.cjs} +5 -5
  61. package/dist/{dist-Cl4FsM3V.mjs → dist-B8padP0r.mjs} +2 -2
  62. package/dist/{dist-Cl4FsM3V.mjs.map → dist-B8padP0r.mjs.map} +1 -1
  63. package/dist/{dist-CbeLS2R5.cjs → dist-BoyKnTdv.cjs} +2 -2
  64. package/dist/{dist-CbeLS2R5.cjs.map → dist-BoyKnTdv.cjs.map} +1 -1
  65. package/dist/{dist-BbS_7TvS.cjs → dist-DRVtlgQ1.cjs} +1 -1
  66. package/dist/{dist-BbS_7TvS.cjs.map → dist-DRVtlgQ1.cjs.map} +1 -1
  67. package/dist/{dist-CMGXkSgZ.mjs → dist-NMbUD0qE.mjs} +1 -1
  68. package/dist/{dist-CMGXkSgZ.mjs.map → dist-NMbUD0qE.mjs.map} +1 -1
  69. package/dist/{es-BSkb3AZk.cjs → es-DlWO6buB.cjs} +1 -1
  70. package/dist/{es-BSkb3AZk.cjs.map → es-DlWO6buB.cjs.map} +1 -1
  71. package/dist/index.cjs +41 -41
  72. package/dist/index.d.cts.map +1 -1
  73. package/dist/index.d.mts.map +1 -1
  74. package/dist/index.mjs +40 -40
  75. package/dist/{order-status-badge-DsbuULAc.cjs → order-status-badge-BqoNJ8XK.cjs} +1 -1
  76. package/dist/{order-status-badge-DsbuULAc.cjs.map → order-status-badge-BqoNJ8XK.cjs.map} +1 -1
  77. package/dist/{order-status-badge-B-iGmxDO.mjs → order-status-badge-CkvYyjT7.mjs} +1 -1
  78. package/dist/{order-status-badge-B-iGmxDO.mjs.map → order-status-badge-CkvYyjT7.mjs.map} +1 -1
  79. package/dist/{portal-tenant-product-media-adapter-y_yCswfv.mjs → portal-tenant-product-media-adapter-BHtx3DdM.mjs} +4 -4
  80. package/dist/{portal-tenant-product-media-adapter-y_yCswfv.mjs.map → portal-tenant-product-media-adapter-BHtx3DdM.mjs.map} +1 -1
  81. package/dist/{portal-tenant-product-media-adapter-DmH2iJvp.cjs → portal-tenant-product-media-adapter-qXW0vGG8.cjs} +5 -5
  82. package/dist/{portal-tenant-product-media-adapter-DmH2iJvp.cjs.map → portal-tenant-product-media-adapter-qXW0vGG8.cjs.map} +1 -1
  83. package/dist/use-account-clients-GUakuhX-.cjs +212 -0
  84. package/dist/use-account-clients-GUakuhX-.cjs.map +1 -0
  85. package/dist/use-account-clients-d3FMT7rH.mjs +194 -0
  86. package/dist/use-account-clients-d3FMT7rH.mjs.map +1 -0
  87. package/dist/{use-current-user-DAxsYRk-.mjs → use-current-user-Cjd0lFyc.mjs} +3 -3
  88. package/dist/{use-current-user-DAxsYRk-.mjs.map → use-current-user-Cjd0lFyc.mjs.map} +1 -1
  89. package/dist/{use-current-user-5Kr_1nZZ.cjs → use-current-user-idj1wuKD.cjs} +3 -3
  90. package/dist/{use-current-user-5Kr_1nZZ.cjs.map → use-current-user-idj1wuKD.cjs.map} +1 -1
  91. package/dist/{use-fluid-api-BJ-PZ0Zx.mjs → use-fluid-api-DdMmBE5K.mjs} +2 -2
  92. package/dist/{use-fluid-api-BJ-PZ0Zx.mjs.map → use-fluid-api-DdMmBE5K.mjs.map} +1 -1
  93. package/dist/{use-fluid-api-uEqwymly.cjs → use-fluid-api-DnDH2bby.cjs} +2 -2
  94. package/dist/{use-fluid-api-uEqwymly.cjs.map → use-fluid-api-DnDH2bby.cjs.map} +1 -1
  95. package/dist/{use-fluid-auth-DXDtI7Ep.cjs → use-fluid-auth-CcxpIYkI.cjs} +2 -2
  96. package/dist/{use-fluid-auth-DXDtI7Ep.cjs.map → use-fluid-auth-CcxpIYkI.cjs.map} +1 -1
  97. package/dist/{use-fluid-auth-DrtkGGwT.mjs → use-fluid-auth-_LboeZI9.mjs} +2 -2
  98. package/dist/{use-fluid-auth-DrtkGGwT.mjs.map → use-fluid-auth-_LboeZI9.mjs.map} +1 -1
  99. package/dist/{use-portal-products-client-zvmWMf8p.mjs → use-portal-products-client-DA7Vop2s.mjs} +2 -2
  100. package/dist/{use-portal-products-client-zvmWMf8p.mjs.map → use-portal-products-client-DA7Vop2s.mjs.map} +1 -1
  101. package/dist/{use-portal-products-client-CXZj-fKI.cjs → use-portal-products-client-DAXn2JSf.cjs} +2 -2
  102. package/dist/{use-portal-products-client-CXZj-fKI.cjs.map → use-portal-products-client-DAXn2JSf.cjs.map} +1 -1
  103. package/package.json +13 -13
  104. package/dist/FluidProvider-BIoYteOA.mjs.map +0 -1
  105. package/dist/FluidProvider-DAe8xcAD.cjs.map +0 -1
  106. package/dist/use-account-clients-CNDyBxm7.mjs +0 -446
  107. package/dist/use-account-clients-CNDyBxm7.mjs.map +0 -1
  108. package/dist/use-account-clients-nmrVvm98.cjs +0 -476
  109. package/dist/use-account-clients-nmrVvm98.cjs.map +0 -1
  110. /package/dist/{src-zEMEV1KP.mjs → src-6SxtfYk9.mjs} +0 -0
  111. /package/dist/{src-CzwiFO_J.cjs → src-ClULVolb.cjs} +0 -0
@@ -507,6 +507,24 @@ function useAppDefinitionApi() {
507
507
  return api;
508
508
  }
509
509
  //#endregion
510
+ //#region ../core/src/account-api-context.ts
511
+ const AccountApiContext = (0, react.createContext)(null);
512
+ const AccountApiProvider = AccountApiContext.Provider;
513
+ function useAccountApi() {
514
+ const api = (0, react.useContext)(AccountApiContext);
515
+ if (!api) throw new Error("useAccountApi must be used within an AccountApiProvider");
516
+ return api;
517
+ }
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
510
528
  //#region ../../platform/api-client-core/src/fetch-client.ts
511
529
  /**
512
530
  * API Error class compatible with fluid-admin's ApiError
@@ -2300,6 +2318,250 @@ function createAppDefinitionApiAdapter(client) {
2300
2318
  } };
2301
2319
  }
2302
2320
  //#endregion
2321
+ //#region src/adapters/account-api-adapter.ts
2322
+ function mapAccount(raw) {
2323
+ return {
2324
+ id: raw.id ?? 0,
2325
+ member_type: raw.member_type ?? "rep",
2326
+ first_name: raw.first_name ?? "",
2327
+ last_name: raw.last_name ?? "",
2328
+ email: raw.email ?? "",
2329
+ phone: raw.phone ?? null,
2330
+ bio: raw.bio ?? null,
2331
+ avatar_url: raw.avatar_url ?? null,
2332
+ slug: raw.slug ?? "",
2333
+ social_links: raw.social_links ?? null
2334
+ };
2335
+ }
2336
+ function createAccountApiAdapter(client) {
2337
+ return {
2338
+ fetchAccount: async () => {
2339
+ const response = await account_show(client);
2340
+ return {
2341
+ account: mapAccount(response.account ?? {}),
2342
+ meta: {
2343
+ request_id: response.meta?.request_id ?? "",
2344
+ timestamp: response.meta?.timestamp ?? ""
2345
+ }
2346
+ };
2347
+ },
2348
+ updateAccount: async (body) => {
2349
+ const response = await account_update(client, body);
2350
+ return {
2351
+ account: mapAccount(response.account ?? {}),
2352
+ meta: {
2353
+ request_id: response.meta?.request_id ?? "",
2354
+ timestamp: response.meta?.timestamp ?? ""
2355
+ }
2356
+ };
2357
+ }
2358
+ };
2359
+ }
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
2303
2565
  //#region src/providers/FluidThemeProvider.tsx
2304
2566
  /**
2305
2567
  * Theme Provider for Fluid SDK
@@ -2661,6 +2923,8 @@ function FluidProvider({ config, children, queryClient, initialTheme, themeConta
2661
2923
  defaultHeaders: { ...csrfToken ? { "X-CSRF-Token": csrfToken } : {} }
2662
2924
  }), [config.baseUrl, csrfToken]);
2663
2925
  const appDefinitionApi = (0, react.useMemo)(() => createAppDefinitionApiAdapter(portalTenantClient), [portalTenantClient]);
2926
+ const accountApi = (0, react.useMemo)(() => createAccountApiAdapter(portalTenantClient), [portalTenantClient]);
2927
+ const payApi = (0, react.useMemo)(() => createPortalTenantPayAdapter(portalTenantClient), [portalTenantClient]);
2664
2928
  const contextValue = (0, react.useMemo)(() => ({
2665
2929
  client,
2666
2930
  config: configRef.current
@@ -2695,13 +2959,19 @@ function FluidProvider({ config, children, queryClient, initialTheme, themeConta
2695
2959
  value: fluidOsApi,
2696
2960
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AppDefinitionApiProvider, {
2697
2961
  value: appDefinitionApi,
2698
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProviderStack, {
2699
- baseUrl: dataSourceBaseUrl,
2700
- getApiHeaders,
2701
- variables: effectiveVariables,
2702
- registry,
2703
- themeProviderProps,
2704
- children
2962
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AccountApiProvider, {
2963
+ value: accountApi,
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
+ })
2974
+ })
2705
2975
  })
2706
2976
  })
2707
2977
  })
@@ -2863,18 +3133,6 @@ Object.defineProperty(exports, "USER_TYPES", {
2863
3133
  return USER_TYPES;
2864
3134
  }
2865
3135
  });
2866
- Object.defineProperty(exports, "account_show", {
2867
- enumerable: true,
2868
- get: function() {
2869
- return account_show;
2870
- }
2871
- });
2872
- Object.defineProperty(exports, "account_update", {
2873
- enumerable: true,
2874
- get: function() {
2875
- return account_update;
2876
- }
2877
- });
2878
3136
  Object.defineProperty(exports, "applyTheme", {
2879
3137
  enumerable: true,
2880
3138
  get: function() {
@@ -3157,6 +3415,12 @@ Object.defineProperty(exports, "transformThemes", {
3157
3415
  return transformThemes;
3158
3416
  }
3159
3417
  });
3418
+ Object.defineProperty(exports, "useAccountApi", {
3419
+ enumerable: true,
3420
+ get: function() {
3421
+ return useAccountApi;
3422
+ }
3423
+ });
3160
3424
  Object.defineProperty(exports, "useAppDefinitionApi", {
3161
3425
  enumerable: true,
3162
3426
  get: function() {
@@ -3181,6 +3445,12 @@ Object.defineProperty(exports, "useFluidOsApiOptional", {
3181
3445
  return useFluidOsApiOptional;
3182
3446
  }
3183
3447
  });
3448
+ Object.defineProperty(exports, "usePayApi", {
3449
+ enumerable: true,
3450
+ get: function() {
3451
+ return usePayApi;
3452
+ }
3453
+ });
3184
3454
  Object.defineProperty(exports, "usePortalTenantClient", {
3185
3455
  enumerable: true,
3186
3456
  get: function() {
@@ -3200,4 +3470,4 @@ Object.defineProperty(exports, "widgetPropertySchemas", {
3200
3470
  }
3201
3471
  });
3202
3472
 
3203
- //# sourceMappingURL=FluidProvider-DAe8xcAD.cjs.map
3473
+ //# sourceMappingURL=FluidProvider-DzCUwDPA.cjs.map