@hookdeck/outpost-sdk 0.8.0 → 0.9.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 +35 -2
- package/bin/mcp-server.js +384 -113
- package/bin/mcp-server.js.map +32 -30
- package/dist/commonjs/funcs/attemptsList.d.ts +4 -2
- package/dist/commonjs/funcs/attemptsList.d.ts.map +1 -1
- package/dist/commonjs/funcs/attemptsList.js +43 -7
- package/dist/commonjs/funcs/attemptsList.js.map +1 -1
- package/dist/commonjs/funcs/destinationsCreate.d.ts +1 -1
- package/dist/commonjs/funcs/destinationsCreate.d.ts.map +1 -1
- package/dist/commonjs/funcs/destinationsCreate.js +6 -6
- package/dist/commonjs/funcs/destinationsCreate.js.map +1 -1
- package/dist/commonjs/funcs/destinationsListAttempts.d.ts +4 -2
- package/dist/commonjs/funcs/destinationsListAttempts.d.ts.map +1 -1
- package/dist/commonjs/funcs/destinationsListAttempts.js +41 -7
- package/dist/commonjs/funcs/destinationsListAttempts.js.map +1 -1
- package/dist/commonjs/funcs/destinationsUpdate.d.ts +1 -1
- package/dist/commonjs/funcs/destinationsUpdate.d.ts.map +1 -1
- package/dist/commonjs/funcs/destinationsUpdate.js +6 -6
- package/dist/commonjs/funcs/destinationsUpdate.js.map +1 -1
- 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 +42 -7
- package/dist/commonjs/funcs/eventsList.js.map +1 -1
- package/dist/commonjs/funcs/{tenantsListTenants.d.ts → tenantsList.d.ts} +5 -3
- package/dist/commonjs/funcs/tenantsList.d.ts.map +1 -0
- package/dist/commonjs/funcs/{tenantsListTenants.js → tenantsList.js} +48 -19
- package/dist/commonjs/funcs/tenantsList.js.map +1 -0
- package/dist/commonjs/funcs/tenantsUpsert.d.ts +1 -1
- package/dist/commonjs/funcs/tenantsUpsert.d.ts.map +1 -1
- package/dist/commonjs/funcs/tenantsUpsert.js +6 -6
- package/dist/commonjs/funcs/tenantsUpsert.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/config.js.map +1 -1
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.js +3 -3
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/attemptsList.js +1 -1
- package/dist/commonjs/mcp-server/tools/attemptsList.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/destinationsCreate.d.ts +1 -1
- package/dist/commonjs/mcp-server/tools/destinationsCreate.js +2 -2
- package/dist/commonjs/mcp-server/tools/destinationsCreate.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/destinationsListAttempts.js +1 -1
- package/dist/commonjs/mcp-server/tools/destinationsListAttempts.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/destinationsUpdate.d.ts +1 -1
- package/dist/commonjs/mcp-server/tools/destinationsUpdate.js +2 -2
- package/dist/commonjs/mcp-server/tools/destinationsUpdate.js.map +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/tenantsList.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/tenantsList.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/{tenantsListTenants.js → tenantsList.js} +8 -12
- package/dist/commonjs/mcp-server/tools/tenantsList.js.map +1 -0
- package/dist/commonjs/mcp-server/tools/tenantsUpsert.d.ts +1 -1
- package/dist/commonjs/mcp-server/tools/tenantsUpsert.js +2 -2
- package/dist/commonjs/mcp-server/tools/tenantsUpsert.js.map +1 -1
- package/dist/commonjs/models/operations/createtenantdestination.d.ts +2 -2
- package/dist/commonjs/models/operations/createtenantdestination.d.ts.map +1 -1
- package/dist/commonjs/models/operations/createtenantdestination.js +2 -2
- package/dist/commonjs/models/operations/createtenantdestination.js.map +1 -1
- package/dist/commonjs/models/operations/getattempt.d.ts +2 -2
- package/dist/commonjs/models/operations/gettenantdestinationattempt.d.ts +2 -2
- package/dist/commonjs/models/operations/listattempts.d.ts +81 -13
- package/dist/commonjs/models/operations/listattempts.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listattempts.js +78 -7
- package/dist/commonjs/models/operations/listattempts.js.map +1 -1
- package/dist/commonjs/models/operations/listevents.d.ts +66 -5
- package/dist/commonjs/models/operations/listevents.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listevents.js +64 -3
- package/dist/commonjs/models/operations/listevents.js.map +1 -1
- package/dist/commonjs/models/operations/listtenantdestinationattempts.d.ts +43 -7
- package/dist/commonjs/models/operations/listtenantdestinationattempts.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listtenantdestinationattempts.js +50 -3
- package/dist/commonjs/models/operations/listtenantdestinationattempts.js.map +1 -1
- package/dist/commonjs/models/operations/listtenantdestinations.d.ts +4 -4
- package/dist/commonjs/models/operations/listtenants.d.ts +31 -0
- package/dist/commonjs/models/operations/listtenants.d.ts.map +1 -1
- package/dist/commonjs/models/operations/listtenants.js +41 -1
- package/dist/commonjs/models/operations/listtenants.js.map +1 -1
- package/dist/commonjs/models/operations/updatetenantdestination.d.ts +2 -2
- package/dist/commonjs/models/operations/updatetenantdestination.d.ts.map +1 -1
- package/dist/commonjs/models/operations/updatetenantdestination.js +2 -2
- package/dist/commonjs/models/operations/updatetenantdestination.js.map +1 -1
- package/dist/commonjs/models/operations/upserttenant.d.ts +2 -2
- package/dist/commonjs/models/operations/upserttenant.d.ts.map +1 -1
- package/dist/commonjs/models/operations/upserttenant.js +2 -2
- package/dist/commonjs/models/operations/upserttenant.js.map +1 -1
- package/dist/commonjs/sdk/attempts.d.ts +4 -1
- package/dist/commonjs/sdk/attempts.d.ts.map +1 -1
- package/dist/commonjs/sdk/attempts.js +2 -1
- package/dist/commonjs/sdk/attempts.js.map +1 -1
- package/dist/commonjs/sdk/destinations.d.ts +6 -3
- package/dist/commonjs/sdk/destinations.d.ts.map +1 -1
- package/dist/commonjs/sdk/destinations.js +6 -5
- package/dist/commonjs/sdk/destinations.js.map +1 -1
- package/dist/commonjs/sdk/events.d.ts +4 -1
- package/dist/commonjs/sdk/events.d.ts.map +1 -1
- package/dist/commonjs/sdk/events.js +2 -1
- package/dist/commonjs/sdk/events.js.map +1 -1
- package/dist/commonjs/sdk/tenants.d.ts +5 -2
- package/dist/commonjs/sdk/tenants.d.ts.map +1 -1
- package/dist/commonjs/sdk/tenants.js +6 -5
- package/dist/commonjs/sdk/tenants.js.map +1 -1
- package/dist/esm/funcs/attemptsList.d.ts +4 -2
- package/dist/esm/funcs/attemptsList.d.ts.map +1 -1
- package/dist/esm/funcs/attemptsList.js +43 -7
- package/dist/esm/funcs/attemptsList.js.map +1 -1
- package/dist/esm/funcs/destinationsCreate.d.ts +1 -1
- package/dist/esm/funcs/destinationsCreate.d.ts.map +1 -1
- package/dist/esm/funcs/destinationsCreate.js +6 -6
- package/dist/esm/funcs/destinationsCreate.js.map +1 -1
- package/dist/esm/funcs/destinationsListAttempts.d.ts +4 -2
- package/dist/esm/funcs/destinationsListAttempts.d.ts.map +1 -1
- package/dist/esm/funcs/destinationsListAttempts.js +41 -7
- package/dist/esm/funcs/destinationsListAttempts.js.map +1 -1
- package/dist/esm/funcs/destinationsUpdate.d.ts +1 -1
- package/dist/esm/funcs/destinationsUpdate.d.ts.map +1 -1
- package/dist/esm/funcs/destinationsUpdate.js +6 -6
- package/dist/esm/funcs/destinationsUpdate.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 +42 -7
- package/dist/esm/funcs/eventsList.js.map +1 -1
- package/dist/esm/funcs/{tenantsListTenants.d.ts → tenantsList.d.ts} +5 -3
- package/dist/esm/funcs/tenantsList.d.ts.map +1 -0
- package/dist/esm/funcs/{tenantsListTenants.js → tenantsList.js} +47 -18
- package/dist/esm/funcs/tenantsList.js.map +1 -0
- package/dist/esm/funcs/tenantsUpsert.d.ts +1 -1
- package/dist/esm/funcs/tenantsUpsert.d.ts.map +1 -1
- package/dist/esm/funcs/tenantsUpsert.js +6 -6
- package/dist/esm/funcs/tenantsUpsert.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/config.js.map +1 -1
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.js +3 -3
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/mcp-server/tools/attemptsList.js +1 -1
- package/dist/esm/mcp-server/tools/attemptsList.js.map +1 -1
- package/dist/esm/mcp-server/tools/destinationsCreate.d.ts +1 -1
- package/dist/esm/mcp-server/tools/destinationsCreate.js +2 -2
- package/dist/esm/mcp-server/tools/destinationsCreate.js.map +1 -1
- package/dist/esm/mcp-server/tools/destinationsListAttempts.js +1 -1
- package/dist/esm/mcp-server/tools/destinationsListAttempts.js.map +1 -1
- package/dist/esm/mcp-server/tools/destinationsUpdate.d.ts +1 -1
- package/dist/esm/mcp-server/tools/destinationsUpdate.js +2 -2
- package/dist/esm/mcp-server/tools/destinationsUpdate.js.map +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/tenantsList.d.ts +8 -0
- package/dist/esm/mcp-server/tools/tenantsList.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/{tenantsListTenants.js → tenantsList.js} +7 -11
- package/dist/esm/mcp-server/tools/tenantsList.js.map +1 -0
- package/dist/esm/mcp-server/tools/tenantsUpsert.d.ts +1 -1
- package/dist/esm/mcp-server/tools/tenantsUpsert.js +2 -2
- package/dist/esm/mcp-server/tools/tenantsUpsert.js.map +1 -1
- package/dist/esm/models/operations/createtenantdestination.d.ts +2 -2
- package/dist/esm/models/operations/createtenantdestination.d.ts.map +1 -1
- package/dist/esm/models/operations/createtenantdestination.js +2 -2
- package/dist/esm/models/operations/createtenantdestination.js.map +1 -1
- package/dist/esm/models/operations/getattempt.d.ts +2 -2
- package/dist/esm/models/operations/gettenantdestinationattempt.d.ts +2 -2
- package/dist/esm/models/operations/listattempts.d.ts +81 -13
- package/dist/esm/models/operations/listattempts.d.ts.map +1 -1
- package/dist/esm/models/operations/listattempts.js +69 -6
- package/dist/esm/models/operations/listattempts.js.map +1 -1
- package/dist/esm/models/operations/listevents.d.ts +66 -5
- package/dist/esm/models/operations/listevents.d.ts.map +1 -1
- package/dist/esm/models/operations/listevents.js +57 -2
- package/dist/esm/models/operations/listevents.js.map +1 -1
- package/dist/esm/models/operations/listtenantdestinationattempts.d.ts +43 -7
- package/dist/esm/models/operations/listtenantdestinationattempts.d.ts.map +1 -1
- package/dist/esm/models/operations/listtenantdestinationattempts.js +45 -2
- package/dist/esm/models/operations/listtenantdestinationattempts.js.map +1 -1
- package/dist/esm/models/operations/listtenantdestinations.d.ts +4 -4
- package/dist/esm/models/operations/listtenants.d.ts +31 -0
- package/dist/esm/models/operations/listtenants.d.ts.map +1 -1
- package/dist/esm/models/operations/listtenants.js +36 -0
- package/dist/esm/models/operations/listtenants.js.map +1 -1
- package/dist/esm/models/operations/updatetenantdestination.d.ts +2 -2
- package/dist/esm/models/operations/updatetenantdestination.d.ts.map +1 -1
- package/dist/esm/models/operations/updatetenantdestination.js +2 -2
- package/dist/esm/models/operations/updatetenantdestination.js.map +1 -1
- package/dist/esm/models/operations/upserttenant.d.ts +2 -2
- package/dist/esm/models/operations/upserttenant.d.ts.map +1 -1
- package/dist/esm/models/operations/upserttenant.js +2 -2
- package/dist/esm/models/operations/upserttenant.js.map +1 -1
- package/dist/esm/sdk/attempts.d.ts +4 -1
- package/dist/esm/sdk/attempts.d.ts.map +1 -1
- package/dist/esm/sdk/attempts.js +2 -1
- package/dist/esm/sdk/attempts.js.map +1 -1
- package/dist/esm/sdk/destinations.d.ts +6 -3
- package/dist/esm/sdk/destinations.d.ts.map +1 -1
- package/dist/esm/sdk/destinations.js +6 -5
- package/dist/esm/sdk/destinations.js.map +1 -1
- package/dist/esm/sdk/events.d.ts +4 -1
- package/dist/esm/sdk/events.d.ts.map +1 -1
- package/dist/esm/sdk/events.js +2 -1
- package/dist/esm/sdk/events.js.map +1 -1
- package/dist/esm/sdk/tenants.d.ts +5 -2
- package/dist/esm/sdk/tenants.d.ts.map +1 -1
- package/dist/esm/sdk/tenants.js +6 -5
- package/dist/esm/sdk/tenants.js.map +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/attemptsList.ts +107 -33
- package/src/funcs/destinationsCreate.ts +6 -6
- package/src/funcs/destinationsListAttempts.ts +112 -35
- package/src/funcs/destinationsUpdate.ts +6 -6
- package/src/funcs/eventsList.ts +106 -33
- package/src/funcs/{tenantsListTenants.ts → tenantsList.ts} +117 -58
- package/src/funcs/tenantsUpsert.ts +6 -6
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +3 -3
- package/src/mcp-server/tools/attemptsList.ts +1 -1
- package/src/mcp-server/tools/destinationsCreate.ts +2 -2
- package/src/mcp-server/tools/destinationsListAttempts.ts +1 -1
- package/src/mcp-server/tools/destinationsUpdate.ts +2 -2
- package/src/mcp-server/tools/eventsList.ts +1 -1
- package/src/mcp-server/tools/{tenantsListTenants.ts → tenantsList.ts} +7 -14
- package/src/mcp-server/tools/tenantsUpsert.ts +2 -2
- package/src/models/operations/createtenantdestination.ts +4 -4
- package/src/models/operations/getattempt.ts +2 -2
- package/src/models/operations/gettenantdestinationattempt.ts +2 -2
- package/src/models/operations/listattempts.ts +209 -19
- package/src/models/operations/listevents.ts +166 -7
- package/src/models/operations/listtenantdestinationattempts.ts +127 -9
- package/src/models/operations/listtenantdestinations.ts +4 -4
- package/src/models/operations/listtenants.ts +94 -0
- package/src/models/operations/updatetenantdestination.ts +4 -4
- package/src/models/operations/upserttenant.ts +4 -4
- package/src/sdk/attempts.ts +5 -2
- package/src/sdk/destinations.ts +12 -6
- package/src/sdk/events.ts +3 -2
- package/src/sdk/tenants.ts +9 -14
- package/dist/commonjs/funcs/tenantsListTenants.d.ts.map +0 -1
- package/dist/commonjs/funcs/tenantsListTenants.js.map +0 -1
- package/dist/commonjs/mcp-server/tools/tenantsListTenants.d.ts +0 -14
- package/dist/commonjs/mcp-server/tools/tenantsListTenants.d.ts.map +0 -1
- package/dist/commonjs/mcp-server/tools/tenantsListTenants.js.map +0 -1
- package/dist/esm/funcs/tenantsListTenants.d.ts.map +0 -1
- package/dist/esm/funcs/tenantsListTenants.js.map +0 -1
- package/dist/esm/mcp-server/tools/tenantsListTenants.d.ts +0 -14
- package/dist/esm/mcp-server/tools/tenantsListTenants.d.ts.map +0 -1
- package/dist/esm/mcp-server/tools/tenantsListTenants.js.map +0 -1
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { OutpostCore } from "../core.js";
|
|
6
|
+
import { dlv } from "../lib/dlv.js";
|
|
6
7
|
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
@@ -10,7 +11,6 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
10
11
|
import { RequestOptions } from "../lib/sdks.js";
|
|
11
12
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
13
|
import { pathToFunc } from "../lib/url.js";
|
|
13
|
-
import * as components from "../models/components/index.js";
|
|
14
14
|
import {
|
|
15
15
|
ConnectionError,
|
|
16
16
|
InvalidRequestError,
|
|
@@ -25,6 +25,12 @@ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
|
25
25
|
import * as operations from "../models/operations/index.js";
|
|
26
26
|
import { APICall, APIPromise } from "../types/async.js";
|
|
27
27
|
import { Result } from "../types/fp.js";
|
|
28
|
+
import {
|
|
29
|
+
createPageIterator,
|
|
30
|
+
haltIterator,
|
|
31
|
+
PageIterator,
|
|
32
|
+
Paginator,
|
|
33
|
+
} from "../types/operations.js";
|
|
28
34
|
|
|
29
35
|
/**
|
|
30
36
|
* List Destination Attempts
|
|
@@ -37,19 +43,22 @@ export function destinationsListAttempts(
|
|
|
37
43
|
request: operations.ListTenantDestinationAttemptsRequest,
|
|
38
44
|
options?: RequestOptions,
|
|
39
45
|
): APIPromise<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
PageIterator<
|
|
47
|
+
Result<
|
|
48
|
+
operations.ListTenantDestinationAttemptsResponse,
|
|
49
|
+
| errors.UnauthorizedError
|
|
50
|
+
| errors.NotFoundError
|
|
51
|
+
| errors.InternalServerError
|
|
52
|
+
| OutpostError
|
|
53
|
+
| ResponseValidationError
|
|
54
|
+
| ConnectionError
|
|
55
|
+
| RequestAbortedError
|
|
56
|
+
| RequestTimeoutError
|
|
57
|
+
| InvalidRequestError
|
|
58
|
+
| UnexpectedClientError
|
|
59
|
+
| SDKValidationError
|
|
60
|
+
>,
|
|
61
|
+
{ cursor: string }
|
|
53
62
|
>
|
|
54
63
|
> {
|
|
55
64
|
return new APIPromise($do(
|
|
@@ -65,19 +74,22 @@ async function $do(
|
|
|
65
74
|
options?: RequestOptions,
|
|
66
75
|
): Promise<
|
|
67
76
|
[
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
PageIterator<
|
|
78
|
+
Result<
|
|
79
|
+
operations.ListTenantDestinationAttemptsResponse,
|
|
80
|
+
| errors.UnauthorizedError
|
|
81
|
+
| errors.NotFoundError
|
|
82
|
+
| errors.InternalServerError
|
|
83
|
+
| OutpostError
|
|
84
|
+
| ResponseValidationError
|
|
85
|
+
| ConnectionError
|
|
86
|
+
| RequestAbortedError
|
|
87
|
+
| RequestTimeoutError
|
|
88
|
+
| InvalidRequestError
|
|
89
|
+
| UnexpectedClientError
|
|
90
|
+
| SDKValidationError
|
|
91
|
+
>,
|
|
92
|
+
{ cursor: string }
|
|
81
93
|
>,
|
|
82
94
|
APICall,
|
|
83
95
|
]
|
|
@@ -91,7 +103,7 @@ async function $do(
|
|
|
91
103
|
"Input validation failed",
|
|
92
104
|
);
|
|
93
105
|
if (!parsed.ok) {
|
|
94
|
-
return [parsed, { status: "invalid" }];
|
|
106
|
+
return [haltIterator(parsed), { status: "invalid" }];
|
|
95
107
|
}
|
|
96
108
|
const payload = parsed.value;
|
|
97
109
|
const body = null;
|
|
@@ -120,7 +132,9 @@ async function $do(
|
|
|
120
132
|
"order_by": payload.order_by,
|
|
121
133
|
"prev": payload.prev,
|
|
122
134
|
"status": payload.status,
|
|
135
|
+
"time[gt]": payload["time[gt]"],
|
|
123
136
|
"time[gte]": payload["time[gte]"],
|
|
137
|
+
"time[lt]": payload["time[lt]"],
|
|
124
138
|
"time[lte]": payload["time[lte]"],
|
|
125
139
|
"topic": payload.topic,
|
|
126
140
|
});
|
|
@@ -160,7 +174,7 @@ async function $do(
|
|
|
160
174
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
161
175
|
}, options);
|
|
162
176
|
if (!requestRes.ok) {
|
|
163
|
-
return [requestRes, { status: "invalid" }];
|
|
177
|
+
return [haltIterator(requestRes), { status: "invalid" }];
|
|
164
178
|
}
|
|
165
179
|
const req = requestRes.value;
|
|
166
180
|
|
|
@@ -171,7 +185,7 @@ async function $do(
|
|
|
171
185
|
retryCodes: context.retryCodes,
|
|
172
186
|
});
|
|
173
187
|
if (!doResult.ok) {
|
|
174
|
-
return [doResult, { status: "request-error", request: req }];
|
|
188
|
+
return [haltIterator(doResult), { status: "request-error", request: req }];
|
|
175
189
|
}
|
|
176
190
|
const response = doResult.value;
|
|
177
191
|
|
|
@@ -179,8 +193,8 @@ async function $do(
|
|
|
179
193
|
HttpMeta: { Response: response, Request: req },
|
|
180
194
|
};
|
|
181
195
|
|
|
182
|
-
const [result] = await M.match<
|
|
183
|
-
|
|
196
|
+
const [result, raw] = await M.match<
|
|
197
|
+
operations.ListTenantDestinationAttemptsResponse,
|
|
184
198
|
| errors.UnauthorizedError
|
|
185
199
|
| errors.NotFoundError
|
|
186
200
|
| errors.InternalServerError
|
|
@@ -193,7 +207,11 @@ async function $do(
|
|
|
193
207
|
| UnexpectedClientError
|
|
194
208
|
| SDKValidationError
|
|
195
209
|
>(
|
|
196
|
-
M.json(
|
|
210
|
+
M.json(
|
|
211
|
+
200,
|
|
212
|
+
operations.ListTenantDestinationAttemptsResponse$inboundSchema,
|
|
213
|
+
{ key: "Result" },
|
|
214
|
+
),
|
|
197
215
|
M.jsonErr(401, errors.UnauthorizedError$inboundSchema),
|
|
198
216
|
M.jsonErr(404, errors.NotFoundError$inboundSchema),
|
|
199
217
|
M.jsonErr(500, errors.InternalServerError$inboundSchema),
|
|
@@ -201,8 +219,67 @@ async function $do(
|
|
|
201
219
|
M.fail("5XX"),
|
|
202
220
|
)(response, req, { extraFields: responseFields });
|
|
203
221
|
if (!result.ok) {
|
|
204
|
-
return [result, {
|
|
222
|
+
return [haltIterator(result), {
|
|
223
|
+
status: "complete",
|
|
224
|
+
request: req,
|
|
225
|
+
response,
|
|
226
|
+
}];
|
|
205
227
|
}
|
|
206
228
|
|
|
207
|
-
|
|
229
|
+
const nextFunc = (
|
|
230
|
+
responseData: unknown,
|
|
231
|
+
): {
|
|
232
|
+
next: Paginator<
|
|
233
|
+
Result<
|
|
234
|
+
operations.ListTenantDestinationAttemptsResponse,
|
|
235
|
+
| errors.UnauthorizedError
|
|
236
|
+
| errors.NotFoundError
|
|
237
|
+
| errors.InternalServerError
|
|
238
|
+
| OutpostError
|
|
239
|
+
| ResponseValidationError
|
|
240
|
+
| ConnectionError
|
|
241
|
+
| RequestAbortedError
|
|
242
|
+
| RequestTimeoutError
|
|
243
|
+
| InvalidRequestError
|
|
244
|
+
| UnexpectedClientError
|
|
245
|
+
| SDKValidationError
|
|
246
|
+
>
|
|
247
|
+
>;
|
|
248
|
+
"~next"?: { cursor: string };
|
|
249
|
+
} => {
|
|
250
|
+
const nextCursor = dlv(responseData, "pagination.next");
|
|
251
|
+
if (typeof nextCursor !== "string") {
|
|
252
|
+
return { next: () => null };
|
|
253
|
+
}
|
|
254
|
+
if (nextCursor.trim() === "") {
|
|
255
|
+
return { next: () => null };
|
|
256
|
+
}
|
|
257
|
+
const results = dlv(responseData, "models");
|
|
258
|
+
if (!Array.isArray(results) || !results.length) {
|
|
259
|
+
return { next: () => null };
|
|
260
|
+
}
|
|
261
|
+
const limit = request?.limit ?? 100;
|
|
262
|
+
if (results.length < limit) {
|
|
263
|
+
return { next: () => null };
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
const nextVal = () =>
|
|
267
|
+
destinationsListAttempts(
|
|
268
|
+
client,
|
|
269
|
+
{
|
|
270
|
+
...request,
|
|
271
|
+
next: nextCursor,
|
|
272
|
+
},
|
|
273
|
+
options,
|
|
274
|
+
);
|
|
275
|
+
|
|
276
|
+
return { next: nextVal, "~next": { cursor: nextCursor } };
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
const page = { ...result, ...nextFunc(raw) };
|
|
280
|
+
return [{ ...page, ...createPageIterator(page, (v) => !v.ok) }, {
|
|
281
|
+
status: "complete",
|
|
282
|
+
request: req,
|
|
283
|
+
response,
|
|
284
|
+
}];
|
|
208
285
|
}
|
|
@@ -36,7 +36,7 @@ export function destinationsUpdate(
|
|
|
36
36
|
client: OutpostCore,
|
|
37
37
|
tenantId: string,
|
|
38
38
|
destinationId: string,
|
|
39
|
-
|
|
39
|
+
body: components.DestinationUpdate,
|
|
40
40
|
options?: RequestOptions,
|
|
41
41
|
): APIPromise<
|
|
42
42
|
Result<
|
|
@@ -59,7 +59,7 @@ export function destinationsUpdate(
|
|
|
59
59
|
client,
|
|
60
60
|
tenantId,
|
|
61
61
|
destinationId,
|
|
62
|
-
|
|
62
|
+
body,
|
|
63
63
|
options,
|
|
64
64
|
));
|
|
65
65
|
}
|
|
@@ -68,7 +68,7 @@ async function $do(
|
|
|
68
68
|
client: OutpostCore,
|
|
69
69
|
tenantId: string,
|
|
70
70
|
destinationId: string,
|
|
71
|
-
|
|
71
|
+
body: components.DestinationUpdate,
|
|
72
72
|
options?: RequestOptions,
|
|
73
73
|
): Promise<
|
|
74
74
|
[
|
|
@@ -93,7 +93,7 @@ async function $do(
|
|
|
93
93
|
const input: operations.UpdateTenantDestinationRequest = {
|
|
94
94
|
tenantId: tenantId,
|
|
95
95
|
destinationId: destinationId,
|
|
96
|
-
|
|
96
|
+
body: body,
|
|
97
97
|
};
|
|
98
98
|
|
|
99
99
|
const parsed = safeParse(
|
|
@@ -106,7 +106,7 @@ async function $do(
|
|
|
106
106
|
return [parsed, { status: "invalid" }];
|
|
107
107
|
}
|
|
108
108
|
const payload = parsed.value;
|
|
109
|
-
const body = encodeJSON("body", payload.
|
|
109
|
+
const body$ = encodeJSON("body", payload.body, { explode: true });
|
|
110
110
|
|
|
111
111
|
const pathParams = {
|
|
112
112
|
destination_id: encodeSimple("destination_id", payload.destination_id, {
|
|
@@ -153,7 +153,7 @@ async function $do(
|
|
|
153
153
|
baseURL: options?.serverURL,
|
|
154
154
|
path: path,
|
|
155
155
|
headers: headers,
|
|
156
|
-
body: body
|
|
156
|
+
body: body$,
|
|
157
157
|
userAgent: client._options.userAgent,
|
|
158
158
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
159
159
|
}, options);
|
package/src/funcs/eventsList.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import { OutpostCore } from "../core.js";
|
|
6
|
+
import { dlv } from "../lib/dlv.js";
|
|
6
7
|
import { encodeFormQuery } from "../lib/encodings.js";
|
|
7
8
|
import * as M from "../lib/matchers.js";
|
|
8
9
|
import { compactMap } from "../lib/primitives.js";
|
|
@@ -10,7 +11,6 @@ import { safeParse } from "../lib/schemas.js";
|
|
|
10
11
|
import { RequestOptions } from "../lib/sdks.js";
|
|
11
12
|
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
13
|
import { pathToFunc } from "../lib/url.js";
|
|
13
|
-
import * as components from "../models/components/index.js";
|
|
14
14
|
import {
|
|
15
15
|
ConnectionError,
|
|
16
16
|
InvalidRequestError,
|
|
@@ -25,6 +25,12 @@ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
|
25
25
|
import * as operations from "../models/operations/index.js";
|
|
26
26
|
import { APICall, APIPromise } from "../types/async.js";
|
|
27
27
|
import { Result } from "../types/fp.js";
|
|
28
|
+
import {
|
|
29
|
+
createPageIterator,
|
|
30
|
+
haltIterator,
|
|
31
|
+
PageIterator,
|
|
32
|
+
Paginator,
|
|
33
|
+
} from "../types/operations.js";
|
|
28
34
|
|
|
29
35
|
/**
|
|
30
36
|
* List Events
|
|
@@ -40,18 +46,21 @@ export function eventsList(
|
|
|
40
46
|
request: operations.ListEventsRequest,
|
|
41
47
|
options?: RequestOptions,
|
|
42
48
|
): APIPromise<
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
PageIterator<
|
|
50
|
+
Result<
|
|
51
|
+
operations.ListEventsResponse,
|
|
52
|
+
| errors.UnauthorizedError
|
|
53
|
+
| errors.InternalServerError
|
|
54
|
+
| OutpostError
|
|
55
|
+
| ResponseValidationError
|
|
56
|
+
| ConnectionError
|
|
57
|
+
| RequestAbortedError
|
|
58
|
+
| RequestTimeoutError
|
|
59
|
+
| InvalidRequestError
|
|
60
|
+
| UnexpectedClientError
|
|
61
|
+
| SDKValidationError
|
|
62
|
+
>,
|
|
63
|
+
{ cursor: string }
|
|
55
64
|
>
|
|
56
65
|
> {
|
|
57
66
|
return new APIPromise($do(
|
|
@@ -67,18 +76,21 @@ async function $do(
|
|
|
67
76
|
options?: RequestOptions,
|
|
68
77
|
): Promise<
|
|
69
78
|
[
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
PageIterator<
|
|
80
|
+
Result<
|
|
81
|
+
operations.ListEventsResponse,
|
|
82
|
+
| errors.UnauthorizedError
|
|
83
|
+
| errors.InternalServerError
|
|
84
|
+
| OutpostError
|
|
85
|
+
| ResponseValidationError
|
|
86
|
+
| ConnectionError
|
|
87
|
+
| RequestAbortedError
|
|
88
|
+
| RequestTimeoutError
|
|
89
|
+
| InvalidRequestError
|
|
90
|
+
| UnexpectedClientError
|
|
91
|
+
| SDKValidationError
|
|
92
|
+
>,
|
|
93
|
+
{ cursor: string }
|
|
82
94
|
>,
|
|
83
95
|
APICall,
|
|
84
96
|
]
|
|
@@ -89,7 +101,7 @@ async function $do(
|
|
|
89
101
|
"Input validation failed",
|
|
90
102
|
);
|
|
91
103
|
if (!parsed.ok) {
|
|
92
|
-
return [parsed, { status: "invalid" }];
|
|
104
|
+
return [haltIterator(parsed), { status: "invalid" }];
|
|
93
105
|
}
|
|
94
106
|
const payload = parsed.value;
|
|
95
107
|
const body = null;
|
|
@@ -98,12 +110,15 @@ async function $do(
|
|
|
98
110
|
|
|
99
111
|
const query = encodeFormQuery({
|
|
100
112
|
"dir": payload.dir,
|
|
113
|
+
"id": payload.id,
|
|
101
114
|
"limit": payload.limit,
|
|
102
115
|
"next": payload.next,
|
|
103
116
|
"order_by": payload.order_by,
|
|
104
117
|
"prev": payload.prev,
|
|
105
118
|
"tenant_id": payload.tenant_id,
|
|
119
|
+
"time[gt]": payload["time[gt]"],
|
|
106
120
|
"time[gte]": payload["time[gte]"],
|
|
121
|
+
"time[lt]": payload["time[lt]"],
|
|
107
122
|
"time[lte]": payload["time[lte]"],
|
|
108
123
|
"topic": payload.topic,
|
|
109
124
|
});
|
|
@@ -143,7 +158,7 @@ async function $do(
|
|
|
143
158
|
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
144
159
|
}, options);
|
|
145
160
|
if (!requestRes.ok) {
|
|
146
|
-
return [requestRes, { status: "invalid" }];
|
|
161
|
+
return [haltIterator(requestRes), { status: "invalid" }];
|
|
147
162
|
}
|
|
148
163
|
const req = requestRes.value;
|
|
149
164
|
|
|
@@ -154,7 +169,7 @@ async function $do(
|
|
|
154
169
|
retryCodes: context.retryCodes,
|
|
155
170
|
});
|
|
156
171
|
if (!doResult.ok) {
|
|
157
|
-
return [doResult, { status: "request-error", request: req }];
|
|
172
|
+
return [haltIterator(doResult), { status: "request-error", request: req }];
|
|
158
173
|
}
|
|
159
174
|
const response = doResult.value;
|
|
160
175
|
|
|
@@ -162,8 +177,8 @@ async function $do(
|
|
|
162
177
|
HttpMeta: { Response: response, Request: req },
|
|
163
178
|
};
|
|
164
179
|
|
|
165
|
-
const [result] = await M.match<
|
|
166
|
-
|
|
180
|
+
const [result, raw] = await M.match<
|
|
181
|
+
operations.ListEventsResponse,
|
|
167
182
|
| errors.UnauthorizedError
|
|
168
183
|
| errors.InternalServerError
|
|
169
184
|
| OutpostError
|
|
@@ -175,15 +190,73 @@ async function $do(
|
|
|
175
190
|
| UnexpectedClientError
|
|
176
191
|
| SDKValidationError
|
|
177
192
|
>(
|
|
178
|
-
M.json(200,
|
|
193
|
+
M.json(200, operations.ListEventsResponse$inboundSchema, { key: "Result" }),
|
|
179
194
|
M.jsonErr(401, errors.UnauthorizedError$inboundSchema),
|
|
180
195
|
M.jsonErr(500, errors.InternalServerError$inboundSchema),
|
|
181
196
|
M.fail("4XX"),
|
|
182
197
|
M.fail("5XX"),
|
|
183
198
|
)(response, req, { extraFields: responseFields });
|
|
184
199
|
if (!result.ok) {
|
|
185
|
-
return [result, {
|
|
200
|
+
return [haltIterator(result), {
|
|
201
|
+
status: "complete",
|
|
202
|
+
request: req,
|
|
203
|
+
response,
|
|
204
|
+
}];
|
|
186
205
|
}
|
|
187
206
|
|
|
188
|
-
|
|
207
|
+
const nextFunc = (
|
|
208
|
+
responseData: unknown,
|
|
209
|
+
): {
|
|
210
|
+
next: Paginator<
|
|
211
|
+
Result<
|
|
212
|
+
operations.ListEventsResponse,
|
|
213
|
+
| errors.UnauthorizedError
|
|
214
|
+
| errors.InternalServerError
|
|
215
|
+
| OutpostError
|
|
216
|
+
| ResponseValidationError
|
|
217
|
+
| ConnectionError
|
|
218
|
+
| RequestAbortedError
|
|
219
|
+
| RequestTimeoutError
|
|
220
|
+
| InvalidRequestError
|
|
221
|
+
| UnexpectedClientError
|
|
222
|
+
| SDKValidationError
|
|
223
|
+
>
|
|
224
|
+
>;
|
|
225
|
+
"~next"?: { cursor: string };
|
|
226
|
+
} => {
|
|
227
|
+
const nextCursor = dlv(responseData, "pagination.next");
|
|
228
|
+
if (typeof nextCursor !== "string") {
|
|
229
|
+
return { next: () => null };
|
|
230
|
+
}
|
|
231
|
+
if (nextCursor.trim() === "") {
|
|
232
|
+
return { next: () => null };
|
|
233
|
+
}
|
|
234
|
+
const results = dlv(responseData, "models");
|
|
235
|
+
if (!Array.isArray(results) || !results.length) {
|
|
236
|
+
return { next: () => null };
|
|
237
|
+
}
|
|
238
|
+
const limit = request?.limit ?? 100;
|
|
239
|
+
if (results.length < limit) {
|
|
240
|
+
return { next: () => null };
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
const nextVal = () =>
|
|
244
|
+
eventsList(
|
|
245
|
+
client,
|
|
246
|
+
{
|
|
247
|
+
...request,
|
|
248
|
+
next: nextCursor,
|
|
249
|
+
},
|
|
250
|
+
options,
|
|
251
|
+
);
|
|
252
|
+
|
|
253
|
+
return { next: nextVal, "~next": { cursor: nextCursor } };
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
const page = { ...result, ...nextFunc(raw) };
|
|
257
|
+
return [{ ...page, ...createPageIterator(page, (v) => !v.ok) }, {
|
|
258
|
+
status: "complete",
|
|
259
|
+
request: req,
|
|
260
|
+
response,
|
|
261
|
+
}];
|
|
189
262
|
}
|