
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
hikvision-apis
Advanced tools
Supply Chain Security
Vulnerability
Quality
Maintenance
License
The project contains a collection of ISAPI APIs from HIK Vision, described in https://tpp.hikvision.com/Wiki/ISAPI/, and allows the conversion of XML types to TypeScript types.
Create an ISAPI instance.
const instance = new ISAPI({
host: '192.168.1.64',
port: 80,
username: 'admin',
password: 'password',
});
Call api using url.
import { PTZChannelList } from '@types';
const url = '/ISAPI/PTZCtrl/channels';
instance
.get<PTZChannelList>(url)
.then((res: PTZChannelList) => console.log(res))
.catch((error: AxiosError<ResponseStatus>) =>
console.error(error.response?.data),
);
Or call provided apis.
instance
.getPTZCtrlChannels()
.then((res: PTZChannelList) => console.log(res))
.catch((error: AxiosError<ResponseStatus>) =>
console.error(error.response?.data),
);
The response is as follows.
{
PTZChannelList: {
_attributes: {
version: '2.0',
xmlns: 'http://www.hikvision.com/ver20/XMLSchema'
},
PTZChannel: {
_attributes: [Object],
id: 1,
enabled: true,
videoInputID: 1,
controlProtocol: 'PELCO-D',
controlAddress: [Object],
panSupport: true,
tiltSupport: true,
zoomSupport: false
}
}
}
Get xml response by calling get with { convert: false }
parameter.
const url = '/ISAPI/PTZCtrl/channels';
await instance
.get<string>(url, { convert: false })
.then((res: string) => console.log(res))
.catch((error: AxiosError) => console.error(error));
XML response.
<?xml version="1.0" encoding="UTF-8"?>
<PTZChannelList version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
<PTZChannel version="2.0" xmlns="http://www.hikvision.com/ver20/XMLSchema">
<id>1</id>
<enabled>true</enabled>
<videoInputID>1</videoInputID>
<controlProtocol>PELCO-D</controlProtocol>
<controlAddress>
<enabled>true</enabled>
<Address>0</Address>
</controlAddress>
<panSupport>true</panSupport>
<tiltSupport>true</tiltSupport>
<zoomSupport>false</zoomSupport>
</PTZChannel>
</PTZChannelList >
Clone the repo and run docs script.
git clone git@github.com:sakharin/hikvision-apis.git
cd hikvision-apis
npm install
npm run doc
Then open docs/index.html
.
The project structure is modified from tomchen/example-typescript-package.
FAQs
HIKVISION APIs
The npm package hikvision-apis receives a total of 1 weekly downloads. As such, hikvision-apis popularity was classified as not popular.
We found that hikvision-apis 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.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.