@pulsar.money/atlas-sdk 0.3.3 → 0.3.5

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.
Files changed (53) hide show
  1. package/package.json +2 -4
  2. package/dist/config/api-config.service.d.ts +0 -5
  3. package/dist/config/api-config.service.js +0 -29
  4. package/dist/config/api-config.service.js.map +0 -1
  5. package/dist/decorator/wallet-address.decorator.d.ts +0 -1
  6. package/dist/decorator/wallet-address.decorator.js +0 -29
  7. package/dist/decorator/wallet-address.decorator.js.map +0 -1
  8. package/dist/index.d.ts +0 -1
  9. package/dist/index.js +0 -18
  10. package/dist/index.js.map +0 -1
  11. package/dist/modules/index.d.ts +0 -2
  12. package/dist/modules/index.js +0 -19
  13. package/dist/modules/index.js.map +0 -1
  14. package/dist/modules/payments/index.d.ts +0 -3
  15. package/dist/modules/payments/index.js +0 -20
  16. package/dist/modules/payments/index.js.map +0 -1
  17. package/dist/modules/payments/payment.controller.d.ts +0 -9
  18. package/dist/modules/payments/payment.controller.js +0 -44
  19. package/dist/modules/payments/payment.controller.js.map +0 -1
  20. package/dist/modules/payments/payment.service.d.ts +0 -8
  21. package/dist/modules/payments/payment.service.js +0 -55
  22. package/dist/modules/payments/payment.service.js.map +0 -1
  23. package/dist/modules/payments/payment.types.d.ts +0 -132
  24. package/dist/modules/payments/payment.types.js +0 -22
  25. package/dist/modules/payments/payment.types.js.map +0 -1
  26. package/dist/modules/profiles/dto/index.d.ts +0 -0
  27. package/dist/modules/profiles/dto/index.js +0 -1
  28. package/dist/modules/profiles/dto/index.js.map +0 -1
  29. package/dist/modules/profiles/dto/link-address.dto.d.ts +0 -3
  30. package/dist/modules/profiles/dto/link-address.dto.js +0 -24
  31. package/dist/modules/profiles/dto/link-address.dto.js.map +0 -1
  32. package/dist/modules/profiles/dto/resend-verification.dto.d.ts +0 -3
  33. package/dist/modules/profiles/dto/resend-verification.dto.js +0 -24
  34. package/dist/modules/profiles/dto/resend-verification.dto.js.map +0 -1
  35. package/dist/modules/profiles/dto/update-profile.dto.d.ts +0 -5
  36. package/dist/modules/profiles/dto/update-profile.dto.js +0 -38
  37. package/dist/modules/profiles/dto/update-profile.dto.js.map +0 -1
  38. package/dist/modules/profiles/dto/verify-email.dto.d.ts +0 -3
  39. package/dist/modules/profiles/dto/verify-email.dto.js +0 -24
  40. package/dist/modules/profiles/dto/verify-email.dto.js.map +0 -1
  41. package/dist/modules/profiles/index.d.ts +0 -3
  42. package/dist/modules/profiles/index.js +0 -20
  43. package/dist/modules/profiles/index.js.map +0 -1
  44. package/dist/modules/profiles/profiles.controller.d.ts +0 -20
  45. package/dist/modules/profiles/profiles.controller.js +0 -173
  46. package/dist/modules/profiles/profiles.controller.js.map +0 -1
  47. package/dist/modules/profiles/profiles.service.d.ts +0 -18
  48. package/dist/modules/profiles/profiles.service.js +0 -168
  49. package/dist/modules/profiles/profiles.service.js.map +0 -1
  50. package/dist/modules/profiles/profiles.types.d.ts +0 -81
  51. package/dist/modules/profiles/profiles.types.js +0 -10
  52. package/dist/modules/profiles/profiles.types.js.map +0 -1
  53. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -1,20 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./profiles.service"), exports);
18
- __exportStar(require("./profiles.controller"), exports);
19
- __exportStar(require("./profiles.types"), exports);
20
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/profiles/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,wDAAsC;AACtC,mDAAiC"}
@@ -1,20 +0,0 @@
1
- /// <reference types="multer" />
2
- import { ProfilesService } from "./profiles.service";
3
- import { LinkAddressDto } from "./dto/link-address.dto";
4
- import { UpdateProfileDto } from "./dto/update-profile.dto";
5
- import { VerifyEmailDto } from "./dto/verify-email.dto";
6
- import { ResendVerificationDto } from "./dto/resend-verification.dto";
7
- import { KycDataForm } from "./profiles.types";
8
- export declare class ProfilesController {
9
- private readonly profilesService;
10
- constructor(profilesService: ProfilesService);
11
- linkAddress(input: LinkAddressDto, address: string): Promise<void>;
12
- verifyEmail(input: VerifyEmailDto, address: string): Promise<void>;
13
- resendVerificationCode(address: string, input: ResendVerificationDto): Promise<void>;
14
- getUserProfile(address: string): Promise<import("./profiles.types").UserProfile>;
15
- updateUserProfile(updateData: UpdateProfileDto, profileImage: Express.Multer.File, address: string): Promise<import("./profiles.types").UserProfile>;
16
- checkUsername(username: string): Promise<boolean>;
17
- unlinkAddress(address: string): Promise<void>;
18
- startKyc(address: string, input: KycDataForm): Promise<import("./profiles.types").KycApplicant>;
19
- createWorkflowRun(address: string): Promise<import("./profiles.types").OnfidoWorkflowRunResponse>;
20
- }
@@ -1,173 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var __param = (this && this.__param) || function (paramIndex, decorator) {
12
- return function (target, key) { decorator(target, key, paramIndex); }
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.ProfilesController = void 0;
16
- const common_1 = require("@nestjs/common");
17
- const platform_express_1 = require("@nestjs/platform-express");
18
- const swagger_1 = require("@nestjs/swagger");
19
- const profiles_service_1 = require("./profiles.service");
20
- const link_address_dto_1 = require("./dto/link-address.dto");
21
- const update_profile_dto_1 = require("./dto/update-profile.dto");
22
- const verify_email_dto_1 = require("./dto/verify-email.dto");
23
- const resend_verification_dto_1 = require("./dto/resend-verification.dto");
24
- const wallet_address_decorator_1 = require("../../decorator/wallet-address.decorator");
25
- let ProfilesController = class ProfilesController {
26
- constructor(profilesService) {
27
- this.profilesService = profilesService;
28
- }
29
- async linkAddress(input, address) {
30
- return await this.profilesService.linkAddress(input.email, address);
31
- }
32
- async verifyEmail(input, address) {
33
- return await this.profilesService.verifyEmail(address, input.code);
34
- }
35
- async resendVerificationCode(address, input) {
36
- return await this.profilesService.resendVerificationCode(address, input.email);
37
- }
38
- async getUserProfile(address) {
39
- return await this.profilesService.getUserProfile(address, {
40
- includeKyc: true,
41
- includePublicProfile: true,
42
- includeUnverified: true,
43
- });
44
- }
45
- async updateUserProfile(updateData, profileImage, address) {
46
- return await this.profilesService.updateUserProfile(address, updateData, profileImage);
47
- }
48
- async checkUsername(username) {
49
- return await this.profilesService.checkUsername(username);
50
- }
51
- async unlinkAddress(address) {
52
- return await this.profilesService.unlinkAddress(address);
53
- }
54
- async startKyc(address, input) {
55
- return await this.profilesService.startKYC(address, input);
56
- }
57
- async createWorkflowRun(address) {
58
- return await this.profilesService.createWorkflowRun(address);
59
- }
60
- };
61
- exports.ProfilesController = ProfilesController;
62
- __decorate([
63
- (0, common_1.Post)("link-email"),
64
- (0, swagger_1.ApiOperation)({ summary: "Link an address to a user" }),
65
- (0, swagger_1.ApiResponse)({ status: 200, description: "Address linked successfully" }),
66
- (0, swagger_1.ApiResponse)({ status: 400, description: "Bad request" }),
67
- __param(0, (0, common_1.Body)()),
68
- __param(1, (0, wallet_address_decorator_1.WalletAddress)()),
69
- __metadata("design:type", Function),
70
- __metadata("design:paramtypes", [link_address_dto_1.LinkAddressDto, String]),
71
- __metadata("design:returntype", Promise)
72
- ], ProfilesController.prototype, "linkAddress", null);
73
- __decorate([
74
- (0, common_1.Post)("verify-email"),
75
- (0, swagger_1.ApiOperation)({ summary: "Verify email" }),
76
- (0, swagger_1.ApiResponse)({ status: 200, description: "Email verified successfully" }),
77
- (0, swagger_1.ApiResponse)({ status: 400, description: "Bad request" }),
78
- __param(0, (0, common_1.Body)()),
79
- __param(1, (0, wallet_address_decorator_1.WalletAddress)()),
80
- __metadata("design:type", Function),
81
- __metadata("design:paramtypes", [verify_email_dto_1.VerifyEmailDto, String]),
82
- __metadata("design:returntype", Promise)
83
- ], ProfilesController.prototype, "verifyEmail", null);
84
- __decorate([
85
- (0, common_1.Post)("resend-verification"),
86
- (0, swagger_1.ApiOperation)({ summary: "Resend verification code" }),
87
- (0, swagger_1.ApiResponse)({ status: 200, description: "Verification code sent" }),
88
- (0, swagger_1.ApiResponse)({ status: 400, description: "Bad request" }),
89
- __param(0, (0, wallet_address_decorator_1.WalletAddress)()),
90
- __param(1, (0, common_1.Body)()),
91
- __metadata("design:type", Function),
92
- __metadata("design:paramtypes", [String, resend_verification_dto_1.ResendVerificationDto]),
93
- __metadata("design:returntype", Promise)
94
- ], ProfilesController.prototype, "resendVerificationCode", null);
95
- __decorate([
96
- (0, common_1.Get)(),
97
- (0, swagger_1.ApiOperation)({ summary: "Get user profile" }),
98
- (0, swagger_1.ApiResponse)({
99
- status: 200,
100
- description: "User profile retrieved successfully",
101
- }),
102
- (0, swagger_1.ApiResponse)({ status: 404, description: "User not found" }),
103
- __param(0, (0, wallet_address_decorator_1.WalletAddress)()),
104
- __metadata("design:type", Function),
105
- __metadata("design:paramtypes", [String]),
106
- __metadata("design:returntype", Promise)
107
- ], ProfilesController.prototype, "getUserProfile", null);
108
- __decorate([
109
- (0, common_1.Put)(""),
110
- (0, swagger_1.ApiOperation)({ summary: "Update user profile" }),
111
- (0, swagger_1.ApiConsumes)("multipart/form-data"),
112
- (0, swagger_1.ApiResponse)({
113
- status: 200,
114
- description: "User profile updated successfully",
115
- }),
116
- (0, common_1.UseInterceptors)((0, platform_express_1.FileInterceptor)("profileImage")),
117
- __param(0, (0, common_1.Body)()),
118
- __param(1, (0, common_1.UploadedFile)()),
119
- __param(2, (0, wallet_address_decorator_1.WalletAddress)()),
120
- __metadata("design:type", Function),
121
- __metadata("design:paramtypes", [update_profile_dto_1.UpdateProfileDto, Object, String]),
122
- __metadata("design:returntype", Promise)
123
- ], ProfilesController.prototype, "updateUserProfile", null);
124
- __decorate([
125
- (0, common_1.Get)("/valid-username/:username"),
126
- (0, swagger_1.ApiOperation)({ summary: "Check if a username is valid" }),
127
- (0, swagger_1.ApiResponse)({ status: 200, description: "Username is valid" }),
128
- (0, swagger_1.ApiResponse)({ status: 400, description: "Username is invalid" }),
129
- __param(0, (0, common_1.Param)("username")),
130
- __metadata("design:type", Function),
131
- __metadata("design:paramtypes", [String]),
132
- __metadata("design:returntype", Promise)
133
- ], ProfilesController.prototype, "checkUsername", null);
134
- __decorate([
135
- (0, common_1.Post)("/unlink-address"),
136
- (0, swagger_1.ApiOperation)({ summary: "Unlink an address from a user" }),
137
- (0, swagger_1.ApiResponse)({ status: 200, description: "Address unlinked successfully" }),
138
- (0, swagger_1.ApiResponse)({ status: 400, description: "Bad request" }),
139
- __param(0, (0, wallet_address_decorator_1.WalletAddress)()),
140
- __metadata("design:type", Function),
141
- __metadata("design:paramtypes", [String]),
142
- __metadata("design:returntype", Promise)
143
- ], ProfilesController.prototype, "unlinkAddress", null);
144
- __decorate([
145
- (0, common_1.Post)("/kyc"),
146
- (0, swagger_1.ApiOperation)({ summary: "Start KYC" }),
147
- (0, swagger_1.ApiResponse)({ status: 200, description: "KYC started successfully" }),
148
- (0, swagger_1.ApiResponse)({ status: 400, description: "Bad request" }),
149
- __param(0, (0, wallet_address_decorator_1.WalletAddress)()),
150
- __param(1, (0, common_1.Body)()),
151
- __metadata("design:type", Function),
152
- __metadata("design:paramtypes", [String, Object]),
153
- __metadata("design:returntype", Promise)
154
- ], ProfilesController.prototype, "startKyc", null);
155
- __decorate([
156
- (0, common_1.Post)("/kyc/workflow"),
157
- (0, swagger_1.ApiOperation)({ summary: "Start KYC workflow run" }),
158
- (0, swagger_1.ApiResponse)({
159
- status: 200,
160
- description: "KYC workflow run created successfully",
161
- }),
162
- (0, swagger_1.ApiResponse)({ status: 400, description: "Bad request" }),
163
- __param(0, (0, wallet_address_decorator_1.WalletAddress)()),
164
- __metadata("design:type", Function),
165
- __metadata("design:paramtypes", [String]),
166
- __metadata("design:returntype", Promise)
167
- ], ProfilesController.prototype, "createWorkflowRun", null);
168
- exports.ProfilesController = ProfilesController = __decorate([
169
- (0, swagger_1.ApiTags)("Users"),
170
- (0, common_1.Controller)("users"),
171
- __metadata("design:paramtypes", [profiles_service_1.ProfilesService])
172
- ], ProfilesController);
173
- //# sourceMappingURL=profiles.controller.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"profiles.controller.js","sourceRoot":"","sources":["../../../src/modules/profiles/profiles.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CASwB;AACxB,+DAA2D;AAC3D,6CAKyB;AACzB,yDAAqD;AACrD,6DAAwD;AACxD,iEAA4D;AAC5D,6DAAwD;AACxD,2EAAsE;AACtE,uFAAyE;AAKlE,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC7B,YAA6B,eAAgC;QAAhC,oBAAe,GAAf,eAAe,CAAiB;IAAG,CAAC;IAM3D,AAAN,KAAK,CAAC,WAAW,CACP,KAAqB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A,sBAAY,EAAC,EAAE,OAAO,EAAE,+BAA+B,EAAE,CAAC;IAC1D,IAAA,qBAAW,EAAC,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,+BAA+B,EAAE,CAAC;IAC1E,IAAA,qBAAW,EAAC,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC;IACpC,WAAA,IAAA,wCAAa,GAAE,CAAA;;;;uDAEnC;AAMK;IAJL,IAAA,aAAI,EAAC,MAAM,CAAC;IACZ,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;IACtC,IAAA,qBAAW,EAAC,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,0BAA0B,EAAE,CAAC;IACrE,IAAA,qBAAW,EAAC,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC;IACzC,WAAA,IAAA,wCAAa,GAAE,CAAA;IAAmB,WAAA,IAAA,aAAI,GAAE,CAAA;;;;kDAEvD;AASK;IAPL,IAAA,aAAI,EAAC,eAAe,CAAC;IACrB,IAAA,sBAAY,EAAC,EAAE,OAAO,EAAE,wBAAwB,EAAE,CAAC;IACnD,IAAA,qBAAW,EAAC;QACX,MAAM,EAAE,GAAG;QACX,WAAW,EAAE,uCAAuC;KACrD,CAAC;IACD,IAAA,qBAAW,EAAC,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC;IAChC,WAAA,IAAA,wCAAa,GAAE,CAAA;;;;2DAEvC;6BA3GU,kBAAkB;IAF9B,IAAA,iBAAO,EAAC,OAAO,CAAC;IAChB,IAAA,mBAAU,EAAC,OAAO,CAAC;qCAE4B,kCAAe;GADlD,kBAAkB,CA4G9B"}
@@ -1,18 +0,0 @@
1
- /// <reference types="multer" />
2
- import { UserProfile, UpdateUserProfileInput, KycDataForm, GetUsersInput, KycApplicant, OnfidoWorkflowRunResponse, GetUserOptions } from "./profiles.types";
3
- export declare class ProfilesService {
4
- private readonly axiosInstance;
5
- constructor();
6
- private createJwt;
7
- linkAddress(email: string, address: string): Promise<void>;
8
- verifyEmail(address: string, code: string): Promise<void>;
9
- resendVerificationCode(address: string, email: string): Promise<void>;
10
- getUserProfile(address: string, options?: GetUserOptions): Promise<UserProfile>;
11
- checkUsername(username: string): Promise<boolean>;
12
- updateUserProfile(address: string, updateData: UpdateUserProfileInput, profileImage: Express.Multer.File | null): Promise<UserProfile>;
13
- unlinkAddress(address: string): Promise<void>;
14
- startKYC(walletAddress: string, kycData: KycDataForm): Promise<KycApplicant>;
15
- createWorkflowRun(address: string): Promise<OnfidoWorkflowRunResponse>;
16
- getUserProfiles(input: GetUsersInput, options?: GetUserOptions): Promise<Record<string, UserProfile>>;
17
- private handleAxiosError;
18
- }
@@ -1,168 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ProfilesService = void 0;
13
- const common_1 = require("@nestjs/common");
14
- const axios_1 = require("axios");
15
- const jsonwebtoken_1 = require("jsonwebtoken");
16
- const api_config_service_1 = require("../../config/api-config.service");
17
- let ProfilesService = class ProfilesService {
18
- constructor() {
19
- this.axiosInstance = axios_1.default.create({
20
- baseURL: api_config_service_1.ApiConfigService.getAtlasBaseUrl(),
21
- });
22
- this.axiosInstance.interceptors.request.use((config) => {
23
- const token = this.createJwt();
24
- config.headers["Authorization"] = `Bearer ${token}`;
25
- return config;
26
- });
27
- }
28
- createJwt() {
29
- const payload = {
30
- exp: Math.floor(Date.now() / 1000) + 60,
31
- };
32
- return (0, jsonwebtoken_1.sign)(payload, api_config_service_1.ApiConfigService.getAtlasJwtSecret());
33
- }
34
- async linkAddress(email, address) {
35
- try {
36
- await this.axiosInstance.post("/users/link-email", {
37
- email,
38
- address,
39
- chain: api_config_service_1.ApiConfigService.getServiceType(),
40
- });
41
- }
42
- catch (error) {
43
- this.handleAxiosError(error);
44
- }
45
- }
46
- async verifyEmail(address, code) {
47
- try {
48
- await this.axiosInstance.post("/users/verify-email", {
49
- address,
50
- code,
51
- chain: api_config_service_1.ApiConfigService.getServiceType(),
52
- });
53
- }
54
- catch (error) {
55
- this.handleAxiosError(error);
56
- }
57
- }
58
- async resendVerificationCode(address, email) {
59
- try {
60
- await this.axiosInstance.post("/users/resend-verification", {
61
- address,
62
- email,
63
- });
64
- }
65
- catch (error) {
66
- this.handleAxiosError(error);
67
- }
68
- }
69
- async getUserProfile(address, options = {}) {
70
- try {
71
- const response = await this.axiosInstance.get(`/users/${address}`, {
72
- params: {
73
- includeKyc: options.includeKyc || false,
74
- includePublicProfile: options.includePublicProfile || false,
75
- includeUnverified: options.includeUnverified || false,
76
- },
77
- });
78
- return response.data;
79
- }
80
- catch (error) {
81
- this.handleAxiosError(error);
82
- }
83
- }
84
- async checkUsername(username) {
85
- try {
86
- const response = await this.axiosInstance.get(`/users/check-username/${username}`);
87
- return response.data;
88
- }
89
- catch (error) {
90
- this.handleAxiosError(error);
91
- }
92
- }
93
- async updateUserProfile(address, updateData, profileImage) {
94
- const formData = new FormData();
95
- Object.keys(updateData).forEach((key) => {
96
- formData.append(key, updateData[key]);
97
- });
98
- if (profileImage) {
99
- const blob = new Blob([profileImage.buffer], {
100
- type: profileImage.mimetype,
101
- });
102
- formData.append("profileImage", blob, profileImage.originalname);
103
- }
104
- formData.append("address", address);
105
- try {
106
- const response = await this.axiosInstance.put(`/users/${address}`, formData, {
107
- headers: { "Content-Type": "multipart/form-data" },
108
- });
109
- return response.data;
110
- }
111
- catch (error) {
112
- this.handleAxiosError(error);
113
- }
114
- }
115
- async unlinkAddress(address) {
116
- try {
117
- await this.axiosInstance.post("/users/unlink-address", { address });
118
- }
119
- catch (error) {
120
- this.handleAxiosError(error);
121
- }
122
- }
123
- async startKYC(walletAddress, kycData) {
124
- try {
125
- const response = await this.axiosInstance.post("/users/kyc", Object.assign({ walletAddress }, kycData));
126
- return response.data;
127
- }
128
- catch (error) {
129
- this.handleAxiosError(error);
130
- }
131
- }
132
- async createWorkflowRun(address) {
133
- try {
134
- const response = await this.axiosInstance.post("/users/kyc/workflow", {
135
- address,
136
- });
137
- return response.data;
138
- }
139
- catch (error) {
140
- this.handleAxiosError(error);
141
- }
142
- }
143
- async getUserProfiles(input, options = {}) {
144
- try {
145
- const response = await this.axiosInstance.post("/users/profiles", input, {
146
- params: {
147
- includeKyc: options.includeKyc || false,
148
- includePublicProfile: options.includePublicProfile || false,
149
- includeUnverified: options.includeUnverified || false,
150
- },
151
- });
152
- return response.data;
153
- }
154
- catch (error) {
155
- this.handleAxiosError(error);
156
- }
157
- }
158
- handleAxiosError(error) {
159
- const errorMessage = error.response.data.error;
160
- throw new common_1.BadRequestException(errorMessage);
161
- }
162
- };
163
- exports.ProfilesService = ProfilesService;
164
- exports.ProfilesService = ProfilesService = __decorate([
165
- (0, common_1.Injectable)(),
166
- __metadata("design:paramtypes", [])
167
- ], ProfilesService);
168
- //# sourceMappingURL=profiles.service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"profiles.service.js","sourceRoot":"","sources":["../../../src/modules/profiles/profiles.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAiE;AACjE,iCAA6C;AAC7C,+CAAoC;AAWpC,wEAAmE;AAG5D,IAAM,eAAe,GAArB,MAAM,eAAe;IAG1B;QACE,IAAI,C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B,CAAC,KAAK,CAAC,CAAC;SAC9B;IACH,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,OAAe;QACrC,IAAI;YACF,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,qBAAqB,EAAE;gBACpE,OAAO;aACR,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,IAAI,CAAC;SACtB;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;SAC9B;IACH,CAAC;IAED,KAAK,CAAC,eAAe,CACnB,KAAoB,EACpB,UAA0B,EAAE;QAE5B,IAAI;YACF,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,iBAAiB,EAAE,KAAK,EAAE;gBACvE,MAAM,EAAE;oBACN,UAAU,EAAE,OAAO,CAAC,UAAU,IAAI,KAAK;oBACvC,oBAAoB,EAAE,OAAO,CAAC,oBAAoB,IAAI,KAAK;oBAC3D,iBAAiB,EAAE,OAAO,CAAC,iBAAiB,IAAI,KAAK;iBACtD;aACF,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,IAAI,CAAC;SACtB;QAAC,OAAO,KAAK,EAAE;YACd,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;SAC9B;IACH,CAAC;IAEO,gBAAgB,CAAC,KAAU;QACjC,MAAM,YAAY,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;QAC/C,MAAM,IAAI,4BAAmB,CAAC,YAAY,CAAC,CAAC;IAC9C,CAAC;CACF,CAAA;AA/KY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;;GACA,eAAe,CA+K3B"}
@@ -1,81 +0,0 @@
1
- export interface LinkAddressInput {
2
- email: string;
3
- }
4
- export interface ResendVerificationInput {
5
- email: string;
6
- phoneNumber: string;
7
- }
8
- export interface UserProfile {
9
- id: string;
10
- email: string;
11
- phoneNumber: string;
12
- username: string;
13
- profileImageUrl: string;
14
- kycApplicant?: KycApplicant;
15
- publicProfile?: {};
16
- }
17
- export interface UpdateUserProfileInput {
18
- firstName?: string;
19
- surname?: string;
20
- username?: string;
21
- }
22
- export interface KycDataForm {
23
- walletAddress: string;
24
- dob: string;
25
- flatNumber?: string;
26
- buildingNumber?: string;
27
- street: string;
28
- town: string;
29
- state: string;
30
- postcode: string;
31
- country: string;
32
- }
33
- export interface KycWorkflowRunForm {
34
- address: string;
35
- }
36
- export interface GetUsersInput {
37
- addresses: string[];
38
- }
39
- export declare enum KYC_Status {
40
- PENDING = "PENDING",
41
- APPROVED = "APPROVED",
42
- REJECTED = "REJECTED"
43
- }
44
- export interface KycApplicant {
45
- guid: string;
46
- kycStatus: KYC_Status;
47
- onfidoApplicantId: string | null;
48
- workflowRunID?: string;
49
- workflowStatus?: KYC_Status;
50
- workflowRunCreatedAt?: string;
51
- userId: number;
52
- firstName: string;
53
- lastName: string;
54
- dob: string;
55
- flatNumber: string;
56
- buildingNumber: string;
57
- street: string;
58
- town: string;
59
- state: string;
60
- postcode: string;
61
- country: string;
62
- }
63
- export interface OnfidoWorkflowRunResponse {
64
- id: string;
65
- workflow_id: string;
66
- applicant_id: string;
67
- status: string;
68
- created_at: string;
69
- tags?: string[];
70
- custom_data?: Record<string, any>;
71
- link?: {
72
- href: string;
73
- };
74
- customer_user_id?: string;
75
- sdk_token: string;
76
- }
77
- export interface GetUserOptions {
78
- includeKyc?: boolean;
79
- includePublicProfile?: boolean;
80
- includeUnverified?: boolean;
81
- }
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.KYC_Status = void 0;
4
- var KYC_Status;
5
- (function (KYC_Status) {
6
- KYC_Status["PENDING"] = "PENDING";
7
- KYC_Status["APPROVED"] = "APPROVED";
8
- KYC_Status["REJECTED"] = "REJECTED";
9
- })(KYC_Status || (exports.KYC_Status = KYC_Status = {}));
10
- //# sourceMappingURL=profiles.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"profiles.types.js","sourceRoot":"","sources":["../../../src/modules/profiles/profiles.types.ts"],"names":[],"mappings":";;;AA+CA,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,iCAAmB,CAAA;IACnB,mCAAqB,CAAA;IACrB,mCAAqB,CAAA;AACvB,CAAC,EAJW,UAAU,0BAAV,UAAU,QAIrB"}