@novu/api 0.0.1-alpha.142 → 0.0.1-alpha.145

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/lib/config.d.ts +2 -2
  2. package/lib/config.js +2 -2
  3. package/models/components/buttontypeenum.d.ts +34 -0
  4. package/models/components/buttontypeenum.d.ts.map +1 -0
  5. package/models/components/buttontypeenum.js +53 -0
  6. package/models/components/buttontypeenum.js.map +1 -0
  7. package/models/components/channelctatypeenum.d.ts +31 -0
  8. package/models/components/channelctatypeenum.d.ts.map +1 -0
  9. package/models/components/channelctatypeenum.js +52 -0
  10. package/models/components/channelctatypeenum.js.map +1 -0
  11. package/models/components/channeltypeenum.d.ts +2 -2
  12. package/models/components/channeltypeenum.js +1 -1
  13. package/models/components/emailblock.d.ts +14 -27
  14. package/models/components/emailblock.d.ts.map +1 -1
  15. package/models/components/emailblock.js +4 -22
  16. package/models/components/emailblock.js.map +1 -1
  17. package/models/components/emailblockstyles.d.ts +5 -30
  18. package/models/components/emailblockstyles.d.ts.map +1 -1
  19. package/models/components/emailblockstyles.js +4 -24
  20. package/models/components/emailblockstyles.js.map +1 -1
  21. package/models/components/emailblocktypeenum.d.ts +34 -0
  22. package/models/components/emailblocktypeenum.d.ts.map +1 -0
  23. package/models/components/emailblocktypeenum.js +53 -0
  24. package/models/components/emailblocktypeenum.js.map +1 -0
  25. package/models/components/index.d.ts +7 -0
  26. package/models/components/index.d.ts.map +1 -1
  27. package/models/components/index.js +7 -0
  28. package/models/components/index.js.map +1 -1
  29. package/models/components/messageaction.d.ts +11 -27
  30. package/models/components/messageaction.d.ts.map +1 -1
  31. package/models/components/messageaction.js +4 -22
  32. package/models/components/messageaction.js.map +1 -1
  33. package/models/components/messageactionresult.d.ts +11 -27
  34. package/models/components/messageactionresult.d.ts.map +1 -1
  35. package/models/components/messageactionresult.js +4 -22
  36. package/models/components/messageactionresult.js.map +1 -1
  37. package/models/components/messageactionstatusenum.d.ts +34 -0
  38. package/models/components/messageactionstatusenum.d.ts.map +1 -0
  39. package/models/components/messageactionstatusenum.js +53 -0
  40. package/models/components/messageactionstatusenum.js.map +1 -0
  41. package/models/components/messagebutton.d.ts +11 -27
  42. package/models/components/messagebutton.d.ts.map +1 -1
  43. package/models/components/messagebutton.js +4 -22
  44. package/models/components/messagebutton.js.map +1 -1
  45. package/models/components/messagecta.d.ts +11 -24
  46. package/models/components/messagecta.d.ts.map +1 -1
  47. package/models/components/messagecta.js +4 -21
  48. package/models/components/messagecta.js.map +1 -1
  49. package/models/components/messagectadata.d.ts +3 -0
  50. package/models/components/messagectadata.d.ts.map +1 -1
  51. package/models/components/messagectadata.js.map +1 -1
  52. package/models/components/messageresponsedto.d.ts +107 -96
  53. package/models/components/messageresponsedto.d.ts.map +1 -1
  54. package/models/components/messageresponsedto.js +18 -81
  55. package/models/components/messageresponsedto.js.map +1 -1
  56. package/models/components/messagestatusenum.d.ts +37 -0
  57. package/models/components/messagestatusenum.d.ts.map +1 -0
  58. package/models/components/messagestatusenum.js +54 -0
  59. package/models/components/messagestatusenum.js.map +1 -0
  60. package/models/components/notificationfeeditemdto.d.ts +1 -1
  61. package/models/components/textalignenum.d.ts +37 -0
  62. package/models/components/textalignenum.d.ts.map +1 -0
  63. package/models/components/textalignenum.js +54 -0
  64. package/models/components/textalignenum.js.map +1 -0
  65. package/models/components/updatesubscriberpreferenceglobalresponsedto.d.ts +33 -0
  66. package/models/components/updatesubscriberpreferenceglobalresponsedto.d.ts.map +1 -0
  67. package/models/components/updatesubscriberpreferenceglobalresponsedto.js +60 -0
  68. package/models/components/updatesubscriberpreferenceglobalresponsedto.js.map +1 -0
  69. package/models/operations/messagescontrollergetmessages.d.ts +1 -1
  70. package/models/operations/subscriberscontrollerupdatesubscriberglobalpreferences.d.ts +2 -2
  71. package/models/operations/subscriberscontrollerupdatesubscriberglobalpreferences.d.ts.map +1 -1
  72. package/models/operations/subscriberscontrollerupdatesubscriberglobalpreferences.js +2 -2
  73. package/models/operations/subscriberscontrollerupdatesubscriberglobalpreferences.js.map +1 -1
  74. package/package.json +1 -1
  75. package/src/lib/config.ts +2 -2
  76. package/src/models/components/buttontypeenum.ts +39 -0
  77. package/src/models/components/channelctatypeenum.ts +38 -0
  78. package/src/models/components/channeltypeenum.ts +2 -2
  79. package/src/models/components/emailblock.ts +20 -31
  80. package/src/models/components/emailblockstyles.ts +11 -30
  81. package/src/models/components/emailblocktypeenum.ts +39 -0
  82. package/src/models/components/index.ts +7 -0
  83. package/src/models/components/messageaction.ts +17 -31
  84. package/src/models/components/messageactionresult.ts +17 -33
  85. package/src/models/components/messageactionstatusenum.ts +41 -0
  86. package/src/models/components/messagebutton.ts +17 -31
  87. package/src/models/components/messagecta.ts +17 -30
  88. package/src/models/components/messagectadata.ts +3 -0
  89. package/src/models/components/messageresponsedto.ts +130 -132
  90. package/src/models/components/messagestatusenum.ts +40 -0
  91. package/src/models/components/notificationfeeditemdto.ts +1 -1
  92. package/src/models/components/textalignenum.ts +40 -0
  93. package/src/models/components/updatesubscriberpreferenceglobalresponsedto.ts +88 -0
  94. package/src/models/operations/messagescontrollergetmessages.ts +1 -1
  95. package/src/models/operations/subscriberscontrollerupdatesubscriberglobalpreferences.ts +6 -4
@@ -5,9 +5,13 @@
5
5
  import * as z from "zod";
6
6
  import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
- import { ClosedEnum } from "../../types/enums.js";
9
8
  import { Result as SafeParseResult } from "../../types/fp.js";
10
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import {
11
+ ChannelTypeEnum,
12
+ ChannelTypeEnum$inboundSchema,
13
+ ChannelTypeEnum$outboundSchema,
14
+ } from "./channeltypeenum.js";
11
15
  import {
12
16
  EmailBlock,
13
17
  EmailBlock$inboundSchema,
@@ -20,6 +24,11 @@ import {
20
24
  MessageCTA$Outbound,
21
25
  MessageCTA$outboundSchema,
22
26
  } from "./messagecta.js";
27
+ import {
28
+ MessageStatusEnum,
29
+ MessageStatusEnum$inboundSchema,
30
+ MessageStatusEnum$outboundSchema,
31
+ } from "./messagestatusenum.js";
23
32
  import {
24
33
  SubscriberResponseDto,
25
34
  SubscriberResponseDto$inboundSchema,
@@ -33,30 +42,11 @@ import {
33
42
  WorkflowResponse$outboundSchema,
34
43
  } from "./workflowresponse.js";
35
44
 
45
+ /**
46
+ * Content of the message, can be an email block or a string
47
+ */
36
48
  export type Content = EmailBlock | string;
37
49
 
38
- export const MessageResponseDtoChannel = {
39
- InApp: "in_app",
40
- Email: "email",
41
- Sms: "sms",
42
- Chat: "chat",
43
- Push: "push",
44
- } as const;
45
- export type MessageResponseDtoChannel = ClosedEnum<
46
- typeof MessageResponseDtoChannel
47
- >;
48
-
49
- export type FeedId = {};
50
-
51
- export const MessageResponseDtoStatus = {
52
- Sent: "sent",
53
- Error: "error",
54
- Warning: "warning",
55
- } as const;
56
- export type MessageResponseDtoStatus = ClosedEnum<
57
- typeof MessageResponseDtoStatus
58
- >;
59
-
60
50
  /**
61
51
  * The payload that was used to send the notification trigger
62
52
  */
@@ -68,44 +58,134 @@ export type MessageResponseDtoPayload = {};
68
58
  export type MessageResponseDtoOverrides = {};
69
59
 
70
60
  export type MessageResponseDto = {
61
+ /**
62
+ * Unique identifier for the message
63
+ */
71
64
  id?: string | undefined;
65
+ /**
66
+ * Template ID associated with the message
67
+ */
72
68
  templateId: string;
69
+ /**
70
+ * Environment ID where the message is sent
71
+ */
73
72
  environmentId: string;
73
+ /**
74
+ * Message template ID
75
+ */
74
76
  messageTemplateId: string;
77
+ /**
78
+ * Organization ID associated with the message
79
+ */
75
80
  organizationId: string;
81
+ /**
82
+ * Notification ID associated with the message
83
+ */
76
84
  notificationId: string;
85
+ /**
86
+ * Subscriber ID associated with the message
87
+ */
77
88
  subscriberId: string;
89
+ /**
90
+ * Subscriber details, if available
91
+ */
78
92
  subscriber?: SubscriberResponseDto | undefined;
93
+ /**
94
+ * Workflow template associated with the message
95
+ */
79
96
  template?: WorkflowResponse | undefined;
97
+ /**
98
+ * Identifier for the message template
99
+ */
80
100
  templateIdentifier?: string | undefined;
101
+ /**
102
+ * Creation date of the message
103
+ */
81
104
  createdAt: string;
105
+ /**
106
+ * Last seen date of the message, if available
107
+ */
82
108
  lastSeenDate?: string | undefined;
109
+ /**
110
+ * Last read date of the message, if available
111
+ */
83
112
  lastReadDate?: string | undefined;
113
+ /**
114
+ * Content of the message, can be an email block or a string
115
+ */
84
116
  content: EmailBlock | string;
117
+ /**
118
+ * Transaction ID associated with the message
119
+ */
85
120
  transactionId: string;
121
+ /**
122
+ * Subject of the message, if applicable
123
+ */
86
124
  subject?: string | undefined;
87
- channel: MessageResponseDtoChannel;
125
+ /**
126
+ * Channel type through which the message is sent
127
+ */
128
+ channel: ChannelTypeEnum;
129
+ /**
130
+ * Indicates if the message has been read
131
+ */
88
132
  read: boolean;
133
+ /**
134
+ * Indicates if the message has been seen
135
+ */
89
136
  seen: boolean;
137
+ /**
138
+ * Email address associated with the message, if applicable
139
+ */
90
140
  email?: string | undefined;
141
+ /**
142
+ * Phone number associated with the message, if applicable
143
+ */
91
144
  phone?: string | undefined;
145
+ /**
146
+ * Direct webhook URL for the message, if applicable
147
+ */
92
148
  directWebhookUrl?: string | undefined;
149
+ /**
150
+ * Provider ID associated with the message, if applicable
151
+ */
93
152
  providerId?: string | undefined;
153
+ /**
154
+ * Device tokens associated with the message, if applicable
155
+ */
94
156
  deviceTokens?: Array<string> | undefined;
157
+ /**
158
+ * Title of the message, if applicable
159
+ */
95
160
  title?: string | undefined;
161
+ /**
162
+ * Call to action associated with the message
163
+ */
96
164
  cta: MessageCTA;
97
- feedId?: FeedId | null | undefined;
98
- status: MessageResponseDtoStatus;
99
- errorId: string;
100
- errorText: string;
165
+ /**
166
+ * Feed ID associated with the message, if applicable
167
+ */
168
+ feedId?: string | null | undefined;
169
+ /**
170
+ * Status of the message
171
+ */
172
+ status: MessageStatusEnum;
173
+ /**
174
+ * Error ID if the message has an error
175
+ */
176
+ errorId?: string | undefined;
177
+ /**
178
+ * Error text if the message has an error
179
+ */
180
+ errorText?: string | undefined;
101
181
  /**
102
182
  * The payload that was used to send the notification trigger
103
183
  */
104
- payload: MessageResponseDtoPayload;
184
+ payload?: MessageResponseDtoPayload | undefined;
105
185
  /**
106
186
  * Provider specific overrides used when triggering the notification
107
187
  */
108
- overrides: MessageResponseDtoOverrides;
188
+ overrides?: MessageResponseDtoOverrides | undefined;
109
189
  };
110
190
 
111
191
  /** @internal */
@@ -149,89 +229,6 @@ export function contentFromJSON(
149
229
  );
150
230
  }
151
231
 
152
- /** @internal */
153
- export const MessageResponseDtoChannel$inboundSchema: z.ZodNativeEnum<
154
- typeof MessageResponseDtoChannel
155
- > = z.nativeEnum(MessageResponseDtoChannel);
156
-
157
- /** @internal */
158
- export const MessageResponseDtoChannel$outboundSchema: z.ZodNativeEnum<
159
- typeof MessageResponseDtoChannel
160
- > = MessageResponseDtoChannel$inboundSchema;
161
-
162
- /**
163
- * @internal
164
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
165
- */
166
- export namespace MessageResponseDtoChannel$ {
167
- /** @deprecated use `MessageResponseDtoChannel$inboundSchema` instead. */
168
- export const inboundSchema = MessageResponseDtoChannel$inboundSchema;
169
- /** @deprecated use `MessageResponseDtoChannel$outboundSchema` instead. */
170
- export const outboundSchema = MessageResponseDtoChannel$outboundSchema;
171
- }
172
-
173
- /** @internal */
174
- export const FeedId$inboundSchema: z.ZodType<FeedId, z.ZodTypeDef, unknown> = z
175
- .object({});
176
-
177
- /** @internal */
178
- export type FeedId$Outbound = {};
179
-
180
- /** @internal */
181
- export const FeedId$outboundSchema: z.ZodType<
182
- FeedId$Outbound,
183
- z.ZodTypeDef,
184
- FeedId
185
- > = z.object({});
186
-
187
- /**
188
- * @internal
189
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
190
- */
191
- export namespace FeedId$ {
192
- /** @deprecated use `FeedId$inboundSchema` instead. */
193
- export const inboundSchema = FeedId$inboundSchema;
194
- /** @deprecated use `FeedId$outboundSchema` instead. */
195
- export const outboundSchema = FeedId$outboundSchema;
196
- /** @deprecated use `FeedId$Outbound` instead. */
197
- export type Outbound = FeedId$Outbound;
198
- }
199
-
200
- export function feedIdToJSON(feedId: FeedId): string {
201
- return JSON.stringify(FeedId$outboundSchema.parse(feedId));
202
- }
203
-
204
- export function feedIdFromJSON(
205
- jsonString: string,
206
- ): SafeParseResult<FeedId, SDKValidationError> {
207
- return safeParse(
208
- jsonString,
209
- (x) => FeedId$inboundSchema.parse(JSON.parse(x)),
210
- `Failed to parse 'FeedId' from JSON`,
211
- );
212
- }
213
-
214
- /** @internal */
215
- export const MessageResponseDtoStatus$inboundSchema: z.ZodNativeEnum<
216
- typeof MessageResponseDtoStatus
217
- > = z.nativeEnum(MessageResponseDtoStatus);
218
-
219
- /** @internal */
220
- export const MessageResponseDtoStatus$outboundSchema: z.ZodNativeEnum<
221
- typeof MessageResponseDtoStatus
222
- > = MessageResponseDtoStatus$inboundSchema;
223
-
224
- /**
225
- * @internal
226
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
227
- */
228
- export namespace MessageResponseDtoStatus$ {
229
- /** @deprecated use `MessageResponseDtoStatus$inboundSchema` instead. */
230
- export const inboundSchema = MessageResponseDtoStatus$inboundSchema;
231
- /** @deprecated use `MessageResponseDtoStatus$outboundSchema` instead. */
232
- export const outboundSchema = MessageResponseDtoStatus$outboundSchema;
233
- }
234
-
235
232
  /** @internal */
236
233
  export const MessageResponseDtoPayload$inboundSchema: z.ZodType<
237
234
  MessageResponseDtoPayload,
@@ -352,7 +349,7 @@ export const MessageResponseDto$inboundSchema: z.ZodType<
352
349
  content: z.union([EmailBlock$inboundSchema, z.string()]),
353
350
  transactionId: z.string(),
354
351
  subject: z.string().optional(),
355
- channel: MessageResponseDtoChannel$inboundSchema,
352
+ channel: ChannelTypeEnum$inboundSchema,
356
353
  read: z.boolean(),
357
354
  seen: z.boolean(),
358
355
  email: z.string().optional(),
@@ -362,12 +359,12 @@ export const MessageResponseDto$inboundSchema: z.ZodType<
362
359
  deviceTokens: z.array(z.string()).optional(),
363
360
  title: z.string().optional(),
364
361
  cta: MessageCTA$inboundSchema,
365
- _feedId: z.nullable(z.lazy(() => FeedId$inboundSchema)).optional(),
366
- status: MessageResponseDtoStatus$inboundSchema,
367
- errorId: z.string(),
368
- errorText: z.string(),
369
- payload: z.lazy(() => MessageResponseDtoPayload$inboundSchema),
370
- overrides: z.lazy(() => MessageResponseDtoOverrides$inboundSchema),
362
+ _feedId: z.nullable(z.string()).optional(),
363
+ status: MessageStatusEnum$inboundSchema,
364
+ errorId: z.string().optional(),
365
+ errorText: z.string().optional(),
366
+ payload: z.lazy(() => MessageResponseDtoPayload$inboundSchema).optional(),
367
+ overrides: z.lazy(() => MessageResponseDtoOverrides$inboundSchema).optional(),
371
368
  }).transform((v) => {
372
369
  return remap$(v, {
373
370
  "_id": "id",
@@ -409,12 +406,12 @@ export type MessageResponseDto$Outbound = {
409
406
  deviceTokens?: Array<string> | undefined;
410
407
  title?: string | undefined;
411
408
  cta: MessageCTA$Outbound;
412
- _feedId?: FeedId$Outbound | null | undefined;
409
+ _feedId?: string | null | undefined;
413
410
  status: string;
414
- errorId: string;
415
- errorText: string;
416
- payload: MessageResponseDtoPayload$Outbound;
417
- overrides: MessageResponseDtoOverrides$Outbound;
411
+ errorId?: string | undefined;
412
+ errorText?: string | undefined;
413
+ payload?: MessageResponseDtoPayload$Outbound | undefined;
414
+ overrides?: MessageResponseDtoOverrides$Outbound | undefined;
418
415
  };
419
416
 
420
417
  /** @internal */
@@ -439,7 +436,7 @@ export const MessageResponseDto$outboundSchema: z.ZodType<
439
436
  content: z.union([EmailBlock$outboundSchema, z.string()]),
440
437
  transactionId: z.string(),
441
438
  subject: z.string().optional(),
442
- channel: MessageResponseDtoChannel$outboundSchema,
439
+ channel: ChannelTypeEnum$outboundSchema,
443
440
  read: z.boolean(),
444
441
  seen: z.boolean(),
445
442
  email: z.string().optional(),
@@ -449,12 +446,13 @@ export const MessageResponseDto$outboundSchema: z.ZodType<
449
446
  deviceTokens: z.array(z.string()).optional(),
450
447
  title: z.string().optional(),
451
448
  cta: MessageCTA$outboundSchema,
452
- feedId: z.nullable(z.lazy(() => FeedId$outboundSchema)).optional(),
453
- status: MessageResponseDtoStatus$outboundSchema,
454
- errorId: z.string(),
455
- errorText: z.string(),
456
- payload: z.lazy(() => MessageResponseDtoPayload$outboundSchema),
457
- overrides: z.lazy(() => MessageResponseDtoOverrides$outboundSchema),
449
+ feedId: z.nullable(z.string()).optional(),
450
+ status: MessageStatusEnum$outboundSchema,
451
+ errorId: z.string().optional(),
452
+ errorText: z.string().optional(),
453
+ payload: z.lazy(() => MessageResponseDtoPayload$outboundSchema).optional(),
454
+ overrides: z.lazy(() => MessageResponseDtoOverrides$outboundSchema)
455
+ .optional(),
458
456
  }).transform((v) => {
459
457
  return remap$(v, {
460
458
  id: "_id",
@@ -0,0 +1,40 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { ClosedEnum } from "../../types/enums.js";
7
+
8
+ /**
9
+ * Status of the message
10
+ */
11
+ export const MessageStatusEnum = {
12
+ Sent: "sent",
13
+ Error: "error",
14
+ Warning: "warning",
15
+ } as const;
16
+ /**
17
+ * Status of the message
18
+ */
19
+ export type MessageStatusEnum = ClosedEnum<typeof MessageStatusEnum>;
20
+
21
+ /** @internal */
22
+ export const MessageStatusEnum$inboundSchema: z.ZodNativeEnum<
23
+ typeof MessageStatusEnum
24
+ > = z.nativeEnum(MessageStatusEnum);
25
+
26
+ /** @internal */
27
+ export const MessageStatusEnum$outboundSchema: z.ZodNativeEnum<
28
+ typeof MessageStatusEnum
29
+ > = MessageStatusEnum$inboundSchema;
30
+
31
+ /**
32
+ * @internal
33
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
34
+ */
35
+ export namespace MessageStatusEnum$ {
36
+ /** @deprecated use `MessageStatusEnum$inboundSchema` instead. */
37
+ export const inboundSchema = MessageStatusEnum$inboundSchema;
38
+ /** @deprecated use `MessageStatusEnum$outboundSchema` instead. */
39
+ export const outboundSchema = MessageStatusEnum$outboundSchema;
40
+ }
@@ -121,7 +121,7 @@ export type NotificationFeedItemDto = {
121
121
  */
122
122
  subject?: string | null | undefined;
123
123
  /**
124
- * The channel through which the notification is sent.
124
+ * Channel type through which the message is sent
125
125
  */
126
126
  channel: ChannelTypeEnum;
127
127
  /**
@@ -0,0 +1,40 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { ClosedEnum } from "../../types/enums.js";
7
+
8
+ /**
9
+ * Text alignment for the email block
10
+ */
11
+ export const TextAlignEnum = {
12
+ Center: "center",
13
+ Left: "left",
14
+ Right: "right",
15
+ } as const;
16
+ /**
17
+ * Text alignment for the email block
18
+ */
19
+ export type TextAlignEnum = ClosedEnum<typeof TextAlignEnum>;
20
+
21
+ /** @internal */
22
+ export const TextAlignEnum$inboundSchema: z.ZodNativeEnum<
23
+ typeof TextAlignEnum
24
+ > = z.nativeEnum(TextAlignEnum);
25
+
26
+ /** @internal */
27
+ export const TextAlignEnum$outboundSchema: z.ZodNativeEnum<
28
+ typeof TextAlignEnum
29
+ > = TextAlignEnum$inboundSchema;
30
+
31
+ /**
32
+ * @internal
33
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
34
+ */
35
+ export namespace TextAlignEnum$ {
36
+ /** @deprecated use `TextAlignEnum$inboundSchema` instead. */
37
+ export const inboundSchema = TextAlignEnum$inboundSchema;
38
+ /** @deprecated use `TextAlignEnum$outboundSchema` instead. */
39
+ export const outboundSchema = TextAlignEnum$outboundSchema;
40
+ }
@@ -0,0 +1,88 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+ import {
10
+ Preference,
11
+ Preference$inboundSchema,
12
+ Preference$Outbound,
13
+ Preference$outboundSchema,
14
+ } from "./preference.js";
15
+
16
+ export type UpdateSubscriberPreferenceGlobalResponseDto = {
17
+ /**
18
+ * The preferences of the subscriber regarding the related workflow
19
+ */
20
+ preference: Preference;
21
+ };
22
+
23
+ /** @internal */
24
+ export const UpdateSubscriberPreferenceGlobalResponseDto$inboundSchema:
25
+ z.ZodType<
26
+ UpdateSubscriberPreferenceGlobalResponseDto,
27
+ z.ZodTypeDef,
28
+ unknown
29
+ > = z.object({
30
+ preference: Preference$inboundSchema,
31
+ });
32
+
33
+ /** @internal */
34
+ export type UpdateSubscriberPreferenceGlobalResponseDto$Outbound = {
35
+ preference: Preference$Outbound;
36
+ };
37
+
38
+ /** @internal */
39
+ export const UpdateSubscriberPreferenceGlobalResponseDto$outboundSchema:
40
+ z.ZodType<
41
+ UpdateSubscriberPreferenceGlobalResponseDto$Outbound,
42
+ z.ZodTypeDef,
43
+ UpdateSubscriberPreferenceGlobalResponseDto
44
+ > = z.object({
45
+ preference: Preference$outboundSchema,
46
+ });
47
+
48
+ /**
49
+ * @internal
50
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
51
+ */
52
+ export namespace UpdateSubscriberPreferenceGlobalResponseDto$ {
53
+ /** @deprecated use `UpdateSubscriberPreferenceGlobalResponseDto$inboundSchema` instead. */
54
+ export const inboundSchema =
55
+ UpdateSubscriberPreferenceGlobalResponseDto$inboundSchema;
56
+ /** @deprecated use `UpdateSubscriberPreferenceGlobalResponseDto$outboundSchema` instead. */
57
+ export const outboundSchema =
58
+ UpdateSubscriberPreferenceGlobalResponseDto$outboundSchema;
59
+ /** @deprecated use `UpdateSubscriberPreferenceGlobalResponseDto$Outbound` instead. */
60
+ export type Outbound = UpdateSubscriberPreferenceGlobalResponseDto$Outbound;
61
+ }
62
+
63
+ export function updateSubscriberPreferenceGlobalResponseDtoToJSON(
64
+ updateSubscriberPreferenceGlobalResponseDto:
65
+ UpdateSubscriberPreferenceGlobalResponseDto,
66
+ ): string {
67
+ return JSON.stringify(
68
+ UpdateSubscriberPreferenceGlobalResponseDto$outboundSchema.parse(
69
+ updateSubscriberPreferenceGlobalResponseDto,
70
+ ),
71
+ );
72
+ }
73
+
74
+ export function updateSubscriberPreferenceGlobalResponseDtoFromJSON(
75
+ jsonString: string,
76
+ ): SafeParseResult<
77
+ UpdateSubscriberPreferenceGlobalResponseDto,
78
+ SDKValidationError
79
+ > {
80
+ return safeParse(
81
+ jsonString,
82
+ (x) =>
83
+ UpdateSubscriberPreferenceGlobalResponseDto$inboundSchema.parse(
84
+ JSON.parse(x),
85
+ ),
86
+ `Failed to parse 'UpdateSubscriberPreferenceGlobalResponseDto' from JSON`,
87
+ );
88
+ }
@@ -11,7 +11,7 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
11
 
12
12
  export type MessagesControllerGetMessagesRequest = {
13
13
  /**
14
- * The channel through which the notification is sent.
14
+ * Channel type through which the message is sent
15
15
  */
16
16
  channel?: components.ChannelTypeEnum | undefined;
17
17
  subscriberId?: string | undefined;
@@ -17,7 +17,7 @@ export type SubscribersControllerUpdateSubscriberGlobalPreferencesRequest = {
17
17
 
18
18
  export type SubscribersControllerUpdateSubscriberGlobalPreferencesResponse = {
19
19
  headers: { [k: string]: Array<string> };
20
- result: components.UpdateSubscriberPreferenceResponseDto;
20
+ result: components.UpdateSubscriberPreferenceGlobalResponseDto;
21
21
  };
22
22
 
23
23
  /** @internal */
@@ -111,7 +111,8 @@ export const SubscribersControllerUpdateSubscriberGlobalPreferencesResponse$inbo
111
111
  unknown
112
112
  > = z.object({
113
113
  Headers: z.record(z.array(z.string())),
114
- Result: components.UpdateSubscriberPreferenceResponseDto$inboundSchema,
114
+ Result:
115
+ components.UpdateSubscriberPreferenceGlobalResponseDto$inboundSchema,
115
116
  }).transform((v) => {
116
117
  return remap$(v, {
117
118
  "Headers": "headers",
@@ -123,7 +124,7 @@ export const SubscribersControllerUpdateSubscriberGlobalPreferencesResponse$inbo
123
124
  export type SubscribersControllerUpdateSubscriberGlobalPreferencesResponse$Outbound =
124
125
  {
125
126
  Headers: { [k: string]: Array<string> };
126
- Result: components.UpdateSubscriberPreferenceResponseDto$Outbound;
127
+ Result: components.UpdateSubscriberPreferenceGlobalResponseDto$Outbound;
127
128
  };
128
129
 
129
130
  /** @internal */
@@ -134,7 +135,8 @@ export const SubscribersControllerUpdateSubscriberGlobalPreferencesResponse$outb
134
135
  SubscribersControllerUpdateSubscriberGlobalPreferencesResponse
135
136
  > = z.object({
136
137
  headers: z.record(z.array(z.string())),
137
- result: components.UpdateSubscriberPreferenceResponseDto$outboundSchema,
138
+ result:
139
+ components.UpdateSubscriberPreferenceGlobalResponseDto$outboundSchema,
138
140
  }).transform((v) => {
139
141
  return remap$(v, {
140
142
  headers: "Headers",