squarefi-bff-api-module 1.10.10 → 1.10.12
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/dist/api/auth.d.ts +1 -1
- package/dist/api/auth.js +19 -2
- package/dist/api/counterparties.d.ts +1 -1
- package/dist/api/types.d.ts +1 -8
- package/dist/utils/converters.d.ts +1 -0
- package/dist/utils/converters.js +5 -0
- package/package.json +1 -1
- package/src/api/auth.ts +6 -3
- package/src/api/types.ts +1 -8
- package/src/utils/converters.ts +1 -0
package/dist/api/auth.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export declare const auth: {
|
|
|
12
12
|
signin: {
|
|
13
13
|
omni: {
|
|
14
14
|
email: (data: API.Auth.SignIn.Email.OTP.Request) => Promise<unknown>;
|
|
15
|
-
phone: (data: API.Auth.SignIn.Phone.OTP.Request) => Promise<unknown>;
|
|
15
|
+
phone: ({ phone, ...data }: API.Auth.SignIn.Phone.OTP.Request) => Promise<unknown>;
|
|
16
16
|
};
|
|
17
17
|
telegram: (data: API.Auth.Telegram.Signin) => Promise<API.Auth.Tokens>;
|
|
18
18
|
password: (email: string, password: string) => Promise<API.Auth.Tokens>;
|
package/dist/api/auth.js
CHANGED
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
2
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
14
|
exports.auth = exports.refreshTokenPath = exports.telegramSignUpPath = exports.telegramSignInPath = void 0;
|
|
4
15
|
const apiClientFactory_1 = require("../utils/apiClientFactory");
|
|
16
|
+
const converters_1 = require("../utils/converters");
|
|
5
17
|
exports.telegramSignInPath = '/auth/sign-in/telegram';
|
|
6
18
|
exports.telegramSignUpPath = '/auth/sign-up/telegram';
|
|
7
19
|
exports.refreshTokenPath = '/auth/refresh/refresh-token';
|
|
@@ -12,14 +24,19 @@ exports.auth = {
|
|
|
12
24
|
data: { email, token, type: 'email' },
|
|
13
25
|
}),
|
|
14
26
|
phone: (phone, token) => apiClientFactory_1.apiClientV2.postRequest('/auth/verify/phone/otp', {
|
|
15
|
-
data: { phone, token, type: 'sms' },
|
|
27
|
+
data: { phone: (0, converters_1.convertPhoneToSupabaseFormat)(phone), token, type: 'sms' },
|
|
16
28
|
}),
|
|
17
29
|
},
|
|
18
30
|
},
|
|
19
31
|
signin: {
|
|
20
32
|
omni: {
|
|
21
33
|
email: (data) => apiClientFactory_1.apiClientV2.postRequest('/auth/sign-in/omni/email/otp', { data }),
|
|
22
|
-
phone: (
|
|
34
|
+
phone: (_a) => {
|
|
35
|
+
var { phone } = _a, data = __rest(_a, ["phone"]);
|
|
36
|
+
return apiClientFactory_1.apiClientV2.postRequest('/auth/sign-in/omni/phone/otp', {
|
|
37
|
+
data: Object.assign({ phone: (0, converters_1.convertPhoneToSupabaseFormat)(phone) }, data),
|
|
38
|
+
});
|
|
39
|
+
},
|
|
23
40
|
},
|
|
24
41
|
telegram: (data) => apiClientFactory_1.apiClientV2.postRequest(exports.telegramSignInPath, { data }),
|
|
25
42
|
password: (email, password // check on backend V2
|
|
@@ -7,7 +7,7 @@ export declare const counterparties: {
|
|
|
7
7
|
destinations: {
|
|
8
8
|
getAll: ({ wallet_id, counterparty_account_id, ...params }: API.Counterparties.Destination.List.Request) => Promise<API.Counterparties.Destination.List.Response>;
|
|
9
9
|
getById: ({ wallet_id, counterparty_account_id, counterparty_destination_id, }: API.Counterparties.Destination.Detail.Request) => Promise<API.Counterparties.Destination.Detail.DestinationDetailItem>;
|
|
10
|
-
create: ({ wallet_id, counterparty_account_id, ...data }: API.Counterparties.Destination.Create.Request) => Promise<API.Counterparties.Destination.
|
|
10
|
+
create: ({ wallet_id, counterparty_account_id, ...data }: API.Counterparties.Destination.Create.Request) => Promise<API.Counterparties.Destination.Detail.DestinationDetailItem>;
|
|
11
11
|
update: ({ wallet_id, counterparty_account_id, counterparty_destination_id, ...data }: API.Counterparties.Destination.Update.Request) => Promise<API.Counterparties.Destination.List.DestinationListItemCommonFields>;
|
|
12
12
|
};
|
|
13
13
|
};
|
package/dist/api/types.d.ts
CHANGED
|
@@ -454,14 +454,7 @@ export declare namespace API {
|
|
|
454
454
|
external_banking_data?: API.Counterparties.Destination.Detail.DestinationDetailItemExternalBankingData;
|
|
455
455
|
external_crypto_data?: API.Counterparties.Destination.Detail.DestinationDetailItemExternalCryptoData;
|
|
456
456
|
}
|
|
457
|
-
|
|
458
|
-
id: string;
|
|
459
|
-
nickname: string;
|
|
460
|
-
created_at: string;
|
|
461
|
-
type: CounterpartyDestinationType;
|
|
462
|
-
external_banking_data?: API.Counterparties.Destination.Detail.DestinationDetailItemExternalBankingData;
|
|
463
|
-
external_crypto_data?: API.Counterparties.Destination.Detail.DestinationDetailItemExternalCryptoData;
|
|
464
|
-
}
|
|
457
|
+
type Response = API.Counterparties.Destination.Detail.DestinationDetailItem;
|
|
465
458
|
}
|
|
466
459
|
namespace Update {
|
|
467
460
|
interface Request {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const convertPhoneToSupabaseFormat: (phone: string) => string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertPhoneToSupabaseFormat = void 0;
|
|
4
|
+
const convertPhoneToSupabaseFormat = (phone) => phone.replace(/\D/g, '');
|
|
5
|
+
exports.convertPhoneToSupabaseFormat = convertPhoneToSupabaseFormat;
|
package/package.json
CHANGED
package/src/api/auth.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { API } from './types';
|
|
2
2
|
|
|
3
3
|
import { apiClientV2 } from '../utils/apiClientFactory';
|
|
4
|
+
import { convertPhoneToSupabaseFormat } from '../utils/converters';
|
|
4
5
|
|
|
5
6
|
export const telegramSignInPath = '/auth/sign-in/telegram';
|
|
6
7
|
export const telegramSignUpPath = '/auth/sign-up/telegram';
|
|
@@ -15,7 +16,7 @@ export const auth = {
|
|
|
15
16
|
}),
|
|
16
17
|
phone: (phone: string, token: string) =>
|
|
17
18
|
apiClientV2.postRequest<API.Auth.VerifyOtp.Response>('/auth/verify/phone/otp', {
|
|
18
|
-
data: { phone, token, type: 'sms' },
|
|
19
|
+
data: { phone: convertPhoneToSupabaseFormat(phone), token, type: 'sms' },
|
|
19
20
|
}),
|
|
20
21
|
},
|
|
21
22
|
},
|
|
@@ -23,8 +24,10 @@ export const auth = {
|
|
|
23
24
|
omni: {
|
|
24
25
|
email: (data: API.Auth.SignIn.Email.OTP.Request) =>
|
|
25
26
|
apiClientV2.postRequest('/auth/sign-in/omni/email/otp', { data }),
|
|
26
|
-
phone: (data: API.Auth.SignIn.Phone.OTP.Request) =>
|
|
27
|
-
apiClientV2.postRequest('/auth/sign-in/omni/phone/otp', {
|
|
27
|
+
phone: ({ phone, ...data }: API.Auth.SignIn.Phone.OTP.Request) =>
|
|
28
|
+
apiClientV2.postRequest('/auth/sign-in/omni/phone/otp', {
|
|
29
|
+
data: { phone: convertPhoneToSupabaseFormat(phone), ...data },
|
|
30
|
+
}),
|
|
28
31
|
},
|
|
29
32
|
telegram: (data: API.Auth.Telegram.Signin) =>
|
|
30
33
|
apiClientV2.postRequest<API.Auth.Tokens>(telegramSignInPath, { data }),
|
package/src/api/types.ts
CHANGED
|
@@ -544,14 +544,7 @@ export namespace API {
|
|
|
544
544
|
external_crypto_data?: API.Counterparties.Destination.Detail.DestinationDetailItemExternalCryptoData;
|
|
545
545
|
}
|
|
546
546
|
|
|
547
|
-
export
|
|
548
|
-
id: string;
|
|
549
|
-
nickname: string;
|
|
550
|
-
created_at: string;
|
|
551
|
-
type: CounterpartyDestinationType;
|
|
552
|
-
external_banking_data?: API.Counterparties.Destination.Detail.DestinationDetailItemExternalBankingData;
|
|
553
|
-
external_crypto_data?: API.Counterparties.Destination.Detail.DestinationDetailItemExternalCryptoData;
|
|
554
|
-
}
|
|
547
|
+
export type Response = API.Counterparties.Destination.Detail.DestinationDetailItem;
|
|
555
548
|
}
|
|
556
549
|
|
|
557
550
|
export namespace Update {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const convertPhoneToSupabaseFormat = (phone: string) => phone.replace(/\D/g, '');
|