@timothyw/pat-common 1.0.112 → 1.0.115
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/dist/types/api/notifications/create-notification-template-types.d.ts +3 -18
- package/dist/types/api/notifications/create-notification-template-types.js +1 -7
- package/dist/types/api/notifications/delete-notification-template-types.d.ts +2 -11
- package/dist/types/api/notifications/delete-notification-template-types.js +1 -6
- package/dist/types/api/notifications/get-notification-templates-types.d.ts +3 -18
- package/dist/types/api/notifications/get-notification-templates-types.js +1 -7
- package/dist/types/api/notifications/preview-notification-template-types.d.ts +5 -34
- package/dist/types/api/notifications/preview-notification-template-types.js +1 -12
- package/dist/types/api/notifications/sync-notification-template-types.d.ts +3 -18
- package/dist/types/api/notifications/sync-notification-template-types.js +1 -7
- package/dist/types/api/notifications/update-notification-template-types.d.ts +3 -146
- package/dist/types/api/notifications/update-notification-template-types.js +1 -4
- package/dist/types/id-types.d.ts +2 -2
- package/dist/types/index.d.ts +1 -3
- package/dist/types/index.js +4 -3
- package/dist/types/new/agenda-types.d.ts +116 -0
- package/dist/types/new/agenda-types.js +37 -0
- package/dist/types/new/auth-types.d.ts +153 -0
- package/dist/types/new/auth-types.js +48 -0
- package/dist/types/new/habits-types.d.ts +317 -0
- package/dist/types/new/habits-types.js +70 -0
- package/dist/types/new/index.d.ts +10 -0
- package/dist/types/new/index.js +26 -0
- package/dist/types/new/lists-types.d.ts +164 -0
- package/dist/types/new/lists-types.js +50 -0
- package/dist/types/new/misc/index.d.ts +1 -0
- package/dist/types/new/misc/index.js +17 -0
- package/dist/types/new/misc/version-types.d.ts +26 -0
- package/dist/types/new/misc/version-types.js +13 -0
- package/dist/types/new/notifications-types.d.ts +407 -0
- package/dist/types/new/notifications-types.js +91 -0
- package/dist/types/new/people-types.d.ts +285 -0
- package/dist/types/new/people-types.js +58 -0
- package/dist/types/new/program-config-types.d.ts +105 -0
- package/dist/types/new/program-config-types.js +29 -0
- package/dist/types/new/thoughts-types.d.ts +57 -0
- package/dist/types/new/thoughts-types.js +18 -0
- package/dist/types/new/user-types.d.ts +283 -0
- package/dist/types/new/user-types.js +46 -0
- package/dist/types/old/api/account/get-user-types.d.ts +5 -0
- package/dist/types/old/api/account/get-user-types.js +2 -0
- package/dist/types/old/api/account/index.d.ts +2 -0
- package/dist/types/old/api/account/index.js +18 -0
- package/dist/types/old/api/account/update-user-types.d.ts +128 -0
- package/dist/types/old/api/account/update-user-types.js +8 -0
- package/dist/types/old/api/auth/create-account-types.d.ts +24 -0
- package/dist/types/old/api/auth/create-account-types.js +10 -0
- package/dist/types/old/api/auth/index.d.ts +5 -0
- package/dist/types/old/api/auth/index.js +21 -0
- package/dist/types/old/api/auth/refresh-auth-types.d.ts +15 -0
- package/dist/types/old/api/auth/refresh-auth-types.js +7 -0
- package/dist/types/old/api/auth/resend-verification-types.d.ts +3 -0
- package/dist/types/old/api/auth/resend-verification-types.js +2 -0
- package/dist/types/old/api/auth/sign-in-types.d.ts +19 -0
- package/dist/types/old/api/auth/sign-in-types.js +8 -0
- package/dist/types/old/api/auth/verify-email-types.d.ts +3 -0
- package/dist/types/old/api/auth/verify-email-types.js +2 -0
- package/dist/types/old/api/habits/create-habit-entry-types.d.ts +19 -0
- package/dist/types/old/api/habits/create-habit-entry-types.js +10 -0
- package/dist/types/old/api/habits/create-habit-types.d.ts +26 -0
- package/dist/types/old/api/habits/create-habit-types.js +12 -0
- package/dist/types/old/api/habits/delete-habit-entry-types.d.ts +5 -0
- package/dist/types/old/api/habits/delete-habit-entry-types.js +2 -0
- package/dist/types/old/api/habits/delete-habit-types.d.ts +3 -0
- package/dist/types/old/api/habits/delete-habit-types.js +2 -0
- package/dist/types/old/api/habits/get-habits-types.d.ts +5 -0
- package/dist/types/old/api/habits/get-habits-types.js +2 -0
- package/dist/types/old/api/habits/index.d.ts +6 -0
- package/dist/types/old/api/habits/index.js +22 -0
- package/dist/types/old/api/habits/update-habit-types.d.ts +26 -0
- package/dist/types/old/api/habits/update-habit-types.js +12 -0
- package/dist/types/old/api/index.d.ts +9 -0
- package/dist/types/old/api/index.js +25 -0
- package/dist/types/old/api/items/complete-item-types.d.ts +14 -0
- package/dist/types/old/api/items/complete-item-types.js +7 -0
- package/dist/types/old/api/items/create-item-types.d.ts +29 -0
- package/dist/types/old/api/items/create-item-types.js +12 -0
- package/dist/types/old/api/items/delete-item-types.d.ts +3 -0
- package/dist/types/old/api/items/delete-item-types.js +2 -0
- package/dist/types/old/api/items/get-items-types.d.ts +5 -0
- package/dist/types/old/api/items/get-items-types.js +2 -0
- package/dist/types/old/api/items/index.d.ts +5 -0
- package/dist/types/old/api/items/index.js +21 -0
- package/dist/types/old/api/items/update-item-types.d.ts +29 -0
- package/dist/types/old/api/items/update-item-types.js +12 -0
- package/dist/types/old/api/lists/complete-list-item-types.d.ts +14 -0
- package/dist/types/old/api/lists/complete-list-item-types.js +7 -0
- package/dist/types/old/api/lists/create-list-item-types.d.ts +22 -0
- package/dist/types/old/api/lists/create-list-item-types.js +10 -0
- package/dist/types/old/api/lists/create-list-types.d.ts +17 -0
- package/dist/types/old/api/lists/create-list-types.js +9 -0
- package/dist/types/old/api/lists/get-list-item-types.d.ts +5 -0
- package/dist/types/old/api/lists/get-list-item-types.js +2 -0
- package/dist/types/old/api/lists/get-lists-types.d.ts +5 -0
- package/dist/types/old/api/lists/get-lists-types.js +2 -0
- package/dist/types/old/api/lists/index.d.ts +7 -0
- package/dist/types/old/api/lists/index.js +23 -0
- package/dist/types/old/api/lists/update-list-item-types.d.ts +23 -0
- package/dist/types/old/api/lists/update-list-item-types.js +11 -0
- package/dist/types/old/api/lists/update-list-types.d.ts +17 -0
- package/dist/types/old/api/lists/update-list-types.js +9 -0
- package/dist/types/old/api/misc/index.d.ts +1 -0
- package/dist/types/old/api/misc/index.js +17 -0
- package/dist/types/old/api/misc/version-types.d.ts +9 -0
- package/dist/types/old/api/misc/version-types.js +2 -0
- package/dist/types/old/api/notifications/create-notification-template-types.d.ts +78 -0
- package/dist/types/old/api/notifications/create-notification-template-types.js +25 -0
- package/dist/types/old/api/notifications/delete-notification-template-types.d.ts +5 -0
- package/dist/types/old/api/notifications/delete-notification-template-types.js +6 -0
- package/dist/types/old/api/notifications/get-notification-templates-types.d.ts +8 -0
- package/dist/types/old/api/notifications/get-notification-templates-types.js +6 -0
- package/dist/types/old/api/notifications/index.d.ts +6 -0
- package/dist/types/old/api/notifications/index.js +22 -0
- package/dist/types/old/api/notifications/preview-notification-template-types.d.ts +29 -0
- package/dist/types/old/api/notifications/preview-notification-template-types.js +12 -0
- package/dist/types/old/api/notifications/sync-notification-template-types.d.ts +14 -0
- package/dist/types/old/api/notifications/sync-notification-template-types.js +8 -0
- package/dist/types/old/api/notifications/update-notification-template-types.d.ts +69 -0
- package/dist/types/old/api/notifications/update-notification-template-types.js +22 -0
- package/dist/types/old/api/people/create-person-note-types.d.ts +19 -0
- package/dist/types/old/api/people/create-person-note-types.js +9 -0
- package/dist/types/old/api/people/create-person-types.d.ts +35 -0
- package/dist/types/old/api/people/create-person-types.js +13 -0
- package/dist/types/old/api/people/delete-person-notes-types.d.ts +3 -0
- package/dist/types/old/api/people/delete-person-notes-types.js +2 -0
- package/dist/types/old/api/people/delete-person-types.d.ts +3 -0
- package/dist/types/old/api/people/delete-person-types.js +2 -0
- package/dist/types/old/api/people/get-people-types.d.ts +5 -0
- package/dist/types/old/api/people/get-people-types.js +2 -0
- package/dist/types/old/api/people/get-person-notes-types.d.ts +5 -0
- package/dist/types/old/api/people/get-person-notes-types.js +2 -0
- package/dist/types/old/api/people/index.d.ts +8 -0
- package/dist/types/old/api/people/index.js +24 -0
- package/dist/types/old/api/people/update-person-note-types.d.ts +14 -0
- package/dist/types/old/api/people/update-person-note-types.js +7 -0
- package/dist/types/old/api/people/update-person-types.d.ts +35 -0
- package/dist/types/old/api/people/update-person-types.js +13 -0
- package/dist/types/old/api/thoughts/create-thought-types.d.ts +14 -0
- package/dist/types/old/api/thoughts/create-thought-types.js +7 -0
- package/dist/types/old/api/thoughts/delete-thought-types.d.ts +3 -0
- package/dist/types/old/api/thoughts/delete-thought-types.js +2 -0
- package/dist/types/old/api/thoughts/get-thoughts-types.d.ts +5 -0
- package/dist/types/old/api/thoughts/get-thoughts-types.js +2 -0
- package/dist/types/old/api/thoughts/index.d.ts +4 -0
- package/dist/types/old/api/thoughts/index.js +20 -0
- package/dist/types/old/api/thoughts/update-thought-types.d.ts +14 -0
- package/dist/types/old/api/thoughts/update-thought-types.js +7 -0
- package/dist/types/old/auth-tokens.d.ts +11 -0
- package/dist/types/old/auth-tokens.js +2 -0
- package/dist/types/old/models/auth-data.d.ts +14 -0
- package/dist/types/old/models/auth-data.js +9 -0
- package/dist/types/old/models/habit-data.d.ts +48 -0
- package/dist/types/old/models/habit-data.js +25 -0
- package/dist/types/old/models/index.d.ts +10 -0
- package/dist/types/old/models/index.js +26 -0
- package/dist/types/old/models/item-data.d.ts +14 -0
- package/dist/types/old/models/item-data.js +2 -0
- package/dist/types/old/models/list-data.d.ts +23 -0
- package/dist/types/old/models/list-data.js +8 -0
- package/dist/types/old/models/notifiable.d.ts +42 -0
- package/dist/types/old/models/notifiable.js +2 -0
- package/dist/types/old/models/notification-template-data.d.ts +224 -0
- package/dist/types/old/models/notification-template-data.js +52 -0
- package/dist/types/old/models/person-data.d.ts +31 -0
- package/dist/types/old/models/person-data.js +2 -0
- package/dist/types/old/models/program-config.d.ts +25 -0
- package/dist/types/old/models/program-config.js +2 -0
- package/dist/types/old/models/thought-data.d.ts +8 -0
- package/dist/types/old/models/thought-data.js +2 -0
- package/dist/types/old/models/user-data.d.ts +147 -0
- package/dist/types/old/models/user-data.js +42 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/type-helpers.d.ts +4 -0
- package/dist/utils/type-helpers.js +19 -0
- package/package.json +1 -1
- package/src/types/id-types.ts +2 -2
- package/src/types/index.ts +4 -3
- package/src/types/new/agenda-types.ts +69 -0
- package/src/types/new/auth-types.ts +92 -0
- package/src/types/new/habits-types.ts +112 -0
- package/src/types/new/index.ts +10 -0
- package/src/types/new/lists-types.ts +108 -0
- package/src/types/new/misc/index.ts +1 -0
- package/src/types/new/misc/version-types.ts +15 -0
- package/src/types/new/notifications-types.ts +144 -0
- package/src/types/new/people-types.ts +110 -0
- package/src/types/new/program-config-types.ts +29 -0
- package/src/types/new/thoughts-types.ts +44 -0
- package/src/types/new/user-types.ts +61 -0
- package/src/types/{api → old/api}/account/get-user-types.ts +1 -1
- package/src/types/{api → old/api}/account/update-user-types.ts +1 -1
- package/src/types/{api → old/api}/auth/create-account-types.ts +1 -1
- package/src/types/{api → old/api}/habits/create-habit-entry-types.ts +2 -2
- package/src/types/{api → old/api}/habits/create-habit-types.ts +1 -1
- package/src/types/{api → old/api}/habits/delete-habit-entry-types.ts +1 -1
- package/src/types/{api → old/api}/habits/get-habits-types.ts +1 -1
- package/src/types/{api → old/api}/habits/update-habit-types.ts +1 -1
- package/src/types/{api → old/api}/items/complete-item-types.ts +1 -1
- package/src/types/{api → old/api}/items/create-item-types.ts +1 -1
- package/src/types/{api → old/api}/items/get-items-types.ts +1 -1
- package/src/types/{api → old/api}/items/update-item-types.ts +1 -1
- package/src/types/{api → old/api}/lists/complete-list-item-types.ts +1 -1
- package/src/types/{api → old/api}/lists/create-list-item-types.ts +2 -2
- package/src/types/{api → old/api}/lists/create-list-types.ts +1 -1
- package/src/types/{api → old/api}/lists/get-list-item-types.ts +1 -1
- package/src/types/{api → old/api}/lists/get-lists-types.ts +1 -1
- package/src/types/{api → old/api}/lists/update-list-item-types.ts +2 -2
- package/src/types/{api → old/api}/lists/update-list-types.ts +1 -1
- package/src/types/{api → old/api}/notifications/create-notification-template-types.ts +4 -13
- package/src/types/old/api/notifications/delete-notification-template-types.ts +8 -0
- package/src/types/old/api/notifications/get-notification-templates-types.ts +12 -0
- package/src/types/old/api/notifications/preview-notification-template-types.ts +21 -0
- package/src/types/old/api/notifications/sync-notification-template-types.ts +14 -0
- package/src/types/{api → old/api}/notifications/update-notification-template-types.ts +5 -12
- package/src/types/{api → old/api}/people/create-person-note-types.ts +2 -2
- package/src/types/{api → old/api}/people/create-person-types.ts +2 -2
- package/src/types/{api → old/api}/people/get-people-types.ts +1 -1
- package/src/types/{api → old/api}/people/get-person-notes-types.ts +1 -1
- package/src/types/{api → old/api}/people/update-person-note-types.ts +1 -1
- package/src/types/{api → old/api}/people/update-person-types.ts +2 -2
- package/src/types/{api → old/api}/thoughts/create-thought-types.ts +1 -1
- package/src/types/{api → old/api}/thoughts/get-thoughts-types.ts +1 -1
- package/src/types/{api → old/api}/thoughts/update-thought-types.ts +1 -1
- package/src/types/{models → old/models}/auth-data.ts +1 -1
- package/src/types/{models → old/models}/habit-data.ts +2 -2
- package/src/types/{models → old/models}/item-data.ts +1 -1
- package/src/types/{models → old/models}/list-data.ts +1 -1
- package/src/types/{models → old/models}/notification-template-data.ts +1 -1
- package/src/types/{models → old/models}/person-data.ts +1 -1
- package/src/types/{models → old/models}/thought-data.ts +1 -1
- package/src/types/{models → old/models}/user-data.ts +2 -2
- package/src/utils/index.ts +2 -1
- package/src/utils/type-helpers.ts +19 -0
- package/src/types/api/notifications/delete-notification-template-types.ts +0 -14
- package/src/types/api/notifications/get-notification-templates-types.ts +0 -21
- package/src/types/api/notifications/preview-notification-template-types.ts +0 -26
- package/src/types/api/notifications/sync-notification-template-types.ts +0 -23
- /package/src/types/{api → old/api}/account/index.ts +0 -0
- /package/src/types/{api → old/api}/auth/index.ts +0 -0
- /package/src/types/{api → old/api}/auth/refresh-auth-types.ts +0 -0
- /package/src/types/{api → old/api}/auth/resend-verification-types.ts +0 -0
- /package/src/types/{api → old/api}/auth/sign-in-types.ts +0 -0
- /package/src/types/{api → old/api}/auth/verify-email-types.ts +0 -0
- /package/src/types/{api → old/api}/habits/delete-habit-types.ts +0 -0
- /package/src/types/{api → old/api}/habits/index.ts +0 -0
- /package/src/types/{api → old/api}/index.ts +0 -0
- /package/src/types/{api → old/api}/items/delete-item-types.ts +0 -0
- /package/src/types/{api → old/api}/items/index.ts +0 -0
- /package/src/types/{api → old/api}/lists/index.ts +0 -0
- /package/src/types/{api → old/api}/misc/index.ts +0 -0
- /package/src/types/{api → old/api}/misc/version-types.ts +0 -0
- /package/src/types/{api → old/api}/notifications/index.ts +0 -0
- /package/src/types/{api → old/api}/people/delete-person-notes-types.ts +0 -0
- /package/src/types/{api → old/api}/people/delete-person-types.ts +0 -0
- /package/src/types/{api → old/api}/people/index.ts +0 -0
- /package/src/types/{api → old/api}/thoughts/delete-thought-types.ts +0 -0
- /package/src/types/{api → old/api}/thoughts/index.ts +0 -0
- /package/src/types/{auth-tokens.ts → old/auth-tokens.ts} +0 -0
- /package/src/types/{models → old/models}/index.ts +0 -0
- /package/src/types/{models → old/models}/notifiable.ts +0 -0
- /package/src/types/{models → old/models}/program-config.ts +0 -0
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { Serialized } from "
|
|
2
|
+
import { Serialized } from "../../../../utils";
|
|
3
3
|
import {
|
|
4
4
|
NotificationTemplateData,
|
|
5
|
-
notificationTriggerTypeSchema
|
|
6
|
-
notificationTemplateDataSchema
|
|
5
|
+
notificationTriggerTypeSchema
|
|
7
6
|
} from "../../models";
|
|
8
7
|
|
|
9
8
|
// Request schema
|
|
@@ -26,12 +25,6 @@ export const updateNotificationTemplateRequestSchema = z.object({
|
|
|
26
25
|
|
|
27
26
|
export type UpdateNotificationTemplateRequest = z.infer<typeof updateNotificationTemplateRequestSchema>;
|
|
28
27
|
|
|
29
|
-
export
|
|
30
|
-
template:
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export type UpdateNotificationTemplateResponse = {
|
|
34
|
-
success: boolean;
|
|
35
|
-
template?: Serialized<NotificationTemplateData>;
|
|
36
|
-
error?: string;
|
|
37
|
-
};
|
|
28
|
+
export interface UpdateNotificationTemplateResponse {
|
|
29
|
+
template: Serialized<NotificationTemplateData>;
|
|
30
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { personIdSchema } from "
|
|
2
|
+
import { personIdSchema } from "../../../id-types";
|
|
3
3
|
import { PersonNoteData } from "../../models";
|
|
4
|
-
import { Serialized } from "
|
|
4
|
+
import { Serialized } from "../../../../utils";
|
|
5
5
|
|
|
6
6
|
export const createPersonNoteRequestSchema = z.object({
|
|
7
7
|
personId: personIdSchema,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { personNoteIdSchema } from "
|
|
2
|
+
import { personNoteIdSchema } from "../../../id-types";
|
|
3
3
|
import { Person } from "../../models";
|
|
4
|
-
import { Serialized } from "
|
|
4
|
+
import { Serialized } from "../../../../utils";
|
|
5
5
|
|
|
6
6
|
export const createPersonRequestSchema = z.object({
|
|
7
7
|
name: z.string().min(1),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { personNoteIdSchema } from "
|
|
2
|
+
import { personNoteIdSchema } from "../../../id-types";
|
|
3
3
|
import { Person } from "../../models";
|
|
4
|
-
import { Serialized } from "
|
|
4
|
+
import { Serialized } from "../../../../utils";
|
|
5
5
|
|
|
6
6
|
export const updatePersonRequestSchema = z.object({
|
|
7
7
|
name: z.string().min(1).optional(),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { DateOnlyString } from "
|
|
2
|
-
import { HabitEntryId, HabitId, UserId } from "
|
|
1
|
+
import { DateOnlyString } from "../../misc-types";
|
|
2
|
+
import { HabitEntryId, HabitId, UserId } from "../../id-types";
|
|
3
3
|
|
|
4
4
|
export enum HabitFrequency {
|
|
5
5
|
DAILY = 'daily',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { NotificationTemplateId, UserId } from "
|
|
2
|
+
import { NotificationTemplateId, UserId } from "../../id-types";
|
|
3
3
|
|
|
4
4
|
export const notificationEntityTypeSchema = z.enum([
|
|
5
5
|
// Individual entity types (notifications FOR the entity itself)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { userIdSchema } from "
|
|
3
|
-
import { ModuleType } from "
|
|
2
|
+
import { userIdSchema } from "../../id-types";
|
|
3
|
+
import { ModuleType } from "../../../enums";
|
|
4
4
|
|
|
5
5
|
const moduleSchema = z.object({
|
|
6
6
|
type: z.nativeEnum(ModuleType),
|
package/src/utils/index.ts
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AuthData, PublicAuthData } from '../types';
|
|
2
|
+
import { HabitData, HabitEntryData, HabitStats, Habit } from '../types';
|
|
3
|
+
|
|
4
|
+
// export type PublicAuthData = Pick<AuthData, 'email' | 'emailVerified'> & { readonly __brand: unique symbol };
|
|
5
|
+
|
|
6
|
+
export function toPublicAuthData(data: AuthData): PublicAuthData {
|
|
7
|
+
return {
|
|
8
|
+
email: data.email,
|
|
9
|
+
emailVerified: data.emailVerified
|
|
10
|
+
} as PublicAuthData;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const toHabit = (data: HabitData, entries: HabitEntryData[], stats: HabitStats): Habit => {
|
|
14
|
+
return {
|
|
15
|
+
...data,
|
|
16
|
+
entries,
|
|
17
|
+
stats
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
// Request schema - no body needed for DELETE
|
|
4
|
-
export const deleteNotificationTemplateRequestSchema = z.object({});
|
|
5
|
-
|
|
6
|
-
export type DeleteNotificationTemplateRequest = z.infer<typeof deleteNotificationTemplateRequestSchema>;
|
|
7
|
-
|
|
8
|
-
// Response schema
|
|
9
|
-
export const deleteNotificationTemplateResponseSchema = z.object({
|
|
10
|
-
success: z.boolean(),
|
|
11
|
-
error: z.string().optional()
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
export type DeleteNotificationTemplateResponse = z.infer<typeof deleteNotificationTemplateResponseSchema>;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { Serialized } from "../../../utils";
|
|
3
|
-
import { NotificationTemplateData } from "../../models/notification-template-data";
|
|
4
|
-
|
|
5
|
-
// Request schema - no body needed for GET
|
|
6
|
-
export const getNotificationTemplatesRequestSchema = z.object({});
|
|
7
|
-
|
|
8
|
-
export type GetNotificationTemplatesRequest = z.infer<typeof getNotificationTemplatesRequestSchema>;
|
|
9
|
-
|
|
10
|
-
// Response schema
|
|
11
|
-
export const getNotificationTemplatesResponseSchema = z.object({
|
|
12
|
-
success: z.boolean(),
|
|
13
|
-
templates: z.array(z.any()).optional(), // Will be Serialized<NotificationTemplateData>[]
|
|
14
|
-
error: z.string().optional()
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
export type GetNotificationTemplatesResponse = {
|
|
18
|
-
success: boolean;
|
|
19
|
-
templates?: Serialized<NotificationTemplateData>[];
|
|
20
|
-
error?: string;
|
|
21
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
// Request schema
|
|
4
|
-
export const previewNotificationTemplateRequestSchema = z.object({
|
|
5
|
-
templateTitle: z.string(),
|
|
6
|
-
templateBody: z.string(),
|
|
7
|
-
entityType: z.string(),
|
|
8
|
-
entityId: z.string(),
|
|
9
|
-
variables: z.record(z.any()).optional()
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
export type PreviewNotificationTemplateRequest = z.infer<typeof previewNotificationTemplateRequestSchema>;
|
|
13
|
-
|
|
14
|
-
// Response schema
|
|
15
|
-
export const previewNotificationTemplateResponseSchema = z.object({
|
|
16
|
-
success: z.boolean(),
|
|
17
|
-
preview: z.object({
|
|
18
|
-
title: z.string(),
|
|
19
|
-
body: z.string(),
|
|
20
|
-
variables: z.record(z.any())
|
|
21
|
-
}).optional(),
|
|
22
|
-
missingVariables: z.array(z.string()).optional(),
|
|
23
|
-
error: z.string().optional()
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
export type PreviewNotificationTemplateResponse = z.infer<typeof previewNotificationTemplateResponseSchema>;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { Serialized } from "../../../utils";
|
|
3
|
-
import { NotificationTemplateData } from "../../models/notification-template-data";
|
|
4
|
-
|
|
5
|
-
// Request schema
|
|
6
|
-
export const syncNotificationTemplateRequestSchema = z.object({
|
|
7
|
-
sync: z.boolean() // true to sync with parent, false to unsync
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
export type SyncNotificationTemplateRequest = z.infer<typeof syncNotificationTemplateRequestSchema>;
|
|
11
|
-
|
|
12
|
-
// Response schema
|
|
13
|
-
export const syncNotificationTemplateResponseSchema = z.object({
|
|
14
|
-
success: z.boolean(),
|
|
15
|
-
template: z.any().optional(), // Will be Serialized<NotificationTemplateData>
|
|
16
|
-
error: z.string().optional()
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
export type SyncNotificationTemplateResponse = {
|
|
20
|
-
success: boolean;
|
|
21
|
-
template?: Serialized<NotificationTemplateData>;
|
|
22
|
-
error?: string;
|
|
23
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|