@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
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/** Serialized pagination metadata for API responses */
|
|
2
|
+
export type PaginationJson = {
|
|
3
|
+
page: number;
|
|
4
|
+
limit: number;
|
|
5
|
+
total: number;
|
|
6
|
+
totalPages: number;
|
|
7
|
+
hasNext: boolean;
|
|
8
|
+
hasPrev: boolean;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Represents pagination metadata for paginated API responses.
|
|
12
|
+
* Provides computed properties for navigation and page calculations.
|
|
13
|
+
*/
|
|
14
|
+
export declare class Pagination {
|
|
15
|
+
readonly page: number;
|
|
16
|
+
readonly limit: number;
|
|
17
|
+
readonly total: number;
|
|
18
|
+
/**
|
|
19
|
+
* @param page - Current page number (1-based)
|
|
20
|
+
* @param limit - Number of items per page
|
|
21
|
+
* @param total - Total number of items across all pages
|
|
22
|
+
*/
|
|
23
|
+
constructor(page: number, limit: number, total: number);
|
|
24
|
+
/** Total number of pages */
|
|
25
|
+
get totalPages(): number;
|
|
26
|
+
/** Whether there is a next page available */
|
|
27
|
+
get hasNext(): boolean;
|
|
28
|
+
/** Whether there is a previous page available */
|
|
29
|
+
get hasPrev(): boolean;
|
|
30
|
+
/** Offset for database queries (0-based) */
|
|
31
|
+
get offset(): number;
|
|
32
|
+
/** Whether this is the first page */
|
|
33
|
+
get isFirstPage(): boolean;
|
|
34
|
+
/** Whether this is the last page */
|
|
35
|
+
get isLastPage(): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Creates a Pagination instance for the next page.
|
|
38
|
+
* @returns New Pagination instance or null if no next page exists
|
|
39
|
+
*/
|
|
40
|
+
nextPage(): Pagination | null;
|
|
41
|
+
/**
|
|
42
|
+
* Creates a Pagination instance for the previous page.
|
|
43
|
+
* @returns New Pagination instance or null if no previous page exists
|
|
44
|
+
*/
|
|
45
|
+
prevPage(): Pagination | null;
|
|
46
|
+
/** Converts to a plain object for JSON serialization */
|
|
47
|
+
toJSON(): {
|
|
48
|
+
page: number;
|
|
49
|
+
limit: number;
|
|
50
|
+
total: number;
|
|
51
|
+
totalPages: number;
|
|
52
|
+
hasNext: boolean;
|
|
53
|
+
hasPrev: boolean;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
/** Generic paginated response structure */
|
|
57
|
+
export interface Paged<T> {
|
|
58
|
+
results: T[];
|
|
59
|
+
pagination: Pagination;
|
|
60
|
+
}
|
|
61
|
+
/** Type for paginated responses after JSON serialization */
|
|
62
|
+
export type PaginatedApiResponse<T> = {
|
|
63
|
+
results: T[];
|
|
64
|
+
pagination: PaginationJson;
|
|
65
|
+
};
|
|
66
|
+
/**
|
|
67
|
+
* Creates a paginated response from query results.
|
|
68
|
+
*/
|
|
69
|
+
export declare function createPaginatedResponse<T>(results: T[], page: number, limit: number, total: number): Paged<T>;
|
|
70
|
+
/**
|
|
71
|
+
* Creates an empty paginated response.
|
|
72
|
+
*/
|
|
73
|
+
export declare function emptyPaginatedResponse<T>(page?: number, limit?: number): Paged<T>;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/** Zod schema for validating pagination query parameters */
|
|
3
|
+
export declare const PaginationParamsSchema: z.ZodObject<{
|
|
4
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
5
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
page: number;
|
|
8
|
+
limit: number;
|
|
9
|
+
}, {
|
|
10
|
+
page?: number | undefined;
|
|
11
|
+
limit?: number | undefined;
|
|
12
|
+
}>;
|
|
13
|
+
/** Zod schema for validating pagination metadata */
|
|
14
|
+
export declare const PaginationSchema: z.ZodObject<{
|
|
15
|
+
page: z.ZodNumber;
|
|
16
|
+
limit: z.ZodNumber;
|
|
17
|
+
total: z.ZodNumber;
|
|
18
|
+
totalPages: z.ZodNumber;
|
|
19
|
+
hasNext: z.ZodBoolean;
|
|
20
|
+
hasPrev: z.ZodBoolean;
|
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
|
22
|
+
page: number;
|
|
23
|
+
limit: number;
|
|
24
|
+
total: number;
|
|
25
|
+
totalPages: number;
|
|
26
|
+
hasNext: boolean;
|
|
27
|
+
hasPrev: boolean;
|
|
28
|
+
}, {
|
|
29
|
+
page: number;
|
|
30
|
+
limit: number;
|
|
31
|
+
total: number;
|
|
32
|
+
totalPages: number;
|
|
33
|
+
hasNext: boolean;
|
|
34
|
+
hasPrev: boolean;
|
|
35
|
+
}>;
|
|
36
|
+
/**
|
|
37
|
+
* Creates a Zod schema for a paginated response with typed results.
|
|
38
|
+
*/
|
|
39
|
+
export declare function createPaginatedResponseSchema<T extends z.ZodTypeAny>(itemSchema: T): z.ZodObject<{
|
|
40
|
+
results: z.ZodArray<T, "many">;
|
|
41
|
+
pagination: z.ZodObject<{
|
|
42
|
+
page: z.ZodNumber;
|
|
43
|
+
limit: z.ZodNumber;
|
|
44
|
+
total: z.ZodNumber;
|
|
45
|
+
totalPages: z.ZodNumber;
|
|
46
|
+
hasNext: z.ZodBoolean;
|
|
47
|
+
hasPrev: z.ZodBoolean;
|
|
48
|
+
}, "strip", z.ZodTypeAny, {
|
|
49
|
+
page: number;
|
|
50
|
+
limit: number;
|
|
51
|
+
total: number;
|
|
52
|
+
totalPages: number;
|
|
53
|
+
hasNext: boolean;
|
|
54
|
+
hasPrev: boolean;
|
|
55
|
+
}, {
|
|
56
|
+
page: number;
|
|
57
|
+
limit: number;
|
|
58
|
+
total: number;
|
|
59
|
+
totalPages: number;
|
|
60
|
+
hasNext: boolean;
|
|
61
|
+
hasPrev: boolean;
|
|
62
|
+
}>;
|
|
63
|
+
}, "strip", z.ZodTypeAny, {
|
|
64
|
+
results: T["_output"][];
|
|
65
|
+
pagination: {
|
|
66
|
+
page: number;
|
|
67
|
+
limit: number;
|
|
68
|
+
total: number;
|
|
69
|
+
totalPages: number;
|
|
70
|
+
hasNext: boolean;
|
|
71
|
+
hasPrev: boolean;
|
|
72
|
+
};
|
|
73
|
+
}, {
|
|
74
|
+
results: T["_input"][];
|
|
75
|
+
pagination: {
|
|
76
|
+
page: number;
|
|
77
|
+
limit: number;
|
|
78
|
+
total: number;
|
|
79
|
+
totalPages: number;
|
|
80
|
+
hasNext: boolean;
|
|
81
|
+
hasPrev: boolean;
|
|
82
|
+
};
|
|
83
|
+
}>;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { FilterCriteria, QueryOptions, SortCriteria, SortDirection } from "./query.types.js";
|
|
2
|
+
export declare const QUERY_BUILDER_TYPE: unique symbol;
|
|
3
|
+
export declare class QueryBuilder {
|
|
4
|
+
readonly options: QueryOptions;
|
|
5
|
+
constructor(options?: QueryOptions);
|
|
6
|
+
/**
|
|
7
|
+
* Type tag to identify QueryBuilder instances
|
|
8
|
+
*/
|
|
9
|
+
[QUERY_BUILDER_TYPE]: string;
|
|
10
|
+
/**
|
|
11
|
+
* Safely check if an object is a QueryBuilder instance
|
|
12
|
+
*/
|
|
13
|
+
static is(obj: any): obj is QueryBuilder;
|
|
14
|
+
addFilter(criteria: FilterCriteria): this;
|
|
15
|
+
where(field: string, value: any): this;
|
|
16
|
+
whereNot(field: string, value: any): this;
|
|
17
|
+
whereLike(field: string, value: string): this;
|
|
18
|
+
whereLikeLower(field: string, value: string): this;
|
|
19
|
+
whereContains(field: string, value: string): this;
|
|
20
|
+
whereStartsWith(field: string, value: string): this;
|
|
21
|
+
whereEndsWith(field: string, value: string): this;
|
|
22
|
+
whereIn(field: string, values: any[]): this;
|
|
23
|
+
whereNull(field: string): this;
|
|
24
|
+
whereNotNull(field: string): this;
|
|
25
|
+
whereGreaterThan(field: string, value: any): this;
|
|
26
|
+
whereGreaterThanOrEqual(field: string, value: any): this;
|
|
27
|
+
whereLessThan(field: string, value: any): this;
|
|
28
|
+
whereLessThanOrEqual(field: string, value: any): this;
|
|
29
|
+
whereBetween(field: string, min: any, max: any): this;
|
|
30
|
+
/**
|
|
31
|
+
* Filter by date range with support for Date objects, strings, and null
|
|
32
|
+
* Internally converts to createdAt:gte and createdAt:lte filters
|
|
33
|
+
*/
|
|
34
|
+
whereDateBetween(startDate?: string | Date | null, endDate?: string | Date | null): this;
|
|
35
|
+
addSort(criteria: SortCriteria): this;
|
|
36
|
+
orderBy(field: string, direction?: SortDirection): this;
|
|
37
|
+
orderByAsc(field: string): this;
|
|
38
|
+
orderByDesc(field: string): this;
|
|
39
|
+
paginate(page: number, limit: number): this;
|
|
40
|
+
/**
|
|
41
|
+
* Add eager loading for related models
|
|
42
|
+
* @param relations Relation name or array of relation names
|
|
43
|
+
*/
|
|
44
|
+
with(relations: string | string[]): this;
|
|
45
|
+
/**
|
|
46
|
+
* Add a JOIN to the query to fetch related models
|
|
47
|
+
* @param relations Relation name or array of relation names to join
|
|
48
|
+
*/
|
|
49
|
+
join(relations: string | string[]): this;
|
|
50
|
+
/**
|
|
51
|
+
* Add GROUP BY clause to the query
|
|
52
|
+
* @param fields Field or fields to group by
|
|
53
|
+
*/
|
|
54
|
+
groupBy(fields: string | string[]): this;
|
|
55
|
+
/**
|
|
56
|
+
* Enable count mode for the query
|
|
57
|
+
* @param expression Optional count expression (defaults to '*')
|
|
58
|
+
*/
|
|
59
|
+
count(expression?: string): this;
|
|
60
|
+
/**
|
|
61
|
+
* Count specific expression with alias
|
|
62
|
+
* @param expression Expression to count
|
|
63
|
+
* @param alias Alias for the count result
|
|
64
|
+
*/
|
|
65
|
+
countAs(expression: string, alias: string): this;
|
|
66
|
+
/**
|
|
67
|
+
* @returns an objection-find query
|
|
68
|
+
*/
|
|
69
|
+
build(): Record<string, any>;
|
|
70
|
+
/**
|
|
71
|
+
* Create a clone of this query builder
|
|
72
|
+
*/
|
|
73
|
+
clone(): this;
|
|
74
|
+
static create<T extends QueryOptions>(options?: T): QueryBuilder;
|
|
75
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare enum FilterOperator {
|
|
2
|
+
EQUALS = "eq",
|
|
3
|
+
NOT_EQUALS = "neq",
|
|
4
|
+
LESS_THAN = "lt",
|
|
5
|
+
LESS_THAN_OR_EQUAL = "lte",
|
|
6
|
+
GREATER_THAN = "gt",
|
|
7
|
+
GREATER_THAN_OR_EQUAL = "gte",
|
|
8
|
+
LIKE = "like",
|
|
9
|
+
LIKE_LOWER = "likeLower",
|
|
10
|
+
IS_NULL = "isNull",
|
|
11
|
+
IS_NOT_NULL = "isNotNull",
|
|
12
|
+
IN = "in"
|
|
13
|
+
}
|
|
14
|
+
export declare enum SortDirection {
|
|
15
|
+
ASC = "asc",
|
|
16
|
+
DESC = "desc"
|
|
17
|
+
}
|
|
18
|
+
export interface FilterCriteria {
|
|
19
|
+
field: string;
|
|
20
|
+
operator: FilterOperator;
|
|
21
|
+
value?: any;
|
|
22
|
+
}
|
|
23
|
+
export interface SortCriteria {
|
|
24
|
+
field: string;
|
|
25
|
+
direction: SortDirection;
|
|
26
|
+
}
|
|
27
|
+
export interface QueryOptions {
|
|
28
|
+
page?: number;
|
|
29
|
+
limit?: number;
|
|
30
|
+
filters?: FilterCriteria[];
|
|
31
|
+
sort?: SortCriteria[];
|
|
32
|
+
includes?: string[];
|
|
33
|
+
join?: string[];
|
|
34
|
+
groupBy?: string[];
|
|
35
|
+
count?: string;
|
|
36
|
+
}
|
|
@@ -23,13 +23,14 @@ export declare const authContract: {
|
|
|
23
23
|
201: z.ZodObject<{
|
|
24
24
|
profile: z.ZodObject<{
|
|
25
25
|
id: z.ZodString;
|
|
26
|
-
firstName: z.
|
|
27
|
-
lastName: z.
|
|
26
|
+
firstName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
27
|
+
lastName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
28
28
|
displayName: z.ZodString;
|
|
29
|
-
phone: z.
|
|
29
|
+
phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
30
30
|
accountNo: z.ZodString;
|
|
31
|
-
email: z.
|
|
32
|
-
|
|
31
|
+
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
32
|
+
autoApprove: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
33
34
|
id: string;
|
|
34
35
|
displayName: string;
|
|
35
36
|
accountNo: string;
|
|
@@ -37,6 +38,7 @@ export declare const authContract: {
|
|
|
37
38
|
lastName?: string | null | undefined;
|
|
38
39
|
phone?: string | null | undefined;
|
|
39
40
|
email?: string | null | undefined;
|
|
41
|
+
autoApprove?: boolean | null | undefined;
|
|
40
42
|
}, {
|
|
41
43
|
id: string;
|
|
42
44
|
displayName: string;
|
|
@@ -45,12 +47,15 @@ export declare const authContract: {
|
|
|
45
47
|
lastName?: string | null | undefined;
|
|
46
48
|
phone?: string | null | undefined;
|
|
47
49
|
email?: string | null | undefined;
|
|
50
|
+
autoApprove?: boolean | null | undefined;
|
|
48
51
|
}>;
|
|
49
52
|
token: z.ZodString;
|
|
50
53
|
access: z.ZodArray<z.ZodString, "many">;
|
|
51
54
|
resetPassword: z.ZodBoolean;
|
|
52
55
|
}, "strip", z.ZodTypeAny, {
|
|
56
|
+
token: string;
|
|
53
57
|
resetPassword: boolean;
|
|
58
|
+
access: string[];
|
|
54
59
|
profile: {
|
|
55
60
|
id: string;
|
|
56
61
|
displayName: string;
|
|
@@ -59,11 +64,12 @@ export declare const authContract: {
|
|
|
59
64
|
lastName?: string | null | undefined;
|
|
60
65
|
phone?: string | null | undefined;
|
|
61
66
|
email?: string | null | undefined;
|
|
67
|
+
autoApprove?: boolean | null | undefined;
|
|
62
68
|
};
|
|
63
|
-
token: string;
|
|
64
|
-
access: string[];
|
|
65
69
|
}, {
|
|
70
|
+
token: string;
|
|
66
71
|
resetPassword: boolean;
|
|
72
|
+
access: string[];
|
|
67
73
|
profile: {
|
|
68
74
|
id: string;
|
|
69
75
|
displayName: string;
|
|
@@ -72,9 +78,8 @@ export declare const authContract: {
|
|
|
72
78
|
lastName?: string | null | undefined;
|
|
73
79
|
phone?: string | null | undefined;
|
|
74
80
|
email?: string | null | undefined;
|
|
81
|
+
autoApprove?: boolean | null | undefined;
|
|
75
82
|
};
|
|
76
|
-
token: string;
|
|
77
|
-
access: string[];
|
|
78
83
|
}>;
|
|
79
84
|
400: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
80
85
|
};
|
|
@@ -82,13 +87,6 @@ export declare const authContract: {
|
|
|
82
87
|
access: {
|
|
83
88
|
method: "GET";
|
|
84
89
|
path: "/access";
|
|
85
|
-
headers: z.ZodObject<{
|
|
86
|
-
token: z.ZodString;
|
|
87
|
-
}, "strip", z.ZodTypeAny, {
|
|
88
|
-
token: string;
|
|
89
|
-
}, {
|
|
90
|
-
token: string;
|
|
91
|
-
}>;
|
|
92
90
|
responses: {
|
|
93
91
|
200: z.ZodArray<z.ZodString, "many">;
|
|
94
92
|
};
|
|
@@ -99,14 +97,13 @@ export declare const authContract: {
|
|
|
99
97
|
currentPassword: z.ZodString;
|
|
100
98
|
newPassword: z.ZodString;
|
|
101
99
|
}, "strip", z.ZodTypeAny, {
|
|
102
|
-
currentPassword: string;
|
|
103
100
|
newPassword: string;
|
|
104
|
-
}, {
|
|
105
101
|
currentPassword: string;
|
|
102
|
+
}, {
|
|
106
103
|
newPassword: string;
|
|
104
|
+
currentPassword: string;
|
|
107
105
|
}>;
|
|
108
106
|
path: "/password";
|
|
109
107
|
responses: {};
|
|
110
108
|
};
|
|
111
109
|
};
|
|
112
|
-
//# sourceMappingURL=contract.d.ts.map
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { BaseRepository } from "@/lib/api/base-repository.js";
|
|
2
|
+
import { User } from "@/modules/auth/user.model.js";
|
|
3
|
+
import { authContract } from "./auth.contract.js";
|
|
4
|
+
/**
|
|
5
|
+
* Repository class for handling authentication-related operations.
|
|
6
|
+
* Provides methods for user login and password management.
|
|
7
|
+
*
|
|
8
|
+
* @extends {BaseRepository<typeof authContract>}
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const authRepo = new AuthRepository();
|
|
13
|
+
* const user = await authRepo.logIn("user@example.com", "password");
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare class AuthRepository extends BaseRepository<typeof authContract> {
|
|
17
|
+
/**
|
|
18
|
+
* Creates an instance of AuthRepository.
|
|
19
|
+
*
|
|
20
|
+
* @param options - Optional configuration
|
|
21
|
+
* @param options.root - Custom API root URL
|
|
22
|
+
* @param options.token - Authentication token for password operations
|
|
23
|
+
*/
|
|
24
|
+
constructor(options?: {
|
|
25
|
+
root?: string;
|
|
26
|
+
token?: string;
|
|
27
|
+
});
|
|
28
|
+
/**
|
|
29
|
+
* Authenticates a user with the provided email and password.
|
|
30
|
+
*
|
|
31
|
+
* @param email - The email of the user attempting to log in
|
|
32
|
+
* @param password - The password of the user
|
|
33
|
+
* @returns Promise that resolves to a User object on successful login
|
|
34
|
+
* @throws {APIError} If the email or password is invalid, or if another error occurs during login
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```typescript
|
|
38
|
+
* try {
|
|
39
|
+
* const user = await authRepo.logIn("user@example.com", "securePassword");
|
|
40
|
+
* console.log(`Welcome ${user.name}!`);
|
|
41
|
+
* } catch (error) {
|
|
42
|
+
* console.error("Login failed:", error.message);
|
|
43
|
+
* }
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
logIn(email: string, password: string): Promise<User>;
|
|
47
|
+
/**
|
|
48
|
+
* Updates the current user's password.
|
|
49
|
+
*
|
|
50
|
+
* @param currentPassword - The user's current password
|
|
51
|
+
* @param newPassword - The new password the user wants to set
|
|
52
|
+
* @returns Promise that resolves to true if the password update is successful
|
|
53
|
+
* @throws {APIError} If the current password is invalid or another error occurs during the update
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```typescript
|
|
57
|
+
* try {
|
|
58
|
+
* await authRepo.updatePassword("oldPassword", "newSecurePassword");
|
|
59
|
+
* console.log("Password updated successfully");
|
|
60
|
+
* } catch (error) {
|
|
61
|
+
* console.error("Password update failed:", error.message);
|
|
62
|
+
* }
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
updatePassword(currentPassword: string, newPassword: string): Promise<boolean>;
|
|
66
|
+
/**
|
|
67
|
+
* Retrieves the current user's access list.
|
|
68
|
+
*
|
|
69
|
+
* @returns Promise that resolves to an array of access permissions/roles
|
|
70
|
+
* @throws {APIError} If the request fails or returns an unexpected status
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```typescript
|
|
74
|
+
* try {
|
|
75
|
+
* const accessList = await repo.getAccessList();
|
|
76
|
+
* console.log("User has access to:", accessList);
|
|
77
|
+
* } catch (error) {
|
|
78
|
+
* console.error("Failed to get access list:", error.message);
|
|
79
|
+
* }
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
getAccessList(): Promise<string[]>;
|
|
83
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import z from "zod";
|
|
2
|
+
import { Profile } from "../profile/profile.model.js";
|
|
3
|
+
import { Role } from "../team-member/role.model.js";
|
|
4
|
+
/**
|
|
5
|
+
* Zod schema for CompanyMembership JSON serialization
|
|
6
|
+
*/
|
|
7
|
+
export declare const CompanyMembershipJSONSchema: z.ZodObject<{
|
|
8
|
+
companyProfile: z.ZodObject<{
|
|
9
|
+
id: z.ZodString;
|
|
10
|
+
firstName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
11
|
+
lastName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
12
|
+
displayName: z.ZodString;
|
|
13
|
+
phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
14
|
+
accountNo: z.ZodString;
|
|
15
|
+
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
16
|
+
autoApprove: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
17
|
+
version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
18
|
+
}, "strip", z.ZodTypeAny, {
|
|
19
|
+
id: string;
|
|
20
|
+
displayName: string;
|
|
21
|
+
accountNo: string;
|
|
22
|
+
version: string;
|
|
23
|
+
firstName?: string | null | undefined;
|
|
24
|
+
lastName?: string | null | undefined;
|
|
25
|
+
phone?: string | null | undefined;
|
|
26
|
+
email?: string | null | undefined;
|
|
27
|
+
autoApprove?: boolean | null | undefined;
|
|
28
|
+
}, {
|
|
29
|
+
id: string;
|
|
30
|
+
displayName: string;
|
|
31
|
+
accountNo: string;
|
|
32
|
+
firstName?: string | null | undefined;
|
|
33
|
+
lastName?: string | null | undefined;
|
|
34
|
+
phone?: string | null | undefined;
|
|
35
|
+
email?: string | null | undefined;
|
|
36
|
+
autoApprove?: boolean | null | undefined;
|
|
37
|
+
version?: string | undefined;
|
|
38
|
+
}>;
|
|
39
|
+
role: z.ZodOptional<z.ZodObject<{
|
|
40
|
+
id: z.ZodString;
|
|
41
|
+
name: z.ZodString;
|
|
42
|
+
description: z.ZodOptional<z.ZodString>;
|
|
43
|
+
access: z.ZodArray<z.ZodString, "many">;
|
|
44
|
+
createdAt: z.ZodString;
|
|
45
|
+
updatedAt: z.ZodString;
|
|
46
|
+
version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
name: string;
|
|
49
|
+
createdAt: string;
|
|
50
|
+
id: string;
|
|
51
|
+
version: string;
|
|
52
|
+
updatedAt: string;
|
|
53
|
+
access: string[];
|
|
54
|
+
description?: string | undefined;
|
|
55
|
+
}, {
|
|
56
|
+
name: string;
|
|
57
|
+
createdAt: string;
|
|
58
|
+
id: string;
|
|
59
|
+
updatedAt: string;
|
|
60
|
+
access: string[];
|
|
61
|
+
version?: string | undefined;
|
|
62
|
+
description?: string | undefined;
|
|
63
|
+
}>>;
|
|
64
|
+
version: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
65
|
+
}, "strip", z.ZodTypeAny, {
|
|
66
|
+
version: string;
|
|
67
|
+
companyProfile: {
|
|
68
|
+
id: string;
|
|
69
|
+
displayName: string;
|
|
70
|
+
accountNo: string;
|
|
71
|
+
version: string;
|
|
72
|
+
firstName?: string | null | undefined;
|
|
73
|
+
lastName?: string | null | undefined;
|
|
74
|
+
phone?: string | null | undefined;
|
|
75
|
+
email?: string | null | undefined;
|
|
76
|
+
autoApprove?: boolean | null | undefined;
|
|
77
|
+
};
|
|
78
|
+
role?: {
|
|
79
|
+
name: string;
|
|
80
|
+
createdAt: string;
|
|
81
|
+
id: string;
|
|
82
|
+
version: string;
|
|
83
|
+
updatedAt: string;
|
|
84
|
+
access: string[];
|
|
85
|
+
description?: string | undefined;
|
|
86
|
+
} | undefined;
|
|
87
|
+
}, {
|
|
88
|
+
companyProfile: {
|
|
89
|
+
id: string;
|
|
90
|
+
displayName: string;
|
|
91
|
+
accountNo: string;
|
|
92
|
+
firstName?: string | null | undefined;
|
|
93
|
+
lastName?: string | null | undefined;
|
|
94
|
+
phone?: string | null | undefined;
|
|
95
|
+
email?: string | null | undefined;
|
|
96
|
+
autoApprove?: boolean | null | undefined;
|
|
97
|
+
version?: string | undefined;
|
|
98
|
+
};
|
|
99
|
+
version?: string | undefined;
|
|
100
|
+
role?: {
|
|
101
|
+
name: string;
|
|
102
|
+
createdAt: string;
|
|
103
|
+
id: string;
|
|
104
|
+
updatedAt: string;
|
|
105
|
+
access: string[];
|
|
106
|
+
version?: string | undefined;
|
|
107
|
+
description?: string | undefined;
|
|
108
|
+
} | undefined;
|
|
109
|
+
}>;
|
|
110
|
+
export type CompanyMembershipJSON = z.infer<typeof CompanyMembershipJSONSchema>;
|
|
111
|
+
export type CompanyMembershipData = {
|
|
112
|
+
companyProfile: Profile;
|
|
113
|
+
role?: Role;
|
|
114
|
+
};
|
|
115
|
+
/**
|
|
116
|
+
* Represents a user's membership within a company.
|
|
117
|
+
*
|
|
118
|
+
* This class encapsulates the relationship between a user and their company:
|
|
119
|
+
* - The company profile the user belongs to
|
|
120
|
+
* - The user's role within that company (optional - depends on permissions)
|
|
121
|
+
*
|
|
122
|
+
* Note: Permissions are stored in LogIn.access, not here.
|
|
123
|
+
* This model focuses purely on the company-user relationship.
|
|
124
|
+
*
|
|
125
|
+
* The role may be undefined if the user doesn't have permission to view
|
|
126
|
+
* role details (Permissions.Role.ViewRole).
|
|
127
|
+
*/
|
|
128
|
+
export declare class CompanyMembership {
|
|
129
|
+
private readonly _companyProfile;
|
|
130
|
+
private readonly _role?;
|
|
131
|
+
private constructor();
|
|
132
|
+
/**
|
|
133
|
+
* Creates a CompanyMembership instance from the required data.
|
|
134
|
+
*
|
|
135
|
+
* @param data - The membership data
|
|
136
|
+
* @returns A new CompanyMembership instance, or undefined if invalid
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* ```typescript
|
|
140
|
+
* const membership = CompanyMembership.from({
|
|
141
|
+
* companyProfile: profile,
|
|
142
|
+
* role: role // optional
|
|
143
|
+
* });
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
146
|
+
static from(data: CompanyMembershipData): CompanyMembership | undefined;
|
|
147
|
+
/**
|
|
148
|
+
* Gets the company profile.
|
|
149
|
+
*/
|
|
150
|
+
get companyProfile(): Profile;
|
|
151
|
+
/**
|
|
152
|
+
* Gets the user's role (may be undefined if user lacks permission to view it).
|
|
153
|
+
*/
|
|
154
|
+
get role(): Role | undefined;
|
|
155
|
+
/**
|
|
156
|
+
* Serializes the CompanyMembership instance to a JSON-compatible object
|
|
157
|
+
*/
|
|
158
|
+
toJSON(): CompanyMembershipJSON;
|
|
159
|
+
/**
|
|
160
|
+
* Serializes the CompanyMembership instance to a JSON string
|
|
161
|
+
*/
|
|
162
|
+
toJSONString(): string;
|
|
163
|
+
/**
|
|
164
|
+
* Creates a CompanyMembership instance from a JSON-compatible object or string
|
|
165
|
+
*/
|
|
166
|
+
static fromJSON(json: CompanyMembershipJSON | string): CompanyMembership | undefined;
|
|
167
|
+
/**
|
|
168
|
+
* Type guard using Zod schema validation
|
|
169
|
+
*/
|
|
170
|
+
static isCompanyMembershipJSON(obj: unknown): obj is CompanyMembershipJSON;
|
|
171
|
+
}
|