@authenty/authapi-types 1.0.22 → 1.0.24
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 +4 -2
- package/dist/index.js +4 -1
- package/package.json +1 -1
- package/src/index.ts +6 -3
package/dist/index.d.ts
CHANGED
|
@@ -468,7 +468,7 @@ export declare namespace AuthApi {
|
|
|
468
468
|
namespace sync {
|
|
469
469
|
type POST = {
|
|
470
470
|
msg: string;
|
|
471
|
-
|
|
471
|
+
Purchase: objects.Purchase;
|
|
472
472
|
};
|
|
473
473
|
}
|
|
474
474
|
namespace getFromGateway {
|
|
@@ -477,6 +477,7 @@ export declare namespace AuthApi {
|
|
|
477
477
|
namespace cancel {
|
|
478
478
|
type POST = {
|
|
479
479
|
msg?: string;
|
|
480
|
+
Purchase: objects.Purchase;
|
|
480
481
|
};
|
|
481
482
|
}
|
|
482
483
|
}
|
|
@@ -769,7 +770,8 @@ export declare namespace AuthApi {
|
|
|
769
770
|
update: (userId: number, purchase: objects.Purchase) => Promise<responses.ApiResponse<objects.Purchase>>;
|
|
770
771
|
cancel: (purchaseId: number, userId: number) => Promise<responses.ApiResponse<responses.user.$userId.purchase.$purchaseId.cancel.POST>>;
|
|
771
772
|
delete: (purchaseId: number, userId: number) => Promise<responses.ApiResponse<responses.user.$userId.purchase.$purchaseId.DELETE>>;
|
|
772
|
-
|
|
773
|
+
listForUser: (userId: number) => Promise<responses.ApiResponse<responses.user.$userId.purchases.GET>>;
|
|
774
|
+
list: (page?: number, pageSize?: number) => Promise<responses.ApiResponse<responses.admin.purchases.search.POST>>;
|
|
773
775
|
getFromGateway: (purchaseId: number, userId: number, async?: boolean) => Promise<responses.ApiResponse<objects.PaymentSystem.PG_Purchase>>;
|
|
774
776
|
};
|
|
775
777
|
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
|
-
|
|
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
package/src/index.ts
CHANGED
|
@@ -509,14 +509,14 @@ export namespace AuthApi {
|
|
|
509
509
|
export namespace sync {
|
|
510
510
|
export type POST = {
|
|
511
511
|
msg:string,
|
|
512
|
-
|
|
512
|
+
Purchase: objects.Purchase
|
|
513
513
|
};
|
|
514
514
|
}
|
|
515
515
|
export namespace getFromGateway {
|
|
516
516
|
export type GET = objects.PaymentSystem.PG_Purchase;
|
|
517
517
|
}
|
|
518
518
|
export namespace cancel {
|
|
519
|
-
export type POST = {msg?:string};
|
|
519
|
+
export type POST = {msg?:string, Purchase: objects.Purchase};
|
|
520
520
|
}
|
|
521
521
|
|
|
522
522
|
}
|
|
@@ -1016,9 +1016,12 @@ export namespace AuthApi {
|
|
|
1016
1016
|
delete: async (purchaseId: number, userId: number) => {
|
|
1017
1017
|
return await this.request<responses.user.$userId.purchase.$purchaseId.DELETE>('DELETE', `user/${userId}/purchase/${purchaseId}`, { });
|
|
1018
1018
|
},
|
|
1019
|
-
|
|
1019
|
+
listForUser: async (userId: number) => {
|
|
1020
1020
|
return await this.request<responses.user.$userId.purchases.GET>('GET', `user/${userId}/purchases`, { });
|
|
1021
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
|
+
},
|
|
1022
1025
|
getFromGateway: async (purchaseId: number, userId: number, async: boolean = false) => {
|
|
1023
1026
|
return await this.request<responses.user.$userId.purchase.$purchaseId.getFromGateway.GET>('GET', `user/${userId}/purchase/${purchaseId}/getFromGateway`, {});
|
|
1024
1027
|
},
|