@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,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
|
* Delete a topic by its topic key if it has no subscribers
|
|
31
32
|
*/
|
|
32
|
-
export
|
|
33
|
+
export function topicsDelete(
|
|
33
34
|
client: NovuCore,
|
|
34
35
|
topicKey: string,
|
|
35
36
|
idempotencyKey?: string | undefined,
|
|
36
37
|
options?: RequestOptions,
|
|
37
|
-
):
|
|
38
|
+
): APIPromise<
|
|
38
39
|
Result<
|
|
39
40
|
operations.TopicsControllerDeleteTopicResponse | undefined,
|
|
40
41
|
| errors.ErrorDto
|
|
@@ -49,6 +50,38 @@ export async function topicsDelete(
|
|
|
49
50
|
| RequestTimeoutError
|
|
50
51
|
| ConnectionError
|
|
51
52
|
>
|
|
53
|
+
> {
|
|
54
|
+
return new APIPromise($do(
|
|
55
|
+
client,
|
|
56
|
+
topicKey,
|
|
57
|
+
idempotencyKey,
|
|
58
|
+
options,
|
|
59
|
+
));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async function $do(
|
|
63
|
+
client: NovuCore,
|
|
64
|
+
topicKey: string,
|
|
65
|
+
idempotencyKey?: string | undefined,
|
|
66
|
+
options?: RequestOptions,
|
|
67
|
+
): Promise<
|
|
68
|
+
[
|
|
69
|
+
Result<
|
|
70
|
+
operations.TopicsControllerDeleteTopicResponse | undefined,
|
|
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.TopicsControllerDeleteTopicRequest = {
|
|
54
87
|
topicKey: topicKey,
|
|
@@ -62,7 +95,7 @@ export async function topicsDelete(
|
|
|
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;
|
|
@@ -123,7 +156,7 @@ export async function topicsDelete(
|
|
|
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 topicsDelete(
|
|
|
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
|
|
|
@@ -191,8 +224,8 @@ export async function topicsDelete(
|
|
|
191
224
|
M.fail("5XX"),
|
|
192
225
|
)(response, { extraFields: responseFields });
|
|
193
226
|
if (!result.ok) {
|
|
194
|
-
return result;
|
|
227
|
+
return [result, { status: "complete", request: req, response }];
|
|
195
228
|
}
|
|
196
229
|
|
|
197
|
-
return result;
|
|
230
|
+
return [result, { status: "complete", request: req, response }];
|
|
198
231
|
}
|
package/src/funcs/topicsList.ts
CHANGED
|
@@ -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
|
* Returns a list of topics that can be paginated using the `page` query parameter and filtered by the topic key with the `key` query parameter
|
|
31
32
|
*/
|
|
32
|
-
export
|
|
33
|
+
export function topicsList(
|
|
33
34
|
client: NovuCore,
|
|
34
35
|
request: operations.TopicsControllerListTopicsRequest,
|
|
35
36
|
options?: RequestOptions,
|
|
36
|
-
):
|
|
37
|
+
): APIPromise<
|
|
37
38
|
Result<
|
|
38
39
|
operations.TopicsControllerListTopicsResponse,
|
|
39
40
|
| errors.ErrorDto
|
|
@@ -48,6 +49,36 @@ export async function topicsList(
|
|
|
48
49
|
| RequestTimeoutError
|
|
49
50
|
| ConnectionError
|
|
50
51
|
>
|
|
52
|
+
> {
|
|
53
|
+
return new APIPromise($do(
|
|
54
|
+
client,
|
|
55
|
+
request,
|
|
56
|
+
options,
|
|
57
|
+
));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async function $do(
|
|
61
|
+
client: NovuCore,
|
|
62
|
+
request: operations.TopicsControllerListTopicsRequest,
|
|
63
|
+
options?: RequestOptions,
|
|
64
|
+
): Promise<
|
|
65
|
+
[
|
|
66
|
+
Result<
|
|
67
|
+
operations.TopicsControllerListTopicsResponse,
|
|
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 parsed = safeParse(
|
|
53
84
|
request,
|
|
@@ -56,7 +87,7 @@ export async function topicsList(
|
|
|
56
87
|
"Input validation failed",
|
|
57
88
|
);
|
|
58
89
|
if (!parsed.ok) {
|
|
59
|
-
return parsed;
|
|
90
|
+
return [parsed, { status: "invalid" }];
|
|
60
91
|
}
|
|
61
92
|
const payload = parsed.value;
|
|
62
93
|
const body = null;
|
|
@@ -117,7 +148,7 @@ export async function topicsList(
|
|
|
117
148
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
118
149
|
}, options);
|
|
119
150
|
if (!requestRes.ok) {
|
|
120
|
-
return requestRes;
|
|
151
|
+
return [requestRes, { status: "invalid" }];
|
|
121
152
|
}
|
|
122
153
|
const req = requestRes.value;
|
|
123
154
|
|
|
@@ -144,7 +175,7 @@ export async function topicsList(
|
|
|
144
175
|
retryCodes: context.retryCodes,
|
|
145
176
|
});
|
|
146
177
|
if (!doResult.ok) {
|
|
147
|
-
return doResult;
|
|
178
|
+
return [doResult, { status: "request-error", request: req }];
|
|
148
179
|
}
|
|
149
180
|
const response = doResult.value;
|
|
150
181
|
|
|
@@ -184,8 +215,8 @@ export async function topicsList(
|
|
|
184
215
|
M.fail("5XX"),
|
|
185
216
|
)(response, { extraFields: responseFields });
|
|
186
217
|
if (!result.ok) {
|
|
187
|
-
return result;
|
|
218
|
+
return [result, { status: "complete", request: req, response }];
|
|
188
219
|
}
|
|
189
220
|
|
|
190
|
-
return result;
|
|
221
|
+
return [result, { status: "complete", request: req, response }];
|
|
191
222
|
}
|
|
@@ -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,13 +31,13 @@ import { Result } from "../types/fp.js";
|
|
|
30
31
|
* @remarks
|
|
31
32
|
* Rename a topic by providing a new name
|
|
32
33
|
*/
|
|
33
|
-
export
|
|
34
|
+
export function topicsRename(
|
|
34
35
|
client: NovuCore,
|
|
35
36
|
renameTopicRequestDto: components.RenameTopicRequestDto,
|
|
36
37
|
topicKey: string,
|
|
37
38
|
idempotencyKey?: string | undefined,
|
|
38
39
|
options?: RequestOptions,
|
|
39
|
-
):
|
|
40
|
+
): APIPromise<
|
|
40
41
|
Result<
|
|
41
42
|
operations.TopicsControllerRenameTopicResponse,
|
|
42
43
|
| errors.ErrorDto
|
|
@@ -51,6 +52,40 @@ export async function topicsRename(
|
|
|
51
52
|
| RequestTimeoutError
|
|
52
53
|
| ConnectionError
|
|
53
54
|
>
|
|
55
|
+
> {
|
|
56
|
+
return new APIPromise($do(
|
|
57
|
+
client,
|
|
58
|
+
renameTopicRequestDto,
|
|
59
|
+
topicKey,
|
|
60
|
+
idempotencyKey,
|
|
61
|
+
options,
|
|
62
|
+
));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
async function $do(
|
|
66
|
+
client: NovuCore,
|
|
67
|
+
renameTopicRequestDto: components.RenameTopicRequestDto,
|
|
68
|
+
topicKey: string,
|
|
69
|
+
idempotencyKey?: string | undefined,
|
|
70
|
+
options?: RequestOptions,
|
|
71
|
+
): Promise<
|
|
72
|
+
[
|
|
73
|
+
Result<
|
|
74
|
+
operations.TopicsControllerRenameTopicResponse,
|
|
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
|
+
]
|
|
54
89
|
> {
|
|
55
90
|
const input: operations.TopicsControllerRenameTopicRequest = {
|
|
56
91
|
renameTopicRequestDto: renameTopicRequestDto,
|
|
@@ -65,7 +100,7 @@ export async function topicsRename(
|
|
|
65
100
|
"Input validation failed",
|
|
66
101
|
);
|
|
67
102
|
if (!parsed.ok) {
|
|
68
|
-
return parsed;
|
|
103
|
+
return [parsed, { status: "invalid" }];
|
|
69
104
|
}
|
|
70
105
|
const payload = parsed.value;
|
|
71
106
|
const body = encodeJSON("body", payload.RenameTopicRequestDto, {
|
|
@@ -129,7 +164,7 @@ export async function topicsRename(
|
|
|
129
164
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
130
165
|
}, options);
|
|
131
166
|
if (!requestRes.ok) {
|
|
132
|
-
return requestRes;
|
|
167
|
+
return [requestRes, { status: "invalid" }];
|
|
133
168
|
}
|
|
134
169
|
const req = requestRes.value;
|
|
135
170
|
|
|
@@ -156,7 +191,7 @@ export async function topicsRename(
|
|
|
156
191
|
retryCodes: context.retryCodes,
|
|
157
192
|
});
|
|
158
193
|
if (!doResult.ok) {
|
|
159
|
-
return doResult;
|
|
194
|
+
return [doResult, { status: "request-error", request: req }];
|
|
160
195
|
}
|
|
161
196
|
const response = doResult.value;
|
|
162
197
|
|
|
@@ -196,8 +231,8 @@ export async function topicsRename(
|
|
|
196
231
|
M.fail("5XX"),
|
|
197
232
|
)(response, { extraFields: responseFields });
|
|
198
233
|
if (!result.ok) {
|
|
199
|
-
return result;
|
|
234
|
+
return [result, { status: "complete", request: req, response }];
|
|
200
235
|
}
|
|
201
236
|
|
|
202
|
-
return result;
|
|
237
|
+
return [result, { status: "complete", request: req, response }];
|
|
203
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
|
* Get a topic by its topic key
|
|
31
32
|
*/
|
|
32
|
-
export
|
|
33
|
+
export function topicsRetrieve(
|
|
33
34
|
client: NovuCore,
|
|
34
35
|
topicKey: string,
|
|
35
36
|
idempotencyKey?: string | undefined,
|
|
36
37
|
options?: RequestOptions,
|
|
37
|
-
):
|
|
38
|
+
): APIPromise<
|
|
38
39
|
Result<
|
|
39
40
|
operations.TopicsControllerGetTopicResponse,
|
|
40
41
|
| errors.ErrorDto
|
|
@@ -49,6 +50,38 @@ export async function topicsRetrieve(
|
|
|
49
50
|
| RequestTimeoutError
|
|
50
51
|
| ConnectionError
|
|
51
52
|
>
|
|
53
|
+
> {
|
|
54
|
+
return new APIPromise($do(
|
|
55
|
+
client,
|
|
56
|
+
topicKey,
|
|
57
|
+
idempotencyKey,
|
|
58
|
+
options,
|
|
59
|
+
));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async function $do(
|
|
63
|
+
client: NovuCore,
|
|
64
|
+
topicKey: string,
|
|
65
|
+
idempotencyKey?: string | undefined,
|
|
66
|
+
options?: RequestOptions,
|
|
67
|
+
): Promise<
|
|
68
|
+
[
|
|
69
|
+
Result<
|
|
70
|
+
operations.TopicsControllerGetTopicResponse,
|
|
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.TopicsControllerGetTopicRequest = {
|
|
54
87
|
topicKey: topicKey,
|
|
@@ -62,7 +95,7 @@ export async function topicsRetrieve(
|
|
|
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;
|
|
@@ -123,7 +156,7 @@ export async function topicsRetrieve(
|
|
|
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 topicsRetrieve(
|
|
|
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 topicsRetrieve(
|
|
|
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
|
/**
|
|
@@ -30,13 +31,13 @@ import { Result } from "../types/fp.js";
|
|
|
30
31
|
* @remarks
|
|
31
32
|
* Add subscribers to a topic by key
|
|
32
33
|
*/
|
|
33
|
-
export
|
|
34
|
+
export function topicsSubscribersAssign(
|
|
34
35
|
client: NovuCore,
|
|
35
36
|
addSubscribersRequestDto: components.AddSubscribersRequestDto,
|
|
36
37
|
topicKey: string,
|
|
37
38
|
idempotencyKey?: string | undefined,
|
|
38
39
|
options?: RequestOptions,
|
|
39
|
-
):
|
|
40
|
+
): APIPromise<
|
|
40
41
|
Result<
|
|
41
42
|
operations.TopicsControllerAssignResponse,
|
|
42
43
|
| errors.ErrorDto
|
|
@@ -51,6 +52,40 @@ export async function topicsSubscribersAssign(
|
|
|
51
52
|
| RequestTimeoutError
|
|
52
53
|
| ConnectionError
|
|
53
54
|
>
|
|
55
|
+
> {
|
|
56
|
+
return new APIPromise($do(
|
|
57
|
+
client,
|
|
58
|
+
addSubscribersRequestDto,
|
|
59
|
+
topicKey,
|
|
60
|
+
idempotencyKey,
|
|
61
|
+
options,
|
|
62
|
+
));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
async function $do(
|
|
66
|
+
client: NovuCore,
|
|
67
|
+
addSubscribersRequestDto: components.AddSubscribersRequestDto,
|
|
68
|
+
topicKey: string,
|
|
69
|
+
idempotencyKey?: string | undefined,
|
|
70
|
+
options?: RequestOptions,
|
|
71
|
+
): Promise<
|
|
72
|
+
[
|
|
73
|
+
Result<
|
|
74
|
+
operations.TopicsControllerAssignResponse,
|
|
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
|
+
]
|
|
54
89
|
> {
|
|
55
90
|
const input: operations.TopicsControllerAssignRequest = {
|
|
56
91
|
addSubscribersRequestDto: addSubscribersRequestDto,
|
|
@@ -65,7 +100,7 @@ export async function topicsSubscribersAssign(
|
|
|
65
100
|
"Input validation failed",
|
|
66
101
|
);
|
|
67
102
|
if (!parsed.ok) {
|
|
68
|
-
return parsed;
|
|
103
|
+
return [parsed, { status: "invalid" }];
|
|
69
104
|
}
|
|
70
105
|
const payload = parsed.value;
|
|
71
106
|
const body = encodeJSON("body", payload.AddSubscribersRequestDto, {
|
|
@@ -129,7 +164,7 @@ export async function topicsSubscribersAssign(
|
|
|
129
164
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
130
165
|
}, options);
|
|
131
166
|
if (!requestRes.ok) {
|
|
132
|
-
return requestRes;
|
|
167
|
+
return [requestRes, { status: "invalid" }];
|
|
133
168
|
}
|
|
134
169
|
const req = requestRes.value;
|
|
135
170
|
|
|
@@ -156,7 +191,7 @@ export async function topicsSubscribersAssign(
|
|
|
156
191
|
retryCodes: context.retryCodes,
|
|
157
192
|
});
|
|
158
193
|
if (!doResult.ok) {
|
|
159
|
-
return doResult;
|
|
194
|
+
return [doResult, { status: "request-error", request: req }];
|
|
160
195
|
}
|
|
161
196
|
const response = doResult.value;
|
|
162
197
|
|
|
@@ -196,8 +231,8 @@ export async function topicsSubscribersAssign(
|
|
|
196
231
|
M.fail("5XX"),
|
|
197
232
|
)(response, { extraFields: responseFields });
|
|
198
233
|
if (!result.ok) {
|
|
199
|
-
return result;
|
|
234
|
+
return [result, { status: "complete", request: req, response }];
|
|
200
235
|
}
|
|
201
236
|
|
|
202
|
-
return result;
|
|
237
|
+
return [result, { status: "complete", request: req, response }];
|
|
203
238
|
}
|
|
@@ -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,13 +31,13 @@ import { Result } from "../types/fp.js";
|
|
|
30
31
|
* @remarks
|
|
31
32
|
* Remove subscribers from a topic
|
|
32
33
|
*/
|
|
33
|
-
export
|
|
34
|
+
export function topicsSubscribersRemove(
|
|
34
35
|
client: NovuCore,
|
|
35
36
|
removeSubscribersRequestDto: components.RemoveSubscribersRequestDto,
|
|
36
37
|
topicKey: string,
|
|
37
38
|
idempotencyKey?: string | undefined,
|
|
38
39
|
options?: RequestOptions,
|
|
39
|
-
):
|
|
40
|
+
): APIPromise<
|
|
40
41
|
Result<
|
|
41
42
|
operations.TopicsControllerRemoveSubscribersResponse | undefined,
|
|
42
43
|
| errors.ErrorDto
|
|
@@ -51,6 +52,40 @@ export async function topicsSubscribersRemove(
|
|
|
51
52
|
| RequestTimeoutError
|
|
52
53
|
| ConnectionError
|
|
53
54
|
>
|
|
55
|
+
> {
|
|
56
|
+
return new APIPromise($do(
|
|
57
|
+
client,
|
|
58
|
+
removeSubscribersRequestDto,
|
|
59
|
+
topicKey,
|
|
60
|
+
idempotencyKey,
|
|
61
|
+
options,
|
|
62
|
+
));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
async function $do(
|
|
66
|
+
client: NovuCore,
|
|
67
|
+
removeSubscribersRequestDto: components.RemoveSubscribersRequestDto,
|
|
68
|
+
topicKey: string,
|
|
69
|
+
idempotencyKey?: string | undefined,
|
|
70
|
+
options?: RequestOptions,
|
|
71
|
+
): Promise<
|
|
72
|
+
[
|
|
73
|
+
Result<
|
|
74
|
+
operations.TopicsControllerRemoveSubscribersResponse | undefined,
|
|
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
|
+
]
|
|
54
89
|
> {
|
|
55
90
|
const input: operations.TopicsControllerRemoveSubscribersRequest = {
|
|
56
91
|
removeSubscribersRequestDto: removeSubscribersRequestDto,
|
|
@@ -67,7 +102,7 @@ export async function topicsSubscribersRemove(
|
|
|
67
102
|
"Input validation failed",
|
|
68
103
|
);
|
|
69
104
|
if (!parsed.ok) {
|
|
70
|
-
return parsed;
|
|
105
|
+
return [parsed, { status: "invalid" }];
|
|
71
106
|
}
|
|
72
107
|
const payload = parsed.value;
|
|
73
108
|
const body = encodeJSON("body", payload.RemoveSubscribersRequestDto, {
|
|
@@ -133,7 +168,7 @@ export async function topicsSubscribersRemove(
|
|
|
133
168
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
134
169
|
}, options);
|
|
135
170
|
if (!requestRes.ok) {
|
|
136
|
-
return requestRes;
|
|
171
|
+
return [requestRes, { status: "invalid" }];
|
|
137
172
|
}
|
|
138
173
|
const req = requestRes.value;
|
|
139
174
|
|
|
@@ -160,7 +195,7 @@ export async function topicsSubscribersRemove(
|
|
|
160
195
|
retryCodes: context.retryCodes,
|
|
161
196
|
});
|
|
162
197
|
if (!doResult.ok) {
|
|
163
|
-
return doResult;
|
|
198
|
+
return [doResult, { status: "request-error", request: req }];
|
|
164
199
|
}
|
|
165
200
|
const response = doResult.value;
|
|
166
201
|
|
|
@@ -202,8 +237,8 @@ export async function topicsSubscribersRemove(
|
|
|
202
237
|
M.fail("5XX"),
|
|
203
238
|
)(response, { extraFields: responseFields });
|
|
204
239
|
if (!result.ok) {
|
|
205
|
-
return result;
|
|
240
|
+
return [result, { status: "complete", request: req, response }];
|
|
206
241
|
}
|
|
207
242
|
|
|
208
|
-
return result;
|
|
243
|
+
return [result, { status: "complete", request: req, response }];
|
|
209
244
|
}
|
|
@@ -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
|
* Check if a subscriber belongs to a certain topic
|
|
31
32
|
*/
|
|
32
|
-
export
|
|
33
|
+
export function topicsSubscribersRetrieve(
|
|
33
34
|
client: NovuCore,
|
|
34
35
|
externalSubscriberId: string,
|
|
35
36
|
topicKey: string,
|
|
36
37
|
idempotencyKey?: string | undefined,
|
|
37
38
|
options?: RequestOptions,
|
|
38
|
-
):
|
|
39
|
+
): APIPromise<
|
|
39
40
|
Result<
|
|
40
41
|
operations.TopicsControllerGetTopicSubscriberResponse,
|
|
41
42
|
| errors.ErrorDto
|
|
@@ -50,6 +51,40 @@ export async function topicsSubscribersRetrieve(
|
|
|
50
51
|
| RequestTimeoutError
|
|
51
52
|
| ConnectionError
|
|
52
53
|
>
|
|
54
|
+
> {
|
|
55
|
+
return new APIPromise($do(
|
|
56
|
+
client,
|
|
57
|
+
externalSubscriberId,
|
|
58
|
+
topicKey,
|
|
59
|
+
idempotencyKey,
|
|
60
|
+
options,
|
|
61
|
+
));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async function $do(
|
|
65
|
+
client: NovuCore,
|
|
66
|
+
externalSubscriberId: string,
|
|
67
|
+
topicKey: string,
|
|
68
|
+
idempotencyKey?: string | undefined,
|
|
69
|
+
options?: RequestOptions,
|
|
70
|
+
): Promise<
|
|
71
|
+
[
|
|
72
|
+
Result<
|
|
73
|
+
operations.TopicsControllerGetTopicSubscriberResponse,
|
|
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
|
+
]
|
|
53
88
|
> {
|
|
54
89
|
const input: operations.TopicsControllerGetTopicSubscriberRequest = {
|
|
55
90
|
externalSubscriberId: externalSubscriberId,
|
|
@@ -66,7 +101,7 @@ export async function topicsSubscribersRetrieve(
|
|
|
66
101
|
"Input validation failed",
|
|
67
102
|
);
|
|
68
103
|
if (!parsed.ok) {
|
|
69
|
-
return parsed;
|
|
104
|
+
return [parsed, { status: "invalid" }];
|
|
70
105
|
}
|
|
71
106
|
const payload = parsed.value;
|
|
72
107
|
const body = null;
|
|
@@ -134,7 +169,7 @@ export async function topicsSubscribersRetrieve(
|
|
|
134
169
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
135
170
|
}, options);
|
|
136
171
|
if (!requestRes.ok) {
|
|
137
|
-
return requestRes;
|
|
172
|
+
return [requestRes, { status: "invalid" }];
|
|
138
173
|
}
|
|
139
174
|
const req = requestRes.value;
|
|
140
175
|
|
|
@@ -161,7 +196,7 @@ export async function topicsSubscribersRetrieve(
|
|
|
161
196
|
retryCodes: context.retryCodes,
|
|
162
197
|
});
|
|
163
198
|
if (!doResult.ok) {
|
|
164
|
-
return doResult;
|
|
199
|
+
return [doResult, { status: "request-error", request: req }];
|
|
165
200
|
}
|
|
166
201
|
const response = doResult.value;
|
|
167
202
|
|
|
@@ -202,8 +237,8 @@ export async function topicsSubscribersRetrieve(
|
|
|
202
237
|
M.fail("5XX"),
|
|
203
238
|
)(response, { extraFields: responseFields });
|
|
204
239
|
if (!result.ok) {
|
|
205
|
-
return result;
|
|
240
|
+
return [result, { status: "complete", request: req, response }];
|
|
206
241
|
}
|
|
207
242
|
|
|
208
|
-
return result;
|
|
243
|
+
return [result, { status: "complete", request: req, response }];
|
|
209
244
|
}
|