@executor-js/plugin-graphql 1.4.33 → 1.5.0

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 (54) hide show
  1. package/dist/AddGraphqlSource-P3D3UXRJ.js +179 -0
  2. package/dist/AddGraphqlSource-P3D3UXRJ.js.map +1 -0
  3. package/dist/EditGraphqlSource-FVF67CTP.js +38 -0
  4. package/dist/EditGraphqlSource-FVF67CTP.js.map +1 -0
  5. package/dist/GraphqlAccountsPanel-GBNFHLFH.js +9 -0
  6. package/dist/GraphqlAccountsPanel-GBNFHLFH.js.map +1 -0
  7. package/dist/api/group.d.ts +108 -119
  8. package/dist/api/handlers.d.ts +9 -7
  9. package/dist/api/index.d.ts +117 -104
  10. package/dist/chunk-2Y3J3CVO.js +191 -0
  11. package/dist/chunk-2Y3J3CVO.js.map +1 -0
  12. package/dist/chunk-ADQTI2OK.js +1309 -0
  13. package/dist/chunk-ADQTI2OK.js.map +1 -0
  14. package/dist/{chunk-UIAHATHP.js → chunk-N5GJE7R6.js} +42 -58
  15. package/dist/chunk-N5GJE7R6.js.map +1 -0
  16. package/dist/chunk-VCYDSSIK.js +79 -0
  17. package/dist/chunk-VCYDSSIK.js.map +1 -0
  18. package/dist/client.js +7 -7
  19. package/dist/client.js.map +1 -1
  20. package/dist/core.js +20 -28
  21. package/dist/index.js +2 -2
  22. package/dist/react/AddGraphqlSource.d.ts +1 -1
  23. package/dist/react/EditGraphqlSource.d.ts +2 -2
  24. package/dist/react/GraphqlAccountsPanel.d.ts +6 -0
  25. package/dist/react/GraphqlSignInButton.d.ts +6 -2
  26. package/dist/react/GraphqlSourceFields.d.ts +2 -2
  27. package/dist/react/atoms.d.ts +95 -205
  28. package/dist/react/auth-method-config.d.ts +9 -0
  29. package/dist/react/client.d.ts +108 -97
  30. package/dist/react/defaults.d.ts +16 -2
  31. package/dist/react/index.d.ts +2 -2
  32. package/dist/react/source-plugin.d.ts +2 -2
  33. package/dist/sdk/errors.d.ts +8 -6
  34. package/dist/sdk/index.d.ts +5 -5
  35. package/dist/sdk/introspect.d.ts +1 -1
  36. package/dist/sdk/invoke.d.ts +1 -4
  37. package/dist/sdk/plugin.d.ts +94 -104
  38. package/dist/sdk/store.d.ts +11 -28
  39. package/dist/sdk/types.d.ts +110 -72
  40. package/package.json +5 -4
  41. package/dist/AddGraphqlSource-CJCUUYNM.js +0 -250
  42. package/dist/AddGraphqlSource-CJCUUYNM.js.map +0 -1
  43. package/dist/EditGraphqlSource-YLTPUYW4.js +0 -267
  44. package/dist/EditGraphqlSource-YLTPUYW4.js.map +0 -1
  45. package/dist/GraphqlSourceSummary-YWJX6ONU.js +0 -70
  46. package/dist/GraphqlSourceSummary-YWJX6ONU.js.map +0 -1
  47. package/dist/chunk-2252RTCE.js +0 -1730
  48. package/dist/chunk-2252RTCE.js.map +0 -1
  49. package/dist/chunk-D3FN3ZDA.js +0 -125
  50. package/dist/chunk-D3FN3ZDA.js.map +0 -1
  51. package/dist/chunk-M4SJY6CB.js +0 -45
  52. package/dist/chunk-M4SJY6CB.js.map +0 -1
  53. package/dist/chunk-UIAHATHP.js.map +0 -1
  54. package/dist/react/GraphqlSourceSummary.d.ts +0 -5
@@ -0,0 +1,179 @@
1
+ import {
2
+ addGraphqlIntegrationOptimistic,
3
+ graphqlTemplatesFromPlacements
4
+ } from "./chunk-2Y3J3CVO.js";
5
+ import "./chunk-N5GJE7R6.js";
6
+
7
+ // src/react/AddGraphqlSource.tsx
8
+ import { useCallback, useMemo, useState } from "react";
9
+ import { useAtomSet, useAtomValue } from "@effect/atom-react";
10
+ import { Link } from "@tanstack/react-router";
11
+ 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
+ import { integrationWriteKeys } from "@executor-js/react/api/reactivity-keys";
18
+ import {
19
+ integrationDisplayNameFromUrl,
20
+ slugifyNamespace,
21
+ useIntegrationIdentity
22
+ } from "@executor-js/react/plugins/integration-identity";
23
+ import { Button } from "@executor-js/react/components/button";
24
+ import {
25
+ AuthTemplateEditor
26
+ } from "@executor-js/react/components/auth-template-editor";
27
+ import { FieldLabel } from "@executor-js/react/components/field";
28
+ import { FloatActions } from "@executor-js/react/components/float-actions";
29
+ import { Spinner } from "@executor-js/react/components/spinner";
30
+
31
+ // src/react/GraphqlSourceFields.tsx
32
+ import {
33
+ CardStack,
34
+ CardStackContent,
35
+ CardStackEntryField
36
+ } from "@executor-js/react/components/card-stack";
37
+ import { Input } from "@executor-js/react/components/input";
38
+ import {
39
+ IntegrationIdentityFieldRows
40
+ } from "@executor-js/react/plugins/integration-identity";
41
+ import { jsx, jsxs } from "react/jsx-runtime";
42
+ function GraphqlSourceFields(props) {
43
+ return /* @__PURE__ */ jsx(CardStack, { children: /* @__PURE__ */ jsxs(CardStackContent, { className: "border-t-0", children: [
44
+ /* @__PURE__ */ jsx(
45
+ CardStackEntryField,
46
+ {
47
+ label: "Endpoint",
48
+ hint: "The endpoint will be introspected to discover available queries and mutations.",
49
+ children: /* @__PURE__ */ jsx(
50
+ Input,
51
+ {
52
+ value: props.endpoint,
53
+ onChange: (e) => props.onEndpointChange(e.target.value),
54
+ placeholder: "https://api.example.com/graphql",
55
+ className: "font-mono text-sm",
56
+ disabled: props.endpointDisabled
57
+ }
58
+ )
59
+ }
60
+ ),
61
+ /* @__PURE__ */ jsx(
62
+ IntegrationIdentityFieldRows,
63
+ {
64
+ identity: props.identity,
65
+ namePlaceholder: "e.g. Shopify API",
66
+ namespaceReadOnly: props.namespaceReadOnly
67
+ }
68
+ )
69
+ ] }) });
70
+ }
71
+
72
+ // src/react/AddGraphqlSource.tsx
73
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
74
+ var ErrorMessage = Schema.Struct({ message: Schema.String });
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.`;
85
+ function AddGraphqlSource(props) {
86
+ const [endpoint, setEndpoint] = useState(props.initialUrl ?? "");
87
+ const identity = useIntegrationIdentity({
88
+ fallbackName: integrationDisplayNameFromUrl(endpoint, "GraphQL") ?? ""
89
+ });
90
+ const [authValue, setAuthValue] = useState({ kind: "none" });
91
+ const [adding, setAdding] = useState(false);
92
+ const [addError, setAddError] = useState(null);
93
+ const doAddIntegration = useAtomSet(addGraphqlIntegrationOptimistic, {
94
+ mode: "promiseExit"
95
+ });
96
+ const apiKeyComplete = authValue.kind !== "apikey" || authValue.placements.some((placement) => placement.name.trim().length > 0);
97
+ const resolvedSlug = useMemo(
98
+ () => slugifyNamespace(identity.namespace) || slugifyNamespace(integrationDisplayNameFromUrl(endpoint.trim(), "GraphQL") ?? "") || "graphql",
99
+ [endpoint, identity.namespace]
100
+ );
101
+ const integrationsResult = useAtomValue(integrationsOptimisticAtom);
102
+ const slugAlreadyExists = useMemo(
103
+ () => AsyncResult.isSuccess(integrationsResult) && integrationsResult.value.some((integration) => String(integration.slug) === resolvedSlug),
104
+ [integrationsResult, resolvedSlug]
105
+ );
106
+ const canAdd = endpoint.trim().length > 0 && apiKeyComplete && !adding && !slugAlreadyExists;
107
+ const sourceIdentity = useCallback(() => {
108
+ const trimmedEndpoint = endpoint.trim();
109
+ const slug = resolvedSlug;
110
+ const displayName = identity.name.trim() || integrationDisplayNameFromUrl(trimmedEndpoint, "GraphQL") || slug;
111
+ return { trimmedEndpoint, slug, displayName };
112
+ }, [endpoint, identity.name, resolvedSlug]);
113
+ const handleAdd = async () => {
114
+ setAdding(true);
115
+ setAddError(null);
116
+ const { trimmedEndpoint, slug, displayName } = sourceIdentity();
117
+ const authenticationTemplate = authValue.kind === "apikey" ? graphqlTemplatesFromPlacements(authValue.placements) : [];
118
+ const integrationExit = await doAddIntegration({
119
+ payload: {
120
+ endpoint: trimmedEndpoint,
121
+ slug,
122
+ name: displayName,
123
+ ...authenticationTemplate.length > 0 ? { authenticationTemplate } : {}
124
+ },
125
+ reactivityKeys: integrationWriteKeys
126
+ });
127
+ if (Exit.isFailure(integrationExit)) {
128
+ setAddError(
129
+ isIntegrationAlreadyExistsExit(integrationExit) ? integrationExistsMessage(slug) : errorMessageFromExit(integrationExit, "Failed to add source")
130
+ );
131
+ setAdding(false);
132
+ return;
133
+ }
134
+ const registeredSlug = integrationExit.value.slug;
135
+ props.onComplete(String(registeredSlug));
136
+ };
137
+ return /* @__PURE__ */ jsxs2("div", { className: "flex flex-1 flex-col gap-6", children: [
138
+ /* @__PURE__ */ jsx2("h1", { className: "text-xl font-semibold text-foreground", children: "Add GraphQL Source" }),
139
+ /* @__PURE__ */ jsx2(GraphqlSourceFields, { endpoint, onEndpointChange: setEndpoint, identity }),
140
+ /* @__PURE__ */ jsxs2("section", { className: "space-y-2.5", children: [
141
+ /* @__PURE__ */ jsx2(FieldLabel, { children: "How does this API authenticate?" }),
142
+ /* @__PURE__ */ jsx2(
143
+ AuthTemplateEditor,
144
+ {
145
+ value: authValue,
146
+ onChange: setAuthValue,
147
+ allowedKinds: ["none", "apikey"]
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 }) }),
167
+ /* @__PURE__ */ jsxs2(FloatActions, { children: [
168
+ /* @__PURE__ */ jsx2(Button, { variant: "ghost", onClick: () => props.onCancel(), disabled: adding, children: "Cancel" }),
169
+ /* @__PURE__ */ jsxs2(Button, { onClick: () => void handleAdd(), disabled: !canAdd, children: [
170
+ adding && /* @__PURE__ */ jsx2(Spinner, { className: "size-3.5" }),
171
+ adding ? "Adding..." : "Add source"
172
+ ] })
173
+ ] })
174
+ ] });
175
+ }
176
+ export {
177
+ AddGraphqlSource as default
178
+ };
179
+ //# sourceMappingURL=AddGraphqlSource-P3D3UXRJ.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, useAtomValue } from \"@effect/atom-react\";\nimport { Link } from \"@tanstack/react-router\";\nimport * as Exit from \"effect/Exit\";\nimport * as Option from \"effect/Option\";\nimport * as Predicate from \"effect/Predicate\";\nimport * as Schema from \"effect/Schema\";\nimport * as AsyncResult from \"effect/unstable/reactivity/AsyncResult\";\n\nimport { integrationsOptimisticAtom } from \"@executor-js/react/api/atoms\";\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 AuthTemplateEditor,\n type AuthTemplateEditorValue,\n} from \"@executor-js/react/components/auth-template-editor\";\nimport { FieldLabel } from \"@executor-js/react/components/field\";\nimport { FloatActions } from \"@executor-js/react/components/float-actions\";\nimport { Spinner } from \"@executor-js/react/components/spinner\";\n\nimport { addGraphqlIntegrationOptimistic } from \"./atoms\";\nimport { GraphqlSourceFields } from \"./GraphqlSourceFields\";\nimport { graphqlTemplatesFromPlacements } from \"./auth-method-config\";\n\nconst ErrorMessage = Schema.Struct({ message: Schema.String });\nconst decodeErrorMessage = Schema.decodeUnknownOption(ErrorMessage);\n\nconst errorMessageFromExit = (exit: Exit.Exit<unknown, unknown>, fallback: string): string =>\n Option.match(Option.flatMap(Exit.findErrorOption(exit), decodeErrorMessage), {\n onNone: () => fallback,\n onSome: ({ message }) => message,\n });\n\nconst isIntegrationAlreadyExistsExit = (exit: Exit.Exit<unknown, unknown>): boolean =>\n Option.match(Exit.findErrorOption(exit), {\n onNone: () => false,\n onSome: Predicate.isTagged(\"IntegrationAlreadyExistsError\"),\n });\n\nconst integrationExistsMessage = (slug: string): string =>\n `An integration named \"${slug}\" already exists. To add more authentication, update your existing integration.`;\n\n// v2 GraphQL add flow (post-redesign): register the integration (introspects\n// the endpoint and declares an apiKey auth template when the user configures a\n// header), then route to the integration's detail hub. Connection creation is\n// no longer part of the add flow — accounts are added from the hub (P6: add\n// without auth, connect later). Auth is declared through the shared\n// `AuthTemplateEditor` (GraphQL stays header/query apiKey — OAuth is hidden).\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 [authValue, setAuthValue] = useState<AuthTemplateEditorValue>({ kind: \"none\" });\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 // An apiKey method needs at least one named placement; `none` is always valid.\n const apiKeyComplete =\n authValue.kind !== \"apikey\" ||\n authValue.placements.some((placement) => placement.name.trim().length > 0);\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 integrationsResult = useAtomValue(integrationsOptimisticAtom);\n const slugAlreadyExists = useMemo(\n () =>\n AsyncResult.isSuccess(integrationsResult) &&\n integrationsResult.value.some((integration) => String(integration.slug) === resolvedSlug),\n [integrationsResult, resolvedSlug],\n );\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 authenticationTemplate =\n authValue.kind === \"apikey\" ? graphqlTemplatesFromPlacements(authValue.placements) : [];\n\n const integrationExit = await doAddIntegration({\n payload: {\n endpoint: trimmedEndpoint,\n slug,\n name: displayName,\n ...(authenticationTemplate.length > 0 ? { authenticationTemplate } : {}),\n },\n reactivityKeys: integrationWriteKeys,\n });\n if (Exit.isFailure(integrationExit)) {\n setAddError(\n isIntegrationAlreadyExistsExit(integrationExit)\n ? integrationExistsMessage(slug)\n : errorMessageFromExit(integrationExit, \"Failed to add source\"),\n );\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 <section className=\"space-y-2.5\">\n <FieldLabel>How does this API authenticate?</FieldLabel>\n <AuthTemplateEditor\n value={authValue}\n onChange={setAuthValue}\n allowedKinds={[\"none\", \"apikey\"]}\n />\n </section>\n\n {slugAlreadyExists && !adding && (\n <div className=\"rounded-lg border border-destructive/30 bg-destructive/5 px-3 py-2\">\n <p className=\"text-[12px] text-destructive\">\n An integration named &quot;{resolvedSlug}&quot; already exists. To add more\n authentication, update your existing integration.{\" \"}\n <Link\n to=\"/integrations/$namespace\"\n params={{ namespace: resolvedSlug }}\n className=\"font-medium underline underline-offset-2\"\n >\n Open it\n </Link>\n </p>\n </div>\n )}\n\n {addError && (\n <div className=\"rounded-lg border border-destructive/30 bg-destructive/5 px-3 py-2\">\n <p className=\"text-[12px] text-destructive\">{addError}</p>\n </div>\n )}\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":";;;;;;;AAAA,SAAS,aAAa,SAAS,gBAAgB;AAC/C,SAAS,YAAY,oBAAoB;AACzC,SAAS,YAAY;AACrB,YAAY,UAAU;AACtB,YAAY,YAAY;AACxB,YAAY,eAAe;AAC3B,YAAY,YAAY;AACxB,YAAY,iBAAiB;AAE7B,SAAS,kCAAkC;AAC3C,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,cAAc;AACvB;AAAA,EACE;AAAA,OAEK;AACP,SAAS,kBAAkB;AAC3B,SAAS,oBAAoB;AAC7B,SAAS,eAAe;;;ACvBxB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,aAAa;AACtB;AAAA,EACE;AAAA,OAEK;AAWD,SAKI,KALJ;AATC,SAAS,oBAAoB,OAMjC;AACD,SACE,oBAAC,aACC,+BAAC,oBAAiB,WAAU,cAC1B;AAAA;AAAA,MAAC;AAAA;AAAA,QACC,OAAM;AAAA,QACN,MAAK;AAAA,QAEL;AAAA,UAAC;AAAA;AAAA,YACC,OAAO,MAAM;AAAA,YACb,UAAU,CAAC,MAAM,MAAM,iBAAkB,EAAE,OAA4B,KAAK;AAAA,YAC5E,aAAY;AAAA,YACZ,WAAU;AAAA,YACV,UAAU,MAAM;AAAA;AAAA,QAClB;AAAA;AAAA,IACF;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,UAAU,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+
9
+ // src/react/EditGraphqlSource.tsx
10
+ import { useAtomValue } from "@effect/atom-react";
11
+ import * as AsyncResult from "effect/unstable/reactivity/AsyncResult";
12
+ import * as Option from "effect/Option";
13
+ import { IntegrationSlug } from "@executor-js/sdk/shared";
14
+ import { decodeGraphqlIntegrationConfigOption } from "@executor-js/plugin-graphql";
15
+ import { jsx, jsxs } from "react/jsx-runtime";
16
+ function EditGraphqlSource(props) {
17
+ const slug = IntegrationSlug.make(props.sourceId);
18
+ const configResult = useAtomValue(graphqlIntegrationConfigAtom(slug));
19
+ const config = AsyncResult.isSuccess(configResult) ? Option.getOrNull(decodeGraphqlIntegrationConfigOption(configResult.value)) : null;
20
+ if (!AsyncResult.isSuccess(configResult) || !config) {
21
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
22
+ /* @__PURE__ */ jsx("h1", { className: "text-xl font-semibold text-foreground", children: "GraphQL Source" }),
23
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Loading configuration\u2026" })
24
+ ] });
25
+ }
26
+ return /* @__PURE__ */ jsx(
27
+ GraphqlAccountsPanel,
28
+ {
29
+ sourceId: props.sourceId,
30
+ integrationName: config.name || String(slug),
31
+ accountHandoff: null
32
+ }
33
+ );
34
+ }
35
+ export {
36
+ EditGraphqlSource as default
37
+ };
38
+ //# sourceMappingURL=EditGraphqlSource-FVF67CTP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/react/EditGraphqlSource.tsx"],"sourcesContent":["import { useAtomValue } from \"@effect/atom-react\";\nimport * as AsyncResult from \"effect/unstable/reactivity/AsyncResult\";\nimport * as Option from \"effect/Option\";\n\nimport { IntegrationSlug } from \"@executor-js/sdk/shared\";\nimport { decodeGraphqlIntegrationConfigOption } from \"@executor-js/plugin-graphql\";\n\nimport { graphqlIntegrationConfigAtom } from \"./atoms\";\nimport GraphqlAccountsPanel from \"./GraphqlAccountsPanel\";\n\n// ---------------------------------------------------------------------------\n// Edit form — v2: custom authentication methods and connections live in the\n// shared accounts hub. Keep edit and accounts on the same component path so\n// GraphQL gets the same \"+ Custom method\" behavior as OpenAPI.\n// ---------------------------------------------------------------------------\n\nexport default function EditGraphqlSource(props: {\n readonly sourceId: string;\n readonly onSave: () => void;\n}) {\n const slug = IntegrationSlug.make(props.sourceId);\n const configResult = useAtomValue(graphqlIntegrationConfigAtom(slug));\n const config = AsyncResult.isSuccess(configResult)\n ? Option.getOrNull(decodeGraphqlIntegrationConfigOption(configResult.value))\n : null;\n\n if (!AsyncResult.isSuccess(configResult) || !config) {\n return (\n <div className=\"space-y-3\">\n <h1 className=\"text-xl font-semibold text-foreground\">GraphQL Source</h1>\n <p className=\"text-sm text-muted-foreground\">Loading configuration…</p>\n </div>\n );\n }\n\n return (\n <GraphqlAccountsPanel\n sourceId={props.sourceId}\n integrationName={config.name || String(slug)}\n accountHandoff={null}\n />\n );\n}\n"],"mappings":";;;;;;;;;AAAA,SAAS,oBAAoB;AAC7B,YAAY,iBAAiB;AAC7B,YAAY,YAAY;AAExB,SAAS,uBAAuB;AAChC,SAAS,4CAA4C;AAuB/C,SACE,KADF;AAZS,SAAR,kBAAmC,OAGvC;AACD,QAAM,OAAO,gBAAgB,KAAK,MAAM,QAAQ;AAChD,QAAM,eAAe,aAAa,6BAA6B,IAAI,CAAC;AACpE,QAAM,SAAqB,sBAAU,YAAY,IACtC,iBAAU,qCAAqC,aAAa,KAAK,CAAC,IACzE;AAEJ,MAAI,CAAa,sBAAU,YAAY,KAAK,CAAC,QAAQ;AACnD,WACE,qBAAC,SAAI,WAAU,aACb;AAAA,0BAAC,QAAG,WAAU,yCAAwC,4BAAc;AAAA,MACpE,oBAAC,OAAE,WAAU,iCAAgC,yCAAsB;AAAA,OACrE;AAAA,EAEJ;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,UAAU,MAAM;AAAA,MAChB,iBAAiB,OAAO,QAAQ,OAAO,IAAI;AAAA,MAC3C,gBAAgB;AAAA;AAAA,EAClB;AAEJ;","names":[]}
@@ -0,0 +1,9 @@
1
+ import {
2
+ GraphqlAccountsPanel
3
+ } from "./chunk-VCYDSSIK.js";
4
+ import "./chunk-2Y3J3CVO.js";
5
+ import "./chunk-N5GJE7R6.js";
6
+ export {
7
+ GraphqlAccountsPanel as default
8
+ };
9
+ //# sourceMappingURL=GraphqlAccountsPanel-GBNFHLFH.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -1,169 +1,158 @@
1
1
  import { HttpApiEndpoint, HttpApiGroup } from "effect/unstable/httpapi";
2
2
  import { Schema } from "effect";
3
- import { InternalError } from "@executor-js/sdk/shared";
3
+ import { InternalError, IntegrationAlreadyExistsError } from "@executor-js/sdk/shared";
4
4
  import { GraphqlIntrospectionError, GraphqlExtractionError } from "../sdk/errors";
5
- export declare const StoredSourceSchema: Schema.Struct<{
6
- readonly namespace: Schema.String;
7
- readonly scope: Schema.brand<Schema.String, "ScopeId">;
8
- readonly name: Schema.String;
5
+ export declare const GraphqlGroup: HttpApiGroup.HttpApiGroup<"graphql", HttpApiEndpoint.HttpApiEndpoint<"addIntegration", "POST", "/graphql/integrations", HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
9
6
  readonly endpoint: Schema.String;
10
- readonly headers: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
11
- readonly kind: Schema.Literal<"binding">;
12
- readonly slot: Schema.String;
13
- readonly prefix: Schema.optional<Schema.String>;
14
- }>]>>;
15
- readonly queryParams: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
16
- readonly kind: Schema.Literal<"binding">;
17
- readonly slot: Schema.String;
7
+ readonly slug: Schema.optional<Schema.String>;
8
+ readonly name: Schema.optional<Schema.String>;
9
+ readonly introspectionJson: Schema.optional<Schema.String>;
10
+ readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
11
+ readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
12
+ readonly authenticationTemplate: Schema.optional<Schema.$Array<Schema.Union<readonly [Schema.Struct<{
13
+ readonly kind: Schema.Literal<"apiKey">;
14
+ readonly slug: Schema.String;
15
+ readonly in: Schema.Literals<readonly ["header", "query"]>;
16
+ readonly name: Schema.String;
18
17
  readonly prefix: Schema.optional<Schema.String>;
19
- }>]>>;
20
- readonly auth: Schema.Union<readonly [Schema.Struct<{
21
- readonly kind: Schema.Literal<"none">;
22
18
  }>, Schema.Struct<{
23
19
  readonly kind: Schema.Literal<"oauth2">;
24
- readonly connectionSlot: Schema.String;
25
- }>]>;
26
- }>;
27
- export declare const GraphqlGroup: HttpApiGroup.HttpApiGroup<"graphql", HttpApiEndpoint.HttpApiEndpoint<"addSource", "POST", "/scopes/:scopeId/graphql/sources", HttpApiEndpoint.StringTree<Schema.Struct<{
28
- scopeId: Schema.brand<Schema.String, "ScopeId">;
29
- }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
30
- readonly endpoint: Schema.String;
31
- readonly name: Schema.String;
32
- readonly introspectionJson: Schema.optional<Schema.String>;
33
- readonly namespace: Schema.String;
34
- readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
35
- readonly kind: Schema.Literal<"secret">;
36
- readonly prefix: Schema.optional<Schema.String>;
37
- }>]>>>;
38
- readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
39
- readonly kind: Schema.Literal<"secret">;
20
+ readonly slug: Schema.String;
21
+ readonly header: Schema.optional<Schema.String>;
40
22
  readonly prefix: Schema.optional<Schema.String>;
41
23
  }>]>>>;
42
- readonly oauth2: Schema.optional<Schema.Struct<{
43
- readonly kind: Schema.Literal<"oauth2">;
44
- readonly securitySchemeName: Schema.String;
45
- readonly flow: Schema.Literals<readonly ["authorizationCode", "clientCredentials"]>;
46
- readonly tokenUrl: Schema.String;
47
- readonly authorizationUrl: Schema.withDecodingDefault<Schema.optional<Schema.NullOr<Schema.String>>>;
48
- readonly issuerUrl: Schema.optional<Schema.NullOr<Schema.String>>;
49
- readonly clientIdSlot: Schema.String;
50
- readonly clientSecretSlot: Schema.NullOr<Schema.String>;
51
- readonly connectionSlot: Schema.String;
52
- readonly scopes: Schema.$Array<Schema.String>;
53
- }>>;
54
- readonly credentials: Schema.optional<Schema.Struct<{
55
- readonly scope: Schema.brand<Schema.String, "ScopeId">;
56
- readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
57
- readonly kind: Schema.Literal<"text">;
58
- readonly text: Schema.String;
59
- readonly prefix: Schema.optional<Schema.String>;
60
- }>, Schema.Struct<{
61
- readonly kind: Schema.Literal<"secret">;
62
- readonly secretId: Schema.String;
63
- readonly secretScope: Schema.optional<Schema.String>;
64
- readonly prefix: Schema.optional<Schema.String>;
65
- }>, Schema.Struct<{
66
- readonly kind: Schema.Literal<"connection">;
67
- readonly connectionId: Schema.String;
68
- }>]>>>;
69
- readonly queryParams: Schema.optional<Schema.$Record<Schema.String, 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
- readonly auth: Schema.optional<Schema.Union<readonly [Schema.Struct<{
83
- readonly kind: Schema.Literal<"none">;
84
- }>, Schema.Struct<{
85
- readonly oauth2: Schema.optional<Schema.Struct<{
86
- readonly connection: Schema.optional<Schema.Union<readonly [Schema.String, Schema.Struct<{
87
- readonly kind: Schema.Literal<"text">;
88
- readonly text: Schema.String;
89
- readonly prefix: Schema.optional<Schema.String>;
90
- }>, Schema.Struct<{
91
- readonly kind: Schema.Literal<"secret">;
92
- readonly secretId: Schema.String;
93
- readonly secretScope: Schema.optional<Schema.String>;
94
- readonly prefix: Schema.optional<Schema.String>;
95
- }>, Schema.Struct<{
96
- readonly kind: Schema.Literal<"connection">;
97
- readonly connectionId: Schema.String;
98
- }>]>>;
99
- }>>;
100
- }>]>>;
101
- }>>;
102
24
  }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
103
- readonly toolCount: Schema.Number;
104
- readonly namespace: Schema.String;
105
- }>>, HttpApiEndpoint.Json<typeof InternalError | Schema.decodeTo<Schema.declareConstructor<GraphqlIntrospectionError, {
106
- readonly _tag: "GraphqlIntrospectionError";
25
+ readonly slug: Schema.String;
26
+ readonly name: Schema.String;
27
+ }>>, HttpApiEndpoint.Json<typeof IntegrationAlreadyExistsError | typeof InternalError | Schema.decodeTo<Schema.declareConstructor<GraphqlIntrospectionError, {
107
28
  readonly message: string;
29
+ readonly _tag: "GraphqlIntrospectionError";
108
30
  }, readonly [Schema.TaggedStruct<"GraphqlIntrospectionError", {
109
31
  readonly message: Schema.String;
110
32
  }>], {
111
- readonly _tag: "GraphqlIntrospectionError";
112
33
  readonly message: string;
34
+ readonly _tag: "GraphqlIntrospectionError";
113
35
  }>, Schema.TaggedStruct<"GraphqlIntrospectionError", {
114
36
  readonly message: Schema.String;
115
37
  }>, never, never> | Schema.decodeTo<Schema.declareConstructor<GraphqlExtractionError, {
116
- readonly _tag: "GraphqlExtractionError";
117
38
  readonly message: string;
39
+ readonly _tag: "GraphqlExtractionError";
118
40
  }, readonly [Schema.TaggedStruct<"GraphqlExtractionError", {
119
41
  readonly message: Schema.String;
120
42
  }>], {
43
+ readonly message: string;
44
+ readonly _tag: "GraphqlExtractionError";
45
+ }>, Schema.TaggedStruct<"GraphqlExtractionError", {
46
+ readonly message: Schema.String;
47
+ }>, never, never>>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getIntegration", "GET", "/graphql/integrations/:slug", HttpApiEndpoint.StringTree<Schema.Struct<{
48
+ slug: Schema.String;
49
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.NullOr<Schema.Unknown>>, HttpApiEndpoint.Json<typeof IntegrationAlreadyExistsError | typeof InternalError | Schema.decodeTo<Schema.declareConstructor<GraphqlIntrospectionError, {
50
+ readonly message: string;
51
+ readonly _tag: "GraphqlIntrospectionError";
52
+ }, readonly [Schema.TaggedStruct<"GraphqlIntrospectionError", {
53
+ readonly message: Schema.String;
54
+ }>], {
55
+ readonly message: string;
56
+ readonly _tag: "GraphqlIntrospectionError";
57
+ }>, Schema.TaggedStruct<"GraphqlIntrospectionError", {
58
+ readonly message: Schema.String;
59
+ }>, never, never> | Schema.decodeTo<Schema.declareConstructor<GraphqlExtractionError, {
60
+ readonly message: string;
121
61
  readonly _tag: "GraphqlExtractionError";
62
+ }, readonly [Schema.TaggedStruct<"GraphqlExtractionError", {
63
+ readonly message: Schema.String;
64
+ }>], {
122
65
  readonly message: string;
66
+ readonly _tag: "GraphqlExtractionError";
123
67
  }>, Schema.TaggedStruct<"GraphqlExtractionError", {
124
68
  readonly message: Schema.String;
125
- }>, never, never>>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getSource", "GET", "/scopes/:scopeId/graphql/sources/:namespace", HttpApiEndpoint.StringTree<Schema.Struct<{
126
- scopeId: Schema.brand<Schema.String, "ScopeId">;
127
- namespace: Schema.String;
69
+ }>, never, never>>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"getConfig", "GET", "/graphql/integrations/:slug/config", HttpApiEndpoint.StringTree<Schema.Struct<{
70
+ slug: Schema.String;
128
71
  }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.NullOr<Schema.Struct<{
129
- readonly namespace: Schema.String;
130
- readonly scope: Schema.brand<Schema.String, "ScopeId">;
131
- readonly name: Schema.String;
132
72
  readonly endpoint: Schema.String;
133
- readonly headers: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
134
- readonly kind: Schema.Literal<"binding">;
135
- readonly slot: Schema.String;
73
+ readonly name: Schema.String;
74
+ readonly introspectionJson: Schema.optional<Schema.String>;
75
+ readonly headers: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
76
+ readonly queryParams: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
77
+ readonly authenticationTemplate: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
78
+ readonly kind: Schema.Literal<"apiKey">;
79
+ readonly slug: Schema.String;
80
+ readonly in: Schema.Literals<readonly ["header", "query"]>;
81
+ readonly name: Schema.String;
82
+ readonly prefix: Schema.optional<Schema.String>;
83
+ }>, Schema.Struct<{
84
+ readonly kind: Schema.Literal<"oauth2">;
85
+ readonly slug: Schema.String;
86
+ readonly header: Schema.optional<Schema.String>;
136
87
  readonly prefix: Schema.optional<Schema.String>;
137
88
  }>]>>;
138
- readonly queryParams: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Struct<{
139
- readonly kind: Schema.Literal<"binding">;
140
- readonly slot: Schema.String;
89
+ }>>>, HttpApiEndpoint.Json<typeof IntegrationAlreadyExistsError | typeof InternalError | Schema.decodeTo<Schema.declareConstructor<GraphqlIntrospectionError, {
90
+ readonly message: string;
91
+ readonly _tag: "GraphqlIntrospectionError";
92
+ }, readonly [Schema.TaggedStruct<"GraphqlIntrospectionError", {
93
+ readonly message: Schema.String;
94
+ }>], {
95
+ readonly message: string;
96
+ readonly _tag: "GraphqlIntrospectionError";
97
+ }>, Schema.TaggedStruct<"GraphqlIntrospectionError", {
98
+ readonly message: Schema.String;
99
+ }>, never, never> | Schema.decodeTo<Schema.declareConstructor<GraphqlExtractionError, {
100
+ readonly message: string;
101
+ readonly _tag: "GraphqlExtractionError";
102
+ }, readonly [Schema.TaggedStruct<"GraphqlExtractionError", {
103
+ readonly message: Schema.String;
104
+ }>], {
105
+ readonly message: string;
106
+ readonly _tag: "GraphqlExtractionError";
107
+ }>, Schema.TaggedStruct<"GraphqlExtractionError", {
108
+ readonly message: Schema.String;
109
+ }>, never, never>>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"configure", "POST", "/graphql/integrations/:slug/config", HttpApiEndpoint.StringTree<Schema.Struct<{
110
+ slug: Schema.String;
111
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
112
+ readonly authenticationTemplate: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
113
+ readonly kind: Schema.Literal<"apiKey">;
114
+ readonly slug: Schema.String;
115
+ readonly in: Schema.Literals<readonly ["header", "query"]>;
116
+ readonly name: Schema.String;
117
+ readonly prefix: Schema.optional<Schema.String>;
118
+ }>, Schema.Struct<{
119
+ readonly kind: Schema.Literal<"oauth2">;
120
+ readonly slug: Schema.String;
121
+ readonly header: Schema.optional<Schema.String>;
141
122
  readonly prefix: Schema.optional<Schema.String>;
142
123
  }>]>>;
143
- readonly auth: Schema.Union<readonly [Schema.Struct<{
144
- readonly kind: Schema.Literal<"none">;
124
+ readonly mode: Schema.optional<Schema.Literals<readonly ["merge", "replace"]>>;
125
+ }>>, HttpApiEndpoint.StringTree<never>, HttpApiEndpoint.Json<Schema.Struct<{
126
+ readonly authenticationTemplate: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
127
+ readonly kind: Schema.Literal<"apiKey">;
128
+ readonly slug: Schema.String;
129
+ readonly in: Schema.Literals<readonly ["header", "query"]>;
130
+ readonly name: Schema.String;
131
+ readonly prefix: Schema.optional<Schema.String>;
145
132
  }>, Schema.Struct<{
146
133
  readonly kind: Schema.Literal<"oauth2">;
147
- readonly connectionSlot: Schema.String;
148
- }>]>;
149
- }>>>, HttpApiEndpoint.Json<typeof InternalError | Schema.decodeTo<Schema.declareConstructor<GraphqlIntrospectionError, {
150
- readonly _tag: "GraphqlIntrospectionError";
134
+ readonly slug: Schema.String;
135
+ readonly header: Schema.optional<Schema.String>;
136
+ readonly prefix: Schema.optional<Schema.String>;
137
+ }>]>>;
138
+ }>>, HttpApiEndpoint.Json<typeof IntegrationAlreadyExistsError | typeof InternalError | Schema.decodeTo<Schema.declareConstructor<GraphqlIntrospectionError, {
151
139
  readonly message: string;
140
+ readonly _tag: "GraphqlIntrospectionError";
152
141
  }, readonly [Schema.TaggedStruct<"GraphqlIntrospectionError", {
153
142
  readonly message: Schema.String;
154
143
  }>], {
155
- readonly _tag: "GraphqlIntrospectionError";
156
144
  readonly message: string;
145
+ readonly _tag: "GraphqlIntrospectionError";
157
146
  }>, Schema.TaggedStruct<"GraphqlIntrospectionError", {
158
147
  readonly message: Schema.String;
159
148
  }>, never, never> | Schema.decodeTo<Schema.declareConstructor<GraphqlExtractionError, {
160
- readonly _tag: "GraphqlExtractionError";
161
149
  readonly message: string;
150
+ readonly _tag: "GraphqlExtractionError";
162
151
  }, readonly [Schema.TaggedStruct<"GraphqlExtractionError", {
163
152
  readonly message: Schema.String;
164
153
  }>], {
165
- readonly _tag: "GraphqlExtractionError";
166
154
  readonly message: string;
155
+ readonly _tag: "GraphqlExtractionError";
167
156
  }>, Schema.TaggedStruct<"GraphqlExtractionError", {
168
157
  readonly message: Schema.String;
169
158
  }>, never, never>>, never, never>, false>;
@@ -1,13 +1,15 @@
1
1
  import { Context, Effect } from "effect";
2
2
  declare const GraphqlExtensionService_base: Context.ServiceClass<GraphqlExtensionService, "GraphqlExtensionService", {
3
- addSource: (config: import("../sdk").GraphqlSourceConfig) => Effect.Effect<{
3
+ addIntegration: (input: import("../sdk").GraphqlAddIntegrationInput) => Effect.Effect<{
4
+ slug: string;
5
+ name: string;
4
6
  toolCount: number;
5
- namespace: string;
6
- }, import("@executor-js/sdk/core").StorageFailure | import("../sdk").GraphqlIntrospectionError | import("../sdk").GraphqlExtractionError, never>;
7
- removeSource: (namespace: string, scope: string) => Effect.Effect<void, import("@executor-js/sdk/core").StorageFailure, never>;
8
- getSource: (namespace: string, scope: string) => Effect.Effect<import("../sdk").StoredGraphqlSource | null, import("@executor-js/sdk/core").StorageFailure, never>;
9
- configureSource: (namespace: string, scope: string, targetScope: string, input: Omit<import("../sdk").GraphqlConfigureSourceInput, "scope">) => Effect.Effect<void, import("@executor-js/sdk/core").StorageFailure, never>;
10
- configure: (source: import("../sdk").GraphqlSourceRef, input: import("../sdk").GraphqlConfigureSourceInput) => Effect.Effect<void, import("@executor-js/sdk/core").StorageFailure, never>;
7
+ }, import("@executor-js/sdk").StorageFailure | import("@executor-js/sdk").IntegrationAlreadyExistsError | import("../sdk").GraphqlIntrospectionError | import("../sdk").GraphqlExtractionError, never>;
8
+ getIntegration: (slug: string) => Effect.Effect<unknown, import("@executor-js/sdk").StorageFailure, never>;
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").AuthTemplate[], import("@executor-js/sdk").StorageFailure>;
11
+ removeIntegration: (slug: string) => Effect.Effect<void, import("@executor-js/sdk").StorageFailure, never>;
12
+ configure: (slug: string, input: import("../sdk").GraphqlConfigureInput) => Effect.Effect<void, import("@executor-js/sdk").StorageFailure, never>;
11
13
  }>;
12
14
  export declare class GraphqlExtensionService extends GraphqlExtensionService_base {
13
15
  }