@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.
Files changed (40) hide show
  1. package/dist/{AddGraphqlSource-3Z3DB4KQ.js → AddGraphqlSource-PBMKSY7Y.js} +29 -18
  2. package/dist/AddGraphqlSource-PBMKSY7Y.js.map +1 -0
  3. package/dist/{EditGraphqlSource-F37RPNKV.js → EditGraphqlSource-AFR4RQHY.js} +107 -91
  4. package/dist/EditGraphqlSource-AFR4RQHY.js.map +1 -0
  5. package/dist/{GraphqlSourceSummary-6EYBXVD2.js → GraphqlSourceSummary-MY4AW37M.js} +4 -4
  6. package/dist/GraphqlSourceSummary-MY4AW37M.js.map +1 -0
  7. package/dist/api/group.d.ts +71 -232
  8. package/dist/api/handlers.d.ts +5 -45
  9. package/dist/api/index.d.ts +76 -404
  10. package/dist/{chunk-PO2TPM5B.js → chunk-7S2FM3ZF.js} +578 -613
  11. package/dist/chunk-7S2FM3ZF.js.map +1 -0
  12. package/dist/chunk-D6E4WAYW.js +51 -0
  13. package/dist/chunk-D6E4WAYW.js.map +1 -0
  14. package/dist/{chunk-445ZPXHU.js → chunk-H422YIM4.js} +15 -34
  15. package/dist/chunk-H422YIM4.js.map +1 -0
  16. package/dist/{chunk-EW4Y3KEX.js → chunk-OYUIHBWZ.js} +23 -80
  17. package/dist/chunk-OYUIHBWZ.js.map +1 -0
  18. package/dist/client.js +7 -47
  19. package/dist/client.js.map +1 -1
  20. package/dist/core.js +3 -8
  21. package/dist/index.js +3 -2
  22. package/dist/react/atoms.d.ts +146 -186
  23. package/dist/react/client.d.ts +70 -231
  24. package/dist/sdk/index.d.ts +2 -2
  25. package/dist/sdk/introspect.d.ts +151 -151
  26. package/dist/sdk/invoke.d.ts +5 -5
  27. package/dist/sdk/plugin.d.ts +74 -228
  28. package/dist/sdk/presets.d.ts +1 -0
  29. package/dist/sdk/store.d.ts +3 -135
  30. package/dist/sdk/types.d.ts +31 -66
  31. package/dist/testing/index.d.ts +20 -2
  32. package/dist/testing.js +77 -29
  33. package/dist/testing.js.map +1 -1
  34. package/package.json +3 -3
  35. package/dist/AddGraphqlSource-3Z3DB4KQ.js.map +0 -1
  36. package/dist/EditGraphqlSource-F37RPNKV.js.map +0 -1
  37. package/dist/GraphqlSourceSummary-6EYBXVD2.js.map +0 -1
  38. package/dist/chunk-445ZPXHU.js.map +0 -1
  39. package/dist/chunk-EW4Y3KEX.js.map +0 -1
  40. package/dist/chunk-PO2TPM5B.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/react/atoms.ts","../src/react/client.ts","../src/api/group.ts"],"sourcesContent":["import type { ScopeId } from \"@executor-js/sdk/shared\";\nimport * as Atom from \"effect/unstable/reactivity/Atom\";\nimport * as AsyncResult from \"effect/unstable/reactivity/AsyncResult\";\nimport { sourceCredentialBindingsAtom, sourcesOptimisticAtom } from \"@executor-js/react/api/atoms\";\nimport { ReactivityKey } from \"@executor-js/react/api/reactivity-keys\";\nimport { GraphqlClient } from \"./client\";\n\n// ---------------------------------------------------------------------------\n// Query atoms\n// ---------------------------------------------------------------------------\n\nexport const graphqlSourceAtom = (scopeId: ScopeId, namespace: string) =>\n GraphqlClient.query(\"graphql\", \"getSource\", {\n params: { scopeId, namespace },\n timeToLive: \"15 seconds\",\n reactivityKeys: [ReactivityKey.sources, ReactivityKey.tools],\n });\n\nexport const graphqlSourceBindingsAtom = (\n scopeId: ScopeId,\n namespace: string,\n sourceScopeId: ScopeId,\n) => sourceCredentialBindingsAtom(scopeId, namespace, sourceScopeId);\n\n// ---------------------------------------------------------------------------\n// Mutation atoms\n// ---------------------------------------------------------------------------\n\nexport const addGraphqlSource = GraphqlClient.mutation(\"graphql\", \"addSource\");\n\nexport const addGraphqlSourceOptimistic = Atom.family((scopeId: ScopeId) =>\n sourcesOptimisticAtom(scopeId).pipe(\n Atom.optimisticFn({\n reducer: (current, arg) =>\n AsyncResult.map(current, (rows) => {\n const id = arg.payload.namespace ?? `pending-${Math.random().toString(36).slice(2)}`;\n const source = {\n id,\n scopeId,\n kind: \"graphql\",\n pluginId: \"graphql\",\n name: arg.payload.name ?? id,\n url: arg.payload.endpoint,\n canRemove: false,\n canRefresh: false,\n canEdit: false,\n runtime: false,\n };\n return [source, ...rows.filter((row) => row.id !== id)].sort((a, b) =>\n a.name.localeCompare(b.name),\n );\n }),\n fn: addGraphqlSource,\n }),\n ),\n);\n","import { createPluginAtomClient } from \"@executor-js/sdk/client\";\nimport { getBaseUrl } from \"@executor-js/react/api/base-url\";\nimport { GraphqlGroup } from \"../api/group\";\n\nexport const GraphqlClient = createPluginAtomClient(GraphqlGroup, {\n baseUrl: getBaseUrl,\n});\n","import { HttpApiEndpoint, HttpApiGroup } from \"effect/unstable/httpapi\";\nimport { Schema } from \"effect\";\nimport { InternalError, ScopeId } from \"@executor-js/sdk/shared\";\n\nimport { GraphqlIntrospectionError, GraphqlExtractionError } from \"../sdk/errors\";\nimport {\n GraphqlConfiguredValueInput,\n ConfiguredGraphqlCredentialValue,\n GraphqlCredentialInput,\n GraphqlSourceAuth,\n GraphqlSourceAuthInput,\n} from \"../sdk/types\";\nimport { OAuth2SourceConfig } from \"@executor-js/sdk/http-source\";\n\n// StoredGraphqlSource shape as an HTTP response schema. Kept local to the\n// api layer because the sdk-side `StoredGraphqlSource` is a plain interface.\nexport const StoredSourceSchema = Schema.Struct({\n namespace: Schema.String,\n scope: ScopeId,\n name: Schema.String,\n endpoint: Schema.String,\n headers: Schema.Record(Schema.String, ConfiguredGraphqlCredentialValue),\n queryParams: Schema.Record(Schema.String, ConfiguredGraphqlCredentialValue),\n auth: GraphqlSourceAuth,\n});\n\n// ---------------------------------------------------------------------------\n// Params\n// ---------------------------------------------------------------------------\n\nconst ScopeParams = {\n scopeId: ScopeId,\n};\n\nconst SourceParams = {\n scopeId: ScopeId,\n namespace: Schema.String,\n};\n\n// ---------------------------------------------------------------------------\n// Payloads\n// ---------------------------------------------------------------------------\n\nconst AddSourcePayload = Schema.Struct({\n endpoint: Schema.String,\n name: Schema.String,\n introspectionJson: Schema.optional(Schema.String),\n namespace: Schema.String,\n headers: Schema.optional(Schema.Record(Schema.String, GraphqlConfiguredValueInput)),\n queryParams: Schema.optional(Schema.Record(Schema.String, GraphqlConfiguredValueInput)),\n oauth2: Schema.optional(OAuth2SourceConfig),\n credentials: Schema.optional(\n Schema.Struct({\n scope: ScopeId,\n headers: Schema.optional(Schema.Record(Schema.String, GraphqlCredentialInput)),\n queryParams: Schema.optional(Schema.Record(Schema.String, GraphqlCredentialInput)),\n auth: Schema.optional(GraphqlSourceAuthInput),\n }),\n ),\n});\n\n// ---------------------------------------------------------------------------\n// Responses\n// ---------------------------------------------------------------------------\n\nconst AddSourceResponse = Schema.Struct({\n toolCount: Schema.Number,\n namespace: Schema.String,\n});\n\n// ---------------------------------------------------------------------------\n// Errors with HTTP status\n// ---------------------------------------------------------------------------\n\nconst IntrospectionError = GraphqlIntrospectionError.annotate({ httpApiStatus: 400 });\nconst ExtractionError = GraphqlExtractionError.annotate({ httpApiStatus: 400 });\n\n// ---------------------------------------------------------------------------\n// Group\n//\n// Plugin SDK errors (GraphqlIntrospectionError etc.) are declared once at\n// the group level via `.addError(...)` — every endpoint inherits them. The\n// errors themselves carry their HTTP status via `HttpApiSchema.annotations`\n// above, so handlers just `return yield* ext.foo(...)` and the schema\n// encodes whatever it gets.\n//\n// 5xx is handled at the API level: `.addError(InternalError)` adds a\n// single shared opaque-by-schema 500 surface translated from `StorageError`\n// by `withCapture` at the HTTP edge. No per-handler wrapping, no\n// per-plugin InternalError.\n// ---------------------------------------------------------------------------\n\nconst GraphqlErrors = [InternalError, IntrospectionError, ExtractionError] as const;\n\nexport const GraphqlGroup = HttpApiGroup.make(\"graphql\")\n .add(\n HttpApiEndpoint.post(\"addSource\", \"/scopes/:scopeId/graphql/sources\", {\n params: ScopeParams,\n payload: AddSourcePayload,\n success: AddSourceResponse,\n error: GraphqlErrors,\n }),\n )\n .add(\n HttpApiEndpoint.get(\"getSource\", \"/scopes/:scopeId/graphql/sources/:namespace\", {\n params: SourceParams,\n success: Schema.NullOr(StoredSourceSchema),\n error: GraphqlErrors,\n }),\n );\n// Plugin domain errors carry their own HTTP status (4xx);\n// `InternalError` is the shared opaque 500 translated at the HTTP edge.\n"],"mappings":"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","names":[]}
package/dist/client.js CHANGED
@@ -1,55 +1,15 @@
1
+ import {
2
+ graphqlPresets
3
+ } from "./chunk-D6E4WAYW.js";
4
+
1
5
  // src/react/plugin-client.tsx
2
6
  import { defineClientPlugin } from "@executor-js/sdk/client";
3
7
 
4
8
  // src/react/source-plugin.ts
5
9
  import { lazy } from "react";
6
-
7
- // src/sdk/presets.ts
8
- var graphqlPresets = [
9
- {
10
- id: "github-graphql",
11
- name: "GitHub GraphQL",
12
- summary: "Repos, issues, PRs, and users via GitHub's GraphQL API.",
13
- url: "https://api.github.com/graphql",
14
- icon: "https://github.com/favicon.ico",
15
- featured: true
16
- },
17
- {
18
- id: "gitlab",
19
- name: "GitLab",
20
- summary: "Projects, merge requests, pipelines, and users.",
21
- url: "https://gitlab.com/api/graphql",
22
- icon: "https://gitlab.com/favicon.ico",
23
- featured: true
24
- },
25
- {
26
- id: "linear",
27
- name: "Linear",
28
- summary: "Issues, projects, teams, and cycles.",
29
- url: "https://api.linear.app/graphql",
30
- icon: "https://linear.app/favicon.ico",
31
- featured: true
32
- },
33
- {
34
- id: "monday",
35
- name: "Monday.com",
36
- summary: "Boards, items, columns, and workspace automation.",
37
- url: "https://api.monday.com/v2",
38
- icon: "https://monday.com/favicon.ico"
39
- },
40
- {
41
- id: "anilist",
42
- name: "AniList",
43
- summary: "Anime and manga database \u2014 no auth required.",
44
- url: "https://graphql.anilist.co",
45
- icon: "https://anilist.co/img/icons/favicon-32x32.png"
46
- }
47
- ];
48
-
49
- // src/react/source-plugin.ts
50
- var importAdd = () => import("./AddGraphqlSource-3Z3DB4KQ.js");
51
- var importEdit = () => import("./EditGraphqlSource-F37RPNKV.js");
52
- var importSummary = () => import("./GraphqlSourceSummary-6EYBXVD2.js");
10
+ var importAdd = () => import("./AddGraphqlSource-PBMKSY7Y.js");
11
+ var importEdit = () => import("./EditGraphqlSource-AFR4RQHY.js");
12
+ var importSummary = () => import("./GraphqlSourceSummary-MY4AW37M.js");
53
13
  var graphqlSourcePlugin = {
54
14
  key: "graphql",
55
15
  label: "GraphQL",
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/react/plugin-client.tsx","../src/react/source-plugin.ts","../src/sdk/presets.ts"],"sourcesContent":["import { defineClientPlugin } from \"@executor-js/sdk/client\";\n\nimport { graphqlSourcePlugin } from \"./source-plugin\";\n\nexport default defineClientPlugin({\n id: \"graphql\" as const,\n sourcePlugin: graphqlSourcePlugin,\n});\n","import { lazy } from \"react\";\nimport type { SourcePlugin } from \"@executor-js/sdk/client\";\nimport { graphqlPresets } from \"../sdk/presets\";\n\nconst importAdd = () => import(\"./AddGraphqlSource\");\nconst importEdit = () => import(\"./EditGraphqlSource\");\nconst importSummary = () => import(\"./GraphqlSourceSummary\");\n\nexport const graphqlSourcePlugin: SourcePlugin = {\n key: \"graphql\",\n label: \"GraphQL\",\n add: lazy(importAdd),\n edit: lazy(importEdit),\n summary: lazy(importSummary),\n presets: graphqlPresets,\n preload: () => {\n void importAdd();\n void importEdit();\n void importSummary();\n },\n};\n","export interface GraphqlPreset {\n readonly id: string;\n readonly name: string;\n readonly summary: string;\n readonly url: string;\n readonly icon?: string;\n readonly featured?: boolean;\n}\n\nexport const graphqlPresets: readonly GraphqlPreset[] = [\n {\n id: \"github-graphql\",\n name: \"GitHub GraphQL\",\n summary: \"Repos, issues, PRs, and users via GitHub's GraphQL API.\",\n url: \"https://api.github.com/graphql\",\n icon: \"https://github.com/favicon.ico\",\n featured: true,\n },\n {\n id: \"gitlab\",\n name: \"GitLab\",\n summary: \"Projects, merge requests, pipelines, and users.\",\n url: \"https://gitlab.com/api/graphql\",\n icon: \"https://gitlab.com/favicon.ico\",\n featured: true,\n },\n {\n id: \"linear\",\n name: \"Linear\",\n summary: \"Issues, projects, teams, and cycles.\",\n url: \"https://api.linear.app/graphql\",\n icon: \"https://linear.app/favicon.ico\",\n featured: true,\n },\n {\n id: \"monday\",\n name: \"Monday.com\",\n summary: \"Boards, items, columns, and workspace automation.\",\n url: \"https://api.monday.com/v2\",\n icon: \"https://monday.com/favicon.ico\",\n },\n {\n id: \"anilist\",\n name: \"AniList\",\n summary: \"Anime and manga database — no auth required.\",\n url: \"https://graphql.anilist.co\",\n icon: \"https://anilist.co/img/icons/favicon-32x32.png\",\n },\n];\n"],"mappings":";AAAA,SAAS,0BAA0B;;;ACAnC,SAAS,YAAY;;;ACSd,IAAM,iBAA2C;AAAA,EACtD;AAAA,IACE,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,SAAS;AAAA,IACT,KAAK;AAAA,IACL,MAAM;AAAA,IACN,UAAU;AAAA,EACZ;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,SAAS;AAAA,IACT,KAAK;AAAA,IACL,MAAM;AAAA,IACN,UAAU;AAAA,EACZ;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,SAAS;AAAA,IACT,KAAK;AAAA,IACL,MAAM;AAAA,IACN,UAAU;AAAA,EACZ;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,SAAS;AAAA,IACT,KAAK;AAAA,IACL,MAAM;AAAA,EACR;AAAA,EACA;AAAA,IACE,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,SAAS;AAAA,IACT,KAAK;AAAA,IACL,MAAM;AAAA,EACR;AACF;;;AD5CA,IAAM,YAAY,MAAM,OAAO,gCAAoB;AACnD,IAAM,aAAa,MAAM,OAAO,iCAAqB;AACrD,IAAM,gBAAgB,MAAM,OAAO,oCAAwB;AAEpD,IAAM,sBAAoC;AAAA,EAC/C,KAAK;AAAA,EACL,OAAO;AAAA,EACP,KAAK,KAAK,SAAS;AAAA,EACnB,MAAM,KAAK,UAAU;AAAA,EACrB,SAAS,KAAK,aAAa;AAAA,EAC3B,SAAS;AAAA,EACT,SAAS,MAAM;AACb,SAAK,UAAU;AACf,SAAK,WAAW;AAChB,SAAK,cAAc;AAAA,EACrB;AACF;;;ADhBA,IAAO,wBAAQ,mBAAmB;AAAA,EAChC,IAAI;AAAA,EACJ,cAAc;AAChB,CAAC;","names":[]}
1
+ {"version":3,"sources":["../src/react/plugin-client.tsx","../src/react/source-plugin.ts"],"sourcesContent":["import { defineClientPlugin } from \"@executor-js/sdk/client\";\n\nimport { graphqlSourcePlugin } from \"./source-plugin\";\n\nexport default defineClientPlugin({\n id: \"graphql\" as const,\n sourcePlugin: graphqlSourcePlugin,\n});\n","import { lazy } from \"react\";\nimport type { SourcePlugin } from \"@executor-js/sdk/client\";\nimport { graphqlPresets } from \"../sdk/presets\";\n\nconst importAdd = () => import(\"./AddGraphqlSource\");\nconst importEdit = () => import(\"./EditGraphqlSource\");\nconst importSummary = () => import(\"./GraphqlSourceSummary\");\n\nexport const graphqlSourcePlugin: SourcePlugin = {\n key: \"graphql\",\n label: \"GraphQL\",\n add: lazy(importAdd),\n edit: lazy(importEdit),\n summary: lazy(importSummary),\n presets: graphqlPresets,\n preload: () => {\n void importAdd();\n void importEdit();\n void importSummary();\n },\n};\n"],"mappings":";;;;;AAAA,SAAS,0BAA0B;;;ACAnC,SAAS,YAAY;AAIrB,IAAM,YAAY,MAAM,OAAO,gCAAoB;AACnD,IAAM,aAAa,MAAM,OAAO,iCAAqB;AACrD,IAAM,gBAAgB,MAAM,OAAO,oCAAwB;AAEpD,IAAM,sBAAoC;AAAA,EAC/C,KAAK;AAAA,EACL,OAAO;AAAA,EACP,KAAK,KAAK,SAAS;AAAA,EACnB,MAAM,KAAK,UAAU;AAAA,EACrB,SAAS,KAAK,aAAa;AAAA,EAC3B,SAAS;AAAA,EACT,SAAS,MAAM;AACb,SAAK,UAAU;AACf,SAAK,WAAW;AAChB,SAAK,cAAc;AAAA,EACrB;AACF;;;ADhBA,IAAO,wBAAQ,mBAAmB;AAAA,EAChC,IAAI;AAAA,EACJ,cAAc;AAChB,CAAC;","names":[]}
package/dist/core.js CHANGED
@@ -8,7 +8,8 @@ import {
8
8
  makeDefaultGraphqlStore,
9
9
  parseIntrospectionJson,
10
10
  resolveHeaders
11
- } from "./chunk-PO2TPM5B.js";
11
+ } from "./chunk-7S2FM3ZF.js";
12
+ import "./chunk-D6E4WAYW.js";
12
13
  import {
13
14
  ConfiguredGraphqlCredentialValue,
14
15
  ExtractedField,
@@ -22,9 +23,6 @@ import {
22
23
  GraphqlOperationKind,
23
24
  GraphqlSourceAuth,
24
25
  GraphqlSourceAuthInput,
25
- GraphqlSourceBindingInput,
26
- GraphqlSourceBindingRef,
27
- GraphqlSourceBindingValue,
28
26
  HeaderValue,
29
27
  InvocationConfig,
30
28
  InvocationResult,
@@ -32,7 +30,7 @@ import {
32
30
  QueryParamValue,
33
31
  graphqlHeaderSlot,
34
32
  graphqlQueryParamSlot
35
- } from "./chunk-445ZPXHU.js";
33
+ } from "./chunk-H422YIM4.js";
36
34
  export {
37
35
  ConfiguredGraphqlCredentialValue,
38
36
  ExtractedField,
@@ -46,9 +44,6 @@ export {
46
44
  GraphqlOperationKind,
47
45
  GraphqlSourceAuth,
48
46
  GraphqlSourceAuthInput,
49
- GraphqlSourceBindingInput,
50
- GraphqlSourceBindingRef,
51
- GraphqlSourceBindingValue,
52
47
  HeaderValue,
53
48
  InvocationConfig,
54
49
  InvocationResult,
package/dist/index.js CHANGED
@@ -1,7 +1,8 @@
1
1
  import {
2
2
  graphqlPlugin
3
- } from "./chunk-PO2TPM5B.js";
4
- import "./chunk-445ZPXHU.js";
3
+ } from "./chunk-7S2FM3ZF.js";
4
+ import "./chunk-D6E4WAYW.js";
5
+ import "./chunk-H422YIM4.js";
5
6
  export {
6
7
  graphqlPlugin
7
8
  };
@@ -1,11 +1,11 @@
1
- import type { ScopeId } from "@executor-js/sdk/core";
1
+ import type { ScopeId } from "@executor-js/sdk/shared";
2
2
  import * as Atom from "effect/unstable/reactivity/Atom";
3
3
  import * as AsyncResult from "effect/unstable/reactivity/AsyncResult";
4
4
  export declare const graphqlSourceAtom: (scopeId: ScopeId, namespace: string) => Atom.Atom<AsyncResult.AsyncResult<{
5
5
  readonly name: string;
6
6
  readonly scope: string & import("effect/Brand").Brand<"ScopeId">;
7
- readonly endpoint: string;
8
7
  readonly namespace: string;
8
+ readonly endpoint: string;
9
9
  readonly headers: {
10
10
  readonly [x: string]: string | {
11
11
  readonly kind: "binding";
@@ -26,8 +26,10 @@ export declare const graphqlSourceAtom: (scopeId: ScopeId, namespace: string) =>
26
26
  readonly kind: "oauth2";
27
27
  readonly connectionSlot: string;
28
28
  };
29
- } | null, import("@executor-js/api").InternalError | import("../sdk").GraphqlIntrospectionError | import("../sdk").GraphqlExtractionError>>;
29
+ } | null, import("@executor-js/sdk").InternalError | import("../sdk").GraphqlIntrospectionError | import("../sdk").GraphqlExtractionError>>;
30
30
  export declare const graphqlSourceBindingsAtom: (scopeId: ScopeId, namespace: string, sourceScopeId: ScopeId) => Atom.Atom<AsyncResult.AsyncResult<readonly {
31
+ readonly pluginId: string;
32
+ readonly sourceId: string;
31
33
  readonly value: {
32
34
  readonly text: string;
33
35
  readonly kind: "text";
@@ -39,236 +41,194 @@ export declare const graphqlSourceBindingsAtom: (scopeId: ScopeId, namespace: st
39
41
  readonly connectionId: string & import("effect/Brand").Brand<"ConnectionId">;
40
42
  readonly kind: "connection";
41
43
  };
42
- readonly createdAt: Date;
43
- readonly sourceId: string;
44
+ readonly id: string & import("effect/Brand").Brand<"CredentialBindingId">;
44
45
  readonly scopeId: string & import("effect/Brand").Brand<"ScopeId">;
46
+ readonly createdAt: Date;
45
47
  readonly updatedAt: Date;
46
- readonly slot: string;
47
48
  readonly sourceScopeId: string & import("effect/Brand").Brand<"ScopeId">;
48
- }[], import("@executor-js/api").InternalError | import("../sdk").GraphqlIntrospectionError | import("../sdk").GraphqlExtractionError>>;
49
+ readonly slotKey: string;
50
+ }[], import("@executor-js/sdk").InternalError>>;
49
51
  export declare const addGraphqlSource: Atom.AtomResultFn<{
50
52
  readonly params: {
51
53
  readonly scopeId: string & import("effect/Brand").Brand<"ScopeId">;
52
54
  };
53
55
  readonly payload: {
56
+ readonly name: string;
57
+ readonly namespace: string;
54
58
  readonly endpoint: string;
55
- readonly targetScope: string & import("effect/Brand").Brand<"ScopeId">;
56
- readonly name?: string | undefined;
57
- readonly namespace?: string | undefined;
59
+ readonly oauth2?: {
60
+ readonly kind: "oauth2";
61
+ readonly scopes: readonly string[];
62
+ readonly clientSecretSlot: string | null;
63
+ readonly securitySchemeName: string;
64
+ readonly flow: "authorizationCode" | "clientCredentials";
65
+ readonly tokenUrl: string;
66
+ readonly clientIdSlot: string;
67
+ readonly connectionSlot: string;
68
+ readonly issuerUrl?: string | null | undefined;
69
+ readonly authorizationUrl?: string | null | undefined;
70
+ } | undefined;
58
71
  readonly headers?: {
59
72
  readonly [x: string]: string | {
60
- readonly secretId: string;
61
- readonly prefix?: string | undefined;
62
- } | {
63
- readonly kind: "binding";
64
- readonly slot: string;
65
- readonly prefix?: string | undefined;
66
- } | {
67
- readonly secretId: string;
68
- readonly targetScope: string & import("effect/Brand").Brand<"ScopeId">;
73
+ readonly kind: "secret";
69
74
  readonly prefix?: string | undefined;
70
- readonly secretScopeId?: (string & import("effect/Brand").Brand<"ScopeId">) | undefined;
71
75
  };
72
76
  } | undefined;
73
77
  readonly queryParams?: {
74
78
  readonly [x: string]: string | {
75
- readonly secretId: string;
76
- readonly prefix?: string | undefined;
77
- } | {
78
- readonly kind: "binding";
79
- readonly slot: string;
79
+ readonly kind: "secret";
80
80
  readonly prefix?: string | undefined;
81
- } | {
82
- readonly secretId: string;
83
- readonly targetScope: string & import("effect/Brand").Brand<"ScopeId">;
84
- readonly prefix?: string | undefined;
85
- readonly secretScopeId?: (string & import("effect/Brand").Brand<"ScopeId">) | undefined;
86
81
  };
87
82
  } | undefined;
88
- readonly auth?: {
89
- readonly kind: "none";
90
- } | {
91
- readonly kind: "oauth2";
92
- readonly connectionSlot: string;
93
- } | {
94
- readonly connectionId: string;
95
- readonly kind: "oauth2";
96
- } | undefined;
97
83
  readonly introspectionJson?: string | undefined;
98
- readonly credentialTargetScope?: (string & import("effect/Brand").Brand<"ScopeId">) | undefined;
84
+ readonly credentials?: {
85
+ readonly scope: string & import("effect/Brand").Brand<"ScopeId">;
86
+ readonly headers?: {
87
+ readonly [x: string]: string | {
88
+ readonly text: string;
89
+ readonly kind: "text";
90
+ readonly prefix?: string | undefined;
91
+ } | {
92
+ readonly secretId: string;
93
+ readonly kind: "secret";
94
+ readonly prefix?: string | undefined;
95
+ readonly secretScope?: string | undefined;
96
+ } | {
97
+ readonly connectionId: string;
98
+ readonly kind: "connection";
99
+ };
100
+ } | undefined;
101
+ readonly queryParams?: {
102
+ readonly [x: string]: string | {
103
+ readonly text: string;
104
+ readonly kind: "text";
105
+ readonly prefix?: string | undefined;
106
+ } | {
107
+ readonly secretId: string;
108
+ readonly kind: "secret";
109
+ readonly prefix?: string | undefined;
110
+ readonly secretScope?: string | undefined;
111
+ } | {
112
+ readonly connectionId: string;
113
+ readonly kind: "connection";
114
+ };
115
+ } | undefined;
116
+ readonly auth?: {
117
+ readonly kind: "none";
118
+ } | {
119
+ readonly oauth2?: {
120
+ readonly connection?: string | {
121
+ readonly text: string;
122
+ readonly kind: "text";
123
+ readonly prefix?: string | undefined;
124
+ } | {
125
+ readonly secretId: string;
126
+ readonly kind: "secret";
127
+ readonly prefix?: string | undefined;
128
+ readonly secretScope?: string | undefined;
129
+ } | {
130
+ readonly connectionId: string;
131
+ readonly kind: "connection";
132
+ } | undefined;
133
+ } | undefined;
134
+ } | undefined;
135
+ } | undefined;
99
136
  };
100
137
  readonly responseMode?: "decoded-only" | undefined;
101
138
  readonly reactivityKeys?: readonly unknown[] | import("effect/Record").ReadonlyRecord<string, readonly unknown[]> | undefined;
102
139
  }, {
103
140
  readonly namespace: string;
104
141
  readonly toolCount: number;
105
- }, import("@executor-js/api").InternalError | import("../sdk").GraphqlIntrospectionError | import("../sdk").GraphqlExtractionError>;
142
+ }, import("@executor-js/sdk").InternalError | import("../sdk").GraphqlIntrospectionError | import("../sdk").GraphqlExtractionError>;
106
143
  export declare const addGraphqlSourceOptimistic: (arg: string & import("effect/Brand").Brand<"ScopeId">) => Atom.AtomResultFn<{
107
144
  readonly params: {
108
145
  readonly scopeId: string & import("effect/Brand").Brand<"ScopeId">;
109
146
  };
110
147
  readonly payload: {
148
+ readonly name: string;
149
+ readonly namespace: string;
111
150
  readonly endpoint: string;
112
- readonly targetScope: string & import("effect/Brand").Brand<"ScopeId">;
113
- readonly name?: string | undefined;
114
- readonly namespace?: string | undefined;
115
- readonly headers?: {
116
- readonly [x: string]: string | {
117
- readonly secretId: string;
118
- readonly prefix?: string | undefined;
119
- } | {
120
- readonly kind: "binding";
121
- readonly slot: string;
122
- readonly prefix?: string | undefined;
123
- } | {
124
- readonly secretId: string;
125
- readonly targetScope: string & import("effect/Brand").Brand<"ScopeId">;
126
- readonly prefix?: string | undefined;
127
- readonly secretScopeId?: (string & import("effect/Brand").Brand<"ScopeId">) | undefined;
128
- };
129
- } | undefined;
130
- readonly queryParams?: {
131
- readonly [x: string]: string | {
132
- readonly secretId: string;
133
- readonly prefix?: string | undefined;
134
- } | {
135
- readonly kind: "binding";
136
- readonly slot: string;
137
- readonly prefix?: string | undefined;
138
- } | {
139
- readonly secretId: string;
140
- readonly targetScope: string & import("effect/Brand").Brand<"ScopeId">;
141
- readonly prefix?: string | undefined;
142
- readonly secretScopeId?: (string & import("effect/Brand").Brand<"ScopeId">) | undefined;
143
- };
144
- } | undefined;
145
- readonly auth?: {
146
- readonly kind: "none";
147
- } | {
151
+ readonly oauth2?: {
148
152
  readonly kind: "oauth2";
153
+ readonly scopes: readonly string[];
154
+ readonly clientSecretSlot: string | null;
155
+ readonly securitySchemeName: string;
156
+ readonly flow: "authorizationCode" | "clientCredentials";
157
+ readonly tokenUrl: string;
158
+ readonly clientIdSlot: string;
149
159
  readonly connectionSlot: string;
150
- } | {
151
- readonly connectionId: string;
152
- readonly kind: "oauth2";
160
+ readonly issuerUrl?: string | null | undefined;
161
+ readonly authorizationUrl?: string | null | undefined;
153
162
  } | undefined;
154
- readonly introspectionJson?: string | undefined;
155
- readonly credentialTargetScope?: (string & import("effect/Brand").Brand<"ScopeId">) | undefined;
156
- };
157
- readonly responseMode?: "decoded-only" | undefined;
158
- readonly reactivityKeys?: readonly unknown[] | import("effect/Record").ReadonlyRecord<string, readonly unknown[]> | undefined;
159
- }, {
160
- readonly namespace: string;
161
- readonly toolCount: number;
162
- }, import("@executor-js/api").InternalError | import("../sdk").GraphqlIntrospectionError | import("../sdk").GraphqlExtractionError>;
163
- export declare const updateGraphqlSource: Atom.AtomResultFn<{
164
- readonly params: {
165
- readonly namespace: string;
166
- readonly scopeId: string & import("effect/Brand").Brand<"ScopeId">;
167
- };
168
- readonly payload: {
169
- readonly sourceScope: string & import("effect/Brand").Brand<"ScopeId">;
170
- readonly name?: string | undefined;
171
- readonly endpoint?: string | undefined;
172
163
  readonly headers?: {
173
164
  readonly [x: string]: string | {
174
- readonly secretId: string;
165
+ readonly kind: "secret";
175
166
  readonly prefix?: string | undefined;
176
- } | {
177
- readonly kind: "binding";
178
- readonly slot: string;
179
- readonly prefix?: string | undefined;
180
- } | {
181
- readonly secretId: string;
182
- readonly targetScope: string & import("effect/Brand").Brand<"ScopeId">;
183
- readonly prefix?: string | undefined;
184
- readonly secretScopeId?: (string & import("effect/Brand").Brand<"ScopeId">) | undefined;
185
167
  };
186
168
  } | undefined;
187
169
  readonly queryParams?: {
188
170
  readonly [x: string]: string | {
189
- readonly secretId: string;
190
- readonly prefix?: string | undefined;
191
- } | {
192
- readonly kind: "binding";
193
- readonly slot: string;
171
+ readonly kind: "secret";
194
172
  readonly prefix?: string | undefined;
195
- } | {
196
- readonly secretId: string;
197
- readonly targetScope: string & import("effect/Brand").Brand<"ScopeId">;
198
- readonly prefix?: string | undefined;
199
- readonly secretScopeId?: (string & import("effect/Brand").Brand<"ScopeId">) | undefined;
200
173
  };
201
174
  } | undefined;
202
- readonly auth?: {
203
- readonly kind: "none";
204
- } | {
205
- readonly kind: "oauth2";
206
- readonly connectionSlot: string;
207
- } | {
208
- readonly connectionId: string;
209
- readonly kind: "oauth2";
175
+ readonly introspectionJson?: string | undefined;
176
+ readonly credentials?: {
177
+ readonly scope: string & import("effect/Brand").Brand<"ScopeId">;
178
+ readonly headers?: {
179
+ readonly [x: string]: string | {
180
+ readonly text: string;
181
+ readonly kind: "text";
182
+ readonly prefix?: string | undefined;
183
+ } | {
184
+ readonly secretId: string;
185
+ readonly kind: "secret";
186
+ readonly prefix?: string | undefined;
187
+ readonly secretScope?: string | undefined;
188
+ } | {
189
+ readonly connectionId: string;
190
+ readonly kind: "connection";
191
+ };
192
+ } | undefined;
193
+ readonly queryParams?: {
194
+ readonly [x: string]: string | {
195
+ readonly text: string;
196
+ readonly kind: "text";
197
+ readonly prefix?: string | undefined;
198
+ } | {
199
+ readonly secretId: string;
200
+ readonly kind: "secret";
201
+ readonly prefix?: string | undefined;
202
+ readonly secretScope?: string | undefined;
203
+ } | {
204
+ readonly connectionId: string;
205
+ readonly kind: "connection";
206
+ };
207
+ } | undefined;
208
+ readonly auth?: {
209
+ readonly kind: "none";
210
+ } | {
211
+ readonly oauth2?: {
212
+ readonly connection?: string | {
213
+ readonly text: string;
214
+ readonly kind: "text";
215
+ readonly prefix?: string | undefined;
216
+ } | {
217
+ readonly secretId: string;
218
+ readonly kind: "secret";
219
+ readonly prefix?: string | undefined;
220
+ readonly secretScope?: string | undefined;
221
+ } | {
222
+ readonly connectionId: string;
223
+ readonly kind: "connection";
224
+ } | undefined;
225
+ } | undefined;
226
+ } | undefined;
210
227
  } | undefined;
211
- readonly credentialTargetScope?: (string & import("effect/Brand").Brand<"ScopeId">) | undefined;
212
- };
213
- readonly responseMode?: "decoded-only" | undefined;
214
- readonly reactivityKeys?: readonly unknown[] | import("effect/Record").ReadonlyRecord<string, readonly unknown[]> | undefined;
215
- }, {
216
- readonly updated: boolean;
217
- }, import("@executor-js/api").InternalError | import("../sdk").GraphqlIntrospectionError | import("../sdk").GraphqlExtractionError>;
218
- export declare const setGraphqlSourceBinding: Atom.AtomResultFn<{
219
- readonly params: {
220
- readonly scopeId: string & import("effect/Brand").Brand<"ScopeId">;
221
- };
222
- readonly payload: {
223
- readonly value: {
224
- readonly text: string;
225
- readonly kind: "text";
226
- } | {
227
- readonly secretId: string & import("effect/Brand").Brand<"SecretId">;
228
- readonly kind: "secret";
229
- readonly secretScopeId?: (string & import("effect/Brand").Brand<"ScopeId">) | undefined;
230
- } | {
231
- readonly connectionId: string & import("effect/Brand").Brand<"ConnectionId">;
232
- readonly kind: "connection";
233
- };
234
- readonly sourceId: string;
235
- readonly scope: string & import("effect/Brand").Brand<"ScopeId">;
236
- readonly slot: string;
237
- readonly sourceScope: string & import("effect/Brand").Brand<"ScopeId">;
238
228
  };
239
229
  readonly responseMode?: "decoded-only" | undefined;
240
230
  readonly reactivityKeys?: readonly unknown[] | import("effect/Record").ReadonlyRecord<string, readonly unknown[]> | undefined;
241
231
  }, {
242
- readonly value: {
243
- readonly text: string;
244
- readonly kind: "text";
245
- } | {
246
- readonly secretId: string & import("effect/Brand").Brand<"SecretId">;
247
- readonly kind: "secret";
248
- readonly secretScopeId?: (string & import("effect/Brand").Brand<"ScopeId">) | undefined;
249
- } | {
250
- readonly connectionId: string & import("effect/Brand").Brand<"ConnectionId">;
251
- readonly kind: "connection";
252
- };
253
- readonly createdAt: Date;
254
- readonly sourceId: string;
255
- readonly scopeId: string & import("effect/Brand").Brand<"ScopeId">;
256
- readonly updatedAt: Date;
257
- readonly slot: string;
258
- readonly sourceScopeId: string & import("effect/Brand").Brand<"ScopeId">;
259
- }, import("@executor-js/api").InternalError | import("../sdk").GraphqlIntrospectionError | import("../sdk").GraphqlExtractionError>;
260
- export declare const removeGraphqlSourceBinding: Atom.AtomResultFn<{
261
- readonly params: {
262
- readonly scopeId: string & import("effect/Brand").Brand<"ScopeId">;
263
- };
264
- readonly payload: {
265
- readonly sourceId: string;
266
- readonly scope: string & import("effect/Brand").Brand<"ScopeId">;
267
- readonly slot: string;
268
- readonly sourceScope: string & import("effect/Brand").Brand<"ScopeId">;
269
- };
270
- readonly responseMode?: "decoded-only" | undefined;
271
- readonly reactivityKeys?: readonly unknown[] | import("effect/Record").ReadonlyRecord<string, readonly unknown[]> | undefined;
272
- }, {
273
- readonly removed: boolean;
274
- }, import("@executor-js/api").InternalError | import("../sdk").GraphqlIntrospectionError | import("../sdk").GraphqlExtractionError>;
232
+ readonly namespace: string;
233
+ readonly toolCount: number;
234
+ }, import("@executor-js/sdk").InternalError | import("../sdk").GraphqlIntrospectionError | import("../sdk").GraphqlExtractionError>;