@authenty/authapi-types 1.0.44 → 1.0.46

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
@@ -944,6 +944,17 @@ export declare namespace AuthApi {
944
944
  status: () => Promise<responses.ApiResponse<responses.cronJobs.GET>>;
945
945
  run: (id: number) => Promise<responses.ApiResponse<responses.cronJobs.$conId.run.POST>>;
946
946
  };
947
+ purchases: {
948
+ search: (filters?: {
949
+ userId?: number;
950
+ date_gte?: string;
951
+ date_lte?: string;
952
+ page?: number;
953
+ pageSize?: number;
954
+ paymentStatus?: objects.PaymentSystem.PG_PurchasePaymentStatus;
955
+ licenseStatus?: objects.PaymentSystem.PG_PurchaseLicenseStatus;
956
+ }) => Promise<responses.ApiResponse<responses.admin.purchases.search.POST>>;
957
+ };
947
958
  reports: {
948
959
  users: () => Promise<responses.ApiResponse<responses.report.users.GET>>;
949
960
  usersMonthlyUsage: (iniDate?: string, endDate?: string, userId?: number) => Promise<responses.ApiResponse<responses.report.users.usage.monthly.GET>>;
package/dist/index.js CHANGED
@@ -265,6 +265,11 @@ var AuthApi;
265
265
  return await this.request('POST', `admin/cronjobs/${id}/run`, {});
266
266
  }
267
267
  },
268
+ purchases: {
269
+ search: async (filters = {}) => {
270
+ return await this.request('POST', 'admin/purchases/search', filters);
271
+ }
272
+ },
268
273
  reports: {
269
274
  users: async () => {
270
275
  return await this.request('GET', 'report/users', {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authenty/authapi-types",
3
- "version": "1.0.44",
3
+ "version": "1.0.46",
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
@@ -861,6 +861,7 @@ export namespace AuthApi {
861
861
  * Client para comunicação com a API de autenticação
862
862
  */
863
863
  export class Client {
864
+
864
865
  private baseURL: string;
865
866
  private bearer: string = '';
866
867
  private pin1: string = '';
@@ -1091,15 +1092,6 @@ export namespace AuthApi {
1091
1092
  * Verifica a sessão atual
1092
1093
  */
1093
1094
  checkSession: async () => {
1094
- if (!this.bearer) {
1095
- return {
1096
- conex: true,
1097
- reqStat: 401,
1098
- success: false,
1099
- data: {},
1100
- msg: 'Token not found'
1101
- };
1102
- }
1103
1095
  return this.request<responses.auth.GET>('GET', 'auth', {}, { retryAttempts: 2, retryDelay: 1000 });
1104
1096
  }
1105
1097
  }
@@ -1173,7 +1165,7 @@ export namespace AuthApi {
1173
1165
  list: async (page: number = 1, pageSize: number = 10) => {
1174
1166
  return await this.request<responses.admin.purchases.search.POST>('GET', `admin/purchases/search`, { page, pageSize });
1175
1167
  },
1176
- getFromGateway: async (purchaseId: number, userId: number, async: boolean = false) => {
1168
+ getFromGateway: async (purchaseId: number, userId: number) => {
1177
1169
  return await this.request<responses.user.$userId.purchase.$purchaseId.getFromGateway.GET>('GET', `user/${userId}/purchase/${purchaseId}/getFromGateway`, {});
1178
1170
  },
1179
1171
  }
@@ -1262,6 +1254,20 @@ export namespace AuthApi {
1262
1254
  }
1263
1255
  },
1264
1256
 
1257
+ purchases: {
1258
+ search: async (filters: {
1259
+ userId?: number,
1260
+ date_gte?: string,
1261
+ date_lte?: string,
1262
+ page?: number,
1263
+ pageSize?: number,
1264
+ paymentStatus?: objects.PaymentSystem.PG_PurchasePaymentStatus,
1265
+ licenseStatus?: objects.PaymentSystem.PG_PurchaseLicenseStatus
1266
+ } = {}) => {
1267
+ return await this.request<responses.admin.purchases.search.POST>('POST', 'admin/purchases/search', filters);
1268
+ }
1269
+ },
1270
+
1265
1271
  reports: {
1266
1272
  users: async () => {
1267
1273
  return await this.request<responses.report.users.GET>('GET', 'report/users', {});