@hahnpro/hpc-api 2026.6.7 → 2026.6.8
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/package.json +2 -2
- package/src/lib/interfaces/crm.interface.d.ts +58 -0
- package/src/lib/interfaces/index.d.ts +2 -2
- package/src/lib/mock/crm.mock.service.d.ts +4 -3
- package/src/lib/mock/crm.mock.service.js +16 -2
- package/src/lib/services/crm.service.d.ts +3 -1
- package/src/lib/services/crm.service.js +6 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hahnpro/hpc-api",
|
|
3
|
-
"version": "2026.6.
|
|
3
|
+
"version": "2026.6.8",
|
|
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.18.
|
|
12
|
+
"axios": "1.18.1",
|
|
13
13
|
"eventsource": "4.1.0",
|
|
14
14
|
"jose": "5.10.0",
|
|
15
15
|
"jwt-decode": "4.0.0",
|
|
@@ -99,6 +99,64 @@ export interface CrmImportDuplicateGroup<T extends CrmImportDuplicateEntityType
|
|
|
99
99
|
members: CrmImportDuplicateMember[];
|
|
100
100
|
contactDetails?: CrmImportContactDuplicateDetails;
|
|
101
101
|
}
|
|
102
|
+
export type CrmDuplicateEntityType = 'contact';
|
|
103
|
+
export type CrmDuplicateGroupStatus = 'autoMerge' | 'needsReview';
|
|
104
|
+
export type CrmDuplicateReasonCode = 'same_normalized_name' | 'shared_phone' | 'single_business_domain' | 'public_email_present' | 'multiple_business_domains' | 'distinct_existing_matches';
|
|
105
|
+
export interface CrmDuplicateMember {
|
|
106
|
+
assetId: string;
|
|
107
|
+
name: string;
|
|
108
|
+
firstName?: string;
|
|
109
|
+
lastName?: string;
|
|
110
|
+
email?: string;
|
|
111
|
+
emails: string[];
|
|
112
|
+
primaryEmail?: string;
|
|
113
|
+
domain?: string;
|
|
114
|
+
organizationName?: string;
|
|
115
|
+
position?: string;
|
|
116
|
+
phone?: string;
|
|
117
|
+
role?: string;
|
|
118
|
+
lastUpdated?: string;
|
|
119
|
+
}
|
|
120
|
+
export interface CrmDuplicateGroup<TMember = CrmDuplicateMember> {
|
|
121
|
+
groupId: string;
|
|
122
|
+
status: CrmDuplicateGroupStatus;
|
|
123
|
+
reasonCodes: CrmDuplicateReasonCode[];
|
|
124
|
+
canonicalAssetId?: string;
|
|
125
|
+
members: TMember[];
|
|
126
|
+
}
|
|
127
|
+
export interface CrmGetDuplicatesQuery {
|
|
128
|
+
entityType?: CrmDuplicateEntityType;
|
|
129
|
+
}
|
|
130
|
+
export interface CrmGetContactDuplicatesResponse {
|
|
131
|
+
entityType: 'contact';
|
|
132
|
+
groups: CrmDuplicateGroup[];
|
|
133
|
+
}
|
|
134
|
+
export type CrmGetDuplicatesResponse = CrmGetContactDuplicatesResponse;
|
|
135
|
+
export interface CrmEmailMerge {
|
|
136
|
+
primaryEmail: string;
|
|
137
|
+
keptEmails: string[];
|
|
138
|
+
}
|
|
139
|
+
export interface CrmContactMergeOverrides {
|
|
140
|
+
name?: string;
|
|
141
|
+
firstName?: string;
|
|
142
|
+
lastName?: string;
|
|
143
|
+
organizationName?: string;
|
|
144
|
+
position?: string;
|
|
145
|
+
phone?: string;
|
|
146
|
+
role?: string;
|
|
147
|
+
}
|
|
148
|
+
export interface CrmMergeContactDuplicatesRequest {
|
|
149
|
+
primaryAssetId: string;
|
|
150
|
+
mergedAssetIds: string[];
|
|
151
|
+
emailMerge?: CrmEmailMerge;
|
|
152
|
+
overrides?: CrmContactMergeOverrides;
|
|
153
|
+
}
|
|
154
|
+
export interface CrmMergeContactDuplicatesResponse {
|
|
155
|
+
primaryAssetId: string;
|
|
156
|
+
mergedAssetIds: string[];
|
|
157
|
+
primaryEmail?: string;
|
|
158
|
+
keptEmails: string[];
|
|
159
|
+
}
|
|
102
160
|
export interface MatchResult {
|
|
103
161
|
found: boolean;
|
|
104
162
|
assetId?: string;
|
|
@@ -6,9 +6,9 @@ export type { Audit } from './audit.interface';
|
|
|
6
6
|
export type { Author } from './author.interface';
|
|
7
7
|
export type { AzureBillingEvent, AzureBillingResult, Billing, BillingEvent, BillingResource, BillingSubscription, BillingValues, OnceBilledResources, RegularlyBilledResources, } from './billing.interface';
|
|
8
8
|
export type { Content, ContentAnalysis, ContentChange, ContentSearchResult, IndexingStatusData, ReindexStatusSsePayload, } from './content.interface';
|
|
9
|
-
export type { CompanyCandidate, ContactCandidate, CrmImportDuplicateDecision, CrmImportDuplicateEntityType, CrmImportDuplicateGroup, CrmImportDuplicateMember, CrmImportDuplicateReasonCode, CrmImportContactDuplicateDetails, CrmImportContactDuplicateMemberDetails, CrmImportJsonRequest, CrmImportParser, CrmImportResponse, ImportResult, ImportResultStats, MatchResult, MeetingReport, ReportActivity, ReportParticipant, ReportSummary, TouchpointCandidate, } from './crm.interface';
|
|
9
|
+
export type { CrmContactMergeOverrides, CrmDuplicateEntityType, CrmDuplicateGroup, CrmDuplicateGroupStatus, CrmDuplicateMember, CrmDuplicateReasonCode, CrmEmailMerge, CrmGetContactDuplicatesResponse, CrmGetDuplicatesQuery, CrmGetDuplicatesResponse, CompanyCandidate, ContactCandidate, CrmImportDuplicateDecision, CrmImportDuplicateEntityType, CrmImportDuplicateGroup, CrmImportDuplicateMember, CrmImportDuplicateReasonCode, CrmImportContactDuplicateDetails, CrmImportContactDuplicateMemberDetails, CrmImportJsonRequest, CrmImportParser, CrmImportResponse, CrmMergeContactDuplicatesRequest, CrmMergeContactDuplicatesResponse, ImportResult, ImportResultStats, MatchResult, MeetingReport, ReportActivity, ReportParticipant, ReportSummary, TouchpointCandidate, } from './crm.interface';
|
|
10
10
|
export type { DataInterface, Filter, Paginated, RequestParameter } from './data.interface';
|
|
11
|
-
export type { DataspaceAllowedResourceType, ShareInDataspaceDto, DataspaceWorkflowStatus, DataspaceWorkflowResult } from './dataspace.interface';
|
|
11
|
+
export type { DataspaceAllowedResourceType, ShareInDataspaceDto, DataspaceWorkflowStatus, DataspaceWorkflowResult, } from './dataspace.interface';
|
|
12
12
|
export type { EdgeDeviceRequestResponse, EdgeDeviceResult, WebIOData } from './edge-device.interface';
|
|
13
13
|
export type { AdditionalNotificationData, Endpoint, EndpointConfig, EndpointLog, NotificationEndpoint, NotificationEndpointLog, NotificationLogType, NotificationPayload, SearchEndpointResult, } from './endpoint.interface';
|
|
14
14
|
export type { CreateEventDto, Event, EventCountByAsset } from './event.interface';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { Config, TokenOption } from '../interfaces';
|
|
2
|
-
import {
|
|
3
|
-
import { CrmService } from '../services/crm.service';
|
|
1
|
+
import { Config, CrmGetDuplicatesQuery, CrmGetDuplicatesResponse, CrmImportParser, CrmImportResponse, CrmMergeContactDuplicatesRequest, CrmMergeContactDuplicatesResponse, TokenOption } from '../interfaces';
|
|
2
|
+
import { CrmService } from '../services';
|
|
4
3
|
import { CrossPlatformFormData } from '../utils';
|
|
5
4
|
export declare class CrmMockService extends CrmService {
|
|
6
5
|
constructor();
|
|
7
6
|
importFile(_form: CrossPlatformFormData, _options?: Config): Promise<CrmImportResponse>;
|
|
8
7
|
importJson(_csv: string, _parser?: CrmImportParser, _options?: TokenOption): Promise<CrmImportResponse>;
|
|
8
|
+
getDuplicates(_query?: CrmGetDuplicatesQuery, _options?: TokenOption): Promise<CrmGetDuplicatesResponse>;
|
|
9
|
+
mergeDuplicates(dto: CrmMergeContactDuplicatesRequest, _options?: TokenOption): Promise<CrmMergeContactDuplicatesResponse>;
|
|
9
10
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CrmMockService = void 0;
|
|
4
|
-
const
|
|
4
|
+
const services_1 = require("../services");
|
|
5
5
|
const http_client_mock_service_1 = require("./http-client.mock.service");
|
|
6
|
-
class CrmMockService extends
|
|
6
|
+
class CrmMockService extends services_1.CrmService {
|
|
7
7
|
constructor() {
|
|
8
8
|
super(new http_client_mock_service_1.HttpClientMockService());
|
|
9
9
|
}
|
|
@@ -48,5 +48,19 @@ class CrmMockService extends crm_service_1.CrmService {
|
|
|
48
48
|
async importJson(_csv, _parser = 'auto', _options = {}) {
|
|
49
49
|
return this.importFile({ getHeaders: () => ({}) });
|
|
50
50
|
}
|
|
51
|
+
async getDuplicates(_query = {}, _options = {}) {
|
|
52
|
+
return {
|
|
53
|
+
entityType: 'contact',
|
|
54
|
+
groups: [],
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
async mergeDuplicates(dto, _options = {}) {
|
|
58
|
+
return {
|
|
59
|
+
primaryAssetId: dto.primaryAssetId,
|
|
60
|
+
mergedAssetIds: dto.mergedAssetIds,
|
|
61
|
+
primaryEmail: dto.emailMerge?.primaryEmail,
|
|
62
|
+
keptEmails: dto.emailMerge?.keptEmails ?? [],
|
|
63
|
+
};
|
|
64
|
+
}
|
|
51
65
|
}
|
|
52
66
|
exports.CrmMockService = CrmMockService;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { APIBase } from '../api-base';
|
|
2
2
|
import { Config, TokenOption } from '../interfaces';
|
|
3
|
-
import { CrmImportParser, CrmImportResponse } from '../interfaces/crm.interface';
|
|
3
|
+
import { CrmGetDuplicatesQuery, CrmGetDuplicatesResponse, CrmImportParser, CrmImportResponse, CrmMergeContactDuplicatesRequest, CrmMergeContactDuplicatesResponse } from '../interfaces/crm.interface';
|
|
4
4
|
import { CrossPlatformFormData } from '../utils';
|
|
5
5
|
import { HttpClientService } from './http-client.service';
|
|
6
6
|
export declare class CrmService extends APIBase {
|
|
7
7
|
constructor(httpClient: HttpClientService);
|
|
8
8
|
importFile(form: CrossPlatformFormData, options?: Config): Promise<CrmImportResponse>;
|
|
9
9
|
importJson(csv: string, parser?: CrmImportParser, options?: TokenOption): Promise<CrmImportResponse>;
|
|
10
|
+
getDuplicates(query?: CrmGetDuplicatesQuery, options?: TokenOption): Promise<CrmGetDuplicatesResponse>;
|
|
11
|
+
mergeDuplicates(dto: CrmMergeContactDuplicatesRequest, options?: TokenOption): Promise<CrmMergeContactDuplicatesResponse>;
|
|
10
12
|
}
|
|
@@ -20,5 +20,11 @@ class CrmService extends api_base_1.APIBase {
|
|
|
20
20
|
const dto = { csv, parser };
|
|
21
21
|
return this.httpClient.post(`${this.basePath}/import/json`, dto, options);
|
|
22
22
|
}
|
|
23
|
+
getDuplicates(query = {}, options = {}) {
|
|
24
|
+
return this.httpClient.get(`${this.basePath}/duplicates`, { ...options, params: query });
|
|
25
|
+
}
|
|
26
|
+
mergeDuplicates(dto, options = {}) {
|
|
27
|
+
return this.httpClient.post(`${this.basePath}/duplicates`, dto, options);
|
|
28
|
+
}
|
|
23
29
|
}
|
|
24
30
|
exports.CrmService = CrmService;
|