@savvycal/appointments-react-query 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.
package/dist/index.cjs ADDED
@@ -0,0 +1,963 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ SavvyCalProvider: () => SavvyCalProvider,
34
+ createQueryClient: () => createQueryClient,
35
+ useAccountById: () => useAccountById,
36
+ useAccountUsers: () => useAccountUsers,
37
+ useAccounts: () => useAccounts,
38
+ useAppointment: () => useAppointment,
39
+ useAppointments: () => useAppointments,
40
+ useBlock: () => useBlock,
41
+ useBlocks: () => useBlocks,
42
+ useCancelAppointment: () => useCancelAppointment,
43
+ useCancelPublicAppointment: () => useCancelPublicAppointment,
44
+ useCancellationReason: () => useCancellationReason,
45
+ useCancellationReasons: () => useCancellationReasons,
46
+ useClient: () => useClient,
47
+ useClients: () => useClients,
48
+ useConfirmAppointment: () => useConfirmAppointment,
49
+ useCreateAccount: () => useCreateAccount,
50
+ useCreateAccountUser: () => useCreateAccountUser,
51
+ useCreateAppointment: () => useCreateAppointment,
52
+ useCreateBlock: () => useCreateBlock,
53
+ useCreateCancellationReason: () => useCreateCancellationReason,
54
+ useCreateClient: () => useCreateClient,
55
+ useCreateDashboardSession: () => useCreateDashboardSession,
56
+ useCreateProvider: () => useCreateProvider,
57
+ useCreateProviderSchedule: () => useCreateProviderSchedule,
58
+ useCreatePublicAppointment: () => useCreatePublicAppointment,
59
+ useCreateService: () => useCreateService,
60
+ useCreateServiceProvider: () => useCreateServiceProvider,
61
+ useCurrentAccount: () => useCurrentAccount,
62
+ useCurrentAccountUser: () => useCurrentAccountUser,
63
+ useCurrentPlatform: () => useCurrentPlatform,
64
+ useDeactivateProvider: () => useDeactivateProvider,
65
+ useDeleteBlock: () => useDeleteBlock,
66
+ useDeleteCancellationReason: () => useDeleteCancellationReason,
67
+ useDeleteClient: () => useDeleteClient,
68
+ useDeleteProviderSchedule: () => useDeleteProviderSchedule,
69
+ useDeleteService: () => useDeleteService,
70
+ useDeleteServiceProvider: () => useDeleteServiceProvider,
71
+ useEarliestPublicServiceSlot: () => useEarliestPublicServiceSlot,
72
+ useProvider: () => useProvider,
73
+ useProviderSchedule: () => useProviderSchedule,
74
+ useProviderSchedules: () => useProviderSchedules,
75
+ useProviders: () => useProviders,
76
+ usePublicAppointment: () => usePublicAppointment,
77
+ usePublicCancellationReasons: () => usePublicCancellationReasons,
78
+ usePublicServiceSlots: () => usePublicServiceSlots,
79
+ useRescheduleAppointment: () => useRescheduleAppointment,
80
+ useReschedulePublicAppointment: () => useReschedulePublicAppointment,
81
+ useRoles: () => useRoles,
82
+ useSavvyCalFetchClient: () => useSavvyCalFetchClient,
83
+ useSavvyCalQueryClient: () => useSavvyCalQueryClient,
84
+ useService: () => useService,
85
+ useServiceProviders: () => useServiceProviders,
86
+ useServiceSlots: () => useServiceSlots,
87
+ useServices: () => useServices,
88
+ useUpdateAccount: () => useUpdateAccount,
89
+ useUpdateBlock: () => useUpdateBlock,
90
+ useUpdateCancellationReason: () => useUpdateCancellationReason,
91
+ useUpdateClient: () => useUpdateClient,
92
+ useUpdateProvider: () => useUpdateProvider,
93
+ useUpdateProviderSchedule: () => useUpdateProviderSchedule,
94
+ useUpdateService: () => useUpdateService
95
+ });
96
+ module.exports = __toCommonJS(index_exports);
97
+
98
+ // ../../node_modules/.pnpm/openapi-react-query@0.5.1_@tanstack+react-query@5.90.11_react@19.2.0__openapi-fetch@0.15.0/node_modules/openapi-react-query/dist/index.mjs
99
+ var import_react_query = require("@tanstack/react-query");
100
+ function createClient(client) {
101
+ const queryFn = async ({
102
+ queryKey: [method, path, init],
103
+ signal
104
+ }) => {
105
+ const mth = method.toUpperCase();
106
+ const fn = client[mth];
107
+ const { data, error, response } = await fn(path, { signal, ...init });
108
+ if (error) {
109
+ throw error;
110
+ }
111
+ if (response.status === 204 || response.headers.get("Content-Length") === "0") {
112
+ return data ?? null;
113
+ }
114
+ return data;
115
+ };
116
+ const queryOptions = (method, path, ...[init, options]) => ({
117
+ queryKey: init === void 0 ? [method, path] : [method, path, init],
118
+ queryFn,
119
+ ...options
120
+ });
121
+ return {
122
+ queryOptions,
123
+ useQuery: (method, path, ...[init, options, queryClient]) => (0, import_react_query.useQuery)(queryOptions(method, path, init, options), queryClient),
124
+ useSuspenseQuery: (method, path, ...[init, options, queryClient]) => (0, import_react_query.useSuspenseQuery)(queryOptions(method, path, init, options), queryClient),
125
+ useInfiniteQuery: (method, path, init, options, queryClient) => {
126
+ const { pageParamName = "cursor", ...restOptions } = options;
127
+ const { queryKey } = queryOptions(method, path, init);
128
+ return (0, import_react_query.useInfiniteQuery)(
129
+ {
130
+ queryKey,
131
+ queryFn: async ({ queryKey: [method2, path2, init2], pageParam = 0, signal }) => {
132
+ const mth = method2.toUpperCase();
133
+ const fn = client[mth];
134
+ const mergedInit = {
135
+ ...init2,
136
+ signal,
137
+ params: {
138
+ ...init2?.params || {},
139
+ query: {
140
+ ...init2?.params?.query,
141
+ [pageParamName]: pageParam
142
+ }
143
+ }
144
+ };
145
+ const { data, error } = await fn(path2, mergedInit);
146
+ if (error) {
147
+ throw error;
148
+ }
149
+ return data;
150
+ },
151
+ ...restOptions
152
+ },
153
+ queryClient
154
+ );
155
+ },
156
+ useMutation: (method, path, options, queryClient) => (0, import_react_query.useMutation)(
157
+ {
158
+ mutationKey: [method, path],
159
+ mutationFn: async (init) => {
160
+ const mth = method.toUpperCase();
161
+ const fn = client[mth];
162
+ const { data, error } = await fn(path, init);
163
+ if (error) {
164
+ throw error;
165
+ }
166
+ return data;
167
+ },
168
+ ...options
169
+ },
170
+ queryClient
171
+ )
172
+ };
173
+ }
174
+
175
+ // src/client.ts
176
+ var createQueryClient = (fetchClient) => {
177
+ return createClient(fetchClient);
178
+ };
179
+
180
+ // src/provider.tsx
181
+ var import_appointments_core = require("@savvycal/appointments-core");
182
+ var import_react = __toESM(require("react"), 1);
183
+ var SavvyCalContext = (0, import_react.createContext)(
184
+ void 0
185
+ );
186
+ SavvyCalContext.displayName = "SavvyCalContext";
187
+ var SavvyCalProvider = ({
188
+ children,
189
+ ...clientOptions
190
+ }) => {
191
+ const fetchClient = (0, import_react.useMemo)(
192
+ () => (0, import_appointments_core.createFetchClient)(clientOptions),
193
+ [clientOptions]
194
+ );
195
+ const queryClient = (0, import_react.useMemo)(
196
+ () => createQueryClient(fetchClient),
197
+ [fetchClient]
198
+ );
199
+ return /* @__PURE__ */ import_react.default.createElement(SavvyCalContext.Provider, { value: { fetchClient, queryClient } }, children);
200
+ };
201
+ SavvyCalProvider.displayName = "SavvyCalProvider";
202
+ var useSavvyCalQueryClient = (overrideClient) => {
203
+ const context = (0, import_react.useContext)(SavvyCalContext);
204
+ if (context === void 0 && !overrideClient) {
205
+ throw new Error(
206
+ "useSavvyCalQueryClient must be used within a SavvyCalProvider"
207
+ );
208
+ }
209
+ return overrideClient || context.queryClient;
210
+ };
211
+ var useSavvyCalFetchClient = (overrideClient) => {
212
+ const context = (0, import_react.useContext)(SavvyCalContext);
213
+ if (context === void 0 && !overrideClient) {
214
+ throw new Error(
215
+ "useSavvyCalFetchClient must be used within a SavvyCalProvider"
216
+ );
217
+ }
218
+ return overrideClient || context.fetchClient;
219
+ };
220
+
221
+ // src/mutation-hooks/use-cancel-appointment.ts
222
+ var useCancelAppointment = (options) => {
223
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
224
+ const client = useSavvyCalQueryClient(overrideClient);
225
+ return client.useMutation(
226
+ "post",
227
+ "/v1/appointments/{appointment_id}/cancel",
228
+ mutationOptions
229
+ );
230
+ };
231
+
232
+ // src/mutation-hooks/use-cancel-public-appointment.ts
233
+ var useCancelPublicAppointment = (options) => {
234
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
235
+ const client = useSavvyCalQueryClient(overrideClient);
236
+ return client.useMutation(
237
+ "post",
238
+ "/v1/public/appointments/{appointment_id}/cancel",
239
+ mutationOptions
240
+ );
241
+ };
242
+
243
+ // src/mutation-hooks/use-confirm-appointment.ts
244
+ var useConfirmAppointment = (options) => {
245
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
246
+ const client = useSavvyCalQueryClient(overrideClient);
247
+ return client.useMutation(
248
+ "post",
249
+ "/v1/appointments/{appointment_id}/confirm",
250
+ mutationOptions
251
+ );
252
+ };
253
+
254
+ // src/mutation-hooks/use-create-account.ts
255
+ var useCreateAccount = (options) => {
256
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
257
+ const client = useSavvyCalQueryClient(overrideClient);
258
+ return client.useMutation("post", "/v1/accounts", mutationOptions);
259
+ };
260
+
261
+ // src/mutation-hooks/use-create-account-user.ts
262
+ var useCreateAccountUser = (options) => {
263
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
264
+ const client = useSavvyCalQueryClient(overrideClient);
265
+ return client.useMutation("post", "/v1/users", mutationOptions);
266
+ };
267
+
268
+ // src/mutation-hooks/use-create-appointment.ts
269
+ var useCreateAppointment = (options) => {
270
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
271
+ const client = useSavvyCalQueryClient(overrideClient);
272
+ return client.useMutation("post", "/v1/appointments", mutationOptions);
273
+ };
274
+
275
+ // src/mutation-hooks/use-create-block.ts
276
+ var useCreateBlock = (options) => {
277
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
278
+ const client = useSavvyCalQueryClient(overrideClient);
279
+ return client.useMutation("post", "/v1/blocks", mutationOptions);
280
+ };
281
+
282
+ // src/mutation-hooks/use-create-cancellation-reason.ts
283
+ var useCreateCancellationReason = (options) => {
284
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
285
+ const client = useSavvyCalQueryClient(overrideClient);
286
+ return client.useMutation(
287
+ "post",
288
+ "/v1/cancellation_reasons",
289
+ mutationOptions
290
+ );
291
+ };
292
+
293
+ // src/mutation-hooks/use-create-client.ts
294
+ var useCreateClient = (options) => {
295
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
296
+ const client = useSavvyCalQueryClient(overrideClient);
297
+ return client.useMutation("post", "/v1/clients", mutationOptions);
298
+ };
299
+
300
+ // src/mutation-hooks/use-create-dashboard-session.ts
301
+ var useCreateDashboardSession = (options) => {
302
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
303
+ const client = useSavvyCalQueryClient(overrideClient);
304
+ return client.useMutation("post", "/v1/dashboard_sessions", mutationOptions);
305
+ };
306
+
307
+ // src/mutation-hooks/use-create-provider.ts
308
+ var useCreateProvider = (options) => {
309
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
310
+ const client = useSavvyCalQueryClient(overrideClient);
311
+ return client.useMutation("post", "/v1/providers", mutationOptions);
312
+ };
313
+
314
+ // src/mutation-hooks/use-create-provider-schedule.ts
315
+ var useCreateProviderSchedule = (options) => {
316
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
317
+ const client = useSavvyCalQueryClient(overrideClient);
318
+ return client.useMutation(
319
+ "post",
320
+ "/v1/providers/{provider_id}/schedules",
321
+ mutationOptions
322
+ );
323
+ };
324
+
325
+ // src/mutation-hooks/use-create-public-appointment.ts
326
+ var useCreatePublicAppointment = (options) => {
327
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
328
+ const client = useSavvyCalQueryClient(overrideClient);
329
+ return client.useMutation("post", "/v1/public/appointments", mutationOptions);
330
+ };
331
+
332
+ // src/mutation-hooks/use-create-service.ts
333
+ var useCreateService = (options) => {
334
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
335
+ const client = useSavvyCalQueryClient(overrideClient);
336
+ return client.useMutation("post", "/v1/services", mutationOptions);
337
+ };
338
+
339
+ // src/mutation-hooks/use-create-service-provider.ts
340
+ var useCreateServiceProvider = (options) => {
341
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
342
+ const client = useSavvyCalQueryClient(overrideClient);
343
+ return client.useMutation(
344
+ "post",
345
+ "/v1/services/{service_id}/providers",
346
+ mutationOptions
347
+ );
348
+ };
349
+
350
+ // src/mutation-hooks/use-deactivate-provider.ts
351
+ var useDeactivateProvider = (options) => {
352
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
353
+ const client = useSavvyCalQueryClient(overrideClient);
354
+ return client.useMutation(
355
+ "delete",
356
+ "/v1/providers/{provider_id}",
357
+ mutationOptions
358
+ );
359
+ };
360
+
361
+ // src/mutation-hooks/use-delete-block.ts
362
+ var useDeleteBlock = (options) => {
363
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
364
+ const client = useSavvyCalQueryClient(overrideClient);
365
+ return client.useMutation("delete", "/v1/blocks/{block_id}", mutationOptions);
366
+ };
367
+
368
+ // src/mutation-hooks/use-delete-cancellation-reason.ts
369
+ var useDeleteCancellationReason = (options) => {
370
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
371
+ const client = useSavvyCalQueryClient(overrideClient);
372
+ return client.useMutation(
373
+ "delete",
374
+ "/v1/cancellation_reasons/{cancellation_reason_id}",
375
+ mutationOptions
376
+ );
377
+ };
378
+
379
+ // src/mutation-hooks/use-delete-client.ts
380
+ var useDeleteClient = (options) => {
381
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
382
+ const client = useSavvyCalQueryClient(overrideClient);
383
+ return client.useMutation(
384
+ "delete",
385
+ "/v1/clients/{client_id}",
386
+ mutationOptions
387
+ );
388
+ };
389
+
390
+ // src/mutation-hooks/use-delete-provider-schedule.ts
391
+ var useDeleteProviderSchedule = (options) => {
392
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
393
+ const client = useSavvyCalQueryClient(overrideClient);
394
+ return client.useMutation(
395
+ "delete",
396
+ "/v1/provider_schedules/{provider_schedule_id}",
397
+ mutationOptions
398
+ );
399
+ };
400
+
401
+ // src/mutation-hooks/use-delete-service.ts
402
+ var useDeleteService = (options) => {
403
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
404
+ const client = useSavvyCalQueryClient(overrideClient);
405
+ return client.useMutation(
406
+ "delete",
407
+ "/v1/services/{service_id}",
408
+ mutationOptions
409
+ );
410
+ };
411
+
412
+ // src/mutation-hooks/use-delete-service-provider.ts
413
+ var useDeleteServiceProvider = (options) => {
414
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
415
+ const client = useSavvyCalQueryClient(overrideClient);
416
+ return client.useMutation(
417
+ "delete",
418
+ "/v1/service_providers/{service_provider_id}",
419
+ mutationOptions
420
+ );
421
+ };
422
+
423
+ // src/mutation-hooks/use-reschedule-appointment.ts
424
+ var useRescheduleAppointment = (options) => {
425
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
426
+ const client = useSavvyCalQueryClient(overrideClient);
427
+ return client.useMutation(
428
+ "post",
429
+ "/v1/appointments/{appointment_id}/reschedule",
430
+ mutationOptions
431
+ );
432
+ };
433
+
434
+ // src/mutation-hooks/use-reschedule-public-appointment.ts
435
+ var useReschedulePublicAppointment = (options) => {
436
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
437
+ const client = useSavvyCalQueryClient(overrideClient);
438
+ return client.useMutation(
439
+ "post",
440
+ "/v1/public/appointments/{appointment_id}/reschedule",
441
+ mutationOptions
442
+ );
443
+ };
444
+
445
+ // src/mutation-hooks/use-update-account.ts
446
+ var useUpdateAccount = (options) => {
447
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
448
+ const client = useSavvyCalQueryClient(overrideClient);
449
+ return client.useMutation(
450
+ "patch",
451
+ "/v1/accounts/{account_id}",
452
+ mutationOptions
453
+ );
454
+ };
455
+
456
+ // src/mutation-hooks/use-update-block.ts
457
+ var useUpdateBlock = (options) => {
458
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
459
+ const client = useSavvyCalQueryClient(overrideClient);
460
+ return client.useMutation("patch", "/v1/blocks/{block_id}", mutationOptions);
461
+ };
462
+
463
+ // src/mutation-hooks/use-update-cancellation-reason.ts
464
+ var useUpdateCancellationReason = (options) => {
465
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
466
+ const client = useSavvyCalQueryClient(overrideClient);
467
+ return client.useMutation(
468
+ "patch",
469
+ "/v1/cancellation_reasons/{cancellation_reason_id}",
470
+ mutationOptions
471
+ );
472
+ };
473
+
474
+ // src/mutation-hooks/use-update-client.ts
475
+ var useUpdateClient = (options) => {
476
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
477
+ const client = useSavvyCalQueryClient(overrideClient);
478
+ return client.useMutation(
479
+ "patch",
480
+ "/v1/clients/{client_id}",
481
+ mutationOptions
482
+ );
483
+ };
484
+
485
+ // src/mutation-hooks/use-update-provider.ts
486
+ var useUpdateProvider = (options) => {
487
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
488
+ const client = useSavvyCalQueryClient(overrideClient);
489
+ return client.useMutation(
490
+ "patch",
491
+ "/v1/providers/{provider_id}",
492
+ mutationOptions
493
+ );
494
+ };
495
+
496
+ // src/mutation-hooks/use-update-provider-schedule.ts
497
+ var useUpdateProviderSchedule = (options) => {
498
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
499
+ const client = useSavvyCalQueryClient(overrideClient);
500
+ return client.useMutation(
501
+ "patch",
502
+ "/v1/provider_schedules/{provider_schedule_id}",
503
+ mutationOptions
504
+ );
505
+ };
506
+
507
+ // src/mutation-hooks/use-update-service.ts
508
+ var useUpdateService = (options) => {
509
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
510
+ const client = useSavvyCalQueryClient(overrideClient);
511
+ return client.useMutation(
512
+ "patch",
513
+ "/v1/services/{service_id}",
514
+ mutationOptions
515
+ );
516
+ };
517
+
518
+ // src/query-hooks/use-account-by-id.ts
519
+ var useAccountById = (account_id, options) => {
520
+ const { client: overrideClient, ...queryOptions } = options ?? {};
521
+ const client = useSavvyCalQueryClient(overrideClient);
522
+ return client.useQuery(
523
+ "get",
524
+ "/v1/accounts/{account_id}",
525
+ {
526
+ params: {
527
+ path: { account_id }
528
+ }
529
+ },
530
+ queryOptions
531
+ );
532
+ };
533
+
534
+ // src/query-hooks/use-account-users.ts
535
+ var useAccountUsers = (options) => {
536
+ const { client: overrideClient, ...queryOptions } = options ?? {};
537
+ const client = useSavvyCalQueryClient(overrideClient);
538
+ return client.useQuery("get", "/v1/users", {}, queryOptions);
539
+ };
540
+
541
+ // src/query-hooks/use-accounts.ts
542
+ var useAccounts = (queryParams, options) => {
543
+ const { client: overrideClient, ...queryOptions } = options ?? {};
544
+ const client = useSavvyCalQueryClient(overrideClient);
545
+ return client.useQuery(
546
+ "get",
547
+ "/v1/accounts",
548
+ {
549
+ params: {
550
+ query: queryParams
551
+ }
552
+ },
553
+ queryOptions
554
+ );
555
+ };
556
+
557
+ // src/query-hooks/use-appointment.ts
558
+ var useAppointment = (appointment_id, queryParams, options) => {
559
+ const { client: overrideClient, ...queryOptions } = options ?? {};
560
+ const client = useSavvyCalQueryClient(overrideClient);
561
+ return client.useQuery(
562
+ "get",
563
+ "/v1/appointments/{appointment_id}",
564
+ {
565
+ params: {
566
+ path: { appointment_id },
567
+ query: queryParams
568
+ }
569
+ },
570
+ queryOptions
571
+ );
572
+ };
573
+
574
+ // src/query-hooks/use-appointments.ts
575
+ var useAppointments = (queryParams, options) => {
576
+ const { client: overrideClient, ...queryOptions } = options ?? {};
577
+ const client = useSavvyCalQueryClient(overrideClient);
578
+ return client.useQuery(
579
+ "get",
580
+ "/v1/appointments",
581
+ {
582
+ params: {
583
+ query: queryParams
584
+ }
585
+ },
586
+ queryOptions
587
+ );
588
+ };
589
+
590
+ // src/query-hooks/use-block.ts
591
+ var useBlock = (block_id, options) => {
592
+ const { client: overrideClient, ...queryOptions } = options ?? {};
593
+ const client = useSavvyCalQueryClient(overrideClient);
594
+ return client.useQuery(
595
+ "get",
596
+ "/v1/blocks/{block_id}",
597
+ {
598
+ params: {
599
+ path: { block_id }
600
+ }
601
+ },
602
+ queryOptions
603
+ );
604
+ };
605
+
606
+ // src/query-hooks/use-blocks.ts
607
+ var useBlocks = (queryParams, options) => {
608
+ const { client: overrideClient, ...queryOptions } = options ?? {};
609
+ const client = useSavvyCalQueryClient(overrideClient);
610
+ return client.useQuery(
611
+ "get",
612
+ "/v1/blocks",
613
+ {
614
+ params: {
615
+ query: queryParams
616
+ }
617
+ },
618
+ queryOptions
619
+ );
620
+ };
621
+
622
+ // src/query-hooks/use-cancellation-reason.ts
623
+ var useCancellationReason = (cancellation_reason_id, options) => {
624
+ const { client: overrideClient, ...queryOptions } = options ?? {};
625
+ const client = useSavvyCalQueryClient(overrideClient);
626
+ return client.useQuery(
627
+ "get",
628
+ "/v1/cancellation_reasons/{cancellation_reason_id}",
629
+ {
630
+ params: {
631
+ path: { cancellation_reason_id }
632
+ }
633
+ },
634
+ queryOptions
635
+ );
636
+ };
637
+
638
+ // src/query-hooks/use-cancellation-reasons.ts
639
+ var useCancellationReasons = (options) => {
640
+ const { client: overrideClient, ...queryOptions } = options ?? {};
641
+ const client = useSavvyCalQueryClient(overrideClient);
642
+ return client.useQuery("get", "/v1/cancellation_reasons", {}, queryOptions);
643
+ };
644
+
645
+ // src/query-hooks/use-client.ts
646
+ var useClient = (client_id, options) => {
647
+ const { client: overrideClient, ...queryOptions } = options ?? {};
648
+ const client = useSavvyCalQueryClient(overrideClient);
649
+ return client.useQuery(
650
+ "get",
651
+ "/v1/clients/{client_id}",
652
+ {
653
+ params: {
654
+ path: { client_id }
655
+ }
656
+ },
657
+ queryOptions
658
+ );
659
+ };
660
+
661
+ // src/query-hooks/use-clients.ts
662
+ var useClients = (queryParams, options) => {
663
+ const { client: overrideClient, ...queryOptions } = options ?? {};
664
+ const client = useSavvyCalQueryClient(overrideClient);
665
+ return client.useQuery(
666
+ "get",
667
+ "/v1/clients",
668
+ {
669
+ params: {
670
+ query: queryParams
671
+ }
672
+ },
673
+ queryOptions
674
+ );
675
+ };
676
+
677
+ // src/query-hooks/use-current-account.ts
678
+ var useCurrentAccount = (options) => {
679
+ const { client: overrideClient, ...queryOptions } = options ?? {};
680
+ const client = useSavvyCalQueryClient(overrideClient);
681
+ return client.useQuery("get", "/v1/account", {}, queryOptions);
682
+ };
683
+
684
+ // src/query-hooks/use-current-account-user.ts
685
+ var useCurrentAccountUser = (options) => {
686
+ const { client: overrideClient, ...queryOptions } = options ?? {};
687
+ const client = useSavvyCalQueryClient(overrideClient);
688
+ return client.useQuery("get", "/v1/user", {}, queryOptions);
689
+ };
690
+
691
+ // src/query-hooks/use-current-platform.ts
692
+ var useCurrentPlatform = (options) => {
693
+ const { client: overrideClient, ...queryOptions } = options ?? {};
694
+ const client = useSavvyCalQueryClient(overrideClient);
695
+ return client.useQuery("get", "/v1/platform", {}, queryOptions);
696
+ };
697
+
698
+ // src/query-hooks/use-earliest-public-service-slot.ts
699
+ var useEarliestPublicServiceSlot = (service_id, queryParams, options) => {
700
+ const { client: overrideClient, ...queryOptions } = options ?? {};
701
+ const client = useSavvyCalQueryClient(overrideClient);
702
+ return client.useQuery(
703
+ "get",
704
+ "/v1/public/services/{service_id}/earliest_slot",
705
+ {
706
+ params: {
707
+ path: { service_id },
708
+ query: queryParams
709
+ }
710
+ },
711
+ queryOptions
712
+ );
713
+ };
714
+
715
+ // src/query-hooks/use-provider.ts
716
+ var useProvider = (provider_id, options) => {
717
+ const { client: overrideClient, ...queryOptions } = options ?? {};
718
+ const client = useSavvyCalQueryClient(overrideClient);
719
+ return client.useQuery(
720
+ "get",
721
+ "/v1/providers/{provider_id}",
722
+ {
723
+ params: {
724
+ path: { provider_id }
725
+ }
726
+ },
727
+ queryOptions
728
+ );
729
+ };
730
+
731
+ // src/query-hooks/use-provider-schedule.ts
732
+ var useProviderSchedule = (provider_schedule_id, options) => {
733
+ const { client: overrideClient, ...queryOptions } = options ?? {};
734
+ const client = useSavvyCalQueryClient(overrideClient);
735
+ return client.useQuery(
736
+ "get",
737
+ "/v1/provider_schedules/{provider_schedule_id}",
738
+ {
739
+ params: {
740
+ path: { provider_schedule_id }
741
+ }
742
+ },
743
+ queryOptions
744
+ );
745
+ };
746
+
747
+ // src/query-hooks/use-provider-schedules.ts
748
+ var useProviderSchedules = (queryParams, options) => {
749
+ const { client: overrideClient, ...queryOptions } = options ?? {};
750
+ const client = useSavvyCalQueryClient(overrideClient);
751
+ return client.useQuery(
752
+ "get",
753
+ "/v1/provider_schedules",
754
+ {
755
+ params: {
756
+ query: queryParams
757
+ }
758
+ },
759
+ queryOptions
760
+ );
761
+ };
762
+
763
+ // src/query-hooks/use-providers.ts
764
+ var useProviders = (queryParams, options) => {
765
+ const { client: overrideClient, ...queryOptions } = options ?? {};
766
+ const client = useSavvyCalQueryClient(overrideClient);
767
+ return client.useQuery(
768
+ "get",
769
+ "/v1/providers",
770
+ {
771
+ params: {
772
+ query: queryParams
773
+ }
774
+ },
775
+ queryOptions
776
+ );
777
+ };
778
+
779
+ // src/query-hooks/use-public-appointment.ts
780
+ var usePublicAppointment = (appointment_id, options) => {
781
+ const { client: overrideClient, ...queryOptions } = options ?? {};
782
+ const client = useSavvyCalQueryClient(overrideClient);
783
+ return client.useQuery(
784
+ "get",
785
+ "/v1/public/appointments/{appointment_id}",
786
+ {
787
+ params: {
788
+ path: { appointment_id }
789
+ }
790
+ },
791
+ queryOptions
792
+ );
793
+ };
794
+
795
+ // src/query-hooks/use-public-cancellation-reasons.ts
796
+ var usePublicCancellationReasons = (appointment_id, options) => {
797
+ const { client: overrideClient, ...queryOptions } = options ?? {};
798
+ const client = useSavvyCalQueryClient(overrideClient);
799
+ return client.useQuery(
800
+ "get",
801
+ "/v1/public/appointments/{appointment_id}/cancellation_reasons",
802
+ {
803
+ params: {
804
+ path: { appointment_id }
805
+ }
806
+ },
807
+ queryOptions
808
+ );
809
+ };
810
+
811
+ // src/query-hooks/use-public-service-slots.ts
812
+ var usePublicServiceSlots = (service_id, queryParams, options) => {
813
+ const { client: overrideClient, ...queryOptions } = options ?? {};
814
+ const client = useSavvyCalQueryClient(overrideClient);
815
+ return client.useQuery(
816
+ "get",
817
+ "/v1/public/services/{service_id}/slots",
818
+ {
819
+ params: {
820
+ path: { service_id },
821
+ query: queryParams
822
+ }
823
+ },
824
+ queryOptions
825
+ );
826
+ };
827
+
828
+ // src/query-hooks/use-roles.ts
829
+ var useRoles = (options) => {
830
+ const { client: overrideClient, ...queryOptions } = options ?? {};
831
+ const client = useSavvyCalQueryClient(overrideClient);
832
+ return client.useQuery("get", "/v1/roles", {}, queryOptions);
833
+ };
834
+
835
+ // src/query-hooks/use-service.ts
836
+ var useService = (service_id, options) => {
837
+ const { client: overrideClient, ...queryOptions } = options ?? {};
838
+ const client = useSavvyCalQueryClient(overrideClient);
839
+ return client.useQuery(
840
+ "get",
841
+ "/v1/services/{service_id}",
842
+ {
843
+ params: {
844
+ path: { service_id }
845
+ }
846
+ },
847
+ queryOptions
848
+ );
849
+ };
850
+
851
+ // src/query-hooks/use-service-providers.ts
852
+ var useServiceProviders = (service_id, options) => {
853
+ const { client: overrideClient, ...queryOptions } = options ?? {};
854
+ const client = useSavvyCalQueryClient(overrideClient);
855
+ return client.useQuery(
856
+ "get",
857
+ "/v1/services/{service_id}/providers",
858
+ {
859
+ params: {
860
+ path: { service_id }
861
+ }
862
+ },
863
+ queryOptions
864
+ );
865
+ };
866
+
867
+ // src/query-hooks/use-service-slots.ts
868
+ var useServiceSlots = (service_id, queryParams, options) => {
869
+ const { client: overrideClient, ...queryOptions } = options ?? {};
870
+ const client = useSavvyCalQueryClient(overrideClient);
871
+ return client.useQuery(
872
+ "get",
873
+ "/v1/services/{service_id}/slots",
874
+ {
875
+ params: {
876
+ path: { service_id },
877
+ query: queryParams
878
+ }
879
+ },
880
+ queryOptions
881
+ );
882
+ };
883
+
884
+ // src/query-hooks/use-services.ts
885
+ var useServices = (queryParams, options) => {
886
+ const { client: overrideClient, ...queryOptions } = options ?? {};
887
+ const client = useSavvyCalQueryClient(overrideClient);
888
+ return client.useQuery(
889
+ "get",
890
+ "/v1/services",
891
+ {
892
+ params: {
893
+ query: queryParams
894
+ }
895
+ },
896
+ queryOptions
897
+ );
898
+ };
899
+ // Annotate the CommonJS export names for ESM import in node:
900
+ 0 && (module.exports = {
901
+ SavvyCalProvider,
902
+ createQueryClient,
903
+ useAccountById,
904
+ useAccountUsers,
905
+ useAccounts,
906
+ useAppointment,
907
+ useAppointments,
908
+ useBlock,
909
+ useBlocks,
910
+ useCancelAppointment,
911
+ useCancelPublicAppointment,
912
+ useCancellationReason,
913
+ useCancellationReasons,
914
+ useClient,
915
+ useClients,
916
+ useConfirmAppointment,
917
+ useCreateAccount,
918
+ useCreateAccountUser,
919
+ useCreateAppointment,
920
+ useCreateBlock,
921
+ useCreateCancellationReason,
922
+ useCreateClient,
923
+ useCreateDashboardSession,
924
+ useCreateProvider,
925
+ useCreateProviderSchedule,
926
+ useCreatePublicAppointment,
927
+ useCreateService,
928
+ useCreateServiceProvider,
929
+ useCurrentAccount,
930
+ useCurrentAccountUser,
931
+ useCurrentPlatform,
932
+ useDeactivateProvider,
933
+ useDeleteBlock,
934
+ useDeleteCancellationReason,
935
+ useDeleteClient,
936
+ useDeleteProviderSchedule,
937
+ useDeleteService,
938
+ useDeleteServiceProvider,
939
+ useEarliestPublicServiceSlot,
940
+ useProvider,
941
+ useProviderSchedule,
942
+ useProviderSchedules,
943
+ useProviders,
944
+ usePublicAppointment,
945
+ usePublicCancellationReasons,
946
+ usePublicServiceSlots,
947
+ useRescheduleAppointment,
948
+ useReschedulePublicAppointment,
949
+ useRoles,
950
+ useSavvyCalFetchClient,
951
+ useSavvyCalQueryClient,
952
+ useService,
953
+ useServiceProviders,
954
+ useServiceSlots,
955
+ useServices,
956
+ useUpdateAccount,
957
+ useUpdateBlock,
958
+ useUpdateCancellationReason,
959
+ useUpdateClient,
960
+ useUpdateProvider,
961
+ useUpdateProviderSchedule,
962
+ useUpdateService
963
+ });