Properties
Private charset
charset: string
defaultRepository
defaultRepository: any
Private errorHandler
errorHandler: function
Private password
password: string
repositories
repositories: Array<any>
Private token
token: string
Private username
username: string
Methods
addObjectToFolder
- addObjectToFolder(objectId: string, folderId: string, allVersions?: boolean, options?: object): Promise<any>
-
Parameters
-
objectId: string
-
folderId: string
-
Default value allVersions: boolean = false
-
Default value options: object = {}
-
Optional succinct?: boolean
Returns Promise<any>
appendContentStream
- appendContentStream(objectId: string, content: string | Blob | Buffer, isLastChunk?: boolean, filename?: string, options?: object): Promise<any>
-
Parameters
-
objectId: string
-
content: string | Blob | Buffer
-
Default value isLastChunk: boolean = false
-
Optional filename: string
-
Default value options: object = {}
-
Optional changeToken?: string
-
Optional succinct?: boolean
Returns Promise<any>
applyACL
- applyACL(objectId: string, addACEs?: object, removeACEs?: object, propagation?: string): Promise<any>
-
Parameters
-
objectId: string
-
Optional addACEs: object
-
Optional removeACEs: object
-
Optional propagation: string
Returns Promise<any>
applyPolicy
- applyPolicy(objectId: string, policyId: string, options?: object): Promise<any>
-
Parameters
-
objectId: string
-
policyId: string
-
Default value options: object = {}
-
Optional succinct?: boolean
Returns Promise<any>
bulkUpdateProperties
- bulkUpdateProperties(objectIds: string[], properties?: object, addSecondaryTypeIds?: string[], removeSecondaryTypeIds?: string[]): Promise<any>
-
Parameters
-
objectIds: string[]
-
Default value properties: object = {}
-
[k: string]: string | string[] | number | number[] | Date | Date[]
-
Default value addSecondaryTypeIds: string[] = []
-
Default value removeSecondaryTypeIds: string[] = []
Returns Promise<any>
cancelCheckOut
- cancelCheckOut(objectId: string): Promise<Response>
-
Parameters
Returns Promise<Response>
checkIn
- checkIn(objectId: string, major?: boolean, input: string | object, content: string | Blob | Buffer, mimeTypeExtension?: string, comment?: string, policies?: string[], addACEs?: object, removeACEs?: object, options?: object): Promise<any>
-
Parameters
-
objectId: string
-
Default value major: boolean = false
-
input: string | object
-
content: string | Blob | Buffer
-
Optional mimeTypeExtension: string
-
Optional comment: string
-
Optional policies: string[]
-
Optional addACEs: object
-
Optional removeACEs: object
-
Default value options: object = {}
-
Optional succinct?: boolean
Returns Promise<any>
checkOut
- checkOut(objectId: string, options?: object): Promise<any>
-
Parameters
-
objectId: string
-
Default value options: object = {}
-
Optional succinct?: boolean
Returns Promise<any>
createDocument
- createDocument(parentId: string, content: string | Blob | Buffer, input: string | object, mimeTypeExtension?: string, versioningState?: "none" | "major" | "minor" | "checkedout", policies?: string[], addACEs?: object, removeACEs?: object, options?: object): Promise<any>
-
Parameters
-
parentId: string
-
content: string | Blob | Buffer
-
input: string | object
-
Optional mimeTypeExtension: string
-
Optional versioningState: "none" | "major" | "minor" | "checkedout"
-
Optional policies: string[]
-
Optional addACEs: object
-
Optional removeACEs: object
-
Default value options: object = {}
-
Optional succinct?: boolean
Returns Promise<any>
createDocumentFromSource
- createDocumentFromSource(parentId: string, sourceId: string, content: string | Blob | Buffer, input: string | object, mimeTypeExtension?: string, versioningState?: "none" | "major" | "minor" | "checkedout", policies?: string[], addACEs?: object, removeACEs?: object, options?: object): Promise<any>
-
Parameters
-
parentId: string
-
sourceId: string
-
content: string | Blob | Buffer
-
input: string | object
-
Optional mimeTypeExtension: string
-
Optional versioningState: "none" | "major" | "minor" | "checkedout"
-
Optional policies: string[]
-
Optional addACEs: object
-
Optional removeACEs: object
-
Default value options: object = {}
-
Optional succinct?: boolean
Returns Promise<any>
createFolder
- createFolder(parentId: string, name: string, type?: string, policies?: Array<any>, addACEs?: object, removeACEs?: object): Promise<any>
-
Parameters
-
parentId: string
-
name: string
-
Default value type: string = "cmis:folder"
-
Default value policies: Array<any> = []
-
Default value addACEs: object = {}
-
Default value removeACEs: object = {}
Returns Promise<any>
createItem
- createItem(folderId: string, properties: object, policies?: string[], addACEs?: object, removeACEs?: object, options?: object): Promise<any>
-
Parameters
-
folderId: string
-
properties: object
-
[k: string]: string | string[] | number | number[] | Date | Date[]
-
Optional policies: string[]
-
Optional addACEs: object
-
Optional removeACEs: object
-
Default value options: object = {}
-
Optional succinct?: boolean
Returns Promise<any>
createPolicy
- createPolicy(folderId: string, properties: object, policies?: string[], addACEs?: object, removeACEs?: object, options?: object): Promise<any>
-
Parameters
-
folderId: string
-
properties: object
-
[k: string]: string | string[] | number | number[] | Date | Date[]
-
Optional policies: string[]
-
Optional addACEs: object
-
Optional removeACEs: object
-
Default value options: object = {}
-
Optional succinct?: boolean
Returns Promise<any>
createRelationship
- createRelationship(properties: object, policies?: string[], addACEs?: object, removeACEs?: object, options?: object): Promise<any>
-
Parameters
-
properties: object
-
[k: string]: string | string[] | number | number[] | Date | Date[]
-
Optional policies: string[]
-
Optional addACEs: object
-
Optional removeACEs: object
-
Default value options: object = {}
-
Optional succinct?: boolean
Returns Promise<any>
createType
- createType(type: any): Promise<any>
-
Parameters
Returns Promise<any>
deleteContentStream
- deleteContentStream(objectId: string, options?: object): Promise<any>
-
Parameters
-
objectId: string
-
Default value options: object = {}
-
Optional changeToken?: string
-
Optional succinct?: boolean
Returns Promise<any>
deleteObject
- deleteObject(objectId: string, allVersions?: boolean): Promise<Response>
-
Parameters
-
objectId: string
-
Default value allVersions: boolean = false
Returns Promise<Response>
deleteTree
- deleteTree(objectId: any, allVersions?: boolean, unfileObjects?: "unfile" | "deletesinglefiled" | "delete", continueOnFailure?: boolean): Promise<Response>
-
Parameters
-
objectId: any
-
Default value allVersions: boolean = false
-
Optional unfileObjects: "unfile" | "deletesinglefiled" | "delete"
-
Default value continueOnFailure: boolean = false
Returns Promise<Response>
deleteType
- deleteType(typeId: string): Promise<any>
-
Parameters
Returns Promise<any>
Private get
- get(url: string, options?: Options): Promise<Response>
-
Parameters
-
url: string
-
Optional options: Options
Returns Promise<Response>
getACL
- getACL(objectId: string, onlyBasicPermissions?: boolean): Promise<any>
-
Parameters
-
objectId: string
-
Default value onlyBasicPermissions: boolean = false
Returns Promise<any>
getAllVersions
- getAllVersions(versionSeriesId: string, options?: object): Promise<any>
-
Parameters
-
versionSeriesId: string
-
Default value options: object = {}
-
Optional filter?: string
-
Optional includeAllowableActions?: boolean
-
Optional succinct?: boolean
Returns Promise<any>
getAllowableActions
- getAllowableActions(objectId: string, options?: object): Promise<any>
-
Parameters
-
objectId: string
-
Default value options: object = {}
-
Optional filter?: string
-
Optional includeAllowableActions?: boolean
-
Optional includeRelationships?: "none" | "source" | "target" | "both"
-
Optional maxItems?: number
-
Optional orderBy?: string
-
Optional renditionFilter?: string
-
Optional skipCount?: number
-
Optional succinct?: boolean
Returns Promise<any>
getAppliedPolicies
- getAppliedPolicies(objectId: string, options?: object): Promise<any>
-
Parameters
-
objectId: string
-
Default value options: object = {}
-
Optional filter?: string
-
Optional succinct?: boolean
Returns Promise<any>
getCheckedOutDocs
- getCheckedOutDocs(objectId?: string, options?: object): Promise<any>
-
Parameters
-
Optional objectId: string
-
Default value options: object = {}
-
Optional filter?: string
-
Optional includeAllowableActions?: boolean
-
Optional includeRelationships?: "none" | "source" | "target" | "both"
-
Optional maxItems?: number
-
Optional orderBy?: string
-
Optional renditionFilter?: string
-
Optional skipCount?: number
-
Optional succinct?: boolean
Returns Promise<any>
getChildren
- getChildren(objectId: string, options?: object): Promise<any>
-
Parameters
-
objectId: string
-
Default value options: object = {}
-
Optional filter?: string
-
Optional includeAllowableActions?: boolean
-
Optional includePathSegment?: boolean
-
Optional includeRelationships?: "none" | "source" | "target" | "both"
-
Optional maxItems?: number
-
Optional orderBy?: string
-
Optional renditionFilter?: string
-
Optional skipCount?: number
-
Optional succinct?: boolean
Returns Promise<any>
getContentChanges
- getContentChanges(changeLogToken?: string, includeProperties?: boolean, includePolicyIds?: boolean, includeACL?: boolean, options?: object): Promise<any>
-
Parameters
-
Optional changeLogToken: string
-
Default value includeProperties: boolean = false
-
Default value includePolicyIds: boolean = false
-
Default value includeACL: boolean = false
-
Default value options: object = {}
-
Optional maxItems?: number
-
Optional succinct?: boolean
Returns Promise<any>
getContentStream
- getContentStream(objectId: string, download?: "attachment" | "inline", streamId?: string): Promise<Response>
-
Parameters
-
objectId: string
-
Default value download: "attachment" | "inline" = "inline"
-
Optional streamId: string
Returns Promise<Response>
getContentStreamURL
- getContentStreamURL(objectId: string, download?: "attachment" | "inline", streamId?: string): string
-
Parameters
-
objectId: string
-
Default value download: "attachment" | "inline" = "inline"
-
Optional streamId: string
Returns string
getDescendants
- getDescendants(folderId: string, depth?: number, options?: object): Promise<any>
-
Parameters
-
folderId: string
-
Optional depth: number
-
Default value options: object = {}
-
Optional filter?: string
-
Optional includeAllowableActions?: boolean
-
Optional includePathSegment?: boolean
-
Optional includeRelationships?: "none" | "source" | "target" | "both"
-
Optional renditionFilter?: string
-
Optional succinct?: boolean
Returns Promise<any>
getFolderParent
- getFolderParent(folderId: string, options?: object): Promise<any>
-
Parameters
-
folderId: string
-
Default value options: object = {}
-
Optional succinct?: boolean
Returns Promise<any>
getFolderTree
- getFolderTree(folderId: string, depth?: number, options?: object): Promise<any>
-
Parameters
-
folderId: string
-
Optional depth: number
-
Default value options: object = {}
-
Optional filter?: string
-
Optional includeAllowableActions?: boolean
-
Optional includePathSegment?: boolean
-
Optional includeRelationships?: "none" | "source" | "target" | "both"
-
Optional renditionFilter?: string
-
Optional succinct?: boolean
Returns Promise<any>
getLastResult
- getLastResult(): Promise<any>
getObject
- getObject(objectId: string, returnVersion?: "this" | "latest" | "latestmajor", options?: object): Promise<any>
-
Parameters
-
objectId: string
-
Optional returnVersion: "this" | "latest" | "latestmajor"
-
Default value options: object = {}
-
Optional filter?: string
-
Optional includeACL?: boolean
-
Optional includeAllowableActions?: boolean
-
Optional includePolicyIds?: boolean
-
Optional includeRelationships?: "none" | "source" | "target" | "both"
-
Optional renditionFilter?: string
-
Optional succinct?: boolean
Returns Promise<any>
getObjectByPath
- getObjectByPath(path: string, options?: object): Promise<any>
-
Parameters
-
path: string
-
Default value options: object = {}
-
Optional filter?: string
-
Optional includeACL?: boolean
-
Optional includeAllowableActions?: boolean
-
Optional includePolicyIds?: boolean
-
Optional includeRelationships?: "none" | "source" | "target" | "both"
-
Optional renditionFilter?: string
-
Optional succinct?: boolean
Returns Promise<any>
getObjectOfLatestVersion
- getObjectOfLatestVersion(versionSeriesId: string, options?: object): Promise<any>
-
Parameters
-
versionSeriesId: string
-
Default value options: object = { major: false }
-
Optional filter?: string
-
Optional includeACL?: boolean
-
Optional includeAllowableActions?: boolean
-
Optional includePolicyIds?: boolean
-
Optional includeRelationships?: "none" | "source" | "target" | "both"
-
Optional major?: boolean
-
Optional renditionFilter?: string
-
Optional succinct?: boolean
Returns Promise<any>
getObjectRelationships
- getObjectRelationships(objectId: string, includeSubRelationshipTypes?: boolean, relationshipDirection?: string, typeId?: string, options?: object): Promise<any>
-
Parameters
-
objectId: string
-
Default value includeSubRelationshipTypes: boolean = false
-
Optional relationshipDirection: string
-
Optional typeId: string
-
Default value options: object = {}
-
Optional filter?: string
-
Optional includeAllowableActions?: boolean
-
Optional maxItems?: number
-
Optional skipCount?: number
-
Optional succinct?: boolean
Returns Promise<any>
getParents
- getParents(objectId: string, options?: object): Promise<any>
-
Parameters
-
objectId: string
-
Default value options: object = {}
-
Optional filter?: string
-
Optional includeAllowableActions?: boolean
-
Optional includePathSegment?: boolean
-
Optional includeRelationships?: "none" | "source" | "target" | "both"
-
Optional renditionFilter?: string
-
Optional succinct?: boolean
Returns Promise<any>
getProperties
- getProperties(objectId: string, returnVersion?: "this" | "latest" | "latestmajor", options?: object): Promise<any>
-
Parameters
-
objectId: string
-
Optional returnVersion: "this" | "latest" | "latestmajor"
-
Default value options: object = {}
-
Optional filter?: string
-
Optional succinct?: boolean
Returns Promise<any>
getRenditions
- getRenditions(objectId: string, options?: object): Promise<any>
-
Parameters
-
objectId: string
-
Default value options: object = {renditionFilter: '*'}
-
Optional maxItems?: number
-
renditionFilter: string
-
Optional skipCount?: number
Returns Promise<any>
getRepositoryInfo
- getRepositoryInfo(): Promise<any>
getTypeChildren
- getTypeChildren(typeId?: string, includePropertyDefinitions?: boolean, options?: object): Promise<any>
-
Parameters
-
Optional typeId: string
-
Optional includePropertyDefinitions: boolean
-
Default value options: object = {}
-
Optional maxItems?: number
-
Optional skipCount?: number
Returns Promise<any>
getTypeDefinition
- getTypeDefinition(typeId: string): Promise<any>
-
Parameters
Returns Promise<any>
getTypeDescendants
- getTypeDescendants(typeId?: string, depth?: number, includePropertyDefinitions?: boolean): Promise<any>
-
Parameters
-
Optional typeId: string
-
Optional depth: number
-
Optional includePropertyDefinitions: boolean
Returns Promise<any>
Private http
- http(method: "GET" | "POST", url: string, options: Options, multipartData?: object): Promise<Response>
-
Parameters
-
method: "GET" | "POST"
-
url: string
-
-
Optional multipartData: object
-
content: string | Blob | Buffer
-
filename: string
-
Optional mimeTypeExtension?: string
Returns Promise<Response>
loadRepositories
- loadRepositories(): Promise<void>
moveObject
- moveObject(objectId: string, sourceFolderId: string, targetFolderId: string, options?: object): Promise<any>
-
Parameters
-
objectId: string
-
sourceFolderId: string
-
targetFolderId: string
-
Default value options: object = {}
-
Optional succinct?: boolean
Returns Promise<any>
Private post
- post(url: string, options?: Options, multipartData?: object): Promise<Response>
-
Parameters
-
url: string
-
Optional options: Options
-
Optional multipartData: object
-
content: string | Blob | Buffer
-
filename: string
-
Optional mimeTypeExtension?: string
Returns Promise<Response>
query
- query(statement: string, searchAllVersions?: boolean, options?: object): Promise<any>
-
Parameters
-
statement: string
-
Default value searchAllVersions: boolean = false
-
Default value options: object = {}
-
Optional includeAllowableActions?: boolean
-
Optional includeRelationships?: "none" | "source" | "target" | "both"
-
Optional maxItems?: number
-
Optional orderBy?: string
-
Optional renditionFilter?: string
-
Optional skipCount?: number
-
Optional succinct?: boolean
Returns Promise<any>
removeObjectFromFolder
- removeObjectFromFolder(objectId: string, folderId: string, options?: object): Promise<any>
-
Parameters
-
objectId: string
-
folderId: string
-
Default value options: object = {}
-
Optional succinct?: boolean
Returns Promise<any>
removePolicy
- removePolicy(objectId: string, policyId: string, options?: object): Promise<any>
-
Parameters
-
objectId: string
-
policyId: string
-
Default value options: object = {}
-
Optional succinct?: boolean
Returns Promise<any>
Private setACEs
- setACEs(options: Options, ACEs: object, action: "add" | "remove"): void
-
Parameters
-
-
ACEs: object
-
action: "add" | "remove"
Returns void
setContentStream
- setContentStream(objectId: string, content: string | Blob | Buffer, overwriteFlag?: boolean, filename?: string, options?: object): Promise<any>
-
Parameters
-
objectId: string
-
content: string | Blob | Buffer
-
Default value overwriteFlag: boolean = false
-
Optional filename: string
-
Default value options: object = {}
-
Optional changeToken?: string
-
Optional succinct?: boolean
Returns Promise<any>
setCredentials
- setCredentials(username: string, password: string): CmisSession
-
Parameters
-
username: string
-
password: string
setErrorHandler
- setErrorHandler(handler: function): void
Private setPolicies
- setPolicies(options: Options, policies: Array<string>): void
Private setProperties
- setProperties(options: Options, properties: object): void
-
Parameters
-
-
properties: object
-
[k: string]: string | string[] | number | number[] | Date | Date[]
Returns void
Private setSecondaryTypeIds
- setSecondaryTypeIds(options: Options, secondaryTypeIds: Array<string>, action: "add" | "remove"): void
-
Parameters
-
-
secondaryTypeIds: Array<string>
-
action: "add" | "remove"
Returns void
updateProperties
- updateProperties(objectId: string, properties: object, options?: object): Promise<any>
-
Parameters
-
objectId: string
-
properties: object
-
[k: string]: string | string[] | number | number[] | Date | Date[]
-
Default value options: object = {}
-
Optional changeToken?: string
-
Optional succinct?: boolean
Returns Promise<any>
updateType
- updateType(type: any): Promise<any>
-
Parameters
Returns Promise<any>
Object literals
Private options
options: object
succinct
succinct: boolean = true
The session is the entry point for all cmis requests
example usage:
// typescript/es6 let session = new cmis.CmisSession('http://localhost:18080/alfresco/cmisbrowser'); session.setCredentials(username, password).loadRepositories() .then(() => session.query("select * from cmis:document")) .then(data => console.log(data)); // javascript/es5 var session = new cmis.CmisSession('http://localhost:18080/alfresco/cmisbrowser'); session.setCredentials(username, password).loadRepositories().then(function(){ return session.query("select * from cmis:document")); }).then(function(data) {console.log(data);});