@capibox/bridge-nextjs-client 0.0.12 → 0.0.14

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/index.d.mts CHANGED
@@ -11,75 +11,659 @@ type ParamsLandingPageResponse = {
11
11
  };
12
12
  };
13
13
 
14
- declare const browser: {
15
- mail: {
16
- sendToRecipient: (data: {
17
- subject: string;
14
+ interface components {
15
+ schemas: {
16
+ SendMailToRecipientDto: {
17
+ /**
18
+ * @description Email recipient address
19
+ * @example recipient@example.com
20
+ */
18
21
  to: string;
19
- htmlPart?: string | undefined;
20
- textPart?: string | undefined;
21
- }) => Promise<{
22
- success: boolean;
23
- }>;
24
- sendToSupport: (data: {
22
+ /**
23
+ * @description Email subject
24
+ * @example Important information about your account
25
+ */
25
26
  subject: string;
26
- htmlPart?: string | undefined;
27
- textPart?: string | undefined;
28
- }) => Promise<{
29
- success: boolean;
30
- }>;
31
- };
32
- session: {
33
- append: (data: {
34
- email?: string | undefined;
35
- currency?: string | undefined;
36
- language?: string | undefined;
37
- }) => Promise<{
27
+ /**
28
+ * @description HTML content of the email
29
+ * @example <p>Hello, this is an <strong>important</strong> message.</p>
30
+ */
31
+ htmlPart?: string;
32
+ /**
33
+ * @description Plain text content of the email
34
+ * @example Hello, this is an important message.
35
+ */
36
+ textPart?: string;
37
+ };
38
+ SendMailResponseDto: {
39
+ /**
40
+ * @description Success status
41
+ * @example true
42
+ */
38
43
  success: boolean;
39
- data: {
40
- uuid: string;
41
- };
42
- }>;
43
- create: (data: {
44
+ };
45
+ SendMailToSupportDto: {
46
+ /**
47
+ * @description Email subject
48
+ * @example Important information about your account
49
+ */
50
+ subject: string;
51
+ /**
52
+ * @description HTML content of the email
53
+ * @example <p>Hello, this is an <strong>important</strong> message.</p>
54
+ */
55
+ htmlPart?: string;
56
+ /**
57
+ * @description Plain text content of the email
58
+ * @example Hello, this is an important message.
59
+ */
60
+ textPart?: string;
61
+ };
62
+ ProjectResponseDto: {
63
+ /**
64
+ * @description The unique identifier of the project
65
+ * @example 1
66
+ */
67
+ id: number;
68
+ /**
69
+ * @description The title of the project
70
+ * @example My Awesome Project
71
+ */
72
+ title: string;
73
+ /**
74
+ * @description The unique UUID of the project used for authentication
75
+ * @example 123e4567-e89b-12d3-a456-426614174000
76
+ */
77
+ uuid: string;
78
+ /**
79
+ * @description The URL of the project
80
+ * @example https://myproject.example.com
81
+ */
82
+ url: string;
83
+ /**
84
+ * @description The support email address for the project
85
+ * @example support@example.com
86
+ */
87
+ support_email: string;
88
+ /**
89
+ * @description The slug of the project
90
+ * @example my-awesome-project
91
+ */
44
92
  slug: string;
45
- email?: string | undefined;
46
- currency?: string | undefined;
47
- language?: string | undefined;
48
- quizData?: Record<string, any> | undefined;
49
- }) => Promise<{
93
+ };
94
+ CreateProjectDto: {
95
+ /**
96
+ * @description The title of the project
97
+ * @example My Awesome Project
98
+ */
99
+ title: string;
100
+ /**
101
+ * @description The unique UUID of the project used for authentication
102
+ * @example 123e4567-e89b-12d3-a456-426614174000
103
+ */
104
+ uuid: string;
105
+ /**
106
+ * @description The URL of the project
107
+ * @example https://myproject.example.com
108
+ */
109
+ url: string;
110
+ /**
111
+ * @description The support email address for the project
112
+ * @example support@example.com
113
+ */
114
+ support_email: string;
115
+ /**
116
+ * @description The slug of the project
117
+ * @example my-awesome-project
118
+ */
119
+ slug: string;
120
+ };
121
+ UpdateProjectDto: {
122
+ /**
123
+ * @description The title of the project
124
+ * @example My Awesome Project
125
+ */
126
+ title?: string;
127
+ /**
128
+ * @description The unique UUID of the project used for authentication
129
+ * @example 123e4567-e89b-12d3-a456-426614174000
130
+ */
131
+ uuid?: string;
132
+ /**
133
+ * @description The URL of the project
134
+ * @example https://myproject.example.com
135
+ */
136
+ url?: string;
137
+ /**
138
+ * @description The support email address for the project
139
+ * @example support@example.com
140
+ */
141
+ support_email?: string;
142
+ /**
143
+ * @description The slug of the project
144
+ * @example my-awesome-project
145
+ */
146
+ slug?: string;
147
+ };
148
+ IntegrationResponseDto: {
149
+ /**
150
+ * @description The unique identifier of the integration
151
+ * @example 1
152
+ */
153
+ id: number;
154
+ /**
155
+ * @description The title of the integration
156
+ * @example My Facebook Integration
157
+ */
158
+ title: string;
159
+ /**
160
+ * @description The ID of the project this integration belongs to
161
+ * @example 1
162
+ */
163
+ projectId: number;
164
+ /**
165
+ * @description The type of integration
166
+ * @example facebook
167
+ */
168
+ type: string;
169
+ /**
170
+ * @description The URL for the integration
171
+ * @example https://example.com/api
172
+ */
173
+ url: string;
174
+ /**
175
+ * @description Additional options for the integration
176
+ * @example {
177
+ * "apiKey": "abc123",
178
+ * "enabled": true
179
+ * }
180
+ */
181
+ options?: Record<string, never>;
182
+ /** @description The project this integration belongs to */
183
+ project?: components["schemas"]["ProjectResponseDto"];
184
+ };
185
+ CreateIntegrationDto: {
186
+ /**
187
+ * @description The type of integration
188
+ * @example facebook
189
+ */
190
+ type: string;
191
+ /**
192
+ * @description The title of the integration
193
+ * @example My Facebook Integration
194
+ */
195
+ title: string;
196
+ /**
197
+ * @description The ID of the project this integration belongs to
198
+ * @example 1
199
+ */
200
+ projectId: number;
201
+ /**
202
+ * @description Additional options for the integration
203
+ * @example {
204
+ * "apiKey": "abc123",
205
+ * "enabled": true
206
+ * }
207
+ */
208
+ options?: Record<string, never>;
209
+ /**
210
+ * @description The URL for the integration
211
+ * @example https://example.com/api
212
+ */
213
+ url?: string;
214
+ };
215
+ UpdateIntegrationDto: {
216
+ /**
217
+ * @description The title of the integration
218
+ * @example Updated Facebook Integration
219
+ */
220
+ title?: string;
221
+ /**
222
+ * @description The ID of the project this integration belongs to
223
+ * @example 1
224
+ */
225
+ projectId?: number;
226
+ /**
227
+ * @description The type of integration
228
+ * @example facebook
229
+ */
230
+ type?: string;
231
+ /**
232
+ * @description The URL for the integration
233
+ * @example https://example.com/api
234
+ */
235
+ url?: string;
236
+ /**
237
+ * @description Description of the integration
238
+ * @example This is a Facebook integration for our project
239
+ */
240
+ _description?: string;
241
+ /**
242
+ * @description Additional options for the integration
243
+ * @example {
244
+ * "apiKey": "abc123",
245
+ * "enabled": true
246
+ * }
247
+ */
248
+ options?: Record<string, never>;
249
+ };
250
+ CreateWebhookDto: {
251
+ /** @description The title of the webhook */
252
+ title?: string;
253
+ /** @description The events that trigger the webhook */
254
+ events: string[];
255
+ /** @description The URL endpoint to send the webhook to */
256
+ endpoint: string;
257
+ /**
258
+ * @description The HTTP method to use when sending the webhook
259
+ * @default GET
260
+ */
261
+ method: string;
262
+ /** @description The authorization header to use when sending the webhook */
263
+ authorization?: string;
264
+ /** @description The project associated with the webhook */
265
+ project?: string;
266
+ };
267
+ WebhookResponseDto: {
268
+ /** @description The unique identifier of the webhook */
269
+ id: number;
270
+ /** @description The title of the webhook */
271
+ title?: string;
272
+ /** @description The events that trigger the webhook */
273
+ events: string[];
274
+ /** @description The URL endpoint to send the webhook to */
275
+ endpoint: string;
276
+ /**
277
+ * @description The HTTP method to use when sending the webhook
278
+ * @default GET
279
+ */
280
+ method: string;
281
+ /** @description The authorization header to use when sending the webhook */
282
+ authorization?: string;
283
+ /** @description The project associated with the webhook */
284
+ project?: string;
285
+ };
286
+ UpdateWebhookDto: {
287
+ /** @description The title of the webhook */
288
+ title?: string;
289
+ /** @description The URL endpoint to send the webhook to */
290
+ endpoint?: string;
291
+ /** @description The HTTP method to use when sending the webhook */
292
+ method?: string;
293
+ /** @description The authorization header to use when sending the webhook */
294
+ authorization?: string;
295
+ /** @description The project associated with the webhook */
296
+ project?: string;
297
+ };
298
+ FunnelTemplatesEnumDto: {
299
+ /**
300
+ * @description Available templates for the home page
301
+ * @example [
302
+ * "Default"
303
+ * ]
304
+ */
305
+ homePageTemplate: string[];
306
+ /**
307
+ * @description Available templates for the quiz page
308
+ * @example [
309
+ * "Default"
310
+ * ]
311
+ */
312
+ quizPageTemplate: string[];
313
+ /**
314
+ * @description Available templates for the result page
315
+ * @example [
316
+ * "Default"
317
+ * ]
318
+ */
319
+ resultPageTemplate: string[];
320
+ /**
321
+ * @description Available templates for the email page
322
+ * @example [
323
+ * "Default"
324
+ * ]
325
+ */
326
+ emailPageTemplate: string[];
327
+ /**
328
+ * @description Available templates for the checkout page
329
+ * @example [
330
+ * "Default"
331
+ * ]
332
+ */
333
+ checkoutPageTemplate: string[];
334
+ /**
335
+ * @description Available templates for the upsell page
336
+ * @example [
337
+ * "Default"
338
+ * ]
339
+ */
340
+ upsellPageTemplate: string[];
341
+ /**
342
+ * @description Available templates for the payment window
343
+ * @example [
344
+ * "Default"
345
+ * ]
346
+ */
347
+ paymentWindowTemplate: string[];
348
+ };
349
+ FunnelTemplatesEnumResponseDto: {
350
+ /** @description Indicates if the request was successful */
50
351
  success: boolean;
51
- data: {
52
- uuid: string;
352
+ data: components["schemas"]["FunnelTemplatesEnumDto"];
353
+ };
354
+ CreateFunnelDtoBridge: {
355
+ angle: string;
356
+ version: string;
357
+ note?: string;
358
+ home_page?: string;
359
+ quiz_page?: string;
360
+ results_page?: string;
361
+ email_page?: string;
362
+ checkout_page?: string;
363
+ payment_window?: string;
364
+ upsell_page: string;
365
+ upsell_options?: {
366
+ [key: string]: unknown;
53
367
  };
54
- }>;
55
- };
56
- crmAuth: {
57
- signIn: (data: {
58
- data: {
59
- username: string;
60
- password: string;
61
- remindMe?: boolean | undefined;
368
+ options?: {
369
+ [key: string]: unknown;
62
370
  };
63
- }) => Promise<{
64
- token: string;
65
- action: string;
66
- }>;
67
- signOut: () => Promise<{
68
- success: 1;
69
- }>;
70
- verify: () => Promise<{
71
- email: string;
371
+ };
372
+ FunnelResponseDto: {
373
+ id: number;
374
+ project: string;
375
+ angle: string;
376
+ version: string;
377
+ note?: string;
378
+ home_page: string;
379
+ quiz_page: string;
380
+ results_page: string;
381
+ email_page: string;
382
+ checkout_page: string;
383
+ payment_window: string;
384
+ upsell_page: string;
385
+ upsell_options?: Record<string, never>;
386
+ options?: Record<string, never>;
387
+ };
388
+ UpdateFunnelDto: {
389
+ project?: string;
390
+ angle?: string;
391
+ version?: string;
392
+ note?: string;
393
+ home_page?: string;
394
+ quiz_page?: string;
395
+ results_page?: string;
396
+ email_page?: string;
397
+ checkout_page?: string;
398
+ payment_window?: string;
399
+ upsell_page?: string;
400
+ upsell_options?: {
401
+ [key: string]: unknown;
402
+ };
403
+ options?: {
404
+ [key: string]: unknown;
405
+ };
406
+ };
407
+ SplitItemDto: {
408
+ url: string;
409
+ split: number;
410
+ };
411
+ CreateSplitDto: {
412
+ project: string;
413
+ url?: string;
414
+ splits?: components["schemas"]["SplitItemDto"][];
415
+ options?: {
416
+ [key: string]: unknown;
417
+ };
418
+ active: boolean;
419
+ };
420
+ SplitResponseDto: {
72
421
  id: number;
73
- firstName: string;
74
- lastName: string;
75
- }>;
422
+ project: string;
423
+ url?: string;
424
+ splits?: components["schemas"]["SplitItemDto"][];
425
+ options?: Record<string, never>;
426
+ active: boolean;
427
+ };
428
+ UpdateSplitDto: {
429
+ project?: string;
430
+ url?: string;
431
+ splits?: components["schemas"]["SplitItemDto"][];
432
+ options?: {
433
+ [key: string]: unknown;
434
+ };
435
+ active?: boolean;
436
+ };
437
+ FacebookCapiPixelDto: {
438
+ /** @example 1234567890123456 */
439
+ pixelId: string;
440
+ /** @description Facebook CAPI Access Token */
441
+ accessToken: string;
442
+ };
443
+ FacebookCapiClientDataDto: {
444
+ /**
445
+ * @description The user's email address.
446
+ * @example joe@example.com
447
+ */
448
+ email: string;
449
+ /**
450
+ * @description The user's IP address.
451
+ * @example 123.123.123.123
452
+ */
453
+ ip: string;
454
+ /**
455
+ * @description The user's browser user agent string.
456
+ * @example Mozilla/5.0 (Windows NT 10.0; Win64; x64) ...
457
+ */
458
+ userAgent: string;
459
+ /**
460
+ * @description The Facebook click ID.
461
+ * @example fb.1.1554763741205.AbCdEfGhIjKlMnOp
462
+ */
463
+ fbc: string;
464
+ /**
465
+ * @description The Facebook browser ID.
466
+ * @example fb.1.1558571054389.1098115397
467
+ */
468
+ fbp: string;
469
+ };
470
+ FacebookCapiEventDataDto: {
471
+ /** @example USD */
472
+ currency: string;
473
+ /** @example 129.99 */
474
+ total: number;
475
+ /** @example https://example.com/product/123 */
476
+ source_url: string;
477
+ };
478
+ FacebookCapiEventDto: {
479
+ /** @example EVENT_ID_123 */
480
+ eventId: string;
481
+ /** @example Purchase */
482
+ eventName: string;
483
+ /**
484
+ * @description Unix timestamp
485
+ * @example 1678886400
486
+ */
487
+ eventTime: number;
488
+ clientData: components["schemas"]["FacebookCapiClientDataDto"];
489
+ eventData: components["schemas"]["FacebookCapiEventDataDto"];
490
+ };
491
+ FacebookCapiPayloadDto: {
492
+ pixel: components["schemas"]["FacebookCapiPixelDto"];
493
+ event: components["schemas"]["FacebookCapiEventDto"];
494
+ };
495
+ TiktokCapiPixelDto: {
496
+ /** @example 1234567890123456 */
497
+ pixelId: string;
498
+ /** @description Tiktok CAPI Access Token */
499
+ accessToken: string;
500
+ };
501
+ TiktokCapiClientDataDto: {
502
+ /**
503
+ * @description The user's email address.
504
+ * @example joe@example.com
505
+ */
506
+ email: string;
507
+ /**
508
+ * @description The user's IP address.
509
+ * @example 123.123.123.123
510
+ */
511
+ ip: string;
512
+ /**
513
+ * @description The user's browser user agent string.
514
+ * @example Mozilla/5.0 (Windows NT 10.0; Win64; x64) ...
515
+ */
516
+ userAgent: string;
517
+ /**
518
+ * @description The Tiktok click ID.
519
+ * @example fb.1.1554763741205.AbCdEfGhIjKlMnOp
520
+ */
521
+ fbc: string;
522
+ /**
523
+ * @description The Tiktok browser ID.
524
+ * @example fb.1.1558571054389.1098115397
525
+ */
526
+ fbp: string;
527
+ };
528
+ TiktokCapiEventDataDto: {
529
+ /** @example USD */
530
+ currency: string;
531
+ /** @example 129.99 */
532
+ total: number;
533
+ /** @example https://example.com/product/123 */
534
+ source_url: string;
535
+ };
536
+ TiktokCapiEventDto: {
537
+ /** @example EVENT_ID_123 */
538
+ eventId: string;
539
+ /** @example Purchase */
540
+ eventName: string;
541
+ /**
542
+ * @description Unix timestamp
543
+ * @example 1678886400
544
+ */
545
+ eventTime: number;
546
+ clientData: components["schemas"]["TiktokCapiClientDataDto"];
547
+ eventData: components["schemas"]["TiktokCapiEventDataDto"];
548
+ };
549
+ TiktokCapiPayloadDto: {
550
+ pixel: components["schemas"]["TiktokCapiPixelDto"];
551
+ event: components["schemas"]["TiktokCapiEventDto"];
552
+ };
553
+ TrackRealtimeEventDto: {
554
+ type: string;
555
+ uuid?: string;
556
+ pathname: string;
557
+ referer: string;
558
+ origin: string;
559
+ /** @example {
560
+ * "session_id": "a1b2c3d4-e5f6-7890",
561
+ * "status": "active"
562
+ * } */
563
+ query: {
564
+ [key: string]: string;
565
+ };
566
+ /** @example {
567
+ * "user_id": 12345,
568
+ * "session_id": "a1b2c3d4-e5f6-7890",
569
+ * "status": "active",
570
+ * "retry_count": 3
571
+ * } */
572
+ eventData?: {
573
+ [key: string]: string | number;
574
+ };
575
+ /** @example {
576
+ * "user_id": 12345,
577
+ * "session_id": "a1b2c3d4-e5f6-7890",
578
+ * "status": "active",
579
+ * "retry_count": 3
580
+ * } */
581
+ attr?: {
582
+ [key: string]: string | number;
583
+ };
584
+ skipEvent?: boolean;
585
+ };
586
+ CreateRealtimeAttributeDtoBridge: {
587
+ attr_key: string;
588
+ attr_value: string;
589
+ funnel: string;
590
+ created_at: number;
591
+ uuid: string;
592
+ };
593
+ CreateRealtimeEventDtoBridge: {
594
+ uuid: string;
595
+ name: string;
596
+ data?: {
597
+ [key: string]: unknown;
598
+ };
599
+ order_id?: string;
600
+ created_at: number;
601
+ funnel: string;
602
+ };
603
+ CreateRealtimeSessionDtoBridge: {
604
+ uuid: string;
605
+ ip: string;
606
+ user_agent: string;
607
+ origin: string;
608
+ referer: string;
609
+ os: string;
610
+ browser: string;
611
+ type: string;
612
+ };
613
+ CreateRealtimeUtmDtoBridge: {
614
+ utm_key: string;
615
+ utm_value: string;
616
+ funnel: string;
617
+ created_at: number;
618
+ uuid: string;
619
+ };
620
+ };
621
+ responses: never;
622
+ parameters: never;
623
+ requestBodies: never;
624
+ headers: never;
625
+ pathItems: never;
626
+ }
627
+
628
+ declare const browser: {
629
+ mail: {
630
+ sendToRecipient: (data: components["schemas"]["SendMailToRecipientDto"]) => Promise<components["schemas"]["SendMailResponseDto"]>;
631
+ sendToSupport: (data: components["schemas"]["SendMailToSupportDto"]) => Promise<components["schemas"]["SendMailResponseDto"]>;
632
+ };
633
+ session: {
634
+ append: () => Promise<void>;
635
+ create: () => Promise<void>;
636
+ };
637
+ crmAuth: {
638
+ signIn: () => Promise<void>;
639
+ signOut: () => Promise<void>;
640
+ verify: () => Promise<void>;
76
641
  };
77
642
  hooks: {
78
643
  useParamsLandingPage: () => ParamsLandingPageResponse;
79
644
  };
645
+ realtime: {
646
+ trackEvent: (type: string, uuid?: string, options?: {
647
+ ga?: any;
648
+ skipGa?: boolean;
649
+ path?: {
650
+ pathname?: string;
651
+ referer?: string;
652
+ origin?: string;
653
+ length?: number;
654
+ };
655
+ attr?: {
656
+ [key: string]: string | number;
657
+ };
658
+ eventData?: {
659
+ [key: string]: string | number;
660
+ };
661
+ skipEvent?: boolean;
662
+ }) => Promise<void>;
663
+ };
80
664
  };
81
665
  declare const server: {
82
- middleware: (req: next_server.NextRequest) => Promise<any>;
666
+ middleware: (req: next_server.NextRequest) => Promise<next_server.NextResponse<unknown> | undefined>;
83
667
  };
84
668
 
85
669
  export { browser, server };