@hahnpro/hpc-api 2026.2.7 → 2026.4.1
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/CHANGELOG.md +6 -1
- package/package.json +2 -2
- package/src/lib/api.d.ts +2 -1
- package/src/lib/api.js +1 -0
- package/src/lib/interfaces/crm.interface.d.ts +107 -0
- package/src/lib/interfaces/crm.interface.js +2 -0
- package/src/lib/interfaces/index.d.ts +1 -0
- package/src/lib/interfaces/reference.interface.d.ts +3 -4
- package/src/lib/interfaces/reference.interface.js +3 -4
- package/src/lib/mock/api.mock.d.ts +2 -1
- package/src/lib/mock/api.mock.js +1 -0
- package/src/lib/mock/asset.mock.service.d.ts +1 -1
- package/src/lib/mock/crm.mock.service.d.ts +9 -0
- package/src/lib/mock/crm.mock.service.js +51 -0
- package/src/lib/mock/index.d.ts +1 -0
- package/src/lib/mock/index.js +3 -1
- package/src/lib/mock/object-reference.mock.service.d.ts +2 -2
- package/src/lib/mock/object-reference.mock.service.js +1 -1
- package/src/lib/services/asset.service.d.ts +1 -1
- package/src/lib/services/crm.service.d.ts +10 -0
- package/src/lib/services/crm.service.js +24 -0
- package/src/lib/services/index.d.ts +1 -0
- package/src/lib/services/index.js +3 -1
- package/src/lib/services/object-reference.service.d.ts +2 -2
- package/src/lib/services/object-reference.service.js +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
# @hahnpro/hpc-api
|
|
2
2
|
|
|
3
|
+
# 2026.4.1
|
|
4
|
+
|
|
5
|
+
- Added CRM API client methods for the standalone CRM service
|
|
6
|
+
|
|
3
7
|
# 2026.2.7
|
|
4
|
-
|
|
8
|
+
|
|
9
|
+
- Added enums: AgentId, AiAssistantId and Type ToolNameType with enums ToolName, ReturnToReferrerTool and HandOffTool
|
|
5
10
|
|
|
6
11
|
# 2026.2.6
|
|
7
12
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hahnpro/hpc-api",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.4.1",
|
|
4
4
|
"description": "Module for easy access to the HahnPRO Cloud API",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@microsoft/fetch-event-source": "2.0.1",
|
|
12
|
-
"axios": "1.
|
|
12
|
+
"axios": "1.14.0",
|
|
13
13
|
"eventsource": "4.1.0",
|
|
14
14
|
"jose": "5.10.0",
|
|
15
15
|
"jwt-decode": "4.0.0",
|
package/src/lib/api.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { QueueOptions } from './queue';
|
|
2
|
-
import { AiService, AlertService, AssetService, AssetTypesService, ContentService, EndpointService, EventService, FlowDeploymentService, FlowFunctionService, FlowModuleService, FlowService, HttpClientService, LabelService, NotificationRuleService, NotificationService, ObjectReferenceService, OrganizationsAdministrationService, OrganizationsResourcesService, OrganizationsService, ProxyService, SearchService, TaskService, TimeSeriesService, UserService, VaultService } from './services';
|
|
2
|
+
import { AiService, AlertService, AssetService, AssetTypesService, ContentService, CrmService, EndpointService, EventService, FlowDeploymentService, FlowFunctionService, FlowModuleService, FlowService, HttpClientService, LabelService, NotificationRuleService, NotificationService, ObjectReferenceService, OrganizationsAdministrationService, OrganizationsResourcesService, OrganizationsService, ProxyService, SearchService, TaskService, TimeSeriesService, UserService, VaultService } from './services';
|
|
3
3
|
export declare class API {
|
|
4
4
|
readonly httpClient?: HttpClientService;
|
|
5
5
|
ai: AiService;
|
|
@@ -7,6 +7,7 @@ export declare class API {
|
|
|
7
7
|
assets: AssetService;
|
|
8
8
|
assetTypes: AssetTypesService;
|
|
9
9
|
contents: ContentService;
|
|
10
|
+
crm: CrmService;
|
|
10
11
|
endpoints: EndpointService;
|
|
11
12
|
events: EventService;
|
|
12
13
|
flows: FlowService;
|
package/src/lib/api.js
CHANGED
|
@@ -39,6 +39,7 @@ class API {
|
|
|
39
39
|
this.assets = new services_1.AssetService(this.httpClient);
|
|
40
40
|
this.assetTypes = new services_1.AssetTypesService(this.httpClient);
|
|
41
41
|
this.contents = new services_1.ContentService(this.httpClient);
|
|
42
|
+
this.crm = new services_1.CrmService(this.httpClient);
|
|
42
43
|
this.endpoints = new services_1.EndpointService(this.httpClient);
|
|
43
44
|
this.events = new services_1.EventService(this.httpClient);
|
|
44
45
|
this.flows = new services_1.FlowService(this.httpClient);
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
export type CrmImportParser = 'auto' | 'sharepoint';
|
|
2
|
+
export interface CrmImportJsonRequest {
|
|
3
|
+
csv: string;
|
|
4
|
+
parser?: CrmImportParser;
|
|
5
|
+
}
|
|
6
|
+
export interface ReportSummary {
|
|
7
|
+
title: string;
|
|
8
|
+
pageViews: number;
|
|
9
|
+
registeredParticipants: number;
|
|
10
|
+
cancelledRegistrations: number;
|
|
11
|
+
attendees: number;
|
|
12
|
+
startTime: string | null;
|
|
13
|
+
endTime: string | null;
|
|
14
|
+
duration: string;
|
|
15
|
+
averageAttendanceTime: string;
|
|
16
|
+
}
|
|
17
|
+
export interface ReportParticipant {
|
|
18
|
+
name: string;
|
|
19
|
+
firstJoin: string | null;
|
|
20
|
+
lastLeave: string | null;
|
|
21
|
+
meetingDuration: string | null;
|
|
22
|
+
email: string | null;
|
|
23
|
+
participantId: string | null;
|
|
24
|
+
role: string | null;
|
|
25
|
+
registrationFirstName: string | null;
|
|
26
|
+
registrationLastName: string | null;
|
|
27
|
+
registrationEmail: string | null;
|
|
28
|
+
registrationTime: string | null;
|
|
29
|
+
registrationStatus: string | null;
|
|
30
|
+
organization: string | null;
|
|
31
|
+
position: string | null;
|
|
32
|
+
phone: string | null;
|
|
33
|
+
}
|
|
34
|
+
export interface ReportActivity {
|
|
35
|
+
name: string;
|
|
36
|
+
joinTime: string | null;
|
|
37
|
+
leaveTime: string | null;
|
|
38
|
+
duration: string | null;
|
|
39
|
+
email: string | null;
|
|
40
|
+
role: string | null;
|
|
41
|
+
}
|
|
42
|
+
export interface MeetingReport {
|
|
43
|
+
summary: ReportSummary;
|
|
44
|
+
participants: ReportParticipant[];
|
|
45
|
+
activities: ReportActivity[];
|
|
46
|
+
}
|
|
47
|
+
export interface TouchpointCandidate {
|
|
48
|
+
name: string;
|
|
49
|
+
date: string | null;
|
|
50
|
+
duration?: string;
|
|
51
|
+
touchpointType: string;
|
|
52
|
+
participantEmails: string[];
|
|
53
|
+
attendeeCount: number;
|
|
54
|
+
source: string;
|
|
55
|
+
sourceId: string;
|
|
56
|
+
}
|
|
57
|
+
export interface ContactCandidate {
|
|
58
|
+
name: string;
|
|
59
|
+
firstName?: string;
|
|
60
|
+
lastName?: string;
|
|
61
|
+
email?: string;
|
|
62
|
+
domain?: string;
|
|
63
|
+
role?: string;
|
|
64
|
+
source: string;
|
|
65
|
+
sourceId: string;
|
|
66
|
+
isPublicProvider: boolean;
|
|
67
|
+
}
|
|
68
|
+
export interface CompanyCandidate {
|
|
69
|
+
name: string;
|
|
70
|
+
normalizedName: string;
|
|
71
|
+
domain: string;
|
|
72
|
+
contactEmails: string[];
|
|
73
|
+
source: string;
|
|
74
|
+
sourceId: string;
|
|
75
|
+
}
|
|
76
|
+
export interface MatchResult {
|
|
77
|
+
found: boolean;
|
|
78
|
+
assetId?: string;
|
|
79
|
+
action: 'create' | 'update' | 'skip';
|
|
80
|
+
}
|
|
81
|
+
export interface ImportResultStats {
|
|
82
|
+
contacts: number;
|
|
83
|
+
companies: number;
|
|
84
|
+
touchpoints: number;
|
|
85
|
+
}
|
|
86
|
+
export interface ImportResult {
|
|
87
|
+
created: ImportResultStats;
|
|
88
|
+
updated: ImportResultStats;
|
|
89
|
+
skipped: ImportResultStats;
|
|
90
|
+
errors: unknown[];
|
|
91
|
+
warnings: unknown[];
|
|
92
|
+
startTime: string;
|
|
93
|
+
endTime: string;
|
|
94
|
+
durationMs: number;
|
|
95
|
+
}
|
|
96
|
+
export interface CrmImportResponse {
|
|
97
|
+
report: MeetingReport;
|
|
98
|
+
touchpoints: TouchpointCandidate[];
|
|
99
|
+
contacts: ContactCandidate[];
|
|
100
|
+
companies: CompanyCandidate[];
|
|
101
|
+
contactMatches: Record<string, MatchResult>;
|
|
102
|
+
companyMatches: Record<string, MatchResult>;
|
|
103
|
+
companyAssetIds: Record<string, string>;
|
|
104
|
+
contactAssetIds: Record<string, string>;
|
|
105
|
+
touchpointAssetIds: Record<string, string>;
|
|
106
|
+
importResult: ImportResult;
|
|
107
|
+
}
|
|
@@ -4,6 +4,7 @@ export type { Api } from './api.interface';
|
|
|
4
4
|
export type { AddToProperty, Asset, AssetRevision, AssetType, AssetTypeRevision, Attachment, EventCause, EventLevelOverride, RemoveFromProperty, Template, } from './asset.interface';
|
|
5
5
|
export type { Author } from './author.interface';
|
|
6
6
|
export type { Content, ContentAnalysis } from './content.interface';
|
|
7
|
+
export type { CrmImportJsonRequest, CrmImportParser, CrmImportResponse } from './crm.interface';
|
|
7
8
|
export type { DataInterface, Filter, Paginated, RequestParameter } from './data.interface';
|
|
8
9
|
export type { Endpoint, EndpointLog, NotificationPayload } from './endpoint.interface';
|
|
9
10
|
export type { CreateEventDto, Event, EventCountByAsset } from './event.interface';
|
|
@@ -14,11 +14,10 @@ export declare enum ObjectReferenceType {
|
|
|
14
14
|
*/
|
|
15
15
|
UPDATED_BY_THREAD = "updated_by_thread",
|
|
16
16
|
/**
|
|
17
|
-
* Marks an Object as being part of the 'Weber Engineering Flange Skill
|
|
18
|
-
* examination, in which they participate.
|
|
17
|
+
* Marks an Object as being part of the 'Weber Engineering - Flange Skill Control' to link the assets
|
|
19
18
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
FLANGE_SKILL_CONTROL_EXAMINEE_BOOKED_TIME_SLOT_IN_EXAMINATION = "flange_skill_control_examinee_booked_time_slot_in_examination",
|
|
20
|
+
FLANGE_SKILL_CONTROL_EXAMINATION_BOOKED_TIME_SLOT = "flange_skill_control_examination_booked_time_slot"
|
|
22
21
|
}
|
|
23
22
|
export interface ObjectReference {
|
|
24
23
|
id: number;
|
|
@@ -18,9 +18,8 @@ var ObjectReferenceType;
|
|
|
18
18
|
*/
|
|
19
19
|
ObjectReferenceType["UPDATED_BY_THREAD"] = "updated_by_thread";
|
|
20
20
|
/**
|
|
21
|
-
* Marks an Object as being part of the 'Weber Engineering Flange Skill
|
|
22
|
-
* examination, in which they participate.
|
|
21
|
+
* Marks an Object as being part of the 'Weber Engineering - Flange Skill Control' to link the assets
|
|
23
22
|
*/
|
|
24
|
-
ObjectReferenceType["
|
|
25
|
-
ObjectReferenceType["
|
|
23
|
+
ObjectReferenceType["FLANGE_SKILL_CONTROL_EXAMINEE_BOOKED_TIME_SLOT_IN_EXAMINATION"] = "flange_skill_control_examinee_booked_time_slot_in_examination";
|
|
24
|
+
ObjectReferenceType["FLANGE_SKILL_CONTROL_EXAMINATION_BOOKED_TIME_SLOT"] = "flange_skill_control_examination_booked_time_slot";
|
|
26
25
|
})(ObjectReferenceType || (exports.ObjectReferenceType = ObjectReferenceType = {}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AiMockService, AlertMockService, AssetMockService, AssetTypesMockService, ContentMockService, EndpointMockService, EventMockService, FlowDeploymentMockService, FlowFunctionsMockService, FlowMockService, FlowModulesMockService, HttpClientMockService, LabelMockService, NotificationMockService, NotificationRulesMockService, ObjectReferenceMockService, OrganizationsAdministrationMockService, OrganizationsMockService, OrganizationsResourcesMockService, SearchMockService, TaskMockService, TimeseriesMockService, UserMockService, VaultMockService } from '.';
|
|
1
|
+
import { AiMockService, AlertMockService, AssetMockService, AssetTypesMockService, ContentMockService, CrmMockService, EndpointMockService, EventMockService, FlowDeploymentMockService, FlowFunctionsMockService, FlowMockService, FlowModulesMockService, HttpClientMockService, LabelMockService, NotificationMockService, NotificationRulesMockService, ObjectReferenceMockService, OrganizationsAdministrationMockService, OrganizationsMockService, OrganizationsResourcesMockService, SearchMockService, TaskMockService, TimeseriesMockService, UserMockService, VaultMockService } from '.';
|
|
2
2
|
import { API } from '../api';
|
|
3
3
|
import { Artifact, Asset, AssetRevision, AssetType, Content, Endpoint, Event, FlowDeployment, FlowDiagram, FlowDto, FlowFunctionDto, FlowFunctionRevision, FlowModule, FlowRevision, Label, Notification, ObjectReference, Organization, Secret, Task, TimeSeries, TimeSeriesValue, VaultSecret } from '../interfaces';
|
|
4
4
|
export interface MockAPIInitData {
|
|
@@ -31,6 +31,7 @@ export declare class MockAPI implements API {
|
|
|
31
31
|
assets: AssetMockService;
|
|
32
32
|
assetTypes: AssetTypesMockService;
|
|
33
33
|
contents: ContentMockService;
|
|
34
|
+
crm: CrmMockService;
|
|
34
35
|
endpoints: EndpointMockService;
|
|
35
36
|
events: EventMockService;
|
|
36
37
|
flows: FlowMockService;
|
package/src/lib/mock/api.mock.js
CHANGED
|
@@ -188,6 +188,7 @@ class MockAPI {
|
|
|
188
188
|
this.assets = new _1.AssetMockService(this, assets1, assetRevisions1);
|
|
189
189
|
this.assetTypes = new _1.AssetTypesMockService(assetTypes, []);
|
|
190
190
|
this.contents = new _1.ContentMockService(contents1, contentData);
|
|
191
|
+
this.crm = new _1.CrmMockService();
|
|
191
192
|
this.endpoints = new _1.EndpointMockService(endpoint1);
|
|
192
193
|
this.events = new _1.EventMockService(events1);
|
|
193
194
|
this.flows = new _1.FlowMockService(flows1, diagrams1, flowRevisions1);
|
|
@@ -35,6 +35,6 @@ export declare class AssetMockService extends BaseService implements AssetServic
|
|
|
35
35
|
}): Promise<void>;
|
|
36
36
|
search(query: string, params?: RequestParameter, options?: TokenOption & {
|
|
37
37
|
[key: string]: any;
|
|
38
|
-
}): Promise<SearchResult
|
|
38
|
+
}): Promise<SearchResult>;
|
|
39
39
|
}
|
|
40
40
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Config, TokenOption } from '../interfaces';
|
|
2
|
+
import { CrmImportParser, CrmImportResponse } from '../interfaces/crm.interface';
|
|
3
|
+
import { CrmService } from '../services/crm.service';
|
|
4
|
+
import { CrossPlatformFormData } from '../utils';
|
|
5
|
+
export declare class CrmMockService extends CrmService {
|
|
6
|
+
constructor();
|
|
7
|
+
importFile(_form: CrossPlatformFormData, _options?: Config): Promise<CrmImportResponse>;
|
|
8
|
+
importJson(_csv: string, _parser?: CrmImportParser, _options?: TokenOption): Promise<CrmImportResponse>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CrmMockService = void 0;
|
|
4
|
+
const crm_service_1 = require("../services/crm.service");
|
|
5
|
+
const http_client_mock_service_1 = require("./http-client.mock.service");
|
|
6
|
+
class CrmMockService extends crm_service_1.CrmService {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(new http_client_mock_service_1.HttpClientMockService());
|
|
9
|
+
}
|
|
10
|
+
async importFile(_form, _options = {}) {
|
|
11
|
+
return {
|
|
12
|
+
report: {
|
|
13
|
+
summary: {
|
|
14
|
+
title: 'Mock Meeting',
|
|
15
|
+
pageViews: 0,
|
|
16
|
+
registeredParticipants: 0,
|
|
17
|
+
cancelledRegistrations: 0,
|
|
18
|
+
attendees: 0,
|
|
19
|
+
startTime: new Date().toISOString(),
|
|
20
|
+
endTime: new Date().toISOString(),
|
|
21
|
+
duration: '0:00:00',
|
|
22
|
+
averageAttendanceTime: '0:00:00',
|
|
23
|
+
},
|
|
24
|
+
participants: [],
|
|
25
|
+
activities: [],
|
|
26
|
+
},
|
|
27
|
+
touchpoints: [],
|
|
28
|
+
contacts: [],
|
|
29
|
+
companies: [],
|
|
30
|
+
contactMatches: {},
|
|
31
|
+
companyMatches: {},
|
|
32
|
+
companyAssetIds: {},
|
|
33
|
+
contactAssetIds: {},
|
|
34
|
+
touchpointAssetIds: {},
|
|
35
|
+
importResult: {
|
|
36
|
+
created: { contacts: 0, companies: 0, touchpoints: 0 },
|
|
37
|
+
updated: { contacts: 0, companies: 0, touchpoints: 0 },
|
|
38
|
+
skipped: { contacts: 0, companies: 0, touchpoints: 0 },
|
|
39
|
+
errors: [],
|
|
40
|
+
warnings: [],
|
|
41
|
+
startTime: new Date().toISOString(),
|
|
42
|
+
endTime: new Date().toISOString(),
|
|
43
|
+
durationMs: 0,
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
async importJson(_csv, _parser = 'auto', _options = {}) {
|
|
48
|
+
return this.importFile({ getHeaders: () => ({}) });
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.CrmMockService = CrmMockService;
|
package/src/lib/mock/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export { AlertMockService } from './alert.mock.service';
|
|
|
8
8
|
export { AssetMockService } from './asset.mock.service';
|
|
9
9
|
export { AssetTypesMockService } from './assetTypes.mock.service';
|
|
10
10
|
export { ContentMockService } from './content.mock.service';
|
|
11
|
+
export { CrmMockService } from './crm.mock.service';
|
|
11
12
|
export { EndpointMockService } from './endpoint.mock.service';
|
|
12
13
|
export { EventMockService } from './event.mock.service';
|
|
13
14
|
export { FlowDeploymentMockService } from './flow-deployment.mock.service';
|
package/src/lib/mock/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VaultMockService = exports.UserMockService = exports.TimeseriesMockService = exports.TaskMockService = exports.ShareMockService = exports.SearchMockService = exports.OrganizationsMockService = exports.OrganizationsResourcesMockService = exports.OrganizationsAdministrationMockService = exports.ObjectReferenceMockService = exports.NotificationMockService = exports.NotificationRulesMockService = exports.LabelMockService = exports.HttpClientMockService = exports.FlowMockService = exports.FlowModulesMockService = exports.FlowFunctionsMockService = exports.FlowDeploymentMockService = exports.EventMockService = exports.EndpointMockService = exports.ContentMockService = exports.AssetTypesMockService = exports.AssetMockService = exports.AlertMockService = exports.AiMockService = exports.TrashMockService = exports.DataMockService = exports.APIBaseMock = exports.sortData = void 0;
|
|
3
|
+
exports.VaultMockService = exports.UserMockService = exports.TimeseriesMockService = exports.TaskMockService = exports.ShareMockService = exports.SearchMockService = exports.OrganizationsMockService = exports.OrganizationsResourcesMockService = exports.OrganizationsAdministrationMockService = exports.ObjectReferenceMockService = exports.NotificationMockService = exports.NotificationRulesMockService = exports.LabelMockService = exports.HttpClientMockService = exports.FlowMockService = exports.FlowModulesMockService = exports.FlowFunctionsMockService = exports.FlowDeploymentMockService = exports.EventMockService = exports.EndpointMockService = exports.CrmMockService = exports.ContentMockService = exports.AssetTypesMockService = exports.AssetMockService = exports.AlertMockService = exports.AiMockService = exports.TrashMockService = exports.DataMockService = exports.APIBaseMock = exports.sortData = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
var utils_1 = require("./utils");
|
|
6
6
|
Object.defineProperty(exports, "sortData", { enumerable: true, get: function () { return utils_1.sortData; } });
|
|
@@ -21,6 +21,8 @@ var assetTypes_mock_service_1 = require("./assetTypes.mock.service");
|
|
|
21
21
|
Object.defineProperty(exports, "AssetTypesMockService", { enumerable: true, get: function () { return assetTypes_mock_service_1.AssetTypesMockService; } });
|
|
22
22
|
var content_mock_service_1 = require("./content.mock.service");
|
|
23
23
|
Object.defineProperty(exports, "ContentMockService", { enumerable: true, get: function () { return content_mock_service_1.ContentMockService; } });
|
|
24
|
+
var crm_mock_service_1 = require("./crm.mock.service");
|
|
25
|
+
Object.defineProperty(exports, "CrmMockService", { enumerable: true, get: function () { return crm_mock_service_1.CrmMockService; } });
|
|
24
26
|
var endpoint_mock_service_1 = require("./endpoint.mock.service");
|
|
25
27
|
Object.defineProperty(exports, "EndpointMockService", { enumerable: true, get: function () { return endpoint_mock_service_1.EndpointMockService; } });
|
|
26
28
|
var event_mock_service_1 = require("./event.mock.service");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { APIBaseMock } from '.';
|
|
2
2
|
import { CreateReferenceDto, ObjectReference, ObjectReferenceType, Paginated, ReferencesQuery, TokenOption } from '../interfaces';
|
|
3
3
|
import { ObjectReferenceService } from '../services/object-reference.service';
|
|
4
|
-
export declare class ObjectReferenceMockService extends
|
|
4
|
+
export declare class ObjectReferenceMockService extends APIBaseMock<ObjectReference> implements ObjectReferenceService {
|
|
5
5
|
constructor(initialData: ObjectReference[]);
|
|
6
6
|
find(query: ReferencesQuery, _options?: TokenOption): Promise<Paginated<ObjectReference>>;
|
|
7
7
|
findAll(objId: string, _options?: TokenOption): Promise<ObjectReference[]>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ObjectReferenceMockService = void 0;
|
|
4
4
|
const _1 = require(".");
|
|
5
|
-
class ObjectReferenceMockService extends _1.
|
|
5
|
+
class ObjectReferenceMockService extends _1.APIBaseMock {
|
|
6
6
|
constructor(initialData) {
|
|
7
7
|
super();
|
|
8
8
|
this.data = initialData;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { APIBase } from '../api-base';
|
|
2
|
+
import { Config, TokenOption } from '../interfaces';
|
|
3
|
+
import { CrmImportParser, CrmImportResponse } from '../interfaces/crm.interface';
|
|
4
|
+
import { CrossPlatformFormData } from '../utils';
|
|
5
|
+
import { HttpClientService } from './http-client.service';
|
|
6
|
+
export declare class CrmService extends APIBase {
|
|
7
|
+
constructor(httpClient: HttpClientService);
|
|
8
|
+
importFile(form: CrossPlatformFormData, options?: Config): Promise<CrmImportResponse>;
|
|
9
|
+
importJson(csv: string, parser?: CrmImportParser, options?: TokenOption): Promise<CrmImportResponse>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CrmService = void 0;
|
|
4
|
+
const api_base_1 = require("../api-base");
|
|
5
|
+
const utils_1 = require("../utils");
|
|
6
|
+
class CrmService extends api_base_1.APIBase {
|
|
7
|
+
constructor(httpClient) {
|
|
8
|
+
super(httpClient, '/crm');
|
|
9
|
+
}
|
|
10
|
+
importFile(form, options = {}) {
|
|
11
|
+
const headers = { ...(0, utils_1.getFormDataHeaders)(form), ...options.headers };
|
|
12
|
+
return this.httpClient.post(`${this.basePath}/import/file`, form, {
|
|
13
|
+
maxBodyLength: Infinity,
|
|
14
|
+
maxContentLength: Infinity,
|
|
15
|
+
...options,
|
|
16
|
+
headers,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
importJson(csv, parser = 'auto', options = {}) {
|
|
20
|
+
const dto = { csv, parser };
|
|
21
|
+
return this.httpClient.post(`${this.basePath}/import/json`, dto, options);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.CrmService = CrmService;
|
|
@@ -5,6 +5,7 @@ export { AlertService } from './alert.service';
|
|
|
5
5
|
export { AssetService } from './asset.service';
|
|
6
6
|
export { AssetTypesService } from './assettypes.service';
|
|
7
7
|
export { ContentService } from './content.service';
|
|
8
|
+
export { CrmService } from './crm.service';
|
|
8
9
|
export { EndpointService } from './endpoint.service';
|
|
9
10
|
export { EventService } from './event.service';
|
|
10
11
|
export { FlowService } from './flow.service';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.VaultService = exports.UserService = exports.TimeSeriesService = exports.TaskService = exports.ShareService = exports.SearchService = exports.ObjectReferenceService = exports.ProxyService = exports.OrganizationsResourcesService = exports.OrganizationsAdministrationService = exports.OrganizationsService = exports.NotificationService = exports.NotificationRuleService = exports.LabelService = exports.HttpClientService = exports.FlowModuleService = exports.FlowFunctionService = exports.FlowDeploymentService = exports.FlowService = exports.EventService = exports.EndpointService = exports.ContentService = exports.AssetTypesService = exports.AssetService = exports.AlertService = exports.AiService = exports.TrashService = exports.DataService = void 0;
|
|
3
|
+
exports.VaultService = exports.UserService = exports.TimeSeriesService = exports.TaskService = exports.ShareService = exports.SearchService = exports.ObjectReferenceService = exports.ProxyService = exports.OrganizationsResourcesService = exports.OrganizationsAdministrationService = exports.OrganizationsService = exports.NotificationService = exports.NotificationRuleService = exports.LabelService = exports.HttpClientService = exports.FlowModuleService = exports.FlowFunctionService = exports.FlowDeploymentService = exports.FlowService = exports.EventService = exports.EndpointService = exports.CrmService = exports.ContentService = exports.AssetTypesService = exports.AssetService = exports.AlertService = exports.AiService = exports.TrashService = exports.DataService = void 0;
|
|
4
4
|
var data_service_1 = require("./data.service");
|
|
5
5
|
Object.defineProperty(exports, "DataService", { enumerable: true, get: function () { return data_service_1.DataService; } });
|
|
6
6
|
var trash_service_1 = require("./trash.service");
|
|
@@ -15,6 +15,8 @@ var assettypes_service_1 = require("./assettypes.service");
|
|
|
15
15
|
Object.defineProperty(exports, "AssetTypesService", { enumerable: true, get: function () { return assettypes_service_1.AssetTypesService; } });
|
|
16
16
|
var content_service_1 = require("./content.service");
|
|
17
17
|
Object.defineProperty(exports, "ContentService", { enumerable: true, get: function () { return content_service_1.ContentService; } });
|
|
18
|
+
var crm_service_1 = require("./crm.service");
|
|
19
|
+
Object.defineProperty(exports, "CrmService", { enumerable: true, get: function () { return crm_service_1.CrmService; } });
|
|
18
20
|
var endpoint_service_1 = require("./endpoint.service");
|
|
19
21
|
Object.defineProperty(exports, "EndpointService", { enumerable: true, get: function () { return endpoint_service_1.EndpointService; } });
|
|
20
22
|
var event_service_1 = require("./event.service");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { APIBase } from '../api-base';
|
|
1
2
|
import { CreateReferenceDto, ObjectReference, ObjectReferenceType, Paginated, ReferencesQuery, TokenOption } from '../interfaces';
|
|
2
|
-
import { DataService } from './data.service';
|
|
3
3
|
import { HttpClientService } from './http-client.service';
|
|
4
|
-
export declare class ObjectReferenceService extends
|
|
4
|
+
export declare class ObjectReferenceService extends APIBase {
|
|
5
5
|
constructor(httpClient: HttpClientService);
|
|
6
6
|
find(query: ReferencesQuery, options?: TokenOption): Promise<Paginated<ObjectReference>>;
|
|
7
7
|
findAll(objId: string, options?: TokenOption): Promise<ObjectReference[]>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ObjectReferenceService = void 0;
|
|
4
|
-
const
|
|
5
|
-
class ObjectReferenceService extends
|
|
4
|
+
const api_base_1 = require("../api-base");
|
|
5
|
+
class ObjectReferenceService extends api_base_1.APIBase {
|
|
6
6
|
constructor(httpClient) {
|
|
7
7
|
super(httpClient, '/references');
|
|
8
8
|
}
|
|
@@ -21,22 +21,22 @@ class ObjectReferenceService extends data_service_1.DataService {
|
|
|
21
21
|
if (query.objIsSrc !== undefined) {
|
|
22
22
|
params.append('objIsSrc', query.objIsSrc.toString());
|
|
23
23
|
}
|
|
24
|
-
return await this.httpClient.get(
|
|
24
|
+
return await this.httpClient.get(`${this.basePath}?${params.toString()}`, options);
|
|
25
25
|
}
|
|
26
26
|
async findAll(objId, options = {}) {
|
|
27
|
-
return await this.httpClient.get(
|
|
27
|
+
return await this.httpClient.get(`${this.basePath}/${objId}`, options);
|
|
28
28
|
}
|
|
29
29
|
async create(dto, options = {}) {
|
|
30
|
-
return await this.httpClient.post(
|
|
30
|
+
return await this.httpClient.post(this.basePath, dto, options);
|
|
31
31
|
}
|
|
32
32
|
async update(referenceId, updateData, options = {}) {
|
|
33
|
-
return await this.httpClient.put(
|
|
33
|
+
return await this.httpClient.put(`${this.basePath}/${referenceId}`, updateData, options);
|
|
34
34
|
}
|
|
35
35
|
async deleteById(refId, options = {}) {
|
|
36
|
-
await this.httpClient.delete(
|
|
36
|
+
await this.httpClient.delete(`${this.basePath}/${refId}`, options);
|
|
37
37
|
}
|
|
38
38
|
async deleteByReference(src, tgt, relType, options = {}) {
|
|
39
|
-
await this.httpClient.delete(
|
|
39
|
+
await this.httpClient.delete(`${this.basePath}/${src}/${tgt}/${relType}`, options);
|
|
40
40
|
}
|
|
41
41
|
async checkConnection(srcId, tgtId, type, options = {}) {
|
|
42
42
|
const params = new URLSearchParams();
|
|
@@ -44,7 +44,7 @@ class ObjectReferenceService extends data_service_1.DataService {
|
|
|
44
44
|
params.append('type', type.toString());
|
|
45
45
|
}
|
|
46
46
|
const queryString = params.toString();
|
|
47
|
-
const url =
|
|
47
|
+
const url = `${this.basePath}/connected/${srcId}/${tgtId}${queryString ? `?${queryString}` : ''}`;
|
|
48
48
|
return await this.httpClient.get(url, options);
|
|
49
49
|
}
|
|
50
50
|
}
|