@spritz-finance/service-client 0.2.69 → 0.2.71

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/lib/config.d.ts CHANGED
@@ -10,6 +10,7 @@ interface GraphClientConfig {
10
10
  growthServiceEndpoint: string;
11
11
  exchangeRatesServiceEndpoint: string;
12
12
  web3ServiceEndpoint: string;
13
+ unblockServiceEndpoint: string;
13
14
  }
14
15
  export declare const config: GraphClientConfig;
15
16
  export {};
package/lib/config.js CHANGED
@@ -16,6 +16,7 @@ const envConfigs = {
16
16
  growthServiceEndpoint: 'https://api-dev.spritz.finance/growth',
17
17
  exchangeRatesServiceEndpoint: 'https://api-dev.spritz.finance/exchange-rates',
18
18
  web3ServiceEndpoint: 'https://api-dev.spritz.finance/web3',
19
+ unblockServiceEndpoint: 'https://api-dev.spritz.finance/unblock',
19
20
  },
20
21
  test: {
21
22
  env: 'staging',
@@ -41,6 +42,7 @@ const envConfigs = {
41
42
  growthServiceEndpoint: 'https://api-staging.spritz.finance/growth',
42
43
  exchangeRatesServiceEndpoint: 'https://api-staging.spritz.finance/exchange-rates',
43
44
  web3ServiceEndpoint: 'https://api-staging.spritz.finance/web3',
45
+ unblockServiceEndpoint: 'https://api-staging.spritz.finance/unblock',
44
46
  },
45
47
  production: {
46
48
  authEndpoint: 'https://auth.spritz.finance/oauth2/token',
@@ -53,6 +55,7 @@ const envConfigs = {
53
55
  growthServiceEndpoint: 'https://api.spritz.finance/growth',
54
56
  exchangeRatesServiceEndpoint: 'https://api.spritz.finance/exchange-rates',
55
57
  web3ServiceEndpoint: 'https://api.spritz.finance/web3',
58
+ unblockServiceEndpoint: 'https://api.spritz.finance/unblock',
56
59
  },
57
60
  };
58
61
  exports.config = (0, config_1.setupEnvConfig)(envConfigs);
package/lib/index.d.ts CHANGED
@@ -9,3 +9,4 @@ export * from './liabilitiesServiceClient';
9
9
  export * from './payableAccountsServiceClient';
10
10
  export * from './exchangeRatesServiceClient';
11
11
  export * from './web3ServiceClient';
12
+ export * from './unblockServiceClient';
package/lib/index.js CHANGED
@@ -25,3 +25,4 @@ __exportStar(require("./liabilitiesServiceClient"), exports);
25
25
  __exportStar(require("./payableAccountsServiceClient"), exports);
26
26
  __exportStar(require("./exchangeRatesServiceClient"), exports);
27
27
  __exportStar(require("./web3ServiceClient"), exports);
28
+ __exportStar(require("./unblockServiceClient"), exports);
@@ -0,0 +1,71 @@
1
+ import { AxiosInstance } from 'axios';
2
+ export declare enum UnblockUserStatus {
3
+ Created = "CREATED",
4
+ KycNeeded = "KYC_NEEDED",
5
+ PendingKycData = "PENDING_KYC_DATA",
6
+ KycPending = "KYC_PENDING",
7
+ SoftKycFailed = "SOFT_KYC_FAILED",
8
+ HardKycFailed = "HARD_KYC_FAILED",
9
+ FullUser = "FULL_USER",
10
+ Suspended = "SUSPENDED"
11
+ }
12
+ export type CreateUnblockAccountInput = {
13
+ otp: string;
14
+ userId: string;
15
+ name: string;
16
+ accountDetails: {
17
+ sortCode?: string;
18
+ iban?: string;
19
+ accountNumber?: string;
20
+ currency?: string;
21
+ };
22
+ };
23
+ export type CreateUnblockUserInput = {
24
+ userId: string;
25
+ firstName: string;
26
+ lastName: string;
27
+ email: string;
28
+ targetAddress?: string;
29
+ country: string;
30
+ };
31
+ export type UnblockAccount = {
32
+ id: string;
33
+ _id: string;
34
+ userId: string;
35
+ status: UnblockUserStatus;
36
+ externalId: string;
37
+ first_name: string;
38
+ last_name: string;
39
+ date_of_birth: string;
40
+ email: string;
41
+ target_address: string;
42
+ address: {
43
+ address_line_1: string;
44
+ address_line_2: string;
45
+ post_code: string;
46
+ city: string;
47
+ country: string;
48
+ };
49
+ };
50
+ export type UnblockUser = {
51
+ id: string;
52
+ _id: string;
53
+ userId: string;
54
+ externalId: string;
55
+ account_name: string;
56
+ iban: string;
57
+ bic: string;
58
+ account_number: string;
59
+ sort_code: string;
60
+ currency: string;
61
+ main_beneficiary: boolean;
62
+ };
63
+ export declare class UnblockServiceClient {
64
+ client: AxiosInstance;
65
+ constructor();
66
+ requestOTP(userId: string): Promise<{
67
+ success: boolean;
68
+ }>;
69
+ createUnblockAccount(input: CreateUnblockAccountInput): Promise<UnblockAccount>;
70
+ createUnblockUser(input: CreateUnblockUserInput): Promise<UnblockAccount>;
71
+ }
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UnblockServiceClient = exports.UnblockUserStatus = void 0;
4
+ const config_1 = require("./config");
5
+ const serviceClient_1 = require("./serviceClient");
6
+ var UnblockUserStatus;
7
+ (function (UnblockUserStatus) {
8
+ UnblockUserStatus["Created"] = "CREATED";
9
+ UnblockUserStatus["KycNeeded"] = "KYC_NEEDED";
10
+ UnblockUserStatus["PendingKycData"] = "PENDING_KYC_DATA";
11
+ UnblockUserStatus["KycPending"] = "KYC_PENDING";
12
+ UnblockUserStatus["SoftKycFailed"] = "SOFT_KYC_FAILED";
13
+ UnblockUserStatus["HardKycFailed"] = "HARD_KYC_FAILED";
14
+ UnblockUserStatus["FullUser"] = "FULL_USER";
15
+ UnblockUserStatus["Suspended"] = "SUSPENDED";
16
+ })(UnblockUserStatus || (exports.UnblockUserStatus = UnblockUserStatus = {}));
17
+ class UnblockServiceClient {
18
+ constructor() {
19
+ this.client = (0, serviceClient_1.createServiceClient)({
20
+ baseURL: config_1.config.unblockServiceEndpoint,
21
+ });
22
+ }
23
+ async requestOTP(userId) {
24
+ return this.client
25
+ .get(`/user/${userId}/request-otp`)
26
+ .then((res) => res.data);
27
+ }
28
+ async createUnblockAccount(input) {
29
+ return this.client
30
+ .post(`/account`, input)
31
+ .then((res) => res.data);
32
+ }
33
+ async createUnblockUser(input) {
34
+ return this.client
35
+ .post(`/user`, input)
36
+ .then((res) => res.data);
37
+ }
38
+ }
39
+ exports.UnblockServiceClient = UnblockServiceClient;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spritz-finance/service-client",
3
- "version": "0.2.69",
3
+ "version": "0.2.71",
4
4
  "description": "Service client",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",