Skip to content

Commit

Permalink
fix idempotency
Browse files Browse the repository at this point in the history
  • Loading branch information
tatarco committed Jan 16, 2025
1 parent fb6ffdd commit d7fa0b7
Show file tree
Hide file tree
Showing 161 changed files with 2,778 additions and 4,389 deletions.
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
!/REACT_QUERY.md
!/**/*.ts
!/**/*.js
!/**/*.json
!/**/*.map

/.eslintrc.js
Expand Down
74 changes: 47 additions & 27 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
lockVersion: 2.0.0
id: 6bff3a53-3f0b-40b4-942f-ff70dc583ae5
management:
docChecksum: 685d8a1a91530f3244f57c461e7f19ec
docChecksum: 5711b967c5092d075f6b0b89bab0a96d
docVersion: "1.0"
speakeasyVersion: 1.468.8
generationVersion: 2.493.19
releaseVersion: 0.0.1-alpha.198
configChecksum: 395c82a58b4dc7b50b67c34441dc25a6
speakeasyVersion: 1.468.9
generationVersion: 2.493.21
releaseVersion: 0.0.1-alpha.196
configChecksum: 04791d768826e1ed506524af9c1c42c2
published: true
features:
typescript:
acceptHeaders: 2.81.2
additionalDependencies: 0.1.0
additionalProperties: 0.1.1
constsAndDefaults: 0.1.11
core: 3.18.15
core: 3.18.16
defaultEnabledRetries: 0.1.0
deprecations: 2.81.1
enumUnions: 0.1.0
Expand Down Expand Up @@ -118,8 +119,8 @@ generatedFiles:
- docs/models/components/filtertopicsresponsedto.md
- docs/models/components/getsubscriberpreferencesresponsedto.md
- docs/models/components/gettopicresponsedto.md
- docs/models/components/idempotencybodydto.md
- docs/models/components/idempotencyresponse.md
- docs/models/components/idempotencybehaviorenum.md
- docs/models/components/idempotencytestingdto.md
- docs/models/components/integrationresponsedto.md
- docs/models/components/issues.md
- docs/models/components/markallmessageasrequestdto.md
Expand Down Expand Up @@ -226,11 +227,17 @@ generatedFiles:
- docs/models/components/workflowresponse.md
- docs/models/components/workflowresponsedata.md
- docs/models/components/workflowtostepcontrolvaluesdto.md
- docs/models/errors/details.md
- docs/models/errors/errordto.md
- docs/models/errors/errors.md
- docs/models/errors/errort.md
- docs/models/errors/healthcontrollerhealthcheckresponsebody.md
- docs/models/errors/info.md
- docs/models/errors/validationerrordto.md
- docs/models/errors/value.md
- docs/models/operations/channel.md
- docs/models/operations/details.md
- docs/models/operations/errort.md
- docs/models/operations/eventscontrollerbroadcasteventtoallrequest.md
- docs/models/operations/eventscontrollerbroadcasteventtoallresponse.md
- docs/models/operations/eventscontrollercancelrequest.md
Expand All @@ -239,6 +246,11 @@ generatedFiles:
- docs/models/operations/eventscontrollertriggerbulkresponse.md
- docs/models/operations/eventscontrollertriggerrequest.md
- docs/models/operations/eventscontrollertriggerresponse.md
- docs/models/operations/healthcontrollerhealthcheckrequest.md
- docs/models/operations/healthcontrollerhealthcheckresponsebody.md
- docs/models/operations/healthcontrollertestidempotencyrequest.md
- docs/models/operations/healthcontrollertestidempotencyresponse.md
- docs/models/operations/info.md
- docs/models/operations/integrationscontrollercreateintegrationrequest.md
- docs/models/operations/integrationscontrollercreateintegrationresponse.md
- docs/models/operations/integrationscontrollergetactiveintegrationsrequest.md
Expand Down Expand Up @@ -312,13 +324,6 @@ generatedFiles:
- docs/models/operations/subscriberscontrollerupdatesubscriberpreferenceresponse.md
- docs/models/operations/subscriberscontrollerupdatesubscriberrequest.md
- docs/models/operations/subscriberscontrollerupdatesubscriberresponse.md
- docs/models/operations/testapiratelimitbulkcontrollerglobalcategorynocostoverriderequest.md
- docs/models/operations/testapiratelimitbulkcontrollernocategorynocostoverriderequest.md
- docs/models/operations/testapiratelimitbulkcontrollernocategorysinglecostoverriderequest.md
- docs/models/operations/testingcontrolleridempotencygetrequest.md
- docs/models/operations/testingcontrolleridempotencygetresponse.md
- docs/models/operations/testingcontrolleridempotencyrequest.md
- docs/models/operations/testingcontrolleridempotencyresponse.md
- docs/models/operations/topicscontrollerassignrequest.md
- docs/models/operations/topicscontrollerassignresponse.md
- docs/models/operations/topicscontrollercreatetopicrequest.md
Expand Down Expand Up @@ -354,8 +359,8 @@ generatedFiles:
- jsr.json
- package.json
- src/core.ts
- src/funcs/adminIdempotencyGet.ts
- src/funcs/adminIdempotencyPost.ts
- src/funcs/adminHealthControllerHealthCheck.ts
- src/funcs/adminTestIdempotency.ts
- src/funcs/cancel.ts
- src/funcs/integrationsCreate.ts
- src/funcs/integrationsDelete.ts
Expand Down Expand Up @@ -392,9 +397,6 @@ generatedFiles:
- src/funcs/subscribersPropertiesUpdateOnlineFlag.ts
- src/funcs/subscribersRetrieve.ts
- src/funcs/subscribersUpdate.ts
- src/funcs/testApiRateLimitBulkControllerGlobalCategoryNoCostOverride.ts
- src/funcs/testApiRateLimitBulkControllerNoCategoryNoCostOverride.ts
- src/funcs/testApiRateLimitBulkControllerNoCategorySingleCostOverride.ts
- src/funcs/topicsCreate.ts
- src/funcs/topicsDelete.ts
- src/funcs/topicsList.ts
Expand Down Expand Up @@ -478,8 +480,8 @@ generatedFiles:
- src/models/components/filtertopicsresponsedto.ts
- src/models/components/getsubscriberpreferencesresponsedto.ts
- src/models/components/gettopicresponsedto.ts
- src/models/components/idempotencybodydto.ts
- src/models/components/idempotencyresponse.ts
- src/models/components/idempotencybehaviorenum.ts
- src/models/components/idempotencytestingdto.ts
- src/models/components/index.ts
- src/models/components/integrationresponsedto.ts
- src/models/components/markallmessageasrequestdto.ts
Expand Down Expand Up @@ -547,6 +549,7 @@ generatedFiles:
- src/models/components/workflowresponse.ts
- src/models/components/workflowtostepcontrolvaluesdto.ts
- src/models/errors/errordto.ts
- src/models/errors/healthcontrollerhealthcheck.ts
- src/models/errors/httpclienterrors.ts
- src/models/errors/index.ts
- src/models/errors/sdkerror.ts
Expand All @@ -556,6 +559,8 @@ generatedFiles:
- src/models/operations/eventscontrollercancel.ts
- src/models/operations/eventscontrollertrigger.ts
- src/models/operations/eventscontrollertriggerbulk.ts
- src/models/operations/healthcontrollerhealthcheck.ts
- src/models/operations/healthcontrollertestidempotency.ts
- src/models/operations/index.ts
- src/models/operations/integrationscontrollercreateintegration.ts
- src/models/operations/integrationscontrollergetactiveintegrations.ts
Expand Down Expand Up @@ -592,11 +597,6 @@ generatedFiles:
- src/models/operations/subscriberscontrollerupdatesubscriberglobalpreferences.ts
- src/models/operations/subscriberscontrollerupdatesubscriberonlineflag.ts
- src/models/operations/subscriberscontrollerupdatesubscriberpreference.ts
- src/models/operations/testapiratelimitbulkcontrollerglobalcategorynocostoverride.ts
- src/models/operations/testapiratelimitbulkcontrollernocategorynocostoverride.ts
- src/models/operations/testapiratelimitbulkcontrollernocategorysinglecostoverride.ts
- src/models/operations/testingcontrolleridempotency.ts
- src/models/operations/testingcontrolleridempotencyget.ts
- src/models/operations/topicscontrollerassign.ts
- src/models/operations/topicscontrollercreatetopic.ts
- src/models/operations/topicscontrollerdeletetopic.ts
Expand Down Expand Up @@ -1727,6 +1727,26 @@ 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"}
"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"}
HealthController_healthCheck:
speakeasy-default-health-controller-health-check:
responses:
"200":
application/json: {"status": "ok", "info": {"database": {"status": "up"}}, "details": {"database": {"status": "up"}}}
"503":
application/json: {"status": "error", "info": {"database": {"status": "up"}}, "error": {"redis": {"status": "down", "message": "Could not connect"}}, "details": {"database": {"status": "up"}, "redis": {"status": "down", "message": "Could not connect"}}}
HealthController_testIdempotency:
speakeasy-default-health-controller-test-idempotency:
requestBody:
application/json: {"expectedBehavior": "IMMEDIATE_EXCEPTION"}
responses:
"400":
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"}
"414":
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"}
"422":
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"}
generatedTests:
EventsController_trigger: "2024-12-24T08:36:06+01:00"
EventsController_triggerBulk: "2024-12-24T08:36:06+01:00"
Expand Down
4 changes: 2 additions & 2 deletions .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.198
version: 0.0.1-alpha.196
additionalDependencies:
dependencies: {}
devDependencies: {}
Expand All @@ -38,7 +38,7 @@ typescript:
inputModelSuffix: input
maxMethodParams: 3
methodArguments: require-security-and-request
moduleFormat: dual
moduleFormat: commonjs
outputModelSuffix: output
packageName: '@novu/api'
responseFormat: flat
Expand Down
12 changes: 6 additions & 6 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
speakeasyVersion: 1.468.8
speakeasyVersion: 1.468.9
sources:
json-development:
sourceNamespace: json-development
sourceRevisionDigest: sha256:cee5d8e4166a37120efd49290cd39e31f731a47e8ce6f2c8169d160e91448cd5
sourceBlobDigest: sha256:fb483306ef3d46d0086280638a2af9803b7e79a6328622e5195b09b2861f8be8
sourceRevisionDigest: sha256:294a81b97cf3083caf5fc94581ffeb3d817bd45b1250685ce352e6a6271f1132
sourceBlobDigest: sha256:84c032851411dc3ed8d709a1d5a839167ddeb3b59c0e631d346946008b739b93
tags:
- latest
- "1.0"
targets:
my-first-target:
source: json-development
sourceNamespace: json-development
sourceRevisionDigest: sha256:cee5d8e4166a37120efd49290cd39e31f731a47e8ce6f2c8169d160e91448cd5
sourceBlobDigest: sha256:fb483306ef3d46d0086280638a2af9803b7e79a6328622e5195b09b2861f8be8
sourceRevisionDigest: sha256:294a81b97cf3083caf5fc94581ffeb3d817bd45b1250685ce352e6a6271f1132
sourceBlobDigest: sha256:84c032851411dc3ed8d709a1d5a839167ddeb3b59c0e631d346946008b739b93
codeSamplesNamespace: code-samples-typescript
codeSamplesRevisionDigest: sha256:1bd212a85307028d47a77d2245e0e8612556943bc6d5d0391b1a56225ea875a5
codeSamplesRevisionDigest: sha256:27a1f29679cda016118eb5a1829442c87ea5de15ff369dfb8512ac103d6653c0
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
17 changes: 4 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ yarn add @novu/api zod
# Note that Yarn does not install peer dependencies automatically. You will need
# to install zod as shown above.
```

> [!NOTE]
> This package is published with CommonJS and ES Modules (ESM) support.
<!-- End SDK Installation [installation] -->

<!-- Start Requirements [requirements] -->
Expand Down Expand Up @@ -221,8 +218,8 @@ run();

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

* [idempotencyPost](docs/sdks/admin/README.md#idempotencypost)
* [idempotencyGet](docs/sdks/admin/README.md#idempotencyget)
* [healthControllerHealthCheck](docs/sdks/admin/README.md#healthcontrollerhealthcheck)
* [testIdempotency](docs/sdks/admin/README.md#testidempotency)

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

Expand Down Expand Up @@ -259,9 +256,6 @@ run();
* [triggerBulk](docs/sdks/novu/README.md#triggerbulk) - Bulk trigger event
* [triggerBroadcast](docs/sdks/novu/README.md#triggerbroadcast) - Broadcast event to all
* [cancel](docs/sdks/novu/README.md#cancel) - Cancel triggered event
* [testApiRateLimitBulkControllerNoCategoryNoCostOverride](docs/sdks/novu/README.md#testapiratelimitbulkcontrollernocategorynocostoverride)
* [testApiRateLimitBulkControllerNoCategorySingleCostOverride](docs/sdks/novu/README.md#testapiratelimitbulkcontrollernocategorysinglecostoverride)
* [testApiRateLimitBulkControllerGlobalCategoryNoCostOverride](docs/sdks/novu/README.md#testapiratelimitbulkcontrollerglobalcategorynocostoverride)

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

Expand Down Expand Up @@ -337,8 +331,8 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).

<summary>Available standalone functions</summary>

- [`adminIdempotencyGet`](docs/sdks/admin/README.md#idempotencyget)
- [`adminIdempotencyPost`](docs/sdks/admin/README.md#idempotencypost)
- [`adminHealthControllerHealthCheck`](docs/sdks/admin/README.md#healthcontrollerhealthcheck)
- [`adminTestIdempotency`](docs/sdks/admin/README.md#testidempotency)
- [`cancel`](docs/sdks/novu/README.md#cancel) - Cancel triggered event
- [`integrationsCreate`](docs/sdks/integrations/README.md#create) - Create integration
- [`integrationsDelete`](docs/sdks/integrations/README.md#delete) - Delete integration
Expand Down Expand Up @@ -375,9 +369,6 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
- [`subscribersPropertiesUpdateOnlineFlag`](docs/sdks/properties/README.md#updateonlineflag) - Update subscriber online status
- [`subscribersRetrieve`](docs/sdks/subscribers/README.md#retrieve) - Get subscriber
- [`subscribersUpdate`](docs/sdks/subscribers/README.md#update) - Update subscriber
- [`testApiRateLimitBulkControllerGlobalCategoryNoCostOverride`](docs/sdks/novu/README.md#testapiratelimitbulkcontrollerglobalcategorynocostoverride)
- [`testApiRateLimitBulkControllerNoCategoryNoCostOverride`](docs/sdks/novu/README.md#testapiratelimitbulkcontrollernocategorynocostoverride)
- [`testApiRateLimitBulkControllerNoCategorySingleCostOverride`](docs/sdks/novu/README.md#testapiratelimitbulkcontrollernocategorysinglecostoverride)
- [`topicsCreate`](docs/sdks/topics/README.md#create) - Topic creation
- [`topicsDelete`](docs/sdks/topics/README.md#delete) - Delete topic
- [`topicsList`](docs/sdks/topics/README.md#list) - Get topic list filtered
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 @@ -8,8 +8,8 @@ import { ActivitiesResponseDto } from "@novu/api/models/components";
let value: ActivitiesResponseDto = {
hasMore: false,
data: [],
pageSize: 1317.97,
page: 7163.27,
pageSize: 7163.27,
page: 2894.06,
};
```

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: 6532.01,
count: 6521.03,
templates: [
"<value>",
],
channels: [
"chat",
"sms",
],
};
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ let value: ActivityNotificationExecutionDetailResponseDto = {
detail: "<value>",
isRetry: false,
isTest: false,
providerId: "mobishastra",
source: "Payload",
providerId: "forty-six-elks",
source: "Webhook",
};
```

Expand Down
16 changes: 8 additions & 8 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: "Success",
detail: "<value>",
isRetry: false,
isTest: false,
providerId: "mailgun",
source: "Webhook",
providerId: "pusher-beams",
source: "Credentials",
},
],
step: {
Expand All @@ -25,21 +25,21 @@ let value: ActivityNotificationJobResponseDto = {
filters: [
{
isNegated: false,
type: "BOOLEAN",
value: "OR",
type: "LIST",
value: "AND",
children: [
{
field: "<value>",
value: "<value>",
operator: "SMALLER_EQUAL",
operator: "NOT_BETWEEN",
on: "payload",
},
],
},
],
templateId: "<id>",
},
providerId: "getstream",
providerId: "novu-email",
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 = "email";
```

## Values
Expand Down
4 changes: 2 additions & 2 deletions docs/models/components/activitynotificationstepresponsedto.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ let value: ActivityNotificationStepResponseDto = {
{
field: "<value>",
value: "<value>",
operator: "NOT_IN",
on: "subscriber",
operator: "SMALLER_EQUAL",
on: "payload",
},
],
},
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: 5699.65,
monthlySent: 5908.73,
weeklySent: 5908.73,
monthlySent: 5743.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: "system_icon",
type: "system_custom",
};
```

Expand Down
Loading

0 comments on commit d7fa0b7

Please sign in to comment.