@temboplus/afloat 0.1.81 → 0.2.0-beta.2
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/dist/index.cjs.js +2 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.esm.js +2 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/lib/api/base-repository.d.ts +177 -0
- package/dist/lib/api/index.d.ts +1 -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/lib/query/index.d.ts +4 -0
- package/dist/lib/query/pagination/pagination.d.ts +73 -0
- package/dist/lib/query/pagination/pagination.schemas.d.ts +83 -0
- package/dist/lib/query/query.builder.d.ts +75 -0
- package/dist/lib/query/query.types.d.ts +36 -0
- package/{esm/src/features/auth/contract.d.ts → dist/modules/auth/auth.contract.d.ts} +16 -19
- package/dist/modules/auth/auth.repository.d.ts +83 -0
- package/dist/modules/auth/company-membership.model.d.ts +171 -0
- package/dist/modules/auth/index.d.ts +3 -0
- package/dist/modules/auth/user.model.d.ts +363 -0
- package/dist/modules/beneficiary/beneficiary-info.model.d.ts +178 -0
- package/dist/modules/beneficiary/beneficiary-input-handler.d.ts +16 -0
- package/dist/modules/beneficiary/beneficiary.api-contract.d.ts +203 -0
- package/dist/modules/beneficiary/beneficiary.dtos.d.ts +84 -0
- package/dist/modules/beneficiary/beneficiary.model.d.ts +441 -0
- package/dist/modules/beneficiary/beneficiary.repository.d.ts +116 -0
- package/dist/modules/beneficiary/index.d.ts +6 -0
- package/dist/modules/login/index.d.ts +4 -0
- package/dist/modules/login/login.api-contract.d.ts +51 -0
- package/dist/modules/login/login.dtos.d.ts +85 -0
- package/dist/modules/login/login.model.d.ts +168 -0
- package/dist/modules/login/login.repository.d.ts +58 -0
- package/{esm/src/models/permission.d.ts → dist/modules/login/permission.type.d.ts} +9 -10
- package/dist/modules/payout/index.d.ts +5 -0
- package/dist/modules/payout/payout-channel-handler.d.ts +82 -0
- package/{esm/src/features/payout/contract.d.ts → dist/modules/payout/payout.api-contract.d.ts} +350 -207
- package/dist/modules/payout/payout.dtos.d.ts +607 -0
- package/dist/modules/payout/payout.model.d.ts +383 -0
- package/dist/modules/payout/payout.query.d.ts +134 -0
- package/dist/modules/payout/payout.repository.d.ts +204 -0
- package/dist/modules/profile/index.d.ts +3 -0
- package/{script/npm/src/src/features/auth/profile/contract.d.ts → dist/modules/profile/profile.api-contract.d.ts} +8 -6
- package/dist/modules/profile/profile.dtos.d.ts +80 -0
- package/{script/npm/src/src/models/user/profile.d.ts → dist/modules/profile/profile.model.d.ts} +81 -52
- package/dist/modules/profile/profile.repository.d.ts +56 -0
- package/dist/modules/team-member/index.d.ts +4 -0
- package/dist/modules/team-member/role.model.d.ts +61 -0
- package/{esm/src/features/admin/contract.d.ts → dist/modules/team-member/team-member.contract.d.ts} +229 -154
- package/dist/modules/team-member/team-member.dtos.d.ts +261 -0
- package/dist/modules/team-member/team-member.model.d.ts +237 -0
- package/dist/modules/team-member/team-member.repository.d.ts +179 -0
- package/dist/modules/wallet/index.d.ts +6 -0
- package/dist/modules/wallet/narration.model.d.ts +225 -0
- package/dist/modules/wallet/statement-entry.model.d.ts +299 -0
- package/{script/npm/src/src/features/wallet/contract.d.ts → dist/modules/wallet/wallet.contract.d.ts} +17 -15
- package/dist/modules/wallet/wallet.dtos.d.ts +204 -0
- package/{esm/src/models/wallet/wallet.d.ts → dist/modules/wallet/wallet.model.d.ts} +34 -40
- package/dist/modules/wallet/wallet.query.d.ts +95 -0
- package/dist/modules/wallet/wallet.repository.d.ts +205 -0
- package/dist/modules/wallet/wallet.utils.d.ts +17 -0
- package/package.json +49 -23
- 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 +0 -14
- 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 +0 -32
- 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 +0 -170
- 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 -179
- 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 -271
- 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 +0 -108
- 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.map +0 -1
- package/esm/src/models/wallet/wallet.js +0 -279
- package/esm/src/shared/base_repository.d.ts +0 -80
- 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 +0 -146
- 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 +0 -23
- 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 +0 -30
- 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 +0 -42
- 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 -183
- 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 +0 -172
- 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 +0 -158
- 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 -275
- 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 +0 -21
- 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 +0 -147
- 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 +0 -13
- 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
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { BaseRepository } from "../../shared/base_repository.js";
|
|
2
|
-
import { userManagementContract } from "./contract.js";
|
|
3
|
-
import type { CreateUserRequest, CreateUserResponse, ManagedUserQueryParams, ResetPasswordRequest, UpdateUserRequest } from "./schemas.js";
|
|
4
|
-
import type { AfloatAuth } from "../auth/manager.js";
|
|
5
|
-
import { ManagedUser } from "../../models/index.js";
|
|
6
|
-
import { Role } from "../../models/role.js";
|
|
7
|
-
/**
|
|
8
|
-
* Repository class for managing user accounts through API interactions.
|
|
9
|
-
* Extends the `BaseRepository` to leverage shared functionality.
|
|
10
|
-
*/
|
|
11
|
-
export declare class UserManagementRepository extends BaseRepository<typeof userManagementContract> {
|
|
12
|
-
/**
|
|
13
|
-
* Creates an instance of `UserManagementRepository` using the user management contract.
|
|
14
|
-
* @param {Object} [props] - Optional constructor properties
|
|
15
|
-
* @param {AfloatAuth} [props.auth] - Optional auth instance to use
|
|
16
|
-
* @param {string} [props.root] - Optional API root URL
|
|
17
|
-
*/
|
|
18
|
-
constructor(props?: {
|
|
19
|
-
auth?: AfloatAuth;
|
|
20
|
-
root?: string;
|
|
21
|
-
});
|
|
22
|
-
/**
|
|
23
|
-
* Creates a new user account.
|
|
24
|
-
* @param {CreateUserRequest} input - The data required to create a new user account.
|
|
25
|
-
* @returns {Promise<CreateUserResponse>} A promise that resolves to the newly created user response.
|
|
26
|
-
* @throws {PermissionError} If the user lacks required permissions
|
|
27
|
-
* @throws {APIError} If the response status code is not 201.
|
|
28
|
-
*/
|
|
29
|
-
createUser(input: CreateUserRequest): Promise<CreateUserResponse>;
|
|
30
|
-
/**
|
|
31
|
-
* Updates an existing user account by ID.
|
|
32
|
-
* @param {string} id - The unique identifier of the user account to update.
|
|
33
|
-
* @param {UpdateUserRequest} input - The data to update the user account with.
|
|
34
|
-
* @returns {Promise<ManagedUser>} A promise that resolves to the updated user account.
|
|
35
|
-
* @throws {PermissionError} If the user lacks required permissions
|
|
36
|
-
* @throws {APIError} If the response status code is not 200.
|
|
37
|
-
*/
|
|
38
|
-
updateUser(id: string, input: UpdateUserRequest): Promise<ManagedUser>;
|
|
39
|
-
/**
|
|
40
|
-
* Archives (soft deletes) a user account by ID.
|
|
41
|
-
* @param {string} id - The unique identifier of the user account to archive.
|
|
42
|
-
* @returns {Promise<ManagedUser>} A promise with the updated user object.
|
|
43
|
-
* @throws {PermissionError} If the user lacks required permissions
|
|
44
|
-
* @throws {APIError} If the response status code is not 200.
|
|
45
|
-
*/
|
|
46
|
-
archiveUser(id: string): Promise<ManagedUser>;
|
|
47
|
-
/**
|
|
48
|
-
* Archives (soft deletes) a user account by ID.
|
|
49
|
-
* @param {string} id - The unique identifier of the user account to archive.
|
|
50
|
-
* @returns {Promise<ManagedUser>} A promise with the updated user object.
|
|
51
|
-
* @throws {PermissionError} If the user lacks required permissions
|
|
52
|
-
* @throws {APIError} If the response status code is not 200.
|
|
53
|
-
*/
|
|
54
|
-
unArchiveUser(id: string): Promise<ManagedUser>;
|
|
55
|
-
/**
|
|
56
|
-
* Resets a user's password.
|
|
57
|
-
* @param {string} id - The unique identifier of the user account.
|
|
58
|
-
* @param {ResetPasswordRequest} [input] - Optional password reset configuration.
|
|
59
|
-
* @returns {Promise<void>} A promise that resolves when the password reset is complete.
|
|
60
|
-
* @throws {PermissionError} If the user lacks required permissions
|
|
61
|
-
* @throws {APIError} If the response status code is not 200.
|
|
62
|
-
*/
|
|
63
|
-
resetUserPassword(id: string, input?: ResetPasswordRequest): Promise<{
|
|
64
|
-
success: boolean;
|
|
65
|
-
}>;
|
|
66
|
-
/**
|
|
67
|
-
* Retrieves all user accounts.
|
|
68
|
-
* Results are ordered in descending order by creation date by default.
|
|
69
|
-
*
|
|
70
|
-
* @returns {Promise<ManagedUser[]>} A promise that resolves to an array of managed users.
|
|
71
|
-
* @throws {PermissionError} If the user lacks required permissions
|
|
72
|
-
* @throws {APIError} If the response status code is not 200.
|
|
73
|
-
* @example
|
|
74
|
-
* const repository = new UserManagementRepository();
|
|
75
|
-
* repository.getAllUsers().then(users => console.log(users));
|
|
76
|
-
*/
|
|
77
|
-
getAllUsers(query?: ManagedUserQueryParams): Promise<ManagedUser[]>;
|
|
78
|
-
/**
|
|
79
|
-
* Retrieves a specific user account by ID.
|
|
80
|
-
*
|
|
81
|
-
* @param {string} id - The unique identifier of the user account to retrieve.
|
|
82
|
-
* @returns {Promise<ManagedUser>} A promise that resolves to the managed user.
|
|
83
|
-
* @throws {PermissionError} If the user lacks required permissions
|
|
84
|
-
* @throws {APIError} If the response status code is not 200 or user not found.
|
|
85
|
-
* @example
|
|
86
|
-
* const repository = new UserManagementRepository();
|
|
87
|
-
* repository.getUser('user-id').then(user => console.log(user));
|
|
88
|
-
*/
|
|
89
|
-
getUser(id: string, query?: ManagedUserQueryParams): Promise<ManagedUser>;
|
|
90
|
-
/**
|
|
91
|
-
* Retrieves all available roles in the system.
|
|
92
|
-
*
|
|
93
|
-
* @returns {Promise<Role[]>} A promise that resolves to an array of roles.
|
|
94
|
-
* @throws {PermissionError} If the user lacks required permissions
|
|
95
|
-
* @throws {APIError} If the response status code is not 200.
|
|
96
|
-
* @example
|
|
97
|
-
* const repository = new UserManagementRepository();
|
|
98
|
-
* repository.getAllRoles().then(roles => console.log(roles));
|
|
99
|
-
*/
|
|
100
|
-
getAllRoles(): Promise<Role[]>;
|
|
101
|
-
/**
|
|
102
|
-
* Retrieves a specific role by ID.
|
|
103
|
-
*
|
|
104
|
-
* @param {string} id - The unique identifier of the role to retrieve.
|
|
105
|
-
* @returns {Promise<Role>} A promise that resolves to the role.
|
|
106
|
-
* @throws {PermissionError} If the user lacks required permissions
|
|
107
|
-
* @throws {APIError} If the response status code is not 200 or role not found.
|
|
108
|
-
* @example
|
|
109
|
-
* const repository = new UserManagementRepository();
|
|
110
|
-
* repository.getRole('role-id').then(role => console.log(role));
|
|
111
|
-
*/
|
|
112
|
-
getRole(id: string): Promise<Role>;
|
|
113
|
-
}
|
|
114
|
-
//# sourceMappingURL=repository.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../../../src/src/features/admin/repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EACL,WAAW,EAGZ,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,IAAI,EAAiB,MAAM,sBAAsB,CAAC;AAE3D;;;GAGG;AACH,qBAAa,wBACX,SAAQ,cAAc,CAAC,OAAO,sBAAsB,CAAC;IACrD;;;;;OAKG;gBACS,KAAK,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,UAAU,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE;IAIxD;;;;;;OAMG;IACG,UAAU,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAgBvE;;;;;;;OAOG;IACG,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,WAAW,CAAC;IAuB5E;;;;;;OAMG;IACG,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAoBnD;;;;;;OAMG;IACG,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAoBrD;;;;;;;OAOG;IACG,iBAAiB,CACrB,EAAE,EAAE,MAAM,EACV,KAAK,GAAE,oBAAyB,GAC/B,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAkBhC;;;;;;;;;;OAUG;IACG,WAAW,CACf,KAAK,GAAE,sBAA0C,GAChD,OAAO,CAAC,WAAW,EAAE,CAAC;IAgBzB;;;;;;;;;;OAUG;IACG,OAAO,CACX,EAAE,EAAE,MAAM,EACV,KAAK,GAAE,sBAA0C,GAChD,OAAO,CAAC,WAAW,CAAC;IAoBvB;;;;;;;;;OASG;IACG,WAAW,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;IAsBpC;;;;;;;;;;OAUG;IACG,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAmBzC"}
|
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
import { BaseRepository } from "../../shared/base_repository.js";
|
|
2
|
-
import { userManagementContract } from "./contract.js";
|
|
3
|
-
import { ManagedUser, Permissions, } from "../../models/index.js";
|
|
4
|
-
import { PermissionError } from "../../errors/index.js";
|
|
5
|
-
import { Role } from "../../models/role.js";
|
|
6
|
-
/**
|
|
7
|
-
* Repository class for managing user accounts through API interactions.
|
|
8
|
-
* Extends the `BaseRepository` to leverage shared functionality.
|
|
9
|
-
*/
|
|
10
|
-
export class UserManagementRepository extends BaseRepository {
|
|
11
|
-
/**
|
|
12
|
-
* Creates an instance of `UserManagementRepository` using the user management contract.
|
|
13
|
-
* @param {Object} [props] - Optional constructor properties
|
|
14
|
-
* @param {AfloatAuth} [props.auth] - Optional auth instance to use
|
|
15
|
-
* @param {string} [props.root] - Optional API root URL
|
|
16
|
-
*/
|
|
17
|
-
constructor(props) {
|
|
18
|
-
super("admin", userManagementContract, props);
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Creates a new user account.
|
|
22
|
-
* @param {CreateUserRequest} input - The data required to create a new user account.
|
|
23
|
-
* @returns {Promise<CreateUserResponse>} A promise that resolves to the newly created user response.
|
|
24
|
-
* @throws {PermissionError} If the user lacks required permissions
|
|
25
|
-
* @throws {APIError} If the response status code is not 201.
|
|
26
|
-
*/
|
|
27
|
-
async createUser(input) {
|
|
28
|
-
const auth = this.getAuthForPermissionCheck();
|
|
29
|
-
const requiredPerm = Permissions.UserManagement.CreateUser;
|
|
30
|
-
if (!auth.checkPermission(requiredPerm)) {
|
|
31
|
-
throw new PermissionError({
|
|
32
|
-
message: "You are not authorized to create user accounts.",
|
|
33
|
-
requiredPermissions: [requiredPerm],
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
const result = await this.client.createUser({ body: input });
|
|
37
|
-
const data = this.handleResponse(result, 201);
|
|
38
|
-
return data;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Updates an existing user account by ID.
|
|
42
|
-
* @param {string} id - The unique identifier of the user account to update.
|
|
43
|
-
* @param {UpdateUserRequest} input - The data to update the user account with.
|
|
44
|
-
* @returns {Promise<ManagedUser>} A promise that resolves to the updated user account.
|
|
45
|
-
* @throws {PermissionError} If the user lacks required permissions
|
|
46
|
-
* @throws {APIError} If the response status code is not 200.
|
|
47
|
-
*/
|
|
48
|
-
async updateUser(id, input) {
|
|
49
|
-
const auth = this.getAuthForPermissionCheck();
|
|
50
|
-
const requiredPerm = Permissions.UserManagement.UpdateUser;
|
|
51
|
-
if (!auth.checkPermission(requiredPerm)) {
|
|
52
|
-
throw new PermissionError({
|
|
53
|
-
message: "You are not authorized to update user accounts.",
|
|
54
|
-
requiredPermissions: [requiredPerm],
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
const result = await this.client.updateUser({
|
|
58
|
-
params: { id },
|
|
59
|
-
body: input,
|
|
60
|
-
});
|
|
61
|
-
const data = this.handleResponse(result, 200);
|
|
62
|
-
const managedUser = ManagedUser.from(data);
|
|
63
|
-
if (!managedUser) {
|
|
64
|
-
throw new Error("Invalid user data received from server");
|
|
65
|
-
}
|
|
66
|
-
return managedUser;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Archives (soft deletes) a user account by ID.
|
|
70
|
-
* @param {string} id - The unique identifier of the user account to archive.
|
|
71
|
-
* @returns {Promise<ManagedUser>} A promise with the updated user object.
|
|
72
|
-
* @throws {PermissionError} If the user lacks required permissions
|
|
73
|
-
* @throws {APIError} If the response status code is not 200.
|
|
74
|
-
*/
|
|
75
|
-
async archiveUser(id) {
|
|
76
|
-
const auth = this.getAuthForPermissionCheck();
|
|
77
|
-
const requiredPerm = Permissions.UserManagement.ArchiveUser;
|
|
78
|
-
if (!auth.checkPermission(requiredPerm)) {
|
|
79
|
-
throw new PermissionError({
|
|
80
|
-
message: "You are not authorized to archive users.",
|
|
81
|
-
requiredPermissions: [requiredPerm],
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
const result = await this.client.archiveUser({ params: { id } });
|
|
85
|
-
const data = this.handleResponse(result, 201);
|
|
86
|
-
const managedUser = ManagedUser.from(data);
|
|
87
|
-
if (!managedUser) {
|
|
88
|
-
throw new Error("Invalid user data received from server");
|
|
89
|
-
}
|
|
90
|
-
return managedUser;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Archives (soft deletes) a user account by ID.
|
|
94
|
-
* @param {string} id - The unique identifier of the user account to archive.
|
|
95
|
-
* @returns {Promise<ManagedUser>} A promise with the updated user object.
|
|
96
|
-
* @throws {PermissionError} If the user lacks required permissions
|
|
97
|
-
* @throws {APIError} If the response status code is not 200.
|
|
98
|
-
*/
|
|
99
|
-
async unArchiveUser(id) {
|
|
100
|
-
const auth = this.getAuthForPermissionCheck();
|
|
101
|
-
const requiredPerm = Permissions.UserManagement.UnArchiveUser;
|
|
102
|
-
if (!auth.checkPermission(requiredPerm)) {
|
|
103
|
-
throw new PermissionError({
|
|
104
|
-
message: "You are not authorized to un-archive users.",
|
|
105
|
-
requiredPermissions: [requiredPerm],
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
const result = await this.client.unArchiveUser({ params: { id } });
|
|
109
|
-
const data = this.handleResponse(result, 201);
|
|
110
|
-
const managedUser = ManagedUser.from(data);
|
|
111
|
-
if (!managedUser) {
|
|
112
|
-
throw new Error("Invalid user data received from server");
|
|
113
|
-
}
|
|
114
|
-
return managedUser;
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Resets a user's password.
|
|
118
|
-
* @param {string} id - The unique identifier of the user account.
|
|
119
|
-
* @param {ResetPasswordRequest} [input] - Optional password reset configuration.
|
|
120
|
-
* @returns {Promise<void>} A promise that resolves when the password reset is complete.
|
|
121
|
-
* @throws {PermissionError} If the user lacks required permissions
|
|
122
|
-
* @throws {APIError} If the response status code is not 200.
|
|
123
|
-
*/
|
|
124
|
-
async resetUserPassword(id, input = {}) {
|
|
125
|
-
const auth = this.getAuthForPermissionCheck();
|
|
126
|
-
const requiredPerm = Permissions.UserManagement.ResetPassword;
|
|
127
|
-
if (!auth.checkPermission(requiredPerm)) {
|
|
128
|
-
throw new PermissionError({
|
|
129
|
-
message: "You are not authorized to reset user passwords.",
|
|
130
|
-
requiredPermissions: [requiredPerm],
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
const result = await this.client.resetPassword({
|
|
134
|
-
params: { id },
|
|
135
|
-
body: input,
|
|
136
|
-
});
|
|
137
|
-
return this.handleResponse(result, 201);
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* Retrieves all user accounts.
|
|
141
|
-
* Results are ordered in descending order by creation date by default.
|
|
142
|
-
*
|
|
143
|
-
* @returns {Promise<ManagedUser[]>} A promise that resolves to an array of managed users.
|
|
144
|
-
* @throws {PermissionError} If the user lacks required permissions
|
|
145
|
-
* @throws {APIError} If the response status code is not 200.
|
|
146
|
-
* @example
|
|
147
|
-
* const repository = new UserManagementRepository();
|
|
148
|
-
* repository.getAllUsers().then(users => console.log(users));
|
|
149
|
-
*/
|
|
150
|
-
async getAllUsers(query = { eager: "role" }) {
|
|
151
|
-
const auth = this.getAuthForPermissionCheck();
|
|
152
|
-
const requiredPerm = Permissions.UserManagement.ViewUsers;
|
|
153
|
-
if (!auth.checkPermission(requiredPerm)) {
|
|
154
|
-
throw new PermissionError({
|
|
155
|
-
message: "You are not authorized to view user accounts.",
|
|
156
|
-
requiredPermissions: [requiredPerm],
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
const result = await this.client.getUsers({ query });
|
|
160
|
-
const data = this.handleResponse(result, 200);
|
|
161
|
-
return ManagedUser.createMany(data);
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* Retrieves a specific user account by ID.
|
|
165
|
-
*
|
|
166
|
-
* @param {string} id - The unique identifier of the user account to retrieve.
|
|
167
|
-
* @returns {Promise<ManagedUser>} A promise that resolves to the managed user.
|
|
168
|
-
* @throws {PermissionError} If the user lacks required permissions
|
|
169
|
-
* @throws {APIError} If the response status code is not 200 or user not found.
|
|
170
|
-
* @example
|
|
171
|
-
* const repository = new UserManagementRepository();
|
|
172
|
-
* repository.getUser('user-id').then(user => console.log(user));
|
|
173
|
-
*/
|
|
174
|
-
async getUser(id, query = { eager: "role" }) {
|
|
175
|
-
const auth = this.getAuthForPermissionCheck();
|
|
176
|
-
const requiredPerm = Permissions.UserManagement.ViewUser;
|
|
177
|
-
if (!auth.checkPermission(requiredPerm)) {
|
|
178
|
-
throw new PermissionError({
|
|
179
|
-
message: "You are not authorized to view user account details.",
|
|
180
|
-
requiredPermissions: [requiredPerm],
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
const result = await this.client.getUser({ params: { id }, query });
|
|
184
|
-
const data = this.handleResponse(result, 200);
|
|
185
|
-
const managedUser = ManagedUser.from(data);
|
|
186
|
-
if (!managedUser) {
|
|
187
|
-
throw new Error("Invalid user data received from server");
|
|
188
|
-
}
|
|
189
|
-
return managedUser;
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* Retrieves all available roles in the system.
|
|
193
|
-
*
|
|
194
|
-
* @returns {Promise<Role[]>} A promise that resolves to an array of roles.
|
|
195
|
-
* @throws {PermissionError} If the user lacks required permissions
|
|
196
|
-
* @throws {APIError} If the response status code is not 200.
|
|
197
|
-
* @example
|
|
198
|
-
* const repository = new UserManagementRepository();
|
|
199
|
-
* repository.getAllRoles().then(roles => console.log(roles));
|
|
200
|
-
*/
|
|
201
|
-
async getAllRoles() {
|
|
202
|
-
const auth = this.getAuthForPermissionCheck();
|
|
203
|
-
const requiredPerm = Permissions.Role.ViewRoles;
|
|
204
|
-
if (!auth.checkPermission(requiredPerm)) {
|
|
205
|
-
throw new PermissionError({
|
|
206
|
-
message: "You are not authorized to view system roles.",
|
|
207
|
-
requiredPermissions: [requiredPerm],
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
const result = await this.client.getRoles();
|
|
211
|
-
const data = this.handleResponse(result, 200);
|
|
212
|
-
return data.map((roleData) => {
|
|
213
|
-
const role = Role.from(roleData);
|
|
214
|
-
if (!role) {
|
|
215
|
-
throw new Error("Invalid role data received from server");
|
|
216
|
-
}
|
|
217
|
-
return role;
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
/**
|
|
221
|
-
* Retrieves a specific role by ID.
|
|
222
|
-
*
|
|
223
|
-
* @param {string} id - The unique identifier of the role to retrieve.
|
|
224
|
-
* @returns {Promise<Role>} A promise that resolves to the role.
|
|
225
|
-
* @throws {PermissionError} If the user lacks required permissions
|
|
226
|
-
* @throws {APIError} If the response status code is not 200 or role not found.
|
|
227
|
-
* @example
|
|
228
|
-
* const repository = new UserManagementRepository();
|
|
229
|
-
* repository.getRole('role-id').then(role => console.log(role));
|
|
230
|
-
*/
|
|
231
|
-
async getRole(id) {
|
|
232
|
-
const auth = this.getAuthForPermissionCheck();
|
|
233
|
-
const requiredPerm = Permissions.Role.ViewRole;
|
|
234
|
-
if (!auth.checkPermission(requiredPerm)) {
|
|
235
|
-
throw new PermissionError({
|
|
236
|
-
message: "You are not authorized to view role details.",
|
|
237
|
-
requiredPermissions: [requiredPerm],
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
const result = await this.client.getRole({ params: { id } });
|
|
241
|
-
const data = this.handleResponse(result, 200);
|
|
242
|
-
const role = Role.from(data);
|
|
243
|
-
if (!role) {
|
|
244
|
-
throw new Error("Invalid role data received from server");
|
|
245
|
-
}
|
|
246
|
-
return role;
|
|
247
|
-
}
|
|
248
|
-
}
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
/**
|
|
3
|
-
* Type definition for password schema using Zod.
|
|
4
|
-
* This is used as a TypeScript type helper for the actual schema implementation.
|
|
5
|
-
*/
|
|
6
|
-
type _PasswordType = z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>;
|
|
7
|
-
/**
|
|
8
|
-
* Type definition for role schema using Zod.
|
|
9
|
-
* This is used as a TypeScript type helper for the actual schema implementation.
|
|
10
|
-
*/
|
|
11
|
-
type _RoleType = z.ZodObject<{
|
|
12
|
-
id: z.ZodString;
|
|
13
|
-
name: z.ZodString;
|
|
14
|
-
description: z.ZodOptional<z.ZodString>;
|
|
15
|
-
access: z.ZodArray<z.ZodString>;
|
|
16
|
-
createdAt: z.ZodString;
|
|
17
|
-
updatedAt: z.ZodString;
|
|
18
|
-
}>;
|
|
19
|
-
/**
|
|
20
|
-
* Type definition for managed user schema using Zod.
|
|
21
|
-
* This is used as a TypeScript type helper for the actual schema implementation.
|
|
22
|
-
*/
|
|
23
|
-
type _ManagedUserType = z.ZodObject<{
|
|
24
|
-
id: z.ZodString;
|
|
25
|
-
name: z.ZodString;
|
|
26
|
-
identity: z.ZodString;
|
|
27
|
-
type: z.ZodString;
|
|
28
|
-
profileId: z.ZodString;
|
|
29
|
-
roleId: z.ZodString;
|
|
30
|
-
resetPassword: z.ZodBoolean;
|
|
31
|
-
isActive: z.ZodBoolean;
|
|
32
|
-
isArchived: z.ZodBoolean;
|
|
33
|
-
role: z.ZodOptional<z.ZodType<Role>>;
|
|
34
|
-
createdAt: z.ZodString;
|
|
35
|
-
updatedAt: z.ZodString;
|
|
36
|
-
}>;
|
|
37
|
-
/**
|
|
38
|
-
* Type definition for create user request schema using Zod.
|
|
39
|
-
* This is used as a TypeScript type helper for the actual schema implementation.
|
|
40
|
-
*/
|
|
41
|
-
type _CreateUserRequestType = z.ZodObject<{
|
|
42
|
-
name: z.ZodString;
|
|
43
|
-
identity: z.ZodString;
|
|
44
|
-
password: z.ZodOptional<_PasswordType>;
|
|
45
|
-
roleId: z.ZodOptional<z.ZodString>;
|
|
46
|
-
resetPassword: z.ZodOptional<z.ZodBoolean>;
|
|
47
|
-
}>;
|
|
48
|
-
/**
|
|
49
|
-
* Type definition for update user request schema using Zod.
|
|
50
|
-
* This is used as a TypeScript type helper for the actual schema implementation.
|
|
51
|
-
*/
|
|
52
|
-
type _UpdateUserRequestType = z.ZodObject<{
|
|
53
|
-
name: z.ZodOptional<z.ZodString>;
|
|
54
|
-
roleId: z.ZodOptional<z.ZodString>;
|
|
55
|
-
password: z.ZodOptional<_PasswordType>;
|
|
56
|
-
resetPassword: z.ZodOptional<z.ZodBoolean>;
|
|
57
|
-
isActive: z.ZodOptional<z.ZodBoolean>;
|
|
58
|
-
}>;
|
|
59
|
-
/**
|
|
60
|
-
* Type definition for reset password request schema using Zod.
|
|
61
|
-
* This is used as a TypeScript type helper for the actual schema implementation.
|
|
62
|
-
*/
|
|
63
|
-
type _ResetPasswordRequestType = z.ZodObject<{
|
|
64
|
-
newPassword: z.ZodOptional<_PasswordType>;
|
|
65
|
-
sendNotification: z.ZodOptional<z.ZodBoolean>;
|
|
66
|
-
}>;
|
|
67
|
-
/**
|
|
68
|
-
* Type definition for create user response schema using Zod.
|
|
69
|
-
* This is used as a TypeScript type helper for the actual schema implementation.
|
|
70
|
-
*/
|
|
71
|
-
type _CreateUserResponseType = z.ZodObject<{
|
|
72
|
-
id: z.ZodString;
|
|
73
|
-
name: z.ZodString;
|
|
74
|
-
identity: z.ZodString;
|
|
75
|
-
type: z.ZodString;
|
|
76
|
-
profileId: z.ZodString;
|
|
77
|
-
roleId: z.ZodString;
|
|
78
|
-
isActive: z.ZodBoolean;
|
|
79
|
-
isArchived: z.ZodBoolean;
|
|
80
|
-
createdAt: z.ZodString;
|
|
81
|
-
}>;
|
|
82
|
-
/**
|
|
83
|
-
* Type definition for managed user query parameters schema using Zod.
|
|
84
|
-
* This is used as a TypeScript type helper for the actual schema implementation.
|
|
85
|
-
*/
|
|
86
|
-
type _ManagedUserQueryParamsType = z.ZodObject<{
|
|
87
|
-
id: z.ZodOptional<z.ZodString>;
|
|
88
|
-
name: z.ZodOptional<z.ZodString>;
|
|
89
|
-
identity: z.ZodOptional<z.ZodString>;
|
|
90
|
-
type: z.ZodOptional<z.ZodString>;
|
|
91
|
-
profileId: z.ZodOptional<z.ZodString>;
|
|
92
|
-
roleId: z.ZodOptional<z.ZodString>;
|
|
93
|
-
resetPassword: z.ZodOptional<z.ZodNumber>;
|
|
94
|
-
isActive: z.ZodOptional<z.ZodNumber>;
|
|
95
|
-
isArchived: z.ZodOptional<z.ZodNumber>;
|
|
96
|
-
createdAt: z.ZodOptional<z.ZodString>;
|
|
97
|
-
updatedAt: z.ZodOptional<z.ZodString>;
|
|
98
|
-
eager: z.ZodOptional<z.ZodString>;
|
|
99
|
-
}>;
|
|
100
|
-
/**
|
|
101
|
-
* Collection of user management schemas for export.
|
|
102
|
-
* Provides access to all user and role validation schemas.
|
|
103
|
-
*/
|
|
104
|
-
export declare const UserManagementSchemas: {
|
|
105
|
-
role: _RoleType;
|
|
106
|
-
managedUser: _ManagedUserType;
|
|
107
|
-
managedUserQueryParams: _ManagedUserQueryParamsType;
|
|
108
|
-
createUserRequest: _CreateUserRequestType;
|
|
109
|
-
updateUserRequest: _UpdateUserRequestType;
|
|
110
|
-
resetPasswordRequest: _ResetPasswordRequestType;
|
|
111
|
-
createUserResponse: _CreateUserResponseType;
|
|
112
|
-
password: _PasswordType;
|
|
113
|
-
};
|
|
114
|
-
/**
|
|
115
|
-
* TypeScript type for a validated role object.
|
|
116
|
-
* Use this type for role instances that have been validated against the schema.
|
|
117
|
-
*/
|
|
118
|
-
type Role = z.infer<typeof UserManagementSchemas.role>;
|
|
119
|
-
/**
|
|
120
|
-
* TypeScript type for a create user request object.
|
|
121
|
-
* Use this type for user creation requests that have been validated against the schema.
|
|
122
|
-
*/
|
|
123
|
-
export type CreateUserRequest = z.infer<typeof UserManagementSchemas.createUserRequest>;
|
|
124
|
-
/**
|
|
125
|
-
* TypeScript type for an update user request object.
|
|
126
|
-
* Use this type for user update requests that have been validated against the schema.
|
|
127
|
-
*/
|
|
128
|
-
export type UpdateUserRequest = z.infer<typeof UserManagementSchemas.updateUserRequest>;
|
|
129
|
-
/**
|
|
130
|
-
* TypeScript type for a reset password request object.
|
|
131
|
-
* Use this type for password reset requests that have been validated against the schema.
|
|
132
|
-
*/
|
|
133
|
-
export type ResetPasswordRequest = z.infer<typeof UserManagementSchemas.resetPasswordRequest>;
|
|
134
|
-
/**
|
|
135
|
-
* TypeScript type for a create user response object.
|
|
136
|
-
* Use this type for user creation responses that have been validated against the schema.
|
|
137
|
-
*/
|
|
138
|
-
export type CreateUserResponse = z.infer<typeof UserManagementSchemas.createUserResponse>;
|
|
139
|
-
/**
|
|
140
|
-
* TypeScript type for managed user query parameters.
|
|
141
|
-
* Use this type for query parameter objects that have been validated against the schema.
|
|
142
|
-
* All fields are optional to allow flexible filtering and searching.
|
|
143
|
-
*/
|
|
144
|
-
export type ManagedUserQueryParams = z.infer<typeof UserManagementSchemas.managedUserQueryParams>;
|
|
145
|
-
export {};
|
|
146
|
-
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/src/features/admin/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,KAAK,aAAa,GAAG,CAAC,CAAC,UAAU,CAC/B,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EACvE,MAAM,EACN,MAAM,CACP,CAAC;AAuDF;;;GAGG;AACH,KAAK,SAAS,GAAG,CAAC,CAAC,SAAS,CAAC;IAC3B,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC;IAChB,IAAI,EAAE,CAAC,CAAC,SAAS,CAAC;IAClB,WAAW,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IACxC,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAChC,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC;IACvB,SAAS,EAAE,CAAC,CAAC,SAAS,CAAC;CACxB,CAAC,CAAC;AAEH;;;GAGG;AACH,KAAK,gBAAgB,GAAG,CAAC,CAA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