Skip to content

Commit

Permalink
add error dto to 500
Browse files Browse the repository at this point in the history
  • Loading branch information
tatarco committed Jan 14, 2025
1 parent 0b84ddb commit 0b9461b
Show file tree
Hide file tree
Showing 207 changed files with 4,297 additions and 682 deletions.
48 changes: 31 additions & 17 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.183
version: 0.0.1-alpha.185
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.468.5
sources:
json-development:
sourceNamespace: json-development
sourceRevisionDigest: sha256:ad4851ee72553198704e4f3a6ed1859b1c2ef111172f86d34395f577afdd14da
sourceBlobDigest: sha256:98ff71d9656ecc1294937a13bff2ddc8e6f233d1c281875726dfc3f2c0301ce4
sourceRevisionDigest: sha256:539c43f93b977159045b3ad8ace48361c55c536e63be9a0e52037e113fd6dfad
sourceBlobDigest: sha256:14ab1e11a39c0b449a308b8f7299616fd083607b5dc75d5b47bfb9c58407835c
tags:
- latest
- "1.0"
targets:
my-first-target:
source: json-development
sourceNamespace: json-development
sourceRevisionDigest: sha256:ad4851ee72553198704e4f3a6ed1859b1c2ef111172f86d34395f577afdd14da
sourceBlobDigest: sha256:98ff71d9656ecc1294937a13bff2ddc8e6f233d1c281875726dfc3f2c0301ce4
sourceRevisionDigest: sha256:539c43f93b977159045b3ad8ace48361c55c536e63be9a0e52037e113fd6dfad
sourceBlobDigest: sha256:14ab1e11a39c0b449a308b8f7299616fd083607b5dc75d5b47bfb9c58407835c
codeSamplesNamespace: code-samples-typescript
codeSamplesRevisionDigest: sha256:e3490b0ae3b56c06736e527f74adefce5ed564fd59c86b2d2bc06430af58c696
codeSamplesRevisionDigest: sha256:74346be6f269180459e26becdb9c494a76faf0927aac0dfca36acef0aad5a580
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ run();

### [admin](docs/sdks/admin/README.md)

* [testingControllerIdempotency](docs/sdks/admin/README.md#testingcontrolleridempotency)
* [testIdempotency](docs/sdks/admin/README.md#testidempotency)
* [testingControllerIdempotencyGet](docs/sdks/admin/README.md#testingcontrolleridempotencyget)

### [integrations](docs/sdks/integrations/README.md)
Expand Down Expand Up @@ -334,7 +334,7 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).

<summary>Available standalone functions</summary>

- [`adminTestingControllerIdempotency`](docs/sdks/admin/README.md#testingcontrolleridempotency)
- [`adminTestIdempotency`](docs/sdks/admin/README.md#testidempotency)
- [`adminTestingControllerIdempotencyGet`](docs/sdks/admin/README.md#testingcontrolleridempotencyget)
- [`cancel`](docs/sdks/novu/README.md#cancel) - Cancel triggered event
- [`integrationsCreate`](docs/sdks/integrations/README.md#create) - Create integration
Expand Down Expand Up @@ -428,11 +428,11 @@ run();

Some methods specify known errors which can be thrown. All the known errors are enumerated in the `models/errors/errors.ts` module. The known errors for a method are documented under the *Errors* tables in SDK docs. For example, the `trigger` method may throw the following errors:

| Error Type | Status Code | Content Type |
| ------------------------- | ----------------------- | ---------------- |
| errors.ErrorDto | 400, 401, 404, 409, 500 | application/json |
| errors.ValidationErrorDto | 422 | application/json |
| errors.SDKError | 4XX, 5XX | \*/\* |
| Error Type | Status Code | Content Type |
| ------------------------- | ---------------------------- | ---------------- |
| errors.ErrorDto | 400, 401, 403, 404, 409, 500 | application/json |
| errors.ValidationErrorDto | 422 | application/json |
| errors.SDKError | 4XX, 5XX | \*/\* |

If the method throws an error and it is not captured by the known errors, it will default to throwing a `SDKError`.

Expand Down
4 changes: 2 additions & 2 deletions docs/models/components/activitiesresponsedto.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ let value: ActivitiesResponseDto = {
transactionId: "<id>",
},
],
pageSize: 1317.97,
page: 7163.27,
pageSize: 7252.55,
page: 5013.24,
};
```

Expand Down
2 changes: 1 addition & 1 deletion docs/models/components/activitygraphstatesresponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ActivityGraphStatesResponse } from "@novu/api/models/components";

let value: ActivityGraphStatesResponse = {
id: "<id>",
count: 6994.79,
count: 8965.47,
templates: [
"<value>",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import { ActivityNotificationExecutionDetailResponseDto } from "@novu/api/models

let value: ActivityNotificationExecutionDetailResponseDto = {
id: "<id>",
status: "ReadConfirmation",
status: "Failed",
detail: "<value>",
isRetry: false,
isTest: false,
providerId: "novu-email",
source: "Payload",
providerId: "netcore",
source: "Internal",
};
```

Expand Down
10 changes: 5 additions & 5 deletions docs/models/components/activitynotificationjobresponsedto.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ import { ActivityNotificationJobResponseDto } from "@novu/api/models/components"

let value: ActivityNotificationJobResponseDto = {
id: "<id>",
type: "email",
type: "digest",
executionDetails: [
{
id: "<id>",
status: "Pending",
status: "Failed",
detail: "<value>",
isRetry: false,
isTest: false,
providerId: "mailgun",
source: "Webhook",
providerId: "generic-sms",
source: "Credentials",
},
],
step: {
Expand All @@ -26,7 +26,7 @@ let value: ActivityNotificationJobResponseDto = {
{},
],
},
providerId: "emailjs",
providerId: "braze",
status: "<value>",
};
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Type of the job
```typescript
import { ActivityNotificationJobResponseDtoType } from "@novu/api/models/components";

let value: ActivityNotificationJobResponseDtoType = "sms";
let value: ActivityNotificationJobResponseDtoType = "custom";
```

## Values
Expand Down
4 changes: 2 additions & 2 deletions docs/models/components/activitystatsresponsedto.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import { ActivityStatsResponseDto } from "@novu/api/models/components";

let value: ActivityStatsResponseDto = {
weeklySent: 9527.49,
monthlySent: 4471.25,
weeklySent: 6532.01,
monthlySent: 6521.03,
};
```

Expand Down
2 changes: 1 addition & 1 deletion docs/models/components/actorfeeditemdto.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { ActorFeedItemDto } from "@novu/api/models/components";

let value: ActorFeedItemDto = {
data: null,
type: "system_custom",
type: "none",
};
```

Expand Down
2 changes: 1 addition & 1 deletion docs/models/components/actortypeenum.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The type of the actor, indicating the role in the notification process.
```typescript
import { ActorTypeEnum } from "@novu/api/models/components";

let value: ActorTypeEnum = "system_icon";
let value: ActorTypeEnum = "user";
```

## Values
Expand Down
2 changes: 1 addition & 1 deletion docs/models/components/backoffunit.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
```typescript
import { BackoffUnit } from "@novu/api/models/components";

let value: BackoffUnit = "minutes";
let value: BackoffUnit = "months";
```

## Values
Expand Down
3 changes: 2 additions & 1 deletion docs/models/components/bulktriggereventdto.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ let value: BulkTriggerEventDto = {
},
},
to: {
subscriberId: "<id>",
topicKey: "<value>",
type: "Topic",
},
},
],
Expand Down
2 changes: 1 addition & 1 deletion docs/models/components/buttontypeenum.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Type of button for the action result
```typescript
import { ButtonTypeEnum } from "@novu/api/models/components";

let value: ButtonTypeEnum = "secondary";
let value: ButtonTypeEnum = "primary";
```

## Values
Expand Down
2 changes: 1 addition & 1 deletion docs/models/components/channel.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The channel type for the integration, which defines how the integration communic
```typescript
import { Channel } from "@novu/api/models/components";

let value: Channel = "push";
let value: Channel = "sms";
```

## Values
Expand Down
2 changes: 1 addition & 1 deletion docs/models/components/channelpreference.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { ChannelPreference } from "@novu/api/models/components";

let value: ChannelPreference = {
type: "sms",
type: "email",
enabled: false,
};
```
Expand Down
2 changes: 1 addition & 1 deletion docs/models/components/channels.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
```typescript
import { Channels } from "@novu/api/models/components";

let value: Channels = "push";
let value: Channels = "sms";
```

## Values
Expand Down
2 changes: 1 addition & 1 deletion docs/models/components/channelsettings.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { ChannelSettings } from "@novu/api/models/components";

let value: ChannelSettings = {
providerId: "msteams",
providerId: "apns",
credentials: {
webhookUrl: "https://example.com/webhook",
channel: "general",
Expand Down
2 changes: 1 addition & 1 deletion docs/models/components/channelsettingsproviderid.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The provider identifier for the credentials
```typescript
import { ChannelSettingsProviderId } from "@novu/api/models/components";

let value: ChannelSettingsProviderId = "getstream";
let value: ChannelSettingsProviderId = "discord";
```

## Values
Expand Down
2 changes: 1 addition & 1 deletion docs/models/components/channeltypeenum.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Channel type through which the message is sent
```typescript
import { ChannelTypeEnum } from "@novu/api/models/components";

let value: ChannelTypeEnum = "email";
let value: ChannelTypeEnum = "sms";
```

## Values
Expand Down
2 changes: 1 addition & 1 deletion docs/models/components/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Content of the message, can be an email block or a string

```typescript
const value: components.EmailBlock = {
type: "button",
type: "text",
content: "<value>",
};
```
Expand Down
2 changes: 1 addition & 1 deletion docs/models/components/createintegrationrequestdto.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { CreateIntegrationRequestDto } from "@novu/api/models/components";

let value: CreateIntegrationRequestDto = {
providerId: "<id>",
channel: "email",
channel: "push",
};
```

Expand Down
2 changes: 1 addition & 1 deletion docs/models/components/createsubscriberrequestdtodata.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ const value: boolean = false;
### `number`

```typescript
const value: number = 2982.82;
const value: number = 4535.43;
```

2 changes: 1 addition & 1 deletion docs/models/components/data.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ const value: boolean = false;
### `number`

```typescript
const value: number = 5232.48;
const value: number = 2974.37;
```

2 changes: 1 addition & 1 deletion docs/models/components/delayregularmetadataunit.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
```typescript
import { DelayRegularMetadataUnit } from "@novu/api/models/components";

let value: DelayRegularMetadataUnit = "minutes";
let value: DelayRegularMetadataUnit = "days";
```

## Values
Expand Down
2 changes: 1 addition & 1 deletion docs/models/components/digesttimedmetadataunit.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
```typescript
import { DigestTimedMetadataUnit } from "@novu/api/models/components";

let value: DigestTimedMetadataUnit = "seconds";
let value: DigestTimedMetadataUnit = "minutes";
```

## Values
Expand Down
2 changes: 1 addition & 1 deletion docs/models/components/emailblock.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { EmailBlock } from "@novu/api/models/components";

let value: EmailBlock = {
type: "button",
type: "text",
content: "<value>",
};
```
Expand Down
2 changes: 1 addition & 1 deletion docs/models/components/emailblockstyles.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { EmailBlockStyles } from "@novu/api/models/components";

let value: EmailBlockStyles = {
textAlign: "right",
textAlign: "center",
};
```

Expand Down
2 changes: 1 addition & 1 deletion docs/models/components/emailblocktypeenum.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Type of the email block
```typescript
import { EmailBlockTypeEnum } from "@novu/api/models/components";

let value: EmailBlockTypeEnum = "text";
let value: EmailBlockTypeEnum = "button";
```

## Values
Expand Down
30 changes: 30 additions & 0 deletions docs/models/components/errordto.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# ErrorDto

## Example Usage

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

let value: ErrorDto = {
statusCode: 404,
timestamp: "2024-12-12T13:00:00Z",
path: "/api/v1/resource",
message: "Resource not found.",
ctx: {
"workflowId": "some_wf_id",
"stepId": "some_wf_id",
},
errorId: "abc123",
};
```

## Fields

| Field | Type | Required | Description | Example |
| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ |
| `statusCode` | *number* | :heavy_check_mark: | HTTP status code of the error response. | 404 |
| `timestamp` | *string* | :heavy_check_mark: | Timestamp of when the error occurred. | 2024-12-12T13:00:00Z |
| `path` | *string* | :heavy_check_mark: | The path where the error occurred. | /api/v1/resource |
| `message` | *string* | :heavy_check_mark: | A detailed error message. | Resource not found. |
| `ctx` | Record<string, *any*> | :heavy_minus_sign: | Optional context object for additional error details. | {<br/>"workflowId": "some_wf_id",<br/>"stepId": "some_wf_id"<br/>} |
| `errorId` | *string* | :heavy_minus_sign: | Optional unique identifier for the error, useful for tracking using Sentry and <br/> New Relic, only available for 500. | abc123 |
4 changes: 2 additions & 2 deletions docs/models/components/feedresponsedto.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ let value: FeedResponseDto = {
updatedAt: new Date("2024-12-10T10:10:59.639Z"),
actor: {
data: null,
type: "system_custom",
type: "system_icon",
},
transactionId: "transaction_123456",
templateIdentifier: "template_abcdef",
providerId: "provider_xyz",
content: "This is a test notification content.",
subject: "Test Notification Subject",
channel: "email",
channel: "in_app",
read: false,
seen: true,
deleted: false,
Expand Down
2 changes: 1 addition & 1 deletion docs/models/components/fieldfilterpartdto.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { FieldFilterPartDto } from "@novu/api/models/components";
let value: FieldFilterPartDto = {
field: "<value>",
value: "<value>",
operator: "BETWEEN",
operator: "NOT_LIKE",
on: "subscriber",
};
```
Expand Down
Loading

0 comments on commit 0b9461b

Please sign in to comment.