balendar 0.0.9 → 0.0.11

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.
@@ -60,7 +60,7 @@ export declare function createBalendar(config: BalendarConfig): {
60
60
  }>>;
61
61
  };
62
62
  api: {
63
- calendars: {
63
+ "calendars-public": {
64
64
  connections: ((params: {
65
65
  provider: string | number;
66
66
  }) => {
@@ -90,71 +90,8 @@ export declare function createBalendar(config: BalendarConfig): {
90
90
  };
91
91
  }>>;
92
92
  };
93
- } & ((params: {
94
- userId: string | number;
95
- }) => {
96
- oauth: {
97
- url: {
98
- get: (options?: {
99
- headers?: Record<string, unknown> | undefined;
100
- query?: Record<string, unknown> | undefined;
101
- fetch?: RequestInit | undefined;
102
- } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
103
- 500: {
104
- error: string;
105
- };
106
- 200: {
107
- url: string;
108
- };
109
- 422: {
110
- type: "validation";
111
- on: string;
112
- summary?: string;
113
- message?: string;
114
- found?: unknown;
115
- property?: string;
116
- expected?: string;
117
- };
118
- }>>;
119
- };
120
- };
121
- })) & {};
122
- webhooks: ((params: {
123
- userId: string | number;
124
- }) => {
125
- handle: {
126
- post: (body?: any, options?: {
127
- headers?: Record<string, unknown> | undefined;
128
- query?: Record<string, unknown> | undefined;
129
- fetch?: RequestInit | undefined;
130
- } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
131
- 500: {
132
- error: string;
133
- };
134
- 200: {
135
- success: boolean;
136
- calendarExternalId?: string | undefined;
137
- resourceId?: string | undefined;
138
- error?: string | undefined;
139
- };
140
- 400: {
141
- error: string;
142
- };
143
- 404: {
144
- error: string;
145
- };
146
- 422: {
147
- type: "validation";
148
- on: string;
149
- summary?: string;
150
- message?: string;
151
- found?: unknown;
152
- property?: string;
153
- expected?: string;
154
- };
155
- }>>;
156
- };
157
- }) & {
93
+ }) & {};
94
+ webhooks: {
158
95
  google: {
159
96
  post: (body?: any, options?: {
160
97
  headers?: Record<string, unknown> | undefined;
@@ -184,129 +121,6 @@ export declare function createBalendar(config: BalendarConfig): {
184
121
  }>>;
185
122
  };
186
123
  };
187
- events: ((params: {
188
- eventId: string | number;
189
- }) => {
190
- patch: (body: {
191
- userId: number;
192
- status?: "confirmed" | "cancelled" | "tentative" | undefined;
193
- title?: string | undefined;
194
- description?: string | null | undefined;
195
- startTime?: string | undefined;
196
- endTime?: string | undefined;
197
- location?: string | null | undefined;
198
- busyStatus?: "busy" | "free" | undefined;
199
- }, options?: {
200
- headers?: Record<string, unknown> | undefined;
201
- query?: Record<string, unknown> | undefined;
202
- fetch?: RequestInit | undefined;
203
- } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
204
- 500: {
205
- error: string;
206
- };
207
- 200: {
208
- userId: number;
209
- title: string;
210
- startTime: string;
211
- endTime: string;
212
- status: "confirmed" | "cancelled" | "tentative";
213
- busyStatus: "busy" | "free";
214
- createdAt: string;
215
- updatedAt: string;
216
- eventId: number;
217
- bookingId: number | null;
218
- description: string | null;
219
- location: string | null;
220
- };
221
- 400: {
222
- error: string;
223
- };
224
- 404: {
225
- error: string;
226
- };
227
- 422: {
228
- type: "validation";
229
- on: string;
230
- summary?: string;
231
- message?: string;
232
- found?: unknown;
233
- property?: string;
234
- expected?: string;
235
- };
236
- }>>;
237
- delete: (body: {
238
- userId: number;
239
- }, options?: {
240
- headers?: Record<string, unknown> | undefined;
241
- query?: Record<string, unknown> | undefined;
242
- fetch?: RequestInit | undefined;
243
- } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
244
- 500: {
245
- error: string;
246
- };
247
- 200: {
248
- success: boolean;
249
- };
250
- 404: {
251
- error: string;
252
- };
253
- 422: {
254
- type: "validation";
255
- on: string;
256
- summary?: string;
257
- message?: string;
258
- found?: unknown;
259
- property?: string;
260
- expected?: string;
261
- };
262
- }>>;
263
- }) & {
264
- post: (body: {
265
- userId: number;
266
- bookingId: number | null;
267
- title: string;
268
- description: string | null;
269
- location: string | null;
270
- startTime: string;
271
- endTime: string;
272
- status: "confirmed" | "cancelled" | "tentative";
273
- busyStatus: "busy" | "free";
274
- }, options?: {
275
- headers?: Record<string, unknown> | undefined;
276
- query?: Record<string, unknown> | undefined;
277
- fetch?: RequestInit | undefined;
278
- } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
279
- 500: {
280
- error: string;
281
- };
282
- 200: {
283
- userId: number;
284
- title: string;
285
- startTime: string;
286
- endTime: string;
287
- status: "confirmed" | "cancelled" | "tentative";
288
- busyStatus: "busy" | "free";
289
- createdAt: string;
290
- updatedAt: string;
291
- eventId: number;
292
- bookingId: number | null;
293
- description: string | null;
294
- location: string | null;
295
- };
296
- 400: {
297
- error: string;
298
- };
299
- 422: {
300
- type: "validation";
301
- on: string;
302
- summary?: string;
303
- message?: string;
304
- found?: unknown;
305
- property?: string;
306
- expected?: string;
307
- };
308
- }>>;
309
- };
310
124
  };
311
125
  events: ((params: {
312
126
  eventId: string | number;
@@ -708,44 +522,203 @@ export declare function createBalendar(config: BalendarConfig): {
708
522
  }>>;
709
523
  };
710
524
  };
711
- availability: {
712
- "user-time-slots": {
713
- post: (body: {
714
- filters: {
715
- dateFrom: string;
716
- dateTo: string;
717
- timeFrom: string;
718
- timeTo: string;
719
- userId: number;
720
- bookingLocations: {
721
- bookingLocationId: number;
722
- bufferMinutes: number;
723
- leadMinutes: number;
525
+ "user-time-slots": {
526
+ post: (body: {
527
+ filters: {
528
+ dateFrom: string;
529
+ dateTo: string;
530
+ timeFrom: string;
531
+ timeTo: string;
532
+ userId: number;
533
+ bookingLocations: {
534
+ bookingLocationId: number;
535
+ bufferMinutes: number;
536
+ leadMinutes: number;
537
+ }[];
538
+ bookingDurationMinutes: number;
539
+ slotGapMinutes: number;
540
+ timeZone: string;
541
+ };
542
+ }, options?: {
543
+ headers?: Record<string, unknown> | undefined;
544
+ query?: Record<string, unknown> | undefined;
545
+ fetch?: RequestInit | undefined;
546
+ } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
547
+ 200: {
548
+ userId: number;
549
+ timeZone: string;
550
+ bookingLocationAvailability: {
551
+ bookingLocationId: number;
552
+ timeSlotCount: number;
553
+ timeSlots: {
554
+ date: string;
555
+ time: string[];
724
556
  }[];
725
- bookingDurationMinutes: number;
726
- slotGapMinutes: number;
727
- timeZone: string;
557
+ }[];
558
+ };
559
+ 400: {
560
+ error: string;
561
+ };
562
+ 422: {
563
+ type: "validation";
564
+ on: string;
565
+ summary?: string;
566
+ message?: string;
567
+ found?: unknown;
568
+ property?: string;
569
+ expected?: string;
570
+ };
571
+ }>>;
572
+ };
573
+ "users-time-slots": {
574
+ post: (body: {
575
+ baseFilters: {
576
+ dateFrom: string;
577
+ dateTo: string;
578
+ timeFrom: string;
579
+ timeTo: string;
580
+ };
581
+ userFilters: {
582
+ userId: number;
583
+ bookingLocations: {
584
+ bookingLocationId: number;
585
+ bufferMinutes: number;
586
+ leadMinutes: number;
587
+ }[];
588
+ bookingDurationMinutes: number;
589
+ slotGapMinutes: number;
590
+ timeZone: string;
591
+ }[];
592
+ }, options?: {
593
+ headers?: Record<string, unknown> | undefined;
594
+ query?: Record<string, unknown> | undefined;
595
+ fetch?: RequestInit | undefined;
596
+ } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
597
+ 200: {
598
+ userId: number;
599
+ timeZone: string;
600
+ bookingLocationAvailability: {
601
+ bookingLocationId: number;
602
+ timeSlotCount: number;
603
+ timeSlots: {
604
+ date: string;
605
+ time: string[];
606
+ }[];
607
+ }[];
608
+ }[];
609
+ 400: {
610
+ error: string;
611
+ };
612
+ 422: {
613
+ type: "validation";
614
+ on: string;
615
+ summary?: string;
616
+ message?: string;
617
+ found?: unknown;
618
+ property?: string;
619
+ expected?: string;
620
+ };
621
+ }>>;
622
+ };
623
+ calendars: {
624
+ connections: ((params: {
625
+ provider: string | number;
626
+ }) => {} & ((params: {
627
+ userId: string | number;
628
+ }) => {
629
+ oauth: {
630
+ url: {
631
+ get: (options?: {
632
+ headers?: Record<string, unknown> | undefined;
633
+ query?: Record<string, unknown> | undefined;
634
+ fetch?: RequestInit | undefined;
635
+ } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
636
+ 500: {
637
+ error: string;
638
+ };
639
+ 200: {
640
+ url: string;
641
+ };
642
+ 422: {
643
+ type: "validation";
644
+ on: string;
645
+ summary?: string;
646
+ message?: string;
647
+ found?: unknown;
648
+ property?: string;
649
+ expected?: string;
650
+ };
651
+ }>>;
728
652
  };
653
+ };
654
+ })) & {
655
+ check: ((params: {
656
+ userId: string | number;
657
+ }) => {
658
+ get: (options?: {
659
+ headers?: Record<string, unknown> | undefined;
660
+ query?: Record<string, unknown> | undefined;
661
+ fetch?: RequestInit | undefined;
662
+ } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
663
+ 500: {
664
+ error: string;
665
+ };
666
+ 200: {
667
+ connected: boolean;
668
+ provider: "apple" | "google" | "microsoft" | null;
669
+ };
670
+ 422: {
671
+ type: "validation";
672
+ on: string;
673
+ summary?: string;
674
+ message?: string;
675
+ found?: unknown;
676
+ property?: string;
677
+ expected?: string;
678
+ };
679
+ }>>;
680
+ }) & {};
681
+ };
682
+ events: ((params: {
683
+ eventId: string | number;
684
+ }) => {
685
+ patch: (body: {
686
+ userId: number;
687
+ title?: string | undefined;
688
+ description?: string | null | undefined;
689
+ status?: "confirmed" | "cancelled" | "tentative" | undefined;
690
+ startTime?: string | undefined;
691
+ endTime?: string | undefined;
692
+ location?: string | null | undefined;
693
+ busyStatus?: "busy" | "free" | undefined;
729
694
  }, options?: {
730
695
  headers?: Record<string, unknown> | undefined;
731
696
  query?: Record<string, unknown> | undefined;
732
697
  fetch?: RequestInit | undefined;
733
698
  } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
699
+ 500: {
700
+ error: string;
701
+ };
734
702
  200: {
735
703
  userId: number;
736
- timeZone: string;
737
- bookingLocationAvailability: {
738
- bookingLocationId: number;
739
- timeSlotCount: number;
740
- timeSlots: {
741
- date: string;
742
- time: string[];
743
- }[];
744
- }[];
704
+ title: string;
705
+ startTime: string;
706
+ endTime: string;
707
+ status: "confirmed" | "cancelled" | "tentative";
708
+ busyStatus: "busy" | "free";
709
+ createdAt: string;
710
+ updatedAt: string;
711
+ eventId: number;
712
+ bookingId: number | null;
713
+ description: string | null;
714
+ location: string | null;
745
715
  };
746
716
  400: {
747
717
  error: string;
748
718
  };
719
+ 404: {
720
+ error: string;
721
+ };
749
722
  422: {
750
723
  type: "validation";
751
724
  on: string;
@@ -756,43 +729,65 @@ export declare function createBalendar(config: BalendarConfig): {
756
729
  expected?: string;
757
730
  };
758
731
  }>>;
759
- };
760
- "users-time-slots": {
761
- post: (body: {
762
- baseFilters: {
763
- dateFrom: string;
764
- dateTo: string;
765
- timeFrom: string;
766
- timeTo: string;
732
+ delete: (body: {
733
+ userId: number;
734
+ }, options?: {
735
+ headers?: Record<string, unknown> | undefined;
736
+ query?: Record<string, unknown> | undefined;
737
+ fetch?: RequestInit | undefined;
738
+ } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
739
+ 500: {
740
+ error: string;
767
741
  };
768
- userFilters: {
769
- userId: number;
770
- bookingLocations: {
771
- bookingLocationId: number;
772
- bufferMinutes: number;
773
- leadMinutes: number;
774
- }[];
775
- bookingDurationMinutes: number;
776
- slotGapMinutes: number;
777
- timeZone: string;
778
- }[];
742
+ 200: {
743
+ success: boolean;
744
+ };
745
+ 404: {
746
+ error: string;
747
+ };
748
+ 422: {
749
+ type: "validation";
750
+ on: string;
751
+ summary?: string;
752
+ message?: string;
753
+ found?: unknown;
754
+ property?: string;
755
+ expected?: string;
756
+ };
757
+ }>>;
758
+ }) & {
759
+ post: (body: {
760
+ userId: number;
761
+ bookingId: number | null;
762
+ title: string;
763
+ description: string | null;
764
+ location: string | null;
765
+ startTime: string;
766
+ endTime: string;
767
+ status: "confirmed" | "cancelled" | "tentative";
768
+ busyStatus: "busy" | "free";
779
769
  }, options?: {
780
770
  headers?: Record<string, unknown> | undefined;
781
771
  query?: Record<string, unknown> | undefined;
782
772
  fetch?: RequestInit | undefined;
783
773
  } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
774
+ 500: {
775
+ error: string;
776
+ };
784
777
  200: {
785
778
  userId: number;
786
- timeZone: string;
787
- bookingLocationAvailability: {
788
- bookingLocationId: number;
789
- timeSlotCount: number;
790
- timeSlots: {
791
- date: string;
792
- time: string[];
793
- }[];
794
- }[];
795
- }[];
779
+ title: string;
780
+ startTime: string;
781
+ endTime: string;
782
+ status: "confirmed" | "cancelled" | "tentative";
783
+ busyStatus: "busy" | "free";
784
+ createdAt: string;
785
+ updatedAt: string;
786
+ eventId: number;
787
+ bookingId: number | null;
788
+ description: string | null;
789
+ location: string | null;
790
+ };
796
791
  400: {
797
792
  error: string;
798
793
  };
@@ -807,6 +802,42 @@ export declare function createBalendar(config: BalendarConfig): {
807
802
  };
808
803
  }>>;
809
804
  };
805
+ webhooks: ((params: {
806
+ userId: string | number;
807
+ }) => {
808
+ handle: {
809
+ post: (body?: any, options?: {
810
+ headers?: Record<string, unknown> | undefined;
811
+ query?: Record<string, unknown> | undefined;
812
+ fetch?: RequestInit | undefined;
813
+ } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
814
+ 500: {
815
+ error: string;
816
+ };
817
+ 200: {
818
+ success: boolean;
819
+ calendarExternalId?: string | undefined;
820
+ resourceId?: string | undefined;
821
+ error?: string | undefined;
822
+ };
823
+ 400: {
824
+ error: string;
825
+ };
826
+ 404: {
827
+ error: string;
828
+ };
829
+ 422: {
830
+ type: "validation";
831
+ on: string;
832
+ summary?: string;
833
+ message?: string;
834
+ found?: unknown;
835
+ property?: string;
836
+ expected?: string;
837
+ };
838
+ }>>;
839
+ };
840
+ }) & {};
810
841
  };
811
842
  };
812
843
  };
@@ -92,13 +92,13 @@ export type Events = z.infer<typeof EventsSchema>;
92
92
  */
93
93
  export declare const UpdateEventInputSchema: z.ZodObject<{
94
94
  userId: z.ZodOptional<z.ZodNumber>;
95
+ title: z.ZodOptional<z.ZodString>;
96
+ description: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>>;
95
97
  status: z.ZodOptional<z.ZodEnum<{
96
98
  confirmed: "confirmed";
97
99
  cancelled: "cancelled";
98
100
  tentative: "tentative";
99
101
  }>>;
100
- title: z.ZodOptional<z.ZodString>;
101
- description: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>>;
102
102
  startTime: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>>;
103
103
  endTime: z.ZodOptional<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>>;
104
104
  location: z.ZodOptional<z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "balendar",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "module": "client.ts",
5
5
  "type": "module",
6
6
  "private": false,