@executor-js/plugin-graphql 1.5.3 → 1.5.5
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 +158 -0
- package/dist/api/handlers.d.ts +17 -0
- package/dist/api/index.d.ts +169 -0
- package/dist/react/AddGraphqlSource.d.ts +5 -0
- package/dist/react/EditGraphqlSource.d.ts +4 -0
- package/dist/react/GraphqlAccountsPanel.d.ts +6 -0
- package/dist/react/GraphqlSignInButton.d.ts +7 -0
- package/dist/react/GraphqlSourceFields.d.ts +8 -0
- package/dist/react/atoms.d.ts +124 -0
- package/dist/react/auth-method-config.d.ts +9 -0
- package/dist/react/client.d.ts +154 -0
- package/dist/react/defaults.d.ts +16 -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/errors.d.ts +43 -0
- package/dist/sdk/extract.d.ts +11 -0
- package/dist/sdk/index.d.ts +7 -0
- package/dist/sdk/introspect.d.ts +440 -0
- package/dist/sdk/invoke.d.ts +20 -0
- package/dist/sdk/plugin.d.ts +115 -0
- package/dist/sdk/presets.d.ts +10 -0
- package/dist/sdk/store.d.ts +18 -0
- package/dist/sdk/types.d.ts +185 -0
- package/dist/testing/index.d.ts +70 -0
- package/package.json +3 -3
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
export declare const GraphqlClient: import("effect/unstable/reactivity/AtomHttpApi").AtomHttpApiClient<"Plugin_graphqlClient", `Plugin_${string}Client`, import("effect/unstable/httpapi/HttpApiGroup").HttpApiGroup<"graphql", import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"addIntegration", "POST", "/graphql/integrations", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
2
|
+
readonly endpoint: import("effect/Schema").String;
|
|
3
|
+
readonly slug: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
4
|
+
readonly name: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
5
|
+
readonly introspectionJson: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
6
|
+
readonly headers: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").String>>;
|
|
7
|
+
readonly queryParams: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").String>>;
|
|
8
|
+
readonly authenticationTemplate: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
9
|
+
readonly kind: import("effect/Schema").Literal<"apiKey">;
|
|
10
|
+
readonly slug: import("effect/Schema").String;
|
|
11
|
+
readonly in: import("effect/Schema").Literals<readonly ["header", "query"]>;
|
|
12
|
+
readonly name: import("effect/Schema").String;
|
|
13
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
14
|
+
}>, import("effect/Schema").Struct<{
|
|
15
|
+
readonly kind: import("effect/Schema").Literal<"oauth2">;
|
|
16
|
+
readonly slug: import("effect/Schema").String;
|
|
17
|
+
readonly header: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
18
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
19
|
+
}>]>>>;
|
|
20
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
21
|
+
readonly slug: import("effect/Schema").String;
|
|
22
|
+
readonly name: import("effect/Schema").String;
|
|
23
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/sdk").IntegrationAlreadyExistsError | typeof import("@executor-js/sdk").InternalError | import("effect/Schema").decodeTo<import("effect/Schema").declareConstructor<import("../sdk").GraphqlIntrospectionError, {
|
|
24
|
+
readonly message: string;
|
|
25
|
+
readonly _tag: "GraphqlIntrospectionError";
|
|
26
|
+
}, readonly [import("effect/Schema").TaggedStruct<"GraphqlIntrospectionError", {
|
|
27
|
+
readonly message: import("effect/Schema").String;
|
|
28
|
+
}>], {
|
|
29
|
+
readonly message: string;
|
|
30
|
+
readonly _tag: "GraphqlIntrospectionError";
|
|
31
|
+
}>, import("effect/Schema").TaggedStruct<"GraphqlIntrospectionError", {
|
|
32
|
+
readonly message: import("effect/Schema").String;
|
|
33
|
+
}>, never, never> | import("effect/Schema").decodeTo<import("effect/Schema").declareConstructor<import("../sdk").GraphqlExtractionError, {
|
|
34
|
+
readonly message: string;
|
|
35
|
+
readonly _tag: "GraphqlExtractionError";
|
|
36
|
+
}, readonly [import("effect/Schema").TaggedStruct<"GraphqlExtractionError", {
|
|
37
|
+
readonly message: import("effect/Schema").String;
|
|
38
|
+
}>], {
|
|
39
|
+
readonly message: string;
|
|
40
|
+
readonly _tag: "GraphqlExtractionError";
|
|
41
|
+
}>, import("effect/Schema").TaggedStruct<"GraphqlExtractionError", {
|
|
42
|
+
readonly message: import("effect/Schema").String;
|
|
43
|
+
}>, never, never>>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getIntegration", "GET", "/graphql/integrations/:slug", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
44
|
+
slug: import("effect/Schema").String;
|
|
45
|
+
}>>, 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").Unknown>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/sdk").IntegrationAlreadyExistsError | typeof import("@executor-js/sdk").InternalError | import("effect/Schema").decodeTo<import("effect/Schema").declareConstructor<import("../sdk").GraphqlIntrospectionError, {
|
|
46
|
+
readonly message: string;
|
|
47
|
+
readonly _tag: "GraphqlIntrospectionError";
|
|
48
|
+
}, readonly [import("effect/Schema").TaggedStruct<"GraphqlIntrospectionError", {
|
|
49
|
+
readonly message: import("effect/Schema").String;
|
|
50
|
+
}>], {
|
|
51
|
+
readonly message: string;
|
|
52
|
+
readonly _tag: "GraphqlIntrospectionError";
|
|
53
|
+
}>, import("effect/Schema").TaggedStruct<"GraphqlIntrospectionError", {
|
|
54
|
+
readonly message: import("effect/Schema").String;
|
|
55
|
+
}>, never, never> | import("effect/Schema").decodeTo<import("effect/Schema").declareConstructor<import("../sdk").GraphqlExtractionError, {
|
|
56
|
+
readonly message: string;
|
|
57
|
+
readonly _tag: "GraphqlExtractionError";
|
|
58
|
+
}, readonly [import("effect/Schema").TaggedStruct<"GraphqlExtractionError", {
|
|
59
|
+
readonly message: import("effect/Schema").String;
|
|
60
|
+
}>], {
|
|
61
|
+
readonly message: string;
|
|
62
|
+
readonly _tag: "GraphqlExtractionError";
|
|
63
|
+
}>, import("effect/Schema").TaggedStruct<"GraphqlExtractionError", {
|
|
64
|
+
readonly message: import("effect/Schema").String;
|
|
65
|
+
}>, never, never>>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getConfig", "GET", "/graphql/integrations/:slug/config", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
66
|
+
slug: import("effect/Schema").String;
|
|
67
|
+
}>>, 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<{
|
|
68
|
+
readonly endpoint: import("effect/Schema").String;
|
|
69
|
+
readonly name: import("effect/Schema").String;
|
|
70
|
+
readonly introspectionJson: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
71
|
+
readonly headers: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").String>>;
|
|
72
|
+
readonly queryParams: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").String>>;
|
|
73
|
+
readonly authenticationTemplate: import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
74
|
+
readonly kind: import("effect/Schema").Literal<"apiKey">;
|
|
75
|
+
readonly slug: import("effect/Schema").String;
|
|
76
|
+
readonly in: import("effect/Schema").Literals<readonly ["header", "query"]>;
|
|
77
|
+
readonly name: import("effect/Schema").String;
|
|
78
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
79
|
+
}>, import("effect/Schema").Struct<{
|
|
80
|
+
readonly kind: import("effect/Schema").Literal<"oauth2">;
|
|
81
|
+
readonly slug: import("effect/Schema").String;
|
|
82
|
+
readonly header: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
83
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
84
|
+
}>]>>;
|
|
85
|
+
}>>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/sdk").IntegrationAlreadyExistsError | typeof import("@executor-js/sdk").InternalError | import("effect/Schema").decodeTo<import("effect/Schema").declareConstructor<import("../sdk").GraphqlIntrospectionError, {
|
|
86
|
+
readonly message: string;
|
|
87
|
+
readonly _tag: "GraphqlIntrospectionError";
|
|
88
|
+
}, readonly [import("effect/Schema").TaggedStruct<"GraphqlIntrospectionError", {
|
|
89
|
+
readonly message: import("effect/Schema").String;
|
|
90
|
+
}>], {
|
|
91
|
+
readonly message: string;
|
|
92
|
+
readonly _tag: "GraphqlIntrospectionError";
|
|
93
|
+
}>, import("effect/Schema").TaggedStruct<"GraphqlIntrospectionError", {
|
|
94
|
+
readonly message: import("effect/Schema").String;
|
|
95
|
+
}>, never, never> | import("effect/Schema").decodeTo<import("effect/Schema").declareConstructor<import("../sdk").GraphqlExtractionError, {
|
|
96
|
+
readonly message: string;
|
|
97
|
+
readonly _tag: "GraphqlExtractionError";
|
|
98
|
+
}, readonly [import("effect/Schema").TaggedStruct<"GraphqlExtractionError", {
|
|
99
|
+
readonly message: import("effect/Schema").String;
|
|
100
|
+
}>], {
|
|
101
|
+
readonly message: string;
|
|
102
|
+
readonly _tag: "GraphqlExtractionError";
|
|
103
|
+
}>, import("effect/Schema").TaggedStruct<"GraphqlExtractionError", {
|
|
104
|
+
readonly message: import("effect/Schema").String;
|
|
105
|
+
}>, never, never>>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"configure", "POST", "/graphql/integrations/:slug/config", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
|
|
106
|
+
slug: import("effect/Schema").String;
|
|
107
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
108
|
+
readonly authenticationTemplate: import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
109
|
+
readonly kind: import("effect/Schema").Literal<"apiKey">;
|
|
110
|
+
readonly slug: import("effect/Schema").String;
|
|
111
|
+
readonly in: import("effect/Schema").Literals<readonly ["header", "query"]>;
|
|
112
|
+
readonly name: import("effect/Schema").String;
|
|
113
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
114
|
+
}>, import("effect/Schema").Struct<{
|
|
115
|
+
readonly kind: import("effect/Schema").Literal<"oauth2">;
|
|
116
|
+
readonly slug: import("effect/Schema").String;
|
|
117
|
+
readonly header: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
118
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
119
|
+
}>]>>;
|
|
120
|
+
readonly mode: import("effect/Schema").optional<import("effect/Schema").Literals<readonly ["merge", "replace"]>>;
|
|
121
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
122
|
+
readonly authenticationTemplate: import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
123
|
+
readonly kind: import("effect/Schema").Literal<"apiKey">;
|
|
124
|
+
readonly slug: import("effect/Schema").String;
|
|
125
|
+
readonly in: import("effect/Schema").Literals<readonly ["header", "query"]>;
|
|
126
|
+
readonly name: import("effect/Schema").String;
|
|
127
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
128
|
+
}>, import("effect/Schema").Struct<{
|
|
129
|
+
readonly kind: import("effect/Schema").Literal<"oauth2">;
|
|
130
|
+
readonly slug: import("effect/Schema").String;
|
|
131
|
+
readonly header: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
132
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
133
|
+
}>]>>;
|
|
134
|
+
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/sdk").IntegrationAlreadyExistsError | typeof import("@executor-js/sdk").InternalError | import("effect/Schema").decodeTo<import("effect/Schema").declareConstructor<import("../sdk").GraphqlIntrospectionError, {
|
|
135
|
+
readonly message: string;
|
|
136
|
+
readonly _tag: "GraphqlIntrospectionError";
|
|
137
|
+
}, readonly [import("effect/Schema").TaggedStruct<"GraphqlIntrospectionError", {
|
|
138
|
+
readonly message: import("effect/Schema").String;
|
|
139
|
+
}>], {
|
|
140
|
+
readonly message: string;
|
|
141
|
+
readonly _tag: "GraphqlIntrospectionError";
|
|
142
|
+
}>, import("effect/Schema").TaggedStruct<"GraphqlIntrospectionError", {
|
|
143
|
+
readonly message: import("effect/Schema").String;
|
|
144
|
+
}>, never, never> | import("effect/Schema").decodeTo<import("effect/Schema").declareConstructor<import("../sdk").GraphqlExtractionError, {
|
|
145
|
+
readonly message: string;
|
|
146
|
+
readonly _tag: "GraphqlExtractionError";
|
|
147
|
+
}, readonly [import("effect/Schema").TaggedStruct<"GraphqlExtractionError", {
|
|
148
|
+
readonly message: import("effect/Schema").String;
|
|
149
|
+
}>], {
|
|
150
|
+
readonly message: string;
|
|
151
|
+
readonly _tag: "GraphqlExtractionError";
|
|
152
|
+
}>, import("effect/Schema").TaggedStruct<"GraphqlExtractionError", {
|
|
153
|
+
readonly message: import("effect/Schema").String;
|
|
154
|
+
}>, never, never>>, never, never>, false>>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ConnectionName, Owner } from "@executor-js/sdk/shared";
|
|
2
|
+
/** The slug of the apiKey auth template the add flow declares + targets. */
|
|
3
|
+
export declare const GRAPHQL_APIKEY_TEMPLATE = "apiKey";
|
|
4
|
+
/** Build the apiKey auth template the integration stores. The connection's
|
|
5
|
+
* value is written to `headerName` at invoke time (no prefix — the user pastes
|
|
6
|
+
* the full header value, e.g. `Bearer ghp_…`). */
|
|
7
|
+
export declare const graphqlApiKeyAuthTemplate: (headerName: string) => {
|
|
8
|
+
readonly kind: "apiKey";
|
|
9
|
+
readonly slug: string;
|
|
10
|
+
readonly in: "header";
|
|
11
|
+
readonly name: string;
|
|
12
|
+
};
|
|
13
|
+
/** Deterministic connection name for a GraphQL integration + owner. Keeps a
|
|
14
|
+
* single owner-scoped credential per integration so re-adding overwrites
|
|
15
|
+
* rather than accumulating duplicates. */
|
|
16
|
+
export declare const graphqlConnectionName: (slug: string, owner: Owner) => ConnectionName;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
import type { Option } from "effect";
|
|
3
|
+
import type { AuthToolFailureCode } from "@executor-js/sdk/core";
|
|
4
|
+
declare const GraphqlIntrospectionError_base: Schema.Class<GraphqlIntrospectionError, Schema.TaggedStruct<"GraphqlIntrospectionError", {
|
|
5
|
+
readonly message: Schema.String;
|
|
6
|
+
}>, import("effect/Cause").YieldableError>;
|
|
7
|
+
export declare class GraphqlIntrospectionError extends GraphqlIntrospectionError_base {
|
|
8
|
+
}
|
|
9
|
+
declare const GraphqlExtractionError_base: Schema.Class<GraphqlExtractionError, Schema.TaggedStruct<"GraphqlExtractionError", {
|
|
10
|
+
readonly message: Schema.String;
|
|
11
|
+
}>, import("effect/Cause").YieldableError>;
|
|
12
|
+
export declare class GraphqlExtractionError extends GraphqlExtractionError_base {
|
|
13
|
+
}
|
|
14
|
+
declare const GraphqlInvocationError_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: "GraphqlInvocationError";
|
|
16
|
+
} & Readonly<A>;
|
|
17
|
+
export declare class GraphqlInvocationError extends GraphqlInvocationError_base<{
|
|
18
|
+
readonly message: string;
|
|
19
|
+
readonly statusCode: Option.Option<number>;
|
|
20
|
+
readonly cause?: unknown;
|
|
21
|
+
}> {
|
|
22
|
+
}
|
|
23
|
+
declare const GraphqlAuthRequiredError_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 & {
|
|
24
|
+
readonly _tag: "GraphqlAuthRequiredError";
|
|
25
|
+
} & Readonly<A>;
|
|
26
|
+
/** A tool invocation could not produce a usable credential. Re-keyed for v2:
|
|
27
|
+
* references the connection by (owner, integration, name) instead of a v1
|
|
28
|
+
* source id + scope. */
|
|
29
|
+
export declare class GraphqlAuthRequiredError extends GraphqlAuthRequiredError_base<{
|
|
30
|
+
readonly code: AuthToolFailureCode;
|
|
31
|
+
readonly message: string;
|
|
32
|
+
readonly owner: string;
|
|
33
|
+
readonly integration: string;
|
|
34
|
+
readonly connection: string;
|
|
35
|
+
readonly credentialKind: "secret" | "oauth" | "upstream";
|
|
36
|
+
readonly credentialLabel?: string;
|
|
37
|
+
readonly template?: string;
|
|
38
|
+
readonly status?: number;
|
|
39
|
+
readonly details?: unknown;
|
|
40
|
+
readonly cause?: unknown;
|
|
41
|
+
}> {
|
|
42
|
+
}
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { GraphqlExtractionError } from "./errors";
|
|
3
|
+
import type { IntrospectionResult } from "./introspect";
|
|
4
|
+
import { ExtractionResult } from "./types";
|
|
5
|
+
export interface ExtractionOutput {
|
|
6
|
+
readonly result: ExtractionResult;
|
|
7
|
+
/** Shared JSON Schema definitions for INPUT_OBJECT and ENUM types.
|
|
8
|
+
* Tool input schemas use `$ref` pointers into these. */
|
|
9
|
+
readonly definitions: Record<string, unknown>;
|
|
10
|
+
}
|
|
11
|
+
export declare const extract: (introspection: IntrospectionResult) => Effect.Effect<ExtractionOutput, GraphqlExtractionError>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { introspect, parseIntrospectionJson } from "./introspect";
|
|
2
|
+
export { extract, type ExtractionOutput } from "./extract";
|
|
3
|
+
export { invoke, invokeWithLayer } from "./invoke";
|
|
4
|
+
export { describeGraphqlAuthMethods, graphqlPlugin, type GraphqlPluginExtension, type GraphqlPluginOptions, type GraphqlAddIntegrationInput, type GraphqlConfigureInput, type GraphqlConfigureAuthInput, } from "./plugin";
|
|
5
|
+
export { makeDefaultGraphqlStore, type GraphqlStore, type StoredOperation } from "./store";
|
|
6
|
+
export { GraphqlIntrospectionError, GraphqlExtractionError, GraphqlInvocationError, GraphqlAuthRequiredError, } from "./errors";
|
|
7
|
+
export { ApiKeyAuthTemplate, AuthTemplate, decodeGraphqlIntegrationConfig, decodeGraphqlIntegrationConfigOption, ExtractedField, ExtractionResult, GraphqlArgument, GraphqlIntegrationConfig, GraphqlOperationKind, InvocationResult, OAuthAuthTemplate, OperationBinding, type ApiKeyAuthTemplate as ApiKeyAuthTemplateType, } from "./types";
|