@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.
@@ -117,6 +117,65 @@ declare interface EntitySetContent {
117
117
 
118
118
  declare type FieldComparisonStatus = "unchanged" | "added" | "removed" | "changed";
119
119
 
120
+ /** One run of an Import Profile's Release over one Source File. */
121
+ declare interface Import {
122
+ id: string;
123
+ importProfileId: string;
124
+ /** The Profile's name when the Import started. */
125
+ importProfileName: string;
126
+ sourceFileId: string;
127
+ /** The odon user id of who started it; the host's members name them. */
128
+ startedBy: string;
129
+ phase: ImportPhase;
130
+ /** Unset until it has ended. */
131
+ outcome?: ImportOutcome;
132
+ /** Why it Failed, as importhub words it; "" otherwise. */
133
+ failureReason: string;
134
+ /** How far the current phase is: done of total, both 0 while unknown. */
135
+ progress: {
136
+ done: number;
137
+ total: number;
138
+ };
139
+ counts: ImportCounts;
140
+ /** The contenthub Change Set it fills; "" until it opened one. */
141
+ changeSetId: string;
142
+ /** The exact Releases it runs with, pinned at Start (release-a-configuration:AC8). */
143
+ releases: {
144
+ importProfile?: ImportReleaseRef;
145
+ /** In the Profile's order. */
146
+ mappings: ImportReleaseRef[];
147
+ /** Unset when the Profile names no Entity Set. */
148
+ entitySet?: ImportReleaseRef;
149
+ };
150
+ /** ISO 8601 timestamps; start and end "" until they happen. */
151
+ createTime: string;
152
+ startTime: string;
153
+ endTime: string;
154
+ /** The odon user id of who cancelled it, as soon as they asked; "" for nobody. */
155
+ cancelledBy: string;
156
+ /** YYYY-MM-DD, or "" for none. */
157
+ effectiveDate: string;
158
+ source?: ImportSource;
159
+ }
160
+
161
+ /** What an Import has done (importhub.v1.ImportCounts). */
162
+ declare interface ImportCounts {
163
+ /** Source Versions its Mappings matched. */
164
+ matched: number;
165
+ /** Content it created. */
166
+ created: number;
167
+ /** Item Problems: Source Versions it skipped. */
168
+ problems: number;
169
+ /** New Planned Releases of Content that exists. */
170
+ planned: number;
171
+ /** Changed Versions planned as corrections. */
172
+ corrected: number;
173
+ /** Changed Versions kept. */
174
+ kept: number;
175
+ /** Source Versions already in contenthub. */
176
+ unchanged: number;
177
+ }
178
+
120
179
  /**
121
180
  * What the screens ask of importhub. Every call acts on the caller's
122
181
  * workspace, which importhub takes from the token's active workspace and
@@ -161,8 +220,28 @@ declare interface ImporthubClient {
161
220
  compareRevisions(kind: ConfigurationKind, id: string, fromRevisionId: string, toRevisionId: string): Promise<ConfigurationComparison>;
162
221
  /** Saves an older Revision's content as a new draft, on the draft named. */
163
222
  restoreRevision(kind: ConfigurationKind, id: string, revisionId: string, draftRevisionId: string): Promise<void>;
223
+ /**
224
+ * Uploads one file as a Source File: importhub hands out a direct upload
225
+ * URL into its blob store, and the file goes there, not through importhub
226
+ * (start-an-import:AC1). `onProgress` hears the share sent, 0 to 1.
227
+ */
228
+ uploadSourceFile(file: File, onProgress: (fraction: number) => void): Promise<SourceFile>;
229
+ /** Queues an Import. Throws StartRefusedError, with importhub's reason. */
230
+ startImport(input: StartImportInput): Promise<Import>;
231
+ /** One page of the workspace's Imports, newest first; pageToken "" for the first. */
232
+ listImports(pageToken: string): Promise<ImportsPage>;
233
+ getImport(id: string): Promise<Import>;
234
+ /** Asks a queued or running Import to stop; returns it as it is now. */
235
+ cancelImport(id: string): Promise<Import>;
236
+ listItemProblems(importId: string, filter: ItemProblemsFilter): Promise<ItemProblemsPage>;
164
237
  }
165
238
 
239
+ /** How an Import ended (importhub.v1.ImportOutcome, CONTEXT.md "Import Outcome"). */
240
+ declare type ImportOutcome = "succeeded" | "succeeded_with_problems" | "failed" | "cancelled";
241
+
242
+ /** Where an Import is (importhub.v1.ImportPhase). */
243
+ declare type ImportPhase = "queued" | "reading" | "writing" | "ended";
244
+
166
245
  declare type ImportProfile = Configured<ImportProfileContent>;
167
246
 
168
247
  /** What an admin edits of an Import Profile. */
@@ -187,6 +266,72 @@ declare interface ImportProfileRef {
187
266
  name: string;
188
267
  }
189
268
 
269
+ /** One Configuration Release an Import runs with, named as it was then. */
270
+ declare interface ImportReleaseRef {
271
+ configurationId: string;
272
+ /** The configuration's name in that Release. */
273
+ name: string;
274
+ releaseId: string;
275
+ /** "Release 3". */
276
+ number: number;
277
+ }
278
+
279
+ /** The publication that triggered an Import: such as 2026-09-20, "BGBl. 2026 I Nr. 270". */
280
+ declare interface ImportSource {
281
+ /** The day it was published, as YYYY-MM-DD. */
282
+ date: string;
283
+ /** How it is cited. */
284
+ reference: string;
285
+ }
286
+
287
+ /** One page of the workspace's Imports, newest first. */
288
+ declare interface ImportsPage {
289
+ imports: Import[];
290
+ /** "" on the last page. */
291
+ nextPageToken: string;
292
+ }
293
+
294
+ /** One Source Version an Import could not save and skipped (CONTEXT.md "Item Problem"). */
295
+ declare interface ItemProblem {
296
+ id: string;
297
+ mappingId: string;
298
+ /** The Mapping's name in the Release the Import ran. */
299
+ mappingName: string;
300
+ /** "" when the element has none. */
301
+ sourceKey: string;
302
+ /** A /-separated path in the Content's data; "" for the Source Version as a whole. */
303
+ field: string;
304
+ /** Why, as importhub words it. */
305
+ reason: string;
306
+ }
307
+
308
+ /** How an Import's Item Problems are filtered: by Mapping, and by Source Key. */
309
+ declare interface ItemProblemsFilter {
310
+ /** "" for every Mapping. */
311
+ mappingId: string;
312
+ /** Matches Source Keys that contain it, ignoring case; "" for all. */
313
+ sourceKeyQuery: string;
314
+ /** "" for the first page. */
315
+ pageToken: string;
316
+ }
317
+
318
+ /** One page of an Import's Item Problems, with their counts. */
319
+ declare interface ItemProblemsPage {
320
+ itemProblems: ItemProblem[];
321
+ /** Every Item Problem of the Import, whatever the filter. */
322
+ totalCount: number;
323
+ /** The Item Problems the filter matches, on every page. */
324
+ matchingCount: number;
325
+ /** Every Mapping with Item Problems and how many, whatever the filter. */
326
+ mappings: {
327
+ mappingId: string;
328
+ mappingName: string;
329
+ count: number;
330
+ }[];
331
+ /** "" on the last page. */
332
+ nextPageToken: string;
333
+ }
334
+
190
335
  declare type Mapping = Configured<MappingContent>;
191
336
 
192
337
  /**
@@ -314,6 +459,22 @@ declare interface ProcessorStep {
314
459
 
315
460
  declare type ProcessorTarget = "source_file" | "rich_text_field";
316
461
 
462
+ /** A Source File uploaded and ready to be imported. */
463
+ declare interface SourceFile {
464
+ id: string;
465
+ fileName: string;
466
+ }
467
+
468
+ /** What starting an Import takes. */
469
+ declare interface StartImportInput {
470
+ importProfileId: string;
471
+ sourceFileId: string;
472
+ /** YYYY-MM-DD; "" or unset for none. */
473
+ effectiveDate?: string;
474
+ /** Both or neither. */
475
+ source?: ImportSource;
476
+ }
477
+
317
478
  /** The intent a Title Contribution writes (importhub.v1.TitleIntent). */
318
479
  declare type TitleIntent = "TITLE_INTENT_UNSPECIFIED" | "TITLE_INTENT_EXCLUDE" | "TITLE_INTENT_REPLACE" | "TITLE_INTENT_ANNOTATE";
319
480
 
@@ -1,7 +1,7 @@
1
1
  import { jsx as t, jsxs as s, Fragment as P } from "react/jsx-runtime";
2
2
  import { useState as _, useEffect as ue, useMemo as ve } from "react";
3
3
  import { useTranslation as $ } from "react-i18next";
4
- import { I as F, l as D, m as te, u as Se, i as xe, M as Ce } from "./mapping-page-v0GJAPjW.js";
4
+ import { I as F, l as D, m as te, u as Se, i as xe, M as Ce } from "./mapping-page-D92XwUq5.js";
5
5
  import { Button as H, StatusBadge as Ee, IconButton as B } from "@knkcs/anker/atoms";
6
6
  import { Card as y, NavList as Q } from "@knkcs/anker/components";
7
7
  import { Stack as h, Text as g, Textarea as me, Alert as K, Box as x, List as oe, HStack as ee, Heading as Ie, Code as $e, Separator as ae, Grid as he, RadioGroup as Fe, Radio as Ne } from "@knkcs/anker/primitives";