[ACS-12037] Remove Knowledge Discovery from ADF (#12042)

* [ACS-12037] Remove Knowledge Discovery from ADF

* [ACS-12037] Resolve Copilot CR comments

* [ACS-12037] Complete cleanup, revert i18n changes

* [ACS-12037] Cleanup features and APIs related to hxiconnector

* [ACS-12037] Update docs
This commit is contained in:
Grzegorz Jaśkowski
2026-07-10 15:37:24 +02:00
committed by GitHub
parent 0b35118dee
commit b86e41515e
63 changed files with 11 additions and 2261 deletions
-1
View File
@@ -24,7 +24,6 @@ export * from './src/api/auth-rest-api/index';
export * from './src/api/activiti-rest-api/index';
export * from './src/api/search-rest-api/index';
export * from './src/api/model-rest-api/index';
export * from './src/api/hxi-connector-api/index';
export * from './src/api/content-custom-api/api/content.api';
export * from './src/authentication/contentAuth';
-13
View File
@@ -38,7 +38,6 @@ export class AlfrescoApi extends AlfrescoApiClient implements AlfrescoApiType {
discoveryClient: ContentClient;
gsClient: ContentClient;
authClient: ContentClient;
hxiConnectorClient: ContentClient;
oauth2Auth: Oauth2Auth;
processAuth: ProcessAuth;
contentAuth: ContentAuth;
@@ -190,12 +189,6 @@ export class AlfrescoApi extends AlfrescoApiClient implements AlfrescoApiType {
} else {
this.processClient.setConfig(this.config);
}
if (!this.hxiConnectorClient) {
this.hxiConnectorClient = new ContentClient(this.config, `/api/${this.config.tenant}/private/hxi/versions/1`, this.httpClient);
} else {
this.hxiConnectorClient.setConfig(this.config, `/api/${this.config.tenant}/private/hxi/versions/1`);
}
}
/**@private? */
@@ -207,7 +200,6 @@ export class AlfrescoApi extends AlfrescoApiClient implements AlfrescoApiType {
this.searchClient.off('error', () => {});
this.discoveryClient.off('error', () => {});
this.gsClient.off('error', () => {});
this.hxiConnectorClient.off('error', () => {});
this.contentClient.on('error', (error: any) => {
this.errorHandler(error);
@@ -236,10 +228,6 @@ export class AlfrescoApi extends AlfrescoApiClient implements AlfrescoApiType {
this.gsClient.on('error', (error: any) => {
this.errorHandler(error);
});
this.hxiConnectorClient.on('error', (error: any) => {
this.errorHandler(error);
});
}
ticketMismatchListeners() {
@@ -370,7 +358,6 @@ export class AlfrescoApi extends AlfrescoApiClient implements AlfrescoApiType {
this.searchClient.setAuthentications(authECM);
this.discoveryClient.setAuthentications(authECM);
this.gsClient.setAuthentications(authECM);
this.hxiConnectorClient.setAuthentications(authECM);
}
/**
@@ -1,35 +0,0 @@
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { AgentPaging } from '../model/agentPaging';
import { BaseApi } from '../../hxi-connector-api/api/base.api';
/**
* Agents Api.
* In order to use this api, you need to have the HX Insights Connector (additional ACS module) installed.
*/
export class AgentsApi extends BaseApi {
/**
* Gets all agents.
* @returns AgentPaging object containing the agents.
*/
getAgents(): Promise<AgentPaging> {
return this.get({
path: '/agents'
});
}
}
@@ -18,7 +18,6 @@
export * from './types';
export * from './actions.api';
export * from './activities.api';
export * from './agents.api';
export * from './audit.api';
export * from './categories.api';
export * from './comments.api';
@@ -33,7 +32,6 @@ export * from './probes.api';
export * from './queries.api';
export * from './ratings.api';
export * from './renditions.api';
export * from './search-ai.api';
export * from './sharedlinks.api';
export * from './sites.api';
export * from './tags.api';
@@ -1,61 +0,0 @@
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { QuestionModel, QuestionRequest, AiAnswerEntry, KnowledgeRetrievalConfigEntry } from '../model';
import { BaseApi } from '../../hxi-connector-api/api/base.api';
/**
* Search AI API.
*/
export class SearchAiApi extends BaseApi {
/**
* Ask a question to the AI.
* @param questions QuestionRequest array containing questions to ask.
* @returns QuestionModel object containing information about questions.
*/
ask(questions: QuestionRequest[]): Promise<QuestionModel> {
const agentId = questions[0].agentId;
return this.post({
path: `agents/${agentId}/questions`,
bodyParam: questions.map((questionRequest) => ({
question: questionRequest.question,
restrictionQuery: { nodesIds: questionRequest.nodeIds }
}))
}).then((response) => response.entry);
}
/**
* Get an answer to specific question.
* @param questionId The ID of the question to get an answer for.
* @returns AiAnswerEntry object containing the answer.
*/
getAnswer(questionId: string): Promise<AiAnswerEntry> {
return this.get({
path: `questions/${questionId}/answers/-default-`
});
}
/**
* Get the knowledge retrieval configuration.
* @returns KnowledgeRetrievalConfigEntry object containing the configuration.
*/
getConfig(): Promise<KnowledgeRetrievalConfigEntry> {
return this.get({
path: '/config/-default-'
});
}
}
@@ -1,87 +0,0 @@
# AgentsApi
| Method | HTTP request | Description |
|-----------------------------------|----------------------------------------------|--------------------------|
| [getAgents](#getAgents) | **GET** /agents | Gets all agents. |
## getAgents
Gets all agents.
A paginated list is returned in the response body. For example:
```json
{
"list": {
"pagination": {
"count": 2,
"hasMoreItems": false,
"totalItems": 2,
"skipCount": 0,
"maxItems": 100
},
"entries": [
{
"entry": {
"id": "Some id",
"name": "Some name",
"description": "Some description",
"avatarUrl": "Some avatar url"
}
}
]
}
}
```
**Example**
```javascript
import { AlfrescoApi, AgentsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const agentsApi = new AgentsApi(alfrescoApi);
agentsApi.getAgents().then((agents) => {
console.log('API called successfully. Returned data: ' + agents);
});
```
**Return type**: [AgentPaging](#AgentPaging)
# Models
## AgentPaging
**Properties**
| Name | Type |
|------|-------------------------------------|
| list | [AgentPagingList](#AgentPagingList) |
## AgentPagingList
**Properties**
| Name | Type |
|----------------|-----------------------------|
| **pagination** | [Pagination](Pagination.md) |
| **entries** | [AgentEntry[]](#AgentEntry) |
## AgentEntry
**Properties**
| Name | Type |
|-----------|-----------------|
| **entry** | [Agent](#Agent) |
## Agent
**Properties**
| Name | Type | Description |
|-----------------|-----------|-------------------------------|
| **id** | string | Agent id |
| **name** | string | Agent name |
| **description** | string | Agent description |
| **avatarUrl** | string | (optional) Agent avatar image |
@@ -1,215 +0,0 @@
# SearchAiApi
| Method | HTTP request | Description |
|-------------------------|----------------------------|--------------------------------------------|
| [ask](#ask) | **GET** /questions | Ask a question to the AI. |
| [getAnswer](#getAnswer) | **GET** /answers/-default- | Get an answer to specific question. |
| [getConfig](#getConfig) | **GET** /config/-default- | Get the knowledge retrieval configuration. |
## ask
Ask a question to the AI.
A list is returned in the response body. For example:
```json
[
{
"question": "Some question",
"questionId": "Some question id",
"restrictionQuery": "Some restriction query"
}
]
```
**Example**
```javascript
import { AlfrescoApi, AgentsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const searchAiApi = new SearchAiApi(alfrescoApi);
searchAiApi.ask([{
question: 'Some question',
restrictionQuery: 'Some restriction query',
agentId: 'Some agent id'
}]).then((questionInformation) => {
console.log('API called successfully. Returned data: ' + questionInformation);
});
```
**Parameters**
| Name | Type | Description |
|---------------|---------------------------------------|-----------------------|
| **questions** | [QuestionRequest](#QuestionRequest)[] | The questions to ask. |
**Return type**: [QuestionModel](#QuestionModel)[]
## getAnswer
Get an answer to specific question.
A paginated list is returned in the response body. For example:
```json
{
"entry": {
"answer": "Some answer",
"question": "Some question",
"complete": true,
"objectReferences": [
{
"objectId": "some-object-id",
"references": [
{
"referenceId": "some-reference-id1",
"rankScore": 0.031,
"rank": 2
},
{
"referenceId": "some-reference-id2",
"rankScore": 0.031,
"rank": 1
},
{
"referenceId": "some-reference-id3",
"rankScore": 0.028,
"rank": 3
}
]
}
]
}
}
```
**Example**
```javascript
import { AlfrescoApi, AgentsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const searchAiApi = new SearchAiApi(alfrescoApi);
searchAiApi.getAnswer('some question id').then((answer) => {
console.log('API called successfully. Returned data: ' + answer);
});
```
**Parameters**
| Name | Type | Description |
|----------------|--------|----------------------------------------------|
| **questionId** | string | The ID of the question to get an answer for. |
**Return type**: [AiAnswerEntry](#AiAnswerEntry)
## getConfig
Get the knowledge retrieval configuration. For example:
```json
{
"entry": {
"knowledgeRetrievalUrl": "https://some-url"
}
}
```
**Example**
```javascript
import { AlfrescoApi, AgentsApi } from '@alfresco/js-api';
const alfrescoApi = new AlfrescoApi(/*..*/);
const searchAiApi = new SearchAiApi(alfrescoApi);
searchAiApi.getConfig().then((answer) => {
console.log('API called successfully. Returned data: ', answer.entry.knowledgeRetrievalUrl);
});
```
**Return type**: [KnowledgeRetrievalConfigEntry](#KnowledgeRetrievalConfigEntry)
# Models
## AiAnswerEntry
**Properties**
| Name | Type |
|-----------|-----------------------|
| **entry** | [AiAnswer](#AiAnswer) |
## AiAnswer
**Properties**
| Name | Type |
|----------------------|-------------------------------------------------------|
| **answer** | string |
| **question** | string |
| **complete** | boolean |
| **objectReferences** | [AiAnswerObjectReference](#AiAnswerObjectReference)[] |
## AiAnswerObjectReference
**Properties**
| Name | Type |
|----------------|-------------------------------------------|
| **objectId** | string |
| nodeId | string |
| **references** | [AiAnswerReference](#AiAnswerReference)[] |
## AiAnswerReference
**Properties**
| Name | Type |
|-----------------|--------|
| **referenceId** | string |
| **rankScore** | number |
| **rank** | number |
## QuestionModel
**Properties**
| Name | Type |
|----------------------|------------------|
| **question** | string |
| **questionId** | string |
| **restrictionQuery** | RestrictionQuery |
## RestrictionQuery
**Properties**
| Name | Type |
|--------------|----------|
| **nodesIds** | string[] |
## QuestionRequest
**Properties**
| Name | Type |
|--------------|----------|
| **question** | string |
| **nodeIds** | string[] |
| **agentId** | string |
## KnowledgeRetrievalConfigEntry
**Properties**
| Name | Type |
|-------|-------------------------------------------------------|
| entry | [KnowledgeRetrievalConfig](#KnowledgeRetrievalConfig) |
## KnowledgeRetrievalConfig
**Properties**
| Name | Type |
|-----------------------|--------|
| knowledgeRetrievalUrl | string |
@@ -1,23 +0,0 @@
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export interface Agent {
id: string;
name: string;
description: string;
avatarUrl?: string;
}
@@ -1,22 +0,0 @@
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Agent } from './agent';
export interface AgentEntry {
entry: Agent;
}
@@ -1,22 +0,0 @@
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { AgentPagingList } from './agentPagingList';
export interface AgentPaging {
list?: AgentPagingList;
}
@@ -1,24 +0,0 @@
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Pagination } from './pagination';
import { AgentEntry } from './agentEntry';
export interface AgentPagingList {
entries?: AgentEntry[];
pagination?: Pagination;
}
@@ -1,25 +0,0 @@
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { AiAnswerObjectReference } from './aiAnswerObjectReference';
export interface AiAnswer {
answer?: string;
question: string;
complete: boolean;
objectReferences: AiAnswerObjectReference[];
}
@@ -1,22 +0,0 @@
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { AiAnswer } from './aiAnswer';
export interface AiAnswerEntry {
entry: AiAnswer;
}
@@ -1,24 +0,0 @@
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { AiAnswerReference } from './aiAnswerReference';
export interface AiAnswerObjectReference {
objectId: string;
nodeId?: string;
references: AiAnswerReference[];
}
@@ -1,22 +0,0 @@
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export interface AiAnswerReference {
referenceId: string;
rankScore: number;
rank: number;
}
@@ -27,14 +27,6 @@ export * from './activity';
export * from './activityEntry';
export * from './activityPaging';
export * from './activityPagingList';
export * from './agent';
export * from './agentEntry';
export * from './agentPaging';
export * from './agentPagingList';
export * from './aiAnswer';
export * from './aiAnswerEntry';
export * from './aiAnswerReference';
export * from './aiAnswerObjectReference';
export * from './association';
export * from './associationBody';
export * from './associationEntry';
@@ -99,8 +91,6 @@ export * from './groupMemberPagingList';
export * from './groupMembershipBodyCreate';
export * from './groupPaging';
export * from './groupPagingList';
export * from './knowledgeRetrievalConfig';
export * from './knowledgeRetrievalConfigEntry';
export * from './modelError';
export * from './networkQuota';
export * from './node';
@@ -143,8 +133,6 @@ export * from './preferencePagingList';
export * from './probeEntry';
export * from './probeEntryEntry';
export * from './property';
export * from './questionModel';
export * from './questionRequest';
export * from './rating';
export * from './ratingAggregate';
export * from './ratingBody';
@@ -1,20 +0,0 @@
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export interface KnowledgeRetrievalConfig {
knowledgeRetrievalUrl: string;
}
@@ -1,22 +0,0 @@
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { KnowledgeRetrievalConfig } from './knowledgeRetrievalConfig';
export interface KnowledgeRetrievalConfigEntry {
entry: KnowledgeRetrievalConfig;
}
@@ -1,24 +0,0 @@
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { RestrictionQuery } from './restrictionQuery';
export interface QuestionModel {
questionId: string;
question: string;
restrictionQuery: RestrictionQuery;
}
@@ -1,22 +0,0 @@
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export interface QuestionRequest {
question: string;
nodeIds: string[];
agentId: string;
}
@@ -1,20 +0,0 @@
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export interface RestrictionQuery {
nodesIds: string[];
}
@@ -1,19 +0,0 @@
**HX Insights Connector API**
Provides access to the HX Insights connector API endpoints.
## Documentation for API Endpoints
All URIs are relative to *https://localhost/alfresco/api/-default-/private/hxi/versions/1*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*.PredictionsApi* | [**getPredictions**](docs/PredictionsApi.md#getPredictions) | **GET** /nodes/{nodeId}/predictions | Get predictions for a node.
## Documentation for Models
- [PredicitonsApi](docs/PredictionsApi.md)
- [Prediciton](docs/Prediction.md)
- [PredicitonEntry](docs/PredictionEntry.md)
- [PredicitonPagingList](docs/PredictionPagingList.md)
- [PredicitonPaging](docs/PredictionPaging.md)
@@ -1,25 +0,0 @@
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { ApiClient } from '../../../api-clients/api-client';
import { LegacyHttpClient } from '../../../api-clients/http-client.interface';
export abstract class BaseApi extends ApiClient {
override get apiClient(): LegacyHttpClient {
return this.alfrescoApi.hxiConnectorClient;
}
}
@@ -1,18 +0,0 @@
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from './predictions.api';
@@ -1,63 +0,0 @@
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { BaseApi } from './base.api';
import { throwIfNotDefined } from '../../../assert';
import { PredictionPaging, ReviewStatus } from '../model';
export class PredictionsApi extends BaseApi {
/**
* List of predictions for a node
* @param nodeId The identifier of a node.
* @returns Promise<PredictionPaging>
*/
getPredictions(nodeId: string): Promise<PredictionPaging> {
throwIfNotDefined(nodeId, 'nodeId');
const pathParams = {
nodeId
};
return this.get({
path: '/nodes/{nodeId}/predictions',
pathParams,
returnType: PredictionPaging
});
}
/**
* Confirm or reject a prediction
* @param predictionId The identifier of a prediction.
* @param reviewStatus New status to apply for prediction. Can be either 'confirmed' or 'rejected'.
* @returns Promise<void>
*/
reviewPrediction(predictionId: string, reviewStatus: ReviewStatus): Promise<void> {
throwIfNotDefined(predictionId, 'predictionId');
throwIfNotDefined(reviewStatus, 'reviewStatus');
const pathParams = {
predictionId,
reviewStatus
};
return this.post({
path: '/predictions/{predictionId}/review',
pathParams,
returnType: Promise<void>
});
}
}
@@ -1,14 +0,0 @@
# Prediction
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **string** | Identifier of a prediction |
**modelId** | **string** | Identifier of a model that made the prediction |
**confidenceLevel** | **number** | Prediction confidence level |
**predictionDateTime** | **Date** | Prediction creation date |
**property** | **string** | Name of the property that prediction was made for |
**previousValue** | any | Previous property value |
**predictionValue** | any | Predicted value |
**updateType** | [**UpdateType**](../model/prediction.ts) | Update type |
**reviewStatus** | [**ReviewStatus**](../model/prediction.ts) | Prediction review status |
@@ -1,8 +0,0 @@
# PredictionEntry
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**entry** | [**Prediction**](Prediction.md) | |
@@ -1,8 +0,0 @@
# PredictionPaging
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**list** | [**PredictionPagingList**](PredictionPagingList.md) | |
@@ -1,9 +0,0 @@
# PredictionPagingList
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**pagination** | [**Pagination**](../../content-rest-api/docs/Pagination.md) | |
**entries** | [**PredictionEntry[]**](PredictionEntry.md) | |
@@ -1,42 +0,0 @@
# PredictionsApi
All URIs are relative to *https://localhost/alfresco/api/-default-/private/hxi/versions/1*
Method | HTTP request | Description
------------- | ------------- | -------------
[**getPredictions**](PredictionsApi.md#getPredictions) | **GET** /nodes/{nodeId}/predictions | Get predictions for node.
[**reviewPrediction**](PredictionsApi.md#reviewPrediction) | **POST** /predictions/{predictionId}/review | Reject or confirm prediction.
<a name="getPredictions"></a>
# **getPredictions**
> PredictionPaging getPredictions(nodeId)
Get predictions for a node.
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**nodeId** | **string** | The identifier of a node. |
### Return type
[**PredictionPaging**](PredictionPaging.md)
<a name="reviewPrediction"></a>
# **reviewPrediction**
> Promise\<void\> reviewPrediction(predictionId, reviewStatus)
Confirm or reject a prediction.
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**predictionId** | **string** | The identifier of a prediction. |
**reviewStatus** | **ReviewStatus** | Review status for prediction. Can be confirmed or rejected. |
### Return type
**Promise\<void\>**
@@ -1,19 +0,0 @@
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from './api';
export * from './model';
@@ -1,21 +0,0 @@
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from './prediction';
export * from './predictionEntry';
export * from './predictionPaging';
export * from './predictionPagingList';
@@ -1,47 +0,0 @@
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { DateAlfresco } from '../../content-custom-api';
export class Prediction {
id: string;
modelId: string;
confidenceLevel: number;
predictionDateTime: Date;
property: string;
previousValue: any;
predictionValue: any;
updateType: UpdateType;
reviewStatus: ReviewStatus;
constructor(input?: Partial<Prediction>) {
if (input) {
Object.assign(this, input);
this.predictionDateTime = input.predictionDateTime ? DateAlfresco.parseDate(input.predictionDateTime) : undefined;
}
}
}
export type UpdateType = 'AUTOFILL' | 'AUTOCORRECT';
export const ReviewStatus = {
UNREVIEWED: 'UNREVIEWED',
CONFIRMED: 'CONFIRMED',
REJECTED: 'REJECTED'
} as const;
export type ReviewStatus = (typeof ReviewStatus)[keyof typeof ReviewStatus];
@@ -1,29 +0,0 @@
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Prediction } from './prediction';
export class PredictionEntry {
entry: Prediction;
constructor(input?: Partial<PredictionEntry>) {
if (input) {
Object.assign(this, input);
this.entry = input.entry ? new Prediction(input.entry) : undefined;
}
}
}
@@ -1,29 +0,0 @@
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { PredictionPagingList } from './predictionPagingList';
export class PredictionPaging {
list?: PredictionPagingList;
constructor(input?: Partial<PredictionPaging>) {
if (input) {
Object.assign(this, input);
this.list = input.list ? new PredictionPagingList(input.list) : undefined;
}
}
}
@@ -1,34 +0,0 @@
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Pagination } from '../../content-rest-api/model/pagination';
import { PredictionEntry } from './predictionEntry';
export class PredictionPagingList {
pagination?: Pagination;
entries?: PredictionEntry[];
constructor(input?: Partial<PredictionPagingList>) {
if (input) {
Object.assign(this, input);
this.pagination = input.pagination ? new Pagination(input.pagination) : undefined;
if (input.entries) {
this.entries = input.entries.map((item) => new PredictionEntry(item));
}
}
}
}
-1
View File
@@ -24,7 +24,6 @@ export * from './api/auth-rest-api';
export * from './api/activiti-rest-api';
export * from './api/search-rest-api';
export * from './api/model-rest-api';
export * from './api/hxi-connector-api';
export * from './api/content-custom-api/api/content.api';
export * from './authentication/contentAuth';
@@ -34,7 +34,6 @@ export interface AlfrescoApiType {
gsClient: LegacyHttpClient;
authClient: LegacyHttpClient;
processAuth: LegacyHttpClient;
hxiConnectorClient: LegacyHttpClient;
setConfig(config: AlfrescoApiConfig): void;
changeWithCredentialsConfig(withCredentials: boolean): void;
@@ -1,71 +0,0 @@
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { AgentMock, EcmAuthMock } from '../mockObjects';
import { AgentsApi, AlfrescoApi } from '../../src';
import assert from 'assert';
describe('AgentsApi', () => {
let agentMock: AgentMock;
let agentsApi: AgentsApi;
beforeEach((done) => {
const hostEcm = 'https://127.0.0.1:8080';
const authResponseMock = new EcmAuthMock(hostEcm);
agentMock = new AgentMock(hostEcm);
authResponseMock.get201Response();
const alfrescoJsApi = new AlfrescoApi({
hostEcm
});
alfrescoJsApi.login('admin', 'admin').then(() => done());
agentsApi = new AgentsApi(alfrescoJsApi);
});
describe('getAgents', () => {
it('should load list of agents', (done) => {
agentMock.mockGetAgents200Response();
agentsApi.getAgents().then((paging) => {
assert.deepStrictEqual(paging, {
list: {
pagination: {
count: 2,
hasMoreItems: false,
skipCount: 0,
maxItems: 100
},
entries: [
{
entry: {
id: 'some id 1',
name: 'some name 1'
}
},
{
entry: {
id: 'some id 2',
name: 'some name 2'
}
}
]
}
});
done();
});
});
});
});
@@ -1,126 +0,0 @@
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { AlfrescoApi, SearchAiApi } from '../../src';
import { EcmAuthMock, SearchAiMock } from '../mockObjects';
import assert from 'assert';
describe('SearchAiApi', () => {
let searchAiApi: SearchAiApi;
let searchAiMock: SearchAiMock;
beforeEach((done) => {
const hostEcm = 'https://127.0.0.1:8080';
const authResponseMock = new EcmAuthMock(hostEcm);
searchAiMock = new SearchAiMock(hostEcm);
authResponseMock.get201Response();
const alfrescoJsApi = new AlfrescoApi({
hostEcm
});
alfrescoJsApi.login('admin', 'admin').then(() => done());
searchAiApi = new SearchAiApi(alfrescoJsApi);
});
describe('ask', () => {
it('should load question information', (done) => {
searchAiMock.mockGetAsk200Response();
searchAiApi
.ask([
{
question: 'some question 1',
nodeIds: ['some node id 1'],
agentId: 'id1'
}
])
.then((questions) => {
assert.deepStrictEqual(questions, {
questionId: 'some id 1',
question: 'some question 1',
restrictionQuery: {
nodesIds: ['some node id 1']
}
});
done();
});
});
});
describe('getAnswer', () => {
it('should load question answer', (done) => {
searchAiMock.mockGetAnswer200Response();
searchAiApi.getAnswer('id1').then((answer) => {
assert.deepStrictEqual(answer, {
entry: {
answer: 'Some answer 1',
complete: true,
question: 'Some question',
objectReferences: [
{
objectId: 'some id 1',
references: [
{
referenceId: 'some reference id 1',
rank: 1,
rankScore: 0.005
},
{
referenceId: 'some reference id 2',
rank: 2,
rankScore: 0.004
}
]
},
{
objectId: 'some id 2',
references: [
{
referenceId: 'some reference id 3',
rank: 1,
rankScore: 0.005
},
{
referenceId: 'some reference id 4',
rank: 2,
rankScore: 0.004
}
]
}
]
}
});
done();
});
});
});
describe('getConfig', () => {
it('should load knowledge retrieval configuration', (done) => {
searchAiMock.mockGetConfig200Response();
searchAiApi.getConfig().then((config) => {
assert.deepStrictEqual(config, {
entry: {
knowledgeRetrievalUrl: 'https://some-url'
}
});
done();
});
});
});
});
@@ -1,49 +0,0 @@
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { BaseMock } from '../base.mock';
export class AgentMock extends BaseMock {
mockGetAgents200Response(): void {
this.mock()
.get('/alfresco/api/-default-/private/hxi/versions/1/agents')
.reply(200, {
list: {
pagination: {
count: 2,
hasMoreItems: false,
skipCount: 0,
maxItems: 100
},
entries: [
{
entry: {
id: 'some id 1',
name: 'some name 1'
}
},
{
entry: {
id: 'some id 2',
name: 'some name 2'
}
}
]
}
});
}
}
@@ -1,95 +0,0 @@
/*!
* @license
* Copyright © 2005-2025 Hyland Software, Inc. and its affiliates. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { BaseMock } from '../base.mock';
export class SearchAiMock extends BaseMock {
mockGetAsk200Response(): void {
this.mock()
.post('/alfresco/api/-default-/private/hxi/versions/1/agents/id1/questions', [
{
question: 'some question 1',
restrictionQuery: {
nodesIds: ['some node id 1']
}
}
])
.reply(200, {
entry: {
question: 'some question 1',
questionId: 'some id 1',
restrictionQuery: {
nodesIds: ['some node id 1']
}
}
});
}
mockGetAnswer200Response(): void {
this.mock()
.get('/alfresco/api/-default-/private/hxi/versions/1/questions/id1/answers/-default-')
.reply(200, {
entry: {
answer: 'Some answer 1',
complete: true,
question: 'Some question',
objectReferences: [
{
objectId: 'some id 1',
references: [
{
referenceId: 'some reference id 1',
rank: 1,
rankScore: 0.005
},
{
referenceId: 'some reference id 2',
rank: 2,
rankScore: 0.004
}
]
},
{
objectId: 'some id 2',
references: [
{
referenceId: 'some reference id 3',
rank: 1,
rankScore: 0.005
},
{
referenceId: 'some reference id 4',
rank: 2,
rankScore: 0.004
}
]
}
]
}
});
}
mockGetConfig200Response(): void {
this.mock()
.get('/alfresco/api/-default-/private/hxi/versions/1/config/-default-')
.reply(200, {
entry: {
knowledgeRetrievalUrl: 'https://some-url'
}
});
}
}
-2
View File
@@ -15,7 +15,6 @@
* limitations under the License.
*/
export * from './content-services/agent.mock';
export * from './content-services/categories.mock';
export * from './content-services/comment.mock';
export * from './content-services/ecm-auth.mock';
@@ -27,7 +26,6 @@ export * from './content-services/groups.mock';
export * from './content-services/find-nodes.mock';
export * from './content-services/rendition.mock';
export * from './content-services/search.mock';
export * from './content-services/search-ai.mock';
export * from './content-services/tag.mock';
export * from './content-services/upload.mock';
export * from './content-services/version.mock';