@novu/api 0.5.0 → 0.6.1
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/README.md +124 -68
- package/bin/mcp-server.js +223 -173
- package/bin/mcp-server.js.map +65 -64
- package/docs/sdks/authentication/README.md +17 -17
- package/docs/sdks/integrations/README.md +55 -55
- package/docs/sdks/novu/README.md +146 -146
- package/docs/sdks/novumessages/README.md +34 -34
- package/docs/sdks/stats/README.md +14 -14
- package/docs/sdks/subscribers/README.md +82 -82
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/sdks.d.ts.map +1 -1
- package/lib/sdks.js +2 -8
- package/lib/sdks.js.map +1 -1
- package/lib/security.d.ts +4 -3
- package/lib/security.d.ts.map +1 -1
- package/lib/security.js +6 -1
- package/lib/security.js.map +1 -1
- package/mcp-server/extensions.d.ts +11 -0
- package/mcp-server/extensions.d.ts.map +1 -0
- package/mcp-server/extensions.js +6 -0
- package/mcp-server/extensions.js.map +1 -0
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/prompts.d.ts +26 -0
- package/mcp-server/prompts.d.ts.map +1 -0
- package/mcp-server/prompts.js +48 -0
- package/mcp-server/prompts.js.map +1 -0
- package/mcp-server/resources.d.ts +9 -4
- package/mcp-server/resources.d.ts.map +1 -1
- package/mcp-server/resources.js +38 -10
- package/mcp-server/resources.js.map +1 -1
- package/mcp-server/server.d.ts.map +1 -1
- package/mcp-server/server.js +31 -24
- package/mcp-server/server.js.map +1 -1
- package/mcp-server/tools/integrationsCreate.js +1 -1
- package/mcp-server/tools/integrationsDelete.js +1 -1
- package/mcp-server/tools/integrationsList.js +1 -1
- package/mcp-server/tools/integrationsListActive.js +1 -1
- package/mcp-server/tools/integrationsSetAsPrimary.js +1 -1
- package/mcp-server/tools/integrationsUpdate.js +1 -1
- package/mcp-server/tools/integrationsWebhooksRetrieve.js +1 -1
- package/mcp-server/tools/messagesDelete.js +1 -1
- package/mcp-server/tools/messagesDeleteByTransactionId.js +1 -1
- package/mcp-server/tools/messagesRetrieve.js +1 -1
- package/mcp-server/tools/notificationsList.js +1 -1
- package/mcp-server/tools/notificationsRetrieve.js +1 -1
- package/mcp-server/tools/notificationsStatsGraph.js +1 -1
- package/mcp-server/tools/notificationsStatsRetrieve.js +1 -1
- package/mcp-server/tools/subscribersAuthenticationChatAccessOauth.js +1 -1
- package/mcp-server/tools/subscribersAuthenticationChatAccessOauthCallBack.js +1 -1
- package/mcp-server/tools/subscribersCreate.js +1 -1
- package/mcp-server/tools/subscribersCreateBulk.js +1 -1
- package/mcp-server/tools/subscribersCredentialsAppend.js +1 -1
- package/mcp-server/tools/subscribersCredentialsDelete.js +1 -1
- package/mcp-server/tools/subscribersCredentialsUpdate.js +1 -1
- package/mcp-server/tools/subscribersDelete.js +1 -1
- package/mcp-server/tools/subscribersList.js +1 -1
- package/mcp-server/tools/subscribersMessagesMarkAll.js +1 -1
- package/mcp-server/tools/subscribersMessagesMarkAllAs.js +1 -1
- package/mcp-server/tools/subscribersMessagesUpdateAsSeen.js +1 -1
- package/mcp-server/tools/subscribersNotificationsFeed.js +1 -1
- package/mcp-server/tools/subscribersNotificationsUnseenCount.js +1 -1
- package/mcp-server/tools/subscribersPatch.js +1 -1
- package/mcp-server/tools/subscribersPreferencesList.js +1 -1
- package/mcp-server/tools/subscribersPreferencesUpdate.js +1 -1
- package/mcp-server/tools/subscribersPropertiesUpdateOnlineFlag.js +1 -1
- package/mcp-server/tools/subscribersRetrieve.js +1 -1
- package/mcp-server/tools/subscribersSearch.js +1 -1
- package/mcp-server/tools/topicsCreate.js +1 -1
- package/mcp-server/tools/topicsDelete.js +1 -1
- package/mcp-server/tools/topicsList.js +1 -1
- package/mcp-server/tools/topicsRename.js +1 -1
- package/mcp-server/tools/topicsRetrieve.js +1 -1
- package/mcp-server/tools/topicsSubscribersAssign.js +1 -1
- package/mcp-server/tools/topicsSubscribersRemove.js +1 -1
- package/mcp-server/tools/topicsSubscribersRetrieve.js +1 -1
- package/mcp-server/tools.d.ts.map +1 -1
- package/mcp-server/tools.js +4 -0
- package/mcp-server/tools.js.map +1 -1
- package/models/components/activitynotificationjobresponsedto.d.ts +9 -0
- package/models/components/activitynotificationjobresponsedto.d.ts.map +1 -1
- package/models/components/activitynotificationjobresponsedto.js +2 -0
- package/models/components/activitynotificationjobresponsedto.js.map +1 -1
- package/models/components/channelsettingsdto.d.ts +8 -8
- package/models/components/channelsettingsdto.d.ts.map +1 -1
- package/models/components/channelsettingsdto.js +14 -13
- package/models/components/channelsettingsdto.js.map +1 -1
- package/models/components/index.d.ts +0 -1
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +0 -1
- package/models/components/index.js.map +1 -1
- package/models/components/integrationresponsedto.d.ts +8 -8
- package/models/components/integrationresponsedto.d.ts.map +1 -1
- package/models/components/integrationresponsedto.js +13 -14
- package/models/components/integrationresponsedto.js.map +1 -1
- package/models/components/markallmessageasrequestdto.d.ts +8 -8
- package/models/components/markallmessageasrequestdto.d.ts.map +1 -1
- package/models/components/markallmessageasrequestdto.js +14 -13
- package/models/components/markallmessageasrequestdto.js.map +1 -1
- package/models/components/messagemarkasrequestdto.d.ts +8 -8
- package/models/components/messagemarkasrequestdto.d.ts.map +1 -1
- package/models/components/messagemarkasrequestdto.js +13 -14
- package/models/components/messagemarkasrequestdto.js.map +1 -1
- package/models/components/overrides.d.ts +8 -8
- package/models/components/overrides.d.ts.map +1 -1
- package/models/components/overrides.js +14 -13
- package/models/components/overrides.js.map +1 -1
- package/models/components/patchsubscriberrequestdto.d.ts +15 -15
- package/models/components/patchsubscriberrequestdto.d.ts.map +1 -1
- package/models/components/patchsubscriberrequestdto.js +19 -20
- package/models/components/patchsubscriberrequestdto.js.map +1 -1
- package/models/components/subscriberchanneldto.d.ts +8 -8
- package/models/components/subscriberchanneldto.d.ts.map +1 -1
- package/models/components/subscriberchanneldto.js +13 -14
- package/models/components/subscriberchanneldto.js.map +1 -1
- package/models/components/subscriberpayloaddto.d.ts +13 -13
- package/models/components/subscriberpayloaddto.d.ts.map +1 -1
- package/models/components/subscriberpayloaddto.js +16 -17
- package/models/components/subscriberpayloaddto.js.map +1 -1
- package/models/operations/eventscontrollercancel.d.ts +2 -3
- package/models/operations/eventscontrollercancel.d.ts.map +1 -1
- package/models/operations/eventscontrollercancel.js +2 -3
- package/models/operations/eventscontrollercancel.js.map +1 -1
- package/models/operations/notificationscontrollerlistnotifications.d.ts +2 -2
- package/package.json +2 -2
- package/sdk/authentication.d.ts +4 -4
- package/sdk/authentication.d.ts.map +1 -1
- package/sdk/authentication.js +6 -6
- package/sdk/authentication.js.map +1 -1
- package/sdk/integrations.d.ts +7 -7
- package/sdk/integrations.d.ts.map +1 -1
- package/sdk/integrations.js +9 -9
- package/sdk/integrations.js.map +1 -1
- package/sdk/novumessages.d.ts +4 -4
- package/sdk/novumessages.d.ts.map +1 -1
- package/sdk/novumessages.js +6 -6
- package/sdk/novumessages.js.map +1 -1
- package/sdk/sdk.d.ts +12 -12
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +15 -15
- package/sdk/sdk.js.map +1 -1
- package/sdk/stats.d.ts +4 -4
- package/sdk/stats.d.ts.map +1 -1
- package/sdk/stats.js +6 -6
- package/sdk/stats.js.map +1 -1
- package/sdk/subscribers.d.ts +26 -26
- package/sdk/subscribers.d.ts.map +1 -1
- package/sdk/subscribers.js +29 -29
- package/sdk/subscribers.js.map +1 -1
- package/sources/json-development.json +1146 -1148
- package/src/lib/config.ts +3 -3
- package/src/lib/sdks.ts +2 -7
- package/src/lib/security.ts +11 -3
- package/src/mcp-server/extensions.ts +17 -0
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/prompts.ts +110 -0
- package/src/mcp-server/resources.ts +76 -14
- package/src/mcp-server/server.ts +41 -24
- package/src/mcp-server/tools/integrationsCreate.ts +1 -1
- package/src/mcp-server/tools/integrationsDelete.ts +1 -1
- package/src/mcp-server/tools/integrationsList.ts +1 -1
- package/src/mcp-server/tools/integrationsListActive.ts +1 -1
- package/src/mcp-server/tools/integrationsSetAsPrimary.ts +1 -1
- package/src/mcp-server/tools/integrationsUpdate.ts +1 -1
- package/src/mcp-server/tools/integrationsWebhooksRetrieve.ts +1 -1
- package/src/mcp-server/tools/messagesDelete.ts +1 -1
- package/src/mcp-server/tools/messagesDeleteByTransactionId.ts +1 -1
- package/src/mcp-server/tools/messagesRetrieve.ts +1 -1
- package/src/mcp-server/tools/notificationsList.ts +1 -1
- package/src/mcp-server/tools/notificationsRetrieve.ts +1 -1
- package/src/mcp-server/tools/notificationsStatsGraph.ts +1 -1
- package/src/mcp-server/tools/notificationsStatsRetrieve.ts +1 -1
- package/src/mcp-server/tools/subscribersAuthenticationChatAccessOauth.ts +1 -1
- package/src/mcp-server/tools/subscribersAuthenticationChatAccessOauthCallBack.ts +1 -1
- package/src/mcp-server/tools/subscribersCreate.ts +1 -1
- package/src/mcp-server/tools/subscribersCreateBulk.ts +1 -1
- package/src/mcp-server/tools/subscribersCredentialsAppend.ts +1 -1
- package/src/mcp-server/tools/subscribersCredentialsDelete.ts +1 -1
- package/src/mcp-server/tools/subscribersCredentialsUpdate.ts +1 -1
- package/src/mcp-server/tools/subscribersDelete.ts +1 -1
- package/src/mcp-server/tools/subscribersList.ts +1 -1
- package/src/mcp-server/tools/subscribersMessagesMarkAll.ts +1 -1
- package/src/mcp-server/tools/subscribersMessagesMarkAllAs.ts +1 -1
- package/src/mcp-server/tools/subscribersMessagesUpdateAsSeen.ts +1 -1
- package/src/mcp-server/tools/subscribersNotificationsFeed.ts +1 -1
- package/src/mcp-server/tools/subscribersNotificationsUnseenCount.ts +1 -1
- package/src/mcp-server/tools/subscribersPatch.ts +1 -1
- package/src/mcp-server/tools/subscribersPreferencesList.ts +1 -1
- package/src/mcp-server/tools/subscribersPreferencesUpdate.ts +1 -1
- package/src/mcp-server/tools/subscribersPropertiesUpdateOnlineFlag.ts +1 -1
- package/src/mcp-server/tools/subscribersRetrieve.ts +1 -1
- package/src/mcp-server/tools/subscribersSearch.ts +1 -1
- package/src/mcp-server/tools/topicsCreate.ts +1 -1
- package/src/mcp-server/tools/topicsDelete.ts +1 -1
- package/src/mcp-server/tools/topicsList.ts +1 -1
- package/src/mcp-server/tools/topicsRename.ts +1 -1
- package/src/mcp-server/tools/topicsRetrieve.ts +1 -1
- package/src/mcp-server/tools/topicsSubscribersAssign.ts +1 -1
- package/src/mcp-server/tools/topicsSubscribersRemove.ts +1 -1
- package/src/mcp-server/tools/topicsSubscribersRetrieve.ts +1 -1
- package/src/mcp-server/tools.ts +5 -0
- package/src/models/components/activitynotificationjobresponsedto.ts +7 -0
- package/src/models/components/channelsettingsdto.ts +14 -18
- package/src/models/components/index.ts +0 -1
- package/src/models/components/integrationresponsedto.ts +18 -14
- package/src/models/components/markallmessageasrequestdto.ts +14 -18
- package/src/models/components/messagemarkasrequestdto.ts +18 -14
- package/src/models/components/overrides.ts +14 -16
- package/src/models/components/patchsubscriberrequestdto.ts +23 -37
- package/src/models/components/subscriberchanneldto.ts +18 -14
- package/src/models/components/subscriberpayloaddto.ts +37 -19
- package/src/models/operations/eventscontrollercancel.ts +4 -5
- package/src/models/operations/notificationscontrollerlistnotifications.ts +2 -2
- package/src/sdk/authentication.ts +16 -16
- package/src/sdk/integrations.ts +17 -17
- package/src/sdk/novumessages.ts +16 -16
- package/src/sdk/sdk.ts +24 -24
- package/src/sdk/stats.ts +10 -10
- package/src/sdk/subscribers.ts +61 -61
- package/models/components/databooleandto.d.ts +0 -29
- package/models/components/databooleandto.d.ts.map +0 -1
- package/models/components/databooleandto.js +0 -59
- package/models/components/databooleandto.js.map +0 -1
- package/src/models/components/databooleandto.ts +0 -62
|
@@ -11,7 +11,7 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
|
11
11
|
/**
|
|
12
12
|
* The channel type which is overridden
|
|
13
13
|
*/
|
|
14
|
-
export const
|
|
14
|
+
export const Channel = {
|
|
15
15
|
InApp: "in_app",
|
|
16
16
|
Email: "email",
|
|
17
17
|
Sms: "sms",
|
|
@@ -21,7 +21,7 @@ export const OverridesChannel = {
|
|
|
21
21
|
/**
|
|
22
22
|
* The channel type which is overridden
|
|
23
23
|
*/
|
|
24
|
-
export type
|
|
24
|
+
export type Channel = ClosedEnum<typeof Channel>;
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* The source of overrides
|
|
@@ -40,7 +40,7 @@ export type Overrides = {
|
|
|
40
40
|
/**
|
|
41
41
|
* The channel type which is overridden
|
|
42
42
|
*/
|
|
43
|
-
channel:
|
|
43
|
+
channel: Channel;
|
|
44
44
|
/**
|
|
45
45
|
* The source of overrides
|
|
46
46
|
*/
|
|
@@ -48,24 +48,22 @@ export type Overrides = {
|
|
|
48
48
|
};
|
|
49
49
|
|
|
50
50
|
/** @internal */
|
|
51
|
-
export const
|
|
52
|
-
|
|
53
|
-
> = z.nativeEnum(OverridesChannel);
|
|
51
|
+
export const Channel$inboundSchema: z.ZodNativeEnum<typeof Channel> = z
|
|
52
|
+
.nativeEnum(Channel);
|
|
54
53
|
|
|
55
54
|
/** @internal */
|
|
56
|
-
export const
|
|
57
|
-
|
|
58
|
-
> = OverridesChannel$inboundSchema;
|
|
55
|
+
export const Channel$outboundSchema: z.ZodNativeEnum<typeof Channel> =
|
|
56
|
+
Channel$inboundSchema;
|
|
59
57
|
|
|
60
58
|
/**
|
|
61
59
|
* @internal
|
|
62
60
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
63
61
|
*/
|
|
64
|
-
export namespace
|
|
65
|
-
/** @deprecated use `
|
|
66
|
-
export const inboundSchema =
|
|
67
|
-
/** @deprecated use `
|
|
68
|
-
export const outboundSchema =
|
|
62
|
+
export namespace Channel$ {
|
|
63
|
+
/** @deprecated use `Channel$inboundSchema` instead. */
|
|
64
|
+
export const inboundSchema = Channel$inboundSchema;
|
|
65
|
+
/** @deprecated use `Channel$outboundSchema` instead. */
|
|
66
|
+
export const outboundSchema = Channel$outboundSchema;
|
|
69
67
|
}
|
|
70
68
|
|
|
71
69
|
/** @internal */
|
|
@@ -93,7 +91,7 @@ export const Overrides$inboundSchema: z.ZodType<
|
|
|
93
91
|
z.ZodTypeDef,
|
|
94
92
|
unknown
|
|
95
93
|
> = z.object({
|
|
96
|
-
channel:
|
|
94
|
+
channel: Channel$inboundSchema,
|
|
97
95
|
source: Source$inboundSchema,
|
|
98
96
|
});
|
|
99
97
|
|
|
@@ -109,7 +107,7 @@ export const Overrides$outboundSchema: z.ZodType<
|
|
|
109
107
|
z.ZodTypeDef,
|
|
110
108
|
Overrides
|
|
111
109
|
> = z.object({
|
|
112
|
-
channel:
|
|
110
|
+
channel: Channel$outboundSchema,
|
|
113
111
|
source: Source$outboundSchema,
|
|
114
112
|
});
|
|
115
113
|
|
|
@@ -10,7 +10,7 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
|
10
10
|
/**
|
|
11
11
|
* Additional custom data for the subscriber
|
|
12
12
|
*/
|
|
13
|
-
export type
|
|
13
|
+
export type Data = {};
|
|
14
14
|
|
|
15
15
|
export type PatchSubscriberRequestDto = {
|
|
16
16
|
/**
|
|
@@ -44,56 +44,44 @@ export type PatchSubscriberRequestDto = {
|
|
|
44
44
|
/**
|
|
45
45
|
* Additional custom data for the subscriber
|
|
46
46
|
*/
|
|
47
|
-
data?:
|
|
47
|
+
data?: Data | null | undefined;
|
|
48
48
|
};
|
|
49
49
|
|
|
50
50
|
/** @internal */
|
|
51
|
-
export const
|
|
52
|
-
|
|
53
|
-
z.ZodTypeDef,
|
|
54
|
-
unknown
|
|
55
|
-
> = z.object({});
|
|
51
|
+
export const Data$inboundSchema: z.ZodType<Data, z.ZodTypeDef, unknown> = z
|
|
52
|
+
.object({});
|
|
56
53
|
|
|
57
54
|
/** @internal */
|
|
58
|
-
export type
|
|
55
|
+
export type Data$Outbound = {};
|
|
59
56
|
|
|
60
57
|
/** @internal */
|
|
61
|
-
export const
|
|
62
|
-
|
|
63
|
-
z.ZodTypeDef,
|
|
64
|
-
PatchSubscriberRequestDtoData
|
|
65
|
-
> = z.object({});
|
|
58
|
+
export const Data$outboundSchema: z.ZodType<Data$Outbound, z.ZodTypeDef, Data> =
|
|
59
|
+
z.object({});
|
|
66
60
|
|
|
67
61
|
/**
|
|
68
62
|
* @internal
|
|
69
63
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
70
64
|
*/
|
|
71
|
-
export namespace
|
|
72
|
-
/** @deprecated use `
|
|
73
|
-
export const inboundSchema =
|
|
74
|
-
/** @deprecated use `
|
|
75
|
-
export const outboundSchema =
|
|
76
|
-
/** @deprecated use `
|
|
77
|
-
export type Outbound =
|
|
65
|
+
export namespace Data$ {
|
|
66
|
+
/** @deprecated use `Data$inboundSchema` instead. */
|
|
67
|
+
export const inboundSchema = Data$inboundSchema;
|
|
68
|
+
/** @deprecated use `Data$outboundSchema` instead. */
|
|
69
|
+
export const outboundSchema = Data$outboundSchema;
|
|
70
|
+
/** @deprecated use `Data$Outbound` instead. */
|
|
71
|
+
export type Outbound = Data$Outbound;
|
|
78
72
|
}
|
|
79
73
|
|
|
80
|
-
export function
|
|
81
|
-
|
|
82
|
-
): string {
|
|
83
|
-
return JSON.stringify(
|
|
84
|
-
PatchSubscriberRequestDtoData$outboundSchema.parse(
|
|
85
|
-
patchSubscriberRequestDtoData,
|
|
86
|
-
),
|
|
87
|
-
);
|
|
74
|
+
export function dataToJSON(data: Data): string {
|
|
75
|
+
return JSON.stringify(Data$outboundSchema.parse(data));
|
|
88
76
|
}
|
|
89
77
|
|
|
90
|
-
export function
|
|
78
|
+
export function dataFromJSON(
|
|
91
79
|
jsonString: string,
|
|
92
|
-
): SafeParseResult<
|
|
80
|
+
): SafeParseResult<Data, SDKValidationError> {
|
|
93
81
|
return safeParse(
|
|
94
82
|
jsonString,
|
|
95
|
-
(x) =>
|
|
96
|
-
`Failed to parse '
|
|
83
|
+
(x) => Data$inboundSchema.parse(JSON.parse(x)),
|
|
84
|
+
`Failed to parse 'Data' from JSON`,
|
|
97
85
|
);
|
|
98
86
|
}
|
|
99
87
|
|
|
@@ -110,8 +98,7 @@ export const PatchSubscriberRequestDto$inboundSchema: z.ZodType<
|
|
|
110
98
|
avatar: z.nullable(z.string()).optional(),
|
|
111
99
|
timezone: z.nullable(z.string()).optional(),
|
|
112
100
|
locale: z.nullable(z.string()).optional(),
|
|
113
|
-
data: z.nullable(z.lazy(() =>
|
|
114
|
-
.optional(),
|
|
101
|
+
data: z.nullable(z.lazy(() => Data$inboundSchema)).optional(),
|
|
115
102
|
});
|
|
116
103
|
|
|
117
104
|
/** @internal */
|
|
@@ -123,7 +110,7 @@ export type PatchSubscriberRequestDto$Outbound = {
|
|
|
123
110
|
avatar?: string | null | undefined;
|
|
124
111
|
timezone?: string | null | undefined;
|
|
125
112
|
locale?: string | null | undefined;
|
|
126
|
-
data?:
|
|
113
|
+
data?: Data$Outbound | null | undefined;
|
|
127
114
|
};
|
|
128
115
|
|
|
129
116
|
/** @internal */
|
|
@@ -139,8 +126,7 @@ export const PatchSubscriberRequestDto$outboundSchema: z.ZodType<
|
|
|
139
126
|
avatar: z.nullable(z.string()).optional(),
|
|
140
127
|
timezone: z.nullable(z.string()).optional(),
|
|
141
128
|
locale: z.nullable(z.string()).optional(),
|
|
142
|
-
data: z.nullable(z.lazy(() =>
|
|
143
|
-
.optional(),
|
|
129
|
+
data: z.nullable(z.lazy(() => Data$outboundSchema)).optional(),
|
|
144
130
|
});
|
|
145
131
|
|
|
146
132
|
/**
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
/**
|
|
18
18
|
* The ID of the chat or push provider.
|
|
19
19
|
*/
|
|
20
|
-
export const
|
|
20
|
+
export const SubscriberChannelDtoProviderId = {
|
|
21
21
|
Slack: "slack",
|
|
22
22
|
Discord: "discord",
|
|
23
23
|
Msteams: "msteams",
|
|
@@ -39,13 +39,15 @@ export const ProviderId = {
|
|
|
39
39
|
/**
|
|
40
40
|
* The ID of the chat or push provider.
|
|
41
41
|
*/
|
|
42
|
-
export type
|
|
42
|
+
export type SubscriberChannelDtoProviderId = ClosedEnum<
|
|
43
|
+
typeof SubscriberChannelDtoProviderId
|
|
44
|
+
>;
|
|
43
45
|
|
|
44
46
|
export type SubscriberChannelDto = {
|
|
45
47
|
/**
|
|
46
48
|
* The ID of the chat or push provider.
|
|
47
49
|
*/
|
|
48
|
-
providerId:
|
|
50
|
+
providerId: SubscriberChannelDtoProviderId;
|
|
49
51
|
/**
|
|
50
52
|
* An optional identifier for the integration.
|
|
51
53
|
*/
|
|
@@ -57,22 +59,24 @@ export type SubscriberChannelDto = {
|
|
|
57
59
|
};
|
|
58
60
|
|
|
59
61
|
/** @internal */
|
|
60
|
-
export const
|
|
61
|
-
|
|
62
|
+
export const SubscriberChannelDtoProviderId$inboundSchema: z.ZodNativeEnum<
|
|
63
|
+
typeof SubscriberChannelDtoProviderId
|
|
64
|
+
> = z.nativeEnum(SubscriberChannelDtoProviderId);
|
|
62
65
|
|
|
63
66
|
/** @internal */
|
|
64
|
-
export const
|
|
65
|
-
|
|
67
|
+
export const SubscriberChannelDtoProviderId$outboundSchema: z.ZodNativeEnum<
|
|
68
|
+
typeof SubscriberChannelDtoProviderId
|
|
69
|
+
> = SubscriberChannelDtoProviderId$inboundSchema;
|
|
66
70
|
|
|
67
71
|
/**
|
|
68
72
|
* @internal
|
|
69
73
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
70
74
|
*/
|
|
71
|
-
export namespace
|
|
72
|
-
/** @deprecated use `
|
|
73
|
-
export const inboundSchema =
|
|
74
|
-
/** @deprecated use `
|
|
75
|
-
export const outboundSchema =
|
|
75
|
+
export namespace SubscriberChannelDtoProviderId$ {
|
|
76
|
+
/** @deprecated use `SubscriberChannelDtoProviderId$inboundSchema` instead. */
|
|
77
|
+
export const inboundSchema = SubscriberChannelDtoProviderId$inboundSchema;
|
|
78
|
+
/** @deprecated use `SubscriberChannelDtoProviderId$outboundSchema` instead. */
|
|
79
|
+
export const outboundSchema = SubscriberChannelDtoProviderId$outboundSchema;
|
|
76
80
|
}
|
|
77
81
|
|
|
78
82
|
/** @internal */
|
|
@@ -81,7 +85,7 @@ export const SubscriberChannelDto$inboundSchema: z.ZodType<
|
|
|
81
85
|
z.ZodTypeDef,
|
|
82
86
|
unknown
|
|
83
87
|
> = z.object({
|
|
84
|
-
providerId:
|
|
88
|
+
providerId: SubscriberChannelDtoProviderId$inboundSchema,
|
|
85
89
|
integrationIdentifier: z.string().optional(),
|
|
86
90
|
credentials: ChannelCredentialsDto$inboundSchema,
|
|
87
91
|
});
|
|
@@ -99,7 +103,7 @@ export const SubscriberChannelDto$outboundSchema: z.ZodType<
|
|
|
99
103
|
z.ZodTypeDef,
|
|
100
104
|
SubscriberChannelDto
|
|
101
105
|
> = z.object({
|
|
102
|
-
providerId:
|
|
106
|
+
providerId: SubscriberChannelDtoProviderId$outboundSchema,
|
|
103
107
|
integrationIdentifier: z.string().optional(),
|
|
104
108
|
credentials: ChannelCredentialsDto$outboundSchema,
|
|
105
109
|
});
|
|
@@ -13,7 +13,11 @@ import {
|
|
|
13
13
|
SubscriberChannelDto$outboundSchema,
|
|
14
14
|
} from "./subscriberchanneldto.js";
|
|
15
15
|
|
|
16
|
-
export type
|
|
16
|
+
export type SubscriberPayloadDtoData =
|
|
17
|
+
| string
|
|
18
|
+
| Array<string>
|
|
19
|
+
| boolean
|
|
20
|
+
| number;
|
|
17
21
|
|
|
18
22
|
export type SubscriberPayloadDto = {
|
|
19
23
|
/**
|
|
@@ -59,40 +63,54 @@ export type SubscriberPayloadDto = {
|
|
|
59
63
|
};
|
|
60
64
|
|
|
61
65
|
/** @internal */
|
|
62
|
-
export const
|
|
63
|
-
|
|
66
|
+
export const SubscriberPayloadDtoData$inboundSchema: z.ZodType<
|
|
67
|
+
SubscriberPayloadDtoData,
|
|
68
|
+
z.ZodTypeDef,
|
|
69
|
+
unknown
|
|
70
|
+
> = z.union([z.string(), z.array(z.string()), z.boolean(), z.number()]);
|
|
64
71
|
|
|
65
72
|
/** @internal */
|
|
66
|
-
export type
|
|
73
|
+
export type SubscriberPayloadDtoData$Outbound =
|
|
74
|
+
| string
|
|
75
|
+
| Array<string>
|
|
76
|
+
| boolean
|
|
77
|
+
| number;
|
|
67
78
|
|
|
68
79
|
/** @internal */
|
|
69
|
-
export const
|
|
70
|
-
|
|
80
|
+
export const SubscriberPayloadDtoData$outboundSchema: z.ZodType<
|
|
81
|
+
SubscriberPayloadDtoData$Outbound,
|
|
82
|
+
z.ZodTypeDef,
|
|
83
|
+
SubscriberPayloadDtoData
|
|
84
|
+
> = z.union([z.string(), z.array(z.string()), z.boolean(), z.number()]);
|
|
71
85
|
|
|
72
86
|
/**
|
|
73
87
|
* @internal
|
|
74
88
|
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
75
89
|
*/
|
|
76
|
-
export namespace
|
|
77
|
-
/** @deprecated use `
|
|
78
|
-
export const inboundSchema =
|
|
79
|
-
/** @deprecated use `
|
|
80
|
-
export const outboundSchema =
|
|
81
|
-
/** @deprecated use `
|
|
82
|
-
export type Outbound =
|
|
90
|
+
export namespace SubscriberPayloadDtoData$ {
|
|
91
|
+
/** @deprecated use `SubscriberPayloadDtoData$inboundSchema` instead. */
|
|
92
|
+
export const inboundSchema = SubscriberPayloadDtoData$inboundSchema;
|
|
93
|
+
/** @deprecated use `SubscriberPayloadDtoData$outboundSchema` instead. */
|
|
94
|
+
export const outboundSchema = SubscriberPayloadDtoData$outboundSchema;
|
|
95
|
+
/** @deprecated use `SubscriberPayloadDtoData$Outbound` instead. */
|
|
96
|
+
export type Outbound = SubscriberPayloadDtoData$Outbound;
|
|
83
97
|
}
|
|
84
98
|
|
|
85
|
-
export function
|
|
86
|
-
|
|
99
|
+
export function subscriberPayloadDtoDataToJSON(
|
|
100
|
+
subscriberPayloadDtoData: SubscriberPayloadDtoData,
|
|
101
|
+
): string {
|
|
102
|
+
return JSON.stringify(
|
|
103
|
+
SubscriberPayloadDtoData$outboundSchema.parse(subscriberPayloadDtoData),
|
|
104
|
+
);
|
|
87
105
|
}
|
|
88
106
|
|
|
89
|
-
export function
|
|
107
|
+
export function subscriberPayloadDtoDataFromJSON(
|
|
90
108
|
jsonString: string,
|
|
91
|
-
): SafeParseResult<
|
|
109
|
+
): SafeParseResult<SubscriberPayloadDtoData, SDKValidationError> {
|
|
92
110
|
return safeParse(
|
|
93
111
|
jsonString,
|
|
94
|
-
(x) =>
|
|
95
|
-
`Failed to parse '
|
|
112
|
+
(x) => SubscriberPayloadDtoData$inboundSchema.parse(JSON.parse(x)),
|
|
113
|
+
`Failed to parse 'SubscriberPayloadDtoData' from JSON`,
|
|
96
114
|
);
|
|
97
115
|
}
|
|
98
116
|
|
|
@@ -6,7 +6,6 @@ import * as z from "zod";
|
|
|
6
6
|
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
8
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
-
import * as components from "../components/index.js";
|
|
10
9
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
10
|
|
|
12
11
|
export type EventsControllerCancelRequest = {
|
|
@@ -19,7 +18,7 @@ export type EventsControllerCancelRequest = {
|
|
|
19
18
|
|
|
20
19
|
export type EventsControllerCancelResponse = {
|
|
21
20
|
headers: { [k: string]: Array<string> };
|
|
22
|
-
result:
|
|
21
|
+
result: boolean;
|
|
23
22
|
};
|
|
24
23
|
|
|
25
24
|
/** @internal */
|
|
@@ -96,7 +95,7 @@ export const EventsControllerCancelResponse$inboundSchema: z.ZodType<
|
|
|
96
95
|
unknown
|
|
97
96
|
> = z.object({
|
|
98
97
|
Headers: z.record(z.array(z.string())),
|
|
99
|
-
Result:
|
|
98
|
+
Result: z.boolean(),
|
|
100
99
|
}).transform((v) => {
|
|
101
100
|
return remap$(v, {
|
|
102
101
|
"Headers": "headers",
|
|
@@ -107,7 +106,7 @@ export const EventsControllerCancelResponse$inboundSchema: z.ZodType<
|
|
|
107
106
|
/** @internal */
|
|
108
107
|
export type EventsControllerCancelResponse$Outbound = {
|
|
109
108
|
Headers: { [k: string]: Array<string> };
|
|
110
|
-
Result:
|
|
109
|
+
Result: boolean;
|
|
111
110
|
};
|
|
112
111
|
|
|
113
112
|
/** @internal */
|
|
@@ -117,7 +116,7 @@ export const EventsControllerCancelResponse$outboundSchema: z.ZodType<
|
|
|
117
116
|
EventsControllerCancelResponse
|
|
118
117
|
> = z.object({
|
|
119
118
|
headers: z.record(z.array(z.string())),
|
|
120
|
-
result:
|
|
119
|
+
result: z.boolean(),
|
|
121
120
|
}).transform((v) => {
|
|
122
121
|
return remap$(v, {
|
|
123
122
|
headers: "Headers",
|
|
@@ -45,11 +45,11 @@ export type NotificationsControllerListNotificationsRequest = {
|
|
|
45
45
|
*/
|
|
46
46
|
transactionId?: string | undefined;
|
|
47
47
|
/**
|
|
48
|
-
* Date filter for records after this timestamp
|
|
48
|
+
* Date filter for records after this timestamp. Defaults to earliest date allowed by subscription plan
|
|
49
49
|
*/
|
|
50
50
|
after?: string | undefined;
|
|
51
51
|
/**
|
|
52
|
-
* Date filter for records before this timestamp
|
|
52
|
+
* Date filter for records before this timestamp. Defaults to current time of request (now)
|
|
53
53
|
*/
|
|
54
54
|
before?: string | undefined;
|
|
55
55
|
/**
|
|
@@ -14,22 +14,6 @@ import { unwrapAsync } from "../types/fp.js";
|
|
|
14
14
|
export { ChatAccessOauthCallBackAcceptEnum } from "../funcs/subscribersAuthenticationChatAccessOauthCallBack.js";
|
|
15
15
|
|
|
16
16
|
export class Authentication extends ClientSDK {
|
|
17
|
-
/**
|
|
18
|
-
* Handle providers oauth redirect
|
|
19
|
-
*/
|
|
20
|
-
async chatAccessOauthCallBack(
|
|
21
|
-
request: operations.SubscribersV1ControllerChatOauthCallbackRequest,
|
|
22
|
-
options?: RequestOptions & {
|
|
23
|
-
acceptHeaderOverride?: ChatAccessOauthCallBackAcceptEnum;
|
|
24
|
-
},
|
|
25
|
-
): Promise<operations.SubscribersV1ControllerChatOauthCallbackResponse> {
|
|
26
|
-
return unwrapAsync(subscribersAuthenticationChatAccessOauthCallBack(
|
|
27
|
-
this,
|
|
28
|
-
request,
|
|
29
|
-
options,
|
|
30
|
-
));
|
|
31
|
-
}
|
|
32
|
-
|
|
33
17
|
/**
|
|
34
18
|
* Handle chat oauth
|
|
35
19
|
*/
|
|
@@ -45,4 +29,20 @@ export class Authentication extends ClientSDK {
|
|
|
45
29
|
options,
|
|
46
30
|
));
|
|
47
31
|
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Handle providers oauth redirect
|
|
35
|
+
*/
|
|
36
|
+
async chatAccessOauthCallBack(
|
|
37
|
+
request: operations.SubscribersV1ControllerChatOauthCallbackRequest,
|
|
38
|
+
options?: RequestOptions & {
|
|
39
|
+
acceptHeaderOverride?: ChatAccessOauthCallBackAcceptEnum;
|
|
40
|
+
},
|
|
41
|
+
): Promise<operations.SubscribersV1ControllerChatOauthCallbackResponse> {
|
|
42
|
+
return unwrapAsync(subscribersAuthenticationChatAccessOauthCallBack(
|
|
43
|
+
this,
|
|
44
|
+
request,
|
|
45
|
+
options,
|
|
46
|
+
));
|
|
47
|
+
}
|
|
48
48
|
}
|
package/src/sdk/integrations.ts
CHANGED
|
@@ -56,23 +56,6 @@ export class Integrations extends ClientSDK {
|
|
|
56
56
|
));
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
/**
|
|
60
|
-
* Get active integrations
|
|
61
|
-
*
|
|
62
|
-
* @remarks
|
|
63
|
-
* Return all the active integrations the user has created for that organization. Review v.0.17.0 changelog for a breaking change
|
|
64
|
-
*/
|
|
65
|
-
async listActive(
|
|
66
|
-
idempotencyKey?: string | undefined,
|
|
67
|
-
options?: RequestOptions,
|
|
68
|
-
): Promise<operations.IntegrationsControllerGetActiveIntegrationsResponse> {
|
|
69
|
-
return unwrapAsync(integrationsListActive(
|
|
70
|
-
this,
|
|
71
|
-
idempotencyKey,
|
|
72
|
-
options,
|
|
73
|
-
));
|
|
74
|
-
}
|
|
75
|
-
|
|
76
59
|
/**
|
|
77
60
|
* Update integration
|
|
78
61
|
*/
|
|
@@ -122,4 +105,21 @@ export class Integrations extends ClientSDK {
|
|
|
122
105
|
options,
|
|
123
106
|
));
|
|
124
107
|
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Get active integrations
|
|
111
|
+
*
|
|
112
|
+
* @remarks
|
|
113
|
+
* Return all the active integrations the user has created for that organization. Review v.0.17.0 changelog for a breaking change
|
|
114
|
+
*/
|
|
115
|
+
async listActive(
|
|
116
|
+
idempotencyKey?: string | undefined,
|
|
117
|
+
options?: RequestOptions,
|
|
118
|
+
): Promise<operations.IntegrationsControllerGetActiveIntegrationsResponse> {
|
|
119
|
+
return unwrapAsync(integrationsListActive(
|
|
120
|
+
this,
|
|
121
|
+
idempotencyKey,
|
|
122
|
+
options,
|
|
123
|
+
));
|
|
124
|
+
}
|
|
125
125
|
}
|
package/src/sdk/novumessages.ts
CHANGED
|
@@ -12,19 +12,15 @@ import { unwrapAsync } from "../types/fp.js";
|
|
|
12
12
|
|
|
13
13
|
export class NovuMessages extends ClientSDK {
|
|
14
14
|
/**
|
|
15
|
-
* Mark
|
|
15
|
+
* Mark message action as seen
|
|
16
16
|
*/
|
|
17
|
-
async
|
|
18
|
-
|
|
19
|
-
subscriberId: string,
|
|
20
|
-
idempotencyKey?: string | undefined,
|
|
17
|
+
async updateAsSeen(
|
|
18
|
+
request: operations.SubscribersV1ControllerMarkActionAsSeenRequest,
|
|
21
19
|
options?: RequestOptions,
|
|
22
|
-
): Promise<operations.
|
|
23
|
-
return unwrapAsync(
|
|
20
|
+
): Promise<operations.SubscribersV1ControllerMarkActionAsSeenResponse> {
|
|
21
|
+
return unwrapAsync(subscribersMessagesUpdateAsSeen(
|
|
24
22
|
this,
|
|
25
|
-
|
|
26
|
-
subscriberId,
|
|
27
|
-
idempotencyKey,
|
|
23
|
+
request,
|
|
28
24
|
options,
|
|
29
25
|
));
|
|
30
26
|
}
|
|
@@ -48,15 +44,19 @@ export class NovuMessages extends ClientSDK {
|
|
|
48
44
|
}
|
|
49
45
|
|
|
50
46
|
/**
|
|
51
|
-
* Mark
|
|
47
|
+
* Mark a subscriber messages as seen, read, unseen or unread
|
|
52
48
|
*/
|
|
53
|
-
async
|
|
54
|
-
|
|
49
|
+
async markAllAs(
|
|
50
|
+
messageMarkAsRequestDto: components.MessageMarkAsRequestDto,
|
|
51
|
+
subscriberId: string,
|
|
52
|
+
idempotencyKey?: string | undefined,
|
|
55
53
|
options?: RequestOptions,
|
|
56
|
-
): Promise<operations.
|
|
57
|
-
return unwrapAsync(
|
|
54
|
+
): Promise<operations.SubscribersV1ControllerMarkMessagesAsResponse> {
|
|
55
|
+
return unwrapAsync(subscribersMessagesMarkAllAs(
|
|
58
56
|
this,
|
|
59
|
-
|
|
57
|
+
messageMarkAsRequestDto,
|
|
58
|
+
subscriberId,
|
|
59
|
+
idempotencyKey,
|
|
60
60
|
options,
|
|
61
61
|
));
|
|
62
62
|
}
|
package/src/sdk/sdk.ts
CHANGED
|
@@ -17,9 +17,9 @@ import { Subscribers } from "./subscribers.js";
|
|
|
17
17
|
import { Topics } from "./topics.js";
|
|
18
18
|
|
|
19
19
|
export class Novu extends ClientSDK {
|
|
20
|
-
private
|
|
21
|
-
get
|
|
22
|
-
return (this.
|
|
20
|
+
private _subscribers?: Subscribers;
|
|
21
|
+
get subscribers(): Subscribers {
|
|
22
|
+
return (this._subscribers ??= new Subscribers(this._options));
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
private _integrations?: Integrations;
|
|
@@ -27,16 +27,16 @@ export class Novu extends ClientSDK {
|
|
|
27
27
|
return (this._integrations ??= new Integrations(this._options));
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
private _subscribers?: Subscribers;
|
|
31
|
-
get subscribers(): Subscribers {
|
|
32
|
-
return (this._subscribers ??= new Subscribers(this._options));
|
|
33
|
-
}
|
|
34
|
-
|
|
35
30
|
private _messages?: Messages;
|
|
36
31
|
get messages(): Messages {
|
|
37
32
|
return (this._messages ??= new Messages(this._options));
|
|
38
33
|
}
|
|
39
34
|
|
|
35
|
+
private _notifications?: Notifications;
|
|
36
|
+
get notifications(): Notifications {
|
|
37
|
+
return (this._notifications ??= new Notifications(this._options));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
40
|
private _topics?: Topics;
|
|
41
41
|
get topics(): Topics {
|
|
42
42
|
return (this._topics ??= new Topics(this._options));
|
|
@@ -65,21 +65,21 @@ export class Novu extends ClientSDK {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
|
-
*
|
|
68
|
+
* Cancel triggered event
|
|
69
69
|
*
|
|
70
70
|
* @remarks
|
|
71
71
|
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
72
|
+
* Using a previously generated transactionId during the event trigger,
|
|
73
|
+
* will cancel any active or pending workflows. This is useful to cancel active digests, delays etc...
|
|
74
74
|
*/
|
|
75
|
-
async
|
|
76
|
-
|
|
75
|
+
async cancel(
|
|
76
|
+
transactionId: string,
|
|
77
77
|
idempotencyKey?: string | undefined,
|
|
78
78
|
options?: RequestOptions,
|
|
79
|
-
): Promise<operations.
|
|
80
|
-
return unwrapAsync(
|
|
79
|
+
): Promise<operations.EventsControllerCancelResponse> {
|
|
80
|
+
return unwrapAsync(cancel(
|
|
81
81
|
this,
|
|
82
|
-
|
|
82
|
+
transactionId,
|
|
83
83
|
idempotencyKey,
|
|
84
84
|
options,
|
|
85
85
|
));
|
|
@@ -106,21 +106,21 @@ export class Novu extends ClientSDK {
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
/**
|
|
109
|
-
*
|
|
109
|
+
* Bulk trigger event
|
|
110
110
|
*
|
|
111
111
|
* @remarks
|
|
112
112
|
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
113
|
+
* Using this endpoint you can trigger multiple events at once, to avoid multiple calls to the API.
|
|
114
|
+
* The bulk API is limited to 100 events per request.
|
|
115
115
|
*/
|
|
116
|
-
async
|
|
117
|
-
|
|
116
|
+
async triggerBulk(
|
|
117
|
+
bulkTriggerEventDto: components.BulkTriggerEventDto,
|
|
118
118
|
idempotencyKey?: string | undefined,
|
|
119
119
|
options?: RequestOptions,
|
|
120
|
-
): Promise<operations.
|
|
121
|
-
return unwrapAsync(
|
|
120
|
+
): Promise<operations.EventsControllerTriggerBulkResponse> {
|
|
121
|
+
return unwrapAsync(triggerBulk(
|
|
122
122
|
this,
|
|
123
|
-
|
|
123
|
+
bulkTriggerEventDto,
|
|
124
124
|
idempotencyKey,
|
|
125
125
|
options,
|
|
126
126
|
));
|