diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index a75fcafe..c441bd9a 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 6bff3a53-3f0b-40b4-942f-ff70dc583ae5 management: - docChecksum: 92fd174fcec8436e782e2dd65b9ca913 + docChecksum: 7656686695d54efcc007c3194bb9e9d6 docVersion: "1.0" speakeasyVersion: 1.453.4 generationVersion: 2.474.6 - releaseVersion: 0.0.1-alpha.70 - configChecksum: 1a90fadeceee20d1afea263bbcad6182 + releaseVersion: 0.0.1-alpha.74 + configChecksum: 2ff328e4ac26a8a420b393b999a2c223 published: true features: typescript: @@ -47,6 +47,8 @@ generatedFiles: - docs/models/components/activitynotificationtemplateresponsedto.md - docs/models/components/activitystatsresponsedto.md - docs/models/components/actor.md + - docs/models/components/actordata.md + - docs/models/components/actortypeenum.md - docs/models/components/addsubscribersrequestdto.md - docs/models/components/apikey.md - docs/models/components/assignsubscribertotopicdto.md @@ -108,10 +110,10 @@ generatedFiles: - docs/models/components/markallmessageasrequestdtomarkas.md - docs/models/components/markas.md - docs/models/components/markmessageactionasseendto.md + - docs/models/components/markmessageactionasseendtopayload.md - docs/models/components/markmessageactionasseendtostatus.md - docs/models/components/messageaction.md - docs/models/components/messageactionresult.md - - docs/models/components/messageactionresultpayload.md - docs/models/components/messageactionresulttype.md - docs/models/components/messageactionstatus.md - docs/models/components/messagebutton.md @@ -130,6 +132,9 @@ generatedFiles: - docs/models/components/messagetemplate.md - docs/models/components/metadata.md - docs/models/components/monthlytype.md + - docs/models/components/notificationdto.md + - docs/models/components/notificationdtochannel.md + - docs/models/components/notificationdtostatus.md - docs/models/components/notificationgroup.md - docs/models/components/notificationgroupresponsedto.md - docs/models/components/notificationstep.md @@ -173,6 +178,7 @@ generatedFiles: - docs/models/components/topicpayloaddto.md - docs/models/components/topicsubscriberdto.md - docs/models/components/triggereventrequestdto.md + - docs/models/components/triggereventrequestdtoactor.md - docs/models/components/triggereventresponsedto.md - docs/models/components/triggereventresponsedtostatus.md - docs/models/components/triggereventtoallrequestdto.md @@ -353,7 +359,7 @@ generatedFiles: - src/funcs/subscribersMessagesMarkAll.ts - src/funcs/subscribersMessagesMarkAllAs.ts - src/funcs/subscribersMessagesUpdateAsSeen.ts - - src/funcs/subscribersNotificationsRetrieve.ts + - src/funcs/subscribersNotificationsFeed.ts - src/funcs/subscribersNotificationsUnseenCount.ts - src/funcs/subscribersPreferencesList.ts - src/funcs/subscribersPreferencesRetrieveByLevel.ts @@ -403,6 +409,8 @@ generatedFiles: - src/models/components/activitynotificationsubscriberresponsedto.ts - src/models/components/activitynotificationtemplateresponsedto.ts - src/models/components/activitystatsresponsedto.ts + - src/models/components/actor.ts + - src/models/components/actortypeenum.ts - src/models/components/addsubscribersrequestdto.ts - src/models/components/apikey.ts - src/models/components/assignsubscribertotopicdto.ts @@ -450,6 +458,7 @@ generatedFiles: - src/models/components/messagemarkasrequestdto.ts - src/models/components/messageresponsedto.ts - src/models/components/messagetemplate.ts + - src/models/components/notificationdto.ts - src/models/components/notificationgroup.ts - src/models/components/notificationgroupresponsedto.ts - src/models/components/notificationstep.ts @@ -861,7 +870,7 @@ examples: payload: "btoa(JSON.stringify({ foo: 123 })) results in base64 encoded string like eyJmb28iOjEyM30=" responses: "200": - application/json: {"page": "1526.70", "hasMore": true, "pageSize": "9643.05", "data": [{"hasMore": true, "data": ["", ""], "pageSize": "1031.10", "page": "1522.73"}, {"hasMore": false, "data": [], "pageSize": "5271.67", "page": "9499.10"}]} + application/json: {"page": "1526.70", "hasMore": true, "pageSize": "9643.05", "data": [{"hasMore": true, "data": [{"_id": "", "_templateId": "", "_environmentId": "", "_messageTemplateId": "", "_organizationId": "", "_notificationId": "", "_subscriberId": "", "_feedId": "", "_jobId": "", "transactionId": "", "content": "", "channel": "push", "read": false, "seen": false, "deleted": false, "cta": {}, "status": "warning", "payload": {"key": "", "key1": "", "key2": ""}, "overrides": {"key": "", "key1": "", "key2": ""}}, {"_id": "", "_templateId": "", "_environmentId": "", "_messageTemplateId": "", "_organizationId": "", "_notificationId": "", "_subscriberId": "", "_feedId": "", "_jobId": "", "transactionId": "", "content": "", "channel": "sms", "read": true, "seen": false, "deleted": true, "cta": {}, "status": "warning", "payload": {"key": "", "key1": ""}, "overrides": {"key": "", "key1": ""}}], "pageSize": "1031.10", "page": "1522.73"}, {"hasMore": false, "data": [], "pageSize": "5271.67", "page": "9499.10"}]} SubscribersController_markMessagesAs: speakeasy-default-subscribers-controller-mark-messages-as: parameters: diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 583c4125..9669779a 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -13,7 +13,7 @@ generation: oAuth2ClientCredentialsEnabled: false oAuth2PasswordEnabled: false typescript: - version: 0.0.1-alpha.70 + version: 0.0.1-alpha.74 additionalDependencies: dependencies: {} devDependencies: {} diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 80822379..509a8432 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.453.4 sources: json-development: sourceNamespace: json-development - sourceRevisionDigest: sha256:fcc580d43aec097e827f7ec9369f285d7564eb95dfcef159203811dc8d86d7e3 - sourceBlobDigest: sha256:51b9cdd1a1f2ebd3b6c2729bb958e54f45f527d221f6419a611e337f336e9a7a + sourceRevisionDigest: sha256:7af3af5203d0b8763363cafe5331f118bfe7a53445adbab5b1421d40c812b7cd + sourceBlobDigest: sha256:586a95c4bf7575b394ba59141a7020703e01cb183c4e45cb8a89c74977f40464 tags: - latest - "1.0" @@ -11,10 +11,10 @@ targets: my-first-target: source: json-development sourceNamespace: json-development - sourceRevisionDigest: sha256:fcc580d43aec097e827f7ec9369f285d7564eb95dfcef159203811dc8d86d7e3 - sourceBlobDigest: sha256:51b9cdd1a1f2ebd3b6c2729bb958e54f45f527d221f6419a611e337f336e9a7a + sourceRevisionDigest: sha256:7af3af5203d0b8763363cafe5331f118bfe7a53445adbab5b1421d40c812b7cd + sourceBlobDigest: sha256:586a95c4bf7575b394ba59141a7020703e01cb183c4e45cb8a89c74977f40464 codeSamplesNamespace: code-samples-typescript - codeSamplesRevisionDigest: sha256:a0d61843e2e18df5fbf574e385f932dacfea1650fba44d2d68f42761bc3ce966 + codeSamplesRevisionDigest: sha256:099010ac625efddb2b44e233939f465f1643465b3023d108d4e7ac5d03c67b95 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index ccb1c2c5..f70b38c6 100644 --- a/README.md +++ b/README.md @@ -295,7 +295,7 @@ run(); #### [subscribers.notifications](docs/sdks/novunotifications/README.md) -* [retrieve](docs/sdks/novunotifications/README.md#retrieve) - Get in-app notification feed for a particular subscriber +* [feed](docs/sdks/novunotifications/README.md#feed) - Get in-app notification feed for a particular subscriber * [unseenCount](docs/sdks/novunotifications/README.md#unseencount) - Get the unseen in-app notifications count for subscribers feed #### [subscribers.preferences](docs/sdks/preferences/README.md) @@ -380,7 +380,7 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). - [`subscribersMessagesMarkAll`](docs/sdks/novumessages/README.md#markall) - Marks all the subscriber messages as read, unread, seen or unseen. Optionally you can pass feed id (or array) to mark messages of a particular feed. - [`subscribersMessagesMarkAllAs`](docs/sdks/novumessages/README.md#markallas) - Mark a subscriber messages as seen, read, unseen or unread - [`subscribersMessagesUpdateAsSeen`](docs/sdks/novumessages/README.md#updateasseen) - Mark message action as seen -- [`subscribersNotificationsRetrieve`](docs/sdks/novunotifications/README.md#retrieve) - Get in-app notification feed for a particular subscriber +- [`subscribersNotificationsFeed`](docs/sdks/novunotifications/README.md#feed) - Get in-app notification feed for a particular subscriber - [`subscribersNotificationsUnseenCount`](docs/sdks/novunotifications/README.md#unseencount) - Get the unseen in-app notifications count for subscribers feed - [`subscribersPreferencesList`](docs/sdks/preferences/README.md#list) - Get subscriber preferences - [`subscribersPreferencesRetrieveByLevel`](docs/sdks/preferences/README.md#retrievebylevel) - Get subscriber preferences by level diff --git a/docs/models/components/activitiesresponsedto.md b/docs/models/components/activitiesresponsedto.md index 5257592a..a1e09140 100644 --- a/docs/models/components/activitiesresponsedto.md +++ b/docs/models/components/activitiesresponsedto.md @@ -14,8 +14,8 @@ let value: ActivitiesResponseDto = { transactionId: "", }, ], - pageSize: 2828.07, - page: 1201.97, + pageSize: 4142.63, + page: 641.47, }; ``` diff --git a/docs/models/components/activitygraphstatesresponse.md b/docs/models/components/activitygraphstatesresponse.md index f00ba2c7..7ff84e78 100644 --- a/docs/models/components/activitygraphstatesresponse.md +++ b/docs/models/components/activitygraphstatesresponse.md @@ -7,12 +7,12 @@ import { ActivityGraphStatesResponse } from "@novu/api/models/components"; let value: ActivityGraphStatesResponse = { id: "", - count: 641.47, + count: 939.41, templates: [ "", ], channels: [ - "chat", + "sms", ], }; ``` diff --git a/docs/models/components/activitystatsresponsedto.md b/docs/models/components/activitystatsresponsedto.md index ab0ed4ca..51547ea8 100644 --- a/docs/models/components/activitystatsresponsedto.md +++ b/docs/models/components/activitystatsresponsedto.md @@ -6,8 +6,8 @@ import { ActivityStatsResponseDto } from "@novu/api/models/components"; let value: ActivityStatsResponseDto = { - weeklySent: 1187.28, - monthlySent: 3179.83, + weeklySent: 5666.01, + monthlySent: 2653.89, }; ``` diff --git a/docs/models/components/actor.md b/docs/models/components/actor.md index 8fb611ca..c343c8ef 100644 --- a/docs/models/components/actor.md +++ b/docs/models/components/actor.md @@ -1,23 +1,19 @@ # Actor -It is used to display the Avatar of the provided actor's subscriber id or actor object. - - If a new actor object is provided, we will create a new subscriber in our system - - -## Supported Types - -### `string` +## Example Usage ```typescript -const value: string = ""; -``` - -### `components.SubscriberPayloadDto` +import { Actor } from "@novu/api/models/components"; -```typescript -const value: components.SubscriberPayloadDto = { - subscriberId: "", +let value: Actor = { + data: {}, + type: "system_icon", }; ``` +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `data` | [components.ActorData](../../models/components/actordata.md) | :heavy_check_mark: | The data associated with the actor, can be null if not applicable. | +| `type` | [components.ActorTypeEnum](../../models/components/actortypeenum.md) | :heavy_check_mark: | The type of the actor, indicating the role in the notification process. | \ No newline at end of file diff --git a/docs/models/components/messageactionresultpayload.md b/docs/models/components/actordata.md similarity index 50% rename from docs/models/components/messageactionresultpayload.md rename to docs/models/components/actordata.md index bbac45e2..afa911a5 100644 --- a/docs/models/components/messageactionresultpayload.md +++ b/docs/models/components/actordata.md @@ -1,11 +1,13 @@ -# MessageActionResultPayload +# ActorData + +The data associated with the actor, can be null if not applicable. ## Example Usage ```typescript -import { MessageActionResultPayload } from "@novu/api/models/components"; +import { ActorData } from "@novu/api/models/components"; -let value: MessageActionResultPayload = {}; +let value: ActorData = {}; ``` ## Fields diff --git a/docs/models/components/actortypeenum.md b/docs/models/components/actortypeenum.md new file mode 100644 index 00000000..205981c7 --- /dev/null +++ b/docs/models/components/actortypeenum.md @@ -0,0 +1,17 @@ +# ActorTypeEnum + +The type of the actor, indicating the role in the notification process. + +## Example Usage + +```typescript +import { ActorTypeEnum } from "@novu/api/models/components"; + +let value: ActorTypeEnum = "system_icon"; +``` + +## Values + +```typescript +"none" | "user" | "system_icon" | "system_custom" +``` \ No newline at end of file diff --git a/docs/models/components/bulktriggereventdto.md b/docs/models/components/bulktriggereventdto.md index 06e5ce8f..7ee68584 100644 --- a/docs/models/components/bulktriggereventdto.md +++ b/docs/models/components/bulktriggereventdto.md @@ -25,7 +25,8 @@ let value: BulkTriggerEventDto = { }, to: [ { - subscriberId: "", + topicKey: "", + type: "Topic", }, ], }, diff --git a/docs/models/components/channel.md b/docs/models/components/channel.md index 212bb8d3..c3c3bf14 100644 --- a/docs/models/components/channel.md +++ b/docs/models/components/channel.md @@ -5,7 +5,7 @@ ```typescript import { Channel } from "@novu/api/models/components"; -let value: Channel = "custom"; +let value: Channel = "in_app"; ``` ## Values diff --git a/docs/models/components/channelcredentials.md b/docs/models/components/channelcredentials.md index 62d000ab..abe311bf 100644 --- a/docs/models/components/channelcredentials.md +++ b/docs/models/components/channelcredentials.md @@ -6,7 +6,7 @@ import { ChannelCredentials } from "@novu/api/models/components"; let value: ChannelCredentials = { - webhookUrl: "https://orange-mozzarella.name/", + webhookUrl: "https://kaleidoscopic-status.net", }; ``` diff --git a/docs/models/components/channelpreference.md b/docs/models/components/channelpreference.md index ddd3acb6..626af6d9 100644 --- a/docs/models/components/channelpreference.md +++ b/docs/models/components/channelpreference.md @@ -6,7 +6,7 @@ import { ChannelPreference } from "@novu/api/models/components"; let value: ChannelPreference = { - type: "push", + type: "sms", enabled: false, }; ``` diff --git a/docs/models/components/channelpreferencetype.md b/docs/models/components/channelpreferencetype.md index 47790754..ac1a01b6 100644 --- a/docs/models/components/channelpreferencetype.md +++ b/docs/models/components/channelpreferencetype.md @@ -7,7 +7,7 @@ The type of channel that is enabled or not ```typescript import { ChannelPreferenceType } from "@novu/api/models/components"; -let value: ChannelPreferenceType = "email"; +let value: ChannelPreferenceType = "chat"; ``` ## Values diff --git a/docs/models/components/channels.md b/docs/models/components/channels.md index bd5fed9f..880793c2 100644 --- a/docs/models/components/channels.md +++ b/docs/models/components/channels.md @@ -5,7 +5,7 @@ ```typescript import { Channels } from "@novu/api/models/components"; -let value: Channels = "sms"; +let value: Channels = "trigger"; ``` ## Values diff --git a/docs/models/components/channelsettings.md b/docs/models/components/channelsettings.md index 789639d4..60b4dd68 100644 --- a/docs/models/components/channelsettings.md +++ b/docs/models/components/channelsettings.md @@ -6,9 +6,9 @@ import { ChannelSettings } from "@novu/api/models/components"; let value: ChannelSettings = { - providerId: "slack", + providerId: "ryver", credentials: { - webhookUrl: "https://finished-receptor.org", + webhookUrl: "https://pale-milestone.biz", }, integrationId: "", }; diff --git a/docs/models/components/channelsettingsproviderid.md b/docs/models/components/channelsettingsproviderid.md index 18c6abdc..9038057c 100644 --- a/docs/models/components/channelsettingsproviderid.md +++ b/docs/models/components/channelsettingsproviderid.md @@ -7,7 +7,7 @@ The provider identifier for the credentials ```typescript import { ChannelSettingsProviderId } from "@novu/api/models/components"; -let value: ChannelSettingsProviderId = "pushpad"; +let value: ChannelSettingsProviderId = "pusher-beams"; ``` ## Values diff --git a/docs/models/components/channeltypeenum.md b/docs/models/components/channeltypeenum.md index b5dc0c7f..e60b29fb 100644 --- a/docs/models/components/channeltypeenum.md +++ b/docs/models/components/channeltypeenum.md @@ -5,7 +5,7 @@ ```typescript import { ChannelTypeEnum } from "@novu/api/models/components"; -let value: ChannelTypeEnum = "email"; +let value: ChannelTypeEnum = "sms"; ``` ## Values diff --git a/docs/models/components/content.md b/docs/models/components/content.md index 1f27e6d7..3fbe6ed8 100644 --- a/docs/models/components/content.md +++ b/docs/models/components/content.md @@ -7,7 +7,7 @@ ```typescript const value: components.EmailBlock = { - type: "text", + type: "button", content: "", }; ``` diff --git a/docs/models/components/createintegrationrequestdto.md b/docs/models/components/createintegrationrequestdto.md index 3f827040..3c288205 100644 --- a/docs/models/components/createintegrationrequestdto.md +++ b/docs/models/components/createintegrationrequestdto.md @@ -7,7 +7,7 @@ import { CreateIntegrationRequestDto } from "@novu/api/models/components"; let value: CreateIntegrationRequestDto = { providerId: "", - channel: "in_app", + channel: "chat", }; ``` diff --git a/docs/models/components/createintegrationrequestdtochannel.md b/docs/models/components/createintegrationrequestdtochannel.md index 6feb4600..8b97a23d 100644 --- a/docs/models/components/createintegrationrequestdtochannel.md +++ b/docs/models/components/createintegrationrequestdtochannel.md @@ -7,7 +7,7 @@ The channel type for the integration ```typescript import { CreateIntegrationRequestDtoChannel } from "@novu/api/models/components"; -let value: CreateIntegrationRequestDtoChannel = "sms"; +let value: CreateIntegrationRequestDtoChannel = "email"; ``` ## Values diff --git a/docs/models/components/createsubscriberrequestdtodata.md b/docs/models/components/createsubscriberrequestdtodata.md index 8f934c53..ff969dec 100644 --- a/docs/models/components/createsubscriberrequestdtodata.md +++ b/docs/models/components/createsubscriberrequestdtodata.md @@ -26,6 +26,6 @@ const value: boolean = false; ### `number` ```typescript -const value: number = 2230.82; +const value: number = 2974.37; ``` diff --git a/docs/models/components/data.md b/docs/models/components/data.md index 3ad249c8..2e7cddbd 100644 --- a/docs/models/components/data.md +++ b/docs/models/components/data.md @@ -26,6 +26,6 @@ const value: boolean = false; ### `number` ```typescript -const value: number = 1965.82; +const value: number = 8379.45; ``` diff --git a/docs/models/components/delayregularmetadataunit.md b/docs/models/components/delayregularmetadataunit.md index 430bf601..8e7bc010 100644 --- a/docs/models/components/delayregularmetadataunit.md +++ b/docs/models/components/delayregularmetadataunit.md @@ -5,7 +5,7 @@ ```typescript import { DelayRegularMetadataUnit } from "@novu/api/models/components"; -let value: DelayRegularMetadataUnit = "months"; +let value: DelayRegularMetadataUnit = "minutes"; ``` ## Values diff --git a/docs/models/components/digesttimedmetadataunit.md b/docs/models/components/digesttimedmetadataunit.md index 5964b2ee..0930da26 100644 --- a/docs/models/components/digesttimedmetadataunit.md +++ b/docs/models/components/digesttimedmetadataunit.md @@ -5,7 +5,7 @@ ```typescript import { DigestTimedMetadataUnit } from "@novu/api/models/components"; -let value: DigestTimedMetadataUnit = "weeks"; +let value: DigestTimedMetadataUnit = "days"; ``` ## Values diff --git a/docs/models/components/emailblockstyles.md b/docs/models/components/emailblockstyles.md index 265e7a28..307b56d5 100644 --- a/docs/models/components/emailblockstyles.md +++ b/docs/models/components/emailblockstyles.md @@ -6,7 +6,7 @@ import { EmailBlockStyles } from "@novu/api/models/components"; let value: EmailBlockStyles = { - textAlign: "left", + textAlign: "right", }; ``` diff --git a/docs/models/components/executiondetailsresponsedto.md b/docs/models/components/executiondetailsresponsedto.md index ba477cc7..b1d6f2d2 100644 --- a/docs/models/components/executiondetailsresponsedto.md +++ b/docs/models/components/executiondetailsresponsedto.md @@ -13,10 +13,10 @@ let value: ExecutionDetailsResponseDto = { notificationTemplateId: "", subscriberId: "", transactionId: "", - channel: "digest", + channel: "sms", detail: "", - source: "Payload", - status: "Success", + source: "Credentials", + status: "Warning", isTest: false, isRetry: false, }; diff --git a/docs/models/components/feedresponsedto.md b/docs/models/components/feedresponsedto.md index 0c4ccdf3..bd996584 100644 --- a/docs/models/components/feedresponsedto.md +++ b/docs/models/components/feedresponsedto.md @@ -8,19 +8,42 @@ import { FeedResponseDto } from "@novu/api/models/components"; let value: FeedResponseDto = { hasMore: false, data: [ - "", + { + id: "", + templateId: "", + environmentId: "", + messageTemplateId: "", + organizationId: "", + notificationId: "", + subscriberId: "", + feedId: "", + jobId: "", + transactionId: "", + content: "", + channel: "push", + read: false, + seen: false, + deleted: false, + cta: { + data: {}, + }, + status: "error", + payload: { + "key": "", + }, + }, ], - pageSize: 5812.73, - page: 8817.35, + pageSize: 4238.55, + page: 6063.93, }; ``` ## Fields -| Field | Type | Required | Description | -| ------------------ | ------------------ | ------------------ | ------------------ | -| `totalCount` | *number* | :heavy_minus_sign: | N/A | -| `hasMore` | *boolean* | :heavy_check_mark: | N/A | -| `data` | *string*[] | :heavy_check_mark: | N/A | -| `pageSize` | *number* | :heavy_check_mark: | N/A | -| `page` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | +| `totalCount` | *number* | :heavy_minus_sign: | Total number of notifications available. | +| `hasMore` | *boolean* | :heavy_check_mark: | Indicates if there are more notifications to load. | +| `data` | [components.NotificationDto](../../models/components/notificationdto.md)[] | :heavy_check_mark: | Array of notifications returned in the response. | +| `pageSize` | *number* | :heavy_check_mark: | The number of notifications returned in this response. | +| `page` | *number* | :heavy_check_mark: | The current page number of the notifications. | \ No newline at end of file diff --git a/docs/models/components/fieldfilterpart.md b/docs/models/components/fieldfilterpart.md index cd49a2c1..f78f2e72 100644 --- a/docs/models/components/fieldfilterpart.md +++ b/docs/models/components/fieldfilterpart.md @@ -8,8 +8,8 @@ import { FieldFilterPart } from "@novu/api/models/components"; let value: FieldFilterPart = { field: "", value: "", - operator: "EQUAL", - on: "subscriber", + operator: "LARGER", + on: "payload", }; ``` diff --git a/docs/models/components/filtertopicsresponsedto.md b/docs/models/components/filtertopicsresponsedto.md index c63cce36..8ca117b6 100644 --- a/docs/models/components/filtertopicsresponsedto.md +++ b/docs/models/components/filtertopicsresponsedto.md @@ -17,9 +17,9 @@ let value: FilterTopicsResponseDto = { ], }, ], - page: 2543.56, - pageSize: 580.29, - totalCount: 4344.17, + page: 2274.15, + pageSize: 2543.56, + totalCount: 580.29, }; ``` diff --git a/docs/models/components/integrationresponsedtochannel.md b/docs/models/components/integrationresponsedtochannel.md index 800076f9..01c4caa5 100644 --- a/docs/models/components/integrationresponsedtochannel.md +++ b/docs/models/components/integrationresponsedtochannel.md @@ -7,7 +7,7 @@ The channel type for the integration, which defines how the integration communic ```typescript import { IntegrationResponseDtoChannel } from "@novu/api/models/components"; -let value: IntegrationResponseDtoChannel = "sms"; +let value: IntegrationResponseDtoChannel = "push"; ``` ## Values diff --git a/docs/models/components/markallmessageasrequestdtomarkas.md b/docs/models/components/markallmessageasrequestdtomarkas.md index 815bb15d..e6c8a0f7 100644 --- a/docs/models/components/markallmessageasrequestdtomarkas.md +++ b/docs/models/components/markallmessageasrequestdtomarkas.md @@ -7,7 +7,7 @@ Mark all subscriber messages as read, unread, seen or unseen ```typescript import { MarkAllMessageAsRequestDtoMarkAs } from "@novu/api/models/components"; -let value: MarkAllMessageAsRequestDtoMarkAs = "unread"; +let value: MarkAllMessageAsRequestDtoMarkAs = "unseen"; ``` ## Values diff --git a/docs/models/components/markmessageactionasseendto.md b/docs/models/components/markmessageactionasseendto.md index 4baea6bc..9bb6816f 100644 --- a/docs/models/components/markmessageactionasseendto.md +++ b/docs/models/components/markmessageactionasseendto.md @@ -6,13 +6,13 @@ import { MarkMessageActionAsSeenDto } from "@novu/api/models/components"; let value: MarkMessageActionAsSeenDto = { - status: "pending", + status: "done", }; ``` ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | -| `status` | [components.MarkMessageActionAsSeenDtoStatus](../../models/components/markmessageactionasseendtostatus.md) | :heavy_check_mark: | Message action status | -| `payload` | [components.Payload](../../models/components/payload.md) | :heavy_minus_sign: | Message action payload | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | +| `status` | [components.MarkMessageActionAsSeenDtoStatus](../../models/components/markmessageactionasseendtostatus.md) | :heavy_check_mark: | Message action status | +| `payload` | [components.MarkMessageActionAsSeenDtoPayload](../../models/components/markmessageactionasseendtopayload.md) | :heavy_minus_sign: | Message action payload | \ No newline at end of file diff --git a/docs/models/components/markmessageactionasseendtopayload.md b/docs/models/components/markmessageactionasseendtopayload.md new file mode 100644 index 00000000..f176f4e9 --- /dev/null +++ b/docs/models/components/markmessageactionasseendtopayload.md @@ -0,0 +1,16 @@ +# MarkMessageActionAsSeenDtoPayload + +Message action payload + +## Example Usage + +```typescript +import { MarkMessageActionAsSeenDtoPayload } from "@novu/api/models/components"; + +let value: MarkMessageActionAsSeenDtoPayload = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/messageactionresult.md b/docs/models/components/messageactionresult.md index bf928d87..69f97b64 100644 --- a/docs/models/components/messageactionresult.md +++ b/docs/models/components/messageactionresult.md @@ -10,7 +10,7 @@ let value: MessageActionResult = {}; ## Fields -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| `payload` | [components.MessageActionResultPayload](../../models/components/messageactionresultpayload.md) | :heavy_minus_sign: | N/A | -| `type` | [components.MessageActionResultType](../../models/components/messageactionresulttype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `payload` | [components.Payload](../../models/components/payload.md) | :heavy_minus_sign: | N/A | +| `type` | [components.MessageActionResultType](../../models/components/messageactionresulttype.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/messageactionstatus.md b/docs/models/components/messageactionstatus.md index c039a55b..8429b4bd 100644 --- a/docs/models/components/messageactionstatus.md +++ b/docs/models/components/messageactionstatus.md @@ -5,7 +5,7 @@ ```typescript import { MessageActionStatus } from "@novu/api/models/components"; -let value: MessageActionStatus = "pending"; +let value: MessageActionStatus = "done"; ``` ## Values diff --git a/docs/models/components/messagebutton.md b/docs/models/components/messagebutton.md index e4f02a56..f51b4781 100644 --- a/docs/models/components/messagebutton.md +++ b/docs/models/components/messagebutton.md @@ -6,7 +6,7 @@ import { MessageButton } from "@novu/api/models/components"; let value: MessageButton = { - type: "secondary", + type: "primary", content: "", }; ``` diff --git a/docs/models/components/messagemarkasrequestdto.md b/docs/models/components/messagemarkasrequestdto.md index b1acfe49..b1d1c037 100644 --- a/docs/models/components/messagemarkasrequestdto.md +++ b/docs/models/components/messagemarkasrequestdto.md @@ -9,7 +9,7 @@ let value: MessageMarkAsRequestDto = { messageId: [ "", ], - markAs: "unseen", + markAs: "seen", }; ``` diff --git a/docs/models/components/messageresponsedto.md b/docs/models/components/messageresponsedto.md index f9a4bb4e..3f136af8 100644 --- a/docs/models/components/messageresponsedto.md +++ b/docs/models/components/messageresponsedto.md @@ -15,13 +15,13 @@ let value: MessageResponseDto = { createdAt: "", content: "", transactionId: "", - channel: "email", + channel: "in_app", read: false, seen: false, cta: { data: {}, }, - status: "error", + status: "warning", errorId: "", errorText: "", payload: {}, diff --git a/docs/models/components/messageresponsedtochannel.md b/docs/models/components/messageresponsedtochannel.md index 4d80ce7c..75481356 100644 --- a/docs/models/components/messageresponsedtochannel.md +++ b/docs/models/components/messageresponsedtochannel.md @@ -5,7 +5,7 @@ ```typescript import { MessageResponseDtoChannel } from "@novu/api/models/components"; -let value: MessageResponseDtoChannel = "in_app"; +let value: MessageResponseDtoChannel = "push"; ``` ## Values diff --git a/docs/models/components/messageresponsedtostatus.md b/docs/models/components/messageresponsedtostatus.md index 4fab3eae..d2a8d2eb 100644 --- a/docs/models/components/messageresponsedtostatus.md +++ b/docs/models/components/messageresponsedtostatus.md @@ -5,7 +5,7 @@ ```typescript import { MessageResponseDtoStatus } from "@novu/api/models/components"; -let value: MessageResponseDtoStatus = "sent"; +let value: MessageResponseDtoStatus = "warning"; ``` ## Values diff --git a/docs/models/components/notificationdto.md b/docs/models/components/notificationdto.md new file mode 100644 index 00000000..190ccec5 --- /dev/null +++ b/docs/models/components/notificationdto.md @@ -0,0 +1,64 @@ +# NotificationDto + +## Example Usage + +```typescript +import { NotificationDto } from "@novu/api/models/components"; + +let value: NotificationDto = { + id: "", + templateId: "", + environmentId: "", + messageTemplateId: "", + organizationId: "", + notificationId: "", + subscriberId: "", + feedId: "", + jobId: "", + transactionId: "", + content: "", + channel: "chat", + read: false, + seen: false, + deleted: false, + cta: { + data: {}, + }, + status: "sent", + payload: { + "key": "", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Unique identifier for the notification. | +| `templateId` | *string* | :heavy_check_mark: | Identifier for the template used to generate the notification. | +| `environmentId` | *string* | :heavy_check_mark: | Identifier for the environment where the notification is sent. | +| `messageTemplateId` | *string* | :heavy_check_mark: | Identifier for the message template used. | +| `organizationId` | *string* | :heavy_check_mark: | Identifier for the organization sending the notification. | +| `notificationId` | *string* | :heavy_check_mark: | Unique identifier for the notification instance. | +| `subscriberId` | *string* | :heavy_check_mark: | Unique identifier for the subscriber receiving the notification. | +| `feedId` | *string* | :heavy_check_mark: | Identifier for the feed associated with the notification. | +| `jobId` | *string* | :heavy_check_mark: | Identifier for the job that triggered the notification. | +| `createdAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | Timestamp indicating when the notification was created. | +| `updatedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | Timestamp indicating when the notification was last updated. | +| `actor` | [components.Actor](../../models/components/actor.md) | :heavy_minus_sign: | Actor details related to the notification, if applicable. | +| `subscriber` | [components.SubscriberResponseDto](../../models/components/subscriberresponsedto.md) | :heavy_minus_sign: | Subscriber details associated with this notification. | +| `transactionId` | *string* | :heavy_check_mark: | Unique identifier for the transaction associated with the notification. | +| `templateIdentifier` | *string* | :heavy_minus_sign: | Identifier for the template used, if applicable. | +| `providerId` | *string* | :heavy_minus_sign: | Identifier for the provider that sends the notification. | +| `content` | *string* | :heavy_check_mark: | The main content of the notification. | +| `subject` | *string* | :heavy_minus_sign: | The subject line for email notifications, if applicable. | +| `channel` | [components.NotificationDtoChannel](../../models/components/notificationdtochannel.md) | :heavy_check_mark: | The channel through which the notification is sent. | +| `read` | *boolean* | :heavy_check_mark: | Indicates whether the notification has been read by the subscriber. | +| `seen` | *boolean* | :heavy_check_mark: | Indicates whether the notification has been seen by the subscriber. | +| `deleted` | *boolean* | :heavy_check_mark: | Indicates whether the notification has been deleted. | +| `deviceTokens` | *string*[] | :heavy_minus_sign: | Device tokens for push notifications, if applicable. | +| `cta` | [components.MessageCTA](../../models/components/messagecta.md) | :heavy_check_mark: | Call-to-action information associated with the notification. | +| `status` | [components.NotificationDtoStatus](../../models/components/notificationdtostatus.md) | :heavy_check_mark: | Current status of the notification. | +| `payload` | Record | :heavy_check_mark: | The payload that was used to send the notification trigger. | +| `overrides` | Record | :heavy_minus_sign: | Provider-specific overrides used when triggering the notification. | \ No newline at end of file diff --git a/docs/models/components/notificationdtochannel.md b/docs/models/components/notificationdtochannel.md new file mode 100644 index 00000000..dff39dc9 --- /dev/null +++ b/docs/models/components/notificationdtochannel.md @@ -0,0 +1,17 @@ +# NotificationDtoChannel + +The channel through which the notification is sent. + +## Example Usage + +```typescript +import { NotificationDtoChannel } from "@novu/api/models/components"; + +let value: NotificationDtoChannel = "in_app"; +``` + +## Values + +```typescript +"in_app" | "email" | "sms" | "chat" | "push" +``` \ No newline at end of file diff --git a/docs/models/components/notificationdtostatus.md b/docs/models/components/notificationdtostatus.md new file mode 100644 index 00000000..0d271216 --- /dev/null +++ b/docs/models/components/notificationdtostatus.md @@ -0,0 +1,17 @@ +# NotificationDtoStatus + +Current status of the notification. + +## Example Usage + +```typescript +import { NotificationDtoStatus } from "@novu/api/models/components"; + +let value: NotificationDtoStatus = "sent"; +``` + +## Values + +```typescript +"sent" | "error" | "warning" +``` \ No newline at end of file diff --git a/docs/models/components/notificationstepvariantmetadata.md b/docs/models/components/notificationstepvariantmetadata.md index 01f05e81..bcea460c 100644 --- a/docs/models/components/notificationstepvariantmetadata.md +++ b/docs/models/components/notificationstepvariantmetadata.md @@ -7,7 +7,7 @@ ```typescript const value: components.DigestRegularMetadata = { - type: "regular", + type: "backoff", }; ``` diff --git a/docs/models/components/operator.md b/docs/models/components/operator.md index 03cb6eec..c4d6a72e 100644 --- a/docs/models/components/operator.md +++ b/docs/models/components/operator.md @@ -5,7 +5,7 @@ ```typescript import { Operator } from "@novu/api/models/components"; -let value: Operator = "SMALLER"; +let value: Operator = "LARGER"; ``` ## Values diff --git a/docs/models/components/ordinal.md b/docs/models/components/ordinal.md index ebaddb3c..d30ab30d 100644 --- a/docs/models/components/ordinal.md +++ b/docs/models/components/ordinal.md @@ -5,7 +5,7 @@ ```typescript import { Ordinal } from "@novu/api/models/components"; -let value: Ordinal = "3"; +let value: Ordinal = "2"; ``` ## Values diff --git a/docs/models/components/ordinalvalue.md b/docs/models/components/ordinalvalue.md index 5eff2560..d5d9e788 100644 --- a/docs/models/components/ordinalvalue.md +++ b/docs/models/components/ordinalvalue.md @@ -5,7 +5,7 @@ ```typescript import { OrdinalValue } from "@novu/api/models/components"; -let value: OrdinalValue = "weekend"; +let value: OrdinalValue = "sunday"; ``` ## Values diff --git a/docs/models/components/payload.md b/docs/models/components/payload.md index 02241ce7..11e6f52c 100644 --- a/docs/models/components/payload.md +++ b/docs/models/components/payload.md @@ -1,7 +1,5 @@ # Payload -Message action payload - ## Example Usage ```typescript diff --git a/docs/models/components/providerid.md b/docs/models/components/providerid.md index 2a5b77d5..aa8991a1 100644 --- a/docs/models/components/providerid.md +++ b/docs/models/components/providerid.md @@ -7,7 +7,7 @@ The ID of the chat or push provider. ```typescript import { ProviderId } from "@novu/api/models/components"; -let value: ProviderId = "grafana-on-call"; +let value: ProviderId = "discord"; ``` ## Values diff --git a/docs/models/components/status.md b/docs/models/components/status.md index 37cc848a..b771c2d0 100644 --- a/docs/models/components/status.md +++ b/docs/models/components/status.md @@ -5,7 +5,7 @@ ```typescript import { Status } from "@novu/api/models/components"; -let value: Status = "ReadConfirmation"; +let value: Status = "Success"; ``` ## Values diff --git a/docs/models/components/stepfilter.md b/docs/models/components/stepfilter.md index e8752125..8d13b8d4 100644 --- a/docs/models/components/stepfilter.md +++ b/docs/models/components/stepfilter.md @@ -7,13 +7,13 @@ import { StepFilter } from "@novu/api/models/components"; let value: StepFilter = { isNegated: false, - type: "STATEMENT", - value: "OR", + type: "LIST", + value: "AND", children: [ { field: "", value: "", - operator: "EQUAL", + operator: "LARGER_EQUAL", on: "payload", }, ], diff --git a/docs/models/components/subscriberchanneldto.md b/docs/models/components/subscriberchanneldto.md index 8338e018..0a063de2 100644 --- a/docs/models/components/subscriberchanneldto.md +++ b/docs/models/components/subscriberchanneldto.md @@ -6,7 +6,7 @@ import { SubscriberChannelDto } from "@novu/api/models/components"; let value: SubscriberChannelDto = { - providerId: "one-signal", + providerId: "pusher-beams", credentials: {}, }; ``` diff --git a/docs/models/components/textalign.md b/docs/models/components/textalign.md index 9cb7d4b0..aa50769d 100644 --- a/docs/models/components/textalign.md +++ b/docs/models/components/textalign.md @@ -5,7 +5,7 @@ ```typescript import { TextAlign } from "@novu/api/models/components"; -let value: TextAlign = "left"; +let value: TextAlign = "center"; ``` ## Values diff --git a/docs/models/components/to.md b/docs/models/components/to.md index e9935acb..44b65ee4 100644 --- a/docs/models/components/to.md +++ b/docs/models/components/to.md @@ -16,7 +16,7 @@ const value: components.SubscriberPayloadDto = { ```typescript const value: components.TopicPayloadDto = { topicKey: "", - type: "Subscriber", + type: "Topic", }; ``` diff --git a/docs/models/components/triggereventrequestdto.md b/docs/models/components/triggereventrequestdto.md index 39de6495..0c3834d0 100644 --- a/docs/models/components/triggereventrequestdto.md +++ b/docs/models/components/triggereventrequestdto.md @@ -23,8 +23,7 @@ let value: TriggerEventRequestDto = { }, to: [ { - topicKey: "", - type: "Subscriber", + subscriberId: "", }, ], }; @@ -40,6 +39,6 @@ let value: TriggerEventRequestDto = { | `overrides` | Record> | :heavy_minus_sign: | This could be used to override provider specific configurations | {
"fcm": {
"data": {
"key": "value"
}
}
} | | `to` | *components.To*[] | :heavy_check_mark: | The recipients list of people who will receive the notification. | | | `transactionId` | *string* | :heavy_minus_sign: | A unique identifier for this transaction, we will generate a UUID if not provided. | | -| `actor` | *components.Actor* | :heavy_minus_sign: | It is used to display the Avatar of the provided actor's subscriber id or actor object.

If a new actor object is provided, we will create a new subscriber in our system | | +| `actor` | *components.TriggerEventRequestDtoActor* | :heavy_minus_sign: | It is used to display the Avatar of the provided actor's subscriber id or actor object.

If a new actor object is provided, we will create a new subscriber in our system | | | `tenant` | *components.Tenant* | :heavy_minus_sign: | It is used to specify a tenant context during trigger event.
Existing tenants will be updated with the provided details. | | | `controls` | [components.WorkflowToStepControlValuesDto](../../models/components/workflowtostepcontrolvaluesdto.md) | :heavy_minus_sign: | Additional control configurations. | | \ No newline at end of file diff --git a/docs/models/components/triggereventrequestdtoactor.md b/docs/models/components/triggereventrequestdtoactor.md new file mode 100644 index 00000000..9489f66b --- /dev/null +++ b/docs/models/components/triggereventrequestdtoactor.md @@ -0,0 +1,23 @@ +# TriggerEventRequestDtoActor + +It is used to display the Avatar of the provided actor's subscriber id or actor object. + + If a new actor object is provided, we will create a new subscriber in our system + + +## Supported Types + +### `string` + +```typescript +const value: string = ""; +``` + +### `components.SubscriberPayloadDto` + +```typescript +const value: components.SubscriberPayloadDto = { + subscriberId: "", +}; +``` + diff --git a/docs/models/components/triggereventresponsedto.md b/docs/models/components/triggereventresponsedto.md index 1400626d..85b0e873 100644 --- a/docs/models/components/triggereventresponsedto.md +++ b/docs/models/components/triggereventresponsedto.md @@ -7,7 +7,7 @@ import { TriggerEventResponseDto } from "@novu/api/models/components"; let value: TriggerEventResponseDto = { acknowledged: false, - status: "trigger_not_active", + status: "no_workflow_active_steps_defined", }; ``` diff --git a/docs/models/components/type.md b/docs/models/components/type.md index 2b2cb707..9fcbd63c 100644 --- a/docs/models/components/type.md +++ b/docs/models/components/type.md @@ -5,7 +5,7 @@ ```typescript import { Type } from "@novu/api/models/components"; -let value: Type = "STATEMENT"; +let value: Type = "LIST"; ``` ## Values diff --git a/docs/models/components/unit.md b/docs/models/components/unit.md index e05e1568..fc4a98bd 100644 --- a/docs/models/components/unit.md +++ b/docs/models/components/unit.md @@ -5,7 +5,7 @@ ```typescript import { Unit } from "@novu/api/models/components"; -let value: Unit = "months"; +let value: Unit = "minutes"; ``` ## Values diff --git a/docs/models/components/unseencountresponse.md b/docs/models/components/unseencountresponse.md index 40e45cb3..4d8eeffc 100644 --- a/docs/models/components/unseencountresponse.md +++ b/docs/models/components/unseencountresponse.md @@ -6,7 +6,7 @@ import { UnseenCountResponse } from "@novu/api/models/components"; let value: UnseenCountResponse = { - count: 6925.32, + count: 5743.25, }; ``` diff --git a/docs/models/components/updatesubscriberchannelrequestdto.md b/docs/models/components/updatesubscriberchannelrequestdto.md index 05460d2a..9c2c1bed 100644 --- a/docs/models/components/updatesubscriberchannelrequestdto.md +++ b/docs/models/components/updatesubscriberchannelrequestdto.md @@ -6,9 +6,9 @@ import { UpdateSubscriberChannelRequestDto } from "@novu/api/models/components"; let value: UpdateSubscriberChannelRequestDto = { - providerId: "getstream", + providerId: "grafana-on-call", credentials: { - webhookUrl: "https://runny-epic.net", + webhookUrl: "https://other-swine.net", }, }; ``` diff --git a/docs/models/components/updatesubscriberchannelrequestdtoproviderid.md b/docs/models/components/updatesubscriberchannelrequestdtoproviderid.md index fbbaecca..fdbac3b4 100644 --- a/docs/models/components/updatesubscriberchannelrequestdtoproviderid.md +++ b/docs/models/components/updatesubscriberchannelrequestdtoproviderid.md @@ -7,7 +7,7 @@ The provider identifier for the credentials ```typescript import { UpdateSubscriberChannelRequestDtoProviderId } from "@novu/api/models/components"; -let value: UpdateSubscriberChannelRequestDtoProviderId = "pusher-beams"; +let value: UpdateSubscriberChannelRequestDtoProviderId = "one-signal"; ``` ## Values diff --git a/docs/models/components/weekdays.md b/docs/models/components/weekdays.md index faebcd38..e410752e 100644 --- a/docs/models/components/weekdays.md +++ b/docs/models/components/weekdays.md @@ -5,7 +5,7 @@ ```typescript import { WeekDays } from "@novu/api/models/components"; -let value: WeekDays = "wednesday"; +let value: WeekDays = "saturday"; ``` ## Values diff --git a/docs/models/components/workflowresponse.md b/docs/models/components/workflowresponse.md index a3a1bfaf..efe7027c 100644 --- a/docs/models/components/workflowresponse.md +++ b/docs/models/components/workflowresponse.md @@ -7,7 +7,7 @@ import { WorkflowResponse } from "@novu/api/models/components"; let value: WorkflowResponse = { name: "", - description: "calculating queasily ha intensely settle pluck", + description: "as advanced afterwards coliseum", active: false, draft: false, preferenceSettings: {}, diff --git a/docs/models/operations/messagescontrollergetmessagesresponse.md b/docs/models/operations/messagescontrollergetmessagesresponse.md index 314663bb..dfa76314 100644 --- a/docs/models/operations/messagescontrollergetmessagesresponse.md +++ b/docs/models/operations/messagescontrollergetmessagesresponse.md @@ -20,8 +20,8 @@ let value: MessagesControllerGetMessagesResponse = { transactionId: "", }, ], - pageSize: 1020.45, - page: 2088.77, + pageSize: 4663.11, + page: 2444.26, }, }; ``` diff --git a/docs/models/operations/subscriberscontrollergetnotificationsfeedresponse.md b/docs/models/operations/subscriberscontrollergetnotificationsfeedresponse.md index ac92f2fd..dea05008 100644 --- a/docs/models/operations/subscriberscontrollergetnotificationsfeedresponse.md +++ b/docs/models/operations/subscriberscontrollergetnotificationsfeedresponse.md @@ -12,17 +12,40 @@ let value: SubscribersControllerGetNotificationsFeedResponse = { ], }, result: { - page: 6818.20, + page: 4370.32, hasMore: false, - pageSize: 3595.08, + pageSize: 6976.31, data: [ { hasMore: false, data: [ - "", + { + id: "", + templateId: "", + environmentId: "", + messageTemplateId: "", + organizationId: "", + notificationId: "", + subscriberId: "", + feedId: "", + jobId: "", + transactionId: "", + content: "", + channel: "in_app", + read: false, + seen: false, + deleted: false, + cta: { + data: {}, + }, + status: "warning", + payload: { + "key": "", + }, + }, ], - pageSize: 4370.32, - page: 6976.31, + pageSize: 6706.38, + page: 2103.83, }, ], }, diff --git a/docs/models/operations/subscriberscontrollergetnotificationsfeedresponsebody.md b/docs/models/operations/subscriberscontrollergetnotificationsfeedresponsebody.md index aba59dad..18920e70 100644 --- a/docs/models/operations/subscriberscontrollergetnotificationsfeedresponsebody.md +++ b/docs/models/operations/subscriberscontrollergetnotificationsfeedresponsebody.md @@ -13,10 +13,33 @@ let value: SubscribersControllerGetNotificationsFeedResponseBody = { { hasMore: false, data: [ - "", + { + id: "", + templateId: "", + environmentId: "", + messageTemplateId: "", + organizationId: "", + notificationId: "", + subscriberId: "", + feedId: "", + jobId: "", + transactionId: "", + content: "", + channel: "chat", + read: false, + seen: false, + deleted: false, + cta: { + data: {}, + }, + status: "warning", + payload: { + "key": "", + }, + }, ], - pageSize: 6169.34, - page: 9437.48, + pageSize: 6818.20, + page: 3595.08, }, ], }; diff --git a/docs/models/operations/subscriberscontrollergetunseencountrequest.md b/docs/models/operations/subscriberscontrollergetunseencountrequest.md index 55404bb7..fa251fa1 100644 --- a/docs/models/operations/subscriberscontrollergetunseencountrequest.md +++ b/docs/models/operations/subscriberscontrollergetunseencountrequest.md @@ -8,7 +8,7 @@ import { SubscribersControllerGetUnseenCountRequest } from "@novu/api/models/ope let value: SubscribersControllerGetUnseenCountRequest = { seen: false, subscriberId: "", - limit: 602.25, + limit: 1289.26, }; ``` diff --git a/docs/models/operations/subscriberscontrollergetunseencountresponse.md b/docs/models/operations/subscriberscontrollergetunseencountresponse.md index d3bb2236..bb6439a7 100644 --- a/docs/models/operations/subscriberscontrollergetunseencountresponse.md +++ b/docs/models/operations/subscriberscontrollergetunseencountresponse.md @@ -12,7 +12,7 @@ let value: SubscribersControllerGetUnseenCountResponse = { ], }, result: { - count: 6667.67, + count: 3154.28, }, }; ``` diff --git a/docs/models/operations/subscriberscontrollermarkactionasseenresponse.md b/docs/models/operations/subscriberscontrollermarkactionasseenresponse.md index 50168579..63057333 100644 --- a/docs/models/operations/subscriberscontrollermarkactionasseenresponse.md +++ b/docs/models/operations/subscriberscontrollermarkactionasseenresponse.md @@ -19,15 +19,18 @@ let value: SubscribersControllerMarkActionAsSeenResponse = { notificationId: "", subscriberId: "", createdAt: "", - content: "", + content: { + type: "button", + content: "", + }, transactionId: "", - channel: "sms", + channel: "chat", read: false, seen: false, cta: { data: {}, }, - status: "warning", + status: "sent", errorId: "", errorText: "", payload: {}, diff --git a/docs/models/operations/subscriberscontrollermarkallunreadasreadrequest.md b/docs/models/operations/subscriberscontrollermarkallunreadasreadrequest.md index 29e13e45..201ffad6 100644 --- a/docs/models/operations/subscriberscontrollermarkallunreadasreadrequest.md +++ b/docs/models/operations/subscriberscontrollermarkallunreadasreadrequest.md @@ -8,7 +8,7 @@ import { SubscribersControllerMarkAllUnreadAsReadRequest } from "@novu/api/model let value: SubscribersControllerMarkAllUnreadAsReadRequest = { subscriberId: "", markAllMessageAsRequestDto: { - markAs: "read", + markAs: "seen", }, }; ``` diff --git a/docs/models/operations/subscriberscontrollermarkallunreadasreadresponse.md b/docs/models/operations/subscriberscontrollermarkallunreadasreadresponse.md index 0936b142..2fd691a3 100644 --- a/docs/models/operations/subscriberscontrollermarkallunreadasreadresponse.md +++ b/docs/models/operations/subscriberscontrollermarkallunreadasreadresponse.md @@ -11,7 +11,7 @@ let value: SubscribersControllerMarkAllUnreadAsReadResponse = { "", ], }, - result: 3154.28, + result: 9883.74, }; ``` diff --git a/docs/models/operations/subscriberscontrollermarkmessagesasrequest.md b/docs/models/operations/subscriberscontrollermarkmessagesasrequest.md index aa477470..9a825dab 100644 --- a/docs/models/operations/subscriberscontrollermarkmessagesasrequest.md +++ b/docs/models/operations/subscriberscontrollermarkmessagesasrequest.md @@ -8,10 +8,8 @@ import { SubscribersControllerMarkMessagesAsRequest } from "@novu/api/models/ope let value: SubscribersControllerMarkMessagesAsRequest = { subscriberId: "", messageMarkAsRequestDto: { - messageId: [ - "", - ], - markAs: "read", + messageId: "", + markAs: "unread", }, }; ``` diff --git a/docs/models/operations/topicscontrollerlisttopicsresponse.md b/docs/models/operations/topicscontrollerlisttopicsresponse.md index 13301bbe..266ea841 100644 --- a/docs/models/operations/topicscontrollerlisttopicsresponse.md +++ b/docs/models/operations/topicscontrollerlisttopicsresponse.md @@ -23,9 +23,9 @@ let value: TopicsControllerListTopicsResponse = { ], }, ], - page: 6531.08, - pageSize: 2532.92, - totalCount: 4663.11, + page: 1103.75, + pageSize: 6563.30, + totalCount: 1381.83, }, }; ``` diff --git a/docs/sdks/novunotifications/README.md b/docs/sdks/novunotifications/README.md index 63357980..df057ad2 100644 --- a/docs/sdks/novunotifications/README.md +++ b/docs/sdks/novunotifications/README.md @@ -5,10 +5,10 @@ ### Available Operations -* [retrieve](#retrieve) - Get in-app notification feed for a particular subscriber +* [feed](#feed) - Get in-app notification feed for a particular subscriber * [unseenCount](#unseencount) - Get the unseen in-app notifications count for subscribers feed -## retrieve +## feed Get in-app notification feed for a particular subscriber @@ -22,7 +22,7 @@ const novu = new Novu({ }); async function run() { - const result = await novu.subscribers.notifications.retrieve({ + const result = await novu.subscribers.notifications.feed({ subscriberId: "", payload: "btoa(JSON.stringify({ foo: 123 })) results in base64 encoded string like eyJmb28iOjEyM30=", }); @@ -40,7 +40,7 @@ The standalone function version of this method: ```typescript import { NovuCore } from "@novu/api/core.js"; -import { subscribersNotificationsRetrieve } from "@novu/api/funcs/subscribersNotificationsRetrieve.js"; +import { subscribersNotificationsFeed } from "@novu/api/funcs/subscribersNotificationsFeed.js"; // Use `NovuCore` for best tree-shaking performance. // You can create one instance of it to use across an application. @@ -49,7 +49,7 @@ const novu = new NovuCore({ }); async function run() { - const res = await subscribersNotificationsRetrieve(novu, { + const res = await subscribersNotificationsFeed(novu, { subscriberId: "", payload: "btoa(JSON.stringify({ foo: 123 })) results in base64 encoded string like eyJmb28iOjEyM30=", }); diff --git a/jsr.json b/jsr.json index 506def06..8258235a 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@novu/api", - "version": "0.0.1-alpha.70", + "version": "0.0.1-alpha.74", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index 5b75f7dd..37e07df7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@novu/api", - "version": "0.0.1-alpha.70", + "version": "0.0.1-alpha.74", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@novu/api", - "version": "0.0.1-alpha.70", + "version": "0.0.1-alpha.74", "devDependencies": { "@typescript-eslint/eslint-plugin": "^7.7.1", "@typescript-eslint/parser": "^7.7.1", diff --git a/package.json b/package.json index da1d1e32..83e74945 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@novu/api", - "version": "0.0.1-alpha.70", + "version": "0.0.1-alpha.74", "author": "Novu", "main": "./index.js", "sideEffects": false, diff --git a/sources/code-samples.yaml b/sources/code-samples.yaml index e52a3fc8..0d04322b 100644 --- a/sources/code-samples.yaml +++ b/sources/code-samples.yaml @@ -254,7 +254,7 @@ actions: "x-codeSamples": - "lang": "typescript" "label": "SubscribersController_getNotificationsFeed" - "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.subscribers.notifications.retrieve({\n subscriberId: \"\",\n payload: \"btoa(JSON.stringify({ foo: 123 })) results in base64 encoded string like eyJmb28iOjEyM30=\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" + "source": "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n const result = await novu.subscribers.notifications.feed({\n subscriberId: \"\",\n payload: \"btoa(JSON.stringify({ foo: 123 })) results in base64 encoded string like eyJmb28iOjEyM30=\",\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();" - target: $["paths"]["/v1/subscribers/{subscriberId}/notifications/unseen"]["get"] update: "x-codeSamples": diff --git a/sources/json-development.json b/sources/json-development.json index ee627ede..4612632a 100644 --- a/sources/json-development.json +++ b/sources/json-development.json @@ -6899,6 +6899,7 @@ "/v1/subscribers/{subscriberId}/notifications/feed": { "get": { "operationId": "SubscribersController_getNotificationsFeed", + "x-speakeasy-name-override": "feed", "x-speakeasy-group": "Subscribers.Notifications", "summary": "Get in-app notification feed for a particular subscriber", "parameters": [ @@ -12155,113 +12156,6 @@ } } }, - "FeedResponseDto": { - "type": "object", - "properties": { - "totalCount": { - "type": "number" - }, - "hasMore": { - "type": "boolean" - }, - "data": { - "type": "array", - "items": { - "type": "string" - } - }, - "pageSize": { - "type": "number" - }, - "page": { - "type": "number" - } - }, - "required": [ - "hasMore", - "data", - "pageSize", - "page" - ] - }, - "UnseenCountResponse": { - "type": "object", - "properties": { - "count": { - "type": "number" - } - }, - "required": [ - "count" - ] - }, - "MessageMarkAsRequestDto": { - "type": "object", - "properties": { - "messageId": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ] - }, - "markAs": { - "enum": [ - "read", - "seen", - "unread", - "unseen" - ], - "type": "string" - } - }, - "required": [ - "messageId", - "markAs" - ] - }, - "MessageEntity": { - "type": "object", - "properties": {} - }, - "MarkAllMessageAsRequestDto": { - "type": "object", - "properties": { - "feedIdentifier": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "array", - "items": { - "type": "string" - } - } - ], - "description": "Optional feed identifier or array of feed identifiers" - }, - "markAs": { - "enum": [ - "read", - "seen", - "unread", - "unseen" - ], - "type": "string", - "description": "Mark all subscriber messages as read, unread, seen or unseen" - } - }, - "required": [ - "markAs" - ] - }, "EmailBlockStyles": { "type": "object", "properties": { @@ -12389,6 +12283,316 @@ "data" ] }, + "ActorTypeEnum": { + "type": "string", + "description": "The type of the actor, indicating the role in the notification process.", + "enum": [ + "none", + "user", + "system_icon", + "system_custom" + ] + }, + "Actor": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "The data associated with the actor, can be null if not applicable.", + "nullable": true + }, + "type": { + "$ref": "#/components/schemas/ActorTypeEnum" + } + }, + "required": [ + "data", + "type" + ] + }, + "NotificationDto": { + "type": "object", + "properties": { + "_id": { + "type": "string", + "description": "Unique identifier for the notification." + }, + "_templateId": { + "type": "string", + "description": "Identifier for the template used to generate the notification." + }, + "_environmentId": { + "type": "string", + "description": "Identifier for the environment where the notification is sent." + }, + "_messageTemplateId": { + "type": "string", + "description": "Identifier for the message template used." + }, + "_organizationId": { + "type": "string", + "description": "Identifier for the organization sending the notification." + }, + "_notificationId": { + "type": "string", + "description": "Unique identifier for the notification instance." + }, + "_subscriberId": { + "type": "string", + "description": "Unique identifier for the subscriber receiving the notification." + }, + "_feedId": { + "type": "string", + "description": "Identifier for the feed associated with the notification." + }, + "_jobId": { + "type": "string", + "description": "Identifier for the job that triggered the notification." + }, + "createdAt": { + "type": "string", + "description": "Timestamp indicating when the notification was created.", + "format": "date-time", + "nullable": true + }, + "updatedAt": { + "type": "string", + "description": "Timestamp indicating when the notification was last updated.", + "format": "date-time", + "nullable": true + }, + "actor": { + "description": "Actor details related to the notification, if applicable.", + "allOf": [ + { + "$ref": "#/components/schemas/Actor" + } + ] + }, + "subscriber": { + "description": "Subscriber details associated with this notification.", + "allOf": [ + { + "$ref": "#/components/schemas/SubscriberResponseDto" + } + ] + }, + "transactionId": { + "type": "string", + "description": "Unique identifier for the transaction associated with the notification." + }, + "templateIdentifier": { + "type": "string", + "description": "Identifier for the template used, if applicable.", + "nullable": true + }, + "providerId": { + "type": "string", + "description": "Identifier for the provider that sends the notification.", + "nullable": true + }, + "content": { + "type": "string", + "description": "The main content of the notification." + }, + "subject": { + "type": "string", + "description": "The subject line for email notifications, if applicable.", + "nullable": true + }, + "channel": { + "enum": [ + "in_app", + "email", + "sms", + "chat", + "push" + ], + "type": "string", + "description": "The channel through which the notification is sent." + }, + "read": { + "type": "boolean", + "description": "Indicates whether the notification has been read by the subscriber." + }, + "seen": { + "type": "boolean", + "description": "Indicates whether the notification has been seen by the subscriber." + }, + "deleted": { + "type": "boolean", + "description": "Indicates whether the notification has been deleted." + }, + "deviceTokens": { + "description": "Device tokens for push notifications, if applicable.", + "nullable": true, + "type": "array", + "items": { + "type": "string" + } + }, + "cta": { + "description": "Call-to-action information associated with the notification.", + "allOf": [ + { + "$ref": "#/components/schemas/MessageCTA" + } + ] + }, + "status": { + "type": "string", + "description": "Current status of the notification.", + "enum": [ + "sent", + "error", + "warning" + ] + }, + "payload": { + "type": "object", + "description": "The payload that was used to send the notification trigger.", + "additionalProperties": true + }, + "overrides": { + "type": "object", + "description": "Provider-specific overrides used when triggering the notification.", + "additionalProperties": true + } + }, + "required": [ + "_id", + "_templateId", + "_environmentId", + "_messageTemplateId", + "_organizationId", + "_notificationId", + "_subscriberId", + "_feedId", + "_jobId", + "transactionId", + "content", + "channel", + "read", + "seen", + "deleted", + "cta", + "status", + "payload" + ] + }, + "FeedResponseDto": { + "type": "object", + "properties": { + "totalCount": { + "type": "number", + "description": "Total number of notifications available.", + "nullable": true + }, + "hasMore": { + "type": "boolean", + "description": "Indicates if there are more notifications to load." + }, + "data": { + "description": "Array of notifications returned in the response.", + "type": "array", + "items": { + "$ref": "#/components/schemas/NotificationDto" + } + }, + "pageSize": { + "type": "number", + "description": "The number of notifications returned in this response." + }, + "page": { + "type": "number", + "description": "The current page number of the notifications." + } + }, + "required": [ + "hasMore", + "data", + "pageSize", + "page" + ] + }, + "UnseenCountResponse": { + "type": "object", + "properties": { + "count": { + "type": "number" + } + }, + "required": [ + "count" + ] + }, + "MessageMarkAsRequestDto": { + "type": "object", + "properties": { + "messageId": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ] + }, + "markAs": { + "enum": [ + "read", + "seen", + "unread", + "unseen" + ], + "type": "string" + } + }, + "required": [ + "messageId", + "markAs" + ] + }, + "MessageEntity": { + "type": "object", + "properties": {} + }, + "MarkAllMessageAsRequestDto": { + "type": "object", + "properties": { + "feedIdentifier": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array", + "items": { + "type": "string" + } + } + ], + "description": "Optional feed identifier or array of feed identifiers" + }, + "markAs": { + "enum": [ + "read", + "seen", + "unread", + "unseen" + ], + "type": "string", + "description": "Mark all subscriber messages as read, unread, seen or unseen" + } + }, + "required": [ + "markAs" + ] + }, "NotificationGroup": { "type": "object", "properties": { diff --git a/src/funcs/subscribersNotificationsRetrieve.ts b/src/funcs/subscribersNotificationsFeed.ts similarity index 98% rename from src/funcs/subscribersNotificationsRetrieve.ts rename to src/funcs/subscribersNotificationsFeed.ts index 8c3615ff..ad055cf2 100644 --- a/src/funcs/subscribersNotificationsRetrieve.ts +++ b/src/funcs/subscribersNotificationsFeed.ts @@ -24,7 +24,7 @@ import { Result } from "../types/fp.js"; /** * Get in-app notification feed for a particular subscriber */ -export async function subscribersNotificationsRetrieve( +export async function subscribersNotificationsFeed( client: NovuCore, request: operations.SubscribersControllerGetNotificationsFeedRequest, options?: RequestOptions, diff --git a/src/lib/config.ts b/src/lib/config.ts index 4c4b1ba0..aeca8bc8 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -55,7 +55,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "1.0", - sdkVersion: "0.0.1-alpha.70", + sdkVersion: "0.0.1-alpha.74", genVersion: "2.474.6", - userAgent: "speakeasy-sdk/typescript 0.0.1-alpha.70 2.474.6 1.0 @novu/api", + userAgent: "speakeasy-sdk/typescript 0.0.1-alpha.74 2.474.6 1.0 @novu/api", } as const; diff --git a/src/models/components/actor.ts b/src/models/components/actor.ts new file mode 100644 index 00000000..f7d2de04 --- /dev/null +++ b/src/models/components/actor.ts @@ -0,0 +1,123 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + ActorTypeEnum, + ActorTypeEnum$inboundSchema, + ActorTypeEnum$outboundSchema, +} from "./actortypeenum.js"; + +/** + * The data associated with the actor, can be null if not applicable. + */ +export type ActorData = {}; + +export type Actor = { + /** + * The data associated with the actor, can be null if not applicable. + */ + data: ActorData | null; + /** + * The type of the actor, indicating the role in the notification process. + */ + type: ActorTypeEnum; +}; + +/** @internal */ +export const ActorData$inboundSchema: z.ZodType< + ActorData, + z.ZodTypeDef, + unknown +> = z.object({}); + +/** @internal */ +export type ActorData$Outbound = {}; + +/** @internal */ +export const ActorData$outboundSchema: z.ZodType< + ActorData$Outbound, + z.ZodTypeDef, + ActorData +> = z.object({}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ActorData$ { + /** @deprecated use `ActorData$inboundSchema` instead. */ + export const inboundSchema = ActorData$inboundSchema; + /** @deprecated use `ActorData$outboundSchema` instead. */ + export const outboundSchema = ActorData$outboundSchema; + /** @deprecated use `ActorData$Outbound` instead. */ + export type Outbound = ActorData$Outbound; +} + +export function actorDataToJSON(actorData: ActorData): string { + return JSON.stringify(ActorData$outboundSchema.parse(actorData)); +} + +export function actorDataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ActorData$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ActorData' from JSON`, + ); +} + +/** @internal */ +export const Actor$inboundSchema: z.ZodType = z + .object({ + data: z.nullable(z.lazy(() => ActorData$inboundSchema)), + type: ActorTypeEnum$inboundSchema, + }); + +/** @internal */ +export type Actor$Outbound = { + data: ActorData$Outbound | null; + type: string; +}; + +/** @internal */ +export const Actor$outboundSchema: z.ZodType< + Actor$Outbound, + z.ZodTypeDef, + Actor +> = z.object({ + data: z.nullable(z.lazy(() => ActorData$outboundSchema)), + type: ActorTypeEnum$outboundSchema, +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace Actor$ { + /** @deprecated use `Actor$inboundSchema` instead. */ + export const inboundSchema = Actor$inboundSchema; + /** @deprecated use `Actor$outboundSchema` instead. */ + export const outboundSchema = Actor$outboundSchema; + /** @deprecated use `Actor$Outbound` instead. */ + export type Outbound = Actor$Outbound; +} + +export function actorToJSON(actor: Actor): string { + return JSON.stringify(Actor$outboundSchema.parse(actor)); +} + +export function actorFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Actor$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Actor' from JSON`, + ); +} diff --git a/src/models/components/actortypeenum.ts b/src/models/components/actortypeenum.ts new file mode 100644 index 00000000..991c815a --- /dev/null +++ b/src/models/components/actortypeenum.ts @@ -0,0 +1,41 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { ClosedEnum } from "../../types/enums.js"; + +/** + * The type of the actor, indicating the role in the notification process. + */ +export const ActorTypeEnum = { + None: "none", + User: "user", + SystemIcon: "system_icon", + SystemCustom: "system_custom", +} as const; +/** + * The type of the actor, indicating the role in the notification process. + */ +export type ActorTypeEnum = ClosedEnum; + +/** @internal */ +export const ActorTypeEnum$inboundSchema: z.ZodNativeEnum< + typeof ActorTypeEnum +> = z.nativeEnum(ActorTypeEnum); + +/** @internal */ +export const ActorTypeEnum$outboundSchema: z.ZodNativeEnum< + typeof ActorTypeEnum +> = ActorTypeEnum$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ActorTypeEnum$ { + /** @deprecated use `ActorTypeEnum$inboundSchema` instead. */ + export const inboundSchema = ActorTypeEnum$inboundSchema; + /** @deprecated use `ActorTypeEnum$outboundSchema` instead. */ + export const outboundSchema = ActorTypeEnum$outboundSchema; +} diff --git a/src/models/components/feedresponsedto.ts b/src/models/components/feedresponsedto.ts index dd231d97..fa71d04c 100644 --- a/src/models/components/feedresponsedto.ts +++ b/src/models/components/feedresponsedto.ts @@ -6,12 +6,33 @@ import * as z from "zod"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + NotificationDto, + NotificationDto$inboundSchema, + NotificationDto$Outbound, + NotificationDto$outboundSchema, +} from "./notificationdto.js"; export type FeedResponseDto = { - totalCount?: number | undefined; + /** + * Total number of notifications available. + */ + totalCount?: number | null | undefined; + /** + * Indicates if there are more notifications to load. + */ hasMore: boolean; - data: Array; + /** + * Array of notifications returned in the response. + */ + data: Array; + /** + * The number of notifications returned in this response. + */ pageSize: number; + /** + * The current page number of the notifications. + */ page: number; }; @@ -21,18 +42,18 @@ export const FeedResponseDto$inboundSchema: z.ZodType< z.ZodTypeDef, unknown > = z.object({ - totalCount: z.number().optional(), + totalCount: z.nullable(z.number()).optional(), hasMore: z.boolean(), - data: z.array(z.string()), + data: z.array(NotificationDto$inboundSchema), pageSize: z.number(), page: z.number(), }); /** @internal */ export type FeedResponseDto$Outbound = { - totalCount?: number | undefined; + totalCount?: number | null | undefined; hasMore: boolean; - data: Array; + data: Array; pageSize: number; page: number; }; @@ -43,9 +64,9 @@ export const FeedResponseDto$outboundSchema: z.ZodType< z.ZodTypeDef, FeedResponseDto > = z.object({ - totalCount: z.number().optional(), + totalCount: z.nullable(z.number()).optional(), hasMore: z.boolean(), - data: z.array(z.string()), + data: z.array(NotificationDto$outboundSchema), pageSize: z.number(), page: z.number(), }); diff --git a/src/models/components/index.ts b/src/models/components/index.ts index b987d17e..35519b0e 100644 --- a/src/models/components/index.ts +++ b/src/models/components/index.ts @@ -8,6 +8,8 @@ export * from "./activitynotificationresponsedto.js"; export * from "./activitynotificationsubscriberresponsedto.js"; export * from "./activitynotificationtemplateresponsedto.js"; export * from "./activitystatsresponsedto.js"; +export * from "./actor.js"; +export * from "./actortypeenum.js"; export * from "./addsubscribersrequestdto.js"; export * from "./apikey.js"; export * from "./assignsubscribertotopicdto.js"; @@ -54,6 +56,7 @@ export * from "./messageentity.js"; export * from "./messagemarkasrequestdto.js"; export * from "./messageresponsedto.js"; export * from "./messagetemplate.js"; +export * from "./notificationdto.js"; export * from "./notificationgroup.js"; export * from "./notificationgroupresponsedto.js"; export * from "./notificationstep.js"; diff --git a/src/models/components/markmessageactionasseendto.ts b/src/models/components/markmessageactionasseendto.ts index 4c9867ce..4476a8f5 100644 --- a/src/models/components/markmessageactionasseendto.ts +++ b/src/models/components/markmessageactionasseendto.ts @@ -25,7 +25,7 @@ export type MarkMessageActionAsSeenDtoStatus = ClosedEnum< /** * Message action payload */ -export type Payload = {}; +export type MarkMessageActionAsSeenDtoPayload = {}; export type MarkMessageActionAsSeenDto = { /** @@ -35,7 +35,7 @@ export type MarkMessageActionAsSeenDto = { /** * Message action payload */ - payload?: Payload | undefined; + payload?: MarkMessageActionAsSeenDtoPayload | undefined; }; /** @internal */ @@ -60,43 +60,53 @@ export namespace MarkMessageActionAsSeenDtoStatus$ { } /** @internal */ -export const Payload$inboundSchema: z.ZodType = - z.object({}); +export const MarkMessageActionAsSeenDtoPayload$inboundSchema: z.ZodType< + MarkMessageActionAsSeenDtoPayload, + z.ZodTypeDef, + unknown +> = z.object({}); /** @internal */ -export type Payload$Outbound = {}; +export type MarkMessageActionAsSeenDtoPayload$Outbound = {}; /** @internal */ -export const Payload$outboundSchema: z.ZodType< - Payload$Outbound, +export const MarkMessageActionAsSeenDtoPayload$outboundSchema: z.ZodType< + MarkMessageActionAsSeenDtoPayload$Outbound, z.ZodTypeDef, - Payload + MarkMessageActionAsSeenDtoPayload > = z.object({}); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace Payload$ { - /** @deprecated use `Payload$inboundSchema` instead. */ - export const inboundSchema = Payload$inboundSchema; - /** @deprecated use `Payload$outboundSchema` instead. */ - export const outboundSchema = Payload$outboundSchema; - /** @deprecated use `Payload$Outbound` instead. */ - export type Outbound = Payload$Outbound; +export namespace MarkMessageActionAsSeenDtoPayload$ { + /** @deprecated use `MarkMessageActionAsSeenDtoPayload$inboundSchema` instead. */ + export const inboundSchema = MarkMessageActionAsSeenDtoPayload$inboundSchema; + /** @deprecated use `MarkMessageActionAsSeenDtoPayload$outboundSchema` instead. */ + export const outboundSchema = + MarkMessageActionAsSeenDtoPayload$outboundSchema; + /** @deprecated use `MarkMessageActionAsSeenDtoPayload$Outbound` instead. */ + export type Outbound = MarkMessageActionAsSeenDtoPayload$Outbound; } -export function payloadToJSON(payload: Payload): string { - return JSON.stringify(Payload$outboundSchema.parse(payload)); +export function markMessageActionAsSeenDtoPayloadToJSON( + markMessageActionAsSeenDtoPayload: MarkMessageActionAsSeenDtoPayload, +): string { + return JSON.stringify( + MarkMessageActionAsSeenDtoPayload$outboundSchema.parse( + markMessageActionAsSeenDtoPayload, + ), + ); } -export function payloadFromJSON( +export function markMessageActionAsSeenDtoPayloadFromJSON( jsonString: string, -): SafeParseResult { +): SafeParseResult { return safeParse( jsonString, - (x) => Payload$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Payload' from JSON`, + (x) => MarkMessageActionAsSeenDtoPayload$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'MarkMessageActionAsSeenDtoPayload' from JSON`, ); } @@ -107,13 +117,14 @@ export const MarkMessageActionAsSeenDto$inboundSchema: z.ZodType< unknown > = z.object({ status: MarkMessageActionAsSeenDtoStatus$inboundSchema, - payload: z.lazy(() => Payload$inboundSchema).optional(), + payload: z.lazy(() => MarkMessageActionAsSeenDtoPayload$inboundSchema) + .optional(), }); /** @internal */ export type MarkMessageActionAsSeenDto$Outbound = { status: string; - payload?: Payload$Outbound | undefined; + payload?: MarkMessageActionAsSeenDtoPayload$Outbound | undefined; }; /** @internal */ @@ -123,7 +134,8 @@ export const MarkMessageActionAsSeenDto$outboundSchema: z.ZodType< MarkMessageActionAsSeenDto > = z.object({ status: MarkMessageActionAsSeenDtoStatus$outboundSchema, - payload: z.lazy(() => Payload$outboundSchema).optional(), + payload: z.lazy(() => MarkMessageActionAsSeenDtoPayload$outboundSchema) + .optional(), }); /** diff --git a/src/models/components/messageactionresult.ts b/src/models/components/messageactionresult.ts index 7a147d51..c361af7e 100644 --- a/src/models/components/messageactionresult.ts +++ b/src/models/components/messageactionresult.ts @@ -8,7 +8,7 @@ import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -export type MessageActionResultPayload = {}; +export type Payload = {}; export const MessageActionResultType = { Primary: "primary", @@ -19,55 +19,48 @@ export type MessageActionResultType = ClosedEnum< >; export type MessageActionResult = { - payload?: MessageActionResultPayload | undefined; + payload?: Payload | undefined; type?: MessageActionResultType | undefined; }; /** @internal */ -export const MessageActionResultPayload$inboundSchema: z.ZodType< - MessageActionResultPayload, - z.ZodTypeDef, - unknown -> = z.object({}); +export const Payload$inboundSchema: z.ZodType = + z.object({}); /** @internal */ -export type MessageActionResultPayload$Outbound = {}; +export type Payload$Outbound = {}; /** @internal */ -export const MessageActionResultPayload$outboundSchema: z.ZodType< - MessageActionResultPayload$Outbound, +export const Payload$outboundSchema: z.ZodType< + Payload$Outbound, z.ZodTypeDef, - MessageActionResultPayload + Payload > = z.object({}); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace MessageActionResultPayload$ { - /** @deprecated use `MessageActionResultPayload$inboundSchema` instead. */ - export const inboundSchema = MessageActionResultPayload$inboundSchema; - /** @deprecated use `MessageActionResultPayload$outboundSchema` instead. */ - export const outboundSchema = MessageActionResultPayload$outboundSchema; - /** @deprecated use `MessageActionResultPayload$Outbound` instead. */ - export type Outbound = MessageActionResultPayload$Outbound; +export namespace Payload$ { + /** @deprecated use `Payload$inboundSchema` instead. */ + export const inboundSchema = Payload$inboundSchema; + /** @deprecated use `Payload$outboundSchema` instead. */ + export const outboundSchema = Payload$outboundSchema; + /** @deprecated use `Payload$Outbound` instead. */ + export type Outbound = Payload$Outbound; } -export function messageActionResultPayloadToJSON( - messageActionResultPayload: MessageActionResultPayload, -): string { - return JSON.stringify( - MessageActionResultPayload$outboundSchema.parse(messageActionResultPayload), - ); +export function payloadToJSON(payload: Payload): string { + return JSON.stringify(Payload$outboundSchema.parse(payload)); } -export function messageActionResultPayloadFromJSON( +export function payloadFromJSON( jsonString: string, -): SafeParseResult { +): SafeParseResult { return safeParse( jsonString, - (x) => MessageActionResultPayload$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'MessageActionResultPayload' from JSON`, + (x) => Payload$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Payload' from JSON`, ); } @@ -98,13 +91,13 @@ export const MessageActionResult$inboundSchema: z.ZodType< z.ZodTypeDef, unknown > = z.object({ - payload: z.lazy(() => MessageActionResultPayload$inboundSchema).optional(), + payload: z.lazy(() => Payload$inboundSchema).optional(), type: MessageActionResultType$inboundSchema.optional(), }); /** @internal */ export type MessageActionResult$Outbound = { - payload?: MessageActionResultPayload$Outbound | undefined; + payload?: Payload$Outbound | undefined; type?: string | undefined; }; @@ -114,7 +107,7 @@ export const MessageActionResult$outboundSchema: z.ZodType< z.ZodTypeDef, MessageActionResult > = z.object({ - payload: z.lazy(() => MessageActionResultPayload$outboundSchema).optional(), + payload: z.lazy(() => Payload$outboundSchema).optional(), type: MessageActionResultType$outboundSchema.optional(), }); diff --git a/src/models/components/notificationdto.ts b/src/models/components/notificationdto.ts new file mode 100644 index 00000000..aaaa3f67 --- /dev/null +++ b/src/models/components/notificationdto.ts @@ -0,0 +1,367 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { ClosedEnum } from "../../types/enums.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + Actor, + Actor$inboundSchema, + Actor$Outbound, + Actor$outboundSchema, +} from "./actor.js"; +import { + MessageCTA, + MessageCTA$inboundSchema, + MessageCTA$Outbound, + MessageCTA$outboundSchema, +} from "./messagecta.js"; +import { + SubscriberResponseDto, + SubscriberResponseDto$inboundSchema, + SubscriberResponseDto$Outbound, + SubscriberResponseDto$outboundSchema, +} from "./subscriberresponsedto.js"; + +/** + * The channel through which the notification is sent. + */ +export const NotificationDtoChannel = { + InApp: "in_app", + Email: "email", + Sms: "sms", + Chat: "chat", + Push: "push", +} as const; +/** + * The channel through which the notification is sent. + */ +export type NotificationDtoChannel = ClosedEnum; + +/** + * Current status of the notification. + */ +export const NotificationDtoStatus = { + Sent: "sent", + Error: "error", + Warning: "warning", +} as const; +/** + * Current status of the notification. + */ +export type NotificationDtoStatus = ClosedEnum; + +export type NotificationDto = { + /** + * Unique identifier for the notification. + */ + id: string; + /** + * Identifier for the template used to generate the notification. + */ + templateId: string; + /** + * Identifier for the environment where the notification is sent. + */ + environmentId: string; + /** + * Identifier for the message template used. + */ + messageTemplateId: string; + /** + * Identifier for the organization sending the notification. + */ + organizationId: string; + /** + * Unique identifier for the notification instance. + */ + notificationId: string; + /** + * Unique identifier for the subscriber receiving the notification. + */ + subscriberId: string; + /** + * Identifier for the feed associated with the notification. + */ + feedId: string; + /** + * Identifier for the job that triggered the notification. + */ + jobId: string; + /** + * Timestamp indicating when the notification was created. + */ + createdAt?: Date | null | undefined; + /** + * Timestamp indicating when the notification was last updated. + */ + updatedAt?: Date | null | undefined; + /** + * Actor details related to the notification, if applicable. + */ + actor?: Actor | undefined; + /** + * Subscriber details associated with this notification. + */ + subscriber?: SubscriberResponseDto | undefined; + /** + * Unique identifier for the transaction associated with the notification. + */ + transactionId: string; + /** + * Identifier for the template used, if applicable. + */ + templateIdentifier?: string | null | undefined; + /** + * Identifier for the provider that sends the notification. + */ + providerId?: string | null | undefined; + /** + * The main content of the notification. + */ + content: string; + /** + * The subject line for email notifications, if applicable. + */ + subject?: string | null | undefined; + /** + * The channel through which the notification is sent. + */ + channel: NotificationDtoChannel; + /** + * Indicates whether the notification has been read by the subscriber. + */ + read: boolean; + /** + * Indicates whether the notification has been seen by the subscriber. + */ + seen: boolean; + /** + * Indicates whether the notification has been deleted. + */ + deleted: boolean; + /** + * Device tokens for push notifications, if applicable. + */ + deviceTokens?: Array | null | undefined; + /** + * Call-to-action information associated with the notification. + */ + cta: MessageCTA; + /** + * Current status of the notification. + */ + status: NotificationDtoStatus; + /** + * The payload that was used to send the notification trigger. + */ + payload: { [k: string]: any }; + /** + * Provider-specific overrides used when triggering the notification. + */ + overrides?: { [k: string]: any } | undefined; +}; + +/** @internal */ +export const NotificationDtoChannel$inboundSchema: z.ZodNativeEnum< + typeof NotificationDtoChannel +> = z.nativeEnum(NotificationDtoChannel); + +/** @internal */ +export const NotificationDtoChannel$outboundSchema: z.ZodNativeEnum< + typeof NotificationDtoChannel +> = NotificationDtoChannel$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace NotificationDtoChannel$ { + /** @deprecated use `NotificationDtoChannel$inboundSchema` instead. */ + export const inboundSchema = NotificationDtoChannel$inboundSchema; + /** @deprecated use `NotificationDtoChannel$outboundSchema` instead. */ + export const outboundSchema = NotificationDtoChannel$outboundSchema; +} + +/** @internal */ +export const NotificationDtoStatus$inboundSchema: z.ZodNativeEnum< + typeof NotificationDtoStatus +> = z.nativeEnum(NotificationDtoStatus); + +/** @internal */ +export const NotificationDtoStatus$outboundSchema: z.ZodNativeEnum< + typeof NotificationDtoStatus +> = NotificationDtoStatus$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace NotificationDtoStatus$ { + /** @deprecated use `NotificationDtoStatus$inboundSchema` instead. */ + export const inboundSchema = NotificationDtoStatus$inboundSchema; + /** @deprecated use `NotificationDtoStatus$outboundSchema` instead. */ + export const outboundSchema = NotificationDtoStatus$outboundSchema; +} + +/** @internal */ +export const NotificationDto$inboundSchema: z.ZodType< + NotificationDto, + z.ZodTypeDef, + unknown +> = z.object({ + _id: z.string(), + _templateId: z.string(), + _environmentId: z.string(), + _messageTemplateId: z.string(), + _organizationId: z.string(), + _notificationId: z.string(), + _subscriberId: z.string(), + _feedId: z.string(), + _jobId: z.string(), + createdAt: z.nullable( + z.string().datetime({ offset: true }).transform(v => new Date(v)), + ).optional(), + updatedAt: z.nullable( + z.string().datetime({ offset: true }).transform(v => new Date(v)), + ).optional(), + actor: Actor$inboundSchema.optional(), + subscriber: SubscriberResponseDto$inboundSchema.optional(), + transactionId: z.string(), + templateIdentifier: z.nullable(z.string()).optional(), + providerId: z.nullable(z.string()).optional(), + content: z.string(), + subject: z.nullable(z.string()).optional(), + channel: NotificationDtoChannel$inboundSchema, + read: z.boolean(), + seen: z.boolean(), + deleted: z.boolean(), + deviceTokens: z.nullable(z.array(z.string())).optional(), + cta: MessageCTA$inboundSchema, + status: NotificationDtoStatus$inboundSchema, + payload: z.record(z.any()), + overrides: z.record(z.any()).optional(), +}).transform((v) => { + return remap$(v, { + "_id": "id", + "_templateId": "templateId", + "_environmentId": "environmentId", + "_messageTemplateId": "messageTemplateId", + "_organizationId": "organizationId", + "_notificationId": "notificationId", + "_subscriberId": "subscriberId", + "_feedId": "feedId", + "_jobId": "jobId", + }); +}); + +/** @internal */ +export type NotificationDto$Outbound = { + _id: string; + _templateId: string; + _environmentId: string; + _messageTemplateId: string; + _organizationId: string; + _notificationId: string; + _subscriberId: string; + _feedId: string; + _jobId: string; + createdAt?: string | null | undefined; + updatedAt?: string | null | undefined; + actor?: Actor$Outbound | undefined; + subscriber?: SubscriberResponseDto$Outbound | undefined; + transactionId: string; + templateIdentifier?: string | null | undefined; + providerId?: string | null | undefined; + content: string; + subject?: string | null | undefined; + channel: string; + read: boolean; + seen: boolean; + deleted: boolean; + deviceTokens?: Array | null | undefined; + cta: MessageCTA$Outbound; + status: string; + payload: { [k: string]: any }; + overrides?: { [k: string]: any } | undefined; +}; + +/** @internal */ +export const NotificationDto$outboundSchema: z.ZodType< + NotificationDto$Outbound, + z.ZodTypeDef, + NotificationDto +> = z.object({ + id: z.string(), + templateId: z.string(), + environmentId: z.string(), + messageTemplateId: z.string(), + organizationId: z.string(), + notificationId: z.string(), + subscriberId: z.string(), + feedId: z.string(), + jobId: z.string(), + createdAt: z.nullable(z.date().transform(v => v.toISOString())).optional(), + updatedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(), + actor: Actor$outboundSchema.optional(), + subscriber: SubscriberResponseDto$outboundSchema.optional(), + transactionId: z.string(), + templateIdentifier: z.nullable(z.string()).optional(), + providerId: z.nullable(z.string()).optional(), + content: z.string(), + subject: z.nullable(z.string()).optional(), + channel: NotificationDtoChannel$outboundSchema, + read: z.boolean(), + seen: z.boolean(), + deleted: z.boolean(), + deviceTokens: z.nullable(z.array(z.string())).optional(), + cta: MessageCTA$outboundSchema, + status: NotificationDtoStatus$outboundSchema, + payload: z.record(z.any()), + overrides: z.record(z.any()).optional(), +}).transform((v) => { + return remap$(v, { + id: "_id", + templateId: "_templateId", + environmentId: "_environmentId", + messageTemplateId: "_messageTemplateId", + organizationId: "_organizationId", + notificationId: "_notificationId", + subscriberId: "_subscriberId", + feedId: "_feedId", + jobId: "_jobId", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace NotificationDto$ { + /** @deprecated use `NotificationDto$inboundSchema` instead. */ + export const inboundSchema = NotificationDto$inboundSchema; + /** @deprecated use `NotificationDto$outboundSchema` instead. */ + export const outboundSchema = NotificationDto$outboundSchema; + /** @deprecated use `NotificationDto$Outbound` instead. */ + export type Outbound = NotificationDto$Outbound; +} + +export function notificationDtoToJSON( + notificationDto: NotificationDto, +): string { + return JSON.stringify(NotificationDto$outboundSchema.parse(notificationDto)); +} + +export function notificationDtoFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => NotificationDto$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'NotificationDto' from JSON`, + ); +} diff --git a/src/models/components/triggereventrequestdto.ts b/src/models/components/triggereventrequestdto.ts index ee147195..984bbc3a 100644 --- a/src/models/components/triggereventrequestdto.ts +++ b/src/models/components/triggereventrequestdto.ts @@ -40,7 +40,7 @@ export type To = TopicPayloadDto | SubscriberPayloadDto | string; * * If a new actor object is provided, we will create a new subscriber in our system */ -export type Actor = SubscriberPayloadDto | string; +export type TriggerEventRequestDtoActor = SubscriberPayloadDto | string; /** * It is used to specify a tenant context during trigger event. @@ -149,43 +149,54 @@ export function toFromJSON( } /** @internal */ -export const Actor$inboundSchema: z.ZodType = z - .union([SubscriberPayloadDto$inboundSchema, z.string()]); +export const TriggerEventRequestDtoActor$inboundSchema: z.ZodType< + TriggerEventRequestDtoActor, + z.ZodTypeDef, + unknown +> = z.union([SubscriberPayloadDto$inboundSchema, z.string()]); /** @internal */ -export type Actor$Outbound = SubscriberPayloadDto$Outbound | string; +export type TriggerEventRequestDtoActor$Outbound = + | SubscriberPayloadDto$Outbound + | string; /** @internal */ -export const Actor$outboundSchema: z.ZodType< - Actor$Outbound, +export const TriggerEventRequestDtoActor$outboundSchema: z.ZodType< + TriggerEventRequestDtoActor$Outbound, z.ZodTypeDef, - Actor + TriggerEventRequestDtoActor > = z.union([SubscriberPayloadDto$outboundSchema, z.string()]); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ -export namespace Actor$ { - /** @deprecated use `Actor$inboundSchema` instead. */ - export const inboundSchema = Actor$inboundSchema; - /** @deprecated use `Actor$outboundSchema` instead. */ - export const outboundSchema = Actor$outboundSchema; - /** @deprecated use `Actor$Outbound` instead. */ - export type Outbound = Actor$Outbound; +export namespace TriggerEventRequestDtoActor$ { + /** @deprecated use `TriggerEventRequestDtoActor$inboundSchema` instead. */ + export const inboundSchema = TriggerEventRequestDtoActor$inboundSchema; + /** @deprecated use `TriggerEventRequestDtoActor$outboundSchema` instead. */ + export const outboundSchema = TriggerEventRequestDtoActor$outboundSchema; + /** @deprecated use `TriggerEventRequestDtoActor$Outbound` instead. */ + export type Outbound = TriggerEventRequestDtoActor$Outbound; } -export function actorToJSON(actor: Actor): string { - return JSON.stringify(Actor$outboundSchema.parse(actor)); +export function triggerEventRequestDtoActorToJSON( + triggerEventRequestDtoActor: TriggerEventRequestDtoActor, +): string { + return JSON.stringify( + TriggerEventRequestDtoActor$outboundSchema.parse( + triggerEventRequestDtoActor, + ), + ); } -export function actorFromJSON( +export function triggerEventRequestDtoActorFromJSON( jsonString: string, -): SafeParseResult { +): SafeParseResult { return safeParse( jsonString, - (x) => Actor$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Actor' from JSON`, + (x) => TriggerEventRequestDtoActor$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'TriggerEventRequestDtoActor' from JSON`, ); } diff --git a/src/sdk/novunotifications.ts b/src/sdk/novunotifications.ts index 32e3be09..5daf58bc 100644 --- a/src/sdk/novunotifications.ts +++ b/src/sdk/novunotifications.ts @@ -2,7 +2,7 @@ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ -import { subscribersNotificationsRetrieve } from "../funcs/subscribersNotificationsRetrieve.js"; +import { subscribersNotificationsFeed } from "../funcs/subscribersNotificationsFeed.js"; import { subscribersNotificationsUnseenCount } from "../funcs/subscribersNotificationsUnseenCount.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as operations from "../models/operations/index.js"; @@ -12,11 +12,11 @@ export class NovuNotifications extends ClientSDK { /** * Get in-app notification feed for a particular subscriber */ - async retrieve( + async feed( request: operations.SubscribersControllerGetNotificationsFeedRequest, options?: RequestOptions, ): Promise { - return unwrapAsync(subscribersNotificationsRetrieve( + return unwrapAsync(subscribersNotificationsFeed( this, request, options,