@voyant-travel/notifications-react 0.111.7
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/LICENSE +201 -0
- package/README.md +30 -0
- package/dist/admin/index.d.ts +70 -0
- package/dist/admin/index.d.ts.map +1 -0
- package/dist/admin/index.js +104 -0
- package/dist/admin/notification-deliveries-host.d.ts +7 -0
- package/dist/admin/notification-deliveries-host.d.ts.map +1 -0
- package/dist/admin/notification-deliveries-host.js +92 -0
- package/dist/admin/notification-delivery-detail-dialog.d.ts +8 -0
- package/dist/admin/notification-delivery-detail-dialog.d.ts.map +1 -0
- package/dist/admin/notification-delivery-detail-dialog.js +30 -0
- package/dist/admin/notification-reminder-rule-detail-host.d.ts +12 -0
- package/dist/admin/notification-reminder-rule-detail-host.d.ts.map +1 -0
- package/dist/admin/notification-reminder-rule-detail-host.js +23 -0
- package/dist/admin/notification-reminder-rule-dialog.d.ts +10 -0
- package/dist/admin/notification-reminder-rule-dialog.d.ts.map +1 -0
- package/dist/admin/notification-reminder-rule-dialog.js +122 -0
- package/dist/admin/notification-reminder-rules-host.d.ts +8 -0
- package/dist/admin/notification-reminder-rules-host.d.ts.map +1 -0
- package/dist/admin/notification-reminder-rules-host.js +57 -0
- package/dist/admin/notification-reminder-runs-host.d.ts +7 -0
- package/dist/admin/notification-reminder-runs-host.d.ts.map +1 -0
- package/dist/admin/notification-reminder-runs-host.js +28 -0
- package/dist/admin/notification-settings-host.d.ts +7 -0
- package/dist/admin/notification-settings-host.d.ts.map +1 -0
- package/dist/admin/notification-settings-host.js +11 -0
- package/dist/admin/notification-template-attachments-field.d.ts +10 -0
- package/dist/admin/notification-template-attachments-field.d.ts.map +1 -0
- package/dist/admin/notification-template-attachments-field.js +6 -0
- package/dist/admin/notification-template-authoring-help.d.ts +25 -0
- package/dist/admin/notification-template-authoring-help.d.ts.map +1 -0
- package/dist/admin/notification-template-authoring-help.js +8 -0
- package/dist/admin/notification-template-detail-host.d.ts +11 -0
- package/dist/admin/notification-template-detail-host.d.ts.map +1 -0
- package/dist/admin/notification-template-detail-host.js +159 -0
- package/dist/admin/notification-template-dialog-utils.d.ts +53 -0
- package/dist/admin/notification-template-dialog-utils.d.ts.map +1 -0
- package/dist/admin/notification-template-dialog-utils.js +112 -0
- package/dist/admin/notification-template-dialog.d.ts +10 -0
- package/dist/admin/notification-template-dialog.d.ts.map +1 -0
- package/dist/admin/notification-template-dialog.js +253 -0
- package/dist/admin/notification-template-rendered-preview.d.ts +14 -0
- package/dist/admin/notification-template-rendered-preview.d.ts.map +1 -0
- package/dist/admin/notification-template-rendered-preview.js +6 -0
- package/dist/admin/notification-templates-host.d.ts +9 -0
- package/dist/admin/notification-templates-host.d.ts.map +1 -0
- package/dist/admin/notification-templates-host.js +52 -0
- package/dist/admin/notifications-admin-shared.d.ts +14 -0
- package/dist/admin/notifications-admin-shared.d.ts.map +1 -0
- package/dist/admin/notifications-admin-shared.js +17 -0
- package/dist/admin/pages/notification-reminder-rule-detail-page.d.ts +8 -0
- package/dist/admin/pages/notification-reminder-rule-detail-page.d.ts.map +1 -0
- package/dist/admin/pages/notification-reminder-rule-detail-page.js +10 -0
- package/dist/admin/pages/notification-template-detail-page.d.ts +7 -0
- package/dist/admin/pages/notification-template-detail-page.d.ts.map +1 -0
- package/dist/admin/pages/notification-template-detail-page.js +9 -0
- package/dist/admin/reminders-preview-host.d.ts +7 -0
- package/dist/admin/reminders-preview-host.d.ts.map +1 -0
- package/dist/admin/reminders-preview-host.js +13 -0
- package/dist/client.d.ts +14 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +71 -0
- package/dist/components/notification-settings-form.d.ts +2 -0
- package/dist/components/notification-settings-form.d.ts.map +1 -0
- package/dist/components/notification-settings-form.js +66 -0
- package/dist/components/reminders-preview-list.d.ts +6 -0
- package/dist/components/reminders-preview-list.d.ts.map +1 -0
- package/dist/components/reminders-preview-list.js +19 -0
- package/dist/components/stage-channel-editor-dialog.d.ts +11 -0
- package/dist/components/stage-channel-editor-dialog.d.ts.map +1 -0
- package/dist/components/stage-channel-editor-dialog.js +77 -0
- package/dist/components/stage-channel-list.d.ts +6 -0
- package/dist/components/stage-channel-list.d.ts.map +1 -0
- package/dist/components/stage-channel-list.js +20 -0
- package/dist/components/stage-editor-dialog.d.ts +10 -0
- package/dist/components/stage-editor-dialog.d.ts.map +1 -0
- package/dist/components/stage-editor-dialog.js +104 -0
- package/dist/components/stage-list.d.ts +5 -0
- package/dist/components/stage-list.d.ts.map +1 -0
- package/dist/components/stage-list.js +34 -0
- package/dist/components/template-picker.d.ts +19 -0
- package/dist/components/template-picker.d.ts.map +1 -0
- package/dist/components/template-picker.js +26 -0
- package/dist/components/timezone-combobox.d.ts +9 -0
- package/dist/components/timezone-combobox.d.ts.map +1 -0
- package/dist/components/timezone-combobox.js +67 -0
- package/dist/hooks/index.d.ts +19 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +19 -0
- package/dist/hooks/use-notification-deliveries.d.ts +39 -0
- package/dist/hooks/use-notification-deliveries.d.ts.map +1 -0
- package/dist/hooks/use-notification-deliveries.js +12 -0
- package/dist/hooks/use-notification-delivery-mutation.d.ts +32 -0
- package/dist/hooks/use-notification-delivery-mutation.d.ts.map +1 -0
- package/dist/hooks/use-notification-delivery-mutation.js +24 -0
- package/dist/hooks/use-notification-delivery.d.ts +32 -0
- package/dist/hooks/use-notification-delivery.d.ts.map +1 -0
- package/dist/hooks/use-notification-delivery.js +12 -0
- package/dist/hooks/use-notification-reminder-rule-mutation.d.ts +53 -0
- package/dist/hooks/use-notification-reminder-rule-mutation.d.ts.map +1 -0
- package/dist/hooks/use-notification-reminder-rule-mutation.js +31 -0
- package/dist/hooks/use-notification-reminder-rule.d.ts +19 -0
- package/dist/hooks/use-notification-reminder-rule.d.ts.map +1 -0
- package/dist/hooks/use-notification-reminder-rule.js +12 -0
- package/dist/hooks/use-notification-reminder-rules.d.ts +25 -0
- package/dist/hooks/use-notification-reminder-rules.d.ts.map +1 -0
- package/dist/hooks/use-notification-reminder-rules.js +12 -0
- package/dist/hooks/use-notification-reminder-runs.d.ts +56 -0
- package/dist/hooks/use-notification-reminder-runs.d.ts.map +1 -0
- package/dist/hooks/use-notification-reminder-runs.js +12 -0
- package/dist/hooks/use-notification-settings.d.ts +50 -0
- package/dist/hooks/use-notification-settings.d.ts.map +1 -0
- package/dist/hooks/use-notification-settings.js +26 -0
- package/dist/hooks/use-notification-template-authoring.d.ts +5 -0
- package/dist/hooks/use-notification-template-authoring.d.ts.map +1 -0
- package/dist/hooks/use-notification-template-authoring.js +8 -0
- package/dist/hooks/use-notification-template-mutation.d.ts +54 -0
- package/dist/hooks/use-notification-template-mutation.d.ts.map +1 -0
- package/dist/hooks/use-notification-template-mutation.js +31 -0
- package/dist/hooks/use-notification-template-tools.d.ts +80 -0
- package/dist/hooks/use-notification-template-tools.d.ts.map +1 -0
- package/dist/hooks/use-notification-template-tools.js +21 -0
- package/dist/hooks/use-notification-template.d.ts +20 -0
- package/dist/hooks/use-notification-template.d.ts.map +1 -0
- package/dist/hooks/use-notification-template.js +12 -0
- package/dist/hooks/use-notification-templates.d.ts +26 -0
- package/dist/hooks/use-notification-templates.d.ts.map +1 -0
- package/dist/hooks/use-notification-templates.js +12 -0
- package/dist/hooks/use-reminder-rule-stage-mutation.d.ts +93 -0
- package/dist/hooks/use-reminder-rule-stage-mutation.d.ts.map +1 -0
- package/dist/hooks/use-reminder-rule-stage-mutation.js +53 -0
- package/dist/hooks/use-reminder-rule-stages.d.ts +25 -0
- package/dist/hooks/use-reminder-rule-stages.d.ts.map +1 -0
- package/dist/hooks/use-reminder-rule-stages.js +12 -0
- package/dist/hooks/use-reminder-stage-channel-mutation.d.ts +48 -0
- package/dist/hooks/use-reminder-stage-channel-mutation.d.ts.map +1 -0
- package/dist/hooks/use-reminder-stage-channel-mutation.js +42 -0
- package/dist/hooks/use-reminder-stage-channels.d.ts +18 -0
- package/dist/hooks/use-reminder-stage-channels.d.ts.map +1 -0
- package/dist/hooks/use-reminder-stage-channels.js +12 -0
- package/dist/hooks/use-reminders-preview.d.ts +21 -0
- package/dist/hooks/use-reminders-preview.d.ts.map +1 -0
- package/dist/hooks/use-reminders-preview.js +12 -0
- package/dist/i18n/en.d.ts +3 -0
- package/dist/i18n/en.d.ts.map +1 -0
- package/dist/i18n/en.js +385 -0
- package/dist/i18n/index.d.ts +5 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +3 -0
- package/dist/i18n/messages.d.ts +386 -0
- package/dist/i18n/messages.d.ts.map +1 -0
- package/dist/i18n/messages.js +1 -0
- package/dist/i18n/provider.d.ts +26 -0
- package/dist/i18n/provider.d.ts.map +1 -0
- package/dist/i18n/provider.js +44 -0
- package/dist/i18n/ro.d.ts +3 -0
- package/dist/i18n/ro.d.ts.map +1 -0
- package/dist/i18n/ro.js +385 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/provider.d.ts +2 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/provider.js +1 -0
- package/dist/query-keys.d.ts +72 -0
- package/dist/query-keys.d.ts.map +1 -0
- package/dist/query-keys.js +19 -0
- package/dist/query-options.d.ts +1252 -0
- package/dist/query-options.d.ts.map +1 -0
- package/dist/query-options.js +120 -0
- package/dist/schemas.d.ts +796 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +173 -0
- package/dist/ui.d.ts +9 -0
- package/dist/ui.d.ts.map +1 -0
- package/dist/ui.js +8 -0
- package/package.json +138 -0
- package/src/styles.css +2 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Combobox, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxInput, ComboboxItem, ComboboxList, } from "@voyant-travel/ui/components/combobox";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
import { useNotificationsUiMessagesOrDefault } from "../i18n/index.js";
|
|
6
|
+
const TIMEZONES = (() => {
|
|
7
|
+
const intl = Intl;
|
|
8
|
+
if (typeof intl.supportedValuesOf === "function") {
|
|
9
|
+
try {
|
|
10
|
+
return [...intl.supportedValuesOf("timeZone")].sort();
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
// fall through
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return [
|
|
17
|
+
"UTC",
|
|
18
|
+
"Africa/Cairo",
|
|
19
|
+
"Africa/Johannesburg",
|
|
20
|
+
"Africa/Lagos",
|
|
21
|
+
"America/Chicago",
|
|
22
|
+
"America/Denver",
|
|
23
|
+
"America/Los_Angeles",
|
|
24
|
+
"America/Mexico_City",
|
|
25
|
+
"America/New_York",
|
|
26
|
+
"America/Sao_Paulo",
|
|
27
|
+
"Asia/Bangkok",
|
|
28
|
+
"Asia/Dubai",
|
|
29
|
+
"Asia/Hong_Kong",
|
|
30
|
+
"Asia/Jakarta",
|
|
31
|
+
"Asia/Kolkata",
|
|
32
|
+
"Asia/Manila",
|
|
33
|
+
"Asia/Seoul",
|
|
34
|
+
"Asia/Shanghai",
|
|
35
|
+
"Asia/Singapore",
|
|
36
|
+
"Asia/Tokyo",
|
|
37
|
+
"Australia/Sydney",
|
|
38
|
+
"Europe/Amsterdam",
|
|
39
|
+
"Europe/Berlin",
|
|
40
|
+
"Europe/Bucharest",
|
|
41
|
+
"Europe/Istanbul",
|
|
42
|
+
"Europe/Lisbon",
|
|
43
|
+
"Europe/London",
|
|
44
|
+
"Europe/Madrid",
|
|
45
|
+
"Europe/Moscow",
|
|
46
|
+
"Europe/Paris",
|
|
47
|
+
"Europe/Rome",
|
|
48
|
+
"Europe/Vienna",
|
|
49
|
+
"Pacific/Auckland",
|
|
50
|
+
];
|
|
51
|
+
})();
|
|
52
|
+
export function TimezoneCombobox({ value, onChange, placeholder, emptyText, disabled, }) {
|
|
53
|
+
const messages = useNotificationsUiMessagesOrDefault().pickers.timezones;
|
|
54
|
+
const [inputValue, setInputValue] = React.useState(value ?? "");
|
|
55
|
+
React.useEffect(() => {
|
|
56
|
+
setInputValue(value ?? "");
|
|
57
|
+
}, [value]);
|
|
58
|
+
return (_jsxs(Combobox, { items: TIMEZONES, value: value ?? null, inputValue: inputValue, autoHighlight: true, disabled: disabled, itemToStringLabel: (item) => item, itemToStringValue: (item) => item, onInputValueChange: (next) => {
|
|
59
|
+
setInputValue(next);
|
|
60
|
+
if (!next)
|
|
61
|
+
onChange(null);
|
|
62
|
+
}, onValueChange: (next) => {
|
|
63
|
+
const tz = next ?? null;
|
|
64
|
+
onChange(tz);
|
|
65
|
+
setInputValue(tz ?? "");
|
|
66
|
+
}, children: [_jsx(ComboboxInput, { placeholder: placeholder ?? messages.placeholder, showClear: Boolean(value) }), _jsxs(ComboboxContent, { children: [_jsx(ComboboxEmpty, { children: emptyText ?? messages.empty }), _jsx(ComboboxList, { children: _jsx(ComboboxCollection, { children: (tz) => (_jsx(ComboboxItem, { value: tz, children: tz }, tz)) }) })] })] }));
|
|
67
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export * from "./use-notification-deliveries.js";
|
|
2
|
+
export * from "./use-notification-delivery.js";
|
|
3
|
+
export * from "./use-notification-delivery-mutation.js";
|
|
4
|
+
export * from "./use-notification-reminder-rule.js";
|
|
5
|
+
export * from "./use-notification-reminder-rule-mutation.js";
|
|
6
|
+
export * from "./use-notification-reminder-rules.js";
|
|
7
|
+
export * from "./use-notification-reminder-runs.js";
|
|
8
|
+
export * from "./use-notification-settings.js";
|
|
9
|
+
export * from "./use-notification-template.js";
|
|
10
|
+
export * from "./use-notification-template-authoring.js";
|
|
11
|
+
export * from "./use-notification-template-mutation.js";
|
|
12
|
+
export * from "./use-notification-template-tools.js";
|
|
13
|
+
export * from "./use-notification-templates.js";
|
|
14
|
+
export * from "./use-reminder-rule-stage-mutation.js";
|
|
15
|
+
export * from "./use-reminder-rule-stages.js";
|
|
16
|
+
export * from "./use-reminder-stage-channel-mutation.js";
|
|
17
|
+
export * from "./use-reminder-stage-channels.js";
|
|
18
|
+
export * from "./use-reminders-preview.js";
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAEA,cAAc,kCAAkC,CAAA;AAChD,cAAc,gCAAgC,CAAA;AAC9C,cAAc,yCAAyC,CAAA;AACvD,cAAc,qCAAqC,CAAA;AACnD,cAAc,8CAA8C,CAAA;AAC5D,cAAc,sCAAsC,CAAA;AACpD,cAAc,qCAAqC,CAAA;AACnD,cAAc,gCAAgC,CAAA;AAC9C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,0CAA0C,CAAA;AACxD,cAAc,yCAAyC,CAAA;AACvD,cAAc,sCAAsC,CAAA;AACpD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,uCAAuC,CAAA;AACrD,cAAc,+BAA+B,CAAA;AAC7C,cAAc,0CAA0C,CAAA;AACxD,cAAc,kCAAkC,CAAA;AAChD,cAAc,4BAA4B,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
export * from "./use-notification-deliveries.js";
|
|
3
|
+
export * from "./use-notification-delivery.js";
|
|
4
|
+
export * from "./use-notification-delivery-mutation.js";
|
|
5
|
+
export * from "./use-notification-reminder-rule.js";
|
|
6
|
+
export * from "./use-notification-reminder-rule-mutation.js";
|
|
7
|
+
export * from "./use-notification-reminder-rules.js";
|
|
8
|
+
export * from "./use-notification-reminder-runs.js";
|
|
9
|
+
export * from "./use-notification-settings.js";
|
|
10
|
+
export * from "./use-notification-template.js";
|
|
11
|
+
export * from "./use-notification-template-authoring.js";
|
|
12
|
+
export * from "./use-notification-template-mutation.js";
|
|
13
|
+
export * from "./use-notification-template-tools.js";
|
|
14
|
+
export * from "./use-notification-templates.js";
|
|
15
|
+
export * from "./use-reminder-rule-stage-mutation.js";
|
|
16
|
+
export * from "./use-reminder-rule-stages.js";
|
|
17
|
+
export * from "./use-reminder-stage-channel-mutation.js";
|
|
18
|
+
export * from "./use-reminder-stage-channels.js";
|
|
19
|
+
export * from "./use-reminders-preview.js";
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { NotificationDeliveriesListFilters } from "../query-keys.js";
|
|
2
|
+
export interface UseNotificationDeliveriesOptions extends NotificationDeliveriesListFilters {
|
|
3
|
+
enabled?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare function useNotificationDeliveries(options?: UseNotificationDeliveriesOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
6
|
+
data: {
|
|
7
|
+
id: string;
|
|
8
|
+
templateId: string | null;
|
|
9
|
+
templateSlug: string | null;
|
|
10
|
+
targetType: "other" | "booking" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "person" | "organization" | "payment_session";
|
|
11
|
+
targetId: string | null;
|
|
12
|
+
personId: string | null;
|
|
13
|
+
organizationId: string | null;
|
|
14
|
+
bookingId: string | null;
|
|
15
|
+
invoiceId: string | null;
|
|
16
|
+
paymentSessionId: string | null;
|
|
17
|
+
channel: "email" | "sms";
|
|
18
|
+
provider: string;
|
|
19
|
+
providerMessageId: string | null;
|
|
20
|
+
status: "pending" | "failed" | "cancelled" | "sent";
|
|
21
|
+
toAddress: string;
|
|
22
|
+
fromAddress: string | null;
|
|
23
|
+
subject: string | null;
|
|
24
|
+
htmlBody: string | null;
|
|
25
|
+
textBody: string | null;
|
|
26
|
+
payloadData: Record<string, unknown> | null;
|
|
27
|
+
metadata: Record<string, unknown> | null;
|
|
28
|
+
errorMessage: string | null;
|
|
29
|
+
scheduledFor: string | null;
|
|
30
|
+
sentAt: string | null;
|
|
31
|
+
failedAt: string | null;
|
|
32
|
+
createdAt: string;
|
|
33
|
+
updatedAt: string;
|
|
34
|
+
}[];
|
|
35
|
+
total: number;
|
|
36
|
+
limit: number;
|
|
37
|
+
offset: number;
|
|
38
|
+
}, Error>;
|
|
39
|
+
//# sourceMappingURL=use-notification-deliveries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-notification-deliveries.d.ts","sourceRoot":"","sources":["../../src/hooks/use-notification-deliveries.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,kBAAkB,CAAA;AAGzE,MAAM,WAAW,gCAAiC,SAAQ,iCAAiC;IACzF,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,yBAAyB,CAAC,OAAO,GAAE,gCAAqC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAOvF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useVoyantNotificationsContext } from "../provider.js";
|
|
4
|
+
import { getNotificationDeliveriesQueryOptions } from "../query-options.js";
|
|
5
|
+
export function useNotificationDeliveries(options = {}) {
|
|
6
|
+
const { baseUrl, fetcher } = useVoyantNotificationsContext();
|
|
7
|
+
const { enabled = true, ...filters } = options;
|
|
8
|
+
return useQuery({
|
|
9
|
+
...getNotificationDeliveriesQueryOptions({ baseUrl, fetcher }, filters),
|
|
10
|
+
enabled,
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare function useNotificationDeliveryMutation(): {
|
|
2
|
+
resend: import("@tanstack/react-query").UseMutationResult<{
|
|
3
|
+
id: string;
|
|
4
|
+
templateId: string | null;
|
|
5
|
+
templateSlug: string | null;
|
|
6
|
+
targetType: "other" | "booking" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "person" | "organization" | "payment_session";
|
|
7
|
+
targetId: string | null;
|
|
8
|
+
personId: string | null;
|
|
9
|
+
organizationId: string | null;
|
|
10
|
+
bookingId: string | null;
|
|
11
|
+
invoiceId: string | null;
|
|
12
|
+
paymentSessionId: string | null;
|
|
13
|
+
channel: "email" | "sms";
|
|
14
|
+
provider: string;
|
|
15
|
+
providerMessageId: string | null;
|
|
16
|
+
status: "pending" | "failed" | "cancelled" | "sent";
|
|
17
|
+
toAddress: string;
|
|
18
|
+
fromAddress: string | null;
|
|
19
|
+
subject: string | null;
|
|
20
|
+
htmlBody: string | null;
|
|
21
|
+
textBody: string | null;
|
|
22
|
+
payloadData: Record<string, unknown> | null;
|
|
23
|
+
metadata: Record<string, unknown> | null;
|
|
24
|
+
errorMessage: string | null;
|
|
25
|
+
scheduledFor: string | null;
|
|
26
|
+
sentAt: string | null;
|
|
27
|
+
failedAt: string | null;
|
|
28
|
+
createdAt: string;
|
|
29
|
+
updatedAt: string;
|
|
30
|
+
}, Error, string, unknown>;
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=use-notification-delivery-mutation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-notification-delivery-mutation.d.ts","sourceRoot":"","sources":["../../src/hooks/use-notification-delivery-mutation.ts"],"names":[],"mappings":"AASA,wBAAgB,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwB9C"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
3
|
+
import { fetchWithValidation } from "../client.js";
|
|
4
|
+
import { useVoyantNotificationsContext } from "../provider.js";
|
|
5
|
+
import { notificationsQueryKeys } from "../query-keys.js";
|
|
6
|
+
import { notificationDeliverySingleResponse } from "../schemas.js";
|
|
7
|
+
export function useNotificationDeliveryMutation() {
|
|
8
|
+
const { baseUrl, fetcher } = useVoyantNotificationsContext();
|
|
9
|
+
const queryClient = useQueryClient();
|
|
10
|
+
const resend = useMutation({
|
|
11
|
+
mutationFn: async (deliveryId) => {
|
|
12
|
+
const { data } = await fetchWithValidation(`/v1/admin/notifications/deliveries/${deliveryId}/resend`, notificationDeliverySingleResponse, { baseUrl, fetcher }, { method: "POST" });
|
|
13
|
+
return data;
|
|
14
|
+
},
|
|
15
|
+
onSuccess: (delivery) => {
|
|
16
|
+
void queryClient.invalidateQueries({ queryKey: notificationsQueryKeys.deliveries() });
|
|
17
|
+
void queryClient.invalidateQueries({ queryKey: notificationsQueryKeys.delivery(delivery.id) });
|
|
18
|
+
},
|
|
19
|
+
onSettled: () => {
|
|
20
|
+
void queryClient.invalidateQueries({ queryKey: notificationsQueryKeys.deliveries() });
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
return { resend };
|
|
24
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare function useNotificationDelivery(id: string, options?: {
|
|
2
|
+
enabled?: boolean;
|
|
3
|
+
}): import("@tanstack/react-query").UseQueryResult<{
|
|
4
|
+
id: string;
|
|
5
|
+
templateId: string | null;
|
|
6
|
+
templateSlug: string | null;
|
|
7
|
+
targetType: "other" | "booking" | "invoice" | "booking_payment_schedule" | "booking_guarantee" | "person" | "organization" | "payment_session";
|
|
8
|
+
targetId: string | null;
|
|
9
|
+
personId: string | null;
|
|
10
|
+
organizationId: string | null;
|
|
11
|
+
bookingId: string | null;
|
|
12
|
+
invoiceId: string | null;
|
|
13
|
+
paymentSessionId: string | null;
|
|
14
|
+
channel: "email" | "sms";
|
|
15
|
+
provider: string;
|
|
16
|
+
providerMessageId: string | null;
|
|
17
|
+
status: "pending" | "failed" | "cancelled" | "sent";
|
|
18
|
+
toAddress: string;
|
|
19
|
+
fromAddress: string | null;
|
|
20
|
+
subject: string | null;
|
|
21
|
+
htmlBody: string | null;
|
|
22
|
+
textBody: string | null;
|
|
23
|
+
payloadData: Record<string, unknown> | null;
|
|
24
|
+
metadata: Record<string, unknown> | null;
|
|
25
|
+
errorMessage: string | null;
|
|
26
|
+
scheduledFor: string | null;
|
|
27
|
+
sentAt: string | null;
|
|
28
|
+
failedAt: string | null;
|
|
29
|
+
createdAt: string;
|
|
30
|
+
updatedAt: string;
|
|
31
|
+
}, Error>;
|
|
32
|
+
//# sourceMappingURL=use-notification-delivery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-notification-delivery.d.ts","sourceRoot":"","sources":["../../src/hooks/use-notification-delivery.ts"],"names":[],"mappings":"AAOA,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAQlF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useVoyantNotificationsContext } from "../provider.js";
|
|
4
|
+
import { getNotificationDeliveryQueryOptions } from "../query-options.js";
|
|
5
|
+
export function useNotificationDelivery(id, options) {
|
|
6
|
+
const { baseUrl, fetcher } = useVoyantNotificationsContext();
|
|
7
|
+
const enabled = options?.enabled ?? true;
|
|
8
|
+
return useQuery({
|
|
9
|
+
...getNotificationDeliveryQueryOptions({ baseUrl, fetcher }, id),
|
|
10
|
+
enabled: enabled && Boolean(id),
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { insertNotificationReminderRuleSchema, updateNotificationReminderRuleSchema } from "@voyant-travel/notifications";
|
|
2
|
+
import type { z } from "zod";
|
|
3
|
+
export type CreateNotificationReminderRuleInput = z.input<typeof insertNotificationReminderRuleSchema>;
|
|
4
|
+
export type UpdateNotificationReminderRuleInput = z.input<typeof updateNotificationReminderRuleSchema>;
|
|
5
|
+
export declare function useNotificationReminderRuleMutation(): {
|
|
6
|
+
create: import("@tanstack/react-query").UseMutationResult<{
|
|
7
|
+
id: string;
|
|
8
|
+
slug: string;
|
|
9
|
+
name: string;
|
|
10
|
+
status: "draft" | "active" | "archived";
|
|
11
|
+
targetType: "invoice" | "booking_payment_schedule" | "booking_confirmed" | "payment_complete" | "booking_cancelled_non_payment";
|
|
12
|
+
channel: "email" | "sms";
|
|
13
|
+
provider: string | null;
|
|
14
|
+
templateId: string | null;
|
|
15
|
+
templateSlug: string | null;
|
|
16
|
+
isSystem: boolean;
|
|
17
|
+
metadata: Record<string, unknown> | null;
|
|
18
|
+
createdAt: string;
|
|
19
|
+
updatedAt: string;
|
|
20
|
+
}, Error, {
|
|
21
|
+
slug: string;
|
|
22
|
+
name: string;
|
|
23
|
+
targetType: "invoice" | "booking_payment_schedule" | "booking_confirmed" | "payment_complete" | "booking_cancelled_non_payment";
|
|
24
|
+
channel: "email" | "sms";
|
|
25
|
+
status?: "draft" | "active" | "archived" | undefined;
|
|
26
|
+
provider?: string | null | undefined;
|
|
27
|
+
templateId?: string | null | undefined;
|
|
28
|
+
templateSlug?: string | null | undefined;
|
|
29
|
+
priority?: unknown;
|
|
30
|
+
suppressionGroup?: string | null | undefined;
|
|
31
|
+
isSystem?: boolean | undefined;
|
|
32
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
33
|
+
}, unknown>;
|
|
34
|
+
update: import("@tanstack/react-query").UseMutationResult<{
|
|
35
|
+
id: string;
|
|
36
|
+
slug: string;
|
|
37
|
+
name: string;
|
|
38
|
+
status: "draft" | "active" | "archived";
|
|
39
|
+
targetType: "invoice" | "booking_payment_schedule" | "booking_confirmed" | "payment_complete" | "booking_cancelled_non_payment";
|
|
40
|
+
channel: "email" | "sms";
|
|
41
|
+
provider: string | null;
|
|
42
|
+
templateId: string | null;
|
|
43
|
+
templateSlug: string | null;
|
|
44
|
+
isSystem: boolean;
|
|
45
|
+
metadata: Record<string, unknown> | null;
|
|
46
|
+
createdAt: string;
|
|
47
|
+
updatedAt: string;
|
|
48
|
+
}, Error, {
|
|
49
|
+
id: string;
|
|
50
|
+
input: UpdateNotificationReminderRuleInput;
|
|
51
|
+
}, unknown>;
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=use-notification-reminder-rule-mutation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-notification-reminder-rule-mutation.d.ts","sourceRoot":"","sources":["../../src/hooks/use-notification-reminder-rule-mutation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,oCAAoC,EACpC,oCAAoC,EACrC,MAAM,8BAA8B,CAAA;AACrC,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAO5B,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,oCAAoC,CAC5C,CAAA;AACD,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,oCAAoC,CAC5C,CAAA;AAED,wBAAgB,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAyBzC,MAAM;eACH,mCAAmC;;EAiB/C"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
3
|
+
import { fetchWithValidation } from "../client.js";
|
|
4
|
+
import { useVoyantNotificationsContext } from "../provider.js";
|
|
5
|
+
import { notificationsQueryKeys } from "../query-keys.js";
|
|
6
|
+
import { notificationReminderRuleSingleResponse } from "../schemas.js";
|
|
7
|
+
export function useNotificationReminderRuleMutation() {
|
|
8
|
+
const { baseUrl, fetcher } = useVoyantNotificationsContext();
|
|
9
|
+
const queryClient = useQueryClient();
|
|
10
|
+
const create = useMutation({
|
|
11
|
+
mutationFn: async (input) => {
|
|
12
|
+
const { data } = await fetchWithValidation("/v1/admin/notifications/reminder-rules", notificationReminderRuleSingleResponse, { baseUrl, fetcher }, { method: "POST", body: JSON.stringify(input) });
|
|
13
|
+
return data;
|
|
14
|
+
},
|
|
15
|
+
onSuccess: (data) => {
|
|
16
|
+
void queryClient.invalidateQueries({ queryKey: notificationsQueryKeys.reminderRules() });
|
|
17
|
+
queryClient.setQueryData(notificationsQueryKeys.reminderRule(data.id), data);
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
const update = useMutation({
|
|
21
|
+
mutationFn: async ({ id, input, }) => {
|
|
22
|
+
const { data } = await fetchWithValidation(`/v1/admin/notifications/reminder-rules/${id}`, notificationReminderRuleSingleResponse, { baseUrl, fetcher }, { method: "PATCH", body: JSON.stringify(input) });
|
|
23
|
+
return data;
|
|
24
|
+
},
|
|
25
|
+
onSuccess: (data) => {
|
|
26
|
+
void queryClient.invalidateQueries({ queryKey: notificationsQueryKeys.reminderRules() });
|
|
27
|
+
queryClient.setQueryData(notificationsQueryKeys.reminderRule(data.id), data);
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
return { create, update };
|
|
31
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface UseNotificationReminderRuleOptions {
|
|
2
|
+
enabled?: boolean;
|
|
3
|
+
}
|
|
4
|
+
export declare function useNotificationReminderRule(id: string, options?: UseNotificationReminderRuleOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
5
|
+
id: string;
|
|
6
|
+
slug: string;
|
|
7
|
+
name: string;
|
|
8
|
+
status: "draft" | "active" | "archived";
|
|
9
|
+
targetType: "invoice" | "booking_payment_schedule" | "booking_confirmed" | "payment_complete" | "booking_cancelled_non_payment";
|
|
10
|
+
channel: "email" | "sms";
|
|
11
|
+
provider: string | null;
|
|
12
|
+
templateId: string | null;
|
|
13
|
+
templateSlug: string | null;
|
|
14
|
+
isSystem: boolean;
|
|
15
|
+
metadata: Record<string, unknown> | null;
|
|
16
|
+
createdAt: string;
|
|
17
|
+
updatedAt: string;
|
|
18
|
+
}, Error>;
|
|
19
|
+
//# sourceMappingURL=use-notification-reminder-rule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-notification-reminder-rule.d.ts","sourceRoot":"","sources":["../../src/hooks/use-notification-reminder-rule.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,kCAAkC;IACjD,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,2BAA2B,CACzC,EAAE,EAAE,MAAM,EACV,OAAO,GAAE,kCAAuC;;;;;;;;;;;;;;UAQjD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useVoyantNotificationsContext } from "../provider.js";
|
|
4
|
+
import { getNotificationReminderRuleQueryOptions } from "../query-options.js";
|
|
5
|
+
export function useNotificationReminderRule(id, options = {}) {
|
|
6
|
+
const { baseUrl, fetcher } = useVoyantNotificationsContext();
|
|
7
|
+
const { enabled = true } = options;
|
|
8
|
+
return useQuery({
|
|
9
|
+
...getNotificationReminderRuleQueryOptions({ baseUrl, fetcher }, id),
|
|
10
|
+
enabled: enabled && Boolean(id),
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { NotificationReminderRulesListFilters } from "../query-keys.js";
|
|
2
|
+
export interface UseNotificationReminderRulesOptions extends NotificationReminderRulesListFilters {
|
|
3
|
+
enabled?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare function useNotificationReminderRules(options?: UseNotificationReminderRulesOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
6
|
+
data: {
|
|
7
|
+
id: string;
|
|
8
|
+
slug: string;
|
|
9
|
+
name: string;
|
|
10
|
+
status: "draft" | "active" | "archived";
|
|
11
|
+
targetType: "invoice" | "booking_payment_schedule" | "booking_confirmed" | "payment_complete" | "booking_cancelled_non_payment";
|
|
12
|
+
channel: "email" | "sms";
|
|
13
|
+
provider: string | null;
|
|
14
|
+
templateId: string | null;
|
|
15
|
+
templateSlug: string | null;
|
|
16
|
+
isSystem: boolean;
|
|
17
|
+
metadata: Record<string, unknown> | null;
|
|
18
|
+
createdAt: string;
|
|
19
|
+
updatedAt: string;
|
|
20
|
+
}[];
|
|
21
|
+
total: number;
|
|
22
|
+
limit: number;
|
|
23
|
+
offset: number;
|
|
24
|
+
}, Error>;
|
|
25
|
+
//# sourceMappingURL=use-notification-reminder-rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-notification-reminder-rules.d.ts","sourceRoot":"","sources":["../../src/hooks/use-notification-reminder-rules.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,kBAAkB,CAAA;AAG5E,MAAM,WAAW,mCAAoC,SAAQ,oCAAoC;IAC/F,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,4BAA4B,CAAC,OAAO,GAAE,mCAAwC;;;;;;;;;;;;;;;;;;;UAO7F"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useVoyantNotificationsContext } from "../provider.js";
|
|
4
|
+
import { getNotificationReminderRulesQueryOptions } from "../query-options.js";
|
|
5
|
+
export function useNotificationReminderRules(options = {}) {
|
|
6
|
+
const { baseUrl, fetcher } = useVoyantNotificationsContext();
|
|
7
|
+
const { enabled = true, ...filters } = options;
|
|
8
|
+
return useQuery({
|
|
9
|
+
...getNotificationReminderRulesQueryOptions({ baseUrl, fetcher }, filters),
|
|
10
|
+
enabled,
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { NotificationReminderRunsListFilters } from "../query-keys.js";
|
|
2
|
+
export interface UseNotificationReminderRunsOptions extends NotificationReminderRunsListFilters {
|
|
3
|
+
enabled?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare function useNotificationReminderRuns(options?: UseNotificationReminderRunsOptions): import("@tanstack/react-query").UseQueryResult<{
|
|
6
|
+
data: {
|
|
7
|
+
id: string;
|
|
8
|
+
reminderRuleId: string;
|
|
9
|
+
targetType: "invoice" | "booking_payment_schedule" | "booking_confirmed" | "payment_complete" | "booking_cancelled_non_payment";
|
|
10
|
+
targetId: string;
|
|
11
|
+
dedupeKey: string;
|
|
12
|
+
status: "queued" | "failed" | "processing" | "skipped" | "sent";
|
|
13
|
+
recipient: string | null;
|
|
14
|
+
scheduledFor: string;
|
|
15
|
+
processedAt: string;
|
|
16
|
+
errorMessage: string | null;
|
|
17
|
+
metadata: Record<string, unknown> | null;
|
|
18
|
+
createdAt: string;
|
|
19
|
+
updatedAt: string;
|
|
20
|
+
links: {
|
|
21
|
+
bookingId: string | null;
|
|
22
|
+
bookingPaymentScheduleId: string | null;
|
|
23
|
+
invoiceId: string | null;
|
|
24
|
+
paymentSessionId: string | null;
|
|
25
|
+
personId: string | null;
|
|
26
|
+
organizationId: string | null;
|
|
27
|
+
notificationDeliveryId: string | null;
|
|
28
|
+
};
|
|
29
|
+
reminderRule: {
|
|
30
|
+
id: string;
|
|
31
|
+
slug: string;
|
|
32
|
+
name: string;
|
|
33
|
+
status: "draft" | "active" | "archived";
|
|
34
|
+
targetType: "invoice" | "booking_payment_schedule" | "booking_confirmed" | "payment_complete" | "booking_cancelled_non_payment";
|
|
35
|
+
channel: "email" | "sms";
|
|
36
|
+
provider: string | null;
|
|
37
|
+
templateId: string | null;
|
|
38
|
+
templateSlug: string | null;
|
|
39
|
+
};
|
|
40
|
+
delivery: {
|
|
41
|
+
id: string;
|
|
42
|
+
status: "pending" | "failed" | "cancelled" | "sent";
|
|
43
|
+
channel: "email" | "sms";
|
|
44
|
+
provider: string;
|
|
45
|
+
toAddress: string;
|
|
46
|
+
subject: string | null;
|
|
47
|
+
sentAt: string | null;
|
|
48
|
+
failedAt: string | null;
|
|
49
|
+
errorMessage: string | null;
|
|
50
|
+
} | null;
|
|
51
|
+
}[];
|
|
52
|
+
total: number;
|
|
53
|
+
limit: number;
|
|
54
|
+
offset: number;
|
|
55
|
+
}, Error>;
|
|
56
|
+
//# sourceMappingURL=use-notification-reminder-runs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-notification-reminder-runs.d.ts","sourceRoot":"","sources":["../../src/hooks/use-notification-reminder-runs.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,kBAAkB,CAAA;AAG3E,MAAM,WAAW,kCAAmC,SAAQ,mCAAmC;IAC7F,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,wBAAgB,2BAA2B,CAAC,OAAO,GAAE,kCAAuC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAO3F"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
import { useVoyantNotificationsContext } from "../provider.js";
|
|
4
|
+
import { getNotificationReminderRunsQueryOptions } from "../query-options.js";
|
|
5
|
+
export function useNotificationReminderRuns(options = {}) {
|
|
6
|
+
const { baseUrl, fetcher } = useVoyantNotificationsContext();
|
|
7
|
+
const { enabled = true, ...filters } = options;
|
|
8
|
+
return useQuery({
|
|
9
|
+
...getNotificationReminderRunsQueryOptions({ baseUrl, fetcher }, filters),
|
|
10
|
+
enabled,
|
|
11
|
+
});
|
|
12
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { updateNotificationSettingsSchema } from "@voyant-travel/notifications";
|
|
2
|
+
import type { z } from "zod";
|
|
3
|
+
export type UpdateNotificationSettingsInput = z.input<typeof updateNotificationSettingsSchema>;
|
|
4
|
+
export declare function useNotificationSettings(): import("@tanstack/react-query").UseQueryResult<{
|
|
5
|
+
id: string;
|
|
6
|
+
scope: string;
|
|
7
|
+
quietHoursLocal: {
|
|
8
|
+
start: string;
|
|
9
|
+
end: string;
|
|
10
|
+
tz: string;
|
|
11
|
+
} | null;
|
|
12
|
+
blackoutDates: string[] | null;
|
|
13
|
+
skipWeekends: boolean;
|
|
14
|
+
holidayCalendar: string | null;
|
|
15
|
+
recipientRateLimitPerDay: number | null;
|
|
16
|
+
suppressionWindowHours: number;
|
|
17
|
+
metadata: Record<string, unknown> | null;
|
|
18
|
+
createdAt: string;
|
|
19
|
+
updatedAt: string;
|
|
20
|
+
}, Error>;
|
|
21
|
+
export declare function useNotificationSettingsMutation(): import("@tanstack/react-query").UseMutationResult<{
|
|
22
|
+
id: string;
|
|
23
|
+
scope: string;
|
|
24
|
+
quietHoursLocal: {
|
|
25
|
+
start: string;
|
|
26
|
+
end: string;
|
|
27
|
+
tz: string;
|
|
28
|
+
} | null;
|
|
29
|
+
blackoutDates: string[] | null;
|
|
30
|
+
skipWeekends: boolean;
|
|
31
|
+
holidayCalendar: string | null;
|
|
32
|
+
recipientRateLimitPerDay: number | null;
|
|
33
|
+
suppressionWindowHours: number;
|
|
34
|
+
metadata: Record<string, unknown> | null;
|
|
35
|
+
createdAt: string;
|
|
36
|
+
updatedAt: string;
|
|
37
|
+
}, Error, {
|
|
38
|
+
scope?: string | undefined;
|
|
39
|
+
quietHoursLocal?: {
|
|
40
|
+
start: string;
|
|
41
|
+
end: string;
|
|
42
|
+
tz: string;
|
|
43
|
+
} | null | undefined;
|
|
44
|
+
blackoutDates?: string[] | null | undefined;
|
|
45
|
+
skipWeekends?: boolean | undefined;
|
|
46
|
+
recipientRateLimitPerDay?: unknown;
|
|
47
|
+
suppressionWindowHours?: unknown;
|
|
48
|
+
metadata?: Record<string, unknown> | null | undefined;
|
|
49
|
+
}, unknown>;
|
|
50
|
+
//# sourceMappingURL=use-notification-settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-notification-settings.d.ts","sourceRoot":"","sources":["../../src/hooks/use-notification-settings.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,8BAA8B,CAAA;AACpF,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAQ5B,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gCAAgC,CAAC,CAAA;AAE9F,wBAAgB,uBAAuB;;;;;;;;;;;;;;;;UAGtC;AAED,wBAAgB,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAoB9C"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
3
|
+
import { fetchWithValidation } from "../client.js";
|
|
4
|
+
import { useVoyantNotificationsContext } from "../provider.js";
|
|
5
|
+
import { notificationsQueryKeys } from "../query-keys.js";
|
|
6
|
+
import { getNotificationSettingsQueryOptions } from "../query-options.js";
|
|
7
|
+
import { notificationSettingsResponse } from "../schemas.js";
|
|
8
|
+
export function useNotificationSettings() {
|
|
9
|
+
const { baseUrl, fetcher } = useVoyantNotificationsContext();
|
|
10
|
+
return useQuery(getNotificationSettingsQueryOptions({ baseUrl, fetcher }));
|
|
11
|
+
}
|
|
12
|
+
export function useNotificationSettingsMutation() {
|
|
13
|
+
const { baseUrl, fetcher } = useVoyantNotificationsContext();
|
|
14
|
+
const queryClient = useQueryClient();
|
|
15
|
+
return useMutation({
|
|
16
|
+
mutationFn: async (input) => {
|
|
17
|
+
const { data } = await fetchWithValidation("/v1/admin/notifications/notification-settings", notificationSettingsResponse, { baseUrl, fetcher }, { method: "PATCH", body: JSON.stringify(input) });
|
|
18
|
+
return data;
|
|
19
|
+
},
|
|
20
|
+
onSuccess: () => {
|
|
21
|
+
void queryClient.invalidateQueries({
|
|
22
|
+
queryKey: notificationsQueryKeys.notificationSettings(),
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function useNotificationTemplateAuthoring(): {
|
|
2
|
+
variableCatalog: import("@voyant-travel/notifications").NotificationTemplateVariableCategory[];
|
|
3
|
+
liquidSnippets: import("@voyant-travel/notifications").NotificationLiquidSnippet[];
|
|
4
|
+
};
|
|
5
|
+
//# sourceMappingURL=use-notification-template-authoring.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-notification-template-authoring.d.ts","sourceRoot":"","sources":["../../src/hooks/use-notification-template-authoring.ts"],"names":[],"mappings":"AAOA,wBAAgB,gCAAgC;;;EAK/C"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { notificationLiquidSnippets, notificationTemplateVariableCatalog, } from "@voyant-travel/notifications";
|
|
3
|
+
export function useNotificationTemplateAuthoring() {
|
|
4
|
+
return {
|
|
5
|
+
variableCatalog: notificationTemplateVariableCatalog,
|
|
6
|
+
liquidSnippets: notificationLiquidSnippets,
|
|
7
|
+
};
|
|
8
|
+
}
|