@executor-js/plugin-graphql 1.4.29 → 1.4.31
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/{AddGraphqlSource-3Z3DB4KQ.js → AddGraphqlSource-PBMKSY7Y.js} +29 -18
- package/dist/AddGraphqlSource-PBMKSY7Y.js.map +1 -0
- package/dist/{EditGraphqlSource-F37RPNKV.js → EditGraphqlSource-AFR4RQHY.js} +107 -91
- package/dist/EditGraphqlSource-AFR4RQHY.js.map +1 -0
- package/dist/{GraphqlSourceSummary-6EYBXVD2.js → GraphqlSourceSummary-MY4AW37M.js} +4 -4
- package/dist/GraphqlSourceSummary-MY4AW37M.js.map +1 -0
- package/dist/api/group.d.ts +71 -232
- package/dist/api/handlers.d.ts +5 -45
- package/dist/api/index.d.ts +76 -404
- package/dist/{chunk-PO2TPM5B.js → chunk-7S2FM3ZF.js} +578 -613
- package/dist/chunk-7S2FM3ZF.js.map +1 -0
- package/dist/chunk-D6E4WAYW.js +51 -0
- package/dist/chunk-D6E4WAYW.js.map +1 -0
- package/dist/{chunk-445ZPXHU.js → chunk-H422YIM4.js} +15 -34
- package/dist/chunk-H422YIM4.js.map +1 -0
- package/dist/{chunk-EW4Y3KEX.js → chunk-OYUIHBWZ.js} +23 -80
- package/dist/chunk-OYUIHBWZ.js.map +1 -0
- package/dist/client.js +7 -47
- package/dist/client.js.map +1 -1
- package/dist/core.js +3 -8
- package/dist/index.js +3 -2
- package/dist/react/atoms.d.ts +146 -186
- package/dist/react/client.d.ts +70 -231
- package/dist/sdk/index.d.ts +2 -2
- package/dist/sdk/introspect.d.ts +151 -151
- package/dist/sdk/invoke.d.ts +5 -5
- package/dist/sdk/plugin.d.ts +74 -228
- package/dist/sdk/presets.d.ts +1 -0
- package/dist/sdk/store.d.ts +3 -135
- package/dist/sdk/types.d.ts +31 -66
- package/dist/testing/index.d.ts +20 -2
- package/dist/testing.js +77 -29
- package/dist/testing.js.map +1 -1
- package/package.json +3 -3
- package/dist/AddGraphqlSource-3Z3DB4KQ.js.map +0 -1
- package/dist/EditGraphqlSource-F37RPNKV.js.map +0 -1
- package/dist/GraphqlSourceSummary-6EYBXVD2.js.map +0 -1
- package/dist/chunk-445ZPXHU.js.map +0 -1
- package/dist/chunk-EW4Y3KEX.js.map +0 -1
- package/dist/chunk-PO2TPM5B.js.map +0 -1
package/dist/sdk/plugin.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { Effect } from "effect";
|
|
1
|
+
import { Effect, Schema } from "effect";
|
|
2
2
|
import type { Layer } from "effect";
|
|
3
3
|
import { HttpClient } from "effect/unstable/http";
|
|
4
4
|
import { type PluginCtx, type StorageFailure } from "@executor-js/sdk/core";
|
|
5
|
+
import { OAuth2SourceConfig } from "@executor-js/sdk/http-source";
|
|
5
6
|
import { type ConfigFileSink } from "@executor-js/config";
|
|
6
7
|
import { GraphqlIntrospectionError } from "./errors";
|
|
7
8
|
import { type GraphqlStore, type StoredGraphqlSource } from "./store";
|
|
8
|
-
import {
|
|
9
|
+
import { type ConfiguredGraphqlCredentialValue, type GraphqlConfiguredValueInput, type GraphqlCredentialInput, type HeaderValue as HeaderValueValue, type GraphqlSourceAuthInput } from "./types";
|
|
9
10
|
export type HeaderValue = HeaderValueValue;
|
|
10
11
|
export type GraphqlCredentialValue = ConfiguredGraphqlCredentialValue;
|
|
11
12
|
export interface GraphqlSourceConfig {
|
|
@@ -18,30 +19,80 @@ export interface GraphqlSourceConfig {
|
|
|
18
19
|
* every inner (per-user) scope via fall-through reads.
|
|
19
20
|
*/
|
|
20
21
|
readonly scope: string;
|
|
21
|
-
/** Display name for the source.
|
|
22
|
-
readonly name
|
|
22
|
+
/** Display name for the source. */
|
|
23
|
+
readonly name: string;
|
|
23
24
|
/** Optional: introspection JSON text (if endpoint doesn't support introspection) */
|
|
24
25
|
readonly introspectionJson?: string;
|
|
25
|
-
/** Namespace for the tools
|
|
26
|
-
readonly namespace
|
|
27
|
-
/** Headers applied to every request.
|
|
28
|
-
readonly headers?: Record<string,
|
|
29
|
-
/** Query parameters applied to every request.
|
|
30
|
-
readonly queryParams?: Record<string,
|
|
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;
|
|
26
|
+
/** Namespace for the tools. */
|
|
27
|
+
readonly namespace: string;
|
|
28
|
+
/** Headers applied to every request. Secret entries declare source-owned slots. */
|
|
29
|
+
readonly headers?: Record<string, GraphqlConfiguredValueInput>;
|
|
30
|
+
/** Query parameters applied to every request. Secret entries declare source-owned slots. */
|
|
31
|
+
readonly queryParams?: Record<string, GraphqlConfiguredValueInput>;
|
|
36
32
|
/** Optional OAuth2 credential used as a Bearer token for every request. */
|
|
37
|
-
readonly
|
|
33
|
+
readonly oauth2?: OAuth2SourceConfig;
|
|
34
|
+
/** Initial credential bindings used while adding and introspecting this source. */
|
|
35
|
+
readonly credentials?: GraphqlInitialCredentialsInput;
|
|
36
|
+
}
|
|
37
|
+
declare const GraphqlInitialCredentialsInputSchema: Schema.Struct<{
|
|
38
|
+
readonly scope: Schema.String;
|
|
39
|
+
readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
40
|
+
readonly kind: Schema.Literal<"text">;
|
|
41
|
+
readonly text: Schema.String;
|
|
42
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
43
|
+
}>, Schema.Struct<{
|
|
44
|
+
readonly kind: Schema.Literal<"secret">;
|
|
45
|
+
readonly secretId: Schema.String;
|
|
46
|
+
readonly secretScope: Schema.optional<Schema.String>;
|
|
47
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
48
|
+
}>, Schema.Struct<{
|
|
49
|
+
readonly kind: Schema.Literal<"connection">;
|
|
50
|
+
readonly connectionId: Schema.String;
|
|
51
|
+
}>]>>>;
|
|
52
|
+
readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
53
|
+
readonly kind: Schema.Literal<"text">;
|
|
54
|
+
readonly text: Schema.String;
|
|
55
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
56
|
+
}>, Schema.Struct<{
|
|
57
|
+
readonly kind: Schema.Literal<"secret">;
|
|
58
|
+
readonly secretId: Schema.String;
|
|
59
|
+
readonly secretScope: Schema.optional<Schema.String>;
|
|
60
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
61
|
+
}>, Schema.Struct<{
|
|
62
|
+
readonly kind: Schema.Literal<"connection">;
|
|
63
|
+
readonly connectionId: Schema.String;
|
|
64
|
+
}>]>>>;
|
|
65
|
+
readonly auth: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
66
|
+
readonly kind: Schema.Literal<"none">;
|
|
67
|
+
}>, Schema.Struct<{
|
|
68
|
+
readonly oauth2: Schema.optional<Schema.Struct<{
|
|
69
|
+
readonly connection: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
70
|
+
readonly kind: Schema.Literal<"text">;
|
|
71
|
+
readonly text: Schema.String;
|
|
72
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
73
|
+
}>, Schema.Struct<{
|
|
74
|
+
readonly kind: Schema.Literal<"secret">;
|
|
75
|
+
readonly secretId: Schema.String;
|
|
76
|
+
readonly secretScope: Schema.optional<Schema.String>;
|
|
77
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
78
|
+
}>, Schema.Struct<{
|
|
79
|
+
readonly kind: Schema.Literal<"connection">;
|
|
80
|
+
readonly connectionId: Schema.String;
|
|
81
|
+
}>]>>;
|
|
82
|
+
}>>;
|
|
83
|
+
}>]>>;
|
|
84
|
+
}>;
|
|
85
|
+
type GraphqlInitialCredentialsInput = typeof GraphqlInitialCredentialsInputSchema.Type;
|
|
86
|
+
export interface GraphqlSourceRef {
|
|
87
|
+
readonly id: string;
|
|
88
|
+
readonly scope: string;
|
|
38
89
|
}
|
|
39
|
-
export interface
|
|
90
|
+
export interface GraphqlConfigureSourceInput {
|
|
91
|
+
readonly scope: string;
|
|
40
92
|
readonly name?: string;
|
|
41
93
|
readonly endpoint?: string;
|
|
42
94
|
readonly headers?: Record<string, GraphqlCredentialInput>;
|
|
43
95
|
readonly queryParams?: Record<string, GraphqlCredentialInput>;
|
|
44
|
-
readonly credentialTargetScope?: string;
|
|
45
96
|
readonly auth?: GraphqlSourceAuthInput;
|
|
46
97
|
}
|
|
47
98
|
export interface GraphqlPluginOptions {
|
|
@@ -57,46 +108,8 @@ declare const makeGraphqlExtension: (ctx: PluginCtx<GraphqlStore>, httpClientLay
|
|
|
57
108
|
}, StorageFailure | GraphqlIntrospectionError | import("./errors").GraphqlExtractionError, never>;
|
|
58
109
|
removeSource: (namespace: string, scope: string) => Effect.Effect<void, StorageFailure, never>;
|
|
59
110
|
getSource: (namespace: string, scope: string) => Effect.Effect<StoredGraphqlSource | null, StorageFailure, never>;
|
|
60
|
-
|
|
61
|
-
|
|
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>;
|
|
111
|
+
configureSource: (namespace: string, scope: string, targetScope: string, input: Omit<GraphqlConfigureSourceInput, "scope">) => Effect.Effect<void, StorageFailure, never>;
|
|
112
|
+
configure: (source: GraphqlSourceRef, input: GraphqlConfigureSourceInput) => Effect.Effect<void, StorageFailure, never>;
|
|
100
113
|
};
|
|
101
114
|
export type GraphqlPluginExtension = ReturnType<typeof makeGraphqlExtension>;
|
|
102
115
|
export declare const graphqlPlugin: import("@executor-js/sdk/core").ConfiguredPlugin<"graphql", {
|
|
@@ -106,174 +119,7 @@ export declare const graphqlPlugin: import("@executor-js/sdk/core").ConfiguredPl
|
|
|
106
119
|
}, StorageFailure | GraphqlIntrospectionError | import("./errors").GraphqlExtractionError, never>;
|
|
107
120
|
removeSource: (namespace: string, scope: string) => Effect.Effect<void, StorageFailure, never>;
|
|
108
121
|
getSource: (namespace: string, scope: string) => Effect.Effect<StoredGraphqlSource | null, StorageFailure, never>;
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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>;
|
|
149
|
-
}, GraphqlStore, GraphqlPluginOptions, {
|
|
150
|
-
readonly graphql_source: {
|
|
151
|
-
readonly fields: {
|
|
152
|
-
readonly id: {
|
|
153
|
-
readonly type: "string";
|
|
154
|
-
readonly required: true;
|
|
155
|
-
};
|
|
156
|
-
readonly scope_id: {
|
|
157
|
-
readonly type: "string";
|
|
158
|
-
readonly required: true;
|
|
159
|
-
readonly index: true;
|
|
160
|
-
};
|
|
161
|
-
readonly name: {
|
|
162
|
-
readonly type: "string";
|
|
163
|
-
readonly required: true;
|
|
164
|
-
};
|
|
165
|
-
readonly endpoint: {
|
|
166
|
-
readonly type: "string";
|
|
167
|
-
readonly required: true;
|
|
168
|
-
};
|
|
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";
|
|
176
|
-
readonly required: false;
|
|
177
|
-
};
|
|
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";
|
|
206
|
-
readonly required: false;
|
|
207
|
-
};
|
|
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";
|
|
252
|
-
readonly required: false;
|
|
253
|
-
};
|
|
254
|
-
};
|
|
255
|
-
};
|
|
256
|
-
readonly graphql_operation: {
|
|
257
|
-
readonly fields: {
|
|
258
|
-
readonly id: {
|
|
259
|
-
readonly type: "string";
|
|
260
|
-
readonly required: true;
|
|
261
|
-
};
|
|
262
|
-
readonly scope_id: {
|
|
263
|
-
readonly type: "string";
|
|
264
|
-
readonly required: true;
|
|
265
|
-
readonly index: true;
|
|
266
|
-
};
|
|
267
|
-
readonly source_id: {
|
|
268
|
-
readonly type: "string";
|
|
269
|
-
readonly required: true;
|
|
270
|
-
readonly index: true;
|
|
271
|
-
};
|
|
272
|
-
readonly binding: {
|
|
273
|
-
readonly type: "json";
|
|
274
|
-
readonly required: true;
|
|
275
|
-
};
|
|
276
|
-
};
|
|
277
|
-
};
|
|
278
|
-
}, undefined, Layer.Layer<unknown, never, never>, import("effect/unstable/httpapi/HttpApiGroup").Any>;
|
|
122
|
+
configureSource: (namespace: string, scope: string, targetScope: string, input: Omit<GraphqlConfigureSourceInput, "scope">) => Effect.Effect<void, StorageFailure, never>;
|
|
123
|
+
configure: (source: GraphqlSourceRef, input: GraphqlConfigureSourceInput) => Effect.Effect<void, StorageFailure, never>;
|
|
124
|
+
}, GraphqlStore, GraphqlPluginOptions, {}, undefined, Layer.Layer<unknown, never, never>, import("effect/unstable/httpapi/HttpApiGroup").Any>;
|
|
279
125
|
export {};
|
package/dist/sdk/presets.d.ts
CHANGED
package/dist/sdk/store.d.ts
CHANGED
|
@@ -1,142 +1,10 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import { type StorageDeps, type StorageFailure } from "@executor-js/sdk/core";
|
|
3
|
-
import { OperationBinding, type ConfiguredGraphqlCredentialValue
|
|
4
|
-
export declare const graphqlSchema: {
|
|
5
|
-
readonly graphql_source: {
|
|
6
|
-
readonly fields: {
|
|
7
|
-
readonly id: {
|
|
8
|
-
readonly type: "string";
|
|
9
|
-
readonly required: true;
|
|
10
|
-
};
|
|
11
|
-
readonly scope_id: {
|
|
12
|
-
readonly type: "string";
|
|
13
|
-
readonly required: true;
|
|
14
|
-
readonly index: true;
|
|
15
|
-
};
|
|
16
|
-
readonly name: {
|
|
17
|
-
readonly type: "string";
|
|
18
|
-
readonly required: true;
|
|
19
|
-
};
|
|
20
|
-
readonly endpoint: {
|
|
21
|
-
readonly type: "string";
|
|
22
|
-
readonly required: true;
|
|
23
|
-
};
|
|
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";
|
|
31
|
-
readonly required: false;
|
|
32
|
-
};
|
|
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";
|
|
61
|
-
readonly required: false;
|
|
62
|
-
};
|
|
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";
|
|
107
|
-
readonly required: false;
|
|
108
|
-
};
|
|
109
|
-
};
|
|
110
|
-
};
|
|
111
|
-
readonly graphql_operation: {
|
|
112
|
-
readonly fields: {
|
|
113
|
-
readonly id: {
|
|
114
|
-
readonly type: "string";
|
|
115
|
-
readonly required: true;
|
|
116
|
-
};
|
|
117
|
-
readonly scope_id: {
|
|
118
|
-
readonly type: "string";
|
|
119
|
-
readonly required: true;
|
|
120
|
-
readonly index: true;
|
|
121
|
-
};
|
|
122
|
-
readonly source_id: {
|
|
123
|
-
readonly type: "string";
|
|
124
|
-
readonly required: true;
|
|
125
|
-
readonly index: true;
|
|
126
|
-
};
|
|
127
|
-
readonly binding: {
|
|
128
|
-
readonly type: "json";
|
|
129
|
-
readonly required: true;
|
|
130
|
-
};
|
|
131
|
-
};
|
|
132
|
-
};
|
|
133
|
-
};
|
|
3
|
+
import { GraphqlSourceAuth, OperationBinding, type ConfiguredGraphqlCredentialValue } from "./types";
|
|
4
|
+
export declare const graphqlSchema: {};
|
|
134
5
|
export type GraphqlSchema = typeof graphqlSchema;
|
|
135
6
|
export interface StoredGraphqlSource {
|
|
136
7
|
readonly namespace: string;
|
|
137
|
-
/** Executor scope id this source row lives in. Writes stamp this on
|
|
138
|
-
* `scope_id`; reads return whichever scope's row the adapter's
|
|
139
|
-
* fall-through walk surfaced first. */
|
|
140
8
|
readonly scope: string;
|
|
141
9
|
readonly name: string;
|
|
142
10
|
readonly endpoint: string;
|
|
@@ -164,4 +32,4 @@ export interface GraphqlStore {
|
|
|
164
32
|
readonly listOperationsBySource: (sourceId: string, scope: string) => Effect.Effect<readonly StoredOperation[], StorageFailure>;
|
|
165
33
|
readonly removeSource: (namespace: string, scope: string) => Effect.Effect<void, StorageFailure>;
|
|
166
34
|
}
|
|
167
|
-
export declare const makeDefaultGraphqlStore: ({
|
|
35
|
+
export declare const makeDefaultGraphqlStore: ({ pluginStorage, }: StorageDeps<GraphqlSchema>) => GraphqlStore;
|
package/dist/sdk/types.d.ts
CHANGED
|
@@ -73,19 +73,24 @@ export declare const ConfiguredGraphqlCredentialValue: Schema.Union<readonly [Sc
|
|
|
73
73
|
readonly prefix: Schema.optional<Schema.String>;
|
|
74
74
|
}>]>;
|
|
75
75
|
export type ConfiguredGraphqlCredentialValue = typeof ConfiguredGraphqlCredentialValue.Type;
|
|
76
|
-
export declare const
|
|
77
|
-
readonly
|
|
76
|
+
export declare const GraphqlConfiguredValueInput: Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
77
|
+
readonly kind: Schema.Literal<"secret">;
|
|
78
78
|
readonly prefix: Schema.optional<Schema.String>;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
readonly
|
|
79
|
+
}>]>;
|
|
80
|
+
export type GraphqlConfiguredValueInput = typeof GraphqlConfiguredValueInput.Type;
|
|
81
|
+
export declare const GraphqlCredentialInput: Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
82
|
+
readonly kind: Schema.Literal<"text">;
|
|
83
|
+
readonly text: Schema.String;
|
|
83
84
|
readonly prefix: Schema.optional<Schema.String>;
|
|
84
|
-
}
|
|
85
|
-
readonly kind: Schema.Literal<"
|
|
86
|
-
readonly
|
|
85
|
+
}>, Schema.Struct<{
|
|
86
|
+
readonly kind: Schema.Literal<"secret">;
|
|
87
|
+
readonly secretId: Schema.String;
|
|
88
|
+
readonly secretScope: Schema.optional<Schema.String>;
|
|
87
89
|
readonly prefix: Schema.optional<Schema.String>;
|
|
88
|
-
}
|
|
90
|
+
}>, Schema.Struct<{
|
|
91
|
+
readonly kind: Schema.Literal<"connection">;
|
|
92
|
+
readonly connectionId: Schema.String;
|
|
93
|
+
}>]>;
|
|
89
94
|
export type GraphqlCredentialInput = typeof GraphqlCredentialInput.Type;
|
|
90
95
|
export declare const graphqlHeaderSlot: (name: string) => string;
|
|
91
96
|
export declare const graphqlQueryParamSlot: (name: string) => string;
|
|
@@ -97,66 +102,26 @@ export declare const GraphqlSourceAuth: Schema.Union<readonly [Schema.Struct<{
|
|
|
97
102
|
readonly connectionSlot: Schema.String;
|
|
98
103
|
}>]>;
|
|
99
104
|
export type GraphqlSourceAuth = typeof GraphqlSourceAuth.Type;
|
|
100
|
-
export declare const GraphqlSourceAuthInput: Schema.Union<readonly [Schema.
|
|
105
|
+
export declare const GraphqlSourceAuthInput: Schema.Union<readonly [Schema.Struct<{
|
|
101
106
|
readonly kind: Schema.Literal<"none">;
|
|
102
107
|
}>, Schema.Struct<{
|
|
103
|
-
readonly
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
+
readonly oauth2: Schema.optional<Schema.Struct<{
|
|
109
|
+
readonly connection: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
110
|
+
readonly kind: Schema.Literal<"text">;
|
|
111
|
+
readonly text: Schema.String;
|
|
112
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
113
|
+
}>, Schema.Struct<{
|
|
114
|
+
readonly kind: Schema.Literal<"secret">;
|
|
115
|
+
readonly secretId: Schema.String;
|
|
116
|
+
readonly secretScope: Schema.optional<Schema.String>;
|
|
117
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
118
|
+
}>, Schema.Struct<{
|
|
119
|
+
readonly kind: Schema.Literal<"connection">;
|
|
120
|
+
readonly connectionId: Schema.String;
|
|
121
|
+
}>]>>;
|
|
122
|
+
}>>;
|
|
108
123
|
}>]>;
|
|
109
124
|
export type GraphqlSourceAuthInput = typeof GraphqlSourceAuthInput.Type;
|
|
110
|
-
export declare const GraphqlSourceBindingValue: Schema.Union<readonly [Schema.Struct<{
|
|
111
|
-
readonly kind: Schema.Literal<"text">;
|
|
112
|
-
readonly text: Schema.String;
|
|
113
|
-
}>, Schema.Struct<{
|
|
114
|
-
readonly kind: Schema.Literal<"secret">;
|
|
115
|
-
readonly secretId: Schema.brand<Schema.String, "SecretId">;
|
|
116
|
-
readonly secretScopeId: Schema.optional<Schema.brand<Schema.String, "ScopeId">>;
|
|
117
|
-
}>, Schema.Struct<{
|
|
118
|
-
readonly kind: Schema.Literal<"connection">;
|
|
119
|
-
readonly connectionId: Schema.brand<Schema.String, "ConnectionId">;
|
|
120
|
-
}>]>;
|
|
121
|
-
export type GraphqlSourceBindingValue = typeof GraphqlSourceBindingValue.Type;
|
|
122
|
-
export declare const GraphqlSourceBindingInput: Schema.Struct<{
|
|
123
|
-
readonly sourceId: Schema.String;
|
|
124
|
-
readonly sourceScope: Schema.brand<Schema.String, "ScopeId">;
|
|
125
|
-
readonly scope: Schema.brand<Schema.String, "ScopeId">;
|
|
126
|
-
readonly slot: Schema.String;
|
|
127
|
-
readonly value: Schema.Union<readonly [Schema.Struct<{
|
|
128
|
-
readonly kind: Schema.Literal<"text">;
|
|
129
|
-
readonly text: Schema.String;
|
|
130
|
-
}>, Schema.Struct<{
|
|
131
|
-
readonly kind: Schema.Literal<"secret">;
|
|
132
|
-
readonly secretId: Schema.brand<Schema.String, "SecretId">;
|
|
133
|
-
readonly secretScopeId: Schema.optional<Schema.brand<Schema.String, "ScopeId">>;
|
|
134
|
-
}>, Schema.Struct<{
|
|
135
|
-
readonly kind: Schema.Literal<"connection">;
|
|
136
|
-
readonly connectionId: Schema.brand<Schema.String, "ConnectionId">;
|
|
137
|
-
}>]>;
|
|
138
|
-
}>;
|
|
139
|
-
export type GraphqlSourceBindingInput = typeof GraphqlSourceBindingInput.Type;
|
|
140
|
-
export declare const GraphqlSourceBindingRef: Schema.Struct<{
|
|
141
|
-
readonly sourceId: Schema.String;
|
|
142
|
-
readonly sourceScopeId: Schema.brand<Schema.String, "ScopeId">;
|
|
143
|
-
readonly scopeId: Schema.brand<Schema.String, "ScopeId">;
|
|
144
|
-
readonly slot: Schema.String;
|
|
145
|
-
readonly value: Schema.Union<readonly [Schema.Struct<{
|
|
146
|
-
readonly kind: Schema.Literal<"text">;
|
|
147
|
-
readonly text: Schema.String;
|
|
148
|
-
}>, Schema.Struct<{
|
|
149
|
-
readonly kind: Schema.Literal<"secret">;
|
|
150
|
-
readonly secretId: Schema.brand<Schema.String, "SecretId">;
|
|
151
|
-
readonly secretScopeId: Schema.optional<Schema.brand<Schema.String, "ScopeId">>;
|
|
152
|
-
}>, Schema.Struct<{
|
|
153
|
-
readonly kind: Schema.Literal<"connection">;
|
|
154
|
-
readonly connectionId: Schema.brand<Schema.String, "ConnectionId">;
|
|
155
|
-
}>]>;
|
|
156
|
-
readonly createdAt: Schema.Date;
|
|
157
|
-
readonly updatedAt: Schema.Date;
|
|
158
|
-
}>;
|
|
159
|
-
export type GraphqlSourceBindingRef = typeof GraphqlSourceBindingRef.Type;
|
|
160
125
|
export declare const InvocationConfig: Schema.Struct<{
|
|
161
126
|
/** The GraphQL endpoint URL */
|
|
162
127
|
readonly endpoint: Schema.String;
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Context, Effect, Layer, Schema as EffectSchema, Scope } from "effect";
|
|
2
|
-
import { GraphQLSchema } from "graphql";
|
|
2
|
+
import type { GraphQLSchema } from "graphql";
|
|
3
|
+
import { OAuthTestServer } from "@executor-js/sdk/testing";
|
|
3
4
|
declare const GraphqlRequestPayload: EffectSchema.Struct<{
|
|
4
5
|
readonly query: EffectSchema.optional<EffectSchema.String>;
|
|
5
6
|
readonly variables: EffectSchema.optional<EffectSchema.$Record<EffectSchema.String, EffectSchema.Unknown>>;
|
|
@@ -19,6 +20,10 @@ export interface GraphqlTestContext {
|
|
|
19
20
|
export interface GraphqlTestServerOptions {
|
|
20
21
|
readonly schema: GraphQLSchema;
|
|
21
22
|
readonly path?: string;
|
|
23
|
+
readonly auth?: {
|
|
24
|
+
readonly validateAuthorization: (authorization: string | null) => Effect.Effect<boolean>;
|
|
25
|
+
readonly wwwAuthenticate?: string;
|
|
26
|
+
};
|
|
22
27
|
}
|
|
23
28
|
export interface GraphqlTestServerShape {
|
|
24
29
|
readonly endpoint: string;
|
|
@@ -41,12 +46,25 @@ declare class GraphqlTestServerHandlerError extends GraphqlTestServerHandlerErro
|
|
|
41
46
|
}> {
|
|
42
47
|
}
|
|
43
48
|
export declare const serveGraphqlTestServer: (options: GraphqlTestServerOptions) => Effect.Effect<GraphqlTestServerShape, GraphqlTestServerAddressError | GraphqlTestServerHandlerError, Scope.Scope>;
|
|
49
|
+
export declare const serveGraphqlFailureTestServer: (options: {
|
|
50
|
+
readonly status: number;
|
|
51
|
+
readonly body: string;
|
|
52
|
+
readonly contentType?: string;
|
|
53
|
+
readonly path?: string;
|
|
54
|
+
}) => Effect.Effect<{
|
|
55
|
+
endpoint: string;
|
|
56
|
+
httpClientLayer: Layer.Layer<import("effect/unstable/http/HttpClient").HttpClient, never, never>;
|
|
57
|
+
}, import("@executor-js/sdk/testing").TestHttpServerAddressError | import("@executor-js/sdk/testing").TestHttpServerServeError, Scope.Scope>;
|
|
44
58
|
declare const GraphqlTestServer_base: Context.ServiceClass<GraphqlTestServer, "@executor-js/plugin-graphql/testing/GraphqlTestServer", GraphqlTestServerShape>;
|
|
45
59
|
export declare class GraphqlTestServer extends GraphqlTestServer_base {
|
|
46
60
|
static readonly layer: (options: GraphqlTestServerOptions) => Layer.Layer<GraphqlTestServer, GraphqlTestServerAddressError | GraphqlTestServerHandlerError, never>;
|
|
61
|
+
static readonly layerWithOAuth: (options: Omit<GraphqlTestServerOptions, "auth">) => Layer.Layer<GraphqlTestServer, GraphqlTestServerAddressError | GraphqlTestServerHandlerError, OAuthTestServer>;
|
|
47
62
|
}
|
|
48
|
-
export declare const makeGreetingGraphqlSchema: (
|
|
63
|
+
export declare const makeGreetingGraphqlSchema: (options?: {
|
|
64
|
+
readonly includeMutation?: boolean;
|
|
65
|
+
}) => GraphQLSchema;
|
|
49
66
|
export declare const TestLayers: {
|
|
50
67
|
greeting: () => Layer.Layer<GraphqlTestServer, GraphqlTestServerAddressError | GraphqlTestServerHandlerError, never>;
|
|
68
|
+
greetingWithOAuth: () => Layer.Layer<GraphqlTestServer, GraphqlTestServerAddressError | GraphqlTestServerHandlerError, OAuthTestServer>;
|
|
51
69
|
};
|
|
52
70
|
export {};
|