@savvycal/appointments-react-query 0.2.3 → 0.3.1

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 CHANGED
@@ -32,6 +32,8 @@ var index_exports = {};
32
32
  __export(index_exports, {
33
33
  SavvyCalProvider: () => SavvyCalProvider,
34
34
  createQueryClient: () => createQueryClient,
35
+ useAbandonBookingIntent: () => useAbandonBookingIntent,
36
+ useAbandonPublicBookingIntent: () => useAbandonPublicBookingIntent,
35
37
  useAccountById: () => useAccountById,
36
38
  useAccountUsers: () => useAccountUsers,
37
39
  useAccounts: () => useAccounts,
@@ -39,12 +41,16 @@ __export(index_exports, {
39
41
  useAppointments: () => useAppointments,
40
42
  useBlock: () => useBlock,
41
43
  useBlocks: () => useBlocks,
44
+ useBookingIntent: () => useBookingIntent,
45
+ useBookingIntents: () => useBookingIntents,
42
46
  useCancelAppointment: () => useCancelAppointment,
43
47
  useCancelPublicAppointment: () => useCancelPublicAppointment,
44
48
  useCancellationReason: () => useCancellationReason,
45
49
  useCancellationReasons: () => useCancellationReasons,
46
50
  useClient: () => useClient,
47
51
  useClients: () => useClients,
52
+ useCompleteBookingIntent: () => useCompleteBookingIntent,
53
+ useCompletePublicBookingIntent: () => useCompletePublicBookingIntent,
48
54
  useConfirmAppointment: () => useConfirmAppointment,
49
55
  useConnectedAccount: () => useConnectedAccount,
50
56
  useConnectedAccounts: () => useConnectedAccounts,
@@ -52,12 +58,14 @@ __export(index_exports, {
52
58
  useCreateAccountUser: () => useCreateAccountUser,
53
59
  useCreateAppointment: () => useCreateAppointment,
54
60
  useCreateBlock: () => useCreateBlock,
61
+ useCreateBookingIntent: () => useCreateBookingIntent,
55
62
  useCreateCancellationReason: () => useCreateCancellationReason,
56
63
  useCreateClient: () => useCreateClient,
57
64
  useCreateDashboardSession: () => useCreateDashboardSession,
58
65
  useCreateProvider: () => useCreateProvider,
59
66
  useCreateProviderSchedule: () => useCreateProviderSchedule,
60
67
  useCreatePublicAppointment: () => useCreatePublicAppointment,
68
+ useCreatePublicBookingIntent: () => useCreatePublicBookingIntent,
61
69
  useCreateService: () => useCreateService,
62
70
  useCreateServiceProvider: () => useCreateServiceProvider,
63
71
  useCurrentAccount: () => useCurrentAccount,
@@ -77,6 +85,7 @@ __export(index_exports, {
77
85
  useProviderSchedules: () => useProviderSchedules,
78
86
  useProviders: () => useProviders,
79
87
  usePublicAppointment: () => usePublicAppointment,
88
+ usePublicBookingIntent: () => usePublicBookingIntent,
80
89
  usePublicCancellationReasons: () => usePublicCancellationReasons,
81
90
  usePublicServiceSlots: () => usePublicServiceSlots,
82
91
  useRescheduleAppointment: () => useRescheduleAppointment,
@@ -91,11 +100,13 @@ __export(index_exports, {
91
100
  useUpdateAccount: () => useUpdateAccount,
92
101
  useUpdateAccountUser: () => useUpdateAccountUser,
93
102
  useUpdateBlock: () => useUpdateBlock,
103
+ useUpdateBookingIntent: () => useUpdateBookingIntent,
94
104
  useUpdateCancellationReason: () => useUpdateCancellationReason,
95
105
  useUpdateClient: () => useUpdateClient,
96
106
  useUpdateConnectedAccount: () => useUpdateConnectedAccount,
97
107
  useUpdateProvider: () => useUpdateProvider,
98
108
  useUpdateProviderSchedule: () => useUpdateProviderSchedule,
109
+ useUpdatePublicBookingIntent: () => useUpdatePublicBookingIntent,
99
110
  useUpdateService: () => useUpdateService
100
111
  });
101
112
  module.exports = __toCommonJS(index_exports);
@@ -223,6 +234,28 @@ var useSavvyCalFetchClient = (overrideClient) => {
223
234
  return overrideClient || context.fetchClient;
224
235
  };
225
236
 
237
+ // src/mutation-hooks/use-abandon-booking-intent.ts
238
+ var useAbandonBookingIntent = (options) => {
239
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
240
+ const client = useSavvyCalQueryClient(overrideClient);
241
+ return client.useMutation(
242
+ "post",
243
+ "/v1/booking_intents/{booking_intent_id}/abandon",
244
+ mutationOptions
245
+ );
246
+ };
247
+
248
+ // src/mutation-hooks/use-abandon-public-booking-intent.ts
249
+ var useAbandonPublicBookingIntent = (options) => {
250
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
251
+ const client = useSavvyCalQueryClient(overrideClient);
252
+ return client.useMutation(
253
+ "post",
254
+ "/v1/public/booking_intents/{booking_intent_id}/abandon",
255
+ mutationOptions
256
+ );
257
+ };
258
+
226
259
  // src/mutation-hooks/use-cancel-appointment.ts
227
260
  var useCancelAppointment = (options) => {
228
261
  const { client: overrideClient, ...mutationOptions } = options ?? {};
@@ -245,6 +278,28 @@ var useCancelPublicAppointment = (options) => {
245
278
  );
246
279
  };
247
280
 
281
+ // src/mutation-hooks/use-complete-booking-intent.ts
282
+ var useCompleteBookingIntent = (options) => {
283
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
284
+ const client = useSavvyCalQueryClient(overrideClient);
285
+ return client.useMutation(
286
+ "post",
287
+ "/v1/booking_intents/{booking_intent_id}/complete",
288
+ mutationOptions
289
+ );
290
+ };
291
+
292
+ // src/mutation-hooks/use-complete-public-booking-intent.ts
293
+ var useCompletePublicBookingIntent = (options) => {
294
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
295
+ const client = useSavvyCalQueryClient(overrideClient);
296
+ return client.useMutation(
297
+ "post",
298
+ "/v1/public/booking_intents/{booking_intent_id}/complete",
299
+ mutationOptions
300
+ );
301
+ };
302
+
248
303
  // src/mutation-hooks/use-confirm-appointment.ts
249
304
  var useConfirmAppointment = (options) => {
250
305
  const { client: overrideClient, ...mutationOptions } = options ?? {};
@@ -284,6 +339,13 @@ var useCreateBlock = (options) => {
284
339
  return client.useMutation("post", "/v1/blocks", mutationOptions);
285
340
  };
286
341
 
342
+ // src/mutation-hooks/use-create-booking-intent.ts
343
+ var useCreateBookingIntent = (options) => {
344
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
345
+ const client = useSavvyCalQueryClient(overrideClient);
346
+ return client.useMutation("post", "/v1/booking_intents", mutationOptions);
347
+ };
348
+
287
349
  // src/mutation-hooks/use-create-cancellation-reason.ts
288
350
  var useCreateCancellationReason = (options) => {
289
351
  const { client: overrideClient, ...mutationOptions } = options ?? {};
@@ -334,6 +396,17 @@ var useCreatePublicAppointment = (options) => {
334
396
  return client.useMutation("post", "/v1/public/appointments", mutationOptions);
335
397
  };
336
398
 
399
+ // src/mutation-hooks/use-create-public-booking-intent.ts
400
+ var useCreatePublicBookingIntent = (options) => {
401
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
402
+ const client = useSavvyCalQueryClient(overrideClient);
403
+ return client.useMutation(
404
+ "post",
405
+ "/v1/public/booking_intents",
406
+ mutationOptions
407
+ );
408
+ };
409
+
337
410
  // src/mutation-hooks/use-create-service.ts
338
411
  var useCreateService = (options) => {
339
412
  const { client: overrideClient, ...mutationOptions } = options ?? {};
@@ -483,6 +556,17 @@ var useUpdateBlock = (options) => {
483
556
  return client.useMutation("patch", "/v1/blocks/{block_id}", mutationOptions);
484
557
  };
485
558
 
559
+ // src/mutation-hooks/use-update-booking-intent.ts
560
+ var useUpdateBookingIntent = (options) => {
561
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
562
+ const client = useSavvyCalQueryClient(overrideClient);
563
+ return client.useMutation(
564
+ "patch",
565
+ "/v1/booking_intents/{booking_intent_id}",
566
+ mutationOptions
567
+ );
568
+ };
569
+
486
570
  // src/mutation-hooks/use-update-cancellation-reason.ts
487
571
  var useUpdateCancellationReason = (options) => {
488
572
  const { client: overrideClient, ...mutationOptions } = options ?? {};
@@ -538,6 +622,17 @@ var useUpdateProviderSchedule = (options) => {
538
622
  );
539
623
  };
540
624
 
625
+ // src/mutation-hooks/use-update-public-booking-intent.ts
626
+ var useUpdatePublicBookingIntent = (options) => {
627
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
628
+ const client = useSavvyCalQueryClient(overrideClient);
629
+ return client.useMutation(
630
+ "patch",
631
+ "/v1/public/booking_intents/{booking_intent_id}",
632
+ mutationOptions
633
+ );
634
+ };
635
+
541
636
  // src/mutation-hooks/use-update-service.ts
542
637
  var useUpdateService = (options) => {
543
638
  const { client: overrideClient, ...mutationOptions } = options ?? {};
@@ -653,6 +748,39 @@ var useBlocks = (queryParams, options) => {
653
748
  );
654
749
  };
655
750
 
751
+ // src/query-hooks/use-booking-intent.ts
752
+ var useBookingIntent = (booking_intent_id, queryParams, options) => {
753
+ const { client: overrideClient, ...queryOptions } = options ?? {};
754
+ const client = useSavvyCalQueryClient(overrideClient);
755
+ return client.useQuery(
756
+ "get",
757
+ "/v1/booking_intents/{booking_intent_id}",
758
+ {
759
+ params: {
760
+ path: { booking_intent_id },
761
+ query: queryParams
762
+ }
763
+ },
764
+ queryOptions
765
+ );
766
+ };
767
+
768
+ // src/query-hooks/use-booking-intents.ts
769
+ var useBookingIntents = (queryParams, options) => {
770
+ const { client: overrideClient, ...queryOptions } = options ?? {};
771
+ const client = useSavvyCalQueryClient(overrideClient);
772
+ return client.useQuery(
773
+ "get",
774
+ "/v1/booking_intents",
775
+ {
776
+ params: {
777
+ query: queryParams
778
+ }
779
+ },
780
+ queryOptions
781
+ );
782
+ };
783
+
656
784
  // src/query-hooks/use-cancellation-reason.ts
657
785
  var useCancellationReason = (cancellation_reason_id, options) => {
658
786
  const { client: overrideClient, ...queryOptions } = options ?? {};
@@ -858,6 +986,22 @@ var usePublicAppointment = (appointment_id, options) => {
858
986
  );
859
987
  };
860
988
 
989
+ // src/query-hooks/use-public-booking-intent.ts
990
+ var usePublicBookingIntent = (booking_intent_id, options) => {
991
+ const { client: overrideClient, ...queryOptions } = options ?? {};
992
+ const client = useSavvyCalQueryClient(overrideClient);
993
+ return client.useQuery(
994
+ "get",
995
+ "/v1/public/booking_intents/{booking_intent_id}",
996
+ {
997
+ params: {
998
+ path: { booking_intent_id }
999
+ }
1000
+ },
1001
+ queryOptions
1002
+ );
1003
+ };
1004
+
861
1005
  // src/query-hooks/use-public-cancellation-reasons.ts
862
1006
  var usePublicCancellationReasons = (appointment_id, options) => {
863
1007
  const { client: overrideClient, ...queryOptions } = options ?? {};
@@ -966,6 +1110,8 @@ var useServices = (queryParams, options) => {
966
1110
  0 && (module.exports = {
967
1111
  SavvyCalProvider,
968
1112
  createQueryClient,
1113
+ useAbandonBookingIntent,
1114
+ useAbandonPublicBookingIntent,
969
1115
  useAccountById,
970
1116
  useAccountUsers,
971
1117
  useAccounts,
@@ -973,12 +1119,16 @@ var useServices = (queryParams, options) => {
973
1119
  useAppointments,
974
1120
  useBlock,
975
1121
  useBlocks,
1122
+ useBookingIntent,
1123
+ useBookingIntents,
976
1124
  useCancelAppointment,
977
1125
  useCancelPublicAppointment,
978
1126
  useCancellationReason,
979
1127
  useCancellationReasons,
980
1128
  useClient,
981
1129
  useClients,
1130
+ useCompleteBookingIntent,
1131
+ useCompletePublicBookingIntent,
982
1132
  useConfirmAppointment,
983
1133
  useConnectedAccount,
984
1134
  useConnectedAccounts,
@@ -986,12 +1136,14 @@ var useServices = (queryParams, options) => {
986
1136
  useCreateAccountUser,
987
1137
  useCreateAppointment,
988
1138
  useCreateBlock,
1139
+ useCreateBookingIntent,
989
1140
  useCreateCancellationReason,
990
1141
  useCreateClient,
991
1142
  useCreateDashboardSession,
992
1143
  useCreateProvider,
993
1144
  useCreateProviderSchedule,
994
1145
  useCreatePublicAppointment,
1146
+ useCreatePublicBookingIntent,
995
1147
  useCreateService,
996
1148
  useCreateServiceProvider,
997
1149
  useCurrentAccount,
@@ -1011,6 +1163,7 @@ var useServices = (queryParams, options) => {
1011
1163
  useProviderSchedules,
1012
1164
  useProviders,
1013
1165
  usePublicAppointment,
1166
+ usePublicBookingIntent,
1014
1167
  usePublicCancellationReasons,
1015
1168
  usePublicServiceSlots,
1016
1169
  useRescheduleAppointment,
@@ -1025,10 +1178,12 @@ var useServices = (queryParams, options) => {
1025
1178
  useUpdateAccount,
1026
1179
  useUpdateAccountUser,
1027
1180
  useUpdateBlock,
1181
+ useUpdateBookingIntent,
1028
1182
  useUpdateCancellationReason,
1029
1183
  useUpdateClient,
1030
1184
  useUpdateConnectedAccount,
1031
1185
  useUpdateProvider,
1032
1186
  useUpdateProviderSchedule,
1187
+ useUpdatePublicBookingIntent,
1033
1188
  useUpdateService
1034
1189
  });