@novu/api 0.0.1-alpha.76 → 0.0.1-alpha.78
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 +3 -3
- package/lib/config.js +3 -3
- package/lib/config.js.map +1 -1
- package/models/components/actorfeeditemdto.d.ts +62 -0
- package/models/components/actorfeeditemdto.d.ts.map +1 -0
- package/models/components/actorfeeditemdto.js +85 -0
- package/models/components/actorfeeditemdto.js.map +1 -0
- package/models/components/channelsettings.d.ts +1 -1
- package/models/components/channeltypeenum.d.ts +6 -0
- package/models/components/channeltypeenum.d.ts.map +1 -1
- package/models/components/channeltypeenum.js +3 -0
- package/models/components/channeltypeenum.js.map +1 -1
- package/models/components/feedresponsedto.d.ts +5 -5
- package/models/components/feedresponsedto.d.ts.map +1 -1
- package/models/components/feedresponsedto.js +5 -5
- package/models/components/feedresponsedto.js.map +1 -1
- package/models/components/index.d.ts +3 -2
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +3 -2
- package/models/components/index.js.map +1 -1
- package/models/components/notificationfeeditemdto.d.ts +281 -0
- package/models/components/notificationfeeditemdto.d.ts.map +1 -0
- package/models/components/notificationfeeditemdto.js +233 -0
- package/models/components/notificationfeeditemdto.js.map +1 -0
- package/models/components/subscriberfeedresponsedto.d.ts +52 -0
- package/models/components/subscriberfeedresponsedto.d.ts.map +1 -0
- package/models/components/subscriberfeedresponsedto.js +76 -0
- package/models/components/subscriberfeedresponsedto.js.map +1 -0
- package/models/components/subscriberresponsedto.d.ts +46 -4
- package/models/components/subscriberresponsedto.d.ts.map +1 -1
- package/models/components/subscriberresponsedto.js.map +1 -1
- package/models/components/triggereventrequestdto.d.ts +13 -13
- package/models/components/triggereventrequestdto.d.ts.map +1 -1
- package/models/components/triggereventrequestdto.js +17 -16
- package/models/components/triggereventrequestdto.js.map +1 -1
- package/models/operations/messagescontrollergetmessages.d.ts +3 -0
- package/models/operations/messagescontrollergetmessages.d.ts.map +1 -1
- package/models/operations/messagescontrollergetmessages.js.map +1 -1
- package/models/operations/subscriberscontrollergetnotificationsfeed.d.ts +2 -42
- package/models/operations/subscriberscontrollergetnotificationsfeed.d.ts.map +1 -1
- package/models/operations/subscriberscontrollergetnotificationsfeed.js +3 -36
- package/models/operations/subscriberscontrollergetnotificationsfeed.js.map +1 -1
- package/package.json +1 -1
- package/src/lib/config.ts +3 -3
- package/src/models/components/actorfeeditemdto.ts +134 -0
- package/src/models/components/channelsettings.ts +1 -1
- package/src/models/components/channeltypeenum.ts +6 -0
- package/src/models/components/feedresponsedto.ts +13 -13
- package/src/models/components/index.ts +3 -2
- package/src/models/components/notificationfeeditemdto.ts +502 -0
- package/src/models/components/subscriberfeedresponsedto.ts +106 -0
- package/src/models/components/subscriberresponsedto.ts +46 -4
- package/src/models/components/triggereventrequestdto.ts +20 -31
- package/src/models/operations/messagescontrollergetmessages.ts +3 -0
- package/src/models/operations/subscriberscontrollergetnotificationsfeed.ts +4 -101
- package/models/components/actor.d.ts +0 -62
- package/models/components/actor.d.ts.map +0 -1
- package/models/components/actor.js +0 -86
- package/models/components/actor.js.map +0 -1
- package/models/components/notificationdto.d.ts +0 -248
- package/models/components/notificationdto.d.ts.map +0 -1
- package/models/components/notificationdto.js +0 -187
- package/models/components/notificationdto.js.map +0 -1
- package/src/models/components/actor.ts +0 -123
- package/src/models/components/notificationdto.ts +0 -367
|
@@ -0,0 +1,502 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
import {
|
|
12
|
+
ActorFeedItemDto,
|
|
13
|
+
ActorFeedItemDto$inboundSchema,
|
|
14
|
+
ActorFeedItemDto$Outbound,
|
|
15
|
+
ActorFeedItemDto$outboundSchema,
|
|
16
|
+
} from "./actorfeeditemdto.js";
|
|
17
|
+
import {
|
|
18
|
+
ChannelTypeEnum,
|
|
19
|
+
ChannelTypeEnum$inboundSchema,
|
|
20
|
+
ChannelTypeEnum$outboundSchema,
|
|
21
|
+
} from "./channeltypeenum.js";
|
|
22
|
+
import {
|
|
23
|
+
MessageCTA,
|
|
24
|
+
MessageCTA$inboundSchema,
|
|
25
|
+
MessageCTA$Outbound,
|
|
26
|
+
MessageCTA$outboundSchema,
|
|
27
|
+
} from "./messagecta.js";
|
|
28
|
+
import {
|
|
29
|
+
SubscriberFeedResponseDto,
|
|
30
|
+
SubscriberFeedResponseDto$inboundSchema,
|
|
31
|
+
SubscriberFeedResponseDto$Outbound,
|
|
32
|
+
SubscriberFeedResponseDto$outboundSchema,
|
|
33
|
+
} from "./subscriberfeedresponsedto.js";
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Identifier for the template used, if applicable.
|
|
37
|
+
*/
|
|
38
|
+
export type TemplateIdentifier = {};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Identifier for the provider that sends the notification.
|
|
42
|
+
*/
|
|
43
|
+
export type NotificationFeedItemDtoProviderId = {};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The subject line for email notifications, if applicable.
|
|
47
|
+
*/
|
|
48
|
+
export type Subject = {};
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Current status of the notification.
|
|
52
|
+
*/
|
|
53
|
+
export const NotificationFeedItemDtoStatus = {
|
|
54
|
+
Sent: "sent",
|
|
55
|
+
Error: "error",
|
|
56
|
+
Warning: "warning",
|
|
57
|
+
} as const;
|
|
58
|
+
/**
|
|
59
|
+
* Current status of the notification.
|
|
60
|
+
*/
|
|
61
|
+
export type NotificationFeedItemDtoStatus = ClosedEnum<
|
|
62
|
+
typeof NotificationFeedItemDtoStatus
|
|
63
|
+
>;
|
|
64
|
+
|
|
65
|
+
export type NotificationFeedItemDto = {
|
|
66
|
+
/**
|
|
67
|
+
* Unique identifier for the notification.
|
|
68
|
+
*/
|
|
69
|
+
id: string;
|
|
70
|
+
/**
|
|
71
|
+
* Identifier for the template used to generate the notification.
|
|
72
|
+
*/
|
|
73
|
+
templateId: string;
|
|
74
|
+
/**
|
|
75
|
+
* Identifier for the environment where the notification is sent.
|
|
76
|
+
*/
|
|
77
|
+
environmentId: string;
|
|
78
|
+
/**
|
|
79
|
+
* Identifier for the message template used.
|
|
80
|
+
*/
|
|
81
|
+
messageTemplateId: string;
|
|
82
|
+
/**
|
|
83
|
+
* Identifier for the organization sending the notification.
|
|
84
|
+
*/
|
|
85
|
+
organizationId: string;
|
|
86
|
+
/**
|
|
87
|
+
* Unique identifier for the notification instance.
|
|
88
|
+
*/
|
|
89
|
+
notificationId: string;
|
|
90
|
+
/**
|
|
91
|
+
* Unique identifier for the subscriber receiving the notification.
|
|
92
|
+
*/
|
|
93
|
+
subscriberId: string;
|
|
94
|
+
/**
|
|
95
|
+
* Identifier for the feed associated with the notification.
|
|
96
|
+
*/
|
|
97
|
+
feedId: string;
|
|
98
|
+
/**
|
|
99
|
+
* Identifier for the job that triggered the notification.
|
|
100
|
+
*/
|
|
101
|
+
jobId: string;
|
|
102
|
+
/**
|
|
103
|
+
* Timestamp indicating when the notification was created.
|
|
104
|
+
*/
|
|
105
|
+
createdAt?: Date | null | undefined;
|
|
106
|
+
/**
|
|
107
|
+
* Timestamp indicating when the notification was last updated.
|
|
108
|
+
*/
|
|
109
|
+
updatedAt?: Date | null | undefined;
|
|
110
|
+
/**
|
|
111
|
+
* Actor details related to the notification, if applicable.
|
|
112
|
+
*/
|
|
113
|
+
actor?: ActorFeedItemDto | undefined;
|
|
114
|
+
/**
|
|
115
|
+
* Subscriber details associated with this notification.
|
|
116
|
+
*/
|
|
117
|
+
subscriber?: SubscriberFeedResponseDto | undefined;
|
|
118
|
+
/**
|
|
119
|
+
* Unique identifier for the transaction associated with the notification.
|
|
120
|
+
*/
|
|
121
|
+
transactionId: string;
|
|
122
|
+
/**
|
|
123
|
+
* Identifier for the template used, if applicable.
|
|
124
|
+
*/
|
|
125
|
+
templateIdentifier?: TemplateIdentifier | null | undefined;
|
|
126
|
+
/**
|
|
127
|
+
* Identifier for the provider that sends the notification.
|
|
128
|
+
*/
|
|
129
|
+
providerId?: NotificationFeedItemDtoProviderId | null | undefined;
|
|
130
|
+
/**
|
|
131
|
+
* The main content of the notification.
|
|
132
|
+
*/
|
|
133
|
+
content: string;
|
|
134
|
+
/**
|
|
135
|
+
* The subject line for email notifications, if applicable.
|
|
136
|
+
*/
|
|
137
|
+
subject?: Subject | null | undefined;
|
|
138
|
+
/**
|
|
139
|
+
* The channel through which the notification is sent.
|
|
140
|
+
*/
|
|
141
|
+
channel: ChannelTypeEnum;
|
|
142
|
+
/**
|
|
143
|
+
* Indicates whether the notification has been read by the subscriber.
|
|
144
|
+
*/
|
|
145
|
+
read: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* Indicates whether the notification has been seen by the subscriber.
|
|
148
|
+
*/
|
|
149
|
+
seen: boolean;
|
|
150
|
+
/**
|
|
151
|
+
* Indicates whether the notification has been deleted.
|
|
152
|
+
*/
|
|
153
|
+
deleted: boolean;
|
|
154
|
+
/**
|
|
155
|
+
* Device tokens for push notifications, if applicable.
|
|
156
|
+
*/
|
|
157
|
+
deviceTokens?: Array<string> | null | undefined;
|
|
158
|
+
/**
|
|
159
|
+
* Call-to-action information associated with the notification.
|
|
160
|
+
*/
|
|
161
|
+
cta: MessageCTA;
|
|
162
|
+
/**
|
|
163
|
+
* Current status of the notification.
|
|
164
|
+
*/
|
|
165
|
+
status: NotificationFeedItemDtoStatus;
|
|
166
|
+
/**
|
|
167
|
+
* The payload that was used to send the notification trigger.
|
|
168
|
+
*/
|
|
169
|
+
payload?: { [k: string]: any } | undefined;
|
|
170
|
+
/**
|
|
171
|
+
* Provider-specific overrides used when triggering the notification.
|
|
172
|
+
*/
|
|
173
|
+
overrides?: { [k: string]: any } | undefined;
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
/** @internal */
|
|
177
|
+
export const TemplateIdentifier$inboundSchema: z.ZodType<
|
|
178
|
+
TemplateIdentifier,
|
|
179
|
+
z.ZodTypeDef,
|
|
180
|
+
unknown
|
|
181
|
+
> = z.object({});
|
|
182
|
+
|
|
183
|
+
/** @internal */
|
|
184
|
+
export type TemplateIdentifier$Outbound = {};
|
|
185
|
+
|
|
186
|
+
/** @internal */
|
|
187
|
+
export const TemplateIdentifier$outboundSchema: z.ZodType<
|
|
188
|
+
TemplateIdentifier$Outbound,
|
|
189
|
+
z.ZodTypeDef,
|
|
190
|
+
TemplateIdentifier
|
|
191
|
+
> = z.object({});
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* @internal
|
|
195
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
196
|
+
*/
|
|
197
|
+
export namespace TemplateIdentifier$ {
|
|
198
|
+
/** @deprecated use `TemplateIdentifier$inboundSchema` instead. */
|
|
199
|
+
export const inboundSchema = TemplateIdentifier$inboundSchema;
|
|
200
|
+
/** @deprecated use `TemplateIdentifier$outboundSchema` instead. */
|
|
201
|
+
export const outboundSchema = TemplateIdentifier$outboundSchema;
|
|
202
|
+
/** @deprecated use `TemplateIdentifier$Outbound` instead. */
|
|
203
|
+
export type Outbound = TemplateIdentifier$Outbound;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export function templateIdentifierToJSON(
|
|
207
|
+
templateIdentifier: TemplateIdentifier,
|
|
208
|
+
): string {
|
|
209
|
+
return JSON.stringify(
|
|
210
|
+
TemplateIdentifier$outboundSchema.parse(templateIdentifier),
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export function templateIdentifierFromJSON(
|
|
215
|
+
jsonString: string,
|
|
216
|
+
): SafeParseResult<TemplateIdentifier, SDKValidationError> {
|
|
217
|
+
return safeParse(
|
|
218
|
+
jsonString,
|
|
219
|
+
(x) => TemplateIdentifier$inboundSchema.parse(JSON.parse(x)),
|
|
220
|
+
`Failed to parse 'TemplateIdentifier' from JSON`,
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/** @internal */
|
|
225
|
+
export const NotificationFeedItemDtoProviderId$inboundSchema: z.ZodType<
|
|
226
|
+
NotificationFeedItemDtoProviderId,
|
|
227
|
+
z.ZodTypeDef,
|
|
228
|
+
unknown
|
|
229
|
+
> = z.object({});
|
|
230
|
+
|
|
231
|
+
/** @internal */
|
|
232
|
+
export type NotificationFeedItemDtoProviderId$Outbound = {};
|
|
233
|
+
|
|
234
|
+
/** @internal */
|
|
235
|
+
export const NotificationFeedItemDtoProviderId$outboundSchema: z.ZodType<
|
|
236
|
+
NotificationFeedItemDtoProviderId$Outbound,
|
|
237
|
+
z.ZodTypeDef,
|
|
238
|
+
NotificationFeedItemDtoProviderId
|
|
239
|
+
> = z.object({});
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* @internal
|
|
243
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
244
|
+
*/
|
|
245
|
+
export namespace NotificationFeedItemDtoProviderId$ {
|
|
246
|
+
/** @deprecated use `NotificationFeedItemDtoProviderId$inboundSchema` instead. */
|
|
247
|
+
export const inboundSchema = NotificationFeedItemDtoProviderId$inboundSchema;
|
|
248
|
+
/** @deprecated use `NotificationFeedItemDtoProviderId$outboundSchema` instead. */
|
|
249
|
+
export const outboundSchema =
|
|
250
|
+
NotificationFeedItemDtoProviderId$outboundSchema;
|
|
251
|
+
/** @deprecated use `NotificationFeedItemDtoProviderId$Outbound` instead. */
|
|
252
|
+
export type Outbound = NotificationFeedItemDtoProviderId$Outbound;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export function notificationFeedItemDtoProviderIdToJSON(
|
|
256
|
+
notificationFeedItemDtoProviderId: NotificationFeedItemDtoProviderId,
|
|
257
|
+
): string {
|
|
258
|
+
return JSON.stringify(
|
|
259
|
+
NotificationFeedItemDtoProviderId$outboundSchema.parse(
|
|
260
|
+
notificationFeedItemDtoProviderId,
|
|
261
|
+
),
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
export function notificationFeedItemDtoProviderIdFromJSON(
|
|
266
|
+
jsonString: string,
|
|
267
|
+
): SafeParseResult<NotificationFeedItemDtoProviderId, SDKValidationError> {
|
|
268
|
+
return safeParse(
|
|
269
|
+
jsonString,
|
|
270
|
+
(x) => NotificationFeedItemDtoProviderId$inboundSchema.parse(JSON.parse(x)),
|
|
271
|
+
`Failed to parse 'NotificationFeedItemDtoProviderId' from JSON`,
|
|
272
|
+
);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/** @internal */
|
|
276
|
+
export const Subject$inboundSchema: z.ZodType<Subject, z.ZodTypeDef, unknown> =
|
|
277
|
+
z.object({});
|
|
278
|
+
|
|
279
|
+
/** @internal */
|
|
280
|
+
export type Subject$Outbound = {};
|
|
281
|
+
|
|
282
|
+
/** @internal */
|
|
283
|
+
export const Subject$outboundSchema: z.ZodType<
|
|
284
|
+
Subject$Outbound,
|
|
285
|
+
z.ZodTypeDef,
|
|
286
|
+
Subject
|
|
287
|
+
> = z.object({});
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* @internal
|
|
291
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
292
|
+
*/
|
|
293
|
+
export namespace Subject$ {
|
|
294
|
+
/** @deprecated use `Subject$inboundSchema` instead. */
|
|
295
|
+
export const inboundSchema = Subject$inboundSchema;
|
|
296
|
+
/** @deprecated use `Subject$outboundSchema` instead. */
|
|
297
|
+
export const outboundSchema = Subject$outboundSchema;
|
|
298
|
+
/** @deprecated use `Subject$Outbound` instead. */
|
|
299
|
+
export type Outbound = Subject$Outbound;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
export function subjectToJSON(subject: Subject): string {
|
|
303
|
+
return JSON.stringify(Subject$outboundSchema.parse(subject));
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
export function subjectFromJSON(
|
|
307
|
+
jsonString: string,
|
|
308
|
+
): SafeParseResult<Subject, SDKValidationError> {
|
|
309
|
+
return safeParse(
|
|
310
|
+
jsonString,
|
|
311
|
+
(x) => Subject$inboundSchema.parse(JSON.parse(x)),
|
|
312
|
+
`Failed to parse 'Subject' from JSON`,
|
|
313
|
+
);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/** @internal */
|
|
317
|
+
export const NotificationFeedItemDtoStatus$inboundSchema: z.ZodNativeEnum<
|
|
318
|
+
typeof NotificationFeedItemDtoStatus
|
|
319
|
+
> = z.nativeEnum(NotificationFeedItemDtoStatus);
|
|
320
|
+
|
|
321
|
+
/** @internal */
|
|
322
|
+
export const NotificationFeedItemDtoStatus$outboundSchema: z.ZodNativeEnum<
|
|
323
|
+
typeof NotificationFeedItemDtoStatus
|
|
324
|
+
> = NotificationFeedItemDtoStatus$inboundSchema;
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* @internal
|
|
328
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
329
|
+
*/
|
|
330
|
+
export namespace NotificationFeedItemDtoStatus$ {
|
|
331
|
+
/** @deprecated use `NotificationFeedItemDtoStatus$inboundSchema` instead. */
|
|
332
|
+
export const inboundSchema = NotificationFeedItemDtoStatus$inboundSchema;
|
|
333
|
+
/** @deprecated use `NotificationFeedItemDtoStatus$outboundSchema` instead. */
|
|
334
|
+
export const outboundSchema = NotificationFeedItemDtoStatus$outboundSchema;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/** @internal */
|
|
338
|
+
export const NotificationFeedItemDto$inboundSchema: z.ZodType<
|
|
339
|
+
NotificationFeedItemDto,
|
|
340
|
+
z.ZodTypeDef,
|
|
341
|
+
unknown
|
|
342
|
+
> = z.object({
|
|
343
|
+
_id: z.string(),
|
|
344
|
+
_templateId: z.string(),
|
|
345
|
+
_environmentId: z.string(),
|
|
346
|
+
_messageTemplateId: z.string(),
|
|
347
|
+
_organizationId: z.string(),
|
|
348
|
+
_notificationId: z.string(),
|
|
349
|
+
_subscriberId: z.string(),
|
|
350
|
+
_feedId: z.string(),
|
|
351
|
+
_jobId: z.string(),
|
|
352
|
+
createdAt: z.nullable(
|
|
353
|
+
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
354
|
+
).optional(),
|
|
355
|
+
updatedAt: z.nullable(
|
|
356
|
+
z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
357
|
+
).optional(),
|
|
358
|
+
actor: ActorFeedItemDto$inboundSchema.optional(),
|
|
359
|
+
subscriber: SubscriberFeedResponseDto$inboundSchema.optional(),
|
|
360
|
+
transactionId: z.string(),
|
|
361
|
+
templateIdentifier: z.nullable(z.lazy(() => TemplateIdentifier$inboundSchema))
|
|
362
|
+
.optional(),
|
|
363
|
+
providerId: z.nullable(
|
|
364
|
+
z.lazy(() => NotificationFeedItemDtoProviderId$inboundSchema),
|
|
365
|
+
).optional(),
|
|
366
|
+
content: z.string(),
|
|
367
|
+
subject: z.nullable(z.lazy(() => Subject$inboundSchema)).optional(),
|
|
368
|
+
channel: ChannelTypeEnum$inboundSchema,
|
|
369
|
+
read: z.boolean(),
|
|
370
|
+
seen: z.boolean(),
|
|
371
|
+
deleted: z.boolean(),
|
|
372
|
+
deviceTokens: z.nullable(z.array(z.string())).optional(),
|
|
373
|
+
cta: MessageCTA$inboundSchema,
|
|
374
|
+
status: NotificationFeedItemDtoStatus$inboundSchema,
|
|
375
|
+
payload: z.record(z.any()).optional(),
|
|
376
|
+
overrides: z.record(z.any()).optional(),
|
|
377
|
+
}).transform((v) => {
|
|
378
|
+
return remap$(v, {
|
|
379
|
+
"_id": "id",
|
|
380
|
+
"_templateId": "templateId",
|
|
381
|
+
"_environmentId": "environmentId",
|
|
382
|
+
"_messageTemplateId": "messageTemplateId",
|
|
383
|
+
"_organizationId": "organizationId",
|
|
384
|
+
"_notificationId": "notificationId",
|
|
385
|
+
"_subscriberId": "subscriberId",
|
|
386
|
+
"_feedId": "feedId",
|
|
387
|
+
"_jobId": "jobId",
|
|
388
|
+
});
|
|
389
|
+
});
|
|
390
|
+
|
|
391
|
+
/** @internal */
|
|
392
|
+
export type NotificationFeedItemDto$Outbound = {
|
|
393
|
+
_id: string;
|
|
394
|
+
_templateId: string;
|
|
395
|
+
_environmentId: string;
|
|
396
|
+
_messageTemplateId: string;
|
|
397
|
+
_organizationId: string;
|
|
398
|
+
_notificationId: string;
|
|
399
|
+
_subscriberId: string;
|
|
400
|
+
_feedId: string;
|
|
401
|
+
_jobId: string;
|
|
402
|
+
createdAt?: string | null | undefined;
|
|
403
|
+
updatedAt?: string | null | undefined;
|
|
404
|
+
actor?: ActorFeedItemDto$Outbound | undefined;
|
|
405
|
+
subscriber?: SubscriberFeedResponseDto$Outbound | undefined;
|
|
406
|
+
transactionId: string;
|
|
407
|
+
templateIdentifier?: TemplateIdentifier$Outbound | null | undefined;
|
|
408
|
+
providerId?: NotificationFeedItemDtoProviderId$Outbound | null | undefined;
|
|
409
|
+
content: string;
|
|
410
|
+
subject?: Subject$Outbound | null | undefined;
|
|
411
|
+
channel: string;
|
|
412
|
+
read: boolean;
|
|
413
|
+
seen: boolean;
|
|
414
|
+
deleted: boolean;
|
|
415
|
+
deviceTokens?: Array<string> | null | undefined;
|
|
416
|
+
cta: MessageCTA$Outbound;
|
|
417
|
+
status: string;
|
|
418
|
+
payload?: { [k: string]: any } | undefined;
|
|
419
|
+
overrides?: { [k: string]: any } | undefined;
|
|
420
|
+
};
|
|
421
|
+
|
|
422
|
+
/** @internal */
|
|
423
|
+
export const NotificationFeedItemDto$outboundSchema: z.ZodType<
|
|
424
|
+
NotificationFeedItemDto$Outbound,
|
|
425
|
+
z.ZodTypeDef,
|
|
426
|
+
NotificationFeedItemDto
|
|
427
|
+
> = z.object({
|
|
428
|
+
id: z.string(),
|
|
429
|
+
templateId: z.string(),
|
|
430
|
+
environmentId: z.string(),
|
|
431
|
+
messageTemplateId: z.string(),
|
|
432
|
+
organizationId: z.string(),
|
|
433
|
+
notificationId: z.string(),
|
|
434
|
+
subscriberId: z.string(),
|
|
435
|
+
feedId: z.string(),
|
|
436
|
+
jobId: z.string(),
|
|
437
|
+
createdAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
|
|
438
|
+
updatedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(),
|
|
439
|
+
actor: ActorFeedItemDto$outboundSchema.optional(),
|
|
440
|
+
subscriber: SubscriberFeedResponseDto$outboundSchema.optional(),
|
|
441
|
+
transactionId: z.string(),
|
|
442
|
+
templateIdentifier: z.nullable(
|
|
443
|
+
z.lazy(() => TemplateIdentifier$outboundSchema),
|
|
444
|
+
).optional(),
|
|
445
|
+
providerId: z.nullable(
|
|
446
|
+
z.lazy(() => NotificationFeedItemDtoProviderId$outboundSchema),
|
|
447
|
+
).optional(),
|
|
448
|
+
content: z.string(),
|
|
449
|
+
subject: z.nullable(z.lazy(() => Subject$outboundSchema)).optional(),
|
|
450
|
+
channel: ChannelTypeEnum$outboundSchema,
|
|
451
|
+
read: z.boolean(),
|
|
452
|
+
seen: z.boolean(),
|
|
453
|
+
deleted: z.boolean(),
|
|
454
|
+
deviceTokens: z.nullable(z.array(z.string())).optional(),
|
|
455
|
+
cta: MessageCTA$outboundSchema,
|
|
456
|
+
status: NotificationFeedItemDtoStatus$outboundSchema,
|
|
457
|
+
payload: z.record(z.any()).optional(),
|
|
458
|
+
overrides: z.record(z.any()).optional(),
|
|
459
|
+
}).transform((v) => {
|
|
460
|
+
return remap$(v, {
|
|
461
|
+
id: "_id",
|
|
462
|
+
templateId: "_templateId",
|
|
463
|
+
environmentId: "_environmentId",
|
|
464
|
+
messageTemplateId: "_messageTemplateId",
|
|
465
|
+
organizationId: "_organizationId",
|
|
466
|
+
notificationId: "_notificationId",
|
|
467
|
+
subscriberId: "_subscriberId",
|
|
468
|
+
feedId: "_feedId",
|
|
469
|
+
jobId: "_jobId",
|
|
470
|
+
});
|
|
471
|
+
});
|
|
472
|
+
|
|
473
|
+
/**
|
|
474
|
+
* @internal
|
|
475
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
476
|
+
*/
|
|
477
|
+
export namespace NotificationFeedItemDto$ {
|
|
478
|
+
/** @deprecated use `NotificationFeedItemDto$inboundSchema` instead. */
|
|
479
|
+
export const inboundSchema = NotificationFeedItemDto$inboundSchema;
|
|
480
|
+
/** @deprecated use `NotificationFeedItemDto$outboundSchema` instead. */
|
|
481
|
+
export const outboundSchema = NotificationFeedItemDto$outboundSchema;
|
|
482
|
+
/** @deprecated use `NotificationFeedItemDto$Outbound` instead. */
|
|
483
|
+
export type Outbound = NotificationFeedItemDto$Outbound;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
export function notificationFeedItemDtoToJSON(
|
|
487
|
+
notificationFeedItemDto: NotificationFeedItemDto,
|
|
488
|
+
): string {
|
|
489
|
+
return JSON.stringify(
|
|
490
|
+
NotificationFeedItemDto$outboundSchema.parse(notificationFeedItemDto),
|
|
491
|
+
);
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
export function notificationFeedItemDtoFromJSON(
|
|
495
|
+
jsonString: string,
|
|
496
|
+
): SafeParseResult<NotificationFeedItemDto, SDKValidationError> {
|
|
497
|
+
return safeParse(
|
|
498
|
+
jsonString,
|
|
499
|
+
(x) => NotificationFeedItemDto$inboundSchema.parse(JSON.parse(x)),
|
|
500
|
+
`Failed to parse 'NotificationFeedItemDto' from JSON`,
|
|
501
|
+
);
|
|
502
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
export type SubscriberFeedResponseDto = {
|
|
12
|
+
/**
|
|
13
|
+
* 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.
|
|
14
|
+
*/
|
|
15
|
+
id?: string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* The first name of the subscriber.
|
|
18
|
+
*/
|
|
19
|
+
firstName?: string | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* The last name of the subscriber.
|
|
22
|
+
*/
|
|
23
|
+
lastName?: string | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* The URL of the subscriber's avatar image.
|
|
26
|
+
*/
|
|
27
|
+
avatar?: string | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* The identifier used to create this subscriber, which typically corresponds to the user ID in your system.
|
|
30
|
+
*/
|
|
31
|
+
subscriberId: string;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** @internal */
|
|
35
|
+
export const SubscriberFeedResponseDto$inboundSchema: z.ZodType<
|
|
36
|
+
SubscriberFeedResponseDto,
|
|
37
|
+
z.ZodTypeDef,
|
|
38
|
+
unknown
|
|
39
|
+
> = z.object({
|
|
40
|
+
_id: z.string().optional(),
|
|
41
|
+
firstName: z.string().optional(),
|
|
42
|
+
lastName: z.string().optional(),
|
|
43
|
+
avatar: z.string().optional(),
|
|
44
|
+
subscriberId: z.string(),
|
|
45
|
+
}).transform((v) => {
|
|
46
|
+
return remap$(v, {
|
|
47
|
+
"_id": "id",
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
/** @internal */
|
|
52
|
+
export type SubscriberFeedResponseDto$Outbound = {
|
|
53
|
+
_id?: string | undefined;
|
|
54
|
+
firstName?: string | undefined;
|
|
55
|
+
lastName?: string | undefined;
|
|
56
|
+
avatar?: string | undefined;
|
|
57
|
+
subscriberId: string;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/** @internal */
|
|
61
|
+
export const SubscriberFeedResponseDto$outboundSchema: z.ZodType<
|
|
62
|
+
SubscriberFeedResponseDto$Outbound,
|
|
63
|
+
z.ZodTypeDef,
|
|
64
|
+
SubscriberFeedResponseDto
|
|
65
|
+
> = z.object({
|
|
66
|
+
id: z.string().optional(),
|
|
67
|
+
firstName: z.string().optional(),
|
|
68
|
+
lastName: z.string().optional(),
|
|
69
|
+
avatar: z.string().optional(),
|
|
70
|
+
subscriberId: z.string(),
|
|
71
|
+
}).transform((v) => {
|
|
72
|
+
return remap$(v, {
|
|
73
|
+
id: "_id",
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* @internal
|
|
79
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
80
|
+
*/
|
|
81
|
+
export namespace SubscriberFeedResponseDto$ {
|
|
82
|
+
/** @deprecated use `SubscriberFeedResponseDto$inboundSchema` instead. */
|
|
83
|
+
export const inboundSchema = SubscriberFeedResponseDto$inboundSchema;
|
|
84
|
+
/** @deprecated use `SubscriberFeedResponseDto$outboundSchema` instead. */
|
|
85
|
+
export const outboundSchema = SubscriberFeedResponseDto$outboundSchema;
|
|
86
|
+
/** @deprecated use `SubscriberFeedResponseDto$Outbound` instead. */
|
|
87
|
+
export type Outbound = SubscriberFeedResponseDto$Outbound;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function subscriberFeedResponseDtoToJSON(
|
|
91
|
+
subscriberFeedResponseDto: SubscriberFeedResponseDto,
|
|
92
|
+
): string {
|
|
93
|
+
return JSON.stringify(
|
|
94
|
+
SubscriberFeedResponseDto$outboundSchema.parse(subscriberFeedResponseDto),
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export function subscriberFeedResponseDtoFromJSON(
|
|
99
|
+
jsonString: string,
|
|
100
|
+
): SafeParseResult<SubscriberFeedResponseDto, SDKValidationError> {
|
|
101
|
+
return safeParse(
|
|
102
|
+
jsonString,
|
|
103
|
+
(x) => SubscriberFeedResponseDto$inboundSchema.parse(JSON.parse(x)),
|
|
104
|
+
`Failed to parse 'SubscriberFeedResponseDto' from JSON`,
|
|
105
|
+
);
|
|
106
|
+
}
|
|
@@ -16,34 +16,76 @@ import {
|
|
|
16
16
|
|
|
17
17
|
export type SubscriberResponseDto = {
|
|
18
18
|
/**
|
|
19
|
-
* The internal
|
|
19
|
+
* 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.
|
|
20
20
|
*/
|
|
21
21
|
id?: string | undefined;
|
|
22
|
+
/**
|
|
23
|
+
* The first name of the subscriber.
|
|
24
|
+
*/
|
|
22
25
|
firstName?: string | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* The last name of the subscriber.
|
|
28
|
+
*/
|
|
23
29
|
lastName?: string | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* The email address of the subscriber.
|
|
32
|
+
*/
|
|
24
33
|
email?: string | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* The phone number of the subscriber.
|
|
36
|
+
*/
|
|
25
37
|
phone?: string | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* The URL of the subscriber's avatar image.
|
|
40
|
+
*/
|
|
26
41
|
avatar?: string | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* The locale setting of the subscriber, indicating their preferred language or region.
|
|
44
|
+
*/
|
|
27
45
|
locale?: string | undefined;
|
|
28
46
|
/**
|
|
29
|
-
* The
|
|
47
|
+
* The identifier used to create this subscriber, which typically corresponds to the user ID in your system.
|
|
30
48
|
*/
|
|
31
49
|
subscriberId: string;
|
|
32
50
|
/**
|
|
33
|
-
*
|
|
51
|
+
* An array of channel settings associated with the subscriber.
|
|
34
52
|
*/
|
|
35
53
|
channels?: Array<ChannelSettings> | undefined;
|
|
36
54
|
/**
|
|
37
|
-
*
|
|
55
|
+
* An array of topics that the subscriber is subscribed to.
|
|
38
56
|
*/
|
|
39
57
|
topics?: Array<string> | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Indicates whether the subscriber is currently online.
|
|
60
|
+
*/
|
|
40
61
|
isOnline?: boolean | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* The timestamp indicating when the subscriber was last online, in ISO 8601 format.
|
|
64
|
+
*/
|
|
41
65
|
lastOnlineAt?: string | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* The unique identifier of the organization to which the subscriber belongs.
|
|
68
|
+
*/
|
|
42
69
|
organizationId: string;
|
|
70
|
+
/**
|
|
71
|
+
* The unique identifier of the environment associated with this subscriber.
|
|
72
|
+
*/
|
|
43
73
|
environmentId: string;
|
|
74
|
+
/**
|
|
75
|
+
* Indicates whether the subscriber has been deleted.
|
|
76
|
+
*/
|
|
44
77
|
deleted: boolean;
|
|
78
|
+
/**
|
|
79
|
+
* The timestamp indicating when the subscriber was created, in ISO 8601 format.
|
|
80
|
+
*/
|
|
45
81
|
createdAt: string;
|
|
82
|
+
/**
|
|
83
|
+
* The timestamp indicating when the subscriber was last updated, in ISO 8601 format.
|
|
84
|
+
*/
|
|
46
85
|
updatedAt: string;
|
|
86
|
+
/**
|
|
87
|
+
* The version of the subscriber document.
|
|
88
|
+
*/
|
|
47
89
|
v?: number | undefined;
|
|
48
90
|
};
|
|
49
91
|
|