@thebookingkit/server 0.1.1 → 0.1.2

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 (104) hide show
  1. package/README.md +50 -0
  2. package/package.json +1 -1
  3. package/src/__tests__/api.test.ts +6 -6
  4. package/src/adapters/email-adapter.ts +2 -2
  5. package/src/adapters/job-adapter.ts +10 -10
  6. package/src/api.ts +5 -5
  7. package/.turbo/turbo-build.log +0 -6
  8. package/.turbo/turbo-test.log +0 -20
  9. package/dist/__tests__/api.test.d.ts +0 -2
  10. package/dist/__tests__/api.test.d.ts.map +0 -1
  11. package/dist/__tests__/api.test.js +0 -280
  12. package/dist/__tests__/api.test.js.map +0 -1
  13. package/dist/__tests__/auth.test.d.ts +0 -2
  14. package/dist/__tests__/auth.test.d.ts.map +0 -1
  15. package/dist/__tests__/auth.test.js +0 -78
  16. package/dist/__tests__/auth.test.js.map +0 -1
  17. package/dist/__tests__/concurrent-booking.test.d.ts +0 -2
  18. package/dist/__tests__/concurrent-booking.test.d.ts.map +0 -1
  19. package/dist/__tests__/concurrent-booking.test.js +0 -111
  20. package/dist/__tests__/concurrent-booking.test.js.map +0 -1
  21. package/dist/__tests__/multi-tenancy.test.d.ts +0 -2
  22. package/dist/__tests__/multi-tenancy.test.d.ts.map +0 -1
  23. package/dist/__tests__/multi-tenancy.test.js +0 -196
  24. package/dist/__tests__/multi-tenancy.test.js.map +0 -1
  25. package/dist/__tests__/serialization-retry.test.d.ts +0 -2
  26. package/dist/__tests__/serialization-retry.test.d.ts.map +0 -1
  27. package/dist/__tests__/serialization-retry.test.js +0 -53
  28. package/dist/__tests__/serialization-retry.test.js.map +0 -1
  29. package/dist/__tests__/webhooks.test.d.ts +0 -2
  30. package/dist/__tests__/webhooks.test.d.ts.map +0 -1
  31. package/dist/__tests__/webhooks.test.js +0 -286
  32. package/dist/__tests__/webhooks.test.js.map +0 -1
  33. package/dist/__tests__/workflows.test.d.ts +0 -2
  34. package/dist/__tests__/workflows.test.d.ts.map +0 -1
  35. package/dist/__tests__/workflows.test.js +0 -299
  36. package/dist/__tests__/workflows.test.js.map +0 -1
  37. package/dist/adapters/calendar-adapter.d.ts +0 -47
  38. package/dist/adapters/calendar-adapter.d.ts.map +0 -1
  39. package/dist/adapters/calendar-adapter.js +0 -2
  40. package/dist/adapters/calendar-adapter.js.map +0 -1
  41. package/dist/adapters/email-adapter.d.ts +0 -65
  42. package/dist/adapters/email-adapter.d.ts.map +0 -1
  43. package/dist/adapters/email-adapter.js +0 -40
  44. package/dist/adapters/email-adapter.js.map +0 -1
  45. package/dist/adapters/index.d.ts +0 -9
  46. package/dist/adapters/index.d.ts.map +0 -1
  47. package/dist/adapters/index.js +0 -3
  48. package/dist/adapters/index.js.map +0 -1
  49. package/dist/adapters/job-adapter.d.ts +0 -26
  50. package/dist/adapters/job-adapter.d.ts.map +0 -1
  51. package/dist/adapters/job-adapter.js +0 -13
  52. package/dist/adapters/job-adapter.js.map +0 -1
  53. package/dist/adapters/payment-adapter.d.ts +0 -106
  54. package/dist/adapters/payment-adapter.d.ts.map +0 -1
  55. package/dist/adapters/payment-adapter.js +0 -8
  56. package/dist/adapters/payment-adapter.js.map +0 -1
  57. package/dist/adapters/sms-adapter.d.ts +0 -33
  58. package/dist/adapters/sms-adapter.d.ts.map +0 -1
  59. package/dist/adapters/sms-adapter.js +0 -8
  60. package/dist/adapters/sms-adapter.js.map +0 -1
  61. package/dist/adapters/storage-adapter.d.ts +0 -12
  62. package/dist/adapters/storage-adapter.d.ts.map +0 -1
  63. package/dist/adapters/storage-adapter.js +0 -2
  64. package/dist/adapters/storage-adapter.js.map +0 -1
  65. package/dist/api.d.ts +0 -223
  66. package/dist/api.d.ts.map +0 -1
  67. package/dist/api.js +0 -271
  68. package/dist/api.js.map +0 -1
  69. package/dist/auth.d.ts +0 -71
  70. package/dist/auth.d.ts.map +0 -1
  71. package/dist/auth.js +0 -81
  72. package/dist/auth.js.map +0 -1
  73. package/dist/booking-tokens.d.ts +0 -23
  74. package/dist/booking-tokens.d.ts.map +0 -1
  75. package/dist/booking-tokens.js +0 -52
  76. package/dist/booking-tokens.js.map +0 -1
  77. package/dist/email-templates.d.ts +0 -36
  78. package/dist/email-templates.d.ts.map +0 -1
  79. package/dist/email-templates.js +0 -112
  80. package/dist/email-templates.js.map +0 -1
  81. package/dist/index.d.ts +0 -13
  82. package/dist/index.d.ts.map +0 -1
  83. package/dist/index.js +0 -22
  84. package/dist/index.js.map +0 -1
  85. package/dist/multi-tenancy.d.ts +0 -132
  86. package/dist/multi-tenancy.d.ts.map +0 -1
  87. package/dist/multi-tenancy.js +0 -188
  88. package/dist/multi-tenancy.js.map +0 -1
  89. package/dist/notification-jobs.d.ts +0 -143
  90. package/dist/notification-jobs.d.ts.map +0 -1
  91. package/dist/notification-jobs.js +0 -278
  92. package/dist/notification-jobs.js.map +0 -1
  93. package/dist/serialization-retry.d.ts +0 -28
  94. package/dist/serialization-retry.d.ts.map +0 -1
  95. package/dist/serialization-retry.js +0 -71
  96. package/dist/serialization-retry.js.map +0 -1
  97. package/dist/webhooks.d.ts +0 -164
  98. package/dist/webhooks.d.ts.map +0 -1
  99. package/dist/webhooks.js +0 -228
  100. package/dist/webhooks.js.map +0 -1
  101. package/dist/workflows.d.ts +0 -169
  102. package/dist/workflows.d.ts.map +0 -1
  103. package/dist/workflows.js +0 -251
  104. package/dist/workflows.js.map +0 -1
@@ -1,164 +0,0 @@
1
- /**
2
- * Webhook infrastructure for event-driven integrations.
3
- *
4
- * Includes typed payloads, HMAC-SHA256 signing with replay protection,
5
- * retry logic, and custom payload templates.
6
- */
7
- /** Supported webhook trigger events */
8
- export type WebhookTrigger = "BOOKING_CREATED" | "BOOKING_CONFIRMED" | "BOOKING_CANCELLED" | "BOOKING_RESCHEDULED" | "BOOKING_REJECTED" | "BOOKING_PAID" | "BOOKING_NO_SHOW" | "FORM_SUBMITTED" | "OOO_CREATED";
9
- /** Attendee in a webhook payload */
10
- export interface WebhookAttendee {
11
- email: string;
12
- name: string;
13
- phone?: string;
14
- }
15
- /** Standard webhook payload body */
16
- export interface WebhookPayload {
17
- bookingId: string;
18
- eventType: string;
19
- startTime: string;
20
- endTime: string;
21
- organizer: {
22
- name: string;
23
- email: string;
24
- };
25
- attendees: WebhookAttendee[];
26
- status: string;
27
- responses?: Record<string, unknown>;
28
- metadata?: Record<string, unknown>;
29
- }
30
- /** Full webhook envelope */
31
- export interface WebhookEnvelope {
32
- triggerEvent: WebhookTrigger;
33
- createdAt: string;
34
- payload: WebhookPayload;
35
- }
36
- /** A webhook subscription definition */
37
- export interface WebhookSubscription {
38
- id: string;
39
- subscriberUrl: string;
40
- triggers: WebhookTrigger[];
41
- secret?: string;
42
- isActive: boolean;
43
- /** Optional scope */
44
- eventTypeId?: string;
45
- teamId?: string;
46
- /** Optional custom payload template (JSON with {{variable}} placeholders) */
47
- payloadTemplate?: string;
48
- }
49
- /** Result of a webhook delivery attempt */
50
- export interface WebhookDeliveryResult {
51
- webhookId: string;
52
- trigger: WebhookTrigger;
53
- responseCode: number | null;
54
- success: boolean;
55
- attempt: number;
56
- deliveredAt: Date;
57
- error?: string;
58
- }
59
- /** Retry configuration for webhook delivery */
60
- export interface WebhookRetryConfig {
61
- /** Maximum number of retry attempts (default: 3) */
62
- maxRetries: number;
63
- /** Backoff delays in seconds for each retry (default: [10, 60, 300]) */
64
- backoffSeconds: number[];
65
- }
66
- /** Result of signature verification */
67
- export interface WebhookVerificationResult {
68
- valid: boolean;
69
- reason?: "timestamp_expired" | "signature_mismatch";
70
- }
71
- /** Default retry configuration */
72
- export declare const DEFAULT_RETRY_CONFIG: WebhookRetryConfig;
73
- /** All valid webhook triggers */
74
- export declare const WEBHOOK_TRIGGERS: WebhookTrigger[];
75
- /** Signature header name */
76
- export declare const SIGNATURE_HEADER = "X-SlotKit-Signature";
77
- /** Timestamp header name */
78
- export declare const TIMESTAMP_HEADER = "X-SlotKit-Timestamp";
79
- /** Default tolerance window in seconds (5 minutes) */
80
- export declare const DEFAULT_TOLERANCE_SECONDS = 300;
81
- /** Error thrown when webhook validation fails */
82
- export declare class WebhookValidationError extends Error {
83
- constructor(message: string);
84
- }
85
- /**
86
- * Create an HMAC-SHA256 signature for a webhook payload.
87
- *
88
- * Signature = HMAC-SHA256(secret, timestamp + '.' + rawBody)
89
- *
90
- * @param rawBody - The raw JSON string of the payload
91
- * @param secret - The webhook secret key
92
- * @param timestampSeconds - Unix timestamp in seconds
93
- * @returns The hex-encoded HMAC signature
94
- */
95
- export declare function signWebhookPayload(rawBody: string, secret: string, timestampSeconds: number): string;
96
- /**
97
- * Verify a webhook signature with replay protection.
98
- *
99
- * @param rawBody - The raw JSON string of the received payload
100
- * @param signature - The value of the X-SlotKit-Signature header
101
- * @param timestampSeconds - The value of the X-SlotKit-Timestamp header (Unix seconds)
102
- * @param secret - The webhook secret key
103
- * @param options - Optional configuration
104
- * @param options.toleranceSeconds - Maximum age of the timestamp in seconds (default: 300)
105
- * @returns Verification result with reason if invalid
106
- */
107
- export declare function verifyWebhookSignature(rawBody: string, signature: string, timestampSeconds: number, secret: string, options?: {
108
- toleranceSeconds?: number;
109
- }): WebhookVerificationResult;
110
- /**
111
- * Create a standard webhook envelope.
112
- *
113
- * @param trigger - The trigger event
114
- * @param payload - The webhook payload data
115
- * @returns The full webhook envelope
116
- */
117
- export declare function createWebhookEnvelope(trigger: WebhookTrigger, payload: WebhookPayload): WebhookEnvelope;
118
- /**
119
- * Resolve a custom payload template with webhook data.
120
- *
121
- * Replaces `{{variable}}` placeholders with values from the envelope.
122
- * Supported variables: triggerEvent, createdAt, bookingId, eventType,
123
- * startTime, endTime, status, and any workflow template variables.
124
- *
125
- * @param template - The JSON template string with {{variable}} placeholders
126
- * @param envelope - The webhook envelope
127
- * @returns The resolved JSON string
128
- */
129
- export declare function resolvePayloadTemplate(template: string, envelope: WebhookEnvelope): string;
130
- /**
131
- * Find all active webhook subscriptions that match a trigger and optional scope.
132
- *
133
- * @param subscriptions - All available webhook subscriptions
134
- * @param trigger - The trigger event that occurred
135
- * @param scope - Optional scope filters (eventTypeId, teamId)
136
- * @returns Matching subscriptions
137
- */
138
- export declare function matchWebhookSubscriptions(subscriptions: WebhookSubscription[], trigger: WebhookTrigger, scope?: {
139
- eventTypeId?: string;
140
- teamId?: string;
141
- }): WebhookSubscription[];
142
- /**
143
- * Determine the delay before the next retry attempt.
144
- *
145
- * @param attempt - The current attempt number (0-indexed)
146
- * @param config - Retry configuration
147
- * @returns Delay in seconds, or null if max retries exceeded
148
- */
149
- export declare function getRetryDelay(attempt: number, config?: WebhookRetryConfig): number | null;
150
- /**
151
- * Determine if a response code indicates success (2xx).
152
- *
153
- * @param statusCode - HTTP response status code
154
- * @returns Whether the delivery was successful
155
- */
156
- export declare function isSuccessResponse(statusCode: number): boolean;
157
- /**
158
- * Validate a webhook subscription.
159
- *
160
- * @param subscription - The subscription to validate
161
- * @throws {WebhookValidationError} If the subscription is invalid
162
- */
163
- export declare function validateWebhookSubscription(subscription: Omit<WebhookSubscription, "id">): void;
164
- //# sourceMappingURL=webhooks.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../src/webhooks.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,uCAAuC;AACvC,MAAM,MAAM,cAAc,GACtB,iBAAiB,GACjB,mBAAmB,GACnB,mBAAmB,GACnB,qBAAqB,GACrB,kBAAkB,GAClB,cAAc,GACd,iBAAiB,GACjB,gBAAgB,GAChB,aAAa,CAAC;AAElB,oCAAoC;AACpC,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,oCAAoC;AACpC,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MA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AAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAChD,mBAAmB,EAAE,CAevB;AAMD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,MAAM,GAAE,kBAAyC,GAChD,MAAM,GAAG,IAAI,CAGf;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAE7D;AAMD;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,YAAY,EAAE,IAAI,CAAC,mBAAmB,EAAE,IAAI,CAAC,GAC5C,IAAI,CA0BN"}
package/dist/webhooks.js DELETED
@@ -1,228 +0,0 @@
1
- /**
2
- * Webhook infrastructure for event-driven integrations.
3
- *
4
- * Includes typed payloads, HMAC-SHA256 signing with replay protection,
5
- * retry logic, and custom payload templates.
6
- */
7
- import { createHmac } from "node:crypto";
8
- // ---------------------------------------------------------------------------
9
- // Constants
10
- // ---------------------------------------------------------------------------
11
- /** Default retry configuration */
12
- export const DEFAULT_RETRY_CONFIG = {
13
- maxRetries: 3,
14
- backoffSeconds: [10, 60, 300],
15
- };
16
- /** All valid webhook triggers */
17
- export const WEBHOOK_TRIGGERS = [
18
- "BOOKING_CREATED",
19
- "BOOKING_CONFIRMED",
20
- "BOOKING_CANCELLED",
21
- "BOOKING_RESCHEDULED",
22
- "BOOKING_REJECTED",
23
- "BOOKING_PAID",
24
- "BOOKING_NO_SHOW",
25
- "FORM_SUBMITTED",
26
- "OOO_CREATED",
27
- ];
28
- /** Signature header name */
29
- export const SIGNATURE_HEADER = "X-SlotKit-Signature";
30
- /** Timestamp header name */
31
- export const TIMESTAMP_HEADER = "X-SlotKit-Timestamp";
32
- /** Default tolerance window in seconds (5 minutes) */
33
- export const DEFAULT_TOLERANCE_SECONDS = 300;
34
- // ---------------------------------------------------------------------------
35
- // Errors
36
- // ---------------------------------------------------------------------------
37
- /** Error thrown when webhook validation fails */
38
- export class WebhookValidationError extends Error {
39
- constructor(message) {
40
- super(message);
41
- this.name = "WebhookValidationError";
42
- }
43
- }
44
- // ---------------------------------------------------------------------------
45
- // Signing & Verification
46
- // ---------------------------------------------------------------------------
47
- /**
48
- * Create an HMAC-SHA256 signature for a webhook payload.
49
- *
50
- * Signature = HMAC-SHA256(secret, timestamp + '.' + rawBody)
51
- *
52
- * @param rawBody - The raw JSON string of the payload
53
- * @param secret - The webhook secret key
54
- * @param timestampSeconds - Unix timestamp in seconds
55
- * @returns The hex-encoded HMAC signature
56
- */
57
- export function signWebhookPayload(rawBody, secret, timestampSeconds) {
58
- const message = `${timestampSeconds}.${rawBody}`;
59
- return createHmac("sha256", secret).update(message).digest("hex");
60
- }
61
- /**
62
- * Verify a webhook signature with replay protection.
63
- *
64
- * @param rawBody - The raw JSON string of the received payload
65
- * @param signature - The value of the X-SlotKit-Signature header
66
- * @param timestampSeconds - The value of the X-SlotKit-Timestamp header (Unix seconds)
67
- * @param secret - The webhook secret key
68
- * @param options - Optional configuration
69
- * @param options.toleranceSeconds - Maximum age of the timestamp in seconds (default: 300)
70
- * @returns Verification result with reason if invalid
71
- */
72
- export function verifyWebhookSignature(rawBody, signature, timestampSeconds, secret, options) {
73
- const tolerance = options?.toleranceSeconds ?? DEFAULT_TOLERANCE_SECONDS;
74
- const nowSeconds = Math.floor(Date.now() / 1000);
75
- const age = nowSeconds - timestampSeconds;
76
- // Check replay protection
77
- if (age > tolerance || age < -tolerance) {
78
- return { valid: false, reason: "timestamp_expired" };
79
- }
80
- // Verify HMAC
81
- const expectedSignature = signWebhookPayload(rawBody, secret, timestampSeconds);
82
- // Constant-time comparison
83
- if (expectedSignature.length !== signature.length) {
84
- return { valid: false, reason: "signature_mismatch" };
85
- }
86
- const a = Buffer.from(expectedSignature, "hex");
87
- const b = Buffer.from(signature, "hex");
88
- if (a.length !== b.length) {
89
- return { valid: false, reason: "signature_mismatch" };
90
- }
91
- let mismatch = 0;
92
- for (let i = 0; i < a.length; i++) {
93
- mismatch |= a[i] ^ b[i];
94
- }
95
- if (mismatch !== 0) {
96
- return { valid: false, reason: "signature_mismatch" };
97
- }
98
- return { valid: true };
99
- }
100
- // ---------------------------------------------------------------------------
101
- // Envelope Construction
102
- // ---------------------------------------------------------------------------
103
- /**
104
- * Create a standard webhook envelope.
105
- *
106
- * @param trigger - The trigger event
107
- * @param payload - The webhook payload data
108
- * @returns The full webhook envelope
109
- */
110
- export function createWebhookEnvelope(trigger, payload) {
111
- return {
112
- triggerEvent: trigger,
113
- createdAt: new Date().toISOString(),
114
- payload,
115
- };
116
- }
117
- // ---------------------------------------------------------------------------
118
- // Custom Payload Templates
119
- // ---------------------------------------------------------------------------
120
- /**
121
- * Resolve a custom payload template with webhook data.
122
- *
123
- * Replaces `{{variable}}` placeholders with values from the envelope.
124
- * Supported variables: triggerEvent, createdAt, bookingId, eventType,
125
- * startTime, endTime, status, and any workflow template variables.
126
- *
127
- * @param template - The JSON template string with {{variable}} placeholders
128
- * @param envelope - The webhook envelope
129
- * @returns The resolved JSON string
130
- */
131
- export function resolvePayloadTemplate(template, envelope) {
132
- const vars = {
133
- "{{triggerEvent}}": envelope.triggerEvent,
134
- "{{createdAt}}": envelope.createdAt,
135
- "{{bookingId}}": envelope.payload.bookingId,
136
- "{{eventType}}": envelope.payload.eventType,
137
- "{{startTime}}": envelope.payload.startTime,
138
- "{{endTime}}": envelope.payload.endTime,
139
- "{{status}}": envelope.payload.status,
140
- "{{organizerName}}": envelope.payload.organizer.name,
141
- "{{organizerEmail}}": envelope.payload.organizer.email,
142
- };
143
- let result = template;
144
- for (const [key, value] of Object.entries(vars)) {
145
- result = result.replaceAll(key, value);
146
- }
147
- return result;
148
- }
149
- // ---------------------------------------------------------------------------
150
- // Subscription Matching
151
- // ---------------------------------------------------------------------------
152
- /**
153
- * Find all active webhook subscriptions that match a trigger and optional scope.
154
- *
155
- * @param subscriptions - All available webhook subscriptions
156
- * @param trigger - The trigger event that occurred
157
- * @param scope - Optional scope filters (eventTypeId, teamId)
158
- * @returns Matching subscriptions
159
- */
160
- export function matchWebhookSubscriptions(subscriptions, trigger, scope) {
161
- return subscriptions.filter((sub) => {
162
- if (!sub.isActive)
163
- return false;
164
- if (!sub.triggers.includes(trigger))
165
- return false;
166
- // Scope filtering: subscription must match if it has a scope
167
- if (sub.eventTypeId && scope?.eventTypeId !== sub.eventTypeId) {
168
- return false;
169
- }
170
- if (sub.teamId && scope?.teamId !== sub.teamId) {
171
- return false;
172
- }
173
- return true;
174
- });
175
- }
176
- // ---------------------------------------------------------------------------
177
- // Retry Logic
178
- // ---------------------------------------------------------------------------
179
- /**
180
- * Determine the delay before the next retry attempt.
181
- *
182
- * @param attempt - The current attempt number (0-indexed)
183
- * @param config - Retry configuration
184
- * @returns Delay in seconds, or null if max retries exceeded
185
- */
186
- export function getRetryDelay(attempt, config = DEFAULT_RETRY_CONFIG) {
187
- if (attempt >= config.maxRetries)
188
- return null;
189
- return config.backoffSeconds[attempt] ?? config.backoffSeconds[config.backoffSeconds.length - 1];
190
- }
191
- /**
192
- * Determine if a response code indicates success (2xx).
193
- *
194
- * @param statusCode - HTTP response status code
195
- * @returns Whether the delivery was successful
196
- */
197
- export function isSuccessResponse(statusCode) {
198
- return statusCode >= 200 && statusCode < 300;
199
- }
200
- // ---------------------------------------------------------------------------
201
- // Validation
202
- // ---------------------------------------------------------------------------
203
- /**
204
- * Validate a webhook subscription.
205
- *
206
- * @param subscription - The subscription to validate
207
- * @throws {WebhookValidationError} If the subscription is invalid
208
- */
209
- export function validateWebhookSubscription(subscription) {
210
- if (!subscription.subscriberUrl) {
211
- throw new WebhookValidationError("Subscriber URL is required");
212
- }
213
- try {
214
- new URL(subscription.subscriberUrl);
215
- }
216
- catch {
217
- throw new WebhookValidationError(`Invalid subscriber URL: "${subscription.subscriberUrl}"`);
218
- }
219
- if (!Array.isArray(subscription.triggers) || subscription.triggers.length === 0) {
220
- throw new WebhookValidationError("At least one trigger is required");
221
- }
222
- for (const trigger of subscription.triggers) {
223
- if (!WEBHOOK_TRIGGERS.includes(trigger)) {
224
- throw new WebhookValidationError(`Invalid trigger: "${trigger}". Must be one of: ${WEBHOOK_TRIGGERS.join(", ")}`);
225
- }
226
- }
227
- }
228
- //# sourceMappingURL=webhooks.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../src/webhooks.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAoFzC,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAE9E,kCAAkC;AAClC,MAAM,CAAC,MAAM,oBAAoB,GAAuB;IACtD,UAAU,EAAE,CAAC;IACb,cAAc,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC;CAC9B,CAAC;AAEF,iCAAiC;AACjC,MAAM,CAAC,MAAM,gBAAgB,GAAqB;IAChD,iBAAiB;IACjB,mBAAmB;IACnB,mBAAmB;IACnB,qBAAqB;IACrB,kBAAkB;IAClB,cAAc;IACd,iBAAiB;IACjB,gBAAgB;IAChB,aAAa;CACd,CAAC;AAEF,4BAA4B;AAC5B,MAAM,CAAC,MAAM,gBAAgB,GAAG,qBAAqB,CAAC;AAEtD,4BAA4B;AAC5B,MAAM,CAAC,MAAM,gBAAgB,GAAG,qBAAqB,CAAC;AAEtD,sDAAsD;AACtD,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,CAAC;AAE7C,8EAA8E;AAC9E,SAAS;AACT,8EAA8E;AAE9E,iDAAiD;AACjD,MAAM,OAAO,sBAAuB,SAAQ,KAAK;IAC/C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAC;IACvC,CAAC;CACF;AAED,8EAA8E;AAC9E,yBAAyB;AACzB,8EAA8E;AAE9E;;;;;;;;;GASG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAAe,EACf,MAAc,EACd,gBAAwB;IAExB,MAAM,OAAO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cAAc,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AACnG,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,UAAkB;IAClD,OAAO,UAAU,IAAI,GAAG,IAAI,UAAU,GAAG,GAAG,CAAC;AAC/C,CAAC;AAED,8EAA8E;AAC9E,aAAa;AACb,8EAA8E;AAE9E;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CACzC,YAA6C;IAE7C,IAAI,CAAC,YAAY,CAAC,aAAa,EAAE,CAAC;QAChC,MAAM,IAAI,sBAAsB,CAAC,4BAA4B,CAAC,CAAC;IACjE,CAAC;IAED,IAAI,CAAC;QACH,IAAI,GAAG,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;IACtC,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,sBAAsB,CAC9B,4BAA4B,YAAY,CAAC,aAAa,GAAG,CAC1D,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,YAAY,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChF,MAAM,IAAI,sBAAsB,CAC9B,kCAAkC,CACnC,CAAC;IACJ,CAAC;IAED,KAAK,MAAM,OAAO,IAAI,YAAY,CAAC,QAAQ,EAAE,CAAC;QAC5C,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YACxC,MAAM,IAAI,sBAAsB,CAC9B,qBAAqB,OAAO,sBAAsB,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAChF,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -1,169 +0,0 @@
1
- /**
2
- * Workflow automation engine.
3
- *
4
- * Trigger-condition-action framework that automates tasks
5
- * based on booking lifecycle events.
6
- */
7
- /** Supported workflow trigger events */
8
- export type WorkflowTrigger = "booking_created" | "booking_confirmed" | "booking_cancelled" | "booking_rescheduled" | "before_event" | "after_event" | "payment_received" | "payment_failed" | "no_show_confirmed" | "form_submitted";
9
- /** Supported workflow action types */
10
- export type WorkflowActionType = "send_email" | "send_sms" | "fire_webhook" | "update_status" | "create_calendar_event";
11
- /** Condition operator for filtering */
12
- export type ConditionOperator = "equals" | "not_equals" | "contains" | "in";
13
- /** A single workflow condition */
14
- export interface WorkflowCondition {
15
- /** The field to check (e.g., "event_type_id", "status", "customer_email") */
16
- field: string;
17
- /** Comparison operator */
18
- operator: ConditionOperator;
19
- /** Value(s) to compare against */
20
- value: string | string[];
21
- }
22
- /** Email action configuration */
23
- export interface EmailActionConfig {
24
- type: "send_email";
25
- /** Recipient: "customer", "host", or a specific email address */
26
- to: string;
27
- /** Email subject (supports template variables) */
28
- subject: string;
29
- /** Email body template (supports template variables) */
30
- body: string;
31
- }
32
- /** SMS action configuration */
33
- export interface SmsActionConfig {
34
- type: "send_sms";
35
- /** Phone number field key or literal number */
36
- to: string;
37
- /** SMS body template (supports template variables) */
38
- body: string;
39
- }
40
- /** Webhook action configuration */
41
- export interface WebhookActionConfig {
42
- type: "fire_webhook";
43
- /** Target URL */
44
- url: string;
45
- /** Payload template (JSON string with template variables) */
46
- payload?: string;
47
- /** HTTP method (default: POST) */
48
- method?: "POST" | "PUT" | "PATCH";
49
- /** Custom headers */
50
- headers?: Record<string, string>;
51
- }
52
- /** Status update action configuration */
53
- export interface StatusUpdateActionConfig {
54
- type: "update_status";
55
- /** New status to set */
56
- status: string;
57
- }
58
- /** Calendar event action configuration */
59
- export interface CalendarEventActionConfig {
60
- type: "create_calendar_event";
61
- /** Additional notes for the calendar event */
62
- notes?: string;
63
- }
64
- /** Union of all action configurations */
65
- export type WorkflowAction = EmailActionConfig | SmsActionConfig | WebhookActionConfig | StatusUpdateActionConfig | CalendarEventActionConfig;
66
- /** A complete workflow definition */
67
- export interface WorkflowDefinition {
68
- id: string;
69
- name: string;
70
- trigger: WorkflowTrigger;
71
- conditions: WorkflowCondition[];
72
- actions: WorkflowAction[];
73
- isActive: boolean;
74
- }
75
- /** Context data passed when evaluating a workflow */
76
- export interface WorkflowContext {
77
- bookingId?: string;
78
- eventTypeId?: string;
79
- providerId?: string;
80
- customerEmail?: string;
81
- customerName?: string;
82
- customerPhone?: string;
83
- status?: string;
84
- startsAt?: Date;
85
- endsAt?: Date;
86
- hostName?: string;
87
- eventTitle?: string;
88
- eventDuration?: number;
89
- eventLocation?: string;
90
- managementUrl?: string;
91
- /** Additional fields for condition evaluation */
92
- [key: string]: unknown;
93
- }
94
- /** Result of a workflow execution log entry */
95
- export interface WorkflowLogEntry {
96
- workflowId: string;
97
- bookingId?: string;
98
- actionType: WorkflowActionType;
99
- status: "success" | "error" | "skipped";
100
- error?: string;
101
- executedAt: Date;
102
- }
103
- /** Error thrown when workflow validation fails */
104
- export declare class WorkflowValidationError extends Error {
105
- constructor(message: string);
106
- }
107
- /** Standard template variables available in workflow messages */
108
- export declare const TEMPLATE_VARIABLES: readonly ["{booking.title}", "{booking.startTime}", "{booking.endTime}", "{booking.date}", "{attendee.name}", "{attendee.email}", "{host.name}", "{event.location}", "{event.duration}", "{booking.managementUrl}"];
109
- /**
110
- * Resolve template variables in a string using workflow context.
111
- *
112
- * Missing variables are replaced with empty strings.
113
- *
114
- * @param template - The template string with `{variable}` placeholders
115
- * @param context - The workflow context with booking/event data
116
- * @returns The resolved string
117
- */
118
- export declare function resolveTemplateVariables(template: string, context: WorkflowContext): string;
119
- /** Default workflow templates for common scenarios */
120
- export declare const DEFAULT_TEMPLATES: {
121
- readonly confirmation: {
122
- readonly subject: "Booking Confirmed: {booking.title}";
123
- readonly body: "Hi {attendee.name},\n\nYour booking for {booking.title} on {booking.date} at {booking.startTime} has been confirmed.\n\nDuration: {event.duration}\nLocation: {event.location}\n\nManage your booking: {booking.managementUrl}\n\nBest regards,\n{host.name}";
124
- };
125
- readonly reminder_24h: {
126
- readonly subject: "Reminder: {booking.title} tomorrow";
127
- readonly body: "Hi {attendee.name},\n\nThis is a reminder that you have a booking for {booking.title} tomorrow at {booking.startTime}.\n\nLocation: {event.location}\n\nManage your booking: {booking.managementUrl}\n\nSee you soon,\n{host.name}";
128
- };
129
- readonly reminder_1h: {
130
- readonly subject: "Reminder: {booking.title} in 1 hour";
131
- readonly body: "Hi {attendee.name},\n\nYour booking for {booking.title} starts in 1 hour at {booking.startTime}.\n\nLocation: {event.location}\n\nSee you soon,\n{host.name}";
132
- };
133
- readonly cancellation: {
134
- readonly subject: "Booking Cancelled: {booking.title}";
135
- readonly body: "Hi {attendee.name},\n\nYour booking for {booking.title} on {booking.date} at {booking.startTime} has been cancelled.\n\nIf you'd like to rebook, please visit our booking page.\n\nBest regards,\n{host.name}";
136
- };
137
- readonly followup: {
138
- readonly subject: "How was your {booking.title}?";
139
- readonly body: "Hi {attendee.name},\n\nThank you for your recent {booking.title} with {host.name}.\n\nWe hope you had a great experience! If you'd like to book again, we'd love to see you.\n\nBest regards,\n{host.name}";
140
- };
141
- };
142
- /**
143
- * Evaluate whether a workflow's conditions are met for the given context.
144
- *
145
- * If no conditions are defined, returns true (unconditional trigger).
146
- * All conditions must match (AND logic).
147
- *
148
- * @param conditions - Array of workflow conditions
149
- * @param context - The workflow context data
150
- * @returns Whether all conditions are satisfied
151
- */
152
- export declare function evaluateConditions(conditions: WorkflowCondition[], context: WorkflowContext): boolean;
153
- /**
154
- * Validate a workflow definition.
155
- *
156
- * @param workflow - The workflow to validate
157
- * @throws {WorkflowValidationError} If the workflow is invalid
158
- */
159
- export declare function validateWorkflow(workflow: WorkflowDefinition): void;
160
- /**
161
- * Find all active workflows that match a given trigger and context.
162
- *
163
- * @param workflows - All available workflows
164
- * @param trigger - The trigger event that occurred
165
- * @param context - The workflow context data
166
- * @returns Workflows that should be executed
167
- */
168
- export declare function matchWorkflows(workflows: WorkflowDefinition[], trigger: WorkflowTrigger, context: WorkflowContext): WorkflowDefinition[];
169
- //# sourceMappingURL=workflows.d.ts.map
@@ -1 +0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