2019-10-09 06:01:52 +00:00
|
|
|
import { stringify as stringifyQs } from "qs";
|
|
|
|
import urlJoin from "url-join";
|
|
|
|
|
|
|
|
import { Pagination, SingleAction } from "../types";
|
|
|
|
|
|
|
|
export const webhooksSection = "/webhooks/";
|
|
|
|
|
|
|
|
export const webhooksListPath = webhooksSection;
|
|
|
|
export type WebhooksListUrlQueryParams = Pagination & SingleAction;
|
|
|
|
export const webhooksListUrl = (params?: WebhooksListUrlQueryParams) =>
|
2019-10-09 07:31:00 +00:00
|
|
|
webhooksListPath + "?" + stringifyQs(params);
|
2019-10-09 06:01:52 +00:00
|
|
|
|
|
|
|
export const webhooksPath = (id: string) => urlJoin(webhooksSection, id);
|
|
|
|
export type WebhooksUrlQueryParams = SingleAction;
|
|
|
|
export const webhooksUrl = (id: string, params?: WebhooksUrlQueryParams) =>
|
|
|
|
webhooksPath(encodeURIComponent(id)) + "?" + stringifyQs(params);
|