@executor-js/plugin-openapi 0.0.2 → 0.2.1
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/dist/AddOpenApiSource-EV3NJHLA.js +19 -0
- package/dist/AddOpenApiSource-EV3NJHLA.js.map +1 -0
- package/dist/EditOpenApiSource-J7NXCVT5.js +665 -0
- package/dist/EditOpenApiSource-J7NXCVT5.js.map +1 -0
- package/dist/OpenApiSourceSummary-K5WZD5NR.js +122 -0
- package/dist/OpenApiSourceSummary-K5WZD5NR.js.map +1 -0
- package/dist/api/group.d.ts +79 -10
- package/dist/api/index.d.ts +384 -0
- package/dist/chunk-2BXVRXGL.js +1345 -0
- package/dist/chunk-2BXVRXGL.js.map +1 -0
- package/dist/chunk-E4QUTDQ2.js +1120 -0
- package/dist/chunk-E4QUTDQ2.js.map +1 -0
- package/dist/chunk-LBTK5F65.js +216 -0
- package/dist/chunk-LBTK5F65.js.map +1 -0
- package/dist/chunk-TRD7KSKA.js +1444 -0
- package/dist/chunk-TRD7KSKA.js.map +1 -0
- package/dist/client.js +165 -0
- package/dist/client.js.map +1 -0
- package/dist/core.js +8 -10
- package/dist/index.js +2 -1
- package/dist/react/AddOpenApiSource.d.ts +1 -1
- package/dist/react/OpenApiSourceDetailsFields.d.ts +18 -0
- package/dist/react/atoms.d.ts +158 -13
- package/dist/react/client.d.ts +85 -349
- package/dist/react/plugin-client.d.ts +2 -0
- package/dist/react/source-plugin.d.ts +1 -1
- package/dist/sdk/index.d.ts +1 -1
- package/dist/sdk/openapi-utils.d.ts +4 -3
- package/dist/sdk/parse.d.ts +1 -1
- package/dist/sdk/parse.test.d.ts +1 -0
- package/dist/sdk/plugin.d.ts +154 -34
- package/dist/sdk/store.d.ts +132 -47
- package/dist/sdk/types.d.ts +19 -44
- package/dist/sdk/upstream-failures.test.d.ts +1 -0
- package/dist/sdk/usage-scope-isolation.test.d.ts +1 -0
- package/dist/testing/index.d.ts +34 -0
- package/dist/testing.js +56 -0
- package/dist/testing.js.map +1 -0
- package/package.json +16 -4
- package/dist/chunk-ZZ7TQ4JC.js +0 -2602
- package/dist/chunk-ZZ7TQ4JC.js.map +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { OpenAPIV3, OpenAPIV3_1 } from "openapi-types";
|
|
2
2
|
import type { ParsedDocument } from "./parse";
|
|
3
|
+
import type { ServerVariable } from "./types";
|
|
3
4
|
export type ParameterObject = OpenAPIV3.ParameterObject | OpenAPIV3_1.ParameterObject;
|
|
4
5
|
export type OperationObject = OpenAPIV3.OperationObject | OpenAPIV3_1.OperationObject;
|
|
5
6
|
export type PathItemObject = OpenAPIV3.PathItemObject | OpenAPIV3_1.PathItemObject;
|
|
@@ -15,12 +16,12 @@ export declare class DocResolver {
|
|
|
15
16
|
}
|
|
16
17
|
/** Substitute `{var}` placeholders in a templated URL using a plain map. */
|
|
17
18
|
export declare const substituteUrlVariables: (url: string, values: Record<string, string>) => string;
|
|
19
|
+
export declare const OPENAPI_MAX_SERVER_VARIABLE_OPTIONS = 64;
|
|
18
20
|
type ServerLike = {
|
|
19
21
|
url: string;
|
|
20
|
-
variables: import("effect/Option").Option<Record<string,
|
|
21
|
-
default: string;
|
|
22
|
-
} | string>>;
|
|
22
|
+
variables: import("effect/Option").Option<Record<string, ServerVariable | string>>;
|
|
23
23
|
};
|
|
24
|
+
export declare const expandServerUrlOptions: (server: ServerLike, limit?: number) => readonly string[];
|
|
24
25
|
export declare const resolveBaseUrl: (servers: readonly ServerLike[]) => string;
|
|
25
26
|
/**
|
|
26
27
|
* Return all declared media entries in spec order. `Object.entries` on a
|
package/dist/sdk/parse.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ declare class OpenApiExtractionErrorFromParse extends OpenApiExtractionError {
|
|
|
14
14
|
* HttpClient so the caller chooses the transport via layer — in Cloudflare
|
|
15
15
|
* Workers, `FetchHttpClient.layer` binds to the Workers-native `fetch` and
|
|
16
16
|
* avoids json-schema-ref-parser's Node-polyfill http resolver, which hangs
|
|
17
|
-
* in production. Bounded by a
|
|
17
|
+
* in production. Bounded by a 60s timeout.
|
|
18
18
|
*/
|
|
19
19
|
export declare const fetchSpecText: (url: string, credentials?: SpecFetchCredentials | undefined) => Effect.Effect<string, OpenApiParseError, HttpClient.HttpClient>;
|
|
20
20
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/sdk/plugin.d.ts
CHANGED
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
|
-
import { HttpClient } from "effect/unstable/http";
|
|
3
2
|
import type { Layer } from "effect";
|
|
3
|
+
import { HttpClient } from "effect/unstable/http";
|
|
4
4
|
import { type StorageFailure } from "@executor-js/sdk/core";
|
|
5
5
|
import { type ConfigFileSink } from "@executor-js/config";
|
|
6
6
|
import { OpenApiExtractionError, OpenApiOAuthError, OpenApiParseError } from "./errors";
|
|
7
7
|
import { SpecPreview } from "./preview";
|
|
8
|
-
import { type OpenapiStore, type StoredSource } from "./store";
|
|
9
|
-
import {
|
|
8
|
+
import { type OpenapiStore, type SourceConfig, type StoredSource } from "./store";
|
|
9
|
+
import { OAuth2SourceConfig, OpenApiSourceBindingInput, OpenApiSourceBindingRef, type OpenApiCredentialInput as OpenApiCredentialInputValue, type ConfiguredHeaderValue as ConfiguredHeaderValueValue, type HeaderValue as HeaderValueValue } from "./types";
|
|
10
10
|
export type HeaderValue = HeaderValueValue;
|
|
11
11
|
export type ConfiguredHeaderValue = ConfiguredHeaderValueValue;
|
|
12
12
|
export type OpenApiHeaderInput = HeaderValue | ConfiguredHeaderValue;
|
|
13
|
-
export type
|
|
14
|
-
export
|
|
13
|
+
export type OpenApiCredentialInput = OpenApiCredentialInputValue;
|
|
14
|
+
export type OpenApiOAuthInput = OAuth2SourceConfig;
|
|
15
|
+
export interface OpenApiSpecFetchCredentialsInput {
|
|
15
16
|
readonly headers?: Record<string, HeaderValue>;
|
|
16
17
|
readonly queryParams?: Record<string, HeaderValue>;
|
|
17
18
|
}
|
|
18
19
|
export interface OpenApiPreviewInput {
|
|
19
20
|
readonly spec: string;
|
|
20
|
-
readonly specFetchCredentials?:
|
|
21
|
+
readonly specFetchCredentials?: OpenApiSpecFetchCredentialsInput;
|
|
21
22
|
}
|
|
22
23
|
export interface OpenApiSpecConfig {
|
|
23
24
|
readonly spec: string;
|
|
24
|
-
readonly specFetchCredentials?:
|
|
25
|
+
readonly specFetchCredentials?: OpenApiSpecFetchCredentialsInput;
|
|
25
26
|
/**
|
|
26
27
|
* Executor scope id that owns this source row. Must be one of the
|
|
27
28
|
* executor's configured scopes. Typical shape: an admin adds the
|
|
@@ -32,15 +33,17 @@ export interface OpenApiSpecConfig {
|
|
|
32
33
|
readonly name?: string;
|
|
33
34
|
readonly baseUrl?: string;
|
|
34
35
|
readonly namespace?: string;
|
|
35
|
-
readonly headers?: Record<string,
|
|
36
|
-
readonly queryParams?: Record<string,
|
|
36
|
+
readonly headers?: Record<string, OpenApiCredentialInput>;
|
|
37
|
+
readonly queryParams?: Record<string, OpenApiCredentialInput>;
|
|
37
38
|
readonly oauth2?: OpenApiOAuthInput;
|
|
39
|
+
readonly credentialTargetScope?: string;
|
|
38
40
|
}
|
|
39
41
|
export interface OpenApiUpdateSourceInput {
|
|
40
42
|
readonly name?: string;
|
|
41
43
|
readonly baseUrl?: string;
|
|
42
|
-
readonly headers?: Record<string,
|
|
43
|
-
readonly queryParams?: Record<string,
|
|
44
|
+
readonly headers?: Record<string, OpenApiCredentialInput>;
|
|
45
|
+
readonly queryParams?: Record<string, OpenApiCredentialInput>;
|
|
46
|
+
readonly credentialTargetScope?: string;
|
|
44
47
|
/** Refresh the source's stored OAuth2 metadata after a successful
|
|
45
48
|
* re-authenticate. */
|
|
46
49
|
readonly oauth2?: OpenApiOAuthInput;
|
|
@@ -75,7 +78,24 @@ export interface OpenApiPluginOptions {
|
|
|
75
78
|
* (best-effort — file errors are logged, not raised). */
|
|
76
79
|
readonly configFile?: ConfigFileSink;
|
|
77
80
|
}
|
|
78
|
-
export declare const openApiPlugin: import("@executor-js/sdk/core").ConfiguredPlugin<"openapi",
|
|
81
|
+
export declare const openApiPlugin: import("@executor-js/sdk/core").ConfiguredPlugin<"openapi", {
|
|
82
|
+
previewSpec: (input: string | OpenApiPreviewInput) => Effect.Effect<SpecPreview, StorageFailure | OpenApiParseError | OpenApiExtractionError | OpenApiOAuthError, never>;
|
|
83
|
+
addSpec: (config: OpenApiSpecConfig) => Effect.Effect<{
|
|
84
|
+
sourceId: string;
|
|
85
|
+
toolCount: number;
|
|
86
|
+
}, StorageFailure | OpenApiParseError | OpenApiExtractionError | OpenApiOAuthError, never>;
|
|
87
|
+
removeSpec: (namespace: string, scope: string) => Effect.Effect<void, StorageFailure, never>;
|
|
88
|
+
getSource: (namespace: string, scope: string) => Effect.Effect<{
|
|
89
|
+
config: SourceConfig;
|
|
90
|
+
namespace: string;
|
|
91
|
+
scope: string;
|
|
92
|
+
name: string;
|
|
93
|
+
} | null, StorageFailure, never>;
|
|
94
|
+
updateSource: (namespace: string, scope: string, input: OpenApiUpdateSourceInput) => Effect.Effect<undefined, StorageFailure | OpenApiOAuthError, never>;
|
|
95
|
+
listSourceBindings: (sourceId: string, sourceScope: string) => Effect.Effect<readonly OpenApiSourceBindingRef[], StorageFailure, never>;
|
|
96
|
+
setSourceBinding: (input: OpenApiSourceBindingInput) => Effect.Effect<OpenApiSourceBindingRef, StorageFailure, never>;
|
|
97
|
+
removeSourceBinding: (sourceId: string, sourceScope: string, slot: string, scope: string) => Effect.Effect<void, StorageFailure, never>;
|
|
98
|
+
}, OpenapiStore, OpenApiPluginOptions, {
|
|
79
99
|
readonly openapi_source: {
|
|
80
100
|
readonly fields: {
|
|
81
101
|
readonly id: {
|
|
@@ -103,25 +123,35 @@ export declare const openApiPlugin: import("@executor-js/sdk/core").ConfiguredPl
|
|
|
103
123
|
readonly type: "string";
|
|
104
124
|
readonly required: false;
|
|
105
125
|
};
|
|
106
|
-
readonly
|
|
126
|
+
readonly oauth2: {
|
|
107
127
|
readonly type: "json";
|
|
108
128
|
readonly required: false;
|
|
109
129
|
};
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
readonly openapi_operation: {
|
|
133
|
+
readonly fields: {
|
|
134
|
+
readonly id: {
|
|
135
|
+
readonly type: "string";
|
|
136
|
+
readonly required: true;
|
|
113
137
|
};
|
|
114
|
-
readonly
|
|
115
|
-
readonly type: "
|
|
116
|
-
readonly required:
|
|
138
|
+
readonly scope_id: {
|
|
139
|
+
readonly type: "string";
|
|
140
|
+
readonly required: true;
|
|
141
|
+
readonly index: true;
|
|
117
142
|
};
|
|
118
|
-
readonly
|
|
143
|
+
readonly source_id: {
|
|
144
|
+
readonly type: "string";
|
|
145
|
+
readonly required: true;
|
|
146
|
+
readonly index: true;
|
|
147
|
+
};
|
|
148
|
+
readonly binding: {
|
|
119
149
|
readonly type: "json";
|
|
120
150
|
readonly required: true;
|
|
121
151
|
};
|
|
122
152
|
};
|
|
123
153
|
};
|
|
124
|
-
readonly
|
|
154
|
+
readonly openapi_source_header: {
|
|
125
155
|
readonly fields: {
|
|
126
156
|
readonly id: {
|
|
127
157
|
readonly type: "string";
|
|
@@ -137,50 +167,140 @@ export declare const openApiPlugin: import("@executor-js/sdk/core").ConfiguredPl
|
|
|
137
167
|
readonly required: true;
|
|
138
168
|
readonly index: true;
|
|
139
169
|
};
|
|
140
|
-
readonly
|
|
141
|
-
readonly type: "
|
|
170
|
+
readonly name: {
|
|
171
|
+
readonly type: "string";
|
|
142
172
|
readonly required: true;
|
|
143
173
|
};
|
|
174
|
+
readonly kind: {
|
|
175
|
+
readonly type: ["text", "binding"];
|
|
176
|
+
readonly required: true;
|
|
177
|
+
};
|
|
178
|
+
readonly text_value: {
|
|
179
|
+
readonly type: "string";
|
|
180
|
+
readonly required: false;
|
|
181
|
+
};
|
|
182
|
+
readonly slot_key: {
|
|
183
|
+
readonly type: "string";
|
|
184
|
+
readonly required: false;
|
|
185
|
+
};
|
|
186
|
+
readonly prefix: {
|
|
187
|
+
readonly type: "string";
|
|
188
|
+
readonly required: false;
|
|
189
|
+
};
|
|
144
190
|
};
|
|
145
191
|
};
|
|
146
|
-
readonly
|
|
192
|
+
readonly openapi_source_query_param: {
|
|
147
193
|
readonly fields: {
|
|
148
194
|
readonly id: {
|
|
149
195
|
readonly type: "string";
|
|
150
196
|
readonly required: true;
|
|
151
197
|
};
|
|
198
|
+
readonly scope_id: {
|
|
199
|
+
readonly type: "string";
|
|
200
|
+
readonly required: true;
|
|
201
|
+
readonly index: true;
|
|
202
|
+
};
|
|
152
203
|
readonly source_id: {
|
|
153
204
|
readonly type: "string";
|
|
154
205
|
readonly required: true;
|
|
155
206
|
readonly index: true;
|
|
156
207
|
};
|
|
157
|
-
readonly
|
|
208
|
+
readonly name: {
|
|
209
|
+
readonly type: "string";
|
|
210
|
+
readonly required: true;
|
|
211
|
+
};
|
|
212
|
+
readonly kind: {
|
|
213
|
+
readonly type: ["text", "binding"];
|
|
214
|
+
readonly required: true;
|
|
215
|
+
};
|
|
216
|
+
readonly text_value: {
|
|
217
|
+
readonly type: "string";
|
|
218
|
+
readonly required: false;
|
|
219
|
+
};
|
|
220
|
+
readonly slot_key: {
|
|
221
|
+
readonly type: "string";
|
|
222
|
+
readonly required: false;
|
|
223
|
+
};
|
|
224
|
+
readonly prefix: {
|
|
225
|
+
readonly type: "string";
|
|
226
|
+
readonly required: false;
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
readonly openapi_source_spec_fetch_header: {
|
|
231
|
+
readonly fields: {
|
|
232
|
+
readonly id: {
|
|
233
|
+
readonly type: "string";
|
|
234
|
+
readonly required: true;
|
|
235
|
+
};
|
|
236
|
+
readonly scope_id: {
|
|
158
237
|
readonly type: "string";
|
|
159
238
|
readonly required: true;
|
|
160
239
|
readonly index: true;
|
|
161
240
|
};
|
|
162
|
-
readonly
|
|
241
|
+
readonly source_id: {
|
|
163
242
|
readonly type: "string";
|
|
164
243
|
readonly required: true;
|
|
165
244
|
readonly index: true;
|
|
166
245
|
};
|
|
167
|
-
readonly
|
|
246
|
+
readonly name: {
|
|
247
|
+
readonly type: "string";
|
|
248
|
+
readonly required: true;
|
|
249
|
+
};
|
|
250
|
+
readonly kind: {
|
|
251
|
+
readonly type: ["text", "binding"];
|
|
252
|
+
readonly required: true;
|
|
253
|
+
};
|
|
254
|
+
readonly text_value: {
|
|
255
|
+
readonly type: "string";
|
|
256
|
+
readonly required: false;
|
|
257
|
+
};
|
|
258
|
+
readonly slot_key: {
|
|
259
|
+
readonly type: "string";
|
|
260
|
+
readonly required: false;
|
|
261
|
+
};
|
|
262
|
+
readonly prefix: {
|
|
263
|
+
readonly type: "string";
|
|
264
|
+
readonly required: false;
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
};
|
|
268
|
+
readonly openapi_source_spec_fetch_query_param: {
|
|
269
|
+
readonly fields: {
|
|
270
|
+
readonly id: {
|
|
271
|
+
readonly type: "string";
|
|
272
|
+
readonly required: true;
|
|
273
|
+
};
|
|
274
|
+
readonly scope_id: {
|
|
168
275
|
readonly type: "string";
|
|
169
276
|
readonly required: true;
|
|
170
277
|
readonly index: true;
|
|
171
278
|
};
|
|
172
|
-
readonly
|
|
173
|
-
readonly type: "
|
|
279
|
+
readonly source_id: {
|
|
280
|
+
readonly type: "string";
|
|
174
281
|
readonly required: true;
|
|
282
|
+
readonly index: true;
|
|
175
283
|
};
|
|
176
|
-
readonly
|
|
177
|
-
readonly type: "
|
|
284
|
+
readonly name: {
|
|
285
|
+
readonly type: "string";
|
|
178
286
|
readonly required: true;
|
|
179
287
|
};
|
|
180
|
-
readonly
|
|
181
|
-
readonly type: "
|
|
288
|
+
readonly kind: {
|
|
289
|
+
readonly type: ["text", "binding"];
|
|
182
290
|
readonly required: true;
|
|
183
291
|
};
|
|
292
|
+
readonly text_value: {
|
|
293
|
+
readonly type: "string";
|
|
294
|
+
readonly required: false;
|
|
295
|
+
};
|
|
296
|
+
readonly slot_key: {
|
|
297
|
+
readonly type: "string";
|
|
298
|
+
readonly required: false;
|
|
299
|
+
};
|
|
300
|
+
readonly prefix: {
|
|
301
|
+
readonly type: "string";
|
|
302
|
+
readonly required: false;
|
|
303
|
+
};
|
|
184
304
|
};
|
|
185
305
|
};
|
|
186
|
-
}>;
|
|
306
|
+
}, undefined, Layer.Layer<unknown, never, never>, import("effect/unstable/httpapi/HttpApiGroup").Any>;
|
package/dist/sdk/store.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
2
|
import { type StorageDeps, type StorageFailure } from "@executor-js/sdk/core";
|
|
3
|
-
import { ConfiguredHeaderValue, ConfiguredHeaderBinding,
|
|
3
|
+
import { ConfiguredHeaderValue, ConfiguredHeaderBinding, OAuth2SourceConfig, OperationBinding } from "./types";
|
|
4
4
|
export declare const openapiSchema: {
|
|
5
5
|
readonly openapi_source: {
|
|
6
6
|
readonly fields: {
|
|
@@ -29,25 +29,35 @@ export declare const openapiSchema: {
|
|
|
29
29
|
readonly type: "string";
|
|
30
30
|
readonly required: false;
|
|
31
31
|
};
|
|
32
|
-
readonly
|
|
32
|
+
readonly oauth2: {
|
|
33
33
|
readonly type: "json";
|
|
34
34
|
readonly required: false;
|
|
35
35
|
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
readonly openapi_operation: {
|
|
39
|
+
readonly fields: {
|
|
40
|
+
readonly id: {
|
|
41
|
+
readonly type: "string";
|
|
42
|
+
readonly required: true;
|
|
39
43
|
};
|
|
40
|
-
readonly
|
|
41
|
-
readonly type: "
|
|
42
|
-
readonly required:
|
|
44
|
+
readonly scope_id: {
|
|
45
|
+
readonly type: "string";
|
|
46
|
+
readonly required: true;
|
|
47
|
+
readonly index: true;
|
|
43
48
|
};
|
|
44
|
-
readonly
|
|
49
|
+
readonly source_id: {
|
|
50
|
+
readonly type: "string";
|
|
51
|
+
readonly required: true;
|
|
52
|
+
readonly index: true;
|
|
53
|
+
};
|
|
54
|
+
readonly binding: {
|
|
45
55
|
readonly type: "json";
|
|
46
56
|
readonly required: true;
|
|
47
57
|
};
|
|
48
58
|
};
|
|
49
59
|
};
|
|
50
|
-
readonly
|
|
60
|
+
readonly openapi_source_header: {
|
|
51
61
|
readonly fields: {
|
|
52
62
|
readonly id: {
|
|
53
63
|
readonly type: "string";
|
|
@@ -63,50 +73,140 @@ export declare const openapiSchema: {
|
|
|
63
73
|
readonly required: true;
|
|
64
74
|
readonly index: true;
|
|
65
75
|
};
|
|
66
|
-
readonly
|
|
67
|
-
readonly type: "
|
|
76
|
+
readonly name: {
|
|
77
|
+
readonly type: "string";
|
|
78
|
+
readonly required: true;
|
|
79
|
+
};
|
|
80
|
+
readonly kind: {
|
|
81
|
+
readonly type: ["text", "binding"];
|
|
68
82
|
readonly required: true;
|
|
69
83
|
};
|
|
84
|
+
readonly text_value: {
|
|
85
|
+
readonly type: "string";
|
|
86
|
+
readonly required: false;
|
|
87
|
+
};
|
|
88
|
+
readonly slot_key: {
|
|
89
|
+
readonly type: "string";
|
|
90
|
+
readonly required: false;
|
|
91
|
+
};
|
|
92
|
+
readonly prefix: {
|
|
93
|
+
readonly type: "string";
|
|
94
|
+
readonly required: false;
|
|
95
|
+
};
|
|
70
96
|
};
|
|
71
97
|
};
|
|
72
|
-
readonly
|
|
98
|
+
readonly openapi_source_query_param: {
|
|
73
99
|
readonly fields: {
|
|
74
100
|
readonly id: {
|
|
75
101
|
readonly type: "string";
|
|
76
102
|
readonly required: true;
|
|
77
103
|
};
|
|
104
|
+
readonly scope_id: {
|
|
105
|
+
readonly type: "string";
|
|
106
|
+
readonly required: true;
|
|
107
|
+
readonly index: true;
|
|
108
|
+
};
|
|
78
109
|
readonly source_id: {
|
|
79
110
|
readonly type: "string";
|
|
80
111
|
readonly required: true;
|
|
81
112
|
readonly index: true;
|
|
82
113
|
};
|
|
83
|
-
readonly
|
|
114
|
+
readonly name: {
|
|
115
|
+
readonly type: "string";
|
|
116
|
+
readonly required: true;
|
|
117
|
+
};
|
|
118
|
+
readonly kind: {
|
|
119
|
+
readonly type: ["text", "binding"];
|
|
120
|
+
readonly required: true;
|
|
121
|
+
};
|
|
122
|
+
readonly text_value: {
|
|
123
|
+
readonly type: "string";
|
|
124
|
+
readonly required: false;
|
|
125
|
+
};
|
|
126
|
+
readonly slot_key: {
|
|
127
|
+
readonly type: "string";
|
|
128
|
+
readonly required: false;
|
|
129
|
+
};
|
|
130
|
+
readonly prefix: {
|
|
131
|
+
readonly type: "string";
|
|
132
|
+
readonly required: false;
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
readonly openapi_source_spec_fetch_header: {
|
|
137
|
+
readonly fields: {
|
|
138
|
+
readonly id: {
|
|
139
|
+
readonly type: "string";
|
|
140
|
+
readonly required: true;
|
|
141
|
+
};
|
|
142
|
+
readonly scope_id: {
|
|
84
143
|
readonly type: "string";
|
|
85
144
|
readonly required: true;
|
|
86
145
|
readonly index: true;
|
|
87
146
|
};
|
|
88
|
-
readonly
|
|
147
|
+
readonly source_id: {
|
|
89
148
|
readonly type: "string";
|
|
90
149
|
readonly required: true;
|
|
91
150
|
readonly index: true;
|
|
92
151
|
};
|
|
93
|
-
readonly
|
|
152
|
+
readonly name: {
|
|
153
|
+
readonly type: "string";
|
|
154
|
+
readonly required: true;
|
|
155
|
+
};
|
|
156
|
+
readonly kind: {
|
|
157
|
+
readonly type: ["text", "binding"];
|
|
158
|
+
readonly required: true;
|
|
159
|
+
};
|
|
160
|
+
readonly text_value: {
|
|
161
|
+
readonly type: "string";
|
|
162
|
+
readonly required: false;
|
|
163
|
+
};
|
|
164
|
+
readonly slot_key: {
|
|
165
|
+
readonly type: "string";
|
|
166
|
+
readonly required: false;
|
|
167
|
+
};
|
|
168
|
+
readonly prefix: {
|
|
169
|
+
readonly type: "string";
|
|
170
|
+
readonly required: false;
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
};
|
|
174
|
+
readonly openapi_source_spec_fetch_query_param: {
|
|
175
|
+
readonly fields: {
|
|
176
|
+
readonly id: {
|
|
177
|
+
readonly type: "string";
|
|
178
|
+
readonly required: true;
|
|
179
|
+
};
|
|
180
|
+
readonly scope_id: {
|
|
94
181
|
readonly type: "string";
|
|
95
182
|
readonly required: true;
|
|
96
183
|
readonly index: true;
|
|
97
184
|
};
|
|
98
|
-
readonly
|
|
99
|
-
readonly type: "
|
|
185
|
+
readonly source_id: {
|
|
186
|
+
readonly type: "string";
|
|
100
187
|
readonly required: true;
|
|
188
|
+
readonly index: true;
|
|
101
189
|
};
|
|
102
|
-
readonly
|
|
103
|
-
readonly type: "
|
|
190
|
+
readonly name: {
|
|
191
|
+
readonly type: "string";
|
|
104
192
|
readonly required: true;
|
|
105
193
|
};
|
|
106
|
-
readonly
|
|
107
|
-
readonly type: "
|
|
194
|
+
readonly kind: {
|
|
195
|
+
readonly type: ["text", "binding"];
|
|
108
196
|
readonly required: true;
|
|
109
197
|
};
|
|
198
|
+
readonly text_value: {
|
|
199
|
+
readonly type: "string";
|
|
200
|
+
readonly required: false;
|
|
201
|
+
};
|
|
202
|
+
readonly slot_key: {
|
|
203
|
+
readonly type: "string";
|
|
204
|
+
readonly required: false;
|
|
205
|
+
};
|
|
206
|
+
readonly prefix: {
|
|
207
|
+
readonly type: "string";
|
|
208
|
+
readonly required: false;
|
|
209
|
+
};
|
|
110
210
|
};
|
|
111
211
|
};
|
|
112
212
|
};
|
|
@@ -119,13 +219,13 @@ export interface SourceConfig {
|
|
|
119
219
|
readonly baseUrl?: string;
|
|
120
220
|
readonly namespace?: string;
|
|
121
221
|
readonly headers?: Record<string, ConfiguredHeaderValue>;
|
|
122
|
-
readonly queryParams?: Record<string,
|
|
222
|
+
readonly queryParams?: Record<string, ConfiguredHeaderValue>;
|
|
123
223
|
readonly specFetchCredentials?: OpenApiSpecFetchCredentials;
|
|
124
224
|
readonly oauth2?: OAuth2SourceConfig;
|
|
125
225
|
}
|
|
126
226
|
export interface OpenApiSpecFetchCredentials {
|
|
127
|
-
readonly headers?: Record<string,
|
|
128
|
-
readonly queryParams?: Record<string,
|
|
227
|
+
readonly headers?: Record<string, ConfiguredHeaderValue>;
|
|
228
|
+
readonly queryParams?: Record<string, ConfiguredHeaderValue>;
|
|
129
229
|
}
|
|
130
230
|
export interface StoredSource {
|
|
131
231
|
readonly namespace: string;
|
|
@@ -135,13 +235,10 @@ export interface StoredSource {
|
|
|
135
235
|
readonly scope: string;
|
|
136
236
|
readonly name: string;
|
|
137
237
|
readonly config: SourceConfig;
|
|
138
|
-
readonly legacy?: {
|
|
139
|
-
readonly headers?: Record<string, HeaderValue>;
|
|
140
|
-
readonly oauth2?: OAuth2Auth;
|
|
141
|
-
};
|
|
142
238
|
}
|
|
143
239
|
declare const StoredSourceSchema_base: Schema.Class<StoredSourceSchema, Schema.Struct<{
|
|
144
240
|
readonly namespace: Schema.String;
|
|
241
|
+
readonly scope: Schema.String;
|
|
145
242
|
readonly name: Schema.String;
|
|
146
243
|
readonly config: Schema.Struct<{
|
|
147
244
|
readonly spec: Schema.String;
|
|
@@ -149,19 +246,10 @@ declare const StoredSourceSchema_base: Schema.Class<StoredSourceSchema, Schema.S
|
|
|
149
246
|
readonly baseUrl: Schema.optional<Schema.String>;
|
|
150
247
|
readonly namespace: Schema.optional<Schema.String>;
|
|
151
248
|
readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, typeof ConfiguredHeaderBinding]>>>;
|
|
152
|
-
readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String,
|
|
153
|
-
readonly secretId: Schema.String;
|
|
154
|
-
readonly prefix: Schema.optional<Schema.String>;
|
|
155
|
-
}>]>>>;
|
|
249
|
+
readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, typeof ConfiguredHeaderBinding]>>>;
|
|
156
250
|
readonly specFetchCredentials: Schema.optional<Schema.Struct<{
|
|
157
|
-
readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String,
|
|
158
|
-
|
|
159
|
-
readonly prefix: Schema.optional<Schema.String>;
|
|
160
|
-
}>]>>>;
|
|
161
|
-
readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
162
|
-
readonly secretId: Schema.String;
|
|
163
|
-
readonly prefix: Schema.optional<Schema.String>;
|
|
164
|
-
}>]>>>;
|
|
251
|
+
readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, typeof ConfiguredHeaderBinding]>>>;
|
|
252
|
+
readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, typeof ConfiguredHeaderBinding]>>>;
|
|
165
253
|
}>>;
|
|
166
254
|
readonly oauth2: Schema.optional<typeof OAuth2SourceConfig>;
|
|
167
255
|
}>;
|
|
@@ -175,6 +263,7 @@ export interface StoredOperation {
|
|
|
175
263
|
readonly binding: OperationBinding;
|
|
176
264
|
}
|
|
177
265
|
export declare const headerBindingSlot: (headerName: string) => string;
|
|
266
|
+
export declare const queryParamBindingSlot: (name: string) => string;
|
|
178
267
|
export declare const oauth2ClientIdSlot: (securitySchemeName: string) => string;
|
|
179
268
|
export declare const oauth2ClientSecretSlot: (securitySchemeName: string) => string;
|
|
180
269
|
export declare const oauth2ConnectionSlot: (securitySchemeName: string) => string;
|
|
@@ -184,7 +273,7 @@ export interface OpenapiStore {
|
|
|
184
273
|
readonly name?: string;
|
|
185
274
|
readonly baseUrl?: string;
|
|
186
275
|
readonly headers?: Record<string, ConfiguredHeaderValue>;
|
|
187
|
-
readonly queryParams?: Record<string,
|
|
276
|
+
readonly queryParams?: Record<string, ConfiguredHeaderValue>;
|
|
188
277
|
readonly oauth2?: OAuth2SourceConfig;
|
|
189
278
|
}) => Effect.Effect<void, StorageFailure>;
|
|
190
279
|
readonly getSource: (namespace: string, scope: string) => Effect.Effect<StoredSource | null, StorageFailure>;
|
|
@@ -192,10 +281,6 @@ export interface OpenapiStore {
|
|
|
192
281
|
readonly getOperationByToolId: (toolId: string, scope: string) => Effect.Effect<StoredOperation | null, StorageFailure>;
|
|
193
282
|
readonly listOperationsBySource: (sourceId: string, scope: string) => Effect.Effect<readonly StoredOperation[], StorageFailure>;
|
|
194
283
|
readonly removeSource: (namespace: string, scope: string) => Effect.Effect<void, StorageFailure>;
|
|
195
|
-
readonly listSourceBindings: (sourceId: string, sourceScope: string) => Effect.Effect<readonly OpenApiSourceBindingRef[], StorageFailure>;
|
|
196
|
-
readonly resolveSourceBinding: (sourceId: string, sourceScope: string, slot: string) => Effect.Effect<OpenApiSourceBindingRef | null, StorageFailure>;
|
|
197
|
-
readonly setSourceBinding: (input: OpenApiSourceBindingInput) => Effect.Effect<OpenApiSourceBindingRef, StorageFailure>;
|
|
198
|
-
readonly removeSourceBinding: (sourceId: string, sourceScope: string, slot: string, scope: string) => Effect.Effect<void, StorageFailure>;
|
|
199
284
|
}
|
|
200
|
-
export declare const makeDefaultOpenapiStore: ({ adapter
|
|
285
|
+
export declare const makeDefaultOpenapiStore: ({ adapter }: StorageDeps<OpenapiSchema>) => OpenapiStore;
|
|
201
286
|
export {};
|