dctrackclient
Advanced tools
Comparing version 1.2.2 to 1.3.0
{ | ||
"name": "dctrackclient", | ||
"version": "1.2.2", | ||
"version": "1.3.0", | ||
"description": "Sunbird dcTrack API client in JavaScript", | ||
@@ -26,5 +26,5 @@ "main": "src/index.js", | ||
"node-fetch": "^3.3.2", | ||
"https-proxy-agent": "^7.0.2", | ||
"socks-proxy-agent": "^8.0.2" | ||
"https-proxy-agent": "^7.0.4", | ||
"socks-proxy-agent": "^8.0.3" | ||
} | ||
} |
@@ -9,3 +9,3 @@ # dcTrackClient [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/nicfv/dcTrackClient/publish.yml?logo=github)](https://github.com/nicfv/dcTrackClient) [![PyPI](https://img.shields.io/pypi/v/dcTrackClient)](https://pypi.org/project/dcTrackClient/) [![PyPI - Downloads](https://img.shields.io/pypi/dm/dcTrackClient?logo=pypi)](https://pypi.org/project/dcTrackClient/) [![npm](https://img.shields.io/npm/v/dctrackclient)](https://www.npmjs.com/package/dctrackclient) [![npm](https://img.shields.io/npm/dt/dctrackclient?logo=npm)](https://www.npmjs.com/package/dctrackclient) | ||
```shell | ||
pip install dcTrackClient==1.2.2 | ||
pip install dcTrackClient==1.3.0 | ||
``` | ||
@@ -15,3 +15,3 @@ | ||
```shell | ||
npm i dctrackclient@1.2.2 | ||
npm i dctrackclient@1.3.0 | ||
``` | ||
@@ -210,3 +210,3 @@ | ||
https://www.sunbirddcim.com/help/dcTrack/v910/API/en/Default.htm | ||
https://www.sunbirddcim.com/help/dcTrack/v911/API/en/Default.htm | ||
@@ -440,6 +440,6 @@ # Package Documentation | ||
## searchConnectors(pageNumber, pageSize, usedCount, payload) | ||
> Retrieve a List of Connectors. Returns JSON entity containing Connector information that was passed in from the Request payload. Please note, Compatible Connectors are not returned by this API, but can be returned when querying a single Connector using the /api/v2/settings/connectors/{connectorId} API. | ||
## searchConnectors(pageNumber, pageSize, payload) | ||
> Search for Connectors using criteria JSON object. Search criteria can be any of the fields applicable to Connector, including custom fields. Specify the fields to be included in the response. This API supports pagination. Returns a list of Connectors with the specified information. | ||
``` | ||
POST api/v2/settings/connectors/quicksearch payload | ||
POST api/v2/quicksearch/connectors payload | ||
``` | ||
@@ -450,3 +450,2 @@ |Parameter|Type| | ||
|pageSize|number| | ||
|usedCount|boolean| | ||
|payload|object| | ||
@@ -555,2 +554,62 @@ | ||
## getBreakers(panelItemID) | ||
> Get a list of all Breakers for a given Panel Item. Returns JSON entity containing an array of all the Breakers for the specified Panel Item. | ||
``` | ||
GET api/v2/dcimoperations/items/{panelItemID}/breakers | ||
``` | ||
|Parameter|Type| | ||
|---|---| | ||
|panelItemID|number| | ||
## getBreaker(panelItemID, breakerPortId) | ||
> Get a list of all Breakers for a given Panel Item. Returns JSON entity containing information for a single Panel Item Breaker. | ||
``` | ||
GET api/v2/dcimoperations/items/{panelItemID}/breakers/{breakerPortId} | ||
``` | ||
|Parameter|Type| | ||
|---|---| | ||
|panelItemID|number| | ||
|breakerPortId|number| | ||
## updateBreaker(panelItemD, beakerPortID, payload) | ||
> Update a single Breaker for a given Panel Item. Returns JSON entity containing information for the updated Panel Item Breaker. Note: This API performs as a true PUT and not a PATCH. Unlike with a PATCH, you must specify all attributes even if you want to change only one. Attributes that are not included in the Request will be considered as removed. | ||
``` | ||
PUT api/v2/dcimoperations/items/{panelItemD}/breakers/{beakerPortID} payload | ||
``` | ||
|Parameter|Type| | ||
|---|---| | ||
|panelItemD|string| | ||
|beakerPortID|number| | ||
|payload|object| | ||
## createBreaker(panelItemId, payload) | ||
> Create a single Breaker for a given Panel Item. Returns JSON entity containing information for the created Panel Item Breaker. Note: Breaker State is set based on the connection status of the Breaker. If the breaker is connected it will always be set to "Closed", even if "Open" is specified in the Request. | ||
``` | ||
POST api/v2/dcimoperations/items/{panelItemId}/breakers payload | ||
``` | ||
|Parameter|Type| | ||
|---|---| | ||
|panelItemId|number| | ||
|payload|object| | ||
## deleteBreaker(panelItemID, breakerPortId) | ||
> Delete a Breaker for a given Panel Item. Returns empty JSON. | ||
``` | ||
DELETE api/v2/dcimoperations/items/{panelItemID}/breakers/{breakerPortId} | ||
``` | ||
|Parameter|Type| | ||
|---|---| | ||
|panelItemID|number| | ||
|breakerPortId|number| | ||
## createBreakersBulk(panelItemID, payload) | ||
> Add/Update/Delete Breakers for a given Panel Item. | ||
``` | ||
POST api/v2/dcimoperations/items/{panelItemID}/breakers/bulk payload | ||
``` | ||
|Parameter|Type| | ||
|---|---| | ||
|panelItemID|number| | ||
|payload|object| | ||
## getLocations() | ||
@@ -620,9 +679,2 @@ > Returns a list for all Locations. | ||
## getSublocationTree() | ||
> Get the sublocation tree. | ||
``` | ||
GET api/v2/subLocations/tree | ||
``` | ||
*No parameters.* | ||
## getSublocations(locationId) | ||
@@ -847,2 +899,20 @@ > Get all sub-locations for a given location in the hierarchy. The locationId is the ID of the location to get the sub-locations for. | ||
## updateDefaultValue(payload) | ||
> Update the default value for a picklist field. | ||
``` | ||
PUT api/v2/settings/lists/defaultValue payload | ||
``` | ||
|Parameter|Type| | ||
|---|---| | ||
|payload|object| | ||
## getFieldProperties(entity) | ||
> Get the properties for all fields applicable to the Entity. | ||
``` | ||
GET api/v2/settings/lists/fieldProperties | ||
``` | ||
|Parameter|Type| | ||
|---|---| | ||
|entity|string| | ||
## submitRequest(id, payload) | ||
@@ -849,0 +919,0 @@ > Create a request. |
@@ -5,3 +5,3 @@ import fetch from 'node-fetch'; | ||
/** | ||
* Sunbird dcTrack API client version 1.2.2 in JavaScript | ||
* Sunbird dcTrack API client version 1.3.0 in JavaScript | ||
*/ | ||
@@ -253,10 +253,9 @@ export class Client { | ||
/** | ||
* Retrieve a List of Connectors. Returns JSON entity containing Connector information that was passed in from the Request payload. Please note, Compatible Connectors are not returned by this API, but can be returned when querying a single Connector using the /api/v2/settings/connectors/{connectorId} API. | ||
* Search for Connectors using criteria JSON object. Search criteria can be any of the fields applicable to Connector, including custom fields. Specify the fields to be included in the response. This API supports pagination. Returns a list of Connectors with the specified information. | ||
* @param {number} pageNumber | ||
* @param {number} pageSize | ||
* @param {boolean} usedCount | ||
* @param {object} payload | ||
*/ | ||
Client.prototype.searchConnectors = function (pageNumber, pageSize, usedCount, payload) { | ||
return this.request('POST', '/api/v2/settings/connectors/quicksearch?pageNumber=' + pageNumber + '&pageSize=' + pageSize + '&usedCount=' + usedCount + '&', payload); | ||
Client.prototype.searchConnectors = function (pageNumber, pageSize, payload) { | ||
return this.request('POST', '/api/v2/quicksearch/connectors?pageNumber=' + pageNumber + '&pageSize=' + pageSize + '&', payload); | ||
} | ||
@@ -356,2 +355,56 @@ | ||
/** | ||
* Get a list of all Breakers for a given Panel Item. Returns JSON entity containing an array of all the Breakers for the specified Panel Item. | ||
* @param {number} panelItemID | ||
*/ | ||
Client.prototype.getBreakers = function (panelItemID) { | ||
return this.request('GET', '/api/v2/dcimoperations/items/' + panelItemID + '/breakers?'); | ||
} | ||
/** | ||
* Get a list of all Breakers for a given Panel Item. Returns JSON entity containing information for a single Panel Item Breaker. | ||
* @param {number} panelItemID | ||
* @param {number} breakerPortId | ||
*/ | ||
Client.prototype.getBreaker = function (panelItemID, breakerPortId) { | ||
return this.request('GET', '/api/v2/dcimoperations/items/' + panelItemID + '/breakers/' + breakerPortId + '?'); | ||
} | ||
/** | ||
* Update a single Breaker for a given Panel Item. Returns JSON entity containing information for the updated Panel Item Breaker. Note: This API performs as a true PUT and not a PATCH. Unlike with a PATCH, you must specify all attributes even if you want to change only one. Attributes that are not included in the Request will be considered as removed. | ||
* @param {string} panelItemD | ||
* @param {number} beakerPortID | ||
* @param {object} payload | ||
*/ | ||
Client.prototype.updateBreaker = function (panelItemD, beakerPortID, payload) { | ||
return this.request('PUT', '/api/v2/dcimoperations/items/' + panelItemD + '/breakers/' + beakerPortID + '?', payload); | ||
} | ||
/** | ||
* Create a single Breaker for a given Panel Item. Returns JSON entity containing information for the created Panel Item Breaker. Note: Breaker State is set based on the connection status of the Breaker. If the breaker is connected it will always be set to "Closed", even if "Open" is specified in the Request. | ||
* @param {number} panelItemId | ||
* @param {object} payload | ||
*/ | ||
Client.prototype.createBreaker = function (panelItemId, payload) { | ||
return this.request('POST', '/api/v2/dcimoperations/items/' + panelItemId + '/breakers?', payload); | ||
} | ||
/** | ||
* Delete a Breaker for a given Panel Item. Returns empty JSON. | ||
* @param {number} panelItemID | ||
* @param {number} breakerPortId | ||
*/ | ||
Client.prototype.deleteBreaker = function (panelItemID, breakerPortId) { | ||
return this.request('DELETE', '/api/v2/dcimoperations/items/' + panelItemID + '/breakers/' + breakerPortId + '?'); | ||
} | ||
/** | ||
* Add/Update/Delete Breakers for a given Panel Item. | ||
* @param {number} panelItemID | ||
* @param {object} payload | ||
*/ | ||
Client.prototype.createBreakersBulk = function (panelItemID, payload) { | ||
return this.request('POST', '/api/v2/dcimoperations/items/' + panelItemID + '/breakers/bulk?', payload); | ||
} | ||
/** | ||
* Returns a list for all Locations. | ||
@@ -416,9 +469,2 @@ */ | ||
/** | ||
* Get the sublocation tree. | ||
*/ | ||
Client.prototype.getSublocationTree = function () { | ||
return this.request('GET', '/api/v2/subLocations/tree?'); | ||
} | ||
/** | ||
* Get all sub-locations for a given location in the hierarchy. The locationId is the ID of the location to get the sub-locations for. | ||
@@ -621,2 +667,18 @@ * @param {number} locationId | ||
/** | ||
* Update the default value for a picklist field. | ||
* @param {object} payload | ||
*/ | ||
Client.prototype.updateDefaultValue = function (payload) { | ||
return this.request('PUT', '/api/v2/settings/lists/defaultValue?', payload); | ||
} | ||
/** | ||
* Get the properties for all fields applicable to the Entity. | ||
* @param {string} entity | ||
*/ | ||
Client.prototype.getFieldProperties = function (entity) { | ||
return this.request('GET', '/api/v2/settings/lists/fieldProperties?entity=' + entity + '&'); | ||
} | ||
/** | ||
* Create a request. | ||
@@ -623,0 +685,0 @@ * @param {number} id |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
102403
1218
1674
3
Updatedhttps-proxy-agent@^7.0.4
Updatedsocks-proxy-agent@^8.0.3