@knkcs/importhub-ui 0.8.0 → 0.10.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.
@@ -140,6 +140,53 @@ declare interface CutReleaseResult {
140
140
  importProfiles: ImportProfileRef[];
141
141
  }
142
142
 
143
+ /**
144
+ * What a real Import would do with one Source Version (importhub.v1.DryRunAction):
145
+ * create its Content, give it a new Planned Release, correct the Release its
146
+ * Changed Version matched, keep that Release, create a Stub, or nothing.
147
+ */
148
+ declare type DryRunAction = "created" | "planned" | "corrected" | "kept" | "stubbed" | "unchanged";
149
+
150
+ /** One entry of a Dry Run's report: one Source Version of one Content. */
151
+ declare interface DryRunContent {
152
+ mappingId: string;
153
+ /** The Mapping's name in what the Dry Run ran. */
154
+ mappingName: string;
155
+ /** The element's Source Key: the Content's Content Key. */
156
+ sourceKey: string;
157
+ /** As the Mapping's display-name template makes it; "" without one. */
158
+ displayName: string;
159
+ action: DryRunAction;
160
+ /** The existing Content it is about; "" for Content it would create or stub. */
161
+ contentId: string;
162
+ /** The Validity Period, as YYYY-MM-DD; "" for undated Content and an open end. */
163
+ firstDay: string;
164
+ lastDay: string;
165
+ }
166
+
167
+ /** How a Dry Run's report is filtered: by action, by Mapping, by Source Key. */
168
+ declare interface DryRunContentsFilter {
169
+ /** "" for every action. */
170
+ action: DryRunAction | "";
171
+ /** "" for every Mapping. */
172
+ mappingId: string;
173
+ /** Matches Source Keys that contain it, ignoring case; "" for all. */
174
+ sourceKeyQuery: string;
175
+ /** "" for the first page. */
176
+ pageToken: string;
177
+ }
178
+
179
+ /** One page of a Dry Run's report. */
180
+ declare interface DryRunContentsPage {
181
+ contents: DryRunContent[];
182
+ /** Every entry of the report, whatever the filter. */
183
+ totalCount: number;
184
+ /** The entries the filter matches, on every page. */
185
+ matchingCount: number;
186
+ /** "" on the last page. */
187
+ nextPageToken: string;
188
+ }
189
+
143
190
  declare type EntitySet = Configured<EntitySetContent>;
144
191
 
145
192
  /** What an admin edits of an Entity Set. */
@@ -191,6 +238,14 @@ declare interface Import {
191
238
  /** YYYY-MM-DD, or "" for none. */
192
239
  effectiveDate: string;
193
240
  source?: ImportSource;
241
+ /**
242
+ * Whether it is a Dry Run (CONTEXT.md "Dry Run"): it writes nothing and
243
+ * opens no Change Set, its counts say what a real Import would do, and its
244
+ * report is `listDryRunContents`'.
245
+ */
246
+ dryRun: boolean;
247
+ /** Whether it runs drafts: a Dry Run started on them. Never for a real Import. */
248
+ draft: boolean;
194
249
  }
195
250
 
196
251
  /** What an Import has done (importhub.v1.ImportCounts). */
@@ -209,6 +264,10 @@ declare interface ImportCounts {
209
264
  kept: number;
210
265
  /** Source Versions already in contenthub. */
211
266
  unchanged: number;
267
+ /** Stubs created for a Stub Mapping's Source Keys no Content had. */
268
+ stubbed: number;
269
+ /** References it could not resolve: each one of its Item Problems too. */
270
+ pendingReferences: number;
212
271
  }
213
272
 
214
273
  /**
@@ -238,6 +297,14 @@ declare interface ImporthubClient {
238
297
  listMappingImportProfiles(id: string): Promise<ImportProfileRef[]>;
239
298
  /** Checks moving the draft to another Blueprint Release, saving nothing. */
240
299
  checkMappingBlueprintRelease(id: string, blueprintReleaseId: string): Promise<BlueprintReleaseCheck>;
300
+ /**
301
+ * Runs a Mapping Test: the content given over the sample, read as an
302
+ * Import reads a Source File. Stores nothing and touches nothing outside
303
+ * importhub (test-a-mapping-on-a-sample-file:AC4). Throws with importhub's
304
+ * reason when the test cannot run at all: a sample that is not XML, an
305
+ * element selector or Source Key xmlmapper cannot evaluate.
306
+ */
307
+ runMappingTest(input: MappingTestInput): Promise<MappingTestResult>;
241
308
  /** Every Entity Set of the workspace, by name. */
242
309
  listEntitySets(): Promise<EntitySet[]>;
243
310
  getEntitySet(id: string): Promise<EntitySet>;
@@ -269,6 +336,18 @@ declare interface ImporthubClient {
269
336
  /** Asks a queued or running Import to stop; returns it as it is now. */
270
337
  cancelImport(id: string): Promise<Import>;
271
338
  listItemProblems(importId: string, filter: ItemProblemsFilter): Promise<ItemProblemsPage>;
339
+ /**
340
+ * Queues a Dry Run: an Import with the same inputs that writes nothing
341
+ * and opens no Change Set (dry-run-an-import:AC1, AC2). Throws
342
+ * StartRefusedError, with importhub's reason, as `startImport` does, and
343
+ * for a draft that is invalid.
344
+ */
345
+ startDryRun(input: StartDryRunInput): Promise<Import>;
346
+ /**
347
+ * One page of a Dry Run's report: per Source Version, what a real Import
348
+ * would do with its Content (dry-run-an-import:AC3).
349
+ */
350
+ listDryRunContents(importId: string, filter: DryRunContentsFilter): Promise<DryRunContentsPage>;
272
351
  /**
273
352
  * Every API key of the workspace, every importer's, newest first, without
274
353
  * their secrets. Needs importhub's `importer`, as all three key calls do.
@@ -321,9 +400,12 @@ declare interface ImportReleaseRef {
321
400
  configurationId: string;
322
401
  /** The configuration's name in that Release. */
323
402
  name: string;
403
+ /** "" for a draft a Dry Run runs. */
324
404
  releaseId: string;
325
- /** "Release 3". */
405
+ /** "Release 3"; 0 for a draft a Dry Run runs. */
326
406
  number: number;
407
+ /** The draft Revision a Dry Run on drafts runs; unset for a Release. */
408
+ revisionId?: string;
327
409
  }
328
410
 
329
411
  /** The publication that triggered an Import: such as 2026-09-20, "BGBl. 2026 I Nr. 270". */
@@ -353,6 +435,16 @@ declare interface ItemProblem {
353
435
  field: string;
354
436
  /** Why, as importhub words it. */
355
437
  reason: string;
438
+ /**
439
+ * Set when it is a reference the Import could not resolve (CONTEXT.md
440
+ * "Pending Reference"): what it names. Its holder is the Content its
441
+ * Mapping and Source Key read, and `field` is where it holds it.
442
+ */
443
+ pendingReference?: {
444
+ targetMappingId: string;
445
+ targetBlueprintId: string;
446
+ targetSourceKey: string;
447
+ };
356
448
  }
357
449
 
358
450
  /** How an Import's Item Problems are filtered: by Mapping, and by Source Key. */
@@ -378,6 +470,8 @@ declare interface ItemProblemsPage {
378
470
  mappingName: string;
379
471
  count: number;
380
472
  }[];
473
+ /** The Item Problems that are Pending References, whatever the filter. */
474
+ pendingReferenceCount: number;
381
475
  /** "" on the last page. */
382
476
  nextPageToken: string;
383
477
  }
@@ -489,6 +583,59 @@ export declare interface MappingEditorProps {
489
583
  onDeleted: () => void;
490
584
  }
491
585
 
586
+ /** One element a Mapping Test matched, as an Import would read it. */
587
+ declare interface MappingTestElement {
588
+ /** Its position among the elements matched, from 1. */
589
+ position: number;
590
+ /** Its Source Key, verbatim; "" when it has none. */
591
+ sourceKey: string;
592
+ /** Its mapped values by field accessor; a field that cannot be mapped is left out. */
593
+ values: Record<string, unknown>;
594
+ /** The Validity Period the sample gives, as YYYY-MM-DD; "" for none. */
595
+ firstDay: string;
596
+ lastDay: string;
597
+ /** The Release Spec values the sample gives, by field. */
598
+ releaseSpec: Record<string, unknown>;
599
+ /** What the display-name template makes; "" without one. */
600
+ displayName: string;
601
+ /** The Collections it would be filed into, by name. */
602
+ collections: string[];
603
+ /** Each field that cannot be mapped, and what an Import would report; none when clean. */
604
+ problems: MappingTestProblem[];
605
+ }
606
+
607
+ /**
608
+ * What a Mapping Test runs (test-a-mapping-on-a-sample-file:AC1): a
609
+ * Mapping's content as the editor holds it, saved or not, over a sample file.
610
+ */
611
+ declare interface MappingTestInput {
612
+ content: MappingContent;
613
+ /** The sample file, an XML file, sent whole. */
614
+ sample: Uint8Array;
615
+ /**
616
+ * An Entity Set of the workspace whose draft's entities the sample uses;
617
+ * "" or unset for none.
618
+ */
619
+ entitySetId?: string;
620
+ }
621
+
622
+ /** One problem of an element in a Mapping Test (importhub.v1.MappingTestProblem). */
623
+ declare interface MappingTestProblem {
624
+ /**
625
+ * A field path, `.`-joined into fieldsets and virtual tables, or the
626
+ * Mapping's setting that reads it (`display_name_template`, say); "" for
627
+ * the element as a whole, such as an element without a Source Key.
628
+ */
629
+ field: string;
630
+ /** Why, for a person: xmlmapper's message for a field that cannot be mapped. */
631
+ reason: string;
632
+ }
633
+
634
+ /** What a Mapping Test answers: every element the element selector matched. */
635
+ declare interface MappingTestResult {
636
+ elements: MappingTestElement[];
637
+ }
638
+
492
639
  /** One entry of the Processor catalogue. */
493
640
  declare interface Processor {
494
641
  /** How a Profile names it, such as `entity-element`. */
@@ -520,6 +667,15 @@ declare interface SourceFile {
520
667
  fileName: string;
521
668
  }
522
669
 
670
+ /** What starting a Dry Run takes: an Import's inputs, and whether to run drafts. */
671
+ declare interface StartDryRunInput extends StartImportInput {
672
+ /**
673
+ * Run the drafts of the Profile, its Mappings and its Entity Set instead
674
+ * of their latest Releases (ADR 0016); unset for the Releases.
675
+ */
676
+ draft?: boolean;
677
+ }
678
+
523
679
  /** What starting an Import takes. */
524
680
  declare interface StartImportInput {
525
681
  importProfileId: string;