OptionalcredentialOrConnector: LazyCredential | IConnectorAdds new dependency items to the project and updates now.config.json.
This method:
Supports adding dependencies from any ServiceNow table, with special handling for:
Configuration for the dependency to add
Array of sys_ids or table names. Use ['*'] to fetch all records from a scope
Scope filter (e.g., 'global', 'x_my_app'). Required when using wildcard '*'
Table name or alias (e.g., 'actions', 'sys_security_acl', 'sys_user')
// Add specific flow actions
await orchestrator.addDependency({
table: 'actions',
ids: ['action_id1', 'action_id2']
})
// Add all actions from a scope using wildcard
await orchestrator.addDependency({
table: 'actions',
ids: ['*'],
scope: 'global'
})
// Add specific security ACLs
await orchestrator.addDependency({
table: 'sys_security_acl',
ids: ['acl_id1', 'acl_id2']
})
// Add all ACLs from a custom scope
await orchestrator.addDependency({
table: 'sys_security_acl',
ids: ['*'],
scope: 'x_my_app'
})
// Add table definitions
await orchestrator.addDependency({
table: 'tables',
ids: ['incident', 'problem', 'change_request']
})
types for downloading existing dependencies
Applies a template to the project.
The ID of the template to apply.
Optionalparams: Record<string, string>The temlate files that were applied to the project
Build the project, generate the output files, and save the keys registry.
Optionaloptions: { frozenKeys?: boolean; sysIds?: string[] }The output files.
Cleans the build appOutDir and packOutputDir of the project.
Download the app contents from the connected ServiceNow instance.
Optionaloptions: Options for the download process, defaults to { method: 'complete' }
OptionaldownloadPath: stringThe path where the downloaded files will be saved. Defaults to os.tmpdir()/servicenow/download/GUID().
The path to the downloaded zip file.
Get documentation metadata for all APIs provided by loaded plugins. Returns a manifest mapping API names to their documentation paths and tags. Uses isomorphic module resolution that works in both Node.js and browser environments.
Install the project on the connected ServiceNow instance.
Optionaloptions: {Optionaloptions: { targetUpdateSetId?: string }Returns the last status of the app upgrade.
Generates sys_claim records on the instance to mark desired records as moved into this global app
Generate a ZIP archive containing the project's output which can be installed with install method
OptionalpackagePath: stringThe path where the ZIP archive will be saved. Defaults to packOutputDir/{package name_version}.zip.
The path to the generated ZIP archive.
Transforms the project's metadata files.
Optionaloptions: TransformOptions | TransformPaths | DownloadOptionsOptions for the transform process
The transformed files
Downloads and generates TypeScript type definitions for dependencies from a ServiceNow instance.
This method can download two types of definitions:
Optionaloptions: { downloadFluent?: boolean; downloadScripts?: boolean }Configuration options for what to download
OptionaldownloadFluent?: booleanDownload fluent type definitions from now.config.json (default: true)
OptionaldownloadScripts?: booleanDownload script type definitions (default: true)
// Download all dependencies (default)
await orchestrator.types()
// Download only script definitions
await orchestrator.types({ downloadScripts: true, downloadFluent: false })
// Download only fluent types
await orchestrator.types({ downloadScripts: false, downloadFluent: true })
addDependency for adding new dependencies programmatically
Unpacks a ZIP archive containing ServiceNow application files
The path to the ZIP archive.
The path where the files will be extracted.
The list of files extracted from the ZIP archive.
Optionaloptions: { targetUpdateSetId?: string }
The Orchestrator class is responsible for managing and coordinating the lifecycle of a project, including the build, packaging, and installation processes.