ptechcore_ui 1.0.33 → 1.0.34

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.cjs CHANGED
@@ -918,16 +918,16 @@ var AuthServices = {
918
918
  // src/services/VendorServices.ts
919
919
  var VENDORS_API_URL = `${API_URL}/accounting/vendors/`;
920
920
  var VendorServices = {
921
- createVendor: (data, token) => {
921
+ create: (data) => {
922
922
  const payload = { ...data };
923
923
  if (!payload.logo) {
924
924
  delete payload.logo;
925
925
  }
926
- return FetchApi.post(`${VENDORS_API_URL}`, payload, token);
926
+ return FetchApi.post(`${VENDORS_API_URL}`, payload);
927
927
  },
928
- getVendor: (id, token) => FetchApi.get(`${VENDORS_API_URL}${id}/`, token),
929
- getVendors: (token, params) => FetchApi.get(`${VENDORS_API_URL}?${new URLSearchParams(params).toString()}`, token),
930
- listVendors: (params) => {
928
+ get: (id) => FetchApi.get(`${VENDORS_API_URL}${id}/`),
929
+ list: (params) => FetchApi.get(`${VENDORS_API_URL}?${new URLSearchParams(params).toString()}`),
930
+ search: (params) => {
931
931
  const searchParams = new URLSearchParams();
932
932
  if (params) {
933
933
  Object.entries(params).forEach(([key, value]) => {
@@ -939,14 +939,14 @@ var VendorServices = {
939
939
  const queryString = searchParams.toString();
940
940
  return FetchApi.get(`${VENDORS_API_URL}search/${queryString ? `?${queryString}` : ""}`);
941
941
  },
942
- updateVendor: (id, data, token) => {
942
+ update: (id, data) => {
943
943
  const payload = { ...data };
944
944
  if (!payload.logo) {
945
945
  delete payload.logo;
946
946
  }
947
- return FetchApi.put(`${VENDORS_API_URL}${id}/`, payload, token);
947
+ return FetchApi.put(`${VENDORS_API_URL}${id}/`, payload);
948
948
  },
949
- deleteVendor: (id, token) => FetchApi.delete(`${VENDORS_API_URL}${id}/`, token)
949
+ delete: (id) => FetchApi.delete(`${VENDORS_API_URL}${id}/`)
950
950
  };
951
951
 
952
952
  // src/contexts/SessionContext.tsx
@@ -1006,7 +1006,7 @@ var SessionProvider = ({ children }) => {
1006
1006
  }
1007
1007
  try {
1008
1008
  setLoadingVendors(true);
1009
- const result = await VendorServices.getVendors(token, { business_entity_id: activeBusinessEntity?.id });
1009
+ const result = await VendorServices.list({ business_entity_id: activeBusinessEntity?.id });
1010
1010
  setVendors(result.data);
1011
1011
  const cacheKey = `vendors_cache_${activeBusinessEntity?.id || "default"}`;
1012
1012
  sessionStorage.setItem(cacheKey, JSON.stringify(result.data));
@@ -3571,16 +3571,16 @@ var UnitServices = {
3571
3571
  // src/services/ClientServices.ts
3572
3572
  var CLIENTS_API_URL = `${API_URL}/accounting/clients/`;
3573
3573
  var ClientServices = {
3574
- createClient: (data, token) => {
3574
+ create: (data) => {
3575
3575
  const payload = { ...data };
3576
3576
  if (!payload.logo) {
3577
3577
  delete payload.logo;
3578
3578
  }
3579
- return FetchApi.post(`${CLIENTS_API_URL}`, payload, token);
3579
+ return FetchApi.post(`${CLIENTS_API_URL}`, payload);
3580
3580
  },
3581
- getClient: (id, token) => FetchApi.get(`${CLIENTS_API_URL}${id}/`, token),
3582
- getClients: (token, params) => FetchApi.get(`${CLIENTS_API_URL}?${new URLSearchParams(params).toString()}`, token),
3583
- listClients: (params) => {
3581
+ get: (id) => FetchApi.get(`${CLIENTS_API_URL}${id}/`),
3582
+ list: (params) => FetchApi.get(`${CLIENTS_API_URL}?${new URLSearchParams(params).toString()}`),
3583
+ search: (params) => {
3584
3584
  const searchParams = new URLSearchParams();
3585
3585
  if (params) {
3586
3586
  Object.entries(params).forEach(([key, value]) => {
@@ -3592,14 +3592,14 @@ var ClientServices = {
3592
3592
  const queryString = searchParams.toString();
3593
3593
  return FetchApi.get(`${CLIENTS_API_URL}search/${queryString ? `?${queryString}` : ""}`);
3594
3594
  },
3595
- updateClient: (id, data, token) => {
3595
+ update: (id, data) => {
3596
3596
  const payload = { ...data };
3597
3597
  if (!payload.logo) {
3598
3598
  delete payload.logo;
3599
3599
  }
3600
- return FetchApi.put(`${CLIENTS_API_URL}${id}/`, payload, token);
3600
+ return FetchApi.put(`${CLIENTS_API_URL}${id}/`, payload);
3601
3601
  },
3602
- deleteClient: (id, token) => FetchApi.delete(`${CLIENTS_API_URL}${id}/`, token)
3602
+ delete: (id) => FetchApi.delete(`${CLIENTS_API_URL}${id}/`)
3603
3603
  };
3604
3604
 
3605
3605
  // src/components/common/FDrawer.tsx
@@ -4845,10 +4845,10 @@ var FormVendor = ({
4845
4845
  const handleSaveVendor = async (entityData) => {
4846
4846
  try {
4847
4847
  if (object && object.id) {
4848
- await VendorServices.updateVendor(object.id, entityData, token);
4848
+ await VendorServices.update(object.id, entityData);
4849
4849
  success("Fournisseur modifi\xE9 avec succ\xE8s !");
4850
4850
  } else {
4851
- await VendorServices.createVendor(entityData, token);
4851
+ await VendorServices.create(entityData);
4852
4852
  success("Fournisseur cr\xE9\xE9 avec succ\xE8s !");
4853
4853
  }
4854
4854
  refresh();
@@ -7004,10 +7004,10 @@ var FormClient = ({
7004
7004
  ...logo && typeof logo !== "string" ? { logo } : {}
7005
7005
  };
7006
7006
  if (object && object.id) {
7007
- await ClientServices.updateClient(object.id, dataToSave, token || "");
7007
+ await ClientServices.update(object.id, dataToSave);
7008
7008
  success("Client modifi\xE9 avec succ\xE8s");
7009
7009
  } else {
7010
- await ClientServices.createClient(dataToSave, token || "");
7010
+ await ClientServices.create(dataToSave);
7011
7011
  success("Client cr\xE9\xE9 avec succ\xE8s");
7012
7012
  }
7013
7013
  refresh();
@@ -8725,7 +8725,7 @@ var SelectVendor = ({
8725
8725
  }
8726
8726
  try {
8727
8727
  setLoadingVendors(true);
8728
- const result = await VendorServices.getVendors(token, { business_entity_id: activeBusinessEntity?.id });
8728
+ const result = await VendorServices.list({ business_entity_id: activeBusinessEntity?.id });
8729
8729
  setVendors(result.data);
8730
8730
  const cacheKey = `vendors_cache_${activeBusinessEntity?.id || "default"}`;
8731
8731
  sessionStorage.setItem(cacheKey, JSON.stringify(result.data));
package/dist/index.d.cts CHANGED
@@ -620,12 +620,12 @@ interface VendorListResponse {
620
620
  };
621
621
  }
622
622
  declare const VendorServices: {
623
- createVendor: (data: Partial<Vendor>, token: string) => Promise<unknown>;
624
- getVendor: (id: number, token: string) => Promise<unknown>;
625
- getVendors: (token: string, params?: any) => Promise<unknown>;
626
- listVendors: (params?: Record<string, any>) => Promise<VendorListResponse>;
627
- updateVendor: (id: number, data: Partial<Vendor>, token: string) => Promise<unknown>;
628
- deleteVendor: (id: number, token: string) => Promise<unknown>;
623
+ create: (data: Partial<Vendor>) => Promise<unknown>;
624
+ get: (id: number) => Promise<unknown>;
625
+ list: (params?: any) => Promise<unknown>;
626
+ search: (params?: Record<string, any>) => Promise<VendorListResponse>;
627
+ update: (id: number, data: Partial<Vendor>) => Promise<unknown>;
628
+ delete: (id: number) => Promise<unknown>;
629
629
  };
630
630
 
631
631
  type FromModule = 'accounting' | 'crm' | 'procurement';
@@ -689,12 +689,12 @@ interface ClientListResponse {
689
689
  };
690
690
  }
691
691
  declare const ClientServices: {
692
- createClient: (data: Partial<Client>, token: string) => Promise<unknown>;
693
- getClient: (id: number, token: string) => Promise<Client>;
694
- getClients: (token: string, params?: any) => Promise<unknown>;
695
- listClients: (params?: Record<string, any>) => Promise<ClientListResponse>;
696
- updateClient: (id: number, data: Partial<Client>, token: string) => Promise<unknown>;
697
- deleteClient: (id: number, token: string) => Promise<unknown>;
692
+ create: (data: Partial<Client>) => Promise<unknown>;
693
+ get: (id: number) => Promise<Client>;
694
+ list: (params?: any) => Promise<unknown>;
695
+ search: (params?: Record<string, any>) => Promise<ClientListResponse>;
696
+ update: (id: number, data: Partial<Client>) => Promise<unknown>;
697
+ delete: (id: number) => Promise<unknown>;
698
698
  };
699
699
 
700
700
  type ImportField = {
package/dist/index.d.ts CHANGED
@@ -620,12 +620,12 @@ interface VendorListResponse {
620
620
  };
621
621
  }
622
622
  declare const VendorServices: {
623
- createVendor: (data: Partial<Vendor>, token: string) => Promise<unknown>;
624
- getVendor: (id: number, token: string) => Promise<unknown>;
625
- getVendors: (token: string, params?: any) => Promise<unknown>;
626
- listVendors: (params?: Record<string, any>) => Promise<VendorListResponse>;
627
- updateVendor: (id: number, data: Partial<Vendor>, token: string) => Promise<unknown>;
628
- deleteVendor: (id: number, token: string) => Promise<unknown>;
623
+ create: (data: Partial<Vendor>) => Promise<unknown>;
624
+ get: (id: number) => Promise<unknown>;
625
+ list: (params?: any) => Promise<unknown>;
626
+ search: (params?: Record<string, any>) => Promise<VendorListResponse>;
627
+ update: (id: number, data: Partial<Vendor>) => Promise<unknown>;
628
+ delete: (id: number) => Promise<unknown>;
629
629
  };
630
630
 
631
631
  type FromModule = 'accounting' | 'crm' | 'procurement';
@@ -689,12 +689,12 @@ interface ClientListResponse {
689
689
  };
690
690
  }
691
691
  declare const ClientServices: {
692
- createClient: (data: Partial<Client>, token: string) => Promise<unknown>;
693
- getClient: (id: number, token: string) => Promise<Client>;
694
- getClients: (token: string, params?: any) => Promise<unknown>;
695
- listClients: (params?: Record<string, any>) => Promise<ClientListResponse>;
696
- updateClient: (id: number, data: Partial<Client>, token: string) => Promise<unknown>;
697
- deleteClient: (id: number, token: string) => Promise<unknown>;
692
+ create: (data: Partial<Client>) => Promise<unknown>;
693
+ get: (id: number) => Promise<Client>;
694
+ list: (params?: any) => Promise<unknown>;
695
+ search: (params?: Record<string, any>) => Promise<ClientListResponse>;
696
+ update: (id: number, data: Partial<Client>) => Promise<unknown>;
697
+ delete: (id: number) => Promise<unknown>;
698
698
  };
699
699
 
700
700
  type ImportField = {
package/dist/index.js CHANGED
@@ -841,16 +841,16 @@ var AuthServices = {
841
841
  // src/services/VendorServices.ts
842
842
  var VENDORS_API_URL = `${API_URL}/accounting/vendors/`;
843
843
  var VendorServices = {
844
- createVendor: (data, token) => {
844
+ create: (data) => {
845
845
  const payload = { ...data };
846
846
  if (!payload.logo) {
847
847
  delete payload.logo;
848
848
  }
849
- return FetchApi.post(`${VENDORS_API_URL}`, payload, token);
849
+ return FetchApi.post(`${VENDORS_API_URL}`, payload);
850
850
  },
851
- getVendor: (id, token) => FetchApi.get(`${VENDORS_API_URL}${id}/`, token),
852
- getVendors: (token, params) => FetchApi.get(`${VENDORS_API_URL}?${new URLSearchParams(params).toString()}`, token),
853
- listVendors: (params) => {
851
+ get: (id) => FetchApi.get(`${VENDORS_API_URL}${id}/`),
852
+ list: (params) => FetchApi.get(`${VENDORS_API_URL}?${new URLSearchParams(params).toString()}`),
853
+ search: (params) => {
854
854
  const searchParams = new URLSearchParams();
855
855
  if (params) {
856
856
  Object.entries(params).forEach(([key, value]) => {
@@ -862,14 +862,14 @@ var VendorServices = {
862
862
  const queryString = searchParams.toString();
863
863
  return FetchApi.get(`${VENDORS_API_URL}search/${queryString ? `?${queryString}` : ""}`);
864
864
  },
865
- updateVendor: (id, data, token) => {
865
+ update: (id, data) => {
866
866
  const payload = { ...data };
867
867
  if (!payload.logo) {
868
868
  delete payload.logo;
869
869
  }
870
- return FetchApi.put(`${VENDORS_API_URL}${id}/`, payload, token);
870
+ return FetchApi.put(`${VENDORS_API_URL}${id}/`, payload);
871
871
  },
872
- deleteVendor: (id, token) => FetchApi.delete(`${VENDORS_API_URL}${id}/`, token)
872
+ delete: (id) => FetchApi.delete(`${VENDORS_API_URL}${id}/`)
873
873
  };
874
874
 
875
875
  // src/contexts/SessionContext.tsx
@@ -929,7 +929,7 @@ var SessionProvider = ({ children }) => {
929
929
  }
930
930
  try {
931
931
  setLoadingVendors(true);
932
- const result = await VendorServices.getVendors(token, { business_entity_id: activeBusinessEntity?.id });
932
+ const result = await VendorServices.list({ business_entity_id: activeBusinessEntity?.id });
933
933
  setVendors(result.data);
934
934
  const cacheKey = `vendors_cache_${activeBusinessEntity?.id || "default"}`;
935
935
  sessionStorage.setItem(cacheKey, JSON.stringify(result.data));
@@ -3494,16 +3494,16 @@ var UnitServices = {
3494
3494
  // src/services/ClientServices.ts
3495
3495
  var CLIENTS_API_URL = `${API_URL}/accounting/clients/`;
3496
3496
  var ClientServices = {
3497
- createClient: (data, token) => {
3497
+ create: (data) => {
3498
3498
  const payload = { ...data };
3499
3499
  if (!payload.logo) {
3500
3500
  delete payload.logo;
3501
3501
  }
3502
- return FetchApi.post(`${CLIENTS_API_URL}`, payload, token);
3502
+ return FetchApi.post(`${CLIENTS_API_URL}`, payload);
3503
3503
  },
3504
- getClient: (id, token) => FetchApi.get(`${CLIENTS_API_URL}${id}/`, token),
3505
- getClients: (token, params) => FetchApi.get(`${CLIENTS_API_URL}?${new URLSearchParams(params).toString()}`, token),
3506
- listClients: (params) => {
3504
+ get: (id) => FetchApi.get(`${CLIENTS_API_URL}${id}/`),
3505
+ list: (params) => FetchApi.get(`${CLIENTS_API_URL}?${new URLSearchParams(params).toString()}`),
3506
+ search: (params) => {
3507
3507
  const searchParams = new URLSearchParams();
3508
3508
  if (params) {
3509
3509
  Object.entries(params).forEach(([key, value]) => {
@@ -3515,14 +3515,14 @@ var ClientServices = {
3515
3515
  const queryString = searchParams.toString();
3516
3516
  return FetchApi.get(`${CLIENTS_API_URL}search/${queryString ? `?${queryString}` : ""}`);
3517
3517
  },
3518
- updateClient: (id, data, token) => {
3518
+ update: (id, data) => {
3519
3519
  const payload = { ...data };
3520
3520
  if (!payload.logo) {
3521
3521
  delete payload.logo;
3522
3522
  }
3523
- return FetchApi.put(`${CLIENTS_API_URL}${id}/`, payload, token);
3523
+ return FetchApi.put(`${CLIENTS_API_URL}${id}/`, payload);
3524
3524
  },
3525
- deleteClient: (id, token) => FetchApi.delete(`${CLIENTS_API_URL}${id}/`, token)
3525
+ delete: (id) => FetchApi.delete(`${CLIENTS_API_URL}${id}/`)
3526
3526
  };
3527
3527
 
3528
3528
  // src/components/common/FDrawer.tsx
@@ -4773,10 +4773,10 @@ var FormVendor = ({
4773
4773
  const handleSaveVendor = async (entityData) => {
4774
4774
  try {
4775
4775
  if (object && object.id) {
4776
- await VendorServices.updateVendor(object.id, entityData, token);
4776
+ await VendorServices.update(object.id, entityData);
4777
4777
  success("Fournisseur modifi\xE9 avec succ\xE8s !");
4778
4778
  } else {
4779
- await VendorServices.createVendor(entityData, token);
4779
+ await VendorServices.create(entityData);
4780
4780
  success("Fournisseur cr\xE9\xE9 avec succ\xE8s !");
4781
4781
  }
4782
4782
  refresh();
@@ -6951,10 +6951,10 @@ var FormClient = ({
6951
6951
  ...logo && typeof logo !== "string" ? { logo } : {}
6952
6952
  };
6953
6953
  if (object && object.id) {
6954
- await ClientServices.updateClient(object.id, dataToSave, token || "");
6954
+ await ClientServices.update(object.id, dataToSave);
6955
6955
  success("Client modifi\xE9 avec succ\xE8s");
6956
6956
  } else {
6957
- await ClientServices.createClient(dataToSave, token || "");
6957
+ await ClientServices.create(dataToSave);
6958
6958
  success("Client cr\xE9\xE9 avec succ\xE8s");
6959
6959
  }
6960
6960
  refresh();
@@ -8672,7 +8672,7 @@ var SelectVendor = ({
8672
8672
  }
8673
8673
  try {
8674
8674
  setLoadingVendors(true);
8675
- const result = await VendorServices.getVendors(token, { business_entity_id: activeBusinessEntity?.id });
8675
+ const result = await VendorServices.list({ business_entity_id: activeBusinessEntity?.id });
8676
8676
  setVendors(result.data);
8677
8677
  const cacheKey = `vendors_cache_${activeBusinessEntity?.id || "default"}`;
8678
8678
  sessionStorage.setItem(cacheKey, JSON.stringify(result.data));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ptechcore_ui",
3
- "version": "1.0.33",
3
+ "version": "1.0.34",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",