@savvycal/appointments-react-query 0.1.2 → 0.2.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
@@ -86,6 +86,7 @@ __export(index_exports, {
86
86
  useServiceSlots: () => useServiceSlots,
87
87
  useServices: () => useServices,
88
88
  useUpdateAccount: () => useUpdateAccount,
89
+ useUpdateAccountUser: () => useUpdateAccountUser,
89
90
  useUpdateBlock: () => useUpdateBlock,
90
91
  useUpdateCancellationReason: () => useUpdateCancellationReason,
91
92
  useUpdateClient: () => useUpdateClient,
@@ -453,6 +454,13 @@ var useUpdateAccount = (options) => {
453
454
  );
454
455
  };
455
456
 
457
+ // src/mutation-hooks/use-update-account-user.ts
458
+ var useUpdateAccountUser = (options) => {
459
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
460
+ const client = useSavvyCalQueryClient(overrideClient);
461
+ return client.useMutation("patch", "/v1/users/{user_id}", mutationOptions);
462
+ };
463
+
456
464
  // src/mutation-hooks/use-update-block.ts
457
465
  var useUpdateBlock = (options) => {
458
466
  const { client: overrideClient, ...mutationOptions } = options ?? {};
@@ -954,6 +962,7 @@ var useServices = (queryParams, options) => {
954
962
  useServiceSlots,
955
963
  useServices,
956
964
  useUpdateAccount,
965
+ useUpdateAccountUser,
957
966
  useUpdateBlock,
958
967
  useUpdateCancellationReason,
959
968
  useUpdateClient,
package/dist/index.d.cts CHANGED
@@ -51,10 +51,10 @@ type GetResponseData<Path extends keyof paths, Method extends HttpMethod, Media
51
51
  type GetResponseError<Path extends keyof paths, Method extends HttpMethod, Media extends MediaType> = Path extends keyof paths ? Method extends keyof paths[Path] ? paths[Path][Method] extends infer Operation ? Operation extends Record<string, any> ? Required<FetchResponse<Operation, MaybeOptionalInit<paths[Path], Method>, Media>>["error"] : never : never : never : never;
52
52
  type QueryKey<Path extends keyof paths, Method extends HttpMethod, Init = MaybeOptionalInit<paths[Path], Method>> = Init extends undefined ? readonly [Method, Path] : readonly [Method, Path, Init];
53
53
 
54
- interface Options$V extends MutationOptionsFor<"post", "/v1/appointments/{appointment_id}/cancel"> {
54
+ interface Options$W extends MutationOptionsFor<"post", "/v1/appointments/{appointment_id}/cancel"> {
55
55
  client?: QueryClient;
56
56
  }
57
- declare const useCancelAppointment: (options?: Options$V) => _tanstack_react_query.UseMutationResult<{
57
+ declare const useCancelAppointment: (options?: Options$W) => _tanstack_react_query.UseMutationResult<{
58
58
  data: {
59
59
  appointment_type: "in_person" | "virtual";
60
60
  cancellation_events: {
@@ -725,10 +725,10 @@ declare const useCancelAppointment: (options?: Options$V) => _tanstack_react_que
725
725
  };
726
726
  }>>;
727
727
 
728
- interface Options$U extends MutationOptionsFor<"post", "/v1/public/appointments/{appointment_id}/cancel"> {
728
+ interface Options$V extends MutationOptionsFor<"post", "/v1/public/appointments/{appointment_id}/cancel"> {
729
729
  client?: QueryClient;
730
730
  }
731
- declare const useCancelPublicAppointment: (options?: Options$U) => _tanstack_react_query.UseMutationResult<{
731
+ declare const useCancelPublicAppointment: (options?: Options$V) => _tanstack_react_query.UseMutationResult<{
732
732
  data: {
733
733
  cancellation: {
734
734
  allowed: boolean;
@@ -871,10 +871,10 @@ declare const useCancelPublicAppointment: (options?: Options$U) => _tanstack_rea
871
871
  };
872
872
  }>>;
873
873
 
874
- interface Options$T extends MutationOptionsFor<"post", "/v1/appointments/{appointment_id}/confirm"> {
874
+ interface Options$U extends MutationOptionsFor<"post", "/v1/appointments/{appointment_id}/confirm"> {
875
875
  client?: QueryClient;
876
876
  }
877
- declare const useConfirmAppointment: (options?: Options$T) => _tanstack_react_query.UseMutationResult<{
877
+ declare const useConfirmAppointment: (options?: Options$U) => _tanstack_react_query.UseMutationResult<{
878
878
  data: {
879
879
  appointment_type: "in_person" | "virtual";
880
880
  cancellation_events: {
@@ -1543,10 +1543,10 @@ declare const useConfirmAppointment: (options?: Options$T) => _tanstack_react_qu
1543
1543
  };
1544
1544
  }>>;
1545
1545
 
1546
- interface Options$S extends MutationOptionsFor<"post", "/v1/accounts"> {
1546
+ interface Options$T extends MutationOptionsFor<"post", "/v1/accounts"> {
1547
1547
  client?: QueryClient;
1548
1548
  }
1549
- declare const useCreateAccount: (options?: Options$S) => _tanstack_react_query.UseMutationResult<{
1549
+ declare const useCreateAccount: (options?: Options$T) => _tanstack_react_query.UseMutationResult<{
1550
1550
  data?: {
1551
1551
  created_at: string;
1552
1552
  id: string;
@@ -1694,10 +1694,10 @@ declare const useCreateAccount: (options?: Options$S) => _tanstack_react_query.U
1694
1694
  };
1695
1695
  }> | undefined>;
1696
1696
 
1697
- interface Options$R extends MutationOptionsFor<"post", "/v1/users"> {
1697
+ interface Options$S extends MutationOptionsFor<"post", "/v1/users"> {
1698
1698
  client?: QueryClient;
1699
1699
  }
1700
- declare const useCreateAccountUser: (options?: Options$R) => _tanstack_react_query.UseMutationResult<{
1700
+ declare const useCreateAccountUser: (options?: Options$S) => _tanstack_react_query.UseMutationResult<{
1701
1701
  object: "account_user";
1702
1702
  passive: boolean;
1703
1703
  roles: {
@@ -1856,10 +1856,10 @@ declare const useCreateAccountUser: (options?: Options$R) => _tanstack_react_que
1856
1856
  };
1857
1857
  }> | undefined>;
1858
1858
 
1859
- interface Options$Q extends MutationOptionsFor<"post", "/v1/appointments"> {
1859
+ interface Options$R extends MutationOptionsFor<"post", "/v1/appointments"> {
1860
1860
  client?: QueryClient;
1861
1861
  }
1862
- declare const useCreateAppointment: (options?: Options$Q) => _tanstack_react_query.UseMutationResult<{
1862
+ declare const useCreateAppointment: (options?: Options$R) => _tanstack_react_query.UseMutationResult<{
1863
1863
  data: {
1864
1864
  appointment_type: "in_person" | "virtual";
1865
1865
  cancellation_events: {
@@ -2541,10 +2541,10 @@ declare const useCreateAppointment: (options?: Options$Q) => _tanstack_react_que
2541
2541
  };
2542
2542
  }> | undefined>;
2543
2543
 
2544
- interface Options$P extends MutationOptionsFor<"post", "/v1/blocks"> {
2544
+ interface Options$Q extends MutationOptionsFor<"post", "/v1/blocks"> {
2545
2545
  client?: QueryClient;
2546
2546
  }
2547
- declare const useCreateBlock: (options?: Options$P) => _tanstack_react_query.UseMutationResult<{
2547
+ declare const useCreateBlock: (options?: Options$Q) => _tanstack_react_query.UseMutationResult<{
2548
2548
  data: {
2549
2549
  all_day: boolean;
2550
2550
  attachment_type: "location" | "service" | "provider" | "service_provider";
@@ -2733,10 +2733,10 @@ declare const useCreateBlock: (options?: Options$P) => _tanstack_react_query.Use
2733
2733
  };
2734
2734
  }> | undefined>;
2735
2735
 
2736
- interface Options$O extends MutationOptionsFor<"post", "/v1/cancellation_reasons"> {
2736
+ interface Options$P extends MutationOptionsFor<"post", "/v1/cancellation_reasons"> {
2737
2737
  client?: QueryClient;
2738
2738
  }
2739
- declare const useCreateCancellationReason: (options?: Options$O) => _tanstack_react_query.UseMutationResult<{
2739
+ declare const useCreateCancellationReason: (options?: Options$P) => _tanstack_react_query.UseMutationResult<{
2740
2740
  data: Record<string, never>;
2741
2741
  }, openapi_typescript_helpers.ErrorResponse<{
2742
2742
  201: {
@@ -2839,10 +2839,10 @@ declare const useCreateCancellationReason: (options?: Options$O) => _tanstack_re
2839
2839
  };
2840
2840
  }> | undefined>;
2841
2841
 
2842
- interface Options$N extends MutationOptionsFor<"post", "/v1/clients"> {
2842
+ interface Options$O extends MutationOptionsFor<"post", "/v1/clients"> {
2843
2843
  client?: QueryClient;
2844
2844
  }
2845
- declare const useCreateClient: (options?: Options$N) => _tanstack_react_query.UseMutationResult<{
2845
+ declare const useCreateClient: (options?: Options$O) => _tanstack_react_query.UseMutationResult<{
2846
2846
  data: {
2847
2847
  created_at: string;
2848
2848
  email?: string | null;
@@ -2987,10 +2987,10 @@ declare const useCreateClient: (options?: Options$N) => _tanstack_react_query.Us
2987
2987
  };
2988
2988
  }> | undefined>;
2989
2989
 
2990
- interface Options$M extends MutationOptionsFor<"post", "/v1/dashboard_sessions"> {
2990
+ interface Options$N extends MutationOptionsFor<"post", "/v1/dashboard_sessions"> {
2991
2991
  client?: QueryClient;
2992
2992
  }
2993
- declare const useCreateDashboardSession: (options?: Options$M) => _tanstack_react_query.UseMutationResult<{
2993
+ declare const useCreateDashboardSession: (options?: Options$N) => _tanstack_react_query.UseMutationResult<{
2994
2994
  data: {
2995
2995
  created_at: string;
2996
2996
  id: string;
@@ -3115,10 +3115,10 @@ declare const useCreateDashboardSession: (options?: Options$M) => _tanstack_reac
3115
3115
  };
3116
3116
  }> | undefined>;
3117
3117
 
3118
- interface Options$L extends MutationOptionsFor<"post", "/v1/providers"> {
3118
+ interface Options$M extends MutationOptionsFor<"post", "/v1/providers"> {
3119
3119
  client?: QueryClient;
3120
3120
  }
3121
- declare const useCreateProvider: (options?: Options$L) => _tanstack_react_query.UseMutationResult<{
3121
+ declare const useCreateProvider: (options?: Options$M) => _tanstack_react_query.UseMutationResult<{
3122
3122
  data: {
3123
3123
  created_at: string;
3124
3124
  display_name: string;
@@ -3255,10 +3255,10 @@ declare const useCreateProvider: (options?: Options$L) => _tanstack_react_query.
3255
3255
  };
3256
3256
  }> | undefined>;
3257
3257
 
3258
- interface Options$K extends MutationOptionsFor<"post", "/v1/providers/{provider_id}/schedules"> {
3258
+ interface Options$L extends MutationOptionsFor<"post", "/v1/providers/{provider_id}/schedules"> {
3259
3259
  client?: QueryClient;
3260
3260
  }
3261
- declare const useCreateProviderSchedule: (options?: Options$K) => _tanstack_react_query.UseMutationResult<{
3261
+ declare const useCreateProviderSchedule: (options?: Options$L) => _tanstack_react_query.UseMutationResult<{
3262
3262
  data: {
3263
3263
  created_at: string;
3264
3264
  effective_from: string;
@@ -3415,10 +3415,10 @@ declare const useCreateProviderSchedule: (options?: Options$K) => _tanstack_reac
3415
3415
  };
3416
3416
  }> | undefined>;
3417
3417
 
3418
- interface Options$J extends MutationOptionsFor<"post", "/v1/public/appointments"> {
3418
+ interface Options$K extends MutationOptionsFor<"post", "/v1/public/appointments"> {
3419
3419
  client?: QueryClient;
3420
3420
  }
3421
- declare const useCreatePublicAppointment: (options?: Options$J) => _tanstack_react_query.UseMutationResult<{
3421
+ declare const useCreatePublicAppointment: (options?: Options$K) => _tanstack_react_query.UseMutationResult<{
3422
3422
  data: {
3423
3423
  cancellation: {
3424
3424
  allowed: boolean;
@@ -3540,10 +3540,10 @@ declare const useCreatePublicAppointment: (options?: Options$J) => _tanstack_rea
3540
3540
  };
3541
3541
  }> | undefined>;
3542
3542
 
3543
- interface Options$I extends MutationOptionsFor<"post", "/v1/services"> {
3543
+ interface Options$J extends MutationOptionsFor<"post", "/v1/services"> {
3544
3544
  client?: QueryClient;
3545
3545
  }
3546
- declare const useCreateService: (options?: Options$I) => _tanstack_react_query.UseMutationResult<{
3546
+ declare const useCreateService: (options?: Options$J) => _tanstack_react_query.UseMutationResult<{
3547
3547
  data: {
3548
3548
  appointment_type: "in_person" | "virtual";
3549
3549
  booking_policy: {
@@ -3824,10 +3824,10 @@ declare const useCreateService: (options?: Options$I) => _tanstack_react_query.U
3824
3824
  };
3825
3825
  }> | undefined>;
3826
3826
 
3827
- interface Options$H extends MutationOptionsFor<"post", "/v1/services/{service_id}/providers"> {
3827
+ interface Options$I extends MutationOptionsFor<"post", "/v1/services/{service_id}/providers"> {
3828
3828
  client?: QueryClient;
3829
3829
  }
3830
- declare const useCreateServiceProvider: (options?: Options$H) => _tanstack_react_query.UseMutationResult<{
3830
+ declare const useCreateServiceProvider: (options?: Options$I) => _tanstack_react_query.UseMutationResult<{
3831
3831
  data: {
3832
3832
  created_at: string;
3833
3833
  id: string;
@@ -4006,10 +4006,10 @@ declare const useCreateServiceProvider: (options?: Options$H) => _tanstack_react
4006
4006
  };
4007
4007
  }>>;
4008
4008
 
4009
- interface Options$G extends MutationOptionsFor<"delete", "/v1/providers/{provider_id}"> {
4009
+ interface Options$H extends MutationOptionsFor<"delete", "/v1/providers/{provider_id}"> {
4010
4010
  client?: QueryClient;
4011
4011
  }
4012
- declare const useDeactivateProvider: (options?: Options$G) => _tanstack_react_query.UseMutationResult<string, openapi_typescript_helpers.ErrorResponse<{
4012
+ declare const useDeactivateProvider: (options?: Options$H) => _tanstack_react_query.UseMutationResult<string, openapi_typescript_helpers.ErrorResponse<{
4013
4013
  204: {
4014
4014
  headers: {
4015
4015
  [name: string]: unknown;
@@ -4096,10 +4096,10 @@ declare const useDeactivateProvider: (options?: Options$G) => _tanstack_react_qu
4096
4096
  };
4097
4097
  }>>;
4098
4098
 
4099
- interface Options$F extends MutationOptionsFor<"delete", "/v1/blocks/{block_id}"> {
4099
+ interface Options$G extends MutationOptionsFor<"delete", "/v1/blocks/{block_id}"> {
4100
4100
  client?: QueryClient;
4101
4101
  }
4102
- declare const useDeleteBlock: (options?: Options$F) => _tanstack_react_query.UseMutationResult<string, openapi_typescript_helpers.ErrorResponse<{
4102
+ declare const useDeleteBlock: (options?: Options$G) => _tanstack_react_query.UseMutationResult<string, openapi_typescript_helpers.ErrorResponse<{
4103
4103
  204: {
4104
4104
  headers: {
4105
4105
  [name: string]: unknown;
@@ -4186,10 +4186,10 @@ declare const useDeleteBlock: (options?: Options$F) => _tanstack_react_query.Use
4186
4186
  };
4187
4187
  }>>;
4188
4188
 
4189
- interface Options$E extends MutationOptionsFor<"delete", "/v1/cancellation_reasons/{cancellation_reason_id}"> {
4189
+ interface Options$F extends MutationOptionsFor<"delete", "/v1/cancellation_reasons/{cancellation_reason_id}"> {
4190
4190
  client?: QueryClient;
4191
4191
  }
4192
- declare const useDeleteCancellationReason: (options?: Options$E) => _tanstack_react_query.UseMutationResult<string, openapi_typescript_helpers.ErrorResponse<{
4192
+ declare const useDeleteCancellationReason: (options?: Options$F) => _tanstack_react_query.UseMutationResult<string, openapi_typescript_helpers.ErrorResponse<{
4193
4193
  204: {
4194
4194
  headers: {
4195
4195
  [name: string]: unknown;
@@ -4276,10 +4276,10 @@ declare const useDeleteCancellationReason: (options?: Options$E) => _tanstack_re
4276
4276
  };
4277
4277
  }>>;
4278
4278
 
4279
- interface Options$D extends MutationOptionsFor<"delete", "/v1/clients/{client_id}"> {
4279
+ interface Options$E extends MutationOptionsFor<"delete", "/v1/clients/{client_id}"> {
4280
4280
  client?: QueryClient;
4281
4281
  }
4282
- declare const useDeleteClient: (options?: Options$D) => _tanstack_react_query.UseMutationResult<string, openapi_typescript_helpers.ErrorResponse<{
4282
+ declare const useDeleteClient: (options?: Options$E) => _tanstack_react_query.UseMutationResult<string, openapi_typescript_helpers.ErrorResponse<{
4283
4283
  204: {
4284
4284
  headers: {
4285
4285
  [name: string]: unknown;
@@ -4366,10 +4366,10 @@ declare const useDeleteClient: (options?: Options$D) => _tanstack_react_query.Us
4366
4366
  };
4367
4367
  }>>;
4368
4368
 
4369
- interface Options$C extends MutationOptionsFor<"delete", "/v1/provider_schedules/{provider_schedule_id}"> {
4369
+ interface Options$D extends MutationOptionsFor<"delete", "/v1/provider_schedules/{provider_schedule_id}"> {
4370
4370
  client?: QueryClient;
4371
4371
  }
4372
- declare const useDeleteProviderSchedule: (options?: Options$C) => _tanstack_react_query.UseMutationResult<string, openapi_typescript_helpers.ErrorResponse<{
4372
+ declare const useDeleteProviderSchedule: (options?: Options$D) => _tanstack_react_query.UseMutationResult<string, openapi_typescript_helpers.ErrorResponse<{
4373
4373
  204: {
4374
4374
  headers: {
4375
4375
  [name: string]: unknown;
@@ -4456,10 +4456,10 @@ declare const useDeleteProviderSchedule: (options?: Options$C) => _tanstack_reac
4456
4456
  };
4457
4457
  }>>;
4458
4458
 
4459
- interface Options$B extends MutationOptionsFor<"delete", "/v1/services/{service_id}"> {
4459
+ interface Options$C extends MutationOptionsFor<"delete", "/v1/services/{service_id}"> {
4460
4460
  client?: QueryClient;
4461
4461
  }
4462
- declare const useDeleteService: (options?: Options$B) => _tanstack_react_query.UseMutationResult<string, openapi_typescript_helpers.ErrorResponse<{
4462
+ declare const useDeleteService: (options?: Options$C) => _tanstack_react_query.UseMutationResult<string, openapi_typescript_helpers.ErrorResponse<{
4463
4463
  204: {
4464
4464
  headers: {
4465
4465
  [name: string]: unknown;
@@ -4546,10 +4546,10 @@ declare const useDeleteService: (options?: Options$B) => _tanstack_react_query.U
4546
4546
  };
4547
4547
  }>>;
4548
4548
 
4549
- interface Options$A extends MutationOptionsFor<"delete", "/v1/service_providers/{service_provider_id}"> {
4549
+ interface Options$B extends MutationOptionsFor<"delete", "/v1/service_providers/{service_provider_id}"> {
4550
4550
  client?: QueryClient;
4551
4551
  }
4552
- declare const useDeleteServiceProvider: (options?: Options$A) => _tanstack_react_query.UseMutationResult<string, openapi_typescript_helpers.ErrorResponse<{
4552
+ declare const useDeleteServiceProvider: (options?: Options$B) => _tanstack_react_query.UseMutationResult<string, openapi_typescript_helpers.ErrorResponse<{
4553
4553
  204: {
4554
4554
  headers: {
4555
4555
  [name: string]: unknown;
@@ -4636,10 +4636,10 @@ declare const useDeleteServiceProvider: (options?: Options$A) => _tanstack_react
4636
4636
  };
4637
4637
  }>>;
4638
4638
 
4639
- interface Options$z extends MutationOptionsFor<"post", "/v1/appointments/{appointment_id}/reschedule"> {
4639
+ interface Options$A extends MutationOptionsFor<"post", "/v1/appointments/{appointment_id}/reschedule"> {
4640
4640
  client?: QueryClient;
4641
4641
  }
4642
- declare const useRescheduleAppointment: (options?: Options$z) => _tanstack_react_query.UseMutationResult<{
4642
+ declare const useRescheduleAppointment: (options?: Options$A) => _tanstack_react_query.UseMutationResult<{
4643
4643
  data: {
4644
4644
  appointment_type: "in_person" | "virtual";
4645
4645
  cancellation_events: {
@@ -5312,10 +5312,10 @@ declare const useRescheduleAppointment: (options?: Options$z) => _tanstack_react
5312
5312
  };
5313
5313
  }>>;
5314
5314
 
5315
- interface Options$y extends MutationOptionsFor<"post", "/v1/public/appointments/{appointment_id}/reschedule"> {
5315
+ interface Options$z extends MutationOptionsFor<"post", "/v1/public/appointments/{appointment_id}/reschedule"> {
5316
5316
  client?: QueryClient;
5317
5317
  }
5318
- declare const useReschedulePublicAppointment: (options?: Options$y) => _tanstack_react_query.UseMutationResult<{
5318
+ declare const useReschedulePublicAppointment: (options?: Options$z) => _tanstack_react_query.UseMutationResult<{
5319
5319
  data: {
5320
5320
  cancellation: {
5321
5321
  allowed: boolean;
@@ -5460,10 +5460,10 @@ declare const useReschedulePublicAppointment: (options?: Options$y) => _tanstack
5460
5460
  };
5461
5461
  }>>;
5462
5462
 
5463
- interface Options$x extends MutationOptionsFor<"patch", "/v1/accounts/{account_id}"> {
5463
+ interface Options$y extends MutationOptionsFor<"patch", "/v1/accounts/{account_id}"> {
5464
5464
  client?: QueryClient;
5465
5465
  }
5466
- declare const useUpdateAccount: (options?: Options$x) => _tanstack_react_query.UseMutationResult<{
5466
+ declare const useUpdateAccount: (options?: Options$y) => _tanstack_react_query.UseMutationResult<{
5467
5467
  data?: {
5468
5468
  created_at: string;
5469
5469
  id: string;
@@ -5610,6 +5610,190 @@ declare const useUpdateAccount: (options?: Options$x) => _tanstack_react_query.U
5610
5610
  };
5611
5611
  }>>;
5612
5612
 
5613
+ interface Options$x extends MutationOptionsFor<"patch", "/v1/users/{user_id}"> {
5614
+ client?: QueryClient;
5615
+ }
5616
+ declare const useUpdateAccountUser: (options?: Options$x) => _tanstack_react_query.UseMutationResult<{
5617
+ object: "account_user";
5618
+ passive: boolean;
5619
+ roles: {
5620
+ id: string;
5621
+ name: string;
5622
+ object: "role";
5623
+ type: "admin" | "staff" | "developer" | "superuser" | "custom";
5624
+ }[];
5625
+ user: {
5626
+ created_at: string;
5627
+ email: string;
5628
+ first_name: string;
5629
+ id: string;
5630
+ last_name: string;
5631
+ object: "user";
5632
+ updated_at: string;
5633
+ };
5634
+ }, openapi_typescript_helpers.ErrorResponse<{
5635
+ 200: {
5636
+ headers: {
5637
+ [name: string]: unknown;
5638
+ };
5639
+ content: {
5640
+ "application/json": {
5641
+ object: "account_user";
5642
+ passive: boolean;
5643
+ roles: {
5644
+ id: string;
5645
+ name: string;
5646
+ object: "role";
5647
+ type: "admin" | "staff" | "developer" | "superuser" | "custom";
5648
+ }[];
5649
+ user: {
5650
+ created_at: string;
5651
+ email: string;
5652
+ first_name: string;
5653
+ id: string;
5654
+ last_name: string;
5655
+ object: "user";
5656
+ updated_at: string;
5657
+ };
5658
+ };
5659
+ };
5660
+ };
5661
+ 401: {
5662
+ headers: {
5663
+ [name: string]: unknown;
5664
+ };
5665
+ content: {
5666
+ "application/json": {
5667
+ errors: {
5668
+ detail: string;
5669
+ status?: string;
5670
+ title?: string;
5671
+ }[];
5672
+ };
5673
+ };
5674
+ };
5675
+ 404: {
5676
+ headers: {
5677
+ [name: string]: unknown;
5678
+ };
5679
+ content: {
5680
+ "application/json": {
5681
+ errors: {
5682
+ detail: string;
5683
+ status?: string;
5684
+ title?: string;
5685
+ }[];
5686
+ };
5687
+ };
5688
+ };
5689
+ 422: {
5690
+ headers: {
5691
+ [name: string]: unknown;
5692
+ };
5693
+ content: {
5694
+ "application/json": {
5695
+ errors: {
5696
+ detail: string;
5697
+ source: {
5698
+ pointer: string;
5699
+ };
5700
+ title: string;
5701
+ }[];
5702
+ };
5703
+ };
5704
+ };
5705
+ }, `${string}/${string}`>, openapi_fetch.FetchOptions<{
5706
+ parameters: {
5707
+ query?: never;
5708
+ header?: {
5709
+ "X-SavvyCal-Account"?: string;
5710
+ };
5711
+ path: {
5712
+ user_id: string;
5713
+ };
5714
+ cookie?: never;
5715
+ };
5716
+ requestBody?: {
5717
+ content: {
5718
+ "application/json": {
5719
+ passive?: boolean;
5720
+ };
5721
+ };
5722
+ };
5723
+ responses: {
5724
+ 200: {
5725
+ headers: {
5726
+ [name: string]: unknown;
5727
+ };
5728
+ content: {
5729
+ "application/json": {
5730
+ object: "account_user";
5731
+ passive: boolean;
5732
+ roles: {
5733
+ id: string;
5734
+ name: string;
5735
+ object: "role";
5736
+ type: "admin" | "staff" | "developer" | "superuser" | "custom";
5737
+ }[];
5738
+ user: {
5739
+ created_at: string;
5740
+ email: string;
5741
+ first_name: string;
5742
+ id: string;
5743
+ last_name: string;
5744
+ object: "user";
5745
+ updated_at: string;
5746
+ };
5747
+ };
5748
+ };
5749
+ };
5750
+ 401: {
5751
+ headers: {
5752
+ [name: string]: unknown;
5753
+ };
5754
+ content: {
5755
+ "application/json": {
5756
+ errors: {
5757
+ detail: string;
5758
+ status?: string;
5759
+ title?: string;
5760
+ }[];
5761
+ };
5762
+ };
5763
+ };
5764
+ 404: {
5765
+ headers: {
5766
+ [name: string]: unknown;
5767
+ };
5768
+ content: {
5769
+ "application/json": {
5770
+ errors: {
5771
+ detail: string;
5772
+ status?: string;
5773
+ title?: string;
5774
+ }[];
5775
+ };
5776
+ };
5777
+ };
5778
+ 422: {
5779
+ headers: {
5780
+ [name: string]: unknown;
5781
+ };
5782
+ content: {
5783
+ "application/json": {
5784
+ errors: {
5785
+ detail: string;
5786
+ source: {
5787
+ pointer: string;
5788
+ };
5789
+ title: string;
5790
+ }[];
5791
+ };
5792
+ };
5793
+ };
5794
+ };
5795
+ }>>;
5796
+
5613
5797
  interface Options$w extends MutationOptionsFor<"patch", "/v1/blocks/{block_id}"> {
5614
5798
  client?: QueryClient;
5615
5799
  }
@@ -9605,4 +9789,4 @@ declare const useServices: (queryParams?: ServicesParams["query"], options?: Opt
9605
9789
  };
9606
9790
  }, `${string}/${string}`>>;
9607
9791
 
9608
- export { type MutationOptionsFor, type QueryClient, type QueryOptionsFor, SavvyCalProvider, type SavvyCalProviderProps, createQueryClient, useAccountById, useAccountUsers, useAccounts, useAppointment, useAppointments, useBlock, useBlocks, useCancelAppointment, useCancelPublicAppointment, useCancellationReason, useCancellationReasons, useClient, useClients, useConfirmAppointment, useCreateAccount, useCreateAccountUser, useCreateAppointment, useCreateBlock, useCreateCancellationReason, useCreateClient, useCreateDashboardSession, useCreateProvider, useCreateProviderSchedule, useCreatePublicAppointment, useCreateService, useCreateServiceProvider, useCurrentAccount, useCurrentAccountUser, useCurrentPlatform, useDeactivateProvider, useDeleteBlock, useDeleteCancellationReason, useDeleteClient, useDeleteProviderSchedule, useDeleteService, useDeleteServiceProvider, useEarliestPublicServiceSlot, useProvider, useProviderSchedule, useProviderSchedules, useProviders, usePublicAppointment, usePublicCancellationReasons, usePublicServiceSlots, useRescheduleAppointment, useReschedulePublicAppointment, useRoles, useSavvyCalFetchClient, useSavvyCalQueryClient, useService, useServiceProviders, useServiceSlots, useServices, useUpdateAccount, useUpdateBlock, useUpdateCancellationReason, useUpdateClient, useUpdateProvider, useUpdateProviderSchedule, useUpdateService };
9792
+ export { type MutationOptionsFor, type QueryClient, type QueryOptionsFor, SavvyCalProvider, type SavvyCalProviderProps, createQueryClient, useAccountById, useAccountUsers, useAccounts, useAppointment, useAppointments, useBlock, useBlocks, useCancelAppointment, useCancelPublicAppointment, useCancellationReason, useCancellationReasons, useClient, useClients, useConfirmAppointment, useCreateAccount, useCreateAccountUser, useCreateAppointment, useCreateBlock, useCreateCancellationReason, useCreateClient, useCreateDashboardSession, useCreateProvider, useCreateProviderSchedule, useCreatePublicAppointment, useCreateService, useCreateServiceProvider, useCurrentAccount, useCurrentAccountUser, useCurrentPlatform, useDeactivateProvider, useDeleteBlock, useDeleteCancellationReason, useDeleteClient, useDeleteProviderSchedule, useDeleteService, useDeleteServiceProvider, useEarliestPublicServiceSlot, useProvider, useProviderSchedule, useProviderSchedules, useProviders, usePublicAppointment, usePublicCancellationReasons, usePublicServiceSlots, useRescheduleAppointment, useReschedulePublicAppointment, useRoles, useSavvyCalFetchClient, useSavvyCalQueryClient, useService, useServiceProviders, useServiceSlots, useServices, useUpdateAccount, useUpdateAccountUser, useUpdateBlock, useUpdateCancellationReason, useUpdateClient, useUpdateProvider, useUpdateProviderSchedule, useUpdateService };
package/dist/index.d.ts CHANGED
@@ -51,10 +51,10 @@ type GetResponseData<Path extends keyof paths, Method extends HttpMethod, Media
51
51
  type GetResponseError<Path extends keyof paths, Method extends HttpMethod, Media extends MediaType> = Path extends keyof paths ? Method extends keyof paths[Path] ? paths[Path][Method] extends infer Operation ? Operation extends Record<string, any> ? Required<FetchResponse<Operation, MaybeOptionalInit<paths[Path], Method>, Media>>["error"] : never : never : never : never;
52
52
  type QueryKey<Path extends keyof paths, Method extends HttpMethod, Init = MaybeOptionalInit<paths[Path], Method>> = Init extends undefined ? readonly [Method, Path] : readonly [Method, Path, Init];
53
53
 
54
- interface Options$V extends MutationOptionsFor<"post", "/v1/appointments/{appointment_id}/cancel"> {
54
+ interface Options$W extends MutationOptionsFor<"post", "/v1/appointments/{appointment_id}/cancel"> {
55
55
  client?: QueryClient;
56
56
  }
57
- declare const useCancelAppointment: (options?: Options$V) => _tanstack_react_query.UseMutationResult<{
57
+ declare const useCancelAppointment: (options?: Options$W) => _tanstack_react_query.UseMutationResult<{
58
58
  data: {
59
59
  appointment_type: "in_person" | "virtual";
60
60
  cancellation_events: {
@@ -725,10 +725,10 @@ declare const useCancelAppointment: (options?: Options$V) => _tanstack_react_que
725
725
  };
726
726
  }>>;
727
727
 
728
- interface Options$U extends MutationOptionsFor<"post", "/v1/public/appointments/{appointment_id}/cancel"> {
728
+ interface Options$V extends MutationOptionsFor<"post", "/v1/public/appointments/{appointment_id}/cancel"> {
729
729
  client?: QueryClient;
730
730
  }
731
- declare const useCancelPublicAppointment: (options?: Options$U) => _tanstack_react_query.UseMutationResult<{
731
+ declare const useCancelPublicAppointment: (options?: Options$V) => _tanstack_react_query.UseMutationResult<{
732
732
  data: {
733
733
  cancellation: {
734
734
  allowed: boolean;
@@ -871,10 +871,10 @@ declare const useCancelPublicAppointment: (options?: Options$U) => _tanstack_rea
871
871
  };
872
872
  }>>;
873
873
 
874
- interface Options$T extends MutationOptionsFor<"post", "/v1/appointments/{appointment_id}/confirm"> {
874
+ interface Options$U extends MutationOptionsFor<"post", "/v1/appointments/{appointment_id}/confirm"> {
875
875
  client?: QueryClient;
876
876
  }
877
- declare const useConfirmAppointment: (options?: Options$T) => _tanstack_react_query.UseMutationResult<{
877
+ declare const useConfirmAppointment: (options?: Options$U) => _tanstack_react_query.UseMutationResult<{
878
878
  data: {
879
879
  appointment_type: "in_person" | "virtual";
880
880
  cancellation_events: {
@@ -1543,10 +1543,10 @@ declare const useConfirmAppointment: (options?: Options$T) => _tanstack_react_qu
1543
1543
  };
1544
1544
  }>>;
1545
1545
 
1546
- interface Options$S extends MutationOptionsFor<"post", "/v1/accounts"> {
1546
+ interface Options$T extends MutationOptionsFor<"post", "/v1/accounts"> {
1547
1547
  client?: QueryClient;
1548
1548
  }
1549
- declare const useCreateAccount: (options?: Options$S) => _tanstack_react_query.UseMutationResult<{
1549
+ declare const useCreateAccount: (options?: Options$T) => _tanstack_react_query.UseMutationResult<{
1550
1550
  data?: {
1551
1551
  created_at: string;
1552
1552
  id: string;
@@ -1694,10 +1694,10 @@ declare const useCreateAccount: (options?: Options$S) => _tanstack_react_query.U
1694
1694
  };
1695
1695
  }> | undefined>;
1696
1696
 
1697
- interface Options$R extends MutationOptionsFor<"post", "/v1/users"> {
1697
+ interface Options$S extends MutationOptionsFor<"post", "/v1/users"> {
1698
1698
  client?: QueryClient;
1699
1699
  }
1700
- declare const useCreateAccountUser: (options?: Options$R) => _tanstack_react_query.UseMutationResult<{
1700
+ declare const useCreateAccountUser: (options?: Options$S) => _tanstack_react_query.UseMutationResult<{
1701
1701
  object: "account_user";
1702
1702
  passive: boolean;
1703
1703
  roles: {
@@ -1856,10 +1856,10 @@ declare const useCreateAccountUser: (options?: Options$R) => _tanstack_react_que
1856
1856
  };
1857
1857
  }> | undefined>;
1858
1858
 
1859
- interface Options$Q extends MutationOptionsFor<"post", "/v1/appointments"> {
1859
+ interface Options$R extends MutationOptionsFor<"post", "/v1/appointments"> {
1860
1860
  client?: QueryClient;
1861
1861
  }
1862
- declare const useCreateAppointment: (options?: Options$Q) => _tanstack_react_query.UseMutationResult<{
1862
+ declare const useCreateAppointment: (options?: Options$R) => _tanstack_react_query.UseMutationResult<{
1863
1863
  data: {
1864
1864
  appointment_type: "in_person" | "virtual";
1865
1865
  cancellation_events: {
@@ -2541,10 +2541,10 @@ declare const useCreateAppointment: (options?: Options$Q) => _tanstack_react_que
2541
2541
  };
2542
2542
  }> | undefined>;
2543
2543
 
2544
- interface Options$P extends MutationOptionsFor<"post", "/v1/blocks"> {
2544
+ interface Options$Q extends MutationOptionsFor<"post", "/v1/blocks"> {
2545
2545
  client?: QueryClient;
2546
2546
  }
2547
- declare const useCreateBlock: (options?: Options$P) => _tanstack_react_query.UseMutationResult<{
2547
+ declare const useCreateBlock: (options?: Options$Q) => _tanstack_react_query.UseMutationResult<{
2548
2548
  data: {
2549
2549
  all_day: boolean;
2550
2550
  attachment_type: "location" | "service" | "provider" | "service_provider";
@@ -2733,10 +2733,10 @@ declare const useCreateBlock: (options?: Options$P) => _tanstack_react_query.Use
2733
2733
  };
2734
2734
  }> | undefined>;
2735
2735
 
2736
- interface Options$O extends MutationOptionsFor<"post", "/v1/cancellation_reasons"> {
2736
+ interface Options$P extends MutationOptionsFor<"post", "/v1/cancellation_reasons"> {
2737
2737
  client?: QueryClient;
2738
2738
  }
2739
- declare const useCreateCancellationReason: (options?: Options$O) => _tanstack_react_query.UseMutationResult<{
2739
+ declare const useCreateCancellationReason: (options?: Options$P) => _tanstack_react_query.UseMutationResult<{
2740
2740
  data: Record<string, never>;
2741
2741
  }, openapi_typescript_helpers.ErrorResponse<{
2742
2742
  201: {
@@ -2839,10 +2839,10 @@ declare const useCreateCancellationReason: (options?: Options$O) => _tanstack_re
2839
2839
  };
2840
2840
  }> | undefined>;
2841
2841
 
2842
- interface Options$N extends MutationOptionsFor<"post", "/v1/clients"> {
2842
+ interface Options$O extends MutationOptionsFor<"post", "/v1/clients"> {
2843
2843
  client?: QueryClient;
2844
2844
  }
2845
- declare const useCreateClient: (options?: Options$N) => _tanstack_react_query.UseMutationResult<{
2845
+ declare const useCreateClient: (options?: Options$O) => _tanstack_react_query.UseMutationResult<{
2846
2846
  data: {
2847
2847
  created_at: string;
2848
2848
  email?: string | null;
@@ -2987,10 +2987,10 @@ declare const useCreateClient: (options?: Options$N) => _tanstack_react_query.Us
2987
2987
  };
2988
2988
  }> | undefined>;
2989
2989
 
2990
- interface Options$M extends MutationOptionsFor<"post", "/v1/dashboard_sessions"> {
2990
+ interface Options$N extends MutationOptionsFor<"post", "/v1/dashboard_sessions"> {
2991
2991
  client?: QueryClient;
2992
2992
  }
2993
- declare const useCreateDashboardSession: (options?: Options$M) => _tanstack_react_query.UseMutationResult<{
2993
+ declare const useCreateDashboardSession: (options?: Options$N) => _tanstack_react_query.UseMutationResult<{
2994
2994
  data: {
2995
2995
  created_at: string;
2996
2996
  id: string;
@@ -3115,10 +3115,10 @@ declare const useCreateDashboardSession: (options?: Options$M) => _tanstack_reac
3115
3115
  };
3116
3116
  }> | undefined>;
3117
3117
 
3118
- interface Options$L extends MutationOptionsFor<"post", "/v1/providers"> {
3118
+ interface Options$M extends MutationOptionsFor<"post", "/v1/providers"> {
3119
3119
  client?: QueryClient;
3120
3120
  }
3121
- declare const useCreateProvider: (options?: Options$L) => _tanstack_react_query.UseMutationResult<{
3121
+ declare const useCreateProvider: (options?: Options$M) => _tanstack_react_query.UseMutationResult<{
3122
3122
  data: {
3123
3123
  created_at: string;
3124
3124
  display_name: string;
@@ -3255,10 +3255,10 @@ declare const useCreateProvider: (options?: Options$L) => _tanstack_react_query.
3255
3255
  };
3256
3256
  }> | undefined>;
3257
3257
 
3258
- interface Options$K extends MutationOptionsFor<"post", "/v1/providers/{provider_id}/schedules"> {
3258
+ interface Options$L extends MutationOptionsFor<"post", "/v1/providers/{provider_id}/schedules"> {
3259
3259
  client?: QueryClient;
3260
3260
  }
3261
- declare const useCreateProviderSchedule: (options?: Options$K) => _tanstack_react_query.UseMutationResult<{
3261
+ declare const useCreateProviderSchedule: (options?: Options$L) => _tanstack_react_query.UseMutationResult<{
3262
3262
  data: {
3263
3263
  created_at: string;
3264
3264
  effective_from: string;
@@ -3415,10 +3415,10 @@ declare const useCreateProviderSchedule: (options?: Options$K) => _tanstack_reac
3415
3415
  };
3416
3416
  }> | undefined>;
3417
3417
 
3418
- interface Options$J extends MutationOptionsFor<"post", "/v1/public/appointments"> {
3418
+ interface Options$K extends MutationOptionsFor<"post", "/v1/public/appointments"> {
3419
3419
  client?: QueryClient;
3420
3420
  }
3421
- declare const useCreatePublicAppointment: (options?: Options$J) => _tanstack_react_query.UseMutationResult<{
3421
+ declare const useCreatePublicAppointment: (options?: Options$K) => _tanstack_react_query.UseMutationResult<{
3422
3422
  data: {
3423
3423
  cancellation: {
3424
3424
  allowed: boolean;
@@ -3540,10 +3540,10 @@ declare const useCreatePublicAppointment: (options?: Options$J) => _tanstack_rea
3540
3540
  };
3541
3541
  }> | undefined>;
3542
3542
 
3543
- interface Options$I extends MutationOptionsFor<"post", "/v1/services"> {
3543
+ interface Options$J extends MutationOptionsFor<"post", "/v1/services"> {
3544
3544
  client?: QueryClient;
3545
3545
  }
3546
- declare const useCreateService: (options?: Options$I) => _tanstack_react_query.UseMutationResult<{
3546
+ declare const useCreateService: (options?: Options$J) => _tanstack_react_query.UseMutationResult<{
3547
3547
  data: {
3548
3548
  appointment_type: "in_person" | "virtual";
3549
3549
  booking_policy: {
@@ -3824,10 +3824,10 @@ declare const useCreateService: (options?: Options$I) => _tanstack_react_query.U
3824
3824
  };
3825
3825
  }> | undefined>;
3826
3826
 
3827
- interface Options$H extends MutationOptionsFor<"post", "/v1/services/{service_id}/providers"> {
3827
+ interface Options$I extends MutationOptionsFor<"post", "/v1/services/{service_id}/providers"> {
3828
3828
  client?: QueryClient;
3829
3829
  }
3830
- declare const useCreateServiceProvider: (options?: Options$H) => _tanstack_react_query.UseMutationResult<{
3830
+ declare const useCreateServiceProvider: (options?: Options$I) => _tanstack_react_query.UseMutationResult<{
3831
3831
  data: {
3832
3832
  created_at: string;
3833
3833
  id: string;
@@ -4006,10 +4006,10 @@ declare const useCreateServiceProvider: (options?: Options$H) => _tanstack_react
4006
4006
  };
4007
4007
  }>>;
4008
4008
 
4009
- interface Options$G extends MutationOptionsFor<"delete", "/v1/providers/{provider_id}"> {
4009
+ interface Options$H extends MutationOptionsFor<"delete", "/v1/providers/{provider_id}"> {
4010
4010
  client?: QueryClient;
4011
4011
  }
4012
- declare const useDeactivateProvider: (options?: Options$G) => _tanstack_react_query.UseMutationResult<string, openapi_typescript_helpers.ErrorResponse<{
4012
+ declare const useDeactivateProvider: (options?: Options$H) => _tanstack_react_query.UseMutationResult<string, openapi_typescript_helpers.ErrorResponse<{
4013
4013
  204: {
4014
4014
  headers: {
4015
4015
  [name: string]: unknown;
@@ -4096,10 +4096,10 @@ declare const useDeactivateProvider: (options?: Options$G) => _tanstack_react_qu
4096
4096
  };
4097
4097
  }>>;
4098
4098
 
4099
- interface Options$F extends MutationOptionsFor<"delete", "/v1/blocks/{block_id}"> {
4099
+ interface Options$G extends MutationOptionsFor<"delete", "/v1/blocks/{block_id}"> {
4100
4100
  client?: QueryClient;
4101
4101
  }
4102
- declare const useDeleteBlock: (options?: Options$F) => _tanstack_react_query.UseMutationResult<string, openapi_typescript_helpers.ErrorResponse<{
4102
+ declare const useDeleteBlock: (options?: Options$G) => _tanstack_react_query.UseMutationResult<string, openapi_typescript_helpers.ErrorResponse<{
4103
4103
  204: {
4104
4104
  headers: {
4105
4105
  [name: string]: unknown;
@@ -4186,10 +4186,10 @@ declare const useDeleteBlock: (options?: Options$F) => _tanstack_react_query.Use
4186
4186
  };
4187
4187
  }>>;
4188
4188
 
4189
- interface Options$E extends MutationOptionsFor<"delete", "/v1/cancellation_reasons/{cancellation_reason_id}"> {
4189
+ interface Options$F extends MutationOptionsFor<"delete", "/v1/cancellation_reasons/{cancellation_reason_id}"> {
4190
4190
  client?: QueryClient;
4191
4191
  }
4192
- declare const useDeleteCancellationReason: (options?: Options$E) => _tanstack_react_query.UseMutationResult<string, openapi_typescript_helpers.ErrorResponse<{
4192
+ declare const useDeleteCancellationReason: (options?: Options$F) => _tanstack_react_query.UseMutationResult<string, openapi_typescript_helpers.ErrorResponse<{
4193
4193
  204: {
4194
4194
  headers: {
4195
4195
  [name: string]: unknown;
@@ -4276,10 +4276,10 @@ declare const useDeleteCancellationReason: (options?: Options$E) => _tanstack_re
4276
4276
  };
4277
4277
  }>>;
4278
4278
 
4279
- interface Options$D extends MutationOptionsFor<"delete", "/v1/clients/{client_id}"> {
4279
+ interface Options$E extends MutationOptionsFor<"delete", "/v1/clients/{client_id}"> {
4280
4280
  client?: QueryClient;
4281
4281
  }
4282
- declare const useDeleteClient: (options?: Options$D) => _tanstack_react_query.UseMutationResult<string, openapi_typescript_helpers.ErrorResponse<{
4282
+ declare const useDeleteClient: (options?: Options$E) => _tanstack_react_query.UseMutationResult<string, openapi_typescript_helpers.ErrorResponse<{
4283
4283
  204: {
4284
4284
  headers: {
4285
4285
  [name: string]: unknown;
@@ -4366,10 +4366,10 @@ declare const useDeleteClient: (options?: Options$D) => _tanstack_react_query.Us
4366
4366
  };
4367
4367
  }>>;
4368
4368
 
4369
- interface Options$C extends MutationOptionsFor<"delete", "/v1/provider_schedules/{provider_schedule_id}"> {
4369
+ interface Options$D extends MutationOptionsFor<"delete", "/v1/provider_schedules/{provider_schedule_id}"> {
4370
4370
  client?: QueryClient;
4371
4371
  }
4372
- declare const useDeleteProviderSchedule: (options?: Options$C) => _tanstack_react_query.UseMutationResult<string, openapi_typescript_helpers.ErrorResponse<{
4372
+ declare const useDeleteProviderSchedule: (options?: Options$D) => _tanstack_react_query.UseMutationResult<string, openapi_typescript_helpers.ErrorResponse<{
4373
4373
  204: {
4374
4374
  headers: {
4375
4375
  [name: string]: unknown;
@@ -4456,10 +4456,10 @@ declare const useDeleteProviderSchedule: (options?: Options$C) => _tanstack_reac
4456
4456
  };
4457
4457
  }>>;
4458
4458
 
4459
- interface Options$B extends MutationOptionsFor<"delete", "/v1/services/{service_id}"> {
4459
+ interface Options$C extends MutationOptionsFor<"delete", "/v1/services/{service_id}"> {
4460
4460
  client?: QueryClient;
4461
4461
  }
4462
- declare const useDeleteService: (options?: Options$B) => _tanstack_react_query.UseMutationResult<string, openapi_typescript_helpers.ErrorResponse<{
4462
+ declare const useDeleteService: (options?: Options$C) => _tanstack_react_query.UseMutationResult<string, openapi_typescript_helpers.ErrorResponse<{
4463
4463
  204: {
4464
4464
  headers: {
4465
4465
  [name: string]: unknown;
@@ -4546,10 +4546,10 @@ declare const useDeleteService: (options?: Options$B) => _tanstack_react_query.U
4546
4546
  };
4547
4547
  }>>;
4548
4548
 
4549
- interface Options$A extends MutationOptionsFor<"delete", "/v1/service_providers/{service_provider_id}"> {
4549
+ interface Options$B extends MutationOptionsFor<"delete", "/v1/service_providers/{service_provider_id}"> {
4550
4550
  client?: QueryClient;
4551
4551
  }
4552
- declare const useDeleteServiceProvider: (options?: Options$A) => _tanstack_react_query.UseMutationResult<string, openapi_typescript_helpers.ErrorResponse<{
4552
+ declare const useDeleteServiceProvider: (options?: Options$B) => _tanstack_react_query.UseMutationResult<string, openapi_typescript_helpers.ErrorResponse<{
4553
4553
  204: {
4554
4554
  headers: {
4555
4555
  [name: string]: unknown;
@@ -4636,10 +4636,10 @@ declare const useDeleteServiceProvider: (options?: Options$A) => _tanstack_react
4636
4636
  };
4637
4637
  }>>;
4638
4638
 
4639
- interface Options$z extends MutationOptionsFor<"post", "/v1/appointments/{appointment_id}/reschedule"> {
4639
+ interface Options$A extends MutationOptionsFor<"post", "/v1/appointments/{appointment_id}/reschedule"> {
4640
4640
  client?: QueryClient;
4641
4641
  }
4642
- declare const useRescheduleAppointment: (options?: Options$z) => _tanstack_react_query.UseMutationResult<{
4642
+ declare const useRescheduleAppointment: (options?: Options$A) => _tanstack_react_query.UseMutationResult<{
4643
4643
  data: {
4644
4644
  appointment_type: "in_person" | "virtual";
4645
4645
  cancellation_events: {
@@ -5312,10 +5312,10 @@ declare const useRescheduleAppointment: (options?: Options$z) => _tanstack_react
5312
5312
  };
5313
5313
  }>>;
5314
5314
 
5315
- interface Options$y extends MutationOptionsFor<"post", "/v1/public/appointments/{appointment_id}/reschedule"> {
5315
+ interface Options$z extends MutationOptionsFor<"post", "/v1/public/appointments/{appointment_id}/reschedule"> {
5316
5316
  client?: QueryClient;
5317
5317
  }
5318
- declare const useReschedulePublicAppointment: (options?: Options$y) => _tanstack_react_query.UseMutationResult<{
5318
+ declare const useReschedulePublicAppointment: (options?: Options$z) => _tanstack_react_query.UseMutationResult<{
5319
5319
  data: {
5320
5320
  cancellation: {
5321
5321
  allowed: boolean;
@@ -5460,10 +5460,10 @@ declare const useReschedulePublicAppointment: (options?: Options$y) => _tanstack
5460
5460
  };
5461
5461
  }>>;
5462
5462
 
5463
- interface Options$x extends MutationOptionsFor<"patch", "/v1/accounts/{account_id}"> {
5463
+ interface Options$y extends MutationOptionsFor<"patch", "/v1/accounts/{account_id}"> {
5464
5464
  client?: QueryClient;
5465
5465
  }
5466
- declare const useUpdateAccount: (options?: Options$x) => _tanstack_react_query.UseMutationResult<{
5466
+ declare const useUpdateAccount: (options?: Options$y) => _tanstack_react_query.UseMutationResult<{
5467
5467
  data?: {
5468
5468
  created_at: string;
5469
5469
  id: string;
@@ -5610,6 +5610,190 @@ declare const useUpdateAccount: (options?: Options$x) => _tanstack_react_query.U
5610
5610
  };
5611
5611
  }>>;
5612
5612
 
5613
+ interface Options$x extends MutationOptionsFor<"patch", "/v1/users/{user_id}"> {
5614
+ client?: QueryClient;
5615
+ }
5616
+ declare const useUpdateAccountUser: (options?: Options$x) => _tanstack_react_query.UseMutationResult<{
5617
+ object: "account_user";
5618
+ passive: boolean;
5619
+ roles: {
5620
+ id: string;
5621
+ name: string;
5622
+ object: "role";
5623
+ type: "admin" | "staff" | "developer" | "superuser" | "custom";
5624
+ }[];
5625
+ user: {
5626
+ created_at: string;
5627
+ email: string;
5628
+ first_name: string;
5629
+ id: string;
5630
+ last_name: string;
5631
+ object: "user";
5632
+ updated_at: string;
5633
+ };
5634
+ }, openapi_typescript_helpers.ErrorResponse<{
5635
+ 200: {
5636
+ headers: {
5637
+ [name: string]: unknown;
5638
+ };
5639
+ content: {
5640
+ "application/json": {
5641
+ object: "account_user";
5642
+ passive: boolean;
5643
+ roles: {
5644
+ id: string;
5645
+ name: string;
5646
+ object: "role";
5647
+ type: "admin" | "staff" | "developer" | "superuser" | "custom";
5648
+ }[];
5649
+ user: {
5650
+ created_at: string;
5651
+ email: string;
5652
+ first_name: string;
5653
+ id: string;
5654
+ last_name: string;
5655
+ object: "user";
5656
+ updated_at: string;
5657
+ };
5658
+ };
5659
+ };
5660
+ };
5661
+ 401: {
5662
+ headers: {
5663
+ [name: string]: unknown;
5664
+ };
5665
+ content: {
5666
+ "application/json": {
5667
+ errors: {
5668
+ detail: string;
5669
+ status?: string;
5670
+ title?: string;
5671
+ }[];
5672
+ };
5673
+ };
5674
+ };
5675
+ 404: {
5676
+ headers: {
5677
+ [name: string]: unknown;
5678
+ };
5679
+ content: {
5680
+ "application/json": {
5681
+ errors: {
5682
+ detail: string;
5683
+ status?: string;
5684
+ title?: string;
5685
+ }[];
5686
+ };
5687
+ };
5688
+ };
5689
+ 422: {
5690
+ headers: {
5691
+ [name: string]: unknown;
5692
+ };
5693
+ content: {
5694
+ "application/json": {
5695
+ errors: {
5696
+ detail: string;
5697
+ source: {
5698
+ pointer: string;
5699
+ };
5700
+ title: string;
5701
+ }[];
5702
+ };
5703
+ };
5704
+ };
5705
+ }, `${string}/${string}`>, openapi_fetch.FetchOptions<{
5706
+ parameters: {
5707
+ query?: never;
5708
+ header?: {
5709
+ "X-SavvyCal-Account"?: string;
5710
+ };
5711
+ path: {
5712
+ user_id: string;
5713
+ };
5714
+ cookie?: never;
5715
+ };
5716
+ requestBody?: {
5717
+ content: {
5718
+ "application/json": {
5719
+ passive?: boolean;
5720
+ };
5721
+ };
5722
+ };
5723
+ responses: {
5724
+ 200: {
5725
+ headers: {
5726
+ [name: string]: unknown;
5727
+ };
5728
+ content: {
5729
+ "application/json": {
5730
+ object: "account_user";
5731
+ passive: boolean;
5732
+ roles: {
5733
+ id: string;
5734
+ name: string;
5735
+ object: "role";
5736
+ type: "admin" | "staff" | "developer" | "superuser" | "custom";
5737
+ }[];
5738
+ user: {
5739
+ created_at: string;
5740
+ email: string;
5741
+ first_name: string;
5742
+ id: string;
5743
+ last_name: string;
5744
+ object: "user";
5745
+ updated_at: string;
5746
+ };
5747
+ };
5748
+ };
5749
+ };
5750
+ 401: {
5751
+ headers: {
5752
+ [name: string]: unknown;
5753
+ };
5754
+ content: {
5755
+ "application/json": {
5756
+ errors: {
5757
+ detail: string;
5758
+ status?: string;
5759
+ title?: string;
5760
+ }[];
5761
+ };
5762
+ };
5763
+ };
5764
+ 404: {
5765
+ headers: {
5766
+ [name: string]: unknown;
5767
+ };
5768
+ content: {
5769
+ "application/json": {
5770
+ errors: {
5771
+ detail: string;
5772
+ status?: string;
5773
+ title?: string;
5774
+ }[];
5775
+ };
5776
+ };
5777
+ };
5778
+ 422: {
5779
+ headers: {
5780
+ [name: string]: unknown;
5781
+ };
5782
+ content: {
5783
+ "application/json": {
5784
+ errors: {
5785
+ detail: string;
5786
+ source: {
5787
+ pointer: string;
5788
+ };
5789
+ title: string;
5790
+ }[];
5791
+ };
5792
+ };
5793
+ };
5794
+ };
5795
+ }>>;
5796
+
5613
5797
  interface Options$w extends MutationOptionsFor<"patch", "/v1/blocks/{block_id}"> {
5614
5798
  client?: QueryClient;
5615
5799
  }
@@ -9605,4 +9789,4 @@ declare const useServices: (queryParams?: ServicesParams["query"], options?: Opt
9605
9789
  };
9606
9790
  }, `${string}/${string}`>>;
9607
9791
 
9608
- export { type MutationOptionsFor, type QueryClient, type QueryOptionsFor, SavvyCalProvider, type SavvyCalProviderProps, createQueryClient, useAccountById, useAccountUsers, useAccounts, useAppointment, useAppointments, useBlock, useBlocks, useCancelAppointment, useCancelPublicAppointment, useCancellationReason, useCancellationReasons, useClient, useClients, useConfirmAppointment, useCreateAccount, useCreateAccountUser, useCreateAppointment, useCreateBlock, useCreateCancellationReason, useCreateClient, useCreateDashboardSession, useCreateProvider, useCreateProviderSchedule, useCreatePublicAppointment, useCreateService, useCreateServiceProvider, useCurrentAccount, useCurrentAccountUser, useCurrentPlatform, useDeactivateProvider, useDeleteBlock, useDeleteCancellationReason, useDeleteClient, useDeleteProviderSchedule, useDeleteService, useDeleteServiceProvider, useEarliestPublicServiceSlot, useProvider, useProviderSchedule, useProviderSchedules, useProviders, usePublicAppointment, usePublicCancellationReasons, usePublicServiceSlots, useRescheduleAppointment, useReschedulePublicAppointment, useRoles, useSavvyCalFetchClient, useSavvyCalQueryClient, useService, useServiceProviders, useServiceSlots, useServices, useUpdateAccount, useUpdateBlock, useUpdateCancellationReason, useUpdateClient, useUpdateProvider, useUpdateProviderSchedule, useUpdateService };
9792
+ export { type MutationOptionsFor, type QueryClient, type QueryOptionsFor, SavvyCalProvider, type SavvyCalProviderProps, createQueryClient, useAccountById, useAccountUsers, useAccounts, useAppointment, useAppointments, useBlock, useBlocks, useCancelAppointment, useCancelPublicAppointment, useCancellationReason, useCancellationReasons, useClient, useClients, useConfirmAppointment, useCreateAccount, useCreateAccountUser, useCreateAppointment, useCreateBlock, useCreateCancellationReason, useCreateClient, useCreateDashboardSession, useCreateProvider, useCreateProviderSchedule, useCreatePublicAppointment, useCreateService, useCreateServiceProvider, useCurrentAccount, useCurrentAccountUser, useCurrentPlatform, useDeactivateProvider, useDeleteBlock, useDeleteCancellationReason, useDeleteClient, useDeleteProviderSchedule, useDeleteService, useDeleteServiceProvider, useEarliestPublicServiceSlot, useProvider, useProviderSchedule, useProviderSchedules, useProviders, usePublicAppointment, usePublicCancellationReasons, usePublicServiceSlots, useRescheduleAppointment, useReschedulePublicAppointment, useRoles, useSavvyCalFetchClient, useSavvyCalQueryClient, useService, useServiceProviders, useServiceSlots, useServices, useUpdateAccount, useUpdateAccountUser, useUpdateBlock, useUpdateCancellationReason, useUpdateClient, useUpdateProvider, useUpdateProviderSchedule, useUpdateService };
package/dist/index.js CHANGED
@@ -358,6 +358,13 @@ var useUpdateAccount = (options) => {
358
358
  );
359
359
  };
360
360
 
361
+ // src/mutation-hooks/use-update-account-user.ts
362
+ var useUpdateAccountUser = (options) => {
363
+ const { client: overrideClient, ...mutationOptions } = options ?? {};
364
+ const client = useSavvyCalQueryClient(overrideClient);
365
+ return client.useMutation("patch", "/v1/users/{user_id}", mutationOptions);
366
+ };
367
+
361
368
  // src/mutation-hooks/use-update-block.ts
362
369
  var useUpdateBlock = (options) => {
363
370
  const { client: overrideClient, ...mutationOptions } = options ?? {};
@@ -858,6 +865,7 @@ export {
858
865
  useServiceSlots,
859
866
  useServices,
860
867
  useUpdateAccount,
868
+ useUpdateAccountUser,
861
869
  useUpdateBlock,
862
870
  useUpdateCancellationReason,
863
871
  useUpdateClient,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@savvycal/appointments-react-query",
3
- "version": "0.1.2",
3
+ "version": "0.2.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": "0.3.0"
46
+ "@savvycal/appointments-core": "0.4.0"
47
47
  },
48
48
  "peerDependencies": {
49
49
  "@tanstack/react-query": "^5.0.0",