Node.js client for the REST API of Classeur
This is alpha software: this is the first major release of this client library. While I've done my best to write thorough unit and integration tests, there may be bugs, and the API is subject to change in future versions.
- Source:
- See:
-
The ClasseurClient class for API usage information.
The README for an overview and more usage examples.
The source code on GitHub.
Examples
Installation
npm install classeur-api-client
Usage
const ClasseurClient = require('classeur-api-client');
const myClient = new ClasseurClient({ userId: "my id", apiKey: "my key" });
myClient.getFile("some file id", function(error, result) {
console.log(`Got a file called ${result.name}`);
console.log(`...and some markdown: ${result.content.text}`);
});
Classes
Type Definitions
-
File
-
Object representation of a Classeur file.
Type:
- Object
- Source:
Properties:
Name Type Description idString The ID of the file.
nameString The name of the file, as visible in the Classeur UI.
permission* Information on the access permissions of the file.
updatedNumber Timestamp (since epoch): the last time the file was updated.
contentClasseurClient~FileContent The content of the file.
-
FileContent
-
Object representation of a Classeur file's content.
Type:
- Object
- Source:
Properties:
Name Type Description textString The text content of the file.
revNumber The revision number of the file.
propertiesObject File properties.
discussionsArray.<Object> Array of objects, each representing a discussion entry regarding this file.
-
FileMetadata
-
Object representation of a Classeur file's metadata.
Type:
- Object
- Source:
Properties:
Name Type Description idString The ID of the file.
nameString The name of the file, as visible in the Classeur UI.
permission* Information on the access permissions of the file.
userIdString The ID of the user who owns the file.
updatedNumber Timestamp (since epoch): the last time the file was updated.
-
Folder
-
Object representation of a Classeur folder.
Type:
- Object
- Source:
Properties:
Name Type Description idString The ID of the folder.
nameString The name of the folder, as visible in the Classeur UI.
userIdString The ID of the user who owns the folder.
updatedNumber Timestamp (since epoch): the last time the folder was updated.
filesArray.<ClasseurClient~FolderFileEntry> List of objects, each representing a file contained within the folder.
-
FolderFileEntry
-
Object representation of a Classeur file entry in a folder.
Type:
- Object
- Source:
Properties:
Name Type Description idString The ID of the file.
nameString The name of the file, as visible in the Classeur UI.
userIdString The ID of the user who owns the file.
updatedNumber Timestamp (since epoch): the last time the file was updated.
-
FolderMetadata
-
Object representation of a Classeur folder's metadata.
Type:
- Object
- Source:
Properties:
Name Type Description idString The ID of the folder.
nameString The name of the folder, as visible in the Classeur UI.
userIdString The ID of the user who owns the folder.
updatedNumber Timestamp (since epoch): the last time the folder was updated.
-
ScrubbedCallback(error, result)
-
Standard
function(error, result) { ... }callbacks that get automatically wrapped so that eithererrororresultmust benull.Parameters:
Name Type Argument Description errorError | String <nullable>
An Error or error String, if an error occurred executing the function to which this callback was supplied, or
nullif the function was successful.result* <nullable>
Results of the function to which this callback was supplied, or
nullif the function was unsuccessful.resultwill benulleven if the function was partially successful, and was supposed to return an Array; partial result arrays are removed.
- Source:
-
UserMetadata
-
Object representation of a Classeur user's metadata.
Type:
- Object
- Source:
Properties:
Name Type Description idString The ID of the user.
nameString The name of the user.