diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 5510a424..cdc8caeb 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,24 +1,24 @@ lockVersion: 2.0.0 id: 6bff3a53-3f0b-40b4-942f-ff70dc583ae5 management: - docChecksum: 953e7804a0485fa5e5b0422a73c055a3 + docChecksum: 3f7f8bee8fb96a1d61fcae878f0589d8 docVersion: "1.0" - speakeasyVersion: 1.453.4 - generationVersion: 2.474.6 - releaseVersion: 0.0.1-alpha.77 - configChecksum: ab03311e8d757787eefe4cc94a1b5a54 + speakeasyVersion: 1.453.8 + generationVersion: 2.474.15 + releaseVersion: 0.0.1-alpha.78 + configChecksum: f7ed5a2a60c86e97ffcf9913b1c262d8 published: true features: typescript: additionalDependencies: 0.1.0 constsAndDefaults: 0.1.11 - core: 3.18.8 + core: 3.18.9 defaultEnabledRetries: 0.1.0 deprecations: 2.81.1 enumUnions: 0.1.0 envVarSecurityUsage: 0.1.2 examples: 2.81.4 - flattening: 2.82.0 + flattening: 2.82.1 globalSecurity: 2.82.11 globalSecurityCallbacks: 0.1.0 globalSecurityFlattening: 0.1.0 @@ -47,7 +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/actorfeeditemdto.md + - docs/models/components/actorfeeditemdtodata.md - docs/models/components/actortypeenum.md - docs/models/components/addsubscribersrequestdto.md - docs/models/components/apikey.md @@ -132,9 +133,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/notificationfeeditemdto.md + - docs/models/components/notificationfeeditemdtoproviderid.md + - docs/models/components/notificationfeeditemdtostatus.md - docs/models/components/notificationgroup.md - docs/models/components/notificationgroupresponsedto.md - docs/models/components/notificationstep.md @@ -163,9 +164,12 @@ generatedFiles: - docs/models/components/source.md - docs/models/components/status.md - docs/models/components/stepfilter.md + - docs/models/components/subject.md - docs/models/components/subscriberchanneldto.md + - docs/models/components/subscriberfeedresponsedto.md - docs/models/components/subscriberpayloaddto.md - docs/models/components/subscriberresponsedto.md + - docs/models/components/templateidentifier.md - docs/models/components/templateresponse.md - docs/models/components/tenant.md - docs/models/components/tenantpayloaddto.md @@ -178,7 +182,6 @@ 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 @@ -408,7 +411,7 @@ generatedFiles: - src/models/components/activitynotificationsubscriberresponsedto.ts - src/models/components/activitynotificationtemplateresponsedto.ts - src/models/components/activitystatsresponsedto.ts - - src/models/components/actor.ts + - src/models/components/actorfeeditemdto.ts - src/models/components/actortypeenum.ts - src/models/components/addsubscribersrequestdto.ts - src/models/components/apikey.ts @@ -457,7 +460,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/notificationfeeditemdto.ts - src/models/components/notificationgroup.ts - src/models/components/notificationgroupresponsedto.ts - src/models/components/notificationstep.ts @@ -472,6 +475,7 @@ generatedFiles: - src/models/components/security.ts - src/models/components/stepfilter.ts - src/models/components/subscriberchanneldto.ts + - src/models/components/subscriberfeedresponsedto.ts - src/models/components/subscriberpayloaddto.ts - src/models/components/subscriberresponsedto.ts - src/models/components/templateresponse.ts diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 43bfd8e2..5398b915 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -13,7 +13,7 @@ generation: oAuth2ClientCredentialsEnabled: false oAuth2PasswordEnabled: false typescript: - version: 0.0.1-alpha.77 + version: 0.0.1-alpha.78 additionalDependencies: dependencies: {} devDependencies: {} diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index b353c4f9..807f6a41 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,9 +1,9 @@ -speakeasyVersion: 1.453.4 +speakeasyVersion: 1.453.8 sources: json-development: sourceNamespace: json-development - sourceRevisionDigest: sha256:bedbc6d00f2af59e27c55d8c94b2c129a47ae6b64e77419967598696ea1b5b23 - sourceBlobDigest: sha256:595c3ce779fd4759c8e761f201f816ed7d1b9d61d57aa175a8902e77b21d3a8b + sourceRevisionDigest: sha256:fdd69938eb255b9b0b52e3b247dee3a116120f206b6997950b8abfd109d60c78 + sourceBlobDigest: sha256:c49b1a02ed03d1b4d2a376f925e9d4c806d50058dcbe6a8c64b3305b76834f9d tags: - latest - "1.0" @@ -11,10 +11,10 @@ targets: my-first-target: source: json-development sourceNamespace: json-development - sourceRevisionDigest: sha256:bedbc6d00f2af59e27c55d8c94b2c129a47ae6b64e77419967598696ea1b5b23 - sourceBlobDigest: sha256:595c3ce779fd4759c8e761f201f816ed7d1b9d61d57aa175a8902e77b21d3a8b + sourceRevisionDigest: sha256:fdd69938eb255b9b0b52e3b247dee3a116120f206b6997950b8abfd109d60c78 + sourceBlobDigest: sha256:c49b1a02ed03d1b4d2a376f925e9d4c806d50058dcbe6a8c64b3305b76834f9d codeSamplesNamespace: code-samples-typescript - codeSamplesRevisionDigest: sha256:a3502e09043e065b4cb33376c11e4f3a84ec89fbc6b306bb9d37f291ba57674c + codeSamplesRevisionDigest: sha256:ace8634f247dbc460f2c4a541ccf625d51ce534747bbc27a0f391381b66174f5 workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/docs/models/components/actor.md b/docs/models/components/actor.md index f07687ea..8fb611ca 100644 --- a/docs/models/components/actor.md +++ b/docs/models/components/actor.md @@ -1,19 +1,23 @@ # Actor -## Example Usage +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 -import { Actor } from "@novu/api/models/components"; +const value: string = ""; +``` + +### `components.SubscriberPayloadDto` -let value: Actor = { - data: {}, - type: "none", +```typescript +const value: components.SubscriberPayloadDto = { + subscriberId: "", }; ``` -## 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/actorfeeditemdto.md b/docs/models/components/actorfeeditemdto.md new file mode 100644 index 00000000..88d0f5f3 --- /dev/null +++ b/docs/models/components/actorfeeditemdto.md @@ -0,0 +1,19 @@ +# ActorFeedItemDto + +## Example Usage + +```typescript +import { ActorFeedItemDto } from "@novu/api/models/components"; + +let value: ActorFeedItemDto = { + data: {}, + type: "none", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- | +| `data` | [components.ActorFeedItemDtoData](../../models/components/actorfeeditemdtodata.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/actordata.md b/docs/models/components/actorfeeditemdtodata.md similarity index 64% rename from docs/models/components/actordata.md rename to docs/models/components/actorfeeditemdtodata.md index afa911a5..05f45846 100644 --- a/docs/models/components/actordata.md +++ b/docs/models/components/actorfeeditemdtodata.md @@ -1,13 +1,13 @@ -# ActorData +# ActorFeedItemDtoData The data associated with the actor, can be null if not applicable. ## Example Usage ```typescript -import { ActorData } from "@novu/api/models/components"; +import { ActorFeedItemDtoData } from "@novu/api/models/components"; -let value: ActorData = {}; +let value: ActorFeedItemDtoData = {}; ``` ## Fields diff --git a/docs/models/components/channelsettings.md b/docs/models/components/channelsettings.md index c3d60f77..cbf08479 100644 --- a/docs/models/components/channelsettings.md +++ b/docs/models/components/channelsettings.md @@ -21,4 +21,4 @@ let value: ChannelSettings = { | `providerId` | [components.ChannelSettingsProviderId](../../models/components/channelsettingsproviderid.md) | :heavy_check_mark: | The provider identifier for the credentials | | `integrationIdentifier` | *string* | :heavy_minus_sign: | The integration identifier | | `credentials` | [components.ChannelCredentials](../../models/components/channelcredentials.md) | :heavy_check_mark: | Credentials payload for the specified provider | -| `integrationId` | *string* | :heavy_check_mark: | Id of the integration that is used for this channel | \ No newline at end of file +| `integrationId` | *string* | :heavy_check_mark: | The unique identifier of the integration associated with this channel. | \ No newline at end of file diff --git a/docs/models/components/channeltypeenum.md b/docs/models/components/channeltypeenum.md index b5dc0c7f..fa8ab8c0 100644 --- a/docs/models/components/channeltypeenum.md +++ b/docs/models/components/channeltypeenum.md @@ -1,11 +1,13 @@ # ChannelTypeEnum +The channel through which the notification is sent. + ## Example Usage ```typescript import { ChannelTypeEnum } from "@novu/api/models/components"; -let value: ChannelTypeEnum = "email"; +let value: ChannelTypeEnum = "chat"; ``` ## Values diff --git a/docs/models/components/feedresponsedto.md b/docs/models/components/feedresponsedto.md index df86595e..b11be7ef 100644 --- a/docs/models/components/feedresponsedto.md +++ b/docs/models/components/feedresponsedto.md @@ -37,10 +37,10 @@ let value: FeedResponseDto = { ## Fields -| 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 +| 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.NotificationFeedItemDto](../../models/components/notificationfeeditemdto.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/filtertopicsresponsedto.md b/docs/models/components/filtertopicsresponsedto.md index da40ddb3..456d5039 100644 --- a/docs/models/components/filtertopicsresponsedto.md +++ b/docs/models/components/filtertopicsresponsedto.md @@ -17,9 +17,9 @@ let value: FilterTopicsResponseDto = { ], }, ], - page: 7980.47, - pageSize: 1856.36, - totalCount: 9527.92, + page: 2735.42, + pageSize: 7980.47, + totalCount: 1856.36, }; ``` 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/messagebuttontype.md b/docs/models/components/messagebuttontype.md index cf92dd69..b06cb585 100644 --- a/docs/models/components/messagebuttontype.md +++ b/docs/models/components/messagebuttontype.md @@ -5,7 +5,7 @@ ```typescript import { MessageButtonType } from "@novu/api/models/components"; -let value: MessageButtonType = "primary"; +let value: MessageButtonType = "secondary"; ``` ## Values diff --git a/docs/models/components/notificationdto.md b/docs/models/components/notificationdto.md deleted file mode 100644 index 9ab4c3a3..00000000 --- a/docs/models/components/notificationdto.md +++ /dev/null @@ -1,61 +0,0 @@ -# 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: "error", -}; -``` - -## 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_minus_sign: | 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 deleted file mode 100644 index 944c579d..00000000 --- a/docs/models/components/notificationdtochannel.md +++ /dev/null @@ -1,17 +0,0 @@ -# NotificationDtoChannel - -The channel through which the notification is sent. - -## Example Usage - -```typescript -import { NotificationDtoChannel } from "@novu/api/models/components"; - -let value: NotificationDtoChannel = "push"; -``` - -## 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 deleted file mode 100644 index 5386c59e..00000000 --- a/docs/models/components/notificationdtostatus.md +++ /dev/null @@ -1,17 +0,0 @@ -# NotificationDtoStatus - -Current status of the notification. - -## Example Usage - -```typescript -import { NotificationDtoStatus } from "@novu/api/models/components"; - -let value: NotificationDtoStatus = "warning"; -``` - -## Values - -```typescript -"sent" | "error" | "warning" -``` \ No newline at end of file diff --git a/docs/models/components/notificationfeeditemdto.md b/docs/models/components/notificationfeeditemdto.md new file mode 100644 index 00000000..abe11a2f --- /dev/null +++ b/docs/models/components/notificationfeeditemdto.md @@ -0,0 +1,61 @@ +# NotificationFeedItemDto + +## Example Usage + +```typescript +import { NotificationFeedItemDto } from "@novu/api/models/components"; + +let value: NotificationFeedItemDto = { + id: "", + templateId: "", + environmentId: "", + messageTemplateId: "", + organizationId: "", + notificationId: "", + subscriberId: "", + feedId: "", + jobId: "", + transactionId: "", + content: "", + channel: "chat", + read: false, + seen: false, + deleted: false, + cta: { + data: {}, + }, + status: "warning", +}; +``` + +## 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.ActorFeedItemDto](../../models/components/actorfeeditemdto.md) | :heavy_minus_sign: | Actor details related to the notification, if applicable. | +| `subscriber` | [components.SubscriberFeedResponseDto](../../models/components/subscriberfeedresponsedto.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` | [components.TemplateIdentifier](../../models/components/templateidentifier.md) | :heavy_minus_sign: | Identifier for the template used, if applicable. | +| `providerId` | [components.NotificationFeedItemDtoProviderId](../../models/components/notificationfeeditemdtoproviderid.md) | :heavy_minus_sign: | Identifier for the provider that sends the notification. | +| `content` | *string* | :heavy_check_mark: | The main content of the notification. | +| `subject` | [components.Subject](../../models/components/subject.md) | :heavy_minus_sign: | The subject line for email notifications, if applicable. | +| `channel` | [components.ChannelTypeEnum](../../models/components/channeltypeenum.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.NotificationFeedItemDtoStatus](../../models/components/notificationfeeditemdtostatus.md) | :heavy_check_mark: | Current status of the notification. | +| `payload` | Record | :heavy_minus_sign: | 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/notificationfeeditemdtoproviderid.md b/docs/models/components/notificationfeeditemdtoproviderid.md new file mode 100644 index 00000000..b1d2676e --- /dev/null +++ b/docs/models/components/notificationfeeditemdtoproviderid.md @@ -0,0 +1,16 @@ +# NotificationFeedItemDtoProviderId + +Identifier for the provider that sends the notification. + +## Example Usage + +```typescript +import { NotificationFeedItemDtoProviderId } from "@novu/api/models/components"; + +let value: NotificationFeedItemDtoProviderId = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/notificationfeeditemdtostatus.md b/docs/models/components/notificationfeeditemdtostatus.md new file mode 100644 index 00000000..dc72a480 --- /dev/null +++ b/docs/models/components/notificationfeeditemdtostatus.md @@ -0,0 +1,17 @@ +# NotificationFeedItemDtoStatus + +Current status of the notification. + +## Example Usage + +```typescript +import { NotificationFeedItemDtoStatus } from "@novu/api/models/components"; + +let value: NotificationFeedItemDtoStatus = "warning"; +``` + +## Values + +```typescript +"sent" | "error" | "warning" +``` \ No newline at end of file diff --git a/docs/models/components/subject.md b/docs/models/components/subject.md new file mode 100644 index 00000000..cbff97ac --- /dev/null +++ b/docs/models/components/subject.md @@ -0,0 +1,16 @@ +# Subject + +The subject line for email notifications, if applicable. + +## Example Usage + +```typescript +import { Subject } from "@novu/api/models/components"; + +let value: Subject = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/subscriberfeedresponsedto.md b/docs/models/components/subscriberfeedresponsedto.md new file mode 100644 index 00000000..a38f8e4e --- /dev/null +++ b/docs/models/components/subscriberfeedresponsedto.md @@ -0,0 +1,21 @@ +# SubscriberFeedResponseDto + +## Example Usage + +```typescript +import { SubscriberFeedResponseDto } from "@novu/api/models/components"; + +let value: SubscriberFeedResponseDto = { + subscriberId: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | The internal ID generated by Novu for your subscriber. This ID does not match the `subscriberId` used in your queries. Refer to `subscriberId` for that identifier. | +| `firstName` | *string* | :heavy_minus_sign: | The first name of the subscriber. | +| `lastName` | *string* | :heavy_minus_sign: | The last name of the subscriber. | +| `avatar` | *string* | :heavy_minus_sign: | The URL of the subscriber's avatar image. | +| `subscriberId` | *string* | :heavy_check_mark: | The identifier used to create this subscriber, which typically corresponds to the user ID in your system. | \ No newline at end of file diff --git a/docs/models/components/subscriberresponsedto.md b/docs/models/components/subscriberresponsedto.md index c42f918e..c8ede295 100644 --- a/docs/models/components/subscriberresponsedto.md +++ b/docs/models/components/subscriberresponsedto.md @@ -17,23 +17,23 @@ let value: SubscriberResponseDto = { ## Fields -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | The internal id novu generated for your subscriber, this is not the subscriberId matching your query. See `subscriberId` for that | -| `firstName` | *string* | :heavy_minus_sign: | N/A | -| `lastName` | *string* | :heavy_minus_sign: | N/A | -| `email` | *string* | :heavy_minus_sign: | N/A | -| `phone` | *string* | :heavy_minus_sign: | N/A | -| `avatar` | *string* | :heavy_minus_sign: | N/A | -| `locale` | *string* | :heavy_minus_sign: | N/A | -| `subscriberId` | *string* | :heavy_check_mark: | The internal identifier you used to create this subscriber, usually correlates to the id the user in your systems | -| `channels` | [components.ChannelSettings](../../models/components/channelsettings.md)[] | :heavy_minus_sign: | Channels settings for subscriber | -| `topics` | *string*[] | :heavy_minus_sign: | Topics that subscriber belongs to | -| `isOnline` | *boolean* | :heavy_minus_sign: | N/A | -| `lastOnlineAt` | *string* | :heavy_minus_sign: | N/A | -| `organizationId` | *string* | :heavy_check_mark: | N/A | -| `environmentId` | *string* | :heavy_check_mark: | N/A | -| `deleted` | *boolean* | :heavy_check_mark: | N/A | -| `createdAt` | *string* | :heavy_check_mark: | N/A | -| `updatedAt` | *string* | :heavy_check_mark: | N/A | -| `v` | *number* | :heavy_minus_sign: | N/A | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | The internal ID generated by Novu for your subscriber. This ID does not match the `subscriberId` used in your queries. Refer to `subscriberId` for that identifier. | +| `firstName` | *string* | :heavy_minus_sign: | The first name of the subscriber. | +| `lastName` | *string* | :heavy_minus_sign: | The last name of the subscriber. | +| `email` | *string* | :heavy_minus_sign: | The email address of the subscriber. | +| `phone` | *string* | :heavy_minus_sign: | The phone number of the subscriber. | +| `avatar` | *string* | :heavy_minus_sign: | The URL of the subscriber's avatar image. | +| `locale` | *string* | :heavy_minus_sign: | The locale setting of the subscriber, indicating their preferred language or region. | +| `subscriberId` | *string* | :heavy_check_mark: | The identifier used to create this subscriber, which typically corresponds to the user ID in your system. | +| `channels` | [components.ChannelSettings](../../models/components/channelsettings.md)[] | :heavy_minus_sign: | An array of channel settings associated with the subscriber. | +| `topics` | *string*[] | :heavy_minus_sign: | An array of topics that the subscriber is subscribed to. | +| `isOnline` | *boolean* | :heavy_minus_sign: | Indicates whether the subscriber is currently online. | +| `lastOnlineAt` | *string* | :heavy_minus_sign: | The timestamp indicating when the subscriber was last online, in ISO 8601 format. | +| `organizationId` | *string* | :heavy_check_mark: | The unique identifier of the organization to which the subscriber belongs. | +| `environmentId` | *string* | :heavy_check_mark: | The unique identifier of the environment associated with this subscriber. | +| `deleted` | *boolean* | :heavy_check_mark: | Indicates whether the subscriber has been deleted. | +| `createdAt` | *string* | :heavy_check_mark: | The timestamp indicating when the subscriber was created, in ISO 8601 format. | +| `updatedAt` | *string* | :heavy_check_mark: | The timestamp indicating when the subscriber was last updated, in ISO 8601 format. | +| `v` | *number* | :heavy_minus_sign: | The version of the subscriber document. | \ No newline at end of file diff --git a/docs/models/components/templateidentifier.md b/docs/models/components/templateidentifier.md new file mode 100644 index 00000000..4e2aa0d5 --- /dev/null +++ b/docs/models/components/templateidentifier.md @@ -0,0 +1,16 @@ +# TemplateIdentifier + +Identifier for the template used, if applicable. + +## Example Usage + +```typescript +import { TemplateIdentifier } from "@novu/api/models/components"; + +let value: TemplateIdentifier = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------- | ----------- | ----------- | ----------- | \ No newline at end of file diff --git a/docs/models/components/triggereventrequestdto.md b/docs/models/components/triggereventrequestdto.md index 0c3834d0..8579c88b 100644 --- a/docs/models/components/triggereventrequestdto.md +++ b/docs/models/components/triggereventrequestdto.md @@ -39,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.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 | | +| `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 | | | `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 deleted file mode 100644 index 9489f66b..00000000 --- a/docs/models/components/triggereventrequestdtoactor.md +++ /dev/null @@ -1,23 +0,0 @@ -# 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/operations/messagescontrollergetmessagesrequest.md b/docs/models/operations/messagescontrollergetmessagesrequest.md index fc66d4ef..a986e792 100644 --- a/docs/models/operations/messagescontrollergetmessagesrequest.md +++ b/docs/models/operations/messagescontrollergetmessagesrequest.md @@ -12,7 +12,7 @@ let value: MessagesControllerGetMessagesRequest = {}; | Field | Type | Required | Description | | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | -| `channel` | [components.ChannelTypeEnum](../../models/components/channeltypeenum.md) | :heavy_minus_sign: | N/A | +| `channel` | [components.ChannelTypeEnum](../../models/components/channeltypeenum.md) | :heavy_minus_sign: | The channel through which the notification is sent. | | `subscriberId` | *string* | :heavy_minus_sign: | N/A | | `transactionId` | *string*[] | :heavy_minus_sign: | N/A | | `page` | *number* | :heavy_minus_sign: | N/A | diff --git a/jsr.json b/jsr.json index 4f3d9a54..ca1fb1c5 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@novu/api", - "version": "0.0.1-alpha.77", + "version": "0.0.1-alpha.78", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index 7c307783..97f3a633 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@novu/api", - "version": "0.0.1-alpha.77", + "version": "0.0.1-alpha.78", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@novu/api", - "version": "0.0.1-alpha.77", + "version": "0.0.1-alpha.78", "devDependencies": { "@typescript-eslint/eslint-plugin": "^7.7.1", "@typescript-eslint/parser": "^7.7.1", diff --git a/package.json b/package.json index dfd8662a..7c7913e7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@novu/api", - "version": "0.0.1-alpha.77", + "version": "0.0.1-alpha.78", "author": "Novu", "main": "./index.js", "sideEffects": false, diff --git a/sources/json-development.json b/sources/json-development.json index 6fcb534f..e8daba53 100644 --- a/sources/json-development.json +++ b/sources/json-development.json @@ -11691,7 +11691,7 @@ }, "_integrationId": { "type": "string", - "description": "Id of the integration that is used for this channel" + "description": "The unique identifier of the integration associated with this channel." } }, "required": [ @@ -11705,67 +11705,81 @@ "properties": { "_id": { "type": "string", - "description": "The internal id novu generated for your subscriber, this is not the subscriberId matching your query. See `subscriberId` for that" + "description": "The internal ID generated by Novu for your subscriber. This ID does not match the `subscriberId` used in your queries. Refer to `subscriberId` for that identifier." }, "firstName": { - "type": "string" + "type": "string", + "description": "The first name of the subscriber." }, "lastName": { - "type": "string" + "type": "string", + "description": "The last name of the subscriber." }, "email": { - "type": "string" + "type": "string", + "description": "The email address of the subscriber." }, "phone": { - "type": "string" + "type": "string", + "description": "The phone number of the subscriber." }, "avatar": { - "type": "string" + "type": "string", + "description": "The URL of the subscriber's avatar image." }, "locale": { - "type": "string" + "type": "string", + "description": "The locale setting of the subscriber, indicating their preferred language or region." }, "subscriberId": { "type": "string", - "description": "The internal identifier you used to create this subscriber, usually correlates to the id the user in your systems" + "description": "The identifier used to create this subscriber, which typically corresponds to the user ID in your system." }, "channels": { - "description": "Channels settings for subscriber", + "description": "An array of channel settings associated with the subscriber.", "type": "array", "items": { "$ref": "#/components/schemas/ChannelSettings" } }, "topics": { - "description": "Topics that subscriber belongs to", + "description": "An array of topics that the subscriber is subscribed to.", "type": "array", "items": { "type": "string" } }, "isOnline": { - "type": "boolean" + "type": "boolean", + "description": "Indicates whether the subscriber is currently online." }, "lastOnlineAt": { - "type": "string" + "type": "string", + "description": "The timestamp indicating when the subscriber was last online, in ISO 8601 format." }, "_organizationId": { - "type": "string" + "type": "string", + "description": "The unique identifier of the organization to which the subscriber belongs." }, "_environmentId": { - "type": "string" + "type": "string", + "description": "The unique identifier of the environment associated with this subscriber." }, "deleted": { - "type": "boolean" + "type": "boolean", + "description": "Indicates whether the subscriber has been deleted." }, "createdAt": { - "type": "string" + "type": "string", + "description": "The timestamp indicating when the subscriber was created, in ISO 8601 format." }, "updatedAt": { - "type": "string" + "type": "string", + "description": "The timestamp indicating when the subscriber was last updated, in ISO 8601 format." }, "__v": { - "type": "number" + "type": "number", + "description": "The version of the subscriber document." } }, "required": [ @@ -12279,7 +12293,7 @@ "system_custom" ] }, - "Actor": { + "ActorFeedItemDto": { "type": "object", "properties": { "data": { @@ -12296,7 +12310,46 @@ "type" ] }, - "NotificationDto": { + "SubscriberFeedResponseDto": { + "type": "object", + "properties": { + "_id": { + "type": "string", + "description": "The internal ID generated by Novu for your subscriber. This ID does not match the `subscriberId` used in your queries. Refer to `subscriberId` for that identifier." + }, + "firstName": { + "type": "string", + "description": "The first name of the subscriber." + }, + "lastName": { + "type": "string", + "description": "The last name of the subscriber." + }, + "avatar": { + "type": "string", + "description": "The URL of the subscriber's avatar image." + }, + "subscriberId": { + "type": "string", + "description": "The identifier used to create this subscriber, which typically corresponds to the user ID in your system." + } + }, + "required": [ + "subscriberId" + ] + }, + "ChannelTypeEnum": { + "type": "string", + "description": "The channel through which the notification is sent.", + "enum": [ + "in_app", + "email", + "sms", + "chat", + "push" + ] + }, + "NotificationFeedItemDto": { "type": "object", "properties": { "_id": { @@ -12337,21 +12390,21 @@ }, "createdAt": { "type": "string", + "nullable": true, "description": "Timestamp indicating when the notification was created.", - "format": "date-time", - "nullable": true + "format": "date-time" }, "updatedAt": { "type": "string", + "nullable": true, "description": "Timestamp indicating when the notification was last updated.", - "format": "date-time", - "nullable": true + "format": "date-time" }, "actor": { "description": "Actor details related to the notification, if applicable.", "allOf": [ { - "$ref": "#/components/schemas/Actor" + "$ref": "#/components/schemas/ActorFeedItemDto" } ] }, @@ -12359,7 +12412,7 @@ "description": "Subscriber details associated with this notification.", "allOf": [ { - "$ref": "#/components/schemas/SubscriberResponseDto" + "$ref": "#/components/schemas/SubscriberFeedResponseDto" } ] }, @@ -12368,34 +12421,26 @@ "description": "Unique identifier for the transaction associated with the notification." }, "templateIdentifier": { - "type": "string", - "description": "Identifier for the template used, if applicable.", - "nullable": true + "type": "object", + "nullable": true, + "description": "Identifier for the template used, if applicable." }, "providerId": { - "type": "string", - "description": "Identifier for the provider that sends the notification.", - "nullable": true + "type": "object", + "nullable": true, + "description": "Identifier for the provider that sends the notification." }, "content": { "type": "string", "description": "The main content of the notification." }, "subject": { - "type": "string", - "description": "The subject line for email notifications, if applicable.", - "nullable": true + "type": "object", + "nullable": true, + "description": "The subject line for email notifications, if applicable." }, "channel": { - "enum": [ - "in_app", - "email", - "sms", - "chat", - "push" - ], - "type": "string", - "description": "The channel through which the notification is sent." + "$ref": "#/components/schemas/ChannelTypeEnum" }, "read": { "type": "boolean", @@ -12410,8 +12455,8 @@ "description": "Indicates whether the notification has been deleted." }, "deviceTokens": { - "description": "Device tokens for push notifications, if applicable.", "nullable": true, + "description": "Device tokens for push notifications, if applicable.", "type": "array", "items": { "type": "string" @@ -12480,7 +12525,7 @@ "description": "Array of notifications returned in the response.", "type": "array", "items": { - "$ref": "#/components/schemas/NotificationDto" + "$ref": "#/components/schemas/NotificationFeedItemDto" } }, "pageSize": { @@ -13214,16 +13259,6 @@ "status" ] }, - "ChannelTypeEnum": { - "type": "string", - "enum": [ - "in_app", - "email", - "sms", - "chat", - "push" - ] - }, "DeleteMessageResponseDto": { "type": "object", "properties": { diff --git a/src/lib/config.ts b/src/lib/config.ts index b1d3e846..da6c3343 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.77", - genVersion: "2.474.6", - userAgent: "speakeasy-sdk/typescript 0.0.1-alpha.77 2.474.6 1.0 @novu/api", + sdkVersion: "0.0.1-alpha.78", + genVersion: "2.474.15", + userAgent: "speakeasy-sdk/typescript 0.0.1-alpha.78 2.474.15 1.0 @novu/api", } as const; diff --git a/src/models/components/actor.ts b/src/models/components/actor.ts deleted file mode 100644 index f7d2de04..00000000 --- a/src/models/components/actor.ts +++ /dev/null @@ -1,123 +0,0 @@ -/* - * 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/actorfeeditemdto.ts b/src/models/components/actorfeeditemdto.ts new file mode 100644 index 00000000..95e758b8 --- /dev/null +++ b/src/models/components/actorfeeditemdto.ts @@ -0,0 +1,134 @@ +/* + * 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 ActorFeedItemDtoData = {}; + +export type ActorFeedItemDto = { + /** + * The data associated with the actor, can be null if not applicable. + */ + data: ActorFeedItemDtoData | null; + /** + * The type of the actor, indicating the role in the notification process. + */ + type: ActorTypeEnum; +}; + +/** @internal */ +export const ActorFeedItemDtoData$inboundSchema: z.ZodType< + ActorFeedItemDtoData, + z.ZodTypeDef, + unknown +> = z.object({}); + +/** @internal */ +export type ActorFeedItemDtoData$Outbound = {}; + +/** @internal */ +export const ActorFeedItemDtoData$outboundSchema: z.ZodType< + ActorFeedItemDtoData$Outbound, + z.ZodTypeDef, + ActorFeedItemDtoData +> = 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 ActorFeedItemDtoData$ { + /** @deprecated use `ActorFeedItemDtoData$inboundSchema` instead. */ + export const inboundSchema = ActorFeedItemDtoData$inboundSchema; + /** @deprecated use `ActorFeedItemDtoData$outboundSchema` instead. */ + export const outboundSchema = ActorFeedItemDtoData$outboundSchema; + /** @deprecated use `ActorFeedItemDtoData$Outbound` instead. */ + export type Outbound = ActorFeedItemDtoData$Outbound; +} + +export function actorFeedItemDtoDataToJSON( + actorFeedItemDtoData: ActorFeedItemDtoData, +): string { + return JSON.stringify( + ActorFeedItemDtoData$outboundSchema.parse(actorFeedItemDtoData), + ); +} + +export function actorFeedItemDtoDataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ActorFeedItemDtoData$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ActorFeedItemDtoData' from JSON`, + ); +} + +/** @internal */ +export const ActorFeedItemDto$inboundSchema: z.ZodType< + ActorFeedItemDto, + z.ZodTypeDef, + unknown +> = z.object({ + data: z.nullable(z.lazy(() => ActorFeedItemDtoData$inboundSchema)), + type: ActorTypeEnum$inboundSchema, +}); + +/** @internal */ +export type ActorFeedItemDto$Outbound = { + data: ActorFeedItemDtoData$Outbound | null; + type: string; +}; + +/** @internal */ +export const ActorFeedItemDto$outboundSchema: z.ZodType< + ActorFeedItemDto$Outbound, + z.ZodTypeDef, + ActorFeedItemDto +> = z.object({ + data: z.nullable(z.lazy(() => ActorFeedItemDtoData$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 ActorFeedItemDto$ { + /** @deprecated use `ActorFeedItemDto$inboundSchema` instead. */ + export const inboundSchema = ActorFeedItemDto$inboundSchema; + /** @deprecated use `ActorFeedItemDto$outboundSchema` instead. */ + export const outboundSchema = ActorFeedItemDto$outboundSchema; + /** @deprecated use `ActorFeedItemDto$Outbound` instead. */ + export type Outbound = ActorFeedItemDto$Outbound; +} + +export function actorFeedItemDtoToJSON( + actorFeedItemDto: ActorFeedItemDto, +): string { + return JSON.stringify( + ActorFeedItemDto$outboundSchema.parse(actorFeedItemDto), + ); +} + +export function actorFeedItemDtoFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ActorFeedItemDto$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ActorFeedItemDto' from JSON`, + ); +} diff --git a/src/models/components/channelsettings.ts b/src/models/components/channelsettings.ts index 8d7f0dce..0b9598fd 100644 --- a/src/models/components/channelsettings.ts +++ b/src/models/components/channelsettings.ts @@ -58,7 +58,7 @@ export type ChannelSettings = { */ credentials: ChannelCredentials; /** - * Id of the integration that is used for this channel + * The unique identifier of the integration associated with this channel. */ integrationId: string; }; diff --git a/src/models/components/channeltypeenum.ts b/src/models/components/channeltypeenum.ts index dda6c6e3..94df6866 100644 --- a/src/models/components/channeltypeenum.ts +++ b/src/models/components/channeltypeenum.ts @@ -5,6 +5,9 @@ import * as z from "zod"; import { ClosedEnum } from "../../types/enums.js"; +/** + * The channel through which the notification is sent. + */ export const ChannelTypeEnum = { InApp: "in_app", Email: "email", @@ -12,6 +15,9 @@ export const ChannelTypeEnum = { Chat: "chat", Push: "push", } as const; +/** + * The channel through which the notification is sent. + */ export type ChannelTypeEnum = ClosedEnum; /** @internal */ diff --git a/src/models/components/feedresponsedto.ts b/src/models/components/feedresponsedto.ts index 4495a73d..b29f5195 100644 --- a/src/models/components/feedresponsedto.ts +++ b/src/models/components/feedresponsedto.ts @@ -7,11 +7,11 @@ 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"; + NotificationFeedItemDto, + NotificationFeedItemDto$inboundSchema, + NotificationFeedItemDto$Outbound, + NotificationFeedItemDto$outboundSchema, +} from "./notificationfeeditemdto.js"; export type FeedResponseDto = { /** @@ -25,7 +25,7 @@ export type FeedResponseDto = { /** * Array of notifications returned in the response. */ - data: Array; + data: Array; /** * The number of notifications returned in this response. */ @@ -44,7 +44,7 @@ export const FeedResponseDto$inboundSchema: z.ZodType< > = z.object({ totalCount: z.number().optional(), hasMore: z.boolean(), - data: z.array(NotificationDto$inboundSchema), + data: z.array(NotificationFeedItemDto$inboundSchema), pageSize: z.number(), page: z.number(), }); @@ -53,7 +53,7 @@ export const FeedResponseDto$inboundSchema: z.ZodType< export type FeedResponseDto$Outbound = { totalCount?: number | undefined; hasMore: boolean; - data: Array; + data: Array; pageSize: number; page: number; }; @@ -66,7 +66,7 @@ export const FeedResponseDto$outboundSchema: z.ZodType< > = z.object({ totalCount: z.number().optional(), hasMore: z.boolean(), - data: z.array(NotificationDto$outboundSchema), + data: z.array(NotificationFeedItemDto$outboundSchema), pageSize: z.number(), page: z.number(), }); diff --git a/src/models/components/index.ts b/src/models/components/index.ts index 35519b0e..224f6a3e 100644 --- a/src/models/components/index.ts +++ b/src/models/components/index.ts @@ -8,7 +8,7 @@ export * from "./activitynotificationresponsedto.js"; export * from "./activitynotificationsubscriberresponsedto.js"; export * from "./activitynotificationtemplateresponsedto.js"; export * from "./activitystatsresponsedto.js"; -export * from "./actor.js"; +export * from "./actorfeeditemdto.js"; export * from "./actortypeenum.js"; export * from "./addsubscribersrequestdto.js"; export * from "./apikey.js"; @@ -56,7 +56,7 @@ export * from "./messageentity.js"; export * from "./messagemarkasrequestdto.js"; export * from "./messageresponsedto.js"; export * from "./messagetemplate.js"; -export * from "./notificationdto.js"; +export * from "./notificationfeeditemdto.js"; export * from "./notificationgroup.js"; export * from "./notificationgroupresponsedto.js"; export * from "./notificationstep.js"; @@ -71,6 +71,7 @@ export * from "./renametopicresponsedto.js"; export * from "./security.js"; export * from "./stepfilter.js"; export * from "./subscriberchanneldto.js"; +export * from "./subscriberfeedresponsedto.js"; export * from "./subscriberpayloaddto.js"; export * from "./subscriberresponsedto.js"; export * from "./templateresponse.js"; diff --git a/src/models/components/notificationdto.ts b/src/models/components/notificationdto.ts deleted file mode 100644 index bd2eba95..00000000 --- a/src/models/components/notificationdto.ts +++ /dev/null @@ -1,367 +0,0 @@ -/* - * 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 } | undefined; - /** - * 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()).optional(), - 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 } | undefined; - 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()).optional(), - 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/notificationfeeditemdto.ts b/src/models/components/notificationfeeditemdto.ts new file mode 100644 index 00000000..326135db --- /dev/null +++ b/src/models/components/notificationfeeditemdto.ts @@ -0,0 +1,502 @@ +/* + * 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 { + ActorFeedItemDto, + ActorFeedItemDto$inboundSchema, + ActorFeedItemDto$Outbound, + ActorFeedItemDto$outboundSchema, +} from "./actorfeeditemdto.js"; +import { + ChannelTypeEnum, + ChannelTypeEnum$inboundSchema, + ChannelTypeEnum$outboundSchema, +} from "./channeltypeenum.js"; +import { + MessageCTA, + MessageCTA$inboundSchema, + MessageCTA$Outbound, + MessageCTA$outboundSchema, +} from "./messagecta.js"; +import { + SubscriberFeedResponseDto, + SubscriberFeedResponseDto$inboundSchema, + SubscriberFeedResponseDto$Outbound, + SubscriberFeedResponseDto$outboundSchema, +} from "./subscriberfeedresponsedto.js"; + +/** + * Identifier for the template used, if applicable. + */ +export type TemplateIdentifier = {}; + +/** + * Identifier for the provider that sends the notification. + */ +export type NotificationFeedItemDtoProviderId = {}; + +/** + * The subject line for email notifications, if applicable. + */ +export type Subject = {}; + +/** + * Current status of the notification. + */ +export const NotificationFeedItemDtoStatus = { + Sent: "sent", + Error: "error", + Warning: "warning", +} as const; +/** + * Current status of the notification. + */ +export type NotificationFeedItemDtoStatus = ClosedEnum< + typeof NotificationFeedItemDtoStatus +>; + +export type NotificationFeedItemDto = { + /** + * 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?: ActorFeedItemDto | undefined; + /** + * Subscriber details associated with this notification. + */ + subscriber?: SubscriberFeedResponseDto | undefined; + /** + * Unique identifier for the transaction associated with the notification. + */ + transactionId: string; + /** + * Identifier for the template used, if applicable. + */ + templateIdentifier?: TemplateIdentifier | null | undefined; + /** + * Identifier for the provider that sends the notification. + */ + providerId?: NotificationFeedItemDtoProviderId | null | undefined; + /** + * The main content of the notification. + */ + content: string; + /** + * The subject line for email notifications, if applicable. + */ + subject?: Subject | null | undefined; + /** + * The channel through which the notification is sent. + */ + channel: ChannelTypeEnum; + /** + * 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: NotificationFeedItemDtoStatus; + /** + * The payload that was used to send the notification trigger. + */ + payload?: { [k: string]: any } | undefined; + /** + * Provider-specific overrides used when triggering the notification. + */ + overrides?: { [k: string]: any } | undefined; +}; + +/** @internal */ +export const TemplateIdentifier$inboundSchema: z.ZodType< + TemplateIdentifier, + z.ZodTypeDef, + unknown +> = z.object({}); + +/** @internal */ +export type TemplateIdentifier$Outbound = {}; + +/** @internal */ +export const TemplateIdentifier$outboundSchema: z.ZodType< + TemplateIdentifier$Outbound, + z.ZodTypeDef, + TemplateIdentifier +> = 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 TemplateIdentifier$ { + /** @deprecated use `TemplateIdentifier$inboundSchema` instead. */ + export const inboundSchema = TemplateIdentifier$inboundSchema; + /** @deprecated use `TemplateIdentifier$outboundSchema` instead. */ + export const outboundSchema = TemplateIdentifier$outboundSchema; + /** @deprecated use `TemplateIdentifier$Outbound` instead. */ + export type Outbound = TemplateIdentifier$Outbound; +} + +export function templateIdentifierToJSON( + templateIdentifier: TemplateIdentifier, +): string { + return JSON.stringify( + TemplateIdentifier$outboundSchema.parse(templateIdentifier), + ); +} + +export function templateIdentifierFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => TemplateIdentifier$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'TemplateIdentifier' from JSON`, + ); +} + +/** @internal */ +export const NotificationFeedItemDtoProviderId$inboundSchema: z.ZodType< + NotificationFeedItemDtoProviderId, + z.ZodTypeDef, + unknown +> = z.object({}); + +/** @internal */ +export type NotificationFeedItemDtoProviderId$Outbound = {}; + +/** @internal */ +export const NotificationFeedItemDtoProviderId$outboundSchema: z.ZodType< + NotificationFeedItemDtoProviderId$Outbound, + z.ZodTypeDef, + NotificationFeedItemDtoProviderId +> = 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 NotificationFeedItemDtoProviderId$ { + /** @deprecated use `NotificationFeedItemDtoProviderId$inboundSchema` instead. */ + export const inboundSchema = NotificationFeedItemDtoProviderId$inboundSchema; + /** @deprecated use `NotificationFeedItemDtoProviderId$outboundSchema` instead. */ + export const outboundSchema = + NotificationFeedItemDtoProviderId$outboundSchema; + /** @deprecated use `NotificationFeedItemDtoProviderId$Outbound` instead. */ + export type Outbound = NotificationFeedItemDtoProviderId$Outbound; +} + +export function notificationFeedItemDtoProviderIdToJSON( + notificationFeedItemDtoProviderId: NotificationFeedItemDtoProviderId, +): string { + return JSON.stringify( + NotificationFeedItemDtoProviderId$outboundSchema.parse( + notificationFeedItemDtoProviderId, + ), + ); +} + +export function notificationFeedItemDtoProviderIdFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => NotificationFeedItemDtoProviderId$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'NotificationFeedItemDtoProviderId' from JSON`, + ); +} + +/** @internal */ +export const Subject$inboundSchema: z.ZodType = + z.object({}); + +/** @internal */ +export type Subject$Outbound = {}; + +/** @internal */ +export const Subject$outboundSchema: z.ZodType< + Subject$Outbound, + z.ZodTypeDef, + Subject +> = 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 Subject$ { + /** @deprecated use `Subject$inboundSchema` instead. */ + export const inboundSchema = Subject$inboundSchema; + /** @deprecated use `Subject$outboundSchema` instead. */ + export const outboundSchema = Subject$outboundSchema; + /** @deprecated use `Subject$Outbound` instead. */ + export type Outbound = Subject$Outbound; +} + +export function subjectToJSON(subject: Subject): string { + return JSON.stringify(Subject$outboundSchema.parse(subject)); +} + +export function subjectFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Subject$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Subject' from JSON`, + ); +} + +/** @internal */ +export const NotificationFeedItemDtoStatus$inboundSchema: z.ZodNativeEnum< + typeof NotificationFeedItemDtoStatus +> = z.nativeEnum(NotificationFeedItemDtoStatus); + +/** @internal */ +export const NotificationFeedItemDtoStatus$outboundSchema: z.ZodNativeEnum< + typeof NotificationFeedItemDtoStatus +> = NotificationFeedItemDtoStatus$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace NotificationFeedItemDtoStatus$ { + /** @deprecated use `NotificationFeedItemDtoStatus$inboundSchema` instead. */ + export const inboundSchema = NotificationFeedItemDtoStatus$inboundSchema; + /** @deprecated use `NotificationFeedItemDtoStatus$outboundSchema` instead. */ + export const outboundSchema = NotificationFeedItemDtoStatus$outboundSchema; +} + +/** @internal */ +export const NotificationFeedItemDto$inboundSchema: z.ZodType< + NotificationFeedItemDto, + 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: ActorFeedItemDto$inboundSchema.optional(), + subscriber: SubscriberFeedResponseDto$inboundSchema.optional(), + transactionId: z.string(), + templateIdentifier: z.nullable(z.lazy(() => TemplateIdentifier$inboundSchema)) + .optional(), + providerId: z.nullable( + z.lazy(() => NotificationFeedItemDtoProviderId$inboundSchema), + ).optional(), + content: z.string(), + subject: z.nullable(z.lazy(() => Subject$inboundSchema)).optional(), + channel: ChannelTypeEnum$inboundSchema, + read: z.boolean(), + seen: z.boolean(), + deleted: z.boolean(), + deviceTokens: z.nullable(z.array(z.string())).optional(), + cta: MessageCTA$inboundSchema, + status: NotificationFeedItemDtoStatus$inboundSchema, + payload: z.record(z.any()).optional(), + 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 NotificationFeedItemDto$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?: ActorFeedItemDto$Outbound | undefined; + subscriber?: SubscriberFeedResponseDto$Outbound | undefined; + transactionId: string; + templateIdentifier?: TemplateIdentifier$Outbound | null | undefined; + providerId?: NotificationFeedItemDtoProviderId$Outbound | null | undefined; + content: string; + subject?: Subject$Outbound | null | undefined; + channel: string; + read: boolean; + seen: boolean; + deleted: boolean; + deviceTokens?: Array | null | undefined; + cta: MessageCTA$Outbound; + status: string; + payload?: { [k: string]: any } | undefined; + overrides?: { [k: string]: any } | undefined; +}; + +/** @internal */ +export const NotificationFeedItemDto$outboundSchema: z.ZodType< + NotificationFeedItemDto$Outbound, + z.ZodTypeDef, + NotificationFeedItemDto +> = 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: ActorFeedItemDto$outboundSchema.optional(), + subscriber: SubscriberFeedResponseDto$outboundSchema.optional(), + transactionId: z.string(), + templateIdentifier: z.nullable( + z.lazy(() => TemplateIdentifier$outboundSchema), + ).optional(), + providerId: z.nullable( + z.lazy(() => NotificationFeedItemDtoProviderId$outboundSchema), + ).optional(), + content: z.string(), + subject: z.nullable(z.lazy(() => Subject$outboundSchema)).optional(), + channel: ChannelTypeEnum$outboundSchema, + read: z.boolean(), + seen: z.boolean(), + deleted: z.boolean(), + deviceTokens: z.nullable(z.array(z.string())).optional(), + cta: MessageCTA$outboundSchema, + status: NotificationFeedItemDtoStatus$outboundSchema, + payload: z.record(z.any()).optional(), + 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 NotificationFeedItemDto$ { + /** @deprecated use `NotificationFeedItemDto$inboundSchema` instead. */ + export const inboundSchema = NotificationFeedItemDto$inboundSchema; + /** @deprecated use `NotificationFeedItemDto$outboundSchema` instead. */ + export const outboundSchema = NotificationFeedItemDto$outboundSchema; + /** @deprecated use `NotificationFeedItemDto$Outbound` instead. */ + export type Outbound = NotificationFeedItemDto$Outbound; +} + +export function notificationFeedItemDtoToJSON( + notificationFeedItemDto: NotificationFeedItemDto, +): string { + return JSON.stringify( + NotificationFeedItemDto$outboundSchema.parse(notificationFeedItemDto), + ); +} + +export function notificationFeedItemDtoFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => NotificationFeedItemDto$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'NotificationFeedItemDto' from JSON`, + ); +} diff --git a/src/models/components/subscriberfeedresponsedto.ts b/src/models/components/subscriberfeedresponsedto.ts new file mode 100644 index 00000000..58d3e7b3 --- /dev/null +++ b/src/models/components/subscriberfeedresponsedto.ts @@ -0,0 +1,106 @@ +/* + * 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 { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type SubscriberFeedResponseDto = { + /** + * The internal ID generated by Novu for your subscriber. This ID does not match the `subscriberId` used in your queries. Refer to `subscriberId` for that identifier. + */ + id?: string | undefined; + /** + * The first name of the subscriber. + */ + firstName?: string | undefined; + /** + * The last name of the subscriber. + */ + lastName?: string | undefined; + /** + * The URL of the subscriber's avatar image. + */ + avatar?: string | undefined; + /** + * The identifier used to create this subscriber, which typically corresponds to the user ID in your system. + */ + subscriberId: string; +}; + +/** @internal */ +export const SubscriberFeedResponseDto$inboundSchema: z.ZodType< + SubscriberFeedResponseDto, + z.ZodTypeDef, + unknown +> = z.object({ + _id: z.string().optional(), + firstName: z.string().optional(), + lastName: z.string().optional(), + avatar: z.string().optional(), + subscriberId: z.string(), +}).transform((v) => { + return remap$(v, { + "_id": "id", + }); +}); + +/** @internal */ +export type SubscriberFeedResponseDto$Outbound = { + _id?: string | undefined; + firstName?: string | undefined; + lastName?: string | undefined; + avatar?: string | undefined; + subscriberId: string; +}; + +/** @internal */ +export const SubscriberFeedResponseDto$outboundSchema: z.ZodType< + SubscriberFeedResponseDto$Outbound, + z.ZodTypeDef, + SubscriberFeedResponseDto +> = z.object({ + id: z.string().optional(), + firstName: z.string().optional(), + lastName: z.string().optional(), + avatar: z.string().optional(), + subscriberId: z.string(), +}).transform((v) => { + return remap$(v, { + id: "_id", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace SubscriberFeedResponseDto$ { + /** @deprecated use `SubscriberFeedResponseDto$inboundSchema` instead. */ + export const inboundSchema = SubscriberFeedResponseDto$inboundSchema; + /** @deprecated use `SubscriberFeedResponseDto$outboundSchema` instead. */ + export const outboundSchema = SubscriberFeedResponseDto$outboundSchema; + /** @deprecated use `SubscriberFeedResponseDto$Outbound` instead. */ + export type Outbound = SubscriberFeedResponseDto$Outbound; +} + +export function subscriberFeedResponseDtoToJSON( + subscriberFeedResponseDto: SubscriberFeedResponseDto, +): string { + return JSON.stringify( + SubscriberFeedResponseDto$outboundSchema.parse(subscriberFeedResponseDto), + ); +} + +export function subscriberFeedResponseDtoFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => SubscriberFeedResponseDto$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'SubscriberFeedResponseDto' from JSON`, + ); +} diff --git a/src/models/components/subscriberresponsedto.ts b/src/models/components/subscriberresponsedto.ts index 24f069d6..324b66d8 100644 --- a/src/models/components/subscriberresponsedto.ts +++ b/src/models/components/subscriberresponsedto.ts @@ -16,34 +16,76 @@ import { export type SubscriberResponseDto = { /** - * The internal id novu generated for your subscriber, this is not the subscriberId matching your query. See `subscriberId` for that + * The internal ID generated by Novu for your subscriber. This ID does not match the `subscriberId` used in your queries. Refer to `subscriberId` for that identifier. */ id?: string | undefined; + /** + * The first name of the subscriber. + */ firstName?: string | undefined; + /** + * The last name of the subscriber. + */ lastName?: string | undefined; + /** + * The email address of the subscriber. + */ email?: string | undefined; + /** + * The phone number of the subscriber. + */ phone?: string | undefined; + /** + * The URL of the subscriber's avatar image. + */ avatar?: string | undefined; + /** + * The locale setting of the subscriber, indicating their preferred language or region. + */ locale?: string | undefined; /** - * The internal identifier you used to create this subscriber, usually correlates to the id the user in your systems + * The identifier used to create this subscriber, which typically corresponds to the user ID in your system. */ subscriberId: string; /** - * Channels settings for subscriber + * An array of channel settings associated with the subscriber. */ channels?: Array | undefined; /** - * Topics that subscriber belongs to + * An array of topics that the subscriber is subscribed to. */ topics?: Array | undefined; + /** + * Indicates whether the subscriber is currently online. + */ isOnline?: boolean | undefined; + /** + * The timestamp indicating when the subscriber was last online, in ISO 8601 format. + */ lastOnlineAt?: string | undefined; + /** + * The unique identifier of the organization to which the subscriber belongs. + */ organizationId: string; + /** + * The unique identifier of the environment associated with this subscriber. + */ environmentId: string; + /** + * Indicates whether the subscriber has been deleted. + */ deleted: boolean; + /** + * The timestamp indicating when the subscriber was created, in ISO 8601 format. + */ createdAt: string; + /** + * The timestamp indicating when the subscriber was last updated, in ISO 8601 format. + */ updatedAt: string; + /** + * The version of the subscriber document. + */ v?: number | undefined; }; diff --git a/src/models/components/triggereventrequestdto.ts b/src/models/components/triggereventrequestdto.ts index 984bbc3a..ee147195 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 TriggerEventRequestDtoActor = SubscriberPayloadDto | string; +export type Actor = SubscriberPayloadDto | string; /** * It is used to specify a tenant context during trigger event. @@ -149,54 +149,43 @@ export function toFromJSON( } /** @internal */ -export const TriggerEventRequestDtoActor$inboundSchema: z.ZodType< - TriggerEventRequestDtoActor, - z.ZodTypeDef, - unknown -> = z.union([SubscriberPayloadDto$inboundSchema, z.string()]); +export const Actor$inboundSchema: z.ZodType = z + .union([SubscriberPayloadDto$inboundSchema, z.string()]); /** @internal */ -export type TriggerEventRequestDtoActor$Outbound = - | SubscriberPayloadDto$Outbound - | string; +export type Actor$Outbound = SubscriberPayloadDto$Outbound | string; /** @internal */ -export const TriggerEventRequestDtoActor$outboundSchema: z.ZodType< - TriggerEventRequestDtoActor$Outbound, +export const Actor$outboundSchema: z.ZodType< + Actor$Outbound, z.ZodTypeDef, - TriggerEventRequestDtoActor + Actor > = 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 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 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 triggerEventRequestDtoActorToJSON( - triggerEventRequestDtoActor: TriggerEventRequestDtoActor, -): string { - return JSON.stringify( - TriggerEventRequestDtoActor$outboundSchema.parse( - triggerEventRequestDtoActor, - ), - ); +export function actorToJSON(actor: Actor): string { + return JSON.stringify(Actor$outboundSchema.parse(actor)); } -export function triggerEventRequestDtoActorFromJSON( +export function actorFromJSON( jsonString: string, -): SafeParseResult { +): SafeParseResult { return safeParse( jsonString, - (x) => TriggerEventRequestDtoActor$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'TriggerEventRequestDtoActor' from JSON`, + (x) => Actor$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Actor' from JSON`, ); } diff --git a/src/models/operations/messagescontrollergetmessages.ts b/src/models/operations/messagescontrollergetmessages.ts index f24bc0c6..ce910eb8 100644 --- a/src/models/operations/messagescontrollergetmessages.ts +++ b/src/models/operations/messagescontrollergetmessages.ts @@ -10,6 +10,9 @@ import * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type MessagesControllerGetMessagesRequest = { + /** + * The channel through which the notification is sent. + */ channel?: components.ChannelTypeEnum | undefined; subscriberId?: string | undefined; transactionId?: Array | undefined;