Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -416,14 +416,12 @@ run();

[`ScalarError`](./src/models/errors/scalarerror.ts) is the base class for all HTTP error responses. It has the following properties:

| Property | Type | Description |
| ------------------- | ---------- | --------------------------------------------------------------------------------------- |
| `error.message` | `string` | Error message |
| `error.statusCode` | `number` | HTTP response status code eg `404` |
| `error.headers` | `Headers` | HTTP response headers |
| `error.body` | `string` | HTTP body. Can be empty string if no body is returned. |
| `error.rawResponse` | `Response` | Raw HTTP response |
| `error.data$` | | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). |
| Property | Type | Description |
| ------------------------- | ---------- | --------------------------------------------------------------------------------------- |
| `error.message` | `string` | Error message |
| `error.httpMeta.response` | `Response` | HTTP response. Access to headers and more. |
| `error.httpMeta.request` | `Request` | HTTP request. Access to headers and more. |
| `error.data$` | | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). |

### Example
```typescript
Expand All @@ -443,9 +441,9 @@ async function run() {
// The base class for HTTP error responses
if (error instanceof errors.ScalarError) {
console.log(error.message);
console.log(error.statusCode);
console.log(error.body);
console.log(error.headers);
console.log(error.httpMeta.response.status);
console.log(error.httpMeta.response.headers);
console.log(error.httpMeta.request);

// Depending on the method different errors may be thrown
if (error instanceof errors.FourHundred) {
Expand Down
16 changes: 16 additions & 0 deletions docs/models/components/httpmetadata.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# HTTPMetadata

## Example Usage

```typescript
import { HTTPMetadata } from "@scalar/sdk/models/components";

let value: HTTPMetadata = {};
```

## Fields

| Field | Type | Required | Description |
| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- |
| `response` | [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response) | :heavy_check_mark: | Raw HTTP response; suitable for custom response parsing |
| `request` | *Request* | :heavy_check_mark: | Raw HTTP request; suitable for debugging |
16 changes: 16 additions & 0 deletions docs/models/operations/addapidocumentaccessgroupresponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# AddApiDocumentAccessGroupResponse

## Example Usage

```typescript
import { AddApiDocumentAccessGroupResponse } from "@scalar/sdk/models/operations";

let value: AddApiDocumentAccessGroupResponse = {};
```

## Fields

| Field | Type | Required | Description |
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A |
| `any` | *any* | :heavy_minus_sign: | Default Response |
16 changes: 16 additions & 0 deletions docs/models/operations/addrulesetaccessgroupresponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# AddRulesetAccessGroupResponse

## Example Usage

```typescript
import { AddRulesetAccessGroupResponse } from "@scalar/sdk/models/operations";

let value: AddRulesetAccessGroupResponse = {};
```

## Fields

| Field | Type | Required | Description |
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A |
| `any` | *any* | :heavy_minus_sign: | Default Response |
16 changes: 16 additions & 0 deletions docs/models/operations/addschemaaccessgroupresponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# AddSchemaAccessGroupResponse

## Example Usage

```typescript
import { AddSchemaAccessGroupResponse } from "@scalar/sdk/models/operations";

let value: AddSchemaAccessGroupResponse = {};
```

## Fields

| Field | Type | Required | Description |
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A |
| `any` | *any* | :heavy_minus_sign: | Default Response |
16 changes: 16 additions & 0 deletions docs/models/operations/createapidocumentresponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# CreateApiDocumentResponse

## Example Usage

```typescript
import { CreateApiDocumentResponse } from "@scalar/sdk/models/operations";

let value: CreateApiDocumentResponse = {};
```

## Fields

| Field | Type | Required | Description |
| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A |
| `object` | [operations.CreateApiDocumentResponseBody](../../models/operations/createapidocumentresponsebody.md) | :heavy_minus_sign: | Default Response |
16 changes: 16 additions & 0 deletions docs/models/operations/createapidocumentversionresponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# CreateApiDocumentVersionResponse

## Example Usage

```typescript
import { CreateApiDocumentVersionResponse } from "@scalar/sdk/models/operations";

let value: CreateApiDocumentVersionResponse = {};
```

## Fields

| Field | Type | Required | Description |
| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A |
| `managedDocVersion` | [components.ManagedDocVersion](../../models/components/manageddocversion.md) | :heavy_minus_sign: | Default Response |
16 changes: 16 additions & 0 deletions docs/models/operations/createguideresponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# CreateGuideResponse

## Example Usage

```typescript
import { CreateGuideResponse } from "@scalar/sdk/models/operations";

let value: CreateGuideResponse = {};
```

## Fields

| Field | Type | Required | Description |
| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A |
| `object` | [operations.CreateGuideResponseBody](../../models/operations/createguideresponsebody.md) | :heavy_minus_sign: | Default Response |
16 changes: 16 additions & 0 deletions docs/models/operations/createloginportalresponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# CreateLoginPortalResponse

## Example Usage

```typescript
import { CreateLoginPortalResponse } from "@scalar/sdk/models/operations";

let value: CreateLoginPortalResponse = {};
```

## Fields

| Field | Type | Required | Description |
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A |
| `uid` | [components.Uid](../../models/components/uid.md) | :heavy_minus_sign: | Default Response |
16 changes: 16 additions & 0 deletions docs/models/operations/createrulesetresponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# CreateRulesetResponse

## Example Usage

```typescript
import { CreateRulesetResponse } from "@scalar/sdk/models/operations";

let value: CreateRulesetResponse = {};
```

## Fields

| Field | Type | Required | Description |
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A |
| `uid` | [components.Uid](../../models/components/uid.md) | :heavy_minus_sign: | Default Response |
16 changes: 16 additions & 0 deletions docs/models/operations/createschemaresponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# CreateSchemaResponse

## Example Usage

```typescript
import { CreateSchemaResponse } from "@scalar/sdk/models/operations";

let value: CreateSchemaResponse = {};
```

## Fields

| Field | Type | Required | Description |
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A |
| `uid` | [components.Uid](../../models/components/uid.md) | :heavy_minus_sign: | Default Response |
16 changes: 16 additions & 0 deletions docs/models/operations/createschemaversionresponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# CreateSchemaVersionResponse

## Example Usage

```typescript
import { CreateSchemaVersionResponse } from "@scalar/sdk/models/operations";

let value: CreateSchemaVersionResponse = {};
```

## Fields

| Field | Type | Required | Description |
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A |
| `uid` | [components.Uid](../../models/components/uid.md) | :heavy_minus_sign: | Default Response |
16 changes: 16 additions & 0 deletions docs/models/operations/createthemeresponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# CreateThemeResponse

## Example Usage

```typescript
import { CreateThemeResponse } from "@scalar/sdk/models/operations";

let value: CreateThemeResponse = {};
```

## Fields

| Field | Type | Required | Description |
| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ |
| `httpMeta` | [components.HTTPMetadata](../../models/components/httpmetadata.md) | :heavy_check_mark: | N/A |
| `uid` | [components.Uid](../../models/components/uid.md) | :heavy_minus_sign: | Default Response |
Loading
Loading