@scalemule/nextjs 0.1.17 → 0.1.19

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.
@@ -1,782 +0,0 @@
1
- import { MoneyClient } from '@scalemule/money';
2
- import { $ as RegisterRequest, p as ClientContext, U as User, v as LoginRequest, L as LoginResponse, c as ListFilesParams, t as ListFilesResponse, a9 as StorageFile, af as UploadResponse } from './index-DTWyUcyd.mjs';
3
-
4
- /**
5
- * Server-Side ScaleMule Client
6
- *
7
- * Stateless client for use in Next.js API routes.
8
- * Does not manage sessions - that's handled by cookies.
9
- */
10
-
11
- type ScaleMuleEnvironment = 'dev' | 'prod';
12
- interface ServerConfig {
13
- /** Your ScaleMule API key (use env var, never hardcode) */
14
- apiKey: string;
15
- /** Environment: 'dev' or 'prod' - automatically sets gateway URL */
16
- environment?: ScaleMuleEnvironment;
17
- /** Custom gateway URL (overrides environment preset) */
18
- gatewayUrl?: string;
19
- /** Enable debug logging */
20
- debug?: boolean;
21
- }
22
- declare function resolveGatewayUrl(config: ServerConfig): string;
23
- declare class ScaleMuleServer {
24
- private apiKey;
25
- private gatewayUrl;
26
- private debug;
27
- money: MoneyClient;
28
- constructor(config: ServerConfig);
29
- moneyWithSession(sessionToken: string): MoneyClient;
30
- /**
31
- * Make a request to the ScaleMule API
32
- *
33
- * @param method - HTTP method
34
- * @param path - API path (e.g., /v1/auth/login)
35
- * @param options - Request options
36
- * @param options.body - Request body (will be JSON stringified)
37
- * @param options.userId - User ID (passed through for storage operations)
38
- * @param options.sessionToken - Session token sent as Authorization: Bearer header
39
- * @param options.clientContext - End user context to forward (IP, user agent, etc.)
40
- */
41
- private request;
42
- auth: {
43
- /**
44
- * Register a new user
45
- */
46
- register: (data: RegisterRequest, options?: {
47
- clientContext?: ClientContext;
48
- }) => Promise<User>;
49
- /**
50
- * Login user - returns session token (store in HTTP-only cookie)
51
- */
52
- login: (data: LoginRequest, options?: {
53
- clientContext?: ClientContext;
54
- }) => Promise<LoginResponse>;
55
- /**
56
- * Logout user
57
- */
58
- logout: (sessionToken: string) => Promise<void>;
59
- /**
60
- * Get current user from session token
61
- */
62
- me: (sessionToken: string) => Promise<User>;
63
- /**
64
- * Refresh session token
65
- */
66
- refresh: (sessionToken: string) => Promise<{
67
- session_token: string;
68
- expires_at: string;
69
- }>;
70
- /**
71
- * Request password reset email
72
- */
73
- forgotPassword: (email: string, options?: {
74
- clientContext?: ClientContext;
75
- }) => Promise<{
76
- message: string;
77
- }>;
78
- /**
79
- * Reset password with token
80
- */
81
- resetPassword: (token: string, newPassword: string, options?: {
82
- clientContext?: ClientContext;
83
- }) => Promise<{
84
- message: string;
85
- }>;
86
- /**
87
- * Verify email with token
88
- */
89
- verifyEmail: (token: string) => Promise<{
90
- message?: string;
91
- verified?: boolean;
92
- session_token?: string;
93
- user?: User;
94
- expires_at?: string;
95
- }>;
96
- /**
97
- * Resend verification email.
98
- * Can be called with a session token (authenticated) or email (unauthenticated).
99
- */
100
- resendVerification: (sessionTokenOrEmail: string, options?: {
101
- email?: string;
102
- }) => Promise<{
103
- message: string;
104
- }>;
105
- };
106
- user: {
107
- /**
108
- * Update user profile
109
- */
110
- update: (sessionToken: string, data: {
111
- full_name?: string;
112
- avatar_url?: string;
113
- }) => Promise<User>;
114
- /**
115
- * Change password
116
- */
117
- changePassword: (sessionToken: string, currentPassword: string, newPassword: string) => Promise<{
118
- message: string;
119
- }>;
120
- /**
121
- * Change email
122
- */
123
- changeEmail: (sessionToken: string, newEmail: string, password: string) => Promise<{
124
- message: string;
125
- }>;
126
- /**
127
- * Delete account
128
- */
129
- deleteAccount: (sessionToken: string, password: string) => Promise<{
130
- message: string;
131
- }>;
132
- };
133
- secrets: {
134
- /**
135
- * Get a secret from the tenant vault
136
- *
137
- * @example
138
- * ```typescript
139
- * const result = await scalemule.secrets.get('ANONYMOUS_USER_SALT')
140
- * if (result.success) {
141
- * console.log('Salt:', result.data.value)
142
- * }
143
- * ```
144
- */
145
- get: (key: string) => Promise<{
146
- value: string;
147
- version: number;
148
- }>;
149
- /**
150
- * Set a secret in the tenant vault
151
- *
152
- * @example
153
- * ```typescript
154
- * await scalemule.secrets.set('ANONYMOUS_USER_SALT', 'my-secret-salt')
155
- * ```
156
- */
157
- set: (key: string, value: string) => Promise<{
158
- value: string;
159
- version: number;
160
- }>;
161
- /**
162
- * Delete a secret from the tenant vault
163
- */
164
- delete: (key: string) => Promise<void>;
165
- /**
166
- * List all secrets in the tenant vault
167
- */
168
- list: () => Promise<{
169
- secrets: Array<{
170
- path: string;
171
- version: number;
172
- }>;
173
- }>;
174
- /**
175
- * Get secret version history
176
- */
177
- versions: (key: string) => Promise<{
178
- versions: Array<{
179
- version: number;
180
- created_at: string;
181
- }>;
182
- }>;
183
- /**
184
- * Rollback to a specific version
185
- */
186
- rollback: (key: string, version: number) => Promise<{
187
- value: string;
188
- version: number;
189
- }>;
190
- /**
191
- * Rotate a secret (copy current version as new version)
192
- */
193
- rotate: (key: string, newValue: string) => Promise<{
194
- value: string;
195
- version: number;
196
- }>;
197
- };
198
- bundles: {
199
- /**
200
- * Get a bundle (structured secret like database credentials)
201
- *
202
- * @param key - Bundle key (e.g., 'database/prod')
203
- * @param resolve - Whether to resolve inheritance (default: true)
204
- *
205
- * @example
206
- * ```typescript
207
- * const result = await scalemule.bundles.get('database/prod')
208
- * if (result.success) {
209
- * console.log('DB Host:', result.data.data.host)
210
- * }
211
- * ```
212
- */
213
- get: <T = Record<string, unknown>>(key: string, resolve?: boolean) => Promise<{
214
- type: string;
215
- data: T;
216
- version: number;
217
- inherits_from?: string;
218
- }>;
219
- /**
220
- * Set a bundle (structured secret)
221
- *
222
- * @param key - Bundle key
223
- * @param type - Bundle type: 'mysql', 'postgres', 'redis', 's3', 'oauth', 'smtp', 'generic'
224
- * @param data - Bundle data (structure depends on type)
225
- * @param inheritsFrom - Optional parent bundle key for inheritance
226
- *
227
- * @example
228
- * ```typescript
229
- * // Create a MySQL bundle
230
- * await scalemule.bundles.set('database/prod', 'mysql', {
231
- * host: 'db.example.com',
232
- * port: 3306,
233
- * username: 'app',
234
- * password: 'secret',
235
- * database: 'myapp'
236
- * })
237
- *
238
- * // Create a bundle that inherits from another
239
- * await scalemule.bundles.set('database/staging', 'mysql', {
240
- * host: 'staging-db.example.com', // Override just the host
241
- * }, 'database/prod')
242
- * ```
243
- */
244
- set: <T = Record<string, unknown>>(key: string, type: string, data: T, inheritsFrom?: string) => Promise<{
245
- type: string;
246
- data: T;
247
- version: number;
248
- }>;
249
- /**
250
- * Delete a bundle
251
- */
252
- delete: (key: string) => Promise<void>;
253
- /**
254
- * List all bundles
255
- */
256
- list: () => Promise<{
257
- bundles: Array<{
258
- path: string;
259
- type: string;
260
- version: number;
261
- inherits_from?: string;
262
- }>;
263
- }>;
264
- /**
265
- * Get connection URL for a database bundle
266
- *
267
- * @example
268
- * ```typescript
269
- * const result = await scalemule.bundles.connectionUrl('database/prod')
270
- * if (result.success) {
271
- * const client = mysql.createConnection(result.data.url)
272
- * }
273
- * ```
274
- */
275
- connectionUrl: (key: string) => Promise<{
276
- url: string;
277
- }>;
278
- };
279
- vaultAudit: {
280
- /**
281
- * Query audit logs for your tenant's vault operations
282
- *
283
- * @example
284
- * ```typescript
285
- * const result = await scalemule.vaultAudit.query({
286
- * action: 'read',
287
- * path: 'database/*',
288
- * since: '2026-01-01'
289
- * })
290
- * ```
291
- */
292
- query: (options?: {
293
- action?: "read" | "write" | "delete" | "list";
294
- path?: string;
295
- since?: string;
296
- until?: string;
297
- limit?: number;
298
- }) => Promise<{
299
- logs: Array<{
300
- timestamp: string;
301
- action: string;
302
- resource_path: string;
303
- success: boolean;
304
- error_message?: string;
305
- }>;
306
- }>;
307
- };
308
- storage: {
309
- /**
310
- * List user's files
311
- */
312
- list: (userId: string, params?: ListFilesParams) => Promise<ListFilesResponse>;
313
- /**
314
- * Get file info
315
- */
316
- get: (fileId: string) => Promise<StorageFile>;
317
- /**
318
- * Delete file
319
- */
320
- delete: (userId: string, fileId: string) => Promise<void>;
321
- /**
322
- * Upload file (from server - use FormData)
323
- *
324
- * @param userId - The user ID who owns this file
325
- * @param file - File data to upload
326
- * @param options - Upload options
327
- * @param options.clientContext - End user context to forward (IP, user agent, etc.)
328
- *
329
- * @example
330
- * ```typescript
331
- * // Forward end user context for proper attribution
332
- * const result = await scalemule.storage.upload(
333
- * userId,
334
- * { buffer, filename, contentType },
335
- * { clientContext: extractClientContext(request) }
336
- * )
337
- * ```
338
- */
339
- upload: (userId: string, file: {
340
- buffer: BlobPart;
341
- filename: string;
342
- contentType: string;
343
- }, options?: {
344
- clientContext?: ClientContext;
345
- }) => Promise<UploadResponse>;
346
- };
347
- webhooks: {
348
- /**
349
- * Create a new webhook subscription
350
- *
351
- * @example
352
- * ```typescript
353
- * const result = await scalemule.webhooks.create({
354
- * webhook_name: 'Video Status Webhook',
355
- * url: 'https://myapp.com/api/webhooks/scalemule',
356
- * events: ['video.ready', 'video.failed']
357
- * })
358
- *
359
- * // Store the secret for signature verification
360
- * console.log('Webhook secret:', result.secret)
361
- * ```
362
- */
363
- create: (data: {
364
- webhook_name: string;
365
- url: string;
366
- events: string[];
367
- }) => Promise<{
368
- id: string;
369
- secret: string;
370
- url: string;
371
- events: string[];
372
- }>;
373
- /**
374
- * List all webhook subscriptions
375
- */
376
- list: () => Promise<{
377
- webhooks: Array<{
378
- id: string;
379
- webhook_name: string;
380
- url: string;
381
- events: string[];
382
- is_enabled: boolean;
383
- }>;
384
- }>;
385
- /**
386
- * Delete a webhook subscription
387
- */
388
- delete: (id: string) => Promise<void>;
389
- /**
390
- * Update a webhook subscription
391
- */
392
- update: (id: string, data: {
393
- url?: string;
394
- events?: string[];
395
- is_enabled?: boolean;
396
- }) => Promise<{
397
- id: string;
398
- url: string;
399
- events: string[];
400
- }>;
401
- /**
402
- * Get available webhook event types
403
- */
404
- eventTypes: () => Promise<{
405
- events: Array<{
406
- event_name: string;
407
- event_description: string;
408
- payload_schema: Record<string, unknown>;
409
- }>;
410
- }>;
411
- };
412
- analytics: {
413
- /**
414
- * Track an analytics event
415
- *
416
- * IMPORTANT: When calling from server-side code (API routes), always pass
417
- * clientContext to ensure the real end user's IP is recorded, not the server's IP.
418
- *
419
- * @example
420
- * ```typescript
421
- * // In an API route
422
- * import { extractClientContext, createServerClient } from '@scalemule/nextjs/server'
423
- *
424
- * export async function POST(request: NextRequest) {
425
- * const clientContext = extractClientContext(request)
426
- * const scalemule = createServerClient()
427
- *
428
- * await scalemule.analytics.trackEvent({
429
- * event_name: 'button_clicked',
430
- * properties: { button_id: 'signup' }
431
- * }, { clientContext })
432
- * }
433
- * ```
434
- */
435
- trackEvent: (event: {
436
- event_name: string;
437
- event_category?: string;
438
- properties?: Record<string, unknown>;
439
- user_id?: string;
440
- session_id?: string;
441
- anonymous_id?: string;
442
- session_duration_seconds?: number;
443
- page_url?: string;
444
- page_title?: string;
445
- referrer?: string;
446
- landing_page?: string;
447
- device_type?: string;
448
- device_brand?: string;
449
- device_model?: string;
450
- browser?: string;
451
- browser_version?: string;
452
- os?: string;
453
- os_version?: string;
454
- screen_resolution?: string;
455
- viewport_size?: string;
456
- utm_source?: string;
457
- utm_medium?: string;
458
- utm_campaign?: string;
459
- utm_term?: string;
460
- utm_content?: string;
461
- client_timestamp?: string;
462
- timestamp?: string;
463
- }, options?: {
464
- clientContext?: ClientContext;
465
- }) => Promise<{
466
- tracked: number;
467
- session_id?: string;
468
- }>;
469
- /**
470
- * Track a page view
471
- *
472
- * @example
473
- * ```typescript
474
- * await scalemule.analytics.trackPageView({
475
- * page_url: 'https://example.com/products',
476
- * page_title: 'Products',
477
- * referrer: 'https://google.com'
478
- * }, { clientContext })
479
- * ```
480
- */
481
- trackPageView: (data: {
482
- page_url: string;
483
- page_title?: string;
484
- referrer?: string;
485
- session_id?: string;
486
- user_id?: string;
487
- }, options?: {
488
- clientContext?: ClientContext;
489
- }) => Promise<{
490
- tracked: number;
491
- session_id?: string;
492
- }>;
493
- /**
494
- * Track multiple events in a batch (max 100)
495
- *
496
- * @example
497
- * ```typescript
498
- * await scalemule.analytics.trackBatch([
499
- * { event_name: 'item_viewed', properties: { item_id: '123' } },
500
- * { event_name: 'item_added_to_cart', properties: { item_id: '123' } }
501
- * ], { clientContext })
502
- * ```
503
- */
504
- trackBatch: (events: Array<{
505
- event_name: string;
506
- event_category?: string;
507
- properties?: Record<string, unknown>;
508
- user_id?: string;
509
- session_id?: string;
510
- anonymous_id?: string;
511
- session_duration_seconds?: number;
512
- page_url?: string;
513
- page_title?: string;
514
- referrer?: string;
515
- landing_page?: string;
516
- device_type?: string;
517
- browser?: string;
518
- os?: string;
519
- screen_resolution?: string;
520
- viewport_size?: string;
521
- utm_source?: string;
522
- utm_medium?: string;
523
- utm_campaign?: string;
524
- utm_term?: string;
525
- utm_content?: string;
526
- client_timestamp?: string;
527
- timestamp?: string;
528
- }>, options?: {
529
- clientContext?: ClientContext;
530
- }) => Promise<{
531
- tracked: number;
532
- }>;
533
- };
534
- flags: {
535
- evaluate: <T = unknown>(flagKey: string, context?: Record<string, unknown>, environment?: string, options?: {
536
- clientContext?: ClientContext;
537
- }) => Promise<{
538
- flag_id: string;
539
- flag_key: string;
540
- environment: string;
541
- value: T;
542
- reason: string;
543
- matched_rule_id?: string | null;
544
- variant_key?: string | null;
545
- bucket?: number | null;
546
- }>;
547
- evaluateBatch: (flagKeys: string[], context?: Record<string, unknown>, environment?: string, options?: {
548
- clientContext?: ClientContext;
549
- }) => Promise<Record<string, {
550
- flag_id: string;
551
- flag_key: string;
552
- environment: string;
553
- value: unknown;
554
- reason: string;
555
- matched_rule_id?: string | null;
556
- variant_key?: string | null;
557
- bucket?: number | null;
558
- }>>;
559
- evaluateAll: (context?: Record<string, unknown>, environment?: string, options?: {
560
- clientContext?: ClientContext;
561
- }) => Promise<Record<string, {
562
- flag_id: string;
563
- flag_key: string;
564
- environment: string;
565
- value: unknown;
566
- reason: string;
567
- matched_rule_id?: string | null;
568
- variant_key?: string | null;
569
- bucket?: number | null;
570
- }>>;
571
- };
572
- }
573
- /**
574
- * Create a server client with environment-based defaults
575
- */
576
- declare function createServerClient(config?: Partial<ServerConfig>): ScaleMuleServer;
577
-
578
- /**
579
- * ScaleMule Webhook Helpers
580
- *
581
- * Provides utilities for webhook signature verification and route handlers
582
- * for video processing events and other ScaleMule webhooks.
583
- *
584
- * @example
585
- * ```typescript
586
- * // app/api/webhooks/scalemule/route.ts
587
- * import { createWebhookRoutes } from '@scalemule/nextjs/server'
588
- *
589
- * export const { POST } = createWebhookRoutes({
590
- * secret: process.env.SCALEMULE_WEBHOOK_SECRET,
591
- * onVideoReady: async (event) => {
592
- * console.log('Video ready:', event.video_id)
593
- * await updateDocument('videos', event.video_id, { status: 'ready' })
594
- * },
595
- * onVideoFailed: async (event) => {
596
- * console.log('Video failed:', event.video_id, event.reason)
597
- * }
598
- * })
599
- * ```
600
- */
601
-
602
- interface WebhookEvent<T = Record<string, unknown>> {
603
- event: string;
604
- timestamp: number;
605
- data: T;
606
- }
607
- interface VideoReadyEvent {
608
- video_id: string;
609
- application_id: string;
610
- duration_seconds?: number;
611
- width?: number;
612
- height?: number;
613
- thumbnail_url?: string;
614
- playlist_url?: string;
615
- }
616
- interface VideoFailedEvent {
617
- video_id: string;
618
- application_id: string;
619
- reason: string;
620
- }
621
- interface VideoUploadedEvent {
622
- video_id: string;
623
- application_id: string;
624
- filename?: string;
625
- size_bytes?: number;
626
- }
627
- interface VideoTranscodedEvent {
628
- video_id: string;
629
- application_id: string;
630
- derivative_count: number;
631
- }
632
- interface WebhookRoutesConfig {
633
- /** ScaleMule client configuration (optional, uses env vars by default) */
634
- client?: Partial<ServerConfig>;
635
- /** Webhook secret for signature verification (recommended for security) */
636
- secret?: string;
637
- /** Handler for video.ready events */
638
- onVideoReady?: (event: VideoReadyEvent) => void | Promise<void>;
639
- /** Handler for video.failed events */
640
- onVideoFailed?: (event: VideoFailedEvent) => void | Promise<void>;
641
- /** Handler for video.uploaded events */
642
- onVideoUploaded?: (event: VideoUploadedEvent) => void | Promise<void>;
643
- /** Handler for video.transcoded events */
644
- onVideoTranscoded?: (event: VideoTranscodedEvent) => void | Promise<void>;
645
- /** Generic handler for any webhook event */
646
- onEvent?: (event: WebhookEvent) => void | Promise<void>;
647
- }
648
- /**
649
- * Verify webhook signature using HMAC-SHA256
650
- *
651
- * ScaleMule webhooks include a signature header in the format: sha256=<hex_signature>
652
- *
653
- * @param payload - Raw request body as string
654
- * @param signature - Value of X-Webhook-Signature header
655
- * @param secret - Your webhook secret
656
- * @returns true if signature is valid
657
- *
658
- * @example
659
- * ```typescript
660
- * const isValid = verifyWebhookSignature(body, signature, secret)
661
- * if (!isValid) {
662
- * return new Response('Invalid signature', { status: 401 })
663
- * }
664
- * ```
665
- */
666
- declare function verifyWebhookSignature(payload: string, signature: string, secret: string): boolean;
667
- /**
668
- * Parse a webhook event from the raw payload
669
- *
670
- * @param payload - Raw request body as string
671
- * @returns Parsed webhook event
672
- */
673
- declare function parseWebhookEvent<T = Record<string, unknown>>(payload: string): WebhookEvent<T>;
674
- /**
675
- * Register a webhook for video events
676
- *
677
- * @param url - The URL to receive webhook notifications
678
- * @param options - Registration options
679
- * @returns The webhook ID and secret for signature verification
680
- *
681
- * @example
682
- * ```typescript
683
- * const { id, secret } = await registerVideoWebhook(
684
- * 'https://myapp.com/api/webhooks/scalemule',
685
- * { events: ['video.ready', 'video.failed'] }
686
- * )
687
- *
688
- * // Store the secret securely for signature verification
689
- * await saveToEnv('SCALEMULE_WEBHOOK_SECRET', secret)
690
- * ```
691
- */
692
- declare function registerVideoWebhook(url: string, options?: {
693
- /** Events to subscribe to (defaults to video.ready and video.failed) */
694
- events?: ('video.ready' | 'video.failed' | 'video.uploaded' | 'video.transcoded')[];
695
- /** Human-readable webhook name */
696
- name?: string;
697
- /** Client configuration */
698
- clientConfig?: Partial<ServerConfig>;
699
- }): Promise<{
700
- id: string;
701
- secret: string;
702
- }>;
703
- type RouteHandler$1 = (request: Request, context: {
704
- params: Promise<{
705
- scalemule?: string[];
706
- }>;
707
- }) => Promise<Response>;
708
- /**
709
- * Create Next.js App Router route handlers for ScaleMule webhooks
710
- *
711
- * Returns a POST handler that:
712
- * - Verifies webhook signature (if secret provided)
713
- * - Parses the event payload
714
- * - Calls appropriate event handlers
715
- * - Returns proper responses
716
- *
717
- * @param config - Webhook routes configuration
718
- * @returns Object with POST handler for use in route.ts
719
- *
720
- * @example
721
- * ```typescript
722
- * // app/api/webhooks/scalemule/route.ts
723
- * import { createWebhookRoutes } from '@scalemule/nextjs/server'
724
- *
725
- * export const { POST } = createWebhookRoutes({
726
- * secret: process.env.SCALEMULE_WEBHOOK_SECRET,
727
- * onVideoReady: async (event) => {
728
- * // Update your database when video is ready
729
- * await db.videos.update({
730
- * where: { id: event.video_id },
731
- * data: {
732
- * status: 'ready',
733
- * duration: event.duration_seconds,
734
- * thumbnailUrl: event.thumbnail_url,
735
- * }
736
- * })
737
- * },
738
- * onVideoFailed: async (event) => {
739
- * // Handle failed video processing
740
- * await notifyUser(event.video_id, event.reason)
741
- * }
742
- * })
743
- * ```
744
- */
745
- declare function createWebhookRoutes(config?: WebhookRoutesConfig): {
746
- POST: RouteHandler$1;
747
- };
748
-
749
- /**
750
- * Simplified webhook handler for 1-line setup.
751
- *
752
- * Usage in your Next.js app:
753
- * ```ts
754
- * // app/api/webhooks/scalemule/route.ts
755
- * import { createWebhookHandler } from '@scalemule/nextjs/server/webhooks'
756
- *
757
- * export const POST = createWebhookHandler({
758
- * secret: process.env.SCALEMULE_WEBHOOK_SECRET,
759
- * onEvent: {
760
- * 'video.transcoding.completed': async (event) => { ... },
761
- * 'storage.file.uploaded': async (event) => { ... },
762
- * }
763
- * })
764
- * ```
765
- */
766
-
767
- interface WebhookHandlerConfig {
768
- /** Webhook secret for signature verification */
769
- secret?: string;
770
- /** Map of event name → handler function */
771
- onEvent?: Record<string, (event: WebhookEvent) => void | Promise<void>>;
772
- }
773
- type RouteHandler = (request: Request) => Promise<Response>;
774
- /**
775
- * Create a webhook handler for ScaleMule events.
776
- *
777
- * Simpler alternative to createWebhookRoutes() — uses an event map
778
- * instead of separate onVideoReady, onVideoFailed, etc. callbacks.
779
- */
780
- declare function createWebhookHandler(config?: WebhookHandlerConfig): RouteHandler;
781
-
782
- export { type ServerConfig as S, type VideoFailedEvent as V, type WebhookEvent as W, ScaleMuleServer as a, type VideoReadyEvent as b, type VideoTranscodedEvent as c, type VideoUploadedEvent as d, type WebhookRoutesConfig as e, createServerClient as f, createWebhookHandler as g, createWebhookRoutes as h, resolveGatewayUrl as i, parseWebhookEvent as p, registerVideoWebhook as r, verifyWebhookSignature as v };