@voyantjs/crm 0.106.1 → 0.107.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.
Files changed (51) hide show
  1. package/README.md +3 -3
  2. package/dist/booking-extension.d.ts +7 -7
  3. package/dist/booking-extension.d.ts.map +1 -1
  4. package/dist/booking-extension.js +8 -5
  5. package/dist/index.d.ts +5 -3
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +3 -2
  8. package/dist/routes/activities.d.ts +2 -2
  9. package/dist/routes/custom-fields.d.ts +6 -6
  10. package/dist/routes/index.d.ts +518 -51
  11. package/dist/routes/index.d.ts.map +1 -1
  12. package/dist/routes/index.js +2 -2
  13. package/dist/routes/pipelines.d.ts +4 -4
  14. package/dist/routes/quote-versions.d.ts +746 -0
  15. package/dist/routes/quote-versions.d.ts.map +1 -0
  16. package/dist/routes/quote-versions.js +175 -0
  17. package/dist/routes/quotes.d.ts +161 -53
  18. package/dist/routes/quotes.d.ts.map +1 -1
  19. package/dist/routes/quotes.js +29 -11
  20. package/dist/schema-activities.d.ts +6 -6
  21. package/dist/schema-relations.d.ts +19 -18
  22. package/dist/schema-relations.d.ts.map +1 -1
  23. package/dist/schema-relations.js +38 -31
  24. package/dist/schema-sales.d.ts +206 -87
  25. package/dist/schema-sales.d.ts.map +1 -1
  26. package/dist/schema-sales.js +62 -50
  27. package/dist/schema-shared.d.ts +3 -3
  28. package/dist/schema-shared.d.ts.map +1 -1
  29. package/dist/schema-shared.js +5 -16
  30. package/dist/schema-signals.d.ts +1 -1
  31. package/dist/schema-signals.js +1 -1
  32. package/dist/service/accounts-merge.js +10 -10
  33. package/dist/service/activities.d.ts +6 -6
  34. package/dist/service/custom-fields.d.ts +6 -6
  35. package/dist/service/index.d.ts +338 -139
  36. package/dist/service/index.d.ts.map +1 -1
  37. package/dist/service/index.js +2 -2
  38. package/dist/service/pipelines.d.ts +4 -4
  39. package/dist/service/quote-versions.d.ts +674 -0
  40. package/dist/service/quote-versions.d.ts.map +1 -0
  41. package/dist/service/quote-versions.js +399 -0
  42. package/dist/service/quotes.d.ts +426 -94
  43. package/dist/service/quotes.d.ts.map +1 -1
  44. package/dist/service/quotes.js +63 -22
  45. package/package.json +7 -7
  46. package/dist/routes/opportunities.d.ts +0 -387
  47. package/dist/routes/opportunities.d.ts.map +0 -1
  48. package/dist/routes/opportunities.js +0 -70
  49. package/dist/service/opportunities.d.ts +0 -822
  50. package/dist/service/opportunities.d.ts.map +0 -1
  51. package/dist/service/opportunities.js +0 -117
@@ -0,0 +1,746 @@
1
+ import type { PostgresJsDatabase } from "drizzle-orm/postgres-js";
2
+ type Env = {
3
+ Variables: {
4
+ db: PostgresJsDatabase;
5
+ userId?: string;
6
+ };
7
+ };
8
+ export declare const quoteVersionRoutes: import("hono/hono-base").HonoBase<Env, {
9
+ "/quote-versions": {
10
+ $get: {
11
+ input: {};
12
+ output: {
13
+ data: {
14
+ id: string;
15
+ quoteId: string;
16
+ label: string | null;
17
+ status: "expired" | "superseded" | "draft" | "sent" | "accepted" | "declined";
18
+ supersedesId: string | null;
19
+ tripSnapshotId: string | null;
20
+ validUntil: string | null;
21
+ currency: string;
22
+ subtotalAmountCents: number;
23
+ taxAmountCents: number;
24
+ totalAmountCents: number;
25
+ notes: string | null;
26
+ sentAt: string | null;
27
+ viewedAt: string | null;
28
+ decidedAt: string | null;
29
+ createdAt: string;
30
+ updatedAt: string;
31
+ archivedAt: string | null;
32
+ }[];
33
+ total: number;
34
+ limit: number;
35
+ offset: number;
36
+ };
37
+ outputFormat: "json";
38
+ status: import("hono/utils/http-status").ContentfulStatusCode;
39
+ };
40
+ };
41
+ } & {
42
+ "/quotes/:id/versions": {
43
+ $post: {
44
+ input: {
45
+ param: {
46
+ id: string;
47
+ };
48
+ };
49
+ output: {
50
+ data: {
51
+ id: string;
52
+ status: "expired" | "superseded" | "draft" | "sent" | "accepted" | "declined";
53
+ createdAt: string;
54
+ decidedAt: string | null;
55
+ updatedAt: string;
56
+ currency: string;
57
+ notes: string | null;
58
+ quoteId: string;
59
+ label: string | null;
60
+ archivedAt: string | null;
61
+ sentAt: string | null;
62
+ supersedesId: string | null;
63
+ tripSnapshotId: string | null;
64
+ validUntil: string | null;
65
+ subtotalAmountCents: number;
66
+ taxAmountCents: number;
67
+ totalAmountCents: number;
68
+ viewedAt: string | null;
69
+ } | undefined;
70
+ };
71
+ outputFormat: "json";
72
+ status: 201;
73
+ } | {
74
+ input: {
75
+ param: {
76
+ id: string;
77
+ };
78
+ };
79
+ output: {
80
+ error: string;
81
+ };
82
+ outputFormat: "json";
83
+ status: 409;
84
+ };
85
+ };
86
+ } & {
87
+ "/quote-versions/expire": {
88
+ $post: {
89
+ input: {};
90
+ output: {
91
+ data: {
92
+ id: string;
93
+ quoteId: string;
94
+ label: string | null;
95
+ status: "expired" | "superseded" | "draft" | "sent" | "accepted" | "declined";
96
+ supersedesId: string | null;
97
+ tripSnapshotId: string | null;
98
+ validUntil: string | null;
99
+ currency: string;
100
+ subtotalAmountCents: number;
101
+ taxAmountCents: number;
102
+ totalAmountCents: number;
103
+ notes: string | null;
104
+ sentAt: string | null;
105
+ viewedAt: string | null;
106
+ decidedAt: string | null;
107
+ createdAt: string;
108
+ updatedAt: string;
109
+ archivedAt: string | null;
110
+ }[];
111
+ };
112
+ outputFormat: "json";
113
+ status: import("hono/utils/http-status").ContentfulStatusCode;
114
+ };
115
+ };
116
+ } & {
117
+ "/quote-versions/:id": {
118
+ $get: {
119
+ input: {
120
+ param: {
121
+ id: string;
122
+ };
123
+ };
124
+ output: {
125
+ error: string;
126
+ };
127
+ outputFormat: "json";
128
+ status: 404;
129
+ } | {
130
+ input: {
131
+ param: {
132
+ id: string;
133
+ };
134
+ };
135
+ output: {
136
+ data: {
137
+ id: string;
138
+ quoteId: string;
139
+ label: string | null;
140
+ status: "expired" | "superseded" | "draft" | "sent" | "accepted" | "declined";
141
+ supersedesId: string | null;
142
+ tripSnapshotId: string | null;
143
+ validUntil: string | null;
144
+ currency: string;
145
+ subtotalAmountCents: number;
146
+ taxAmountCents: number;
147
+ totalAmountCents: number;
148
+ notes: string | null;
149
+ sentAt: string | null;
150
+ viewedAt: string | null;
151
+ decidedAt: string | null;
152
+ createdAt: string;
153
+ updatedAt: string;
154
+ archivedAt: string | null;
155
+ };
156
+ };
157
+ outputFormat: "json";
158
+ status: import("hono/utils/http-status").ContentfulStatusCode;
159
+ };
160
+ };
161
+ } & {
162
+ "/quote-versions/:id": {
163
+ $patch: {
164
+ input: {
165
+ param: {
166
+ id: string;
167
+ };
168
+ };
169
+ output: {
170
+ error: string;
171
+ };
172
+ outputFormat: "json";
173
+ status: 404;
174
+ } | {
175
+ input: {
176
+ param: {
177
+ id: string;
178
+ };
179
+ };
180
+ output: {
181
+ data: {
182
+ id: string;
183
+ quoteId: string;
184
+ label: string | null;
185
+ status: "expired" | "superseded" | "draft" | "sent" | "accepted" | "declined";
186
+ supersedesId: string | null;
187
+ tripSnapshotId: string | null;
188
+ validUntil: string | null;
189
+ currency: string;
190
+ subtotalAmountCents: number;
191
+ taxAmountCents: number;
192
+ totalAmountCents: number;
193
+ notes: string | null;
194
+ sentAt: string | null;
195
+ viewedAt: string | null;
196
+ decidedAt: string | null;
197
+ createdAt: string;
198
+ updatedAt: string;
199
+ archivedAt: string | null;
200
+ };
201
+ };
202
+ outputFormat: "json";
203
+ status: import("hono/utils/http-status").ContentfulStatusCode;
204
+ } | {
205
+ input: {
206
+ param: {
207
+ id: string;
208
+ };
209
+ };
210
+ output: {
211
+ error: string;
212
+ };
213
+ outputFormat: "json";
214
+ status: 409;
215
+ };
216
+ };
217
+ } & {
218
+ "/quote-versions/:id": {
219
+ $delete: {
220
+ input: {
221
+ param: {
222
+ id: string;
223
+ };
224
+ };
225
+ output: {
226
+ error: string;
227
+ };
228
+ outputFormat: "json";
229
+ status: 404;
230
+ } | {
231
+ input: {
232
+ param: {
233
+ id: string;
234
+ };
235
+ };
236
+ output: {
237
+ success: true;
238
+ };
239
+ outputFormat: "json";
240
+ status: import("hono/utils/http-status").ContentfulStatusCode;
241
+ } | {
242
+ input: {
243
+ param: {
244
+ id: string;
245
+ };
246
+ };
247
+ output: {
248
+ error: string;
249
+ };
250
+ outputFormat: "json";
251
+ status: 409;
252
+ };
253
+ };
254
+ } & {
255
+ "/quote-versions/:id/trip-snapshot": {
256
+ $post: {
257
+ input: {
258
+ param: {
259
+ id: string;
260
+ };
261
+ };
262
+ output: {
263
+ error: string;
264
+ };
265
+ outputFormat: "json";
266
+ status: 404;
267
+ } | {
268
+ input: {
269
+ param: {
270
+ id: string;
271
+ };
272
+ };
273
+ output: {
274
+ data: {
275
+ quoteVersion: {
276
+ id: string;
277
+ quoteId: string;
278
+ label: string | null;
279
+ status: "expired" | "superseded" | "draft" | "sent" | "accepted" | "declined";
280
+ supersedesId: string | null;
281
+ tripSnapshotId: string | null;
282
+ validUntil: string | null;
283
+ currency: string;
284
+ subtotalAmountCents: number;
285
+ taxAmountCents: number;
286
+ totalAmountCents: number;
287
+ notes: string | null;
288
+ sentAt: string | null;
289
+ viewedAt: string | null;
290
+ decidedAt: string | null;
291
+ createdAt: string;
292
+ updatedAt: string;
293
+ archivedAt: string | null;
294
+ };
295
+ lines: {
296
+ id: string;
297
+ description: string;
298
+ createdAt: string;
299
+ updatedAt: string;
300
+ currency: string;
301
+ quoteVersionId: string;
302
+ productId: string | null;
303
+ supplierServiceId: string | null;
304
+ quantity: number;
305
+ unitPriceAmountCents: number;
306
+ totalAmountCents: number;
307
+ }[];
308
+ };
309
+ };
310
+ outputFormat: "json";
311
+ status: import("hono/utils/http-status").ContentfulStatusCode;
312
+ } | {
313
+ input: {
314
+ param: {
315
+ id: string;
316
+ };
317
+ };
318
+ output: {
319
+ error: string;
320
+ };
321
+ outputFormat: "json";
322
+ status: 409;
323
+ };
324
+ };
325
+ } & {
326
+ "/quote-versions/:id/send": {
327
+ $post: {
328
+ input: {
329
+ param: {
330
+ id: string;
331
+ };
332
+ };
333
+ output: {
334
+ error: string;
335
+ };
336
+ outputFormat: "json";
337
+ status: 404;
338
+ } | {
339
+ input: {
340
+ param: {
341
+ id: string;
342
+ };
343
+ };
344
+ output: {
345
+ data: {
346
+ id: string;
347
+ quoteId: string;
348
+ label: string | null;
349
+ status: "expired" | "superseded" | "draft" | "sent" | "accepted" | "declined";
350
+ supersedesId: string | null;
351
+ tripSnapshotId: string | null;
352
+ validUntil: string | null;
353
+ currency: string;
354
+ subtotalAmountCents: number;
355
+ taxAmountCents: number;
356
+ totalAmountCents: number;
357
+ notes: string | null;
358
+ sentAt: string | null;
359
+ viewedAt: string | null;
360
+ decidedAt: string | null;
361
+ createdAt: string;
362
+ updatedAt: string;
363
+ archivedAt: string | null;
364
+ };
365
+ };
366
+ outputFormat: "json";
367
+ status: import("hono/utils/http-status").ContentfulStatusCode;
368
+ } | {
369
+ input: {
370
+ param: {
371
+ id: string;
372
+ };
373
+ };
374
+ output: {
375
+ error: string;
376
+ };
377
+ outputFormat: "json";
378
+ status: 409;
379
+ };
380
+ };
381
+ } & {
382
+ "/quote-versions/:id/view": {
383
+ $post: {
384
+ input: {
385
+ param: {
386
+ id: string;
387
+ };
388
+ };
389
+ output: {
390
+ error: string;
391
+ };
392
+ outputFormat: "json";
393
+ status: 404;
394
+ } | {
395
+ input: {
396
+ param: {
397
+ id: string;
398
+ };
399
+ };
400
+ output: {
401
+ data: {
402
+ id: string;
403
+ quoteId: string;
404
+ label: string | null;
405
+ status: "expired" | "superseded" | "draft" | "sent" | "accepted" | "declined";
406
+ supersedesId: string | null;
407
+ tripSnapshotId: string | null;
408
+ validUntil: string | null;
409
+ currency: string;
410
+ subtotalAmountCents: number;
411
+ taxAmountCents: number;
412
+ totalAmountCents: number;
413
+ notes: string | null;
414
+ sentAt: string | null;
415
+ viewedAt: string | null;
416
+ decidedAt: string | null;
417
+ createdAt: string;
418
+ updatedAt: string;
419
+ archivedAt: string | null;
420
+ };
421
+ };
422
+ outputFormat: "json";
423
+ status: import("hono/utils/http-status").ContentfulStatusCode;
424
+ };
425
+ };
426
+ } & {
427
+ "/quote-versions/:id/accept": {
428
+ $post: {
429
+ input: {
430
+ param: {
431
+ id: string;
432
+ };
433
+ };
434
+ output: {
435
+ error: string;
436
+ };
437
+ outputFormat: "json";
438
+ status: 404;
439
+ } | {
440
+ input: {
441
+ param: {
442
+ id: string;
443
+ };
444
+ };
445
+ output: {
446
+ data: {
447
+ quote: {
448
+ id: string;
449
+ status: "lost" | "archived" | "open" | "won";
450
+ organizationId: string | null;
451
+ createdAt: string;
452
+ source: string | null;
453
+ updatedAt: string;
454
+ title: string;
455
+ ownerId: string | null;
456
+ sourceRef: string | null;
457
+ tags: string[];
458
+ personId: string | null;
459
+ pipelineId: string;
460
+ stageId: string;
461
+ acceptedVersionId: string | null;
462
+ valueAmountCents: number | null;
463
+ valueCurrency: string | null;
464
+ expectedCloseDate: string | null;
465
+ lostReason: string | null;
466
+ stageChangedAt: string;
467
+ closedAt: string | null;
468
+ };
469
+ quoteVersion: {
470
+ id: string;
471
+ status: "expired" | "superseded" | "draft" | "sent" | "accepted" | "declined";
472
+ createdAt: string;
473
+ decidedAt: string | null;
474
+ updatedAt: string;
475
+ currency: string;
476
+ notes: string | null;
477
+ quoteId: string;
478
+ label: string | null;
479
+ archivedAt: string | null;
480
+ sentAt: string | null;
481
+ supersedesId: string | null;
482
+ tripSnapshotId: string | null;
483
+ validUntil: string | null;
484
+ subtotalAmountCents: number;
485
+ taxAmountCents: number;
486
+ totalAmountCents: number;
487
+ viewedAt: string | null;
488
+ };
489
+ closedQuoteVersions: {
490
+ id: string;
491
+ status: "expired" | "superseded" | "draft" | "sent" | "accepted" | "declined";
492
+ createdAt: string;
493
+ decidedAt: string | null;
494
+ updatedAt: string;
495
+ currency: string;
496
+ notes: string | null;
497
+ quoteId: string;
498
+ label: string | null;
499
+ archivedAt: string | null;
500
+ sentAt: string | null;
501
+ supersedesId: string | null;
502
+ tripSnapshotId: string | null;
503
+ validUntil: string | null;
504
+ subtotalAmountCents: number;
505
+ taxAmountCents: number;
506
+ totalAmountCents: number;
507
+ viewedAt: string | null;
508
+ }[];
509
+ };
510
+ };
511
+ outputFormat: "json";
512
+ status: import("hono/utils/http-status").ContentfulStatusCode;
513
+ } | {
514
+ input: {
515
+ param: {
516
+ id: string;
517
+ };
518
+ };
519
+ output: {
520
+ error: string;
521
+ };
522
+ outputFormat: "json";
523
+ status: 409;
524
+ };
525
+ };
526
+ } & {
527
+ "/quote-versions/:id/decline": {
528
+ $post: {
529
+ input: {
530
+ param: {
531
+ id: string;
532
+ };
533
+ };
534
+ output: {
535
+ error: string;
536
+ };
537
+ outputFormat: "json";
538
+ status: 404;
539
+ } | {
540
+ input: {
541
+ param: {
542
+ id: string;
543
+ };
544
+ };
545
+ output: {
546
+ data: {
547
+ id: string;
548
+ quoteId: string;
549
+ label: string | null;
550
+ status: "expired" | "superseded" | "draft" | "sent" | "accepted" | "declined";
551
+ supersedesId: string | null;
552
+ tripSnapshotId: string | null;
553
+ validUntil: string | null;
554
+ currency: string;
555
+ subtotalAmountCents: number;
556
+ taxAmountCents: number;
557
+ totalAmountCents: number;
558
+ notes: string | null;
559
+ sentAt: string | null;
560
+ viewedAt: string | null;
561
+ decidedAt: string | null;
562
+ createdAt: string;
563
+ updatedAt: string;
564
+ archivedAt: string | null;
565
+ };
566
+ };
567
+ outputFormat: "json";
568
+ status: import("hono/utils/http-status").ContentfulStatusCode;
569
+ } | {
570
+ input: {
571
+ param: {
572
+ id: string;
573
+ };
574
+ };
575
+ output: {
576
+ error: string;
577
+ };
578
+ outputFormat: "json";
579
+ status: 409;
580
+ };
581
+ };
582
+ } & {
583
+ "/quote-versions/:id/lines": {
584
+ $get: {
585
+ input: {
586
+ param: {
587
+ id: string;
588
+ };
589
+ };
590
+ output: {
591
+ data: {
592
+ id: string;
593
+ quoteVersionId: string;
594
+ productId: string | null;
595
+ supplierServiceId: string | null;
596
+ description: string;
597
+ quantity: number;
598
+ unitPriceAmountCents: number;
599
+ totalAmountCents: number;
600
+ currency: string;
601
+ createdAt: string;
602
+ updatedAt: string;
603
+ }[];
604
+ };
605
+ outputFormat: "json";
606
+ status: import("hono/utils/http-status").ContentfulStatusCode;
607
+ };
608
+ };
609
+ } & {
610
+ "/quote-versions/:id/lines": {
611
+ $post: {
612
+ input: {
613
+ param: {
614
+ id: string;
615
+ };
616
+ };
617
+ output: {
618
+ error: string;
619
+ };
620
+ outputFormat: "json";
621
+ status: 404;
622
+ } | {
623
+ input: {
624
+ param: {
625
+ id: string;
626
+ };
627
+ };
628
+ output: {
629
+ data: {
630
+ id: string;
631
+ description: string;
632
+ createdAt: string;
633
+ updatedAt: string;
634
+ currency: string;
635
+ quoteVersionId: string;
636
+ productId: string | null;
637
+ supplierServiceId: string | null;
638
+ quantity: number;
639
+ unitPriceAmountCents: number;
640
+ totalAmountCents: number;
641
+ };
642
+ };
643
+ outputFormat: "json";
644
+ status: 201;
645
+ } | {
646
+ input: {
647
+ param: {
648
+ id: string;
649
+ };
650
+ };
651
+ output: {
652
+ error: string;
653
+ };
654
+ outputFormat: "json";
655
+ status: 409;
656
+ };
657
+ };
658
+ } & {
659
+ "/quote-version-lines/:id": {
660
+ $patch: {
661
+ input: {
662
+ param: {
663
+ id: string;
664
+ };
665
+ };
666
+ output: {
667
+ error: string;
668
+ };
669
+ outputFormat: "json";
670
+ status: 404;
671
+ } | {
672
+ input: {
673
+ param: {
674
+ id: string;
675
+ };
676
+ };
677
+ output: {
678
+ data: {
679
+ id: string;
680
+ quoteVersionId: string;
681
+ productId: string | null;
682
+ supplierServiceId: string | null;
683
+ description: string;
684
+ quantity: number;
685
+ unitPriceAmountCents: number;
686
+ totalAmountCents: number;
687
+ currency: string;
688
+ createdAt: string;
689
+ updatedAt: string;
690
+ };
691
+ };
692
+ outputFormat: "json";
693
+ status: import("hono/utils/http-status").ContentfulStatusCode;
694
+ } | {
695
+ input: {
696
+ param: {
697
+ id: string;
698
+ };
699
+ };
700
+ output: {
701
+ error: string;
702
+ };
703
+ outputFormat: "json";
704
+ status: 409;
705
+ };
706
+ };
707
+ } & {
708
+ "/quote-version-lines/:id": {
709
+ $delete: {
710
+ input: {
711
+ param: {
712
+ id: string;
713
+ };
714
+ };
715
+ output: {
716
+ error: string;
717
+ };
718
+ outputFormat: "json";
719
+ status: 404;
720
+ } | {
721
+ input: {
722
+ param: {
723
+ id: string;
724
+ };
725
+ };
726
+ output: {
727
+ success: true;
728
+ };
729
+ outputFormat: "json";
730
+ status: import("hono/utils/http-status").ContentfulStatusCode;
731
+ } | {
732
+ input: {
733
+ param: {
734
+ id: string;
735
+ };
736
+ };
737
+ output: {
738
+ error: string;
739
+ };
740
+ outputFormat: "json";
741
+ status: 409;
742
+ };
743
+ };
744
+ }, "/", "/quote-version-lines/:id">;
745
+ export {};
746
+ //# sourceMappingURL=quote-versions.d.ts.map