@novu/api 0.1.6 → 0.2.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/FUNCTIONS.md +1 -1
- package/README.md +14 -31
- package/docs/sdks/authentication/README.md +4 -4
- package/docs/sdks/credentials/README.md +6 -6
- package/docs/sdks/integrations/README.md +12 -12
- package/docs/sdks/messages/README.md +6 -6
- package/docs/sdks/notifications/README.md +4 -4
- package/docs/sdks/novu/README.md +8 -8
- package/docs/sdks/novumessages/README.md +6 -6
- package/docs/sdks/novunotifications/README.md +4 -4
- package/docs/sdks/novusubscribers/README.md +6 -6
- package/docs/sdks/preferences/README.md +9 -260
- package/docs/sdks/properties/README.md +2 -2
- package/docs/sdks/stats/README.md +4 -4
- package/docs/sdks/subscribers/README.md +50 -322
- package/docs/sdks/topics/README.md +10 -10
- package/docs/sdks/webhooks/README.md +2 -2
- package/funcs/subscribersCreate.d.ts +2 -2
- package/funcs/subscribersCreate.d.ts.map +1 -1
- package/funcs/subscribersCreate.js +5 -5
- package/funcs/subscribersCreate.js.map +1 -1
- package/funcs/{subscribersPreferencesRetrieve.d.ts → subscribersPreferencesList.d.ts} +2 -2
- package/funcs/subscribersPreferencesList.d.ts.map +1 -0
- package/funcs/{subscribersPreferencesRetrieve.js → subscribersPreferencesList.js} +4 -4
- package/funcs/subscribersPreferencesList.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/models/components/index.d.ts +0 -14
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +0 -14
- package/models/components/index.js.map +1 -1
- package/models/components/subscriberresponsedto.d.ts +5 -0
- package/models/components/subscriberresponsedto.d.ts.map +1 -1
- package/models/components/subscriberresponsedto.js +2 -0
- package/models/components/subscriberresponsedto.js.map +1 -1
- package/models/operations/index.d.ts +1 -8
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +1 -8
- package/models/operations/index.js.map +1 -1
- package/models/operations/subscriberscontrollercreatesubscriber.d.ts +66 -0
- package/models/operations/subscriberscontrollercreatesubscriber.d.ts.map +1 -0
- package/models/operations/subscriberscontrollercreatesubscriber.js +112 -0
- package/models/operations/subscriberscontrollercreatesubscriber.js.map +1 -0
- package/package.json +1 -1
- package/sdk/preferences.d.ts +1 -20
- package/sdk/preferences.d.ts.map +1 -1
- package/sdk/preferences.js +3 -32
- package/sdk/preferences.js.map +1 -1
- package/sdk/subscribers.d.ts +9 -32
- package/sdk/subscribers.d.ts.map +1 -1
- package/sdk/subscribers.js +12 -44
- package/sdk/subscribers.js.map +1 -1
- package/sources/json-development.json +2313 -6112
- package/src/funcs/subscribersCreate.ts +9 -9
- package/src/funcs/{subscribersPreferencesRetrieve.ts → subscribersPreferencesList.ts} +1 -1
- package/src/lib/config.ts +3 -3
- package/src/models/components/index.ts +0 -14
- package/src/models/components/subscriberresponsedto.ts +7 -0
- package/src/models/operations/index.ts +1 -8
- package/src/models/operations/subscriberscontrollercreatesubscriber.ts +185 -0
- package/src/sdk/preferences.ts +3 -70
- package/src/sdk/subscribers.ts +24 -90
- package/docs/sdks/legacy/README.md +0 -86
- package/funcs/subscribersDeleteLegacy.d.ts +0 -18
- package/funcs/subscribersDeleteLegacy.d.ts.map +0 -1
- package/funcs/subscribersDeleteLegacy.js +0 -141
- package/funcs/subscribersDeleteLegacy.js.map +0 -1
- package/funcs/subscribersPreferencesLegacyUpdateGlobal.d.ts +0 -14
- package/funcs/subscribersPreferencesLegacyUpdateGlobal.d.ts.map +0 -1
- package/funcs/subscribersPreferencesLegacyUpdateGlobal.js +0 -140
- package/funcs/subscribersPreferencesLegacyUpdateGlobal.js.map +0 -1
- package/funcs/subscribersPreferencesListLegacy.d.ts +0 -15
- package/funcs/subscribersPreferencesListLegacy.d.ts.map +0 -1
- package/funcs/subscribersPreferencesListLegacy.js +0 -145
- package/funcs/subscribersPreferencesListLegacy.js.map +0 -1
- package/funcs/subscribersPreferencesRetrieve.d.ts.map +0 -1
- package/funcs/subscribersPreferencesRetrieve.js.map +0 -1
- package/funcs/subscribersPreferencesRetrieveByLevelLegacy.d.ts +0 -15
- package/funcs/subscribersPreferencesRetrieveByLevelLegacy.d.ts.map +0 -1
- package/funcs/subscribersPreferencesRetrieveByLevelLegacy.js +0 -144
- package/funcs/subscribersPreferencesRetrieveByLevelLegacy.js.map +0 -1
- package/funcs/subscribersPreferencesUpdateLegacy.d.ts +0 -13
- package/funcs/subscribersPreferencesUpdateLegacy.d.ts.map +0 -1
- package/funcs/subscribersPreferencesUpdateLegacy.js +0 -139
- package/funcs/subscribersPreferencesUpdateLegacy.js.map +0 -1
- package/funcs/subscribersRetrieveLegacy.d.ts +0 -16
- package/funcs/subscribersRetrieveLegacy.d.ts.map +0 -1
- package/funcs/subscribersRetrieveLegacy.js +0 -144
- package/funcs/subscribersRetrieveLegacy.js.map +0 -1
- package/funcs/subscribersUpdateLegacy.d.ts +0 -17
- package/funcs/subscribersUpdateLegacy.d.ts.map +0 -1
- package/funcs/subscribersUpdateLegacy.js +0 -143
- package/funcs/subscribersUpdateLegacy.js.map +0 -1
- package/models/components/channelpreference.d.ts +0 -38
- package/models/components/channelpreference.d.ts.map +0 -1
- package/models/components/channelpreference.js +0 -62
- package/models/components/channelpreference.js.map +0 -1
- package/models/components/deletesubscriberresponsedto.d.ts +0 -66
- package/models/components/deletesubscriberresponsedto.d.ts.map +0 -1
- package/models/components/deletesubscriberresponsedto.js +0 -82
- package/models/components/deletesubscriberresponsedto.js.map +0 -1
- package/models/components/getsubscriberpreferencesresponsedto.d.ts +0 -39
- package/models/components/getsubscriberpreferencesresponsedto.d.ts.map +0 -1
- package/models/components/getsubscriberpreferencesresponsedto.js +0 -63
- package/models/components/getsubscriberpreferencesresponsedto.js.map +0 -1
- package/models/components/notificationtriggerresponse.d.ts +0 -55
- package/models/components/notificationtriggerresponse.d.ts.map +0 -1
- package/models/components/notificationtriggerresponse.js +0 -72
- package/models/components/notificationtriggerresponse.js.map +0 -1
- package/models/components/notificationtriggervariableresponse.d.ts +0 -101
- package/models/components/notificationtriggervariableresponse.d.ts.map +0 -1
- package/models/components/notificationtriggervariableresponse.js +0 -112
- package/models/components/notificationtriggervariableresponse.js.map +0 -1
- package/models/components/preference.d.ts +0 -38
- package/models/components/preference.d.ts.map +0 -1
- package/models/components/preference.js +0 -62
- package/models/components/preference.js.map +0 -1
- package/models/components/templateresponse.d.ts +0 -48
- package/models/components/templateresponse.d.ts.map +0 -1
- package/models/components/templateresponse.js +0 -75
- package/models/components/templateresponse.js.map +0 -1
- package/models/components/triggerreservedvariableresponse.d.ts +0 -69
- package/models/components/triggerreservedvariableresponse.d.ts.map +0 -1
- package/models/components/triggerreservedvariableresponse.js +0 -83
- package/models/components/triggerreservedvariableresponse.js.map +0 -1
- package/models/components/triggertypeenum.d.ts +0 -31
- package/models/components/triggertypeenum.d.ts.map +0 -1
- package/models/components/triggertypeenum.js +0 -52
- package/models/components/triggertypeenum.js.map +0 -1
- package/models/components/updatesubscriberglobalpreferencesrequestdto.d.ts +0 -38
- package/models/components/updatesubscriberglobalpreferencesrequestdto.d.ts.map +0 -1
- package/models/components/updatesubscriberglobalpreferencesrequestdto.js +0 -62
- package/models/components/updatesubscriberglobalpreferencesrequestdto.js.map +0 -1
- package/models/components/updatesubscriberpreferenceglobalresponsedto.d.ts +0 -33
- package/models/components/updatesubscriberpreferenceglobalresponsedto.d.ts.map +0 -1
- package/models/components/updatesubscriberpreferenceglobalresponsedto.js +0 -60
- package/models/components/updatesubscriberpreferenceglobalresponsedto.js.map +0 -1
- package/models/components/updatesubscriberpreferencerequestdto.d.ts +0 -38
- package/models/components/updatesubscriberpreferencerequestdto.d.ts.map +0 -1
- package/models/components/updatesubscriberpreferencerequestdto.js +0 -62
- package/models/components/updatesubscriberpreferencerequestdto.js.map +0 -1
- package/models/components/updatesubscriberpreferenceresponsedto.d.ts +0 -39
- package/models/components/updatesubscriberpreferenceresponsedto.d.ts.map +0 -1
- package/models/components/updatesubscriberpreferenceresponsedto.js +0 -63
- package/models/components/updatesubscriberpreferenceresponsedto.js.map +0 -1
- package/models/components/updatesubscriberrequestdto.d.ts +0 -72
- package/models/components/updatesubscriberrequestdto.d.ts.map +0 -1
- package/models/components/updatesubscriberrequestdto.js +0 -74
- package/models/components/updatesubscriberrequestdto.js.map +0 -1
- package/models/operations/subscribersv1controllercreatesubscriber.d.ts +0 -66
- package/models/operations/subscribersv1controllercreatesubscriber.d.ts.map +0 -1
- package/models/operations/subscribersv1controllercreatesubscriber.js +0 -112
- package/models/operations/subscribersv1controllercreatesubscriber.js.map +0 -1
- package/models/operations/subscribersv1controllergetsubscriber.d.ts +0 -71
- package/models/operations/subscribersv1controllergetsubscriber.d.ts.map +0 -1
- package/models/operations/subscribersv1controllergetsubscriber.js +0 -112
- package/models/operations/subscribersv1controllergetsubscriber.js.map +0 -1
- package/models/operations/subscribersv1controllergetsubscriberpreferencebylevel.d.ts +0 -108
- package/models/operations/subscribersv1controllergetsubscriberpreferencebylevel.d.ts.map +0 -1
- package/models/operations/subscribersv1controllergetsubscriberpreferencebylevel.js +0 -141
- package/models/operations/subscribersv1controllergetsubscriberpreferencebylevel.js.map +0 -1
- package/models/operations/subscribersv1controllerlistsubscriberpreferences.d.ts +0 -71
- package/models/operations/subscribersv1controllerlistsubscriberpreferences.d.ts.map +0 -1
- package/models/operations/subscribersv1controllerlistsubscriberpreferences.js +0 -116
- package/models/operations/subscribersv1controllerlistsubscriberpreferences.js.map +0 -1
- package/models/operations/subscribersv1controllerremovesubscriber.d.ts +0 -66
- package/models/operations/subscribersv1controllerremovesubscriber.d.ts.map +0 -1
- package/models/operations/subscribersv1controllerremovesubscriber.js +0 -110
- package/models/operations/subscribersv1controllerremovesubscriber.js.map +0 -1
- package/models/operations/subscribersv1controllerupdatesubscriber.d.ts +0 -68
- package/models/operations/subscribersv1controllerupdatesubscriber.d.ts.map +0 -1
- package/models/operations/subscribersv1controllerupdatesubscriber.js +0 -114
- package/models/operations/subscribersv1controllerupdatesubscriber.js.map +0 -1
- package/models/operations/subscribersv1controllerupdatesubscriberglobalpreferences.d.ts +0 -68
- package/models/operations/subscribersv1controllerupdatesubscriberglobalpreferences.d.ts.map +0 -1
- package/models/operations/subscribersv1controllerupdatesubscriberglobalpreferences.js +0 -118
- package/models/operations/subscribersv1controllerupdatesubscriberglobalpreferences.js.map +0 -1
- package/models/operations/subscribersv1controllerupdatesubscriberpreference.d.ts +0 -70
- package/models/operations/subscribersv1controllerupdatesubscriberpreference.d.ts.map +0 -1
- package/models/operations/subscribersv1controllerupdatesubscriberpreference.js +0 -120
- package/models/operations/subscribersv1controllerupdatesubscriberpreference.js.map +0 -1
- package/sdk/legacy.d.ts +0 -10
- package/sdk/legacy.d.ts.map +0 -1
- package/sdk/legacy.js +0 -19
- package/sdk/legacy.js.map +0 -1
- package/src/funcs/subscribersDeleteLegacy.ts +0 -200
- package/src/funcs/subscribersPreferencesLegacyUpdateGlobal.ts +0 -211
- package/src/funcs/subscribersPreferencesListLegacy.ts +0 -209
- package/src/funcs/subscribersPreferencesRetrieveByLevelLegacy.ts +0 -205
- package/src/funcs/subscribersPreferencesUpdateLegacy.ts +0 -202
- package/src/funcs/subscribersRetrieveLegacy.ts +0 -205
- package/src/funcs/subscribersUpdateLegacy.ts +0 -204
- package/src/models/components/channelpreference.ts +0 -81
- package/src/models/components/deletesubscriberresponsedto.ts +0 -114
- package/src/models/components/getsubscriberpreferencesresponsedto.ts +0 -93
- package/src/models/components/notificationtriggerresponse.ts +0 -126
- package/src/models/components/notificationtriggervariableresponse.ts +0 -193
- package/src/models/components/preference.ts +0 -78
- package/src/models/components/templateresponse.ts +0 -105
- package/src/models/components/triggerreservedvariableresponse.ts +0 -116
- package/src/models/components/triggertypeenum.ts +0 -38
- package/src/models/components/updatesubscriberglobalpreferencesrequestdto.ts +0 -95
- package/src/models/components/updatesubscriberpreferenceglobalresponsedto.ts +0 -88
- package/src/models/components/updatesubscriberpreferencerequestdto.ts +0 -87
- package/src/models/components/updatesubscriberpreferenceresponsedto.ts +0 -93
- package/src/models/components/updatesubscriberrequestdto.ts +0 -124
- package/src/models/operations/subscribersv1controllercreatesubscriber.ts +0 -187
- package/src/models/operations/subscribersv1controllergetsubscriber.ts +0 -188
- package/src/models/operations/subscribersv1controllergetsubscriberpreferencebylevel.ts +0 -231
- package/src/models/operations/subscribersv1controllerlistsubscriberpreferences.ts +0 -191
- package/src/models/operations/subscribersv1controllerremovesubscriber.ts +0 -183
- package/src/models/operations/subscribersv1controllerupdatesubscriber.ts +0 -191
- package/src/models/operations/subscribersv1controllerupdatesubscriberglobalpreferences.ts +0 -195
- package/src/models/operations/subscribersv1controllerupdatesubscriberpreference.ts +0 -197
- package/src/sdk/legacy.ts +0 -32
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { NovuCore } from "../core.js";
|
|
6
|
-
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
7
|
-
import * as M from "../lib/matchers.js";
|
|
8
|
-
import { compactMap } from "../lib/primitives.js";
|
|
9
|
-
import { safeParse } from "../lib/schemas.js";
|
|
10
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
-
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
-
import { pathToFunc } from "../lib/url.js";
|
|
13
|
-
import {
|
|
14
|
-
ConnectionError,
|
|
15
|
-
InvalidRequestError,
|
|
16
|
-
RequestAbortedError,
|
|
17
|
-
RequestTimeoutError,
|
|
18
|
-
UnexpectedClientError,
|
|
19
|
-
} from "../models/errors/httpclienterrors.js";
|
|
20
|
-
import * as errors from "../models/errors/index.js";
|
|
21
|
-
import { SDKError } from "../models/errors/sdkerror.js";
|
|
22
|
-
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
23
|
-
import * as operations from "../models/operations/index.js";
|
|
24
|
-
import { Result } from "../types/fp.js";
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Get subscriber
|
|
28
|
-
*
|
|
29
|
-
* @remarks
|
|
30
|
-
* Get subscriber by your internal id used to identify the subscriber
|
|
31
|
-
*/
|
|
32
|
-
export async function subscribersRetrieveLegacy(
|
|
33
|
-
client: NovuCore,
|
|
34
|
-
subscriberId: string,
|
|
35
|
-
includeTopics?: boolean | undefined,
|
|
36
|
-
idempotencyKey?: string | undefined,
|
|
37
|
-
options?: RequestOptions,
|
|
38
|
-
): Promise<
|
|
39
|
-
Result<
|
|
40
|
-
operations.SubscribersV1ControllerGetSubscriberResponse,
|
|
41
|
-
| errors.ErrorDto
|
|
42
|
-
| errors.ErrorDto
|
|
43
|
-
| errors.ValidationErrorDto
|
|
44
|
-
| errors.ErrorDto
|
|
45
|
-
| SDKError
|
|
46
|
-
| SDKValidationError
|
|
47
|
-
| UnexpectedClientError
|
|
48
|
-
| InvalidRequestError
|
|
49
|
-
| RequestAbortedError
|
|
50
|
-
| RequestTimeoutError
|
|
51
|
-
| ConnectionError
|
|
52
|
-
>
|
|
53
|
-
> {
|
|
54
|
-
const input: operations.SubscribersV1ControllerGetSubscriberRequest = {
|
|
55
|
-
subscriberId: subscriberId,
|
|
56
|
-
includeTopics: includeTopics,
|
|
57
|
-
idempotencyKey: idempotencyKey,
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
const parsed = safeParse(
|
|
61
|
-
input,
|
|
62
|
-
(value) =>
|
|
63
|
-
operations.SubscribersV1ControllerGetSubscriberRequest$outboundSchema
|
|
64
|
-
.parse(value),
|
|
65
|
-
"Input validation failed",
|
|
66
|
-
);
|
|
67
|
-
if (!parsed.ok) {
|
|
68
|
-
return parsed;
|
|
69
|
-
}
|
|
70
|
-
const payload = parsed.value;
|
|
71
|
-
const body = null;
|
|
72
|
-
|
|
73
|
-
const pathParams = {
|
|
74
|
-
subscriberId: encodeSimple("subscriberId", payload.subscriberId, {
|
|
75
|
-
explode: false,
|
|
76
|
-
charEncoding: "percent",
|
|
77
|
-
}),
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
const path = pathToFunc("/v1/subscribers/{subscriberId}")(pathParams);
|
|
81
|
-
|
|
82
|
-
const query = encodeFormQuery({
|
|
83
|
-
"includeTopics": payload.includeTopics,
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
const headers = new Headers(compactMap({
|
|
87
|
-
Accept: "application/json",
|
|
88
|
-
"idempotency-key": encodeSimple(
|
|
89
|
-
"idempotency-key",
|
|
90
|
-
payload["idempotency-key"],
|
|
91
|
-
{ explode: false, charEncoding: "none" },
|
|
92
|
-
),
|
|
93
|
-
}));
|
|
94
|
-
|
|
95
|
-
const secConfig = await extractSecurity(client._options.secretKey);
|
|
96
|
-
const securityInput = secConfig == null ? {} : { secretKey: secConfig };
|
|
97
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
98
|
-
|
|
99
|
-
const context = {
|
|
100
|
-
operationID: "SubscribersV1Controller_getSubscriber",
|
|
101
|
-
oAuth2Scopes: [],
|
|
102
|
-
|
|
103
|
-
resolvedSecurity: requestSecurity,
|
|
104
|
-
|
|
105
|
-
securitySource: client._options.secretKey,
|
|
106
|
-
retryConfig: options?.retries
|
|
107
|
-
|| client._options.retryConfig
|
|
108
|
-
|| {
|
|
109
|
-
strategy: "backoff",
|
|
110
|
-
backoff: {
|
|
111
|
-
initialInterval: 1000,
|
|
112
|
-
maxInterval: 30000,
|
|
113
|
-
exponent: 1.5,
|
|
114
|
-
maxElapsedTime: 3600000,
|
|
115
|
-
},
|
|
116
|
-
retryConnectionErrors: true,
|
|
117
|
-
}
|
|
118
|
-
|| { strategy: "none" },
|
|
119
|
-
retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
const requestRes = client._createRequest(context, {
|
|
123
|
-
security: requestSecurity,
|
|
124
|
-
method: "GET",
|
|
125
|
-
baseURL: options?.serverURL,
|
|
126
|
-
path: path,
|
|
127
|
-
headers: headers,
|
|
128
|
-
query: query,
|
|
129
|
-
body: body,
|
|
130
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
131
|
-
}, options);
|
|
132
|
-
if (!requestRes.ok) {
|
|
133
|
-
return requestRes;
|
|
134
|
-
}
|
|
135
|
-
const req = requestRes.value;
|
|
136
|
-
|
|
137
|
-
const doResult = await client._do(req, {
|
|
138
|
-
context,
|
|
139
|
-
errorCodes: [
|
|
140
|
-
"400",
|
|
141
|
-
"401",
|
|
142
|
-
"403",
|
|
143
|
-
"404",
|
|
144
|
-
"405",
|
|
145
|
-
"409",
|
|
146
|
-
"413",
|
|
147
|
-
"414",
|
|
148
|
-
"415",
|
|
149
|
-
"422",
|
|
150
|
-
"429",
|
|
151
|
-
"4XX",
|
|
152
|
-
"500",
|
|
153
|
-
"503",
|
|
154
|
-
"5XX",
|
|
155
|
-
],
|
|
156
|
-
retryConfig: context.retryConfig,
|
|
157
|
-
retryCodes: context.retryCodes,
|
|
158
|
-
});
|
|
159
|
-
if (!doResult.ok) {
|
|
160
|
-
return doResult;
|
|
161
|
-
}
|
|
162
|
-
const response = doResult.value;
|
|
163
|
-
|
|
164
|
-
const responseFields = {
|
|
165
|
-
HttpMeta: { Response: response, Request: req },
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
const [result] = await M.match<
|
|
169
|
-
operations.SubscribersV1ControllerGetSubscriberResponse,
|
|
170
|
-
| errors.ErrorDto
|
|
171
|
-
| errors.ErrorDto
|
|
172
|
-
| errors.ValidationErrorDto
|
|
173
|
-
| errors.ErrorDto
|
|
174
|
-
| SDKError
|
|
175
|
-
| SDKValidationError
|
|
176
|
-
| UnexpectedClientError
|
|
177
|
-
| InvalidRequestError
|
|
178
|
-
| RequestAbortedError
|
|
179
|
-
| RequestTimeoutError
|
|
180
|
-
| ConnectionError
|
|
181
|
-
>(
|
|
182
|
-
M.json(
|
|
183
|
-
200,
|
|
184
|
-
operations.SubscribersV1ControllerGetSubscriberResponse$inboundSchema,
|
|
185
|
-
{ hdrs: true, key: "Result" },
|
|
186
|
-
),
|
|
187
|
-
M.jsonErr(414, errors.ErrorDto$inboundSchema),
|
|
188
|
-
M.jsonErr(
|
|
189
|
-
[400, 401, 403, 404, 405, 409, 413, 415],
|
|
190
|
-
errors.ErrorDto$inboundSchema,
|
|
191
|
-
{ hdrs: true },
|
|
192
|
-
),
|
|
193
|
-
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
|
|
194
|
-
M.fail(429),
|
|
195
|
-
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
|
|
196
|
-
M.fail(503),
|
|
197
|
-
M.fail("4XX"),
|
|
198
|
-
M.fail("5XX"),
|
|
199
|
-
)(response, { extraFields: responseFields });
|
|
200
|
-
if (!result.ok) {
|
|
201
|
-
return result;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
return result;
|
|
205
|
-
}
|
|
@@ -1,204 +0,0 @@
|
|
|
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 * as M from "../lib/matchers.js";
|
|
8
|
-
import { compactMap } from "../lib/primitives.js";
|
|
9
|
-
import { safeParse } from "../lib/schemas.js";
|
|
10
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
-
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
-
import { pathToFunc } from "../lib/url.js";
|
|
13
|
-
import * as components from "../models/components/index.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 { SDKError } from "../models/errors/sdkerror.js";
|
|
23
|
-
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
-
import * as operations from "../models/operations/index.js";
|
|
25
|
-
import { Result } from "../types/fp.js";
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Update subscriber
|
|
29
|
-
*
|
|
30
|
-
* @remarks
|
|
31
|
-
* Used to update the subscriber entity with new information
|
|
32
|
-
*/
|
|
33
|
-
export async function subscribersUpdateLegacy(
|
|
34
|
-
client: NovuCore,
|
|
35
|
-
updateSubscriberRequestDto: components.UpdateSubscriberRequestDto,
|
|
36
|
-
subscriberId: string,
|
|
37
|
-
idempotencyKey?: string | undefined,
|
|
38
|
-
options?: RequestOptions,
|
|
39
|
-
): Promise<
|
|
40
|
-
Result<
|
|
41
|
-
operations.SubscribersV1ControllerUpdateSubscriberResponse,
|
|
42
|
-
| errors.ErrorDto
|
|
43
|
-
| errors.ErrorDto
|
|
44
|
-
| errors.ValidationErrorDto
|
|
45
|
-
| errors.ErrorDto
|
|
46
|
-
| SDKError
|
|
47
|
-
| SDKValidationError
|
|
48
|
-
| UnexpectedClientError
|
|
49
|
-
| InvalidRequestError
|
|
50
|
-
| RequestAbortedError
|
|
51
|
-
| RequestTimeoutError
|
|
52
|
-
| ConnectionError
|
|
53
|
-
>
|
|
54
|
-
> {
|
|
55
|
-
const input: operations.SubscribersV1ControllerUpdateSubscriberRequest = {
|
|
56
|
-
updateSubscriberRequestDto: updateSubscriberRequestDto,
|
|
57
|
-
subscriberId: subscriberId,
|
|
58
|
-
idempotencyKey: idempotencyKey,
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
const parsed = safeParse(
|
|
62
|
-
input,
|
|
63
|
-
(value) =>
|
|
64
|
-
operations.SubscribersV1ControllerUpdateSubscriberRequest$outboundSchema
|
|
65
|
-
.parse(value),
|
|
66
|
-
"Input validation failed",
|
|
67
|
-
);
|
|
68
|
-
if (!parsed.ok) {
|
|
69
|
-
return parsed;
|
|
70
|
-
}
|
|
71
|
-
const payload = parsed.value;
|
|
72
|
-
const body = encodeJSON("body", payload.UpdateSubscriberRequestDto, {
|
|
73
|
-
explode: true,
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
const pathParams = {
|
|
77
|
-
subscriberId: encodeSimple("subscriberId", payload.subscriberId, {
|
|
78
|
-
explode: false,
|
|
79
|
-
charEncoding: "percent",
|
|
80
|
-
}),
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
const path = pathToFunc("/v1/subscribers/{subscriberId}")(pathParams);
|
|
84
|
-
|
|
85
|
-
const headers = new Headers(compactMap({
|
|
86
|
-
"Content-Type": "application/json",
|
|
87
|
-
Accept: "application/json",
|
|
88
|
-
"idempotency-key": encodeSimple(
|
|
89
|
-
"idempotency-key",
|
|
90
|
-
payload["idempotency-key"],
|
|
91
|
-
{ explode: false, charEncoding: "none" },
|
|
92
|
-
),
|
|
93
|
-
}));
|
|
94
|
-
|
|
95
|
-
const secConfig = await extractSecurity(client._options.secretKey);
|
|
96
|
-
const securityInput = secConfig == null ? {} : { secretKey: secConfig };
|
|
97
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
98
|
-
|
|
99
|
-
const context = {
|
|
100
|
-
operationID: "SubscribersV1Controller_updateSubscriber",
|
|
101
|
-
oAuth2Scopes: [],
|
|
102
|
-
|
|
103
|
-
resolvedSecurity: requestSecurity,
|
|
104
|
-
|
|
105
|
-
securitySource: client._options.secretKey,
|
|
106
|
-
retryConfig: options?.retries
|
|
107
|
-
|| client._options.retryConfig
|
|
108
|
-
|| {
|
|
109
|
-
strategy: "backoff",
|
|
110
|
-
backoff: {
|
|
111
|
-
initialInterval: 1000,
|
|
112
|
-
maxInterval: 30000,
|
|
113
|
-
exponent: 1.5,
|
|
114
|
-
maxElapsedTime: 3600000,
|
|
115
|
-
},
|
|
116
|
-
retryConnectionErrors: true,
|
|
117
|
-
}
|
|
118
|
-
|| { strategy: "none" },
|
|
119
|
-
retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
const requestRes = client._createRequest(context, {
|
|
123
|
-
security: requestSecurity,
|
|
124
|
-
method: "PUT",
|
|
125
|
-
baseURL: options?.serverURL,
|
|
126
|
-
path: path,
|
|
127
|
-
headers: headers,
|
|
128
|
-
body: body,
|
|
129
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
130
|
-
}, options);
|
|
131
|
-
if (!requestRes.ok) {
|
|
132
|
-
return requestRes;
|
|
133
|
-
}
|
|
134
|
-
const req = requestRes.value;
|
|
135
|
-
|
|
136
|
-
const doResult = await client._do(req, {
|
|
137
|
-
context,
|
|
138
|
-
errorCodes: [
|
|
139
|
-
"400",
|
|
140
|
-
"401",
|
|
141
|
-
"403",
|
|
142
|
-
"404",
|
|
143
|
-
"405",
|
|
144
|
-
"409",
|
|
145
|
-
"413",
|
|
146
|
-
"414",
|
|
147
|
-
"415",
|
|
148
|
-
"422",
|
|
149
|
-
"429",
|
|
150
|
-
"4XX",
|
|
151
|
-
"500",
|
|
152
|
-
"503",
|
|
153
|
-
"5XX",
|
|
154
|
-
],
|
|
155
|
-
retryConfig: context.retryConfig,
|
|
156
|
-
retryCodes: context.retryCodes,
|
|
157
|
-
});
|
|
158
|
-
if (!doResult.ok) {
|
|
159
|
-
return doResult;
|
|
160
|
-
}
|
|
161
|
-
const response = doResult.value;
|
|
162
|
-
|
|
163
|
-
const responseFields = {
|
|
164
|
-
HttpMeta: { Response: response, Request: req },
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
const [result] = await M.match<
|
|
168
|
-
operations.SubscribersV1ControllerUpdateSubscriberResponse,
|
|
169
|
-
| errors.ErrorDto
|
|
170
|
-
| errors.ErrorDto
|
|
171
|
-
| errors.ValidationErrorDto
|
|
172
|
-
| errors.ErrorDto
|
|
173
|
-
| SDKError
|
|
174
|
-
| SDKValidationError
|
|
175
|
-
| UnexpectedClientError
|
|
176
|
-
| InvalidRequestError
|
|
177
|
-
| RequestAbortedError
|
|
178
|
-
| RequestTimeoutError
|
|
179
|
-
| ConnectionError
|
|
180
|
-
>(
|
|
181
|
-
M.json(
|
|
182
|
-
200,
|
|
183
|
-
operations.SubscribersV1ControllerUpdateSubscriberResponse$inboundSchema,
|
|
184
|
-
{ hdrs: true, key: "Result" },
|
|
185
|
-
),
|
|
186
|
-
M.jsonErr(414, errors.ErrorDto$inboundSchema),
|
|
187
|
-
M.jsonErr(
|
|
188
|
-
[400, 401, 403, 404, 405, 409, 413, 415],
|
|
189
|
-
errors.ErrorDto$inboundSchema,
|
|
190
|
-
{ hdrs: true },
|
|
191
|
-
),
|
|
192
|
-
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
|
|
193
|
-
M.fail(429),
|
|
194
|
-
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
|
|
195
|
-
M.fail(503),
|
|
196
|
-
M.fail("4XX"),
|
|
197
|
-
M.fail("5XX"),
|
|
198
|
-
)(response, { extraFields: responseFields });
|
|
199
|
-
if (!result.ok) {
|
|
200
|
-
return result;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
return result;
|
|
204
|
-
}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import * as z from "zod";
|
|
6
|
-
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
-
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
-
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
-
import {
|
|
10
|
-
ChannelTypeEnum,
|
|
11
|
-
ChannelTypeEnum$inboundSchema,
|
|
12
|
-
ChannelTypeEnum$outboundSchema,
|
|
13
|
-
} from "./channeltypeenum.js";
|
|
14
|
-
|
|
15
|
-
export type ChannelPreference = {
|
|
16
|
-
/**
|
|
17
|
-
* Channel type through which the message is sent
|
|
18
|
-
*/
|
|
19
|
-
type: ChannelTypeEnum;
|
|
20
|
-
/**
|
|
21
|
-
* If channel is enabled or not
|
|
22
|
-
*/
|
|
23
|
-
enabled: boolean;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
/** @internal */
|
|
27
|
-
export const ChannelPreference$inboundSchema: z.ZodType<
|
|
28
|
-
ChannelPreference,
|
|
29
|
-
z.ZodTypeDef,
|
|
30
|
-
unknown
|
|
31
|
-
> = z.object({
|
|
32
|
-
type: ChannelTypeEnum$inboundSchema,
|
|
33
|
-
enabled: z.boolean(),
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
/** @internal */
|
|
37
|
-
export type ChannelPreference$Outbound = {
|
|
38
|
-
type: string;
|
|
39
|
-
enabled: boolean;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
/** @internal */
|
|
43
|
-
export const ChannelPreference$outboundSchema: z.ZodType<
|
|
44
|
-
ChannelPreference$Outbound,
|
|
45
|
-
z.ZodTypeDef,
|
|
46
|
-
ChannelPreference
|
|
47
|
-
> = z.object({
|
|
48
|
-
type: ChannelTypeEnum$outboundSchema,
|
|
49
|
-
enabled: z.boolean(),
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* @internal
|
|
54
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
55
|
-
*/
|
|
56
|
-
export namespace ChannelPreference$ {
|
|
57
|
-
/** @deprecated use `ChannelPreference$inboundSchema` instead. */
|
|
58
|
-
export const inboundSchema = ChannelPreference$inboundSchema;
|
|
59
|
-
/** @deprecated use `ChannelPreference$outboundSchema` instead. */
|
|
60
|
-
export const outboundSchema = ChannelPreference$outboundSchema;
|
|
61
|
-
/** @deprecated use `ChannelPreference$Outbound` instead. */
|
|
62
|
-
export type Outbound = ChannelPreference$Outbound;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export function channelPreferenceToJSON(
|
|
66
|
-
channelPreference: ChannelPreference,
|
|
67
|
-
): string {
|
|
68
|
-
return JSON.stringify(
|
|
69
|
-
ChannelPreference$outboundSchema.parse(channelPreference),
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export function channelPreferenceFromJSON(
|
|
74
|
-
jsonString: string,
|
|
75
|
-
): SafeParseResult<ChannelPreference, SDKValidationError> {
|
|
76
|
-
return safeParse(
|
|
77
|
-
jsonString,
|
|
78
|
-
(x) => ChannelPreference$inboundSchema.parse(JSON.parse(x)),
|
|
79
|
-
`Failed to parse 'ChannelPreference' from JSON`,
|
|
80
|
-
);
|
|
81
|
-
}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import * as z from "zod";
|
|
6
|
-
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
-
import { ClosedEnum } from "../../types/enums.js";
|
|
8
|
-
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
-
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* The status enum for the performed action
|
|
13
|
-
*/
|
|
14
|
-
export const DeleteSubscriberResponseDtoStatus = {
|
|
15
|
-
Deleted: "deleted",
|
|
16
|
-
} as const;
|
|
17
|
-
/**
|
|
18
|
-
* The status enum for the performed action
|
|
19
|
-
*/
|
|
20
|
-
export type DeleteSubscriberResponseDtoStatus = ClosedEnum<
|
|
21
|
-
typeof DeleteSubscriberResponseDtoStatus
|
|
22
|
-
>;
|
|
23
|
-
|
|
24
|
-
export type DeleteSubscriberResponseDto = {
|
|
25
|
-
/**
|
|
26
|
-
* A boolean stating the success of the action
|
|
27
|
-
*/
|
|
28
|
-
acknowledged: boolean;
|
|
29
|
-
/**
|
|
30
|
-
* The status enum for the performed action
|
|
31
|
-
*/
|
|
32
|
-
status: DeleteSubscriberResponseDtoStatus;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
/** @internal */
|
|
36
|
-
export const DeleteSubscriberResponseDtoStatus$inboundSchema: z.ZodNativeEnum<
|
|
37
|
-
typeof DeleteSubscriberResponseDtoStatus
|
|
38
|
-
> = z.nativeEnum(DeleteSubscriberResponseDtoStatus);
|
|
39
|
-
|
|
40
|
-
/** @internal */
|
|
41
|
-
export const DeleteSubscriberResponseDtoStatus$outboundSchema: z.ZodNativeEnum<
|
|
42
|
-
typeof DeleteSubscriberResponseDtoStatus
|
|
43
|
-
> = DeleteSubscriberResponseDtoStatus$inboundSchema;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* @internal
|
|
47
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
48
|
-
*/
|
|
49
|
-
export namespace DeleteSubscriberResponseDtoStatus$ {
|
|
50
|
-
/** @deprecated use `DeleteSubscriberResponseDtoStatus$inboundSchema` instead. */
|
|
51
|
-
export const inboundSchema = DeleteSubscriberResponseDtoStatus$inboundSchema;
|
|
52
|
-
/** @deprecated use `DeleteSubscriberResponseDtoStatus$outboundSchema` instead. */
|
|
53
|
-
export const outboundSchema =
|
|
54
|
-
DeleteSubscriberResponseDtoStatus$outboundSchema;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/** @internal */
|
|
58
|
-
export const DeleteSubscriberResponseDto$inboundSchema: z.ZodType<
|
|
59
|
-
DeleteSubscriberResponseDto,
|
|
60
|
-
z.ZodTypeDef,
|
|
61
|
-
unknown
|
|
62
|
-
> = z.object({
|
|
63
|
-
acknowledged: z.boolean(),
|
|
64
|
-
status: DeleteSubscriberResponseDtoStatus$inboundSchema,
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
/** @internal */
|
|
68
|
-
export type DeleteSubscriberResponseDto$Outbound = {
|
|
69
|
-
acknowledged: boolean;
|
|
70
|
-
status: string;
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
/** @internal */
|
|
74
|
-
export const DeleteSubscriberResponseDto$outboundSchema: z.ZodType<
|
|
75
|
-
DeleteSubscriberResponseDto$Outbound,
|
|
76
|
-
z.ZodTypeDef,
|
|
77
|
-
DeleteSubscriberResponseDto
|
|
78
|
-
> = z.object({
|
|
79
|
-
acknowledged: z.boolean(),
|
|
80
|
-
status: DeleteSubscriberResponseDtoStatus$outboundSchema,
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* @internal
|
|
85
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
86
|
-
*/
|
|
87
|
-
export namespace DeleteSubscriberResponseDto$ {
|
|
88
|
-
/** @deprecated use `DeleteSubscriberResponseDto$inboundSchema` instead. */
|
|
89
|
-
export const inboundSchema = DeleteSubscriberResponseDto$inboundSchema;
|
|
90
|
-
/** @deprecated use `DeleteSubscriberResponseDto$outboundSchema` instead. */
|
|
91
|
-
export const outboundSchema = DeleteSubscriberResponseDto$outboundSchema;
|
|
92
|
-
/** @deprecated use `DeleteSubscriberResponseDto$Outbound` instead. */
|
|
93
|
-
export type Outbound = DeleteSubscriberResponseDto$Outbound;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export function deleteSubscriberResponseDtoToJSON(
|
|
97
|
-
deleteSubscriberResponseDto: DeleteSubscriberResponseDto,
|
|
98
|
-
): string {
|
|
99
|
-
return JSON.stringify(
|
|
100
|
-
DeleteSubscriberResponseDto$outboundSchema.parse(
|
|
101
|
-
deleteSubscriberResponseDto,
|
|
102
|
-
),
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
export function deleteSubscriberResponseDtoFromJSON(
|
|
107
|
-
jsonString: string,
|
|
108
|
-
): SafeParseResult<DeleteSubscriberResponseDto, SDKValidationError> {
|
|
109
|
-
return safeParse(
|
|
110
|
-
jsonString,
|
|
111
|
-
(x) => DeleteSubscriberResponseDto$inboundSchema.parse(JSON.parse(x)),
|
|
112
|
-
`Failed to parse 'DeleteSubscriberResponseDto' from JSON`,
|
|
113
|
-
);
|
|
114
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import * as z from "zod";
|
|
6
|
-
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
-
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
-
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
-
import {
|
|
10
|
-
Preference,
|
|
11
|
-
Preference$inboundSchema,
|
|
12
|
-
Preference$Outbound,
|
|
13
|
-
Preference$outboundSchema,
|
|
14
|
-
} from "./preference.js";
|
|
15
|
-
import {
|
|
16
|
-
TemplateResponse,
|
|
17
|
-
TemplateResponse$inboundSchema,
|
|
18
|
-
TemplateResponse$Outbound,
|
|
19
|
-
TemplateResponse$outboundSchema,
|
|
20
|
-
} from "./templateresponse.js";
|
|
21
|
-
|
|
22
|
-
export type GetSubscriberPreferencesResponseDto = {
|
|
23
|
-
/**
|
|
24
|
-
* The workflow information and if it is critical or not
|
|
25
|
-
*/
|
|
26
|
-
template?: TemplateResponse | undefined;
|
|
27
|
-
/**
|
|
28
|
-
* The preferences of the subscriber regarding the related workflow
|
|
29
|
-
*/
|
|
30
|
-
preference: Preference;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
/** @internal */
|
|
34
|
-
export const GetSubscriberPreferencesResponseDto$inboundSchema: z.ZodType<
|
|
35
|
-
GetSubscriberPreferencesResponseDto,
|
|
36
|
-
z.ZodTypeDef,
|
|
37
|
-
unknown
|
|
38
|
-
> = z.object({
|
|
39
|
-
template: TemplateResponse$inboundSchema.optional(),
|
|
40
|
-
preference: Preference$inboundSchema,
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
/** @internal */
|
|
44
|
-
export type GetSubscriberPreferencesResponseDto$Outbound = {
|
|
45
|
-
template?: TemplateResponse$Outbound | undefined;
|
|
46
|
-
preference: Preference$Outbound;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
/** @internal */
|
|
50
|
-
export const GetSubscriberPreferencesResponseDto$outboundSchema: z.ZodType<
|
|
51
|
-
GetSubscriberPreferencesResponseDto$Outbound,
|
|
52
|
-
z.ZodTypeDef,
|
|
53
|
-
GetSubscriberPreferencesResponseDto
|
|
54
|
-
> = z.object({
|
|
55
|
-
template: TemplateResponse$outboundSchema.optional(),
|
|
56
|
-
preference: Preference$outboundSchema,
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* @internal
|
|
61
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
62
|
-
*/
|
|
63
|
-
export namespace GetSubscriberPreferencesResponseDto$ {
|
|
64
|
-
/** @deprecated use `GetSubscriberPreferencesResponseDto$inboundSchema` instead. */
|
|
65
|
-
export const inboundSchema =
|
|
66
|
-
GetSubscriberPreferencesResponseDto$inboundSchema;
|
|
67
|
-
/** @deprecated use `GetSubscriberPreferencesResponseDto$outboundSchema` instead. */
|
|
68
|
-
export const outboundSchema =
|
|
69
|
-
GetSubscriberPreferencesResponseDto$outboundSchema;
|
|
70
|
-
/** @deprecated use `GetSubscriberPreferencesResponseDto$Outbound` instead. */
|
|
71
|
-
export type Outbound = GetSubscriberPreferencesResponseDto$Outbound;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export function getSubscriberPreferencesResponseDtoToJSON(
|
|
75
|
-
getSubscriberPreferencesResponseDto: GetSubscriberPreferencesResponseDto,
|
|
76
|
-
): string {
|
|
77
|
-
return JSON.stringify(
|
|
78
|
-
GetSubscriberPreferencesResponseDto$outboundSchema.parse(
|
|
79
|
-
getSubscriberPreferencesResponseDto,
|
|
80
|
-
),
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export function getSubscriberPreferencesResponseDtoFromJSON(
|
|
85
|
-
jsonString: string,
|
|
86
|
-
): SafeParseResult<GetSubscriberPreferencesResponseDto, SDKValidationError> {
|
|
87
|
-
return safeParse(
|
|
88
|
-
jsonString,
|
|
89
|
-
(x) =>
|
|
90
|
-
GetSubscriberPreferencesResponseDto$inboundSchema.parse(JSON.parse(x)),
|
|
91
|
-
`Failed to parse 'GetSubscriberPreferencesResponseDto' from JSON`,
|
|
92
|
-
);
|
|
93
|
-
}
|