This repository has been archived by the owner on Feb 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ACS-5839] improved API typings (#1635)
* improved UploadApi typings * update docs * remove unused params * aspects api typings * types api typings * fix the bundling and treeshaking issue * cleanup ClassesApi * cleanup GroupsApi (partially) * cleanup api classes * restore delete methods for now
- Loading branch information
1 parent
8f9dc5e
commit 241a47e
Showing
18 changed files
with
267 additions
and
539 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,31 @@ | ||
# UploadApi | ||
|
||
|
||
Method | HTTP request | Description | ||
------------- | ------------- | ------------- | ||
[**uploadFile**](UploadApi.md#uploadFile) | | upload file content | ||
| Method | Description | | ||
|-------------------------------------------|---------------------| | ||
| [**uploadFile**](UploadApi.md#uploadFile) | upload file content | | ||
|
||
|
||
<a name="uploadFile"></a> | ||
# **uploadFile** | ||
> uploadFile(fileDefinition, relativePath: string, rootFolderId: string, nodeBody: any, opts?: any): Promise<any | Emitter> | ||
> uploadFile(fileDefinition, relativePath: string, rootFolderId: string, nodeBody: any, opts?: any): Promise<NodeEntry | any> | ||
|
||
### Example | ||
**Example** | ||
|
||
```javascript | ||
const alfrescoApi = new AlfrescoApi(/*...*/); | ||
const fs = require('fs'); | ||
const uploadApi = new UploadApi(alfrescoApi); | ||
const fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt'); | ||
|
||
let fs = require('fs'); | ||
|
||
let fileToUpload = fs.createReadStream('./folderA/folderB/newFile.txt'); | ||
|
||
let uploadApi = new UploadApi(this.alfrescoApi); | ||
uploadApi.uploadFile(fileToUpload) | ||
.then(() => { | ||
uploadApi.uploadFile(fileToUpload).then( | ||
() => { | ||
console.log('File Uploaded in the root'); | ||
}, (error) => { | ||
}, | ||
(error) => { | ||
console.log('Error during the upload' + error); | ||
}); | ||
|
||
|
||
``` | ||
|
||
|
Oops, something went wrong.