@knkcs/importhub-ui 0.1.0 → 0.2.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.
package/dist/index.d.ts CHANGED
@@ -1,8 +1,18 @@
1
1
  import { JSX } from 'react';
2
2
  import { LucideIcon } from 'lucide-react';
3
3
  import { ReactNode } from 'react';
4
+ import { Schema } from '@knkcs/fieldkit/schema';
4
5
  import { Transport } from '@connectrpc/connect';
5
6
 
7
+ /** What moving a Mapping's draft to another Blueprint Release would lose. */
8
+ export declare interface BlueprintReleaseCheck {
9
+ blueprintId: string;
10
+ /** Every mapped field path the Release does not have. */
11
+ missingFieldPaths: string[];
12
+ /** Every Release Spec field read or matched on that it does not have. */
13
+ missingReleaseSpecFields: string[];
14
+ }
15
+
6
16
  /**
7
17
  * The link out to a Change Set in contenthub, where the host says it is
8
18
  * (`ImporthubHost.changeSetHref`). Nothing when the host has no address for
@@ -14,6 +24,46 @@ export declare interface ChangeSetLinkProps {
14
24
  changeSetId: string;
15
25
  }
16
26
 
27
+ /**
28
+ * A delete importhub refused because Import Profiles still include the
29
+ * Mapping, or name the Entity Set (manage-mappings:AC4,
30
+ * manage-entity-sets:AC3). Carries the Profiles, so the screen names them.
31
+ */
32
+ export declare class ConfigurationInUseError extends Error {
33
+ readonly importProfiles: ImportProfileRef[];
34
+ constructor(importProfiles: ImportProfileRef[], message?: string);
35
+ }
36
+
37
+ /** A Configuration Release, as a list names it: "Release 3". */
38
+ export declare interface ConfigurationRelease {
39
+ id: string;
40
+ number: number;
41
+ }
42
+
43
+ /** Where a configuration stands: its draft and its latest Release. */
44
+ export declare interface ConfigurationState {
45
+ draftRevisionId: string;
46
+ /** Unset while the configuration has none. */
47
+ latestRelease?: ConfigurationRelease;
48
+ /** True when the draft differs from the latest Release, and while there is none. */
49
+ draftDiffersFromRelease: boolean;
50
+ }
51
+
52
+ /** One configuration of a kind, at its draft. */
53
+ declare interface Configured<C> {
54
+ id: string;
55
+ /** The draft's content. */
56
+ content: C;
57
+ /**
58
+ * Whether it is valid now: for Profiles and Mappings the service's
59
+ * `current_validity`, which counts what changed since the save (an
60
+ * included Mapping turned invalid, a Blueprint gone); for Entity Sets the
61
+ * validity as saved, the only one they have.
62
+ */
63
+ validity: Validity;
64
+ state: ConfigurationState;
65
+ }
66
+
17
67
  /**
18
68
  * The one call a host makes to talk to importhub (knkcms/core ADR 0003):
19
69
  * an `ImporthubClient` over Connect.
@@ -36,10 +86,42 @@ export declare interface CreateConnectImporthubClientOptions {
36
86
  transport?: Transport;
37
87
  }
38
88
 
39
- /** An Entity Set, as a list names it: its draft's name. */
40
- export declare interface EntitySetSummary {
41
- id: string;
89
+ export declare type EntitySet = Configured<EntitySetContent>;
90
+
91
+ /** What an admin edits of an Entity Set. */
92
+ export declare interface EntitySetContent {
42
93
  name: string;
94
+ description: string;
95
+ /** Entity names without `&` and `;`, to the text each stands for. */
96
+ entities: Record<string, string>;
97
+ }
98
+
99
+ /**
100
+ * One Entity Set (manage-entity-sets:AC1): its name and its table of
101
+ * entities, each with the text it stands for. An admin edits the table and
102
+ * saves with the header's Save, and deletes from the rail, which importhub
103
+ * refuses while a Profile names it, naming them (AC3).
104
+ */
105
+ export declare function EntitySetDetail({ client, id, onDeleted }: EntitySetDetailProps): JSX.Element;
106
+
107
+ export declare interface EntitySetDetailProps {
108
+ client: ImporthubClient;
109
+ /** The Entity Set's id. */
110
+ id: string;
111
+ /** It was deleted: the host leaves its page. */
112
+ onDeleted: () => void;
113
+ }
114
+
115
+ /**
116
+ * Every Entity Set of the workspace, with how many entities each defines
117
+ * (manage-entity-sets:AC1); an admin creates one from the header.
118
+ */
119
+ export declare function EntitySetsIndex({ client, onOpen }: EntitySetsIndexProps): JSX.Element;
120
+
121
+ export declare interface EntitySetsIndexProps {
122
+ client: ImporthubClient;
123
+ /** Opens an Entity Set's page: the host navigates, after a create too. */
124
+ onOpen: (id: string) => void;
43
125
  }
44
126
 
45
127
  /** The package's bundled translations, keyed by language, then by namespace. */
@@ -67,6 +149,12 @@ export declare const i18nResources: {
67
149
  summary_one: string;
68
150
  summary_other: string;
69
151
  };
152
+ processors: {
153
+ title: string;
154
+ summary_zero: string;
155
+ summary_one: string;
156
+ summary_other: string;
157
+ };
70
158
  };
71
159
  startPage: {
72
160
  loading: string;
@@ -75,6 +163,148 @@ export declare const i18nResources: {
75
163
  changeSet: {
76
164
  open: string;
77
165
  };
166
+ common: {
167
+ cancel: string;
168
+ delete: string;
169
+ create: string;
170
+ save: string;
171
+ apply: string;
172
+ close: string;
173
+ };
174
+ fields: {
175
+ name: string;
176
+ description: string;
177
+ };
178
+ validity: {
179
+ column: string;
180
+ valid: string;
181
+ invalid: string;
182
+ invalidTitle: string;
183
+ };
184
+ release: {
185
+ column: string;
186
+ number: string;
187
+ none: string;
188
+ };
189
+ delete: {
190
+ inUse: string;
191
+ failed: string;
192
+ };
193
+ create: {
194
+ nameTaken: string;
195
+ nameRequired: string;
196
+ failed: string;
197
+ };
198
+ save: {
199
+ failed: string;
200
+ };
201
+ rail: {
202
+ title: string;
203
+ actions: string;
204
+ };
205
+ order: {
206
+ moveUp: string;
207
+ moveDown: string;
208
+ remove: string;
209
+ };
210
+ profiles: {
211
+ new: string;
212
+ empty: string;
213
+ general: string;
214
+ entitySet: string;
215
+ entitySetHelp: string;
216
+ noEntitySet: string;
217
+ autoPublish: string;
218
+ autoPublishHelp: string;
219
+ deleteOnSuccess: string;
220
+ deleteOnSuccessHelp: string;
221
+ preprocessors: string;
222
+ mappings: string;
223
+ postProcessors: string;
224
+ noPreprocessors: string;
225
+ noPostProcessors: string;
226
+ noMappings: string;
227
+ addPreprocessor: string;
228
+ addPostProcessor: string;
229
+ addMapping: string;
230
+ missingMapping: string;
231
+ delete: string;
232
+ deleteTitle: string;
233
+ deleteMessage: string;
234
+ };
235
+ processors: {
236
+ empty: string;
237
+ kindColumn: string;
238
+ targetColumn: string;
239
+ settingsColumn: string;
240
+ noSettings: string;
241
+ kind: {
242
+ preprocessor: string;
243
+ post_processor: string;
244
+ };
245
+ target: {
246
+ source_file: string;
247
+ rich_text_field: string;
248
+ };
249
+ unknown: string;
250
+ settingsOf: string;
251
+ configure: string;
252
+ viewSettings: string;
253
+ settingsCount_zero: string;
254
+ settingsCount_one: string;
255
+ settingsCount_other: string;
256
+ };
257
+ mappings: {
258
+ new: string;
259
+ empty: string;
260
+ general: string;
261
+ blueprint: string;
262
+ release: string;
263
+ blueprintId: string;
264
+ releaseId: string;
265
+ idsHelp: string;
266
+ newRelease: string;
267
+ newReleaseId: string;
268
+ elementSelector: string;
269
+ elementSelectorHelp: string;
270
+ sourceKeySelector: string;
271
+ sourceKeyTemplate: string;
272
+ sourceKeyTemplateHelp: string;
273
+ fieldCount_zero: string;
274
+ fieldCount_one: string;
275
+ fieldCount_other: string;
276
+ target: string;
277
+ move: string;
278
+ moveTitle: string;
279
+ check: string;
280
+ checkFailed: string;
281
+ nothingLost: string;
282
+ lost_one: string;
283
+ lost_other: string;
284
+ lostFields: string;
285
+ lostReleaseSpec: string;
286
+ moveConfirm: string;
287
+ includedBy: string;
288
+ noProfiles: string;
289
+ delete: string;
290
+ deleteTitle: string;
291
+ deleteMessage: string;
292
+ };
293
+ entitySets: {
294
+ new: string;
295
+ empty: string;
296
+ general: string;
297
+ entities: string;
298
+ entity: string;
299
+ noEntities: string;
300
+ entityName: string;
301
+ entityText: string;
302
+ addEntity: string;
303
+ removeEntity: string;
304
+ delete: string;
305
+ deleteTitle: string;
306
+ deleteMessage: string;
307
+ };
78
308
  };
79
309
  };
80
310
  de: {
@@ -100,6 +330,12 @@ export declare const i18nResources: {
100
330
  summary_one: string;
101
331
  summary_other: string;
102
332
  };
333
+ processors: {
334
+ title: string;
335
+ summary_zero: string;
336
+ summary_one: string;
337
+ summary_other: string;
338
+ };
103
339
  };
104
340
  startPage: {
105
341
  loading: string;
@@ -108,6 +344,148 @@ export declare const i18nResources: {
108
344
  changeSet: {
109
345
  open: string;
110
346
  };
347
+ common: {
348
+ cancel: string;
349
+ delete: string;
350
+ create: string;
351
+ save: string;
352
+ apply: string;
353
+ close: string;
354
+ };
355
+ fields: {
356
+ name: string;
357
+ description: string;
358
+ };
359
+ validity: {
360
+ column: string;
361
+ valid: string;
362
+ invalid: string;
363
+ invalidTitle: string;
364
+ };
365
+ release: {
366
+ column: string;
367
+ number: string;
368
+ none: string;
369
+ };
370
+ delete: {
371
+ inUse: string;
372
+ failed: string;
373
+ };
374
+ create: {
375
+ nameTaken: string;
376
+ nameRequired: string;
377
+ failed: string;
378
+ };
379
+ save: {
380
+ failed: string;
381
+ };
382
+ rail: {
383
+ title: string;
384
+ actions: string;
385
+ };
386
+ order: {
387
+ moveUp: string;
388
+ moveDown: string;
389
+ remove: string;
390
+ };
391
+ profiles: {
392
+ new: string;
393
+ empty: string;
394
+ general: string;
395
+ entitySet: string;
396
+ entitySetHelp: string;
397
+ noEntitySet: string;
398
+ autoPublish: string;
399
+ autoPublishHelp: string;
400
+ deleteOnSuccess: string;
401
+ deleteOnSuccessHelp: string;
402
+ preprocessors: string;
403
+ mappings: string;
404
+ postProcessors: string;
405
+ noPreprocessors: string;
406
+ noPostProcessors: string;
407
+ noMappings: string;
408
+ addPreprocessor: string;
409
+ addPostProcessor: string;
410
+ addMapping: string;
411
+ missingMapping: string;
412
+ delete: string;
413
+ deleteTitle: string;
414
+ deleteMessage: string;
415
+ };
416
+ processors: {
417
+ empty: string;
418
+ kindColumn: string;
419
+ targetColumn: string;
420
+ settingsColumn: string;
421
+ noSettings: string;
422
+ kind: {
423
+ preprocessor: string;
424
+ post_processor: string;
425
+ };
426
+ target: {
427
+ source_file: string;
428
+ rich_text_field: string;
429
+ };
430
+ unknown: string;
431
+ settingsOf: string;
432
+ configure: string;
433
+ viewSettings: string;
434
+ settingsCount_zero: string;
435
+ settingsCount_one: string;
436
+ settingsCount_other: string;
437
+ };
438
+ mappings: {
439
+ new: string;
440
+ empty: string;
441
+ general: string;
442
+ blueprint: string;
443
+ release: string;
444
+ blueprintId: string;
445
+ releaseId: string;
446
+ idsHelp: string;
447
+ newRelease: string;
448
+ newReleaseId: string;
449
+ elementSelector: string;
450
+ elementSelectorHelp: string;
451
+ sourceKeySelector: string;
452
+ sourceKeyTemplate: string;
453
+ sourceKeyTemplateHelp: string;
454
+ fieldCount_zero: string;
455
+ fieldCount_one: string;
456
+ fieldCount_other: string;
457
+ target: string;
458
+ move: string;
459
+ moveTitle: string;
460
+ check: string;
461
+ checkFailed: string;
462
+ nothingLost: string;
463
+ lost_one: string;
464
+ lost_other: string;
465
+ lostFields: string;
466
+ lostReleaseSpec: string;
467
+ moveConfirm: string;
468
+ includedBy: string;
469
+ noProfiles: string;
470
+ delete: string;
471
+ deleteTitle: string;
472
+ deleteMessage: string;
473
+ };
474
+ entitySets: {
475
+ new: string;
476
+ empty: string;
477
+ general: string;
478
+ entities: string;
479
+ entity: string;
480
+ noEntities: string;
481
+ entityName: string;
482
+ entityText: string;
483
+ addEntity: string;
484
+ removeEntity: string;
485
+ delete: string;
486
+ deleteTitle: string;
487
+ deleteMessage: string;
488
+ };
111
489
  };
112
490
  };
113
491
  };
@@ -126,16 +504,66 @@ export declare const IMPORTHUB_SECTIONS: readonly ImporthubSection[];
126
504
  */
127
505
  export declare const IMPORTHUB_UI_NS = "importhub-ui";
128
506
 
507
+ /** A Blueprint, as a Mapping's target is picked and named. */
508
+ export declare interface ImporthubBlueprint {
509
+ id: string;
510
+ name: string;
511
+ }
512
+
513
+ /** A Blueprint Release, as a Mapping pins it: `label` names it, such as "Release 3". */
514
+ export declare interface ImporthubBlueprintRelease {
515
+ id: string;
516
+ label: string;
517
+ }
518
+
519
+ /**
520
+ * Where the screens find Blueprints and their Releases, which live in
521
+ * blueprinthub, not importhub: importhub stores only their ids. A host that
522
+ * reaches blueprinthub (core does) answers from it; one that does not leaves
523
+ * `ImporthubHost.blueprints` out, and the Mapping screens then take and show
524
+ * the two as labelled ids, the technical detail anker's id rule allows.
525
+ */
526
+ export declare interface ImporthubBlueprints {
527
+ /** The workspace's Blueprints a Mapping may target, by name. */
528
+ listBlueprints(): Promise<ImporthubBlueprint[]>;
529
+ /** A Blueprint's Releases, newest first. */
530
+ listReleases(blueprintId: string): Promise<ImporthubBlueprintRelease[]>;
531
+ }
532
+
129
533
  /**
130
534
  * What the screens ask of importhub. Every call acts on the caller's
131
535
  * workspace, which importhub takes from the token's active workspace and
132
536
  * never from an argument: a host switches workspace by switching the token.
537
+ * An update names the draft it was made on, and is refused when somebody
538
+ * saved in between.
133
539
  */
134
540
  export declare interface ImporthubClient {
135
541
  /** Every Import Profile of the workspace, by name. */
136
- listImportProfiles(): Promise<ImportProfileSummary[]>;
542
+ listImportProfiles(): Promise<ImportProfile[]>;
543
+ getImportProfile(id: string): Promise<ImportProfile>;
544
+ createImportProfile(content: ImportProfileContent): Promise<ImportProfile>;
545
+ updateImportProfile(id: string, content: ImportProfileContent, draftRevisionId: string): Promise<ImportProfile>;
546
+ deleteImportProfile(id: string): Promise<void>;
547
+ /** The Processor catalogue, by name; the same in every workspace. */
548
+ listProcessors(): Promise<Processor[]>;
549
+ /** Every Mapping of the workspace, by name. */
550
+ listMappings(): Promise<Mapping[]>;
551
+ getMapping(id: string): Promise<Mapping>;
552
+ createMapping(content: MappingContent): Promise<Mapping>;
553
+ updateMapping(id: string, content: MappingContent, draftRevisionId: string): Promise<Mapping>;
554
+ /** Throws ConfigurationInUseError while a Profile includes it. */
555
+ deleteMapping(id: string): Promise<void>;
556
+ /** The Import Profiles whose draft or latest Release includes it. */
557
+ listMappingImportProfiles(id: string): Promise<ImportProfileRef[]>;
558
+ /** Checks moving the draft to another Blueprint Release, saving nothing. */
559
+ checkMappingBlueprintRelease(id: string, blueprintReleaseId: string): Promise<BlueprintReleaseCheck>;
137
560
  /** Every Entity Set of the workspace, by name. */
138
- listEntitySets(): Promise<EntitySetSummary[]>;
561
+ listEntitySets(): Promise<EntitySet[]>;
562
+ getEntitySet(id: string): Promise<EntitySet>;
563
+ createEntitySet(content: EntitySetContent): Promise<EntitySet>;
564
+ updateEntitySet(id: string, content: EntitySetContent, draftRevisionId: string): Promise<EntitySet>;
565
+ /** Throws ConfigurationInUseError while a Profile names it. */
566
+ deleteEntitySet(id: string): Promise<void>;
139
567
  }
140
568
 
141
569
  export declare interface ImporthubHost {
@@ -147,6 +575,16 @@ export declare interface ImporthubHost {
147
575
  * link to: the screen then shows no link rather than a broken one.
148
576
  */
149
577
  changeSetHref: (changeSetId: string) => string | null;
578
+ /**
579
+ * Whether the viewer may change configuration: importhub's `admin`
580
+ * (ADR 0010), which only the host's session knows. Unset, the screens
581
+ * show configuration read-only, as to a `viewer`; either way importhub
582
+ * authorizes every write itself, so this hides actions and guards
583
+ * nothing.
584
+ */
585
+ canConfigure?: boolean;
586
+ /** Where Blueprints and their Releases are found; see ImporthubBlueprints. */
587
+ blueprints?: ImporthubBlueprints;
150
588
  }
151
589
 
152
590
  /** Provides the host's decisions to every importhub screen beneath it. */
@@ -160,24 +598,36 @@ export declare interface ImporthubHostProviderProps {
160
598
  export declare const importhubKeys: {
161
599
  all: (workspaceId: string) => readonly ["importhub", string];
162
600
  importProfiles: (workspaceId: string) => readonly ["importhub", string, "importProfiles"];
601
+ importProfile: (workspaceId: string, id: string) => readonly ["importhub", string, "importProfiles", string];
602
+ processors: (workspaceId: string) => readonly ["importhub", string, "processors"];
603
+ mappings: (workspaceId: string) => readonly ["importhub", string, "mappings"];
604
+ mapping: (workspaceId: string, id: string) => readonly ["importhub", string, "mappings", string];
605
+ mappingImportProfiles: (workspaceId: string, id: string) => readonly ["importhub", string, "mappings", string, "importProfiles"];
163
606
  entitySets: (workspaceId: string) => readonly ["importhub", string, "entitySets"];
607
+ entitySet: (workspaceId: string, id: string) => readonly ["importhub", string, "entitySets", string];
608
+ blueprints: (workspaceId: string) => readonly ["importhub", string, "blueprints"];
609
+ blueprintReleases: (workspaceId: string, blueprintId: string) => readonly ["importhub", string, "blueprints", string, "releases"];
164
610
  };
165
611
 
166
- /** Where the host mounts each section's index. */
612
+ /**
613
+ * Where the host mounts each section's index. An item of a section (one
614
+ * Import Profile, Mapping or Entity Set) lives under it, at
615
+ * `<index>/<id>` (`itemPath`), so a host mounts one route per section and its
616
+ * items, and the screens link to both without asking.
617
+ */
167
618
  export declare type ImporthubPaths = Record<ImporthubSection, string>;
168
619
 
169
620
  /**
170
621
  * importhub's sections: Imports, the host's own work, and the configuration
171
622
  * an admin manages (CONTEXT.md, "Configuration").
172
623
  */
173
- export declare type ImporthubSection = "imports" | "profiles" | "mappings" | "entitySets";
624
+ export declare type ImporthubSection = "imports" | "profiles" | "mappings" | "entitySets" | "processors";
174
625
 
175
626
  /**
176
- * A section's start page, until its screens exist: the section's
627
+ * A section's start page, for a host that has no screen for it yet: the section's
177
628
  * title in the frame, and a body saying what the workspace holds of it. Where
178
- * importhub can already list a section (Import Profiles, Entity Sets) it
179
- * says how many there are, read for the host's active workspace; Imports and
180
- * Mappings have nothing to read yet.
629
+ * importhub can already list a section it says how many there are, read for the host's active workspace; Imports have
630
+ * nothing to read yet, and Mappings are counted on their own screen.
181
631
  */
182
632
  export declare function ImporthubStartPage({ client, section }: ImporthubStartPageProps): JSX.Element;
183
633
 
@@ -187,12 +637,161 @@ export declare interface ImporthubStartPageProps {
187
637
  section: ImporthubSection;
188
638
  }
189
639
 
190
- /** An Import Profile, as a list names it. */
191
- export declare interface ImportProfileSummary {
640
+ export declare type ImportProfile = Configured<ImportProfileContent>;
641
+
642
+ /** What an admin edits of an Import Profile. */
643
+ export declare interface ImportProfileContent {
644
+ name: string;
645
+ description: string;
646
+ /** The Entity Set the Source File is read with; "" for none. */
647
+ entitySetId: string;
648
+ /** In the order they run. */
649
+ preprocessors: ProcessorStep[];
650
+ /** The Mappings it includes, by id, in the order they run. */
651
+ mappingIds: string[];
652
+ /** In the order they run. */
653
+ postProcessors: ProcessorStep[];
654
+ autoPublish: boolean;
655
+ deleteSourceFileOnSuccess: boolean;
656
+ }
657
+
658
+ /**
659
+ * One Import Profile with every setting (manage-import-profiles:AC3): its
660
+ * Entity Set, its Preprocessors, Mappings and Post-processors in order, each
661
+ * Processor configured in a form generated from its settings spec (AC4), and
662
+ * what happens to the result. An admin edits all of it as one draft and
663
+ * saves it with the header's one Save, and deletes the Profile from the rail
664
+ * (anker ADR 0004); a viewer sees the same page read-only. Why it is invalid
665
+ * heads the page (AC6).
666
+ */
667
+ export declare function ImportProfileDetail({ client, id, onDeleted }: ImportProfileDetailProps): JSX.Element;
668
+
669
+ export declare interface ImportProfileDetailProps {
670
+ client: ImporthubClient;
671
+ /** The Import Profile's id. */
672
+ id: string;
673
+ /** It was deleted: the host leaves its page, for the list, say. */
674
+ onDeleted: () => void;
675
+ }
676
+
677
+ /** An Import Profile, named where another configuration is used. */
678
+ export declare interface ImportProfileRef {
192
679
  id: string;
193
680
  name: string;
194
681
  }
195
682
 
683
+ /**
684
+ * Every Import Profile of the workspace, with its validity and its latest
685
+ * Release (manage-import-profiles:AC1, AC6); an admin creates one from the
686
+ * header (AC2).
687
+ */
688
+ export declare function ImportProfilesIndex({ client, onOpen }: ImportProfilesIndexProps): JSX.Element;
689
+
690
+ export declare interface ImportProfilesIndexProps {
691
+ client: ImporthubClient;
692
+ /** Opens an Import Profile's page: the host navigates, after a create too. */
693
+ onOpen: (id: string) => void;
694
+ }
695
+
696
+ /** Where an item of a section lives: its index's path, then its id. */
697
+ export declare function itemPath(paths: ImporthubPaths, section: ImporthubSection, id: string): string;
698
+
699
+ export declare type Mapping = Configured<MappingContent>;
700
+
701
+ /**
702
+ * What an admin edits of a Mapping, in the JSON shape of importhub.v1's
703
+ * MappingContent (its camelCase keys). The screens here edit only the
704
+ * fields they name; every other setting (field mappings, Version Match,
705
+ * Title Contributions, …) is the structured editor's (F4), and travels
706
+ * through as given, so a save here never drops it.
707
+ */
708
+ export declare interface MappingContent {
709
+ name: string;
710
+ description?: string;
711
+ blueprintId: string;
712
+ blueprintReleaseId: string;
713
+ elementSelector?: string;
714
+ sourceKey?: {
715
+ selector?: string;
716
+ template?: string;
717
+ [key: string]: unknown;
718
+ };
719
+ /** Each an xmlmapper FieldMapping; `name` is the field path. */
720
+ fields?: Array<Record<string, unknown>>;
721
+ [key: string]: unknown;
722
+ }
723
+
724
+ /**
725
+ * One Mapping (manage-mappings:AC2): its name, what it selects and its
726
+ * Source Key, the Blueprint Release it pins with the move to another one
727
+ * (AC5), the Import Profiles that include it (AC3), and why it is invalid.
728
+ * An admin saves with the header's Save and deletes from the rail, which
729
+ * importhub refuses while a Profile includes it, naming them (AC4).
730
+ */
731
+ export declare function MappingDetail({ client, id, onDeleted }: MappingDetailProps): JSX.Element;
732
+
733
+ export declare interface MappingDetailProps {
734
+ client: ImporthubClient;
735
+ /** The Mapping's id. */
736
+ id: string;
737
+ /** It was deleted: the host leaves its page. */
738
+ onDeleted: () => void;
739
+ }
740
+
741
+ /**
742
+ * Every Mapping of the workspace with its target Blueprint, its pinned
743
+ * Blueprint Release and its validity (manage-mappings:AC1); an admin creates
744
+ * one, naming the Blueprint and the Release, from the header (AC2).
745
+ */
746
+ export declare function MappingsIndex({ client, onOpen }: MappingsIndexProps): JSX.Element;
747
+
748
+ export declare interface MappingsIndexProps {
749
+ client: ImporthubClient;
750
+ /** Opens a Mapping's page: the host navigates, after a create too. */
751
+ onOpen: (id: string) => void;
752
+ }
753
+
754
+ /** A create or rename refused: another configuration of the kind has the name. */
755
+ export declare class NameTakenError extends Error {
756
+ constructor(message?: string);
757
+ }
758
+
759
+ /** One entry of the Processor catalogue. */
760
+ export declare interface Processor {
761
+ /** How a Profile names it, such as `entity-element`. */
762
+ name: string;
763
+ kind: ProcessorKind;
764
+ /** What it works on: a Profile lists only `source_file` ones. */
765
+ target: ProcessorTarget;
766
+ /** In English, from the service. */
767
+ description: string;
768
+ /** Its settings as fieldkit Fields, in form order; empty for none. */
769
+ settingsSpec: Schema;
770
+ }
771
+
772
+ /**
773
+ * The Processor catalogue (manage-import-profiles:AC5): every Processor with
774
+ * its kind, where it is configured, what it does and the settings it takes,
775
+ * by their names. Read-only for everyone: the catalogue is importhub's.
776
+ */
777
+ export declare function ProcessorCatalogue({ client }: ProcessorCatalogueProps): JSX.Element;
778
+
779
+ export declare interface ProcessorCatalogueProps {
780
+ client: ImporthubClient;
781
+ }
782
+
783
+ export declare type ProcessorKind = "preprocessor" | "post_processor";
784
+
785
+ /** One Processor in a Profile's pipeline, with its settings. */
786
+ export declare interface ProcessorStep {
787
+ /** The Processor, by its name in the catalogue. */
788
+ processor: string;
789
+ /** One value per setting of its settings spec, by `api_accessor`. */
790
+ settings: Record<string, unknown>;
791
+ }
792
+
793
+ export declare type ProcessorTarget = "source_file" | "rich_text_field";
794
+
196
795
  /**
197
796
  * The Standalone App's paths: Imports at the top, the configuration under
198
797
  * `/settings/<item>`, one page per item (odon's integration guide, "Sidebar
@@ -206,4 +805,20 @@ export declare const STANDALONE_IMPORTHUB_PATHS: ImporthubPaths;
206
805
  */
207
806
  export declare function useImporthubHost(): ImporthubHost;
208
807
 
808
+ /** Whether a configuration may be released, and if not, why. */
809
+ export declare interface Validity {
810
+ valid: boolean;
811
+ reasons: ValidityReason[];
812
+ }
813
+
814
+ /** One thing that makes a configuration invalid (importhub.v1.ValidityReason). */
815
+ export declare interface ValidityReason {
816
+ /** Where, as a JSON Pointer into the content; empty for the whole. */
817
+ path: string;
818
+ /** A stable code, such as `no_mappings`; the type's service lists them. */
819
+ code: string;
820
+ /** What is wrong, in English, for a person. */
821
+ message: string;
822
+ }
823
+
209
824
  export { }