@outseta/api-client 0.1.1 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/README.md +6 -8
  2. package/dist/index.js +23 -19
  3. package/package.json +3 -6
  4. package/src/__tests__/accounts-crud.integration.test.ts +41 -39
  5. package/src/__tests__/client.test.ts +3 -3
  6. package/src/__tests__/people.integration.test.ts +28 -32
  7. package/src/__tests__/setup.ts +5 -6
  8. package/src/__tests__/support.integration.test.ts +28 -35
  9. package/src/client.ts +55 -24
  10. package/src/generated/activity/activity.ts +335 -0
  11. package/src/generated/billing/billing.ts +1006 -0
  12. package/src/generated/crm/crm.ts +1143 -1
  13. package/src/generated/email/email.ts +798 -0
  14. package/src/generated/models/accountAddPersonToAccountBody.ts +227 -0
  15. package/src/generated/models/accountCancelAccountBody.ts +227 -0
  16. package/src/generated/models/accountCancelationAllOf.ts +2 -0
  17. package/src/generated/models/accountExtendTrialBody.ts +227 -0
  18. package/src/generated/models/accountStage.ts +2 -1
  19. package/src/generated/models/accountUpdateAccountBody.ts +227 -0
  20. package/src/generated/models/accountUpdateMembershipBody.ts +227 -0
  21. package/src/generated/models/activityAddCustomActivityBody.ts +227 -0
  22. package/src/generated/models/activityGetAllParams.ts +241 -0
  23. package/src/generated/models/articleGetAllArticlesParams.ts +228 -0
  24. package/src/generated/models/backGroundTaskType.ts +3 -1
  25. package/src/generated/models/broadcastCampaignAllOf.ts +4 -0
  26. package/src/generated/models/broadcastCampaignStatus.ts +2 -1
  27. package/src/generated/models/campaignAddBroadcastEmailBody.ts +227 -0
  28. package/src/generated/models/campaignSendTestCampaignEmailBody.ts +227 -0
  29. package/src/generated/models/campaignUpdateBroadcastEmailBody.ts +227 -0
  30. package/src/generated/models/cancelationStatus.ts +236 -0
  31. package/src/generated/models/caseAddCaseBody.ts +227 -0
  32. package/src/generated/models/caseAddCaseParams.ts +229 -0
  33. package/src/generated/models/crmSettingsAllOf.ts +2 -0
  34. package/src/generated/models/dealAddDealBody.ts +227 -0
  35. package/src/generated/models/dealGetAllDealsParams.ts +234 -0
  36. package/src/generated/models/dealUpdateDealBody.ts +227 -0
  37. package/src/generated/models/discountCouponAddDiscountCouponBody.ts +227 -0
  38. package/src/generated/models/dnsEntry.ts +2 -0
  39. package/src/generated/models/emailListAddSubscriptionBody.ts +227 -0
  40. package/src/generated/models/emailListGetAllSubscriptionsParams.ts +229 -0
  41. package/src/generated/models/extendSubscriptionOptions.ts +225 -0
  42. package/src/generated/models/index.ts +40 -0
  43. package/src/generated/models/invoiceAddInvoiceBody.ts +227 -0
  44. package/src/generated/models/invoiceAllOf.ts +8 -0
  45. package/src/generated/models/messageAllOf.ts +1 -0
  46. package/src/generated/models/paymentInformationSavePaymentInformationBody.ts +227 -0
  47. package/src/generated/models/personAddPersonBody.ts +227 -0
  48. package/src/generated/models/personAllOf.ts +3 -3
  49. package/src/generated/models/personForgotPasswordBody.ts +227 -0
  50. package/src/generated/models/personGetAllPeopleParams.ts +229 -0
  51. package/src/generated/models/personSetTemporaryPasswordBody.ts +227 -0
  52. package/src/generated/models/personUpdatePersonBody.ts +227 -0
  53. package/src/generated/models/qcountConfigSettingType.ts +3 -1
  54. package/src/generated/models/resendEmailsRequest.ts +226 -0
  55. package/src/generated/models/sendGridDomainAuthenticationAllOf.ts +1 -0
  56. package/src/generated/models/setupIntent.ts +2 -0
  57. package/src/generated/models/stripeCreditNoteAllOf.ts +9 -0
  58. package/src/generated/models/stripeInvoiceAllOf.ts +9 -0
  59. package/src/generated/models/stripePriceAllOf.ts +2 -0
  60. package/src/generated/models/stripeProductAllOf.ts +5 -0
  61. package/src/generated/models/stripeSubscriptionAllOf.ts +4 -0
  62. package/src/generated/models/subscriptionAddOnAddSubscriptionAddOnBody.ts +227 -0
  63. package/src/generated/models/subscriptionChangeSubscriptionBody.ts +227 -0
  64. package/src/generated/models/subscriptionChangeSubscriptionParams.ts +229 -0
  65. package/src/generated/models/subscriptionChangeSubscriptionPreviewBody.ts +227 -0
  66. package/src/generated/models/subscriptionChangeSubscriptionPreviewParams.ts +229 -0
  67. package/src/generated/models/subscriptionFirstTimeSubscriptionBody.ts +227 -0
  68. package/src/generated/models/subscriptionFirstTimeSubscriptionPreviewBody.ts +227 -0
  69. package/src/generated/models/subscriptionFirstTimeSubscriptionPreviewParams.ts +229 -0
  70. package/src/generated/models/subscriptionSetSubscriptionUpgradeRequiredBody.ts +227 -0
  71. package/src/generated/models/transactionsAddPaymentTransactionBody.ts +227 -0
  72. package/src/generated/models/usageAddUsageBody.ts +227 -0
  73. package/src/generated/support/support.ts +341 -1
  74. package/src/index.ts +7 -1
  75. package/src/generated/zod.ts +0 -191087
@@ -0,0 +1,227 @@
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
+ import type { Usage } from './usage';
223
+
224
+ /**
225
+ * @nullable
226
+ */
227
+ export type UsageAddUsageBody = Usage | null;
@@ -220,8 +220,14 @@ For help regarding the Outseta API please email [support@outseta.com](mailto:sup
220
220
  * OpenAPI spec version: v1
221
221
  */
222
222
  import type {
223
+ Article,
224
+ ArticleGetAllArticlesParams,
223
225
  Case,
224
- CaseGetAllCasesParams
226
+ CaseAddCaseBody,
227
+ CaseAddCaseParams,
228
+ CaseGetAllCasesParams,
229
+ CaseHistory,
230
+ Category
225
231
  } from '.././models';
226
232
 
227
233
  import { customFetch } from '../../client';
@@ -282,3 +288,337 @@ export const caseGetAllCases = async (params?: CaseGetAllCasesParams, options?:
282
288
  );}
283
289
 
284
290
 
291
+ /**
292
+ * @summary Adds a case into the support system.
293
+ */
294
+ export type caseAddCaseResponse200 = {
295
+ data: Case
296
+ status: 200
297
+ }
298
+
299
+ export type caseAddCaseResponse401 = {
300
+ data: void
301
+ status: 401
302
+ }
303
+
304
+ export type caseAddCaseResponseSuccess = (caseAddCaseResponse200) & {
305
+ headers: Headers;
306
+ };
307
+ export type caseAddCaseResponseError = (caseAddCaseResponse401) & {
308
+ headers: Headers;
309
+ };
310
+
311
+ export type caseAddCaseResponse = (caseAddCaseResponseSuccess | caseAddCaseResponseError)
312
+
313
+ export const getCaseAddCaseUrl = (params?: CaseAddCaseParams,) => {
314
+ const normalizedParams = new URLSearchParams();
315
+
316
+ Object.entries(params || {}).forEach(([key, value]) => {
317
+
318
+ if (value !== undefined) {
319
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
320
+ }
321
+ });
322
+
323
+ const stringifiedParams = normalizedParams.toString();
324
+
325
+ return stringifiedParams.length > 0 ? `/api/v1/support/cases?${stringifiedParams}` : `/api/v1/support/cases`
326
+ }
327
+
328
+ export const caseAddCase = async (caseAddCaseBody: CaseAddCaseBody,
329
+ params?: CaseAddCaseParams, options?: RequestInit): Promise<caseAddCaseResponse> => {
330
+
331
+ return customFetch<caseAddCaseResponse>(getCaseAddCaseUrl(params),
332
+ {
333
+ ...options,
334
+ method: 'POST',
335
+ headers: { 'Content-Type': 'application/json', ...options?.headers },
336
+ body: JSON.stringify(
337
+ caseAddCaseBody,)
338
+ }
339
+ );}
340
+
341
+
342
+ /**
343
+ * @summary Retrieve a specific case
344
+ */
345
+ export type caseGetCaseResponse200 = {
346
+ data: Case
347
+ status: 200
348
+ }
349
+
350
+ export type caseGetCaseResponse400 = {
351
+ data: void
352
+ status: 400
353
+ }
354
+
355
+ export type caseGetCaseResponse401 = {
356
+ data: void
357
+ status: 401
358
+ }
359
+
360
+ export type caseGetCaseResponse404 = {
361
+ data: void
362
+ status: 404
363
+ }
364
+
365
+ export type caseGetCaseResponseSuccess = (caseGetCaseResponse200) & {
366
+ headers: Headers;
367
+ };
368
+ export type caseGetCaseResponseError = (caseGetCaseResponse400 | caseGetCaseResponse401 | caseGetCaseResponse404) & {
369
+ headers: Headers;
370
+ };
371
+
372
+ export type caseGetCaseResponse = (caseGetCaseResponseSuccess | caseGetCaseResponseError)
373
+
374
+ export const getCaseGetCaseUrl = (caseUid: string | null,) => {
375
+
376
+
377
+
378
+
379
+ return `/api/v1/support/cases/${caseUid}`
380
+ }
381
+
382
+ export const caseGetCase = async (caseUid: string | null, options?: RequestInit): Promise<caseGetCaseResponse> => {
383
+
384
+ return customFetch<caseGetCaseResponse>(getCaseGetCaseUrl(caseUid),
385
+ {
386
+ ...options,
387
+ method: 'GET'
388
+
389
+
390
+ }
391
+ );}
392
+
393
+
394
+ /**
395
+ * @summary Adds a reply from an agent to a support case.
396
+ */
397
+ export type caseAddReplyResponse200 = {
398
+ data: Blob
399
+ status: 200
400
+ }
401
+
402
+ export type caseAddReplyResponse400 = {
403
+ data: void
404
+ status: 400
405
+ }
406
+
407
+ export type caseAddReplyResponse401 = {
408
+ data: void
409
+ status: 401
410
+ }
411
+
412
+ export type caseAddReplyResponse404 = {
413
+ data: void
414
+ status: 404
415
+ }
416
+
417
+ export type caseAddReplyResponseSuccess = (caseAddReplyResponse200) & {
418
+ headers: Headers;
419
+ };
420
+ export type caseAddReplyResponseError = (caseAddReplyResponse400 | caseAddReplyResponse401 | caseAddReplyResponse404) & {
421
+ headers: Headers;
422
+ };
423
+
424
+ export type caseAddReplyResponse = (caseAddReplyResponseSuccess | caseAddReplyResponseError)
425
+
426
+ export const getCaseAddReplyUrl = (caseUid: string | null,) => {
427
+
428
+
429
+
430
+
431
+ return `/api/v1/support/cases/${caseUid}/replies`
432
+ }
433
+
434
+ export const caseAddReply = async (caseUid: string | null, options?: RequestInit): Promise<caseAddReplyResponse> => {
435
+
436
+ return customFetch<caseAddReplyResponse>(getCaseAddReplyUrl(caseUid),
437
+ {
438
+ ...options,
439
+ method: 'POST'
440
+
441
+
442
+ }
443
+ );}
444
+
445
+
446
+ /**
447
+ * @summary Adds a response to the case from the person that opened the case.
448
+ */
449
+ export type caseAddClientResponseResponse200 = {
450
+ data: CaseHistory
451
+ status: 200
452
+ }
453
+
454
+ export type caseAddClientResponseResponse400 = {
455
+ data: void
456
+ status: 400
457
+ }
458
+
459
+ export type caseAddClientResponseResponse401 = {
460
+ data: void
461
+ status: 401
462
+ }
463
+
464
+ export type caseAddClientResponseResponse404 = {
465
+ data: void
466
+ status: 404
467
+ }
468
+
469
+ export type caseAddClientResponseResponseSuccess = (caseAddClientResponseResponse200) & {
470
+ headers: Headers;
471
+ };
472
+ export type caseAddClientResponseResponseError = (caseAddClientResponseResponse400 | caseAddClientResponseResponse401 | caseAddClientResponseResponse404) & {
473
+ headers: Headers;
474
+ };
475
+
476
+ export type caseAddClientResponseResponse = (caseAddClientResponseResponseSuccess | caseAddClientResponseResponseError)
477
+
478
+ export const getCaseAddClientResponseUrl = (caseUid: string | null,
479
+ comment: string | null,) => {
480
+
481
+
482
+
483
+
484
+ return `/api/v1/support/cases/${caseUid}/clientresponse/${comment}`
485
+ }
486
+
487
+ export const caseAddClientResponse = async (caseUid: string | null,
488
+ comment: string | null, options?: RequestInit): Promise<caseAddClientResponseResponse> => {
489
+
490
+ return customFetch<caseAddClientResponseResponse>(getCaseAddClientResponseUrl(caseUid,comment),
491
+ {
492
+ ...options,
493
+ method: 'POST'
494
+
495
+
496
+ }
497
+ );}
498
+
499
+
500
+ /**
501
+ * @summary Retrieves all knowledge base articles.
502
+ Matches on title or body of the article"
503
+ */
504
+ export type articleGetAllArticlesResponse200 = {
505
+ data: Article[]
506
+ status: 200
507
+ }
508
+
509
+ export type articleGetAllArticlesResponseSuccess = (articleGetAllArticlesResponse200) & {
510
+ headers: Headers;
511
+ };
512
+ ;
513
+
514
+ export type articleGetAllArticlesResponse = (articleGetAllArticlesResponseSuccess)
515
+
516
+ export const getArticleGetAllArticlesUrl = (params?: ArticleGetAllArticlesParams,) => {
517
+ const normalizedParams = new URLSearchParams();
518
+
519
+ Object.entries(params || {}).forEach(([key, value]) => {
520
+
521
+ if (value !== undefined) {
522
+ normalizedParams.append(key, value === null ? 'null' : value.toString())
523
+ }
524
+ });
525
+
526
+ const stringifiedParams = normalizedParams.toString();
527
+
528
+ return stringifiedParams.length > 0 ? `/api/v1/support/articles?${stringifiedParams}` : `/api/v1/support/articles`
529
+ }
530
+
531
+ export const articleGetAllArticles = async (params?: ArticleGetAllArticlesParams, options?: RequestInit): Promise<articleGetAllArticlesResponse> => {
532
+
533
+ return customFetch<articleGetAllArticlesResponse>(getArticleGetAllArticlesUrl(params),
534
+ {
535
+ ...options,
536
+ method: 'GET'
537
+
538
+
539
+ }
540
+ );}
541
+
542
+
543
+ /**
544
+ * @summary Retrieves a knowledge base article.
545
+ */
546
+ export type articleGetArticleResponse200 = {
547
+ data: Article
548
+ status: 200
549
+ }
550
+
551
+ export type articleGetArticleResponse400 = {
552
+ data: void
553
+ status: 400
554
+ }
555
+
556
+ export type articleGetArticleResponse404 = {
557
+ data: void
558
+ status: 404
559
+ }
560
+
561
+ export type articleGetArticleResponseSuccess = (articleGetArticleResponse200) & {
562
+ headers: Headers;
563
+ };
564
+ export type articleGetArticleResponseError = (articleGetArticleResponse400 | articleGetArticleResponse404) & {
565
+ headers: Headers;
566
+ };
567
+
568
+ export type articleGetArticleResponse = (articleGetArticleResponseSuccess | articleGetArticleResponseError)
569
+
570
+ export const getArticleGetArticleUrl = (articleUid: string | null,) => {
571
+
572
+
573
+
574
+
575
+ return `/api/v1/support/articles/${articleUid}`
576
+ }
577
+
578
+ export const articleGetArticle = async (articleUid: string | null, options?: RequestInit): Promise<articleGetArticleResponse> => {
579
+
580
+ return customFetch<articleGetArticleResponse>(getArticleGetArticleUrl(articleUid),
581
+ {
582
+ ...options,
583
+ method: 'GET'
584
+
585
+
586
+ }
587
+ );}
588
+
589
+
590
+ /**
591
+ * @summary Retrieves all knowledge base categories.
592
+ */
593
+ export type categoryGetAllCategoriesResponse200 = {
594
+ data: Category[]
595
+ status: 200
596
+ }
597
+
598
+ export type categoryGetAllCategoriesResponseSuccess = (categoryGetAllCategoriesResponse200) & {
599
+ headers: Headers;
600
+ };
601
+ ;
602
+
603
+ export type categoryGetAllCategoriesResponse = (categoryGetAllCategoriesResponseSuccess)
604
+
605
+ export const getCategoryGetAllCategoriesUrl = () => {
606
+
607
+
608
+
609
+
610
+ return `/api/v1/support/categories`
611
+ }
612
+
613
+ export const categoryGetAllCategories = async ( options?: RequestInit): Promise<categoryGetAllCategoriesResponse> => {
614
+
615
+ return customFetch<categoryGetAllCategoriesResponse>(getCategoryGetAllCategoriesUrl(),
616
+ {
617
+ ...options,
618
+ method: 'GET'
619
+
620
+
621
+ }
622
+ );}
623
+
624
+
package/src/index.ts CHANGED
@@ -1,5 +1,11 @@
1
1
  export { createClient, customFetch } from "./client.js";
2
- export type { OutsetaCredentials } from "./client.js";
2
+ export type {
3
+ OutsetaCredentials,
4
+ OutsetaApiKeyCredentials,
5
+ OutsetaBearerCredentials,
6
+ OutsetaClient,
7
+ OutsetaRequestInit,
8
+ } from "./client.js";
3
9
 
4
10
  // Re-export generated types and functions once generated
5
11
  // export * from "./generated/index.js";