@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 CHANGED
@@ -39,6 +39,7 @@ __export(index_exports, {
39
39
  useAccounts: () => useAccounts,
40
40
  useAppointment: () => useAppointment,
41
41
  useAppointments: () => useAppointments,
42
+ useAttachServiceForm: () => useAttachServiceForm,
42
43
  useBlock: () => useBlock,
43
44
  useBlocks: () => useBlocks,
44
45
  useBookingIntent: () => useBookingIntent,
@@ -48,6 +49,8 @@ __export(index_exports, {
48
49
  useCancellationReason: () => useCancellationReason,
49
50
  useCancellationReasons: () => useCancellationReasons,
50
51
  useClient: () => useClient,
52
+ useClientField: () => useClientField,
53
+ useClientFields: () => useClientFields,
51
54
  useClients: () => useClients,
52
55
  useCompleteBookingIntent: () => useCompleteBookingIntent,
53
56
  useCompletePublicBookingIntent: () => useCompletePublicBookingIntent,
@@ -61,7 +64,9 @@ __export(index_exports, {
61
64
  useCreateBookingIntent: () => useCreateBookingIntent,
62
65
  useCreateCancellationReason: () => useCreateCancellationReason,
63
66
  useCreateClient: () => useCreateClient,
67
+ useCreateClientField: () => useCreateClientField,
64
68
  useCreateDashboardSession: () => useCreateDashboardSession,
69
+ useCreateForm: () => useCreateForm,
65
70
  useCreateProvider: () => useCreateProvider,
66
71
  useCreateProviderSchedule: () => useCreateProviderSchedule,
67
72
  useCreatePublicAppointment: () => useCreatePublicAppointment,
@@ -75,11 +80,16 @@ __export(index_exports, {
75
80
  useDeleteBlock: () => useDeleteBlock,
76
81
  useDeleteCancellationReason: () => useDeleteCancellationReason,
77
82
  useDeleteClient: () => useDeleteClient,
83
+ useDeleteClientField: () => useDeleteClientField,
78
84
  useDeleteConnectedAccount: () => useDeleteConnectedAccount,
85
+ useDeleteForm: () => useDeleteForm,
79
86
  useDeleteProviderSchedule: () => useDeleteProviderSchedule,
80
87
  useDeleteService: () => useDeleteService,
81
88
  useDeleteServiceProvider: () => useDeleteServiceProvider,
89
+ useDetachServiceForm: () => useDetachServiceForm,
82
90
  useEarliestPublicServiceSlot: () => useEarliestPublicServiceSlot,
91
+ useForm: () => useForm,
92
+ useForms: () => useForms,
83
93
  useProvider: () => useProvider,
84
94
  useProviderSchedule: () => useProviderSchedule,
85
95
  useProviderSchedules: () => useProviderSchedules,
@@ -94,16 +104,20 @@ __export(index_exports, {
94
104
  useSavvyCalFetchClient: () => useSavvyCalFetchClient,
95
105
  useSavvyCalQueryClient: () => useSavvyCalQueryClient,
96
106
  useService: () => useService,
107
+ useServiceForms: () => useServiceForms,
97
108
  useServiceProviders: () => useServiceProviders,
98
109
  useServiceSlots: () => useServiceSlots,
99
110
  useServices: () => useServices,
111
+ useSortServiceForms: () => useSortServiceForms,
100
112
  useUpdateAccount: () => useUpdateAccount,
101
113
  useUpdateAccountUser: () => useUpdateAccountUser,
102
114
  useUpdateBlock: () => useUpdateBlock,
103
115
  useUpdateBookingIntent: () => useUpdateBookingIntent,
104
116
  useUpdateCancellationReason: () => useUpdateCancellationReason,
105
117
  useUpdateClient: () => useUpdateClient,
118
+ useUpdateClientField: () => useUpdateClientField,
106
119
  useUpdateConnectedAccount: () => useUpdateConnectedAccount,
120
+ useUpdateForm: () => useUpdateForm,
107
121
  useUpdateProvider: () => useUpdateProvider,
108
122
  useUpdateProviderSchedule: () => useUpdateProviderSchedule,
109
123
  useUpdatePublicBookingIntent: () => useUpdatePublicBookingIntent,
@@ -256,6 +270,17 @@ var useAbandonPublicBookingIntent = (options) => {
256
270
  );
257
271
  };
258
272
 
273
+ // src/mutation-hooks/use-attach-service-form.ts
274
+ var useAttachServiceForm = (options) => {
275
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
276
+ const client = useSavvyCalQueryClient(overrideClient);
277
+ return client.useMutation(
278
+ "post",
279
+ "/v1/services/{service_id}/forms",
280
+ mutationOptions
281
+ );
282
+ };
283
+
259
284
  // src/mutation-hooks/use-cancel-appointment.ts
260
285
  var useCancelAppointment = (options) => {
261
286
  const { client: overrideClient, ...mutationOptions } = options ?? {};
@@ -364,6 +389,13 @@ var useCreateClient = (options) => {
364
389
  return client.useMutation("post", "/v1/clients", mutationOptions);
365
390
  };
366
391
 
392
+ // src/mutation-hooks/use-create-client-field.ts
393
+ var useCreateClientField = (options) => {
394
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
395
+ const client = useSavvyCalQueryClient(overrideClient);
396
+ return client.useMutation("post", "/v1/client_fields", mutationOptions);
397
+ };
398
+
367
399
  // src/mutation-hooks/use-create-dashboard-session.ts
368
400
  var useCreateDashboardSession = (options) => {
369
401
  const { client: overrideClient, ...mutationOptions } = options ?? {};
@@ -371,6 +403,13 @@ var useCreateDashboardSession = (options) => {
371
403
  return client.useMutation("post", "/v1/dashboard_sessions", mutationOptions);
372
404
  };
373
405
 
406
+ // src/mutation-hooks/use-create-form.ts
407
+ var useCreateForm = (options) => {
408
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
409
+ const client = useSavvyCalQueryClient(overrideClient);
410
+ return client.useMutation("post", "/v1/forms", mutationOptions);
411
+ };
412
+
374
413
  // src/mutation-hooks/use-create-provider.ts
375
414
  var useCreateProvider = (options) => {
376
415
  const { client: overrideClient, ...mutationOptions } = options ?? {};
@@ -465,6 +504,17 @@ var useDeleteClient = (options) => {
465
504
  );
466
505
  };
467
506
 
507
+ // src/mutation-hooks/use-delete-client-field.ts
508
+ var useDeleteClientField = (options) => {
509
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
510
+ const client = useSavvyCalQueryClient(overrideClient);
511
+ return client.useMutation(
512
+ "delete",
513
+ "/v1/client_fields/{client_field_id}",
514
+ mutationOptions
515
+ );
516
+ };
517
+
468
518
  // src/mutation-hooks/use-delete-connected-account.ts
469
519
  var useDeleteConnectedAccount = (options) => {
470
520
  const { client: overrideClient, ...mutationOptions } = options ?? {};
@@ -476,6 +526,13 @@ var useDeleteConnectedAccount = (options) => {
476
526
  );
477
527
  };
478
528
 
529
+ // src/mutation-hooks/use-delete-form.ts
530
+ var useDeleteForm = (options) => {
531
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
532
+ const client = useSavvyCalQueryClient(overrideClient);
533
+ return client.useMutation("delete", "/v1/forms/{form_id}", mutationOptions);
534
+ };
535
+
479
536
  // src/mutation-hooks/use-delete-provider-schedule.ts
480
537
  var useDeleteProviderSchedule = (options) => {
481
538
  const { client: overrideClient, ...mutationOptions } = options ?? {};
@@ -509,6 +566,17 @@ var useDeleteServiceProvider = (options) => {
509
566
  );
510
567
  };
511
568
 
569
+ // src/mutation-hooks/use-detach-service-form.ts
570
+ var useDetachServiceForm = (options) => {
571
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
572
+ const client = useSavvyCalQueryClient(overrideClient);
573
+ return client.useMutation(
574
+ "delete",
575
+ "/v1/service_forms/{service_form_id}",
576
+ mutationOptions
577
+ );
578
+ };
579
+
512
580
  // src/mutation-hooks/use-reschedule-appointment.ts
513
581
  var useRescheduleAppointment = (options) => {
514
582
  const { client: overrideClient, ...mutationOptions } = options ?? {};
@@ -531,6 +599,17 @@ var useReschedulePublicAppointment = (options) => {
531
599
  );
532
600
  };
533
601
 
602
+ // src/mutation-hooks/use-sort-service-forms.ts
603
+ var useSortServiceForms = (options) => {
604
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
605
+ const client = useSavvyCalQueryClient(overrideClient);
606
+ return client.useMutation(
607
+ "post",
608
+ "/v1/services/{service_id}/forms/sort",
609
+ mutationOptions
610
+ );
611
+ };
612
+
534
613
  // src/mutation-hooks/use-update-account.ts
535
614
  var useUpdateAccount = (options) => {
536
615
  const { client: overrideClient, ...mutationOptions } = options ?? {};
@@ -589,6 +668,17 @@ var useUpdateClient = (options) => {
589
668
  );
590
669
  };
591
670
 
671
+ // src/mutation-hooks/use-update-client-field.ts
672
+ var useUpdateClientField = (options) => {
673
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
674
+ const client = useSavvyCalQueryClient(overrideClient);
675
+ return client.useMutation(
676
+ "patch",
677
+ "/v1/client_fields/{client_field_id}",
678
+ mutationOptions
679
+ );
680
+ };
681
+
592
682
  // src/mutation-hooks/use-update-connected-account.ts
593
683
  var useUpdateConnectedAccount = (options) => {
594
684
  const { client: overrideClient, ...mutationOptions } = options ?? {};
@@ -600,6 +690,13 @@ var useUpdateConnectedAccount = (options) => {
600
690
  );
601
691
  };
602
692
 
693
+ // src/mutation-hooks/use-update-form.ts
694
+ var useUpdateForm = (options) => {
695
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
696
+ const client = useSavvyCalQueryClient(overrideClient);
697
+ return client.useMutation("patch", "/v1/forms/{form_id}", mutationOptions);
698
+ };
699
+
603
700
  // src/mutation-hooks/use-update-provider.ts
604
701
  var useUpdateProvider = (options) => {
605
702
  const { client: overrideClient, ...mutationOptions } = options ?? {};
@@ -805,7 +902,7 @@ var useCancellationReasons = (options) => {
805
902
  };
806
903
 
807
904
  // src/query-hooks/use-client.ts
808
- var useClient = (client_id, options) => {
905
+ var useClient = (client_id, queryParams, options) => {
809
906
  const { client: overrideClient, ...queryOptions } = options ?? {};
810
907
  const client = useSavvyCalQueryClient(overrideClient);
811
908
  return client.useQuery(
@@ -813,13 +910,37 @@ var useClient = (client_id, options) => {
813
910
  "/v1/clients/{client_id}",
814
911
  {
815
912
  params: {
816
- path: { client_id }
913
+ path: { client_id },
914
+ query: queryParams
915
+ }
916
+ },
917
+ queryOptions
918
+ );
919
+ };
920
+
921
+ // src/query-hooks/use-client-field.ts
922
+ var useClientField = (client_field_id, options) => {
923
+ const { client: overrideClient, ...queryOptions } = options ?? {};
924
+ const client = useSavvyCalQueryClient(overrideClient);
925
+ return client.useQuery(
926
+ "get",
927
+ "/v1/client_fields/{client_field_id}",
928
+ {
929
+ params: {
930
+ path: { client_field_id }
817
931
  }
818
932
  },
819
933
  queryOptions
820
934
  );
821
935
  };
822
936
 
937
+ // src/query-hooks/use-client-fields.ts
938
+ var useClientFields = (options) => {
939
+ const { client: overrideClient, ...queryOptions } = options ?? {};
940
+ const client = useSavvyCalQueryClient(overrideClient);
941
+ return client.useQuery("get", "/v1/client_fields", {}, queryOptions);
942
+ };
943
+
823
944
  // src/query-hooks/use-clients.ts
824
945
  var useClients = (queryParams, options) => {
825
946
  const { client: overrideClient, ...queryOptions } = options ?? {};
@@ -906,6 +1027,38 @@ var useEarliestPublicServiceSlot = (service_id, queryParams, options) => {
906
1027
  );
907
1028
  };
908
1029
 
1030
+ // src/query-hooks/use-form.ts
1031
+ var useForm = (form_id, options) => {
1032
+ const { client: overrideClient, ...queryOptions } = options ?? {};
1033
+ const client = useSavvyCalQueryClient(overrideClient);
1034
+ return client.useQuery(
1035
+ "get",
1036
+ "/v1/forms/{form_id}",
1037
+ {
1038
+ params: {
1039
+ path: { form_id }
1040
+ }
1041
+ },
1042
+ queryOptions
1043
+ );
1044
+ };
1045
+
1046
+ // src/query-hooks/use-forms.ts
1047
+ var useForms = (queryParams, options) => {
1048
+ const { client: overrideClient, ...queryOptions } = options ?? {};
1049
+ const client = useSavvyCalQueryClient(overrideClient);
1050
+ return client.useQuery(
1051
+ "get",
1052
+ "/v1/forms",
1053
+ {
1054
+ params: {
1055
+ query: queryParams
1056
+ }
1057
+ },
1058
+ queryOptions
1059
+ );
1060
+ };
1061
+
909
1062
  // src/query-hooks/use-provider.ts
910
1063
  var useProvider = (provider_id, options) => {
911
1064
  const { client: overrideClient, ...queryOptions } = options ?? {};
@@ -1058,6 +1211,22 @@ var useService = (service_id, options) => {
1058
1211
  );
1059
1212
  };
1060
1213
 
1214
+ // src/query-hooks/use-service-forms.ts
1215
+ var useServiceForms = (service_id, options) => {
1216
+ const { client: overrideClient, ...queryOptions } = options ?? {};
1217
+ const client = useSavvyCalQueryClient(overrideClient);
1218
+ return client.useQuery(
1219
+ "get",
1220
+ "/v1/services/{service_id}/forms",
1221
+ {
1222
+ params: {
1223
+ path: { service_id }
1224
+ }
1225
+ },
1226
+ queryOptions
1227
+ );
1228
+ };
1229
+
1061
1230
  // src/query-hooks/use-service-providers.ts
1062
1231
  var useServiceProviders = (service_id, options) => {
1063
1232
  const { client: overrideClient, ...queryOptions } = options ?? {};
@@ -1117,6 +1286,7 @@ var useServices = (queryParams, options) => {
1117
1286
  useAccounts,
1118
1287
  useAppointment,
1119
1288
  useAppointments,
1289
+ useAttachServiceForm,
1120
1290
  useBlock,
1121
1291
  useBlocks,
1122
1292
  useBookingIntent,
@@ -1126,6 +1296,8 @@ var useServices = (queryParams, options) => {
1126
1296
  useCancellationReason,
1127
1297
  useCancellationReasons,
1128
1298
  useClient,
1299
+ useClientField,
1300
+ useClientFields,
1129
1301
  useClients,
1130
1302
  useCompleteBookingIntent,
1131
1303
  useCompletePublicBookingIntent,
@@ -1139,7 +1311,9 @@ var useServices = (queryParams, options) => {
1139
1311
  useCreateBookingIntent,
1140
1312
  useCreateCancellationReason,
1141
1313
  useCreateClient,
1314
+ useCreateClientField,
1142
1315
  useCreateDashboardSession,
1316
+ useCreateForm,
1143
1317
  useCreateProvider,
1144
1318
  useCreateProviderSchedule,
1145
1319
  useCreatePublicAppointment,
@@ -1153,11 +1327,16 @@ var useServices = (queryParams, options) => {
1153
1327
  useDeleteBlock,
1154
1328
  useDeleteCancellationReason,
1155
1329
  useDeleteClient,
1330
+ useDeleteClientField,
1156
1331
  useDeleteConnectedAccount,
1332
+ useDeleteForm,
1157
1333
  useDeleteProviderSchedule,
1158
1334
  useDeleteService,
1159
1335
  useDeleteServiceProvider,
1336
+ useDetachServiceForm,
1160
1337
  useEarliestPublicServiceSlot,
1338
+ useForm,
1339
+ useForms,
1161
1340
  useProvider,
1162
1341
  useProviderSchedule,
1163
1342
  useProviderSchedules,
@@ -1172,16 +1351,20 @@ var useServices = (queryParams, options) => {
1172
1351
  useSavvyCalFetchClient,
1173
1352
  useSavvyCalQueryClient,
1174
1353
  useService,
1354
+ useServiceForms,
1175
1355
  useServiceProviders,
1176
1356
  useServiceSlots,
1177
1357
  useServices,
1358
+ useSortServiceForms,
1178
1359
  useUpdateAccount,
1179
1360
  useUpdateAccountUser,
1180
1361
  useUpdateBlock,
1181
1362
  useUpdateBookingIntent,
1182
1363
  useUpdateCancellationReason,
1183
1364
  useUpdateClient,
1365
+ useUpdateClientField,
1184
1366
  useUpdateConnectedAccount,
1367
+ useUpdateForm,
1185
1368
  useUpdateProvider,
1186
1369
  useUpdateProviderSchedule,
1187
1370
  useUpdatePublicBookingIntent,