@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
|
@@ -21,17 +21,18 @@ 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
|
/**
|
|
27
28
|
* Delete integration
|
|
28
29
|
*/
|
|
29
|
-
export
|
|
30
|
+
export function integrationsDelete(
|
|
30
31
|
client: NovuCore,
|
|
31
32
|
integrationId: string,
|
|
32
33
|
idempotencyKey?: string | undefined,
|
|
33
34
|
options?: RequestOptions,
|
|
34
|
-
):
|
|
35
|
+
): APIPromise<
|
|
35
36
|
Result<
|
|
36
37
|
operations.IntegrationsControllerRemoveIntegrationResponse,
|
|
37
38
|
| errors.ErrorDto
|
|
@@ -46,6 +47,38 @@ export async function integrationsDelete(
|
|
|
46
47
|
| RequestTimeoutError
|
|
47
48
|
| ConnectionError
|
|
48
49
|
>
|
|
50
|
+
> {
|
|
51
|
+
return new APIPromise($do(
|
|
52
|
+
client,
|
|
53
|
+
integrationId,
|
|
54
|
+
idempotencyKey,
|
|
55
|
+
options,
|
|
56
|
+
));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async function $do(
|
|
60
|
+
client: NovuCore,
|
|
61
|
+
integrationId: string,
|
|
62
|
+
idempotencyKey?: string | undefined,
|
|
63
|
+
options?: RequestOptions,
|
|
64
|
+
): Promise<
|
|
65
|
+
[
|
|
66
|
+
Result<
|
|
67
|
+
operations.IntegrationsControllerRemoveIntegrationResponse,
|
|
68
|
+
| errors.ErrorDto
|
|
69
|
+
| errors.ErrorDto
|
|
70
|
+
| errors.ValidationErrorDto
|
|
71
|
+
| errors.ErrorDto
|
|
72
|
+
| SDKError
|
|
73
|
+
| SDKValidationError
|
|
74
|
+
| UnexpectedClientError
|
|
75
|
+
| InvalidRequestError
|
|
76
|
+
| RequestAbortedError
|
|
77
|
+
| RequestTimeoutError
|
|
78
|
+
| ConnectionError
|
|
79
|
+
>,
|
|
80
|
+
APICall,
|
|
81
|
+
]
|
|
49
82
|
> {
|
|
50
83
|
const input: operations.IntegrationsControllerRemoveIntegrationRequest = {
|
|
51
84
|
integrationId: integrationId,
|
|
@@ -60,7 +93,7 @@ export async function integrationsDelete(
|
|
|
60
93
|
"Input validation failed",
|
|
61
94
|
);
|
|
62
95
|
if (!parsed.ok) {
|
|
63
|
-
return parsed;
|
|
96
|
+
return [parsed, { status: "invalid" }];
|
|
64
97
|
}
|
|
65
98
|
const payload = parsed.value;
|
|
66
99
|
const body = null;
|
|
@@ -121,7 +154,7 @@ export async function integrationsDelete(
|
|
|
121
154
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
122
155
|
}, options);
|
|
123
156
|
if (!requestRes.ok) {
|
|
124
|
-
return requestRes;
|
|
157
|
+
return [requestRes, { status: "invalid" }];
|
|
125
158
|
}
|
|
126
159
|
const req = requestRes.value;
|
|
127
160
|
|
|
@@ -148,7 +181,7 @@ export async function integrationsDelete(
|
|
|
148
181
|
retryCodes: context.retryCodes,
|
|
149
182
|
});
|
|
150
183
|
if (!doResult.ok) {
|
|
151
|
-
return doResult;
|
|
184
|
+
return [doResult, { status: "request-error", request: req }];
|
|
152
185
|
}
|
|
153
186
|
const response = doResult.value;
|
|
154
187
|
|
|
@@ -189,8 +222,8 @@ export async function integrationsDelete(
|
|
|
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
|
}
|
|
@@ -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,11 +30,11 @@ import { Result } from "../types/fp.js";
|
|
|
29
30
|
* @remarks
|
|
30
31
|
* Return all the integrations the user has created for that organization. Review v.0.17.0 changelog for a breaking change
|
|
31
32
|
*/
|
|
32
|
-
export
|
|
33
|
+
export function integrationsList(
|
|
33
34
|
client: NovuCore,
|
|
34
35
|
idempotencyKey?: string | undefined,
|
|
35
36
|
options?: RequestOptions,
|
|
36
|
-
):
|
|
37
|
+
): APIPromise<
|
|
37
38
|
Result<
|
|
38
39
|
operations.IntegrationsControllerListIntegrationsResponse,
|
|
39
40
|
| errors.ErrorDto
|
|
@@ -48,6 +49,36 @@ export async function integrationsList(
|
|
|
48
49
|
| RequestTimeoutError
|
|
49
50
|
| ConnectionError
|
|
50
51
|
>
|
|
52
|
+
> {
|
|
53
|
+
return new APIPromise($do(
|
|
54
|
+
client,
|
|
55
|
+
idempotencyKey,
|
|
56
|
+
options,
|
|
57
|
+
));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async function $do(
|
|
61
|
+
client: NovuCore,
|
|
62
|
+
idempotencyKey?: string | undefined,
|
|
63
|
+
options?: RequestOptions,
|
|
64
|
+
): Promise<
|
|
65
|
+
[
|
|
66
|
+
Result<
|
|
67
|
+
operations.IntegrationsControllerListIntegrationsResponse,
|
|
68
|
+
| errors.ErrorDto
|
|
69
|
+
| errors.ErrorDto
|
|
70
|
+
| errors.ValidationErrorDto
|
|
71
|
+
| errors.ErrorDto
|
|
72
|
+
| SDKError
|
|
73
|
+
| SDKValidationError
|
|
74
|
+
| UnexpectedClientError
|
|
75
|
+
| InvalidRequestError
|
|
76
|
+
| RequestAbortedError
|
|
77
|
+
| RequestTimeoutError
|
|
78
|
+
| ConnectionError
|
|
79
|
+
>,
|
|
80
|
+
APICall,
|
|
81
|
+
]
|
|
51
82
|
> {
|
|
52
83
|
const input: operations.IntegrationsControllerListIntegrationsRequest = {
|
|
53
84
|
idempotencyKey: idempotencyKey,
|
|
@@ -61,7 +92,7 @@ export async function integrationsList(
|
|
|
61
92
|
"Input validation failed",
|
|
62
93
|
);
|
|
63
94
|
if (!parsed.ok) {
|
|
64
|
-
return parsed;
|
|
95
|
+
return [parsed, { status: "invalid" }];
|
|
65
96
|
}
|
|
66
97
|
const payload = parsed.value;
|
|
67
98
|
const body = null;
|
|
@@ -115,7 +146,7 @@ export async function integrationsList(
|
|
|
115
146
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
116
147
|
}, options);
|
|
117
148
|
if (!requestRes.ok) {
|
|
118
|
-
return requestRes;
|
|
149
|
+
return [requestRes, { status: "invalid" }];
|
|
119
150
|
}
|
|
120
151
|
const req = requestRes.value;
|
|
121
152
|
|
|
@@ -142,7 +173,7 @@ export async function integrationsList(
|
|
|
142
173
|
retryCodes: context.retryCodes,
|
|
143
174
|
});
|
|
144
175
|
if (!doResult.ok) {
|
|
145
|
-
return doResult;
|
|
176
|
+
return [doResult, { status: "request-error", request: req }];
|
|
146
177
|
}
|
|
147
178
|
const response = doResult.value;
|
|
148
179
|
|
|
@@ -183,8 +214,8 @@ export async function integrationsList(
|
|
|
183
214
|
M.fail("5XX"),
|
|
184
215
|
)(response, { extraFields: responseFields });
|
|
185
216
|
if (!result.ok) {
|
|
186
|
-
return result;
|
|
217
|
+
return [result, { status: "complete", request: req, response }];
|
|
187
218
|
}
|
|
188
219
|
|
|
189
|
-
return result;
|
|
220
|
+
return [result, { status: "complete", request: req, response }];
|
|
190
221
|
}
|
|
@@ -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,11 +30,11 @@ import { Result } from "../types/fp.js";
|
|
|
29
30
|
* @remarks
|
|
30
31
|
* Return all the active integrations the user has created for that organization. Review v.0.17.0 changelog for a breaking change
|
|
31
32
|
*/
|
|
32
|
-
export
|
|
33
|
+
export function integrationsListActive(
|
|
33
34
|
client: NovuCore,
|
|
34
35
|
idempotencyKey?: string | undefined,
|
|
35
36
|
options?: RequestOptions,
|
|
36
|
-
):
|
|
37
|
+
): APIPromise<
|
|
37
38
|
Result<
|
|
38
39
|
operations.IntegrationsControllerGetActiveIntegrationsResponse,
|
|
39
40
|
| errors.ErrorDto
|
|
@@ -48,6 +49,36 @@ export async function integrationsListActive(
|
|
|
48
49
|
| RequestTimeoutError
|
|
49
50
|
| ConnectionError
|
|
50
51
|
>
|
|
52
|
+
> {
|
|
53
|
+
return new APIPromise($do(
|
|
54
|
+
client,
|
|
55
|
+
idempotencyKey,
|
|
56
|
+
options,
|
|
57
|
+
));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async function $do(
|
|
61
|
+
client: NovuCore,
|
|
62
|
+
idempotencyKey?: string | undefined,
|
|
63
|
+
options?: RequestOptions,
|
|
64
|
+
): Promise<
|
|
65
|
+
[
|
|
66
|
+
Result<
|
|
67
|
+
operations.IntegrationsControllerGetActiveIntegrationsResponse,
|
|
68
|
+
| errors.ErrorDto
|
|
69
|
+
| errors.ErrorDto
|
|
70
|
+
| errors.ValidationErrorDto
|
|
71
|
+
| errors.ErrorDto
|
|
72
|
+
| SDKError
|
|
73
|
+
| SDKValidationError
|
|
74
|
+
| UnexpectedClientError
|
|
75
|
+
| InvalidRequestError
|
|
76
|
+
| RequestAbortedError
|
|
77
|
+
| RequestTimeoutError
|
|
78
|
+
| ConnectionError
|
|
79
|
+
>,
|
|
80
|
+
APICall,
|
|
81
|
+
]
|
|
51
82
|
> {
|
|
52
83
|
const input: operations.IntegrationsControllerGetActiveIntegrationsRequest = {
|
|
53
84
|
idempotencyKey: idempotencyKey,
|
|
@@ -62,7 +93,7 @@ export async function integrationsListActive(
|
|
|
62
93
|
"Input validation failed",
|
|
63
94
|
);
|
|
64
95
|
if (!parsed.ok) {
|
|
65
|
-
return parsed;
|
|
96
|
+
return [parsed, { status: "invalid" }];
|
|
66
97
|
}
|
|
67
98
|
const payload = parsed.value;
|
|
68
99
|
const body = null;
|
|
@@ -116,7 +147,7 @@ export async function integrationsListActive(
|
|
|
116
147
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
117
148
|
}, options);
|
|
118
149
|
if (!requestRes.ok) {
|
|
119
|
-
return requestRes;
|
|
150
|
+
return [requestRes, { status: "invalid" }];
|
|
120
151
|
}
|
|
121
152
|
const req = requestRes.value;
|
|
122
153
|
|
|
@@ -143,7 +174,7 @@ export async function integrationsListActive(
|
|
|
143
174
|
retryCodes: context.retryCodes,
|
|
144
175
|
});
|
|
145
176
|
if (!doResult.ok) {
|
|
146
|
-
return doResult;
|
|
177
|
+
return [doResult, { status: "request-error", request: req }];
|
|
147
178
|
}
|
|
148
179
|
const response = doResult.value;
|
|
149
180
|
|
|
@@ -185,8 +216,8 @@ export async function integrationsListActive(
|
|
|
185
216
|
M.fail("5XX"),
|
|
186
217
|
)(response, { extraFields: responseFields });
|
|
187
218
|
if (!result.ok) {
|
|
188
|
-
return result;
|
|
219
|
+
return [result, { status: "complete", request: req, response }];
|
|
189
220
|
}
|
|
190
221
|
|
|
191
|
-
return result;
|
|
222
|
+
return [result, { status: "complete", request: req, response }];
|
|
192
223
|
}
|
|
@@ -21,17 +21,18 @@ 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
|
/**
|
|
27
28
|
* Set integration as primary
|
|
28
29
|
*/
|
|
29
|
-
export
|
|
30
|
+
export function integrationsSetAsPrimary(
|
|
30
31
|
client: NovuCore,
|
|
31
32
|
integrationId: string,
|
|
32
33
|
idempotencyKey?: string | undefined,
|
|
33
34
|
options?: RequestOptions,
|
|
34
|
-
):
|
|
35
|
+
): APIPromise<
|
|
35
36
|
Result<
|
|
36
37
|
operations.IntegrationsControllerSetIntegrationAsPrimaryResponse,
|
|
37
38
|
| errors.ErrorDto
|
|
@@ -46,6 +47,38 @@ export async function integrationsSetAsPrimary(
|
|
|
46
47
|
| RequestTimeoutError
|
|
47
48
|
| ConnectionError
|
|
48
49
|
>
|
|
50
|
+
> {
|
|
51
|
+
return new APIPromise($do(
|
|
52
|
+
client,
|
|
53
|
+
integrationId,
|
|
54
|
+
idempotencyKey,
|
|
55
|
+
options,
|
|
56
|
+
));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
async function $do(
|
|
60
|
+
client: NovuCore,
|
|
61
|
+
integrationId: string,
|
|
62
|
+
idempotencyKey?: string | undefined,
|
|
63
|
+
options?: RequestOptions,
|
|
64
|
+
): Promise<
|
|
65
|
+
[
|
|
66
|
+
Result<
|
|
67
|
+
operations.IntegrationsControllerSetIntegrationAsPrimaryResponse,
|
|
68
|
+
| errors.ErrorDto
|
|
69
|
+
| errors.ErrorDto
|
|
70
|
+
| errors.ValidationErrorDto
|
|
71
|
+
| errors.ErrorDto
|
|
72
|
+
| SDKError
|
|
73
|
+
| SDKValidationError
|
|
74
|
+
| UnexpectedClientError
|
|
75
|
+
| InvalidRequestError
|
|
76
|
+
| RequestAbortedError
|
|
77
|
+
| RequestTimeoutError
|
|
78
|
+
| ConnectionError
|
|
79
|
+
>,
|
|
80
|
+
APICall,
|
|
81
|
+
]
|
|
49
82
|
> {
|
|
50
83
|
const input: operations.IntegrationsControllerSetIntegrationAsPrimaryRequest =
|
|
51
84
|
{
|
|
@@ -62,7 +95,7 @@ export async function integrationsSetAsPrimary(
|
|
|
62
95
|
"Input validation failed",
|
|
63
96
|
);
|
|
64
97
|
if (!parsed.ok) {
|
|
65
|
-
return parsed;
|
|
98
|
+
return [parsed, { status: "invalid" }];
|
|
66
99
|
}
|
|
67
100
|
const payload = parsed.value;
|
|
68
101
|
const body = null;
|
|
@@ -125,7 +158,7 @@ export async function integrationsSetAsPrimary(
|
|
|
125
158
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
126
159
|
}, options);
|
|
127
160
|
if (!requestRes.ok) {
|
|
128
|
-
return requestRes;
|
|
161
|
+
return [requestRes, { status: "invalid" }];
|
|
129
162
|
}
|
|
130
163
|
const req = requestRes.value;
|
|
131
164
|
|
|
@@ -152,7 +185,7 @@ export async function integrationsSetAsPrimary(
|
|
|
152
185
|
retryCodes: context.retryCodes,
|
|
153
186
|
});
|
|
154
187
|
if (!doResult.ok) {
|
|
155
|
-
return doResult;
|
|
188
|
+
return [doResult, { status: "request-error", request: req }];
|
|
156
189
|
}
|
|
157
190
|
const response = doResult.value;
|
|
158
191
|
|
|
@@ -194,8 +227,8 @@ export async function integrationsSetAsPrimary(
|
|
|
194
227
|
M.fail("5XX"),
|
|
195
228
|
)(response, { extraFields: responseFields });
|
|
196
229
|
if (!result.ok) {
|
|
197
|
-
return result;
|
|
230
|
+
return [result, { status: "complete", request: req, response }];
|
|
198
231
|
}
|
|
199
232
|
|
|
200
|
-
return result;
|
|
233
|
+
return [result, { status: "complete", request: req, response }];
|
|
201
234
|
}
|
|
@@ -22,18 +22,19 @@ 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
|
/**
|
|
28
29
|
* Update integration
|
|
29
30
|
*/
|
|
30
|
-
export
|
|
31
|
+
export function integrationsUpdate(
|
|
31
32
|
client: NovuCore,
|
|
32
33
|
updateIntegrationRequestDto: components.UpdateIntegrationRequestDto,
|
|
33
34
|
integrationId: string,
|
|
34
35
|
idempotencyKey?: string | undefined,
|
|
35
36
|
options?: RequestOptions,
|
|
36
|
-
):
|
|
37
|
+
): APIPromise<
|
|
37
38
|
Result<
|
|
38
39
|
operations.IntegrationsControllerUpdateIntegrationByIdResponse,
|
|
39
40
|
| errors.ErrorDto
|
|
@@ -48,6 +49,40 @@ export async function integrationsUpdate(
|
|
|
48
49
|
| RequestTimeoutError
|
|
49
50
|
| ConnectionError
|
|
50
51
|
>
|
|
52
|
+
> {
|
|
53
|
+
return new APIPromise($do(
|
|
54
|
+
client,
|
|
55
|
+
updateIntegrationRequestDto,
|
|
56
|
+
integrationId,
|
|
57
|
+
idempotencyKey,
|
|
58
|
+
options,
|
|
59
|
+
));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async function $do(
|
|
63
|
+
client: NovuCore,
|
|
64
|
+
updateIntegrationRequestDto: components.UpdateIntegrationRequestDto,
|
|
65
|
+
integrationId: string,
|
|
66
|
+
idempotencyKey?: string | undefined,
|
|
67
|
+
options?: RequestOptions,
|
|
68
|
+
): Promise<
|
|
69
|
+
[
|
|
70
|
+
Result<
|
|
71
|
+
operations.IntegrationsControllerUpdateIntegrationByIdResponse,
|
|
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
|
+
]
|
|
51
86
|
> {
|
|
52
87
|
const input: operations.IntegrationsControllerUpdateIntegrationByIdRequest = {
|
|
53
88
|
updateIntegrationRequestDto: updateIntegrationRequestDto,
|
|
@@ -64,7 +99,7 @@ export async function integrationsUpdate(
|
|
|
64
99
|
"Input validation failed",
|
|
65
100
|
);
|
|
66
101
|
if (!parsed.ok) {
|
|
67
|
-
return parsed;
|
|
102
|
+
return [parsed, { status: "invalid" }];
|
|
68
103
|
}
|
|
69
104
|
const payload = parsed.value;
|
|
70
105
|
const body = encodeJSON("body", payload.UpdateIntegrationRequestDto, {
|
|
@@ -128,7 +163,7 @@ export async function integrationsUpdate(
|
|
|
128
163
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
129
164
|
}, options);
|
|
130
165
|
if (!requestRes.ok) {
|
|
131
|
-
return requestRes;
|
|
166
|
+
return [requestRes, { status: "invalid" }];
|
|
132
167
|
}
|
|
133
168
|
const req = requestRes.value;
|
|
134
169
|
|
|
@@ -155,7 +190,7 @@ export async function integrationsUpdate(
|
|
|
155
190
|
retryCodes: context.retryCodes,
|
|
156
191
|
});
|
|
157
192
|
if (!doResult.ok) {
|
|
158
|
-
return doResult;
|
|
193
|
+
return [doResult, { status: "request-error", request: req }];
|
|
159
194
|
}
|
|
160
195
|
const response = doResult.value;
|
|
161
196
|
|
|
@@ -197,8 +232,8 @@ export async function integrationsUpdate(
|
|
|
197
232
|
M.fail("5XX"),
|
|
198
233
|
)(response, { extraFields: responseFields });
|
|
199
234
|
if (!result.ok) {
|
|
200
|
-
return result;
|
|
235
|
+
return [result, { status: "complete", request: req, response }];
|
|
201
236
|
}
|
|
202
237
|
|
|
203
|
-
return result;
|
|
238
|
+
return [result, { status: "complete", request: req, response }];
|
|
204
239
|
}
|
|
@@ -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,12 +30,12 @@ import { Result } from "../types/fp.js";
|
|
|
29
30
|
* @remarks
|
|
30
31
|
* Return the status of the webhook for this provider, if it is supported or if it is not based on a boolean value
|
|
31
32
|
*/
|
|
32
|
-
export
|
|
33
|
+
export function integrationsWebhooksRetrieve(
|
|
33
34
|
client: NovuCore,
|
|
34
35
|
providerOrIntegrationId: string,
|
|
35
36
|
idempotencyKey?: string | undefined,
|
|
36
37
|
options?: RequestOptions,
|
|
37
|
-
):
|
|
38
|
+
): APIPromise<
|
|
38
39
|
Result<
|
|
39
40
|
operations.IntegrationsControllerGetWebhookSupportStatusResponse,
|
|
40
41
|
| errors.ErrorDto
|
|
@@ -49,6 +50,38 @@ export async function integrationsWebhooksRetrieve(
|
|
|
49
50
|
| RequestTimeoutError
|
|
50
51
|
| ConnectionError
|
|
51
52
|
>
|
|
53
|
+
> {
|
|
54
|
+
return new APIPromise($do(
|
|
55
|
+
client,
|
|
56
|
+
providerOrIntegrationId,
|
|
57
|
+
idempotencyKey,
|
|
58
|
+
options,
|
|
59
|
+
));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async function $do(
|
|
63
|
+
client: NovuCore,
|
|
64
|
+
providerOrIntegrationId: string,
|
|
65
|
+
idempotencyKey?: string | undefined,
|
|
66
|
+
options?: RequestOptions,
|
|
67
|
+
): Promise<
|
|
68
|
+
[
|
|
69
|
+
Result<
|
|
70
|
+
operations.IntegrationsControllerGetWebhookSupportStatusResponse,
|
|
71
|
+
| errors.ErrorDto
|
|
72
|
+
| errors.ErrorDto
|
|
73
|
+
| errors.ValidationErrorDto
|
|
74
|
+
| errors.ErrorDto
|
|
75
|
+
| SDKError
|
|
76
|
+
| SDKValidationError
|
|
77
|
+
| UnexpectedClientError
|
|
78
|
+
| InvalidRequestError
|
|
79
|
+
| RequestAbortedError
|
|
80
|
+
| RequestTimeoutError
|
|
81
|
+
| ConnectionError
|
|
82
|
+
>,
|
|
83
|
+
APICall,
|
|
84
|
+
]
|
|
52
85
|
> {
|
|
53
86
|
const input: operations.IntegrationsControllerGetWebhookSupportStatusRequest =
|
|
54
87
|
{
|
|
@@ -65,7 +98,7 @@ export async function integrationsWebhooksRetrieve(
|
|
|
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 = null;
|
|
@@ -129,7 +162,7 @@ export async function integrationsWebhooksRetrieve(
|
|
|
129
162
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
130
163
|
}, options);
|
|
131
164
|
if (!requestRes.ok) {
|
|
132
|
-
return requestRes;
|
|
165
|
+
return [requestRes, { status: "invalid" }];
|
|
133
166
|
}
|
|
134
167
|
const req = requestRes.value;
|
|
135
168
|
|
|
@@ -156,7 +189,7 @@ export async function integrationsWebhooksRetrieve(
|
|
|
156
189
|
retryCodes: context.retryCodes,
|
|
157
190
|
});
|
|
158
191
|
if (!doResult.ok) {
|
|
159
|
-
return doResult;
|
|
192
|
+
return [doResult, { status: "request-error", request: req }];
|
|
160
193
|
}
|
|
161
194
|
const response = doResult.value;
|
|
162
195
|
|
|
@@ -198,8 +231,8 @@ export async function integrationsWebhooksRetrieve(
|
|
|
198
231
|
M.fail("5XX"),
|
|
199
232
|
)(response, { extraFields: responseFields });
|
|
200
233
|
if (!result.ok) {
|
|
201
|
-
return result;
|
|
234
|
+
return [result, { status: "complete", request: req, response }];
|
|
202
235
|
}
|
|
203
236
|
|
|
204
|
-
return result;
|
|
237
|
+
return [result, { status: "complete", request: req, response }];
|
|
205
238
|
}
|
|
@@ -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,12 +30,12 @@ import { Result } from "../types/fp.js";
|
|
|
29
30
|
* @remarks
|
|
30
31
|
* Deletes a message entity from the Novu platform
|
|
31
32
|
*/
|
|
32
|
-
export
|
|
33
|
+
export function messagesDelete(
|
|
33
34
|
client: NovuCore,
|
|
34
35
|
messageId: string,
|
|
35
36
|
idempotencyKey?: string | undefined,
|
|
36
37
|
options?: RequestOptions,
|
|
37
|
-
):
|
|
38
|
+
): APIPromise<
|
|
38
39
|
Result<
|
|
39
40
|
operations.MessagesControllerDeleteMessageResponse,
|
|
40
41
|
| errors.ErrorDto
|
|
@@ -49,6 +50,38 @@ export async function messagesDelete(
|
|
|
49
50
|
| RequestTimeoutError
|
|
50
51
|
| ConnectionError
|
|
51
52
|
>
|
|
53
|
+
> {
|
|
54
|
+
return new APIPromise($do(
|
|
55
|
+
client,
|
|
56
|
+
messageId,
|
|
57
|
+
idempotencyKey,
|
|
58
|
+
options,
|
|
59
|
+
));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async function $do(
|
|
63
|
+
client: NovuCore,
|
|
64
|
+
messageId: string,
|
|
65
|
+
idempotencyKey?: string | undefined,
|
|
66
|
+
options?: RequestOptions,
|
|
67
|
+
): Promise<
|
|
68
|
+
[
|
|
69
|
+
Result<
|
|
70
|
+
operations.MessagesControllerDeleteMessageResponse,
|
|
71
|
+
| errors.ErrorDto
|
|
72
|
+
| errors.ErrorDto
|
|
73
|
+
| errors.ValidationErrorDto
|
|
74
|
+
| errors.ErrorDto
|
|
75
|
+
| SDKError
|
|
76
|
+
| SDKValidationError
|
|
77
|
+
| UnexpectedClientError
|
|
78
|
+
| InvalidRequestError
|
|
79
|
+
| RequestAbortedError
|
|
80
|
+
| RequestTimeoutError
|
|
81
|
+
| ConnectionError
|
|
82
|
+
>,
|
|
83
|
+
APICall,
|
|
84
|
+
]
|
|
52
85
|
> {
|
|
53
86
|
const input: operations.MessagesControllerDeleteMessageRequest = {
|
|
54
87
|
messageId: messageId,
|
|
@@ -64,7 +97,7 @@ export async function messagesDelete(
|
|
|
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 = null;
|
|
@@ -125,7 +158,7 @@ export async function messagesDelete(
|
|
|
125
158
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
126
159
|
}, options);
|
|
127
160
|
if (!requestRes.ok) {
|
|
128
|
-
return requestRes;
|
|
161
|
+
return [requestRes, { status: "invalid" }];
|
|
129
162
|
}
|
|
130
163
|
const req = requestRes.value;
|
|
131
164
|
|
|
@@ -152,7 +185,7 @@ export async function messagesDelete(
|
|
|
152
185
|
retryCodes: context.retryCodes,
|
|
153
186
|
});
|
|
154
187
|
if (!doResult.ok) {
|
|
155
|
-
return doResult;
|
|
188
|
+
return [doResult, { status: "request-error", request: req }];
|
|
156
189
|
}
|
|
157
190
|
const response = doResult.value;
|
|
158
191
|
|
|
@@ -193,8 +226,8 @@ export async function messagesDelete(
|
|
|
193
226
|
M.fail("5XX"),
|
|
194
227
|
)(response, { extraFields: responseFields });
|
|
195
228
|
if (!result.ok) {
|
|
196
|
-
return result;
|
|
229
|
+
return [result, { status: "complete", request: req, response }];
|
|
197
230
|
}
|
|
198
231
|
|
|
199
|
-
return result;
|
|
232
|
+
return [result, { status: "complete", request: req, response }];
|
|
200
233
|
}
|