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