@savvycal/appointments-react-query 0.4.0 → 1.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 +185 -2
- package/dist/index.d.cts +5110 -2657
- package/dist/index.d.ts +5110 -2657
- package/dist/index.js +171 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -145,6 +145,17 @@ var useAbandonPublicBookingIntent = (options) => {
|
|
|
145
145
|
);
|
|
146
146
|
};
|
|
147
147
|
|
|
148
|
+
// src/mutation-hooks/use-attach-service-form.ts
|
|
149
|
+
var useAttachServiceForm = (options) => {
|
|
150
|
+
const { client: overrideClient, ...mutationOptions } = options ?? {};
|
|
151
|
+
const client = useSavvyCalQueryClient(overrideClient);
|
|
152
|
+
return client.useMutation(
|
|
153
|
+
"post",
|
|
154
|
+
"/v1/services/{service_id}/forms",
|
|
155
|
+
mutationOptions
|
|
156
|
+
);
|
|
157
|
+
};
|
|
158
|
+
|
|
148
159
|
// src/mutation-hooks/use-cancel-appointment.ts
|
|
149
160
|
var useCancelAppointment = (options) => {
|
|
150
161
|
const { client: overrideClient, ...mutationOptions } = options ?? {};
|
|
@@ -253,6 +264,13 @@ var useCreateClient = (options) => {
|
|
|
253
264
|
return client.useMutation("post", "/v1/clients", mutationOptions);
|
|
254
265
|
};
|
|
255
266
|
|
|
267
|
+
// src/mutation-hooks/use-create-client-field.ts
|
|
268
|
+
var useCreateClientField = (options) => {
|
|
269
|
+
const { client: overrideClient, ...mutationOptions } = options ?? {};
|
|
270
|
+
const client = useSavvyCalQueryClient(overrideClient);
|
|
271
|
+
return client.useMutation("post", "/v1/client_fields", mutationOptions);
|
|
272
|
+
};
|
|
273
|
+
|
|
256
274
|
// src/mutation-hooks/use-create-dashboard-session.ts
|
|
257
275
|
var useCreateDashboardSession = (options) => {
|
|
258
276
|
const { client: overrideClient, ...mutationOptions } = options ?? {};
|
|
@@ -260,6 +278,13 @@ var useCreateDashboardSession = (options) => {
|
|
|
260
278
|
return client.useMutation("post", "/v1/dashboard_sessions", mutationOptions);
|
|
261
279
|
};
|
|
262
280
|
|
|
281
|
+
// src/mutation-hooks/use-create-form.ts
|
|
282
|
+
var useCreateForm = (options) => {
|
|
283
|
+
const { client: overrideClient, ...mutationOptions } = options ?? {};
|
|
284
|
+
const client = useSavvyCalQueryClient(overrideClient);
|
|
285
|
+
return client.useMutation("post", "/v1/forms", mutationOptions);
|
|
286
|
+
};
|
|
287
|
+
|
|
263
288
|
// src/mutation-hooks/use-create-provider.ts
|
|
264
289
|
var useCreateProvider = (options) => {
|
|
265
290
|
const { client: overrideClient, ...mutationOptions } = options ?? {};
|
|
@@ -354,6 +379,17 @@ var useDeleteClient = (options) => {
|
|
|
354
379
|
);
|
|
355
380
|
};
|
|
356
381
|
|
|
382
|
+
// src/mutation-hooks/use-delete-client-field.ts
|
|
383
|
+
var useDeleteClientField = (options) => {
|
|
384
|
+
const { client: overrideClient, ...mutationOptions } = options ?? {};
|
|
385
|
+
const client = useSavvyCalQueryClient(overrideClient);
|
|
386
|
+
return client.useMutation(
|
|
387
|
+
"delete",
|
|
388
|
+
"/v1/client_fields/{client_field_id}",
|
|
389
|
+
mutationOptions
|
|
390
|
+
);
|
|
391
|
+
};
|
|
392
|
+
|
|
357
393
|
// src/mutation-hooks/use-delete-connected-account.ts
|
|
358
394
|
var useDeleteConnectedAccount = (options) => {
|
|
359
395
|
const { client: overrideClient, ...mutationOptions } = options ?? {};
|
|
@@ -365,6 +401,13 @@ var useDeleteConnectedAccount = (options) => {
|
|
|
365
401
|
);
|
|
366
402
|
};
|
|
367
403
|
|
|
404
|
+
// src/mutation-hooks/use-delete-form.ts
|
|
405
|
+
var useDeleteForm = (options) => {
|
|
406
|
+
const { client: overrideClient, ...mutationOptions } = options ?? {};
|
|
407
|
+
const client = useSavvyCalQueryClient(overrideClient);
|
|
408
|
+
return client.useMutation("delete", "/v1/forms/{form_id}", mutationOptions);
|
|
409
|
+
};
|
|
410
|
+
|
|
368
411
|
// src/mutation-hooks/use-delete-provider-schedule.ts
|
|
369
412
|
var useDeleteProviderSchedule = (options) => {
|
|
370
413
|
const { client: overrideClient, ...mutationOptions } = options ?? {};
|
|
@@ -398,6 +441,17 @@ var useDeleteServiceProvider = (options) => {
|
|
|
398
441
|
);
|
|
399
442
|
};
|
|
400
443
|
|
|
444
|
+
// src/mutation-hooks/use-detach-service-form.ts
|
|
445
|
+
var useDetachServiceForm = (options) => {
|
|
446
|
+
const { client: overrideClient, ...mutationOptions } = options ?? {};
|
|
447
|
+
const client = useSavvyCalQueryClient(overrideClient);
|
|
448
|
+
return client.useMutation(
|
|
449
|
+
"delete",
|
|
450
|
+
"/v1/service_forms/{service_form_id}",
|
|
451
|
+
mutationOptions
|
|
452
|
+
);
|
|
453
|
+
};
|
|
454
|
+
|
|
401
455
|
// src/mutation-hooks/use-reschedule-appointment.ts
|
|
402
456
|
var useRescheduleAppointment = (options) => {
|
|
403
457
|
const { client: overrideClient, ...mutationOptions } = options ?? {};
|
|
@@ -420,6 +474,17 @@ var useReschedulePublicAppointment = (options) => {
|
|
|
420
474
|
);
|
|
421
475
|
};
|
|
422
476
|
|
|
477
|
+
// src/mutation-hooks/use-sort-service-forms.ts
|
|
478
|
+
var useSortServiceForms = (options) => {
|
|
479
|
+
const { client: overrideClient, ...mutationOptions } = options ?? {};
|
|
480
|
+
const client = useSavvyCalQueryClient(overrideClient);
|
|
481
|
+
return client.useMutation(
|
|
482
|
+
"post",
|
|
483
|
+
"/v1/services/{service_id}/forms/sort",
|
|
484
|
+
mutationOptions
|
|
485
|
+
);
|
|
486
|
+
};
|
|
487
|
+
|
|
423
488
|
// src/mutation-hooks/use-update-account.ts
|
|
424
489
|
var useUpdateAccount = (options) => {
|
|
425
490
|
const { client: overrideClient, ...mutationOptions } = options ?? {};
|
|
@@ -478,6 +543,17 @@ var useUpdateClient = (options) => {
|
|
|
478
543
|
);
|
|
479
544
|
};
|
|
480
545
|
|
|
546
|
+
// src/mutation-hooks/use-update-client-field.ts
|
|
547
|
+
var useUpdateClientField = (options) => {
|
|
548
|
+
const { client: overrideClient, ...mutationOptions } = options ?? {};
|
|
549
|
+
const client = useSavvyCalQueryClient(overrideClient);
|
|
550
|
+
return client.useMutation(
|
|
551
|
+
"patch",
|
|
552
|
+
"/v1/client_fields/{client_field_id}",
|
|
553
|
+
mutationOptions
|
|
554
|
+
);
|
|
555
|
+
};
|
|
556
|
+
|
|
481
557
|
// src/mutation-hooks/use-update-connected-account.ts
|
|
482
558
|
var useUpdateConnectedAccount = (options) => {
|
|
483
559
|
const { client: overrideClient, ...mutationOptions } = options ?? {};
|
|
@@ -489,6 +565,13 @@ var useUpdateConnectedAccount = (options) => {
|
|
|
489
565
|
);
|
|
490
566
|
};
|
|
491
567
|
|
|
568
|
+
// src/mutation-hooks/use-update-form.ts
|
|
569
|
+
var useUpdateForm = (options) => {
|
|
570
|
+
const { client: overrideClient, ...mutationOptions } = options ?? {};
|
|
571
|
+
const client = useSavvyCalQueryClient(overrideClient);
|
|
572
|
+
return client.useMutation("patch", "/v1/forms/{form_id}", mutationOptions);
|
|
573
|
+
};
|
|
574
|
+
|
|
492
575
|
// src/mutation-hooks/use-update-provider.ts
|
|
493
576
|
var useUpdateProvider = (options) => {
|
|
494
577
|
const { client: overrideClient, ...mutationOptions } = options ?? {};
|
|
@@ -694,7 +777,7 @@ var useCancellationReasons = (options) => {
|
|
|
694
777
|
};
|
|
695
778
|
|
|
696
779
|
// src/query-hooks/use-client.ts
|
|
697
|
-
var useClient = (client_id, options) => {
|
|
780
|
+
var useClient = (client_id, queryParams, options) => {
|
|
698
781
|
const { client: overrideClient, ...queryOptions } = options ?? {};
|
|
699
782
|
const client = useSavvyCalQueryClient(overrideClient);
|
|
700
783
|
return client.useQuery(
|
|
@@ -702,13 +785,37 @@ var useClient = (client_id, options) => {
|
|
|
702
785
|
"/v1/clients/{client_id}",
|
|
703
786
|
{
|
|
704
787
|
params: {
|
|
705
|
-
path: { client_id }
|
|
788
|
+
path: { client_id },
|
|
789
|
+
query: queryParams
|
|
790
|
+
}
|
|
791
|
+
},
|
|
792
|
+
queryOptions
|
|
793
|
+
);
|
|
794
|
+
};
|
|
795
|
+
|
|
796
|
+
// src/query-hooks/use-client-field.ts
|
|
797
|
+
var useClientField = (client_field_id, options) => {
|
|
798
|
+
const { client: overrideClient, ...queryOptions } = options ?? {};
|
|
799
|
+
const client = useSavvyCalQueryClient(overrideClient);
|
|
800
|
+
return client.useQuery(
|
|
801
|
+
"get",
|
|
802
|
+
"/v1/client_fields/{client_field_id}",
|
|
803
|
+
{
|
|
804
|
+
params: {
|
|
805
|
+
path: { client_field_id }
|
|
706
806
|
}
|
|
707
807
|
},
|
|
708
808
|
queryOptions
|
|
709
809
|
);
|
|
710
810
|
};
|
|
711
811
|
|
|
812
|
+
// src/query-hooks/use-client-fields.ts
|
|
813
|
+
var useClientFields = (options) => {
|
|
814
|
+
const { client: overrideClient, ...queryOptions } = options ?? {};
|
|
815
|
+
const client = useSavvyCalQueryClient(overrideClient);
|
|
816
|
+
return client.useQuery("get", "/v1/client_fields", {}, queryOptions);
|
|
817
|
+
};
|
|
818
|
+
|
|
712
819
|
// src/query-hooks/use-clients.ts
|
|
713
820
|
var useClients = (queryParams, options) => {
|
|
714
821
|
const { client: overrideClient, ...queryOptions } = options ?? {};
|
|
@@ -795,6 +902,38 @@ var useEarliestPublicServiceSlot = (service_id, queryParams, options) => {
|
|
|
795
902
|
);
|
|
796
903
|
};
|
|
797
904
|
|
|
905
|
+
// src/query-hooks/use-form.ts
|
|
906
|
+
var useForm = (form_id, options) => {
|
|
907
|
+
const { client: overrideClient, ...queryOptions } = options ?? {};
|
|
908
|
+
const client = useSavvyCalQueryClient(overrideClient);
|
|
909
|
+
return client.useQuery(
|
|
910
|
+
"get",
|
|
911
|
+
"/v1/forms/{form_id}",
|
|
912
|
+
{
|
|
913
|
+
params: {
|
|
914
|
+
path: { form_id }
|
|
915
|
+
}
|
|
916
|
+
},
|
|
917
|
+
queryOptions
|
|
918
|
+
);
|
|
919
|
+
};
|
|
920
|
+
|
|
921
|
+
// src/query-hooks/use-forms.ts
|
|
922
|
+
var useForms = (queryParams, options) => {
|
|
923
|
+
const { client: overrideClient, ...queryOptions } = options ?? {};
|
|
924
|
+
const client = useSavvyCalQueryClient(overrideClient);
|
|
925
|
+
return client.useQuery(
|
|
926
|
+
"get",
|
|
927
|
+
"/v1/forms",
|
|
928
|
+
{
|
|
929
|
+
params: {
|
|
930
|
+
query: queryParams
|
|
931
|
+
}
|
|
932
|
+
},
|
|
933
|
+
queryOptions
|
|
934
|
+
);
|
|
935
|
+
};
|
|
936
|
+
|
|
798
937
|
// src/query-hooks/use-provider.ts
|
|
799
938
|
var useProvider = (provider_id, options) => {
|
|
800
939
|
const { client: overrideClient, ...queryOptions } = options ?? {};
|
|
@@ -947,6 +1086,22 @@ var useService = (service_id, options) => {
|
|
|
947
1086
|
);
|
|
948
1087
|
};
|
|
949
1088
|
|
|
1089
|
+
// src/query-hooks/use-service-forms.ts
|
|
1090
|
+
var useServiceForms = (service_id, options) => {
|
|
1091
|
+
const { client: overrideClient, ...queryOptions } = options ?? {};
|
|
1092
|
+
const client = useSavvyCalQueryClient(overrideClient);
|
|
1093
|
+
return client.useQuery(
|
|
1094
|
+
"get",
|
|
1095
|
+
"/v1/services/{service_id}/forms",
|
|
1096
|
+
{
|
|
1097
|
+
params: {
|
|
1098
|
+
path: { service_id }
|
|
1099
|
+
}
|
|
1100
|
+
},
|
|
1101
|
+
queryOptions
|
|
1102
|
+
);
|
|
1103
|
+
};
|
|
1104
|
+
|
|
950
1105
|
// src/query-hooks/use-service-providers.ts
|
|
951
1106
|
var useServiceProviders = (service_id, options) => {
|
|
952
1107
|
const { client: overrideClient, ...queryOptions } = options ?? {};
|
|
@@ -1005,6 +1160,7 @@ export {
|
|
|
1005
1160
|
useAccounts,
|
|
1006
1161
|
useAppointment,
|
|
1007
1162
|
useAppointments,
|
|
1163
|
+
useAttachServiceForm,
|
|
1008
1164
|
useBlock,
|
|
1009
1165
|
useBlocks,
|
|
1010
1166
|
useBookingIntent,
|
|
@@ -1014,6 +1170,8 @@ export {
|
|
|
1014
1170
|
useCancellationReason,
|
|
1015
1171
|
useCancellationReasons,
|
|
1016
1172
|
useClient,
|
|
1173
|
+
useClientField,
|
|
1174
|
+
useClientFields,
|
|
1017
1175
|
useClients,
|
|
1018
1176
|
useCompleteBookingIntent,
|
|
1019
1177
|
useCompletePublicBookingIntent,
|
|
@@ -1027,7 +1185,9 @@ export {
|
|
|
1027
1185
|
useCreateBookingIntent,
|
|
1028
1186
|
useCreateCancellationReason,
|
|
1029
1187
|
useCreateClient,
|
|
1188
|
+
useCreateClientField,
|
|
1030
1189
|
useCreateDashboardSession,
|
|
1190
|
+
useCreateForm,
|
|
1031
1191
|
useCreateProvider,
|
|
1032
1192
|
useCreateProviderSchedule,
|
|
1033
1193
|
useCreatePublicAppointment,
|
|
@@ -1041,11 +1201,16 @@ export {
|
|
|
1041
1201
|
useDeleteBlock,
|
|
1042
1202
|
useDeleteCancellationReason,
|
|
1043
1203
|
useDeleteClient,
|
|
1204
|
+
useDeleteClientField,
|
|
1044
1205
|
useDeleteConnectedAccount,
|
|
1206
|
+
useDeleteForm,
|
|
1045
1207
|
useDeleteProviderSchedule,
|
|
1046
1208
|
useDeleteService,
|
|
1047
1209
|
useDeleteServiceProvider,
|
|
1210
|
+
useDetachServiceForm,
|
|
1048
1211
|
useEarliestPublicServiceSlot,
|
|
1212
|
+
useForm,
|
|
1213
|
+
useForms,
|
|
1049
1214
|
useProvider,
|
|
1050
1215
|
useProviderSchedule,
|
|
1051
1216
|
useProviderSchedules,
|
|
@@ -1060,16 +1225,20 @@ export {
|
|
|
1060
1225
|
useSavvyCalFetchClient,
|
|
1061
1226
|
useSavvyCalQueryClient,
|
|
1062
1227
|
useService,
|
|
1228
|
+
useServiceForms,
|
|
1063
1229
|
useServiceProviders,
|
|
1064
1230
|
useServiceSlots,
|
|
1065
1231
|
useServices,
|
|
1232
|
+
useSortServiceForms,
|
|
1066
1233
|
useUpdateAccount,
|
|
1067
1234
|
useUpdateAccountUser,
|
|
1068
1235
|
useUpdateBlock,
|
|
1069
1236
|
useUpdateBookingIntent,
|
|
1070
1237
|
useUpdateCancellationReason,
|
|
1071
1238
|
useUpdateClient,
|
|
1239
|
+
useUpdateClientField,
|
|
1072
1240
|
useUpdateConnectedAccount,
|
|
1241
|
+
useUpdateForm,
|
|
1073
1242
|
useUpdateProvider,
|
|
1074
1243
|
useUpdateProviderSchedule,
|
|
1075
1244
|
useUpdatePublicBookingIntent,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@savvycal/appointments-react-query",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.1.0",
|
|
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": "
|
|
46
|
+
"@savvycal/appointments-core": "1.1.0"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
49
|
"@tanstack/react-query": "^5.0.0",
|