ACS-8055 create legal-hold service

This commit is contained in:
DaryaBalvanovich
2024-06-11 23:51:41 +02:00
committed by Darya Balvanovich
parent f07b06f905
commit bec33659fd
14 changed files with 166 additions and 134 deletions
@@ -34,7 +34,6 @@ import { BaseApi } from './base.api';
import { throwIfNotDefined } from '../../../assert';
import { buildCollectionParam } from '../../../alfrescoApiClient';
import { ContentPagingQuery } from './types';
import { NodeAssignedHoldPaging } from '../model/nodeAssinedHoldsPaging';
export type NodesIncludeQuery = {
/**
@@ -983,48 +982,4 @@ export class NodesApi extends BaseApi {
returnType: DirectAccessUrlEntry
});
}
/**
* List Assigned Holds
*
* **Note:** this endpoint is available in Alfresco 7.1 and newer versions.
*
* Gets a list of assigned holds that are associated with the current **nodeId**.
*
* @param nodeId The identifier of a child node. You can also use one of these well-known aliases:
* - -my-
* - -shared-
* - -root-
* @param opts Optional parameters
* @param opts.where Optionally filter the list by **frozenContent**:
* - where=(assocType='rma:frozenContent')
* @returns Promise<NodeAssignedHoldPaging>
*/
listAssignedHolds(
nodeId: string,
opts?: {
where?: string;
} & ContentPagingQuery
): Promise<NodeAssignedHoldPaging> {
throwIfNotDefined(nodeId, 'nodeId');
opts = opts || {};
const pathParams = {
nodeId
};
const queryParams = {
where: opts?.where,
skipCount: opts?.skipCount,
maxItems: opts?.maxItems
};
return this.get({
path: '/nodes/{nodeId}/parents',
pathParams,
queryParams,
returnType: NodeAssignedHoldPaging
});
}
}
@@ -199,7 +199,4 @@ export * from './versionPagingList';
export * from './deletedNode';
export * from './nodeAssociation';
export * from './nodeChildAssociation';
export * from './nodeAssignedHoldPagingList';
export * from './nodeAssinedHoldsPaging';
export * from './nodeAssignedHoldEntry';
export * from './nodeAssignedHold';
export * from './nodeHold';
@@ -1,48 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 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';
import { UserInfo } from './userInfo';
import { ChildAssociationInfo } from './childAssociationInfo';
export class NodeAssignedHold {
id: string;
/**
* The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |.
* The character . must not be used at the end of the name.
*/
name: string;
nodeType: string;
isFolder: boolean;
isFile: boolean;
modifiedAt: Date;
modifiedByUser: UserInfo;
createdAt: Date;
createdByUser: UserInfo;
parentId?: string;
association?: ChildAssociationInfo;
constructor(input?: Partial<NodeAssignedHold>) {
if (input) {
Object.assign(this, input);
this.modifiedAt = input.modifiedAt ? DateAlfresco.parseDate(input.modifiedAt) : undefined;
this.modifiedByUser = input.modifiedByUser ? new UserInfo(input.modifiedByUser) : undefined;
this.createdAt = input.createdAt ? DateAlfresco.parseDate(input.createdAt) : undefined;
this.createdByUser = input.createdByUser ? new UserInfo(input.createdByUser) : undefined;
}
}
}
@@ -1,34 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 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 '..';
import { NodeAssignedHoldEntry } from './nodeAssignedHoldEntry';
export class NodeAssignedHoldPagingList {
pagination: Pagination;
entries: NodeAssignedHoldEntry[];
constructor(input?: Partial<NodeAssignedHoldPagingList>) {
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 NodeAssignedHoldEntry(item));
}
}
}
}
@@ -1,29 +0,0 @@
/*!
* @license
* Copyright © 2005-2024 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 { NodeAssignedHoldPagingList } from './nodeAssignedHoldPagingList';
export class NodeAssignedHoldPaging {
list?: NodeAssignedHoldPagingList;
constructor(input?: Partial<NodeAssignedHoldPaging>) {
if (input) {
Object.assign(this, input);
this.list = input.list ? new NodeAssignedHoldPagingList(input.list) : undefined;
}
}
}
@@ -49,6 +49,8 @@ export class NodeChildAssociation {
permissions?: PermissionsInfo;
definition?: Definition;
association?: ChildAssociationInfo;
reason?: string;
description?: string;
constructor(input?: Partial<NodeChildAssociation>) {
if (input) {
@@ -15,15 +15,19 @@
* limitations under the License.
*/
import { NodeAssignedHold } from './nodeAssignedHold';
export class NodeHold {
id: string;
/**
* The name must not contain spaces or the following special characters: * \" < > \\ / ? : and |.
* The character . must not be used at the end of the name.
*/
name: string;
reason: string;
description: string;
export class NodeAssignedHoldEntry {
entry: NodeAssignedHold;
constructor(input?: Partial<NodeAssignedHoldEntry>) {
constructor(input?: Partial<NodeHold>) {
if (input) {
Object.assign(this, input);
this.entry = input.entry ? new NodeAssignedHold(input.entry) : undefined;
}
}
}
@@ -15,7 +15,7 @@
* limitations under the License.
*/
export interface NodeHold {
export interface Hold {
id: string;
name: string;
reason?: string;
@@ -26,3 +26,4 @@ export * from './transferContainers.api';
export * from './transfers.api';
export * from './unfiledContainers.api';
export * from './unfiledRecordFolders.api';
export * from './legal-hold.api';
@@ -0,0 +1,54 @@
/*!
* @license
* Copyright © 2005-2024 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 { ContentPagingQuery, NodeChildAssociationPaging } from '../../content-rest-api';
/**
* Legal Holds service.
*
* @module RecordsApi
*/
export class LegalHoldApi extends BaseApi {
/**
* List of legal holds
*
* @param filePlanId The identifier of a file plan. You can also use the -filePlan- alias.
* @param opts Optional parameters
* @returns Promise<RecordCategoryPaging>
*/
getHolds(filePlanId: string = '-filePlan-', opts?: ContentPagingQuery): Promise<NodeChildAssociationPaging> {
throwIfNotDefined(filePlanId, 'filePlanId');
const pathParams = {
filePlanId
};
const queryParams = {
skipCount: opts?.skipCount,
maxItems: opts?.maxItems
};
return this.get({
path: '/file-plans/{filePlanId}/holds',
pathParams,
queryParams,
returnType: NodeChildAssociationPaging
});
}
}