@temboplus/afloat 0.1.77-beta.2 → 0.1.77-beta.21

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 (42) hide show
  1. package/dist/index.cjs.js +1 -1
  2. package/dist/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +1 -1
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/lib/api/base-repository.d.ts +3 -1
  6. package/dist/lib/query/query.builder.d.ts +5 -1
  7. package/dist/modules/auth/auth.contract.d.ts +2 -2
  8. package/dist/modules/auth/company-membership.model.d.ts +122 -9
  9. package/dist/modules/auth/index.d.ts +0 -1
  10. package/dist/modules/auth/user.model.d.ts +238 -15
  11. package/dist/modules/contact/contact-info.model.d.ts +183 -533
  12. package/dist/modules/contact/contact.api-contract.d.ts +8 -8
  13. package/dist/modules/contact/contact.dtos.d.ts +2 -2
  14. package/dist/modules/contact/contact.model.d.ts +309 -32
  15. package/dist/modules/login/login.api-contract.d.ts +2 -2
  16. package/dist/modules/login/login.dtos.d.ts +4 -4
  17. package/dist/modules/login/login.model.d.ts +54 -24
  18. package/dist/modules/payout/payout.api-contract.d.ts +37 -37
  19. package/dist/modules/payout/payout.dtos.d.ts +47 -39
  20. package/dist/modules/payout/payout.model.d.ts +242 -2
  21. package/dist/modules/payout/payout.query.d.ts +11 -3
  22. package/dist/modules/payout/payout.repository.d.ts +48 -25
  23. package/dist/modules/profile/profile.model.d.ts +65 -30
  24. package/dist/modules/team-member/role.model.d.ts +49 -1
  25. package/dist/modules/team-member/team-member.contract.d.ts +44 -44
  26. package/dist/modules/team-member/team-member.dtos.d.ts +14 -14
  27. package/dist/modules/team-member/team-member.model.d.ts +106 -6
  28. package/dist/modules/wallet/index.d.ts +0 -1
  29. package/dist/modules/wallet/narration.model.d.ts +34 -38
  30. package/dist/modules/wallet/statement-entry.model.d.ts +172 -73
  31. package/dist/modules/wallet/wallet.contract.d.ts +6 -6
  32. package/dist/modules/wallet/wallet.dtos.d.ts +12 -12
  33. package/dist/modules/wallet/wallet.model.d.ts +56 -19
  34. package/dist/modules/wallet/wallet.query.d.ts +95 -0
  35. package/dist/modules/wallet/wallet.repository.d.ts +45 -13
  36. package/package.json +2 -2
  37. package/dist/modules/auth/auth.manager.d.ts +0 -249
  38. package/dist/modules/auth/auth.store.d.ts +0 -139
  39. package/dist/modules/auth/storage/client-store.d.ts +0 -29
  40. package/dist/modules/auth/storage/client-token-handler.d.ts +0 -31
  41. package/dist/modules/auth/storage/types.d.ts +0 -41
  42. package/dist/modules/wallet/wallet-manager.session.d.ts +0 -143
@@ -1,143 +0,0 @@
1
- import { Country, type CountryCode } from "@temboplus/frontend-core";
2
- import { Wallet } from "./wallet.model.js";
3
- import { User } from "../auth/user.model.js";
4
- /**
5
- * Defines the shape of the persisted wallet session state.
6
- * IMPORTANT: Properties like selectedWalletId/selectedCountryCode are guaranteed
7
- * non-nullable and valid ONLY when isInitialized is true.
8
- */
9
- interface WalletSession {
10
- userId: string;
11
- wallets: Wallet[];
12
- selectedWalletId: string;
13
- selectedCountryCode: CountryCode;
14
- lastSynced: Date | string;
15
- isInitialized: boolean;
16
- }
17
- /**
18
- * Defines the complete state shape including actions and internal getters.
19
- */
20
- interface WalletState extends WalletSession {
21
- setWallets: (wallets: Wallet[]) => void;
22
- setSelectedWallet: (wallet: Wallet) => void;
23
- setSelectedCountry: (countryCode: CountryCode) => void;
24
- reset: () => void;
25
- _getWalletsByCountry: (countryCode: CountryCode) => Wallet[];
26
- _getSelectedWallet: () => Wallet;
27
- }
28
- export declare const walletsStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<WalletState>, "persist"> & {
29
- persist: {
30
- setOptions: (options: Partial<import("zustand/middleware").PersistOptions<WalletState, unknown>>) => void;
31
- clearStorage: () => void;
32
- rehydrate: () => Promise<void> | void;
33
- hasHydrated: () => boolean;
34
- onHydrate: (fn: (state: WalletState) => void) => () => void;
35
- onFinishHydration: (fn: (state: WalletState) => void) => () => void;
36
- getOptions: () => Partial<import("zustand/middleware").PersistOptions<WalletState, unknown>>;
37
- };
38
- }>;
39
- /**
40
- * WalletSessionManager handles wallet-related operations and state management coordination.
41
- * It uses a Zustand store (`useWalletStore`) for state and interacts with WalletRepo.
42
- *
43
- * IMPORTANT: This manager enforces the invariant that an initialized user session
44
- * always has at least one wallet and a valid selection. Methods that return selected
45
- * data (`getSelectedWallet`, `getSelectedCountry`, etc.) will THROW AN ERROR if called
46
- * before the session is initialized via the `initialize()` method.
47
- */
48
- export declare class WalletSessionManager {
49
- private repo;
50
- private static _instance;
51
- /**
52
- * @private
53
- */
54
- private constructor();
55
- /**
56
- * Gets the singleton instance of WalletSessionManager.
57
- * @returns {WalletSessionManager} The singleton instance.
58
- */
59
- static get instance(): WalletSessionManager;
60
- /**
61
- * Checks if the wallet session is initialized.
62
- * @returns {boolean} True if initialized, false otherwise.
63
- */
64
- isInitialized(): boolean;
65
- /**
66
- * Initializes the wallet manager for the current user.
67
- * Fetches wallets if the store isn't already initialized.
68
- * Throws an error if the user is not authenticated or if the user is found to have no wallets.
69
- * @async
70
- * @returns {Promise<void>} Resolves when initialization is complete.
71
- * @throws {Error} If user not authenticated or user has no wallets.
72
- */
73
- initialize(user: User): Promise<void>;
74
- /**
75
- * Fetches the latest wallet data from the server and updates the store.
76
- * Throws an error if the user has no wallets or if the fetch fails.
77
- * Ensures the store is updated and marked as initialized.
78
- * @async
79
- * @returns {Promise<void>} Resolves when refresh is complete.
80
- * @throws {Error} If fetch fails or user has no wallets.
81
- */
82
- refreshWallets(): Promise<void>;
83
- /**
84
- * Gets all available wallets. Guaranteed non-empty after successful initialization.
85
- * @returns {Wallet[]} Non-empty array of Wallet instances.
86
- * @throws {Error} If called before initialization is complete.
87
- */
88
- getWallets(): Wallet[];
89
- /**
90
- * Gets unique available country codes based on current wallets.
91
- * @returns {CountryCode[]} Array of CountryCodes. Guaranteed non-empty after initialization.
92
- * @throws {Error} If called before initialization is complete.
93
- */
94
- getCountries(): CountryCode[];
95
- /**
96
- * Gets wallets for a specific country.
97
- * @param {CountryCode} countryCode The country code to filter by.
98
- * @returns {Wallet[]} Array of Wallet instances for the country. May be empty if no wallets match the code, but the overall list isn't empty.
99
- * @throws {Error} If called before initialization is complete.
100
- */
101
- getWalletsByCountry(countryCode: CountryCode): Wallet[];
102
- /**
103
- * Gets the currently selected wallet instance.
104
- * @returns {Wallet} The selected Wallet instance (guaranteed non-nullable).
105
- * @throws {Error} If called before initialization is complete or if state is inconsistent.
106
- */
107
- getSelectedWallet(): Wallet;
108
- /**
109
- * Gets the currently selected country code.
110
- * @returns {CountryCode} The selected CountryCode (guaranteed non-nullable).
111
- * @throws {Error} If called before initialization is complete.
112
- */
113
- getSelectedCountryCode(): CountryCode;
114
- /**
115
- * Gets the currently selected Country object.
116
- * @returns {Country} The selected Country object (guaranteed non-nullable).
117
- * @throws {Error} If called before initialization or if Country.fromCode fails for the selected code.
118
- */
119
- getSelectedCountry(): Country;
120
- /**
121
- * Changes the selected wallet in the store.
122
- * Throws error if the provided walletId is not found in the current list.
123
- * @param {string} walletId - The ID of the wallet to select.
124
- * @returns {void}
125
- * @throws {Error} If wallet with given ID is not found or if called before initialization.
126
- */
127
- changeWallet(walletId: string): void;
128
- /**
129
- * Changes the selected country in the store.
130
- * Automatically selects the first available wallet for that country.
131
- * Throws error if no wallets exist for the given countryCode or if called before initialization.
132
- * @param {CountryCode} countryCode - The country code to select.
133
- * @returns {void}
134
- * @throws {Error} If no wallets found for the country code or if called before initialization.
135
- */
136
- changeCountry(countryCode: CountryCode): void;
137
- /**
138
- * Resets the wallet store to initial (uninitialized) state.
139
- * Typically used during user logout.
140
- */
141
- reset(): void;
142
- }
143
- export {};