@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.
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/models/components/buttontypeenum.d.ts +34 -0
- package/models/components/buttontypeenum.d.ts.map +1 -0
- package/models/components/buttontypeenum.js +53 -0
- package/models/components/buttontypeenum.js.map +1 -0
- package/models/components/channelctatypeenum.d.ts +31 -0
- package/models/components/channelctatypeenum.d.ts.map +1 -0
- package/models/components/channelctatypeenum.js +52 -0
- package/models/components/channelctatypeenum.js.map +1 -0
- package/models/components/channeltypeenum.d.ts +2 -2
- package/models/components/channeltypeenum.js +1 -1
- package/models/components/emailblock.d.ts +14 -27
- package/models/components/emailblock.d.ts.map +1 -1
- package/models/components/emailblock.js +4 -22
- package/models/components/emailblock.js.map +1 -1
- package/models/components/emailblockstyles.d.ts +5 -30
- package/models/components/emailblockstyles.d.ts.map +1 -1
- package/models/components/emailblockstyles.js +4 -24
- package/models/components/emailblockstyles.js.map +1 -1
- package/models/components/emailblocktypeenum.d.ts +34 -0
- package/models/components/emailblocktypeenum.d.ts.map +1 -0
- package/models/components/emailblocktypeenum.js +53 -0
- package/models/components/emailblocktypeenum.js.map +1 -0
- package/models/components/index.d.ts +7 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +7 -0
- package/models/components/index.js.map +1 -1
- package/models/components/messageaction.d.ts +11 -27
- package/models/components/messageaction.d.ts.map +1 -1
- package/models/components/messageaction.js +4 -22
- package/models/components/messageaction.js.map +1 -1
- package/models/components/messageactionresult.d.ts +11 -27
- package/models/components/messageactionresult.d.ts.map +1 -1
- package/models/components/messageactionresult.js +4 -22
- package/models/components/messageactionresult.js.map +1 -1
- package/models/components/messageactionstatusenum.d.ts +34 -0
- package/models/components/messageactionstatusenum.d.ts.map +1 -0
- package/models/components/messageactionstatusenum.js +53 -0
- package/models/components/messageactionstatusenum.js.map +1 -0
- package/models/components/messagebutton.d.ts +11 -27
- package/models/components/messagebutton.d.ts.map +1 -1
- package/models/components/messagebutton.js +4 -22
- package/models/components/messagebutton.js.map +1 -1
- package/models/components/messagecta.d.ts +11 -24
- package/models/components/messagecta.d.ts.map +1 -1
- package/models/components/messagecta.js +4 -21
- package/models/components/messagecta.js.map +1 -1
- package/models/components/messagectadata.d.ts +3 -0
- package/models/components/messagectadata.d.ts.map +1 -1
- package/models/components/messagectadata.js.map +1 -1
- package/models/components/messageresponsedto.d.ts +107 -96
- package/models/components/messageresponsedto.d.ts.map +1 -1
- package/models/components/messageresponsedto.js +18 -81
- package/models/components/messageresponsedto.js.map +1 -1
- package/models/components/messagestatusenum.d.ts +37 -0
- package/models/components/messagestatusenum.d.ts.map +1 -0
- package/models/components/messagestatusenum.js +54 -0
- package/models/components/messagestatusenum.js.map +1 -0
- package/models/components/notificationfeeditemdto.d.ts +1 -1
- package/models/components/textalignenum.d.ts +37 -0
- package/models/components/textalignenum.d.ts.map +1 -0
- package/models/components/textalignenum.js +54 -0
- package/models/components/textalignenum.js.map +1 -0
- package/models/components/updatesubscriberpreferenceglobalresponsedto.d.ts +33 -0
- package/models/components/updatesubscriberpreferenceglobalresponsedto.d.ts.map +1 -0
- package/models/components/updatesubscriberpreferenceglobalresponsedto.js +60 -0
- package/models/components/updatesubscriberpreferenceglobalresponsedto.js.map +1 -0
- package/models/operations/messagescontrollergetmessages.d.ts +1 -1
- package/models/operations/subscriberscontrollerupdatesubscriberglobalpreferences.d.ts +2 -2
- package/models/operations/subscriberscontrollerupdatesubscriberglobalpreferences.d.ts.map +1 -1
- package/models/operations/subscriberscontrollerupdatesubscriberglobalpreferences.js +2 -2
- package/models/operations/subscriberscontrollerupdatesubscriberglobalpreferences.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/config.ts +2 -2
- package/src/models/components/buttontypeenum.ts +39 -0
- package/src/models/components/channelctatypeenum.ts +38 -0
- package/src/models/components/channeltypeenum.ts +2 -2
- package/src/models/components/emailblock.ts +20 -31
- package/src/models/components/emailblockstyles.ts +11 -30
- package/src/models/components/emailblocktypeenum.ts +39 -0
- package/src/models/components/index.ts +7 -0
- package/src/models/components/messageaction.ts +17 -31
- package/src/models/components/messageactionresult.ts +17 -33
- package/src/models/components/messageactionstatusenum.ts +41 -0
- package/src/models/components/messagebutton.ts +17 -31
- package/src/models/components/messagecta.ts +17 -30
- package/src/models/components/messagectadata.ts +3 -0
- package/src/models/components/messageresponsedto.ts +130 -132
- package/src/models/components/messagestatusenum.ts +40 -0
- package/src/models/components/notificationfeeditemdto.ts +1 -1
- package/src/models/components/textalignenum.ts +40 -0
- package/src/models/components/updatesubscriberpreferenceglobalresponsedto.ts +88 -0
- package/src/models/operations/messagescontrollergetmessages.ts +1 -1
- 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
|
-
|
|
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
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
|
|
184
|
+
payload?: MessageResponseDtoPayload | undefined;
|
|
105
185
|
/**
|
|
106
186
|
* Provider specific overrides used when triggering the notification
|
|
107
187
|
*/
|
|
108
|
-
overrides
|
|
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:
|
|
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.
|
|
366
|
-
status:
|
|
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?:
|
|
409
|
+
_feedId?: string | null | undefined;
|
|
413
410
|
status: string;
|
|
414
|
-
errorId
|
|
415
|
-
errorText
|
|
416
|
-
payload
|
|
417
|
-
overrides
|
|
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:
|
|
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.
|
|
453
|
-
status:
|
|
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
|
+
}
|
|
@@ -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
|
-
*
|
|
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.
|
|
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:
|
|
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.
|
|
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:
|
|
138
|
+
result:
|
|
139
|
+
components.UpdateSubscriberPreferenceGlobalResponseDto$outboundSchema,
|
|
138
140
|
}).transform((v) => {
|
|
139
141
|
return remap$(v, {
|
|
140
142
|
headers: "Headers",
|