mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
d8a063284a
Summary: Adds a new endpoint to update webhook. Perform some refactoring to allow code reuse from endpoint allowing to _subscribe and _unsubscribe webhooks. One aspect of webhook is that url are stored in the home db while the rest of the fields (tableRef, isReadyColRef, ...) are stored in sqlite. So care must be taken when updating fields, to properly rollback if anything should fail. Follow up diff will bring UI to edit webhook list Test Plan: Updated doc api server tests Reviewers: jarek Reviewed By: jarek Subscribers: paulfitz Differential Revision: https://phab.getgrist.com/D3821
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
/**
|
|
* 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")),
|
|
});
|
|
|
|
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")),
|
|
});
|
|
|
|
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")),
|
|
});
|
|
|
|
const exportedTypeSuite: t.ITypeSuite = {
|
|
WebhookFields,
|
|
WebhookSubscribe,
|
|
WebhookUpdate,
|
|
WebhookPatch,
|
|
};
|
|
export default exportedTypeSuite;
|