@fayz-ai/admin 0.43.1 → 0.43.4
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConnectors.d.ts","sourceRoot":"","sources":["../../../src/components/connect/useConnectors.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,KAAK,gBAAgB,EAErB,KAAK,gBAAgB,EACtB,MAAM,SAAS,CAAA;AAgBhB,wBAAgB,WAAW,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAmBzD;AAED,wBAAgB,mBAAmB,IAAI,gBAAgB,EAAE,GAAG,IAAI,CAY/D;AA0BD,2EAA2E;AAC3E,wBAAgB,iBAAiB,IAAI,IAAI,CAIxC;AAsBD;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,EAAE,CAGhD;AAaD,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAA;IACrC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,gEAAgE;IAChE,WAAW,EAAE,CAAC,SAAS,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC3D,+EAA+E;IAC/E,cAAc,EAAE,OAAO,CAAA;IACvB,WAAW,EAAE,OAAO,CAAA;CACrB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,OAAO,GAAE;IACrC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,2EAA2E;IAC3E,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,gFAAgF;IAChF,cAAc,CAAC,EAAE,OAAO,CAAA;CACpB,GAAG,cAAc,
|
|
1
|
+
{"version":3,"file":"useConnectors.d.ts","sourceRoot":"","sources":["../../../src/components/connect/useConnectors.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,KAAK,gBAAgB,EAErB,KAAK,gBAAgB,EACtB,MAAM,SAAS,CAAA;AAgBhB,wBAAgB,WAAW,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAmBzD;AAED,wBAAgB,mBAAmB,IAAI,gBAAgB,EAAE,GAAG,IAAI,CAY/D;AA0BD,2EAA2E;AAC3E,wBAAgB,iBAAiB,IAAI,IAAI,CAIxC;AAsBD;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,EAAE,CAGhD;AAaD,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAA;IACrC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,gEAAgE;IAChE,WAAW,EAAE,CAAC,SAAS,EAAE,gBAAgB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC3D,+EAA+E;IAC/E,cAAc,EAAE,OAAO,CAAA;IACvB,WAAW,EAAE,OAAO,CAAA;CACrB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,OAAO,GAAE;IACrC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,2EAA2E;IAC3E,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,gFAAgF;IAChF,cAAc,CAAC,EAAE,OAAO,CAAA;CACpB,GAAG,cAAc,CA4GtB"}
|
package/dist/index.js
CHANGED
|
@@ -5920,7 +5920,8 @@ function useConnectors(options = {}) {
|
|
|
5920
5920
|
}, [call2, tenantId2, includeGrants, connection, nonce]);
|
|
5921
5921
|
const revokeGrant = React133__default.useCallback(
|
|
5922
5922
|
async (connector) => {
|
|
5923
|
-
|
|
5923
|
+
if (!tenantId2) throw new Error("Nenhuma conta selecionada.");
|
|
5924
|
+
const response = await call2(`/${connector.id}?tenantId=${encodeURIComponent(tenantId2)}`, { method: "DELETE" });
|
|
5924
5925
|
if (!response.ok) {
|
|
5925
5926
|
const body = await response.json().catch(() => ({}));
|
|
5926
5927
|
throw new Error(body.message ?? "N\xE3o foi poss\xEDvel desconectar.");
|
|
@@ -5928,7 +5929,7 @@ function useConnectors(options = {}) {
|
|
|
5928
5929
|
invalidateGrants();
|
|
5929
5930
|
setGrants((current2) => (current2 ?? []).filter((g) => g.id !== connector.id));
|
|
5930
5931
|
},
|
|
5931
|
-
[call2]
|
|
5932
|
+
[call2, tenantId2]
|
|
5932
5933
|
);
|
|
5933
5934
|
const waitingGrants = includeGrants && !!connection && !!tenantId2 && grants === null;
|
|
5934
5935
|
const connectors = React133__default.useMemo(() => {
|
|
@@ -10225,31 +10226,31 @@ function ConnectPanel({
|
|
|
10225
10226
|
const secretFieldCount = (def.fields ?? []).filter(isSecretField).length;
|
|
10226
10227
|
const hasStoredCredential = connector.state === "connected" || connector.state === "needs_setup";
|
|
10227
10228
|
const [formKey, setFormKey] = React133__default.useState(0);
|
|
10228
|
-
if (def.authKind === "oauth") {
|
|
10229
|
-
return /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
10230
|
-
/* @__PURE__ */ jsx(Note, { children: t("connectors.authorize.oauthOnly") }),
|
|
10231
|
-
/* @__PURE__ */ jsxs(
|
|
10232
|
-
Button,
|
|
10233
|
-
{
|
|
10234
|
-
disabled: busy === "oauth" || !def.startOAuth,
|
|
10235
|
-
onClick: () => run("oauth", async () => {
|
|
10236
|
-
const url = await def.startOAuth(window.location.href, { tenantId: tenantId2 });
|
|
10237
|
-
window.location.href = url;
|
|
10238
|
-
}),
|
|
10239
|
-
children: [
|
|
10240
|
-
busy === "oauth" ? /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx(Plug, { className: "h-4 w-4" }),
|
|
10241
|
-
`${t("connectors.connect")} ${def.name}`
|
|
10242
|
-
]
|
|
10243
|
-
}
|
|
10244
|
-
)
|
|
10245
|
-
] });
|
|
10246
|
-
}
|
|
10247
10229
|
const fields = def.fields ?? [];
|
|
10230
|
+
const oauthDoor = def.authKind === "oauth" ? /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
10231
|
+
/* @__PURE__ */ jsx(Note, { children: t(fields.length > 0 ? "connectors.authorize.oauthOrKey" : "connectors.authorize.oauthOnly") }),
|
|
10232
|
+
/* @__PURE__ */ jsxs(
|
|
10233
|
+
Button,
|
|
10234
|
+
{
|
|
10235
|
+
disabled: busy === "oauth" || !def.startOAuth,
|
|
10236
|
+
onClick: () => run("oauth", async () => {
|
|
10237
|
+
const url = await def.startOAuth(window.location.href, { tenantId: tenantId2 });
|
|
10238
|
+
window.location.href = url;
|
|
10239
|
+
}),
|
|
10240
|
+
children: [
|
|
10241
|
+
busy === "oauth" ? /* @__PURE__ */ jsx(Loader2, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsx(Plug, { className: "h-4 w-4" }),
|
|
10242
|
+
`${t("connectors.connect")} ${def.name}`
|
|
10243
|
+
]
|
|
10244
|
+
}
|
|
10245
|
+
)
|
|
10246
|
+
] }) : null;
|
|
10247
|
+
if (oauthDoor && fields.length === 0) return oauthDoor;
|
|
10248
10248
|
return /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
10249
|
+
oauthDoor,
|
|
10249
10250
|
/* @__PURE__ */ jsx(ProviderInstallStep, { connector: def }),
|
|
10250
10251
|
needsSink && /* @__PURE__ */ jsx(Note, { children: sinkMissing ? t("connectors.credentials.noSink") : t("connectors.credentials.held") }),
|
|
10251
10252
|
needsSink && !sinkMissing && secretFieldCount > 1 && hasStoredCredential && /* @__PURE__ */ jsx(Note, { children: t("connectors.credentials.replaces") }),
|
|
10252
|
-
fields.length === 0 && !def.providerInstall && /* @__PURE__ */ jsx(Note, { children: t("connectors.authorize.nothingToFill") }),
|
|
10253
|
+
fields.length === 0 && !def.providerInstall && !oauthDoor && /* @__PURE__ */ jsx(Note, { children: t("connectors.authorize.nothingToFill") }),
|
|
10253
10254
|
/* @__PURE__ */ jsx("div", { className: "grid gap-3 sm:grid-cols-2", children: fields.map(
|
|
10254
10255
|
(f) => isSecretField(f) ? /* @__PURE__ */ jsxs("label", { className: "block", children: [
|
|
10255
10256
|
/* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-muted-foreground", children: f.label }),
|