@knkcs/importhub-ui 0.7.0 → 0.9.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.
@@ -238,6 +238,14 @@ declare interface ImporthubClient {
238
238
  listMappingImportProfiles(id: string): Promise<ImportProfileRef[]>;
239
239
  /** Checks moving the draft to another Blueprint Release, saving nothing. */
240
240
  checkMappingBlueprintRelease(id: string, blueprintReleaseId: string): Promise<BlueprintReleaseCheck>;
241
+ /**
242
+ * Runs a Mapping Test: the content given over the sample, read as an
243
+ * Import reads a Source File. Stores nothing and touches nothing outside
244
+ * importhub (test-a-mapping-on-a-sample-file:AC4). Throws with importhub's
245
+ * reason when the test cannot run at all: a sample that is not XML, an
246
+ * element selector or Source Key xmlmapper cannot evaluate.
247
+ */
248
+ runMappingTest(input: MappingTestInput): Promise<MappingTestResult>;
241
249
  /** Every Entity Set of the workspace, by name. */
242
250
  listEntitySets(): Promise<EntitySet[]>;
243
251
  getEntitySet(id: string): Promise<EntitySet>;
@@ -446,6 +454,11 @@ declare interface MappingContent {
446
454
  };
447
455
  collections?: string[];
448
456
  displayNameTemplate?: string;
457
+ /**
458
+ * The plain-text field of the pinned Release the display name is written
459
+ * into; set with displayNameTemplate, or neither.
460
+ */
461
+ displayNameField?: string;
449
462
  placeholderAssets?: Array<{
450
463
  selector?: string;
451
464
  assetType?: string;
@@ -484,6 +497,59 @@ export declare interface MappingEditorProps {
484
497
  onDeleted: () => void;
485
498
  }
486
499
 
500
+ /** One element a Mapping Test matched, as an Import would read it. */
501
+ declare interface MappingTestElement {
502
+ /** Its position among the elements matched, from 1. */
503
+ position: number;
504
+ /** Its Source Key, verbatim; "" when it has none. */
505
+ sourceKey: string;
506
+ /** Its mapped values by field accessor; a field that cannot be mapped is left out. */
507
+ values: Record<string, unknown>;
508
+ /** The Validity Period the sample gives, as YYYY-MM-DD; "" for none. */
509
+ firstDay: string;
510
+ lastDay: string;
511
+ /** The Release Spec values the sample gives, by field. */
512
+ releaseSpec: Record<string, unknown>;
513
+ /** What the display-name template makes; "" without one. */
514
+ displayName: string;
515
+ /** The Collections it would be filed into, by name. */
516
+ collections: string[];
517
+ /** Each field that cannot be mapped, and what an Import would report; none when clean. */
518
+ problems: MappingTestProblem[];
519
+ }
520
+
521
+ /**
522
+ * What a Mapping Test runs (test-a-mapping-on-a-sample-file:AC1): a
523
+ * Mapping's content as the editor holds it, saved or not, over a sample file.
524
+ */
525
+ declare interface MappingTestInput {
526
+ content: MappingContent;
527
+ /** The sample file, an XML file, sent whole. */
528
+ sample: Uint8Array;
529
+ /**
530
+ * An Entity Set of the workspace whose draft's entities the sample uses;
531
+ * "" or unset for none.
532
+ */
533
+ entitySetId?: string;
534
+ }
535
+
536
+ /** One problem of an element in a Mapping Test (importhub.v1.MappingTestProblem). */
537
+ declare interface MappingTestProblem {
538
+ /**
539
+ * A field path, `.`-joined into fieldsets and virtual tables, or the
540
+ * Mapping's setting that reads it (`display_name_template`, say); "" for
541
+ * the element as a whole, such as an element without a Source Key.
542
+ */
543
+ field: string;
544
+ /** Why, for a person: xmlmapper's message for a field that cannot be mapped. */
545
+ reason: string;
546
+ }
547
+
548
+ /** What a Mapping Test answers: every element the element selector matched. */
549
+ declare interface MappingTestResult {
550
+ elements: MappingTestElement[];
551
+ }
552
+
487
553
  /** One entry of the Processor catalogue. */
488
554
  declare interface Processor {
489
555
  /** How a Profile names it, such as `entity-element`. */