Skip to content

Latest commit

 

History

History
285 lines (209 loc) · 16 KB

api.md

File metadata and controls

285 lines (209 loc) · 16 KB

Classes

Workspace

Class that represents a workspace

Objects

twx-parser : object

Entry point for the library

Typedefs

AppSnapshot : Object
ObjectVersion : Object
SnapshotCriteria : Object
ObjectCriteria : Object

Workspace

Class that represents a workspace

Kind: global class

new Workspace(name)

Create a workspace.

Param Type Description
name string The workspace name

workspace.addFile(filePath) ⇒ Promise.<(undefined|Error)>

Add a file to the workspace.

Kind: instance method of Workspace
Returns: Promise.<(undefined|Error)> - a Promise that will be resolved if the file is successfully parsed and added, or rejected with an Error instance if any error occurs.

Param Type Description
filePath string path to the TWX file to be added

workspace.removeFile(filePath) ⇒ Promise.<(undefined|Error)>

Remove a file from the workspace.

Kind: instance method of Workspace
Returns: Promise.<(undefined|Error)> - a Promise that will be resolved if the file is successfully parsed and removed, or rejected with an Error instance if any error occurs.

Param Type Description
filePath string path to the TWX file to be removed

workspace.getSnapshots(criteria) ⇒ Promise.<(Array.<AppSnapshot>|Error)>

Query snapshots from the workspace.

Kind: instance method of Workspace
Returns: Promise.<(Array.<AppSnapshot>|Error)> - a Promise that will be resolved with an array of AppSnapshot instances with the results that match the given criteria, or rejected with an Error instance if any error occurs

Param Type Description
criteria SnapshotCriteria search criteria

workspace.getSnapshotDependencies(inputData) ⇒ Promise.<(Array.<AppSnapshot>|Error)>

Retrieve snapshots that are direct children of the snapshot(s) passed as input.

Kind: instance method of Workspace
Returns: Promise.<(Array.<AppSnapshot>|Error)> - a Promise that will be resolved with an array of AppSnapshot instances with the results that match the given criteria, or rejected with an Error instance if any error occurs

Param Type Description
inputData AppSnapshot | Array.<AppSnapshot> snapshot(s) for which we want to retrieve children

workspace.getSnapshotWhereUsed(inputData) ⇒ Promise.<(Array.<AppSnapshot>|Error)>

Retrieve snapshots that are direct parents of the snapshot(s) passed as input.

Kind: instance method of Workspace
Returns: Promise.<(Array.<AppSnapshot>|Error)> - a Promise that will be resolved with an array of AppSnapshot instances with the results that match the given criteria, or rejected with an Error instance if any error occurs

Param Type Description
inputData AppSnapshot | Array.<AppSnapshot> snapshot(s) for which we want to retrieve parents

workspace.getSnapshotObjects(inputData) ⇒ Promise.<(Array.<ObjectVersion>|Error)>

Retrieve objects that belong to the snapshot(s) passed as input.

Kind: instance method of Workspace
Returns: Promise.<(Array.<ObjectVersion>|Error)> - a Promise that will be resolved with an array of ObjectVersion instances with the results that match the given criteria, or rejected with an Error instance if any error occurs

Param Type Description
inputData AppSnapshot | Array.<AppSnapshot> snapshot(s) for which we want to retrieve objects

workspace.getObjects(objectCriteria, snapshotCriteria) ⇒ Promise.<(Array.<ObjectVersion>|Error)>

Query objects from the workspace. Optionally, you can restrict results that belong to snapshot(s) that match the given criteria.

Kind: instance method of Workspace
Returns: Promise.<(Array.<ObjectVersion>|Error)> - a Promise that will be resolved with an array of ObjectVersion instances with the results that match the given criteria, or rejected with an Error instance if any error occurs

Param Type Description
objectCriteria ObjectCriteria search criteria
snapshotCriteria SnapshotCriteria snapshot search criteria to restrict results

workspace.getObjectDependencies(inputData, snapshotCriteria) ⇒ Promise.<(Array.<ObjectVersion>|Error)>

Retrieve objects that are direct children of the objects(s) passed as input. Optionally, you can restrict results that belong to snapshot(s) that match the given criteria.

Kind: instance method of Workspace
Returns: Promise.<(Array.<ObjectVersion>|Error)> - a Promise that will be resolved with an array of ObjectVersion instances with the results that match the given criteria, or rejected with an Error instance if any error occurs

Param Type Description
inputData ObjectVersion | Array.<ObjectVersion> object(s) for which we want to retrieve direct children
snapshotCriteria SnapshotCriteria snapshot search criteria to restrict results

workspace.getObjectWhereUsed(inputData, snapshotCriteria) ⇒ Promise.<(Array.<ObjectVersion>|Error)>

Retrieve objects that are direct parents of the objects(s) passed as input. Optionally, you can restrict results that belong to snapshot(s) that match the given criteria.

Kind: instance method of Workspace
Returns: Promise.<(Array.<ObjectVersion>|Error)> - a Promise that will be resolved with an array of ObjectVersion instances with the results that match the given criteria, or rejected with an Error instance if any error occurs

Param Type Description
inputData ObjectVersion | Array.<ObjectVersion> object(s) for which we want to retrieve direct parents
snapshotCriteria SnapshotCriteria snapshot search criteria to restrict results

workspace.getObjectSnapshots(inputData) ⇒ Promise.<(Array.<AppSnapshot>|Error)>

Retrieve snapshots whose object(s) passed as input belong to.

Kind: instance method of Workspace
Returns: Promise.<(Array.<AppSnapshot>|Error)> - a Promise that will be resolved with an array of AppSnapshot instances with the results that match the given criteria, or rejected with an Error instance if any error occurs

Param Type Description
inputData ObjectVersion | Array.<ObjectVersion> object(s) for which we want to retrieve snapshots

workspace.getLeafNodes() ⇒ Promise.<(Array.<object>|Error)>

Retrieve snapshots that do not depend on any other snapshots.

Kind: instance method of Workspace
Returns: Promise.<(Array.<object>|Error)> - a Promise that will be resolved with an array of results that match the given criteria, or rejected with an Error instance if any error occurs. The result has a getNextLevel method to retrieve the next level on the dependency tree.

workspace.getTopLevelNodes() ⇒ Promise.<(Array.<object>|Error)>

Retrieve snapshots that are not a dependency to any other snapshots.

Kind: instance method of Workspace
Returns: Promise.<(Array.<object>|Error)> - a Promise that will be resolved with an array of results that match the given criteria, or rejected with an Error instance if any error occurs. The result has a getNextLevel method to retrieve the next level on the dependency tree.

twx-parser : object

Entry point for the library

Kind: global namespace

twx-parser.getWorkspace(name, password) ⇒ Promise.<(Workspace|Error)>

Method to get or create a workspace

Kind: static method of twx-parser
Returns: Promise.<(Workspace|Error)> - Promise that will be resolved with a Workspace instance, or be rejected with an Error instance if any error occurs

Param Type Description
name string Name of the workspace. If a workspace with this name already exists, it is retrieved. Otherwise, a new workspace is created.
password string Password to open the workspace. If the workspace is new, the given password will be the workspace's password. If the workspace already exists, this password will be compared with the password used to create the workspace

AppSnapshot : Object

Kind: global typedef
Properties

Name Type Description
snapshotId string Snapshot ID
appId string Application ID
branchId string Branch ID
snapshotName string Snapshot Name
branchName string Branch Name
appShortName string Application Acronym
appName string Application Name
description string Application Description
buildVersion string Application Build Version
isToolkit boolean True if the snapshot is from a toolkit, and false otherwise
isSystem boolean True if the snapshot is made by IBM, and false otherwise

ObjectVersion : Object

Kind: global typedef
Properties

Name Type Description
objectVersionId string Object Version ID
objectId string Object ID
name string Object Name
type string Object Type
subtype string Object Subtype

SnapshotCriteria : Object

Kind: global typedef
Properties

Name Type Description
snapshotId string | Array.<string> use this property to query by one or more snapshot IDs
appId string | Array.<string> use this property to query by one or more application IDs
branchId string | Array.<string> use this property to query by one or more branch IDs
snapshotName string | Array.<string> use this property to query by one or more snapshot names
branchName string | Array.<string> use this property to query by one or more branch names
appShortName string | Array.<string> use this property to query by one or more application acronyms
appName string | Array.<string> use this property to query by one or more application names
description string | Array.<string> use this property to query by one or more application descriptions
buildVersion string | Array.<string> use this property to query by one or more application build versions
isToolkit string | Array.<boolean> use this property to query by toolkits or process applications
isSystem string | Array.<boolean> use this property to query by system toolkits or applications

ObjectCriteria : Object

Kind: global typedef
Properties

Name Type Description
objectVersionId string | Array.<string> use this property to query by one or more object version IDs
objectId string | Array.<string> use this property to query by one or more object IDs
name string | Array.<string> use this property to query by one or more object names
type string | Array.<string> use this property to query by one or more object types
subtype string | Array.<string> use this property to query by one or more object sub types