
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
teamcity-client
Advanced tools
const TeamcityClient = require('teamcity-client');
const api = new TeamcityClient({
host: 'teamcity.domain.com',
user: 'username', // optional
password: 'pwd' // optional
});
Get detail info about build
const options = {
tags: ['production', 'tested'],
user: 'username'
};
// get last build by criteria
api.build.detail(options)
.then(buildInfo => console.log(buildInfo))
.catch(err => console.error(err));
// get build by id
api.build.detail({id: 'my-build-id'})
.then(buildInfo => console.log(buildInfo))
.catch(err => console.error(err));
// get build by number
api.build.detail({number: '537'})
.then(buildInfo => console.log(buildInfo))
.catch(err => console.error(err));
Get list of builds by criteria
api.build.list({buildType: {id: 'project-id'}})
.then(buildList => console.log(buildList))
api.build.list({buildType: {id: 'project-id'}, tags: ['production']})
.then(buildList => console.log(buildList))
You can use all build locator params to get build
Download source
const fs = require('q-io/fs');
api.artifact.content(options, 'relative/path/to/source')
.then(blob => fs.write('data.zip', blob))
Get metadata
api.artifact.meta(options, 'source.json')
.then(data => console.log(data));
Response example
{
"name": "source.json",
"size": 25360,
"modificationTime": "20151202T183212+0300",
"href": "/guestAuth/app/rest/builds/id:10/artifacts/metadata/source.json",
"content": {
"href": "/guestAuth/app/rest/builds/id:10/artifacts/content/source.json"
}
}
Get children list
api.artifact.children(options, 'relative/path')
.then(data => console.log(JSON.stringify(data, null, 2)))
Response example
{
"count": 1,
"file": [
{
"name": "pathA",
"modificationTime": "2T183246+0300",
"href": "/guestAuth/app/rest/builds/id:4869415/artifacts/metadata/relative/path/pathA",
"children": {
"href": "/guestAuth/app/rest/builds/id:4869415/artifacts/children/relative/path/pathA"
}
},
]
}
Download archived sources
Download zip with all js-files in directory relative/path
api.artifact.archived(options, 'relative/path', '**/*.js')
.then(blob => fs.write('data.zip', blob))
Get tags
api.tags.get(locator)
.then(data => console.log(data))
Add tags
api.tags.add(locator, ['tag1', 'tag2'])
.then(data => console.log(data))
api.tags.add(locator, 'new_tag')
.then(data => console.log(data))
Replace tags
api.tags.replace(locator, ['tag1', 'tag2'])
.then(data => console.log(data))
api.tags.add(locator, 'new_tag')
.then(data => console.log(data))
Get changes list
api.changes.list(buildId)
.then(data => console.log(data))
Get changes list with details
api.changes.list(buildId, {withDetails: true})
.then(data => console.log(data))
Get particular change details
api.changes.detail(changeId)
.then(data => console.log(data))
FAQs
Teamcity Client for Node.js
We found that teamcity-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.