@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
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.previewNotificationTemplateRequestSchema = exports.syncNotificationTemplateRequestSchema = exports.updateNotificationTemplateRequestSchema = exports.createNotificationTemplateRequestSchema = exports.entitySyncStateSchema = exports.createNotificationTemplateSchema = exports.notificationTemplateSchema = exports.notificationContentSchema = exports.notificationTriggerSchema = exports.notificationTriggerTypeSchema = exports.notificationEntityTypeSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const id_types_1 = require("../id-types");
|
|
6
|
+
exports.notificationEntityTypeSchema = zod_1.z.enum([
|
|
7
|
+
'agenda', 'tasks', 'habits', 'inbox',
|
|
8
|
+
'agenda_item', 'habit',
|
|
9
|
+
'agenda_defaults', 'habits_defaults'
|
|
10
|
+
]);
|
|
11
|
+
exports.notificationTriggerTypeSchema = zod_1.z.enum(['time_based', 'event_based', 'recurring']);
|
|
12
|
+
exports.notificationTriggerSchema = zod_1.z.object({
|
|
13
|
+
type: exports.notificationTriggerTypeSchema,
|
|
14
|
+
conditions: zod_1.z.record(zod_1.z.any()),
|
|
15
|
+
timing: zod_1.z.record(zod_1.z.any())
|
|
16
|
+
});
|
|
17
|
+
exports.notificationContentSchema = zod_1.z.object({
|
|
18
|
+
title: zod_1.z.string(),
|
|
19
|
+
body: zod_1.z.string(),
|
|
20
|
+
variables: zod_1.z.record(zod_1.z.string()).optional()
|
|
21
|
+
});
|
|
22
|
+
exports.notificationTemplateSchema = zod_1.z.object({
|
|
23
|
+
_id: id_types_1.notificationTemplateIdSchema,
|
|
24
|
+
userId: id_types_1.userIdSchema,
|
|
25
|
+
entityType: exports.notificationEntityTypeSchema,
|
|
26
|
+
entityId: zod_1.z.string().optional(),
|
|
27
|
+
name: zod_1.z.string(),
|
|
28
|
+
description: zod_1.z.string().optional(),
|
|
29
|
+
trigger: exports.notificationTriggerSchema,
|
|
30
|
+
content: exports.notificationContentSchema,
|
|
31
|
+
active: zod_1.z.boolean(),
|
|
32
|
+
inheritedFrom: id_types_1.notificationTemplateIdSchema.optional(),
|
|
33
|
+
customized: zod_1.z.boolean(),
|
|
34
|
+
createdAt: zod_1.z.date(),
|
|
35
|
+
updatedAt: zod_1.z.date()
|
|
36
|
+
});
|
|
37
|
+
exports.createNotificationTemplateSchema = exports.notificationTemplateSchema.omit({
|
|
38
|
+
_id: true,
|
|
39
|
+
createdAt: true,
|
|
40
|
+
updatedAt: true
|
|
41
|
+
});
|
|
42
|
+
exports.entitySyncStateSchema = zod_1.z.object({
|
|
43
|
+
userId: id_types_1.userIdSchema,
|
|
44
|
+
entityType: exports.notificationEntityTypeSchema,
|
|
45
|
+
entityId: zod_1.z.string(),
|
|
46
|
+
synced: zod_1.z.boolean(),
|
|
47
|
+
updatedAt: zod_1.z.date()
|
|
48
|
+
});
|
|
49
|
+
exports.createNotificationTemplateRequestSchema = zod_1.z.object({
|
|
50
|
+
entityType: exports.notificationEntityTypeSchema,
|
|
51
|
+
entityId: zod_1.z.string().optional(),
|
|
52
|
+
name: zod_1.z.string().min(1).max(100),
|
|
53
|
+
description: zod_1.z.string().max(500).optional(),
|
|
54
|
+
trigger: zod_1.z.object({
|
|
55
|
+
type: exports.notificationTriggerTypeSchema,
|
|
56
|
+
conditions: zod_1.z.record(zod_1.z.any()),
|
|
57
|
+
timing: zod_1.z.record(zod_1.z.any())
|
|
58
|
+
}),
|
|
59
|
+
content: zod_1.z.object({
|
|
60
|
+
title: zod_1.z.string().min(1).max(200),
|
|
61
|
+
body: zod_1.z.string().min(1).max(1000),
|
|
62
|
+
variables: zod_1.z.record(zod_1.z.string()).optional()
|
|
63
|
+
}),
|
|
64
|
+
active: zod_1.z.boolean().default(true),
|
|
65
|
+
inheritedFrom: zod_1.z.string().optional(),
|
|
66
|
+
customized: zod_1.z.boolean().default(false)
|
|
67
|
+
});
|
|
68
|
+
exports.updateNotificationTemplateRequestSchema = zod_1.z.object({
|
|
69
|
+
name: zod_1.z.string().optional(),
|
|
70
|
+
description: zod_1.z.string().optional(),
|
|
71
|
+
trigger: zod_1.z.object({
|
|
72
|
+
type: exports.notificationTriggerTypeSchema,
|
|
73
|
+
conditions: zod_1.z.record(zod_1.z.any()),
|
|
74
|
+
timing: zod_1.z.record(zod_1.z.any())
|
|
75
|
+
}).optional(),
|
|
76
|
+
content: zod_1.z.object({
|
|
77
|
+
title: zod_1.z.string(),
|
|
78
|
+
body: zod_1.z.string(),
|
|
79
|
+
variables: zod_1.z.record(zod_1.z.string()).optional()
|
|
80
|
+
}).optional(),
|
|
81
|
+
active: zod_1.z.boolean().optional(),
|
|
82
|
+
customized: zod_1.z.boolean().optional()
|
|
83
|
+
});
|
|
84
|
+
exports.syncNotificationTemplateRequestSchema = zod_1.z.object({
|
|
85
|
+
entityType: exports.notificationEntityTypeSchema,
|
|
86
|
+
entityId: zod_1.z.string()
|
|
87
|
+
});
|
|
88
|
+
exports.previewNotificationTemplateRequestSchema = zod_1.z.object({
|
|
89
|
+
templateId: id_types_1.notificationTemplateIdSchema,
|
|
90
|
+
entityData: zod_1.z.record(zod_1.z.any()).optional()
|
|
91
|
+
});
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Serialized } from '../../utils';
|
|
3
|
+
export declare const personPropertySchema: z.ZodObject<{
|
|
4
|
+
key: z.ZodString;
|
|
5
|
+
value: z.ZodString;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
key: string;
|
|
8
|
+
value: string;
|
|
9
|
+
}, {
|
|
10
|
+
key: string;
|
|
11
|
+
value: string;
|
|
12
|
+
}>;
|
|
13
|
+
export declare const personNoteSchema: z.ZodObject<{
|
|
14
|
+
_id: z.ZodEffects<z.ZodString, import("../id-types").PersonNoteId, string>;
|
|
15
|
+
personId: z.ZodEffects<z.ZodString, import("../id-types").PersonId, string>;
|
|
16
|
+
userId: z.ZodEffects<z.ZodString, import("../id-types").UserId, string>;
|
|
17
|
+
content: z.ZodString;
|
|
18
|
+
createdAt: z.ZodDate;
|
|
19
|
+
updatedAt: z.ZodDate;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
_id: string & {
|
|
22
|
+
readonly __brand: "PersonNoteId";
|
|
23
|
+
};
|
|
24
|
+
createdAt: Date;
|
|
25
|
+
updatedAt: Date;
|
|
26
|
+
userId: string & {
|
|
27
|
+
readonly __brand: "UserId";
|
|
28
|
+
};
|
|
29
|
+
content: string;
|
|
30
|
+
personId: string & {
|
|
31
|
+
readonly __brand: "PersonId";
|
|
32
|
+
};
|
|
33
|
+
}, {
|
|
34
|
+
_id: string;
|
|
35
|
+
createdAt: Date;
|
|
36
|
+
updatedAt: Date;
|
|
37
|
+
userId: string;
|
|
38
|
+
content: string;
|
|
39
|
+
personId: string;
|
|
40
|
+
}>;
|
|
41
|
+
export declare const personDataSchema: z.ZodObject<{
|
|
42
|
+
_id: z.ZodEffects<z.ZodString, import("../id-types").PersonId, string>;
|
|
43
|
+
userId: z.ZodEffects<z.ZodString, import("../id-types").UserId, string>;
|
|
44
|
+
createdAt: z.ZodDate;
|
|
45
|
+
updatedAt: z.ZodDate;
|
|
46
|
+
name: z.ZodString;
|
|
47
|
+
properties: z.ZodArray<z.ZodObject<{
|
|
48
|
+
key: z.ZodString;
|
|
49
|
+
value: z.ZodString;
|
|
50
|
+
}, "strip", z.ZodTypeAny, {
|
|
51
|
+
key: string;
|
|
52
|
+
value: string;
|
|
53
|
+
}, {
|
|
54
|
+
key: string;
|
|
55
|
+
value: string;
|
|
56
|
+
}>, "many">;
|
|
57
|
+
noteIds: z.ZodArray<z.ZodEffects<z.ZodString, import("../id-types").PersonNoteId, string>, "many">;
|
|
58
|
+
}, "strip", z.ZodTypeAny, {
|
|
59
|
+
_id: string & {
|
|
60
|
+
readonly __brand: "PersonId";
|
|
61
|
+
};
|
|
62
|
+
createdAt: Date;
|
|
63
|
+
updatedAt: Date;
|
|
64
|
+
userId: string & {
|
|
65
|
+
readonly __brand: "UserId";
|
|
66
|
+
};
|
|
67
|
+
name: string;
|
|
68
|
+
properties: {
|
|
69
|
+
key: string;
|
|
70
|
+
value: string;
|
|
71
|
+
}[];
|
|
72
|
+
noteIds: import("../id-types").PersonNoteId[];
|
|
73
|
+
}, {
|
|
74
|
+
_id: string;
|
|
75
|
+
createdAt: Date;
|
|
76
|
+
updatedAt: Date;
|
|
77
|
+
userId: string;
|
|
78
|
+
name: string;
|
|
79
|
+
properties: {
|
|
80
|
+
key: string;
|
|
81
|
+
value: string;
|
|
82
|
+
}[];
|
|
83
|
+
noteIds: string[];
|
|
84
|
+
}>;
|
|
85
|
+
export declare const personSchema: z.ZodObject<{
|
|
86
|
+
_id: z.ZodEffects<z.ZodString, import("../id-types").PersonId, string>;
|
|
87
|
+
userId: z.ZodEffects<z.ZodString, import("../id-types").UserId, string>;
|
|
88
|
+
createdAt: z.ZodDate;
|
|
89
|
+
updatedAt: z.ZodDate;
|
|
90
|
+
name: z.ZodString;
|
|
91
|
+
properties: z.ZodArray<z.ZodObject<{
|
|
92
|
+
key: z.ZodString;
|
|
93
|
+
value: z.ZodString;
|
|
94
|
+
}, "strip", z.ZodTypeAny, {
|
|
95
|
+
key: string;
|
|
96
|
+
value: string;
|
|
97
|
+
}, {
|
|
98
|
+
key: string;
|
|
99
|
+
value: string;
|
|
100
|
+
}>, "many">;
|
|
101
|
+
notes: z.ZodArray<z.ZodObject<{
|
|
102
|
+
_id: z.ZodEffects<z.ZodString, import("../id-types").PersonNoteId, string>;
|
|
103
|
+
personId: z.ZodEffects<z.ZodString, import("../id-types").PersonId, string>;
|
|
104
|
+
userId: z.ZodEffects<z.ZodString, import("../id-types").UserId, string>;
|
|
105
|
+
content: z.ZodString;
|
|
106
|
+
createdAt: z.ZodDate;
|
|
107
|
+
updatedAt: z.ZodDate;
|
|
108
|
+
}, "strip", z.ZodTypeAny, {
|
|
109
|
+
_id: string & {
|
|
110
|
+
readonly __brand: "PersonNoteId";
|
|
111
|
+
};
|
|
112
|
+
createdAt: Date;
|
|
113
|
+
updatedAt: Date;
|
|
114
|
+
userId: string & {
|
|
115
|
+
readonly __brand: "UserId";
|
|
116
|
+
};
|
|
117
|
+
content: string;
|
|
118
|
+
personId: string & {
|
|
119
|
+
readonly __brand: "PersonId";
|
|
120
|
+
};
|
|
121
|
+
}, {
|
|
122
|
+
_id: string;
|
|
123
|
+
createdAt: Date;
|
|
124
|
+
updatedAt: Date;
|
|
125
|
+
userId: string;
|
|
126
|
+
content: string;
|
|
127
|
+
personId: string;
|
|
128
|
+
}>, "many">;
|
|
129
|
+
}, "strip", z.ZodTypeAny, {
|
|
130
|
+
_id: string & {
|
|
131
|
+
readonly __brand: "PersonId";
|
|
132
|
+
};
|
|
133
|
+
createdAt: Date;
|
|
134
|
+
updatedAt: Date;
|
|
135
|
+
userId: string & {
|
|
136
|
+
readonly __brand: "UserId";
|
|
137
|
+
};
|
|
138
|
+
name: string;
|
|
139
|
+
notes: {
|
|
140
|
+
_id: string & {
|
|
141
|
+
readonly __brand: "PersonNoteId";
|
|
142
|
+
};
|
|
143
|
+
createdAt: Date;
|
|
144
|
+
updatedAt: Date;
|
|
145
|
+
userId: string & {
|
|
146
|
+
readonly __brand: "UserId";
|
|
147
|
+
};
|
|
148
|
+
content: string;
|
|
149
|
+
personId: string & {
|
|
150
|
+
readonly __brand: "PersonId";
|
|
151
|
+
};
|
|
152
|
+
}[];
|
|
153
|
+
properties: {
|
|
154
|
+
key: string;
|
|
155
|
+
value: string;
|
|
156
|
+
}[];
|
|
157
|
+
}, {
|
|
158
|
+
_id: string;
|
|
159
|
+
createdAt: Date;
|
|
160
|
+
updatedAt: Date;
|
|
161
|
+
userId: string;
|
|
162
|
+
name: string;
|
|
163
|
+
notes: {
|
|
164
|
+
_id: string;
|
|
165
|
+
createdAt: Date;
|
|
166
|
+
updatedAt: Date;
|
|
167
|
+
userId: string;
|
|
168
|
+
content: string;
|
|
169
|
+
personId: string;
|
|
170
|
+
}[];
|
|
171
|
+
properties: {
|
|
172
|
+
key: string;
|
|
173
|
+
value: string;
|
|
174
|
+
}[];
|
|
175
|
+
}>;
|
|
176
|
+
export declare const createPersonRequestSchema: z.ZodObject<{
|
|
177
|
+
name: z.ZodString;
|
|
178
|
+
properties: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
179
|
+
key: z.ZodString;
|
|
180
|
+
value: z.ZodString;
|
|
181
|
+
}, "strip", z.ZodTypeAny, {
|
|
182
|
+
key: string;
|
|
183
|
+
value: string;
|
|
184
|
+
}, {
|
|
185
|
+
key: string;
|
|
186
|
+
value: string;
|
|
187
|
+
}>, "many">>;
|
|
188
|
+
notes: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, import("../id-types").PersonNoteId, string>, "many">>;
|
|
189
|
+
}, "strip", z.ZodTypeAny, {
|
|
190
|
+
name: string;
|
|
191
|
+
notes?: import("../id-types").PersonNoteId[] | undefined;
|
|
192
|
+
properties?: {
|
|
193
|
+
key: string;
|
|
194
|
+
value: string;
|
|
195
|
+
}[] | undefined;
|
|
196
|
+
}, {
|
|
197
|
+
name: string;
|
|
198
|
+
notes?: string[] | undefined;
|
|
199
|
+
properties?: {
|
|
200
|
+
key: string;
|
|
201
|
+
value: string;
|
|
202
|
+
}[] | undefined;
|
|
203
|
+
}>;
|
|
204
|
+
export declare const updatePersonRequestSchema: z.ZodObject<{
|
|
205
|
+
name: z.ZodOptional<z.ZodString>;
|
|
206
|
+
properties: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
207
|
+
key: z.ZodString;
|
|
208
|
+
value: z.ZodString;
|
|
209
|
+
}, "strip", z.ZodTypeAny, {
|
|
210
|
+
key: string;
|
|
211
|
+
value: string;
|
|
212
|
+
}, {
|
|
213
|
+
key: string;
|
|
214
|
+
value: string;
|
|
215
|
+
}>, "many">>;
|
|
216
|
+
noteIds: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, import("../id-types").PersonNoteId, string>, "many">>;
|
|
217
|
+
}, "strip", z.ZodTypeAny, {
|
|
218
|
+
name?: string | undefined;
|
|
219
|
+
properties?: {
|
|
220
|
+
key: string;
|
|
221
|
+
value: string;
|
|
222
|
+
}[] | undefined;
|
|
223
|
+
noteIds?: import("../id-types").PersonNoteId[] | undefined;
|
|
224
|
+
}, {
|
|
225
|
+
name?: string | undefined;
|
|
226
|
+
properties?: {
|
|
227
|
+
key: string;
|
|
228
|
+
value: string;
|
|
229
|
+
}[] | undefined;
|
|
230
|
+
noteIds?: string[] | undefined;
|
|
231
|
+
}>;
|
|
232
|
+
export declare const createPersonNoteRequestSchema: z.ZodObject<{
|
|
233
|
+
personId: z.ZodEffects<z.ZodString, import("../id-types").PersonId, string>;
|
|
234
|
+
content: z.ZodString;
|
|
235
|
+
}, "strip", z.ZodTypeAny, {
|
|
236
|
+
content: string;
|
|
237
|
+
personId: string & {
|
|
238
|
+
readonly __brand: "PersonId";
|
|
239
|
+
};
|
|
240
|
+
}, {
|
|
241
|
+
content: string;
|
|
242
|
+
personId: string;
|
|
243
|
+
}>;
|
|
244
|
+
export declare const updatePersonNoteRequestSchema: z.ZodObject<{
|
|
245
|
+
content: z.ZodString;
|
|
246
|
+
}, "strip", z.ZodTypeAny, {
|
|
247
|
+
content: string;
|
|
248
|
+
}, {
|
|
249
|
+
content: string;
|
|
250
|
+
}>;
|
|
251
|
+
export type PersonPropertyData = z.infer<typeof personPropertySchema>;
|
|
252
|
+
export type PersonNoteData = z.infer<typeof personNoteSchema>;
|
|
253
|
+
export type PersonData = z.infer<typeof personDataSchema>;
|
|
254
|
+
export type Person = z.infer<typeof personSchema>;
|
|
255
|
+
export type CreatePersonRequest = z.infer<typeof createPersonRequestSchema>;
|
|
256
|
+
export type UpdatePersonRequest = z.infer<typeof updatePersonRequestSchema>;
|
|
257
|
+
export type CreatePersonNoteRequest = z.infer<typeof createPersonNoteRequestSchema>;
|
|
258
|
+
export type UpdatePersonNoteRequest = z.infer<typeof updatePersonNoteRequestSchema>;
|
|
259
|
+
export interface CreatePersonResponse {
|
|
260
|
+
person: Serialized<Person>;
|
|
261
|
+
}
|
|
262
|
+
export interface GetPeopleResponse {
|
|
263
|
+
people: Serialized<Person>[];
|
|
264
|
+
}
|
|
265
|
+
export interface GetPersonResponse {
|
|
266
|
+
person: Serialized<Person>;
|
|
267
|
+
}
|
|
268
|
+
export interface UpdatePersonResponse {
|
|
269
|
+
person: Serialized<Person>;
|
|
270
|
+
}
|
|
271
|
+
export interface DeletePersonResponse {
|
|
272
|
+
deleted: boolean;
|
|
273
|
+
}
|
|
274
|
+
export interface CreatePersonNoteResponse {
|
|
275
|
+
personNote: Serialized<PersonNoteData>;
|
|
276
|
+
}
|
|
277
|
+
export interface GetPersonNotesResponse {
|
|
278
|
+
personNotes: Serialized<PersonNoteData>[];
|
|
279
|
+
}
|
|
280
|
+
export interface UpdatePersonNoteResponse {
|
|
281
|
+
personNote: Serialized<PersonNoteData>;
|
|
282
|
+
}
|
|
283
|
+
export interface DeletePersonNoteResponse {
|
|
284
|
+
deleted: boolean;
|
|
285
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updatePersonNoteRequestSchema = exports.createPersonNoteRequestSchema = exports.updatePersonRequestSchema = exports.createPersonRequestSchema = exports.personSchema = exports.personDataSchema = exports.personNoteSchema = exports.personPropertySchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const id_types_1 = require("../id-types");
|
|
6
|
+
exports.personPropertySchema = zod_1.z.object({
|
|
7
|
+
key: zod_1.z.string(),
|
|
8
|
+
value: zod_1.z.string()
|
|
9
|
+
});
|
|
10
|
+
exports.personNoteSchema = zod_1.z.object({
|
|
11
|
+
_id: id_types_1.personNoteIdSchema,
|
|
12
|
+
personId: id_types_1.personIdSchema,
|
|
13
|
+
userId: id_types_1.userIdSchema,
|
|
14
|
+
content: zod_1.z.string(),
|
|
15
|
+
createdAt: zod_1.z.date(),
|
|
16
|
+
updatedAt: zod_1.z.date()
|
|
17
|
+
});
|
|
18
|
+
exports.personDataSchema = zod_1.z.object({
|
|
19
|
+
_id: id_types_1.personIdSchema,
|
|
20
|
+
userId: id_types_1.userIdSchema,
|
|
21
|
+
createdAt: zod_1.z.date(),
|
|
22
|
+
updatedAt: zod_1.z.date(),
|
|
23
|
+
name: zod_1.z.string(),
|
|
24
|
+
properties: zod_1.z.array(exports.personPropertySchema),
|
|
25
|
+
noteIds: zod_1.z.array(id_types_1.personNoteIdSchema)
|
|
26
|
+
});
|
|
27
|
+
exports.personSchema = zod_1.z.object({
|
|
28
|
+
_id: id_types_1.personIdSchema,
|
|
29
|
+
userId: id_types_1.userIdSchema,
|
|
30
|
+
createdAt: zod_1.z.date(),
|
|
31
|
+
updatedAt: zod_1.z.date(),
|
|
32
|
+
name: zod_1.z.string(),
|
|
33
|
+
properties: zod_1.z.array(exports.personPropertySchema),
|
|
34
|
+
notes: zod_1.z.array(exports.personNoteSchema)
|
|
35
|
+
});
|
|
36
|
+
exports.createPersonRequestSchema = zod_1.z.object({
|
|
37
|
+
name: zod_1.z.string().min(1),
|
|
38
|
+
properties: zod_1.z.array(zod_1.z.object({
|
|
39
|
+
key: zod_1.z.string().min(1),
|
|
40
|
+
value: zod_1.z.string().min(1)
|
|
41
|
+
})).optional(),
|
|
42
|
+
notes: zod_1.z.array(id_types_1.personNoteIdSchema).optional()
|
|
43
|
+
});
|
|
44
|
+
exports.updatePersonRequestSchema = zod_1.z.object({
|
|
45
|
+
name: zod_1.z.string().min(1).optional(),
|
|
46
|
+
properties: zod_1.z.array(zod_1.z.object({
|
|
47
|
+
key: zod_1.z.string().min(1),
|
|
48
|
+
value: zod_1.z.string().min(1)
|
|
49
|
+
})).optional(),
|
|
50
|
+
noteIds: zod_1.z.array(id_types_1.personNoteIdSchema).optional()
|
|
51
|
+
});
|
|
52
|
+
exports.createPersonNoteRequestSchema = zod_1.z.object({
|
|
53
|
+
personId: id_types_1.personIdSchema,
|
|
54
|
+
content: zod_1.z.string().min(1)
|
|
55
|
+
});
|
|
56
|
+
exports.updatePersonNoteRequestSchema = zod_1.z.object({
|
|
57
|
+
content: zod_1.z.string().min(1)
|
|
58
|
+
});
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const programConfigSchema: z.ZodObject<{
|
|
3
|
+
_requiredBuildVersions: z.ZodObject<{
|
|
4
|
+
iOS: z.ZodNumber;
|
|
5
|
+
android: z.ZodNumber;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
iOS: number;
|
|
8
|
+
android: number;
|
|
9
|
+
}, {
|
|
10
|
+
iOS: number;
|
|
11
|
+
android: number;
|
|
12
|
+
}>;
|
|
13
|
+
dev: z.ZodObject<{
|
|
14
|
+
authorizedEmails: z.ZodArray<z.ZodString, "many">;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
authorizedEmails: string[];
|
|
17
|
+
}, {
|
|
18
|
+
authorizedEmails: string[];
|
|
19
|
+
}>;
|
|
20
|
+
discord: z.ZodObject<{
|
|
21
|
+
token: z.ZodString;
|
|
22
|
+
clientId: z.ZodString;
|
|
23
|
+
guildId: z.ZodString;
|
|
24
|
+
logChannelId: z.ZodOptional<z.ZodString>;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
token: string;
|
|
27
|
+
clientId: string;
|
|
28
|
+
guildId: string;
|
|
29
|
+
logChannelId?: string | undefined;
|
|
30
|
+
}, {
|
|
31
|
+
token: string;
|
|
32
|
+
clientId: string;
|
|
33
|
+
guildId: string;
|
|
34
|
+
logChannelId?: string | undefined;
|
|
35
|
+
}>;
|
|
36
|
+
mailjet: z.ZodObject<{
|
|
37
|
+
apiKey: z.ZodString;
|
|
38
|
+
secretKey: z.ZodString;
|
|
39
|
+
}, "strip", z.ZodTypeAny, {
|
|
40
|
+
apiKey: string;
|
|
41
|
+
secretKey: string;
|
|
42
|
+
}, {
|
|
43
|
+
apiKey: string;
|
|
44
|
+
secretKey: string;
|
|
45
|
+
}>;
|
|
46
|
+
expo: z.ZodObject<{
|
|
47
|
+
token: z.ZodString;
|
|
48
|
+
}, "strip", z.ZodTypeAny, {
|
|
49
|
+
token: string;
|
|
50
|
+
}, {
|
|
51
|
+
token: string;
|
|
52
|
+
}>;
|
|
53
|
+
redisUrl: z.ZodString;
|
|
54
|
+
updatedAt: z.ZodDate;
|
|
55
|
+
createdAt: z.ZodDate;
|
|
56
|
+
}, "strip", z.ZodTypeAny, {
|
|
57
|
+
dev: {
|
|
58
|
+
authorizedEmails: string[];
|
|
59
|
+
};
|
|
60
|
+
createdAt: Date;
|
|
61
|
+
updatedAt: Date;
|
|
62
|
+
_requiredBuildVersions: {
|
|
63
|
+
iOS: number;
|
|
64
|
+
android: number;
|
|
65
|
+
};
|
|
66
|
+
discord: {
|
|
67
|
+
token: string;
|
|
68
|
+
clientId: string;
|
|
69
|
+
guildId: string;
|
|
70
|
+
logChannelId?: string | undefined;
|
|
71
|
+
};
|
|
72
|
+
mailjet: {
|
|
73
|
+
apiKey: string;
|
|
74
|
+
secretKey: string;
|
|
75
|
+
};
|
|
76
|
+
expo: {
|
|
77
|
+
token: string;
|
|
78
|
+
};
|
|
79
|
+
redisUrl: string;
|
|
80
|
+
}, {
|
|
81
|
+
dev: {
|
|
82
|
+
authorizedEmails: string[];
|
|
83
|
+
};
|
|
84
|
+
createdAt: Date;
|
|
85
|
+
updatedAt: Date;
|
|
86
|
+
_requiredBuildVersions: {
|
|
87
|
+
iOS: number;
|
|
88
|
+
android: number;
|
|
89
|
+
};
|
|
90
|
+
discord: {
|
|
91
|
+
token: string;
|
|
92
|
+
clientId: string;
|
|
93
|
+
guildId: string;
|
|
94
|
+
logChannelId?: string | undefined;
|
|
95
|
+
};
|
|
96
|
+
mailjet: {
|
|
97
|
+
apiKey: string;
|
|
98
|
+
secretKey: string;
|
|
99
|
+
};
|
|
100
|
+
expo: {
|
|
101
|
+
token: string;
|
|
102
|
+
};
|
|
103
|
+
redisUrl: string;
|
|
104
|
+
}>;
|
|
105
|
+
export type ProgramConfigData = z.infer<typeof programConfigSchema>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.programConfigSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.programConfigSchema = zod_1.z.object({
|
|
6
|
+
_requiredBuildVersions: zod_1.z.object({
|
|
7
|
+
iOS: zod_1.z.number(),
|
|
8
|
+
android: zod_1.z.number()
|
|
9
|
+
}),
|
|
10
|
+
dev: zod_1.z.object({
|
|
11
|
+
authorizedEmails: zod_1.z.array(zod_1.z.string())
|
|
12
|
+
}),
|
|
13
|
+
discord: zod_1.z.object({
|
|
14
|
+
token: zod_1.z.string(),
|
|
15
|
+
clientId: zod_1.z.string(),
|
|
16
|
+
guildId: zod_1.z.string(),
|
|
17
|
+
logChannelId: zod_1.z.string().optional()
|
|
18
|
+
}),
|
|
19
|
+
mailjet: zod_1.z.object({
|
|
20
|
+
apiKey: zod_1.z.string(),
|
|
21
|
+
secretKey: zod_1.z.string()
|
|
22
|
+
}),
|
|
23
|
+
expo: zod_1.z.object({
|
|
24
|
+
token: zod_1.z.string()
|
|
25
|
+
}),
|
|
26
|
+
redisUrl: zod_1.z.string(),
|
|
27
|
+
updatedAt: zod_1.z.date(),
|
|
28
|
+
createdAt: zod_1.z.date()
|
|
29
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { Serialized } from '../../utils';
|
|
3
|
+
export declare const thoughtSchema: z.ZodObject<{
|
|
4
|
+
_id: z.ZodEffects<z.ZodString, import("../id-types").ThoughtId, string>;
|
|
5
|
+
userId: z.ZodEffects<z.ZodString, import("../id-types").UserId, string>;
|
|
6
|
+
createdAt: z.ZodDate;
|
|
7
|
+
updatedAt: z.ZodDate;
|
|
8
|
+
content: z.ZodString;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
_id: string & {
|
|
11
|
+
readonly __brand: "ThoughtId";
|
|
12
|
+
};
|
|
13
|
+
createdAt: Date;
|
|
14
|
+
updatedAt: Date;
|
|
15
|
+
userId: string & {
|
|
16
|
+
readonly __brand: "UserId";
|
|
17
|
+
};
|
|
18
|
+
content: string;
|
|
19
|
+
}, {
|
|
20
|
+
_id: string;
|
|
21
|
+
createdAt: Date;
|
|
22
|
+
updatedAt: Date;
|
|
23
|
+
userId: string;
|
|
24
|
+
content: string;
|
|
25
|
+
}>;
|
|
26
|
+
export declare const createThoughtRequestSchema: z.ZodObject<{
|
|
27
|
+
content: z.ZodString;
|
|
28
|
+
}, "strip", z.ZodTypeAny, {
|
|
29
|
+
content: string;
|
|
30
|
+
}, {
|
|
31
|
+
content: string;
|
|
32
|
+
}>;
|
|
33
|
+
export declare const updateThoughtRequestSchema: z.ZodObject<{
|
|
34
|
+
content: z.ZodString;
|
|
35
|
+
}, "strip", z.ZodTypeAny, {
|
|
36
|
+
content: string;
|
|
37
|
+
}, {
|
|
38
|
+
content: string;
|
|
39
|
+
}>;
|
|
40
|
+
export type ThoughtData = z.infer<typeof thoughtSchema>;
|
|
41
|
+
export type CreateThoughtRequest = z.infer<typeof createThoughtRequestSchema>;
|
|
42
|
+
export type UpdateThoughtRequest = z.infer<typeof updateThoughtRequestSchema>;
|
|
43
|
+
export interface CreateThoughtResponse {
|
|
44
|
+
thought: Serialized<ThoughtData>;
|
|
45
|
+
}
|
|
46
|
+
export interface GetThoughtsResponse {
|
|
47
|
+
thoughts: Serialized<ThoughtData>[];
|
|
48
|
+
}
|
|
49
|
+
export interface GetThoughtResponse {
|
|
50
|
+
thought: Serialized<ThoughtData>;
|
|
51
|
+
}
|
|
52
|
+
export interface UpdateThoughtResponse {
|
|
53
|
+
thought: Serialized<ThoughtData>;
|
|
54
|
+
}
|
|
55
|
+
export interface DeleteThoughtResponse {
|
|
56
|
+
deleted: boolean;
|
|
57
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateThoughtRequestSchema = exports.createThoughtRequestSchema = exports.thoughtSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const id_types_1 = require("../id-types");
|
|
6
|
+
exports.thoughtSchema = zod_1.z.object({
|
|
7
|
+
_id: id_types_1.thoughtIdSchema,
|
|
8
|
+
userId: id_types_1.userIdSchema,
|
|
9
|
+
createdAt: zod_1.z.date(),
|
|
10
|
+
updatedAt: zod_1.z.date(),
|
|
11
|
+
content: zod_1.z.string()
|
|
12
|
+
});
|
|
13
|
+
exports.createThoughtRequestSchema = zod_1.z.object({
|
|
14
|
+
content: zod_1.z.string().min(1)
|
|
15
|
+
});
|
|
16
|
+
exports.updateThoughtRequestSchema = zod_1.z.object({
|
|
17
|
+
content: zod_1.z.string().min(1)
|
|
18
|
+
});
|