@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 +155 -0
- package/dist/index.d.cts +11204 -4566
- package/dist/index.d.ts +11204 -4566
- package/dist/index.js +144 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -123,6 +123,28 @@ var useSavvyCalFetchClient = (overrideClient) => {
|
|
|
123
123
|
return overrideClient || context.fetchClient;
|
|
124
124
|
};
|
|
125
125
|
|
|
126
|
+
// src/mutation-hooks/use-abandon-booking-intent.ts
|
|
127
|
+
var useAbandonBookingIntent = (options) => {
|
|
128
|
+
const { client: overrideClient, ...mutationOptions } = options ?? {};
|
|
129
|
+
const client = useSavvyCalQueryClient(overrideClient);
|
|
130
|
+
return client.useMutation(
|
|
131
|
+
"post",
|
|
132
|
+
"/v1/booking_intents/{booking_intent_id}/abandon",
|
|
133
|
+
mutationOptions
|
|
134
|
+
);
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
// src/mutation-hooks/use-abandon-public-booking-intent.ts
|
|
138
|
+
var useAbandonPublicBookingIntent = (options) => {
|
|
139
|
+
const { client: overrideClient, ...mutationOptions } = options ?? {};
|
|
140
|
+
const client = useSavvyCalQueryClient(overrideClient);
|
|
141
|
+
return client.useMutation(
|
|
142
|
+
"post",
|
|
143
|
+
"/v1/public/booking_intents/{booking_intent_id}/abandon",
|
|
144
|
+
mutationOptions
|
|
145
|
+
);
|
|
146
|
+
};
|
|
147
|
+
|
|
126
148
|
// src/mutation-hooks/use-cancel-appointment.ts
|
|
127
149
|
var useCancelAppointment = (options) => {
|
|
128
150
|
const { client: overrideClient, ...mutationOptions } = options ?? {};
|
|
@@ -145,6 +167,28 @@ var useCancelPublicAppointment = (options) => {
|
|
|
145
167
|
);
|
|
146
168
|
};
|
|
147
169
|
|
|
170
|
+
// src/mutation-hooks/use-complete-booking-intent.ts
|
|
171
|
+
var useCompleteBookingIntent = (options) => {
|
|
172
|
+
const { client: overrideClient, ...mutationOptions } = options ?? {};
|
|
173
|
+
const client = useSavvyCalQueryClient(overrideClient);
|
|
174
|
+
return client.useMutation(
|
|
175
|
+
"post",
|
|
176
|
+
"/v1/booking_intents/{booking_intent_id}/complete",
|
|
177
|
+
mutationOptions
|
|
178
|
+
);
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
// src/mutation-hooks/use-complete-public-booking-intent.ts
|
|
182
|
+
var useCompletePublicBookingIntent = (options) => {
|
|
183
|
+
const { client: overrideClient, ...mutationOptions } = options ?? {};
|
|
184
|
+
const client = useSavvyCalQueryClient(overrideClient);
|
|
185
|
+
return client.useMutation(
|
|
186
|
+
"post",
|
|
187
|
+
"/v1/public/booking_intents/{booking_intent_id}/complete",
|
|
188
|
+
mutationOptions
|
|
189
|
+
);
|
|
190
|
+
};
|
|
191
|
+
|
|
148
192
|
// src/mutation-hooks/use-confirm-appointment.ts
|
|
149
193
|
var useConfirmAppointment = (options) => {
|
|
150
194
|
const { client: overrideClient, ...mutationOptions } = options ?? {};
|
|
@@ -184,6 +228,13 @@ var useCreateBlock = (options) => {
|
|
|
184
228
|
return client.useMutation("post", "/v1/blocks", mutationOptions);
|
|
185
229
|
};
|
|
186
230
|
|
|
231
|
+
// src/mutation-hooks/use-create-booking-intent.ts
|
|
232
|
+
var useCreateBookingIntent = (options) => {
|
|
233
|
+
const { client: overrideClient, ...mutationOptions } = options ?? {};
|
|
234
|
+
const client = useSavvyCalQueryClient(overrideClient);
|
|
235
|
+
return client.useMutation("post", "/v1/booking_intents", mutationOptions);
|
|
236
|
+
};
|
|
237
|
+
|
|
187
238
|
// src/mutation-hooks/use-create-cancellation-reason.ts
|
|
188
239
|
var useCreateCancellationReason = (options) => {
|
|
189
240
|
const { client: overrideClient, ...mutationOptions } = options ?? {};
|
|
@@ -234,6 +285,17 @@ var useCreatePublicAppointment = (options) => {
|
|
|
234
285
|
return client.useMutation("post", "/v1/public/appointments", mutationOptions);
|
|
235
286
|
};
|
|
236
287
|
|
|
288
|
+
// src/mutation-hooks/use-create-public-booking-intent.ts
|
|
289
|
+
var useCreatePublicBookingIntent = (options) => {
|
|
290
|
+
const { client: overrideClient, ...mutationOptions } = options ?? {};
|
|
291
|
+
const client = useSavvyCalQueryClient(overrideClient);
|
|
292
|
+
return client.useMutation(
|
|
293
|
+
"post",
|
|
294
|
+
"/v1/public/booking_intents",
|
|
295
|
+
mutationOptions
|
|
296
|
+
);
|
|
297
|
+
};
|
|
298
|
+
|
|
237
299
|
// src/mutation-hooks/use-create-service.ts
|
|
238
300
|
var useCreateService = (options) => {
|
|
239
301
|
const { client: overrideClient, ...mutationOptions } = options ?? {};
|
|
@@ -383,6 +445,17 @@ var useUpdateBlock = (options) => {
|
|
|
383
445
|
return client.useMutation("patch", "/v1/blocks/{block_id}", mutationOptions);
|
|
384
446
|
};
|
|
385
447
|
|
|
448
|
+
// src/mutation-hooks/use-update-booking-intent.ts
|
|
449
|
+
var useUpdateBookingIntent = (options) => {
|
|
450
|
+
const { client: overrideClient, ...mutationOptions } = options ?? {};
|
|
451
|
+
const client = useSavvyCalQueryClient(overrideClient);
|
|
452
|
+
return client.useMutation(
|
|
453
|
+
"patch",
|
|
454
|
+
"/v1/booking_intents/{booking_intent_id}",
|
|
455
|
+
mutationOptions
|
|
456
|
+
);
|
|
457
|
+
};
|
|
458
|
+
|
|
386
459
|
// src/mutation-hooks/use-update-cancellation-reason.ts
|
|
387
460
|
var useUpdateCancellationReason = (options) => {
|
|
388
461
|
const { client: overrideClient, ...mutationOptions } = options ?? {};
|
|
@@ -438,6 +511,17 @@ var useUpdateProviderSchedule = (options) => {
|
|
|
438
511
|
);
|
|
439
512
|
};
|
|
440
513
|
|
|
514
|
+
// src/mutation-hooks/use-update-public-booking-intent.ts
|
|
515
|
+
var useUpdatePublicBookingIntent = (options) => {
|
|
516
|
+
const { client: overrideClient, ...mutationOptions } = options ?? {};
|
|
517
|
+
const client = useSavvyCalQueryClient(overrideClient);
|
|
518
|
+
return client.useMutation(
|
|
519
|
+
"patch",
|
|
520
|
+
"/v1/public/booking_intents/{booking_intent_id}",
|
|
521
|
+
mutationOptions
|
|
522
|
+
);
|
|
523
|
+
};
|
|
524
|
+
|
|
441
525
|
// src/mutation-hooks/use-update-service.ts
|
|
442
526
|
var useUpdateService = (options) => {
|
|
443
527
|
const { client: overrideClient, ...mutationOptions } = options ?? {};
|
|
@@ -553,6 +637,39 @@ var useBlocks = (queryParams, options) => {
|
|
|
553
637
|
);
|
|
554
638
|
};
|
|
555
639
|
|
|
640
|
+
// src/query-hooks/use-booking-intent.ts
|
|
641
|
+
var useBookingIntent = (booking_intent_id, queryParams, options) => {
|
|
642
|
+
const { client: overrideClient, ...queryOptions } = options ?? {};
|
|
643
|
+
const client = useSavvyCalQueryClient(overrideClient);
|
|
644
|
+
return client.useQuery(
|
|
645
|
+
"get",
|
|
646
|
+
"/v1/booking_intents/{booking_intent_id}",
|
|
647
|
+
{
|
|
648
|
+
params: {
|
|
649
|
+
path: { booking_intent_id },
|
|
650
|
+
query: queryParams
|
|
651
|
+
}
|
|
652
|
+
},
|
|
653
|
+
queryOptions
|
|
654
|
+
);
|
|
655
|
+
};
|
|
656
|
+
|
|
657
|
+
// src/query-hooks/use-booking-intents.ts
|
|
658
|
+
var useBookingIntents = (queryParams, options) => {
|
|
659
|
+
const { client: overrideClient, ...queryOptions } = options ?? {};
|
|
660
|
+
const client = useSavvyCalQueryClient(overrideClient);
|
|
661
|
+
return client.useQuery(
|
|
662
|
+
"get",
|
|
663
|
+
"/v1/booking_intents",
|
|
664
|
+
{
|
|
665
|
+
params: {
|
|
666
|
+
query: queryParams
|
|
667
|
+
}
|
|
668
|
+
},
|
|
669
|
+
queryOptions
|
|
670
|
+
);
|
|
671
|
+
};
|
|
672
|
+
|
|
556
673
|
// src/query-hooks/use-cancellation-reason.ts
|
|
557
674
|
var useCancellationReason = (cancellation_reason_id, options) => {
|
|
558
675
|
const { client: overrideClient, ...queryOptions } = options ?? {};
|
|
@@ -758,6 +875,22 @@ var usePublicAppointment = (appointment_id, options) => {
|
|
|
758
875
|
);
|
|
759
876
|
};
|
|
760
877
|
|
|
878
|
+
// src/query-hooks/use-public-booking-intent.ts
|
|
879
|
+
var usePublicBookingIntent = (booking_intent_id, options) => {
|
|
880
|
+
const { client: overrideClient, ...queryOptions } = options ?? {};
|
|
881
|
+
const client = useSavvyCalQueryClient(overrideClient);
|
|
882
|
+
return client.useQuery(
|
|
883
|
+
"get",
|
|
884
|
+
"/v1/public/booking_intents/{booking_intent_id}",
|
|
885
|
+
{
|
|
886
|
+
params: {
|
|
887
|
+
path: { booking_intent_id }
|
|
888
|
+
}
|
|
889
|
+
},
|
|
890
|
+
queryOptions
|
|
891
|
+
);
|
|
892
|
+
};
|
|
893
|
+
|
|
761
894
|
// src/query-hooks/use-public-cancellation-reasons.ts
|
|
762
895
|
var usePublicCancellationReasons = (appointment_id, options) => {
|
|
763
896
|
const { client: overrideClient, ...queryOptions } = options ?? {};
|
|
@@ -865,6 +998,8 @@ var useServices = (queryParams, options) => {
|
|
|
865
998
|
export {
|
|
866
999
|
SavvyCalProvider,
|
|
867
1000
|
createQueryClient,
|
|
1001
|
+
useAbandonBookingIntent,
|
|
1002
|
+
useAbandonPublicBookingIntent,
|
|
868
1003
|
useAccountById,
|
|
869
1004
|
useAccountUsers,
|
|
870
1005
|
useAccounts,
|
|
@@ -872,12 +1007,16 @@ export {
|
|
|
872
1007
|
useAppointments,
|
|
873
1008
|
useBlock,
|
|
874
1009
|
useBlocks,
|
|
1010
|
+
useBookingIntent,
|
|
1011
|
+
useBookingIntents,
|
|
875
1012
|
useCancelAppointment,
|
|
876
1013
|
useCancelPublicAppointment,
|
|
877
1014
|
useCancellationReason,
|
|
878
1015
|
useCancellationReasons,
|
|
879
1016
|
useClient,
|
|
880
1017
|
useClients,
|
|
1018
|
+
useCompleteBookingIntent,
|
|
1019
|
+
useCompletePublicBookingIntent,
|
|
881
1020
|
useConfirmAppointment,
|
|
882
1021
|
useConnectedAccount,
|
|
883
1022
|
useConnectedAccounts,
|
|
@@ -885,12 +1024,14 @@ export {
|
|
|
885
1024
|
useCreateAccountUser,
|
|
886
1025
|
useCreateAppointment,
|
|
887
1026
|
useCreateBlock,
|
|
1027
|
+
useCreateBookingIntent,
|
|
888
1028
|
useCreateCancellationReason,
|
|
889
1029
|
useCreateClient,
|
|
890
1030
|
useCreateDashboardSession,
|
|
891
1031
|
useCreateProvider,
|
|
892
1032
|
useCreateProviderSchedule,
|
|
893
1033
|
useCreatePublicAppointment,
|
|
1034
|
+
useCreatePublicBookingIntent,
|
|
894
1035
|
useCreateService,
|
|
895
1036
|
useCreateServiceProvider,
|
|
896
1037
|
useCurrentAccount,
|
|
@@ -910,6 +1051,7 @@ export {
|
|
|
910
1051
|
useProviderSchedules,
|
|
911
1052
|
useProviders,
|
|
912
1053
|
usePublicAppointment,
|
|
1054
|
+
usePublicBookingIntent,
|
|
913
1055
|
usePublicCancellationReasons,
|
|
914
1056
|
usePublicServiceSlots,
|
|
915
1057
|
useRescheduleAppointment,
|
|
@@ -924,10 +1066,12 @@ export {
|
|
|
924
1066
|
useUpdateAccount,
|
|
925
1067
|
useUpdateAccountUser,
|
|
926
1068
|
useUpdateBlock,
|
|
1069
|
+
useUpdateBookingIntent,
|
|
927
1070
|
useUpdateCancellationReason,
|
|
928
1071
|
useUpdateClient,
|
|
929
1072
|
useUpdateConnectedAccount,
|
|
930
1073
|
useUpdateProvider,
|
|
931
1074
|
useUpdateProviderSchedule,
|
|
1075
|
+
useUpdatePublicBookingIntent,
|
|
932
1076
|
useUpdateService
|
|
933
1077
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@savvycal/appointments-react-query",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A tiny wrapper around @tanstack/react-query for the SavvyCal Appointments API",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"openapi-typescript-helpers": "^0.0.15",
|
|
46
|
-
"@savvycal/appointments-core": "0.
|
|
46
|
+
"@savvycal/appointments-core": "0.9.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@tanstack/react-query": "^5.0.0",
|