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 91c0e4d commit cd42839
Show file tree
Hide file tree
Showing 200 changed files with 7,288 additions and 3,152 deletions.
115 changes: 101 additions & 14 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.190
version: 0.0.1-alpha.191
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:d2d26f4f38aad2f864bfeca92dadbbecd76ae4be8e62a2b7cad8f007928a8c21
sourceBlobDigest: sha256:3b3b31a84ca2cf667720127456386b248528b50b47b8cd84f6a3265b4dd2cef7
sourceRevisionDigest: sha256:947d403c6210d4def348841542284055c75f9d523a1bebad3cc1b19379053050
sourceBlobDigest: sha256:b6cb003896457b33a9eff91cb1634e1141c85dabac04dfb4ff98a62fd208b3aa
tags:
- latest
- "1.0"
targets:
my-first-target:
source: json-development
sourceNamespace: json-development
sourceRevisionDigest: sha256:d2d26f4f38aad2f864bfeca92dadbbecd76ae4be8e62a2b7cad8f007928a8c21
sourceBlobDigest: sha256:3b3b31a84ca2cf667720127456386b248528b50b47b8cd84f6a3265b4dd2cef7
sourceRevisionDigest: sha256:947d403c6210d4def348841542284055c75f9d523a1bebad3cc1b19379053050
sourceBlobDigest: sha256:b6cb003896457b33a9eff91cb1634e1141c85dabac04dfb4ff98a62fd208b3aa
codeSamplesNamespace: code-samples-typescript
codeSamplesRevisionDigest: sha256:bd2b02bfed55239d2aa4ba80af1fd1432b99d1dd6b0be1cdd03cfa8ccd8ee6a8
codeSamplesRevisionDigest: sha256:bba06e78002f00eb8d0fa12916a790bfe23a0b1a8eef3b8c636980bb7146dd92
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,12 @@ 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, 403, 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, 405, 409, 413, 415, 500 | application/json |
| errors.ErrorDto | 414 | 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 Expand Up @@ -482,6 +483,11 @@ async function run() {
console.error(err);
return;
}
case (err instanceof ErrorDto): {
// Handle err.data$: ErrorDtoData
console.error(err);
return;
}
case (err instanceof ValidationErrorDto): {
// Handle err.data$: ValidationErrorDtoData
console.error(err);
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: 8817.36,
page: 6925.32,
pageSize: 1317.97,
page: 7163.27,
};
```

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

let value: ActivityGraphStatesResponse = {
id: "<id>",
count: 6521.03,
count: 6994.79,
templates: [
"<value>",
],
channels: [
"sms",
"email",
],
};
```
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: "Warning",
status: "ReadConfirmation",
detail: "<value>",
isRetry: false,
isTest: false,
providerId: "clicksend",
source: "Internal",
providerId: "novu-email",
source: "Payload",
};
```

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: "push",
type: "email",
executionDetails: [
{
id: "<id>",
status: "ReadConfirmation",
status: "Pending",
detail: "<value>",
isRetry: false,
isTest: false,
providerId: "messagebird",
source: "Internal",
providerId: "mailgun",
source: "Webhook",
},
],
step: {
Expand All @@ -26,7 +26,7 @@ let value: ActivityNotificationJobResponseDto = {
{},
],
},
providerId: "generic-sms",
providerId: "emailjs",
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 = "trigger";
let value: ActivityNotificationJobResponseDtoType = "sms";
```

## 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: 5908.73,
monthlySent: 5743.25,
weeklySent: 9527.49,
monthlySent: 4471.25,
};
```

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: "none",
type: "system_custom",
};
```

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_custom";
let value: ActorTypeEnum = "system_icon";
```

## 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 = "weeks";
let value: BackoffUnit = "minutes";
```

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

let value: BuilderFieldType = "MULTI_LIST";
let value: BuilderFieldType = "STATEMENT";
```

## Values
Expand Down
3 changes: 1 addition & 2 deletions docs/models/components/bulktriggereventdto.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ let value: BulkTriggerEventDto = {
},
},
to: {
topicKey: "<value>",
type: "Topic",
subscriberId: "<id>",
},
},
],
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: "push",
type: "sms",
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 = "chat";
let value: Channels = "push";
```

## 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: "grafana-on-call",
providerId: "msteams",
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 = "whatsapp-business";
let value: ChannelSettingsProviderId = "getstream";
```

## 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 = "sms";
let value: ChannelTypeEnum = "email";
```

## Values
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: "chat",
channel: "email",
};
```

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 = 691.67;
const value: number = 2982.82;
```

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 = 8464.09;
const value: number = 5232.48;
```

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 = "hours";
let value: DelayRegularMetadataUnit = "minutes";
```

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

let value: DigestRegularMetadata = {
type: "regular",
type: "backoff",
};
```

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

let value: DigestRegularMetadataType = "backoff";
let value: DigestRegularMetadataType = "regular";
```

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

let value: DigestRegularMetadataUnit = "minutes";
let value: DigestRegularMetadataUnit = "weeks";
```

## 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 = "minutes";
let value: DigestTimedMetadataUnit = "seconds";
```

## 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: "text",
type: "button",
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: "left",
textAlign: "right",
};
```

Expand Down
30 changes: 0 additions & 30 deletions docs/models/components/errordto.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/models/components/feedresponsedto.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ let value: FeedResponseDto = {
updatedAt: new Date("2024-12-10T10:10:59.639Z"),
actor: {
data: null,
type: "none",
type: "system_custom",
},
transactionId: "transaction_123456",
templateIdentifier: "template_abcdef",
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: "IN",
operator: "BETWEEN",
on: "subscriber",
};
```
Expand Down
2 changes: 1 addition & 1 deletion docs/models/components/idempotencybodydto.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import { IdempotencyBodyDto } from "@novu/api/models/components";

let value: IdempotencyBodyDto = {
data: 3960.6,
data: 1832.8,
};
```

Expand Down
Loading

0 comments on commit cd42839

Please sign in to comment.