@burdenoff/microfe-integrations 2026.801.1 → 2026.807.1
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/generated/wspace-operations.d.ts +351 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -1
- package/dist/generated/wspace-operations.js +131 -71
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +70519 -34096
- package/dist/generated/wspace-types.d.ts.map +1 -1
- package/dist/integrations/components/AddConnectionDialog.d.ts.map +1 -1
- package/dist/integrations/components/AddConnectionDialog.js +238 -484
- package/dist/integrations/components/AddConnectionDialog.js.map +1 -1
- package/dist/integrations/components/AuthMethodSelector.d.ts +13 -0
- package/dist/integrations/components/AuthMethodSelector.d.ts.map +1 -0
- package/dist/integrations/components/AuthMethodSelector.js +48 -0
- package/dist/integrations/components/AuthMethodSelector.js.map +1 -0
- package/dist/integrations/components/AuthMethodsEditor.d.ts +10 -0
- package/dist/integrations/components/AuthMethodsEditor.d.ts.map +1 -0
- package/dist/integrations/components/AuthMethodsEditor.js +388 -0
- package/dist/integrations/components/AuthMethodsEditor.js.map +1 -0
- package/dist/integrations/components/ProviderIcon.d.ts +5 -4
- package/dist/integrations/components/ProviderIcon.d.ts.map +1 -1
- package/dist/integrations/components/ProviderIcon.js +18 -14
- package/dist/integrations/components/ProviderIcon.js.map +1 -1
- package/dist/integrations/components/SchemaForm.d.ts +43 -0
- package/dist/integrations/components/SchemaForm.d.ts.map +1 -0
- package/dist/integrations/components/SchemaForm.js +170 -0
- package/dist/integrations/components/SchemaForm.js.map +1 -0
- package/dist/integrations/hooks/useConnections.d.ts +12 -0
- package/dist/integrations/hooks/useConnections.d.ts.map +1 -1
- package/dist/integrations/hooks/useConnections.js +63 -52
- package/dist/integrations/hooks/useConnections.js.map +1 -1
- package/dist/integrations/hooks/useProviders.d.ts +27 -0
- package/dist/integrations/hooks/useProviders.d.ts.map +1 -1
- package/dist/integrations/hooks/useProviders.js +49 -33
- package/dist/integrations/hooks/useProviders.js.map +1 -1
- package/dist/integrations/pages/ConnectionsList.js +7 -7
- package/dist/integrations/pages/ProviderCatalog.js +10 -10
- package/dist/integrations/pages/ProviderCatalog.js.map +1 -1
- package/dist/integrations/pages/ProviderEditorPage.d.ts.map +1 -1
- package/dist/integrations/pages/ProviderEditorPage.js +326 -315
- package/dist/integrations/pages/ProviderEditorPage.js.map +1 -1
- package/dist/integrations/types/index.d.ts +24 -0
- package/dist/integrations/types/index.d.ts.map +1 -1
- package/dist/integrations/utils/constants.d.ts +12 -13
- package/dist/integrations/utils/constants.d.ts.map +1 -1
- package/dist/integrations/utils/constants.js +1 -18
- package/dist/integrations/utils/constants.js.map +1 -1
- package/dist/integrations/utils/integrationsHelpers.d.ts +7 -0
- package/dist/integrations/utils/integrationsHelpers.d.ts.map +1 -1
- package/dist/integrations/utils/integrationsHelpers.js +4 -1
- package/dist/integrations/utils/integrationsHelpers.js.map +1 -1
- package/dist/integrations/utils/mappers.d.ts +0 -3
- package/dist/integrations/utils/mappers.d.ts.map +1 -1
- package/dist/integrations/utils/mappers.js +24 -4
- package/dist/integrations/utils/mappers.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { useState as e } from "react";
|
|
2
|
+
import { Eye as t, EyeOff as n, Info as r } from "lucide-react";
|
|
3
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
4
|
+
//#region src/integrations/components/SchemaForm.tsx
|
|
5
|
+
function o(e) {
|
|
6
|
+
if (typeof e != "object" || !e || Array.isArray(e)) return null;
|
|
7
|
+
let t = e;
|
|
8
|
+
return typeof t.properties != "object" || t.properties === null ? null : {
|
|
9
|
+
properties: t.properties,
|
|
10
|
+
required: Array.isArray(t.required) ? t.required.filter((e) => typeof e == "string") : []
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function s(e, t) {
|
|
14
|
+
return e.showIf ? Object.entries(e.showIf).every(([e, n]) => {
|
|
15
|
+
let r = t[e];
|
|
16
|
+
return Array.isArray(n) ? n.includes(r) : r === n;
|
|
17
|
+
}) : !0;
|
|
18
|
+
}
|
|
19
|
+
function c(e, t) {
|
|
20
|
+
return e.required.every((n) => {
|
|
21
|
+
let r = e.properties[n];
|
|
22
|
+
if (r && !s(r, t)) return !0;
|
|
23
|
+
let i = t[n];
|
|
24
|
+
return typeof i == "string" ? i.trim().length > 0 : i != null;
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function l(e) {
|
|
28
|
+
return e.map((e) => typeof e == "string" ? {
|
|
29
|
+
label: e,
|
|
30
|
+
value: e
|
|
31
|
+
} : e);
|
|
32
|
+
}
|
|
33
|
+
var u = ({ schema: e, values: t, onChange: n, disabled: r, idPrefix: a = "schema" }) => {
|
|
34
|
+
let o = new Set(e.required);
|
|
35
|
+
return /* @__PURE__ */ i("div", {
|
|
36
|
+
className: "space-y-3",
|
|
37
|
+
children: Object.entries(e.properties).filter(([, e]) => s(e, t)).map(([e, s]) => /* @__PURE__ */ i(d, {
|
|
38
|
+
id: `${a}-${e}`,
|
|
39
|
+
name: e,
|
|
40
|
+
property: s,
|
|
41
|
+
value: t[e],
|
|
42
|
+
required: o.has(e),
|
|
43
|
+
disabled: r,
|
|
44
|
+
onChange: (r) => n({
|
|
45
|
+
...t,
|
|
46
|
+
[e]: r
|
|
47
|
+
})
|
|
48
|
+
}, e))
|
|
49
|
+
});
|
|
50
|
+
}, d = ({ id: o, name: s, property: c, value: u, required: d, disabled: f, onChange: p }) => {
|
|
51
|
+
let [m, h] = e(!1), g = c.title ?? s, _ = c.placeholder ?? c.description ?? "";
|
|
52
|
+
if (c.type === "notice") return /* @__PURE__ */ a("div", {
|
|
53
|
+
className: "flex items-start gap-2 px-3 py-2 rounded-md bg-status-info-bg-subtle border border-border-default",
|
|
54
|
+
children: [/* @__PURE__ */ i(r, {
|
|
55
|
+
size: 14,
|
|
56
|
+
className: "text-status-info-text flex-shrink-0 mt-0.5"
|
|
57
|
+
}), /* @__PURE__ */ i("span", {
|
|
58
|
+
className: "text-xs text-status-info-text",
|
|
59
|
+
children: c.description ?? g
|
|
60
|
+
})]
|
|
61
|
+
});
|
|
62
|
+
let v = c.description ? /* @__PURE__ */ i("p", {
|
|
63
|
+
className: "mt-1 text-xs text-text-secondary",
|
|
64
|
+
children: c.description
|
|
65
|
+
}) : null, y = /* @__PURE__ */ a("label", {
|
|
66
|
+
htmlFor: o,
|
|
67
|
+
className: "block text-sm font-medium text-text-primary mb-1.5",
|
|
68
|
+
children: [
|
|
69
|
+
g,
|
|
70
|
+
" ",
|
|
71
|
+
d && /* @__PURE__ */ i("span", {
|
|
72
|
+
className: "text-status-error-text",
|
|
73
|
+
children: "*"
|
|
74
|
+
})
|
|
75
|
+
]
|
|
76
|
+
}), b = "w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50";
|
|
77
|
+
return c.type === "boolean" ? /* @__PURE__ */ a("div", {
|
|
78
|
+
className: "flex items-center gap-3",
|
|
79
|
+
children: [/* @__PURE__ */ i("button", {
|
|
80
|
+
type: "button",
|
|
81
|
+
role: "switch",
|
|
82
|
+
id: o,
|
|
83
|
+
"aria-checked": !!(u ?? c.default ?? !1),
|
|
84
|
+
"aria-label": g,
|
|
85
|
+
onClick: () => p(!u),
|
|
86
|
+
disabled: f,
|
|
87
|
+
className: `relative inline-flex h-5 w-9 items-center rounded-full transition-colors disabled:opacity-50 ${u ? "bg-primary" : "bg-bg-muted"}`,
|
|
88
|
+
children: /* @__PURE__ */ i("span", { className: `inline-block h-3.5 w-3.5 transform rounded-full bg-white transition-transform ${u ? "translate-x-4.5" : "translate-x-0.5"}` })
|
|
89
|
+
}), /* @__PURE__ */ a("span", {
|
|
90
|
+
className: "text-sm font-medium text-text-primary",
|
|
91
|
+
children: [g, c.description && /* @__PURE__ */ a("span", {
|
|
92
|
+
className: "text-text-secondary font-normal ml-1",
|
|
93
|
+
children: ["— ", c.description]
|
|
94
|
+
})]
|
|
95
|
+
})]
|
|
96
|
+
}) : c.enum && c.enum.length > 0 ? /* @__PURE__ */ a("div", { children: [
|
|
97
|
+
y,
|
|
98
|
+
/* @__PURE__ */ a("select", {
|
|
99
|
+
id: o,
|
|
100
|
+
"aria-label": g,
|
|
101
|
+
value: String(u ?? c.default ?? ""),
|
|
102
|
+
onChange: (e) => p(e.target.value),
|
|
103
|
+
disabled: f,
|
|
104
|
+
className: b,
|
|
105
|
+
children: [/* @__PURE__ */ a("option", {
|
|
106
|
+
value: "",
|
|
107
|
+
children: ["Select ", g.toLowerCase()]
|
|
108
|
+
}), l(c.enum).map((e) => /* @__PURE__ */ i("option", {
|
|
109
|
+
value: e.value,
|
|
110
|
+
children: e.label
|
|
111
|
+
}, e.value))]
|
|
112
|
+
}),
|
|
113
|
+
v
|
|
114
|
+
] }) : c.type === "number" ? /* @__PURE__ */ a("div", { children: [
|
|
115
|
+
y,
|
|
116
|
+
/* @__PURE__ */ i("input", {
|
|
117
|
+
id: o,
|
|
118
|
+
"aria-label": g,
|
|
119
|
+
type: "number",
|
|
120
|
+
value: u == null ? "" : String(u),
|
|
121
|
+
onChange: (e) => p(e.target.value === "" ? void 0 : Number(e.target.value)),
|
|
122
|
+
placeholder: _,
|
|
123
|
+
disabled: f,
|
|
124
|
+
className: b
|
|
125
|
+
}),
|
|
126
|
+
v
|
|
127
|
+
] }) : c.format === "textarea" || c.format === "json" ? /* @__PURE__ */ a("div", { children: [
|
|
128
|
+
y,
|
|
129
|
+
/* @__PURE__ */ i("textarea", {
|
|
130
|
+
id: o,
|
|
131
|
+
"aria-label": g,
|
|
132
|
+
value: String(u ?? ""),
|
|
133
|
+
onChange: (e) => p(e.target.value),
|
|
134
|
+
placeholder: _,
|
|
135
|
+
disabled: f,
|
|
136
|
+
rows: 5,
|
|
137
|
+
autoComplete: "off",
|
|
138
|
+
spellCheck: !1,
|
|
139
|
+
className: `${b} font-mono`
|
|
140
|
+
}),
|
|
141
|
+
v
|
|
142
|
+
] }) : /* @__PURE__ */ a("div", { children: [
|
|
143
|
+
y,
|
|
144
|
+
/* @__PURE__ */ a("div", {
|
|
145
|
+
className: "relative",
|
|
146
|
+
children: [/* @__PURE__ */ i("input", {
|
|
147
|
+
id: o,
|
|
148
|
+
"aria-label": g,
|
|
149
|
+
type: c.secret && !m ? "password" : "text",
|
|
150
|
+
value: String(u ?? ""),
|
|
151
|
+
onChange: (e) => p(e.target.value),
|
|
152
|
+
placeholder: _,
|
|
153
|
+
disabled: f,
|
|
154
|
+
autoComplete: "off",
|
|
155
|
+
className: `${b} ${c.secret ? "font-mono pr-10" : ""}`
|
|
156
|
+
}), c.secret && /* @__PURE__ */ i("button", {
|
|
157
|
+
type: "button",
|
|
158
|
+
onClick: () => h((e) => !e),
|
|
159
|
+
"aria-label": m ? `Hide ${g}` : `Show ${g}`,
|
|
160
|
+
className: "absolute right-2 top-1/2 -translate-y-1/2 text-text-secondary hover:text-text-primary",
|
|
161
|
+
children: i(m ? n : t, { size: 16 })
|
|
162
|
+
})]
|
|
163
|
+
}),
|
|
164
|
+
v
|
|
165
|
+
] });
|
|
166
|
+
};
|
|
167
|
+
//#endregion
|
|
168
|
+
export { u as SchemaForm, c as isSchemaComplete, o as parseFormSchema };
|
|
169
|
+
|
|
170
|
+
//# sourceMappingURL=SchemaForm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SchemaForm.js","names":[],"sources":["../../../src/integrations/components/SchemaForm.tsx"],"sourcesContent":["/**\n * SchemaForm — renders a credential form from a JSON-Schema-ish description.\n *\n * The whole point of this component is that it is the *only* place credential\n * fields are drawn. A provider (or one of its auth methods) describes what it\n * needs as data, this renders it, and adding a provider or an authentication\n * method never requires new React.\n *\n * Supported per-property keys, beyond plain JSON Schema:\n * secret -> masked input with a reveal toggle\n * format -> 'textarea' | 'json' for multi-line values (service-account keys)\n * enum -> string[] or {label,value}[] for a select\n * showIf -> { field: value | value[] } conditional visibility\n * placeholder -> distinct from `description`, which renders as help text\n * type -> 'notice' renders informational copy instead of an input\n */\nimport type { FC } from 'react';\nimport { useState } from 'react';\nimport { Eye, EyeOff, Info } from 'lucide-react';\n\nexport interface SchemaProperty {\n type?: string;\n title?: string;\n description?: string;\n placeholder?: string;\n secret?: boolean;\n format?: string;\n default?: string | number | boolean;\n enum?: Array<string | { label: string; value: string }>;\n showIf?: Record<string, unknown>;\n}\n\nexport interface FormSchema {\n type?: string;\n properties: Record<string, SchemaProperty>;\n required: string[];\n}\n\n/**\n * Narrow an arbitrary JSON value to a renderable schema. Returns null when the\n * value isn't a usable object schema, so callers can fall back rather than\n * rendering an empty form.\n */\nexport function parseFormSchema(raw: unknown): FormSchema | null {\n if (typeof raw !== 'object' || raw === null || Array.isArray(raw)) return null;\n const candidate = raw as { properties?: unknown; required?: unknown };\n if (typeof candidate.properties !== 'object' || candidate.properties === null) return null;\n return {\n properties: candidate.properties as Record<string, SchemaProperty>,\n required: Array.isArray(candidate.required)\n ? candidate.required.filter((r): r is string => typeof r === 'string')\n : [],\n };\n}\n\n/**\n * Evaluate a property's `showIf`. A field is visible when every named field\n * holds one of the accepted values, so dependent fields (e.g. \"custom scopes\"\n * revealed by a toggle) need no bespoke component.\n */\nfunction isVisible(property: SchemaProperty, values: Record<string, unknown>): boolean {\n if (!property.showIf) return true;\n return Object.entries(property.showIf).every(([field, expected]) => {\n const actual = values[field];\n return Array.isArray(expected) ? expected.includes(actual) : actual === expected;\n });\n}\n\n/**\n * Required fields that are visible and filled. Hidden fields are excluded on\n * purpose — a `showIf` field the user never saw must not block submission.\n */\nexport function isSchemaComplete(schema: FormSchema, values: Record<string, unknown>): boolean {\n return schema.required.every((field) => {\n const property = schema.properties[field];\n if (property && !isVisible(property, values)) return true;\n const value = values[field];\n return typeof value === 'string'\n ? value.trim().length > 0\n : value !== undefined && value !== null;\n });\n}\n\nfunction normalizeOptions(\n options: Array<string | { label: string; value: string }>\n): Array<{ label: string; value: string }> {\n return options.map((option) =>\n typeof option === 'string' ? { label: option, value: option } : option\n );\n}\n\ninterface SchemaFormProps {\n schema: FormSchema;\n values: Record<string, unknown>;\n onChange: (values: Record<string, unknown>) => void;\n disabled?: boolean;\n /** Prefix for generated element ids so several forms can coexist on a page. */\n idPrefix?: string;\n}\n\nexport const SchemaForm: FC<SchemaFormProps> = ({\n schema,\n values,\n onChange,\n disabled,\n idPrefix = 'schema',\n}) => {\n const required = new Set(schema.required);\n\n return (\n <div className=\"space-y-3\">\n {Object.entries(schema.properties)\n .filter(([, property]) => isVisible(property, values))\n .map(([field, property]) => (\n <SchemaField\n key={field}\n id={`${idPrefix}-${field}`}\n name={field}\n property={property}\n value={values[field]}\n required={required.has(field)}\n disabled={disabled}\n onChange={(next) => onChange({ ...values, [field]: next })}\n />\n ))}\n </div>\n );\n};\n\ninterface SchemaFieldProps {\n id: string;\n name: string;\n property: SchemaProperty;\n value: unknown;\n required: boolean;\n disabled?: boolean;\n onChange: (value: unknown) => void;\n}\n\nconst SchemaField: FC<SchemaFieldProps> = ({\n id,\n name,\n property,\n value,\n required,\n disabled,\n onChange,\n}) => {\n const [revealed, setRevealed] = useState(false);\n const label = property.title ?? name;\n const placeholder = property.placeholder ?? property.description ?? '';\n\n if (property.type === 'notice') {\n return (\n <div className=\"flex items-start gap-2 px-3 py-2 rounded-md bg-status-info-bg-subtle border border-border-default\">\n <Info size={14} className=\"text-status-info-text flex-shrink-0 mt-0.5\" />\n <span className=\"text-xs text-status-info-text\">{property.description ?? label}</span>\n </div>\n );\n }\n\n const help = property.description ? (\n <p className=\"mt-1 text-xs text-text-secondary\">{property.description}</p>\n ) : null;\n\n const labelNode = (\n <label htmlFor={id} className=\"block text-sm font-medium text-text-primary mb-1.5\">\n {label} {required && <span className=\"text-status-error-text\">*</span>}\n </label>\n );\n\n const inputClass =\n 'w-full px-3 py-2 border border-border-subtle rounded-md bg-bg-surface text-sm focus:outline-none focus:ring-2 focus:ring-primary/20 focus:border-primary disabled:opacity-50';\n\n if (property.type === 'boolean') {\n return (\n <div className=\"flex items-center gap-3\">\n <button\n type=\"button\"\n role=\"switch\"\n id={id}\n aria-checked={Boolean(value ?? property.default ?? false)}\n aria-label={label}\n onClick={() => onChange(!value)}\n disabled={disabled}\n className={`relative inline-flex h-5 w-9 items-center rounded-full transition-colors disabled:opacity-50 ${\n value ? 'bg-primary' : 'bg-bg-muted'\n }`}\n >\n <span\n className={`inline-block h-3.5 w-3.5 transform rounded-full bg-white transition-transform ${\n value ? 'translate-x-4.5' : 'translate-x-0.5'\n }`}\n />\n </button>\n <span className=\"text-sm font-medium text-text-primary\">\n {label}\n {property.description && (\n <span className=\"text-text-secondary font-normal ml-1\">— {property.description}</span>\n )}\n </span>\n </div>\n );\n }\n\n if (property.enum && property.enum.length > 0) {\n return (\n <div>\n {labelNode}\n <select\n id={id}\n aria-label={label}\n value={String(value ?? property.default ?? '')}\n onChange={(event) => onChange(event.target.value)}\n disabled={disabled}\n className={inputClass}\n >\n <option value=\"\">Select {label.toLowerCase()}</option>\n {normalizeOptions(property.enum).map((option) => (\n <option key={option.value} value={option.value}>\n {option.label}\n </option>\n ))}\n </select>\n {help}\n </div>\n );\n }\n\n if (property.type === 'number') {\n return (\n <div>\n {labelNode}\n <input\n id={id}\n aria-label={label}\n type=\"number\"\n value={value === undefined || value === null ? '' : String(value)}\n onChange={(event) =>\n onChange(event.target.value === '' ? undefined : Number(event.target.value))\n }\n placeholder={placeholder}\n disabled={disabled}\n className={inputClass}\n />\n {help}\n </div>\n );\n }\n\n // Multi-line values (service-account key JSON, PEM blocks) are unusable in a\n // single-line input — the previous form made you paste a whole JSON key into\n // one, so `format` is honoured before the secret/plain split.\n const multiline = property.format === 'textarea' || property.format === 'json';\n if (multiline) {\n return (\n <div>\n {labelNode}\n <textarea\n id={id}\n aria-label={label}\n value={String(value ?? '')}\n onChange={(event) => onChange(event.target.value)}\n placeholder={placeholder}\n disabled={disabled}\n rows={5}\n autoComplete=\"off\"\n spellCheck={false}\n className={`${inputClass} font-mono`}\n />\n {help}\n </div>\n );\n }\n\n return (\n <div>\n {labelNode}\n <div className=\"relative\">\n <input\n id={id}\n aria-label={label}\n type={property.secret && !revealed ? 'password' : 'text'}\n value={String(value ?? '')}\n onChange={(event) => onChange(event.target.value)}\n placeholder={placeholder}\n disabled={disabled}\n autoComplete=\"off\"\n className={`${inputClass} ${property.secret ? 'font-mono pr-10' : ''}`}\n />\n {property.secret && (\n <button\n type=\"button\"\n onClick={() => setRevealed((previous) => !previous)}\n aria-label={revealed ? `Hide ${label}` : `Show ${label}`}\n className=\"absolute right-2 top-1/2 -translate-y-1/2 text-text-secondary hover:text-text-primary\"\n >\n {revealed ? <EyeOff size={16} /> : <Eye size={16} />}\n </button>\n )}\n </div>\n {help}\n </div>\n );\n};\n"],"mappings":";;;;AA2CA,SAAgB,EAAgB,GAAiC;AAC/D,KAAI,OAAO,KAAQ,aAAY,KAAgB,MAAM,QAAQ,EAAI,CAAE,QAAO;CAC1E,IAAM,IAAY;AAElB,QADI,OAAO,EAAU,cAAe,YAAY,EAAU,eAAe,OAAa,OAC/E;EACL,YAAY,EAAU;EACtB,UAAU,MAAM,QAAQ,EAAU,SAAS,GACvC,EAAU,SAAS,QAAQ,MAAmB,OAAO,KAAM,SAAS,GACpE,EAAE;EACP;;AAQH,SAAS,EAAU,GAA0B,GAA0C;AAErF,QADK,EAAS,SACP,OAAO,QAAQ,EAAS,OAAO,CAAC,OAAO,CAAC,GAAO,OAAc;EAClE,IAAM,IAAS,EAAO;AACtB,SAAO,MAAM,QAAQ,EAAS,GAAG,EAAS,SAAS,EAAO,GAAG,MAAW;GACxE,GAJ2B;;AAW/B,SAAgB,EAAiB,GAAoB,GAA0C;AAC7F,QAAO,EAAO,SAAS,OAAO,MAAU;EACtC,IAAM,IAAW,EAAO,WAAW;AACnC,MAAI,KAAY,CAAC,EAAU,GAAU,EAAO,CAAE,QAAO;EACrD,IAAM,IAAQ,EAAO;AACrB,SAAO,OAA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J,cAAY;GACZ,OAAO,OAAO,KAAS,GAAG;GAC1B,WAAW,MAAU,EAAS,EAAM,OAAO,MAAM;GACpC;GACH;GACV,MAAM;GACN,cAAa;GACb,YAAY;GACZ,WAAW,GAAG,EAAW;GACzB,CAAA;EACD;EACG,EAAA,CAAA,GAKR,kBAAC,OAAD,EAAA,UAAA;EACG;EACD,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,SAAD;IACM;IACJ,cAAY;IACZ,MAAM,EAAS,UAAU,CAAC,IAAW,aAAa;IAClD,OAAO,OAAO,KAAS,GAAG;IAC1B,WAAW,MAAU,EAAS,EAAM,OAAO,MAAM;IACpC;IACH;IACV,cAAa;IACb,WAAW,GAAG,EAAW,GAAG,EAAS,SAAS,oBAAoB;IAClE,CAAA,EACD,EAAS,UACR,kBAAC,UAAD;IACE,MAAK;IACL,eAAe,GAAa,MAAa,CAAC,EAAS;IACnD,cAAY,IAAW,QAAQ,MAAU,QAAQ;IACjD,WAAU;cAEE,EAAX,IAAY,IAAuB,GAAxB,EAAQ,MAAM,IAAM,CAAoB;IAC7C,CAAA,CAEP;;EACL;EACG,EAAA,CAAA"}
|
|
@@ -39,6 +39,7 @@ export declare function useCreateConnection(): {
|
|
|
39
39
|
name: string;
|
|
40
40
|
description?: string;
|
|
41
41
|
providerId: string;
|
|
42
|
+
authMethodKey?: string;
|
|
42
43
|
vaultId?: string;
|
|
43
44
|
credentialSecretId?: string;
|
|
44
45
|
managedSecretName?: string;
|
|
@@ -54,6 +55,17 @@ export declare function useInitiateOAuth(): {
|
|
|
54
55
|
initiateOAuth: (connectionId: string, redirectUri: string, providerKey: string, scopes?: string[]) => Promise<OAuthInitiationResult | null>;
|
|
55
56
|
loading: boolean;
|
|
56
57
|
};
|
|
58
|
+
/**
|
|
59
|
+
* Authenticate a connection with values shaped by its auth method's schema.
|
|
60
|
+
*
|
|
61
|
+
* Generic replacement for the per-auth-type hooks below: the caller passes
|
|
62
|
+
* whatever the rendered form collected, so a new auth type needs no new hook,
|
|
63
|
+
* no new mutation document and no new branch at the call site.
|
|
64
|
+
*/
|
|
65
|
+
export declare function useAuthenticateConnection(): {
|
|
66
|
+
authenticateConnection: (connectionId: string, authMethodKey: string | undefined, values: Record<string, unknown>) => Promise<any>;
|
|
67
|
+
loading: boolean;
|
|
68
|
+
};
|
|
57
69
|
export declare function useAuthenticateWithApiKey(): {
|
|
58
70
|
authenticateWithApiKey: (connectionId: string, apiKey: string) => Promise<any>;
|
|
59
71
|
loading: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConnections.d.ts","sourceRoot":"","sources":["../../../src/integrations/hooks/useConnections.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"useConnections.d.ts","sourceRoot":"","sources":["../../../src/integrations/hooks/useConnections.ts"],"names":[],"mappings":"AAAA;;GAEG;AAuBH,OAAO,KAAK,EACV,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,UAAU,CAAC;AAIlB,UAAU,uBAAuB;IAC/B,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,cAAc,CAAC,MAAM,CAAC,EAAE,uBAAuB;;;;;;;;;EAa9D;AAED,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM;;;;;;;;EAavC;AAED,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,MAAM;;;;;;;;;EAmB1D;AAID,wBAAgB,mBAAmB;8BAOjB;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,MAAM,CAAC;QACnB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAClC;;EAeJ;AAED,wBAAgB,mBAAmB;2BAOpB,MAAM;;EAQpB;AAED,wBAAgB,gBAAgB;kCAMZ,MAAM,eACP,MAAM,eACN,MAAM,WACV,MAAM,EAAE,KAChB,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC;;EAgB3C;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB;2CAOrB,MAAM,iBACL,MAAM,GAAG,SAAS,UACzB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;EAWpC;AAED,wBAAgB,yBAAyB;2CAMhB,MAAM,UAAU,MAAM;;EAQ9C;AAED,wBAAgB,4BAA4B;8CAMnB,MAAM,YAAY,MAAM,YAAY,MAAM;;EAQlE;AAED,wBAAgB,8BAA8B;gDAMrB,MAAM,SAAS,MAAM;;EAQ7C;AAkBD;;;;;GAKG;AACH,wBAAgB,iCAAiC;mDASxB,MAAM,WAAW,MAAM,EAAE;YAPN,MAAM;gBAAU,gBAAgB;;;EAe3E;AAmBD;;;;GAIG;AACH,wBAAgB,+BAA+B;iDAStB,MAAM,UAAU,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;YAPtB,MAAM;gBAAU,gBAAgB;;;EAezE;AAED,wBAAgB,eAAe;iCAON,MAAM;;EAW9B;AAED,wBAAgB,mBAAmB;qCAOV,MAAM;;EAW9B;AAED,wBAAgB,iBAAiB;mCAIR,MAAM,KAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;;EAQrE"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { useIntegrations as e } from "../providers/IntegrationsProvider.js";
|
|
2
|
-
import {
|
|
3
|
-
import { mapConnection as
|
|
4
|
-
import { useIntegrationsEventBus as
|
|
5
|
-
import { useCallback as
|
|
6
|
-
import { gql as
|
|
7
|
-
import { useMutation as
|
|
2
|
+
import { useAuthenticateConnectionMutation as t, useAuthenticateWithApiKeyMutation as n, useAuthenticateWithBasicAuthMutation as r, useAuthenticateWithBearerTokenMutation as i, useCreateConnectionMutation as a, useDeleteConnectionMutation as o, useGetConnectionQuery as s, useGetConnectionsByProviderQuery as c, useGetConnectionsQuery as l, useInitiateOAuthMutation as u, useRefreshConnectionTokenMutation as d, useRevokeConnectionMutation as f, useTestConnectionMutation as p } from "../../generated/wspace-operations.js";
|
|
3
|
+
import { mapConnection as m } from "../utils/mappers.js";
|
|
4
|
+
import { useIntegrationsEventBus as h } from "../events/useIntegrationsEventBus.js";
|
|
5
|
+
import { useCallback as g } from "react";
|
|
6
|
+
import { gql as _ } from "@apollo/client";
|
|
7
|
+
import { useMutation as v } from "@apollo/client/react";
|
|
8
8
|
//#region src/integrations/hooks/useConnections.ts
|
|
9
|
-
function
|
|
10
|
-
let { workspaceId: n } = e(), { data: r, loading: i, error: a, refetch: o } =
|
|
9
|
+
function y(t) {
|
|
10
|
+
let { workspaceId: n } = e(), { data: r, loading: i, error: a, refetch: o } = l({
|
|
11
11
|
variables: {
|
|
12
12
|
filter: t,
|
|
13
13
|
pagination: { limit: 100 }
|
|
@@ -16,28 +16,28 @@ function v(t) {
|
|
|
16
16
|
errorPolicy: "all"
|
|
17
17
|
});
|
|
18
18
|
return {
|
|
19
|
-
connections: (r?.getConnections?.items ?? []).map((e) =>
|
|
19
|
+
connections: (r?.getConnections?.items ?? []).map((e) => m(e)),
|
|
20
20
|
total: r?.getConnections?.total ?? 0,
|
|
21
21
|
loading: i,
|
|
22
22
|
error: a,
|
|
23
23
|
refetch: o
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
let { workspaceId: n } = e(), { data: r, loading: i, error: a, refetch:
|
|
26
|
+
function b(t) {
|
|
27
|
+
let { workspaceId: n } = e(), { data: r, loading: i, error: a, refetch: o } = s({
|
|
28
28
|
variables: { id: t },
|
|
29
29
|
skip: !n || !t,
|
|
30
30
|
errorPolicy: "all"
|
|
31
31
|
});
|
|
32
32
|
return {
|
|
33
|
-
connection: r?.getConnection ?
|
|
33
|
+
connection: r?.getConnection ? m(r.getConnection) : null,
|
|
34
34
|
loading: i,
|
|
35
35
|
error: a,
|
|
36
|
-
refetch:
|
|
36
|
+
refetch: o
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
function
|
|
40
|
-
let { workspaceId: n } = e(), { data: r, loading: i, error: a, refetch: o } =
|
|
39
|
+
function x(t) {
|
|
40
|
+
let { workspaceId: n } = e(), { data: r, loading: i, error: a, refetch: o } = c({
|
|
41
41
|
variables: {
|
|
42
42
|
providerId: t,
|
|
43
43
|
pagination: { limit: 100 }
|
|
@@ -46,17 +46,17 @@ function b(t) {
|
|
|
46
46
|
errorPolicy: "all"
|
|
47
47
|
});
|
|
48
48
|
return {
|
|
49
|
-
connections: (r?.getConnectionsByProvider?.items ?? []).map((e) =>
|
|
49
|
+
connections: (r?.getConnectionsByProvider?.items ?? []).map((e) => m(e)),
|
|
50
50
|
total: r?.getConnectionsByProvider?.total ?? 0,
|
|
51
51
|
loading: i,
|
|
52
52
|
error: a,
|
|
53
53
|
refetch: o
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
let [e, { loading: t }] =
|
|
56
|
+
function S() {
|
|
57
|
+
let [e, { loading: t }] = a({ refetchQueries: ["GetConnections"] }), n = h();
|
|
58
58
|
return {
|
|
59
|
-
createConnection:
|
|
59
|
+
createConnection: g(async (t) => {
|
|
60
60
|
let r = (await e({ variables: { input: t } })).data?.createConnection?.id;
|
|
61
61
|
return r && n.emit("integrations:connection-created", {
|
|
62
62
|
connectionId: r,
|
|
@@ -66,10 +66,10 @@ function x() {
|
|
|
66
66
|
loading: t
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
function
|
|
70
|
-
let [e, { loading: t }] =
|
|
69
|
+
function C() {
|
|
70
|
+
let [e, { loading: t }] = o({ refetchQueries: ["GetConnections"] }), n = h();
|
|
71
71
|
return {
|
|
72
|
-
deleteConnection:
|
|
72
|
+
deleteConnection: g(async (t, r = !1) => {
|
|
73
73
|
await e({ variables: {
|
|
74
74
|
id: t,
|
|
75
75
|
deleteVaultSecret: r
|
|
@@ -78,10 +78,10 @@ function S() {
|
|
|
78
78
|
loading: t
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
let [e, { loading: t }] =
|
|
81
|
+
function w() {
|
|
82
|
+
let [e, { loading: t }] = u(), n = h();
|
|
83
83
|
return {
|
|
84
|
-
initiateOAuth:
|
|
84
|
+
initiateOAuth: g(async (t, r, i, a) => {
|
|
85
85
|
n.emit("integrations:oauth-started", {
|
|
86
86
|
connectionId: t,
|
|
87
87
|
providerKey: i
|
|
@@ -100,20 +100,31 @@ function C() {
|
|
|
100
100
|
loading: t
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function T() {
|
|
104
104
|
let [e, { loading: n }] = t({ refetchQueries: ["GetConnection"] });
|
|
105
105
|
return {
|
|
106
|
-
|
|
106
|
+
authenticateConnection: g(async (t, n, r) => (await e({ variables: { input: {
|
|
107
107
|
connectionId: t,
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
authMethodKey: n,
|
|
109
|
+
values: r
|
|
110
|
+
} } })).data?.authenticateConnection, [e]),
|
|
110
111
|
loading: n
|
|
111
112
|
};
|
|
112
113
|
}
|
|
113
|
-
function
|
|
114
|
+
function E() {
|
|
114
115
|
let [e, { loading: t }] = n({ refetchQueries: ["GetConnection"] });
|
|
115
116
|
return {
|
|
116
|
-
|
|
117
|
+
authenticateWithApiKey: g(async (t, n) => (await e({ variables: { input: {
|
|
118
|
+
connectionId: t,
|
|
119
|
+
apiKey: n
|
|
120
|
+
} } })).data?.authenticateWithApiKey, [e]),
|
|
121
|
+
loading: t
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
function D() {
|
|
125
|
+
let [e, { loading: t }] = r({ refetchQueries: ["GetConnection"] });
|
|
126
|
+
return {
|
|
127
|
+
authenticateWithBasicAuth: g(async (t, n, r) => (await e({ variables: { input: {
|
|
117
128
|
connectionId: t,
|
|
118
129
|
username: n,
|
|
119
130
|
password: r
|
|
@@ -121,17 +132,17 @@ function T() {
|
|
|
121
132
|
loading: t
|
|
122
133
|
};
|
|
123
134
|
}
|
|
124
|
-
function
|
|
125
|
-
let [e, { loading: t }] =
|
|
135
|
+
function O() {
|
|
136
|
+
let [e, { loading: t }] = i({ refetchQueries: ["GetConnection"] });
|
|
126
137
|
return {
|
|
127
|
-
authenticateWithBearerToken:
|
|
138
|
+
authenticateWithBearerToken: g(async (t, n) => (await e({ variables: { input: {
|
|
128
139
|
connectionId: t,
|
|
129
140
|
token: n
|
|
130
141
|
} } })).data?.authenticateWithBearerToken, [e]),
|
|
131
142
|
loading: t
|
|
132
143
|
};
|
|
133
144
|
}
|
|
134
|
-
var
|
|
145
|
+
var k = _`
|
|
135
146
|
mutation AuthenticateWithServiceAccount($input: ServiceAccountAuthInput!) {
|
|
136
147
|
authenticateWithServiceAccount(input: $input) {
|
|
137
148
|
id
|
|
@@ -139,17 +150,17 @@ var D = g`
|
|
|
139
150
|
}
|
|
140
151
|
}
|
|
141
152
|
`;
|
|
142
|
-
function
|
|
143
|
-
let [e, { loading: t }] =
|
|
153
|
+
function A() {
|
|
154
|
+
let [e, { loading: t }] = v(k, { refetchQueries: ["GetConnection"] });
|
|
144
155
|
return {
|
|
145
|
-
authenticateWithServiceAccount:
|
|
156
|
+
authenticateWithServiceAccount: g(async (t, n) => (await e({ variables: { input: {
|
|
146
157
|
connectionId: t,
|
|
147
158
|
scopes: n
|
|
148
159
|
} } })).data?.authenticateWithServiceAccount, [e]),
|
|
149
160
|
loading: t
|
|
150
161
|
};
|
|
151
162
|
}
|
|
152
|
-
var
|
|
163
|
+
var j = _`
|
|
153
164
|
mutation AuthenticateWithCustomConfig($input: CustomConfigAuthInput!) {
|
|
154
165
|
authenticateWithCustomConfig(input: $input) {
|
|
155
166
|
id
|
|
@@ -157,44 +168,44 @@ var k = g`
|
|
|
157
168
|
}
|
|
158
169
|
}
|
|
159
170
|
`;
|
|
160
|
-
function
|
|
161
|
-
let [e, { loading: t }] =
|
|
171
|
+
function M() {
|
|
172
|
+
let [e, { loading: t }] = v(j, { refetchQueries: ["GetConnection"] });
|
|
162
173
|
return {
|
|
163
|
-
authenticateWithCustomConfig:
|
|
174
|
+
authenticateWithCustomConfig: g(async (t, n) => (await e({ variables: { input: {
|
|
164
175
|
connectionId: t,
|
|
165
176
|
config: n
|
|
166
177
|
} } })).data?.authenticateWithCustomConfig, [e]),
|
|
167
178
|
loading: t
|
|
168
179
|
};
|
|
169
180
|
}
|
|
170
|
-
function
|
|
171
|
-
let [e, { loading: t }] =
|
|
181
|
+
function N() {
|
|
182
|
+
let [e, { loading: t }] = d({ refetchQueries: ["GetConnection"] }), n = h();
|
|
172
183
|
return {
|
|
173
|
-
refreshToken:
|
|
184
|
+
refreshToken: g(async (t) => {
|
|
174
185
|
let r = await e({ variables: { connectionId: t } });
|
|
175
186
|
return r.data?.refreshConnectionToken && n.emit("integrations:token-refreshed", { connectionId: t }), r.data?.refreshConnectionToken;
|
|
176
187
|
}, [e, n]),
|
|
177
188
|
loading: t
|
|
178
189
|
};
|
|
179
190
|
}
|
|
180
|
-
function
|
|
181
|
-
let [e, { loading: t }] =
|
|
191
|
+
function P() {
|
|
192
|
+
let [e, { loading: t }] = f({ refetchQueries: ["GetConnection"] }), n = h();
|
|
182
193
|
return {
|
|
183
|
-
revokeConnection:
|
|
194
|
+
revokeConnection: g(async (t) => {
|
|
184
195
|
let r = await e({ variables: { connectionId: t } });
|
|
185
196
|
return r.data?.revokeConnection && n.emit("integrations:token-revoked", { connectionId: t }), r.data?.revokeConnection;
|
|
186
197
|
}, [e, n]),
|
|
187
198
|
loading: t
|
|
188
199
|
};
|
|
189
200
|
}
|
|
190
|
-
function
|
|
191
|
-
let [e, { loading: t }] =
|
|
201
|
+
function F() {
|
|
202
|
+
let [e, { loading: t }] = p();
|
|
192
203
|
return {
|
|
193
|
-
testConnection:
|
|
204
|
+
testConnection: g(async (t) => (await e({ variables: { connectionId: t } })).data?.testConnection ?? null, [e]),
|
|
194
205
|
loading: t
|
|
195
206
|
};
|
|
196
207
|
}
|
|
197
208
|
//#endregion
|
|
198
|
-
export {
|
|
209
|
+
export { T as useAuthenticateConnection, E as useAuthenticateWithApiKey, D as useAuthenticateWithBasicAuth, O as useAuthenticateWithBearerToken, M as useAuthenticateWithCustomConfig, A as useAuthenticateWithServiceAccount, b as useConnection, y as useConnections, x as useConnectionsByProvider, S as useCreateConnection, C as useDeleteConnection, w as useInitiateOAuth, N as useRefreshToken, P as useRevokeConnection, F as useTestConnection };
|
|
199
210
|
|
|
200
211
|
//# sourceMappingURL=useConnections.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConnections.js","names":[],"sources":["../../../src/integrations/hooks/useConnections.ts"],"sourcesContent":["/**\n * Custom hooks wrapping GraphQL queries and mutations for connections.\n */\n\nimport { useCallback } from 'react';\nimport { gql } from '@apollo/client';\nimport { useMutation } from '@apollo/client/react';\nimport {\n useGetConnectionsQuery,\n useGetConnectionQuery,\n useGetConnectionsByProviderQuery,\n useCreateConnectionMutation,\n useInitiateOAuthMutation,\n useAuthenticateWithApiKeyMutation,\n useAuthenticateWithBasicAuthMutation,\n useAuthenticateWithBearerTokenMutation,\n useRefreshConnectionTokenMutation,\n useRevokeConnectionMutation,\n useTestConnectionMutation,\n useDeleteConnectionMutation,\n} from '../../generated/wspace-operations';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport { useIntegrationsEventBus } from '../events/useIntegrationsEventBus';\nimport { mapConnection } from '../utils/mappers';\nimport type {\n IntegrationConnection,\n ConnectionStatus,\n OAuthInitiationResult,\n ConnectionTestResult,\n} from '../types';\n\n// ─── Query Hooks ────────────────────────────────────────────────────────────\n\ninterface ConnectionFilterOptions {\n status?: ConnectionStatus;\n providerId?: string;\n search?: string;\n}\n\nexport function useConnections(filter?: ConnectionFilterOptions) {\n const { workspaceId } = useIntegrations();\n const { data, loading, error, refetch } = useGetConnectionsQuery({\n variables: { filter, pagination: { limit: 100 } },\n skip: !workspaceId,\n errorPolicy: 'all',\n });\n\n const connections: IntegrationConnection[] = (data?.getConnections?.items ?? []).map(\n (item: Record<string, unknown>) => mapConnection(item)\n );\n\n return { connections, total: data?.getConnections?.total ?? 0, loading, error, refetch };\n}\n\nexport function useConnection(id: string) {\n const { workspaceId } = useIntegrations();\n const { data, loading, error, refetch } = useGetConnectionQuery({\n variables: { id },\n skip: !workspaceId || !id,\n errorPolicy: 'all',\n });\n\n const connection: IntegrationConnection | null = data?.getConnection\n ? mapConnection(data.getConnection as Record<string, unknown>)\n : null;\n\n return { connection, loading, error, refetch };\n}\n\nexport function useConnectionsByProvider(providerId: string) {\n const { workspaceId } = useIntegrations();\n const { data, loading, error, refetch } = useGetConnectionsByProviderQuery({\n variables: { providerId, pagination: { limit: 100 } },\n skip: !workspaceId || !providerId,\n errorPolicy: 'all',\n });\n\n const connections: IntegrationConnection[] = (data?.getConnectionsByProvider?.items ?? []).map(\n (item: Record<string, unknown>) => mapConnection(item)\n );\n\n return {\n connections,\n total: data?.getConnectionsByProvider?.total ?? 0,\n loading,\n error,\n refetch,\n };\n}\n\n// ─── Mutation Hooks ─────────────────────────────────────────────────────────\n\nexport function useCreateConnection() {\n const [mutate, { loading }] = useCreateConnectionMutation({\n refetchQueries: ['GetConnections'],\n });\n const eventBus = useIntegrationsEventBus();\n\n const createConnection = useCallback(\n async (input: {\n name: string;\n description?: string;\n providerId: string;\n vaultId?: string;\n credentialSecretId?: string;\n managedSecretName?: string;\n config?: Record<string, unknown>;\n }) => {\n const result = await mutate({ variables: { input } });\n const id = result.data?.createConnection?.id as string | undefined;\n if (id) {\n eventBus.emit('integrations:connection-created', {\n connectionId: id,\n providerKey: input.providerId,\n });\n }\n return id;\n },\n [mutate, eventBus]\n );\n\n return { createConnection, loading };\n}\n\nexport function useDeleteConnection() {\n const [mutate, { loading }] = useDeleteConnectionMutation({\n refetchQueries: ['GetConnections'],\n });\n const eventBus = useIntegrationsEventBus();\n\n const deleteConnection = useCallback(\n async (id: string, deleteVaultSecret = false) => {\n await mutate({ variables: { id, deleteVaultSecret } });\n eventBus.emit('integrations:connection-deleted', { connectionId: id });\n },\n [mutate, eventBus]\n );\n\n return { deleteConnection, loading };\n}\n\nexport function useInitiateOAuth() {\n const [mutate, { loading }] = useInitiateOAuthMutation();\n const eventBus = useIntegrationsEventBus();\n\n const initiateOAuth = useCallback(\n async (\n connectionId: string,\n redirectUri: string,\n providerKey: string,\n scopes?: string[]\n ): Promise<OAuthInitiationResult | null> => {\n eventBus.emit('integrations:oauth-started', { connectionId, providerKey });\n const result = await mutate({ variables: { input: { connectionId, redirectUri, scopes } } });\n if (result.error) {\n eventBus.emit('integrations:oauth-failed', {\n connectionId,\n providerKey,\n error: result.error.message,\n });\n }\n return result.data?.initiateOAuth ?? null;\n },\n [mutate, eventBus]\n );\n\n return { initiateOAuth, loading };\n}\n\nexport function useAuthenticateWithApiKey() {\n const [mutate, { loading }] = useAuthenticateWithApiKeyMutation({\n refetchQueries: ['GetConnection'],\n });\n\n const authenticateWithApiKey = useCallback(\n async (connectionId: string, apiKey: string) => {\n const result = await mutate({ variables: { input: { connectionId, apiKey } } });\n return result.data?.authenticateWithApiKey;\n },\n [mutate]\n );\n\n return { authenticateWithApiKey, loading };\n}\n\nexport function useAuthenticateWithBasicAuth() {\n const [mutate, { loading }] = useAuthenticateWithBasicAuthMutation({\n refetchQueries: ['GetConnection'],\n });\n\n const authenticateWithBasicAuth = useCallback(\n async (connectionId: string, username: string, password: string) => {\n const result = await mutate({ variables: { input: { connectionId, username, password } } });\n return result.data?.authenticateWithBasicAuth;\n },\n [mutate]\n );\n\n return { authenticateWithBasicAuth, loading };\n}\n\nexport function useAuthenticateWithBearerToken() {\n const [mutate, { loading }] = useAuthenticateWithBearerTokenMutation({\n refetchQueries: ['GetConnection'],\n });\n\n const authenticateWithBearerToken = useCallback(\n async (connectionId: string, token: string) => {\n const result = await mutate({ variables: { input: { connectionId, token } } });\n return result.data?.authenticateWithBearerToken;\n },\n [mutate]\n );\n\n return { authenticateWithBearerToken, loading };\n}\n\n/**\n * GraphQL document for the first-party SERVICE_ACCOUNT auth flow. Defined inline\n * (rather than via codegen) so it does not depend on a fresh `schema:pull` from\n * a gateway that already exposes the new `authenticateWithServiceAccount`\n * mutation. Once the gateway supergraph includes it, this can be migrated to an\n * `src/operations/...` document like the other mutations.\n */\nconst AUTHENTICATE_WITH_SERVICE_ACCOUNT = gql`\n mutation AuthenticateWithServiceAccount($input: ServiceAccountAuthInput!) {\n authenticateWithServiceAccount(input: $input) {\n id\n status\n }\n }\n`;\n\n/**\n * Connect a first-party SERVICE_ACCOUNT provider (e.g. Burdenoff). No user\n * credentials are collected — the platform mints an app-as-user token per\n * execution. Calling this records the user's consent (delegation) for the\n * reserved app and activates the connection.\n */\nexport function useAuthenticateWithServiceAccount() {\n const [mutate, { loading }] = useMutation<\n { authenticateWithServiceAccount: { id: string; status: ConnectionStatus } },\n { input: { connectionId: string; scopes?: string[] } }\n >(AUTHENTICATE_WITH_SERVICE_ACCOUNT, {\n refetchQueries: ['GetConnection'],\n });\n\n const authenticateWithServiceAccount = useCallback(\n async (connectionId: string, scopes?: string[]) => {\n const result = await mutate({ variables: { input: { connectionId, scopes } } });\n return result.data?.authenticateWithServiceAccount;\n },\n [mutate]\n );\n\n return { authenticateWithServiceAccount, loading };\n}\n\n/**\n * GraphQL document for CUSTOM provider auth (configSchema-driven config, e.g.\n * Google Workspace Admin domain-wide delegation). Defined inline (rather than\n * via codegen) so it does not depend on a fresh `schema:pull` from a gateway\n * that already exposes the new `authenticateWithCustomConfig` mutation. Once\n * the gateway supergraph includes it, this can be migrated to an\n * `src/operations/...` document like the other mutations.\n */\nconst AUTHENTICATE_WITH_CUSTOM_CONFIG = gql`\n mutation AuthenticateWithCustomConfig($input: CustomConfigAuthInput!) {\n authenticateWithCustomConfig(input: $input) {\n id\n status\n }\n }\n`;\n\n/**\n * Connect a CUSTOM provider with a configSchema-shaped config object. The full\n * config is stored inside the encrypted credential payload (secrets never hit\n * plain columns); the connection becomes ACTIVE immediately.\n */\nexport function useAuthenticateWithCustomConfig() {\n const [mutate, { loading }] = useMutation<\n { authenticateWithCustomConfig: { id: string; status: ConnectionStatus } },\n { input: { connectionId: string; config: Record<string, unknown> } }\n >(AUTHENTICATE_WITH_CUSTOM_CONFIG, {\n refetchQueries: ['GetConnection'],\n });\n\n const authenticateWithCustomConfig = useCallback(\n async (connectionId: string, config: Record<string, unknown>) => {\n const result = await mutate({ variables: { input: { connectionId, config } } });\n return result.data?.authenticateWithCustomConfig;\n },\n [mutate]\n );\n\n return { authenticateWithCustomConfig, loading };\n}\n\nexport function useRefreshToken() {\n const [mutate, { loading }] = useRefreshConnectionTokenMutation({\n refetchQueries: ['GetConnection'],\n });\n const eventBus = useIntegrationsEventBus();\n\n const refreshToken = useCallback(\n async (connectionId: string) => {\n const result = await mutate({ variables: { connectionId } });\n if (result.data?.refreshConnectionToken) {\n eventBus.emit('integrations:token-refreshed', { connectionId });\n }\n return result.data?.refreshConnectionToken;\n },\n [mutate, eventBus]\n );\n\n return { refreshToken, loading };\n}\n\nexport function useRevokeConnection() {\n const [mutate, { loading }] = useRevokeConnectionMutation({\n refetchQueries: ['GetConnection'],\n });\n const eventBus = useIntegrationsEventBus();\n\n const revokeConnection = useCallback(\n async (connectionId: string) => {\n const result = await mutate({ variables: { connectionId } });\n if (result.data?.revokeConnection) {\n eventBus.emit('integrations:token-revoked', { connectionId });\n }\n return result.data?.revokeConnection;\n },\n [mutate, eventBus]\n );\n\n return { revokeConnection, loading };\n}\n\nexport function useTestConnection() {\n const [mutate, { loading }] = useTestConnectionMutation();\n\n const testConnection = useCallback(\n async (connectionId: string): Promise<ConnectionTestResult | null> => {\n const result = await mutate({ variables: { connectionId } });\n return result.data?.testConnection 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,EAAE,EAAE,CAAC,EACjE,MAAM,8BAEtB,CAAC,EAAO,CACT;EAEsC;EAAS;;AAGlD,SAAgB,IAAkB;CAChC,IAAM,CAAC,GAAQ,EAAE,gBAAa,EAAkC,EAC9D,gBAAgB,CAAC,gBAAgB,EAClC,CAAC,EACI,IAAW,GAAyB;AAa1C,QAAO;EAAE,cAXY,EACnB,OAAO,MAAyB;GAC9B,IAAM,IAAS,MAAM,EAAO,EAAE,WAAW,EAAE,iBAAc,EAAE,CAAC;AAI5D,UAHI,EAAO,MAAM,0BACf,EAAS,KAAK,gCAAgC,EAAE,iBAAc,CAAC,EAE1D,EAAO,MAAM;KAEtB,CAAC,GAAQ,EAAS,CACnB;EAEsB;EAAS;;AAGlC,SAAgB,IAAsB;CACpC,IAAM,CAAC,GAAQ,EAAE,gBAAa,EAA4B,EACxD,gBAAgB,CAAC,gBAAgB,EAClC,CAAC,EACI,IAAW,GAAyB;AAa1C,QAAO;EAAE,kBAXgB,EACvB,OAAO,MAAyB;GAC9B,IAAM,IAAS,MAAM,EAAO,EAAE,WAAW,EAAE,iBAAc,EAAE,CAAC;AAI5D,UAHI,EAAO,MAAM,oBACf,EAAS,KAAK,8BAA8B,EAAE,iBAAc,CAAC,EAExD,EAAO,MAAM;KAEtB,CAAC,GAAQ,EAAS,CACnB;EAE0B;EAAS;;AAGtC,SAAgB,IAAoB;CAClC,IAAM,CAAC,GAAQ,EAAE,gBAAa,GAA2B;AAUzD,QAAO;EAAE,gBARc,EACrB,OAAO,OACU,MAAM,EAAO,EAAE,WAAW,EAAE,iBAAc,EAAE,CAAC,EAC9C,MAAM,kBAAkB,MAExC,CAAC,EAAO,CACT;EAEwB;EAAS"}
|
|
1
|
+
{"version":3,"file":"useConnections.js","names":[],"sources":["../../../src/integrations/hooks/useConnections.ts"],"sourcesContent":["/**\n * Custom hooks wrapping GraphQL queries and mutations for connections.\n */\n\nimport { useCallback } from 'react';\nimport { gql } from '@apollo/client';\nimport { useMutation } from '@apollo/client/react';\nimport {\n useGetConnectionsQuery,\n useGetConnectionQuery,\n useGetConnectionsByProviderQuery,\n useCreateConnectionMutation,\n useInitiateOAuthMutation,\n useAuthenticateConnectionMutation,\n useAuthenticateWithApiKeyMutation,\n useAuthenticateWithBasicAuthMutation,\n useAuthenticateWithBearerTokenMutation,\n useRefreshConnectionTokenMutation,\n useRevokeConnectionMutation,\n useTestConnectionMutation,\n useDeleteConnectionMutation,\n} from '../../generated/wspace-operations';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\nimport { useIntegrationsEventBus } from '../events/useIntegrationsEventBus';\nimport { mapConnection } from '../utils/mappers';\nimport type {\n IntegrationConnection,\n ConnectionStatus,\n OAuthInitiationResult,\n ConnectionTestResult,\n} from '../types';\n\n// ─── Query Hooks ────────────────────────────────────────────────────────────\n\ninterface ConnectionFilterOptions {\n status?: ConnectionStatus;\n providerId?: string;\n search?: string;\n}\n\nexport function useConnections(filter?: ConnectionFilterOptions) {\n const { workspaceId } = useIntegrations();\n const { data, loading, error, refetch } = useGetConnectionsQuery({\n variables: { filter, pagination: { limit: 100 } },\n skip: !workspaceId,\n errorPolicy: 'all',\n });\n\n const connections: IntegrationConnection[] = (data?.getConnections?.items ?? []).map(\n (item: Record<string, unknown>) => mapConnection(item)\n );\n\n return { connections, total: data?.getConnections?.total ?? 0, loading, error, refetch };\n}\n\nexport function useConnection(id: string) {\n const { workspaceId } = useIntegrations();\n const { data, loading, error, refetch } = useGetConnectionQuery({\n variables: { id },\n skip: !workspaceId || !id,\n errorPolicy: 'all',\n });\n\n const connection: IntegrationConnection | null = data?.getConnection\n ? mapConnection(data.getConnection as Record<string, unknown>)\n : null;\n\n return { connection, loading, error, refetch };\n}\n\nexport function useConnectionsByProvider(providerId: string) {\n const { workspaceId } = useIntegrations();\n const { data, loading, error, refetch } = useGetConnectionsByProviderQuery({\n variables: { providerId, pagination: { limit: 100 } },\n skip: !workspaceId || !providerId,\n errorPolicy: 'all',\n });\n\n const connections: IntegrationConnection[] = (data?.getConnectionsByProvider?.items ?? []).map(\n (item: Record<string, unknown>) => mapConnection(item)\n );\n\n return {\n connections,\n total: data?.getConnectionsByProvider?.total ?? 0,\n loading,\n error,\n refetch,\n };\n}\n\n// ─── Mutation Hooks ─────────────────────────────────────────────────────────\n\nexport function useCreateConnection() {\n const [mutate, { loading }] = useCreateConnectionMutation({\n refetchQueries: ['GetConnections'],\n });\n const eventBus = useIntegrationsEventBus();\n\n const createConnection = useCallback(\n async (input: {\n name: string;\n description?: string;\n providerId: string;\n authMethodKey?: string;\n vaultId?: string;\n credentialSecretId?: string;\n managedSecretName?: string;\n config?: Record<string, unknown>;\n }) => {\n const result = await mutate({ variables: { input } });\n const id = result.data?.createConnection?.id as string | undefined;\n if (id) {\n eventBus.emit('integrations:connection-created', {\n connectionId: id,\n providerKey: input.providerId,\n });\n }\n return id;\n },\n [mutate, eventBus]\n );\n\n return { createConnection, loading };\n}\n\nexport function useDeleteConnection() {\n const [mutate, { loading }] = useDeleteConnectionMutation({\n refetchQueries: ['GetConnections'],\n });\n const eventBus = useIntegrationsEventBus();\n\n const deleteConnection = useCallback(\n async (id: string, deleteVaultSecret = false) => {\n await mutate({ variables: { id, deleteVaultSecret } });\n eventBus.emit('integrations:connection-deleted', { connectionId: id });\n },\n [mutate, eventBus]\n );\n\n return { deleteConnection, loading };\n}\n\nexport function useInitiateOAuth() {\n const [mutate, { loading }] = useInitiateOAuthMutation();\n const eventBus = useIntegrationsEventBus();\n\n const initiateOAuth = useCallback(\n async (\n connectionId: string,\n redirectUri: string,\n providerKey: string,\n scopes?: string[]\n ): Promise<OAuthInitiationResult | null> => {\n eventBus.emit('integrations:oauth-started', { connectionId, providerKey });\n const result = await mutate({ variables: { input: { connectionId, redirectUri, scopes } } });\n if (result.error) {\n eventBus.emit('integrations:oauth-failed', {\n connectionId,\n providerKey,\n error: result.error.message,\n });\n }\n return result.data?.initiateOAuth ?? null;\n },\n [mutate, eventBus]\n );\n\n return { initiateOAuth, loading };\n}\n\n/**\n * Authenticate a connection with values shaped by its auth method's schema.\n *\n * Generic replacement for the per-auth-type hooks below: the caller passes\n * whatever the rendered form collected, so a new auth type needs no new hook,\n * no new mutation document and no new branch at the call site.\n */\nexport function useAuthenticateConnection() {\n const [mutate, { loading }] = useAuthenticateConnectionMutation({\n refetchQueries: ['GetConnection'],\n });\n\n const authenticateConnection = useCallback(\n async (\n connectionId: string,\n authMethodKey: string | undefined,\n values: Record<string, unknown>\n ) => {\n const result = await mutate({\n variables: { input: { connectionId, authMethodKey, values } },\n });\n return result.data?.authenticateConnection;\n },\n [mutate]\n );\n\n return { authenticateConnection, loading };\n}\n\nexport function useAuthenticateWithApiKey() {\n const [mutate, { loading }] = useAuthenticateWithApiKeyMutation({\n refetchQueries: ['GetConnection'],\n });\n\n const authenticateWithApiKey = useCallback(\n async (connectionId: string, apiKey: string) => {\n const result = await mutate({ variables: { input: { connectionId, apiKey } } });\n return result.data?.authenticateWithApiKey;\n },\n [mutate]\n );\n\n return { authenticateWithApiKey, loading };\n}\n\nexport function useAuthenticateWithBasicAuth() {\n const [mutate, { loading }] = useAuthenticateWithBasicAuthMutation({\n refetchQueries: ['GetConnection'],\n });\n\n const authenticateWithBasicAuth = useCallback(\n async (connectionId: string, username: string, password: string) => {\n const result = await mutate({ variables: { input: { connectionId, username, password } } });\n return result.data?.authenticateWithBasicAuth;\n },\n [mutate]\n );\n\n return { authenticateWithBasicAuth, loading };\n}\n\nexport function useAuthenticateWithBearerToken() {\n const [mutate, { loading }] = useAuthenticateWithBearerTokenMutation({\n refetchQueries: ['GetConnection'],\n });\n\n const authenticateWithBearerToken = useCallback(\n async (connectionId: string, token: string) => {\n const result = await mutate({ variables: { input: { connectionId, token } } });\n return result.data?.authenticateWithBearerToken;\n },\n [mutate]\n );\n\n return { authenticateWithBearerToken, loading };\n}\n\n/**\n * GraphQL document for the first-party SERVICE_ACCOUNT auth flow. Defined inline\n * (rather than via codegen) so it does not depend on a fresh `schema:pull` from\n * a gateway that already exposes the new `authenticateWithServiceAccount`\n * mutation. Once the gateway supergraph includes it, this can be migrated to an\n * `src/operations/...` document like the other mutations.\n */\nconst AUTHENTICATE_WITH_SERVICE_ACCOUNT = gql`\n mutation AuthenticateWithServiceAccount($input: ServiceAccountAuthInput!) {\n authenticateWithServiceAccount(input: $input) {\n id\n status\n }\n }\n`;\n\n/**\n * Connect a first-party SERVICE_ACCOUNT provider (e.g. Burdenoff). No user\n * credentials are collected — the platform mints an app-as-user token per\n * execution. Calling this records the user's consent (delegation) for the\n * reserved app and activates the connection.\n */\nexport function useAuthenticateWithServiceAccount() {\n const [mutate, { loading }] = useMutation<\n { authenticateWithServiceAccount: { id: string; status: ConnectionStatus } },\n { input: { connectionId: string; scopes?: string[] } }\n >(AUTHENTICATE_WITH_SERVICE_ACCOUNT, {\n refetchQueries: ['GetConnection'],\n });\n\n const authenticateWithServiceAccount = useCallback(\n async (connectionId: string, scopes?: string[]) => {\n const result = await mutate({ variables: { input: { connectionId, scopes } } });\n return result.data?.authenticateWithServiceAccount;\n },\n [mutate]\n );\n\n return { authenticateWithServiceAccount, loading };\n}\n\n/**\n * GraphQL document for CUSTOM provider auth (configSchema-driven config, e.g.\n * Google Workspace Admin domain-wide delegation). Defined inline (rather than\n * via codegen) so it does not depend on a fresh `schema:pull` from a gateway\n * that already exposes the new `authenticateWithCustomConfig` mutation. Once\n * the gateway supergraph includes it, this can be migrated to an\n * `src/operations/...` document like the other mutations.\n */\nconst AUTHENTICATE_WITH_CUSTOM_CONFIG = gql`\n mutation AuthenticateWithCustomConfig($input: CustomConfigAuthInput!) {\n authenticateWithCustomConfig(input: $input) {\n id\n status\n }\n }\n`;\n\n/**\n * Connect a CUSTOM provider with a configSchema-shaped config object. The full\n * config is stored inside the encrypted credential payload (secrets never hit\n * plain columns); the connection becomes ACTIVE immediately.\n */\nexport function useAuthenticateWithCustomConfig() {\n const [mutate, { loading }] = useMutation<\n { authenticateWithCustomConfig: { id: string; status: ConnectionStatus } },\n { input: { connectionId: string; config: Record<string, unknown> } }\n >(AUTHENTICATE_WITH_CUSTOM_CONFIG, {\n refetchQueries: ['GetConnection'],\n });\n\n const authenticateWithCustomConfig = useCallback(\n async (connectionId: string, config: Record<string, unknown>) => {\n const result = await mutate({ variables: { input: { connectionId, config } } });\n return result.data?.authenticateWithCustomConfig;\n },\n [mutate]\n );\n\n return { authenticateWithCustomConfig, loading };\n}\n\nexport function useRefreshToken() {\n const [mutate, { loading }] = useRefreshConnectionTokenMutation({\n refetchQueries: ['GetConnection'],\n });\n const eventBus = useIntegrationsEventBus();\n\n const refreshToken = useCallback(\n async (connectionId: string) => {\n const result = await mutate({ variables: { connectionId } });\n if (result.data?.refreshConnectionToken) {\n eventBus.emit('integrations:token-refreshed', { connectionId });\n }\n return result.data?.refreshConnectionToken;\n },\n [mutate, eventBus]\n );\n\n return { refreshToken, loading };\n}\n\nexport function useRevokeConnection() {\n const [mutate, { loading }] = useRevokeConnectionMutation({\n refetchQueries: ['GetConnection'],\n });\n const eventBus = useIntegrationsEventBus();\n\n const revokeConnection = useCallback(\n async (connectionId: string) => {\n const result = await mutate({ variables: { connectionId } });\n if (result.data?.revokeConnection) {\n eventBus.emit('integrations:token-revoked', { connectionId });\n }\n return result.data?.revokeConnection;\n },\n [mutate, eventBus]\n );\n\n return { revokeConnection, loading };\n}\n\nexport function useTestConnection() {\n const [mutate, { loading }] = useTestConnectionMutation();\n\n const testConnection = useCallback(\n async (connectionId: string): Promise<ConnectionTestResult | null> => {\n const result = await mutate({ variables: { connectionId } });\n return result.data?.testConnection ?? null;\n },\n [mutate]\n );\n\n return { testConnection, loading };\n}\n"],"mappings":";;;;;;;;AAwCA,SAAgB,EAAe,GAAkC;CAC/D,IAAM,EAAE,mBAAgB,GAAiB,EACnC,EAAE,SAAM,YAAS,UAAO,eAAY,EAAuB;EAC/D,WAAW;GAAE;GAAQ,YAAY,EAAE,OAAO,KAAK;GAAE;EACjD,MAAM,CAAC;EACP,aAAa;EACd,CAAC;AAMF,QAAO;EAAE,cA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;GAAc;GAAQ,EAAE,EAAE,CAAC,EACjE,MAAM,8BAEtB,CAAC,EAAO,CACT;EAEsC;EAAS;;AAGlD,SAAgB,IAAkB;CAChC,IAAM,CAAC,GAAQ,EAAE,gBAAa,EAAkC,EAC9D,gBAAgB,CAAC,gBAAgB,EAClC,CAAC,EACI,IAAW,GAAyB;AAa1C,QAAO;EAAE,cAXY,EACnB,OAAO,MAAyB;GAC9B,IAAM,IAAS,MAAM,EAAO,EAAE,WAAW,EAAE,iBAAc,EAAE,CAAC;AAI5D,UAHI,EAAO,MAAM,0BACf,EAAS,KAAK,gCAAgC,EAAE,iBAAc,CAAC,EAE1D,EAAO,MAAM;KAEtB,CAAC,GAAQ,EAAS,CACnB;EAEsB;EAAS;;AAGlC,SAAgB,IAAsB;CACpC,IAAM,CAAC,GAAQ,EAAE,gBAAa,EAA4B,EACxD,gBAAgB,CAAC,gBAAgB,EAClC,CAAC,EACI,IAAW,GAAyB;AAa1C,QAAO;EAAE,kBAXgB,EACvB,OAAO,MAAyB;GAC9B,IAAM,IAAS,MAAM,EAAO,EAAE,WAAW,EAAE,iBAAc,EAAE,CAAC;AAI5D,UAHI,EAAO,MAAM,oBACf,EAAS,KAAK,8BAA8B,EAAE,iBAAc,CAAC,EAExD,EAAO,MAAM;KAEtB,CAAC,GAAQ,EAAS,CACnB;EAE0B;EAAS;;AAGtC,SAAgB,IAAoB;CAClC,IAAM,CAAC,GAAQ,EAAE,gBAAa,GAA2B;AAUzD,QAAO;EAAE,gBARc,EACrB,OAAO,OACU,MAAM,EAAO,EAAE,WAAW,EAAE,iBAAc,EAAE,CAAC,EAC9C,MAAM,kBAAkB,MAExC,CAAC,EAAO,CACT;EAEwB;EAAS"}
|
|
@@ -95,5 +95,32 @@ export declare function useDisableProvider(): {
|
|
|
95
95
|
disableProvider: (id: string) => Promise<any>;
|
|
96
96
|
loading: boolean;
|
|
97
97
|
};
|
|
98
|
+
/**
|
|
99
|
+
* Create or update one of a provider's authentication methods.
|
|
100
|
+
*
|
|
101
|
+
* This is what makes multi-auth an admin action rather than a code change: the
|
|
102
|
+
* method's display name, type and field schema are all data, so offering a new
|
|
103
|
+
* way to authenticate against an existing provider needs no deploy.
|
|
104
|
+
*/
|
|
105
|
+
export declare function useUpsertAuthMethod(): {
|
|
106
|
+
upsertAuthMethod: (providerId: string, input: {
|
|
107
|
+
key: string;
|
|
108
|
+
displayName: string;
|
|
109
|
+
description?: string;
|
|
110
|
+
authType: string;
|
|
111
|
+
flow?: string;
|
|
112
|
+
configSchema?: Record<string, unknown> | null;
|
|
113
|
+
oauthConfig?: Record<string, unknown> | null;
|
|
114
|
+
defaultScopes?: string[];
|
|
115
|
+
isDefault?: boolean;
|
|
116
|
+
isEnabled?: boolean;
|
|
117
|
+
displayOrder?: number;
|
|
118
|
+
}) => Promise<any>;
|
|
119
|
+
loading: boolean;
|
|
120
|
+
};
|
|
121
|
+
export declare function useDeleteAuthMethod(): {
|
|
122
|
+
deleteAuthMethod: (providerId: string, key: string) => Promise<any>;
|
|
123
|
+
loading: boolean;
|
|
124
|
+
};
|
|
98
125
|
export {};
|
|
99
126
|
//# sourceMappingURL=useProviders.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useProviders.d.ts","sourceRoot":"","sources":["../../../src/integrations/hooks/useProviders.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"useProviders.d.ts","sourceRoot":"","sources":["../../../src/integrations/hooks/useProviders.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAiBH,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAIpF,UAAU,qBAAqB;IAC7B,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,YAAY,CAAC,MAAM,CAAC,EAAE,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