comprodls-sdk 2.62.0 → 2.63.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2027,7 +2027,8 @@ function analytics() {
2027
2027
  getMyAssignedPathsOfClass: getMyAssignedPathsOfClass.bind(this),
2028
2028
  getAssignedPathAnalytics: getAssignedPathAnalytics.bind(this),
2029
2029
  getMyParticularAssignedPathOfClass: getMyParticularAssignedPathOfClass.bind(this),
2030
-
2030
+ getParticularAssignedPathOfClass: getParticularAssignedPathOfClass.bind(this),
2031
+
2031
2032
  getTimeseriesAnalytics: getTimeseriesAnalytics.bind(this),
2032
2033
  postProgressTimeseries: postProgressTimeseries.bind(this),
2033
2034
 
@@ -3658,6 +3659,60 @@ function getMyParticularAssignedPathOfClass(options) {
3658
3659
  return dfd.promise;
3659
3660
  }
3660
3661
 
3662
+ /* options = {
3663
+ "classid": "string", // Mandatory
3664
+ "assignedpathid" : "string",
3665
+ "ext_assignedpathid": "string", // Either ext_assignedpathid or assignedpathid is mandatory.
3666
+ };
3667
+ */
3668
+ function getParticularAssignedPathOfClass(options) {
3669
+ var self = this;
3670
+ // Initializing promise
3671
+ var dfd = q.defer();
3672
+ var err = helpers.validations.isAuthenticated(self.orgId, self.token);
3673
+ if(err) { dfd.reject(err); }
3674
+ else {
3675
+ if(options && options.classid && (options.assignedpathid || options.ext_assignedpathid)) {
3676
+
3677
+ // Passed all validations, Contruct API url
3678
+ var url = self.config.DEFAULT_HOSTS.ANALYTICS +
3679
+ self.config.ANALYTICS_API_URLS.getAllAssignedPathsOfClass;
3680
+ url = helpers.api.constructAPIUrl(url, { orgId: self.orgId });
3681
+
3682
+ var queryParams = { classid: options.classid };
3683
+ if(options.assignedpathid) { queryParams.assignedpathid = options.assignedpathid; }
3684
+ if(options.ext_assignedpathid) {queryParams.ext_assignedpathid = options.ext_assignedpathid;}
3685
+
3686
+ // Setup request with URL and Params
3687
+ var requestAPI = request.get(url).query(queryParams);
3688
+
3689
+ // Setup token in Authorization header
3690
+ requestAPI = helpers.api.setupAPIToken(requestAPI, self.token);
3691
+
3692
+ // Setting up traceid
3693
+ if(self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
3694
+
3695
+ requestAPI
3696
+ .agent(keepaliveAgent)
3697
+ .end(function (error, response) {
3698
+ if(error) {
3699
+ err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
3700
+ dfd.reject(err);
3701
+ }
3702
+ else { dfd.resolve(response.body.entities[0]); }
3703
+ });
3704
+ }
3705
+ else {
3706
+ err = {};
3707
+ err.message = err.description = 'Mandatory params - \'classid\', ' +
3708
+ '\'assignedpathid\'/\'ext_assignedpathid\' not found in request options.';
3709
+ err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
3710
+ dfd.reject(err);
3711
+ }
3712
+ }
3713
+ return dfd.promise;
3714
+ }
3715
+
3661
3716
  /*
3662
3717
  options = {
3663
3718
  query: 'string', //mandatory