@authenty/authapi-types 1.0.21 → 1.0.23

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.ts CHANGED
@@ -663,6 +663,16 @@ export declare namespace AuthApi {
663
663
  msg?: string;
664
664
  };
665
665
  }
666
+ namespace admin {
667
+ namespace purchases {
668
+ namespace search {
669
+ type POST = {
670
+ purchases: objects.Purchase[];
671
+ pagination: auxiliarTypes.PaginationInfo;
672
+ };
673
+ }
674
+ }
675
+ }
666
676
  }
667
677
  /**
668
678
  * Configuração do Client
@@ -759,7 +769,8 @@ export declare namespace AuthApi {
759
769
  update: (userId: number, purchase: objects.Purchase) => Promise<responses.ApiResponse<objects.Purchase>>;
760
770
  cancel: (purchaseId: number, userId: number) => Promise<responses.ApiResponse<responses.user.$userId.purchase.$purchaseId.cancel.POST>>;
761
771
  delete: (purchaseId: number, userId: number) => Promise<responses.ApiResponse<responses.user.$userId.purchase.$purchaseId.DELETE>>;
762
- list: (userId: number) => Promise<responses.ApiResponse<responses.user.$userId.purchases.GET>>;
772
+ listForUser: (userId: number) => Promise<responses.ApiResponse<responses.user.$userId.purchases.GET>>;
773
+ list: (page?: number, pageSize?: number) => Promise<responses.ApiResponse<responses.admin.purchases.search.POST>>;
763
774
  getFromGateway: (purchaseId: number, userId: number, async?: boolean) => Promise<responses.ApiResponse<objects.PaymentSystem.PG_Purchase>>;
764
775
  };
765
776
  products: {
package/dist/index.js CHANGED
@@ -184,9 +184,12 @@ var AuthApi;
184
184
  delete: async (purchaseId, userId) => {
185
185
  return await this.request('DELETE', `user/${userId}/purchase/${purchaseId}`, {});
186
186
  },
187
- list: async (userId) => {
187
+ listForUser: async (userId) => {
188
188
  return await this.request('GET', `user/${userId}/purchases`, {});
189
189
  },
190
+ list: async (page = 1, pageSize = 10) => {
191
+ return await this.request('GET', `admin/purchases/search`, { page, pageSize });
192
+ },
190
193
  getFromGateway: async (purchaseId, userId, async = false) => {
191
194
  return await this.request('GET', `user/${userId}/purchase/${purchaseId}/getFromGateway`, {});
192
195
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authenty/authapi-types",
3
- "version": "1.0.21",
3
+ "version": "1.0.23",
4
4
  "description": "Shared types for Authenty API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/index.ts CHANGED
@@ -679,6 +679,14 @@ export namespace AuthApi {
679
679
  export namespace report {
680
680
  export type POST = { msg?: string };
681
681
  }
682
+
683
+ export namespace admin {
684
+ export namespace purchases {
685
+ export namespace search {
686
+ export type POST = {purchases: objects.Purchase[], pagination: auxiliarTypes.PaginationInfo}
687
+ }
688
+ }
689
+ }
682
690
  }
683
691
 
684
692
  /**
@@ -1008,9 +1016,12 @@ export namespace AuthApi {
1008
1016
  delete: async (purchaseId: number, userId: number) => {
1009
1017
  return await this.request<responses.user.$userId.purchase.$purchaseId.DELETE>('DELETE', `user/${userId}/purchase/${purchaseId}`, { });
1010
1018
  },
1011
- list: async (userId: number) => {
1019
+ listForUser: async (userId: number) => {
1012
1020
  return await this.request<responses.user.$userId.purchases.GET>('GET', `user/${userId}/purchases`, { });
1013
1021
  },
1022
+ list: async (page: number=1, pageSize: number=10) => {
1023
+ return await this.request<responses.admin.purchases.search.POST>('GET', `admin/purchases/search`, { page, pageSize});
1024
+ },
1014
1025
  getFromGateway: async (purchaseId: number, userId: number, async: boolean = false) => {
1015
1026
  return await this.request<responses.user.$userId.purchase.$purchaseId.getFromGateway.GET>('GET', `user/${userId}/purchase/${purchaseId}/getFromGateway`, {});
1016
1027
  },