@executor-js/plugin-openapi 0.1.0 → 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.
Files changed (38) hide show
  1. package/dist/AddOpenApiSource-EV3NJHLA.js +19 -0
  2. package/dist/AddOpenApiSource-EV3NJHLA.js.map +1 -0
  3. package/dist/EditOpenApiSource-J7NXCVT5.js +665 -0
  4. package/dist/EditOpenApiSource-J7NXCVT5.js.map +1 -0
  5. package/dist/OpenApiSourceSummary-K5WZD5NR.js +122 -0
  6. package/dist/OpenApiSourceSummary-K5WZD5NR.js.map +1 -0
  7. package/dist/api/group.d.ts +79 -10
  8. package/dist/api/index.d.ts +384 -0
  9. package/dist/chunk-2BXVRXGL.js +1345 -0
  10. package/dist/chunk-2BXVRXGL.js.map +1 -0
  11. package/dist/chunk-E4QUTDQ2.js +1120 -0
  12. package/dist/chunk-E4QUTDQ2.js.map +1 -0
  13. package/dist/chunk-LBTK5F65.js +216 -0
  14. package/dist/chunk-LBTK5F65.js.map +1 -0
  15. package/dist/chunk-TRD7KSKA.js +1444 -0
  16. package/dist/chunk-TRD7KSKA.js.map +1 -0
  17. package/dist/client.js +165 -0
  18. package/dist/client.js.map +1 -0
  19. package/dist/core.js +8 -10
  20. package/dist/index.js +2 -1
  21. package/dist/react/AddOpenApiSource.d.ts +1 -1
  22. package/dist/react/OpenApiSourceDetailsFields.d.ts +18 -0
  23. package/dist/react/atoms.d.ts +158 -13
  24. package/dist/react/client.d.ts +84 -15
  25. package/dist/sdk/index.d.ts +1 -1
  26. package/dist/sdk/openapi-utils.d.ts +4 -3
  27. package/dist/sdk/parse.d.ts +1 -1
  28. package/dist/sdk/parse.test.d.ts +1 -0
  29. package/dist/sdk/plugin.d.ts +136 -125
  30. package/dist/sdk/store.d.ts +132 -47
  31. package/dist/sdk/types.d.ts +19 -44
  32. package/dist/sdk/usage-scope-isolation.test.d.ts +1 -0
  33. package/dist/testing/index.d.ts +34 -0
  34. package/dist/testing.js +56 -0
  35. package/dist/testing.js.map +1 -0
  36. package/package.json +16 -4
  37. package/dist/chunk-RBE3CVB4.js +0 -2837
  38. package/dist/chunk-RBE3CVB4.js.map +0 -1
@@ -1,28 +1,28 @@
1
- import { Effect, Schema } from "effect";
1
+ import { Effect } from "effect";
2
2
  import type { Layer } from "effect";
3
3
  import { HttpClient } from "effect/unstable/http";
4
- import { OpenApiExtensionService } from "../api/handlers";
5
4
  import { type StorageFailure } from "@executor-js/sdk/core";
6
5
  import { type ConfigFileSink } from "@executor-js/config";
7
6
  import { OpenApiExtractionError, OpenApiOAuthError, OpenApiParseError } from "./errors";
8
7
  import { SpecPreview } from "./preview";
9
8
  import { type OpenapiStore, type SourceConfig, type StoredSource } from "./store";
10
- import { HeaderValue as HeaderValueSchema, OAuth2Auth, OAuth2SourceConfig, OpenApiSourceBindingInput, type OpenApiSourceBindingRef, type ConfiguredHeaderValue as ConfiguredHeaderValueValue, type HeaderValue as HeaderValueValue } from "./types";
9
+ import { OAuth2SourceConfig, OpenApiSourceBindingInput, OpenApiSourceBindingRef, type OpenApiCredentialInput as OpenApiCredentialInputValue, type ConfiguredHeaderValue as ConfiguredHeaderValueValue, type HeaderValue as HeaderValueValue } from "./types";
11
10
  export type HeaderValue = HeaderValueValue;
12
11
  export type ConfiguredHeaderValue = ConfiguredHeaderValueValue;
13
12
  export type OpenApiHeaderInput = HeaderValue | ConfiguredHeaderValue;
14
- export type OpenApiOAuthInput = OAuth2Auth | OAuth2SourceConfig;
15
- export interface OpenApiSpecFetchCredentials {
13
+ export type OpenApiCredentialInput = OpenApiCredentialInputValue;
14
+ export type OpenApiOAuthInput = OAuth2SourceConfig;
15
+ export interface OpenApiSpecFetchCredentialsInput {
16
16
  readonly headers?: Record<string, HeaderValue>;
17
17
  readonly queryParams?: Record<string, HeaderValue>;
18
18
  }
19
19
  export interface OpenApiPreviewInput {
20
20
  readonly spec: string;
21
- readonly specFetchCredentials?: OpenApiSpecFetchCredentials;
21
+ readonly specFetchCredentials?: OpenApiSpecFetchCredentialsInput;
22
22
  }
23
23
  export interface OpenApiSpecConfig {
24
24
  readonly spec: string;
25
- readonly specFetchCredentials?: OpenApiSpecFetchCredentials;
25
+ readonly specFetchCredentials?: OpenApiSpecFetchCredentialsInput;
26
26
  /**
27
27
  * Executor scope id that owns this source row. Must be one of the
28
28
  * executor's configured scopes. Typical shape: an admin adds the
@@ -33,15 +33,17 @@ export interface OpenApiSpecConfig {
33
33
  readonly name?: string;
34
34
  readonly baseUrl?: string;
35
35
  readonly namespace?: string;
36
- readonly headers?: Record<string, OpenApiHeaderInput>;
37
- readonly queryParams?: Record<string, HeaderValue>;
36
+ readonly headers?: Record<string, OpenApiCredentialInput>;
37
+ readonly queryParams?: Record<string, OpenApiCredentialInput>;
38
38
  readonly oauth2?: OpenApiOAuthInput;
39
+ readonly credentialTargetScope?: string;
39
40
  }
40
41
  export interface OpenApiUpdateSourceInput {
41
42
  readonly name?: string;
42
43
  readonly baseUrl?: string;
43
- readonly headers?: Record<string, OpenApiHeaderInput>;
44
- readonly queryParams?: Record<string, HeaderValue>;
44
+ readonly headers?: Record<string, OpenApiCredentialInput>;
45
+ readonly queryParams?: Record<string, OpenApiCredentialInput>;
46
+ readonly credentialTargetScope?: string;
45
47
  /** Refresh the source's stored OAuth2 metadata after a successful
46
48
  * re-authenticate. */
47
49
  readonly oauth2?: OpenApiOAuthInput;
@@ -88,12 +90,8 @@ export declare const openApiPlugin: import("@executor-js/sdk/core").ConfiguredPl
88
90
  namespace: string;
89
91
  scope: string;
90
92
  name: string;
91
- legacy?: {
92
- readonly headers?: Record<string, HeaderValueSchema>;
93
- readonly oauth2?: OAuth2Auth;
94
- };
95
93
  } | null, StorageFailure, never>;
96
- updateSource: (namespace: string, scope: string, input: OpenApiUpdateSourceInput) => Effect.Effect<void, StorageFailure, never>;
94
+ updateSource: (namespace: string, scope: string, input: OpenApiUpdateSourceInput) => Effect.Effect<undefined, StorageFailure | OpenApiOAuthError, never>;
97
95
  listSourceBindings: (sourceId: string, sourceScope: string) => Effect.Effect<readonly OpenApiSourceBindingRef[], StorageFailure, never>;
98
96
  setSourceBinding: (input: OpenApiSourceBindingInput) => Effect.Effect<OpenApiSourceBindingRef, StorageFailure, never>;
99
97
  removeSourceBinding: (sourceId: string, sourceScope: string, slot: string, scope: string) => Effect.Effect<void, StorageFailure, never>;
@@ -125,25 +123,35 @@ export declare const openApiPlugin: import("@executor-js/sdk/core").ConfiguredPl
125
123
  readonly type: "string";
126
124
  readonly required: false;
127
125
  };
128
- readonly headers: {
126
+ readonly oauth2: {
129
127
  readonly type: "json";
130
128
  readonly required: false;
131
129
  };
132
- readonly query_params: {
133
- readonly type: "json";
134
- readonly required: false;
130
+ };
131
+ };
132
+ readonly openapi_operation: {
133
+ readonly fields: {
134
+ readonly id: {
135
+ readonly type: "string";
136
+ readonly required: true;
135
137
  };
136
- readonly oauth2: {
137
- readonly type: "json";
138
- readonly required: false;
138
+ readonly scope_id: {
139
+ readonly type: "string";
140
+ readonly required: true;
141
+ readonly index: true;
142
+ };
143
+ readonly source_id: {
144
+ readonly type: "string";
145
+ readonly required: true;
146
+ readonly index: true;
139
147
  };
140
- readonly invocation_config: {
148
+ readonly binding: {
141
149
  readonly type: "json";
142
150
  readonly required: true;
143
151
  };
144
152
  };
145
153
  };
146
- readonly openapi_operation: {
154
+ readonly openapi_source_header: {
147
155
  readonly fields: {
148
156
  readonly id: {
149
157
  readonly type: "string";
@@ -159,137 +167,140 @@ export declare const openApiPlugin: import("@executor-js/sdk/core").ConfiguredPl
159
167
  readonly required: true;
160
168
  readonly index: true;
161
169
  };
162
- readonly binding: {
163
- readonly type: "json";
170
+ readonly name: {
171
+ readonly type: "string";
164
172
  readonly required: true;
165
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
+ };
166
190
  };
167
191
  };
168
- readonly openapi_source_binding: {
192
+ readonly openapi_source_query_param: {
169
193
  readonly fields: {
170
194
  readonly id: {
171
195
  readonly type: "string";
172
196
  readonly required: true;
173
197
  };
198
+ readonly scope_id: {
199
+ readonly type: "string";
200
+ readonly required: true;
201
+ readonly index: true;
202
+ };
174
203
  readonly source_id: {
175
204
  readonly type: "string";
176
205
  readonly required: true;
177
206
  readonly index: true;
178
207
  };
179
- readonly source_scope_id: {
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: {
180
237
  readonly type: "string";
181
238
  readonly required: true;
182
239
  readonly index: true;
183
240
  };
184
- readonly target_scope_id: {
241
+ readonly source_id: {
185
242
  readonly type: "string";
186
243
  readonly required: true;
187
244
  readonly index: true;
188
245
  };
189
- readonly slot: {
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: {
190
275
  readonly type: "string";
191
276
  readonly required: true;
192
277
  readonly index: true;
193
278
  };
194
- readonly value: {
195
- readonly type: "json";
279
+ readonly source_id: {
280
+ readonly type: "string";
196
281
  readonly required: true;
282
+ readonly index: true;
197
283
  };
198
- readonly created_at: {
199
- readonly type: "date";
284
+ readonly name: {
285
+ readonly type: "string";
200
286
  readonly required: true;
201
287
  };
202
- readonly updated_at: {
203
- readonly type: "date";
288
+ readonly kind: {
289
+ readonly type: ["text", "binding"];
204
290
  readonly required: true;
205
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
+ };
206
304
  };
207
305
  };
208
- }, typeof OpenApiExtensionService, Layer.Layer<import("effect/unstable/httpapi/HttpApiGroup").ApiGroup<"executor", "openapi">, never, import("effect/unstable/http/HttpRouter").Request<"Requires", OpenApiExtensionService>>, import("effect/unstable/httpapi/HttpApiGroup").HttpApiGroup<"openapi", import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"previewSpec", "POST", "/scopes/:scopeId/openapi/preview", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<Schema.Struct<{
209
- scopeId: Schema.brand<Schema.String, "ScopeId">;
210
- }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<Schema.Struct<{
211
- readonly spec: Schema.String;
212
- readonly specFetchCredentials: Schema.optional<Schema.Struct<{
213
- readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
214
- readonly secretId: Schema.String;
215
- readonly prefix: Schema.optional<Schema.String>;
216
- }>]>>>;
217
- readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
218
- readonly secretId: Schema.String;
219
- readonly prefix: Schema.optional<Schema.String>;
220
- }>]>>>;
221
- }>>;
222
- }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof SpecPreview>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof OpenApiParseError | typeof OpenApiExtractionError | typeof OpenApiOAuthError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"addSpec", "POST", "/scopes/:scopeId/openapi/specs", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<Schema.Struct<{
223
- scopeId: Schema.brand<Schema.String, "ScopeId">;
224
- }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<Schema.Struct<{
225
- readonly spec: Schema.String;
226
- readonly specFetchCredentials: Schema.optional<Schema.Struct<{
227
- readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
228
- readonly secretId: Schema.String;
229
- readonly prefix: Schema.optional<Schema.String>;
230
- }>]>>>;
231
- readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
232
- readonly secretId: Schema.String;
233
- readonly prefix: Schema.optional<Schema.String>;
234
- }>]>>>;
235
- }>>;
236
- readonly name: Schema.optional<Schema.String>;
237
- readonly baseUrl: Schema.optional<Schema.String>;
238
- readonly namespace: Schema.optional<Schema.String>;
239
- readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
240
- readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
241
- readonly secretId: Schema.String;
242
- readonly prefix: Schema.optional<Schema.String>;
243
- }>]>>>;
244
- readonly oauth2: Schema.optional<Schema.Union<readonly [typeof OAuth2Auth, typeof OAuth2SourceConfig]>>;
245
- }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<Schema.Struct<{
246
- readonly toolCount: Schema.Number;
247
- readonly namespace: Schema.String;
248
- }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof OpenApiParseError | typeof OpenApiExtractionError | typeof OpenApiOAuthError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getSource", "GET", "/scopes/:scopeId/openapi/sources/:namespace", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<Schema.Struct<{
249
- scopeId: Schema.brand<Schema.String, "ScopeId">;
250
- namespace: Schema.String;
251
- }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<Schema.NullOr<typeof import("./store").StoredSourceSchema>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof OpenApiParseError | typeof OpenApiExtractionError | typeof OpenApiOAuthError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"updateSource", "PATCH", "/scopes/:scopeId/openapi/sources/:namespace", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<Schema.Struct<{
252
- scopeId: Schema.brand<Schema.String, "ScopeId">;
253
- namespace: Schema.String;
254
- }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<Schema.Struct<{
255
- readonly name: Schema.optional<Schema.String>;
256
- readonly baseUrl: Schema.optional<Schema.String>;
257
- readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
258
- readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
259
- readonly secretId: Schema.String;
260
- readonly prefix: Schema.optional<Schema.String>;
261
- }>]>>>;
262
- readonly oauth2: Schema.optional<Schema.Union<readonly [typeof OAuth2Auth, typeof OAuth2SourceConfig]>>;
263
- }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<Schema.Struct<{
264
- readonly updated: Schema.Boolean;
265
- }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof OpenApiParseError | typeof OpenApiExtractionError | typeof OpenApiOAuthError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"listSourceBindings", "GET", "/scopes/:scopeId/openapi/sources/:namespace/base/:sourceScopeId/bindings", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<Schema.Struct<{
266
- scopeId: Schema.brand<Schema.String, "ScopeId">;
267
- namespace: Schema.String;
268
- sourceScopeId: Schema.brand<Schema.String, "ScopeId">;
269
- }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<Schema.$Array<typeof OpenApiSourceBindingRef>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof OpenApiParseError | typeof OpenApiExtractionError | typeof OpenApiOAuthError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"setSourceBinding", "POST", "/scopes/:scopeId/openapi/source-bindings", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<Schema.Struct<{
270
- scopeId: Schema.brand<Schema.String, "ScopeId">;
271
- }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<Schema.Struct<{
272
- readonly sourceId: Schema.String;
273
- readonly sourceScope: Schema.brand<Schema.String, "ScopeId">;
274
- readonly scope: Schema.brand<Schema.String, "ScopeId">;
275
- readonly slot: Schema.String;
276
- readonly value: Schema.Union<readonly [Schema.Struct<{
277
- readonly kind: Schema.Literal<"secret">;
278
- readonly secretId: Schema.brand<Schema.String, "SecretId">;
279
- }>, Schema.Struct<{
280
- readonly kind: Schema.Literal<"connection">;
281
- readonly connectionId: Schema.brand<Schema.String, "ConnectionId">;
282
- }>, Schema.Struct<{
283
- readonly kind: Schema.Literal<"text">;
284
- readonly text: Schema.String;
285
- }>]>;
286
- }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof OpenApiSourceBindingRef>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof OpenApiParseError | typeof OpenApiExtractionError | typeof OpenApiOAuthError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"removeSourceBinding", "POST", "/scopes/:scopeId/openapi/source-bindings/remove", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<Schema.Struct<{
287
- scopeId: Schema.brand<Schema.String, "ScopeId">;
288
- }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<Schema.Struct<{
289
- readonly sourceId: Schema.String;
290
- readonly sourceScope: Schema.brand<Schema.String, "ScopeId">;
291
- readonly slot: Schema.String;
292
- readonly scope: Schema.brand<Schema.String, "ScopeId">;
293
- }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<Schema.Struct<{
294
- readonly removed: Schema.Boolean;
295
- }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof OpenApiParseError | typeof OpenApiExtractionError | typeof OpenApiOAuthError>, never, never>, false>>;
306
+ }, undefined, Layer.Layer<unknown, never, never>, import("effect/unstable/httpapi/HttpApiGroup").Any>;
@@ -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, HeaderValue, OAuth2Auth, OAuth2SourceConfig, OpenApiSourceBindingInput, OpenApiSourceBindingRef, OperationBinding } from "./types";
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 headers: {
32
+ readonly oauth2: {
33
33
  readonly type: "json";
34
34
  readonly required: false;
35
35
  };
36
- readonly query_params: {
37
- readonly type: "json";
38
- readonly required: false;
36
+ };
37
+ };
38
+ readonly openapi_operation: {
39
+ readonly fields: {
40
+ readonly id: {
41
+ readonly type: "string";
42
+ readonly required: true;
39
43
  };
40
- readonly oauth2: {
41
- readonly type: "json";
42
- readonly required: false;
44
+ readonly scope_id: {
45
+ readonly type: "string";
46
+ readonly required: true;
47
+ readonly index: true;
43
48
  };
44
- readonly invocation_config: {
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 openapi_operation: {
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 binding: {
67
- readonly type: "json";
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 openapi_source_binding: {
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 source_scope_id: {
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 target_scope_id: {
147
+ readonly source_id: {
89
148
  readonly type: "string";
90
149
  readonly required: true;
91
150
  readonly index: true;
92
151
  };
93
- readonly slot: {
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 value: {
99
- readonly type: "json";
185
+ readonly source_id: {
186
+ readonly type: "string";
100
187
  readonly required: true;
188
+ readonly index: true;
101
189
  };
102
- readonly created_at: {
103
- readonly type: "date";
190
+ readonly name: {
191
+ readonly type: "string";
104
192
  readonly required: true;
105
193
  };
106
- readonly updated_at: {
107
- readonly type: "date";
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, HeaderValue>;
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, HeaderValue>;
128
- readonly queryParams?: Record<string, HeaderValue>;
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, Schema.Struct<{
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, Schema.Struct<{
158
- readonly secretId: Schema.String;
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, HeaderValue>;
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, scopes, }: StorageDeps<OpenapiSchema>) => OpenapiStore;
285
+ export declare const makeDefaultOpenapiStore: ({ adapter }: StorageDeps<OpenapiSchema>) => OpenapiStore;
201
286
  export {};