@outseta/react 0.1.1 → 0.2.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.
@@ -237,7 +237,23 @@ import type {
237
237
  Account,
238
238
  AccountAddAccountBody,
239
239
  AccountAddAccountParams,
240
- AccountGetAllAccountsParams
240
+ AccountAddPersonToAccountBody,
241
+ AccountCancelAccountBody,
242
+ AccountExtendTrialBody,
243
+ AccountGetAllAccountsParams,
244
+ AccountUpdateAccountBody,
245
+ AccountUpdateMembershipBody,
246
+ Deal,
247
+ DealAddDealBody,
248
+ DealGetAllDealsParams,
249
+ DealUpdateDealBody,
250
+ Person,
251
+ PersonAccount,
252
+ PersonAddPersonBody,
253
+ PersonForgotPasswordBody,
254
+ PersonGetAllPeopleParams,
255
+ PersonSetTemporaryPasswordBody,
256
+ PersonUpdatePersonBody
241
257
  } from '../outsetaAPI.schemas';
242
258
 
243
259
  import { customFetch } from '../../mutator';
@@ -248,16 +264,16 @@ type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
248
264
 
249
265
 
250
266
  /**
251
- * @summary Returns all accounts, optionally filtered by segment or search query.
267
+ * @summary Retrieves all the deals associated with your account.
252
268
  */
253
- export const accountGetAllAccounts = (
254
- params?: AccountGetAllAccountsParams,
269
+ export const dealGetAllDeals = (
270
+ params?: DealGetAllDealsParams,
255
271
  options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
256
272
  ) => {
257
273
 
258
274
 
259
- return customFetch<Account[]>(
260
- {url: `/api/v1/crm/accounts`, method: 'GET',
275
+ return customFetch<Deal[]>(
276
+ {url: `/api/v1/crm/deals`, method: 'GET',
261
277
  params, signal
262
278
  },
263
279
  options);
@@ -266,45 +282,45 @@ export const accountGetAllAccounts = (
266
282
 
267
283
 
268
284
 
269
- export const getAccountGetAllAccountsQueryKey = (params?: AccountGetAllAccountsParams,) => {
285
+ export const getDealGetAllDealsQueryKey = (params?: DealGetAllDealsParams,) => {
270
286
  return [
271
- `/api/v1/crm/accounts`, ...(params ? [params]: [])
287
+ `/api/v1/crm/deals`, ...(params ? [params]: [])
272
288
  ] as const;
273
289
  }
274
290
 
275
291
 
276
- export const getAccountGetAllAccountsQueryOptions = <TData = Awaited<ReturnType<typeof accountGetAllAccounts>>, TError = void>(params?: AccountGetAllAccountsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof accountGetAllAccounts>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
292
+ export const getDealGetAllDealsQueryOptions = <TData = Awaited<ReturnType<typeof dealGetAllDeals>>, TError = void>(params?: DealGetAllDealsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof dealGetAllDeals>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
277
293
  ) => {
278
294
 
279
295
  const {query: queryOptions, request: requestOptions} = options ?? {};
280
296
 
281
- const queryKey = queryOptions?.queryKey ?? getAccountGetAllAccountsQueryKey(params);
297
+ const queryKey = queryOptions?.queryKey ?? getDealGetAllDealsQueryKey(params);
282
298
 
283
299
 
284
300
 
285
- const queryFn: QueryFunction<Awaited<ReturnType<typeof accountGetAllAccounts>>> = ({ signal }) => accountGetAllAccounts(params, requestOptions, signal);
301
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof dealGetAllDeals>>> = ({ signal }) => dealGetAllDeals(params, requestOptions, signal);
286
302
 
287
303
 
288
304
 
289
305
 
290
306
 
291
- return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof accountGetAllAccounts>>, TError, TData> & { queryKey: QueryKey }
307
+ return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof dealGetAllDeals>>, TError, TData> & { queryKey: QueryKey }
292
308
  }
293
309
 
294
- export type AccountGetAllAccountsQueryResult = NonNullable<Awaited<ReturnType<typeof accountGetAllAccounts>>>
295
- export type AccountGetAllAccountsQueryError = void
310
+ export type DealGetAllDealsQueryResult = NonNullable<Awaited<ReturnType<typeof dealGetAllDeals>>>
311
+ export type DealGetAllDealsQueryError = void
296
312
 
297
313
 
298
314
  /**
299
- * @summary Returns all accounts, optionally filtered by segment or search query.
315
+ * @summary Retrieves all the deals associated with your account.
300
316
  */
301
317
 
302
- export function useAccountGetAllAccounts<TData = Awaited<ReturnType<typeof accountGetAllAccounts>>, TError = void>(
303
- params?: AccountGetAllAccountsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof accountGetAllAccounts>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
318
+ export function useDealGetAllDeals<TData = Awaited<ReturnType<typeof dealGetAllDeals>>, TError = void>(
319
+ params?: DealGetAllDealsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof dealGetAllDeals>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
304
320
 
305
321
  ): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
306
322
 
307
- const queryOptions = getAccountGetAllAccountsQueryOptions(params,options)
323
+ const queryOptions = getDealGetAllDealsQueryOptions(params,options)
308
324
 
309
325
  const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
310
326
 
@@ -317,34 +333,29 @@ export function useAccountGetAllAccounts<TData = Awaited<ReturnType<typeof accou
317
333
 
318
334
 
319
335
  /**
320
- * @summary Add a new account.
321
- To add an account with an existing person, the Account payload include something like this:
322
- { ... other Account properties ..., "PersonAccount": [ { "Person": { "Uid": [personUid] }, "IsPrimary": "true" } ] }
336
+ * @summary Add a new deal.
323
337
  */
324
- export const accountAddAccount = (
325
- accountAddAccountBody: AccountAddAccountBody,
326
- params?: AccountAddAccountParams,
338
+ export const dealAddDeal = (
339
+ dealAddDealBody: DealAddDealBody,
327
340
  options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
328
341
  ) => {
329
342
 
330
343
 
331
- return customFetch<Blob>(
332
- {url: `/api/v1/crm/accounts`, method: 'POST',
344
+ return customFetch<Deal>(
345
+ {url: `/api/v1/crm/deals`, method: 'POST',
333
346
  headers: {'Content-Type': 'application/json', },
334
- data: accountAddAccountBody,
335
- params,
336
- responseType: 'blob', signal
347
+ data: dealAddDealBody, signal
337
348
  },
338
349
  options);
339
350
  }
340
351
 
341
352
 
342
353
 
343
- export const getAccountAddAccountMutationOptions = <TError = void,
344
- TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountAddAccount>>, TError,{data: AccountAddAccountBody;params?: AccountAddAccountParams}, TContext>, request?: SecondParameter<typeof customFetch>}
345
- ): UseMutationOptions<Awaited<ReturnType<typeof accountAddAccount>>, TError,{data: AccountAddAccountBody;params?: AccountAddAccountParams}, TContext> => {
354
+ export const getDealAddDealMutationOptions = <TError = void,
355
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof dealAddDeal>>, TError,{data: DealAddDealBody}, TContext>, request?: SecondParameter<typeof customFetch>}
356
+ ): UseMutationOptions<Awaited<ReturnType<typeof dealAddDeal>>, TError,{data: DealAddDealBody}, TContext> => {
346
357
 
347
- const mutationKey = ['accountAddAccount'];
358
+ const mutationKey = ['dealAddDeal'];
348
359
  const {mutation: mutationOptions, request: requestOptions} = options ?
349
360
  options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
350
361
  options
@@ -354,10 +365,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
354
365
 
355
366
 
356
367
 
357
- const mutationFn: MutationFunction<Awaited<ReturnType<typeof accountAddAccount>>, {data: AccountAddAccountBody;params?: AccountAddAccountParams}> = (props) => {
358
- const {data,params} = props ?? {};
368
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof dealAddDeal>>, {data: DealAddDealBody}> = (props) => {
369
+ const {data} = props ?? {};
359
370
 
360
- return accountAddAccount(data,params,requestOptions)
371
+ return dealAddDeal(data,requestOptions)
361
372
  }
362
373
 
363
374
 
@@ -365,85 +376,348 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
365
376
 
366
377
  return { mutationFn, ...mutationOptions }}
367
378
 
368
- export type AccountAddAccountMutationResult = NonNullable<Awaited<ReturnType<typeof accountAddAccount>>>
369
- export type AccountAddAccountMutationBody = AccountAddAccountBody
370
- export type AccountAddAccountMutationError = void
379
+ export type DealAddDealMutationResult = NonNullable<Awaited<ReturnType<typeof dealAddDeal>>>
380
+ export type DealAddDealMutationBody = DealAddDealBody
381
+ export type DealAddDealMutationError = void
371
382
 
372
383
  /**
373
- * @summary Add a new account.
374
- To add an account with an existing person, the Account payload include something like this:
375
- { ... other Account properties ..., "PersonAccount": [ { "Person": { "Uid": [personUid] }, "IsPrimary": "true" } ] }
384
+ * @summary Add a new deal.
376
385
  */
377
- export const useAccountAddAccount = <TError = void,
378
- TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountAddAccount>>, TError,{data: AccountAddAccountBody;params?: AccountAddAccountParams}, TContext>, request?: SecondParameter<typeof customFetch>}
386
+ export const useDealAddDeal = <TError = void,
387
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof dealAddDeal>>, TError,{data: DealAddDealBody}, TContext>, request?: SecondParameter<typeof customFetch>}
379
388
  ): UseMutationResult<
380
- Awaited<ReturnType<typeof accountAddAccount>>,
389
+ Awaited<ReturnType<typeof dealAddDeal>>,
381
390
  TError,
382
- {data: AccountAddAccountBody;params?: AccountAddAccountParams},
391
+ {data: DealAddDealBody},
383
392
  TContext
384
393
  > => {
385
394
 
386
- const mutationOptions = getAccountAddAccountMutationOptions(options);
395
+ const mutationOptions = getDealAddDealMutationOptions(options);
387
396
 
388
397
  return useMutation(mutationOptions);
389
398
  }
390
399
  /**
391
- * @summary Returns a single account by UID.
400
+ * @summary Retrieves one deal associated with your account.
392
401
  */
393
- export const accountGetAccount = (
394
- accountUid: string | null,
402
+ export const dealGetDeal = (
403
+ dealUid: string | null,
404
+ options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
405
+ ) => {
406
+
407
+
408
+ return customFetch<Deal>(
409
+ {url: `/api/v1/crm/deals/${dealUid}`, method: 'GET', signal
410
+ },
411
+ options);
412
+ }
413
+
414
+
415
+
416
+
417
+ export const getDealGetDealQueryKey = (dealUid?: string | null,) => {
418
+ return [
419
+ `/api/v1/crm/deals/${dealUid}`
420
+ ] as const;
421
+ }
422
+
423
+
424
+ export const getDealGetDealQueryOptions = <TData = Awaited<ReturnType<typeof dealGetDeal>>, TError = void>(dealUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof dealGetDeal>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
425
+ ) => {
426
+
427
+ const {query: queryOptions, request: requestOptions} = options ?? {};
428
+
429
+ const queryKey = queryOptions?.queryKey ?? getDealGetDealQueryKey(dealUid);
430
+
431
+
432
+
433
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof dealGetDeal>>> = ({ signal }) => dealGetDeal(dealUid, requestOptions, signal);
434
+
435
+
436
+
437
+
438
+
439
+ return { queryKey, queryFn, enabled: !!(dealUid), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof dealGetDeal>>, TError, TData> & { queryKey: QueryKey }
440
+ }
441
+
442
+ export type DealGetDealQueryResult = NonNullable<Awaited<ReturnType<typeof dealGetDeal>>>
443
+ export type DealGetDealQueryError = void
444
+
445
+
446
+ /**
447
+ * @summary Retrieves one deal associated with your account.
448
+ */
449
+
450
+ export function useDealGetDeal<TData = Awaited<ReturnType<typeof dealGetDeal>>, TError = void>(
451
+ dealUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof dealGetDeal>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
452
+
453
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
454
+
455
+ const queryOptions = getDealGetDealQueryOptions(dealUid,options)
456
+
457
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
458
+
459
+ query.queryKey = queryOptions.queryKey ;
460
+
461
+ return query;
462
+ }
463
+
464
+
465
+
466
+
467
+ /**
468
+ * @summary Update a deal.
469
+ */
470
+ export const dealUpdateDeal = (
471
+ dealUid: string | null,
472
+ dealUpdateDealBody: DealUpdateDealBody,
473
+ options?: SecondParameter<typeof customFetch>,) => {
474
+
475
+
476
+ return customFetch<Deal>(
477
+ {url: `/api/v1/crm/deals/${dealUid}`, method: 'PUT',
478
+ headers: {'Content-Type': 'application/json', },
479
+ data: dealUpdateDealBody
480
+ },
481
+ options);
482
+ }
483
+
484
+
485
+
486
+ export const getDealUpdateDealMutationOptions = <TError = void,
487
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof dealUpdateDeal>>, TError,{dealUid: string | null;data: DealUpdateDealBody}, TContext>, request?: SecondParameter<typeof customFetch>}
488
+ ): UseMutationOptions<Awaited<ReturnType<typeof dealUpdateDeal>>, TError,{dealUid: string | null;data: DealUpdateDealBody}, TContext> => {
489
+
490
+ const mutationKey = ['dealUpdateDeal'];
491
+ const {mutation: mutationOptions, request: requestOptions} = options ?
492
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
493
+ options
494
+ : {...options, mutation: {...options.mutation, mutationKey}}
495
+ : {mutation: { mutationKey, }, request: undefined};
496
+
497
+
498
+
499
+
500
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof dealUpdateDeal>>, {dealUid: string | null;data: DealUpdateDealBody}> = (props) => {
501
+ const {dealUid,data} = props ?? {};
502
+
503
+ return dealUpdateDeal(dealUid,data,requestOptions)
504
+ }
505
+
506
+
507
+
508
+
509
+ return { mutationFn, ...mutationOptions }}
510
+
511
+ export type DealUpdateDealMutationResult = NonNullable<Awaited<ReturnType<typeof dealUpdateDeal>>>
512
+ export type DealUpdateDealMutationBody = DealUpdateDealBody
513
+ export type DealUpdateDealMutationError = void
514
+
515
+ /**
516
+ * @summary Update a deal.
517
+ */
518
+ export const useDealUpdateDeal = <TError = void,
519
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof dealUpdateDeal>>, TError,{dealUid: string | null;data: DealUpdateDealBody}, TContext>, request?: SecondParameter<typeof customFetch>}
520
+ ): UseMutationResult<
521
+ Awaited<ReturnType<typeof dealUpdateDeal>>,
522
+ TError,
523
+ {dealUid: string | null;data: DealUpdateDealBody},
524
+ TContext
525
+ > => {
526
+
527
+ const mutationOptions = getDealUpdateDealMutationOptions(options);
528
+
529
+ return useMutation(mutationOptions);
530
+ }
531
+ /**
532
+ * @summary Delete a deal.
533
+ */
534
+ export const dealDeleteDeal = (
535
+ dealUid: string | null,
536
+ options?: SecondParameter<typeof customFetch>,) => {
537
+
538
+
539
+ return customFetch<Blob>(
540
+ {url: `/api/v1/crm/deals/${dealUid}`, method: 'DELETE',
541
+ responseType: 'blob'
542
+ },
543
+ options);
544
+ }
545
+
546
+
547
+
548
+ export const getDealDeleteDealMutationOptions = <TError = void,
549
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof dealDeleteDeal>>, TError,{dealUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
550
+ ): UseMutationOptions<Awaited<ReturnType<typeof dealDeleteDeal>>, TError,{dealUid: string | null}, TContext> => {
551
+
552
+ const mutationKey = ['dealDeleteDeal'];
553
+ const {mutation: mutationOptions, request: requestOptions} = options ?
554
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
555
+ options
556
+ : {...options, mutation: {...options.mutation, mutationKey}}
557
+ : {mutation: { mutationKey, }, request: undefined};
558
+
559
+
560
+
561
+
562
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof dealDeleteDeal>>, {dealUid: string | null}> = (props) => {
563
+ const {dealUid} = props ?? {};
564
+
565
+ return dealDeleteDeal(dealUid,requestOptions)
566
+ }
567
+
568
+
569
+
570
+
571
+ return { mutationFn, ...mutationOptions }}
572
+
573
+ export type DealDeleteDealMutationResult = NonNullable<Awaited<ReturnType<typeof dealDeleteDeal>>>
574
+
575
+ export type DealDeleteDealMutationError = void
576
+
577
+ /**
578
+ * @summary Delete a deal.
579
+ */
580
+ export const useDealDeleteDeal = <TError = void,
581
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof dealDeleteDeal>>, TError,{dealUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
582
+ ): UseMutationResult<
583
+ Awaited<ReturnType<typeof dealDeleteDeal>>,
584
+ TError,
585
+ {dealUid: string | null},
586
+ TContext
587
+ > => {
588
+
589
+ const mutationOptions = getDealDeleteDealMutationOptions(options);
590
+
591
+ return useMutation(mutationOptions);
592
+ }
593
+ /**
594
+ * @summary Register a new account. This is the same endpoint the sign up embed uses to create accounts.
595
+ At a minimum you must pass one Primary Contact with an Email address and one Subscription
596
+ record with a reference to a Plan. Other fields (e.g. Account Name, Billing Address,
597
+ Payment Information, etc.) can be passed as desired. A confirmation email will be sent
598
+ to the user unless you've specifically toggled this option off on the AUTH > SIGN UP AND LOGIN page.
599
+ */
600
+ export const registrationRegisterAccount = (
601
+
395
602
  options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
396
603
  ) => {
397
604
 
398
605
 
399
606
  return customFetch<Account>(
400
- {url: `/api/v1/crm/accounts/${accountUid}`, method: 'GET', signal
607
+ {url: `/api/v1/crm/registrations`, method: 'POST', signal
401
608
  },
402
609
  options);
403
610
  }
404
611
 
405
612
 
406
613
 
614
+ export const getRegistrationRegisterAccountMutationOptions = <TError = unknown,
615
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof registrationRegisterAccount>>, TError,void, TContext>, request?: SecondParameter<typeof customFetch>}
616
+ ): UseMutationOptions<Awaited<ReturnType<typeof registrationRegisterAccount>>, TError,void, TContext> => {
407
617
 
408
- export const getAccountGetAccountQueryKey = (accountUid?: string | null,) => {
618
+ const mutationKey = ['registrationRegisterAccount'];
619
+ const {mutation: mutationOptions, request: requestOptions} = options ?
620
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
621
+ options
622
+ : {...options, mutation: {...options.mutation, mutationKey}}
623
+ : {mutation: { mutationKey, }, request: undefined};
624
+
625
+
626
+
627
+
628
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof registrationRegisterAccount>>, void> = () => {
629
+
630
+
631
+ return registrationRegisterAccount(requestOptions)
632
+ }
633
+
634
+
635
+
636
+
637
+ return { mutationFn, ...mutationOptions }}
638
+
639
+ export type RegistrationRegisterAccountMutationResult = NonNullable<Awaited<ReturnType<typeof registrationRegisterAccount>>>
640
+
641
+ export type RegistrationRegisterAccountMutationError = unknown
642
+
643
+ /**
644
+ * @summary Register a new account. This is the same endpoint the sign up embed uses to create accounts.
645
+ At a minimum you must pass one Primary Contact with an Email address and one Subscription
646
+ record with a reference to a Plan. Other fields (e.g. Account Name, Billing Address,
647
+ Payment Information, etc.) can be passed as desired. A confirmation email will be sent
648
+ to the user unless you've specifically toggled this option off on the AUTH > SIGN UP AND LOGIN page.
649
+ */
650
+ export const useRegistrationRegisterAccount = <TError = unknown,
651
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof registrationRegisterAccount>>, TError,void, TContext>, request?: SecondParameter<typeof customFetch>}
652
+ ): UseMutationResult<
653
+ Awaited<ReturnType<typeof registrationRegisterAccount>>,
654
+ TError,
655
+ void,
656
+ TContext
657
+ > => {
658
+
659
+ const mutationOptions = getRegistrationRegisterAccountMutationOptions(options);
660
+
661
+ return useMutation(mutationOptions);
662
+ }
663
+ /**
664
+ * @summary Returns all accounts, optionally filtered by segment or search query.
665
+ */
666
+ export const accountGetAllAccounts = (
667
+ params?: AccountGetAllAccountsParams,
668
+ options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
669
+ ) => {
670
+
671
+
672
+ return customFetch<Account[]>(
673
+ {url: `/api/v1/crm/accounts`, method: 'GET',
674
+ params, signal
675
+ },
676
+ options);
677
+ }
678
+
679
+
680
+
681
+
682
+ export const getAccountGetAllAccountsQueryKey = (params?: AccountGetAllAccountsParams,) => {
409
683
  return [
410
- `/api/v1/crm/accounts/${accountUid}`
684
+ `/api/v1/crm/accounts`, ...(params ? [params]: [])
411
685
  ] as const;
412
686
  }
413
687
 
414
688
 
415
- export const getAccountGetAccountQueryOptions = <TData = Awaited<ReturnType<typeof accountGetAccount>>, TError = void>(accountUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof accountGetAccount>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
689
+ export const getAccountGetAllAccountsQueryOptions = <TData = Awaited<ReturnType<typeof accountGetAllAccounts>>, TError = void>(params?: AccountGetAllAccountsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof accountGetAllAccounts>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
416
690
  ) => {
417
691
 
418
692
  const {query: queryOptions, request: requestOptions} = options ?? {};
419
693
 
420
- const queryKey = queryOptions?.queryKey ?? getAccountGetAccountQueryKey(accountUid);
694
+ const queryKey = queryOptions?.queryKey ?? getAccountGetAllAccountsQueryKey(params);
421
695
 
422
696
 
423
697
 
424
- const queryFn: QueryFunction<Awaited<ReturnType<typeof accountGetAccount>>> = ({ signal }) => accountGetAccount(accountUid, requestOptions, signal);
698
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof accountGetAllAccounts>>> = ({ signal }) => accountGetAllAccounts(params, requestOptions, signal);
425
699
 
426
700
 
427
701
 
428
702
 
429
703
 
430
- return { queryKey, queryFn, enabled: !!(accountUid), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof accountGetAccount>>, TError, TData> & { queryKey: QueryKey }
704
+ return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof accountGetAllAccounts>>, TError, TData> & { queryKey: QueryKey }
431
705
  }
432
706
 
433
- export type AccountGetAccountQueryResult = NonNullable<Awaited<ReturnType<typeof accountGetAccount>>>
434
- export type AccountGetAccountQueryError = void
707
+ export type AccountGetAllAccountsQueryResult = NonNullable<Awaited<ReturnType<typeof accountGetAllAccounts>>>
708
+ export type AccountGetAllAccountsQueryError = void
435
709
 
436
710
 
437
711
  /**
438
- * @summary Returns a single account by UID.
712
+ * @summary Returns all accounts, optionally filtered by segment or search query.
439
713
  */
440
714
 
441
- export function useAccountGetAccount<TData = Awaited<ReturnType<typeof accountGetAccount>>, TError = void>(
442
- accountUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof accountGetAccount>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
715
+ export function useAccountGetAllAccounts<TData = Awaited<ReturnType<typeof accountGetAllAccounts>>, TError = void>(
716
+ params?: AccountGetAllAccountsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof accountGetAllAccounts>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
443
717
 
444
718
  ): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
445
719
 
446
- const queryOptions = getAccountGetAccountQueryOptions(accountUid,options)
720
+ const queryOptions = getAccountGetAllAccountsQueryOptions(params,options)
447
721
 
448
722
  const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
449
723
 
@@ -455,3 +729,1194 @@ export function useAccountGetAccount<TData = Awaited<ReturnType<typeof accountGe
455
729
 
456
730
 
457
731
 
732
+ /**
733
+ * @summary Add a new account.
734
+ To add an account with an existing person, the Account payload include something like this:
735
+ { ... other Account properties ..., "PersonAccount": [ { "Person": { "Uid": [personUid] }, "IsPrimary": "true" } ] }
736
+ */
737
+ export const accountAddAccount = (
738
+ accountAddAccountBody: AccountAddAccountBody,
739
+ params?: AccountAddAccountParams,
740
+ options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
741
+ ) => {
742
+
743
+
744
+ return customFetch<Blob>(
745
+ {url: `/api/v1/crm/accounts`, method: 'POST',
746
+ headers: {'Content-Type': 'application/json', },
747
+ data: accountAddAccountBody,
748
+ params,
749
+ responseType: 'blob', signal
750
+ },
751
+ options);
752
+ }
753
+
754
+
755
+
756
+ export const getAccountAddAccountMutationOptions = <TError = void,
757
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountAddAccount>>, TError,{data: AccountAddAccountBody;params?: AccountAddAccountParams}, TContext>, request?: SecondParameter<typeof customFetch>}
758
+ ): UseMutationOptions<Awaited<ReturnType<typeof accountAddAccount>>, TError,{data: AccountAddAccountBody;params?: AccountAddAccountParams}, TContext> => {
759
+
760
+ const mutationKey = ['accountAddAccount'];
761
+ const {mutation: mutationOptions, request: requestOptions} = options ?
762
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
763
+ options
764
+ : {...options, mutation: {...options.mutation, mutationKey}}
765
+ : {mutation: { mutationKey, }, request: undefined};
766
+
767
+
768
+
769
+
770
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof accountAddAccount>>, {data: AccountAddAccountBody;params?: AccountAddAccountParams}> = (props) => {
771
+ const {data,params} = props ?? {};
772
+
773
+ return accountAddAccount(data,params,requestOptions)
774
+ }
775
+
776
+
777
+
778
+
779
+ return { mutationFn, ...mutationOptions }}
780
+
781
+ export type AccountAddAccountMutationResult = NonNullable<Awaited<ReturnType<typeof accountAddAccount>>>
782
+ export type AccountAddAccountMutationBody = AccountAddAccountBody
783
+ export type AccountAddAccountMutationError = void
784
+
785
+ /**
786
+ * @summary Add a new account.
787
+ To add an account with an existing person, the Account payload include something like this:
788
+ { ... other Account properties ..., "PersonAccount": [ { "Person": { "Uid": [personUid] }, "IsPrimary": "true" } ] }
789
+ */
790
+ export const useAccountAddAccount = <TError = void,
791
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountAddAccount>>, TError,{data: AccountAddAccountBody;params?: AccountAddAccountParams}, TContext>, request?: SecondParameter<typeof customFetch>}
792
+ ): UseMutationResult<
793
+ Awaited<ReturnType<typeof accountAddAccount>>,
794
+ TError,
795
+ {data: AccountAddAccountBody;params?: AccountAddAccountParams},
796
+ TContext
797
+ > => {
798
+
799
+ const mutationOptions = getAccountAddAccountMutationOptions(options);
800
+
801
+ return useMutation(mutationOptions);
802
+ }
803
+ /**
804
+ * @summary Returns a single account by UID.
805
+ */
806
+ export const accountGetAccount = (
807
+ accountUid: string | null,
808
+ options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
809
+ ) => {
810
+
811
+
812
+ return customFetch<Account>(
813
+ {url: `/api/v1/crm/accounts/${accountUid}`, method: 'GET', signal
814
+ },
815
+ options);
816
+ }
817
+
818
+
819
+
820
+
821
+ export const getAccountGetAccountQueryKey = (accountUid?: string | null,) => {
822
+ return [
823
+ `/api/v1/crm/accounts/${accountUid}`
824
+ ] as const;
825
+ }
826
+
827
+
828
+ export const getAccountGetAccountQueryOptions = <TData = Awaited<ReturnType<typeof accountGetAccount>>, TError = void>(accountUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof accountGetAccount>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
829
+ ) => {
830
+
831
+ const {query: queryOptions, request: requestOptions} = options ?? {};
832
+
833
+ const queryKey = queryOptions?.queryKey ?? getAccountGetAccountQueryKey(accountUid);
834
+
835
+
836
+
837
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof accountGetAccount>>> = ({ signal }) => accountGetAccount(accountUid, requestOptions, signal);
838
+
839
+
840
+
841
+
842
+
843
+ return { queryKey, queryFn, enabled: !!(accountUid), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof accountGetAccount>>, TError, TData> & { queryKey: QueryKey }
844
+ }
845
+
846
+ export type AccountGetAccountQueryResult = NonNullable<Awaited<ReturnType<typeof accountGetAccount>>>
847
+ export type AccountGetAccountQueryError = void
848
+
849
+
850
+ /**
851
+ * @summary Returns a single account by UID.
852
+ */
853
+
854
+ export function useAccountGetAccount<TData = Awaited<ReturnType<typeof accountGetAccount>>, TError = void>(
855
+ accountUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof accountGetAccount>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
856
+
857
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
858
+
859
+ const queryOptions = getAccountGetAccountQueryOptions(accountUid,options)
860
+
861
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
862
+
863
+ query.queryKey = queryOptions.queryKey ;
864
+
865
+ return query;
866
+ }
867
+
868
+
869
+
870
+
871
+ /**
872
+ * @summary Delete an account record.
873
+ */
874
+ export const accountDeleteAccount = (
875
+ accountUid: string | null,
876
+ options?: SecondParameter<typeof customFetch>,) => {
877
+
878
+
879
+ return customFetch<Blob>(
880
+ {url: `/api/v1/crm/accounts/${accountUid}`, method: 'DELETE',
881
+ responseType: 'blob'
882
+ },
883
+ options);
884
+ }
885
+
886
+
887
+
888
+ export const getAccountDeleteAccountMutationOptions = <TError = void,
889
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountDeleteAccount>>, TError,{accountUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
890
+ ): UseMutationOptions<Awaited<ReturnType<typeof accountDeleteAccount>>, TError,{accountUid: string | null}, TContext> => {
891
+
892
+ const mutationKey = ['accountDeleteAccount'];
893
+ const {mutation: mutationOptions, request: requestOptions} = options ?
894
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
895
+ options
896
+ : {...options, mutation: {...options.mutation, mutationKey}}
897
+ : {mutation: { mutationKey, }, request: undefined};
898
+
899
+
900
+
901
+
902
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof accountDeleteAccount>>, {accountUid: string | null}> = (props) => {
903
+ const {accountUid} = props ?? {};
904
+
905
+ return accountDeleteAccount(accountUid,requestOptions)
906
+ }
907
+
908
+
909
+
910
+
911
+ return { mutationFn, ...mutationOptions }}
912
+
913
+ export type AccountDeleteAccountMutationResult = NonNullable<Awaited<ReturnType<typeof accountDeleteAccount>>>
914
+
915
+ export type AccountDeleteAccountMutationError = void
916
+
917
+ /**
918
+ * @summary Delete an account record.
919
+ */
920
+ export const useAccountDeleteAccount = <TError = void,
921
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountDeleteAccount>>, TError,{accountUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
922
+ ): UseMutationResult<
923
+ Awaited<ReturnType<typeof accountDeleteAccount>>,
924
+ TError,
925
+ {accountUid: string | null},
926
+ TContext
927
+ > => {
928
+
929
+ const mutationOptions = getAccountDeleteAccountMutationOptions(options);
930
+
931
+ return useMutation(mutationOptions);
932
+ }
933
+ /**
934
+ * @summary Update account information. You can update one or multiple properties on the object.
935
+ Any property that you include in the json schema will be updated.
936
+ To update custom properties just include them in the same way that they are included when you do a get on the object.
937
+ */
938
+ export const accountUpdateAccount = (
939
+ accountUid: string | null,
940
+ accountUpdateAccountBody: AccountUpdateAccountBody,
941
+ options?: SecondParameter<typeof customFetch>,) => {
942
+
943
+
944
+ return customFetch<Account>(
945
+ {url: `/api/v1/crm/accounts/${accountUid}`, method: 'PUT',
946
+ headers: {'Content-Type': 'application/json', },
947
+ data: accountUpdateAccountBody
948
+ },
949
+ options);
950
+ }
951
+
952
+
953
+
954
+ export const getAccountUpdateAccountMutationOptions = <TError = void,
955
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountUpdateAccount>>, TError,{accountUid: string | null;data: AccountUpdateAccountBody}, TContext>, request?: SecondParameter<typeof customFetch>}
956
+ ): UseMutationOptions<Awaited<ReturnType<typeof accountUpdateAccount>>, TError,{accountUid: string | null;data: AccountUpdateAccountBody}, TContext> => {
957
+
958
+ const mutationKey = ['accountUpdateAccount'];
959
+ const {mutation: mutationOptions, request: requestOptions} = options ?
960
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
961
+ options
962
+ : {...options, mutation: {...options.mutation, mutationKey}}
963
+ : {mutation: { mutationKey, }, request: undefined};
964
+
965
+
966
+
967
+
968
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof accountUpdateAccount>>, {accountUid: string | null;data: AccountUpdateAccountBody}> = (props) => {
969
+ const {accountUid,data} = props ?? {};
970
+
971
+ return accountUpdateAccount(accountUid,data,requestOptions)
972
+ }
973
+
974
+
975
+
976
+
977
+ return { mutationFn, ...mutationOptions }}
978
+
979
+ export type AccountUpdateAccountMutationResult = NonNullable<Awaited<ReturnType<typeof accountUpdateAccount>>>
980
+ export type AccountUpdateAccountMutationBody = AccountUpdateAccountBody
981
+ export type AccountUpdateAccountMutationError = void
982
+
983
+ /**
984
+ * @summary Update account information. You can update one or multiple properties on the object.
985
+ Any property that you include in the json schema will be updated.
986
+ To update custom properties just include them in the same way that they are included when you do a get on the object.
987
+ */
988
+ export const useAccountUpdateAccount = <TError = void,
989
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountUpdateAccount>>, TError,{accountUid: string | null;data: AccountUpdateAccountBody}, TContext>, request?: SecondParameter<typeof customFetch>}
990
+ ): UseMutationResult<
991
+ Awaited<ReturnType<typeof accountUpdateAccount>>,
992
+ TError,
993
+ {accountUid: string | null;data: AccountUpdateAccountBody},
994
+ TContext
995
+ > => {
996
+
997
+ const mutationOptions = getAccountUpdateAccountMutationOptions(options);
998
+
999
+ return useMutation(mutationOptions);
1000
+ }
1001
+ /**
1002
+ * @summary Add a person to an existing account. Set sendWelcomeEmail=true to send a welcome email to the person added.
1003
+ */
1004
+ export const accountAddPersonToAccount = (
1005
+ accountUid: string | null,
1006
+ accountAddPersonToAccountBody: AccountAddPersonToAccountBody,
1007
+ options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
1008
+ ) => {
1009
+
1010
+
1011
+ return customFetch<PersonAccount>(
1012
+ {url: `/api/v1/crm/accounts/${accountUid}/memberships`, method: 'POST',
1013
+ headers: {'Content-Type': 'application/json', },
1014
+ data: accountAddPersonToAccountBody, signal
1015
+ },
1016
+ options);
1017
+ }
1018
+
1019
+
1020
+
1021
+ export const getAccountAddPersonToAccountMutationOptions = <TError = void,
1022
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountAddPersonToAccount>>, TError,{accountUid: string | null;data: AccountAddPersonToAccountBody}, TContext>, request?: SecondParameter<typeof customFetch>}
1023
+ ): UseMutationOptions<Awaited<ReturnType<typeof accountAddPersonToAccount>>, TError,{accountUid: string | null;data: AccountAddPersonToAccountBody}, TContext> => {
1024
+
1025
+ const mutationKey = ['accountAddPersonToAccount'];
1026
+ const {mutation: mutationOptions, request: requestOptions} = options ?
1027
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
1028
+ options
1029
+ : {...options, mutation: {...options.mutation, mutationKey}}
1030
+ : {mutation: { mutationKey, }, request: undefined};
1031
+
1032
+
1033
+
1034
+
1035
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof accountAddPersonToAccount>>, {accountUid: string | null;data: AccountAddPersonToAccountBody}> = (props) => {
1036
+ const {accountUid,data} = props ?? {};
1037
+
1038
+ return accountAddPersonToAccount(accountUid,data,requestOptions)
1039
+ }
1040
+
1041
+
1042
+
1043
+
1044
+ return { mutationFn, ...mutationOptions }}
1045
+
1046
+ export type AccountAddPersonToAccountMutationResult = NonNullable<Awaited<ReturnType<typeof accountAddPersonToAccount>>>
1047
+ export type AccountAddPersonToAccountMutationBody = AccountAddPersonToAccountBody
1048
+ export type AccountAddPersonToAccountMutationError = void
1049
+
1050
+ /**
1051
+ * @summary Add a person to an existing account. Set sendWelcomeEmail=true to send a welcome email to the person added.
1052
+ */
1053
+ export const useAccountAddPersonToAccount = <TError = void,
1054
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountAddPersonToAccount>>, TError,{accountUid: string | null;data: AccountAddPersonToAccountBody}, TContext>, request?: SecondParameter<typeof customFetch>}
1055
+ ): UseMutationResult<
1056
+ Awaited<ReturnType<typeof accountAddPersonToAccount>>,
1057
+ TError,
1058
+ {accountUid: string | null;data: AccountAddPersonToAccountBody},
1059
+ TContext
1060
+ > => {
1061
+
1062
+ const mutationOptions = getAccountAddPersonToAccountMutationOptions(options);
1063
+
1064
+ return useMutation(mutationOptions);
1065
+ }
1066
+ /**
1067
+ * @summary Update an account membership. This is the method by which you can change the primary contact of an account.
1068
+ */
1069
+ export const accountUpdateMembership = (
1070
+ accountUid: string | null,
1071
+ membershipUid: string | null,
1072
+ accountUpdateMembershipBody: AccountUpdateMembershipBody,
1073
+ options?: SecondParameter<typeof customFetch>,) => {
1074
+
1075
+
1076
+ return customFetch<Blob>(
1077
+ {url: `/api/v1/crm/accounts/${accountUid}/memberships/${membershipUid}`, method: 'PUT',
1078
+ headers: {'Content-Type': 'application/json', },
1079
+ data: accountUpdateMembershipBody,
1080
+ responseType: 'blob'
1081
+ },
1082
+ options);
1083
+ }
1084
+
1085
+
1086
+
1087
+ export const getAccountUpdateMembershipMutationOptions = <TError = void,
1088
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountUpdateMembership>>, TError,{accountUid: string | null;membershipUid: string | null;data: AccountUpdateMembershipBody}, TContext>, request?: SecondParameter<typeof customFetch>}
1089
+ ): UseMutationOptions<Awaited<ReturnType<typeof accountUpdateMembership>>, TError,{accountUid: string | null;membershipUid: string | null;data: AccountUpdateMembershipBody}, TContext> => {
1090
+
1091
+ const mutationKey = ['accountUpdateMembership'];
1092
+ const {mutation: mutationOptions, request: requestOptions} = options ?
1093
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
1094
+ options
1095
+ : {...options, mutation: {...options.mutation, mutationKey}}
1096
+ : {mutation: { mutationKey, }, request: undefined};
1097
+
1098
+
1099
+
1100
+
1101
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof accountUpdateMembership>>, {accountUid: string | null;membershipUid: string | null;data: AccountUpdateMembershipBody}> = (props) => {
1102
+ const {accountUid,membershipUid,data} = props ?? {};
1103
+
1104
+ return accountUpdateMembership(accountUid,membershipUid,data,requestOptions)
1105
+ }
1106
+
1107
+
1108
+
1109
+
1110
+ return { mutationFn, ...mutationOptions }}
1111
+
1112
+ export type AccountUpdateMembershipMutationResult = NonNullable<Awaited<ReturnType<typeof accountUpdateMembership>>>
1113
+ export type AccountUpdateMembershipMutationBody = AccountUpdateMembershipBody
1114
+ export type AccountUpdateMembershipMutationError = void
1115
+
1116
+ /**
1117
+ * @summary Update an account membership. This is the method by which you can change the primary contact of an account.
1118
+ */
1119
+ export const useAccountUpdateMembership = <TError = void,
1120
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountUpdateMembership>>, TError,{accountUid: string | null;membershipUid: string | null;data: AccountUpdateMembershipBody}, TContext>, request?: SecondParameter<typeof customFetch>}
1121
+ ): UseMutationResult<
1122
+ Awaited<ReturnType<typeof accountUpdateMembership>>,
1123
+ TError,
1124
+ {accountUid: string | null;membershipUid: string | null;data: AccountUpdateMembershipBody},
1125
+ TContext
1126
+ > => {
1127
+
1128
+ const mutationOptions = getAccountUpdateMembershipMutationOptions(options);
1129
+
1130
+ return useMutation(mutationOptions);
1131
+ }
1132
+ /**
1133
+ * @summary Remove a person from an account. Note that you cannot remove the primary contact of an account.
1134
+ */
1135
+ export const accountDeleteMembership = (
1136
+ accountUid: string | null,
1137
+ membershipUid: string | null,
1138
+ options?: SecondParameter<typeof customFetch>,) => {
1139
+
1140
+
1141
+ return customFetch<Blob>(
1142
+ {url: `/api/v1/crm/accounts/${accountUid}/memberships/${membershipUid}`, method: 'DELETE',
1143
+ responseType: 'blob'
1144
+ },
1145
+ options);
1146
+ }
1147
+
1148
+
1149
+
1150
+ export const getAccountDeleteMembershipMutationOptions = <TError = void,
1151
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountDeleteMembership>>, TError,{accountUid: string | null;membershipUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
1152
+ ): UseMutationOptions<Awaited<ReturnType<typeof accountDeleteMembership>>, TError,{accountUid: string | null;membershipUid: string | null}, TContext> => {
1153
+
1154
+ const mutationKey = ['accountDeleteMembership'];
1155
+ const {mutation: mutationOptions, request: requestOptions} = options ?
1156
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
1157
+ options
1158
+ : {...options, mutation: {...options.mutation, mutationKey}}
1159
+ : {mutation: { mutationKey, }, request: undefined};
1160
+
1161
+
1162
+
1163
+
1164
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof accountDeleteMembership>>, {accountUid: string | null;membershipUid: string | null}> = (props) => {
1165
+ const {accountUid,membershipUid} = props ?? {};
1166
+
1167
+ return accountDeleteMembership(accountUid,membershipUid,requestOptions)
1168
+ }
1169
+
1170
+
1171
+
1172
+
1173
+ return { mutationFn, ...mutationOptions }}
1174
+
1175
+ export type AccountDeleteMembershipMutationResult = NonNullable<Awaited<ReturnType<typeof accountDeleteMembership>>>
1176
+
1177
+ export type AccountDeleteMembershipMutationError = void
1178
+
1179
+ /**
1180
+ * @summary Remove a person from an account. Note that you cannot remove the primary contact of an account.
1181
+ */
1182
+ export const useAccountDeleteMembership = <TError = void,
1183
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountDeleteMembership>>, TError,{accountUid: string | null;membershipUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
1184
+ ): UseMutationResult<
1185
+ Awaited<ReturnType<typeof accountDeleteMembership>>,
1186
+ TError,
1187
+ {accountUid: string | null;membershipUid: string | null},
1188
+ TContext
1189
+ > => {
1190
+
1191
+ const mutationOptions = getAccountDeleteMembershipMutationOptions(options);
1192
+
1193
+ return useMutation(mutationOptions);
1194
+ }
1195
+ /**
1196
+ * @summary Add a cancellation request to an account. The account needs to be in subscribing stage.
1197
+ The stage will automatically change over to cancelling. If the account has a subscription
1198
+ attached to it then at the subscription renewal the subscription will end and the account
1199
+ will be automatically set to expired.
1200
+ */
1201
+ export const accountCancelAccount = (
1202
+ accountUid: string | null,
1203
+ accountCancelAccountBody: AccountCancelAccountBody,
1204
+ options?: SecondParameter<typeof customFetch>,) => {
1205
+
1206
+
1207
+ return customFetch<Blob>(
1208
+ {url: `/api/v1/crm/accounts/${accountUid}/cancel`, method: 'PUT',
1209
+ headers: {'Content-Type': 'application/json', },
1210
+ data: accountCancelAccountBody,
1211
+ responseType: 'blob'
1212
+ },
1213
+ options);
1214
+ }
1215
+
1216
+
1217
+
1218
+ export const getAccountCancelAccountMutationOptions = <TError = void,
1219
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountCancelAccount>>, TError,{accountUid: string | null;data: AccountCancelAccountBody}, TContext>, request?: SecondParameter<typeof customFetch>}
1220
+ ): UseMutationOptions<Awaited<ReturnType<typeof accountCancelAccount>>, TError,{accountUid: string | null;data: AccountCancelAccountBody}, TContext> => {
1221
+
1222
+ const mutationKey = ['accountCancelAccount'];
1223
+ const {mutation: mutationOptions, request: requestOptions} = options ?
1224
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
1225
+ options
1226
+ : {...options, mutation: {...options.mutation, mutationKey}}
1227
+ : {mutation: { mutationKey, }, request: undefined};
1228
+
1229
+
1230
+
1231
+
1232
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof accountCancelAccount>>, {accountUid: string | null;data: AccountCancelAccountBody}> = (props) => {
1233
+ const {accountUid,data} = props ?? {};
1234
+
1235
+ return accountCancelAccount(accountUid,data,requestOptions)
1236
+ }
1237
+
1238
+
1239
+
1240
+
1241
+ return { mutationFn, ...mutationOptions }}
1242
+
1243
+ export type AccountCancelAccountMutationResult = NonNullable<Awaited<ReturnType<typeof accountCancelAccount>>>
1244
+ export type AccountCancelAccountMutationBody = AccountCancelAccountBody
1245
+ export type AccountCancelAccountMutationError = void
1246
+
1247
+ /**
1248
+ * @summary Add a cancellation request to an account. The account needs to be in subscribing stage.
1249
+ The stage will automatically change over to cancelling. If the account has a subscription
1250
+ attached to it then at the subscription renewal the subscription will end and the account
1251
+ will be automatically set to expired.
1252
+ */
1253
+ export const useAccountCancelAccount = <TError = void,
1254
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountCancelAccount>>, TError,{accountUid: string | null;data: AccountCancelAccountBody}, TContext>, request?: SecondParameter<typeof customFetch>}
1255
+ ): UseMutationResult<
1256
+ Awaited<ReturnType<typeof accountCancelAccount>>,
1257
+ TError,
1258
+ {accountUid: string | null;data: AccountCancelAccountBody},
1259
+ TContext
1260
+ > => {
1261
+
1262
+ const mutationOptions = getAccountCancelAccountMutationOptions(options);
1263
+
1264
+ return useMutation(mutationOptions);
1265
+ }
1266
+ /**
1267
+ * @summary Remove a previous cancellation request from an account.
1268
+ */
1269
+ export const accountRemoveCancellation = (
1270
+ accountUid: string | null,
1271
+ options?: SecondParameter<typeof customFetch>,) => {
1272
+
1273
+
1274
+ return customFetch<Blob>(
1275
+ {url: `/api/v1/crm/accounts/${accountUid}/remove-cancellation`, method: 'PUT',
1276
+ responseType: 'blob'
1277
+ },
1278
+ options);
1279
+ }
1280
+
1281
+
1282
+
1283
+ export const getAccountRemoveCancellationMutationOptions = <TError = void,
1284
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountRemoveCancellation>>, TError,{accountUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
1285
+ ): UseMutationOptions<Awaited<ReturnType<typeof accountRemoveCancellation>>, TError,{accountUid: string | null}, TContext> => {
1286
+
1287
+ const mutationKey = ['accountRemoveCancellation'];
1288
+ const {mutation: mutationOptions, request: requestOptions} = options ?
1289
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
1290
+ options
1291
+ : {...options, mutation: {...options.mutation, mutationKey}}
1292
+ : {mutation: { mutationKey, }, request: undefined};
1293
+
1294
+
1295
+
1296
+
1297
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof accountRemoveCancellation>>, {accountUid: string | null}> = (props) => {
1298
+ const {accountUid} = props ?? {};
1299
+
1300
+ return accountRemoveCancellation(accountUid,requestOptions)
1301
+ }
1302
+
1303
+
1304
+
1305
+
1306
+ return { mutationFn, ...mutationOptions }}
1307
+
1308
+ export type AccountRemoveCancellationMutationResult = NonNullable<Awaited<ReturnType<typeof accountRemoveCancellation>>>
1309
+
1310
+ export type AccountRemoveCancellationMutationError = void
1311
+
1312
+ /**
1313
+ * @summary Remove a previous cancellation request from an account.
1314
+ */
1315
+ export const useAccountRemoveCancellation = <TError = void,
1316
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountRemoveCancellation>>, TError,{accountUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
1317
+ ): UseMutationResult<
1318
+ Awaited<ReturnType<typeof accountRemoveCancellation>>,
1319
+ TError,
1320
+ {accountUid: string | null},
1321
+ TContext
1322
+ > => {
1323
+
1324
+ const mutationOptions = getAccountRemoveCancellationMutationOptions(options);
1325
+
1326
+ return useMutation(mutationOptions);
1327
+ }
1328
+ /**
1329
+ * @summary Extend the date that a trial subscription expires.
1330
+ */
1331
+ export const accountExtendTrial = (
1332
+ accountUid: string | null,
1333
+ accountExtendTrialBody: AccountExtendTrialBody,
1334
+ options?: SecondParameter<typeof customFetch>,) => {
1335
+
1336
+
1337
+ return customFetch<Blob>(
1338
+ {url: `/api/v1/crm/accounts/${accountUid}/extend-trial`, method: 'PUT',
1339
+ headers: {'Content-Type': 'application/json', },
1340
+ data: accountExtendTrialBody,
1341
+ responseType: 'blob'
1342
+ },
1343
+ options);
1344
+ }
1345
+
1346
+
1347
+
1348
+ export const getAccountExtendTrialMutationOptions = <TError = void,
1349
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountExtendTrial>>, TError,{accountUid: string | null;data: AccountExtendTrialBody}, TContext>, request?: SecondParameter<typeof customFetch>}
1350
+ ): UseMutationOptions<Awaited<ReturnType<typeof accountExtendTrial>>, TError,{accountUid: string | null;data: AccountExtendTrialBody}, TContext> => {
1351
+
1352
+ const mutationKey = ['accountExtendTrial'];
1353
+ const {mutation: mutationOptions, request: requestOptions} = options ?
1354
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
1355
+ options
1356
+ : {...options, mutation: {...options.mutation, mutationKey}}
1357
+ : {mutation: { mutationKey, }, request: undefined};
1358
+
1359
+
1360
+
1361
+
1362
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof accountExtendTrial>>, {accountUid: string | null;data: AccountExtendTrialBody}> = (props) => {
1363
+ const {accountUid,data} = props ?? {};
1364
+
1365
+ return accountExtendTrial(accountUid,data,requestOptions)
1366
+ }
1367
+
1368
+
1369
+
1370
+
1371
+ return { mutationFn, ...mutationOptions }}
1372
+
1373
+ export type AccountExtendTrialMutationResult = NonNullable<Awaited<ReturnType<typeof accountExtendTrial>>>
1374
+ export type AccountExtendTrialMutationBody = AccountExtendTrialBody
1375
+ export type AccountExtendTrialMutationError = void
1376
+
1377
+ /**
1378
+ * @summary Extend the date that a trial subscription expires.
1379
+ */
1380
+ export const useAccountExtendTrial = <TError = void,
1381
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountExtendTrial>>, TError,{accountUid: string | null;data: AccountExtendTrialBody}, TContext>, request?: SecondParameter<typeof customFetch>}
1382
+ ): UseMutationResult<
1383
+ Awaited<ReturnType<typeof accountExtendTrial>>,
1384
+ TError,
1385
+ {accountUid: string | null;data: AccountExtendTrialBody},
1386
+ TContext
1387
+ > => {
1388
+
1389
+ const mutationOptions = getAccountExtendTrialMutationOptions(options);
1390
+
1391
+ return useMutation(mutationOptions);
1392
+ }
1393
+ /**
1394
+ * @summary Send a confirmation email to people on an account. Pass personUid as a query parameter
1395
+ to send to a specific person, or personUid=* to send to all people on the account.
1396
+ If no personUid is provided, the email is sent to the primary contact.
1397
+ */
1398
+ export const accountSendConfirmationEmail = (
1399
+ accountUid: string | null,
1400
+ options?: SecondParameter<typeof customFetch>,) => {
1401
+
1402
+
1403
+ return customFetch<Blob>(
1404
+ {url: `/api/v1/crm/accounts/${accountUid}/send-confirmation-email`, method: 'PUT',
1405
+ responseType: 'blob'
1406
+ },
1407
+ options);
1408
+ }
1409
+
1410
+
1411
+
1412
+ export const getAccountSendConfirmationEmailMutationOptions = <TError = void,
1413
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountSendConfirmationEmail>>, TError,{accountUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
1414
+ ): UseMutationOptions<Awaited<ReturnType<typeof accountSendConfirmationEmail>>, TError,{accountUid: string | null}, TContext> => {
1415
+
1416
+ const mutationKey = ['accountSendConfirmationEmail'];
1417
+ const {mutation: mutationOptions, request: requestOptions} = options ?
1418
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
1419
+ options
1420
+ : {...options, mutation: {...options.mutation, mutationKey}}
1421
+ : {mutation: { mutationKey, }, request: undefined};
1422
+
1423
+
1424
+
1425
+
1426
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof accountSendConfirmationEmail>>, {accountUid: string | null}> = (props) => {
1427
+ const {accountUid} = props ?? {};
1428
+
1429
+ return accountSendConfirmationEmail(accountUid,requestOptions)
1430
+ }
1431
+
1432
+
1433
+
1434
+
1435
+ return { mutationFn, ...mutationOptions }}
1436
+
1437
+ export type AccountSendConfirmationEmailMutationResult = NonNullable<Awaited<ReturnType<typeof accountSendConfirmationEmail>>>
1438
+
1439
+ export type AccountSendConfirmationEmailMutationError = void
1440
+
1441
+ /**
1442
+ * @summary Send a confirmation email to people on an account. Pass personUid as a query parameter
1443
+ to send to a specific person, or personUid=* to send to all people on the account.
1444
+ If no personUid is provided, the email is sent to the primary contact.
1445
+ */
1446
+ export const useAccountSendConfirmationEmail = <TError = void,
1447
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountSendConfirmationEmail>>, TError,{accountUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
1448
+ ): UseMutationResult<
1449
+ Awaited<ReturnType<typeof accountSendConfirmationEmail>>,
1450
+ TError,
1451
+ {accountUid: string | null},
1452
+ TContext
1453
+ > => {
1454
+
1455
+ const mutationOptions = getAccountSendConfirmationEmailMutationOptions(options);
1456
+
1457
+ return useMutation(mutationOptions);
1458
+ }
1459
+ /**
1460
+ * @summary Retrieves all the people associated with your account.
1461
+ */
1462
+ export const personGetAllPeople = (
1463
+ params?: PersonGetAllPeopleParams,
1464
+ options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
1465
+ ) => {
1466
+
1467
+
1468
+ return customFetch<Person[]>(
1469
+ {url: `/api/v1/crm/people`, method: 'GET',
1470
+ params, signal
1471
+ },
1472
+ options);
1473
+ }
1474
+
1475
+
1476
+
1477
+
1478
+ export const getPersonGetAllPeopleQueryKey = (params?: PersonGetAllPeopleParams,) => {
1479
+ return [
1480
+ `/api/v1/crm/people`, ...(params ? [params]: [])
1481
+ ] as const;
1482
+ }
1483
+
1484
+
1485
+ export const getPersonGetAllPeopleQueryOptions = <TData = Awaited<ReturnType<typeof personGetAllPeople>>, TError = void>(params?: PersonGetAllPeopleParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof personGetAllPeople>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
1486
+ ) => {
1487
+
1488
+ const {query: queryOptions, request: requestOptions} = options ?? {};
1489
+
1490
+ const queryKey = queryOptions?.queryKey ?? getPersonGetAllPeopleQueryKey(params);
1491
+
1492
+
1493
+
1494
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof personGetAllPeople>>> = ({ signal }) => personGetAllPeople(params, requestOptions, signal);
1495
+
1496
+
1497
+
1498
+
1499
+
1500
+ return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof personGetAllPeople>>, TError, TData> & { queryKey: QueryKey }
1501
+ }
1502
+
1503
+ export type PersonGetAllPeopleQueryResult = NonNullable<Awaited<ReturnType<typeof personGetAllPeople>>>
1504
+ export type PersonGetAllPeopleQueryError = void
1505
+
1506
+
1507
+ /**
1508
+ * @summary Retrieves all the people associated with your account.
1509
+ */
1510
+
1511
+ export function usePersonGetAllPeople<TData = Awaited<ReturnType<typeof personGetAllPeople>>, TError = void>(
1512
+ params?: PersonGetAllPeopleParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof personGetAllPeople>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
1513
+
1514
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
1515
+
1516
+ const queryOptions = getPersonGetAllPeopleQueryOptions(params,options)
1517
+
1518
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
1519
+
1520
+ query.queryKey = queryOptions.queryKey ;
1521
+
1522
+ return query;
1523
+ }
1524
+
1525
+
1526
+
1527
+
1528
+ /**
1529
+ * @summary Add a new person.
1530
+ */
1531
+ export const personAddPerson = (
1532
+ personAddPersonBody: PersonAddPersonBody,
1533
+ options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
1534
+ ) => {
1535
+
1536
+
1537
+ return customFetch<Person>(
1538
+ {url: `/api/v1/crm/people`, method: 'POST',
1539
+ headers: {'Content-Type': 'application/json', },
1540
+ data: personAddPersonBody, signal
1541
+ },
1542
+ options);
1543
+ }
1544
+
1545
+
1546
+
1547
+ export const getPersonAddPersonMutationOptions = <TError = void,
1548
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof personAddPerson>>, TError,{data: PersonAddPersonBody}, TContext>, request?: SecondParameter<typeof customFetch>}
1549
+ ): UseMutationOptions<Awaited<ReturnType<typeof personAddPerson>>, TError,{data: PersonAddPersonBody}, TContext> => {
1550
+
1551
+ const mutationKey = ['personAddPerson'];
1552
+ const {mutation: mutationOptions, request: requestOptions} = options ?
1553
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
1554
+ options
1555
+ : {...options, mutation: {...options.mutation, mutationKey}}
1556
+ : {mutation: { mutationKey, }, request: undefined};
1557
+
1558
+
1559
+
1560
+
1561
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof personAddPerson>>, {data: PersonAddPersonBody}> = (props) => {
1562
+ const {data} = props ?? {};
1563
+
1564
+ return personAddPerson(data,requestOptions)
1565
+ }
1566
+
1567
+
1568
+
1569
+
1570
+ return { mutationFn, ...mutationOptions }}
1571
+
1572
+ export type PersonAddPersonMutationResult = NonNullable<Awaited<ReturnType<typeof personAddPerson>>>
1573
+ export type PersonAddPersonMutationBody = PersonAddPersonBody
1574
+ export type PersonAddPersonMutationError = void
1575
+
1576
+ /**
1577
+ * @summary Add a new person.
1578
+ */
1579
+ export const usePersonAddPerson = <TError = void,
1580
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof personAddPerson>>, TError,{data: PersonAddPersonBody}, TContext>, request?: SecondParameter<typeof customFetch>}
1581
+ ): UseMutationResult<
1582
+ Awaited<ReturnType<typeof personAddPerson>>,
1583
+ TError,
1584
+ {data: PersonAddPersonBody},
1585
+ TContext
1586
+ > => {
1587
+
1588
+ const mutationOptions = getPersonAddPersonMutationOptions(options);
1589
+
1590
+ return useMutation(mutationOptions);
1591
+ }
1592
+ /**
1593
+ * @summary Retrieves a person.
1594
+ */
1595
+ export const personGetPerson = (
1596
+ personUid: string | null,
1597
+ options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
1598
+ ) => {
1599
+
1600
+
1601
+ return customFetch<Person>(
1602
+ {url: `/api/v1/crm/people/${personUid}`, method: 'GET', signal
1603
+ },
1604
+ options);
1605
+ }
1606
+
1607
+
1608
+
1609
+
1610
+ export const getPersonGetPersonQueryKey = (personUid?: string | null,) => {
1611
+ return [
1612
+ `/api/v1/crm/people/${personUid}`
1613
+ ] as const;
1614
+ }
1615
+
1616
+
1617
+ export const getPersonGetPersonQueryOptions = <TData = Awaited<ReturnType<typeof personGetPerson>>, TError = void>(personUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof personGetPerson>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
1618
+ ) => {
1619
+
1620
+ const {query: queryOptions, request: requestOptions} = options ?? {};
1621
+
1622
+ const queryKey = queryOptions?.queryKey ?? getPersonGetPersonQueryKey(personUid);
1623
+
1624
+
1625
+
1626
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof personGetPerson>>> = ({ signal }) => personGetPerson(personUid, requestOptions, signal);
1627
+
1628
+
1629
+
1630
+
1631
+
1632
+ return { queryKey, queryFn, enabled: !!(personUid), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof personGetPerson>>, TError, TData> & { queryKey: QueryKey }
1633
+ }
1634
+
1635
+ export type PersonGetPersonQueryResult = NonNullable<Awaited<ReturnType<typeof personGetPerson>>>
1636
+ export type PersonGetPersonQueryError = void
1637
+
1638
+
1639
+ /**
1640
+ * @summary Retrieves a person.
1641
+ */
1642
+
1643
+ export function usePersonGetPerson<TData = Awaited<ReturnType<typeof personGetPerson>>, TError = void>(
1644
+ personUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof personGetPerson>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
1645
+
1646
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
1647
+
1648
+ const queryOptions = getPersonGetPersonQueryOptions(personUid,options)
1649
+
1650
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
1651
+
1652
+ query.queryKey = queryOptions.queryKey ;
1653
+
1654
+ return query;
1655
+ }
1656
+
1657
+
1658
+
1659
+
1660
+ /**
1661
+ * @summary Update a person record. You can update one or multiple properties on the object.
1662
+ Any property that you include in the json schema will be updated.
1663
+ To update custom properties just include them in the same way that they are included when you do a get on the object.
1664
+ */
1665
+ export const personUpdatePerson = (
1666
+ personUid: string | null,
1667
+ personUpdatePersonBody: PersonUpdatePersonBody,
1668
+ options?: SecondParameter<typeof customFetch>,) => {
1669
+
1670
+
1671
+ return customFetch<Person>(
1672
+ {url: `/api/v1/crm/people/${personUid}`, method: 'PUT',
1673
+ headers: {'Content-Type': 'application/json', },
1674
+ data: personUpdatePersonBody
1675
+ },
1676
+ options);
1677
+ }
1678
+
1679
+
1680
+
1681
+ export const getPersonUpdatePersonMutationOptions = <TError = void,
1682
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof personUpdatePerson>>, TError,{personUid: string | null;data: PersonUpdatePersonBody}, TContext>, request?: SecondParameter<typeof customFetch>}
1683
+ ): UseMutationOptions<Awaited<ReturnType<typeof personUpdatePerson>>, TError,{personUid: string | null;data: PersonUpdatePersonBody}, TContext> => {
1684
+
1685
+ const mutationKey = ['personUpdatePerson'];
1686
+ const {mutation: mutationOptions, request: requestOptions} = options ?
1687
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
1688
+ options
1689
+ : {...options, mutation: {...options.mutation, mutationKey}}
1690
+ : {mutation: { mutationKey, }, request: undefined};
1691
+
1692
+
1693
+
1694
+
1695
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof personUpdatePerson>>, {personUid: string | null;data: PersonUpdatePersonBody}> = (props) => {
1696
+ const {personUid,data} = props ?? {};
1697
+
1698
+ return personUpdatePerson(personUid,data,requestOptions)
1699
+ }
1700
+
1701
+
1702
+
1703
+
1704
+ return { mutationFn, ...mutationOptions }}
1705
+
1706
+ export type PersonUpdatePersonMutationResult = NonNullable<Awaited<ReturnType<typeof personUpdatePerson>>>
1707
+ export type PersonUpdatePersonMutationBody = PersonUpdatePersonBody
1708
+ export type PersonUpdatePersonMutationError = void
1709
+
1710
+ /**
1711
+ * @summary Update a person record. You can update one or multiple properties on the object.
1712
+ Any property that you include in the json schema will be updated.
1713
+ To update custom properties just include them in the same way that they are included when you do a get on the object.
1714
+ */
1715
+ export const usePersonUpdatePerson = <TError = void,
1716
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof personUpdatePerson>>, TError,{personUid: string | null;data: PersonUpdatePersonBody}, TContext>, request?: SecondParameter<typeof customFetch>}
1717
+ ): UseMutationResult<
1718
+ Awaited<ReturnType<typeof personUpdatePerson>>,
1719
+ TError,
1720
+ {personUid: string | null;data: PersonUpdatePersonBody},
1721
+ TContext
1722
+ > => {
1723
+
1724
+ const mutationOptions = getPersonUpdatePersonMutationOptions(options);
1725
+
1726
+ return useMutation(mutationOptions);
1727
+ }
1728
+ /**
1729
+ * @summary Delete a person record.
1730
+ */
1731
+ export const personDeletePerson = (
1732
+ personUid: string | null,
1733
+ options?: SecondParameter<typeof customFetch>,) => {
1734
+
1735
+
1736
+ return customFetch<Blob>(
1737
+ {url: `/api/v1/crm/people/${personUid}`, method: 'DELETE',
1738
+ responseType: 'blob'
1739
+ },
1740
+ options);
1741
+ }
1742
+
1743
+
1744
+
1745
+ export const getPersonDeletePersonMutationOptions = <TError = void,
1746
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof personDeletePerson>>, TError,{personUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
1747
+ ): UseMutationOptions<Awaited<ReturnType<typeof personDeletePerson>>, TError,{personUid: string | null}, TContext> => {
1748
+
1749
+ const mutationKey = ['personDeletePerson'];
1750
+ const {mutation: mutationOptions, request: requestOptions} = options ?
1751
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
1752
+ options
1753
+ : {...options, mutation: {...options.mutation, mutationKey}}
1754
+ : {mutation: { mutationKey, }, request: undefined};
1755
+
1756
+
1757
+
1758
+
1759
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof personDeletePerson>>, {personUid: string | null}> = (props) => {
1760
+ const {personUid} = props ?? {};
1761
+
1762
+ return personDeletePerson(personUid,requestOptions)
1763
+ }
1764
+
1765
+
1766
+
1767
+
1768
+ return { mutationFn, ...mutationOptions }}
1769
+
1770
+ export type PersonDeletePersonMutationResult = NonNullable<Awaited<ReturnType<typeof personDeletePerson>>>
1771
+
1772
+ export type PersonDeletePersonMutationError = void
1773
+
1774
+ /**
1775
+ * @summary Delete a person record.
1776
+ */
1777
+ export const usePersonDeletePerson = <TError = void,
1778
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof personDeletePerson>>, TError,{personUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
1779
+ ): UseMutationResult<
1780
+ Awaited<ReturnType<typeof personDeletePerson>>,
1781
+ TError,
1782
+ {personUid: string | null},
1783
+ TContext
1784
+ > => {
1785
+
1786
+ const mutationOptions = getPersonDeletePersonMutationOptions(options);
1787
+
1788
+ return useMutation(mutationOptions);
1789
+ }
1790
+ /**
1791
+ * @summary Set a temporary password for a user. The user needs to update the password with the next login.
1792
+ */
1793
+ export const personSetTemporaryPassword = (
1794
+ personUid: string | null,
1795
+ personSetTemporaryPasswordBody: PersonSetTemporaryPasswordBody,
1796
+ options?: SecondParameter<typeof customFetch>,) => {
1797
+
1798
+
1799
+ return customFetch<Blob>(
1800
+ {url: `/api/v1/crm/people/${personUid}/setTemporaryPassword`, method: 'PUT',
1801
+ headers: {'Content-Type': 'application/json', },
1802
+ data: personSetTemporaryPasswordBody,
1803
+ responseType: 'blob'
1804
+ },
1805
+ options);
1806
+ }
1807
+
1808
+
1809
+
1810
+ export const getPersonSetTemporaryPasswordMutationOptions = <TError = void,
1811
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof personSetTemporaryPassword>>, TError,{personUid: string | null;data: PersonSetTemporaryPasswordBody}, TContext>, request?: SecondParameter<typeof customFetch>}
1812
+ ): UseMutationOptions<Awaited<ReturnType<typeof personSetTemporaryPassword>>, TError,{personUid: string | null;data: PersonSetTemporaryPasswordBody}, TContext> => {
1813
+
1814
+ const mutationKey = ['personSetTemporaryPassword'];
1815
+ const {mutation: mutationOptions, request: requestOptions} = options ?
1816
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
1817
+ options
1818
+ : {...options, mutation: {...options.mutation, mutationKey}}
1819
+ : {mutation: { mutationKey, }, request: undefined};
1820
+
1821
+
1822
+
1823
+
1824
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof personSetTemporaryPassword>>, {personUid: string | null;data: PersonSetTemporaryPasswordBody}> = (props) => {
1825
+ const {personUid,data} = props ?? {};
1826
+
1827
+ return personSetTemporaryPassword(personUid,data,requestOptions)
1828
+ }
1829
+
1830
+
1831
+
1832
+
1833
+ return { mutationFn, ...mutationOptions }}
1834
+
1835
+ export type PersonSetTemporaryPasswordMutationResult = NonNullable<Awaited<ReturnType<typeof personSetTemporaryPassword>>>
1836
+ export type PersonSetTemporaryPasswordMutationBody = PersonSetTemporaryPasswordBody
1837
+ export type PersonSetTemporaryPasswordMutationError = void
1838
+
1839
+ /**
1840
+ * @summary Set a temporary password for a user. The user needs to update the password with the next login.
1841
+ */
1842
+ export const usePersonSetTemporaryPassword = <TError = void,
1843
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof personSetTemporaryPassword>>, TError,{personUid: string | null;data: PersonSetTemporaryPasswordBody}, TContext>, request?: SecondParameter<typeof customFetch>}
1844
+ ): UseMutationResult<
1845
+ Awaited<ReturnType<typeof personSetTemporaryPassword>>,
1846
+ TError,
1847
+ {personUid: string | null;data: PersonSetTemporaryPasswordBody},
1848
+ TContext
1849
+ > => {
1850
+
1851
+ const mutationOptions = getPersonSetTemporaryPasswordMutationOptions(options);
1852
+
1853
+ return useMutation(mutationOptions);
1854
+ }
1855
+ /**
1856
+ * @summary Initiate the forgot password flow by sending an email to the user with a link to a page
1857
+ where they can reset their password. The reset password token in the link is valid for 30 minutes.
1858
+ */
1859
+ export const personForgotPassword = (
1860
+ personForgotPasswordBody: PersonForgotPasswordBody,
1861
+ options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
1862
+ ) => {
1863
+
1864
+
1865
+ return customFetch<Blob>(
1866
+ {url: `/api/v1/crm/people/forgotPassword`, method: 'POST',
1867
+ headers: {'Content-Type': 'application/json', },
1868
+ data: personForgotPasswordBody,
1869
+ responseType: 'blob', signal
1870
+ },
1871
+ options);
1872
+ }
1873
+
1874
+
1875
+
1876
+ export const getPersonForgotPasswordMutationOptions = <TError = unknown,
1877
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof personForgotPassword>>, TError,{data: PersonForgotPasswordBody}, TContext>, request?: SecondParameter<typeof customFetch>}
1878
+ ): UseMutationOptions<Awaited<ReturnType<typeof personForgotPassword>>, TError,{data: PersonForgotPasswordBody}, TContext> => {
1879
+
1880
+ const mutationKey = ['personForgotPassword'];
1881
+ const {mutation: mutationOptions, request: requestOptions} = options ?
1882
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
1883
+ options
1884
+ : {...options, mutation: {...options.mutation, mutationKey}}
1885
+ : {mutation: { mutationKey, }, request: undefined};
1886
+
1887
+
1888
+
1889
+
1890
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof personForgotPassword>>, {data: PersonForgotPasswordBody}> = (props) => {
1891
+ const {data} = props ?? {};
1892
+
1893
+ return personForgotPassword(data,requestOptions)
1894
+ }
1895
+
1896
+
1897
+
1898
+
1899
+ return { mutationFn, ...mutationOptions }}
1900
+
1901
+ export type PersonForgotPasswordMutationResult = NonNullable<Awaited<ReturnType<typeof personForgotPassword>>>
1902
+ export type PersonForgotPasswordMutationBody = PersonForgotPasswordBody
1903
+ export type PersonForgotPasswordMutationError = unknown
1904
+
1905
+ /**
1906
+ * @summary Initiate the forgot password flow by sending an email to the user with a link to a page
1907
+ where they can reset their password. The reset password token in the link is valid for 30 minutes.
1908
+ */
1909
+ export const usePersonForgotPassword = <TError = unknown,
1910
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof personForgotPassword>>, TError,{data: PersonForgotPasswordBody}, TContext>, request?: SecondParameter<typeof customFetch>}
1911
+ ): UseMutationResult<
1912
+ Awaited<ReturnType<typeof personForgotPassword>>,
1913
+ TError,
1914
+ {data: PersonForgotPasswordBody},
1915
+ TContext
1916
+ > => {
1917
+
1918
+ const mutationOptions = getPersonForgotPasswordMutationOptions(options);
1919
+
1920
+ return useMutation(mutationOptions);
1921
+ }
1922
+