@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/types.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare const HttpMethod: Schema.Literals<readonly ["get", "put", "post",
|
|
|
5
5
|
export type HttpMethod = typeof HttpMethod.Type;
|
|
6
6
|
export declare const ParameterLocation: Schema.Literals<readonly ["path", "query", "header", "cookie"]>;
|
|
7
7
|
export type ParameterLocation = typeof ParameterLocation.Type;
|
|
8
|
-
declare const
|
|
8
|
+
export declare const OperationParameter: Schema.Struct<{
|
|
9
9
|
readonly name: Schema.String;
|
|
10
10
|
readonly location: Schema.Literals<readonly ["path", "query", "header", "cookie"]>;
|
|
11
11
|
readonly required: Schema.Boolean;
|
|
@@ -14,15 +14,8 @@ declare const OperationParameter_base: Schema.Class<OperationParameter, Schema.S
|
|
|
14
14
|
readonly explode: Schema.OptionFromOptional<Schema.Boolean>;
|
|
15
15
|
readonly allowReserved: Schema.OptionFromOptional<Schema.Boolean>;
|
|
16
16
|
readonly description: Schema.OptionFromOptional<Schema.String>;
|
|
17
|
-
}
|
|
18
|
-
export
|
|
19
|
-
}
|
|
20
|
-
declare const EncodingObject_base: Schema.Class<EncodingObject, Schema.Struct<{
|
|
21
|
-
readonly contentType: Schema.OptionFromOptional<Schema.String>;
|
|
22
|
-
readonly style: Schema.OptionFromOptional<Schema.String>;
|
|
23
|
-
readonly explode: Schema.OptionFromOptional<Schema.Boolean>;
|
|
24
|
-
readonly allowReserved: Schema.OptionFromOptional<Schema.Boolean>;
|
|
25
|
-
}>, {}>;
|
|
17
|
+
}>;
|
|
18
|
+
export type OperationParameter = typeof OperationParameter.Type;
|
|
26
19
|
/**
|
|
27
20
|
* OpenAPI 3.x `Encoding Object` (§4.8.15). Declared per-property inside a
|
|
28
21
|
* multipart/form-data or application/x-www-form-urlencoded request body.
|
|
@@ -32,16 +25,25 @@ declare const EncodingObject_base: Schema.Class<EncodingObject, Schema.Struct<{
|
|
|
32
25
|
* - `style` / `explode` / `allowReserved` — for form-urlencoded, control
|
|
33
26
|
* array / object serialization the same way parameter-level style does.
|
|
34
27
|
*/
|
|
35
|
-
export declare
|
|
36
|
-
|
|
37
|
-
|
|
28
|
+
export declare const EncodingObject: Schema.Struct<{
|
|
29
|
+
readonly contentType: Schema.OptionFromOptional<Schema.String>;
|
|
30
|
+
readonly style: Schema.OptionFromOptional<Schema.String>;
|
|
31
|
+
readonly explode: Schema.OptionFromOptional<Schema.Boolean>;
|
|
32
|
+
readonly allowReserved: Schema.OptionFromOptional<Schema.Boolean>;
|
|
33
|
+
}>;
|
|
34
|
+
export type EncodingObject = typeof EncodingObject.Type;
|
|
35
|
+
export declare const MediaBinding: Schema.Struct<{
|
|
38
36
|
readonly contentType: Schema.String;
|
|
39
37
|
readonly schema: Schema.OptionFromOptional<Schema.Unknown>;
|
|
40
|
-
readonly encoding: Schema.OptionFromOptional<Schema.$Record<Schema.String,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
38
|
+
readonly encoding: Schema.OptionFromOptional<Schema.$Record<Schema.String, Schema.Struct<{
|
|
39
|
+
readonly contentType: Schema.OptionFromOptional<Schema.String>;
|
|
40
|
+
readonly style: Schema.OptionFromOptional<Schema.String>;
|
|
41
|
+
readonly explode: Schema.OptionFromOptional<Schema.Boolean>;
|
|
42
|
+
readonly allowReserved: Schema.OptionFromOptional<Schema.Boolean>;
|
|
43
|
+
}>>>;
|
|
44
|
+
}>;
|
|
45
|
+
export type MediaBinding = typeof MediaBinding.Type;
|
|
46
|
+
export declare const OperationRequestBody: Schema.Struct<{
|
|
45
47
|
readonly required: Schema.Boolean;
|
|
46
48
|
/** Default media type — first declared in spec order (not JSON-first).
|
|
47
49
|
* Used when the caller does not override via the tool's `contentType` arg. */
|
|
@@ -52,55 +54,172 @@ declare const OperationRequestBody_base: Schema.Class<OperationRequestBody, Sche
|
|
|
52
54
|
/** All declared media types in spec order. Populated by `extract.ts`
|
|
53
55
|
* going forward; older persisted bindings may have this unset and will
|
|
54
56
|
* fall back to `{contentType, schema}`. */
|
|
55
|
-
readonly contents: Schema.OptionFromOptional<Schema.$Array<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
57
|
+
readonly contents: Schema.OptionFromOptional<Schema.$Array<Schema.Struct<{
|
|
58
|
+
readonly contentType: Schema.String;
|
|
59
|
+
readonly schema: Schema.OptionFromOptional<Schema.Unknown>;
|
|
60
|
+
readonly encoding: Schema.OptionFromOptional<Schema.$Record<Schema.String, Schema.Struct<{
|
|
61
|
+
readonly contentType: Schema.OptionFromOptional<Schema.String>;
|
|
62
|
+
readonly style: Schema.OptionFromOptional<Schema.String>;
|
|
63
|
+
readonly explode: Schema.OptionFromOptional<Schema.Boolean>;
|
|
64
|
+
readonly allowReserved: Schema.OptionFromOptional<Schema.Boolean>;
|
|
65
|
+
}>>>;
|
|
66
|
+
}>>>;
|
|
67
|
+
}>;
|
|
68
|
+
export type OperationRequestBody = typeof OperationRequestBody.Type;
|
|
69
|
+
export declare const ExtractedOperation: Schema.Struct<{
|
|
60
70
|
readonly operationId: Schema.brand<Schema.String, "OperationId">;
|
|
61
71
|
readonly method: Schema.Literals<readonly ["get", "put", "post", "delete", "patch", "head", "options", "trace"]>;
|
|
62
72
|
readonly pathTemplate: Schema.String;
|
|
63
73
|
readonly summary: Schema.OptionFromOptional<Schema.String>;
|
|
64
74
|
readonly description: Schema.OptionFromOptional<Schema.String>;
|
|
65
75
|
readonly tags: Schema.$Array<Schema.String>;
|
|
66
|
-
readonly parameters: Schema.$Array<
|
|
67
|
-
|
|
76
|
+
readonly parameters: Schema.$Array<Schema.Struct<{
|
|
77
|
+
readonly name: Schema.String;
|
|
78
|
+
readonly location: Schema.Literals<readonly ["path", "query", "header", "cookie"]>;
|
|
79
|
+
readonly required: Schema.Boolean;
|
|
80
|
+
readonly schema: Schema.OptionFromOptional<Schema.Unknown>;
|
|
81
|
+
readonly style: Schema.OptionFromOptional<Schema.String>;
|
|
82
|
+
readonly explode: Schema.OptionFromOptional<Schema.Boolean>;
|
|
83
|
+
readonly allowReserved: Schema.OptionFromOptional<Schema.Boolean>;
|
|
84
|
+
readonly description: Schema.OptionFromOptional<Schema.String>;
|
|
85
|
+
}>>;
|
|
86
|
+
readonly requestBody: Schema.OptionFromOptional<Schema.Struct<{
|
|
87
|
+
readonly required: Schema.Boolean;
|
|
88
|
+
/** Default media type — first declared in spec order (not JSON-first).
|
|
89
|
+
* Used when the caller does not override via the tool's `contentType` arg. */
|
|
90
|
+
readonly contentType: Schema.String;
|
|
91
|
+
/** Schema of the default media type. Kept for backward compat with stored
|
|
92
|
+
* bindings from before `contents` was added. */
|
|
93
|
+
readonly schema: Schema.OptionFromOptional<Schema.Unknown>;
|
|
94
|
+
/** All declared media types in spec order. Populated by `extract.ts`
|
|
95
|
+
* going forward; older persisted bindings may have this unset and will
|
|
96
|
+
* fall back to `{contentType, schema}`. */
|
|
97
|
+
readonly contents: Schema.OptionFromOptional<Schema.$Array<Schema.Struct<{
|
|
98
|
+
readonly contentType: Schema.String;
|
|
99
|
+
readonly schema: Schema.OptionFromOptional<Schema.Unknown>;
|
|
100
|
+
readonly encoding: Schema.OptionFromOptional<Schema.$Record<Schema.String, Schema.Struct<{
|
|
101
|
+
readonly contentType: Schema.OptionFromOptional<Schema.String>;
|
|
102
|
+
readonly style: Schema.OptionFromOptional<Schema.String>;
|
|
103
|
+
readonly explode: Schema.OptionFromOptional<Schema.Boolean>;
|
|
104
|
+
readonly allowReserved: Schema.OptionFromOptional<Schema.Boolean>;
|
|
105
|
+
}>>>;
|
|
106
|
+
}>>>;
|
|
107
|
+
}>>;
|
|
68
108
|
readonly inputSchema: Schema.OptionFromOptional<Schema.Unknown>;
|
|
69
109
|
readonly outputSchema: Schema.OptionFromOptional<Schema.Unknown>;
|
|
70
110
|
readonly deprecated: Schema.Boolean;
|
|
71
|
-
}
|
|
72
|
-
export
|
|
73
|
-
|
|
74
|
-
declare const ServerVariable_base: Schema.Class<ServerVariable, Schema.Struct<{
|
|
111
|
+
}>;
|
|
112
|
+
export type ExtractedOperation = typeof ExtractedOperation.Type;
|
|
113
|
+
export declare const ServerVariable: Schema.Struct<{
|
|
75
114
|
readonly default: Schema.String;
|
|
76
115
|
readonly enum: Schema.OptionFromOptional<Schema.$Array<Schema.String>>;
|
|
77
116
|
readonly description: Schema.OptionFromOptional<Schema.String>;
|
|
78
|
-
}
|
|
79
|
-
export
|
|
80
|
-
|
|
81
|
-
declare const ServerInfo_base: Schema.Class<ServerInfo, Schema.Struct<{
|
|
117
|
+
}>;
|
|
118
|
+
export type ServerVariable = typeof ServerVariable.Type;
|
|
119
|
+
export declare const ServerInfo: Schema.Struct<{
|
|
82
120
|
readonly url: Schema.String;
|
|
83
121
|
readonly description: Schema.OptionFromOptional<Schema.String>;
|
|
84
|
-
readonly variables: Schema.OptionFromOptional<Schema.$Record<Schema.String,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
122
|
+
readonly variables: Schema.OptionFromOptional<Schema.$Record<Schema.String, Schema.Struct<{
|
|
123
|
+
readonly default: Schema.String;
|
|
124
|
+
readonly enum: Schema.OptionFromOptional<Schema.$Array<Schema.String>>;
|
|
125
|
+
readonly description: Schema.OptionFromOptional<Schema.String>;
|
|
126
|
+
}>>>;
|
|
127
|
+
}>;
|
|
128
|
+
export type ServerInfo = typeof ServerInfo.Type;
|
|
129
|
+
export declare const ExtractionResult: Schema.Struct<{
|
|
89
130
|
readonly title: Schema.OptionFromOptional<Schema.String>;
|
|
90
131
|
readonly version: Schema.OptionFromOptional<Schema.String>;
|
|
91
|
-
readonly servers: Schema.$Array<
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
132
|
+
readonly servers: Schema.$Array<Schema.Struct<{
|
|
133
|
+
readonly url: Schema.String;
|
|
134
|
+
readonly description: Schema.OptionFromOptional<Schema.String>;
|
|
135
|
+
readonly variables: Schema.OptionFromOptional<Schema.$Record<Schema.String, Schema.Struct<{
|
|
136
|
+
readonly default: Schema.String;
|
|
137
|
+
readonly enum: Schema.OptionFromOptional<Schema.$Array<Schema.String>>;
|
|
138
|
+
readonly description: Schema.OptionFromOptional<Schema.String>;
|
|
139
|
+
}>>>;
|
|
140
|
+
}>>;
|
|
141
|
+
readonly operations: Schema.$Array<Schema.Struct<{
|
|
142
|
+
readonly operationId: Schema.brand<Schema.String, "OperationId">;
|
|
143
|
+
readonly method: Schema.Literals<readonly ["get", "put", "post", "delete", "patch", "head", "options", "trace"]>;
|
|
144
|
+
readonly pathTemplate: Schema.String;
|
|
145
|
+
readonly summary: Schema.OptionFromOptional<Schema.String>;
|
|
146
|
+
readonly description: Schema.OptionFromOptional<Schema.String>;
|
|
147
|
+
readonly tags: Schema.$Array<Schema.String>;
|
|
148
|
+
readonly parameters: Schema.$Array<Schema.Struct<{
|
|
149
|
+
readonly name: Schema.String;
|
|
150
|
+
readonly location: Schema.Literals<readonly ["path", "query", "header", "cookie"]>;
|
|
151
|
+
readonly required: Schema.Boolean;
|
|
152
|
+
readonly schema: Schema.OptionFromOptional<Schema.Unknown>;
|
|
153
|
+
readonly style: Schema.OptionFromOptional<Schema.String>;
|
|
154
|
+
readonly explode: Schema.OptionFromOptional<Schema.Boolean>;
|
|
155
|
+
readonly allowReserved: Schema.OptionFromOptional<Schema.Boolean>;
|
|
156
|
+
readonly description: Schema.OptionFromOptional<Schema.String>;
|
|
157
|
+
}>>;
|
|
158
|
+
readonly requestBody: Schema.OptionFromOptional<Schema.Struct<{
|
|
159
|
+
readonly required: Schema.Boolean;
|
|
160
|
+
/** Default media type — first declared in spec order (not JSON-first).
|
|
161
|
+
* Used when the caller does not override via the tool's `contentType` arg. */
|
|
162
|
+
readonly contentType: Schema.String;
|
|
163
|
+
/** Schema of the default media type. Kept for backward compat with stored
|
|
164
|
+
* bindings from before `contents` was added. */
|
|
165
|
+
readonly schema: Schema.OptionFromOptional<Schema.Unknown>;
|
|
166
|
+
/** All declared media types in spec order. Populated by `extract.ts`
|
|
167
|
+
* going forward; older persisted bindings may have this unset and will
|
|
168
|
+
* fall back to `{contentType, schema}`. */
|
|
169
|
+
readonly contents: Schema.OptionFromOptional<Schema.$Array<Schema.Struct<{
|
|
170
|
+
readonly contentType: Schema.String;
|
|
171
|
+
readonly schema: Schema.OptionFromOptional<Schema.Unknown>;
|
|
172
|
+
readonly encoding: Schema.OptionFromOptional<Schema.$Record<Schema.String, Schema.Struct<{
|
|
173
|
+
readonly contentType: Schema.OptionFromOptional<Schema.String>;
|
|
174
|
+
readonly style: Schema.OptionFromOptional<Schema.String>;
|
|
175
|
+
readonly explode: Schema.OptionFromOptional<Schema.Boolean>;
|
|
176
|
+
readonly allowReserved: Schema.OptionFromOptional<Schema.Boolean>;
|
|
177
|
+
}>>>;
|
|
178
|
+
}>>>;
|
|
179
|
+
}>>;
|
|
180
|
+
readonly inputSchema: Schema.OptionFromOptional<Schema.Unknown>;
|
|
181
|
+
readonly outputSchema: Schema.OptionFromOptional<Schema.Unknown>;
|
|
182
|
+
readonly deprecated: Schema.Boolean;
|
|
183
|
+
}>>;
|
|
184
|
+
}>;
|
|
185
|
+
export type ExtractionResult = typeof ExtractionResult.Type;
|
|
186
|
+
export declare const OperationBinding: Schema.Struct<{
|
|
97
187
|
readonly method: Schema.Literals<readonly ["get", "put", "post", "delete", "patch", "head", "options", "trace"]>;
|
|
98
188
|
readonly pathTemplate: Schema.String;
|
|
99
|
-
readonly parameters: Schema.$Array<
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
189
|
+
readonly parameters: Schema.$Array<Schema.Struct<{
|
|
190
|
+
readonly name: Schema.String;
|
|
191
|
+
readonly location: Schema.Literals<readonly ["path", "query", "header", "cookie"]>;
|
|
192
|
+
readonly required: Schema.Boolean;
|
|
193
|
+
readonly schema: Schema.OptionFromOptional<Schema.Unknown>;
|
|
194
|
+
readonly style: Schema.OptionFromOptional<Schema.String>;
|
|
195
|
+
readonly explode: Schema.OptionFromOptional<Schema.Boolean>;
|
|
196
|
+
readonly allowReserved: Schema.OptionFromOptional<Schema.Boolean>;
|
|
197
|
+
readonly description: Schema.OptionFromOptional<Schema.String>;
|
|
198
|
+
}>>;
|
|
199
|
+
readonly requestBody: Schema.OptionFromOptional<Schema.Struct<{
|
|
200
|
+
readonly required: Schema.Boolean;
|
|
201
|
+
/** Default media type — first declared in spec order (not JSON-first).
|
|
202
|
+
* Used when the caller does not override via the tool's `contentType` arg. */
|
|
203
|
+
readonly contentType: Schema.String;
|
|
204
|
+
/** Schema of the default media type. Kept for backward compat with stored
|
|
205
|
+
* bindings from before `contents` was added. */
|
|
206
|
+
readonly schema: Schema.OptionFromOptional<Schema.Unknown>;
|
|
207
|
+
/** All declared media types in spec order. Populated by `extract.ts`
|
|
208
|
+
* going forward; older persisted bindings may have this unset and will
|
|
209
|
+
* fall back to `{contentType, schema}`. */
|
|
210
|
+
readonly contents: Schema.OptionFromOptional<Schema.$Array<Schema.Struct<{
|
|
211
|
+
readonly contentType: Schema.String;
|
|
212
|
+
readonly schema: Schema.OptionFromOptional<Schema.Unknown>;
|
|
213
|
+
readonly encoding: Schema.OptionFromOptional<Schema.$Record<Schema.String, Schema.Struct<{
|
|
214
|
+
readonly contentType: Schema.OptionFromOptional<Schema.String>;
|
|
215
|
+
readonly style: Schema.OptionFromOptional<Schema.String>;
|
|
216
|
+
readonly explode: Schema.OptionFromOptional<Schema.Boolean>;
|
|
217
|
+
readonly allowReserved: Schema.OptionFromOptional<Schema.Boolean>;
|
|
218
|
+
}>>>;
|
|
219
|
+
}>>>;
|
|
220
|
+
}>>;
|
|
221
|
+
}>;
|
|
222
|
+
export type OperationBinding = typeof OperationBinding.Type;
|
|
104
223
|
/**
|
|
105
224
|
* A header value — either a static string or a reference to a secret.
|
|
106
225
|
* Stored as JSON-serializable data.
|
|
@@ -110,14 +229,17 @@ export declare const HeaderValue: Schema.Union<readonly [Schema.String, Schema.S
|
|
|
110
229
|
readonly prefix: Schema.optional<Schema.String>;
|
|
111
230
|
}>]>;
|
|
112
231
|
export type HeaderValue = typeof HeaderValue.Type;
|
|
113
|
-
declare const
|
|
232
|
+
export declare const ConfiguredHeaderBinding: Schema.Struct<{
|
|
114
233
|
readonly kind: Schema.Literal<"binding">;
|
|
115
234
|
readonly slot: Schema.String;
|
|
116
235
|
readonly prefix: Schema.optional<Schema.String>;
|
|
117
|
-
}
|
|
118
|
-
export
|
|
119
|
-
|
|
120
|
-
|
|
236
|
+
}>;
|
|
237
|
+
export type ConfiguredHeaderBinding = typeof ConfiguredHeaderBinding.Type;
|
|
238
|
+
export declare const ConfiguredHeaderValue: Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
239
|
+
readonly kind: Schema.Literal<"binding">;
|
|
240
|
+
readonly slot: Schema.String;
|
|
241
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
242
|
+
}>]>;
|
|
121
243
|
export type ConfiguredHeaderValue = typeof ConfiguredHeaderValue.Type;
|
|
122
244
|
export declare const OpenApiCredentialInput: Schema.Union<readonly [Schema.Struct<{
|
|
123
245
|
readonly secretId: Schema.String;
|
|
@@ -127,7 +249,11 @@ export declare const OpenApiCredentialInput: Schema.Union<readonly [Schema.Struc
|
|
|
127
249
|
}>, Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
128
250
|
readonly secretId: Schema.String;
|
|
129
251
|
readonly prefix: Schema.optional<Schema.String>;
|
|
130
|
-
}>]>, Schema.Union<readonly [Schema.String,
|
|
252
|
+
}>]>, Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
253
|
+
readonly kind: Schema.Literal<"binding">;
|
|
254
|
+
readonly slot: Schema.String;
|
|
255
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
256
|
+
}>]>]>;
|
|
131
257
|
export type OpenApiCredentialInput = typeof OpenApiCredentialInput.Type;
|
|
132
258
|
export declare const OpenApiSourceBindingValue: Schema.Union<readonly [Schema.Struct<{
|
|
133
259
|
readonly kind: Schema.Literal<"secret">;
|
|
@@ -141,7 +267,7 @@ export declare const OpenApiSourceBindingValue: Schema.Union<readonly [Schema.St
|
|
|
141
267
|
readonly text: Schema.String;
|
|
142
268
|
}>]>;
|
|
143
269
|
export type OpenApiSourceBindingValue = typeof OpenApiSourceBindingValue.Type;
|
|
144
|
-
export declare const
|
|
270
|
+
export declare const OpenApiSourceBindingInput: Schema.Struct<{
|
|
145
271
|
readonly sourceId: Schema.String;
|
|
146
272
|
readonly sourceScope: Schema.brand<Schema.String, "ScopeId">;
|
|
147
273
|
readonly scope: Schema.brand<Schema.String, "ScopeId">;
|
|
@@ -158,26 +284,8 @@ export declare const OpenApiSourceBindingInputSchema: Schema.Struct<{
|
|
|
158
284
|
readonly text: Schema.String;
|
|
159
285
|
}>]>;
|
|
160
286
|
}>;
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
readonly sourceScope: Schema.brand<Schema.String, "ScopeId">;
|
|
164
|
-
readonly scope: Schema.brand<Schema.String, "ScopeId">;
|
|
165
|
-
readonly slot: Schema.String;
|
|
166
|
-
readonly value: Schema.Union<readonly [Schema.Struct<{
|
|
167
|
-
readonly kind: Schema.Literal<"secret">;
|
|
168
|
-
readonly secretId: Schema.brand<Schema.String, "SecretId">;
|
|
169
|
-
readonly secretScopeId: Schema.optional<Schema.brand<Schema.String, "ScopeId">>;
|
|
170
|
-
}>, Schema.Struct<{
|
|
171
|
-
readonly kind: Schema.Literal<"connection">;
|
|
172
|
-
readonly connectionId: Schema.brand<Schema.String, "ConnectionId">;
|
|
173
|
-
}>, Schema.Struct<{
|
|
174
|
-
readonly kind: Schema.Literal<"text">;
|
|
175
|
-
readonly text: Schema.String;
|
|
176
|
-
}>]>;
|
|
177
|
-
}>, {}>;
|
|
178
|
-
export declare class OpenApiSourceBindingInput extends OpenApiSourceBindingInput_base {
|
|
179
|
-
}
|
|
180
|
-
declare const OpenApiSourceBindingRef_base: Schema.Class<OpenApiSourceBindingRef, Schema.Struct<{
|
|
287
|
+
export type OpenApiSourceBindingInput = typeof OpenApiSourceBindingInput.Type;
|
|
288
|
+
export declare const OpenApiSourceBindingRef: Schema.Struct<{
|
|
181
289
|
readonly sourceId: Schema.String;
|
|
182
290
|
readonly sourceScopeId: Schema.brand<Schema.String, "ScopeId">;
|
|
183
291
|
readonly scopeId: Schema.brand<Schema.String, "ScopeId">;
|
|
@@ -195,12 +303,11 @@ declare const OpenApiSourceBindingRef_base: Schema.Class<OpenApiSourceBindingRef
|
|
|
195
303
|
}>]>;
|
|
196
304
|
readonly createdAt: Schema.Date;
|
|
197
305
|
readonly updatedAt: Schema.Date;
|
|
198
|
-
}
|
|
199
|
-
export
|
|
200
|
-
}
|
|
306
|
+
}>;
|
|
307
|
+
export type OpenApiSourceBindingRef = typeof OpenApiSourceBindingRef.Type;
|
|
201
308
|
export declare const OAuth2Flow: Schema.Literals<readonly ["authorizationCode", "clientCredentials"]>;
|
|
202
309
|
export type OAuth2Flow = typeof OAuth2Flow.Type;
|
|
203
|
-
export declare const
|
|
310
|
+
export declare const OAuth2SourceConfig: Schema.Struct<{
|
|
204
311
|
readonly kind: Schema.Literal<"oauth2">;
|
|
205
312
|
readonly securitySchemeName: Schema.String;
|
|
206
313
|
readonly flow: Schema.Literals<readonly ["authorizationCode", "clientCredentials"]>;
|
|
@@ -212,26 +319,11 @@ export declare const OAuth2SourceConfigSchema: Schema.Struct<{
|
|
|
212
319
|
readonly connectionSlot: Schema.String;
|
|
213
320
|
readonly scopes: Schema.$Array<Schema.String>;
|
|
214
321
|
}>;
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
readonly securitySchemeName: Schema.String;
|
|
218
|
-
readonly flow: Schema.Literals<readonly ["authorizationCode", "clientCredentials"]>;
|
|
219
|
-
readonly tokenUrl: Schema.String;
|
|
220
|
-
readonly authorizationUrl: Schema.NullOr<Schema.String>;
|
|
221
|
-
readonly issuerUrl: Schema.optional<Schema.NullOr<Schema.String>>;
|
|
222
|
-
readonly clientIdSlot: Schema.String;
|
|
223
|
-
readonly clientSecretSlot: Schema.NullOr<Schema.String>;
|
|
224
|
-
readonly connectionSlot: Schema.String;
|
|
225
|
-
readonly scopes: Schema.$Array<Schema.String>;
|
|
226
|
-
}>, {}>;
|
|
227
|
-
export declare class OAuth2SourceConfig extends OAuth2SourceConfig_base {
|
|
228
|
-
}
|
|
229
|
-
declare const InvocationResult_base: Schema.Class<InvocationResult, Schema.Struct<{
|
|
322
|
+
export type OAuth2SourceConfig = typeof OAuth2SourceConfig.Type;
|
|
323
|
+
export declare const InvocationResult: Schema.Struct<{
|
|
230
324
|
readonly status: Schema.Number;
|
|
231
325
|
readonly headers: Schema.$Record<Schema.String, Schema.String>;
|
|
232
326
|
readonly data: Schema.NullOr<Schema.Unknown>;
|
|
233
327
|
readonly error: Schema.NullOr<Schema.Unknown>;
|
|
234
|
-
}
|
|
235
|
-
export
|
|
236
|
-
}
|
|
237
|
-
export {};
|
|
328
|
+
}>;
|
|
329
|
+
export type InvocationResult = typeof InvocationResult.Type;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@executor-js/plugin-openapi",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.4.21",
|
|
4
4
|
"homepage": "https://github.com/RhysSullivan/executor/tree/main/packages/plugins/openapi",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/RhysSullivan/executor/issues"
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@effect/platform-node": "4.0.0-beta.59",
|
|
56
|
-
"@executor-js/config": "
|
|
57
|
-
"@executor-js/sdk": "
|
|
56
|
+
"@executor-js/config": "1.4.21",
|
|
57
|
+
"@executor-js/sdk": "1.4.21",
|
|
58
58
|
"effect": "4.0.0-beta.59",
|
|
59
59
|
"openapi-types": "^12.1.3",
|
|
60
60
|
"yaml": "^2.7.1"
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@effect/atom-react": "4.0.0-beta.59",
|
|
64
64
|
"@effect/vitest": "4.0.0-beta.59",
|
|
65
|
-
"@executor-js/storage-core": "
|
|
65
|
+
"@executor-js/storage-core": "1.4.21",
|
|
66
66
|
"@types/node": "^24.3.1",
|
|
67
67
|
"@types/react": "^19.1.0",
|
|
68
68
|
"bun-types": "^1.2.22",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/react/EditOpenApiSource.tsx"],"sourcesContent":["import { useEffect, useMemo, useRef, useState } from \"react\";\nimport { useAtomSet, useAtomValue } from \"@effect/atom-react\";\nimport * as Exit from \"effect/Exit\";\nimport * as Option from \"effect/Option\";\nimport * as Schema from \"effect/Schema\";\nimport * as AsyncResult from \"effect/unstable/reactivity/AsyncResult\";\n\nimport { connectionsAtom, sourceAtom, startOAuth } from \"@executor-js/react/api/atoms\";\nimport { useScope, useScopeStack, useUserScope } from \"@executor-js/react/api/scope-context\";\nimport { connectionWriteKeys, sourceWriteKeys } from \"@executor-js/react/api/reactivity-keys\";\nimport { Button } from \"@executor-js/react/components/button\";\nimport { CopyButton } from \"@executor-js/react/components/copy-button\";\nimport {\n CardStack,\n CardStackContent,\n CardStackEntry,\n CardStackEntryContent,\n CardStackEntryDescription,\n CardStackEntryField,\n CardStackEntryTitle,\n} from \"@executor-js/react/components/card-stack\";\nimport { FilterTabs } from \"@executor-js/react/components/filter-tabs\";\nimport { Input } from \"@executor-js/react/components/input\";\nimport { sourceWriteKeys as openApiWriteKeys } from \"@executor-js/react/api/reactivity-keys\";\nimport { ConnectionId, ScopeId, SecretId } from \"@executor-js/sdk/core\";\nimport { useSecretPickerSecrets } from \"@executor-js/react/plugins/use-secret-picker-secrets\";\nimport {\n oauthCallbackUrl,\n useOAuthPopupFlow,\n type OAuthCompletionPayload,\n} from \"@executor-js/react/plugins/oauth-sign-in\";\nimport {\n effectiveCredentialBindingForScope,\n exactCredentialBindingForScope,\n isConnectionCredentialBindingValue,\n isSecretCredentialBindingValue,\n} from \"@executor-js/react/plugins/credential-bindings\";\nimport { SecretCredentialSlotBindings } from \"@executor-js/react/plugins/credential-slot-bindings\";\n\nimport {\n openApiSourceAtom,\n openApiSourceBindingsAtom,\n removeOpenApiSourceBinding,\n setOpenApiSourceBinding,\n updateOpenApiSource,\n} from \"./atoms\";\nimport { OpenApiSourceDetailsFields } from \"./OpenApiSourceDetailsFields\";\nimport {\n OPENAPI_OAUTH_CALLBACK_PATH,\n OPENAPI_OAUTH_POPUP_NAME,\n inferOAuthIssuerUrl,\n resolveOAuthUrl,\n} from \"./AddOpenApiSource\";\nimport { oauth2ClientSecretSlot } from \"../sdk/store\";\nimport {\n OAuth2SourceConfig,\n OpenApiSourceBindingInput,\n type OpenApiSourceBindingRef,\n} from \"../sdk/types\";\n\nconst ErrorMessage = Schema.Struct({ message: Schema.String });\nconst decodeErrorMessage = Schema.decodeUnknownOption(ErrorMessage);\n\nconst errorMessageFromExit = (exit: Exit.Exit<unknown, unknown>, fallback: string): string =>\n Option.match(Option.flatMap(Exit.findErrorOption(exit), decodeErrorMessage), {\n onNone: () => fallback,\n onSome: ({ message }) => message,\n });\n\ntype SlotDef =\n | {\n readonly kind: \"secret\";\n readonly slot: string;\n readonly label: string;\n readonly hint?: string;\n }\n | {\n readonly kind: \"oauth2\";\n readonly slot: string;\n readonly label: string;\n };\n\nconst slugify = (value: string): string =>\n value\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\") || \"default\";\n\nconst shortHash = (value: string): string => {\n let hash = 0x811c9dc5;\n for (let i = 0; i < value.length; i++) {\n hash ^= value.charCodeAt(i);\n hash = Math.imul(hash, 0x01000193);\n }\n return (hash >>> 0).toString(36).slice(0, 6);\n};\n\nconst openApiOAuthConnectionId = (\n sourceId: string,\n securitySchemeName: string,\n targetScope: ScopeId,\n): ConnectionId =>\n ConnectionId.make(\n `openapi-oauth-${slugify(sourceId)}-${slugify(securitySchemeName)}-${shortHash(targetScope)}`,\n );\n\nconst effectiveClientSecretSlot = (oauth2: {\n readonly securitySchemeName: string;\n readonly clientSecretSlot: string | null;\n}): string => oauth2.clientSecretSlot ?? oauth2ClientSecretSlot(oauth2.securitySchemeName);\n\nexport default function EditOpenApiSource(props: {\n readonly sourceId: string;\n readonly onSave: () => void;\n}) {\n const displayScope = useScope();\n const scopeStack = useScopeStack();\n const userScope = useUserScope();\n const sourceSummaryResult = useAtomValue(sourceAtom(props.sourceId, displayScope));\n const sourceSummary =\n AsyncResult.isSuccess(sourceSummaryResult) && sourceSummaryResult.value\n ? sourceSummaryResult.value\n : null;\n const sourceScopeId = sourceSummary?.scopeId ?? displayScope;\n const sourceScope = ScopeId.make(sourceScopeId);\n const scopeRanks = useMemo(\n () => new Map(scopeStack.map((scope, index) => [scope.id, index] as const)),\n [scopeStack],\n );\n\n const sourceResult = useAtomValue(openApiSourceAtom(sourceScope, props.sourceId));\n const bindingsResult = useAtomValue(\n openApiSourceBindingsAtom(displayScope, props.sourceId, sourceScope),\n );\n const connectionsResult = useAtomValue(connectionsAtom(displayScope));\n const secretList = useSecretPickerSecrets();\n\n const doUpdate = useAtomSet(updateOpenApiSource, { mode: \"promiseExit\" });\n const doSetBinding = useAtomSet(setOpenApiSourceBinding, {\n mode: \"promiseExit\",\n });\n const doRemoveBinding = useAtomSet(removeOpenApiSourceBinding, {\n mode: \"promiseExit\",\n });\n const doStartOAuth = useAtomSet(startOAuth, { mode: \"promiseExit\" });\n const oauth = useOAuthPopupFlow<OAuthCompletionPayload>({\n popupName: OPENAPI_OAUTH_POPUP_NAME,\n popupBlockedMessage: \"OAuth popup was blocked by the browser\",\n startErrorMessage: \"Failed to connect OAuth\",\n });\n\n const source =\n AsyncResult.isSuccess(sourceResult) && sourceResult.value ? sourceResult.value : null;\n const bindingRows: readonly OpenApiSourceBindingRef[] = AsyncResult.isSuccess(bindingsResult)\n ? bindingsResult.value\n : [];\n const connections = AsyncResult.isSuccess(connectionsResult) ? connectionsResult.value : [];\n const oauth2RedirectUrl = oauthCallbackUrl(OPENAPI_OAUTH_CALLBACK_PATH);\n\n const [name, setName] = useState(source?.name ?? \"\");\n const [baseUrl, setBaseUrl] = useState(source?.config.baseUrl ?? \"\");\n const [sourceSaveState, setSourceSaveState] = useState<\"idle\" | \"saving\" | \"saved\">(\"idle\");\n const [error, setError] = useState<string | null>(null);\n const [busyKey, setBusyKey] = useState<string | null>(null);\n const [pendingOAuthConnection, setPendingOAuthConnection] = useState<{\n readonly scopeId: ScopeId;\n readonly slot: string;\n readonly connectionId: string;\n } | null>(null);\n const [loadedSourceKey, setLoadedSourceKey] = useState<string | null>(null);\n const [selectedOAuthTokenScope, setSelectedOAuthTokenScope] = useState<string>(\n userScope !== sourceScopeId ? userScope : sourceScopeId,\n );\n const [oauth2AuthorizationUrl, setOAuth2AuthorizationUrl] = useState(\n source?.config.oauth2?.authorizationUrl ?? \"\",\n );\n const [oauth2TokenUrl, setOAuth2TokenUrl] = useState(source?.config.oauth2?.tokenUrl ?? \"\");\n const [oauth2EndpointsSaveState, setOAuth2EndpointsSaveState] = useState<\n \"idle\" | \"saving\" | \"saved\"\n >(\"idle\");\n const editIdentity = useMemo(\n () => ({\n name,\n namespace: props.sourceId,\n setName,\n setNamespace: () => {},\n reset: () => {},\n }),\n [name, props.sourceId],\n );\n const sourceSaveSeq = useRef(0);\n const oauth2EndpointsSaveSeq = useRef(0);\n\n useEffect(() => {\n setSelectedOAuthTokenScope(userScope !== sourceScopeId ? userScope : sourceScopeId);\n }, [sourceScopeId, userScope]);\n\n useEffect(() => {\n if (!source) return;\n const sourceKey = `${sourceScopeId}:${source.namespace}`;\n if (loadedSourceKey === sourceKey) return;\n setName(source.name);\n setBaseUrl(source.config.baseUrl ?? \"\");\n setOAuth2AuthorizationUrl(source.config.oauth2?.authorizationUrl ?? \"\");\n setOAuth2TokenUrl(source.config.oauth2?.tokenUrl ?? \"\");\n setOAuth2EndpointsSaveState(\"idle\");\n setSourceSaveState(\"idle\");\n setLoadedSourceKey(sourceKey);\n }, [loadedSourceKey, source, sourceScopeId]);\n\n useEffect(() => {\n if (!source) return;\n const sourceKey = `${sourceScopeId}:${source.namespace}`;\n if (loadedSourceKey !== sourceKey) return;\n\n const nextName = name.trim();\n const nextBaseUrl = baseUrl.trim();\n const currentName = source.name;\n const currentBaseUrl = source.config.baseUrl ?? \"\";\n if ((nextName || currentName) === currentName && nextBaseUrl === currentBaseUrl) {\n return;\n }\n\n const timeout = window.setTimeout(() => {\n const seq = ++sourceSaveSeq.current;\n setSourceSaveState(\"saving\");\n setError(null);\n void (async () => {\n const exit = await doUpdate({\n params: { scopeId: displayScope, namespace: props.sourceId },\n payload: {\n sourceScope,\n name: nextName || undefined,\n baseUrl: nextBaseUrl || undefined,\n },\n reactivityKeys: openApiWriteKeys,\n });\n if (sourceSaveSeq.current !== seq) return;\n if (Exit.isFailure(exit)) {\n setSourceSaveState(\"idle\");\n setError(errorMessageFromExit(exit, \"Failed to save source details\"));\n return;\n }\n setSourceSaveState(\"saved\");\n window.setTimeout(() => {\n if (sourceSaveSeq.current === seq) setSourceSaveState(\"idle\");\n }, 1600);\n })();\n }, 600);\n\n return () => window.clearTimeout(timeout);\n }, [\n baseUrl,\n displayScope,\n doUpdate,\n loadedSourceKey,\n name,\n props.sourceId,\n source,\n sourceScope,\n sourceScopeId,\n ]);\n\n const secretSlots = useMemo(() => {\n if (!source) return [] as SlotDef[];\n const slots: SlotDef[] = [];\n for (const [headerName, value] of Object.entries(source.config.headers ?? {})) {\n if (typeof value === \"string\") continue;\n slots.push({\n kind: \"secret\",\n slot: value.slot,\n label: headerName,\n hint: value.prefix ? `Prefix: ${value.prefix}` : undefined,\n });\n }\n if (source.config.oauth2) {\n const clientSecretSlot = effectiveClientSecretSlot(source.config.oauth2);\n slots.push({\n kind: \"secret\",\n slot: source.config.oauth2.clientIdSlot,\n label: \"Client ID\",\n });\n slots.push({\n kind: \"secret\",\n slot: clientSecretSlot,\n label: \"Client Secret\",\n hint:\n source.config.oauth2.flow === \"authorizationCode\"\n ? \"Optional for public PKCE clients\"\n : undefined,\n });\n slots.push({\n kind: \"oauth2\",\n slot: source.config.oauth2.connectionSlot,\n label:\n source.config.oauth2.flow === \"clientCredentials\"\n ? \"OAuth Client Credentials\"\n : \"OAuth Authorization Code\",\n });\n }\n return slots;\n }, [source]);\n\n const credentialScopes = useMemo(() => {\n const entries = [{ scopeId: ScopeId.make(sourceScopeId), label: \"Organization\" }];\n if (userScope !== sourceScopeId) {\n entries.unshift({ scopeId: ScopeId.make(userScope), label: \"Personal\" });\n } else {\n entries[0] = {\n scopeId: ScopeId.make(sourceScopeId),\n label: \"Credentials\",\n };\n }\n return entries;\n }, [sourceScopeId, userScope]);\n const credentialScopeOptions = useMemo(\n () =>\n credentialScopes.map((entry) => ({\n scopeId: entry.scopeId,\n label: entry.label,\n description:\n entry.label === \"Personal\"\n ? \"Saved only for your account.\"\n : \"Shared with everyone who can use this source.\",\n })),\n [credentialScopes],\n );\n const organizationCredentialScope =\n credentialScopes.find((entry) => entry.label === \"Organization\") ?? credentialScopes[0]!;\n const personalCredentialScope =\n credentialScopes.find((entry) => entry.label === \"Personal\") ?? null;\n const secretBindingScopes =\n personalCredentialScope &&\n personalCredentialScope.scopeId !== organizationCredentialScope.scopeId\n ? [organizationCredentialScope, personalCredentialScope]\n : [organizationCredentialScope];\n const activeOAuthTokenScope =\n credentialScopes.find((entry) => entry.scopeId === selectedOAuthTokenScope) ??\n credentialScopes[0]!;\n const activeOAuthTokenScopeId = activeOAuthTokenScope.scopeId;\n const activeOAuthTokenScopeLabel = activeOAuthTokenScope.label;\n\n if (!source) {\n return (\n <div className=\"space-y-3\">\n <h1 className=\"text-xl font-semibold text-foreground\">Edit OpenAPI Source</h1>\n <p className=\"text-sm text-muted-foreground\">Loading configuration…</p>\n </div>\n );\n }\n\n const setSecretBinding = async (\n targetScope: ScopeId,\n slot: string,\n secretId: string,\n secretScope: ScopeId,\n ) => {\n const inputKey = `${targetScope}:${slot}`;\n const trimmed = secretId.trim();\n if (!trimmed) return;\n setBusyKey(inputKey);\n setError(null);\n const exit = await doSetBinding({\n params: { scopeId: displayScope },\n payload: new OpenApiSourceBindingInput({\n sourceId: props.sourceId,\n sourceScope,\n scope: targetScope,\n slot,\n value: {\n kind: \"secret\",\n secretId: SecretId.make(trimmed),\n secretScopeId: secretScope,\n },\n }),\n reactivityKeys: sourceWriteKeys,\n });\n if (Exit.isFailure(exit)) {\n setError(errorMessageFromExit(exit, \"Failed to save credential binding\"));\n }\n setBusyKey(null);\n };\n\n const clearBinding = async (targetScope: ScopeId, slot: string) => {\n setBusyKey(`${targetScope}:${slot}:clear`);\n setError(null);\n const exit = await doRemoveBinding({\n params: { scopeId: displayScope },\n payload: {\n sourceId: props.sourceId,\n sourceScope,\n slot,\n scope: targetScope,\n },\n reactivityKeys: sourceWriteKeys,\n });\n if (Exit.isFailure(exit)) {\n setError(errorMessageFromExit(exit, \"Failed to clear credential binding\"));\n }\n setBusyKey(null);\n };\n\n const connectOAuth = async (targetScope: ScopeId) => {\n const oauth2 = source.config.oauth2;\n if (!oauth2) return;\n const clientIdBinding = effectiveCredentialBindingForScope(\n bindingRows,\n oauth2.clientIdSlot,\n targetScope,\n scopeRanks,\n );\n const clientSecretSlot = effectiveClientSecretSlot(oauth2);\n const clientSecretBinding = effectiveCredentialBindingForScope(\n bindingRows,\n clientSecretSlot,\n targetScope,\n scopeRanks,\n );\n if (!clientIdBinding || !isSecretCredentialBindingValue(clientIdBinding.value)) {\n setError(\"Client ID must be bound before connecting\");\n return;\n }\n const clientIdSecretId = clientIdBinding.value.secretId;\n if (\n oauth2.flow === \"clientCredentials\" &&\n (!clientSecretBinding || !isSecretCredentialBindingValue(clientSecretBinding.value))\n ) {\n setError(\"Client secret must be bound before connecting\");\n return;\n }\n const clientSecretValue =\n oauth2.flow === \"clientCredentials\" &&\n clientSecretBinding &&\n isSecretCredentialBindingValue(clientSecretBinding.value)\n ? clientSecretBinding.value\n : null;\n\n const existingConnection = exactCredentialBindingForScope(\n bindingRows,\n oauth2.connectionSlot,\n targetScope,\n );\n const connectionId =\n existingConnection && isConnectionCredentialBindingValue(existingConnection.value)\n ? existingConnection.value.connectionId\n : openApiOAuthConnectionId(props.sourceId, oauth2.securitySchemeName, targetScope);\n\n setBusyKey(`${targetScope}:${oauth2.connectionSlot}:connect`);\n setPendingOAuthConnection({\n scopeId: targetScope,\n slot: oauth2.connectionSlot,\n connectionId: connectionId,\n });\n setError(null);\n const failConnect = (message: string) => {\n setError(message);\n setPendingOAuthConnection(null);\n setBusyKey(null);\n };\n const displayName = source.name;\n const tokenUrl = resolveOAuthUrl(oauth2.tokenUrl, source.config.baseUrl ?? \"\");\n if (oauth2.flow === \"clientCredentials\") {\n const startOAuthExit = await doStartOAuth({\n params: { scopeId: targetScope },\n payload: {\n endpoint: tokenUrl,\n redirectUrl: tokenUrl,\n connectionId: connectionId,\n tokenScope: targetScope,\n strategy: {\n kind: \"client-credentials\",\n tokenEndpoint: tokenUrl,\n clientIdSecretId,\n clientSecretSecretId: clientSecretValue!.secretId,\n scopes: [...oauth2.scopes],\n },\n pluginId: \"openapi\",\n identityLabel: `${displayName} OAuth`,\n },\n });\n if (Exit.isFailure(startOAuthExit)) {\n failConnect(errorMessageFromExit(startOAuthExit, \"Failed to connect OAuth\"));\n return;\n }\n const response = startOAuthExit.value;\n if (!response.completedConnection) {\n failConnect(\"Unexpected OAuth response\");\n return;\n }\n const setBindingExit = await doSetBinding({\n params: { scopeId: displayScope },\n payload: new OpenApiSourceBindingInput({\n sourceId: props.sourceId,\n sourceScope,\n scope: targetScope,\n slot: oauth2.connectionSlot,\n value: {\n kind: \"connection\",\n connectionId: ConnectionId.make(response.completedConnection.connectionId),\n },\n }),\n reactivityKeys: [...sourceWriteKeys, ...connectionWriteKeys],\n });\n if (Exit.isFailure(setBindingExit)) {\n failConnect(errorMessageFromExit(setBindingExit, \"Failed to connect OAuth\"));\n return;\n }\n setPendingOAuthConnection(null);\n setBusyKey(null);\n return;\n }\n\n const authorizationUrl = resolveOAuthUrl(\n oauth2.authorizationUrl ?? \"\",\n source.config.baseUrl ?? \"\",\n );\n const issuerUrl = oauth2.issuerUrl ?? inferOAuthIssuerUrl(authorizationUrl);\n const startOAuthExit = await doStartOAuth({\n params: { scopeId: targetScope },\n payload: {\n endpoint: authorizationUrl,\n connectionId,\n tokenScope: targetScope,\n redirectUrl: oauth2RedirectUrl,\n strategy: {\n kind: \"authorization-code\",\n authorizationEndpoint: authorizationUrl,\n tokenEndpoint: tokenUrl,\n issuerUrl,\n clientIdSecretId,\n clientSecretSecretId:\n clientSecretBinding && isSecretCredentialBindingValue(clientSecretBinding.value)\n ? clientSecretBinding.value.secretId\n : null,\n scopes: [...oauth2.scopes],\n },\n pluginId: \"openapi\",\n identityLabel: `${displayName} OAuth`,\n },\n });\n if (Exit.isFailure(startOAuthExit)) {\n failConnect(errorMessageFromExit(startOAuthExit, \"Failed to connect OAuth\"));\n return;\n }\n const response = startOAuthExit.value;\n if (response.authorizationUrl === null) {\n failConnect(\"Unexpected OAuth response\");\n return;\n }\n\n await oauth.openAuthorization({\n tokenScope: targetScope,\n run: async () => ({\n sessionId: response.sessionId,\n authorizationUrl: response.authorizationUrl,\n }),\n onSuccess: async (result) => {\n const setBindingExit = await doSetBinding({\n params: { scopeId: displayScope },\n payload: new OpenApiSourceBindingInput({\n sourceId: props.sourceId,\n sourceScope,\n scope: targetScope,\n slot: oauth2.connectionSlot,\n value: {\n kind: \"connection\",\n connectionId: ConnectionId.make(result.connectionId),\n },\n }),\n reactivityKeys: [...sourceWriteKeys, ...connectionWriteKeys],\n });\n if (Exit.isFailure(setBindingExit)) {\n failConnect(errorMessageFromExit(setBindingExit, \"Failed to connect OAuth\"));\n return;\n }\n setPendingOAuthConnection(null);\n setBusyKey(null);\n },\n onError: (message) => {\n setError(message);\n setPendingOAuthConnection(null);\n setBusyKey(null);\n },\n });\n };\n\n return (\n <div className=\"space-y-6\">\n <div>\n <h1 className=\"text-xl font-semibold text-foreground\">OpenAPI Source</h1>\n </div>\n\n <OpenApiSourceDetailsFields\n title=\"Source Details\"\n description=\"Name and base URL save automatically.\"\n identity={editIdentity}\n baseUrl={baseUrl}\n onBaseUrlChange={setBaseUrl}\n specUrl={source.config.sourceUrl ?? \"\"}\n onSpecUrlChange={() => {}}\n specUrlDisabled\n namespaceReadOnly\n saveState={sourceSaveState}\n footer={\n source.config.oauth2\n ? `Authentication Template: OAuth2 ${source.config.oauth2.flow}`\n : Object.keys(source.config.headers ?? {}).length > 0\n ? `Authentication Template: ${Object.keys(source.config.headers ?? {}).length} header binding${\n Object.keys(source.config.headers ?? {}).length === 1 ? \"\" : \"s\"\n }`\n : \"Authentication Template: None\"\n }\n />\n\n <CardStack>\n <CardStackContent className=\"border-t-0\">\n <CardStackEntry>\n <CardStackEntryContent>\n <CardStackEntryTitle>Secrets</CardStackEntryTitle>\n </CardStackEntryContent>\n </CardStackEntry>\n\n <SecretCredentialSlotBindings\n slots={secretSlots.filter((slot) => slot.kind === \"secret\")}\n bindingScopes={secretBindingScopes}\n bindingRows={bindingRows}\n scopeRanks={scopeRanks}\n secrets={secretList}\n sourceId={props.sourceId}\n sourceName={source.name}\n credentialScopeOptions={credentialScopeOptions}\n busyKey={busyKey}\n onSetSecretBinding={setSecretBinding}\n onClearBinding={clearBinding}\n />\n\n {source.config.oauth2 &&\n (() => {\n const oauth2 = source.config.oauth2;\n const trimmedAuthUrl = oauth2AuthorizationUrl.trim();\n const trimmedTokenUrl = oauth2TokenUrl.trim();\n const savedAuthUrl = oauth2.authorizationUrl ?? \"\";\n const isAuthCode = oauth2.flow === \"authorizationCode\";\n const endpointsDirty =\n (isAuthCode && trimmedAuthUrl !== savedAuthUrl) ||\n trimmedTokenUrl !== oauth2.tokenUrl;\n const saving = oauth2EndpointsSaveState === \"saving\";\n const tokenUrlMissing = trimmedTokenUrl.length === 0;\n const authUrlMissing = isAuthCode && trimmedAuthUrl.length === 0;\n const canSave = endpointsDirty && !saving && !tokenUrlMissing && !authUrlMissing;\n\n const saveOAuth2Endpoints = async () => {\n const seq = ++oauth2EndpointsSaveSeq.current;\n setOAuth2EndpointsSaveState(\"saving\");\n setError(null);\n const exit = await doUpdate({\n params: { scopeId: displayScope, namespace: props.sourceId },\n payload: {\n sourceScope,\n oauth2: new OAuth2SourceConfig({\n kind: \"oauth2\",\n securitySchemeName: oauth2.securitySchemeName,\n flow: oauth2.flow,\n tokenUrl: trimmedTokenUrl,\n authorizationUrl: isAuthCode ? trimmedAuthUrl || null : null,\n issuerUrl: oauth2.issuerUrl ?? null,\n clientIdSlot: oauth2.clientIdSlot,\n clientSecretSlot: oauth2.clientSecretSlot,\n connectionSlot: oauth2.connectionSlot,\n scopes: [...oauth2.scopes],\n }),\n },\n reactivityKeys: openApiWriteKeys,\n });\n if (oauth2EndpointsSaveSeq.current !== seq) return;\n if (Exit.isFailure(exit)) {\n setOAuth2EndpointsSaveState(\"idle\");\n setError(errorMessageFromExit(exit, \"Failed to save OAuth endpoints\"));\n return;\n }\n setOAuth2EndpointsSaveState(\"saved\");\n window.setTimeout(() => {\n if (oauth2EndpointsSaveSeq.current === seq) {\n setOAuth2EndpointsSaveState(\"idle\");\n }\n }, 1600);\n };\n\n const exact = exactCredentialBindingForScope(\n bindingRows,\n oauth2.connectionSlot,\n activeOAuthTokenScopeId,\n );\n const binding =\n exact ??\n effectiveCredentialBindingForScope(\n bindingRows,\n oauth2.connectionSlot,\n activeOAuthTokenScopeId,\n scopeRanks,\n );\n const connectionBinding =\n binding && isConnectionCredentialBindingValue(binding.value) ? binding.value : null;\n const connection = connectionBinding\n ? connections.find((entry) => entry.id === connectionBinding.connectionId)\n : null;\n const bindingScopeId = connectionBinding && binding ? binding.scopeId : null;\n const isConnecting =\n busyKey === `${activeOAuthTokenScopeId}:${oauth2.connectionSlot}:connect`;\n const isPendingOAuthConnection =\n pendingOAuthConnection?.scopeId === activeOAuthTokenScopeId &&\n pendingOAuthConnection !== null &&\n pendingOAuthConnection.slot === oauth2.connectionSlot;\n const isConnected = connection !== null && connection !== undefined;\n const statusText =\n isConnecting || isPendingOAuthConnection\n ? \"Saving OAuth connection...\"\n : connectionBinding && bindingScopeId\n ? connection\n ? bindingScopeId === activeOAuthTokenScopeId\n ? `Connected in ${activeOAuthTokenScopeLabel.toLowerCase()} as ${\n connection.identityLabel ?? connection.id\n }`\n : `Using organization connection ${\n connection.identityLabel ?? connection.id\n }`\n : bindingScopeId === activeOAuthTokenScopeId\n ? `Saved connection is missing in ${activeOAuthTokenScopeLabel.toLowerCase()}`\n : \"Organization connection is missing\"\n : `No ${activeOAuthTokenScopeLabel.toLowerCase()} connection`;\n const connectDisabled = isConnecting || endpointsDirty || saving;\n\n return (\n <>\n <CardStackEntry>\n <CardStackEntryContent>\n <CardStackEntryTitle>OAuth Endpoints</CardStackEntryTitle>\n <CardStackEntryDescription>\n Override the URLs from the OpenAPI spec when a provider publishes the wrong\n values.\n </CardStackEntryDescription>\n </CardStackEntryContent>\n <div className=\"flex items-center gap-2\">\n {oauth2EndpointsSaveState !== \"idle\" && (\n <span className=\"text-xs text-muted-foreground\">\n {saving ? \"Saving…\" : \"Saved\"}\n </span>\n )}\n <Button\n size=\"sm\"\n onClick={() => void saveOAuth2Endpoints()}\n disabled={!canSave}\n >\n Save\n </Button>\n </div>\n </CardStackEntry>\n {isAuthCode && (\n <CardStackEntryField label=\"Authorization URL\">\n <Input\n value={oauth2AuthorizationUrl}\n onChange={(e) =>\n setOAuth2AuthorizationUrl((e.target as HTMLInputElement).value)\n }\n className=\"font-mono text-sm\"\n />\n </CardStackEntryField>\n )}\n <CardStackEntryField label=\"Token URL\">\n <Input\n value={oauth2TokenUrl}\n onChange={(e) => setOAuth2TokenUrl((e.target as HTMLInputElement).value)}\n className=\"font-mono text-sm\"\n />\n </CardStackEntryField>\n <CardStackEntryField label=\"Redirect URL\">\n <div className=\"space-y-1.5\">\n <div className=\"flex items-center gap-1 rounded-md border border-border bg-background/50 px-2.5 py-1.5 font-mono text-[11px]\">\n <span className=\"truncate flex-1 text-foreground\">{oauth2RedirectUrl}</span>\n <CopyButton value={oauth2RedirectUrl} />\n </div>\n <p className=\"text-xs text-muted-foreground\">\n Add this to your OAuth app's allowed redirects.\n </p>\n </div>\n </CardStackEntryField>\n {credentialScopes.length > 1 && (\n <CardStackEntry>\n <CardStackEntryContent>\n <CardStackEntryTitle>OAuth token</CardStackEntryTitle>\n <CardStackEntryDescription>\n Choose where the signed-in OAuth token is saved.\n </CardStackEntryDescription>\n </CardStackEntryContent>\n <FilterTabs\n tabs={credentialScopes.map((entry) => ({\n value: entry.scopeId,\n label: entry.label,\n }))}\n value={activeOAuthTokenScopeId}\n onChange={setSelectedOAuthTokenScope}\n />\n </CardStackEntry>\n )}\n <CardStackEntryField label=\"OAuth Connection\">\n <div className=\"space-y-2\">\n <div className=\"text-sm text-muted-foreground\">{statusText}</div>\n <Button\n size=\"sm\"\n onClick={() => void connectOAuth(activeOAuthTokenScopeId)}\n disabled={connectDisabled}\n >\n {isConnecting ? \"Connecting…\" : isConnected ? \"Reconnect\" : \"Connect\"}\n </Button>\n {endpointsDirty && (\n <p className=\"text-xs text-muted-foreground\">\n Save endpoint changes before reconnecting.\n </p>\n )}\n </div>\n </CardStackEntryField>\n </>\n );\n })()}\n </CardStackContent>\n </CardStack>\n\n {error && (\n <div className=\"rounded-lg border border-destructive/30 bg-destructive/5 px-3 py-2\">\n <p className=\"text-sm text-destructive\">{error}</p>\n </div>\n )}\n\n <div className=\"flex items-center justify-start border-t border-border pt-4\">\n <Button variant=\"ghost\" onClick={props.onSave}>\n Back\n </Button>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,WAAW,SAAS,QAAQ,gBAAgB;AACrD,SAAS,YAAY,oBAAoB;AACzC,YAAY,UAAU;AACtB,YAAY,YAAY;AACxB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