repzo 1.0.80 → 1.0.81

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/lib/index.d.ts CHANGED
@@ -568,6 +568,23 @@ export default class Repzo {
568
568
  params?: Service.Workorder.Get.Params
569
569
  ) => Promise<Service.Workorder.Get.Result>;
570
570
  };
571
+ supplier: {
572
+ _path: string;
573
+ find: (
574
+ params?: Service.Supplier.Find.Params
575
+ ) => Promise<Service.Supplier.Find.Result>;
576
+ get: (
577
+ id: Service.Supplier.Get.ID,
578
+ params?: Service.Supplier.Get.Params
579
+ ) => Promise<Service.Supplier.Get.Result>;
580
+ create: (
581
+ body: Service.Supplier.Create.Body
582
+ ) => Promise<Service.Supplier.Create.Result>;
583
+ update: (
584
+ id: Service.Supplier.Update.ID,
585
+ body: Service.Supplier.Update.Body
586
+ ) => Promise<Service.Supplier.Update.Result>;
587
+ };
571
588
  quickConvertToPdf: {
572
589
  _path: string;
573
590
  find: (
package/lib/index.js CHANGED
@@ -1175,6 +1175,40 @@ export default class Repzo {
1175
1175
  );
1176
1176
  },
1177
1177
  };
1178
+ this.supplier = {
1179
+ _path: "/supplier",
1180
+ find: async (params) => {
1181
+ let res = await this._fetch(
1182
+ this.svAPIEndpoint,
1183
+ this.supplier._path,
1184
+ params
1185
+ );
1186
+ return res;
1187
+ },
1188
+ get: async (id, params) => {
1189
+ return await this._fetch(
1190
+ this.svAPIEndpoint,
1191
+ this.supplier._path + `/${id}`,
1192
+ params
1193
+ );
1194
+ },
1195
+ create: async (body) => {
1196
+ let res = await this._create(
1197
+ this.svAPIEndpoint,
1198
+ this.supplier._path,
1199
+ body
1200
+ );
1201
+ return res;
1202
+ },
1203
+ update: async (id, body) => {
1204
+ let res = await this._update(
1205
+ this.svAPIEndpoint,
1206
+ this.supplier._path + `/${id}`,
1207
+ body
1208
+ );
1209
+ return res;
1210
+ },
1211
+ };
1178
1212
  this.quickConvertToPdf = {
1179
1213
  _path: "/quick-convert-to-pdf",
1180
1214
  find: async (params) => {
@@ -6766,6 +6766,69 @@ export declare namespace Service {
6766
6766
  type Result = ReceivingMaterialSchema;
6767
6767
  }
6768
6768
  }
6769
+ namespace Supplier {
6770
+ interface SupplierSchema {
6771
+ _id: string;
6772
+ name: string;
6773
+ local_name?: string;
6774
+ phone?: string;
6775
+ address?: string;
6776
+ tax_number?: string;
6777
+ type: "individual" | "company";
6778
+ disabled: boolean;
6779
+ company_namespace: string[];
6780
+ createdAt: string;
6781
+ updatedAt: string;
6782
+ }
6783
+ interface CreateBody {
6784
+ name: string;
6785
+ local_name?: string;
6786
+ phone?: string;
6787
+ address?: string;
6788
+ tax_number?: string;
6789
+ type: "individual" | "company";
6790
+ disabled: boolean;
6791
+ company_namespace: string[];
6792
+ }
6793
+ interface UpdateBody {
6794
+ _id?: string;
6795
+ name?: string;
6796
+ local_name?: string;
6797
+ phone?: string;
6798
+ address?: string;
6799
+ tax_number?: string;
6800
+ type?: "individual" | "company";
6801
+ disabled?: boolean;
6802
+ company_namespace?: string[];
6803
+ }
6804
+ namespace Find {
6805
+ type Params = DefaultPaginationQueryParams & {
6806
+ _id?: string[] | string;
6807
+ name?: string;
6808
+ local_name?: string;
6809
+ type?: string;
6810
+ from_updatedAt?: number;
6811
+ [key: string]: any;
6812
+ };
6813
+ interface Result extends DefaultPaginationResult {
6814
+ data: SupplierSchema[];
6815
+ }
6816
+ }
6817
+ namespace Get {
6818
+ type ID = string;
6819
+ interface Params {}
6820
+ type Result = SupplierSchema;
6821
+ }
6822
+ namespace Create {
6823
+ type Body = CreateBody;
6824
+ type Result = SupplierSchema;
6825
+ }
6826
+ namespace Update {
6827
+ type ID = string;
6828
+ type Body = UpdateBody;
6829
+ type Result = SupplierSchema;
6830
+ }
6831
+ }
6769
6832
  namespace Cycle {
6770
6833
  type CycleStatus = "pending" | "approved" | "processing" | "rejected";
6771
6834
  export interface Schema {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repzo",
3
- "version": "1.0.80",
3
+ "version": "1.0.81",
4
4
  "description": "Repzo TypeScript SDK",
5
5
  "main": "./lib/index.js",
6
6
  "type": "module",
package/src/index.ts CHANGED
@@ -1689,6 +1689,51 @@ export default class Repzo {
1689
1689
  );
1690
1690
  },
1691
1691
  };
1692
+ supplier = {
1693
+ _path: "/supplier",
1694
+ find: async (
1695
+ params?: Service.Supplier.Find.Params
1696
+ ): Promise<Service.Supplier.Find.Result> => {
1697
+ let res: Service.Supplier.Find.Result = await this._fetch(
1698
+ this.svAPIEndpoint,
1699
+ this.supplier._path,
1700
+ params
1701
+ );
1702
+ return res;
1703
+ },
1704
+ get: async (
1705
+ id: Service.Supplier.Get.ID,
1706
+ params?: Service.Supplier.Get.Params
1707
+ ): Promise<Service.Supplier.Get.Result> => {
1708
+ return await this._fetch(
1709
+ this.svAPIEndpoint,
1710
+ this.supplier._path + `/${id}`,
1711
+ params
1712
+ );
1713
+ },
1714
+ create: async (
1715
+ body: Service.Supplier.Create.Body
1716
+ ): Promise<Service.Supplier.Create.Result> => {
1717
+ let res = await this._create(
1718
+ this.svAPIEndpoint,
1719
+ this.supplier._path,
1720
+ body
1721
+ );
1722
+ return res;
1723
+ },
1724
+
1725
+ update: async (
1726
+ id: Service.Supplier.Update.ID,
1727
+ body: Service.Supplier.Update.Body
1728
+ ): Promise<Service.Supplier.Update.Result> => {
1729
+ let res: Service.Supplier.Update.Result = await this._update(
1730
+ this.svAPIEndpoint,
1731
+ this.supplier._path + `/${id}`,
1732
+ body
1733
+ );
1734
+ return res;
1735
+ },
1736
+ };
1692
1737
 
1693
1738
  quickConvertToPdf = {
1694
1739
  _path: "/quick-convert-to-pdf",
@@ -6768,6 +6768,69 @@ export namespace Service {
6768
6768
  export type Result = ReceivingMaterialSchema;
6769
6769
  }
6770
6770
  }
6771
+ export namespace Supplier {
6772
+ export interface SupplierSchema {
6773
+ _id: string;
6774
+ name: string;
6775
+ local_name?: string;
6776
+ phone?: string;
6777
+ address?: string;
6778
+ tax_number?: string;
6779
+ type: "individual" | "company";
6780
+ disabled: boolean;
6781
+ company_namespace: string[];
6782
+ createdAt: string;
6783
+ updatedAt: string;
6784
+ }
6785
+ export interface CreateBody {
6786
+ name: string;
6787
+ local_name?: string;
6788
+ phone?: string;
6789
+ address?: string;
6790
+ tax_number?: string;
6791
+ type: "individual" | "company";
6792
+ disabled: boolean;
6793
+ company_namespace: string[];
6794
+ }
6795
+ export interface UpdateBody {
6796
+ _id?: string;
6797
+ name?: string;
6798
+ local_name?: string;
6799
+ phone?: string;
6800
+ address?: string;
6801
+ tax_number?: string;
6802
+ type?: "individual" | "company";
6803
+ disabled?: boolean;
6804
+ company_namespace?: string[];
6805
+ }
6806
+ export namespace Find {
6807
+ export type Params = DefaultPaginationQueryParams & {
6808
+ _id?: string[] | string;
6809
+ name?: string;
6810
+ local_name?: string;
6811
+ type?: string;
6812
+ from_updatedAt?: number;
6813
+ [key: string]: any; // integration_meta.
6814
+ };
6815
+ export interface Result extends DefaultPaginationResult {
6816
+ data: SupplierSchema[];
6817
+ }
6818
+ }
6819
+ export namespace Get {
6820
+ export type ID = string;
6821
+ export interface Params {}
6822
+ export type Result = SupplierSchema;
6823
+ }
6824
+ export namespace Create {
6825
+ export type Body = CreateBody;
6826
+ export type Result = SupplierSchema;
6827
+ }
6828
+ export namespace Update {
6829
+ export type ID = string;
6830
+ export type Body = UpdateBody;
6831
+ export type Result = SupplierSchema;
6832
+ }
6833
+ }
6771
6834
  export namespace Cycle {
6772
6835
  type CycleStatus = "pending" | "approved" | "processing" | "rejected";
6773
6836
  export interface Schema {