@d19n/youfibre-odin-sdk 1.0.38 → 1.0.41
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-sdk-v2/ActivityLogApi.d.ts +1 -0
- package/dist/api-sdk-v2/ActivityLogApi.js +1 -0
- package/dist/api-sdk-v2/CallApi.d.ts +1 -0
- package/dist/api-sdk-v2/CallApi.js +1 -0
- package/dist/api-sdk-v2/CaseActionApi.d.ts +37 -0
- package/dist/api-sdk-v2/CaseActionApi.js +127 -0
- package/dist/api-sdk-v2/CaseApi.d.ts +8 -2
- package/dist/api-sdk-v2/CaseApi.js +8 -2
- package/dist/api-sdk-v2/ContactApi.d.ts +15 -14
- package/dist/api-sdk-v2/ContactApi.js +15 -14
- package/dist/api-sdk-v2/ConversationApi.d.ts +38 -0
- package/dist/api-sdk-v2/ConversationApi.js +128 -0
- package/dist/api-sdk-v2/EmailApi.d.ts +40 -0
- package/dist/api-sdk-v2/EmailApi.js +130 -0
- package/dist/api-sdk-v2/LeadApi.d.ts +4 -4
- package/dist/api-sdk-v2/LeadApi.js +4 -4
- package/dist/api-sdk-v2/MessageApi.d.ts +37 -0
- package/dist/api-sdk-v2/MessageApi.js +127 -0
- package/dist/api-sdk-v2/ServiceAppointmentApi.d.ts +1 -1
- package/dist/api-sdk-v2/ServiceAppointmentApi.js +1 -1
- package/dist/api-sdk-v2/TeamApi.d.ts +1 -0
- package/dist/api-sdk-v2/TeamApi.js +1 -0
- package/dist/api-sdk-v2/UserApi.d.ts +4 -1
- package/dist/api-sdk-v2/UserApi.js +4 -1
- package/dist/api-sdk-v2/WorkOrderApi.d.ts +11 -11
- package/dist/api-sdk-v2/WorkOrderApi.js +11 -11
- package/dist/db-sdk-v2/ActivityLogDb.d.ts +1 -0
- package/dist/db-sdk-v2/ActivityLogDb.js +1 -0
- package/dist/db-sdk-v2/CallDb.d.ts +1 -0
- package/dist/db-sdk-v2/CallDb.js +1 -0
- package/dist/db-sdk-v2/CaseActionDb.d.ts +26 -0
- package/dist/db-sdk-v2/CaseActionDb.js +104 -0
- package/dist/db-sdk-v2/CaseDb.d.ts +8 -2
- package/dist/db-sdk-v2/CaseDb.js +8 -2
- package/dist/db-sdk-v2/ContactDb.d.ts +15 -14
- package/dist/db-sdk-v2/ContactDb.js +15 -14
- package/dist/db-sdk-v2/ConversationDb.d.ts +27 -0
- package/dist/db-sdk-v2/ConversationDb.js +105 -0
- package/dist/db-sdk-v2/EmailDb.d.ts +29 -0
- package/dist/db-sdk-v2/EmailDb.js +107 -0
- package/dist/db-sdk-v2/LeadDb.d.ts +4 -4
- package/dist/db-sdk-v2/LeadDb.js +4 -4
- package/dist/db-sdk-v2/MessageDb.d.ts +26 -0
- package/dist/db-sdk-v2/MessageDb.js +104 -0
- package/dist/db-sdk-v2/ServiceAppointmentDb.d.ts +1 -1
- package/dist/db-sdk-v2/ServiceAppointmentDb.js +1 -1
- package/dist/db-sdk-v2/TeamDb.d.ts +1 -0
- package/dist/db-sdk-v2/TeamDb.js +1 -0
- package/dist/db-sdk-v2/UserDb.d.ts +4 -1
- package/dist/db-sdk-v2/UserDb.js +4 -1
- package/dist/db-sdk-v2/WorkOrderDb.d.ts +11 -11
- package/dist/db-sdk-v2/WorkOrderDb.js +11 -11
- package/dist/entities-v2/ActivityLog.d.ts +2 -0
- package/dist/entities-v2/AfpInvoiceFile.d.ts +183 -0
- package/dist/entities-v2/AfpInvoiceFile.js +46 -0
- package/dist/entities-v2/BillingAdjustment.d.ts +12 -12
- package/dist/entities-v2/BillingAdjustment.js +10 -10
- package/dist/entities-v2/BlockageA55.d.ts +36 -36
- package/dist/entities-v2/BlockageA55.js +36 -36
- package/dist/entities-v2/Call.d.ts +11 -1
- package/dist/entities-v2/Call.js +4 -0
- package/dist/entities-v2/Case.d.ts +149 -5
- package/dist/entities-v2/Case.js +122 -1
- package/dist/entities-v2/CaseAction.d.ts +51 -0
- package/dist/entities-v2/CaseAction.js +25 -0
- package/dist/entities-v2/ChangeReason.d.ts +8 -0
- package/dist/entities-v2/ChangeReason.js +8 -0
- package/dist/entities-v2/CollectionWorkOrder.d.ts +4 -4
- package/dist/entities-v2/Contact.d.ts +81 -79
- package/dist/entities-v2/Contact.js +61 -61
- package/dist/entities-v2/Conversation.d.ts +81 -0
- package/dist/entities-v2/Conversation.js +52 -0
- package/dist/entities-v2/CsvFile.d.ts +183 -0
- package/dist/entities-v2/CsvFile.js +46 -0
- package/dist/entities-v2/Email.d.ts +89 -0
- package/dist/entities-v2/Email.js +45 -0
- package/dist/entities-v2/EmailFile.d.ts +183 -0
- package/dist/entities-v2/EmailFile.js +46 -0
- package/dist/entities-v2/File.d.ts +9 -1
- package/dist/entities-v2/File.js +8 -0
- package/dist/entities-v2/FinanceWorkOrder.d.ts +4 -4
- package/dist/entities-v2/InspectionWorkOrder.d.ts +4 -4
- package/dist/entities-v2/InstallBusinessWorkOrder.d.ts +4 -4
- package/dist/entities-v2/InstallServiceWorkOrder.d.ts +4 -4
- package/dist/entities-v2/InstallWorkOrder.d.ts +4 -4
- package/dist/entities-v2/InternalInstallAudit.d.ts +10 -10
- package/dist/entities-v2/InternalInstallAudit.js +9 -9
- package/dist/entities-v2/InvoiceFile.d.ts +183 -0
- package/dist/entities-v2/InvoiceFile.js +46 -0
- package/dist/entities-v2/Message.d.ts +63 -0
- package/dist/entities-v2/Message.js +31 -0
- package/dist/entities-v2/NaProblemEvidenceFile.d.ts +183 -0
- package/dist/entities-v2/NaProblemEvidenceFile.js +46 -0
- package/dist/entities-v2/NaSolutionEvidenceFile.d.ts +183 -0
- package/dist/entities-v2/NaSolutionEvidenceFile.js +46 -0
- package/dist/entities-v2/NetworkAdjustmentWorkOrder.d.ts +4 -4
- package/dist/entities-v2/NetworkDevice.d.ts +7 -1
- package/dist/entities-v2/NetworkDevice.js +7 -1
- package/dist/entities-v2/OltNetworkDevice.d.ts +7 -1
- package/dist/entities-v2/OltNetworkDevice.js +7 -1
- package/dist/entities-v2/OpenreachA55File.d.ts +183 -0
- package/dist/entities-v2/OpenreachA55File.js +46 -0
- package/dist/entities-v2/OtdrFile.d.ts +183 -0
- package/dist/entities-v2/OtdrFile.js +46 -0
- package/dist/entities-v2/OutageCase.d.ts +149 -5
- package/dist/entities-v2/OutageCase.js +122 -1
- package/dist/entities-v2/OutcomeFormBlockageA55.d.ts +36 -36
- package/dist/entities-v2/OutcomeFormBlockageA55.js +36 -36
- package/dist/entities-v2/OutcomeFormOverlayRealA55.d.ts +40 -40
- package/dist/entities-v2/OutcomeFormOverlayRealA55.js +38 -38
- package/dist/entities-v2/OutcomeFormRemediationRequiredReason.d.ts +17 -10
- package/dist/entities-v2/OutcomeFormRemediationRequiredReason.js +17 -10
- package/dist/entities-v2/OverlayRealA55.d.ts +40 -40
- package/dist/entities-v2/OverlayRealA55.js +38 -38
- package/dist/entities-v2/PlanningWorkOrder.d.ts +4 -4
- package/dist/entities-v2/PrePullWorkOrder.d.ts +4 -4
- package/dist/entities-v2/RemediationRequiredReason.d.ts +17 -10
- package/dist/entities-v2/RemediationRequiredReason.js +17 -10
- package/dist/entities-v2/RemediationWorkOrder.d.ts +4 -4
- package/dist/entities-v2/SaCancelChangeReason.d.ts +5 -0
- package/dist/entities-v2/SaCancelChangeReason.js +5 -0
- package/dist/entities-v2/SaRescheduleChangeReason.d.ts +3 -0
- package/dist/entities-v2/SaRescheduleChangeReason.js +3 -0
- package/dist/entities-v2/ServiceAppointment.d.ts +2 -2
- package/dist/entities-v2/ServiceWorkOrder.d.ts +4 -4
- package/dist/entities-v2/SupportEmail.d.ts +86 -0
- package/dist/entities-v2/SupportEmail.js +41 -0
- package/dist/entities-v2/Team.d.ts +9 -1
- package/dist/entities-v2/Team.js +7 -1
- package/dist/entities-v2/User.d.ts +11 -3
- package/dist/entities-v2/User.js +3 -0
- package/dist/entities-v2/WayleaveWorkOrder.d.ts +4 -4
- package/dist/entities-v2/WorkOrder.d.ts +3 -3
- package/dist/types-v1/Types.d.ts +12 -8
- package/dist/types-v1/Types.js +12 -8
- package/package.json +1 -1
- package/src/api-sdk-v2/ActivityLogApi.ts +6 -0
- package/src/api-sdk-v2/CallApi.ts +6 -0
- package/src/api-sdk-v2/CaseActionApi.ts +138 -0
- package/src/api-sdk-v2/CaseApi.ts +44 -8
- package/src/api-sdk-v2/ContactApi.ts +84 -78
- package/src/api-sdk-v2/ConversationApi.ts +144 -0
- package/src/api-sdk-v2/EmailApi.ts +156 -0
- package/src/api-sdk-v2/LeadApi.ts +18 -18
- package/src/api-sdk-v2/MessageApi.ts +138 -0
- package/src/api-sdk-v2/ServiceAppointmentApi.ts +6 -6
- package/src/api-sdk-v2/TeamApi.ts +6 -0
- package/src/api-sdk-v2/UserApi.ts +24 -6
- package/src/api-sdk-v2/WorkOrderApi.ts +60 -60
- package/src/db-sdk-v2/ActivityLogDb.ts +8 -0
- package/src/db-sdk-v2/CallDb.ts +8 -0
- package/src/db-sdk-v2/CaseActionDb.ts +121 -0
- package/src/db-sdk-v2/CaseDb.ts +56 -8
- package/src/db-sdk-v2/ContactDb.ts +91 -83
- package/src/db-sdk-v2/ConversationDb.ts +129 -0
- package/src/db-sdk-v2/EmailDb.ts +145 -0
- package/src/db-sdk-v2/LeadDb.ts +22 -22
- package/src/db-sdk-v2/MessageDb.ts +121 -0
- package/src/db-sdk-v2/ServiceAppointmentDb.ts +8 -8
- package/src/db-sdk-v2/TeamDb.ts +8 -0
- package/src/db-sdk-v2/UserDb.ts +32 -8
- package/src/db-sdk-v2/WorkOrderDb.ts +76 -76
- package/src/entities-v2/ActivityLog.ts +2 -0
- package/src/entities-v2/AfpInvoiceFile.ts +199 -0
- package/src/entities-v2/BillingAdjustment.ts +16 -16
- package/src/entities-v2/BlockageA55.ts +45 -45
- package/src/entities-v2/Call.ts +15 -1
- package/src/entities-v2/Case.ts +170 -4
- package/src/entities-v2/CaseAction.ts +55 -0
- package/src/entities-v2/ChangeReason.ts +8 -0
- package/src/entities-v2/CollectionWorkOrder.ts +4 -4
- package/src/entities-v2/Contact.ts +104 -102
- package/src/entities-v2/Conversation.ts +89 -0
- package/src/entities-v2/CsvFile.ts +199 -0
- package/src/entities-v2/Email.ts +107 -0
- package/src/entities-v2/EmailFile.ts +199 -0
- package/src/entities-v2/File.ts +8 -0
- package/src/entities-v2/FinanceWorkOrder.ts +4 -4
- package/src/entities-v2/InspectionWorkOrder.ts +4 -4
- package/src/entities-v2/InstallBusinessWorkOrder.ts +4 -4
- package/src/entities-v2/InstallServiceWorkOrder.ts +4 -4
- package/src/entities-v2/InstallWorkOrder.ts +4 -4
- package/src/entities-v2/InternalInstallAudit.ts +12 -12
- package/src/entities-v2/InvoiceFile.ts +199 -0
- package/src/entities-v2/Message.ts +73 -0
- package/src/entities-v2/NaProblemEvidenceFile.ts +199 -0
- package/src/entities-v2/NaSolutionEvidenceFile.ts +199 -0
- package/src/entities-v2/NetworkAdjustmentWorkOrder.ts +4 -4
- package/src/entities-v2/NetworkDevice.ts +7 -0
- package/src/entities-v2/OltNetworkDevice.ts +7 -0
- package/src/entities-v2/OpenreachA55File.ts +199 -0
- package/src/entities-v2/OtdrFile.ts +199 -0
- package/src/entities-v2/OutageCase.ts +170 -4
- package/src/entities-v2/OutcomeFormBlockageA55.ts +45 -45
- package/src/entities-v2/OutcomeFormOverlayRealA55.ts +51 -51
- package/src/entities-v2/OutcomeFormRemediationRequiredReason.ts +17 -10
- package/src/entities-v2/OverlayRealA55.ts +51 -51
- package/src/entities-v2/PlanningWorkOrder.ts +4 -4
- package/src/entities-v2/PrePullWorkOrder.ts +4 -4
- package/src/entities-v2/RemediationRequiredReason.ts +17 -10
- package/src/entities-v2/RemediationWorkOrder.ts +4 -4
- package/src/entities-v2/SaCancelChangeReason.ts +5 -0
- package/src/entities-v2/SaRescheduleChangeReason.ts +3 -0
- package/src/entities-v2/ServiceAppointment.ts +2 -2
- package/src/entities-v2/ServiceWorkOrder.ts +4 -4
- package/src/entities-v2/SupportEmail.ts +106 -0
- package/src/entities-v2/Team.ts +9 -0
- package/src/entities-v2/User.ts +13 -2
- package/src/entities-v2/WayleaveWorkOrder.ts +4 -4
- package/src/entities-v2/WorkOrder.ts +3 -3
- package/src/types-v1/Types.ts +12 -8
|
@@ -8,6 +8,7 @@ export declare class ActivityLogApi extends ApiProvider {
|
|
|
8
8
|
private readonly moduleName;
|
|
9
9
|
private readonly entityName;
|
|
10
10
|
private sourceRecord;
|
|
11
|
+
readonly call: ApiRecordLinkManager;
|
|
11
12
|
readonly onetouchswitch: ApiRecordLinkManager;
|
|
12
13
|
readonly workorder: ApiRecordLinkManager;
|
|
13
14
|
constructor(authParams?: OauthParams, authToken?: string);
|
|
@@ -18,6 +18,7 @@ class ActivityLogApi extends api_provider_1.ApiProvider {
|
|
|
18
18
|
this.authToken = authToken;
|
|
19
19
|
this.moduleName = 'AuditModule';
|
|
20
20
|
this.entityName = 'ActivityLog';
|
|
21
|
+
this.call = new api_record_link_manager_1.ApiRecordLinkManager('AuditModule:ActivityLog', 'NotificationModule:Call', 'CallActivity');
|
|
21
22
|
this.onetouchswitch = new api_record_link_manager_1.ApiRecordLinkManager('AuditModule:ActivityLog', 'OrderModule:OneTouchSwitch', 'OneTouchSwitch_ActivityLog');
|
|
22
23
|
this.workorder = new api_record_link_manager_1.ApiRecordLinkManager('AuditModule:ActivityLog', 'FieldServiceModule:WorkOrder', 'WorkOrder_ActivityLog');
|
|
23
24
|
}
|
|
@@ -8,6 +8,7 @@ export declare class CallApi extends ApiProvider {
|
|
|
8
8
|
private readonly moduleName;
|
|
9
9
|
private readonly entityName;
|
|
10
10
|
private sourceRecord;
|
|
11
|
+
readonly activitylog: ApiRecordLinkManager;
|
|
11
12
|
readonly lead: ApiRecordLinkManager;
|
|
12
13
|
readonly contact: ApiRecordLinkManager;
|
|
13
14
|
readonly case: ApiRecordLinkManager;
|
|
@@ -18,6 +18,7 @@ class CallApi extends api_provider_1.ApiProvider {
|
|
|
18
18
|
this.authToken = authToken;
|
|
19
19
|
this.moduleName = 'NotificationModule';
|
|
20
20
|
this.entityName = 'Call';
|
|
21
|
+
this.activitylog = new api_record_link_manager_1.ApiRecordLinkManager('NotificationModule:Call', 'AuditModule:ActivityLog', 'CallActivity');
|
|
21
22
|
this.lead = new api_record_link_manager_1.ApiRecordLinkManager('NotificationModule:Call', 'CrmModule:Lead', 'Call__Lead');
|
|
22
23
|
this.contact = new api_record_link_manager_1.ApiRecordLinkManager('NotificationModule:Call', 'CrmModule:Contact', 'Call__Contact');
|
|
23
24
|
this.case = new api_record_link_manager_1.ApiRecordLinkManager('NotificationModule:Call', 'SupportModule:Case', 'Call__Case');
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { OauthParams } from '@d19n/odin-sdk-generator/dist/api.interfaces';
|
|
2
|
+
import { ApiProvider } from '@d19n/odin-sdk-generator/dist/api.provider';
|
|
3
|
+
import { OdinSearchV2 } from '@d19n/odin-types/dist/interfaces/v2.db.interfaces';
|
|
4
|
+
import { OdinRecordCreateDto, OdinRecordUpdateDto } from '@d19n/odin-types/dist/dtos/odin.dtos';
|
|
5
|
+
import { ApiRecordLinkManager } from '@d19n/odin-sdk-generator/dist/api.record.link.manager';
|
|
6
|
+
export declare class CaseActionApi extends ApiProvider {
|
|
7
|
+
protected readonly authToken?: string;
|
|
8
|
+
private readonly moduleName;
|
|
9
|
+
private readonly entityName;
|
|
10
|
+
private sourceRecord;
|
|
11
|
+
readonly case: ApiRecordLinkManager;
|
|
12
|
+
constructor(authParams?: OauthParams, authToken?: string);
|
|
13
|
+
setRecord(sourceRecord: any): void;
|
|
14
|
+
schema(): Promise<import("@d19n/odin-types/dist/types/odin.types").OdinSchema>;
|
|
15
|
+
search(params: Partial<OdinSearchV2>): Promise<import("@d19n/odin-sdk-generator/dist/api.interfaces").OdinSearchResponse<any>>;
|
|
16
|
+
searchAndPaginate(params: Partial<OdinSearchV2>): Promise<import("@d19n/odin-sdk-generator/dist/api.interfaces").OdinSearchResponse<any>>;
|
|
17
|
+
reIndex(body: {
|
|
18
|
+
id: string;
|
|
19
|
+
schemaId: string;
|
|
20
|
+
}[]): Promise<any>;
|
|
21
|
+
get(caseActionId: string): Promise<any>;
|
|
22
|
+
getMany(caseActionIds: string[]): Promise<any[]>;
|
|
23
|
+
upsert(upsertDto: OdinRecordCreateDto): Promise<any>;
|
|
24
|
+
upsertMany(upsertDtos: OdinRecordCreateDto[]): Promise<any[]>;
|
|
25
|
+
update(updateDto: OdinRecordUpdateDto): Promise<any>;
|
|
26
|
+
updateMany(updateDtos: OdinRecordUpdateDto[]): Promise<any[]>;
|
|
27
|
+
delete(caseActionId: string): Promise<import("@d19n/odin-types/dist/types/odin.types").OdinDeleteResponse>;
|
|
28
|
+
deleteMany(caseActionIds: string[]): Promise<import("@d19n/odin-types/dist/types/odin.types").OdinDeleteResponse[]>;
|
|
29
|
+
restore(caseActionIds: string[]): Promise<import("@d19n/odin-types/dist/types/odin.types").OdinRestoreResponse[]>;
|
|
30
|
+
applyAction(actionName: string, dtos: any[]): Promise<any[]>;
|
|
31
|
+
getVersions(): Promise<{
|
|
32
|
+
[key: string]: Record<string, any>;
|
|
33
|
+
}>;
|
|
34
|
+
getRevisionTimeline(): Promise<{
|
|
35
|
+
[key: string]: Record<string, any>[];
|
|
36
|
+
}>;
|
|
37
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.CaseActionApi = void 0;
|
|
13
|
+
const api_provider_1 = require("@d19n/odin-sdk-generator/dist/api.provider");
|
|
14
|
+
const api_record_link_manager_1 = require("@d19n/odin-sdk-generator/dist/api.record.link.manager");
|
|
15
|
+
class CaseActionApi extends api_provider_1.ApiProvider {
|
|
16
|
+
constructor(authParams, authToken) {
|
|
17
|
+
super(authParams, authToken);
|
|
18
|
+
this.authToken = authToken;
|
|
19
|
+
this.moduleName = 'SupportModule';
|
|
20
|
+
this.entityName = 'CaseAction';
|
|
21
|
+
this.case = new api_record_link_manager_1.ApiRecordLinkManager('SupportModule:CaseAction', 'SupportModule:Case', 'Case__CaseAction');
|
|
22
|
+
}
|
|
23
|
+
setRecord(sourceRecord) {
|
|
24
|
+
this.sourceRecord = sourceRecord;
|
|
25
|
+
}
|
|
26
|
+
schema() {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
return yield this.getSchema(this.moduleName, this.entityName);
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
// Use this function when you want to search and handle all pagination on your own
|
|
32
|
+
search(params) {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
return yield this._searchRecords(this.moduleName, this.entityName, params);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
// Use this function when you want paginating through the results to be handled
|
|
38
|
+
searchAndPaginate(params) {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
return yield this._searchAllRecordsAndPaginate(this.moduleName, this.entityName, params);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
// Use this function to re-index records in elastic search
|
|
44
|
+
reIndex(body) {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
return yield this._reIndexRecords(body);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
// Use this function when you want to return a single record
|
|
50
|
+
get(caseActionId) {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
const res = yield this._getByPrimaryKey(this.moduleName, this.entityName, caseActionId);
|
|
53
|
+
this.setRecord(res);
|
|
54
|
+
return res;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
// Use this function when you want to return many records by primaryKeys
|
|
58
|
+
getMany(caseActionIds) {
|
|
59
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
return yield this._getManyByPrimaryKey(this.moduleName, this.entityName, caseActionIds);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
// Use this function when you want to upsert one record
|
|
64
|
+
upsert(upsertDto) {
|
|
65
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
66
|
+
const res = yield this._upsert(this.moduleName, this.entityName, [upsertDto]);
|
|
67
|
+
return res[0];
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
// Use this function when you want to upsert many records
|
|
71
|
+
upsertMany(upsertDtos) {
|
|
72
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
73
|
+
return yield this._upsert(this.moduleName, this.entityName, upsertDtos);
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
// Use this function when you want to update one record
|
|
77
|
+
update(updateDto) {
|
|
78
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
const res = yield this._update(this.moduleName, this.entityName, [updateDto]);
|
|
80
|
+
return res[0];
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
// Use this function when you want to update many records
|
|
84
|
+
updateMany(updateDtos) {
|
|
85
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
86
|
+
return yield this._update(this.moduleName, this.entityName, updateDtos);
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
// Use this function when you want to delete one record
|
|
90
|
+
delete(caseActionId) {
|
|
91
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
+
const res = yield this._delete(this.moduleName, this.entityName, [caseActionId]);
|
|
93
|
+
return res[0];
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
// Use this function when you want to delete many records
|
|
97
|
+
deleteMany(caseActionIds) {
|
|
98
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
99
|
+
return yield this._delete(this.moduleName, this.entityName, caseActionIds);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
// Use this function when you want to restore one or many records
|
|
103
|
+
restore(caseActionIds) {
|
|
104
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
105
|
+
return yield this._restore(this.moduleName, this.entityName, caseActionIds);
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
// Use this function when you want to apply actions
|
|
109
|
+
applyAction(actionName, dtos) {
|
|
110
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
111
|
+
return yield this._applyAction(this.moduleName, this.entityName, actionName, dtos);
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
// Use this function when you want to return the versions for a single record
|
|
115
|
+
getVersions() {
|
|
116
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
117
|
+
return yield this._getVersions(this.moduleName, this.entityName, this.sourceRecord.id);
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
// Use this function when you want to return the change history for a single record
|
|
121
|
+
getRevisionTimeline() {
|
|
122
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
123
|
+
return yield this._getRevisionTimeline(this.moduleName, this.entityName, this.sourceRecord.id);
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
exports.CaseActionApi = CaseActionApi;
|
|
@@ -8,9 +8,12 @@ export declare class CaseApi extends ApiProvider {
|
|
|
8
8
|
private readonly moduleName;
|
|
9
9
|
private readonly entityName;
|
|
10
10
|
private sourceRecord;
|
|
11
|
+
readonly caseowner: ApiRecordLinkManager;
|
|
12
|
+
readonly case__user: ApiRecordLinkManager;
|
|
13
|
+
readonly casecollaborators: ApiRecordLinkManager;
|
|
11
14
|
readonly case: ApiRecordLinkManager;
|
|
12
15
|
readonly file: ApiRecordLinkManager;
|
|
13
|
-
readonly
|
|
16
|
+
readonly caseaction: ApiRecordLinkManager;
|
|
14
17
|
readonly order: ApiRecordLinkManager;
|
|
15
18
|
readonly workorder: ApiRecordLinkManager;
|
|
16
19
|
readonly note: ApiRecordLinkManager;
|
|
@@ -19,7 +22,10 @@ export declare class CaseApi extends ApiProvider {
|
|
|
19
22
|
readonly call: ApiRecordLinkManager;
|
|
20
23
|
readonly queue: ApiRecordLinkManager;
|
|
21
24
|
readonly queuechange: ApiRecordLinkManager;
|
|
22
|
-
readonly
|
|
25
|
+
readonly team: ApiRecordLinkManager;
|
|
26
|
+
readonly contact: ApiRecordLinkManager;
|
|
27
|
+
readonly email: ApiRecordLinkManager;
|
|
28
|
+
readonly conversation: ApiRecordLinkManager;
|
|
23
29
|
constructor(authParams?: OauthParams, authToken?: string);
|
|
24
30
|
setRecord(sourceRecord: any): void;
|
|
25
31
|
schema(): Promise<import("@d19n/odin-types/dist/types/odin.types").OdinSchema>;
|
|
@@ -18,9 +18,12 @@ class CaseApi extends api_provider_1.ApiProvider {
|
|
|
18
18
|
this.authToken = authToken;
|
|
19
19
|
this.moduleName = 'SupportModule';
|
|
20
20
|
this.entityName = 'Case';
|
|
21
|
+
this.caseowner = new api_record_link_manager_1.ApiRecordLinkManager('SupportModule:Case', 'IdentityModule:User', 'CaseOwner');
|
|
22
|
+
this.case__user = new api_record_link_manager_1.ApiRecordLinkManager('SupportModule:Case', 'IdentityModule:User', 'Case__User');
|
|
23
|
+
this.casecollaborators = new api_record_link_manager_1.ApiRecordLinkManager('SupportModule:Case', 'IdentityModule:User', 'CaseCollaborators');
|
|
21
24
|
this.case = new api_record_link_manager_1.ApiRecordLinkManager('SupportModule:Case', 'SupportModule:Case', 'Case__Case');
|
|
22
25
|
this.file = new api_record_link_manager_1.ApiRecordLinkManager('SupportModule:Case', 'SchemaModule:File', 'Case__File');
|
|
23
|
-
this.
|
|
26
|
+
this.caseaction = new api_record_link_manager_1.ApiRecordLinkManager('SupportModule:Case', 'SupportModule:CaseAction', 'Case__CaseAction');
|
|
24
27
|
this.order = new api_record_link_manager_1.ApiRecordLinkManager('SupportModule:Case', 'OrderModule:Order', 'Case__Order');
|
|
25
28
|
this.workorder = new api_record_link_manager_1.ApiRecordLinkManager('SupportModule:Case', 'FieldServiceModule:WorkOrder', 'Case__WorkOrder');
|
|
26
29
|
this.note = new api_record_link_manager_1.ApiRecordLinkManager('SupportModule:Case', 'SupportModule:Note', 'Case__Note');
|
|
@@ -29,7 +32,10 @@ class CaseApi extends api_provider_1.ApiProvider {
|
|
|
29
32
|
this.call = new api_record_link_manager_1.ApiRecordLinkManager('SupportModule:Case', 'NotificationModule:Call', 'Call__Case');
|
|
30
33
|
this.queue = new api_record_link_manager_1.ApiRecordLinkManager('SupportModule:Case', 'SupportModule:Queue', 'Queue__Case');
|
|
31
34
|
this.queuechange = new api_record_link_manager_1.ApiRecordLinkManager('SupportModule:Case', 'SupportModule:QueueChange', 'Case__QueueChange');
|
|
32
|
-
this.
|
|
35
|
+
this.team = new api_record_link_manager_1.ApiRecordLinkManager('SupportModule:Case', 'IdentityModule:Team', 'Case_Team');
|
|
36
|
+
this.contact = new api_record_link_manager_1.ApiRecordLinkManager('SupportModule:Case', 'CrmModule:Contact', 'Case__Contact');
|
|
37
|
+
this.email = new api_record_link_manager_1.ApiRecordLinkManager('SupportModule:Case', 'NotificationModule:Email', 'Case__Email');
|
|
38
|
+
this.conversation = new api_record_link_manager_1.ApiRecordLinkManager('SupportModule:Case', 'NotificationModule:Conversation', 'Case_Conversation');
|
|
33
39
|
}
|
|
34
40
|
setRecord(sourceRecord) {
|
|
35
41
|
this.sourceRecord = sourceRecord;
|
|
@@ -8,30 +8,31 @@ export declare class ContactApi extends ApiProvider {
|
|
|
8
8
|
private readonly moduleName;
|
|
9
9
|
private readonly entityName;
|
|
10
10
|
private sourceRecord;
|
|
11
|
-
readonly
|
|
12
|
-
readonly
|
|
11
|
+
readonly organization__contact: ApiRecordLinkManager;
|
|
12
|
+
readonly billingcontact: ApiRecordLinkManager;
|
|
13
|
+
readonly workorder__contact: ApiRecordLinkManager;
|
|
14
|
+
readonly order__contact: ApiRecordLinkManager;
|
|
15
|
+
readonly lead__contact: ApiRecordLinkManager;
|
|
16
|
+
readonly invoice__contact: ApiRecordLinkManager;
|
|
17
|
+
readonly commission__contact: ApiRecordLinkManager;
|
|
18
|
+
readonly contact__contact: ApiRecordLinkManager;
|
|
19
|
+
readonly onetouchswitch__contact: ApiRecordLinkManager;
|
|
20
|
+
readonly deactivationapproval__contact: ApiRecordLinkManager;
|
|
21
|
+
readonly orderremediationtask__contact: ApiRecordLinkManager;
|
|
22
|
+
readonly call__contact: ApiRecordLinkManager;
|
|
23
|
+
readonly fingerprint__contact: ApiRecordLinkManager;
|
|
24
|
+
readonly case__contact: ApiRecordLinkManager;
|
|
25
|
+
readonly email_contact: ApiRecordLinkManager;
|
|
13
26
|
readonly activity: ApiRecordLinkManager;
|
|
14
27
|
readonly note: ApiRecordLinkManager;
|
|
15
|
-
readonly workorder: ApiRecordLinkManager;
|
|
16
|
-
readonly order: ApiRecordLinkManager;
|
|
17
|
-
readonly lead: ApiRecordLinkManager;
|
|
18
28
|
readonly address: ApiRecordLinkManager;
|
|
19
29
|
readonly smsmessage: ApiRecordLinkManager;
|
|
20
|
-
readonly invoice: ApiRecordLinkManager;
|
|
21
30
|
readonly billingrequest: ApiRecordLinkManager;
|
|
22
31
|
readonly file: ApiRecordLinkManager;
|
|
23
|
-
readonly commission: ApiRecordLinkManager;
|
|
24
|
-
readonly contact: ApiRecordLinkManager;
|
|
25
|
-
readonly onetouchswitch: ApiRecordLinkManager;
|
|
26
32
|
readonly contactidentity: ApiRecordLinkManager;
|
|
27
33
|
readonly paymentmethodrefund: ApiRecordLinkManager;
|
|
28
|
-
readonly deactivationapproval: ApiRecordLinkManager;
|
|
29
34
|
readonly phonenumber: ApiRecordLinkManager;
|
|
30
|
-
readonly orderremediationtask: ApiRecordLinkManager;
|
|
31
|
-
readonly case: ApiRecordLinkManager;
|
|
32
35
|
readonly appointment: ApiRecordLinkManager;
|
|
33
|
-
readonly call: ApiRecordLinkManager;
|
|
34
|
-
readonly fingerprint: ApiRecordLinkManager;
|
|
35
36
|
readonly paymentmethod: ApiRecordLinkManager;
|
|
36
37
|
constructor(authParams?: OauthParams, authToken?: string);
|
|
37
38
|
setRecord(sourceRecord: any): void;
|
|
@@ -18,30 +18,31 @@ class ContactApi extends api_provider_1.ApiProvider {
|
|
|
18
18
|
this.authToken = authToken;
|
|
19
19
|
this.moduleName = 'CrmModule';
|
|
20
20
|
this.entityName = 'Contact';
|
|
21
|
-
this.
|
|
22
|
-
this.
|
|
21
|
+
this.organization__contact = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'CrmModule:Contact', 'Organization__Contact');
|
|
22
|
+
this.billingcontact = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'CrmModule:Contact', 'BillingContact');
|
|
23
|
+
this.workorder__contact = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'CrmModule:Contact', 'WorkOrder__Contact');
|
|
24
|
+
this.order__contact = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'CrmModule:Contact', 'Order__Contact');
|
|
25
|
+
this.lead__contact = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'CrmModule:Contact', 'Lead__Contact');
|
|
26
|
+
this.invoice__contact = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'CrmModule:Contact', 'Invoice__Contact');
|
|
27
|
+
this.commission__contact = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'CrmModule:Contact', 'Commission__Contact');
|
|
28
|
+
this.contact__contact = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'CrmModule:Contact', 'Contact__Contact');
|
|
29
|
+
this.onetouchswitch__contact = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'CrmModule:Contact', 'OneTouchSwitch__Contact');
|
|
30
|
+
this.deactivationapproval__contact = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'CrmModule:Contact', 'DeactivationApproval__Contact');
|
|
31
|
+
this.orderremediationtask__contact = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'CrmModule:Contact', 'OrderRemediationTask__Contact');
|
|
32
|
+
this.call__contact = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'CrmModule:Contact', 'Call__Contact');
|
|
33
|
+
this.fingerprint__contact = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'CrmModule:Contact', 'Fingerprint__Contact');
|
|
34
|
+
this.case__contact = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'CrmModule:Contact', 'Case__Contact');
|
|
35
|
+
this.email_contact = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'CrmModule:Contact', 'Email_Contact');
|
|
23
36
|
this.activity = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'SchemaModule:Activity', 'Contact__Activity');
|
|
24
37
|
this.note = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'SupportModule:Note', 'Contact__Note');
|
|
25
|
-
this.workorder = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'FieldServiceModule:WorkOrder', 'WorkOrder__Contact');
|
|
26
|
-
this.order = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'OrderModule:Order', 'Order__Contact');
|
|
27
|
-
this.lead = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'CrmModule:Lead', 'Lead__Contact');
|
|
28
38
|
this.address = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'CrmModule:Address', 'Contact__Address');
|
|
29
39
|
this.smsmessage = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'NotificationModule:SmsMessage', 'Contact__SmsMessage');
|
|
30
|
-
this.invoice = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'BillingModule:Invoice', 'Invoice__Contact');
|
|
31
40
|
this.billingrequest = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'BillingModule:BillingRequest', 'Contact__BillingRequest');
|
|
32
41
|
this.file = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'SchemaModule:File', 'Contact__File');
|
|
33
|
-
this.commission = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'BillingModule:Commission', 'Commission__Contact');
|
|
34
|
-
this.contact = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'CrmModule:Contact', 'Contact__Contact');
|
|
35
|
-
this.onetouchswitch = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'OrderModule:OneTouchSwitch', 'OneTouchSwitch__Contact');
|
|
36
42
|
this.contactidentity = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'CrmModule:ContactIdentity', 'Contact__ContactIdentity');
|
|
37
43
|
this.paymentmethodrefund = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'BillingModule:PaymentMethodRefund', 'Contact__PaymentMethodRefund');
|
|
38
|
-
this.deactivationapproval = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'OrderModule:DeactivationApproval', 'DeactivationApproval__Contact');
|
|
39
44
|
this.phonenumber = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'CrmModule:PhoneNumber', 'Contact__PhoneNumber');
|
|
40
|
-
this.orderremediationtask = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'OrderModule:OrderRemediationTask', 'OrderRemediationTask__Contact');
|
|
41
|
-
this.case = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'SupportModule:Case', 'Case__Contact');
|
|
42
45
|
this.appointment = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'CrmModule:Appointment', 'Contact__Appointment');
|
|
43
|
-
this.call = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'NotificationModule:Call', 'Call__Contact');
|
|
44
|
-
this.fingerprint = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'CrmModule:Fingerprint', 'Fingerprint__Contact');
|
|
45
46
|
this.paymentmethod = new api_record_link_manager_1.ApiRecordLinkManager('CrmModule:Contact', 'BillingModule:PaymentMethod', 'Contact__PaymentMethod');
|
|
46
47
|
}
|
|
47
48
|
setRecord(sourceRecord) {
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { OauthParams } from '@d19n/odin-sdk-generator/dist/api.interfaces';
|
|
2
|
+
import { ApiProvider } from '@d19n/odin-sdk-generator/dist/api.provider';
|
|
3
|
+
import { OdinSearchV2 } from '@d19n/odin-types/dist/interfaces/v2.db.interfaces';
|
|
4
|
+
import { OdinRecordCreateDto, OdinRecordUpdateDto } from '@d19n/odin-types/dist/dtos/odin.dtos';
|
|
5
|
+
import { ApiRecordLinkManager } from '@d19n/odin-sdk-generator/dist/api.record.link.manager';
|
|
6
|
+
export declare class ConversationApi extends ApiProvider {
|
|
7
|
+
protected readonly authToken?: string;
|
|
8
|
+
private readonly moduleName;
|
|
9
|
+
private readonly entityName;
|
|
10
|
+
private sourceRecord;
|
|
11
|
+
readonly message: ApiRecordLinkManager;
|
|
12
|
+
readonly case: ApiRecordLinkManager;
|
|
13
|
+
constructor(authParams?: OauthParams, authToken?: string);
|
|
14
|
+
setRecord(sourceRecord: any): void;
|
|
15
|
+
schema(): Promise<import("@d19n/odin-types/dist/types/odin.types").OdinSchema>;
|
|
16
|
+
search(params: Partial<OdinSearchV2>): Promise<import("@d19n/odin-sdk-generator/dist/api.interfaces").OdinSearchResponse<any>>;
|
|
17
|
+
searchAndPaginate(params: Partial<OdinSearchV2>): Promise<import("@d19n/odin-sdk-generator/dist/api.interfaces").OdinSearchResponse<any>>;
|
|
18
|
+
reIndex(body: {
|
|
19
|
+
id: string;
|
|
20
|
+
schemaId: string;
|
|
21
|
+
}[]): Promise<any>;
|
|
22
|
+
get(conversationId: string): Promise<any>;
|
|
23
|
+
getMany(conversationIds: string[]): Promise<any[]>;
|
|
24
|
+
upsert(upsertDto: OdinRecordCreateDto): Promise<any>;
|
|
25
|
+
upsertMany(upsertDtos: OdinRecordCreateDto[]): Promise<any[]>;
|
|
26
|
+
update(updateDto: OdinRecordUpdateDto): Promise<any>;
|
|
27
|
+
updateMany(updateDtos: OdinRecordUpdateDto[]): Promise<any[]>;
|
|
28
|
+
delete(conversationId: string): Promise<import("@d19n/odin-types/dist/types/odin.types").OdinDeleteResponse>;
|
|
29
|
+
deleteMany(conversationIds: string[]): Promise<import("@d19n/odin-types/dist/types/odin.types").OdinDeleteResponse[]>;
|
|
30
|
+
restore(conversationIds: string[]): Promise<import("@d19n/odin-types/dist/types/odin.types").OdinRestoreResponse[]>;
|
|
31
|
+
applyAction(actionName: string, dtos: any[]): Promise<any[]>;
|
|
32
|
+
getVersions(): Promise<{
|
|
33
|
+
[key: string]: Record<string, any>;
|
|
34
|
+
}>;
|
|
35
|
+
getRevisionTimeline(): Promise<{
|
|
36
|
+
[key: string]: Record<string, any>[];
|
|
37
|
+
}>;
|
|
38
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ConversationApi = void 0;
|
|
13
|
+
const api_provider_1 = require("@d19n/odin-sdk-generator/dist/api.provider");
|
|
14
|
+
const api_record_link_manager_1 = require("@d19n/odin-sdk-generator/dist/api.record.link.manager");
|
|
15
|
+
class ConversationApi extends api_provider_1.ApiProvider {
|
|
16
|
+
constructor(authParams, authToken) {
|
|
17
|
+
super(authParams, authToken);
|
|
18
|
+
this.authToken = authToken;
|
|
19
|
+
this.moduleName = 'NotificationModule';
|
|
20
|
+
this.entityName = 'Conversation';
|
|
21
|
+
this.message = new api_record_link_manager_1.ApiRecordLinkManager('NotificationModule:Conversation', 'NotificationModule:Message', 'Conversation_Message');
|
|
22
|
+
this.case = new api_record_link_manager_1.ApiRecordLinkManager('NotificationModule:Conversation', 'SupportModule:Case', 'Case_Conversation');
|
|
23
|
+
}
|
|
24
|
+
setRecord(sourceRecord) {
|
|
25
|
+
this.sourceRecord = sourceRecord;
|
|
26
|
+
}
|
|
27
|
+
schema() {
|
|
28
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
return yield this.getSchema(this.moduleName, this.entityName);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
// Use this function when you want to search and handle all pagination on your own
|
|
33
|
+
search(params) {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
return yield this._searchRecords(this.moduleName, this.entityName, params);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
// Use this function when you want paginating through the results to be handled
|
|
39
|
+
searchAndPaginate(params) {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
return yield this._searchAllRecordsAndPaginate(this.moduleName, this.entityName, params);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
// Use this function to re-index records in elastic search
|
|
45
|
+
reIndex(body) {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
return yield this._reIndexRecords(body);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
// Use this function when you want to return a single record
|
|
51
|
+
get(conversationId) {
|
|
52
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
const res = yield this._getByPrimaryKey(this.moduleName, this.entityName, conversationId);
|
|
54
|
+
this.setRecord(res);
|
|
55
|
+
return res;
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
// Use this function when you want to return many records by primaryKeys
|
|
59
|
+
getMany(conversationIds) {
|
|
60
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
return yield this._getManyByPrimaryKey(this.moduleName, this.entityName, conversationIds);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
// Use this function when you want to upsert one record
|
|
65
|
+
upsert(upsertDto) {
|
|
66
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
const res = yield this._upsert(this.moduleName, this.entityName, [upsertDto]);
|
|
68
|
+
return res[0];
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
// Use this function when you want to upsert many records
|
|
72
|
+
upsertMany(upsertDtos) {
|
|
73
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
return yield this._upsert(this.moduleName, this.entityName, upsertDtos);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
// Use this function when you want to update one record
|
|
78
|
+
update(updateDto) {
|
|
79
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
+
const res = yield this._update(this.moduleName, this.entityName, [updateDto]);
|
|
81
|
+
return res[0];
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
// Use this function when you want to update many records
|
|
85
|
+
updateMany(updateDtos) {
|
|
86
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
87
|
+
return yield this._update(this.moduleName, this.entityName, updateDtos);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
// Use this function when you want to delete one record
|
|
91
|
+
delete(conversationId) {
|
|
92
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
93
|
+
const res = yield this._delete(this.moduleName, this.entityName, [conversationId]);
|
|
94
|
+
return res[0];
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
// Use this function when you want to delete many records
|
|
98
|
+
deleteMany(conversationIds) {
|
|
99
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
+
return yield this._delete(this.moduleName, this.entityName, conversationIds);
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
// Use this function when you want to restore one or many records
|
|
104
|
+
restore(conversationIds) {
|
|
105
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
106
|
+
return yield this._restore(this.moduleName, this.entityName, conversationIds);
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
// Use this function when you want to apply actions
|
|
110
|
+
applyAction(actionName, dtos) {
|
|
111
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
112
|
+
return yield this._applyAction(this.moduleName, this.entityName, actionName, dtos);
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
// Use this function when you want to return the versions for a single record
|
|
116
|
+
getVersions() {
|
|
117
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
118
|
+
return yield this._getVersions(this.moduleName, this.entityName, this.sourceRecord.id);
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
// Use this function when you want to return the change history for a single record
|
|
122
|
+
getRevisionTimeline() {
|
|
123
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
124
|
+
return yield this._getRevisionTimeline(this.moduleName, this.entityName, this.sourceRecord.id);
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
exports.ConversationApi = ConversationApi;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { OauthParams } from '@d19n/odin-sdk-generator/dist/api.interfaces';
|
|
2
|
+
import { ApiProvider } from '@d19n/odin-sdk-generator/dist/api.provider';
|
|
3
|
+
import { OdinSearchV2 } from '@d19n/odin-types/dist/interfaces/v2.db.interfaces';
|
|
4
|
+
import { OdinRecordCreateDto, OdinRecordUpdateDto } from '@d19n/odin-types/dist/dtos/odin.dtos';
|
|
5
|
+
import { ApiRecordLinkManager } from '@d19n/odin-sdk-generator/dist/api.record.link.manager';
|
|
6
|
+
export declare class EmailApi extends ApiProvider {
|
|
7
|
+
protected readonly authToken?: string;
|
|
8
|
+
private readonly moduleName;
|
|
9
|
+
private readonly entityName;
|
|
10
|
+
private sourceRecord;
|
|
11
|
+
readonly email: ApiRecordLinkManager;
|
|
12
|
+
readonly case: ApiRecordLinkManager;
|
|
13
|
+
readonly contact: ApiRecordLinkManager;
|
|
14
|
+
readonly user: ApiRecordLinkManager;
|
|
15
|
+
constructor(authParams?: OauthParams, authToken?: string);
|
|
16
|
+
setRecord(sourceRecord: any): void;
|
|
17
|
+
schema(): Promise<import("@d19n/odin-types/dist/types/odin.types").OdinSchema>;
|
|
18
|
+
search(params: Partial<OdinSearchV2>): Promise<import("@d19n/odin-sdk-generator/dist/api.interfaces").OdinSearchResponse<any>>;
|
|
19
|
+
searchAndPaginate(params: Partial<OdinSearchV2>): Promise<import("@d19n/odin-sdk-generator/dist/api.interfaces").OdinSearchResponse<any>>;
|
|
20
|
+
reIndex(body: {
|
|
21
|
+
id: string;
|
|
22
|
+
schemaId: string;
|
|
23
|
+
}[]): Promise<any>;
|
|
24
|
+
get(emailId: string): Promise<any>;
|
|
25
|
+
getMany(emailIds: string[]): Promise<any[]>;
|
|
26
|
+
upsert(upsertDto: OdinRecordCreateDto): Promise<any>;
|
|
27
|
+
upsertMany(upsertDtos: OdinRecordCreateDto[]): Promise<any[]>;
|
|
28
|
+
update(updateDto: OdinRecordUpdateDto): Promise<any>;
|
|
29
|
+
updateMany(updateDtos: OdinRecordUpdateDto[]): Promise<any[]>;
|
|
30
|
+
delete(emailId: string): Promise<import("@d19n/odin-types/dist/types/odin.types").OdinDeleteResponse>;
|
|
31
|
+
deleteMany(emailIds: string[]): Promise<import("@d19n/odin-types/dist/types/odin.types").OdinDeleteResponse[]>;
|
|
32
|
+
restore(emailIds: string[]): Promise<import("@d19n/odin-types/dist/types/odin.types").OdinRestoreResponse[]>;
|
|
33
|
+
applyAction(actionName: string, dtos: any[]): Promise<any[]>;
|
|
34
|
+
getVersions(): Promise<{
|
|
35
|
+
[key: string]: Record<string, any>;
|
|
36
|
+
}>;
|
|
37
|
+
getRevisionTimeline(): Promise<{
|
|
38
|
+
[key: string]: Record<string, any>[];
|
|
39
|
+
}>;
|
|
40
|
+
}
|