### aem-api

`0.1.2`
Need help reading this?

### AEM

new AEM()
Instance Members
▸ constructor(host, port, username, password)

Primes the AEM object for instance manipulation

constructor(host: Any, port: Any, username: Any, password: Any)
Parameters
host `(Any)`
port `(Any)`
username `(Any)`
password `(Any)`
▸ createNode(path, type, props)

Creates a node at a given path

createNode(path: Any, type: Any, props: Any): Promise<Node, Error>
Parameters
path `(Any)`
type `(Any)`
props `(Any)`
Returns
`Promise<Node, Error>`:
▸ moveNode(path, destination)

Move node to a new path

moveNode(path: Any, destination: Any): Promise<Node, Error>
Parameters
path `(Any)`
destination `(Any)`
Returns
`Promise<Node, Error>`:
▸ removeNode(path)

Removes a node at a given path

removeNode(path: Any): Promise<null, Error>
Parameters
path `(Any)`
Returns
`Promise<null, Error>`:
▸ getNode(path)

Fetchs a node from the repo

getNode(path: Any): Promise<Node, Error>
Parameters
path `(Any)`
Returns
`Promise<Node, Error>`:
▸ setProperties(path, props)

Sets properties on a node

setProperties(path: Any, props: Any): Promise<Node, Error>
Parameters
path `(Any)`
props `(Any)`
Returns
`Promise<Node, Error>`:
▸ setProperty(path, prop, val)

Sets a property on a given node

setProperty(path: Any, prop: Any, val: Any): Promise<Node, Error>
Parameters
path `(Any)`
prop `(Any)`
val `(Any)`
Returns
`Promise<Node, Error>`:
▸ removeProperties(path, props)

Removes properties from a node

removeProperties(path: Any, props: Array<String>): Promise<Node, Error>
Parameters
path `(Any)`
props `(Array<String>)`
Returns
`Promise<Node, Error>`:
▸ removeProperty(path, prop)

Removes a property from a node

removeProperty(path: Any, prop: Any): Promise<Node, Error>
Parameters
path `(Any)`
prop `(Any)`
Returns
`Promise<Node, Error>`:
▸ createFile(path, file, encoding, [mimeType])

Creates an nt:file

createFile(path: String, file: (String | Buffer | fs.ReadStream), encoding: String, mimeType: [String]): Promise<Node, Error>
Parameters
path `(String)`
file `((String | Buffer | fs.ReadStream))`
encoding `(String)`
mimeType `([String] (default `application/octet-stream`) )`
Returns
`Promise<Node, Error>`:
▸ updateFile(path, file, encoding, [mimeType], [createMode])

Updates an nt:file

updateFile(path: String, file: (String | Buffer | fs.ReadStream), encoding: String, mimeType: [String], createMode: [Boolean](default false)): Promise<Node, Error>
Parameters
path `(String)`
file `((String | Buffer | fs.ReadStream))`
encoding `(String)`
mimeType `([String] (default `application/octet-stream`) )`
createMode `([Boolean](default false))` are we creating a file, or just updating
Returns
`Promise<Node, Error>`:
▸ moveFile(path, destination)

Move file to new destination

moveFile(path: Any, destination: Any): Promise<Node, Error>
Parameters
path `(Any)`
destination `(Any)`
Returns
`Promise<Node, Error>`:
▸ removeFile(path)

Removes an nt:file at a given path

removeFile(path: Any): Promise<null, Error>
Parameters
path `(Any)`
Returns
`Promise<null, Error>`:
▸ activateNode(path, treeActivation, onlyModified, ignoreDeactivated)

Activates a node to pub instance

activateNode(path: Any, treeActivation: Any, onlyModified: Any, ignoreDeactivated: Any): Promise<Node, Error>
Parameters
path `(Any)`
treeActivation `(Any (default `false`) )`
onlyModified `(Any (default `true`) )`
ignoreDeactivated `(Any (default `true`) )`
Returns
`Promise<Node, Error>`:
▸ deactivateNode(path)

Deactivates a node

deactivateNode(path: Any): Promise<Node, Error>
Parameters
path `(Any)`
Returns
`Promise<Node, Error>`:

### Node

new Node()
Instance Members
▸ setProperties(props)

Sets properties on a node

setProperties(props: Any): Promise<Node, Error>
Parameters
props `(Any)`
Returns
`Promise<Node, Error>`:
▸ setProperty(prop, val)

Sets a property on a given node

setProperty(prop: Any, val: Any): Promise<Node, Error>
Parameters
prop `(Any)`
val `(Any)`
Returns
`Promise<Node, Error>`:
▸ removeProperties(props)

Removes properties from a node

removeProperties(props: Array<String>): Promise<Node, Error>
Parameters
props `(Array<String>)`
Returns
`Promise<Node, Error>`:
▸ removeProperty(prop)

Removes a property from a node

removeProperty(prop: Any): Promise<Node, Error>
Parameters
prop `(Any)`
Returns
`Promise<Node, Error>`:
▸ getProperties()

Returns an object of properties

getProperties(): Promise<Object, Error>
Returns
`Promise<Object, Error>`:
▸ getChildren()

Returns an object of child nodes

getChildren(): Promise<Object, Error>
Returns
`Promise<Object, Error>`:
▸ getChild(path)

Returns a child node

getChild(path: Any): Promise<Node, Error>
Parameters
path `(Any)`
Returns
`Promise<Node, Error>`:
▸ createChild(path, type, props)

Creates a child node

createChild(path: Any, type: Any, props: Any): Promise<Node, Error>
Parameters
path `(Any)`
type `(Any)`
props `(Any)`
Returns
`Promise<Node, Error>`:
▸ moveChild(path, destination)

Moves a child node, returns the child node

moveChild(path: Any, destination: Any): Promise<Node, Error>
Parameters
path `(Any)`
destination `(Any)`
Returns
`Promise<Node, Error>`:
▸ removeChild(path)

Removes a child node

removeChild(path: Any): Promise<null, Error>
Parameters
path `(Any)`
Returns
`Promise<null, Error>`:
▸ createFile(path, file, encoding, mimeType)

Creates a file relative to current node, returns new nt:file node

createFile(path: Any, file: Any, encoding: Any, mimeType: Any): Promise<Node, Error>
Parameters
path `(Any)`
file `(Any)`
encoding `(Any)`
mimeType `(Any)`
Returns
`Promise<Node, Error>`:
▸ updateFile(path, file, encoding, mimeType)

Updates a file relative to current node, returns nt:file node

updateFile(path: Any, file: Any, encoding: Any, mimeType: Any): Promise<Node, Error>
Parameters
path `(Any)`
file `(Any)`
encoding `(Any)`
mimeType `(Any)`
Returns
`Promise<Node, Error>`:
▸ removeFile(path)

Removes a file relative to current node

removeFile(path: Any): Promise<null, Error>
Parameters
path `(Any)`
Returns
`Promise<null, Error>`:
▸ move(destination)

Moves current node, returns updated node

move(destination: Any): Promise<Node, Error>
Parameters
destination `(Any)`
Returns
`Promise<Node, Error>`:
▸ remove()

Removes current node from repo

remove(): Promise<null, Error>
Returns
`Promise<null, Error>`:
▸ activate(treeActivation, onlyModified, ignoreDeactivated, args)

Activates node to pub instance

activate(treeActivation: Any, onlyModified: Any, ignoreDeactivated: Any, args: ...Any): Promise<Node, Error>
Parameters
treeActivation `(Any (default `false`) )`
onlyModified `(Any (default `true`) )`
ignoreDeactivated `(Any (default `true`) )`
args `(...Any)`
Returns
`Promise<Node, Error>`:
▸ deactivate()

Deactivates node

deactivate(): Promise<Node, Error>
Returns
`Promise<Node, Error>`: