@knkcs/importhub-ui 0.4.0 → 0.5.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 +7 -0
- package/README.md +7 -2
- package/dist/importhub-client-fCWgKH03.js +29 -0
- package/dist/importhub-client-fCWgKH03.js.map +1 -0
- package/dist/index.d.ts +457 -0
- package/dist/index.js +1547 -849
- package/dist/index.js.map +1 -1
- package/dist/mapping-editor.d.ts +161 -0
- package/dist/mapping-editor.js +1 -1
- package/dist/{mapping-page-v0GJAPjW.js → mapping-page-D92XwUq5.js} +426 -418
- package/dist/mapping-page-D92XwUq5.js.map +1 -0
- package/dist/testing.d.ts +192 -0
- package/dist/testing.js +548 -270
- package/dist/testing.js.map +1 -1
- package/package.json +1 -1
- package/dist/importhub-client-CrS-3Zuu.js +0 -23
- package/dist/importhub-client-CrS-3Zuu.js.map +0 -1
- package/dist/mapping-page-v0GJAPjW.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.5.0](https://github.com/knkCS/importhub/compare/importhub-ui-v0.4.0...importhub-ui-v0.5.0) (2026-12-04)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **ui:** start flow, Import list and Import detail (F6) ([#111](https://github.com/knkCS/importhub/issues/111)) ([8851c3d](https://github.com/knkCS/importhub/commit/8851c3d4985a5549b48a0cda231badf249215a3f))
|
|
9
|
+
|
|
3
10
|
## [0.4.0](https://github.com/knkCS/importhub/compare/importhub-ui-v0.3.0...importhub-ui-v0.4.0) (2026-12-04)
|
|
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 configuration screens (Import Profiles, Mappings, Entity Sets and the Processor catalogue) with their release and history, the structured Mapping editor (the `./mapping-editor` subpath)
|
|
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, and the structured Mapping editor (the `./mapping-editor` subpath). The Dry Run report and the Mapping Test follow.
|
|
8
8
|
|
|
9
9
|
## Install
|
|
10
10
|
|
|
@@ -50,6 +50,8 @@ import { ImporthubHostProvider, STANDALONE_IMPORTHUB_PATHS } from "@knkcs/import
|
|
|
50
50
|
changeSetHref: (changeSetId) => `/change-sets/${changeSetId}`,
|
|
51
51
|
// Whether the viewer may change configuration (importhub's `admin`). Unset: read-only.
|
|
52
52
|
canConfigure: true,
|
|
53
|
+
// Whether the viewer may start and cancel Imports (importhub's `importer`). Unset: neither.
|
|
54
|
+
canImport: true,
|
|
53
55
|
// Optional: where Blueprints and their Releases are found, to name a Mapping's target.
|
|
54
56
|
// Without it, the Mapping screens take and show their ids, labelled as such.
|
|
55
57
|
// `getRelease` (optional) gives a Release's field tree to the Mapping editor; without
|
|
@@ -65,13 +67,16 @@ An Import fills one contenthub Change Set, and its page links out to it (`Change
|
|
|
65
67
|
|
|
66
68
|
### Screens
|
|
67
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.
|
|
68
73
|
- `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.
|
|
69
74
|
- `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.
|
|
70
75
|
- `MappingEditor({ client, id, onDeleted })`, from `@knkcs/importhub-ui/mapping-editor`: the structured Mapping editor, a Mapping's page as `MappingDetail` shows it with three 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. 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.
|
|
71
76
|
- `EntitySetsIndex({ client, onOpen })` and `EntitySetDetail({ client, id, onDeleted })`: the Entity Sets and their tables of entities.
|
|
72
77
|
- `ConfigurationHistory({ client, kind, id, draftRevisionId, onRestored })`: a configuration's Revisions, newest first, with who saved each and when and the Releases cut from them; any two compared side by side, and an older one restored as a new draft. Each detail page above renders it as its History tab (`?tab=history`); a host may place it elsewhere.
|
|
73
78
|
- `ProcessorCatalogue({ client })`: every Processor with its kind, description and settings.
|
|
74
|
-
- `ImporthubStartPage({ client, section })`: a section's start page, for a
|
|
79
|
+
- `ImporthubStartPage({ client, section })`: a section's start page, for a host that has no screen for a section yet.
|
|
75
80
|
|
|
76
81
|
Every configuration screen shows why a configuration is invalid and whether its draft differs from its latest Release, saves with the header's one Save, and cuts a Release and deletes from the rail (anker ADR 0004); a Mapping's cut names the Import Profiles that take the Release first. It is read-only, with no Cut Release or restore, unless the host says `canConfigure`. `onOpen` runs after a create too; `onDeleted` once the item is gone.
|
|
77
82
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
class t extends Error {
|
|
2
|
+
importProfiles;
|
|
3
|
+
constructor(r, s = "in use by Import Profiles") {
|
|
4
|
+
super(s), this.name = "ConfigurationInUseError", this.importProfiles = r;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
class o extends Error {
|
|
8
|
+
validity;
|
|
9
|
+
constructor(r, s) {
|
|
10
|
+
super(r), this.name = "ReleaseRefusedError", this.validity = s;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
class a extends Error {
|
|
14
|
+
constructor(r = "the name is taken") {
|
|
15
|
+
super(r), this.name = "NameTakenError";
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
class n extends Error {
|
|
19
|
+
constructor(r) {
|
|
20
|
+
super(r), this.name = "StartRefusedError";
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
t as C,
|
|
25
|
+
a as N,
|
|
26
|
+
o as R,
|
|
27
|
+
n as S
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=importhub-client-fCWgKH03.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"importhub-client-fCWgKH03.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.\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\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 * 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\treleaseId: string;\n\t/** \"Release 3\". */\n\tnumber: number;\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}\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}\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/** 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}\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/** \"\" 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 * 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\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}\n"],"names":["ConfigurationInUseError","importProfiles","message","ReleaseRefusedError","validity","NameTakenError","StartRefusedError"],"mappings":"AA0NO,MAAMA,UAAgC,MAAM;AAAA,EACzC;AAAA,EACT,YAAYC,GAAoCC,IAAU,6BAA6B;AACtF,UAAMA,CAAO,GACb,KAAK,OAAO,2BACZ,KAAK,iBAAiBD;AAAA,EACvB;AACD;AAQO,MAAME,UAA4B,MAAM;AAAA,EACrC;AAAA,EACT,YAAYD,GAAiBE,GAAqB;AACjD,UAAMF,CAAO,GACb,KAAK,OAAO,uBACZ,KAAK,WAAWE;AAAA,EACjB;AACD;AAGO,MAAMC,UAAuB,MAAM;AAAA,EACzC,YAAYH,IAAU,qBAAqB;AAC1C,UAAMA,CAAO,GACb,KAAK,OAAO;AAAA,EACb;AACD;AAiNO,MAAMI,UAA0B,MAAM;AAAA,EAC5C,YAAYJ,GAAiB;AAC5B,UAAMA,CAAO,GACb,KAAK,OAAO;AAAA,EACb;AACD;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -167,6 +167,12 @@ export declare interface CreateConnectImporthubClientOptions {
|
|
|
167
167
|
fetch?: typeof fetch;
|
|
168
168
|
/** A pre-built transport (tests: `createRouterTransport`). Overrides baseUrl and fetch. */
|
|
169
169
|
transport?: Transport;
|
|
170
|
+
/**
|
|
171
|
+
* How a Source File's content is sent to the upload URL importhub hands
|
|
172
|
+
* out; `putToBlobStore` by default. Tests in Node, which has no
|
|
173
|
+
* XMLHttpRequest, pass their own.
|
|
174
|
+
*/
|
|
175
|
+
putFile?: (url: string, file: File, onProgress: (fraction: number) => void) => Promise<void>;
|
|
170
176
|
}
|
|
171
177
|
|
|
172
178
|
/** A Release cut, and for a Mapping the Import Profiles that take it. */
|
|
@@ -654,6 +660,111 @@ export declare const i18nResources: {
|
|
|
654
660
|
folderPathSelectorHelp: string;
|
|
655
661
|
};
|
|
656
662
|
};
|
|
663
|
+
imports: {
|
|
664
|
+
start: string;
|
|
665
|
+
empty: string;
|
|
666
|
+
profile: string;
|
|
667
|
+
startedBy: string;
|
|
668
|
+
started: string;
|
|
669
|
+
ended: string;
|
|
670
|
+
matched: string;
|
|
671
|
+
created: string;
|
|
672
|
+
problems: string;
|
|
673
|
+
planned: string;
|
|
674
|
+
corrected: string;
|
|
675
|
+
kept: string;
|
|
676
|
+
unchanged: string;
|
|
677
|
+
loadMore: string;
|
|
678
|
+
phase: {
|
|
679
|
+
queued: string;
|
|
680
|
+
reading: string;
|
|
681
|
+
writing: string;
|
|
682
|
+
cancelling: string;
|
|
683
|
+
};
|
|
684
|
+
outcome: {
|
|
685
|
+
succeeded: string;
|
|
686
|
+
succeeded_with_problems: string;
|
|
687
|
+
failed: string;
|
|
688
|
+
cancelled: string;
|
|
689
|
+
};
|
|
690
|
+
progressTitle: string;
|
|
691
|
+
phaseLong: {
|
|
692
|
+
reading: string;
|
|
693
|
+
writing: string;
|
|
694
|
+
};
|
|
695
|
+
progressOf: string;
|
|
696
|
+
progressUnknown: string;
|
|
697
|
+
queuedBody: string;
|
|
698
|
+
failedTitle: string;
|
|
699
|
+
cancelledBody: string;
|
|
700
|
+
cancellingBody: string;
|
|
701
|
+
problemsBody_one: string;
|
|
702
|
+
problemsBody_other: string;
|
|
703
|
+
details: string;
|
|
704
|
+
effectiveDate: string;
|
|
705
|
+
source: string;
|
|
706
|
+
sourceValue: string;
|
|
707
|
+
none: string;
|
|
708
|
+
changeSet: string;
|
|
709
|
+
counts: string;
|
|
710
|
+
releases: string;
|
|
711
|
+
releaseOf: string;
|
|
712
|
+
mapping: string;
|
|
713
|
+
entitySet: string;
|
|
714
|
+
cancel: string;
|
|
715
|
+
cancelTitle: string;
|
|
716
|
+
cancelMessage: string;
|
|
717
|
+
cancelConfirm: string;
|
|
718
|
+
keepRunning: string;
|
|
719
|
+
cancelFailed: string;
|
|
720
|
+
itemProblems: string;
|
|
721
|
+
noItemProblems: string;
|
|
722
|
+
noMatchingProblems: string;
|
|
723
|
+
searchSourceKey: string;
|
|
724
|
+
filterMapping: string;
|
|
725
|
+
allMappings: string;
|
|
726
|
+
mappingCount: string;
|
|
727
|
+
problemCount: string;
|
|
728
|
+
sourceKey: string;
|
|
729
|
+
field: string;
|
|
730
|
+
reason: string;
|
|
731
|
+
wholeVersion: string;
|
|
732
|
+
noSourceKey: string;
|
|
733
|
+
subtitle: string;
|
|
734
|
+
outcomeColumn: string;
|
|
735
|
+
someone: string;
|
|
736
|
+
mappings: string;
|
|
737
|
+
};
|
|
738
|
+
startImport: {
|
|
739
|
+
title: string;
|
|
740
|
+
fileCard: string;
|
|
741
|
+
profile: string;
|
|
742
|
+
profileHelp: string;
|
|
743
|
+
profileOption: string;
|
|
744
|
+
file: string;
|
|
745
|
+
fileHelp: string;
|
|
746
|
+
dropHint: string;
|
|
747
|
+
dragActive: string;
|
|
748
|
+
chooseFile: string;
|
|
749
|
+
uploading: string;
|
|
750
|
+
uploaded: string;
|
|
751
|
+
uploadFailed: string;
|
|
752
|
+
notXml: string;
|
|
753
|
+
datesCard: string;
|
|
754
|
+
datesHelp: string;
|
|
755
|
+
effectiveDate: string;
|
|
756
|
+
effectiveDateHelp: string;
|
|
757
|
+
sourceDate: string;
|
|
758
|
+
sourceReference: string;
|
|
759
|
+
sourceReferenceHelp: string;
|
|
760
|
+
sourceIncomplete: string;
|
|
761
|
+
profileRequired: string;
|
|
762
|
+
consentTitle: string;
|
|
763
|
+
consent: string;
|
|
764
|
+
refused: string;
|
|
765
|
+
notAllowed: string;
|
|
766
|
+
noProfiles: string;
|
|
767
|
+
};
|
|
657
768
|
};
|
|
658
769
|
};
|
|
659
770
|
de: {
|
|
@@ -1089,10 +1200,196 @@ export declare const i18nResources: {
|
|
|
1089
1200
|
folderPathSelectorHelp: string;
|
|
1090
1201
|
};
|
|
1091
1202
|
};
|
|
1203
|
+
imports: {
|
|
1204
|
+
start: string;
|
|
1205
|
+
empty: string;
|
|
1206
|
+
profile: string;
|
|
1207
|
+
startedBy: string;
|
|
1208
|
+
started: string;
|
|
1209
|
+
ended: string;
|
|
1210
|
+
matched: string;
|
|
1211
|
+
created: string;
|
|
1212
|
+
problems: string;
|
|
1213
|
+
planned: string;
|
|
1214
|
+
corrected: string;
|
|
1215
|
+
kept: string;
|
|
1216
|
+
unchanged: string;
|
|
1217
|
+
loadMore: string;
|
|
1218
|
+
phase: {
|
|
1219
|
+
queued: string;
|
|
1220
|
+
reading: string;
|
|
1221
|
+
writing: string;
|
|
1222
|
+
cancelling: string;
|
|
1223
|
+
};
|
|
1224
|
+
outcome: {
|
|
1225
|
+
succeeded: string;
|
|
1226
|
+
succeeded_with_problems: string;
|
|
1227
|
+
failed: string;
|
|
1228
|
+
cancelled: string;
|
|
1229
|
+
};
|
|
1230
|
+
progressTitle: string;
|
|
1231
|
+
phaseLong: {
|
|
1232
|
+
reading: string;
|
|
1233
|
+
writing: string;
|
|
1234
|
+
};
|
|
1235
|
+
progressOf: string;
|
|
1236
|
+
progressUnknown: string;
|
|
1237
|
+
queuedBody: string;
|
|
1238
|
+
failedTitle: string;
|
|
1239
|
+
cancelledBody: string;
|
|
1240
|
+
cancellingBody: string;
|
|
1241
|
+
problemsBody_one: string;
|
|
1242
|
+
problemsBody_other: string;
|
|
1243
|
+
details: string;
|
|
1244
|
+
effectiveDate: string;
|
|
1245
|
+
source: string;
|
|
1246
|
+
sourceValue: string;
|
|
1247
|
+
none: string;
|
|
1248
|
+
changeSet: string;
|
|
1249
|
+
counts: string;
|
|
1250
|
+
releases: string;
|
|
1251
|
+
releaseOf: string;
|
|
1252
|
+
mapping: string;
|
|
1253
|
+
entitySet: string;
|
|
1254
|
+
cancel: string;
|
|
1255
|
+
cancelTitle: string;
|
|
1256
|
+
cancelMessage: string;
|
|
1257
|
+
cancelConfirm: string;
|
|
1258
|
+
keepRunning: string;
|
|
1259
|
+
cancelFailed: string;
|
|
1260
|
+
itemProblems: string;
|
|
1261
|
+
noItemProblems: string;
|
|
1262
|
+
noMatchingProblems: string;
|
|
1263
|
+
searchSourceKey: string;
|
|
1264
|
+
filterMapping: string;
|
|
1265
|
+
allMappings: string;
|
|
1266
|
+
mappingCount: string;
|
|
1267
|
+
problemCount: string;
|
|
1268
|
+
sourceKey: string;
|
|
1269
|
+
field: string;
|
|
1270
|
+
reason: string;
|
|
1271
|
+
wholeVersion: string;
|
|
1272
|
+
noSourceKey: string;
|
|
1273
|
+
subtitle: string;
|
|
1274
|
+
outcomeColumn: string;
|
|
1275
|
+
someone: string;
|
|
1276
|
+
mappings: string;
|
|
1277
|
+
};
|
|
1278
|
+
startImport: {
|
|
1279
|
+
title: string;
|
|
1280
|
+
fileCard: string;
|
|
1281
|
+
profile: string;
|
|
1282
|
+
profileHelp: string;
|
|
1283
|
+
profileOption: string;
|
|
1284
|
+
file: string;
|
|
1285
|
+
fileHelp: string;
|
|
1286
|
+
dropHint: string;
|
|
1287
|
+
dragActive: string;
|
|
1288
|
+
chooseFile: string;
|
|
1289
|
+
uploading: string;
|
|
1290
|
+
uploaded: string;
|
|
1291
|
+
uploadFailed: string;
|
|
1292
|
+
notXml: string;
|
|
1293
|
+
datesCard: string;
|
|
1294
|
+
datesHelp: string;
|
|
1295
|
+
effectiveDate: string;
|
|
1296
|
+
effectiveDateHelp: string;
|
|
1297
|
+
sourceDate: string;
|
|
1298
|
+
sourceReference: string;
|
|
1299
|
+
sourceReferenceHelp: string;
|
|
1300
|
+
sourceIncomplete: string;
|
|
1301
|
+
profileRequired: string;
|
|
1302
|
+
consentTitle: string;
|
|
1303
|
+
consent: string;
|
|
1304
|
+
refused: string;
|
|
1305
|
+
notAllowed: string;
|
|
1306
|
+
noProfiles: string;
|
|
1307
|
+
};
|
|
1092
1308
|
};
|
|
1093
1309
|
};
|
|
1094
1310
|
};
|
|
1095
1311
|
|
|
1312
|
+
/** One run of an Import Profile's Release over one Source File. */
|
|
1313
|
+
export declare interface Import {
|
|
1314
|
+
id: string;
|
|
1315
|
+
importProfileId: string;
|
|
1316
|
+
/** The Profile's name when the Import started. */
|
|
1317
|
+
importProfileName: string;
|
|
1318
|
+
sourceFileId: string;
|
|
1319
|
+
/** The odon user id of who started it; the host's members name them. */
|
|
1320
|
+
startedBy: string;
|
|
1321
|
+
phase: ImportPhase;
|
|
1322
|
+
/** Unset until it has ended. */
|
|
1323
|
+
outcome?: ImportOutcome;
|
|
1324
|
+
/** Why it Failed, as importhub words it; "" otherwise. */
|
|
1325
|
+
failureReason: string;
|
|
1326
|
+
/** How far the current phase is: done of total, both 0 while unknown. */
|
|
1327
|
+
progress: {
|
|
1328
|
+
done: number;
|
|
1329
|
+
total: number;
|
|
1330
|
+
};
|
|
1331
|
+
counts: ImportCounts;
|
|
1332
|
+
/** The contenthub Change Set it fills; "" until it opened one. */
|
|
1333
|
+
changeSetId: string;
|
|
1334
|
+
/** The exact Releases it runs with, pinned at Start (release-a-configuration:AC8). */
|
|
1335
|
+
releases: {
|
|
1336
|
+
importProfile?: ImportReleaseRef;
|
|
1337
|
+
/** In the Profile's order. */
|
|
1338
|
+
mappings: ImportReleaseRef[];
|
|
1339
|
+
/** Unset when the Profile names no Entity Set. */
|
|
1340
|
+
entitySet?: ImportReleaseRef;
|
|
1341
|
+
};
|
|
1342
|
+
/** ISO 8601 timestamps; start and end "" until they happen. */
|
|
1343
|
+
createTime: string;
|
|
1344
|
+
startTime: string;
|
|
1345
|
+
endTime: string;
|
|
1346
|
+
/** The odon user id of who cancelled it, as soon as they asked; "" for nobody. */
|
|
1347
|
+
cancelledBy: string;
|
|
1348
|
+
/** YYYY-MM-DD, or "" for none. */
|
|
1349
|
+
effectiveDate: string;
|
|
1350
|
+
source?: ImportSource;
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
/** What an Import has done (importhub.v1.ImportCounts). */
|
|
1354
|
+
export declare interface ImportCounts {
|
|
1355
|
+
/** Source Versions its Mappings matched. */
|
|
1356
|
+
matched: number;
|
|
1357
|
+
/** Content it created. */
|
|
1358
|
+
created: number;
|
|
1359
|
+
/** Item Problems: Source Versions it skipped. */
|
|
1360
|
+
problems: number;
|
|
1361
|
+
/** New Planned Releases of Content that exists. */
|
|
1362
|
+
planned: number;
|
|
1363
|
+
/** Changed Versions planned as corrections. */
|
|
1364
|
+
corrected: number;
|
|
1365
|
+
/** Changed Versions kept. */
|
|
1366
|
+
kept: number;
|
|
1367
|
+
/** Source Versions already in contenthub. */
|
|
1368
|
+
unchanged: number;
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
/**
|
|
1372
|
+
* One Import (follow-an-import): its status, and while it runs its phase
|
|
1373
|
+
* and progress, read again until it ends (AC2); how it ended and why (AC7),
|
|
1374
|
+
* who cancelled it (AC6); its details with the link to its Change Set in
|
|
1375
|
+
* contenthub, where the host says that is (AC5); its counts; the exact
|
|
1376
|
+
* Releases it ran with (release-a-configuration:AC8); and its Item Problems
|
|
1377
|
+
* (AC4). An importer cancels a queued or running one from the rail; a viewer
|
|
1378
|
+
* sees no Cancel (AC8).
|
|
1379
|
+
*/
|
|
1380
|
+
export declare function ImportDetail({ client, id, pollIntervalMs, }: ImportDetailProps): JSX.Element;
|
|
1381
|
+
|
|
1382
|
+
export declare interface ImportDetailProps {
|
|
1383
|
+
client: ImporthubClient;
|
|
1384
|
+
/** The Import's id. */
|
|
1385
|
+
id: string;
|
|
1386
|
+
/**
|
|
1387
|
+
* How often the page reads the Import again while it is queued or
|
|
1388
|
+
* running, in ms; 2000 by default. It stops once the Import has ended.
|
|
1389
|
+
*/
|
|
1390
|
+
pollIntervalMs?: number;
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1096
1393
|
/** Each section's icon, as the Standalone App's sidebar shows it too. */
|
|
1097
1394
|
export declare const IMPORTHUB_SECTION_ICONS: Record<ImporthubSection, LucideIcon>;
|
|
1098
1395
|
|
|
@@ -1213,6 +1510,20 @@ export declare interface ImporthubClient {
|
|
|
1213
1510
|
compareRevisions(kind: ConfigurationKind, id: string, fromRevisionId: string, toRevisionId: string): Promise<ConfigurationComparison>;
|
|
1214
1511
|
/** Saves an older Revision's content as a new draft, on the draft named. */
|
|
1215
1512
|
restoreRevision(kind: ConfigurationKind, id: string, revisionId: string, draftRevisionId: string): Promise<void>;
|
|
1513
|
+
/**
|
|
1514
|
+
* Uploads one file as a Source File: importhub hands out a direct upload
|
|
1515
|
+
* URL into its blob store, and the file goes there, not through importhub
|
|
1516
|
+
* (start-an-import:AC1). `onProgress` hears the share sent, 0 to 1.
|
|
1517
|
+
*/
|
|
1518
|
+
uploadSourceFile(file: File, onProgress: (fraction: number) => void): Promise<SourceFile>;
|
|
1519
|
+
/** Queues an Import. Throws StartRefusedError, with importhub's reason. */
|
|
1520
|
+
startImport(input: StartImportInput): Promise<Import>;
|
|
1521
|
+
/** One page of the workspace's Imports, newest first; pageToken "" for the first. */
|
|
1522
|
+
listImports(pageToken: string): Promise<ImportsPage>;
|
|
1523
|
+
getImport(id: string): Promise<Import>;
|
|
1524
|
+
/** Asks a queued or running Import to stop; returns it as it is now. */
|
|
1525
|
+
cancelImport(id: string): Promise<Import>;
|
|
1526
|
+
listItemProblems(importId: string, filter: ItemProblemsFilter): Promise<ItemProblemsPage>;
|
|
1216
1527
|
}
|
|
1217
1528
|
|
|
1218
1529
|
export declare interface ImporthubHost {
|
|
@@ -1232,6 +1543,13 @@ export declare interface ImporthubHost {
|
|
|
1232
1543
|
* nothing.
|
|
1233
1544
|
*/
|
|
1234
1545
|
canConfigure?: boolean;
|
|
1546
|
+
/**
|
|
1547
|
+
* Whether the viewer may start and cancel Imports: importhub's
|
|
1548
|
+
* `importer` (ADR 0010), which `admin` implies. Unset, the screens offer
|
|
1549
|
+
* neither, as to a `viewer` (follow-an-import:AC8); importhub authorizes
|
|
1550
|
+
* every Start and Cancel itself, so this hides actions and guards nothing.
|
|
1551
|
+
*/
|
|
1552
|
+
canImport?: boolean;
|
|
1235
1553
|
/** Where Blueprints and their Releases are found; see ImporthubBlueprints. */
|
|
1236
1554
|
blueprints?: ImporthubBlueprints;
|
|
1237
1555
|
}
|
|
@@ -1254,6 +1572,10 @@ export declare const importhubKeys: {
|
|
|
1254
1572
|
mappingImportProfiles: (workspaceId: string, id: string) => readonly ["importhub", string, "mappings", string, "importProfiles"];
|
|
1255
1573
|
entitySets: (workspaceId: string) => readonly ["importhub", string, "entitySets"];
|
|
1256
1574
|
entitySet: (workspaceId: string, id: string) => readonly ["importhub", string, "entitySets", string];
|
|
1575
|
+
imports: (workspaceId: string) => readonly ["importhub", string, "imports"];
|
|
1576
|
+
import: (workspaceId: string, id: string) => readonly ["importhub", string, "imports", string];
|
|
1577
|
+
/** An Import's Item Problems under a filter, one entry per filter. */
|
|
1578
|
+
itemProblems: (workspaceId: string, id: string, mappingId: string, sourceKeyQuery: string) => readonly ["importhub", string, "imports", string, "itemProblems", string, string];
|
|
1257
1579
|
blueprints: (workspaceId: string) => readonly ["importhub", string, "blueprints"];
|
|
1258
1580
|
blueprintReleases: (workspaceId: string, blueprintId: string) => readonly ["importhub", string, "blueprints", string, "releases"];
|
|
1259
1581
|
/** A Blueprint Release with its field tree; a Release never changes once cut. */
|
|
@@ -1294,6 +1616,12 @@ export declare interface ImporthubStartPageProps {
|
|
|
1294
1616
|
section: ImporthubSection;
|
|
1295
1617
|
}
|
|
1296
1618
|
|
|
1619
|
+
/** How an Import ended (importhub.v1.ImportOutcome, CONTEXT.md "Import Outcome"). */
|
|
1620
|
+
export declare type ImportOutcome = "succeeded" | "succeeded_with_problems" | "failed" | "cancelled";
|
|
1621
|
+
|
|
1622
|
+
/** Where an Import is (importhub.v1.ImportPhase). */
|
|
1623
|
+
export declare type ImportPhase = "queued" | "reading" | "writing" | "ended";
|
|
1624
|
+
|
|
1297
1625
|
export declare type ImportProfile = Configured<ImportProfileContent>;
|
|
1298
1626
|
|
|
1299
1627
|
/** What an admin edits of an Import Profile. */
|
|
@@ -1350,9 +1678,94 @@ export declare interface ImportProfilesIndexProps {
|
|
|
1350
1678
|
onOpen: (id: string) => void;
|
|
1351
1679
|
}
|
|
1352
1680
|
|
|
1681
|
+
/** One Configuration Release an Import runs with, named as it was then. */
|
|
1682
|
+
export declare interface ImportReleaseRef {
|
|
1683
|
+
configurationId: string;
|
|
1684
|
+
/** The configuration's name in that Release. */
|
|
1685
|
+
name: string;
|
|
1686
|
+
releaseId: string;
|
|
1687
|
+
/** "Release 3". */
|
|
1688
|
+
number: number;
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1691
|
+
/**
|
|
1692
|
+
* The workspace's Imports, newest first, with their Profile, starter,
|
|
1693
|
+
* Outcome and counts (follow-an-import:AC1); a queued Import shows as Queued.
|
|
1694
|
+
* The list follows Imports that are still running. An importer starts one
|
|
1695
|
+
* from the header; a viewer sees no Start (follow-an-import:AC8).
|
|
1696
|
+
*/
|
|
1697
|
+
export declare function ImportsIndex({ client, onStart, pollIntervalMs, }: ImportsIndexProps): JSX.Element;
|
|
1698
|
+
|
|
1699
|
+
export declare interface ImportsIndexProps {
|
|
1700
|
+
client: ImporthubClient;
|
|
1701
|
+
/** Opens the start flow: the host navigates to where it mounts `StartImport`. */
|
|
1702
|
+
onStart: () => void;
|
|
1703
|
+
/**
|
|
1704
|
+
* How often the list reads again while one of its Imports is queued or
|
|
1705
|
+
* running, in ms; 2000 by default. It stops once all have ended.
|
|
1706
|
+
*/
|
|
1707
|
+
pollIntervalMs?: number;
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1710
|
+
/** The publication that triggered an Import: such as 2026-09-20, "BGBl. 2026 I Nr. 270". */
|
|
1711
|
+
export declare interface ImportSource {
|
|
1712
|
+
/** The day it was published, as YYYY-MM-DD. */
|
|
1713
|
+
date: string;
|
|
1714
|
+
/** How it is cited. */
|
|
1715
|
+
reference: string;
|
|
1716
|
+
}
|
|
1717
|
+
|
|
1718
|
+
/** One page of the workspace's Imports, newest first. */
|
|
1719
|
+
export declare interface ImportsPage {
|
|
1720
|
+
imports: Import[];
|
|
1721
|
+
/** "" on the last page. */
|
|
1722
|
+
nextPageToken: string;
|
|
1723
|
+
}
|
|
1724
|
+
|
|
1353
1725
|
/** Where an item of a section lives: its index's path, then its id. */
|
|
1354
1726
|
export declare function itemPath(paths: ImporthubPaths, section: ImporthubSection, id: string): string;
|
|
1355
1727
|
|
|
1728
|
+
/** One Source Version an Import could not save and skipped (CONTEXT.md "Item Problem"). */
|
|
1729
|
+
export declare interface ItemProblem {
|
|
1730
|
+
id: string;
|
|
1731
|
+
mappingId: string;
|
|
1732
|
+
/** The Mapping's name in the Release the Import ran. */
|
|
1733
|
+
mappingName: string;
|
|
1734
|
+
/** "" when the element has none. */
|
|
1735
|
+
sourceKey: string;
|
|
1736
|
+
/** A /-separated path in the Content's data; "" for the Source Version as a whole. */
|
|
1737
|
+
field: string;
|
|
1738
|
+
/** Why, as importhub words it. */
|
|
1739
|
+
reason: string;
|
|
1740
|
+
}
|
|
1741
|
+
|
|
1742
|
+
/** How an Import's Item Problems are filtered: by Mapping, and by Source Key. */
|
|
1743
|
+
export declare interface ItemProblemsFilter {
|
|
1744
|
+
/** "" for every Mapping. */
|
|
1745
|
+
mappingId: string;
|
|
1746
|
+
/** Matches Source Keys that contain it, ignoring case; "" for all. */
|
|
1747
|
+
sourceKeyQuery: string;
|
|
1748
|
+
/** "" for the first page. */
|
|
1749
|
+
pageToken: string;
|
|
1750
|
+
}
|
|
1751
|
+
|
|
1752
|
+
/** One page of an Import's Item Problems, with their counts. */
|
|
1753
|
+
export declare interface ItemProblemsPage {
|
|
1754
|
+
itemProblems: ItemProblem[];
|
|
1755
|
+
/** Every Item Problem of the Import, whatever the filter. */
|
|
1756
|
+
totalCount: number;
|
|
1757
|
+
/** The Item Problems the filter matches, on every page. */
|
|
1758
|
+
matchingCount: number;
|
|
1759
|
+
/** Every Mapping with Item Problems and how many, whatever the filter. */
|
|
1760
|
+
mappings: {
|
|
1761
|
+
mappingId: string;
|
|
1762
|
+
mappingName: string;
|
|
1763
|
+
count: number;
|
|
1764
|
+
}[];
|
|
1765
|
+
/** "" on the last page. */
|
|
1766
|
+
nextPageToken: string;
|
|
1767
|
+
}
|
|
1768
|
+
|
|
1356
1769
|
export declare type Mapping = Configured<MappingContent>;
|
|
1357
1770
|
|
|
1358
1771
|
/**
|
|
@@ -1514,6 +1927,12 @@ export declare class ReleaseRefusedError extends Error {
|
|
|
1514
1927
|
constructor(message: string, validity?: Validity);
|
|
1515
1928
|
}
|
|
1516
1929
|
|
|
1930
|
+
/** A Source File uploaded and ready to be imported. */
|
|
1931
|
+
export declare interface SourceFile {
|
|
1932
|
+
id: string;
|
|
1933
|
+
fileName: string;
|
|
1934
|
+
}
|
|
1935
|
+
|
|
1517
1936
|
/**
|
|
1518
1937
|
* The Standalone App's paths: Imports at the top, the configuration under
|
|
1519
1938
|
* `/settings/<item>`, one page per item (odon's integration guide, "Sidebar
|
|
@@ -1521,6 +1940,44 @@ export declare class ReleaseRefusedError extends Error {
|
|
|
1521
1940
|
*/
|
|
1522
1941
|
export declare const STANDALONE_IMPORTHUB_PATHS: ImporthubPaths;
|
|
1523
1942
|
|
|
1943
|
+
/**
|
|
1944
|
+
* The start flow (start-an-import:AC1–AC4): an importer picks one of the
|
|
1945
|
+
* workspace's Import Profiles that has a Release, since an Import never runs
|
|
1946
|
+
* a draft; uploads one XML file straight into importhub's storage, with its
|
|
1947
|
+
* progress; gives, if the file carries none, an effective date and a Source
|
|
1948
|
+
* (its date and reference, both or neither); reads what delegated access
|
|
1949
|
+
* Start grants; and starts with the header's one action. A Start importhub
|
|
1950
|
+
* refuses (a missing contenthub right, a configuration without a Release or
|
|
1951
|
+
* invalid now) is shown with importhub's reason. A viewer gets no Start.
|
|
1952
|
+
*/
|
|
1953
|
+
export declare function StartImport({ client, onStarted }: StartImportProps): JSX.Element;
|
|
1954
|
+
|
|
1955
|
+
/** What starting an Import takes. */
|
|
1956
|
+
export declare interface StartImportInput {
|
|
1957
|
+
importProfileId: string;
|
|
1958
|
+
sourceFileId: string;
|
|
1959
|
+
/** YYYY-MM-DD; "" or unset for none. */
|
|
1960
|
+
effectiveDate?: string;
|
|
1961
|
+
/** Both or neither. */
|
|
1962
|
+
source?: ImportSource;
|
|
1963
|
+
}
|
|
1964
|
+
|
|
1965
|
+
export declare interface StartImportProps {
|
|
1966
|
+
client: ImporthubClient;
|
|
1967
|
+
/** The Import is queued: the host opens its page. */
|
|
1968
|
+
onStarted: (importId: string) => void;
|
|
1969
|
+
}
|
|
1970
|
+
|
|
1971
|
+
/**
|
|
1972
|
+
* A Start importhub refused (start-an-import:AC4, release-a-configuration:AC5):
|
|
1973
|
+
* the starter lacks contenthub `editor`, or `publisher` for an Auto-publish
|
|
1974
|
+
* Profile, or what the Import would run has no Release or is invalid now. Its
|
|
1975
|
+
* message is importhub's, which names what stands in the way.
|
|
1976
|
+
*/
|
|
1977
|
+
export declare class StartRefusedError extends Error {
|
|
1978
|
+
constructor(message: string);
|
|
1979
|
+
}
|
|
1980
|
+
|
|
1524
1981
|
/** The intent a Title Contribution writes (importhub.v1.TitleIntent). */
|
|
1525
1982
|
export declare type TitleIntent = "TITLE_INTENT_UNSPECIFIED" | "TITLE_INTENT_EXCLUDE" | "TITLE_INTENT_REPLACE" | "TITLE_INTENT_ANNOTATE";
|
|
1526
1983
|
|