@@ -34,87 +34,52 @@ export class TrashcanApi extends BaseApi {
34
34
* Permanently delete a deleted node
35
35
*
36
36
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
37
-
38
- Permanently deletes the deleted node **nodeId**.
39
-
40
37
*
41
38
* @param nodeId The identifier of a node.
42
39
* @return Promise<{}>
43
40
*/
44
41
deleteDeletedNode ( nodeId : string ) : Promise < any > {
45
-
46
42
throwIfNotDefined ( nodeId , 'nodeId' ) ;
47
43
48
- const postBody : null = null ;
49
-
50
44
const pathParams = {
51
- 'nodeId' : nodeId
52
- } ;
53
-
54
- const queryParams = {
55
- } ;
56
-
57
- const headerParams = {
58
-
59
- } ;
60
- const formParams = {
45
+ nodeId
61
46
} ;
62
47
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
+ } ) ;
70
52
}
71
- /**
53
+
54
+ /**
72
55
* Get rendition information for a deleted node
73
56
*
74
57
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
75
-
76
- Gets the rendition information for **renditionId** of file **nodeId**.
77
-
78
58
*
79
59
* @param nodeId The identifier of a node.
80
60
* @param renditionId The name of a thumbnail rendition, for example *doclib*, or *pdf*.
81
61
* @return Promise<RenditionEntry>
82
62
*/
83
63
getArchivedNodeRendition ( nodeId : string , renditionId : string ) : Promise < RenditionEntry > {
84
-
85
64
throwIfNotDefined ( nodeId , 'nodeId' ) ;
86
65
throwIfNotDefined ( renditionId , 'renditionId' ) ;
87
66
88
- const postBody : null = null ;
89
-
90
67
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
101
70
} ;
102
71
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
+ } ) ;
110
77
}
111
- /**
78
+
79
+ /**
112
80
* Get rendition content of a deleted node
113
81
*
114
82
* **Note:** this endpoint is available in Alfresco 5.2 and newer versions.
115
-
116
- Gets the rendition content for **renditionId** of file **nodeId**.
117
-
118
83
*
119
84
* @param nodeId The identifier of a node.
120
85
* @param renditionId The name of a thumbnail rendition, for example *doclib*, or *pdf*.
@@ -149,34 +114,30 @@ than a 404 response.
149
114
} ) : Promise < Blob > {
150
115
throwIfNotDefined ( nodeId , 'nodeId' ) ;
151
116
throwIfNotDefined ( renditionId , 'renditionId' ) ;
152
-
153
117
opts = opts || { } ;
154
- const postBody : null = null ;
155
118
156
119
const pathParams = {
157
120
nodeId,
158
121
renditionId
159
122
} ;
160
123
161
124
const queryParams = {
162
- ' attachment' : opts [ ' attachment' ] ,
163
- ' placeholder' : opts [ ' placeholder' ]
125
+ attachment : opts ?. attachment ,
126
+ placeholder : opts ?. placeholder
164
127
} ;
165
128
166
129
const headerParams = {
167
- 'If-Modified-Since' : opts [ ' ifModifiedSince' ] ,
168
- 'Range' : opts [ ' range' ]
130
+ 'If-Modified-Since' : opts ?. ifModifiedSince ,
131
+ 'Range' : opts ?. range
169
132
} ;
170
- const formParams = {
171
- } ;
172
-
173
- const contentTypes = [ 'application/json' ] ;
174
- const accepts = [ 'application/octet-stream' ] ;
175
133
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
+ } ) ;
180
141
}
181
142
/**
182
143
* Get a deleted node
@@ -201,33 +162,22 @@ Gets the specific deleted node **nodeId**.
201
162
* @return Promise<DeletedNodeEntry>
202
163
*/
203
164
getDeletedNode ( nodeId : string , opts ?: { include ?: string [ ] } ) : Promise < DeletedNodeEntry > {
204
-
205
165
throwIfNotDefined ( nodeId , 'nodeId' ) ;
206
166
207
- opts = opts || { } ;
208
- const postBody : null = null ;
209
-
210
167
const pathParams = {
211
- 'nodeId' : nodeId
168
+ nodeId
212
169
} ;
213
170
214
171
const queryParams = {
215
- 'include' : buildCollectionParam ( opts [ 'include' ] , 'csv' )
216
- } ;
217
-
218
- const headerParams = {
219
-
220
- } ;
221
- const formParams = {
172
+ include : buildCollectionParam ( opts ?. include , 'csv' )
222
173
} ;
223
174
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
+ } ) ;
231
181
}
232
182
/**
233
183
* Get deleted node content
@@ -372,7 +322,7 @@ If not supplied then the default value is 100.
372
322
373
323
* @return Promise<DeletedNodesPaging>
374
324
*/
375
- listDeletedNodes ( opts ?: { skipCount ?: number ; maxItems ?: string ; include ?: string [ ] } ) : Promise < DeletedNodesPaging > {
325
+ listDeletedNodes ( opts ?: { skipCount ?: number ; maxItems ?: number ; include ?: string [ ] } ) : Promise < DeletedNodesPaging > {
376
326
opts = opts || { } ;
377
327
378
328
const queryParams = {
0 commit comments