@hookdeck/outpost-sdk 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -0
- package/bin/mcp-server.js +457 -38
- package/bin/mcp-server.js.map +27 -20
- package/dist/commonjs/funcs/eventsList.d.ts +4 -2
- package/dist/commonjs/funcs/eventsList.d.ts.map +1 -1
- package/dist/commonjs/funcs/eventsList.js +46 -8
- package/dist/commonjs/funcs/eventsList.js.map +1 -1
- package/dist/commonjs/funcs/eventsListByDestination.d.ts +4 -2
- package/dist/commonjs/funcs/eventsListByDestination.d.ts.map +1 -1
- package/dist/commonjs/funcs/eventsListByDestination.js +44 -8
- package/dist/commonjs/funcs/eventsListByDestination.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/security.d.ts.map +1 -1
- package/dist/commonjs/lib/security.js.map +1 -1
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.js +1 -1
- package/dist/commonjs/mcp-server/tools/eventsList.js +1 -1
- package/dist/commonjs/mcp-server/tools/eventsList.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/eventsListByDestination.js +1 -1
- package/dist/commonjs/mcp-server/tools/eventsListByDestination.js.map +1 -1
- package/dist/commonjs/models/components/awss3config.d.ts +47 -0
- package/dist/commonjs/models/components/awss3config.d.ts.map +1 -0
- package/dist/commonjs/models/components/awss3config.js +86 -0
- package/dist/commonjs/models/components/awss3config.js.map +1 -0
- package/dist/commonjs/models/components/awss3credentials.d.ts +42 -0
- package/dist/commonjs/models/components/awss3credentials.d.ts.map +1 -0
- package/dist/commonjs/models/components/awss3credentials.js +73 -0
- package/dist/commonjs/models/components/awss3credentials.js.map +1 -0
- package/dist/commonjs/models/components/destination.d.ts +5 -0
- package/dist/commonjs/models/components/destination.d.ts.map +1 -1
- package/dist/commonjs/models/components/destination.js +7 -0
- package/dist/commonjs/models/components/destination.js.map +1 -1
- package/dist/commonjs/models/components/destinationawss3.d.ts +98 -0
- package/dist/commonjs/models/components/destinationawss3.d.ts.map +1 -0
- package/dist/commonjs/models/components/destinationawss3.js +122 -0
- package/dist/commonjs/models/components/destinationawss3.js.map +1 -0
- package/dist/commonjs/models/components/destinationcreate.d.ts +5 -0
- package/dist/commonjs/models/components/destinationcreate.d.ts.map +1 -1
- package/dist/commonjs/models/components/destinationcreate.js +7 -0
- package/dist/commonjs/models/components/destinationcreate.js.map +1 -1
- package/dist/commonjs/models/components/destinationcreateawss3.d.ts +78 -0
- package/dist/commonjs/models/components/destinationcreateawss3.d.ts.map +1 -0
- package/dist/commonjs/models/components/destinationcreateawss3.js +101 -0
- package/dist/commonjs/models/components/destinationcreateawss3.js.map +1 -0
- package/dist/commonjs/models/components/destinationupdate.d.ts +3 -2
- package/dist/commonjs/models/components/destinationupdate.d.ts.map +1 -1
- package/dist/commonjs/models/components/destinationupdate.js +3 -0
- package/dist/commonjs/models/components/destinationupdate.js.map +1 -1
- package/dist/commonjs/models/components/destinationupdateawss3.d.ts +39 -0
- package/dist/commonjs/models/components/destinationupdateawss3.d.ts.map +1 -0
- package/dist/commonjs/models/components/destinationupdateawss3.js +76 -0
- package/dist/commonjs/models/components/destinationupdateawss3.js.map +1 -0
- package/dist/commonjs/models/components/index.d.ts +5 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +5 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/operations/getdestinationtypeschema.d.ts +3 -0
- package/dist/commonjs/models/operations/getdestinationtypeschema.d.ts.map +1 -1
- package/dist/commonjs/models/operations/getdestinationtypeschema.js +1 -0
- package/dist/commonjs/models/operations/getdestinationtypeschema.js.map +1 -1
- package/dist/commonjs/models/operations/gettenantdestinationtypeschema.d.ts +3 -0
- package/dist/commonjs/models/operations/gettenantdestinationtypeschema.d.ts.map +1 -1
- package/dist/commonjs/models/operations/gettenantdestinationtypeschema.js +1 -0
- package/dist/commonjs/models/operations/gettenantdestinationtypeschema.js.map +1 -1
- package/dist/commonjs/models/operations/listtenantdestinations.d.ts +6 -0
- package/dist/commonjs/models/operations/listtenantdestinations.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listtenantdestinations.js +2 -0
- package/dist/commonjs/models/operations/listtenantdestinations.js.map +1 -1
- package/dist/commonjs/models/operations/listtenantevents.d.ts +94 -0
- package/dist/commonjs/models/operations/listtenantevents.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listtenantevents.js +92 -1
- package/dist/commonjs/models/operations/listtenantevents.js.map +1 -1
- package/dist/commonjs/models/operations/listtenanteventsbydestination.d.ts +94 -0
- package/dist/commonjs/models/operations/listtenanteventsbydestination.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listtenanteventsbydestination.js +92 -1
- package/dist/commonjs/models/operations/listtenanteventsbydestination.js.map +1 -1
- package/dist/commonjs/sdk/events.d.ts +7 -2
- package/dist/commonjs/sdk/events.d.ts.map +1 -1
- package/dist/commonjs/sdk/events.js +3 -2
- package/dist/commonjs/sdk/events.js.map +1 -1
- package/dist/esm/funcs/eventsList.d.ts +4 -2
- package/dist/esm/funcs/eventsList.d.ts.map +1 -1
- package/dist/esm/funcs/eventsList.js +46 -8
- package/dist/esm/funcs/eventsList.js.map +1 -1
- package/dist/esm/funcs/eventsListByDestination.d.ts +4 -2
- package/dist/esm/funcs/eventsListByDestination.d.ts.map +1 -1
- package/dist/esm/funcs/eventsListByDestination.js +44 -8
- package/dist/esm/funcs/eventsListByDestination.js.map +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/security.d.ts.map +1 -1
- package/dist/esm/lib/security.js.map +1 -1
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.js +1 -1
- package/dist/esm/mcp-server/tools/eventsList.js +1 -1
- package/dist/esm/mcp-server/tools/eventsList.js.map +1 -1
- package/dist/esm/mcp-server/tools/eventsListByDestination.js +1 -1
- package/dist/esm/mcp-server/tools/eventsListByDestination.js.map +1 -1
- package/dist/esm/models/components/awss3config.d.ts +47 -0
- package/dist/esm/models/components/awss3config.d.ts.map +1 -0
- package/dist/esm/models/components/awss3config.js +48 -0
- package/dist/esm/models/components/awss3config.js.map +1 -0
- package/dist/esm/models/components/awss3credentials.d.ts +42 -0
- package/dist/esm/models/components/awss3credentials.d.ts.map +1 -0
- package/dist/esm/models/components/awss3credentials.js +35 -0
- package/dist/esm/models/components/awss3credentials.js.map +1 -0
- package/dist/esm/models/components/destination.d.ts +5 -0
- package/dist/esm/models/components/destination.d.ts.map +1 -1
- package/dist/esm/models/components/destination.js +7 -0
- package/dist/esm/models/components/destination.js.map +1 -1
- package/dist/esm/models/components/destinationawss3.d.ts +98 -0
- package/dist/esm/models/components/destinationawss3.d.ts.map +1 -0
- package/dist/esm/models/components/destinationawss3.js +84 -0
- package/dist/esm/models/components/destinationawss3.js.map +1 -0
- package/dist/esm/models/components/destinationcreate.d.ts +5 -0
- package/dist/esm/models/components/destinationcreate.d.ts.map +1 -1
- package/dist/esm/models/components/destinationcreate.js +7 -0
- package/dist/esm/models/components/destinationcreate.js.map +1 -1
- package/dist/esm/models/components/destinationcreateawss3.d.ts +78 -0
- package/dist/esm/models/components/destinationcreateawss3.d.ts.map +1 -0
- package/dist/esm/models/components/destinationcreateawss3.js +63 -0
- package/dist/esm/models/components/destinationcreateawss3.js.map +1 -0
- package/dist/esm/models/components/destinationupdate.d.ts +3 -2
- package/dist/esm/models/components/destinationupdate.d.ts.map +1 -1
- package/dist/esm/models/components/destinationupdate.js +3 -0
- package/dist/esm/models/components/destinationupdate.js.map +1 -1
- package/dist/esm/models/components/destinationupdateawss3.d.ts +39 -0
- package/dist/esm/models/components/destinationupdateawss3.d.ts.map +1 -0
- package/dist/esm/models/components/destinationupdateawss3.js +38 -0
- package/dist/esm/models/components/destinationupdateawss3.js.map +1 -0
- package/dist/esm/models/components/index.d.ts +5 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +5 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/operations/getdestinationtypeschema.d.ts +3 -0
- package/dist/esm/models/operations/getdestinationtypeschema.d.ts.map +1 -1
- package/dist/esm/models/operations/getdestinationtypeschema.js +1 -0
- package/dist/esm/models/operations/getdestinationtypeschema.js.map +1 -1
- package/dist/esm/models/operations/gettenantdestinationtypeschema.d.ts +3 -0
- package/dist/esm/models/operations/gettenantdestinationtypeschema.d.ts.map +1 -1
- package/dist/esm/models/operations/gettenantdestinationtypeschema.js +1 -0
- package/dist/esm/models/operations/gettenantdestinationtypeschema.js.map +1 -1
- package/dist/esm/models/operations/listtenantdestinations.d.ts +6 -0
- package/dist/esm/models/operations/listtenantdestinations.d.ts.map +1 -1
- package/dist/esm/models/operations/listtenantdestinations.js +2 -0
- package/dist/esm/models/operations/listtenantdestinations.js.map +1 -1
- package/dist/esm/models/operations/listtenantevents.d.ts +94 -0
- package/dist/esm/models/operations/listtenantevents.d.ts.map +1 -1
- package/dist/esm/models/operations/listtenantevents.js +87 -0
- package/dist/esm/models/operations/listtenantevents.js.map +1 -1
- package/dist/esm/models/operations/listtenanteventsbydestination.d.ts +94 -0
- package/dist/esm/models/operations/listtenanteventsbydestination.d.ts.map +1 -1
- package/dist/esm/models/operations/listtenanteventsbydestination.js +87 -0
- package/dist/esm/models/operations/listtenanteventsbydestination.js.map +1 -1
- package/dist/esm/sdk/events.d.ts +7 -2
- package/dist/esm/sdk/events.d.ts.map +1 -1
- package/dist/esm/sdk/events.js +3 -2
- package/dist/esm/sdk/events.js.map +1 -1
- package/docs/sdks/events/README.md +14 -6
- package/examples/healthCheck.example.ts +1 -1
- package/examples/package-lock.json +3 -3
- package/jsr.json +1 -1
- package/package.json +3 -3
- package/src/funcs/eventsList.ts +122 -42
- package/src/funcs/eventsListByDestination.ts +124 -42
- package/src/lib/config.ts +3 -3
- package/src/lib/security.ts +4 -1
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/mcp-server/tools/eventsList.ts +1 -1
- package/src/mcp-server/tools/eventsListByDestination.ts +1 -1
- package/src/models/components/awss3config.ts +97 -0
- package/src/models/components/awss3credentials.ts +83 -0
- package/src/models/components/destination.ts +18 -0
- package/src/models/components/destinationawss3.ts +185 -0
- package/src/models/components/destinationcreate.ts +18 -0
- package/src/models/components/destinationcreateawss3.ts +144 -0
- package/src/models/components/destinationupdate.ts +12 -2
- package/src/models/components/destinationupdateawss3.ts +95 -0
- package/src/models/components/index.ts +5 -0
- package/src/models/operations/getdestinationtypeschema.ts +1 -0
- package/src/models/operations/gettenantdestinationtypeschema.ts +1 -0
- package/src/models/operations/listtenantdestinations.ts +2 -0
- package/src/models/operations/listtenantevents.ts +198 -0
- package/src/models/operations/listtenanteventsbydestination.ts +215 -0
- package/src/sdk/events.ts +12 -4
package/src/funcs/eventsList.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import * as z from "zod";
|
|
6
5
|
import { OutpostCore } from "../core.js";
|
|
6
|
+
import { dlv } from "../lib/dlv.js";
|
|
7
7
|
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
8
8
|
import * as M from "../lib/matchers.js";
|
|
9
9
|
import { compactMap } from "../lib/primitives.js";
|
|
@@ -11,7 +11,6 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
11
11
|
import { RequestOptions } from "../lib/sdks.js";
|
|
12
12
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
13
|
import { pathToFunc } from "../lib/url.js";
|
|
14
|
-
import * as components from "../models/components/index.js";
|
|
15
14
|
import {
|
|
16
15
|
ConnectionError,
|
|
17
16
|
InvalidRequestError,
|
|
@@ -26,6 +25,12 @@ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
|
26
25
|
import * as operations from "../models/operations/index.js";
|
|
27
26
|
import { APICall, APIPromise } from "../types/async.js";
|
|
28
27
|
import { Result } from "../types/fp.js";
|
|
28
|
+
import {
|
|
29
|
+
createPageIterator,
|
|
30
|
+
haltIterator,
|
|
31
|
+
PageIterator,
|
|
32
|
+
Paginator,
|
|
33
|
+
} from "../types/operations.js";
|
|
29
34
|
|
|
30
35
|
/**
|
|
31
36
|
* List Events
|
|
@@ -38,39 +43,9 @@ export function eventsList(
|
|
|
38
43
|
request: operations.ListTenantEventsRequest,
|
|
39
44
|
options?: RequestOptions,
|
|
40
45
|
): APIPromise<
|
|
41
|
-
|
|
42
|
-
Array<components.Event>,
|
|
43
|
-
| errors.UnauthorizedError
|
|
44
|
-
| errors.TimeoutError
|
|
45
|
-
| errors.RateLimitedError
|
|
46
|
-
| errors.BadRequestError
|
|
47
|
-
| errors.NotFoundError
|
|
48
|
-
| errors.InternalServerError
|
|
49
|
-
| OutpostError
|
|
50
|
-
| ResponseValidationError
|
|
51
|
-
| ConnectionError
|
|
52
|
-
| RequestAbortedError
|
|
53
|
-
| RequestTimeoutError
|
|
54
|
-
| InvalidRequestError
|
|
55
|
-
| UnexpectedClientError
|
|
56
|
-
| SDKValidationError
|
|
57
|
-
>
|
|
58
|
-
> {
|
|
59
|
-
return new APIPromise($do(
|
|
60
|
-
client,
|
|
61
|
-
request,
|
|
62
|
-
options,
|
|
63
|
-
));
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
async function $do(
|
|
67
|
-
client: OutpostCore,
|
|
68
|
-
request: operations.ListTenantEventsRequest,
|
|
69
|
-
options?: RequestOptions,
|
|
70
|
-
): Promise<
|
|
71
|
-
[
|
|
46
|
+
PageIterator<
|
|
72
47
|
Result<
|
|
73
|
-
|
|
48
|
+
operations.ListTenantEventsResponse,
|
|
74
49
|
| errors.UnauthorizedError
|
|
75
50
|
| errors.TimeoutError
|
|
76
51
|
| errors.RateLimitedError
|
|
@@ -86,6 +61,42 @@ async function $do(
|
|
|
86
61
|
| UnexpectedClientError
|
|
87
62
|
| SDKValidationError
|
|
88
63
|
>,
|
|
64
|
+
{ cursor: string }
|
|
65
|
+
>
|
|
66
|
+
> {
|
|
67
|
+
return new APIPromise($do(
|
|
68
|
+
client,
|
|
69
|
+
request,
|
|
70
|
+
options,
|
|
71
|
+
));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
async function $do(
|
|
75
|
+
client: OutpostCore,
|
|
76
|
+
request: operations.ListTenantEventsRequest,
|
|
77
|
+
options?: RequestOptions,
|
|
78
|
+
): Promise<
|
|
79
|
+
[
|
|
80
|
+
PageIterator<
|
|
81
|
+
Result<
|
|
82
|
+
operations.ListTenantEventsResponse,
|
|
83
|
+
| errors.UnauthorizedError
|
|
84
|
+
| errors.TimeoutError
|
|
85
|
+
| errors.RateLimitedError
|
|
86
|
+
| errors.BadRequestError
|
|
87
|
+
| errors.NotFoundError
|
|
88
|
+
| errors.InternalServerError
|
|
89
|
+
| OutpostError
|
|
90
|
+
| ResponseValidationError
|
|
91
|
+
| ConnectionError
|
|
92
|
+
| RequestAbortedError
|
|
93
|
+
| RequestTimeoutError
|
|
94
|
+
| InvalidRequestError
|
|
95
|
+
| UnexpectedClientError
|
|
96
|
+
| SDKValidationError
|
|
97
|
+
>,
|
|
98
|
+
{ cursor: string }
|
|
99
|
+
>,
|
|
89
100
|
APICall,
|
|
90
101
|
]
|
|
91
102
|
> {
|
|
@@ -95,7 +106,7 @@ async function $do(
|
|
|
95
106
|
"Input validation failed",
|
|
96
107
|
);
|
|
97
108
|
if (!parsed.ok) {
|
|
98
|
-
return [parsed, { status: "invalid" }];
|
|
109
|
+
return [haltIterator(parsed), { status: "invalid" }];
|
|
99
110
|
}
|
|
100
111
|
const payload = parsed.value;
|
|
101
112
|
const body = null;
|
|
@@ -112,6 +123,11 @@ async function $do(
|
|
|
112
123
|
|
|
113
124
|
const query = encodeFormQuery({
|
|
114
125
|
"destination_id": payload.destination_id,
|
|
126
|
+
"end": payload.end,
|
|
127
|
+
"limit": payload.limit,
|
|
128
|
+
"next": payload.next,
|
|
129
|
+
"prev": payload.prev,
|
|
130
|
+
"start": payload.start,
|
|
115
131
|
"status": payload.status,
|
|
116
132
|
});
|
|
117
133
|
|
|
@@ -149,7 +165,7 @@ async function $do(
|
|
|
149
165
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
150
166
|
}, options);
|
|
151
167
|
if (!requestRes.ok) {
|
|
152
|
-
return [requestRes, { status: "invalid" }];
|
|
168
|
+
return [haltIterator(requestRes), { status: "invalid" }];
|
|
153
169
|
}
|
|
154
170
|
const req = requestRes.value;
|
|
155
171
|
|
|
@@ -186,7 +202,7 @@ async function $do(
|
|
|
186
202
|
retryCodes: context.retryCodes,
|
|
187
203
|
});
|
|
188
204
|
if (!doResult.ok) {
|
|
189
|
-
return [doResult, { status: "request-error", request: req }];
|
|
205
|
+
return [haltIterator(doResult), { status: "request-error", request: req }];
|
|
190
206
|
}
|
|
191
207
|
const response = doResult.value;
|
|
192
208
|
|
|
@@ -194,8 +210,8 @@ async function $do(
|
|
|
194
210
|
HttpMeta: { Response: response, Request: req },
|
|
195
211
|
};
|
|
196
212
|
|
|
197
|
-
const [result] = await M.match<
|
|
198
|
-
|
|
213
|
+
const [result, raw] = await M.match<
|
|
214
|
+
operations.ListTenantEventsResponse,
|
|
199
215
|
| errors.UnauthorizedError
|
|
200
216
|
| errors.TimeoutError
|
|
201
217
|
| errors.RateLimitedError
|
|
@@ -211,7 +227,9 @@ async function $do(
|
|
|
211
227
|
| UnexpectedClientError
|
|
212
228
|
| SDKValidationError
|
|
213
229
|
>(
|
|
214
|
-
M.json(200,
|
|
230
|
+
M.json(200, operations.ListTenantEventsResponse$inboundSchema, {
|
|
231
|
+
key: "Result",
|
|
232
|
+
}),
|
|
215
233
|
M.jsonErr([401, 403, 407], errors.UnauthorizedError$inboundSchema),
|
|
216
234
|
M.jsonErr(408, errors.TimeoutError$inboundSchema),
|
|
217
235
|
M.jsonErr(429, errors.RateLimitedError$inboundSchema),
|
|
@@ -231,8 +249,70 @@ async function $do(
|
|
|
231
249
|
M.fail("5XX"),
|
|
232
250
|
)(response, req, { extraFields: responseFields });
|
|
233
251
|
if (!result.ok) {
|
|
234
|
-
return [result, {
|
|
252
|
+
return [haltIterator(result), {
|
|
253
|
+
status: "complete",
|
|
254
|
+
request: req,
|
|
255
|
+
response,
|
|
256
|
+
}];
|
|
235
257
|
}
|
|
236
258
|
|
|
237
|
-
|
|
259
|
+
const nextFunc = (
|
|
260
|
+
responseData: unknown,
|
|
261
|
+
): {
|
|
262
|
+
next: Paginator<
|
|
263
|
+
Result<
|
|
264
|
+
operations.ListTenantEventsResponse,
|
|
265
|
+
| errors.UnauthorizedError
|
|
266
|
+
| errors.TimeoutError
|
|
267
|
+
| errors.RateLimitedError
|
|
268
|
+
| errors.BadRequestError
|
|
269
|
+
| errors.NotFoundError
|
|
270
|
+
| errors.InternalServerError
|
|
271
|
+
| OutpostError
|
|
272
|
+
| ResponseValidationError
|
|
273
|
+
| ConnectionError
|
|
274
|
+
| RequestAbortedError
|
|
275
|
+
| RequestTimeoutError
|
|
276
|
+
| InvalidRequestError
|
|
277
|
+
| UnexpectedClientError
|
|
278
|
+
| SDKValidationError
|
|
279
|
+
>
|
|
280
|
+
>;
|
|
281
|
+
"~next"?: { cursor: string };
|
|
282
|
+
} => {
|
|
283
|
+
const nextCursor = dlv(responseData, "next");
|
|
284
|
+
if (typeof nextCursor !== "string") {
|
|
285
|
+
return { next: () => null };
|
|
286
|
+
}
|
|
287
|
+
if (nextCursor.trim() === "") {
|
|
288
|
+
return { next: () => null };
|
|
289
|
+
}
|
|
290
|
+
const results = dlv(responseData, "data");
|
|
291
|
+
if (!Array.isArray(results) || !results.length) {
|
|
292
|
+
return { next: () => null };
|
|
293
|
+
}
|
|
294
|
+
const limit = request?.limit ?? 100;
|
|
295
|
+
if (results.length < limit) {
|
|
296
|
+
return { next: () => null };
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
const nextVal = () =>
|
|
300
|
+
eventsList(
|
|
301
|
+
client,
|
|
302
|
+
{
|
|
303
|
+
...request,
|
|
304
|
+
next: nextCursor,
|
|
305
|
+
},
|
|
306
|
+
options,
|
|
307
|
+
);
|
|
308
|
+
|
|
309
|
+
return { next: nextVal, "~next": { cursor: nextCursor } };
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
const page = { ...result, ...nextFunc(raw) };
|
|
313
|
+
return [{ ...page, ...createPageIterator(page, (v) => !v.ok) }, {
|
|
314
|
+
status: "complete",
|
|
315
|
+
request: req,
|
|
316
|
+
response,
|
|
317
|
+
}];
|
|
238
318
|
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import * as z from "zod";
|
|
6
5
|
import { OutpostCore } from "../core.js";
|
|
6
|
+
import { dlv } from "../lib/dlv.js";
|
|
7
7
|
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
8
8
|
import * as M from "../lib/matchers.js";
|
|
9
9
|
import { compactMap } from "../lib/primitives.js";
|
|
@@ -11,7 +11,6 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
11
11
|
import { RequestOptions } from "../lib/sdks.js";
|
|
12
12
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
13
|
import { pathToFunc } from "../lib/url.js";
|
|
14
|
-
import * as components from "../models/components/index.js";
|
|
15
14
|
import {
|
|
16
15
|
ConnectionError,
|
|
17
16
|
InvalidRequestError,
|
|
@@ -26,6 +25,12 @@ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
|
26
25
|
import * as operations from "../models/operations/index.js";
|
|
27
26
|
import { APICall, APIPromise } from "../types/async.js";
|
|
28
27
|
import { Result } from "../types/fp.js";
|
|
28
|
+
import {
|
|
29
|
+
createPageIterator,
|
|
30
|
+
haltIterator,
|
|
31
|
+
PageIterator,
|
|
32
|
+
Paginator,
|
|
33
|
+
} from "../types/operations.js";
|
|
29
34
|
|
|
30
35
|
/**
|
|
31
36
|
* List Events by Destination
|
|
@@ -38,39 +43,9 @@ export function eventsListByDestination(
|
|
|
38
43
|
request: operations.ListTenantEventsByDestinationRequest,
|
|
39
44
|
options?: RequestOptions,
|
|
40
45
|
): APIPromise<
|
|
41
|
-
|
|
42
|
-
Array<components.Event>,
|
|
43
|
-
| errors.UnauthorizedError
|
|
44
|
-
| errors.TimeoutError
|
|
45
|
-
| errors.RateLimitedError
|
|
46
|
-
| errors.BadRequestError
|
|
47
|
-
| errors.NotFoundError
|
|
48
|
-
| errors.InternalServerError
|
|
49
|
-
| OutpostError
|
|
50
|
-
| ResponseValidationError
|
|
51
|
-
| ConnectionError
|
|
52
|
-
| RequestAbortedError
|
|
53
|
-
| RequestTimeoutError
|
|
54
|
-
| InvalidRequestError
|
|
55
|
-
| UnexpectedClientError
|
|
56
|
-
| SDKValidationError
|
|
57
|
-
>
|
|
58
|
-
> {
|
|
59
|
-
return new APIPromise($do(
|
|
60
|
-
client,
|
|
61
|
-
request,
|
|
62
|
-
options,
|
|
63
|
-
));
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
async function $do(
|
|
67
|
-
client: OutpostCore,
|
|
68
|
-
request: operations.ListTenantEventsByDestinationRequest,
|
|
69
|
-
options?: RequestOptions,
|
|
70
|
-
): Promise<
|
|
71
|
-
[
|
|
46
|
+
PageIterator<
|
|
72
47
|
Result<
|
|
73
|
-
|
|
48
|
+
operations.ListTenantEventsByDestinationResponse,
|
|
74
49
|
| errors.UnauthorizedError
|
|
75
50
|
| errors.TimeoutError
|
|
76
51
|
| errors.RateLimitedError
|
|
@@ -86,6 +61,42 @@ async function $do(
|
|
|
86
61
|
| UnexpectedClientError
|
|
87
62
|
| SDKValidationError
|
|
88
63
|
>,
|
|
64
|
+
{ cursor: string }
|
|
65
|
+
>
|
|
66
|
+
> {
|
|
67
|
+
return new APIPromise($do(
|
|
68
|
+
client,
|
|
69
|
+
request,
|
|
70
|
+
options,
|
|
71
|
+
));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
async function $do(
|
|
75
|
+
client: OutpostCore,
|
|
76
|
+
request: operations.ListTenantEventsByDestinationRequest,
|
|
77
|
+
options?: RequestOptions,
|
|
78
|
+
): Promise<
|
|
79
|
+
[
|
|
80
|
+
PageIterator<
|
|
81
|
+
Result<
|
|
82
|
+
operations.ListTenantEventsByDestinationResponse,
|
|
83
|
+
| errors.UnauthorizedError
|
|
84
|
+
| errors.TimeoutError
|
|
85
|
+
| errors.RateLimitedError
|
|
86
|
+
| errors.BadRequestError
|
|
87
|
+
| errors.NotFoundError
|
|
88
|
+
| errors.InternalServerError
|
|
89
|
+
| OutpostError
|
|
90
|
+
| ResponseValidationError
|
|
91
|
+
| ConnectionError
|
|
92
|
+
| RequestAbortedError
|
|
93
|
+
| RequestTimeoutError
|
|
94
|
+
| InvalidRequestError
|
|
95
|
+
| UnexpectedClientError
|
|
96
|
+
| SDKValidationError
|
|
97
|
+
>,
|
|
98
|
+
{ cursor: string }
|
|
99
|
+
>,
|
|
89
100
|
APICall,
|
|
90
101
|
]
|
|
91
102
|
> {
|
|
@@ -98,7 +109,7 @@ async function $do(
|
|
|
98
109
|
"Input validation failed",
|
|
99
110
|
);
|
|
100
111
|
if (!parsed.ok) {
|
|
101
|
-
return [parsed, { status: "invalid" }];
|
|
112
|
+
return [haltIterator(parsed), { status: "invalid" }];
|
|
102
113
|
}
|
|
103
114
|
const payload = parsed.value;
|
|
104
115
|
const body = null;
|
|
@@ -120,6 +131,11 @@ async function $do(
|
|
|
120
131
|
);
|
|
121
132
|
|
|
122
133
|
const query = encodeFormQuery({
|
|
134
|
+
"end": payload.end,
|
|
135
|
+
"limit": payload.limit,
|
|
136
|
+
"next": payload.next,
|
|
137
|
+
"prev": payload.prev,
|
|
138
|
+
"start": payload.start,
|
|
123
139
|
"status": payload.status,
|
|
124
140
|
});
|
|
125
141
|
|
|
@@ -157,7 +173,7 @@ async function $do(
|
|
|
157
173
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
158
174
|
}, options);
|
|
159
175
|
if (!requestRes.ok) {
|
|
160
|
-
return [requestRes, { status: "invalid" }];
|
|
176
|
+
return [haltIterator(requestRes), { status: "invalid" }];
|
|
161
177
|
}
|
|
162
178
|
const req = requestRes.value;
|
|
163
179
|
|
|
@@ -194,7 +210,7 @@ async function $do(
|
|
|
194
210
|
retryCodes: context.retryCodes,
|
|
195
211
|
});
|
|
196
212
|
if (!doResult.ok) {
|
|
197
|
-
return [doResult, { status: "request-error", request: req }];
|
|
213
|
+
return [haltIterator(doResult), { status: "request-error", request: req }];
|
|
198
214
|
}
|
|
199
215
|
const response = doResult.value;
|
|
200
216
|
|
|
@@ -202,8 +218,8 @@ async function $do(
|
|
|
202
218
|
HttpMeta: { Response: response, Request: req },
|
|
203
219
|
};
|
|
204
220
|
|
|
205
|
-
const [result] = await M.match<
|
|
206
|
-
|
|
221
|
+
const [result, raw] = await M.match<
|
|
222
|
+
operations.ListTenantEventsByDestinationResponse,
|
|
207
223
|
| errors.UnauthorizedError
|
|
208
224
|
| errors.TimeoutError
|
|
209
225
|
| errors.RateLimitedError
|
|
@@ -219,7 +235,11 @@ async function $do(
|
|
|
219
235
|
| UnexpectedClientError
|
|
220
236
|
| SDKValidationError
|
|
221
237
|
>(
|
|
222
|
-
M.json(
|
|
238
|
+
M.json(
|
|
239
|
+
200,
|
|
240
|
+
operations.ListTenantEventsByDestinationResponse$inboundSchema,
|
|
241
|
+
{ key: "Result" },
|
|
242
|
+
),
|
|
223
243
|
M.jsonErr([401, 403, 407], errors.UnauthorizedError$inboundSchema),
|
|
224
244
|
M.jsonErr(408, errors.TimeoutError$inboundSchema),
|
|
225
245
|
M.jsonErr(429, errors.RateLimitedError$inboundSchema),
|
|
@@ -239,8 +259,70 @@ async function $do(
|
|
|
239
259
|
M.fail("5XX"),
|
|
240
260
|
)(response, req, { extraFields: responseFields });
|
|
241
261
|
if (!result.ok) {
|
|
242
|
-
return [result, {
|
|
262
|
+
return [haltIterator(result), {
|
|
263
|
+
status: "complete",
|
|
264
|
+
request: req,
|
|
265
|
+
response,
|
|
266
|
+
}];
|
|
243
267
|
}
|
|
244
268
|
|
|
245
|
-
|
|
269
|
+
const nextFunc = (
|
|
270
|
+
responseData: unknown,
|
|
271
|
+
): {
|
|
272
|
+
next: Paginator<
|
|
273
|
+
Result<
|
|
274
|
+
operations.ListTenantEventsByDestinationResponse,
|
|
275
|
+
| errors.UnauthorizedError
|
|
276
|
+
| errors.TimeoutError
|
|
277
|
+
| errors.RateLimitedError
|
|
278
|
+
| errors.BadRequestError
|
|
279
|
+
| errors.NotFoundError
|
|
280
|
+
| errors.InternalServerError
|
|
281
|
+
| OutpostError
|
|
282
|
+
| ResponseValidationError
|
|
283
|
+
| ConnectionError
|
|
284
|
+
| RequestAbortedError
|
|
285
|
+
| RequestTimeoutError
|
|
286
|
+
| InvalidRequestError
|
|
287
|
+
| UnexpectedClientError
|
|
288
|
+
| SDKValidationError
|
|
289
|
+
>
|
|
290
|
+
>;
|
|
291
|
+
"~next"?: { cursor: string };
|
|
292
|
+
} => {
|
|
293
|
+
const nextCursor = dlv(responseData, "next");
|
|
294
|
+
if (typeof nextCursor !== "string") {
|
|
295
|
+
return { next: () => null };
|
|
296
|
+
}
|
|
297
|
+
if (nextCursor.trim() === "") {
|
|
298
|
+
return { next: () => null };
|
|
299
|
+
}
|
|
300
|
+
const results = dlv(responseData, "data");
|
|
301
|
+
if (!Array.isArray(results) || !results.length) {
|
|
302
|
+
return { next: () => null };
|
|
303
|
+
}
|
|
304
|
+
const limit = request?.limit ?? 100;
|
|
305
|
+
if (results.length < limit) {
|
|
306
|
+
return { next: () => null };
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
const nextVal = () =>
|
|
310
|
+
eventsListByDestination(
|
|
311
|
+
client,
|
|
312
|
+
{
|
|
313
|
+
...request,
|
|
314
|
+
next: nextCursor,
|
|
315
|
+
},
|
|
316
|
+
options,
|
|
317
|
+
);
|
|
318
|
+
|
|
319
|
+
return { next: nextVal, "~next": { cursor: nextCursor } };
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
const page = { ...result, ...nextFunc(raw) };
|
|
323
|
+
return [{ ...page, ...createPageIterator(page, (v) => !v.ok) }, {
|
|
324
|
+
status: "complete",
|
|
325
|
+
request: req,
|
|
326
|
+
response,
|
|
327
|
+
}];
|
|
246
328
|
}
|
package/src/lib/config.ts
CHANGED
|
@@ -73,8 +73,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
73
73
|
export const SDK_METADATA = {
|
|
74
74
|
language: "typescript",
|
|
75
75
|
openapiDocVersion: "0.0.1",
|
|
76
|
-
sdkVersion: "0.
|
|
77
|
-
genVersion: "2.
|
|
76
|
+
sdkVersion: "0.4.0",
|
|
77
|
+
genVersion: "2.692.0",
|
|
78
78
|
userAgent:
|
|
79
|
-
"speakeasy-sdk/typescript 0.
|
|
79
|
+
"speakeasy-sdk/typescript 0.4.0 2.692.0 0.0.1 @hookdeck/outpost-sdk",
|
|
80
80
|
} as const;
|
package/src/lib/security.ts
CHANGED
|
@@ -83,7 +83,10 @@ type SecurityInputOAuth2 = {
|
|
|
83
83
|
type SecurityInputOAuth2ClientCredentials = {
|
|
84
84
|
type: "oauth2:client_credentials";
|
|
85
85
|
value:
|
|
86
|
-
| {
|
|
86
|
+
| {
|
|
87
|
+
clientID?: string | undefined;
|
|
88
|
+
clientSecret?: string | undefined;
|
|
89
|
+
}
|
|
87
90
|
| null
|
|
88
91
|
| string
|
|
89
92
|
| undefined;
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
|
|
11
|
+
export type Awss3Config = {
|
|
12
|
+
/**
|
|
13
|
+
* The name of your AWS S3 bucket.
|
|
14
|
+
*/
|
|
15
|
+
bucket: string;
|
|
16
|
+
/**
|
|
17
|
+
* The AWS region where your bucket is located.
|
|
18
|
+
*/
|
|
19
|
+
region: string;
|
|
20
|
+
/**
|
|
21
|
+
* JMESPath expression for generating S3 object keys. Default is join('', [time.rfc3339_nano, '_', metadata."event-id", '.json']).
|
|
22
|
+
*/
|
|
23
|
+
keyTemplate?: string | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* The storage class for the S3 objects (e.g., STANDARD, INTELLIGENT_TIERING, GLACIER, etc.). Defaults to "STANDARD".
|
|
26
|
+
*/
|
|
27
|
+
storageClass?: string | undefined;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/** @internal */
|
|
31
|
+
export const Awss3Config$inboundSchema: z.ZodType<
|
|
32
|
+
Awss3Config,
|
|
33
|
+
z.ZodTypeDef,
|
|
34
|
+
unknown
|
|
35
|
+
> = z.object({
|
|
36
|
+
bucket: z.string(),
|
|
37
|
+
region: z.string(),
|
|
38
|
+
key_template: z.string().optional(),
|
|
39
|
+
storage_class: z.string().optional(),
|
|
40
|
+
}).transform((v) => {
|
|
41
|
+
return remap$(v, {
|
|
42
|
+
"key_template": "keyTemplate",
|
|
43
|
+
"storage_class": "storageClass",
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
/** @internal */
|
|
48
|
+
export type Awss3Config$Outbound = {
|
|
49
|
+
bucket: string;
|
|
50
|
+
region: string;
|
|
51
|
+
key_template?: string | undefined;
|
|
52
|
+
storage_class?: string | undefined;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/** @internal */
|
|
56
|
+
export const Awss3Config$outboundSchema: z.ZodType<
|
|
57
|
+
Awss3Config$Outbound,
|
|
58
|
+
z.ZodTypeDef,
|
|
59
|
+
Awss3Config
|
|
60
|
+
> = z.object({
|
|
61
|
+
bucket: z.string(),
|
|
62
|
+
region: z.string(),
|
|
63
|
+
keyTemplate: z.string().optional(),
|
|
64
|
+
storageClass: z.string().optional(),
|
|
65
|
+
}).transform((v) => {
|
|
66
|
+
return remap$(v, {
|
|
67
|
+
keyTemplate: "key_template",
|
|
68
|
+
storageClass: "storage_class",
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* @internal
|
|
74
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
75
|
+
*/
|
|
76
|
+
export namespace Awss3Config$ {
|
|
77
|
+
/** @deprecated use `Awss3Config$inboundSchema` instead. */
|
|
78
|
+
export const inboundSchema = Awss3Config$inboundSchema;
|
|
79
|
+
/** @deprecated use `Awss3Config$outboundSchema` instead. */
|
|
80
|
+
export const outboundSchema = Awss3Config$outboundSchema;
|
|
81
|
+
/** @deprecated use `Awss3Config$Outbound` instead. */
|
|
82
|
+
export type Outbound = Awss3Config$Outbound;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function awss3ConfigToJSON(awss3Config: Awss3Config): string {
|
|
86
|
+
return JSON.stringify(Awss3Config$outboundSchema.parse(awss3Config));
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function awss3ConfigFromJSON(
|
|
90
|
+
jsonString: string,
|
|
91
|
+
): SafeParseResult<Awss3Config, SDKValidationError> {
|
|
92
|
+
return safeParse(
|
|
93
|
+
jsonString,
|
|
94
|
+
(x) => Awss3Config$inboundSchema.parse(JSON.parse(x)),
|
|
95
|
+
`Failed to parse 'Awss3Config' from JSON`,
|
|
96
|
+
);
|
|
97
|
+
}
|