@executor-js/plugin-openapi 1.5.2 → 1.5.4
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/api/group.d.ts +188 -0
- package/dist/api/handlers.d.ts +7 -0
- package/dist/api/index.d.ts +271 -0
- package/dist/react/AddOpenApiSource.d.ts +8 -0
- package/dist/react/EditOpenApiSource.d.ts +4 -0
- package/dist/react/GoogleProductPicker.d.ts +9 -0
- package/dist/react/OpenApiAccountsPanel.d.ts +6 -0
- package/dist/react/OpenApiSourceDetailsFields.d.ts +19 -0
- package/dist/react/atoms.d.ts +279 -0
- package/dist/react/auth-method-config.d.ts +15 -0
- package/dist/react/auth-method-config.test.d.ts +1 -0
- package/dist/react/client.d.ts +184 -0
- package/dist/react/index.d.ts +3 -0
- package/dist/react/plugin-client.d.ts +2 -0
- package/dist/react/source-plugin.d.ts +2 -0
- package/dist/sdk/client-credentials-oauth.test.d.ts +1 -0
- package/dist/sdk/config.d.ts +75 -0
- package/dist/sdk/configure.test.d.ts +1 -0
- package/dist/sdk/definitions.d.ts +25 -0
- package/dist/sdk/describe-auth-methods.test.d.ts +1 -0
- package/dist/sdk/errors.d.ts +44 -0
- package/dist/sdk/extract.d.ts +59 -0
- package/dist/sdk/form-urlencoded-body.test.d.ts +1 -0
- package/dist/sdk/google-bundle.test.d.ts +1 -0
- package/dist/sdk/google-discovery.d.ts +43 -0
- package/dist/sdk/google-discovery.test.d.ts +1 -0
- package/dist/sdk/google-oauth-batches.d.ts +13 -0
- package/dist/sdk/google-oauth-batches.test.d.ts +1 -0
- package/dist/sdk/google-oauth-scopes.d.ts +3 -0
- package/dist/sdk/google-oauth-scopes.test.d.ts +1 -0
- package/dist/sdk/google-presets.d.ts +16 -0
- package/dist/sdk/google-presets.test.d.ts +1 -0
- package/dist/sdk/google-product-picker-scopes.test.d.ts +1 -0
- package/dist/sdk/index.d.ts +11 -0
- package/dist/sdk/index.test.d.ts +1 -0
- package/dist/sdk/invoke.d.ts +55 -0
- 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 +57 -0
- package/dist/sdk/parse.d.ts +33 -0
- package/dist/sdk/parse.test.d.ts +1 -0
- package/dist/sdk/plugin.d.ts +163 -0
- package/dist/sdk/plugin.test.d.ts +1 -0
- package/dist/sdk/presets.d.ts +10 -0
- package/dist/sdk/preview-oauth2.test.d.ts +1 -0
- package/dist/sdk/preview.d.ts +269 -0
- package/dist/sdk/query-serialization.test.d.ts +1 -0
- package/dist/sdk/real-specs.test.d.ts +1 -0
- package/dist/sdk/store.d.ts +21 -0
- package/dist/sdk/types.d.ts +252 -0
- package/dist/sdk/upstream-failures.test.d.ts +1 -0
- package/dist/sdk/usage-scope-isolation.test.d.ts +1 -0
- package/dist/testing/index.d.ts +183 -0
- package/dist/testing.test.d.ts +1 -0
- package/package.json +17 -17
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { Context, Effect, Layer, Scope } from "effect";
|
|
2
|
+
import { HttpClient, HttpServerRequest, HttpServerResponse } from "effect/unstable/http";
|
|
3
|
+
import { HttpApi } from "effect/unstable/httpapi";
|
|
4
|
+
import { OAuthTestServer } from "@executor-js/sdk/testing";
|
|
5
|
+
import { IntegrationSlug, type Connection, type CreateConnectionInput, type Owner, type ToolAddress as ToolAddressType } from "@executor-js/sdk/core";
|
|
6
|
+
import type { OpenApiPluginExtension, OpenApiSpecConfig } from "../sdk/plugin";
|
|
7
|
+
declare const OpenApiTestServerAddressError_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 & {
|
|
8
|
+
readonly _tag: "OpenApiTestServerAddressError";
|
|
9
|
+
} & Readonly<A>;
|
|
10
|
+
export declare class OpenApiTestServerAddressError extends OpenApiTestServerAddressError_base<{
|
|
11
|
+
readonly address: unknown;
|
|
12
|
+
}> {
|
|
13
|
+
}
|
|
14
|
+
declare const OpenApiTestServerSpecError_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 & {
|
|
15
|
+
readonly _tag: "OpenApiTestServerSpecError";
|
|
16
|
+
} & Readonly<A>;
|
|
17
|
+
export declare class OpenApiTestServerSpecError extends OpenApiTestServerSpecError_base<{
|
|
18
|
+
readonly cause: unknown;
|
|
19
|
+
}> {
|
|
20
|
+
}
|
|
21
|
+
export interface OpenApiTestServerShape {
|
|
22
|
+
readonly baseUrl: string;
|
|
23
|
+
readonly specJson: string;
|
|
24
|
+
readonly httpClientLayer: Layer.Layer<HttpClient.HttpClient, never, never>;
|
|
25
|
+
}
|
|
26
|
+
export interface OpenApiHttpApiTestServerOptions {
|
|
27
|
+
readonly api: HttpApi.Any;
|
|
28
|
+
readonly handlersLayer: Layer.Layer<any, any, any>;
|
|
29
|
+
readonly specPath?: `/${string}`;
|
|
30
|
+
readonly transformSpec?: (spec: Record<string, unknown>) => Record<string, unknown>;
|
|
31
|
+
readonly captureSpecRequest?: (request: HttpServerRequest.HttpServerRequest) => Effect.Effect<void>;
|
|
32
|
+
readonly guardSpecRequest?: (request: HttpServerRequest.HttpServerRequest) => Effect.Effect<HttpServerResponse.HttpServerResponse | null>;
|
|
33
|
+
}
|
|
34
|
+
export interface OpenApiHttpApiTestServerShape extends OpenApiTestServerShape {
|
|
35
|
+
readonly specUrl: string;
|
|
36
|
+
}
|
|
37
|
+
export interface MutableOpenApiSpecTestServerShape extends OpenApiTestServerShape {
|
|
38
|
+
readonly specUrl: string;
|
|
39
|
+
readonly setApi: (api: HttpApi.Any) => Effect.Effect<void, OpenApiTestServerSpecError>;
|
|
40
|
+
readonly requestCount: Effect.Effect<number>;
|
|
41
|
+
}
|
|
42
|
+
export interface OpenApiTestRequest {
|
|
43
|
+
readonly method: string;
|
|
44
|
+
readonly url: string;
|
|
45
|
+
readonly path: string;
|
|
46
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
47
|
+
readonly body: string;
|
|
48
|
+
}
|
|
49
|
+
export interface OpenApiEchoTestServerOptions {
|
|
50
|
+
readonly transformSpec?: (spec: Record<string, unknown>) => Record<string, unknown>;
|
|
51
|
+
readonly oauth2?: {
|
|
52
|
+
readonly authorizationUrl: string;
|
|
53
|
+
readonly tokenUrl: string;
|
|
54
|
+
readonly scopes?: Readonly<Record<string, string>>;
|
|
55
|
+
readonly validateAuthorization?: (authorization: string | null) => Effect.Effect<boolean>;
|
|
56
|
+
readonly wwwAuthenticate?: string;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export interface OpenApiEchoTestServerShape extends OpenApiTestServerShape {
|
|
60
|
+
readonly specUrl: string;
|
|
61
|
+
readonly requests: Effect.Effect<readonly OpenApiTestRequest[]>;
|
|
62
|
+
readonly clearRequests: Effect.Effect<void>;
|
|
63
|
+
}
|
|
64
|
+
export type OpenApiTestSourceOptions = Omit<OpenApiSpecConfig, "spec" | "baseUrl" | "slug"> & {
|
|
65
|
+
readonly baseUrl?: string | null;
|
|
66
|
+
readonly slug?: string;
|
|
67
|
+
};
|
|
68
|
+
export type OpenApiHttpApiTestSourceOptions = Omit<OpenApiSpecConfig, "spec" | "slug" | "baseUrl"> & {
|
|
69
|
+
readonly slug?: string;
|
|
70
|
+
readonly baseUrl?: string | null;
|
|
71
|
+
readonly specBaseUrl?: string;
|
|
72
|
+
readonly transformSpec?: (spec: Record<string, unknown>) => Record<string, unknown>;
|
|
73
|
+
};
|
|
74
|
+
type OpenApiHttpApiAddSpecHeadersInput = {
|
|
75
|
+
readonly headers?: Record<string, string>;
|
|
76
|
+
readonly queryParams?: Record<string, string>;
|
|
77
|
+
};
|
|
78
|
+
export type OpenApiHttpApiTestAddSpecPayloadOptions = Omit<OpenApiHttpApiTestSourceOptions, "headers" | "queryParams"> & OpenApiHttpApiAddSpecHeadersInput;
|
|
79
|
+
export type OpenApiTestSourceExecutor = {
|
|
80
|
+
readonly openapi: Pick<OpenApiPluginExtension, "addSpec">;
|
|
81
|
+
};
|
|
82
|
+
export type OpenApiTestConnectionExecutor = {
|
|
83
|
+
readonly openapi: Pick<OpenApiPluginExtension, "addSpec">;
|
|
84
|
+
readonly connections: {
|
|
85
|
+
readonly create: (input: CreateConnectionInput) => Effect.Effect<Connection, unknown>;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
export interface OpenApiTestConnectionOptions {
|
|
89
|
+
readonly slug?: string;
|
|
90
|
+
readonly owner?: Owner;
|
|
91
|
+
readonly connection?: string;
|
|
92
|
+
readonly template?: string;
|
|
93
|
+
/** Inline credential value. Defaults to a throwaway token via the in-memory
|
|
94
|
+
* provider's `from` path is avoided — pass `value` to store a real secret. */
|
|
95
|
+
readonly value?: string;
|
|
96
|
+
readonly baseUrl?: string | null;
|
|
97
|
+
}
|
|
98
|
+
export interface OpenApiTestConnection {
|
|
99
|
+
readonly slug: string;
|
|
100
|
+
readonly owner: Owner;
|
|
101
|
+
readonly connection: string;
|
|
102
|
+
readonly address: (tool: string) => ToolAddressType;
|
|
103
|
+
}
|
|
104
|
+
/** addSpec + connections.create from a raw server spec; returns an address
|
|
105
|
+
* builder for `executor.execute`. */
|
|
106
|
+
export declare const addOpenApiTestConnection: (executor: OpenApiTestConnectionExecutor, server: OpenApiTestServerShape, sourceOptions: OpenApiTestSourceOptions, connectionOptions?: OpenApiTestConnectionOptions) => Effect.Effect<OpenApiTestConnection, unknown>;
|
|
107
|
+
export interface OpenApiTestSpecOptions {
|
|
108
|
+
readonly baseUrl?: string;
|
|
109
|
+
readonly transformSpec?: (spec: Record<string, unknown>) => Record<string, unknown>;
|
|
110
|
+
}
|
|
111
|
+
export declare const makeOpenApiTestSpecJson: (api: HttpApi.Any, options?: OpenApiTestSpecOptions) => string;
|
|
112
|
+
export declare const makeOpenApiTestSourceConfig: (server: OpenApiTestServerShape, options: OpenApiTestSourceOptions) => OpenApiSpecConfig;
|
|
113
|
+
export declare const addOpenApiTestSource: (executor: OpenApiTestSourceExecutor, server: OpenApiTestServerShape, options: OpenApiTestSourceOptions) => Effect.Effect<{
|
|
114
|
+
readonly slug: IntegrationSlug;
|
|
115
|
+
readonly toolCount: number;
|
|
116
|
+
}, import("@executor-js/sdk/core").StorageFailure | import("@executor-js/sdk/core").IntegrationAlreadyExistsError | import("../sdk").OpenApiParseError | import("../sdk").OpenApiExtractionError | import("../sdk").OpenApiOAuthError, never>;
|
|
117
|
+
export declare const makeOpenApiHttpApiTestSourceConfig: (api: HttpApi.Any, options: OpenApiHttpApiTestSourceOptions) => OpenApiSpecConfig;
|
|
118
|
+
export declare const addOpenApiHttpApiTestSource: (executor: OpenApiTestSourceExecutor, api: HttpApi.Any, options: OpenApiHttpApiTestSourceOptions) => Effect.Effect<{
|
|
119
|
+
readonly slug: IntegrationSlug;
|
|
120
|
+
readonly toolCount: number;
|
|
121
|
+
}, import("@executor-js/sdk/core").StorageFailure | import("@executor-js/sdk/core").IntegrationAlreadyExistsError | import("../sdk").OpenApiParseError | import("../sdk").OpenApiExtractionError | import("../sdk").OpenApiOAuthError, never>;
|
|
122
|
+
export declare const makeOpenApiHttpApiTestAddSpecPayload: (api: HttpApi.Any, options: OpenApiHttpApiTestAddSpecPayloadOptions) => {
|
|
123
|
+
authenticationTemplate?: readonly import("../sdk").Authentication[] | undefined;
|
|
124
|
+
queryParams?: Record<string, string> | undefined;
|
|
125
|
+
headers?: Record<string, string> | undefined;
|
|
126
|
+
spec: {
|
|
127
|
+
readonly kind: "url";
|
|
128
|
+
readonly url: string;
|
|
129
|
+
} | {
|
|
130
|
+
readonly value: string;
|
|
131
|
+
readonly kind: "blob";
|
|
132
|
+
} | {
|
|
133
|
+
readonly kind: "googleDiscovery";
|
|
134
|
+
readonly url: string;
|
|
135
|
+
} | {
|
|
136
|
+
readonly kind: "googleDiscoveryBundle";
|
|
137
|
+
readonly urls: readonly string[];
|
|
138
|
+
};
|
|
139
|
+
slug: string;
|
|
140
|
+
baseUrl: string | undefined;
|
|
141
|
+
};
|
|
142
|
+
export declare const makeOpenApiHttpApiTestSpecPayload: (api: HttpApi.Any, options?: OpenApiTestSpecOptions) => {
|
|
143
|
+
spec: string;
|
|
144
|
+
};
|
|
145
|
+
export declare const serveOpenApiHttpApiTestServer: (options: OpenApiHttpApiTestServerOptions) => Effect.Effect<OpenApiHttpApiTestServerShape, OpenApiTestServerAddressError | OpenApiTestServerSpecError, Scope.Scope>;
|
|
146
|
+
declare const OpenApiHttpApiTestServer_base: Context.ServiceClass<OpenApiHttpApiTestServer, "@executor-js/plugin-openapi/testing/OpenApiHttpApiTestServer", OpenApiHttpApiTestServerShape>;
|
|
147
|
+
export declare class OpenApiHttpApiTestServer extends OpenApiHttpApiTestServer_base {
|
|
148
|
+
static readonly layer: (options: OpenApiHttpApiTestServerOptions) => Layer.Layer<OpenApiHttpApiTestServer, OpenApiTestServerAddressError | OpenApiTestServerSpecError, never>;
|
|
149
|
+
}
|
|
150
|
+
export declare const serveMutableOpenApiSpecTestServer: (options: {
|
|
151
|
+
readonly initialApi: HttpApi.Any;
|
|
152
|
+
readonly specPath?: `/${string}`;
|
|
153
|
+
readonly transformSpec?: (spec: Record<string, unknown>) => Record<string, unknown>;
|
|
154
|
+
}) => Effect.Effect<MutableOpenApiSpecTestServerShape, OpenApiTestServerAddressError | OpenApiTestServerSpecError, Scope.Scope>;
|
|
155
|
+
export declare const serveOpenApiEchoTestServer: (options?: OpenApiEchoTestServerOptions) => Effect.Effect<OpenApiEchoTestServerShape, OpenApiTestServerAddressError | OpenApiTestServerSpecError, Scope.Scope>;
|
|
156
|
+
export declare const serveOpenApiEchoTestServerWithOAuth: (options?: Omit<OpenApiEchoTestServerOptions, "oauth2"> & {
|
|
157
|
+
readonly scopes?: Readonly<Record<string, string>>;
|
|
158
|
+
readonly wwwAuthenticate?: string;
|
|
159
|
+
}) => Effect.Effect<OpenApiEchoTestServerShape, OpenApiTestServerAddressError | OpenApiTestServerSpecError, Scope.Scope | OAuthTestServer>;
|
|
160
|
+
declare const OpenApiEchoTestServer_base: Context.ServiceClass<OpenApiEchoTestServer, "@executor-js/plugin-openapi/testing/OpenApiEchoTestServer", OpenApiEchoTestServerShape>;
|
|
161
|
+
export declare class OpenApiEchoTestServer extends OpenApiEchoTestServer_base {
|
|
162
|
+
static readonly layer: (options?: OpenApiEchoTestServerOptions) => Layer.Layer<OpenApiEchoTestServer, OpenApiTestServerAddressError | OpenApiTestServerSpecError, never>;
|
|
163
|
+
static readonly layerWithOAuth: (options?: Omit<OpenApiEchoTestServerOptions, "oauth2"> & {
|
|
164
|
+
readonly scopes?: Readonly<Record<string, string>>;
|
|
165
|
+
readonly wwwAuthenticate?: string;
|
|
166
|
+
}) => Layer.Layer<OpenApiEchoTestServer, OpenApiTestServerAddressError | OpenApiTestServerSpecError, OAuthTestServer>;
|
|
167
|
+
}
|
|
168
|
+
export declare const TestLayers: {
|
|
169
|
+
httpApi: (options: OpenApiHttpApiTestServerOptions) => Layer.Layer<OpenApiHttpApiTestServer, OpenApiTestServerAddressError | OpenApiTestServerSpecError, never>;
|
|
170
|
+
echo: (options?: OpenApiEchoTestServerOptions) => Layer.Layer<OpenApiEchoTestServer, OpenApiTestServerAddressError | OpenApiTestServerSpecError, never>;
|
|
171
|
+
echoWithOAuth: (options?: Omit<OpenApiEchoTestServerOptions, "oauth2"> & {
|
|
172
|
+
readonly scopes?: Readonly<Record<string, string>>;
|
|
173
|
+
readonly wwwAuthenticate?: string;
|
|
174
|
+
}) => Layer.Layer<OpenApiEchoTestServer, OpenApiTestServerAddressError | OpenApiTestServerSpecError, OAuthTestServer>;
|
|
175
|
+
};
|
|
176
|
+
export interface OpenApiInvocationResult<TData = Record<string, unknown> | unknown[] | null> {
|
|
177
|
+
readonly status: number | null;
|
|
178
|
+
readonly headers: Record<string, string> | null;
|
|
179
|
+
readonly data: TData;
|
|
180
|
+
readonly error: unknown;
|
|
181
|
+
}
|
|
182
|
+
export declare const unwrapInvocation: <TData = Record<string, unknown> | null>(raw: unknown) => OpenApiInvocationResult<TData>;
|
|
183
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@executor-js/plugin-openapi",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.4",
|
|
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"
|
|
@@ -52,29 +52,29 @@
|
|
|
52
52
|
"typecheck:slow": "bunx tsc --noEmit -p tsconfig.json"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@effect/platform-node": "
|
|
56
|
-
"@executor-js/config": "1.5.
|
|
57
|
-
"@executor-js/sdk": "1.5.
|
|
55
|
+
"@effect/platform-node": "4.0.0-beta.59",
|
|
56
|
+
"@executor-js/config": "1.5.4",
|
|
57
|
+
"@executor-js/sdk": "1.5.4",
|
|
58
58
|
"lucide-react": "^1.7.0",
|
|
59
59
|
"openapi-types": "^12.1.3",
|
|
60
60
|
"yaml": "^2.7.1"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@effect/atom-react": "
|
|
64
|
-
"@effect/vitest": "
|
|
65
|
-
"@types/node": "
|
|
66
|
-
"@types/react": "
|
|
67
|
-
"bun-types": "
|
|
68
|
-
"effect": "
|
|
69
|
-
"react": "
|
|
70
|
-
"tsup": "
|
|
71
|
-
"vitest": "
|
|
63
|
+
"@effect/atom-react": "4.0.0-beta.59",
|
|
64
|
+
"@effect/vitest": "4.0.0-beta.59",
|
|
65
|
+
"@types/node": "^24.3.1",
|
|
66
|
+
"@types/react": "^19.1.0",
|
|
67
|
+
"bun-types": "^1.2.22",
|
|
68
|
+
"effect": "4.0.0-beta.59",
|
|
69
|
+
"react": "^19.1.0",
|
|
70
|
+
"tsup": "^8.5.0",
|
|
71
|
+
"vitest": "^4.1.5"
|
|
72
72
|
},
|
|
73
73
|
"peerDependencies": {
|
|
74
|
-
"@effect/atom-react": "
|
|
75
|
-
"@tanstack/react-router": "
|
|
76
|
-
"effect": "
|
|
77
|
-
"react": "
|
|
74
|
+
"@effect/atom-react": "4.0.0-beta.59",
|
|
75
|
+
"@tanstack/react-router": "^1.168.10",
|
|
76
|
+
"effect": "4.0.0-beta.59",
|
|
77
|
+
"react": "^19.1.0"
|
|
78
78
|
},
|
|
79
79
|
"peerDependenciesMeta": {
|
|
80
80
|
"react": {
|