@timothyw/pat-common 1.0.137 → 1.0.139

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.
@@ -12,6 +12,7 @@ export declare enum NotificationTemplateLevel {
12
12
  }
13
13
  export declare enum NotificationEntityType {
14
14
  AGENDA_ITEM = "agenda_item",
15
+ HABIT = "habit",
15
16
  AGENDA_PANEL = "agenda_item",
16
17
  INBOX_PANEL = "inbox_panel"
17
18
  }
@@ -223,34 +224,34 @@ export declare const updateNotificationTemplateRequestSchema: z.ZodObject<{
223
224
  variantData?: any;
224
225
  active?: boolean | undefined;
225
226
  }>;
226
- export declare const entitySyncRequestSchema: z.ZodObject<{
227
+ export declare const getEntitySyncRequestSchema: z.ZodObject<{
227
228
  targetEntityType: z.ZodNativeEnum<typeof NotificationEntityType>;
228
229
  targetId: z.ZodString;
229
- synced: z.ZodBoolean;
230
230
  }, "strip", z.ZodTypeAny, {
231
231
  targetEntityType: NotificationEntityType;
232
232
  targetId: string;
233
- synced: boolean;
234
233
  }, {
235
234
  targetEntityType: NotificationEntityType;
236
235
  targetId: string;
237
- synced: boolean;
238
236
  }>;
239
- export declare const getEntitySyncRequestSchema: z.ZodObject<{
237
+ export declare const setEntitySyncRequestSchema: z.ZodObject<{
240
238
  targetEntityType: z.ZodNativeEnum<typeof NotificationEntityType>;
241
239
  targetId: z.ZodString;
240
+ synced: z.ZodBoolean;
242
241
  }, "strip", z.ZodTypeAny, {
243
242
  targetEntityType: NotificationEntityType;
244
243
  targetId: string;
244
+ synced: boolean;
245
245
  }, {
246
246
  targetEntityType: NotificationEntityType;
247
247
  targetId: string;
248
+ synced: boolean;
248
249
  }>;
249
250
  export type NotificationTrigger = z.infer<typeof notificationSchedulerDataSchema>;
250
251
  export type NotificationTemplateData = z.infer<typeof notificationTemplateSchema>;
251
252
  export type CreateNotificationTemplateRequest = z.infer<typeof createNotificationTemplateRequestSchema>;
252
253
  export type UpdateNotificationTemplateRequest = z.infer<typeof updateNotificationTemplateRequestSchema>;
253
- export type EntitySyncRequest = z.infer<typeof entitySyncRequestSchema>;
254
+ export type EntitySyncRequest = z.infer<typeof setEntitySyncRequestSchema>;
254
255
  export type GetEntitySyncRequest = z.infer<typeof getEntitySyncRequestSchema>;
255
256
  export interface CreateNotificationTemplateResponse {
256
257
  template: Serialized<NotificationTemplateData>;
@@ -266,14 +267,9 @@ export interface UpdateNotificationTemplateResponse {
266
267
  }
267
268
  export interface DeleteNotificationTemplateResponse {
268
269
  }
269
- export interface EntitySyncResponse {
270
- success: boolean;
270
+ export interface GetEntitySyncResponse {
271
271
  synced: boolean;
272
- templates?: Serialized<NotificationTemplateData>[];
273
- error?: string;
274
272
  }
275
- export interface GetEntitySyncResponse {
276
- success: boolean;
273
+ export interface SetEntitySyncResponse {
277
274
  synced: boolean;
278
- error?: string;
279
275
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getEntitySyncRequestSchema = exports.entitySyncRequestSchema = 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.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;
@@ -11,6 +11,7 @@ var NotificationTemplateLevel;
11
11
  var NotificationEntityType;
12
12
  (function (NotificationEntityType) {
13
13
  NotificationEntityType["AGENDA_ITEM"] = "agenda_item";
14
+ NotificationEntityType["HABIT"] = "habit";
14
15
  NotificationEntityType["AGENDA_PANEL"] = "agenda_item";
15
16
  NotificationEntityType["INBOX_PANEL"] = "inbox_panel";
16
17
  })(NotificationEntityType || (exports.NotificationEntityType = NotificationEntityType = {}));
@@ -60,12 +61,12 @@ exports.updateNotificationTemplateRequestSchema = zod_1.z.object({
60
61
  variantData: zod_1.z.any().optional(),
61
62
  active: zod_1.z.boolean().optional()
62
63
  });
63
- exports.entitySyncRequestSchema = zod_1.z.object({
64
- targetEntityType: zod_1.z.nativeEnum(NotificationEntityType),
65
- targetId: zod_1.z.string(),
66
- synced: zod_1.z.boolean()
67
- });
68
64
  exports.getEntitySyncRequestSchema = zod_1.z.object({
69
65
  targetEntityType: zod_1.z.nativeEnum(NotificationEntityType),
70
66
  targetId: zod_1.z.string()
71
67
  });
68
+ exports.setEntitySyncRequestSchema = zod_1.z.object({
69
+ targetEntityType: zod_1.z.nativeEnum(NotificationEntityType),
70
+ targetId: zod_1.z.string(),
71
+ synced: zod_1.z.boolean()
72
+ });
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@timothyw/pat-common",
3
3
  "description": "",
4
4
  "author": "Timothy Washburn",
5
- "version": "1.0.137",
5
+ "version": "1.0.139",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "scripts": {
@@ -16,6 +16,7 @@ export enum NotificationTemplateLevel {
16
16
 
17
17
  export enum NotificationEntityType {
18
18
  AGENDA_ITEM = 'agenda_item',
19
+ HABIT = 'habit',
19
20
 
20
21
  AGENDA_PANEL = 'agenda_item',
21
22
  INBOX_PANEL = 'inbox_panel',
@@ -71,15 +72,15 @@ export const updateNotificationTemplateRequestSchema = z.object({
71
72
  active: z.boolean().optional()
72
73
  });
73
74
 
74
- export const entitySyncRequestSchema = z.object({
75
+ export const getEntitySyncRequestSchema = z.object({
75
76
  targetEntityType: z.nativeEnum(NotificationEntityType),
76
- targetId: z.string(),
77
- synced: z.boolean()
77
+ targetId: z.string()
78
78
  });
79
79
 
80
- export const getEntitySyncRequestSchema = z.object({
80
+ export const setEntitySyncRequestSchema = z.object({
81
81
  targetEntityType: z.nativeEnum(NotificationEntityType),
82
- targetId: z.string()
82
+ targetId: z.string(),
83
+ synced: z.boolean()
83
84
  });
84
85
 
85
86
  export type NotificationTrigger = z.infer<typeof notificationSchedulerDataSchema>;
@@ -87,7 +88,7 @@ export type NotificationTemplateData = z.infer<typeof notificationTemplateSchema
87
88
 
88
89
  export type CreateNotificationTemplateRequest = z.infer<typeof createNotificationTemplateRequestSchema>;
89
90
  export type UpdateNotificationTemplateRequest = z.infer<typeof updateNotificationTemplateRequestSchema>;
90
- export type EntitySyncRequest = z.infer<typeof entitySyncRequestSchema>;
91
+ export type EntitySyncRequest = z.infer<typeof setEntitySyncRequestSchema>;
91
92
  export type GetEntitySyncRequest = z.infer<typeof getEntitySyncRequestSchema>;
92
93
 
93
94
  export interface CreateNotificationTemplateResponse {
@@ -108,15 +109,10 @@ export interface UpdateNotificationTemplateResponse {
108
109
 
109
110
  export interface DeleteNotificationTemplateResponse {}
110
111
 
111
- export interface EntitySyncResponse {
112
- success: boolean;
112
+ export interface GetEntitySyncResponse {
113
113
  synced: boolean;
114
- templates?: Serialized<NotificationTemplateData>[];
115
- error?: string;
116
114
  }
117
115
 
118
- export interface GetEntitySyncResponse {
119
- success: boolean;
116
+ export interface SetEntitySyncResponse {
120
117
  synced: boolean;
121
- error?: string;
122
118
  }