mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
* Revert "AAE-30882 Replace superagent (#11134)"
This reverts commit a347b20f20.
* AAE-0000 - Fixed lock for cli and adf
This commit is contained in:
@@ -15,17 +15,18 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import nock from 'nock';
|
||||
import { BaseMock } from '../base.mock';
|
||||
|
||||
export class VersionMock extends BaseMock {
|
||||
post201Response(nodeId: string, versionId: string): void {
|
||||
this.createNockWithCors()
|
||||
nock(this.host, { encodedQueryParams: true })
|
||||
.post('/alfresco/api/-default-/public/alfresco/versions/1/nodes/' + nodeId + '/versions/' + versionId + '/revert')
|
||||
.reply(201, { entry: { id: '3.0' } });
|
||||
}
|
||||
|
||||
get200Response(nodeId: string): void {
|
||||
this.createNockWithCors()
|
||||
nock(this.host, { encodedQueryParams: true })
|
||||
.get('/alfresco/api/-default-/public/alfresco/versions/1/nodes/' + nodeId + '/versions')
|
||||
.reply(200, {
|
||||
list: {
|
||||
@@ -42,7 +43,7 @@ export class VersionMock extends BaseMock {
|
||||
}
|
||||
|
||||
get200ResponseVersionRenditions(nodeId: string, versionId: string): void {
|
||||
this.createNockWithCors()
|
||||
nock(this.host, { encodedQueryParams: true })
|
||||
.get('/alfresco/api/-default-/public/alfresco/versions/1/nodes/' + nodeId + '/versions/' + versionId + '/renditions')
|
||||
.reply(200, {
|
||||
list: {
|
||||
@@ -102,7 +103,7 @@ export class VersionMock extends BaseMock {
|
||||
}
|
||||
|
||||
get200VersionRendition(nodeId: string, versionId: string, renditionId: string): void {
|
||||
this.createNockWithCors()
|
||||
nock(this.host, { encodedQueryParams: true })
|
||||
.get('/alfresco/api/-default-/public/alfresco/versions/1/nodes/' + nodeId + '/versions/' + versionId + '/renditions/' + renditionId)
|
||||
.reply(200, {
|
||||
entry: {
|
||||
@@ -114,7 +115,7 @@ export class VersionMock extends BaseMock {
|
||||
}
|
||||
|
||||
create200VersionRendition(nodeId: string, versionId: string): void {
|
||||
this.createNockWithCors()
|
||||
nock(this.host, { encodedQueryParams: true })
|
||||
.post('/alfresco/api/-default-/public/alfresco/versions/1/nodes/' + nodeId + '/versions/' + versionId + '/renditions', { id: 'pdf' })
|
||||
.reply(202, '');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user