@outseta/react 0.2.0 → 0.2.2

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.
@@ -1,224 +1,4 @@
1
1
  // @ts-nocheck
2
- /**
3
- * Generated by orval v7.21.0 🍺
4
- * Do not edit manually.
5
- * Outseta API
6
- * # Outseta REST API
7
-
8
- The Outseta REST API enables you to perform a variety of powerful tasks such as creating and updating people, accounts, subscriptions, and invoices. Outseta uses standard HTTP protocols within a compliant architecture that is simple to integrate. You can use the API both on the client or the server side; see the authentication section below for each scenario.
9
-
10
- **Base URL:** `https://{your-domain}.outseta.com/api/v1/`
11
-
12
- ## API Guidelines
13
-
14
- 1. The API will only respond to secured communication done over **HTTPS**. HTTP requests will be sent a `301` redirect to the corresponding HTTPS resource.
15
- 2. Responses are sent in **JSON** format. In case the API request results in an error, it is represented by an `"error": {}` key in the JSON response.
16
- 3. The request method (verb) determines the nature of the action: **GET** fetches data, **POST** creates new records, **PUT** updates existing records.
17
- 4. The API responds with appropriate **HTTP status codes** for all requests.
18
- 5. Use `donotlog=1` as a query parameter on any API call where you don't want the action to be logged in the activity log.
19
-
20
- ## Authentication
21
-
22
- All API requests require authentication via one of two methods:
23
-
24
- ### Server-Side (API Keys)
25
-
26
- Use API keys for server-to-server integrations. Create keys at **Settings > Integrations > API Keys**. Make sure to record the secret key when you create it.
27
-
28
- ```
29
- Authorization: Outseta {api_key}:{api_secret}
30
- ```
31
-
32
- **Example:**
33
- ```
34
- Authorization: Outseta ce08fd5a-e1ee-4472-9c5f-b7575d8369b2:74fc1d2242a4eb7336d34b0e40cfbc5f
35
- ```
36
-
37
- > **Warning:** Never expose API keys in client-side code. The API key and secret combined give full access to all data in your account.
38
-
39
- ### Client-Side (Bearer Token)
40
-
41
- Do **not** use API keys on the client side — they can be easily copied. Instead, obtain a JWT access token by calling the `POST /tokens` endpoint from the server side with your credentials, then use it on the client:
42
-
43
- ```
44
- Authorization: bearer {access_token}
45
- ```
46
-
47
- Tokens are JWTs containing claims such as `PersonUid`, `AccountUid`, and subscription details. Tokens expire after approximately one year.
48
-
49
- Verify tokens server-side using Outseta's [JWKS endpoint](https://{your-domain}.outseta.com/.well-known/jwks.json).
50
-
51
- ## Field Selection
52
-
53
- When you make an API request, you'll automatically get all the basic information from the main object and its immediate child objects. Referenced objects beyond the first level are returned as `null`.
54
-
55
- Change this behavior using the `fields` query parameter:
56
-
57
- - **Go deeper** — Request fields lower down in the object tree: `?fields=CurrentSubscription.Plan.*`
58
- - **Go lighter** — Request only the essentials for faster performance: `?fields=Uid,Name`
59
- - **Combination** — `?fields=Uid,Name,CurrentSubscription.Plan.Uid`
60
- - **Wildcard** — Use `*` to get all fields in an object: `?fields=*` or `?fields=CurrentSubscription.Plan.*`
61
-
62
- > **Tip:** When expanding nested paths, include `*` and intermediate path segments (e.g., `PersonAccount.*`) to preserve root-level and intermediate fields.
63
-
64
- **Examples:**
65
-
66
- ```
67
- # Get the current subscription plan UID for an account
68
- GET /crm/accounts/{uid}?fields=CurrentSubscription.Plan.Uid
69
-
70
- # Get the account UID and plan UID for a list of accounts
71
- GET /crm/accounts?fields=Uid,CurrentSubscription.Plan.Uid
72
-
73
- # Get the full plan object for an account's current subscription
74
- GET /crm/accounts/{uid}?fields=CurrentSubscription.Plan.*
75
-
76
- # Get a person with their account and subscription info
77
- GET /crm/people/{uid}?fields=Uid,PersonAccount.Account.CurrentSubscription.Plan.Uid
78
- ```
79
-
80
- If your request includes fields from a child object you will be limited to retrieving **25 items** per page. The maximum for requests not expanding child object fields is **100 items**.
81
-
82
- ## Pagination
83
-
84
- List endpoints return paginated results with a `metadata` object and an `items` array:
85
-
86
- ```json
87
- {
88
- "metadata": {
89
- "limit": 25,
90
- "offset": 0,
91
- "total": 142
92
- },
93
- "items": [ ... ]
94
- }
95
- ```
96
-
97
- | Parameter | Type | Default | Description |
98
- |-----------|------|---------|-------------|
99
- | `offset` | integer | `0` | Page number (zero-based) |
100
- | `limit` | integer | `25` | Maximum number of records per page |
101
-
102
- **Examples:**
103
- ```
104
- ?offset=0&limit=20 # returns results 1-20
105
- ?offset=1&limit=20 # returns results 21-40
106
- ```
107
-
108
- ## Sorting
109
-
110
- Sort results using the `orderBy` parameter with a property name and direction:
111
-
112
- ```
113
- ?orderBy=PropertyName+DESC
114
- ```
115
-
116
- ## Filtering
117
-
118
- Filter results by passing entity properties as query parameters.
119
-
120
- ### Basic Filtering
121
-
122
- Filter on any field using the field name as a query parameter:
123
-
124
- ```
125
- GET /crm/people?Email=john@example.com
126
- GET /crm/accounts?AccountStage=2
127
- ```
128
-
129
- ### Wildcard Matching
130
-
131
- | Pattern | Match Type | Example |
132
- |---------|-----------|---------|
133
- | `*value` | Ends with | `?Email=*@example.com` |
134
- | `value*` | Starts with | `?Name=Acme*` |
135
- | `*value*` | Contains | `?Name=*corp*` |
136
-
137
- ### Comparison Operators
138
-
139
- For advanced filtering, append comparison operators to field names:
140
-
141
- | Operator | Description | Example |
142
- |----------|-------------|---------|
143
- | `__gt` | Greater than | `Created__gt=2024-01-01` |
144
- | `__gte` | Greater than or equal | `Amount__gte=100` |
145
- | `__lt` | Less than | `Created__lt=2024-12-31` |
146
- | `__lte` | Less than or equal | `Amount__lte=500` |
147
- | `__ne` | Not equal | `Status__ne=Active` |
148
- | `__isnull` | Is null (true/false) | `ProfileImageS3Url__isnull=true` |
149
-
150
- **Examples:**
151
-
152
- ```
153
- # Date filtering
154
- GET /crm/accounts?Created__gt=2024-01-01
155
- GET /billing/subscriptions?EndDate__lt=2024-08-01
156
-
157
- # Numeric filtering
158
- GET /billing/invoices?Amount__gte=1000
159
-
160
- # Null value filtering
161
- GET /crm/people?ProfileImageS3Url__isnull=true
162
-
163
- # Multiple filters combined with field selection
164
- GET /billing/subscriptions?StartDate__gte=2024-01-01&Rate__lt=100&DiscountCode__isnull=false&fields=Uid,Amount,StartDate,DiscountCode,Plan.Name
165
- ```
166
-
167
- ## Account Billing Stages
168
-
169
- Account stages reflect the financial standing of each account and are not directly editable — they change automatically based on subscription activity.
170
-
171
- | Value | Stage | Description |
172
- |-------|-------|-------------|
173
- | `2` | Trialing | Currently on a free trial or free plan |
174
- | `3` | Subscribing | Active paid subscription (contributes to MRR) |
175
- | `4` | Canceling | Customer has indicated intent to cancel |
176
- | `5` | Expired | Subscription has ended after cancellation |
177
- | `6` | Trial Expired | Free trial ended without conversion to paid |
178
-
179
- Filter by stage: `GET /crm/accounts?AccountStage=3` returns all actively subscribing accounts.
180
-
181
- ## Webhooks
182
-
183
- Use **Activity Notifications** to receive real-time callbacks when events occur in Outseta. Configure webhooks at **Settings > Notifications**.
184
-
185
- Common events include:
186
- - `Person Created` / `Person Updated`
187
- - `Account Created` / `Account Updated`
188
- - `Subscription Created` / `Subscription Updated`
189
-
190
- Always verify webhook signatures using the SHA256 secret provided in the Outseta dashboard.
191
-
192
- ## Error Responses
193
-
194
- | Status Code | Description |
195
- |-------------|-------------|
196
- | `200` | Success |
197
- | `301` | Redirect — HTTP requests are redirected to HTTPS |
198
- | `400` | Bad request — invalid parameters or Uid format |
199
- | `401` | Unauthorized — missing or invalid authentication |
200
- | `404` | Entity not found |
201
- | `4XX` / `5XX` | Client or server error |
202
-
203
- Validation errors return a JSON body with `ErrorMessage` and `PropertyName` fields:
204
-
205
- ```json
206
- {
207
- "ErrorMessage": "Invalid company email",
208
- "PropertyName": "Email"
209
- }
210
- ```
211
-
212
- ## Rate Limits
213
-
214
- Requests authorized by an API Key should not exceed **4 requests/second**.
215
-
216
- ## Support
217
-
218
- For help regarding the Outseta API please email [support@outseta.com](mailto:support@outseta.com).
219
-
220
- * OpenAPI spec version: v1
221
- */
222
2
  import {
223
3
  useMutation,
224
4
  useQuery
@@ -237,7 +17,23 @@ import type {
237
17
  Account,
238
18
  AccountAddAccountBody,
239
19
  AccountAddAccountParams,
240
- AccountGetAllAccountsParams
20
+ AccountAddPersonToAccountBody,
21
+ AccountCancelAccountBody,
22
+ AccountExtendTrialBody,
23
+ AccountGetAllAccountsParams,
24
+ AccountUpdateAccountBody,
25
+ AccountUpdateMembershipBody,
26
+ Deal,
27
+ DealAddDealBody,
28
+ DealGetAllDealsParams,
29
+ DealUpdateDealBody,
30
+ Person,
31
+ PersonAccount,
32
+ PersonAddPersonBody,
33
+ PersonForgotPasswordBody,
34
+ PersonGetAllPeopleParams,
35
+ PersonSetTemporaryPasswordBody,
36
+ PersonUpdatePersonBody
241
37
  } from '../outsetaAPI.schemas';
242
38
 
243
39
  import { customFetch } from '../../mutator';
@@ -248,16 +44,16 @@ type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
248
44
 
249
45
 
250
46
  /**
251
- * @summary Returns all accounts, optionally filtered by segment or search query.
47
+ * @summary Retrieves all the deals associated with your account.
252
48
  */
253
- export const accountGetAllAccounts = (
254
- params?: AccountGetAllAccountsParams,
49
+ export const dealGetAllDeals = (
50
+ params?: DealGetAllDealsParams,
255
51
  options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
256
52
  ) => {
257
53
 
258
54
 
259
- return customFetch<Account[]>(
260
- {url: `/api/v1/crm/accounts`, method: 'GET',
55
+ return customFetch<Deal[]>(
56
+ {url: `/api/v1/crm/deals`, method: 'GET',
261
57
  params, signal
262
58
  },
263
59
  options);
@@ -266,45 +62,45 @@ export const accountGetAllAccounts = (
266
62
 
267
63
 
268
64
 
269
- export const getAccountGetAllAccountsQueryKey = (params?: AccountGetAllAccountsParams,) => {
65
+ export const getDealGetAllDealsQueryKey = (params?: DealGetAllDealsParams,) => {
270
66
  return [
271
- `/api/v1/crm/accounts`, ...(params ? [params]: [])
67
+ `/api/v1/crm/deals`, ...(params ? [params]: [])
272
68
  ] as const;
273
69
  }
274
70
 
275
71
 
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>}
72
+ 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
73
  ) => {
278
74
 
279
75
  const {query: queryOptions, request: requestOptions} = options ?? {};
280
76
 
281
- const queryKey = queryOptions?.queryKey ?? getAccountGetAllAccountsQueryKey(params);
77
+ const queryKey = queryOptions?.queryKey ?? getDealGetAllDealsQueryKey(params);
282
78
 
283
79
 
284
80
 
285
- const queryFn: QueryFunction<Awaited<ReturnType<typeof accountGetAllAccounts>>> = ({ signal }) => accountGetAllAccounts(params, requestOptions, signal);
81
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof dealGetAllDeals>>> = ({ signal }) => dealGetAllDeals(params, requestOptions, signal);
286
82
 
287
83
 
288
84
 
289
85
 
290
86
 
291
- return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof accountGetAllAccounts>>, TError, TData> & { queryKey: QueryKey }
87
+ return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof dealGetAllDeals>>, TError, TData> & { queryKey: QueryKey }
292
88
  }
293
89
 
294
- export type AccountGetAllAccountsQueryResult = NonNullable<Awaited<ReturnType<typeof accountGetAllAccounts>>>
295
- export type AccountGetAllAccountsQueryError = void
90
+ export type DealGetAllDealsQueryResult = NonNullable<Awaited<ReturnType<typeof dealGetAllDeals>>>
91
+ export type DealGetAllDealsQueryError = void
296
92
 
297
93
 
298
94
  /**
299
- * @summary Returns all accounts, optionally filtered by segment or search query.
95
+ * @summary Retrieves all the deals associated with your account.
300
96
  */
301
97
 
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>}
98
+ export function useDealGetAllDeals<TData = Awaited<ReturnType<typeof dealGetAllDeals>>, TError = void>(
99
+ params?: DealGetAllDealsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof dealGetAllDeals>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
304
100
 
305
101
  ): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
306
102
 
307
- const queryOptions = getAccountGetAllAccountsQueryOptions(params,options)
103
+ const queryOptions = getDealGetAllDealsQueryOptions(params,options)
308
104
 
309
105
  const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
310
106
 
@@ -317,34 +113,29 @@ export function useAccountGetAllAccounts<TData = Awaited<ReturnType<typeof accou
317
113
 
318
114
 
319
115
  /**
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" } ] }
116
+ * @summary Add a new deal.
323
117
  */
324
- export const accountAddAccount = (
325
- accountAddAccountBody: AccountAddAccountBody,
326
- params?: AccountAddAccountParams,
118
+ export const dealAddDeal = (
119
+ dealAddDealBody: DealAddDealBody,
327
120
  options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
328
121
  ) => {
329
122
 
330
123
 
331
- return customFetch<Blob>(
332
- {url: `/api/v1/crm/accounts`, method: 'POST',
124
+ return customFetch<Deal>(
125
+ {url: `/api/v1/crm/deals`, method: 'POST',
333
126
  headers: {'Content-Type': 'application/json', },
334
- data: accountAddAccountBody,
335
- params,
336
- responseType: 'blob', signal
127
+ data: dealAddDealBody, signal
337
128
  },
338
129
  options);
339
130
  }
340
131
 
341
132
 
342
133
 
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> => {
134
+ export const getDealAddDealMutationOptions = <TError = void,
135
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof dealAddDeal>>, TError,{data: DealAddDealBody}, TContext>, request?: SecondParameter<typeof customFetch>}
136
+ ): UseMutationOptions<Awaited<ReturnType<typeof dealAddDeal>>, TError,{data: DealAddDealBody}, TContext> => {
346
137
 
347
- const mutationKey = ['accountAddAccount'];
138
+ const mutationKey = ['dealAddDeal'];
348
139
  const {mutation: mutationOptions, request: requestOptions} = options ?
349
140
  options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
350
141
  options
@@ -354,10 +145,10 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
354
145
 
355
146
 
356
147
 
357
- const mutationFn: MutationFunction<Awaited<ReturnType<typeof accountAddAccount>>, {data: AccountAddAccountBody;params?: AccountAddAccountParams}> = (props) => {
358
- const {data,params} = props ?? {};
148
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof dealAddDeal>>, {data: DealAddDealBody}> = (props) => {
149
+ const {data} = props ?? {};
359
150
 
360
- return accountAddAccount(data,params,requestOptions)
151
+ return dealAddDeal(data,requestOptions)
361
152
  }
362
153
 
363
154
 
@@ -365,39 +156,37 @@ const {mutation: mutationOptions, request: requestOptions} = options ?
365
156
 
366
157
  return { mutationFn, ...mutationOptions }}
367
158
 
368
- export type AccountAddAccountMutationResult = NonNullable<Awaited<ReturnType<typeof accountAddAccount>>>
369
- export type AccountAddAccountMutationBody = AccountAddAccountBody
370
- export type AccountAddAccountMutationError = void
159
+ export type DealAddDealMutationResult = NonNullable<Awaited<ReturnType<typeof dealAddDeal>>>
160
+ export type DealAddDealMutationBody = DealAddDealBody
161
+ export type DealAddDealMutationError = void
371
162
 
372
163
  /**
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" } ] }
164
+ * @summary Add a new deal.
376
165
  */
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>}
166
+ export const useDealAddDeal = <TError = void,
167
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof dealAddDeal>>, TError,{data: DealAddDealBody}, TContext>, request?: SecondParameter<typeof customFetch>}
379
168
  ): UseMutationResult<
380
- Awaited<ReturnType<typeof accountAddAccount>>,
169
+ Awaited<ReturnType<typeof dealAddDeal>>,
381
170
  TError,
382
- {data: AccountAddAccountBody;params?: AccountAddAccountParams},
171
+ {data: DealAddDealBody},
383
172
  TContext
384
173
  > => {
385
174
 
386
- const mutationOptions = getAccountAddAccountMutationOptions(options);
175
+ const mutationOptions = getDealAddDealMutationOptions(options);
387
176
 
388
177
  return useMutation(mutationOptions);
389
178
  }
390
179
  /**
391
- * @summary Returns a single account by UID.
180
+ * @summary Retrieves one deal associated with your account.
392
181
  */
393
- export const accountGetAccount = (
394
- accountUid: string | null,
182
+ export const dealGetDeal = (
183
+ dealUid: string | null,
395
184
  options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
396
185
  ) => {
397
186
 
398
187
 
399
- return customFetch<Account>(
400
- {url: `/api/v1/crm/accounts/${accountUid}`, method: 'GET', signal
188
+ return customFetch<Deal>(
189
+ {url: `/api/v1/crm/deals/${dealUid}`, method: 'GET', signal
401
190
  },
402
191
  options);
403
192
  }
@@ -405,45 +194,45 @@ export const accountGetAccount = (
405
194
 
406
195
 
407
196
 
408
- export const getAccountGetAccountQueryKey = (accountUid?: string | null,) => {
197
+ export const getDealGetDealQueryKey = (dealUid?: string | null,) => {
409
198
  return [
410
- `/api/v1/crm/accounts/${accountUid}`
199
+ `/api/v1/crm/deals/${dealUid}`
411
200
  ] as const;
412
201
  }
413
202
 
414
203
 
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>}
204
+ 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>}
416
205
  ) => {
417
206
 
418
207
  const {query: queryOptions, request: requestOptions} = options ?? {};
419
208
 
420
- const queryKey = queryOptions?.queryKey ?? getAccountGetAccountQueryKey(accountUid);
209
+ const queryKey = queryOptions?.queryKey ?? getDealGetDealQueryKey(dealUid);
421
210
 
422
211
 
423
212
 
424
- const queryFn: QueryFunction<Awaited<ReturnType<typeof accountGetAccount>>> = ({ signal }) => accountGetAccount(accountUid, requestOptions, signal);
213
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof dealGetDeal>>> = ({ signal }) => dealGetDeal(dealUid, requestOptions, signal);
425
214
 
426
215
 
427
216
 
428
217
 
429
218
 
430
- return { queryKey, queryFn, enabled: !!(accountUid), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof accountGetAccount>>, TError, TData> & { queryKey: QueryKey }
219
+ return { queryKey, queryFn, enabled: !!(dealUid), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof dealGetDeal>>, TError, TData> & { queryKey: QueryKey }
431
220
  }
432
221
 
433
- export type AccountGetAccountQueryResult = NonNullable<Awaited<ReturnType<typeof accountGetAccount>>>
434
- export type AccountGetAccountQueryError = void
222
+ export type DealGetDealQueryResult = NonNullable<Awaited<ReturnType<typeof dealGetDeal>>>
223
+ export type DealGetDealQueryError = void
435
224
 
436
225
 
437
226
  /**
438
- * @summary Returns a single account by UID.
227
+ * @summary Retrieves one deal associated with your account.
439
228
  */
440
229
 
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>}
230
+ export function useDealGetDeal<TData = Awaited<ReturnType<typeof dealGetDeal>>, TError = void>(
231
+ dealUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof dealGetDeal>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
443
232
 
444
233
  ): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
445
234
 
446
- const queryOptions = getAccountGetAccountQueryOptions(accountUid,options)
235
+ const queryOptions = getDealGetDealQueryOptions(dealUid,options)
447
236
 
448
237
  const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
449
238
 
@@ -455,3 +244,1459 @@ export function useAccountGetAccount<TData = Awaited<ReturnType<typeof accountGe
455
244
 
456
245
 
457
246
 
247
+ /**
248
+ * @summary Update a deal.
249
+ */
250
+ export const dealUpdateDeal = (
251
+ dealUid: string | null,
252
+ dealUpdateDealBody: DealUpdateDealBody,
253
+ options?: SecondParameter<typeof customFetch>,) => {
254
+
255
+
256
+ return customFetch<Deal>(
257
+ {url: `/api/v1/crm/deals/${dealUid}`, method: 'PUT',
258
+ headers: {'Content-Type': 'application/json', },
259
+ data: dealUpdateDealBody
260
+ },
261
+ options);
262
+ }
263
+
264
+
265
+
266
+ export const getDealUpdateDealMutationOptions = <TError = void,
267
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof dealUpdateDeal>>, TError,{dealUid: string | null;data: DealUpdateDealBody}, TContext>, request?: SecondParameter<typeof customFetch>}
268
+ ): UseMutationOptions<Awaited<ReturnType<typeof dealUpdateDeal>>, TError,{dealUid: string | null;data: DealUpdateDealBody}, TContext> => {
269
+
270
+ const mutationKey = ['dealUpdateDeal'];
271
+ const {mutation: mutationOptions, request: requestOptions} = options ?
272
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
273
+ options
274
+ : {...options, mutation: {...options.mutation, mutationKey}}
275
+ : {mutation: { mutationKey, }, request: undefined};
276
+
277
+
278
+
279
+
280
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof dealUpdateDeal>>, {dealUid: string | null;data: DealUpdateDealBody}> = (props) => {
281
+ const {dealUid,data} = props ?? {};
282
+
283
+ return dealUpdateDeal(dealUid,data,requestOptions)
284
+ }
285
+
286
+
287
+
288
+
289
+ return { mutationFn, ...mutationOptions }}
290
+
291
+ export type DealUpdateDealMutationResult = NonNullable<Awaited<ReturnType<typeof dealUpdateDeal>>>
292
+ export type DealUpdateDealMutationBody = DealUpdateDealBody
293
+ export type DealUpdateDealMutationError = void
294
+
295
+ /**
296
+ * @summary Update a deal.
297
+ */
298
+ export const useDealUpdateDeal = <TError = void,
299
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof dealUpdateDeal>>, TError,{dealUid: string | null;data: DealUpdateDealBody}, TContext>, request?: SecondParameter<typeof customFetch>}
300
+ ): UseMutationResult<
301
+ Awaited<ReturnType<typeof dealUpdateDeal>>,
302
+ TError,
303
+ {dealUid: string | null;data: DealUpdateDealBody},
304
+ TContext
305
+ > => {
306
+
307
+ const mutationOptions = getDealUpdateDealMutationOptions(options);
308
+
309
+ return useMutation(mutationOptions);
310
+ }
311
+ /**
312
+ * @summary Delete a deal.
313
+ */
314
+ export const dealDeleteDeal = (
315
+ dealUid: string | null,
316
+ options?: SecondParameter<typeof customFetch>,) => {
317
+
318
+
319
+ return customFetch<Blob>(
320
+ {url: `/api/v1/crm/deals/${dealUid}`, method: 'DELETE',
321
+ responseType: 'blob'
322
+ },
323
+ options);
324
+ }
325
+
326
+
327
+
328
+ export const getDealDeleteDealMutationOptions = <TError = void,
329
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof dealDeleteDeal>>, TError,{dealUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
330
+ ): UseMutationOptions<Awaited<ReturnType<typeof dealDeleteDeal>>, TError,{dealUid: string | null}, TContext> => {
331
+
332
+ const mutationKey = ['dealDeleteDeal'];
333
+ const {mutation: mutationOptions, request: requestOptions} = options ?
334
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
335
+ options
336
+ : {...options, mutation: {...options.mutation, mutationKey}}
337
+ : {mutation: { mutationKey, }, request: undefined};
338
+
339
+
340
+
341
+
342
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof dealDeleteDeal>>, {dealUid: string | null}> = (props) => {
343
+ const {dealUid} = props ?? {};
344
+
345
+ return dealDeleteDeal(dealUid,requestOptions)
346
+ }
347
+
348
+
349
+
350
+
351
+ return { mutationFn, ...mutationOptions }}
352
+
353
+ export type DealDeleteDealMutationResult = NonNullable<Awaited<ReturnType<typeof dealDeleteDeal>>>
354
+
355
+ export type DealDeleteDealMutationError = void
356
+
357
+ /**
358
+ * @summary Delete a deal.
359
+ */
360
+ export const useDealDeleteDeal = <TError = void,
361
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof dealDeleteDeal>>, TError,{dealUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
362
+ ): UseMutationResult<
363
+ Awaited<ReturnType<typeof dealDeleteDeal>>,
364
+ TError,
365
+ {dealUid: string | null},
366
+ TContext
367
+ > => {
368
+
369
+ const mutationOptions = getDealDeleteDealMutationOptions(options);
370
+
371
+ return useMutation(mutationOptions);
372
+ }
373
+ /**
374
+ * @summary Register a new account. This is the same endpoint the sign up embed uses to create accounts.
375
+ At a minimum you must pass one Primary Contact with an Email address and one Subscription
376
+ record with a reference to a Plan. Other fields (e.g. Account Name, Billing Address,
377
+ Payment Information, etc.) can be passed as desired. A confirmation email will be sent
378
+ to the user unless you've specifically toggled this option off on the AUTH > SIGN UP AND LOGIN page.
379
+ */
380
+ export const registrationRegisterAccount = (
381
+
382
+ options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
383
+ ) => {
384
+
385
+
386
+ return customFetch<Account>(
387
+ {url: `/api/v1/crm/registrations`, method: 'POST', signal
388
+ },
389
+ options);
390
+ }
391
+
392
+
393
+
394
+ export const getRegistrationRegisterAccountMutationOptions = <TError = unknown,
395
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof registrationRegisterAccount>>, TError,void, TContext>, request?: SecondParameter<typeof customFetch>}
396
+ ): UseMutationOptions<Awaited<ReturnType<typeof registrationRegisterAccount>>, TError,void, TContext> => {
397
+
398
+ const mutationKey = ['registrationRegisterAccount'];
399
+ const {mutation: mutationOptions, request: requestOptions} = options ?
400
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
401
+ options
402
+ : {...options, mutation: {...options.mutation, mutationKey}}
403
+ : {mutation: { mutationKey, }, request: undefined};
404
+
405
+
406
+
407
+
408
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof registrationRegisterAccount>>, void> = () => {
409
+
410
+
411
+ return registrationRegisterAccount(requestOptions)
412
+ }
413
+
414
+
415
+
416
+
417
+ return { mutationFn, ...mutationOptions }}
418
+
419
+ export type RegistrationRegisterAccountMutationResult = NonNullable<Awaited<ReturnType<typeof registrationRegisterAccount>>>
420
+
421
+ export type RegistrationRegisterAccountMutationError = unknown
422
+
423
+ /**
424
+ * @summary Register a new account. This is the same endpoint the sign up embed uses to create accounts.
425
+ At a minimum you must pass one Primary Contact with an Email address and one Subscription
426
+ record with a reference to a Plan. Other fields (e.g. Account Name, Billing Address,
427
+ Payment Information, etc.) can be passed as desired. A confirmation email will be sent
428
+ to the user unless you've specifically toggled this option off on the AUTH > SIGN UP AND LOGIN page.
429
+ */
430
+ export const useRegistrationRegisterAccount = <TError = unknown,
431
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof registrationRegisterAccount>>, TError,void, TContext>, request?: SecondParameter<typeof customFetch>}
432
+ ): UseMutationResult<
433
+ Awaited<ReturnType<typeof registrationRegisterAccount>>,
434
+ TError,
435
+ void,
436
+ TContext
437
+ > => {
438
+
439
+ const mutationOptions = getRegistrationRegisterAccountMutationOptions(options);
440
+
441
+ return useMutation(mutationOptions);
442
+ }
443
+ /**
444
+ * @summary Returns all accounts, optionally filtered by segment or search query.
445
+ */
446
+ export const accountGetAllAccounts = (
447
+ params?: AccountGetAllAccountsParams,
448
+ options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
449
+ ) => {
450
+
451
+
452
+ return customFetch<Account[]>(
453
+ {url: `/api/v1/crm/accounts`, method: 'GET',
454
+ params, signal
455
+ },
456
+ options);
457
+ }
458
+
459
+
460
+
461
+
462
+ export const getAccountGetAllAccountsQueryKey = (params?: AccountGetAllAccountsParams,) => {
463
+ return [
464
+ `/api/v1/crm/accounts`, ...(params ? [params]: [])
465
+ ] as const;
466
+ }
467
+
468
+
469
+ 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>}
470
+ ) => {
471
+
472
+ const {query: queryOptions, request: requestOptions} = options ?? {};
473
+
474
+ const queryKey = queryOptions?.queryKey ?? getAccountGetAllAccountsQueryKey(params);
475
+
476
+
477
+
478
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof accountGetAllAccounts>>> = ({ signal }) => accountGetAllAccounts(params, requestOptions, signal);
479
+
480
+
481
+
482
+
483
+
484
+ return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof accountGetAllAccounts>>, TError, TData> & { queryKey: QueryKey }
485
+ }
486
+
487
+ export type AccountGetAllAccountsQueryResult = NonNullable<Awaited<ReturnType<typeof accountGetAllAccounts>>>
488
+ export type AccountGetAllAccountsQueryError = void
489
+
490
+
491
+ /**
492
+ * @summary Returns all accounts, optionally filtered by segment or search query.
493
+ */
494
+
495
+ export function useAccountGetAllAccounts<TData = Awaited<ReturnType<typeof accountGetAllAccounts>>, TError = void>(
496
+ params?: AccountGetAllAccountsParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof accountGetAllAccounts>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
497
+
498
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
499
+
500
+ const queryOptions = getAccountGetAllAccountsQueryOptions(params,options)
501
+
502
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
503
+
504
+ query.queryKey = queryOptions.queryKey ;
505
+
506
+ return query;
507
+ }
508
+
509
+
510
+
511
+
512
+ /**
513
+ * @summary Add a new account.
514
+ To add an account with an existing person, the Account payload include something like this:
515
+ { ... other Account properties ..., "PersonAccount": [ { "Person": { "Uid": [personUid] }, "IsPrimary": "true" } ] }
516
+ */
517
+ export const accountAddAccount = (
518
+ accountAddAccountBody: AccountAddAccountBody,
519
+ params?: AccountAddAccountParams,
520
+ options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
521
+ ) => {
522
+
523
+
524
+ return customFetch<Blob>(
525
+ {url: `/api/v1/crm/accounts`, method: 'POST',
526
+ headers: {'Content-Type': 'application/json', },
527
+ data: accountAddAccountBody,
528
+ params,
529
+ responseType: 'blob', signal
530
+ },
531
+ options);
532
+ }
533
+
534
+
535
+
536
+ export const getAccountAddAccountMutationOptions = <TError = void,
537
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountAddAccount>>, TError,{data: AccountAddAccountBody;params?: AccountAddAccountParams}, TContext>, request?: SecondParameter<typeof customFetch>}
538
+ ): UseMutationOptions<Awaited<ReturnType<typeof accountAddAccount>>, TError,{data: AccountAddAccountBody;params?: AccountAddAccountParams}, TContext> => {
539
+
540
+ const mutationKey = ['accountAddAccount'];
541
+ const {mutation: mutationOptions, request: requestOptions} = options ?
542
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
543
+ options
544
+ : {...options, mutation: {...options.mutation, mutationKey}}
545
+ : {mutation: { mutationKey, }, request: undefined};
546
+
547
+
548
+
549
+
550
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof accountAddAccount>>, {data: AccountAddAccountBody;params?: AccountAddAccountParams}> = (props) => {
551
+ const {data,params} = props ?? {};
552
+
553
+ return accountAddAccount(data,params,requestOptions)
554
+ }
555
+
556
+
557
+
558
+
559
+ return { mutationFn, ...mutationOptions }}
560
+
561
+ export type AccountAddAccountMutationResult = NonNullable<Awaited<ReturnType<typeof accountAddAccount>>>
562
+ export type AccountAddAccountMutationBody = AccountAddAccountBody
563
+ export type AccountAddAccountMutationError = void
564
+
565
+ /**
566
+ * @summary Add a new account.
567
+ To add an account with an existing person, the Account payload include something like this:
568
+ { ... other Account properties ..., "PersonAccount": [ { "Person": { "Uid": [personUid] }, "IsPrimary": "true" } ] }
569
+ */
570
+ export const useAccountAddAccount = <TError = void,
571
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountAddAccount>>, TError,{data: AccountAddAccountBody;params?: AccountAddAccountParams}, TContext>, request?: SecondParameter<typeof customFetch>}
572
+ ): UseMutationResult<
573
+ Awaited<ReturnType<typeof accountAddAccount>>,
574
+ TError,
575
+ {data: AccountAddAccountBody;params?: AccountAddAccountParams},
576
+ TContext
577
+ > => {
578
+
579
+ const mutationOptions = getAccountAddAccountMutationOptions(options);
580
+
581
+ return useMutation(mutationOptions);
582
+ }
583
+ /**
584
+ * @summary Returns a single account by UID.
585
+ */
586
+ export const accountGetAccount = (
587
+ accountUid: string | null,
588
+ options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
589
+ ) => {
590
+
591
+
592
+ return customFetch<Account>(
593
+ {url: `/api/v1/crm/accounts/${accountUid}`, method: 'GET', signal
594
+ },
595
+ options);
596
+ }
597
+
598
+
599
+
600
+
601
+ export const getAccountGetAccountQueryKey = (accountUid?: string | null,) => {
602
+ return [
603
+ `/api/v1/crm/accounts/${accountUid}`
604
+ ] as const;
605
+ }
606
+
607
+
608
+ 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>}
609
+ ) => {
610
+
611
+ const {query: queryOptions, request: requestOptions} = options ?? {};
612
+
613
+ const queryKey = queryOptions?.queryKey ?? getAccountGetAccountQueryKey(accountUid);
614
+
615
+
616
+
617
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof accountGetAccount>>> = ({ signal }) => accountGetAccount(accountUid, requestOptions, signal);
618
+
619
+
620
+
621
+
622
+
623
+ return { queryKey, queryFn, enabled: !!(accountUid), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof accountGetAccount>>, TError, TData> & { queryKey: QueryKey }
624
+ }
625
+
626
+ export type AccountGetAccountQueryResult = NonNullable<Awaited<ReturnType<typeof accountGetAccount>>>
627
+ export type AccountGetAccountQueryError = void
628
+
629
+
630
+ /**
631
+ * @summary Returns a single account by UID.
632
+ */
633
+
634
+ export function useAccountGetAccount<TData = Awaited<ReturnType<typeof accountGetAccount>>, TError = void>(
635
+ accountUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof accountGetAccount>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
636
+
637
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
638
+
639
+ const queryOptions = getAccountGetAccountQueryOptions(accountUid,options)
640
+
641
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
642
+
643
+ query.queryKey = queryOptions.queryKey ;
644
+
645
+ return query;
646
+ }
647
+
648
+
649
+
650
+
651
+ /**
652
+ * @summary Delete an account record.
653
+ */
654
+ export const accountDeleteAccount = (
655
+ accountUid: string | null,
656
+ options?: SecondParameter<typeof customFetch>,) => {
657
+
658
+
659
+ return customFetch<Blob>(
660
+ {url: `/api/v1/crm/accounts/${accountUid}`, method: 'DELETE',
661
+ responseType: 'blob'
662
+ },
663
+ options);
664
+ }
665
+
666
+
667
+
668
+ export const getAccountDeleteAccountMutationOptions = <TError = void,
669
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountDeleteAccount>>, TError,{accountUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
670
+ ): UseMutationOptions<Awaited<ReturnType<typeof accountDeleteAccount>>, TError,{accountUid: string | null}, TContext> => {
671
+
672
+ const mutationKey = ['accountDeleteAccount'];
673
+ const {mutation: mutationOptions, request: requestOptions} = options ?
674
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
675
+ options
676
+ : {...options, mutation: {...options.mutation, mutationKey}}
677
+ : {mutation: { mutationKey, }, request: undefined};
678
+
679
+
680
+
681
+
682
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof accountDeleteAccount>>, {accountUid: string | null}> = (props) => {
683
+ const {accountUid} = props ?? {};
684
+
685
+ return accountDeleteAccount(accountUid,requestOptions)
686
+ }
687
+
688
+
689
+
690
+
691
+ return { mutationFn, ...mutationOptions }}
692
+
693
+ export type AccountDeleteAccountMutationResult = NonNullable<Awaited<ReturnType<typeof accountDeleteAccount>>>
694
+
695
+ export type AccountDeleteAccountMutationError = void
696
+
697
+ /**
698
+ * @summary Delete an account record.
699
+ */
700
+ export const useAccountDeleteAccount = <TError = void,
701
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountDeleteAccount>>, TError,{accountUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
702
+ ): UseMutationResult<
703
+ Awaited<ReturnType<typeof accountDeleteAccount>>,
704
+ TError,
705
+ {accountUid: string | null},
706
+ TContext
707
+ > => {
708
+
709
+ const mutationOptions = getAccountDeleteAccountMutationOptions(options);
710
+
711
+ return useMutation(mutationOptions);
712
+ }
713
+ /**
714
+ * @summary Update account information. You can update one or multiple properties on the object.
715
+ Any property that you include in the json schema will be updated.
716
+ To update custom properties just include them in the same way that they are included when you do a get on the object.
717
+ */
718
+ export const accountUpdateAccount = (
719
+ accountUid: string | null,
720
+ accountUpdateAccountBody: AccountUpdateAccountBody,
721
+ options?: SecondParameter<typeof customFetch>,) => {
722
+
723
+
724
+ return customFetch<Account>(
725
+ {url: `/api/v1/crm/accounts/${accountUid}`, method: 'PUT',
726
+ headers: {'Content-Type': 'application/json', },
727
+ data: accountUpdateAccountBody
728
+ },
729
+ options);
730
+ }
731
+
732
+
733
+
734
+ export const getAccountUpdateAccountMutationOptions = <TError = void,
735
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountUpdateAccount>>, TError,{accountUid: string | null;data: AccountUpdateAccountBody}, TContext>, request?: SecondParameter<typeof customFetch>}
736
+ ): UseMutationOptions<Awaited<ReturnType<typeof accountUpdateAccount>>, TError,{accountUid: string | null;data: AccountUpdateAccountBody}, TContext> => {
737
+
738
+ const mutationKey = ['accountUpdateAccount'];
739
+ const {mutation: mutationOptions, request: requestOptions} = options ?
740
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
741
+ options
742
+ : {...options, mutation: {...options.mutation, mutationKey}}
743
+ : {mutation: { mutationKey, }, request: undefined};
744
+
745
+
746
+
747
+
748
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof accountUpdateAccount>>, {accountUid: string | null;data: AccountUpdateAccountBody}> = (props) => {
749
+ const {accountUid,data} = props ?? {};
750
+
751
+ return accountUpdateAccount(accountUid,data,requestOptions)
752
+ }
753
+
754
+
755
+
756
+
757
+ return { mutationFn, ...mutationOptions }}
758
+
759
+ export type AccountUpdateAccountMutationResult = NonNullable<Awaited<ReturnType<typeof accountUpdateAccount>>>
760
+ export type AccountUpdateAccountMutationBody = AccountUpdateAccountBody
761
+ export type AccountUpdateAccountMutationError = void
762
+
763
+ /**
764
+ * @summary Update account information. You can update one or multiple properties on the object.
765
+ Any property that you include in the json schema will be updated.
766
+ To update custom properties just include them in the same way that they are included when you do a get on the object.
767
+ */
768
+ export const useAccountUpdateAccount = <TError = void,
769
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountUpdateAccount>>, TError,{accountUid: string | null;data: AccountUpdateAccountBody}, TContext>, request?: SecondParameter<typeof customFetch>}
770
+ ): UseMutationResult<
771
+ Awaited<ReturnType<typeof accountUpdateAccount>>,
772
+ TError,
773
+ {accountUid: string | null;data: AccountUpdateAccountBody},
774
+ TContext
775
+ > => {
776
+
777
+ const mutationOptions = getAccountUpdateAccountMutationOptions(options);
778
+
779
+ return useMutation(mutationOptions);
780
+ }
781
+ /**
782
+ * @summary Add a person to an existing account. Set sendWelcomeEmail=true to send a welcome email to the person added.
783
+ */
784
+ export const accountAddPersonToAccount = (
785
+ accountUid: string | null,
786
+ accountAddPersonToAccountBody: AccountAddPersonToAccountBody,
787
+ options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
788
+ ) => {
789
+
790
+
791
+ return customFetch<PersonAccount>(
792
+ {url: `/api/v1/crm/accounts/${accountUid}/memberships`, method: 'POST',
793
+ headers: {'Content-Type': 'application/json', },
794
+ data: accountAddPersonToAccountBody, signal
795
+ },
796
+ options);
797
+ }
798
+
799
+
800
+
801
+ export const getAccountAddPersonToAccountMutationOptions = <TError = void,
802
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountAddPersonToAccount>>, TError,{accountUid: string | null;data: AccountAddPersonToAccountBody}, TContext>, request?: SecondParameter<typeof customFetch>}
803
+ ): UseMutationOptions<Awaited<ReturnType<typeof accountAddPersonToAccount>>, TError,{accountUid: string | null;data: AccountAddPersonToAccountBody}, TContext> => {
804
+
805
+ const mutationKey = ['accountAddPersonToAccount'];
806
+ const {mutation: mutationOptions, request: requestOptions} = options ?
807
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
808
+ options
809
+ : {...options, mutation: {...options.mutation, mutationKey}}
810
+ : {mutation: { mutationKey, }, request: undefined};
811
+
812
+
813
+
814
+
815
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof accountAddPersonToAccount>>, {accountUid: string | null;data: AccountAddPersonToAccountBody}> = (props) => {
816
+ const {accountUid,data} = props ?? {};
817
+
818
+ return accountAddPersonToAccount(accountUid,data,requestOptions)
819
+ }
820
+
821
+
822
+
823
+
824
+ return { mutationFn, ...mutationOptions }}
825
+
826
+ export type AccountAddPersonToAccountMutationResult = NonNullable<Awaited<ReturnType<typeof accountAddPersonToAccount>>>
827
+ export type AccountAddPersonToAccountMutationBody = AccountAddPersonToAccountBody
828
+ export type AccountAddPersonToAccountMutationError = void
829
+
830
+ /**
831
+ * @summary Add a person to an existing account. Set sendWelcomeEmail=true to send a welcome email to the person added.
832
+ */
833
+ export const useAccountAddPersonToAccount = <TError = void,
834
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountAddPersonToAccount>>, TError,{accountUid: string | null;data: AccountAddPersonToAccountBody}, TContext>, request?: SecondParameter<typeof customFetch>}
835
+ ): UseMutationResult<
836
+ Awaited<ReturnType<typeof accountAddPersonToAccount>>,
837
+ TError,
838
+ {accountUid: string | null;data: AccountAddPersonToAccountBody},
839
+ TContext
840
+ > => {
841
+
842
+ const mutationOptions = getAccountAddPersonToAccountMutationOptions(options);
843
+
844
+ return useMutation(mutationOptions);
845
+ }
846
+ /**
847
+ * @summary Update an account membership. This is the method by which you can change the primary contact of an account.
848
+ */
849
+ export const accountUpdateMembership = (
850
+ accountUid: string | null,
851
+ membershipUid: string | null,
852
+ accountUpdateMembershipBody: AccountUpdateMembershipBody,
853
+ options?: SecondParameter<typeof customFetch>,) => {
854
+
855
+
856
+ return customFetch<Blob>(
857
+ {url: `/api/v1/crm/accounts/${accountUid}/memberships/${membershipUid}`, method: 'PUT',
858
+ headers: {'Content-Type': 'application/json', },
859
+ data: accountUpdateMembershipBody,
860
+ responseType: 'blob'
861
+ },
862
+ options);
863
+ }
864
+
865
+
866
+
867
+ export const getAccountUpdateMembershipMutationOptions = <TError = void,
868
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountUpdateMembership>>, TError,{accountUid: string | null;membershipUid: string | null;data: AccountUpdateMembershipBody}, TContext>, request?: SecondParameter<typeof customFetch>}
869
+ ): UseMutationOptions<Awaited<ReturnType<typeof accountUpdateMembership>>, TError,{accountUid: string | null;membershipUid: string | null;data: AccountUpdateMembershipBody}, TContext> => {
870
+
871
+ const mutationKey = ['accountUpdateMembership'];
872
+ const {mutation: mutationOptions, request: requestOptions} = options ?
873
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
874
+ options
875
+ : {...options, mutation: {...options.mutation, mutationKey}}
876
+ : {mutation: { mutationKey, }, request: undefined};
877
+
878
+
879
+
880
+
881
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof accountUpdateMembership>>, {accountUid: string | null;membershipUid: string | null;data: AccountUpdateMembershipBody}> = (props) => {
882
+ const {accountUid,membershipUid,data} = props ?? {};
883
+
884
+ return accountUpdateMembership(accountUid,membershipUid,data,requestOptions)
885
+ }
886
+
887
+
888
+
889
+
890
+ return { mutationFn, ...mutationOptions }}
891
+
892
+ export type AccountUpdateMembershipMutationResult = NonNullable<Awaited<ReturnType<typeof accountUpdateMembership>>>
893
+ export type AccountUpdateMembershipMutationBody = AccountUpdateMembershipBody
894
+ export type AccountUpdateMembershipMutationError = void
895
+
896
+ /**
897
+ * @summary Update an account membership. This is the method by which you can change the primary contact of an account.
898
+ */
899
+ export const useAccountUpdateMembership = <TError = void,
900
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountUpdateMembership>>, TError,{accountUid: string | null;membershipUid: string | null;data: AccountUpdateMembershipBody}, TContext>, request?: SecondParameter<typeof customFetch>}
901
+ ): UseMutationResult<
902
+ Awaited<ReturnType<typeof accountUpdateMembership>>,
903
+ TError,
904
+ {accountUid: string | null;membershipUid: string | null;data: AccountUpdateMembershipBody},
905
+ TContext
906
+ > => {
907
+
908
+ const mutationOptions = getAccountUpdateMembershipMutationOptions(options);
909
+
910
+ return useMutation(mutationOptions);
911
+ }
912
+ /**
913
+ * @summary Remove a person from an account. Note that you cannot remove the primary contact of an account.
914
+ */
915
+ export const accountDeleteMembership = (
916
+ accountUid: string | null,
917
+ membershipUid: string | null,
918
+ options?: SecondParameter<typeof customFetch>,) => {
919
+
920
+
921
+ return customFetch<Blob>(
922
+ {url: `/api/v1/crm/accounts/${accountUid}/memberships/${membershipUid}`, method: 'DELETE',
923
+ responseType: 'blob'
924
+ },
925
+ options);
926
+ }
927
+
928
+
929
+
930
+ export const getAccountDeleteMembershipMutationOptions = <TError = void,
931
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountDeleteMembership>>, TError,{accountUid: string | null;membershipUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
932
+ ): UseMutationOptions<Awaited<ReturnType<typeof accountDeleteMembership>>, TError,{accountUid: string | null;membershipUid: string | null}, TContext> => {
933
+
934
+ const mutationKey = ['accountDeleteMembership'];
935
+ const {mutation: mutationOptions, request: requestOptions} = options ?
936
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
937
+ options
938
+ : {...options, mutation: {...options.mutation, mutationKey}}
939
+ : {mutation: { mutationKey, }, request: undefined};
940
+
941
+
942
+
943
+
944
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof accountDeleteMembership>>, {accountUid: string | null;membershipUid: string | null}> = (props) => {
945
+ const {accountUid,membershipUid} = props ?? {};
946
+
947
+ return accountDeleteMembership(accountUid,membershipUid,requestOptions)
948
+ }
949
+
950
+
951
+
952
+
953
+ return { mutationFn, ...mutationOptions }}
954
+
955
+ export type AccountDeleteMembershipMutationResult = NonNullable<Awaited<ReturnType<typeof accountDeleteMembership>>>
956
+
957
+ export type AccountDeleteMembershipMutationError = void
958
+
959
+ /**
960
+ * @summary Remove a person from an account. Note that you cannot remove the primary contact of an account.
961
+ */
962
+ export const useAccountDeleteMembership = <TError = void,
963
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountDeleteMembership>>, TError,{accountUid: string | null;membershipUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
964
+ ): UseMutationResult<
965
+ Awaited<ReturnType<typeof accountDeleteMembership>>,
966
+ TError,
967
+ {accountUid: string | null;membershipUid: string | null},
968
+ TContext
969
+ > => {
970
+
971
+ const mutationOptions = getAccountDeleteMembershipMutationOptions(options);
972
+
973
+ return useMutation(mutationOptions);
974
+ }
975
+ /**
976
+ * @summary Add a cancellation request to an account. The account needs to be in subscribing stage.
977
+ The stage will automatically change over to cancelling. If the account has a subscription
978
+ attached to it then at the subscription renewal the subscription will end and the account
979
+ will be automatically set to expired.
980
+ */
981
+ export const accountCancelAccount = (
982
+ accountUid: string | null,
983
+ accountCancelAccountBody: AccountCancelAccountBody,
984
+ options?: SecondParameter<typeof customFetch>,) => {
985
+
986
+
987
+ return customFetch<Blob>(
988
+ {url: `/api/v1/crm/accounts/${accountUid}/cancel`, method: 'PUT',
989
+ headers: {'Content-Type': 'application/json', },
990
+ data: accountCancelAccountBody,
991
+ responseType: 'blob'
992
+ },
993
+ options);
994
+ }
995
+
996
+
997
+
998
+ export const getAccountCancelAccountMutationOptions = <TError = void,
999
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountCancelAccount>>, TError,{accountUid: string | null;data: AccountCancelAccountBody}, TContext>, request?: SecondParameter<typeof customFetch>}
1000
+ ): UseMutationOptions<Awaited<ReturnType<typeof accountCancelAccount>>, TError,{accountUid: string | null;data: AccountCancelAccountBody}, TContext> => {
1001
+
1002
+ const mutationKey = ['accountCancelAccount'];
1003
+ const {mutation: mutationOptions, request: requestOptions} = options ?
1004
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
1005
+ options
1006
+ : {...options, mutation: {...options.mutation, mutationKey}}
1007
+ : {mutation: { mutationKey, }, request: undefined};
1008
+
1009
+
1010
+
1011
+
1012
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof accountCancelAccount>>, {accountUid: string | null;data: AccountCancelAccountBody}> = (props) => {
1013
+ const {accountUid,data} = props ?? {};
1014
+
1015
+ return accountCancelAccount(accountUid,data,requestOptions)
1016
+ }
1017
+
1018
+
1019
+
1020
+
1021
+ return { mutationFn, ...mutationOptions }}
1022
+
1023
+ export type AccountCancelAccountMutationResult = NonNullable<Awaited<ReturnType<typeof accountCancelAccount>>>
1024
+ export type AccountCancelAccountMutationBody = AccountCancelAccountBody
1025
+ export type AccountCancelAccountMutationError = void
1026
+
1027
+ /**
1028
+ * @summary Add a cancellation request to an account. The account needs to be in subscribing stage.
1029
+ The stage will automatically change over to cancelling. If the account has a subscription
1030
+ attached to it then at the subscription renewal the subscription will end and the account
1031
+ will be automatically set to expired.
1032
+ */
1033
+ export const useAccountCancelAccount = <TError = void,
1034
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountCancelAccount>>, TError,{accountUid: string | null;data: AccountCancelAccountBody}, TContext>, request?: SecondParameter<typeof customFetch>}
1035
+ ): UseMutationResult<
1036
+ Awaited<ReturnType<typeof accountCancelAccount>>,
1037
+ TError,
1038
+ {accountUid: string | null;data: AccountCancelAccountBody},
1039
+ TContext
1040
+ > => {
1041
+
1042
+ const mutationOptions = getAccountCancelAccountMutationOptions(options);
1043
+
1044
+ return useMutation(mutationOptions);
1045
+ }
1046
+ /**
1047
+ * @summary Remove a previous cancellation request from an account.
1048
+ */
1049
+ export const accountRemoveCancellation = (
1050
+ accountUid: string | null,
1051
+ options?: SecondParameter<typeof customFetch>,) => {
1052
+
1053
+
1054
+ return customFetch<Blob>(
1055
+ {url: `/api/v1/crm/accounts/${accountUid}/remove-cancellation`, method: 'PUT',
1056
+ responseType: 'blob'
1057
+ },
1058
+ options);
1059
+ }
1060
+
1061
+
1062
+
1063
+ export const getAccountRemoveCancellationMutationOptions = <TError = void,
1064
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountRemoveCancellation>>, TError,{accountUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
1065
+ ): UseMutationOptions<Awaited<ReturnType<typeof accountRemoveCancellation>>, TError,{accountUid: string | null}, TContext> => {
1066
+
1067
+ const mutationKey = ['accountRemoveCancellation'];
1068
+ const {mutation: mutationOptions, request: requestOptions} = options ?
1069
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
1070
+ options
1071
+ : {...options, mutation: {...options.mutation, mutationKey}}
1072
+ : {mutation: { mutationKey, }, request: undefined};
1073
+
1074
+
1075
+
1076
+
1077
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof accountRemoveCancellation>>, {accountUid: string | null}> = (props) => {
1078
+ const {accountUid} = props ?? {};
1079
+
1080
+ return accountRemoveCancellation(accountUid,requestOptions)
1081
+ }
1082
+
1083
+
1084
+
1085
+
1086
+ return { mutationFn, ...mutationOptions }}
1087
+
1088
+ export type AccountRemoveCancellationMutationResult = NonNullable<Awaited<ReturnType<typeof accountRemoveCancellation>>>
1089
+
1090
+ export type AccountRemoveCancellationMutationError = void
1091
+
1092
+ /**
1093
+ * @summary Remove a previous cancellation request from an account.
1094
+ */
1095
+ export const useAccountRemoveCancellation = <TError = void,
1096
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountRemoveCancellation>>, TError,{accountUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
1097
+ ): UseMutationResult<
1098
+ Awaited<ReturnType<typeof accountRemoveCancellation>>,
1099
+ TError,
1100
+ {accountUid: string | null},
1101
+ TContext
1102
+ > => {
1103
+
1104
+ const mutationOptions = getAccountRemoveCancellationMutationOptions(options);
1105
+
1106
+ return useMutation(mutationOptions);
1107
+ }
1108
+ /**
1109
+ * @summary Extend the date that a trial subscription expires.
1110
+ */
1111
+ export const accountExtendTrial = (
1112
+ accountUid: string | null,
1113
+ accountExtendTrialBody: AccountExtendTrialBody,
1114
+ options?: SecondParameter<typeof customFetch>,) => {
1115
+
1116
+
1117
+ return customFetch<Blob>(
1118
+ {url: `/api/v1/crm/accounts/${accountUid}/extend-trial`, method: 'PUT',
1119
+ headers: {'Content-Type': 'application/json', },
1120
+ data: accountExtendTrialBody,
1121
+ responseType: 'blob'
1122
+ },
1123
+ options);
1124
+ }
1125
+
1126
+
1127
+
1128
+ export const getAccountExtendTrialMutationOptions = <TError = void,
1129
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountExtendTrial>>, TError,{accountUid: string | null;data: AccountExtendTrialBody}, TContext>, request?: SecondParameter<typeof customFetch>}
1130
+ ): UseMutationOptions<Awaited<ReturnType<typeof accountExtendTrial>>, TError,{accountUid: string | null;data: AccountExtendTrialBody}, TContext> => {
1131
+
1132
+ const mutationKey = ['accountExtendTrial'];
1133
+ const {mutation: mutationOptions, request: requestOptions} = options ?
1134
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
1135
+ options
1136
+ : {...options, mutation: {...options.mutation, mutationKey}}
1137
+ : {mutation: { mutationKey, }, request: undefined};
1138
+
1139
+
1140
+
1141
+
1142
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof accountExtendTrial>>, {accountUid: string | null;data: AccountExtendTrialBody}> = (props) => {
1143
+ const {accountUid,data} = props ?? {};
1144
+
1145
+ return accountExtendTrial(accountUid,data,requestOptions)
1146
+ }
1147
+
1148
+
1149
+
1150
+
1151
+ return { mutationFn, ...mutationOptions }}
1152
+
1153
+ export type AccountExtendTrialMutationResult = NonNullable<Awaited<ReturnType<typeof accountExtendTrial>>>
1154
+ export type AccountExtendTrialMutationBody = AccountExtendTrialBody
1155
+ export type AccountExtendTrialMutationError = void
1156
+
1157
+ /**
1158
+ * @summary Extend the date that a trial subscription expires.
1159
+ */
1160
+ export const useAccountExtendTrial = <TError = void,
1161
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountExtendTrial>>, TError,{accountUid: string | null;data: AccountExtendTrialBody}, TContext>, request?: SecondParameter<typeof customFetch>}
1162
+ ): UseMutationResult<
1163
+ Awaited<ReturnType<typeof accountExtendTrial>>,
1164
+ TError,
1165
+ {accountUid: string | null;data: AccountExtendTrialBody},
1166
+ TContext
1167
+ > => {
1168
+
1169
+ const mutationOptions = getAccountExtendTrialMutationOptions(options);
1170
+
1171
+ return useMutation(mutationOptions);
1172
+ }
1173
+ /**
1174
+ * @summary Send a confirmation email to people on an account. Pass personUid as a query parameter
1175
+ to send to a specific person, or personUid=* to send to all people on the account.
1176
+ If no personUid is provided, the email is sent to the primary contact.
1177
+ */
1178
+ export const accountSendConfirmationEmail = (
1179
+ accountUid: string | null,
1180
+ options?: SecondParameter<typeof customFetch>,) => {
1181
+
1182
+
1183
+ return customFetch<Blob>(
1184
+ {url: `/api/v1/crm/accounts/${accountUid}/send-confirmation-email`, method: 'PUT',
1185
+ responseType: 'blob'
1186
+ },
1187
+ options);
1188
+ }
1189
+
1190
+
1191
+
1192
+ export const getAccountSendConfirmationEmailMutationOptions = <TError = void,
1193
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountSendConfirmationEmail>>, TError,{accountUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
1194
+ ): UseMutationOptions<Awaited<ReturnType<typeof accountSendConfirmationEmail>>, TError,{accountUid: string | null}, TContext> => {
1195
+
1196
+ const mutationKey = ['accountSendConfirmationEmail'];
1197
+ const {mutation: mutationOptions, request: requestOptions} = options ?
1198
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
1199
+ options
1200
+ : {...options, mutation: {...options.mutation, mutationKey}}
1201
+ : {mutation: { mutationKey, }, request: undefined};
1202
+
1203
+
1204
+
1205
+
1206
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof accountSendConfirmationEmail>>, {accountUid: string | null}> = (props) => {
1207
+ const {accountUid} = props ?? {};
1208
+
1209
+ return accountSendConfirmationEmail(accountUid,requestOptions)
1210
+ }
1211
+
1212
+
1213
+
1214
+
1215
+ return { mutationFn, ...mutationOptions }}
1216
+
1217
+ export type AccountSendConfirmationEmailMutationResult = NonNullable<Awaited<ReturnType<typeof accountSendConfirmationEmail>>>
1218
+
1219
+ export type AccountSendConfirmationEmailMutationError = void
1220
+
1221
+ /**
1222
+ * @summary Send a confirmation email to people on an account. Pass personUid as a query parameter
1223
+ to send to a specific person, or personUid=* to send to all people on the account.
1224
+ If no personUid is provided, the email is sent to the primary contact.
1225
+ */
1226
+ export const useAccountSendConfirmationEmail = <TError = void,
1227
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof accountSendConfirmationEmail>>, TError,{accountUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
1228
+ ): UseMutationResult<
1229
+ Awaited<ReturnType<typeof accountSendConfirmationEmail>>,
1230
+ TError,
1231
+ {accountUid: string | null},
1232
+ TContext
1233
+ > => {
1234
+
1235
+ const mutationOptions = getAccountSendConfirmationEmailMutationOptions(options);
1236
+
1237
+ return useMutation(mutationOptions);
1238
+ }
1239
+ /**
1240
+ * @summary Retrieves all the people associated with your account.
1241
+ */
1242
+ export const personGetAllPeople = (
1243
+ params?: PersonGetAllPeopleParams,
1244
+ options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
1245
+ ) => {
1246
+
1247
+
1248
+ return customFetch<Person[]>(
1249
+ {url: `/api/v1/crm/people`, method: 'GET',
1250
+ params, signal
1251
+ },
1252
+ options);
1253
+ }
1254
+
1255
+
1256
+
1257
+
1258
+ export const getPersonGetAllPeopleQueryKey = (params?: PersonGetAllPeopleParams,) => {
1259
+ return [
1260
+ `/api/v1/crm/people`, ...(params ? [params]: [])
1261
+ ] as const;
1262
+ }
1263
+
1264
+
1265
+ 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>}
1266
+ ) => {
1267
+
1268
+ const {query: queryOptions, request: requestOptions} = options ?? {};
1269
+
1270
+ const queryKey = queryOptions?.queryKey ?? getPersonGetAllPeopleQueryKey(params);
1271
+
1272
+
1273
+
1274
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof personGetAllPeople>>> = ({ signal }) => personGetAllPeople(params, requestOptions, signal);
1275
+
1276
+
1277
+
1278
+
1279
+
1280
+ return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof personGetAllPeople>>, TError, TData> & { queryKey: QueryKey }
1281
+ }
1282
+
1283
+ export type PersonGetAllPeopleQueryResult = NonNullable<Awaited<ReturnType<typeof personGetAllPeople>>>
1284
+ export type PersonGetAllPeopleQueryError = void
1285
+
1286
+
1287
+ /**
1288
+ * @summary Retrieves all the people associated with your account.
1289
+ */
1290
+
1291
+ export function usePersonGetAllPeople<TData = Awaited<ReturnType<typeof personGetAllPeople>>, TError = void>(
1292
+ params?: PersonGetAllPeopleParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof personGetAllPeople>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
1293
+
1294
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
1295
+
1296
+ const queryOptions = getPersonGetAllPeopleQueryOptions(params,options)
1297
+
1298
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
1299
+
1300
+ query.queryKey = queryOptions.queryKey ;
1301
+
1302
+ return query;
1303
+ }
1304
+
1305
+
1306
+
1307
+
1308
+ /**
1309
+ * @summary Add a new person.
1310
+ */
1311
+ export const personAddPerson = (
1312
+ personAddPersonBody: PersonAddPersonBody,
1313
+ options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
1314
+ ) => {
1315
+
1316
+
1317
+ return customFetch<Person>(
1318
+ {url: `/api/v1/crm/people`, method: 'POST',
1319
+ headers: {'Content-Type': 'application/json', },
1320
+ data: personAddPersonBody, signal
1321
+ },
1322
+ options);
1323
+ }
1324
+
1325
+
1326
+
1327
+ export const getPersonAddPersonMutationOptions = <TError = void,
1328
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof personAddPerson>>, TError,{data: PersonAddPersonBody}, TContext>, request?: SecondParameter<typeof customFetch>}
1329
+ ): UseMutationOptions<Awaited<ReturnType<typeof personAddPerson>>, TError,{data: PersonAddPersonBody}, TContext> => {
1330
+
1331
+ const mutationKey = ['personAddPerson'];
1332
+ const {mutation: mutationOptions, request: requestOptions} = options ?
1333
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
1334
+ options
1335
+ : {...options, mutation: {...options.mutation, mutationKey}}
1336
+ : {mutation: { mutationKey, }, request: undefined};
1337
+
1338
+
1339
+
1340
+
1341
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof personAddPerson>>, {data: PersonAddPersonBody}> = (props) => {
1342
+ const {data} = props ?? {};
1343
+
1344
+ return personAddPerson(data,requestOptions)
1345
+ }
1346
+
1347
+
1348
+
1349
+
1350
+ return { mutationFn, ...mutationOptions }}
1351
+
1352
+ export type PersonAddPersonMutationResult = NonNullable<Awaited<ReturnType<typeof personAddPerson>>>
1353
+ export type PersonAddPersonMutationBody = PersonAddPersonBody
1354
+ export type PersonAddPersonMutationError = void
1355
+
1356
+ /**
1357
+ * @summary Add a new person.
1358
+ */
1359
+ export const usePersonAddPerson = <TError = void,
1360
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof personAddPerson>>, TError,{data: PersonAddPersonBody}, TContext>, request?: SecondParameter<typeof customFetch>}
1361
+ ): UseMutationResult<
1362
+ Awaited<ReturnType<typeof personAddPerson>>,
1363
+ TError,
1364
+ {data: PersonAddPersonBody},
1365
+ TContext
1366
+ > => {
1367
+
1368
+ const mutationOptions = getPersonAddPersonMutationOptions(options);
1369
+
1370
+ return useMutation(mutationOptions);
1371
+ }
1372
+ /**
1373
+ * @summary Retrieves a person.
1374
+ */
1375
+ export const personGetPerson = (
1376
+ personUid: string | null,
1377
+ options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
1378
+ ) => {
1379
+
1380
+
1381
+ return customFetch<Person>(
1382
+ {url: `/api/v1/crm/people/${personUid}`, method: 'GET', signal
1383
+ },
1384
+ options);
1385
+ }
1386
+
1387
+
1388
+
1389
+
1390
+ export const getPersonGetPersonQueryKey = (personUid?: string | null,) => {
1391
+ return [
1392
+ `/api/v1/crm/people/${personUid}`
1393
+ ] as const;
1394
+ }
1395
+
1396
+
1397
+ 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>}
1398
+ ) => {
1399
+
1400
+ const {query: queryOptions, request: requestOptions} = options ?? {};
1401
+
1402
+ const queryKey = queryOptions?.queryKey ?? getPersonGetPersonQueryKey(personUid);
1403
+
1404
+
1405
+
1406
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof personGetPerson>>> = ({ signal }) => personGetPerson(personUid, requestOptions, signal);
1407
+
1408
+
1409
+
1410
+
1411
+
1412
+ return { queryKey, queryFn, enabled: !!(personUid), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof personGetPerson>>, TError, TData> & { queryKey: QueryKey }
1413
+ }
1414
+
1415
+ export type PersonGetPersonQueryResult = NonNullable<Awaited<ReturnType<typeof personGetPerson>>>
1416
+ export type PersonGetPersonQueryError = void
1417
+
1418
+
1419
+ /**
1420
+ * @summary Retrieves a person.
1421
+ */
1422
+
1423
+ export function usePersonGetPerson<TData = Awaited<ReturnType<typeof personGetPerson>>, TError = void>(
1424
+ personUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof personGetPerson>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
1425
+
1426
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
1427
+
1428
+ const queryOptions = getPersonGetPersonQueryOptions(personUid,options)
1429
+
1430
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
1431
+
1432
+ query.queryKey = queryOptions.queryKey ;
1433
+
1434
+ return query;
1435
+ }
1436
+
1437
+
1438
+
1439
+
1440
+ /**
1441
+ * @summary Update a person record. You can update one or multiple properties on the object.
1442
+ Any property that you include in the json schema will be updated.
1443
+ To update custom properties just include them in the same way that they are included when you do a get on the object.
1444
+ */
1445
+ export const personUpdatePerson = (
1446
+ personUid: string | null,
1447
+ personUpdatePersonBody: PersonUpdatePersonBody,
1448
+ options?: SecondParameter<typeof customFetch>,) => {
1449
+
1450
+
1451
+ return customFetch<Person>(
1452
+ {url: `/api/v1/crm/people/${personUid}`, method: 'PUT',
1453
+ headers: {'Content-Type': 'application/json', },
1454
+ data: personUpdatePersonBody
1455
+ },
1456
+ options);
1457
+ }
1458
+
1459
+
1460
+
1461
+ export const getPersonUpdatePersonMutationOptions = <TError = void,
1462
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof personUpdatePerson>>, TError,{personUid: string | null;data: PersonUpdatePersonBody}, TContext>, request?: SecondParameter<typeof customFetch>}
1463
+ ): UseMutationOptions<Awaited<ReturnType<typeof personUpdatePerson>>, TError,{personUid: string | null;data: PersonUpdatePersonBody}, TContext> => {
1464
+
1465
+ const mutationKey = ['personUpdatePerson'];
1466
+ const {mutation: mutationOptions, request: requestOptions} = options ?
1467
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
1468
+ options
1469
+ : {...options, mutation: {...options.mutation, mutationKey}}
1470
+ : {mutation: { mutationKey, }, request: undefined};
1471
+
1472
+
1473
+
1474
+
1475
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof personUpdatePerson>>, {personUid: string | null;data: PersonUpdatePersonBody}> = (props) => {
1476
+ const {personUid,data} = props ?? {};
1477
+
1478
+ return personUpdatePerson(personUid,data,requestOptions)
1479
+ }
1480
+
1481
+
1482
+
1483
+
1484
+ return { mutationFn, ...mutationOptions }}
1485
+
1486
+ export type PersonUpdatePersonMutationResult = NonNullable<Awaited<ReturnType<typeof personUpdatePerson>>>
1487
+ export type PersonUpdatePersonMutationBody = PersonUpdatePersonBody
1488
+ export type PersonUpdatePersonMutationError = void
1489
+
1490
+ /**
1491
+ * @summary Update a person record. You can update one or multiple properties on the object.
1492
+ Any property that you include in the json schema will be updated.
1493
+ To update custom properties just include them in the same way that they are included when you do a get on the object.
1494
+ */
1495
+ export const usePersonUpdatePerson = <TError = void,
1496
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof personUpdatePerson>>, TError,{personUid: string | null;data: PersonUpdatePersonBody}, TContext>, request?: SecondParameter<typeof customFetch>}
1497
+ ): UseMutationResult<
1498
+ Awaited<ReturnType<typeof personUpdatePerson>>,
1499
+ TError,
1500
+ {personUid: string | null;data: PersonUpdatePersonBody},
1501
+ TContext
1502
+ > => {
1503
+
1504
+ const mutationOptions = getPersonUpdatePersonMutationOptions(options);
1505
+
1506
+ return useMutation(mutationOptions);
1507
+ }
1508
+ /**
1509
+ * @summary Delete a person record.
1510
+ */
1511
+ export const personDeletePerson = (
1512
+ personUid: string | null,
1513
+ options?: SecondParameter<typeof customFetch>,) => {
1514
+
1515
+
1516
+ return customFetch<Blob>(
1517
+ {url: `/api/v1/crm/people/${personUid}`, method: 'DELETE',
1518
+ responseType: 'blob'
1519
+ },
1520
+ options);
1521
+ }
1522
+
1523
+
1524
+
1525
+ export const getPersonDeletePersonMutationOptions = <TError = void,
1526
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof personDeletePerson>>, TError,{personUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
1527
+ ): UseMutationOptions<Awaited<ReturnType<typeof personDeletePerson>>, TError,{personUid: string | null}, TContext> => {
1528
+
1529
+ const mutationKey = ['personDeletePerson'];
1530
+ const {mutation: mutationOptions, request: requestOptions} = options ?
1531
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
1532
+ options
1533
+ : {...options, mutation: {...options.mutation, mutationKey}}
1534
+ : {mutation: { mutationKey, }, request: undefined};
1535
+
1536
+
1537
+
1538
+
1539
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof personDeletePerson>>, {personUid: string | null}> = (props) => {
1540
+ const {personUid} = props ?? {};
1541
+
1542
+ return personDeletePerson(personUid,requestOptions)
1543
+ }
1544
+
1545
+
1546
+
1547
+
1548
+ return { mutationFn, ...mutationOptions }}
1549
+
1550
+ export type PersonDeletePersonMutationResult = NonNullable<Awaited<ReturnType<typeof personDeletePerson>>>
1551
+
1552
+ export type PersonDeletePersonMutationError = void
1553
+
1554
+ /**
1555
+ * @summary Delete a person record.
1556
+ */
1557
+ export const usePersonDeletePerson = <TError = void,
1558
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof personDeletePerson>>, TError,{personUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
1559
+ ): UseMutationResult<
1560
+ Awaited<ReturnType<typeof personDeletePerson>>,
1561
+ TError,
1562
+ {personUid: string | null},
1563
+ TContext
1564
+ > => {
1565
+
1566
+ const mutationOptions = getPersonDeletePersonMutationOptions(options);
1567
+
1568
+ return useMutation(mutationOptions);
1569
+ }
1570
+ /**
1571
+ * @summary Set a temporary password for a user. The user needs to update the password with the next login.
1572
+ */
1573
+ export const personSetTemporaryPassword = (
1574
+ personUid: string | null,
1575
+ personSetTemporaryPasswordBody: PersonSetTemporaryPasswordBody,
1576
+ options?: SecondParameter<typeof customFetch>,) => {
1577
+
1578
+
1579
+ return customFetch<Blob>(
1580
+ {url: `/api/v1/crm/people/${personUid}/setTemporaryPassword`, method: 'PUT',
1581
+ headers: {'Content-Type': 'application/json', },
1582
+ data: personSetTemporaryPasswordBody,
1583
+ responseType: 'blob'
1584
+ },
1585
+ options);
1586
+ }
1587
+
1588
+
1589
+
1590
+ export const getPersonSetTemporaryPasswordMutationOptions = <TError = void,
1591
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof personSetTemporaryPassword>>, TError,{personUid: string | null;data: PersonSetTemporaryPasswordBody}, TContext>, request?: SecondParameter<typeof customFetch>}
1592
+ ): UseMutationOptions<Awaited<ReturnType<typeof personSetTemporaryPassword>>, TError,{personUid: string | null;data: PersonSetTemporaryPasswordBody}, TContext> => {
1593
+
1594
+ const mutationKey = ['personSetTemporaryPassword'];
1595
+ const {mutation: mutationOptions, request: requestOptions} = options ?
1596
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
1597
+ options
1598
+ : {...options, mutation: {...options.mutation, mutationKey}}
1599
+ : {mutation: { mutationKey, }, request: undefined};
1600
+
1601
+
1602
+
1603
+
1604
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof personSetTemporaryPassword>>, {personUid: string | null;data: PersonSetTemporaryPasswordBody}> = (props) => {
1605
+ const {personUid,data} = props ?? {};
1606
+
1607
+ return personSetTemporaryPassword(personUid,data,requestOptions)
1608
+ }
1609
+
1610
+
1611
+
1612
+
1613
+ return { mutationFn, ...mutationOptions }}
1614
+
1615
+ export type PersonSetTemporaryPasswordMutationResult = NonNullable<Awaited<ReturnType<typeof personSetTemporaryPassword>>>
1616
+ export type PersonSetTemporaryPasswordMutationBody = PersonSetTemporaryPasswordBody
1617
+ export type PersonSetTemporaryPasswordMutationError = void
1618
+
1619
+ /**
1620
+ * @summary Set a temporary password for a user. The user needs to update the password with the next login.
1621
+ */
1622
+ export const usePersonSetTemporaryPassword = <TError = void,
1623
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof personSetTemporaryPassword>>, TError,{personUid: string | null;data: PersonSetTemporaryPasswordBody}, TContext>, request?: SecondParameter<typeof customFetch>}
1624
+ ): UseMutationResult<
1625
+ Awaited<ReturnType<typeof personSetTemporaryPassword>>,
1626
+ TError,
1627
+ {personUid: string | null;data: PersonSetTemporaryPasswordBody},
1628
+ TContext
1629
+ > => {
1630
+
1631
+ const mutationOptions = getPersonSetTemporaryPasswordMutationOptions(options);
1632
+
1633
+ return useMutation(mutationOptions);
1634
+ }
1635
+ /**
1636
+ * @summary Initiate the forgot password flow by sending an email to the user with a link to a page
1637
+ where they can reset their password. The reset password token in the link is valid for 30 minutes.
1638
+ */
1639
+ export const personForgotPassword = (
1640
+ personForgotPasswordBody: PersonForgotPasswordBody,
1641
+ options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
1642
+ ) => {
1643
+
1644
+
1645
+ return customFetch<Blob>(
1646
+ {url: `/api/v1/crm/people/forgotPassword`, method: 'POST',
1647
+ headers: {'Content-Type': 'application/json', },
1648
+ data: personForgotPasswordBody,
1649
+ responseType: 'blob', signal
1650
+ },
1651
+ options);
1652
+ }
1653
+
1654
+
1655
+
1656
+ export const getPersonForgotPasswordMutationOptions = <TError = unknown,
1657
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof personForgotPassword>>, TError,{data: PersonForgotPasswordBody}, TContext>, request?: SecondParameter<typeof customFetch>}
1658
+ ): UseMutationOptions<Awaited<ReturnType<typeof personForgotPassword>>, TError,{data: PersonForgotPasswordBody}, TContext> => {
1659
+
1660
+ const mutationKey = ['personForgotPassword'];
1661
+ const {mutation: mutationOptions, request: requestOptions} = options ?
1662
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
1663
+ options
1664
+ : {...options, mutation: {...options.mutation, mutationKey}}
1665
+ : {mutation: { mutationKey, }, request: undefined};
1666
+
1667
+
1668
+
1669
+
1670
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof personForgotPassword>>, {data: PersonForgotPasswordBody}> = (props) => {
1671
+ const {data} = props ?? {};
1672
+
1673
+ return personForgotPassword(data,requestOptions)
1674
+ }
1675
+
1676
+
1677
+
1678
+
1679
+ return { mutationFn, ...mutationOptions }}
1680
+
1681
+ export type PersonForgotPasswordMutationResult = NonNullable<Awaited<ReturnType<typeof personForgotPassword>>>
1682
+ export type PersonForgotPasswordMutationBody = PersonForgotPasswordBody
1683
+ export type PersonForgotPasswordMutationError = unknown
1684
+
1685
+ /**
1686
+ * @summary Initiate the forgot password flow by sending an email to the user with a link to a page
1687
+ where they can reset their password. The reset password token in the link is valid for 30 minutes.
1688
+ */
1689
+ export const usePersonForgotPassword = <TError = unknown,
1690
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof personForgotPassword>>, TError,{data: PersonForgotPasswordBody}, TContext>, request?: SecondParameter<typeof customFetch>}
1691
+ ): UseMutationResult<
1692
+ Awaited<ReturnType<typeof personForgotPassword>>,
1693
+ TError,
1694
+ {data: PersonForgotPasswordBody},
1695
+ TContext
1696
+ > => {
1697
+
1698
+ const mutationOptions = getPersonForgotPasswordMutationOptions(options);
1699
+
1700
+ return useMutation(mutationOptions);
1701
+ }
1702
+