@nsshunt/stsrest01client 1.0.9 → 1.0.11

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.
@@ -12,7 +12,7 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
12
12
  var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
13
13
  var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
14
14
 
15
- var _options, _DUMMY_USER, _invokeMethods, _maxRetries, _sleepDuration, _NoRetryStatusCodes, _accessToken, _noRetries, _LogDebugMessage, _LogErrorMessage, _TestMode, ___InvokeResourceAPI, _axiosClient, _options2;
15
+ var _options, _DUMMY_USER, _invokeMethods, _maxRetries, _sleepDuration, _NoRetryStatusCodes, _accessToken, _noRetries, _LogDebugMessage, _LogErrorMessage, _TestMode, ___InvokeResourceAPI, _axiosClient, _options2, _checkResName;
16
16
  function getDefaultExportFromCjs(x) {
17
17
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
18
18
  }
@@ -3756,6 +3756,19 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
3756
3756
  var _a;
3757
3757
  return ((_a = await this.PostResourceDBR(resource, errorCb)) == null ? void 0 : _a.resdesc) ?? null;
3758
3758
  });
3759
+ // --- [ PUT.Resources ] ------------------------------------------------------------------------------------------------------------------
3760
+ __publicField(this, "PutResourcesAR", async (resources, errorCb) => {
3761
+ const url = `${__privateGet(this, _options2).endpoint}${goptions.rest01apiroot}/resources`;
3762
+ return await __privateGet(this, _axiosClient).InvokeResourceAPI(url, "put", resources, null, null, errorCb);
3763
+ });
3764
+ __publicField(this, "PutResourcesDBR", async (resources, errorCb) => {
3765
+ var _a;
3766
+ return ((_a = await this.PutResourcesAR(resources, errorCb)) == null ? void 0 : _a.data.map((r) => r.detail)) ?? null;
3767
+ });
3768
+ __publicField(this, "PutResources", async (resources, errorCb) => {
3769
+ var _a;
3770
+ return ((_a = await this.PutResourcesDBR(resources, errorCb)) == null ? void 0 : _a.map((r) => r.resdesc)) ?? null;
3771
+ });
3759
3772
  // --- [ PUT.Resource ] -------------------------------------------------------------------------------------------------------------------
3760
3773
  __publicField(this, "PutResourceAR", async (resource, errorCb) => {
3761
3774
  const url = `${__privateGet(this, _options2).endpoint}${goptions.rest01apiroot}/resources/${resource.resname}`;
@@ -3769,6 +3782,19 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
3769
3782
  var _a;
3770
3783
  return ((_a = await this.PutResourceDBR(resource, errorCb)) == null ? void 0 : _a.resdesc) ?? null;
3771
3784
  });
3785
+ // --- [ PATCH.Resources ] ------------------------------------------------------------------------------------------------------------------
3786
+ __publicField(this, "PatchResourcesAR", async (resources, errorCb) => {
3787
+ const url = `${__privateGet(this, _options2).endpoint}${goptions.rest01apiroot}/resources`;
3788
+ return await __privateGet(this, _axiosClient).InvokeResourceAPI(url, "patch", resources, null, null, errorCb);
3789
+ });
3790
+ __publicField(this, "PatchResourcesDBR", async (resources, errorCb) => {
3791
+ var _a;
3792
+ return ((_a = await this.PatchResourcesAR(resources, errorCb)) == null ? void 0 : _a.data.map((r) => r.detail)) ?? null;
3793
+ });
3794
+ __publicField(this, "PatchResources", async (resources, errorCb) => {
3795
+ var _a;
3796
+ return ((_a = await this.PatchResourcesDBR(resources, errorCb)) == null ? void 0 : _a.map((r) => r.resdesc)) ?? null;
3797
+ });
3772
3798
  // --- [ PATCH.Resource ] -------------------------------------------------------------------------------------------------------------------
3773
3799
  __publicField(this, "PatchResourceAR", async (resource, errorCb) => {
3774
3800
  const url = `${__privateGet(this, _options2).endpoint}${goptions.rest01apiroot}/resources/${resource.resname}`;
@@ -3782,6 +3808,19 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
3782
3808
  var _a;
3783
3809
  return ((_a = await this.PatchResourceDBR(resource, errorCb)) == null ? void 0 : _a.resdesc) ?? null;
3784
3810
  });
3811
+ // --- [ DELETE.Resources ] -------------------------------------------------------------------------------------------------------------------
3812
+ __publicField(this, "DeleteResourcesAR", async (resources, errorCb) => {
3813
+ const url = `${__privateGet(this, _options2).endpoint}${goptions.rest01apiroot}/resources`;
3814
+ return await __privateGet(this, _axiosClient).InvokeResourceAPI(url, "delete", resources, null, null, errorCb);
3815
+ });
3816
+ __publicField(this, "DeleteResourcesDBR", async (resources, errorCb) => {
3817
+ var _a;
3818
+ return ((_a = await this.DeleteResourcesAR(resources, errorCb)) == null ? void 0 : _a.data.map((r) => r.detail)) ?? null;
3819
+ });
3820
+ __publicField(this, "DeleteResources", async (resources, errorCb) => {
3821
+ var _a;
3822
+ return ((_a = await this.DeleteResourcesDBR(resources, errorCb)) == null ? void 0 : _a.map((r) => r.resdesc)) ?? null;
3823
+ });
3785
3824
  // --- [ DELETE.Resource ] -------------------------------------------------------------------------------------------------------------------
3786
3825
  __publicField(this, "DeleteResourceAR", async (resource, errorCb) => {
3787
3826
  const url = `${__privateGet(this, _options2).endpoint}${goptions.rest01apiroot}/resources/${resource.resname}`;
@@ -3828,6 +3867,18 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
3828
3867
  return ((_a = await this.GetResourcesDBR(filters, errorCb)) == null ? void 0 : _a.map((r) => r.resdesc)) ?? null;
3829
3868
  });
3830
3869
  // --- [ Entity ] -------------------------------------------------------------------------------------------------------------------
3870
+ __privateAdd(this, _checkResName, (resourceEntities) => {
3871
+ let resName = "";
3872
+ resourceEntities.forEach((re) => {
3873
+ resName = resName.localeCompare("") === 0 ? re.resname : resName;
3874
+ if (resName.localeCompare(re.resname) !== 0) {
3875
+ throw new Error(`Invalid batch provided. resname not all equal. Previous checked value: [${resName}, current value: [${re.resname}]`);
3876
+ } else {
3877
+ resName = re.resname;
3878
+ }
3879
+ });
3880
+ return resName;
3881
+ });
3831
3882
  // --- [ POST.Entitiy ] -------------------------------------------------------------------------------------------------------------------
3832
3883
  __publicField(this, "PostEntityAR", async (resourceEntity, errorCb) => {
3833
3884
  const url = `${__privateGet(this, _options2).endpoint}${goptions.rest01apiroot}/resources/${resourceEntity.resname}/entities`;
@@ -3841,6 +3892,19 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
3841
3892
  var _a;
3842
3893
  return ((_a = await this.PostEntityDBR(resourceEntity, errorCb)) == null ? void 0 : _a.entvalue) ?? null;
3843
3894
  });
3895
+ // --- [ PUT.Entities ] -----------------------------------------------------------------------------------------------------------------
3896
+ __publicField(this, "PutEntitiesAR", async (resourceEntities, errorCb) => {
3897
+ const url = `${__privateGet(this, _options2).endpoint}${goptions.rest01apiroot}/resources/${__privateGet(this, _checkResName).call(this, resourceEntities)}/entities`;
3898
+ return __privateGet(this, _axiosClient).InvokeResourceAPI(url, "put", resourceEntities, null, null, errorCb);
3899
+ });
3900
+ __publicField(this, "PutEntitiesDBR", async (resourceEntities, errorCb) => {
3901
+ var _a;
3902
+ return ((_a = await this.PutEntitiesAR(resourceEntities, errorCb)) == null ? void 0 : _a.data.map((r) => r.detail)) ?? null;
3903
+ });
3904
+ __publicField(this, "PutEntities", async (resourceEntities, errorCb) => {
3905
+ var _a;
3906
+ return ((_a = await this.PutEntitiesDBR(resourceEntities, errorCb)) == null ? void 0 : _a.map((r) => r.entvalue)) ?? null;
3907
+ });
3844
3908
  // --- [ PUT.Entity ] -------------------------------------------------------------------------------------------------------------------
3845
3909
  __publicField(this, "PutEntityAR", async (entity, errorCb) => {
3846
3910
  const url = `${__privateGet(this, _options2).endpoint}${goptions.rest01apiroot}/resources/${entity.resname}/entities/${entity.entname}`;
@@ -3854,6 +3918,19 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
3854
3918
  var _a;
3855
3919
  return ((_a = await this.PutEntityDBR(resourceEntity, errorCb)) == null ? void 0 : _a.entvalue) ?? null;
3856
3920
  });
3921
+ // --- [ PATCH.Entities ] -----------------------------------------------------------------------------------------------------------------
3922
+ __publicField(this, "PatchEntitiesAR", async (resourceEntities, errorCb) => {
3923
+ const url = `${__privateGet(this, _options2).endpoint}${goptions.rest01apiroot}/resources/${__privateGet(this, _checkResName).call(this, resourceEntities)}/entities`;
3924
+ return __privateGet(this, _axiosClient).InvokeResourceAPI(url, "patch", resourceEntities, null, null, errorCb);
3925
+ });
3926
+ __publicField(this, "PatchEntitiesDBR", async (resourceEntities, errorCb) => {
3927
+ var _a;
3928
+ return ((_a = await this.PatchEntitiesAR(resourceEntities, errorCb)) == null ? void 0 : _a.data.map((r) => r.detail)) ?? null;
3929
+ });
3930
+ __publicField(this, "PatchEntities", async (resourceEntities, errorCb) => {
3931
+ var _a;
3932
+ return ((_a = await this.PatchEntitiesDBR(resourceEntities, errorCb)) == null ? void 0 : _a.map((r) => r.entvalue)) ?? null;
3933
+ });
3857
3934
  // --- [ PATCH.Entity ] -------------------------------------------------------------------------------------------------------------------
3858
3935
  __publicField(this, "PatchEntityAR", async (resourceEntity, errorCb) => {
3859
3936
  const url = `${__privateGet(this, _options2).endpoint}${goptions.rest01apiroot}/resources/${resourceEntity.resname}/entities/${resourceEntity.entname}`;
@@ -3868,6 +3945,19 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
3868
3945
  return ((_a = await this.PatchEntityDBR(resourceEntity, errorCb)) == null ? void 0 : _a.entvalue) ?? null;
3869
3946
  });
3870
3947
  // --- [ DELETE.Entity ] -------------------------------------------------------------------------------------------------------------------
3948
+ __publicField(this, "DeleteEntitiesAR", async (resourceEntities, errorCb) => {
3949
+ const url = `${__privateGet(this, _options2).endpoint}${goptions.rest01apiroot}/resources/${__privateGet(this, _checkResName).call(this, resourceEntities)}/entities`;
3950
+ return __privateGet(this, _axiosClient).InvokeResourceAPI(url, "delete", resourceEntities, null, null, errorCb);
3951
+ });
3952
+ __publicField(this, "DeleteEntitiesDBR", async (resourceEntities, errorCb) => {
3953
+ var _a;
3954
+ return ((_a = await this.DeleteEntitiesAR(resourceEntities, errorCb)) == null ? void 0 : _a.data.map((r) => r.detail)) ?? null;
3955
+ });
3956
+ __publicField(this, "DeleteEntities", async (resourceEntities, errorCb) => {
3957
+ var _a;
3958
+ return ((_a = await this.DeleteEntitiesDBR(resourceEntities, errorCb)) == null ? void 0 : _a.map((r) => r.entvalue)) ?? null;
3959
+ });
3960
+ // --- [ DELETE.Entity ] -------------------------------------------------------------------------------------------------------------------
3871
3961
  __publicField(this, "DeleteEntityAR", async (resourceEntity, errorCb) => {
3872
3962
  const url = `${__privateGet(this, _options2).endpoint}${goptions.rest01apiroot}/resources/${resourceEntity.resname}/entities/${resourceEntity.entname}`;
3873
3963
  return __privateGet(this, _axiosClient).InvokeResourceAPI(url, "delete", resourceEntity, null, null, errorCb);
@@ -3925,6 +4015,7 @@ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "
3925
4015
  }
3926
4016
  _axiosClient = new WeakMap();
3927
4017
  _options2 = new WeakMap();
4018
+ _checkResName = new WeakMap();
3928
4019
  exports2.AxiosClient = AxiosClient;
3929
4020
  exports2.STSRest01Client = STSRest01Client;
3930
4021
  Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });