balendar 0.0.8 → 0.0.10

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,15 +60,25 @@ export declare function createBalendar(config: BalendarConfig): {
60
60
  }>>;
61
61
  };
62
62
  api: {
63
- "external-calendars": {
64
- oauth: {
63
+ calendars: {
64
+ connections: ((params: {
65
+ provider: string | number;
66
+ }) => {
65
67
  callback: {
66
- get: (options?: {
68
+ get: (options: {
67
69
  headers?: Record<string, unknown> | undefined;
68
- query?: Record<string, unknown> | undefined;
70
+ query: {
71
+ code: string;
72
+ state: string;
73
+ };
69
74
  fetch?: RequestInit | undefined;
70
- } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
71
- 200: Response;
75
+ }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
76
+ 500: {
77
+ success: boolean;
78
+ };
79
+ 200: {
80
+ success: boolean;
81
+ };
72
82
  422: {
73
83
  type: "validation";
74
84
  on: string;
@@ -80,92 +90,22 @@ export declare function createBalendar(config: BalendarConfig): {
80
90
  };
81
91
  }>>;
82
92
  };
83
- };
84
- api: {
85
- "external-calendars": {
86
- users: ((params: {
87
- userId: string | number;
88
- }) => {
89
- oauth: {
90
- url: {
91
- get: (options: {
92
- headers?: Record<string, unknown> | undefined;
93
- query: {
94
- externalProvider: "apple" | "google" | "microsoft";
95
- redirectUri: string;
96
- scopes?: string | undefined;
97
- state?: string | undefined;
98
- };
99
- fetch?: RequestInit | undefined;
100
- }) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
101
- 200: {
102
- url: string;
103
- };
104
- 400: {
105
- error: string;
106
- };
107
- 422: {
108
- type: "validation";
109
- on: string;
110
- summary?: string;
111
- message?: string;
112
- found?: unknown;
113
- property?: string;
114
- expected?: string;
115
- };
116
- }>>;
117
- };
118
- };
119
- "is-connected-google": {
120
- get: (options?: {
121
- headers?: Record<string, unknown> | undefined;
122
- query?: Record<string, unknown> | undefined;
123
- fetch?: RequestInit | undefined;
124
- } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
125
- 200: {
126
- isConnected: boolean;
127
- };
128
- 422: {
129
- type: "validation";
130
- on: string;
131
- summary?: string;
132
- message?: string;
133
- found?: unknown;
134
- property?: string;
135
- expected?: string;
136
- };
137
- }>>;
138
- };
139
- } & ((params: {
140
- externalCalendarId: string | number;
141
- }) => {
93
+ } & ((params: {
94
+ userId: string | number;
95
+ }) => {
96
+ oauth: {
97
+ url: {
142
98
  get: (options?: {
143
99
  headers?: Record<string, unknown> | undefined;
144
100
  query?: Record<string, unknown> | undefined;
145
101
  fetch?: RequestInit | undefined;
146
102
  } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
147
- 200: {
148
- externalCalendar: {
149
- lastSyncedAt: string | null;
150
- syncStatus: "error" | "pending" | "syncing" | "synced";
151
- syncError: string | null;
152
- retryCount: number;
153
- externalProvider: "apple" | "google" | "microsoft";
154
- externalId: string;
155
- connectionId: string;
156
- accessToken: string;
157
- expiresAt: string;
158
- createdAt: string;
159
- updatedAt: string;
160
- externalCalendarId: number;
161
- userId: number;
162
- status: "error" | "active" | "expired" | "revoked";
163
- refreshToken?: string | undefined;
164
- };
165
- };
166
- 404: {
103
+ 500: {
167
104
  error: string;
168
105
  };
106
+ 200: {
107
+ url: string;
108
+ };
169
109
  422: {
170
110
  type: "validation";
171
111
  on: string;
@@ -176,9 +116,224 @@ export declare function createBalendar(config: BalendarConfig): {
176
116
  expected?: string;
177
117
  };
178
118
  }>>;
179
- })) & {};
119
+ };
120
+ };
121
+ })) & {
122
+ check: ((params: {
123
+ userId: string | number;
124
+ }) => {
125
+ get: (options?: {
126
+ headers?: Record<string, unknown> | undefined;
127
+ query?: Record<string, unknown> | undefined;
128
+ fetch?: RequestInit | undefined;
129
+ } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
130
+ 500: {
131
+ error: string;
132
+ };
133
+ 200: {
134
+ connected: boolean;
135
+ provider: "apple" | "google" | "microsoft" | null;
136
+ };
137
+ 422: {
138
+ type: "validation";
139
+ on: string;
140
+ summary?: string;
141
+ message?: string;
142
+ found?: unknown;
143
+ property?: string;
144
+ expected?: string;
145
+ };
146
+ }>>;
147
+ }) & {};
148
+ };
149
+ webhooks: ((params: {
150
+ userId: string | number;
151
+ }) => {
152
+ handle: {
153
+ post: (body?: any, options?: {
154
+ headers?: Record<string, unknown> | undefined;
155
+ query?: Record<string, unknown> | undefined;
156
+ fetch?: RequestInit | undefined;
157
+ } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
158
+ 500: {
159
+ error: string;
160
+ };
161
+ 200: {
162
+ success: boolean;
163
+ calendarExternalId?: string | undefined;
164
+ resourceId?: string | undefined;
165
+ error?: string | undefined;
166
+ };
167
+ 400: {
168
+ error: string;
169
+ };
170
+ 404: {
171
+ error: string;
172
+ };
173
+ 422: {
174
+ type: "validation";
175
+ on: string;
176
+ summary?: string;
177
+ message?: string;
178
+ found?: unknown;
179
+ property?: string;
180
+ expected?: string;
181
+ };
182
+ }>>;
183
+ };
184
+ }) & {
185
+ google: {
186
+ post: (body?: any, options?: {
187
+ headers?: Record<string, unknown> | undefined;
188
+ query?: Record<string, unknown> | undefined;
189
+ fetch?: RequestInit | undefined;
190
+ } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
191
+ 500: {
192
+ error: string;
193
+ };
194
+ 200: {
195
+ success: boolean;
196
+ message?: string | undefined;
197
+ error?: string | undefined;
198
+ };
199
+ 400: {
200
+ error: string;
201
+ };
202
+ 422: {
203
+ type: "validation";
204
+ on: string;
205
+ summary?: string;
206
+ message?: string;
207
+ found?: unknown;
208
+ property?: string;
209
+ expected?: string;
210
+ };
211
+ }>>;
180
212
  };
181
213
  };
214
+ events: ((params: {
215
+ eventId: string | number;
216
+ }) => {
217
+ patch: (body: {
218
+ userId: number;
219
+ status?: "confirmed" | "cancelled" | "tentative" | undefined;
220
+ title?: string | undefined;
221
+ description?: string | null | undefined;
222
+ startTime?: string | undefined;
223
+ endTime?: string | undefined;
224
+ location?: string | null | undefined;
225
+ busyStatus?: "busy" | "free" | undefined;
226
+ }, options?: {
227
+ headers?: Record<string, unknown> | undefined;
228
+ query?: Record<string, unknown> | undefined;
229
+ fetch?: RequestInit | undefined;
230
+ } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
231
+ 500: {
232
+ error: string;
233
+ };
234
+ 200: {
235
+ userId: number;
236
+ title: string;
237
+ startTime: string;
238
+ endTime: string;
239
+ status: "confirmed" | "cancelled" | "tentative";
240
+ busyStatus: "busy" | "free";
241
+ createdAt: string;
242
+ updatedAt: string;
243
+ eventId: number;
244
+ bookingId: number | null;
245
+ description: string | null;
246
+ location: string | null;
247
+ };
248
+ 400: {
249
+ error: string;
250
+ };
251
+ 404: {
252
+ error: string;
253
+ };
254
+ 422: {
255
+ type: "validation";
256
+ on: string;
257
+ summary?: string;
258
+ message?: string;
259
+ found?: unknown;
260
+ property?: string;
261
+ expected?: string;
262
+ };
263
+ }>>;
264
+ delete: (body: {
265
+ userId: number;
266
+ }, options?: {
267
+ headers?: Record<string, unknown> | undefined;
268
+ query?: Record<string, unknown> | undefined;
269
+ fetch?: RequestInit | undefined;
270
+ } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
271
+ 500: {
272
+ error: string;
273
+ };
274
+ 200: {
275
+ success: boolean;
276
+ };
277
+ 404: {
278
+ error: string;
279
+ };
280
+ 422: {
281
+ type: "validation";
282
+ on: string;
283
+ summary?: string;
284
+ message?: string;
285
+ found?: unknown;
286
+ property?: string;
287
+ expected?: string;
288
+ };
289
+ }>>;
290
+ }) & {
291
+ post: (body: {
292
+ userId: number;
293
+ bookingId: number | null;
294
+ title: string;
295
+ description: string | null;
296
+ location: string | null;
297
+ startTime: string;
298
+ endTime: string;
299
+ status: "confirmed" | "cancelled" | "tentative";
300
+ busyStatus: "busy" | "free";
301
+ }, options?: {
302
+ headers?: Record<string, unknown> | undefined;
303
+ query?: Record<string, unknown> | undefined;
304
+ fetch?: RequestInit | undefined;
305
+ } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
306
+ 500: {
307
+ error: string;
308
+ };
309
+ 200: {
310
+ userId: number;
311
+ title: string;
312
+ startTime: string;
313
+ endTime: string;
314
+ status: "confirmed" | "cancelled" | "tentative";
315
+ busyStatus: "busy" | "free";
316
+ createdAt: string;
317
+ updatedAt: string;
318
+ eventId: number;
319
+ bookingId: number | null;
320
+ description: string | null;
321
+ location: string | null;
322
+ };
323
+ 400: {
324
+ error: string;
325
+ };
326
+ 422: {
327
+ type: "validation";
328
+ on: string;
329
+ summary?: string;
330
+ message?: string;
331
+ found?: unknown;
332
+ property?: string;
333
+ expected?: string;
334
+ };
335
+ }>>;
336
+ };
182
337
  };
183
338
  events: ((params: {
184
339
  eventId: string | number;
@@ -680,129 +835,6 @@ export declare function createBalendar(config: BalendarConfig): {
680
835
  }>>;
681
836
  };
682
837
  };
683
- "event-sync": {
684
- event: ((params: {
685
- eventId: string | number;
686
- }) => {
687
- patch: (body?: {
688
- userId?: number | undefined;
689
- status?: "confirmed" | "cancelled" | "tentative" | undefined;
690
- title?: string | undefined;
691
- description?: string | null | undefined;
692
- startTime?: string | undefined;
693
- endTime?: string | undefined;
694
- location?: string | null | undefined;
695
- busyStatus?: "busy" | "free" | undefined;
696
- } | undefined, options?: {
697
- headers?: Record<string, unknown> | undefined;
698
- query?: Record<string, unknown> | undefined;
699
- fetch?: RequestInit | undefined;
700
- } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
701
- 500: {
702
- error: string;
703
- };
704
- 200: {
705
- userId: number;
706
- title: string;
707
- startTime: string;
708
- endTime: string;
709
- status: "confirmed" | "cancelled" | "tentative";
710
- busyStatus: "busy" | "free";
711
- createdAt: string;
712
- updatedAt: string;
713
- eventId: number;
714
- bookingId: number | null;
715
- description: string | null;
716
- location: string | null;
717
- };
718
- 400: {
719
- error: string;
720
- };
721
- 404: {
722
- error: string;
723
- };
724
- 422: {
725
- type: "validation";
726
- on: string;
727
- summary?: string;
728
- message?: string;
729
- found?: unknown;
730
- property?: string;
731
- expected?: string;
732
- };
733
- }>>;
734
- delete: (body?: unknown, 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;
741
- };
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";
769
- }, options?: {
770
- headers?: Record<string, unknown> | undefined;
771
- query?: Record<string, unknown> | undefined;
772
- fetch?: RequestInit | undefined;
773
- } | undefined) => Promise<import("@elysiajs/eden").Treaty.TreatyResponse<{
774
- 500: {
775
- error: string;
776
- };
777
- 200: {
778
- userId: number;
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
- };
791
- 400: {
792
- error: string;
793
- };
794
- 422: {
795
- type: "validation";
796
- on: string;
797
- summary?: string;
798
- message?: string;
799
- found?: unknown;
800
- property?: string;
801
- expected?: string;
802
- };
803
- }>>;
804
- };
805
- };
806
838
  };
807
839
  };
808
840
  export type Balendar = ReturnType<typeof createBalendar>;
@@ -1,5 +1,6 @@
1
1
  export * from '../src/modules/availability-rules/availability-rules.domain.ts';
2
+ export * from '../src/modules/calendar-mappings/calendar-mappings.domain.ts';
3
+ export * from '../src/modules/event-mappings/event-mappings.domain.ts';
2
4
  export * from '../src/modules/events/events.domain.ts';
3
- export * from '../src/modules/external-calendars/external-calendars.domain.ts';
4
- export * from '../src/modules/external-events/external-events.domain.ts';
5
5
  export * from '../src/orchestrators/availability/availability.domain.ts';
6
+ export * from '../src/shared/schemas/index.ts';