@knkcs/importhub-ui 0.9.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.10.0](https://github.com/knkCS/importhub/compare/importhub-ui-v0.9.0...importhub-ui-v0.10.0) (2026-12-05)
4
+
5
+
6
+ ### Features
7
+
8
+ * **ui:** Dry Run in the start flow, the Dry Run report, and Dry Runs marked in the Import list (F7) ([#143](https://github.com/knkCS/importhub/issues/143)) ([a353b8e](https://github.com/knkCS/importhub/commit/a353b8e805b7cbd5995727333d2c9dd8a4cfd77c))
9
+
3
10
  ## [0.9.0](https://github.com/knkCS/importhub/compare/importhub-ui-v0.8.0...importhub-ui-v0.9.0) (2026-12-05)
4
11
 
5
12
 
package/README.md CHANGED
@@ -4,7 +4,7 @@ importhub's screens for knk hosts, built on [anker](https://github.com/knkCS/ank
4
4
 
5
5
  The package exports **screens, not routes**. The host draws the page frame (anker's host contract, knkcms/core ADR 0003): a screen reports its title, breadcrumbs and header actions, reads the viewer and the active workspace from `@knkcs/anker/host`, and asks the host for everything only the host knows through `ImporthubHostProvider`. The package never navigates on its own.
6
6
 
7
- So far it holds the Import list, an Import's page and the start flow, the configuration screens (Import Profiles, Mappings, Entity Sets and the Processor catalogue) with their release and history, the workspace's API keys, and the structured Mapping editor with its Mapping Test (the `./mapping-editor` subpath). The Dry Run report follows.
7
+ So far it holds the Import list, an Import's page, the start flow and the Dry Run report, the configuration screens (Import Profiles, Mappings, Entity Sets and the Processor catalogue) with their release and history, the workspace's API keys, and the structured Mapping editor with its Mapping Test (the `./mapping-editor` subpath).
8
8
 
9
9
  ## Install
10
10
 
@@ -67,9 +67,10 @@ An Import fills one contenthub Change Set, and its page links out to it (`Change
67
67
 
68
68
  ### Screens
69
69
 
70
- - `ImportsIndex({ client, onStart, pollIntervalMs? })`: the workspace's Imports, newest first, with their Profile, starter, status (queued, running, or their Import Outcome) and counts. It reads again while one is queued or running. `onStart` opens the start flow, offered only when the host says `canImport`.
71
- - `ImportDetail({ client, id, pollIntervalMs? })`: one Import, at `itemPath(paths, "imports", id)`. While it runs, its phase and progress are read again until it ends. Once it ends, it shows its Outcome and why it failed or who cancelled it, its details, the link to its Change Set, its counts, and the exact Releases it ran with. Its Item Problems are filtered by Mapping and searched by Source Key, with counts. Cancel sits in the rail under `canImport`.
72
- - `StartImport({ client, onStarted })`: the start flow. The importer picks a Profile that has a Release and uploads one XML file straight into importhub's storage, with its progress. They may add an effective date and a Source (date and reference), read what delegated access they grant, and Start from the header. A refused Start shows importhub's reason. `onStarted(importId)` opens the queued Import.
70
+ - `ImportsIndex({ client, onStart, pollIntervalMs? })`: the workspace's Imports, newest first, with their Profile, starter, status (queued, running, or their Import Outcome) and counts, each marked an Import or a Dry Run. It reads again while one is queued or running. `onStart` opens the start flow, offered only when the host says `canImport`.
71
+ - `ImportDetail({ client, id, pollIntervalMs? })`: one Import, at `itemPath(paths, "imports", id)`. While it runs, its phase and progress are read again until it ends. Once it ends, it shows its Outcome and why it failed or who cancelled it, its details, the link to its Change Set, its counts, and the exact Releases it ran with. Its Item Problems, Pending References told apart among them, are filtered by Mapping and searched by Source Key, with counts. Cancel sits in the rail under `canImport`. For a Dry Run it shows the Dry Run report instead, so a host's Import route opens both.
72
+ - `DryRunReport({ client, id, pollIntervalMs? })`: a Dry Run's report, what a real Import with the same inputs would do. Per Content it says whether it would be created, given a new Planned Release, corrected, kept, stubbed or left unchanged, filterable by that, by Mapping and by Source Key. Corrections are called out above it, with a way to show only them. Below come every Item Problem and Pending Reference, its counts, what it ran on (the latest Releases or the drafts) and Cancel under `canImport`, as on an Import's page.
73
+ - `StartImport({ client, onStarted })`: the start flow. The importer chooses a real Import or a Dry Run of it, with the same inputs; under `canConfigure` an admin may run the Dry Run on the drafts instead of the latest Releases, and then any Profile is offered, released or not. The importer picks a Profile that has a Release and uploads one XML file straight into importhub's storage, with its progress. They may add an effective date and a Source (date and reference), read what delegated access they grant, and Start from the header. A refused Start shows importhub's reason. `onStarted(importId)` opens the queued Import or Dry Run.
73
74
  - `ImportProfilesIndex({ client, onOpen })` and `ImportProfileDetail({ client, id, onDeleted })`: the Import Profiles, each with its Entity Set, its Preprocessors, Mappings and Post-processors in order (each Processor configured in a form fieldkit generates from its settings spec), Auto-publish and delete-on-success.
74
75
  - `MappingsIndex({ client, onOpen })` and `MappingDetail({ client, id, onDeleted })`: the Mappings with their target Blueprint and pinned Release, the Profiles that include each, and the move to another Release, which lists the field paths it would lose first.
75
76
  - `MappingEditor({ client, id, onDeleted })`, from `@knkcs/importhub-ui/mapping-editor`: the structured Mapping editor, a Mapping's page as `MappingDetail` shows it with four more tabs. **Fields** shows the pinned Release's field tree, fieldsets nested and each field marked mapped or not, beside the selected field's form: its XPath, its xmlmapper type and that type's options, and an Advanced (JSON) panel with the field mapping's full settings, whose keys the form does not cover survive every save. **Source Key & Source Versions** holds the Source Key's extraction, the Version Match, the Validity Period and Release Spec sources and the Changed Version handling; **Output** the Stub Mapping, the display-name template, target Collections and collection routing, Title Contributions and Placeholder Assets. **Mapping Test** runs the Mapping as the editor holds it, unsaved edits included, over a sample XML file the admin chooses, optionally read with an Entity Set's entities: it lists every matched element with its Source Key and mapped values, and each field that cannot be mapped with its error in the element's row for that field. It says, and importhub's `RunMappingTest` guarantees, that it touches nothing outside importhub; the sample goes with the request and is not kept. The reasons importhub gives for an invalid draft show at the fields they concern. It is its own entry, so load it lazily, where a Mapping's page goes: `lazy(() => import("@knkcs/importhub-ui/mapping-editor").then((m) => ({ default: m.MappingEditor })))`. The root entry never imports it.
@@ -5,14 +5,14 @@ class t extends Error {
5
5
  }
6
6
  class o extends Error {
7
7
  importProfiles;
8
- constructor(r, e = "in use by Import Profiles") {
9
- super(e), this.name = "ConfigurationInUseError", this.importProfiles = r;
8
+ constructor(r, s = "in use by Import Profiles") {
9
+ super(s), this.name = "ConfigurationInUseError", this.importProfiles = r;
10
10
  }
11
11
  }
12
12
  class a extends Error {
13
13
  validity;
14
- constructor(r, e) {
15
- super(r), this.name = "ReleaseRefusedError", this.validity = e;
14
+ constructor(r, s) {
15
+ super(r), this.name = "ReleaseRefusedError", this.validity = s;
16
16
  }
17
17
  }
18
18
  class n extends Error {
@@ -20,7 +20,15 @@ class n extends Error {
20
20
  super(r), this.name = "NameTakenError";
21
21
  }
22
22
  }
23
- class i extends Error {
23
+ const i = [
24
+ "created",
25
+ "planned",
26
+ "corrected",
27
+ "kept",
28
+ "stubbed",
29
+ "unchanged"
30
+ ];
31
+ class c extends Error {
24
32
  constructor(r) {
25
33
  super(r), this.name = "StartRefusedError";
26
34
  }
@@ -29,9 +37,10 @@ const u = 100;
29
37
  export {
30
38
  u as A,
31
39
  o as C,
40
+ i as D,
32
41
  t as M,
33
42
  n as N,
34
43
  a as R,
35
- i as S
44
+ c as S
36
45
  };
37
- //# sourceMappingURL=importhub-client-Wrb4s3lw.js.map
46
+ //# sourceMappingURL=importhub-client-BzOVIXA4.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"importhub-client-BzOVIXA4.js","sources":["../src/client/importhub-client.ts"],"sourcesContent":["// The client the screens are handed: a small, hand-written interface over\n// importhub's Connect API, as every hub package has (blueprinthub-ui,\n// contenthub-ui). Proto types never leave it, so a host or a test can supply\n// any implementation (`createConnectImporthubClient`, or the stub in\n// `@knkcs/importhub-ui/testing`), and a screen never learns the wire.\n//\n// It grows with the screens: the configuration screens (F2) read and write\n// Import Profiles, Mappings and Entity Sets and read the Processor catalogue;\n// release and history (F3, release-a-configuration) cut Releases, list,\n// compare and restore Revisions, alike for every kind of configuration.\n// Imports (F6, start-an-import, follow-an-import) upload a Source File,\n// start, list, read and cancel Imports, and list their Item Problems. API\n// keys (F9, import-with-an-api-key) are created, listed and revoked. Dry Runs\n// (F7, dry-run-an-import) are started as Imports are, and their report read.\n\nimport type { Schema } from \"@knkcs/fieldkit/schema\";\n\n/** One thing that makes a configuration invalid (importhub.v1.ValidityReason). */\nexport interface ValidityReason {\n\t/** Where, as a JSON Pointer into the content; empty for the whole. */\n\tpath: string;\n\t/** A stable code, such as `no_mappings`; the type's service lists them. */\n\tcode: string;\n\t/** What is wrong, in English, for a person. */\n\tmessage: string;\n}\n\n/** Whether a configuration may be released, and if not, why. */\nexport interface Validity {\n\tvalid: boolean;\n\treasons: ValidityReason[];\n}\n\n/** A Configuration Release, as a list names it: \"Release 3\". */\nexport interface ConfigurationRelease {\n\tid: string;\n\tnumber: number;\n}\n\n/** Where a configuration stands: its draft and its latest Release. */\nexport interface ConfigurationState {\n\tdraftRevisionId: string;\n\t/** Unset while the configuration has none. */\n\tlatestRelease?: ConfigurationRelease;\n\t/** True when the draft differs from the latest Release, and while there is none. */\n\tdraftDiffersFromRelease: boolean;\n}\n\n/** One configuration of a kind, at its draft. */\ninterface Configured<C> {\n\tid: string;\n\t/** The draft's content. */\n\tcontent: C;\n\t/**\n\t * Whether it is valid now: for Profiles and Mappings the service's\n\t * `current_validity`, which counts what changed since the save (an\n\t * included Mapping turned invalid, a Blueprint gone); for Entity Sets the\n\t * validity as saved, the only one they have.\n\t */\n\tvalidity: Validity;\n\tstate: ConfigurationState;\n}\n\n/** One Processor in a Profile's pipeline, with its settings. */\nexport interface ProcessorStep {\n\t/** The Processor, by its name in the catalogue. */\n\tprocessor: string;\n\t/** One value per setting of its settings spec, by `api_accessor`. */\n\tsettings: Record<string, unknown>;\n}\n\n/** What an admin edits of an Import Profile. */\nexport interface ImportProfileContent {\n\tname: string;\n\tdescription: string;\n\t/** The Entity Set the Source File is read with; \"\" for none. */\n\tentitySetId: string;\n\t/** In the order they run. */\n\tpreprocessors: ProcessorStep[];\n\t/** The Mappings it includes, by id, in the order they run. */\n\tmappingIds: string[];\n\t/** In the order they run. */\n\tpostProcessors: ProcessorStep[];\n\tautoPublish: boolean;\n\tdeleteSourceFileOnSuccess: boolean;\n}\n\nexport type ImportProfile = Configured<ImportProfileContent>;\n\n/**\n * What an admin edits of a Mapping, in the JSON shape of importhub.v1's\n * MappingContent: its camelCase keys, enums by their names\n * (`CHANGED_VERSION_HANDLING_KEEP`), unset settings left out. The settings are\n * typed as the structured editor (F4) edits them; every key travels through\n * as given, typed or not, so a save never drops one a screen does not show.\n */\nexport interface MappingContent {\n\tname: string;\n\tdescription?: string;\n\tblueprintId: string;\n\tblueprintReleaseId: string;\n\telementSelector?: string;\n\tsourceKey?: {\n\t\tselector?: string;\n\t\ttemplate?: string;\n\t\textractPattern?: string;\n\t\t/** `-` when unset; \"\" joins the groups with nothing. */\n\t\textractSeparator?: string;\n\t\tnormalize?: boolean;\n\t\t[key: string]: unknown;\n\t};\n\t/** Each an xmlmapper FieldMapping; `name` is the field path. */\n\tfields?: Array<Record<string, unknown>>;\n\tversionMatch?: {\n\t\tvalidityPeriod?: boolean;\n\t\treleaseSpecFields?: string[];\n\t\tcontentFields?: string[];\n\t};\n\tvalidityPeriod?: {\n\t\tvalidFromSelector?: string;\n\t\tvalidToSelector?: string;\n\t\tdateFormats?: string[];\n\t};\n\treleaseSpec?: Array<{ field?: string; selector?: string }>;\n\t/** Unset: Correct. */\n\tchangedVersion?: ChangedVersionHandling;\n\tstub?: boolean;\n\ttitleContributions?: Array<{\n\t\tselector?: string;\n\t\tausgabeCodeSelector?: string;\n\t\treferenceSpecValues?: Array<{ field?: string; selector?: string }>;\n\t\treferenceFilterSelector?: string;\n\t\tintent?: TitleIntent;\n\t\tintentTextSelector?: string;\n\t}>;\n\tcollectionRouting?: {\n\t\tselector?: string;\n\t\tcollectionMap?: Record<string, string>;\n\t\tidPattern?: string;\n\t\tcollectionTemplate?: string;\n\t\tsuffix?: string;\n\t\tfallback?: string;\n\t};\n\tcollections?: string[];\n\tdisplayNameTemplate?: string;\n\t/**\n\t * The plain-text field of the pinned Release the display name is written\n\t * into; set with displayNameTemplate, or neither.\n\t */\n\tdisplayNameField?: string;\n\tplaceholderAssets?: Array<{\n\t\tselector?: string;\n\t\tassetType?: string;\n\t\tkeyParts?: string[];\n\t\tnameSelector?: string;\n\t\tdescriptionSelector?: string;\n\t\tmetadata?: Record<string, string>;\n\t\tfolderRoot?: string;\n\t\tfolderPathSelector?: string;\n\t}>;\n\t[key: string]: unknown;\n}\n\n/** What happens to a Changed Version (importhub.v1.ChangedVersionHandling). */\nexport type ChangedVersionHandling =\n\t| \"CHANGED_VERSION_HANDLING_UNSPECIFIED\"\n\t| \"CHANGED_VERSION_HANDLING_CORRECT\"\n\t| \"CHANGED_VERSION_HANDLING_KEEP\"\n\t| \"CHANGED_VERSION_HANDLING_FAIL\";\n\n/** The intent a Title Contribution writes (importhub.v1.TitleIntent). */\nexport type TitleIntent =\n\t| \"TITLE_INTENT_UNSPECIFIED\"\n\t| \"TITLE_INTENT_EXCLUDE\"\n\t| \"TITLE_INTENT_REPLACE\"\n\t| \"TITLE_INTENT_ANNOTATE\";\n\nexport type Mapping = Configured<MappingContent>;\n\n/** What an admin edits of an Entity Set. */\nexport interface EntitySetContent {\n\tname: string;\n\tdescription: string;\n\t/** Entity names without `&` and `;`, to the text each stands for. */\n\tentities: Record<string, string>;\n}\n\nexport type EntitySet = Configured<EntitySetContent>;\n\n/** An Import Profile, named where another configuration is used. */\nexport interface ImportProfileRef {\n\tid: string;\n\tname: string;\n}\n\nexport type ProcessorKind = \"preprocessor\" | \"post_processor\";\nexport type ProcessorTarget = \"source_file\" | \"rich_text_field\";\n\n/** One entry of the Processor catalogue. */\nexport interface Processor {\n\t/** How a Profile names it, such as `entity-element`. */\n\tname: string;\n\tkind: ProcessorKind;\n\t/** What it works on: a Profile lists only `source_file` ones. */\n\ttarget: ProcessorTarget;\n\t/** In English, from the service. */\n\tdescription: string;\n\t/** Its settings as fieldkit Fields, in form order; empty for none. */\n\tsettingsSpec: Schema;\n}\n\n/** What moving a Mapping's draft to another Blueprint Release would lose. */\nexport interface BlueprintReleaseCheck {\n\tblueprintId: string;\n\t/** Every mapped field path the Release does not have. */\n\tmissingFieldPaths: string[];\n\t/** Every Release Spec field read or matched on that it does not have. */\n\tmissingReleaseSpecFields: string[];\n}\n\n/**\n * What a Mapping Test runs (test-a-mapping-on-a-sample-file:AC1): a\n * Mapping's content as the editor holds it, saved or not, over a sample file.\n */\nexport interface MappingTestInput {\n\tcontent: MappingContent;\n\t/** The sample file, an XML file, sent whole. */\n\tsample: Uint8Array;\n\t/**\n\t * An Entity Set of the workspace whose draft's entities the sample uses;\n\t * \"\" or unset for none.\n\t */\n\tentitySetId?: string;\n}\n\n/** One problem of an element in a Mapping Test (importhub.v1.MappingTestProblem). */\nexport interface MappingTestProblem {\n\t/**\n\t * A field path, `.`-joined into fieldsets and virtual tables, or the\n\t * Mapping's setting that reads it (`display_name_template`, say); \"\" for\n\t * the element as a whole, such as an element without a Source Key.\n\t */\n\tfield: string;\n\t/** Why, for a person: xmlmapper's message for a field that cannot be mapped. */\n\treason: string;\n}\n\n/** One element a Mapping Test matched, as an Import would read it. */\nexport interface MappingTestElement {\n\t/** Its position among the elements matched, from 1. */\n\tposition: number;\n\t/** Its Source Key, verbatim; \"\" when it has none. */\n\tsourceKey: string;\n\t/** Its mapped values by field accessor; a field that cannot be mapped is left out. */\n\tvalues: Record<string, unknown>;\n\t/** The Validity Period the sample gives, as YYYY-MM-DD; \"\" for none. */\n\tfirstDay: string;\n\tlastDay: string;\n\t/** The Release Spec values the sample gives, by field. */\n\treleaseSpec: Record<string, unknown>;\n\t/** What the display-name template makes; \"\" without one. */\n\tdisplayName: string;\n\t/** The Collections it would be filed into, by name. */\n\tcollections: string[];\n\t/** Each field that cannot be mapped, and what an Import would report; none when clean. */\n\tproblems: MappingTestProblem[];\n}\n\n/** What a Mapping Test answers: every element the element selector matched. */\nexport interface MappingTestResult {\n\telements: MappingTestElement[];\n}\n\n/**\n * A Mapping Test that could not run at all: the sample is not XML, the\n * element selector or Source Key cannot be evaluated, or the Entity Set named\n * is unknown. Its message is importhub's, which names xmlmapper's reason.\n */\nexport class MappingTestRefusedError extends Error {\n\tconstructor(message: string) {\n\t\tsuper(message);\n\t\tthis.name = \"MappingTestRefusedError\";\n\t}\n}\n\n/**\n * A delete importhub refused because Import Profiles still include the\n * Mapping, or name the Entity Set (manage-mappings:AC4,\n * manage-entity-sets:AC3). Carries the Profiles, so the screen names them.\n */\nexport class ConfigurationInUseError extends Error {\n\treadonly importProfiles: ImportProfileRef[];\n\tconstructor(importProfiles: ImportProfileRef[], message = \"in use by Import Profiles\") {\n\t\tsuper(message);\n\t\tthis.name = \"ConfigurationInUseError\";\n\t\tthis.importProfiles = importProfiles;\n\t}\n}\n\n/**\n * A cut importhub refused (release-a-configuration:AC3): the draft is\n * invalid now, it does not differ from the latest Release, or somebody saved\n * in between. Carries the draft's validity when that was the reason, so the\n * screen lists why.\n */\nexport class ReleaseRefusedError extends Error {\n\treadonly validity?: Validity;\n\tconstructor(message: string, validity?: Validity) {\n\t\tsuper(message);\n\t\tthis.name = \"ReleaseRefusedError\";\n\t\tthis.validity = validity;\n\t}\n}\n\n/** A create or rename refused: another configuration of the kind has the name. */\nexport class NameTakenError extends Error {\n\tconstructor(message = \"the name is taken\") {\n\t\tsuper(message);\n\t\tthis.name = \"NameTakenError\";\n\t}\n}\n\n/** The kinds of versioned configuration (ADR 0016). */\nexport type ConfigurationKind = \"importProfile\" | \"mapping\" | \"entitySet\";\n\n/** One saved Revision of a configuration, as its history lists it. */\nexport interface ConfigurationRevision {\n\tid: string;\n\t/** The odon user id of who saved it; the host's members name them. */\n\tsavedBy: string;\n\t/** When it was saved, as an ISO 8601 timestamp. */\n\tsavedAt: string;\n\t/** Whether it could be released, as decided when it was saved. */\n\tvalidity: Validity;\n\t/** The Revision it restored; \"\" for an ordinary save. */\n\trestoredFromRevisionId: string;\n}\n\n/** A Configuration Release as the history lists it: who cut it, when, from what. */\nexport interface ConfigurationReleaseRecord extends ConfigurationRelease {\n\t/** The Revision it pins. */\n\trevisionId: string;\n\t/** The odon user id of the admin who cut it. */\n\treleasedBy: string;\n\t/** When it was cut, as an ISO 8601 timestamp. */\n\treleasedAt: string;\n}\n\n/** One page of a configuration's history. */\nexport interface ConfigurationHistoryPage {\n\t/** This page's Revisions, newest first. */\n\trevisions: ConfigurationRevision[];\n\t/** Every Release, newest first, on every page. */\n\treleases: ConfigurationReleaseRecord[];\n\t/** The token of the next page; \"\" on the last. */\n\tnextPageToken: string;\n}\n\n/**\n * One side of a comparison: a Revision's content, keyed as importhub keys\n * the compared fields (the proto's field names, such as `mapping_ids`).\n */\nexport interface ConfigurationVersion {\n\trevisionId: string;\n\tcontent: Record<string, unknown>;\n}\n\nexport type FieldComparisonStatus = \"unchanged\" | \"added\" | \"removed\" | \"changed\";\n\n/** Two Revisions of one configuration, and how each top-level field differs. */\nexport interface ConfigurationComparison {\n\tfrom: ConfigurationVersion;\n\tto: ConfigurationVersion;\n\tfields: { field: string; status: FieldComparisonStatus }[];\n}\n\n/** A Release cut, and for a Mapping the Import Profiles that take it. */\nexport interface CutReleaseResult {\n\trelease: ConfigurationReleaseRecord;\n\t/** The Profiles that include the Mapping; empty for other kinds. */\n\timportProfiles: ImportProfileRef[];\n}\n\n/** Where an Import is (importhub.v1.ImportPhase). */\nexport type ImportPhase = \"queued\" | \"reading\" | \"writing\" | \"ended\";\n\n/** How an Import ended (importhub.v1.ImportOutcome, CONTEXT.md \"Import Outcome\"). */\nexport type ImportOutcome = \"succeeded\" | \"succeeded_with_problems\" | \"failed\" | \"cancelled\";\n\n/** The publication that triggered an Import: such as 2026-09-20, \"BGBl. 2026 I Nr. 270\". */\nexport interface ImportSource {\n\t/** The day it was published, as YYYY-MM-DD. */\n\tdate: string;\n\t/** How it is cited. */\n\treference: string;\n}\n\n/** One Configuration Release an Import runs with, named as it was then. */\nexport interface ImportReleaseRef {\n\tconfigurationId: string;\n\t/** The configuration's name in that Release. */\n\tname: string;\n\t/** \"\" for a draft a Dry Run runs. */\n\treleaseId: string;\n\t/** \"Release 3\"; 0 for a draft a Dry Run runs. */\n\tnumber: number;\n\t/** The draft Revision a Dry Run on drafts runs; unset for a Release. */\n\trevisionId?: string;\n}\n\n/** What an Import has done (importhub.v1.ImportCounts). */\nexport interface ImportCounts {\n\t/** Source Versions its Mappings matched. */\n\tmatched: number;\n\t/** Content it created. */\n\tcreated: number;\n\t/** Item Problems: Source Versions it skipped. */\n\tproblems: number;\n\t/** New Planned Releases of Content that exists. */\n\tplanned: number;\n\t/** Changed Versions planned as corrections. */\n\tcorrected: number;\n\t/** Changed Versions kept. */\n\tkept: number;\n\t/** Source Versions already in contenthub. */\n\tunchanged: number;\n\t/** Stubs created for a Stub Mapping's Source Keys no Content had. */\n\tstubbed: number;\n\t/** References it could not resolve: each one of its Item Problems too. */\n\tpendingReferences: number;\n}\n\n/** One run of an Import Profile's Release over one Source File. */\nexport interface Import {\n\tid: string;\n\timportProfileId: string;\n\t/** The Profile's name when the Import started. */\n\timportProfileName: string;\n\tsourceFileId: string;\n\t/** The odon user id of who started it; the host's members name them. */\n\tstartedBy: string;\n\tphase: ImportPhase;\n\t/** Unset until it has ended. */\n\toutcome?: ImportOutcome;\n\t/** Why it Failed, as importhub words it; \"\" otherwise. */\n\tfailureReason: string;\n\t/** How far the current phase is: done of total, both 0 while unknown. */\n\tprogress: { done: number; total: number };\n\tcounts: ImportCounts;\n\t/** The contenthub Change Set it fills; \"\" until it opened one. */\n\tchangeSetId: string;\n\t/** The exact Releases it runs with, pinned at Start (release-a-configuration:AC8). */\n\treleases: {\n\t\timportProfile?: ImportReleaseRef;\n\t\t/** In the Profile's order. */\n\t\tmappings: ImportReleaseRef[];\n\t\t/** Unset when the Profile names no Entity Set. */\n\t\tentitySet?: ImportReleaseRef;\n\t};\n\t/** ISO 8601 timestamps; start and end \"\" until they happen. */\n\tcreateTime: string;\n\tstartTime: string;\n\tendTime: string;\n\t/** The odon user id of who cancelled it, as soon as they asked; \"\" for nobody. */\n\tcancelledBy: string;\n\t/** YYYY-MM-DD, or \"\" for none. */\n\teffectiveDate: string;\n\tsource?: ImportSource;\n\t/**\n\t * Whether it is a Dry Run (CONTEXT.md \"Dry Run\"): it writes nothing and\n\t * opens no Change Set, its counts say what a real Import would do, and its\n\t * report is `listDryRunContents`'.\n\t */\n\tdryRun: boolean;\n\t/** Whether it runs drafts: a Dry Run started on them. Never for a real Import. */\n\tdraft: boolean;\n}\n\n/** One page of the workspace's Imports, newest first. */\nexport interface ImportsPage {\n\timports: Import[];\n\t/** \"\" on the last page. */\n\tnextPageToken: string;\n}\n\n/** A Source File uploaded and ready to be imported. */\nexport interface SourceFile {\n\tid: string;\n\tfileName: string;\n}\n\n/** What starting an Import takes. */\nexport interface StartImportInput {\n\timportProfileId: string;\n\tsourceFileId: string;\n\t/** YYYY-MM-DD; \"\" or unset for none. */\n\teffectiveDate?: string;\n\t/** Both or neither. */\n\tsource?: ImportSource;\n}\n\n/** What starting a Dry Run takes: an Import's inputs, and whether to run drafts. */\nexport interface StartDryRunInput extends StartImportInput {\n\t/**\n\t * Run the drafts of the Profile, its Mappings and its Entity Set instead\n\t * of their latest Releases (ADR 0016); unset for the Releases.\n\t */\n\tdraft?: boolean;\n}\n\n/**\n * What a real Import would do with one Source Version (importhub.v1.DryRunAction):\n * create its Content, give it a new Planned Release, correct the Release its\n * Changed Version matched, keep that Release, create a Stub, or nothing.\n */\nexport type DryRunAction = \"created\" | \"planned\" | \"corrected\" | \"kept\" | \"stubbed\" | \"unchanged\";\n\n/** Every DryRunAction, in the order a report offers them. */\nexport const DRY_RUN_ACTIONS: readonly DryRunAction[] = [\n\t\"created\",\n\t\"planned\",\n\t\"corrected\",\n\t\"kept\",\n\t\"stubbed\",\n\t\"unchanged\",\n];\n\n/** One entry of a Dry Run's report: one Source Version of one Content. */\nexport interface DryRunContent {\n\tmappingId: string;\n\t/** The Mapping's name in what the Dry Run ran. */\n\tmappingName: string;\n\t/** The element's Source Key: the Content's Content Key. */\n\tsourceKey: string;\n\t/** As the Mapping's display-name template makes it; \"\" without one. */\n\tdisplayName: string;\n\taction: DryRunAction;\n\t/** The existing Content it is about; \"\" for Content it would create or stub. */\n\tcontentId: string;\n\t/** The Validity Period, as YYYY-MM-DD; \"\" for undated Content and an open end. */\n\tfirstDay: string;\n\tlastDay: string;\n}\n\n/** How a Dry Run's report is filtered: by action, by Mapping, by Source Key. */\nexport interface DryRunContentsFilter {\n\t/** \"\" for every action. */\n\taction: DryRunAction | \"\";\n\t/** \"\" for every Mapping. */\n\tmappingId: string;\n\t/** Matches Source Keys that contain it, ignoring case; \"\" for all. */\n\tsourceKeyQuery: string;\n\t/** \"\" for the first page. */\n\tpageToken: string;\n}\n\n/** One page of a Dry Run's report. */\nexport interface DryRunContentsPage {\n\tcontents: DryRunContent[];\n\t/** Every entry of the report, whatever the filter. */\n\ttotalCount: number;\n\t/** The entries the filter matches, on every page. */\n\tmatchingCount: number;\n\t/** \"\" on the last page. */\n\tnextPageToken: string;\n}\n\n/** One Source Version an Import could not save and skipped (CONTEXT.md \"Item Problem\"). */\nexport interface ItemProblem {\n\tid: string;\n\tmappingId: string;\n\t/** The Mapping's name in the Release the Import ran. */\n\tmappingName: string;\n\t/** \"\" when the element has none. */\n\tsourceKey: string;\n\t/** A /-separated path in the Content's data; \"\" for the Source Version as a whole. */\n\tfield: string;\n\t/** Why, as importhub words it. */\n\treason: string;\n\t/**\n\t * Set when it is a reference the Import could not resolve (CONTEXT.md\n\t * \"Pending Reference\"): what it names. Its holder is the Content its\n\t * Mapping and Source Key read, and `field` is where it holds it.\n\t */\n\tpendingReference?: {\n\t\ttargetMappingId: string;\n\t\ttargetBlueprintId: string;\n\t\ttargetSourceKey: string;\n\t};\n}\n\n/** How an Import's Item Problems are filtered: by Mapping, and by Source Key. */\nexport interface ItemProblemsFilter {\n\t/** \"\" for every Mapping. */\n\tmappingId: string;\n\t/** Matches Source Keys that contain it, ignoring case; \"\" for all. */\n\tsourceKeyQuery: string;\n\t/** \"\" for the first page. */\n\tpageToken: string;\n}\n\n/** One page of an Import's Item Problems, with their counts. */\nexport interface ItemProblemsPage {\n\titemProblems: ItemProblem[];\n\t/** Every Item Problem of the Import, whatever the filter. */\n\ttotalCount: number;\n\t/** The Item Problems the filter matches, on every page. */\n\tmatchingCount: number;\n\t/** Every Mapping with Item Problems and how many, whatever the filter. */\n\tmappings: { mappingId: string; mappingName: string; count: number }[];\n\t/** The Item Problems that are Pending References, whatever the filter. */\n\tpendingReferenceCount: number;\n\t/** \"\" on the last page. */\n\tnextPageToken: string;\n}\n\n/**\n * A Start importhub refused (start-an-import:AC4, release-a-configuration:AC5):\n * the starter lacks contenthub `editor`, or `publisher` for an Auto-publish\n * Profile, or what the Import would run has no Release or is invalid now. Its\n * message is importhub's, which names what stands in the way.\n */\nexport class StartRefusedError extends Error {\n\tconstructor(message: string) {\n\t\tsuper(message);\n\t\tthis.name = \"StartRefusedError\";\n\t}\n}\n\n/**\n * An importhub API key of the workspace (importhub.v1.APIKey): an odon API\n * key with scope `importhub:workspace:<W>`, which importhub created with a\n * standing Delegation Grant that ends with it (ADR 0006, amended). Never its\n * secret.\n */\nexport interface ApiKey {\n\tid: string;\n\t/** What it is for, as people read it: \"Nightly gesetz feed\". */\n\tname: string;\n\t/** The secret's first characters, for telling keys apart. */\n\tkeyPrefix: string;\n\t/** The odon user id of who created it, as whom it acts; the host's members name them. */\n\towner: string;\n\t/** When it stops working, as an ISO 8601 timestamp; \"\" for never. */\n\texpireTime: string;\n\t/** When it was created, as an ISO 8601 timestamp. */\n\tcreateTime: string;\n}\n\n/** The longest name CreateAPIKey takes. */\nexport const API_KEY_NAME_MAX = 100;\n\n/** What creating an API key takes. */\nexport interface CreateApiKeyInput {\n\t/** Not blank, at most API_KEY_NAME_MAX characters. */\n\tname: string;\n\t/** When it stops working, as an ISO 8601 timestamp in the future; \"\" or unset for never. */\n\texpireTime?: string;\n}\n\n/** A key just created, with its secret: the one time importhub returns it. */\nexport interface CreatedApiKey {\n\tapiKey: ApiKey;\n\t/** To send as `Authorization: Bearer <secret>`; no later call returns it. */\n\tsecret: string;\n}\n\n/**\n * What the screens ask of importhub. Every call acts on the caller's\n * workspace, which importhub takes from the token's active workspace and\n * never from an argument: a host switches workspace by switching the token.\n * An update names the draft it was made on, and is refused when somebody\n * saved in between.\n */\nexport interface ImporthubClient {\n\t/** Every Import Profile of the workspace, by name. */\n\tlistImportProfiles(): Promise<ImportProfile[]>;\n\tgetImportProfile(id: string): Promise<ImportProfile>;\n\tcreateImportProfile(content: ImportProfileContent): Promise<ImportProfile>;\n\tupdateImportProfile(\n\t\tid: string,\n\t\tcontent: ImportProfileContent,\n\t\tdraftRevisionId: string,\n\t): Promise<ImportProfile>;\n\tdeleteImportProfile(id: string): Promise<void>;\n\n\t/** The Processor catalogue, by name; the same in every workspace. */\n\tlistProcessors(): Promise<Processor[]>;\n\n\t/** Every Mapping of the workspace, by name. */\n\tlistMappings(): Promise<Mapping[]>;\n\tgetMapping(id: string): Promise<Mapping>;\n\tcreateMapping(content: MappingContent): Promise<Mapping>;\n\tupdateMapping(id: string, content: MappingContent, draftRevisionId: string): Promise<Mapping>;\n\t/** Throws ConfigurationInUseError while a Profile includes it. */\n\tdeleteMapping(id: string): Promise<void>;\n\t/** The Import Profiles whose draft or latest Release includes it. */\n\tlistMappingImportProfiles(id: string): Promise<ImportProfileRef[]>;\n\t/** Checks moving the draft to another Blueprint Release, saving nothing. */\n\tcheckMappingBlueprintRelease(\n\t\tid: string,\n\t\tblueprintReleaseId: string,\n\t): Promise<BlueprintReleaseCheck>;\n\t/**\n\t * Runs a Mapping Test: the content given over the sample, read as an\n\t * Import reads a Source File. Stores nothing and touches nothing outside\n\t * importhub (test-a-mapping-on-a-sample-file:AC4). Throws with importhub's\n\t * reason when the test cannot run at all: a sample that is not XML, an\n\t * element selector or Source Key xmlmapper cannot evaluate.\n\t */\n\trunMappingTest(input: MappingTestInput): Promise<MappingTestResult>;\n\n\t/** Every Entity Set of the workspace, by name. */\n\tlistEntitySets(): Promise<EntitySet[]>;\n\tgetEntitySet(id: string): Promise<EntitySet>;\n\tcreateEntitySet(content: EntitySetContent): Promise<EntitySet>;\n\tupdateEntitySet(\n\t\tid: string,\n\t\tcontent: EntitySetContent,\n\t\tdraftRevisionId: string,\n\t): Promise<EntitySet>;\n\t/** Throws ConfigurationInUseError while a Profile names it. */\n\tdeleteEntitySet(id: string): Promise<void>;\n\n\t/**\n\t * Cuts a Configuration Release from the draft named. Throws\n\t * ReleaseRefusedError, with the reasons when the draft is invalid.\n\t */\n\tcutRelease(\n\t\tkind: ConfigurationKind,\n\t\tid: string,\n\t\tdraftRevisionId: string,\n\t): Promise<CutReleaseResult>;\n\t/** One page of the history; pageToken \"\" for the first. */\n\tlistHistory(\n\t\tkind: ConfigurationKind,\n\t\tid: string,\n\t\tpageToken: string,\n\t): Promise<ConfigurationHistoryPage>;\n\tcompareRevisions(\n\t\tkind: ConfigurationKind,\n\t\tid: string,\n\t\tfromRevisionId: string,\n\t\ttoRevisionId: string,\n\t): Promise<ConfigurationComparison>;\n\t/** Saves an older Revision's content as a new draft, on the draft named. */\n\trestoreRevision(\n\t\tkind: ConfigurationKind,\n\t\tid: string,\n\t\trevisionId: string,\n\t\tdraftRevisionId: string,\n\t): Promise<void>;\n\n\t/**\n\t * Uploads one file as a Source File: importhub hands out a direct upload\n\t * URL into its blob store, and the file goes there, not through importhub\n\t * (start-an-import:AC1). `onProgress` hears the share sent, 0 to 1.\n\t */\n\tuploadSourceFile(file: File, onProgress: (fraction: number) => void): Promise<SourceFile>;\n\t/** Queues an Import. Throws StartRefusedError, with importhub's reason. */\n\tstartImport(input: StartImportInput): Promise<Import>;\n\t/** One page of the workspace's Imports, newest first; pageToken \"\" for the first. */\n\tlistImports(pageToken: string): Promise<ImportsPage>;\n\tgetImport(id: string): Promise<Import>;\n\t/** Asks a queued or running Import to stop; returns it as it is now. */\n\tcancelImport(id: string): Promise<Import>;\n\tlistItemProblems(importId: string, filter: ItemProblemsFilter): Promise<ItemProblemsPage>;\n\t/**\n\t * Queues a Dry Run: an Import with the same inputs that writes nothing\n\t * and opens no Change Set (dry-run-an-import:AC1, AC2). Throws\n\t * StartRefusedError, with importhub's reason, as `startImport` does, and\n\t * for a draft that is invalid.\n\t */\n\tstartDryRun(input: StartDryRunInput): Promise<Import>;\n\t/**\n\t * One page of a Dry Run's report: per Source Version, what a real Import\n\t * would do with its Content (dry-run-an-import:AC3).\n\t */\n\tlistDryRunContents(importId: string, filter: DryRunContentsFilter): Promise<DryRunContentsPage>;\n\n\t/**\n\t * Every API key of the workspace, every importer's, newest first, without\n\t * their secrets. Needs importhub's `importer`, as all three key calls do.\n\t */\n\tlistApiKeys(): Promise<ApiKey[]>;\n\t/**\n\t * Creates an API key acting as the caller, with its Delegation Grant, and\n\t * returns its secret this once (import-with-an-api-key:AC5).\n\t */\n\tcreateApiKey(input: CreateApiKeyInput): Promise<CreatedApiKey>;\n\t/**\n\t * Revokes an API key in odon and releases its Grant: it stops working at\n\t * once (import-with-an-api-key:AC7).\n\t */\n\trevokeApiKey(id: string): Promise<void>;\n}\n"],"names":["MappingTestRefusedError","message","ConfigurationInUseError","importProfiles","ReleaseRefusedError","validity","NameTakenError","DRY_RUN_ACTIONS","StartRefusedError","API_KEY_NAME_MAX"],"mappings":"AAsRO,MAAMA,UAAgC,MAAM;AAAA,EAClD,YAAYC,GAAiB;AAC5B,UAAMA,CAAO,GACb,KAAK,OAAO;AAAA,EACb;AACD;AAOO,MAAMC,UAAgC,MAAM;AAAA,EACzC;AAAA,EACT,YAAYC,GAAoCF,IAAU,6BAA6B;AACtF,UAAMA,CAAO,GACb,KAAK,OAAO,2BACZ,KAAK,iBAAiBE;AAAA,EACvB;AACD;AAQO,MAAMC,UAA4B,MAAM;AAAA,EACrC;AAAA,EACT,YAAYH,GAAiBI,GAAqB;AACjD,UAAMJ,CAAO,GACb,KAAK,OAAO,uBACZ,KAAK,WAAWI;AAAA,EACjB;AACD;AAGO,MAAMC,UAAuB,MAAM;AAAA,EACzC,YAAYL,IAAU,qBAAqB;AAC1C,UAAMA,CAAO,GACb,KAAK,OAAO;AAAA,EACb;AACD;AAsMO,MAAMM,IAA2C;AAAA,EACvD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAiGO,MAAMC,UAA0B,MAAM;AAAA,EAC5C,YAAYP,GAAiB;AAC5B,UAAMA,CAAO,GACb,KAAK,OAAO;AAAA,EACb;AACD;AAuBO,MAAMQ,IAAmB;"}
package/dist/index.d.ts CHANGED
@@ -234,6 +234,84 @@ export declare interface CutReleaseResult {
234
234
  importProfiles: ImportProfileRef[];
235
235
  }
236
236
 
237
+ /** Every DryRunAction, in the order a report offers them. */
238
+ export declare const DRY_RUN_ACTIONS: readonly DryRunAction[];
239
+
240
+ /**
241
+ * What a real Import would do with one Source Version (importhub.v1.DryRunAction):
242
+ * create its Content, give it a new Planned Release, correct the Release its
243
+ * Changed Version matched, keep that Release, create a Stub, or nothing.
244
+ */
245
+ export declare type DryRunAction = "created" | "planned" | "corrected" | "kept" | "stubbed" | "unchanged";
246
+
247
+ /** One entry of a Dry Run's report: one Source Version of one Content. */
248
+ export declare interface DryRunContent {
249
+ mappingId: string;
250
+ /** The Mapping's name in what the Dry Run ran. */
251
+ mappingName: string;
252
+ /** The element's Source Key: the Content's Content Key. */
253
+ sourceKey: string;
254
+ /** As the Mapping's display-name template makes it; "" without one. */
255
+ displayName: string;
256
+ action: DryRunAction;
257
+ /** The existing Content it is about; "" for Content it would create or stub. */
258
+ contentId: string;
259
+ /** The Validity Period, as YYYY-MM-DD; "" for undated Content and an open end. */
260
+ firstDay: string;
261
+ lastDay: string;
262
+ }
263
+
264
+ /** How a Dry Run's report is filtered: by action, by Mapping, by Source Key. */
265
+ export declare interface DryRunContentsFilter {
266
+ /** "" for every action. */
267
+ action: DryRunAction | "";
268
+ /** "" for every Mapping. */
269
+ mappingId: string;
270
+ /** Matches Source Keys that contain it, ignoring case; "" for all. */
271
+ sourceKeyQuery: string;
272
+ /** "" for the first page. */
273
+ pageToken: string;
274
+ }
275
+
276
+ /** One page of a Dry Run's report. */
277
+ export declare interface DryRunContentsPage {
278
+ contents: DryRunContent[];
279
+ /** Every entry of the report, whatever the filter. */
280
+ totalCount: number;
281
+ /** The entries the filter matches, on every page. */
282
+ matchingCount: number;
283
+ /** "" on the last page. */
284
+ nextPageToken: string;
285
+ }
286
+
287
+ /**
288
+ * A Dry Run's report (dry-run-an-import:AC3, AC4; CONTEXT.md "Dry Run"):
289
+ * what a real Import with the same inputs would do, written nowhere. It
290
+ * lists per Content whether it would be created, given a new Planned
291
+ * Release, corrected, kept, stubbed or left unchanged, filterable by that
292
+ * and by Mapping; calls out the corrections, the one action that changes
293
+ * what is already published; and lists every Item Problem and Pending
294
+ * Reference. Around it, the Dry Run as any Import's page shows one: its
295
+ * status and progress, what it ran on (the latest Releases, or the drafts),
296
+ * and Cancel for an importer while it runs.
297
+ *
298
+ * `ImportDetail` shows this page for a Dry Run, so a host need not mount it
299
+ * apart; a host that does gets the same page. An Import that is no Dry Run
300
+ * has no report, and this says so.
301
+ */
302
+ export declare function DryRunReport({ client, id, pollIntervalMs, }: DryRunReportProps): JSX.Element;
303
+
304
+ export declare interface DryRunReportProps {
305
+ client: ImporthubClient;
306
+ /** The Dry Run's id: an Import marked as a Dry Run. */
307
+ id: string;
308
+ /**
309
+ * How often the page reads the Dry Run again while it is queued or
310
+ * running, in ms; 2000 by default. It stops once the Dry Run has ended.
311
+ */
312
+ pollIntervalMs?: number;
313
+ }
314
+
237
315
  export declare type EntitySet = Configured<EntitySetContent>;
238
316
 
239
317
  /** What an admin edits of an Entity Set. */
@@ -829,6 +907,14 @@ export declare const i18nResources: {
829
907
  outcomeColumn: string;
830
908
  someone: string;
831
909
  mappings: string;
910
+ kind: string;
911
+ pendingReference: string;
912
+ itemProblem: string;
913
+ problemCountWithPending_one: string;
914
+ problemCountWithPending_other: string;
915
+ kindColumn: string;
916
+ kindImport: string;
917
+ kindDryRun: string;
832
918
  };
833
919
  startImport: {
834
920
  title: string;
@@ -859,6 +945,18 @@ export declare const i18nResources: {
859
945
  refused: string;
860
946
  notAllowed: string;
861
947
  noProfiles: string;
948
+ on: string;
949
+ onRelease: string;
950
+ onDraft: string;
951
+ profileDraftHelp: string;
952
+ profileDraftOption: string;
953
+ startDryRun: string;
954
+ dryRunRefused: string;
955
+ dryRunConsent: string;
956
+ kind: string;
957
+ kindImport: string;
958
+ kindDryRun: string;
959
+ kindCard: string;
862
960
  };
863
961
  apiKeys: {
864
962
  title: string;
@@ -891,6 +989,63 @@ export declare const i18nResources: {
891
989
  revokeMessage: string;
892
990
  revokeFailed: string;
893
991
  };
992
+ dryRun: {
993
+ badge: string;
994
+ subtitle: string;
995
+ failedTitle: string;
996
+ cancelledBody: string;
997
+ problemsBody_one: string;
998
+ problemsBody_other: string;
999
+ cancel: string;
1000
+ cancelTitle: string;
1001
+ cancelMessage: string;
1002
+ phaseLong: {
1003
+ reading: string;
1004
+ writing: string;
1005
+ };
1006
+ ranOn: string;
1007
+ onReleases: string;
1008
+ onDrafts: string;
1009
+ configuration: string;
1010
+ draftOf: string;
1011
+ correctionsTitle_one: string;
1012
+ correctionsTitle_other: string;
1013
+ correctionsBody: string;
1014
+ showCorrections: string;
1015
+ summary: string;
1016
+ counts: {
1017
+ matched: string;
1018
+ created: string;
1019
+ planned: string;
1020
+ corrected: string;
1021
+ kept: string;
1022
+ stubbed: string;
1023
+ unchanged: string;
1024
+ problems: string;
1025
+ pendingReferences: string;
1026
+ };
1027
+ report: string;
1028
+ actionColumn: string;
1029
+ displayName: string;
1030
+ validity: string;
1031
+ filterAction: string;
1032
+ allActions: string;
1033
+ allMappings: string;
1034
+ emptyReport: string;
1035
+ noMatchingContent: string;
1036
+ validityRange: string;
1037
+ validityOpen: string;
1038
+ action: {
1039
+ created: string;
1040
+ planned: string;
1041
+ corrected: string;
1042
+ kept: string;
1043
+ stubbed: string;
1044
+ unchanged: string;
1045
+ };
1046
+ notDryRun: string;
1047
+ contentCount: string;
1048
+ };
894
1049
  };
895
1050
  };
896
1051
  de: {
@@ -1443,6 +1598,14 @@ export declare const i18nResources: {
1443
1598
  outcomeColumn: string;
1444
1599
  someone: string;
1445
1600
  mappings: string;
1601
+ kind: string;
1602
+ pendingReference: string;
1603
+ itemProblem: string;
1604
+ problemCountWithPending_one: string;
1605
+ problemCountWithPending_other: string;
1606
+ kindColumn: string;
1607
+ kindImport: string;
1608
+ kindDryRun: string;
1446
1609
  };
1447
1610
  startImport: {
1448
1611
  title: string;
@@ -1473,6 +1636,18 @@ export declare const i18nResources: {
1473
1636
  refused: string;
1474
1637
  notAllowed: string;
1475
1638
  noProfiles: string;
1639
+ on: string;
1640
+ onRelease: string;
1641
+ onDraft: string;
1642
+ profileDraftHelp: string;
1643
+ profileDraftOption: string;
1644
+ startDryRun: string;
1645
+ dryRunRefused: string;
1646
+ dryRunConsent: string;
1647
+ kind: string;
1648
+ kindImport: string;
1649
+ kindDryRun: string;
1650
+ kindCard: string;
1476
1651
  };
1477
1652
  apiKeys: {
1478
1653
  title: string;
@@ -1505,6 +1680,63 @@ export declare const i18nResources: {
1505
1680
  revokeMessage: string;
1506
1681
  revokeFailed: string;
1507
1682
  };
1683
+ dryRun: {
1684
+ badge: string;
1685
+ subtitle: string;
1686
+ failedTitle: string;
1687
+ cancelledBody: string;
1688
+ problemsBody_one: string;
1689
+ problemsBody_other: string;
1690
+ cancel: string;
1691
+ cancelTitle: string;
1692
+ cancelMessage: string;
1693
+ phaseLong: {
1694
+ reading: string;
1695
+ writing: string;
1696
+ };
1697
+ ranOn: string;
1698
+ onReleases: string;
1699
+ onDrafts: string;
1700
+ configuration: string;
1701
+ draftOf: string;
1702
+ correctionsTitle_one: string;
1703
+ correctionsTitle_other: string;
1704
+ correctionsBody: string;
1705
+ showCorrections: string;
1706
+ summary: string;
1707
+ counts: {
1708
+ matched: string;
1709
+ created: string;
1710
+ planned: string;
1711
+ corrected: string;
1712
+ kept: string;
1713
+ stubbed: string;
1714
+ unchanged: string;
1715
+ problems: string;
1716
+ pendingReferences: string;
1717
+ };
1718
+ report: string;
1719
+ actionColumn: string;
1720
+ displayName: string;
1721
+ validity: string;
1722
+ filterAction: string;
1723
+ allActions: string;
1724
+ allMappings: string;
1725
+ emptyReport: string;
1726
+ noMatchingContent: string;
1727
+ validityRange: string;
1728
+ validityOpen: string;
1729
+ action: {
1730
+ created: string;
1731
+ planned: string;
1732
+ corrected: string;
1733
+ kept: string;
1734
+ stubbed: string;
1735
+ unchanged: string;
1736
+ };
1737
+ notDryRun: string;
1738
+ contentCount: string;
1739
+ };
1508
1740
  };
1509
1741
  };
1510
1742
  };
@@ -1548,6 +1780,14 @@ export declare interface Import {
1548
1780
  /** YYYY-MM-DD, or "" for none. */
1549
1781
  effectiveDate: string;
1550
1782
  source?: ImportSource;
1783
+ /**
1784
+ * Whether it is a Dry Run (CONTEXT.md "Dry Run"): it writes nothing and
1785
+ * opens no Change Set, its counts say what a real Import would do, and its
1786
+ * report is `listDryRunContents`'.
1787
+ */
1788
+ dryRun: boolean;
1789
+ /** Whether it runs drafts: a Dry Run started on them. Never for a real Import. */
1790
+ draft: boolean;
1551
1791
  }
1552
1792
 
1553
1793
  /** What an Import has done (importhub.v1.ImportCounts). */
@@ -1566,6 +1806,10 @@ export declare interface ImportCounts {
1566
1806
  kept: number;
1567
1807
  /** Source Versions already in contenthub. */
1568
1808
  unchanged: number;
1809
+ /** Stubs created for a Stub Mapping's Source Keys no Content had. */
1810
+ stubbed: number;
1811
+ /** References it could not resolve: each one of its Item Problems too. */
1812
+ pendingReferences: number;
1569
1813
  }
1570
1814
 
1571
1815
  /**
@@ -1576,6 +1820,9 @@ export declare interface ImportCounts {
1576
1820
  * Releases it ran with (release-a-configuration:AC8); and its Item Problems
1577
1821
  * (AC4). An importer cancels a queued or running one from the rail; a viewer
1578
1822
  * sees no Cancel (AC8).
1823
+ *
1824
+ * A Dry Run's page is its report (`DryRunReport`), so a host that opens an
1825
+ * Import's page from the list opens a Dry Run's report the same way.
1579
1826
  */
1580
1827
  export declare function ImportDetail({ client, id, pollIntervalMs, }: ImportDetailProps): JSX.Element;
1581
1828
 
@@ -1732,6 +1979,18 @@ export declare interface ImporthubClient {
1732
1979
  /** Asks a queued or running Import to stop; returns it as it is now. */
1733
1980
  cancelImport(id: string): Promise<Import>;
1734
1981
  listItemProblems(importId: string, filter: ItemProblemsFilter): Promise<ItemProblemsPage>;
1982
+ /**
1983
+ * Queues a Dry Run: an Import with the same inputs that writes nothing
1984
+ * and opens no Change Set (dry-run-an-import:AC1, AC2). Throws
1985
+ * StartRefusedError, with importhub's reason, as `startImport` does, and
1986
+ * for a draft that is invalid.
1987
+ */
1988
+ startDryRun(input: StartDryRunInput): Promise<Import>;
1989
+ /**
1990
+ * One page of a Dry Run's report: per Source Version, what a real Import
1991
+ * would do with its Content (dry-run-an-import:AC3).
1992
+ */
1993
+ listDryRunContents(importId: string, filter: DryRunContentsFilter): Promise<DryRunContentsPage>;
1735
1994
  /**
1736
1995
  * Every API key of the workspace, every importer's, newest first, without
1737
1996
  * their secrets. Needs importhub's `importer`, as all three key calls do.
@@ -1799,6 +2058,8 @@ export declare const importhubKeys: {
1799
2058
  import: (workspaceId: string, id: string) => readonly ["importhub", string, "imports", string];
1800
2059
  /** An Import's Item Problems under a filter, one entry per filter. */
1801
2060
  itemProblems: (workspaceId: string, id: string, mappingId: string, sourceKeyQuery: string) => readonly ["importhub", string, "imports", string, "itemProblems", string, string];
2061
+ /** A Dry Run's report under a filter, one entry per filter. */
2062
+ dryRunContents: (workspaceId: string, id: string, action: string, mappingId: string, sourceKeyQuery: string) => readonly ["importhub", string, "imports", string, "dryRunContents", string, string, string];
1802
2063
  /** The workspace's importhub API keys. */
1803
2064
  apiKeys: (workspaceId: string) => readonly ["importhub", string, "apiKeys"];
1804
2065
  blueprints: (workspaceId: string) => readonly ["importhub", string, "blueprints"];
@@ -1908,14 +2169,19 @@ export declare interface ImportReleaseRef {
1908
2169
  configurationId: string;
1909
2170
  /** The configuration's name in that Release. */
1910
2171
  name: string;
2172
+ /** "" for a draft a Dry Run runs. */
1911
2173
  releaseId: string;
1912
- /** "Release 3". */
2174
+ /** "Release 3"; 0 for a draft a Dry Run runs. */
1913
2175
  number: number;
2176
+ /** The draft Revision a Dry Run on drafts runs; unset for a Release. */
2177
+ revisionId?: string;
1914
2178
  }
1915
2179
 
1916
2180
  /**
1917
2181
  * The workspace's Imports, newest first, with their Profile, starter,
1918
2182
  * Outcome and counts (follow-an-import:AC1); a queued Import shows as Queued.
2183
+ * A Dry Run is listed with them, marked as one: its counts say what a real
2184
+ * Import would do, and its page is its report.
1919
2185
  * The list follows Imports that are still running. An importer starts one
1920
2186
  * from the header; a viewer sees no Start (follow-an-import:AC8).
1921
2187
  */
@@ -1962,6 +2228,16 @@ export declare interface ItemProblem {
1962
2228
  field: string;
1963
2229
  /** Why, as importhub words it. */
1964
2230
  reason: string;
2231
+ /**
2232
+ * Set when it is a reference the Import could not resolve (CONTEXT.md
2233
+ * "Pending Reference"): what it names. Its holder is the Content its
2234
+ * Mapping and Source Key read, and `field` is where it holds it.
2235
+ */
2236
+ pendingReference?: {
2237
+ targetMappingId: string;
2238
+ targetBlueprintId: string;
2239
+ targetSourceKey: string;
2240
+ };
1965
2241
  }
1966
2242
 
1967
2243
  /** How an Import's Item Problems are filtered: by Mapping, and by Source Key. */
@@ -1987,6 +2263,8 @@ export declare interface ItemProblemsPage {
1987
2263
  mappingName: string;
1988
2264
  count: number;
1989
2265
  }[];
2266
+ /** The Item Problems that are Pending References, whatever the filter. */
2267
+ pendingReferenceCount: number;
1990
2268
  /** "" on the last page. */
1991
2269
  nextPageToken: string;
1992
2270
  }
@@ -2232,10 +2510,22 @@ export declare interface SourceFile {
2232
2510
  */
2233
2511
  export declare const STANDALONE_IMPORTHUB_PATHS: ImporthubPaths;
2234
2512
 
2513
+ /** What starting a Dry Run takes: an Import's inputs, and whether to run drafts. */
2514
+ export declare interface StartDryRunInput extends StartImportInput {
2515
+ /**
2516
+ * Run the drafts of the Profile, its Mappings and its Entity Set instead
2517
+ * of their latest Releases (ADR 0016); unset for the Releases.
2518
+ */
2519
+ draft?: boolean;
2520
+ }
2521
+
2235
2522
  /**
2236
- * The start flow (start-an-import:AC1–AC4): an importer picks one of the
2237
- * workspace's Import Profiles that has a Release, since an Import never runs
2238
- * a draft; uploads one XML file straight into importhub's storage, with its
2523
+ * The start flow (start-an-import:AC1–AC4): an importer chooses a real
2524
+ * Import or a Dry Run of one, with the same inputs (dry-run-an-import:AC1);
2525
+ * picks one of the workspace's Import Profiles that has a Release, since an
2526
+ * Import never runs a draft, while an admin may run a Dry Run on the drafts
2527
+ * of any Profile instead, to check them before releasing (ADR 0016);
2528
+ * uploads one XML file straight into importhub's storage, with its
2239
2529
  * progress; gives, if the file carries none, an effective date and a Source
2240
2530
  * (its date and reference, both or neither); reads what delegated access
2241
2531
  * Start grants; and starts with the header's one action. A Start importhub
@@ -2256,7 +2546,10 @@ export declare interface StartImportInput {
2256
2546
 
2257
2547
  export declare interface StartImportProps {
2258
2548
  client: ImporthubClient;
2259
- /** The Import is queued: the host opens its page. */
2549
+ /**
2550
+ * The Import or Dry Run is queued: the host opens its page, where a Dry
2551
+ * Run's page is its report.
2552
+ */
2260
2553
  onStarted: (importId: string) => void;
2261
2554
  }
2262
2555