@novu/api 0.6.0 → 0.6.2
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 +29 -4
- package/bin/mcp-server.js +328 -91
- package/bin/mcp-server.js.map +15 -11
- package/docs/sdks/subscribers/README.md +113 -0
- package/funcs/subscribersSearch.js +1 -0
- package/funcs/subscribersSearch.js.map +1 -1
- package/funcs/subscribersUpsert.d.ts +18 -0
- package/funcs/subscribersUpsert.d.ts.map +1 -0
- package/funcs/subscribersUpsert.js +148 -0
- package/funcs/subscribersUpsert.js.map +1 -0
- package/hooks/types.d.ts +1 -1
- package/hooks/types.d.ts.map +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.d.ts.map +1 -1
- package/mcp-server/server.js +3 -1
- package/mcp-server/server.js.map +1 -1
- package/mcp-server/tools/subscribersUpsert.d.ts +11 -0
- package/mcp-server/tools/subscribersUpsert.d.ts.map +1 -0
- package/mcp-server/tools/subscribersUpsert.js +57 -0
- package/mcp-server/tools/subscribersUpsert.js.map +1 -0
- 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/updatesubscriberrequestdto.d.ts +72 -0
- package/models/components/updatesubscriberrequestdto.d.ts.map +1 -0
- package/models/components/updatesubscriberrequestdto.js +74 -0
- package/models/components/updatesubscriberrequestdto.js.map +1 -0
- package/models/components/workflowinfodto.d.ts +5 -0
- package/models/components/workflowinfodto.d.ts.map +1 -1
- package/models/components/workflowinfodto.js +2 -0
- package/models/components/workflowinfodto.js.map +1 -1
- package/models/operations/index.d.ts +1 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +1 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/subscriberscontrollersearchsubscribers.d.ts +26 -6
- package/models/operations/subscriberscontrollersearchsubscribers.d.ts.map +1 -1
- package/models/operations/subscriberscontrollersearchsubscribers.js +11 -6
- package/models/operations/subscriberscontrollersearchsubscribers.js.map +1 -1
- package/models/operations/subscribersv1controllerupdatesubscriber.d.ts +68 -0
- package/models/operations/subscribersv1controllerupdatesubscriber.d.ts.map +1 -0
- package/models/operations/subscribersv1controllerupdatesubscriber.js +114 -0
- package/models/operations/subscribersv1controllerupdatesubscriber.js.map +1 -0
- package/package.json +2 -2
- package/sdk/subscribers.d.ts +7 -0
- package/sdk/subscribers.d.ts.map +1 -1
- package/sdk/subscribers.js +10 -0
- package/sdk/subscribers.js.map +1 -1
- package/sources/json-development.json +687 -117
- package/src/funcs/subscribersSearch.ts +1 -0
- package/src/funcs/subscribersUpsert.ts +240 -0
- package/src/hooks/types.ts +1 -1
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +3 -1
- package/src/mcp-server/tools/subscribersUpsert.ts +43 -0
- package/src/models/components/index.ts +1 -0
- package/src/models/components/updatesubscriberrequestdto.ts +124 -0
- package/src/models/components/workflowinfodto.ts +7 -0
- package/src/models/operations/index.ts +1 -0
- package/src/models/operations/subscriberscontrollersearchsubscribers.ts +34 -12
- package/src/models/operations/subscribersv1controllerupdatesubscriber.ts +191 -0
- package/src/sdk/subscribers.ts +22 -0
|
@@ -0,0 +1,240 @@
|
|
|
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 { APICall, APIPromise } from "../types/async.js";
|
|
26
|
+
import { Result } from "../types/fp.js";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Upsert subscriber
|
|
30
|
+
*
|
|
31
|
+
* @remarks
|
|
32
|
+
* Used to upsert the subscriber entity with new information
|
|
33
|
+
*/
|
|
34
|
+
export function subscribersUpsert(
|
|
35
|
+
client: NovuCore,
|
|
36
|
+
updateSubscriberRequestDto: components.UpdateSubscriberRequestDto,
|
|
37
|
+
subscriberId: string,
|
|
38
|
+
idempotencyKey?: string | undefined,
|
|
39
|
+
options?: RequestOptions,
|
|
40
|
+
): APIPromise<
|
|
41
|
+
Result<
|
|
42
|
+
operations.SubscribersV1ControllerUpdateSubscriberResponse,
|
|
43
|
+
| errors.ErrorDto
|
|
44
|
+
| errors.ErrorDto
|
|
45
|
+
| errors.ValidationErrorDto
|
|
46
|
+
| errors.ErrorDto
|
|
47
|
+
| SDKError
|
|
48
|
+
| SDKValidationError
|
|
49
|
+
| UnexpectedClientError
|
|
50
|
+
| InvalidRequestError
|
|
51
|
+
| RequestAbortedError
|
|
52
|
+
| RequestTimeoutError
|
|
53
|
+
| ConnectionError
|
|
54
|
+
>
|
|
55
|
+
> {
|
|
56
|
+
return new APIPromise($do(
|
|
57
|
+
client,
|
|
58
|
+
updateSubscriberRequestDto,
|
|
59
|
+
subscriberId,
|
|
60
|
+
idempotencyKey,
|
|
61
|
+
options,
|
|
62
|
+
));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
async function $do(
|
|
66
|
+
client: NovuCore,
|
|
67
|
+
updateSubscriberRequestDto: components.UpdateSubscriberRequestDto,
|
|
68
|
+
subscriberId: string,
|
|
69
|
+
idempotencyKey?: string | undefined,
|
|
70
|
+
options?: RequestOptions,
|
|
71
|
+
): Promise<
|
|
72
|
+
[
|
|
73
|
+
Result<
|
|
74
|
+
operations.SubscribersV1ControllerUpdateSubscriberResponse,
|
|
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
|
+
]
|
|
89
|
+
> {
|
|
90
|
+
const input: operations.SubscribersV1ControllerUpdateSubscriberRequest = {
|
|
91
|
+
updateSubscriberRequestDto: updateSubscriberRequestDto,
|
|
92
|
+
subscriberId: subscriberId,
|
|
93
|
+
idempotencyKey: idempotencyKey,
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const parsed = safeParse(
|
|
97
|
+
input,
|
|
98
|
+
(value) =>
|
|
99
|
+
operations.SubscribersV1ControllerUpdateSubscriberRequest$outboundSchema
|
|
100
|
+
.parse(value),
|
|
101
|
+
"Input validation failed",
|
|
102
|
+
);
|
|
103
|
+
if (!parsed.ok) {
|
|
104
|
+
return [parsed, { status: "invalid" }];
|
|
105
|
+
}
|
|
106
|
+
const payload = parsed.value;
|
|
107
|
+
const body = encodeJSON("body", payload.UpdateSubscriberRequestDto, {
|
|
108
|
+
explode: true,
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
const pathParams = {
|
|
112
|
+
subscriberId: encodeSimple("subscriberId", payload.subscriberId, {
|
|
113
|
+
explode: false,
|
|
114
|
+
charEncoding: "percent",
|
|
115
|
+
}),
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
const path = pathToFunc("/v1/subscribers/{subscriberId}")(pathParams);
|
|
119
|
+
|
|
120
|
+
const headers = new Headers(compactMap({
|
|
121
|
+
"Content-Type": "application/json",
|
|
122
|
+
Accept: "application/json",
|
|
123
|
+
"idempotency-key": encodeSimple(
|
|
124
|
+
"idempotency-key",
|
|
125
|
+
payload["idempotency-key"],
|
|
126
|
+
{ explode: false, charEncoding: "none" },
|
|
127
|
+
),
|
|
128
|
+
}));
|
|
129
|
+
|
|
130
|
+
const secConfig = await extractSecurity(client._options.secretKey);
|
|
131
|
+
const securityInput = secConfig == null ? {} : { secretKey: secConfig };
|
|
132
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
133
|
+
|
|
134
|
+
const context = {
|
|
135
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
136
|
+
operationID: "SubscribersV1Controller_updateSubscriber",
|
|
137
|
+
oAuth2Scopes: [],
|
|
138
|
+
|
|
139
|
+
resolvedSecurity: requestSecurity,
|
|
140
|
+
|
|
141
|
+
securitySource: client._options.secretKey,
|
|
142
|
+
retryConfig: options?.retries
|
|
143
|
+
|| client._options.retryConfig
|
|
144
|
+
|| {
|
|
145
|
+
strategy: "backoff",
|
|
146
|
+
backoff: {
|
|
147
|
+
initialInterval: 1000,
|
|
148
|
+
maxInterval: 30000,
|
|
149
|
+
exponent: 1.5,
|
|
150
|
+
maxElapsedTime: 3600000,
|
|
151
|
+
},
|
|
152
|
+
retryConnectionErrors: true,
|
|
153
|
+
}
|
|
154
|
+
|| { strategy: "none" },
|
|
155
|
+
retryCodes: options?.retryCodes || ["408", "409", "429", "5XX"],
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
const requestRes = client._createRequest(context, {
|
|
159
|
+
security: requestSecurity,
|
|
160
|
+
method: "PUT",
|
|
161
|
+
baseURL: options?.serverURL,
|
|
162
|
+
path: path,
|
|
163
|
+
headers: headers,
|
|
164
|
+
body: body,
|
|
165
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
166
|
+
}, options);
|
|
167
|
+
if (!requestRes.ok) {
|
|
168
|
+
return [requestRes, { status: "invalid" }];
|
|
169
|
+
}
|
|
170
|
+
const req = requestRes.value;
|
|
171
|
+
|
|
172
|
+
const doResult = await client._do(req, {
|
|
173
|
+
context,
|
|
174
|
+
errorCodes: [
|
|
175
|
+
"400",
|
|
176
|
+
"401",
|
|
177
|
+
"403",
|
|
178
|
+
"404",
|
|
179
|
+
"405",
|
|
180
|
+
"409",
|
|
181
|
+
"413",
|
|
182
|
+
"414",
|
|
183
|
+
"415",
|
|
184
|
+
"422",
|
|
185
|
+
"429",
|
|
186
|
+
"4XX",
|
|
187
|
+
"500",
|
|
188
|
+
"503",
|
|
189
|
+
"5XX",
|
|
190
|
+
],
|
|
191
|
+
retryConfig: context.retryConfig,
|
|
192
|
+
retryCodes: context.retryCodes,
|
|
193
|
+
});
|
|
194
|
+
if (!doResult.ok) {
|
|
195
|
+
return [doResult, { status: "request-error", request: req }];
|
|
196
|
+
}
|
|
197
|
+
const response = doResult.value;
|
|
198
|
+
|
|
199
|
+
const responseFields = {
|
|
200
|
+
HttpMeta: { Response: response, Request: req },
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
const [result] = await M.match<
|
|
204
|
+
operations.SubscribersV1ControllerUpdateSubscriberResponse,
|
|
205
|
+
| errors.ErrorDto
|
|
206
|
+
| errors.ErrorDto
|
|
207
|
+
| errors.ValidationErrorDto
|
|
208
|
+
| errors.ErrorDto
|
|
209
|
+
| SDKError
|
|
210
|
+
| SDKValidationError
|
|
211
|
+
| UnexpectedClientError
|
|
212
|
+
| InvalidRequestError
|
|
213
|
+
| RequestAbortedError
|
|
214
|
+
| RequestTimeoutError
|
|
215
|
+
| ConnectionError
|
|
216
|
+
>(
|
|
217
|
+
M.json(
|
|
218
|
+
200,
|
|
219
|
+
operations.SubscribersV1ControllerUpdateSubscriberResponse$inboundSchema,
|
|
220
|
+
{ hdrs: true, key: "Result" },
|
|
221
|
+
),
|
|
222
|
+
M.jsonErr(414, errors.ErrorDto$inboundSchema),
|
|
223
|
+
M.jsonErr(
|
|
224
|
+
[400, 401, 403, 404, 405, 409, 413, 415],
|
|
225
|
+
errors.ErrorDto$inboundSchema,
|
|
226
|
+
{ hdrs: true },
|
|
227
|
+
),
|
|
228
|
+
M.jsonErr(422, errors.ValidationErrorDto$inboundSchema, { hdrs: true }),
|
|
229
|
+
M.fail(429),
|
|
230
|
+
M.jsonErr(500, errors.ErrorDto$inboundSchema, { hdrs: true }),
|
|
231
|
+
M.fail(503),
|
|
232
|
+
M.fail("4XX"),
|
|
233
|
+
M.fail("5XX"),
|
|
234
|
+
)(response, { extraFields: responseFields });
|
|
235
|
+
if (!result.ok) {
|
|
236
|
+
return [result, { status: "complete", request: req, response }];
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
return [result, { status: "complete", request: req, response }];
|
|
240
|
+
}
|
package/src/hooks/types.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { SecurityState } from "../lib/security.js";
|
|
|
9
9
|
export type HookContext = {
|
|
10
10
|
baseURL: string | URL;
|
|
11
11
|
operationID: string;
|
|
12
|
-
oAuth2Scopes
|
|
12
|
+
oAuth2Scopes: string[] | null;
|
|
13
13
|
securitySource?: any | (() => Promise<any>);
|
|
14
14
|
retryConfig: RetryConfig;
|
|
15
15
|
resolvedSecurity: SecurityState | null;
|
package/src/lib/config.ts
CHANGED
|
@@ -55,7 +55,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
55
55
|
export const SDK_METADATA = {
|
|
56
56
|
language: "typescript",
|
|
57
57
|
openapiDocVersion: "1.0",
|
|
58
|
-
sdkVersion: "0.6.
|
|
59
|
-
genVersion: "2.
|
|
60
|
-
userAgent: "speakeasy-sdk/typescript 0.6.
|
|
58
|
+
sdkVersion: "0.6.2",
|
|
59
|
+
genVersion: "2.563.1",
|
|
60
|
+
userAgent: "speakeasy-sdk/typescript 0.6.2 2.563.1 1.0 @novu/api",
|
|
61
61
|
} as const;
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -48,6 +48,7 @@ import { tool$subscribersPreferencesUpdate } from "./tools/subscribersPreference
|
|
|
48
48
|
import { tool$subscribersPropertiesUpdateOnlineFlag } from "./tools/subscribersPropertiesUpdateOnlineFlag.js";
|
|
49
49
|
import { tool$subscribersRetrieve } from "./tools/subscribersRetrieve.js";
|
|
50
50
|
import { tool$subscribersSearch } from "./tools/subscribersSearch.js";
|
|
51
|
+
import { tool$subscribersUpsert } from "./tools/subscribersUpsert.js";
|
|
51
52
|
import { tool$topicsCreate } from "./tools/topicsCreate.js";
|
|
52
53
|
import { tool$topicsDelete } from "./tools/topicsDelete.js";
|
|
53
54
|
import { tool$topicsList } from "./tools/topicsList.js";
|
|
@@ -70,7 +71,7 @@ export function createMCPServer(deps: {
|
|
|
70
71
|
}) {
|
|
71
72
|
const server = new McpServer({
|
|
72
73
|
name: "Novu",
|
|
73
|
-
version: "0.6.
|
|
74
|
+
version: "0.6.2",
|
|
74
75
|
});
|
|
75
76
|
|
|
76
77
|
const client = new NovuCore({
|
|
@@ -110,6 +111,7 @@ export function createMCPServer(deps: {
|
|
|
110
111
|
tool(tool$subscribersPatch);
|
|
111
112
|
tool(tool$subscribersDelete);
|
|
112
113
|
tool(tool$subscribersList);
|
|
114
|
+
tool(tool$subscribersUpsert);
|
|
113
115
|
tool(tool$subscribersCreateBulk);
|
|
114
116
|
tool(tool$integrationsList);
|
|
115
117
|
tool(tool$integrationsCreate);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { subscribersUpsert } from "../../funcs/subscribersUpsert.js";
|
|
7
|
+
import * as components from "../../models/components/index.js";
|
|
8
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
9
|
+
|
|
10
|
+
const args = {
|
|
11
|
+
updateSubscriberRequestDto:
|
|
12
|
+
components.UpdateSubscriberRequestDto$inboundSchema,
|
|
13
|
+
subscriberId: z.string(),
|
|
14
|
+
idempotencyKey: z.string().optional(),
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const tool$subscribersUpsert: ToolDefinition<typeof args> = {
|
|
18
|
+
name: "subscribers-upsert",
|
|
19
|
+
description: `Upsert subscriber
|
|
20
|
+
|
|
21
|
+
Used to upsert the subscriber entity with new information`,
|
|
22
|
+
args,
|
|
23
|
+
tool: async (client, args, ctx) => {
|
|
24
|
+
const [result, apiCall] = await subscribersUpsert(
|
|
25
|
+
client,
|
|
26
|
+
args.updateSubscriberRequestDto,
|
|
27
|
+
args.subscriberId,
|
|
28
|
+
args.idempotencyKey,
|
|
29
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
30
|
+
).$inspect();
|
|
31
|
+
|
|
32
|
+
if (!result.ok) {
|
|
33
|
+
return {
|
|
34
|
+
content: [{ type: "text", text: result.error.message }],
|
|
35
|
+
isError: true,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const value = result.value.result;
|
|
40
|
+
|
|
41
|
+
return formatResult(value, apiCall);
|
|
42
|
+
},
|
|
43
|
+
};
|
|
@@ -111,6 +111,7 @@ export * from "./updatedsubscriberdto.js";
|
|
|
111
111
|
export * from "./updateintegrationrequestdto.js";
|
|
112
112
|
export * from "./updatesubscriberchannelrequestdto.js";
|
|
113
113
|
export * from "./updatesubscriberonlineflagrequestdto.js";
|
|
114
|
+
export * from "./updatesubscriberrequestdto.js";
|
|
114
115
|
export * from "./workflowinfodto.js";
|
|
115
116
|
export * from "./workfloworiginenum.js";
|
|
116
117
|
export * from "./workflowpreferencedto.js";
|
|
@@ -0,0 +1,124 @@
|
|
|
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
|
+
SubscriberChannelDto,
|
|
11
|
+
SubscriberChannelDto$inboundSchema,
|
|
12
|
+
SubscriberChannelDto$Outbound,
|
|
13
|
+
SubscriberChannelDto$outboundSchema,
|
|
14
|
+
} from "./subscriberchanneldto.js";
|
|
15
|
+
|
|
16
|
+
export type UpdateSubscriberRequestDto = {
|
|
17
|
+
/**
|
|
18
|
+
* The email address of the subscriber.
|
|
19
|
+
*/
|
|
20
|
+
email?: string | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* The first name of the subscriber.
|
|
23
|
+
*/
|
|
24
|
+
firstName?: string | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* The last name of the subscriber.
|
|
27
|
+
*/
|
|
28
|
+
lastName?: string | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* The phone number of the subscriber.
|
|
31
|
+
*/
|
|
32
|
+
phone?: string | undefined;
|
|
33
|
+
/**
|
|
34
|
+
* The avatar URL of the subscriber.
|
|
35
|
+
*/
|
|
36
|
+
avatar?: string | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* The locale of the subscriber, for example "en-US".
|
|
39
|
+
*/
|
|
40
|
+
locale?: string | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Custom data associated with the subscriber. Can contain any additional properties.
|
|
43
|
+
*/
|
|
44
|
+
data?: { [k: string]: any } | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* An array of communication channels for the subscriber.
|
|
47
|
+
*/
|
|
48
|
+
channels?: Array<SubscriberChannelDto> | undefined;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/** @internal */
|
|
52
|
+
export const UpdateSubscriberRequestDto$inboundSchema: z.ZodType<
|
|
53
|
+
UpdateSubscriberRequestDto,
|
|
54
|
+
z.ZodTypeDef,
|
|
55
|
+
unknown
|
|
56
|
+
> = z.object({
|
|
57
|
+
email: z.string().optional(),
|
|
58
|
+
firstName: z.string().optional(),
|
|
59
|
+
lastName: z.string().optional(),
|
|
60
|
+
phone: z.string().optional(),
|
|
61
|
+
avatar: z.string().optional(),
|
|
62
|
+
locale: z.string().optional(),
|
|
63
|
+
data: z.record(z.any()).optional(),
|
|
64
|
+
channels: z.array(SubscriberChannelDto$inboundSchema).optional(),
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
/** @internal */
|
|
68
|
+
export type UpdateSubscriberRequestDto$Outbound = {
|
|
69
|
+
email?: string | undefined;
|
|
70
|
+
firstName?: string | undefined;
|
|
71
|
+
lastName?: string | undefined;
|
|
72
|
+
phone?: string | undefined;
|
|
73
|
+
avatar?: string | undefined;
|
|
74
|
+
locale?: string | undefined;
|
|
75
|
+
data?: { [k: string]: any } | undefined;
|
|
76
|
+
channels?: Array<SubscriberChannelDto$Outbound> | undefined;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/** @internal */
|
|
80
|
+
export const UpdateSubscriberRequestDto$outboundSchema: z.ZodType<
|
|
81
|
+
UpdateSubscriberRequestDto$Outbound,
|
|
82
|
+
z.ZodTypeDef,
|
|
83
|
+
UpdateSubscriberRequestDto
|
|
84
|
+
> = z.object({
|
|
85
|
+
email: z.string().optional(),
|
|
86
|
+
firstName: z.string().optional(),
|
|
87
|
+
lastName: z.string().optional(),
|
|
88
|
+
phone: z.string().optional(),
|
|
89
|
+
avatar: z.string().optional(),
|
|
90
|
+
locale: z.string().optional(),
|
|
91
|
+
data: z.record(z.any()).optional(),
|
|
92
|
+
channels: z.array(SubscriberChannelDto$outboundSchema).optional(),
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* @internal
|
|
97
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
98
|
+
*/
|
|
99
|
+
export namespace UpdateSubscriberRequestDto$ {
|
|
100
|
+
/** @deprecated use `UpdateSubscriberRequestDto$inboundSchema` instead. */
|
|
101
|
+
export const inboundSchema = UpdateSubscriberRequestDto$inboundSchema;
|
|
102
|
+
/** @deprecated use `UpdateSubscriberRequestDto$outboundSchema` instead. */
|
|
103
|
+
export const outboundSchema = UpdateSubscriberRequestDto$outboundSchema;
|
|
104
|
+
/** @deprecated use `UpdateSubscriberRequestDto$Outbound` instead. */
|
|
105
|
+
export type Outbound = UpdateSubscriberRequestDto$Outbound;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function updateSubscriberRequestDtoToJSON(
|
|
109
|
+
updateSubscriberRequestDto: UpdateSubscriberRequestDto,
|
|
110
|
+
): string {
|
|
111
|
+
return JSON.stringify(
|
|
112
|
+
UpdateSubscriberRequestDto$outboundSchema.parse(updateSubscriberRequestDto),
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export function updateSubscriberRequestDtoFromJSON(
|
|
117
|
+
jsonString: string,
|
|
118
|
+
): SafeParseResult<UpdateSubscriberRequestDto, SDKValidationError> {
|
|
119
|
+
return safeParse(
|
|
120
|
+
jsonString,
|
|
121
|
+
(x) => UpdateSubscriberRequestDto$inboundSchema.parse(JSON.parse(x)),
|
|
122
|
+
`Failed to parse 'UpdateSubscriberRequestDto' from JSON`,
|
|
123
|
+
);
|
|
124
|
+
}
|
|
@@ -20,6 +20,10 @@ export type WorkflowInfoDto = {
|
|
|
20
20
|
* Display name of the workflow
|
|
21
21
|
*/
|
|
22
22
|
name: string;
|
|
23
|
+
/**
|
|
24
|
+
* last updated date
|
|
25
|
+
*/
|
|
26
|
+
updatedAt?: string | undefined;
|
|
23
27
|
};
|
|
24
28
|
|
|
25
29
|
/** @internal */
|
|
@@ -31,6 +35,7 @@ export const WorkflowInfoDto$inboundSchema: z.ZodType<
|
|
|
31
35
|
slug: z.string(),
|
|
32
36
|
identifier: z.string(),
|
|
33
37
|
name: z.string(),
|
|
38
|
+
updatedAt: z.string().optional(),
|
|
34
39
|
});
|
|
35
40
|
|
|
36
41
|
/** @internal */
|
|
@@ -38,6 +43,7 @@ export type WorkflowInfoDto$Outbound = {
|
|
|
38
43
|
slug: string;
|
|
39
44
|
identifier: string;
|
|
40
45
|
name: string;
|
|
46
|
+
updatedAt?: string | undefined;
|
|
41
47
|
};
|
|
42
48
|
|
|
43
49
|
/** @internal */
|
|
@@ -49,6 +55,7 @@ export const WorkflowInfoDto$outboundSchema: z.ZodType<
|
|
|
49
55
|
slug: z.string(),
|
|
50
56
|
identifier: z.string(),
|
|
51
57
|
name: z.string(),
|
|
58
|
+
updatedAt: z.string().optional(),
|
|
52
59
|
});
|
|
53
60
|
|
|
54
61
|
/**
|
|
@@ -38,6 +38,7 @@ export * from "./subscribersv1controllermarkactionasseen.js";
|
|
|
38
38
|
export * from "./subscribersv1controllermarkallunreadasread.js";
|
|
39
39
|
export * from "./subscribersv1controllermarkmessagesas.js";
|
|
40
40
|
export * from "./subscribersv1controllermodifysubscriberchannel.js";
|
|
41
|
+
export * from "./subscribersv1controllerupdatesubscriber.js";
|
|
41
42
|
export * from "./subscribersv1controllerupdatesubscriberchannel.js";
|
|
42
43
|
export * from "./subscribersv1controllerupdatesubscriberonlineflag.js";
|
|
43
44
|
export * from "./topicscontrollerassign.js";
|
|
@@ -10,10 +10,16 @@ import { Result as SafeParseResult } from "../../types/fp.js";
|
|
|
10
10
|
import * as components from "../components/index.js";
|
|
11
11
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Direction of sorting
|
|
15
|
+
*/
|
|
13
16
|
export const OrderDirection = {
|
|
14
17
|
Asc: "ASC",
|
|
15
18
|
Desc: "DESC",
|
|
16
19
|
} as const;
|
|
20
|
+
/**
|
|
21
|
+
* Direction of sorting
|
|
22
|
+
*/
|
|
17
23
|
export type OrderDirection = ClosedEnum<typeof OrderDirection>;
|
|
18
24
|
|
|
19
25
|
export type SubscribersControllerSearchSubscribersRequest = {
|
|
@@ -25,6 +31,22 @@ export type SubscribersControllerSearchSubscribersRequest = {
|
|
|
25
31
|
* Cursor for pagination indicating the ending point before which to fetch results.
|
|
26
32
|
*/
|
|
27
33
|
before?: string | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Limit the number of items to return
|
|
36
|
+
*/
|
|
37
|
+
limit?: number | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Direction of sorting
|
|
40
|
+
*/
|
|
41
|
+
orderDirection?: OrderDirection | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Field to order by
|
|
44
|
+
*/
|
|
45
|
+
orderBy?: string | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Include cursor item in response
|
|
48
|
+
*/
|
|
49
|
+
includeCursor?: boolean | undefined;
|
|
28
50
|
/**
|
|
29
51
|
* Email address of the subscriber to filter results.
|
|
30
52
|
*/
|
|
@@ -41,9 +63,6 @@ export type SubscribersControllerSearchSubscribersRequest = {
|
|
|
41
63
|
* Unique identifier of the subscriber to filter results.
|
|
42
64
|
*/
|
|
43
65
|
subscriberId?: string | undefined;
|
|
44
|
-
limit?: number | undefined;
|
|
45
|
-
orderDirection?: OrderDirection | undefined;
|
|
46
|
-
orderBy?: any | undefined;
|
|
47
66
|
/**
|
|
48
67
|
* A header for idempotency purposes
|
|
49
68
|
*/
|
|
@@ -85,13 +104,14 @@ export const SubscribersControllerSearchSubscribersRequest$inboundSchema:
|
|
|
85
104
|
> = z.object({
|
|
86
105
|
after: z.string().optional(),
|
|
87
106
|
before: z.string().optional(),
|
|
107
|
+
limit: z.number().optional(),
|
|
108
|
+
orderDirection: OrderDirection$inboundSchema.optional(),
|
|
109
|
+
orderBy: z.string().optional(),
|
|
110
|
+
includeCursor: z.boolean().optional(),
|
|
88
111
|
email: z.string().optional(),
|
|
89
112
|
name: z.string().optional(),
|
|
90
113
|
phone: z.string().optional(),
|
|
91
114
|
subscriberId: z.string().optional(),
|
|
92
|
-
limit: z.number().optional(),
|
|
93
|
-
orderDirection: OrderDirection$inboundSchema.optional(),
|
|
94
|
-
orderBy: z.any().optional(),
|
|
95
115
|
"idempotency-key": z.string().optional(),
|
|
96
116
|
}).transform((v) => {
|
|
97
117
|
return remap$(v, {
|
|
@@ -103,13 +123,14 @@ export const SubscribersControllerSearchSubscribersRequest$inboundSchema:
|
|
|
103
123
|
export type SubscribersControllerSearchSubscribersRequest$Outbound = {
|
|
104
124
|
after?: string | undefined;
|
|
105
125
|
before?: string | undefined;
|
|
126
|
+
limit?: number | undefined;
|
|
127
|
+
orderDirection?: string | undefined;
|
|
128
|
+
orderBy?: string | undefined;
|
|
129
|
+
includeCursor?: boolean | undefined;
|
|
106
130
|
email?: string | undefined;
|
|
107
131
|
name?: string | undefined;
|
|
108
132
|
phone?: string | undefined;
|
|
109
133
|
subscriberId?: string | undefined;
|
|
110
|
-
limit?: number | undefined;
|
|
111
|
-
orderDirection?: string | undefined;
|
|
112
|
-
orderBy?: any | undefined;
|
|
113
134
|
"idempotency-key"?: string | undefined;
|
|
114
135
|
};
|
|
115
136
|
|
|
@@ -122,13 +143,14 @@ export const SubscribersControllerSearchSubscribersRequest$outboundSchema:
|
|
|
122
143
|
> = z.object({
|
|
123
144
|
after: z.string().optional(),
|
|
124
145
|
before: z.string().optional(),
|
|
146
|
+
limit: z.number().optional(),
|
|
147
|
+
orderDirection: OrderDirection$outboundSchema.optional(),
|
|
148
|
+
orderBy: z.string().optional(),
|
|
149
|
+
includeCursor: z.boolean().optional(),
|
|
125
150
|
email: z.string().optional(),
|
|
126
151
|
name: z.string().optional(),
|
|
127
152
|
phone: z.string().optional(),
|
|
128
153
|
subscriberId: z.string().optional(),
|
|
129
|
-
limit: z.number().optional(),
|
|
130
|
-
orderDirection: OrderDirection$outboundSchema.optional(),
|
|
131
|
-
orderBy: z.any().optional(),
|
|
132
154
|
idempotencyKey: z.string().optional(),
|
|
133
155
|
}).transform((v) => {
|
|
134
156
|
return remap$(v, {
|