@timothyw/pat-common 1.0.119 → 1.0.120
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/agenda-types.d.ts +115 -0
- package/dist/types/agenda-types.js +37 -0
- package/dist/types/auth-types.d.ts +153 -0
- package/dist/types/auth-types.js +48 -0
- package/dist/types/habits-types.d.ts +315 -0
- package/dist/types/habits-types.js +70 -0
- package/dist/types/index.d.ts +11 -3
- package/dist/types/index.js +11 -6
- package/dist/types/lists-types.d.ts +162 -0
- package/dist/types/lists-types.js +50 -0
- package/dist/types/misc/index.d.ts +3 -0
- package/dist/types/misc/index.js +19 -0
- package/dist/types/misc/misc-types.d.ts +8 -0
- package/dist/types/misc/misc-types.js +9 -0
- package/dist/types/misc/socket-message-types.d.ts +17 -0
- package/dist/types/misc/socket-message-types.js +12 -0
- package/dist/types/misc/version-types.d.ts +26 -0
- package/dist/types/misc/version-types.js +13 -0
- package/dist/types/notifications-types.d.ts +570 -0
- package/dist/types/notifications-types.js +149 -0
- package/dist/types/people-types.d.ts +283 -0
- package/dist/types/people-types.js +58 -0
- package/dist/types/program-config-types.d.ts +105 -0
- package/dist/types/program-config-types.js +29 -0
- package/dist/types/thoughts-types.d.ts +56 -0
- package/dist/types/thoughts-types.js +18 -0
- package/dist/types/user-types.d.ts +283 -0
- package/dist/types/user-types.js +46 -0
- package/package.json +1 -1
- package/src/types/{new/agenda-types.ts → agenda-types.ts} +2 -2
- package/src/types/{new/auth-types.ts → auth-types.ts} +1 -1
- package/src/types/{new/habits-types.ts → habits-types.ts} +3 -3
- package/src/types/index.ts +12 -7
- package/src/types/{new/lists-types.ts → lists-types.ts} +2 -2
- package/src/types/misc/index.ts +3 -0
- package/src/types/{new/notifications-types.ts → notifications-types.ts} +56 -12
- package/src/types/{new/people-types.ts → people-types.ts} +2 -2
- package/src/types/{new/thoughts-types.ts → thoughts-types.ts} +2 -2
- package/src/types/{new/user-types.ts → user-types.ts} +3 -3
- package/src/types/new/index.ts +0 -10
- package/src/types/new/misc/index.ts +0 -1
- package/src/types/old/api/account/get-user-types.ts +0 -6
- package/src/types/old/api/account/index.ts +0 -2
- package/src/types/old/api/account/update-user-types.ts +0 -14
- package/src/types/old/api/auth/create-account-types.ts +0 -17
- package/src/types/old/api/auth/index.ts +0 -5
- package/src/types/old/api/auth/refresh-auth-types.ts +0 -14
- package/src/types/old/api/auth/resend-verification-types.ts +0 -3
- package/src/types/old/api/auth/sign-in-types.ts +0 -16
- package/src/types/old/api/auth/verify-email-types.ts +0 -3
- package/src/types/old/api/habits/create-habit-entry-types.ts +0 -15
- package/src/types/old/api/habits/create-habit-types.ts +0 -17
- package/src/types/old/api/habits/delete-habit-entry-types.ts +0 -6
- package/src/types/old/api/habits/delete-habit-types.ts +0 -3
- package/src/types/old/api/habits/get-habits-types.ts +0 -6
- package/src/types/old/api/habits/index.ts +0 -6
- package/src/types/old/api/habits/update-habit-types.ts +0 -17
- package/src/types/old/api/index.ts +0 -9
- package/src/types/old/api/items/complete-item-types.ts +0 -13
- package/src/types/old/api/items/create-item-types.ts +0 -18
- package/src/types/old/api/items/delete-item-types.ts +0 -3
- package/src/types/old/api/items/get-items-types.ts +0 -6
- package/src/types/old/api/items/index.ts +0 -5
- package/src/types/old/api/items/update-item-types.ts +0 -18
- package/src/types/old/api/lists/complete-list-item-types.ts +0 -13
- package/src/types/old/api/lists/create-list-item-types.ts +0 -16
- package/src/types/old/api/lists/create-list-types.ts +0 -14
- package/src/types/old/api/lists/get-list-item-types.ts +0 -6
- package/src/types/old/api/lists/get-lists-types.ts +0 -6
- package/src/types/old/api/lists/index.ts +0 -7
- package/src/types/old/api/lists/update-list-item-types.ts +0 -17
- package/src/types/old/api/lists/update-list-types.ts +0 -14
- package/src/types/old/api/misc/index.ts +0 -1
- package/src/types/old/api/misc/version-types.ts +0 -10
- package/src/types/old/api/notifications/create-notification-template-types.ts +0 -30
- package/src/types/old/api/notifications/delete-notification-template-types.ts +0 -8
- package/src/types/old/api/notifications/get-notification-templates-types.ts +0 -12
- package/src/types/old/api/notifications/index.ts +0 -6
- package/src/types/old/api/notifications/preview-notification-template-types.ts +0 -21
- package/src/types/old/api/notifications/sync-notification-template-types.ts +0 -14
- package/src/types/old/api/notifications/update-notification-template-types.ts +0 -30
- package/src/types/old/api/people/create-person-note-types.ts +0 -15
- package/src/types/old/api/people/create-person-types.ts +0 -19
- package/src/types/old/api/people/delete-person-notes-types.ts +0 -3
- package/src/types/old/api/people/delete-person-types.ts +0 -3
- package/src/types/old/api/people/get-people-types.ts +0 -6
- package/src/types/old/api/people/get-person-notes-types.ts +0 -6
- package/src/types/old/api/people/index.ts +0 -8
- package/src/types/old/api/people/update-person-note-types.ts +0 -13
- package/src/types/old/api/people/update-person-types.ts +0 -19
- package/src/types/old/api/thoughts/create-thought-types.ts +0 -13
- package/src/types/old/api/thoughts/delete-thought-types.ts +0 -3
- package/src/types/old/api/thoughts/get-thoughts-types.ts +0 -6
- package/src/types/old/api/thoughts/index.ts +0 -4
- package/src/types/old/api/thoughts/update-thought-types.ts +0 -13
- package/src/types/old/auth-tokens.ts +0 -13
- package/src/types/old/models/auth-data.ts +0 -21
- package/src/types/old/models/habit-data.ts +0 -62
- package/src/types/old/models/index.ts +0 -10
- package/src/types/old/models/item-data.ts +0 -16
- package/src/types/old/models/list-data.ts +0 -26
- package/src/types/old/models/notifiable.ts +0 -52
- package/src/types/old/models/notification-template-data.ts +0 -67
- package/src/types/old/models/person-data.ts +0 -35
- package/src/types/old/models/program-config.ts +0 -25
- package/src/types/old/models/thought-data.ts +0 -9
- package/src/types/old/models/user-data.ts +0 -47
- /package/src/types/{misc-types.ts → misc/misc-types.ts} +0 -0
- /package/src/types/{socket-message-types.ts → misc/socket-message-types.ts} +0 -0
- /package/src/types/{new/misc → misc}/version-types.ts +0 -0
- /package/src/types/{new/program-config-types.ts → program-config-types.ts} +0 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getEntitySyncRequestSchema = exports.entitySyncRequestSchema = exports.getNotificationInstancesRequestSchema = exports.previewNotificationTemplateRequestSchema = exports.syncNotificationTemplateRequestSchema = exports.updateNotificationTemplateRequestSchema = exports.createNotificationTemplateRequestSchema = exports.notificationInstanceSchema = exports.entitySyncStateSchema = exports.createNotificationTemplateSchema = exports.notificationTemplateSchema = exports.notificationContentSchema = exports.notificationTriggerSchema = exports.notificationTriggerTypeSchema = exports.notificationStatusSchema = exports.NotificationTriggerType = exports.NotificationStatus = exports.notificationEntityTypeSchema = exports.NotificationEntityType = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const id_types_1 = require("./id-types");
|
|
6
|
+
var NotificationEntityType;
|
|
7
|
+
(function (NotificationEntityType) {
|
|
8
|
+
NotificationEntityType["AGENDA"] = "agenda";
|
|
9
|
+
NotificationEntityType["TASKS"] = "tasks";
|
|
10
|
+
NotificationEntityType["HABITS"] = "habits";
|
|
11
|
+
NotificationEntityType["INBOX"] = "inbox";
|
|
12
|
+
NotificationEntityType["AGENDA_ITEM"] = "agenda_item";
|
|
13
|
+
NotificationEntityType["HABIT"] = "habit";
|
|
14
|
+
NotificationEntityType["AGENDA_DEFAULTS"] = "agenda_defaults";
|
|
15
|
+
NotificationEntityType["HABITS_DEFAULTS"] = "habits_defaults";
|
|
16
|
+
NotificationEntityType["INBOX_PANEL"] = "inbox_panel";
|
|
17
|
+
})(NotificationEntityType || (exports.NotificationEntityType = NotificationEntityType = {}));
|
|
18
|
+
exports.notificationEntityTypeSchema = zod_1.z.nativeEnum(NotificationEntityType);
|
|
19
|
+
var NotificationStatus;
|
|
20
|
+
(function (NotificationStatus) {
|
|
21
|
+
NotificationStatus["SCHEDULED"] = "scheduled";
|
|
22
|
+
NotificationStatus["SENT"] = "sent";
|
|
23
|
+
NotificationStatus["FAILED"] = "failed";
|
|
24
|
+
NotificationStatus["CANCELLED"] = "cancelled";
|
|
25
|
+
})(NotificationStatus || (exports.NotificationStatus = NotificationStatus = {}));
|
|
26
|
+
var NotificationTriggerType;
|
|
27
|
+
(function (NotificationTriggerType) {
|
|
28
|
+
NotificationTriggerType["TIME_BASED"] = "time_based";
|
|
29
|
+
NotificationTriggerType["EVENT_BASED"] = "event_based";
|
|
30
|
+
NotificationTriggerType["RECURRING"] = "recurring";
|
|
31
|
+
})(NotificationTriggerType || (exports.NotificationTriggerType = NotificationTriggerType = {}));
|
|
32
|
+
exports.notificationStatusSchema = zod_1.z.nativeEnum(NotificationStatus);
|
|
33
|
+
exports.notificationTriggerTypeSchema = zod_1.z.nativeEnum(NotificationTriggerType);
|
|
34
|
+
exports.notificationTriggerSchema = zod_1.z.object({
|
|
35
|
+
type: exports.notificationTriggerTypeSchema,
|
|
36
|
+
conditions: zod_1.z.record(zod_1.z.any()),
|
|
37
|
+
timing: zod_1.z.record(zod_1.z.any())
|
|
38
|
+
});
|
|
39
|
+
exports.notificationContentSchema = zod_1.z.object({
|
|
40
|
+
title: zod_1.z.string(),
|
|
41
|
+
body: zod_1.z.string(),
|
|
42
|
+
variables: zod_1.z.record(zod_1.z.string()).optional()
|
|
43
|
+
});
|
|
44
|
+
exports.notificationTemplateSchema = zod_1.z.object({
|
|
45
|
+
_id: id_types_1.notificationTemplateIdSchema,
|
|
46
|
+
userId: id_types_1.userIdSchema,
|
|
47
|
+
entityType: exports.notificationEntityTypeSchema,
|
|
48
|
+
entityId: zod_1.z.string().optional(),
|
|
49
|
+
name: zod_1.z.string(),
|
|
50
|
+
description: zod_1.z.string().optional(),
|
|
51
|
+
trigger: exports.notificationTriggerSchema,
|
|
52
|
+
content: exports.notificationContentSchema,
|
|
53
|
+
active: zod_1.z.boolean(),
|
|
54
|
+
inheritedFrom: id_types_1.notificationTemplateIdSchema.optional(),
|
|
55
|
+
customized: zod_1.z.boolean(),
|
|
56
|
+
createdAt: zod_1.z.date(),
|
|
57
|
+
updatedAt: zod_1.z.date()
|
|
58
|
+
});
|
|
59
|
+
exports.createNotificationTemplateSchema = exports.notificationTemplateSchema.omit({
|
|
60
|
+
_id: true,
|
|
61
|
+
createdAt: true,
|
|
62
|
+
updatedAt: true
|
|
63
|
+
});
|
|
64
|
+
exports.entitySyncStateSchema = zod_1.z.object({
|
|
65
|
+
userId: id_types_1.userIdSchema,
|
|
66
|
+
entityType: exports.notificationEntityTypeSchema,
|
|
67
|
+
entityId: zod_1.z.string(),
|
|
68
|
+
synced: zod_1.z.boolean(),
|
|
69
|
+
updatedAt: zod_1.z.date()
|
|
70
|
+
});
|
|
71
|
+
exports.notificationInstanceSchema = zod_1.z.object({
|
|
72
|
+
_id: id_types_1.notificationInstanceIdSchema,
|
|
73
|
+
templateId: id_types_1.notificationTemplateIdSchema,
|
|
74
|
+
userId: id_types_1.userIdSchema,
|
|
75
|
+
entityId: zod_1.z.string(),
|
|
76
|
+
scheduledFor: zod_1.z.date(),
|
|
77
|
+
status: exports.notificationStatusSchema,
|
|
78
|
+
sentAt: zod_1.z.date().optional(),
|
|
79
|
+
content: zod_1.z.object({
|
|
80
|
+
title: zod_1.z.string(),
|
|
81
|
+
body: zod_1.z.string(),
|
|
82
|
+
data: zod_1.z.record(zod_1.z.any()).optional()
|
|
83
|
+
}),
|
|
84
|
+
redisId: zod_1.z.string(),
|
|
85
|
+
error: zod_1.z.string().optional(),
|
|
86
|
+
createdAt: zod_1.z.date(),
|
|
87
|
+
updatedAt: zod_1.z.date()
|
|
88
|
+
});
|
|
89
|
+
exports.createNotificationTemplateRequestSchema = zod_1.z.object({
|
|
90
|
+
entityType: exports.notificationEntityTypeSchema,
|
|
91
|
+
entityId: zod_1.z.string().optional(),
|
|
92
|
+
name: zod_1.z.string().min(1).max(100),
|
|
93
|
+
description: zod_1.z.string().max(500).optional(),
|
|
94
|
+
trigger: zod_1.z.object({
|
|
95
|
+
type: exports.notificationTriggerTypeSchema,
|
|
96
|
+
conditions: zod_1.z.record(zod_1.z.any()),
|
|
97
|
+
timing: zod_1.z.record(zod_1.z.any())
|
|
98
|
+
}),
|
|
99
|
+
content: zod_1.z.object({
|
|
100
|
+
title: zod_1.z.string().min(1).max(200),
|
|
101
|
+
body: zod_1.z.string().min(1).max(1000),
|
|
102
|
+
variables: zod_1.z.record(zod_1.z.string()).optional()
|
|
103
|
+
}),
|
|
104
|
+
active: zod_1.z.boolean().default(true),
|
|
105
|
+
inheritedFrom: zod_1.z.string().optional(),
|
|
106
|
+
customized: zod_1.z.boolean().default(false)
|
|
107
|
+
});
|
|
108
|
+
exports.updateNotificationTemplateRequestSchema = zod_1.z.object({
|
|
109
|
+
name: zod_1.z.string().optional(),
|
|
110
|
+
description: zod_1.z.string().optional(),
|
|
111
|
+
trigger: zod_1.z.object({
|
|
112
|
+
type: exports.notificationTriggerTypeSchema,
|
|
113
|
+
conditions: zod_1.z.record(zod_1.z.any()),
|
|
114
|
+
timing: zod_1.z.record(zod_1.z.any())
|
|
115
|
+
}).optional(),
|
|
116
|
+
content: zod_1.z.object({
|
|
117
|
+
title: zod_1.z.string(),
|
|
118
|
+
body: zod_1.z.string(),
|
|
119
|
+
variables: zod_1.z.record(zod_1.z.string()).optional()
|
|
120
|
+
}).optional(),
|
|
121
|
+
active: zod_1.z.boolean().optional(),
|
|
122
|
+
customized: zod_1.z.boolean().optional()
|
|
123
|
+
});
|
|
124
|
+
exports.syncNotificationTemplateRequestSchema = zod_1.z.object({
|
|
125
|
+
sync: zod_1.z.boolean()
|
|
126
|
+
});
|
|
127
|
+
exports.previewNotificationTemplateRequestSchema = zod_1.z.object({
|
|
128
|
+
templateTitle: zod_1.z.string(),
|
|
129
|
+
templateBody: zod_1.z.string(),
|
|
130
|
+
entityType: zod_1.z.string(),
|
|
131
|
+
entityId: zod_1.z.string(),
|
|
132
|
+
variables: zod_1.z.record(zod_1.z.any()).optional()
|
|
133
|
+
});
|
|
134
|
+
exports.getNotificationInstancesRequestSchema = zod_1.z.object({
|
|
135
|
+
status: zod_1.z.string().optional(),
|
|
136
|
+
templateId: zod_1.z.string().optional(),
|
|
137
|
+
entityId: zod_1.z.string().optional(),
|
|
138
|
+
limit: zod_1.z.number().optional(),
|
|
139
|
+
offset: zod_1.z.number().optional()
|
|
140
|
+
});
|
|
141
|
+
exports.entitySyncRequestSchema = zod_1.z.object({
|
|
142
|
+
entityType: zod_1.z.string(),
|
|
143
|
+
entityId: zod_1.z.string(),
|
|
144
|
+
synced: zod_1.z.boolean()
|
|
145
|
+
});
|
|
146
|
+
exports.getEntitySyncRequestSchema = zod_1.z.object({
|
|
147
|
+
entityType: zod_1.z.string(),
|
|
148
|
+
entityId: zod_1.z.string()
|
|
149
|
+
});
|
|
@@ -0,0 +1,283 @@
|
|
|
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
|
+
value: string;
|
|
8
|
+
key: string;
|
|
9
|
+
}, {
|
|
10
|
+
value: string;
|
|
11
|
+
key: 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
|
+
value: string;
|
|
52
|
+
key: string;
|
|
53
|
+
}, {
|
|
54
|
+
value: string;
|
|
55
|
+
key: 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
|
+
value: string;
|
|
70
|
+
key: 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
|
+
value: string;
|
|
81
|
+
key: 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
|
+
value: string;
|
|
96
|
+
key: string;
|
|
97
|
+
}, {
|
|
98
|
+
value: string;
|
|
99
|
+
key: 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
|
+
value: string;
|
|
155
|
+
key: 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
|
+
value: string;
|
|
173
|
+
key: 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
|
+
value: string;
|
|
183
|
+
key: string;
|
|
184
|
+
}, {
|
|
185
|
+
value: string;
|
|
186
|
+
key: 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
|
+
value: string;
|
|
194
|
+
key: string;
|
|
195
|
+
}[] | undefined;
|
|
196
|
+
}, {
|
|
197
|
+
name: string;
|
|
198
|
+
notes?: string[] | undefined;
|
|
199
|
+
properties?: {
|
|
200
|
+
value: string;
|
|
201
|
+
key: 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
|
+
value: string;
|
|
211
|
+
key: string;
|
|
212
|
+
}, {
|
|
213
|
+
value: string;
|
|
214
|
+
key: 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
|
+
value: string;
|
|
221
|
+
key: string;
|
|
222
|
+
}[] | undefined;
|
|
223
|
+
noteIds?: import("./id-types").PersonNoteId[] | undefined;
|
|
224
|
+
}, {
|
|
225
|
+
name?: string | undefined;
|
|
226
|
+
properties?: {
|
|
227
|
+
value: string;
|
|
228
|
+
key: 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
|
+
}
|
|
273
|
+
export interface CreatePersonNoteResponse {
|
|
274
|
+
personNote: Serialized<PersonNoteData>;
|
|
275
|
+
}
|
|
276
|
+
export interface GetPersonNotesResponse {
|
|
277
|
+
personNotes: Serialized<PersonNoteData>[];
|
|
278
|
+
}
|
|
279
|
+
export interface UpdatePersonNoteResponse {
|
|
280
|
+
personNote: Serialized<PersonNoteData>;
|
|
281
|
+
}
|
|
282
|
+
export interface DeletePersonNoteResponse {
|
|
283
|
+
}
|
|
@@ -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,56 @@
|
|
|
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
|
+
}
|
|
@@ -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
|
+
});
|