@executor-js/plugin-openapi 1.5.0 → 1.5.2

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 (57) hide show
  1. package/package.json +17 -17
  2. package/dist/api/group.d.ts +0 -188
  3. package/dist/api/handlers.d.ts +0 -7
  4. package/dist/api/index.d.ts +0 -271
  5. package/dist/react/AddOpenApiSource.d.ts +0 -8
  6. package/dist/react/EditOpenApiSource.d.ts +0 -4
  7. package/dist/react/GoogleProductPicker.d.ts +0 -9
  8. package/dist/react/OpenApiAccountsPanel.d.ts +0 -6
  9. package/dist/react/OpenApiSourceDetailsFields.d.ts +0 -19
  10. package/dist/react/atoms.d.ts +0 -279
  11. package/dist/react/auth-method-config.d.ts +0 -15
  12. package/dist/react/auth-method-config.test.d.ts +0 -1
  13. package/dist/react/client.d.ts +0 -184
  14. package/dist/react/index.d.ts +0 -3
  15. package/dist/react/plugin-client.d.ts +0 -2
  16. package/dist/react/source-plugin.d.ts +0 -2
  17. package/dist/sdk/client-credentials-oauth.test.d.ts +0 -1
  18. package/dist/sdk/config.d.ts +0 -75
  19. package/dist/sdk/configure.test.d.ts +0 -1
  20. package/dist/sdk/definitions.d.ts +0 -25
  21. package/dist/sdk/describe-auth-methods.test.d.ts +0 -1
  22. package/dist/sdk/errors.d.ts +0 -44
  23. package/dist/sdk/extract.d.ts +0 -59
  24. package/dist/sdk/form-urlencoded-body.test.d.ts +0 -1
  25. package/dist/sdk/google-bundle.test.d.ts +0 -1
  26. package/dist/sdk/google-discovery.d.ts +0 -43
  27. package/dist/sdk/google-discovery.test.d.ts +0 -1
  28. package/dist/sdk/google-oauth-batches.d.ts +0 -13
  29. package/dist/sdk/google-oauth-batches.test.d.ts +0 -1
  30. package/dist/sdk/google-oauth-scopes.d.ts +0 -3
  31. package/dist/sdk/google-oauth-scopes.test.d.ts +0 -1
  32. package/dist/sdk/google-presets.d.ts +0 -16
  33. package/dist/sdk/google-presets.test.d.ts +0 -1
  34. package/dist/sdk/google-product-picker-scopes.test.d.ts +0 -1
  35. package/dist/sdk/index.d.ts +0 -11
  36. package/dist/sdk/index.test.d.ts +0 -1
  37. package/dist/sdk/invoke.d.ts +0 -55
  38. package/dist/sdk/multi-scope-bearer.test.d.ts +0 -1
  39. package/dist/sdk/multi-scope-oauth.test.d.ts +0 -1
  40. package/dist/sdk/non-json-body.test.d.ts +0 -1
  41. package/dist/sdk/oauth-refresh.test.d.ts +0 -1
  42. package/dist/sdk/openapi-utils.d.ts +0 -57
  43. package/dist/sdk/parse.d.ts +0 -33
  44. package/dist/sdk/parse.test.d.ts +0 -1
  45. package/dist/sdk/plugin.d.ts +0 -163
  46. package/dist/sdk/plugin.test.d.ts +0 -1
  47. package/dist/sdk/presets.d.ts +0 -10
  48. package/dist/sdk/preview-oauth2.test.d.ts +0 -1
  49. package/dist/sdk/preview.d.ts +0 -269
  50. package/dist/sdk/query-serialization.test.d.ts +0 -1
  51. package/dist/sdk/real-specs.test.d.ts +0 -1
  52. package/dist/sdk/store.d.ts +0 -21
  53. package/dist/sdk/types.d.ts +0 -252
  54. package/dist/sdk/upstream-failures.test.d.ts +0 -1
  55. package/dist/sdk/usage-scope-isolation.test.d.ts +0 -1
  56. package/dist/testing/index.d.ts +0 -183
  57. package/dist/testing.test.d.ts +0 -1
@@ -1,44 +0,0 @@
1
- import { Schema } from "effect";
2
- import type { Option } from "effect";
3
- import type { AuthToolFailureCode } from "@executor-js/sdk/core";
4
- declare const OpenApiParseError_base: Schema.Class<OpenApiParseError, Schema.TaggedStruct<"OpenApiParseError", {
5
- readonly message: Schema.String;
6
- }>, import("effect/Cause").YieldableError>;
7
- export declare class OpenApiParseError extends OpenApiParseError_base {
8
- }
9
- declare const OpenApiExtractionError_base: Schema.Class<OpenApiExtractionError, Schema.TaggedStruct<"OpenApiExtractionError", {
10
- readonly message: Schema.String;
11
- }>, import("effect/Cause").YieldableError>;
12
- export declare class OpenApiExtractionError extends OpenApiExtractionError_base {
13
- }
14
- 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 & {
15
- readonly _tag: "OpenApiInvocationError";
16
- } & Readonly<A>;
17
- export declare class OpenApiInvocationError extends OpenApiInvocationError_base<{
18
- readonly message: string;
19
- readonly statusCode: Option.Option<number>;
20
- readonly cause?: unknown;
21
- }> {
22
- }
23
- declare const OpenApiOAuthError_base: Schema.Class<OpenApiOAuthError, Schema.TaggedStruct<"OpenApiOAuthError", {
24
- readonly message: Schema.String;
25
- }>, import("effect/Cause").YieldableError>;
26
- export declare class OpenApiOAuthError extends OpenApiOAuthError_base {
27
- }
28
- declare const OpenApiAuthRequiredError_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 & {
29
- readonly _tag: "OpenApiAuthRequiredError";
30
- } & Readonly<A>;
31
- export declare class OpenApiAuthRequiredError extends OpenApiAuthRequiredError_base<{
32
- readonly code: AuthToolFailureCode;
33
- readonly message: string;
34
- readonly owner: "org" | "user";
35
- readonly integration: string;
36
- readonly connection: string;
37
- readonly credentialKind: "secret" | "oauth" | "upstream";
38
- readonly credentialLabel?: string;
39
- readonly status?: number;
40
- readonly details?: unknown;
41
- readonly cause?: unknown;
42
- }> {
43
- }
44
- export {};
@@ -1,59 +0,0 @@
1
- import { Effect, Option } from "effect";
2
- import { OpenApiExtractionError } from "./errors";
3
- import type { ParsedDocument } from "./parse";
4
- /** Extract all operations from a bundled OpenAPI 3.x document */
5
- export declare const extract: (doc: ParsedDocument) => Effect.Effect<{
6
- readonly version: Option.Option<string>;
7
- readonly operations: readonly {
8
- readonly description: Option.Option<string>;
9
- readonly inputSchema: Option.Option<unknown>;
10
- readonly outputSchema: Option.Option<unknown>;
11
- readonly method: "post" | "options" | "delete" | "get" | "put" | "patch" | "head" | "trace";
12
- readonly deprecated: boolean;
13
- readonly toolPath: Option.Option<string>;
14
- readonly summary: Option.Option<string>;
15
- readonly tags: readonly string[];
16
- readonly parameters: readonly {
17
- readonly name: string;
18
- readonly required: boolean;
19
- readonly description: Option.Option<string>;
20
- readonly schema: Option.Option<unknown>;
21
- readonly style: Option.Option<string>;
22
- readonly location: "header" | "query" | "path" | "cookie";
23
- readonly explode: Option.Option<boolean>;
24
- readonly allowReserved: Option.Option<boolean>;
25
- }[];
26
- readonly requestBody: Option.Option<{
27
- readonly required: boolean;
28
- readonly schema: Option.Option<unknown>;
29
- readonly contentType: string;
30
- readonly contents: Option.Option<readonly {
31
- readonly schema: Option.Option<unknown>;
32
- readonly contentType: string;
33
- readonly encoding: Option.Option<{
34
- readonly [x: string]: {
35
- readonly style: Option.Option<string>;
36
- readonly contentType: Option.Option<string>;
37
- readonly explode: Option.Option<boolean>;
38
- readonly allowReserved: Option.Option<boolean>;
39
- };
40
- }>;
41
- }[]>;
42
- }>;
43
- readonly operationId: string & import("effect/Brand").Brand<"OperationId">;
44
- readonly pathTemplate: string;
45
- readonly baseUrl?: string | undefined;
46
- }[];
47
- readonly title: Option.Option<string>;
48
- readonly servers: readonly {
49
- readonly description: Option.Option<string>;
50
- readonly url: string;
51
- readonly variables: Option.Option<{
52
- readonly [x: string]: {
53
- readonly default: string;
54
- readonly description: Option.Option<string>;
55
- readonly enum: Option.Option<readonly string[]>;
56
- };
57
- }>;
58
- }[];
59
- }, OpenApiExtractionError, never>;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,43 +0,0 @@
1
- import { Effect } from "effect";
2
- import { HttpClient } from "effect/unstable/http";
3
- import { OpenApiParseError } from "./errors";
4
- import type { SpecFetchCredentials } from "./parse";
5
- import type { Authentication } from "./types";
6
- export interface GoogleDiscoveryOpenApiConversion {
7
- readonly specText: string;
8
- readonly baseUrl: string;
9
- readonly title: string;
10
- readonly service: string;
11
- readonly version: string;
12
- readonly discoveryUrls?: readonly string[];
13
- /** The v2 oauth auth template the converted integration declares, when the
14
- * Discovery document advertises OAuth2 scopes. */
15
- readonly authenticationTemplate?: readonly Authentication[];
16
- }
17
- export declare const isGoogleDiscoveryUrl: (url: string) => boolean;
18
- export declare const fetchGoogleDiscoveryDocument: (discoveryUrl: string, credentials?: SpecFetchCredentials | undefined) => Effect.Effect<string, OpenApiParseError, HttpClient.HttpClient>;
19
- export declare const convertGoogleDiscoveryToOpenApi: (input: {
20
- readonly discoveryUrl: string;
21
- readonly documentText: string;
22
- }) => Effect.Effect<{
23
- authenticationTemplate?: readonly Authentication[] | undefined;
24
- specText: string;
25
- baseUrl: string;
26
- title: string;
27
- service: string;
28
- version: string;
29
- }, OpenApiParseError, never>;
30
- export declare const convertGoogleDiscoveryBundleToOpenApi: (input: {
31
- readonly documents: readonly {
32
- readonly discoveryUrl: string;
33
- readonly documentText: string;
34
- }[];
35
- }) => Effect.Effect<{
36
- authenticationTemplate?: readonly Authentication[] | undefined;
37
- specText: string;
38
- baseUrl: string;
39
- title: string;
40
- service: string;
41
- version: string;
42
- discoveryUrls: string[];
43
- }, OpenApiParseError, never>;
@@ -1 +0,0 @@
1
- export {};
@@ -1,13 +0,0 @@
1
- import type { GoogleOpenApiOAuthAudience } from "./google-presets";
2
- export type GoogleOAuthBatchInput = {
3
- readonly id: string;
4
- readonly name: string;
5
- readonly oauthAudience: GoogleOpenApiOAuthAudience;
6
- readonly scopes: readonly string[];
7
- };
8
- export type GoogleOAuthConsentBatch = {
9
- readonly id: string;
10
- readonly label: string;
11
- readonly apiScopes: readonly string[];
12
- };
13
- export declare const googleOAuthConsentBatches: (items: readonly GoogleOAuthBatchInput[]) => readonly GoogleOAuthConsentBatch[];
@@ -1 +0,0 @@
1
- export {};
@@ -1,3 +0,0 @@
1
- export declare const isGoogleUserConsentOAuthScope: (scope: string) => boolean;
2
- export declare const filterGoogleUserConsentOAuthScopes: (scopes: Iterable<string>) => string[];
3
- export declare const compactGoogleOAuthScopes: (scopes: Iterable<string>) => string[];
@@ -1 +0,0 @@
1
- export {};
@@ -1,16 +0,0 @@
1
- import type { OpenApiPreset } from "./presets";
2
- export type GoogleOpenApiOAuthAudience = "standard-user" | "advanced-user" | "workspace-admin" | "unsupported-user";
3
- export type GoogleOpenApiPreset = OpenApiPreset & {
4
- readonly oauthAudience: GoogleOpenApiOAuthAudience;
5
- };
6
- export declare const GOOGLE_BUNDLE_PRESET_ID = "google";
7
- export declare const googleOpenApiBundlePreset: OpenApiPreset;
8
- export declare const googleOpenApiPresets: readonly GoogleOpenApiPreset[];
9
- export declare const googleStandardUserOAuthPresets: GoogleOpenApiPreset[];
10
- export declare const googleOAuthConsentScopes: Readonly<Record<string, readonly string[]>>;
11
- export declare const googleOAuthConsentScopesForPreset: (presetId: string) => readonly string[];
12
- export declare const googlePresetForDiscoveryUrl: (url: string) => GoogleOpenApiPreset | undefined;
13
- /** The distinct caution-tier audiences (`workspace-admin`, `unsupported-user`)
14
- * among the supplied Discovery URLs — the ones whose consent the user should be
15
- * warned about. Returns `[]` when every URL is a standard/advanced API. */
16
- export declare const googleAudienceWarningsForUrls: (urls: readonly string[]) => readonly GoogleOpenApiOAuthAudience[];
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,11 +0,0 @@
1
- export { parse, resolveSpecText, fetchSpecText } from "./parse";
2
- export { convertGoogleDiscoveryBundleToOpenApi, convertGoogleDiscoveryToOpenApi, fetchGoogleDiscoveryDocument, isGoogleDiscoveryUrl, type GoogleDiscoveryOpenApiConversion, } from "./google-discovery";
3
- export { extract } from "./extract";
4
- export { invoke, invokeWithLayer, annotationsForOperation } from "./invoke";
5
- export { openApiPlugin, type OpenApiSpecConfig, type OpenApiConfigureInput, type OpenApiSpecInput, type OpenApiPreviewInput, type OpenApiPluginExtension, type OpenApiPluginOptions, } from "./plugin";
6
- export { type OpenapiStore, type StoredOperation, makeDefaultOpenapiStore } from "./store";
7
- export { decodeOpenApiIntegrationConfig, renderAuthTemplate, AuthenticationSchema, OpenApiIntegrationConfigSchema, type OpenApiIntegrationConfig, type RenderedAuth, } from "./config";
8
- export { previewSpec, SecurityScheme, AuthStrategy, HeaderPreset, OAuth2Preset, OAuth2Flows, OAuth2AuthorizationCodeFlow, OAuth2ClientCredentialsFlow, PreviewOperation, SpecPreview, } from "./preview";
9
- export { DocResolver, resolveBaseUrl, substituteUrlVariables, preferredContent, } from "./openapi-utils";
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";
@@ -1 +0,0 @@
1
- export {};
@@ -1,55 +0,0 @@
1
- import { Effect, Layer, Option } from "effect";
2
- import { HttpClient } from "effect/unstable/http";
3
- import { OpenApiInvocationError } from "./errors";
4
- import { type OperationBinding } from "./types";
5
- export declare const invoke: (operation: {
6
- readonly method: "post" | "options" | "delete" | "get" | "put" | "patch" | "head" | "trace";
7
- readonly parameters: readonly {
8
- readonly name: string;
9
- readonly required: boolean;
10
- readonly description: Option.Option<string>;
11
- readonly schema: Option.Option<unknown>;
12
- readonly style: Option.Option<string>;
13
- readonly location: "header" | "query" | "path" | "cookie";
14
- readonly explode: Option.Option<boolean>;
15
- readonly allowReserved: Option.Option<boolean>;
16
- }[];
17
- readonly requestBody: Option.Option<{
18
- readonly required: boolean;
19
- readonly schema: Option.Option<unknown>;
20
- readonly contentType: string;
21
- readonly contents: Option.Option<readonly {
22
- readonly schema: Option.Option<unknown>;
23
- readonly contentType: string;
24
- readonly encoding: Option.Option<{
25
- readonly [x: string]: {
26
- readonly style: Option.Option<string>;
27
- readonly contentType: Option.Option<string>;
28
- readonly explode: Option.Option<boolean>;
29
- readonly allowReserved: Option.Option<boolean>;
30
- };
31
- }>;
32
- }[]>;
33
- }>;
34
- readonly pathTemplate: string;
35
- readonly baseUrl?: string | undefined;
36
- }, args: Record<string, unknown>, resolvedHeaders: Record<string, string>, sourceQueryParams?: Record<string, string> | undefined) => Effect.Effect<{
37
- readonly error: unknown;
38
- readonly data: unknown;
39
- readonly status: number;
40
- readonly headers: {
41
- readonly [x: string]: string;
42
- };
43
- }, OpenApiInvocationError, HttpClient.HttpClient>;
44
- 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<{
45
- readonly error: unknown;
46
- readonly data: unknown;
47
- readonly status: number;
48
- readonly headers: {
49
- readonly [x: string]: string;
50
- };
51
- }, OpenApiInvocationError, never>;
52
- export declare const annotationsForOperation: (method: string, pathTemplate: string) => {
53
- requiresApproval?: boolean;
54
- approvalDescription?: string;
55
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,57 +0,0 @@
1
- import type { OpenAPIV3, OpenAPIV3_1 } from "openapi-types";
2
- import type { ParsedDocument } from "./parse";
3
- import type { ServerVariable } from "./types";
4
- export type ParameterObject = OpenAPIV3.ParameterObject | OpenAPIV3_1.ParameterObject;
5
- export type OperationObject = OpenAPIV3.OperationObject | OpenAPIV3_1.OperationObject;
6
- export type PathItemObject = OpenAPIV3.PathItemObject | OpenAPIV3_1.PathItemObject;
7
- export type RequestBodyObject = OpenAPIV3.RequestBodyObject | OpenAPIV3_1.RequestBodyObject;
8
- export type ResponseObject = OpenAPIV3.ResponseObject | OpenAPIV3_1.ResponseObject;
9
- export type MediaTypeObject = OpenAPIV3.MediaTypeObject | OpenAPIV3_1.MediaTypeObject;
10
- export type ServerObject = OpenAPIV3.ServerObject | OpenAPIV3_1.ServerObject;
11
- export declare class DocResolver {
12
- readonly doc: ParsedDocument;
13
- constructor(doc: ParsedDocument);
14
- /** Resolve a value that might be a $ref, returning the resolved object */
15
- resolve<T>(value: T | OpenAPIV3.ReferenceObject | OpenAPIV3_1.ReferenceObject): T | null;
16
- private resolvePointer;
17
- }
18
- /** Substitute `{var}` placeholders in a templated URL using a plain map. */
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;
27
- /**
28
- * Return all declared media entries in spec order. `Object.entries` on a
29
- * plain object preserves insertion order in modern engines, which matches
30
- * spec declaration order as the parser produced it.
31
- */
32
- export declare const declaredContents: (content: Record<string, MediaTypeObject> | undefined) => ReadonlyArray<{
33
- mediaType: string;
34
- media: MediaTypeObject;
35
- }>;
36
- /**
37
- * Pick the default media type for a requestBody or response. Matches
38
- * swagger-client behaviour: **first declared wins** (not JSON-first). Spec
39
- * authors order content entries to signal intent (upload-heavy endpoints
40
- * declare multipart first, JSON second); respecting that order avoids
41
- * silently downgrading a multipart endpoint to JSON.
42
- *
43
- * For response bodies we still want a JSON preference because the server
44
- * picks the response content type, not the client — the old `application/
45
- * json` preference is preserved via `preferredResponseContent` below.
46
- */
47
- export declare const preferredContent: (content: Record<string, MediaTypeObject> | undefined) => {
48
- mediaType: string;
49
- media: MediaTypeObject;
50
- } | undefined;
51
- /** Response-side content picker — still JSON-first because the server
52
- * picks the response media type, so we want to advertise a preference. */
53
- export declare const preferredResponseContent: (content: Record<string, MediaTypeObject> | undefined) => {
54
- mediaType: string;
55
- media: MediaTypeObject;
56
- } | undefined;
57
- export {};
@@ -1,33 +0,0 @@
1
- import type { OpenAPIV3, OpenAPIV3_1 } from "openapi-types";
2
- import { Effect } from "effect";
3
- import { HttpClient } from "effect/unstable/http";
4
- import { OpenApiExtractionError, OpenApiParseError } from "./errors";
5
- export type ParsedDocument = OpenAPIV3.Document | OpenAPIV3_1.Document;
6
- export interface SpecFetchCredentials {
7
- readonly headers?: Record<string, string>;
8
- readonly queryParams?: Record<string, string>;
9
- }
10
- declare class OpenApiExtractionErrorFromParse extends OpenApiExtractionError {
11
- }
12
- /**
13
- * Fetch an OpenAPI spec URL and return its body text. Uses the Effect
14
- * HttpClient so the caller chooses the transport via layer — in Cloudflare
15
- * Workers, `FetchHttpClient.layer` binds to the Workers-native `fetch`.
16
- * Bounded by a 60s timeout.
17
- */
18
- export declare const fetchSpecText: (url: string, credentials?: SpecFetchCredentials | undefined) => Effect.Effect<string, OpenApiParseError, HttpClient.HttpClient>;
19
- /**
20
- * Resolve an input string to spec text — if it's a URL, fetch it via
21
- * HttpClient; otherwise return it as-is.
22
- */
23
- export declare const resolveSpecText: (input: string, credentials?: SpecFetchCredentials) => Effect.Effect<string, OpenApiParseError, HttpClient.HttpClient>;
24
- /**
25
- * Parse an OpenAPI document from spec text and validate it's OpenAPI 3.x.
26
- *
27
- * NOTE: does NOT resolve `$ref`s. `DocResolver` + `normalizeOpenApiRefs`
28
- * downstream work on refs lazily, so inlining them here would just waste
29
- * memory — and for big specs (e.g. Cloudflare's API) that blows through
30
- * the 128MB Cloudflare Workers memory cap.
31
- */
32
- export declare const parse: (text: string) => Effect.Effect<ParsedDocument, OpenApiParseError | OpenApiExtractionErrorFromParse, never>;
33
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,163 +0,0 @@
1
- import { Effect, Option, Schema } from "effect";
2
- import type { Layer } from "effect";
3
- import { HttpClient } from "effect/unstable/http";
4
- import { IntegrationAlreadyExistsError, IntegrationSlug, type AuthMethodDescriptor, type Integration, type IntegrationRecord, type StorageFailure } from "@executor-js/sdk/core";
5
- import { type OpenApiIntegrationConfig } from "./config";
6
- import { OpenApiExtractionError, OpenApiOAuthError, OpenApiParseError } from "./errors";
7
- import { type SpecPreview } from "./preview";
8
- import { type OpenapiStore } from "./store";
9
- import type { Authentication } from "./types";
10
- export type OpenApiSpecInput = typeof OpenApiSpecInputSchema.Type;
11
- export interface OpenApiPreviewInput {
12
- readonly spec: string;
13
- }
14
- /** Add an OpenAPI integration to the catalog. The integration is the API
15
- * surface; connections (the credentials) are attached separately and resolve
16
- * their value through the declared `authenticationTemplate`. */
17
- export interface OpenApiSpecConfig {
18
- readonly spec: OpenApiSpecInput;
19
- /** The catalog slug for the new integration (the `<integration>` segment). */
20
- readonly slug: string;
21
- /** Human description (defaults to the spec title). */
22
- readonly description?: string;
23
- readonly baseUrl?: string;
24
- /** Static headers applied to every request (no secret material). */
25
- readonly headers?: Record<string, string>;
26
- /** Static query params applied to every request. */
27
- readonly queryParams?: Record<string, string>;
28
- /** Auth methods a connection's value renders through. */
29
- readonly authenticationTemplate?: readonly Authentication[];
30
- }
31
- export interface OpenApiExtensionFailure {
32
- readonly _tag: string;
33
- }
34
- /** Add / merge custom auth methods onto an existing OpenAPI integration's
35
- * `authenticationTemplate`. Mirrors the GraphQL plugin's `configure`. */
36
- export interface OpenApiConfigureInput {
37
- /** The auth methods to add. Each entry is appended to (or, when its `slug`
38
- * already exists, replaces) the integration's existing template array. A
39
- * custom apiKey method with no `slug` is assigned a generated `custom_<id>`
40
- * slug that is collision-checked against the existing template. */
41
- readonly authenticationTemplate: readonly Authentication[];
42
- readonly mode?: "merge" | "replace";
43
- }
44
- export interface OpenApiPluginExtension {
45
- readonly previewSpec: (input: string | OpenApiPreviewInput) => Effect.Effect<SpecPreview, OpenApiParseError | OpenApiExtractionError | OpenApiOAuthError | StorageFailure>;
46
- readonly addSpec: (config: OpenApiSpecConfig) => Effect.Effect<{
47
- readonly slug: IntegrationSlug;
48
- readonly toolCount: number;
49
- }, OpenApiParseError | OpenApiExtractionError | OpenApiOAuthError | IntegrationAlreadyExistsError | StorageFailure>;
50
- readonly removeSpec: (slug: string) => Effect.Effect<void, StorageFailure>;
51
- readonly getIntegration: (slug: string) => Effect.Effect<Integration | null, StorageFailure>;
52
- /** Read the integration's full opaque config, including its
53
- * `authenticationTemplate`. Returns null when the integration is absent. */
54
- readonly getConfig: (slug: string) => Effect.Effect<OpenApiIntegrationConfig | null, StorageFailure>;
55
- /** Add / merge custom auth methods onto the integration's
56
- * `authenticationTemplate`. Returns the resulting template array. */
57
- readonly configure: (slug: string, input: OpenApiConfigureInput) => Effect.Effect<readonly Authentication[], StorageFailure>;
58
- }
59
- declare const OpenApiSpecInputSchema: Schema.Union<readonly [Schema.Struct<{
60
- readonly kind: Schema.Literal<"url">;
61
- readonly url: Schema.String;
62
- }>, Schema.Struct<{
63
- readonly kind: Schema.Literal<"blob">;
64
- readonly value: Schema.String;
65
- }>, Schema.Struct<{
66
- readonly kind: Schema.Literal<"googleDiscovery">;
67
- readonly url: Schema.String;
68
- }>, Schema.Struct<{
69
- readonly kind: Schema.Literal<"googleDiscoveryBundle">;
70
- readonly urls: Schema.$Array<Schema.String>;
71
- }>]>;
72
- export declare const describeOpenApiAuthMethods: (record: IntegrationRecord) => readonly AuthMethodDescriptor[];
73
- export declare const describeOpenApiIntegrationDisplay: (record: IntegrationRecord) => {
74
- readonly url?: string;
75
- };
76
- export interface OpenApiPluginOptions {
77
- readonly httpClientLayer?: Layer.Layer<HttpClient.HttpClient, never, never>;
78
- }
79
- export declare const openApiPlugin: import("@executor-js/sdk/core").ConfiguredPlugin<"openapi", {
80
- previewSpec: (input: string | OpenApiPreviewInput) => Effect.Effect<{
81
- readonly version: Option.Option<string>;
82
- readonly operations: readonly {
83
- readonly method: "post" | "options" | "delete" | "get" | "put" | "patch" | "head" | "trace";
84
- readonly deprecated: boolean;
85
- readonly path: string;
86
- readonly summary: Option.Option<string>;
87
- readonly tags: readonly string[];
88
- readonly operationId: string;
89
- }[];
90
- readonly title: Option.Option<string>;
91
- readonly tags: readonly string[];
92
- readonly servers: readonly {
93
- readonly description: Option.Option<string>;
94
- readonly url: string;
95
- readonly variables: Option.Option<{
96
- readonly [x: string]: {
97
- readonly default: string;
98
- readonly description: Option.Option<string>;
99
- readonly enum: Option.Option<readonly string[]>;
100
- };
101
- }>;
102
- }[];
103
- readonly securitySchemes: readonly {
104
- readonly name: string;
105
- readonly type: "oauth2" | "http" | "apiKey" | "openIdConnect";
106
- readonly in: Option.Option<"header" | "query" | "cookie">;
107
- readonly description: Option.Option<string>;
108
- readonly scheme: Option.Option<string>;
109
- readonly bearerFormat: Option.Option<string>;
110
- readonly headerName: Option.Option<string>;
111
- readonly flows: Option.Option<{
112
- readonly authorizationCode: Option.Option<{
113
- readonly authorizationUrl: string;
114
- readonly tokenUrl: string;
115
- readonly scopes: {
116
- readonly [x: string]: string;
117
- };
118
- readonly refreshUrl: Option.Option<string>;
119
- }>;
120
- readonly clientCredentials: Option.Option<{
121
- readonly tokenUrl: string;
122
- readonly scopes: {
123
- readonly [x: string]: string;
124
- };
125
- readonly refreshUrl: Option.Option<string>;
126
- }>;
127
- }>;
128
- readonly openIdConnectUrl: Option.Option<string>;
129
- }[];
130
- readonly authStrategies: readonly {
131
- readonly schemes: readonly string[];
132
- }[];
133
- readonly headerPresets: readonly {
134
- readonly label: string;
135
- readonly headers: {
136
- readonly [x: string]: string | null;
137
- };
138
- readonly secretHeaders: readonly string[];
139
- }[];
140
- readonly oauth2Presets: readonly {
141
- readonly label: string;
142
- readonly authorizationUrl: Option.Option<string>;
143
- readonly tokenUrl: string;
144
- readonly scopes: {
145
- readonly [x: string]: string;
146
- };
147
- readonly refreshUrl: Option.Option<string>;
148
- readonly flow: "authorizationCode" | "clientCredentials";
149
- readonly identityScopes: false | "auto" | readonly string[];
150
- readonly securitySchemeName: string;
151
- }[];
152
- readonly operationCount: number;
153
- }, OpenApiParseError | OpenApiExtractionError, never>;
154
- addSpec: (config: OpenApiSpecConfig) => Effect.Effect<{
155
- slug: string & import("effect/Brand").Brand<"IntegrationSlug">;
156
- toolCount: number;
157
- }, StorageFailure | IntegrationAlreadyExistsError | OpenApiParseError | OpenApiExtractionError | OpenApiOAuthError, never>;
158
- removeSpec: (slug: string) => Effect.Effect<void, StorageFailure, never>;
159
- getIntegration: (slug: string) => Effect.Effect<Integration | null, StorageFailure, never>;
160
- getConfig: (slug: string) => Effect.Effect<OpenApiIntegrationConfig | null, StorageFailure>;
161
- configure: (slug: string, input: OpenApiConfigureInput) => Effect.Effect<readonly Authentication[], StorageFailure>;
162
- }, OpenapiStore, OpenApiPluginOptions, undefined, Layer.Layer<unknown, never, never>, import("effect/unstable/httpapi/HttpApiGroup").Any>;
163
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,10 +0,0 @@
1
- export interface OpenApiPreset {
2
- readonly id: string;
3
- readonly name: string;
4
- readonly summary: string;
5
- readonly url?: string;
6
- readonly icon?: string;
7
- readonly featured?: boolean;
8
- }
9
- export { googleOpenApiPresets, googleStandardUserOAuthPresets } from "./google-presets";
10
- export declare const openApiPresets: readonly OpenApiPreset[];
@@ -1 +0,0 @@
1
- export {};