@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.
Files changed (111) hide show
  1. package/dist/types/agenda-types.d.ts +115 -0
  2. package/dist/types/agenda-types.js +37 -0
  3. package/dist/types/auth-types.d.ts +153 -0
  4. package/dist/types/auth-types.js +48 -0
  5. package/dist/types/habits-types.d.ts +315 -0
  6. package/dist/types/habits-types.js +70 -0
  7. package/dist/types/index.d.ts +11 -3
  8. package/dist/types/index.js +11 -6
  9. package/dist/types/lists-types.d.ts +162 -0
  10. package/dist/types/lists-types.js +50 -0
  11. package/dist/types/misc/index.d.ts +3 -0
  12. package/dist/types/misc/index.js +19 -0
  13. package/dist/types/misc/misc-types.d.ts +8 -0
  14. package/dist/types/misc/misc-types.js +9 -0
  15. package/dist/types/misc/socket-message-types.d.ts +17 -0
  16. package/dist/types/misc/socket-message-types.js +12 -0
  17. package/dist/types/misc/version-types.d.ts +26 -0
  18. package/dist/types/misc/version-types.js +13 -0
  19. package/dist/types/notifications-types.d.ts +570 -0
  20. package/dist/types/notifications-types.js +149 -0
  21. package/dist/types/people-types.d.ts +283 -0
  22. package/dist/types/people-types.js +58 -0
  23. package/dist/types/program-config-types.d.ts +105 -0
  24. package/dist/types/program-config-types.js +29 -0
  25. package/dist/types/thoughts-types.d.ts +56 -0
  26. package/dist/types/thoughts-types.js +18 -0
  27. package/dist/types/user-types.d.ts +283 -0
  28. package/dist/types/user-types.js +46 -0
  29. package/package.json +1 -1
  30. package/src/types/{new/agenda-types.ts → agenda-types.ts} +2 -2
  31. package/src/types/{new/auth-types.ts → auth-types.ts} +1 -1
  32. package/src/types/{new/habits-types.ts → habits-types.ts} +3 -3
  33. package/src/types/index.ts +12 -7
  34. package/src/types/{new/lists-types.ts → lists-types.ts} +2 -2
  35. package/src/types/misc/index.ts +3 -0
  36. package/src/types/{new/notifications-types.ts → notifications-types.ts} +56 -12
  37. package/src/types/{new/people-types.ts → people-types.ts} +2 -2
  38. package/src/types/{new/thoughts-types.ts → thoughts-types.ts} +2 -2
  39. package/src/types/{new/user-types.ts → user-types.ts} +3 -3
  40. package/src/types/new/index.ts +0 -10
  41. package/src/types/new/misc/index.ts +0 -1
  42. package/src/types/old/api/account/get-user-types.ts +0 -6
  43. package/src/types/old/api/account/index.ts +0 -2
  44. package/src/types/old/api/account/update-user-types.ts +0 -14
  45. package/src/types/old/api/auth/create-account-types.ts +0 -17
  46. package/src/types/old/api/auth/index.ts +0 -5
  47. package/src/types/old/api/auth/refresh-auth-types.ts +0 -14
  48. package/src/types/old/api/auth/resend-verification-types.ts +0 -3
  49. package/src/types/old/api/auth/sign-in-types.ts +0 -16
  50. package/src/types/old/api/auth/verify-email-types.ts +0 -3
  51. package/src/types/old/api/habits/create-habit-entry-types.ts +0 -15
  52. package/src/types/old/api/habits/create-habit-types.ts +0 -17
  53. package/src/types/old/api/habits/delete-habit-entry-types.ts +0 -6
  54. package/src/types/old/api/habits/delete-habit-types.ts +0 -3
  55. package/src/types/old/api/habits/get-habits-types.ts +0 -6
  56. package/src/types/old/api/habits/index.ts +0 -6
  57. package/src/types/old/api/habits/update-habit-types.ts +0 -17
  58. package/src/types/old/api/index.ts +0 -9
  59. package/src/types/old/api/items/complete-item-types.ts +0 -13
  60. package/src/types/old/api/items/create-item-types.ts +0 -18
  61. package/src/types/old/api/items/delete-item-types.ts +0 -3
  62. package/src/types/old/api/items/get-items-types.ts +0 -6
  63. package/src/types/old/api/items/index.ts +0 -5
  64. package/src/types/old/api/items/update-item-types.ts +0 -18
  65. package/src/types/old/api/lists/complete-list-item-types.ts +0 -13
  66. package/src/types/old/api/lists/create-list-item-types.ts +0 -16
  67. package/src/types/old/api/lists/create-list-types.ts +0 -14
  68. package/src/types/old/api/lists/get-list-item-types.ts +0 -6
  69. package/src/types/old/api/lists/get-lists-types.ts +0 -6
  70. package/src/types/old/api/lists/index.ts +0 -7
  71. package/src/types/old/api/lists/update-list-item-types.ts +0 -17
  72. package/src/types/old/api/lists/update-list-types.ts +0 -14
  73. package/src/types/old/api/misc/index.ts +0 -1
  74. package/src/types/old/api/misc/version-types.ts +0 -10
  75. package/src/types/old/api/notifications/create-notification-template-types.ts +0 -30
  76. package/src/types/old/api/notifications/delete-notification-template-types.ts +0 -8
  77. package/src/types/old/api/notifications/get-notification-templates-types.ts +0 -12
  78. package/src/types/old/api/notifications/index.ts +0 -6
  79. package/src/types/old/api/notifications/preview-notification-template-types.ts +0 -21
  80. package/src/types/old/api/notifications/sync-notification-template-types.ts +0 -14
  81. package/src/types/old/api/notifications/update-notification-template-types.ts +0 -30
  82. package/src/types/old/api/people/create-person-note-types.ts +0 -15
  83. package/src/types/old/api/people/create-person-types.ts +0 -19
  84. package/src/types/old/api/people/delete-person-notes-types.ts +0 -3
  85. package/src/types/old/api/people/delete-person-types.ts +0 -3
  86. package/src/types/old/api/people/get-people-types.ts +0 -6
  87. package/src/types/old/api/people/get-person-notes-types.ts +0 -6
  88. package/src/types/old/api/people/index.ts +0 -8
  89. package/src/types/old/api/people/update-person-note-types.ts +0 -13
  90. package/src/types/old/api/people/update-person-types.ts +0 -19
  91. package/src/types/old/api/thoughts/create-thought-types.ts +0 -13
  92. package/src/types/old/api/thoughts/delete-thought-types.ts +0 -3
  93. package/src/types/old/api/thoughts/get-thoughts-types.ts +0 -6
  94. package/src/types/old/api/thoughts/index.ts +0 -4
  95. package/src/types/old/api/thoughts/update-thought-types.ts +0 -13
  96. package/src/types/old/auth-tokens.ts +0 -13
  97. package/src/types/old/models/auth-data.ts +0 -21
  98. package/src/types/old/models/habit-data.ts +0 -62
  99. package/src/types/old/models/index.ts +0 -10
  100. package/src/types/old/models/item-data.ts +0 -16
  101. package/src/types/old/models/list-data.ts +0 -26
  102. package/src/types/old/models/notifiable.ts +0 -52
  103. package/src/types/old/models/notification-template-data.ts +0 -67
  104. package/src/types/old/models/person-data.ts +0 -35
  105. package/src/types/old/models/program-config.ts +0 -25
  106. package/src/types/old/models/thought-data.ts +0 -9
  107. package/src/types/old/models/user-data.ts +0 -47
  108. /package/src/types/{misc-types.ts → misc/misc-types.ts} +0 -0
  109. /package/src/types/{socket-message-types.ts → misc/socket-message-types.ts} +0 -0
  110. /package/src/types/{new/misc → misc}/version-types.ts +0 -0
  111. /package/src/types/{new/program-config-types.ts → program-config-types.ts} +0 -0
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createHabitEntryRequestSchema = exports.updateHabitRequestSchema = exports.createHabitRequestSchema = exports.habitSchema = exports.habitStatsSchema = exports.habitDataSchema = exports.habitEntrySchema = exports.HabitEntryStatus = exports.HabitFrequency = void 0;
4
+ const zod_1 = require("zod");
5
+ const id_types_1 = require("./id-types");
6
+ const misc_types_1 = require("./misc/misc-types");
7
+ var HabitFrequency;
8
+ (function (HabitFrequency) {
9
+ HabitFrequency["DAILY"] = "daily";
10
+ HabitFrequency["WEEKLY"] = "weekly";
11
+ HabitFrequency["EVERY_N_DAYS"] = "every_n_days";
12
+ HabitFrequency["WEEKDAYS_ONLY"] = "weekdays_only";
13
+ HabitFrequency["CUSTOM"] = "custom";
14
+ })(HabitFrequency || (exports.HabitFrequency = HabitFrequency = {}));
15
+ var HabitEntryStatus;
16
+ (function (HabitEntryStatus) {
17
+ HabitEntryStatus["COMPLETED"] = "completed";
18
+ HabitEntryStatus["EXCUSED"] = "excused";
19
+ HabitEntryStatus["MISSED"] = "missed";
20
+ })(HabitEntryStatus || (exports.HabitEntryStatus = HabitEntryStatus = {}));
21
+ exports.habitEntrySchema = zod_1.z.object({
22
+ _id: id_types_1.habitEntryIdSchema,
23
+ habitId: id_types_1.habitIdSchema,
24
+ userId: id_types_1.userIdSchema,
25
+ date: misc_types_1.dateOnlyStringSchema,
26
+ status: zod_1.z.nativeEnum(HabitEntryStatus),
27
+ createdAt: zod_1.z.date(),
28
+ updatedAt: zod_1.z.date()
29
+ });
30
+ exports.habitDataSchema = zod_1.z.object({
31
+ _id: id_types_1.habitIdSchema,
32
+ userId: id_types_1.userIdSchema,
33
+ name: zod_1.z.string(),
34
+ description: zod_1.z.string().nullable().optional(),
35
+ notes: zod_1.z.string().nullable().optional(),
36
+ frequency: zod_1.z.nativeEnum(HabitFrequency),
37
+ rolloverTime: zod_1.z.string(),
38
+ firstDay: misc_types_1.dateOnlyStringSchema,
39
+ createdAt: zod_1.z.date(),
40
+ updatedAt: zod_1.z.date()
41
+ });
42
+ exports.habitStatsSchema = zod_1.z.object({
43
+ totalDays: zod_1.z.number(),
44
+ completedDays: zod_1.z.number(),
45
+ excusedDays: zod_1.z.number(),
46
+ missedDays: zod_1.z.number(),
47
+ completionRate: zod_1.z.number()
48
+ });
49
+ exports.habitSchema = exports.habitDataSchema.extend({
50
+ entries: zod_1.z.array(exports.habitEntrySchema),
51
+ stats: exports.habitStatsSchema
52
+ });
53
+ exports.createHabitRequestSchema = zod_1.z.object({
54
+ name: zod_1.z.string().min(1).trim(),
55
+ description: zod_1.z.string().trim().optional(),
56
+ notes: zod_1.z.string().trim().optional(),
57
+ frequency: zod_1.z.nativeEnum(HabitFrequency),
58
+ rolloverTime: zod_1.z.string().regex(/^([01]?[0-9]|2[0-3]):[0-5][0-9]$/)
59
+ });
60
+ exports.updateHabitRequestSchema = zod_1.z.object({
61
+ name: zod_1.z.string().min(1).trim().optional(),
62
+ description: zod_1.z.string().trim().nullish(),
63
+ notes: zod_1.z.string().trim().nullish(),
64
+ frequency: zod_1.z.nativeEnum(HabitFrequency).optional(),
65
+ rolloverTime: zod_1.z.string().regex(/^([01]?[0-9]|2[0-3]):[0-5][0-9]$/).optional()
66
+ });
67
+ exports.createHabitEntryRequestSchema = zod_1.z.object({
68
+ date: misc_types_1.dateOnlyStringSchema,
69
+ status: zod_1.z.nativeEnum(HabitEntryStatus)
70
+ });
@@ -1,4 +1,12 @@
1
- export * from './new';
1
+ export * from './misc';
2
+ export * from './agenda-types';
3
+ export * from './thoughts-types';
4
+ export * from './habits-types';
2
5
  export * from './id-types';
3
- export * from './misc-types';
4
- export * from './socket-message-types';
6
+ export * from './people-types';
7
+ export * from './lists-types';
8
+ export * from './notifications-types';
9
+ export * from './auth-types';
10
+ export * from './user-types';
11
+ export * from './program-config-types';
12
+ export * from './misc';
@@ -14,10 +14,15 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- // export * from './api'
18
- // export * from './models'
19
- __exportStar(require("./new"), exports);
20
- // export * from './auth-tokens'
17
+ __exportStar(require("./misc"), exports);
18
+ __exportStar(require("./agenda-types"), exports);
19
+ __exportStar(require("./thoughts-types"), exports);
20
+ __exportStar(require("./habits-types"), exports);
21
21
  __exportStar(require("./id-types"), exports);
22
- __exportStar(require("./misc-types"), exports);
23
- __exportStar(require("./socket-message-types"), exports);
22
+ __exportStar(require("./people-types"), exports);
23
+ __exportStar(require("./lists-types"), exports);
24
+ __exportStar(require("./notifications-types"), exports);
25
+ __exportStar(require("./auth-types"), exports);
26
+ __exportStar(require("./user-types"), exports);
27
+ __exportStar(require("./program-config-types"), exports);
28
+ __exportStar(require("./misc"), exports);
@@ -0,0 +1,162 @@
1
+ import { z } from 'zod';
2
+ import { Serialized } from '../utils';
3
+ export declare enum ListType {
4
+ TASKS = "tasks",
5
+ NOTES = "notes"
6
+ }
7
+ export declare const listItemSchema: z.ZodObject<{
8
+ _id: z.ZodEffects<z.ZodString, import("./id-types").ListItemId, string>;
9
+ userId: z.ZodEffects<z.ZodString, import("./id-types").UserId, string>;
10
+ createdAt: z.ZodDate;
11
+ updatedAt: z.ZodDate;
12
+ name: z.ZodString;
13
+ notes: z.ZodOptional<z.ZodString>;
14
+ completed: z.ZodBoolean;
15
+ listId: z.ZodEffects<z.ZodString, import("./id-types").ListId, string>;
16
+ }, "strip", z.ZodTypeAny, {
17
+ _id: string & {
18
+ readonly __brand: "ListItemId";
19
+ };
20
+ createdAt: Date;
21
+ updatedAt: Date;
22
+ userId: string & {
23
+ readonly __brand: "UserId";
24
+ };
25
+ name: string;
26
+ completed: boolean;
27
+ listId: string & {
28
+ readonly __brand: "ListId";
29
+ };
30
+ notes?: string | undefined;
31
+ }, {
32
+ _id: string;
33
+ createdAt: Date;
34
+ updatedAt: Date;
35
+ userId: string;
36
+ name: string;
37
+ completed: boolean;
38
+ listId: string;
39
+ notes?: string | undefined;
40
+ }>;
41
+ export declare const listSchema: z.ZodObject<{
42
+ _id: z.ZodEffects<z.ZodString, import("./id-types").ListId, 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
+ type: z.ZodNativeEnum<typeof ListType>;
48
+ }, "strip", z.ZodTypeAny, {
49
+ type: ListType;
50
+ _id: string & {
51
+ readonly __brand: "ListId";
52
+ };
53
+ createdAt: Date;
54
+ updatedAt: Date;
55
+ userId: string & {
56
+ readonly __brand: "UserId";
57
+ };
58
+ name: string;
59
+ }, {
60
+ type: ListType;
61
+ _id: string;
62
+ createdAt: Date;
63
+ updatedAt: Date;
64
+ userId: string;
65
+ name: string;
66
+ }>;
67
+ export declare const createListRequestSchema: z.ZodObject<{
68
+ name: z.ZodString;
69
+ type: z.ZodNativeEnum<typeof ListType>;
70
+ }, "strip", z.ZodTypeAny, {
71
+ type: ListType;
72
+ name: string;
73
+ }, {
74
+ type: ListType;
75
+ name: string;
76
+ }>;
77
+ export declare const updateListRequestSchema: z.ZodObject<{
78
+ name: z.ZodOptional<z.ZodString>;
79
+ type: z.ZodOptional<z.ZodNativeEnum<typeof ListType>>;
80
+ }, "strip", z.ZodTypeAny, {
81
+ type?: ListType | undefined;
82
+ name?: string | undefined;
83
+ }, {
84
+ type?: ListType | undefined;
85
+ name?: string | undefined;
86
+ }>;
87
+ export declare const createListItemRequestSchema: z.ZodObject<{
88
+ name: z.ZodString;
89
+ notes: z.ZodOptional<z.ZodString>;
90
+ listId: z.ZodEffects<z.ZodString, import("./id-types").ListId, string>;
91
+ }, "strip", z.ZodTypeAny, {
92
+ name: string;
93
+ listId: string & {
94
+ readonly __brand: "ListId";
95
+ };
96
+ notes?: string | undefined;
97
+ }, {
98
+ name: string;
99
+ listId: string;
100
+ notes?: string | undefined;
101
+ }>;
102
+ export declare const updateListItemRequestSchema: z.ZodObject<{
103
+ name: z.ZodOptional<z.ZodString>;
104
+ notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
105
+ completed: z.ZodOptional<z.ZodBoolean>;
106
+ listId: z.ZodOptional<z.ZodEffects<z.ZodString, import("./id-types").ListId, string>>;
107
+ }, "strip", z.ZodTypeAny, {
108
+ name?: string | undefined;
109
+ notes?: string | null | undefined;
110
+ completed?: boolean | undefined;
111
+ listId?: import("./id-types").ListId | undefined;
112
+ }, {
113
+ name?: string | undefined;
114
+ notes?: string | null | undefined;
115
+ completed?: boolean | undefined;
116
+ listId?: string | undefined;
117
+ }>;
118
+ export declare const completeListItemRequestSchema: z.ZodObject<{
119
+ completed: z.ZodBoolean;
120
+ }, "strip", z.ZodTypeAny, {
121
+ completed: boolean;
122
+ }, {
123
+ completed: boolean;
124
+ }>;
125
+ export type ListItemData = z.infer<typeof listItemSchema>;
126
+ export type ListData = z.infer<typeof listSchema>;
127
+ export type CreateListRequest = z.infer<typeof createListRequestSchema>;
128
+ export type UpdateListRequest = z.infer<typeof updateListRequestSchema>;
129
+ export type CreateListItemRequest = z.infer<typeof createListItemRequestSchema>;
130
+ export type UpdateListItemRequest = z.infer<typeof updateListItemRequestSchema>;
131
+ export type CompleteListItemRequest = z.infer<typeof completeListItemRequestSchema>;
132
+ export interface CreateListResponse {
133
+ list: Serialized<ListData>;
134
+ }
135
+ export interface GetListsResponse {
136
+ lists: Serialized<ListData>[];
137
+ }
138
+ export interface GetListResponse {
139
+ list: Serialized<ListData>;
140
+ }
141
+ export interface UpdateListResponse {
142
+ list: Serialized<ListData>;
143
+ }
144
+ export interface DeleteListResponse {
145
+ }
146
+ export interface CreateListItemResponse {
147
+ listItem: Serialized<ListItemData>;
148
+ }
149
+ export interface GetListItemsResponse {
150
+ listItems: Serialized<ListItemData>[];
151
+ }
152
+ export interface GetListItemResponse {
153
+ listItem: Serialized<ListItemData>;
154
+ }
155
+ export interface UpdateListItemResponse {
156
+ listItem: Serialized<ListItemData>;
157
+ }
158
+ export interface CompleteListItemResponse {
159
+ listItem: Serialized<ListItemData>;
160
+ }
161
+ export interface DeleteListItemResponse {
162
+ }
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.completeListItemRequestSchema = exports.updateListItemRequestSchema = exports.createListItemRequestSchema = exports.updateListRequestSchema = exports.createListRequestSchema = exports.listSchema = exports.listItemSchema = exports.ListType = void 0;
4
+ const zod_1 = require("zod");
5
+ const id_types_1 = require("./id-types");
6
+ var ListType;
7
+ (function (ListType) {
8
+ ListType["TASKS"] = "tasks";
9
+ ListType["NOTES"] = "notes";
10
+ })(ListType || (exports.ListType = ListType = {}));
11
+ exports.listItemSchema = zod_1.z.object({
12
+ _id: id_types_1.listItemIdSchema,
13
+ userId: id_types_1.userIdSchema,
14
+ createdAt: zod_1.z.date(),
15
+ updatedAt: zod_1.z.date(),
16
+ name: zod_1.z.string(),
17
+ notes: zod_1.z.string().optional(),
18
+ completed: zod_1.z.boolean(),
19
+ listId: id_types_1.listIdSchema
20
+ });
21
+ exports.listSchema = zod_1.z.object({
22
+ _id: id_types_1.listIdSchema,
23
+ userId: id_types_1.userIdSchema,
24
+ createdAt: zod_1.z.date(),
25
+ updatedAt: zod_1.z.date(),
26
+ name: zod_1.z.string(),
27
+ type: zod_1.z.nativeEnum(ListType)
28
+ });
29
+ exports.createListRequestSchema = zod_1.z.object({
30
+ name: zod_1.z.string().min(1),
31
+ type: zod_1.z.nativeEnum(ListType)
32
+ });
33
+ exports.updateListRequestSchema = zod_1.z.object({
34
+ name: zod_1.z.string().min(1).optional(),
35
+ type: zod_1.z.nativeEnum(ListType).optional()
36
+ });
37
+ exports.createListItemRequestSchema = zod_1.z.object({
38
+ name: zod_1.z.string().min(1),
39
+ notes: zod_1.z.string().optional(),
40
+ listId: id_types_1.listIdSchema
41
+ });
42
+ exports.updateListItemRequestSchema = zod_1.z.object({
43
+ name: zod_1.z.string().min(1).optional(),
44
+ notes: zod_1.z.string().nullish(),
45
+ completed: zod_1.z.boolean().optional(),
46
+ listId: id_types_1.listIdSchema.optional()
47
+ });
48
+ exports.completeListItemRequestSchema = zod_1.z.object({
49
+ completed: zod_1.z.boolean()
50
+ });
@@ -0,0 +1,3 @@
1
+ export * from './misc-types';
2
+ export * from './socket-message-types';
3
+ export * from './version-types';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./misc-types"), exports);
18
+ __exportStar(require("./socket-message-types"), exports);
19
+ __exportStar(require("./version-types"), exports);
@@ -0,0 +1,8 @@
1
+ import { z } from "zod";
2
+ export type DateOnlyString = string & {
3
+ readonly __brand: "DateOnlyString";
4
+ };
5
+ export declare const dateOnlyStringSchema: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, DateOnlyString, string>;
6
+ export type DateString = string & {
7
+ readonly __brand: "DateString";
8
+ };
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dateOnlyStringSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.dateOnlyStringSchema = zod_1.z.string()
6
+ .refine(val => /^\d{4}-\d{2}-\d{2}$/.test(val), {
7
+ message: "Invalid date-only string format, expected YYYY-MM-DD",
8
+ })
9
+ .transform(val => val);
@@ -0,0 +1,17 @@
1
+ export declare enum SocketMessageType {
2
+ CLIENT_HEARTBEAT_ACK = "client_heartbeat_ack",
3
+ CLIENT_VERIFY_EMAIL_RESPONSE = "client_verify_email_response",
4
+ SERVER_HEARTBEAT = "server_heartbeat",
5
+ SERVER_VERIFY_EMAIL_CHECK = "server_verify_email_check"
6
+ }
7
+ export interface SocketMessage<T> {
8
+ type: SocketMessageType;
9
+ userId: string;
10
+ data: T;
11
+ }
12
+ export interface ServerHeartbeatData {
13
+ timestamp: number;
14
+ }
15
+ export interface ClientVerifyEmailResponseData {
16
+ emailVerified: boolean;
17
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SocketMessageType = void 0;
4
+ var SocketMessageType;
5
+ (function (SocketMessageType) {
6
+ // client bound packets
7
+ SocketMessageType["CLIENT_HEARTBEAT_ACK"] = "client_heartbeat_ack";
8
+ SocketMessageType["CLIENT_VERIFY_EMAIL_RESPONSE"] = "client_verify_email_response";
9
+ // server bound packets
10
+ SocketMessageType["SERVER_HEARTBEAT"] = "server_heartbeat";
11
+ SocketMessageType["SERVER_VERIFY_EMAIL_CHECK"] = "server_verify_email_check";
12
+ })(SocketMessageType || (exports.SocketMessageType = SocketMessageType = {}));
@@ -0,0 +1,26 @@
1
+ import { z } from 'zod';
2
+ export declare const versionQuerySchema: z.ZodObject<{
3
+ iOSBuildVersion: z.ZodOptional<z.ZodNumber>;
4
+ androidBuildVersion: z.ZodOptional<z.ZodNumber>;
5
+ }, "strip", z.ZodTypeAny, {
6
+ iOSBuildVersion?: number | undefined;
7
+ androidBuildVersion?: number | undefined;
8
+ }, {
9
+ iOSBuildVersion?: number | undefined;
10
+ androidBuildVersion?: number | undefined;
11
+ }>;
12
+ export declare const versionResponseSchema: z.ZodObject<{
13
+ minIOSBuildVersion: z.ZodNumber;
14
+ minAndroidBuildVersion: z.ZodNumber;
15
+ updateRequired: z.ZodBoolean;
16
+ }, "strip", z.ZodTypeAny, {
17
+ minIOSBuildVersion: number;
18
+ minAndroidBuildVersion: number;
19
+ updateRequired: boolean;
20
+ }, {
21
+ minIOSBuildVersion: number;
22
+ minAndroidBuildVersion: number;
23
+ updateRequired: boolean;
24
+ }>;
25
+ export type VersionQuery = z.infer<typeof versionQuerySchema>;
26
+ export type VersionResponse = z.infer<typeof versionResponseSchema>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.versionResponseSchema = exports.versionQuerySchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.versionQuerySchema = zod_1.z.object({
6
+ iOSBuildVersion: zod_1.z.number().optional(),
7
+ androidBuildVersion: zod_1.z.number().optional()
8
+ });
9
+ exports.versionResponseSchema = zod_1.z.object({
10
+ minIOSBuildVersion: zod_1.z.number(),
11
+ minAndroidBuildVersion: zod_1.z.number(),
12
+ updateRequired: zod_1.z.boolean()
13
+ });