ggez-banking-sdk 0.1.174 → 0.1.175
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DeviceType, EntityStatus, EntityVerificationStatus, Gender, DocumentType, PhoneNumberTypes, SecurityAuthenticationTypes, SecurityLoginType, Titles, } from "../../../constants";
|
|
2
|
-
import { ClientHelper, DateTimeHelper } from "../../../helper";
|
|
2
|
+
import { ClientHelper, DateTimeHelper, UserHelper } from "../../../helper";
|
|
3
3
|
import { getBase64 } from "../../../utils";
|
|
4
4
|
export { FillUserData, FillCreateUserData, FillCreateUserWithGoogleData };
|
|
5
5
|
const FillUserData = (key, value) => {
|
|
@@ -131,7 +131,11 @@ const FillCreateUserData = (data) => {
|
|
|
131
131
|
},
|
|
132
132
|
},
|
|
133
133
|
],
|
|
134
|
-
custom_field:
|
|
134
|
+
custom_field: UserHelper.FillPromotionData({
|
|
135
|
+
giftData: data.giftData,
|
|
136
|
+
referralCode: data.referralCode,
|
|
137
|
+
referralCodeType: data.referralCodeType,
|
|
138
|
+
}),
|
|
135
139
|
};
|
|
136
140
|
if (data.isMobileConfirmed && data.mobileAuthenticationCode) {
|
|
137
141
|
userData.authentication.push({
|
|
@@ -158,21 +162,21 @@ const FillCreateUserWithGoogleData = async (data) => {
|
|
|
158
162
|
type: SecurityLoginType.Google,
|
|
159
163
|
verification_status: EntityVerificationStatus.Verified,
|
|
160
164
|
};
|
|
161
|
-
const documentData = {
|
|
162
|
-
info: {
|
|
163
|
-
type: DocumentType.Profile_Picture,
|
|
164
|
-
subject: "Profile Picture",
|
|
165
|
-
},
|
|
166
|
-
attachment: [
|
|
167
|
-
{
|
|
168
|
-
file_name: data.loginId,
|
|
169
|
-
file_extension: ".jpg",
|
|
170
|
-
content: base64,
|
|
171
|
-
},
|
|
172
|
-
],
|
|
173
|
-
};
|
|
174
165
|
userData.external_auth = [externalAuth];
|
|
175
166
|
if (base64) {
|
|
167
|
+
const documentData = {
|
|
168
|
+
info: {
|
|
169
|
+
type: DocumentType.Profile_Picture,
|
|
170
|
+
subject: "Profile Picture",
|
|
171
|
+
},
|
|
172
|
+
attachment: [
|
|
173
|
+
{
|
|
174
|
+
file_name: data.loginId,
|
|
175
|
+
file_extension: ".jpg",
|
|
176
|
+
content: base64,
|
|
177
|
+
},
|
|
178
|
+
],
|
|
179
|
+
};
|
|
176
180
|
userData.documents = [documentData];
|
|
177
181
|
}
|
|
178
182
|
return userData;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TModifyListByEntity, TModifyByDocumentData, TSortByID, TSortByIsPrimary, TSortByVerificationStatus, TSortEntity, TModifyOrganizationByDocumentData, TModifyProfilePicture, TModifySecurityResetUserSecurity, VerifySecurityData, UserData } from "../types";
|
|
1
|
+
import type { TModifyListByEntity, TModifyByDocumentData, TSortByID, TSortByIsPrimary, TSortByVerificationStatus, TSortEntity, TModifyOrganizationByDocumentData, TModifyProfilePicture, TModifySecurityResetUserSecurity, VerifySecurityData, UserData, ICreateUserData } from "../types";
|
|
2
2
|
declare class UserHelper {
|
|
3
3
|
static ModifyListByEntity: TModifyListByEntity;
|
|
4
4
|
static ModifyByDocumentData: TModifyByDocumentData;
|
|
@@ -10,5 +10,14 @@ declare class UserHelper {
|
|
|
10
10
|
static SortByVerificationStatus: TSortByVerificationStatus;
|
|
11
11
|
static SortById: TSortByID;
|
|
12
12
|
static ExtractDeviceData: (data: UserData | VerifySecurityData) => import("../types").Device;
|
|
13
|
+
static FillPromotionData: (data: Pick<ICreateUserData, "giftData" | "referralCode" | "referralCodeType">) => {
|
|
14
|
+
promotion_data: {
|
|
15
|
+
gift_data?: ICreateUserData["giftData"];
|
|
16
|
+
referral_data?: {
|
|
17
|
+
code: ICreateUserData["referralCode"];
|
|
18
|
+
type: ICreateUserData["referralCodeType"];
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
};
|
|
13
22
|
}
|
|
14
23
|
export { UserHelper };
|
|
@@ -132,5 +132,21 @@ class UserHelper {
|
|
|
132
132
|
}
|
|
133
133
|
return data.device;
|
|
134
134
|
};
|
|
135
|
+
static FillPromotionData = (data) => {
|
|
136
|
+
if (!data ||
|
|
137
|
+
(!data.giftData && !data.referralCode && !data.referralCodeType))
|
|
138
|
+
return;
|
|
139
|
+
const customField = { promotion_data: {} };
|
|
140
|
+
if (data.giftData) {
|
|
141
|
+
customField.promotion_data.gift_data = data.giftData;
|
|
142
|
+
}
|
|
143
|
+
if (data.referralCode && data.referralCodeType) {
|
|
144
|
+
customField.promotion_data.referral_data = {
|
|
145
|
+
code: data.referralCode,
|
|
146
|
+
type: data.referralCodeType,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
return customField;
|
|
150
|
+
};
|
|
135
151
|
}
|
|
136
152
|
export { UserHelper };
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type DeepPartial<T> = {
|
|
3
|
-
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
4
|
-
};
|
|
1
|
+
import { GiftData } from "../../../banking";
|
|
5
2
|
interface IGetUserData {
|
|
6
3
|
id: number;
|
|
7
4
|
token?: string;
|
|
@@ -28,7 +25,7 @@ interface ICreateUserData {
|
|
|
28
25
|
referralCodeType: string;
|
|
29
26
|
mobileNumberCountry: string;
|
|
30
27
|
preferredLanguageCode: string;
|
|
31
|
-
|
|
28
|
+
giftData: GiftData;
|
|
32
29
|
}
|
|
33
30
|
interface ICreateUserWithGoogleData extends ICreateUserData {
|
|
34
31
|
loginId: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ggez-banking-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.175",
|
|
4
4
|
"description": "A Node.js package to handle GGEZ Banking API endpoints, Simplify the process of managing CRUD operations with this efficient and easy-to-use package.",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|