@authenty/authapi-types 1.0.27 → 1.0.29
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 +3 -3
- package/dist/index.js +3 -3
- package/package.json +1 -1
- package/src/index.ts +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -404,7 +404,7 @@ export declare namespace AuthApi {
|
|
|
404
404
|
};
|
|
405
405
|
}
|
|
406
406
|
namespace logout {
|
|
407
|
-
type
|
|
407
|
+
type POST = {};
|
|
408
408
|
}
|
|
409
409
|
}
|
|
410
410
|
namespace users {
|
|
@@ -753,7 +753,7 @@ export declare namespace AuthApi {
|
|
|
753
753
|
/**
|
|
754
754
|
* Faz logout da API
|
|
755
755
|
*/
|
|
756
|
-
logout: () => Promise<responses.ApiResponse<responses.auth.logout.
|
|
756
|
+
logout: () => Promise<responses.ApiResponse<responses.auth.logout.POST>>;
|
|
757
757
|
/**
|
|
758
758
|
* Verifica a sessão atual
|
|
759
759
|
*/
|
|
@@ -761,7 +761,7 @@ export declare namespace AuthApi {
|
|
|
761
761
|
};
|
|
762
762
|
checkHealth(): Promise<boolean>;
|
|
763
763
|
users: {
|
|
764
|
-
list: () => Promise<responses.ApiResponse<responses.users.GET>>;
|
|
764
|
+
list: (search?: string, page?: number, itemsPerPage?: number, includeDeleted?: boolean) => Promise<responses.ApiResponse<responses.users.GET>>;
|
|
765
765
|
get: (userId: number, includePurchases?: boolean) => Promise<responses.ApiResponse<responses.user.$userId.GET>>;
|
|
766
766
|
update: (userId: number, userData: Partial<objects.LocalUser>) => Promise<responses.ApiResponse<objects.LocalUser>>;
|
|
767
767
|
updateConfig: (obj: {
|
package/dist/index.js
CHANGED
|
@@ -116,7 +116,7 @@ var AuthApi;
|
|
|
116
116
|
* Faz logout da API
|
|
117
117
|
*/
|
|
118
118
|
logout: async () => {
|
|
119
|
-
const result = await this.request('
|
|
119
|
+
const result = await this.request('POST', 'auth/logout', {});
|
|
120
120
|
this.setToken('');
|
|
121
121
|
this.setPin1('');
|
|
122
122
|
return result;
|
|
@@ -138,8 +138,8 @@ var AuthApi;
|
|
|
138
138
|
}
|
|
139
139
|
};
|
|
140
140
|
this.users = {
|
|
141
|
-
list: async () => {
|
|
142
|
-
return await this.request('GET', 'users', {});
|
|
141
|
+
list: async (search = '', page = 1, itemsPerPage = 50, includeDeleted = false) => {
|
|
142
|
+
return await this.request('GET', 'users', { search, page, itemsPerPage, includeDeleted });
|
|
143
143
|
},
|
|
144
144
|
get: async (userId, includePurchases = true) => {
|
|
145
145
|
return await this.request('GET', `user/${userId}?includePurchases=${includePurchases}`, {});
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -450,7 +450,7 @@ export namespace AuthApi {
|
|
|
450
450
|
export type POST = { user: objects.LocalUser; msg?: string };
|
|
451
451
|
}
|
|
452
452
|
export namespace logout {
|
|
453
|
-
export type
|
|
453
|
+
export type POST = {};
|
|
454
454
|
}
|
|
455
455
|
}
|
|
456
456
|
|
|
@@ -943,7 +943,7 @@ export namespace AuthApi {
|
|
|
943
943
|
* Faz logout da API
|
|
944
944
|
*/
|
|
945
945
|
logout: async () => {
|
|
946
|
-
const result = await this.request<responses.auth.logout.
|
|
946
|
+
const result = await this.request<responses.auth.logout.POST>('POST', 'auth/logout', {});
|
|
947
947
|
this.setToken('');
|
|
948
948
|
this.setPin1('');
|
|
949
949
|
return result;
|
|
@@ -982,8 +982,8 @@ export namespace AuthApi {
|
|
|
982
982
|
}
|
|
983
983
|
|
|
984
984
|
public users = {
|
|
985
|
-
list: async () => {
|
|
986
|
-
return await this.request<responses.users.GET>('GET', 'users', {});
|
|
985
|
+
list: async (search:string='', page:number=1, itemsPerPage:number=50, includeDeleted:boolean=false) => {
|
|
986
|
+
return await this.request<responses.users.GET>('GET', 'users', {search,page,itemsPerPage,includeDeleted});
|
|
987
987
|
},
|
|
988
988
|
get: async (userId: number, includePurchases: boolean = true) => {
|
|
989
989
|
return await this.request<responses.user.$userId.GET>('GET', `user/${userId}?includePurchases=${includePurchases}`, {});
|