nucleus-core-ts 0.9.781 → 0.9.783
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/client.js +1 -1
- package/dist/fe/components/IntegrationsPage/components/ConnectionAuthFields.d.ts +2 -0
- package/dist/fe/components/IntegrationsPage/components/ConnectionAuthFields.js +85 -0
- package/dist/fe/components/IntegrationsPage/components/ConnectionBasicFields.d.ts +2 -0
- package/dist/fe/components/IntegrationsPage/components/ConnectionBasicFields.js +165 -0
- package/dist/fe/components/IntegrationsPage/components/ConnectionForm.d.ts +10 -0
- package/dist/fe/components/IntegrationsPage/components/ConnectionForm.js +112 -0
- package/dist/fe/components/IntegrationsPage/components/ConnectionList.d.ts +9 -0
- package/dist/fe/components/IntegrationsPage/components/ConnectionList.js +184 -0
- package/dist/fe/components/IntegrationsPage/components/ConnectionOauthFields.d.ts +2 -0
- package/dist/fe/components/IntegrationsPage/components/ConnectionOauthFields.js +131 -0
- package/dist/fe/components/IntegrationsPage/components/ConnectionSettingsTab.d.ts +21 -0
- package/dist/fe/components/IntegrationsPage/components/ConnectionSettingsTab.js +49 -0
- package/dist/fe/components/IntegrationsPage/components/ConnectionTabs.d.ts +12 -0
- package/dist/fe/components/IntegrationsPage/components/ConnectionTabs.js +95 -0
- package/dist/fe/components/IntegrationsPage/components/ConnectionTest.d.ts +9 -0
- package/dist/fe/components/IntegrationsPage/components/ConnectionTest.js +116 -0
- package/dist/fe/components/IntegrationsPage/components/CredentialFields.d.ts +9 -0
- package/dist/fe/components/IntegrationsPage/components/CredentialFields.js +171 -0
- package/dist/fe/components/IntegrationsPage/components/CredentialSlotRow.d.ts +13 -0
- package/dist/fe/components/IntegrationsPage/components/CredentialSlotRow.js +63 -0
- package/dist/fe/components/IntegrationsPage/components/EndpointForm.d.ts +11 -0
- package/dist/fe/components/IntegrationsPage/components/EndpointForm.js +166 -0
- package/dist/fe/components/IntegrationsPage/components/EndpointFormFields.d.ts +19 -0
- package/dist/fe/components/IntegrationsPage/components/EndpointFormFields.js +162 -0
- package/dist/fe/components/IntegrationsPage/components/EndpointList.d.ts +12 -0
- package/dist/fe/components/IntegrationsPage/components/EndpointList.js +205 -0
- package/dist/fe/components/IntegrationsPage/components/EndpointSample.d.ts +6 -0
- package/dist/fe/components/IntegrationsPage/components/EndpointSample.js +204 -0
- package/dist/fe/components/IntegrationsPage/components/EndpointsTab.d.ts +5 -0
- package/dist/fe/components/IntegrationsPage/components/EndpointsTab.js +101 -0
- package/dist/fe/components/IntegrationsPage/components/FieldMappingRow.d.ts +17 -0
- package/dist/fe/components/IntegrationsPage/components/FieldMappingRow.js +179 -0
- package/dist/fe/components/IntegrationsPage/components/FieldMappingRows.d.ts +11 -0
- package/dist/fe/components/IntegrationsPage/components/FieldMappingRows.js +115 -0
- package/dist/fe/components/IntegrationsPage/components/IntegrationsPage.d.ts +2 -0
- package/dist/fe/components/IntegrationsPage/components/IntegrationsPage.js +175 -0
- package/dist/fe/components/IntegrationsPage/components/MappingEditor.d.ts +15 -0
- package/dist/fe/components/IntegrationsPage/components/MappingEditor.js +193 -0
- package/dist/fe/components/IntegrationsPage/components/MappingList.d.ts +11 -0
- package/dist/fe/components/IntegrationsPage/components/MappingList.js +191 -0
- package/dist/fe/components/IntegrationsPage/components/MappingWriteModeFields.d.ts +19 -0
- package/dist/fe/components/IntegrationsPage/components/MappingWriteModeFields.js +150 -0
- package/dist/fe/components/IntegrationsPage/components/MappingsTab.d.ts +5 -0
- package/dist/fe/components/IntegrationsPage/components/MappingsTab.js +154 -0
- package/dist/fe/components/IntegrationsPage/components/PaginationFields.d.ts +9 -0
- package/dist/fe/components/IntegrationsPage/components/PaginationFields.js +218 -0
- package/dist/fe/components/IntegrationsPage/components/ParamBindingRow.d.ts +24 -0
- package/dist/fe/components/IntegrationsPage/components/ParamBindingRow.js +180 -0
- package/dist/fe/components/IntegrationsPage/components/ParamBindingRows.d.ts +33 -0
- package/dist/fe/components/IntegrationsPage/components/ParamBindingRows.js +100 -0
- package/dist/fe/components/IntegrationsPage/components/Primitives.d.ts +65 -0
- package/dist/fe/components/IntegrationsPage/components/Primitives.js +94 -0
- package/dist/fe/components/IntegrationsPage/components/RunConfirmStep.d.ts +10 -0
- package/dist/fe/components/IntegrationsPage/components/RunConfirmStep.js +48 -0
- package/dist/fe/components/IntegrationsPage/components/RunHistory.d.ts +10 -0
- package/dist/fe/components/IntegrationsPage/components/RunHistory.js +124 -0
- package/dist/fe/components/IntegrationsPage/components/RunHistoryRow.d.ts +7 -0
- package/dist/fe/components/IntegrationsPage/components/RunHistoryRow.js +129 -0
- package/dist/fe/components/IntegrationsPage/components/RunPanel.d.ts +9 -0
- package/dist/fe/components/IntegrationsPage/components/RunPanel.js +160 -0
- package/dist/fe/components/IntegrationsPage/components/RunPlanIssues.d.ts +5 -0
- package/dist/fe/components/IntegrationsPage/components/RunPlanIssues.js +43 -0
- package/dist/fe/components/IntegrationsPage/components/RunPlanSummary.d.ts +5 -0
- package/dist/fe/components/IntegrationsPage/components/RunPlanSummary.js +92 -0
- package/dist/fe/components/IntegrationsPage/components/RunProgressBar.d.ts +8 -0
- package/dist/fe/components/IntegrationsPage/components/RunProgressBar.js +77 -0
- package/dist/fe/components/IntegrationsPage/components/RunRevertConflicts.d.ts +13 -0
- package/dist/fe/components/IntegrationsPage/components/RunRevertConflicts.js +65 -0
- package/dist/fe/components/IntegrationsPage/components/RunsTab.d.ts +13 -0
- package/dist/fe/components/IntegrationsPage/components/RunsTab.js +39 -0
- package/dist/fe/components/IntegrationsPage/components/Skeletons.d.ts +9 -0
- package/dist/fe/components/IntegrationsPage/components/Skeletons.js +139 -0
- package/dist/fe/components/IntegrationsPage/components/authOptions.d.ts +29 -0
- package/dist/fe/components/IntegrationsPage/components/authOptions.js +71 -0
- package/dist/fe/components/IntegrationsPage/components/connectionDraft.d.ts +64 -0
- package/dist/fe/components/IntegrationsPage/components/connectionDraft.js +112 -0
- package/dist/fe/components/IntegrationsPage/components/credentialSlots.d.ts +25 -0
- package/dist/fe/components/IntegrationsPage/components/credentialSlots.js +67 -0
- package/dist/fe/components/IntegrationsPage/components/fieldMappingOptions.d.ts +16 -0
- package/dist/fe/components/IntegrationsPage/components/fieldMappingOptions.js +41 -0
- package/dist/fe/components/IntegrationsPage/components/formSupport.d.ts +19 -0
- package/dist/fe/components/IntegrationsPage/components/formSupport.js +25 -0
- package/dist/fe/components/IntegrationsPage/components/mappingDraft.d.ts +40 -0
- package/dist/fe/components/IntegrationsPage/components/mappingDraft.js +44 -0
- package/dist/fe/components/IntegrationsPage/components/pathParams.d.ts +9 -0
- package/dist/fe/components/IntegrationsPage/components/pathParams.js +15 -0
- package/dist/fe/components/IntegrationsPage/components/runFormat.d.ts +33 -0
- package/dist/fe/components/IntegrationsPage/components/runFormat.js +85 -0
- package/dist/fe/components/IntegrationsPage/components/useInfiniteList.d.ts +40 -0
- package/dist/fe/components/IntegrationsPage/components/useInfiniteList.js +110 -0
- package/dist/fe/components/IntegrationsPage/index.d.ts +18 -0
- package/dist/fe/components/IntegrationsPage/index.js +11 -0
- package/dist/fe/components/IntegrationsPage/store/index.d.ts +2 -0
- package/dist/fe/components/IntegrationsPage/store/index.js +124 -0
- package/dist/fe/components/IntegrationsPage/store/state.d.ts +80 -0
- package/dist/fe/components/IntegrationsPage/store/state.js +32 -0
- package/dist/fe/components/IntegrationsPage/theme/index.d.ts +103 -0
- package/dist/fe/components/IntegrationsPage/theme/index.js +113 -0
- package/dist/fe/components/IntegrationsPage/types/actions.d.ts +91 -0
- package/dist/fe/components/IntegrationsPage/types/actions.js +1 -0
- package/dist/fe/components/IntegrationsPage/types/index.d.ts +3 -0
- package/dist/fe/components/IntegrationsPage/types/index.js +3 -0
- package/dist/fe/components/IntegrationsPage/types/records.d.ts +139 -0
- package/dist/fe/components/IntegrationsPage/types/records.js +11 -0
- package/dist/fe/components/IntegrationsPage/types/results.d.ts +52 -0
- package/dist/fe/components/IntegrationsPage/types/results.js +4 -0
- package/dist/fe/index.d.ts +2 -0
- package/dist/fe/index.js +1 -0
- package/dist/index.js +14 -14
- package/dist/src/Client/ApiCaller/system-tables.d.ts +505 -0
- package/dist/src/Client/Proxy/wsProxy.js +25 -1
- package/dist/src/ElysiaPlugin/routes/backup/types.d.ts +3 -1
- package/dist/src/ElysiaPlugin/routes/integrations/index.d.ts +49 -0
- package/dist/src/ElysiaPlugin/routes/integrations/inspect.d.ts +87 -0
- package/dist/src/ElysiaPlugin/routes/integrations/inspectRoutes.d.ts +41 -0
- package/dist/src/ElysiaPlugin/routes/integrations/repository.d.ts +88 -0
- package/dist/src/ElysiaPlugin/routes/integrations/types.d.ts +22 -0
- package/dist/src/ElysiaPlugin/routes/pubsub/frame.d.ts +37 -0
- package/dist/src/ElysiaPlugin/routes/pubsub/frame.test.d.ts +1 -0
- package/dist/src/Services/Backup/BackupService.d.ts +16 -8
- package/dist/src/Services/Backup/types.d.ts +25 -0
- package/dist/src/Services/Integrations/bindings.d.ts +116 -0
- package/dist/src/Services/Integrations/bindings.test.d.ts +1 -0
- package/dist/src/Services/Integrations/collect.d.ts +68 -0
- package/dist/src/Services/Integrations/collect.test.d.ts +1 -0
- package/dist/src/Services/Integrations/fetcher.d.ts +100 -0
- package/dist/src/Services/Integrations/fetcher.test.d.ts +1 -0
- package/dist/src/Services/Integrations/lock.d.ts +77 -0
- package/dist/src/Services/Integrations/lock.test.d.ts +1 -0
- package/dist/src/Services/Integrations/mapping.d.ts +63 -0
- package/dist/src/Services/Integrations/mapping.test.d.ts +1 -0
- package/dist/src/Services/Integrations/oauth.d.ts +89 -0
- package/dist/src/Services/Integrations/oauth.test.d.ts +1 -0
- package/dist/src/Services/Integrations/pagination.d.ts +97 -0
- package/dist/src/Services/Integrations/pagination.test.d.ts +1 -0
- package/dist/src/Services/Integrations/plan.d.ts +74 -0
- package/dist/src/Services/Integrations/plan.test.d.ts +1 -0
- package/dist/src/Services/Integrations/revert.d.ts +78 -0
- package/dist/src/Services/Integrations/revert.test.d.ts +1 -0
- package/dist/src/Services/Integrations/runner.d.ts +126 -0
- package/dist/src/Services/Integrations/runner.test.d.ts +1 -0
- package/dist/src/Services/Integrations/types.d.ts +208 -0
- package/dist/src/Services/Integrations/writer.d.ts +105 -0
- package/dist/src/Services/Integrations/writer.test.d.ts +1 -0
- package/dist/src/Utils/cron.d.ts +65 -0
- package/dist/src/Utils/cron.test.d.ts +1 -0
- package/dist/src/types.d.ts +67 -1
- package/package.json +1 -1
- package/schemas/config.nucleus.json +43 -0
- package/schemas/table.schema.json +2 -1
- package/scripts/generate-schema.test.ts +78 -0
- package/scripts/generate-schema.ts +43 -5
- package/src/system.tables.json +362 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every class the panel paints with, in one place.
|
|
3
|
+
*
|
|
4
|
+
* Light is the base and `dark:` is the override, so nothing renders unstyled in
|
|
5
|
+
* either theme. Sizing is mobile-first: the base classes are what a 320px phone
|
|
6
|
+
* gets, and each breakpoint adds room rather than repairing damage.
|
|
7
|
+
*
|
|
8
|
+
* An app can replace any slice of this with {@link extendIntegrationsTheme}
|
|
9
|
+
* without forking the components.
|
|
10
|
+
*/
|
|
11
|
+
export type IntegrationsPageTheme = {
|
|
12
|
+
container: string;
|
|
13
|
+
header: {
|
|
14
|
+
wrapper: string;
|
|
15
|
+
title: string;
|
|
16
|
+
subtitle: string;
|
|
17
|
+
actions: string;
|
|
18
|
+
};
|
|
19
|
+
layout: {
|
|
20
|
+
split: string;
|
|
21
|
+
aside: string;
|
|
22
|
+
main: string;
|
|
23
|
+
};
|
|
24
|
+
card: {
|
|
25
|
+
wrapper: string;
|
|
26
|
+
header: string;
|
|
27
|
+
title: string;
|
|
28
|
+
body: string;
|
|
29
|
+
footer: string;
|
|
30
|
+
};
|
|
31
|
+
list: {
|
|
32
|
+
wrapper: string;
|
|
33
|
+
item: string;
|
|
34
|
+
itemSelected: string;
|
|
35
|
+
itemTitle: string;
|
|
36
|
+
itemMeta: string;
|
|
37
|
+
empty: string;
|
|
38
|
+
sentinel: string;
|
|
39
|
+
};
|
|
40
|
+
tabs: {
|
|
41
|
+
wrapper: string;
|
|
42
|
+
button: string;
|
|
43
|
+
active: string;
|
|
44
|
+
inactive: string;
|
|
45
|
+
};
|
|
46
|
+
field: {
|
|
47
|
+
wrapper: string;
|
|
48
|
+
label: string;
|
|
49
|
+
input: string;
|
|
50
|
+
hint: string;
|
|
51
|
+
error: string;
|
|
52
|
+
};
|
|
53
|
+
button: {
|
|
54
|
+
primary: string;
|
|
55
|
+
secondary: string;
|
|
56
|
+
ghost: string;
|
|
57
|
+
danger: string;
|
|
58
|
+
};
|
|
59
|
+
badge: {
|
|
60
|
+
base: string;
|
|
61
|
+
neutral: string;
|
|
62
|
+
success: string;
|
|
63
|
+
warning: string;
|
|
64
|
+
danger: string;
|
|
65
|
+
info: string;
|
|
66
|
+
};
|
|
67
|
+
stat: {
|
|
68
|
+
grid: string;
|
|
69
|
+
cell: string;
|
|
70
|
+
value: string;
|
|
71
|
+
label: string;
|
|
72
|
+
};
|
|
73
|
+
notice: {
|
|
74
|
+
info: string;
|
|
75
|
+
warning: string;
|
|
76
|
+
danger: string;
|
|
77
|
+
title: string;
|
|
78
|
+
body: string;
|
|
79
|
+
};
|
|
80
|
+
code: string;
|
|
81
|
+
skeleton: {
|
|
82
|
+
line: string;
|
|
83
|
+
block: string;
|
|
84
|
+
};
|
|
85
|
+
progress: {
|
|
86
|
+
track: string;
|
|
87
|
+
bar: string;
|
|
88
|
+
label: string;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
export declare const integrationsPageTheme: IntegrationsPageTheme;
|
|
92
|
+
type DeepPartial<T> = {
|
|
93
|
+
[K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Overrides a slice of the theme, leaving the rest intact.
|
|
97
|
+
*
|
|
98
|
+
* One level of nesting is all the theme has, so a shallow merge per group is
|
|
99
|
+
* exactly right — and it means an app overriding one badge colour does not have
|
|
100
|
+
* to restate the other five.
|
|
101
|
+
*/
|
|
102
|
+
export declare function extendIntegrationsTheme(overrides: DeepPartial<IntegrationsPageTheme>): IntegrationsPageTheme;
|
|
103
|
+
export {};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every class the panel paints with, in one place.
|
|
3
|
+
*
|
|
4
|
+
* Light is the base and `dark:` is the override, so nothing renders unstyled in
|
|
5
|
+
* either theme. Sizing is mobile-first: the base classes are what a 320px phone
|
|
6
|
+
* gets, and each breakpoint adds room rather than repairing damage.
|
|
7
|
+
*
|
|
8
|
+
* An app can replace any slice of this with {@link extendIntegrationsTheme}
|
|
9
|
+
* without forking the components.
|
|
10
|
+
*/ /** Shared so a control and its skeleton cannot drift apart in height. */ const CONTROL = 'h-10 rounded-lg text-sm sm:h-9';
|
|
11
|
+
export const integrationsPageTheme = {
|
|
12
|
+
container: 'flex flex-col gap-4 text-slate-900 sm:gap-5 dark:text-slate-100',
|
|
13
|
+
header: {
|
|
14
|
+
wrapper: 'flex flex-col gap-2 sm:flex-row sm:items-end sm:justify-between',
|
|
15
|
+
title: 'font-semibold text-lg tracking-tight sm:text-xl',
|
|
16
|
+
subtitle: 'text-slate-600 text-sm dark:text-slate-400',
|
|
17
|
+
actions: 'flex flex-wrap items-center gap-2'
|
|
18
|
+
},
|
|
19
|
+
// One column on a phone; the connection list becomes a rail from lg upward,
|
|
20
|
+
// where there is finally room for both without either being cramped.
|
|
21
|
+
layout: {
|
|
22
|
+
split: 'grid grid-cols-1 gap-4 lg:grid-cols-[minmax(0,20rem)_minmax(0,1fr)] lg:gap-5',
|
|
23
|
+
aside: 'flex min-w-0 flex-col gap-3',
|
|
24
|
+
main: 'flex min-w-0 flex-col gap-4'
|
|
25
|
+
},
|
|
26
|
+
card: {
|
|
27
|
+
wrapper: 'rounded-xl border border-slate-200 bg-white shadow-sm dark:border-slate-800 dark:bg-slate-900',
|
|
28
|
+
header: 'flex flex-col gap-2 border-slate-200 border-b px-4 py-3 sm:flex-row sm:items-center sm:justify-between dark:border-slate-800',
|
|
29
|
+
title: 'font-medium text-slate-900 text-sm dark:text-slate-100',
|
|
30
|
+
body: 'flex flex-col gap-3 p-4',
|
|
31
|
+
footer: 'flex flex-wrap items-center justify-end gap-2 border-slate-200 border-t px-4 py-3 dark:border-slate-800'
|
|
32
|
+
},
|
|
33
|
+
list: {
|
|
34
|
+
wrapper: 'flex flex-col gap-1.5',
|
|
35
|
+
item: 'flex w-full flex-col gap-0.5 rounded-lg border border-transparent px-3 py-2.5 text-left transition-colors hover:bg-slate-100 dark:hover:bg-slate-800',
|
|
36
|
+
itemSelected: 'border-sky-300 bg-sky-50 hover:bg-sky-50 dark:border-sky-700 dark:bg-sky-950 dark:hover:bg-sky-950',
|
|
37
|
+
itemTitle: 'truncate font-medium text-slate-900 text-sm dark:text-slate-100',
|
|
38
|
+
itemMeta: 'truncate text-slate-500 text-xs dark:text-slate-400',
|
|
39
|
+
empty: 'rounded-lg border border-slate-200 border-dashed px-4 py-8 text-center text-slate-500 text-sm dark:border-slate-700 dark:text-slate-400',
|
|
40
|
+
// Watched by the infinite scroller; the next page is requested when it appears.
|
|
41
|
+
sentinel: 'h-8 w-full shrink-0'
|
|
42
|
+
},
|
|
43
|
+
tabs: {
|
|
44
|
+
wrapper: 'flex gap-1 overflow-x-auto rounded-lg border border-slate-200 bg-slate-50 p-1 dark:border-slate-800 dark:bg-slate-900',
|
|
45
|
+
button: 'shrink-0 rounded-md px-3 py-1.5 font-medium text-sm transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-sky-500 focus-visible:outline-offset-2',
|
|
46
|
+
active: 'bg-white text-slate-900 shadow-sm dark:bg-slate-800 dark:text-slate-100',
|
|
47
|
+
inactive: 'text-slate-600 hover:text-slate-900 dark:text-slate-400 dark:hover:text-slate-100'
|
|
48
|
+
},
|
|
49
|
+
field: {
|
|
50
|
+
wrapper: 'flex flex-col gap-1.5',
|
|
51
|
+
label: 'font-medium text-slate-700 text-xs dark:text-slate-300',
|
|
52
|
+
input: `w-full border border-slate-300 bg-white px-3 text-slate-900 outline-none transition-colors placeholder:text-slate-400 focus:border-sky-500 focus:ring-2 focus:ring-sky-500/20 disabled:opacity-60 dark:border-slate-700 dark:bg-slate-950 dark:text-slate-100 dark:placeholder:text-slate-500 ${CONTROL}`,
|
|
53
|
+
hint: 'text-slate-500 text-xs dark:text-slate-400',
|
|
54
|
+
error: 'text-rose-600 text-xs dark:text-rose-400'
|
|
55
|
+
},
|
|
56
|
+
button: {
|
|
57
|
+
primary: `inline-flex items-center justify-center gap-1.5 bg-sky-600 px-3.5 font-medium text-white transition-colors hover:bg-sky-700 disabled:opacity-50 dark:bg-sky-500 dark:hover:bg-sky-400 dark:text-slate-950 ${CONTROL}`,
|
|
58
|
+
secondary: `inline-flex items-center justify-center gap-1.5 border border-slate-300 bg-white px-3.5 font-medium text-slate-700 transition-colors hover:bg-slate-50 disabled:opacity-50 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-200 dark:hover:bg-slate-800 ${CONTROL}`,
|
|
59
|
+
ghost: `inline-flex items-center justify-center gap-1.5 px-2.5 font-medium text-slate-600 transition-colors hover:bg-slate-100 hover:text-slate-900 disabled:opacity-50 dark:text-slate-400 dark:hover:bg-slate-800 dark:hover:text-slate-100 ${CONTROL}`,
|
|
60
|
+
danger: `inline-flex items-center justify-center gap-1.5 bg-rose-600 px-3.5 font-medium text-white transition-colors hover:bg-rose-700 disabled:opacity-50 dark:bg-rose-600 dark:hover:bg-rose-500 ${CONTROL}`
|
|
61
|
+
},
|
|
62
|
+
badge: {
|
|
63
|
+
base: 'inline-flex items-center gap-1 rounded-full border px-2 py-0.5 font-medium text-xs',
|
|
64
|
+
neutral: 'border-slate-200 bg-slate-100 text-slate-700 dark:border-slate-700 dark:bg-slate-800 dark:text-slate-300',
|
|
65
|
+
success: 'border-emerald-200 bg-emerald-50 text-emerald-700 dark:border-emerald-800 dark:bg-emerald-950 dark:text-emerald-400',
|
|
66
|
+
warning: 'border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-800 dark:bg-amber-950 dark:text-amber-400',
|
|
67
|
+
danger: 'border-rose-200 bg-rose-50 text-rose-700 dark:border-rose-800 dark:bg-rose-950 dark:text-rose-400',
|
|
68
|
+
info: 'border-sky-200 bg-sky-50 text-sky-700 dark:border-sky-800 dark:bg-sky-950 dark:text-sky-400'
|
|
69
|
+
},
|
|
70
|
+
stat: {
|
|
71
|
+
grid: 'grid grid-cols-2 gap-2 xs:grid-cols-3 sm:grid-cols-4 lg:grid-cols-6',
|
|
72
|
+
cell: 'flex flex-col items-center gap-0.5 rounded-lg border border-slate-200 bg-white px-2 py-3 text-center dark:border-slate-800 dark:bg-slate-900',
|
|
73
|
+
value: 'font-semibold text-lg tabular-nums',
|
|
74
|
+
label: 'text-[11px] text-slate-500 leading-tight dark:text-slate-400'
|
|
75
|
+
},
|
|
76
|
+
notice: {
|
|
77
|
+
info: 'rounded-lg border border-sky-200 bg-sky-50 p-3 dark:border-sky-900 dark:bg-sky-950',
|
|
78
|
+
warning: 'rounded-lg border border-amber-200 bg-amber-50 p-3 dark:border-amber-900 dark:bg-amber-950',
|
|
79
|
+
danger: 'rounded-lg border border-rose-200 bg-rose-50 p-3 dark:border-rose-900 dark:bg-rose-950',
|
|
80
|
+
title: 'font-medium text-sm',
|
|
81
|
+
body: 'mt-0.5 text-sm leading-relaxed opacity-90'
|
|
82
|
+
},
|
|
83
|
+
code: 'block overflow-x-auto rounded-lg border border-slate-200 bg-slate-50 p-3 font-mono text-[11px] text-slate-700 leading-relaxed sm:text-xs dark:border-slate-800 dark:bg-slate-950 dark:text-slate-300',
|
|
84
|
+
skeleton: {
|
|
85
|
+
line: 'h-3 animate-pulse rounded bg-slate-200 dark:bg-slate-800',
|
|
86
|
+
block: 'animate-pulse rounded-lg bg-slate-200 dark:bg-slate-800'
|
|
87
|
+
},
|
|
88
|
+
progress: {
|
|
89
|
+
track: 'h-1.5 w-full overflow-hidden rounded-full bg-slate-200 dark:bg-slate-800',
|
|
90
|
+
bar: 'h-full rounded-full bg-sky-600 transition-[width] duration-300 ease-out dark:bg-sky-500',
|
|
91
|
+
label: 'text-slate-600 text-xs tabular-nums dark:text-slate-400'
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Overrides a slice of the theme, leaving the rest intact.
|
|
96
|
+
*
|
|
97
|
+
* One level of nesting is all the theme has, so a shallow merge per group is
|
|
98
|
+
* exactly right — and it means an app overriding one badge colour does not have
|
|
99
|
+
* to restate the other five.
|
|
100
|
+
*/ export function extendIntegrationsTheme(overrides) {
|
|
101
|
+
const base = integrationsPageTheme;
|
|
102
|
+
const merged = {
|
|
103
|
+
...base
|
|
104
|
+
};
|
|
105
|
+
for (const [group, value] of Object.entries(overrides)){
|
|
106
|
+
const current = base[group];
|
|
107
|
+
merged[group] = value && typeof value === 'object' && current && typeof current === 'object' ? {
|
|
108
|
+
...current,
|
|
109
|
+
...value
|
|
110
|
+
} : value;
|
|
111
|
+
}
|
|
112
|
+
return merged;
|
|
113
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { IntegrationEndpoint, IntegrationMapping, IntegrationRun, IntegrationSource } from './records';
|
|
2
|
+
import type { ConnectionTestValue, EndpointSampleValue, RunPlanValue, RunProgressValue } from './results';
|
|
3
|
+
/**
|
|
4
|
+
* One page of a server-driven list.
|
|
5
|
+
*
|
|
6
|
+
* Filtering, searching, sorting and paging all happen on the server. A list that
|
|
7
|
+
* pages on the client has already fetched everything, which stops being viable
|
|
8
|
+
* at the first customer with real data.
|
|
9
|
+
*/
|
|
10
|
+
export type ListQuery = {
|
|
11
|
+
page?: number;
|
|
12
|
+
limit?: number;
|
|
13
|
+
search?: string;
|
|
14
|
+
sort?: {
|
|
15
|
+
field: string;
|
|
16
|
+
direction: 'asc' | 'desc';
|
|
17
|
+
}[];
|
|
18
|
+
filters?: unknown[];
|
|
19
|
+
};
|
|
20
|
+
export type ListResult<T> = {
|
|
21
|
+
items: T[];
|
|
22
|
+
meta?: {
|
|
23
|
+
page?: number;
|
|
24
|
+
limit?: number;
|
|
25
|
+
totalItems?: number;
|
|
26
|
+
totalPages?: number;
|
|
27
|
+
hasNextPage?: boolean;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export type IntegrationsActions = {
|
|
31
|
+
listSources: (query: ListQuery) => Promise<ListResult<IntegrationSource>>;
|
|
32
|
+
saveSource: (source: Partial<IntegrationSource>) => Promise<IntegrationSource | null>;
|
|
33
|
+
deleteSource: (id: string) => Promise<boolean>;
|
|
34
|
+
/** Write-only: the value goes in, only a masked preview comes back. */
|
|
35
|
+
saveCredentials: (sourceId: string, values: {
|
|
36
|
+
token?: string;
|
|
37
|
+
oauthClientSecret?: string;
|
|
38
|
+
oauthPassword?: string;
|
|
39
|
+
}) => Promise<Record<string, string | null>>;
|
|
40
|
+
testSource: (sourceId: string) => Promise<ConnectionTestValue>;
|
|
41
|
+
listEndpoints: (sourceId: string, query: ListQuery) => Promise<ListResult<IntegrationEndpoint>>;
|
|
42
|
+
saveEndpoint: (endpoint: Partial<IntegrationEndpoint>) => Promise<IntegrationEndpoint | null>;
|
|
43
|
+
deleteEndpoint: (id: string) => Promise<boolean>;
|
|
44
|
+
sampleEndpoint: (endpointId: string, pathParams?: Record<string, string>) => Promise<EndpointSampleValue>;
|
|
45
|
+
/**
|
|
46
|
+
* Mappings of one CONNECTION.
|
|
47
|
+
*
|
|
48
|
+
* Scoped by source rather than by a list of endpoint ids: the panel only ever
|
|
49
|
+
* holds the current page of endpoints, so passing ids would silently hide
|
|
50
|
+
* every mapping whose endpoint had not been paged in yet. Resolving that join
|
|
51
|
+
* is the app's job, which is the side that can ask the server for it.
|
|
52
|
+
*/
|
|
53
|
+
listMappings: (sourceId: string, query: ListQuery) => Promise<ListResult<IntegrationMapping>>;
|
|
54
|
+
saveMapping: (mapping: Partial<IntegrationMapping>) => Promise<IntegrationMapping | null>;
|
|
55
|
+
deleteMapping: (id: string) => Promise<boolean>;
|
|
56
|
+
previewRun: (mappingId: string) => Promise<{
|
|
57
|
+
plan: RunPlanValue | null;
|
|
58
|
+
error?: string;
|
|
59
|
+
}>;
|
|
60
|
+
startRun: (mappingId: string, confirm?: boolean) => Promise<{
|
|
61
|
+
runId: string | null;
|
|
62
|
+
error?: string;
|
|
63
|
+
needsConfirm?: boolean;
|
|
64
|
+
}>;
|
|
65
|
+
cancelRun: (runId: string) => Promise<boolean>;
|
|
66
|
+
revertRun: (runId: string, force?: boolean) => Promise<{
|
|
67
|
+
ok: boolean;
|
|
68
|
+
message: string;
|
|
69
|
+
conflicts?: {
|
|
70
|
+
id: string;
|
|
71
|
+
reason: string;
|
|
72
|
+
}[];
|
|
73
|
+
}>;
|
|
74
|
+
listRuns: (query: ListQuery & {
|
|
75
|
+
mappingId?: string;
|
|
76
|
+
}) => Promise<ListResult<IntegrationRun>>;
|
|
77
|
+
/** Target entities this app allows an import to write into, with their columns. */
|
|
78
|
+
listTargets: () => Promise<{
|
|
79
|
+
entity: string;
|
|
80
|
+
label: string;
|
|
81
|
+
fields: string[];
|
|
82
|
+
}[]>;
|
|
83
|
+
};
|
|
84
|
+
export type IntegrationsPageProps = {
|
|
85
|
+
title?: string;
|
|
86
|
+
subtitle?: string;
|
|
87
|
+
className?: string;
|
|
88
|
+
actions: IntegrationsActions;
|
|
89
|
+
/** Realtime run progress, when the app wires the pub/sub topic. */
|
|
90
|
+
onSubscribeProgress?: (handler: (progress: RunProgressValue) => void) => () => void;
|
|
91
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The panel's contract with whatever app mounts it.
|
|
3
|
+
*
|
|
4
|
+
* Every call is an injected action, exactly like the other pages in this kit —
|
|
5
|
+
* the component knows the SHAPE of an integration but nothing about how this
|
|
6
|
+
* particular app talks to its server.
|
|
7
|
+
*
|
|
8
|
+
* The record types below deliberately mirror the system tables rather than
|
|
9
|
+
* re-modelling them, so a column added to the framework does not need a second
|
|
10
|
+
* definition here to become visible.
|
|
11
|
+
*/
|
|
12
|
+
import type { RunIssueValue } from './results';
|
|
13
|
+
export type IntegrationAuthType = 'none' | 'bearer' | 'api_key' | 'basic' | 'oauth2';
|
|
14
|
+
export type IntegrationSource = {
|
|
15
|
+
id: string;
|
|
16
|
+
name: string;
|
|
17
|
+
slug: string;
|
|
18
|
+
/** Any scheme, host and port. HTTPS is not required and must not be enforced. */
|
|
19
|
+
baseUrl: string;
|
|
20
|
+
description?: string | null;
|
|
21
|
+
enabled?: boolean;
|
|
22
|
+
authType: IntegrationAuthType;
|
|
23
|
+
/** Masked preview of the stored credential. The value itself never arrives. */
|
|
24
|
+
authTokenHint?: string | null;
|
|
25
|
+
authHeaderName?: string | null;
|
|
26
|
+
authQueryParam?: string | null;
|
|
27
|
+
extraHeaders?: Record<string, string> | null;
|
|
28
|
+
tokenUrl?: string | null;
|
|
29
|
+
oauthGrantType?: 'password' | 'client_credentials' | null;
|
|
30
|
+
oauthClientId?: string | null;
|
|
31
|
+
oauthClientSecretHint?: string | null;
|
|
32
|
+
oauthUsername?: string | null;
|
|
33
|
+
oauthPasswordHint?: string | null;
|
|
34
|
+
oauthScope?: string | null;
|
|
35
|
+
oauthClientAuth?: 'basic' | 'body' | null;
|
|
36
|
+
/** False turns off certificate verification for THIS source's requests only. */
|
|
37
|
+
tlsVerify?: boolean;
|
|
38
|
+
timeoutMs?: number | null;
|
|
39
|
+
};
|
|
40
|
+
export type PaginationKind = 'none' | 'page_number' | 'offset' | 'cursor' | 'link_header';
|
|
41
|
+
/** Chosen explicitly. A wrong guess silently imports one page. */
|
|
42
|
+
export type PaginationProfileValue = {
|
|
43
|
+
kind: PaginationKind;
|
|
44
|
+
pageParam?: string;
|
|
45
|
+
sizeParam?: string;
|
|
46
|
+
offsetParam?: string;
|
|
47
|
+
limitParam?: string;
|
|
48
|
+
cursorParam?: string;
|
|
49
|
+
nextCursorPath?: string;
|
|
50
|
+
pageSize?: number;
|
|
51
|
+
firstPage?: number;
|
|
52
|
+
totalPath?: string;
|
|
53
|
+
lastPagePath?: string;
|
|
54
|
+
};
|
|
55
|
+
/** Where one path/query parameter of an endpoint gets its value. */
|
|
56
|
+
export type ParamBindingValue = {
|
|
57
|
+
param: string;
|
|
58
|
+
from: 'static';
|
|
59
|
+
value: string;
|
|
60
|
+
} | {
|
|
61
|
+
param: string;
|
|
62
|
+
from: 'endpoint';
|
|
63
|
+
endpointId: string;
|
|
64
|
+
field: string;
|
|
65
|
+
} | {
|
|
66
|
+
param: string;
|
|
67
|
+
from: 'entity';
|
|
68
|
+
entity: string;
|
|
69
|
+
field: string;
|
|
70
|
+
};
|
|
71
|
+
export type IntegrationEndpoint = {
|
|
72
|
+
id: string;
|
|
73
|
+
sourceId: string;
|
|
74
|
+
tag: string;
|
|
75
|
+
name?: string | null;
|
|
76
|
+
method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
77
|
+
path: string;
|
|
78
|
+
description?: string | null;
|
|
79
|
+
queryParams?: Record<string, unknown> | null;
|
|
80
|
+
requestBody?: Record<string, unknown> | null;
|
|
81
|
+
paramBindings?: ParamBindingValue[] | null;
|
|
82
|
+
pagination?: PaginationProfileValue | null;
|
|
83
|
+
responseRootPath?: string | null;
|
|
84
|
+
sampleResponse?: {
|
|
85
|
+
records?: unknown[];
|
|
86
|
+
} | null;
|
|
87
|
+
enabled?: boolean;
|
|
88
|
+
};
|
|
89
|
+
export type MappingTransformValue = 'none' | 'trim' | 'upper' | 'lower' | 'toString' | 'toNumber' | 'toBoolean' | 'dateOnly';
|
|
90
|
+
export type FieldMappingValue = {
|
|
91
|
+
source: string;
|
|
92
|
+
target: string;
|
|
93
|
+
transform?: MappingTransformValue;
|
|
94
|
+
constant?: string;
|
|
95
|
+
fallback?: string;
|
|
96
|
+
};
|
|
97
|
+
export type WriteModeValue = 'upsert' | 'append' | 'replace';
|
|
98
|
+
export type MissingRecordPolicyValue = 'ignore' | 'deactivate' | 'delete';
|
|
99
|
+
export type IntegrationMapping = {
|
|
100
|
+
id: string;
|
|
101
|
+
endpointId: string;
|
|
102
|
+
name: string;
|
|
103
|
+
targetEntity: string;
|
|
104
|
+
fieldMappings: FieldMappingValue[];
|
|
105
|
+
dedupSourceField?: string | null;
|
|
106
|
+
dedupTargetField?: string | null;
|
|
107
|
+
writeMode: WriteModeValue;
|
|
108
|
+
missingRecordPolicy: MissingRecordPolicyValue;
|
|
109
|
+
missingRecordColumn?: string | null;
|
|
110
|
+
missingRecordValue?: string | null;
|
|
111
|
+
lastRunAt?: string | null;
|
|
112
|
+
enabled?: boolean;
|
|
113
|
+
};
|
|
114
|
+
export type RunStatusValue = 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled' | 'reverted';
|
|
115
|
+
export type IntegrationRun = {
|
|
116
|
+
id: string;
|
|
117
|
+
mappingId?: string | null;
|
|
118
|
+
targetEntity?: string | null;
|
|
119
|
+
writeMode?: WriteModeValue | null;
|
|
120
|
+
status: RunStatusValue;
|
|
121
|
+
trigger?: string | null;
|
|
122
|
+
totalFetched: number;
|
|
123
|
+
sourceReportedTotal?: number | null;
|
|
124
|
+
createdCount: number;
|
|
125
|
+
updatedCount: number;
|
|
126
|
+
skippedCount: number;
|
|
127
|
+
deletedCount: number;
|
|
128
|
+
deactivatedCount: number;
|
|
129
|
+
errorCount: number;
|
|
130
|
+
externalCallCount?: number;
|
|
131
|
+
issues?: RunIssueValue[] | null;
|
|
132
|
+
errors?: string[] | null;
|
|
133
|
+
cancelRequested?: boolean;
|
|
134
|
+
startedAt?: string | null;
|
|
135
|
+
finishedAt?: string | null;
|
|
136
|
+
preImagesExpireAt?: string | null;
|
|
137
|
+
revertedAt?: string | null;
|
|
138
|
+
createdAt?: string | null;
|
|
139
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The panel's contract with whatever app mounts it.
|
|
3
|
+
*
|
|
4
|
+
* Every call is an injected action, exactly like the other pages in this kit —
|
|
5
|
+
* the component knows the SHAPE of an integration but nothing about how this
|
|
6
|
+
* particular app talks to its server.
|
|
7
|
+
*
|
|
8
|
+
* The record types below deliberately mirror the system tables rather than
|
|
9
|
+
* re-modelling them, so a column added to the framework does not need a second
|
|
10
|
+
* definition here to become visible.
|
|
11
|
+
*/ export { };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shapes the panel RENDERS rather than stores: what a call reported, what a
|
|
3
|
+
* run would do, and how far a running one has got.
|
|
4
|
+
*/
|
|
5
|
+
import type { MissingRecordPolicyValue, WriteModeValue } from './records';
|
|
6
|
+
export type RunIssueValue = {
|
|
7
|
+
sourceIndex: number;
|
|
8
|
+
kind: string;
|
|
9
|
+
message: string;
|
|
10
|
+
dedupKey?: string | null;
|
|
11
|
+
};
|
|
12
|
+
/** What a run would do, computed without writing. */
|
|
13
|
+
export type RunPlanValue = {
|
|
14
|
+
targetEntity: string;
|
|
15
|
+
writeMode: WriteModeValue;
|
|
16
|
+
totalFetched: number;
|
|
17
|
+
reportedTotal: number | null;
|
|
18
|
+
toCreate: number;
|
|
19
|
+
toUpdate: number;
|
|
20
|
+
toSkip: number;
|
|
21
|
+
missing: number;
|
|
22
|
+
missingPolicy: MissingRecordPolicyValue;
|
|
23
|
+
existingCount: number;
|
|
24
|
+
dedupConfigured: boolean;
|
|
25
|
+
issues: RunIssueValue[];
|
|
26
|
+
warnings: string[];
|
|
27
|
+
sample: Record<string, unknown>[];
|
|
28
|
+
};
|
|
29
|
+
export type ConnectionTestValue = {
|
|
30
|
+
ok: boolean;
|
|
31
|
+
detail?: string;
|
|
32
|
+
error?: string;
|
|
33
|
+
};
|
|
34
|
+
export type EndpointSampleValue = {
|
|
35
|
+
ok: boolean;
|
|
36
|
+
status: number;
|
|
37
|
+
error: string | null;
|
|
38
|
+
recordCount: number;
|
|
39
|
+
sample: unknown[];
|
|
40
|
+
fields: string[];
|
|
41
|
+
/** Top-level keys of the raw body — the answer to "why 0 records". */
|
|
42
|
+
bodyKeys: string[];
|
|
43
|
+
bodyPreview: string | null;
|
|
44
|
+
};
|
|
45
|
+
/** How far a running import has got, as the server reports it. */
|
|
46
|
+
export type RunProgressValue = {
|
|
47
|
+
runId: string;
|
|
48
|
+
phase: 'fetching' | 'mapping' | 'validating' | 'writing' | 'done';
|
|
49
|
+
processed?: number;
|
|
50
|
+
total?: number;
|
|
51
|
+
message?: string;
|
|
52
|
+
};
|
package/dist/fe/index.d.ts
CHANGED
|
@@ -21,6 +21,8 @@ export type { ForgotPasswordAction, ForgotPasswordFormProps, ForgotPasswordHeade
|
|
|
21
21
|
export { ForgotPasswordPage, useForgotPasswordStore, } from './components/ForgotPasswordPage';
|
|
22
22
|
export type { FormBuilderProps, FormFieldConfig, FormFieldProps, FormFieldRenderProps, FormFooterRenderProps, FormLayout, FormMode, FormSize, FormState, UseFormBuilderOptions, UseFormBuilderReturn, } from './components/FormBuilder';
|
|
23
23
|
export { FormBuilder, FormField, formBuilderTheme, useFormBuilder, } from './components/FormBuilder';
|
|
24
|
+
export type { ConnectionTab, IntegrationsActions, IntegrationsPageProps, IntegrationsPageTheme, } from './components/IntegrationsPage';
|
|
25
|
+
export { extendIntegrationsTheme, IntegrationsPage, integrationsPageTheme, useIntegrationsStore, } from './components/IntegrationsPage';
|
|
24
26
|
export type { LoginAction, LoginFeatureConfig, LoginFormData, LoginFormProps, LoginHeaderProps, LoginPageConfig, LoginPageProps, LoginPageVariant, LogoutAction, MeAction, } from './components/LoginPage';
|
|
25
27
|
export { LoginPage, useLoginStore } from './components/LoginPage';
|
|
26
28
|
export type { MagicLinkVerifyAction as MagicLinkVerifyPageAction, MagicLinkVerifyError, MagicLinkVerifyPageConfig, } from './components/MagicLinkVerifyPage';
|
package/dist/fe/index.js
CHANGED
|
@@ -15,6 +15,7 @@ export { ComponentCanvas, ComponentSidebar, createDefaultRegistry, DesignSystemP
|
|
|
15
15
|
export { DeviceCard, DevicesHeader, DevicesPage, useDevicesStore } from './components/DevicesPage';
|
|
16
16
|
export { ForgotPasswordPage, useForgotPasswordStore } from './components/ForgotPasswordPage';
|
|
17
17
|
export { FormBuilder, FormField, formBuilderTheme, useFormBuilder } from './components/FormBuilder';
|
|
18
|
+
export { extendIntegrationsTheme, IntegrationsPage, integrationsPageTheme, useIntegrationsStore } from './components/IntegrationsPage';
|
|
18
19
|
export { LoginPage, useLoginStore } from './components/LoginPage';
|
|
19
20
|
export { MagicLinkVerifyPage, magicLinkVerifyPageTheme, useMagicLinkVerifyStore } from './components/MagicLinkVerifyPage';
|
|
20
21
|
export { extendNotificationCenterTheme, NotificationBell, NotificationCenter, notificationCenterTheme, useNotificationCenterStore } from './components/NotificationCenter';
|