@pulsar.money/atlas-sdk 0.3.5 → 0.4.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.
Files changed (53) hide show
  1. package/dist/config/api-config.service.d.ts +5 -0
  2. package/dist/config/api-config.service.js +29 -0
  3. package/dist/config/api-config.service.js.map +1 -0
  4. package/dist/decorator/wallet-address.decorator.d.ts +1 -0
  5. package/dist/decorator/wallet-address.decorator.js +29 -0
  6. package/dist/decorator/wallet-address.decorator.js.map +1 -0
  7. package/dist/index.d.ts +1 -0
  8. package/dist/index.js +18 -0
  9. package/dist/index.js.map +1 -0
  10. package/dist/modules/index.d.ts +2 -0
  11. package/dist/modules/index.js +19 -0
  12. package/dist/modules/index.js.map +1 -0
  13. package/dist/modules/payments/index.d.ts +3 -0
  14. package/dist/modules/payments/index.js +20 -0
  15. package/dist/modules/payments/index.js.map +1 -0
  16. package/dist/modules/payments/payment.controller.d.ts +9 -0
  17. package/dist/modules/payments/payment.controller.js +44 -0
  18. package/dist/modules/payments/payment.controller.js.map +1 -0
  19. package/dist/modules/payments/payment.service.d.ts +8 -0
  20. package/dist/modules/payments/payment.service.js +55 -0
  21. package/dist/modules/payments/payment.service.js.map +1 -0
  22. package/dist/modules/payments/payment.types.d.ts +132 -0
  23. package/dist/modules/payments/payment.types.js +22 -0
  24. package/dist/modules/payments/payment.types.js.map +1 -0
  25. package/dist/modules/profiles/dto/index.d.ts +0 -0
  26. package/dist/modules/profiles/dto/index.js +1 -0
  27. package/dist/modules/profiles/dto/index.js.map +1 -0
  28. package/dist/modules/profiles/dto/link-address.dto.d.ts +3 -0
  29. package/dist/modules/profiles/dto/link-address.dto.js +24 -0
  30. package/dist/modules/profiles/dto/link-address.dto.js.map +1 -0
  31. package/dist/modules/profiles/dto/resend-verification.dto.d.ts +3 -0
  32. package/dist/modules/profiles/dto/resend-verification.dto.js +24 -0
  33. package/dist/modules/profiles/dto/resend-verification.dto.js.map +1 -0
  34. package/dist/modules/profiles/dto/update-profile.dto.d.ts +14 -0
  35. package/dist/modules/profiles/dto/update-profile.dto.js +84 -0
  36. package/dist/modules/profiles/dto/update-profile.dto.js.map +1 -0
  37. package/dist/modules/profiles/dto/verify-email.dto.d.ts +3 -0
  38. package/dist/modules/profiles/dto/verify-email.dto.js +24 -0
  39. package/dist/modules/profiles/dto/verify-email.dto.js.map +1 -0
  40. package/dist/modules/profiles/index.d.ts +3 -0
  41. package/dist/modules/profiles/index.js +20 -0
  42. package/dist/modules/profiles/index.js.map +1 -0
  43. package/dist/modules/profiles/profiles.controller.d.ts +20 -0
  44. package/dist/modules/profiles/profiles.controller.js +179 -0
  45. package/dist/modules/profiles/profiles.controller.js.map +1 -0
  46. package/dist/modules/profiles/profiles.service.d.ts +18 -0
  47. package/dist/modules/profiles/profiles.service.js +180 -0
  48. package/dist/modules/profiles/profiles.service.js.map +1 -0
  49. package/dist/modules/profiles/profiles.types.d.ts +81 -0
  50. package/dist/modules/profiles/profiles.types.js +10 -0
  51. package/dist/modules/profiles/profiles.types.js.map +1 -0
  52. package/dist/tsconfig.tsbuildinfo +1 -0
  53. package/package.json +4 -2
@@ -0,0 +1,24 @@
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.VerifyEmailDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const swagger_1 = require("@nestjs/swagger");
15
+ class VerifyEmailDto {
16
+ }
17
+ exports.VerifyEmailDto = VerifyEmailDto;
18
+ __decorate([
19
+ (0, swagger_1.ApiProperty)({ description: 'Verification code' }),
20
+ (0, class_validator_1.IsString)(),
21
+ (0, class_validator_1.IsNotEmpty)(),
22
+ __metadata("design:type", String)
23
+ ], VerifyEmailDto.prototype, "code", void 0);
24
+ //# sourceMappingURL=verify-email.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verify-email.dto.js","sourceRoot":"","sources":["../../../../src/modules/profiles/dto/verify-email.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAuD;AACvD,6CAA8C;AAE9C,MAAa,cAAc;CAK1B;AALD,wCAKC;AADC;IAHC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAC;IACjD,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;4CACC"}
@@ -0,0 +1,3 @@
1
+ export * from "./profiles.service";
2
+ export * from "./profiles.controller";
3
+ export * from "./profiles.types";
@@ -0,0 +1,20 @@
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/modules/profiles/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,qDAAmC;AACnC,wDAAsC;AACtC,mDAAiC"}
@@ -0,0 +1,20 @@
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, address: string, profileImage?: Express.Multer.File, bannerImage?: Express.Multer.File, bannerMobileImage?: Express.Multer.File): 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
+ }
@@ -0,0 +1,179 @@
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, address, profileImage, bannerImage, bannerMobileImage) {
46
+ return await this.profilesService.updateUserProfile(address, updateData, profileImage, bannerImage, bannerMobileImage);
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, swagger_1.ApiResponse)({ status: 400, description: "Bad request" }),
117
+ (0, swagger_1.ApiResponse)({ status: 403, description: "User not verified" }),
118
+ (0, swagger_1.ApiResponse)({ status: 404, description: "User not found" }),
119
+ (0, swagger_1.ApiResponse)({ status: 500, description: "Internal server error" }),
120
+ (0, common_1.UseInterceptors)((0, platform_express_1.FileInterceptor)("profileImage"), (0, platform_express_1.FileInterceptor)("bannerImage"), (0, platform_express_1.FileInterceptor)("bannerMobileImage")),
121
+ __param(0, (0, common_1.Body)()),
122
+ __param(1, (0, wallet_address_decorator_1.WalletAddress)()),
123
+ __param(2, (0, common_1.UploadedFile)("profileImage")),
124
+ __param(3, (0, common_1.UploadedFile)("bannerImage")),
125
+ __param(4, (0, common_1.UploadedFile)("bannerMobileImage")),
126
+ __metadata("design:type", Function),
127
+ __metadata("design:paramtypes", [update_profile_dto_1.UpdateProfileDto, String, Object, Object, Object]),
128
+ __metadata("design:returntype", Promise)
129
+ ], ProfilesController.prototype, "updateUserProfile", null);
130
+ __decorate([
131
+ (0, common_1.Get)("/valid-username/:username"),
132
+ (0, swagger_1.ApiOperation)({ summary: "Check if a username is valid" }),
133
+ (0, swagger_1.ApiResponse)({ status: 200, description: "Username is valid" }),
134
+ (0, swagger_1.ApiResponse)({ status: 400, description: "Username is invalid" }),
135
+ __param(0, (0, common_1.Param)("username")),
136
+ __metadata("design:type", Function),
137
+ __metadata("design:paramtypes", [String]),
138
+ __metadata("design:returntype", Promise)
139
+ ], ProfilesController.prototype, "checkUsername", null);
140
+ __decorate([
141
+ (0, common_1.Post)("/unlink-address"),
142
+ (0, swagger_1.ApiOperation)({ summary: "Unlink an address from a user" }),
143
+ (0, swagger_1.ApiResponse)({ status: 200, description: "Address unlinked successfully" }),
144
+ (0, swagger_1.ApiResponse)({ status: 400, description: "Bad request" }),
145
+ __param(0, (0, wallet_address_decorator_1.WalletAddress)()),
146
+ __metadata("design:type", Function),
147
+ __metadata("design:paramtypes", [String]),
148
+ __metadata("design:returntype", Promise)
149
+ ], ProfilesController.prototype, "unlinkAddress", null);
150
+ __decorate([
151
+ (0, common_1.Post)("/kyc"),
152
+ (0, swagger_1.ApiOperation)({ summary: "Start KYC" }),
153
+ (0, swagger_1.ApiResponse)({ status: 200, description: "KYC started successfully" }),
154
+ (0, swagger_1.ApiResponse)({ status: 400, description: "Bad request" }),
155
+ __param(0, (0, wallet_address_decorator_1.WalletAddress)()),
156
+ __param(1, (0, common_1.Body)()),
157
+ __metadata("design:type", Function),
158
+ __metadata("design:paramtypes", [String, Object]),
159
+ __metadata("design:returntype", Promise)
160
+ ], ProfilesController.prototype, "startKyc", null);
161
+ __decorate([
162
+ (0, common_1.Post)("/kyc/workflow"),
163
+ (0, swagger_1.ApiOperation)({ summary: "Start KYC workflow run" }),
164
+ (0, swagger_1.ApiResponse)({
165
+ status: 200,
166
+ description: "KYC workflow run created successfully",
167
+ }),
168
+ (0, swagger_1.ApiResponse)({ status: 400, description: "Bad request" }),
169
+ __param(0, (0, wallet_address_decorator_1.WalletAddress)()),
170
+ __metadata("design:type", Function),
171
+ __metadata("design:paramtypes", [String]),
172
+ __metadata("design:returntype", Promise)
173
+ ], ProfilesController.prototype, "createWorkflowRun", null);
174
+ exports.ProfilesController = ProfilesController = __decorate([
175
+ (0, swagger_1.ApiTags)("Users"),
176
+ (0, common_1.Controller)("users"),
177
+ __metadata("design:paramtypes", [profiles_service_1.ProfilesService])
178
+ ], ProfilesController);
179
+ //# sourceMappingURL=profiles.controller.js.map
@@ -0,0 +1 @@
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,EACZ,OAAe;QAEhC,OAAO,MAAM,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACtE,CAAC;IAMK,AAAN,KAAK,CAAC,WAAW,CACP,KAAqB,EACZ,OAAe;QAEhC,OAAO,MAAM,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IACrE,CAAC;IAMK,AAAN,KAAK,CAAC,sBAAsB,CACT,OAAe,EACxB,KAA4B;QAEpC,OAAO,MAAM,IAAI,CAAC,eAAe,CAAC,sBAAsB,CACtD,OAAO,EACP,KAAK,CAAC,KAAK,CACZ,CAAC;IACJ,CAAC;IASK,AAAN,KAAK,CAAC,cAAc,CAAkB,OAAe;QACnD,OAAO,MAAM,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,OAAO,EAAE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kflowRunResponse, 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, bannerImage: Express.Multer.File | null, bannerMobileImage: 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
+ }
@@ -0,0 +1,180 @@
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/valid-username/${username}`);
87
+ return response.data;
88
+ }
89
+ catch (error) {
90
+ this.handleAxiosError(error);
91
+ }
92
+ }
93
+ async updateUserProfile(address, updateData, profileImage, bannerImage, bannerMobileImage) {
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
+ if (bannerImage) {
105
+ const blob = new Blob([bannerImage.buffer], {
106
+ type: bannerImage.mimetype,
107
+ });
108
+ formData.append("bannerImage", blob, bannerImage.originalname);
109
+ }
110
+ if (bannerMobileImage) {
111
+ const blob = new Blob([bannerMobileImage.buffer], {
112
+ type: bannerMobileImage.mimetype,
113
+ });
114
+ formData.append("bannerMobileImage", blob, bannerMobileImage.originalname);
115
+ }
116
+ formData.append("address", address);
117
+ try {
118
+ const response = await this.axiosInstance.put(`/users/${address}`, formData, {
119
+ headers: { "Content-Type": "multipart/form-data" },
120
+ });
121
+ return response.data;
122
+ }
123
+ catch (error) {
124
+ this.handleAxiosError(error);
125
+ }
126
+ }
127
+ async unlinkAddress(address) {
128
+ try {
129
+ await this.axiosInstance.post("/users/unlink-address", { address });
130
+ }
131
+ catch (error) {
132
+ this.handleAxiosError(error);
133
+ }
134
+ }
135
+ async startKYC(walletAddress, kycData) {
136
+ try {
137
+ const response = await this.axiosInstance.post("/users/kyc", Object.assign({ walletAddress }, kycData));
138
+ return response.data;
139
+ }
140
+ catch (error) {
141
+ this.handleAxiosError(error);
142
+ }
143
+ }
144
+ async createWorkflowRun(address) {
145
+ try {
146
+ const response = await this.axiosInstance.post("/users/kyc/workflow", {
147
+ address,
148
+ });
149
+ return response.data;
150
+ }
151
+ catch (error) {
152
+ this.handleAxiosError(error);
153
+ }
154
+ }
155
+ async getUserProfiles(input, options = {}) {
156
+ try {
157
+ const response = await this.axiosInstance.post("/users/profiles", input, {
158
+ params: {
159
+ includeKyc: options.includeKyc || false,
160
+ includePublicProfile: options.includePublicProfile || false,
161
+ includeUnverified: options.includeUnverified || false,
162
+ },
163
+ });
164
+ return response.data;
165
+ }
166
+ catch (error) {
167
+ this.handleAxiosError(error);
168
+ }
169
+ }
170
+ handleAxiosError(error) {
171
+ const errorMessage = error.response.data.error;
172
+ throw new common_1.BadRequestException(errorMessage);
173
+ }
174
+ };
175
+ exports.ProfilesService = ProfilesService;
176
+ exports.ProfilesService = ProfilesService = __decorate([
177
+ (0, common_1.Injectable)(),
178
+ __metadata("design:paramtypes", [])
179
+ ], ProfilesService);
180
+ //# sourceMappingURL=profiles.service.js.map
@@ -0,0 +1 @@
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,CAAC,aAAa,GAAG,eAAK,CAAC,MAAM,CAAC;YAChC,OAAO,EAAE,qCAAgB,CAAC,eAAe,EAAE;SAC5C,CAAC,CAAC;QAEH,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;YACrD,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;YAC/B,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,KAAK,EAAE,CAAC;YACpD,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC,CAAC;IACL,CAAC;IAEO,SAAS;QACf,MAAM,OAAO,GAAG;YACd,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE;SACxC,CAAC;QACF,OAAO,IAAA,mBAAI,EAAC,OAAO,EAAE,qCAAgB,CAAC,iBAAiB,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,KAAa,EAAE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,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;AAjMY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;;GACA,eAAe,CAiM3B"}
@@ -0,0 +1,81 @@
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
+ profileImage: 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
+ }
@@ -0,0 +1,10 @@
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
@@ -0,0 +1 @@
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"}