@executor-js/plugin-graphql 0.1.0 → 1.4.20

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 (37) hide show
  1. package/dist/AddGraphqlSource-3Z3DB4KQ.js +239 -0
  2. package/dist/AddGraphqlSource-3Z3DB4KQ.js.map +1 -0
  3. package/dist/EditGraphqlSource-F37RPNKV.js +251 -0
  4. package/dist/EditGraphqlSource-F37RPNKV.js.map +1 -0
  5. package/dist/GraphqlSourceSummary-6EYBXVD2.js +70 -0
  6. package/dist/GraphqlSourceSummary-6EYBXVD2.js.map +1 -0
  7. package/dist/api/group.d.ts +204 -13
  8. package/dist/api/handlers.d.ts +51 -3
  9. package/dist/api/index.d.ts +482 -0
  10. package/dist/chunk-445ZPXHU.js +148 -0
  11. package/dist/chunk-445ZPXHU.js.map +1 -0
  12. package/dist/chunk-EW4Y3KEX.js +182 -0
  13. package/dist/chunk-EW4Y3KEX.js.map +1 -0
  14. package/dist/chunk-M4SJY6CB.js +45 -0
  15. package/dist/chunk-M4SJY6CB.js.map +1 -0
  16. package/dist/chunk-PO2TPM5B.js +1636 -0
  17. package/dist/chunk-PO2TPM5B.js.map +1 -0
  18. package/dist/client.js +75 -0
  19. package/dist/client.js.map +1 -0
  20. package/dist/core.js +32 -10
  21. package/dist/index.js +2 -1
  22. package/dist/react/GraphqlSourceFields.d.ts +8 -0
  23. package/dist/react/GraphqlSourceSummary.d.ts +3 -1
  24. package/dist/react/atoms.d.ts +206 -10
  25. package/dist/react/client.d.ts +200 -12
  26. package/dist/sdk/index.d.ts +1 -1
  27. package/dist/sdk/introspect.d.ts +437 -43
  28. package/dist/sdk/invoke.d.ts +17 -3
  29. package/dist/sdk/plugin.d.ts +192 -170
  30. package/dist/sdk/store.d.ts +84 -11
  31. package/dist/sdk/types.d.ts +129 -30
  32. package/dist/testing/index.d.ts +52 -0
  33. package/dist/testing.js +131 -0
  34. package/dist/testing.js.map +1 -0
  35. package/package.json +18 -4
  36. package/dist/chunk-EIC5WI6C.js +0 -1225
  37. package/dist/chunk-EIC5WI6C.js.map +0 -1
@@ -1,13 +1,13 @@
1
1
  import { Effect } from "effect";
2
2
  import type { Layer } from "effect";
3
3
  import { HttpClient } from "effect/unstable/http";
4
- import { GraphqlExtensionService } from "../api/handlers";
5
- import { type StorageFailure } from "@executor-js/sdk/core";
4
+ import { type PluginCtx, type StorageFailure } from "@executor-js/sdk/core";
6
5
  import { type ConfigFileSink } from "@executor-js/config";
7
- import { GraphqlExtractionError, GraphqlIntrospectionError } from "./errors";
6
+ import { GraphqlIntrospectionError } from "./errors";
8
7
  import { type GraphqlStore, type StoredGraphqlSource } from "./store";
9
- import { type GraphqlSourceAuth, type HeaderValue as HeaderValueValue, type QueryParamValue } from "./types";
8
+ import { GraphqlSourceBindingInput, type ConfiguredGraphqlCredentialValue, type GraphqlCredentialInput, type HeaderValue as HeaderValueValue, type GraphqlSourceAuthInput } from "./types";
10
9
  export type HeaderValue = HeaderValueValue;
10
+ export type GraphqlCredentialValue = ConfiguredGraphqlCredentialValue;
11
11
  export interface GraphqlSourceConfig {
12
12
  /** The GraphQL endpoint URL */
13
13
  readonly endpoint: string;
@@ -24,50 +24,25 @@ export interface GraphqlSourceConfig {
24
24
  readonly introspectionJson?: string;
25
25
  /** Namespace for the tools (derived from endpoint if not provided) */
26
26
  readonly namespace?: string;
27
- /** Headers applied to every request. Values can reference secrets. */
28
- readonly headers?: Record<string, HeaderValue>;
29
- /** Query parameters applied to every request. Values can reference secrets. */
30
- readonly queryParams?: Record<string, QueryParamValue>;
31
- /** Optional OAuth2 connection used as a Bearer token for every request. */
32
- readonly auth?: GraphqlSourceAuth;
27
+ /** Headers applied to every request. Direct secrets are rewritten to slots. */
28
+ readonly headers?: Record<string, GraphqlCredentialInput>;
29
+ /** Query parameters applied to every request. Direct secrets are rewritten to slots. */
30
+ readonly queryParams?: Record<string, GraphqlCredentialInput>;
31
+ /**
32
+ * Scope that owns any direct credentials supplied on this call. Required
33
+ * whenever headers/queryParams/auth carry direct secret or connection ids.
34
+ */
35
+ readonly credentialTargetScope?: string;
36
+ /** Optional OAuth2 credential used as a Bearer token for every request. */
37
+ readonly auth?: GraphqlSourceAuthInput;
33
38
  }
34
39
  export interface GraphqlUpdateSourceInput {
35
40
  readonly name?: string;
36
41
  readonly endpoint?: string;
37
- readonly headers?: Record<string, HeaderValue>;
38
- readonly queryParams?: Record<string, QueryParamValue>;
39
- readonly auth?: GraphqlSourceAuth;
40
- }
41
- /**
42
- * Errors any GraphQL extension method may surface. `GraphqlIntrospectionError`
43
- * and `GraphqlExtractionError` are plugin-domain tagged errors that flow
44
- * directly to clients (4xx, each carrying its own `HttpApiSchema` status).
45
- * `StorageFailure` covers raw backend failures (`StorageError` plus
46
- * `UniqueViolationError`); the HTTP edge (`@executor-js/api`'s `withCapture`)
47
- * translates `StorageError` to the opaque `InternalError({ traceId })` at
48
- * Layer composition.
49
- */
50
- export type GraphqlExtensionFailure = GraphqlIntrospectionError | GraphqlExtractionError | StorageFailure;
51
- export interface GraphqlPluginExtension {
52
- /** Add a GraphQL endpoint and register its operations as tools */
53
- readonly addSource: (config: GraphqlSourceConfig) => Effect.Effect<{
54
- readonly toolCount: number;
55
- readonly namespace: string;
56
- }, GraphqlExtensionFailure>;
57
- /** Remove all tools from a previously added GraphQL source by namespace.
58
- * `scope` pins the cleanup to the exact row — without it a shadowed
59
- * outer-scope source with the same namespace could be wiped instead. */
60
- readonly removeSource: (namespace: string, scope: string) => Effect.Effect<void, StorageFailure>;
61
- /** Fetch the full stored source by namespace (or null if missing).
62
- * `scope` returns the exact row at that scope. For fall-through
63
- * reads across the executor's scope stack, use `executor.sources.*`. */
64
- readonly getSource: (namespace: string, scope: string) => Effect.Effect<StoredGraphqlSource | null, StorageFailure>;
65
- /** Update config (endpoint, headers) for an existing GraphQL source.
66
- * Does NOT re-introspect or re-register tools — just patches the
67
- * stored endpoint/headers used at invoke time. `scope` pins the
68
- * mutation to a single row so shadowed rows at other scopes are
69
- * untouched. */
70
- readonly updateSource: (namespace: string, scope: string, input: GraphqlUpdateSourceInput) => Effect.Effect<void, StorageFailure>;
42
+ readonly headers?: Record<string, GraphqlCredentialInput>;
43
+ readonly queryParams?: Record<string, GraphqlCredentialInput>;
44
+ readonly credentialTargetScope?: string;
45
+ readonly auth?: GraphqlSourceAuthInput;
71
46
  }
72
47
  export interface GraphqlPluginOptions {
73
48
  readonly httpClientLayer?: Layer.Layer<HttpClient.HttpClient>;
@@ -75,14 +50,102 @@ export interface GraphqlPluginOptions {
75
50
  * (best-effort — file errors are logged, not raised). */
76
51
  readonly configFile?: ConfigFileSink;
77
52
  }
53
+ declare const makeGraphqlExtension: (ctx: PluginCtx<GraphqlStore>, httpClientLayer: Layer.Layer<HttpClient.HttpClient>, configFile: ConfigFileSink | undefined) => {
54
+ addSource: (config: GraphqlSourceConfig) => Effect.Effect<{
55
+ toolCount: number;
56
+ namespace: string;
57
+ }, StorageFailure | GraphqlIntrospectionError | import("./errors").GraphqlExtractionError, never>;
58
+ removeSource: (namespace: string, scope: string) => Effect.Effect<void, StorageFailure, never>;
59
+ getSource: (namespace: string, scope: string) => Effect.Effect<StoredGraphqlSource | null, StorageFailure, never>;
60
+ updateSource: (namespace: string, scope: string, input: GraphqlUpdateSourceInput) => Effect.Effect<void, StorageFailure | GraphqlIntrospectionError, never>;
61
+ listSourceBindings: (sourceId: string, sourceScope: string) => Effect.Effect<readonly {
62
+ readonly value: {
63
+ readonly text: string;
64
+ readonly kind: "text";
65
+ } | {
66
+ readonly secretId: string & import("effect/Brand").Brand<"SecretId">;
67
+ readonly kind: "secret";
68
+ readonly secretScopeId?: (string & import("effect/Brand").Brand<"ScopeId">) | undefined;
69
+ } | {
70
+ readonly connectionId: string & import("effect/Brand").Brand<"ConnectionId">;
71
+ readonly kind: "connection";
72
+ };
73
+ readonly createdAt: Date;
74
+ readonly sourceId: string;
75
+ readonly scopeId: string & import("effect/Brand").Brand<"ScopeId">;
76
+ readonly updatedAt: Date;
77
+ readonly slot: string;
78
+ readonly sourceScopeId: string & import("effect/Brand").Brand<"ScopeId">;
79
+ }[], StorageFailure, never>;
80
+ setSourceBinding: (input: GraphqlSourceBindingInput) => Effect.Effect<{
81
+ readonly value: {
82
+ readonly text: string;
83
+ readonly kind: "text";
84
+ } | {
85
+ readonly secretId: string & import("effect/Brand").Brand<"SecretId">;
86
+ readonly kind: "secret";
87
+ readonly secretScopeId?: (string & import("effect/Brand").Brand<"ScopeId">) | undefined;
88
+ } | {
89
+ readonly connectionId: string & import("effect/Brand").Brand<"ConnectionId">;
90
+ readonly kind: "connection";
91
+ };
92
+ readonly createdAt: Date;
93
+ readonly sourceId: string;
94
+ readonly scopeId: string & import("effect/Brand").Brand<"ScopeId">;
95
+ readonly updatedAt: Date;
96
+ readonly slot: string;
97
+ readonly sourceScopeId: string & import("effect/Brand").Brand<"ScopeId">;
98
+ }, StorageFailure, never>;
99
+ removeSourceBinding: (sourceId: string, sourceScope: string, slot: string, scope: string) => Effect.Effect<void, StorageFailure, never>;
100
+ };
101
+ export type GraphqlPluginExtension = ReturnType<typeof makeGraphqlExtension>;
78
102
  export declare const graphqlPlugin: import("@executor-js/sdk/core").ConfiguredPlugin<"graphql", {
79
103
  addSource: (config: GraphqlSourceConfig) => Effect.Effect<{
80
- readonly toolCount: number;
81
- readonly namespace: string;
82
- }, StorageFailure | GraphqlIntrospectionError | GraphqlExtractionError, never>;
104
+ toolCount: number;
105
+ namespace: string;
106
+ }, StorageFailure | GraphqlIntrospectionError | import("./errors").GraphqlExtractionError, never>;
83
107
  removeSource: (namespace: string, scope: string) => Effect.Effect<void, StorageFailure, never>;
84
108
  getSource: (namespace: string, scope: string) => Effect.Effect<StoredGraphqlSource | null, StorageFailure, never>;
85
- updateSource: (namespace: string, scope: string, input: GraphqlUpdateSourceInput) => Effect.Effect<void, StorageFailure, never>;
109
+ updateSource: (namespace: string, scope: string, input: GraphqlUpdateSourceInput) => Effect.Effect<void, StorageFailure | GraphqlIntrospectionError, never>;
110
+ listSourceBindings: (sourceId: string, sourceScope: string) => Effect.Effect<readonly {
111
+ readonly value: {
112
+ readonly text: string;
113
+ readonly kind: "text";
114
+ } | {
115
+ readonly secretId: string & import("effect/Brand").Brand<"SecretId">;
116
+ readonly kind: "secret";
117
+ readonly secretScopeId?: (string & import("effect/Brand").Brand<"ScopeId">) | undefined;
118
+ } | {
119
+ readonly connectionId: string & import("effect/Brand").Brand<"ConnectionId">;
120
+ readonly kind: "connection";
121
+ };
122
+ readonly createdAt: Date;
123
+ readonly sourceId: string;
124
+ readonly scopeId: string & import("effect/Brand").Brand<"ScopeId">;
125
+ readonly updatedAt: Date;
126
+ readonly slot: string;
127
+ readonly sourceScopeId: string & import("effect/Brand").Brand<"ScopeId">;
128
+ }[], StorageFailure, never>;
129
+ setSourceBinding: (input: GraphqlSourceBindingInput) => Effect.Effect<{
130
+ readonly value: {
131
+ readonly text: string;
132
+ readonly kind: "text";
133
+ } | {
134
+ readonly secretId: string & import("effect/Brand").Brand<"SecretId">;
135
+ readonly kind: "secret";
136
+ readonly secretScopeId?: (string & import("effect/Brand").Brand<"ScopeId">) | undefined;
137
+ } | {
138
+ readonly connectionId: string & import("effect/Brand").Brand<"ConnectionId">;
139
+ readonly kind: "connection";
140
+ };
141
+ readonly createdAt: Date;
142
+ readonly sourceId: string;
143
+ readonly scopeId: string & import("effect/Brand").Brand<"ScopeId">;
144
+ readonly updatedAt: Date;
145
+ readonly slot: string;
146
+ readonly sourceScopeId: string & import("effect/Brand").Brand<"ScopeId">;
147
+ }, StorageFailure, never>;
148
+ removeSourceBinding: (sourceId: string, sourceScope: string, slot: string, scope: string) => Effect.Effect<void, StorageFailure, never>;
86
149
  }, GraphqlStore, GraphqlPluginOptions, {
87
150
  readonly graphql_source: {
88
151
  readonly fields: {
@@ -103,16 +166,89 @@ export declare const graphqlPlugin: import("@executor-js/sdk/core").ConfiguredPl
103
166
  readonly type: "string";
104
167
  readonly required: true;
105
168
  };
106
- readonly headers: {
107
- readonly type: "json";
169
+ readonly auth_kind: {
170
+ readonly type: ["none", "oauth2"];
171
+ readonly required: true;
172
+ readonly defaultValue: "none";
173
+ };
174
+ readonly auth_connection_slot: {
175
+ readonly type: "string";
108
176
  readonly required: false;
109
177
  };
110
- readonly query_params: {
111
- readonly type: "json";
178
+ };
179
+ };
180
+ readonly graphql_source_header: {
181
+ readonly fields: {
182
+ readonly id: {
183
+ readonly type: "string";
184
+ readonly required: true;
185
+ };
186
+ readonly scope_id: {
187
+ readonly type: "string";
188
+ readonly required: true;
189
+ readonly index: true;
190
+ };
191
+ readonly source_id: {
192
+ readonly type: "string";
193
+ readonly required: true;
194
+ readonly index: true;
195
+ };
196
+ readonly name: {
197
+ readonly type: "string";
198
+ readonly required: true;
199
+ };
200
+ readonly kind: {
201
+ readonly type: ["text", "binding"];
202
+ readonly required: true;
203
+ };
204
+ readonly text_value: {
205
+ readonly type: "string";
112
206
  readonly required: false;
113
207
  };
114
- readonly auth: {
115
- readonly type: "json";
208
+ readonly slot_key: {
209
+ readonly type: "string";
210
+ readonly required: false;
211
+ };
212
+ readonly prefix: {
213
+ readonly type: "string";
214
+ readonly required: false;
215
+ };
216
+ };
217
+ };
218
+ readonly graphql_source_query_param: {
219
+ readonly fields: {
220
+ readonly id: {
221
+ readonly type: "string";
222
+ readonly required: true;
223
+ };
224
+ readonly scope_id: {
225
+ readonly type: "string";
226
+ readonly required: true;
227
+ readonly index: true;
228
+ };
229
+ readonly source_id: {
230
+ readonly type: "string";
231
+ readonly required: true;
232
+ readonly index: true;
233
+ };
234
+ readonly name: {
235
+ readonly type: "string";
236
+ readonly required: true;
237
+ };
238
+ readonly kind: {
239
+ readonly type: ["text", "binding"];
240
+ readonly required: true;
241
+ };
242
+ readonly text_value: {
243
+ readonly type: "string";
244
+ readonly required: false;
245
+ };
246
+ readonly slot_key: {
247
+ readonly type: "string";
248
+ readonly required: false;
249
+ };
250
+ readonly prefix: {
251
+ readonly type: "string";
116
252
  readonly required: false;
117
253
  };
118
254
  };
@@ -139,119 +275,5 @@ export declare const graphqlPlugin: import("@executor-js/sdk/core").ConfiguredPl
139
275
  };
140
276
  };
141
277
  };
142
- }, typeof GraphqlExtensionService, Layer.Layer<import("effect/unstable/httpapi/HttpApiGroup").ApiGroup<"executor", "graphql">, never, import("effect/unstable/http/HttpRouter").Request<"Requires", GraphqlExtensionService>>, import("effect/unstable/httpapi/HttpApiGroup").HttpApiGroup<"graphql", import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"addSource", "POST", "/scopes/:scopeId/graphql/sources", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
143
- scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
144
- }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
145
- readonly endpoint: import("effect/Schema").String;
146
- readonly name: import("effect/Schema").optional<import("effect/Schema").String>;
147
- readonly introspectionJson: import("effect/Schema").optional<import("effect/Schema").String>;
148
- readonly namespace: import("effect/Schema").optional<import("effect/Schema").String>;
149
- readonly headers: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>;
150
- readonly queryParams: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>;
151
- readonly auth: import("effect/Schema").optional<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
152
- readonly kind: import("effect/Schema").Literal<"none">;
153
- }>, import("effect/Schema").Struct<{
154
- readonly kind: import("effect/Schema").Literal<"oauth2">;
155
- readonly connectionId: import("effect/Schema").String;
156
- }>]>>;
157
- }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
158
- readonly toolCount: import("effect/Schema").Number;
159
- readonly namespace: import("effect/Schema").String;
160
- }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | import("effect/Schema").decodeTo<import("effect/Schema").declareConstructor<GraphqlIntrospectionError, {
161
- readonly message: string;
162
- readonly _tag: "GraphqlIntrospectionError";
163
- }, readonly [import("effect/Schema").TaggedStruct<"GraphqlIntrospectionError", {
164
- readonly message: import("effect/Schema").String;
165
- }>], {
166
- readonly message: string;
167
- readonly _tag: "GraphqlIntrospectionError";
168
- }>, import("effect/Schema").TaggedStruct<"GraphqlIntrospectionError", {
169
- readonly message: import("effect/Schema").String;
170
- }>, never, never> | import("effect/Schema").decodeTo<import("effect/Schema").declareConstructor<GraphqlExtractionError, {
171
- readonly message: string;
172
- readonly _tag: "GraphqlExtractionError";
173
- }, readonly [import("effect/Schema").TaggedStruct<"GraphqlExtractionError", {
174
- readonly message: import("effect/Schema").String;
175
- }>], {
176
- readonly message: string;
177
- readonly _tag: "GraphqlExtractionError";
178
- }>, import("effect/Schema").TaggedStruct<"GraphqlExtractionError", {
179
- readonly message: import("effect/Schema").String;
180
- }>, never, never>>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"getSource", "GET", "/scopes/:scopeId/graphql/sources/:namespace", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
181
- scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
182
- namespace: import("effect/Schema").String;
183
- }>>, 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<{
184
- readonly namespace: import("effect/Schema").String;
185
- readonly name: import("effect/Schema").String;
186
- readonly endpoint: import("effect/Schema").String;
187
- readonly headers: import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").Struct<{
188
- readonly secretId: import("effect/Schema").String;
189
- readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
190
- }>]>>;
191
- readonly queryParams: import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").Struct<{
192
- readonly secretId: import("effect/Schema").String;
193
- readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
194
- }>]>>;
195
- readonly auth: import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
196
- readonly kind: import("effect/Schema").Literal<"none">;
197
- }>, import("effect/Schema").Struct<{
198
- readonly kind: import("effect/Schema").Literal<"oauth2">;
199
- readonly connectionId: import("effect/Schema").String;
200
- }>]>;
201
- }>>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | import("effect/Schema").decodeTo<import("effect/Schema").declareConstructor<GraphqlIntrospectionError, {
202
- readonly message: string;
203
- readonly _tag: "GraphqlIntrospectionError";
204
- }, readonly [import("effect/Schema").TaggedStruct<"GraphqlIntrospectionError", {
205
- readonly message: import("effect/Schema").String;
206
- }>], {
207
- readonly message: string;
208
- readonly _tag: "GraphqlIntrospectionError";
209
- }>, import("effect/Schema").TaggedStruct<"GraphqlIntrospectionError", {
210
- readonly message: import("effect/Schema").String;
211
- }>, never, never> | import("effect/Schema").decodeTo<import("effect/Schema").declareConstructor<GraphqlExtractionError, {
212
- readonly message: string;
213
- readonly _tag: "GraphqlExtractionError";
214
- }, readonly [import("effect/Schema").TaggedStruct<"GraphqlExtractionError", {
215
- readonly message: import("effect/Schema").String;
216
- }>], {
217
- readonly message: string;
218
- readonly _tag: "GraphqlExtractionError";
219
- }>, import("effect/Schema").TaggedStruct<"GraphqlExtractionError", {
220
- readonly message: import("effect/Schema").String;
221
- }>, never, never>>, never, never> | import("effect/unstable/httpapi/HttpApiEndpoint").HttpApiEndpoint<"updateSource", "PATCH", "/scopes/:scopeId/graphql/sources/:namespace", import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<import("effect/Schema").Struct<{
222
- scopeId: import("effect/Schema").brand<import("effect/Schema").String, "ScopeId">;
223
- namespace: import("effect/Schema").String;
224
- }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
225
- readonly name: import("effect/Schema").optional<import("effect/Schema").String>;
226
- readonly endpoint: import("effect/Schema").optional<import("effect/Schema").String>;
227
- readonly headers: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>;
228
- readonly queryParams: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Unknown>>;
229
- readonly auth: import("effect/Schema").optional<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
230
- readonly kind: import("effect/Schema").Literal<"none">;
231
- }>, import("effect/Schema").Struct<{
232
- readonly kind: import("effect/Schema").Literal<"oauth2">;
233
- readonly connectionId: import("effect/Schema").String;
234
- }>]>>;
235
- }>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
236
- readonly updated: import("effect/Schema").Boolean;
237
- }>>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<typeof import("@executor-js/api").InternalError | import("effect/Schema").decodeTo<import("effect/Schema").declareConstructor<GraphqlIntrospectionError, {
238
- readonly message: string;
239
- readonly _tag: "GraphqlIntrospectionError";
240
- }, readonly [import("effect/Schema").TaggedStruct<"GraphqlIntrospectionError", {
241
- readonly message: import("effect/Schema").String;
242
- }>], {
243
- readonly message: string;
244
- readonly _tag: "GraphqlIntrospectionError";
245
- }>, import("effect/Schema").TaggedStruct<"GraphqlIntrospectionError", {
246
- readonly message: import("effect/Schema").String;
247
- }>, never, never> | import("effect/Schema").decodeTo<import("effect/Schema").declareConstructor<GraphqlExtractionError, {
248
- readonly message: string;
249
- readonly _tag: "GraphqlExtractionError";
250
- }, readonly [import("effect/Schema").TaggedStruct<"GraphqlExtractionError", {
251
- readonly message: import("effect/Schema").String;
252
- }>], {
253
- readonly message: string;
254
- readonly _tag: "GraphqlExtractionError";
255
- }>, import("effect/Schema").TaggedStruct<"GraphqlExtractionError", {
256
- readonly message: import("effect/Schema").String;
257
- }>, never, never>>, never, never>, false>>;
278
+ }, undefined, Layer.Layer<unknown, never, never>, import("effect/unstable/httpapi/HttpApiGroup").Any>;
279
+ export {};
@@ -1,6 +1,6 @@
1
1
  import { Effect } from "effect";
2
2
  import { type StorageDeps, type StorageFailure } from "@executor-js/sdk/core";
3
- import { OperationBinding, type GraphqlSourceAuth, type HeaderValue, type QueryParamValue } from "./types";
3
+ import { OperationBinding, type ConfiguredGraphqlCredentialValue, type GraphqlSourceAuth } from "./types";
4
4
  export declare const graphqlSchema: {
5
5
  readonly graphql_source: {
6
6
  readonly fields: {
@@ -21,16 +21,89 @@ export declare const graphqlSchema: {
21
21
  readonly type: "string";
22
22
  readonly required: true;
23
23
  };
24
- readonly headers: {
25
- readonly type: "json";
24
+ readonly auth_kind: {
25
+ readonly type: ["none", "oauth2"];
26
+ readonly required: true;
27
+ readonly defaultValue: "none";
28
+ };
29
+ readonly auth_connection_slot: {
30
+ readonly type: "string";
26
31
  readonly required: false;
27
32
  };
28
- readonly query_params: {
29
- readonly type: "json";
33
+ };
34
+ };
35
+ readonly graphql_source_header: {
36
+ readonly fields: {
37
+ readonly id: {
38
+ readonly type: "string";
39
+ readonly required: true;
40
+ };
41
+ readonly scope_id: {
42
+ readonly type: "string";
43
+ readonly required: true;
44
+ readonly index: true;
45
+ };
46
+ readonly source_id: {
47
+ readonly type: "string";
48
+ readonly required: true;
49
+ readonly index: true;
50
+ };
51
+ readonly name: {
52
+ readonly type: "string";
53
+ readonly required: true;
54
+ };
55
+ readonly kind: {
56
+ readonly type: ["text", "binding"];
57
+ readonly required: true;
58
+ };
59
+ readonly text_value: {
60
+ readonly type: "string";
30
61
  readonly required: false;
31
62
  };
32
- readonly auth: {
33
- readonly type: "json";
63
+ readonly slot_key: {
64
+ readonly type: "string";
65
+ readonly required: false;
66
+ };
67
+ readonly prefix: {
68
+ readonly type: "string";
69
+ readonly required: false;
70
+ };
71
+ };
72
+ };
73
+ readonly graphql_source_query_param: {
74
+ readonly fields: {
75
+ readonly id: {
76
+ readonly type: "string";
77
+ readonly required: true;
78
+ };
79
+ readonly scope_id: {
80
+ readonly type: "string";
81
+ readonly required: true;
82
+ readonly index: true;
83
+ };
84
+ readonly source_id: {
85
+ readonly type: "string";
86
+ readonly required: true;
87
+ readonly index: true;
88
+ };
89
+ readonly name: {
90
+ readonly type: "string";
91
+ readonly required: true;
92
+ };
93
+ readonly kind: {
94
+ readonly type: ["text", "binding"];
95
+ readonly required: true;
96
+ };
97
+ readonly text_value: {
98
+ readonly type: "string";
99
+ readonly required: false;
100
+ };
101
+ readonly slot_key: {
102
+ readonly type: "string";
103
+ readonly required: false;
104
+ };
105
+ readonly prefix: {
106
+ readonly type: "string";
34
107
  readonly required: false;
35
108
  };
36
109
  };
@@ -67,8 +140,8 @@ export interface StoredGraphqlSource {
67
140
  readonly scope: string;
68
141
  readonly name: string;
69
142
  readonly endpoint: string;
70
- readonly headers: Record<string, HeaderValue>;
71
- readonly queryParams: Record<string, QueryParamValue>;
143
+ readonly headers: Record<string, ConfiguredGraphqlCredentialValue>;
144
+ readonly queryParams: Record<string, ConfiguredGraphqlCredentialValue>;
72
145
  readonly auth: GraphqlSourceAuth;
73
146
  }
74
147
  export interface StoredOperation {
@@ -81,8 +154,8 @@ export interface GraphqlStore {
81
154
  readonly updateSourceMeta: (namespace: string, scope: string, patch: {
82
155
  readonly name?: string;
83
156
  readonly endpoint?: string;
84
- readonly headers?: Record<string, HeaderValue>;
85
- readonly queryParams?: Record<string, QueryParamValue>;
157
+ readonly headers?: Record<string, ConfiguredGraphqlCredentialValue>;
158
+ readonly queryParams?: Record<string, ConfiguredGraphqlCredentialValue>;
86
159
  readonly auth?: GraphqlSourceAuth;
87
160
  }) => Effect.Effect<void, StorageFailure>;
88
161
  readonly getSource: (namespace: string, scope: string) => Effect.Effect<StoredGraphqlSource | null, StorageFailure>;