@burdenoff/microfe-integrations 2026.1030.1 → 2026.1102.2
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/global-types.d.ts +5717 -1663
- package/dist/generated/global-types.d.ts.map +1 -1
- package/dist/generated/wspace-operations.d.ts +675 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -1
- package/dist/generated/wspace-operations.js +322 -76
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +77378 -31802
- package/dist/generated/wspace-types.d.ts.map +1 -1
- package/dist/generated/wspace-types.js +11 -1
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/integrations/IntegrationsAdminRoutes.d.ts.map +1 -1
- package/dist/integrations/IntegrationsAdminRoutes.js +13 -9
- package/dist/integrations/IntegrationsAdminRoutes.js.map +1 -1
- package/dist/integrations/IntegrationsRoot.d.ts.map +1 -1
- package/dist/integrations/IntegrationsRoot.js +43 -36
- package/dist/integrations/IntegrationsRoot.js.map +1 -1
- package/dist/integrations/IntegrationsUserRoutes.d.ts.map +1 -1
- package/dist/integrations/IntegrationsUserRoutes.js +20 -12
- package/dist/integrations/IntegrationsUserRoutes.js.map +1 -1
- package/dist/integrations/components/ConnectorSubmissionCard.d.ts +16 -0
- package/dist/integrations/components/ConnectorSubmissionCard.d.ts.map +1 -0
- package/dist/integrations/components/ConnectorSubmissionCard.js +192 -0
- package/dist/integrations/components/ConnectorSubmissionCard.js.map +1 -0
- package/dist/integrations/components/ConnectorSubmissionPager.d.ts +22 -0
- package/dist/integrations/components/ConnectorSubmissionPager.d.ts.map +1 -0
- package/dist/integrations/components/ConnectorSubmissionPager.js +36 -0
- package/dist/integrations/components/ConnectorSubmissionPager.js.map +1 -0
- package/dist/integrations/hooks/useConnectorSubmissions.d.ts +47 -0
- package/dist/integrations/hooks/useConnectorSubmissions.d.ts.map +1 -0
- package/dist/integrations/hooks/useConnectorSubmissions.js +80 -0
- package/dist/integrations/hooks/useConnectorSubmissions.js.map +1 -0
- package/dist/integrations/hooks/useMailbox.d.ts +123 -0
- package/dist/integrations/hooks/useMailbox.d.ts.map +1 -0
- package/dist/integrations/hooks/useMailbox.js +87 -0
- package/dist/integrations/hooks/useMailbox.js.map +1 -0
- package/dist/integrations/pages/ConnectorReviewQueuePage.d.ts +7 -0
- package/dist/integrations/pages/ConnectorReviewQueuePage.d.ts.map +1 -0
- package/dist/integrations/pages/ConnectorReviewQueuePage.js +201 -0
- package/dist/integrations/pages/ConnectorReviewQueuePage.js.map +1 -0
- package/dist/integrations/pages/ConnectorSubmissionsPage.d.ts +6 -0
- package/dist/integrations/pages/ConnectorSubmissionsPage.d.ts.map +1 -0
- package/dist/integrations/pages/ConnectorSubmissionsPage.js +576 -0
- package/dist/integrations/pages/ConnectorSubmissionsPage.js.map +1 -0
- package/dist/integrations/pages/MailboxInbox.d.ts +7 -0
- package/dist/integrations/pages/MailboxInbox.d.ts.map +1 -0
- package/dist/integrations/pages/MailboxInbox.js +550 -0
- package/dist/integrations/pages/MailboxInbox.js.map +1 -0
- package/dist/integrations/pages/ProviderCatalog.d.ts.map +1 -1
- package/dist/integrations/pages/ProviderCatalog.js +157 -145
- package/dist/integrations/pages/ProviderCatalog.js.map +1 -1
- package/dist/integrations/pages/ProviderDetail.d.ts.map +1 -1
- package/dist/integrations/pages/ProviderDetail.js +15 -8
- package/dist/integrations/pages/ProviderDetail.js.map +1 -1
- package/dist/integrations/store/mailboxStore.d.ts +26 -0
- package/dist/integrations/store/mailboxStore.d.ts.map +1 -0
- package/dist/integrations/store/mailboxStore.js +52 -0
- package/dist/integrations/store/mailboxStore.js.map +1 -0
- package/dist/integrations/translations/en.d.ts +1 -0
- package/dist/integrations/translations/en.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMailbox.js","names":[],"sources":["../../../src/integrations/hooks/useMailbox.ts"],"sourcesContent":["/**\n * Connected mailbox hooks (BOFF-4422): the caller's own Gmail / Outlook\n * connections, a page of messages, one conversation, and send / mark read.\n */\nimport { useCallback } from 'react';\n\nimport { MailboxFolder } from '../../generated/wspace-types';\nimport type {\n MailboxAccountsQuery,\n MailboxMessagesQuery,\n MailboxThreadQuery,\n SendMailboxMessageMutation,\n} from '../../generated/wspace-operations';\nimport {\n useMailboxAccountsQuery,\n useMailboxMessagesQuery,\n useMailboxThreadQuery,\n useSendMailboxMessageMutation,\n useSetMailboxMessageReadMutation,\n} from '../../generated/wspace-operations';\nimport { useIntegrations } from '../providers/IntegrationsProvider';\n\nexport { MailboxFolder };\n\nexport const MAILBOX_PAGE_SIZE = 25;\n\n/*\n * The generated hooks reference result types through `Types.*`, which the\n * import-types preset does not emit into wspace-types.ts, so their `data` is\n * untyped. The operation result types below are generated in\n * wspace-operations.ts and pin the shapes this module hands to the page.\n */\nexport type MailboxAccount = MailboxAccountsQuery['mailboxAccounts'][number];\nexport type MailboxMessageSummary = MailboxMessagesQuery['mailboxMessages']['messages'][number];\nexport type MailboxThread = NonNullable<MailboxThreadQuery['mailboxThread']>;\nexport type MailboxSendResult = SendMailboxMessageMutation['sendMailboxMessage'];\n\nexport function useMailboxAccounts() {\n const { workspaceId } = useIntegrations();\n const { data, loading, error, refetch } = useMailboxAccountsQuery({\n skip: !workspaceId,\n errorPolicy: 'all',\n fetchPolicy: 'cache-and-network',\n });\n const typed = data as MailboxAccountsQuery | undefined;\n const accounts: MailboxAccount[] = typed?.mailboxAccounts ?? [];\n // True once the gateway has answered; a skipped query (no workspace yet)\n // must not read as \"no mailboxes connected\".\n const answered = typed?.mailboxAccounts !== undefined;\n return { accounts, answered, loading, error, refetch };\n}\n\nexport function useMailboxMessages(options: {\n connectionId: string | null;\n folder: MailboxFolder;\n query: string;\n pageToken: string | null;\n}) {\n const { connectionId, folder, query, pageToken } = options;\n const { data, loading, error, refetch } = useMailboxMessagesQuery({\n variables: {\n input: {\n connectionId: connectionId ?? '',\n folder,\n query: query || null,\n pageToken,\n limit: MAILBOX_PAGE_SIZE,\n },\n },\n skip: !connectionId,\n errorPolicy: 'none',\n fetchPolicy: 'network-only',\n });\n const typed = data as MailboxMessagesQuery | undefined;\n const messages: MailboxMessageSummary[] = typed?.mailboxMessages.messages ?? [];\n const nextPageToken: string | null = typed?.mailboxMessages.nextPageToken ?? null;\n return {\n messages,\n nextPageToken,\n loading,\n error,\n refetch,\n };\n}\n\nexport function useMailboxThread(connectionId: string | null, threadId: string | null) {\n const { data, loading, error, refetch } = useMailboxThreadQuery({\n variables: { connectionId: connectionId ?? '', threadId: threadId ?? '' },\n skip: !connectionId || !threadId,\n errorPolicy: 'none',\n fetchPolicy: 'network-only',\n });\n const thread: MailboxThread | null =\n (data as MailboxThreadQuery | undefined)?.mailboxThread ?? null;\n return { thread, loading, error, refetch };\n}\n\nexport interface SendMailInput {\n connectionId: string;\n to: string[];\n cc?: string[];\n subject?: string;\n bodyText: string;\n replyToMessageId?: string;\n}\n\nexport function useSendMail() {\n const [mutate, { loading }] = useSendMailboxMessageMutation();\n const send = useCallback(\n async (input: SendMailInput) => {\n const result = await mutate({\n variables: {\n input: {\n connectionId: input.connectionId,\n to: input.to,\n cc: input.cc ?? null,\n subject: input.subject ?? null,\n bodyText: input.bodyText,\n replyToMessageId: input.replyToMessageId ?? null,\n },\n },\n });\n const sent: MailboxSendResult | null =\n (result.data as SendMailboxMessageMutation | null | undefined)?.sendMailboxMessage ?? null;\n return sent;\n },\n [mutate]\n );\n return { send, sending: loading };\n}\n\nexport function useSetMailRead() {\n const [mutate] = useSetMailboxMessageReadMutation();\n return useCallback(\n async (connectionId: string, messageId: string, read: boolean) => {\n await mutate({ variables: { connectionId, messageId, read } });\n },\n [mutate]\n );\n}\n\n/**\n * Splits a recipient field on commas, semicolons and line breaks. Spaces are\n * not separators, so a pasted entry stays whole and the service validates it\n * as one address instead of receiving fragments of it.\n */\nexport function splitRecipients(value: string): string[] {\n return value\n .split(/[,;\\r\\n]+/)\n .map((part) => part.trim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,EACF,EACF,CAAC,EAEQ,MAAwD,sBAAsB,MAG1F,CAAC,EAAO,CACT;EACc,SAAS;EAAS;;AAGnC,SAAgB,IAAiB;CAC/B,IAAM,CAAC,KAAU,GAAkC;AACnD,QAAO,EACL,OAAO,GAAsB,GAAmB,MAAkB;AAChE,QAAM,EAAO,EAAE,WAAW;GAAE;GAAc;GAAW;GAAM,EAAE,CAAC;IAEhE,CAAC,EAAO,CACT;;AAQH,SAAgB,EAAgB,GAAyB;AACvD,QAAO,EACJ,MAAM,YAAY,CAClB,KAAK,MAAS,EAAK,MAAM,CAAC,CAC1B,OAAO,QAAQ"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Connector review queue (BOFF-4417), for platform reviewers in the admin
|
|
3
|
+
* console. Oldest pending first, so the queue is worked in service-level order.
|
|
4
|
+
* The service refuses every action here to anyone but a super admin.
|
|
5
|
+
*/
|
|
6
|
+
export declare function ConnectorReviewQueuePage(): import("react").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=ConnectorReviewQueuePage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectorReviewQueuePage.d.ts","sourceRoot":"","sources":["../../../src/integrations/pages/ConnectorReviewQueuePage.tsx"],"names":[],"mappings":"AA6BA;;;;GAIG;AACH,wBAAgB,wBAAwB,gCA0OvC"}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { useTr as e } from "../hooks/useTr.js";
|
|
2
|
+
import { cn as t } from "../utils/cn.js";
|
|
3
|
+
import { ConnectorSubmissionStatus as n } from "../../generated/wspace-types.js";
|
|
4
|
+
import { useConnectorReviewQueue as r, useReviewConnectorSubmission as i } from "../hooks/useConnectorSubmissions.js";
|
|
5
|
+
import { ConnectorSubmissionCard as a } from "../components/ConnectorSubmissionCard.js";
|
|
6
|
+
import { ConnectorSubmissionPager as o } from "../components/ConnectorSubmissionPager.js";
|
|
7
|
+
import { useId as s, useState as c } from "react";
|
|
8
|
+
import { Check as l, ClipboardCheck as u, Loader2 as d, Shield as f, X as p } from "lucide-react";
|
|
9
|
+
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
10
|
+
import { Button as _, IllustratedEmptyState as v, PagePurpose as y } from "@burdenoff/fe-libs/ui";
|
|
11
|
+
//#region src/integrations/pages/ConnectorReviewQueuePage.tsx
|
|
12
|
+
var b = [
|
|
13
|
+
[
|
|
14
|
+
n.PendingReview,
|
|
15
|
+
"integrations.connectorReview.filters.pending",
|
|
16
|
+
"Pending"
|
|
17
|
+
],
|
|
18
|
+
[
|
|
19
|
+
n.Approved,
|
|
20
|
+
"integrations.connectorReview.filters.approved",
|
|
21
|
+
"Approved"
|
|
22
|
+
],
|
|
23
|
+
[
|
|
24
|
+
n.Rejected,
|
|
25
|
+
"integrations.connectorReview.filters.rejected",
|
|
26
|
+
"Rejected"
|
|
27
|
+
],
|
|
28
|
+
[
|
|
29
|
+
null,
|
|
30
|
+
"integrations.connectorReview.filters.all",
|
|
31
|
+
"All"
|
|
32
|
+
]
|
|
33
|
+
];
|
|
34
|
+
function x() {
|
|
35
|
+
let x = e(), S = s(), [C, w] = c(n.PendingReview), [T, E] = c(null), [D, O] = c(""), [k, A] = c(""), [j, M] = c(0), { submissions: N, total: P, hasMore: F, stats: I, loading: L, error: R } = r(C, j), { approve: z, reject: B, loading: V } = i(), H = (e, t) => {
|
|
36
|
+
O(""), A(""), E({
|
|
37
|
+
submission: e,
|
|
38
|
+
kind: t
|
|
39
|
+
});
|
|
40
|
+
}, U = () => {
|
|
41
|
+
A(""), E(null);
|
|
42
|
+
}, W = (e) => {
|
|
43
|
+
w(e), M(0), U();
|
|
44
|
+
}, G = async () => {
|
|
45
|
+
if (T) {
|
|
46
|
+
A("");
|
|
47
|
+
try {
|
|
48
|
+
T.kind === "approve" ? await z(T.submission.id, D.trim() || null) : await B(T.submission.id, D.trim()), E(null);
|
|
49
|
+
} catch (e) {
|
|
50
|
+
A(e instanceof Error ? e.message : String(e));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
return /* @__PURE__ */ g("div", {
|
|
55
|
+
className: "space-y-6 p-4 sm:p-6 max-w-5xl mx-auto",
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ g("div", {
|
|
58
|
+
className: "rounded-xl border border-border-seam bg-accent-wash p-6 flex flex-wrap items-center gap-4",
|
|
59
|
+
children: [
|
|
60
|
+
/* @__PURE__ */ h("div", {
|
|
61
|
+
className: "p-2.5 rounded-lg bg-action-primary-bg/10",
|
|
62
|
+
children: /* @__PURE__ */ h(u, {
|
|
63
|
+
size: 24,
|
|
64
|
+
className: "text-primary"
|
|
65
|
+
})
|
|
66
|
+
}),
|
|
67
|
+
/* @__PURE__ */ g("div", {
|
|
68
|
+
className: "min-w-0 flex-1",
|
|
69
|
+
children: [/* @__PURE__ */ h("h1", {
|
|
70
|
+
className: "text-2xl font-bold text-text-primary",
|
|
71
|
+
children: x("integrations.connectorReview.title", "Connector reviews")
|
|
72
|
+
}), /* @__PURE__ */ h("p", {
|
|
73
|
+
className: "text-sm text-text-secondary mt-1",
|
|
74
|
+
children: x("integrations.connectorReview.subtitle", "Third-party connectors waiting to join the integrations catalog.")
|
|
75
|
+
})]
|
|
76
|
+
}),
|
|
77
|
+
I && /* @__PURE__ */ g("div", {
|
|
78
|
+
className: "flex gap-3 text-sm",
|
|
79
|
+
"aria-label": "Review stats",
|
|
80
|
+
children: [/* @__PURE__ */ h("span", {
|
|
81
|
+
className: "rounded-lg border border-border-seam bg-bg-surface px-3 py-1.5 text-text-primary",
|
|
82
|
+
children: x("integrations.connectorReview.stats.pending", "{{count}} pending", { count: I.pending })
|
|
83
|
+
}), /* @__PURE__ */ h("span", {
|
|
84
|
+
className: t("rounded-lg border border-border-seam px-3 py-1.5", I.overdue > 0 ? "bg-status-warning-bg-subtle text-status-warning-text" : "bg-bg-surface text-text-secondary"),
|
|
85
|
+
children: x("integrations.connectorReview.stats.overdue", "{{count}} overdue", { count: I.overdue })
|
|
86
|
+
})]
|
|
87
|
+
})
|
|
88
|
+
]
|
|
89
|
+
}),
|
|
90
|
+
/* @__PURE__ */ h(y, {
|
|
91
|
+
icon: /* @__PURE__ */ h(f, { size: 16 }),
|
|
92
|
+
children: x("integrations.connectorReview.purpose", "Check that each connector names a real public API it is entitled to publish, that its docs, privacy policy and support contact work, and that its credential placement matches the API docs. Approving installs it in the catalog for every workspace; you can disable or uninstall it later from Providers. Reject with a reason the developer can act on. Decide within five business days.")
|
|
93
|
+
}),
|
|
94
|
+
/* @__PURE__ */ h("div", {
|
|
95
|
+
className: "flex flex-wrap gap-2",
|
|
96
|
+
role: "group",
|
|
97
|
+
"aria-label": "Status filter",
|
|
98
|
+
children: b.map(([e, n, r]) => /* @__PURE__ */ h("button", {
|
|
99
|
+
type: "button",
|
|
100
|
+
"aria-pressed": C === e,
|
|
101
|
+
onClick: () => W(e),
|
|
102
|
+
className: t("rounded-lg border px-3 py-1.5 text-sm font-medium transition-colors", C === e ? "bg-action-primary-bg text-action-primary-text border-primary" : "bg-bg-surface text-text-primary border-border-subtle hover:bg-accent"),
|
|
103
|
+
children: x(n, r)
|
|
104
|
+
}, r))
|
|
105
|
+
}),
|
|
106
|
+
k && !T && /* @__PURE__ */ h("div", {
|
|
107
|
+
role: "alert",
|
|
108
|
+
className: "rounded-xl border border-border-seam bg-status-error-bg-subtle px-4 py-3 text-sm text-status-error-text",
|
|
109
|
+
children: k
|
|
110
|
+
}),
|
|
111
|
+
L && N.length === 0 ? /* @__PURE__ */ h("div", {
|
|
112
|
+
className: "flex justify-center py-10",
|
|
113
|
+
children: /* @__PURE__ */ h(d, {
|
|
114
|
+
size: 32,
|
|
115
|
+
className: "animate-spin text-primary"
|
|
116
|
+
})
|
|
117
|
+
}) : R && N.length === 0 ? /* @__PURE__ */ h("div", {
|
|
118
|
+
role: "alert",
|
|
119
|
+
className: "rounded-xl border border-border-seam bg-status-error-bg-subtle px-4 py-3 text-sm text-status-error-text",
|
|
120
|
+
children: R.message
|
|
121
|
+
}) : N.length === 0 ? /* @__PURE__ */ h(v, {
|
|
122
|
+
illustration: "empty-data",
|
|
123
|
+
title: x("integrations.connectorReview.empty.title", "Nothing to review"),
|
|
124
|
+
description: x("integrations.connectorReview.empty.description", "New connector submissions appear here.")
|
|
125
|
+
}) : /* @__PURE__ */ h("div", {
|
|
126
|
+
className: "space-y-3",
|
|
127
|
+
children: N.map((e) => /* @__PURE__ */ g("div", {
|
|
128
|
+
className: "space-y-2",
|
|
129
|
+
children: [/* @__PURE__ */ h(a, {
|
|
130
|
+
submission: e,
|
|
131
|
+
showPublisherContact: !0,
|
|
132
|
+
actions: e.status === n.PendingReview ? /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ g(_, {
|
|
133
|
+
size: "sm",
|
|
134
|
+
onClick: () => H(e, "approve"),
|
|
135
|
+
children: [/* @__PURE__ */ h(l, { size: 14 }), x("integrations.connectorReview.actions.approve", "Approve")]
|
|
136
|
+
}), /* @__PURE__ */ g(_, {
|
|
137
|
+
size: "sm",
|
|
138
|
+
variant: "ghost",
|
|
139
|
+
onClick: () => H(e, "reject"),
|
|
140
|
+
children: [/* @__PURE__ */ h(p, { size: 14 }), x("integrations.connectorReview.actions.reject", "Reject")]
|
|
141
|
+
})] }) : null
|
|
142
|
+
}), T?.submission.id === e.id && /* @__PURE__ */ g("div", {
|
|
143
|
+
className: "rounded-xl border border-border-seam bg-bg-surface p-4 space-y-3",
|
|
144
|
+
children: [
|
|
145
|
+
/* @__PURE__ */ h("label", {
|
|
146
|
+
htmlFor: S,
|
|
147
|
+
className: "block text-sm font-medium text-text-primary",
|
|
148
|
+
children: T.kind === "approve" ? x("integrations.connectorReview.decision.approveNotes", "Notes (optional)") : x("integrations.connectorReview.decision.rejectReason", "Reason the developer will see")
|
|
149
|
+
}),
|
|
150
|
+
/* @__PURE__ */ h("textarea", {
|
|
151
|
+
id: S,
|
|
152
|
+
value: D,
|
|
153
|
+
onChange: (e) => O(e.target.value),
|
|
154
|
+
rows: 3,
|
|
155
|
+
maxLength: 2e3,
|
|
156
|
+
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary"
|
|
157
|
+
}),
|
|
158
|
+
k && /* @__PURE__ */ h("p", {
|
|
159
|
+
role: "alert",
|
|
160
|
+
className: "text-sm text-status-error-text",
|
|
161
|
+
children: k
|
|
162
|
+
}),
|
|
163
|
+
/* @__PURE__ */ g("div", {
|
|
164
|
+
className: "flex flex-wrap justify-end gap-2",
|
|
165
|
+
children: [/* @__PURE__ */ h(_, {
|
|
166
|
+
variant: "ghost",
|
|
167
|
+
size: "sm",
|
|
168
|
+
onClick: U,
|
|
169
|
+
children: x("integrations.common.cancel", "Cancel")
|
|
170
|
+
}), /* @__PURE__ */ g(_, {
|
|
171
|
+
size: "sm",
|
|
172
|
+
onClick: G,
|
|
173
|
+
disabled: V || T.kind === "reject" && !D.trim(),
|
|
174
|
+
children: [V && /* @__PURE__ */ h(d, {
|
|
175
|
+
size: 14,
|
|
176
|
+
className: "animate-spin"
|
|
177
|
+
}), T.kind === "approve" ? x("integrations.connectorReview.decision.confirmApprove", "Approve and publish") : x("integrations.connectorReview.decision.confirmReject", "Reject submission")]
|
|
178
|
+
})]
|
|
179
|
+
})
|
|
180
|
+
]
|
|
181
|
+
})]
|
|
182
|
+
}, e.id))
|
|
183
|
+
}),
|
|
184
|
+
/* @__PURE__ */ h(o, {
|
|
185
|
+
offset: j,
|
|
186
|
+
count: N.length,
|
|
187
|
+
total: P,
|
|
188
|
+
hasMore: F,
|
|
189
|
+
pageSize: 25,
|
|
190
|
+
disabled: L,
|
|
191
|
+
onOffsetChange: (e) => {
|
|
192
|
+
U(), M(e);
|
|
193
|
+
}
|
|
194
|
+
})
|
|
195
|
+
]
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
//#endregion
|
|
199
|
+
export { x as ConnectorReviewQueuePage };
|
|
200
|
+
|
|
201
|
+
//# sourceMappingURL=ConnectorReviewQueuePage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectorReviewQueuePage.js","names":[],"sources":["../../../src/integrations/pages/ConnectorReviewQueuePage.tsx"],"sourcesContent":["import { useId, useState } from 'react';\nimport { Check, ClipboardCheck, Loader2, Shield, X } from 'lucide-react';\nimport { Button, IllustratedEmptyState, PagePurpose } from '@burdenoff/fe-libs/ui';\n\nimport { cn } from '../utils/cn';\nimport { useTr } from '../hooks/useTr';\nimport {\n CONNECTOR_SUBMISSION_PAGE_SIZE,\n type ConnectorSubmission,\n ConnectorSubmissionStatus,\n useConnectorReviewQueue,\n useReviewConnectorSubmission,\n} from '../hooks/useConnectorSubmissions';\nimport { ConnectorSubmissionCard } from '../components/ConnectorSubmissionCard';\nimport { ConnectorSubmissionPager } from '../components/ConnectorSubmissionPager';\n\ntype Decision = { submission: ConnectorSubmission; kind: 'approve' | 'reject' };\n\nconst FILTERS: [ConnectorSubmissionStatus | null, string, string][] = [\n [\n ConnectorSubmissionStatus.PendingReview,\n 'integrations.connectorReview.filters.pending',\n 'Pending',\n ],\n [ConnectorSubmissionStatus.Approved, 'integrations.connectorReview.filters.approved', 'Approved'],\n [ConnectorSubmissionStatus.Rejected, 'integrations.connectorReview.filters.rejected', 'Rejected'],\n [null, 'integrations.connectorReview.filters.all', 'All'],\n];\n\n/**\n * Connector review queue (BOFF-4417), for platform reviewers in the admin\n * console. Oldest pending first, so the queue is worked in service-level order.\n * The service refuses every action here to anyone but a super admin.\n */\nexport function ConnectorReviewQueuePage() {\n const tr = useTr();\n const notesId = useId();\n const [status, setStatus] = useState<ConnectorSubmissionStatus | null>(\n ConnectorSubmissionStatus.PendingReview\n );\n const [decision, setDecision] = useState<Decision | null>(null);\n const [notes, setNotes] = useState('');\n const [actionError, setActionError] = useState('');\n const [offset, setOffset] = useState(0);\n const { submissions, total, hasMore, stats, loading, error } = useConnectorReviewQueue(\n status,\n offset\n );\n const { approve, reject, loading: deciding } = useReviewConnectorSubmission();\n\n const openDecision = (submission: ConnectorSubmission, kind: Decision['kind']) => {\n setNotes('');\n setActionError('');\n setDecision({ submission, kind });\n };\n\n const closeDecision = () => {\n setActionError('');\n setDecision(null);\n };\n\n const changeStatus = (value: ConnectorSubmissionStatus | null) => {\n setStatus(value);\n setOffset(0);\n closeDecision();\n };\n\n const confirm = async () => {\n if (!decision) return;\n setActionError('');\n try {\n if (decision.kind === 'approve') {\n await approve(decision.submission.id, notes.trim() || null);\n } else {\n await reject(decision.submission.id, notes.trim());\n }\n setDecision(null);\n } catch (cause) {\n setActionError(cause instanceof Error ? cause.message : String(cause));\n }\n };\n\n return (\n <div className=\"space-y-6 p-4 sm:p-6 max-w-5xl mx-auto\">\n <div className=\"rounded-xl border border-border-seam bg-accent-wash p-6 flex flex-wrap items-center gap-4\">\n <div className=\"p-2.5 rounded-lg bg-action-primary-bg/10\">\n <ClipboardCheck size={24} className=\"text-primary\" />\n </div>\n <div className=\"min-w-0 flex-1\">\n <h1 className=\"text-2xl font-bold text-text-primary\">\n {tr('integrations.connectorReview.title', 'Connector reviews')}\n </h1>\n <p className=\"text-sm text-text-secondary mt-1\">\n {tr(\n 'integrations.connectorReview.subtitle',\n 'Third-party connectors waiting to join the integrations catalog.'\n )}\n </p>\n </div>\n {stats && (\n <div className=\"flex gap-3 text-sm\" aria-label=\"Review stats\">\n <span className=\"rounded-lg border border-border-seam bg-bg-surface px-3 py-1.5 text-text-primary\">\n {tr('integrations.connectorReview.stats.pending', '{{count}} pending', {\n count: stats.pending,\n })}\n </span>\n <span\n className={cn(\n 'rounded-lg border border-border-seam px-3 py-1.5',\n stats.overdue > 0\n ? 'bg-status-warning-bg-subtle text-status-warning-text'\n : 'bg-bg-surface text-text-secondary'\n )}\n >\n {tr('integrations.connectorReview.stats.overdue', '{{count}} overdue', {\n count: stats.overdue,\n })}\n </span>\n </div>\n )}\n </div>\n\n <PagePurpose icon={<Shield size={16} />}>\n {tr(\n 'integrations.connectorReview.purpose',\n 'Check that each connector names a real public API it is entitled to publish, that its docs, privacy policy and support contact work, and that its credential placement matches the API docs. Approving installs it in the catalog for every workspace; you can disable or uninstall it later from Providers. Reject with a reason the developer can act on. Decide within five business days.'\n )}\n </PagePurpose>\n\n <div className=\"flex flex-wrap gap-2\" role=\"group\" aria-label=\"Status filter\">\n {FILTERS.map(([value, key, fallback]) => (\n <button\n key={fallback}\n type=\"button\"\n aria-pressed={status === value}\n onClick={() => changeStatus(value)}\n className={cn(\n 'rounded-lg border px-3 py-1.5 text-sm font-medium transition-colors',\n status === value\n ? 'bg-action-primary-bg text-action-primary-text border-primary'\n : 'bg-bg-surface text-text-primary border-border-subtle hover:bg-accent'\n )}\n >\n {tr(key, fallback)}\n </button>\n ))}\n </div>\n\n {actionError && !decision && (\n <div\n role=\"alert\"\n className=\"rounded-xl border border-border-seam bg-status-error-bg-subtle px-4 py-3 text-sm text-status-error-text\"\n >\n {actionError}\n </div>\n )}\n\n {loading && submissions.length === 0 ? (\n <div className=\"flex justify-center py-10\">\n <Loader2 size={32} className=\"animate-spin text-primary\" />\n </div>\n ) : error && submissions.length === 0 ? (\n <div\n role=\"alert\"\n className=\"rounded-xl border border-border-seam bg-status-error-bg-subtle px-4 py-3 text-sm text-status-error-text\"\n >\n {error.message}\n </div>\n ) : submissions.length === 0 ? (\n <IllustratedEmptyState\n illustration=\"empty-data\"\n title={tr('integrations.connectorReview.empty.title', 'Nothing to review')}\n description={tr(\n 'integrations.connectorReview.empty.description',\n 'New connector submissions appear here.'\n )}\n />\n ) : (\n <div className=\"space-y-3\">\n {submissions.map((submission) => (\n <div key={submission.id} className=\"space-y-2\">\n <ConnectorSubmissionCard\n submission={submission}\n showPublisherContact\n actions={\n submission.status === ConnectorSubmissionStatus.PendingReview ? (\n <>\n <Button size=\"sm\" onClick={() => openDecision(submission, 'approve')}>\n <Check size={14} />\n {tr('integrations.connectorReview.actions.approve', 'Approve')}\n </Button>\n <Button\n size=\"sm\"\n variant=\"ghost\"\n onClick={() => openDecision(submission, 'reject')}\n >\n <X size={14} />\n {tr('integrations.connectorReview.actions.reject', 'Reject')}\n </Button>\n </>\n ) : null\n }\n />\n {decision?.submission.id === submission.id && (\n <div className=\"rounded-xl border border-border-seam bg-bg-surface p-4 space-y-3\">\n <label htmlFor={notesId} className=\"block text-sm font-medium text-text-primary\">\n {decision.kind === 'approve'\n ? tr('integrations.connectorReview.decision.approveNotes', 'Notes (optional)')\n : tr(\n 'integrations.connectorReview.decision.rejectReason',\n 'Reason the developer will see'\n )}\n </label>\n <textarea\n id={notesId}\n value={notes}\n onChange={(event) => setNotes(event.target.value)}\n rows={3}\n maxLength={2000}\n className=\"w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2.5 text-sm text-text-primary\"\n />\n {actionError && (\n <p role=\"alert\" className=\"text-sm text-status-error-text\">\n {actionError}\n </p>\n )}\n <div className=\"flex flex-wrap justify-end gap-2\">\n <Button variant=\"ghost\" size=\"sm\" onClick={closeDecision}>\n {tr('integrations.common.cancel', 'Cancel')}\n </Button>\n <Button\n size=\"sm\"\n onClick={confirm}\n disabled={deciding || (decision.kind === 'reject' && !notes.trim())}\n >\n {deciding && <Loader2 size={14} className=\"animate-spin\" />}\n {decision.kind === 'approve'\n ? tr(\n 'integrations.connectorReview.decision.confirmApprove',\n 'Approve and publish'\n )\n : tr(\n 'integrations.connectorReview.decision.confirmReject',\n 'Reject submission'\n )}\n </Button>\n </div>\n </div>\n )}\n </div>\n ))}\n </div>\n )}\n\n <ConnectorSubmissionPager\n offset={offset}\n count={submissions.length}\n total={total}\n hasMore={hasMore}\n pageSize={CONNECTOR_SUBMISSION_PAGE_SIZE}\n disabled={loading}\n onOffsetChange={(next) => {\n closeDecision();\n setOffset(next);\n }}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AAkBA,IAAM,IAAgE;CACpE;EACE,EAA0B;EAC1B;EACA;EACD;CACD;EAAC,EAA0B;EAAU;EAAiD;EAAW;CACjG;EAAC,EA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W,GAqEf,CACN;IACE,CAAA;GAGR,kBAAC,GAAD;IACU;IACR,OAAO,EAAY;IACZ;IACE;IACT,UAAA;IACA,UAAU;IACV,iBAAiB,MAAS;AAExB,KADA,GAAe,EACf,EAAU,EAAK;;IAEjB,CAAA;GACE"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Connector developer page (BOFF-4417): submit a third-party connector for the
|
|
3
|
+
* integrations catalog and follow each submission through review.
|
|
4
|
+
*/
|
|
5
|
+
export declare function ConnectorSubmissionsPage(): import("react").JSX.Element;
|
|
6
|
+
//# sourceMappingURL=ConnectorSubmissionsPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectorSubmissionsPage.d.ts","sourceRoot":"","sources":["../../../src/integrations/pages/ConnectorSubmissionsPage.tsx"],"names":[],"mappings":"AAmgBA;;;GAGG;AACH,wBAAgB,wBAAwB,gCA2JvC"}
|