@riocrypto/common 1.0.1523 → 1.0.1524

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.
@@ -58,6 +58,8 @@ import { Alert } from "../types/alert";
58
58
  import { AlertType } from "../types/alert-type";
59
59
  import { WebhookType } from "../types/webhook-type";
60
60
  import { WebhookRegistration } from "../types/webhook-registration";
61
+ import { AdminActionType } from "../types/admin-action-type";
62
+ import { AdminAction } from "../types/admin-action";
61
63
  export declare class RioAdminClient {
62
64
  private axios;
63
65
  constructor(axios: AxiosStatic | AxiosInstance);
@@ -332,4 +334,10 @@ export declare class RioAdminClient {
332
334
  }): Promise<WebhookRegistration[]>;
333
335
  getWebhookRegistration(id: string): Promise<WebhookRegistration>;
334
336
  deleteWebhookRegistration(id: string): Promise<void>;
337
+ createAdminAction({ type, }: {
338
+ type: AdminActionType;
339
+ }): Promise<AdminAction>;
340
+ getAdminActions(page: number): Promise<AdminAction[]>;
341
+ getAdminAction(id: string): Promise<AdminAction>;
342
+ cancelAdminAction(id: string): Promise<void>;
335
343
  }
@@ -1063,5 +1063,34 @@ class RioAdminClient {
1063
1063
  yield this.axios.delete(`/api/webhooks/${id}`);
1064
1064
  });
1065
1065
  }
1066
+ createAdminAction({ type, }) {
1067
+ return __awaiter(this, void 0, void 0, function* () {
1068
+ const { data } = yield this.axios.post(`/api/admin/actions/${type}`, {
1069
+ type,
1070
+ });
1071
+ return data;
1072
+ });
1073
+ }
1074
+ getAdminActions(page) {
1075
+ return __awaiter(this, void 0, void 0, function* () {
1076
+ const { data } = yield this.axios.get("/api/admin/actions", {
1077
+ params: {
1078
+ page,
1079
+ },
1080
+ });
1081
+ return data;
1082
+ });
1083
+ }
1084
+ getAdminAction(id) {
1085
+ return __awaiter(this, void 0, void 0, function* () {
1086
+ const { data } = yield this.axios.get(`/api/admin/actions/${id}`);
1087
+ return data;
1088
+ });
1089
+ }
1090
+ cancelAdminAction(id) {
1091
+ return __awaiter(this, void 0, void 0, function* () {
1092
+ yield this.axios.put(`/api/admin/actions/${id}/cancel`);
1093
+ });
1094
+ }
1066
1095
  }
1067
1096
  exports.RioAdminClient = RioAdminClient;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common",
3
- "version": "1.0.1523",
3
+ "version": "1.0.1524",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",