@novu/api 0.2.0 → 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 +12 -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 +12 -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 +12 -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 +12 -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 +12 -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 +12 -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 +12 -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 +12 -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 +12 -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 +12 -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 +12 -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 +13 -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 +12 -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 +12 -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 +12 -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 +12 -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 +12 -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 +13 -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 +12 -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 +12 -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 +12 -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 +12 -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 +12 -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 +20 -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 +12 -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 +12 -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 +12 -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 +12 -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 +12 -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 +12 -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 +12 -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 +12 -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 +12 -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 +12 -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 +12 -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 +12 -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 +12 -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 +12 -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 +12 -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 +12 -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 +12 -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 +12 -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 +12 -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 +12 -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 +12 -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 +12 -7
- package/funcs/triggerBulk.js.map +1 -1
- package/hooks/types.d.ts +1 -0
- package/hooks/types.d.ts.map +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/security.d.ts.map +1 -1
- package/lib/security.js.map +1 -1
- 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 +41 -7
- package/src/funcs/integrationsCreate.ts +41 -7
- package/src/funcs/integrationsDelete.ts +41 -7
- package/src/funcs/integrationsList.ts +39 -7
- package/src/funcs/integrationsListActive.ts +39 -7
- package/src/funcs/integrationsSetAsPrimary.ts +41 -7
- package/src/funcs/integrationsUpdate.ts +43 -7
- package/src/funcs/integrationsWebhooksRetrieve.ts +41 -7
- package/src/funcs/messagesDelete.ts +41 -7
- package/src/funcs/messagesDeleteByTransactionId.ts +44 -7
- package/src/funcs/messagesRetrieve.ts +39 -7
- package/src/funcs/notificationsList.ts +40 -7
- package/src/funcs/notificationsRetrieve.ts +41 -7
- package/src/funcs/notificationsStatsGraph.ts +41 -7
- package/src/funcs/notificationsStatsRetrieve.ts +39 -7
- package/src/funcs/subscribersAuthenticationChatAccessOauth.ts +39 -7
- package/src/funcs/subscribersAuthenticationChatAccessOauthCallBack.ts +41 -7
- package/src/funcs/subscribersCreate.ts +42 -8
- package/src/funcs/subscribersCreateBulk.ts +41 -7
- package/src/funcs/subscribersCredentialsAppend.ts +44 -7
- package/src/funcs/subscribersCredentialsDelete.ts +44 -7
- package/src/funcs/subscribersCredentialsUpdate.ts +44 -7
- package/src/funcs/subscribersDelete.ts +41 -7
- package/src/funcs/subscribersList.ts +54 -7
- package/src/funcs/subscribersMessagesMarkAll.ts +43 -7
- package/src/funcs/subscribersMessagesMarkAllAs.ts +43 -7
- package/src/funcs/subscribersMessagesUpdateAsSeen.ts +39 -7
- package/src/funcs/subscribersNotificationsFeed.ts +39 -7
- package/src/funcs/subscribersNotificationsUnseenCount.ts +39 -7
- package/src/funcs/subscribersPatch.ts +43 -7
- package/src/funcs/subscribersPreferencesList.ts +41 -7
- package/src/funcs/subscribersPreferencesUpdate.ts +43 -7
- package/src/funcs/subscribersPropertiesUpdateOnlineFlag.ts +44 -7
- package/src/funcs/subscribersRetrieve.ts +41 -7
- package/src/funcs/subscribersSearch.ts +39 -7
- package/src/funcs/topicsCreate.ts +41 -7
- package/src/funcs/topicsDelete.ts +41 -7
- package/src/funcs/topicsList.ts +39 -7
- package/src/funcs/topicsRename.ts +43 -7
- package/src/funcs/topicsRetrieve.ts +41 -7
- package/src/funcs/topicsSubscribersAssign.ts +43 -7
- package/src/funcs/topicsSubscribersRemove.ts +43 -7
- package/src/funcs/topicsSubscribersRetrieve.ts +43 -7
- package/src/funcs/trigger.ts +41 -7
- package/src/funcs/triggerBroadcast.ts +41 -7
- package/src/funcs/triggerBulk.ts +41 -7
- package/src/hooks/types.ts +1 -0
- package/src/lib/config.ts +3 -3
- package/src/lib/security.ts +0 -1
- 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
|
@@ -21,6 +21,7 @@ import * as errors from "../models/errors/index.js";
|
|
|
21
21
|
import { SDKError } from "../models/errors/sdkerror.js";
|
|
22
22
|
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
23
23
|
import * as operations from "../models/operations/index.js";
|
|
24
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
24
25
|
import { Result } from "../types/fp.js";
|
|
25
26
|
|
|
26
27
|
export enum ChatAccessOauthCallBackAcceptEnum {
|
|
@@ -31,13 +32,13 @@ export enum ChatAccessOauthCallBackAcceptEnum {
|
|
|
31
32
|
/**
|
|
32
33
|
* Handle providers oauth redirect
|
|
33
34
|
*/
|
|
34
|
-
export
|
|
35
|
+
export function subscribersAuthenticationChatAccessOauthCallBack(
|
|
35
36
|
client: NovuCore,
|
|
36
37
|
request: operations.SubscribersV1ControllerChatOauthCallbackRequest,
|
|
37
38
|
options?: RequestOptions & {
|
|
38
39
|
acceptHeaderOverride?: ChatAccessOauthCallBackAcceptEnum;
|
|
39
40
|
},
|
|
40
|
-
):
|
|
41
|
+
): APIPromise<
|
|
41
42
|
Result<
|
|
42
43
|
operations.SubscribersV1ControllerChatOauthCallbackResponse,
|
|
43
44
|
| errors.ErrorDto
|
|
@@ -52,6 +53,38 @@ export async function subscribersAuthenticationChatAccessOauthCallBack(
|
|
|
52
53
|
| RequestTimeoutError
|
|
53
54
|
| ConnectionError
|
|
54
55
|
>
|
|
56
|
+
> {
|
|
57
|
+
return new APIPromise($do(
|
|
58
|
+
client,
|
|
59
|
+
request,
|
|
60
|
+
options,
|
|
61
|
+
));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async function $do(
|
|
65
|
+
client: NovuCore,
|
|
66
|
+
request: operations.SubscribersV1ControllerChatOauthCallbackRequest,
|
|
67
|
+
options?: RequestOptions & {
|
|
68
|
+
acceptHeaderOverride?: ChatAccessOauthCallBackAcceptEnum;
|
|
69
|
+
},
|
|
70
|
+
): Promise<
|
|
71
|
+
[
|
|
72
|
+
Result<
|
|
73
|
+
operations.SubscribersV1ControllerChatOauthCallbackResponse,
|
|
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 parsed = safeParse(
|
|
57
90
|
request,
|
|
@@ -61,7 +94,7 @@ export async function subscribersAuthenticationChatAccessOauthCallBack(
|
|
|
61
94
|
"Input validation failed",
|
|
62
95
|
);
|
|
63
96
|
if (!parsed.ok) {
|
|
64
|
-
return parsed;
|
|
97
|
+
return [parsed, { status: "invalid" }];
|
|
65
98
|
}
|
|
66
99
|
const payload = parsed.value;
|
|
67
100
|
const body = null;
|
|
@@ -103,6 +136,7 @@ export async function subscribersAuthenticationChatAccessOauthCallBack(
|
|
|
103
136
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
104
137
|
|
|
105
138
|
const context = {
|
|
139
|
+
baseURL: options?.serverURL ?? "",
|
|
106
140
|
operationID: "SubscribersV1Controller_chatOauthCallback",
|
|
107
141
|
oAuth2Scopes: [],
|
|
108
142
|
|
|
@@ -136,7 +170,7 @@ export async function subscribersAuthenticationChatAccessOauthCallBack(
|
|
|
136
170
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
137
171
|
}, options);
|
|
138
172
|
if (!requestRes.ok) {
|
|
139
|
-
return requestRes;
|
|
173
|
+
return [requestRes, { status: "invalid" }];
|
|
140
174
|
}
|
|
141
175
|
const req = requestRes.value;
|
|
142
176
|
|
|
@@ -163,7 +197,7 @@ export async function subscribersAuthenticationChatAccessOauthCallBack(
|
|
|
163
197
|
retryCodes: context.retryCodes,
|
|
164
198
|
});
|
|
165
199
|
if (!doResult.ok) {
|
|
166
|
-
return doResult;
|
|
200
|
+
return [doResult, { status: "request-error", request: req }];
|
|
167
201
|
}
|
|
168
202
|
const response = doResult.value;
|
|
169
203
|
|
|
@@ -209,8 +243,8 @@ export async function subscribersAuthenticationChatAccessOauthCallBack(
|
|
|
209
243
|
M.fail("5XX"),
|
|
210
244
|
)(response, { extraFields: responseFields });
|
|
211
245
|
if (!result.ok) {
|
|
212
|
-
return result;
|
|
246
|
+
return [result, { status: "complete", request: req, response }];
|
|
213
247
|
}
|
|
214
248
|
|
|
215
|
-
return result;
|
|
249
|
+
return [result, { status: "complete", request: req, response }];
|
|
216
250
|
}
|
|
@@ -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
|
/**
|
|
@@ -30,12 +31,12 @@ import { Result } from "../types/fp.js";
|
|
|
30
31
|
* @remarks
|
|
31
32
|
* Create subscriber with the given data
|
|
32
33
|
*/
|
|
33
|
-
export
|
|
34
|
+
export function subscribersCreate(
|
|
34
35
|
client: NovuCore,
|
|
35
36
|
createSubscriberRequestDto: components.CreateSubscriberRequestDto,
|
|
36
37
|
idempotencyKey?: string | undefined,
|
|
37
38
|
options?: RequestOptions,
|
|
38
|
-
):
|
|
39
|
+
): APIPromise<
|
|
39
40
|
Result<
|
|
40
41
|
operations.SubscribersControllerCreateSubscriberResponse,
|
|
41
42
|
| errors.ErrorDto
|
|
@@ -50,6 +51,38 @@ export async function subscribersCreate(
|
|
|
50
51
|
| RequestTimeoutError
|
|
51
52
|
| ConnectionError
|
|
52
53
|
>
|
|
54
|
+
> {
|
|
55
|
+
return new APIPromise($do(
|
|
56
|
+
client,
|
|
57
|
+
createSubscriberRequestDto,
|
|
58
|
+
idempotencyKey,
|
|
59
|
+
options,
|
|
60
|
+
));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async function $do(
|
|
64
|
+
client: NovuCore,
|
|
65
|
+
createSubscriberRequestDto: components.CreateSubscriberRequestDto,
|
|
66
|
+
idempotencyKey?: string | undefined,
|
|
67
|
+
options?: RequestOptions,
|
|
68
|
+
): Promise<
|
|
69
|
+
[
|
|
70
|
+
Result<
|
|
71
|
+
operations.SubscribersControllerCreateSubscriberResponse,
|
|
72
|
+
| errors.ErrorDto
|
|
73
|
+
| errors.ErrorDto
|
|
74
|
+
| errors.ValidationErrorDto
|
|
75
|
+
| errors.ErrorDto
|
|
76
|
+
| SDKError
|
|
77
|
+
| SDKValidationError
|
|
78
|
+
| UnexpectedClientError
|
|
79
|
+
| InvalidRequestError
|
|
80
|
+
| RequestAbortedError
|
|
81
|
+
| RequestTimeoutError
|
|
82
|
+
| ConnectionError
|
|
83
|
+
>,
|
|
84
|
+
APICall,
|
|
85
|
+
]
|
|
53
86
|
> {
|
|
54
87
|
const input: operations.SubscribersControllerCreateSubscriberRequest = {
|
|
55
88
|
createSubscriberRequestDto: createSubscriberRequestDto,
|
|
@@ -64,7 +97,7 @@ export async function subscribersCreate(
|
|
|
64
97
|
"Input validation failed",
|
|
65
98
|
);
|
|
66
99
|
if (!parsed.ok) {
|
|
67
|
-
return parsed;
|
|
100
|
+
return [parsed, { status: "invalid" }];
|
|
68
101
|
}
|
|
69
102
|
const payload = parsed.value;
|
|
70
103
|
const body = encodeJSON("body", payload.CreateSubscriberRequestDto, {
|
|
@@ -88,6 +121,7 @@ export async function subscribersCreate(
|
|
|
88
121
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
89
122
|
|
|
90
123
|
const context = {
|
|
124
|
+
baseURL: options?.serverURL ?? "",
|
|
91
125
|
operationID: "SubscribersController_createSubscriber",
|
|
92
126
|
oAuth2Scopes: [],
|
|
93
127
|
|
|
@@ -120,7 +154,7 @@ export async function subscribersCreate(
|
|
|
120
154
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
121
155
|
}, options);
|
|
122
156
|
if (!requestRes.ok) {
|
|
123
|
-
return requestRes;
|
|
157
|
+
return [requestRes, { status: "invalid" }];
|
|
124
158
|
}
|
|
125
159
|
const req = requestRes.value;
|
|
126
160
|
|
|
@@ -147,7 +181,7 @@ export async function subscribersCreate(
|
|
|
147
181
|
retryCodes: context.retryCodes,
|
|
148
182
|
});
|
|
149
183
|
if (!doResult.ok) {
|
|
150
|
-
return doResult;
|
|
184
|
+
return [doResult, { status: "request-error", request: req }];
|
|
151
185
|
}
|
|
152
186
|
const response = doResult.value;
|
|
153
187
|
|
|
@@ -170,7 +204,7 @@ export async function subscribersCreate(
|
|
|
170
204
|
| ConnectionError
|
|
171
205
|
>(
|
|
172
206
|
M.json(
|
|
173
|
-
|
|
207
|
+
201,
|
|
174
208
|
operations.SubscribersControllerCreateSubscriberResponse$inboundSchema,
|
|
175
209
|
{ hdrs: true, key: "Result" },
|
|
176
210
|
),
|
|
@@ -188,8 +222,8 @@ export async function subscribersCreate(
|
|
|
188
222
|
M.fail("5XX"),
|
|
189
223
|
)(response, { extraFields: responseFields });
|
|
190
224
|
if (!result.ok) {
|
|
191
|
-
return result;
|
|
225
|
+
return [result, { status: "complete", request: req, response }];
|
|
192
226
|
}
|
|
193
227
|
|
|
194
|
-
return result;
|
|
228
|
+
return [result, { status: "complete", request: req, response }];
|
|
195
229
|
}
|
|
@@ -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 create multiple subscribers at once, to avoid multiple calls to the API.
|
|
33
34
|
* The bulk API is limited to 500 subscribers per request.
|
|
34
35
|
*/
|
|
35
|
-
export
|
|
36
|
+
export function subscribersCreateBulk(
|
|
36
37
|
client: NovuCore,
|
|
37
38
|
bulkSubscriberCreateDto: components.BulkSubscriberCreateDto,
|
|
38
39
|
idempotencyKey?: string | undefined,
|
|
39
40
|
options?: RequestOptions,
|
|
40
|
-
):
|
|
41
|
+
): APIPromise<
|
|
41
42
|
Result<
|
|
42
43
|
operations.SubscribersV1ControllerBulkCreateSubscribersResponse,
|
|
43
44
|
| errors.ErrorDto
|
|
@@ -52,6 +53,38 @@ export async function subscribersCreateBulk(
|
|
|
52
53
|
| RequestTimeoutError
|
|
53
54
|
| ConnectionError
|
|
54
55
|
>
|
|
56
|
+
> {
|
|
57
|
+
return new APIPromise($do(
|
|
58
|
+
client,
|
|
59
|
+
bulkSubscriberCreateDto,
|
|
60
|
+
idempotencyKey,
|
|
61
|
+
options,
|
|
62
|
+
));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
async function $do(
|
|
66
|
+
client: NovuCore,
|
|
67
|
+
bulkSubscriberCreateDto: components.BulkSubscriberCreateDto,
|
|
68
|
+
idempotencyKey?: string | undefined,
|
|
69
|
+
options?: RequestOptions,
|
|
70
|
+
): Promise<
|
|
71
|
+
[
|
|
72
|
+
Result<
|
|
73
|
+
operations.SubscribersV1ControllerBulkCreateSubscribersResponse,
|
|
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.SubscribersV1ControllerBulkCreateSubscribersRequest =
|
|
57
90
|
{
|
|
@@ -68,7 +101,7 @@ export async function subscribersCreateBulk(
|
|
|
68
101
|
"Input validation failed",
|
|
69
102
|
);
|
|
70
103
|
if (!parsed.ok) {
|
|
71
|
-
return parsed;
|
|
104
|
+
return [parsed, { status: "invalid" }];
|
|
72
105
|
}
|
|
73
106
|
const payload = parsed.value;
|
|
74
107
|
const body = encodeJSON("body", payload.BulkSubscriberCreateDto, {
|
|
@@ -92,6 +125,7 @@ export async function subscribersCreateBulk(
|
|
|
92
125
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
93
126
|
|
|
94
127
|
const context = {
|
|
128
|
+
baseURL: options?.serverURL ?? "",
|
|
95
129
|
operationID: "SubscribersV1Controller_bulkCreateSubscribers",
|
|
96
130
|
oAuth2Scopes: [],
|
|
97
131
|
|
|
@@ -124,7 +158,7 @@ export async function subscribersCreateBulk(
|
|
|
124
158
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
125
159
|
}, options);
|
|
126
160
|
if (!requestRes.ok) {
|
|
127
|
-
return requestRes;
|
|
161
|
+
return [requestRes, { status: "invalid" }];
|
|
128
162
|
}
|
|
129
163
|
const req = requestRes.value;
|
|
130
164
|
|
|
@@ -151,7 +185,7 @@ export async function subscribersCreateBulk(
|
|
|
151
185
|
retryCodes: context.retryCodes,
|
|
152
186
|
});
|
|
153
187
|
if (!doResult.ok) {
|
|
154
|
-
return doResult;
|
|
188
|
+
return [doResult, { status: "request-error", request: req }];
|
|
155
189
|
}
|
|
156
190
|
const response = doResult.value;
|
|
157
191
|
|
|
@@ -193,8 +227,8 @@ export async function subscribersCreateBulk(
|
|
|
193
227
|
M.fail("5XX"),
|
|
194
228
|
)(response, { extraFields: responseFields });
|
|
195
229
|
if (!result.ok) {
|
|
196
|
-
return result;
|
|
230
|
+
return [result, { status: "complete", request: req, response }];
|
|
197
231
|
}
|
|
198
232
|
|
|
199
|
-
return result;
|
|
233
|
+
return [result, { status: "complete", request: req, response }];
|
|
200
234
|
}
|
|
@@ -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,14 +32,14 @@ import { Result } from "../types/fp.js";
|
|
|
31
32
|
* Subscriber credentials associated to the delivery methods such as slack and push tokens.
|
|
32
33
|
* This endpoint appends provided credentials and deviceTokens to the existing ones.
|
|
33
34
|
*/
|
|
34
|
-
export
|
|
35
|
+
export function subscribersCredentialsAppend(
|
|
35
36
|
client: NovuCore,
|
|
36
37
|
updateSubscriberChannelRequestDto:
|
|
37
38
|
components.UpdateSubscriberChannelRequestDto,
|
|
38
39
|
subscriberId: string,
|
|
39
40
|
idempotencyKey?: string | undefined,
|
|
40
41
|
options?: RequestOptions,
|
|
41
|
-
):
|
|
42
|
+
): APIPromise<
|
|
42
43
|
Result<
|
|
43
44
|
operations.SubscribersV1ControllerModifySubscriberChannelResponse,
|
|
44
45
|
| errors.ErrorDto
|
|
@@ -53,6 +54,41 @@ export async function subscribersCredentialsAppend(
|
|
|
53
54
|
| RequestTimeoutError
|
|
54
55
|
| ConnectionError
|
|
55
56
|
>
|
|
57
|
+
> {
|
|
58
|
+
return new APIPromise($do(
|
|
59
|
+
client,
|
|
60
|
+
updateSubscriberChannelRequestDto,
|
|
61
|
+
subscriberId,
|
|
62
|
+
idempotencyKey,
|
|
63
|
+
options,
|
|
64
|
+
));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
async function $do(
|
|
68
|
+
client: NovuCore,
|
|
69
|
+
updateSubscriberChannelRequestDto:
|
|
70
|
+
components.UpdateSubscriberChannelRequestDto,
|
|
71
|
+
subscriberId: string,
|
|
72
|
+
idempotencyKey?: string | undefined,
|
|
73
|
+
options?: RequestOptions,
|
|
74
|
+
): Promise<
|
|
75
|
+
[
|
|
76
|
+
Result<
|
|
77
|
+
operations.SubscribersV1ControllerModifySubscriberChannelResponse,
|
|
78
|
+
| errors.ErrorDto
|
|
79
|
+
| errors.ErrorDto
|
|
80
|
+
| errors.ValidationErrorDto
|
|
81
|
+
| errors.ErrorDto
|
|
82
|
+
| SDKError
|
|
83
|
+
| SDKValidationError
|
|
84
|
+
| UnexpectedClientError
|
|
85
|
+
| InvalidRequestError
|
|
86
|
+
| RequestAbortedError
|
|
87
|
+
| RequestTimeoutError
|
|
88
|
+
| ConnectionError
|
|
89
|
+
>,
|
|
90
|
+
APICall,
|
|
91
|
+
]
|
|
56
92
|
> {
|
|
57
93
|
const input:
|
|
58
94
|
operations.SubscribersV1ControllerModifySubscriberChannelRequest = {
|
|
@@ -70,7 +106,7 @@ export async function subscribersCredentialsAppend(
|
|
|
70
106
|
"Input validation failed",
|
|
71
107
|
);
|
|
72
108
|
if (!parsed.ok) {
|
|
73
|
-
return parsed;
|
|
109
|
+
return [parsed, { status: "invalid" }];
|
|
74
110
|
}
|
|
75
111
|
const payload = parsed.value;
|
|
76
112
|
const body = encodeJSON("body", payload.UpdateSubscriberChannelRequestDto, {
|
|
@@ -103,6 +139,7 @@ export async function subscribersCredentialsAppend(
|
|
|
103
139
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
104
140
|
|
|
105
141
|
const context = {
|
|
142
|
+
baseURL: options?.serverURL ?? "",
|
|
106
143
|
operationID: "SubscribersV1Controller_modifySubscriberChannel",
|
|
107
144
|
oAuth2Scopes: [],
|
|
108
145
|
|
|
@@ -135,7 +172,7 @@ export async function subscribersCredentialsAppend(
|
|
|
135
172
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
136
173
|
}, options);
|
|
137
174
|
if (!requestRes.ok) {
|
|
138
|
-
return requestRes;
|
|
175
|
+
return [requestRes, { status: "invalid" }];
|
|
139
176
|
}
|
|
140
177
|
const req = requestRes.value;
|
|
141
178
|
|
|
@@ -162,7 +199,7 @@ export async function subscribersCredentialsAppend(
|
|
|
162
199
|
retryCodes: context.retryCodes,
|
|
163
200
|
});
|
|
164
201
|
if (!doResult.ok) {
|
|
165
|
-
return doResult;
|
|
202
|
+
return [doResult, { status: "request-error", request: req }];
|
|
166
203
|
}
|
|
167
204
|
const response = doResult.value;
|
|
168
205
|
|
|
@@ -204,8 +241,8 @@ export async function subscribersCredentialsAppend(
|
|
|
204
241
|
M.fail("5XX"),
|
|
205
242
|
)(response, { extraFields: responseFields });
|
|
206
243
|
if (!result.ok) {
|
|
207
|
-
return result;
|
|
244
|
+
return [result, { status: "complete", request: req, response }];
|
|
208
245
|
}
|
|
209
246
|
|
|
210
|
-
return result;
|
|
247
|
+
return [result, { status: "complete", request: req, response }];
|
|
211
248
|
}
|
|
@@ -21,6 +21,7 @@ import * as errors from "../models/errors/index.js";
|
|
|
21
21
|
import { SDKError } from "../models/errors/sdkerror.js";
|
|
22
22
|
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
23
23
|
import * as operations from "../models/operations/index.js";
|
|
24
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
24
25
|
import { Result } from "../types/fp.js";
|
|
25
26
|
|
|
26
27
|
/**
|
|
@@ -29,13 +30,13 @@ import { Result } from "../types/fp.js";
|
|
|
29
30
|
* @remarks
|
|
30
31
|
* Delete subscriber credentials such as slack and expo tokens.
|
|
31
32
|
*/
|
|
32
|
-
export
|
|
33
|
+
export function subscribersCredentialsDelete(
|
|
33
34
|
client: NovuCore,
|
|
34
35
|
subscriberId: string,
|
|
35
36
|
providerId: string,
|
|
36
37
|
idempotencyKey?: string | undefined,
|
|
37
38
|
options?: RequestOptions,
|
|
38
|
-
):
|
|
39
|
+
): APIPromise<
|
|
39
40
|
Result<
|
|
40
41
|
| operations.SubscribersV1ControllerDeleteSubscriberCredentialsResponse
|
|
41
42
|
| undefined,
|
|
@@ -51,6 +52,41 @@ export async function subscribersCredentialsDelete(
|
|
|
51
52
|
| RequestTimeoutError
|
|
52
53
|
| ConnectionError
|
|
53
54
|
>
|
|
55
|
+
> {
|
|
56
|
+
return new APIPromise($do(
|
|
57
|
+
client,
|
|
58
|
+
subscriberId,
|
|
59
|
+
providerId,
|
|
60
|
+
idempotencyKey,
|
|
61
|
+
options,
|
|
62
|
+
));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
async function $do(
|
|
66
|
+
client: NovuCore,
|
|
67
|
+
subscriberId: string,
|
|
68
|
+
providerId: string,
|
|
69
|
+
idempotencyKey?: string | undefined,
|
|
70
|
+
options?: RequestOptions,
|
|
71
|
+
): Promise<
|
|
72
|
+
[
|
|
73
|
+
Result<
|
|
74
|
+
| operations.SubscribersV1ControllerDeleteSubscriberCredentialsResponse
|
|
75
|
+
| undefined,
|
|
76
|
+
| errors.ErrorDto
|
|
77
|
+
| errors.ErrorDto
|
|
78
|
+
| errors.ValidationErrorDto
|
|
79
|
+
| errors.ErrorDto
|
|
80
|
+
| SDKError
|
|
81
|
+
| SDKValidationError
|
|
82
|
+
| UnexpectedClientError
|
|
83
|
+
| InvalidRequestError
|
|
84
|
+
| RequestAbortedError
|
|
85
|
+
| RequestTimeoutError
|
|
86
|
+
| ConnectionError
|
|
87
|
+
>,
|
|
88
|
+
APICall,
|
|
89
|
+
]
|
|
54
90
|
> {
|
|
55
91
|
const input:
|
|
56
92
|
operations.SubscribersV1ControllerDeleteSubscriberCredentialsRequest = {
|
|
@@ -68,7 +104,7 @@ export async function subscribersCredentialsDelete(
|
|
|
68
104
|
"Input validation failed",
|
|
69
105
|
);
|
|
70
106
|
if (!parsed.ok) {
|
|
71
|
-
return parsed;
|
|
107
|
+
return [parsed, { status: "invalid" }];
|
|
72
108
|
}
|
|
73
109
|
const payload = parsed.value;
|
|
74
110
|
const body = null;
|
|
@@ -102,6 +138,7 @@ export async function subscribersCredentialsDelete(
|
|
|
102
138
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
103
139
|
|
|
104
140
|
const context = {
|
|
141
|
+
baseURL: options?.serverURL ?? "",
|
|
105
142
|
operationID: "SubscribersV1Controller_deleteSubscriberCredentials",
|
|
106
143
|
oAuth2Scopes: [],
|
|
107
144
|
|
|
@@ -134,7 +171,7 @@ export async function subscribersCredentialsDelete(
|
|
|
134
171
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
135
172
|
}, options);
|
|
136
173
|
if (!requestRes.ok) {
|
|
137
|
-
return requestRes;
|
|
174
|
+
return [requestRes, { status: "invalid" }];
|
|
138
175
|
}
|
|
139
176
|
const req = requestRes.value;
|
|
140
177
|
|
|
@@ -161,7 +198,7 @@ export async function subscribersCredentialsDelete(
|
|
|
161
198
|
retryCodes: context.retryCodes,
|
|
162
199
|
});
|
|
163
200
|
if (!doResult.ok) {
|
|
164
|
-
return doResult;
|
|
201
|
+
return [doResult, { status: "request-error", request: req }];
|
|
165
202
|
}
|
|
166
203
|
const response = doResult.value;
|
|
167
204
|
|
|
@@ -205,8 +242,8 @@ export async function subscribersCredentialsDelete(
|
|
|
205
242
|
M.fail("5XX"),
|
|
206
243
|
)(response, { extraFields: responseFields });
|
|
207
244
|
if (!result.ok) {
|
|
208
|
-
return result;
|
|
245
|
+
return [result, { status: "complete", request: req, response }];
|
|
209
246
|
}
|
|
210
247
|
|
|
211
|
-
return result;
|
|
248
|
+
return [result, { status: "complete", request: req, response }];
|
|
212
249
|
}
|
|
@@ -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
|
/**
|
|
@@ -30,14 +31,14 @@ import { Result } from "../types/fp.js";
|
|
|
30
31
|
* @remarks
|
|
31
32
|
* Subscriber credentials associated to the delivery methods such as slack and push tokens.
|
|
32
33
|
*/
|
|
33
|
-
export
|
|
34
|
+
export function subscribersCredentialsUpdate(
|
|
34
35
|
client: NovuCore,
|
|
35
36
|
updateSubscriberChannelRequestDto:
|
|
36
37
|
components.UpdateSubscriberChannelRequestDto,
|
|
37
38
|
subscriberId: string,
|
|
38
39
|
idempotencyKey?: string | undefined,
|
|
39
40
|
options?: RequestOptions,
|
|
40
|
-
):
|
|
41
|
+
): APIPromise<
|
|
41
42
|
Result<
|
|
42
43
|
operations.SubscribersV1ControllerUpdateSubscriberChannelResponse,
|
|
43
44
|
| errors.ErrorDto
|
|
@@ -52,6 +53,41 @@ export async function subscribersCredentialsUpdate(
|
|
|
52
53
|
| RequestTimeoutError
|
|
53
54
|
| ConnectionError
|
|
54
55
|
>
|
|
56
|
+
> {
|
|
57
|
+
return new APIPromise($do(
|
|
58
|
+
client,
|
|
59
|
+
updateSubscriberChannelRequestDto,
|
|
60
|
+
subscriberId,
|
|
61
|
+
idempotencyKey,
|
|
62
|
+
options,
|
|
63
|
+
));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
async function $do(
|
|
67
|
+
client: NovuCore,
|
|
68
|
+
updateSubscriberChannelRequestDto:
|
|
69
|
+
components.UpdateSubscriberChannelRequestDto,
|
|
70
|
+
subscriberId: string,
|
|
71
|
+
idempotencyKey?: string | undefined,
|
|
72
|
+
options?: RequestOptions,
|
|
73
|
+
): Promise<
|
|
74
|
+
[
|
|
75
|
+
Result<
|
|
76
|
+
operations.SubscribersV1ControllerUpdateSubscriberChannelResponse,
|
|
77
|
+
| errors.ErrorDto
|
|
78
|
+
| errors.ErrorDto
|
|
79
|
+
| errors.ValidationErrorDto
|
|
80
|
+
| errors.ErrorDto
|
|
81
|
+
| SDKError
|
|
82
|
+
| SDKValidationError
|
|
83
|
+
| UnexpectedClientError
|
|
84
|
+
| InvalidRequestError
|
|
85
|
+
| RequestAbortedError
|
|
86
|
+
| RequestTimeoutError
|
|
87
|
+
| ConnectionError
|
|
88
|
+
>,
|
|
89
|
+
APICall,
|
|
90
|
+
]
|
|
55
91
|
> {
|
|
56
92
|
const input:
|
|
57
93
|
operations.SubscribersV1ControllerUpdateSubscriberChannelRequest = {
|
|
@@ -69,7 +105,7 @@ export async function subscribersCredentialsUpdate(
|
|
|
69
105
|
"Input validation failed",
|
|
70
106
|
);
|
|
71
107
|
if (!parsed.ok) {
|
|
72
|
-
return parsed;
|
|
108
|
+
return [parsed, { status: "invalid" }];
|
|
73
109
|
}
|
|
74
110
|
const payload = parsed.value;
|
|
75
111
|
const body = encodeJSON("body", payload.UpdateSubscriberChannelRequestDto, {
|
|
@@ -102,6 +138,7 @@ export async function subscribersCredentialsUpdate(
|
|
|
102
138
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
103
139
|
|
|
104
140
|
const context = {
|
|
141
|
+
baseURL: options?.serverURL ?? "",
|
|
105
142
|
operationID: "SubscribersV1Controller_updateSubscriberChannel",
|
|
106
143
|
oAuth2Scopes: [],
|
|
107
144
|
|
|
@@ -134,7 +171,7 @@ export async function subscribersCredentialsUpdate(
|
|
|
134
171
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
135
172
|
}, options);
|
|
136
173
|
if (!requestRes.ok) {
|
|
137
|
-
return requestRes;
|
|
174
|
+
return [requestRes, { status: "invalid" }];
|
|
138
175
|
}
|
|
139
176
|
const req = requestRes.value;
|
|
140
177
|
|
|
@@ -161,7 +198,7 @@ export async function subscribersCredentialsUpdate(
|
|
|
161
198
|
retryCodes: context.retryCodes,
|
|
162
199
|
});
|
|
163
200
|
if (!doResult.ok) {
|
|
164
|
-
return doResult;
|
|
201
|
+
return [doResult, { status: "request-error", request: req }];
|
|
165
202
|
}
|
|
166
203
|
const response = doResult.value;
|
|
167
204
|
|
|
@@ -203,8 +240,8 @@ export async function subscribersCredentialsUpdate(
|
|
|
203
240
|
M.fail("5XX"),
|
|
204
241
|
)(response, { extraFields: responseFields });
|
|
205
242
|
if (!result.ok) {
|
|
206
|
-
return result;
|
|
243
|
+
return [result, { status: "complete", request: req, response }];
|
|
207
244
|
}
|
|
208
245
|
|
|
209
|
-
return result;
|
|
246
|
+
return [result, { status: "complete", request: req, response }];
|
|
210
247
|
}
|