@voyant-travel/notifications 0.115.0 → 0.116.0
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/service-deliveries.d.ts +29 -34
- package/dist/service-deliveries.d.ts.map +1 -1
- package/dist/service-deliveries.js +1 -1
- package/dist/service-shared.d.ts +2 -7
- package/dist/service-shared.d.ts.map +1 -1
- package/dist/service-shared.js +2 -6
- package/dist/service-templates.d.ts +76 -91
- package/dist/service-templates.d.ts.map +1 -1
- package/dist/service-templates.js +3 -3
- package/package.json +6 -5
|
@@ -1,40 +1,35 @@
|
|
|
1
1
|
import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
|
|
2
2
|
import type { NotificationDeliveryListQuery, NotificationService, SendInvoiceNotificationInput, SendNotificationInput, SendPaymentSessionNotificationInput } from "./service-shared.js";
|
|
3
3
|
export { resolveNotificationPaymentUrl } from "./service-delivery-metadata.js";
|
|
4
|
-
export declare function listDeliveries(db: PostgresJsDatabase, query: NotificationDeliveryListQuery): Promise<{
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}[];
|
|
34
|
-
total: number;
|
|
35
|
-
limit: number;
|
|
36
|
-
offset: number;
|
|
37
|
-
}>;
|
|
4
|
+
export declare function listDeliveries(db: PostgresJsDatabase, query: NotificationDeliveryListQuery): Promise<import("@voyant-travel/types").ListResponse<{
|
|
5
|
+
id: string;
|
|
6
|
+
templateId: string | null;
|
|
7
|
+
templateSlug: string | null;
|
|
8
|
+
targetType: "invoice" | "organization" | "other" | "booking" | "booking_payment_schedule" | "booking_guarantee" | "person" | "payment_session";
|
|
9
|
+
targetId: string | null;
|
|
10
|
+
personId: string | null;
|
|
11
|
+
organizationId: string | null;
|
|
12
|
+
bookingId: string | null;
|
|
13
|
+
invoiceId: string | null;
|
|
14
|
+
paymentSessionId: string | null;
|
|
15
|
+
channel: "email" | "sms";
|
|
16
|
+
provider: string;
|
|
17
|
+
providerMessageId: string | null;
|
|
18
|
+
status: "failed" | "pending" | "cancelled" | "sent";
|
|
19
|
+
toAddress: string;
|
|
20
|
+
fromAddress: string | null;
|
|
21
|
+
subject: string | null;
|
|
22
|
+
htmlBody: string | null;
|
|
23
|
+
textBody: string | null;
|
|
24
|
+
payloadData: Record<string, unknown> | null;
|
|
25
|
+
metadata: Record<string, unknown> | null;
|
|
26
|
+
errorMessage: string | null;
|
|
27
|
+
scheduledFor: Date | null;
|
|
28
|
+
sentAt: Date | null;
|
|
29
|
+
failedAt: Date | null;
|
|
30
|
+
createdAt: Date;
|
|
31
|
+
updatedAt: Date;
|
|
32
|
+
}>>;
|
|
38
33
|
export declare function getDeliveryById(db: PostgresJsDatabase, id: string): Promise<{
|
|
39
34
|
id: string;
|
|
40
35
|
templateId: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-deliveries.d.ts","sourceRoot":"","sources":["../src/service-deliveries.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAUjE,OAAO,KAAK,EACV,6BAA6B,EAC7B,mBAAmB,EACnB,4BAA4B,EAC5B,qBAAqB,EACrB,mCAAmC,EACpC,MAAM,qBAAqB,CAAA;AAc5B,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAA;AAE9E,wBAAsB,cAAc,CAAC,EAAE,EAAE,kBAAkB,EAAE,KAAK,EAAE,6BAA6B
|
|
1
|
+
{"version":3,"file":"service-deliveries.d.ts","sourceRoot":"","sources":["../src/service-deliveries.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAUjE,OAAO,KAAK,EACV,6BAA6B,EAC7B,mBAAmB,EACnB,4BAA4B,EAC5B,qBAAqB,EACrB,mCAAmC,EACpC,MAAM,qBAAqB,CAAA;AAc5B,OAAO,EAAE,6BAA6B,EAAE,MAAM,gCAAgC,CAAA;AAE9E,wBAAsB,cAAc,CAAC,EAAE,EAAE,kBAAkB,EAAE,KAAK,EAAE,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAgChG;AAED,wBAAsB,eAAe,CAAC,EAAE,EAAE,kBAAkB,EAAE,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAOvE;AAED,wBAAsB,cAAc,CAClC,EAAE,EAAE,kBAAkB,EACtB,UAAU,EAAE,mBAAmB,EAC/B,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAgCX;AAED,wBAAsB,gBAAgB,CACpC,EAAE,EAAE,kBAAkB,EACtB,UAAU,EAAE,mBAAmB,EAC/B,KAAK,EAAE,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAuI7B;AAED,wBAAsB,8BAA8B,CAClD,EAAE,EAAE,kBAAkB,EACtB,UAAU,EAAE,mBAAmB,EAC/B,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA2G3C;AAED,wBAAsB,uBAAuB,CAC3C,EAAE,EAAE,kBAAkB,EACtB,UAAU,EAAE,mBAAmB,EAC/B,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAyGpC"}
|
|
@@ -39,7 +39,7 @@ export async function listDeliveries(db, query) {
|
|
|
39
39
|
.where(where)
|
|
40
40
|
.limit(query.limit)
|
|
41
41
|
.offset(query.offset)
|
|
42
|
-
.orderBy(desc(notificationDeliveries.createdAt)), db.select({
|
|
42
|
+
.orderBy(desc(notificationDeliveries.createdAt)), db.select({ count: sql `count(*)::int` }).from(notificationDeliveries).where(where), query.limit, query.offset);
|
|
43
43
|
}
|
|
44
44
|
export async function getDeliveryById(db, id) {
|
|
45
45
|
const [row] = await db
|
package/dist/service-shared.d.ts
CHANGED
|
@@ -96,12 +96,7 @@ export declare function listBookingNotificationParticipants(db: PostgresJsDataba
|
|
|
96
96
|
}[]>;
|
|
97
97
|
export declare function listBookingNotificationItems(db: PostgresJsDatabase, bookingId: string): Promise<unknown[]>;
|
|
98
98
|
export declare function paginate<T>(rowsPromise: Promise<T[]>, totalPromise: Promise<Array<{
|
|
99
|
-
|
|
100
|
-
}>>, limit: number, offset: number): Promise<
|
|
101
|
-
data: T[];
|
|
102
|
-
total: number;
|
|
103
|
-
limit: number;
|
|
104
|
-
offset: number;
|
|
105
|
-
}>;
|
|
99
|
+
count: number;
|
|
100
|
+
}>>, limit: number, offset: number): Promise<import("@voyant-travel/types").ListResponse<T>>;
|
|
106
101
|
export declare function buildWhereClause<T extends SQLWrapper>(conditions: Array<T | undefined>): import("drizzle-orm").SQL<unknown> | undefined;
|
|
107
102
|
//# sourceMappingURL=service-shared.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-shared.d.ts","sourceRoot":"","sources":["../src/service-shared.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"service-shared.d.ts","sourceRoot":"","sources":["../src/service-shared.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAA;AAGrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AACjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK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IAAI,CAAA;IAC3B,wBAAwB,EAAE,MAAM,GAAG,IAAI,CAAA;CACxC,GAAG,IAAI,EACR,YAAY,EAAE,KAAK,CAAC;IAClB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,SAAS,EAAE,OAAO,CAAA;IAClB,eAAe,EAAE,MAAM,CAAA;IACvB,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAC;WALO,MAAM,GAAG,IAAI;eACT,OAAO;qBACD,MAAM;eACZ,MAAM;cACP,MAAM;SAmCnB;AAED,wBAAsB,mCAAmC,CACvD,EAAE,EAAE,kBAAkB,EACtB,SAAS,EAAE,MAAM;;;;;;;KAclB;AAED,wBAAsB,4BAA4B,CAAC,EAAE,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,sBAkB3F;AAED,wBAAsB,QAAQ,CAAC,CAAC,EAC9B,WAAW,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC,EACzB,YAAY,EAAE,OAAO,CAAC,KAAK,CAAC;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,EAC/C,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,2DAIf;AAED,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,UAAU,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC,GAAG,SAAS,CAAC,kDAGtF"}
|
package/dist/service-shared.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { bookingItems, bookingTravelers } from "@voyant-travel/bookings/schema";
|
|
2
|
+
import { listResponse } from "@voyant-travel/types";
|
|
2
3
|
import { and, desc, eq } from "drizzle-orm";
|
|
3
4
|
import { renderLiquidTemplate } from "./liquid.js";
|
|
4
5
|
import { enrichBookingItem, normalizeNotificationTemplateData } from "./service-template-data.js";
|
|
@@ -146,12 +147,7 @@ export async function listBookingNotificationItems(db, bookingId) {
|
|
|
146
147
|
}
|
|
147
148
|
export async function paginate(rowsPromise, totalPromise, limit, offset) {
|
|
148
149
|
const [data, totalRows] = await Promise.all([rowsPromise, totalPromise]);
|
|
149
|
-
return {
|
|
150
|
-
data,
|
|
151
|
-
total: totalRows[0]?.total ?? 0,
|
|
152
|
-
limit,
|
|
153
|
-
offset,
|
|
154
|
-
};
|
|
150
|
+
return listResponse(data, { total: totalRows[0]?.count ?? 0, limit, offset });
|
|
155
151
|
}
|
|
156
152
|
export function buildWhereClause(conditions) {
|
|
157
153
|
const filtered = conditions.filter((condition) => Boolean(condition));
|
|
@@ -1,26 +1,21 @@
|
|
|
1
1
|
import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
|
|
2
2
|
import type { CreateNotificationReminderRuleInput, CreateNotificationTemplateInput, NotificationReminderRuleListQuery, NotificationReminderRunListQuery, NotificationTemplateListQuery, UpdateNotificationReminderRuleInput, UpdateNotificationTemplateInput } from "./service-shared.js";
|
|
3
|
-
export declare function listTemplates(db: PostgresJsDatabase, query: NotificationTemplateListQuery): Promise<{
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}[];
|
|
20
|
-
total: number;
|
|
21
|
-
limit: number;
|
|
22
|
-
offset: number;
|
|
23
|
-
}>;
|
|
3
|
+
export declare function listTemplates(db: PostgresJsDatabase, query: NotificationTemplateListQuery): Promise<import("@voyant-travel/types").ListResponse<{
|
|
4
|
+
id: string;
|
|
5
|
+
slug: string;
|
|
6
|
+
name: string;
|
|
7
|
+
channel: "email" | "sms";
|
|
8
|
+
provider: string | null;
|
|
9
|
+
status: "active" | "draft" | "archived";
|
|
10
|
+
subjectTemplate: string | null;
|
|
11
|
+
htmlTemplate: string | null;
|
|
12
|
+
textTemplate: string | null;
|
|
13
|
+
fromAddress: string | null;
|
|
14
|
+
isSystem: boolean;
|
|
15
|
+
metadata: Record<string, unknown> | null;
|
|
16
|
+
createdAt: Date;
|
|
17
|
+
updatedAt: Date;
|
|
18
|
+
}>>;
|
|
24
19
|
export declare function getTemplateById(db: PostgresJsDatabase, id: string): Promise<{
|
|
25
20
|
id: string;
|
|
26
21
|
slug: string;
|
|
@@ -86,28 +81,23 @@ export declare function updateTemplate(db: PostgresJsDatabase, id: string, data:
|
|
|
86
81
|
updatedAt: Date;
|
|
87
82
|
} | null>;
|
|
88
83
|
export declare function deleteTemplate(db: PostgresJsDatabase, id: string): Promise<boolean>;
|
|
89
|
-
export declare function listReminderRules(db: PostgresJsDatabase, query: NotificationReminderRuleListQuery): Promise<{
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}[];
|
|
107
|
-
total: number;
|
|
108
|
-
limit: number;
|
|
109
|
-
offset: number;
|
|
110
|
-
}>;
|
|
84
|
+
export declare function listReminderRules(db: PostgresJsDatabase, query: NotificationReminderRuleListQuery): Promise<import("@voyant-travel/types").ListResponse<{
|
|
85
|
+
id: string;
|
|
86
|
+
slug: string;
|
|
87
|
+
name: string;
|
|
88
|
+
status: "active" | "draft" | "archived";
|
|
89
|
+
targetType: "invoice" | "booking_confirmed" | "booking_payment_schedule" | "payment_complete" | "booking_cancelled_non_payment";
|
|
90
|
+
channel: "email" | "sms";
|
|
91
|
+
provider: string | null;
|
|
92
|
+
templateId: string | null;
|
|
93
|
+
templateSlug: string | null;
|
|
94
|
+
priority: number;
|
|
95
|
+
suppressionGroup: string | null;
|
|
96
|
+
isSystem: boolean;
|
|
97
|
+
metadata: Record<string, unknown> | null;
|
|
98
|
+
createdAt: Date;
|
|
99
|
+
updatedAt: Date;
|
|
100
|
+
}>>;
|
|
111
101
|
export declare function getReminderRuleById(db: PostgresJsDatabase, id: string): Promise<{
|
|
112
102
|
id: string;
|
|
113
103
|
slug: string;
|
|
@@ -160,57 +150,52 @@ export declare function updateReminderRule(db: PostgresJsDatabase, id: string, d
|
|
|
160
150
|
updatedAt: Date;
|
|
161
151
|
} | null>;
|
|
162
152
|
export declare function deleteReminderRule(db: PostgresJsDatabase, id: string): Promise<boolean>;
|
|
163
|
-
export declare function listReminderRuns(db: PostgresJsDatabase, query: NotificationReminderRunListQuery): Promise<{
|
|
164
|
-
|
|
153
|
+
export declare function listReminderRuns(db: PostgresJsDatabase, query: NotificationReminderRunListQuery): Promise<import("@voyant-travel/types").ListResponse<{
|
|
154
|
+
id: string;
|
|
155
|
+
reminderRuleId: string;
|
|
156
|
+
targetType: "invoice" | "booking_confirmed" | "booking_payment_schedule" | "payment_complete" | "booking_cancelled_non_payment";
|
|
157
|
+
targetId: string;
|
|
158
|
+
dedupeKey: string;
|
|
159
|
+
status: "failed" | "queued" | "skipped" | "processing" | "sent";
|
|
160
|
+
recipient: string | null;
|
|
161
|
+
scheduledFor: string;
|
|
162
|
+
processedAt: string;
|
|
163
|
+
errorMessage: string | null;
|
|
164
|
+
metadata: Record<string, unknown> | null;
|
|
165
|
+
createdAt: string;
|
|
166
|
+
updatedAt: string;
|
|
167
|
+
links: {
|
|
168
|
+
bookingId: string | null;
|
|
169
|
+
bookingPaymentScheduleId: string | null;
|
|
170
|
+
invoiceId: string | null;
|
|
171
|
+
paymentSessionId: string | null;
|
|
172
|
+
personId: string | null;
|
|
173
|
+
organizationId: string | null;
|
|
174
|
+
notificationDeliveryId: string | null;
|
|
175
|
+
};
|
|
176
|
+
reminderRule: {
|
|
165
177
|
id: string;
|
|
166
|
-
|
|
178
|
+
slug: string;
|
|
179
|
+
name: string;
|
|
180
|
+
status: "active" | "draft" | "archived";
|
|
167
181
|
targetType: "invoice" | "booking_confirmed" | "booking_payment_schedule" | "payment_complete" | "booking_cancelled_non_payment";
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
182
|
+
channel: "email" | "sms";
|
|
183
|
+
provider: string | null;
|
|
184
|
+
templateId: string | null;
|
|
185
|
+
templateSlug: string | null;
|
|
186
|
+
};
|
|
187
|
+
delivery: {
|
|
188
|
+
id: string;
|
|
189
|
+
status: "failed" | "pending" | "cancelled" | "sent";
|
|
190
|
+
channel: "email" | "sms";
|
|
191
|
+
provider: string;
|
|
192
|
+
toAddress: string;
|
|
193
|
+
subject: string | null;
|
|
194
|
+
sentAt: string | null;
|
|
195
|
+
failedAt: string | null;
|
|
174
196
|
errorMessage: string | null;
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
updatedAt: string;
|
|
178
|
-
links: {
|
|
179
|
-
bookingId: string | null;
|
|
180
|
-
bookingPaymentScheduleId: string | null;
|
|
181
|
-
invoiceId: string | null;
|
|
182
|
-
paymentSessionId: string | null;
|
|
183
|
-
personId: string | null;
|
|
184
|
-
organizationId: string | null;
|
|
185
|
-
notificationDeliveryId: string | null;
|
|
186
|
-
};
|
|
187
|
-
reminderRule: {
|
|
188
|
-
id: string;
|
|
189
|
-
slug: string;
|
|
190
|
-
name: string;
|
|
191
|
-
status: "active" | "draft" | "archived";
|
|
192
|
-
targetType: "invoice" | "booking_confirmed" | "booking_payment_schedule" | "payment_complete" | "booking_cancelled_non_payment";
|
|
193
|
-
channel: "email" | "sms";
|
|
194
|
-
provider: string | null;
|
|
195
|
-
templateId: string | null;
|
|
196
|
-
templateSlug: string | null;
|
|
197
|
-
};
|
|
198
|
-
delivery: {
|
|
199
|
-
id: string;
|
|
200
|
-
status: "failed" | "pending" | "cancelled" | "sent";
|
|
201
|
-
channel: "email" | "sms";
|
|
202
|
-
provider: string;
|
|
203
|
-
toAddress: string;
|
|
204
|
-
subject: string | null;
|
|
205
|
-
sentAt: string | null;
|
|
206
|
-
failedAt: string | null;
|
|
207
|
-
errorMessage: string | null;
|
|
208
|
-
} | null;
|
|
209
|
-
}[];
|
|
210
|
-
total: number;
|
|
211
|
-
limit: number;
|
|
212
|
-
offset: number;
|
|
213
|
-
}>;
|
|
197
|
+
} | null;
|
|
198
|
+
}>>;
|
|
214
199
|
export declare function getReminderRunById(db: PostgresJsDatabase, id: string): Promise<{
|
|
215
200
|
id: string;
|
|
216
201
|
reminderRuleId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service-templates.d.ts","sourceRoot":"","sources":["../src/service-templates.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAQjE,OAAO,KAAK,EACV,mCAAmC,EACnC,+BAA+B,EAC/B,iCAAiC,EACjC,gCAAgC,EAEhC,6BAA6B,EAC7B,mCAAmC,EACnC,+BAA+B,EAChC,MAAM,qBAAqB,CAAA;AAoG5B,wBAAsB,aAAa,CAAC,EAAE,EAAE,kBAAkB,EAAE,KAAK,EAAE,6BAA6B
|
|
1
|
+
{"version":3,"file":"service-templates.d.ts","sourceRoot":"","sources":["../src/service-templates.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAQjE,OAAO,KAAK,EACV,mCAAmC,EACnC,+BAA+B,EAC/B,iCAAiC,EACjC,gCAAgC,EAEhC,6BAA6B,EAC7B,mCAAmC,EACnC,+BAA+B,EAChC,MAAM,qBAAqB,CAAA;AAoG5B,wBAAsB,aAAa,CAAC,EAAE,EAAE,kBAAkB,EAAE,KAAK,EAAE,6BAA6B;;;;;;;;;;;;;;;IAyB/F;AAED,wBAAsB,eAAe,CAAC,EAAE,EAAE,kBAAkB,EAAE,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;UAOvE;AAED,wBAAsB,iBAAiB,CAAC,EAAE,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM;;;;;;;;;;;;;;;UAO3E;AAED,wBAAsB,cAAc,CAClC,EAAE,EAAE,kBAAkB,EACtB,IAAI,EAAE,+BAA+B;;;;;;;;;;;;;;;UAItC;AAED,wBAAsB,cAAc,CAClC,EAAE,EAAE,kBAAkB,EACtB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,+BAA+B;;;;;;;;;;;;;;;UAQtC;AAED,wBAAsB,cAAc,CAAC,EAAE,EAAE,kBAAkB,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAMzF;AAED,wBAAsB,iBAAiB,CACrC,EAAE,EAAE,kBAAkB,EACtB,KAAK,EAAE,iCAAiC;;;;;;;;;;;;;;;;IA0BzC;AAED,wBAAsB,mBAAmB,CAAC,EAAE,EAAE,kBAAkB,EAAE,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;;UAO3E;AAED,wBAAsB,kBAAkB,CACtC,EAAE,EAAE,kBAAkB,EACtB,IAAI,EAAE,mCAAmC;;;;;;;;;;;;;;;;UAI1C;AAED,wBAAsB,kBAAkB,CACtC,EAAE,EAAE,kBAAkB,EACtB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,mCAAmC;;;;;;;;;;;;;;;;UAQ1C;AAED,wBAAsB,kBAAkB,CAAC,EAAE,EAAE,kBAAkB,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAM7F;AAED,wBAAsB,gBAAgB,CACpC,EAAE,EAAE,kBAAkB,EACtB,KAAK,EAAE,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAoGxC;AAED,wBAAsB,kBAAkB,CAAC,EAAE,EAAE,kBAAkB,EAAE,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UAoD1E"}
|
|
@@ -79,7 +79,7 @@ export async function listTemplates(db, query) {
|
|
|
79
79
|
.where(where)
|
|
80
80
|
.limit(query.limit)
|
|
81
81
|
.offset(query.offset)
|
|
82
|
-
.orderBy(desc(notificationTemplates.updatedAt)), db.select({
|
|
82
|
+
.orderBy(desc(notificationTemplates.updatedAt)), db.select({ count: sql `count(*)::int` }).from(notificationTemplates).where(where), query.limit, query.offset);
|
|
83
83
|
}
|
|
84
84
|
export async function getTemplateById(db, id) {
|
|
85
85
|
const [row] = await db
|
|
@@ -135,7 +135,7 @@ export async function listReminderRules(db, query) {
|
|
|
135
135
|
.where(where)
|
|
136
136
|
.limit(query.limit)
|
|
137
137
|
.offset(query.offset)
|
|
138
|
-
.orderBy(desc(notificationReminderRules.updatedAt)), db.select({
|
|
138
|
+
.orderBy(desc(notificationReminderRules.updatedAt)), db.select({ count: sql `count(*)::int` }).from(notificationReminderRules).where(where), query.limit, query.offset);
|
|
139
139
|
}
|
|
140
140
|
export async function getReminderRuleById(db, id) {
|
|
141
141
|
const [row] = await db
|
|
@@ -243,7 +243,7 @@ export async function listReminderRuns(db, query) {
|
|
|
243
243
|
.limit(query.limit)
|
|
244
244
|
.offset(query.offset)
|
|
245
245
|
.orderBy(desc(notificationReminderRuns.createdAt))
|
|
246
|
-
.then((rows) => rows.map(normalizeReminderRun)), db.select({
|
|
246
|
+
.then((rows) => rows.map(normalizeReminderRun)), db.select({ count: sql `count(*)::int` }).from(notificationReminderRuns).where(where), query.limit, query.offset);
|
|
247
247
|
}
|
|
248
248
|
export async function getReminderRunById(db, id) {
|
|
249
249
|
const [row] = await db
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@voyant-travel/notifications",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.116.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -61,12 +61,13 @@
|
|
|
61
61
|
"hono": "^4.12.10",
|
|
62
62
|
"liquidjs": "^10.26.0",
|
|
63
63
|
"zod": "^4.3.6",
|
|
64
|
-
"@voyant-travel/bookings": "^0.
|
|
64
|
+
"@voyant-travel/bookings": "^0.134.0",
|
|
65
65
|
"@voyant-travel/core": "^0.111.0",
|
|
66
66
|
"@voyant-travel/db": "^0.109.0",
|
|
67
|
-
"@voyant-travel/
|
|
68
|
-
"@voyant-travel/
|
|
69
|
-
"@voyant-travel/
|
|
67
|
+
"@voyant-travel/types": "^0.106.0",
|
|
68
|
+
"@voyant-travel/finance": "^0.134.0",
|
|
69
|
+
"@voyant-travel/hono": "^0.115.0",
|
|
70
|
+
"@voyant-travel/legal": "^0.134.0"
|
|
70
71
|
},
|
|
71
72
|
"devDependencies": {
|
|
72
73
|
"drizzle-kit": "^0.31.10",
|