@executor-js/plugin-graphql 1.5.5 → 1.5.7
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-P3D3UXRJ.js → AddGraphqlSource-FGT7DNXV.js} +39 -64
- package/dist/AddGraphqlSource-FGT7DNXV.js.map +1 -0
- package/dist/{EditGraphqlSource-FVF67CTP.js → EditGraphqlSource-QELISUYT.js} +4 -4
- package/dist/GraphqlAccountsPanel-U62WSGHR.js +9 -0
- package/dist/api/group.d.ts +54 -21
- package/dist/api/handlers.d.ts +1 -1
- package/dist/api/index.d.ts +55 -22
- package/dist/{chunk-N5GJE7R6.js → chunk-732HGFSH.js} +57 -21
- package/dist/chunk-732HGFSH.js.map +1 -0
- package/dist/{chunk-2Y3J3CVO.js → chunk-HN5FB4DO.js} +35 -55
- package/dist/chunk-HN5FB4DO.js.map +1 -0
- package/dist/{chunk-VCYDSSIK.js → chunk-OGNJZCEF.js} +27 -28
- package/dist/chunk-OGNJZCEF.js.map +1 -0
- package/dist/{chunk-ADQTI2OK.js → chunk-OUZI3QNC.js} +119 -124
- package/dist/chunk-OUZI3QNC.js.map +1 -0
- package/dist/client.js +3 -3
- package/dist/core.js +124 -10
- package/dist/core.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/react/atoms.d.ts +83 -29
- package/dist/react/auth-method-config.d.ts +21 -8
- package/dist/react/client.d.ts +54 -21
- package/dist/react/defaults.d.ts +0 -11
- package/dist/sdk/index.d.ts +4 -1
- package/dist/sdk/introspection-blob-migration.d.ts +7 -0
- package/dist/sdk/migrate-config.d.ts +6 -0
- package/dist/sdk/plugin.d.ts +49 -22
- package/dist/sdk/store.d.ts +11 -1
- package/dist/sdk/types.d.ts +102 -47
- package/package.json +3 -3
- package/dist/AddGraphqlSource-P3D3UXRJ.js.map +0 -1
- package/dist/GraphqlAccountsPanel-GBNFHLFH.js +0 -9
- package/dist/chunk-2Y3J3CVO.js.map +0 -1
- package/dist/chunk-ADQTI2OK.js.map +0 -1
- package/dist/chunk-N5GJE7R6.js.map +0 -1
- package/dist/chunk-VCYDSSIK.js.map +0 -1
- /package/dist/{EditGraphqlSource-FVF67CTP.js.map → EditGraphqlSource-QELISUYT.js.map} +0 -0
- /package/dist/{GraphqlAccountsPanel-GBNFHLFH.js.map → GraphqlAccountsPanel-U62WSGHR.js.map} +0 -0
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addGraphqlIntegrationOptimistic,
|
|
3
|
-
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
3
|
+
graphqlAuthMethodInputsFromPlacements
|
|
4
|
+
} from "./chunk-HN5FB4DO.js";
|
|
5
|
+
import "./chunk-732HGFSH.js";
|
|
6
6
|
|
|
7
7
|
// src/react/AddGraphqlSource.tsx
|
|
8
8
|
import { useCallback, useMemo, useState } from "react";
|
|
9
|
-
import { useAtomSet
|
|
10
|
-
import { Link } from "@tanstack/react-router";
|
|
9
|
+
import { useAtomSet } from "@effect/atom-react";
|
|
11
10
|
import * as Exit from "effect/Exit";
|
|
12
|
-
import * as Option from "effect/Option";
|
|
13
|
-
import * as Predicate from "effect/Predicate";
|
|
14
|
-
import * as Schema from "effect/Schema";
|
|
15
|
-
import * as AsyncResult from "effect/unstable/reactivity/AsyncResult";
|
|
16
|
-
import { integrationsOptimisticAtom } from "@executor-js/react/api/atoms";
|
|
17
11
|
import { integrationWriteKeys } from "@executor-js/react/api/reactivity-keys";
|
|
18
12
|
import {
|
|
19
13
|
integrationDisplayNameFromUrl,
|
|
@@ -22,11 +16,17 @@ import {
|
|
|
22
16
|
} from "@executor-js/react/plugins/integration-identity";
|
|
23
17
|
import { Button } from "@executor-js/react/components/button";
|
|
24
18
|
import {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
AuthMethodListEditor,
|
|
20
|
+
useAuthMethodList
|
|
21
|
+
} from "@executor-js/react/components/auth-method-list-editor";
|
|
28
22
|
import { FloatActions } from "@executor-js/react/components/float-actions";
|
|
29
23
|
import { Spinner } from "@executor-js/react/components/spinner";
|
|
24
|
+
import {
|
|
25
|
+
addIntegrationErrorMessage,
|
|
26
|
+
FormErrorAlert,
|
|
27
|
+
SlugCollisionAlert,
|
|
28
|
+
useSlugAlreadyExists
|
|
29
|
+
} from "@executor-js/react/lib/integration-add";
|
|
30
30
|
|
|
31
31
|
// src/react/GraphqlSourceFields.tsx
|
|
32
32
|
import {
|
|
@@ -71,38 +71,32 @@ function GraphqlSourceFields(props) {
|
|
|
71
71
|
|
|
72
72
|
// src/react/AddGraphqlSource.tsx
|
|
73
73
|
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
74
|
-
var
|
|
75
|
-
var decodeErrorMessage = Schema.decodeUnknownOption(ErrorMessage);
|
|
76
|
-
var errorMessageFromExit = (exit, fallback) => Option.match(Option.flatMap(Exit.findErrorOption(exit), decodeErrorMessage), {
|
|
77
|
-
onNone: () => fallback,
|
|
78
|
-
onSome: ({ message }) => message
|
|
79
|
-
});
|
|
80
|
-
var isIntegrationAlreadyExistsExit = (exit) => Option.match(Exit.findErrorOption(exit), {
|
|
81
|
-
onNone: () => false,
|
|
82
|
-
onSome: Predicate.isTagged("IntegrationAlreadyExistsError")
|
|
83
|
-
});
|
|
84
|
-
var integrationExistsMessage = (slug) => `An integration named "${slug}" already exists. To add more authentication, update your existing integration.`;
|
|
74
|
+
var NO_SEEDS = [];
|
|
85
75
|
function AddGraphqlSource(props) {
|
|
86
76
|
const [endpoint, setEndpoint] = useState(props.initialUrl ?? "");
|
|
87
77
|
const identity = useIntegrationIdentity({
|
|
88
78
|
fallbackName: integrationDisplayNameFromUrl(endpoint, "GraphQL") ?? ""
|
|
89
79
|
});
|
|
90
|
-
const
|
|
80
|
+
const authMethodList = useAuthMethodList(NO_SEEDS);
|
|
91
81
|
const [adding, setAdding] = useState(false);
|
|
92
82
|
const [addError, setAddError] = useState(null);
|
|
93
83
|
const doAddIntegration = useAtomSet(addGraphqlIntegrationOptimistic, {
|
|
94
84
|
mode: "promiseExit"
|
|
95
85
|
});
|
|
96
|
-
const
|
|
86
|
+
const authenticationTemplate = useMemo(
|
|
87
|
+
() => authMethodList.rows.flatMap(
|
|
88
|
+
(row) => row.value.kind === "apikey" ? graphqlAuthMethodInputsFromPlacements(row.value.placements) : []
|
|
89
|
+
),
|
|
90
|
+
[authMethodList.rows]
|
|
91
|
+
);
|
|
92
|
+
const apiKeyComplete = authMethodList.rows.every(
|
|
93
|
+
(row) => row.value.kind !== "apikey" || row.value.placements.some((placement) => placement.name.trim().length > 0)
|
|
94
|
+
);
|
|
97
95
|
const resolvedSlug = useMemo(
|
|
98
96
|
() => slugifyNamespace(identity.namespace) || slugifyNamespace(integrationDisplayNameFromUrl(endpoint.trim(), "GraphQL") ?? "") || "graphql",
|
|
99
97
|
[endpoint, identity.namespace]
|
|
100
98
|
);
|
|
101
|
-
const
|
|
102
|
-
const slugAlreadyExists = useMemo(
|
|
103
|
-
() => AsyncResult.isSuccess(integrationsResult) && integrationsResult.value.some((integration) => String(integration.slug) === resolvedSlug),
|
|
104
|
-
[integrationsResult, resolvedSlug]
|
|
105
|
-
);
|
|
99
|
+
const slugAlreadyExists = useSlugAlreadyExists(resolvedSlug);
|
|
106
100
|
const canAdd = endpoint.trim().length > 0 && apiKeyComplete && !adding && !slugAlreadyExists;
|
|
107
101
|
const sourceIdentity = useCallback(() => {
|
|
108
102
|
const trimmedEndpoint = endpoint.trim();
|
|
@@ -114,20 +108,17 @@ function AddGraphqlSource(props) {
|
|
|
114
108
|
setAdding(true);
|
|
115
109
|
setAddError(null);
|
|
116
110
|
const { trimmedEndpoint, slug, displayName } = sourceIdentity();
|
|
117
|
-
const authenticationTemplate = authValue.kind === "apikey" ? graphqlTemplatesFromPlacements(authValue.placements) : [];
|
|
118
111
|
const integrationExit = await doAddIntegration({
|
|
119
112
|
payload: {
|
|
120
113
|
endpoint: trimmedEndpoint,
|
|
121
114
|
slug,
|
|
122
115
|
name: displayName,
|
|
123
|
-
...authenticationTemplate.length > 0 ? { authenticationTemplate } : {}
|
|
116
|
+
...authenticationTemplate.length > 0 ? { authenticationTemplate: [...authenticationTemplate] } : {}
|
|
124
117
|
},
|
|
125
118
|
reactivityKeys: integrationWriteKeys
|
|
126
119
|
});
|
|
127
120
|
if (Exit.isFailure(integrationExit)) {
|
|
128
|
-
setAddError(
|
|
129
|
-
isIntegrationAlreadyExistsExit(integrationExit) ? integrationExistsMessage(slug) : errorMessageFromExit(integrationExit, "Failed to add source")
|
|
130
|
-
);
|
|
121
|
+
setAddError(addIntegrationErrorMessage(integrationExit, slug, "Failed to add source"));
|
|
131
122
|
setAdding(false);
|
|
132
123
|
return;
|
|
133
124
|
}
|
|
@@ -137,33 +128,17 @@ function AddGraphqlSource(props) {
|
|
|
137
128
|
return /* @__PURE__ */ jsxs2("div", { className: "flex flex-1 flex-col gap-6", children: [
|
|
138
129
|
/* @__PURE__ */ jsx2("h1", { className: "text-xl font-semibold text-foreground", children: "Add GraphQL Source" }),
|
|
139
130
|
/* @__PURE__ */ jsx2(GraphqlSourceFields, { endpoint, onEndpointChange: setEndpoint, identity }),
|
|
140
|
-
/* @__PURE__ */
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
slugAlreadyExists && !adding && /* @__PURE__ */ jsx2("div", { className: "rounded-lg border border-destructive/30 bg-destructive/5 px-3 py-2", children: /* @__PURE__ */ jsxs2("p", { className: "text-[12px] text-destructive", children: [
|
|
152
|
-
'An integration named "',
|
|
153
|
-
resolvedSlug,
|
|
154
|
-
'" already exists. To add more authentication, update your existing integration.',
|
|
155
|
-
" ",
|
|
156
|
-
/* @__PURE__ */ jsx2(
|
|
157
|
-
Link,
|
|
158
|
-
{
|
|
159
|
-
to: "/integrations/$namespace",
|
|
160
|
-
params: { namespace: resolvedSlug },
|
|
161
|
-
className: "font-medium underline underline-offset-2",
|
|
162
|
-
children: "Open it"
|
|
163
|
-
}
|
|
164
|
-
)
|
|
165
|
-
] }) }),
|
|
166
|
-
addError && /* @__PURE__ */ jsx2("div", { className: "rounded-lg border border-destructive/30 bg-destructive/5 px-3 py-2", children: /* @__PURE__ */ jsx2("p", { className: "text-[12px] text-destructive", children: addError }) }),
|
|
131
|
+
/* @__PURE__ */ jsx2(
|
|
132
|
+
AuthMethodListEditor,
|
|
133
|
+
{
|
|
134
|
+
list: authMethodList,
|
|
135
|
+
allowedKinds: ["none", "apikey"],
|
|
136
|
+
emptyHint: "No authentication declared. Add a method, or add the source without auth and connect an account from the integration page later.",
|
|
137
|
+
footerHint: "Every method here is registered with the source. Connect an account from the integration page after adding."
|
|
138
|
+
}
|
|
139
|
+
),
|
|
140
|
+
slugAlreadyExists && !adding && /* @__PURE__ */ jsx2(SlugCollisionAlert, { slug: resolvedSlug }),
|
|
141
|
+
addError && /* @__PURE__ */ jsx2(FormErrorAlert, { message: addError }),
|
|
167
142
|
/* @__PURE__ */ jsxs2(FloatActions, { children: [
|
|
168
143
|
/* @__PURE__ */ jsx2(Button, { variant: "ghost", onClick: () => props.onCancel(), disabled: adding, children: "Cancel" }),
|
|
169
144
|
/* @__PURE__ */ jsxs2(Button, { onClick: () => void handleAdd(), disabled: !canAdd, children: [
|
|
@@ -176,4 +151,4 @@ function AddGraphqlSource(props) {
|
|
|
176
151
|
export {
|
|
177
152
|
AddGraphqlSource as default
|
|
178
153
|
};
|
|
179
|
-
//# sourceMappingURL=AddGraphqlSource-
|
|
154
|
+
//# sourceMappingURL=AddGraphqlSource-FGT7DNXV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/react/AddGraphqlSource.tsx","../src/react/GraphqlSourceFields.tsx"],"sourcesContent":["import { useCallback, useMemo, useState } from \"react\";\nimport { useAtomSet } from \"@effect/atom-react\";\nimport * as Exit from \"effect/Exit\";\n\nimport { integrationWriteKeys } from \"@executor-js/react/api/reactivity-keys\";\nimport {\n integrationDisplayNameFromUrl,\n slugifyNamespace,\n useIntegrationIdentity,\n} from \"@executor-js/react/plugins/integration-identity\";\nimport { Button } from \"@executor-js/react/components/button\";\nimport {\n AuthMethodListEditor,\n useAuthMethodList,\n type AuthMethodRow,\n type AuthMethodSeed,\n} from \"@executor-js/react/components/auth-method-list-editor\";\nimport { FloatActions } from \"@executor-js/react/components/float-actions\";\nimport { Spinner } from \"@executor-js/react/components/spinner\";\nimport {\n addIntegrationErrorMessage,\n FormErrorAlert,\n SlugCollisionAlert,\n useSlugAlreadyExists,\n} from \"@executor-js/react/lib/integration-add\";\n\nimport { addGraphqlIntegrationOptimistic } from \"./atoms\";\nimport { GraphqlSourceFields } from \"./GraphqlSourceFields\";\nimport { graphqlAuthMethodInputsFromPlacements } from \"./auth-method-config\";\nimport type { GraphqlAuthMethodInput } from \"../sdk/types\";\n\n// v2 GraphQL add flow: register the integration with its declared auth-method\n// LIST (the shared `AuthMethodListEditor` — GraphQL stays header/query apiKey;\n// OAuth is hidden), then route to the integration's detail hub. Connection\n// creation is no longer part of the add flow — accounts are added from the hub\n// (P6: add without auth, connect later).\n\n// GraphQL has no add-time detection, so the list starts empty (module constant\n// — a fresh [] every render would re-seed the list each render).\nconst NO_SEEDS: readonly AuthMethodSeed[] = [];\n\nexport default function AddGraphqlSource(props: {\n onComplete: (slug?: string) => void;\n onCancel: () => void;\n initialUrl?: string;\n}) {\n const [endpoint, setEndpoint] = useState(props.initialUrl ?? \"\");\n const identity = useIntegrationIdentity({\n fallbackName: integrationDisplayNameFromUrl(endpoint, \"GraphQL\") ?? \"\",\n });\n const authMethodList = useAuthMethodList(NO_SEEDS);\n const [adding, setAdding] = useState(false);\n const [addError, setAddError] = useState<string | null>(null);\n\n const doAddIntegration = useAtomSet(addGraphqlIntegrationOptimistic, {\n mode: \"promiseExit\",\n });\n\n // The methods to register: each apikey row declares ONE method carrying\n // every named placement (header + query mix in a single method). Inputs\n // omit slugs — the backend assigns carrier-derived ones. `none` rows\n // register nothing.\n const authenticationTemplate = useMemo<readonly GraphqlAuthMethodInput[]>(\n () =>\n authMethodList.rows.flatMap((row: AuthMethodRow) =>\n row.value.kind === \"apikey\"\n ? graphqlAuthMethodInputsFromPlacements(row.value.placements)\n : [],\n ),\n [authMethodList.rows],\n );\n\n // Every apikey row needs at least one named placement; `none` rows are\n // always valid.\n const apiKeyComplete = authMethodList.rows.every(\n (row: AuthMethodRow) =>\n row.value.kind !== \"apikey\" ||\n row.value.placements.some((placement) => placement.name.trim().length > 0),\n );\n\n const resolvedSlug = useMemo(\n () =>\n slugifyNamespace(identity.namespace) ||\n slugifyNamespace(integrationDisplayNameFromUrl(endpoint.trim(), \"GraphQL\") ?? \"\") ||\n \"graphql\",\n [endpoint, identity.namespace],\n );\n\n // Pre-empt the API's `IntegrationAlreadyExistsError`: adding an integration\n // whose slug already exists clobbers the existing one's connections/policies,\n // so the API blocks it. Surface that here from the tenant-scoped catalog list.\n const slugAlreadyExists = useSlugAlreadyExists(resolvedSlug);\n\n const canAdd = endpoint.trim().length > 0 && apiKeyComplete && !adding && !slugAlreadyExists;\n\n const sourceIdentity = useCallback(() => {\n const trimmedEndpoint = endpoint.trim();\n const slug = resolvedSlug;\n const displayName =\n identity.name.trim() || integrationDisplayNameFromUrl(trimmedEndpoint, \"GraphQL\") || slug;\n return { trimmedEndpoint, slug, displayName };\n }, [endpoint, identity.name, resolvedSlug]);\n\n const handleAdd = async (): Promise<void> => {\n setAdding(true);\n setAddError(null);\n const { trimmedEndpoint, slug, displayName } = sourceIdentity();\n\n const integrationExit = await doAddIntegration({\n payload: {\n endpoint: trimmedEndpoint,\n slug,\n name: displayName,\n ...(authenticationTemplate.length > 0\n ? { authenticationTemplate: [...authenticationTemplate] }\n : {}),\n },\n reactivityKeys: integrationWriteKeys,\n });\n if (Exit.isFailure(integrationExit)) {\n setAddError(addIntegrationErrorMessage(integrationExit, slug, \"Failed to add source\"));\n setAdding(false);\n return;\n }\n const registeredSlug = integrationExit.value.slug;\n\n props.onComplete(String(registeredSlug));\n };\n\n return (\n <div className=\"flex flex-1 flex-col gap-6\">\n <h1 className=\"text-xl font-semibold text-foreground\">Add GraphQL Source</h1>\n\n <GraphqlSourceFields endpoint={endpoint} onEndpointChange={setEndpoint} identity={identity} />\n\n <AuthMethodListEditor\n list={authMethodList}\n allowedKinds={[\"none\", \"apikey\"]}\n emptyHint=\"No authentication declared. Add a method, or add the source without auth and connect an account from the integration page later.\"\n footerHint=\"Every method here is registered with the source. Connect an account from the integration page after adding.\"\n />\n\n {slugAlreadyExists && !adding && <SlugCollisionAlert slug={resolvedSlug} />}\n\n {addError && <FormErrorAlert message={addError} />}\n\n <FloatActions>\n <Button variant=\"ghost\" onClick={() => props.onCancel()} disabled={adding}>\n Cancel\n </Button>\n <Button onClick={() => void handleAdd()} disabled={!canAdd}>\n {adding && <Spinner className=\"size-3.5\" />}\n {adding ? \"Adding...\" : \"Add source\"}\n </Button>\n </FloatActions>\n </div>\n );\n}\n","import {\n CardStack,\n CardStackContent,\n CardStackEntryField,\n} from \"@executor-js/react/components/card-stack\";\nimport { Input } from \"@executor-js/react/components/input\";\nimport {\n IntegrationIdentityFieldRows,\n type IntegrationIdentity,\n} from \"@executor-js/react/plugins/integration-identity\";\n\nexport function GraphqlSourceFields(props: {\n readonly endpoint: string;\n readonly onEndpointChange: (endpoint: string) => void;\n readonly identity: IntegrationIdentity;\n readonly endpointDisabled?: boolean;\n readonly namespaceReadOnly?: boolean;\n}) {\n return (\n <CardStack>\n <CardStackContent className=\"border-t-0\">\n <CardStackEntryField\n label=\"Endpoint\"\n hint=\"The endpoint will be introspected to discover available queries and mutations.\"\n >\n <Input\n value={props.endpoint}\n onChange={(e) => props.onEndpointChange((e.target as HTMLInputElement).value)}\n placeholder=\"https://api.example.com/graphql\"\n className=\"font-mono text-sm\"\n disabled={props.endpointDisabled}\n />\n </CardStackEntryField>\n <IntegrationIdentityFieldRows\n identity={props.identity}\n namePlaceholder=\"e.g. Shopify API\"\n namespaceReadOnly={props.namespaceReadOnly}\n />\n </CardStackContent>\n </CardStack>\n );\n}\n"],"mappings":"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","names":["jsx","jsxs"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GraphqlAccountsPanel
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OGNJZCEF.js";
|
|
4
4
|
import {
|
|
5
5
|
graphqlIntegrationConfigAtom
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-HN5FB4DO.js";
|
|
7
|
+
import "./chunk-732HGFSH.js";
|
|
8
8
|
|
|
9
9
|
// src/react/EditGraphqlSource.tsx
|
|
10
10
|
import { useAtomValue } from "@effect/atom-react";
|
|
@@ -35,4 +35,4 @@ function EditGraphqlSource(props) {
|
|
|
35
35
|
export {
|
|
36
36
|
EditGraphqlSource as default
|
|
37
37
|
};
|
|
38
|
-
//# sourceMappingURL=EditGraphqlSource-
|
|
38
|
+
//# sourceMappingURL=EditGraphqlSource-QELISUYT.js.map
|
package/dist/api/group.d.ts
CHANGED
|
@@ -10,16 +10,25 @@ export declare const GraphqlGroup: HttpApiGroup.HttpApiGroup<"graphql", HttpApiE
|
|
|
10
10
|
readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
11
11
|
readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
12
12
|
readonly authenticationTemplate: Schema.optional<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
13
|
-
readonly
|
|
14
|
-
readonly
|
|
15
|
-
readonly in: Schema.Literals<readonly ["header", "query"]>;
|
|
16
|
-
readonly name: Schema.String;
|
|
17
|
-
readonly prefix: Schema.optional<Schema.String>;
|
|
13
|
+
readonly slug: Schema.optional<Schema.String>;
|
|
14
|
+
readonly kind: Schema.Literal<"none">;
|
|
18
15
|
}>, Schema.Struct<{
|
|
16
|
+
readonly slug: Schema.optional<Schema.String>;
|
|
19
17
|
readonly kind: Schema.Literal<"oauth2">;
|
|
20
|
-
readonly slug: Schema.String;
|
|
21
18
|
readonly header: Schema.optional<Schema.String>;
|
|
22
19
|
readonly prefix: Schema.optional<Schema.String>;
|
|
20
|
+
}>, Schema.Struct<{
|
|
21
|
+
readonly slug: Schema.optional<Schema.String>;
|
|
22
|
+
readonly type: Schema.Literal<"apiKey">;
|
|
23
|
+
readonly label: Schema.optional<Schema.String>;
|
|
24
|
+
readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
25
|
+
readonly type: Schema.Literal<"variable">;
|
|
26
|
+
readonly name: Schema.String;
|
|
27
|
+
}>]>>]>>>;
|
|
28
|
+
readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
29
|
+
readonly type: Schema.Literal<"variable">;
|
|
30
|
+
readonly name: Schema.String;
|
|
31
|
+
}>]>>]>>>;
|
|
23
32
|
}>]>>>;
|
|
24
33
|
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
25
34
|
readonly slug: Schema.String;
|
|
@@ -71,15 +80,22 @@ export declare const GraphqlGroup: HttpApiGroup.HttpApiGroup<"graphql", HttpApiE
|
|
|
71
80
|
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.NullOr<Schema.Struct<{
|
|
72
81
|
readonly endpoint: Schema.String;
|
|
73
82
|
readonly name: Schema.String;
|
|
74
|
-
readonly introspectionJson: Schema.optional<Schema.String>;
|
|
75
83
|
readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
76
84
|
readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
77
85
|
readonly authenticationTemplate: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
78
|
-
readonly kind: Schema.Literal<"apiKey">;
|
|
79
86
|
readonly slug: Schema.String;
|
|
80
|
-
readonly
|
|
81
|
-
|
|
82
|
-
readonly
|
|
87
|
+
readonly kind: Schema.Literal<"none">;
|
|
88
|
+
}>, Schema.Struct<{
|
|
89
|
+
readonly slug: Schema.String;
|
|
90
|
+
readonly kind: Schema.Literal<"apikey">;
|
|
91
|
+
readonly label: Schema.optional<Schema.String>;
|
|
92
|
+
readonly placements: Schema.$Array<Schema.Struct<{
|
|
93
|
+
readonly carrier: Schema.Literals<readonly ["header", "query"]>;
|
|
94
|
+
readonly name: Schema.String;
|
|
95
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
96
|
+
readonly variable: Schema.optional<Schema.String>;
|
|
97
|
+
readonly literal: Schema.optional<Schema.String>;
|
|
98
|
+
}>>;
|
|
83
99
|
}>, Schema.Struct<{
|
|
84
100
|
readonly kind: Schema.Literal<"oauth2">;
|
|
85
101
|
readonly slug: Schema.String;
|
|
@@ -110,25 +126,42 @@ export declare const GraphqlGroup: HttpApiGroup.HttpApiGroup<"graphql", HttpApiE
|
|
|
110
126
|
slug: Schema.String;
|
|
111
127
|
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
112
128
|
readonly authenticationTemplate: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
113
|
-
readonly
|
|
114
|
-
readonly
|
|
115
|
-
readonly in: Schema.Literals<readonly ["header", "query"]>;
|
|
116
|
-
readonly name: Schema.String;
|
|
117
|
-
readonly prefix: Schema.optional<Schema.String>;
|
|
129
|
+
readonly slug: Schema.optional<Schema.String>;
|
|
130
|
+
readonly kind: Schema.Literal<"none">;
|
|
118
131
|
}>, Schema.Struct<{
|
|
132
|
+
readonly slug: Schema.optional<Schema.String>;
|
|
119
133
|
readonly kind: Schema.Literal<"oauth2">;
|
|
120
|
-
readonly slug: Schema.String;
|
|
121
134
|
readonly header: Schema.optional<Schema.String>;
|
|
122
135
|
readonly prefix: Schema.optional<Schema.String>;
|
|
136
|
+
}>, Schema.Struct<{
|
|
137
|
+
readonly slug: Schema.optional<Schema.String>;
|
|
138
|
+
readonly type: Schema.Literal<"apiKey">;
|
|
139
|
+
readonly label: Schema.optional<Schema.String>;
|
|
140
|
+
readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
141
|
+
readonly type: Schema.Literal<"variable">;
|
|
142
|
+
readonly name: Schema.String;
|
|
143
|
+
}>]>>]>>>;
|
|
144
|
+
readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.$Array<Schema.Union<readonly [Schema.String, Schema.Struct<{
|
|
145
|
+
readonly type: Schema.Literal<"variable">;
|
|
146
|
+
readonly name: Schema.String;
|
|
147
|
+
}>]>>]>>>;
|
|
123
148
|
}>]>>;
|
|
124
149
|
readonly mode: Schema.optional<Schema.Literals<readonly ["merge", "replace"]>>;
|
|
125
150
|
}>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
|
|
126
151
|
readonly authenticationTemplate: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
|
|
127
|
-
readonly kind: Schema.Literal<"apiKey">;
|
|
128
152
|
readonly slug: Schema.String;
|
|
129
|
-
readonly
|
|
130
|
-
|
|
131
|
-
readonly
|
|
153
|
+
readonly kind: Schema.Literal<"none">;
|
|
154
|
+
}>, Schema.Struct<{
|
|
155
|
+
readonly slug: Schema.String;
|
|
156
|
+
readonly kind: Schema.Literal<"apikey">;
|
|
157
|
+
readonly label: Schema.optional<Schema.String>;
|
|
158
|
+
readonly placements: Schema.$Array<Schema.Struct<{
|
|
159
|
+
readonly carrier: Schema.Literals<readonly ["header", "query"]>;
|
|
160
|
+
readonly name: Schema.String;
|
|
161
|
+
readonly prefix: Schema.optional<Schema.String>;
|
|
162
|
+
readonly variable: Schema.optional<Schema.String>;
|
|
163
|
+
readonly literal: Schema.optional<Schema.String>;
|
|
164
|
+
}>>;
|
|
132
165
|
}>, Schema.Struct<{
|
|
133
166
|
readonly kind: Schema.Literal<"oauth2">;
|
|
134
167
|
readonly slug: Schema.String;
|
package/dist/api/handlers.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ declare const GraphqlExtensionService_base: Context.ServiceClass<GraphqlExtensio
|
|
|
7
7
|
}, import("@executor-js/sdk").StorageFailure | import("@executor-js/sdk").IntegrationAlreadyExistsError | import("../sdk").GraphqlIntrospectionError | import("../sdk").GraphqlExtractionError, never>;
|
|
8
8
|
getIntegration: (slug: string) => Effect.Effect<unknown, import("@executor-js/sdk").StorageFailure, never>;
|
|
9
9
|
getConfig: (slug: string) => Effect.Effect<import("../sdk").GraphqlIntegrationConfig | null, import("@executor-js/sdk").StorageFailure>;
|
|
10
|
-
configureAuth: (slug: string, input: import("../sdk").GraphqlConfigureAuthInput) => Effect.Effect<readonly import("../sdk").
|
|
10
|
+
configureAuth: (slug: string, input: import("../sdk").GraphqlConfigureAuthInput) => Effect.Effect<readonly import("../sdk").GraphqlAuthMethod[], import("@executor-js/sdk").StorageFailure>;
|
|
11
11
|
removeIntegration: (slug: string) => Effect.Effect<void, import("@executor-js/sdk").StorageFailure, never>;
|
|
12
12
|
configure: (slug: string, input: import("../sdk").GraphqlConfigureInput) => Effect.Effect<void, import("@executor-js/sdk").StorageFailure, never>;
|
|
13
13
|
}>;
|
package/dist/api/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export declare const graphqlHttpPlugin: import("@executor-js/sdk/core").Configur
|
|
|
10
10
|
}, import("@executor-js/sdk/core").StorageFailure | import("@executor-js/sdk/shared").IntegrationAlreadyExistsError | import("../sdk").GraphqlIntrospectionError | import("../sdk").GraphqlExtractionError, never>;
|
|
11
11
|
getIntegration: (slug: string) => import("effect/Effect").Effect<unknown, import("@executor-js/sdk/core").StorageFailure, never>;
|
|
12
12
|
getConfig: (slug: string) => import("effect/Effect").Effect<import("../sdk").GraphqlIntegrationConfig | null, import("@executor-js/sdk/core").StorageFailure>;
|
|
13
|
-
configureAuth: (slug: string, input: import("../sdk").GraphqlConfigureAuthInput) => import("effect/Effect").Effect<readonly import("../sdk").
|
|
13
|
+
configureAuth: (slug: string, input: import("../sdk").GraphqlConfigureAuthInput) => import("effect/Effect").Effect<readonly import("../sdk").GraphqlAuthMethod[], import("@executor-js/sdk/core").StorageFailure>;
|
|
14
14
|
removeIntegration: (slug: string) => import("effect/Effect").Effect<void, import("@executor-js/sdk/core").StorageFailure, never>;
|
|
15
15
|
configure: (slug: string, input: import("../sdk").GraphqlConfigureInput) => import("effect/Effect").Effect<void, import("@executor-js/sdk/core").StorageFailure, never>;
|
|
16
16
|
}, import("../sdk").GraphqlStore, GraphqlPluginOptions, typeof GraphqlExtensionService, import("effect/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<"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<{
|
|
@@ -21,16 +21,25 @@ export declare const graphqlHttpPlugin: import("@executor-js/sdk/core").Configur
|
|
|
21
21
|
readonly headers: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").String>>;
|
|
22
22
|
readonly queryParams: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").String>>;
|
|
23
23
|
readonly authenticationTemplate: import("effect/Schema").optional<import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
24
|
-
readonly
|
|
25
|
-
readonly
|
|
26
|
-
readonly in: import("effect/Schema").Literals<readonly ["header", "query"]>;
|
|
27
|
-
readonly name: import("effect/Schema").String;
|
|
28
|
-
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
24
|
+
readonly slug: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
25
|
+
readonly kind: import("effect/Schema").Literal<"none">;
|
|
29
26
|
}>, import("effect/Schema").Struct<{
|
|
27
|
+
readonly slug: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
30
28
|
readonly kind: import("effect/Schema").Literal<"oauth2">;
|
|
31
|
-
readonly slug: import("effect/Schema").String;
|
|
32
29
|
readonly header: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
33
30
|
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
31
|
+
}>, import("effect/Schema").Struct<{
|
|
32
|
+
readonly slug: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
33
|
+
readonly type: import("effect/Schema").Literal<"apiKey">;
|
|
34
|
+
readonly label: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
35
|
+
readonly headers: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").Struct<{
|
|
36
|
+
readonly type: import("effect/Schema").Literal<"variable">;
|
|
37
|
+
readonly name: import("effect/Schema").String;
|
|
38
|
+
}>]>>]>>>;
|
|
39
|
+
readonly queryParams: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").Struct<{
|
|
40
|
+
readonly type: import("effect/Schema").Literal<"variable">;
|
|
41
|
+
readonly name: import("effect/Schema").String;
|
|
42
|
+
}>]>>]>>>;
|
|
34
43
|
}>]>>>;
|
|
35
44
|
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
36
45
|
readonly slug: import("effect/Schema").String;
|
|
@@ -82,15 +91,22 @@ export declare const graphqlHttpPlugin: import("@executor-js/sdk/core").Configur
|
|
|
82
91
|
}>>, 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<{
|
|
83
92
|
readonly endpoint: import("effect/Schema").String;
|
|
84
93
|
readonly name: import("effect/Schema").String;
|
|
85
|
-
readonly introspectionJson: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
86
94
|
readonly headers: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").String>>;
|
|
87
95
|
readonly queryParams: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").String>>;
|
|
88
96
|
readonly authenticationTemplate: import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
89
|
-
readonly kind: import("effect/Schema").Literal<"apiKey">;
|
|
90
97
|
readonly slug: import("effect/Schema").String;
|
|
91
|
-
readonly
|
|
92
|
-
|
|
93
|
-
readonly
|
|
98
|
+
readonly kind: import("effect/Schema").Literal<"none">;
|
|
99
|
+
}>, import("effect/Schema").Struct<{
|
|
100
|
+
readonly slug: import("effect/Schema").String;
|
|
101
|
+
readonly kind: import("effect/Schema").Literal<"apikey">;
|
|
102
|
+
readonly label: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
103
|
+
readonly placements: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
104
|
+
readonly carrier: import("effect/Schema").Literals<readonly ["header", "query"]>;
|
|
105
|
+
readonly name: import("effect/Schema").String;
|
|
106
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
107
|
+
readonly variable: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
108
|
+
readonly literal: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
109
|
+
}>>;
|
|
94
110
|
}>, import("effect/Schema").Struct<{
|
|
95
111
|
readonly kind: import("effect/Schema").Literal<"oauth2">;
|
|
96
112
|
readonly slug: import("effect/Schema").String;
|
|
@@ -121,25 +137,42 @@ export declare const graphqlHttpPlugin: import("@executor-js/sdk/core").Configur
|
|
|
121
137
|
slug: import("effect/Schema").String;
|
|
122
138
|
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
123
139
|
readonly authenticationTemplate: import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
124
|
-
readonly
|
|
125
|
-
readonly
|
|
126
|
-
readonly in: import("effect/Schema").Literals<readonly ["header", "query"]>;
|
|
127
|
-
readonly name: import("effect/Schema").String;
|
|
128
|
-
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
140
|
+
readonly slug: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
141
|
+
readonly kind: import("effect/Schema").Literal<"none">;
|
|
129
142
|
}>, import("effect/Schema").Struct<{
|
|
143
|
+
readonly slug: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
130
144
|
readonly kind: import("effect/Schema").Literal<"oauth2">;
|
|
131
|
-
readonly slug: import("effect/Schema").String;
|
|
132
145
|
readonly header: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
133
146
|
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
147
|
+
}>, import("effect/Schema").Struct<{
|
|
148
|
+
readonly slug: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
149
|
+
readonly type: import("effect/Schema").Literal<"apiKey">;
|
|
150
|
+
readonly label: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
151
|
+
readonly headers: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").Struct<{
|
|
152
|
+
readonly type: import("effect/Schema").Literal<"variable">;
|
|
153
|
+
readonly name: import("effect/Schema").String;
|
|
154
|
+
}>]>>]>>>;
|
|
155
|
+
readonly queryParams: import("effect/Schema").optional<import("effect/Schema").$Record<import("effect/Schema").String, import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").String, import("effect/Schema").Struct<{
|
|
156
|
+
readonly type: import("effect/Schema").Literal<"variable">;
|
|
157
|
+
readonly name: import("effect/Schema").String;
|
|
158
|
+
}>]>>]>>>;
|
|
134
159
|
}>]>>;
|
|
135
160
|
readonly mode: import("effect/Schema").optional<import("effect/Schema").Literals<readonly ["merge", "replace"]>>;
|
|
136
161
|
}>>, import("effect/unstable/httpapi/HttpApiEndpoint").StringTree<never>, import("effect/unstable/httpapi/HttpApiEndpoint").Json<import("effect/Schema").Struct<{
|
|
137
162
|
readonly authenticationTemplate: import("effect/Schema").$Array<import("effect/Schema").Union<readonly [import("effect/Schema").Struct<{
|
|
138
|
-
readonly kind: import("effect/Schema").Literal<"apiKey">;
|
|
139
163
|
readonly slug: import("effect/Schema").String;
|
|
140
|
-
readonly
|
|
141
|
-
|
|
142
|
-
readonly
|
|
164
|
+
readonly kind: import("effect/Schema").Literal<"none">;
|
|
165
|
+
}>, import("effect/Schema").Struct<{
|
|
166
|
+
readonly slug: import("effect/Schema").String;
|
|
167
|
+
readonly kind: import("effect/Schema").Literal<"apikey">;
|
|
168
|
+
readonly label: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
169
|
+
readonly placements: import("effect/Schema").$Array<import("effect/Schema").Struct<{
|
|
170
|
+
readonly carrier: import("effect/Schema").Literals<readonly ["header", "query"]>;
|
|
171
|
+
readonly name: import("effect/Schema").String;
|
|
172
|
+
readonly prefix: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
173
|
+
readonly variable: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
174
|
+
readonly literal: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
175
|
+
}>>;
|
|
143
176
|
}>, import("effect/Schema").Struct<{
|
|
144
177
|
readonly kind: import("effect/Schema").Literal<"oauth2">;
|
|
145
178
|
readonly slug: import("effect/Schema").String;
|
|
@@ -21,6 +21,14 @@ var GraphqlAuthRequiredError = class extends Data.TaggedError("GraphqlAuthRequir
|
|
|
21
21
|
|
|
22
22
|
// src/sdk/types.ts
|
|
23
23
|
import { Schema as Schema2 } from "effect";
|
|
24
|
+
import {
|
|
25
|
+
ApiKeyAuthTemplate,
|
|
26
|
+
apiKeyMethodFromAuthTemplate,
|
|
27
|
+
isApiKeyAuthTemplate,
|
|
28
|
+
ApiKeyAuthMethod,
|
|
29
|
+
NoneAuthMethod,
|
|
30
|
+
normalizeAuthMethodSlugs
|
|
31
|
+
} from "@executor-js/sdk/http-auth";
|
|
24
32
|
var GraphqlOperationKind = Schema2.Literals(["query", "mutation"]);
|
|
25
33
|
var GraphqlArgument = Schema2.Struct({
|
|
26
34
|
name: Schema2.String,
|
|
@@ -53,17 +61,7 @@ var OperationBinding = Schema2.Struct({
|
|
|
53
61
|
/** Ordered variable names for mapping */
|
|
54
62
|
variableNames: Schema2.Array(Schema2.String)
|
|
55
63
|
});
|
|
56
|
-
var
|
|
57
|
-
kind: Schema2.Literal("apiKey"),
|
|
58
|
-
/** The template slug a connection references via `connection.template`. */
|
|
59
|
-
slug: Schema2.String,
|
|
60
|
-
in: Schema2.Literals(["header", "query"]),
|
|
61
|
-
/** The header / query-parameter name the value is written to. */
|
|
62
|
-
name: Schema2.String,
|
|
63
|
-
/** Optional prefix prepended to the value (e.g. `Bearer `). */
|
|
64
|
-
prefix: Schema2.optional(Schema2.String)
|
|
65
|
-
});
|
|
66
|
-
var OAuthAuthTemplate = Schema2.Struct({
|
|
64
|
+
var GraphqlOAuthMethod = Schema2.Struct({
|
|
67
65
|
kind: Schema2.Literal("oauth2"),
|
|
68
66
|
slug: Schema2.String,
|
|
69
67
|
/** The header to write the bearer token to. Defaults to `Authorization`. */
|
|
@@ -71,21 +69,57 @@ var OAuthAuthTemplate = Schema2.Struct({
|
|
|
71
69
|
/** The token prefix. Defaults to `Bearer `. */
|
|
72
70
|
prefix: Schema2.optional(Schema2.String)
|
|
73
71
|
});
|
|
74
|
-
var
|
|
72
|
+
var GraphqlAuthMethod = Schema2.Union([
|
|
73
|
+
NoneAuthMethod,
|
|
74
|
+
ApiKeyAuthMethod,
|
|
75
|
+
GraphqlOAuthMethod
|
|
76
|
+
]);
|
|
77
|
+
var GraphqlAuthMethodInput = Schema2.Union([
|
|
78
|
+
Schema2.Struct({ slug: Schema2.optional(Schema2.String), kind: Schema2.Literal("none") }),
|
|
79
|
+
Schema2.Struct({
|
|
80
|
+
slug: Schema2.optional(Schema2.String),
|
|
81
|
+
kind: Schema2.Literal("oauth2"),
|
|
82
|
+
header: Schema2.optional(Schema2.String),
|
|
83
|
+
prefix: Schema2.optional(Schema2.String)
|
|
84
|
+
}),
|
|
85
|
+
// Credential methods are authored request-shaped — the ONE apikey input
|
|
86
|
+
// dialect: `{ type: "apiKey", headers: { Authorization: ["Bearer ",
|
|
87
|
+
// variable("token")] }, queryParams: { … } }`. Stored configs and the
|
|
88
|
+
// catalog read as canonical placements; `apiKeyAuthTemplateFromMethod`
|
|
89
|
+
// serializes them back for read-modify-write flows.
|
|
90
|
+
ApiKeyAuthTemplate
|
|
91
|
+
]);
|
|
92
|
+
var defaultGraphqlAuthSlug = (method) => {
|
|
93
|
+
if (method.kind !== "apikey") return method.kind;
|
|
94
|
+
if (method.placements.length === 1) {
|
|
95
|
+
return method.placements[0].carrier === "header" ? "header" : "query";
|
|
96
|
+
}
|
|
97
|
+
return "apikey";
|
|
98
|
+
};
|
|
99
|
+
var expandGraphqlAuthMethodInputs = (methods) => methods.map(
|
|
100
|
+
(method) => isApiKeyAuthTemplate(method) ? apiKeyMethodFromAuthTemplate(method) : method
|
|
101
|
+
);
|
|
102
|
+
var normalizeGraphqlAuthMethods = (methods) => normalizeAuthMethodSlugs(
|
|
103
|
+
expandGraphqlAuthMethodInputs(methods),
|
|
104
|
+
defaultGraphqlAuthSlug
|
|
105
|
+
);
|
|
75
106
|
var GraphqlIntegrationConfig = Schema2.Struct({
|
|
76
107
|
/** The GraphQL endpoint URL. */
|
|
77
108
|
endpoint: Schema2.String,
|
|
78
109
|
/** Display name for the integration. */
|
|
79
110
|
name: Schema2.String,
|
|
80
|
-
/**
|
|
81
|
-
*
|
|
82
|
-
introspectionJson
|
|
111
|
+
/** Hex SHA-256 of the introspection JSON snapshot — the content address of
|
|
112
|
+
* the blob (`introspection/<hash>` in the plugin blob store). Rows that
|
|
113
|
+
* predate the blob store (inline `introspectionJson` text) are rewritten
|
|
114
|
+
* by the introspection-to-blob migrations before this schema sees them. */
|
|
115
|
+
introspectionHash: Schema2.optional(Schema2.String),
|
|
83
116
|
/** Static headers applied to every request (and to add-time introspection). */
|
|
84
117
|
headers: Schema2.optional(Schema2.Record(Schema2.String, Schema2.String)),
|
|
85
118
|
/** Static query parameters applied to every request. */
|
|
86
119
|
queryParams: Schema2.optional(Schema2.Record(Schema2.String, Schema2.String)),
|
|
87
|
-
/**
|
|
88
|
-
|
|
120
|
+
/** Declared auth methods — how a connection's values are rendered onto
|
|
121
|
+
* requests. A connection's `template` picks one by slug. */
|
|
122
|
+
authenticationTemplate: Schema2.Array(GraphqlAuthMethod)
|
|
89
123
|
});
|
|
90
124
|
var decodeGraphqlIntegrationConfig = Schema2.decodeUnknownEffect(GraphqlIntegrationConfig);
|
|
91
125
|
var decodeGraphqlIntegrationConfigOption = Schema2.decodeUnknownOption(GraphqlIntegrationConfig);
|
|
@@ -105,12 +139,14 @@ export {
|
|
|
105
139
|
ExtractedField,
|
|
106
140
|
ExtractionResult,
|
|
107
141
|
OperationBinding,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
142
|
+
GraphqlOAuthMethod,
|
|
143
|
+
GraphqlAuthMethod,
|
|
144
|
+
GraphqlAuthMethodInput,
|
|
145
|
+
expandGraphqlAuthMethodInputs,
|
|
146
|
+
normalizeGraphqlAuthMethods,
|
|
111
147
|
GraphqlIntegrationConfig,
|
|
112
148
|
decodeGraphqlIntegrationConfig,
|
|
113
149
|
decodeGraphqlIntegrationConfigOption,
|
|
114
150
|
InvocationResult
|
|
115
151
|
};
|
|
116
|
-
//# sourceMappingURL=chunk-
|
|
152
|
+
//# sourceMappingURL=chunk-732HGFSH.js.map
|