Skip to content

Commit 1c733bc

Browse files
committed
fix: add status field to Event schema and comprehensive tests
Add missing 'status' field to Event schema in OpenAPI specification and generate updated TypeScript SDK with proper type definitions. Changes: - Updated Event schema in OpenAPI spec to include 'status' field (enum: success | failed) - Regenerated TypeScript SDK with new EventStatus type - Added comprehensive test suite for event status field validation - Updated all destination tests to use proper SDK types - Added SDK regeneration script for consistent build process The API was already returning the status field in event responses, but it was not documented in the OpenAPI spec, causing SDK clients to not have access to this field. This change aligns the spec with the actual API behavior. Tests verify: - Status field is present in events from listByDestination - Status field is present in single event retrieval - Status field is present in tenant-wide event lists - Status values are valid (success or failed) Fixes #490 Related to PR #491
1 parent cd3fa35 commit 1c733bc

37 files changed

+561
-99
lines changed

.speakeasy/workflow.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ speakeasyVersion: 1.636.3
22
sources:
33
Outpost API:
44
sourceNamespace: outpost-api
5-
sourceRevisionDigest: sha256:2fd0f3a228f7804a077a738eea8bdd8d0238c799b5d0c699113ab5b982c9c3f4
6-
sourceBlobDigest: sha256:84ea2c33aa27fd52d26243b2be5d1acdafc8b7c3c737f678cffdc62bbcac8c58
5+
sourceRevisionDigest: sha256:abcb227d706ddbbb55ab9a423da413260c4d83c247616a9f6067890ff4bfa997
6+
sourceBlobDigest: sha256:b8f43e14862cadf618bc568c76cec68ed15da6c4c7fec0541edd4671a3b26815
77
tags:
88
- latest
99
- 0.0.1
@@ -25,10 +25,10 @@ targets:
2525
outpost-ts:
2626
source: Outpost API
2727
sourceNamespace: outpost-api
28-
sourceRevisionDigest: sha256:2fd0f3a228f7804a077a738eea8bdd8d0238c799b5d0c699113ab5b982c9c3f4
29-
sourceBlobDigest: sha256:84ea2c33aa27fd52d26243b2be5d1acdafc8b7c3c737f678cffdc62bbcac8c58
28+
sourceRevisionDigest: sha256:abcb227d706ddbbb55ab9a423da413260c4d83c247616a9f6067890ff4bfa997
29+
sourceBlobDigest: sha256:b8f43e14862cadf618bc568c76cec68ed15da6c4c7fec0541edd4671a3b26815
3030
codeSamplesNamespace: outpost-api-typescript-code-samples
31-
codeSamplesRevisionDigest: sha256:d4eca43f53a3683f444aa9e98cc59cee0fbe9bfc00696753e1f9587b0955f9ab
31+
codeSamplesRevisionDigest: sha256:58c8e1b33a4de342b37a90c0c490a21c795e4b5c6c4f2ceef9f8c45b817a56f3
3232
workflow:
3333
workflowVersion: 1.0.0
3434
speakeasyVersion: latest

docs/apis/openapi.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1005,6 +1005,16 @@ components:
10051005
$ref: "#/components/schemas/AWSKinesisConfig" # stream_name/region required here, but PATCH means optional
10061006
credentials:
10071007
$ref: "#/components/schemas/AWSKinesisCredentials" # key/secret required here, but PATCH means optional
1008+
DestinationUpdateAzureServiceBus:
1009+
type: object
1010+
# Properties duplicated from DestinationUpdateBase
1011+
properties:
1012+
topics:
1013+
$ref: "#/components/schemas/Topics"
1014+
config:
1015+
$ref: "#/components/schemas/AzureServiceBusConfig" # name required here, but PATCH means optional
1016+
credentials:
1017+
$ref: "#/components/schemas/AzureServiceBusCredentials" # connection_string required here, but PATCH means optional
10081018

10091019
DestinationUpdateAWSS3:
10101020
type: object
@@ -1035,6 +1045,7 @@ components:
10351045
- $ref: "#/components/schemas/DestinationUpdateRabbitMQ"
10361046
- $ref: "#/components/schemas/DestinationUpdateHookdeck"
10371047
- $ref: "#/components/schemas/DestinationUpdateAWSKinesis"
1048+
- $ref: "#/components/schemas/DestinationUpdateAzureServiceBus"
10381049
- $ref: "#/components/schemas/DestinationUpdateAWSS3"
10391050
- $ref: "#/components/schemas/DestinationUpdateGCPPubSub"
10401051
# Event Schemas
@@ -1107,6 +1118,7 @@ components:
11071118
example: "2024-01-01T00:00:00Z"
11081119
metadata:
11091120
type: object
1121+
nullable: true
11101122
description: Key-value string pairs of metadata associated with the event.
11111123
additionalProperties:
11121124
type: string

examples/demos/nodejs/src/portal-urls.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ const main = async () => {
88
const portalUrl = await outpost.getPortalURL(org.id);
99
console.log(`Portal URL for ${org.id}:`, portalUrl);
1010
}
11+
12+
try {
13+
const portalUrl = await outpost.getPortalURL("test-tenant");
14+
console.log(`Portal URL for test-tenant:`, portalUrl);
15+
} catch (error) {
16+
console.error(`Failed to create portal for test-tenant:`, error);
17+
}
1118
};
1219

1320
main()

sdks/outpost-typescript/.speakeasy/gen.lock

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
lockVersion: 2.0.0
22
id: edb58086-83b9-45a3-9095-52bf57a11009
33
management:
4-
docChecksum: 5ba70e6fd5c38bf6938a020a3ee4e211
4+
docChecksum: 0e5299d5650362a90c20df3906cf0c76
55
docVersion: 0.0.1
66
speakeasyVersion: 1.636.3
77
generationVersion: 2.723.11
8-
releaseVersion: 0.5.1
9-
configChecksum: f68ee8655bbd6462d87583a682258f8b
8+
releaseVersion: 0.5.0
9+
configChecksum: 9fbad82eb37adcf42c1125163f3177c3
1010
repoURL: https://github.com/hookdeck/outpost.git
1111
repoSubDirectory: sdks/outpost-typescript
1212
installationURL: https://gitpkg.now.sh/hookdeck/outpost/sdks/outpost-typescript
@@ -48,6 +48,7 @@ generatedFiles:
4848
- docs/models/components/azureservicebusconfig.md
4949
- docs/models/components/azureservicebuscredentials.md
5050
- docs/models/components/deliveryattempt.md
51+
- docs/models/components/deliveryattemptstatus.md
5152
- docs/models/components/destination.md
5253
- docs/models/components/destinationawskinesis.md
5354
- docs/models/components/destinationawskinesistype.md
@@ -87,13 +88,15 @@ generatedFiles:
8788
- docs/models/components/destinationupdateawskinesis.md
8889
- docs/models/components/destinationupdateawss3.md
8990
- docs/models/components/destinationupdateawssqs.md
91+
- docs/models/components/destinationupdateazureservicebus.md
9092
- docs/models/components/destinationupdategcppubsub.md
9193
- docs/models/components/destinationupdatehookdeck.md
9294
- docs/models/components/destinationupdaterabbitmq.md
9395
- docs/models/components/destinationupdatewebhook.md
9496
- docs/models/components/destinationwebhook.md
9597
- docs/models/components/destinationwebhooktype.md
9698
- docs/models/components/event.md
99+
- docs/models/components/eventstatus.md
97100
- docs/models/components/gcppubsubconfig.md
98101
- docs/models/components/gcppubsubcredentials.md
99102
- docs/models/components/hookdeckcredentials.md
@@ -103,7 +106,6 @@ generatedFiles:
103106
- docs/models/components/rabbitmqconfig.md
104107
- docs/models/components/rabbitmqcredentials.md
105108
- docs/models/components/security.md
106-
- docs/models/components/status.md
107109
- docs/models/components/successresponse.md
108110
- docs/models/components/tenant.md
109111
- docs/models/components/tenanttoken.md
@@ -308,6 +310,7 @@ generatedFiles:
308310
- src/models/components/destinationupdateawskinesis.ts
309311
- src/models/components/destinationupdateawss3.ts
310312
- src/models/components/destinationupdateawssqs.ts
313+
- src/models/components/destinationupdateazureservicebus.ts
311314
- src/models/components/destinationupdategcppubsub.ts
312315
- src/models/components/destinationupdatehookdeck.ts
313316
- src/models/components/destinationupdaterabbitmq.ts

sdks/outpost-typescript/.speakeasy/gen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ generation:
2222
generateNewTests: false
2323
skipResponseBodyAssertions: false
2424
typescript:
25-
version: 0.5.1
25+
version: 0.5.0
2626
acceptHeaderEnum: true
2727
additionalDependencies:
2828
dependencies: {}

sdks/outpost-typescript/docs/models/components/deliveryattempt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ let value: DeliveryAttempt = {
2121
| Field | Type | Required | Description | Example |
2222
| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
2323
| `deliveredAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | N/A | 2024-01-01T00:00:00Z |
24-
| `status` | [components.Status](../../models/components/status.md) | :heavy_minus_sign: | N/A | success |
24+
| `status` | [components.DeliveryAttemptStatus](../../models/components/deliveryattemptstatus.md) | :heavy_minus_sign: | N/A | success |
2525
| `responseStatusCode` | *number* | :heavy_minus_sign: | N/A | 200 |
2626
| `responseBody` | *string* | :heavy_minus_sign: | N/A | {"status":"ok"} |
2727
| `responseHeaders` | Record<string, *string*> | :heavy_minus_sign: | N/A | {<br/>"content-type": "application/json"<br/>} |
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# DeliveryAttemptStatus
2+
3+
## Example Usage
4+
5+
```typescript
6+
import { DeliveryAttemptStatus } from "@hookdeck/outpost-sdk/models/components";
7+
8+
let value: DeliveryAttemptStatus = "success";
9+
```
10+
11+
## Values
12+
13+
```typescript
14+
"success" | "failed"
15+
```

sdks/outpost-typescript/docs/models/components/destinationupdate.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,21 @@ const value: components.DestinationUpdateAWSKinesis = {
7878
};
7979
```
8080

81+
### `components.DestinationUpdateAzureServiceBus`
82+
83+
```typescript
84+
const value: components.DestinationUpdateAzureServiceBus = {
85+
topics: "*",
86+
config: {
87+
name: "my-queue-or-topic",
88+
},
89+
credentials: {
90+
connectionString:
91+
"Endpoint=sb://namespace.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=abc123",
92+
},
93+
};
94+
```
95+
8196
### `components.DestinationUpdateAwss3`
8297

8398
```typescript
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# DestinationUpdateAzureServiceBus
2+
3+
## Example Usage
4+
5+
```typescript
6+
import { DestinationUpdateAzureServiceBus } from "@hookdeck/outpost-sdk/models/components";
7+
8+
let value: DestinationUpdateAzureServiceBus = {
9+
topics: "*",
10+
config: {
11+
name: "my-queue-or-topic",
12+
},
13+
credentials: {
14+
connectionString:
15+
"Endpoint=sb://namespace.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=abc123",
16+
},
17+
};
18+
```
19+
20+
## Fields
21+
22+
| Field | Type | Required | Description | Example |
23+
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
24+
| `topics` | *components.Topics* | :heavy_minus_sign: | "*" or an array of enabled topics. | * |
25+
| `config` | [components.AzureServiceBusConfig](../../models/components/azureservicebusconfig.md) | :heavy_minus_sign: | N/A | |
26+
| `credentials` | [components.AzureServiceBusCredentials](../../models/components/azureservicebuscredentials.md) | :heavy_minus_sign: | N/A | |

sdks/outpost-typescript/docs/models/components/event.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ let value: Event = {
1414
metadata: {
1515
"source": "crm",
1616
},
17+
status: "success",
1718
data: {
1819
"user_id": "userid",
1920
"status": "active",
@@ -31,4 +32,5 @@ let value: Event = {
3132
| `time` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | Time the event was received/processed. | 2024-01-01T00:00:00Z |
3233
| `successfulAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | Time the event was successfully delivered. | 2024-01-01T00:00:00Z |
3334
| `metadata` | Record<string, *string*> | :heavy_minus_sign: | Key-value string pairs of metadata associated with the event. | {<br/>"source": "crm"<br/>} |
35+
| `status` | [components.EventStatus](../../models/components/eventstatus.md) | :heavy_minus_sign: | N/A | success |
3436
| `data` | Record<string, *any*> | :heavy_minus_sign: | Freeform JSON data of the event. | {<br/>"user_id": "userid",<br/>"status": "active"<br/>} |

0 commit comments

Comments
 (0)