@executor-js/plugin-openapi 0.0.1 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -23
- package/dist/api/group.d.ts +94 -38
- package/dist/api/handlers.d.ts +2 -2
- package/dist/chunk-RBE3CVB4.js +2837 -0
- package/dist/chunk-RBE3CVB4.js.map +1 -0
- package/dist/core.js +44 -50
- package/dist/core.js.map +1 -1
- package/dist/index.js +2 -5
- package/dist/index.js.map +1 -1
- package/dist/react/AddOpenApiSource.d.ts +13 -0
- package/dist/react/EditOpenApiSource.d.ts +2 -2
- package/dist/react/OpenApiSourceSummary.d.ts +3 -1
- package/dist/react/atoms.d.ts +129 -0
- package/dist/react/client.d.ts +88 -3
- package/dist/react/plugin-client.d.ts +2 -0
- package/dist/react/source-plugin.d.ts +1 -1
- package/dist/sdk/client-credentials-oauth.test.d.ts +1 -0
- package/dist/sdk/credential-status.d.ts +23 -0
- package/dist/sdk/credential-status.test.d.ts +1 -0
- package/dist/sdk/errors.d.ts +11 -10
- package/dist/sdk/form-urlencoded-body.test.d.ts +1 -0
- package/dist/sdk/index.d.ts +8 -10
- package/dist/sdk/invoke.d.ts +8 -17
- package/dist/sdk/multi-scope-bearer.test.d.ts +1 -0
- package/dist/sdk/multi-scope-oauth.test.d.ts +1 -0
- package/dist/sdk/non-json-body.test.d.ts +1 -0
- package/dist/sdk/oauth-refresh.test.d.ts +1 -0
- package/dist/sdk/openapi-utils.d.ts +35 -4
- package/dist/sdk/parse.d.ts +28 -4
- package/dist/sdk/plugin.d.ts +278 -23
- package/dist/sdk/preview-oauth2.test.d.ts +1 -0
- package/dist/sdk/preview.d.ts +86 -161
- package/dist/sdk/store.d.ts +201 -0
- package/dist/sdk/types.d.ts +234 -266
- package/dist/sdk/upstream-failures.test.d.ts +1 -0
- package/package.json +11 -22
- package/dist/chunk-KPGROAQO.js +0 -1279
- package/dist/chunk-KPGROAQO.js.map +0 -1
- package/dist/promise.d.ts +0 -6
- package/dist/sdk/config-file-store.d.ts +0 -10
- package/dist/sdk/kv-operation-store.d.ts +0 -4
- package/dist/sdk/operation-store.d.ts +0 -36
- package/dist/sdk/stored-source.d.ts +0 -51
package/dist/core.js
CHANGED
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AuthStrategy,
|
|
3
3
|
DocResolver,
|
|
4
|
+
EncodingObject,
|
|
4
5
|
ExtractedOperation,
|
|
5
6
|
ExtractionResult,
|
|
6
7
|
HeaderPreset,
|
|
7
8
|
HttpMethod,
|
|
8
9
|
InvocationConfig,
|
|
9
10
|
InvocationResult,
|
|
11
|
+
MediaBinding,
|
|
12
|
+
OAuth2Auth,
|
|
13
|
+
OAuth2AuthorizationCodeFlow,
|
|
14
|
+
OAuth2ClientCredentialsFlow,
|
|
15
|
+
OAuth2Flows,
|
|
16
|
+
OAuth2Preset,
|
|
17
|
+
OAuth2SourceConfig,
|
|
10
18
|
OpenApiExtractionError,
|
|
11
19
|
OpenApiInvocationError,
|
|
20
|
+
OpenApiOAuthError,
|
|
12
21
|
OpenApiParseError,
|
|
22
|
+
OpenApiSourceBindingInput,
|
|
23
|
+
OpenApiSourceBindingRef,
|
|
24
|
+
OpenApiSourceBindingValue,
|
|
13
25
|
OperationBinding,
|
|
14
26
|
OperationId,
|
|
15
27
|
OperationParameter,
|
|
@@ -18,71 +30,48 @@ import {
|
|
|
18
30
|
PreviewOperation,
|
|
19
31
|
SecurityScheme,
|
|
20
32
|
ServerInfo,
|
|
33
|
+
ServerVariable,
|
|
21
34
|
SpecPreview,
|
|
35
|
+
annotationsForOperation,
|
|
22
36
|
extract,
|
|
37
|
+
fetchSpecText,
|
|
23
38
|
invoke,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
makeOpenApiInvoker,
|
|
39
|
+
invokeWithLayer,
|
|
40
|
+
makeDefaultOpenapiStore,
|
|
27
41
|
openApiPlugin,
|
|
42
|
+
openapiSchema,
|
|
28
43
|
parse,
|
|
29
44
|
preferredContent,
|
|
30
45
|
previewSpec,
|
|
31
|
-
resolveBaseUrl
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
import { addSourceToConfig, removeSourceFromConfig, SECRET_REF_PREFIX } from "@executor/config";
|
|
37
|
-
var translateSecretHeaders = (headers) => {
|
|
38
|
-
if (!headers) return void 0;
|
|
39
|
-
const result = {};
|
|
40
|
-
for (const [key, value] of Object.entries(headers)) {
|
|
41
|
-
if (typeof value === "string") {
|
|
42
|
-
result[key] = value;
|
|
43
|
-
continue;
|
|
44
|
-
}
|
|
45
|
-
const ref = `${SECRET_REF_PREFIX}${value.secretId}`;
|
|
46
|
-
result[key] = value.prefix ? { value: ref, prefix: value.prefix } : ref;
|
|
47
|
-
}
|
|
48
|
-
return result;
|
|
49
|
-
};
|
|
50
|
-
var toSourceConfig = (source) => ({
|
|
51
|
-
kind: "openapi",
|
|
52
|
-
spec: source.config.spec,
|
|
53
|
-
baseUrl: source.config.baseUrl,
|
|
54
|
-
namespace: source.namespace,
|
|
55
|
-
headers: translateSecretHeaders(source.config.headers)
|
|
56
|
-
});
|
|
57
|
-
var withConfigFile = (inner, configPath, fsLayer) => ({
|
|
58
|
-
...inner,
|
|
59
|
-
putSource: (source) => Effect.gen(function* () {
|
|
60
|
-
yield* inner.putSource(source);
|
|
61
|
-
yield* addSourceToConfig(configPath, toSourceConfig(source)).pipe(
|
|
62
|
-
Effect.provide(fsLayer),
|
|
63
|
-
Effect.catchAll(() => Effect.void)
|
|
64
|
-
);
|
|
65
|
-
}),
|
|
66
|
-
removeSource: (namespace) => Effect.gen(function* () {
|
|
67
|
-
yield* inner.removeSource(namespace);
|
|
68
|
-
yield* removeSourceFromConfig(configPath, namespace).pipe(
|
|
69
|
-
Effect.provide(fsLayer),
|
|
70
|
-
Effect.catchAll(() => Effect.void)
|
|
71
|
-
);
|
|
72
|
-
})
|
|
73
|
-
});
|
|
46
|
+
resolveBaseUrl,
|
|
47
|
+
resolveHeaders,
|
|
48
|
+
resolveSpecText,
|
|
49
|
+
substituteUrlVariables
|
|
50
|
+
} from "./chunk-RBE3CVB4.js";
|
|
74
51
|
export {
|
|
75
52
|
AuthStrategy,
|
|
76
53
|
DocResolver,
|
|
54
|
+
EncodingObject,
|
|
77
55
|
ExtractedOperation,
|
|
78
56
|
ExtractionResult,
|
|
79
57
|
HeaderPreset,
|
|
80
58
|
HttpMethod,
|
|
81
59
|
InvocationConfig,
|
|
82
60
|
InvocationResult,
|
|
61
|
+
MediaBinding,
|
|
62
|
+
OAuth2Auth,
|
|
63
|
+
OAuth2AuthorizationCodeFlow,
|
|
64
|
+
OAuth2ClientCredentialsFlow,
|
|
65
|
+
OAuth2Flows,
|
|
66
|
+
OAuth2Preset,
|
|
67
|
+
OAuth2SourceConfig,
|
|
83
68
|
OpenApiExtractionError,
|
|
84
69
|
OpenApiInvocationError,
|
|
70
|
+
OpenApiOAuthError,
|
|
85
71
|
OpenApiParseError,
|
|
72
|
+
OpenApiSourceBindingInput,
|
|
73
|
+
OpenApiSourceBindingRef,
|
|
74
|
+
OpenApiSourceBindingValue,
|
|
86
75
|
OperationBinding,
|
|
87
76
|
OperationId,
|
|
88
77
|
OperationParameter,
|
|
@@ -91,17 +80,22 @@ export {
|
|
|
91
80
|
PreviewOperation,
|
|
92
81
|
SecurityScheme,
|
|
93
82
|
ServerInfo,
|
|
83
|
+
ServerVariable,
|
|
94
84
|
SpecPreview,
|
|
85
|
+
annotationsForOperation,
|
|
95
86
|
extract,
|
|
87
|
+
fetchSpecText,
|
|
96
88
|
invoke,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
makeOpenApiInvoker,
|
|
89
|
+
invokeWithLayer,
|
|
90
|
+
makeDefaultOpenapiStore,
|
|
100
91
|
openApiPlugin,
|
|
92
|
+
openapiSchema,
|
|
101
93
|
parse,
|
|
102
94
|
preferredContent,
|
|
103
95
|
previewSpec,
|
|
104
96
|
resolveBaseUrl,
|
|
105
|
-
|
|
97
|
+
resolveHeaders,
|
|
98
|
+
resolveSpecText,
|
|
99
|
+
substituteUrlVariables
|
|
106
100
|
};
|
|
107
101
|
//# sourceMappingURL=core.js.map
|
package/dist/core.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
openApiPlugin
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
|
|
5
|
-
// src/promise.ts
|
|
6
|
-
var openApiPlugin2 = (options) => openApiPlugin(options);
|
|
3
|
+
} from "./chunk-RBE3CVB4.js";
|
|
7
4
|
export {
|
|
8
|
-
|
|
5
|
+
openApiPlugin
|
|
9
6
|
};
|
|
10
7
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
import type { OAuth2Preset } from "../sdk/preview";
|
|
2
|
+
export declare const OPENAPI_OAUTH_POPUP_NAME = "openapi-oauth";
|
|
3
|
+
export declare const OPENAPI_OAUTH_CALLBACK_PATH = "/api/oauth/callback";
|
|
4
|
+
export declare const openApiOAuthConnectionId: (namespaceSlug: string, flow: OAuth2Preset["flow"]) => string;
|
|
5
|
+
/**
|
|
6
|
+
* OpenAPI 3.x requires OAuth2 tokenUrl/authorizationUrl to be absolute,
|
|
7
|
+
* but some specs ship relative paths like `/api/rest/v1/oauth/token`.
|
|
8
|
+
* Resolve them against the source's chosen baseUrl so the backend can
|
|
9
|
+
* fetch them directly and the absolute URL is what gets persisted on
|
|
10
|
+
* OAuth2Auth.
|
|
11
|
+
*/
|
|
12
|
+
export declare function resolveOAuthUrl(url: string, baseUrl: string): string;
|
|
13
|
+
export declare function inferOAuthIssuerUrl(authorizationUrl: string): string | null;
|
|
1
14
|
export default function AddOpenApiSource(props: {
|
|
2
15
|
onComplete: () => void;
|
|
3
16
|
onCancel: () => void;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import type { ScopeId } from "@executor-js/sdk/core";
|
|
2
|
+
export declare const openApiSourceAtom: (scopeId: ScopeId, namespace: string) => import("effect/unstable/reactivity/Atom").Atom<import("effect/unstable/reactivity/AsyncResult").AsyncResult<import("../sdk/store").StoredSourceSchema | null, import("@executor-js/api").InternalError | import("../sdk").OpenApiParseError | import("../sdk").OpenApiExtractionError | import("../sdk").OpenApiOAuthError>>;
|
|
3
|
+
export declare const openApiSourceBindingsAtom: (scopeId: ScopeId, namespace: string, sourceScopeId: ScopeId) => import("effect/unstable/reactivity/Atom").Atom<import("effect/unstable/reactivity/AsyncResult").AsyncResult<readonly import("../sdk").OpenApiSourceBindingRef[], import("@executor-js/api").InternalError | import("../sdk").OpenApiParseError | import("../sdk").OpenApiExtractionError | import("../sdk").OpenApiOAuthError>>;
|
|
4
|
+
export declare const previewOpenApiSpec: import("effect/unstable/reactivity/Atom").AtomResultFn<{
|
|
5
|
+
readonly params: {
|
|
6
|
+
readonly scopeId: string & import("effect/Brand").Brand<"ScopeId">;
|
|
7
|
+
};
|
|
8
|
+
readonly payload: {
|
|
9
|
+
readonly spec: string;
|
|
10
|
+
readonly specFetchCredentials?: {
|
|
11
|
+
readonly headers?: {
|
|
12
|
+
readonly [x: string]: string | {
|
|
13
|
+
readonly secretId: string;
|
|
14
|
+
readonly prefix?: string | undefined;
|
|
15
|
+
};
|
|
16
|
+
} | undefined;
|
|
17
|
+
readonly queryParams?: {
|
|
18
|
+
readonly [x: string]: string | {
|
|
19
|
+
readonly secretId: string;
|
|
20
|
+
readonly prefix?: string | undefined;
|
|
21
|
+
};
|
|
22
|
+
} | undefined;
|
|
23
|
+
} | undefined;
|
|
24
|
+
};
|
|
25
|
+
readonly responseMode?: "decoded-only" | undefined;
|
|
26
|
+
readonly reactivityKeys?: readonly unknown[] | import("effect/Record").ReadonlyRecord<string, readonly unknown[]> | undefined;
|
|
27
|
+
}, import("../sdk").SpecPreview, import("@executor-js/api").InternalError | import("../sdk").OpenApiParseError | import("../sdk").OpenApiExtractionError | import("../sdk").OpenApiOAuthError>;
|
|
28
|
+
export declare const addOpenApiSpec: import("effect/unstable/reactivity/Atom").AtomResultFn<{
|
|
29
|
+
readonly params: {
|
|
30
|
+
readonly scopeId: string & import("effect/Brand").Brand<"ScopeId">;
|
|
31
|
+
};
|
|
32
|
+
readonly payload: {
|
|
33
|
+
readonly spec: string;
|
|
34
|
+
readonly name?: string | undefined;
|
|
35
|
+
readonly namespace?: string | undefined;
|
|
36
|
+
readonly oauth2?: import("../sdk").OAuth2Auth | import("../sdk").OAuth2SourceConfig | undefined;
|
|
37
|
+
readonly headers?: {
|
|
38
|
+
readonly [x: string]: unknown;
|
|
39
|
+
} | undefined;
|
|
40
|
+
readonly queryParams?: {
|
|
41
|
+
readonly [x: string]: string | {
|
|
42
|
+
readonly secretId: string;
|
|
43
|
+
readonly prefix?: string | undefined;
|
|
44
|
+
};
|
|
45
|
+
} | undefined;
|
|
46
|
+
readonly baseUrl?: string | undefined;
|
|
47
|
+
readonly specFetchCredentials?: {
|
|
48
|
+
readonly headers?: {
|
|
49
|
+
readonly [x: string]: string | {
|
|
50
|
+
readonly secretId: string;
|
|
51
|
+
readonly prefix?: string | undefined;
|
|
52
|
+
};
|
|
53
|
+
} | undefined;
|
|
54
|
+
readonly queryParams?: {
|
|
55
|
+
readonly [x: string]: string | {
|
|
56
|
+
readonly secretId: string;
|
|
57
|
+
readonly prefix?: string | undefined;
|
|
58
|
+
};
|
|
59
|
+
} | undefined;
|
|
60
|
+
} | undefined;
|
|
61
|
+
};
|
|
62
|
+
readonly responseMode?: "decoded-only" | undefined;
|
|
63
|
+
readonly reactivityKeys?: readonly unknown[] | import("effect/Record").ReadonlyRecord<string, readonly unknown[]> | undefined;
|
|
64
|
+
}, {
|
|
65
|
+
readonly namespace: string;
|
|
66
|
+
readonly toolCount: number;
|
|
67
|
+
}, import("@executor-js/api").InternalError | import("../sdk").OpenApiParseError | import("../sdk").OpenApiExtractionError | import("../sdk").OpenApiOAuthError>;
|
|
68
|
+
export declare const updateOpenApiSource: import("effect/unstable/reactivity/Atom").AtomResultFn<{
|
|
69
|
+
readonly params: {
|
|
70
|
+
readonly namespace: string;
|
|
71
|
+
readonly scopeId: string & import("effect/Brand").Brand<"ScopeId">;
|
|
72
|
+
};
|
|
73
|
+
readonly payload: {
|
|
74
|
+
readonly name?: string | undefined;
|
|
75
|
+
readonly oauth2?: import("../sdk").OAuth2Auth | import("../sdk").OAuth2SourceConfig | undefined;
|
|
76
|
+
readonly headers?: {
|
|
77
|
+
readonly [x: string]: unknown;
|
|
78
|
+
} | undefined;
|
|
79
|
+
readonly queryParams?: {
|
|
80
|
+
readonly [x: string]: string | {
|
|
81
|
+
readonly secretId: string;
|
|
82
|
+
readonly prefix?: string | undefined;
|
|
83
|
+
};
|
|
84
|
+
} | undefined;
|
|
85
|
+
readonly baseUrl?: string | undefined;
|
|
86
|
+
};
|
|
87
|
+
readonly responseMode?: "decoded-only" | undefined;
|
|
88
|
+
readonly reactivityKeys?: readonly unknown[] | import("effect/Record").ReadonlyRecord<string, readonly unknown[]> | undefined;
|
|
89
|
+
}, {
|
|
90
|
+
readonly updated: boolean;
|
|
91
|
+
}, import("@executor-js/api").InternalError | import("../sdk").OpenApiParseError | import("../sdk").OpenApiExtractionError | import("../sdk").OpenApiOAuthError>;
|
|
92
|
+
export declare const setOpenApiSourceBinding: import("effect/unstable/reactivity/Atom").AtomResultFn<{
|
|
93
|
+
readonly params: {
|
|
94
|
+
readonly scopeId: string & import("effect/Brand").Brand<"ScopeId">;
|
|
95
|
+
};
|
|
96
|
+
readonly payload: {
|
|
97
|
+
readonly value: {
|
|
98
|
+
readonly secretId: string & import("effect/Brand").Brand<"SecretId">;
|
|
99
|
+
readonly kind: "secret";
|
|
100
|
+
} | {
|
|
101
|
+
readonly connectionId: string & import("effect/Brand").Brand<"ConnectionId">;
|
|
102
|
+
readonly kind: "connection";
|
|
103
|
+
} | {
|
|
104
|
+
readonly kind: "text";
|
|
105
|
+
readonly text: string;
|
|
106
|
+
};
|
|
107
|
+
readonly sourceId: string;
|
|
108
|
+
readonly scope: string & import("effect/Brand").Brand<"ScopeId">;
|
|
109
|
+
readonly slot: string;
|
|
110
|
+
readonly sourceScope: string & import("effect/Brand").Brand<"ScopeId">;
|
|
111
|
+
};
|
|
112
|
+
readonly responseMode?: "decoded-only" | undefined;
|
|
113
|
+
readonly reactivityKeys?: readonly unknown[] | import("effect/Record").ReadonlyRecord<string, readonly unknown[]> | undefined;
|
|
114
|
+
}, import("../sdk").OpenApiSourceBindingRef, import("@executor-js/api").InternalError | import("../sdk").OpenApiParseError | import("../sdk").OpenApiExtractionError | import("../sdk").OpenApiOAuthError>;
|
|
115
|
+
export declare const removeOpenApiSourceBinding: import("effect/unstable/reactivity/Atom").AtomResultFn<{
|
|
116
|
+
readonly params: {
|
|
117
|
+
readonly scopeId: string & import("effect/Brand").Brand<"ScopeId">;
|
|
118
|
+
};
|
|
119
|
+
readonly payload: {
|
|
120
|
+
readonly sourceId: string;
|
|
121
|
+
readonly scope: string & import("effect/Brand").Brand<"ScopeId">;
|
|
122
|
+
readonly slot: string;
|
|
123
|
+
readonly sourceScope: string & import("effect/Brand").Brand<"ScopeId">;
|
|
124
|
+
};
|
|
125
|
+
readonly responseMode?: "decoded-only" | undefined;
|
|
126
|
+
readonly reactivityKeys?: readonly unknown[] | import("effect/Record").ReadonlyRecord<string, readonly unknown[]> | undefined;
|
|
127
|
+
}, {
|
|
128
|
+
readonly removed: boolean;
|
|
129
|
+
}, import("@executor-js/api").InternalError | import("../sdk").OpenApiParseError | import("../sdk").OpenApiExtractionError | import("../sdk").OpenApiOAuthError>;
|
package/dist/react/client.d.ts
CHANGED
|
@@ -1,3 +1,88 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
export declare const OpenApiClient: import("effect/unstable/reactivity/AtomHttpApi").AtomHttpApiClient<"Plugin_openapiClient", `Plugin_${string}Client`, import("effect/unstable/httpapi/HttpApiGroup").HttpApiGroup<"openapi", import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"previewSpec", "POST", "/scopes/:scopeId/openapi/preview", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
2
|
+
scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
3
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
4
|
+
readonly spec: import("effect/Schema").String;
|
|
5
|
+
readonly specFetchCredentials: import("effect/Schema").optional<import("effect/Schema").Struct<{
|
|
6
|
+
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").Struct<{
|
|
7
|
+
readonly secretId: import("effect/Schema").String;
|
|
8
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
9
|
+
}>]>>>;
|
|
10
|
+
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").Struct<{
|
|
11
|
+
readonly secretId: import("effect/Schema").String;
|
|
12
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
13
|
+
}>]>>>;
|
|
14
|
+
}>>;
|
|
15
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("../sdk").SpecPreview>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof import("../sdk").OpenApiParseError | typeof import("../sdk").OpenApiExtractionError | typeof import("../sdk").OpenApiOAuthError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"addSpec", "POST", "/scopes/:scopeId/openapi/specs", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
16
|
+
scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
17
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
18
|
+
readonly spec: import("effect/Schema").String;
|
|
19
|
+
readonly specFetchCredentials: import("effect/Schema").optional<import("effect/Schema").Struct<{
|
|
20
|
+
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").Struct<{
|
|
21
|
+
readonly secretId: import("effect/Schema").String;
|
|
22
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
23
|
+
}>]>>>;
|
|
24
|
+
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").Struct<{
|
|
25
|
+
readonly secretId: import("effect/Schema").String;
|
|
26
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
27
|
+
}>]>>>;
|
|
28
|
+
}>>;
|
|
29
|
+
readonly name: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
30
|
+
readonly baseUrl: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
31
|
+
readonly namespace: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
32
|
+
readonly headers: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>;
|
|
33
|
+
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").Struct<{
|
|
34
|
+
readonly secretId: import("effect/Schema").String;
|
|
35
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
36
|
+
}>]>>>;
|
|
37
|
+
readonly oauth2: import("effect/Schema").optional<import("effect/Schema").Union<readonly [typeof import("../sdk").OAuth2Auth, typeof import("../sdk").OAuth2SourceConfig]>>;
|
|
38
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
39
|
+
readonly toolCount: import("effect/Schema").Number;
|
|
40
|
+
readonly namespace: import("effect/Schema").String;
|
|
41
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof import("../sdk").OpenApiParseError | typeof import("../sdk").OpenApiExtractionError | typeof import("../sdk").OpenApiOAuthError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getSource", "GET", "/scopes/:scopeId/openapi/sources/:namespace", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
42
|
+
scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
43
|
+
namespace: import("effect/Schema").String;
|
|
44
|
+
}>>, 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<typeof import("../sdk/store").StoredSourceSchema>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof import("../sdk").OpenApiParseError | typeof import("../sdk").OpenApiExtractionError | typeof import("../sdk").OpenApiOAuthError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"updateSource", "PATCH", "/scopes/:scopeId/openapi/sources/:namespace", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
45
|
+
scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
46
|
+
namespace: import("effect/Schema").String;
|
|
47
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
48
|
+
readonly name: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
49
|
+
readonly baseUrl: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
50
|
+
readonly headers: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>;
|
|
51
|
+
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").Struct<{
|
|
52
|
+
readonly secretId: import("effect/Schema").String;
|
|
53
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
54
|
+
}>]>>>;
|
|
55
|
+
readonly oauth2: import("effect/Schema").optional<import("effect/Schema").Union<readonly [typeof import("../sdk").OAuth2Auth, typeof import("../sdk").OAuth2SourceConfig]>>;
|
|
56
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
57
|
+
readonly updated: import("effect/Schema").Boolean;
|
|
58
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof import("../sdk").OpenApiParseError | typeof import("../sdk").OpenApiExtractionError | typeof import("../sdk").OpenApiOAuthError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"listSourceBindings", "GET", "/scopes/:scopeId/openapi/sources/:namespace/base/:sourceScopeId/bindings", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
59
|
+
scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
60
|
+
namespace: import("effect/Schema").String;
|
|
61
|
+
sourceScopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
62
|
+
}>>, 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").$Array<typeof import("../sdk").OpenApiSourceBindingRef>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof import("../sdk").OpenApiParseError | typeof import("../sdk").OpenApiExtractionError | typeof import("../sdk").OpenApiOAuthError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"setSourceBinding", "POST", "/scopes/:scopeId/openapi/source-bindings", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
63
|
+
scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
64
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
65
|
+
readonly sourceId: import("effect/Schema").String;
|
|
66
|
+
readonly sourceScope: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
67
|
+
readonly scope: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
68
|
+
readonly slot: import("effect/Schema").String;
|
|
69
|
+
readonly value: import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
70
|
+
readonly kind: import("effect/Schema").Literal<"secret">;
|
|
71
|
+
readonly secretId: import("effect/Schema").brand<import("effect/Schema").String, "SecretId">;
|
|
72
|
+
}>, import("effect/Schema").Struct<{
|
|
73
|
+
readonly kind: import("effect/Schema").Literal<"connection">;
|
|
74
|
+
readonly connectionId: import("effect/Schema").brand<import("effect/Schema").String, "ConnectionId">;
|
|
75
|
+
}>, import("effect/Schema").Struct<{
|
|
76
|
+
readonly kind: import("effect/Schema").Literal<"text">;
|
|
77
|
+
readonly text: import("effect/Schema").String;
|
|
78
|
+
}>]>;
|
|
79
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("../sdk").OpenApiSourceBindingRef>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof import("../sdk").OpenApiParseError | typeof import("../sdk").OpenApiExtractionError | typeof import("../sdk").OpenApiOAuthError>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"removeSourceBinding", "POST", "/scopes/:scopeId/openapi/source-bindings/remove", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
80
|
+
scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
81
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
82
|
+
readonly sourceId: import("effect/Schema").String;
|
|
83
|
+
readonly sourceScope: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
84
|
+
readonly slot: import("effect/Schema").String;
|
|
85
|
+
readonly scope: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
|
|
86
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
87
|
+
readonly removed: import("effect/Schema").Boolean;
|
|
88
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | typeof import("../sdk").OpenApiParseError | typeof import("../sdk").OpenApiExtractionError | typeof import("../sdk").OpenApiOAuthError>, never, never>, false>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { SourcePlugin } from "@executor/
|
|
1
|
+
import type { SourcePlugin } from "@executor-js/sdk/client";
|
|
2
2
|
export declare const openApiSourcePlugin: SourcePlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ConnectionId, ScopeId } from "@executor-js/sdk/core";
|
|
2
|
+
import type { ConfiguredHeaderValue, OpenApiSourceBindingValue } from "./types";
|
|
3
|
+
export type BindingRowForCredentialStatus = {
|
|
4
|
+
readonly slot: string;
|
|
5
|
+
readonly scopeId: ScopeId;
|
|
6
|
+
readonly value: OpenApiSourceBindingValue;
|
|
7
|
+
};
|
|
8
|
+
export type SourceForCredentialStatus = {
|
|
9
|
+
readonly config: {
|
|
10
|
+
readonly headers?: Record<string, ConfiguredHeaderValue>;
|
|
11
|
+
readonly oauth2?: {
|
|
12
|
+
readonly securitySchemeName: string;
|
|
13
|
+
readonly flow: "authorizationCode" | "clientCredentials";
|
|
14
|
+
readonly clientIdSlot: string;
|
|
15
|
+
readonly clientSecretSlot: string | null;
|
|
16
|
+
readonly connectionSlot: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export declare const effectiveBindingForScope: (rows: readonly BindingRowForCredentialStatus[], slot: string, targetScope: ScopeId, ranks: ReadonlyMap<string, number>) => BindingRowForCredentialStatus | null;
|
|
21
|
+
export declare function missingCredentialLabels(source: SourceForCredentialStatus, bindings: readonly BindingRowForCredentialStatus[], targetScope: ScopeId, ranks: ReadonlyMap<string, number>, options?: {
|
|
22
|
+
readonly liveConnectionIds?: ReadonlySet<string> | readonly ConnectionId[];
|
|
23
|
+
}): string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/sdk/errors.d.ts
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
import type { Option } from "effect";
|
|
3
|
-
declare const OpenApiParseError_base: Schema.
|
|
4
|
-
readonly
|
|
5
|
-
}
|
|
6
|
-
message: typeof Schema.String;
|
|
7
|
-
}>;
|
|
3
|
+
declare const OpenApiParseError_base: Schema.Class<OpenApiParseError, Schema.TaggedStruct<"OpenApiParseError", {
|
|
4
|
+
readonly message: Schema.String;
|
|
5
|
+
}>, import("effect/Cause").YieldableError>;
|
|
8
6
|
export declare class OpenApiParseError extends OpenApiParseError_base {
|
|
9
7
|
}
|
|
10
|
-
declare const OpenApiExtractionError_base: Schema.
|
|
11
|
-
readonly
|
|
12
|
-
}
|
|
13
|
-
message: typeof Schema.String;
|
|
14
|
-
}>;
|
|
8
|
+
declare const OpenApiExtractionError_base: Schema.Class<OpenApiExtractionError, Schema.TaggedStruct<"OpenApiExtractionError", {
|
|
9
|
+
readonly message: Schema.String;
|
|
10
|
+
}>, import("effect/Cause").YieldableError>;
|
|
15
11
|
export declare class OpenApiExtractionError extends OpenApiExtractionError_base {
|
|
16
12
|
}
|
|
17
13
|
declare const OpenApiInvocationError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("effect/Cause").YieldableError & {
|
|
@@ -23,4 +19,9 @@ export declare class OpenApiInvocationError extends OpenApiInvocationError_base<
|
|
|
23
19
|
readonly cause?: unknown;
|
|
24
20
|
}> {
|
|
25
21
|
}
|
|
22
|
+
declare const OpenApiOAuthError_base: Schema.Class<OpenApiOAuthError, Schema.TaggedStruct<"OpenApiOAuthError", {
|
|
23
|
+
readonly message: Schema.String;
|
|
24
|
+
}>, import("effect/Cause").YieldableError>;
|
|
25
|
+
export declare class OpenApiOAuthError extends OpenApiOAuthError_base {
|
|
26
|
+
}
|
|
26
27
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/sdk/index.d.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
export { parse } from "./parse";
|
|
1
|
+
export { parse, resolveSpecText, fetchSpecText } from "./parse";
|
|
2
2
|
export { extract } from "./extract";
|
|
3
|
-
export { invoke,
|
|
4
|
-
export { openApiPlugin, type OpenApiSpecConfig, type OpenApiPluginExtension } from "./plugin";
|
|
5
|
-
export { type
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export { OpenApiParseError, OpenApiExtractionError, OpenApiInvocationError } from "./errors";
|
|
11
|
-
export { ExtractedOperation, ExtractionResult, InvocationConfig, InvocationResult, OperationBinding, OperationParameter, OperationRequestBody, ServerInfo, OperationId, HttpMethod, ParameterLocation, } from "./types";
|
|
3
|
+
export { invoke, invokeWithLayer, resolveHeaders, annotationsForOperation } from "./invoke";
|
|
4
|
+
export { openApiPlugin, type OpenApiSpecConfig, type OpenApiPluginExtension, type OpenApiPluginOptions, type OpenApiUpdateSourceInput, } from "./plugin";
|
|
5
|
+
export { openapiSchema, type OpenapiSchema, type OpenapiStore, type StoredOperation, type StoredSource, type SourceConfig, makeDefaultOpenapiStore, } from "./store";
|
|
6
|
+
export { previewSpec, SecurityScheme, AuthStrategy, HeaderPreset, OAuth2Preset, OAuth2Flows, OAuth2AuthorizationCodeFlow, OAuth2ClientCredentialsFlow, PreviewOperation, SpecPreview, } from "./preview";
|
|
7
|
+
export { DocResolver, resolveBaseUrl, substituteUrlVariables, preferredContent, } from "./openapi-utils";
|
|
8
|
+
export { OpenApiParseError, OpenApiExtractionError, OpenApiInvocationError, OpenApiOAuthError, } from "./errors";
|
|
9
|
+
export { EncodingObject, ExtractedOperation, ExtractionResult, InvocationConfig, InvocationResult, MediaBinding, OAuth2Auth, OAuth2SourceConfig, OpenApiSourceBindingInput, OpenApiSourceBindingRef, OpenApiSourceBindingValue, OperationBinding, OperationParameter, OperationRequestBody, ServerInfo, ServerVariable, OperationId, HttpMethod, ParameterLocation, } from "./types";
|
package/dist/sdk/invoke.d.ts
CHANGED
|
@@ -1,23 +1,14 @@
|
|
|
1
1
|
import { Effect, Layer } from "effect";
|
|
2
|
-
import { HttpClient } from "
|
|
3
|
-
import
|
|
2
|
+
import { HttpClient } from "effect/unstable/http";
|
|
3
|
+
import type { SecretOwnedByConnectionError, StorageFailure } from "@executor-js/sdk/core";
|
|
4
4
|
import { OpenApiInvocationError } from "./errors";
|
|
5
|
-
import type
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
*/
|
|
5
|
+
import { type HeaderValue, type OperationBinding, InvocationResult } from "./types";
|
|
6
|
+
export declare const resolveHeaders: (headers: Record<string, HeaderValue>, secrets: {
|
|
7
|
+
readonly get: (id: string) => Effect.Effect<string | null, SecretOwnedByConnectionError | StorageFailure>;
|
|
8
|
+
}) => Effect.Effect<Record<string, string>, OpenApiInvocationError | StorageFailure>;
|
|
9
|
+
export declare const invoke: (operation: OperationBinding, args: Record<string, unknown>, resolvedHeaders: Record<string, string>, sourceQueryParams?: Record<string, string> | undefined) => Effect.Effect<InvocationResult, OpenApiInvocationError, HttpClient.HttpClient>;
|
|
10
|
+
export declare const invokeWithLayer: (operation: OperationBinding, args: Record<string, unknown>, baseUrl: string, resolvedHeaders: Record<string, string>, sourceQueryParams: Record<string, string>, httpClientLayer: Layer.Layer<HttpClient.HttpClient, never, never>) => Effect.Effect<InvocationResult, OpenApiInvocationError, never>;
|
|
12
11
|
export declare const annotationsForOperation: (method: string, pathTemplate: string) => {
|
|
13
12
|
requiresApproval?: boolean;
|
|
14
13
|
approvalDescription?: string;
|
|
15
14
|
};
|
|
16
|
-
export declare const makeOpenApiInvoker: (opts: {
|
|
17
|
-
readonly operationStore: OpenApiOperationStore;
|
|
18
|
-
readonly httpClientLayer: Layer.Layer<HttpClient.HttpClient>;
|
|
19
|
-
readonly secrets: {
|
|
20
|
-
readonly resolve: (secretId: SecretId, scopeId: ScopeId) => Effect.Effect<string, unknown>;
|
|
21
|
-
};
|
|
22
|
-
readonly scopeId: ScopeId;
|
|
23
|
-
}) => ToolInvoker;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|