2023-03-01 20:43:22 +00:00
|
|
|
/**
|
|
|
|
* This module was automatically generated by `ts-interface-builder`
|
|
|
|
*/
|
|
|
|
import * as t from "ts-interface-checker";
|
|
|
|
// tslint:disable:object-literal-key-quotes
|
|
|
|
|
|
|
|
export const WebhookFields = t.iface([], {
|
|
|
|
"url": "string",
|
|
|
|
"eventTypes": t.array(t.union(t.lit("add"), t.lit("update"))),
|
|
|
|
"tableId": "string",
|
|
|
|
"enabled": t.opt("boolean"),
|
|
|
|
"isReadyColumn": t.opt(t.union("string", "null")),
|
2023-05-08 22:06:24 +00:00
|
|
|
"name": t.opt("string"),
|
|
|
|
"memo": t.opt("string"),
|
2023-03-01 20:43:22 +00:00
|
|
|
});
|
|
|
|
|
2023-05-08 22:06:24 +00:00
|
|
|
export const WebhookBatchStatus = t.union(t.lit('success'), t.lit('failure'), t.lit('rejected'));
|
|
|
|
|
|
|
|
export const WebhookStatus = t.union(t.lit('idle'), t.lit('sending'), t.lit('retrying'), t.lit('postponed'), t.lit('error'), t.lit('invalid'));
|
|
|
|
|
2023-03-01 20:43:22 +00:00
|
|
|
export const WebhookSubscribe = t.iface([], {
|
|
|
|
"url": "string",
|
|
|
|
"eventTypes": t.array(t.union(t.lit("add"), t.lit("update"))),
|
|
|
|
"enabled": t.opt("boolean"),
|
|
|
|
"isReadyColumn": t.opt(t.union("string", "null")),
|
2023-05-08 22:06:24 +00:00
|
|
|
"name": t.opt("string"),
|
|
|
|
"memo": t.opt("string"),
|
|
|
|
});
|
|
|
|
|
|
|
|
export const WebhookSummary = t.iface([], {
|
|
|
|
"id": "string",
|
|
|
|
"fields": t.iface([], {
|
|
|
|
"url": "string",
|
|
|
|
"unsubscribeKey": "string",
|
|
|
|
"eventTypes": t.array("string"),
|
|
|
|
"isReadyColumn": t.union("string", "null"),
|
|
|
|
"tableId": "string",
|
|
|
|
"enabled": "boolean",
|
|
|
|
"name": "string",
|
|
|
|
"memo": "string",
|
|
|
|
}),
|
|
|
|
"usage": t.union("WebhookUsage", "null"),
|
2023-03-01 20:43:22 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
export const WebhookUpdate = t.iface([], {
|
|
|
|
"id": "string",
|
|
|
|
"fields": "WebhookPatch",
|
|
|
|
});
|
|
|
|
|
|
|
|
export const WebhookPatch = t.iface([], {
|
|
|
|
"url": t.opt("string"),
|
|
|
|
"eventTypes": t.opt(t.array(t.union(t.lit("add"), t.lit("update")))),
|
|
|
|
"tableId": t.opt("string"),
|
|
|
|
"enabled": t.opt("boolean"),
|
|
|
|
"isReadyColumn": t.opt(t.union("string", "null")),
|
2023-05-08 22:06:24 +00:00
|
|
|
"name": t.opt("string"),
|
|
|
|
"memo": t.opt("string"),
|
|
|
|
});
|
|
|
|
|
|
|
|
export const WebhookUsage = t.iface([], {
|
|
|
|
"numWaiting": "number",
|
|
|
|
"status": "WebhookStatus",
|
|
|
|
"updatedTime": t.opt(t.union("number", "null")),
|
|
|
|
"lastSuccessTime": t.opt(t.union("number", "null")),
|
|
|
|
"lastFailureTime": t.opt(t.union("number", "null")),
|
|
|
|
"lastErrorMessage": t.opt(t.union("string", "null")),
|
|
|
|
"lastHttpStatus": t.opt(t.union("number", "null")),
|
|
|
|
"lastEventBatch": t.opt(t.union("null", t.iface([], {
|
|
|
|
"size": "number",
|
|
|
|
"errorMessage": t.union("string", "null"),
|
|
|
|
"httpStatus": t.union("number", "null"),
|
|
|
|
"status": "WebhookBatchStatus",
|
|
|
|
"attempts": "number",
|
|
|
|
}))),
|
|
|
|
"numSuccess": t.opt(t.iface([], {
|
|
|
|
"pastHour": "number",
|
|
|
|
"past24Hours": "number",
|
|
|
|
})),
|
2023-03-01 20:43:22 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
const exportedTypeSuite: t.ITypeSuite = {
|
|
|
|
WebhookFields,
|
2023-05-08 22:06:24 +00:00
|
|
|
WebhookBatchStatus,
|
|
|
|
WebhookStatus,
|
2023-03-01 20:43:22 +00:00
|
|
|
WebhookSubscribe,
|
2023-05-08 22:06:24 +00:00
|
|
|
WebhookSummary,
|
2023-03-01 20:43:22 +00:00
|
|
|
WebhookUpdate,
|
|
|
|
WebhookPatch,
|
2023-05-08 22:06:24 +00:00
|
|
|
WebhookUsage,
|
2023-03-01 20:43:22 +00:00
|
|
|
};
|
|
|
|
export default exportedTypeSuite;
|