Skip to content

Commit

Permalink
change add error definition
Browse files Browse the repository at this point in the history
  • Loading branch information
tatarco committed Dec 12, 2024
1 parent ddff664 commit 24b8038
Show file tree
Hide file tree
Showing 215 changed files with 14,360 additions and 736 deletions.
222 changes: 219 additions & 3 deletions .speakeasy/gen.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ generation:
oAuth2ClientCredentialsEnabled: false
oAuth2PasswordEnabled: false
typescript:
version: 0.0.1-alpha.94
version: 0.0.1-alpha.95
additionalDependencies:
dependencies: {}
devDependencies: {}
Expand Down
10 changes: 5 additions & 5 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ speakeasyVersion: 1.454.0
sources:
json-development:
sourceNamespace: json-development
sourceRevisionDigest: sha256:5ad66a0b090dc3ea3796044f3f540e8acef94f869a845509ec8c10769716a8a9
sourceBlobDigest: sha256:b77923e812380b853820c1c144c9bcfe6778b502955aafea6f11e3a9ca2a0354
sourceRevisionDigest: sha256:814d2a71379e2fe69616b3728d339907237a8bfddad56068fbe64bccdbb91279
sourceBlobDigest: sha256:c4a748406197daccd6fc62894202e700cf1d343f419436b7cf2d19043fadf2a8
tags:
- latest
- "1.0"
targets:
my-first-target:
source: json-development
sourceNamespace: json-development
sourceRevisionDigest: sha256:5ad66a0b090dc3ea3796044f3f540e8acef94f869a845509ec8c10769716a8a9
sourceBlobDigest: sha256:b77923e812380b853820c1c144c9bcfe6778b502955aafea6f11e3a9ca2a0354
sourceRevisionDigest: sha256:814d2a71379e2fe69616b3728d339907237a8bfddad56068fbe64bccdbb91279
sourceBlobDigest: sha256:c4a748406197daccd6fc62894202e700cf1d343f419436b7cf2d19043fadf2a8
codeSamplesNamespace: code-samples-typescript
codeSamplesRevisionDigest: sha256:0fc65f3df9de690e043ae9af5ec739ff3050252f96b00b1ef0aa5d418b1d726d
codeSamplesRevisionDigest: sha256:11096380d09d27006ca423c8b90601826f373ca6c20e464d7605fe4e91d4efd3
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
24 changes: 20 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -429,13 +429,19 @@ If a HTTP request fails, an operation my also throw an error from the `models/er

In addition, when custom error responses are specified for an operation, the SDK may throw their associated Error type. You can refer to respective *Errors* tables in SDK docs for more details on possible error types for each operation. For example, the `trigger` method may throw the following errors:

| Error Type | Status Code | Content Type |
| --------------- | ----------- | ------------ |
| errors.SDKError | 4XX, 5XX | \*/\* |
| Error Type | Status Code | Content Type |
| -------------------------------------------------- | ----------- | ---------------- |
| errors.EventsControllerTriggerResponseBody | 400 | application/json |
| errors.EventsControllerTriggerResponseResponseBody | 404 | application/json |
| errors.SDKError | 4XX, 5XX | \*/\* |

```typescript
import { Novu } from "@novu/api";
import { SDKValidationError } from "@novu/api/models/errors";
import {
EventsControllerTriggerResponseBody,
EventsControllerTriggerResponseResponseBody,
SDKValidationError,
} from "@novu/api/models/errors";

const novu = new Novu({
apiKey: "<YOUR_API_KEY_HERE>",
Expand Down Expand Up @@ -469,6 +475,16 @@ async function run() {
console.error(err.rawValue);
return;
}
case (err instanceof EventsControllerTriggerResponseBody): {
// Handle err.data$: EventsControllerTriggerResponseBodyData
console.error(err);
return;
}
case (err instanceof EventsControllerTriggerResponseResponseBody): {
// Handle err.data$: EventsControllerTriggerResponseResponseBodyData
console.error(err);
return;
}
default: {
throw err;
}
Expand Down
14 changes: 14 additions & 0 deletions docs/models/components/errordto.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# ErrorDto

## Example Usage

```typescript
import { ErrorDto } from "@novu/api/models/components";

let value: ErrorDto = {};
```

## Fields

| Field | Type | Required | Description |
| ----------- | ----------- | ----------- | ----------- |
2 changes: 1 addition & 1 deletion docs/models/components/notificationfeeditemdto.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,5 @@ let value: NotificationFeedItemDto = {
| `deviceTokens` | *string*[] | :heavy_minus_sign: | Device tokens for push notifications, if applicable. | [<br/>"token1",<br/>"token2"<br/>] |
| `cta` | [components.MessageCTA](../../models/components/messagecta.md) | :heavy_check_mark: | Call-to-action information associated with the notification. | |
| `status` | [components.NotificationFeedItemDtoStatus](../../models/components/notificationfeeditemdtostatus.md) | :heavy_check_mark: | Current status of the notification. | sent |
| `payload` | Record<string, *any*> | :heavy_check_mark: | The payload that was used to send the notification trigger. | {<br/>"key": "value"<br/>} |
| `payload` | Record<string, *any*> | :heavy_minus_sign: | The payload that was used to send the notification trigger. | {<br/>"key": "value"<br/>} |
| `overrides` | Record<string, *any*> | :heavy_minus_sign: | Provider-specific overrides used when triggering the notification. | {<br/>"overrideKey": "overrideValue"<br/>} |
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# EventsControllerBroadcastEventToAllResponseBody

Bad Request

## Example Usage

```typescript
import { EventsControllerBroadcastEventToAllResponseBody } from "@novu/api/models/errors";

// No examples available for this model
```

## Fields

| Field | Type | Required | Description |
| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- |
| `data` | [components.ErrorDto](../../models/components/errordto.md) | :heavy_minus_sign: | N/A |
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# EventsControllerBroadcastEventToAllResponseResponseBody

Not Found

## Example Usage

```typescript
import { EventsControllerBroadcastEventToAllResponseResponseBody } from "@novu/api/models/errors";

// No examples available for this model
```

## Fields

| Field | Type | Required | Description |
| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- |
| `data` | [components.ErrorDto](../../models/components/errordto.md) | :heavy_minus_sign: | N/A |
17 changes: 17 additions & 0 deletions docs/models/errors/eventscontrollercancelresponsebody.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# EventsControllerCancelResponseBody

Bad Request

## Example Usage

```typescript
import { EventsControllerCancelResponseBody } from "@novu/api/models/errors";

// No examples available for this model
```

## Fields

| Field | Type | Required | Description |
| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- |
| `data` | [components.ErrorDto](../../models/components/errordto.md) | :heavy_minus_sign: | N/A |
17 changes: 17 additions & 0 deletions docs/models/errors/eventscontrollercancelresponseresponsebody.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# EventsControllerCancelResponseResponseBody

Not Found

## Example Usage

```typescript
import { EventsControllerCancelResponseResponseBody } from "@novu/api/models/errors";

// No examples available for this model
```

## Fields

| Field | Type | Required | Description |
| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- |
| `data` | [components.ErrorDto](../../models/components/errordto.md) | :heavy_minus_sign: | N/A |
17 changes: 17 additions & 0 deletions docs/models/errors/eventscontrollertriggerbulkresponsebody.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# EventsControllerTriggerBulkResponseBody

Bad Request

## Example Usage

```typescript
import { EventsControllerTriggerBulkResponseBody } from "@novu/api/models/errors";

// No examples available for this model
```

## Fields

| Field | Type | Required | Description |
| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- |
| `data` | [components.ErrorDto](../../models/components/errordto.md) | :heavy_minus_sign: | N/A |
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# EventsControllerTriggerBulkResponseResponseBody

Not Found

## Example Usage

```typescript
import { EventsControllerTriggerBulkResponseResponseBody } from "@novu/api/models/errors";

// No examples available for this model
```

## Fields

| Field | Type | Required | Description |
| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- |
| `data` | [components.ErrorDto](../../models/components/errordto.md) | :heavy_minus_sign: | N/A |
17 changes: 17 additions & 0 deletions docs/models/errors/eventscontrollertriggerresponsebody.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# EventsControllerTriggerResponseBody

Bad Request

## Example Usage

```typescript
import { EventsControllerTriggerResponseBody } from "@novu/api/models/errors";

// No examples available for this model
```

## Fields

| Field | Type | Required | Description |
| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- |
| `data` | [components.ErrorDto](../../models/components/errordto.md) | :heavy_minus_sign: | N/A |
17 changes: 17 additions & 0 deletions docs/models/errors/eventscontrollertriggerresponseresponsebody.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# EventsControllerTriggerResponseResponseBody

Not Found

## Example Usage

```typescript
import { EventsControllerTriggerResponseResponseBody } from "@novu/api/models/errors";

// No examples available for this model
```

## Fields

| Field | Type | Required | Description |
| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- |
| `data` | [components.ErrorDto](../../models/components/errordto.md) | :heavy_minus_sign: | N/A |
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# IntegrationsControllerCreateIntegrationIntegrationsResponseBody

Not Found

## Example Usage

```typescript
import { IntegrationsControllerCreateIntegrationIntegrationsResponseBody } from "@novu/api/models/errors";

// No examples available for this model
```

## Fields

| Field | Type | Required | Description |
| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- |
| `data` | [components.ErrorDto](../../models/components/errordto.md) | :heavy_minus_sign: | N/A |
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# IntegrationsControllerCreateIntegrationResponseBody

Bad Request

## Example Usage

```typescript
import { IntegrationsControllerCreateIntegrationResponseBody } from "@novu/api/models/errors";

// No examples available for this model
```

## Fields

| Field | Type | Required | Description |
| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- |
| `data` | [components.ErrorDto](../../models/components/errordto.md) | :heavy_minus_sign: | N/A |
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# IntegrationsControllerGetActiveIntegrationsIntegrationsResponseBody

Not Found

## Example Usage

```typescript
import { IntegrationsControllerGetActiveIntegrationsIntegrationsResponseBody } from "@novu/api/models/errors";

// No examples available for this model
```

## Fields

| Field | Type | Required | Description |
| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- |
| `data` | [components.ErrorDto](../../models/components/errordto.md) | :heavy_minus_sign: | N/A |
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# IntegrationsControllerGetActiveIntegrationsResponseBody

Bad Request

## Example Usage

```typescript
import { IntegrationsControllerGetActiveIntegrationsResponseBody } from "@novu/api/models/errors";

// No examples available for this model
```

## Fields

| Field | Type | Required | Description |
| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- |
| `data` | [components.ErrorDto](../../models/components/errordto.md) | :heavy_minus_sign: | N/A |
Loading

0 comments on commit 24b8038

Please sign in to comment.