falconhub-apilibrary 1.3.1-dev.97 → 1.3.1-dev.99
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.
- package/dist/index.d.mts +823 -1706
- package/dist/index.mjs +408 -1055
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -598,6 +598,21 @@ var AuthService = class {
|
|
|
598
598
|
}
|
|
599
599
|
return res;
|
|
600
600
|
}
|
|
601
|
+
/**
|
|
602
|
+
* Obtiene la SecretKey del usuario autenticado.
|
|
603
|
+
* Requiere sesión activa. Si el usuario tiene 2FA habilitado, se debe proveer el OTP.
|
|
604
|
+
* @param request - Objeto opcional con otpCode (requerido si IsTwoFactorEnabled)
|
|
605
|
+
*/
|
|
606
|
+
async getSecretKey(request) {
|
|
607
|
+
const response = await this.api.executePOST(
|
|
608
|
+
"oauth/secret-key",
|
|
609
|
+
request
|
|
610
|
+
);
|
|
611
|
+
if (!response) {
|
|
612
|
+
throw new ErrorResponse("No response from server");
|
|
613
|
+
}
|
|
614
|
+
return response;
|
|
615
|
+
}
|
|
601
616
|
// #region Email & OTP & Password (public - no auth)
|
|
602
617
|
/**
|
|
603
618
|
* Confirma el correo electrónico de un usuario.
|
|
@@ -703,209 +718,361 @@ var FilterBuilder = class {
|
|
|
703
718
|
}
|
|
704
719
|
};
|
|
705
720
|
|
|
706
|
-
// src/services/
|
|
707
|
-
var
|
|
721
|
+
// src/services/CatalogService.ts
|
|
722
|
+
var CatalogService = class {
|
|
708
723
|
constructor(api) {
|
|
709
|
-
this.BASE_PATH = "
|
|
724
|
+
this.BASE_PATH = "catalogs";
|
|
710
725
|
this.api = api;
|
|
711
726
|
}
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
const response = await this.api.executeGET(
|
|
721
|
-
`${this.BASE_PATH}/profile`,
|
|
722
|
-
true
|
|
723
|
-
);
|
|
724
|
-
return response;
|
|
727
|
+
// #region GENDERS
|
|
728
|
+
/**
|
|
729
|
+
* Obtiene todos los géneros con filtros opcionales.
|
|
730
|
+
* @param filter - Filtros opcionales para la búsqueda
|
|
731
|
+
*/
|
|
732
|
+
async getGenders(filter) {
|
|
733
|
+
const endpoint = FilterBuilder.buildEndpoint(`${this.BASE_PATH}/genders`, filter);
|
|
734
|
+
return this.api.executeGET(endpoint, false);
|
|
725
735
|
}
|
|
726
|
-
|
|
727
|
-
|
|
736
|
+
/**
|
|
737
|
+
* Obtiene el modelo de filtros disponibles para géneros.
|
|
738
|
+
*/
|
|
739
|
+
async getGendersFilters() {
|
|
740
|
+
return this.api.executeGET(`${this.BASE_PATH}/genders/filters`, false);
|
|
728
741
|
}
|
|
729
|
-
|
|
730
|
-
|
|
742
|
+
/**
|
|
743
|
+
* Obtiene un género por su ID.
|
|
744
|
+
* @param id - ID del género
|
|
745
|
+
*/
|
|
746
|
+
async getGenderById(id) {
|
|
747
|
+
return this.api.executeGET(`${this.BASE_PATH}/genders/${id}`, false);
|
|
731
748
|
}
|
|
732
|
-
// #region Admin CRUD
|
|
733
749
|
/**
|
|
734
|
-
* Crea un nuevo
|
|
735
|
-
* @param request - Datos del
|
|
750
|
+
* Crea un nuevo género.
|
|
751
|
+
* @param request - Datos del género a crear
|
|
736
752
|
*/
|
|
737
|
-
async
|
|
738
|
-
return this.api.executePOST(`${this.BASE_PATH}/
|
|
753
|
+
async createGender(request) {
|
|
754
|
+
return this.api.executePOST(`${this.BASE_PATH}/genders`, request);
|
|
739
755
|
}
|
|
740
756
|
/**
|
|
741
|
-
*
|
|
742
|
-
* @param
|
|
757
|
+
* Actualiza un género existente.
|
|
758
|
+
* @param id - ID del género a actualizar
|
|
759
|
+
* @param request - Nuevos datos del género
|
|
743
760
|
*/
|
|
744
|
-
async
|
|
745
|
-
return this.api.
|
|
761
|
+
async updateGender(id, request) {
|
|
762
|
+
return this.api.executePUT(`${this.BASE_PATH}/genders/${id}`, request);
|
|
746
763
|
}
|
|
747
764
|
/**
|
|
748
|
-
*
|
|
749
|
-
* @param id - ID del
|
|
750
|
-
* @param request - Nueva contraseña
|
|
765
|
+
* Elimina un género.
|
|
766
|
+
* @param id - ID del género a eliminar
|
|
751
767
|
*/
|
|
752
|
-
async
|
|
753
|
-
return this.api.
|
|
768
|
+
async deleteGender(id) {
|
|
769
|
+
return this.api.executeDELETE(`${this.BASE_PATH}/genders/${id}`);
|
|
754
770
|
}
|
|
771
|
+
// #endregion
|
|
772
|
+
// #region AREA CODES
|
|
755
773
|
/**
|
|
756
|
-
* Obtiene todos los
|
|
774
|
+
* Obtiene todos los códigos de área con filtros opcionales.
|
|
757
775
|
* @param filter - Filtros opcionales para la búsqueda
|
|
758
776
|
*/
|
|
759
|
-
async
|
|
760
|
-
const endpoint = FilterBuilder.buildEndpoint(`${this.BASE_PATH}/
|
|
761
|
-
return this.api.executeGET(endpoint,
|
|
777
|
+
async getAreaCodes(filter) {
|
|
778
|
+
const endpoint = FilterBuilder.buildEndpoint(`${this.BASE_PATH}/area-codes`, filter);
|
|
779
|
+
return this.api.executeGET(endpoint, false);
|
|
762
780
|
}
|
|
763
781
|
/**
|
|
764
|
-
* Obtiene el modelo de filtros disponibles para
|
|
782
|
+
* Obtiene el modelo de filtros disponibles para códigos de área.
|
|
765
783
|
*/
|
|
766
|
-
async
|
|
767
|
-
return this.api.executeGET(`${this.BASE_PATH}/
|
|
784
|
+
async getAreaCodesFilters() {
|
|
785
|
+
return this.api.executeGET(`${this.BASE_PATH}/area-codes/filters`, false);
|
|
768
786
|
}
|
|
769
787
|
/**
|
|
770
|
-
* Obtiene un
|
|
771
|
-
* @param id - ID del
|
|
788
|
+
* Obtiene un código de área por su ID.
|
|
789
|
+
* @param id - ID del código de área
|
|
772
790
|
*/
|
|
773
|
-
async
|
|
774
|
-
return this.api.executeGET(`${this.BASE_PATH}/
|
|
791
|
+
async getAreaCodeById(id) {
|
|
792
|
+
return this.api.executeGET(`${this.BASE_PATH}/area-codes/${id}`, false);
|
|
775
793
|
}
|
|
776
794
|
/**
|
|
777
|
-
*
|
|
778
|
-
* @param
|
|
795
|
+
* Crea un nuevo código de área.
|
|
796
|
+
* @param request - Datos del código de área a crear
|
|
779
797
|
*/
|
|
780
|
-
async
|
|
781
|
-
return this.api.
|
|
798
|
+
async createAreaCode(request) {
|
|
799
|
+
return this.api.executePOST(`${this.BASE_PATH}/area-codes`, request);
|
|
782
800
|
}
|
|
783
801
|
/**
|
|
784
|
-
* Actualiza un
|
|
785
|
-
* @param id - ID del
|
|
786
|
-
* @param request - Nuevos datos del
|
|
802
|
+
* Actualiza un código de área existente.
|
|
803
|
+
* @param id - ID del código de área a actualizar
|
|
804
|
+
* @param request - Nuevos datos del código de área
|
|
787
805
|
*/
|
|
788
|
-
async
|
|
789
|
-
return this.api.executePUT(`${this.BASE_PATH}/
|
|
806
|
+
async updateAreaCode(id, request) {
|
|
807
|
+
return this.api.executePUT(`${this.BASE_PATH}/area-codes/${id}`, request);
|
|
790
808
|
}
|
|
791
809
|
/**
|
|
792
|
-
* Activa o desactiva un
|
|
793
|
-
* @param id - ID del
|
|
810
|
+
* Activa o desactiva un código de área.
|
|
811
|
+
* @param id - ID del código de área
|
|
794
812
|
*/
|
|
795
|
-
async
|
|
796
|
-
return this.api.executePUT(`${this.BASE_PATH}/
|
|
813
|
+
async toggleAreaCodeStatus(id) {
|
|
814
|
+
return this.api.executePUT(`${this.BASE_PATH}/area-codes/${id}/toggle-status`);
|
|
797
815
|
}
|
|
798
816
|
/**
|
|
799
|
-
*
|
|
800
|
-
* @param id - ID del
|
|
801
|
-
* @param request - Nuevos datos de autenticación
|
|
817
|
+
* Elimina un código de área.
|
|
818
|
+
* @param id - ID del código de área a eliminar
|
|
802
819
|
*/
|
|
803
|
-
async
|
|
804
|
-
return this.api.
|
|
820
|
+
async deleteAreaCode(id) {
|
|
821
|
+
return this.api.executeDELETE(`${this.BASE_PATH}/area-codes/${id}`);
|
|
805
822
|
}
|
|
806
823
|
// #endregion
|
|
807
|
-
|
|
824
|
+
};
|
|
825
|
+
|
|
826
|
+
// src/services/InventoryService.ts
|
|
827
|
+
var InventoryService = class {
|
|
828
|
+
constructor(api) {
|
|
829
|
+
this.BASE_PATH = "inventory";
|
|
830
|
+
this.api = api;
|
|
831
|
+
}
|
|
832
|
+
// #region LOCATIONS
|
|
808
833
|
/**
|
|
809
|
-
* Obtiene
|
|
834
|
+
* Obtiene todas las ubicaciones con filtros opcionales.
|
|
810
835
|
* @param filter - Filtros opcionales para la búsqueda
|
|
811
836
|
*/
|
|
812
|
-
async
|
|
813
|
-
const endpoint = FilterBuilder.buildEndpoint(`${this.BASE_PATH}/
|
|
837
|
+
async getLocations(filter) {
|
|
838
|
+
const endpoint = FilterBuilder.buildEndpoint(`${this.BASE_PATH}/locations`, filter);
|
|
814
839
|
return this.api.executeGET(endpoint, true);
|
|
815
840
|
}
|
|
816
841
|
/**
|
|
817
|
-
* Obtiene el modelo de filtros disponibles para
|
|
842
|
+
* Obtiene el modelo de filtros disponibles para ubicaciones.
|
|
818
843
|
*/
|
|
819
|
-
async
|
|
820
|
-
return this.api.executeGET(`${this.BASE_PATH}/
|
|
844
|
+
async getLocationFiltersModel() {
|
|
845
|
+
return this.api.executeGET(`${this.BASE_PATH}/locations/filters`, true);
|
|
821
846
|
}
|
|
822
847
|
/**
|
|
823
|
-
* Obtiene
|
|
824
|
-
* @param id - ID
|
|
848
|
+
* Obtiene una ubicación por su ID.
|
|
849
|
+
* @param id - ID de la ubicación
|
|
825
850
|
*/
|
|
826
|
-
async
|
|
827
|
-
return this.api.executeGET(`${this.BASE_PATH}/
|
|
851
|
+
async getLocationById(id) {
|
|
852
|
+
return this.api.executeGET(`${this.BASE_PATH}/locations/${id}`, true);
|
|
828
853
|
}
|
|
829
854
|
/**
|
|
830
|
-
* Crea
|
|
831
|
-
* @param request - Datos
|
|
855
|
+
* Crea una nueva ubicación.
|
|
856
|
+
* @param request - Datos de la ubicación a crear
|
|
832
857
|
*/
|
|
833
|
-
async
|
|
834
|
-
return this.api.executePOST(`${this.BASE_PATH}/
|
|
858
|
+
async createLocation(request) {
|
|
859
|
+
return this.api.executePOST(`${this.BASE_PATH}/locations`, request);
|
|
835
860
|
}
|
|
836
861
|
/**
|
|
837
|
-
* Actualiza
|
|
838
|
-
* @param id - ID
|
|
839
|
-
* @param request - Nuevos datos
|
|
862
|
+
* Actualiza una ubicación existente.
|
|
863
|
+
* @param id - ID de la ubicación a actualizar
|
|
864
|
+
* @param request - Nuevos datos de la ubicación
|
|
840
865
|
*/
|
|
841
|
-
async
|
|
842
|
-
return this.api.executePUT(`${this.BASE_PATH}/
|
|
866
|
+
async updateLocation(id, request) {
|
|
867
|
+
return this.api.executePUT(`${this.BASE_PATH}/locations/${id}`, request);
|
|
843
868
|
}
|
|
844
869
|
/**
|
|
845
|
-
*
|
|
846
|
-
* @param id - ID
|
|
870
|
+
* Activa o desactiva una ubicación.
|
|
871
|
+
* @param id - ID de la ubicación
|
|
847
872
|
*/
|
|
848
|
-
async
|
|
849
|
-
return this.api.
|
|
873
|
+
async toggleLocationStatus(id) {
|
|
874
|
+
return this.api.executePUT(`${this.BASE_PATH}/locations/${id}/toggle-status`);
|
|
875
|
+
}
|
|
876
|
+
/**
|
|
877
|
+
* Elimina una ubicación.
|
|
878
|
+
* @param id - ID de la ubicación a eliminar
|
|
879
|
+
*/
|
|
880
|
+
async deleteLocation(id) {
|
|
881
|
+
return this.api.executeDELETE(`${this.BASE_PATH}/locations/${id}`);
|
|
850
882
|
}
|
|
851
883
|
// #endregion
|
|
852
|
-
// #region
|
|
884
|
+
// #region STATUSES
|
|
853
885
|
/**
|
|
854
|
-
* Obtiene todos los
|
|
886
|
+
* Obtiene todos los estatus de inventario con filtros opcionales.
|
|
855
887
|
* @param filter - Filtros opcionales para la búsqueda
|
|
856
888
|
*/
|
|
857
|
-
async
|
|
858
|
-
const endpoint = FilterBuilder.buildEndpoint(`${this.BASE_PATH}/catalogs/
|
|
889
|
+
async getStatuses(filter) {
|
|
890
|
+
const endpoint = FilterBuilder.buildEndpoint(`${this.BASE_PATH}/catalogs/statuses`, filter);
|
|
859
891
|
return this.api.executeGET(endpoint, true);
|
|
860
892
|
}
|
|
861
893
|
/**
|
|
862
|
-
* Obtiene el modelo de filtros disponibles para
|
|
894
|
+
* Obtiene el modelo de filtros disponibles para estatus de inventario.
|
|
863
895
|
*/
|
|
864
|
-
async
|
|
865
|
-
return this.api.executeGET(`${this.BASE_PATH}/catalogs/
|
|
896
|
+
async getStatusFiltersModel() {
|
|
897
|
+
return this.api.executeGET(`${this.BASE_PATH}/catalogs/statuses/filters`, true);
|
|
866
898
|
}
|
|
867
899
|
/**
|
|
868
|
-
* Obtiene un
|
|
869
|
-
* @param id - ID del
|
|
900
|
+
* Obtiene un estatus de inventario por su ID.
|
|
901
|
+
* @param id - ID del estatus
|
|
870
902
|
*/
|
|
871
|
-
async
|
|
872
|
-
return this.api.executeGET(`${this.BASE_PATH}/catalogs/
|
|
903
|
+
async getStatusById(id) {
|
|
904
|
+
return this.api.executeGET(`${this.BASE_PATH}/catalogs/statuses/${id}`, true);
|
|
873
905
|
}
|
|
874
906
|
/**
|
|
875
|
-
*
|
|
876
|
-
* @param
|
|
907
|
+
* Crea un nuevo estatus de inventario.
|
|
908
|
+
* @param request - Datos del estatus a crear
|
|
877
909
|
*/
|
|
878
|
-
async
|
|
879
|
-
return this.api.
|
|
910
|
+
async createStatus(request) {
|
|
911
|
+
return this.api.executePOST(`${this.BASE_PATH}/catalogs/statuses`, request);
|
|
880
912
|
}
|
|
881
913
|
/**
|
|
882
|
-
*
|
|
883
|
-
* @param
|
|
914
|
+
* Actualiza un estatus de inventario existente.
|
|
915
|
+
* @param id - ID del estatus a actualizar
|
|
916
|
+
* @param request - Nuevos datos del estatus
|
|
884
917
|
*/
|
|
885
|
-
async
|
|
886
|
-
return this.api.
|
|
918
|
+
async updateStatus(id, request) {
|
|
919
|
+
return this.api.executePUT(`${this.BASE_PATH}/catalogs/statuses/${id}`, request);
|
|
887
920
|
}
|
|
888
921
|
/**
|
|
889
|
-
*
|
|
890
|
-
* @param id - ID del
|
|
891
|
-
* @param request - Nuevos datos del rol
|
|
922
|
+
* Elimina un estatus de inventario.
|
|
923
|
+
* @param id - ID del estatus a eliminar
|
|
892
924
|
*/
|
|
893
|
-
async
|
|
894
|
-
return this.api.
|
|
925
|
+
async deleteStatus(id) {
|
|
926
|
+
return this.api.executeDELETE(`${this.BASE_PATH}/catalogs/statuses/${id}`);
|
|
895
927
|
}
|
|
928
|
+
// #endregion
|
|
929
|
+
// #region PACKINGS
|
|
896
930
|
/**
|
|
897
|
-
*
|
|
898
|
-
* @param
|
|
931
|
+
* Obtiene todos los empaques con filtros opcionales.
|
|
932
|
+
* @param filter - Filtros opcionales para la búsqueda
|
|
899
933
|
*/
|
|
900
|
-
async
|
|
901
|
-
|
|
934
|
+
async getPackings(filter) {
|
|
935
|
+
const endpoint = FilterBuilder.buildEndpoint(`${this.BASE_PATH}/catalogs/packings`, filter);
|
|
936
|
+
return this.api.executeGET(endpoint, true);
|
|
902
937
|
}
|
|
903
938
|
/**
|
|
904
|
-
*
|
|
905
|
-
* @param id - ID del rol a eliminar
|
|
939
|
+
* Obtiene el modelo de filtros disponibles para empaques.
|
|
906
940
|
*/
|
|
907
|
-
async
|
|
908
|
-
return this.api.
|
|
941
|
+
async getPackingFiltersModel() {
|
|
942
|
+
return this.api.executeGET(`${this.BASE_PATH}/catalogs/packings/filters`, true);
|
|
943
|
+
}
|
|
944
|
+
/**
|
|
945
|
+
* Obtiene un empaque por su ID.
|
|
946
|
+
* @param id - ID del empaque
|
|
947
|
+
*/
|
|
948
|
+
async getPackingById(id) {
|
|
949
|
+
return this.api.executeGET(`${this.BASE_PATH}/catalogs/packings/${id}`, true);
|
|
950
|
+
}
|
|
951
|
+
/**
|
|
952
|
+
* Crea un nuevo empaque.
|
|
953
|
+
* @param request - Datos del empaque a crear
|
|
954
|
+
*/
|
|
955
|
+
async createPacking(request) {
|
|
956
|
+
return this.api.executePOST(`${this.BASE_PATH}/catalogs/packings`, request);
|
|
957
|
+
}
|
|
958
|
+
/**
|
|
959
|
+
* Actualiza un empaque existente.
|
|
960
|
+
* @param id - ID del empaque a actualizar
|
|
961
|
+
* @param request - Nuevos datos del empaque
|
|
962
|
+
*/
|
|
963
|
+
async updatePacking(id, request) {
|
|
964
|
+
return this.api.executePUT(`${this.BASE_PATH}/catalogs/packings/${id}`, request);
|
|
965
|
+
}
|
|
966
|
+
/**
|
|
967
|
+
* Activa o desactiva un empaque.
|
|
968
|
+
* @param id - ID del empaque
|
|
969
|
+
*/
|
|
970
|
+
async togglePackingStatus(id) {
|
|
971
|
+
return this.api.executePUT(`${this.BASE_PATH}/catalogs/packings/${id}/toggle-status`);
|
|
972
|
+
}
|
|
973
|
+
/**
|
|
974
|
+
* Elimina un empaque.
|
|
975
|
+
* @param id - ID del empaque a eliminar
|
|
976
|
+
*/
|
|
977
|
+
async deletePacking(id) {
|
|
978
|
+
return this.api.executeDELETE(`${this.BASE_PATH}/catalogs/packings/${id}`);
|
|
979
|
+
}
|
|
980
|
+
// #endregion
|
|
981
|
+
// #region MATERIALS
|
|
982
|
+
/**
|
|
983
|
+
* Obtiene todos los materiales con filtros opcionales.
|
|
984
|
+
* @param filter - Filtros opcionales para la búsqueda
|
|
985
|
+
*/
|
|
986
|
+
async getMaterials(filter) {
|
|
987
|
+
const endpoint = FilterBuilder.buildEndpoint(`${this.BASE_PATH}/catalogs/materials`, filter);
|
|
988
|
+
return this.api.executeGET(endpoint, true);
|
|
989
|
+
}
|
|
990
|
+
/**
|
|
991
|
+
* Obtiene el modelo de filtros disponibles para materiales.
|
|
992
|
+
*/
|
|
993
|
+
async getMaterialFiltersModel() {
|
|
994
|
+
return this.api.executeGET(`${this.BASE_PATH}/catalogs/materials/filters`, true);
|
|
995
|
+
}
|
|
996
|
+
/**
|
|
997
|
+
* Obtiene un material por su ID.
|
|
998
|
+
* @param id - ID del material
|
|
999
|
+
*/
|
|
1000
|
+
async getMaterialById(id) {
|
|
1001
|
+
return this.api.executeGET(`${this.BASE_PATH}/catalogs/materials/${id}`, true);
|
|
1002
|
+
}
|
|
1003
|
+
/**
|
|
1004
|
+
* Crea un nuevo material.
|
|
1005
|
+
* @param request - Datos del material a crear
|
|
1006
|
+
*/
|
|
1007
|
+
async createMaterial(request) {
|
|
1008
|
+
return this.api.executePOST(`${this.BASE_PATH}/catalogs/materials`, request);
|
|
1009
|
+
}
|
|
1010
|
+
/**
|
|
1011
|
+
* Actualiza un material existente.
|
|
1012
|
+
* @param id - ID del material a actualizar
|
|
1013
|
+
* @param request - Nuevos datos del material
|
|
1014
|
+
*/
|
|
1015
|
+
async updateMaterial(id, request) {
|
|
1016
|
+
return this.api.executePUT(`${this.BASE_PATH}/catalogs/materials/${id}`, request);
|
|
1017
|
+
}
|
|
1018
|
+
/**
|
|
1019
|
+
* Elimina un material.
|
|
1020
|
+
* @param id - ID del material a eliminar
|
|
1021
|
+
*/
|
|
1022
|
+
async deleteMaterial(id) {
|
|
1023
|
+
return this.api.executeDELETE(`${this.BASE_PATH}/catalogs/materials/${id}`);
|
|
1024
|
+
}
|
|
1025
|
+
// #endregion
|
|
1026
|
+
// #region PROVIDERS
|
|
1027
|
+
/**
|
|
1028
|
+
* Obtiene todos los proveedores con filtros opcionales.
|
|
1029
|
+
* @param filter - Filtros opcionales para la búsqueda
|
|
1030
|
+
*/
|
|
1031
|
+
async getProviders(filter) {
|
|
1032
|
+
const endpoint = FilterBuilder.buildEndpoint(`${this.BASE_PATH}/catalogs/providers`, filter);
|
|
1033
|
+
return this.api.executeGET(endpoint, true);
|
|
1034
|
+
}
|
|
1035
|
+
/**
|
|
1036
|
+
* Obtiene el modelo de filtros disponibles para proveedores.
|
|
1037
|
+
*/
|
|
1038
|
+
async getProviderFiltersModel() {
|
|
1039
|
+
return this.api.executeGET(`${this.BASE_PATH}/catalogs/providers/filters`, true);
|
|
1040
|
+
}
|
|
1041
|
+
/**
|
|
1042
|
+
* Obtiene un proveedor por su ID.
|
|
1043
|
+
* @param id - ID del proveedor
|
|
1044
|
+
*/
|
|
1045
|
+
async getProviderById(id) {
|
|
1046
|
+
return this.api.executeGET(`${this.BASE_PATH}/catalogs/providers/${id}`, true);
|
|
1047
|
+
}
|
|
1048
|
+
/**
|
|
1049
|
+
* Crea un nuevo proveedor.
|
|
1050
|
+
* @param request - Datos del proveedor a crear
|
|
1051
|
+
*/
|
|
1052
|
+
async createProvider(request) {
|
|
1053
|
+
return this.api.executePOST(`${this.BASE_PATH}/catalogs/providers`, request);
|
|
1054
|
+
}
|
|
1055
|
+
/**
|
|
1056
|
+
* Actualiza un proveedor existente.
|
|
1057
|
+
* @param id - ID del proveedor a actualizar
|
|
1058
|
+
* @param request - Nuevos datos del proveedor
|
|
1059
|
+
*/
|
|
1060
|
+
async updateProvider(id, request) {
|
|
1061
|
+
return this.api.executePUT(`${this.BASE_PATH}/catalogs/providers/${id}`, request);
|
|
1062
|
+
}
|
|
1063
|
+
/**
|
|
1064
|
+
* Activa o desactiva un proveedor.
|
|
1065
|
+
* @param id - ID del proveedor
|
|
1066
|
+
*/
|
|
1067
|
+
async toggleProviderStatus(id) {
|
|
1068
|
+
return this.api.executePUT(`${this.BASE_PATH}/catalogs/providers/${id}/toggle-status`);
|
|
1069
|
+
}
|
|
1070
|
+
/**
|
|
1071
|
+
* Elimina un proveedor.
|
|
1072
|
+
* @param id - ID del proveedor a eliminar
|
|
1073
|
+
*/
|
|
1074
|
+
async deleteProvider(id) {
|
|
1075
|
+
return this.api.executeDELETE(`${this.BASE_PATH}/catalogs/providers/${id}`);
|
|
909
1076
|
}
|
|
910
1077
|
// #endregion
|
|
911
1078
|
};
|
|
@@ -1080,1027 +1247,217 @@ var SystemService = class {
|
|
|
1080
1247
|
// #endregion
|
|
1081
1248
|
};
|
|
1082
1249
|
|
|
1083
|
-
// src/services/
|
|
1084
|
-
var
|
|
1250
|
+
// src/services/UserService.ts
|
|
1251
|
+
var UserService = class {
|
|
1085
1252
|
constructor(api) {
|
|
1086
|
-
this.BASE_PATH = "
|
|
1253
|
+
this.BASE_PATH = "users";
|
|
1087
1254
|
this.api = api;
|
|
1088
1255
|
}
|
|
1089
|
-
// #region LOCATIONS
|
|
1090
1256
|
/**
|
|
1091
|
-
* Obtiene
|
|
1092
|
-
* @
|
|
1093
|
-
|
|
1094
|
-
async
|
|
1095
|
-
const
|
|
1096
|
-
|
|
1257
|
+
* Obtiene la información básica del usuario.
|
|
1258
|
+
* @returns retorna un objeto con la información básica del usuario
|
|
1259
|
+
*/
|
|
1260
|
+
async me() {
|
|
1261
|
+
const response = await this.api.executeGET(
|
|
1262
|
+
`${this.BASE_PATH}/me`,
|
|
1263
|
+
true
|
|
1264
|
+
);
|
|
1265
|
+
return response;
|
|
1097
1266
|
}
|
|
1098
1267
|
/**
|
|
1099
|
-
* Obtiene
|
|
1268
|
+
* Obtiene la información general del usuario para la vista de perfil.
|
|
1269
|
+
* @returns
|
|
1100
1270
|
*/
|
|
1101
|
-
async
|
|
1102
|
-
|
|
1271
|
+
async profile() {
|
|
1272
|
+
const response = await this.api.executeGET(
|
|
1273
|
+
`${this.BASE_PATH}/profile`,
|
|
1274
|
+
true
|
|
1275
|
+
);
|
|
1276
|
+
return response;
|
|
1103
1277
|
}
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
* @param id - ID de la ubicación
|
|
1107
|
-
*/
|
|
1108
|
-
async getLocationById(id) {
|
|
1109
|
-
return this.api.executeGET(`${this.BASE_PATH}/locations/${id}`, true);
|
|
1278
|
+
async changePasswordUser(request) {
|
|
1279
|
+
return this.api.executePUT(`${this.BASE_PATH}/me/password`, request);
|
|
1110
1280
|
}
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
* @param request - Datos de la ubicación a crear
|
|
1114
|
-
*/
|
|
1115
|
-
async createLocation(request) {
|
|
1116
|
-
return this.api.executePOST(`${this.BASE_PATH}/locations`, request);
|
|
1281
|
+
async updateUserData(request) {
|
|
1282
|
+
return this.api.executePUT(`${this.BASE_PATH}/me`, request);
|
|
1117
1283
|
}
|
|
1284
|
+
// #region Admin CRUD
|
|
1118
1285
|
/**
|
|
1119
|
-
*
|
|
1120
|
-
* @param
|
|
1121
|
-
* @param request - Nuevos datos de la ubicación
|
|
1286
|
+
* Crea un nuevo usuario administrador.
|
|
1287
|
+
* @param request - Datos del nuevo administrador
|
|
1122
1288
|
*/
|
|
1123
|
-
async
|
|
1124
|
-
return this.api.
|
|
1289
|
+
async newAdminUser(request) {
|
|
1290
|
+
return this.api.executePOST(`${this.BASE_PATH}/admin`, request);
|
|
1125
1291
|
}
|
|
1126
1292
|
/**
|
|
1127
|
-
*
|
|
1128
|
-
* @param
|
|
1293
|
+
* Crea la autenticación para un usuario.
|
|
1294
|
+
* @param request - Datos de autenticación del usuario
|
|
1129
1295
|
*/
|
|
1130
|
-
async
|
|
1131
|
-
return this.api.
|
|
1296
|
+
async createUserAuthentication(request) {
|
|
1297
|
+
return this.api.executePOST(`${this.BASE_PATH}/admin/authentication`, request);
|
|
1132
1298
|
}
|
|
1133
1299
|
/**
|
|
1134
|
-
*
|
|
1135
|
-
* @param id - ID
|
|
1300
|
+
* Cambia la contraseña de un administrador.
|
|
1301
|
+
* @param id - ID del usuario
|
|
1302
|
+
* @param request - Nueva contraseña
|
|
1136
1303
|
*/
|
|
1137
|
-
async
|
|
1138
|
-
return this.api.
|
|
1304
|
+
async changePasswordAdmin(id, request) {
|
|
1305
|
+
return this.api.executePOST(`${this.BASE_PATH}/admin/${id}/password`, request);
|
|
1139
1306
|
}
|
|
1140
|
-
// #endregion
|
|
1141
|
-
// #region STATUSES
|
|
1142
1307
|
/**
|
|
1143
|
-
* Obtiene todos los
|
|
1308
|
+
* Obtiene todos los administradores con filtros opcionales.
|
|
1144
1309
|
* @param filter - Filtros opcionales para la búsqueda
|
|
1145
1310
|
*/
|
|
1146
|
-
async
|
|
1147
|
-
const endpoint = FilterBuilder.buildEndpoint(`${this.BASE_PATH}/
|
|
1311
|
+
async getAllAdmins(filter) {
|
|
1312
|
+
const endpoint = FilterBuilder.buildEndpoint(`${this.BASE_PATH}/admin`, filter);
|
|
1148
1313
|
return this.api.executeGET(endpoint, true);
|
|
1149
1314
|
}
|
|
1150
1315
|
/**
|
|
1151
|
-
* Obtiene el modelo de filtros disponibles para
|
|
1316
|
+
* Obtiene el modelo de filtros disponibles para administradores.
|
|
1152
1317
|
*/
|
|
1153
|
-
async
|
|
1154
|
-
return this.api.executeGET(`${this.BASE_PATH}/
|
|
1318
|
+
async getAdminFiltersModel() {
|
|
1319
|
+
return this.api.executeGET(`${this.BASE_PATH}/admin/filters`, true);
|
|
1155
1320
|
}
|
|
1156
1321
|
/**
|
|
1157
|
-
* Obtiene un
|
|
1158
|
-
* @param id - ID del
|
|
1322
|
+
* Obtiene un administrador por su ID.
|
|
1323
|
+
* @param id - ID del administrador
|
|
1159
1324
|
*/
|
|
1160
|
-
async
|
|
1161
|
-
return this.api.executeGET(`${this.BASE_PATH}/
|
|
1325
|
+
async getAdminById(id) {
|
|
1326
|
+
return this.api.executeGET(`${this.BASE_PATH}/admin/${id}`, true);
|
|
1162
1327
|
}
|
|
1163
1328
|
/**
|
|
1164
|
-
*
|
|
1165
|
-
* @param
|
|
1329
|
+
* Obtiene la autenticación de un administrador.
|
|
1330
|
+
* @param id - ID del usuario
|
|
1166
1331
|
*/
|
|
1167
|
-
async
|
|
1168
|
-
return this.api.
|
|
1332
|
+
async getAdminAuthentication(id) {
|
|
1333
|
+
return this.api.executeGET(`${this.BASE_PATH}/admin/authentication/${id}`, true);
|
|
1169
1334
|
}
|
|
1170
1335
|
/**
|
|
1171
|
-
* Actualiza un
|
|
1172
|
-
* @param id - ID del
|
|
1173
|
-
* @param request - Nuevos datos del
|
|
1336
|
+
* Actualiza un administrador existente.
|
|
1337
|
+
* @param id - ID del administrador
|
|
1338
|
+
* @param request - Nuevos datos del administrador
|
|
1174
1339
|
*/
|
|
1175
|
-
async
|
|
1176
|
-
return this.api.executePUT(`${this.BASE_PATH}/
|
|
1340
|
+
async updateAdmin(id, request) {
|
|
1341
|
+
return this.api.executePUT(`${this.BASE_PATH}/admin/${id}`, request);
|
|
1177
1342
|
}
|
|
1178
1343
|
/**
|
|
1179
|
-
*
|
|
1180
|
-
* @param id - ID del
|
|
1344
|
+
* Activa o desactiva un administrador.
|
|
1345
|
+
* @param id - ID del administrador
|
|
1181
1346
|
*/
|
|
1182
|
-
async
|
|
1183
|
-
return this.api.
|
|
1347
|
+
async toggleAdminStatus(id) {
|
|
1348
|
+
return this.api.executePUT(`${this.BASE_PATH}/admin/${id}/toggle-status`);
|
|
1184
1349
|
}
|
|
1185
|
-
// #endregion
|
|
1186
|
-
// #region PACKINGS
|
|
1187
1350
|
/**
|
|
1188
|
-
*
|
|
1189
|
-
* @param
|
|
1190
|
-
|
|
1191
|
-
async getPackings(filter) {
|
|
1192
|
-
const endpoint = FilterBuilder.buildEndpoint(`${this.BASE_PATH}/catalogs/packings`, filter);
|
|
1193
|
-
return this.api.executeGET(endpoint, true);
|
|
1194
|
-
}
|
|
1195
|
-
/**
|
|
1196
|
-
* Obtiene el modelo de filtros disponibles para empaques.
|
|
1197
|
-
*/
|
|
1198
|
-
async getPackingFiltersModel() {
|
|
1199
|
-
return this.api.executeGET(`${this.BASE_PATH}/catalogs/packings/filters`, true);
|
|
1200
|
-
}
|
|
1201
|
-
/**
|
|
1202
|
-
* Obtiene un empaque por su ID.
|
|
1203
|
-
* @param id - ID del empaque
|
|
1204
|
-
*/
|
|
1205
|
-
async getPackingById(id) {
|
|
1206
|
-
return this.api.executeGET(`${this.BASE_PATH}/catalogs/packings/${id}`, true);
|
|
1207
|
-
}
|
|
1208
|
-
/**
|
|
1209
|
-
* Crea un nuevo empaque.
|
|
1210
|
-
* @param request - Datos del empaque a crear
|
|
1211
|
-
*/
|
|
1212
|
-
async createPacking(request) {
|
|
1213
|
-
return this.api.executePOST(`${this.BASE_PATH}/catalogs/packings`, request);
|
|
1214
|
-
}
|
|
1215
|
-
/**
|
|
1216
|
-
* Actualiza un empaque existente.
|
|
1217
|
-
* @param id - ID del empaque a actualizar
|
|
1218
|
-
* @param request - Nuevos datos del empaque
|
|
1219
|
-
*/
|
|
1220
|
-
async updatePacking(id, request) {
|
|
1221
|
-
return this.api.executePUT(`${this.BASE_PATH}/catalogs/packings/${id}`, request);
|
|
1222
|
-
}
|
|
1223
|
-
/**
|
|
1224
|
-
* Activa o desactiva un empaque.
|
|
1225
|
-
* @param id - ID del empaque
|
|
1226
|
-
*/
|
|
1227
|
-
async togglePackingStatus(id) {
|
|
1228
|
-
return this.api.executePUT(`${this.BASE_PATH}/catalogs/packings/${id}/toggle-status`);
|
|
1229
|
-
}
|
|
1230
|
-
/**
|
|
1231
|
-
* Elimina un empaque.
|
|
1232
|
-
* @param id - ID del empaque a eliminar
|
|
1233
|
-
*/
|
|
1234
|
-
async deletePacking(id) {
|
|
1235
|
-
return this.api.executeDELETE(`${this.BASE_PATH}/catalogs/packings/${id}`);
|
|
1236
|
-
}
|
|
1237
|
-
// #endregion
|
|
1238
|
-
// #region MATERIALS
|
|
1239
|
-
/**
|
|
1240
|
-
* Obtiene todos los materiales con filtros opcionales.
|
|
1241
|
-
* @param filter - Filtros opcionales para la búsqueda
|
|
1242
|
-
*/
|
|
1243
|
-
async getMaterials(filter) {
|
|
1244
|
-
const endpoint = FilterBuilder.buildEndpoint(`${this.BASE_PATH}/catalogs/materials`, filter);
|
|
1245
|
-
return this.api.executeGET(endpoint, true);
|
|
1246
|
-
}
|
|
1247
|
-
/**
|
|
1248
|
-
* Obtiene el modelo de filtros disponibles para materiales.
|
|
1249
|
-
*/
|
|
1250
|
-
async getMaterialFiltersModel() {
|
|
1251
|
-
return this.api.executeGET(`${this.BASE_PATH}/catalogs/materials/filters`, true);
|
|
1252
|
-
}
|
|
1253
|
-
/**
|
|
1254
|
-
* Obtiene un material por su ID.
|
|
1255
|
-
* @param id - ID del material
|
|
1256
|
-
*/
|
|
1257
|
-
async getMaterialById(id) {
|
|
1258
|
-
return this.api.executeGET(`${this.BASE_PATH}/catalogs/materials/${id}`, true);
|
|
1259
|
-
}
|
|
1260
|
-
/**
|
|
1261
|
-
* Crea un nuevo material.
|
|
1262
|
-
* @param request - Datos del material a crear
|
|
1263
|
-
*/
|
|
1264
|
-
async createMaterial(request) {
|
|
1265
|
-
return this.api.executePOST(`${this.BASE_PATH}/catalogs/materials`, request);
|
|
1266
|
-
}
|
|
1267
|
-
/**
|
|
1268
|
-
* Actualiza un material existente.
|
|
1269
|
-
* @param id - ID del material a actualizar
|
|
1270
|
-
* @param request - Nuevos datos del material
|
|
1271
|
-
*/
|
|
1272
|
-
async updateMaterial(id, request) {
|
|
1273
|
-
return this.api.executePUT(`${this.BASE_PATH}/catalogs/materials/${id}`, request);
|
|
1274
|
-
}
|
|
1275
|
-
/**
|
|
1276
|
-
* Elimina un material.
|
|
1277
|
-
* @param id - ID del material a eliminar
|
|
1278
|
-
*/
|
|
1279
|
-
async deleteMaterial(id) {
|
|
1280
|
-
return this.api.executeDELETE(`${this.BASE_PATH}/catalogs/materials/${id}`);
|
|
1281
|
-
}
|
|
1282
|
-
// #endregion
|
|
1283
|
-
// #region PROVIDERS
|
|
1284
|
-
/**
|
|
1285
|
-
* Obtiene todos los proveedores con filtros opcionales.
|
|
1286
|
-
* @param filter - Filtros opcionales para la búsqueda
|
|
1287
|
-
*/
|
|
1288
|
-
async getProviders(filter) {
|
|
1289
|
-
const endpoint = FilterBuilder.buildEndpoint(`${this.BASE_PATH}/catalogs/providers`, filter);
|
|
1290
|
-
return this.api.executeGET(endpoint, true);
|
|
1291
|
-
}
|
|
1292
|
-
/**
|
|
1293
|
-
* Obtiene el modelo de filtros disponibles para proveedores.
|
|
1294
|
-
*/
|
|
1295
|
-
async getProviderFiltersModel() {
|
|
1296
|
-
return this.api.executeGET(`${this.BASE_PATH}/catalogs/providers/filters`, true);
|
|
1297
|
-
}
|
|
1298
|
-
/**
|
|
1299
|
-
* Obtiene un proveedor por su ID.
|
|
1300
|
-
* @param id - ID del proveedor
|
|
1301
|
-
*/
|
|
1302
|
-
async getProviderById(id) {
|
|
1303
|
-
return this.api.executeGET(`${this.BASE_PATH}/catalogs/providers/${id}`, true);
|
|
1304
|
-
}
|
|
1305
|
-
/**
|
|
1306
|
-
* Crea un nuevo proveedor.
|
|
1307
|
-
* @param request - Datos del proveedor a crear
|
|
1308
|
-
*/
|
|
1309
|
-
async createProvider(request) {
|
|
1310
|
-
return this.api.executePOST(`${this.BASE_PATH}/catalogs/providers`, request);
|
|
1311
|
-
}
|
|
1312
|
-
/**
|
|
1313
|
-
* Actualiza un proveedor existente.
|
|
1314
|
-
* @param id - ID del proveedor a actualizar
|
|
1315
|
-
* @param request - Nuevos datos del proveedor
|
|
1316
|
-
*/
|
|
1317
|
-
async updateProvider(id, request) {
|
|
1318
|
-
return this.api.executePUT(`${this.BASE_PATH}/catalogs/providers/${id}`, request);
|
|
1319
|
-
}
|
|
1320
|
-
/**
|
|
1321
|
-
* Activa o desactiva un proveedor.
|
|
1322
|
-
* @param id - ID del proveedor
|
|
1323
|
-
*/
|
|
1324
|
-
async toggleProviderStatus(id) {
|
|
1325
|
-
return this.api.executePUT(`${this.BASE_PATH}/catalogs/providers/${id}/toggle-status`);
|
|
1326
|
-
}
|
|
1327
|
-
/**
|
|
1328
|
-
* Elimina un proveedor.
|
|
1329
|
-
* @param id - ID del proveedor a eliminar
|
|
1330
|
-
*/
|
|
1331
|
-
async deleteProvider(id) {
|
|
1332
|
-
return this.api.executeDELETE(`${this.BASE_PATH}/catalogs/providers/${id}`);
|
|
1333
|
-
}
|
|
1334
|
-
// #endregion
|
|
1335
|
-
};
|
|
1336
|
-
|
|
1337
|
-
// src/services/ProductService.ts
|
|
1338
|
-
var ProductService = class {
|
|
1339
|
-
constructor(api) {
|
|
1340
|
-
this.BASE_PATH = "products";
|
|
1341
|
-
this.api = api;
|
|
1342
|
-
}
|
|
1343
|
-
// #region PRODUCT IMAGES
|
|
1344
|
-
/**
|
|
1345
|
-
* Obtiene todas las imágenes de producto con filtros opcionales.
|
|
1346
|
-
* @param filter - Filtros opcionales para la búsqueda
|
|
1347
|
-
*/
|
|
1348
|
-
async getImages(filter) {
|
|
1349
|
-
const endpoint = FilterBuilder.buildEndpoint(`${this.BASE_PATH}/images`, filter);
|
|
1350
|
-
return this.api.executeGET(endpoint, true);
|
|
1351
|
-
}
|
|
1352
|
-
/**
|
|
1353
|
-
* Obtiene el modelo de filtros disponibles para imágenes de producto.
|
|
1354
|
-
*/
|
|
1355
|
-
async getImageFiltersModel() {
|
|
1356
|
-
return this.api.executeGET(`${this.BASE_PATH}/images/filters`, true);
|
|
1357
|
-
}
|
|
1358
|
-
/**
|
|
1359
|
-
* Obtiene una imagen de producto por su ID.
|
|
1360
|
-
* @param id - ID de la imagen
|
|
1361
|
-
*/
|
|
1362
|
-
async getImageById(id) {
|
|
1363
|
-
return this.api.executeGET(`${this.BASE_PATH}/images/${id}`, true);
|
|
1364
|
-
}
|
|
1365
|
-
/**
|
|
1366
|
-
* Crea una nueva imagen de producto.
|
|
1367
|
-
* @param request - Datos de la imagen a crear
|
|
1368
|
-
*/
|
|
1369
|
-
async createImage(request) {
|
|
1370
|
-
return this.api.executePOST(`${this.BASE_PATH}/images`, request);
|
|
1371
|
-
}
|
|
1372
|
-
/**
|
|
1373
|
-
* Actualiza una imagen de producto existente.
|
|
1374
|
-
* @param id - ID de la imagen a actualizar
|
|
1375
|
-
* @param request - Nuevos datos de la imagen
|
|
1376
|
-
*/
|
|
1377
|
-
async updateImage(id, request) {
|
|
1378
|
-
return this.api.executePUT(`${this.BASE_PATH}/images/${id}`, request);
|
|
1379
|
-
}
|
|
1380
|
-
/**
|
|
1381
|
-
* Elimina una imagen de producto.
|
|
1382
|
-
* @param id - ID de la imagen a eliminar
|
|
1383
|
-
*/
|
|
1384
|
-
async deleteImage(id) {
|
|
1385
|
-
return this.api.executeDELETE(`${this.BASE_PATH}/images/${id}`);
|
|
1386
|
-
}
|
|
1387
|
-
// #endregion
|
|
1388
|
-
// #region PRODUCT BULLETS
|
|
1389
|
-
/**
|
|
1390
|
-
* Obtiene todos los bullets de producto con filtros opcionales.
|
|
1391
|
-
* @param filter - Filtros opcionales para la búsqueda
|
|
1392
|
-
*/
|
|
1393
|
-
async getBullets(filter) {
|
|
1394
|
-
const endpoint = FilterBuilder.buildEndpoint(`${this.BASE_PATH}/bullets`, filter);
|
|
1395
|
-
return this.api.executeGET(endpoint, true);
|
|
1396
|
-
}
|
|
1397
|
-
/**
|
|
1398
|
-
* Obtiene el modelo de filtros disponibles para bullets de producto.
|
|
1399
|
-
*/
|
|
1400
|
-
async getBulletFiltersModel() {
|
|
1401
|
-
return this.api.executeGET(`${this.BASE_PATH}/bullets/filters`, true);
|
|
1402
|
-
}
|
|
1403
|
-
/**
|
|
1404
|
-
* Obtiene un bullet de producto por su ID.
|
|
1405
|
-
* @param id - ID del bullet
|
|
1406
|
-
*/
|
|
1407
|
-
async getBulletById(id) {
|
|
1408
|
-
return this.api.executeGET(`${this.BASE_PATH}/bullets/${id}`, true);
|
|
1409
|
-
}
|
|
1410
|
-
/**
|
|
1411
|
-
* Crea un nuevo bullet de producto.
|
|
1412
|
-
* @param request - Datos del bullet a crear
|
|
1413
|
-
*/
|
|
1414
|
-
async createBullet(request) {
|
|
1415
|
-
return this.api.executePOST(`${this.BASE_PATH}/bullets`, request);
|
|
1416
|
-
}
|
|
1417
|
-
/**
|
|
1418
|
-
* Actualiza un bullet de producto existente.
|
|
1419
|
-
* @param id - ID del bullet a actualizar
|
|
1420
|
-
* @param request - Nuevos datos del bullet
|
|
1421
|
-
*/
|
|
1422
|
-
async updateBullet(id, request) {
|
|
1423
|
-
return this.api.executePUT(`${this.BASE_PATH}/bullets/${id}`, request);
|
|
1424
|
-
}
|
|
1425
|
-
/**
|
|
1426
|
-
* Elimina un bullet de producto.
|
|
1427
|
-
* @param id - ID del bullet a eliminar
|
|
1428
|
-
*/
|
|
1429
|
-
async deleteBullet(id) {
|
|
1430
|
-
return this.api.executeDELETE(`${this.BASE_PATH}/bullets/${id}`);
|
|
1431
|
-
}
|
|
1432
|
-
// #endregion
|
|
1433
|
-
// #region PRODUCT KEYWORDS
|
|
1434
|
-
/**
|
|
1435
|
-
* Obtiene todos los keywords de producto con filtros opcionales.
|
|
1436
|
-
* @param filter - Filtros opcionales para la búsqueda
|
|
1437
|
-
*/
|
|
1438
|
-
async getKeywords(filter) {
|
|
1439
|
-
const endpoint = FilterBuilder.buildEndpoint(`${this.BASE_PATH}/keywords`, filter);
|
|
1440
|
-
return this.api.executeGET(endpoint, true);
|
|
1441
|
-
}
|
|
1442
|
-
/**
|
|
1443
|
-
* Obtiene el modelo de filtros disponibles para keywords de producto.
|
|
1444
|
-
*/
|
|
1445
|
-
async getKeywordFiltersModel() {
|
|
1446
|
-
return this.api.executeGET(`${this.BASE_PATH}/keywords/filters`, true);
|
|
1447
|
-
}
|
|
1448
|
-
/**
|
|
1449
|
-
* Obtiene un keyword de producto por su ID.
|
|
1450
|
-
* @param id - ID del keyword
|
|
1451
|
-
*/
|
|
1452
|
-
async getKeywordById(id) {
|
|
1453
|
-
return this.api.executeGET(`${this.BASE_PATH}/keywords/${id}`, true);
|
|
1454
|
-
}
|
|
1455
|
-
/**
|
|
1456
|
-
* Crea un nuevo keyword de producto.
|
|
1457
|
-
* @param request - Datos del keyword a crear
|
|
1458
|
-
*/
|
|
1459
|
-
async createKeyword(request) {
|
|
1460
|
-
return this.api.executePOST(`${this.BASE_PATH}/keywords`, request);
|
|
1461
|
-
}
|
|
1462
|
-
/**
|
|
1463
|
-
* Actualiza un keyword de producto existente.
|
|
1464
|
-
* @param id - ID del keyword a actualizar
|
|
1465
|
-
* @param request - Nuevos datos del keyword
|
|
1466
|
-
*/
|
|
1467
|
-
async updateKeyword(id, request) {
|
|
1468
|
-
return this.api.executePUT(`${this.BASE_PATH}/keywords/${id}`, request);
|
|
1469
|
-
}
|
|
1470
|
-
/**
|
|
1471
|
-
* Elimina un keyword de producto.
|
|
1472
|
-
* @param id - ID del keyword a eliminar
|
|
1473
|
-
*/
|
|
1474
|
-
async deleteKeyword(id) {
|
|
1475
|
-
return this.api.executeDELETE(`${this.BASE_PATH}/keywords/${id}`);
|
|
1476
|
-
}
|
|
1477
|
-
// #endregion
|
|
1478
|
-
// #region PRODUCT PRICES
|
|
1479
|
-
/**
|
|
1480
|
-
* Obtiene todos los precios de producto con filtros opcionales.
|
|
1481
|
-
* @param filter - Filtros opcionales para la búsqueda
|
|
1482
|
-
*/
|
|
1483
|
-
async getPrices(filter) {
|
|
1484
|
-
const endpoint = FilterBuilder.buildEndpoint(`${this.BASE_PATH}/prices`, filter);
|
|
1485
|
-
return this.api.executeGET(endpoint, true);
|
|
1486
|
-
}
|
|
1487
|
-
/**
|
|
1488
|
-
* Obtiene el modelo de filtros disponibles para precios de producto.
|
|
1489
|
-
*/
|
|
1490
|
-
async getPriceFiltersModel() {
|
|
1491
|
-
return this.api.executeGET(`${this.BASE_PATH}/prices/filters`, true);
|
|
1492
|
-
}
|
|
1493
|
-
/**
|
|
1494
|
-
* Obtiene un precio de producto por su ID.
|
|
1495
|
-
* @param id - ID del precio
|
|
1496
|
-
*/
|
|
1497
|
-
async getPriceById(id) {
|
|
1498
|
-
return this.api.executeGET(`${this.BASE_PATH}/prices/${id}`, true);
|
|
1499
|
-
}
|
|
1500
|
-
/**
|
|
1501
|
-
* Crea un nuevo precio de producto.
|
|
1502
|
-
* @param request - Datos del precio a crear
|
|
1503
|
-
*/
|
|
1504
|
-
async createPrice(request) {
|
|
1505
|
-
return this.api.executePOST(`${this.BASE_PATH}/prices`, request);
|
|
1506
|
-
}
|
|
1507
|
-
/**
|
|
1508
|
-
* Actualiza un precio de producto existente.
|
|
1509
|
-
* @param id - ID del precio a actualizar
|
|
1510
|
-
* @param request - Nuevos datos del precio
|
|
1511
|
-
*/
|
|
1512
|
-
async updatePrice(id, request) {
|
|
1513
|
-
return this.api.executePUT(`${this.BASE_PATH}/prices/${id}`, request);
|
|
1514
|
-
}
|
|
1515
|
-
/**
|
|
1516
|
-
* Elimina un precio de producto.
|
|
1517
|
-
* @param id - ID del precio a eliminar
|
|
1518
|
-
*/
|
|
1519
|
-
async deletePrice(id) {
|
|
1520
|
-
return this.api.executeDELETE(`${this.BASE_PATH}/prices/${id}`);
|
|
1521
|
-
}
|
|
1522
|
-
// #endregion
|
|
1523
|
-
// #region BLANK PRODUCTS
|
|
1524
|
-
/**
|
|
1525
|
-
* Obtiene todos los productos en blanco con filtros opcionales.
|
|
1526
|
-
* @param filter - Filtros opcionales para la búsqueda
|
|
1527
|
-
*/
|
|
1528
|
-
async getBlankProducts(filter) {
|
|
1529
|
-
const endpoint = FilterBuilder.buildEndpoint(`${this.BASE_PATH}/blanks`, filter);
|
|
1530
|
-
return this.api.executeGET(endpoint, true);
|
|
1531
|
-
}
|
|
1532
|
-
/**
|
|
1533
|
-
* Obtiene el modelo de filtros disponibles para productos en blanco.
|
|
1534
|
-
*/
|
|
1535
|
-
async getBlankProductFiltersModel() {
|
|
1536
|
-
return this.api.executeGET(`${this.BASE_PATH}/blanks/filters`, true);
|
|
1537
|
-
}
|
|
1538
|
-
/**
|
|
1539
|
-
* Obtiene un producto en blanco por su ID.
|
|
1540
|
-
* @param id - ID del producto en blanco
|
|
1541
|
-
*/
|
|
1542
|
-
async getBlankProductById(id) {
|
|
1543
|
-
return this.api.executeGET(`${this.BASE_PATH}/blanks/${id}`, true);
|
|
1544
|
-
}
|
|
1545
|
-
/**
|
|
1546
|
-
* Crea un nuevo producto en blanco.
|
|
1547
|
-
* @param request - Datos del producto en blanco a crear
|
|
1548
|
-
*/
|
|
1549
|
-
async createBlankProduct(request) {
|
|
1550
|
-
return this.api.executePOST(`${this.BASE_PATH}/blanks`, request);
|
|
1551
|
-
}
|
|
1552
|
-
/**
|
|
1553
|
-
* Actualiza un producto en blanco existente.
|
|
1554
|
-
* @param id - ID del producto en blanco a actualizar
|
|
1555
|
-
* @param request - Nuevos datos del producto en blanco
|
|
1556
|
-
*/
|
|
1557
|
-
async updateBlankProduct(id, request) {
|
|
1558
|
-
return this.api.executePUT(`${this.BASE_PATH}/blanks/${id}`, request);
|
|
1559
|
-
}
|
|
1560
|
-
/**
|
|
1561
|
-
* Elimina un producto en blanco.
|
|
1562
|
-
* @param id - ID del producto en blanco a eliminar
|
|
1563
|
-
*/
|
|
1564
|
-
async deleteBlankProduct(id) {
|
|
1565
|
-
return this.api.executeDELETE(`${this.BASE_PATH}/blanks/${id}`);
|
|
1566
|
-
}
|
|
1567
|
-
// #endregion
|
|
1568
|
-
// #region DETAIL PRODUCT POD
|
|
1569
|
-
/**
|
|
1570
|
-
* Obtiene todos los detalles de producto POD con filtros opcionales.
|
|
1571
|
-
* @param filter - Filtros opcionales para la búsqueda
|
|
1572
|
-
*/
|
|
1573
|
-
async getPODDetails(filter) {
|
|
1574
|
-
const endpoint = FilterBuilder.buildEndpoint(`${this.BASE_PATH}/pod-details`, filter);
|
|
1575
|
-
return this.api.executeGET(endpoint, true);
|
|
1576
|
-
}
|
|
1577
|
-
/**
|
|
1578
|
-
* Obtiene el modelo de filtros disponibles para detalles de producto POD.
|
|
1579
|
-
*/
|
|
1580
|
-
async getPODDetailFiltersModel() {
|
|
1581
|
-
return this.api.executeGET(`${this.BASE_PATH}/pod-details/filters`, true);
|
|
1582
|
-
}
|
|
1583
|
-
/**
|
|
1584
|
-
* Obtiene un detalle de producto POD por su ID.
|
|
1585
|
-
* @param id - ID del detalle POD
|
|
1586
|
-
*/
|
|
1587
|
-
async getPODDetailById(id) {
|
|
1588
|
-
return this.api.executeGET(`${this.BASE_PATH}/pod-details/${id}`, true);
|
|
1589
|
-
}
|
|
1590
|
-
/**
|
|
1591
|
-
* Crea un nuevo detalle de producto POD.
|
|
1592
|
-
* @param request - Datos del detalle POD a crear
|
|
1593
|
-
*/
|
|
1594
|
-
async createPODDetail(request) {
|
|
1595
|
-
return this.api.executePOST(`${this.BASE_PATH}/pod-details`, request);
|
|
1596
|
-
}
|
|
1597
|
-
/**
|
|
1598
|
-
* Actualiza un detalle de producto POD existente.
|
|
1599
|
-
* @param id - ID del detalle POD a actualizar
|
|
1600
|
-
* @param request - Nuevos datos del detalle POD
|
|
1601
|
-
*/
|
|
1602
|
-
async updatePODDetail(id, request) {
|
|
1603
|
-
return this.api.executePUT(`${this.BASE_PATH}/pod-details/${id}`, request);
|
|
1604
|
-
}
|
|
1605
|
-
/**
|
|
1606
|
-
* Elimina un detalle de producto POD.
|
|
1607
|
-
* @param id - ID del detalle POD a eliminar
|
|
1608
|
-
*/
|
|
1609
|
-
async deletePODDetail(id) {
|
|
1610
|
-
return this.api.executeDELETE(`${this.BASE_PATH}/pod-details/${id}`);
|
|
1611
|
-
}
|
|
1612
|
-
// #endregion
|
|
1613
|
-
// #region CATALOG - SIZES
|
|
1614
|
-
/**
|
|
1615
|
-
* Obtiene todas las tallas con filtros opcionales.
|
|
1616
|
-
* @param filter - Filtros opcionales para la búsqueda
|
|
1617
|
-
*/
|
|
1618
|
-
async getSizes(filter) {
|
|
1619
|
-
const endpoint = FilterBuilder.buildEndpoint(`${this.BASE_PATH}/catalog/sizes`, filter);
|
|
1620
|
-
return this.api.executeGET(endpoint, true);
|
|
1621
|
-
}
|
|
1622
|
-
/**
|
|
1623
|
-
* Obtiene el modelo de filtros disponibles para tallas.
|
|
1624
|
-
*/
|
|
1625
|
-
async getSizeFiltersModel() {
|
|
1626
|
-
return this.api.executeGET(`${this.BASE_PATH}/catalog/sizes/filters`, true);
|
|
1627
|
-
}
|
|
1628
|
-
/**
|
|
1629
|
-
* Obtiene una talla por su ID.
|
|
1630
|
-
* @param id - ID de la talla
|
|
1631
|
-
*/
|
|
1632
|
-
async getSizeById(id) {
|
|
1633
|
-
return this.api.executeGET(`${this.BASE_PATH}/catalog/sizes/${id}`, true);
|
|
1634
|
-
}
|
|
1635
|
-
/**
|
|
1636
|
-
* Crea una nueva talla.
|
|
1637
|
-
* @param request - Datos de la talla a crear
|
|
1638
|
-
*/
|
|
1639
|
-
async createSize(request) {
|
|
1640
|
-
return this.api.executePOST(`${this.BASE_PATH}/catalog/sizes`, request);
|
|
1641
|
-
}
|
|
1642
|
-
/**
|
|
1643
|
-
* Actualiza una talla existente.
|
|
1644
|
-
* @param id - ID de la talla a actualizar
|
|
1645
|
-
* @param request - Nuevos datos de la talla
|
|
1646
|
-
*/
|
|
1647
|
-
async updateSize(id, request) {
|
|
1648
|
-
return this.api.executePUT(`${this.BASE_PATH}/catalog/sizes/${id}`, request);
|
|
1649
|
-
}
|
|
1650
|
-
/**
|
|
1651
|
-
* Elimina una talla.
|
|
1652
|
-
* @param id - ID de la talla a eliminar
|
|
1653
|
-
*/
|
|
1654
|
-
async deleteSize(id) {
|
|
1655
|
-
return this.api.executeDELETE(`${this.BASE_PATH}/catalog/sizes/${id}`);
|
|
1656
|
-
}
|
|
1657
|
-
// #endregion
|
|
1658
|
-
// #region CATALOG - SIZE GROUPS
|
|
1659
|
-
/**
|
|
1660
|
-
* Obtiene todos los grupos de tallas con filtros opcionales.
|
|
1661
|
-
* @param filter - Filtros opcionales para la búsqueda
|
|
1662
|
-
*/
|
|
1663
|
-
async getSizeGroups(filter) {
|
|
1664
|
-
const endpoint = FilterBuilder.buildEndpoint(`${this.BASE_PATH}/catalog/size-groups`, filter);
|
|
1665
|
-
return this.api.executeGET(endpoint, true);
|
|
1666
|
-
}
|
|
1667
|
-
/**
|
|
1668
|
-
* Obtiene el modelo de filtros disponibles para grupos de tallas.
|
|
1669
|
-
*/
|
|
1670
|
-
async getSizeGroupFiltersModel() {
|
|
1671
|
-
return this.api.executeGET(`${this.BASE_PATH}/catalog/size-groups/filters`, true);
|
|
1672
|
-
}
|
|
1673
|
-
/**
|
|
1674
|
-
* Obtiene un grupo de tallas por su ID.
|
|
1675
|
-
* @param id - ID del grupo de tallas
|
|
1676
|
-
*/
|
|
1677
|
-
async getSizeGroupById(id) {
|
|
1678
|
-
return this.api.executeGET(`${this.BASE_PATH}/catalog/size-groups/${id}`, true);
|
|
1679
|
-
}
|
|
1680
|
-
/**
|
|
1681
|
-
* Crea un nuevo grupo de tallas.
|
|
1682
|
-
* @param request - Datos del grupo de tallas a crear
|
|
1683
|
-
*/
|
|
1684
|
-
async createSizeGroup(request) {
|
|
1685
|
-
return this.api.executePOST(`${this.BASE_PATH}/catalog/size-groups`, request);
|
|
1686
|
-
}
|
|
1687
|
-
/**
|
|
1688
|
-
* Actualiza un grupo de tallas existente.
|
|
1689
|
-
* @param id - ID del grupo de tallas a actualizar
|
|
1690
|
-
* @param request - Nuevos datos del grupo de tallas
|
|
1691
|
-
*/
|
|
1692
|
-
async updateSizeGroup(id, request) {
|
|
1693
|
-
return this.api.executePUT(`${this.BASE_PATH}/catalog/size-groups/${id}`, request);
|
|
1694
|
-
}
|
|
1695
|
-
/**
|
|
1696
|
-
* Elimina un grupo de tallas.
|
|
1697
|
-
* @param id - ID del grupo de tallas a eliminar
|
|
1698
|
-
*/
|
|
1699
|
-
async deleteSizeGroup(id) {
|
|
1700
|
-
return this.api.executeDELETE(`${this.BASE_PATH}/catalog/size-groups/${id}`);
|
|
1701
|
-
}
|
|
1702
|
-
// #endregion
|
|
1703
|
-
// #region CATALOG - PRODUCT TYPES
|
|
1704
|
-
/**
|
|
1705
|
-
* Obtiene todos los tipos de producto con filtros opcionales.
|
|
1706
|
-
* @param filter - Filtros opcionales para la búsqueda
|
|
1707
|
-
*/
|
|
1708
|
-
async getProductTypes(filter) {
|
|
1709
|
-
const endpoint = FilterBuilder.buildEndpoint(`${this.BASE_PATH}/catalog/product-types`, filter);
|
|
1710
|
-
return this.api.executeGET(endpoint, true);
|
|
1711
|
-
}
|
|
1712
|
-
/**
|
|
1713
|
-
* Obtiene el modelo de filtros disponibles para tipos de producto.
|
|
1714
|
-
*/
|
|
1715
|
-
async getProductTypeFiltersModel() {
|
|
1716
|
-
return this.api.executeGET(`${this.BASE_PATH}/catalog/product-types/filters`, true);
|
|
1717
|
-
}
|
|
1718
|
-
/**
|
|
1719
|
-
* Obtiene un tipo de producto por su ID.
|
|
1720
|
-
* @param id - ID del tipo de producto
|
|
1721
|
-
*/
|
|
1722
|
-
async getProductTypeById(id) {
|
|
1723
|
-
return this.api.executeGET(`${this.BASE_PATH}/catalog/product-types/${id}`, true);
|
|
1724
|
-
}
|
|
1725
|
-
/**
|
|
1726
|
-
* Crea un nuevo tipo de producto.
|
|
1727
|
-
* @param request - Datos del tipo de producto a crear
|
|
1728
|
-
*/
|
|
1729
|
-
async createProductType(request) {
|
|
1730
|
-
return this.api.executePOST(`${this.BASE_PATH}/catalog/product-types`, request);
|
|
1731
|
-
}
|
|
1732
|
-
/**
|
|
1733
|
-
* Actualiza un tipo de producto existente.
|
|
1734
|
-
* @param id - ID del tipo de producto a actualizar
|
|
1735
|
-
* @param request - Nuevos datos del tipo de producto
|
|
1736
|
-
*/
|
|
1737
|
-
async updateProductType(id, request) {
|
|
1738
|
-
return this.api.executePUT(`${this.BASE_PATH}/catalog/product-types/${id}`, request);
|
|
1739
|
-
}
|
|
1740
|
-
/**
|
|
1741
|
-
* Elimina un tipo de producto.
|
|
1742
|
-
* @param id - ID del tipo de producto a eliminar
|
|
1743
|
-
*/
|
|
1744
|
-
async deleteProductType(id) {
|
|
1745
|
-
return this.api.executeDELETE(`${this.BASE_PATH}/catalog/product-types/${id}`);
|
|
1746
|
-
}
|
|
1747
|
-
// #endregion
|
|
1748
|
-
// #region CATALOG - PRODUCT CATEGORIES
|
|
1749
|
-
/**
|
|
1750
|
-
* Obtiene todas las categorías de producto con filtros opcionales.
|
|
1751
|
-
* @param filter - Filtros opcionales para la búsqueda
|
|
1752
|
-
*/
|
|
1753
|
-
async getProductCategories(filter) {
|
|
1754
|
-
const endpoint = FilterBuilder.buildEndpoint(`${this.BASE_PATH}/catalog/product-categories`, filter);
|
|
1755
|
-
return this.api.executeGET(endpoint, true);
|
|
1756
|
-
}
|
|
1757
|
-
/**
|
|
1758
|
-
* Obtiene el modelo de filtros disponibles para categorías de producto.
|
|
1759
|
-
*/
|
|
1760
|
-
async getProductCategoryFiltersModel() {
|
|
1761
|
-
return this.api.executeGET(`${this.BASE_PATH}/catalog/product-categories/filters`, true);
|
|
1762
|
-
}
|
|
1763
|
-
/**
|
|
1764
|
-
* Obtiene una categoría de producto por su ID.
|
|
1765
|
-
* @param id - ID de la categoría
|
|
1766
|
-
*/
|
|
1767
|
-
async getProductCategoryById(id) {
|
|
1768
|
-
return this.api.executeGET(`${this.BASE_PATH}/catalog/product-categories/${id}`, true);
|
|
1769
|
-
}
|
|
1770
|
-
/**
|
|
1771
|
-
* Crea una nueva categoría de producto.
|
|
1772
|
-
* @param request - Datos de la categoría a crear
|
|
1773
|
-
*/
|
|
1774
|
-
async createProductCategory(request) {
|
|
1775
|
-
return this.api.executePOST(`${this.BASE_PATH}/catalog/product-categories`, request);
|
|
1776
|
-
}
|
|
1777
|
-
/**
|
|
1778
|
-
* Actualiza una categoría de producto existente.
|
|
1779
|
-
* @param id - ID de la categoría a actualizar
|
|
1780
|
-
* @param request - Nuevos datos de la categoría
|
|
1781
|
-
*/
|
|
1782
|
-
async updateProductCategory(id, request) {
|
|
1783
|
-
return this.api.executePUT(`${this.BASE_PATH}/catalog/product-categories/${id}`, request);
|
|
1784
|
-
}
|
|
1785
|
-
/**
|
|
1786
|
-
* Activa o desactiva una categoría de producto.
|
|
1787
|
-
* @param id - ID de la categoría
|
|
1788
|
-
*/
|
|
1789
|
-
async toggleProductCategoryStatus(id) {
|
|
1790
|
-
return this.api.executePUT(`${this.BASE_PATH}/catalog/product-categories/${id}/toggle-status`);
|
|
1791
|
-
}
|
|
1792
|
-
/**
|
|
1793
|
-
* Elimina una categoría de producto.
|
|
1794
|
-
* @param id - ID de la categoría a eliminar
|
|
1795
|
-
*/
|
|
1796
|
-
async deleteProductCategory(id) {
|
|
1797
|
-
return this.api.executeDELETE(`${this.BASE_PATH}/catalog/product-categories/${id}`);
|
|
1798
|
-
}
|
|
1799
|
-
// #endregion
|
|
1800
|
-
// #region CATALOG - PRODUCT STATUSES
|
|
1801
|
-
/**
|
|
1802
|
-
* Obtiene todos los estatus de producto con filtros opcionales.
|
|
1803
|
-
* @param filter - Filtros opcionales para la búsqueda
|
|
1804
|
-
*/
|
|
1805
|
-
async getProductStatuses(filter) {
|
|
1806
|
-
const endpoint = FilterBuilder.buildEndpoint(`${this.BASE_PATH}/catalog/product-statuses`, filter);
|
|
1807
|
-
return this.api.executeGET(endpoint, true);
|
|
1808
|
-
}
|
|
1809
|
-
/**
|
|
1810
|
-
* Obtiene el modelo de filtros disponibles para estatus de producto.
|
|
1811
|
-
*/
|
|
1812
|
-
async getProductStatusFiltersModel() {
|
|
1813
|
-
return this.api.executeGET(`${this.BASE_PATH}/catalog/product-statuses/filters`, true);
|
|
1814
|
-
}
|
|
1815
|
-
/**
|
|
1816
|
-
* Obtiene un estatus de producto por su ID.
|
|
1817
|
-
* @param id - ID del estatus
|
|
1818
|
-
*/
|
|
1819
|
-
async getProductStatusById(id) {
|
|
1820
|
-
return this.api.executeGET(`${this.BASE_PATH}/catalog/product-statuses/${id}`, true);
|
|
1821
|
-
}
|
|
1822
|
-
/**
|
|
1823
|
-
* Crea un nuevo estatus de producto.
|
|
1824
|
-
* @param request - Datos del estatus a crear
|
|
1825
|
-
*/
|
|
1826
|
-
async createProductStatus(request) {
|
|
1827
|
-
return this.api.executePOST(`${this.BASE_PATH}/catalog/product-statuses`, request);
|
|
1828
|
-
}
|
|
1829
|
-
/**
|
|
1830
|
-
* Actualiza un estatus de producto existente.
|
|
1831
|
-
* @param id - ID del estatus a actualizar
|
|
1832
|
-
* @param request - Nuevos datos del estatus
|
|
1833
|
-
*/
|
|
1834
|
-
async updateProductStatus(id, request) {
|
|
1835
|
-
return this.api.executePUT(`${this.BASE_PATH}/catalog/product-statuses/${id}`, request);
|
|
1836
|
-
}
|
|
1837
|
-
/**
|
|
1838
|
-
* Elimina un estatus de producto.
|
|
1839
|
-
* @param id - ID del estatus a eliminar
|
|
1840
|
-
*/
|
|
1841
|
-
async deleteProductStatus(id) {
|
|
1842
|
-
return this.api.executeDELETE(`${this.BASE_PATH}/catalog/product-statuses/${id}`);
|
|
1843
|
-
}
|
|
1844
|
-
// #endregion
|
|
1845
|
-
// #region CATALOG - STUDIOS
|
|
1846
|
-
/**
|
|
1847
|
-
* Obtiene todos los estudios con filtros opcionales.
|
|
1848
|
-
* @param filter - Filtros opcionales para la búsqueda
|
|
1849
|
-
*/
|
|
1850
|
-
async getStudios(filter) {
|
|
1851
|
-
const endpoint = FilterBuilder.buildEndpoint(`${this.BASE_PATH}/catalog/studios`, filter);
|
|
1852
|
-
return this.api.executeGET(endpoint, true);
|
|
1853
|
-
}
|
|
1854
|
-
/**
|
|
1855
|
-
* Obtiene el modelo de filtros disponibles para estudios.
|
|
1856
|
-
*/
|
|
1857
|
-
async getStudioFiltersModel() {
|
|
1858
|
-
return this.api.executeGET(`${this.BASE_PATH}/catalog/studios/filters`, true);
|
|
1859
|
-
}
|
|
1860
|
-
/**
|
|
1861
|
-
* Obtiene un estudio por su ID.
|
|
1862
|
-
* @param id - ID del estudio
|
|
1863
|
-
*/
|
|
1864
|
-
async getStudioById(id) {
|
|
1865
|
-
return this.api.executeGET(`${this.BASE_PATH}/catalog/studios/${id}`, true);
|
|
1866
|
-
}
|
|
1867
|
-
/**
|
|
1868
|
-
* Crea un nuevo estudio.
|
|
1869
|
-
* @param request - Datos del estudio a crear
|
|
1870
|
-
*/
|
|
1871
|
-
async createStudio(request) {
|
|
1872
|
-
return this.api.executePOST(`${this.BASE_PATH}/catalog/studios`, request);
|
|
1873
|
-
}
|
|
1874
|
-
/**
|
|
1875
|
-
* Actualiza un estudio existente.
|
|
1876
|
-
* @param id - ID del estudio a actualizar
|
|
1877
|
-
* @param request - Nuevos datos del estudio
|
|
1878
|
-
*/
|
|
1879
|
-
async updateStudio(id, request) {
|
|
1880
|
-
return this.api.executePUT(`${this.BASE_PATH}/catalog/studios/${id}`, request);
|
|
1881
|
-
}
|
|
1882
|
-
/**
|
|
1883
|
-
* Activa o desactiva un estudio.
|
|
1884
|
-
* @param id - ID del estudio
|
|
1885
|
-
*/
|
|
1886
|
-
async toggleStudioStatus(id) {
|
|
1887
|
-
return this.api.executePUT(`${this.BASE_PATH}/catalog/studios/${id}/toggle-status`);
|
|
1888
|
-
}
|
|
1889
|
-
/**
|
|
1890
|
-
* Elimina un estudio.
|
|
1891
|
-
* @param id - ID del estudio a eliminar
|
|
1351
|
+
* Actualiza la autenticación de un administrador.
|
|
1352
|
+
* @param id - ID del usuario
|
|
1353
|
+
* @param request - Nuevos datos de autenticación
|
|
1892
1354
|
*/
|
|
1893
|
-
async
|
|
1894
|
-
return this.api.
|
|
1355
|
+
async updateAdminAuthentication(id, request) {
|
|
1356
|
+
return this.api.executePUT(`${this.BASE_PATH}/admin/authentication/${id}`, request);
|
|
1895
1357
|
}
|
|
1896
1358
|
// #endregion
|
|
1897
|
-
// #region
|
|
1359
|
+
// #region User Types
|
|
1898
1360
|
/**
|
|
1899
|
-
* Obtiene
|
|
1361
|
+
* Obtiene todos los tipos de usuario con filtros opcionales.
|
|
1900
1362
|
* @param filter - Filtros opcionales para la búsqueda
|
|
1901
1363
|
*/
|
|
1902
|
-
async
|
|
1903
|
-
const endpoint = FilterBuilder.buildEndpoint(`${this.BASE_PATH}/
|
|
1364
|
+
async getUserTypes(filter) {
|
|
1365
|
+
const endpoint = FilterBuilder.buildEndpoint(`${this.BASE_PATH}/catalogs/user-types`, filter);
|
|
1904
1366
|
return this.api.executeGET(endpoint, true);
|
|
1905
1367
|
}
|
|
1906
1368
|
/**
|
|
1907
|
-
* Obtiene el modelo de filtros disponibles para
|
|
1908
|
-
*/
|
|
1909
|
-
async getLicenseFiltersModel() {
|
|
1910
|
-
return this.api.executeGET(`${this.BASE_PATH}/catalog/licenses/filters`, true);
|
|
1911
|
-
}
|
|
1912
|
-
/**
|
|
1913
|
-
* Obtiene una licencia por su ID.
|
|
1914
|
-
* @param id - ID de la licencia
|
|
1369
|
+
* Obtiene el modelo de filtros disponibles para tipos de usuario.
|
|
1915
1370
|
*/
|
|
1916
|
-
async
|
|
1917
|
-
return this.api.executeGET(`${this.BASE_PATH}/
|
|
1371
|
+
async getUserTypesFilters() {
|
|
1372
|
+
return this.api.executeGET(`${this.BASE_PATH}/catalogs/user-types/filters`, true);
|
|
1918
1373
|
}
|
|
1919
1374
|
/**
|
|
1920
|
-
*
|
|
1921
|
-
* @param
|
|
1375
|
+
* Obtiene un tipo de usuario por su ID.
|
|
1376
|
+
* @param id - ID del tipo de usuario
|
|
1922
1377
|
*/
|
|
1923
|
-
async
|
|
1924
|
-
return this.api.
|
|
1378
|
+
async getUserTypeById(id) {
|
|
1379
|
+
return this.api.executeGET(`${this.BASE_PATH}/catalogs/user-types/${id}`, true);
|
|
1925
1380
|
}
|
|
1926
1381
|
/**
|
|
1927
|
-
*
|
|
1928
|
-
* @param
|
|
1929
|
-
* @param request - Nuevos datos de la licencia
|
|
1382
|
+
* Crea un nuevo tipo de usuario.
|
|
1383
|
+
* @param request - Datos del tipo de usuario a crear
|
|
1930
1384
|
*/
|
|
1931
|
-
async
|
|
1932
|
-
return this.api.
|
|
1385
|
+
async createUserType(request) {
|
|
1386
|
+
return this.api.executePOST(`${this.BASE_PATH}/catalogs/user-types`, request);
|
|
1933
1387
|
}
|
|
1934
1388
|
/**
|
|
1935
|
-
*
|
|
1936
|
-
* @param id - ID de
|
|
1389
|
+
* Actualiza un tipo de usuario existente.
|
|
1390
|
+
* @param id - ID del tipo de usuario a actualizar
|
|
1391
|
+
* @param request - Nuevos datos del tipo de usuario
|
|
1937
1392
|
*/
|
|
1938
|
-
async
|
|
1939
|
-
return this.api.executePUT(`${this.BASE_PATH}/
|
|
1393
|
+
async updateUserType(id, request) {
|
|
1394
|
+
return this.api.executePUT(`${this.BASE_PATH}/catalogs/user-types/${id}`, request);
|
|
1940
1395
|
}
|
|
1941
1396
|
/**
|
|
1942
|
-
* Elimina
|
|
1943
|
-
* @param id - ID de
|
|
1397
|
+
* Elimina un tipo de usuario.
|
|
1398
|
+
* @param id - ID del tipo de usuario a eliminar
|
|
1944
1399
|
*/
|
|
1945
|
-
async
|
|
1946
|
-
return this.api.executeDELETE(`${this.BASE_PATH}/
|
|
1400
|
+
async deleteUserType(id) {
|
|
1401
|
+
return this.api.executeDELETE(`${this.BASE_PATH}/catalogs/user-types/${id}`);
|
|
1947
1402
|
}
|
|
1948
1403
|
// #endregion
|
|
1949
|
-
// #region
|
|
1404
|
+
// #region Roles
|
|
1950
1405
|
/**
|
|
1951
|
-
* Obtiene todos los
|
|
1406
|
+
* Obtiene todos los roles con filtros opcionales.
|
|
1952
1407
|
* @param filter - Filtros opcionales para la búsqueda
|
|
1953
1408
|
*/
|
|
1954
|
-
async
|
|
1955
|
-
const endpoint = FilterBuilder.buildEndpoint(`${this.BASE_PATH}/
|
|
1409
|
+
async getRoles(filter) {
|
|
1410
|
+
const endpoint = FilterBuilder.buildEndpoint(`${this.BASE_PATH}/catalogs/roles`, filter);
|
|
1956
1411
|
return this.api.executeGET(endpoint, true);
|
|
1957
1412
|
}
|
|
1958
1413
|
/**
|
|
1959
|
-
* Obtiene el modelo de filtros disponibles para
|
|
1960
|
-
*/
|
|
1961
|
-
async getProviderFiltersModel() {
|
|
1962
|
-
return this.api.executeGET(`${this.BASE_PATH}/catalog/providers/filters`, true);
|
|
1963
|
-
}
|
|
1964
|
-
/**
|
|
1965
|
-
* Obtiene un proveedor por su ID.
|
|
1966
|
-
* @param id - ID del proveedor
|
|
1967
|
-
*/
|
|
1968
|
-
async getProviderById(id) {
|
|
1969
|
-
return this.api.executeGET(`${this.BASE_PATH}/catalog/providers/${id}`, true);
|
|
1970
|
-
}
|
|
1971
|
-
/**
|
|
1972
|
-
* Crea un nuevo proveedor.
|
|
1973
|
-
* @param request - Datos del proveedor a crear
|
|
1974
|
-
*/
|
|
1975
|
-
async createProvider(request) {
|
|
1976
|
-
return this.api.executePOST(`${this.BASE_PATH}/catalog/providers`, request);
|
|
1977
|
-
}
|
|
1978
|
-
/**
|
|
1979
|
-
* Actualiza un proveedor existente.
|
|
1980
|
-
* @param id - ID del proveedor a actualizar
|
|
1981
|
-
* @param request - Nuevos datos del proveedor
|
|
1982
|
-
*/
|
|
1983
|
-
async updateProvider(id, request) {
|
|
1984
|
-
return this.api.executePUT(`${this.BASE_PATH}/catalog/providers/${id}`, request);
|
|
1985
|
-
}
|
|
1986
|
-
/**
|
|
1987
|
-
* Activa o desactiva un proveedor.
|
|
1988
|
-
* @param id - ID del proveedor
|
|
1989
|
-
*/
|
|
1990
|
-
async toggleProviderStatus(id) {
|
|
1991
|
-
return this.api.executePUT(`${this.BASE_PATH}/catalog/providers/${id}/toggle-status`);
|
|
1992
|
-
}
|
|
1993
|
-
/**
|
|
1994
|
-
* Elimina un proveedor.
|
|
1995
|
-
* @param id - ID del proveedor a eliminar
|
|
1996
|
-
*/
|
|
1997
|
-
async deleteProvider(id) {
|
|
1998
|
-
return this.api.executeDELETE(`${this.BASE_PATH}/catalog/providers/${id}`);
|
|
1999
|
-
}
|
|
2000
|
-
// #endregion
|
|
2001
|
-
};
|
|
2002
|
-
|
|
2003
|
-
// src/services/CatalogService.ts
|
|
2004
|
-
var CatalogService = class {
|
|
2005
|
-
constructor(api) {
|
|
2006
|
-
this.BASE_PATH = "catalogs";
|
|
2007
|
-
this.api = api;
|
|
2008
|
-
}
|
|
2009
|
-
// #region GENDERS
|
|
2010
|
-
/**
|
|
2011
|
-
* Obtiene todos los géneros con filtros opcionales.
|
|
2012
|
-
* @param filter - Filtros opcionales para la búsqueda
|
|
2013
|
-
*/
|
|
2014
|
-
async getGenders(filter) {
|
|
2015
|
-
const endpoint = FilterBuilder.buildEndpoint(`${this.BASE_PATH}/genders`, filter);
|
|
2016
|
-
return this.api.executeGET(endpoint, false);
|
|
2017
|
-
}
|
|
2018
|
-
/**
|
|
2019
|
-
* Obtiene el modelo de filtros disponibles para géneros.
|
|
2020
|
-
*/
|
|
2021
|
-
async getGendersFilters() {
|
|
2022
|
-
return this.api.executeGET(`${this.BASE_PATH}/genders/filters`, false);
|
|
2023
|
-
}
|
|
2024
|
-
/**
|
|
2025
|
-
* Obtiene un género por su ID.
|
|
2026
|
-
* @param id - ID del género
|
|
2027
|
-
*/
|
|
2028
|
-
async getGenderById(id) {
|
|
2029
|
-
return this.api.executeGET(`${this.BASE_PATH}/genders/${id}`, false);
|
|
2030
|
-
}
|
|
2031
|
-
/**
|
|
2032
|
-
* Crea un nuevo género.
|
|
2033
|
-
* @param request - Datos del género a crear
|
|
2034
|
-
*/
|
|
2035
|
-
async createGender(request) {
|
|
2036
|
-
return this.api.executePOST(`${this.BASE_PATH}/genders`, request);
|
|
2037
|
-
}
|
|
2038
|
-
/**
|
|
2039
|
-
* Actualiza un género existente.
|
|
2040
|
-
* @param id - ID del género a actualizar
|
|
2041
|
-
* @param request - Nuevos datos del género
|
|
2042
|
-
*/
|
|
2043
|
-
async updateGender(id, request) {
|
|
2044
|
-
return this.api.executePUT(`${this.BASE_PATH}/genders/${id}`, request);
|
|
2045
|
-
}
|
|
2046
|
-
/**
|
|
2047
|
-
* Elimina un género.
|
|
2048
|
-
* @param id - ID del género a eliminar
|
|
2049
|
-
*/
|
|
2050
|
-
async deleteGender(id) {
|
|
2051
|
-
return this.api.executeDELETE(`${this.BASE_PATH}/genders/${id}`);
|
|
2052
|
-
}
|
|
2053
|
-
// #endregion
|
|
2054
|
-
// #region AREA CODES
|
|
2055
|
-
/**
|
|
2056
|
-
* Obtiene todos los códigos de área con filtros opcionales.
|
|
2057
|
-
* @param filter - Filtros opcionales para la búsqueda
|
|
1414
|
+
* Obtiene el modelo de filtros disponibles para roles.
|
|
2058
1415
|
*/
|
|
2059
|
-
async
|
|
2060
|
-
|
|
2061
|
-
return this.api.executeGET(endpoint, false);
|
|
1416
|
+
async getRolesFilters() {
|
|
1417
|
+
return this.api.executeGET(`${this.BASE_PATH}/catalogs/roles/filters`, true);
|
|
2062
1418
|
}
|
|
2063
1419
|
/**
|
|
2064
|
-
* Obtiene
|
|
1420
|
+
* Obtiene un rol por su ID.
|
|
1421
|
+
* @param id - ID del rol
|
|
2065
1422
|
*/
|
|
2066
|
-
async
|
|
2067
|
-
return this.api.executeGET(`${this.BASE_PATH}/
|
|
1423
|
+
async getRoleById(id) {
|
|
1424
|
+
return this.api.executeGET(`${this.BASE_PATH}/catalogs/roles/${id}`, true);
|
|
2068
1425
|
}
|
|
2069
1426
|
/**
|
|
2070
|
-
* Obtiene
|
|
2071
|
-
* @param
|
|
1427
|
+
* Obtiene los roles asociados a un tipo de usuario.
|
|
1428
|
+
* @param userTypeId - ID del tipo de usuario
|
|
2072
1429
|
*/
|
|
2073
|
-
async
|
|
2074
|
-
return this.api.executeGET(`${this.BASE_PATH}/
|
|
1430
|
+
async getRolesByUserType(userTypeId) {
|
|
1431
|
+
return this.api.executeGET(`${this.BASE_PATH}/catalogs/roles/user-type/${userTypeId}`, true);
|
|
2075
1432
|
}
|
|
2076
1433
|
/**
|
|
2077
|
-
* Crea un nuevo
|
|
2078
|
-
* @param request - Datos del
|
|
1434
|
+
* Crea un nuevo rol.
|
|
1435
|
+
* @param request - Datos del rol a crear
|
|
2079
1436
|
*/
|
|
2080
|
-
async
|
|
2081
|
-
return this.api.executePOST(`${this.BASE_PATH}/
|
|
1437
|
+
async createRole(request) {
|
|
1438
|
+
return this.api.executePOST(`${this.BASE_PATH}/catalogs/roles`, request);
|
|
2082
1439
|
}
|
|
2083
1440
|
/**
|
|
2084
|
-
* Actualiza un
|
|
2085
|
-
* @param id - ID del
|
|
2086
|
-
* @param request - Nuevos datos del
|
|
1441
|
+
* Actualiza un rol existente.
|
|
1442
|
+
* @param id - ID del rol a actualizar
|
|
1443
|
+
* @param request - Nuevos datos del rol
|
|
2087
1444
|
*/
|
|
2088
|
-
async
|
|
2089
|
-
return this.api.executePUT(`${this.BASE_PATH}/
|
|
1445
|
+
async updateRole(id, request) {
|
|
1446
|
+
return this.api.executePUT(`${this.BASE_PATH}/catalogs/roles/${id}`, request);
|
|
2090
1447
|
}
|
|
2091
1448
|
/**
|
|
2092
|
-
* Activa o desactiva un
|
|
2093
|
-
* @param id - ID del
|
|
1449
|
+
* Activa o desactiva un rol.
|
|
1450
|
+
* @param id - ID del rol
|
|
2094
1451
|
*/
|
|
2095
|
-
async
|
|
2096
|
-
return this.api.executePUT(`${this.BASE_PATH}/
|
|
1452
|
+
async toggleRoleStatus(id) {
|
|
1453
|
+
return this.api.executePUT(`${this.BASE_PATH}/catalogs/roles/${id}/toggle-status`);
|
|
2097
1454
|
}
|
|
2098
1455
|
/**
|
|
2099
|
-
* Elimina un
|
|
2100
|
-
* @param id - ID del
|
|
1456
|
+
* Elimina un rol.
|
|
1457
|
+
* @param id - ID del rol a eliminar
|
|
2101
1458
|
*/
|
|
2102
|
-
async
|
|
2103
|
-
return this.api.executeDELETE(`${this.BASE_PATH}/
|
|
1459
|
+
async deleteRole(id) {
|
|
1460
|
+
return this.api.executeDELETE(`${this.BASE_PATH}/catalogs/roles/${id}`);
|
|
2104
1461
|
}
|
|
2105
1462
|
// #endregion
|
|
2106
1463
|
};
|
|
@@ -2168,9 +1525,6 @@ var FalconHUBSDK = class {
|
|
|
2168
1525
|
this.inventory = new InventoryService(
|
|
2169
1526
|
this.api
|
|
2170
1527
|
);
|
|
2171
|
-
this.product = new ProductService(
|
|
2172
|
-
this.api
|
|
2173
|
-
);
|
|
2174
1528
|
this.catalog = new CatalogService(
|
|
2175
1529
|
this.api
|
|
2176
1530
|
);
|
|
@@ -2254,7 +1608,6 @@ export {
|
|
|
2254
1608
|
FalconHUBSDK,
|
|
2255
1609
|
FilterBuilder,
|
|
2256
1610
|
InventoryService,
|
|
2257
|
-
ProductService,
|
|
2258
1611
|
SystemService,
|
|
2259
1612
|
TokenManager,
|
|
2260
1613
|
UserService,
|