@timothyw/pat-common 1.0.139 → 1.0.141
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 +0 -3
- package/dist/types/id-types.d.ts +3 -3
- package/dist/types/id-types.js +2 -2
- package/dist/types/notifications-types.d.ts +20 -5
- package/dist/types/notifications-types.js +7 -1
- package/package.json +1 -1
- package/src/types/agenda-types.ts +0 -4
- package/src/types/id-types.ts +2 -2
- package/src/types/notifications-types.ts +11 -7
|
@@ -102,9 +102,6 @@ export interface CreateAgendaItemResponse {
|
|
|
102
102
|
export interface GetAgendaItemsResponse {
|
|
103
103
|
agendaItems: Serialized<AgendaItemData>[];
|
|
104
104
|
}
|
|
105
|
-
export interface GetAgendaItemResponse {
|
|
106
|
-
agendaItem: Serialized<AgendaItemData>;
|
|
107
|
-
}
|
|
108
105
|
export interface UpdateAgendaItemResponse {
|
|
109
106
|
agendaItem: Serialized<AgendaItemData>;
|
|
110
107
|
}
|
package/dist/types/id-types.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ export declare const notificationTemplateIdSchema: z.ZodEffects<z.ZodString, Not
|
|
|
43
43
|
export type NotificationTemplateId = string & {
|
|
44
44
|
readonly __brand: "NotificationTemplateId";
|
|
45
45
|
};
|
|
46
|
-
export declare const
|
|
47
|
-
export type
|
|
48
|
-
readonly __brand: "
|
|
46
|
+
export declare const notificationSyncIdSchema: z.ZodEffects<z.ZodString, NotificationSyncId, string>;
|
|
47
|
+
export type NotificationSyncId = string & {
|
|
48
|
+
readonly __brand: "NotificationSyncId";
|
|
49
49
|
};
|
package/dist/types/id-types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.notificationSyncIdSchema = exports.notificationTemplateIdSchema = exports.habitEntryIdSchema = exports.habitIdSchema = exports.listItemIdSchema = exports.listIdSchema = exports.thoughtIdSchema = exports.personNoteIdSchema = exports.personIdSchema = exports.itemIdSchema = exports.authIdSchema = exports.userIdSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
exports.userIdSchema = zod_1.z.string().transform((val) => val);
|
|
6
6
|
exports.authIdSchema = zod_1.z.string().transform((val) => val);
|
|
@@ -13,4 +13,4 @@ exports.listItemIdSchema = zod_1.z.string().transform((val) => val);
|
|
|
13
13
|
exports.habitIdSchema = zod_1.z.string().transform((val) => val);
|
|
14
14
|
exports.habitEntryIdSchema = zod_1.z.string().transform((val) => val);
|
|
15
15
|
exports.notificationTemplateIdSchema = zod_1.z.string().transform((val) => val);
|
|
16
|
-
exports.
|
|
16
|
+
exports.notificationSyncIdSchema = zod_1.z.string().transform((val) => val);
|
|
@@ -119,6 +119,24 @@ export declare const notificationTemplateSchema: z.ZodObject<{
|
|
|
119
119
|
active: boolean;
|
|
120
120
|
variantData?: any;
|
|
121
121
|
}>;
|
|
122
|
+
export declare const notificationSyncSchema: z.ZodObject<{
|
|
123
|
+
_id: z.ZodEffects<z.ZodString, import("./id-types").NotificationSyncId, string>;
|
|
124
|
+
targetId: z.ZodString;
|
|
125
|
+
createdAt: z.ZodDate;
|
|
126
|
+
updatedAt: z.ZodDate;
|
|
127
|
+
}, "strip", z.ZodTypeAny, {
|
|
128
|
+
_id: string & {
|
|
129
|
+
readonly __brand: "NotificationSyncId";
|
|
130
|
+
};
|
|
131
|
+
createdAt: Date;
|
|
132
|
+
updatedAt: Date;
|
|
133
|
+
targetId: string;
|
|
134
|
+
}, {
|
|
135
|
+
_id: string;
|
|
136
|
+
createdAt: Date;
|
|
137
|
+
updatedAt: Date;
|
|
138
|
+
targetId: string;
|
|
139
|
+
}>;
|
|
122
140
|
export declare const createNotificationTemplateRequestSchema: z.ZodObject<{
|
|
123
141
|
targetLevel: z.ZodNativeEnum<typeof NotificationTemplateLevel>;
|
|
124
142
|
targetEntityType: z.ZodNativeEnum<typeof NotificationEntityType>;
|
|
@@ -247,21 +265,18 @@ export declare const setEntitySyncRequestSchema: z.ZodObject<{
|
|
|
247
265
|
targetId: string;
|
|
248
266
|
synced: boolean;
|
|
249
267
|
}>;
|
|
250
|
-
export type NotificationTrigger = z.infer<typeof notificationSchedulerDataSchema>;
|
|
251
268
|
export type NotificationTemplateData = z.infer<typeof notificationTemplateSchema>;
|
|
269
|
+
export type NotificationSyncData = z.infer<typeof notificationSyncSchema>;
|
|
252
270
|
export type CreateNotificationTemplateRequest = z.infer<typeof createNotificationTemplateRequestSchema>;
|
|
253
271
|
export type UpdateNotificationTemplateRequest = z.infer<typeof updateNotificationTemplateRequestSchema>;
|
|
254
|
-
export type EntitySyncRequest = z.infer<typeof setEntitySyncRequestSchema>;
|
|
255
272
|
export type GetEntitySyncRequest = z.infer<typeof getEntitySyncRequestSchema>;
|
|
273
|
+
export type SetEntitySyncRequest = z.infer<typeof setEntitySyncRequestSchema>;
|
|
256
274
|
export interface CreateNotificationTemplateResponse {
|
|
257
275
|
template: Serialized<NotificationTemplateData>;
|
|
258
276
|
}
|
|
259
277
|
export interface GetNotificationTemplatesResponse {
|
|
260
278
|
templates: Serialized<NotificationTemplateData>[];
|
|
261
279
|
}
|
|
262
|
-
export interface GetNotificationTemplateResponse {
|
|
263
|
-
template: Serialized<NotificationTemplateData>;
|
|
264
|
-
}
|
|
265
280
|
export interface UpdateNotificationTemplateResponse {
|
|
266
281
|
template: Serialized<NotificationTemplateData>;
|
|
267
282
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setEntitySyncRequestSchema = exports.getEntitySyncRequestSchema = exports.updateNotificationTemplateRequestSchema = exports.createNotificationTemplateRequestSchema = exports.notificationTemplateSchema = exports.notificationSchedulerDataSchema = exports.NotificationVariantType = exports.NotificationSchedulerType = exports.NotificationEntityType = exports.NotificationTemplateLevel = void 0;
|
|
3
|
+
exports.setEntitySyncRequestSchema = exports.getEntitySyncRequestSchema = exports.updateNotificationTemplateRequestSchema = exports.createNotificationTemplateRequestSchema = exports.notificationSyncSchema = exports.notificationTemplateSchema = exports.notificationSchedulerDataSchema = exports.NotificationVariantType = exports.NotificationSchedulerType = exports.NotificationEntityType = exports.NotificationTemplateLevel = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const id_types_1 = require("./id-types");
|
|
6
6
|
var NotificationTemplateLevel;
|
|
@@ -48,6 +48,12 @@ exports.notificationTemplateSchema = zod_1.z.object({
|
|
|
48
48
|
createdAt: zod_1.z.date(),
|
|
49
49
|
updatedAt: zod_1.z.date()
|
|
50
50
|
});
|
|
51
|
+
exports.notificationSyncSchema = zod_1.z.object({
|
|
52
|
+
_id: id_types_1.notificationSyncIdSchema,
|
|
53
|
+
targetId: zod_1.z.string(),
|
|
54
|
+
createdAt: zod_1.z.date(),
|
|
55
|
+
updatedAt: zod_1.z.date()
|
|
56
|
+
});
|
|
51
57
|
exports.createNotificationTemplateRequestSchema = zod_1.z.object({
|
|
52
58
|
targetLevel: zod_1.z.nativeEnum(NotificationTemplateLevel),
|
|
53
59
|
targetEntityType: zod_1.z.nativeEnum(NotificationEntityType),
|
package/package.json
CHANGED
|
@@ -52,10 +52,6 @@ export interface GetAgendaItemsResponse {
|
|
|
52
52
|
agendaItems: Serialized<AgendaItemData>[];
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
export interface GetAgendaItemResponse {
|
|
56
|
-
agendaItem: Serialized<AgendaItemData>;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
55
|
export interface UpdateAgendaItemResponse {
|
|
60
56
|
agendaItem: Serialized<AgendaItemData>;
|
|
61
57
|
}
|
package/src/types/id-types.ts
CHANGED
|
@@ -33,5 +33,5 @@ export type HabitEntryId = string & { readonly __brand: "HabitEntryId" };
|
|
|
33
33
|
export const notificationTemplateIdSchema = z.string().transform((val): NotificationTemplateId => val as NotificationTemplateId);
|
|
34
34
|
export type NotificationTemplateId = string & { readonly __brand: "NotificationTemplateId" };
|
|
35
35
|
|
|
36
|
-
export const
|
|
37
|
-
export type
|
|
36
|
+
export const notificationSyncIdSchema = z.string().transform((val): NotificationSyncId => val as NotificationSyncId);
|
|
37
|
+
export type NotificationSyncId = string & { readonly __brand: "NotificationSyncId" };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { notificationTemplateIdSchema,
|
|
2
|
+
import { notificationTemplateIdSchema, notificationSyncIdSchema, userIdSchema } from './id-types';
|
|
3
3
|
import { Serialized } from '../utils';
|
|
4
4
|
|
|
5
5
|
export interface NotificationContext<T = any> {
|
|
@@ -57,6 +57,13 @@ export const notificationTemplateSchema = z.object({
|
|
|
57
57
|
updatedAt: z.date()
|
|
58
58
|
});
|
|
59
59
|
|
|
60
|
+
export const notificationSyncSchema = z.object({
|
|
61
|
+
_id: notificationSyncIdSchema,
|
|
62
|
+
targetId: z.string(),
|
|
63
|
+
createdAt: z.date(),
|
|
64
|
+
updatedAt: z.date()
|
|
65
|
+
});
|
|
66
|
+
|
|
60
67
|
export const createNotificationTemplateRequestSchema = z.object({
|
|
61
68
|
targetLevel: z.nativeEnum(NotificationTemplateLevel),
|
|
62
69
|
targetEntityType: z.nativeEnum(NotificationEntityType),
|
|
@@ -83,13 +90,14 @@ export const setEntitySyncRequestSchema = z.object({
|
|
|
83
90
|
synced: z.boolean()
|
|
84
91
|
});
|
|
85
92
|
|
|
86
|
-
export type NotificationTrigger = z.infer<typeof notificationSchedulerDataSchema>;
|
|
87
93
|
export type NotificationTemplateData = z.infer<typeof notificationTemplateSchema>;
|
|
94
|
+
export type NotificationSyncData = z.infer<typeof notificationSyncSchema>;
|
|
88
95
|
|
|
89
96
|
export type CreateNotificationTemplateRequest = z.infer<typeof createNotificationTemplateRequestSchema>;
|
|
90
97
|
export type UpdateNotificationTemplateRequest = z.infer<typeof updateNotificationTemplateRequestSchema>;
|
|
91
|
-
|
|
98
|
+
|
|
92
99
|
export type GetEntitySyncRequest = z.infer<typeof getEntitySyncRequestSchema>;
|
|
100
|
+
export type SetEntitySyncRequest = z.infer<typeof setEntitySyncRequestSchema>;
|
|
93
101
|
|
|
94
102
|
export interface CreateNotificationTemplateResponse {
|
|
95
103
|
template: Serialized<NotificationTemplateData>;
|
|
@@ -99,10 +107,6 @@ export interface GetNotificationTemplatesResponse {
|
|
|
99
107
|
templates: Serialized<NotificationTemplateData>[];
|
|
100
108
|
}
|
|
101
109
|
|
|
102
|
-
export interface GetNotificationTemplateResponse {
|
|
103
|
-
template: Serialized<NotificationTemplateData>;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
110
|
export interface UpdateNotificationTemplateResponse {
|
|
107
111
|
template: Serialized<NotificationTemplateData>;
|
|
108
112
|
}
|