@executor-js/plugin-openapi 1.5.6 → 1.5.7

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 (58) hide show
  1. package/dist/{AddOpenApiSource-7M52SRUX.js → AddOpenApiSource-7O4LSD7C.js} +79 -241
  2. package/dist/AddOpenApiSource-7O4LSD7C.js.map +1 -0
  3. package/dist/{EditOpenApiSource-WTAMRJUK.js → EditOpenApiSource-GIN5RQPL.js} +3 -3
  4. package/dist/{OpenApiAccountsPanel-3VJJXNQF.js → OpenApiAccountsPanel-7XT6ZMD5.js} +30 -28
  5. package/dist/OpenApiAccountsPanel-7XT6ZMD5.js.map +1 -0
  6. package/dist/api/group.d.ts +38 -37
  7. package/dist/api/index.d.ts +39 -38
  8. package/dist/{chunk-YVRI7KRC.js → chunk-C3IJX4AN.js} +257 -219
  9. package/dist/chunk-C3IJX4AN.js.map +1 -0
  10. package/dist/{chunk-OSIFYIQP.js → chunk-C6PH4R7Q.js} +94 -5
  11. package/dist/chunk-C6PH4R7Q.js.map +1 -0
  12. package/dist/{chunk-BSLE6HCE.js → chunk-IB36ED7Y.js} +13 -27
  13. package/dist/chunk-IB36ED7Y.js.map +1 -0
  14. package/dist/chunk-RCBR3QMJ.js +73 -0
  15. package/dist/chunk-RCBR3QMJ.js.map +1 -0
  16. package/dist/{chunk-V7VCHYOY.js → chunk-WJQIWTZF.js} +97 -172
  17. package/dist/chunk-WJQIWTZF.js.map +1 -0
  18. package/dist/client.js +3 -3
  19. package/dist/core.js +133 -7
  20. package/dist/core.js.map +1 -1
  21. package/dist/index.js +7 -5
  22. package/dist/index.js.map +1 -1
  23. package/dist/react/AddOpenApiSource.d.ts +0 -1
  24. package/dist/react/OpenApiSourceDetailsFields.d.ts +3 -0
  25. package/dist/react/atoms.d.ts +40 -52
  26. package/dist/react/auth-method-config.d.ts +7 -4
  27. package/dist/react/client.d.ts +38 -37
  28. package/dist/sdk/config.d.ts +27 -27
  29. package/dist/sdk/derive-auth.d.ts +9 -0
  30. package/dist/sdk/extract.d.ts +11 -1
  31. package/dist/sdk/index.d.ts +6 -2
  32. package/dist/sdk/invoke.d.ts +11 -1
  33. package/dist/sdk/migrate-config.d.ts +4 -0
  34. package/dist/sdk/migrate-config.test.d.ts +1 -0
  35. package/dist/sdk/openapi-utils.d.ts +4 -8
  36. package/dist/sdk/output-schema-migration.d.ts +21 -0
  37. package/dist/sdk/output-schema-migration.test.d.ts +1 -0
  38. package/dist/sdk/plugin.d.ts +6 -4
  39. package/dist/sdk/preview.d.ts +77 -1
  40. package/dist/sdk/server-url-resolution.test.d.ts +1 -0
  41. package/dist/sdk/spec-blob-migration.d.ts +7 -0
  42. package/dist/sdk/spec-blob.test.d.ts +1 -0
  43. package/dist/sdk/store.d.ts +10 -1
  44. package/dist/sdk/tool-row-projection.test.d.ts +1 -0
  45. package/dist/sdk/types.d.ts +61 -36
  46. package/dist/testing/index.d.ts +1 -1
  47. package/dist/testing.js +4 -20
  48. package/dist/testing.js.map +1 -1
  49. package/package.json +3 -3
  50. package/dist/AddOpenApiSource-7M52SRUX.js.map +0 -1
  51. package/dist/OpenApiAccountsPanel-3VJJXNQF.js.map +0 -1
  52. package/dist/chunk-BSLE6HCE.js.map +0 -1
  53. package/dist/chunk-OSIFYIQP.js.map +0 -1
  54. package/dist/chunk-QSSRVK6M.js +0 -139
  55. package/dist/chunk-QSSRVK6M.js.map +0 -1
  56. package/dist/chunk-V7VCHYOY.js.map +0 -1
  57. package/dist/chunk-YVRI7KRC.js.map +0 -1
  58. /package/dist/{EditOpenApiSource-WTAMRJUK.js.map → EditOpenApiSource-GIN5RQPL.js.map} +0 -0
@@ -7,6 +7,9 @@ export declare function OpenApiSourceDetailsFields(props: {
7
7
  readonly baseUrl: string;
8
8
  readonly onBaseUrlChange: (value: string) => void;
9
9
  readonly baseUrlOptions?: readonly FreeformComboboxOption[];
10
+ readonly baseUrlLabel?: string;
11
+ readonly baseUrlPlaceholder?: string;
12
+ readonly baseUrlHint?: string;
10
13
  readonly specUrl?: string;
11
14
  readonly onSpecUrlChange?: (value: string) => void;
12
15
  readonly faviconIcon?: string | null;
@@ -8,34 +8,29 @@ export declare const openApiIntegrationAtom: (slug: IntegrationSlug) => Atom.Ato
8
8
  readonly canRefresh: boolean;
9
9
  } | null, import("@executor-js/sdk").IntegrationAlreadyExistsError | import("@executor-js/sdk").InternalError | import("../sdk").OpenApiParseError | import("../sdk").OpenApiExtractionError | import("../sdk").OpenApiOAuthError>>;
10
10
  export declare const openApiConfigAtom: (slug: IntegrationSlug) => Atom.Atom<import("effect/unstable/reactivity/AsyncResult").AsyncResult<{
11
- readonly spec: string;
12
11
  readonly headers?: {
13
12
  readonly [x: string]: string;
14
13
  } | undefined;
15
- readonly baseUrl?: string | undefined;
16
14
  readonly queryParams?: {
17
15
  readonly [x: string]: string;
18
16
  } | undefined;
19
17
  readonly sourceUrl?: string | undefined;
20
18
  readonly googleDiscoveryUrls?: readonly string[] | undefined;
19
+ readonly baseUrl?: string | undefined;
21
20
  readonly authenticationTemplate?: readonly ({
22
- readonly type: "apiKey";
23
21
  readonly slug: string;
24
- readonly headers?: {
25
- readonly [x: string]: string | readonly (string | {
26
- readonly name: string;
27
- readonly type: "variable";
28
- })[];
29
- } | undefined;
30
- readonly queryParams?: {
31
- readonly [x: string]: string | readonly (string | {
32
- readonly name: string;
33
- readonly type: "variable";
34
- })[];
35
- } | undefined;
22
+ readonly kind: "apikey";
23
+ readonly placements: readonly {
24
+ readonly name: string;
25
+ readonly carrier: "header" | "query";
26
+ readonly variable?: string | undefined;
27
+ readonly prefix?: string | undefined;
28
+ readonly literal?: string | undefined;
29
+ }[];
30
+ readonly label?: string | undefined;
36
31
  } | {
37
- readonly type: "oauth";
38
32
  readonly slug: string;
33
+ readonly kind: "oauth2";
39
34
  readonly authorizationUrl: string;
40
35
  readonly tokenUrl: string;
41
36
  readonly scopes: readonly string[];
@@ -58,7 +53,6 @@ export declare const previewOpenApiSpec: Atom.AtomResultFn<{
58
53
  readonly operationId: string;
59
54
  }[];
60
55
  readonly title: import("effect/Option").Option<string>;
61
- readonly tags: readonly string[];
62
56
  readonly servers: readonly {
63
57
  readonly description: import("effect/Option").Option<string>;
64
58
  readonly url: string;
@@ -70,6 +64,7 @@ export declare const previewOpenApiSpec: Atom.AtomResultFn<{
70
64
  };
71
65
  }>;
72
66
  }[];
67
+ readonly tags: readonly string[];
73
68
  readonly securitySchemes: readonly {
74
69
  readonly name: string;
75
70
  readonly type: "oauth2" | "http" | "apiKey" | "openIdConnect";
@@ -141,13 +136,14 @@ export declare const addOpenApiSpec: Atom.AtomResultFn<{
141
136
  readonly headers?: {
142
137
  readonly [x: string]: string;
143
138
  } | undefined;
144
- readonly baseUrl?: string | undefined;
145
139
  readonly queryParams?: {
146
140
  readonly [x: string]: string;
147
141
  } | undefined;
142
+ readonly baseUrl?: string | undefined;
148
143
  readonly authenticationTemplate?: readonly ({
149
144
  readonly type: "apiKey";
150
- readonly slug: string;
145
+ readonly slug?: string | undefined;
146
+ readonly label?: string | undefined;
151
147
  readonly headers?: {
152
148
  readonly [x: string]: string | readonly (string | {
153
149
  readonly name: string;
@@ -161,8 +157,8 @@ export declare const addOpenApiSpec: Atom.AtomResultFn<{
161
157
  })[];
162
158
  } | undefined;
163
159
  } | {
164
- readonly type: "oauth";
165
160
  readonly slug: string;
161
+ readonly kind: "oauth2";
166
162
  readonly authorizationUrl: string;
167
163
  readonly tokenUrl: string;
168
164
  readonly scopes: readonly string[];
@@ -188,7 +184,8 @@ export declare const openapiConfigure: Atom.AtomResultFn<{
188
184
  readonly payload: {
189
185
  readonly authenticationTemplate: readonly ({
190
186
  readonly type: "apiKey";
191
- readonly slug: string;
187
+ readonly slug?: string | undefined;
188
+ readonly label?: string | undefined;
192
189
  readonly headers?: {
193
190
  readonly [x: string]: string | readonly (string | {
194
191
  readonly name: string;
@@ -202,8 +199,8 @@ export declare const openapiConfigure: Atom.AtomResultFn<{
202
199
  })[];
203
200
  } | undefined;
204
201
  } | {
205
- readonly type: "oauth";
206
202
  readonly slug: string;
203
+ readonly kind: "oauth2";
207
204
  readonly authorizationUrl: string;
208
205
  readonly tokenUrl: string;
209
206
  readonly scopes: readonly string[];
@@ -214,23 +211,19 @@ export declare const openapiConfigure: Atom.AtomResultFn<{
214
211
  readonly reactivityKeys?: readonly unknown[] | import("effect/Record").ReadonlyRecord<string, readonly unknown[]> | undefined;
215
212
  }, {
216
213
  readonly authenticationTemplate: readonly ({
217
- readonly type: "apiKey";
218
214
  readonly slug: string;
219
- readonly headers?: {
220
- readonly [x: string]: string | readonly (string | {
221
- readonly name: string;
222
- readonly type: "variable";
223
- })[];
224
- } | undefined;
225
- readonly queryParams?: {
226
- readonly [x: string]: string | readonly (string | {
227
- readonly name: string;
228
- readonly type: "variable";
229
- })[];
230
- } | undefined;
215
+ readonly kind: "apikey";
216
+ readonly placements: readonly {
217
+ readonly name: string;
218
+ readonly carrier: "header" | "query";
219
+ readonly variable?: string | undefined;
220
+ readonly prefix?: string | undefined;
221
+ readonly literal?: string | undefined;
222
+ }[];
223
+ readonly label?: string | undefined;
231
224
  } | {
232
- readonly type: "oauth";
233
225
  readonly slug: string;
226
+ readonly kind: "oauth2";
234
227
  readonly authorizationUrl: string;
235
228
  readonly tokenUrl: string;
236
229
  readonly scopes: readonly string[];
@@ -244,34 +237,29 @@ export declare const openApiIntegrationFamily: (arg: string & import("effect/Bra
244
237
  readonly canRefresh: boolean;
245
238
  } | null, import("@executor-js/sdk").IntegrationAlreadyExistsError | import("@executor-js/sdk").InternalError | import("../sdk").OpenApiParseError | import("../sdk").OpenApiExtractionError | import("../sdk").OpenApiOAuthError>>;
246
239
  export declare const openApiConfigFamily: (arg: string & import("effect/Brand").Brand<"IntegrationSlug">) => Atom.Atom<import("effect/unstable/reactivity/AsyncResult").AsyncResult<{
247
- readonly spec: string;
248
240
  readonly headers?: {
249
241
  readonly [x: string]: string;
250
242
  } | undefined;
251
- readonly baseUrl?: string | undefined;
252
243
  readonly queryParams?: {
253
244
  readonly [x: string]: string;
254
245
  } | undefined;
255
246
  readonly sourceUrl?: string | undefined;
256
247
  readonly googleDiscoveryUrls?: readonly string[] | undefined;
248
+ readonly baseUrl?: string | undefined;
257
249
  readonly authenticationTemplate?: readonly ({
258
- readonly type: "apiKey";
259
250
  readonly slug: string;
260
- readonly headers?: {
261
- readonly [x: string]: string | readonly (string | {
262
- readonly name: string;
263
- readonly type: "variable";
264
- })[];
265
- } | undefined;
266
- readonly queryParams?: {
267
- readonly [x: string]: string | readonly (string | {
268
- readonly name: string;
269
- readonly type: "variable";
270
- })[];
271
- } | undefined;
251
+ readonly kind: "apikey";
252
+ readonly placements: readonly {
253
+ readonly name: string;
254
+ readonly carrier: "header" | "query";
255
+ readonly variable?: string | undefined;
256
+ readonly prefix?: string | undefined;
257
+ readonly literal?: string | undefined;
258
+ }[];
259
+ readonly label?: string | undefined;
272
260
  } | {
273
- readonly type: "oauth";
274
261
  readonly slug: string;
262
+ readonly kind: "oauth2";
275
263
  readonly authorizationUrl: string;
276
264
  readonly tokenUrl: string;
277
265
  readonly scopes: readonly string[];
@@ -1,11 +1,14 @@
1
1
  import type { AuthMethod, Placement } from "@executor-js/react/lib/auth-placements";
2
2
  import type { AuthTemplateEditorValue } from "@executor-js/react/components/auth-template-editor";
3
- import { type APIKeyAuthentication, type Authentication } from "../sdk/types";
4
- export declare const placementsFromApiKey: (template: APIKeyAuthentication) => Placement[];
3
+ import type { APIKeyAuthentication, Authentication, AuthenticationInput } from "../sdk/types";
4
+ /** Serialize a canonical method into the wire input union (apikey the
5
+ * request-shaped dialect; oauth passes through). */
6
+ export declare const openApiWireAuthInput: (method: Authentication) => AuthenticationInput;
7
+ export declare const placementsFromApiKey: (template: APIKeyAuthentication) => readonly Placement[];
5
8
  /** Map each stored auth template to a generic `AuthMethod`. */
6
9
  export declare function authMethodsFromConfig(templates: readonly Authentication[]): AuthMethod[];
7
- /** Build an `APIKeyAuthentication` template from generic placements. When
8
- * `slug` is omitted the backend assigns a `custom_<id>` slug. */
10
+ /** Build an apikey method from generic placements. When `slug` is omitted the
11
+ * backend assigns a `custom_<id>` slug. */
9
12
  export declare function templateFromPlacements(placements: readonly Placement[], slug?: string): APIKeyAuthentication;
10
13
  /** Convert one stored `Authentication` template into a generic editor value. */
11
14
  export declare function editorValueFromAuthentication(template: Authentication): AuthTemplateEditorValue;
@@ -84,7 +84,14 @@ export declare const OpenApiClient: import("effect/unstable/reactivity/AtomHttpA
84
84
  readonly queryParams: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").String>>;
85
85
  readonly authenticationTemplate: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
86
86
  readonly slug: import("effect/Schema").String;
87
+ readonly kind: import("effect/Schema").Literal<"oauth2">;
88
+ readonly authorizationUrl: import("effect/Schema").String;
89
+ readonly tokenUrl: import("effect/Schema").String;
90
+ readonly scopes: import("effect/Schema").$Array<import("effect/Schema").String>;
91
+ }>, import("effect/Schema").Struct<{
92
+ readonly slug: import("effect/Schema").optional<import("effect/Schema").String>;
87
93
  readonly type: import("effect/Schema").Literal<"apiKey">;
94
+ readonly label: import("effect/Schema").optional<import("effect/Schema").String>;
88
95
  readonly headers: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").Struct<{
89
96
  readonly type: import("effect/Schema").Literal<"variable">;
90
97
  readonly name: import("effect/Schema").String;
@@ -93,12 +100,6 @@ export declare const OpenApiClient: import("effect/unstable/reactivity/AtomHttpA
93
100
  readonly type: import("effect/Schema").Literal<"variable">;
94
101
  readonly name: import("effect/Schema").String;
95
102
  }>]>>]>>>;
96
- }>, import("effect/Schema").Struct<{
97
- readonly slug: import("effect/Schema").String;
98
- readonly type: import("effect/Schema").Literal<"oauth">;
99
- readonly authorizationUrl: import("effect/Schema").String;
100
- readonly tokenUrl: import("effect/Schema").String;
101
- readonly scopes: import("effect/Schema").$Array<import("effect/Schema").String>;
102
103
  }>]>>>;
103
104
  }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
104
105
  readonly slug: import("effect/Schema").brand<import("effect/Schema").String, "IntegrationSlug">;
@@ -114,7 +115,6 @@ export declare const OpenApiClient: import("effect/unstable/reactivity/AtomHttpA
114
115
  }>>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/sdk").IntegrationAlreadyExistsError | typeof import("@executor-js/sdk").InternalError | typeof import("../sdk").OpenApiParseError | typeof import("../sdk").OpenApiExtractionError | typeof import("../sdk").OpenApiOAuthError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getConfig", "GET", "/openapi/integrations/:slug/config", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
115
116
  slug: import("effect/Schema").String;
116
117
  }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").NullOr<import("effect/Schema").Struct<{
117
- readonly spec: import("effect/Schema").String;
118
118
  readonly sourceUrl: import("effect/Schema").optional<import("effect/Schema").String>;
119
119
  readonly googleDiscoveryUrls: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").String>>;
120
120
  readonly baseUrl: import("effect/Schema").optional<import("effect/Schema").String>;
@@ -122,28 +122,35 @@ export declare const OpenApiClient: import("effect/unstable/reactivity/AtomHttpA
122
122
  readonly queryParams: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").String>>;
123
123
  readonly authenticationTemplate: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
124
124
  readonly slug: import("effect/Schema").String;
125
- readonly type: import("effect/Schema").Literal<"apiKey">;
126
- readonly headers: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").Struct<{
127
- readonly type: import("effect/Schema").Literal<"variable">;
128
- readonly name: import("effect/Schema").String;
129
- }>]>>]>>>;
130
- readonly queryParams: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").Struct<{
131
- readonly type: import("effect/Schema").Literal<"variable">;
132
- readonly name: import("effect/Schema").String;
133
- }>]>>]>>>;
134
- }>, import("effect/Schema").Struct<{
135
- readonly slug: import("effect/Schema").String;
136
- readonly type: import("effect/Schema").Literal<"oauth">;
125
+ readonly kind: import("effect/Schema").Literal<"oauth2">;
137
126
  readonly authorizationUrl: import("effect/Schema").String;
138
127
  readonly tokenUrl: import("effect/Schema").String;
139
128
  readonly scopes: import("effect/Schema").$Array<import("effect/Schema").String>;
129
+ }>, import("effect/Schema").Struct<{
130
+ readonly slug: import("effect/Schema").String;
131
+ readonly kind: import("effect/Schema").Literal<"apikey">;
132
+ readonly label: import("effect/Schema").optional<import("effect/Schema").String>;
133
+ readonly placements: import("effect/Schema").$Array<import("effect/Schema").Struct<{
134
+ readonly carrier: import("effect/Schema").Literals<readonly ["header", "query"]>;
135
+ readonly name: import("effect/Schema").String;
136
+ readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
137
+ readonly variable: import("effect/Schema").optional<import("effect/Schema").String>;
138
+ readonly literal: import("effect/Schema").optional<import("effect/Schema").String>;
139
+ }>>;
140
140
  }>]>>>;
141
141
  }>>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/sdk").IntegrationAlreadyExistsError | typeof import("@executor-js/sdk").InternalError | typeof import("../sdk").OpenApiParseError | typeof import("../sdk").OpenApiExtractionError | typeof import("../sdk").OpenApiOAuthError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"configure", "POST", "/openapi/integrations/:slug/config", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
142
142
  slug: import("effect/Schema").String;
143
143
  }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
144
144
  readonly authenticationTemplate: import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
145
145
  readonly slug: import("effect/Schema").String;
146
+ readonly kind: import("effect/Schema").Literal<"oauth2">;
147
+ readonly authorizationUrl: import("effect/Schema").String;
148
+ readonly tokenUrl: import("effect/Schema").String;
149
+ readonly scopes: import("effect/Schema").$Array<import("effect/Schema").String>;
150
+ }>, import("effect/Schema").Struct<{
151
+ readonly slug: import("effect/Schema").optional<import("effect/Schema").String>;
146
152
  readonly type: import("effect/Schema").Literal<"apiKey">;
153
+ readonly label: import("effect/Schema").optional<import("effect/Schema").String>;
147
154
  readonly headers: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").Struct<{
148
155
  readonly type: import("effect/Schema").Literal<"variable">;
149
156
  readonly name: import("effect/Schema").String;
@@ -152,32 +159,26 @@ export declare const OpenApiClient: import("effect/unstable/reactivity/AtomHttpA
152
159
  readonly type: import("effect/Schema").Literal<"variable">;
153
160
  readonly name: import("effect/Schema").String;
154
161
  }>]>>]>>>;
155
- }>, import("effect/Schema").Struct<{
156
- readonly slug: import("effect/Schema").String;
157
- readonly type: import("effect/Schema").Literal<"oauth">;
158
- readonly authorizationUrl: import("effect/Schema").String;
159
- readonly tokenUrl: import("effect/Schema").String;
160
- readonly scopes: import("effect/Schema").$Array<import("effect/Schema").String>;
161
162
  }>]>>;
162
163
  readonly mode: import("effect/Schema").optional<import("effect/Schema").Literals<readonly ["merge", "replace"]>>;
163
164
  }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
164
165
  readonly authenticationTemplate: import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
165
166
  readonly slug: import("effect/Schema").String;
166
- readonly type: import("effect/Schema").Literal<"apiKey">;
167
- readonly headers: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").Struct<{
168
- readonly type: import("effect/Schema").Literal<"variable">;
169
- readonly name: import("effect/Schema").String;
170
- }>]>>]>>>;
171
- readonly queryParams: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").Struct<{
172
- readonly type: import("effect/Schema").Literal<"variable">;
173
- readonly name: import("effect/Schema").String;
174
- }>]>>]>>>;
175
- }>, import("effect/Schema").Struct<{
176
- readonly slug: import("effect/Schema").String;
177
- readonly type: import("effect/Schema").Literal<"oauth">;
167
+ readonly kind: import("effect/Schema").Literal<"oauth2">;
178
168
  readonly authorizationUrl: import("effect/Schema").String;
179
169
  readonly tokenUrl: import("effect/Schema").String;
180
170
  readonly scopes: import("effect/Schema").$Array<import("effect/Schema").String>;
171
+ }>, import("effect/Schema").Struct<{
172
+ readonly slug: import("effect/Schema").String;
173
+ readonly kind: import("effect/Schema").Literal<"apikey">;
174
+ readonly label: import("effect/Schema").optional<import("effect/Schema").String>;
175
+ readonly placements: import("effect/Schema").$Array<import("effect/Schema").Struct<{
176
+ readonly carrier: import("effect/Schema").Literals<readonly ["header", "query"]>;
177
+ readonly name: import("effect/Schema").String;
178
+ readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
179
+ readonly variable: import("effect/Schema").optional<import("effect/Schema").String>;
180
+ readonly literal: import("effect/Schema").optional<import("effect/Schema").String>;
181
+ }>>;
181
182
  }>]>>;
182
183
  }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/sdk").IntegrationAlreadyExistsError | typeof import("@executor-js/sdk").InternalError | typeof import("../sdk").OpenApiParseError | typeof import("../sdk").OpenApiExtractionError | typeof import("../sdk").OpenApiOAuthError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"removeSpec", "DELETE", "/openapi/integrations/:slug", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
183
184
  slug: import("effect/Schema").String;
@@ -2,30 +2,31 @@ import { Schema } from "effect";
2
2
  import type { Authentication } from "./types";
3
3
  export declare const AuthenticationSchema: Schema.Union<readonly [Schema.Struct<{
4
4
  readonly slug: Schema.String;
5
- readonly type: Schema.Literal<"oauth">;
5
+ readonly kind: Schema.Literal<"oauth2">;
6
6
  readonly authorizationUrl: Schema.String;
7
7
  readonly tokenUrl: Schema.String;
8
8
  readonly scopes: Schema.$Array<Schema.String>;
9
9
  }>, Schema.Struct<{
10
10
  readonly slug: Schema.String;
11
- readonly type: Schema.Literal<"apiKey">;
12
- readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Struct<{
13
- readonly type: Schema.Literal<"variable">;
11
+ readonly kind: Schema.Literal<"apikey">;
12
+ readonly label: Schema.optional<Schema.String>;
13
+ readonly placements: Schema.$Array<Schema.Struct<{
14
+ readonly carrier: Schema.Literals<readonly ["header", "query"]>;
14
15
  readonly name: Schema.String;
15
- }>]>>]>>>;
16
- readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Struct<{
17
- readonly type: Schema.Literal<"variable">;
18
- readonly name: Schema.String;
19
- }>]>>]>>>;
16
+ readonly prefix: Schema.optional<Schema.String>;
17
+ readonly variable: Schema.optional<Schema.String>;
18
+ readonly literal: Schema.optional<Schema.String>;
19
+ }>>;
20
20
  }>]>;
21
21
  export declare const OpenApiIntegrationConfigSchema: Schema.Struct<{
22
- /** Inlined OpenAPI document text (resolved + parsed source of truth). */
23
- readonly spec: Schema.String;
22
+ /** Hex SHA-256 of the resolved spec text the content address of the spec
23
+ * blob (`spec/<hash>` in the plugin blob store). */
24
+ readonly specHash: Schema.optional<Schema.String>;
24
25
  /** Origin URL the spec was fetched from, when known. Enables refresh. */
25
26
  readonly sourceUrl: Schema.optional<Schema.String>;
26
27
  /** Google Discovery bundle URLs, when the spec came from a Google bundle. */
27
28
  readonly googleDiscoveryUrls: Schema.optional<Schema.$Array<Schema.String>>;
28
- /** Base URL override; falls back to the spec's first server. */
29
+ /** Optional base URL override. */
29
30
  readonly baseUrl: Schema.optional<Schema.String>;
30
31
  /** Static headers applied to every request (no secret material). */
31
32
  readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
@@ -34,21 +35,21 @@ export declare const OpenApiIntegrationConfigSchema: Schema.Struct<{
34
35
  /** The auth methods a connection's value can be applied through. */
35
36
  readonly authenticationTemplate: Schema.optional<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
36
37
  readonly slug: Schema.String;
37
- readonly type: Schema.Literal<"oauth">;
38
+ readonly kind: Schema.Literal<"oauth2">;
38
39
  readonly authorizationUrl: Schema.String;
39
40
  readonly tokenUrl: Schema.String;
40
41
  readonly scopes: Schema.$Array<Schema.String>;
41
42
  }>, Schema.Struct<{
42
43
  readonly slug: Schema.String;
43
- readonly type: Schema.Literal<"apiKey">;
44
- readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Struct<{
45
- readonly type: Schema.Literal<"variable">;
46
- readonly name: Schema.String;
47
- }>]>>]>>>;
48
- readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Struct<{
49
- readonly type: Schema.Literal<"variable">;
44
+ readonly kind: Schema.Literal<"apikey">;
45
+ readonly label: Schema.optional<Schema.String>;
46
+ readonly placements: Schema.$Array<Schema.Struct<{
47
+ readonly carrier: Schema.Literals<readonly ["header", "query"]>;
50
48
  readonly name: Schema.String;
51
- }>]>>]>>>;
49
+ readonly prefix: Schema.optional<Schema.String>;
50
+ readonly variable: Schema.optional<Schema.String>;
51
+ readonly literal: Schema.optional<Schema.String>;
52
+ }>>;
52
53
  }>]>>>;
53
54
  }>;
54
55
  export type OpenApiIntegrationConfig = Omit<typeof OpenApiIntegrationConfigSchema.Type, "authenticationTemplate"> & {
@@ -64,12 +65,11 @@ export interface RenderedAuth {
64
65
  readonly queryParams: Record<string, string>;
65
66
  }
66
67
  /** Render an auth template against a connection's resolved input `values`
67
- * (`variable → value`). For an apiKey template, each `variable("<name>")` is
68
- * substituted from its own entry, so a method with two distinct inputs (e.g.
69
- * Datadog) fills each header from a different value. For an oauth template (no
70
- * explicit placement), render a bearer Authorization header from `token`. */
68
+ * (`variable → value`). Each placement substitutes from its own entry, so a
69
+ * method with two distinct inputs (e.g. Datadog) fills each header from a
70
+ * different value. */
71
71
  export declare const renderAuthTemplate: (template: Authentication, values: Record<string, string | null>) => RenderedAuth;
72
72
  /** The distinct input variables a template references — the inputs a connection
73
- * must supply. An oauth template needs `token`; an apiKey template needs every
74
- * `variable("<name>")` across its placements. */
73
+ * must supply. An oauth template needs `token`; an apiKey method needs every
74
+ * variable across its placements. */
75
75
  export declare const requiredTemplateVariables: (template: Authentication) => readonly string[];
@@ -0,0 +1,9 @@
1
+ import type { HeaderPreset, OAuth2Preset, SpecPreview } from "./preview";
2
+ import type { Authentication } from "./types";
3
+ export declare function resolveOAuthUrl(url: string, baseUrl: string): string;
4
+ export declare const resolvedOAuthScopes: (apiScopes: Iterable<string>, identityScopes: OAuth2Preset["identityScopes"]) => string[];
5
+ export declare const detectedAuthenticationTemplates: (headerPresets: readonly HeaderPreset[], oauth2Presets: readonly OAuth2Preset[], baseUrl: string) => readonly Authentication[];
6
+ export declare const firstBaseUrlForPreview: (preview: SpecPreview) => string;
7
+ /** The fallback `addSpec` uses when no explicit template was passed: every
8
+ * spec-detected method, resolved against the integration's base URL. */
9
+ export declare const deriveAuthenticationTemplateFromPreview: (preview: SpecPreview, baseUrl: string | undefined) => readonly Authentication[];
@@ -11,6 +11,17 @@ export declare const extract: (doc: ParsedDocument) => Effect.Effect<{
11
11
  readonly method: "post" | "options" | "delete" | "get" | "put" | "patch" | "head" | "trace";
12
12
  readonly deprecated: boolean;
13
13
  readonly toolPath: Option.Option<string>;
14
+ readonly servers: readonly {
15
+ readonly description: Option.Option<string>;
16
+ readonly url: string;
17
+ readonly variables: Option.Option<{
18
+ readonly [x: string]: {
19
+ readonly default: string;
20
+ readonly description: Option.Option<string>;
21
+ readonly enum: Option.Option<readonly string[]>;
22
+ };
23
+ }>;
24
+ }[];
14
25
  readonly summary: Option.Option<string>;
15
26
  readonly tags: readonly string[];
16
27
  readonly parameters: readonly {
@@ -42,7 +53,6 @@ export declare const extract: (doc: ParsedDocument) => Effect.Effect<{
42
53
  }>;
43
54
  readonly operationId: string & import("effect/Brand").Brand<"OperationId">;
44
55
  readonly pathTemplate: string;
45
- readonly baseUrl?: string | undefined;
46
56
  }[];
47
57
  readonly title: Option.Option<string>;
48
58
  readonly servers: readonly {
@@ -6,6 +6,10 @@ export { openApiPlugin, type OpenApiSpecConfig, type OpenApiConfigureInput, type
6
6
  export { type OpenapiStore, type StoredOperation, makeDefaultOpenapiStore } from "./store";
7
7
  export { decodeOpenApiIntegrationConfig, renderAuthTemplate, AuthenticationSchema, OpenApiIntegrationConfigSchema, type OpenApiIntegrationConfig, type RenderedAuth, } from "./config";
8
8
  export { previewSpec, SecurityScheme, AuthStrategy, HeaderPreset, OAuth2Preset, OAuth2Flows, OAuth2AuthorizationCodeFlow, OAuth2ClientCredentialsFlow, PreviewOperation, SpecPreview, } from "./preview";
9
- export { DocResolver, resolveBaseUrl, substituteUrlVariables, preferredContent, } from "./openapi-utils";
9
+ export { DocResolver, resolveServerUrl, substituteUrlVariables, preferredContent, } from "./openapi-utils";
10
10
  export { OpenApiParseError, OpenApiExtractionError, OpenApiInvocationError, OpenApiOAuthError, OpenApiAuthRequiredError, } from "./errors";
11
- export { EncodingObject, ExtractedOperation, ExtractionResult, InvocationResult, MediaBinding, OperationBinding, OperationParameter, OperationRequestBody, ServerInfo, ServerVariable, OperationId, HttpMethod, ParameterLocation, variable, type Authentication, type APIKeyAuthentication, type AuthenticationVariable, type AuthenticationTemplateValue, } from "./types";
11
+ export { EncodingObject, ExtractedOperation, ExtractionResult, InvocationResult, MediaBinding, OperationBinding, OperationParameter, OperationRequestBody, ServerInfo, ServerVariable, OperationId, HttpMethod, ParameterLocation, TOKEN_VARIABLE, normalizeOpenApiAuthInputs, type Authentication, type AuthenticationInput, type APIKeyAuthentication, } from "./types";
12
+ export { variable, type ApiKeyAuthTemplate } from "@executor-js/sdk/http-auth";
13
+ export { migrateOpenApiAuthConfig } from "./migrate-config";
14
+ export { openApiOutputSchemaDataMigration, runSqliteOpenApiOutputSchemaMigration, unwrapOpenApiTransportEnvelope, } from "./output-schema-migration";
15
+ export { openApiSpecBlobDataMigration } from "./spec-blob-migration";
@@ -32,7 +32,17 @@ export declare const invoke: (operation: {
32
32
  }[]>;
33
33
  }>;
34
34
  readonly pathTemplate: string;
35
- readonly baseUrl?: string | undefined;
35
+ readonly servers?: readonly {
36
+ readonly description: Option.Option<string>;
37
+ readonly url: string;
38
+ readonly variables: Option.Option<{
39
+ readonly [x: string]: {
40
+ readonly default: string;
41
+ readonly description: Option.Option<string>;
42
+ readonly enum: Option.Option<readonly string[]>;
43
+ };
44
+ }>;
45
+ }[] | undefined;
36
46
  }, args: Record<string, unknown>, resolvedHeaders: Record<string, string>, sourceQueryParams?: Record<string, string> | undefined) => Effect.Effect<{
37
47
  readonly error: unknown;
38
48
  readonly data: unknown;
@@ -0,0 +1,4 @@
1
+ /** Rewrite a stored OpenAPI integration config blob into the canonical shape.
2
+ * Returns the rewritten config, or `null` when no rewrite is needed (already
3
+ * canonical, no auth templates, or not this plugin's shape). Idempotent. */
4
+ export declare const migrateOpenApiAuthConfig: (config: unknown) => unknown | null;
@@ -0,0 +1 @@
1
+ export {};
@@ -17,13 +17,10 @@ export declare class DocResolver {
17
17
  }
18
18
  /** Substitute `{var}` placeholders in a templated URL using a plain map. */
19
19
  export declare const substituteUrlVariables: (url: string, values: Record<string, string>) => string;
20
- export declare const OPENAPI_MAX_SERVER_VARIABLE_OPTIONS = 64;
21
- type ServerLike = {
22
- url: string;
23
- variables: import("effect/Option").Option<Record<string, ServerVariable | string>>;
24
- };
25
- export declare const expandServerUrlOptions: (server: ServerLike, limit?: number) => readonly string[];
26
- export declare const resolveBaseUrl: (servers: readonly ServerLike[]) => string;
20
+ /** Resolve a templated server URL, filling each `{var}` from `overrides` when
21
+ * non-empty, otherwise the variable's spec default. URLs without placeholders
22
+ * pass through unchanged. */
23
+ export declare const resolveServerUrl: (templateUrl: string, variables: Record<string, ServerVariable> | undefined, overrides: Record<string, string>) => string;
27
24
  /**
28
25
  * Return all declared media entries in spec order. `Object.entries` on a
29
26
  * plain object preserves insertion order in modern engines, which matches
@@ -54,4 +51,3 @@ export declare const preferredResponseContent: (content: Record<string, MediaTyp
54
51
  mediaType: string;
55
52
  media: MediaTypeObject;
56
53
  } | undefined;
57
- export {};
@@ -0,0 +1,21 @@
1
+ import { Effect } from "effect";
2
+ import { DataMigrationError, type SqliteDataMigrationClient } from "@executor-js/sdk/core";
3
+ /**
4
+ * If `schema` is the retired transport envelope, return the payload schema
5
+ * to persist instead (`null` when the envelope carried an empty `{}` data
6
+ * schema — the new producer persists no output schema for those). Returns
7
+ * undefined when the schema is not an envelope and the row must be left
8
+ * untouched.
9
+ */
10
+ export declare const unwrapOpenApiTransportEnvelope: (schema: unknown) => {
11
+ readonly outputSchema: unknown | null;
12
+ } | undefined;
13
+ /** Unwrap envelope-shaped openapi tool output schemas in a SQLite database.
14
+ * Returns the number of rows rewritten. The `tool` table may not exist yet
15
+ * on a fresh database — that counts as nothing to migrate. */
16
+ export declare const runSqliteOpenApiOutputSchemaMigration: (client: SqliteDataMigrationClient) => Effect.Effect<number, DataMigrationError>;
17
+ /** Registry entry for the boot-time data-migration ledger. */
18
+ export declare const openApiOutputSchemaDataMigration: {
19
+ name: string;
20
+ run: (client: SqliteDataMigrationClient) => Effect.Effect<void, DataMigrationError, never>;
21
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -7,6 +7,7 @@ import { OpenApiExtractionError, OpenApiOAuthError, OpenApiParseError } from "./
7
7
  import { type SpecPreview } from "./preview";
8
8
  import { type OpenapiStore } from "./store";
9
9
  import type { Authentication } from "./types";
10
+ import { type AuthenticationInput } from "./types";
10
11
  export type OpenApiSpecInput = typeof OpenApiSpecInputSchema.Type;
11
12
  export interface OpenApiPreviewInput {
12
13
  readonly spec: string;
@@ -25,8 +26,9 @@ export interface OpenApiSpecConfig {
25
26
  readonly headers?: Record<string, string>;
26
27
  /** Static query params applied to every request. */
27
28
  readonly queryParams?: Record<string, string>;
28
- /** Auth methods a connection's value renders through. */
29
- readonly authenticationTemplate?: readonly Authentication[];
29
+ /** Auth methods a connection's value renders through — canonical
30
+ * placements or the request-shaped authoring dialect. */
31
+ readonly authenticationTemplate?: readonly AuthenticationInput[];
30
32
  }
31
33
  export interface OpenApiExtensionFailure {
32
34
  readonly _tag: string;
@@ -38,7 +40,7 @@ export interface OpenApiConfigureInput {
38
40
  * already exists, replaces) the integration's existing template array. A
39
41
  * custom apiKey method with no `slug` is assigned a generated `custom_<id>`
40
42
  * slug that is collision-checked against the existing template. */
41
- readonly authenticationTemplate: readonly Authentication[];
43
+ readonly authenticationTemplate: readonly AuthenticationInput[];
42
44
  readonly mode?: "merge" | "replace";
43
45
  }
44
46
  export interface OpenApiPluginExtension {
@@ -88,7 +90,6 @@ export declare const openApiPlugin: import("@executor-js/sdk/core").ConfiguredPl
88
90
  readonly operationId: string;
89
91
  }[];
90
92
  readonly title: Option.Option<string>;
91
- readonly tags: readonly string[];
92
93
  readonly servers: readonly {
93
94
  readonly description: Option.Option<string>;
94
95
  readonly url: string;
@@ -100,6 +101,7 @@ export declare const openApiPlugin: import("@executor-js/sdk/core").ConfiguredPl
100
101
  };
101
102
  }>;
102
103
  }[];
104
+ readonly tags: readonly string[];
103
105
  readonly securitySchemes: readonly {
104
106
  readonly name: string;
105
107
  readonly type: "oauth2" | "http" | "apiKey" | "openIdConnect";