@temboplus/afloat 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +7 -0
- package/README.md +21 -0
- package/esm/_dnt.test_shims.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/almost_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/array_includes.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/assert.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/assertion_error.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/equal.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/exists.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/fail.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/false.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/greater.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/instance_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/is_error.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/less.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/less_or_equal.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/match.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/mod.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/not_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/not_instance_of.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/not_match.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/object_match.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/rejects.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/strict_equals.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/string_includes.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/throws.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/unimplemented.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/assert/1.0.10/unreachable.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +1 -0
- package/esm/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +1 -0
- package/esm/mod.d.ts +7 -0
- package/esm/mod.d.ts.map +1 -0
- package/esm/mod.js +6 -0
- package/esm/package.json +3 -0
- package/esm/src/errors/api_error.d.ts +63 -0
- package/esm/src/errors/api_error.d.ts.map +1 -0
- package/esm/src/errors/api_error.js +90 -0
- package/esm/src/errors/index.d.ts +3 -0
- package/esm/src/errors/index.d.ts.map +1 -0
- package/esm/src/errors/index.js +2 -0
- package/esm/src/errors/permission_error.d.ts +48 -0
- package/esm/src/errors/permission_error.d.ts.map +1 -0
- package/esm/src/errors/permission_error.js +70 -0
- package/esm/src/features/auth/contract.d.ts +123 -0
- package/esm/src/features/auth/contract.d.ts.map +1 -0
- package/esm/src/features/auth/contract.js +50 -0
- package/esm/src/features/auth/index.d.ts +2 -0
- package/esm/src/features/auth/index.d.ts.map +1 -0
- package/esm/src/features/auth/index.js +1 -0
- package/esm/src/features/auth/manager.d.ts +71 -0
- package/esm/src/features/auth/manager.d.ts.map +1 -0
- package/esm/src/features/auth/manager.js +118 -0
- package/esm/src/features/auth/repository.d.ts +30 -0
- package/esm/src/features/auth/repository.d.ts.map +1 -0
- package/esm/src/features/auth/repository.js +94 -0
- package/esm/src/features/contact/contract.d.ts +170 -0
- package/esm/src/features/contact/contract.d.ts.map +1 -0
- package/esm/src/features/contact/contract.js +49 -0
- package/esm/src/features/contact/index.d.ts +2 -0
- package/esm/src/features/contact/index.d.ts.map +1 -0
- package/esm/src/features/contact/index.js +1 -0
- package/esm/src/features/contact/repository.d.ts +47 -0
- package/esm/src/features/contact/repository.d.ts.map +1 -0
- package/esm/src/features/contact/repository.js +94 -0
- package/esm/src/features/files-gen/contract.d.ts +67 -0
- package/esm/src/features/files-gen/contract.d.ts.map +1 -0
- package/esm/src/features/files-gen/contract.js +40 -0
- package/esm/src/features/files-gen/repository.d.ts +47 -0
- package/esm/src/features/files-gen/repository.d.ts.map +1 -0
- package/esm/src/features/files-gen/repository.js +48 -0
- package/esm/src/features/payout/contract.d.ts +623 -0
- package/esm/src/features/payout/contract.d.ts.map +1 -0
- package/esm/src/features/payout/contract.js +75 -0
- package/esm/src/features/payout/index.d.ts +2 -0
- package/esm/src/features/payout/index.d.ts.map +1 -0
- package/esm/src/features/payout/index.js +1 -0
- package/esm/src/features/payout/repository.d.ts +62 -0
- package/esm/src/features/payout/repository.d.ts.map +1 -0
- package/esm/src/features/payout/repository.js +158 -0
- package/esm/src/features/wallet/contract.d.ts +103 -0
- package/esm/src/features/wallet/contract.d.ts.map +1 -0
- package/esm/src/features/wallet/contract.js +35 -0
- package/esm/src/features/wallet/index.d.ts +2 -0
- package/esm/src/features/wallet/index.d.ts.map +1 -0
- package/esm/src/features/wallet/index.js +1 -0
- package/esm/src/features/wallet/repository.d.ts +74 -0
- package/esm/src/features/wallet/repository.d.ts.map +1 -0
- package/esm/src/features/wallet/repository.js +132 -0
- package/esm/src/models/contact/derivatives/contact.d.ts +168 -0
- package/esm/src/models/contact/derivatives/contact.d.ts.map +1 -0
- package/esm/src/models/contact/derivatives/contact.js +260 -0
- package/esm/src/models/contact/derivatives/contact.test.d.ts.map +1 -0
- package/esm/src/models/contact/derivatives/contact_info.d.ts +188 -0
- package/esm/src/models/contact/derivatives/contact_info.d.ts.map +1 -0
- package/esm/src/models/contact/derivatives/contact_info.js +255 -0
- package/esm/src/models/contact/derivatives/contact_info.test.d.ts.map +1 -0
- package/esm/src/models/contact/index.d.ts +5 -0
- package/esm/src/models/contact/index.d.ts.map +1 -0
- package/esm/src/models/contact/index.js +4 -0
- package/esm/src/models/contact/schemas.d.ts +66 -0
- package/esm/src/models/contact/schemas.d.ts.map +1 -0
- package/esm/src/models/contact/schemas.js +64 -0
- package/esm/src/models/contact/validation.d.ts +37 -0
- package/esm/src/models/contact/validation.d.ts.map +1 -0
- package/esm/src/models/contact/validation.js +139 -0
- package/esm/src/models/contact/validation.test.d.ts.map +1 -0
- package/esm/src/models/index.d.ts +6 -0
- package/esm/src/models/index.d.ts.map +1 -0
- package/esm/src/models/index.js +5 -0
- package/esm/src/models/payout/api.d.ts +29 -0
- package/esm/src/models/payout/api.d.ts.map +1 -0
- package/esm/src/models/payout/api.js +1 -0
- package/esm/src/models/payout/channel.d.ts +58 -0
- package/esm/src/models/payout/channel.d.ts.map +1 -0
- package/esm/src/models/payout/channel.js +46 -0
- package/esm/src/models/payout/derivatives/payout.d.ts +156 -0
- package/esm/src/models/payout/derivatives/payout.d.ts.map +1 -0
- package/esm/src/models/payout/derivatives/payout.js +261 -0
- package/esm/src/models/payout/derivatives/payout.test.d.ts.map +1 -0
- package/esm/src/models/payout/index.d.ts +6 -0
- package/esm/src/models/payout/index.d.ts.map +1 -0
- package/esm/src/models/payout/index.js +5 -0
- package/esm/src/models/payout/schemas.d.ts +154 -0
- package/esm/src/models/payout/schemas.d.ts.map +1 -0
- package/esm/src/models/payout/schemas.js +103 -0
- package/esm/src/models/payout/status.d.ts +31 -0
- package/esm/src/models/payout/status.d.ts.map +1 -0
- package/esm/src/models/payout/status.js +32 -0
- package/esm/src/models/permission.d.ts +42 -0
- package/esm/src/models/permission.d.ts.map +1 -0
- package/esm/src/models/permission.js +37 -0
- package/esm/src/models/user/index.d.ts +3 -0
- package/esm/src/models/user/index.d.ts.map +1 -0
- package/esm/src/models/user/index.js +2 -0
- package/esm/src/models/user/profile.d.ts +38 -0
- package/esm/src/models/user/profile.d.ts.map +1 -0
- package/esm/src/models/user/profile.js +25 -0
- package/esm/src/models/user/user.d.ts +80 -0
- package/esm/src/models/user/user.d.ts.map +1 -0
- package/esm/src/models/user/user.js +149 -0
- package/esm/src/models/wallet/guards.d.ts +11 -0
- package/esm/src/models/wallet/guards.d.ts.map +1 -0
- package/esm/src/models/wallet/guards.js +14 -0
- package/esm/src/models/wallet/index.d.ts +4 -0
- package/esm/src/models/wallet/index.d.ts.map +1 -0
- package/esm/src/models/wallet/index.js +3 -0
- package/esm/src/models/wallet/schemas.d.ts +50 -0
- package/esm/src/models/wallet/schemas.d.ts.map +1 -0
- package/esm/src/models/wallet/schemas.js +64 -0
- package/esm/src/models/wallet/statement.d.ts +27 -0
- package/esm/src/models/wallet/statement.d.ts.map +1 -0
- package/esm/src/models/wallet/statement.js +13 -0
- package/esm/src/shared/base_repository.d.ts +56 -0
- package/esm/src/shared/base_repository.d.ts.map +1 -0
- package/esm/src/shared/base_repository.js +95 -0
- package/esm/src/shared/common_responses.d.ts +13 -0
- package/esm/src/shared/common_responses.d.ts.map +1 -0
- package/esm/src/shared/common_responses.js +10 -0
- package/esm/src/shared/index.d.ts +3 -0
- package/esm/src/shared/index.d.ts.map +1 -0
- package/esm/src/shared/index.js +2 -0
- package/package.json +40 -0
- package/script/_dnt.test_shims.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.10/almost_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.10/array_includes.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.10/assert.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.10/assertion_error.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.10/equal.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.10/equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.10/exists.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.10/fail.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.10/false.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.10/greater.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.10/greater_or_equal.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.10/instance_of.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.10/is_error.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.10/less.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.10/less_or_equal.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.10/match.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.10/mod.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.10/not_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.10/not_instance_of.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.10/not_match.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.10/not_strict_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.10/object_match.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.10/rejects.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.10/strict_equals.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.10/string_includes.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.10/throws.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.10/unimplemented.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/assert/1.0.10/unreachable.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/build_message.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/diff.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/diff_str.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/format.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/styles.d.ts.map +1 -0
- package/script/deps/jsr.io/@std/internal/1.0.5/types.d.ts.map +1 -0
- package/script/mod.d.ts +7 -0
- package/script/mod.d.ts.map +1 -0
- package/script/mod.js +22 -0
- package/script/package.json +3 -0
- package/script/src/errors/api_error.d.ts +63 -0
- package/script/src/errors/api_error.d.ts.map +1 -0
- package/script/src/errors/api_error.js +94 -0
- package/script/src/errors/index.d.ts +3 -0
- package/script/src/errors/index.d.ts.map +1 -0
- package/script/src/errors/index.js +18 -0
- package/script/src/errors/permission_error.d.ts +48 -0
- package/script/src/errors/permission_error.d.ts.map +1 -0
- package/script/src/errors/permission_error.js +74 -0
- package/script/src/features/auth/contract.d.ts +123 -0
- package/script/src/features/auth/contract.d.ts.map +1 -0
- package/script/src/features/auth/contract.js +53 -0
- package/script/src/features/auth/index.d.ts +2 -0
- package/script/src/features/auth/index.d.ts.map +1 -0
- package/script/src/features/auth/index.js +17 -0
- package/script/src/features/auth/manager.d.ts +71 -0
- package/script/src/features/auth/manager.d.ts.map +1 -0
- package/script/src/features/auth/manager.js +122 -0
- package/script/src/features/auth/repository.d.ts +30 -0
- package/script/src/features/auth/repository.d.ts.map +1 -0
- package/script/src/features/auth/repository.js +98 -0
- package/script/src/features/contact/contract.d.ts +170 -0
- package/script/src/features/contact/contract.d.ts.map +1 -0
- package/script/src/features/contact/contract.js +52 -0
- package/script/src/features/contact/index.d.ts +2 -0
- package/script/src/features/contact/index.d.ts.map +1 -0
- package/script/src/features/contact/index.js +17 -0
- package/script/src/features/contact/repository.d.ts +47 -0
- package/script/src/features/contact/repository.d.ts.map +1 -0
- package/script/src/features/contact/repository.js +98 -0
- package/script/src/features/files-gen/contract.d.ts +67 -0
- package/script/src/features/files-gen/contract.d.ts.map +1 -0
- package/script/src/features/files-gen/contract.js +43 -0
- package/script/src/features/files-gen/repository.d.ts +47 -0
- package/script/src/features/files-gen/repository.d.ts.map +1 -0
- package/script/src/features/files-gen/repository.js +52 -0
- package/script/src/features/payout/contract.d.ts +623 -0
- package/script/src/features/payout/contract.d.ts.map +1 -0
- package/script/src/features/payout/contract.js +78 -0
- package/script/src/features/payout/index.d.ts +2 -0
- package/script/src/features/payout/index.d.ts.map +1 -0
- package/script/src/features/payout/index.js +17 -0
- package/script/src/features/payout/repository.d.ts +62 -0
- package/script/src/features/payout/repository.d.ts.map +1 -0
- package/script/src/features/payout/repository.js +162 -0
- package/script/src/features/wallet/contract.d.ts +103 -0
- package/script/src/features/wallet/contract.d.ts.map +1 -0
- package/script/src/features/wallet/contract.js +38 -0
- package/script/src/features/wallet/index.d.ts +2 -0
- package/script/src/features/wallet/index.d.ts.map +1 -0
- package/script/src/features/wallet/index.js +17 -0
- package/script/src/features/wallet/repository.d.ts +74 -0
- package/script/src/features/wallet/repository.d.ts.map +1 -0
- package/script/src/features/wallet/repository.js +136 -0
- package/script/src/models/contact/derivatives/contact.d.ts +168 -0
- package/script/src/models/contact/derivatives/contact.d.ts.map +1 -0
- package/script/src/models/contact/derivatives/contact.js +264 -0
- package/script/src/models/contact/derivatives/contact.test.d.ts.map +1 -0
- package/script/src/models/contact/derivatives/contact_info.d.ts +188 -0
- package/script/src/models/contact/derivatives/contact_info.d.ts.map +1 -0
- package/script/src/models/contact/derivatives/contact_info.js +260 -0
- package/script/src/models/contact/derivatives/contact_info.test.d.ts.map +1 -0
- package/script/src/models/contact/index.d.ts +5 -0
- package/script/src/models/contact/index.d.ts.map +1 -0
- package/script/src/models/contact/index.js +20 -0
- package/script/src/models/contact/schemas.d.ts +66 -0
- package/script/src/models/contact/schemas.d.ts.map +1 -0
- package/script/src/models/contact/schemas.js +67 -0
- package/script/src/models/contact/validation.d.ts +37 -0
- package/script/src/models/contact/validation.d.ts.map +1 -0
- package/script/src/models/contact/validation.js +146 -0
- package/script/src/models/contact/validation.test.d.ts.map +1 -0
- package/script/src/models/index.d.ts +6 -0
- package/script/src/models/index.d.ts.map +1 -0
- package/script/src/models/index.js +21 -0
- package/script/src/models/payout/api.d.ts +29 -0
- package/script/src/models/payout/api.d.ts.map +1 -0
- package/script/src/models/payout/api.js +2 -0
- package/script/src/models/payout/channel.d.ts +58 -0
- package/script/src/models/payout/channel.d.ts.map +1 -0
- package/script/src/models/payout/channel.js +49 -0
- package/script/src/models/payout/derivatives/payout.d.ts +156 -0
- package/script/src/models/payout/derivatives/payout.d.ts.map +1 -0
- package/script/src/models/payout/derivatives/payout.js +265 -0
- package/script/src/models/payout/derivatives/payout.test.d.ts.map +1 -0
- package/script/src/models/payout/index.d.ts +6 -0
- package/script/src/models/payout/index.d.ts.map +1 -0
- package/script/src/models/payout/index.js +21 -0
- package/script/src/models/payout/schemas.d.ts +154 -0
- package/script/src/models/payout/schemas.d.ts.map +1 -0
- package/script/src/models/payout/schemas.js +106 -0
- package/script/src/models/payout/status.d.ts +31 -0
- package/script/src/models/payout/status.d.ts.map +1 -0
- package/script/src/models/payout/status.js +35 -0
- package/script/src/models/permission.d.ts +42 -0
- package/script/src/models/permission.d.ts.map +1 -0
- package/script/src/models/permission.js +40 -0
- package/script/src/models/user/index.d.ts +3 -0
- package/script/src/models/user/index.d.ts.map +1 -0
- package/script/src/models/user/index.js +18 -0
- package/script/src/models/user/profile.d.ts +38 -0
- package/script/src/models/user/profile.d.ts.map +1 -0
- package/script/src/models/user/profile.js +28 -0
- package/script/src/models/user/user.d.ts +80 -0
- package/script/src/models/user/user.d.ts.map +1 -0
- package/script/src/models/user/user.js +153 -0
- package/script/src/models/wallet/guards.d.ts +11 -0
- package/script/src/models/wallet/guards.d.ts.map +1 -0
- package/script/src/models/wallet/guards.js +17 -0
- package/script/src/models/wallet/index.d.ts +4 -0
- package/script/src/models/wallet/index.d.ts.map +1 -0
- package/script/src/models/wallet/index.js +19 -0
- package/script/src/models/wallet/schemas.d.ts +50 -0
- package/script/src/models/wallet/schemas.d.ts.map +1 -0
- package/script/src/models/wallet/schemas.js +67 -0
- package/script/src/models/wallet/statement.d.ts +27 -0
- package/script/src/models/wallet/statement.d.ts.map +1 -0
- package/script/src/models/wallet/statement.js +16 -0
- package/script/src/shared/base_repository.d.ts +56 -0
- package/script/src/shared/base_repository.d.ts.map +1 -0
- package/script/src/shared/base_repository.js +99 -0
- package/script/src/shared/common_responses.d.ts +13 -0
- package/script/src/shared/common_responses.d.ts.map +1 -0
- package/script/src/shared/common_responses.js +13 -0
- package/script/src/shared/index.d.ts +3 -0
- package/script/src/shared/index.d.ts.map +1 -0
- package/script/src/shared/index.js +18 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { BaseRepository } from "../../shared/base_repository.js";
|
|
2
|
+
import { contract } from "./contract.js";
|
|
3
|
+
import { Contact, type ContactInput } from "../../models/contact/index.js";
|
|
4
|
+
/**
|
|
5
|
+
* Repository class for managing `Contact` data through API interactions.
|
|
6
|
+
* Extends the `BaseRepository` to leverage shared functionality.
|
|
7
|
+
*/
|
|
8
|
+
export declare class ContactRepository extends BaseRepository<typeof contract> {
|
|
9
|
+
/**
|
|
10
|
+
* Creates an instance of `ContactRepository` using the contact contract.
|
|
11
|
+
*/
|
|
12
|
+
constructor();
|
|
13
|
+
/**
|
|
14
|
+
* Creates a new contact record.
|
|
15
|
+
* @param {ContactInput} input - The data required to create a new contact.
|
|
16
|
+
* @returns {Promise<Contact>} A promise that resolves to the newly created contact.
|
|
17
|
+
* @throws {APIError} If the response status code is not 201.
|
|
18
|
+
*/
|
|
19
|
+
create(input: ContactInput): Promise<Contact>;
|
|
20
|
+
/**
|
|
21
|
+
* Updates an existing contact record by ID.
|
|
22
|
+
* @param {string} id - The unique identifier of the contact to edit.
|
|
23
|
+
* @param {ContactInput} input - The data to update the contact with.
|
|
24
|
+
* @returns {Promise<Contact>} A promise that resolves to the updated contact.
|
|
25
|
+
* @throws {APIError} If the response status code is not 200.
|
|
26
|
+
*/
|
|
27
|
+
edit(id: string, input: ContactInput): Promise<Contact>;
|
|
28
|
+
/**
|
|
29
|
+
* Deletes a contact record by ID.
|
|
30
|
+
* @param {string} id - The unique identifier of the contact to remove.
|
|
31
|
+
* @returns {Promise<void>} A promise that resolves when the deletion is complete.
|
|
32
|
+
* @throws {APIError} If the response status code is not 200.
|
|
33
|
+
*/
|
|
34
|
+
remove(id: string): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Retrieves all contacts
|
|
37
|
+
* Results are ordered in descending order by default.
|
|
38
|
+
*
|
|
39
|
+
* @returns {Promise<Contact[]>} A promise that resolves to an array of contacts.
|
|
40
|
+
* @throws {APIError} If the response status code is not 200 or the range is invalid.
|
|
41
|
+
* @example
|
|
42
|
+
* const repository = new ContactRepository();
|
|
43
|
+
* repository.getAll().then(contacts => console.log(contacts));
|
|
44
|
+
*/
|
|
45
|
+
getAll(): Promise<Contact[]>;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=repository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../../../src/src/features/contact/repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EACL,OAAO,EAEP,KAAK,YAAY,EAClB,MAAM,+BAA+B,CAAC;AAKvC;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,cAAc,CAAC,OAAO,QAAQ,CAAC;IACpE;;OAEG;;IAKH;;;;;OAKG;IACG,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC;IAanD;;;;;;OAMG;IACG,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC;IAgB7D;;;;;OAKG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAYvC;;;;;;;;;OASG;IACG,MAAM,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;CAanC"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ContactRepository = void 0;
|
|
4
|
+
const base_repository_js_1 = require("../../shared/base_repository.js");
|
|
5
|
+
const contract_js_1 = require("./contract.js");
|
|
6
|
+
const index_js_1 = require("../../models/contact/index.js");
|
|
7
|
+
const index_js_2 = require("../auth/index.js");
|
|
8
|
+
const index_js_3 = require("../../models/index.js");
|
|
9
|
+
const index_js_4 = require("../../errors/index.js");
|
|
10
|
+
/**
|
|
11
|
+
* Repository class for managing `Contact` data through API interactions.
|
|
12
|
+
* Extends the `BaseRepository` to leverage shared functionality.
|
|
13
|
+
*/
|
|
14
|
+
class ContactRepository extends base_repository_js_1.BaseRepository {
|
|
15
|
+
/**
|
|
16
|
+
* Creates an instance of `ContactRepository` using the contact contract.
|
|
17
|
+
*/
|
|
18
|
+
constructor() {
|
|
19
|
+
super("contact", contract_js_1.contract);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Creates a new contact record.
|
|
23
|
+
* @param {ContactInput} input - The data required to create a new contact.
|
|
24
|
+
* @returns {Promise<Contact>} A promise that resolves to the newly created contact.
|
|
25
|
+
* @throws {APIError} If the response status code is not 201.
|
|
26
|
+
*/
|
|
27
|
+
async create(input) {
|
|
28
|
+
if (!index_js_2.AfloatAuth.instance.checkPermission(index_js_3.Permissions.Contact.Create)) {
|
|
29
|
+
throw new index_js_4.PermissionError({
|
|
30
|
+
message: "You are not authorized to add contacts.",
|
|
31
|
+
requiredPermissions: [index_js_3.Permissions.Contact.Create],
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
const result = await this.client.postContact({ body: input });
|
|
35
|
+
const data = this.handleResponse(result, 201);
|
|
36
|
+
return index_js_1.Contact.create(data);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Updates an existing contact record by ID.
|
|
40
|
+
* @param {string} id - The unique identifier of the contact to edit.
|
|
41
|
+
* @param {ContactInput} input - The data to update the contact with.
|
|
42
|
+
* @returns {Promise<Contact>} A promise that resolves to the updated contact.
|
|
43
|
+
* @throws {APIError} If the response status code is not 200.
|
|
44
|
+
*/
|
|
45
|
+
async edit(id, input) {
|
|
46
|
+
if (!index_js_2.AfloatAuth.instance.checkPermission(index_js_3.Permissions.Contact.Update)) {
|
|
47
|
+
throw new index_js_4.PermissionError({
|
|
48
|
+
message: "You are not authorized to update contacts.",
|
|
49
|
+
requiredPermissions: [index_js_3.Permissions.Contact.Update],
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
const result = await this.client.editContact({
|
|
53
|
+
params: { id },
|
|
54
|
+
body: input,
|
|
55
|
+
});
|
|
56
|
+
const data = this.handleResponse(result, 200);
|
|
57
|
+
return index_js_1.Contact.create(data);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Deletes a contact record by ID.
|
|
61
|
+
* @param {string} id - The unique identifier of the contact to remove.
|
|
62
|
+
* @returns {Promise<void>} A promise that resolves when the deletion is complete.
|
|
63
|
+
* @throws {APIError} If the response status code is not 200.
|
|
64
|
+
*/
|
|
65
|
+
async remove(id) {
|
|
66
|
+
if (!index_js_2.AfloatAuth.instance.checkPermission(index_js_3.Permissions.Contact.Delete)) {
|
|
67
|
+
throw new index_js_4.PermissionError({
|
|
68
|
+
message: "You are not authorized to delete contacts.",
|
|
69
|
+
requiredPermissions: [index_js_3.Permissions.Contact.Delete],
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
const result = await this.client.deleteContact({ params: { id } });
|
|
73
|
+
this.handleResponse(result, 200);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Retrieves all contacts
|
|
77
|
+
* Results are ordered in descending order by default.
|
|
78
|
+
*
|
|
79
|
+
* @returns {Promise<Contact[]>} A promise that resolves to an array of contacts.
|
|
80
|
+
* @throws {APIError} If the response status code is not 200 or the range is invalid.
|
|
81
|
+
* @example
|
|
82
|
+
* const repository = new ContactRepository();
|
|
83
|
+
* repository.getAll().then(contacts => console.log(contacts));
|
|
84
|
+
*/
|
|
85
|
+
async getAll() {
|
|
86
|
+
if (!index_js_2.AfloatAuth.instance.checkPermission(index_js_3.Permissions.Contact.List)) {
|
|
87
|
+
throw new index_js_4.PermissionError({
|
|
88
|
+
message: "You are not authorized to view contacts.",
|
|
89
|
+
requiredPermissions: [index_js_3.Permissions.Contact.List],
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
const query = { orderByDesc: "createdAt" };
|
|
93
|
+
const result = await this.client.getContacts({ query });
|
|
94
|
+
const data = this.handleResponse(result, 200);
|
|
95
|
+
return index_js_1.Contact.createMany(data);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
exports.ContactRepository = ContactRepository;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { STATEMENT_OUTPUT_TYPE } from "../../models/wallet/index.js";
|
|
3
|
+
export declare const contract: {
|
|
4
|
+
genStatementPDF: {
|
|
5
|
+
method: "POST";
|
|
6
|
+
body: z.ZodObject<{
|
|
7
|
+
end_date: z.ZodDate;
|
|
8
|
+
start_date: z.ZodDate;
|
|
9
|
+
account_no: z.ZodOptional<z.ZodString>;
|
|
10
|
+
return_file_type: z.ZodEnum<[STATEMENT_OUTPUT_TYPE.EXCEL, STATEMENT_OUTPUT_TYPE.PDF]>;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
end_date: Date;
|
|
13
|
+
start_date: Date;
|
|
14
|
+
return_file_type: STATEMENT_OUTPUT_TYPE;
|
|
15
|
+
account_no?: string | undefined;
|
|
16
|
+
}, {
|
|
17
|
+
end_date: Date;
|
|
18
|
+
start_date: Date;
|
|
19
|
+
return_file_type: STATEMENT_OUTPUT_TYPE;
|
|
20
|
+
account_no?: string | undefined;
|
|
21
|
+
}>;
|
|
22
|
+
path: "/statement";
|
|
23
|
+
responses: {
|
|
24
|
+
201: z.ZodObject<{
|
|
25
|
+
file: z.ZodString;
|
|
26
|
+
file_extension: z.ZodString;
|
|
27
|
+
mime_type: z.ZodString;
|
|
28
|
+
}, "strip", z.ZodTypeAny, {
|
|
29
|
+
file: string;
|
|
30
|
+
file_extension: string;
|
|
31
|
+
mime_type: string;
|
|
32
|
+
}, {
|
|
33
|
+
file: string;
|
|
34
|
+
file_extension: string;
|
|
35
|
+
mime_type: string;
|
|
36
|
+
}>;
|
|
37
|
+
202: z.ZodObject<{
|
|
38
|
+
message: z.ZodString;
|
|
39
|
+
}, "strip", z.ZodTypeAny, {
|
|
40
|
+
message: string;
|
|
41
|
+
}, {
|
|
42
|
+
message: string;
|
|
43
|
+
}>;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
genAccountDetailsPDF: {
|
|
47
|
+
method: "POST";
|
|
48
|
+
body: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
|
|
49
|
+
path: "/account_details";
|
|
50
|
+
responses: {
|
|
51
|
+
201: z.ZodObject<{
|
|
52
|
+
file: z.ZodString;
|
|
53
|
+
file_extension: z.ZodString;
|
|
54
|
+
mime_type: z.ZodString;
|
|
55
|
+
}, "strip", z.ZodTypeAny, {
|
|
56
|
+
file: string;
|
|
57
|
+
file_extension: string;
|
|
58
|
+
mime_type: string;
|
|
59
|
+
}, {
|
|
60
|
+
file: string;
|
|
61
|
+
file_extension: string;
|
|
62
|
+
mime_type: string;
|
|
63
|
+
}>;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../../../../src/src/features/files-gen/contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoCnB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.contract = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const core_1 = require("@ts-rest/core");
|
|
6
|
+
const index_js_1 = require("../../models/wallet/index.js");
|
|
7
|
+
exports.contract = (0, core_1.initContract)().router({
|
|
8
|
+
genStatementPDF: {
|
|
9
|
+
method: "POST",
|
|
10
|
+
path: "/statement",
|
|
11
|
+
body: zod_1.z.object({
|
|
12
|
+
end_date: zod_1.z.date(),
|
|
13
|
+
start_date: zod_1.z.date(),
|
|
14
|
+
account_no: zod_1.z.string().optional(),
|
|
15
|
+
return_file_type: zod_1.z.enum([
|
|
16
|
+
index_js_1.STATEMENT_OUTPUT_TYPE.EXCEL,
|
|
17
|
+
index_js_1.STATEMENT_OUTPUT_TYPE.PDF,
|
|
18
|
+
]),
|
|
19
|
+
}),
|
|
20
|
+
responses: {
|
|
21
|
+
201: zod_1.z.object({
|
|
22
|
+
file: zod_1.z.string(),
|
|
23
|
+
file_extension: zod_1.z.string(),
|
|
24
|
+
mime_type: zod_1.z.string(),
|
|
25
|
+
}),
|
|
26
|
+
202: zod_1.z.object({
|
|
27
|
+
message: zod_1.z.string(),
|
|
28
|
+
}),
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
genAccountDetailsPDF: {
|
|
32
|
+
method: "POST",
|
|
33
|
+
path: "/account_details",
|
|
34
|
+
body: zod_1.z.object({}),
|
|
35
|
+
responses: {
|
|
36
|
+
201: zod_1.z.object({
|
|
37
|
+
file: zod_1.z.string(),
|
|
38
|
+
file_extension: zod_1.z.string(),
|
|
39
|
+
mime_type: zod_1.z.string(),
|
|
40
|
+
}),
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
});
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { contract } from "./contract.js";
|
|
2
|
+
import { BaseRepository } from "../../shared/index.js";
|
|
3
|
+
import type { ClientInferRequest, ClientInferResponseBody } from "@ts-rest/core";
|
|
4
|
+
import type { StatementFile } from "../../models/wallet/index.js";
|
|
5
|
+
/**
|
|
6
|
+
* Type definition for statement generation input parameters.
|
|
7
|
+
* Inferred from the contract's genStatementPDF endpoint request body.
|
|
8
|
+
* @typedef {ClientInferRequest<typeof contract.genStatementPDF>["body"]} GenStatementInput
|
|
9
|
+
*/
|
|
10
|
+
type GenStatementInput = ClientInferRequest<typeof contract.genStatementPDF>["body"];
|
|
11
|
+
/**
|
|
12
|
+
* Type definition for account details response.
|
|
13
|
+
* Inferred from the contract's genAccountDetailsPDF endpoint response body.
|
|
14
|
+
* @typedef {ClientInferResponseBody<typeof contract.genAccountDetailsPDF>} GenAccountDetailsResponse
|
|
15
|
+
*/
|
|
16
|
+
type GenAccountDetailsResponse = ClientInferResponseBody<typeof contract.genAccountDetailsPDF>;
|
|
17
|
+
/**
|
|
18
|
+
* Repository class for managing file generation operations including
|
|
19
|
+
* statement PDFs and account details documents.
|
|
20
|
+
* @extends {BaseRepository<typeof contract>}
|
|
21
|
+
*/
|
|
22
|
+
export declare class AfloatFilesRepo extends BaseRepository<typeof contract> {
|
|
23
|
+
/**
|
|
24
|
+
* Creates an instance of AfloatFilesRepo initialized with the files generation contract.
|
|
25
|
+
* Configures the repository with the PDF maker service endpoint.
|
|
26
|
+
*/
|
|
27
|
+
constructor();
|
|
28
|
+
/**
|
|
29
|
+
* Generates and downloads a statement PDF based on the provided parameters.
|
|
30
|
+
* @param {GenStatementInput} body - The statement generation parameters
|
|
31
|
+
* @param {Date} body.start_date - Start date for the statement period
|
|
32
|
+
* @param {Date} body.end_date - End date for the statement period
|
|
33
|
+
* @param {string} body.return_file_type - Desired file format for the statement
|
|
34
|
+
* @param {string} [body.account_no] - Optional account number to generate statement for
|
|
35
|
+
* @throws {APIError} If the statement generation operation fails
|
|
36
|
+
* @returns {Promise<StatementFile>} The generated statement file
|
|
37
|
+
*/
|
|
38
|
+
downloadStatement(body: GenStatementInput): Promise<StatementFile>;
|
|
39
|
+
/**
|
|
40
|
+
* Generates a PDF containing detailed account information.
|
|
41
|
+
* @throws {APIError} If the PDF generation operation fails
|
|
42
|
+
* @returns {Promise<GenAccountDetailsResponse>} The generated account details PDF
|
|
43
|
+
*/
|
|
44
|
+
genAccountDetailsPDF(): Promise<GenAccountDetailsResponse>;
|
|
45
|
+
}
|
|
46
|
+
export {};
|
|
47
|
+
//# sourceMappingURL=repository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository.d.ts","sourceRoot":"","sources":["../../../../src/src/features/files-gen/repository.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,KAAK,EACV,kBAAkB,EAClB,uBAAuB,EACxB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElE;;;;GAIG;AACH,KAAK,iBAAiB,GAAG,kBAAkB,CACzC,OAAO,QAAQ,CAAC,eAAe,CAChC,CAAC,MAAM,CAAC,CAAC;AAEV;;;;GAIG;AACH,KAAK,yBAAyB,GAAG,uBAAuB,CACtD,OAAO,QAAQ,CAAC,oBAAoB,CACrC,CAAC;AAEF;;;;GAIG;AACH,qBAAa,eAAgB,SAAQ,cAAc,CAAC,OAAO,QAAQ,CAAC;IAClE;;;OAGG;;IAOH;;;;;;;;;OASG;IACG,iBAAiB,CACrB,IAAI,EAAE,iBAAiB,GACtB,OAAO,CAAC,aAAa,CAAC;IAUzB;;;;OAIG;IACG,oBAAoB,IAAI,OAAO,CAAC,yBAAyB,CAAC;CAWjE"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AfloatFilesRepo = void 0;
|
|
4
|
+
const contract_js_1 = require("./contract.js");
|
|
5
|
+
const index_js_1 = require("../../shared/index.js");
|
|
6
|
+
const api_error_js_1 = require("../../errors/api_error.js");
|
|
7
|
+
/**
|
|
8
|
+
* Repository class for managing file generation operations including
|
|
9
|
+
* statement PDFs and account details documents.
|
|
10
|
+
* @extends {BaseRepository<typeof contract>}
|
|
11
|
+
*/
|
|
12
|
+
class AfloatFilesRepo extends index_js_1.BaseRepository {
|
|
13
|
+
/**
|
|
14
|
+
* Creates an instance of AfloatFilesRepo initialized with the files generation contract.
|
|
15
|
+
* Configures the repository with the PDF maker service endpoint.
|
|
16
|
+
*/
|
|
17
|
+
constructor() {
|
|
18
|
+
super("wallet", contract_js_1.contract, {
|
|
19
|
+
root: "https://api.afloat.money/pdf-maker/afloat",
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Generates and downloads a statement PDF based on the provided parameters.
|
|
24
|
+
* @param {GenStatementInput} body - The statement generation parameters
|
|
25
|
+
* @param {Date} body.start_date - Start date for the statement period
|
|
26
|
+
* @param {Date} body.end_date - End date for the statement period
|
|
27
|
+
* @param {string} body.return_file_type - Desired file format for the statement
|
|
28
|
+
* @param {string} [body.account_no] - Optional account number to generate statement for
|
|
29
|
+
* @throws {APIError} If the statement generation operation fails
|
|
30
|
+
* @returns {Promise<StatementFile>} The generated statement file
|
|
31
|
+
*/
|
|
32
|
+
async downloadStatement(body) {
|
|
33
|
+
const result = await this.client.genStatementPDF({ body });
|
|
34
|
+
if (result.status === 201) {
|
|
35
|
+
return result.body;
|
|
36
|
+
}
|
|
37
|
+
throw api_error_js_1.APIError.unknown("An error occurred while generating statement PDF");
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Generates a PDF containing detailed account information.
|
|
41
|
+
* @throws {APIError} If the PDF generation operation fails
|
|
42
|
+
* @returns {Promise<GenAccountDetailsResponse>} The generated account details PDF
|
|
43
|
+
*/
|
|
44
|
+
async genAccountDetailsPDF() {
|
|
45
|
+
const result = await this.client.genAccountDetailsPDF();
|
|
46
|
+
if (result.status === 201) {
|
|
47
|
+
return result.body;
|
|
48
|
+
}
|
|
49
|
+
throw api_error_js_1.APIError.unknown("An error occurred while generating account details PDF");
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.AfloatFilesRepo = AfloatFilesRepo;
|