@longvansoftware/service-js-client 2.3.3 → 2.3.4
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.
|
@@ -8,5 +8,6 @@ export declare const GET_PHONE_BY_PARTYID: DocumentNode;
|
|
|
8
8
|
export declare const GET_EMAIL_BY_PARTYID: DocumentNode;
|
|
9
9
|
export declare const GET_ACCESS_TOKEN_BY_OTP: DocumentNode;
|
|
10
10
|
export declare const GET_PARTY_DETAIL_BY_PHONE: (fields?: string[]) => DocumentNode;
|
|
11
|
+
export declare const GET_PARTY_DETAIL_BY_CONTACT_INFO: (fields?: string[]) => DocumentNode;
|
|
11
12
|
export declare const GET_ORGANIZATIONS_BY_PARTYID: (fields?: string[]) => DocumentNode;
|
|
12
13
|
export declare const CHECK_ENABLED_2FA: (fields?: string[]) => DocumentNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CHECK_ENABLED_2FA = exports.GET_ORGANIZATIONS_BY_PARTYID = exports.GET_PARTY_DETAIL_BY_PHONE = exports.GET_ACCESS_TOKEN_BY_OTP = exports.GET_EMAIL_BY_PARTYID = exports.GET_PHONE_BY_PARTYID = exports.GET_USER_LOGIN_BY_PARTY_ID = exports.CHECK_USERNAME_EXISTED = exports.GET_USER_LOGIN_BY_USER_LOGIN_ID = exports.GET_USER_LOGIN_BY_TOKEN = exports.GET_USER_DETAIL = void 0;
|
|
3
|
+
exports.CHECK_ENABLED_2FA = exports.GET_ORGANIZATIONS_BY_PARTYID = exports.GET_PARTY_DETAIL_BY_CONTACT_INFO = exports.GET_PARTY_DETAIL_BY_PHONE = exports.GET_ACCESS_TOKEN_BY_OTP = exports.GET_EMAIL_BY_PARTYID = exports.GET_PHONE_BY_PARTYID = exports.GET_USER_LOGIN_BY_PARTY_ID = exports.CHECK_USERNAME_EXISTED = exports.GET_USER_LOGIN_BY_USER_LOGIN_ID = exports.GET_USER_LOGIN_BY_TOKEN = exports.GET_USER_DETAIL = void 0;
|
|
4
4
|
const graphql_tag_1 = require("graphql-tag");
|
|
5
5
|
exports.GET_USER_DETAIL = (0, graphql_tag_1.gql) `
|
|
6
6
|
query GetUserDetail($orgId: String!, $accessToken: String!) {
|
|
@@ -98,6 +98,18 @@ const GET_PARTY_DETAIL_BY_PHONE = (fields = []) => {
|
|
|
98
98
|
`;
|
|
99
99
|
};
|
|
100
100
|
exports.GET_PARTY_DETAIL_BY_PHONE = GET_PARTY_DETAIL_BY_PHONE;
|
|
101
|
+
const GET_PARTY_DETAIL_BY_CONTACT_INFO = (fields = []) => {
|
|
102
|
+
const fieldStr = fields.join("\n ");
|
|
103
|
+
const hasFields = fields.length > 0;
|
|
104
|
+
return (0, graphql_tag_1.gql) `
|
|
105
|
+
query GetPartyDetailByContactInfo($contactInfo: String!, $orgId: String!) {
|
|
106
|
+
getPartyDetailByContactInfo(contactInfo: $contactInfo, orgId: $orgId) {
|
|
107
|
+
${hasFields ? `${fieldStr}` : ""}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
`;
|
|
111
|
+
};
|
|
112
|
+
exports.GET_PARTY_DETAIL_BY_CONTACT_INFO = GET_PARTY_DETAIL_BY_CONTACT_INFO;
|
|
101
113
|
const GET_ORGANIZATIONS_BY_PARTYID = (fields = []) => {
|
|
102
114
|
const fieldStr = fields.join("\n ");
|
|
103
115
|
const hasFields = fields.length > 0;
|
|
@@ -45,6 +45,7 @@ export declare class AuthService extends Service {
|
|
|
45
45
|
getPhoneByPartyId(partyId: string): Promise<any>;
|
|
46
46
|
getEmailByPartyId(partyId: string): Promise<any>;
|
|
47
47
|
getPartyDetailByPhone(phone: string, fields: string[]): Promise<any>;
|
|
48
|
+
getPartyDetailByContactInfo(contactInfo: string, fields: string[]): Promise<any>;
|
|
48
49
|
createPartyDetail(name: string, phone: string, createdBy: string, source: string, fields: string[]): Promise<any>;
|
|
49
50
|
getOrganizationsByPartyIdDynamic(partyId: string, fields: string[]): Promise<any>;
|
|
50
51
|
checkEnabled2FA(partyId: string, fields: string[]): Promise<any>;
|
|
@@ -408,6 +408,23 @@ class AuthService extends serviceSDK_1.Service {
|
|
|
408
408
|
}
|
|
409
409
|
});
|
|
410
410
|
}
|
|
411
|
+
getPartyDetailByContactInfo(contactInfo, fields) {
|
|
412
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
413
|
+
const query = (0, queries_1.GET_PARTY_DETAIL_BY_CONTACT_INFO)(fields);
|
|
414
|
+
const variables = {
|
|
415
|
+
contactInfo,
|
|
416
|
+
orgId: this.orgId,
|
|
417
|
+
};
|
|
418
|
+
try {
|
|
419
|
+
const response = yield this.graphqlQuery(query, variables);
|
|
420
|
+
return response.getPartyDetailByContactInfo;
|
|
421
|
+
}
|
|
422
|
+
catch (error) {
|
|
423
|
+
console.log(`Error in getPartyDetailByContactInfo: ${error}`);
|
|
424
|
+
throw error;
|
|
425
|
+
}
|
|
426
|
+
});
|
|
427
|
+
}
|
|
411
428
|
createPartyDetail(name, phone, createdBy, source, fields) {
|
|
412
429
|
return __awaiter(this, void 0, void 0, function* () {
|
|
413
430
|
const mutation = (0, mutations_1.CREATE_PARTY_DETAIL)(fields);
|