@temboplus/afloat 0.1.77-beta.9 → 0.1.79
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/LICENSE +7 -0
- package/README.md +42 -246
- package/esm/mod.d.ts +8 -0
- package/esm/mod.d.ts.map +1 -0
- package/esm/mod.js +7 -0
- package/esm/package.json +3 -0
- package/{dist/lib/error/error.api.d.ts → esm/src/errors/api_error.d.ts} +1 -0
- package/esm/src/errors/api_error.d.ts.map +1 -0
- package/esm/src/errors/api_error.js +90 -0
- package/esm/src/errors/index.d.ts +3 -0
- package/esm/src/errors/index.d.ts.map +1 -0
- package/esm/src/errors/index.js +2 -0
- package/{dist/lib/error/error.permission.d.ts → esm/src/errors/permission_error.d.ts} +2 -1
- package/esm/src/errors/permission_error.d.ts.map +1 -0
- package/esm/src/errors/permission_error.js +70 -0
- package/{dist/modules/team-member/team-member.contract.d.ts → esm/src/features/admin/contract.d.ts} +158 -233
- package/esm/src/features/admin/contract.d.ts.map +1 -0
- package/esm/src/features/admin/contract.js +210 -0
- package/esm/src/features/admin/index.d.ts +4 -0
- package/esm/src/features/admin/index.d.ts.map +1 -0
- package/esm/src/features/admin/index.js +3 -0
- package/esm/src/features/admin/repository.d.ts +114 -0
- package/esm/src/features/admin/repository.d.ts.map +1 -0
- package/esm/src/features/admin/repository.js +248 -0
- package/esm/src/features/admin/schemas.d.ts +146 -0
- package/esm/src/features/admin/schemas.d.ts.map +1 -0
- package/esm/src/features/admin/schemas.js +206 -0
- package/esm/src/features/auth/access/contract.d.ts +14 -0
- package/esm/src/features/auth/access/contract.d.ts.map +1 -0
- package/esm/src/features/auth/access/contract.js +14 -0
- package/esm/src/features/auth/access/repository.d.ts +11 -0
- package/esm/src/features/auth/access/repository.d.ts.map +1 -0
- package/esm/src/features/auth/access/repository.js +25 -0
- package/{dist/modules/auth/auth.contract.d.ts → esm/src/features/auth/contract.d.ts} +19 -16
- package/esm/src/features/auth/contract.d.ts.map +1 -0
- package/esm/src/features/auth/contract.js +43 -0
- package/esm/src/features/auth/identity/contract.d.ts +23 -0
- package/esm/src/features/auth/identity/contract.d.ts.map +1 -0
- package/esm/src/features/auth/identity/contract.js +17 -0
- package/esm/src/features/auth/identity/repository.d.ts +22 -0
- package/esm/src/features/auth/identity/repository.d.ts.map +1 -0
- package/esm/src/features/auth/identity/repository.js +30 -0
- package/esm/src/features/auth/index.d.ts +6 -0
- package/esm/src/features/auth/index.d.ts.map +1 -0
- package/esm/src/features/auth/index.js +5 -0
- package/esm/src/features/auth/manager.d.ts +105 -0
- package/esm/src/features/auth/manager.d.ts.map +1 -0
- package/esm/src/features/auth/manager.js +181 -0
- package/{dist/modules/profile/profile.api-contract.d.ts → esm/src/features/auth/profile/contract.d.ts} +6 -8
- package/esm/src/features/auth/profile/contract.d.ts.map +1 -0
- package/esm/src/features/auth/profile/contract.js +14 -0
- package/esm/src/features/auth/profile/repository.d.ts +11 -0
- package/esm/src/features/auth/profile/repository.d.ts.map +1 -0
- package/esm/src/features/auth/profile/repository.js +25 -0
- package/esm/src/features/auth/repository.d.ts +30 -0
- package/esm/src/features/auth/repository.d.ts.map +1 -0
- package/esm/src/features/auth/repository.js +69 -0
- package/{dist/modules/auth/storage/client-store.d.ts → esm/src/features/auth/storage/client_store.d.ts} +2 -1
- package/esm/src/features/auth/storage/client_store.d.ts.map +1 -0
- package/esm/src/features/auth/storage/client_store.js +46 -0
- package/{dist/modules/auth/storage/client-token-handler.d.ts → esm/src/features/auth/storage/client_token_handler.d.ts} +1 -0
- package/esm/src/features/auth/storage/client_token_handler.d.ts.map +1 -0
- package/esm/src/features/auth/storage/client_token_handler.js +36 -0
- package/esm/src/features/auth/storage/server_store.d.ts +24 -0
- package/esm/src/features/auth/storage/server_store.d.ts.map +1 -0
- package/esm/src/features/auth/storage/server_store.js +34 -0
- package/esm/src/features/auth/storage/server_token_handler.d.ts +36 -0
- package/esm/src/features/auth/storage/server_token_handler.d.ts.map +1 -0
- package/esm/src/features/auth/storage/server_token_handler.js +115 -0
- package/{dist/modules → esm/src/features}/auth/storage/types.d.ts +2 -1
- package/esm/src/features/auth/storage/types.d.ts.map +1 -0
- package/esm/src/features/auth/storage/types.js +1 -0
- package/{dist/modules/contact/contact.api-contract.d.ts → esm/src/features/contact/contract.d.ts} +55 -88
- package/esm/src/features/contact/contract.d.ts.map +1 -0
- package/esm/src/features/contact/contract.js +49 -0
- package/esm/src/features/contact/index.d.ts +2 -0
- package/esm/src/features/contact/index.d.ts.map +1 -0
- package/esm/src/features/contact/index.js +1 -0
- package/esm/src/features/contact/repository.d.ts +58 -0
- package/esm/src/features/contact/repository.d.ts.map +1 -0
- package/esm/src/features/contact/repository.js +108 -0
- package/{dist/modules/payout/payout.api-contract.d.ts → esm/src/features/payout/contract.d.ts} +197 -340
- package/esm/src/features/payout/contract.d.ts.map +1 -0
- package/esm/src/features/payout/contract.js +75 -0
- package/esm/src/features/payout/index.d.ts +2 -0
- package/esm/src/features/payout/index.d.ts.map +1 -0
- package/esm/src/features/payout/index.js +1 -0
- package/esm/src/features/payout/repository.d.ts +67 -0
- package/esm/src/features/payout/repository.d.ts.map +1 -0
- package/esm/src/features/payout/repository.js +163 -0
- package/{dist/modules/wallet/wallet.contract.d.ts → esm/src/features/wallet/contract.d.ts} +11 -13
- package/esm/src/features/wallet/contract.d.ts.map +1 -0
- package/esm/src/features/wallet/contract.js +38 -0
- package/esm/src/features/wallet/index.d.ts +2 -0
- package/esm/src/features/wallet/index.d.ts.map +1 -0
- package/esm/src/features/wallet/index.js +1 -0
- package/esm/src/features/wallet/repository.d.ts +57 -0
- package/esm/src/features/wallet/repository.d.ts.map +1 -0
- package/esm/src/features/wallet/repository.js +93 -0
- package/esm/src/models/contact/derivatives/contact.d.ts +172 -0
- package/esm/src/models/contact/derivatives/contact.d.ts.map +1 -0
- package/esm/src/models/contact/derivatives/contact.js +266 -0
- package/esm/src/models/contact/derivatives/contact_info.d.ts +188 -0
- package/esm/src/models/contact/derivatives/contact_info.d.ts.map +1 -0
- package/esm/src/models/contact/derivatives/contact_info.js +255 -0
- package/esm/src/models/contact/index.d.ts +5 -0
- package/esm/src/models/contact/index.d.ts.map +1 -0
- package/esm/src/models/contact/index.js +4 -0
- package/esm/src/models/contact/schemas.d.ts +66 -0
- package/esm/src/models/contact/schemas.d.ts.map +1 -0
- package/esm/src/models/contact/schemas.js +64 -0
- package/esm/src/models/contact/validation.d.ts +37 -0
- package/esm/src/models/contact/validation.d.ts.map +1 -0
- package/esm/src/models/contact/validation.js +146 -0
- package/esm/src/models/index.d.ts +7 -0
- package/esm/src/models/index.d.ts.map +1 -0
- package/esm/src/models/index.js +6 -0
- package/esm/src/models/payout/api.d.ts +29 -0
- package/esm/src/models/payout/api.d.ts.map +1 -0
- package/esm/src/models/payout/api.js +1 -0
- package/esm/src/models/payout/channel.d.ts +58 -0
- package/esm/src/models/payout/channel.d.ts.map +1 -0
- package/esm/src/models/payout/channel.js +53 -0
- package/esm/src/models/payout/derivatives/payout.d.ts +158 -0
- package/esm/src/models/payout/derivatives/payout.d.ts.map +1 -0
- package/esm/src/models/payout/derivatives/payout.js +271 -0
- package/esm/src/models/payout/index.d.ts +7 -0
- package/esm/src/models/payout/index.d.ts.map +1 -0
- package/esm/src/models/payout/index.js +6 -0
- package/esm/src/models/payout/narration.d.ts +164 -0
- package/esm/src/models/payout/narration.d.ts.map +1 -0
- package/esm/src/models/payout/narration.js +308 -0
- package/esm/src/models/payout/schemas.d.ts +156 -0
- package/esm/src/models/payout/schemas.d.ts.map +1 -0
- package/esm/src/models/payout/schemas.js +105 -0
- package/esm/src/models/payout/status.d.ts +33 -0
- package/esm/src/models/payout/status.d.ts.map +1 -0
- package/esm/src/models/payout/status.js +34 -0
- package/{dist/modules/login/permission.type.d.ts → esm/src/models/permission.d.ts} +9 -8
- package/esm/src/models/permission.d.ts.map +1 -0
- package/esm/src/models/permission.js +50 -0
- package/esm/src/models/role.d.ts +21 -0
- package/esm/src/models/role.d.ts.map +1 -0
- package/esm/src/models/role.js +73 -0
- package/esm/src/models/user/authenticated-user.d.ts +77 -0
- package/esm/src/models/user/authenticated-user.d.ts.map +1 -0
- package/esm/src/models/user/authenticated-user.js +226 -0
- package/esm/src/models/user/index.d.ts +4 -0
- package/esm/src/models/user/index.d.ts.map +1 -0
- package/esm/src/models/user/index.js +3 -0
- package/esm/src/models/user/managed-user.d.ts +108 -0
- package/esm/src/models/user/managed-user.d.ts.map +1 -0
- package/esm/src/models/user/managed-user.js +255 -0
- package/{dist/modules/profile/profile.model.d.ts → esm/src/models/user/profile.d.ts} +52 -81
- package/esm/src/models/user/profile.d.ts.map +1 -0
- package/esm/src/models/user/profile.js +334 -0
- package/esm/src/models/wallet/index.d.ts +4 -0
- package/esm/src/models/wallet/index.d.ts.map +1 -0
- package/esm/src/models/wallet/index.js +3 -0
- package/esm/src/models/wallet/schemas.d.ts +95 -0
- package/esm/src/models/wallet/schemas.d.ts.map +1 -0
- package/esm/src/models/wallet/schemas.js +35 -0
- package/esm/src/models/wallet/statement_entry.d.ts +160 -0
- package/esm/src/models/wallet/statement_entry.d.ts.map +1 -0
- package/esm/src/models/wallet/statement_entry.js +255 -0
- package/{dist/modules/wallet/wallet.model.d.ts → esm/src/models/wallet/wallet.d.ts} +37 -31
- package/esm/src/models/wallet/wallet.d.ts.map +1 -0
- package/esm/src/models/wallet/wallet.js +279 -0
- package/esm/src/shared/base_repository.d.ts +80 -0
- package/esm/src/shared/base_repository.d.ts.map +1 -0
- package/esm/src/shared/base_repository.js +153 -0
- package/esm/src/shared/common_responses.d.ts +13 -0
- package/esm/src/shared/common_responses.d.ts.map +1 -0
- package/esm/src/shared/common_responses.js +10 -0
- package/esm/src/shared/index.d.ts +3 -0
- package/esm/src/shared/index.d.ts.map +1 -0
- package/esm/src/shared/index.js +2 -0
- package/esm/src/shared/token_required_repository.d.ts +78 -0
- package/esm/src/shared/token_required_repository.d.ts.map +1 -0
- package/esm/src/shared/token_required_repository.js +128 -0
- package/package.json +23 -49
- package/script/mod.d.ts +8 -0
- package/script/mod.d.ts.map +1 -0
- package/script/mod.js +23 -0
- package/script/npm/src/mod.d.ts +8 -0
- package/script/npm/src/mod.d.ts.map +1 -0
- package/script/npm/src/mod.js +23 -0
- package/script/npm/src/src/errors/api_error.d.ts +63 -0
- package/script/npm/src/src/errors/api_error.d.ts.map +1 -0
- package/script/npm/src/src/errors/api_error.js +94 -0
- package/script/npm/src/src/errors/index.d.ts +3 -0
- package/script/npm/src/src/errors/index.d.ts.map +1 -0
- package/script/npm/src/src/errors/index.js +18 -0
- package/script/npm/src/src/errors/permission_error.d.ts +48 -0
- package/script/npm/src/src/errors/permission_error.d.ts.map +1 -0
- package/script/npm/src/src/errors/permission_error.js +74 -0
- package/script/npm/src/src/features/admin/contract.d.ts +842 -0
- package/script/npm/src/src/features/admin/contract.d.ts.map +1 -0
- package/script/npm/src/src/features/admin/contract.js +213 -0
- package/script/npm/src/src/features/admin/index.d.ts +4 -0
- package/script/npm/src/src/features/admin/index.d.ts.map +1 -0
- package/script/npm/src/src/features/admin/index.js +19 -0
- package/script/npm/src/src/features/admin/repository.d.ts +114 -0
- package/script/npm/src/src/features/admin/repository.d.ts.map +1 -0
- package/script/npm/src/src/features/admin/repository.js +252 -0
- package/script/npm/src/src/features/admin/schemas.d.ts +146 -0
- package/script/npm/src/src/features/admin/schemas.d.ts.map +1 -0
- package/script/npm/src/src/features/admin/schemas.js +209 -0
- package/script/npm/src/src/features/auth/access/contract.d.ts +14 -0
- package/script/npm/src/src/features/auth/access/contract.d.ts.map +1 -0
- package/script/npm/src/src/features/auth/access/contract.js +17 -0
- package/script/npm/src/src/features/auth/access/repository.d.ts +11 -0
- package/script/npm/src/src/features/auth/access/repository.d.ts.map +1 -0
- package/script/npm/src/src/features/auth/access/repository.js +29 -0
- package/script/npm/src/src/features/auth/contract.d.ts +112 -0
- package/script/npm/src/src/features/auth/contract.d.ts.map +1 -0
- package/script/npm/src/src/features/auth/contract.js +46 -0
- package/script/npm/src/src/features/auth/identity/contract.d.ts +23 -0
- package/script/npm/src/src/features/auth/identity/contract.d.ts.map +1 -0
- package/script/npm/src/src/features/auth/identity/contract.js +20 -0
- package/script/npm/src/src/features/auth/identity/repository.d.ts +22 -0
- package/script/npm/src/src/features/auth/identity/repository.d.ts.map +1 -0
- package/script/npm/src/src/features/auth/identity/repository.js +34 -0
- package/script/npm/src/src/features/auth/index.d.ts +6 -0
- package/script/npm/src/src/features/auth/index.d.ts.map +1 -0
- package/script/npm/src/src/features/auth/index.js +21 -0
- package/script/npm/src/src/features/auth/manager.d.ts +105 -0
- package/script/npm/src/src/features/auth/manager.d.ts.map +1 -0
- package/script/npm/src/src/features/auth/manager.js +185 -0
- package/script/npm/src/src/features/auth/profile/contract.d.ts +37 -0
- package/script/npm/src/src/features/auth/profile/contract.d.ts.map +1 -0
- package/script/npm/src/src/features/auth/profile/contract.js +17 -0
- package/script/npm/src/src/features/auth/profile/repository.d.ts +11 -0
- package/script/npm/src/src/features/auth/profile/repository.d.ts.map +1 -0
- package/script/npm/src/src/features/auth/profile/repository.js +29 -0
- package/script/npm/src/src/features/auth/repository.d.ts +30 -0
- package/script/npm/src/src/features/auth/repository.d.ts.map +1 -0
- package/script/npm/src/src/features/auth/repository.js +73 -0
- package/script/npm/src/src/features/auth/storage/client_store.d.ts +30 -0
- package/script/npm/src/src/features/auth/storage/client_store.d.ts.map +1 -0
- package/script/npm/src/src/features/auth/storage/client_store.js +51 -0
- package/script/npm/src/src/features/auth/storage/client_token_handler.d.ts +32 -0
- package/script/npm/src/src/features/auth/storage/client_token_handler.d.ts.map +1 -0
- package/script/npm/src/src/features/auth/storage/client_token_handler.js +40 -0
- package/script/npm/src/src/features/auth/storage/server_store.d.ts +24 -0
- package/script/npm/src/src/features/auth/storage/server_store.d.ts.map +1 -0
- package/script/npm/src/src/features/auth/storage/server_store.js +38 -0
- package/script/npm/src/src/features/auth/storage/server_token_handler.d.ts +36 -0
- package/script/npm/src/src/features/auth/storage/server_token_handler.d.ts.map +1 -0
- package/script/npm/src/src/features/auth/storage/server_token_handler.js +119 -0
- package/script/npm/src/src/features/auth/storage/types.d.ts +42 -0
- package/script/npm/src/src/features/auth/storage/types.d.ts.map +1 -0
- package/script/npm/src/src/features/auth/storage/types.js +2 -0
- package/script/npm/src/src/features/contact/contract.d.ts +170 -0
- package/script/npm/src/src/features/contact/contract.d.ts.map +1 -0
- package/script/npm/src/src/features/contact/contract.js +52 -0
- package/script/npm/src/src/features/contact/index.d.ts +2 -0
- package/script/npm/src/src/features/contact/index.d.ts.map +1 -0
- package/script/npm/src/src/features/contact/index.js +17 -0
- package/script/npm/src/src/features/contact/repository.d.ts +58 -0
- package/script/npm/src/src/features/contact/repository.d.ts.map +1 -0
- package/script/npm/src/src/features/contact/repository.js +112 -0
- package/script/npm/src/src/features/payout/contract.d.ts +623 -0
- package/script/npm/src/src/features/payout/contract.d.ts.map +1 -0
- package/script/npm/src/src/features/payout/contract.js +78 -0
- package/script/npm/src/src/features/payout/index.d.ts +2 -0
- package/script/npm/src/src/features/payout/index.d.ts.map +1 -0
- package/script/npm/src/src/features/payout/index.js +17 -0
- package/script/npm/src/src/features/payout/repository.d.ts +67 -0
- package/script/npm/src/src/features/payout/repository.d.ts.map +1 -0
- package/script/npm/src/src/features/payout/repository.js +167 -0
- package/script/npm/src/src/features/wallet/contract.d.ts +137 -0
- package/script/npm/src/src/features/wallet/contract.d.ts.map +1 -0
- package/script/npm/src/src/features/wallet/contract.js +41 -0
- package/script/npm/src/src/features/wallet/index.d.ts +2 -0
- package/script/npm/src/src/features/wallet/index.d.ts.map +1 -0
- package/script/npm/src/src/features/wallet/index.js +17 -0
- package/script/npm/src/src/features/wallet/repository.d.ts +57 -0
- package/script/npm/src/src/features/wallet/repository.d.ts.map +1 -0
- package/script/npm/src/src/features/wallet/repository.js +97 -0
- package/script/npm/src/src/models/contact/derivatives/contact.d.ts +172 -0
- package/script/npm/src/src/models/contact/derivatives/contact.d.ts.map +1 -0
- package/script/npm/src/src/models/contact/derivatives/contact.js +270 -0
- package/script/npm/src/src/models/contact/derivatives/contact_info.d.ts +188 -0
- package/script/npm/src/src/models/contact/derivatives/contact_info.d.ts.map +1 -0
- package/script/npm/src/src/models/contact/derivatives/contact_info.js +260 -0
- package/script/npm/src/src/models/contact/index.d.ts +5 -0
- package/script/npm/src/src/models/contact/index.d.ts.map +1 -0
- package/script/npm/src/src/models/contact/index.js +20 -0
- package/script/npm/src/src/models/contact/schemas.d.ts +66 -0
- package/script/npm/src/src/models/contact/schemas.d.ts.map +1 -0
- package/script/npm/src/src/models/contact/schemas.js +67 -0
- package/script/npm/src/src/models/contact/validation.d.ts +37 -0
- package/script/npm/src/src/models/contact/validation.d.ts.map +1 -0
- package/script/npm/src/src/models/contact/validation.js +153 -0
- package/script/npm/src/src/models/index.d.ts +7 -0
- package/script/npm/src/src/models/index.d.ts.map +1 -0
- package/script/npm/src/src/models/index.js +22 -0
- package/script/npm/src/src/models/payout/api.d.ts +29 -0
- package/script/npm/src/src/models/payout/api.d.ts.map +1 -0
- package/script/npm/src/src/models/payout/api.js +2 -0
- package/script/npm/src/src/models/payout/channel.d.ts +58 -0
- package/script/npm/src/src/models/payout/channel.d.ts.map +1 -0
- package/script/npm/src/src/models/payout/channel.js +56 -0
- package/script/npm/src/src/models/payout/derivatives/payout.d.ts +158 -0
- package/script/npm/src/src/models/payout/derivatives/payout.d.ts.map +1 -0
- package/script/npm/src/src/models/payout/derivatives/payout.js +275 -0
- package/script/npm/src/src/models/payout/index.d.ts +7 -0
- package/script/npm/src/src/models/payout/index.d.ts.map +1 -0
- package/script/npm/src/src/models/payout/index.js +22 -0
- package/script/npm/src/src/models/payout/narration.d.ts +164 -0
- package/script/npm/src/src/models/payout/narration.d.ts.map +1 -0
- package/script/npm/src/src/models/payout/narration.js +312 -0
- package/script/npm/src/src/models/payout/schemas.d.ts +156 -0
- package/script/npm/src/src/models/payout/schemas.d.ts.map +1 -0
- package/script/npm/src/src/models/payout/schemas.js +108 -0
- package/script/npm/src/src/models/payout/status.d.ts +33 -0
- package/script/npm/src/src/models/payout/status.d.ts.map +1 -0
- package/script/npm/src/src/models/payout/status.js +37 -0
- package/script/npm/src/src/models/permission.d.ts +55 -0
- package/script/npm/src/src/models/permission.d.ts.map +1 -0
- package/script/npm/src/src/models/permission.js +53 -0
- package/script/npm/src/src/models/role.d.ts +21 -0
- package/script/npm/src/src/models/role.d.ts.map +1 -0
- package/script/npm/src/src/models/role.js +77 -0
- package/script/npm/src/src/models/user/authenticated-user.d.ts +77 -0
- package/script/npm/src/src/models/user/authenticated-user.d.ts.map +1 -0
- package/script/npm/src/src/models/user/authenticated-user.js +230 -0
- package/script/npm/src/src/models/user/index.d.ts +4 -0
- package/script/npm/src/src/models/user/index.d.ts.map +1 -0
- package/script/npm/src/src/models/user/index.js +19 -0
- package/script/npm/src/src/models/user/managed-user.d.ts +108 -0
- package/script/npm/src/src/models/user/managed-user.d.ts.map +1 -0
- package/script/npm/src/src/models/user/managed-user.js +260 -0
- package/script/npm/src/src/models/user/profile.d.ts +161 -0
- package/script/npm/src/src/models/user/profile.d.ts.map +1 -0
- package/script/npm/src/src/models/user/profile.js +338 -0
- package/script/npm/src/src/models/wallet/index.d.ts +4 -0
- package/script/npm/src/src/models/wallet/index.d.ts.map +1 -0
- package/script/npm/src/src/models/wallet/index.js +19 -0
- package/script/npm/src/src/models/wallet/schemas.d.ts +95 -0
- package/script/npm/src/src/models/wallet/schemas.d.ts.map +1 -0
- package/script/npm/src/src/models/wallet/schemas.js +38 -0
- package/script/npm/src/src/models/wallet/statement_entry.d.ts +160 -0
- package/script/npm/src/src/models/wallet/statement_entry.d.ts.map +1 -0
- package/script/npm/src/src/models/wallet/statement_entry.js +259 -0
- package/script/npm/src/src/models/wallet/wallet.d.ts +147 -0
- package/script/npm/src/src/models/wallet/wallet.d.ts.map +1 -0
- package/script/npm/src/src/models/wallet/wallet.js +283 -0
- package/script/npm/src/src/shared/base_repository.d.ts +80 -0
- package/script/npm/src/src/shared/base_repository.d.ts.map +1 -0
- package/script/npm/src/src/shared/base_repository.js +157 -0
- package/script/npm/src/src/shared/common_responses.d.ts +13 -0
- package/script/npm/src/src/shared/common_responses.d.ts.map +1 -0
- package/script/npm/src/src/shared/common_responses.js +13 -0
- package/script/npm/src/src/shared/index.d.ts +3 -0
- package/script/npm/src/src/shared/index.d.ts.map +1 -0
- package/script/npm/src/src/shared/index.js +18 -0
- package/script/npm/src/src/shared/token_required_repository.d.ts +78 -0
- package/script/npm/src/src/shared/token_required_repository.d.ts.map +1 -0
- package/script/npm/src/src/shared/token_required_repository.js +132 -0
- package/script/package.json +3 -0
- package/dist/index.cjs.js +0 -2
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.d.ts +0 -10
- package/dist/index.esm.js +0 -2
- package/dist/index.esm.js.map +0 -1
- package/dist/lib/api/base-repository.d.ts +0 -175
- package/dist/lib/api/index.d.ts +0 -1
- package/dist/lib/error/error.utils.d.ts +0 -22
- package/dist/lib/error/index.d.ts +0 -3
- package/dist/lib/query/index.d.ts +0 -4
- package/dist/lib/query/pagination/pagination.d.ts +0 -73
- package/dist/lib/query/pagination/pagination.schemas.d.ts +0 -83
- package/dist/lib/query/query.builder.d.ts +0 -71
- package/dist/lib/query/query.types.d.ts +0 -36
- package/dist/modules/auth/auth.manager.d.ts +0 -249
- package/dist/modules/auth/auth.repository.d.ts +0 -83
- package/dist/modules/auth/auth.store.d.ts +0 -139
- package/dist/modules/auth/company-membership.model.d.ts +0 -171
- package/dist/modules/auth/index.d.ts +0 -4
- package/dist/modules/auth/user.model.d.ts +0 -363
- package/dist/modules/contact/contact-info.model.d.ts +0 -485
- package/dist/modules/contact/contact-input-handler.d.ts +0 -16
- package/dist/modules/contact/contact.dtos.d.ts +0 -84
- package/dist/modules/contact/contact.model.d.ts +0 -441
- package/dist/modules/contact/contact.repository.d.ts +0 -116
- package/dist/modules/contact/index.d.ts +0 -4
- package/dist/modules/login/index.d.ts +0 -4
- package/dist/modules/login/login.api-contract.d.ts +0 -51
- package/dist/modules/login/login.dtos.d.ts +0 -85
- package/dist/modules/login/login.model.d.ts +0 -168
- package/dist/modules/login/login.repository.d.ts +0 -58
- package/dist/modules/payout/index.d.ts +0 -5
- package/dist/modules/payout/payout-channel-handler.d.ts +0 -82
- package/dist/modules/payout/payout.dtos.d.ts +0 -605
- package/dist/modules/payout/payout.model.d.ts +0 -379
- package/dist/modules/payout/payout.query.d.ts +0 -133
- package/dist/modules/payout/payout.repository.d.ts +0 -181
- package/dist/modules/profile/index.d.ts +0 -3
- package/dist/modules/profile/profile.dtos.d.ts +0 -80
- package/dist/modules/profile/profile.repository.d.ts +0 -56
- package/dist/modules/team-member/index.d.ts +0 -4
- package/dist/modules/team-member/role.model.d.ts +0 -61
- package/dist/modules/team-member/team-member.dtos.d.ts +0 -261
- package/dist/modules/team-member/team-member.model.d.ts +0 -237
- package/dist/modules/team-member/team-member.repository.d.ts +0 -179
- package/dist/modules/wallet/index.d.ts +0 -7
- package/dist/modules/wallet/narration.model.d.ts +0 -225
- package/dist/modules/wallet/statement-entry.model.d.ts +0 -299
- package/dist/modules/wallet/wallet-manager.session.d.ts +0 -143
- package/dist/modules/wallet/wallet.dtos.d.ts +0 -204
- package/dist/modules/wallet/wallet.query.d.ts +0 -95
- package/dist/modules/wallet/wallet.repository.d.ts +0 -205
- package/dist/modules/wallet/wallet.utils.d.ts +0 -17
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/** Serialized pagination metadata for API responses */
|
|
2
|
-
export type PaginationJson = {
|
|
3
|
-
page: number;
|
|
4
|
-
limit: number;
|
|
5
|
-
total: number;
|
|
6
|
-
totalPages: number;
|
|
7
|
-
hasNext: boolean;
|
|
8
|
-
hasPrev: boolean;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Represents pagination metadata for paginated API responses.
|
|
12
|
-
* Provides computed properties for navigation and page calculations.
|
|
13
|
-
*/
|
|
14
|
-
export declare class Pagination {
|
|
15
|
-
readonly page: number;
|
|
16
|
-
readonly limit: number;
|
|
17
|
-
readonly total: number;
|
|
18
|
-
/**
|
|
19
|
-
* @param page - Current page number (1-based)
|
|
20
|
-
* @param limit - Number of items per page
|
|
21
|
-
* @param total - Total number of items across all pages
|
|
22
|
-
*/
|
|
23
|
-
constructor(page: number, limit: number, total: number);
|
|
24
|
-
/** Total number of pages */
|
|
25
|
-
get totalPages(): number;
|
|
26
|
-
/** Whether there is a next page available */
|
|
27
|
-
get hasNext(): boolean;
|
|
28
|
-
/** Whether there is a previous page available */
|
|
29
|
-
get hasPrev(): boolean;
|
|
30
|
-
/** Offset for database queries (0-based) */
|
|
31
|
-
get offset(): number;
|
|
32
|
-
/** Whether this is the first page */
|
|
33
|
-
get isFirstPage(): boolean;
|
|
34
|
-
/** Whether this is the last page */
|
|
35
|
-
get isLastPage(): boolean;
|
|
36
|
-
/**
|
|
37
|
-
* Creates a Pagination instance for the next page.
|
|
38
|
-
* @returns New Pagination instance or null if no next page exists
|
|
39
|
-
*/
|
|
40
|
-
nextPage(): Pagination | null;
|
|
41
|
-
/**
|
|
42
|
-
* Creates a Pagination instance for the previous page.
|
|
43
|
-
* @returns New Pagination instance or null if no previous page exists
|
|
44
|
-
*/
|
|
45
|
-
prevPage(): Pagination | null;
|
|
46
|
-
/** Converts to a plain object for JSON serialization */
|
|
47
|
-
toJSON(): {
|
|
48
|
-
page: number;
|
|
49
|
-
limit: number;
|
|
50
|
-
total: number;
|
|
51
|
-
totalPages: number;
|
|
52
|
-
hasNext: boolean;
|
|
53
|
-
hasPrev: boolean;
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
/** Generic paginated response structure */
|
|
57
|
-
export interface Paged<T> {
|
|
58
|
-
results: T[];
|
|
59
|
-
pagination: Pagination;
|
|
60
|
-
}
|
|
61
|
-
/** Type for paginated responses after JSON serialization */
|
|
62
|
-
export type PaginatedApiResponse<T> = {
|
|
63
|
-
results: T[];
|
|
64
|
-
pagination: PaginationJson;
|
|
65
|
-
};
|
|
66
|
-
/**
|
|
67
|
-
* Creates a paginated response from query results.
|
|
68
|
-
*/
|
|
69
|
-
export declare function createPaginatedResponse<T>(results: T[], page: number, limit: number, total: number): Paged<T>;
|
|
70
|
-
/**
|
|
71
|
-
* Creates an empty paginated response.
|
|
72
|
-
*/
|
|
73
|
-
export declare function emptyPaginatedResponse<T>(page?: number, limit?: number): Paged<T>;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
/** Zod schema for validating pagination query parameters */
|
|
3
|
-
export declare const PaginationParamsSchema: z.ZodObject<{
|
|
4
|
-
page: z.ZodDefault<z.ZodNumber>;
|
|
5
|
-
limit: z.ZodDefault<z.ZodNumber>;
|
|
6
|
-
}, "strip", z.ZodTypeAny, {
|
|
7
|
-
page: number;
|
|
8
|
-
limit: number;
|
|
9
|
-
}, {
|
|
10
|
-
page?: number | undefined;
|
|
11
|
-
limit?: number | undefined;
|
|
12
|
-
}>;
|
|
13
|
-
/** Zod schema for validating pagination metadata */
|
|
14
|
-
export declare const PaginationSchema: z.ZodObject<{
|
|
15
|
-
page: z.ZodNumber;
|
|
16
|
-
limit: z.ZodNumber;
|
|
17
|
-
total: z.ZodNumber;
|
|
18
|
-
totalPages: z.ZodNumber;
|
|
19
|
-
hasNext: z.ZodBoolean;
|
|
20
|
-
hasPrev: z.ZodBoolean;
|
|
21
|
-
}, "strip", z.ZodTypeAny, {
|
|
22
|
-
page: number;
|
|
23
|
-
limit: number;
|
|
24
|
-
total: number;
|
|
25
|
-
totalPages: number;
|
|
26
|
-
hasNext: boolean;
|
|
27
|
-
hasPrev: boolean;
|
|
28
|
-
}, {
|
|
29
|
-
page: number;
|
|
30
|
-
limit: number;
|
|
31
|
-
total: number;
|
|
32
|
-
totalPages: number;
|
|
33
|
-
hasNext: boolean;
|
|
34
|
-
hasPrev: boolean;
|
|
35
|
-
}>;
|
|
36
|
-
/**
|
|
37
|
-
* Creates a Zod schema for a paginated response with typed results.
|
|
38
|
-
*/
|
|
39
|
-
export declare function createPaginatedResponseSchema<T extends z.ZodTypeAny>(itemSchema: T): z.ZodObject<{
|
|
40
|
-
results: z.ZodArray<T, "many">;
|
|
41
|
-
pagination: z.ZodObject<{
|
|
42
|
-
page: z.ZodNumber;
|
|
43
|
-
limit: z.ZodNumber;
|
|
44
|
-
total: z.ZodNumber;
|
|
45
|
-
totalPages: z.ZodNumber;
|
|
46
|
-
hasNext: z.ZodBoolean;
|
|
47
|
-
hasPrev: z.ZodBoolean;
|
|
48
|
-
}, "strip", z.ZodTypeAny, {
|
|
49
|
-
page: number;
|
|
50
|
-
limit: number;
|
|
51
|
-
total: number;
|
|
52
|
-
totalPages: number;
|
|
53
|
-
hasNext: boolean;
|
|
54
|
-
hasPrev: boolean;
|
|
55
|
-
}, {
|
|
56
|
-
page: number;
|
|
57
|
-
limit: number;
|
|
58
|
-
total: number;
|
|
59
|
-
totalPages: number;
|
|
60
|
-
hasNext: boolean;
|
|
61
|
-
hasPrev: boolean;
|
|
62
|
-
}>;
|
|
63
|
-
}, "strip", z.ZodTypeAny, {
|
|
64
|
-
results: T["_output"][];
|
|
65
|
-
pagination: {
|
|
66
|
-
page: number;
|
|
67
|
-
limit: number;
|
|
68
|
-
total: number;
|
|
69
|
-
totalPages: number;
|
|
70
|
-
hasNext: boolean;
|
|
71
|
-
hasPrev: boolean;
|
|
72
|
-
};
|
|
73
|
-
}, {
|
|
74
|
-
results: T["_input"][];
|
|
75
|
-
pagination: {
|
|
76
|
-
page: number;
|
|
77
|
-
limit: number;
|
|
78
|
-
total: number;
|
|
79
|
-
totalPages: number;
|
|
80
|
-
hasNext: boolean;
|
|
81
|
-
hasPrev: boolean;
|
|
82
|
-
};
|
|
83
|
-
}>;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { FilterCriteria, QueryOptions, SortCriteria, SortDirection } from "./query.types.js";
|
|
2
|
-
export declare const QUERY_BUILDER_TYPE: unique symbol;
|
|
3
|
-
export declare class QueryBuilder {
|
|
4
|
-
readonly options: QueryOptions;
|
|
5
|
-
constructor(options?: QueryOptions);
|
|
6
|
-
/**
|
|
7
|
-
* Type tag to identify QueryBuilder instances
|
|
8
|
-
*/
|
|
9
|
-
[QUERY_BUILDER_TYPE]: string;
|
|
10
|
-
/**
|
|
11
|
-
* Safely check if an object is a QueryBuilder instance
|
|
12
|
-
*/
|
|
13
|
-
static is(obj: any): obj is QueryBuilder;
|
|
14
|
-
addFilter(criteria: FilterCriteria): this;
|
|
15
|
-
where(field: string, value: any): this;
|
|
16
|
-
whereNot(field: string, value: any): this;
|
|
17
|
-
whereLike(field: string, value: string): this;
|
|
18
|
-
whereLikeLower(field: string, value: string): this;
|
|
19
|
-
whereContains(field: string, value: string): this;
|
|
20
|
-
whereStartsWith(field: string, value: string): this;
|
|
21
|
-
whereEndsWith(field: string, value: string): this;
|
|
22
|
-
whereIn(field: string, values: any[]): this;
|
|
23
|
-
whereNull(field: string): this;
|
|
24
|
-
whereNotNull(field: string): this;
|
|
25
|
-
whereGreaterThan(field: string, value: any): this;
|
|
26
|
-
whereGreaterThanOrEqual(field: string, value: any): this;
|
|
27
|
-
whereLessThan(field: string, value: any): this;
|
|
28
|
-
whereLessThanOrEqual(field: string, value: any): this;
|
|
29
|
-
whereBetween(field: string, min: any, max: any): this;
|
|
30
|
-
whereDateBetween(startDate?: string | null, endDate?: string | null): this;
|
|
31
|
-
addSort(criteria: SortCriteria): this;
|
|
32
|
-
orderBy(field: string, direction?: SortDirection): this;
|
|
33
|
-
orderByAsc(field: string): this;
|
|
34
|
-
orderByDesc(field: string): this;
|
|
35
|
-
paginate(page: number, limit: number): this;
|
|
36
|
-
/**
|
|
37
|
-
* Add eager loading for related models
|
|
38
|
-
* @param relations Relation name or array of relation names
|
|
39
|
-
*/
|
|
40
|
-
with(relations: string | string[]): this;
|
|
41
|
-
/**
|
|
42
|
-
* Add a JOIN to the query to fetch related models
|
|
43
|
-
* @param relations Relation name or array of relation names to join
|
|
44
|
-
*/
|
|
45
|
-
join(relations: string | string[]): this;
|
|
46
|
-
/**
|
|
47
|
-
* Add GROUP BY clause to the query
|
|
48
|
-
* @param fields Field or fields to group by
|
|
49
|
-
*/
|
|
50
|
-
groupBy(fields: string | string[]): this;
|
|
51
|
-
/**
|
|
52
|
-
* Enable count mode for the query
|
|
53
|
-
* @param expression Optional count expression (defaults to '*')
|
|
54
|
-
*/
|
|
55
|
-
count(expression?: string): this;
|
|
56
|
-
/**
|
|
57
|
-
* Count specific expression with alias
|
|
58
|
-
* @param expression Expression to count
|
|
59
|
-
* @param alias Alias for the count result
|
|
60
|
-
*/
|
|
61
|
-
countAs(expression: string, alias: string): this;
|
|
62
|
-
/**
|
|
63
|
-
* @returns an objection-find query
|
|
64
|
-
*/
|
|
65
|
-
build(): Record<string, any>;
|
|
66
|
-
/**
|
|
67
|
-
* Create a clone of this query builder
|
|
68
|
-
*/
|
|
69
|
-
clone(): this;
|
|
70
|
-
static create<T extends QueryOptions>(options?: T): QueryBuilder;
|
|
71
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export declare enum FilterOperator {
|
|
2
|
-
EQUALS = "eq",
|
|
3
|
-
NOT_EQUALS = "neq",
|
|
4
|
-
LESS_THAN = "lt",
|
|
5
|
-
LESS_THAN_OR_EQUAL = "lte",
|
|
6
|
-
GREATER_THAN = "gt",
|
|
7
|
-
GREATER_THAN_OR_EQUAL = "gte",
|
|
8
|
-
LIKE = "like",
|
|
9
|
-
LIKE_LOWER = "likeLower",
|
|
10
|
-
IS_NULL = "isNull",
|
|
11
|
-
IS_NOT_NULL = "isNotNull",
|
|
12
|
-
IN = "in"
|
|
13
|
-
}
|
|
14
|
-
export declare enum SortDirection {
|
|
15
|
-
ASC = "asc",
|
|
16
|
-
DESC = "desc"
|
|
17
|
-
}
|
|
18
|
-
export interface FilterCriteria {
|
|
19
|
-
field: string;
|
|
20
|
-
operator: FilterOperator;
|
|
21
|
-
value?: any;
|
|
22
|
-
}
|
|
23
|
-
export interface SortCriteria {
|
|
24
|
-
field: string;
|
|
25
|
-
direction: SortDirection;
|
|
26
|
-
}
|
|
27
|
-
export interface QueryOptions {
|
|
28
|
-
page?: number;
|
|
29
|
-
limit?: number;
|
|
30
|
-
filters?: FilterCriteria[];
|
|
31
|
-
sort?: SortCriteria[];
|
|
32
|
-
includes?: string[];
|
|
33
|
-
join?: string[];
|
|
34
|
-
groupBy?: string[];
|
|
35
|
-
count?: string;
|
|
36
|
-
}
|
|
@@ -1,249 +0,0 @@
|
|
|
1
|
-
import { Permission } from "@/modules/login/permission.type.js";
|
|
2
|
-
import { User } from "@/modules/auth/user.model.js";
|
|
3
|
-
/**
|
|
4
|
-
* Clean authentication manager for client-side usage only.
|
|
5
|
-
*
|
|
6
|
-
* This class provides a centralized way to manage user authentication state,
|
|
7
|
-
* including login, logout, and permission checking. It uses a singleton pattern
|
|
8
|
-
* for client-side usage and directly interfaces with the unified auth store.
|
|
9
|
-
*
|
|
10
|
-
* **Architecture:**
|
|
11
|
-
* - **Client-side**: Use the singleton instance via `AfloatAuth.instance`
|
|
12
|
-
* - **Server-side**: Pass tokens directly to repositories (no auth manager needed)
|
|
13
|
-
*
|
|
14
|
-
* **Features:**
|
|
15
|
-
* - Direct integration with unified auth store
|
|
16
|
-
* - React hooks for reactive UI updates
|
|
17
|
-
* - Permission checking utilities
|
|
18
|
-
* - Automatic wallet session management
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* ```typescript
|
|
22
|
-
* // Client-side usage
|
|
23
|
-
* const auth = AfloatAuth.instance;
|
|
24
|
-
* const user = await auth.logIn(email, password);
|
|
25
|
-
*
|
|
26
|
-
* // Server-side usage (no auth manager needed)
|
|
27
|
-
* const walletRepo = new WalletRepository({ token: extractedToken });
|
|
28
|
-
* const balance = await walletRepo.getBalance({ wallet });
|
|
29
|
-
* ```
|
|
30
|
-
*/
|
|
31
|
-
export declare class AfloatAuth {
|
|
32
|
-
/** Client-side singleton instance */
|
|
33
|
-
private static _instance;
|
|
34
|
-
/**
|
|
35
|
-
* Private constructor to control instantiation.
|
|
36
|
-
* Use the static instance getter instead.
|
|
37
|
-
*
|
|
38
|
-
* @private
|
|
39
|
-
*/
|
|
40
|
-
private constructor();
|
|
41
|
-
/**
|
|
42
|
-
* Gets or creates the client-side singleton instance.
|
|
43
|
-
*
|
|
44
|
-
* @returns The client-side singleton instance
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* ```typescript
|
|
48
|
-
* const auth = AfloatAuth.instance;
|
|
49
|
-
* if (auth.currentUser) {
|
|
50
|
-
* console.log("User is logged in");
|
|
51
|
-
* }
|
|
52
|
-
* ```
|
|
53
|
-
*/
|
|
54
|
-
static get instance(): AfloatAuth;
|
|
55
|
-
/**
|
|
56
|
-
* Gets the authentication repository for API operations.
|
|
57
|
-
*
|
|
58
|
-
* @private
|
|
59
|
-
* @returns The auth repository instance with current token
|
|
60
|
-
*/
|
|
61
|
-
private get repo();
|
|
62
|
-
/**
|
|
63
|
-
* Gets the current authentication token.
|
|
64
|
-
*
|
|
65
|
-
* @returns The current authentication token, or undefined if not authenticated
|
|
66
|
-
*
|
|
67
|
-
* @example
|
|
68
|
-
* ```typescript
|
|
69
|
-
* const token = auth.getUserToken();
|
|
70
|
-
* if (token) {
|
|
71
|
-
* const apiClient = new SomeRepository({ token });
|
|
72
|
-
* }
|
|
73
|
-
* ```
|
|
74
|
-
*/
|
|
75
|
-
getUserToken(): string | undefined;
|
|
76
|
-
/**
|
|
77
|
-
* Gets the currently authenticated user.
|
|
78
|
-
*
|
|
79
|
-
* @returns The current user instance, or undefined if not authenticated
|
|
80
|
-
*
|
|
81
|
-
* @example
|
|
82
|
-
* ```typescript
|
|
83
|
-
* const user = auth.currentUser;
|
|
84
|
-
* if (user) {
|
|
85
|
-
* console.log(`Welcome, ${user.name}!`);
|
|
86
|
-
* }
|
|
87
|
-
* ```
|
|
88
|
-
*/
|
|
89
|
-
get currentUser(): User | undefined;
|
|
90
|
-
/**
|
|
91
|
-
* Checks if a user is currently authenticated.
|
|
92
|
-
*
|
|
93
|
-
* @returns True if user is authenticated, false otherwise
|
|
94
|
-
*
|
|
95
|
-
* @example
|
|
96
|
-
* ```typescript
|
|
97
|
-
* if (auth.isAuthenticated) {
|
|
98
|
-
* // User is logged in
|
|
99
|
-
* showDashboard();
|
|
100
|
-
* } else {
|
|
101
|
-
* // User needs to log in
|
|
102
|
-
* showLoginForm();
|
|
103
|
-
* }
|
|
104
|
-
* ```
|
|
105
|
-
*/
|
|
106
|
-
get isAuthenticated(): boolean;
|
|
107
|
-
/**
|
|
108
|
-
* React hook for accessing the current user in client-side components.
|
|
109
|
-
*
|
|
110
|
-
* This hook provides reactive updates when the user state changes,
|
|
111
|
-
* making it perfect for React components that need to respond to
|
|
112
|
-
* authentication state changes.
|
|
113
|
-
*
|
|
114
|
-
* @returns The current user with reactive updates, or undefined if not authenticated
|
|
115
|
-
* @throws {Error} If called in a server environment
|
|
116
|
-
*
|
|
117
|
-
* @example
|
|
118
|
-
* ```typescript
|
|
119
|
-
* function UserProfile() {
|
|
120
|
-
* const user = AfloatAuth.instance.useCurrentUser();
|
|
121
|
-
*
|
|
122
|
-
* if (!user) {
|
|
123
|
-
* return <LoginForm />;
|
|
124
|
-
* }
|
|
125
|
-
*
|
|
126
|
-
* return <div>Hello, {user.name}!</div>;
|
|
127
|
-
* }
|
|
128
|
-
* ```
|
|
129
|
-
*/
|
|
130
|
-
useCurrentUser(): User | undefined;
|
|
131
|
-
/**
|
|
132
|
-
* Checks if the current user has a specific permission.
|
|
133
|
-
*
|
|
134
|
-
* @param perm - The permission to check
|
|
135
|
-
* @returns True if the user has the permission, false otherwise
|
|
136
|
-
*
|
|
137
|
-
* @example
|
|
138
|
-
* ```typescript
|
|
139
|
-
* if (auth.checkPermission(Permission.ViewBalance)) {
|
|
140
|
-
* // User can view wallet balance
|
|
141
|
-
* const walletRepo = new WalletRepository({ token: auth.getUserToken() });
|
|
142
|
-
* const balance = await walletRepo.getBalance(wallet);
|
|
143
|
-
* } else {
|
|
144
|
-
* console.log("User doesn't have permission to view balance");
|
|
145
|
-
* }
|
|
146
|
-
* ```
|
|
147
|
-
*/
|
|
148
|
-
checkPermission(perm: Permission): boolean;
|
|
149
|
-
/**
|
|
150
|
-
* Authenticates a user with email and password.
|
|
151
|
-
*
|
|
152
|
-
* On successful authentication:
|
|
153
|
-
* - Clears any existing auth data
|
|
154
|
-
* - Stores the new user and token atomically
|
|
155
|
-
* - Initializes related services (wallet manager)
|
|
156
|
-
*
|
|
157
|
-
* @param email - The user's email address
|
|
158
|
-
* @param password - The user's password
|
|
159
|
-
* @returns Promise resolving to the authenticated user
|
|
160
|
-
* @throws {Error} If authentication fails
|
|
161
|
-
*
|
|
162
|
-
* @example
|
|
163
|
-
* ```typescript
|
|
164
|
-
* try {
|
|
165
|
-
* const user = await auth.logIn("user@example.com", "password123");
|
|
166
|
-
* console.log("Login successful!");
|
|
167
|
-
* router.push("/dashboard");
|
|
168
|
-
* } catch (error) {
|
|
169
|
-
* console.error("Login failed:", error.message);
|
|
170
|
-
* setError("Invalid credentials");
|
|
171
|
-
* }
|
|
172
|
-
* ```
|
|
173
|
-
*/
|
|
174
|
-
logIn(email: string, password: string): Promise<User>;
|
|
175
|
-
/**
|
|
176
|
-
* Updates the current user's password.
|
|
177
|
-
*
|
|
178
|
-
* @param currentPassword - The user's current password
|
|
179
|
-
* @param newPassword - The new password to set
|
|
180
|
-
* @returns Promise resolving to true if successful
|
|
181
|
-
* @throws {Error} If the password update fails or user is not authenticated
|
|
182
|
-
*
|
|
183
|
-
* @example
|
|
184
|
-
* ```typescript
|
|
185
|
-
* try {
|
|
186
|
-
* await auth.resetPassword("oldPassword", "newPassword123");
|
|
187
|
-
* console.log("Password updated successfully");
|
|
188
|
-
* showSuccessMessage("Password updated!");
|
|
189
|
-
* } catch (error) {
|
|
190
|
-
* console.error("Password update failed:", error.message);
|
|
191
|
-
* showErrorMessage("Failed to update password");
|
|
192
|
-
* }
|
|
193
|
-
* ```
|
|
194
|
-
*/
|
|
195
|
-
resetPassword(currentPassword: string, newPassword: string): Promise<boolean>;
|
|
196
|
-
/**
|
|
197
|
-
* Logs out the current user and clears all authentication data.
|
|
198
|
-
*
|
|
199
|
-
* This method:
|
|
200
|
-
* - Clears user state from memory and storage
|
|
201
|
-
* - Removes authentication tokens
|
|
202
|
-
* - Resets related services
|
|
203
|
-
*
|
|
204
|
-
* @example
|
|
205
|
-
* ```typescript
|
|
206
|
-
* auth.logOut();
|
|
207
|
-
* router.push("/login");
|
|
208
|
-
* console.log("User logged out successfully");
|
|
209
|
-
* ```
|
|
210
|
-
*/
|
|
211
|
-
logOut(): void;
|
|
212
|
-
/**
|
|
213
|
-
* Refreshes the current authentication state.
|
|
214
|
-
* Useful for clearing potentially stale data.
|
|
215
|
-
*
|
|
216
|
-
* @example
|
|
217
|
-
* ```typescript
|
|
218
|
-
* // Clear current state and force fresh authentication
|
|
219
|
-
* auth.refresh();
|
|
220
|
-
* ```
|
|
221
|
-
*/
|
|
222
|
-
refresh(): void;
|
|
223
|
-
/**
|
|
224
|
-
* Gets debug information about the current authentication state.
|
|
225
|
-
* Useful for troubleshooting authentication issues.
|
|
226
|
-
*
|
|
227
|
-
* @returns Object containing authentication state information
|
|
228
|
-
*
|
|
229
|
-
* @example
|
|
230
|
-
* ```typescript
|
|
231
|
-
* const debugInfo = auth.getDebugInfo();
|
|
232
|
-
* console.log("Auth Debug Info:", debugInfo);
|
|
233
|
-
* ```
|
|
234
|
-
*/
|
|
235
|
-
getDebugInfo(): {
|
|
236
|
-
hasUser: boolean;
|
|
237
|
-
hasToken: boolean;
|
|
238
|
-
isAuthenticated: boolean;
|
|
239
|
-
userName: string;
|
|
240
|
-
tokenLength: number;
|
|
241
|
-
managerInstance: string;
|
|
242
|
-
};
|
|
243
|
-
/**
|
|
244
|
-
* Clears all stored authentication data from the unified store.
|
|
245
|
-
*
|
|
246
|
-
* @private
|
|
247
|
-
*/
|
|
248
|
-
private clearSavedData;
|
|
249
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { BaseRepository } from "@/lib/api/base-repository.js";
|
|
2
|
-
import { User } from "@/modules/auth/user.model.js";
|
|
3
|
-
import { authContract } from "./auth.contract.js";
|
|
4
|
-
/**
|
|
5
|
-
* Repository class for handling authentication-related operations.
|
|
6
|
-
* Provides methods for user login and password management.
|
|
7
|
-
*
|
|
8
|
-
* @extends {BaseRepository<typeof authContract>}
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* ```typescript
|
|
12
|
-
* const authRepo = new AuthRepository();
|
|
13
|
-
* const user = await authRepo.logIn("user@example.com", "password");
|
|
14
|
-
* ```
|
|
15
|
-
*/
|
|
16
|
-
export declare class AuthRepository extends BaseRepository<typeof authContract> {
|
|
17
|
-
/**
|
|
18
|
-
* Creates an instance of AuthRepository.
|
|
19
|
-
*
|
|
20
|
-
* @param options - Optional configuration
|
|
21
|
-
* @param options.root - Custom API root URL
|
|
22
|
-
* @param options.token - Authentication token for password operations
|
|
23
|
-
*/
|
|
24
|
-
constructor(options?: {
|
|
25
|
-
root?: string;
|
|
26
|
-
token?: string;
|
|
27
|
-
});
|
|
28
|
-
/**
|
|
29
|
-
* Authenticates a user with the provided email and password.
|
|
30
|
-
*
|
|
31
|
-
* @param email - The email of the user attempting to log in
|
|
32
|
-
* @param password - The password of the user
|
|
33
|
-
* @returns Promise that resolves to a User object on successful login
|
|
34
|
-
* @throws {APIError} If the email or password is invalid, or if another error occurs during login
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* ```typescript
|
|
38
|
-
* try {
|
|
39
|
-
* const user = await authRepo.logIn("user@example.com", "securePassword");
|
|
40
|
-
* console.log(`Welcome ${user.name}!`);
|
|
41
|
-
* } catch (error) {
|
|
42
|
-
* console.error("Login failed:", error.message);
|
|
43
|
-
* }
|
|
44
|
-
* ```
|
|
45
|
-
*/
|
|
46
|
-
logIn(email: string, password: string): Promise<User>;
|
|
47
|
-
/**
|
|
48
|
-
* Updates the current user's password.
|
|
49
|
-
*
|
|
50
|
-
* @param currentPassword - The user's current password
|
|
51
|
-
* @param newPassword - The new password the user wants to set
|
|
52
|
-
* @returns Promise that resolves to true if the password update is successful
|
|
53
|
-
* @throws {APIError} If the current password is invalid or another error occurs during the update
|
|
54
|
-
*
|
|
55
|
-
* @example
|
|
56
|
-
* ```typescript
|
|
57
|
-
* try {
|
|
58
|
-
* await authRepo.updatePassword("oldPassword", "newSecurePassword");
|
|
59
|
-
* console.log("Password updated successfully");
|
|
60
|
-
* } catch (error) {
|
|
61
|
-
* console.error("Password update failed:", error.message);
|
|
62
|
-
* }
|
|
63
|
-
* ```
|
|
64
|
-
*/
|
|
65
|
-
updatePassword(currentPassword: string, newPassword: string): Promise<boolean>;
|
|
66
|
-
/**
|
|
67
|
-
* Retrieves the current user's access list.
|
|
68
|
-
*
|
|
69
|
-
* @returns Promise that resolves to an array of access permissions/roles
|
|
70
|
-
* @throws {APIError} If the request fails or returns an unexpected status
|
|
71
|
-
*
|
|
72
|
-
* @example
|
|
73
|
-
* ```typescript
|
|
74
|
-
* try {
|
|
75
|
-
* const accessList = await repo.getAccessList();
|
|
76
|
-
* console.log("User has access to:", accessList);
|
|
77
|
-
* } catch (error) {
|
|
78
|
-
* console.error("Failed to get access list:", error.message);
|
|
79
|
-
* }
|
|
80
|
-
* ```
|
|
81
|
-
*/
|
|
82
|
-
getAccessList(): Promise<string[]>;
|
|
83
|
-
}
|