@collective-intelligence/external-apps-server-sdk 0.2.4 → 0.2.5
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 +11 -2
- package/dist/chunks/{index-7pww93nd.js → index-sc1m7s5d.js} +4 -4
- package/dist/effect.d.ts +1376 -0
- package/dist/effect.js +1 -1
- package/dist/index.d.ts +669 -656
- package/dist/index.js +1 -1
- package/dist/next.js +1 -1
- package/dist/resources.js +1 -1
- package/dist/runtime/web.js +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -10,316 +10,6 @@ import * as Option$1 from 'effect/Option';
|
|
|
10
10
|
import * as Redacted from 'effect/Redacted';
|
|
11
11
|
import * as Schema from 'effect/Schema';
|
|
12
12
|
|
|
13
|
-
export type AuthToken = string | undefined;
|
|
14
|
-
export interface Auth {
|
|
15
|
-
/**
|
|
16
|
-
* Which part of the request do we use to send the auth?
|
|
17
|
-
*
|
|
18
|
-
* @default 'header'
|
|
19
|
-
*/
|
|
20
|
-
in?: "header" | "query" | "cookie";
|
|
21
|
-
/**
|
|
22
|
-
* Header or query parameter name.
|
|
23
|
-
*
|
|
24
|
-
* @default 'Authorization'
|
|
25
|
-
*/
|
|
26
|
-
name?: string;
|
|
27
|
-
scheme?: "basic" | "bearer";
|
|
28
|
-
type: "apiKey" | "http";
|
|
29
|
-
}
|
|
30
|
-
export interface SerializerOptions<T> {
|
|
31
|
-
/**
|
|
32
|
-
* @default true
|
|
33
|
-
*/
|
|
34
|
-
explode: boolean;
|
|
35
|
-
style: T;
|
|
36
|
-
}
|
|
37
|
-
export type ArrayStyle = "form" | "spaceDelimited" | "pipeDelimited";
|
|
38
|
-
export type ObjectStyle = "form" | "deepObject";
|
|
39
|
-
export type QuerySerializer = (query: Record<string, unknown>) => string;
|
|
40
|
-
export type BodySerializer = (body: unknown) => unknown;
|
|
41
|
-
export type QuerySerializerOptionsObject = {
|
|
42
|
-
allowReserved?: boolean;
|
|
43
|
-
array?: Partial<SerializerOptions<ArrayStyle>>;
|
|
44
|
-
object?: Partial<SerializerOptions<ObjectStyle>>;
|
|
45
|
-
};
|
|
46
|
-
export type QuerySerializerOptions = QuerySerializerOptionsObject & {
|
|
47
|
-
/**
|
|
48
|
-
* Per-parameter serialization overrides. When provided, these settings
|
|
49
|
-
* override the global array/object settings for specific parameter names.
|
|
50
|
-
*/
|
|
51
|
-
parameters?: Record<string, QuerySerializerOptionsObject>;
|
|
52
|
-
};
|
|
53
|
-
export type HttpMethod = "connect" | "delete" | "get" | "head" | "options" | "patch" | "post" | "put" | "trace";
|
|
54
|
-
export type Client<RequestFn = never, Config = unknown, MethodFn = never, BuildUrlFn = never, SseFn = never> = {
|
|
55
|
-
/**
|
|
56
|
-
* Returns the final request URL.
|
|
57
|
-
*/
|
|
58
|
-
buildUrl: BuildUrlFn;
|
|
59
|
-
getConfig: () => Config;
|
|
60
|
-
request: RequestFn;
|
|
61
|
-
setConfig: (config: Config) => Config;
|
|
62
|
-
} & {
|
|
63
|
-
[K in HttpMethod]: MethodFn;
|
|
64
|
-
} & ([
|
|
65
|
-
SseFn
|
|
66
|
-
] extends [
|
|
67
|
-
never
|
|
68
|
-
] ? {
|
|
69
|
-
sse?: never;
|
|
70
|
-
} : {
|
|
71
|
-
sse: {
|
|
72
|
-
[K in HttpMethod]: SseFn;
|
|
73
|
-
};
|
|
74
|
-
});
|
|
75
|
-
export interface Config {
|
|
76
|
-
/**
|
|
77
|
-
* Auth token or a function returning auth token. The resolved value will be
|
|
78
|
-
* added to the request payload as defined by its `security` array.
|
|
79
|
-
*/
|
|
80
|
-
auth?: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken;
|
|
81
|
-
/**
|
|
82
|
-
* A function for serializing request body parameter. By default,
|
|
83
|
-
* {@link JSON.stringify()} will be used.
|
|
84
|
-
*/
|
|
85
|
-
bodySerializer?: BodySerializer | null;
|
|
86
|
-
/**
|
|
87
|
-
* An object containing any HTTP headers that you want to pre-populate your
|
|
88
|
-
* `Headers` object with.
|
|
89
|
-
*
|
|
90
|
-
* {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
|
|
91
|
-
*/
|
|
92
|
-
headers?: RequestInit["headers"] | Record<string, string | number | boolean | (string | number | boolean)[] | null | undefined | unknown>;
|
|
93
|
-
/**
|
|
94
|
-
* The request method.
|
|
95
|
-
*
|
|
96
|
-
* {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
|
|
97
|
-
*/
|
|
98
|
-
method?: Uppercase<HttpMethod>;
|
|
99
|
-
/**
|
|
100
|
-
* A function for serializing request query parameters. By default, arrays
|
|
101
|
-
* will be exploded in form style, objects will be exploded in deepObject
|
|
102
|
-
* style, and reserved characters are percent-encoded.
|
|
103
|
-
*
|
|
104
|
-
* This method will have no effect if the native `paramsSerializer()` Axios
|
|
105
|
-
* API function is used.
|
|
106
|
-
*
|
|
107
|
-
* {@link https://swagger.io/docs/specification/serialization/#query View examples}
|
|
108
|
-
*/
|
|
109
|
-
querySerializer?: QuerySerializer | QuerySerializerOptions;
|
|
110
|
-
/**
|
|
111
|
-
* A function validating request data. This is useful if you want to ensure
|
|
112
|
-
* the request conforms to the desired shape, so it can be safely sent to
|
|
113
|
-
* the server.
|
|
114
|
-
*/
|
|
115
|
-
requestValidator?: (data: unknown) => Promise<unknown>;
|
|
116
|
-
/**
|
|
117
|
-
* A function transforming response data before it's returned. This is useful
|
|
118
|
-
* for post-processing data, e.g., converting ISO strings into Date objects.
|
|
119
|
-
*/
|
|
120
|
-
responseTransformer?: (data: unknown) => Promise<unknown>;
|
|
121
|
-
/**
|
|
122
|
-
* A function validating response data. This is useful if you want to ensure
|
|
123
|
-
* the response conforms to the desired shape, so it can be safely passed to
|
|
124
|
-
* the transformers and returned to the user.
|
|
125
|
-
*/
|
|
126
|
-
responseValidator?: (data: unknown) => Promise<unknown>;
|
|
127
|
-
}
|
|
128
|
-
export type ServerSentEventsOptions<TData = unknown> = Omit<RequestInit, "body" | "method"> & Pick<Config, "method" | "responseTransformer" | "responseValidator"> & {
|
|
129
|
-
/**
|
|
130
|
-
* Fetch API implementation. You can use this option to provide a custom
|
|
131
|
-
* fetch instance.
|
|
132
|
-
*
|
|
133
|
-
* @default globalThis.fetch
|
|
134
|
-
*/
|
|
135
|
-
body?: RequestInit["body"] | undefined;
|
|
136
|
-
fetch?: typeof fetch;
|
|
137
|
-
/**
|
|
138
|
-
* Implementing clients can call request interceptors inside this hook.
|
|
139
|
-
*/
|
|
140
|
-
onRequest?: (url: string, init: RequestInit) => Promise<Request>;
|
|
141
|
-
/**
|
|
142
|
-
* Callback invoked when a network or parsing error occurs during streaming.
|
|
143
|
-
*
|
|
144
|
-
* This option applies only if the endpoint returns a stream of events.
|
|
145
|
-
*
|
|
146
|
-
* @param error The error that occurred.
|
|
147
|
-
*/
|
|
148
|
-
onSseError?: (error: unknown) => void;
|
|
149
|
-
/**
|
|
150
|
-
* Callback invoked when an event is streamed from the server.
|
|
151
|
-
*
|
|
152
|
-
* This option applies only if the endpoint returns a stream of events.
|
|
153
|
-
*
|
|
154
|
-
* @param event Event streamed from the server.
|
|
155
|
-
* @returns Nothing (void).
|
|
156
|
-
*/
|
|
157
|
-
onSseEvent?: (event: StreamEvent<TData>) => void;
|
|
158
|
-
serializedBody?: RequestInit["body"] | undefined;
|
|
159
|
-
/**
|
|
160
|
-
* Default retry delay in milliseconds.
|
|
161
|
-
*
|
|
162
|
-
* This option applies only if the endpoint returns a stream of events.
|
|
163
|
-
*
|
|
164
|
-
* @default 3000
|
|
165
|
-
*/
|
|
166
|
-
sseDefaultRetryDelay?: number;
|
|
167
|
-
/**
|
|
168
|
-
* Maximum number of retry attempts before giving up.
|
|
169
|
-
*/
|
|
170
|
-
sseMaxRetryAttempts?: number;
|
|
171
|
-
/**
|
|
172
|
-
* Maximum retry delay in milliseconds.
|
|
173
|
-
*
|
|
174
|
-
* Applies only when exponential backoff is used.
|
|
175
|
-
*
|
|
176
|
-
* This option applies only if the endpoint returns a stream of events.
|
|
177
|
-
*
|
|
178
|
-
* @default 30000
|
|
179
|
-
*/
|
|
180
|
-
sseMaxRetryDelay?: number;
|
|
181
|
-
/**
|
|
182
|
-
* Optional sleep function for retry backoff.
|
|
183
|
-
*
|
|
184
|
-
* Defaults to using `setTimeout`.
|
|
185
|
-
*/
|
|
186
|
-
sseSleepFn?: (ms: number) => Promise<void>;
|
|
187
|
-
url: string;
|
|
188
|
-
};
|
|
189
|
-
export interface StreamEvent<TData = unknown> {
|
|
190
|
-
data: TData;
|
|
191
|
-
event?: string | undefined;
|
|
192
|
-
id?: string | undefined;
|
|
193
|
-
retry?: number;
|
|
194
|
-
}
|
|
195
|
-
export type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unknown> = {
|
|
196
|
-
stream: AsyncGenerator<TData extends Record<string, unknown> ? TData[keyof TData] : TData, TReturn, TNext>;
|
|
197
|
-
};
|
|
198
|
-
export type ErrInterceptor<Err, Res, Req, Options> = (error: Err, response: Res, request: Req, options: Options) => Err | Promise<Err>;
|
|
199
|
-
export type ReqInterceptor<Req, Options> = (request: Req, options: Options) => Req | Promise<Req>;
|
|
200
|
-
export type ResInterceptor<Res, Req, Options> = (response: Res, request: Req, options: Options) => Res | Promise<Res>;
|
|
201
|
-
declare class Interceptors<Interceptor> {
|
|
202
|
-
fns: Array<Interceptor | null>;
|
|
203
|
-
clear(): void;
|
|
204
|
-
eject(id: number | Interceptor): void;
|
|
205
|
-
exists(id: number | Interceptor): boolean;
|
|
206
|
-
getInterceptorIndex(id: number | Interceptor): number;
|
|
207
|
-
update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false;
|
|
208
|
-
use(fn: Interceptor): number;
|
|
209
|
-
}
|
|
210
|
-
export interface Middleware<Req, Res, Err, Options> {
|
|
211
|
-
error: Interceptors<ErrInterceptor<Err, Res, Req, Options>>;
|
|
212
|
-
request: Interceptors<ReqInterceptor<Req, Options>>;
|
|
213
|
-
response: Interceptors<ResInterceptor<Res, Req, Options>>;
|
|
214
|
-
}
|
|
215
|
-
export type ResponseStyle = "data" | "fields";
|
|
216
|
-
interface Config$1<T extends ClientOptions = ClientOptions> extends Omit<RequestInit, "body" | "headers" | "method">, Config {
|
|
217
|
-
/**
|
|
218
|
-
* Base URL for all requests made by this client.
|
|
219
|
-
*/
|
|
220
|
-
baseUrl?: T["baseUrl"];
|
|
221
|
-
/**
|
|
222
|
-
* Fetch API implementation. You can use this option to provide a custom
|
|
223
|
-
* fetch instance.
|
|
224
|
-
*
|
|
225
|
-
* @default globalThis.fetch
|
|
226
|
-
*/
|
|
227
|
-
fetch?: typeof fetch;
|
|
228
|
-
/**
|
|
229
|
-
* Please don't use the Fetch client for Next.js applications. The `next`
|
|
230
|
-
* options won't have any effect.
|
|
231
|
-
*
|
|
232
|
-
* Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead.
|
|
233
|
-
*/
|
|
234
|
-
next?: never;
|
|
235
|
-
/**
|
|
236
|
-
* Return the response data parsed in a specified format. By default, `auto`
|
|
237
|
-
* will infer the appropriate method from the `Content-Type` response header.
|
|
238
|
-
* You can override this behavior with any of the {@link Body} methods.
|
|
239
|
-
* Select `stream` if you don't want to parse response data at all.
|
|
240
|
-
*
|
|
241
|
-
* @default 'auto'
|
|
242
|
-
*/
|
|
243
|
-
parseAs?: "arrayBuffer" | "auto" | "blob" | "formData" | "json" | "stream" | "text";
|
|
244
|
-
/**
|
|
245
|
-
* Should we return only data or multiple fields (data, error, response, etc.)?
|
|
246
|
-
*
|
|
247
|
-
* @default 'fields'
|
|
248
|
-
*/
|
|
249
|
-
responseStyle?: ResponseStyle;
|
|
250
|
-
/**
|
|
251
|
-
* Throw an error instead of returning it in the response?
|
|
252
|
-
*
|
|
253
|
-
* @default false
|
|
254
|
-
*/
|
|
255
|
-
throwOnError?: T["throwOnError"];
|
|
256
|
-
}
|
|
257
|
-
export interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle = "fields", ThrowOnError extends boolean = boolean, Url extends string = string> extends Config$1<{
|
|
258
|
-
responseStyle: TResponseStyle;
|
|
259
|
-
throwOnError: ThrowOnError;
|
|
260
|
-
}>, Pick<ServerSentEventsOptions<TData>, "onRequest" | "onSseError" | "onSseEvent" | "sseDefaultRetryDelay" | "sseMaxRetryAttempts" | "sseMaxRetryDelay"> {
|
|
261
|
-
/**
|
|
262
|
-
* Any body that you want to add to your request.
|
|
263
|
-
*
|
|
264
|
-
* {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
|
|
265
|
-
*/
|
|
266
|
-
body?: unknown;
|
|
267
|
-
path?: Record<string, unknown>;
|
|
268
|
-
query?: Record<string, unknown>;
|
|
269
|
-
/**
|
|
270
|
-
* Security mechanism(s) to use for the request.
|
|
271
|
-
*/
|
|
272
|
-
security?: ReadonlyArray<Auth>;
|
|
273
|
-
url: Url;
|
|
274
|
-
}
|
|
275
|
-
export interface ResolvedRequestOptions<TResponseStyle extends ResponseStyle = "fields", ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions<unknown, TResponseStyle, ThrowOnError, Url> {
|
|
276
|
-
headers: Headers;
|
|
277
|
-
serializedBody?: string | undefined;
|
|
278
|
-
}
|
|
279
|
-
export type RequestResult<TData = unknown, TError = unknown, ThrowOnError extends boolean = boolean, TResponseStyle extends ResponseStyle = "fields"> = ThrowOnError extends true ? Promise<TResponseStyle extends "data" ? TData extends Record<string, unknown> ? TData[keyof TData] : TData : {
|
|
280
|
-
data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
|
|
281
|
-
request: Request;
|
|
282
|
-
response: Response;
|
|
283
|
-
}> : Promise<TResponseStyle extends "data" ? (TData extends Record<string, unknown> ? TData[keyof TData] : TData) | undefined : ({
|
|
284
|
-
data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
|
|
285
|
-
error: undefined;
|
|
286
|
-
} | {
|
|
287
|
-
data: undefined;
|
|
288
|
-
error: TError extends Record<string, unknown> ? TError[keyof TError] : TError;
|
|
289
|
-
}) & {
|
|
290
|
-
request: Request;
|
|
291
|
-
response: Response;
|
|
292
|
-
}>;
|
|
293
|
-
export interface ClientOptions {
|
|
294
|
-
baseUrl?: string;
|
|
295
|
-
responseStyle?: ResponseStyle;
|
|
296
|
-
throwOnError?: boolean;
|
|
297
|
-
}
|
|
298
|
-
export type MethodFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
299
|
-
export type SseFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<never, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData, TError>>;
|
|
300
|
-
export type RequestFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method"> & Pick<Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
301
|
-
export type BuildUrlFn = <TData extends {
|
|
302
|
-
body?: unknown;
|
|
303
|
-
path?: Record<string, unknown>;
|
|
304
|
-
query?: Record<string, unknown>;
|
|
305
|
-
url: string;
|
|
306
|
-
}>(options: TData & Options<TData>) => string;
|
|
307
|
-
type Client$1 = Client<RequestFn, Config$1, MethodFn, BuildUrlFn, SseFn> & {
|
|
308
|
-
interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>;
|
|
309
|
-
};
|
|
310
|
-
export interface TEndpointData {
|
|
311
|
-
body?: unknown;
|
|
312
|
-
headers?: unknown;
|
|
313
|
-
path?: unknown;
|
|
314
|
-
query?: unknown;
|
|
315
|
-
url: string;
|
|
316
|
-
}
|
|
317
|
-
export type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
318
|
-
export type Options<TData extends TEndpointData = TEndpointData, ThrowOnError extends boolean = boolean, TResponse = unknown, TResponseStyle extends ResponseStyle = "fields"> = OmitKeys<RequestOptions<TResponse, TResponseStyle, ThrowOnError>, "body" | "path" | "query" | "url"> & ([
|
|
319
|
-
TData
|
|
320
|
-
] extends [
|
|
321
|
-
never
|
|
322
|
-
] ? unknown : Omit<TData, "url">);
|
|
323
13
|
export type AccessExplanation = {
|
|
324
14
|
cut: {
|
|
325
15
|
credential: {
|
|
@@ -1261,85 +951,6 @@ export type ApplicationAccessPrincipalsExplainData = {
|
|
|
1261
951
|
query?: never;
|
|
1262
952
|
url: "/application/v1/access/explain";
|
|
1263
953
|
};
|
|
1264
|
-
type Options$1<TData extends TEndpointData = TEndpointData, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options<TData, ThrowOnError, TResponse> & {
|
|
1265
|
-
/**
|
|
1266
|
-
* You can provide a client instance returned by `createClient()` instead of
|
|
1267
|
-
* individual options. This might be also useful if you want to implement a
|
|
1268
|
-
* custom client.
|
|
1269
|
-
*/
|
|
1270
|
-
client?: Client$1;
|
|
1271
|
-
/**
|
|
1272
|
-
* You can pass arbitrary values through the `meta` object. This can be
|
|
1273
|
-
* used to access values that aren't defined as part of the SDK function.
|
|
1274
|
-
*/
|
|
1275
|
-
meta?: Record<string, unknown>;
|
|
1276
|
-
};
|
|
1277
|
-
/** Every generated error body of the access API names its error by `_tag`. */
|
|
1278
|
-
export type AccessApiErrorBody = Readonly<{
|
|
1279
|
-
_tag: string;
|
|
1280
|
-
}>;
|
|
1281
|
-
declare class AccessApiError extends Error {
|
|
1282
|
-
readonly name = "AccessApiError";
|
|
1283
|
-
readonly body: AccessApiErrorBody;
|
|
1284
|
-
readonly status: number;
|
|
1285
|
-
constructor(status: number, body: AccessApiErrorBody);
|
|
1286
|
-
}
|
|
1287
|
-
export type EndpointOptions<OptionsType> = Pick<OptionsType, Extract<keyof OptionsType, "body" | "headers" | "path" | "query">>;
|
|
1288
|
-
declare const createApplicationAccessApi: (client: Client$1) => {
|
|
1289
|
-
axes: {
|
|
1290
|
-
list: (options: EndpointOptions<Options$1<ApplicationAccessDefinitionsListAxesData, false, unknown>>) => Promise<AccessGrantAxis[]>;
|
|
1291
|
-
};
|
|
1292
|
-
catalog: {
|
|
1293
|
-
list: (options: EndpointOptions<Options$1<ApplicationAccessDefinitionsListCapabilitiesData, false, unknown>>) => Promise<AccessCapabilityNode[]>;
|
|
1294
|
-
};
|
|
1295
|
-
explain: (options: EndpointOptions<Options$1<ApplicationAccessPrincipalsExplainData, false, unknown>>) => Promise<AccessExplanation>;
|
|
1296
|
-
grants: {
|
|
1297
|
-
create: (options: EndpointOptions<Options$1<ApplicationAccessGrantsCreateData, false, unknown>>) => Promise<AccessGrant>;
|
|
1298
|
-
delete: (options: EndpointOptions<Options$1<ApplicationAccessGrantsDeleteData, false, unknown>>) => Promise<void>;
|
|
1299
|
-
deleteByFqn: (options: EndpointOptions<Options$1<ApplicationAccessGrantsDeleteByFqnData, false, unknown>>) => Promise<void>;
|
|
1300
|
-
get: (options: EndpointOptions<Options$1<ApplicationAccessGrantsGetData, false, unknown>>) => Promise<AccessGrant>;
|
|
1301
|
-
getByFqn: (options: EndpointOptions<Options$1<ApplicationAccessGrantsGetByFqnData, false, unknown>>) => Promise<AccessGrant>;
|
|
1302
|
-
list: (options: EndpointOptions<Options$1<ApplicationAccessGrantsListData, false, unknown>>) => Promise<AccessGrantList>;
|
|
1303
|
-
sync: (options: EndpointOptions<Options$1<ApplicationAccessGrantsSyncData, false, unknown>>) => Promise<AccessGrantSyncResult>;
|
|
1304
|
-
update: (options: EndpointOptions<Options$1<ApplicationAccessGrantsUpdateData, false, unknown>>) => Promise<AccessGrant>;
|
|
1305
|
-
updateByFqn: (options: EndpointOptions<Options$1<ApplicationAccessGrantsUpdateByFqnData, false, unknown>>) => Promise<AccessGrant>;
|
|
1306
|
-
};
|
|
1307
|
-
groups: {
|
|
1308
|
-
addMember: (options: EndpointOptions<Options$1<ApplicationAccessGroupsAddMemberData, false, unknown>>) => Promise<void>;
|
|
1309
|
-
create: (options: EndpointOptions<Options$1<ApplicationAccessGroupsCreateData, false, unknown>>) => Promise<AccessGroup>;
|
|
1310
|
-
delete: (options: EndpointOptions<Options$1<ApplicationAccessGroupsDeleteData, false, unknown>>) => Promise<void>;
|
|
1311
|
-
get: (options: EndpointOptions<Options$1<ApplicationAccessGroupsGetData, false, unknown>>) => Promise<AccessGroup>;
|
|
1312
|
-
list: (options: EndpointOptions<Options$1<ApplicationAccessGroupsListData, false, unknown>>) => Promise<AccessGroupPage>;
|
|
1313
|
-
removeMember: (options: EndpointOptions<Options$1<ApplicationAccessGroupsRemoveMemberData, false, unknown>>) => Promise<void>;
|
|
1314
|
-
update: (options: EndpointOptions<Options$1<ApplicationAccessGroupsUpdateData, false, unknown>>) => Promise<AccessGroup>;
|
|
1315
|
-
};
|
|
1316
|
-
invitations: {
|
|
1317
|
-
list: (options: EndpointOptions<Options$1<ApplicationAccessMembersListInvitationsData, false, unknown>>) => Promise<AccessInvitationPage>;
|
|
1318
|
-
revoke: (options: EndpointOptions<Options$1<ApplicationAccessMembersRevokeInvitationData, false, unknown>>) => Promise<void>;
|
|
1319
|
-
};
|
|
1320
|
-
knowledgePolicies: {
|
|
1321
|
-
forSchema: (options: EndpointOptions<Options$1<ApplicationAccessDefinitionsGetSchemaKnowledgePoliciesData, false, unknown>>) => Promise<AccessSchemaKnowledgePolicies>;
|
|
1322
|
-
list: (options: EndpointOptions<Options$1<ApplicationAccessDefinitionsListKnowledgePoliciesData, false, unknown>>) => Promise<AccessKnowledgeDataPolicy[]>;
|
|
1323
|
-
};
|
|
1324
|
-
maxPrivileges: {
|
|
1325
|
-
get: (options: EndpointOptions<Options$1<ApplicationAccessDefinitionsGetMaxPrivilegesData, false, unknown>>) => Promise<AccessProfile>;
|
|
1326
|
-
list: (options: EndpointOptions<Options$1<ApplicationAccessDefinitionsListMaxPrivilegesData, false, unknown>>) => Promise<AccessProfile[]>;
|
|
1327
|
-
};
|
|
1328
|
-
members: {
|
|
1329
|
-
create: (options: EndpointOptions<Options$1<ApplicationAccessMembersCreateData, false, unknown>>) => Promise<AccessMemberCreated>;
|
|
1330
|
-
get: (options: EndpointOptions<Options$1<ApplicationAccessMembersGetData, false, unknown>>) => Promise<AccessMember>;
|
|
1331
|
-
list: (options: EndpointOptions<Options$1<ApplicationAccessMembersListData, false, unknown>>) => Promise<AccessMemberPage>;
|
|
1332
|
-
remove: (options: EndpointOptions<Options$1<ApplicationAccessMembersDeleteData, false, unknown>>) => Promise<void>;
|
|
1333
|
-
resume: (options: EndpointOptions<Options$1<ApplicationAccessMembersResumeData, false, unknown>>) => Promise<void>;
|
|
1334
|
-
suspend: (options: EndpointOptions<Options$1<ApplicationAccessMembersSuspendData, false, unknown>>) => Promise<void>;
|
|
1335
|
-
};
|
|
1336
|
-
profiles: {
|
|
1337
|
-
get: (options: EndpointOptions<Options$1<ApplicationAccessDefinitionsGetProfileData, false, unknown>>) => Promise<AccessProfile>;
|
|
1338
|
-
list: (options: EndpointOptions<Options$1<ApplicationAccessDefinitionsListProfilesData, false, unknown>>) => Promise<AccessProfile[]>;
|
|
1339
|
-
};
|
|
1340
|
-
snapshot: (options: EndpointOptions<Options$1<ApplicationAccessPrincipalsSnapshotData, false, unknown>>) => Promise<AccessSnapshot>;
|
|
1341
|
-
};
|
|
1342
|
-
export type ApplicationAccessApi = ReturnType<typeof createApplicationAccessApi>;
|
|
1343
954
|
export type JsonValue = boolean | null | number | readonly JsonValue[] | Readonly<{
|
|
1344
955
|
readonly [key: string]: JsonValue;
|
|
1345
956
|
}> | string;
|
|
@@ -1605,156 +1216,546 @@ type StorageFileId = string & Readonly<{
|
|
|
1605
1216
|
[storageFileIdBrand]: "StorageFileId";
|
|
1606
1217
|
}>;
|
|
1607
1218
|
/**
|
|
1608
|
-
* One file of up to 10 MiB, base64-encoded. CI accepts the content types
|
|
1609
|
-
* `application/pdf`, `image/jpeg` and `image/png`.
|
|
1219
|
+
* One file of up to 10 MiB, base64-encoded. CI accepts the content types
|
|
1220
|
+
* `application/pdf`, `image/jpeg` and `image/png`.
|
|
1221
|
+
*/
|
|
1222
|
+
interface DurableFileUpload {
|
|
1223
|
+
contentBase64: string;
|
|
1224
|
+
contentType: string;
|
|
1225
|
+
fileName: string;
|
|
1226
|
+
sizeBytes: number;
|
|
1227
|
+
}
|
|
1228
|
+
export interface ExternalApplicationServiceOperationRequest {
|
|
1229
|
+
input: DurableFileUpload;
|
|
1230
|
+
operationId: "files_upload";
|
|
1231
|
+
}
|
|
1232
|
+
export type ExternalApplicationServiceOperationSuccess = EnvelopeSuccess<"files_upload", {
|
|
1233
|
+
storageFileId: StorageFileId;
|
|
1234
|
+
}>;
|
|
1235
|
+
/** Every operation a confidential server client may invoke. */
|
|
1236
|
+
export type ExternalApplicationServerOperationRequest = ExternalApplicationOperationRequest | ExternalApplicationServiceOperationRequest;
|
|
1237
|
+
export type ExternalApplicationOperationFailure = ExternalApplicationsGetContextError;
|
|
1238
|
+
export type ExternalApplicationServerOperationId = ExternalApplicationServerOperationRequest["operationId"];
|
|
1239
|
+
export type ExternalApplicationOperationRequestFor<Id extends ExternalApplicationServerOperationId> = Extract<ExternalApplicationServerOperationRequest, {
|
|
1240
|
+
operationId: Id;
|
|
1241
|
+
}>;
|
|
1242
|
+
export type ExternalApplicationOperationSuccessFor<Id extends ExternalApplicationServerOperationId> = Extract<ExternalApplicationOperationSuccess | ExternalApplicationServiceOperationSuccess, {
|
|
1243
|
+
operationId: Id;
|
|
1244
|
+
}>;
|
|
1245
|
+
export type ExternalApplicationOperationResult<Id extends ExternalApplicationServerOperationId> = Readonly<{
|
|
1246
|
+
error: ExternalApplicationOperationFailure;
|
|
1247
|
+
ok: false;
|
|
1248
|
+
}> | Readonly<{
|
|
1249
|
+
ok: true;
|
|
1250
|
+
value: ExternalApplicationOperationSuccessFor<Id>;
|
|
1251
|
+
}>;
|
|
1252
|
+
export interface ExternalApplicationExternalAuditSubject {
|
|
1253
|
+
readonly issuer: string;
|
|
1254
|
+
readonly mappedUserId?: string;
|
|
1255
|
+
readonly subjectId: string;
|
|
1256
|
+
}
|
|
1257
|
+
type JsonObject$1 = Readonly<Record<string, ResourceJsonValue>>;
|
|
1258
|
+
/** A text, or a text that CI speaks with a Voice of the Organization or a named one. */
|
|
1259
|
+
type MessageContent = Readonly<{
|
|
1260
|
+
kind: "text";
|
|
1261
|
+
text: string;
|
|
1262
|
+
}> | Readonly<{
|
|
1263
|
+
kind: "voice";
|
|
1264
|
+
/** Selects the Voice. Absent: the language detected from `text`. */
|
|
1265
|
+
language?: string;
|
|
1266
|
+
/** Absent: the default text-to-speech Speech Model of the Organization. */
|
|
1267
|
+
modelId?: string;
|
|
1268
|
+
modelSettings?: JsonObject$1;
|
|
1269
|
+
speed?: number;
|
|
1270
|
+
text: string;
|
|
1271
|
+
voice: Readonly<{
|
|
1272
|
+
mode: "organization";
|
|
1273
|
+
}> | Readonly<{
|
|
1274
|
+
mode: "fixed";
|
|
1275
|
+
voiceId: string;
|
|
1276
|
+
}> | Readonly<{
|
|
1277
|
+
mode: "per_language";
|
|
1278
|
+
voices: readonly Readonly<{
|
|
1279
|
+
languageCode: string;
|
|
1280
|
+
voiceId: string;
|
|
1281
|
+
}>[];
|
|
1282
|
+
}>;
|
|
1283
|
+
}>;
|
|
1284
|
+
/**
|
|
1285
|
+
* Where the message goes: the Conversation Reference of an earlier message,
|
|
1286
|
+
* or the recipient fields of the vendor for a new conversation.
|
|
1287
|
+
*/
|
|
1288
|
+
type MessageTarget = Readonly<{
|
|
1289
|
+
conversation: string;
|
|
1290
|
+
mode: "continue";
|
|
1291
|
+
}> | Readonly<{
|
|
1292
|
+
mode: "start_new";
|
|
1293
|
+
recipient: JsonObject$1;
|
|
1294
|
+
}>;
|
|
1295
|
+
export type MessageSendInput = Readonly<{
|
|
1296
|
+
/** A connection that an administrator granted to the application. */
|
|
1297
|
+
connectionId: string;
|
|
1298
|
+
content: MessageContent;
|
|
1299
|
+
idempotencyKey: string;
|
|
1300
|
+
/** Vendor sender fields; required when the account has more than one sender. */
|
|
1301
|
+
sender?: JsonObject$1;
|
|
1302
|
+
/** The vendor service; required when the connection has more than one. */
|
|
1303
|
+
service?: string;
|
|
1304
|
+
target: MessageTarget;
|
|
1305
|
+
}>;
|
|
1306
|
+
/** The vendor accepted the message. It does not mean that a person received it. */
|
|
1307
|
+
type MessageReceipt = Readonly<{
|
|
1308
|
+
/** Continues the conversation of the sent message. */
|
|
1309
|
+
conversation: string;
|
|
1310
|
+
/** The message id of the vendor. */
|
|
1311
|
+
messageId: string;
|
|
1312
|
+
}>;
|
|
1313
|
+
declare const messageSendErrorCodes: readonly [
|
|
1314
|
+
"invalid_message",
|
|
1315
|
+
"recipient_unreachable",
|
|
1316
|
+
"window_closed",
|
|
1317
|
+
"template_required",
|
|
1318
|
+
"not_installed",
|
|
1319
|
+
"unsupported_content",
|
|
1320
|
+
"rejected",
|
|
1321
|
+
"transport",
|
|
1322
|
+
"configuration",
|
|
1323
|
+
"unknown_provider"
|
|
1324
|
+
];
|
|
1325
|
+
/** Why the provider did not send the message. */
|
|
1326
|
+
type MessageSendErrorCode = (typeof messageSendErrorCodes)[number];
|
|
1327
|
+
declare const messageSendFailureCodes: readonly [
|
|
1328
|
+
"authentication_required",
|
|
1329
|
+
"authorization_denied",
|
|
1330
|
+
"conflict",
|
|
1331
|
+
"internal_error",
|
|
1332
|
+
"invalid_request",
|
|
1333
|
+
"message_send_failed",
|
|
1334
|
+
"not_found",
|
|
1335
|
+
"operation_not_allowed",
|
|
1336
|
+
"rate_limited",
|
|
1337
|
+
"send_outcome_unknown",
|
|
1338
|
+
"temporarily_unavailable"
|
|
1339
|
+
];
|
|
1340
|
+
type MessageSendFailure = Readonly<{
|
|
1341
|
+
correlationId: string;
|
|
1342
|
+
error: Readonly<{
|
|
1343
|
+
code: (typeof messageSendFailureCodes)[number];
|
|
1344
|
+
message: string;
|
|
1345
|
+
retryable: boolean;
|
|
1346
|
+
/** Present with the code `message_send_failed`. */
|
|
1347
|
+
sendErrorCode?: MessageSendErrorCode;
|
|
1348
|
+
}>;
|
|
1349
|
+
}>;
|
|
1350
|
+
type MessageSendResult = Readonly<{
|
|
1351
|
+
error: MessageSendFailure;
|
|
1352
|
+
ok: false;
|
|
1353
|
+
}> | Readonly<{
|
|
1354
|
+
ok: true;
|
|
1355
|
+
value: Readonly<{
|
|
1356
|
+
correlationId: string;
|
|
1357
|
+
operationId: "messages_send";
|
|
1358
|
+
result: MessageReceipt;
|
|
1359
|
+
}>;
|
|
1360
|
+
}>;
|
|
1361
|
+
/** One tag of the SDK cache tag vocabulary. */
|
|
1362
|
+
export type CiTag = string & Brand.Brand<"CiTag">;
|
|
1363
|
+
/**
|
|
1364
|
+
* The `invalidate` option of a Vanilla Facade: it gets the Entity Tag and the
|
|
1365
|
+
* Schema Tag of each record write that CI confirmed. In Next.js, pass
|
|
1366
|
+
* `nextInvalidate` of `./next`.
|
|
1610
1367
|
*/
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1368
|
+
export type InvalidateTags = (tags: readonly CiTag[]) => Promise<void> | void;
|
|
1369
|
+
export type AuthToken = string | undefined;
|
|
1370
|
+
export interface Auth {
|
|
1371
|
+
/**
|
|
1372
|
+
* Which part of the request do we use to send the auth?
|
|
1373
|
+
*
|
|
1374
|
+
* @default 'header'
|
|
1375
|
+
*/
|
|
1376
|
+
in?: "header" | "query" | "cookie";
|
|
1377
|
+
/**
|
|
1378
|
+
* Header or query parameter name.
|
|
1379
|
+
*
|
|
1380
|
+
* @default 'Authorization'
|
|
1381
|
+
*/
|
|
1382
|
+
name?: string;
|
|
1383
|
+
scheme?: "basic" | "bearer";
|
|
1384
|
+
type: "apiKey" | "http";
|
|
1385
|
+
}
|
|
1386
|
+
export interface SerializerOptions<T> {
|
|
1387
|
+
/**
|
|
1388
|
+
* @default true
|
|
1389
|
+
*/
|
|
1390
|
+
explode: boolean;
|
|
1391
|
+
style: T;
|
|
1392
|
+
}
|
|
1393
|
+
export type ArrayStyle = "form" | "spaceDelimited" | "pipeDelimited";
|
|
1394
|
+
export type ObjectStyle = "form" | "deepObject";
|
|
1395
|
+
export type QuerySerializer = (query: Record<string, unknown>) => string;
|
|
1396
|
+
export type BodySerializer = (body: unknown) => unknown;
|
|
1397
|
+
export type QuerySerializerOptionsObject = {
|
|
1398
|
+
allowReserved?: boolean;
|
|
1399
|
+
array?: Partial<SerializerOptions<ArrayStyle>>;
|
|
1400
|
+
object?: Partial<SerializerOptions<ObjectStyle>>;
|
|
1401
|
+
};
|
|
1402
|
+
export type QuerySerializerOptions = QuerySerializerOptionsObject & {
|
|
1403
|
+
/**
|
|
1404
|
+
* Per-parameter serialization overrides. When provided, these settings
|
|
1405
|
+
* override the global array/object settings for specific parameter names.
|
|
1406
|
+
*/
|
|
1407
|
+
parameters?: Record<string, QuerySerializerOptionsObject>;
|
|
1408
|
+
};
|
|
1409
|
+
export type HttpMethod = "connect" | "delete" | "get" | "head" | "options" | "patch" | "post" | "put" | "trace";
|
|
1410
|
+
export type Client<RequestFn = never, Config = unknown, MethodFn = never, BuildUrlFn = never, SseFn = never> = {
|
|
1411
|
+
/**
|
|
1412
|
+
* Returns the final request URL.
|
|
1413
|
+
*/
|
|
1414
|
+
buildUrl: BuildUrlFn;
|
|
1415
|
+
getConfig: () => Config;
|
|
1416
|
+
request: RequestFn;
|
|
1417
|
+
setConfig: (config: Config) => Config;
|
|
1418
|
+
} & {
|
|
1419
|
+
[K in HttpMethod]: MethodFn;
|
|
1420
|
+
} & ([
|
|
1421
|
+
SseFn
|
|
1422
|
+
] extends [
|
|
1423
|
+
never
|
|
1424
|
+
] ? {
|
|
1425
|
+
sse?: never;
|
|
1426
|
+
} : {
|
|
1427
|
+
sse: {
|
|
1428
|
+
[K in HttpMethod]: SseFn;
|
|
1429
|
+
};
|
|
1430
|
+
});
|
|
1431
|
+
export interface Config {
|
|
1432
|
+
/**
|
|
1433
|
+
* Auth token or a function returning auth token. The resolved value will be
|
|
1434
|
+
* added to the request payload as defined by its `security` array.
|
|
1435
|
+
*/
|
|
1436
|
+
auth?: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken;
|
|
1437
|
+
/**
|
|
1438
|
+
* A function for serializing request body parameter. By default,
|
|
1439
|
+
* {@link JSON.stringify()} will be used.
|
|
1440
|
+
*/
|
|
1441
|
+
bodySerializer?: BodySerializer | null;
|
|
1442
|
+
/**
|
|
1443
|
+
* An object containing any HTTP headers that you want to pre-populate your
|
|
1444
|
+
* `Headers` object with.
|
|
1445
|
+
*
|
|
1446
|
+
* {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
|
|
1447
|
+
*/
|
|
1448
|
+
headers?: RequestInit["headers"] | Record<string, string | number | boolean | (string | number | boolean)[] | null | undefined | unknown>;
|
|
1449
|
+
/**
|
|
1450
|
+
* The request method.
|
|
1451
|
+
*
|
|
1452
|
+
* {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
|
|
1453
|
+
*/
|
|
1454
|
+
method?: Uppercase<HttpMethod>;
|
|
1455
|
+
/**
|
|
1456
|
+
* A function for serializing request query parameters. By default, arrays
|
|
1457
|
+
* will be exploded in form style, objects will be exploded in deepObject
|
|
1458
|
+
* style, and reserved characters are percent-encoded.
|
|
1459
|
+
*
|
|
1460
|
+
* This method will have no effect if the native `paramsSerializer()` Axios
|
|
1461
|
+
* API function is used.
|
|
1462
|
+
*
|
|
1463
|
+
* {@link https://swagger.io/docs/specification/serialization/#query View examples}
|
|
1464
|
+
*/
|
|
1465
|
+
querySerializer?: QuerySerializer | QuerySerializerOptions;
|
|
1466
|
+
/**
|
|
1467
|
+
* A function validating request data. This is useful if you want to ensure
|
|
1468
|
+
* the request conforms to the desired shape, so it can be safely sent to
|
|
1469
|
+
* the server.
|
|
1470
|
+
*/
|
|
1471
|
+
requestValidator?: (data: unknown) => Promise<unknown>;
|
|
1472
|
+
/**
|
|
1473
|
+
* A function transforming response data before it's returned. This is useful
|
|
1474
|
+
* for post-processing data, e.g., converting ISO strings into Date objects.
|
|
1475
|
+
*/
|
|
1476
|
+
responseTransformer?: (data: unknown) => Promise<unknown>;
|
|
1477
|
+
/**
|
|
1478
|
+
* A function validating response data. This is useful if you want to ensure
|
|
1479
|
+
* the response conforms to the desired shape, so it can be safely passed to
|
|
1480
|
+
* the transformers and returned to the user.
|
|
1481
|
+
*/
|
|
1482
|
+
responseValidator?: (data: unknown) => Promise<unknown>;
|
|
1483
|
+
}
|
|
1484
|
+
export type ServerSentEventsOptions<TData = unknown> = Omit<RequestInit, "body" | "method"> & Pick<Config, "method" | "responseTransformer" | "responseValidator"> & {
|
|
1485
|
+
/**
|
|
1486
|
+
* Fetch API implementation. You can use this option to provide a custom
|
|
1487
|
+
* fetch instance.
|
|
1488
|
+
*
|
|
1489
|
+
* @default globalThis.fetch
|
|
1490
|
+
*/
|
|
1491
|
+
body?: RequestInit["body"] | undefined;
|
|
1492
|
+
fetch?: typeof fetch;
|
|
1493
|
+
/**
|
|
1494
|
+
* Implementing clients can call request interceptors inside this hook.
|
|
1495
|
+
*/
|
|
1496
|
+
onRequest?: (url: string, init: RequestInit) => Promise<Request>;
|
|
1497
|
+
/**
|
|
1498
|
+
* Callback invoked when a network or parsing error occurs during streaming.
|
|
1499
|
+
*
|
|
1500
|
+
* This option applies only if the endpoint returns a stream of events.
|
|
1501
|
+
*
|
|
1502
|
+
* @param error The error that occurred.
|
|
1503
|
+
*/
|
|
1504
|
+
onSseError?: (error: unknown) => void;
|
|
1505
|
+
/**
|
|
1506
|
+
* Callback invoked when an event is streamed from the server.
|
|
1507
|
+
*
|
|
1508
|
+
* This option applies only if the endpoint returns a stream of events.
|
|
1509
|
+
*
|
|
1510
|
+
* @param event Event streamed from the server.
|
|
1511
|
+
* @returns Nothing (void).
|
|
1512
|
+
*/
|
|
1513
|
+
onSseEvent?: (event: StreamEvent<TData>) => void;
|
|
1514
|
+
serializedBody?: RequestInit["body"] | undefined;
|
|
1515
|
+
/**
|
|
1516
|
+
* Default retry delay in milliseconds.
|
|
1517
|
+
*
|
|
1518
|
+
* This option applies only if the endpoint returns a stream of events.
|
|
1519
|
+
*
|
|
1520
|
+
* @default 3000
|
|
1521
|
+
*/
|
|
1522
|
+
sseDefaultRetryDelay?: number;
|
|
1523
|
+
/**
|
|
1524
|
+
* Maximum number of retry attempts before giving up.
|
|
1525
|
+
*/
|
|
1526
|
+
sseMaxRetryAttempts?: number;
|
|
1527
|
+
/**
|
|
1528
|
+
* Maximum retry delay in milliseconds.
|
|
1529
|
+
*
|
|
1530
|
+
* Applies only when exponential backoff is used.
|
|
1531
|
+
*
|
|
1532
|
+
* This option applies only if the endpoint returns a stream of events.
|
|
1533
|
+
*
|
|
1534
|
+
* @default 30000
|
|
1535
|
+
*/
|
|
1536
|
+
sseMaxRetryDelay?: number;
|
|
1537
|
+
/**
|
|
1538
|
+
* Optional sleep function for retry backoff.
|
|
1539
|
+
*
|
|
1540
|
+
* Defaults to using `setTimeout`.
|
|
1541
|
+
*/
|
|
1542
|
+
sseSleepFn?: (ms: number) => Promise<void>;
|
|
1543
|
+
url: string;
|
|
1544
|
+
};
|
|
1545
|
+
export interface StreamEvent<TData = unknown> {
|
|
1546
|
+
data: TData;
|
|
1547
|
+
event?: string | undefined;
|
|
1548
|
+
id?: string | undefined;
|
|
1549
|
+
retry?: number;
|
|
1550
|
+
}
|
|
1551
|
+
export type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unknown> = {
|
|
1552
|
+
stream: AsyncGenerator<TData extends Record<string, unknown> ? TData[keyof TData] : TData, TReturn, TNext>;
|
|
1553
|
+
};
|
|
1554
|
+
export type ErrInterceptor<Err, Res, Req, Options> = (error: Err, response: Res, request: Req, options: Options) => Err | Promise<Err>;
|
|
1555
|
+
export type ReqInterceptor<Req, Options> = (request: Req, options: Options) => Req | Promise<Req>;
|
|
1556
|
+
export type ResInterceptor<Res, Req, Options> = (response: Res, request: Req, options: Options) => Res | Promise<Res>;
|
|
1557
|
+
declare class Interceptors<Interceptor> {
|
|
1558
|
+
fns: Array<Interceptor | null>;
|
|
1559
|
+
clear(): void;
|
|
1560
|
+
eject(id: number | Interceptor): void;
|
|
1561
|
+
exists(id: number | Interceptor): boolean;
|
|
1562
|
+
getInterceptorIndex(id: number | Interceptor): number;
|
|
1563
|
+
update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false;
|
|
1564
|
+
use(fn: Interceptor): number;
|
|
1565
|
+
}
|
|
1566
|
+
export interface Middleware<Req, Res, Err, Options> {
|
|
1567
|
+
error: Interceptors<ErrInterceptor<Err, Res, Req, Options>>;
|
|
1568
|
+
request: Interceptors<ReqInterceptor<Req, Options>>;
|
|
1569
|
+
response: Interceptors<ResInterceptor<Res, Req, Options>>;
|
|
1570
|
+
}
|
|
1571
|
+
export type ResponseStyle = "data" | "fields";
|
|
1572
|
+
interface Config$1<T extends ClientOptions = ClientOptions> extends Omit<RequestInit, "body" | "headers" | "method">, Config {
|
|
1573
|
+
/**
|
|
1574
|
+
* Base URL for all requests made by this client.
|
|
1575
|
+
*/
|
|
1576
|
+
baseUrl?: T["baseUrl"];
|
|
1577
|
+
/**
|
|
1578
|
+
* Fetch API implementation. You can use this option to provide a custom
|
|
1579
|
+
* fetch instance.
|
|
1580
|
+
*
|
|
1581
|
+
* @default globalThis.fetch
|
|
1582
|
+
*/
|
|
1583
|
+
fetch?: typeof fetch;
|
|
1584
|
+
/**
|
|
1585
|
+
* Please don't use the Fetch client for Next.js applications. The `next`
|
|
1586
|
+
* options won't have any effect.
|
|
1587
|
+
*
|
|
1588
|
+
* Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead.
|
|
1589
|
+
*/
|
|
1590
|
+
next?: never;
|
|
1591
|
+
/**
|
|
1592
|
+
* Return the response data parsed in a specified format. By default, `auto`
|
|
1593
|
+
* will infer the appropriate method from the `Content-Type` response header.
|
|
1594
|
+
* You can override this behavior with any of the {@link Body} methods.
|
|
1595
|
+
* Select `stream` if you don't want to parse response data at all.
|
|
1596
|
+
*
|
|
1597
|
+
* @default 'auto'
|
|
1598
|
+
*/
|
|
1599
|
+
parseAs?: "arrayBuffer" | "auto" | "blob" | "formData" | "json" | "stream" | "text";
|
|
1600
|
+
/**
|
|
1601
|
+
* Should we return only data or multiple fields (data, error, response, etc.)?
|
|
1602
|
+
*
|
|
1603
|
+
* @default 'fields'
|
|
1604
|
+
*/
|
|
1605
|
+
responseStyle?: ResponseStyle;
|
|
1606
|
+
/**
|
|
1607
|
+
* Throw an error instead of returning it in the response?
|
|
1608
|
+
*
|
|
1609
|
+
* @default false
|
|
1610
|
+
*/
|
|
1611
|
+
throwOnError?: T["throwOnError"];
|
|
1616
1612
|
}
|
|
1617
|
-
export interface
|
|
1618
|
-
|
|
1619
|
-
|
|
1613
|
+
export interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle = "fields", ThrowOnError extends boolean = boolean, Url extends string = string> extends Config$1<{
|
|
1614
|
+
responseStyle: TResponseStyle;
|
|
1615
|
+
throwOnError: ThrowOnError;
|
|
1616
|
+
}>, Pick<ServerSentEventsOptions<TData>, "onRequest" | "onSseError" | "onSseEvent" | "sseDefaultRetryDelay" | "sseMaxRetryAttempts" | "sseMaxRetryDelay"> {
|
|
1617
|
+
/**
|
|
1618
|
+
* Any body that you want to add to your request.
|
|
1619
|
+
*
|
|
1620
|
+
* {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
|
|
1621
|
+
*/
|
|
1622
|
+
body?: unknown;
|
|
1623
|
+
path?: Record<string, unknown>;
|
|
1624
|
+
query?: Record<string, unknown>;
|
|
1625
|
+
/**
|
|
1626
|
+
* Security mechanism(s) to use for the request.
|
|
1627
|
+
*/
|
|
1628
|
+
security?: ReadonlyArray<Auth>;
|
|
1629
|
+
url: Url;
|
|
1620
1630
|
}
|
|
1621
|
-
export
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
/** Every operation a confidential server client may invoke. */
|
|
1625
|
-
export type ExternalApplicationServerOperationRequest = ExternalApplicationOperationRequest | ExternalApplicationServiceOperationRequest;
|
|
1626
|
-
export type ExternalApplicationOperationFailure = ExternalApplicationsGetContextError;
|
|
1627
|
-
export type ExternalApplicationServerOperationId = ExternalApplicationServerOperationRequest["operationId"];
|
|
1628
|
-
export type ExternalApplicationOperationRequestFor<Id extends ExternalApplicationServerOperationId> = Extract<ExternalApplicationServerOperationRequest, {
|
|
1629
|
-
operationId: Id;
|
|
1630
|
-
}>;
|
|
1631
|
-
export type ExternalApplicationOperationSuccessFor<Id extends ExternalApplicationServerOperationId> = Extract<ExternalApplicationOperationSuccess | ExternalApplicationServiceOperationSuccess, {
|
|
1632
|
-
operationId: Id;
|
|
1633
|
-
}>;
|
|
1634
|
-
export type ExternalApplicationOperationResult<Id extends ExternalApplicationServerOperationId> = Readonly<{
|
|
1635
|
-
error: ExternalApplicationOperationFailure;
|
|
1636
|
-
ok: false;
|
|
1637
|
-
}> | Readonly<{
|
|
1638
|
-
ok: true;
|
|
1639
|
-
value: ExternalApplicationOperationSuccessFor<Id>;
|
|
1640
|
-
}>;
|
|
1641
|
-
export interface ExternalApplicationExternalAuditSubject {
|
|
1642
|
-
readonly issuer: string;
|
|
1643
|
-
readonly mappedUserId?: string;
|
|
1644
|
-
readonly subjectId: string;
|
|
1631
|
+
export interface ResolvedRequestOptions<TResponseStyle extends ResponseStyle = "fields", ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions<unknown, TResponseStyle, ThrowOnError, Url> {
|
|
1632
|
+
headers: Headers;
|
|
1633
|
+
serializedBody?: string | undefined;
|
|
1645
1634
|
}
|
|
1646
|
-
type
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
text: string;
|
|
1660
|
-
voice: Readonly<{
|
|
1661
|
-
mode: "organization";
|
|
1662
|
-
}> | Readonly<{
|
|
1663
|
-
mode: "fixed";
|
|
1664
|
-
voiceId: string;
|
|
1665
|
-
}> | Readonly<{
|
|
1666
|
-
mode: "per_language";
|
|
1667
|
-
voices: readonly Readonly<{
|
|
1668
|
-
languageCode: string;
|
|
1669
|
-
voiceId: string;
|
|
1670
|
-
}>[];
|
|
1671
|
-
}>;
|
|
1672
|
-
}>;
|
|
1673
|
-
/**
|
|
1674
|
-
* Where the message goes: the Conversation Reference of an earlier message,
|
|
1675
|
-
* or the recipient fields of the vendor for a new conversation.
|
|
1676
|
-
*/
|
|
1677
|
-
type MessageTarget = Readonly<{
|
|
1678
|
-
conversation: string;
|
|
1679
|
-
mode: "continue";
|
|
1680
|
-
}> | Readonly<{
|
|
1681
|
-
mode: "start_new";
|
|
1682
|
-
recipient: JsonObject$1;
|
|
1683
|
-
}>;
|
|
1684
|
-
export type MessageSendInput = Readonly<{
|
|
1685
|
-
/** A connection that an administrator granted to the application. */
|
|
1686
|
-
connectionId: string;
|
|
1687
|
-
content: MessageContent;
|
|
1688
|
-
idempotencyKey: string;
|
|
1689
|
-
/** Vendor sender fields; required when the account has more than one sender. */
|
|
1690
|
-
sender?: JsonObject$1;
|
|
1691
|
-
/** The vendor service; required when the connection has more than one. */
|
|
1692
|
-
service?: string;
|
|
1693
|
-
target: MessageTarget;
|
|
1694
|
-
}>;
|
|
1695
|
-
/** The vendor accepted the message. It does not mean that a person received it. */
|
|
1696
|
-
type MessageReceipt = Readonly<{
|
|
1697
|
-
/** Continues the conversation of the sent message. */
|
|
1698
|
-
conversation: string;
|
|
1699
|
-
/** The message id of the vendor. */
|
|
1700
|
-
messageId: string;
|
|
1701
|
-
}>;
|
|
1702
|
-
declare const messageSendErrorCodes: readonly [
|
|
1703
|
-
"invalid_message",
|
|
1704
|
-
"recipient_unreachable",
|
|
1705
|
-
"window_closed",
|
|
1706
|
-
"template_required",
|
|
1707
|
-
"not_installed",
|
|
1708
|
-
"unsupported_content",
|
|
1709
|
-
"rejected",
|
|
1710
|
-
"transport",
|
|
1711
|
-
"configuration",
|
|
1712
|
-
"unknown_provider"
|
|
1713
|
-
];
|
|
1714
|
-
/** Why the provider did not send the message. */
|
|
1715
|
-
type MessageSendErrorCode = (typeof messageSendErrorCodes)[number];
|
|
1716
|
-
declare const messageSendFailureCodes: readonly [
|
|
1717
|
-
"authentication_required",
|
|
1718
|
-
"authorization_denied",
|
|
1719
|
-
"conflict",
|
|
1720
|
-
"internal_error",
|
|
1721
|
-
"invalid_request",
|
|
1722
|
-
"message_send_failed",
|
|
1723
|
-
"not_found",
|
|
1724
|
-
"operation_not_allowed",
|
|
1725
|
-
"rate_limited",
|
|
1726
|
-
"send_outcome_unknown",
|
|
1727
|
-
"temporarily_unavailable"
|
|
1728
|
-
];
|
|
1729
|
-
type MessageSendFailure = Readonly<{
|
|
1730
|
-
correlationId: string;
|
|
1731
|
-
error: Readonly<{
|
|
1732
|
-
code: (typeof messageSendFailureCodes)[number];
|
|
1733
|
-
message: string;
|
|
1734
|
-
retryable: boolean;
|
|
1735
|
-
/** Present with the code `message_send_failed`. */
|
|
1736
|
-
sendErrorCode?: MessageSendErrorCode;
|
|
1737
|
-
}>;
|
|
1738
|
-
}>;
|
|
1739
|
-
type MessageSendResult = Readonly<{
|
|
1740
|
-
error: MessageSendFailure;
|
|
1741
|
-
ok: false;
|
|
1742
|
-
}> | Readonly<{
|
|
1743
|
-
ok: true;
|
|
1744
|
-
value: Readonly<{
|
|
1745
|
-
correlationId: string;
|
|
1746
|
-
operationId: "messages_send";
|
|
1747
|
-
result: MessageReceipt;
|
|
1748
|
-
}>;
|
|
1635
|
+
export type RequestResult<TData = unknown, TError = unknown, ThrowOnError extends boolean = boolean, TResponseStyle extends ResponseStyle = "fields"> = ThrowOnError extends true ? Promise<TResponseStyle extends "data" ? TData extends Record<string, unknown> ? TData[keyof TData] : TData : {
|
|
1636
|
+
data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
|
|
1637
|
+
request: Request;
|
|
1638
|
+
response: Response;
|
|
1639
|
+
}> : Promise<TResponseStyle extends "data" ? (TData extends Record<string, unknown> ? TData[keyof TData] : TData) | undefined : ({
|
|
1640
|
+
data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
|
|
1641
|
+
error: undefined;
|
|
1642
|
+
} | {
|
|
1643
|
+
data: undefined;
|
|
1644
|
+
error: TError extends Record<string, unknown> ? TError[keyof TError] : TError;
|
|
1645
|
+
}) & {
|
|
1646
|
+
request: Request;
|
|
1647
|
+
response: Response;
|
|
1749
1648
|
}>;
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
export type
|
|
1649
|
+
export interface ClientOptions {
|
|
1650
|
+
baseUrl?: string;
|
|
1651
|
+
responseStyle?: ResponseStyle;
|
|
1652
|
+
throwOnError?: boolean;
|
|
1653
|
+
}
|
|
1654
|
+
export type MethodFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
1655
|
+
export type SseFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<never, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData, TError>>;
|
|
1656
|
+
export type RequestFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method"> & Pick<Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
|
|
1657
|
+
export type BuildUrlFn = <TData extends {
|
|
1658
|
+
body?: unknown;
|
|
1659
|
+
path?: Record<string, unknown>;
|
|
1660
|
+
query?: Record<string, unknown>;
|
|
1661
|
+
url: string;
|
|
1662
|
+
}>(options: TData & Options<TData>) => string;
|
|
1663
|
+
type Client$1 = Client<RequestFn, Config$1, MethodFn, BuildUrlFn, SseFn> & {
|
|
1664
|
+
interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>;
|
|
1665
|
+
};
|
|
1666
|
+
export interface TEndpointData {
|
|
1667
|
+
body?: unknown;
|
|
1668
|
+
headers?: unknown;
|
|
1669
|
+
path?: unknown;
|
|
1670
|
+
query?: unknown;
|
|
1671
|
+
url: string;
|
|
1672
|
+
}
|
|
1673
|
+
export type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
|
|
1674
|
+
export type Options<TData extends TEndpointData = TEndpointData, ThrowOnError extends boolean = boolean, TResponse = unknown, TResponseStyle extends ResponseStyle = "fields"> = OmitKeys<RequestOptions<TResponse, TResponseStyle, ThrowOnError>, "body" | "path" | "query" | "url"> & ([
|
|
1675
|
+
TData
|
|
1676
|
+
] extends [
|
|
1677
|
+
never
|
|
1678
|
+
] ? unknown : Omit<TData, "url">);
|
|
1679
|
+
type Options$1<TData extends TEndpointData = TEndpointData, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options<TData, ThrowOnError, TResponse> & {
|
|
1680
|
+
/**
|
|
1681
|
+
* You can provide a client instance returned by `createClient()` instead of
|
|
1682
|
+
* individual options. This might be also useful if you want to implement a
|
|
1683
|
+
* custom client.
|
|
1684
|
+
*/
|
|
1685
|
+
client?: Client$1;
|
|
1686
|
+
/**
|
|
1687
|
+
* You can pass arbitrary values through the `meta` object. This can be
|
|
1688
|
+
* used to access values that aren't defined as part of the SDK function.
|
|
1689
|
+
*/
|
|
1690
|
+
meta?: Record<string, unknown>;
|
|
1691
|
+
};
|
|
1692
|
+
export type EndpointOptions<OptionsType> = Pick<OptionsType, Extract<keyof OptionsType, "body" | "headers" | "path" | "query">>;
|
|
1693
|
+
declare const createApplicationAccessApi: (client: Client$1) => {
|
|
1694
|
+
axes: {
|
|
1695
|
+
list: (options: EndpointOptions<Options$1<ApplicationAccessDefinitionsListAxesData, false, unknown>>) => Promise<AccessGrantAxis[]>;
|
|
1696
|
+
};
|
|
1697
|
+
catalog: {
|
|
1698
|
+
list: (options: EndpointOptions<Options$1<ApplicationAccessDefinitionsListCapabilitiesData, false, unknown>>) => Promise<AccessCapabilityNode[]>;
|
|
1699
|
+
};
|
|
1700
|
+
explain: (options: EndpointOptions<Options$1<ApplicationAccessPrincipalsExplainData, false, unknown>>) => Promise<AccessExplanation>;
|
|
1701
|
+
grants: {
|
|
1702
|
+
create: (options: EndpointOptions<Options$1<ApplicationAccessGrantsCreateData, false, unknown>>) => Promise<AccessGrant>;
|
|
1703
|
+
delete: (options: EndpointOptions<Options$1<ApplicationAccessGrantsDeleteData, false, unknown>>) => Promise<void>;
|
|
1704
|
+
deleteByFqn: (options: EndpointOptions<Options$1<ApplicationAccessGrantsDeleteByFqnData, false, unknown>>) => Promise<void>;
|
|
1705
|
+
get: (options: EndpointOptions<Options$1<ApplicationAccessGrantsGetData, false, unknown>>) => Promise<AccessGrant>;
|
|
1706
|
+
getByFqn: (options: EndpointOptions<Options$1<ApplicationAccessGrantsGetByFqnData, false, unknown>>) => Promise<AccessGrant>;
|
|
1707
|
+
list: (options: EndpointOptions<Options$1<ApplicationAccessGrantsListData, false, unknown>>) => Promise<AccessGrantList>;
|
|
1708
|
+
sync: (options: EndpointOptions<Options$1<ApplicationAccessGrantsSyncData, false, unknown>>) => Promise<AccessGrantSyncResult>;
|
|
1709
|
+
update: (options: EndpointOptions<Options$1<ApplicationAccessGrantsUpdateData, false, unknown>>) => Promise<AccessGrant>;
|
|
1710
|
+
updateByFqn: (options: EndpointOptions<Options$1<ApplicationAccessGrantsUpdateByFqnData, false, unknown>>) => Promise<AccessGrant>;
|
|
1711
|
+
};
|
|
1712
|
+
groups: {
|
|
1713
|
+
addMember: (options: EndpointOptions<Options$1<ApplicationAccessGroupsAddMemberData, false, unknown>>) => Promise<void>;
|
|
1714
|
+
create: (options: EndpointOptions<Options$1<ApplicationAccessGroupsCreateData, false, unknown>>) => Promise<AccessGroup>;
|
|
1715
|
+
delete: (options: EndpointOptions<Options$1<ApplicationAccessGroupsDeleteData, false, unknown>>) => Promise<void>;
|
|
1716
|
+
get: (options: EndpointOptions<Options$1<ApplicationAccessGroupsGetData, false, unknown>>) => Promise<AccessGroup>;
|
|
1717
|
+
list: (options: EndpointOptions<Options$1<ApplicationAccessGroupsListData, false, unknown>>) => Promise<AccessGroupPage>;
|
|
1718
|
+
removeMember: (options: EndpointOptions<Options$1<ApplicationAccessGroupsRemoveMemberData, false, unknown>>) => Promise<void>;
|
|
1719
|
+
update: (options: EndpointOptions<Options$1<ApplicationAccessGroupsUpdateData, false, unknown>>) => Promise<AccessGroup>;
|
|
1720
|
+
};
|
|
1721
|
+
invitations: {
|
|
1722
|
+
list: (options: EndpointOptions<Options$1<ApplicationAccessMembersListInvitationsData, false, unknown>>) => Promise<AccessInvitationPage>;
|
|
1723
|
+
revoke: (options: EndpointOptions<Options$1<ApplicationAccessMembersRevokeInvitationData, false, unknown>>) => Promise<void>;
|
|
1724
|
+
};
|
|
1725
|
+
knowledgePolicies: {
|
|
1726
|
+
forSchema: (options: EndpointOptions<Options$1<ApplicationAccessDefinitionsGetSchemaKnowledgePoliciesData, false, unknown>>) => Promise<AccessSchemaKnowledgePolicies>;
|
|
1727
|
+
list: (options: EndpointOptions<Options$1<ApplicationAccessDefinitionsListKnowledgePoliciesData, false, unknown>>) => Promise<AccessKnowledgeDataPolicy[]>;
|
|
1728
|
+
};
|
|
1729
|
+
maxPrivileges: {
|
|
1730
|
+
get: (options: EndpointOptions<Options$1<ApplicationAccessDefinitionsGetMaxPrivilegesData, false, unknown>>) => Promise<AccessProfile>;
|
|
1731
|
+
list: (options: EndpointOptions<Options$1<ApplicationAccessDefinitionsListMaxPrivilegesData, false, unknown>>) => Promise<AccessProfile[]>;
|
|
1732
|
+
};
|
|
1733
|
+
members: {
|
|
1734
|
+
create: (options: EndpointOptions<Options$1<ApplicationAccessMembersCreateData, false, unknown>>) => Promise<AccessMemberCreated>;
|
|
1735
|
+
get: (options: EndpointOptions<Options$1<ApplicationAccessMembersGetData, false, unknown>>) => Promise<AccessMember>;
|
|
1736
|
+
list: (options: EndpointOptions<Options$1<ApplicationAccessMembersListData, false, unknown>>) => Promise<AccessMemberPage>;
|
|
1737
|
+
remove: (options: EndpointOptions<Options$1<ApplicationAccessMembersDeleteData, false, unknown>>) => Promise<void>;
|
|
1738
|
+
resume: (options: EndpointOptions<Options$1<ApplicationAccessMembersResumeData, false, unknown>>) => Promise<void>;
|
|
1739
|
+
suspend: (options: EndpointOptions<Options$1<ApplicationAccessMembersSuspendData, false, unknown>>) => Promise<void>;
|
|
1740
|
+
};
|
|
1741
|
+
profiles: {
|
|
1742
|
+
get: (options: EndpointOptions<Options$1<ApplicationAccessDefinitionsGetProfileData, false, unknown>>) => Promise<AccessProfile>;
|
|
1743
|
+
list: (options: EndpointOptions<Options$1<ApplicationAccessDefinitionsListProfilesData, false, unknown>>) => Promise<AccessProfile[]>;
|
|
1744
|
+
};
|
|
1745
|
+
snapshot: (options: EndpointOptions<Options$1<ApplicationAccessPrincipalsSnapshotData, false, unknown>>) => Promise<AccessSnapshot>;
|
|
1746
|
+
};
|
|
1747
|
+
export type ApplicationAccessApi = ReturnType<typeof createApplicationAccessApi>;
|
|
1748
|
+
declare const ServerAccessError_base: Schema.Class<ServerAccessError, Schema.TaggedStruct<"ServerAccessError", {
|
|
1749
|
+
readonly body: Schema.StructWithRest<Schema.Struct<{
|
|
1750
|
+
readonly _tag: Schema.String;
|
|
1751
|
+
}>, readonly [
|
|
1752
|
+
Schema.$Record<Schema.String, Schema.Unknown>
|
|
1753
|
+
]>;
|
|
1754
|
+
readonly status: Schema.Int;
|
|
1755
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1756
|
+
declare class ServerAccessError extends ServerAccessError_base {
|
|
1757
|
+
get message(): string;
|
|
1758
|
+
}
|
|
1758
1759
|
declare const oauthErrorCodes: readonly [
|
|
1759
1760
|
"invalid_client",
|
|
1760
1761
|
"invalid_grant",
|
|
@@ -1797,6 +1798,137 @@ declare class MemberSessionExchangeError extends MemberSessionExchangeError_base
|
|
|
1797
1798
|
}>, options: Schema.MakeOptions | undefined);
|
|
1798
1799
|
get message(): string;
|
|
1799
1800
|
}
|
|
1801
|
+
/** The Organization a `ci.access` call acts in. */
|
|
1802
|
+
export type ServerAccessContext = Readonly<{
|
|
1803
|
+
organizationId: string;
|
|
1804
|
+
}>;
|
|
1805
|
+
export type OptionsOf<F> = F extends (options: infer Options) => PromiseLike<infer _> ? Options : never;
|
|
1806
|
+
export type BodyOf<F> = OptionsOf<F> extends {
|
|
1807
|
+
body: infer B;
|
|
1808
|
+
} ? B : never;
|
|
1809
|
+
export type PathOf<F> = OptionsOf<F> extends {
|
|
1810
|
+
path: infer P;
|
|
1811
|
+
} ? P : never;
|
|
1812
|
+
export type QueryOf<F> = OptionsOf<F> extends {
|
|
1813
|
+
query?: infer Q;
|
|
1814
|
+
} ? NonNullable<Q> : never;
|
|
1815
|
+
export type ResultOf<F> = F extends (options: never) => PromiseLike<infer Result> ? Result : never;
|
|
1816
|
+
export type Api = ApplicationAccessApi;
|
|
1817
|
+
export type WithBody<F> = ServerAccessContext & BodyOf<F>;
|
|
1818
|
+
export type WithPath<F> = ServerAccessContext & PathOf<F>;
|
|
1819
|
+
/** How a `ci.access` call fails. */
|
|
1820
|
+
export type ServerAccessFailure = CiTransportError | ServerAccessError;
|
|
1821
|
+
export type Call<Request, Result> = (request: Request) => Effect.Effect<Result, ServerAccessFailure>;
|
|
1822
|
+
export type Method<Request, F> = Call<Request, ResultOf<F>>;
|
|
1823
|
+
/** A grant named by its id or by its Access Grant FQN. */
|
|
1824
|
+
export type GrantReference = PathOf<Api["grants"]["get"]> | PathOf<Api["grants"]["getByFqn"]>;
|
|
1825
|
+
export type ServerAccessMember = ResultOf<Api["members"]["get"]>;
|
|
1826
|
+
export type ServerAccessGrant = ResultOf<Api["grants"]["get"]>;
|
|
1827
|
+
/** The `access` service of a `ServerClient`. */
|
|
1828
|
+
export interface ServerAccessService {
|
|
1829
|
+
/** The Grant Axes and the slugs that key Axis Values. Needs `admin.profiles` at read. */
|
|
1830
|
+
readonly axes: Readonly<{
|
|
1831
|
+
list: Method<ServerAccessContext, Api["axes"]["list"]>;
|
|
1832
|
+
}>;
|
|
1833
|
+
/** The Capability Catalog of the Organization. Needs `admin.profiles` at read. */
|
|
1834
|
+
readonly catalog: Readonly<{
|
|
1835
|
+
list: Method<ServerAccessContext, Api["catalog"]["list"]>;
|
|
1836
|
+
}>;
|
|
1837
|
+
/**
|
|
1838
|
+
* Why a principal may use a capability or act on a Knowledge record: its
|
|
1839
|
+
* grants with their path and the matching policies. Needs `admin.grants`
|
|
1840
|
+
* at read.
|
|
1841
|
+
*/
|
|
1842
|
+
readonly explain: Method<WithBody<Api["explain"]>, Api["explain"]>;
|
|
1843
|
+
/**
|
|
1844
|
+
* Access Grants by id or Access Grant FQN. Writes need `admin.grants` at
|
|
1845
|
+
* manage and pass Grant Authority; `sync` makes the runtime grants below
|
|
1846
|
+
* a namespace exactly the list. Reads need `admin.grants` at read.
|
|
1847
|
+
*/
|
|
1848
|
+
readonly grants: Readonly<{
|
|
1849
|
+
create: Method<WithBody<Api["grants"]["create"]>, Api["grants"]["create"]>;
|
|
1850
|
+
delete: Call<ServerAccessContext & GrantReference, void>;
|
|
1851
|
+
get: Call<ServerAccessContext & GrantReference, ServerAccessGrant>;
|
|
1852
|
+
/** The grants of a user or Group, or below a namespace; at least one of them. */
|
|
1853
|
+
list: Method<ServerAccessContext & QueryOf<Api["grants"]["list"]>, Api["grants"]["list"]>;
|
|
1854
|
+
sync: Method<WithBody<Api["grants"]["sync"]>, Api["grants"]["sync"]>;
|
|
1855
|
+
update: Call<ServerAccessContext & GrantReference & BodyOf<Api["grants"]["update"]>, ServerAccessGrant>;
|
|
1856
|
+
}>;
|
|
1857
|
+
/**
|
|
1858
|
+
* Groups. Reads need `admin.groups` at read, writes at manage; adding or
|
|
1859
|
+
* removing a member of a Group that a holders-only grant reaches also
|
|
1860
|
+
* needs Grant Authority over that grant. An app server reads Groups but
|
|
1861
|
+
* writes none.
|
|
1862
|
+
*/
|
|
1863
|
+
readonly groups: Readonly<{
|
|
1864
|
+
addMember: Call<WithPath<Api["groups"]["addMember"]> & BodyOf<Api["groups"]["addMember"]>, void>;
|
|
1865
|
+
create: Method<WithBody<Api["groups"]["create"]>, Api["groups"]["create"]>;
|
|
1866
|
+
delete: Call<WithPath<Api["groups"]["delete"]>, void>;
|
|
1867
|
+
get: Method<WithPath<Api["groups"]["get"]>, Api["groups"]["get"]>;
|
|
1868
|
+
/** A page of Groups; pass `next` as `page` to read the page after it. */
|
|
1869
|
+
list: Method<ServerAccessContext & QueryOf<Api["groups"]["list"]>, Api["groups"]["list"]>;
|
|
1870
|
+
removeMember: Call<WithPath<Api["groups"]["removeMember"]>, void>;
|
|
1871
|
+
update: Method<WithPath<Api["groups"]["update"]> & BodyOf<Api["groups"]["update"]>, Api["groups"]["update"]>;
|
|
1872
|
+
}>;
|
|
1873
|
+
/**
|
|
1874
|
+
* Invitations that `members.create` sent with mode `invitation`, newest
|
|
1875
|
+
* first. Reads need `admin.users` at read, a revoke at manage. Only a
|
|
1876
|
+
* service principal invites, so an app server is refused.
|
|
1877
|
+
*/
|
|
1878
|
+
readonly invitations: Readonly<{
|
|
1879
|
+
/** A page of invitations, optionally by `status`; pass `next` as `page` to read the page after it. */
|
|
1880
|
+
list: Method<ServerAccessContext & QueryOf<Api["invitations"]["list"]>, Api["invitations"]["list"]>;
|
|
1881
|
+
revoke: Call<WithPath<Api["invitations"]["revoke"]>, void>;
|
|
1882
|
+
}>;
|
|
1883
|
+
/**
|
|
1884
|
+
* The Knowledge Data Policies, read only: the core and packages declare
|
|
1885
|
+
* them. `forSchema` answers the policies that decide the reads and the
|
|
1886
|
+
* writes of one schema, by its FQN. Needs `admin.profiles` at read.
|
|
1887
|
+
*/
|
|
1888
|
+
readonly knowledgePolicies: Readonly<{
|
|
1889
|
+
forSchema: Method<WithPath<Api["knowledgePolicies"]["forSchema"]>, Api["knowledgePolicies"]["forSchema"]>;
|
|
1890
|
+
list: Method<ServerAccessContext, Api["knowledgePolicies"]["list"]>;
|
|
1891
|
+
}>;
|
|
1892
|
+
/**
|
|
1893
|
+
* The Max Privileges templates, read only: the most an app's user tokens
|
|
1894
|
+
* or an API key may do. Needs `admin.profiles` at read.
|
|
1895
|
+
*/
|
|
1896
|
+
readonly maxPrivileges: Readonly<{
|
|
1897
|
+
get: Method<WithPath<Api["maxPrivileges"]["get"]>, Api["maxPrivileges"]["get"]>;
|
|
1898
|
+
list: Method<ServerAccessContext, Api["maxPrivileges"]["list"]>;
|
|
1899
|
+
}>;
|
|
1900
|
+
/**
|
|
1901
|
+
* Members and guests. `create` needs `admin.grants` at manage and Grant
|
|
1902
|
+
* Authority over each grant; reads need `admin.users` at read for
|
|
1903
|
+
* members and `admin.guests` at read for guests; changes need the same at
|
|
1904
|
+
* manage. An app server sees and changes only the guests it created.
|
|
1905
|
+
*/
|
|
1906
|
+
readonly members: Readonly<{
|
|
1907
|
+
create: Method<WithBody<Api["members"]["create"]>, Api["members"]["create"]>;
|
|
1908
|
+
/** The member with this address, or `null` when the caller sees none. */
|
|
1909
|
+
findByEmail: Call<ServerAccessContext & Readonly<{
|
|
1910
|
+
email: string;
|
|
1911
|
+
}>, ServerAccessMember | null>;
|
|
1912
|
+
get: Method<WithPath<Api["members"]["get"]>, Api["members"]["get"]>;
|
|
1913
|
+
list: Method<ServerAccessContext & QueryOf<Api["members"]["list"]>, Api["members"]["list"]>;
|
|
1914
|
+
remove: Method<WithPath<Api["members"]["remove"]>, Api["members"]["remove"]>;
|
|
1915
|
+
resume: Method<WithPath<Api["members"]["resume"]>, Api["members"]["resume"]>;
|
|
1916
|
+
suspend: Method<WithPath<Api["members"]["suspend"]>, Api["members"]["suspend"]>;
|
|
1917
|
+
}>;
|
|
1918
|
+
/** Access Profiles, read only. Needs `admin.profiles` at read. */
|
|
1919
|
+
readonly profiles: Readonly<{
|
|
1920
|
+
get: Method<WithPath<Api["profiles"]["get"]>, Api["profiles"]["get"]>;
|
|
1921
|
+
list: Method<ServerAccessContext, Api["profiles"]["list"]>;
|
|
1922
|
+
}>;
|
|
1923
|
+
/** A user's Access Snapshot in the Organization. Needs `admin.grants` at read. */
|
|
1924
|
+
readonly snapshot: Method<WithPath<Api["snapshot"]>, Api["snapshot"]>;
|
|
1925
|
+
}
|
|
1926
|
+
/** The `.` form of a service: each method resolves its value or rejects with its failure. */
|
|
1927
|
+
export type Promised<Service> = {
|
|
1928
|
+
readonly [Key in keyof Service]: Service[Key] extends (request: infer Request) => Effect.Effect<infer Result, infer _Failure> ? (request: Request) => Promise<Result> : Promised<Service[Key]>;
|
|
1929
|
+
};
|
|
1930
|
+
/** `ci.access` of `.`; a refused call rejects with `ServerAccessError`. */
|
|
1931
|
+
export type ServerAccess = Promised<ServerAccessService>;
|
|
1800
1932
|
/**
|
|
1801
1933
|
* A client secret: a string at `.`, or the `Redacted` string that Effect
|
|
1802
1934
|
* `Config.Redacted` reads for the `./effect` layers.
|
|
@@ -2177,127 +2309,6 @@ declare function createServerClient(config: ServerClientConfig & ServerClientInv
|
|
|
2177
2309
|
declare function createServerClient(config: ServerClientConfig & ServerClientInvalidation): ServerClient & Readonly<{
|
|
2178
2310
|
close: () => Promise<void>;
|
|
2179
2311
|
}>;
|
|
2180
|
-
/** The Organization a `ci.access` call acts in. */
|
|
2181
|
-
export type ServerAccessContext = Readonly<{
|
|
2182
|
-
organizationId: string;
|
|
2183
|
-
}>;
|
|
2184
|
-
export type OptionsOf<F> = F extends (options: infer Options) => PromiseLike<infer _> ? Options : never;
|
|
2185
|
-
export type BodyOf<F> = OptionsOf<F> extends {
|
|
2186
|
-
body: infer B;
|
|
2187
|
-
} ? B : never;
|
|
2188
|
-
export type PathOf<F> = OptionsOf<F> extends {
|
|
2189
|
-
path: infer P;
|
|
2190
|
-
} ? P : never;
|
|
2191
|
-
export type QueryOf<F> = OptionsOf<F> extends {
|
|
2192
|
-
query?: infer Q;
|
|
2193
|
-
} ? NonNullable<Q> : never;
|
|
2194
|
-
export type ResultOf<F> = F extends (options: never) => PromiseLike<infer Result> ? Result : never;
|
|
2195
|
-
export type Api = ApplicationAccessApi;
|
|
2196
|
-
export type WithBody<F> = ServerAccessContext & BodyOf<F>;
|
|
2197
|
-
export type WithPath<F> = ServerAccessContext & PathOf<F>;
|
|
2198
|
-
export type Method<Request, F> = (request: Request) => Promise<ResultOf<F>>;
|
|
2199
|
-
/** A grant named by its id or by its Access Grant FQN. */
|
|
2200
|
-
export type GrantReference = PathOf<Api["grants"]["get"]> | PathOf<Api["grants"]["getByFqn"]>;
|
|
2201
|
-
export type ServerAccessMember = ResultOf<Api["members"]["get"]>;
|
|
2202
|
-
export type ServerAccessGrant = ResultOf<Api["grants"]["get"]>;
|
|
2203
|
-
export interface ServerAccess {
|
|
2204
|
-
/** The Grant Axes and the slugs that key Axis Values. Needs `admin.profiles` at read. */
|
|
2205
|
-
readonly axes: Readonly<{
|
|
2206
|
-
list: Method<ServerAccessContext, Api["axes"]["list"]>;
|
|
2207
|
-
}>;
|
|
2208
|
-
/** The Capability Catalog of the Organization. Needs `admin.profiles` at read. */
|
|
2209
|
-
readonly catalog: Readonly<{
|
|
2210
|
-
list: Method<ServerAccessContext, Api["catalog"]["list"]>;
|
|
2211
|
-
}>;
|
|
2212
|
-
/**
|
|
2213
|
-
* Why a principal may use a capability or act on a Knowledge record: its
|
|
2214
|
-
* grants with their path and the matching policies. Needs `admin.grants`
|
|
2215
|
-
* at read.
|
|
2216
|
-
*/
|
|
2217
|
-
readonly explain: Method<WithBody<Api["explain"]>, Api["explain"]>;
|
|
2218
|
-
/**
|
|
2219
|
-
* Access Grants by id or Access Grant FQN. Writes need `admin.grants` at
|
|
2220
|
-
* manage and pass Grant Authority; `sync` makes the runtime grants below
|
|
2221
|
-
* a namespace exactly the list. Reads need `admin.grants` at read.
|
|
2222
|
-
*/
|
|
2223
|
-
readonly grants: Readonly<{
|
|
2224
|
-
create: Method<WithBody<Api["grants"]["create"]>, Api["grants"]["create"]>;
|
|
2225
|
-
delete: (request: ServerAccessContext & GrantReference) => Promise<void>;
|
|
2226
|
-
get: (request: ServerAccessContext & GrantReference) => Promise<ServerAccessGrant>;
|
|
2227
|
-
/** The grants of a user or Group, or below a namespace; at least one of them. */
|
|
2228
|
-
list: Method<ServerAccessContext & QueryOf<Api["grants"]["list"]>, Api["grants"]["list"]>;
|
|
2229
|
-
sync: Method<WithBody<Api["grants"]["sync"]>, Api["grants"]["sync"]>;
|
|
2230
|
-
update: (request: ServerAccessContext & GrantReference & BodyOf<Api["grants"]["update"]>) => Promise<ServerAccessGrant>;
|
|
2231
|
-
}>;
|
|
2232
|
-
/**
|
|
2233
|
-
* Groups. Reads need `admin.groups` at read, writes at manage; adding or
|
|
2234
|
-
* removing a member of a Group that a holders-only grant reaches also
|
|
2235
|
-
* needs Grant Authority over that grant. An app server reads Groups but
|
|
2236
|
-
* writes none.
|
|
2237
|
-
*/
|
|
2238
|
-
readonly groups: Readonly<{
|
|
2239
|
-
addMember: (request: WithPath<Api["groups"]["addMember"]> & BodyOf<Api["groups"]["addMember"]>) => Promise<void>;
|
|
2240
|
-
create: Method<WithBody<Api["groups"]["create"]>, Api["groups"]["create"]>;
|
|
2241
|
-
delete: (request: WithPath<Api["groups"]["delete"]>) => Promise<void>;
|
|
2242
|
-
get: Method<WithPath<Api["groups"]["get"]>, Api["groups"]["get"]>;
|
|
2243
|
-
/** A page of Groups; pass `next` as `page` to read the page after it. */
|
|
2244
|
-
list: Method<ServerAccessContext & QueryOf<Api["groups"]["list"]>, Api["groups"]["list"]>;
|
|
2245
|
-
removeMember: (request: WithPath<Api["groups"]["removeMember"]>) => Promise<void>;
|
|
2246
|
-
update: Method<WithPath<Api["groups"]["update"]> & BodyOf<Api["groups"]["update"]>, Api["groups"]["update"]>;
|
|
2247
|
-
}>;
|
|
2248
|
-
/**
|
|
2249
|
-
* Invitations that `members.create` sent with mode `invitation`, newest
|
|
2250
|
-
* first. Reads need `admin.users` at read, a revoke at manage. Only a
|
|
2251
|
-
* service principal invites, so an app server is refused.
|
|
2252
|
-
*/
|
|
2253
|
-
readonly invitations: Readonly<{
|
|
2254
|
-
/** A page of invitations, optionally by `status`; pass `next` as `page` to read the page after it. */
|
|
2255
|
-
list: Method<ServerAccessContext & QueryOf<Api["invitations"]["list"]>, Api["invitations"]["list"]>;
|
|
2256
|
-
revoke: (request: WithPath<Api["invitations"]["revoke"]>) => Promise<void>;
|
|
2257
|
-
}>;
|
|
2258
|
-
/**
|
|
2259
|
-
* The Knowledge Data Policies, read only: the core and packages declare
|
|
2260
|
-
* them. `forSchema` answers the policies that decide the reads and the
|
|
2261
|
-
* writes of one schema, by its FQN. Needs `admin.profiles` at read.
|
|
2262
|
-
*/
|
|
2263
|
-
readonly knowledgePolicies: Readonly<{
|
|
2264
|
-
forSchema: Method<WithPath<Api["knowledgePolicies"]["forSchema"]>, Api["knowledgePolicies"]["forSchema"]>;
|
|
2265
|
-
list: Method<ServerAccessContext, Api["knowledgePolicies"]["list"]>;
|
|
2266
|
-
}>;
|
|
2267
|
-
/**
|
|
2268
|
-
* The Max Privileges templates, read only: the most an app's user tokens
|
|
2269
|
-
* or an API key may do. Needs `admin.profiles` at read.
|
|
2270
|
-
*/
|
|
2271
|
-
readonly maxPrivileges: Readonly<{
|
|
2272
|
-
get: Method<WithPath<Api["maxPrivileges"]["get"]>, Api["maxPrivileges"]["get"]>;
|
|
2273
|
-
list: Method<ServerAccessContext, Api["maxPrivileges"]["list"]>;
|
|
2274
|
-
}>;
|
|
2275
|
-
/**
|
|
2276
|
-
* Members and guests. `create` needs `admin.grants` at manage and Grant
|
|
2277
|
-
* Authority over each grant; reads need `admin.users` at read for
|
|
2278
|
-
* members and `admin.guests` at read for guests; changes need the same at
|
|
2279
|
-
* manage. An app server sees and changes only the guests it created.
|
|
2280
|
-
*/
|
|
2281
|
-
readonly members: Readonly<{
|
|
2282
|
-
create: Method<WithBody<Api["members"]["create"]>, Api["members"]["create"]>;
|
|
2283
|
-
/** The member with this address, or `null` when the caller sees none. */
|
|
2284
|
-
findByEmail: (request: ServerAccessContext & Readonly<{
|
|
2285
|
-
email: string;
|
|
2286
|
-
}>) => Promise<ServerAccessMember | null>;
|
|
2287
|
-
get: Method<WithPath<Api["members"]["get"]>, Api["members"]["get"]>;
|
|
2288
|
-
list: Method<ServerAccessContext & QueryOf<Api["members"]["list"]>, Api["members"]["list"]>;
|
|
2289
|
-
remove: Method<WithPath<Api["members"]["remove"]>, Api["members"]["remove"]>;
|
|
2290
|
-
resume: Method<WithPath<Api["members"]["resume"]>, Api["members"]["resume"]>;
|
|
2291
|
-
suspend: Method<WithPath<Api["members"]["suspend"]>, Api["members"]["suspend"]>;
|
|
2292
|
-
}>;
|
|
2293
|
-
/** Access Profiles, read only. Needs `admin.profiles` at read. */
|
|
2294
|
-
readonly profiles: Readonly<{
|
|
2295
|
-
get: Method<WithPath<Api["profiles"]["get"]>, Api["profiles"]["get"]>;
|
|
2296
|
-
list: Method<ServerAccessContext, Api["profiles"]["list"]>;
|
|
2297
|
-
}>;
|
|
2298
|
-
/** A user's Access Snapshot in the Organization. Needs `admin.grants` at read. */
|
|
2299
|
-
readonly snapshot: Method<WithPath<Api["snapshot"]>, Api["snapshot"]>;
|
|
2300
|
-
}
|
|
2301
2312
|
export interface MemberSessionExchangeRequest {
|
|
2302
2313
|
readonly credentials: ConfidentialCredentialProvider;
|
|
2303
2314
|
readonly fetch?: typeof globalThis.fetch;
|
|
@@ -2329,13 +2340,14 @@ export type RunAsApplicationConfig<Secret extends ClientSecret = string> = Reado
|
|
|
2329
2340
|
}>;
|
|
2330
2341
|
declare const CiError$1: typeof CiError;
|
|
2331
2342
|
type CiError$1 = CiError;
|
|
2343
|
+
declare const ServerAccessError$1: typeof ServerAccessError;
|
|
2344
|
+
type ServerAccessError$1 = ServerAccessError;
|
|
2332
2345
|
declare const CiTransportError$1: typeof CiTransportError;
|
|
2333
2346
|
type CiTransportError$1 = CiTransportError;
|
|
2334
2347
|
declare const FederatedAuthError$1: typeof FederatedAuthError;
|
|
2335
2348
|
type FederatedAuthError$1 = FederatedAuthError;
|
|
2336
2349
|
declare const createServerClient$1: typeof createServerClient;
|
|
2337
2350
|
export declare const serverSdkRuntime: "node";
|
|
2338
|
-
export declare const ServerAccessError: typeof AccessApiError;
|
|
2339
2351
|
export declare const runAsApplication: (config: RunAsApplicationConfig & ServerClientInvalidation) => ServerClient & Readonly<{
|
|
2340
2352
|
close: () => Promise<void>;
|
|
2341
2353
|
}>;
|
|
@@ -2357,6 +2369,7 @@ export {
|
|
|
2357
2369
|
MessageSendResult as ServerMessageSendResult,
|
|
2358
2370
|
MessageTarget as ServerMessageTarget,
|
|
2359
2371
|
ResourceJsonValue,
|
|
2372
|
+
ServerAccessError$1 as ServerAccessError,
|
|
2360
2373
|
StorageFileId as ServerStorageFileId,
|
|
2361
2374
|
createServerClient$1 as createServerClient,
|
|
2362
2375
|
};
|