@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,237 +1,27 @@
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 {
3
+ useMutation,
223
4
  useQuery
224
5
  } from '@tanstack/react-query';
225
6
  import type {
7
+ MutationFunction,
226
8
  QueryFunction,
227
9
  QueryKey,
10
+ UseMutationOptions,
11
+ UseMutationResult,
228
12
  UseQueryOptions,
229
13
  UseQueryResult
230
14
  } from '@tanstack/react-query';
231
15
 
232
16
  import type {
17
+ Article,
18
+ ArticleGetAllArticlesParams,
233
19
  Case,
234
- CaseGetAllCasesParams
20
+ CaseAddCaseBody,
21
+ CaseAddCaseParams,
22
+ CaseGetAllCasesParams,
23
+ CaseHistory,
24
+ Category
235
25
  } from '../outsetaAPI.schemas';
236
26
 
237
27
  import { customFetch } from '../../mutator';
@@ -314,3 +104,470 @@ export function useCaseGetAllCases<TData = Awaited<ReturnType<typeof caseGetAllC
314
104
 
315
105
 
316
106
 
107
+ /**
108
+ * @summary Adds a case into the support system.
109
+ */
110
+ export const caseAddCase = (
111
+ caseAddCaseBody: CaseAddCaseBody,
112
+ params?: CaseAddCaseParams,
113
+ options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
114
+ ) => {
115
+
116
+
117
+ return customFetch<Case>(
118
+ {url: `/api/v1/support/cases`, method: 'POST',
119
+ headers: {'Content-Type': 'application/json', },
120
+ data: caseAddCaseBody,
121
+ params, signal
122
+ },
123
+ options);
124
+ }
125
+
126
+
127
+
128
+ export const getCaseAddCaseMutationOptions = <TError = void,
129
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof caseAddCase>>, TError,{data: CaseAddCaseBody;params?: CaseAddCaseParams}, TContext>, request?: SecondParameter<typeof customFetch>}
130
+ ): UseMutationOptions<Awaited<ReturnType<typeof caseAddCase>>, TError,{data: CaseAddCaseBody;params?: CaseAddCaseParams}, TContext> => {
131
+
132
+ const mutationKey = ['caseAddCase'];
133
+ const {mutation: mutationOptions, request: requestOptions} = options ?
134
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
135
+ options
136
+ : {...options, mutation: {...options.mutation, mutationKey}}
137
+ : {mutation: { mutationKey, }, request: undefined};
138
+
139
+
140
+
141
+
142
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof caseAddCase>>, {data: CaseAddCaseBody;params?: CaseAddCaseParams}> = (props) => {
143
+ const {data,params} = props ?? {};
144
+
145
+ return caseAddCase(data,params,requestOptions)
146
+ }
147
+
148
+
149
+
150
+
151
+ return { mutationFn, ...mutationOptions }}
152
+
153
+ export type CaseAddCaseMutationResult = NonNullable<Awaited<ReturnType<typeof caseAddCase>>>
154
+ export type CaseAddCaseMutationBody = CaseAddCaseBody
155
+ export type CaseAddCaseMutationError = void
156
+
157
+ /**
158
+ * @summary Adds a case into the support system.
159
+ */
160
+ export const useCaseAddCase = <TError = void,
161
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof caseAddCase>>, TError,{data: CaseAddCaseBody;params?: CaseAddCaseParams}, TContext>, request?: SecondParameter<typeof customFetch>}
162
+ ): UseMutationResult<
163
+ Awaited<ReturnType<typeof caseAddCase>>,
164
+ TError,
165
+ {data: CaseAddCaseBody;params?: CaseAddCaseParams},
166
+ TContext
167
+ > => {
168
+
169
+ const mutationOptions = getCaseAddCaseMutationOptions(options);
170
+
171
+ return useMutation(mutationOptions);
172
+ }
173
+ /**
174
+ * @summary Retrieve a specific case
175
+ */
176
+ export const caseGetCase = (
177
+ caseUid: string | null,
178
+ options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
179
+ ) => {
180
+
181
+
182
+ return customFetch<Case>(
183
+ {url: `/api/v1/support/cases/${caseUid}`, method: 'GET', signal
184
+ },
185
+ options);
186
+ }
187
+
188
+
189
+
190
+
191
+ export const getCaseGetCaseQueryKey = (caseUid?: string | null,) => {
192
+ return [
193
+ `/api/v1/support/cases/${caseUid}`
194
+ ] as const;
195
+ }
196
+
197
+
198
+ export const getCaseGetCaseQueryOptions = <TData = Awaited<ReturnType<typeof caseGetCase>>, TError = void>(caseUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof caseGetCase>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
199
+ ) => {
200
+
201
+ const {query: queryOptions, request: requestOptions} = options ?? {};
202
+
203
+ const queryKey = queryOptions?.queryKey ?? getCaseGetCaseQueryKey(caseUid);
204
+
205
+
206
+
207
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof caseGetCase>>> = ({ signal }) => caseGetCase(caseUid, requestOptions, signal);
208
+
209
+
210
+
211
+
212
+
213
+ return { queryKey, queryFn, enabled: !!(caseUid), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof caseGetCase>>, TError, TData> & { queryKey: QueryKey }
214
+ }
215
+
216
+ export type CaseGetCaseQueryResult = NonNullable<Awaited<ReturnType<typeof caseGetCase>>>
217
+ export type CaseGetCaseQueryError = void
218
+
219
+
220
+ /**
221
+ * @summary Retrieve a specific case
222
+ */
223
+
224
+ export function useCaseGetCase<TData = Awaited<ReturnType<typeof caseGetCase>>, TError = void>(
225
+ caseUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof caseGetCase>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
226
+
227
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
228
+
229
+ const queryOptions = getCaseGetCaseQueryOptions(caseUid,options)
230
+
231
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
232
+
233
+ query.queryKey = queryOptions.queryKey ;
234
+
235
+ return query;
236
+ }
237
+
238
+
239
+
240
+
241
+ /**
242
+ * @summary Adds a reply from an agent to a support case.
243
+ */
244
+ export const caseAddReply = (
245
+ caseUid: string | null,
246
+ options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
247
+ ) => {
248
+
249
+
250
+ return customFetch<Blob>(
251
+ {url: `/api/v1/support/cases/${caseUid}/replies`, method: 'POST',
252
+ responseType: 'blob', signal
253
+ },
254
+ options);
255
+ }
256
+
257
+
258
+
259
+ export const getCaseAddReplyMutationOptions = <TError = void,
260
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof caseAddReply>>, TError,{caseUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
261
+ ): UseMutationOptions<Awaited<ReturnType<typeof caseAddReply>>, TError,{caseUid: string | null}, TContext> => {
262
+
263
+ const mutationKey = ['caseAddReply'];
264
+ const {mutation: mutationOptions, request: requestOptions} = options ?
265
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
266
+ options
267
+ : {...options, mutation: {...options.mutation, mutationKey}}
268
+ : {mutation: { mutationKey, }, request: undefined};
269
+
270
+
271
+
272
+
273
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof caseAddReply>>, {caseUid: string | null}> = (props) => {
274
+ const {caseUid} = props ?? {};
275
+
276
+ return caseAddReply(caseUid,requestOptions)
277
+ }
278
+
279
+
280
+
281
+
282
+ return { mutationFn, ...mutationOptions }}
283
+
284
+ export type CaseAddReplyMutationResult = NonNullable<Awaited<ReturnType<typeof caseAddReply>>>
285
+
286
+ export type CaseAddReplyMutationError = void
287
+
288
+ /**
289
+ * @summary Adds a reply from an agent to a support case.
290
+ */
291
+ export const useCaseAddReply = <TError = void,
292
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof caseAddReply>>, TError,{caseUid: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
293
+ ): UseMutationResult<
294
+ Awaited<ReturnType<typeof caseAddReply>>,
295
+ TError,
296
+ {caseUid: string | null},
297
+ TContext
298
+ > => {
299
+
300
+ const mutationOptions = getCaseAddReplyMutationOptions(options);
301
+
302
+ return useMutation(mutationOptions);
303
+ }
304
+ /**
305
+ * @summary Adds a response to the case from the person that opened the case.
306
+ */
307
+ export const caseAddClientResponse = (
308
+ caseUid: string | null,
309
+ comment: string | null,
310
+ options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
311
+ ) => {
312
+
313
+
314
+ return customFetch<CaseHistory>(
315
+ {url: `/api/v1/support/cases/${caseUid}/clientresponse/${comment}`, method: 'POST', signal
316
+ },
317
+ options);
318
+ }
319
+
320
+
321
+
322
+ export const getCaseAddClientResponseMutationOptions = <TError = void,
323
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof caseAddClientResponse>>, TError,{caseUid: string | null;comment: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
324
+ ): UseMutationOptions<Awaited<ReturnType<typeof caseAddClientResponse>>, TError,{caseUid: string | null;comment: string | null}, TContext> => {
325
+
326
+ const mutationKey = ['caseAddClientResponse'];
327
+ const {mutation: mutationOptions, request: requestOptions} = options ?
328
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
329
+ options
330
+ : {...options, mutation: {...options.mutation, mutationKey}}
331
+ : {mutation: { mutationKey, }, request: undefined};
332
+
333
+
334
+
335
+
336
+ const mutationFn: MutationFunction<Awaited<ReturnType<typeof caseAddClientResponse>>, {caseUid: string | null;comment: string | null}> = (props) => {
337
+ const {caseUid,comment} = props ?? {};
338
+
339
+ return caseAddClientResponse(caseUid,comment,requestOptions)
340
+ }
341
+
342
+
343
+
344
+
345
+ return { mutationFn, ...mutationOptions }}
346
+
347
+ export type CaseAddClientResponseMutationResult = NonNullable<Awaited<ReturnType<typeof caseAddClientResponse>>>
348
+
349
+ export type CaseAddClientResponseMutationError = void
350
+
351
+ /**
352
+ * @summary Adds a response to the case from the person that opened the case.
353
+ */
354
+ export const useCaseAddClientResponse = <TError = void,
355
+ TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof caseAddClientResponse>>, TError,{caseUid: string | null;comment: string | null}, TContext>, request?: SecondParameter<typeof customFetch>}
356
+ ): UseMutationResult<
357
+ Awaited<ReturnType<typeof caseAddClientResponse>>,
358
+ TError,
359
+ {caseUid: string | null;comment: string | null},
360
+ TContext
361
+ > => {
362
+
363
+ const mutationOptions = getCaseAddClientResponseMutationOptions(options);
364
+
365
+ return useMutation(mutationOptions);
366
+ }
367
+ /**
368
+ * @summary Retrieves all knowledge base articles.
369
+ Matches on title or body of the article"
370
+ */
371
+ export const articleGetAllArticles = (
372
+ params?: ArticleGetAllArticlesParams,
373
+ options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
374
+ ) => {
375
+
376
+
377
+ return customFetch<Article[]>(
378
+ {url: `/api/v1/support/articles`, method: 'GET',
379
+ params, signal
380
+ },
381
+ options);
382
+ }
383
+
384
+
385
+
386
+
387
+ export const getArticleGetAllArticlesQueryKey = (params?: ArticleGetAllArticlesParams,) => {
388
+ return [
389
+ `/api/v1/support/articles`, ...(params ? [params]: [])
390
+ ] as const;
391
+ }
392
+
393
+
394
+ export const getArticleGetAllArticlesQueryOptions = <TData = Awaited<ReturnType<typeof articleGetAllArticles>>, TError = unknown>(params?: ArticleGetAllArticlesParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof articleGetAllArticles>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
395
+ ) => {
396
+
397
+ const {query: queryOptions, request: requestOptions} = options ?? {};
398
+
399
+ const queryKey = queryOptions?.queryKey ?? getArticleGetAllArticlesQueryKey(params);
400
+
401
+
402
+
403
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof articleGetAllArticles>>> = ({ signal }) => articleGetAllArticles(params, requestOptions, signal);
404
+
405
+
406
+
407
+
408
+
409
+ return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof articleGetAllArticles>>, TError, TData> & { queryKey: QueryKey }
410
+ }
411
+
412
+ export type ArticleGetAllArticlesQueryResult = NonNullable<Awaited<ReturnType<typeof articleGetAllArticles>>>
413
+ export type ArticleGetAllArticlesQueryError = unknown
414
+
415
+
416
+ /**
417
+ * @summary Retrieves all knowledge base articles.
418
+ Matches on title or body of the article"
419
+ */
420
+
421
+ export function useArticleGetAllArticles<TData = Awaited<ReturnType<typeof articleGetAllArticles>>, TError = unknown>(
422
+ params?: ArticleGetAllArticlesParams, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof articleGetAllArticles>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
423
+
424
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
425
+
426
+ const queryOptions = getArticleGetAllArticlesQueryOptions(params,options)
427
+
428
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
429
+
430
+ query.queryKey = queryOptions.queryKey ;
431
+
432
+ return query;
433
+ }
434
+
435
+
436
+
437
+
438
+ /**
439
+ * @summary Retrieves a knowledge base article.
440
+ */
441
+ export const articleGetArticle = (
442
+ articleUid: string | null,
443
+ options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
444
+ ) => {
445
+
446
+
447
+ return customFetch<Article>(
448
+ {url: `/api/v1/support/articles/${articleUid}`, method: 'GET', signal
449
+ },
450
+ options);
451
+ }
452
+
453
+
454
+
455
+
456
+ export const getArticleGetArticleQueryKey = (articleUid?: string | null,) => {
457
+ return [
458
+ `/api/v1/support/articles/${articleUid}`
459
+ ] as const;
460
+ }
461
+
462
+
463
+ export const getArticleGetArticleQueryOptions = <TData = Awaited<ReturnType<typeof articleGetArticle>>, TError = void>(articleUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof articleGetArticle>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
464
+ ) => {
465
+
466
+ const {query: queryOptions, request: requestOptions} = options ?? {};
467
+
468
+ const queryKey = queryOptions?.queryKey ?? getArticleGetArticleQueryKey(articleUid);
469
+
470
+
471
+
472
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof articleGetArticle>>> = ({ signal }) => articleGetArticle(articleUid, requestOptions, signal);
473
+
474
+
475
+
476
+
477
+
478
+ return { queryKey, queryFn, enabled: !!(articleUid), ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof articleGetArticle>>, TError, TData> & { queryKey: QueryKey }
479
+ }
480
+
481
+ export type ArticleGetArticleQueryResult = NonNullable<Awaited<ReturnType<typeof articleGetArticle>>>
482
+ export type ArticleGetArticleQueryError = void
483
+
484
+
485
+ /**
486
+ * @summary Retrieves a knowledge base article.
487
+ */
488
+
489
+ export function useArticleGetArticle<TData = Awaited<ReturnType<typeof articleGetArticle>>, TError = void>(
490
+ articleUid: string | null, options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof articleGetArticle>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
491
+
492
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
493
+
494
+ const queryOptions = getArticleGetArticleQueryOptions(articleUid,options)
495
+
496
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
497
+
498
+ query.queryKey = queryOptions.queryKey ;
499
+
500
+ return query;
501
+ }
502
+
503
+
504
+
505
+
506
+ /**
507
+ * @summary Retrieves all knowledge base categories.
508
+ */
509
+ export const categoryGetAllCategories = (
510
+
511
+ options?: SecondParameter<typeof customFetch>,signal?: AbortSignal
512
+ ) => {
513
+
514
+
515
+ return customFetch<Category[]>(
516
+ {url: `/api/v1/support/categories`, method: 'GET', signal
517
+ },
518
+ options);
519
+ }
520
+
521
+
522
+
523
+
524
+ export const getCategoryGetAllCategoriesQueryKey = () => {
525
+ return [
526
+ `/api/v1/support/categories`
527
+ ] as const;
528
+ }
529
+
530
+
531
+ export const getCategoryGetAllCategoriesQueryOptions = <TData = Awaited<ReturnType<typeof categoryGetAllCategories>>, TError = unknown>( options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof categoryGetAllCategories>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
532
+ ) => {
533
+
534
+ const {query: queryOptions, request: requestOptions} = options ?? {};
535
+
536
+ const queryKey = queryOptions?.queryKey ?? getCategoryGetAllCategoriesQueryKey();
537
+
538
+
539
+
540
+ const queryFn: QueryFunction<Awaited<ReturnType<typeof categoryGetAllCategories>>> = ({ signal }) => categoryGetAllCategories(requestOptions, signal);
541
+
542
+
543
+
544
+
545
+
546
+ return { queryKey, queryFn, ...queryOptions} as UseQueryOptions<Awaited<ReturnType<typeof categoryGetAllCategories>>, TError, TData> & { queryKey: QueryKey }
547
+ }
548
+
549
+ export type CategoryGetAllCategoriesQueryResult = NonNullable<Awaited<ReturnType<typeof categoryGetAllCategories>>>
550
+ export type CategoryGetAllCategoriesQueryError = unknown
551
+
552
+
553
+ /**
554
+ * @summary Retrieves all knowledge base categories.
555
+ */
556
+
557
+ export function useCategoryGetAllCategories<TData = Awaited<ReturnType<typeof categoryGetAllCategories>>, TError = unknown>(
558
+ options?: { query?:UseQueryOptions<Awaited<ReturnType<typeof categoryGetAllCategories>>, TError, TData>, request?: SecondParameter<typeof customFetch>}
559
+
560
+ ): UseQueryResult<TData, TError> & { queryKey: QueryKey } {
561
+
562
+ const queryOptions = getCategoryGetAllCategoriesQueryOptions(options)
563
+
564
+ const query = useQuery(queryOptions) as UseQueryResult<TData, TError> & { queryKey: QueryKey };
565
+
566
+ query.queryKey = queryOptions.queryKey ;
567
+
568
+ return query;
569
+ }
570
+
571
+
572
+
573
+