ggez-banking-sdk 0.4.1 → 0.4.3
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/context/defaultClientContextProvider.d.ts +1 -10
- package/dist/helper/geoHelper.d.ts +1 -5
- package/dist/helper/userHelper.d.ts +2 -10
- package/dist/types/api/context/clientContext.d.ts +10 -1
- package/dist/types/helper/geoHelper.d.ts +11 -1
- package/dist/types/helper/userHelper.d.ts +11 -0
- package/package.json +2 -2
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
import type { ClientContextProvider } from "../../types/api/context/clientContext";
|
|
2
|
-
type InitialContext = {
|
|
3
|
-
baseUrl: string;
|
|
4
|
-
nodeUrl: string;
|
|
5
|
-
programId: number;
|
|
6
|
-
lang?: string;
|
|
7
|
-
installationId?: string;
|
|
8
|
-
token?: string;
|
|
9
|
-
userId?: number;
|
|
10
|
-
};
|
|
1
|
+
import type { ClientContextProvider, InitialContext } from "../../types/api/context/clientContext";
|
|
11
2
|
declare class DefaultClientContextProvider implements ClientContextProvider {
|
|
12
3
|
private baseUrl;
|
|
13
4
|
private nodeUrl;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import type { GeoCoordinates } from "../types";
|
|
2
|
-
import type { AxiosResponse } from "axios";
|
|
3
|
-
type GeoSource = {
|
|
4
|
-
getIPAddressAndLocation: () => Promise<AxiosResponse<string>>;
|
|
5
|
-
};
|
|
1
|
+
import type { GeoCoordinates, GeoSource } from "../types";
|
|
6
2
|
declare class GeoHelper {
|
|
7
3
|
private static readonly CACHE_KEY;
|
|
8
4
|
private static readonly DEFAULT_TTL_MS;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Entity, EntityData } from "../constant";
|
|
2
|
-
import type { TModifyListByEntity, TModifyByDocumentData, TSortByID, TSortByIsPrimary, TSortByVerificationStatus, TSortEntity, TModifyOrganizationByDocumentData, TModifyOrganizationList, TModifyProfilePicture, TModifySecurityResetUserSecurity, VerifySecurityData, UserData, ICreateUserData } from "../types";
|
|
2
|
+
import type { TModifyListByEntity, TModifyByDocumentData, TSortByID, TSortByIsPrimary, TSortByVerificationStatus, TSortEntity, TModifyOrganizationByDocumentData, TModifyOrganizationList, TModifyProfilePicture, TModifySecurityResetUserSecurity, VerifySecurityData, UserData, ICreateUserData, PromotionCustomField } from "../types";
|
|
3
3
|
declare class UserHelper {
|
|
4
4
|
static modifyListByEntity: TModifyListByEntity;
|
|
5
5
|
static modifyByDocumentData: TModifyByDocumentData;
|
|
@@ -13,14 +13,6 @@ declare class UserHelper {
|
|
|
13
13
|
static sortById: TSortByID;
|
|
14
14
|
static extractDeviceData: (data: UserData | VerifySecurityData) => import("..").Device;
|
|
15
15
|
static fillUserDataByEntity(entity: Entity, entityData: EntityData, data: any, id: number): UserData;
|
|
16
|
-
static fillPromotionData: (data: Pick<ICreateUserData, "giftData" | "referralCode" | "referralCodeType">) =>
|
|
17
|
-
promotion_data: {
|
|
18
|
-
gift_data?: ICreateUserData["giftData"][];
|
|
19
|
-
referral_data?: {
|
|
20
|
-
code: ICreateUserData["referralCode"];
|
|
21
|
-
type: ICreateUserData["referralCodeType"];
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
} | undefined;
|
|
16
|
+
static fillPromotionData: (data: Pick<ICreateUserData, "giftData" | "referralCode" | "referralCodeType">) => PromotionCustomField | undefined;
|
|
25
17
|
}
|
|
26
18
|
export { UserHelper };
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
type InitialContext = {
|
|
2
|
+
baseUrl: string;
|
|
3
|
+
nodeUrl: string;
|
|
4
|
+
programId: number;
|
|
5
|
+
lang?: string;
|
|
6
|
+
installationId?: string;
|
|
7
|
+
token?: string;
|
|
8
|
+
userId?: number;
|
|
9
|
+
};
|
|
1
10
|
/**
|
|
2
11
|
* Source of truth for per-request credential + config state.
|
|
3
12
|
*
|
|
@@ -20,4 +29,4 @@ interface ClientContextProvider {
|
|
|
20
29
|
getUserId(): number;
|
|
21
30
|
setUserId(userId: number): void;
|
|
22
31
|
}
|
|
23
|
-
export type { ClientContextProvider };
|
|
32
|
+
export type { InitialContext, ClientContextProvider };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { AxiosResponse } from "axios";
|
|
2
|
+
import type { GeoCoordinates } from "../banking/common";
|
|
1
3
|
type IPAddressAndLocation = {
|
|
2
4
|
ip_address: string;
|
|
3
5
|
country: string;
|
|
@@ -5,4 +7,12 @@ type IPAddressAndLocation = {
|
|
|
5
7
|
latitude: number;
|
|
6
8
|
longitude: number;
|
|
7
9
|
};
|
|
8
|
-
|
|
10
|
+
type GeoSource = {
|
|
11
|
+
getIPAddressAndLocation: () => Promise<AxiosResponse<string>>;
|
|
12
|
+
};
|
|
13
|
+
interface CachedGeoData {
|
|
14
|
+
geo_coordinates: GeoCoordinates;
|
|
15
|
+
ip_address?: string;
|
|
16
|
+
timestamp: number;
|
|
17
|
+
}
|
|
18
|
+
export type { IPAddressAndLocation, GeoSource, CachedGeoData };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DocumentData, OrganizationData, PersonalInfo, ResetUserSecurity, UserData, UserSecurity } from "..";
|
|
2
|
+
import type { GiftData } from "../banking/entities/customField/promotionData/giftData";
|
|
2
3
|
type TEntity = UserData[keyof Pick<UserData, "addresses" | "bank_account" | "email" | "phone" | "identification">][0];
|
|
3
4
|
type TModifyListByEntity = <K extends TEntity>(entityList: K[], entity: K) => K[];
|
|
4
5
|
type TModifyByDocumentData = <K extends TEntity>(entityList: K[], entity: DocumentData) => K[];
|
|
@@ -19,3 +20,13 @@ type TSortByIsPrimary = TBaseSortEntityBy;
|
|
|
19
20
|
type TSortByVerificationStatus = TBaseSortEntityBy;
|
|
20
21
|
type TSortByID = TBaseSortEntityBy;
|
|
21
22
|
export { TSortEntity, TSortByIsPrimary, TSortByVerificationStatus, TSortByID };
|
|
23
|
+
type PromotionCustomField = {
|
|
24
|
+
promotion_data: {
|
|
25
|
+
gift_data?: GiftData[];
|
|
26
|
+
referral_data?: {
|
|
27
|
+
code: string;
|
|
28
|
+
type: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export type { PromotionCustomField };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ggez-banking-sdk",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
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",
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
"homepage": "https://github.com/GGEZLabs/ggez-banking-sdk#readme",
|
|
117
117
|
"scripts": {
|
|
118
118
|
"build": "tsc --build",
|
|
119
|
-
"test": "jest",
|
|
119
|
+
"test": "jest --forceExit",
|
|
120
120
|
"prepare": "npm run build",
|
|
121
121
|
"analyze": "node scripts/essentials-analysis.js"
|
|
122
122
|
},
|