@novu/api 3.16.0 → 3.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -14
- package/funcs/integrationsCreate.d.ts +1 -1
- package/funcs/integrationsCreate.js +1 -1
- package/funcs/integrationsCreateMobileLink.d.ts +19 -0
- package/funcs/integrationsCreateMobileLink.d.ts.map +1 -0
- package/funcs/integrationsCreateMobileLink.js +141 -0
- package/funcs/integrationsCreateMobileLink.js.map +1 -0
- package/funcs/integrationsDelete.d.ts +1 -1
- package/funcs/integrationsDelete.js +1 -1
- package/funcs/integrationsIntegrationsControllerAutoConfigureIntegration.d.ts +1 -1
- package/funcs/integrationsIntegrationsControllerAutoConfigureIntegration.js +1 -1
- package/funcs/integrationsIntegrationsControllerConfigureIntegrationWebhook.d.ts +18 -0
- package/funcs/integrationsIntegrationsControllerConfigureIntegrationWebhook.d.ts.map +1 -0
- package/funcs/integrationsIntegrationsControllerConfigureIntegrationWebhook.js +139 -0
- package/funcs/integrationsIntegrationsControllerConfigureIntegrationWebhook.js.map +1 -0
- package/funcs/integrationsLinkChannelEndpoint.d.ts +19 -0
- package/funcs/integrationsLinkChannelEndpoint.d.ts.map +1 -0
- package/funcs/integrationsLinkChannelEndpoint.js +138 -0
- package/funcs/integrationsLinkChannelEndpoint.js.map +1 -0
- package/funcs/integrationsList.d.ts +1 -1
- package/funcs/integrationsList.js +1 -1
- package/funcs/integrationsListActive.d.ts +1 -1
- package/funcs/integrationsListActive.js +1 -1
- package/funcs/integrationsSetAsPrimary.d.ts +1 -0
- package/funcs/integrationsSetAsPrimary.d.ts.map +1 -1
- package/funcs/integrationsSetAsPrimary.js +1 -0
- package/funcs/integrationsSetAsPrimary.js.map +1 -1
- package/funcs/integrationsUpdate.d.ts +1 -1
- package/funcs/integrationsUpdate.js +1 -1
- package/funcs/subscribersMessagesMarkAll.d.ts +3 -1
- package/funcs/subscribersMessagesMarkAll.d.ts.map +1 -1
- package/funcs/subscribersMessagesMarkAll.js +3 -1
- package/funcs/subscribersMessagesMarkAll.js.map +1 -1
- package/funcs/subscribersMessagesMarkAllAs.d.ts +4 -2
- package/funcs/subscribersMessagesMarkAllAs.d.ts.map +1 -1
- package/funcs/subscribersMessagesMarkAllAs.js +4 -2
- package/funcs/subscribersMessagesMarkAllAs.js.map +1 -1
- package/funcs/subscribersMessagesUpdateAsSeen.d.ts +3 -1
- package/funcs/subscribersMessagesUpdateAsSeen.d.ts.map +1 -1
- package/funcs/subscribersMessagesUpdateAsSeen.js +3 -1
- package/funcs/subscribersMessagesUpdateAsSeen.js.map +1 -1
- package/funcs/subscribersNotificationsFeed.d.ts +3 -1
- package/funcs/subscribersNotificationsFeed.d.ts.map +1 -1
- package/funcs/subscribersNotificationsFeed.js +3 -1
- package/funcs/subscribersNotificationsFeed.js.map +1 -1
- package/funcs/subscribersNotificationsUnseenCount.d.ts +3 -1
- package/funcs/subscribersNotificationsUnseenCount.d.ts.map +1 -1
- package/funcs/subscribersNotificationsUnseenCount.js +3 -1
- package/funcs/subscribersNotificationsUnseenCount.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 +4 -4
- package/lib/config.js +4 -4
- package/lib/encodings.js +12 -12
- package/lib/encodings.js.map +1 -1
- package/lib/matchers.js +3 -3
- package/lib/matchers.js.map +1 -1
- package/lib/primitives.d.ts +1 -0
- package/lib/primitives.d.ts.map +1 -1
- package/lib/primitives.js +18 -0
- package/lib/primitives.js.map +1 -1
- package/lib/retries.js +7 -0
- package/lib/retries.js.map +1 -1
- package/lib/sdks.d.ts.map +1 -1
- package/lib/sdks.js +50 -16
- package/lib/sdks.js.map +1 -1
- package/models/components/chatorpushproviderenum.d.ts +1 -0
- package/models/components/chatorpushproviderenum.d.ts.map +1 -1
- package/models/components/chatorpushproviderenum.js +1 -0
- package/models/components/chatorpushproviderenum.js.map +1 -1
- package/models/components/configuretelegramwebhookresponsedto.d.ts +21 -0
- package/models/components/configuretelegramwebhookresponsedto.d.ts.map +1 -0
- package/models/components/configuretelegramwebhookresponsedto.js +52 -0
- package/models/components/configuretelegramwebhookresponsedto.js.map +1 -0
- package/models/components/createtelegramchatendpointdto.d.ts +75 -0
- package/models/components/createtelegramchatendpointdto.d.ts.map +1 -0
- package/models/components/createtelegramchatendpointdto.js +77 -0
- package/models/components/createtelegramchatendpointdto.js.map +1 -0
- package/models/components/credentialsdto.d.ts +22 -0
- package/models/components/credentialsdto.d.ts.map +1 -1
- package/models/components/credentialsdto.js +10 -0
- package/models/components/credentialsdto.js.map +1 -1
- package/models/components/getchannelconnectionresponsedto.d.ts +3 -0
- package/models/components/getchannelconnectionresponsedto.d.ts.map +1 -1
- package/models/components/getchannelconnectionresponsedto.js +3 -0
- package/models/components/getchannelconnectionresponsedto.js.map +1 -1
- package/models/components/getchannelendpointresponsedto.d.ts +9 -2
- package/models/components/getchannelendpointresponsedto.d.ts.map +1 -1
- package/models/components/getchannelendpointresponsedto.js +13 -0
- package/models/components/getchannelendpointresponsedto.js.map +1 -1
- package/models/components/index.d.ts +7 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +7 -0
- package/models/components/index.js.map +1 -1
- package/models/components/issueintegrationmobilelinkrequestdto.d.ts +15 -0
- package/models/components/issueintegrationmobilelinkrequestdto.d.ts.map +1 -0
- package/models/components/issueintegrationmobilelinkrequestdto.js +49 -0
- package/models/components/issueintegrationmobilelinkrequestdto.js.map +1 -0
- package/models/components/issuetelegrammobilelinkresponsedto.d.ts +21 -0
- package/models/components/issuetelegrammobilelinkresponsedto.d.ts.map +1 -0
- package/models/components/issuetelegrammobilelinkresponsedto.js +52 -0
- package/models/components/issuetelegrammobilelinkresponsedto.js.map +1 -0
- package/models/components/linkchannelendpointrequestdto.d.ts +20 -0
- package/models/components/linkchannelendpointrequestdto.d.ts.map +1 -0
- package/models/components/linkchannelendpointrequestdto.js +50 -0
- package/models/components/linkchannelendpointrequestdto.js.map +1 -0
- package/models/components/linkchannelendpointresponsedto.d.ts +19 -0
- package/models/components/linkchannelendpointresponsedto.d.ts.map +1 -0
- package/models/components/linkchannelendpointresponsedto.js +51 -0
- package/models/components/linkchannelendpointresponsedto.js.map +1 -0
- package/models/components/msteamschannelendpointdto.d.ts +5 -0
- package/models/components/msteamschannelendpointdto.d.ts.map +1 -1
- package/models/components/msteamschannelendpointdto.js +11 -1
- package/models/components/msteamschannelendpointdto.js.map +1 -1
- package/models/components/msteamsuserendpointdto.d.ts +5 -0
- package/models/components/msteamsuserendpointdto.d.ts.map +1 -1
- package/models/components/msteamsuserendpointdto.js +10 -1
- package/models/components/msteamsuserendpointdto.js.map +1 -1
- package/models/components/previewpayloaddto.d.ts +5 -0
- package/models/components/previewpayloaddto.d.ts.map +1 -1
- package/models/components/previewpayloaddto.js +2 -0
- package/models/components/previewpayloaddto.js.map +1 -1
- package/models/components/providersidenum.d.ts +3 -0
- package/models/components/providersidenum.d.ts.map +1 -1
- package/models/components/providersidenum.js +3 -0
- package/models/components/providersidenum.js.map +1 -1
- package/models/components/subscriberchanneldto.d.ts +1 -0
- package/models/components/subscriberchanneldto.d.ts.map +1 -1
- package/models/components/subscriberchanneldto.js +1 -0
- package/models/components/subscriberchanneldto.js.map +1 -1
- package/models/components/telegramchatendpointdto.d.ts +20 -0
- package/models/components/telegramchatendpointdto.d.ts.map +1 -0
- package/models/components/telegramchatendpointdto.js +58 -0
- package/models/components/telegramchatendpointdto.js.map +1 -0
- package/models/components/updateworkflowdto.d.ts +5 -4
- package/models/components/updateworkflowdto.d.ts.map +1 -1
- package/models/components/updateworkflowdto.js +3 -0
- package/models/components/updateworkflowdto.js.map +1 -1
- package/models/operations/channelendpointscontrollercreatechannelendpoint.d.ts +4 -4
- package/models/operations/channelendpointscontrollercreatechannelendpoint.d.ts.map +1 -1
- package/models/operations/channelendpointscontrollercreatechannelendpoint.js +2 -0
- package/models/operations/channelendpointscontrollercreatechannelendpoint.js.map +1 -1
- package/models/operations/index.d.ts +3 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +3 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/integrationscontrollerconfigureintegrationwebhook.d.ts +29 -0
- package/models/operations/integrationscontrollerconfigureintegrationwebhook.d.ts.map +1 -0
- package/models/operations/integrationscontrollerconfigureintegrationwebhook.js +73 -0
- package/models/operations/integrationscontrollerconfigureintegrationwebhook.js.map +1 -0
- package/models/operations/integrationscontrollercreateintegrationmobilelink.d.ts +31 -0
- package/models/operations/integrationscontrollercreateintegrationmobilelink.d.ts.map +1 -0
- package/models/operations/integrationscontrollercreateintegrationmobilelink.js +75 -0
- package/models/operations/integrationscontrollercreateintegrationmobilelink.js.map +1 -0
- package/models/operations/integrationscontrollerlinkchannelendpoint.d.ts +29 -0
- package/models/operations/integrationscontrollerlinkchannelendpoint.d.ts.map +1 -0
- package/models/operations/integrationscontrollerlinkchannelendpoint.js +72 -0
- package/models/operations/integrationscontrollerlinkchannelendpoint.js.map +1 -0
- package/package.json +1 -1
- package/sdk/integrations.d.ts +28 -6
- package/sdk/integrations.d.ts.map +1 -1
- package/sdk/integrations.js +37 -6
- package/sdk/integrations.js.map +1 -1
- package/sdk/novumessages.d.ts +10 -4
- package/sdk/novumessages.d.ts.map +1 -1
- package/sdk/novumessages.js +10 -4
- package/sdk/novumessages.js.map +1 -1
- package/sdk/novunotifications.d.ts +6 -2
- package/sdk/novunotifications.d.ts.map +1 -1
- package/sdk/novunotifications.js +6 -2
- package/sdk/novunotifications.js.map +1 -1
- package/src/funcs/integrationsCreate.ts +1 -1
- package/src/funcs/integrationsCreateMobileLink.ts +236 -0
- package/src/funcs/integrationsDelete.ts +1 -1
- package/src/funcs/integrationsIntegrationsControllerAutoConfigureIntegration.ts +1 -1
- package/src/funcs/integrationsIntegrationsControllerConfigureIntegrationWebhook.ts +223 -0
- package/src/funcs/integrationsLinkChannelEndpoint.ts +216 -0
- package/src/funcs/integrationsList.ts +1 -1
- package/src/funcs/integrationsListActive.ts +1 -1
- package/src/funcs/integrationsSetAsPrimary.ts +1 -0
- package/src/funcs/integrationsUpdate.ts +1 -1
- package/src/funcs/subscribersMessagesMarkAll.ts +3 -1
- package/src/funcs/subscribersMessagesMarkAllAs.ts +4 -2
- package/src/funcs/subscribersMessagesUpdateAsSeen.ts +3 -1
- package/src/funcs/subscribersNotificationsFeed.ts +3 -1
- package/src/funcs/subscribersNotificationsUnseenCount.ts +3 -1
- package/src/hooks/types.ts +1 -0
- package/src/lib/config.ts +4 -4
- package/src/lib/encodings.ts +1 -1
- package/src/lib/matchers.ts +1 -1
- package/src/lib/primitives.ts +16 -0
- package/src/lib/retries.ts +8 -0
- package/src/lib/sdks.ts +54 -17
- package/src/models/components/chatorpushproviderenum.ts +1 -0
- package/src/models/components/configuretelegramwebhookresponsedto.ts +45 -0
- package/src/models/components/createtelegramchatendpointdto.ts +149 -0
- package/src/models/components/credentialsdto.ts +32 -0
- package/src/models/components/getchannelconnectionresponsedto.ts +3 -0
- package/src/models/components/getchannelendpointresponsedto.ts +30 -2
- package/src/models/components/index.ts +7 -0
- package/src/models/components/issueintegrationmobilelinkrequestdto.ts +36 -0
- package/src/models/components/issuetelegrammobilelinkresponsedto.ts +45 -0
- package/src/models/components/linkchannelendpointrequestdto.ts +42 -0
- package/src/models/components/linkchannelendpointresponsedto.ts +39 -0
- package/src/models/components/msteamschannelendpointdto.ts +21 -0
- package/src/models/components/msteamsuserendpointdto.ts +20 -0
- package/src/models/components/previewpayloaddto.ts +7 -0
- package/src/models/components/providersidenum.ts +3 -0
- package/src/models/components/subscriberchanneldto.ts +1 -0
- package/src/models/components/telegramchatendpointdto.ts +54 -0
- package/src/models/components/updateworkflowdto.ts +11 -0
- package/src/models/operations/channelendpointscontrollercreatechannelendpoint.ts +10 -4
- package/src/models/operations/index.ts +3 -0
- package/src/models/operations/integrationscontrollerconfigureintegrationwebhook.ts +86 -0
- package/src/models/operations/integrationscontrollercreateintegrationmobilelink.ts +94 -0
- package/src/models/operations/integrationscontrollerlinkchannelendpoint.ts +90 -0
- package/src/sdk/integrations.ts +76 -6
- package/src/sdk/novumessages.ts +10 -4
- package/src/sdk/novunotifications.ts +6 -2
- package/src/types/async.ts +8 -7
- package/types/async.d.ts.map +1 -1
- package/types/async.js +8 -7
- package/types/async.js.map +1 -1
- package/lib/dlv.d.ts +0 -14
- package/lib/dlv.d.ts.map +0 -1
- package/lib/dlv.js +0 -49
- package/lib/dlv.js.map +0 -1
- package/lib/is-plain-object.d.ts +0 -2
- package/lib/is-plain-object.d.ts.map +0 -1
- package/lib/is-plain-object.js +0 -41
- package/lib/is-plain-object.js.map +0 -1
- package/src/lib/dlv.ts +0 -53
- package/src/lib/is-plain-object.ts +0 -43
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { NovuCore } from "../core.js";
|
|
6
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import * as components from "../models/components/index.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/httpclienterrors.js";
|
|
22
|
+
import * as errors from "../models/errors/index.js";
|
|
23
|
+
import { NovuError } from "../models/errors/novuerror.js";
|
|
24
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
25
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
26
|
+
import * as operations from "../models/operations/index.js";
|
|
27
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
28
|
+
import { Result } from "../types/fp.js";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Issue a short-lived mobile setup link for an existing integration
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* Returns an opaque, single-use setup token plus a mobile URL for configuring an existing chat integration. Telegram is the only supported provider initially.
|
|
35
|
+
*/
|
|
36
|
+
export function integrationsCreateMobileLink(
|
|
37
|
+
client: NovuCore,
|
|
38
|
+
issueIntegrationMobileLinkRequestDto:
|
|
39
|
+
components.IssueIntegrationMobileLinkRequestDto,
|
|
40
|
+
integrationIdentifier: string,
|
|
41
|
+
idempotencyKey?: string | undefined,
|
|
42
|
+
options?: RequestOptions,
|
|
43
|
+
): APIPromise<
|
|
44
|
+
Result<
|
|
45
|
+
operations.IntegrationsControllerCreateIntegrationMobileLinkResponse,
|
|
46
|
+
| errors.ErrorDto
|
|
47
|
+
| errors.ValidationErrorDto
|
|
48
|
+
| NovuError
|
|
49
|
+
| ResponseValidationError
|
|
50
|
+
| ConnectionError
|
|
51
|
+
| RequestAbortedError
|
|
52
|
+
| RequestTimeoutError
|
|
53
|
+
| InvalidRequestError
|
|
54
|
+
| UnexpectedClientError
|
|
55
|
+
| SDKValidationError
|
|
56
|
+
>
|
|
57
|
+
> {
|
|
58
|
+
return new APIPromise($do(
|
|
59
|
+
client,
|
|
60
|
+
issueIntegrationMobileLinkRequestDto,
|
|
61
|
+
integrationIdentifier,
|
|
62
|
+
idempotencyKey,
|
|
63
|
+
options,
|
|
64
|
+
));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
async function $do(
|
|
68
|
+
client: NovuCore,
|
|
69
|
+
issueIntegrationMobileLinkRequestDto:
|
|
70
|
+
components.IssueIntegrationMobileLinkRequestDto,
|
|
71
|
+
integrationIdentifier: string,
|
|
72
|
+
idempotencyKey?: string | undefined,
|
|
73
|
+
options?: RequestOptions,
|
|
74
|
+
): Promise<
|
|
75
|
+
[
|
|
76
|
+
Result<
|
|
77
|
+
operations.IntegrationsControllerCreateIntegrationMobileLinkResponse,
|
|
78
|
+
| errors.ErrorDto
|
|
79
|
+
| errors.ValidationErrorDto
|
|
80
|
+
| NovuError
|
|
81
|
+
| ResponseValidationError
|
|
82
|
+
| ConnectionError
|
|
83
|
+
| RequestAbortedError
|
|
84
|
+
| RequestTimeoutError
|
|
85
|
+
| InvalidRequestError
|
|
86
|
+
| UnexpectedClientError
|
|
87
|
+
| SDKValidationError
|
|
88
|
+
>,
|
|
89
|
+
APICall,
|
|
90
|
+
]
|
|
91
|
+
> {
|
|
92
|
+
const input:
|
|
93
|
+
operations.IntegrationsControllerCreateIntegrationMobileLinkRequest = {
|
|
94
|
+
issueIntegrationMobileLinkRequestDto:
|
|
95
|
+
issueIntegrationMobileLinkRequestDto,
|
|
96
|
+
integrationIdentifier: integrationIdentifier,
|
|
97
|
+
idempotencyKey: idempotencyKey,
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const parsed = safeParse(
|
|
101
|
+
input,
|
|
102
|
+
(value) =>
|
|
103
|
+
operations
|
|
104
|
+
.IntegrationsControllerCreateIntegrationMobileLinkRequest$outboundSchema
|
|
105
|
+
.parse(value),
|
|
106
|
+
"Input validation failed",
|
|
107
|
+
);
|
|
108
|
+
if (!parsed.ok) {
|
|
109
|
+
return [parsed, { status: "invalid" }];
|
|
110
|
+
}
|
|
111
|
+
const payload = parsed.value;
|
|
112
|
+
const body = encodeJSON(
|
|
113
|
+
"body",
|
|
114
|
+
payload.IssueIntegrationMobileLinkRequestDto,
|
|
115
|
+
{ explode: true },
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
const pathParams = {
|
|
119
|
+
integrationIdentifier: encodeSimple(
|
|
120
|
+
"integrationIdentifier",
|
|
121
|
+
payload.integrationIdentifier,
|
|
122
|
+
{ explode: false, charEncoding: "percent" },
|
|
123
|
+
),
|
|
124
|
+
};
|
|
125
|
+
const path = pathToFunc(
|
|
126
|
+
"/v1/integrations/{integrationIdentifier}/mobile-link",
|
|
127
|
+
)(pathParams);
|
|
128
|
+
|
|
129
|
+
const headers = new Headers(compactMap({
|
|
130
|
+
"Content-Type": "application/json",
|
|
131
|
+
Accept: "application/json",
|
|
132
|
+
"idempotency-key": encodeSimple(
|
|
133
|
+
"idempotency-key",
|
|
134
|
+
payload["idempotency-key"],
|
|
135
|
+
{ explode: false, charEncoding: "none" },
|
|
136
|
+
),
|
|
137
|
+
}));
|
|
138
|
+
|
|
139
|
+
const secConfig = await extractSecurity(client._options.secretKey);
|
|
140
|
+
const securityInput = secConfig == null ? {} : { secretKey: secConfig };
|
|
141
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
142
|
+
|
|
143
|
+
const context = {
|
|
144
|
+
options: client._options,
|
|
145
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
146
|
+
operationID: "IntegrationsController_createIntegrationMobileLink",
|
|
147
|
+
oAuth2Scopes: null,
|
|
148
|
+
|
|
149
|
+
resolvedSecurity: requestSecurity,
|
|
150
|
+
|
|
151
|
+
securitySource: client._options.secretKey,
|
|
152
|
+
retryConfig: options?.retries
|
|
153
|
+
|| client._options.retryConfig
|
|
154
|
+
|| {
|
|
155
|
+
strategy: "backoff",
|
|
156
|
+
backoff: {
|
|
157
|
+
initialInterval: 1000,
|
|
158
|
+
maxInterval: 30000,
|
|
159
|
+
exponent: 1.5,
|
|
160
|
+
maxElapsedTime: 3600000,
|
|
161
|
+
},
|
|
162
|
+
retryConnectionErrors: true,
|
|
163
|
+
}
|
|
164
|
+
|| { strategy: "none" },
|
|
165
|
+
retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
const requestRes = client._createRequest(context, {
|
|
169
|
+
security: requestSecurity,
|
|
170
|
+
method: "POST",
|
|
171
|
+
baseURL: options?.serverURL,
|
|
172
|
+
path: path,
|
|
173
|
+
headers: headers,
|
|
174
|
+
body: body,
|
|
175
|
+
userAgent: client._options.userAgent,
|
|
176
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
177
|
+
}, options);
|
|
178
|
+
if (!requestRes.ok) {
|
|
179
|
+
return [requestRes, { status: "invalid" }];
|
|
180
|
+
}
|
|
181
|
+
const req = requestRes.value;
|
|
182
|
+
|
|
183
|
+
const doResult = await client._do(req, {
|
|
184
|
+
context,
|
|
185
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
186
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
187
|
+
retryConfig: context.retryConfig,
|
|
188
|
+
retryCodes: context.retryCodes,
|
|
189
|
+
});
|
|
190
|
+
if (!doResult.ok) {
|
|
191
|
+
return [doResult, { status: "request-error", request: req }];
|
|
192
|
+
}
|
|
193
|
+
const response = doResult.value;
|
|
194
|
+
|
|
195
|
+
const responseFields = {
|
|
196
|
+
HttpMeta: { Response: response, Request: req },
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
const [result] = await M.match<
|
|
200
|
+
operations.IntegrationsControllerCreateIntegrationMobileLinkResponse,
|
|
201
|
+
| errors.ErrorDto
|
|
202
|
+
| errors.ValidationErrorDto
|
|
203
|
+
| NovuError
|
|
204
|
+
| ResponseValidationError
|
|
205
|
+
| ConnectionError
|
|
206
|
+
| RequestAbortedError
|
|
207
|
+
| RequestTimeoutError
|
|
208
|
+
| InvalidRequestError
|
|
209
|
+
| UnexpectedClientError
|
|
210
|
+
| SDKValidationError
|
|
211
|
+
>(
|
|
212
|
+
M.json(
|
|
213
|
+
200,
|
|
214
|
+
operations
|
|
215
|
+
.IntegrationsControllerCreateIntegrationMobileLinkResponse$inboundSchema,
|
|
216
|
+
{ hdrs: true, key: "Result" },
|
|
217
|
+
),
|
|
218
|
+
M.jsonErr(414, errors.ErrorDto$inboundSchema),
|
|
219
|
+
M.jsonErr(
|
|
220
|
+
[400, 401, 403, 404, 405, 409, 413, 415],
|
|
221
|
+
errors.ErrorDto$inboundSchema,
|
|
222
|
+
{ hdrs: true },
|
|
223
|
+
),
|
|
224
|
+
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
|
|
225
|
+
M.fail(429),
|
|
226
|
+
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
|
|
227
|
+
M.fail(503),
|
|
228
|
+
M.fail("4XX"),
|
|
229
|
+
M.fail("5XX"),
|
|
230
|
+
)(response, req, { extraFields: responseFields });
|
|
231
|
+
if (!result.ok) {
|
|
232
|
+
return [result, { status: "complete", request: req, response }];
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
return [result, { status: "complete", request: req, response }];
|
|
236
|
+
}
|
|
@@ -31,7 +31,7 @@ import { Result } from "../types/fp.js";
|
|
|
31
31
|
*
|
|
32
32
|
* @remarks
|
|
33
33
|
* Delete an integration by its unique key identifier **integrationId**.
|
|
34
|
-
* This action is irreversible.
|
|
34
|
+
* This action is irreversible. Only integration metadata is returned, credentials field is returned as empty object.
|
|
35
35
|
*/
|
|
36
36
|
export function integrationsDelete(
|
|
37
37
|
client: NovuCore,
|
|
@@ -31,7 +31,7 @@ import { Result } from "../types/fp.js";
|
|
|
31
31
|
*
|
|
32
32
|
* @remarks
|
|
33
33
|
* Auto-configure an integration by its unique key identifier **integrationId** for inbound webhook support.
|
|
34
|
-
* This will automatically generate required webhook signing keys and configure webhook endpoints.
|
|
34
|
+
* This will automatically generate required webhook signing keys and configure webhook endpoints. Only integration metadata is returned, credentials field is returned as an empty object.
|
|
35
35
|
*/
|
|
36
36
|
export function integrationsIntegrationsControllerAutoConfigureIntegration(
|
|
37
37
|
client: NovuCore,
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { NovuCore } from "../core.js";
|
|
6
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import * as errors from "../models/errors/index.js";
|
|
22
|
+
import { NovuError } from "../models/errors/novuerror.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Configure a chat integration webhook
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Registers the Novu webhook URL with the chat provider for the specified integration. Telegram is the only supported provider initially.
|
|
34
|
+
*/
|
|
35
|
+
export function integrationsIntegrationsControllerConfigureIntegrationWebhook(
|
|
36
|
+
client: NovuCore,
|
|
37
|
+
integrationIdentifier: string,
|
|
38
|
+
idempotencyKey?: string | undefined,
|
|
39
|
+
options?: RequestOptions,
|
|
40
|
+
): APIPromise<
|
|
41
|
+
Result<
|
|
42
|
+
operations.IntegrationsControllerConfigureIntegrationWebhookResponse,
|
|
43
|
+
| errors.ErrorDto
|
|
44
|
+
| errors.ValidationErrorDto
|
|
45
|
+
| NovuError
|
|
46
|
+
| ResponseValidationError
|
|
47
|
+
| ConnectionError
|
|
48
|
+
| RequestAbortedError
|
|
49
|
+
| RequestTimeoutError
|
|
50
|
+
| InvalidRequestError
|
|
51
|
+
| UnexpectedClientError
|
|
52
|
+
| SDKValidationError
|
|
53
|
+
>
|
|
54
|
+
> {
|
|
55
|
+
return new APIPromise($do(
|
|
56
|
+
client,
|
|
57
|
+
integrationIdentifier,
|
|
58
|
+
idempotencyKey,
|
|
59
|
+
options,
|
|
60
|
+
));
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async function $do(
|
|
64
|
+
client: NovuCore,
|
|
65
|
+
integrationIdentifier: string,
|
|
66
|
+
idempotencyKey?: string | undefined,
|
|
67
|
+
options?: RequestOptions,
|
|
68
|
+
): Promise<
|
|
69
|
+
[
|
|
70
|
+
Result<
|
|
71
|
+
operations.IntegrationsControllerConfigureIntegrationWebhookResponse,
|
|
72
|
+
| errors.ErrorDto
|
|
73
|
+
| errors.ValidationErrorDto
|
|
74
|
+
| NovuError
|
|
75
|
+
| ResponseValidationError
|
|
76
|
+
| ConnectionError
|
|
77
|
+
| RequestAbortedError
|
|
78
|
+
| RequestTimeoutError
|
|
79
|
+
| InvalidRequestError
|
|
80
|
+
| UnexpectedClientError
|
|
81
|
+
| SDKValidationError
|
|
82
|
+
>,
|
|
83
|
+
APICall,
|
|
84
|
+
]
|
|
85
|
+
> {
|
|
86
|
+
const input:
|
|
87
|
+
operations.IntegrationsControllerConfigureIntegrationWebhookRequest = {
|
|
88
|
+
integrationIdentifier: integrationIdentifier,
|
|
89
|
+
idempotencyKey: idempotencyKey,
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const parsed = safeParse(
|
|
93
|
+
input,
|
|
94
|
+
(value) =>
|
|
95
|
+
operations
|
|
96
|
+
.IntegrationsControllerConfigureIntegrationWebhookRequest$outboundSchema
|
|
97
|
+
.parse(value),
|
|
98
|
+
"Input validation failed",
|
|
99
|
+
);
|
|
100
|
+
if (!parsed.ok) {
|
|
101
|
+
return [parsed, { status: "invalid" }];
|
|
102
|
+
}
|
|
103
|
+
const payload = parsed.value;
|
|
104
|
+
const body = null;
|
|
105
|
+
|
|
106
|
+
const pathParams = {
|
|
107
|
+
integrationIdentifier: encodeSimple(
|
|
108
|
+
"integrationIdentifier",
|
|
109
|
+
payload.integrationIdentifier,
|
|
110
|
+
{ explode: false, charEncoding: "percent" },
|
|
111
|
+
),
|
|
112
|
+
};
|
|
113
|
+
const path = pathToFunc(
|
|
114
|
+
"/v1/integrations/{integrationIdentifier}/webhook/configure",
|
|
115
|
+
)(pathParams);
|
|
116
|
+
|
|
117
|
+
const headers = new Headers(compactMap({
|
|
118
|
+
Accept: "application/json",
|
|
119
|
+
"idempotency-key": encodeSimple(
|
|
120
|
+
"idempotency-key",
|
|
121
|
+
payload["idempotency-key"],
|
|
122
|
+
{ explode: false, charEncoding: "none" },
|
|
123
|
+
),
|
|
124
|
+
}));
|
|
125
|
+
|
|
126
|
+
const secConfig = await extractSecurity(client._options.secretKey);
|
|
127
|
+
const securityInput = secConfig == null ? {} : { secretKey: secConfig };
|
|
128
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
129
|
+
|
|
130
|
+
const context = {
|
|
131
|
+
options: client._options,
|
|
132
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
133
|
+
operationID: "IntegrationsController_configureIntegrationWebhook",
|
|
134
|
+
oAuth2Scopes: null,
|
|
135
|
+
|
|
136
|
+
resolvedSecurity: requestSecurity,
|
|
137
|
+
|
|
138
|
+
securitySource: client._options.secretKey,
|
|
139
|
+
retryConfig: options?.retries
|
|
140
|
+
|| client._options.retryConfig
|
|
141
|
+
|| {
|
|
142
|
+
strategy: "backoff",
|
|
143
|
+
backoff: {
|
|
144
|
+
initialInterval: 1000,
|
|
145
|
+
maxInterval: 30000,
|
|
146
|
+
exponent: 1.5,
|
|
147
|
+
maxElapsedTime: 3600000,
|
|
148
|
+
},
|
|
149
|
+
retryConnectionErrors: true,
|
|
150
|
+
}
|
|
151
|
+
|| { strategy: "none" },
|
|
152
|
+
retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
const requestRes = client._createRequest(context, {
|
|
156
|
+
security: requestSecurity,
|
|
157
|
+
method: "POST",
|
|
158
|
+
baseURL: options?.serverURL,
|
|
159
|
+
path: path,
|
|
160
|
+
headers: headers,
|
|
161
|
+
body: body,
|
|
162
|
+
userAgent: client._options.userAgent,
|
|
163
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
164
|
+
}, options);
|
|
165
|
+
if (!requestRes.ok) {
|
|
166
|
+
return [requestRes, { status: "invalid" }];
|
|
167
|
+
}
|
|
168
|
+
const req = requestRes.value;
|
|
169
|
+
|
|
170
|
+
const doResult = await client._do(req, {
|
|
171
|
+
context,
|
|
172
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
173
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
174
|
+
retryConfig: context.retryConfig,
|
|
175
|
+
retryCodes: context.retryCodes,
|
|
176
|
+
});
|
|
177
|
+
if (!doResult.ok) {
|
|
178
|
+
return [doResult, { status: "request-error", request: req }];
|
|
179
|
+
}
|
|
180
|
+
const response = doResult.value;
|
|
181
|
+
|
|
182
|
+
const responseFields = {
|
|
183
|
+
HttpMeta: { Response: response, Request: req },
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
const [result] = await M.match<
|
|
187
|
+
operations.IntegrationsControllerConfigureIntegrationWebhookResponse,
|
|
188
|
+
| errors.ErrorDto
|
|
189
|
+
| errors.ValidationErrorDto
|
|
190
|
+
| NovuError
|
|
191
|
+
| ResponseValidationError
|
|
192
|
+
| ConnectionError
|
|
193
|
+
| RequestAbortedError
|
|
194
|
+
| RequestTimeoutError
|
|
195
|
+
| InvalidRequestError
|
|
196
|
+
| UnexpectedClientError
|
|
197
|
+
| SDKValidationError
|
|
198
|
+
>(
|
|
199
|
+
M.json(
|
|
200
|
+
200,
|
|
201
|
+
operations
|
|
202
|
+
.IntegrationsControllerConfigureIntegrationWebhookResponse$inboundSchema,
|
|
203
|
+
{ hdrs: true, key: "Result" },
|
|
204
|
+
),
|
|
205
|
+
M.jsonErr(414, errors.ErrorDto$inboundSchema),
|
|
206
|
+
M.jsonErr(
|
|
207
|
+
[400, 401, 403, 404, 405, 409, 413, 415],
|
|
208
|
+
errors.ErrorDto$inboundSchema,
|
|
209
|
+
{ hdrs: true },
|
|
210
|
+
),
|
|
211
|
+
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
|
|
212
|
+
M.fail(429),
|
|
213
|
+
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
|
|
214
|
+
M.fail(503),
|
|
215
|
+
M.fail("4XX"),
|
|
216
|
+
M.fail("5XX"),
|
|
217
|
+
)(response, req, { extraFields: responseFields });
|
|
218
|
+
if (!result.ok) {
|
|
219
|
+
return [result, { status: "complete", request: req, response }];
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
return [result, { status: "complete", request: req, response }];
|
|
223
|
+
}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { NovuCore } from "../core.js";
|
|
6
|
+
import { encodeJSON, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import { matchStatusCode } from "../lib/http.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import * as components from "../models/components/index.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/httpclienterrors.js";
|
|
22
|
+
import * as errors from "../models/errors/index.js";
|
|
23
|
+
import { NovuError } from "../models/errors/novuerror.js";
|
|
24
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
25
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
26
|
+
import * as operations from "../models/operations/index.js";
|
|
27
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
28
|
+
import { Result } from "../types/fp.js";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Issue a URL to link a subscriber chat identity
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* Returns a provider-specific URL the subscriber opens to link their chat identity. The integration provider is resolved from integrationIdentifier; Telegram returns a deep link.
|
|
35
|
+
*/
|
|
36
|
+
export function integrationsLinkChannelEndpoint(
|
|
37
|
+
client: NovuCore,
|
|
38
|
+
linkChannelEndpointRequestDto: components.LinkChannelEndpointRequestDto,
|
|
39
|
+
idempotencyKey?: string | undefined,
|
|
40
|
+
options?: RequestOptions,
|
|
41
|
+
): APIPromise<
|
|
42
|
+
Result<
|
|
43
|
+
operations.IntegrationsControllerLinkChannelEndpointResponse,
|
|
44
|
+
| errors.ErrorDto
|
|
45
|
+
| errors.ValidationErrorDto
|
|
46
|
+
| NovuError
|
|
47
|
+
| ResponseValidationError
|
|
48
|
+
| ConnectionError
|
|
49
|
+
| RequestAbortedError
|
|
50
|
+
| RequestTimeoutError
|
|
51
|
+
| InvalidRequestError
|
|
52
|
+
| UnexpectedClientError
|
|
53
|
+
| SDKValidationError
|
|
54
|
+
>
|
|
55
|
+
> {
|
|
56
|
+
return new APIPromise($do(
|
|
57
|
+
client,
|
|
58
|
+
linkChannelEndpointRequestDto,
|
|
59
|
+
idempotencyKey,
|
|
60
|
+
options,
|
|
61
|
+
));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async function $do(
|
|
65
|
+
client: NovuCore,
|
|
66
|
+
linkChannelEndpointRequestDto: components.LinkChannelEndpointRequestDto,
|
|
67
|
+
idempotencyKey?: string | undefined,
|
|
68
|
+
options?: RequestOptions,
|
|
69
|
+
): Promise<
|
|
70
|
+
[
|
|
71
|
+
Result<
|
|
72
|
+
operations.IntegrationsControllerLinkChannelEndpointResponse,
|
|
73
|
+
| errors.ErrorDto
|
|
74
|
+
| errors.ValidationErrorDto
|
|
75
|
+
| NovuError
|
|
76
|
+
| ResponseValidationError
|
|
77
|
+
| ConnectionError
|
|
78
|
+
| RequestAbortedError
|
|
79
|
+
| RequestTimeoutError
|
|
80
|
+
| InvalidRequestError
|
|
81
|
+
| UnexpectedClientError
|
|
82
|
+
| SDKValidationError
|
|
83
|
+
>,
|
|
84
|
+
APICall,
|
|
85
|
+
]
|
|
86
|
+
> {
|
|
87
|
+
const input: operations.IntegrationsControllerLinkChannelEndpointRequest = {
|
|
88
|
+
linkChannelEndpointRequestDto: linkChannelEndpointRequestDto,
|
|
89
|
+
idempotencyKey: idempotencyKey,
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const parsed = safeParse(
|
|
93
|
+
input,
|
|
94
|
+
(value) =>
|
|
95
|
+
operations.IntegrationsControllerLinkChannelEndpointRequest$outboundSchema
|
|
96
|
+
.parse(value),
|
|
97
|
+
"Input validation failed",
|
|
98
|
+
);
|
|
99
|
+
if (!parsed.ok) {
|
|
100
|
+
return [parsed, { status: "invalid" }];
|
|
101
|
+
}
|
|
102
|
+
const payload = parsed.value;
|
|
103
|
+
const body = encodeJSON("body", payload.LinkChannelEndpointRequestDto, {
|
|
104
|
+
explode: true,
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
const path = pathToFunc("/v1/integrations/channel-endpoints/link")();
|
|
108
|
+
|
|
109
|
+
const headers = new Headers(compactMap({
|
|
110
|
+
"Content-Type": "application/json",
|
|
111
|
+
Accept: "application/json",
|
|
112
|
+
"idempotency-key": encodeSimple(
|
|
113
|
+
"idempotency-key",
|
|
114
|
+
payload["idempotency-key"],
|
|
115
|
+
{ explode: false, charEncoding: "none" },
|
|
116
|
+
),
|
|
117
|
+
}));
|
|
118
|
+
|
|
119
|
+
const secConfig = await extractSecurity(client._options.secretKey);
|
|
120
|
+
const securityInput = secConfig == null ? {} : { secretKey: secConfig };
|
|
121
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
122
|
+
|
|
123
|
+
const context = {
|
|
124
|
+
options: client._options,
|
|
125
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
126
|
+
operationID: "IntegrationsController_linkChannelEndpoint",
|
|
127
|
+
oAuth2Scopes: null,
|
|
128
|
+
|
|
129
|
+
resolvedSecurity: requestSecurity,
|
|
130
|
+
|
|
131
|
+
securitySource: client._options.secretKey,
|
|
132
|
+
retryConfig: options?.retries
|
|
133
|
+
|| client._options.retryConfig
|
|
134
|
+
|| {
|
|
135
|
+
strategy: "backoff",
|
|
136
|
+
backoff: {
|
|
137
|
+
initialInterval: 1000,
|
|
138
|
+
maxInterval: 30000,
|
|
139
|
+
exponent: 1.5,
|
|
140
|
+
maxElapsedTime: 3600000,
|
|
141
|
+
},
|
|
142
|
+
retryConnectionErrors: true,
|
|
143
|
+
}
|
|
144
|
+
|| { strategy: "none" },
|
|
145
|
+
retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
const requestRes = client._createRequest(context, {
|
|
149
|
+
security: requestSecurity,
|
|
150
|
+
method: "POST",
|
|
151
|
+
baseURL: options?.serverURL,
|
|
152
|
+
path: path,
|
|
153
|
+
headers: headers,
|
|
154
|
+
body: body,
|
|
155
|
+
userAgent: client._options.userAgent,
|
|
156
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
157
|
+
}, options);
|
|
158
|
+
if (!requestRes.ok) {
|
|
159
|
+
return [requestRes, { status: "invalid" }];
|
|
160
|
+
}
|
|
161
|
+
const req = requestRes.value;
|
|
162
|
+
|
|
163
|
+
const doResult = await client._do(req, {
|
|
164
|
+
context,
|
|
165
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
166
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
167
|
+
retryConfig: context.retryConfig,
|
|
168
|
+
retryCodes: context.retryCodes,
|
|
169
|
+
});
|
|
170
|
+
if (!doResult.ok) {
|
|
171
|
+
return [doResult, { status: "request-error", request: req }];
|
|
172
|
+
}
|
|
173
|
+
const response = doResult.value;
|
|
174
|
+
|
|
175
|
+
const responseFields = {
|
|
176
|
+
HttpMeta: { Response: response, Request: req },
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
const [result] = await M.match<
|
|
180
|
+
operations.IntegrationsControllerLinkChannelEndpointResponse,
|
|
181
|
+
| errors.ErrorDto
|
|
182
|
+
| errors.ValidationErrorDto
|
|
183
|
+
| NovuError
|
|
184
|
+
| ResponseValidationError
|
|
185
|
+
| ConnectionError
|
|
186
|
+
| RequestAbortedError
|
|
187
|
+
| RequestTimeoutError
|
|
188
|
+
| InvalidRequestError
|
|
189
|
+
| UnexpectedClientError
|
|
190
|
+
| SDKValidationError
|
|
191
|
+
>(
|
|
192
|
+
M.json(
|
|
193
|
+
200,
|
|
194
|
+
operations
|
|
195
|
+
.IntegrationsControllerLinkChannelEndpointResponse$inboundSchema,
|
|
196
|
+
{ hdrs: true, key: "Result" },
|
|
197
|
+
),
|
|
198
|
+
M.jsonErr(414, errors.ErrorDto$inboundSchema),
|
|
199
|
+
M.jsonErr(
|
|
200
|
+
[400, 401, 403, 404, 405, 409, 413, 415],
|
|
201
|
+
errors.ErrorDto$inboundSchema,
|
|
202
|
+
{ hdrs: true },
|
|
203
|
+
),
|
|
204
|
+
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
|
|
205
|
+
M.fail(429),
|
|
206
|
+
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
|
|
207
|
+
M.fail(503),
|
|
208
|
+
M.fail("4XX"),
|
|
209
|
+
M.fail("5XX"),
|
|
210
|
+
)(response, req, { extraFields: responseFields });
|
|
211
|
+
if (!result.ok) {
|
|
212
|
+
return [result, { status: "complete", request: req, response }];
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
return [result, { status: "complete", request: req, response }];
|
|
216
|
+
}
|
|
@@ -30,7 +30,7 @@ import { Result } from "../types/fp.js";
|
|
|
30
30
|
* List all integrations
|
|
31
31
|
*
|
|
32
32
|
* @remarks
|
|
33
|
-
* List all the channels integrations created in the organization
|
|
33
|
+
* List all the channels integrations created in the organization. Only integration metadata is returned, credentials field is returned as an empty object.
|
|
34
34
|
*/
|
|
35
35
|
export function integrationsList(
|
|
36
36
|
client: NovuCore,
|