Skip to content
This repository was archived by the owner on Jun 11, 2025. It is now read-only.

Commit 277b79f

Browse files
authored
[ACS-5839] typing fixes (#1646)
1 parent de66ea7 commit 277b79f

File tree

1 file changed

+36
-86
lines changed

1 file changed

+36
-86
lines changed

src/api/content-rest-api/api/trashcan.api.ts

Lines changed: 36 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -34,87 +34,52 @@ export class TrashcanApi extends BaseApi {
3434
* Permanently delete a deleted node
3535
*
3636
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
37-
38-
Permanently deletes the deleted node **nodeId**.
39-
4037
*
4138
* @param nodeId The identifier of a node.
4239
* @return Promise<{}>
4340
*/
4441
deleteDeletedNode(nodeId: string): Promise<any> {
45-
4642
throwIfNotDefined(nodeId, 'nodeId');
4743

48-
const postBody: null = null;
49-
5044
const pathParams = {
51-
'nodeId': nodeId
52-
};
53-
54-
const queryParams = {
55-
};
56-
57-
const headerParams = {
58-
59-
};
60-
const formParams = {
45+
nodeId
6146
};
6247

63-
const contentTypes = ['application/json'];
64-
const accepts = ['application/json'];
65-
66-
return this.apiClient.callApi(
67-
'/deleted-nodes/{nodeId}', 'DELETE',
68-
pathParams, queryParams, headerParams, formParams, postBody,
69-
contentTypes, accepts );
48+
return this.delete({
49+
path: '/deleted-nodes/{nodeId}',
50+
pathParams
51+
});
7052
}
71-
/**
53+
54+
/**
7255
* Get rendition information for a deleted node
7356
*
7457
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
75-
76-
Gets the rendition information for **renditionId** of file **nodeId**.
77-
7858
*
7959
* @param nodeId The identifier of a node.
8060
* @param renditionId The name of a thumbnail rendition, for example *doclib*, or *pdf*.
8161
* @return Promise<RenditionEntry>
8262
*/
8363
getArchivedNodeRendition(nodeId: string, renditionId: string): Promise<RenditionEntry> {
84-
8564
throwIfNotDefined(nodeId, 'nodeId');
8665
throwIfNotDefined(renditionId, 'renditionId');
8766

88-
const postBody: null = null;
89-
9067
const pathParams = {
91-
'nodeId': nodeId, 'renditionId': renditionId
92-
};
93-
94-
const queryParams = {
95-
};
96-
97-
const headerParams = {
98-
99-
};
100-
const formParams = {
68+
nodeId,
69+
renditionId
10170
};
10271

103-
const contentTypes = ['application/json'];
104-
const accepts = ['application/json'];
105-
106-
return this.apiClient.callApi(
107-
'/deleted-nodes/{nodeId}/renditions/{renditionId}', 'GET',
108-
pathParams, queryParams, headerParams, formParams, postBody,
109-
contentTypes, accepts , RenditionEntry);
72+
return this.get({
73+
path: '/deleted-nodes/{nodeId}/renditions/{renditionId}',
74+
pathParams,
75+
returnType: RenditionEntry
76+
});
11077
}
111-
/**
78+
79+
/**
11280
* Get rendition content of a deleted node
11381
*
11482
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
115-
116-
Gets the rendition content for **renditionId** of file **nodeId**.
117-
11883
*
11984
* @param nodeId The identifier of a node.
12085
* @param renditionId The name of a thumbnail rendition, for example *doclib*, or *pdf*.
@@ -149,34 +114,30 @@ than a 404 response.
149114
}): Promise<Blob> {
150115
throwIfNotDefined(nodeId, 'nodeId');
151116
throwIfNotDefined(renditionId, 'renditionId');
152-
153117
opts = opts || {};
154-
const postBody: null = null;
155118

156119
const pathParams = {
157120
nodeId,
158121
renditionId
159122
};
160123

161124
const queryParams = {
162-
'attachment': opts['attachment'],
163-
'placeholder': opts['placeholder']
125+
attachment: opts?.attachment,
126+
placeholder: opts?.placeholder
164127
};
165128

166129
const headerParams = {
167-
'If-Modified-Since': opts['ifModifiedSince'],
168-
'Range': opts['range']
130+
'If-Modified-Since': opts?.ifModifiedSince,
131+
'Range': opts?.range
169132
};
170-
const formParams = {
171-
};
172-
173-
const contentTypes = ['application/json'];
174-
const accepts = ['application/octet-stream'];
175133

176-
return this.apiClient.callApi(
177-
'/deleted-nodes/{nodeId}/renditions/{renditionId}/content', 'GET',
178-
pathParams, queryParams, headerParams, formParams, postBody,
179-
contentTypes, accepts , 'blob');
134+
return this.get({
135+
path: '/deleted-nodes/{nodeId}/renditions/{renditionId}/content',
136+
pathParams,
137+
queryParams,
138+
headerParams,
139+
accepts: ['application/octet-stream']
140+
});
180141
}
181142
/**
182143
* Get a deleted node
@@ -201,33 +162,22 @@ Gets the specific deleted node **nodeId**.
201162
* @return Promise<DeletedNodeEntry>
202163
*/
203164
getDeletedNode(nodeId: string, opts?: { include?: string[] }): Promise<DeletedNodeEntry> {
204-
205165
throwIfNotDefined(nodeId, 'nodeId');
206166

207-
opts = opts || {};
208-
const postBody: null = null;
209-
210167
const pathParams = {
211-
'nodeId': nodeId
168+
nodeId
212169
};
213170

214171
const queryParams = {
215-
'include': buildCollectionParam(opts['include'], 'csv')
216-
};
217-
218-
const headerParams = {
219-
220-
};
221-
const formParams = {
172+
include: buildCollectionParam(opts?.include, 'csv')
222173
};
223174

224-
const contentTypes = ['application/json'];
225-
const accepts = ['application/json'];
226-
227-
return this.apiClient.callApi(
228-
'/deleted-nodes/{nodeId}', 'GET',
229-
pathParams, queryParams, headerParams, formParams, postBody,
230-
contentTypes, accepts , DeletedNodeEntry);
175+
return this.get({
176+
path: '/deleted-nodes/{nodeId}',
177+
pathParams,
178+
queryParams,
179+
returnType: DeletedNodeEntry
180+
});
231181
}
232182
/**
233183
* Get deleted node content
@@ -372,7 +322,7 @@ If not supplied then the default value is 100.
372322
373323
* @return Promise<DeletedNodesPaging>
374324
*/
375-
listDeletedNodes(opts?: { skipCount?: number; maxItems?: string; include?: string[] }): Promise<DeletedNodesPaging> {
325+
listDeletedNodes(opts?: { skipCount?: number; maxItems?: number; include?: string[] }): Promise<DeletedNodesPaging> {
376326
opts = opts || {};
377327

378328
const queryParams = {

0 commit comments

Comments
 (0)