@executor-js/plugin-openapi 0.0.1 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +24 -23
  2. package/dist/api/group.d.ts +94 -38
  3. package/dist/api/handlers.d.ts +2 -2
  4. package/dist/chunk-RBE3CVB4.js +2837 -0
  5. package/dist/chunk-RBE3CVB4.js.map +1 -0
  6. package/dist/core.js +44 -50
  7. package/dist/core.js.map +1 -1
  8. package/dist/index.js +2 -5
  9. package/dist/index.js.map +1 -1
  10. package/dist/react/AddOpenApiSource.d.ts +13 -0
  11. package/dist/react/EditOpenApiSource.d.ts +2 -2
  12. package/dist/react/OpenApiSourceSummary.d.ts +3 -1
  13. package/dist/react/atoms.d.ts +129 -0
  14. package/dist/react/client.d.ts +88 -3
  15. package/dist/react/plugin-client.d.ts +2 -0
  16. package/dist/react/source-plugin.d.ts +1 -1
  17. package/dist/sdk/client-credentials-oauth.test.d.ts +1 -0
  18. package/dist/sdk/credential-status.d.ts +23 -0
  19. package/dist/sdk/credential-status.test.d.ts +1 -0
  20. package/dist/sdk/errors.d.ts +11 -10
  21. package/dist/sdk/form-urlencoded-body.test.d.ts +1 -0
  22. package/dist/sdk/index.d.ts +8 -10
  23. package/dist/sdk/invoke.d.ts +8 -17
  24. package/dist/sdk/multi-scope-bearer.test.d.ts +1 -0
  25. package/dist/sdk/multi-scope-oauth.test.d.ts +1 -0
  26. package/dist/sdk/non-json-body.test.d.ts +1 -0
  27. package/dist/sdk/oauth-refresh.test.d.ts +1 -0
  28. package/dist/sdk/openapi-utils.d.ts +35 -4
  29. package/dist/sdk/parse.d.ts +28 -4
  30. package/dist/sdk/plugin.d.ts +278 -23
  31. package/dist/sdk/preview-oauth2.test.d.ts +1 -0
  32. package/dist/sdk/preview.d.ts +86 -161
  33. package/dist/sdk/store.d.ts +201 -0
  34. package/dist/sdk/types.d.ts +234 -266
  35. package/dist/sdk/upstream-failures.test.d.ts +1 -0
  36. package/package.json +11 -22
  37. package/dist/chunk-KPGROAQO.js +0 -1279
  38. package/dist/chunk-KPGROAQO.js.map +0 -1
  39. package/dist/promise.d.ts +0 -6
  40. package/dist/sdk/config-file-store.d.ts +0 -10
  41. package/dist/sdk/kv-operation-store.d.ts +0 -4
  42. package/dist/sdk/operation-store.d.ts +0 -36
  43. package/dist/sdk/stored-source.d.ts +0 -51
@@ -1,187 +1,112 @@
1
- import { Effect, Option } from "effect";
1
+ import { Effect } from "effect";
2
2
  import { Schema } from "effect";
3
- declare const SecurityScheme_base: Schema.Class<SecurityScheme, {
4
- /** Key name in components.securitySchemes (e.g. "api_token") */
5
- name: typeof Schema.String;
6
- /** OpenAPI security scheme type */
7
- type: Schema.Literal<["http", "apiKey", "oauth2", "openIdConnect"]>;
8
- /** For type: "http" — e.g. "bearer", "basic" */
9
- scheme: Schema.optionalWith<typeof Schema.String, {
10
- as: "Option";
11
- }>;
12
- /** For type: "apiKey" — where the key goes */
13
- in: Schema.optionalWith<Schema.Literal<["header", "query", "cookie"]>, {
14
- as: "Option";
15
- }>;
16
- /** For type: "apiKey" — the header/query/cookie name */
17
- headerName: Schema.optionalWith<typeof Schema.String, {
18
- as: "Option";
19
- }>;
20
- description: Schema.optionalWith<typeof Schema.String, {
21
- as: "Option";
22
- }>;
23
- }, Schema.Struct.Encoded<{
3
+ import { ServerInfo } from "./types";
4
+ declare const OAuth2AuthorizationCodeFlow_base: Schema.Class<OAuth2AuthorizationCodeFlow, Schema.Struct<{
5
+ readonly authorizationUrl: Schema.String;
6
+ readonly tokenUrl: Schema.String;
7
+ readonly refreshUrl: Schema.OptionFromOptional<Schema.String>;
8
+ readonly scopes: Schema.$Record<Schema.String, Schema.String>;
9
+ }>, {}>;
10
+ export declare class OAuth2AuthorizationCodeFlow extends OAuth2AuthorizationCodeFlow_base {
11
+ }
12
+ declare const OAuth2ClientCredentialsFlow_base: Schema.Class<OAuth2ClientCredentialsFlow, Schema.Struct<{
13
+ readonly tokenUrl: Schema.String;
14
+ readonly refreshUrl: Schema.OptionFromOptional<Schema.String>;
15
+ readonly scopes: Schema.$Record<Schema.String, Schema.String>;
16
+ }>, {}>;
17
+ export declare class OAuth2ClientCredentialsFlow extends OAuth2ClientCredentialsFlow_base {
18
+ }
19
+ declare const OAuth2Flows_base: Schema.Class<OAuth2Flows, Schema.Struct<{
20
+ readonly authorizationCode: Schema.OptionFromOptional<typeof OAuth2AuthorizationCodeFlow>;
21
+ readonly clientCredentials: Schema.OptionFromOptional<typeof OAuth2ClientCredentialsFlow>;
22
+ }>, {}>;
23
+ export declare class OAuth2Flows extends OAuth2Flows_base {
24
+ }
25
+ declare const SecurityScheme_base: Schema.Class<SecurityScheme, Schema.Struct<{
24
26
  /** Key name in components.securitySchemes (e.g. "api_token") */
25
- name: typeof Schema.String;
27
+ readonly name: Schema.String;
26
28
  /** OpenAPI security scheme type */
27
- type: Schema.Literal<["http", "apiKey", "oauth2", "openIdConnect"]>;
29
+ readonly type: Schema.Literals<readonly ["http", "apiKey", "oauth2", "openIdConnect"]>;
28
30
  /** For type: "http" — e.g. "bearer", "basic" */
29
- scheme: Schema.optionalWith<typeof Schema.String, {
30
- as: "Option";
31
- }>;
31
+ readonly scheme: Schema.OptionFromOptional<Schema.String>;
32
+ /** For type: "http" with scheme "bearer" — e.g. "JWT" */
33
+ readonly bearerFormat: Schema.OptionFromOptional<Schema.String>;
32
34
  /** For type: "apiKey" — where the key goes */
33
- in: Schema.optionalWith<Schema.Literal<["header", "query", "cookie"]>, {
34
- as: "Option";
35
- }>;
35
+ readonly in: Schema.OptionFromOptional<Schema.Literals<readonly ["header", "query", "cookie"]>>;
36
36
  /** For type: "apiKey" — the header/query/cookie name */
37
- headerName: Schema.optionalWith<typeof Schema.String, {
38
- as: "Option";
39
- }>;
40
- description: Schema.optionalWith<typeof Schema.String, {
41
- as: "Option";
42
- }>;
43
- }>, never, {
44
- readonly name: string;
45
- } & {
46
- readonly description: Option.Option<string>;
47
- } & {
48
- readonly type: "http" | "apiKey" | "oauth2" | "openIdConnect";
49
- } & {
50
- readonly scheme: Option.Option<string>;
51
- } & {
52
- readonly in: Option.Option<"query" | "header" | "cookie">;
53
- } & {
54
- readonly headerName: Option.Option<string>;
55
- }, {}, {}>;
37
+ readonly headerName: Schema.OptionFromOptional<Schema.String>;
38
+ readonly description: Schema.OptionFromOptional<Schema.String>;
39
+ /** For type: "oauth2" — declared flows (authorizationCode / clientCredentials only; implicit and password are deprecated). */
40
+ readonly flows: Schema.OptionFromOptional<typeof OAuth2Flows>;
41
+ /** For type: "openIdConnect" — the discovery URL. */
42
+ readonly openIdConnectUrl: Schema.OptionFromOptional<Schema.String>;
43
+ }>, {}>;
56
44
  export declare class SecurityScheme extends SecurityScheme_base {
57
45
  }
58
- declare const AuthStrategy_base: Schema.Class<AuthStrategy, {
59
- /** The security schemes required together for this strategy */
60
- schemes: Schema.Array$<typeof Schema.String>;
61
- }, Schema.Struct.Encoded<{
46
+ declare const AuthStrategy_base: Schema.Class<AuthStrategy, Schema.Struct<{
62
47
  /** The security schemes required together for this strategy */
63
- schemes: Schema.Array$<typeof Schema.String>;
64
- }>, never, {
65
- readonly schemes: readonly string[];
66
- }, {}, {}>;
48
+ readonly schemes: Schema.$Array<Schema.String>;
49
+ }>, {}>;
67
50
  export declare class AuthStrategy extends AuthStrategy_base {
68
51
  }
69
- declare const HeaderPreset_base: Schema.Class<HeaderPreset, {
52
+ declare const HeaderPreset_base: Schema.Class<HeaderPreset, Schema.Struct<{
70
53
  /** Human-readable label for the UI (e.g. "Bearer Token", "API Key + Email") */
71
- label: typeof Schema.String;
54
+ readonly label: Schema.String;
72
55
  /** Headers this strategy needs. Value is null when the user must provide it. */
73
- headers: Schema.Record$<typeof Schema.String, Schema.NullOr<typeof Schema.String>>;
56
+ readonly headers: Schema.$Record<Schema.String, Schema.NullOr<Schema.String>>;
74
57
  /** Which headers should be stored as secrets */
75
- secretHeaders: Schema.Array$<typeof Schema.String>;
76
- }, Schema.Struct.Encoded<{
77
- /** Human-readable label for the UI (e.g. "Bearer Token", "API Key + Email") */
78
- label: typeof Schema.String;
79
- /** Headers this strategy needs. Value is null when the user must provide it. */
80
- headers: Schema.Record$<typeof Schema.String, Schema.NullOr<typeof Schema.String>>;
81
- /** Which headers should be stored as secrets */
82
- secretHeaders: Schema.Array$<typeof Schema.String>;
83
- }>, never, {
84
- readonly headers: {
85
- readonly [x: string]: string | null;
86
- };
87
- } & {
88
- readonly label: string;
89
- } & {
90
- readonly secretHeaders: readonly string[];
91
- }, {}, {}>;
58
+ readonly secretHeaders: Schema.$Array<Schema.String>;
59
+ }>, {}>;
92
60
  export declare class HeaderPreset extends HeaderPreset_base {
93
61
  }
94
- declare const PreviewOperation_base: Schema.Class<PreviewOperation, {
95
- operationId: typeof Schema.String;
96
- method: Schema.Literal<["get", "put", "post", "delete", "patch", "head", "options", "trace"]>;
97
- path: typeof Schema.String;
98
- summary: Schema.optionalWith<typeof Schema.String, {
99
- as: "Option";
100
- }>;
101
- tags: Schema.Array$<typeof Schema.String>;
102
- deprecated: typeof Schema.Boolean;
103
- }, Schema.Struct.Encoded<{
104
- operationId: typeof Schema.String;
105
- method: Schema.Literal<["get", "put", "post", "delete", "patch", "head", "options", "trace"]>;
106
- path: typeof Schema.String;
107
- summary: Schema.optionalWith<typeof Schema.String, {
108
- as: "Option";
109
- }>;
110
- tags: Schema.Array$<typeof Schema.String>;
111
- deprecated: typeof Schema.Boolean;
112
- }>, never, {
113
- readonly tags: readonly string[];
114
- } & {
115
- readonly summary: Option.Option<string>;
116
- } & {
117
- readonly operationId: string;
118
- } & {
119
- readonly deprecated: boolean;
120
- } & {
121
- readonly path: string;
122
- } & {
123
- readonly method: "delete" | "get" | "put" | "post" | "options" | "head" | "patch" | "trace";
124
- }, {}, {}>;
62
+ declare const OAuth2Preset_base: Schema.Class<OAuth2Preset, Schema.Struct<{
63
+ /** Human-readable label for the UI (e.g. "OAuth2 (Authorization Code) — oauth_app") */
64
+ readonly label: Schema.String;
65
+ /** The source security scheme this preset came from (components.securitySchemes key). */
66
+ readonly securitySchemeName: Schema.String;
67
+ /** Which OAuth2 flow this preset uses. */
68
+ readonly flow: Schema.Literals<readonly ["authorizationCode", "clientCredentials"]>;
69
+ /** For authorizationCode: user-agent redirect URL (from the spec). */
70
+ readonly authorizationUrl: Schema.OptionFromOptional<Schema.String>;
71
+ /** Token endpoint to exchange the code / refresh. */
72
+ readonly tokenUrl: Schema.String;
73
+ /** Optional refresh endpoint if the spec declares one separately. */
74
+ readonly refreshUrl: Schema.OptionFromOptional<Schema.String>;
75
+ /** Declared scopes for this flow: `{ scope: description }`. */
76
+ readonly scopes: Schema.$Record<Schema.String, Schema.String>;
77
+ }>, {}>;
78
+ export declare class OAuth2Preset extends OAuth2Preset_base {
79
+ }
80
+ declare const PreviewOperation_base: Schema.Class<PreviewOperation, Schema.Struct<{
81
+ readonly operationId: Schema.String;
82
+ readonly method: Schema.Literals<readonly ["get", "put", "post", "delete", "patch", "head", "options", "trace"]>;
83
+ readonly path: Schema.String;
84
+ readonly summary: Schema.OptionFromOptional<Schema.String>;
85
+ readonly tags: Schema.$Array<Schema.String>;
86
+ readonly deprecated: Schema.Boolean;
87
+ }>, {}>;
125
88
  export declare class PreviewOperation extends PreviewOperation_base {
126
89
  }
127
- declare const SpecPreview_base: Schema.Class<SpecPreview, {
128
- title: Schema.optionalWith<typeof Schema.String, {
129
- as: "Option";
130
- }>;
131
- version: Schema.optionalWith<typeof Schema.String, {
132
- as: "Option";
133
- }>;
134
- /** Reuses ServerInfo from extraction */
135
- servers: Schema.Array$<typeof Schema.Unknown>;
136
- operationCount: typeof Schema.Number;
137
- /** Lightweight operation list for the add-source UI */
138
- operations: Schema.Array$<typeof PreviewOperation>;
139
- tags: Schema.Array$<typeof Schema.String>;
140
- securitySchemes: Schema.Array$<typeof SecurityScheme>;
141
- /** Valid auth strategies (each is a set of schemes used together) */
142
- authStrategies: Schema.Array$<typeof AuthStrategy>;
143
- /** Pre-built header presets derived from auth strategies */
144
- headerPresets: Schema.Array$<typeof HeaderPreset>;
145
- }, Schema.Struct.Encoded<{
146
- title: Schema.optionalWith<typeof Schema.String, {
147
- as: "Option";
148
- }>;
149
- version: Schema.optionalWith<typeof Schema.String, {
150
- as: "Option";
151
- }>;
90
+ declare const SpecPreview_base: Schema.Class<SpecPreview, Schema.Struct<{
91
+ readonly title: Schema.OptionFromOptional<Schema.String>;
92
+ readonly version: Schema.OptionFromOptional<Schema.String>;
152
93
  /** Reuses ServerInfo from extraction */
153
- servers: Schema.Array$<typeof Schema.Unknown>;
154
- operationCount: typeof Schema.Number;
94
+ readonly servers: Schema.$Array<typeof ServerInfo>;
95
+ readonly operationCount: Schema.Number;
155
96
  /** Lightweight operation list for the add-source UI */
156
- operations: Schema.Array$<typeof PreviewOperation>;
157
- tags: Schema.Array$<typeof Schema.String>;
158
- securitySchemes: Schema.Array$<typeof SecurityScheme>;
97
+ readonly operations: Schema.$Array<typeof PreviewOperation>;
98
+ readonly tags: Schema.$Array<Schema.String>;
99
+ readonly securitySchemes: Schema.$Array<typeof SecurityScheme>;
159
100
  /** Valid auth strategies (each is a set of schemes used together) */
160
- authStrategies: Schema.Array$<typeof AuthStrategy>;
101
+ readonly authStrategies: Schema.$Array<typeof AuthStrategy>;
161
102
  /** Pre-built header presets derived from auth strategies */
162
- headerPresets: Schema.Array$<typeof HeaderPreset>;
163
- }>, never, {
164
- readonly title: Option.Option<string>;
165
- } & {
166
- readonly servers: readonly unknown[];
167
- } & {
168
- readonly tags: readonly string[];
169
- } & {
170
- readonly version: Option.Option<string>;
171
- } & {
172
- readonly securitySchemes: readonly SecurityScheme[];
173
- } & {
174
- readonly operations: readonly PreviewOperation[];
175
- } & {
176
- readonly operationCount: number;
177
- } & {
178
- readonly authStrategies: readonly AuthStrategy[];
179
- } & {
180
- readonly headerPresets: readonly HeaderPreset[];
181
- }, {}, {}>;
103
+ readonly headerPresets: Schema.$Array<typeof HeaderPreset>;
104
+ /** OAuth2 presets — one per (oauth2 scheme × supported flow) combination */
105
+ readonly oauth2Presets: Schema.$Array<typeof OAuth2Preset>;
106
+ }>, {}>;
182
107
  export declare class SpecPreview extends SpecPreview_base {
183
108
  }
184
109
  /** Preview an OpenAPI spec — extract metadata without registering anything.
185
- * Reuses parse() + extract() for the heavy lifting. */
186
- export declare const previewSpec: (specText: string) => Effect.Effect<SpecPreview, import("./errors").OpenApiParseError | import("./errors").OpenApiExtractionError, never>;
110
+ * Accepts either a URL or raw JSON/YAML text. */
111
+ export declare const previewSpec: (input: string) => Effect.Effect<SpecPreview, import("./errors").OpenApiParseError | import("./errors").OpenApiExtractionError, import("effect/unstable/http/HttpClient").HttpClient>;
187
112
  export {};
@@ -0,0 +1,201 @@
1
+ import { Effect, Schema } from "effect";
2
+ import { type StorageDeps, type StorageFailure } from "@executor-js/sdk/core";
3
+ import { ConfiguredHeaderValue, ConfiguredHeaderBinding, HeaderValue, OAuth2Auth, OAuth2SourceConfig, OpenApiSourceBindingInput, OpenApiSourceBindingRef, OperationBinding } from "./types";
4
+ export declare const openapiSchema: {
5
+ readonly openapi_source: {
6
+ readonly fields: {
7
+ readonly id: {
8
+ readonly type: "string";
9
+ readonly required: true;
10
+ };
11
+ readonly scope_id: {
12
+ readonly type: "string";
13
+ readonly required: true;
14
+ readonly index: true;
15
+ };
16
+ readonly name: {
17
+ readonly type: "string";
18
+ readonly required: true;
19
+ };
20
+ readonly spec: {
21
+ readonly type: "string";
22
+ readonly required: true;
23
+ };
24
+ readonly source_url: {
25
+ readonly type: "string";
26
+ readonly required: false;
27
+ };
28
+ readonly base_url: {
29
+ readonly type: "string";
30
+ readonly required: false;
31
+ };
32
+ readonly headers: {
33
+ readonly type: "json";
34
+ readonly required: false;
35
+ };
36
+ readonly query_params: {
37
+ readonly type: "json";
38
+ readonly required: false;
39
+ };
40
+ readonly oauth2: {
41
+ readonly type: "json";
42
+ readonly required: false;
43
+ };
44
+ readonly invocation_config: {
45
+ readonly type: "json";
46
+ readonly required: true;
47
+ };
48
+ };
49
+ };
50
+ readonly openapi_operation: {
51
+ readonly fields: {
52
+ readonly id: {
53
+ readonly type: "string";
54
+ readonly required: true;
55
+ };
56
+ readonly scope_id: {
57
+ readonly type: "string";
58
+ readonly required: true;
59
+ readonly index: true;
60
+ };
61
+ readonly source_id: {
62
+ readonly type: "string";
63
+ readonly required: true;
64
+ readonly index: true;
65
+ };
66
+ readonly binding: {
67
+ readonly type: "json";
68
+ readonly required: true;
69
+ };
70
+ };
71
+ };
72
+ readonly openapi_source_binding: {
73
+ readonly fields: {
74
+ readonly id: {
75
+ readonly type: "string";
76
+ readonly required: true;
77
+ };
78
+ readonly source_id: {
79
+ readonly type: "string";
80
+ readonly required: true;
81
+ readonly index: true;
82
+ };
83
+ readonly source_scope_id: {
84
+ readonly type: "string";
85
+ readonly required: true;
86
+ readonly index: true;
87
+ };
88
+ readonly target_scope_id: {
89
+ readonly type: "string";
90
+ readonly required: true;
91
+ readonly index: true;
92
+ };
93
+ readonly slot: {
94
+ readonly type: "string";
95
+ readonly required: true;
96
+ readonly index: true;
97
+ };
98
+ readonly value: {
99
+ readonly type: "json";
100
+ readonly required: true;
101
+ };
102
+ readonly created_at: {
103
+ readonly type: "date";
104
+ readonly required: true;
105
+ };
106
+ readonly updated_at: {
107
+ readonly type: "date";
108
+ readonly required: true;
109
+ };
110
+ };
111
+ };
112
+ };
113
+ export type OpenapiSchema = typeof openapiSchema;
114
+ export interface SourceConfig {
115
+ readonly spec: string;
116
+ /** Origin URL when the spec was fetched from http(s). Absent for
117
+ * raw-text adds. Persisted so `refreshSource` can re-fetch. */
118
+ readonly sourceUrl?: string;
119
+ readonly baseUrl?: string;
120
+ readonly namespace?: string;
121
+ readonly headers?: Record<string, ConfiguredHeaderValue>;
122
+ readonly queryParams?: Record<string, HeaderValue>;
123
+ readonly specFetchCredentials?: OpenApiSpecFetchCredentials;
124
+ readonly oauth2?: OAuth2SourceConfig;
125
+ }
126
+ export interface OpenApiSpecFetchCredentials {
127
+ readonly headers?: Record<string, HeaderValue>;
128
+ readonly queryParams?: Record<string, HeaderValue>;
129
+ }
130
+ export interface StoredSource {
131
+ readonly namespace: string;
132
+ /** Executor scope id this source row lives in. Writes stamp this on
133
+ * `scope_id`; reads return whichever scope's row the adapter's
134
+ * fall-through filter sees first. */
135
+ readonly scope: string;
136
+ readonly name: string;
137
+ readonly config: SourceConfig;
138
+ readonly legacy?: {
139
+ readonly headers?: Record<string, HeaderValue>;
140
+ readonly oauth2?: OAuth2Auth;
141
+ };
142
+ }
143
+ declare const StoredSourceSchema_base: Schema.Class<StoredSourceSchema, Schema.Struct<{
144
+ readonly namespace: Schema.String;
145
+ readonly name: Schema.String;
146
+ readonly config: Schema.Struct<{
147
+ readonly spec: Schema.String;
148
+ readonly sourceUrl: Schema.optional<Schema.String>;
149
+ readonly baseUrl: Schema.optional<Schema.String>;
150
+ readonly namespace: Schema.optional<Schema.String>;
151
+ 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
+ }>]>>>;
156
+ 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
+ }>]>>>;
165
+ }>>;
166
+ readonly oauth2: Schema.optional<typeof OAuth2SourceConfig>;
167
+ }>;
168
+ }>, {}>;
169
+ export declare class StoredSourceSchema extends StoredSourceSchema_base {
170
+ }
171
+ export type StoredSourceSchemaType = typeof StoredSourceSchema.Type;
172
+ export interface StoredOperation {
173
+ readonly toolId: string;
174
+ readonly sourceId: string;
175
+ readonly binding: OperationBinding;
176
+ }
177
+ export declare const headerBindingSlot: (headerName: string) => string;
178
+ export declare const oauth2ClientIdSlot: (securitySchemeName: string) => string;
179
+ export declare const oauth2ClientSecretSlot: (securitySchemeName: string) => string;
180
+ export declare const oauth2ConnectionSlot: (securitySchemeName: string) => string;
181
+ export interface OpenapiStore {
182
+ readonly upsertSource: (input: StoredSource, operations: readonly StoredOperation[]) => Effect.Effect<void, StorageFailure>;
183
+ readonly updateSourceMeta: (namespace: string, scope: string, patch: {
184
+ readonly name?: string;
185
+ readonly baseUrl?: string;
186
+ readonly headers?: Record<string, ConfiguredHeaderValue>;
187
+ readonly queryParams?: Record<string, HeaderValue>;
188
+ readonly oauth2?: OAuth2SourceConfig;
189
+ }) => Effect.Effect<void, StorageFailure>;
190
+ readonly getSource: (namespace: string, scope: string) => Effect.Effect<StoredSource | null, StorageFailure>;
191
+ readonly listSources: () => Effect.Effect<readonly StoredSource[], StorageFailure>;
192
+ readonly getOperationByToolId: (toolId: string, scope: string) => Effect.Effect<StoredOperation | null, StorageFailure>;
193
+ readonly listOperationsBySource: (sourceId: string, scope: string) => Effect.Effect<readonly StoredOperation[], StorageFailure>;
194
+ 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
+ }
200
+ export declare const makeDefaultOpenapiStore: ({ adapter, scopes, }: StorageDeps<OpenapiSchema>) => OpenapiStore;
201
+ export {};