@riocrypto/common 1.0.1516 → 1.0.1518
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/build/clients/rio-admin-client.d.ts +17 -0
- package/build/clients/rio-admin-client.js +30 -0
- package/build/clients/rio-client.d.ts +17 -0
- package/build/clients/rio-client.js +30 -0
- package/build/helpers/humanize-onboarding-status.d.ts +1 -1
- package/build/helpers/humanize-onboarding-status.js +7 -2
- package/build/types/chained-order.d.ts +1 -0
- package/package.json +1 -1
|
@@ -56,6 +56,8 @@ import { AlertTriggerCondition } from "../types/alert-trigger-condition";
|
|
|
56
56
|
import { Side } from "../types/side";
|
|
57
57
|
import { Alert } from "../types/alert";
|
|
58
58
|
import { AlertType } from "../types/alert-type";
|
|
59
|
+
import { WebhookType } from "../types/webhook-type";
|
|
60
|
+
import { WebhookRegistration } from "../types/webhook-registration";
|
|
59
61
|
export declare class RioAdminClient {
|
|
60
62
|
private axios;
|
|
61
63
|
constructor(axios: AxiosStatic | AxiosInstance);
|
|
@@ -315,4 +317,19 @@ export declare class RioAdminClient {
|
|
|
315
317
|
updateAuth(update: AuthUpdate, id: string): Promise<Auth>;
|
|
316
318
|
deleteAuth(id: string): Promise<void>;
|
|
317
319
|
getInvoice(orderId: string): Promise<Invoice>;
|
|
320
|
+
createWebhookRegistration({ userId, brokerId, type, url, }: {
|
|
321
|
+
userId: string;
|
|
322
|
+
brokerId: string;
|
|
323
|
+
type: WebhookType;
|
|
324
|
+
url: string;
|
|
325
|
+
}): Promise<{
|
|
326
|
+
id: string;
|
|
327
|
+
secret: string;
|
|
328
|
+
}>;
|
|
329
|
+
getWebhookRegistrations(page: number, query?: {
|
|
330
|
+
userId?: string;
|
|
331
|
+
brokerId?: string;
|
|
332
|
+
}): Promise<WebhookRegistration[]>;
|
|
333
|
+
getWebhookRegistration(id: string): Promise<WebhookRegistration>;
|
|
334
|
+
deleteWebhookRegistration(id: string): Promise<void>;
|
|
318
335
|
}
|
|
@@ -1034,5 +1034,35 @@ class RioAdminClient {
|
|
|
1034
1034
|
return response.data;
|
|
1035
1035
|
});
|
|
1036
1036
|
}
|
|
1037
|
+
createWebhookRegistration({ userId, brokerId, type, url, }) {
|
|
1038
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1039
|
+
const { data } = yield this.axios.post("/api/webhooks", {
|
|
1040
|
+
userId,
|
|
1041
|
+
brokerId,
|
|
1042
|
+
type,
|
|
1043
|
+
url,
|
|
1044
|
+
});
|
|
1045
|
+
return data;
|
|
1046
|
+
});
|
|
1047
|
+
}
|
|
1048
|
+
getWebhookRegistrations(page, query) {
|
|
1049
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1050
|
+
const { data } = yield this.axios.get("/api/webhooks", {
|
|
1051
|
+
params: Object.assign({ page }, query),
|
|
1052
|
+
});
|
|
1053
|
+
return data;
|
|
1054
|
+
});
|
|
1055
|
+
}
|
|
1056
|
+
getWebhookRegistration(id) {
|
|
1057
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1058
|
+
const { data } = yield this.axios.get(`/api/webhooks/${id}`);
|
|
1059
|
+
return data;
|
|
1060
|
+
});
|
|
1061
|
+
}
|
|
1062
|
+
deleteWebhookRegistration(id) {
|
|
1063
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1064
|
+
yield this.axios.delete(`/api/webhooks/${id}`);
|
|
1065
|
+
});
|
|
1066
|
+
}
|
|
1037
1067
|
}
|
|
1038
1068
|
exports.RioAdminClient = RioAdminClient;
|
|
@@ -46,6 +46,8 @@ import { Alert } from "../types/alert";
|
|
|
46
46
|
import { AlertTriggerCondition } from "../types/alert-trigger-condition";
|
|
47
47
|
import { Side } from "../types/side";
|
|
48
48
|
import { AlertType } from "../types/alert-type";
|
|
49
|
+
import { WebhookRegistration } from "../types/webhook-registration";
|
|
50
|
+
import { WebhookType } from "../types/webhook-type";
|
|
49
51
|
export declare class RioClient {
|
|
50
52
|
private axios;
|
|
51
53
|
constructor(axios: AxiosStatic | AxiosInstance);
|
|
@@ -257,4 +259,19 @@ export declare class RioClient {
|
|
|
257
259
|
tosLink: string;
|
|
258
260
|
}>;
|
|
259
261
|
getOnboarding(id: string): Promise<Onboarding>;
|
|
262
|
+
createWebhookRegistration({ userId, brokerId, type, url, }: {
|
|
263
|
+
userId: string;
|
|
264
|
+
brokerId: string;
|
|
265
|
+
type: WebhookType;
|
|
266
|
+
url: string;
|
|
267
|
+
}): Promise<{
|
|
268
|
+
id: string;
|
|
269
|
+
secret: string;
|
|
270
|
+
}>;
|
|
271
|
+
getWebhookRegistrations(page: number, query?: {
|
|
272
|
+
userId?: string;
|
|
273
|
+
brokerId?: string;
|
|
274
|
+
}): Promise<WebhookRegistration[]>;
|
|
275
|
+
getWebhookRegistration(id: string): Promise<WebhookRegistration>;
|
|
276
|
+
deleteWebhookRegistration(id: string): Promise<void>;
|
|
260
277
|
}
|
|
@@ -810,5 +810,35 @@ class RioClient {
|
|
|
810
810
|
return data;
|
|
811
811
|
});
|
|
812
812
|
}
|
|
813
|
+
createWebhookRegistration({ userId, brokerId, type, url, }) {
|
|
814
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
815
|
+
const { data } = yield this.axios.post("/api/webhooks", {
|
|
816
|
+
userId,
|
|
817
|
+
brokerId,
|
|
818
|
+
type,
|
|
819
|
+
url,
|
|
820
|
+
});
|
|
821
|
+
return data;
|
|
822
|
+
});
|
|
823
|
+
}
|
|
824
|
+
getWebhookRegistrations(page, query) {
|
|
825
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
826
|
+
const { data } = yield this.axios.get("/api/webhooks", {
|
|
827
|
+
params: Object.assign({ page }, query),
|
|
828
|
+
});
|
|
829
|
+
return data;
|
|
830
|
+
});
|
|
831
|
+
}
|
|
832
|
+
getWebhookRegistration(id) {
|
|
833
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
834
|
+
const { data } = yield this.axios.get(`/api/webhooks/${id}`);
|
|
835
|
+
return data;
|
|
836
|
+
});
|
|
837
|
+
}
|
|
838
|
+
deleteWebhookRegistration(id) {
|
|
839
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
840
|
+
yield this.axios.delete(`/api/webhooks/${id}`);
|
|
841
|
+
});
|
|
842
|
+
}
|
|
813
843
|
}
|
|
814
844
|
exports.RioClient = RioClient;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { OnboardingStatus } from "../types/onboarding-status";
|
|
2
|
-
export declare const humanizeOnboardingStatus: (status: OnboardingStatus) => string;
|
|
2
|
+
export declare const humanizeOnboardingStatus: (status: OnboardingStatus, isAdmin?: boolean) => string;
|
|
@@ -2,12 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.humanizeOnboardingStatus = void 0;
|
|
4
4
|
const onboarding_status_1 = require("../types/onboarding-status");
|
|
5
|
-
const humanizeOnboardingStatus = (status) => {
|
|
5
|
+
const humanizeOnboardingStatus = (status, isAdmin) => {
|
|
6
6
|
switch (status) {
|
|
7
7
|
case onboarding_status_1.OnboardingStatus.Failed:
|
|
8
8
|
return "Failed";
|
|
9
9
|
case onboarding_status_1.OnboardingStatus.Review:
|
|
10
|
-
|
|
10
|
+
if (isAdmin) {
|
|
11
|
+
return "Review";
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
return "In review";
|
|
15
|
+
}
|
|
11
16
|
case onboarding_status_1.OnboardingStatus.Approved:
|
|
12
17
|
return "Approved";
|
|
13
18
|
case onboarding_status_1.OnboardingStatus.LegalRepresentativePassed:
|