@oronts/vendure-data-hub-plugin 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/dist/dashboard/components/common/ConnectionConfigEditor.tsx +589 -0
  3. package/dist/dashboard/components/common/HeadersEditor.tsx +90 -0
  4. package/dist/dashboard/components/common/ValidationFeedback.tsx +17 -0
  5. package/dist/dashboard/components/common/index.ts +10 -0
  6. package/dist/dashboard/components/pipelines/PipelineEditor.tsx +504 -0
  7. package/dist/dashboard/components/pipelines/PipelineExport.tsx +63 -0
  8. package/dist/dashboard/components/pipelines/PipelineImport.tsx +87 -0
  9. package/dist/dashboard/components/pipelines/ReactFlowPipelineEditor.tsx +539 -0
  10. package/dist/dashboard/components/pipelines/shared/NodePropertiesPanel.tsx +146 -0
  11. package/dist/dashboard/components/pipelines/shared/PipelineNode.tsx +155 -0
  12. package/dist/dashboard/components/pipelines/shared/PipelineSettingsPanel.tsx +392 -0
  13. package/dist/dashboard/components/pipelines/shared/StepListItem.tsx +144 -0
  14. package/dist/dashboard/components/pipelines/shared/index.ts +33 -0
  15. package/dist/dashboard/components/pipelines/shared/visual-node-config.ts +169 -0
  16. package/dist/dashboard/components/shared/LoadMoreButton.tsx +18 -0
  17. package/dist/dashboard/components/shared/entity-selector/EntitySelector.tsx +59 -0
  18. package/dist/dashboard/components/shared/entity-selector/index.ts +1 -0
  19. package/dist/dashboard/components/shared/error-boundary/ErrorBoundary.tsx +90 -0
  20. package/dist/dashboard/components/shared/error-boundary/index.ts +1 -0
  21. package/dist/dashboard/components/shared/feedback/EmptyState.tsx +36 -0
  22. package/dist/dashboard/components/shared/feedback/ErrorState.tsx +69 -0
  23. package/dist/dashboard/components/shared/feedback/LoadingState.tsx +104 -0
  24. package/dist/dashboard/components/shared/feedback/ValidationErrorDisplay.tsx +29 -0
  25. package/dist/dashboard/components/shared/feedback/index.ts +4 -0
  26. package/dist/dashboard/components/shared/file-dropzone/FileDropzone.tsx +167 -0
  27. package/dist/dashboard/components/shared/file-dropzone/index.ts +1 -0
  28. package/dist/dashboard/components/shared/filter-conditions-editor/FilterConditionsEditor.tsx +226 -0
  29. package/dist/dashboard/components/shared/filter-conditions-editor/index.ts +1 -0
  30. package/dist/dashboard/components/shared/index.ts +45 -0
  31. package/dist/dashboard/components/shared/schema-form/SchemaFormRenderer.tsx +248 -0
  32. package/dist/dashboard/components/shared/schema-form/fields/BooleanField.tsx +26 -0
  33. package/dist/dashboard/components/shared/schema-form/fields/FieldWrapper.tsx +28 -0
  34. package/dist/dashboard/components/shared/schema-form/fields/FileUploadField.tsx +171 -0
  35. package/dist/dashboard/components/shared/schema-form/fields/JsonField.tsx +132 -0
  36. package/dist/dashboard/components/shared/schema-form/fields/NumberField.tsx +33 -0
  37. package/dist/dashboard/components/shared/schema-form/fields/SelectField.tsx +70 -0
  38. package/dist/dashboard/components/shared/schema-form/fields/StringField.tsx +36 -0
  39. package/dist/dashboard/components/shared/schema-form/fields/TextareaField.tsx +31 -0
  40. package/dist/dashboard/components/shared/schema-form/fields/index.ts +23 -0
  41. package/dist/dashboard/components/shared/schema-form/index.ts +2 -0
  42. package/dist/dashboard/components/shared/schema-form/utils.ts +3 -0
  43. package/dist/dashboard/components/shared/selectable-card/SelectableCard.tsx +65 -0
  44. package/dist/dashboard/components/shared/selectable-card/index.ts +1 -0
  45. package/dist/dashboard/components/shared/stat-card/StatCard.tsx +121 -0
  46. package/dist/dashboard/components/shared/stat-card/index.ts +1 -0
  47. package/dist/dashboard/components/shared/step-config/AdapterRequiredWarning.tsx +25 -0
  48. package/dist/dashboard/components/shared/step-config/AdapterSelector.tsx +109 -0
  49. package/dist/dashboard/components/shared/step-config/AdvancedEditors.tsx +634 -0
  50. package/dist/dashboard/components/shared/step-config/EnrichConfigComponent.tsx +295 -0
  51. package/dist/dashboard/components/shared/step-config/ExtractTestResults.tsx +143 -0
  52. package/dist/dashboard/components/shared/step-config/GateConfigComponent.tsx +127 -0
  53. package/dist/dashboard/components/shared/step-config/LoadTestResults.tsx +104 -0
  54. package/dist/dashboard/components/shared/step-config/OperatorCard.tsx +266 -0
  55. package/dist/dashboard/components/shared/step-config/OperatorCheatSheetButton.tsx +54 -0
  56. package/dist/dashboard/components/shared/step-config/OperatorFieldInput.tsx +209 -0
  57. package/dist/dashboard/components/shared/step-config/RetrySettingsComponent.tsx +111 -0
  58. package/dist/dashboard/components/shared/step-config/RouteConfigComponent.tsx +125 -0
  59. package/dist/dashboard/components/shared/step-config/StepConfigPanel.tsx +564 -0
  60. package/dist/dashboard/components/shared/step-config/StepTester.tsx +165 -0
  61. package/dist/dashboard/components/shared/step-config/TestResultContainer.tsx +57 -0
  62. package/dist/dashboard/components/shared/step-config/TransformTestResults.tsx +130 -0
  63. package/dist/dashboard/components/shared/step-config/ValidateConfigComponent.tsx +334 -0
  64. package/dist/dashboard/components/shared/step-config/index.ts +29 -0
  65. package/dist/dashboard/components/shared/step-config/step-test-handlers.ts +297 -0
  66. package/dist/dashboard/components/shared/trigger-config/TriggerForm.tsx +478 -0
  67. package/dist/dashboard/components/shared/trigger-config/index.ts +1 -0
  68. package/dist/dashboard/components/shared/triggers-panel/TriggersPanel.tsx +281 -0
  69. package/dist/dashboard/components/shared/triggers-panel/index.ts +1 -0
  70. package/dist/dashboard/components/shared/wizard/ConfigurationNameCard.tsx +59 -0
  71. package/dist/dashboard/components/shared/wizard/SummaryCard.tsx +53 -0
  72. package/dist/dashboard/components/shared/wizard/WizardFooter.tsx +47 -0
  73. package/dist/dashboard/components/shared/wizard/WizardProgressBar.tsx +78 -0
  74. package/dist/dashboard/components/shared/wizard/index.ts +4 -0
  75. package/dist/dashboard/components/shared/wizard-trigger/TriggerSchemaFields.tsx +128 -0
  76. package/dist/dashboard/components/shared/wizard-trigger/TriggerSelector.tsx +33 -0
  77. package/dist/dashboard/components/shared/wizard-trigger/index.ts +2 -0
  78. package/dist/dashboard/components/templates/TemplateGallery.tsx +210 -0
  79. package/dist/dashboard/components/templates/TemplatePreview.tsx +214 -0
  80. package/dist/dashboard/components/templates/index.ts +4 -0
  81. package/dist/dashboard/components/wizards/export-wizard/DestinationStep.tsx +207 -0
  82. package/dist/dashboard/components/wizards/export-wizard/ExportWizard.tsx +221 -0
  83. package/dist/dashboard/components/wizards/export-wizard/FieldsStep.tsx +159 -0
  84. package/dist/dashboard/components/wizards/export-wizard/FormatStep.tsx +246 -0
  85. package/dist/dashboard/components/wizards/export-wizard/ReviewStep.tsx +231 -0
  86. package/dist/dashboard/components/wizards/export-wizard/SourceStep.tsx +154 -0
  87. package/dist/dashboard/components/wizards/export-wizard/TriggerStep.tsx +234 -0
  88. package/dist/dashboard/components/wizards/export-wizard/constants.ts +73 -0
  89. package/dist/dashboard/components/wizards/export-wizard/index.ts +2 -0
  90. package/dist/dashboard/components/wizards/export-wizard/types.ts +39 -0
  91. package/dist/dashboard/components/wizards/import-wizard/ImportWizard.tsx +350 -0
  92. package/dist/dashboard/components/wizards/import-wizard/MappingStep.tsx +286 -0
  93. package/dist/dashboard/components/wizards/import-wizard/PreviewStep.tsx +79 -0
  94. package/dist/dashboard/components/wizards/import-wizard/ReviewStep.tsx +266 -0
  95. package/dist/dashboard/components/wizards/import-wizard/SourceStep.tsx +537 -0
  96. package/dist/dashboard/components/wizards/import-wizard/StrategyStep.tsx +328 -0
  97. package/dist/dashboard/components/wizards/import-wizard/TargetStep.tsx +76 -0
  98. package/dist/dashboard/components/wizards/import-wizard/TemplateStep.tsx +116 -0
  99. package/dist/dashboard/components/wizards/import-wizard/TransformStep.tsx +666 -0
  100. package/dist/dashboard/components/wizards/import-wizard/TriggerStep.tsx +51 -0
  101. package/dist/dashboard/components/wizards/import-wizard/constants.ts +104 -0
  102. package/dist/dashboard/components/wizards/import-wizard/index.ts +3 -0
  103. package/dist/dashboard/components/wizards/import-wizard/types.ts +35 -0
  104. package/dist/dashboard/components/wizards/index.ts +7 -0
  105. package/dist/dashboard/components/wizards/shared/WizardStepContainer.tsx +27 -0
  106. package/dist/dashboard/components/wizards/shared/constants.ts +16 -0
  107. package/dist/dashboard/components/wizards/shared/index.ts +10 -0
  108. package/dist/dashboard/constants/colors.ts +25 -0
  109. package/dist/dashboard/constants/connection-defaults.ts +7 -0
  110. package/dist/dashboard/constants/connection-types.ts +1 -0
  111. package/dist/dashboard/constants/defaults.ts +18 -0
  112. package/dist/dashboard/constants/editor.ts +69 -0
  113. package/dist/dashboard/constants/enum-maps.ts +18 -0
  114. package/dist/dashboard/constants/fallbacks.ts +44 -0
  115. package/dist/dashboard/constants/file-format-registry.ts +206 -0
  116. package/dist/dashboard/constants/index.ts +24 -0
  117. package/dist/dashboard/constants/navigation.ts +29 -0
  118. package/dist/dashboard/constants/permissions.ts +41 -0
  119. package/dist/dashboard/constants/placeholders.ts +77 -0
  120. package/dist/dashboard/constants/routes.ts +12 -0
  121. package/dist/dashboard/constants/run-status.ts +1 -0
  122. package/dist/dashboard/constants/sentinel-values.ts +12 -0
  123. package/dist/dashboard/constants/step-configs.ts +9 -0
  124. package/dist/dashboard/constants/step-mappings.ts +170 -0
  125. package/dist/dashboard/constants/steps.ts +37 -0
  126. package/dist/dashboard/constants/toast-messages.ts +149 -0
  127. package/dist/dashboard/constants/triggers.ts +5 -0
  128. package/dist/dashboard/constants/ui-config.ts +139 -0
  129. package/dist/dashboard/constants/ui-dimensions.ts +145 -0
  130. package/dist/dashboard/constants/ui-states.ts +28 -0
  131. package/dist/dashboard/constants/ui-types.ts +85 -0
  132. package/dist/dashboard/constants/validation-patterns.ts +26 -0
  133. package/dist/dashboard/gql/gql.ts +370 -0
  134. package/dist/dashboard/gql/graphql.ts +10378 -0
  135. package/dist/dashboard/gql/index.ts +1 -0
  136. package/dist/dashboard/hooks/api/index.ts +115 -0
  137. package/dist/dashboard/hooks/api/mutation-helpers.ts +34 -0
  138. package/dist/dashboard/hooks/api/use-adapters.ts +92 -0
  139. package/dist/dashboard/hooks/api/use-config-options.ts +513 -0
  140. package/dist/dashboard/hooks/api/use-connections.ts +84 -0
  141. package/dist/dashboard/hooks/api/use-entity-field-schemas.ts +99 -0
  142. package/dist/dashboard/hooks/api/use-entity-loaders.ts +45 -0
  143. package/dist/dashboard/hooks/api/use-hooks.ts +68 -0
  144. package/dist/dashboard/hooks/api/use-logs.ts +102 -0
  145. package/dist/dashboard/hooks/api/use-pipeline-runs.ts +221 -0
  146. package/dist/dashboard/hooks/api/use-pipelines.ts +279 -0
  147. package/dist/dashboard/hooks/api/use-queues.ts +141 -0
  148. package/dist/dashboard/hooks/api/use-secrets.ts +75 -0
  149. package/dist/dashboard/hooks/api/use-settings.ts +55 -0
  150. package/dist/dashboard/hooks/api/use-step-tester.ts +79 -0
  151. package/dist/dashboard/hooks/index.ts +13 -0
  152. package/dist/dashboard/hooks/use-adapter-catalog.ts +253 -0
  153. package/dist/dashboard/hooks/use-export-templates.ts +80 -0
  154. package/dist/dashboard/hooks/use-import-templates.ts +139 -0
  155. package/dist/dashboard/hooks/use-load-more.ts +29 -0
  156. package/dist/dashboard/hooks/use-stable-keys.ts +54 -0
  157. package/dist/dashboard/hooks/use-trigger-types.ts +100 -0
  158. package/dist/dashboard/hooks/use-wizard-navigation.ts +128 -0
  159. package/dist/dashboard/index.tsx +55 -0
  160. package/dist/dashboard/routes/adapters/AdapterCard.tsx +102 -0
  161. package/dist/dashboard/routes/adapters/AdapterConstants.tsx +20 -0
  162. package/dist/dashboard/routes/adapters/AdapterDetail.tsx +208 -0
  163. package/dist/dashboard/routes/adapters/AdapterTypeSection.tsx +105 -0
  164. package/dist/dashboard/routes/adapters/AdaptersPage.tsx +276 -0
  165. package/dist/dashboard/routes/adapters/AdaptersTable.tsx +107 -0
  166. package/dist/dashboard/routes/adapters/index.ts +1 -0
  167. package/dist/dashboard/routes/connections/ConnectionDetail.tsx +218 -0
  168. package/dist/dashboard/routes/connections/ConnectionsList.tsx +34 -0
  169. package/dist/dashboard/routes/connections/index.ts +2 -0
  170. package/dist/dashboard/routes/hooks/Hooks.tsx +425 -0
  171. package/dist/dashboard/routes/hooks/hook-stages.ts +52 -0
  172. package/dist/dashboard/routes/hooks/index.ts +1 -0
  173. package/dist/dashboard/routes/index.ts +8 -0
  174. package/dist/dashboard/routes/logs/Logs.tsx +93 -0
  175. package/dist/dashboard/routes/logs/components/LogDetailDrawer.tsx +118 -0
  176. package/dist/dashboard/routes/logs/components/LogExplorerTab.tsx +367 -0
  177. package/dist/dashboard/routes/logs/components/LogLevelBadge.tsx +34 -0
  178. package/dist/dashboard/routes/logs/components/LogTableRow.tsx +70 -0
  179. package/dist/dashboard/routes/logs/components/LogsOverviewTab.tsx +178 -0
  180. package/dist/dashboard/routes/logs/components/RealtimeLogTab.tsx +122 -0
  181. package/dist/dashboard/routes/logs/index.ts +1 -0
  182. package/dist/dashboard/routes/pipelines/ErrorAuditList.tsx +39 -0
  183. package/dist/dashboard/routes/pipelines/ExportWizardPage.tsx +96 -0
  184. package/dist/dashboard/routes/pipelines/ImportWizardPage.tsx +104 -0
  185. package/dist/dashboard/routes/pipelines/PipelineDetail.tsx +211 -0
  186. package/dist/dashboard/routes/pipelines/PipelineRunsBlock.tsx +377 -0
  187. package/dist/dashboard/routes/pipelines/PipelinesList.tsx +87 -0
  188. package/dist/dashboard/routes/pipelines/RetryPatchHelper.tsx +51 -0
  189. package/dist/dashboard/routes/pipelines/RunDetailsPanel.tsx +238 -0
  190. package/dist/dashboard/routes/pipelines/RunErrorsList.tsx +116 -0
  191. package/dist/dashboard/routes/pipelines/StepCounters.tsx +24 -0
  192. package/dist/dashboard/routes/pipelines/StepSummaryTable.tsx +36 -0
  193. package/dist/dashboard/routes/pipelines/components/DryRunDialog.tsx +341 -0
  194. package/dist/dashboard/routes/pipelines/components/PipelineActionButtons.tsx +201 -0
  195. package/dist/dashboard/routes/pipelines/components/PipelineEditorToggle.tsx +116 -0
  196. package/dist/dashboard/routes/pipelines/components/PipelineFormFields.tsx +156 -0
  197. package/dist/dashboard/routes/pipelines/components/PipelineWebhookInfo.tsx +111 -0
  198. package/dist/dashboard/routes/pipelines/components/ReviewActionsPanel.tsx +342 -0
  199. package/dist/dashboard/routes/pipelines/components/ValidationPanel.tsx +121 -0
  200. package/dist/dashboard/routes/pipelines/components/VersionHistoryDialog.tsx +131 -0
  201. package/dist/dashboard/routes/pipelines/components/index.ts +25 -0
  202. package/dist/dashboard/routes/pipelines/hooks/index.ts +1 -0
  203. package/dist/dashboard/routes/pipelines/hooks/use-pipeline-validation.ts +114 -0
  204. package/dist/dashboard/routes/pipelines/index.ts +4 -0
  205. package/dist/dashboard/routes/pipelines/utils/index.ts +1 -0
  206. package/dist/dashboard/routes/pipelines/utils/pipeline-conversion.ts +261 -0
  207. package/dist/dashboard/routes/queues/ConsumersTable.tsx +134 -0
  208. package/dist/dashboard/routes/queues/DeadLettersTable.tsx +118 -0
  209. package/dist/dashboard/routes/queues/FailedRunsTable.tsx +74 -0
  210. package/dist/dashboard/routes/queues/QueuesPage.tsx +290 -0
  211. package/dist/dashboard/routes/queues/index.ts +1 -0
  212. package/dist/dashboard/routes/queues/types.ts +22 -0
  213. package/dist/dashboard/routes/secrets/SecretDetail.tsx +278 -0
  214. package/dist/dashboard/routes/secrets/SecretsList.tsx +34 -0
  215. package/dist/dashboard/routes/secrets/index.ts +2 -0
  216. package/dist/dashboard/routes/settings/Settings.tsx +343 -0
  217. package/dist/dashboard/routes/settings/index.ts +1 -0
  218. package/dist/dashboard/types/index.ts +89 -0
  219. package/dist/dashboard/types/pipeline.ts +51 -0
  220. package/dist/dashboard/types/ui-types.ts +400 -0
  221. package/dist/dashboard/types/wizard.ts +235 -0
  222. package/dist/dashboard/utils/adapter-grouping.ts +43 -0
  223. package/dist/dashboard/utils/column-analysis.ts +11 -0
  224. package/dist/dashboard/utils/field-preparation.ts +31 -0
  225. package/dist/dashboard/utils/form-validation.ts +373 -0
  226. package/dist/dashboard/utils/formatters.ts +92 -0
  227. package/dist/dashboard/utils/icon-resolver.ts +35 -0
  228. package/dist/dashboard/utils/index.ts +60 -0
  229. package/dist/dashboard/utils/query-key-factory.ts +54 -0
  230. package/dist/dashboard/utils/step-helpers.ts +32 -0
  231. package/dist/dashboard/utils/string-helpers.ts +4 -0
  232. package/dist/dashboard/utils/template-helpers.ts +26 -0
  233. package/dist/dashboard/utils/trigger-sync.ts +138 -0
  234. package/dist/dashboard/utils/wizard-to-pipeline.ts +569 -0
  235. package/package.json +2 -2
@@ -0,0 +1,24 @@
1
+ export * from './navigation';
2
+ export * from './steps';
3
+ export * from './triggers';
4
+ export * from './run-status';
5
+ export * from './editor';
6
+ export * from './ui-config';
7
+ export * from './step-mappings';
8
+ export * from './enum-maps';
9
+ export * from './ui-dimensions';
10
+ export * from './colors';
11
+ export * from './step-configs';
12
+ export * from './routes';
13
+ export * from './permissions';
14
+ export * from './connection-defaults';
15
+ export * from './defaults';
16
+ export * from './validation-patterns';
17
+ export * from './sentinel-values';
18
+ export * from './ui-types';
19
+ export * from './connection-types';
20
+ export * from './ui-states';
21
+ export * from './toast-messages';
22
+ export * from './placeholders';
23
+ export * from './fallbacks';
24
+ export * from './file-format-registry';
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Navigation constants for DataHub admin UI.
3
+ *
4
+ * Note: These values must match the backend constants in src/constants/core.ts
5
+ * to ensure proper navigation and routing. The dashboard maintains its own copy
6
+ * to avoid layer violations between dashboard and backend code.
7
+ */
8
+
9
+ /** Navigation section identifier for DataHub */
10
+ export const DATAHUB_NAV_SECTION = 'data-hub';
11
+
12
+ /** Navigation item ID for pipelines */
13
+ export const DATAHUB_NAV_ID = 'data-hub-pipelines';
14
+
15
+ /** Base route for pipeline pages */
16
+ export const DATAHUB_ROUTE_BASE = '/data-hub/pipelines';
17
+
18
+ /** Base path for DataHub REST API endpoints */
19
+ export const DATAHUB_API_BASE = '/data-hub';
20
+
21
+ /** File upload API endpoint */
22
+ export const DATAHUB_API_UPLOAD = `${DATAHUB_API_BASE}/upload`;
23
+
24
+ /**
25
+ * Generate webhook URL for a pipeline.
26
+ * @param code - The pipeline code
27
+ */
28
+ export const DATAHUB_API_WEBHOOK = (code: string) =>
29
+ `${DATAHUB_API_BASE}/webhook/${code}`;
@@ -0,0 +1,41 @@
1
+ export const DATAHUB_PERMISSIONS = {
2
+ // Pipeline CRUD permissions
3
+ CREATE_PIPELINE: 'CreateDataHubPipeline',
4
+ READ_PIPELINE: 'ReadDataHubPipeline',
5
+ UPDATE_PIPELINE: 'UpdateDataHubPipeline',
6
+ DELETE_PIPELINE: 'DeleteDataHubPipeline',
7
+
8
+ // Secret CRUD permissions
9
+ CREATE_SECRET: 'CreateDataHubSecret',
10
+ READ_SECRET: 'ReadDataHubSecret',
11
+ UPDATE_SECRET: 'UpdateDataHubSecret',
12
+ DELETE_SECRET: 'DeleteDataHubSecret',
13
+
14
+ // Pipeline execution permissions
15
+ RUN_PIPELINE: 'RunDataHubPipeline',
16
+ VIEW_RUNS: 'ViewDataHubRuns',
17
+ PUBLISH_PIPELINE: 'PublishDataHubPipeline',
18
+ REVIEW_PIPELINE: 'ReviewDataHubPipeline',
19
+
20
+ // Configuration management permissions
21
+ MANAGE_ADAPTERS: 'ManageDataHubAdapters',
22
+ MANAGE_CONNECTIONS: 'ManageDataHubConnections',
23
+ UPDATE_SETTINGS: 'UpdateDataHubSettings',
24
+
25
+ // Quarantine/error handling permissions (using consistent naming)
26
+ VIEW_QUARANTINE: 'ViewDataHubQuarantine',
27
+ EDIT_QUARANTINE: 'EditDataHubQuarantine',
28
+ REPLAY_RECORD: 'ReplayDataHubRecord',
29
+
30
+ // Analytics and monitoring permissions
31
+ VIEW_ANALYTICS: 'ViewDataHubAnalytics',
32
+ MANAGE_WEBHOOKS: 'ManageDataHubWebhooks',
33
+ MANAGE_DESTINATIONS: 'ManageDataHubDestinations',
34
+ MANAGE_FEEDS: 'ManageDataHubFeeds',
35
+ VIEW_ENTITY_SCHEMAS: 'ViewDataHubEntitySchemas',
36
+ SUBSCRIBE_EVENTS: 'SubscribeDataHubEvents',
37
+
38
+ // File management permissions
39
+ MANAGE_FILES: 'ManageDataHubFiles',
40
+ READ_FILES: 'ReadDataHubFiles',
41
+ } as const;
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Placeholder Text Constants
3
+ *
4
+ * Centralized placeholder text for form inputs and sample data.
5
+ * Eliminates hardcoded strings scattered across components.
6
+ */
7
+
8
+ export const PLACEHOLDERS = {
9
+ // Field inputs
10
+ FIELD_NAME: 'Field name (e.g., sku, price)',
11
+ REGEX_PATTERN: 'Regex pattern (e.g., ^[A-Z]{3}-\\d+$)',
12
+ ERROR_MESSAGE: 'Error message (optional)',
13
+
14
+ // JSON inputs
15
+ JSON_SAMPLE: '{"key": "value"}',
16
+ JSON_ARRAY_SAMPLE: '[{"id": 1}, {"id": 2}]',
17
+ SAMPLE_RECORDS: '[{ "id": "1", "name": "Example" }]',
18
+
19
+ // Authentication
20
+ API_KEY: 'your-api-key',
21
+ BEARER_TOKEN: 'your-bearer-token',
22
+ BASIC_USERNAME: 'username',
23
+ BASIC_PASSWORD: 'password',
24
+ API_KEY_SECRET: 'api-key-secret',
25
+ PASSWORD_SECRET: 'password-secret',
26
+ API_KEY_HEADER: 'X-API-Key',
27
+ SERVICE_USER: 'service-user',
28
+
29
+ // Connection
30
+ HOST: 'localhost',
31
+ PORT: '5432',
32
+ DATABASE_NAME: 'my_database',
33
+ TABLE_NAME: 'my_table',
34
+
35
+ // URLs
36
+ API_URL: 'https://api.example.com/v1',
37
+ WEBHOOK_URL: 'https://example.com/webhook',
38
+
39
+ // Headers
40
+ HEADER_NAME: 'X-Custom-Header',
41
+ HEADER_VALUE: 'header-value',
42
+
43
+ // Codes and identifiers
44
+ PIPELINE_NAME: 'My Pipeline',
45
+ PIPELINE_CODE: 'my-pipeline-code',
46
+ SECRET_CODE: 'my-secret',
47
+ CONNECTION_CODE: 'my-connection',
48
+
49
+ // Query inputs
50
+ SQL_QUERY: 'SELECT * FROM table WHERE status = $1',
51
+ GRAPHQL_QUERY: '{ products { id name } }',
52
+
53
+ // File paths
54
+ FILE_PATH: '/path/to/file.csv',
55
+ OUTPUT_DIRECTORY: '/output',
56
+
57
+ // Cron
58
+ CRON_EXPRESSION: '0 */6 * * *',
59
+ } as const;
60
+
61
+ /**
62
+ * Default sample data for testing
63
+ */
64
+ export const DEFAULT_SAMPLE_DATA = `[
65
+ { "id": "1", "sku": "SKU-001", "name": "Product One", "price": 99.99 },
66
+ { "id": "2", "sku": "SKU-002", "name": "Product Two", "price": 149.99 }
67
+ ]`;
68
+
69
+ /**
70
+ * Step test descriptions
71
+ */
72
+ export const STEP_TEST_DESCRIPTIONS = {
73
+ EXTRACT: 'Extracts data using the configured adapter and returns sample records.',
74
+ TRANSFORM: 'Applies configured transformations to these records.',
75
+ VALIDATE: 'Runs validation rules on these records.',
76
+ LOAD: 'Loads records into the target system.',
77
+ } as const;
@@ -0,0 +1,12 @@
1
+ import { DATAHUB_ROUTE_BASE, DATAHUB_API_BASE } from './navigation';
2
+
3
+ export const ROUTES = {
4
+ PIPELINES: DATAHUB_ROUTE_BASE,
5
+ HOOKS: `${DATAHUB_API_BASE}/hooks`,
6
+ SETTINGS: `${DATAHUB_API_BASE}/settings`,
7
+ ADAPTERS: `${DATAHUB_API_BASE}/adapters`,
8
+ LOGS: `${DATAHUB_API_BASE}/logs`,
9
+ QUEUES: `${DATAHUB_API_BASE}/queues`,
10
+ SECRETS: `${DATAHUB_API_BASE}/secrets`,
11
+ CONNECTIONS: `${DATAHUB_API_BASE}/connections`,
12
+ } as const;
@@ -0,0 +1 @@
1
+ export { RUN_STATUS } from '../../shared/constants';
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Sentinel values used for Select components that need to represent
3
+ * empty/unselected states. HTML select elements require non-empty values,
4
+ * so we use these sentinel strings to represent "no selection".
5
+ */
6
+ export const SENTINEL_VALUES = {
7
+ /** Represents an empty/unmapped field - use when a field should be cleared */
8
+ EMPTY: '__empty__',
9
+ /** Represents no selection - use for optional select dropdowns */
10
+ NONE: '__none__',
11
+ } as const;
12
+
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Default values for route step branch configuration.
3
+ */
4
+ export const ROUTE_BRANCH_DEFAULTS = {
5
+ /** Prefix for auto-generated branch names */
6
+ namePrefix: 'branch-',
7
+ /** Maximum number of branches allowed per route step */
8
+ maxBranches: 10,
9
+ } as const;
@@ -0,0 +1,170 @@
1
+ import type { StepType } from '../../shared/types';
2
+ import type { VisualNodeCategory } from '../types/pipeline';
3
+ import type { LucideIcon } from 'lucide-react';
4
+ import type { StepConfig } from './steps';
5
+ import { DEFAULT_STEP_CONFIGS } from './steps';
6
+ import { resolveIconName } from '../utils/icon-resolver';
7
+
8
+ export const NODE_CATEGORIES = {
9
+ TRIGGER: 'trigger',
10
+ SOURCE: 'source',
11
+ TRANSFORM: 'transform',
12
+ VALIDATE: 'validate',
13
+ CONDITION: 'condition',
14
+ ENRICH: 'enrich',
15
+ LOAD: 'load',
16
+ EXPORT: 'export',
17
+ FEED: 'feed',
18
+ SINK: 'sink',
19
+ FILTER: 'filter',
20
+ GATE: 'gate',
21
+ } as const satisfies Record<string, VisualNodeCategory>;
22
+
23
+ export const ADAPTER_TYPES = {
24
+ TRIGGER: 'TRIGGER',
25
+ EXTRACTOR: 'EXTRACTOR',
26
+ OPERATOR: 'OPERATOR',
27
+ VALIDATOR: 'VALIDATOR',
28
+ ENRICHER: 'ENRICHER',
29
+ ROUTER: 'ROUTER',
30
+ LOADER: 'LOADER',
31
+ EXPORTER: 'EXPORTER',
32
+ FEED: 'FEED',
33
+ SINK: 'SINK',
34
+ } as const;
35
+
36
+ // ---------------------------------------------------------------------------
37
+ // Step mapping result type
38
+ // ---------------------------------------------------------------------------
39
+
40
+ export interface StepMappings {
41
+ stepTypeToCategory: Record<string, VisualNodeCategory>;
42
+ categoryToStepType: Record<string, StepType>;
43
+ categoryToAdapterType: Record<string, string>;
44
+ adapterTypeToNodeType: Record<string, string>;
45
+ adapterTypeToCategory: Record<string, string>;
46
+ categoryColors: Record<VisualNodeCategory, string>;
47
+ }
48
+
49
+ // ---------------------------------------------------------------------------
50
+ // Dynamic builder: derives all maps from step config data
51
+ // ---------------------------------------------------------------------------
52
+
53
+ /**
54
+ * Maps backend adapter type to UI category label for adapter catalog grouping.
55
+ * This is the only map not derivable from step configs, so it stays hand-maintained.
56
+ */
57
+ const ADAPTER_TYPE_CATEGORY_LABELS: Record<string, string> = {
58
+ EXTRACTOR: 'SOURCES',
59
+ OPERATOR: 'TRANSFORMS',
60
+ VALIDATOR: 'VALIDATION',
61
+ ENRICHER: 'TRANSFORMS',
62
+ ROUTER: 'ROUTING',
63
+ LOADER: 'DESTINATIONS',
64
+ EXPORTER: 'EXPORTS',
65
+ FEED: 'FEEDS',
66
+ SINK: 'SINKS',
67
+ };
68
+
69
+ /**
70
+ * Internal builder used by both the static fallback derivation and the public
71
+ * `buildStepMappings` function.
72
+ *
73
+ * `adapterTypeToCategory` (UI labels like SOURCES, TRANSFORMS) is not derivable from
74
+ * step configs alone, so it must be provided as a parameter.
75
+ */
76
+ function buildStepMappingsInternal(
77
+ stepConfigs: Record<string, StepConfig>,
78
+ adapterTypeCategoryLabels: Record<string, string>,
79
+ ): StepMappings {
80
+ const stepTypeToCategory: Record<string, VisualNodeCategory> = {};
81
+ const categoryToStepType: Record<string, StepType> = {};
82
+ const categoryToAdapterType: Record<string, string> = { filter: 'OPERATOR' };
83
+ const adapterTypeToNodeType: Record<string, string> = {};
84
+ const categoryColors: Record<string, string> = {};
85
+
86
+ for (const config of Object.values(stepConfigs)) {
87
+ const stepType = config.type;
88
+ const category = config.nodeType as VisualNodeCategory;
89
+
90
+ // stepType -> category
91
+ stepTypeToCategory[stepType] = category;
92
+
93
+ // category -> stepType (first wins for shared categories)
94
+ if (!(category in categoryToStepType)) {
95
+ categoryToStepType[category] = stepType;
96
+ }
97
+
98
+ // category -> adapterType
99
+ if (config.adapterType) {
100
+ categoryToAdapterType[category] = config.adapterType;
101
+ // adapterType -> nodeType (first wins for shared adapter types like OPERATOR)
102
+ if (!(config.adapterType in adapterTypeToNodeType)) {
103
+ adapterTypeToNodeType[config.adapterType] = category;
104
+ }
105
+ }
106
+
107
+ // category -> color
108
+ categoryColors[category] = config.color;
109
+ }
110
+
111
+ // filter category shares transform's color
112
+ if (!categoryColors.filter && categoryColors.transform) {
113
+ categoryColors.filter = categoryColors.transform;
114
+ }
115
+
116
+ return {
117
+ stepTypeToCategory,
118
+ categoryToStepType,
119
+ categoryToAdapterType,
120
+ adapterTypeToNodeType,
121
+ adapterTypeToCategory: { ...adapterTypeCategoryLabels },
122
+ categoryColors: categoryColors as Record<VisualNodeCategory, string>,
123
+ };
124
+ }
125
+
126
+ /**
127
+ * Builds all step mapping tables from backend step config data.
128
+ *
129
+ * The `adapterType` field on each config drives `categoryToAdapterType` and `adapterTypeToNodeType`.
130
+ * The `nodeType` field (equal to the visual node category) drives `adapterTypeToNodeType`.
131
+ * The `category` field drives `stepTypeToCategory` and `categoryToStepType`.
132
+ */
133
+ export function buildStepMappings(stepConfigs: Record<string, StepConfig>): StepMappings {
134
+ return buildStepMappingsInternal(stepConfigs, ADAPTER_TYPE_CATEGORY_LABELS);
135
+ }
136
+
137
+ // ---------------------------------------------------------------------------
138
+ // Auto-derived fallback maps from DEFAULT_STEP_CONFIGS
139
+ // ---------------------------------------------------------------------------
140
+
141
+ const _derived = buildStepMappingsInternal(DEFAULT_STEP_CONFIGS, ADAPTER_TYPE_CATEGORY_LABELS);
142
+
143
+ export const STEP_TYPE_TO_CATEGORY = _derived.stepTypeToCategory;
144
+ export const CATEGORY_TO_STEP_TYPE = _derived.categoryToStepType;
145
+ export const CATEGORY_TO_ADAPTER_TYPE = _derived.categoryToAdapterType;
146
+ export const ADAPTER_TYPE_TO_NODE_TYPE = _derived.adapterTypeToNodeType;
147
+ export const ADAPTER_TYPE_TO_CATEGORY = _derived.adapterTypeToCategory;
148
+ export const CATEGORY_COLORS = _derived.categoryColors;
149
+
150
+ /** Static fallback mappings used during loading before backend data arrives. */
151
+ export const FALLBACK_STEP_MAPPINGS: StepMappings = _derived;
152
+
153
+ // ---------------------------------------------------------------------------
154
+ // Helper functions
155
+ // ---------------------------------------------------------------------------
156
+
157
+ export function mapStepTypeToCategory(stepType: string): VisualNodeCategory {
158
+ const type = String(stepType).toUpperCase();
159
+ return STEP_TYPE_TO_CATEGORY[type] ?? 'transform';
160
+ }
161
+
162
+ export function mapCategoryToStepType(category: string): StepType {
163
+ return CATEGORY_TO_STEP_TYPE[category] ?? 'TRANSFORM';
164
+ }
165
+
166
+ export function getStepTypeIcon(stepType: string): LucideIcon | undefined {
167
+ const type = String(stepType).toUpperCase();
168
+ const config = DEFAULT_STEP_CONFIGS[type as StepType];
169
+ return config ? resolveIconName(config.icon) : undefined;
170
+ }
@@ -0,0 +1,37 @@
1
+ import type { StepType } from '../../shared/types';
2
+ import { STEP_TYPE, SHARED_STEP_TYPE_CONFIGS } from '../../shared/constants';
3
+
4
+ export { STEP_TYPE };
5
+
6
+ export interface StepConfig {
7
+ readonly type: StepType;
8
+ readonly label: string;
9
+ readonly description: string;
10
+ readonly icon: string;
11
+ readonly color: string;
12
+ readonly bgColor: string;
13
+ readonly borderColor: string;
14
+ readonly inputs: number;
15
+ readonly outputs: number;
16
+ /** Backend adapter type for registry lookup (e.g. EXTRACTOR, OPERATOR). Null for step types without adapters. */
17
+ readonly adapterType: string | null;
18
+ /** Visual node type for the pipeline editor (e.g. source, transform, load). */
19
+ readonly nodeType: string;
20
+ }
21
+
22
+ /**
23
+ * Static fallback step configs used during loading before backend data is available.
24
+ * At runtime, prefer `useStepConfigs()` hook which returns backend-driven data.
25
+ * Also used by non-React code (visual-node-config, step-mappings) that cannot call hooks.
26
+ *
27
+ * Derived from the shared single source of truth (SHARED_STEP_TYPE_CONFIGS).
28
+ */
29
+ export const DEFAULT_STEP_CONFIGS: Record<StepType, StepConfig> =
30
+ SHARED_STEP_TYPE_CONFIGS.reduce(
31
+ (acc, cfg) => {
32
+ acc[cfg.type] = cfg;
33
+ return acc;
34
+ },
35
+ {} as Record<StepType, StepConfig>,
36
+ );
37
+
@@ -0,0 +1,149 @@
1
+ import { getErrorMessage } from '../../shared';
2
+
3
+ /**
4
+ * Centralized toast message constants for the dashboard
5
+ *
6
+ * Follows naming convention:
7
+ * - Success messages: TOAST_<CATEGORY>_<ACTION>_SUCCESS
8
+ * - Error messages: TOAST_<CATEGORY>_<ACTION>_ERROR
9
+ * - Warning messages: TOAST_<CATEGORY>_<ACTION>_WARNING
10
+ */
11
+
12
+ /**
13
+ * Pipeline-related toast messages
14
+ */
15
+ export const TOAST_PIPELINE = {
16
+ RUN_STARTED: 'Run started',
17
+ RUN_START_ERROR: 'Failed to start run',
18
+ RECORD_RETRY_QUEUED: 'Record retry queued',
19
+ INVALID_JSON_PATCH: 'Invalid JSON patch',
20
+ SAVE_SUCCESS: 'Successfully saved pipeline',
21
+ SAVE_ERROR: 'Failed to save pipeline',
22
+ SUBMITTED_FOR_REVIEW: 'Submitted for review',
23
+ SUBMIT_ERROR: 'Submit failed',
24
+ APPROVED: 'Approved',
25
+ APPROVE_ERROR: 'Approve failed',
26
+ REJECTED: 'Rejected',
27
+ REJECT_ERROR: 'Reject failed',
28
+ PUBLISHED: 'Published',
29
+ PUBLISH_ERROR: 'Publish failed',
30
+ VALIDATION_FIX_REQUIRED: 'Fix validation issues before publishing',
31
+ ARCHIVED: 'Pipeline archived',
32
+ ARCHIVE_ERROR: 'Failed to archive pipeline',
33
+ RESTORED: 'Pipeline restored',
34
+ DELETED: 'Pipeline deleted',
35
+ DUPLICATED: 'Pipeline duplicated',
36
+ DRY_RUN_FAILED: 'Dry run failed',
37
+ HISTORY_LOAD_ERROR: 'Failed to load version history',
38
+ GATE_APPROVED: 'Gate approved, resuming pipeline',
39
+ GATE_APPROVE_ERROR: 'Failed to approve gate',
40
+ GATE_REJECTED: 'Gate rejected, pipeline cancelled',
41
+ GATE_REJECT_ERROR: 'Failed to reject gate',
42
+ } as const;
43
+
44
+ /**
45
+ * Connection-related toast messages
46
+ */
47
+ export const TOAST_CONNECTION = {
48
+ SECRETS_LOAD_ERROR: 'Failed to load available secrets. Some features may be limited.',
49
+ TEST_SUCCESS: 'Connection successful',
50
+ TEST_FAILED: 'Connection failed',
51
+ SAVE_SUCCESS: 'Connection saved successfully',
52
+ SAVE_ERROR: 'Failed to save connection',
53
+ DELETE_SUCCESS: 'Connection deleted successfully',
54
+ DELETE_ERROR: 'Failed to delete connection',
55
+ } as const;
56
+
57
+ /**
58
+ * Adapter-related toast messages
59
+ */
60
+ export const TOAST_ADAPTER = {
61
+ CONFIG_COPIED: 'Config copied to clipboard',
62
+ COPY_ERROR: 'Failed to copy',
63
+ } as const;
64
+
65
+ /**
66
+ * Hook-related toast messages
67
+ */
68
+ export const TOAST_HOOK = {
69
+ SELECT_PIPELINE_FIRST: 'Please select a pipeline first',
70
+ TEST_SUCCESS: 'Hook test executed successfully',
71
+ } as const;
72
+
73
+ /**
74
+ * Log-related toast messages
75
+ */
76
+ export const TOAST_LOG = {
77
+ EXPORT_SUCCESS: 'Logs exported successfully',
78
+ EXPORT_ERROR: 'Failed to export logs',
79
+ } as const;
80
+
81
+ /**
82
+ * File-related toast messages
83
+ */
84
+ export const TOAST_FILE = {
85
+ UNSUPPORTED_TYPE: 'Unsupported file type',
86
+ EXCEL_REQUIRES_XLSX: 'Excel parsing requires xlsx library. Please use CSV or JSON.',
87
+ NO_DATA_FOUND: 'No data found in file',
88
+ PARSE_ERROR: 'Failed to parse file',
89
+ PARSE_SUCCESS: 'Parsed {count} records',
90
+ PARSED_ROWS_COLUMNS: 'Parsed {rows} rows with {columns} columns',
91
+ MISSING_REQUIRED: 'Missing required fields: {fields}',
92
+ } as const;
93
+
94
+ /**
95
+ * Wizard-related toast messages
96
+ */
97
+ export const TOAST_WIZARD = {
98
+ NAME_REQUIRED: 'Please provide a name for the configuration',
99
+ IMPORT_NAME_REQUIRED: 'Please provide a name for the import configuration',
100
+ EXPORT_NAME_REQUIRED: 'Please provide a name for the export configuration',
101
+ URL_REQUIRED: 'Please enter a URL first',
102
+ TEMPLATE_SELECTED: 'Template applied',
103
+ IMPORT_CREATED: 'Import pipeline created',
104
+ EXPORT_CREATED: 'Export pipeline created',
105
+ CREATE_FAILED: 'Failed to create pipeline',
106
+ } as const;
107
+
108
+ /**
109
+ * Secret-related toast messages
110
+ */
111
+ export const TOAST_SECRET = {
112
+ SAVE_SUCCESS: 'Secret saved successfully',
113
+ SAVE_ERROR: 'Failed to save secret',
114
+ DELETE_SUCCESS: 'Secret deleted successfully',
115
+ DELETE_ERROR: 'Failed to delete secret',
116
+ } as const;
117
+
118
+ /**
119
+ * Template-related toast messages
120
+ */
121
+ export const TOAST_TEMPLATE = {
122
+ SAMPLE_COPIED: 'Sample data copied to clipboard',
123
+ SAMPLE_DOWNLOADED: 'Sample file downloaded',
124
+ } as const;
125
+
126
+ /**
127
+ * Settings-related toast messages
128
+ */
129
+ export const TOAST_SETTINGS = {
130
+ VALIDATION_ERRORS: 'Please fix validation errors before saving',
131
+ SAVE_SUCCESS: 'Settings saved successfully',
132
+ SAVE_ERROR: 'Failed to save settings',
133
+ } as const;
134
+
135
+ /**
136
+ * Helper to format parsed records toast
137
+ */
138
+ export const formatParsedRecords = (count: number): string => {
139
+ return TOAST_FILE.PARSE_SUCCESS.replace('{count}', String(count));
140
+ };
141
+
142
+ /**
143
+ * Helper to format error messages with details
144
+ */
145
+ export const formatParseError = (error: unknown): string => {
146
+ const message = getErrorMessage(error);
147
+ return `${TOAST_FILE.PARSE_ERROR}: ${message}`;
148
+ };
149
+
@@ -0,0 +1,5 @@
1
+ import type { TriggerType } from '../../shared/types';
2
+ import { TRIGGER_TYPE } from '../../shared/constants/enums';
3
+
4
+ export type { TriggerType };
5
+ export { TRIGGER_TYPE };