@inkeep/agents-manage-mcp 0.0.0-dev-20251212042017 → 0.0.0-dev-20251212052636
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/package.json +1 -1
- package/src/funcs/invitationsGetApiInvitationsPending.ts +50 -57
- package/src/funcs/playgroundCreatePlaygroundToken.ts +60 -72
- package/src/funcs/userOrganizationsGetApiUsersUserIdOrganizations.ts +50 -59
- package/src/funcs/userOrganizationsPostApiUsersUserIdOrganizations.ts +52 -61
- package/src/mcp-server/tools/invitationsGetApiInvitationsPending.ts +14 -18
- package/src/mcp-server/tools/userOrganizationsGetApiUsersUserIdOrganizations.ts +30 -32
- package/src/mcp-server/tools/userOrganizationsPostApiUsersUserIdOrganizations.ts +30 -32
- package/src/models/createplaygroundtokenop.ts +14 -10
- package/src/models/getapiinvitationspendingop.ts +6 -5
- package/src/models/getapiusersuseridorganizationsop.ts +7 -8
- package/src/models/postapiusersuseridorganizationsop.ts +12 -12
- package/src/models/security.ts +11 -8
- package/tsup.config.ts +4 -4
package/package.json
CHANGED
|
@@ -2,31 +2,31 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { InkeepAgentsCore } from
|
|
6
|
-
import { encodeFormQuery } from
|
|
7
|
-
import * as M from
|
|
8
|
-
import { compactMap } from
|
|
9
|
-
import { safeParse } from
|
|
10
|
-
import { RequestOptions } from
|
|
11
|
-
import { extractSecurity, resolveGlobalSecurity } from
|
|
12
|
-
import { pathToFunc } from
|
|
13
|
-
import { APIError } from
|
|
5
|
+
import { InkeepAgentsCore } from '../core.js';
|
|
6
|
+
import { encodeFormQuery } 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 { APIError } from '../models/errors/apierror.js';
|
|
14
14
|
import {
|
|
15
15
|
ConnectionError,
|
|
16
16
|
InvalidRequestError,
|
|
17
17
|
RequestAbortedError,
|
|
18
18
|
RequestTimeoutError,
|
|
19
19
|
UnexpectedClientError,
|
|
20
|
-
} from
|
|
21
|
-
import { SDKValidationError } from
|
|
20
|
+
} from '../models/errors/httpclienterrors.js';
|
|
21
|
+
import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
|
|
22
22
|
import {
|
|
23
23
|
GetApiInvitationsPendingRequest,
|
|
24
24
|
GetApiInvitationsPendingRequest$zodSchema,
|
|
25
25
|
GetApiInvitationsPendingResponse,
|
|
26
26
|
GetApiInvitationsPendingResponse$zodSchema,
|
|
27
|
-
} from
|
|
28
|
-
import { APICall, APIPromise } from
|
|
29
|
-
import { Result } from
|
|
27
|
+
} from '../models/getapiinvitationspendingop.js';
|
|
28
|
+
import { APICall, APIPromise } from '../types/async.js';
|
|
29
|
+
import { Result } from '../types/fp.js';
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* Get pending invitations
|
|
@@ -37,7 +37,7 @@ import { Result } from "../types/fp.js";
|
|
|
37
37
|
export function invitationsGetApiInvitationsPending(
|
|
38
38
|
client$: InkeepAgentsCore,
|
|
39
39
|
request: GetApiInvitationsPendingRequest,
|
|
40
|
-
options?: RequestOptions
|
|
40
|
+
options?: RequestOptions
|
|
41
41
|
): APIPromise<
|
|
42
42
|
Result<
|
|
43
43
|
GetApiInvitationsPendingResponse,
|
|
@@ -50,17 +50,13 @@ export function invitationsGetApiInvitationsPending(
|
|
|
50
50
|
| ConnectionError
|
|
51
51
|
>
|
|
52
52
|
> {
|
|
53
|
-
return new APIPromise($do(
|
|
54
|
-
client$,
|
|
55
|
-
request,
|
|
56
|
-
options,
|
|
57
|
-
));
|
|
53
|
+
return new APIPromise($do(client$, request, options));
|
|
58
54
|
}
|
|
59
55
|
|
|
60
56
|
async function $do(
|
|
61
57
|
client$: InkeepAgentsCore,
|
|
62
58
|
request: GetApiInvitationsPendingRequest,
|
|
63
|
-
options?: RequestOptions
|
|
59
|
+
options?: RequestOptions
|
|
64
60
|
): Promise<
|
|
65
61
|
[
|
|
66
62
|
Result<
|
|
@@ -79,57 +75,54 @@ async function $do(
|
|
|
79
75
|
const parsed$ = safeParse(
|
|
80
76
|
request,
|
|
81
77
|
(value$) => GetApiInvitationsPendingRequest$zodSchema.parse(value$),
|
|
82
|
-
|
|
78
|
+
'Input validation failed'
|
|
83
79
|
);
|
|
84
80
|
if (!parsed$.ok) {
|
|
85
|
-
return [parsed$, { status:
|
|
81
|
+
return [parsed$, { status: 'invalid' }];
|
|
86
82
|
}
|
|
87
83
|
const payload$ = parsed$.value;
|
|
88
84
|
const body$ = null;
|
|
89
|
-
const path$ = pathToFunc(
|
|
85
|
+
const path$ = pathToFunc('/api/invitations/pending')();
|
|
90
86
|
const query$ = encodeFormQuery({
|
|
91
|
-
|
|
87
|
+
email: payload$.email,
|
|
92
88
|
});
|
|
93
89
|
|
|
94
|
-
const headers$ = new Headers(
|
|
95
|
-
|
|
96
|
-
|
|
90
|
+
const headers$ = new Headers(
|
|
91
|
+
compactMap({
|
|
92
|
+
Accept: 'application/json',
|
|
93
|
+
})
|
|
94
|
+
);
|
|
97
95
|
const securityInput = await extractSecurity(client$._options.security);
|
|
98
96
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
99
97
|
|
|
100
98
|
const context = {
|
|
101
99
|
options: client$._options,
|
|
102
|
-
baseURL: options?.serverURL ?? client$._baseURL ??
|
|
103
|
-
operationID:
|
|
100
|
+
baseURL: options?.serverURL ?? client$._baseURL ?? '',
|
|
101
|
+
operationID: 'get_/api/invitations/pending',
|
|
104
102
|
oAuth2Scopes: null,
|
|
105
103
|
resolvedSecurity: requestSecurity,
|
|
106
104
|
securitySource: client$._options.security,
|
|
107
|
-
retryConfig: options?.retries
|
|
108
|
-
|
|
109
|
-
|| { strategy: "none" },
|
|
110
|
-
retryCodes: options?.retryCodes || [
|
|
111
|
-
"429",
|
|
112
|
-
"500",
|
|
113
|
-
"502",
|
|
114
|
-
"503",
|
|
115
|
-
"504",
|
|
116
|
-
],
|
|
105
|
+
retryConfig: options?.retries || client$._options.retryConfig || { strategy: 'none' },
|
|
106
|
+
retryCodes: options?.retryCodes || ['429', '500', '502', '503', '504'],
|
|
117
107
|
};
|
|
118
108
|
|
|
119
|
-
const requestRes = client$._createRequest(
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
109
|
+
const requestRes = client$._createRequest(
|
|
110
|
+
context,
|
|
111
|
+
{
|
|
112
|
+
security: requestSecurity,
|
|
113
|
+
method: 'GET',
|
|
114
|
+
baseURL: options?.serverURL,
|
|
115
|
+
path: path$,
|
|
116
|
+
headers: headers$,
|
|
117
|
+
query: query$,
|
|
118
|
+
body: body$,
|
|
119
|
+
userAgent: client$._options.userAgent,
|
|
120
|
+
timeoutMs: options?.timeoutMs || client$._options.timeoutMs || -1,
|
|
121
|
+
},
|
|
122
|
+
options
|
|
123
|
+
);
|
|
131
124
|
if (!requestRes.ok) {
|
|
132
|
-
return [requestRes, { status:
|
|
125
|
+
return [requestRes, { status: 'invalid' }];
|
|
133
126
|
}
|
|
134
127
|
const req$ = requestRes.value;
|
|
135
128
|
|
|
@@ -140,7 +133,7 @@ async function $do(
|
|
|
140
133
|
retryCodes: context.retryCodes,
|
|
141
134
|
});
|
|
142
135
|
if (!doResult.ok) {
|
|
143
|
-
return [doResult, { status:
|
|
136
|
+
return [doResult, { status: 'request-error', request: req$ }];
|
|
144
137
|
}
|
|
145
138
|
const response = doResult.value;
|
|
146
139
|
const responseFields$ = {
|
|
@@ -158,9 +151,9 @@ async function $do(
|
|
|
158
151
|
| ConnectionError
|
|
159
152
|
>(
|
|
160
153
|
M.json(200, GetApiInvitationsPendingResponse$zodSchema, {
|
|
161
|
-
key:
|
|
162
|
-
})
|
|
154
|
+
key: 'ResponseBodies',
|
|
155
|
+
})
|
|
163
156
|
)(response, req$, { extraFields: responseFields$ });
|
|
164
157
|
|
|
165
|
-
return [result$, { status:
|
|
158
|
+
return [result$, { status: 'complete', request: req$, response }];
|
|
166
159
|
}
|
|
@@ -2,32 +2,32 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { InkeepAgentsCore } from
|
|
6
|
-
import { encodeJSON, encodeSimple } from
|
|
7
|
-
import * as M from
|
|
8
|
-
import { compactMap } from
|
|
9
|
-
import { safeParse } from
|
|
10
|
-
import { RequestOptions } from
|
|
11
|
-
import { resolveSecurity } from
|
|
12
|
-
import { pathToFunc } from
|
|
5
|
+
import { InkeepAgentsCore } 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 { resolveSecurity } from '../lib/security.js';
|
|
12
|
+
import { pathToFunc } from '../lib/url.js';
|
|
13
13
|
import {
|
|
14
14
|
CreatePlaygroundTokenRequest,
|
|
15
15
|
CreatePlaygroundTokenRequest$zodSchema,
|
|
16
16
|
CreatePlaygroundTokenResponse,
|
|
17
17
|
CreatePlaygroundTokenResponse$zodSchema,
|
|
18
18
|
CreatePlaygroundTokenSecurity,
|
|
19
|
-
} from
|
|
20
|
-
import { APIError } from
|
|
19
|
+
} from '../models/createplaygroundtokenop.js';
|
|
20
|
+
import { APIError } from '../models/errors/apierror.js';
|
|
21
21
|
import {
|
|
22
22
|
ConnectionError,
|
|
23
23
|
InvalidRequestError,
|
|
24
24
|
RequestAbortedError,
|
|
25
25
|
RequestTimeoutError,
|
|
26
26
|
UnexpectedClientError,
|
|
27
|
-
} from
|
|
28
|
-
import { SDKValidationError } from
|
|
29
|
-
import { APICall, APIPromise } from
|
|
30
|
-
import { Result } from
|
|
27
|
+
} from '../models/errors/httpclienterrors.js';
|
|
28
|
+
import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
|
|
29
|
+
import { APICall, APIPromise } from '../types/async.js';
|
|
30
|
+
import { Result } from '../types/fp.js';
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Generate temporary API key for playground
|
|
@@ -39,7 +39,7 @@ export function playgroundCreatePlaygroundToken(
|
|
|
39
39
|
client$: InkeepAgentsCore,
|
|
40
40
|
security: CreatePlaygroundTokenSecurity,
|
|
41
41
|
request: CreatePlaygroundTokenRequest,
|
|
42
|
-
options?: RequestOptions
|
|
42
|
+
options?: RequestOptions
|
|
43
43
|
): APIPromise<
|
|
44
44
|
Result<
|
|
45
45
|
CreatePlaygroundTokenResponse,
|
|
@@ -52,19 +52,14 @@ export function playgroundCreatePlaygroundToken(
|
|
|
52
52
|
| ConnectionError
|
|
53
53
|
>
|
|
54
54
|
> {
|
|
55
|
-
return new APIPromise($do(
|
|
56
|
-
client$,
|
|
57
|
-
security,
|
|
58
|
-
request,
|
|
59
|
-
options,
|
|
60
|
-
));
|
|
55
|
+
return new APIPromise($do(client$, security, request, options));
|
|
61
56
|
}
|
|
62
57
|
|
|
63
58
|
async function $do(
|
|
64
59
|
client$: InkeepAgentsCore,
|
|
65
60
|
security: CreatePlaygroundTokenSecurity,
|
|
66
61
|
request: CreatePlaygroundTokenRequest,
|
|
67
|
-
options?: RequestOptions
|
|
62
|
+
options?: RequestOptions
|
|
68
63
|
): Promise<
|
|
69
64
|
[
|
|
70
65
|
Result<
|
|
@@ -83,71 +78,64 @@ async function $do(
|
|
|
83
78
|
const parsed$ = safeParse(
|
|
84
79
|
request,
|
|
85
80
|
(value$) => CreatePlaygroundTokenRequest$zodSchema.parse(value$),
|
|
86
|
-
|
|
81
|
+
'Input validation failed'
|
|
87
82
|
);
|
|
88
83
|
if (!parsed$.ok) {
|
|
89
|
-
return [parsed$, { status:
|
|
84
|
+
return [parsed$, { status: 'invalid' }];
|
|
90
85
|
}
|
|
91
86
|
const payload$ = parsed$.value;
|
|
92
|
-
const body$ = encodeJSON(
|
|
87
|
+
const body$ = encodeJSON('body', payload$.body, { explode: true });
|
|
93
88
|
|
|
94
89
|
const pathParams$ = {
|
|
95
|
-
tenantId: encodeSimple(
|
|
90
|
+
tenantId: encodeSimple('tenantId', payload$.tenantId, {
|
|
96
91
|
explode: false,
|
|
97
|
-
charEncoding:
|
|
92
|
+
charEncoding: 'percent',
|
|
98
93
|
}),
|
|
99
94
|
};
|
|
100
|
-
const path$ = pathToFunc(
|
|
101
|
-
pathParams$,
|
|
102
|
-
);
|
|
95
|
+
const path$ = pathToFunc('/tenants/{tenantId}/playground/token')(pathParams$);
|
|
103
96
|
|
|
104
|
-
const headers$ = new Headers(
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
const requestSecurity = resolveSecurity(
|
|
110
|
-
[
|
|
111
|
-
{
|
|
112
|
-
fieldName: "better-auth.session_token",
|
|
113
|
-
type: "apiKey:cookie",
|
|
114
|
-
value: security?.cookieAuth,
|
|
115
|
-
},
|
|
116
|
-
],
|
|
97
|
+
const headers$ = new Headers(
|
|
98
|
+
compactMap({
|
|
99
|
+
'Content-Type': 'application/json',
|
|
100
|
+
Accept: 'application/json',
|
|
101
|
+
})
|
|
117
102
|
);
|
|
118
103
|
|
|
104
|
+
const requestSecurity = resolveSecurity([
|
|
105
|
+
{
|
|
106
|
+
fieldName: 'better-auth.session_token',
|
|
107
|
+
type: 'apiKey:cookie',
|
|
108
|
+
value: security?.cookieAuth,
|
|
109
|
+
},
|
|
110
|
+
]);
|
|
111
|
+
|
|
119
112
|
const context = {
|
|
120
113
|
options: client$._options,
|
|
121
|
-
baseURL: options?.serverURL ?? client$._baseURL ??
|
|
122
|
-
operationID:
|
|
114
|
+
baseURL: options?.serverURL ?? client$._baseURL ?? '',
|
|
115
|
+
operationID: 'create-playground-token',
|
|
123
116
|
oAuth2Scopes: null,
|
|
124
117
|
resolvedSecurity: requestSecurity,
|
|
125
118
|
securitySource: security,
|
|
126
|
-
retryConfig: options?.retries
|
|
127
|
-
|
|
128
|
-
|| { strategy: "none" },
|
|
129
|
-
retryCodes: options?.retryCodes || [
|
|
130
|
-
"429",
|
|
131
|
-
"500",
|
|
132
|
-
"502",
|
|
133
|
-
"503",
|
|
134
|
-
"504",
|
|
135
|
-
],
|
|
119
|
+
retryConfig: options?.retries || client$._options.retryConfig || { strategy: 'none' },
|
|
120
|
+
retryCodes: options?.retryCodes || ['429', '500', '502', '503', '504'],
|
|
136
121
|
};
|
|
137
122
|
|
|
138
|
-
const requestRes = client$._createRequest(
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
123
|
+
const requestRes = client$._createRequest(
|
|
124
|
+
context,
|
|
125
|
+
{
|
|
126
|
+
security: requestSecurity,
|
|
127
|
+
method: 'POST',
|
|
128
|
+
baseURL: options?.serverURL,
|
|
129
|
+
path: path$,
|
|
130
|
+
headers: headers$,
|
|
131
|
+
body: body$,
|
|
132
|
+
userAgent: client$._options.userAgent,
|
|
133
|
+
timeoutMs: options?.timeoutMs || client$._options.timeoutMs || -1,
|
|
134
|
+
},
|
|
135
|
+
options
|
|
136
|
+
);
|
|
149
137
|
if (!requestRes.ok) {
|
|
150
|
-
return [requestRes, { status:
|
|
138
|
+
return [requestRes, { status: 'invalid' }];
|
|
151
139
|
}
|
|
152
140
|
const req$ = requestRes.value;
|
|
153
141
|
|
|
@@ -158,7 +146,7 @@ async function $do(
|
|
|
158
146
|
retryCodes: context.retryCodes,
|
|
159
147
|
});
|
|
160
148
|
if (!doResult.ok) {
|
|
161
|
-
return [doResult, { status:
|
|
149
|
+
return [doResult, { status: 'request-error', request: req$ }];
|
|
162
150
|
}
|
|
163
151
|
const response = doResult.value;
|
|
164
152
|
const responseFields$ = {
|
|
@@ -175,11 +163,11 @@ async function $do(
|
|
|
175
163
|
| RequestTimeoutError
|
|
176
164
|
| ConnectionError
|
|
177
165
|
>(
|
|
178
|
-
M.json(200, CreatePlaygroundTokenResponse$zodSchema, { key:
|
|
166
|
+
M.json(200, CreatePlaygroundTokenResponse$zodSchema, { key: 'object' }),
|
|
179
167
|
M.json(401, CreatePlaygroundTokenResponse$zodSchema, {
|
|
180
|
-
key:
|
|
181
|
-
})
|
|
168
|
+
key: 'ErrorResponse',
|
|
169
|
+
})
|
|
182
170
|
)(response, req$, { extraFields: responseFields$ });
|
|
183
171
|
|
|
184
|
-
return [result$, { status:
|
|
172
|
+
return [result$, { status: 'complete', request: req$, response }];
|
|
185
173
|
}
|
|
@@ -2,31 +2,31 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { InkeepAgentsCore } from
|
|
6
|
-
import { encodeSimple } from
|
|
7
|
-
import * as M from
|
|
8
|
-
import { compactMap } from
|
|
9
|
-
import { safeParse } from
|
|
10
|
-
import { RequestOptions } from
|
|
11
|
-
import { extractSecurity, resolveGlobalSecurity } from
|
|
12
|
-
import { pathToFunc } from
|
|
13
|
-
import { APIError } from
|
|
5
|
+
import { InkeepAgentsCore } from '../core.js';
|
|
6
|
+
import { 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 { APIError } from '../models/errors/apierror.js';
|
|
14
14
|
import {
|
|
15
15
|
ConnectionError,
|
|
16
16
|
InvalidRequestError,
|
|
17
17
|
RequestAbortedError,
|
|
18
18
|
RequestTimeoutError,
|
|
19
19
|
UnexpectedClientError,
|
|
20
|
-
} from
|
|
21
|
-
import { SDKValidationError } from
|
|
20
|
+
} from '../models/errors/httpclienterrors.js';
|
|
21
|
+
import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
|
|
22
22
|
import {
|
|
23
23
|
GetApiUsersUserIdOrganizationsRequest,
|
|
24
24
|
GetApiUsersUserIdOrganizationsRequest$zodSchema,
|
|
25
25
|
GetApiUsersUserIdOrganizationsResponse,
|
|
26
26
|
GetApiUsersUserIdOrganizationsResponse$zodSchema,
|
|
27
|
-
} from
|
|
28
|
-
import { APICall, APIPromise } from
|
|
29
|
-
import { Result } from
|
|
27
|
+
} from '../models/getapiusersuseridorganizationsop.js';
|
|
28
|
+
import { APICall, APIPromise } from '../types/async.js';
|
|
29
|
+
import { Result } from '../types/fp.js';
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* List user organizations
|
|
@@ -37,7 +37,7 @@ import { Result } from "../types/fp.js";
|
|
|
37
37
|
export function userOrganizationsGetApiUsersUserIdOrganizations(
|
|
38
38
|
client$: InkeepAgentsCore,
|
|
39
39
|
request: GetApiUsersUserIdOrganizationsRequest,
|
|
40
|
-
options?: RequestOptions
|
|
40
|
+
options?: RequestOptions
|
|
41
41
|
): APIPromise<
|
|
42
42
|
Result<
|
|
43
43
|
GetApiUsersUserIdOrganizationsResponse,
|
|
@@ -50,17 +50,13 @@ export function userOrganizationsGetApiUsersUserIdOrganizations(
|
|
|
50
50
|
| ConnectionError
|
|
51
51
|
>
|
|
52
52
|
> {
|
|
53
|
-
return new APIPromise($do(
|
|
54
|
-
client$,
|
|
55
|
-
request,
|
|
56
|
-
options,
|
|
57
|
-
));
|
|
53
|
+
return new APIPromise($do(client$, request, options));
|
|
58
54
|
}
|
|
59
55
|
|
|
60
56
|
async function $do(
|
|
61
57
|
client$: InkeepAgentsCore,
|
|
62
58
|
request: GetApiUsersUserIdOrganizationsRequest,
|
|
63
|
-
options?: RequestOptions
|
|
59
|
+
options?: RequestOptions
|
|
64
60
|
): Promise<
|
|
65
61
|
[
|
|
66
62
|
Result<
|
|
@@ -79,62 +75,57 @@ async function $do(
|
|
|
79
75
|
const parsed$ = safeParse(
|
|
80
76
|
request,
|
|
81
77
|
(value$) => GetApiUsersUserIdOrganizationsRequest$zodSchema.parse(value$),
|
|
82
|
-
|
|
78
|
+
'Input validation failed'
|
|
83
79
|
);
|
|
84
80
|
if (!parsed$.ok) {
|
|
85
|
-
return [parsed$, { status:
|
|
81
|
+
return [parsed$, { status: 'invalid' }];
|
|
86
82
|
}
|
|
87
83
|
const payload$ = parsed$.value;
|
|
88
84
|
const body$ = null;
|
|
89
85
|
|
|
90
86
|
const pathParams$ = {
|
|
91
|
-
userId: encodeSimple(
|
|
87
|
+
userId: encodeSimple('userId', payload$.userId, {
|
|
92
88
|
explode: false,
|
|
93
|
-
charEncoding:
|
|
89
|
+
charEncoding: 'percent',
|
|
94
90
|
}),
|
|
95
91
|
};
|
|
96
|
-
const path$ = pathToFunc(
|
|
97
|
-
pathParams$,
|
|
98
|
-
);
|
|
92
|
+
const path$ = pathToFunc('/api/users/{userId}/organizations')(pathParams$);
|
|
99
93
|
|
|
100
|
-
const headers$ = new Headers(
|
|
101
|
-
|
|
102
|
-
|
|
94
|
+
const headers$ = new Headers(
|
|
95
|
+
compactMap({
|
|
96
|
+
Accept: 'application/json',
|
|
97
|
+
})
|
|
98
|
+
);
|
|
103
99
|
const securityInput = await extractSecurity(client$._options.security);
|
|
104
100
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
105
101
|
|
|
106
102
|
const context = {
|
|
107
103
|
options: client$._options,
|
|
108
|
-
baseURL: options?.serverURL ?? client$._baseURL ??
|
|
109
|
-
operationID:
|
|
104
|
+
baseURL: options?.serverURL ?? client$._baseURL ?? '',
|
|
105
|
+
operationID: 'get_/api/users/{userId}/organizations',
|
|
110
106
|
oAuth2Scopes: null,
|
|
111
107
|
resolvedSecurity: requestSecurity,
|
|
112
108
|
securitySource: client$._options.security,
|
|
113
|
-
retryConfig: options?.retries
|
|
114
|
-
|
|
115
|
-
|| { strategy: "none" },
|
|
116
|
-
retryCodes: options?.retryCodes || [
|
|
117
|
-
"429",
|
|
118
|
-
"500",
|
|
119
|
-
"502",
|
|
120
|
-
"503",
|
|
121
|
-
"504",
|
|
122
|
-
],
|
|
109
|
+
retryConfig: options?.retries || client$._options.retryConfig || { strategy: 'none' },
|
|
110
|
+
retryCodes: options?.retryCodes || ['429', '500', '502', '503', '504'],
|
|
123
111
|
};
|
|
124
112
|
|
|
125
|
-
const requestRes = client$._createRequest(
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
113
|
+
const requestRes = client$._createRequest(
|
|
114
|
+
context,
|
|
115
|
+
{
|
|
116
|
+
security: requestSecurity,
|
|
117
|
+
method: 'GET',
|
|
118
|
+
baseURL: options?.serverURL,
|
|
119
|
+
path: path$,
|
|
120
|
+
headers: headers$,
|
|
121
|
+
body: body$,
|
|
122
|
+
userAgent: client$._options.userAgent,
|
|
123
|
+
timeoutMs: options?.timeoutMs || client$._options.timeoutMs || -1,
|
|
124
|
+
},
|
|
125
|
+
options
|
|
126
|
+
);
|
|
136
127
|
if (!requestRes.ok) {
|
|
137
|
-
return [requestRes, { status:
|
|
128
|
+
return [requestRes, { status: 'invalid' }];
|
|
138
129
|
}
|
|
139
130
|
const req$ = requestRes.value;
|
|
140
131
|
|
|
@@ -145,7 +136,7 @@ async function $do(
|
|
|
145
136
|
retryCodes: context.retryCodes,
|
|
146
137
|
});
|
|
147
138
|
if (!doResult.ok) {
|
|
148
|
-
return [doResult, { status:
|
|
139
|
+
return [doResult, { status: 'request-error', request: req$ }];
|
|
149
140
|
}
|
|
150
141
|
const response = doResult.value;
|
|
151
142
|
const responseFields$ = {
|
|
@@ -163,9 +154,9 @@ async function $do(
|
|
|
163
154
|
| ConnectionError
|
|
164
155
|
>(
|
|
165
156
|
M.json(200, GetApiUsersUserIdOrganizationsResponse$zodSchema, {
|
|
166
|
-
key:
|
|
167
|
-
})
|
|
157
|
+
key: 'ResponseBodies',
|
|
158
|
+
})
|
|
168
159
|
)(response, req$, { extraFields: responseFields$ });
|
|
169
160
|
|
|
170
|
-
return [result$, { status:
|
|
161
|
+
return [result$, { status: 'complete', request: req$, response }];
|
|
171
162
|
}
|
|
@@ -2,31 +2,31 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { InkeepAgentsCore } from
|
|
6
|
-
import { encodeJSON, encodeSimple } from
|
|
7
|
-
import * as M from
|
|
8
|
-
import { compactMap } from
|
|
9
|
-
import { safeParse } from
|
|
10
|
-
import { RequestOptions } from
|
|
11
|
-
import { extractSecurity, resolveGlobalSecurity } from
|
|
12
|
-
import { pathToFunc } from
|
|
13
|
-
import { APIError } from
|
|
5
|
+
import { InkeepAgentsCore } 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 { APIError } from '../models/errors/apierror.js';
|
|
14
14
|
import {
|
|
15
15
|
ConnectionError,
|
|
16
16
|
InvalidRequestError,
|
|
17
17
|
RequestAbortedError,
|
|
18
18
|
RequestTimeoutError,
|
|
19
19
|
UnexpectedClientError,
|
|
20
|
-
} from
|
|
21
|
-
import { SDKValidationError } from
|
|
20
|
+
} from '../models/errors/httpclienterrors.js';
|
|
21
|
+
import { SDKValidationError } from '../models/errors/sdkvalidationerror.js';
|
|
22
22
|
import {
|
|
23
23
|
PostApiUsersUserIdOrganizationsRequest,
|
|
24
24
|
PostApiUsersUserIdOrganizationsRequest$zodSchema,
|
|
25
25
|
PostApiUsersUserIdOrganizationsResponse,
|
|
26
26
|
PostApiUsersUserIdOrganizationsResponse$zodSchema,
|
|
27
|
-
} from
|
|
28
|
-
import { APICall, APIPromise } from
|
|
29
|
-
import { Result } from
|
|
27
|
+
} from '../models/postapiusersuseridorganizationsop.js';
|
|
28
|
+
import { APICall, APIPromise } from '../types/async.js';
|
|
29
|
+
import { Result } from '../types/fp.js';
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* Add user to organization
|
|
@@ -37,7 +37,7 @@ import { Result } from "../types/fp.js";
|
|
|
37
37
|
export function userOrganizationsPostApiUsersUserIdOrganizations(
|
|
38
38
|
client$: InkeepAgentsCore,
|
|
39
39
|
request: PostApiUsersUserIdOrganizationsRequest,
|
|
40
|
-
options?: RequestOptions
|
|
40
|
+
options?: RequestOptions
|
|
41
41
|
): APIPromise<
|
|
42
42
|
Result<
|
|
43
43
|
PostApiUsersUserIdOrganizationsResponse,
|
|
@@ -50,17 +50,13 @@ export function userOrganizationsPostApiUsersUserIdOrganizations(
|
|
|
50
50
|
| ConnectionError
|
|
51
51
|
>
|
|
52
52
|
> {
|
|
53
|
-
return new APIPromise($do(
|
|
54
|
-
client$,
|
|
55
|
-
request,
|
|
56
|
-
options,
|
|
57
|
-
));
|
|
53
|
+
return new APIPromise($do(client$, request, options));
|
|
58
54
|
}
|
|
59
55
|
|
|
60
56
|
async function $do(
|
|
61
57
|
client$: InkeepAgentsCore,
|
|
62
58
|
request: PostApiUsersUserIdOrganizationsRequest,
|
|
63
|
-
options?: RequestOptions
|
|
59
|
+
options?: RequestOptions
|
|
64
60
|
): Promise<
|
|
65
61
|
[
|
|
66
62
|
Result<
|
|
@@ -79,63 +75,58 @@ async function $do(
|
|
|
79
75
|
const parsed$ = safeParse(
|
|
80
76
|
request,
|
|
81
77
|
(value$) => PostApiUsersUserIdOrganizationsRequest$zodSchema.parse(value$),
|
|
82
|
-
|
|
78
|
+
'Input validation failed'
|
|
83
79
|
);
|
|
84
80
|
if (!parsed$.ok) {
|
|
85
|
-
return [parsed$, { status:
|
|
81
|
+
return [parsed$, { status: 'invalid' }];
|
|
86
82
|
}
|
|
87
83
|
const payload$ = parsed$.value;
|
|
88
|
-
const body$ = encodeJSON(
|
|
84
|
+
const body$ = encodeJSON('body', payload$.body, { explode: true });
|
|
89
85
|
|
|
90
86
|
const pathParams$ = {
|
|
91
|
-
userId: encodeSimple(
|
|
87
|
+
userId: encodeSimple('userId', payload$.userId, {
|
|
92
88
|
explode: false,
|
|
93
|
-
charEncoding:
|
|
89
|
+
charEncoding: 'percent',
|
|
94
90
|
}),
|
|
95
91
|
};
|
|
96
|
-
const path$ = pathToFunc(
|
|
97
|
-
pathParams$,
|
|
98
|
-
);
|
|
92
|
+
const path$ = pathToFunc('/api/users/{userId}/organizations')(pathParams$);
|
|
99
93
|
|
|
100
|
-
const headers$ = new Headers(
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
94
|
+
const headers$ = new Headers(
|
|
95
|
+
compactMap({
|
|
96
|
+
'Content-Type': 'application/json',
|
|
97
|
+
Accept: 'application/json',
|
|
98
|
+
})
|
|
99
|
+
);
|
|
104
100
|
const securityInput = await extractSecurity(client$._options.security);
|
|
105
101
|
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
106
102
|
|
|
107
103
|
const context = {
|
|
108
104
|
options: client$._options,
|
|
109
|
-
baseURL: options?.serverURL ?? client$._baseURL ??
|
|
110
|
-
operationID:
|
|
105
|
+
baseURL: options?.serverURL ?? client$._baseURL ?? '',
|
|
106
|
+
operationID: 'post_/api/users/{userId}/organizations',
|
|
111
107
|
oAuth2Scopes: null,
|
|
112
108
|
resolvedSecurity: requestSecurity,
|
|
113
109
|
securitySource: client$._options.security,
|
|
114
|
-
retryConfig: options?.retries
|
|
115
|
-
|
|
116
|
-
|| { strategy: "none" },
|
|
117
|
-
retryCodes: options?.retryCodes || [
|
|
118
|
-
"429",
|
|
119
|
-
"500",
|
|
120
|
-
"502",
|
|
121
|
-
"503",
|
|
122
|
-
"504",
|
|
123
|
-
],
|
|
110
|
+
retryConfig: options?.retries || client$._options.retryConfig || { strategy: 'none' },
|
|
111
|
+
retryCodes: options?.retryCodes || ['429', '500', '502', '503', '504'],
|
|
124
112
|
};
|
|
125
113
|
|
|
126
|
-
const requestRes = client$._createRequest(
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
114
|
+
const requestRes = client$._createRequest(
|
|
115
|
+
context,
|
|
116
|
+
{
|
|
117
|
+
security: requestSecurity,
|
|
118
|
+
method: 'POST',
|
|
119
|
+
baseURL: options?.serverURL,
|
|
120
|
+
path: path$,
|
|
121
|
+
headers: headers$,
|
|
122
|
+
body: body$,
|
|
123
|
+
userAgent: client$._options.userAgent,
|
|
124
|
+
timeoutMs: options?.timeoutMs || client$._options.timeoutMs || -1,
|
|
125
|
+
},
|
|
126
|
+
options
|
|
127
|
+
);
|
|
137
128
|
if (!requestRes.ok) {
|
|
138
|
-
return [requestRes, { status:
|
|
129
|
+
return [requestRes, { status: 'invalid' }];
|
|
139
130
|
}
|
|
140
131
|
const req$ = requestRes.value;
|
|
141
132
|
|
|
@@ -146,7 +137,7 @@ async function $do(
|
|
|
146
137
|
retryCodes: context.retryCodes,
|
|
147
138
|
});
|
|
148
139
|
if (!doResult.ok) {
|
|
149
|
-
return [doResult, { status:
|
|
140
|
+
return [doResult, { status: 'request-error', request: req$ }];
|
|
150
141
|
}
|
|
151
142
|
const response = doResult.value;
|
|
152
143
|
const responseFields$ = {
|
|
@@ -164,9 +155,9 @@ async function $do(
|
|
|
164
155
|
| ConnectionError
|
|
165
156
|
>(
|
|
166
157
|
M.json(201, PostApiUsersUserIdOrganizationsResponse$zodSchema, {
|
|
167
|
-
key:
|
|
168
|
-
})
|
|
158
|
+
key: 'object',
|
|
159
|
+
})
|
|
169
160
|
)(response, req$, { extraFields: responseFields$ });
|
|
170
161
|
|
|
171
|
-
return [result$, { status:
|
|
162
|
+
return [result$, { status: 'complete', request: req$, response }];
|
|
172
163
|
}
|
|
@@ -2,39 +2,35 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { invitationsGetApiInvitationsPending } from
|
|
6
|
-
import { GetApiInvitationsPendingRequest$zodSchema } from
|
|
7
|
-
import { formatResult, ToolDefinition } from
|
|
5
|
+
import { invitationsGetApiInvitationsPending } from '../../funcs/invitationsGetApiInvitationsPending.js';
|
|
6
|
+
import { GetApiInvitationsPendingRequest$zodSchema } from '../../models/getapiinvitationspendingop.js';
|
|
7
|
+
import { formatResult, ToolDefinition } from '../tools.js';
|
|
8
8
|
|
|
9
9
|
const args = {
|
|
10
10
|
request: GetApiInvitationsPendingRequest$zodSchema,
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
export const tool$invitationsGetApiInvitationsPending: ToolDefinition<
|
|
14
|
-
|
|
15
|
-
> = {
|
|
16
|
-
name: "invitations-get-api-invitations-pending",
|
|
13
|
+
export const tool$invitationsGetApiInvitationsPending: ToolDefinition<typeof args> = {
|
|
14
|
+
name: 'invitations-get-api-invitations-pending',
|
|
17
15
|
description: `Get pending invitations
|
|
18
16
|
|
|
19
17
|
Get all pending (non-expired) invitations for a given email address`,
|
|
20
18
|
annotations: {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
title: '',
|
|
20
|
+
destructiveHint: false,
|
|
21
|
+
idempotentHint: false,
|
|
22
|
+
openWorldHint: false,
|
|
23
|
+
readOnlyHint: true,
|
|
26
24
|
},
|
|
27
25
|
args,
|
|
28
26
|
tool: async (client, args, ctx) => {
|
|
29
|
-
const [result, apiCall] = await invitationsGetApiInvitationsPending(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
{ fetchOptions: { signal: ctx.signal } },
|
|
33
|
-
).$inspect();
|
|
27
|
+
const [result, apiCall] = await invitationsGetApiInvitationsPending(client, args.request, {
|
|
28
|
+
fetchOptions: { signal: ctx.signal },
|
|
29
|
+
}).$inspect();
|
|
34
30
|
|
|
35
31
|
if (!result.ok) {
|
|
36
32
|
return {
|
|
37
|
-
content: [{ type:
|
|
33
|
+
content: [{ type: 'text', text: result.error.message }],
|
|
38
34
|
isError: true,
|
|
39
35
|
};
|
|
40
36
|
}
|
|
@@ -2,45 +2,43 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { userOrganizationsGetApiUsersUserIdOrganizations } from
|
|
6
|
-
import { GetApiUsersUserIdOrganizationsRequest$zodSchema } from
|
|
7
|
-
import { formatResult, ToolDefinition } from
|
|
5
|
+
import { userOrganizationsGetApiUsersUserIdOrganizations } from '../../funcs/userOrganizationsGetApiUsersUserIdOrganizations.js';
|
|
6
|
+
import { GetApiUsersUserIdOrganizationsRequest$zodSchema } from '../../models/getapiusersuseridorganizationsop.js';
|
|
7
|
+
import { formatResult, ToolDefinition } from '../tools.js';
|
|
8
8
|
|
|
9
9
|
const args = {
|
|
10
10
|
request: GetApiUsersUserIdOrganizationsRequest$zodSchema,
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
export const tool$userOrganizationsGetApiUsersUserIdOrganizations:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
description: `List user organizations
|
|
13
|
+
export const tool$userOrganizationsGetApiUsersUserIdOrganizations: ToolDefinition<typeof args> = {
|
|
14
|
+
name: 'user-organizations-get-api-users-user-id-organizations',
|
|
15
|
+
description: `List user organizations
|
|
17
16
|
|
|
18
17
|
Get all organizations associated with a user`,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
).$inspect();
|
|
18
|
+
annotations: {
|
|
19
|
+
title: '',
|
|
20
|
+
destructiveHint: false,
|
|
21
|
+
idempotentHint: false,
|
|
22
|
+
openWorldHint: false,
|
|
23
|
+
readOnlyHint: true,
|
|
24
|
+
},
|
|
25
|
+
args,
|
|
26
|
+
tool: async (client, args, ctx) => {
|
|
27
|
+
const [result, apiCall] = await userOrganizationsGetApiUsersUserIdOrganizations(
|
|
28
|
+
client,
|
|
29
|
+
args.request,
|
|
30
|
+
{ fetchOptions: { signal: ctx.signal } }
|
|
31
|
+
).$inspect();
|
|
34
32
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
33
|
+
if (!result.ok) {
|
|
34
|
+
return {
|
|
35
|
+
content: [{ type: 'text', text: result.error.message }],
|
|
36
|
+
isError: true,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
41
39
|
|
|
42
|
-
|
|
40
|
+
const value = result.value;
|
|
43
41
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
return formatResult(value, apiCall);
|
|
43
|
+
},
|
|
44
|
+
};
|
|
@@ -2,45 +2,43 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { userOrganizationsPostApiUsersUserIdOrganizations } from
|
|
6
|
-
import { PostApiUsersUserIdOrganizationsRequest$zodSchema } from
|
|
7
|
-
import { formatResult, ToolDefinition } from
|
|
5
|
+
import { userOrganizationsPostApiUsersUserIdOrganizations } from '../../funcs/userOrganizationsPostApiUsersUserIdOrganizations.js';
|
|
6
|
+
import { PostApiUsersUserIdOrganizationsRequest$zodSchema } from '../../models/postapiusersuseridorganizationsop.js';
|
|
7
|
+
import { formatResult, ToolDefinition } from '../tools.js';
|
|
8
8
|
|
|
9
9
|
const args = {
|
|
10
10
|
request: PostApiUsersUserIdOrganizationsRequest$zodSchema,
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
export const tool$userOrganizationsPostApiUsersUserIdOrganizations:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
description: `Add user to organization
|
|
13
|
+
export const tool$userOrganizationsPostApiUsersUserIdOrganizations: ToolDefinition<typeof args> = {
|
|
14
|
+
name: 'user-organizations-post-api-users-user-id-organizations',
|
|
15
|
+
description: `Add user to organization
|
|
17
16
|
|
|
18
17
|
Associate a user with an organization`,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
).$inspect();
|
|
18
|
+
annotations: {
|
|
19
|
+
title: '',
|
|
20
|
+
destructiveHint: false,
|
|
21
|
+
idempotentHint: false,
|
|
22
|
+
openWorldHint: false,
|
|
23
|
+
readOnlyHint: false,
|
|
24
|
+
},
|
|
25
|
+
args,
|
|
26
|
+
tool: async (client, args, ctx) => {
|
|
27
|
+
const [result, apiCall] = await userOrganizationsPostApiUsersUserIdOrganizations(
|
|
28
|
+
client,
|
|
29
|
+
args.request,
|
|
30
|
+
{ fetchOptions: { signal: ctx.signal } }
|
|
31
|
+
).$inspect();
|
|
34
32
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
33
|
+
if (!result.ok) {
|
|
34
|
+
return {
|
|
35
|
+
content: [{ type: 'text', text: result.error.message }],
|
|
36
|
+
isError: true,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
41
39
|
|
|
42
|
-
|
|
40
|
+
const value = result.value;
|
|
43
41
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
return formatResult(value, apiCall);
|
|
43
|
+
},
|
|
44
|
+
};
|
|
@@ -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
|
|
6
|
-
import { ErrorResponse, ErrorResponse$zodSchema } from
|
|
5
|
+
import * as z from 'zod';
|
|
6
|
+
import { ErrorResponse, ErrorResponse$zodSchema } from './errorresponse.js';
|
|
7
7
|
|
|
8
8
|
export type CreatePlaygroundTokenSecurity = { cookieAuth: string };
|
|
9
9
|
|
|
@@ -12,9 +12,11 @@ export const CreatePlaygroundTokenSecurity$zodSchema: z.ZodType<
|
|
|
12
12
|
z.ZodTypeDef,
|
|
13
13
|
unknown
|
|
14
14
|
> = z.object({
|
|
15
|
-
cookieAuth: z
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
cookieAuth: z
|
|
16
|
+
.string()
|
|
17
|
+
.describe(
|
|
18
|
+
'Session-based authentication using HTTP-only cookies. Cookies are automatically sent by browsers. For server-side requests, include cookies with names starting with "better-auth." in the Cookie header.'
|
|
19
|
+
),
|
|
18
20
|
});
|
|
19
21
|
|
|
20
22
|
export type CreatePlaygroundTokenRequestBody = {
|
|
@@ -42,7 +44,7 @@ export const CreatePlaygroundTokenRequest$zodSchema: z.ZodType<
|
|
|
42
44
|
unknown
|
|
43
45
|
> = z.object({
|
|
44
46
|
body: z.lazy(() => CreatePlaygroundTokenRequestBody$zodSchema).optional(),
|
|
45
|
-
tenantId: z.string().describe(
|
|
47
|
+
tenantId: z.string().describe('Tenant identifier'),
|
|
46
48
|
});
|
|
47
49
|
|
|
48
50
|
/**
|
|
@@ -57,10 +59,12 @@ export const CreatePlaygroundTokenResponseBody$zodSchema: z.ZodType<
|
|
|
57
59
|
CreatePlaygroundTokenResponseBody,
|
|
58
60
|
z.ZodTypeDef,
|
|
59
61
|
unknown
|
|
60
|
-
> = z
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
> = z
|
|
63
|
+
.object({
|
|
64
|
+
apiKey: z.string(),
|
|
65
|
+
expiresAt: z.string(),
|
|
66
|
+
})
|
|
67
|
+
.describe('Temporary API key generated successfully');
|
|
64
68
|
|
|
65
69
|
export type CreatePlaygroundTokenResponse = {
|
|
66
70
|
ContentType: string;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import * as z from
|
|
5
|
+
import * as z from 'zod';
|
|
6
6
|
|
|
7
7
|
export type GetApiInvitationsPendingRequest = { email: string };
|
|
8
8
|
|
|
@@ -11,7 +11,7 @@ export const GetApiInvitationsPendingRequest$zodSchema: z.ZodType<
|
|
|
11
11
|
z.ZodTypeDef,
|
|
12
12
|
unknown
|
|
13
13
|
> = z.object({
|
|
14
|
-
email: z.string().describe(
|
|
14
|
+
email: z.string().describe('Email address to check for invitations'),
|
|
15
15
|
});
|
|
16
16
|
|
|
17
17
|
export type GetApiInvitationsPendingResponseBody = {
|
|
@@ -56,8 +56,9 @@ export const GetApiInvitationsPendingResponse$zodSchema: z.ZodType<
|
|
|
56
56
|
> = z.object({
|
|
57
57
|
ContentType: z.string(),
|
|
58
58
|
RawResponse: z.instanceof(Response),
|
|
59
|
-
ResponseBodies: z
|
|
60
|
-
z.lazy(() => GetApiInvitationsPendingResponseBody$zodSchema)
|
|
61
|
-
|
|
59
|
+
ResponseBodies: z
|
|
60
|
+
.array(z.lazy(() => GetApiInvitationsPendingResponseBody$zodSchema))
|
|
61
|
+
.describe('List of pending invitations')
|
|
62
|
+
.optional(),
|
|
62
63
|
StatusCode: z.number().int(),
|
|
63
64
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import * as z from
|
|
5
|
+
import * as z from 'zod';
|
|
6
6
|
|
|
7
7
|
export type GetApiUsersUserIdOrganizationsRequest = { userId: string };
|
|
8
8
|
|
|
@@ -11,7 +11,7 @@ export const GetApiUsersUserIdOrganizationsRequest$zodSchema: z.ZodType<
|
|
|
11
11
|
z.ZodTypeDef,
|
|
12
12
|
unknown
|
|
13
13
|
> = z.object({
|
|
14
|
-
userId: z.string().describe(
|
|
14
|
+
userId: z.string().describe('User ID'),
|
|
15
15
|
});
|
|
16
16
|
|
|
17
17
|
export type GetApiUsersUserIdOrganizationsResponseBody = {
|
|
@@ -42,9 +42,7 @@ export type GetApiUsersUserIdOrganizationsResponse = {
|
|
|
42
42
|
ContentType: string;
|
|
43
43
|
StatusCode: number;
|
|
44
44
|
RawResponse: Response;
|
|
45
|
-
ResponseBodies?:
|
|
46
|
-
| Array<GetApiUsersUserIdOrganizationsResponseBody>
|
|
47
|
-
| undefined;
|
|
45
|
+
ResponseBodies?: Array<GetApiUsersUserIdOrganizationsResponseBody> | undefined;
|
|
48
46
|
};
|
|
49
47
|
|
|
50
48
|
export const GetApiUsersUserIdOrganizationsResponse$zodSchema: z.ZodType<
|
|
@@ -54,8 +52,9 @@ export const GetApiUsersUserIdOrganizationsResponse$zodSchema: z.ZodType<
|
|
|
54
52
|
> = z.object({
|
|
55
53
|
ContentType: z.string(),
|
|
56
54
|
RawResponse: z.instanceof(Response),
|
|
57
|
-
ResponseBodies: z
|
|
58
|
-
z.lazy(() => GetApiUsersUserIdOrganizationsResponseBody$zodSchema)
|
|
59
|
-
|
|
55
|
+
ResponseBodies: z
|
|
56
|
+
.array(z.lazy(() => GetApiUsersUserIdOrganizationsResponseBody$zodSchema))
|
|
57
|
+
.describe('List of user organizations')
|
|
58
|
+
.optional(),
|
|
60
59
|
StatusCode: z.number().int(),
|
|
61
60
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import * as z from
|
|
5
|
+
import * as z from 'zod';
|
|
6
6
|
|
|
7
7
|
export type PostApiUsersUserIdOrganizationsRequestBody = {
|
|
8
8
|
organizationId: string;
|
|
@@ -15,7 +15,7 @@ export const PostApiUsersUserIdOrganizationsRequestBody$zodSchema: z.ZodType<
|
|
|
15
15
|
unknown
|
|
16
16
|
> = z.object({
|
|
17
17
|
organizationId: z.string(),
|
|
18
|
-
role: z.string().default(
|
|
18
|
+
role: z.string().default('member'),
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
export type PostApiUsersUserIdOrganizationsRequest = {
|
|
@@ -28,9 +28,8 @@ export const PostApiUsersUserIdOrganizationsRequest$zodSchema: z.ZodType<
|
|
|
28
28
|
z.ZodTypeDef,
|
|
29
29
|
unknown
|
|
30
30
|
> = z.object({
|
|
31
|
-
body: z.lazy(() => PostApiUsersUserIdOrganizationsRequestBody$zodSchema)
|
|
32
|
-
|
|
33
|
-
userId: z.string().describe("User ID"),
|
|
31
|
+
body: z.lazy(() => PostApiUsersUserIdOrganizationsRequestBody$zodSchema).optional(),
|
|
32
|
+
userId: z.string().describe('User ID'),
|
|
34
33
|
});
|
|
35
34
|
|
|
36
35
|
/**
|
|
@@ -46,11 +45,13 @@ export const PostApiUsersUserIdOrganizationsResponseBody$zodSchema: z.ZodType<
|
|
|
46
45
|
PostApiUsersUserIdOrganizationsResponseBody,
|
|
47
46
|
z.ZodTypeDef,
|
|
48
47
|
unknown
|
|
49
|
-
> = z
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
> = z
|
|
49
|
+
.object({
|
|
50
|
+
createdAt: z.string(),
|
|
51
|
+
organizationId: z.string(),
|
|
52
|
+
role: z.string(),
|
|
53
|
+
})
|
|
54
|
+
.describe('User added to organization');
|
|
54
55
|
|
|
55
56
|
export type PostApiUsersUserIdOrganizationsResponse = {
|
|
56
57
|
ContentType: string;
|
|
@@ -67,6 +68,5 @@ export const PostApiUsersUserIdOrganizationsResponse$zodSchema: z.ZodType<
|
|
|
67
68
|
ContentType: z.string(),
|
|
68
69
|
RawResponse: z.instanceof(Response),
|
|
69
70
|
StatusCode: z.number().int(),
|
|
70
|
-
object: z.lazy(() => PostApiUsersUserIdOrganizationsResponseBody$zodSchema)
|
|
71
|
-
.optional(),
|
|
71
|
+
object: z.lazy(() => PostApiUsersUserIdOrganizationsResponseBody$zodSchema).optional(),
|
|
72
72
|
});
|
package/src/models/security.ts
CHANGED
|
@@ -2,16 +2,19 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import * as z from
|
|
5
|
+
import * as z from 'zod';
|
|
6
6
|
|
|
7
7
|
export type Security = { cookieAuth: string; bearerAuth: string };
|
|
8
8
|
|
|
9
|
-
export const Security$zodSchema: z.ZodType<Security, z.ZodTypeDef, unknown> = z
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
export const Security$zodSchema: z.ZodType<Security, z.ZodTypeDef, unknown> = z.object({
|
|
10
|
+
bearerAuth: z
|
|
11
|
+
.string()
|
|
12
|
+
.describe(
|
|
13
|
+
'Bearer token authentication. Use this for API clients and service-to-service communication. Set the Authorization header to "Bearer <token>".'
|
|
13
14
|
),
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
cookieAuth: z
|
|
16
|
+
.string()
|
|
17
|
+
.describe(
|
|
18
|
+
'Session-based authentication using HTTP-only cookies. Cookies are automatically sent by browsers. For server-side requests, include cookies with names starting with "better-auth." in the Cookie header.'
|
|
16
19
|
),
|
|
17
|
-
|
|
20
|
+
});
|
package/tsup.config.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineConfig } from
|
|
1
|
+
import { defineConfig } from 'tsup';
|
|
2
2
|
|
|
3
3
|
export default defineConfig({
|
|
4
|
-
entry: [
|
|
5
|
-
format: [
|
|
4
|
+
entry: ['src/index.ts'],
|
|
5
|
+
format: ['cjs', 'esm'],
|
|
6
6
|
dts: true,
|
|
7
7
|
clean: true,
|
|
8
8
|
// Bundle zod INTO the package output to avoid version conflicts
|
|
9
9
|
// with consumers that use Zod v4
|
|
10
|
-
noExternal: [
|
|
10
|
+
noExternal: ['zod'],
|
|
11
11
|
});
|