@executor-js/plugin-openapi 0.2.1 → 1.4.21
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 → AddOpenApiSource-FLMNI742.js} +4 -4
- package/dist/{EditOpenApiSource-J7NXCVT5.js → EditOpenApiSource-I4NIGIIJ.js} +8 -8
- package/dist/EditOpenApiSource-I4NIGIIJ.js.map +1 -0
- package/dist/{OpenApiSourceSummary-K5WZD5NR.js → OpenApiSourceSummary-CM46DB4L.js} +3 -3
- package/dist/api/group.d.ts +146 -7
- package/dist/api/index.d.ts +257 -7
- package/dist/{chunk-2BXVRXGL.js → chunk-E7PZ2QGD.js} +70 -112
- package/dist/chunk-E7PZ2QGD.js.map +1 -0
- package/dist/{chunk-LBTK5F65.js → chunk-GFQUEZUW.js} +7 -7
- package/dist/chunk-GFQUEZUW.js.map +1 -0
- package/dist/{chunk-TRD7KSKA.js → chunk-OZ67JNID.js} +11 -8
- package/dist/chunk-OZ67JNID.js.map +1 -0
- package/dist/{chunk-E4QUTDQ2.js → chunk-TGDT6QCH.js} +11 -11
- package/dist/chunk-TGDT6QCH.js.map +1 -0
- package/dist/client.js +3 -3
- package/dist/core.js +2 -2
- package/dist/index.js +2 -2
- package/dist/react/atoms.d.ts +164 -4
- package/dist/react/client.d.ts +146 -4
- package/dist/sdk/extract.d.ts +54 -3
- package/dist/sdk/invoke.d.ts +48 -4
- package/dist/sdk/plugin.d.ts +112 -4
- package/dist/sdk/preview.d.ts +201 -49
- package/dist/sdk/store.d.ts +36 -11
- package/dist/sdk/types.d.ts +191 -99
- package/package.json +4 -4
- package/dist/EditOpenApiSource-J7NXCVT5.js.map +0 -1
- package/dist/chunk-2BXVRXGL.js.map +0 -1
- package/dist/chunk-E4QUTDQ2.js.map +0 -1
- package/dist/chunk-LBTK5F65.js.map +0 -1
- package/dist/chunk-TRD7KSKA.js.map +0 -1
- /package/dist/{AddOpenApiSource-EV3NJHLA.js.map → AddOpenApiSource-FLMNI742.js.map} +0 -0
- /package/dist/{OpenApiSourceSummary-K5WZD5NR.js.map → OpenApiSourceSummary-CM46DB4L.js.map} +0 -0
package/dist/sdk/plugin.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Effect } from "effect";
|
|
1
|
+
import { Effect, Option } from "effect";
|
|
2
2
|
import type { Layer } from "effect";
|
|
3
3
|
import { HttpClient } from "effect/unstable/http";
|
|
4
4
|
import { type StorageFailure } from "@executor-js/sdk/core";
|
|
@@ -79,7 +79,79 @@ export interface OpenApiPluginOptions {
|
|
|
79
79
|
readonly configFile?: ConfigFileSink;
|
|
80
80
|
}
|
|
81
81
|
export declare const openApiPlugin: import("@executor-js/sdk/core").ConfiguredPlugin<"openapi", {
|
|
82
|
-
previewSpec: (input: string | OpenApiPreviewInput) => Effect.Effect<
|
|
82
|
+
previewSpec: (input: string | OpenApiPreviewInput) => Effect.Effect<{
|
|
83
|
+
readonly title: Option.Option<string>;
|
|
84
|
+
readonly servers: readonly {
|
|
85
|
+
readonly url: string;
|
|
86
|
+
readonly description: Option.Option<string>;
|
|
87
|
+
readonly variables: Option.Option<{
|
|
88
|
+
readonly [x: string]: {
|
|
89
|
+
readonly description: Option.Option<string>;
|
|
90
|
+
readonly default: string;
|
|
91
|
+
readonly enum: Option.Option<readonly string[]>;
|
|
92
|
+
};
|
|
93
|
+
}>;
|
|
94
|
+
}[];
|
|
95
|
+
readonly tags: readonly string[];
|
|
96
|
+
readonly version: Option.Option<string>;
|
|
97
|
+
readonly securitySchemes: readonly {
|
|
98
|
+
readonly type: "oauth2" | "http" | "apiKey" | "openIdConnect";
|
|
99
|
+
readonly in: Option.Option<"query" | "header" | "cookie">;
|
|
100
|
+
readonly name: string;
|
|
101
|
+
readonly description: Option.Option<string>;
|
|
102
|
+
readonly scheme: Option.Option<string>;
|
|
103
|
+
readonly bearerFormat: Option.Option<string>;
|
|
104
|
+
readonly headerName: Option.Option<string>;
|
|
105
|
+
readonly flows: Option.Option<{
|
|
106
|
+
readonly authorizationCode: Option.Option<{
|
|
107
|
+
readonly scopes: {
|
|
108
|
+
readonly [x: string]: string;
|
|
109
|
+
};
|
|
110
|
+
readonly authorizationUrl: string;
|
|
111
|
+
readonly tokenUrl: string;
|
|
112
|
+
readonly refreshUrl: Option.Option<string>;
|
|
113
|
+
}>;
|
|
114
|
+
readonly clientCredentials: Option.Option<{
|
|
115
|
+
readonly scopes: {
|
|
116
|
+
readonly [x: string]: string;
|
|
117
|
+
};
|
|
118
|
+
readonly tokenUrl: string;
|
|
119
|
+
readonly refreshUrl: Option.Option<string>;
|
|
120
|
+
}>;
|
|
121
|
+
}>;
|
|
122
|
+
readonly openIdConnectUrl: Option.Option<string>;
|
|
123
|
+
}[];
|
|
124
|
+
readonly operations: readonly {
|
|
125
|
+
readonly method: "delete" | "options" | "get" | "put" | "post" | "head" | "patch" | "trace";
|
|
126
|
+
readonly tags: readonly string[];
|
|
127
|
+
readonly summary: Option.Option<string>;
|
|
128
|
+
readonly operationId: string;
|
|
129
|
+
readonly deprecated: boolean;
|
|
130
|
+
readonly path: string;
|
|
131
|
+
}[];
|
|
132
|
+
readonly authStrategies: readonly {
|
|
133
|
+
readonly schemes: readonly string[];
|
|
134
|
+
}[];
|
|
135
|
+
readonly headerPresets: readonly {
|
|
136
|
+
readonly headers: {
|
|
137
|
+
readonly [x: string]: string | null;
|
|
138
|
+
};
|
|
139
|
+
readonly secretHeaders: readonly string[];
|
|
140
|
+
readonly label: string;
|
|
141
|
+
}[];
|
|
142
|
+
readonly oauth2Presets: readonly {
|
|
143
|
+
readonly scopes: {
|
|
144
|
+
readonly [x: string]: string;
|
|
145
|
+
};
|
|
146
|
+
readonly authorizationUrl: Option.Option<string>;
|
|
147
|
+
readonly securitySchemeName: string;
|
|
148
|
+
readonly flow: "authorizationCode" | "clientCredentials";
|
|
149
|
+
readonly tokenUrl: string;
|
|
150
|
+
readonly refreshUrl: Option.Option<string>;
|
|
151
|
+
readonly label: string;
|
|
152
|
+
}[];
|
|
153
|
+
readonly operationCount: number;
|
|
154
|
+
}, StorageFailure | OpenApiParseError | OpenApiExtractionError | OpenApiOAuthError, never>;
|
|
83
155
|
addSpec: (config: OpenApiSpecConfig) => Effect.Effect<{
|
|
84
156
|
sourceId: string;
|
|
85
157
|
toolCount: number;
|
|
@@ -92,8 +164,44 @@ export declare const openApiPlugin: import("@executor-js/sdk/core").ConfiguredPl
|
|
|
92
164
|
name: string;
|
|
93
165
|
} | null, StorageFailure, never>;
|
|
94
166
|
updateSource: (namespace: string, scope: string, input: OpenApiUpdateSourceInput) => Effect.Effect<undefined, StorageFailure | OpenApiOAuthError, never>;
|
|
95
|
-
listSourceBindings: (sourceId: string, sourceScope: string) => Effect.Effect<readonly
|
|
96
|
-
|
|
167
|
+
listSourceBindings: (sourceId: string, sourceScope: string) => Effect.Effect<readonly {
|
|
168
|
+
readonly value: {
|
|
169
|
+
readonly secretId: string & import("effect/Brand").Brand<"SecretId">;
|
|
170
|
+
readonly kind: "secret";
|
|
171
|
+
readonly secretScopeId?: (string & import("effect/Brand").Brand<"ScopeId">) | undefined;
|
|
172
|
+
} | {
|
|
173
|
+
readonly connectionId: string & import("effect/Brand").Brand<"ConnectionId">;
|
|
174
|
+
readonly kind: "connection";
|
|
175
|
+
} | {
|
|
176
|
+
readonly text: string;
|
|
177
|
+
readonly kind: "text";
|
|
178
|
+
};
|
|
179
|
+
readonly createdAt: Date;
|
|
180
|
+
readonly sourceId: string;
|
|
181
|
+
readonly scopeId: string & import("effect/Brand").Brand<"ScopeId">;
|
|
182
|
+
readonly updatedAt: Date;
|
|
183
|
+
readonly slot: string;
|
|
184
|
+
readonly sourceScopeId: string & import("effect/Brand").Brand<"ScopeId">;
|
|
185
|
+
}[], StorageFailure, never>;
|
|
186
|
+
setSourceBinding: (input: OpenApiSourceBindingInput) => Effect.Effect<{
|
|
187
|
+
readonly value: {
|
|
188
|
+
readonly secretId: string & import("effect/Brand").Brand<"SecretId">;
|
|
189
|
+
readonly kind: "secret";
|
|
190
|
+
readonly secretScopeId?: (string & import("effect/Brand").Brand<"ScopeId">) | undefined;
|
|
191
|
+
} | {
|
|
192
|
+
readonly connectionId: string & import("effect/Brand").Brand<"ConnectionId">;
|
|
193
|
+
readonly kind: "connection";
|
|
194
|
+
} | {
|
|
195
|
+
readonly text: string;
|
|
196
|
+
readonly kind: "text";
|
|
197
|
+
};
|
|
198
|
+
readonly createdAt: Date;
|
|
199
|
+
readonly sourceId: string;
|
|
200
|
+
readonly scopeId: string & import("effect/Brand").Brand<"ScopeId">;
|
|
201
|
+
readonly updatedAt: Date;
|
|
202
|
+
readonly slot: string;
|
|
203
|
+
readonly sourceScopeId: string & import("effect/Brand").Brand<"ScopeId">;
|
|
204
|
+
}, StorageFailure, never>;
|
|
97
205
|
removeSourceBinding: (sourceId: string, sourceScope: string, slot: string, scope: string) => Effect.Effect<void, StorageFailure, never>;
|
|
98
206
|
}, OpenapiStore, OpenApiPluginOptions, {
|
|
99
207
|
readonly openapi_source: {
|
package/dist/sdk/preview.d.ts
CHANGED
|
@@ -1,28 +1,33 @@
|
|
|
1
|
-
import { Effect } from "effect";
|
|
1
|
+
import { Effect, Option } from "effect";
|
|
2
2
|
import { Schema } from "effect";
|
|
3
|
-
|
|
4
|
-
declare const OAuth2AuthorizationCodeFlow_base: Schema.Class<OAuth2AuthorizationCodeFlow, Schema.Struct<{
|
|
3
|
+
export declare const OAuth2AuthorizationCodeFlow: Schema.Struct<{
|
|
5
4
|
readonly authorizationUrl: Schema.String;
|
|
6
5
|
readonly tokenUrl: Schema.String;
|
|
7
6
|
readonly refreshUrl: Schema.OptionFromOptional<Schema.String>;
|
|
8
7
|
readonly scopes: Schema.$Record<Schema.String, Schema.String>;
|
|
9
|
-
}
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
declare const OAuth2ClientCredentialsFlow_base: Schema.Class<OAuth2ClientCredentialsFlow, Schema.Struct<{
|
|
8
|
+
}>;
|
|
9
|
+
export type OAuth2AuthorizationCodeFlow = typeof OAuth2AuthorizationCodeFlow.Type;
|
|
10
|
+
export declare const OAuth2ClientCredentialsFlow: Schema.Struct<{
|
|
13
11
|
readonly tokenUrl: Schema.String;
|
|
14
12
|
readonly refreshUrl: Schema.OptionFromOptional<Schema.String>;
|
|
15
13
|
readonly scopes: Schema.$Record<Schema.String, Schema.String>;
|
|
16
|
-
}
|
|
17
|
-
export
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
14
|
+
}>;
|
|
15
|
+
export type OAuth2ClientCredentialsFlow = typeof OAuth2ClientCredentialsFlow.Type;
|
|
16
|
+
export declare const OAuth2Flows: Schema.Struct<{
|
|
17
|
+
readonly authorizationCode: Schema.OptionFromOptional<Schema.Struct<{
|
|
18
|
+
readonly authorizationUrl: Schema.String;
|
|
19
|
+
readonly tokenUrl: Schema.String;
|
|
20
|
+
readonly refreshUrl: Schema.OptionFromOptional<Schema.String>;
|
|
21
|
+
readonly scopes: Schema.$Record<Schema.String, Schema.String>;
|
|
22
|
+
}>>;
|
|
23
|
+
readonly clientCredentials: Schema.OptionFromOptional<Schema.Struct<{
|
|
24
|
+
readonly tokenUrl: Schema.String;
|
|
25
|
+
readonly refreshUrl: Schema.OptionFromOptional<Schema.String>;
|
|
26
|
+
readonly scopes: Schema.$Record<Schema.String, Schema.String>;
|
|
27
|
+
}>>;
|
|
28
|
+
}>;
|
|
29
|
+
export type OAuth2Flows = typeof OAuth2Flows.Type;
|
|
30
|
+
export declare const SecurityScheme: Schema.Struct<{
|
|
26
31
|
/** Key name in components.securitySchemes (e.g. "api_token") */
|
|
27
32
|
readonly name: Schema.String;
|
|
28
33
|
/** OpenAPI security scheme type */
|
|
@@ -37,29 +42,38 @@ declare const SecurityScheme_base: Schema.Class<SecurityScheme, Schema.Struct<{
|
|
|
37
42
|
readonly headerName: Schema.OptionFromOptional<Schema.String>;
|
|
38
43
|
readonly description: Schema.OptionFromOptional<Schema.String>;
|
|
39
44
|
/** For type: "oauth2" — declared flows (authorizationCode / clientCredentials only; implicit and password are deprecated). */
|
|
40
|
-
readonly flows: Schema.OptionFromOptional<
|
|
45
|
+
readonly flows: Schema.OptionFromOptional<Schema.Struct<{
|
|
46
|
+
readonly authorizationCode: Schema.OptionFromOptional<Schema.Struct<{
|
|
47
|
+
readonly authorizationUrl: Schema.String;
|
|
48
|
+
readonly tokenUrl: Schema.String;
|
|
49
|
+
readonly refreshUrl: Schema.OptionFromOptional<Schema.String>;
|
|
50
|
+
readonly scopes: Schema.$Record<Schema.String, Schema.String>;
|
|
51
|
+
}>>;
|
|
52
|
+
readonly clientCredentials: Schema.OptionFromOptional<Schema.Struct<{
|
|
53
|
+
readonly tokenUrl: Schema.String;
|
|
54
|
+
readonly refreshUrl: Schema.OptionFromOptional<Schema.String>;
|
|
55
|
+
readonly scopes: Schema.$Record<Schema.String, Schema.String>;
|
|
56
|
+
}>>;
|
|
57
|
+
}>>;
|
|
41
58
|
/** For type: "openIdConnect" — the discovery URL. */
|
|
42
59
|
readonly openIdConnectUrl: Schema.OptionFromOptional<Schema.String>;
|
|
43
|
-
}
|
|
44
|
-
export
|
|
45
|
-
|
|
46
|
-
declare const AuthStrategy_base: Schema.Class<AuthStrategy, Schema.Struct<{
|
|
60
|
+
}>;
|
|
61
|
+
export type SecurityScheme = typeof SecurityScheme.Type;
|
|
62
|
+
export declare const AuthStrategy: Schema.Struct<{
|
|
47
63
|
/** The security schemes required together for this strategy */
|
|
48
64
|
readonly schemes: Schema.$Array<Schema.String>;
|
|
49
|
-
}
|
|
50
|
-
export
|
|
51
|
-
|
|
52
|
-
declare const HeaderPreset_base: Schema.Class<HeaderPreset, Schema.Struct<{
|
|
65
|
+
}>;
|
|
66
|
+
export type AuthStrategy = typeof AuthStrategy.Type;
|
|
67
|
+
export declare const HeaderPreset: Schema.Struct<{
|
|
53
68
|
/** Human-readable label for the UI (e.g. "Bearer Token", "API Key + Email") */
|
|
54
69
|
readonly label: Schema.String;
|
|
55
70
|
/** Headers this strategy needs. Value is null when the user must provide it. */
|
|
56
71
|
readonly headers: Schema.$Record<Schema.String, Schema.NullOr<Schema.String>>;
|
|
57
72
|
/** Which headers should be stored as secrets */
|
|
58
73
|
readonly secretHeaders: Schema.$Array<Schema.String>;
|
|
59
|
-
}
|
|
60
|
-
export
|
|
61
|
-
|
|
62
|
-
declare const OAuth2Preset_base: Schema.Class<OAuth2Preset, Schema.Struct<{
|
|
74
|
+
}>;
|
|
75
|
+
export type HeaderPreset = typeof HeaderPreset.Type;
|
|
76
|
+
export declare const OAuth2Preset: Schema.Struct<{
|
|
63
77
|
/** Human-readable label for the UI (e.g. "OAuth2 (Authorization Code) — oauth_app") */
|
|
64
78
|
readonly label: Schema.String;
|
|
65
79
|
/** The source security scheme this preset came from (components.securitySchemes key). */
|
|
@@ -74,39 +88,177 @@ declare const OAuth2Preset_base: Schema.Class<OAuth2Preset, Schema.Struct<{
|
|
|
74
88
|
readonly refreshUrl: Schema.OptionFromOptional<Schema.String>;
|
|
75
89
|
/** Declared scopes for this flow: `{ scope: description }`. */
|
|
76
90
|
readonly scopes: Schema.$Record<Schema.String, Schema.String>;
|
|
77
|
-
}
|
|
78
|
-
export
|
|
79
|
-
|
|
80
|
-
declare const PreviewOperation_base: Schema.Class<PreviewOperation, Schema.Struct<{
|
|
91
|
+
}>;
|
|
92
|
+
export type OAuth2Preset = typeof OAuth2Preset.Type;
|
|
93
|
+
export declare const PreviewOperation: Schema.Struct<{
|
|
81
94
|
readonly operationId: Schema.String;
|
|
82
95
|
readonly method: Schema.Literals<readonly ["get", "put", "post", "delete", "patch", "head", "options", "trace"]>;
|
|
83
96
|
readonly path: Schema.String;
|
|
84
97
|
readonly summary: Schema.OptionFromOptional<Schema.String>;
|
|
85
98
|
readonly tags: Schema.$Array<Schema.String>;
|
|
86
99
|
readonly deprecated: Schema.Boolean;
|
|
87
|
-
}
|
|
88
|
-
export
|
|
89
|
-
|
|
90
|
-
declare const SpecPreview_base: Schema.Class<SpecPreview, Schema.Struct<{
|
|
100
|
+
}>;
|
|
101
|
+
export type PreviewOperation = typeof PreviewOperation.Type;
|
|
102
|
+
export declare const SpecPreview: Schema.Struct<{
|
|
91
103
|
readonly title: Schema.OptionFromOptional<Schema.String>;
|
|
92
104
|
readonly version: Schema.OptionFromOptional<Schema.String>;
|
|
93
105
|
/** Reuses ServerInfo from extraction */
|
|
94
|
-
readonly servers: Schema.$Array<
|
|
106
|
+
readonly servers: Schema.$Array<Schema.Struct<{
|
|
107
|
+
readonly url: Schema.String;
|
|
108
|
+
readonly description: Schema.OptionFromOptional<Schema.String>;
|
|
109
|
+
readonly variables: Schema.OptionFromOptional<Schema.$Record<Schema.String, Schema.Struct<{
|
|
110
|
+
readonly default: Schema.String;
|
|
111
|
+
readonly enum: Schema.OptionFromOptional<Schema.$Array<Schema.String>>;
|
|
112
|
+
readonly description: Schema.OptionFromOptional<Schema.String>;
|
|
113
|
+
}>>>;
|
|
114
|
+
}>>;
|
|
95
115
|
readonly operationCount: Schema.Number;
|
|
96
116
|
/** Lightweight operation list for the add-source UI */
|
|
97
|
-
readonly operations: Schema.$Array<
|
|
117
|
+
readonly operations: Schema.$Array<Schema.Struct<{
|
|
118
|
+
readonly operationId: Schema.String;
|
|
119
|
+
readonly method: Schema.Literals<readonly ["get", "put", "post", "delete", "patch", "head", "options", "trace"]>;
|
|
120
|
+
readonly path: Schema.String;
|
|
121
|
+
readonly summary: Schema.OptionFromOptional<Schema.String>;
|
|
122
|
+
readonly tags: Schema.$Array<Schema.String>;
|
|
123
|
+
readonly deprecated: Schema.Boolean;
|
|
124
|
+
}>>;
|
|
98
125
|
readonly tags: Schema.$Array<Schema.String>;
|
|
99
|
-
readonly securitySchemes: Schema.$Array<
|
|
126
|
+
readonly securitySchemes: Schema.$Array<Schema.Struct<{
|
|
127
|
+
/** Key name in components.securitySchemes (e.g. "api_token") */
|
|
128
|
+
readonly name: Schema.String;
|
|
129
|
+
/** OpenAPI security scheme type */
|
|
130
|
+
readonly type: Schema.Literals<readonly ["http", "apiKey", "oauth2", "openIdConnect"]>;
|
|
131
|
+
/** For type: "http" — e.g. "bearer", "basic" */
|
|
132
|
+
readonly scheme: Schema.OptionFromOptional<Schema.String>;
|
|
133
|
+
/** For type: "http" with scheme "bearer" — e.g. "JWT" */
|
|
134
|
+
readonly bearerFormat: Schema.OptionFromOptional<Schema.String>;
|
|
135
|
+
/** For type: "apiKey" — where the key goes */
|
|
136
|
+
readonly in: Schema.OptionFromOptional<Schema.Literals<readonly ["header", "query", "cookie"]>>;
|
|
137
|
+
/** For type: "apiKey" — the header/query/cookie name */
|
|
138
|
+
readonly headerName: Schema.OptionFromOptional<Schema.String>;
|
|
139
|
+
readonly description: Schema.OptionFromOptional<Schema.String>;
|
|
140
|
+
/** For type: "oauth2" — declared flows (authorizationCode / clientCredentials only; implicit and password are deprecated). */
|
|
141
|
+
readonly flows: Schema.OptionFromOptional<Schema.Struct<{
|
|
142
|
+
readonly authorizationCode: Schema.OptionFromOptional<Schema.Struct<{
|
|
143
|
+
readonly authorizationUrl: Schema.String;
|
|
144
|
+
readonly tokenUrl: Schema.String;
|
|
145
|
+
readonly refreshUrl: Schema.OptionFromOptional<Schema.String>;
|
|
146
|
+
readonly scopes: Schema.$Record<Schema.String, Schema.String>;
|
|
147
|
+
}>>;
|
|
148
|
+
readonly clientCredentials: Schema.OptionFromOptional<Schema.Struct<{
|
|
149
|
+
readonly tokenUrl: Schema.String;
|
|
150
|
+
readonly refreshUrl: Schema.OptionFromOptional<Schema.String>;
|
|
151
|
+
readonly scopes: Schema.$Record<Schema.String, Schema.String>;
|
|
152
|
+
}>>;
|
|
153
|
+
}>>;
|
|
154
|
+
/** For type: "openIdConnect" — the discovery URL. */
|
|
155
|
+
readonly openIdConnectUrl: Schema.OptionFromOptional<Schema.String>;
|
|
156
|
+
}>>;
|
|
100
157
|
/** Valid auth strategies (each is a set of schemes used together) */
|
|
101
|
-
readonly authStrategies: Schema.$Array<
|
|
158
|
+
readonly authStrategies: Schema.$Array<Schema.Struct<{
|
|
159
|
+
/** The security schemes required together for this strategy */
|
|
160
|
+
readonly schemes: Schema.$Array<Schema.String>;
|
|
161
|
+
}>>;
|
|
102
162
|
/** Pre-built header presets derived from auth strategies */
|
|
103
|
-
readonly headerPresets: Schema.$Array<
|
|
163
|
+
readonly headerPresets: Schema.$Array<Schema.Struct<{
|
|
164
|
+
/** Human-readable label for the UI (e.g. "Bearer Token", "API Key + Email") */
|
|
165
|
+
readonly label: Schema.String;
|
|
166
|
+
/** Headers this strategy needs. Value is null when the user must provide it. */
|
|
167
|
+
readonly headers: Schema.$Record<Schema.String, Schema.NullOr<Schema.String>>;
|
|
168
|
+
/** Which headers should be stored as secrets */
|
|
169
|
+
readonly secretHeaders: Schema.$Array<Schema.String>;
|
|
170
|
+
}>>;
|
|
104
171
|
/** OAuth2 presets — one per (oauth2 scheme × supported flow) combination */
|
|
105
|
-
readonly oauth2Presets: Schema.$Array<
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
172
|
+
readonly oauth2Presets: Schema.$Array<Schema.Struct<{
|
|
173
|
+
/** Human-readable label for the UI (e.g. "OAuth2 (Authorization Code) — oauth_app") */
|
|
174
|
+
readonly label: Schema.String;
|
|
175
|
+
/** The source security scheme this preset came from (components.securitySchemes key). */
|
|
176
|
+
readonly securitySchemeName: Schema.String;
|
|
177
|
+
/** Which OAuth2 flow this preset uses. */
|
|
178
|
+
readonly flow: Schema.Literals<readonly ["authorizationCode", "clientCredentials"]>;
|
|
179
|
+
/** For authorizationCode: user-agent redirect URL (from the spec). */
|
|
180
|
+
readonly authorizationUrl: Schema.OptionFromOptional<Schema.String>;
|
|
181
|
+
/** Token endpoint to exchange the code / refresh. */
|
|
182
|
+
readonly tokenUrl: Schema.String;
|
|
183
|
+
/** Optional refresh endpoint if the spec declares one separately. */
|
|
184
|
+
readonly refreshUrl: Schema.OptionFromOptional<Schema.String>;
|
|
185
|
+
/** Declared scopes for this flow: `{ scope: description }`. */
|
|
186
|
+
readonly scopes: Schema.$Record<Schema.String, Schema.String>;
|
|
187
|
+
}>>;
|
|
188
|
+
}>;
|
|
189
|
+
export type SpecPreview = typeof SpecPreview.Type;
|
|
109
190
|
/** Preview an OpenAPI spec — extract metadata without registering anything.
|
|
110
191
|
* Accepts either a URL or raw JSON/YAML text. */
|
|
111
|
-
export declare const previewSpec: (input: string) => Effect.Effect<
|
|
112
|
-
|
|
192
|
+
export declare const previewSpec: (input: string) => Effect.Effect<{
|
|
193
|
+
readonly title: Option.Option<string>;
|
|
194
|
+
readonly servers: readonly {
|
|
195
|
+
readonly url: string;
|
|
196
|
+
readonly description: Option.Option<string>;
|
|
197
|
+
readonly variables: Option.Option<{
|
|
198
|
+
readonly [x: string]: {
|
|
199
|
+
readonly description: Option.Option<string>;
|
|
200
|
+
readonly default: string;
|
|
201
|
+
readonly enum: Option.Option<readonly string[]>;
|
|
202
|
+
};
|
|
203
|
+
}>;
|
|
204
|
+
}[];
|
|
205
|
+
readonly tags: readonly string[];
|
|
206
|
+
readonly version: Option.Option<string>;
|
|
207
|
+
readonly securitySchemes: readonly {
|
|
208
|
+
readonly type: "oauth2" | "http" | "apiKey" | "openIdConnect";
|
|
209
|
+
readonly in: Option.Option<"query" | "header" | "cookie">;
|
|
210
|
+
readonly name: string;
|
|
211
|
+
readonly description: Option.Option<string>;
|
|
212
|
+
readonly scheme: Option.Option<string>;
|
|
213
|
+
readonly bearerFormat: Option.Option<string>;
|
|
214
|
+
readonly headerName: Option.Option<string>;
|
|
215
|
+
readonly flows: Option.Option<{
|
|
216
|
+
readonly authorizationCode: Option.Option<{
|
|
217
|
+
readonly scopes: {
|
|
218
|
+
readonly [x: string]: string;
|
|
219
|
+
};
|
|
220
|
+
readonly authorizationUrl: string;
|
|
221
|
+
readonly tokenUrl: string;
|
|
222
|
+
readonly refreshUrl: Option.Option<string>;
|
|
223
|
+
}>;
|
|
224
|
+
readonly clientCredentials: Option.Option<{
|
|
225
|
+
readonly scopes: {
|
|
226
|
+
readonly [x: string]: string;
|
|
227
|
+
};
|
|
228
|
+
readonly tokenUrl: string;
|
|
229
|
+
readonly refreshUrl: Option.Option<string>;
|
|
230
|
+
}>;
|
|
231
|
+
}>;
|
|
232
|
+
readonly openIdConnectUrl: Option.Option<string>;
|
|
233
|
+
}[];
|
|
234
|
+
readonly operations: readonly {
|
|
235
|
+
readonly method: "delete" | "options" | "get" | "put" | "post" | "head" | "patch" | "trace";
|
|
236
|
+
readonly tags: readonly string[];
|
|
237
|
+
readonly summary: Option.Option<string>;
|
|
238
|
+
readonly operationId: string;
|
|
239
|
+
readonly deprecated: boolean;
|
|
240
|
+
readonly path: string;
|
|
241
|
+
}[];
|
|
242
|
+
readonly authStrategies: readonly {
|
|
243
|
+
readonly schemes: readonly string[];
|
|
244
|
+
}[];
|
|
245
|
+
readonly headerPresets: readonly {
|
|
246
|
+
readonly headers: {
|
|
247
|
+
readonly [x: string]: string | null;
|
|
248
|
+
};
|
|
249
|
+
readonly secretHeaders: readonly string[];
|
|
250
|
+
readonly label: string;
|
|
251
|
+
}[];
|
|
252
|
+
readonly oauth2Presets: readonly {
|
|
253
|
+
readonly scopes: {
|
|
254
|
+
readonly [x: string]: string;
|
|
255
|
+
};
|
|
256
|
+
readonly authorizationUrl: Option.Option<string>;
|
|
257
|
+
readonly securitySchemeName: string;
|
|
258
|
+
readonly flow: "authorizationCode" | "clientCredentials";
|
|
259
|
+
readonly tokenUrl: string;
|
|
260
|
+
readonly refreshUrl: Option.Option<string>;
|
|
261
|
+
readonly label: string;
|
|
262
|
+
}[];
|
|
263
|
+
readonly operationCount: number;
|
|
264
|
+
}, import("./errors").OpenApiParseError | import("./errors").OpenApiExtractionError, import("effect/unstable/http/HttpClient").HttpClient>;
|
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,
|
|
3
|
+
import { ConfiguredHeaderValue, OAuth2SourceConfig, OperationBinding } from "./types";
|
|
4
4
|
export declare const openapiSchema: {
|
|
5
5
|
readonly openapi_source: {
|
|
6
6
|
readonly fields: {
|
|
@@ -236,7 +236,7 @@ export interface StoredSource {
|
|
|
236
236
|
readonly name: string;
|
|
237
237
|
readonly config: SourceConfig;
|
|
238
238
|
}
|
|
239
|
-
declare const
|
|
239
|
+
export declare const StoredSourceSchema: Schema.Struct<{
|
|
240
240
|
readonly namespace: Schema.String;
|
|
241
241
|
readonly scope: Schema.String;
|
|
242
242
|
readonly name: Schema.String;
|
|
@@ -245,17 +245,43 @@ declare const StoredSourceSchema_base: Schema.Class<StoredSourceSchema, Schema.S
|
|
|
245
245
|
readonly sourceUrl: Schema.optional<Schema.String>;
|
|
246
246
|
readonly baseUrl: Schema.optional<Schema.String>;
|
|
247
247
|
readonly namespace: Schema.optional<Schema.String>;
|
|
248
|
-
readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String,
|
|
249
|
-
|
|
248
|
+
readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
249
|
+
readonly kind: Schema.Literal<"binding">;
|
|
250
|
+
readonly slot: Schema.String;
|
|
251
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
252
|
+
}>]>>>;
|
|
253
|
+
readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
254
|
+
readonly kind: Schema.Literal<"binding">;
|
|
255
|
+
readonly slot: Schema.String;
|
|
256
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
257
|
+
}>]>>>;
|
|
250
258
|
readonly specFetchCredentials: Schema.optional<Schema.Struct<{
|
|
251
|
-
readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String,
|
|
252
|
-
|
|
259
|
+
readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
260
|
+
readonly kind: Schema.Literal<"binding">;
|
|
261
|
+
readonly slot: Schema.String;
|
|
262
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
263
|
+
}>]>>>;
|
|
264
|
+
readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
265
|
+
readonly kind: Schema.Literal<"binding">;
|
|
266
|
+
readonly slot: Schema.String;
|
|
267
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
268
|
+
}>]>>>;
|
|
269
|
+
}>>;
|
|
270
|
+
readonly oauth2: Schema.optional<Schema.Struct<{
|
|
271
|
+
readonly kind: Schema.Literal<"oauth2">;
|
|
272
|
+
readonly securitySchemeName: Schema.String;
|
|
273
|
+
readonly flow: Schema.Literals<readonly ["authorizationCode", "clientCredentials"]>;
|
|
274
|
+
readonly tokenUrl: Schema.String;
|
|
275
|
+
readonly authorizationUrl: Schema.NullOr<Schema.String>;
|
|
276
|
+
readonly issuerUrl: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
277
|
+
readonly clientIdSlot: Schema.String;
|
|
278
|
+
readonly clientSecretSlot: Schema.NullOr<Schema.String>;
|
|
279
|
+
readonly connectionSlot: Schema.String;
|
|
280
|
+
readonly scopes: Schema.$Array<Schema.String>;
|
|
253
281
|
}>>;
|
|
254
|
-
readonly oauth2: Schema.optional<typeof OAuth2SourceConfig>;
|
|
255
282
|
}>;
|
|
256
|
-
}
|
|
257
|
-
export
|
|
258
|
-
}
|
|
283
|
+
}>;
|
|
284
|
+
export type StoredSourceSchema = typeof StoredSourceSchema.Type;
|
|
259
285
|
export type StoredSourceSchemaType = typeof StoredSourceSchema.Type;
|
|
260
286
|
export interface StoredOperation {
|
|
261
287
|
readonly toolId: string;
|
|
@@ -283,4 +309,3 @@ export interface OpenapiStore {
|
|
|
283
309
|
readonly removeSource: (namespace: string, scope: string) => Effect.Effect<void, StorageFailure>;
|
|
284
310
|
}
|
|
285
311
|
export declare const makeDefaultOpenapiStore: ({ adapter }: StorageDeps<OpenapiSchema>) => OpenapiStore;
|
|
286
|
-
export {};
|