Skip to content

Commit

Permalink
add idempotency response object
Browse files Browse the repository at this point in the history
  • Loading branch information
tatarco committed Jan 16, 2025
1 parent a7cc38b commit 3791746
Show file tree
Hide file tree
Showing 27 changed files with 200 additions and 53 deletions.
10 changes: 7 additions & 3 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: 6bff3a53-3f0b-40b4-942f-ff70dc583ae5
management:
docChecksum: a666b1ead3f6f3ce2d9c4e6509c308ea
docChecksum: 063605e0a945a04df5e4c80be6f376f3
docVersion: "1.0"
speakeasyVersion: 1.468.9
generationVersion: 2.493.21
releaseVersion: 0.0.1
configChecksum: dc2d10eb0f2d612ad19440e03a1295e5
releaseVersion: 0.0.2
configChecksum: ab90f07a008f94a81c3f451548235962
published: true
features:
typescript:
Expand Down Expand Up @@ -119,6 +119,7 @@ generatedFiles:
- docs/models/components/filtertopicsresponsedto.md
- docs/models/components/getsubscriberpreferencesresponsedto.md
- docs/models/components/gettopicresponsedto.md
- docs/models/components/idempotencetestingresponse.md
- docs/models/components/idempotencybehaviorenum.md
- docs/models/components/idempotencytestingdto.md
- docs/models/components/integrationresponsedto.md
Expand Down Expand Up @@ -480,6 +481,7 @@ generatedFiles:
- src/models/components/filtertopicsresponsedto.ts
- src/models/components/getsubscriberpreferencesresponsedto.ts
- src/models/components/gettopicresponsedto.ts
- src/models/components/idempotencetestingresponse.ts
- src/models/components/idempotencybehaviorenum.ts
- src/models/components/idempotencytestingdto.ts
- src/models/components/index.ts
Expand Down Expand Up @@ -1747,6 +1749,8 @@ examples:
application/json: {"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", "errors": {"fieldName1": {"messages": ["Field is required", "Invalid format"], "value": "xx xx xx "}, "fieldName2": {"messages": ["Field is required", "Invalid format"], "value": "xx xx xx "}, "fieldName3": {"messages": ["Field is required", "Invalid format"], "value": "xx xx xx "}, "fieldName4": {"messages": ["Field is required", "Invalid format"], "value": "xx xx xx "}}}
"500":
application/json: {"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"}
"201":
application/json: {"number": 1}
generatedTests:
EventsController_trigger: "2024-12-24T08:36:06+01:00"
EventsController_triggerBulk: "2024-12-24T08:36:06+01:00"
Expand Down
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
version: 0.0.2
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.9
sources:
json-development:
sourceNamespace: json-development
sourceRevisionDigest: sha256:ba5f690118d5ec1d225266ae02e1a084e832c455fdfe42c5972fcea0afc7089a
sourceBlobDigest: sha256:4079f1fc187e164bde1a6f84b452ff1052ecae7edde241c940fbcccdec261a83
sourceRevisionDigest: sha256:2e8f0daa01625fca6f7998a24cd9ced9a70c0ccf44b28db8823746e3d6341c2a
sourceBlobDigest: sha256:3654c6fb51c3c34da42c6d5796f31ebdf4af7bf1f3f59f077646c1a3a07aca72
tags:
- latest
- "1.0"
targets:
my-first-target:
source: json-development
sourceNamespace: json-development
sourceRevisionDigest: sha256:ba5f690118d5ec1d225266ae02e1a084e832c455fdfe42c5972fcea0afc7089a
sourceBlobDigest: sha256:4079f1fc187e164bde1a6f84b452ff1052ecae7edde241c940fbcccdec261a83
sourceRevisionDigest: sha256:2e8f0daa01625fca6f7998a24cd9ced9a70c0ccf44b28db8823746e3d6341c2a
sourceBlobDigest: sha256:3654c6fb51c3c34da42c6d5796f31ebdf4af7bf1f3f59f077646c1a3a07aca72
codeSamplesNamespace: code-samples-typescript
codeSamplesRevisionDigest: sha256:bb484bce2a8c10935db734ae15c3d6c6887fc97c8773d9dd034b0a1ba52e3001
codeSamplesRevisionDigest: sha256:6988d93fb2b914d00bc2afcd79f0f869aecfd865f5be056933703f3a4908a1c3
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
17 changes: 17 additions & 0 deletions docs/models/components/idempotencetestingresponse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# IdempotenceTestingResponse

## Example Usage

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

let value: IdempotenceTestingResponse = {
number: 1,
};
```

## Fields

| Field | Type | Required | Description | Example |
| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- |
| `number` | *number* | :heavy_check_mark: | A unique number representing the idempotency response | 1 |
6 changes: 3 additions & 3 deletions docs/models/components/messageresponsedto.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ let value: MessageResponseDto = {
organizationId: "<id>",
environmentId: "<id>",
deleted: false,
createdAt: "1728523207441",
updatedAt: "1736966654426",
createdAt: "1728524602230",
updatedAt: "1736968049215",
},
createdAt: "1721933635686",
createdAt: "1721935030476",
content: {
type: "button",
content: "<value>",
Expand Down
4 changes: 2 additions & 2 deletions docs/models/components/subscriberresponsedto.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ let value: SubscriberResponseDto = {
organizationId: "<id>",
environmentId: "<id>",
deleted: false,
createdAt: "1727700055351",
updatedAt: "1736960485186",
createdAt: "1727701449903",
updatedAt: "1736961879739",
};
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@ let value: HealthControllerTestIdempotencyResponse = {
"<value>",
],
},
result: {
number: 1,
},
};
```

## Fields

| Field | Type | Required | Description |
| -------------------------- | -------------------------- | -------------------------- | -------------------------- |
| `headers` | Record<string, *string*[]> | :heavy_check_mark: | N/A |
| Field | Type | Required | Description |
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| `headers` | Record<string, *string*[]> | :heavy_check_mark: | N/A |
| `result` | [components.IdempotenceTestingResponse](../../models/components/idempotencetestingresponse.md) | :heavy_check_mark: | N/A |
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ let value: SubscribersControllerCreateSubscriberResponse = {
organizationId: "<id>",
environmentId: "<id>",
deleted: false,
createdAt: "1713845250939",
updatedAt: "1737018718437",
createdAt: "1713846645065",
updatedAt: "1737020112563",
},
};
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ let value: SubscribersControllerGetSubscriberResponse = {
organizationId: "<id>",
environmentId: "<id>",
deleted: false,
createdAt: "1723428357867",
updatedAt: "1736953448843",
createdAt: "1723429751999",
updatedAt: "1736954842975",
},
};
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ let value: SubscribersControllerListSubscribersResponse = {
organizationId: "<id>",
environmentId: "<id>",
deleted: false,
createdAt: "1735293303440",
updatedAt: "1736996912589",
createdAt: "1735294697558",
updatedAt: "1736998306707",
},
],
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ let value: SubscribersControllerListSubscribersResponseBody = {
organizationId: "<id>",
environmentId: "<id>",
deleted: false,
createdAt: "1720055438118",
updatedAt: "1737019262353",
createdAt: "1720056832229",
updatedAt: "1737020656464",
},
],
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ let value: SubscribersControllerMarkActionAsSeenResponse = {
organizationId: "<id>",
environmentId: "<id>",
deleted: false,
createdAt: "1731927655264",
updatedAt: "1736960128305",
createdAt: "1731929049501",
updatedAt: "1736961522542",
},
createdAt: "1736295850213",
createdAt: "1736297244449",
content: {
type: "text",
content: "<value>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ let value: SubscribersControllerMarkMessagesAsResponse = {
organizationId: "<id>",
environmentId: "<id>",
deleted: false,
createdAt: "1713490029210",
updatedAt: "1736992114270",
createdAt: "1713491423432",
updatedAt: "1736993508492",
},
createdAt: "1713210430711",
createdAt: "1713211824934",
content: {
type: "button",
content: "<value>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ let value: SubscribersControllerModifySubscriberChannelResponse = {
organizationId: "<id>",
environmentId: "<id>",
deleted: false,
createdAt: "1726529379919",
updatedAt: "1737009767888",
createdAt: "1726530774081",
updatedAt: "1737011162050",
},
};
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ let value: SubscribersControllerUpdateSubscriberChannelResponse = {
organizationId: "<id>",
environmentId: "<id>",
deleted: false,
createdAt: "1716839666235",
updatedAt: "1736989584566",
createdAt: "1716841060390",
updatedAt: "1736990978721",
},
};
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ let value: SubscribersControllerUpdateSubscriberOnlineFlagResponse = {
organizationId: "<id>",
environmentId: "<id>",
deleted: false,
createdAt: "1709568045048",
updatedAt: "1736979078148",
createdAt: "1709569439227",
updatedAt: "1736980472327",
},
};
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ let value: SubscribersControllerUpdateSubscriberResponse = {
organizationId: "<id>",
environmentId: "<id>",
deleted: false,
createdAt: "1724805275529",
updatedAt: "1737005127910",
createdAt: "1724806669667",
updatedAt: "1737006522049",
},
};
```
Expand Down
2 changes: 1 addition & 1 deletion jsr.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{
"name": "@novu/api",
"version": "0.0.1",
"version": "0.0.2",
"exports": {
".": "./src/index.ts",
"./models/errors": "./src/models/errors/index.ts",
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@novu/api",
"version": "0.0.1",
"version": "0.0.2",
"author": "Novu",
"main": "./index.js",
"sideEffects": false,
Expand Down
46 changes: 46 additions & 0 deletions sources/json-development.json
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,39 @@
}
},
"responses": {
"201": {
"headers": {
"Content-Type": {
"$ref": "#/components/headers/Content-Type"
},
"RateLimit-Limit": {
"$ref": "#/components/headers/RateLimit-Limit"
},
"RateLimit-Remaining": {
"$ref": "#/components/headers/RateLimit-Remaining"
},
"RateLimit-Reset": {
"$ref": "#/components/headers/RateLimit-Reset"
},
"RateLimit-Policy": {
"$ref": "#/components/headers/RateLimit-Policy"
},
"Idempotency-Key": {
"$ref": "#/components/headers/Idempotency-Key"
},
"Idempotency-Replay": {
"$ref": "#/components/headers/Idempotency-Replay"
}
},
"description": "",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/IdempotenceTestingResponse"
}
}
}
},
"400": {
"description": "Bad Request",
"headers": {
Expand Down Expand Up @@ -24282,6 +24315,19 @@
"expectedBehavior"
]
},
"IdempotenceTestingResponse": {
"type": "object",
"properties": {
"number": {
"type": "number",
"description": "A unique number representing the idempotency response",
"example": 1
}
},
"required": [
"number"
]
},
"TriggerEventResponseDto": {
"type": "object",
"properties": {
Expand Down
14 changes: 7 additions & 7 deletions src/funcs/adminTestIdempotency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export async function adminTestIdempotency(
options?: RequestOptions,
): Promise<
Result<
operations.HealthControllerTestIdempotencyResponse | undefined,
operations.HealthControllerTestIdempotencyResponse,
| errors.ErrorDto
| errors.ErrorDto
| errors.ValidationErrorDto
Expand Down Expand Up @@ -151,7 +151,7 @@ export async function adminTestIdempotency(
};

const [result] = await M.match<
operations.HealthControllerTestIdempotencyResponse | undefined,
operations.HealthControllerTestIdempotencyResponse,
| errors.ErrorDto
| errors.ErrorDto
| errors.ValidationErrorDto
Expand All @@ -164,6 +164,11 @@ export async function adminTestIdempotency(
| RequestTimeoutError
| ConnectionError
>(
M.json(
201,
operations.HealthControllerTestIdempotencyResponse$inboundSchema,
{ hdrs: true, key: "Result" },
),
M.jsonErr(
[400, 401, 403, 404, 405, 409, 413, 415],
errors.ErrorDto$inboundSchema,
Expand All @@ -174,11 +179,6 @@ export async function adminTestIdempotency(
M.fail(429),
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
M.fail(503),
M.nil(
"2XX",
operations.HealthControllerTestIdempotencyResponse$inboundSchema
.optional(),
),
M.fail("4XX"),
M.fail("5XX"),
)(response, { extraFields: responseFields });
Expand Down
4 changes: 2 additions & 2 deletions src/lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
export const SDK_METADATA = {
language: "typescript",
openapiDocVersion: "1.0",
sdkVersion: "0.0.1",
sdkVersion: "0.0.2",
genVersion: "2.493.21",
userAgent: "speakeasy-sdk/typescript 0.0.1 2.493.21 1.0 @novu/api",
userAgent: "speakeasy-sdk/typescript 0.0.2 2.493.21 1.0 @novu/api",
} as const;
Loading

0 comments on commit 3791746

Please sign in to comment.