@knkcs/importhub-ui 0.9.0 → 0.11.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,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.11.0](https://github.com/knkCS/importhub/compare/importhub-ui-v0.10.0...importhub-ui-v0.11.0) (2026-12-05)
4
+
5
+
6
+ ### Features
7
+
8
+ * **ui:** Pending References, asset moves and Re-run on an Import's page (F8) ([#148](https://github.com/knkCS/importhub/issues/148)) ([93ba49b](https://github.com/knkCS/importhub/commit/93ba49bd8a9a1d80e08e42ed7b565dcb0ab47106))
9
+
10
+ ## [0.10.0](https://github.com/knkCS/importhub/compare/importhub-ui-v0.9.0...importhub-ui-v0.10.0) (2026-12-05)
11
+
12
+
13
+ ### Features
14
+
15
+ * **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))
16
+
3
17
  ## [0.9.0](https://github.com/knkCS/importhub/compare/importhub-ui-v0.8.0...importhub-ui-v0.9.0) (2026-12-05)
4
18
 
5
19
 
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\t/**\n\t * The Placeholder Assets it found in mediahub outside the folder mirroring\n\t * their path and moved there, in the order moved\n\t * (link-placeholder-assets-in-mediahub:AC7). `getImport` reads them;\n\t * `listImports` leaves them empty, as they grow with the Source File.\n\t */\n\tassetMoves: AssetMove[];\n\t/**\n\t * When its Source File was deleted, as an ISO 8601 timestamp, and why, as\n\t * importhub words it; both \"\" while it is kept. Re-run is offered only\n\t * while it is kept (re-run-a-source-file).\n\t */\n\tsourceFileDeleteTime: string;\n\tsourceFileDeletionReason: string;\n}\n\n/** One mediahub asset an Import moved into the folder mirroring its path. */\nexport interface AssetMove {\n\t/** The asset's key in mediahub, as the source spells it. */\n\tkey: string;\n\t/**\n\t * The folder paths it was moved from and to, from the workspace's root,\n\t * joined by \" / \"; `from` is importhub's \"(no folder)\" for an asset filed\n\t * nowhere.\n\t */\n\tfrom: string;\n\tto: string;\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 * The Content's display name, as its Mapping's display-name template makes\n\t * it; \"\" without one, or when the problem is about no one Content.\n\t */\n\tdisplayName: 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 * Starts a new Import of the same Source File on the latest Releases, its\n\t * other inputs copied (re-run-a-source-file:AC1); a re-run of a Dry Run is\n\t * a Dry Run. Throws StartRefusedError, with importhub's reason, as\n\t * `startImport` does, and once the Source File is deleted.\n\t */\n\trerunImport(id: string): Promise<Import>;\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;AAiOO,MAAMM,IAA2C;AAAA,EACvD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD;AAsGO,MAAMC,UAA0B,MAAM;AAAA,EAC5C,YAAYP,GAAiB;AAC5B,UAAMA,CAAO,GACb,KAAK,OAAO;AAAA,EACb;AACD;AAuBO,MAAMQ,IAAmB;"}