@burdenoff/microfe-integrations 2026.1030.1 → 2026.1102.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.
Files changed (43) hide show
  1. package/dist/generated/global-types.d.ts +5717 -1663
  2. package/dist/generated/global-types.d.ts.map +1 -1
  3. package/dist/generated/wspace-operations.d.ts +440 -0
  4. package/dist/generated/wspace-operations.d.ts.map +1 -1
  5. package/dist/generated/wspace-operations.js +213 -84
  6. package/dist/generated/wspace-operations.js.map +1 -1
  7. package/dist/generated/wspace-types.d.ts +77378 -31802
  8. package/dist/generated/wspace-types.d.ts.map +1 -1
  9. package/dist/generated/wspace-types.js +9 -1
  10. package/dist/generated/wspace-types.js.map +1 -1
  11. package/dist/integrations/IntegrationsAdminRoutes.d.ts.map +1 -1
  12. package/dist/integrations/IntegrationsAdminRoutes.js +13 -9
  13. package/dist/integrations/IntegrationsAdminRoutes.js.map +1 -1
  14. package/dist/integrations/IntegrationsUserRoutes.d.ts.map +1 -1
  15. package/dist/integrations/IntegrationsUserRoutes.js +16 -12
  16. package/dist/integrations/IntegrationsUserRoutes.js.map +1 -1
  17. package/dist/integrations/components/ConnectorSubmissionCard.d.ts +16 -0
  18. package/dist/integrations/components/ConnectorSubmissionCard.d.ts.map +1 -0
  19. package/dist/integrations/components/ConnectorSubmissionCard.js +192 -0
  20. package/dist/integrations/components/ConnectorSubmissionCard.js.map +1 -0
  21. package/dist/integrations/components/ConnectorSubmissionPager.d.ts +22 -0
  22. package/dist/integrations/components/ConnectorSubmissionPager.d.ts.map +1 -0
  23. package/dist/integrations/components/ConnectorSubmissionPager.js +36 -0
  24. package/dist/integrations/components/ConnectorSubmissionPager.js.map +1 -0
  25. package/dist/integrations/hooks/useConnectorSubmissions.d.ts +47 -0
  26. package/dist/integrations/hooks/useConnectorSubmissions.d.ts.map +1 -0
  27. package/dist/integrations/hooks/useConnectorSubmissions.js +80 -0
  28. package/dist/integrations/hooks/useConnectorSubmissions.js.map +1 -0
  29. package/dist/integrations/pages/ConnectorReviewQueuePage.d.ts +7 -0
  30. package/dist/integrations/pages/ConnectorReviewQueuePage.d.ts.map +1 -0
  31. package/dist/integrations/pages/ConnectorReviewQueuePage.js +201 -0
  32. package/dist/integrations/pages/ConnectorReviewQueuePage.js.map +1 -0
  33. package/dist/integrations/pages/ConnectorSubmissionsPage.d.ts +6 -0
  34. package/dist/integrations/pages/ConnectorSubmissionsPage.d.ts.map +1 -0
  35. package/dist/integrations/pages/ConnectorSubmissionsPage.js +576 -0
  36. package/dist/integrations/pages/ConnectorSubmissionsPage.js.map +1 -0
  37. package/dist/integrations/pages/ProviderCatalog.d.ts.map +1 -1
  38. package/dist/integrations/pages/ProviderCatalog.js +157 -145
  39. package/dist/integrations/pages/ProviderCatalog.js.map +1 -1
  40. package/dist/integrations/pages/ProviderDetail.d.ts.map +1 -1
  41. package/dist/integrations/pages/ProviderDetail.js +15 -8
  42. package/dist/integrations/pages/ProviderDetail.js.map +1 -1
  43. package/package.json +1 -1
@@ -0,0 +1,80 @@
1
+ import { useApproveConnectorSubmissionMutation as e, useConnectorSubmissionsQuery as t, useMyConnectorSubmissionsQuery as n, useRejectConnectorSubmissionMutation as r, useSubmitConnectorMutation as i, useWithdrawConnectorSubmissionMutation as a } from "../../generated/wspace-operations.js";
2
+ import "../../generated/wspace-types.js";
3
+ import { useCallback as o } from "react";
4
+ var s = ["MyConnectorSubmissions", "ConnectorSubmissions"];
5
+ function c(e) {
6
+ return {
7
+ limit: 25,
8
+ offset: Math.max(0, Math.trunc(e))
9
+ };
10
+ }
11
+ function l(e = 0) {
12
+ let { data: t, dataState: r, loading: i, error: a, refetch: o } = n({
13
+ variables: { pagination: c(e) },
14
+ fetchPolicy: "cache-and-network",
15
+ errorPolicy: "all"
16
+ }), s = r === "complete" ? t : null;
17
+ return {
18
+ submissions: s?.myConnectorSubmissions.items ?? [],
19
+ total: s?.myConnectorSubmissions.total ?? 0,
20
+ hasMore: s?.myConnectorSubmissions.hasMore ?? !1,
21
+ loading: i,
22
+ error: a,
23
+ refetch: o
24
+ };
25
+ }
26
+ function u(e, n = 0) {
27
+ let { data: r, dataState: i, loading: a, error: o, refetch: s } = t({
28
+ variables: {
29
+ filter: e ? { status: e } : null,
30
+ pagination: c(n)
31
+ },
32
+ fetchPolicy: "cache-and-network",
33
+ errorPolicy: "all"
34
+ }), l = i === "complete" ? r : null;
35
+ return {
36
+ submissions: l?.connectorSubmissions.items ?? [],
37
+ total: l?.connectorSubmissions.total ?? 0,
38
+ hasMore: l?.connectorSubmissions.hasMore ?? !1,
39
+ stats: l?.connectorSubmissionReviewStats ?? null,
40
+ loading: a,
41
+ error: o,
42
+ refetch: s
43
+ };
44
+ }
45
+ function d() {
46
+ let [e, { loading: t }] = i({ refetchQueries: s });
47
+ return {
48
+ submitConnector: o(async (t) => (await e({ variables: { input: t } })).data?.submitConnector ?? null, [e]),
49
+ loading: t
50
+ };
51
+ }
52
+ function f() {
53
+ let [e, { loading: t }] = a({ refetchQueries: s });
54
+ return {
55
+ withdraw: o(async (t) => (await e({ variables: { id: t } })).data?.withdrawConnectorSubmission ?? null, [e]),
56
+ loading: t
57
+ };
58
+ }
59
+ function p() {
60
+ let [t, { loading: n }] = e({ refetchQueries: [
61
+ ...s,
62
+ "GetProviders",
63
+ "GetProviderCatalog"
64
+ ] }), [i, { loading: a }] = r({ refetchQueries: s });
65
+ return {
66
+ approve: o(async (e, n) => (await t({ variables: {
67
+ id: e,
68
+ notes: n
69
+ } })).data?.approveConnectorSubmission ?? null, [t]),
70
+ reject: o(async (e, t) => (await i({ variables: {
71
+ id: e,
72
+ reason: t
73
+ } })).data?.rejectConnectorSubmission ?? null, [i]),
74
+ loading: n || a
75
+ };
76
+ }
77
+ //#endregion
78
+ export { u as useConnectorReviewQueue, l as useMyConnectorSubmissions, p as useReviewConnectorSubmission, d as useSubmitConnector, f as useWithdrawConnectorSubmission };
79
+
80
+ //# sourceMappingURL=useConnectorSubmissions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useConnectorSubmissions.js","names":[],"sources":["../../../src/integrations/hooks/useConnectorSubmissions.ts"],"sourcesContent":["/**\n * Third-party connector submissions (BOFF-4417).\n *\n * Developers submit connectors for the integrations catalog and follow their\n * review; platform reviewers (super admins) work the review queue. The service\n * scopes the developer queries to the caller, so these hooks carry no ids.\n */\nimport { useCallback } from 'react';\n\nimport {\n type ConnectorSubmissionFieldsFragment,\n useApproveConnectorSubmissionMutation,\n useConnectorSubmissionsQuery,\n useMyConnectorSubmissionsQuery,\n useRejectConnectorSubmissionMutation,\n useSubmitConnectorMutation,\n useWithdrawConnectorSubmissionMutation,\n} from '../../generated/wspace-operations';\nimport { ConnectorSubmissionStatus, type SubmitConnectorInput } from '../../generated/wspace-types';\n\nexport type ConnectorSubmission = ConnectorSubmissionFieldsFragment;\nexport type ConnectorSubmissionInput = SubmitConnectorInput;\nexport { ConnectorSubmissionStatus };\n\n/** Rows per page. The service caps a page at 100. */\nexport const CONNECTOR_SUBMISSION_PAGE_SIZE = 25;\nconst REFETCH = ['MyConnectorSubmissions', 'ConnectorSubmissions'];\n\nfunction page(offset: number) {\n return { limit: CONNECTOR_SUBMISSION_PAGE_SIZE, offset: Math.max(0, Math.trunc(offset)) };\n}\n\n/** One page of the caller's own submissions, newest first. */\nexport function useMyConnectorSubmissions(offset = 0) {\n const { data, dataState, loading, error, refetch } = useMyConnectorSubmissionsQuery({\n variables: { pagination: page(offset) },\n fetchPolicy: 'cache-and-network',\n errorPolicy: 'all',\n });\n // Only a complete result carries fully typed rows; partial data (an error\n // with errorPolicy 'all') is treated as empty so the page shows the error.\n const complete = dataState === 'complete' ? data : null;\n const submissions: ConnectorSubmission[] = complete?.myConnectorSubmissions.items ?? [];\n return {\n submissions,\n total: complete?.myConnectorSubmissions.total ?? 0,\n hasMore: complete?.myConnectorSubmissions.hasMore ?? false,\n loading,\n error,\n refetch,\n };\n}\n\n/** One page of the review queue (oldest first) and its counters. Super admins only. */\nexport function useConnectorReviewQueue(status: ConnectorSubmissionStatus | null, offset = 0) {\n const { data, dataState, loading, error, refetch } = useConnectorSubmissionsQuery({\n variables: { filter: status ? { status } : null, pagination: page(offset) },\n fetchPolicy: 'cache-and-network',\n errorPolicy: 'all',\n });\n const complete = dataState === 'complete' ? data : null;\n const submissions: ConnectorSubmission[] = complete?.connectorSubmissions.items ?? [];\n return {\n submissions,\n total: complete?.connectorSubmissions.total ?? 0,\n hasMore: complete?.connectorSubmissions.hasMore ?? false,\n stats: complete?.connectorSubmissionReviewStats ?? null,\n loading,\n error,\n refetch,\n };\n}\n\nexport function useSubmitConnector() {\n const [mutate, { loading }] = useSubmitConnectorMutation({ refetchQueries: REFETCH });\n const submitConnector = useCallback(\n async (input: SubmitConnectorInput) => {\n const result = await mutate({ variables: { input } });\n return result.data?.submitConnector ?? null;\n },\n [mutate]\n );\n return { submitConnector, loading };\n}\n\nexport function useWithdrawConnectorSubmission() {\n const [mutate, { loading }] = useWithdrawConnectorSubmissionMutation({\n refetchQueries: REFETCH,\n });\n const withdraw = useCallback(\n async (id: string) => {\n const result = await mutate({ variables: { id } });\n return result.data?.withdrawConnectorSubmission ?? null;\n },\n [mutate]\n );\n return { withdraw, loading };\n}\n\nexport function useReviewConnectorSubmission() {\n const [approveMutation, { loading: approving }] = useApproveConnectorSubmissionMutation({\n refetchQueries: [...REFETCH, 'GetProviders', 'GetProviderCatalog'],\n });\n const [rejectMutation, { loading: rejecting }] = useRejectConnectorSubmissionMutation({\n refetchQueries: REFETCH,\n });\n const approve = useCallback(\n async (id: string, notes: string | null) => {\n const result = await approveMutation({ variables: { id, notes } });\n return result.data?.approveConnectorSubmission ?? null;\n },\n [approveMutation]\n );\n const reject = useCallback(\n async (id: string, reason: string) => {\n const result = await rejectMutation({ variables: { id, reason } });\n return result.data?.rejectConnectorSubmission ?? null;\n },\n [rejectMutation]\n );\n return { approve, reject, loading: approving || rejecting };\n}\n"],"mappings":";;;AA0BA,IAAM,IAAU,CAAC,0BAA0B,u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AAO,OACU,MAAM,EAAO,EAAE,WAAW,EAAE,OAAI,EAAE,CAAC,EACpC,MAAM,+BAA+B,MAErD,CAAC,EAAO,CACT;EACkB;EAAS;;AAG9B,SAAgB,IAA+B;CAC7C,IAAM,CAAC,GAAiB,EAAE,SAAS,OAAe,EAAsC,EACtF,gBAAgB;EAAC,GAAG;EAAS;EAAgB;EAAqB,EACnE,CAAC,EACI,CAAC,GAAgB,EAAE,SAAS,OAAe,EAAqC,EACpF,gBAAgB,GACjB,CAAC;AAeF,QAAO;EAAE,SAdO,EACd,OAAO,GAAY,OACF,MAAM,EAAgB,EAAE,WAAW;GAAE;GAAI;GAAO,EAAE,CAAC,EACpD,MAAM,8BAA8B,MAEpD,CAAC,EAAgB,CAClB;EAQiB,QAPH,EACb,OAAO,GAAY,OACF,MAAM,EAAe,EAAE,WAAW;GAAE;GAAI;GAAQ,EAAE,CAAC,EACpD,MAAM,6BAA6B,MAEnD,CAAC,EAAe,CACjB;EACyB,SAAS,KAAa;EAAW"}
@@ -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,EAA0B;EAAU;EAAiD;EAAW;CACjG;EAAC;EAAM;EAA4C;EAAM;CAC1D;AAO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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"}