@novu/api 0.2.1 → 0.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/README.md +4 -4
- package/funcs/cancel.d.ts +2 -1
- package/funcs/cancel.d.ts.map +1 -1
- package/funcs/cancel.js +11 -7
- package/funcs/cancel.js.map +1 -1
- package/funcs/integrationsCreate.d.ts +2 -1
- package/funcs/integrationsCreate.d.ts.map +1 -1
- package/funcs/integrationsCreate.js +11 -7
- package/funcs/integrationsCreate.js.map +1 -1
- package/funcs/integrationsDelete.d.ts +2 -1
- package/funcs/integrationsDelete.d.ts.map +1 -1
- package/funcs/integrationsDelete.js +11 -7
- package/funcs/integrationsDelete.js.map +1 -1
- package/funcs/integrationsList.d.ts +2 -1
- package/funcs/integrationsList.d.ts.map +1 -1
- package/funcs/integrationsList.js +11 -7
- package/funcs/integrationsList.js.map +1 -1
- package/funcs/integrationsListActive.d.ts +2 -1
- package/funcs/integrationsListActive.d.ts.map +1 -1
- package/funcs/integrationsListActive.js +11 -7
- package/funcs/integrationsListActive.js.map +1 -1
- package/funcs/integrationsSetAsPrimary.d.ts +2 -1
- package/funcs/integrationsSetAsPrimary.d.ts.map +1 -1
- package/funcs/integrationsSetAsPrimary.js +11 -7
- package/funcs/integrationsSetAsPrimary.js.map +1 -1
- package/funcs/integrationsUpdate.d.ts +2 -1
- package/funcs/integrationsUpdate.d.ts.map +1 -1
- package/funcs/integrationsUpdate.js +11 -7
- package/funcs/integrationsUpdate.js.map +1 -1
- package/funcs/integrationsWebhooksRetrieve.d.ts +2 -1
- package/funcs/integrationsWebhooksRetrieve.d.ts.map +1 -1
- package/funcs/integrationsWebhooksRetrieve.js +11 -7
- package/funcs/integrationsWebhooksRetrieve.js.map +1 -1
- package/funcs/messagesDelete.d.ts +2 -1
- package/funcs/messagesDelete.d.ts.map +1 -1
- package/funcs/messagesDelete.js +11 -7
- package/funcs/messagesDelete.js.map +1 -1
- package/funcs/messagesDeleteByTransactionId.d.ts +2 -1
- package/funcs/messagesDeleteByTransactionId.d.ts.map +1 -1
- package/funcs/messagesDeleteByTransactionId.js +11 -7
- package/funcs/messagesDeleteByTransactionId.js.map +1 -1
- package/funcs/messagesRetrieve.d.ts +2 -1
- package/funcs/messagesRetrieve.d.ts.map +1 -1
- package/funcs/messagesRetrieve.js +11 -7
- package/funcs/messagesRetrieve.js.map +1 -1
- package/funcs/notificationsList.d.ts +2 -1
- package/funcs/notificationsList.d.ts.map +1 -1
- package/funcs/notificationsList.js +12 -7
- package/funcs/notificationsList.js.map +1 -1
- package/funcs/notificationsRetrieve.d.ts +2 -1
- package/funcs/notificationsRetrieve.d.ts.map +1 -1
- package/funcs/notificationsRetrieve.js +11 -7
- package/funcs/notificationsRetrieve.js.map +1 -1
- package/funcs/notificationsStatsGraph.d.ts +2 -1
- package/funcs/notificationsStatsGraph.d.ts.map +1 -1
- package/funcs/notificationsStatsGraph.js +11 -7
- package/funcs/notificationsStatsGraph.js.map +1 -1
- package/funcs/notificationsStatsRetrieve.d.ts +2 -1
- package/funcs/notificationsStatsRetrieve.d.ts.map +1 -1
- package/funcs/notificationsStatsRetrieve.js +11 -7
- package/funcs/notificationsStatsRetrieve.js.map +1 -1
- package/funcs/subscribersAuthenticationChatAccessOauth.d.ts +2 -1
- package/funcs/subscribersAuthenticationChatAccessOauth.d.ts.map +1 -1
- package/funcs/subscribersAuthenticationChatAccessOauth.js +11 -7
- package/funcs/subscribersAuthenticationChatAccessOauth.js.map +1 -1
- package/funcs/subscribersAuthenticationChatAccessOauthCallBack.d.ts +2 -1
- package/funcs/subscribersAuthenticationChatAccessOauthCallBack.d.ts.map +1 -1
- package/funcs/subscribersAuthenticationChatAccessOauthCallBack.js +11 -7
- package/funcs/subscribersAuthenticationChatAccessOauthCallBack.js.map +1 -1
- package/funcs/subscribersCreate.d.ts +2 -1
- package/funcs/subscribersCreate.d.ts.map +1 -1
- package/funcs/subscribersCreate.js +12 -8
- package/funcs/subscribersCreate.js.map +1 -1
- package/funcs/subscribersCreateBulk.d.ts +2 -1
- package/funcs/subscribersCreateBulk.d.ts.map +1 -1
- package/funcs/subscribersCreateBulk.js +11 -7
- package/funcs/subscribersCreateBulk.js.map +1 -1
- package/funcs/subscribersCredentialsAppend.d.ts +2 -1
- package/funcs/subscribersCredentialsAppend.d.ts.map +1 -1
- package/funcs/subscribersCredentialsAppend.js +11 -7
- package/funcs/subscribersCredentialsAppend.js.map +1 -1
- package/funcs/subscribersCredentialsDelete.d.ts +2 -1
- package/funcs/subscribersCredentialsDelete.d.ts.map +1 -1
- package/funcs/subscribersCredentialsDelete.js +11 -7
- package/funcs/subscribersCredentialsDelete.js.map +1 -1
- package/funcs/subscribersCredentialsUpdate.d.ts +2 -1
- package/funcs/subscribersCredentialsUpdate.d.ts.map +1 -1
- package/funcs/subscribersCredentialsUpdate.js +11 -7
- package/funcs/subscribersCredentialsUpdate.js.map +1 -1
- package/funcs/subscribersDelete.d.ts +2 -1
- package/funcs/subscribersDelete.d.ts.map +1 -1
- package/funcs/subscribersDelete.js +11 -7
- package/funcs/subscribersDelete.js.map +1 -1
- package/funcs/subscribersList.d.ts +2 -1
- package/funcs/subscribersList.d.ts.map +1 -1
- package/funcs/subscribersList.js +19 -7
- package/funcs/subscribersList.js.map +1 -1
- package/funcs/subscribersMessagesMarkAll.d.ts +2 -1
- package/funcs/subscribersMessagesMarkAll.d.ts.map +1 -1
- package/funcs/subscribersMessagesMarkAll.js +11 -7
- package/funcs/subscribersMessagesMarkAll.js.map +1 -1
- package/funcs/subscribersMessagesMarkAllAs.d.ts +2 -1
- package/funcs/subscribersMessagesMarkAllAs.d.ts.map +1 -1
- package/funcs/subscribersMessagesMarkAllAs.js +11 -7
- package/funcs/subscribersMessagesMarkAllAs.js.map +1 -1
- package/funcs/subscribersMessagesUpdateAsSeen.d.ts +2 -1
- package/funcs/subscribersMessagesUpdateAsSeen.d.ts.map +1 -1
- package/funcs/subscribersMessagesUpdateAsSeen.js +11 -7
- package/funcs/subscribersMessagesUpdateAsSeen.js.map +1 -1
- package/funcs/subscribersNotificationsFeed.d.ts +2 -1
- package/funcs/subscribersNotificationsFeed.d.ts.map +1 -1
- package/funcs/subscribersNotificationsFeed.js +11 -7
- package/funcs/subscribersNotificationsFeed.js.map +1 -1
- package/funcs/subscribersNotificationsUnseenCount.d.ts +2 -1
- package/funcs/subscribersNotificationsUnseenCount.d.ts.map +1 -1
- package/funcs/subscribersNotificationsUnseenCount.js +11 -7
- package/funcs/subscribersNotificationsUnseenCount.js.map +1 -1
- package/funcs/subscribersPatch.d.ts +2 -1
- package/funcs/subscribersPatch.d.ts.map +1 -1
- package/funcs/subscribersPatch.js +11 -7
- package/funcs/subscribersPatch.js.map +1 -1
- package/funcs/subscribersPreferencesList.d.ts +2 -1
- package/funcs/subscribersPreferencesList.d.ts.map +1 -1
- package/funcs/subscribersPreferencesList.js +11 -7
- package/funcs/subscribersPreferencesList.js.map +1 -1
- package/funcs/subscribersPreferencesUpdate.d.ts +2 -1
- package/funcs/subscribersPreferencesUpdate.d.ts.map +1 -1
- package/funcs/subscribersPreferencesUpdate.js +11 -7
- package/funcs/subscribersPreferencesUpdate.js.map +1 -1
- package/funcs/subscribersPropertiesUpdateOnlineFlag.d.ts +2 -1
- package/funcs/subscribersPropertiesUpdateOnlineFlag.d.ts.map +1 -1
- package/funcs/subscribersPropertiesUpdateOnlineFlag.js +11 -7
- package/funcs/subscribersPropertiesUpdateOnlineFlag.js.map +1 -1
- package/funcs/subscribersRetrieve.d.ts +2 -1
- package/funcs/subscribersRetrieve.d.ts.map +1 -1
- package/funcs/subscribersRetrieve.js +11 -7
- package/funcs/subscribersRetrieve.js.map +1 -1
- package/funcs/subscribersSearch.d.ts +2 -1
- package/funcs/subscribersSearch.d.ts.map +1 -1
- package/funcs/subscribersSearch.js +11 -7
- package/funcs/subscribersSearch.js.map +1 -1
- package/funcs/topicsCreate.d.ts +2 -1
- package/funcs/topicsCreate.d.ts.map +1 -1
- package/funcs/topicsCreate.js +11 -7
- package/funcs/topicsCreate.js.map +1 -1
- package/funcs/topicsDelete.d.ts +2 -1
- package/funcs/topicsDelete.d.ts.map +1 -1
- package/funcs/topicsDelete.js +11 -7
- package/funcs/topicsDelete.js.map +1 -1
- package/funcs/topicsList.d.ts +2 -1
- package/funcs/topicsList.d.ts.map +1 -1
- package/funcs/topicsList.js +11 -7
- package/funcs/topicsList.js.map +1 -1
- package/funcs/topicsRename.d.ts +2 -1
- package/funcs/topicsRename.d.ts.map +1 -1
- package/funcs/topicsRename.js +11 -7
- package/funcs/topicsRename.js.map +1 -1
- package/funcs/topicsRetrieve.d.ts +2 -1
- package/funcs/topicsRetrieve.d.ts.map +1 -1
- package/funcs/topicsRetrieve.js +11 -7
- package/funcs/topicsRetrieve.js.map +1 -1
- package/funcs/topicsSubscribersAssign.d.ts +2 -1
- package/funcs/topicsSubscribersAssign.d.ts.map +1 -1
- package/funcs/topicsSubscribersAssign.js +11 -7
- package/funcs/topicsSubscribersAssign.js.map +1 -1
- package/funcs/topicsSubscribersRemove.d.ts +2 -1
- package/funcs/topicsSubscribersRemove.d.ts.map +1 -1
- package/funcs/topicsSubscribersRemove.js +11 -7
- package/funcs/topicsSubscribersRemove.js.map +1 -1
- package/funcs/topicsSubscribersRetrieve.d.ts +2 -1
- package/funcs/topicsSubscribersRetrieve.d.ts.map +1 -1
- package/funcs/topicsSubscribersRetrieve.js +11 -7
- package/funcs/topicsSubscribersRetrieve.js.map +1 -1
- package/funcs/trigger.d.ts +2 -1
- package/funcs/trigger.d.ts.map +1 -1
- package/funcs/trigger.js +11 -7
- package/funcs/trigger.js.map +1 -1
- package/funcs/triggerBroadcast.d.ts +2 -1
- package/funcs/triggerBroadcast.d.ts.map +1 -1
- package/funcs/triggerBroadcast.js +11 -7
- package/funcs/triggerBroadcast.js.map +1 -1
- package/funcs/triggerBulk.d.ts +2 -1
- package/funcs/triggerBulk.d.ts.map +1 -1
- package/funcs/triggerBulk.js +11 -7
- package/funcs/triggerBulk.js.map +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/models/components/activitynotificationtemplateresponsedto.d.ts +6 -0
- package/models/components/activitynotificationtemplateresponsedto.d.ts.map +1 -1
- package/models/components/activitynotificationtemplateresponsedto.js +3 -0
- package/models/components/activitynotificationtemplateresponsedto.js.map +1 -1
- package/models/components/createsubscriberrequestdto.d.ts +28 -50
- package/models/components/createsubscriberrequestdto.d.ts.map +1 -1
- package/models/components/createsubscriberrequestdto.js +17 -41
- package/models/components/createsubscriberrequestdto.js.map +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/patchsubscriberrequestdto.d.ts +0 -5
- package/models/components/patchsubscriberrequestdto.d.ts.map +1 -1
- package/models/components/patchsubscriberrequestdto.js +0 -2
- package/models/components/patchsubscriberrequestdto.js.map +1 -1
- package/models/components/subscriberpayloaddto.d.ts +5 -0
- package/models/components/subscriberpayloaddto.d.ts.map +1 -1
- package/models/components/subscriberpayloaddto.js +2 -0
- package/models/components/subscriberpayloaddto.js.map +1 -1
- package/models/components/triggereventresponsedto.d.ts +3 -0
- package/models/components/triggereventresponsedto.d.ts.map +1 -1
- package/models/components/triggereventresponsedto.js +1 -0
- package/models/components/triggereventresponsedto.js.map +1 -1
- package/models/components/workfloworiginenum.d.ts +37 -0
- package/models/components/workfloworiginenum.d.ts.map +1 -0
- package/models/components/workfloworiginenum.js +54 -0
- package/models/components/workfloworiginenum.js.map +1 -0
- package/models/operations/notificationscontrollerlistnotifications.d.ts +5 -0
- package/models/operations/notificationscontrollerlistnotifications.d.ts.map +1 -1
- package/models/operations/notificationscontrollerlistnotifications.js +2 -0
- package/models/operations/notificationscontrollerlistnotifications.js.map +1 -1
- package/package.json +1 -1
- package/sources/json-development.json +57 -45
- package/src/funcs/cancel.ts +40 -7
- package/src/funcs/integrationsCreate.ts +40 -7
- package/src/funcs/integrationsDelete.ts +40 -7
- package/src/funcs/integrationsList.ts +38 -7
- package/src/funcs/integrationsListActive.ts +38 -7
- package/src/funcs/integrationsSetAsPrimary.ts +40 -7
- package/src/funcs/integrationsUpdate.ts +42 -7
- package/src/funcs/integrationsWebhooksRetrieve.ts +40 -7
- package/src/funcs/messagesDelete.ts +40 -7
- package/src/funcs/messagesDeleteByTransactionId.ts +43 -7
- package/src/funcs/messagesRetrieve.ts +38 -7
- package/src/funcs/notificationsList.ts +39 -7
- package/src/funcs/notificationsRetrieve.ts +40 -7
- package/src/funcs/notificationsStatsGraph.ts +40 -7
- package/src/funcs/notificationsStatsRetrieve.ts +38 -7
- package/src/funcs/subscribersAuthenticationChatAccessOauth.ts +38 -7
- package/src/funcs/subscribersAuthenticationChatAccessOauthCallBack.ts +40 -7
- package/src/funcs/subscribersCreate.ts +41 -8
- package/src/funcs/subscribersCreateBulk.ts +40 -7
- package/src/funcs/subscribersCredentialsAppend.ts +43 -7
- package/src/funcs/subscribersCredentialsDelete.ts +43 -7
- package/src/funcs/subscribersCredentialsUpdate.ts +43 -7
- package/src/funcs/subscribersDelete.ts +40 -7
- package/src/funcs/subscribersList.ts +53 -7
- package/src/funcs/subscribersMessagesMarkAll.ts +42 -7
- package/src/funcs/subscribersMessagesMarkAllAs.ts +42 -7
- package/src/funcs/subscribersMessagesUpdateAsSeen.ts +38 -7
- package/src/funcs/subscribersNotificationsFeed.ts +38 -7
- package/src/funcs/subscribersNotificationsUnseenCount.ts +38 -7
- package/src/funcs/subscribersPatch.ts +42 -7
- package/src/funcs/subscribersPreferencesList.ts +40 -7
- package/src/funcs/subscribersPreferencesUpdate.ts +42 -7
- package/src/funcs/subscribersPropertiesUpdateOnlineFlag.ts +43 -7
- package/src/funcs/subscribersRetrieve.ts +40 -7
- package/src/funcs/subscribersSearch.ts +38 -7
- package/src/funcs/topicsCreate.ts +40 -7
- package/src/funcs/topicsDelete.ts +40 -7
- package/src/funcs/topicsList.ts +38 -7
- package/src/funcs/topicsRename.ts +42 -7
- package/src/funcs/topicsRetrieve.ts +40 -7
- package/src/funcs/topicsSubscribersAssign.ts +42 -7
- package/src/funcs/topicsSubscribersRemove.ts +42 -7
- package/src/funcs/topicsSubscribersRetrieve.ts +42 -7
- package/src/funcs/trigger.ts +40 -7
- package/src/funcs/triggerBroadcast.ts +40 -7
- package/src/funcs/triggerBulk.ts +40 -7
- package/src/lib/config.ts +3 -3
- package/src/models/components/activitynotificationtemplateresponsedto.ts +12 -0
- package/src/models/components/createsubscriberrequestdto.ts +41 -111
- package/src/models/components/index.ts +1 -0
- package/src/models/components/patchsubscriberrequestdto.ts +0 -7
- package/src/models/components/subscriberpayloaddto.ts +7 -0
- package/src/models/components/triggereventresponsedto.ts +1 -0
- package/src/models/components/workfloworiginenum.ts +40 -0
- package/src/models/operations/notificationscontrollerlistnotifications.ts +7 -0
- package/src/types/async.ts +68 -0
- package/types/async.d.ts +23 -0
- package/types/async.d.ts.map +1 -0
- package/types/async.js +44 -0
- package/types/async.js.map +1 -0
package/src/funcs/trigger.ts
CHANGED
|
@@ -22,6 +22,7 @@ import * as errors from "../models/errors/index.js";
|
|
|
22
22
|
import { SDKError } from "../models/errors/sdkerror.js";
|
|
23
23
|
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
24
|
import * as operations from "../models/operations/index.js";
|
|
25
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
25
26
|
import { Result } from "../types/fp.js";
|
|
26
27
|
|
|
27
28
|
/**
|
|
@@ -33,12 +34,12 @@ import { Result } from "../types/fp.js";
|
|
|
33
34
|
* The trigger identifier is used to match the particular workflow associated with it.
|
|
34
35
|
* Additional information can be passed according the body interface below.
|
|
35
36
|
*/
|
|
36
|
-
export
|
|
37
|
+
export function trigger(
|
|
37
38
|
client: NovuCore,
|
|
38
39
|
triggerEventRequestDto: components.TriggerEventRequestDto,
|
|
39
40
|
idempotencyKey?: string | undefined,
|
|
40
41
|
options?: RequestOptions,
|
|
41
|
-
):
|
|
42
|
+
): APIPromise<
|
|
42
43
|
Result<
|
|
43
44
|
operations.EventsControllerTriggerResponse,
|
|
44
45
|
| errors.ErrorDto
|
|
@@ -53,6 +54,38 @@ export async function trigger(
|
|
|
53
54
|
| RequestTimeoutError
|
|
54
55
|
| ConnectionError
|
|
55
56
|
>
|
|
57
|
+
> {
|
|
58
|
+
return new APIPromise($do(
|
|
59
|
+
client,
|
|
60
|
+
triggerEventRequestDto,
|
|
61
|
+
idempotencyKey,
|
|
62
|
+
options,
|
|
63
|
+
));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
async function $do(
|
|
67
|
+
client: NovuCore,
|
|
68
|
+
triggerEventRequestDto: components.TriggerEventRequestDto,
|
|
69
|
+
idempotencyKey?: string | undefined,
|
|
70
|
+
options?: RequestOptions,
|
|
71
|
+
): Promise<
|
|
72
|
+
[
|
|
73
|
+
Result<
|
|
74
|
+
operations.EventsControllerTriggerResponse,
|
|
75
|
+
| errors.ErrorDto
|
|
76
|
+
| errors.ErrorDto
|
|
77
|
+
| errors.ValidationErrorDto
|
|
78
|
+
| errors.ErrorDto
|
|
79
|
+
| SDKError
|
|
80
|
+
| SDKValidationError
|
|
81
|
+
| UnexpectedClientError
|
|
82
|
+
| InvalidRequestError
|
|
83
|
+
| RequestAbortedError
|
|
84
|
+
| RequestTimeoutError
|
|
85
|
+
| ConnectionError
|
|
86
|
+
>,
|
|
87
|
+
APICall,
|
|
88
|
+
]
|
|
56
89
|
> {
|
|
57
90
|
const input: operations.EventsControllerTriggerRequest = {
|
|
58
91
|
triggerEventRequestDto: triggerEventRequestDto,
|
|
@@ -66,7 +99,7 @@ export async function trigger(
|
|
|
66
99
|
"Input validation failed",
|
|
67
100
|
);
|
|
68
101
|
if (!parsed.ok) {
|
|
69
|
-
return parsed;
|
|
102
|
+
return [parsed, { status: "invalid" }];
|
|
70
103
|
}
|
|
71
104
|
const payload = parsed.value;
|
|
72
105
|
const body = encodeJSON("body", payload.TriggerEventRequestDto, {
|
|
@@ -123,7 +156,7 @@ export async function trigger(
|
|
|
123
156
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
124
157
|
}, options);
|
|
125
158
|
if (!requestRes.ok) {
|
|
126
|
-
return requestRes;
|
|
159
|
+
return [requestRes, { status: "invalid" }];
|
|
127
160
|
}
|
|
128
161
|
const req = requestRes.value;
|
|
129
162
|
|
|
@@ -150,7 +183,7 @@ export async function trigger(
|
|
|
150
183
|
retryCodes: context.retryCodes,
|
|
151
184
|
});
|
|
152
185
|
if (!doResult.ok) {
|
|
153
|
-
return doResult;
|
|
186
|
+
return [doResult, { status: "request-error", request: req }];
|
|
154
187
|
}
|
|
155
188
|
const response = doResult.value;
|
|
156
189
|
|
|
@@ -190,8 +223,8 @@ export async function trigger(
|
|
|
190
223
|
M.fail("5XX"),
|
|
191
224
|
)(response, { extraFields: responseFields });
|
|
192
225
|
if (!result.ok) {
|
|
193
|
-
return result;
|
|
226
|
+
return [result, { status: "complete", request: req, response }];
|
|
194
227
|
}
|
|
195
228
|
|
|
196
|
-
return result;
|
|
229
|
+
return [result, { status: "complete", request: req, response }];
|
|
197
230
|
}
|
|
@@ -22,6 +22,7 @@ import * as errors from "../models/errors/index.js";
|
|
|
22
22
|
import { SDKError } from "../models/errors/sdkerror.js";
|
|
23
23
|
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
24
|
import * as operations from "../models/operations/index.js";
|
|
25
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
25
26
|
import { Result } from "../types/fp.js";
|
|
26
27
|
|
|
27
28
|
/**
|
|
@@ -31,12 +32,12 @@ import { Result } from "../types/fp.js";
|
|
|
31
32
|
* Trigger a broadcast event to all existing subscribers, could be used to send announcements, etc.
|
|
32
33
|
* In the future could be used to trigger events to a subset of subscribers based on defined filters.
|
|
33
34
|
*/
|
|
34
|
-
export
|
|
35
|
+
export function triggerBroadcast(
|
|
35
36
|
client: NovuCore,
|
|
36
37
|
triggerEventToAllRequestDto: components.TriggerEventToAllRequestDto,
|
|
37
38
|
idempotencyKey?: string | undefined,
|
|
38
39
|
options?: RequestOptions,
|
|
39
|
-
):
|
|
40
|
+
): APIPromise<
|
|
40
41
|
Result<
|
|
41
42
|
operations.EventsControllerBroadcastEventToAllResponse,
|
|
42
43
|
| errors.ErrorDto
|
|
@@ -51,6 +52,38 @@ export async function triggerBroadcast(
|
|
|
51
52
|
| RequestTimeoutError
|
|
52
53
|
| ConnectionError
|
|
53
54
|
>
|
|
55
|
+
> {
|
|
56
|
+
return new APIPromise($do(
|
|
57
|
+
client,
|
|
58
|
+
triggerEventToAllRequestDto,
|
|
59
|
+
idempotencyKey,
|
|
60
|
+
options,
|
|
61
|
+
));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async function $do(
|
|
65
|
+
client: NovuCore,
|
|
66
|
+
triggerEventToAllRequestDto: components.TriggerEventToAllRequestDto,
|
|
67
|
+
idempotencyKey?: string | undefined,
|
|
68
|
+
options?: RequestOptions,
|
|
69
|
+
): Promise<
|
|
70
|
+
[
|
|
71
|
+
Result<
|
|
72
|
+
operations.EventsControllerBroadcastEventToAllResponse,
|
|
73
|
+
| errors.ErrorDto
|
|
74
|
+
| errors.ErrorDto
|
|
75
|
+
| errors.ValidationErrorDto
|
|
76
|
+
| errors.ErrorDto
|
|
77
|
+
| SDKError
|
|
78
|
+
| SDKValidationError
|
|
79
|
+
| UnexpectedClientError
|
|
80
|
+
| InvalidRequestError
|
|
81
|
+
| RequestAbortedError
|
|
82
|
+
| RequestTimeoutError
|
|
83
|
+
| ConnectionError
|
|
84
|
+
>,
|
|
85
|
+
APICall,
|
|
86
|
+
]
|
|
54
87
|
> {
|
|
55
88
|
const input: operations.EventsControllerBroadcastEventToAllRequest = {
|
|
56
89
|
triggerEventToAllRequestDto: triggerEventToAllRequestDto,
|
|
@@ -65,7 +98,7 @@ export async function triggerBroadcast(
|
|
|
65
98
|
"Input validation failed",
|
|
66
99
|
);
|
|
67
100
|
if (!parsed.ok) {
|
|
68
|
-
return parsed;
|
|
101
|
+
return [parsed, { status: "invalid" }];
|
|
69
102
|
}
|
|
70
103
|
const payload = parsed.value;
|
|
71
104
|
const body = encodeJSON("body", payload.TriggerEventToAllRequestDto, {
|
|
@@ -122,7 +155,7 @@ export async function triggerBroadcast(
|
|
|
122
155
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
123
156
|
}, options);
|
|
124
157
|
if (!requestRes.ok) {
|
|
125
|
-
return requestRes;
|
|
158
|
+
return [requestRes, { status: "invalid" }];
|
|
126
159
|
}
|
|
127
160
|
const req = requestRes.value;
|
|
128
161
|
|
|
@@ -149,7 +182,7 @@ export async function triggerBroadcast(
|
|
|
149
182
|
retryCodes: context.retryCodes,
|
|
150
183
|
});
|
|
151
184
|
if (!doResult.ok) {
|
|
152
|
-
return doResult;
|
|
185
|
+
return [doResult, { status: "request-error", request: req }];
|
|
153
186
|
}
|
|
154
187
|
const response = doResult.value;
|
|
155
188
|
|
|
@@ -190,8 +223,8 @@ export async function triggerBroadcast(
|
|
|
190
223
|
M.fail("5XX"),
|
|
191
224
|
)(response, { extraFields: responseFields });
|
|
192
225
|
if (!result.ok) {
|
|
193
|
-
return result;
|
|
226
|
+
return [result, { status: "complete", request: req, response }];
|
|
194
227
|
}
|
|
195
228
|
|
|
196
|
-
return result;
|
|
229
|
+
return [result, { status: "complete", request: req, response }];
|
|
197
230
|
}
|
package/src/funcs/triggerBulk.ts
CHANGED
|
@@ -22,6 +22,7 @@ import * as errors from "../models/errors/index.js";
|
|
|
22
22
|
import { SDKError } from "../models/errors/sdkerror.js";
|
|
23
23
|
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
24
|
import * as operations from "../models/operations/index.js";
|
|
25
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
25
26
|
import { Result } from "../types/fp.js";
|
|
26
27
|
|
|
27
28
|
/**
|
|
@@ -32,12 +33,12 @@ import { Result } from "../types/fp.js";
|
|
|
32
33
|
* Using this endpoint you can trigger multiple events at once, to avoid multiple calls to the API.
|
|
33
34
|
* The bulk API is limited to 100 events per request.
|
|
34
35
|
*/
|
|
35
|
-
export
|
|
36
|
+
export function triggerBulk(
|
|
36
37
|
client: NovuCore,
|
|
37
38
|
bulkTriggerEventDto: components.BulkTriggerEventDto,
|
|
38
39
|
idempotencyKey?: string | undefined,
|
|
39
40
|
options?: RequestOptions,
|
|
40
|
-
):
|
|
41
|
+
): APIPromise<
|
|
41
42
|
Result<
|
|
42
43
|
operations.EventsControllerTriggerBulkResponse,
|
|
43
44
|
| errors.ErrorDto
|
|
@@ -52,6 +53,38 @@ export async function triggerBulk(
|
|
|
52
53
|
| RequestTimeoutError
|
|
53
54
|
| ConnectionError
|
|
54
55
|
>
|
|
56
|
+
> {
|
|
57
|
+
return new APIPromise($do(
|
|
58
|
+
client,
|
|
59
|
+
bulkTriggerEventDto,
|
|
60
|
+
idempotencyKey,
|
|
61
|
+
options,
|
|
62
|
+
));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
async function $do(
|
|
66
|
+
client: NovuCore,
|
|
67
|
+
bulkTriggerEventDto: components.BulkTriggerEventDto,
|
|
68
|
+
idempotencyKey?: string | undefined,
|
|
69
|
+
options?: RequestOptions,
|
|
70
|
+
): Promise<
|
|
71
|
+
[
|
|
72
|
+
Result<
|
|
73
|
+
operations.EventsControllerTriggerBulkResponse,
|
|
74
|
+
| errors.ErrorDto
|
|
75
|
+
| errors.ErrorDto
|
|
76
|
+
| errors.ValidationErrorDto
|
|
77
|
+
| errors.ErrorDto
|
|
78
|
+
| SDKError
|
|
79
|
+
| SDKValidationError
|
|
80
|
+
| UnexpectedClientError
|
|
81
|
+
| InvalidRequestError
|
|
82
|
+
| RequestAbortedError
|
|
83
|
+
| RequestTimeoutError
|
|
84
|
+
| ConnectionError
|
|
85
|
+
>,
|
|
86
|
+
APICall,
|
|
87
|
+
]
|
|
55
88
|
> {
|
|
56
89
|
const input: operations.EventsControllerTriggerBulkRequest = {
|
|
57
90
|
bulkTriggerEventDto: bulkTriggerEventDto,
|
|
@@ -65,7 +98,7 @@ export async function triggerBulk(
|
|
|
65
98
|
"Input validation failed",
|
|
66
99
|
);
|
|
67
100
|
if (!parsed.ok) {
|
|
68
|
-
return parsed;
|
|
101
|
+
return [parsed, { status: "invalid" }];
|
|
69
102
|
}
|
|
70
103
|
const payload = parsed.value;
|
|
71
104
|
const body = encodeJSON("body", payload.BulkTriggerEventDto, {
|
|
@@ -122,7 +155,7 @@ export async function triggerBulk(
|
|
|
122
155
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
123
156
|
}, options);
|
|
124
157
|
if (!requestRes.ok) {
|
|
125
|
-
return requestRes;
|
|
158
|
+
return [requestRes, { status: "invalid" }];
|
|
126
159
|
}
|
|
127
160
|
const req = requestRes.value;
|
|
128
161
|
|
|
@@ -149,7 +182,7 @@ export async function triggerBulk(
|
|
|
149
182
|
retryCodes: context.retryCodes,
|
|
150
183
|
});
|
|
151
184
|
if (!doResult.ok) {
|
|
152
|
-
return doResult;
|
|
185
|
+
return [doResult, { status: "request-error", request: req }];
|
|
153
186
|
}
|
|
154
187
|
const response = doResult.value;
|
|
155
188
|
|
|
@@ -189,8 +222,8 @@ export async function triggerBulk(
|
|
|
189
222
|
M.fail("5XX"),
|
|
190
223
|
)(response, { extraFields: responseFields });
|
|
191
224
|
if (!result.ok) {
|
|
192
|
-
return result;
|
|
225
|
+
return [result, { status: "complete", request: req, response }];
|
|
193
226
|
}
|
|
194
227
|
|
|
195
|
-
return result;
|
|
228
|
+
return [result, { status: "complete", request: req, response }];
|
|
196
229
|
}
|
package/src/lib/config.ts
CHANGED
|
@@ -55,7 +55,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
55
55
|
export const SDK_METADATA = {
|
|
56
56
|
language: "typescript",
|
|
57
57
|
openapiDocVersion: "1.0",
|
|
58
|
-
sdkVersion: "0.
|
|
59
|
-
genVersion: "2.
|
|
60
|
-
userAgent: "speakeasy-sdk/typescript 0.
|
|
58
|
+
sdkVersion: "0.3.0",
|
|
59
|
+
genVersion: "2.515.0",
|
|
60
|
+
userAgent: "speakeasy-sdk/typescript 0.3.0 2.515.0 1.0 @novu/api",
|
|
61
61
|
} as const;
|
|
@@ -13,6 +13,11 @@ import {
|
|
|
13
13
|
NotificationTriggerDto$Outbound,
|
|
14
14
|
NotificationTriggerDto$outboundSchema,
|
|
15
15
|
} from "./notificationtriggerdto.js";
|
|
16
|
+
import {
|
|
17
|
+
WorkflowOriginEnum,
|
|
18
|
+
WorkflowOriginEnum$inboundSchema,
|
|
19
|
+
WorkflowOriginEnum$outboundSchema,
|
|
20
|
+
} from "./workfloworiginenum.js";
|
|
16
21
|
|
|
17
22
|
export type ActivityNotificationTemplateResponseDto = {
|
|
18
23
|
/**
|
|
@@ -23,6 +28,10 @@ export type ActivityNotificationTemplateResponseDto = {
|
|
|
23
28
|
* Name of the template
|
|
24
29
|
*/
|
|
25
30
|
name: string;
|
|
31
|
+
/**
|
|
32
|
+
* Origin of the workflow
|
|
33
|
+
*/
|
|
34
|
+
origin?: WorkflowOriginEnum | undefined;
|
|
26
35
|
/**
|
|
27
36
|
* Triggers of the template
|
|
28
37
|
*/
|
|
@@ -37,6 +46,7 @@ export const ActivityNotificationTemplateResponseDto$inboundSchema: z.ZodType<
|
|
|
37
46
|
> = z.object({
|
|
38
47
|
_id: z.string().optional(),
|
|
39
48
|
name: z.string(),
|
|
49
|
+
origin: WorkflowOriginEnum$inboundSchema.optional(),
|
|
40
50
|
triggers: z.array(NotificationTriggerDto$inboundSchema),
|
|
41
51
|
}).transform((v) => {
|
|
42
52
|
return remap$(v, {
|
|
@@ -48,6 +58,7 @@ export const ActivityNotificationTemplateResponseDto$inboundSchema: z.ZodType<
|
|
|
48
58
|
export type ActivityNotificationTemplateResponseDto$Outbound = {
|
|
49
59
|
_id?: string | undefined;
|
|
50
60
|
name: string;
|
|
61
|
+
origin?: string | undefined;
|
|
51
62
|
triggers: Array<NotificationTriggerDto$Outbound>;
|
|
52
63
|
};
|
|
53
64
|
|
|
@@ -59,6 +70,7 @@ export const ActivityNotificationTemplateResponseDto$outboundSchema: z.ZodType<
|
|
|
59
70
|
> = z.object({
|
|
60
71
|
id: z.string().optional(),
|
|
61
72
|
name: z.string(),
|
|
73
|
+
origin: WorkflowOriginEnum$outboundSchema.optional(),
|
|
62
74
|
triggers: z.array(NotificationTriggerDto$outboundSchema),
|
|
63
75
|
}).transform((v) => {
|
|
64
76
|
return remap$(v, {
|
|
@@ -6,112 +6,46 @@ import * as z from "zod";
|
|
|
6
6
|
import { safeParse } from "../../lib/schemas.js";
|
|
7
7
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
8
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
-
import {
|
|
10
|
-
SubscriberChannelDto,
|
|
11
|
-
SubscriberChannelDto$inboundSchema,
|
|
12
|
-
SubscriberChannelDto$Outbound,
|
|
13
|
-
SubscriberChannelDto$outboundSchema,
|
|
14
|
-
} from "./subscriberchanneldto.js";
|
|
15
|
-
|
|
16
|
-
export type CreateSubscriberRequestDtoData =
|
|
17
|
-
| string
|
|
18
|
-
| Array<string>
|
|
19
|
-
| boolean
|
|
20
|
-
| number;
|
|
21
9
|
|
|
22
10
|
export type CreateSubscriberRequestDto = {
|
|
23
11
|
/**
|
|
24
|
-
*
|
|
12
|
+
* Unique identifier of the subscriber
|
|
25
13
|
*/
|
|
26
14
|
subscriberId: string;
|
|
27
15
|
/**
|
|
28
|
-
*
|
|
16
|
+
* First name of the subscriber
|
|
29
17
|
*/
|
|
30
|
-
|
|
18
|
+
firstName?: string | null | undefined;
|
|
31
19
|
/**
|
|
32
|
-
*
|
|
20
|
+
* Last name of the subscriber
|
|
33
21
|
*/
|
|
34
|
-
|
|
22
|
+
lastName?: string | null | undefined;
|
|
35
23
|
/**
|
|
36
|
-
*
|
|
24
|
+
* Email address of the subscriber
|
|
37
25
|
*/
|
|
38
|
-
|
|
26
|
+
email?: string | null | undefined;
|
|
39
27
|
/**
|
|
40
|
-
*
|
|
28
|
+
* Phone number of the subscriber
|
|
41
29
|
*/
|
|
42
|
-
phone?: string | undefined;
|
|
30
|
+
phone?: string | null | undefined;
|
|
43
31
|
/**
|
|
44
|
-
*
|
|
32
|
+
* Avatar URL or identifier
|
|
45
33
|
*/
|
|
46
|
-
avatar?: string | undefined;
|
|
34
|
+
avatar?: string | null | undefined;
|
|
47
35
|
/**
|
|
48
|
-
*
|
|
36
|
+
* Timezone of the subscriber
|
|
49
37
|
*/
|
|
50
|
-
|
|
38
|
+
timezone?: string | null | undefined;
|
|
51
39
|
/**
|
|
52
|
-
*
|
|
40
|
+
* Locale of the subscriber
|
|
53
41
|
*/
|
|
54
|
-
|
|
42
|
+
locale?: string | null | undefined;
|
|
55
43
|
/**
|
|
56
|
-
*
|
|
44
|
+
* Additional custom data for the subscriber
|
|
57
45
|
*/
|
|
58
|
-
|
|
46
|
+
data?: { [k: string]: any } | null | undefined;
|
|
59
47
|
};
|
|
60
48
|
|
|
61
|
-
/** @internal */
|
|
62
|
-
export const CreateSubscriberRequestDtoData$inboundSchema: z.ZodType<
|
|
63
|
-
CreateSubscriberRequestDtoData,
|
|
64
|
-
z.ZodTypeDef,
|
|
65
|
-
unknown
|
|
66
|
-
> = z.union([z.string(), z.array(z.string()), z.boolean(), z.number()]);
|
|
67
|
-
|
|
68
|
-
/** @internal */
|
|
69
|
-
export type CreateSubscriberRequestDtoData$Outbound =
|
|
70
|
-
| string
|
|
71
|
-
| Array<string>
|
|
72
|
-
| boolean
|
|
73
|
-
| number;
|
|
74
|
-
|
|
75
|
-
/** @internal */
|
|
76
|
-
export const CreateSubscriberRequestDtoData$outboundSchema: z.ZodType<
|
|
77
|
-
CreateSubscriberRequestDtoData$Outbound,
|
|
78
|
-
z.ZodTypeDef,
|
|
79
|
-
CreateSubscriberRequestDtoData
|
|
80
|
-
> = z.union([z.string(), z.array(z.string()), z.boolean(), z.number()]);
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* @internal
|
|
84
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
85
|
-
*/
|
|
86
|
-
export namespace CreateSubscriberRequestDtoData$ {
|
|
87
|
-
/** @deprecated use `CreateSubscriberRequestDtoData$inboundSchema` instead. */
|
|
88
|
-
export const inboundSchema = CreateSubscriberRequestDtoData$inboundSchema;
|
|
89
|
-
/** @deprecated use `CreateSubscriberRequestDtoData$outboundSchema` instead. */
|
|
90
|
-
export const outboundSchema = CreateSubscriberRequestDtoData$outboundSchema;
|
|
91
|
-
/** @deprecated use `CreateSubscriberRequestDtoData$Outbound` instead. */
|
|
92
|
-
export type Outbound = CreateSubscriberRequestDtoData$Outbound;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export function createSubscriberRequestDtoDataToJSON(
|
|
96
|
-
createSubscriberRequestDtoData: CreateSubscriberRequestDtoData,
|
|
97
|
-
): string {
|
|
98
|
-
return JSON.stringify(
|
|
99
|
-
CreateSubscriberRequestDtoData$outboundSchema.parse(
|
|
100
|
-
createSubscriberRequestDtoData,
|
|
101
|
-
),
|
|
102
|
-
);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export function createSubscriberRequestDtoDataFromJSON(
|
|
106
|
-
jsonString: string,
|
|
107
|
-
): SafeParseResult<CreateSubscriberRequestDtoData, SDKValidationError> {
|
|
108
|
-
return safeParse(
|
|
109
|
-
jsonString,
|
|
110
|
-
(x) => CreateSubscriberRequestDtoData$inboundSchema.parse(JSON.parse(x)),
|
|
111
|
-
`Failed to parse 'CreateSubscriberRequestDtoData' from JSON`,
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
49
|
/** @internal */
|
|
116
50
|
export const CreateSubscriberRequestDto$inboundSchema: z.ZodType<
|
|
117
51
|
CreateSubscriberRequestDto,
|
|
@@ -119,29 +53,27 @@ export const CreateSubscriberRequestDto$inboundSchema: z.ZodType<
|
|
|
119
53
|
unknown
|
|
120
54
|
> = z.object({
|
|
121
55
|
subscriberId: z.string(),
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
phone: z.string().optional(),
|
|
126
|
-
avatar: z.string().optional(),
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
).optional(),
|
|
131
|
-
channels: z.array(SubscriberChannelDto$inboundSchema).optional(),
|
|
56
|
+
firstName: z.nullable(z.string()).optional(),
|
|
57
|
+
lastName: z.nullable(z.string()).optional(),
|
|
58
|
+
email: z.nullable(z.string()).optional(),
|
|
59
|
+
phone: z.nullable(z.string()).optional(),
|
|
60
|
+
avatar: z.nullable(z.string()).optional(),
|
|
61
|
+
timezone: z.nullable(z.string()).optional(),
|
|
62
|
+
locale: z.nullable(z.string()).optional(),
|
|
63
|
+
data: z.nullable(z.record(z.any())).optional(),
|
|
132
64
|
});
|
|
133
65
|
|
|
134
66
|
/** @internal */
|
|
135
67
|
export type CreateSubscriberRequestDto$Outbound = {
|
|
136
68
|
subscriberId: string;
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
phone?: string | undefined;
|
|
141
|
-
avatar?: string | undefined;
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
69
|
+
firstName?: string | null | undefined;
|
|
70
|
+
lastName?: string | null | undefined;
|
|
71
|
+
email?: string | null | undefined;
|
|
72
|
+
phone?: string | null | undefined;
|
|
73
|
+
avatar?: string | null | undefined;
|
|
74
|
+
timezone?: string | null | undefined;
|
|
75
|
+
locale?: string | null | undefined;
|
|
76
|
+
data?: { [k: string]: any } | null | undefined;
|
|
145
77
|
};
|
|
146
78
|
|
|
147
79
|
/** @internal */
|
|
@@ -151,16 +83,14 @@ export const CreateSubscriberRequestDto$outboundSchema: z.ZodType<
|
|
|
151
83
|
CreateSubscriberRequestDto
|
|
152
84
|
> = z.object({
|
|
153
85
|
subscriberId: z.string(),
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
phone: z.string().optional(),
|
|
158
|
-
avatar: z.string().optional(),
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
).optional(),
|
|
163
|
-
channels: z.array(SubscriberChannelDto$outboundSchema).optional(),
|
|
86
|
+
firstName: z.nullable(z.string()).optional(),
|
|
87
|
+
lastName: z.nullable(z.string()).optional(),
|
|
88
|
+
email: z.nullable(z.string()).optional(),
|
|
89
|
+
phone: z.nullable(z.string()).optional(),
|
|
90
|
+
avatar: z.nullable(z.string()).optional(),
|
|
91
|
+
timezone: z.nullable(z.string()).optional(),
|
|
92
|
+
locale: z.nullable(z.string()).optional(),
|
|
93
|
+
data: z.nullable(z.record(z.any())).optional(),
|
|
164
94
|
});
|
|
165
95
|
|
|
166
96
|
/**
|
|
@@ -113,5 +113,6 @@ export * from "./updateintegrationrequestdto.js";
|
|
|
113
113
|
export * from "./updatesubscriberchannelrequestdto.js";
|
|
114
114
|
export * from "./updatesubscriberonlineflagrequestdto.js";
|
|
115
115
|
export * from "./workflowinfodto.js";
|
|
116
|
+
export * from "./workfloworiginenum.js";
|
|
116
117
|
export * from "./workflowpreferencedto.js";
|
|
117
118
|
export * from "./workflowresponse.js";
|
|
@@ -13,10 +13,6 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
|
13
13
|
export type PatchSubscriberRequestDtoData = {};
|
|
14
14
|
|
|
15
15
|
export type PatchSubscriberRequestDto = {
|
|
16
|
-
/**
|
|
17
|
-
* Unique identifier of the subscriber
|
|
18
|
-
*/
|
|
19
|
-
subscriberId?: string | null | undefined;
|
|
20
16
|
/**
|
|
21
17
|
* First name of the subscriber
|
|
22
18
|
*/
|
|
@@ -107,7 +103,6 @@ export const PatchSubscriberRequestDto$inboundSchema: z.ZodType<
|
|
|
107
103
|
z.ZodTypeDef,
|
|
108
104
|
unknown
|
|
109
105
|
> = z.object({
|
|
110
|
-
subscriberId: z.nullable(z.string()).optional(),
|
|
111
106
|
firstName: z.nullable(z.string()).optional(),
|
|
112
107
|
lastName: z.nullable(z.string()).optional(),
|
|
113
108
|
email: z.nullable(z.string()).optional(),
|
|
@@ -121,7 +116,6 @@ export const PatchSubscriberRequestDto$inboundSchema: z.ZodType<
|
|
|
121
116
|
|
|
122
117
|
/** @internal */
|
|
123
118
|
export type PatchSubscriberRequestDto$Outbound = {
|
|
124
|
-
subscriberId?: string | null | undefined;
|
|
125
119
|
firstName?: string | null | undefined;
|
|
126
120
|
lastName?: string | null | undefined;
|
|
127
121
|
email?: string | null | undefined;
|
|
@@ -138,7 +132,6 @@ export const PatchSubscriberRequestDto$outboundSchema: z.ZodType<
|
|
|
138
132
|
z.ZodTypeDef,
|
|
139
133
|
PatchSubscriberRequestDto
|
|
140
134
|
> = z.object({
|
|
141
|
-
subscriberId: z.nullable(z.string()).optional(),
|
|
142
135
|
firstName: z.nullable(z.string()).optional(),
|
|
143
136
|
lastName: z.nullable(z.string()).optional(),
|
|
144
137
|
email: z.nullable(z.string()).optional(),
|
|
@@ -52,6 +52,10 @@ export type SubscriberPayloadDto = {
|
|
|
52
52
|
* An optional array of subscriber channels.
|
|
53
53
|
*/
|
|
54
54
|
channels?: Array<SubscriberChannelDto> | undefined;
|
|
55
|
+
/**
|
|
56
|
+
* The timezone of the subscriber.
|
|
57
|
+
*/
|
|
58
|
+
timezone?: string | undefined;
|
|
55
59
|
};
|
|
56
60
|
|
|
57
61
|
/** @internal */
|
|
@@ -109,6 +113,7 @@ export const SubscriberPayloadDto$inboundSchema: z.ZodType<
|
|
|
109
113
|
z.union([z.string(), z.array(z.string()), z.boolean(), z.number()]),
|
|
110
114
|
).optional(),
|
|
111
115
|
channels: z.array(SubscriberChannelDto$inboundSchema).optional(),
|
|
116
|
+
timezone: z.string().optional(),
|
|
112
117
|
});
|
|
113
118
|
|
|
114
119
|
/** @internal */
|
|
@@ -122,6 +127,7 @@ export type SubscriberPayloadDto$Outbound = {
|
|
|
122
127
|
locale?: string | undefined;
|
|
123
128
|
data?: { [k: string]: string | Array<string> | boolean | number } | undefined;
|
|
124
129
|
channels?: Array<SubscriberChannelDto$Outbound> | undefined;
|
|
130
|
+
timezone?: string | undefined;
|
|
125
131
|
};
|
|
126
132
|
|
|
127
133
|
/** @internal */
|
|
@@ -141,6 +147,7 @@ export const SubscriberPayloadDto$outboundSchema: z.ZodType<
|
|
|
141
147
|
z.union([z.string(), z.array(z.string()), z.boolean(), z.number()]),
|
|
142
148
|
).optional(),
|
|
143
149
|
channels: z.array(SubscriberChannelDto$outboundSchema).optional(),
|
|
150
|
+
timezone: z.string().optional(),
|
|
144
151
|
});
|
|
145
152
|
|
|
146
153
|
/**
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Origin of the workflow
|
|
10
|
+
*/
|
|
11
|
+
export const WorkflowOriginEnum = {
|
|
12
|
+
NovuCloud: "novu-cloud",
|
|
13
|
+
NovuCloudV1: "novu-cloud-v1",
|
|
14
|
+
External: "external",
|
|
15
|
+
} as const;
|
|
16
|
+
/**
|
|
17
|
+
* Origin of the workflow
|
|
18
|
+
*/
|
|
19
|
+
export type WorkflowOriginEnum = ClosedEnum<typeof WorkflowOriginEnum>;
|
|
20
|
+
|
|
21
|
+
/** @internal */
|
|
22
|
+
export const WorkflowOriginEnum$inboundSchema: z.ZodNativeEnum<
|
|
23
|
+
typeof WorkflowOriginEnum
|
|
24
|
+
> = z.nativeEnum(WorkflowOriginEnum);
|
|
25
|
+
|
|
26
|
+
/** @internal */
|
|
27
|
+
export const WorkflowOriginEnum$outboundSchema: z.ZodNativeEnum<
|
|
28
|
+
typeof WorkflowOriginEnum
|
|
29
|
+
> = WorkflowOriginEnum$inboundSchema;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @internal
|
|
33
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
34
|
+
*/
|
|
35
|
+
export namespace WorkflowOriginEnum$ {
|
|
36
|
+
/** @deprecated use `WorkflowOriginEnum$inboundSchema` instead. */
|
|
37
|
+
export const inboundSchema = WorkflowOriginEnum$inboundSchema;
|
|
38
|
+
/** @deprecated use `WorkflowOriginEnum$outboundSchema` instead. */
|
|
39
|
+
export const outboundSchema = WorkflowOriginEnum$outboundSchema;
|
|
40
|
+
}
|