@temboplus/afloat 0.1.60 → 0.1.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +246 -42
- package/{esm/src/features/admin/contract.d.ts → dist/features/admin/admin.contract.d.ts} +41 -77
- package/{script/npm/src/src/features/admin/schemas.d.ts → dist/features/admin/admin.dtos.d.ts} +8 -9
- package/dist/features/admin/admin.repository.d.ts +179 -0
- package/dist/features/admin/index.d.ts +2 -0
- package/{esm/src/features/auth/access/contract.d.ts → dist/features/auth/access/access.api-contract.d.ts} +0 -1
- package/dist/features/auth/access/access.repository.d.ts +55 -0
- package/{esm/src/features/auth/contract.d.ts → dist/features/auth/auth.contract.d.ts} +12 -8
- package/dist/features/auth/auth.manager.d.ts +249 -0
- package/dist/features/auth/auth.repository.d.ts +66 -0
- package/dist/features/auth/auth.store.d.ts +139 -0
- package/{script/npm/src/src/features/auth/identity/contract.d.ts → dist/features/auth/identity/identity.api-contract.d.ts} +0 -1
- package/dist/features/auth/identity/identity.repository.d.ts +58 -0
- package/dist/features/auth/index.d.ts +5 -0
- package/{script/npm/src/src/features/auth/profile/contract.d.ts → dist/features/auth/profile/profile.api-contract.d.ts} +8 -6
- package/dist/features/auth/profile/profile.dtos.d.ts +80 -0
- package/dist/features/auth/profile/profile.repository.d.ts +56 -0
- package/{script/npm/src/src/features/auth/storage/client_store.d.ts → dist/features/auth/storage/client-store.d.ts} +2 -3
- package/{esm/src/features/auth/storage/client_token_handler.d.ts → dist/features/auth/storage/client-token-handler.d.ts} +1 -2
- package/{script/npm/src/src → dist}/features/auth/storage/types.d.ts +1 -2
- package/dist/features/contact/contact-input-handler.d.ts +16 -0
- package/{esm/src/features/contact/contract.d.ts → dist/features/contact/contact.api-contract.d.ts} +101 -45
- package/dist/features/contact/contact.dtos.d.ts +90 -0
- package/dist/features/contact/contact.repository.d.ts +116 -0
- package/dist/features/contact/index.d.ts +2 -0
- package/dist/features/payout/index.d.ts +3 -0
- package/dist/features/payout/payout-channel-handler.d.ts +108 -0
- package/{esm/src/features/payout/contract.d.ts → dist/features/payout/payout.api-contract.d.ts} +351 -187
- package/dist/features/payout/payout.dtos.d.ts +365 -0
- package/dist/features/payout/payout.repository.d.ts +193 -0
- package/dist/features/wallet/index.d.ts +4 -0
- package/dist/features/wallet/wallet-manager.session.d.ts +143 -0
- package/{script/npm/src/src/features/wallet/contract.d.ts → dist/features/wallet/wallet.contract.d.ts} +9 -7
- package/dist/features/wallet/wallet.dtos.d.ts +204 -0
- package/dist/features/wallet/wallet.repository.d.ts +120 -0
- package/dist/features/wallet/wallet.utils.d.ts +17 -0
- package/dist/index.cjs.js +2 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.esm.js +2 -0
- package/dist/index.esm.js.map +1 -0
- package/{esm/src/shared/base_repository.d.ts → dist/lib/api/base-repository.d.ts} +137 -42
- package/{script/npm/src/src/shared/common_responses.d.ts → dist/lib/api/common-responses.d.ts} +0 -1
- package/dist/lib/api/index.d.ts +2 -0
- package/{esm/src/errors/api_error.d.ts → dist/lib/error/error.api.d.ts} +0 -1
- package/{script/npm/src/src/errors/permission_error.d.ts → dist/lib/error/error.permission.d.ts} +1 -2
- package/dist/lib/error/error.utils.d.ts +22 -0
- package/dist/lib/error/index.d.ts +3 -0
- package/dist/models/contact-info.model.d.ts +817 -0
- package/{script/npm/src/src/models/contact/derivatives/contact.d.ts → dist/models/contact.model.d.ts} +23 -16
- package/dist/models/index.d.ts +11 -0
- package/{esm/src/models/user/managed-user.d.ts → dist/models/managed-user.model.d.ts} +3 -3
- package/dist/models/narration.model.d.ts +184 -0
- package/{script/npm/src/src/models/payout/derivatives/payout.d.ts → dist/models/payout.model.d.ts} +13 -17
- package/{esm/src → dist}/models/permission.d.ts +1 -2
- package/{script/npm/src/src/models/user/profile.d.ts → dist/models/profile.model.d.ts} +37 -43
- package/{script/npm/src/src/models/role.d.ts → dist/models/role.model.d.ts} +2 -10
- package/dist/models/statement-entry.model.d.ts +248 -0
- package/dist/models/user.model.d.ts +65 -0
- package/{script/npm/src/src/models/wallet/wallet.d.ts → dist/models/wallet.model.d.ts} +3 -46
- package/package.json +47 -25
- package/LICENSE +0 -7
- package/esm/_dnt.test_shims.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/almost_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/array_includes.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/assert.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/assertion_error.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/equal.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/exists.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/fail.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/false.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/greater.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/instance_of.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/is_error.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/less.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/less_or_equal.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/mod.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/not_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/not_instance_of.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/not_match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/object_match.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/rejects.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/strict_equals.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/string_includes.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/throws.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/unimplemented.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/assert/1.0.10/unreachable.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +0 -1
- package/esm/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +0 -1
- package/esm/mod.d.ts +0 -8
- package/esm/mod.d.ts.map +0 -1
- package/esm/mod.js +0 -7
- package/esm/package.json +0 -3
- package/esm/src/errors/api_error.d.ts.map +0 -1
- package/esm/src/errors/api_error.js +0 -90
- package/esm/src/errors/index.d.ts +0 -3
- package/esm/src/errors/index.d.ts.map +0 -1
- package/esm/src/errors/index.js +0 -2
- package/esm/src/errors/permission_error.d.ts +0 -48
- package/esm/src/errors/permission_error.d.ts.map +0 -1
- package/esm/src/errors/permission_error.js +0 -70
- package/esm/src/features/admin/contract.d.ts.map +0 -1
- package/esm/src/features/admin/contract.js +0 -210
- package/esm/src/features/admin/index.d.ts +0 -4
- package/esm/src/features/admin/index.d.ts.map +0 -1
- package/esm/src/features/admin/index.js +0 -3
- package/esm/src/features/admin/repository.d.ts +0 -114
- package/esm/src/features/admin/repository.d.ts.map +0 -1
- package/esm/src/features/admin/repository.js +0 -248
- package/esm/src/features/admin/schemas.d.ts +0 -146
- package/esm/src/features/admin/schemas.d.ts.map +0 -1
- package/esm/src/features/admin/schemas.js +0 -206
- package/esm/src/features/auth/access/contract.d.ts.map +0 -1
- package/esm/src/features/auth/access/contract.js +0 -14
- package/esm/src/features/auth/access/repository.d.ts +0 -11
- package/esm/src/features/auth/access/repository.d.ts.map +0 -1
- package/esm/src/features/auth/access/repository.js +0 -25
- package/esm/src/features/auth/contract.d.ts.map +0 -1
- package/esm/src/features/auth/contract.js +0 -43
- package/esm/src/features/auth/identity/contract.d.ts +0 -23
- package/esm/src/features/auth/identity/contract.d.ts.map +0 -1
- package/esm/src/features/auth/identity/contract.js +0 -17
- package/esm/src/features/auth/identity/repository.d.ts +0 -22
- package/esm/src/features/auth/identity/repository.d.ts.map +0 -1
- package/esm/src/features/auth/identity/repository.js +0 -30
- package/esm/src/features/auth/index.d.ts +0 -6
- package/esm/src/features/auth/index.d.ts.map +0 -1
- package/esm/src/features/auth/index.js +0 -5
- package/esm/src/features/auth/manager.d.ts +0 -105
- package/esm/src/features/auth/manager.d.ts.map +0 -1
- package/esm/src/features/auth/manager.js +0 -181
- package/esm/src/features/auth/profile/contract.d.ts +0 -37
- package/esm/src/features/auth/profile/contract.d.ts.map +0 -1
- package/esm/src/features/auth/profile/contract.js +0 -14
- package/esm/src/features/auth/profile/repository.d.ts +0 -11
- package/esm/src/features/auth/profile/repository.d.ts.map +0 -1
- package/esm/src/features/auth/profile/repository.js +0 -25
- package/esm/src/features/auth/repository.d.ts +0 -30
- package/esm/src/features/auth/repository.d.ts.map +0 -1
- package/esm/src/features/auth/repository.js +0 -69
- package/esm/src/features/auth/storage/client_store.d.ts +0 -30
- package/esm/src/features/auth/storage/client_store.d.ts.map +0 -1
- package/esm/src/features/auth/storage/client_store.js +0 -46
- package/esm/src/features/auth/storage/client_token_handler.d.ts.map +0 -1
- package/esm/src/features/auth/storage/client_token_handler.js +0 -36
- package/esm/src/features/auth/storage/server_store.d.ts +0 -24
- package/esm/src/features/auth/storage/server_store.d.ts.map +0 -1
- package/esm/src/features/auth/storage/server_store.js +0 -34
- package/esm/src/features/auth/storage/server_token_handler.d.ts +0 -36
- package/esm/src/features/auth/storage/server_token_handler.d.ts.map +0 -1
- package/esm/src/features/auth/storage/server_token_handler.js +0 -115
- package/esm/src/features/auth/storage/types.d.ts +0 -42
- package/esm/src/features/auth/storage/types.d.ts.map +0 -1
- package/esm/src/features/auth/storage/types.js +0 -1
- package/esm/src/features/contact/contract.d.ts.map +0 -1
- package/esm/src/features/contact/contract.js +0 -49
- package/esm/src/features/contact/index.d.ts +0 -2
- package/esm/src/features/contact/index.d.ts.map +0 -1
- package/esm/src/features/contact/index.js +0 -1
- package/esm/src/features/contact/repository.d.ts +0 -58
- package/esm/src/features/contact/repository.d.ts.map +0 -1
- package/esm/src/features/contact/repository.js +0 -108
- package/esm/src/features/payout/contract.d.ts.map +0 -1
- package/esm/src/features/payout/contract.js +0 -75
- package/esm/src/features/payout/index.d.ts +0 -2
- package/esm/src/features/payout/index.d.ts.map +0 -1
- package/esm/src/features/payout/index.js +0 -1
- package/esm/src/features/payout/repository.d.ts +0 -67
- package/esm/src/features/payout/repository.d.ts.map +0 -1
- package/esm/src/features/payout/repository.js +0 -163
- package/esm/src/features/wallet/contract.d.ts +0 -137
- package/esm/src/features/wallet/contract.d.ts.map +0 -1
- package/esm/src/features/wallet/contract.js +0 -38
- package/esm/src/features/wallet/index.d.ts +0 -2
- package/esm/src/features/wallet/index.d.ts.map +0 -1
- package/esm/src/features/wallet/index.js +0 -1
- package/esm/src/features/wallet/repository.d.ts +0 -57
- package/esm/src/features/wallet/repository.d.ts.map +0 -1
- package/esm/src/features/wallet/repository.js +0 -93
- package/esm/src/models/contact/derivatives/contact.d.ts +0 -172
- package/esm/src/models/contact/derivatives/contact.d.ts.map +0 -1
- package/esm/src/models/contact/derivatives/contact.js +0 -266
- package/esm/src/models/contact/derivatives/contact.test.d.ts.map +0 -1
- 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/derivatives/contact_info.test.d.ts.map +0 -1
- 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/contact/validation.test.d.ts.map +0 -1
- package/esm/src/models/index.d.ts +0 -7
- package/esm/src/models/index.d.ts.map +0 -1
- package/esm/src/models/index.js +0 -6
- package/esm/src/models/payout/api.d.ts +0 -29
- package/esm/src/models/payout/api.d.ts.map +0 -1
- package/esm/src/models/payout/api.js +0 -1
- package/esm/src/models/payout/channel.d.ts +0 -58
- package/esm/src/models/payout/channel.d.ts.map +0 -1
- package/esm/src/models/payout/channel.js +0 -53
- package/esm/src/models/payout/derivatives/payout.d.ts +0 -158
- package/esm/src/models/payout/derivatives/payout.d.ts.map +0 -1
- package/esm/src/models/payout/derivatives/payout.js +0 -265
- package/esm/src/models/payout/derivatives/payout.test.d.ts.map +0 -1
- package/esm/src/models/payout/index.d.ts +0 -7
- package/esm/src/models/payout/index.d.ts.map +0 -1
- package/esm/src/models/payout/index.js +0 -6
- package/esm/src/models/payout/narration.d.ts +0 -164
- package/esm/src/models/payout/narration.d.ts.map +0 -1
- package/esm/src/models/payout/narration.js +0 -308
- package/esm/src/models/payout/schemas.d.ts +0 -156
- package/esm/src/models/payout/schemas.d.ts.map +0 -1
- package/esm/src/models/payout/schemas.js +0 -105
- package/esm/src/models/payout/status.d.ts +0 -33
- package/esm/src/models/payout/status.d.ts.map +0 -1
- package/esm/src/models/payout/status.js +0 -34
- package/esm/src/models/permission.d.ts.map +0 -1
- package/esm/src/models/permission.js +0 -50
- package/esm/src/models/role.d.ts +0 -21
- package/esm/src/models/role.d.ts.map +0 -1
- package/esm/src/models/role.js +0 -73
- package/esm/src/models/user/authenticated-user.d.ts +0 -77
- package/esm/src/models/user/authenticated-user.d.ts.map +0 -1
- package/esm/src/models/user/authenticated-user.js +0 -226
- package/esm/src/models/user/index.d.ts +0 -4
- package/esm/src/models/user/index.d.ts.map +0 -1
- package/esm/src/models/user/index.js +0 -3
- package/esm/src/models/user/managed-user.d.ts.map +0 -1
- package/esm/src/models/user/managed-user.js +0 -255
- package/esm/src/models/user/profile.d.ts +0 -161
- package/esm/src/models/user/profile.d.ts.map +0 -1
- package/esm/src/models/user/profile.js +0 -334
- package/esm/src/models/wallet/index.d.ts +0 -4
- package/esm/src/models/wallet/index.d.ts.map +0 -1
- package/esm/src/models/wallet/index.js +0 -3
- package/esm/src/models/wallet/schemas.d.ts +0 -95
- package/esm/src/models/wallet/schemas.d.ts.map +0 -1
- package/esm/src/models/wallet/schemas.js +0 -35
- package/esm/src/models/wallet/statement_entry.d.ts +0 -160
- package/esm/src/models/wallet/statement_entry.d.ts.map +0 -1
- package/esm/src/models/wallet/statement_entry.js +0 -255
- package/esm/src/models/wallet/wallet.d.ts +0 -147
- package/esm/src/models/wallet/wallet.d.ts.map +0 -1
- package/esm/src/models/wallet/wallet.js +0 -279
- package/esm/src/shared/base_repository.d.ts.map +0 -1
- package/esm/src/shared/base_repository.js +0 -153
- package/esm/src/shared/common_responses.d.ts +0 -13
- package/esm/src/shared/common_responses.d.ts.map +0 -1
- package/esm/src/shared/common_responses.js +0 -10
- package/esm/src/shared/index.d.ts +0 -3
- package/esm/src/shared/index.d.ts.map +0 -1
- package/esm/src/shared/index.js +0 -2
- package/esm/src/shared/token_required_repository.d.ts +0 -78
- package/esm/src/shared/token_required_repository.d.ts.map +0 -1
- package/esm/src/shared/token_required_repository.js +0 -128
- package/script/mod.d.ts +0 -8
- package/script/mod.d.ts.map +0 -1
- package/script/mod.js +0 -23
- package/script/npm/src/_dnt.test_shims.d.ts +0 -6
- package/script/npm/src/_dnt.test_shims.d.ts.map +0 -1
- package/script/npm/src/_dnt.test_shims.js +0 -65
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/almost_equals.d.ts +0 -29
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/almost_equals.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/almost_equals.js +0 -49
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/array_includes.d.ts +0 -24
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/array_includes.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/array_includes.js +0 -49
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/assert.d.ts +0 -16
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/assert.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/assert.js +0 -25
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/assertion_error.d.ts +0 -26
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/assertion_error.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/assertion_error.js +0 -34
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/equal.d.ts +0 -17
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/equal.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/equal.js +0 -209
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/equals.d.ts +0 -35
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/equals.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/equals.js +0 -61
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/exists.d.ts +0 -18
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/exists.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/exists.js +0 -30
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/fail.d.ts +0 -15
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/fail.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/fail.js +0 -23
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/false.d.ts +0 -18
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/false.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/false.js +0 -25
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/greater.d.ts +0 -20
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/greater.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/greater.js +0 -32
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.d.ts +0 -20
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.js +0 -32
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/instance_of.d.ts +0 -23
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/instance_of.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/instance_of.js +0 -55
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/is_error.d.ts +0 -25
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/is_error.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/is_error.js +0 -56
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/less.d.ts +0 -19
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/less.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/less.js +0 -31
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/less_or_equal.d.ts +0 -20
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/less_or_equal.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/less_or_equal.js +0 -32
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/match.d.ts +0 -18
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/match.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/match.js +0 -29
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/mod.d.ts +0 -44
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/mod.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/mod.js +0 -61
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/not_equals.d.ts +0 -21
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/not_equals.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/not_equals.js +0 -36
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/not_instance_of.d.ts +0 -20
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/not_instance_of.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/not_instance_of.js +0 -32
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/not_match.d.ts +0 -18
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/not_match.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/not_match.js +0 -29
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.d.ts +0 -23
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.js +0 -35
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/object_match.d.ts +0 -29
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/object_match.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/object_match.js +0 -163
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/rejects.d.ts +0 -42
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/rejects.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/rejects.js +0 -56
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/strict_equals.d.ts +0 -24
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/strict_equals.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/strict_equals.js +0 -60
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/string_includes.d.ts +0 -18
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/string_includes.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/string_includes.js +0 -29
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/throws.d.ts +0 -45
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/throws.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/throws.js +0 -47
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/unimplemented.d.ts +0 -15
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/unimplemented.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/unimplemented.js +0 -23
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/unreachable.d.ts +0 -15
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/unreachable.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/assert/1.0.10/unreachable.js +0 -23
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts +0 -82
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/build_message.js +0 -115
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/diff.d.ts +0 -140
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/diff.js +0 -283
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts +0 -99
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/diff_str.js +0 -185
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/format.d.ts +0 -2
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/format.js +0 -63
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/styles.d.ts +0 -159
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/styles.js +0 -242
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/types.d.ts +0 -16
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +0 -1
- package/script/npm/src/deps/jsr.io/@std/internal/1.0.5/types.js +0 -3
- package/script/npm/src/mod.d.ts +0 -8
- package/script/npm/src/mod.d.ts.map +0 -1
- package/script/npm/src/mod.js +0 -23
- package/script/npm/src/src/errors/api_error.d.ts +0 -63
- package/script/npm/src/src/errors/api_error.d.ts.map +0 -1
- package/script/npm/src/src/errors/api_error.js +0 -94
- package/script/npm/src/src/errors/index.d.ts +0 -3
- package/script/npm/src/src/errors/index.d.ts.map +0 -1
- package/script/npm/src/src/errors/index.js +0 -18
- package/script/npm/src/src/errors/permission_error.d.ts.map +0 -1
- package/script/npm/src/src/errors/permission_error.js +0 -74
- package/script/npm/src/src/features/admin/contract.d.ts +0 -842
- package/script/npm/src/src/features/admin/contract.d.ts.map +0 -1
- package/script/npm/src/src/features/admin/contract.js +0 -213
- package/script/npm/src/src/features/admin/index.d.ts +0 -4
- package/script/npm/src/src/features/admin/index.d.ts.map +0 -1
- package/script/npm/src/src/features/admin/index.js +0 -19
- package/script/npm/src/src/features/admin/repository.d.ts +0 -114
- package/script/npm/src/src/features/admin/repository.d.ts.map +0 -1
- package/script/npm/src/src/features/admin/repository.js +0 -252
- package/script/npm/src/src/features/admin/schemas.d.ts.map +0 -1
- package/script/npm/src/src/features/admin/schemas.js +0 -209
- package/script/npm/src/src/features/auth/access/contract.d.ts +0 -14
- package/script/npm/src/src/features/auth/access/contract.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/access/contract.js +0 -17
- package/script/npm/src/src/features/auth/access/repository.d.ts +0 -11
- package/script/npm/src/src/features/auth/access/repository.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/access/repository.js +0 -29
- package/script/npm/src/src/features/auth/contract.d.ts +0 -112
- package/script/npm/src/src/features/auth/contract.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/contract.js +0 -46
- package/script/npm/src/src/features/auth/identity/contract.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/identity/contract.js +0 -20
- package/script/npm/src/src/features/auth/identity/repository.d.ts +0 -22
- package/script/npm/src/src/features/auth/identity/repository.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/identity/repository.js +0 -34
- package/script/npm/src/src/features/auth/index.d.ts +0 -6
- package/script/npm/src/src/features/auth/index.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/index.js +0 -21
- package/script/npm/src/src/features/auth/manager.d.ts +0 -105
- package/script/npm/src/src/features/auth/manager.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/manager.js +0 -185
- package/script/npm/src/src/features/auth/profile/contract.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/profile/contract.js +0 -17
- package/script/npm/src/src/features/auth/profile/repository.d.ts +0 -11
- package/script/npm/src/src/features/auth/profile/repository.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/profile/repository.js +0 -29
- package/script/npm/src/src/features/auth/repository.d.ts +0 -30
- package/script/npm/src/src/features/auth/repository.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/repository.js +0 -73
- package/script/npm/src/src/features/auth/storage/client_store.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/storage/client_store.js +0 -51
- package/script/npm/src/src/features/auth/storage/client_token_handler.d.ts +0 -32
- package/script/npm/src/src/features/auth/storage/client_token_handler.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/storage/client_token_handler.js +0 -40
- package/script/npm/src/src/features/auth/storage/server_store.d.ts +0 -24
- package/script/npm/src/src/features/auth/storage/server_store.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/storage/server_store.js +0 -38
- package/script/npm/src/src/features/auth/storage/server_token_handler.d.ts +0 -36
- package/script/npm/src/src/features/auth/storage/server_token_handler.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/storage/server_token_handler.js +0 -119
- package/script/npm/src/src/features/auth/storage/types.d.ts.map +0 -1
- package/script/npm/src/src/features/auth/storage/types.js +0 -2
- package/script/npm/src/src/features/contact/contract.d.ts +0 -170
- package/script/npm/src/src/features/contact/contract.d.ts.map +0 -1
- package/script/npm/src/src/features/contact/contract.js +0 -52
- package/script/npm/src/src/features/contact/index.d.ts +0 -2
- package/script/npm/src/src/features/contact/index.d.ts.map +0 -1
- package/script/npm/src/src/features/contact/index.js +0 -17
- package/script/npm/src/src/features/contact/repository.d.ts +0 -58
- package/script/npm/src/src/features/contact/repository.d.ts.map +0 -1
- package/script/npm/src/src/features/contact/repository.js +0 -112
- package/script/npm/src/src/features/payout/contract.d.ts +0 -623
- package/script/npm/src/src/features/payout/contract.d.ts.map +0 -1
- package/script/npm/src/src/features/payout/contract.js +0 -78
- package/script/npm/src/src/features/payout/index.d.ts +0 -2
- package/script/npm/src/src/features/payout/index.d.ts.map +0 -1
- package/script/npm/src/src/features/payout/index.js +0 -17
- package/script/npm/src/src/features/payout/repository.d.ts +0 -67
- package/script/npm/src/src/features/payout/repository.d.ts.map +0 -1
- package/script/npm/src/src/features/payout/repository.js +0 -167
- package/script/npm/src/src/features/wallet/contract.d.ts.map +0 -1
- package/script/npm/src/src/features/wallet/contract.js +0 -41
- package/script/npm/src/src/features/wallet/index.d.ts +0 -2
- package/script/npm/src/src/features/wallet/index.d.ts.map +0 -1
- package/script/npm/src/src/features/wallet/index.js +0 -17
- package/script/npm/src/src/features/wallet/repository.d.ts +0 -57
- package/script/npm/src/src/features/wallet/repository.d.ts.map +0 -1
- package/script/npm/src/src/features/wallet/repository.js +0 -97
- package/script/npm/src/src/models/contact/derivatives/contact.d.ts.map +0 -1
- package/script/npm/src/src/models/contact/derivatives/contact.js +0 -270
- package/script/npm/src/src/models/contact/derivatives/contact.test.d.ts +0 -1
- package/script/npm/src/src/models/contact/derivatives/contact.test.d.ts.map +0 -1
- package/script/npm/src/src/models/contact/derivatives/contact.test.js +0 -64
- 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/derivatives/contact_info.test.d.ts +0 -1
- package/script/npm/src/src/models/contact/derivatives/contact_info.test.d.ts.map +0 -1
- package/script/npm/src/src/models/contact/derivatives/contact_info.test.js +0 -331
- 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/contact/validation.test.d.ts +0 -2
- package/script/npm/src/src/models/contact/validation.test.d.ts.map +0 -1
- package/script/npm/src/src/models/contact/validation.test.js +0 -186
- package/script/npm/src/src/models/index.d.ts +0 -7
- package/script/npm/src/src/models/index.d.ts.map +0 -1
- package/script/npm/src/src/models/index.js +0 -22
- package/script/npm/src/src/models/payout/api.d.ts +0 -29
- package/script/npm/src/src/models/payout/api.d.ts.map +0 -1
- package/script/npm/src/src/models/payout/api.js +0 -2
- package/script/npm/src/src/models/payout/channel.d.ts +0 -58
- package/script/npm/src/src/models/payout/channel.d.ts.map +0 -1
- package/script/npm/src/src/models/payout/channel.js +0 -56
- package/script/npm/src/src/models/payout/derivatives/payout.d.ts.map +0 -1
- package/script/npm/src/src/models/payout/derivatives/payout.js +0 -269
- package/script/npm/src/src/models/payout/derivatives/payout.test.d.ts +0 -1
- package/script/npm/src/src/models/payout/derivatives/payout.test.d.ts.map +0 -1
- package/script/npm/src/src/models/payout/derivatives/payout.test.js +0 -76
- package/script/npm/src/src/models/payout/index.d.ts +0 -7
- package/script/npm/src/src/models/payout/index.d.ts.map +0 -1
- package/script/npm/src/src/models/payout/index.js +0 -22
- package/script/npm/src/src/models/payout/narration.d.ts +0 -164
- package/script/npm/src/src/models/payout/narration.d.ts.map +0 -1
- package/script/npm/src/src/models/payout/narration.js +0 -312
- package/script/npm/src/src/models/payout/schemas.d.ts +0 -156
- package/script/npm/src/src/models/payout/schemas.d.ts.map +0 -1
- package/script/npm/src/src/models/payout/schemas.js +0 -108
- package/script/npm/src/src/models/payout/status.d.ts +0 -33
- package/script/npm/src/src/models/payout/status.d.ts.map +0 -1
- package/script/npm/src/src/models/payout/status.js +0 -37
- package/script/npm/src/src/models/permission.d.ts +0 -55
- package/script/npm/src/src/models/permission.d.ts.map +0 -1
- package/script/npm/src/src/models/permission.js +0 -53
- package/script/npm/src/src/models/role.d.ts.map +0 -1
- package/script/npm/src/src/models/role.js +0 -77
- package/script/npm/src/src/models/user/authenticated-user.d.ts +0 -77
- package/script/npm/src/src/models/user/authenticated-user.d.ts.map +0 -1
- package/script/npm/src/src/models/user/authenticated-user.js +0 -230
- package/script/npm/src/src/models/user/index.d.ts +0 -4
- package/script/npm/src/src/models/user/index.d.ts.map +0 -1
- package/script/npm/src/src/models/user/index.js +0 -19
- package/script/npm/src/src/models/user/managed-user.d.ts +0 -108
- package/script/npm/src/src/models/user/managed-user.d.ts.map +0 -1
- package/script/npm/src/src/models/user/managed-user.js +0 -260
- package/script/npm/src/src/models/user/profile.d.ts.map +0 -1
- package/script/npm/src/src/models/user/profile.js +0 -338
- package/script/npm/src/src/models/wallet/index.d.ts +0 -4
- package/script/npm/src/src/models/wallet/index.d.ts.map +0 -1
- package/script/npm/src/src/models/wallet/index.js +0 -19
- package/script/npm/src/src/models/wallet/schemas.d.ts +0 -95
- package/script/npm/src/src/models/wallet/schemas.d.ts.map +0 -1
- package/script/npm/src/src/models/wallet/schemas.js +0 -38
- package/script/npm/src/src/models/wallet/statement_entry.d.ts +0 -160
- package/script/npm/src/src/models/wallet/statement_entry.d.ts.map +0 -1
- package/script/npm/src/src/models/wallet/statement_entry.js +0 -259
- package/script/npm/src/src/models/wallet/wallet.d.ts.map +0 -1
- package/script/npm/src/src/models/wallet/wallet.js +0 -283
- package/script/npm/src/src/shared/base_repository.d.ts +0 -80
- package/script/npm/src/src/shared/base_repository.d.ts.map +0 -1
- package/script/npm/src/src/shared/base_repository.js +0 -157
- package/script/npm/src/src/shared/common_responses.d.ts.map +0 -1
- package/script/npm/src/src/shared/common_responses.js +0 -13
- package/script/npm/src/src/shared/index.d.ts +0 -3
- package/script/npm/src/src/shared/index.d.ts.map +0 -1
- package/script/npm/src/src/shared/index.js +0 -18
- package/script/npm/src/src/shared/token_required_repository.d.ts +0 -78
- package/script/npm/src/src/shared/token_required_repository.d.ts.map +0 -1
- package/script/npm/src/src/shared/token_required_repository.js +0 -132
- package/script/package.json +0 -3
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { BaseRepository } from "@/lib/api/base-repository";
|
|
2
|
+
import { accessContract } from "./access.api-contract";
|
|
3
|
+
/**
|
|
4
|
+
* Repository class for managing access-related operations.
|
|
5
|
+
* Handles retrieving user access lists and permissions from the API.
|
|
6
|
+
*
|
|
7
|
+
* This repository handles pure API communication without permission checking.
|
|
8
|
+
* Permission validation should be handled at the service layer or route handlers.
|
|
9
|
+
*
|
|
10
|
+
* @extends {BaseRepository<typeof accessContract>}
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* const repo = new AccessRepository({ token: userToken });
|
|
15
|
+
* const accessList = await repo.getAccessList();
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare class AccessRepository extends BaseRepository<typeof accessContract> {
|
|
19
|
+
/**
|
|
20
|
+
* Creates an instance of AccessRepository.
|
|
21
|
+
*
|
|
22
|
+
* @param options - Optional configuration
|
|
23
|
+
* @param options.token - Authentication token for API calls
|
|
24
|
+
* @param options.root - Custom API root URL
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* const repo = new AccessRepository({
|
|
29
|
+
* token: "user-auth-token",
|
|
30
|
+
* root: "base-api-url"
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
constructor(options?: {
|
|
35
|
+
token?: string;
|
|
36
|
+
root?: string;
|
|
37
|
+
});
|
|
38
|
+
/**
|
|
39
|
+
* Retrieves the current user's access list.
|
|
40
|
+
*
|
|
41
|
+
* @returns Promise that resolves to an array of access permissions/roles
|
|
42
|
+
* @throws {APIError} If the request fails or returns an unexpected status
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```typescript
|
|
46
|
+
* try {
|
|
47
|
+
* const accessList = await repo.getAccessList();
|
|
48
|
+
* console.log("User has access to:", accessList);
|
|
49
|
+
* } catch (error) {
|
|
50
|
+
* console.error("Failed to get access list:", error.message);
|
|
51
|
+
* }
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
getAccessList(): Promise<string[]>;
|
|
55
|
+
}
|
|
@@ -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,6 +47,7 @@ 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">;
|
|
@@ -59,6 +62,7 @@ export declare const authContract: {
|
|
|
59
62
|
lastName?: string | null | undefined;
|
|
60
63
|
phone?: string | null | undefined;
|
|
61
64
|
email?: string | null | undefined;
|
|
65
|
+
autoApprove?: boolean | null | undefined;
|
|
62
66
|
};
|
|
63
67
|
token: string;
|
|
64
68
|
access: string[];
|
|
@@ -72,6 +76,7 @@ export declare const authContract: {
|
|
|
72
76
|
lastName?: string | null | undefined;
|
|
73
77
|
phone?: string | null | undefined;
|
|
74
78
|
email?: string | null | undefined;
|
|
79
|
+
autoApprove?: boolean | null | undefined;
|
|
75
80
|
};
|
|
76
81
|
token: string;
|
|
77
82
|
access: string[];
|
|
@@ -99,14 +104,13 @@ export declare const authContract: {
|
|
|
99
104
|
currentPassword: z.ZodString;
|
|
100
105
|
newPassword: z.ZodString;
|
|
101
106
|
}, "strip", z.ZodTypeAny, {
|
|
102
|
-
currentPassword: string;
|
|
103
107
|
newPassword: string;
|
|
104
|
-
}, {
|
|
105
108
|
currentPassword: string;
|
|
109
|
+
}, {
|
|
106
110
|
newPassword: string;
|
|
111
|
+
currentPassword: string;
|
|
107
112
|
}>;
|
|
108
113
|
path: "/password";
|
|
109
114
|
responses: {};
|
|
110
115
|
};
|
|
111
116
|
};
|
|
112
|
-
//# sourceMappingURL=contract.d.ts.map
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { User } from "@/models/user.model";
|
|
2
|
+
import { Permission } from "@/models/permission";
|
|
3
|
+
/**
|
|
4
|
+
* Clean authentication manager for client-side usage only.
|
|
5
|
+
*
|
|
6
|
+
* This class provides a centralized way to manage user authentication state,
|
|
7
|
+
* including login, logout, and permission checking. It uses a singleton pattern
|
|
8
|
+
* for client-side usage and directly interfaces with the unified auth store.
|
|
9
|
+
*
|
|
10
|
+
* **Architecture:**
|
|
11
|
+
* - **Client-side**: Use the singleton instance via `AfloatAuth.instance`
|
|
12
|
+
* - **Server-side**: Pass tokens directly to repositories (no auth manager needed)
|
|
13
|
+
*
|
|
14
|
+
* **Features:**
|
|
15
|
+
* - Direct integration with unified auth store
|
|
16
|
+
* - React hooks for reactive UI updates
|
|
17
|
+
* - Permission checking utilities
|
|
18
|
+
* - Automatic wallet session management
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* // Client-side usage
|
|
23
|
+
* const auth = AfloatAuth.instance;
|
|
24
|
+
* const user = await auth.logIn(email, password);
|
|
25
|
+
*
|
|
26
|
+
* // Server-side usage (no auth manager needed)
|
|
27
|
+
* const walletRepo = new WalletRepository({ token: extractedToken });
|
|
28
|
+
* const balance = await walletRepo.getBalance({ wallet });
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare class AfloatAuth {
|
|
32
|
+
/** Client-side singleton instance */
|
|
33
|
+
private static _instance;
|
|
34
|
+
/**
|
|
35
|
+
* Private constructor to control instantiation.
|
|
36
|
+
* Use the static instance getter instead.
|
|
37
|
+
*
|
|
38
|
+
* @private
|
|
39
|
+
*/
|
|
40
|
+
private constructor();
|
|
41
|
+
/**
|
|
42
|
+
* Gets or creates the client-side singleton instance.
|
|
43
|
+
*
|
|
44
|
+
* @returns The client-side singleton instance
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* const auth = AfloatAuth.instance;
|
|
49
|
+
* if (auth.currentUser) {
|
|
50
|
+
* console.log("User is logged in");
|
|
51
|
+
* }
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
static get instance(): AfloatAuth;
|
|
55
|
+
/**
|
|
56
|
+
* Gets the authentication repository for API operations.
|
|
57
|
+
*
|
|
58
|
+
* @private
|
|
59
|
+
* @returns The auth repository instance with current token
|
|
60
|
+
*/
|
|
61
|
+
private get repo();
|
|
62
|
+
/**
|
|
63
|
+
* Gets the current authentication token.
|
|
64
|
+
*
|
|
65
|
+
* @returns The current authentication token, or undefined if not authenticated
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```typescript
|
|
69
|
+
* const token = auth.getUserToken();
|
|
70
|
+
* if (token) {
|
|
71
|
+
* const apiClient = new SomeRepository({ token });
|
|
72
|
+
* }
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
getUserToken(): string | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* Gets the currently authenticated user.
|
|
78
|
+
*
|
|
79
|
+
* @returns The current user instance, or undefined if not authenticated
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```typescript
|
|
83
|
+
* const user = auth.currentUser;
|
|
84
|
+
* if (user) {
|
|
85
|
+
* console.log(`Welcome, ${user.name}!`);
|
|
86
|
+
* }
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
get currentUser(): User | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* Checks if a user is currently authenticated.
|
|
92
|
+
*
|
|
93
|
+
* @returns True if user is authenticated, false otherwise
|
|
94
|
+
*
|
|
95
|
+
* @example
|
|
96
|
+
* ```typescript
|
|
97
|
+
* if (auth.isAuthenticated) {
|
|
98
|
+
* // User is logged in
|
|
99
|
+
* showDashboard();
|
|
100
|
+
* } else {
|
|
101
|
+
* // User needs to log in
|
|
102
|
+
* showLoginForm();
|
|
103
|
+
* }
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
get isAuthenticated(): boolean;
|
|
107
|
+
/**
|
|
108
|
+
* React hook for accessing the current user in client-side components.
|
|
109
|
+
*
|
|
110
|
+
* This hook provides reactive updates when the user state changes,
|
|
111
|
+
* making it perfect for React components that need to respond to
|
|
112
|
+
* authentication state changes.
|
|
113
|
+
*
|
|
114
|
+
* @returns The current user with reactive updates, or undefined if not authenticated
|
|
115
|
+
* @throws {Error} If called in a server environment
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```typescript
|
|
119
|
+
* function UserProfile() {
|
|
120
|
+
* const user = AfloatAuth.instance.useCurrentUser();
|
|
121
|
+
*
|
|
122
|
+
* if (!user) {
|
|
123
|
+
* return <LoginForm />;
|
|
124
|
+
* }
|
|
125
|
+
*
|
|
126
|
+
* return <div>Hello, {user.name}!</div>;
|
|
127
|
+
* }
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
useCurrentUser(): User | undefined;
|
|
131
|
+
/**
|
|
132
|
+
* Checks if the current user has a specific permission.
|
|
133
|
+
*
|
|
134
|
+
* @param perm - The permission to check
|
|
135
|
+
* @returns True if the user has the permission, false otherwise
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* ```typescript
|
|
139
|
+
* if (auth.checkPermission(Permission.ViewBalance)) {
|
|
140
|
+
* // User can view wallet balance
|
|
141
|
+
* const walletRepo = new WalletRepository({ token: auth.getUserToken() });
|
|
142
|
+
* const balance = await walletRepo.getBalance(wallet);
|
|
143
|
+
* } else {
|
|
144
|
+
* console.log("User doesn't have permission to view balance");
|
|
145
|
+
* }
|
|
146
|
+
* ```
|
|
147
|
+
*/
|
|
148
|
+
checkPermission(perm: Permission): boolean;
|
|
149
|
+
/**
|
|
150
|
+
* Authenticates a user with email and password.
|
|
151
|
+
*
|
|
152
|
+
* On successful authentication:
|
|
153
|
+
* - Clears any existing auth data
|
|
154
|
+
* - Stores the new user and token atomically
|
|
155
|
+
* - Initializes related services (wallet manager)
|
|
156
|
+
*
|
|
157
|
+
* @param email - The user's email address
|
|
158
|
+
* @param password - The user's password
|
|
159
|
+
* @returns Promise resolving to the authenticated user
|
|
160
|
+
* @throws {Error} If authentication fails
|
|
161
|
+
*
|
|
162
|
+
* @example
|
|
163
|
+
* ```typescript
|
|
164
|
+
* try {
|
|
165
|
+
* const user = await auth.logIn("user@example.com", "password123");
|
|
166
|
+
* console.log("Login successful!");
|
|
167
|
+
* router.push("/dashboard");
|
|
168
|
+
* } catch (error) {
|
|
169
|
+
* console.error("Login failed:", error.message);
|
|
170
|
+
* setError("Invalid credentials");
|
|
171
|
+
* }
|
|
172
|
+
* ```
|
|
173
|
+
*/
|
|
174
|
+
logIn(email: string, password: string): Promise<User>;
|
|
175
|
+
/**
|
|
176
|
+
* Updates the current user's password.
|
|
177
|
+
*
|
|
178
|
+
* @param currentPassword - The user's current password
|
|
179
|
+
* @param newPassword - The new password to set
|
|
180
|
+
* @returns Promise resolving to true if successful
|
|
181
|
+
* @throws {Error} If the password update fails or user is not authenticated
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* ```typescript
|
|
185
|
+
* try {
|
|
186
|
+
* await auth.resetPassword("oldPassword", "newPassword123");
|
|
187
|
+
* console.log("Password updated successfully");
|
|
188
|
+
* showSuccessMessage("Password updated!");
|
|
189
|
+
* } catch (error) {
|
|
190
|
+
* console.error("Password update failed:", error.message);
|
|
191
|
+
* showErrorMessage("Failed to update password");
|
|
192
|
+
* }
|
|
193
|
+
* ```
|
|
194
|
+
*/
|
|
195
|
+
resetPassword(currentPassword: string, newPassword: string): Promise<boolean>;
|
|
196
|
+
/**
|
|
197
|
+
* Logs out the current user and clears all authentication data.
|
|
198
|
+
*
|
|
199
|
+
* This method:
|
|
200
|
+
* - Clears user state from memory and storage
|
|
201
|
+
* - Removes authentication tokens
|
|
202
|
+
* - Resets related services
|
|
203
|
+
*
|
|
204
|
+
* @example
|
|
205
|
+
* ```typescript
|
|
206
|
+
* auth.logOut();
|
|
207
|
+
* router.push("/login");
|
|
208
|
+
* console.log("User logged out successfully");
|
|
209
|
+
* ```
|
|
210
|
+
*/
|
|
211
|
+
logOut(): void;
|
|
212
|
+
/**
|
|
213
|
+
* Refreshes the current authentication state.
|
|
214
|
+
* Useful for clearing potentially stale data.
|
|
215
|
+
*
|
|
216
|
+
* @example
|
|
217
|
+
* ```typescript
|
|
218
|
+
* // Clear current state and force fresh authentication
|
|
219
|
+
* auth.refresh();
|
|
220
|
+
* ```
|
|
221
|
+
*/
|
|
222
|
+
refresh(): void;
|
|
223
|
+
/**
|
|
224
|
+
* Gets debug information about the current authentication state.
|
|
225
|
+
* Useful for troubleshooting authentication issues.
|
|
226
|
+
*
|
|
227
|
+
* @returns Object containing authentication state information
|
|
228
|
+
*
|
|
229
|
+
* @example
|
|
230
|
+
* ```typescript
|
|
231
|
+
* const debugInfo = auth.getDebugInfo();
|
|
232
|
+
* console.log("Auth Debug Info:", debugInfo);
|
|
233
|
+
* ```
|
|
234
|
+
*/
|
|
235
|
+
getDebugInfo(): {
|
|
236
|
+
hasUser: boolean;
|
|
237
|
+
hasToken: boolean;
|
|
238
|
+
isAuthenticated: boolean;
|
|
239
|
+
userName: string;
|
|
240
|
+
tokenLength: number;
|
|
241
|
+
managerInstance: string;
|
|
242
|
+
};
|
|
243
|
+
/**
|
|
244
|
+
* Clears all stored authentication data from the unified store.
|
|
245
|
+
*
|
|
246
|
+
* @private
|
|
247
|
+
*/
|
|
248
|
+
private clearSavedData;
|
|
249
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { BaseRepository } from "../../lib/api/base-repository";
|
|
2
|
+
import { authContract } from "./auth.contract";
|
|
3
|
+
import { User } from "@/models/user.model";
|
|
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
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { type StoreApi, type UseBoundStore } from "zustand";
|
|
2
|
+
import { User } from "@/models/user.model";
|
|
3
|
+
/** Type definition for the store's internal state */
|
|
4
|
+
type AuthState = {
|
|
5
|
+
user: string | undefined;
|
|
6
|
+
token: string | undefined;
|
|
7
|
+
};
|
|
8
|
+
/** Type definition for the store's actions */
|
|
9
|
+
interface AuthActions {
|
|
10
|
+
setUser: (user: User) => void;
|
|
11
|
+
getUser: () => User | undefined;
|
|
12
|
+
setToken: (token: string) => void;
|
|
13
|
+
getToken: () => string | undefined;
|
|
14
|
+
setUserAndToken: (user: User, token: string) => void;
|
|
15
|
+
clearAuth: () => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Unified Zustand store for managing both user and token state with persistence.
|
|
19
|
+
*
|
|
20
|
+
* Features:
|
|
21
|
+
* - Persists both user data and token to sessionStorage
|
|
22
|
+
* - Serializes/deserializes User objects to/from JSON
|
|
23
|
+
* - Provides reactive state updates for React components
|
|
24
|
+
* - Automatically syncs user and token state
|
|
25
|
+
* - Server-side rendering safe
|
|
26
|
+
*/
|
|
27
|
+
export declare const authStore: UseBoundStore<StoreApi<AuthState & AuthActions>>;
|
|
28
|
+
/**
|
|
29
|
+
* Gets the current authenticated user from the auth store.
|
|
30
|
+
* This function can be called from anywhere in the application.
|
|
31
|
+
*
|
|
32
|
+
* @returns The current user or undefined if not authenticated
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```typescript
|
|
36
|
+
* // In BaseRepository or any other file
|
|
37
|
+
* const user = getCurrentUser();
|
|
38
|
+
* if (user) {
|
|
39
|
+
* console.log(`Current user: ${user.name}`);
|
|
40
|
+
* }
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export declare const getCurrentUser: () => User | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Gets the current authentication token from the auth store.
|
|
46
|
+
* This function can be called from anywhere in the application,
|
|
47
|
+
* including BaseRepository for automatic token injection.
|
|
48
|
+
*
|
|
49
|
+
* @returns The current token or undefined if not authenticated
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```typescript
|
|
53
|
+
* // In BaseRepository
|
|
54
|
+
* const token = getCurrentToken();
|
|
55
|
+
* if (token) {
|
|
56
|
+
* // Use token for API calls
|
|
57
|
+
* return initClient(contract, { baseHeaders: { token } });
|
|
58
|
+
* }
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export declare const getCurrentToken: () => string | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* React hook to access the current user with reactive updates.
|
|
64
|
+
*
|
|
65
|
+
* @returns The current user or undefined if not authenticated
|
|
66
|
+
* @throws {Error} If called in a server environment
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```typescript
|
|
70
|
+
* function UserProfile() {
|
|
71
|
+
* const user = useCurrentUser();
|
|
72
|
+
*
|
|
73
|
+
* if (!user) {
|
|
74
|
+
* return <div>Please log in</div>;
|
|
75
|
+
* }
|
|
76
|
+
*
|
|
77
|
+
* return <div>Welcome, {user.name}!</div>;
|
|
78
|
+
* }
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
export declare const useCurrentUser: () => User | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* React hook to access the current token with reactive updates.
|
|
84
|
+
*
|
|
85
|
+
* @returns The current token or undefined if not authenticated
|
|
86
|
+
* @throws {Error} If called in a server environment
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```typescript
|
|
90
|
+
* function SomeComponent() {
|
|
91
|
+
* const token = useCurrentToken();
|
|
92
|
+
*
|
|
93
|
+
* if (!token) {
|
|
94
|
+
* return <div>Please log in</div>;
|
|
95
|
+
* }
|
|
96
|
+
*
|
|
97
|
+
* // Use token...
|
|
98
|
+
* }
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
export declare const useCurrentToken: () => string | undefined;
|
|
102
|
+
/**
|
|
103
|
+
* Checks if a user is currently authenticated.
|
|
104
|
+
*
|
|
105
|
+
* @returns True if user is authenticated, false otherwise
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```typescript
|
|
109
|
+
* if (isAuthenticated()) {
|
|
110
|
+
* // User is logged in
|
|
111
|
+
* showDashboard();
|
|
112
|
+
* } else {
|
|
113
|
+
* // User needs to log in
|
|
114
|
+
* showLoginForm();
|
|
115
|
+
* }
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
export declare const isAuthenticated: () => boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Gets debug information about the current authentication state.
|
|
121
|
+
* Useful for troubleshooting authentication issues.
|
|
122
|
+
*
|
|
123
|
+
* @returns Object containing authentication state information
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* ```typescript
|
|
127
|
+
* const debugInfo = getAuthDebugInfo();
|
|
128
|
+
* console.log("Auth Debug Info:", debugInfo);
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
131
|
+
export declare const getAuthDebugInfo: () => {
|
|
132
|
+
hasUser: boolean;
|
|
133
|
+
hasToken: boolean;
|
|
134
|
+
isAuthenticated: boolean;
|
|
135
|
+
userName: string;
|
|
136
|
+
tokenLength: number;
|
|
137
|
+
storeState: string | (AuthState & AuthActions);
|
|
138
|
+
};
|
|
139
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { identityContract } from "./identity.api-contract";
|
|
2
|
+
import type { ClientInferResponseBody } from "@ts-rest/core";
|
|
3
|
+
import { BaseRepository } from "@/lib/api";
|
|
4
|
+
type GetUserIdentityResponse = ClientInferResponseBody<typeof identityContract.getUserCredentials>;
|
|
5
|
+
/**
|
|
6
|
+
* Repository class for retrieving user identity-related information.
|
|
7
|
+
* Handles fetching user credentials and identity data from the API.
|
|
8
|
+
*
|
|
9
|
+
* This repository handles pure API communication without permission checking.
|
|
10
|
+
* Permission validation should be handled at the service layer or route handlers.
|
|
11
|
+
*
|
|
12
|
+
* @extends {BaseRepository<typeof identityContract>}
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* const repo = new IdentityRepository({ token: userToken });
|
|
17
|
+
* const identity = await repo.getIdentity();
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare class IdentityRepository extends BaseRepository<typeof identityContract> {
|
|
21
|
+
/**
|
|
22
|
+
* Creates an instance of IdentityRepository.
|
|
23
|
+
*
|
|
24
|
+
* @param options - Optional configuration
|
|
25
|
+
* @param options.token - Authentication token for API calls
|
|
26
|
+
* @param options.root - Custom API root URL
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* const repo = new IdentityRepository({
|
|
31
|
+
* token: "user-auth-token",
|
|
32
|
+
* root: "base-api-url"
|
|
33
|
+
* });
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
constructor(options?: {
|
|
37
|
+
token?: string;
|
|
38
|
+
root?: string;
|
|
39
|
+
});
|
|
40
|
+
/**
|
|
41
|
+
* Retrieves the current user's login credentials and identity information.
|
|
42
|
+
*
|
|
43
|
+
* @returns Promise that resolves to the user's login credentials
|
|
44
|
+
* @throws {APIError} If the request fails or returns an unexpected status
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```typescript
|
|
48
|
+
* try {
|
|
49
|
+
* const identity = await repo.getIdentity();
|
|
50
|
+
* console.log("User identity:", identity);
|
|
51
|
+
* } catch (error) {
|
|
52
|
+
* console.error("Failed to get user identity:", error.message);
|
|
53
|
+
* }
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
getIdentity(): Promise<GetUserIdentityResponse>;
|
|
57
|
+
}
|
|
58
|
+
export {};
|
|
@@ -8,13 +8,14 @@ export declare const profileContract: {
|
|
|
8
8
|
responses: {
|
|
9
9
|
200: import("zod").ZodObject<{
|
|
10
10
|
id: import("zod").ZodString;
|
|
11
|
-
firstName: import("zod").
|
|
12
|
-
lastName: import("zod").
|
|
11
|
+
firstName: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
12
|
+
lastName: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
13
13
|
displayName: import("zod").ZodString;
|
|
14
|
-
phone: import("zod").
|
|
14
|
+
phone: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
15
15
|
accountNo: import("zod").ZodString;
|
|
16
|
-
email: import("zod").
|
|
17
|
-
|
|
16
|
+
email: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodString>>;
|
|
17
|
+
autoApprove: import("zod").ZodOptional<import("zod").ZodNullable<import("zod").ZodBoolean>>;
|
|
18
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
18
19
|
id: string;
|
|
19
20
|
displayName: string;
|
|
20
21
|
accountNo: string;
|
|
@@ -22,6 +23,7 @@ export declare const profileContract: {
|
|
|
22
23
|
lastName?: string | null | undefined;
|
|
23
24
|
phone?: string | null | undefined;
|
|
24
25
|
email?: string | null | undefined;
|
|
26
|
+
autoApprove?: boolean | null | undefined;
|
|
25
27
|
}, {
|
|
26
28
|
id: string;
|
|
27
29
|
displayName: string;
|
|
@@ -30,8 +32,8 @@ export declare const profileContract: {
|
|
|
30
32
|
lastName?: string | null | undefined;
|
|
31
33
|
phone?: string | null | undefined;
|
|
32
34
|
email?: string | null | undefined;
|
|
35
|
+
autoApprove?: boolean | null | undefined;
|
|
33
36
|
}>;
|
|
34
37
|
};
|
|
35
38
|
};
|
|
36
39
|
};
|
|
37
|
-
//# sourceMappingURL=contract.d.ts.map
|