ggez-banking-sdk 0.1.115 → 0.1.117

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 (45) hide show
  1. package/dist/helper/userHelper.d.ts +3 -13
  2. package/dist/helper/userHelper.js +2 -336
  3. package/dist/types/api/data/order.d.ts +1 -1
  4. package/dist/types/banking/account/accountdata.d.ts +13 -13
  5. package/dist/types/banking/account/info.d.ts +1 -1
  6. package/dist/types/banking/account/options/fulfilmentinfo.d.ts +1 -1
  7. package/dist/types/banking/account/options/options.d.ts +1 -1
  8. package/dist/types/banking/blockchain/info.d.ts +1 -1
  9. package/dist/types/banking/common/baseresult.d.ts +2 -2
  10. package/dist/types/banking/common/currencyclouddata.d.ts +4 -4
  11. package/dist/types/banking/common/history.d.ts +1 -1
  12. package/dist/types/banking/entities/address.d.ts +2 -2
  13. package/dist/types/banking/entities/bankaccount.d.ts +3 -3
  14. package/dist/types/banking/entities/creditcard.d.ts +2 -2
  15. package/dist/types/banking/entities/cryptoaddress.d.ts +1 -1
  16. package/dist/types/banking/entities/customField/promotionData/giftData.d.ts +1 -1
  17. package/dist/types/banking/entities/device.d.ts +4 -4
  18. package/dist/types/banking/entities/devicehistory.d.ts +1 -1
  19. package/dist/types/banking/entities/email.d.ts +2 -2
  20. package/dist/types/banking/entities/externalauthentication.d.ts +1 -1
  21. package/dist/types/banking/entities/identification.d.ts +4 -3
  22. package/dist/types/banking/entities/json/device/deviceextendedinfo.d.ts +2 -2
  23. package/dist/types/banking/entities/phone.d.ts +2 -2
  24. package/dist/types/banking/entities/relationship.d.ts +2 -2
  25. package/dist/types/banking/entities/socialmedia.d.ts +1 -1
  26. package/dist/types/banking/group/info.d.ts +1 -1
  27. package/dist/types/banking/oauth/tokenData.d.ts +1 -1
  28. package/dist/types/banking/order/fulfilment/pinCodeFulfilment.d.ts +1 -1
  29. package/dist/types/banking/order/info.d.ts +1 -1
  30. package/dist/types/banking/order/paymentMethod.d.ts +2 -2
  31. package/dist/types/banking/organization/info.d.ts +1 -1
  32. package/dist/types/banking/organization/organizationdata.d.ts +9 -9
  33. package/dist/types/banking/ticket/info.d.ts +1 -1
  34. package/dist/types/banking/transaction/info.d.ts +3 -3
  35. package/dist/types/banking/user/confirmUserSecurityInfo.d.ts +2 -2
  36. package/dist/types/banking/user/documentinfo.d.ts +1 -1
  37. package/dist/types/banking/user/info.d.ts +1 -1
  38. package/dist/types/banking/user/personalinfo.d.ts +1 -1
  39. package/dist/types/banking/user/resetUserSecurityInfo.d.ts +2 -2
  40. package/dist/types/banking/user/userdata.d.ts +2 -2
  41. package/dist/types/banking/user/validateSecurityData.d.ts +1 -1
  42. package/dist/types/banking/user/validateUserSecurityInfo.d.ts +2 -2
  43. package/dist/types/banking/user/verifyUserSecurityInfo.d.ts +2 -2
  44. package/dist/types/helper/userHelper.d.ts +3 -3
  45. package/package.json +1 -1
@@ -1,17 +1,7 @@
1
- import { TModifyByEntity, TModifyByDocumentData, TSortByID, TSortByIsPrimary, TSortByVerificationStatus, TSortEntity } from "..";
2
- declare const OldUserHelper: (userInfo: any) => {
3
- checkResponse: () => {
4
- checkUserResponseAuth: (response: any, showMessageSuccess: boolean, funcName: string) => any;
5
- checkGlobalResponse: (key: string, response: any, funcName: string, keyAction?: string) => {
6
- newUserInfo: any;
7
- };
8
- errorHandler: (error: any, funcName: string, response?: string) => never;
9
- };
10
- };
11
- export declare function sortUserInfo(list?: any[] | null): any;
12
- export default OldUserHelper;
1
+ import { TModifyListByEntity, TModifyByDocumentData, TSortByID, TSortByIsPrimary, TSortByVerificationStatus, TSortEntity } from "..";
13
2
  declare class UserHelper {
14
- static ModifyByEntity: TModifyByEntity;
3
+ static ModifyListByEntity: TModifyListByEntity;
4
+ static ModifyProfilePicture: () => {};
15
5
  static ModifyByDocumentData: TModifyByDocumentData;
16
6
  static SortEntity: TSortEntity;
17
7
  static SortByIsPrimary: TSortByIsPrimary;
@@ -1,342 +1,7 @@
1
1
  import { EntityVerificationStatus } from "../constants/enum";
2
- import { SystemResponses } from "../constants";
3
- const OldUserHelper = (userInfo) => {
4
- // error Handler
5
- // action type
6
- const newUserInfo = () => {
7
- const error = null;
8
- const addInfo = (key, data) => {
9
- if (Array.isArray(userInfo[`${key}`])) {
10
- const newData = [...userInfo[`${key}`], data[0]];
11
- const newUserInfo = { ...userInfo, [key]: sortUserInfo(newData) };
12
- return { newUserInfo: newUserInfo };
13
- }
14
- else {
15
- const newUserInfo = { ...userInfo, [key]: data };
16
- return { newUserInfo: newUserInfo };
17
- }
18
- };
19
- const updateInfo = (key, data) => {
20
- const updatedData = Array.isArray(userInfo[`${key}`]) &&
21
- userInfo[`${key}`].map((el, i) => {
22
- if (el.id == data[0].id) {
23
- return data[0];
24
- }
25
- else {
26
- return el;
27
- }
28
- });
29
- const newUserInfo = { ...userInfo, [key]: sortUserInfo(updatedData) };
30
- return { newUserInfo: newUserInfo };
31
- };
32
- const removeInfo = (key, data) => {
33
- let newUserInfo;
34
- if (Array.isArray(userInfo[`${key}`]) && data != null) {
35
- const removeData = Array.isArray(userInfo[`${key}`]) &&
36
- userInfo[`${key}`].filter((el, i) => {
37
- return el.id !== data[0].id;
38
- });
39
- newUserInfo = { ...userInfo, [key]: sortUserInfo(removeData) };
40
- }
41
- else if (data == null) {
42
- const userInfoObj = { ...userInfo };
43
- userInfoObj[key] = data;
44
- newUserInfo = userInfoObj;
45
- }
46
- return { newUserInfo: newUserInfo };
47
- };
48
- const updatePrimaryInfo = (key, data) => {
49
- const updateData = Array.isArray(userInfo[`${key}`]) &&
50
- userInfo[`${key}`].map((el, i) => {
51
- if (el.id == data[0].id) {
52
- return { ...el, is_primary: 1 };
53
- }
54
- else if (el.is_primary == 1) {
55
- return { ...el, is_primary: 0 };
56
- }
57
- else {
58
- return el;
59
- }
60
- });
61
- const newUserInfo = { ...userInfo, [key]: sortUserInfo(updateData) };
62
- return { newUserInfo: newUserInfo };
63
- };
64
- const updateDocumentInfo = (key, data) => {
65
- const updateData = Array.isArray(userInfo[`${key}`]) &&
66
- userInfo[`${key}`].map((el, i) => {
67
- if (el.id == data?.info?.entity_id) {
68
- return {
69
- ...el,
70
- verification_status: EntityVerificationStatus.Pending,
71
- };
72
- }
73
- else {
74
- return el;
75
- }
76
- });
77
- const newUserInfo = { ...userInfo, [key]: sortUserInfo(updateData) };
78
- return { newUserInfo: newUserInfo, error: error };
79
- };
80
- const updateObjectInfo = (key, data) => {
81
- const updateData = { ...userInfo[`${key}`], ...data };
82
- const newUserInfo = { ...userInfo, [key]: updateData };
83
- return { newUserInfo: newUserInfo };
84
- };
85
- const updateProfilePicture = (key, res) => {
86
- const data = res.data.attachment[0].file_url;
87
- const updateData = { ...userInfo[`${key}`], ["picture"]: data };
88
- const newUserInfo = { ...userInfo, [`${key}`]: updateData };
89
- return { newUserInfo: newUserInfo };
90
- };
91
- const getUserInfo = (data) => {
92
- const newUserInfo = { ...userInfo, data };
93
- return { newUserInfo: newUserInfo };
94
- };
95
- const resetSecurity = (key, keyAction) => {
96
- let security = null;
97
- if (keyAction == "resetQuestions") {
98
- security = {
99
- ...userInfo[`${key}`],
100
- ["secret_answer_1"]: "____",
101
- ["secret_answer_2"]: "____",
102
- };
103
- }
104
- else if (keyAction == "resetSecurityCode") {
105
- security = {
106
- ...userInfo[`${key}`],
107
- ["security_code"]: "____",
108
- };
109
- }
110
- const newUserInfo = { ...userInfo, [`${key}`]: security };
111
- return { newUserInfo: newUserInfo };
112
- };
113
- const addOrganizationInfo = (key, data) => {
114
- if (Array.isArray(userInfo[`${key}`])) {
115
- const newData = [...userInfo[`${key}`], data];
116
- const newUserInfo = { ...userInfo, [key]: sortUserInfo(newData) };
117
- return { newUserInfo: newUserInfo };
118
- }
119
- else {
120
- const newUserInfo = { ...userInfo, [key]: [data] };
121
- return { newUserInfo: newUserInfo };
122
- }
123
- };
124
- const updateOrganizationInfo = (key, data) => {
125
- const updatedData = Array.isArray(userInfo[`${key}`]) &&
126
- userInfo[`${key}`].map((el, i) => {
127
- if (el.info.id == data.info.id) {
128
- return data;
129
- }
130
- else {
131
- return el;
132
- }
133
- });
134
- const newUserInfo = { ...userInfo, [key]: sortUserInfo(updatedData) };
135
- return { newUserInfo: newUserInfo };
136
- };
137
- const removeOrganizationInfo = (key, data) => {
138
- let newUserInfo;
139
- if (Array.isArray(userInfo[`${key}`]) && data != null) {
140
- let removeData = Array.isArray(userInfo[`${key}`]) &&
141
- userInfo[`${key}`].filter((el, i) => {
142
- return el.info.id !== data.info.id;
143
- });
144
- if (removeData.length <= 0) {
145
- removeData = null;
146
- }
147
- newUserInfo = { ...userInfo, [key]: sortUserInfo(removeData) };
148
- }
149
- else if (data == null) {
150
- const userInfoObj = { ...userInfo };
151
- userInfoObj[key] = data;
152
- newUserInfo = userInfoObj;
153
- }
154
- return { newUserInfo: newUserInfo };
155
- };
156
- const createDocumentOrganization = (key, data) => {
157
- const updateData = Array.isArray(userInfo[`${key}`]) &&
158
- userInfo[`${key}`].map((el, i) => {
159
- if (el.info.id == data?.info?.entity_id) {
160
- const newInfo = {
161
- ...el.info,
162
- verification_status: EntityVerificationStatus.Pending,
163
- };
164
- return { ...el, ["info"]: newInfo };
165
- }
166
- else {
167
- return el;
168
- }
169
- });
170
- const newUserInfo = { ...userInfo, [key]: updateData };
171
- return { newUserInfo: newUserInfo };
172
- };
173
- return {
174
- addInfo,
175
- removeInfo,
176
- updateInfo,
177
- updatePrimaryInfo,
178
- updateDocumentInfo,
179
- updateObjectInfo,
180
- updateProfilePicture,
181
- getUserInfo,
182
- resetSecurity,
183
- addOrganizationInfo,
184
- updateOrganizationInfo,
185
- removeOrganizationInfo,
186
- createDocumentOrganization,
187
- };
188
- };
189
- const { addInfo, removeInfo, updateInfo, updatePrimaryInfo, updateDocumentInfo, updateObjectInfo, updateProfilePicture, getUserInfo, resetSecurity, addOrganizationInfo, updateOrganizationInfo, removeOrganizationInfo, createDocumentOrganization, } = newUserInfo();
190
- // check response
191
- const checkResponse = () => {
192
- const errorHandler = (error, funcName, response) => {
193
- const errorObj = {
194
- status: "failed",
195
- message: error,
196
- funcName: funcName,
197
- response: response,
198
- };
199
- throw errorObj;
200
- };
201
- const actionTypeHandler = (key, response, keyAction) => {
202
- const data = response?.data[`${key}`];
203
- if (keyAction == "create") {
204
- return addInfo(`${key}`, data);
205
- }
206
- else if (keyAction == "update") {
207
- return updateInfo(`${key}`, data);
208
- }
209
- else if (keyAction == "delete") {
210
- return removeInfo(`${key}`, data);
211
- }
212
- else if (keyAction == "updatePrimary") {
213
- return updatePrimaryInfo(`${key}`, data);
214
- }
215
- else if (keyAction == "confirm") {
216
- const data = response?.data?.verify_data[`${key}`];
217
- return updateInfo(`${key}`, [data]);
218
- }
219
- else if (keyAction == "createDocument") {
220
- return updateDocumentInfo(`${key}`, response?.data);
221
- }
222
- else if (keyAction == "updateObjectInfo") {
223
- return updateObjectInfo(`${key}`, data);
224
- }
225
- else if (keyAction == "updateProfilePicture") {
226
- return updateProfilePicture(`${key}`, response);
227
- }
228
- else if (keyAction == "userInfo") {
229
- return getUserInfo(response?.data);
230
- }
231
- else if (keyAction == "resetQuestions" ||
232
- keyAction == "resetSecurityCode") {
233
- return resetSecurity(`${key}`, keyAction);
234
- }
235
- else if (keyAction == "createOrganization") {
236
- return addOrganizationInfo(`${key}`, response?.data);
237
- }
238
- else if (keyAction == "updateOrganization") {
239
- return updateOrganizationInfo(`${key}`, response?.data);
240
- }
241
- else if (keyAction == "deleteOrganization") {
242
- return removeOrganizationInfo(`${key}`, response?.data);
243
- }
244
- else if (keyAction == "createDocumentOrganization") {
245
- return createDocumentOrganization(`${key}`, response?.data);
246
- }
247
- else {
248
- return { newUserInfo: null };
249
- }
250
- };
251
- const checkUserResponseAuth = (response, showMessageSuccess, funcName) => {
252
- const check = response?.data?.result?.code;
253
- if (check != SystemResponses.Approved &&
254
- check != SystemResponses.Create_User_Completed_Partially) {
255
- errorHandler(response?.data?.result?.message, funcName, response);
256
- }
257
- else if (!showMessageSuccess) {
258
- const value = response.data;
259
- value.email = sortUserInfo(value.email);
260
- value.phone = sortUserInfo(value.phone);
261
- value.identification = sortUserInfo(value.identification);
262
- value.addresses = sortUserInfo(value.addresses);
263
- value.bank_account = sortUserInfo(value.bank_account);
264
- return value;
265
- }
266
- else {
267
- return {
268
- action: "Success",
269
- message: "User Created Successfully",
270
- };
271
- }
272
- };
273
- const checkGlobalResponse = (key, response, funcName, keyAction) => {
274
- const check = response?.data?.result?.code;
275
- if (!check && funcName.includes("login")) {
276
- return { newUserInfo: null };
277
- }
278
- else if (check &&
279
- (check == SystemResponses.Approved ||
280
- check == SystemResponses.Create_User_Completed_Partially)) {
281
- return actionTypeHandler(key, response, keyAction);
282
- }
283
- else {
284
- return errorHandler(response?.data?.result?.message, funcName, response);
285
- }
286
- };
287
- return {
288
- checkUserResponseAuth,
289
- checkGlobalResponse,
290
- errorHandler,
291
- };
292
- };
293
- return {
294
- checkResponse,
295
- };
296
- };
297
- export function sortUserInfo(list) {
298
- try {
299
- const verificationStatusOrder = {
300
- "1": 0, // Verified
301
- "2": 1, // Pending
302
- "3": 2, // Failed
303
- "0": 3, // Not Verified
304
- "-1": 4, // Undefined
305
- };
306
- return list
307
- ? list?.sort((a, b) => {
308
- // First, compare by 'is_primary'
309
- const isPrimaryComparison = a?.is_primary != undefined && b?.is_primary != undefined
310
- ? b?.is_primary - a?.is_primary
311
- : 0;
312
- // If 'is_primary' values are equal, compare by 'verification_status'
313
- if (isPrimaryComparison === 0) {
314
- const verificationStatusComparison = verificationStatusOrder[a?.verification_status] -
315
- verificationStatusOrder[b?.verification_status];
316
- // If 'is_primary' values are equal, and 'verification_status' values are equal, compare by id
317
- if (verificationStatusComparison == 0) {
318
- return b?.id - a?.id;
319
- }
320
- return verificationStatusComparison;
321
- }
322
- return isPrimaryComparison;
323
- })
324
- : list;
325
- }
326
- catch (error) {
327
- const errorObj = {
328
- status: "failed",
329
- message: error,
330
- funcName: "sortUserInfo",
331
- response: null,
332
- };
333
- return errorObj;
334
- }
335
- }
336
- export default OldUserHelper;
337
2
  class UserHelper {
338
3
  // #region "Modify"
339
- static ModifyByEntity = (entityList, entity) => {
4
+ static ModifyListByEntity = (entityList, entity) => {
340
5
  const modifiedList = entityList.map((e) => {
341
6
  if (e.id == entity.id) {
342
7
  return { ...e, ...entity };
@@ -349,6 +14,7 @@ class UserHelper {
349
14
  const sortedList = this.SortEntity(modifiedList);
350
15
  return sortedList;
351
16
  };
17
+ static ModifyProfilePicture;
352
18
  static ModifyByDocumentData = (entityList, documentData) => {
353
19
  const modifiedList = entityList.map((e) => {
354
20
  if (e.id == documentData.info.entity_id) {
@@ -4,7 +4,7 @@ interface ICreateOrderData {
4
4
  variantId: VariantType;
5
5
  userNotes: string;
6
6
  accountId: number;
7
- paymentMethod: PaymentMethodType | null;
7
+ paymentMethod: PaymentMethodType;
8
8
  validate: ValidateType;
9
9
  }
10
10
  export type { ICreateOrderData };
@@ -1,19 +1,19 @@
1
1
  import { AccountStatementData, BankAccount, ChainData, CreditLimit, AccountFulfilment, AccountInfo, Limits, Options, Provision, Tokenization, Archive, BaseResult, GeoCoordinates, SimplifiedAccessRule } from "..";
2
2
  type AccountData = BaseResult & {
3
3
  info: AccountInfo;
4
- limits: Limits | null;
5
- archive: Archive | null;
4
+ limits: Limits;
5
+ archive: Archive;
6
6
  custom_field: Record<string, any>;
7
- geo_coordinates: GeoCoordinates | null;
8
- options: Options | null;
9
- bank_account: BankAccount[] | null;
10
- history: History[] | null;
11
- fulfilment: AccountFulfilment[] | null;
12
- access_rule: SimplifiedAccessRule[] | null;
13
- provision: Provision | null;
14
- credit_limit: CreditLimit | null;
15
- tokenization: Tokenization[] | null;
16
- chain_data: ChainData | null;
17
- statement: AccountStatementData[] | null;
7
+ geo_coordinates: GeoCoordinates;
8
+ options: Options;
9
+ bank_account: BankAccount[];
10
+ history: History[];
11
+ fulfilment: AccountFulfilment[];
12
+ access_rule: SimplifiedAccessRule[];
13
+ provision: Provision;
14
+ credit_limit: CreditLimit;
15
+ tokenization: Tokenization[];
16
+ chain_data: ChainData;
17
+ statement: AccountStatementData[];
18
18
  };
19
19
  export type { AccountData };
@@ -24,7 +24,7 @@ type AccountInfo = {
24
24
  original_source_id: string;
25
25
  server_date: string;
26
26
  date_utc: string;
27
- client_date: string | null;
27
+ client_date: string;
28
28
  source_time_zone: string;
29
29
  security: Security;
30
30
  is_multi_currency: boolean;
@@ -8,7 +8,7 @@ type FulfilmentInfo = {
8
8
  extra_identifier: string;
9
9
  fourth_line_embossing: string;
10
10
  status: number;
11
- status_date: string | null;
11
+ status_date: string;
12
12
  batch_id: number;
13
13
  name_on_card_first: string;
14
14
  name_on_card_last: string;
@@ -1,6 +1,6 @@
1
1
  import { OptionsFulfilment } from "..";
2
2
  type Options = {
3
3
  is_visible: number;
4
- fulfilment: OptionsFulfilment | null;
4
+ fulfilment: OptionsFulfilment;
5
5
  };
6
6
  export type { Options };
@@ -9,7 +9,7 @@ type BlockchainInfo = {
9
9
  memo: string;
10
10
  server_date: string;
11
11
  date_utc: string;
12
- client_date: Date | null;
12
+ client_date: Date;
13
13
  source_time_zone: string;
14
14
  source_id: string;
15
15
  };
@@ -1,9 +1,9 @@
1
1
  import type { Authentication, LastActivity, Notes, Result } from "..";
2
2
  type BaseResult = {
3
3
  result: Result;
4
- notes: Notes | null;
4
+ notes: Notes;
5
5
  last_activity: LastActivity;
6
- authentication: Authentication[] | null;
6
+ authentication: Authentication[];
7
7
  validate: string;
8
8
  function_code: number;
9
9
  time_zone: string;
@@ -5,9 +5,9 @@ type CurrencyCloudData = {
5
5
  funding_account_data: CurrencyCloudFundingAccountData[];
6
6
  };
7
7
  type CurrencyCloudAccountData = {
8
- phone_trading: boolean | null;
9
- online_trading: boolean | null;
10
- api_trading: boolean | null;
8
+ phone_trading: boolean;
9
+ online_trading: boolean;
10
+ api_trading: boolean;
11
11
  short_reference: string;
12
12
  identification_value: string;
13
13
  identification_type: string;
@@ -25,7 +25,7 @@ type CurrencyCloudAccountData = {
25
25
  account_name: string;
26
26
  legal_entity_type: string;
27
27
  id: string;
28
- process_third_party_funds: boolean | null;
28
+ process_third_party_funds: boolean;
29
29
  settlement_type: string;
30
30
  };
31
31
  type CurrencyCloudContactData = {
@@ -14,6 +14,6 @@ type History = {
14
14
  original_source_id: string;
15
15
  server_date: string;
16
16
  date_utc: string;
17
- client_date: string | null;
17
+ client_date: string;
18
18
  };
19
19
  export type { History };
@@ -17,9 +17,9 @@ type Address = {
17
17
  original_source_id: string;
18
18
  server_date: string;
19
19
  date_utc: string;
20
- client_date: string | null;
20
+ client_date: string;
21
21
  update_date_utc: string;
22
- custom_field: Record<string, unknown> | null;
22
+ custom_field: Record<string, unknown>;
23
23
  ticket: TicketData[];
24
24
  };
25
25
  export type { Address };
@@ -26,16 +26,16 @@ type BankAccount = {
26
26
  verification_status: number;
27
27
  city_town: string;
28
28
  postal_zip_code: string;
29
- extended_data: BankExtendedData | null;
29
+ extended_data: BankExtendedData;
30
30
  sort_code: string;
31
31
  description: string;
32
32
  original_source_id: string;
33
33
  server_date: string;
34
34
  date_utc: string;
35
- client_date: string | null;
35
+ client_date: string;
36
36
  update_date_utc: string;
37
37
  service_provider: number;
38
- custom_field: Record<string, unknown> | null;
38
+ custom_field: Record<string, unknown>;
39
39
  ticket: TicketData[];
40
40
  wire_transfer_type: number;
41
41
  notes: string;
@@ -17,9 +17,9 @@ type CreditCard = {
17
17
  original_source_id: string;
18
18
  server_date: string;
19
19
  date_utc: string;
20
- client_date: string | null;
20
+ client_date: string;
21
21
  update_date_utc: string;
22
- custom_field: Record<string, any> | null;
22
+ custom_field: Record<string, any>;
23
23
  ticket: TicketData[];
24
24
  };
25
25
  export type { CreditCard };
@@ -12,7 +12,7 @@ type CryptoAddress = {
12
12
  original_source_id: string;
13
13
  server_date: string;
14
14
  date_utc: string;
15
- client_date: string | null;
15
+ client_date: string;
16
16
  update_date_utc: string;
17
17
  };
18
18
  export type { CryptoAddress };
@@ -5,7 +5,7 @@ type GiftData = {
5
5
  type: number;
6
6
  order_id: number;
7
7
  order_status: number;
8
- claimed_date: string | null;
8
+ claimed_date: string;
9
9
  claimed_prize_amount: number;
10
10
  claimed_prize_asset: string;
11
11
  };
@@ -6,19 +6,19 @@ type Device = {
6
6
  os: string;
7
7
  unique_id: string;
8
8
  installation_id: string;
9
- extended_info: DeviceExtendedInfo | null;
9
+ extended_info: DeviceExtendedInfo;
10
10
  status: number;
11
11
  verification_status: number;
12
- is_online: boolean | null;
12
+ is_online: boolean;
13
13
  encryption_key: string;
14
14
  application_version: string;
15
15
  serial_number: string;
16
16
  source_ip_address: string;
17
- geo_coordinates: GeoCoordinates | null;
17
+ geo_coordinates: GeoCoordinates;
18
18
  original_source_id: string;
19
19
  server_date: string;
20
20
  date_utc: string;
21
- client_date: string | null;
21
+ client_date: string;
22
22
  update_date_utc: string;
23
23
  client_time_zone: string;
24
24
  };
@@ -12,7 +12,7 @@ type DeviceHistory = {
12
12
  geo_coordinates: GeoCoordinates;
13
13
  server_date: string;
14
14
  date_utc: string;
15
- client_date: string | null;
15
+ client_date: string;
16
16
  update_date_utc: string;
17
17
  client_time_zone: string;
18
18
  };
@@ -8,8 +8,8 @@ type Email = {
8
8
  original_source_id: string;
9
9
  server_date: string;
10
10
  date_utc: string;
11
- client_date: string | null;
11
+ client_date: string;
12
12
  update_date_utc: string;
13
- custom_field: Record<string, unknown> | null;
13
+ custom_field: Record<string, unknown>;
14
14
  };
15
15
  export type { Email };
@@ -8,7 +8,7 @@ type ExternalAuthentication = {
8
8
  original_source_id: string;
9
9
  server_date: string;
10
10
  date_utc: string;
11
- client_date: string | null;
11
+ client_date: string;
12
12
  update_date_utc: string;
13
13
  custom_field: Record<string, unknown>;
14
14
  };
@@ -3,6 +3,7 @@ import { TicketData } from "../ticket";
3
3
  type Identification = {
4
4
  result: Result;
5
5
  id: number;
6
+ is_primary: undefined;
6
7
  type: number;
7
8
  country_of_issue: string;
8
9
  country_of_residence: string;
@@ -14,10 +15,10 @@ type Identification = {
14
15
  original_source_id: string;
15
16
  server_date: string;
16
17
  date_utc: string;
17
- client_date: string | null;
18
+ client_date: string;
18
19
  update_date_utc: string;
19
- extra_data: IdentificationExtraData | null;
20
- custom_field: Record<string, unknown> | null;
20
+ extra_data: IdentificationExtraData;
21
+ custom_field: Record<string, unknown>;
21
22
  ticket: TicketData[];
22
23
  };
23
24
  export type { Identification };
@@ -1,7 +1,7 @@
1
1
  import { DeviceCultureInfo, SIMInfo } from "../../..";
2
2
  type DeviceExtendedInfo = {
3
- sim_info: SIMInfo | null;
4
- culture_info: DeviceCultureInfo | null;
3
+ sim_info: SIMInfo;
4
+ culture_info: DeviceCultureInfo;
5
5
  user_agent: string;
6
6
  fingerprint: string;
7
7
  cpu: string;
@@ -9,8 +9,8 @@ type Phone = {
9
9
  original_source_id: string;
10
10
  server_date: string;
11
11
  date_utc: string;
12
- client_date: string | null;
12
+ client_date: string;
13
13
  update_date_utc: string;
14
- custom_field: Record<string, unknown> | null;
14
+ custom_field: Record<string, unknown>;
15
15
  };
16
16
  export type { Phone };
@@ -17,8 +17,8 @@ type Relationship = {
17
17
  original_source_id: string;
18
18
  server_date: string;
19
19
  date_utc: string;
20
- client_date: string | null;
20
+ client_date: string;
21
21
  update_date_utc: string;
22
- custom_field: Record<string, unknown> | null;
22
+ custom_field: Record<string, unknown>;
23
23
  };
24
24
  export type { Relationship };
@@ -5,7 +5,7 @@ type SocialMedia = {
5
5
  original_source_id: string;
6
6
  server_date: string;
7
7
  date_utc: string;
8
- client_date: string | null;
8
+ client_date: string;
9
9
  update_date_utc: string;
10
10
  custom_field: Record<string, unknown>;
11
11
  };
@@ -9,7 +9,7 @@ type GroupInfo = {
9
9
  original_source_id: string;
10
10
  server_date: string;
11
11
  date_utc: string;
12
- client_date: string | null;
12
+ client_date: string;
13
13
  update_date_utc: string;
14
14
  source_time_zone: string;
15
15
  };
@@ -15,7 +15,7 @@ type TokenData = BaseResult & {
15
15
  installation_id: string;
16
16
  device_status: string;
17
17
  device_verification_status: string;
18
- device_encryption_key: string | null;
18
+ device_encryption_key: string;
19
19
  error: string;
20
20
  };
21
21
  export { TokenData };
@@ -1,6 +1,6 @@
1
1
  type PinCodeFulfilment = {
2
2
  pin_code_id: number;
3
3
  print_status: number;
4
- is_pin_code_related_to_order: boolean | null;
4
+ is_pin_code_related_to_order: boolean;
5
5
  };
6
6
  export type { PinCodeFulfilment };
@@ -21,7 +21,7 @@ type OrderInfo = {
21
21
  refund_expiry_datetime_utc: string;
22
22
  server_date: string;
23
23
  date_utc: string;
24
- client_date: Date | null;
24
+ client_date: Date;
25
25
  source_time_zone: string;
26
26
  source_language: string;
27
27
  original_source_id: string;
@@ -1,8 +1,8 @@
1
1
  import { AccountData, CreditCard } from "..";
2
2
  type PaymentMethod = {
3
3
  type: number;
4
- account: AccountData | null;
5
- credit_card: CreditCard | null;
4
+ account: AccountData;
5
+ credit_card: CreditCard;
6
6
  payment_gateway: null;
7
7
  mada: null;
8
8
  network: null;
@@ -10,7 +10,7 @@ type OrganizationInfo = {
10
10
  type: number;
11
11
  server_date: string;
12
12
  date_utc: string;
13
- client_date: string | null;
13
+ client_date: string;
14
14
  source_time_zone: string;
15
15
  source_id: string;
16
16
  };
@@ -3,20 +3,20 @@ type OrganizationData = BaseResult & {
3
3
  info: OrganizationInfo;
4
4
  details: OrganizationDetails;
5
5
  address: Address[];
6
- email: Email[] | null;
7
- phone: Phone[] | null;
8
- social_media: SocialMedia[] | null;
6
+ email: Email[];
7
+ phone: Phone[];
8
+ social_media: SocialMedia[];
9
9
  ownership_json: string;
10
- classification: Classification | null;
10
+ classification: Classification;
11
11
  working_hours: WorkingHour;
12
12
  json: string;
13
13
  geo_coordinates: GeoCoordinates;
14
- history: History[] | null;
14
+ history: History[];
15
15
  relationship: Relationship[];
16
- documents: DocumentData[] | null;
17
- users: UserData[] | null;
18
- accounts: AccountData[] | null;
19
- picture: string[] | null;
16
+ documents: DocumentData[];
17
+ users: UserData[];
18
+ accounts: AccountData[];
19
+ picture: string[];
20
20
  ticket: TicketData[];
21
21
  };
22
22
  export type { OrganizationData };
@@ -25,7 +25,7 @@ type TicketInfo = {
25
25
  notes: string;
26
26
  server_date: string;
27
27
  date_utc: string;
28
- client_date: string | null;
28
+ client_date: string;
29
29
  update_date_utc: string;
30
30
  source_time_zone: string;
31
31
  original_source_id: string;
@@ -19,9 +19,9 @@ type TransactionInfo = {
19
19
  date_utc: string;
20
20
  auth_date_utc: string;
21
21
  post_date_utc: string;
22
- client_date: Date | null;
23
- auth_client_date: Date | null;
24
- post_client_date: Date | null;
22
+ client_date: Date;
23
+ auth_client_date: Date;
24
+ post_client_date: Date;
25
25
  source_time_zone: string;
26
26
  service_provider: number;
27
27
  wallet_identifier: string;
@@ -4,8 +4,8 @@ type ConfirmUserSecurityInfo = {
4
4
  user_id: number;
5
5
  type: number;
6
6
  source_id: string;
7
- server_date: Date | null;
8
- date_utc: Date | null;
7
+ server_date: Date;
8
+ date_utc: Date;
9
9
  source_time_zone: string;
10
10
  };
11
11
  export type { ConfirmUserSecurityInfo };
@@ -15,7 +15,7 @@ type DocumentInfo = {
15
15
  number_of_attachments: number;
16
16
  support_notes: string;
17
17
  update_datetime_utc: string;
18
- client_date: string | null;
18
+ client_date: string;
19
19
  source_id: string;
20
20
  server_date: string;
21
21
  date_utc: string;
@@ -9,7 +9,7 @@ type UserInfo = {
9
9
  is_vulnerable: number;
10
10
  server_date: string;
11
11
  date_utc: string;
12
- client_date: string | null;
12
+ client_date: string;
13
13
  source_time_zone: string;
14
14
  original_source_id: string;
15
15
  };
@@ -7,7 +7,7 @@ type PersonalInfo = {
7
7
  gender: string;
8
8
  date_of_birth: string;
9
9
  verification_status: number;
10
- picture: string[] | null;
10
+ picture: string[];
11
11
  custom_field: {
12
12
  [key: string]: any;
13
13
  };
@@ -4,8 +4,8 @@ type ResetUserSecurityInfo = {
4
4
  user_id: number;
5
5
  type: number;
6
6
  source_id: string;
7
- server_date: Date | null;
8
- date_utc: Date | null;
7
+ server_date: Date;
8
+ date_utc: Date;
9
9
  source_time_zone: string;
10
10
  };
11
11
  export type { ResetUserSecurityInfo };
@@ -1,7 +1,7 @@
1
1
  import type { AccountData, Activity, Address, BankAccount, BaseResult, CreditCard, CryptoAddress, Currency, Device, DeviceHistory, DocumentData, Email, History, ExternalAuthentication, GeneralRequirements, GeoCoordinates, GroupData, Identification, OrganizationData, PersonalInfo, Phone, Preferences, Relationship, UserSecurity, SimplifiedAccessRule, TermsConditions, TicketData, UserAuthenticationData, UserCreditLimit, UserInfo, Commerce, ValidationData, PromotionData, UserAccessControl } from "..";
2
2
  type CustomField = {
3
- promotion_data: PromotionData | null;
4
- user_access_control: UserAccessControl | null;
3
+ promotion_data: PromotionData;
4
+ user_access_control: UserAccessControl;
5
5
  };
6
6
  type UserData = BaseResult & {
7
7
  info: UserInfo;
@@ -6,6 +6,6 @@ type ValidateSecurityData = BaseResult & {
6
6
  phone: string;
7
7
  secret_answer_1: string;
8
8
  secret_answer_2: string;
9
- birth_date: Date | null;
9
+ birth_date: Date;
10
10
  };
11
11
  export type { ValidateSecurityData };
@@ -4,8 +4,8 @@ type ValidateUserSecurityInfo = {
4
4
  user_id: number;
5
5
  type: number;
6
6
  source_id: string;
7
- server_date: Date | null;
8
- date_utc: Date | null;
7
+ server_date: Date;
8
+ date_utc: Date;
9
9
  source_time_zone: string;
10
10
  };
11
11
  export type { ValidateUserSecurityInfo };
@@ -6,8 +6,8 @@ type VerifyUserSecurityInfo = {
6
6
  type: number;
7
7
  authorization_request_type: number;
8
8
  source_id: string;
9
- server_date: Date | null;
10
- date_utc: Date | null;
9
+ server_date: Date;
10
+ date_utc: Date;
11
11
  source_time_zone: string;
12
12
  };
13
13
  export type { VerifyUserSecurityInfo };
@@ -1,9 +1,9 @@
1
1
  import { DocumentData, OrganizationData, UserData } from "..";
2
- type TEntity = UserData[keyof Pick<UserData, "addresses" | "bank_account" | "email" | "phone">][0];
3
- type TModifyByEntity = <K extends TEntity>(entityList: K[], entity: K) => K[];
2
+ type TEntity = UserData[keyof Pick<UserData, "addresses" | "bank_account" | "email" | "phone" | "identification">][0];
3
+ type TModifyListByEntity = <K extends TEntity>(entityList: K[], entity: K) => K[];
4
4
  type TModifyByDocumentData = <K extends TEntity>(entityList: K[], entity: DocumentData) => K[];
5
5
  type TModifyOrganizationByDocumentData = <K extends OrganizationData>(entityList: K[], entity: DocumentData) => K[];
6
- export { TEntity, TModifyByEntity, TModifyByDocumentData, TModifyOrganizationByDocumentData, };
6
+ export { TEntity, TModifyListByEntity, TModifyByDocumentData, TModifyOrganizationByDocumentData, };
7
7
  type BaseEntity = {
8
8
  id: number;
9
9
  is_primary: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ggez-banking-sdk",
3
- "version": "0.1.115",
3
+ "version": "0.1.117",
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",