@asteby/metacore-runtime-react 53.4.1 → 53.6.0

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 (68) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +73 -0
  3. package/dist/index.d.ts +2 -0
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +4 -0
  6. package/dist/setup/addon-config-surface.d.ts +119 -0
  7. package/dist/setup/addon-config-surface.d.ts.map +1 -0
  8. package/dist/setup/addon-config-surface.js +662 -0
  9. package/dist/setup/connector-blocks-model.d.ts +79 -0
  10. package/dist/setup/connector-blocks-model.d.ts.map +1 -0
  11. package/dist/setup/connector-blocks-model.js +96 -0
  12. package/dist/setup/connector-blocks.d.ts +48 -0
  13. package/dist/setup/connector-blocks.d.ts.map +1 -0
  14. package/dist/setup/connector-blocks.js +132 -0
  15. package/dist/setup/connector-form-model.d.ts +40 -0
  16. package/dist/setup/connector-form-model.d.ts.map +1 -0
  17. package/dist/setup/connector-form-model.js +76 -0
  18. package/dist/setup/flow-model.d.ts +49 -0
  19. package/dist/setup/flow-model.d.ts.map +1 -0
  20. package/dist/setup/flow-model.js +124 -0
  21. package/dist/setup/health-card.d.ts +25 -0
  22. package/dist/setup/health-card.d.ts.map +1 -0
  23. package/dist/setup/health-card.js +21 -0
  24. package/dist/setup/index.d.ts +13 -0
  25. package/dist/setup/index.d.ts.map +1 -0
  26. package/dist/setup/index.js +15 -0
  27. package/dist/setup/messages.d.ts +15 -0
  28. package/dist/setup/messages.d.ts.map +1 -0
  29. package/dist/setup/messages.js +320 -0
  30. package/dist/setup/records-table.d.ts +24 -0
  31. package/dist/setup/records-table.d.ts.map +1 -0
  32. package/dist/setup/records-table.js +80 -0
  33. package/dist/setup/setup-flow.d.ts +30 -0
  34. package/dist/setup/setup-flow.d.ts.map +1 -0
  35. package/dist/setup/setup-flow.js +277 -0
  36. package/dist/setup/setup-form-step.d.ts +20 -0
  37. package/dist/setup/setup-form-step.d.ts.map +1 -0
  38. package/dist/setup/setup-form-step.js +173 -0
  39. package/dist/setup/step-status-badge.d.ts +12 -0
  40. package/dist/setup/step-status-badge.d.ts.map +1 -0
  41. package/dist/setup/step-status-badge.js +21 -0
  42. package/dist/setup/tone.d.ts +8 -0
  43. package/dist/setup/tone.d.ts.map +1 -0
  44. package/dist/setup/tone.js +33 -0
  45. package/dist/setup/types.d.ts +130 -0
  46. package/dist/setup/types.d.ts.map +1 -0
  47. package/dist/setup/types.js +1 -0
  48. package/package.json +9 -5
  49. package/src/__tests__/addon-config-surface.test.tsx +260 -0
  50. package/src/__tests__/connector-blocks.test.tsx +302 -0
  51. package/src/__tests__/setup-components.test.tsx +147 -0
  52. package/src/__tests__/setup-flow-model.test.ts +117 -0
  53. package/src/__tests__/setup-flow.test.tsx +424 -0
  54. package/src/index.ts +29 -0
  55. package/src/setup/addon-config-surface.tsx +1426 -0
  56. package/src/setup/connector-blocks-model.ts +163 -0
  57. package/src/setup/connector-blocks.tsx +341 -0
  58. package/src/setup/connector-form-model.ts +115 -0
  59. package/src/setup/flow-model.ts +156 -0
  60. package/src/setup/health-card.tsx +131 -0
  61. package/src/setup/index.ts +35 -0
  62. package/src/setup/messages.ts +334 -0
  63. package/src/setup/records-table.tsx +186 -0
  64. package/src/setup/setup-flow.tsx +562 -0
  65. package/src/setup/setup-form-step.tsx +342 -0
  66. package/src/setup/step-status-badge.tsx +47 -0
  67. package/src/setup/tone.ts +44 -0
  68. package/src/setup/types.ts +147 -0
@@ -0,0 +1,79 @@
1
+ import type { StepStatus } from './types';
2
+ export type ConnectorBlockKind = 'webhook_url' | 'instructions' | 'action';
3
+ export interface ConnectorBlockLink {
4
+ label: string;
5
+ url: string;
6
+ }
7
+ /** One non-input element of a connector setup step, as the host serves it. */
8
+ export interface ConnectorFormBlock {
9
+ key: string;
10
+ kind: ConnectorBlockKind | string;
11
+ title?: string;
12
+ description?: string;
13
+ /** kind=webhook_url: webhooks[].key (the host fills `value`). */
14
+ webhook?: string;
15
+ links?: ConnectorBlockLink[];
16
+ /** kind=action: wasm export the host runs. */
17
+ export?: string;
18
+ /** kind=action: button text (literal or i18n key). */
19
+ label?: string;
20
+ /** Host-computed value (kind=webhook_url: the org's absolute URL). */
21
+ value?: string;
22
+ }
23
+ export type BlockDetailKind = 'text' | 'id' | 'url';
24
+ export interface BlockResultDetail {
25
+ key?: string;
26
+ label?: string;
27
+ value: string;
28
+ kind?: BlockDetailKind | string;
29
+ }
30
+ /** Normalized outcome of an action block run. */
31
+ export interface BlockResult {
32
+ status: StepStatus;
33
+ message: string;
34
+ details: BlockResultDetail[];
35
+ }
36
+ /** Only absolute https URLs are ever turned into links. */
37
+ export declare function safeHttpsUrl(raw: unknown): string | null;
38
+ /**
39
+ * Reads what an action export (or a connector test_export) answered. Accepts
40
+ * the kernel envelope `{success, data, error}` or a bare `data`. Never invents
41
+ * success: anything without an explicit ok/ok-status is an error.
42
+ */
43
+ export declare function normalizeBlockResult(raw: unknown, fallbackError?: string): BlockResult;
44
+ /** Message of a failed HTTP call (axios-like error), or the fallback. */
45
+ export declare function errorMessage(err: unknown, fallback: string): string;
46
+ export interface WizardSectionInput {
47
+ key: string;
48
+ title?: string;
49
+ description?: string;
50
+ blocks?: ConnectorFormBlock[];
51
+ }
52
+ export interface WizardStep {
53
+ key: string;
54
+ title?: string;
55
+ description?: string;
56
+ kind: 'creds' | 'settings';
57
+ blocks: ConnectorFormBlock[];
58
+ }
59
+ /**
60
+ * Wizard steps of a connector form_layout: every section that has fields OR
61
+ * blocks (a step that only shows the webhook URL and a test is a real step),
62
+ * plus a final "Ajustes" step when the addon ships settings.
63
+ */
64
+ export declare function buildWizardSteps(sections: WizardSectionInput[], fieldSections: (string | undefined)[], hasSettings: boolean, settingsTitle?: string): WizardStep[];
65
+ /** Whether an explicit action block already runs the connector's test_export. */
66
+ export declare function hasExplicitTest(sections: WizardSectionInput[], testExport?: string): boolean;
67
+ /**
68
+ * Status of a wizard step for the stepper: an error (failed field or action)
69
+ * wins; then a finished verification; then "visited".
70
+ */
71
+ export declare function stepStatus(opts: {
72
+ index: number;
73
+ current: number;
74
+ fieldKeys: string[];
75
+ fieldErrors: Record<string, string>;
76
+ blockKeys: string[];
77
+ results: Record<string, BlockResult | undefined>;
78
+ }): StepStatus;
79
+ //# sourceMappingURL=connector-blocks-model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connector-blocks-model.d.ts","sourceRoot":"","sources":["../../src/setup/connector-blocks-model.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEzC,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG,cAAc,GAAG,QAAQ,CAAA;AAE1E,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,8EAA8E;AAC9E,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,kBAAkB,GAAG,MAAM,CAAA;IACjC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,iEAAiE;IACjE,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,KAAK,CAAC,EAAE,kBAAkB,EAAE,CAAA;IAC5B,8CAA8C;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,sDAAsD;IACtD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,sEAAsE;IACtE,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,IAAI,GAAG,KAAK,CAAA;AAEnD,MAAM,WAAW,iBAAiB;IAChC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,eAAe,GAAG,MAAM,CAAA;CAChC;AA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M,CAAA;IACf,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACnC,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,SAAS,CAAC,CAAA;CACjD,GAAG,UAAU,CASb"}
@@ -0,0 +1,96 @@
1
+ const STATUSES = ['pending', 'running', 'ok', 'warn', 'error', 'blocked'];
2
+ /** Only absolute https URLs are ever turned into links. */
3
+ export function safeHttpsUrl(raw) {
4
+ if (typeof raw !== 'string')
5
+ return null;
6
+ try {
7
+ const u = new URL(raw);
8
+ if (u.protocol !== 'https:' || !u.host || u.username || u.password)
9
+ return null;
10
+ return u.toString();
11
+ }
12
+ catch {
13
+ return null;
14
+ }
15
+ }
16
+ /**
17
+ * Reads what an action export (or a connector test_export) answered. Accepts
18
+ * the kernel envelope `{success, data, error}` or a bare `data`. Never invents
19
+ * success: anything without an explicit ok/ok-status is an error.
20
+ */
21
+ export function normalizeBlockResult(raw, fallbackError = '') {
22
+ const env = (raw ?? {});
23
+ const hasEnvelope = 'success' in env || 'data' in env || 'error' in env;
24
+ if (hasEnvelope && env.success === false) {
25
+ const msg = env.error?.message ?? env.message ?? fallbackError;
26
+ return { status: 'error', message: String(msg ?? ''), details: [] };
27
+ }
28
+ const data = ((hasEnvelope ? env.data : env) ?? {});
29
+ let status;
30
+ if (typeof data.status === 'string' && STATUSES.includes(data.status)) {
31
+ status = data.status;
32
+ }
33
+ else {
34
+ status = data.ok === true ? 'ok' : 'error';
35
+ }
36
+ // An explicit ok:false wins over a status that claims success.
37
+ if (data.ok === false && (status === 'ok' || status === 'warn'))
38
+ status = 'error';
39
+ const details = Array.isArray(data.details)
40
+ ? data.details
41
+ .filter((d) => d && (typeof d.value === 'string' || typeof d.value === 'number'))
42
+ .slice(0, 12)
43
+ .map((d) => ({
44
+ key: typeof d.key === 'string' ? d.key : undefined,
45
+ label: typeof d.label === 'string' ? d.label : undefined,
46
+ value: String(d.value),
47
+ kind: d.kind === 'id' || d.kind === 'url' ? d.kind : 'text',
48
+ }))
49
+ : [];
50
+ const message = typeof data.message === 'string' && data.message ? data.message : status === 'error' ? fallbackError : '';
51
+ return { status, message, details };
52
+ }
53
+ /** Message of a failed HTTP call (axios-like error), or the fallback. */
54
+ export function errorMessage(err, fallback) {
55
+ const e = err;
56
+ return e?.response?.data?.message || e?.response?.data?.error?.message || fallback;
57
+ }
58
+ /**
59
+ * Wizard steps of a connector form_layout: every section that has fields OR
60
+ * blocks (a step that only shows the webhook URL and a test is a real step),
61
+ * plus a final "Ajustes" step when the addon ships settings.
62
+ */
63
+ export function buildWizardSteps(sections, fieldSections, hasSettings, settingsTitle = 'installed_addons.section_settings') {
64
+ const withFields = new Set(fieldSections.filter(Boolean));
65
+ const steps = sections
66
+ .filter((s) => withFields.has(s.key) || (s.blocks?.length ?? 0) > 0)
67
+ .map((s) => ({ key: s.key, title: s.title, description: s.description, kind: 'creds', blocks: s.blocks ?? [] }));
68
+ if (hasSettings)
69
+ steps.push({ key: '__settings', title: settingsTitle, kind: 'settings', blocks: [] });
70
+ return steps;
71
+ }
72
+ /** Whether an explicit action block already runs the connector's test_export. */
73
+ export function hasExplicitTest(sections, testExport) {
74
+ if (!testExport)
75
+ return false;
76
+ return sections.some((s) => (s.blocks ?? []).some((b) => b.kind === 'action' && b.export === testExport));
77
+ }
78
+ /**
79
+ * Status of a wizard step for the stepper: an error (failed field or action)
80
+ * wins; then a finished verification; then "visited".
81
+ */
82
+ export function stepStatus(opts) {
83
+ const { index, current, fieldKeys, fieldErrors, blockKeys, results } = opts;
84
+ if (fieldKeys.some((k) => !!fieldErrors[k]))
85
+ return 'error';
86
+ const rs = blockKeys.map((k) => results[k]).filter(Boolean);
87
+ if (rs.some((r) => r.status === 'error' || r.status === 'blocked'))
88
+ return 'error';
89
+ if (rs.some((r) => r.status === 'warn'))
90
+ return 'warn';
91
+ if (rs.length > 0 && rs.every((r) => r.status === 'ok'))
92
+ return 'ok';
93
+ if (index < current)
94
+ return 'ok';
95
+ return 'pending';
96
+ }
@@ -0,0 +1,48 @@
1
+ import { type BlockResult, type ConnectorFormBlock } from './connector-blocks-model';
2
+ /** Long help is clamped to 3 lines with a "Ver más" toggle: never cut for good. */
3
+ export declare function HelpText({ text, id, className, clampAt, }: {
4
+ text: string;
5
+ id?: string;
6
+ className?: string;
7
+ /** Characters above which the text starts collapsed. */
8
+ clampAt?: number;
9
+ }): import("react").JSX.Element | null;
10
+ /** A read-only value (wraps, never truncates) with a 44px Copy button. */
11
+ export declare function CopyValue({ value, label, mono }: {
12
+ value: string;
13
+ label: string;
14
+ mono?: boolean;
15
+ }): import("react").JSX.Element;
16
+ export declare function WebhookUrlBlock({ block }: {
17
+ block: ConnectorFormBlock;
18
+ }): import("react").JSX.Element;
19
+ export declare function InstructionsBlock({ block }: {
20
+ block: ConnectorFormBlock;
21
+ }): import("react").JSX.Element;
22
+ export interface ActionBlockProps {
23
+ block: ConnectorFormBlock;
24
+ /** Runs the action; resolves to the normalized result (never throws). */
25
+ run: () => Promise<BlockResult>;
26
+ result?: BlockResult;
27
+ onResult?: (r: BlockResult) => void;
28
+ disabled?: boolean;
29
+ /** Shown under the button (e.g. "Se guardarán tus cambios antes de probar"). */
30
+ note?: string;
31
+ }
32
+ export declare function ActionBlock({ block, run, result, onResult, disabled, note }: ActionBlockProps): import("react").JSX.Element;
33
+ export declare function BlockResultView({ result }: {
34
+ result: BlockResult;
35
+ }): import("react").JSX.Element;
36
+ export interface ConnectorBlocksProps {
37
+ blocks: ConnectorFormBlock[];
38
+ /** Runs an action block by key. */
39
+ runAction: (block: ConnectorFormBlock) => Promise<BlockResult>;
40
+ results?: Record<string, BlockResult | undefined>;
41
+ onResult?: (key: string, r: BlockResult) => void;
42
+ /** Disables actions (e.g. the viewer may not run them). */
43
+ actionsDisabled?: boolean;
44
+ actionNote?: string;
45
+ }
46
+ /** Renders a step's blocks in declared order; unknown kinds are skipped. */
47
+ export declare function ConnectorBlocks({ blocks, runAction, results, onResult, actionsDisabled, actionNote }: ConnectorBlocksProps): import("react").JSX.Element | null;
48
+ //# sourceMappingURL=connector-blocks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connector-blocks.d.ts","sourceRoot":"","sources":["../../src/setup/connector-blocks.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAgB,KAAK,WAAW,EAAE,KAAK,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAmBlG,mFAAmF;AACnF,wBAAgB,QAAQ,CAAC,EACvB,IAAI,EACJ,EAAE,EACF,SAAS,EACT,OAAa,GACd,EAAE;IACD,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,sCA+BA;AAGD,0EAA0E;AAC1E,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,IAAW,EAAE,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,+BAwCxG;AAmCD,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,kBAAkB,CAAA;CAAE,+BAkBvE;AAGD,wBAAgB,iBAAiB,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,kBAAkB,CAAA;CAAE,+BAQzE;AAGD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,kBAAkB,CAAA;IACzB,yEAAyE;IACzE,GAAG,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,CAAA;IAC/B,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,WAAW,KAAK,IAAI,CAAA;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,gFAAgF;IAChF,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,gBAAgB,+BAmD7F;AAED,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,+BAyClE;AAGD,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,kBAAkB,EAAE,CAAA;IAC5B,mCAAmC;IACnC,SAAS,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,OAAO,CAAC,WAAW,CAAC,CAAA;IAC9D,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,GAAG,SAAS,CAAC,CAAA;IACjD,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE,WAAW,KAAK,IAAI,CAAA;IAChD,2DAA2D;IAC3D,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,4EAA4E;AAC5E,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,UAAU,EAAE,EAAE,oBAAoB,sCA4B1H"}
@@ -0,0 +1,132 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // Connector setup blocks: what a step of the "Configurar <addon>" wizard shows
3
+ // besides inputs. Declared by the addon manifest (kernel
4
+ // connectors[].form_layout.sections[].blocks), computed / run by the host, and
5
+ // rendered here the same for every addon:
6
+ // • webhook_url — the org's webhook URL, read-only, with Copy + links
7
+ // • instructions — help text (expandable) + https links to the provider
8
+ // • action — a verification button with a live, structured result
9
+ // Plus the small building blocks the wizard reuses: HelpText (long help never
10
+ // gets cut: it expands) and CopyValue.
11
+ import { useCallback, useEffect, useId, useRef, useState } from 'react';
12
+ import { useTranslation } from 'react-i18next';
13
+ import { Check, Copy, ExternalLink, Loader2, Play, RotateCcw } from 'lucide-react';
14
+ import { Button } from '@asteby/metacore-ui/primitives';
15
+ import { cn } from '@asteby/metacore-ui/lib';
16
+ import { useSetupT } from './messages';
17
+ import { copyText } from './records-table';
18
+ import { StepStatusBadge } from './step-status-badge';
19
+ import { STEP_TONE, TONE_BADGE } from './tone';
20
+ import { textOrFallback } from './connector-form-model';
21
+ import { safeHttpsUrl } from './connector-blocks-model';
22
+ /** Resolves an addon i18n key (or literal); never paints a raw dotted key. */
23
+ function useAddonText() {
24
+ const { t } = useTranslation();
25
+ return useCallback((key, fallback = '') => {
26
+ if (!key)
27
+ return fallback;
28
+ const out = t(key, { defaultValue: '' });
29
+ const resolved = textOrFallback(out, key, '');
30
+ if (resolved)
31
+ return resolved;
32
+ // A literal sentence (has spaces, no dots-only shape) is shown as is.
33
+ return /\s/.test(key) || !key.includes('.') ? key : fallback;
34
+ }, [t]);
35
+ }
36
+ // ─── HelpText ────────────────────────────────────────────────────────────────
37
+ /** Long help is clamped to 3 lines with a "Ver más" toggle: never cut for good. */
38
+ export function HelpText({ text, id, className, clampAt = 160, }) {
39
+ const st = useSetupT();
40
+ const [open, setOpen] = useState(false);
41
+ const autoId = useId();
42
+ const bodyId = id ?? `${autoId}-help`;
43
+ if (!text)
44
+ return null;
45
+ const long = text.length > clampAt;
46
+ return (_jsxs("div", { className: cn('flex flex-col items-start gap-0.5', className), children: [_jsx("p", { id: bodyId, className: cn('text-xs leading-relaxed whitespace-pre-line break-words text-muted-foreground', long && !open && 'line-clamp-3'), children: text }), long ? (_jsx("button", { type: 'button', className: 'inline-flex min-h-11 items-center text-xs font-medium text-primary underline-offset-2 hover:underline focus-visible:outline-2 focus-visible:outline-ring sm:min-h-6', "aria-expanded": open, "aria-controls": bodyId, onClick: () => setOpen((v) => !v), children: open ? st('blocks.less') : st('blocks.more') })) : null] }));
47
+ }
48
+ // ─── CopyValue ───────────────────────────────────────────────────────────────
49
+ /** A read-only value (wraps, never truncates) with a 44px Copy button. */
50
+ export function CopyValue({ value, label, mono = true }) {
51
+ const st = useSetupT();
52
+ const [state, setState] = useState('idle');
53
+ const timer = useRef(undefined);
54
+ useEffect(() => () => clearTimeout(timer.current), []);
55
+ const onCopy = async () => {
56
+ const ok = await copyText(value);
57
+ setState(ok ? 'copied' : 'failed');
58
+ clearTimeout(timer.current);
59
+ timer.current = setTimeout(() => setState('idle'), 2500);
60
+ };
61
+ return (_jsxs("div", { className: 'flex flex-col gap-1', children: [_jsxs("div", { className: 'flex items-stretch gap-2', children: [_jsx("output", { "aria-label": label, className: cn('min-w-0 flex-1 rounded-md border bg-muted/50 px-3 py-2.5 text-sm break-all select-all', mono && 'font-mono text-[13px]'), children: value }), _jsxs(Button, { type: 'button', variant: 'outline', className: 'h-auto min-h-11 shrink-0 gap-1.5 px-3', onClick: onCopy, "aria-label": st('blocks.copy_label', { what: label }), children: [state === 'copied' ? _jsx(Check, { "aria-hidden": 'true', className: 'h-4 w-4' }) : _jsx(Copy, { "aria-hidden": 'true', className: 'h-4 w-4' }), _jsx("span", { className: 'hidden sm:inline', children: state === 'copied' ? st('records.copied') : st('records.copy') })] })] }), _jsx("p", { className: 'sr-only', role: 'status', "aria-live": 'polite', children: state === 'copied' ? st('records.copied') : state === 'failed' ? st('records.copy_failed') : '' }), state === 'failed' ? _jsx("p", { className: 'text-xs text-destructive', children: st('records.copy_failed') }) : null] }));
62
+ }
63
+ function BlockLinks({ links }) {
64
+ const tx = useAddonText();
65
+ const safe = (links ?? []).map((l) => ({ ...l, href: safeHttpsUrl(l.url) })).filter((l) => !!l.href);
66
+ if (safe.length === 0)
67
+ return null;
68
+ return (_jsx("ul", { className: 'flex flex-wrap gap-x-4 gap-y-1', children: safe.map((l) => (_jsx("li", { children: _jsxs("a", { href: l.href, target: '_blank', rel: 'noopener noreferrer', className: 'inline-flex min-h-11 items-center gap-1.5 text-sm font-medium text-primary underline-offset-2 hover:underline sm:min-h-8', children: [_jsx(ExternalLink, { "aria-hidden": 'true', className: 'h-3.5 w-3.5' }), tx(l.label, l.href)] }) }, l.href))) }));
69
+ }
70
+ function BlockFrame({ title, children, className }) {
71
+ return (_jsxs("section", { className: cn('flex flex-col gap-2 rounded-lg border border-border/70 bg-card p-3', className), children: [title ? _jsx("h4", { className: 'text-sm font-medium', children: title }) : null, children] }));
72
+ }
73
+ // ─── webhook_url ─────────────────────────────────────────────────────────────
74
+ export function WebhookUrlBlock({ block }) {
75
+ const st = useSetupT();
76
+ const tx = useAddonText();
77
+ const title = tx(block.title, st('blocks.webhook_title'));
78
+ const value = typeof block.value === 'string' ? block.value.trim() : '';
79
+ return (_jsxs(BlockFrame, { title: title, children: [value ? (_jsx(CopyValue, { value: value, label: title })) : (_jsx("p", { className: 'text-sm text-muted-foreground', role: 'note', children: st('blocks.webhook_unavailable') })), _jsx(HelpText, { text: tx(block.description, st('blocks.webhook_help')) }), _jsx(BlockLinks, { links: block.links })] }));
80
+ }
81
+ // ─── instructions ────────────────────────────────────────────────────────────
82
+ export function InstructionsBlock({ block }) {
83
+ const tx = useAddonText();
84
+ return (_jsxs(BlockFrame, { title: tx(block.title), className: 'bg-muted/30', children: [_jsx(HelpText, { text: tx(block.description), clampAt: 240 }), _jsx(BlockLinks, { links: block.links })] }));
85
+ }
86
+ export function ActionBlock({ block, run, result, onResult, disabled, note }) {
87
+ const st = useSetupT();
88
+ const tx = useAddonText();
89
+ const [busy, setBusy] = useState(false);
90
+ const [local, setLocal] = useState(undefined);
91
+ const shown = result ?? local;
92
+ const label = tx(block.label, st('blocks.run'));
93
+ const onRun = async () => {
94
+ setBusy(true);
95
+ try {
96
+ const r = await run();
97
+ setLocal(r);
98
+ onResult?.(r);
99
+ }
100
+ finally {
101
+ setBusy(false);
102
+ }
103
+ };
104
+ const failed = shown && (shown.status === 'error' || shown.status === 'blocked');
105
+ return (_jsxs(BlockFrame, { title: tx(block.title), children: [_jsx(HelpText, { text: tx(block.description) }), _jsxs("div", { className: 'flex flex-wrap items-center gap-2', children: [_jsxs(Button, { type: 'button', variant: failed ? 'outline' : 'secondary', className: 'h-auto min-h-11 gap-2 whitespace-normal text-left', onClick: onRun, disabled: busy || disabled, "aria-describedby": note ? `${block.key}-note` : undefined, children: [busy ? (_jsx(Loader2, { "aria-hidden": 'true', className: 'h-4 w-4 shrink-0 animate-spin motion-reduce:animate-none' })) : shown ? (_jsx(RotateCcw, { "aria-hidden": 'true', className: 'h-4 w-4 shrink-0' })) : (_jsx(Play, { "aria-hidden": 'true', className: 'h-4 w-4 shrink-0' })), busy ? st('blocks.running') : shown ? st('blocks.retry_with', { label }) : label] }), note ? (_jsx("span", { id: `${block.key}-note`, className: 'text-xs text-muted-foreground', children: note })) : null] }), _jsx("div", { role: 'status', "aria-live": 'polite', "aria-atomic": 'true', className: 'empty:hidden', children: shown ? _jsx(BlockResultView, { result: shown }) : null })] }));
106
+ }
107
+ export function BlockResultView({ result }) {
108
+ const st = useSetupT();
109
+ const tone = STEP_TONE[result.status] ?? 'neutral';
110
+ return (_jsxs("div", { className: cn('flex flex-col gap-2 rounded-md border px-3 py-2', TONE_BADGE[tone]), "data-result-status": result.status, children: [_jsxs("div", { className: 'flex flex-wrap items-center gap-2', children: [_jsx(StepStatusBadge, { status: result.status, label: st(`blocks.result.${result.status}`) }), result.message ? _jsx("span", { className: 'text-sm break-words text-foreground', children: result.message }) : null] }), result.details.length > 0 ? (_jsx("dl", { className: 'flex flex-col gap-2', children: result.details.map((d, i) => {
111
+ const label = d.label || d.key || '';
112
+ const href = d.kind === 'url' ? safeHttpsUrl(d.value) : null;
113
+ return (_jsxs("div", { className: 'flex flex-col gap-1', children: [_jsx("dt", { className: 'text-xs font-medium text-muted-foreground', children: label }), _jsx("dd", { className: 'text-sm text-foreground', children: d.kind === 'id' ? (_jsx(CopyValue, { value: d.value, label: label || st('blocks.value') })) : href ? (_jsxs("a", { href: href, target: '_blank', rel: 'noopener noreferrer', className: 'inline-flex min-h-11 items-center gap-1.5 break-all font-medium text-primary underline-offset-2 hover:underline sm:min-h-8', children: [_jsx(ExternalLink, { "aria-hidden": 'true', className: 'h-3.5 w-3.5 shrink-0' }), st('blocks.open_link')] })) : (_jsx("span", { className: 'break-words', children: d.value })) })] }, d.key ?? i));
114
+ }) })) : null] }));
115
+ }
116
+ /** Renders a step's blocks in declared order; unknown kinds are skipped. */
117
+ export function ConnectorBlocks({ blocks, runAction, results, onResult, actionsDisabled, actionNote }) {
118
+ if (blocks.length === 0)
119
+ return null;
120
+ return (_jsx("div", { className: 'flex flex-col gap-3', children: blocks.map((b) => {
121
+ switch (b.kind) {
122
+ case 'webhook_url':
123
+ return _jsx(WebhookUrlBlock, { block: b }, b.key);
124
+ case 'instructions':
125
+ return _jsx(InstructionsBlock, { block: b }, b.key);
126
+ case 'action':
127
+ return (_jsx(ActionBlock, { block: b, run: () => runAction(b), result: results?.[b.key], onResult: (r) => onResult?.(b.key, r), disabled: actionsDisabled, note: actionNote }, b.key));
128
+ default:
129
+ return null;
130
+ }
131
+ }) }));
132
+ }
@@ -0,0 +1,40 @@
1
+ /** The minimum a credential definition needs for these helpers. */
2
+ export interface CredentialLike {
3
+ key: string;
4
+ label?: string;
5
+ required?: boolean;
6
+ secret?: boolean;
7
+ type?: string;
8
+ default?: string;
9
+ }
10
+ export type CredentialShape = 'public_key' | 'secret_key';
11
+ /** What a pasted value looks like, or null when it is not recognisable. */
12
+ export declare function credentialShape(raw: string): CredentialShape | null;
13
+ export declare const isSecretCredential: (f: CredentialLike) => boolean;
14
+ export interface ShapeMismatch {
15
+ /** What the value looks like. */
16
+ shape: CredentialShape;
17
+ /** The sibling field the value probably belongs to, when the form has one. */
18
+ suggestedKey?: string;
19
+ }
20
+ /**
21
+ * A value pasted in the wrong box: a public key in the secret token field, or
22
+ * a secret in the public-key field. Only a warning (never blocks), and only
23
+ * raised when the form really has a field for what the value looks like.
24
+ */
25
+ export declare function shapeMismatch(field: CredentialLike, value: string, fields: CredentialLike[]): ShapeMismatch | null;
26
+ /** Required fields still empty. A stored secret (connected) counts as filled. */
27
+ export declare function missingRequired(fields: CredentialLike[], values: Record<string, string>, connected: boolean): string[];
28
+ export interface SaveError {
29
+ /** The complete server message, never shortened. */
30
+ message: string;
31
+ /** Fields the server (or the client check) says need attention. */
32
+ fieldKeys: string[];
33
+ }
34
+ /** Reads the kernel/ops error envelope: {message, errors: {field: [{code}]}}. */
35
+ export declare function parseSaveError(err: unknown, fallback: string): SaveError;
36
+ /** Never show a raw dotted key: fall back to `fallback` when the text is the key. */
37
+ export declare function textOrFallback(text: string | undefined, key: string, fallback: string): string;
38
+ /** Cheap content hash so a re-published bundle with the same key count re-merges. */
39
+ export declare function bundleSignature(labels: Record<string, unknown>): string;
40
+ //# sourceMappingURL=connector-form-model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connector-form-model.d.ts","sourceRoot":"","sources":["../../src/setup/connector-form-model.ts"],"names":[],"mappings":"AAMA,mEAAmE;AACnE,MAAM,WAAW,cAAc;IAC7B,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,MAAM,eAAe,GAAG,YAAY,GAAG,YAAY,CAAA;AASzD,2EAA2E;AAC3E,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAMnE;AAED,eAAO,MAAM,kBAAkB,GAAI,GAAG,cAAc,YAAsC,CAAA;AAI1F,MAAM,WAAW,aAAa;IAC5B,iCAAiC;IACjC,KAAK,EAAE,eAAe,CAAA;IACtB,8EAA8E;IAC9E,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,cAAc,EACrB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,cAAc,EAAE,GACvB,aAAa,GAAG,IAAI,CAatB;AAED,iFAAiF;AACjF,wBAAgB,eAAe,CAC7B,MAAM,EAAE,cAAc,EAAE,EACxB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,SAAS,EAAE,OAAO,GACjB,MAAM,EAAE,CAOV;AAED,MAAM,WAAW,SAAS;IACxB,oDAAoD;IACpD,OAAO,EAAE,MAAM,CAAA;IACf,mEAAmE;IACnE,SAAS,EAAE,MAAM,EAAE,CAAA;CACpB;AAED,iFAAiF;AACjF,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,CASxE;AAED,qFAAqF;AACrF,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAG9F;AAED,qFAAqF;AACrF,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAKvE"}
@@ -0,0 +1,76 @@
1
+ // Pure helpers for the connector credentials form (no React, no i18n instance):
2
+ // shape detection of pasted values, save-error parsing and required-field
3
+ // checks. Kept free of any provider name on purpose: the rules look at the
4
+ // SHAPE of a value and at how the form's own fields are declared, so every
5
+ // connector (any addon) benefits and none is special-cased.
6
+ const UUID = '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}';
7
+ // Public (publishable) keys are short identifiers: "<PREFIX>-<uuid>" or the
8
+ // pk_live_/pk_test_ family. Server-side tokens are longer, numeric/hex blobs
9
+ // or sk_/rk_ prefixed. These are generic conventions, not one provider's.
10
+ const PUBLIC_SHAPES = [new RegExp(`^(?:[A-Z_]+-)?${UUID}$`, 'i'), /^pk_(?:live|test)_[A-Za-z0-9]+$/];
11
+ const SECRET_SHAPES = [/^(?:sk|rk)_(?:live|test)_[A-Za-z0-9]+$/, /^[A-Z_]+-\d{6,}-\d{4,}-[0-9a-f]{16,}-\d+$/i];
12
+ /** What a pasted value looks like, or null when it is not recognisable. */
13
+ export function credentialShape(raw) {
14
+ const v = raw.trim();
15
+ if (!v)
16
+ return null;
17
+ if (PUBLIC_SHAPES.some((r) => r.test(v)))
18
+ return 'public_key';
19
+ if (SECRET_SHAPES.some((r) => r.test(v)))
20
+ return 'secret_key';
21
+ return null;
22
+ }
23
+ export const isSecretCredential = (f) => !!f.secret || f.type === 'secret';
24
+ const looksPublic = (f) => /public|publishable|client_id/i.test(f.key);
25
+ /**
26
+ * A value pasted in the wrong box: a public key in the secret token field, or
27
+ * a secret in the public-key field. Only a warning (never blocks), and only
28
+ * raised when the form really has a field for what the value looks like.
29
+ */
30
+ export function shapeMismatch(field, value, fields) {
31
+ const shape = credentialShape(value);
32
+ if (!shape)
33
+ return null;
34
+ const siblings = fields.filter((f) => f.key !== field.key);
35
+ if (shape === 'public_key' && isSecretCredential(field) && !looksPublic(field)) {
36
+ const target = siblings.find(looksPublic);
37
+ return target ? { shape, suggestedKey: target.key } : null;
38
+ }
39
+ if (shape === 'secret_key' && looksPublic(field)) {
40
+ const target = siblings.find((f) => isSecretCredential(f) && !looksPublic(f));
41
+ return target ? { shape, suggestedKey: target.key } : null;
42
+ }
43
+ return null;
44
+ }
45
+ /** Required fields still empty. A stored secret (connected) counts as filled. */
46
+ export function missingRequired(fields, values, connected) {
47
+ return fields
48
+ .filter((f) => f.required)
49
+ .filter((f) => !(values[f.key] ?? '').trim())
50
+ .filter((f) => !(connected && isSecretCredential(f)))
51
+ .filter((f) => !(f.default != null && f.default !== ''))
52
+ .map((f) => f.key);
53
+ }
54
+ /** Reads the kernel/ops error envelope: {message, errors: {field: [{code}]}}. */
55
+ export function parseSaveError(err, fallback) {
56
+ const data = err?.response
57
+ ?.data;
58
+ const message = typeof data?.message === 'string' && data.message.trim() ? data.message.trim() : fallback;
59
+ const errors = data?.errors;
60
+ const fieldKeys = errors && typeof errors === 'object' && !Array.isArray(errors) ? Object.keys(errors) : [];
61
+ return { message, fieldKeys };
62
+ }
63
+ /** Never show a raw dotted key: fall back to `fallback` when the text is the key. */
64
+ export function textOrFallback(text, key, fallback) {
65
+ if (!text || text === key)
66
+ return fallback;
67
+ return text;
68
+ }
69
+ /** Cheap content hash so a re-published bundle with the same key count re-merges. */
70
+ export function bundleSignature(labels) {
71
+ let h = 5381;
72
+ const s = JSON.stringify(labels);
73
+ for (let i = 0; i < s.length; i++)
74
+ h = ((h << 5) + h + s.charCodeAt(i)) | 0;
75
+ return `${Object.keys(labels).length}:${(h >>> 0).toString(36)}`;
76
+ }
@@ -0,0 +1,49 @@
1
+ import type { SetupFlowState, SetupStepDef, SetupStepState, StepStatus } from './types';
2
+ export declare const STEP_STATUSES: StepStatus[];
3
+ /** Accepts the array or the by-key map the server may send. */
4
+ export declare function normalizeState(raw: SetupFlowState | null | undefined): Record<string, SetupStepState>;
5
+ /** A step counts as satisfied (unblocks dependants) when ok, warn or skipped. */
6
+ export declare function isSatisfied(st: SetupStepState | undefined): boolean;
7
+ /** Steps this one waits on that are not satisfied yet. */
8
+ export declare function unmetDependencies(def: SetupStepDef, states: Record<string, SetupStepState>): string[];
9
+ /**
10
+ * Status shown for a step: the server's, except that a step whose
11
+ * dependencies are unmet is `blocked` (unless it is already running/ok, which
12
+ * the server decides). A skipped step reads as `ok`.
13
+ */
14
+ export declare function effectiveStatus(def: SetupStepDef, states: Record<string, SetupStepState>): StepStatus;
15
+ /** First step that needs the person: not satisfied and not blocked; else the last. */
16
+ export declare function pickActiveStep(defs: SetupStepDef[], states: Record<string, SetupStepState>): string | undefined;
17
+ export interface FlowProgress {
18
+ done: number;
19
+ total: number;
20
+ percent: number;
21
+ complete: boolean;
22
+ }
23
+ /**
24
+ * Progress over the REQUIRED steps (optional ones do not hold completion
25
+ * back, but count as done when they are). The flow is complete when every
26
+ * required step is satisfied; an error step is never satisfied.
27
+ */
28
+ export declare function flowProgress(defs: SetupStepDef[], states: Record<string, SetupStepState>, serverCompleted?: boolean): FlowProgress;
29
+ export interface BackoffOptions {
30
+ baseMs?: number;
31
+ factor?: number;
32
+ maxMs?: number;
33
+ /** Ceiling honoured for a server `retry_after_s`. */
34
+ maxRetryAfterMs?: number;
35
+ }
36
+ /**
37
+ * Delay before the next poll. Without a hint: exponential from `baseMs`
38
+ * (2s, 3.2s, 5.1s…) capped at `maxMs` (30s). A server `retry_after_s` wins,
39
+ * but never below 1s nor above `maxRetryAfterMs` (5 min).
40
+ */
41
+ export declare function nextPollDelayMs(attempt: number, retryAfterS?: number, opts?: BackoffOptions): number;
42
+ /** Only http(s) and app-relative paths may be opened from a `fix.url`. */
43
+ export declare function safeUrl(url: string | undefined): string | null;
44
+ /** Merges a runStep/skipStep answer (step or whole flow) into the local map. */
45
+ export declare function mergeAnswer(current: Record<string, SetupStepState>, key: string, answer: SetupStepState | SetupFlowState | void | undefined): {
46
+ next: Record<string, SetupStepState>;
47
+ needsRefetch: boolean;
48
+ };
49
+ //# sourceMappingURL=flow-model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flow-model.d.ts","sourceRoot":"","sources":["../../src/setup/flow-model.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEvF,eAAO,MAAM,aAAa,EAAE,UAAU,EAA6D,CAAA;AAEnG,+DAA+D;AAC/D,wBAAgB,cAAc,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAUrG;AAED,iFAAiF;AACjF,wBAAgB,WAAW,CAAC,EAAE,EAAE,cAAc,GAAG,SAAS,GAAG,OAAO,CAGnE;AAED,0DAA0D;AAC1D,wBAA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