@novu/api 1.2.0 → 1.3.0
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/FUNCTIONS.md +5 -22
- package/README.md +48 -74
- package/bin/mcp-server.js +289 -23
- package/bin/mcp-server.js.map +59 -57
- package/docs/sdks/credentials/README.md +15 -27
- package/docs/sdks/integrations/README.md +30 -54
- package/docs/sdks/messages/README.md +15 -27
- package/docs/sdks/notifications/README.md +10 -18
- package/docs/sdks/novu/README.md +44 -57
- package/docs/sdks/novumessages/README.md +15 -27
- package/docs/sdks/novunotifications/README.md +10 -18
- package/docs/sdks/novusubscribers/README.md +5 -9
- package/docs/sdks/novutopics/README.md +5 -9
- package/docs/sdks/preferences/README.md +10 -18
- package/docs/sdks/properties/README.md +5 -9
- package/docs/sdks/subscribers/README.md +34 -57
- package/docs/sdks/subscriptions/README.md +16 -28
- package/docs/sdks/topics/README.md +25 -45
- package/funcs/cancel.d.ts +1 -1
- package/funcs/cancel.d.ts.map +1 -1
- package/funcs/cancel.js +2 -0
- package/funcs/cancel.js.map +1 -1
- package/funcs/integrationsCreate.d.ts +1 -1
- package/funcs/integrationsCreate.d.ts.map +1 -1
- package/funcs/integrationsCreate.js +2 -0
- package/funcs/integrationsCreate.js.map +1 -1
- package/funcs/integrationsDelete.d.ts +1 -1
- package/funcs/integrationsDelete.d.ts.map +1 -1
- package/funcs/integrationsDelete.js +2 -0
- package/funcs/integrationsDelete.js.map +1 -1
- package/funcs/integrationsList.d.ts +1 -1
- package/funcs/integrationsList.d.ts.map +1 -1
- package/funcs/integrationsList.js +2 -0
- package/funcs/integrationsList.js.map +1 -1
- package/funcs/integrationsListActive.d.ts +1 -1
- package/funcs/integrationsListActive.d.ts.map +1 -1
- package/funcs/integrationsListActive.js +2 -0
- package/funcs/integrationsListActive.js.map +1 -1
- package/funcs/integrationsSetAsPrimary.d.ts +1 -1
- package/funcs/integrationsSetAsPrimary.d.ts.map +1 -1
- package/funcs/integrationsSetAsPrimary.js +2 -0
- package/funcs/integrationsSetAsPrimary.js.map +1 -1
- package/funcs/integrationsUpdate.d.ts +1 -1
- package/funcs/integrationsUpdate.d.ts.map +1 -1
- package/funcs/integrationsUpdate.js +2 -0
- package/funcs/integrationsUpdate.js.map +1 -1
- package/funcs/messagesDelete.d.ts +1 -1
- package/funcs/messagesDelete.d.ts.map +1 -1
- package/funcs/messagesDelete.js +2 -0
- package/funcs/messagesDelete.js.map +1 -1
- package/funcs/messagesDeleteByTransactionId.d.ts +1 -1
- package/funcs/messagesDeleteByTransactionId.d.ts.map +1 -1
- package/funcs/messagesDeleteByTransactionId.js +2 -0
- package/funcs/messagesDeleteByTransactionId.js.map +1 -1
- package/funcs/messagesRetrieve.d.ts +1 -1
- package/funcs/messagesRetrieve.d.ts.map +1 -1
- package/funcs/messagesRetrieve.js +2 -0
- package/funcs/messagesRetrieve.js.map +1 -1
- package/funcs/notificationsList.d.ts +1 -1
- package/funcs/notificationsList.d.ts.map +1 -1
- package/funcs/notificationsList.js +2 -0
- package/funcs/notificationsList.js.map +1 -1
- package/funcs/notificationsRetrieve.d.ts +1 -1
- package/funcs/notificationsRetrieve.d.ts.map +1 -1
- package/funcs/notificationsRetrieve.js +2 -0
- package/funcs/notificationsRetrieve.js.map +1 -1
- package/funcs/subscribersCreate.d.ts +1 -1
- package/funcs/subscribersCreate.d.ts.map +1 -1
- package/funcs/subscribersCreate.js +2 -0
- package/funcs/subscribersCreate.js.map +1 -1
- package/funcs/subscribersCreateBulk.d.ts +1 -1
- package/funcs/subscribersCreateBulk.d.ts.map +1 -1
- package/funcs/subscribersCreateBulk.js +2 -0
- package/funcs/subscribersCreateBulk.js.map +1 -1
- package/funcs/subscribersCredentialsAppend.d.ts +1 -1
- package/funcs/subscribersCredentialsAppend.d.ts.map +1 -1
- package/funcs/subscribersCredentialsAppend.js +2 -0
- package/funcs/subscribersCredentialsAppend.js.map +1 -1
- package/funcs/subscribersCredentialsDelete.d.ts +1 -1
- package/funcs/subscribersCredentialsDelete.d.ts.map +1 -1
- package/funcs/subscribersCredentialsDelete.js +2 -0
- package/funcs/subscribersCredentialsDelete.js.map +1 -1
- package/funcs/subscribersCredentialsUpdate.d.ts +1 -1
- package/funcs/subscribersCredentialsUpdate.d.ts.map +1 -1
- package/funcs/subscribersCredentialsUpdate.js +2 -0
- package/funcs/subscribersCredentialsUpdate.js.map +1 -1
- package/funcs/subscribersDelete.d.ts +4 -3
- package/funcs/subscribersDelete.d.ts.map +1 -1
- package/funcs/subscribersDelete.js +5 -2
- package/funcs/subscribersDelete.js.map +1 -1
- package/funcs/subscribersMessagesMarkAll.d.ts +1 -1
- package/funcs/subscribersMessagesMarkAll.d.ts.map +1 -1
- package/funcs/subscribersMessagesMarkAll.js +2 -0
- package/funcs/subscribersMessagesMarkAll.js.map +1 -1
- package/funcs/subscribersMessagesMarkAllAs.d.ts +1 -1
- package/funcs/subscribersMessagesMarkAllAs.d.ts.map +1 -1
- package/funcs/subscribersMessagesMarkAllAs.js +2 -0
- package/funcs/subscribersMessagesMarkAllAs.js.map +1 -1
- package/funcs/subscribersMessagesUpdateAsSeen.d.ts +1 -1
- package/funcs/subscribersMessagesUpdateAsSeen.d.ts.map +1 -1
- package/funcs/subscribersMessagesUpdateAsSeen.js +2 -0
- package/funcs/subscribersMessagesUpdateAsSeen.js.map +1 -1
- package/funcs/subscribersNotificationsFeed.d.ts +1 -1
- package/funcs/subscribersNotificationsFeed.d.ts.map +1 -1
- package/funcs/subscribersNotificationsFeed.js +2 -0
- package/funcs/subscribersNotificationsFeed.js.map +1 -1
- package/funcs/subscribersNotificationsUnseenCount.d.ts +1 -1
- package/funcs/subscribersNotificationsUnseenCount.d.ts.map +1 -1
- package/funcs/subscribersNotificationsUnseenCount.js +2 -0
- package/funcs/subscribersNotificationsUnseenCount.js.map +1 -1
- package/funcs/subscribersPatch.d.ts +1 -1
- package/funcs/subscribersPatch.d.ts.map +1 -1
- package/funcs/subscribersPatch.js +2 -0
- package/funcs/subscribersPatch.js.map +1 -1
- package/funcs/subscribersPreferencesList.d.ts +1 -1
- package/funcs/subscribersPreferencesList.d.ts.map +1 -1
- package/funcs/subscribersPreferencesList.js +2 -0
- package/funcs/subscribersPreferencesList.js.map +1 -1
- package/funcs/subscribersPreferencesUpdate.d.ts +1 -1
- package/funcs/subscribersPreferencesUpdate.d.ts.map +1 -1
- package/funcs/subscribersPreferencesUpdate.js +2 -0
- package/funcs/subscribersPreferencesUpdate.js.map +1 -1
- package/funcs/subscribersPropertiesUpdateOnlineFlag.d.ts +1 -1
- package/funcs/subscribersPropertiesUpdateOnlineFlag.d.ts.map +1 -1
- package/funcs/subscribersPropertiesUpdateOnlineFlag.js +2 -0
- package/funcs/subscribersPropertiesUpdateOnlineFlag.js.map +1 -1
- package/funcs/subscribersRetrieve.d.ts +2 -2
- package/funcs/subscribersRetrieve.d.ts.map +1 -1
- package/funcs/subscribersRetrieve.js +3 -1
- package/funcs/subscribersRetrieve.js.map +1 -1
- package/funcs/subscribersSearch.d.ts +1 -1
- package/funcs/subscribersSearch.d.ts.map +1 -1
- package/funcs/subscribersSearch.js +2 -0
- package/funcs/subscribersSearch.js.map +1 -1
- package/funcs/subscribersTopicsList.d.ts +1 -1
- package/funcs/subscribersTopicsList.d.ts.map +1 -1
- package/funcs/subscribersTopicsList.js +2 -0
- package/funcs/subscribersTopicsList.js.map +1 -1
- package/funcs/topicsCreate.d.ts +1 -1
- package/funcs/topicsCreate.d.ts.map +1 -1
- package/funcs/topicsCreate.js +2 -0
- package/funcs/topicsCreate.js.map +1 -1
- package/funcs/topicsDelete.d.ts +1 -1
- package/funcs/topicsDelete.d.ts.map +1 -1
- package/funcs/topicsDelete.js +2 -0
- package/funcs/topicsDelete.js.map +1 -1
- package/funcs/topicsGet.d.ts +1 -1
- package/funcs/topicsGet.d.ts.map +1 -1
- package/funcs/topicsGet.js +2 -0
- package/funcs/topicsGet.js.map +1 -1
- package/funcs/topicsList.d.ts +1 -1
- package/funcs/topicsList.d.ts.map +1 -1
- package/funcs/topicsList.js +2 -0
- package/funcs/topicsList.js.map +1 -1
- package/funcs/topicsSubscribersRetrieve.d.ts +1 -1
- package/funcs/topicsSubscribersRetrieve.d.ts.map +1 -1
- package/funcs/topicsSubscribersRetrieve.js +2 -0
- package/funcs/topicsSubscribersRetrieve.js.map +1 -1
- package/funcs/topicsSubscriptionsCreate.d.ts +1 -1
- package/funcs/topicsSubscriptionsCreate.d.ts.map +1 -1
- package/funcs/topicsSubscriptionsCreate.js +2 -0
- package/funcs/topicsSubscriptionsCreate.js.map +1 -1
- package/funcs/topicsSubscriptionsDelete.d.ts +1 -1
- package/funcs/topicsSubscriptionsDelete.d.ts.map +1 -1
- package/funcs/topicsSubscriptionsDelete.js +2 -0
- package/funcs/topicsSubscriptionsDelete.js.map +1 -1
- package/funcs/topicsSubscriptionsList.d.ts +2 -2
- package/funcs/topicsSubscriptionsList.d.ts.map +1 -1
- package/funcs/topicsSubscriptionsList.js +3 -1
- package/funcs/topicsSubscriptionsList.js.map +1 -1
- package/funcs/topicsUpdate.d.ts +1 -1
- package/funcs/topicsUpdate.d.ts.map +1 -1
- package/funcs/topicsUpdate.js +2 -0
- package/funcs/topicsUpdate.js.map +1 -1
- package/funcs/trigger.d.ts +1 -1
- package/funcs/trigger.d.ts.map +1 -1
- package/funcs/trigger.js +5 -1
- package/funcs/trigger.js.map +1 -1
- package/funcs/triggerBroadcast.d.ts +1 -1
- package/funcs/triggerBroadcast.d.ts.map +1 -1
- package/funcs/triggerBroadcast.js +5 -1
- package/funcs/triggerBroadcast.js.map +1 -1
- package/funcs/triggerBulk.d.ts +1 -1
- package/funcs/triggerBulk.d.ts.map +1 -1
- package/funcs/triggerBulk.js +5 -1
- package/funcs/triggerBulk.js.map +1 -1
- package/hooks/types.d.ts +2 -0
- package/hooks/types.d.ts.map +1 -1
- package/index.d.ts +2 -0
- package/index.d.ts.map +1 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +7 -3
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +3 -3
- package/lib/config.js.map +1 -1
- package/lib/sdks.d.ts +1 -0
- package/lib/sdks.d.ts.map +1 -1
- package/lib/sdks.js +3 -3
- package/lib/sdks.js.map +1 -1
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.js +1 -1
- package/mcp-server/tools/subscribersDelete.d.ts.map +1 -1
- package/mcp-server/tools/subscribersDelete.js +3 -2
- package/mcp-server/tools/subscribersDelete.js.map +1 -1
- package/mcp-server/tools/subscribersRetrieve.js +1 -1
- package/mcp-server/tools/topicsSubscriptionsList.js +1 -1
- package/models/components/index.d.ts +1 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +1 -0
- package/models/components/index.js.map +1 -1
- package/models/components/notificationfeeditemdto.d.ts +2 -2
- package/models/components/notificationfeeditemdto.d.ts.map +1 -1
- package/models/components/notificationfeeditemdto.js +2 -2
- package/models/components/notificationfeeditemdto.js.map +1 -1
- package/models/components/payloadvalidationerrordto.d.ts +125 -0
- package/models/components/payloadvalidationerrordto.d.ts.map +1 -0
- package/models/components/payloadvalidationerrordto.js +160 -0
- package/models/components/payloadvalidationerrordto.js.map +1 -0
- package/models/components/updateintegrationrequestdto.d.ts +0 -5
- package/models/components/updateintegrationrequestdto.d.ts.map +1 -1
- package/models/components/updateintegrationrequestdto.js +0 -2
- package/models/components/updateintegrationrequestdto.js.map +1 -1
- package/models/errors/index.d.ts +1 -0
- package/models/errors/index.d.ts.map +1 -1
- package/models/errors/index.js +1 -0
- package/models/errors/index.js.map +1 -1
- package/models/errors/payloadvalidationexceptiondto.d.ts +222 -0
- package/models/errors/payloadvalidationexceptiondto.d.ts.map +1 -0
- package/models/errors/payloadvalidationexceptiondto.js +212 -0
- package/models/errors/payloadvalidationexceptiondto.js.map +1 -0
- package/models/errors/sdkerror.d.ts +14 -2
- package/models/errors/sdkerror.d.ts.map +1 -1
- package/models/errors/sdkerror.js +1 -1
- package/models/errors/sdkerror.js.map +1 -1
- package/package.json +1 -1
- package/sdk/subscribers.d.ts +4 -3
- package/sdk/subscribers.d.ts.map +1 -1
- package/sdk/subscribers.js +4 -3
- package/sdk/subscribers.js.map +1 -1
- package/sdk/subscriptions.d.ts +1 -1
- package/sdk/subscriptions.js +1 -1
- package/sources/json-development.json +227 -46
- package/src/funcs/cancel.ts +2 -6
- package/src/funcs/integrationsCreate.ts +2 -6
- package/src/funcs/integrationsDelete.ts +2 -6
- package/src/funcs/integrationsList.ts +2 -6
- package/src/funcs/integrationsListActive.ts +2 -6
- package/src/funcs/integrationsSetAsPrimary.ts +2 -6
- package/src/funcs/integrationsUpdate.ts +2 -6
- package/src/funcs/messagesDelete.ts +2 -6
- package/src/funcs/messagesDeleteByTransactionId.ts +2 -6
- package/src/funcs/messagesRetrieve.ts +2 -6
- package/src/funcs/notificationsList.ts +2 -6
- package/src/funcs/notificationsRetrieve.ts +2 -6
- package/src/funcs/subscribersCreate.ts +2 -6
- package/src/funcs/subscribersCreateBulk.ts +2 -6
- package/src/funcs/subscribersCredentialsAppend.ts +2 -6
- package/src/funcs/subscribersCredentialsDelete.ts +2 -6
- package/src/funcs/subscribersCredentialsUpdate.ts +2 -6
- package/src/funcs/subscribersDelete.ts +5 -8
- package/src/funcs/subscribersMessagesMarkAll.ts +2 -6
- package/src/funcs/subscribersMessagesMarkAllAs.ts +2 -6
- package/src/funcs/subscribersMessagesUpdateAsSeen.ts +2 -6
- package/src/funcs/subscribersNotificationsFeed.ts +2 -6
- package/src/funcs/subscribersNotificationsUnseenCount.ts +2 -6
- package/src/funcs/subscribersPatch.ts +2 -6
- package/src/funcs/subscribersPreferencesList.ts +2 -6
- package/src/funcs/subscribersPreferencesUpdate.ts +2 -6
- package/src/funcs/subscribersPropertiesUpdateOnlineFlag.ts +2 -6
- package/src/funcs/subscribersRetrieve.ts +3 -7
- package/src/funcs/subscribersSearch.ts +2 -6
- package/src/funcs/subscribersTopicsList.ts +2 -6
- package/src/funcs/topicsCreate.ts +2 -6
- package/src/funcs/topicsDelete.ts +2 -6
- package/src/funcs/topicsGet.ts +2 -6
- package/src/funcs/topicsList.ts +2 -6
- package/src/funcs/topicsSubscribersRetrieve.ts +2 -6
- package/src/funcs/topicsSubscriptionsCreate.ts +2 -6
- package/src/funcs/topicsSubscriptionsDelete.ts +2 -6
- package/src/funcs/topicsSubscriptionsList.ts +3 -7
- package/src/funcs/topicsUpdate.ts +2 -6
- package/src/funcs/trigger.ts +9 -7
- package/src/funcs/triggerBroadcast.ts +9 -7
- package/src/funcs/triggerBulk.ts +9 -7
- package/src/hooks/types.ts +2 -0
- package/src/index.ts +2 -0
- package/src/lib/config.ts +7 -3
- package/src/lib/sdks.ts +10 -4
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/mcp-server/tools/subscribersDelete.ts +3 -2
- package/src/mcp-server/tools/subscribersRetrieve.ts +1 -1
- package/src/mcp-server/tools/topicsSubscriptionsList.ts +1 -1
- package/src/models/components/index.ts +1 -0
- package/src/models/components/notificationfeeditemdto.ts +4 -4
- package/src/models/components/payloadvalidationerrordto.ts +299 -0
- package/src/models/components/updateintegrationrequestdto.ts +0 -7
- package/src/models/errors/index.ts +1 -0
- package/src/models/errors/payloadvalidationexceptiondto.ts +466 -0
- package/src/models/errors/sdkerror.ts +18 -3
- package/src/sdk/subscribers.ts +4 -3
- package/src/sdk/subscriptions.ts +1 -1
|
@@ -0,0 +1,466 @@
|
|
|
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 * as components from "../components/index.js";
|
|
9
|
+
import { SDKValidationError } from "./sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
export type MessagePayloadValidationExceptionDto5 =
|
|
12
|
+
| string
|
|
13
|
+
| number
|
|
14
|
+
| boolean
|
|
15
|
+
| { [k: string]: any };
|
|
16
|
+
|
|
17
|
+
export type MessagePayloadValidationExceptionDto4 = {};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Value that failed validation
|
|
21
|
+
*/
|
|
22
|
+
export type PayloadValidationExceptionDtoMessage =
|
|
23
|
+
| MessagePayloadValidationExceptionDto4
|
|
24
|
+
| string
|
|
25
|
+
| number
|
|
26
|
+
| boolean
|
|
27
|
+
| Array<string | number | boolean | { [k: string]: any } | null>;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The JSON schema that was used for validation
|
|
31
|
+
*/
|
|
32
|
+
export type Schema = {};
|
|
33
|
+
|
|
34
|
+
export type PayloadValidationExceptionDtoData = {
|
|
35
|
+
/**
|
|
36
|
+
* HTTP status code of the error response.
|
|
37
|
+
*/
|
|
38
|
+
statusCode: number;
|
|
39
|
+
/**
|
|
40
|
+
* Timestamp of when the error occurred.
|
|
41
|
+
*/
|
|
42
|
+
timestamp: string;
|
|
43
|
+
/**
|
|
44
|
+
* The path where the error occurred.
|
|
45
|
+
*/
|
|
46
|
+
path: string;
|
|
47
|
+
/**
|
|
48
|
+
* Value that failed validation
|
|
49
|
+
*/
|
|
50
|
+
message?:
|
|
51
|
+
| MessagePayloadValidationExceptionDto4
|
|
52
|
+
| string
|
|
53
|
+
| number
|
|
54
|
+
| boolean
|
|
55
|
+
| Array<string | number | boolean | { [k: string]: any } | null>
|
|
56
|
+
| null
|
|
57
|
+
| undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Optional context object for additional error details.
|
|
60
|
+
*/
|
|
61
|
+
ctx?: { [k: string]: any } | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* Optional unique identifier for the error, useful for tracking using Sentry and
|
|
64
|
+
*
|
|
65
|
+
* @remarks
|
|
66
|
+
* New Relic, only available for 500.
|
|
67
|
+
*/
|
|
68
|
+
errorId?: string | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* Type identifier for payload validation errors
|
|
71
|
+
*/
|
|
72
|
+
type: string;
|
|
73
|
+
/**
|
|
74
|
+
* Array of detailed validation errors
|
|
75
|
+
*/
|
|
76
|
+
errors: Array<components.PayloadValidationErrorDto>;
|
|
77
|
+
/**
|
|
78
|
+
* The JSON schema that was used for validation
|
|
79
|
+
*/
|
|
80
|
+
schema?: Schema | undefined;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export class PayloadValidationExceptionDto extends Error {
|
|
84
|
+
/**
|
|
85
|
+
* HTTP status code of the error response.
|
|
86
|
+
*/
|
|
87
|
+
statusCode: number;
|
|
88
|
+
/**
|
|
89
|
+
* Timestamp of when the error occurred.
|
|
90
|
+
*/
|
|
91
|
+
timestamp: string;
|
|
92
|
+
/**
|
|
93
|
+
* The path where the error occurred.
|
|
94
|
+
*/
|
|
95
|
+
path: string;
|
|
96
|
+
/**
|
|
97
|
+
* Optional context object for additional error details.
|
|
98
|
+
*/
|
|
99
|
+
ctx?: { [k: string]: any } | undefined;
|
|
100
|
+
/**
|
|
101
|
+
* Optional unique identifier for the error, useful for tracking using Sentry and
|
|
102
|
+
*
|
|
103
|
+
* @remarks
|
|
104
|
+
* New Relic, only available for 500.
|
|
105
|
+
*/
|
|
106
|
+
errorId?: string | undefined;
|
|
107
|
+
/**
|
|
108
|
+
* Type identifier for payload validation errors
|
|
109
|
+
*/
|
|
110
|
+
type: string;
|
|
111
|
+
/**
|
|
112
|
+
* Array of detailed validation errors
|
|
113
|
+
*/
|
|
114
|
+
errors: Array<components.PayloadValidationErrorDto>;
|
|
115
|
+
/**
|
|
116
|
+
* The JSON schema that was used for validation
|
|
117
|
+
*/
|
|
118
|
+
schema?: Schema | undefined;
|
|
119
|
+
|
|
120
|
+
/** The original data that was passed to this error instance. */
|
|
121
|
+
data$: PayloadValidationExceptionDtoData;
|
|
122
|
+
|
|
123
|
+
constructor(err: PayloadValidationExceptionDtoData) {
|
|
124
|
+
const message = "message" in err && typeof err.message === "string"
|
|
125
|
+
? err.message
|
|
126
|
+
: `API error occurred: ${JSON.stringify(err)}`;
|
|
127
|
+
super(message);
|
|
128
|
+
this.data$ = err;
|
|
129
|
+
|
|
130
|
+
this.statusCode = err.statusCode;
|
|
131
|
+
this.timestamp = err.timestamp;
|
|
132
|
+
this.path = err.path;
|
|
133
|
+
if (err.ctx != null) this.ctx = err.ctx;
|
|
134
|
+
if (err.errorId != null) this.errorId = err.errorId;
|
|
135
|
+
this.type = err.type;
|
|
136
|
+
this.errors = err.errors;
|
|
137
|
+
if (err.schema != null) this.schema = err.schema;
|
|
138
|
+
|
|
139
|
+
this.name = "PayloadValidationExceptionDto";
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** @internal */
|
|
144
|
+
export const MessagePayloadValidationExceptionDto5$inboundSchema: z.ZodType<
|
|
145
|
+
MessagePayloadValidationExceptionDto5,
|
|
146
|
+
z.ZodTypeDef,
|
|
147
|
+
unknown
|
|
148
|
+
> = z.union([z.string(), z.number(), z.boolean(), z.record(z.any())]);
|
|
149
|
+
|
|
150
|
+
/** @internal */
|
|
151
|
+
export type MessagePayloadValidationExceptionDto5$Outbound =
|
|
152
|
+
| string
|
|
153
|
+
| number
|
|
154
|
+
| boolean
|
|
155
|
+
| { [k: string]: any };
|
|
156
|
+
|
|
157
|
+
/** @internal */
|
|
158
|
+
export const MessagePayloadValidationExceptionDto5$outboundSchema: z.ZodType<
|
|
159
|
+
MessagePayloadValidationExceptionDto5$Outbound,
|
|
160
|
+
z.ZodTypeDef,
|
|
161
|
+
MessagePayloadValidationExceptionDto5
|
|
162
|
+
> = z.union([z.string(), z.number(), z.boolean(), z.record(z.any())]);
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* @internal
|
|
166
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
167
|
+
*/
|
|
168
|
+
export namespace MessagePayloadValidationExceptionDto5$ {
|
|
169
|
+
/** @deprecated use `MessagePayloadValidationExceptionDto5$inboundSchema` instead. */
|
|
170
|
+
export const inboundSchema =
|
|
171
|
+
MessagePayloadValidationExceptionDto5$inboundSchema;
|
|
172
|
+
/** @deprecated use `MessagePayloadValidationExceptionDto5$outboundSchema` instead. */
|
|
173
|
+
export const outboundSchema =
|
|
174
|
+
MessagePayloadValidationExceptionDto5$outboundSchema;
|
|
175
|
+
/** @deprecated use `MessagePayloadValidationExceptionDto5$Outbound` instead. */
|
|
176
|
+
export type Outbound = MessagePayloadValidationExceptionDto5$Outbound;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export function messagePayloadValidationExceptionDto5ToJSON(
|
|
180
|
+
messagePayloadValidationExceptionDto5: MessagePayloadValidationExceptionDto5,
|
|
181
|
+
): string {
|
|
182
|
+
return JSON.stringify(
|
|
183
|
+
MessagePayloadValidationExceptionDto5$outboundSchema.parse(
|
|
184
|
+
messagePayloadValidationExceptionDto5,
|
|
185
|
+
),
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export function messagePayloadValidationExceptionDto5FromJSON(
|
|
190
|
+
jsonString: string,
|
|
191
|
+
): SafeParseResult<MessagePayloadValidationExceptionDto5, SDKValidationError> {
|
|
192
|
+
return safeParse(
|
|
193
|
+
jsonString,
|
|
194
|
+
(x) =>
|
|
195
|
+
MessagePayloadValidationExceptionDto5$inboundSchema.parse(JSON.parse(x)),
|
|
196
|
+
`Failed to parse 'MessagePayloadValidationExceptionDto5' from JSON`,
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/** @internal */
|
|
201
|
+
export const MessagePayloadValidationExceptionDto4$inboundSchema: z.ZodType<
|
|
202
|
+
MessagePayloadValidationExceptionDto4,
|
|
203
|
+
z.ZodTypeDef,
|
|
204
|
+
unknown
|
|
205
|
+
> = z.object({});
|
|
206
|
+
|
|
207
|
+
/** @internal */
|
|
208
|
+
export type MessagePayloadValidationExceptionDto4$Outbound = {};
|
|
209
|
+
|
|
210
|
+
/** @internal */
|
|
211
|
+
export const MessagePayloadValidationExceptionDto4$outboundSchema: z.ZodType<
|
|
212
|
+
MessagePayloadValidationExceptionDto4$Outbound,
|
|
213
|
+
z.ZodTypeDef,
|
|
214
|
+
MessagePayloadValidationExceptionDto4
|
|
215
|
+
> = z.object({});
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* @internal
|
|
219
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
220
|
+
*/
|
|
221
|
+
export namespace MessagePayloadValidationExceptionDto4$ {
|
|
222
|
+
/** @deprecated use `MessagePayloadValidationExceptionDto4$inboundSchema` instead. */
|
|
223
|
+
export const inboundSchema =
|
|
224
|
+
MessagePayloadValidationExceptionDto4$inboundSchema;
|
|
225
|
+
/** @deprecated use `MessagePayloadValidationExceptionDto4$outboundSchema` instead. */
|
|
226
|
+
export const outboundSchema =
|
|
227
|
+
MessagePayloadValidationExceptionDto4$outboundSchema;
|
|
228
|
+
/** @deprecated use `MessagePayloadValidationExceptionDto4$Outbound` instead. */
|
|
229
|
+
export type Outbound = MessagePayloadValidationExceptionDto4$Outbound;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export function messagePayloadValidationExceptionDto4ToJSON(
|
|
233
|
+
messagePayloadValidationExceptionDto4: MessagePayloadValidationExceptionDto4,
|
|
234
|
+
): string {
|
|
235
|
+
return JSON.stringify(
|
|
236
|
+
MessagePayloadValidationExceptionDto4$outboundSchema.parse(
|
|
237
|
+
messagePayloadValidationExceptionDto4,
|
|
238
|
+
),
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export function messagePayloadValidationExceptionDto4FromJSON(
|
|
243
|
+
jsonString: string,
|
|
244
|
+
): SafeParseResult<MessagePayloadValidationExceptionDto4, SDKValidationError> {
|
|
245
|
+
return safeParse(
|
|
246
|
+
jsonString,
|
|
247
|
+
(x) =>
|
|
248
|
+
MessagePayloadValidationExceptionDto4$inboundSchema.parse(JSON.parse(x)),
|
|
249
|
+
`Failed to parse 'MessagePayloadValidationExceptionDto4' from JSON`,
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/** @internal */
|
|
254
|
+
export const PayloadValidationExceptionDtoMessage$inboundSchema: z.ZodType<
|
|
255
|
+
PayloadValidationExceptionDtoMessage,
|
|
256
|
+
z.ZodTypeDef,
|
|
257
|
+
unknown
|
|
258
|
+
> = z.union([
|
|
259
|
+
z.lazy(() => MessagePayloadValidationExceptionDto4$inboundSchema),
|
|
260
|
+
z.string(),
|
|
261
|
+
z.number(),
|
|
262
|
+
z.boolean(),
|
|
263
|
+
z.array(
|
|
264
|
+
z.nullable(
|
|
265
|
+
z.union([z.string(), z.number(), z.boolean(), z.record(z.any())]),
|
|
266
|
+
),
|
|
267
|
+
),
|
|
268
|
+
]);
|
|
269
|
+
|
|
270
|
+
/** @internal */
|
|
271
|
+
export type PayloadValidationExceptionDtoMessage$Outbound =
|
|
272
|
+
| MessagePayloadValidationExceptionDto4$Outbound
|
|
273
|
+
| string
|
|
274
|
+
| number
|
|
275
|
+
| boolean
|
|
276
|
+
| Array<string | number | boolean | { [k: string]: any } | null>;
|
|
277
|
+
|
|
278
|
+
/** @internal */
|
|
279
|
+
export const PayloadValidationExceptionDtoMessage$outboundSchema: z.ZodType<
|
|
280
|
+
PayloadValidationExceptionDtoMessage$Outbound,
|
|
281
|
+
z.ZodTypeDef,
|
|
282
|
+
PayloadValidationExceptionDtoMessage
|
|
283
|
+
> = z.union([
|
|
284
|
+
z.lazy(() => MessagePayloadValidationExceptionDto4$outboundSchema),
|
|
285
|
+
z.string(),
|
|
286
|
+
z.number(),
|
|
287
|
+
z.boolean(),
|
|
288
|
+
z.array(
|
|
289
|
+
z.nullable(
|
|
290
|
+
z.union([z.string(), z.number(), z.boolean(), z.record(z.any())]),
|
|
291
|
+
),
|
|
292
|
+
),
|
|
293
|
+
]);
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* @internal
|
|
297
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
298
|
+
*/
|
|
299
|
+
export namespace PayloadValidationExceptionDtoMessage$ {
|
|
300
|
+
/** @deprecated use `PayloadValidationExceptionDtoMessage$inboundSchema` instead. */
|
|
301
|
+
export const inboundSchema =
|
|
302
|
+
PayloadValidationExceptionDtoMessage$inboundSchema;
|
|
303
|
+
/** @deprecated use `PayloadValidationExceptionDtoMessage$outboundSchema` instead. */
|
|
304
|
+
export const outboundSchema =
|
|
305
|
+
PayloadValidationExceptionDtoMessage$outboundSchema;
|
|
306
|
+
/** @deprecated use `PayloadValidationExceptionDtoMessage$Outbound` instead. */
|
|
307
|
+
export type Outbound = PayloadValidationExceptionDtoMessage$Outbound;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
export function payloadValidationExceptionDtoMessageToJSON(
|
|
311
|
+
payloadValidationExceptionDtoMessage: PayloadValidationExceptionDtoMessage,
|
|
312
|
+
): string {
|
|
313
|
+
return JSON.stringify(
|
|
314
|
+
PayloadValidationExceptionDtoMessage$outboundSchema.parse(
|
|
315
|
+
payloadValidationExceptionDtoMessage,
|
|
316
|
+
),
|
|
317
|
+
);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
export function payloadValidationExceptionDtoMessageFromJSON(
|
|
321
|
+
jsonString: string,
|
|
322
|
+
): SafeParseResult<PayloadValidationExceptionDtoMessage, SDKValidationError> {
|
|
323
|
+
return safeParse(
|
|
324
|
+
jsonString,
|
|
325
|
+
(x) =>
|
|
326
|
+
PayloadValidationExceptionDtoMessage$inboundSchema.parse(JSON.parse(x)),
|
|
327
|
+
`Failed to parse 'PayloadValidationExceptionDtoMessage' from JSON`,
|
|
328
|
+
);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
/** @internal */
|
|
332
|
+
export const Schema$inboundSchema: z.ZodType<Schema, z.ZodTypeDef, unknown> = z
|
|
333
|
+
.object({});
|
|
334
|
+
|
|
335
|
+
/** @internal */
|
|
336
|
+
export type Schema$Outbound = {};
|
|
337
|
+
|
|
338
|
+
/** @internal */
|
|
339
|
+
export const Schema$outboundSchema: z.ZodType<
|
|
340
|
+
Schema$Outbound,
|
|
341
|
+
z.ZodTypeDef,
|
|
342
|
+
Schema
|
|
343
|
+
> = z.object({});
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* @internal
|
|
347
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
348
|
+
*/
|
|
349
|
+
export namespace Schema$ {
|
|
350
|
+
/** @deprecated use `Schema$inboundSchema` instead. */
|
|
351
|
+
export const inboundSchema = Schema$inboundSchema;
|
|
352
|
+
/** @deprecated use `Schema$outboundSchema` instead. */
|
|
353
|
+
export const outboundSchema = Schema$outboundSchema;
|
|
354
|
+
/** @deprecated use `Schema$Outbound` instead. */
|
|
355
|
+
export type Outbound = Schema$Outbound;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
export function schemaToJSON(schema: Schema): string {
|
|
359
|
+
return JSON.stringify(Schema$outboundSchema.parse(schema));
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
export function schemaFromJSON(
|
|
363
|
+
jsonString: string,
|
|
364
|
+
): SafeParseResult<Schema, SDKValidationError> {
|
|
365
|
+
return safeParse(
|
|
366
|
+
jsonString,
|
|
367
|
+
(x) => Schema$inboundSchema.parse(JSON.parse(x)),
|
|
368
|
+
`Failed to parse 'Schema' from JSON`,
|
|
369
|
+
);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/** @internal */
|
|
373
|
+
export const PayloadValidationExceptionDto$inboundSchema: z.ZodType<
|
|
374
|
+
PayloadValidationExceptionDto,
|
|
375
|
+
z.ZodTypeDef,
|
|
376
|
+
unknown
|
|
377
|
+
> = z.object({
|
|
378
|
+
statusCode: z.number(),
|
|
379
|
+
timestamp: z.string(),
|
|
380
|
+
path: z.string(),
|
|
381
|
+
message: z.nullable(
|
|
382
|
+
z.union([
|
|
383
|
+
z.lazy(() => MessagePayloadValidationExceptionDto4$inboundSchema),
|
|
384
|
+
z.string(),
|
|
385
|
+
z.number(),
|
|
386
|
+
z.boolean(),
|
|
387
|
+
z.array(
|
|
388
|
+
z.nullable(
|
|
389
|
+
z.union([z.string(), z.number(), z.boolean(), z.record(z.any())]),
|
|
390
|
+
),
|
|
391
|
+
),
|
|
392
|
+
]),
|
|
393
|
+
).optional(),
|
|
394
|
+
ctx: z.record(z.any()).optional(),
|
|
395
|
+
errorId: z.string().optional(),
|
|
396
|
+
type: z.string(),
|
|
397
|
+
errors: z.array(components.PayloadValidationErrorDto$inboundSchema),
|
|
398
|
+
schema: z.lazy(() => Schema$inboundSchema).optional(),
|
|
399
|
+
})
|
|
400
|
+
.transform((v) => {
|
|
401
|
+
return new PayloadValidationExceptionDto(v);
|
|
402
|
+
});
|
|
403
|
+
|
|
404
|
+
/** @internal */
|
|
405
|
+
export type PayloadValidationExceptionDto$Outbound = {
|
|
406
|
+
statusCode: number;
|
|
407
|
+
timestamp: string;
|
|
408
|
+
path: string;
|
|
409
|
+
message?:
|
|
410
|
+
| MessagePayloadValidationExceptionDto4$Outbound
|
|
411
|
+
| string
|
|
412
|
+
| number
|
|
413
|
+
| boolean
|
|
414
|
+
| Array<string | number | boolean | { [k: string]: any } | null>
|
|
415
|
+
| null
|
|
416
|
+
| undefined;
|
|
417
|
+
ctx?: { [k: string]: any } | undefined;
|
|
418
|
+
errorId?: string | undefined;
|
|
419
|
+
type: string;
|
|
420
|
+
errors: Array<components.PayloadValidationErrorDto$Outbound>;
|
|
421
|
+
schema?: Schema$Outbound | undefined;
|
|
422
|
+
};
|
|
423
|
+
|
|
424
|
+
/** @internal */
|
|
425
|
+
export const PayloadValidationExceptionDto$outboundSchema: z.ZodType<
|
|
426
|
+
PayloadValidationExceptionDto$Outbound,
|
|
427
|
+
z.ZodTypeDef,
|
|
428
|
+
PayloadValidationExceptionDto
|
|
429
|
+
> = z.instanceof(PayloadValidationExceptionDto)
|
|
430
|
+
.transform(v => v.data$)
|
|
431
|
+
.pipe(z.object({
|
|
432
|
+
statusCode: z.number(),
|
|
433
|
+
timestamp: z.string(),
|
|
434
|
+
path: z.string(),
|
|
435
|
+
message: z.nullable(
|
|
436
|
+
z.union([
|
|
437
|
+
z.lazy(() => MessagePayloadValidationExceptionDto4$outboundSchema),
|
|
438
|
+
z.string(),
|
|
439
|
+
z.number(),
|
|
440
|
+
z.boolean(),
|
|
441
|
+
z.array(
|
|
442
|
+
z.nullable(
|
|
443
|
+
z.union([z.string(), z.number(), z.boolean(), z.record(z.any())]),
|
|
444
|
+
),
|
|
445
|
+
),
|
|
446
|
+
]),
|
|
447
|
+
).optional(),
|
|
448
|
+
ctx: z.record(z.any()).optional(),
|
|
449
|
+
errorId: z.string().optional(),
|
|
450
|
+
type: z.string(),
|
|
451
|
+
errors: z.array(components.PayloadValidationErrorDto$outboundSchema),
|
|
452
|
+
schema: z.lazy(() => Schema$outboundSchema).optional(),
|
|
453
|
+
}));
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* @internal
|
|
457
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
458
|
+
*/
|
|
459
|
+
export namespace PayloadValidationExceptionDto$ {
|
|
460
|
+
/** @deprecated use `PayloadValidationExceptionDto$inboundSchema` instead. */
|
|
461
|
+
export const inboundSchema = PayloadValidationExceptionDto$inboundSchema;
|
|
462
|
+
/** @deprecated use `PayloadValidationExceptionDto$outboundSchema` instead. */
|
|
463
|
+
export const outboundSchema = PayloadValidationExceptionDto$outboundSchema;
|
|
464
|
+
/** @deprecated use `PayloadValidationExceptionDto$Outbound` instead. */
|
|
465
|
+
export type Outbound = PayloadValidationExceptionDto$Outbound;
|
|
466
|
+
}
|
|
@@ -3,22 +3,37 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
export class SDKError extends Error {
|
|
6
|
+
/**
|
|
7
|
+
* HTTP status code
|
|
8
|
+
*/
|
|
6
9
|
public readonly statusCode: number;
|
|
10
|
+
/**
|
|
11
|
+
* HTTP content type
|
|
12
|
+
*/
|
|
7
13
|
public readonly contentType: string;
|
|
14
|
+
/**
|
|
15
|
+
* HTTP body
|
|
16
|
+
*/
|
|
17
|
+
public readonly body: string;
|
|
18
|
+
/**
|
|
19
|
+
* Raw response
|
|
20
|
+
*/
|
|
21
|
+
public readonly rawResponse: Response;
|
|
8
22
|
|
|
9
23
|
constructor(
|
|
10
24
|
message: string,
|
|
11
|
-
|
|
12
|
-
|
|
25
|
+
rawResponse: Response,
|
|
26
|
+
body: string = "",
|
|
13
27
|
) {
|
|
14
28
|
const statusCode = rawResponse.status;
|
|
15
29
|
const contentType = rawResponse.headers.get("content-type") || "";
|
|
16
30
|
const bodyString = body.length > 0 ? `\n${body}` : "";
|
|
17
|
-
|
|
18
31
|
super(
|
|
19
32
|
`${message}: Status ${statusCode} Content-Type ${contentType} Body ${bodyString}`,
|
|
20
33
|
);
|
|
21
34
|
|
|
35
|
+
this.body = body;
|
|
36
|
+
this.rawResponse = rawResponse;
|
|
22
37
|
this.statusCode = statusCode;
|
|
23
38
|
this.contentType = contentType;
|
|
24
39
|
|
package/src/sdk/subscribers.ts
CHANGED
|
@@ -92,7 +92,7 @@ export class Subscribers extends ClientSDK {
|
|
|
92
92
|
* Retrieve a subscriber
|
|
93
93
|
*
|
|
94
94
|
* @remarks
|
|
95
|
-
*
|
|
95
|
+
* Retrieve a subscriber by its unique key identifier **subscriberId**.
|
|
96
96
|
* **subscriberId** field is required.
|
|
97
97
|
*/
|
|
98
98
|
async retrieve(
|
|
@@ -131,10 +131,11 @@ export class Subscribers extends ClientSDK {
|
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
/**
|
|
134
|
-
* Delete subscriber
|
|
134
|
+
* Delete a subscriber
|
|
135
135
|
*
|
|
136
136
|
* @remarks
|
|
137
|
-
* Deletes a subscriber entity from the Novu platform along with associated messages, preferences, and topic subscriptions
|
|
137
|
+
* Deletes a subscriber entity from the Novu platform along with associated messages, preferences, and topic subscriptions.
|
|
138
|
+
* **subscriberId** is a required field.
|
|
138
139
|
*/
|
|
139
140
|
async delete(
|
|
140
141
|
subscriberId: string,
|
package/src/sdk/subscriptions.ts
CHANGED
|
@@ -15,7 +15,7 @@ export class Subscriptions extends ClientSDK {
|
|
|
15
15
|
* List topic subscriptions
|
|
16
16
|
*
|
|
17
17
|
* @remarks
|
|
18
|
-
* List all
|
|
18
|
+
* List all subscriptions of subscribers for a topic.
|
|
19
19
|
* Checkout all available filters in the query section.
|
|
20
20
|
*/
|
|
21
21
|
async list(
|