@temboplus/afloat 0.1.61 → 0.1.63
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/README.md +246 -42
- package/{esm/src/features/admin/contract.d.ts → dist/features/admin/admin.contract.d.ts} +41 -77
- package/{script/npm/src/src/features/admin/schemas.d.ts → dist/features/admin/admin.dtos.d.ts} +8 -9
- package/dist/features/admin/admin.repository.d.ts +179 -0
- package/dist/features/admin/index.d.ts +2 -0
- package/{esm/src/features/auth/access/contract.d.ts → dist/features/auth/access/access.api-contract.d.ts} +0 -1
- package/dist/features/auth/access/access.repository.d.ts +55 -0
- package/{esm/src/features/auth/contract.d.ts → dist/features/auth/auth.contract.d.ts} +12 -8
- package/dist/features/auth/auth.manager.d.ts +249 -0
- package/dist/features/auth/auth.repository.d.ts +66 -0
- package/dist/features/auth/auth.store.d.ts +139 -0
- package/{script/npm/src/src/features/auth/identity/contract.d.ts → dist/features/auth/identity/identity.api-contract.d.ts} +0 -1
- package/dist/features/auth/identity/identity.repository.d.ts +58 -0
- package/dist/features/auth/index.d.ts +5 -0
- package/{script/npm/src/src/features/auth/profile/contract.d.ts → dist/features/auth/profile/profile.api-contract.d.ts} +8 -6
- package/dist/features/auth/profile/profile.dtos.d.ts +80 -0
- package/dist/features/auth/profile/profile.repository.d.ts +56 -0
- package/{script/npm/src/src/features/auth/storage/client_store.d.ts → dist/features/auth/storage/client-store.d.ts} +2 -3
- package/{esm/src/features/auth/storage/client_token_handler.d.ts → dist/features/auth/storage/client-token-handler.d.ts} +1 -2
- package/{script/npm/src/src → dist}/features/auth/storage/types.d.ts +1 -2
- package/dist/features/contact/contact-input-handler.d.ts +16 -0
- package/{esm/src/features/contact/contract.d.ts → dist/features/contact/contact.api-contract.d.ts} +101 -45
- package/dist/features/contact/contact.dtos.d.ts +90 -0
- package/dist/features/contact/contact.repository.d.ts +116 -0
- package/dist/features/contact/index.d.ts +2 -0
- package/dist/features/payout/index.d.ts +3 -0
- package/dist/features/payout/payout-channel-handler.d.ts +108 -0
- package/{esm/src/features/payout/contract.d.ts → dist/features/payout/payout.api-contract.d.ts} +351 -187
- package/dist/features/payout/payout.dtos.d.ts +365 -0
- package/dist/features/payout/payout.repository.d.ts +193 -0
- package/dist/features/wallet/index.d.ts +4 -0
- package/dist/features/wallet/wallet-manager.session.d.ts +143 -0
- package/{script/npm/src/src/features/wallet/contract.d.ts → dist/features/wallet/wallet.contract.d.ts} +9 -7
- package/dist/features/wallet/wallet.dtos.d.ts +204 -0
- package/dist/features/wallet/wallet.repository.d.ts +173 -0
- package/dist/features/wallet/wallet.utils.d.ts +17 -0
- package/dist/index.cjs.js +2 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.esm.js +2 -0
- package/dist/index.esm.js.map +1 -0
- package/{esm/src/shared/base_repository.d.ts → dist/lib/api/base-repository.d.ts} +137 -42
- package/{script/npm/src/src/shared/common_responses.d.ts → dist/lib/api/common-responses.d.ts} +0 -1
- package/dist/lib/api/index.d.ts +2 -0
- package/{esm/src/errors/api_error.d.ts → dist/lib/error/error.api.d.ts} +0 -1
- package/{script/npm/src/src/errors/permission_error.d.ts → dist/lib/error/error.permission.d.ts} +1 -2
- package/dist/lib/error/error.utils.d.ts +22 -0
- package/dist/lib/error/index.d.ts +3 -0
- package/dist/models/contact-info.model.d.ts +817 -0
- package/{script/npm/src/src/models/contact/derivatives/contact.d.ts → dist/models/contact.model.d.ts} +23 -16
- package/dist/models/index.d.ts +11 -0
- package/{esm/src/models/user/managed-user.d.ts → dist/models/managed-user.model.d.ts} +3 -3
- package/dist/models/narration.model.d.ts +184 -0
- package/{script/npm/src/src/models/payout/derivatives/payout.d.ts → dist/models/payout.model.d.ts} +14 -16
- package/{esm/src → dist}/models/permission.d.ts +1 -2
- package/{script/npm/src/src/models/user/profile.d.ts → dist/models/profile.model.d.ts} +37 -43
- package/{script/npm/src/src/models/role.d.ts → dist/models/role.model.d.ts} +2 -10
- package/dist/models/statement-entry.model.d.ts +248 -0
- package/dist/models/user.model.d.ts +65 -0
- package/{script/npm/src/src/models/wallet/wallet.d.ts → dist/models/wallet.model.d.ts} +3 -46
- package/package.json +47 -24
- package/LICENSE +0 -7
- package/esm/mod.d.ts +0 -8
- package/esm/mod.d.ts.map +0 -1
- package/esm/mod.js +0 -7
- package/esm/package.json +0 -3
- package/esm/src/errors/api_error.d.ts.map +0 -1
- package/esm/src/errors/api_error.js +0 -90
- package/esm/src/errors/index.d.ts +0 -3
- package/esm/src/errors/index.d.ts.map +0 -1
- package/esm/src/errors/index.js +0 -2
- package/esm/src/errors/permission_error.d.ts +0 -48
- package/esm/src/errors/permission_error.d.ts.map +0 -1
- package/esm/src/errors/permission_error.js +0 -70
- package/esm/src/features/admin/contract.d.ts.map +0 -1
- package/esm/src/features/admin/contract.js +0 -210
- package/esm/src/features/admin/index.d.ts +0 -4
- package/esm/src/features/admin/index.d.ts.map +0 -1
- package/esm/src/features/admin/index.js +0 -3
- package/esm/src/features/admin/repository.d.ts +0 -114
- package/esm/src/features/admin/repository.d.ts.map +0 -1
- package/esm/src/features/admin/repository.js +0 -248
- package/esm/src/features/admin/schemas.d.ts +0 -146
- package/esm/src/features/admin/schemas.d.ts.map +0 -1
- package/esm/src/features/admin/schemas.js +0 -206
- package/esm/src/features/auth/access/contract.d.ts.map +0 -1
- package/esm/src/features/auth/access/contract.js +0 -14
- package/esm/src/features/auth/access/repository.d.ts +0 -11
- package/esm/src/features/auth/access/repository.d.ts.map +0 -1
- package/esm/src/features/auth/access/repository.js +0 -25
- package/esm/src/features/auth/contract.d.ts.map +0 -1
- package/esm/src/features/auth/contract.js +0 -43
- package/esm/src/features/auth/identity/contract.d.ts +0 -23
- package/esm/src/features/auth/identity/contract.d.ts.map +0 -1
- package/esm/src/features/auth/identity/contract.js +0 -17
- package/esm/src/features/auth/identity/repository.d.ts +0 -22
- package/esm/src/features/auth/identity/repository.d.ts.map +0 -1
- package/esm/src/features/auth/identity/repository.js +0 -30
- package/esm/src/features/auth/index.d.ts +0 -6
- package/esm/src/features/auth/index.d.ts.map +0 -1
- package/esm/src/features/auth/index.js +0 -5
- package/esm/src/features/auth/manager.d.ts +0 -105
- package/esm/src/features/auth/manager.d.ts.map +0 -1
- package/esm/src/features/auth/manager.js +0 -181
- package/esm/src/features/auth/profile/contract.d.ts +0 -37
- package/esm/src/features/auth/profile/contract.d.ts.map +0 -1
- package/esm/src/features/auth/profile/contract.js +0 -14
- package/esm/src/features/auth/profile/repository.d.ts +0 -11
- package/esm/src/features/auth/profile/repository.d.ts.map +0 -1
- package/esm/src/features/auth/profile/repository.js +0 -25
- package/esm/src/features/auth/repository.d.ts +0 -30
- package/esm/src/features/auth/repository.d.ts.map +0 -1
- package/esm/src/features/auth/repository.js +0 -69
- package/esm/src/features/auth/storage/client_store.d.ts +0 -30
- package/esm/src/features/auth/storage/client_store.d.ts.map +0 -1
- package/esm/src/features/auth/storage/client_store.js +0 -46
- package/esm/src/features/auth/storage/client_token_handler.d.ts.map +0 -1
- package/esm/src/features/auth/storage/client_token_handler.js +0 -36
- package/esm/src/features/auth/storage/server_store.d.ts +0 -24
- package/esm/src/features/auth/storage/server_store.d.ts.map +0 -1
- package/esm/src/features/auth/storage/server_store.js +0 -34
- package/esm/src/features/auth/storage/server_token_handler.d.ts +0 -36
- package/esm/src/features/auth/storage/server_token_handler.d.ts.map +0 -1
- package/esm/src/features/auth/storage/server_token_handler.js +0 -115
- package/esm/src/features/auth/storage/types.d.ts +0 -42
- package/esm/src/features/auth/storage/types.d.ts.map +0 -1
- package/esm/src/features/auth/storage/types.js +0 -1
- package/esm/src/features/contact/contract.d.ts.map +0 -1
- package/esm/src/features/contact/contract.js +0 -49
- package/esm/src/features/contact/index.d.ts +0 -2
- package/esm/src/features/contact/index.d.ts.map +0 -1
- package/esm/src/features/contact/index.js +0 -1
- package/esm/src/features/contact/repository.d.ts +0 -58
- package/esm/src/features/contact/repository.d.ts.map +0 -1
- package/esm/src/features/contact/repository.js +0 -108
- package/esm/src/features/payout/contract.d.ts.map +0 -1
- package/esm/src/features/payout/contract.js +0 -75
- package/esm/src/features/payout/index.d.ts +0 -2
- package/esm/src/features/payout/index.d.ts.map +0 -1
- package/esm/src/features/payout/index.js +0 -1
- package/esm/src/features/payout/repository.d.ts +0 -67
- package/esm/src/features/payout/repository.d.ts.map +0 -1
- package/esm/src/features/payout/repository.js +0 -163
- package/esm/src/features/wallet/contract.d.ts +0 -137
- package/esm/src/features/wallet/contract.d.ts.map +0 -1
- package/esm/src/features/wallet/contract.js +0 -38
- package/esm/src/features/wallet/index.d.ts +0 -2
- package/esm/src/features/wallet/index.d.ts.map +0 -1
- package/esm/src/features/wallet/index.js +0 -1
- package/esm/src/features/wallet/repository.d.ts +0 -57
- package/esm/src/features/wallet/repository.d.ts.map +0 -1
- package/esm/src/features/wallet/repository.js +0 -93
- package/esm/src/models/contact/derivatives/contact.d.ts +0 -172
- package/esm/src/models/contact/derivatives/contact.d.ts.map +0 -1
- package/esm/src/models/contact/derivatives/contact.js +0 -266
- package/esm/src/models/contact/derivatives/contact_info.d.ts +0 -188
- package/esm/src/models/contact/derivatives/contact_info.d.ts.map +0 -1
- package/esm/src/models/contact/derivatives/contact_info.js +0 -255
- package/esm/src/models/contact/index.d.ts +0 -5
- package/esm/src/models/contact/index.d.ts.map +0 -1
- package/esm/src/models/contact/index.js +0 -4
- package/esm/src/models/contact/schemas.d.ts +0 -66
- package/esm/src/models/contact/schemas.d.ts.map +0 -1
- package/esm/src/models/contact/schemas.js +0 -64
- package/esm/src/models/contact/validation.d.ts +0 -37
- package/esm/src/models/contact/validation.d.ts.map +0 -1
- package/esm/src/models/contact/validation.js +0 -146
- package/esm/src/models/index.d.ts +0 -7
- package/esm/src/models/index.d.ts.map +0 -1
- package/esm/src/models/index.js +0 -6
- package/esm/src/models/payout/api.d.ts +0 -29
- package/esm/src/models/payout/api.d.ts.map +0 -1
- package/esm/src/models/payout/api.js +0 -1
- package/esm/src/models/payout/channel.d.ts +0 -58
- package/esm/src/models/payout/channel.d.ts.map +0 -1
- package/esm/src/models/payout/channel.js +0 -53
- package/esm/src/models/payout/derivatives/payout.d.ts +0 -158
- package/esm/src/models/payout/derivatives/payout.d.ts.map +0 -1
- package/esm/src/models/payout/derivatives/payout.js +0 -265
- package/esm/src/models/payout/index.d.ts +0 -7
- package/esm/src/models/payout/index.d.ts.map +0 -1
- package/esm/src/models/payout/index.js +0 -6
- package/esm/src/models/payout/narration.d.ts +0 -164
- package/esm/src/models/payout/narration.d.ts.map +0 -1
- package/esm/src/models/payout/narration.js +0 -308
- package/esm/src/models/payout/schemas.d.ts +0 -156
- package/esm/src/models/payout/schemas.d.ts.map +0 -1
- package/esm/src/models/payout/schemas.js +0 -105
- package/esm/src/models/payout/status.d.ts +0 -33
- package/esm/src/models/payout/status.d.ts.map +0 -1
- package/esm/src/models/payout/status.js +0 -34
- package/esm/src/models/permission.d.ts.map +0 -1
- package/esm/src/models/permission.js +0 -50
- package/esm/src/models/role.d.ts +0 -21
- package/esm/src/models/role.d.ts.map +0 -1
- package/esm/src/models/role.js +0 -73
- package/esm/src/models/user/authenticated-user.d.ts +0 -77
- package/esm/src/models/user/authenticated-user.d.ts.map +0 -1
- package/esm/src/models/user/authenticated-user.js +0 -226
- package/esm/src/models/user/index.d.ts +0 -4
- package/esm/src/models/user/index.d.ts.map +0 -1
- package/esm/src/models/user/index.js +0 -3
- package/esm/src/models/user/managed-user.d.ts.map +0 -1
- package/esm/src/models/user/managed-user.js +0 -255
- package/esm/src/models/user/profile.d.ts +0 -161
- package/esm/src/models/user/profile.d.ts.map +0 -1
- package/esm/src/models/user/profile.js +0 -334
- package/esm/src/models/wallet/index.d.ts +0 -4
- package/esm/src/models/wallet/index.d.ts.map +0 -1
- package/esm/src/models/wallet/index.js +0 -3
- package/esm/src/models/wallet/schemas.d.ts +0 -95
- package/esm/src/models/wallet/schemas.d.ts.map +0 -1
- package/esm/src/models/wallet/schemas.js +0 -35
- package/esm/src/models/wallet/statement_entry.d.ts +0 -160
- package/esm/src/models/wallet/statement_entry.d.ts.map +0 -1
- package/esm/src/models/wallet/statement_entry.js +0 -255
- package/esm/src/models/wallet/wallet.d.ts +0 -147
- package/esm/src/models/wallet/wallet.d.ts.map +0 -1
- package/esm/src/models/wallet/wallet.js +0 -279
- package/esm/src/shared/base_repository.d.ts.map +0 -1
- package/esm/src/shared/base_repository.js +0 -153
- package/esm/src/shared/common_responses.d.ts +0 -13
- package/esm/src/shared/common_responses.d.ts.map +0 -1
- package/esm/src/shared/common_responses.js +0 -10
- package/esm/src/shared/index.d.ts +0 -3
- package/esm/src/shared/index.d.ts.map +0 -1
- package/esm/src/shared/index.js +0 -2
- package/esm/src/shared/token_required_repository.d.ts +0 -78
- package/esm/src/shared/token_required_repository.d.ts.map +0 -1
- package/esm/src/shared/token_required_repository.js +0 -128
- package/script/mod.d.ts +0 -8
- package/script/mod.d.ts.map +0 -1
- package/script/mod.js +0 -23
- package/script/npm/src/mod.d.ts +0 -8
- package/script/npm/src/mod.d.ts.map +0 -1
- package/script/npm/src/mod.js +0 -23
- package/script/npm/src/src/errors/api_error.d.ts +0 -63
- package/script/npm/src/src/errors/api_error.d.ts.map +0 -1
- package/script/npm/src/src/errors/api_error.js +0 -94
- package/script/npm/src/src/errors/index.d.ts +0 -3
- package/script/npm/src/src/errors/index.d.ts.map +0 -1
- package/script/npm/src/src/errors/index.js +0 -18
- package/script/npm/src/src/errors/permission_error.d.ts.map +0 -1
- package/script/npm/src/src/errors/permission_error.js +0 -74
- package/script/npm/src/src/features/admin/contract.d.ts +0 -842
- package/script/npm/src/src/features/admin/contract.d.ts.map +0 -1
- package/script/npm/src/src/features/admin/contract.js +0 -213
- package/script/npm/src/src/features/admin/index.d.ts +0 -4
- package/script/npm/src/src/features/admin/index.d.ts.map +0 -1
- package/script/npm/src/src/features/admin/index.js +0 -19
- package/script/npm/src/src/features/admin/repository.d.ts +0 -114
- package/script/npm/src/src/features/admin/repository.d.ts.map +0 -1
- package/script/npm/src/src/features/admin/repository.js +0 -252
- package/script/npm/src/src/features/admin/schemas.d.ts.map +0 -1
- package/script/npm/src/src/features/admin/schemas.js +0 -209
- package/script/npm/src/src/features/auth/access/contract.d.ts +0 -14
- package/script/npm/src/src/features/auth/access/contract.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/access/contract.js +0 -17
- package/script/npm/src/src/features/auth/access/repository.d.ts +0 -11
- package/script/npm/src/src/features/auth/access/repository.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/access/repository.js +0 -29
- package/script/npm/src/src/features/auth/contract.d.ts +0 -112
- package/script/npm/src/src/features/auth/contract.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/contract.js +0 -46
- package/script/npm/src/src/features/auth/identity/contract.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/identity/contract.js +0 -20
- package/script/npm/src/src/features/auth/identity/repository.d.ts +0 -22
- package/script/npm/src/src/features/auth/identity/repository.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/identity/repository.js +0 -34
- package/script/npm/src/src/features/auth/index.d.ts +0 -6
- package/script/npm/src/src/features/auth/index.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/index.js +0 -21
- package/script/npm/src/src/features/auth/manager.d.ts +0 -105
- package/script/npm/src/src/features/auth/manager.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/manager.js +0 -185
- package/script/npm/src/src/features/auth/profile/contract.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/profile/contract.js +0 -17
- package/script/npm/src/src/features/auth/profile/repository.d.ts +0 -11
- package/script/npm/src/src/features/auth/profile/repository.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/profile/repository.js +0 -29
- package/script/npm/src/src/features/auth/repository.d.ts +0 -30
- package/script/npm/src/src/features/auth/repository.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/repository.js +0 -73
- package/script/npm/src/src/features/auth/storage/client_store.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/storage/client_store.js +0 -51
- package/script/npm/src/src/features/auth/storage/client_token_handler.d.ts +0 -32
- package/script/npm/src/src/features/auth/storage/client_token_handler.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/storage/client_token_handler.js +0 -40
- package/script/npm/src/src/features/auth/storage/server_store.d.ts +0 -24
- package/script/npm/src/src/features/auth/storage/server_store.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/storage/server_store.js +0 -38
- package/script/npm/src/src/features/auth/storage/server_token_handler.d.ts +0 -36
- package/script/npm/src/src/features/auth/storage/server_token_handler.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/storage/server_token_handler.js +0 -119
- package/script/npm/src/src/features/auth/storage/types.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/storage/types.js +0 -2
- package/script/npm/src/src/features/contact/contract.d.ts +0 -170
- package/script/npm/src/src/features/contact/contract.d.ts.map +0 -1
- package/script/npm/src/src/features/contact/contract.js +0 -52
- package/script/npm/src/src/features/contact/index.d.ts +0 -2
- package/script/npm/src/src/features/contact/index.d.ts.map +0 -1
- package/script/npm/src/src/features/contact/index.js +0 -17
- package/script/npm/src/src/features/contact/repository.d.ts +0 -58
- package/script/npm/src/src/features/contact/repository.d.ts.map +0 -1
- package/script/npm/src/src/features/contact/repository.js +0 -112
- package/script/npm/src/src/features/payout/contract.d.ts +0 -623
- package/script/npm/src/src/features/payout/contract.d.ts.map +0 -1
- package/script/npm/src/src/features/payout/contract.js +0 -78
- package/script/npm/src/src/features/payout/index.d.ts +0 -2
- package/script/npm/src/src/features/payout/index.d.ts.map +0 -1
- package/script/npm/src/src/features/payout/index.js +0 -17
- package/script/npm/src/src/features/payout/repository.d.ts +0 -67
- package/script/npm/src/src/features/payout/repository.d.ts.map +0 -1
- package/script/npm/src/src/features/payout/repository.js +0 -167
- package/script/npm/src/src/features/wallet/contract.d.ts.map +0 -1
- package/script/npm/src/src/features/wallet/contract.js +0 -41
- package/script/npm/src/src/features/wallet/index.d.ts +0 -2
- package/script/npm/src/src/features/wallet/index.d.ts.map +0 -1
- package/script/npm/src/src/features/wallet/index.js +0 -17
- package/script/npm/src/src/features/wallet/repository.d.ts +0 -57
- package/script/npm/src/src/features/wallet/repository.d.ts.map +0 -1
- package/script/npm/src/src/features/wallet/repository.js +0 -97
- package/script/npm/src/src/models/contact/derivatives/contact.d.ts.map +0 -1
- package/script/npm/src/src/models/contact/derivatives/contact.js +0 -270
- package/script/npm/src/src/models/contact/derivatives/contact_info.d.ts +0 -188
- package/script/npm/src/src/models/contact/derivatives/contact_info.d.ts.map +0 -1
- package/script/npm/src/src/models/contact/derivatives/contact_info.js +0 -260
- package/script/npm/src/src/models/contact/index.d.ts +0 -5
- package/script/npm/src/src/models/contact/index.d.ts.map +0 -1
- package/script/npm/src/src/models/contact/index.js +0 -20
- package/script/npm/src/src/models/contact/schemas.d.ts +0 -66
- package/script/npm/src/src/models/contact/schemas.d.ts.map +0 -1
- package/script/npm/src/src/models/contact/schemas.js +0 -67
- package/script/npm/src/src/models/contact/validation.d.ts +0 -37
- package/script/npm/src/src/models/contact/validation.d.ts.map +0 -1
- package/script/npm/src/src/models/contact/validation.js +0 -153
- package/script/npm/src/src/models/index.d.ts +0 -7
- package/script/npm/src/src/models/index.d.ts.map +0 -1
- package/script/npm/src/src/models/index.js +0 -22
- package/script/npm/src/src/models/payout/api.d.ts +0 -29
- package/script/npm/src/src/models/payout/api.d.ts.map +0 -1
- package/script/npm/src/src/models/payout/api.js +0 -2
- package/script/npm/src/src/models/payout/channel.d.ts +0 -58
- package/script/npm/src/src/models/payout/channel.d.ts.map +0 -1
- package/script/npm/src/src/models/payout/channel.js +0 -56
- package/script/npm/src/src/models/payout/derivatives/payout.d.ts.map +0 -1
- package/script/npm/src/src/models/payout/derivatives/payout.js +0 -269
- package/script/npm/src/src/models/payout/index.d.ts +0 -7
- package/script/npm/src/src/models/payout/index.d.ts.map +0 -1
- package/script/npm/src/src/models/payout/index.js +0 -22
- package/script/npm/src/src/models/payout/narration.d.ts +0 -164
- package/script/npm/src/src/models/payout/narration.d.ts.map +0 -1
- package/script/npm/src/src/models/payout/narration.js +0 -312
- package/script/npm/src/src/models/payout/schemas.d.ts +0 -156
- package/script/npm/src/src/models/payout/schemas.d.ts.map +0 -1
- package/script/npm/src/src/models/payout/schemas.js +0 -108
- package/script/npm/src/src/models/payout/status.d.ts +0 -33
- package/script/npm/src/src/models/payout/status.d.ts.map +0 -1
- package/script/npm/src/src/models/payout/status.js +0 -37
- package/script/npm/src/src/models/permission.d.ts +0 -55
- package/script/npm/src/src/models/permission.d.ts.map +0 -1
- package/script/npm/src/src/models/permission.js +0 -53
- package/script/npm/src/src/models/role.d.ts.map +0 -1
- package/script/npm/src/src/models/role.js +0 -77
- package/script/npm/src/src/models/user/authenticated-user.d.ts +0 -77
- package/script/npm/src/src/models/user/authenticated-user.d.ts.map +0 -1
- package/script/npm/src/src/models/user/authenticated-user.js +0 -230
- package/script/npm/src/src/models/user/index.d.ts +0 -4
- package/script/npm/src/src/models/user/index.d.ts.map +0 -1
- package/script/npm/src/src/models/user/index.js +0 -19
- package/script/npm/src/src/models/user/managed-user.d.ts +0 -108
- package/script/npm/src/src/models/user/managed-user.d.ts.map +0 -1
- package/script/npm/src/src/models/user/managed-user.js +0 -260
- package/script/npm/src/src/models/user/profile.d.ts.map +0 -1
- package/script/npm/src/src/models/user/profile.js +0 -338
- package/script/npm/src/src/models/wallet/index.d.ts +0 -4
- package/script/npm/src/src/models/wallet/index.d.ts.map +0 -1
- package/script/npm/src/src/models/wallet/index.js +0 -19
- package/script/npm/src/src/models/wallet/schemas.d.ts +0 -95
- package/script/npm/src/src/models/wallet/schemas.d.ts.map +0 -1
- package/script/npm/src/src/models/wallet/schemas.js +0 -38
- package/script/npm/src/src/models/wallet/statement_entry.d.ts +0 -160
- package/script/npm/src/src/models/wallet/statement_entry.d.ts.map +0 -1
- package/script/npm/src/src/models/wallet/statement_entry.js +0 -259
- package/script/npm/src/src/models/wallet/wallet.d.ts.map +0 -1
- package/script/npm/src/src/models/wallet/wallet.js +0 -283
- package/script/npm/src/src/shared/base_repository.d.ts +0 -80
- package/script/npm/src/src/shared/base_repository.d.ts.map +0 -1
- package/script/npm/src/src/shared/base_repository.js +0 -157
- package/script/npm/src/src/shared/common_responses.d.ts.map +0 -1
- package/script/npm/src/src/shared/common_responses.js +0 -13
- package/script/npm/src/src/shared/index.d.ts +0 -3
- package/script/npm/src/src/shared/index.d.ts.map +0 -1
- package/script/npm/src/src/shared/index.js +0 -18
- package/script/npm/src/src/shared/token_required_repository.d.ts +0 -78
- package/script/npm/src/src/shared/token_required_repository.d.ts.map +0 -1
- package/script/npm/src/src/shared/token_required_repository.js +0 -132
- package/script/package.json +0 -3
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import { WalletStatementEntryDTO } from "@/features/wallet/wallet.dtos";
|
|
2
|
+
import { Amount, AmountJson } from "@temboplus/frontend-core";
|
|
3
|
+
import { Narration, NarrationJson } from "./narration.model";
|
|
4
|
+
/**
|
|
5
|
+
* Interface for the JSON representation of WalletStatementEntry
|
|
6
|
+
*/
|
|
7
|
+
export interface WalletStatementEntryJson {
|
|
8
|
+
accountNo?: string;
|
|
9
|
+
debitOrCredit: string;
|
|
10
|
+
tranRefNo: string;
|
|
11
|
+
narration: NarrationJson;
|
|
12
|
+
txnDate: string;
|
|
13
|
+
valueDate: string;
|
|
14
|
+
amountCredited: AmountJson;
|
|
15
|
+
amountDebited: AmountJson;
|
|
16
|
+
balance: AmountJson;
|
|
17
|
+
currencyCode: string;
|
|
18
|
+
version?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Represents a single entry in a Wallet's statement history.
|
|
22
|
+
*
|
|
23
|
+
* This class provides methods for creating, validating, and accessing statement entry data.
|
|
24
|
+
* It integrates with the Zod schema validation for data integrity and includes narration parsing capabilities.
|
|
25
|
+
* The narration field now uses the Narration class for enhanced functionality.
|
|
26
|
+
*/
|
|
27
|
+
export declare class WalletStatementEntry {
|
|
28
|
+
private _accountNo?;
|
|
29
|
+
private _debitOrCredit;
|
|
30
|
+
private _tranRefNo;
|
|
31
|
+
private _narration;
|
|
32
|
+
private _txnDate;
|
|
33
|
+
private _valueDate;
|
|
34
|
+
private _amountCredited;
|
|
35
|
+
private _amountDebited;
|
|
36
|
+
private _balance;
|
|
37
|
+
private _currencyCode;
|
|
38
|
+
/**
|
|
39
|
+
* Gets the statement entry schema used for validation.
|
|
40
|
+
*/
|
|
41
|
+
static get schema(): import("zod").ZodObject<{
|
|
42
|
+
accountNo: import("zod").ZodEffects<import("zod").ZodOptional<import("zod").ZodString>, string | undefined, string | undefined>;
|
|
43
|
+
debitOrCredit: import("zod").ZodString;
|
|
44
|
+
tranRefNo: import("zod").ZodString;
|
|
45
|
+
narration: import("zod").ZodString;
|
|
46
|
+
txnDate: import("zod").ZodDate;
|
|
47
|
+
valueDate: import("zod").ZodDate;
|
|
48
|
+
amountCredited: import("zod").ZodNumber;
|
|
49
|
+
amountDebited: import("zod").ZodNumber;
|
|
50
|
+
balance: import("zod").ZodNumber;
|
|
51
|
+
currencyCode: import("zod").ZodDefault<import("zod").ZodEffects<import("zod").ZodOptional<import("zod").ZodString>, string | undefined, string | undefined>>;
|
|
52
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
53
|
+
currencyCode: string;
|
|
54
|
+
debitOrCredit: string;
|
|
55
|
+
tranRefNo: string;
|
|
56
|
+
narration: string;
|
|
57
|
+
txnDate: Date;
|
|
58
|
+
valueDate: Date;
|
|
59
|
+
amountCredited: number;
|
|
60
|
+
amountDebited: number;
|
|
61
|
+
balance: number;
|
|
62
|
+
accountNo?: string | undefined;
|
|
63
|
+
}, {
|
|
64
|
+
debitOrCredit: string;
|
|
65
|
+
tranRefNo: string;
|
|
66
|
+
narration: string;
|
|
67
|
+
txnDate: Date;
|
|
68
|
+
valueDate: Date;
|
|
69
|
+
amountCredited: number;
|
|
70
|
+
amountDebited: number;
|
|
71
|
+
balance: number;
|
|
72
|
+
accountNo?: string | undefined;
|
|
73
|
+
currencyCode?: string | undefined;
|
|
74
|
+
}>;
|
|
75
|
+
/**
|
|
76
|
+
* Private constructor to enforce use of static factory methods.
|
|
77
|
+
* Assumes data is already validated and dates are Date objects.
|
|
78
|
+
* @param data - Object containing statement entry information conforming to WalletStatementEntryDTO.
|
|
79
|
+
* @param narration - Narration instance for the transaction
|
|
80
|
+
*/
|
|
81
|
+
private constructor();
|
|
82
|
+
/**
|
|
83
|
+
* Creates a new WalletStatementEntry instance after validating the input data.
|
|
84
|
+
* Handles date coercion via the schema and uses currencyCode from the data.
|
|
85
|
+
*
|
|
86
|
+
* @param data - Object containing statement entry information. Dates can be strings or Date objects.
|
|
87
|
+
* @returns A new WalletStatementEntry instance, or undefined if validation fails.
|
|
88
|
+
*/
|
|
89
|
+
static create(data: {
|
|
90
|
+
accountNo?: string | null;
|
|
91
|
+
debitOrCredit: string;
|
|
92
|
+
tranRefNo: string;
|
|
93
|
+
narration: string | Narration;
|
|
94
|
+
txnDate: string | Date;
|
|
95
|
+
valueDate: string | Date;
|
|
96
|
+
amountCredited: number;
|
|
97
|
+
amountDebited: number;
|
|
98
|
+
balance: number;
|
|
99
|
+
currencyCode?: string;
|
|
100
|
+
}): WalletStatementEntry | undefined;
|
|
101
|
+
/**
|
|
102
|
+
* Creates a new WalletStatementEntry with a payout narration using the V2 format.
|
|
103
|
+
* This is a convenience method for creating statement entries for payout transactions.
|
|
104
|
+
*
|
|
105
|
+
* @param data - Statement entry data without narration
|
|
106
|
+
* @param payoutId - Unique payout identifier for generating narration
|
|
107
|
+
* @returns A new WalletStatementEntry instance with generated narration, or undefined if validation fails
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```typescript
|
|
111
|
+
* const entry = WalletStatementEntry.createWithPayoutNarration({
|
|
112
|
+
* debitOrCredit: "DEBIT",
|
|
113
|
+
* tranRefNo: "TXN-12345",
|
|
114
|
+
* txnDate: new Date(),
|
|
115
|
+
* valueDate: new Date(),
|
|
116
|
+
* amountDebited: 50000,
|
|
117
|
+
* amountCredited: 0,
|
|
118
|
+
* balance: 450000,
|
|
119
|
+
* currencyCode: "TZS"
|
|
120
|
+
* }, "AF-2024-001234");
|
|
121
|
+
* // Creates entry with narration: "TEMBO-DISB #AF-2024-001234"
|
|
122
|
+
* ```
|
|
123
|
+
*/
|
|
124
|
+
static createWithPayoutNarration(data: {
|
|
125
|
+
accountNo?: string | null;
|
|
126
|
+
debitOrCredit: string;
|
|
127
|
+
tranRefNo: string;
|
|
128
|
+
txnDate: string | Date;
|
|
129
|
+
valueDate: string | Date;
|
|
130
|
+
amountCredited: number;
|
|
131
|
+
amountDebited: number;
|
|
132
|
+
balance: number;
|
|
133
|
+
currencyCode?: string;
|
|
134
|
+
}, payoutId: string): WalletStatementEntry | undefined;
|
|
135
|
+
get accountNo(): string | undefined;
|
|
136
|
+
get debitOrCredit(): string;
|
|
137
|
+
get tranRefNo(): string;
|
|
138
|
+
get narration(): Narration;
|
|
139
|
+
get txnDate(): Date;
|
|
140
|
+
get valueDate(): Date;
|
|
141
|
+
get amountCredited(): Amount;
|
|
142
|
+
get amountDebited(): Amount;
|
|
143
|
+
get balance(): Amount;
|
|
144
|
+
get currencyCode(): string;
|
|
145
|
+
/**
|
|
146
|
+
* Gets the payout ID from the narration if it's a V2 format payout narration.
|
|
147
|
+
* This is a convenience method that delegates to the narration instance.
|
|
148
|
+
*
|
|
149
|
+
* @returns The payout ID if available, undefined otherwise
|
|
150
|
+
*/
|
|
151
|
+
get payoutId(): string | undefined;
|
|
152
|
+
/**
|
|
153
|
+
* Checks if this statement entry represents a payout transaction.
|
|
154
|
+
* Determined by checking if the narration contains a payout ID.
|
|
155
|
+
*
|
|
156
|
+
* @returns True if this is a payout transaction, false otherwise
|
|
157
|
+
*/
|
|
158
|
+
get isPayout(): boolean;
|
|
159
|
+
/**
|
|
160
|
+
* Serializes the WalletStatementEntry instance to a JSON-compatible object.
|
|
161
|
+
* Dates are converted to ISO strings, amounts are serialized using Amount.toJson(),
|
|
162
|
+
* and narration is serialized using Narration.toJson().
|
|
163
|
+
*
|
|
164
|
+
* @returns {WalletStatementEntryJson} A plain object containing all necessary data
|
|
165
|
+
*/
|
|
166
|
+
toJson(): WalletStatementEntryJson;
|
|
167
|
+
/**
|
|
168
|
+
* Creates a WalletStatementEntry instance from a JSON-compatible object.
|
|
169
|
+
*
|
|
170
|
+
* @param {WalletStatementEntryJson | string} json - Either a WalletStatementEntryJson object or a JSON string
|
|
171
|
+
* @returns {WalletStatementEntry | undefined} A WalletStatementEntry instance if valid, undefined otherwise
|
|
172
|
+
*/
|
|
173
|
+
static fromJson(json: WalletStatementEntryJson | string): WalletStatementEntry | undefined;
|
|
174
|
+
/**
|
|
175
|
+
* Type guard to check if an object is a valid WalletStatementEntryJson
|
|
176
|
+
*
|
|
177
|
+
* @param obj - The object to validate
|
|
178
|
+
* @returns True if the object conforms to WalletStatementEntryJson structure
|
|
179
|
+
*/
|
|
180
|
+
static isWalletStatementEntryJson(obj: unknown): obj is WalletStatementEntryJson;
|
|
181
|
+
/**
|
|
182
|
+
* Validates the current statement entry instance data against the schema.
|
|
183
|
+
* @returns True if the statement entry instance data is valid, false otherwise.
|
|
184
|
+
*/
|
|
185
|
+
validate(): boolean;
|
|
186
|
+
/**
|
|
187
|
+
* Type guard to check if an unknown object is a valid WalletStatementEntry instance.
|
|
188
|
+
* Performs structural checks (duck typing).
|
|
189
|
+
* @param obj - The object to check.
|
|
190
|
+
* @returns Type predicate indicating if the object is a WalletStatementEntry instance.
|
|
191
|
+
*/
|
|
192
|
+
static is(obj: unknown): obj is WalletStatementEntry;
|
|
193
|
+
/**
|
|
194
|
+
* Checks if two WalletStatementEntry instances are equal based on their transaction reference numbers.
|
|
195
|
+
* @param other - Another WalletStatementEntry to compare with.
|
|
196
|
+
* @returns True if both entries have the same transaction reference number.
|
|
197
|
+
*/
|
|
198
|
+
equals(other: WalletStatementEntry): boolean;
|
|
199
|
+
/**
|
|
200
|
+
* Creates a copy of this WalletStatementEntry with the same data.
|
|
201
|
+
* @returns A new WalletStatementEntry instance with identical data.
|
|
202
|
+
*/
|
|
203
|
+
clone(): WalletStatementEntry | undefined;
|
|
204
|
+
/**
|
|
205
|
+
* Returns a string representation of the statement entry for debugging.
|
|
206
|
+
* @returns A formatted string with key transaction details.
|
|
207
|
+
*/
|
|
208
|
+
toString(): string;
|
|
209
|
+
/**
|
|
210
|
+
* Serializes an array of WalletStatementEntry instances to JSON-compatible objects
|
|
211
|
+
*
|
|
212
|
+
* @param entries - Array of WalletStatementEntry instances to serialize
|
|
213
|
+
* @returns Array of WalletStatementEntryJson objects
|
|
214
|
+
*/
|
|
215
|
+
static toJsonArray(entries: WalletStatementEntry[]): WalletStatementEntryJson[];
|
|
216
|
+
/**
|
|
217
|
+
* Creates WalletStatementEntry instances from an array of JSON-compatible objects
|
|
218
|
+
*
|
|
219
|
+
* @param jsonArray - Array of WalletStatementEntryJson objects or JSON string
|
|
220
|
+
* @returns Array of WalletStatementEntry instances (invalid items are filtered out)
|
|
221
|
+
*/
|
|
222
|
+
static fromJsonArray(jsonArray: WalletStatementEntryJson[] | string): WalletStatementEntry[];
|
|
223
|
+
/**
|
|
224
|
+
* Legacy method for backwards compatibility - creates object representation
|
|
225
|
+
* @deprecated Use toJson() instead for proper serialization
|
|
226
|
+
*/
|
|
227
|
+
toObject(): Omit<WalletStatementEntryDTO, "amountCredited" | "amountDebited" | "balance" | "narration"> & {
|
|
228
|
+
amountCredited: AmountJson;
|
|
229
|
+
amountDebited: AmountJson;
|
|
230
|
+
balance: AmountJson;
|
|
231
|
+
narration: string;
|
|
232
|
+
};
|
|
233
|
+
/**
|
|
234
|
+
* Legacy method for backwards compatibility - converts to JSON string
|
|
235
|
+
* @deprecated Use JSON.stringify(entry.toJson()) instead
|
|
236
|
+
*/
|
|
237
|
+
toJSON(): string;
|
|
238
|
+
/**
|
|
239
|
+
* Legacy method for backwards compatibility
|
|
240
|
+
* @deprecated Use fromJson() instead
|
|
241
|
+
*/
|
|
242
|
+
static fromJSON(jsonString: string): WalletStatementEntry | undefined;
|
|
243
|
+
/**
|
|
244
|
+
* Legacy method for backwards compatibility - creates from plain object
|
|
245
|
+
* @deprecated Use fromJson() for serialized data or create() for raw data
|
|
246
|
+
*/
|
|
247
|
+
static from(data: any): WalletStatementEntry | undefined;
|
|
248
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Profile } from "./profile.model";
|
|
2
|
+
/**
|
|
3
|
+
* Represents a user in Afloat.
|
|
4
|
+
*
|
|
5
|
+
* This class centralizes user-related logic, simplifying interaction
|
|
6
|
+
* with user-related data and ensuring consistent access checks across the application.
|
|
7
|
+
*/
|
|
8
|
+
export declare class User {
|
|
9
|
+
/**
|
|
10
|
+
* Logged-in user name.
|
|
11
|
+
*/
|
|
12
|
+
name: string;
|
|
13
|
+
/**
|
|
14
|
+
* Logged-in identity: phone number or email address.
|
|
15
|
+
*/
|
|
16
|
+
identity: string;
|
|
17
|
+
/**
|
|
18
|
+
* The user's Afloat profile.
|
|
19
|
+
*/
|
|
20
|
+
profile: Profile;
|
|
21
|
+
/**
|
|
22
|
+
* The user's authentication token.
|
|
23
|
+
*/
|
|
24
|
+
token: string;
|
|
25
|
+
/**
|
|
26
|
+
* Indicates whether the user must change their default password.
|
|
27
|
+
*/
|
|
28
|
+
resetPassword: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* A list of granted access keys (permissions).
|
|
31
|
+
*/
|
|
32
|
+
access: string[];
|
|
33
|
+
/**
|
|
34
|
+
* A map of access keys to boolean values for fast permission checks.
|
|
35
|
+
*/
|
|
36
|
+
private accessMap;
|
|
37
|
+
/**
|
|
38
|
+
* Creates a new `User` instance.
|
|
39
|
+
*/
|
|
40
|
+
private constructor();
|
|
41
|
+
/**
|
|
42
|
+
* Checks if the user has a specific access permission.
|
|
43
|
+
*
|
|
44
|
+
* @param key - The access key to check.
|
|
45
|
+
* @returns `true` if the user has the specified access, otherwise `false`.
|
|
46
|
+
*/
|
|
47
|
+
can(key: string): boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Returns a plain object representation of the user.
|
|
50
|
+
* This can safely be embedded in a JWT payload.
|
|
51
|
+
*/
|
|
52
|
+
toObject(): Record<string, any>;
|
|
53
|
+
/**
|
|
54
|
+
* Serializes the `User` instance to a JSON string.
|
|
55
|
+
*/
|
|
56
|
+
toJSON(): string;
|
|
57
|
+
/**
|
|
58
|
+
* Creates a new `User` instance from a JSON string.
|
|
59
|
+
*/
|
|
60
|
+
static fromJSON(jsonString: string): User | undefined;
|
|
61
|
+
/**
|
|
62
|
+
* Creates a new `User` instance from a plain object.
|
|
63
|
+
*/
|
|
64
|
+
static from(data: any): User | undefined;
|
|
65
|
+
}
|
|
@@ -1,46 +1,5 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
1
|
import { type CurrencyCode, type ISO2CountryCode } from "@temboplus/frontend-core";
|
|
3
|
-
|
|
4
|
-
* Zod schema definition for validating Wallet data structures.
|
|
5
|
-
* Ensures data integrity for wallet objects, including runtime validation
|
|
6
|
-
* of country codes against the imported ISO2CountryCodesSet.
|
|
7
|
-
*/
|
|
8
|
-
declare const walletSchema: z.ZodObject<{
|
|
9
|
-
id: z.ZodString;
|
|
10
|
-
profileId: z.ZodString;
|
|
11
|
-
accountNo: z.ZodString;
|
|
12
|
-
accountName: z.ZodString;
|
|
13
|
-
channel: z.ZodString;
|
|
14
|
-
countryCode: z.ZodEffects<z.ZodDefault<z.ZodString>, string, string | undefined>;
|
|
15
|
-
currencyCode: z.ZodEffects<z.ZodDefault<z.ZodString>, string, string | undefined>;
|
|
16
|
-
createdAt: z.ZodString;
|
|
17
|
-
updatedAt: z.ZodString;
|
|
18
|
-
}, "strip", z.ZodTypeAny, {
|
|
19
|
-
id: string;
|
|
20
|
-
accountNo: string;
|
|
21
|
-
channel: string;
|
|
22
|
-
profileId: string;
|
|
23
|
-
createdAt: string;
|
|
24
|
-
updatedAt: string;
|
|
25
|
-
accountName: string;
|
|
26
|
-
countryCode: string;
|
|
27
|
-
currencyCode: string;
|
|
28
|
-
}, {
|
|
29
|
-
id: string;
|
|
30
|
-
accountNo: string;
|
|
31
|
-
channel: string;
|
|
32
|
-
profileId: string;
|
|
33
|
-
createdAt: string;
|
|
34
|
-
updatedAt: string;
|
|
35
|
-
accountName: string;
|
|
36
|
-
countryCode?: string | undefined;
|
|
37
|
-
currencyCode?: string | undefined;
|
|
38
|
-
}>;
|
|
39
|
-
/**
|
|
40
|
-
* TypeScript type representing the validated data structure for a Wallet.
|
|
41
|
-
* Derived from the walletSchema. Note: countryCode is inferred as string.
|
|
42
|
-
*/
|
|
43
|
-
type WalletDataType = z.infer<typeof walletSchema>;
|
|
2
|
+
import { WalletDTO, WalletDTOSchemas } from "@/features/wallet/wallet.dtos";
|
|
44
3
|
/**
|
|
45
4
|
* Represents a digital Wallet entity.
|
|
46
5
|
*
|
|
@@ -61,7 +20,7 @@ export declare class Wallet {
|
|
|
61
20
|
* Retrieves the Zod schema used for Wallet validation.
|
|
62
21
|
* @returns The Zod schema object for Wallet.
|
|
63
22
|
*/
|
|
64
|
-
static get schema(): typeof
|
|
23
|
+
static get schema(): typeof WalletDTOSchemas.walletDTO;
|
|
65
24
|
/**
|
|
66
25
|
* Private constructor enforces instantiation via static factory methods.
|
|
67
26
|
* @param data - The validated wallet data object (countryCode is string).
|
|
@@ -109,7 +68,7 @@ export declare class Wallet {
|
|
|
109
68
|
* Suitable for serialization or validation.
|
|
110
69
|
* @returns A plain object conforming to the WalletDataType structure.
|
|
111
70
|
*/
|
|
112
|
-
toObject():
|
|
71
|
+
toObject(): WalletDTO;
|
|
113
72
|
/**
|
|
114
73
|
* Serializes the Wallet instance into a JSON string.
|
|
115
74
|
* @returns A JSON string representation of the wallet data.
|
|
@@ -143,5 +102,3 @@ export declare class Wallet {
|
|
|
143
102
|
*/
|
|
144
103
|
static is(obj: unknown): obj is Wallet;
|
|
145
104
|
}
|
|
146
|
-
export {};
|
|
147
|
-
//# sourceMappingURL=wallet.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,38 +1,61 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@temboplus/afloat",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "A
|
|
3
|
+
"version": "0.1.63",
|
|
4
|
+
"description": "A foundational library for Temboplus-Afloat projects.",
|
|
5
|
+
"main": "./dist/index.cjs.js",
|
|
6
|
+
"module": "./dist/index.esm.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/index.esm.js",
|
|
12
|
+
"require": "./dist/index.cjs.js",
|
|
13
|
+
"types": "./dist/index.d.ts"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "rollup -c rollup.config.js",
|
|
21
|
+
"prepare": "npm run build",
|
|
22
|
+
"dev": "npm run build -- --watch",
|
|
23
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
24
|
+
},
|
|
5
25
|
"repository": {
|
|
6
26
|
"type": "git",
|
|
7
|
-
"url": "git+https://github.com/TemboPlus-Frontend/afloat-js"
|
|
27
|
+
"url": "git+https://github.com/TemboPlus-Frontend/afloat-js.git"
|
|
8
28
|
},
|
|
29
|
+
"keywords": [
|
|
30
|
+
"temboplus",
|
|
31
|
+
"afloat"
|
|
32
|
+
],
|
|
33
|
+
"author": "Okello Gerald",
|
|
9
34
|
"license": "MIT",
|
|
10
35
|
"bugs": {
|
|
11
36
|
"url": "https://github.com/TemboPlus-Frontend/afloat-js/issues"
|
|
12
37
|
},
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
".": {
|
|
17
|
-
"import": "./esm/mod.js",
|
|
18
|
-
"require": "./script/mod.js"
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
"scripts": {
|
|
22
|
-
"test": "node test_runner.js"
|
|
23
|
-
},
|
|
24
|
-
"private": false,
|
|
25
|
-
"dependencies": {
|
|
26
|
-
"@temboplus/frontend-core": "^0.2.9",
|
|
38
|
+
"homepage": "https://github.com/TemboPlus-Frontend/afloat-js#readme",
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"@temboplus/frontend-core": "^0.2.11",
|
|
27
41
|
"@ts-rest/core": "^3.52.1",
|
|
28
|
-
"
|
|
42
|
+
"tslib": "^2.8.1",
|
|
29
43
|
"uuid": "^11.1.0",
|
|
30
44
|
"zod": "^3.24.2",
|
|
31
|
-
"zustand": "^5.
|
|
45
|
+
"zustand": "^4.5.7"
|
|
32
46
|
},
|
|
33
47
|
"devDependencies": {
|
|
34
|
-
"@
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
48
|
+
"@rollup/plugin-alias": "^5.1.1",
|
|
49
|
+
"@rollup/plugin-commonjs": "^28.0.3",
|
|
50
|
+
"@rollup/plugin-json": "^6.1.0",
|
|
51
|
+
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
52
|
+
"@rollup/plugin-terser": "^0.4.4",
|
|
53
|
+
"@rollup/plugin-typescript": "^12.1.3",
|
|
54
|
+
"@types/jest": "^29.5.14",
|
|
55
|
+
"jest": "^29.7.0",
|
|
56
|
+
"rollup": "^4.39.0",
|
|
57
|
+
"ts-jest": "^29.3.1",
|
|
58
|
+
"ts-node": "^10.9.2",
|
|
59
|
+
"typescript": "^5.8.3"
|
|
60
|
+
}
|
|
61
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
Copyright (c) 2025 TemboPlus Inc.
|
|
2
|
-
|
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
-
|
|
5
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
-
|
|
7
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/esm/mod.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export * from "./src/features/auth/index.js";
|
|
2
|
-
export * from "./src/features/contact/index.js";
|
|
3
|
-
export * from "./src/features/wallet/index.js";
|
|
4
|
-
export * from "./src/features/payout/index.js";
|
|
5
|
-
export * from "./src/features/admin/index.js";
|
|
6
|
-
export * from "./src/errors/index.js";
|
|
7
|
-
export * from "./src/models/index.js";
|
|
8
|
-
//# sourceMappingURL=mod.d.ts.map
|
package/esm/mod.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,+BAA+B,CAAC;AAE9C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC"}
|
package/esm/mod.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export * from "./src/features/auth/index.js";
|
|
2
|
-
export * from "./src/features/contact/index.js";
|
|
3
|
-
export * from "./src/features/wallet/index.js";
|
|
4
|
-
export * from "./src/features/payout/index.js";
|
|
5
|
-
export * from "./src/features/admin/index.js";
|
|
6
|
-
export * from "./src/errors/index.js";
|
|
7
|
-
export * from "./src/models/index.js";
|
package/esm/package.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api_error.d.ts","sourceRoot":"","sources":["../../../src/src/errors/api_error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,qBAAa,QAAS,SAAQ,KAAK;IACjC;;;OAGG;IACH,SAAgB,UAAU,EAAE,MAAM,CAAC;IAEnC;;;OAGG;IACH,SAAgB,KAAK,CAAC,EAAE,MAAM,CAAC;IAE/B;;;OAGG;IACH,SAAgB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAElD;;;;;;;OAOG;gBACS,IAAI,EAAE;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACnC;IASD;;;;;;;;;;;;;;;;;OAiBG;WACW,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ;WAKrC,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,QAAQ;IAOjD,WAAkB,MAAM,IAAI,CAAC,CAAC,SAAS,CAAC;QACtC,OAAO,EAAE,CAAC,CAAC,SAAS,CAAC;QACrB,UAAU,EAAE,CAAC,CAAC,SAAS,CAAC;QACxB,KAAK,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QAClC,OAAO,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;KACxC,CAAC,CAOD;CACF"}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
/**
|
|
3
|
-
* Custom error class representing API-related errors.
|
|
4
|
-
* Extends the built-in `Error` class to include additional properties such as `statusCode`, `error`, and `details`.
|
|
5
|
-
*/
|
|
6
|
-
export class APIError extends Error {
|
|
7
|
-
/**
|
|
8
|
-
* Creates a new `APIError` instance.
|
|
9
|
-
* @param {Object} args - The arguments to initialize the error.
|
|
10
|
-
* @param {string} args.message - The error message.
|
|
11
|
-
* @param {number} args.statusCode - The HTTP status code associated with the error.
|
|
12
|
-
* @param {string} [args.error] - An optional error identifier or code.
|
|
13
|
-
* @param {Record<string, unknown>} [args.details] - Additional details about the error.
|
|
14
|
-
*/
|
|
15
|
-
constructor(args) {
|
|
16
|
-
super(args.message);
|
|
17
|
-
/**
|
|
18
|
-
* The HTTP status code associated with the error.
|
|
19
|
-
* @type {number}
|
|
20
|
-
*/
|
|
21
|
-
Object.defineProperty(this, "statusCode", {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
configurable: true,
|
|
24
|
-
writable: true,
|
|
25
|
-
value: void 0
|
|
26
|
-
});
|
|
27
|
-
/**
|
|
28
|
-
* An optional error identifier or code.
|
|
29
|
-
* @type {string | undefined}
|
|
30
|
-
*/
|
|
31
|
-
Object.defineProperty(this, "error", {
|
|
32
|
-
enumerable: true,
|
|
33
|
-
configurable: true,
|
|
34
|
-
writable: true,
|
|
35
|
-
value: void 0
|
|
36
|
-
});
|
|
37
|
-
/**
|
|
38
|
-
* Additional details about the error, often used for debugging purposes.
|
|
39
|
-
* @type {Record<string, unknown> | undefined}
|
|
40
|
-
*/
|
|
41
|
-
Object.defineProperty(this, "details", {
|
|
42
|
-
enumerable: true,
|
|
43
|
-
configurable: true,
|
|
44
|
-
writable: true,
|
|
45
|
-
value: void 0
|
|
46
|
-
});
|
|
47
|
-
this.name = "ApiError";
|
|
48
|
-
this.statusCode = args.statusCode;
|
|
49
|
-
if (this.error)
|
|
50
|
-
this.error = args.error;
|
|
51
|
-
if (args.details)
|
|
52
|
-
this.details = args.details;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Validates whether an unknown value conforms to the APIError schema.
|
|
56
|
-
* This is more thorough than an instanceof check as it verifies all required properties
|
|
57
|
-
* and their types using the defined schema.
|
|
58
|
-
*
|
|
59
|
-
* @param {unknown} error - Any value to be validated
|
|
60
|
-
* @returns {error is APIError} Type predicate indicating if the value is a valid APIError
|
|
61
|
-
*
|
|
62
|
-
* @example
|
|
63
|
-
* try {
|
|
64
|
-
* throw new Error('Network failed');
|
|
65
|
-
* } catch (err) {
|
|
66
|
-
* if (APIError.is(err)) {
|
|
67
|
-
* // err is typed as APIError here
|
|
68
|
-
* console.log(err.statusCode);
|
|
69
|
-
* }
|
|
70
|
-
* }
|
|
71
|
-
*/
|
|
72
|
-
static is(error) {
|
|
73
|
-
const result = APIError.schema.safeParse(error);
|
|
74
|
-
return result.success;
|
|
75
|
-
}
|
|
76
|
-
static unknown(message) {
|
|
77
|
-
return new APIError({
|
|
78
|
-
message: message ?? "An unknown error occurred",
|
|
79
|
-
statusCode: 502,
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
static get schema() {
|
|
83
|
-
return z.object({
|
|
84
|
-
message: z.string(),
|
|
85
|
-
statusCode: z.number().int(),
|
|
86
|
-
error: z.string().optional(),
|
|
87
|
-
details: z.object({}).optional(),
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/errors/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC"}
|
package/esm/src/errors/index.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { type Permission } from "../models/permission.js";
|
|
2
|
-
/**
|
|
3
|
-
* Custom error class representing an error caused by missing required permissions.
|
|
4
|
-
* Extends the built-in {@link Error} class to include the `requiredPermissions` property.
|
|
5
|
-
*/
|
|
6
|
-
export declare class PermissionError extends Error {
|
|
7
|
-
/**
|
|
8
|
-
* The permissions that are required but were not present, causing the error.
|
|
9
|
-
* @type {Permission[]}
|
|
10
|
-
*/
|
|
11
|
-
readonly requiredPermissions: Permission[];
|
|
12
|
-
/**
|
|
13
|
-
* Creates a new `PermissionError` instance.
|
|
14
|
-
* @param {Object} args - The constructor arguments.
|
|
15
|
-
* @param {Permission[]} args.requiredPermissions - An array of permissions required for the operation.
|
|
16
|
-
* @param {string} [args.message] - An optional custom error message. Defaults to listing the missing permissions.
|
|
17
|
-
*/
|
|
18
|
-
constructor(args: {
|
|
19
|
-
requiredPermissions: Permission[];
|
|
20
|
-
message?: string;
|
|
21
|
-
});
|
|
22
|
-
/**
|
|
23
|
-
* Validates if an unknown value is a valid PermissionError instance.
|
|
24
|
-
* Performs structural validation of the error object and its properties.
|
|
25
|
-
*
|
|
26
|
-
* @param {unknown} error - The value to validate.
|
|
27
|
-
* @returns {error is PermissionError} Type predicate indicating if the value is a valid PermissionError.
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* try {
|
|
31
|
-
* throw new Error('Access denied');
|
|
32
|
-
* } catch (error) {
|
|
33
|
-
* if (PermissionError.is(error)) {
|
|
34
|
-
* // error is typed as PermissionError with properly typed requiredPermissions
|
|
35
|
-
* console.log(error.requiredPermissions);
|
|
36
|
-
* }
|
|
37
|
-
* }
|
|
38
|
-
*
|
|
39
|
-
* @remarks
|
|
40
|
-
* Validates the following:
|
|
41
|
-
* - Has all required Error properties
|
|
42
|
-
* - Has correct error name
|
|
43
|
-
* - Contains properly structured requiredPermissions array
|
|
44
|
-
* - Maintains proper prototype chain
|
|
45
|
-
*/
|
|
46
|
-
static is(error: unknown): error is PermissionError;
|
|
47
|
-
}
|
|
48
|
-
//# sourceMappingURL=permission_error.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"permission_error.d.ts","sourceRoot":"","sources":["../../../src/src/errors/permission_error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAe,MAAM,yBAAyB,CAAC;AAGvE;;;GAGG;AACH,qBAAa,eAAgB,SAAQ,KAAK;IACxC;;;OAGG;IACH,SAAgB,mBAAmB,EAAE,UAAU,EAAE,CAAC;IAElD;;;;;OAKG;gBACS,IAAI,EAAE;QAChB,mBAAmB,EAAE,UAAU,EAAE,CAAC;QAClC,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB;IASD;;;;;;;;;;;;;;;;;;;;;;;OAuBG;WACW,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,eAAe;CAkB3D"}
|