comprodls-sdk 2.92.0-thor → 2.94.0-thor

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.
@@ -372,6 +372,7 @@ exports.AUTHEXTN_API_URLS = {
372
372
 
373
373
  //Space related API
374
374
  entitleBulkUsersToProducts: '/accounts/{accountid}/entitle-users/bulk',
375
+ deleteUserAccount : '/accounts/{accountid}/ext-users/{ext_user_id}',
375
376
 
376
377
  // Assigned Path APIs
377
378
  userAssignedPaths: '/org/{orgid}/classes/{classid}/assigned-paths/{assignedpathid}/enroll-user/multi',
@@ -11879,7 +11880,8 @@ function spacesextn(accountId) {
11879
11880
  this.accountId = accountId;
11880
11881
  return {
11881
11882
  entitleBulkUsersToProducts: entitleBulkUsersToProducts.bind(this),
11882
- setupUser: setupUser.bind(this)
11883
+ setupUser: setupUser.bind(this),
11884
+ deleteUserAccount : deleteUserAccount.bind(this)
11883
11885
  };
11884
11886
  }
11885
11887
 
@@ -11966,6 +11968,50 @@ function setupUser(options) {
11966
11968
  }
11967
11969
  return deferred.promise;
11968
11970
  }
11971
+
11972
+ /**
11973
+ * Wiki Link for SDK params
11974
+ * https://github.com/comprodls/comprodls-sdk-js/wiki/04_AUTH-Adapter#getuserprofileparams
11975
+ */
11976
+ function deleteUserAccount(options) {
11977
+ var self = this;
11978
+ return new Promise(function(resolve, reject) {
11979
+
11980
+ if (options.ext_user_id && options.body) {
11981
+ //Passed all validations, Contruct API url
11982
+ var url = self.config.DEFAULT_HOSTS.AUTHEXTN +
11983
+ self.config.AUTHEXTN_API_URLS.deleteUserAccount;
11984
+ url = helpers.api.constructAPIUrl(url, {
11985
+ accountid: self.accountId,
11986
+ ext_user_id: options.ext_user_id,
11987
+ });
11988
+
11989
+ // Setup request
11990
+ var requestAPI = request.delete(url)
11991
+ .set('Content-Type', 'application/json')
11992
+ .set('Accept', 'application/json');
11993
+ if (self.traceid) { requestAPI.set('X-Amzn-Trace-Id', self.traceid); }
11994
+
11995
+ requestAPI
11996
+ .send(options.body)
11997
+ .agent(keepaliveAgent)
11998
+ .end(function(error, response) {
11999
+ if (error) {
12000
+ var err = new DLSError(helpers.errors.ERROR_TYPES.API_ERROR, error);
12001
+ reject(err);
12002
+ } else {
12003
+ resolve(response.body);
12004
+ }
12005
+ });
12006
+ } else {
12007
+ var err = {};
12008
+ err.description = 'Mandatory field \'ext_user_id\' or \'body\' in request options.';
12009
+ err.message = err.description;
12010
+ err = new DLSError(helpers.errors.ERROR_TYPES.SDK_ERROR, err);
12011
+ reject(err);
12012
+ }
12013
+ });
12014
+ }
11969
12015
 
11970
12016
  },{"../../helpers":3,"agentkeepalive":30,"q":35,"superagent":38}],24:[function(require,module,exports){
11971
12017
  /*************************************************************************