@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/dist/index.d.ts CHANGED
@@ -41,6 +41,19 @@ export declare interface ApiKeysIndexProps {
41
41
  client: ImporthubClient;
42
42
  }
43
43
 
44
+ /** One mediahub asset an Import moved into the folder mirroring its path. */
45
+ export declare interface AssetMove {
46
+ /** The asset's key in mediahub, as the source spells it. */
47
+ key: string;
48
+ /**
49
+ * The folder paths it was moved from and to, from the workspace's root,
50
+ * joined by " / "; `from` is importhub's "(no folder)" for an asset filed
51
+ * nowhere.
52
+ */
53
+ from: string;
54
+ to: string;
55
+ }
56
+
44
57
  /** What moving a Mapping's draft to another Blueprint Release would lose. */
45
58
  export declare interface BlueprintReleaseCheck {
46
59
  blueprintId: string;
@@ -234,6 +247,84 @@ export declare interface CutReleaseResult {
234
247
  importProfiles: ImportProfileRef[];
235
248
  }
236
249
 
250
+ /** Every DryRunAction, in the order a report offers them. */
251
+ export declare const DRY_RUN_ACTIONS: readonly DryRunAction[];
252
+
253
+ /**
254
+ * What a real Import would do with one Source Version (importhub.v1.DryRunAction):
255
+ * create its Content, give it a new Planned Release, correct the Release its
256
+ * Changed Version matched, keep that Release, create a Stub, or nothing.
257
+ */
258
+ export declare type DryRunAction = "created" | "planned" | "corrected" | "kept" | "stubbed" | "unchanged";
259
+
260
+ /** One entry of a Dry Run's report: one Source Version of one Content. */
261
+ export declare interface DryRunContent {
262
+ mappingId: string;
263
+ /** The Mapping's name in what the Dry Run ran. */
264
+ mappingName: string;
265
+ /** The element's Source Key: the Content's Content Key. */
266
+ sourceKey: string;
267
+ /** As the Mapping's display-name template makes it; "" without one. */
268
+ displayName: string;
269
+ action: DryRunAction;
270
+ /** The existing Content it is about; "" for Content it would create or stub. */
271
+ contentId: string;
272
+ /** The Validity Period, as YYYY-MM-DD; "" for undated Content and an open end. */
273
+ firstDay: string;
274
+ lastDay: string;
275
+ }
276
+
277
+ /** How a Dry Run's report is filtered: by action, by Mapping, by Source Key. */
278
+ export declare interface DryRunContentsFilter {
279
+ /** "" for every action. */
280
+ action: DryRunAction | "";
281
+ /** "" for every Mapping. */
282
+ mappingId: string;
283
+ /** Matches Source Keys that contain it, ignoring case; "" for all. */
284
+ sourceKeyQuery: string;
285
+ /** "" for the first page. */
286
+ pageToken: string;
287
+ }
288
+
289
+ /** One page of a Dry Run's report. */
290
+ export declare interface DryRunContentsPage {
291
+ contents: DryRunContent[];
292
+ /** Every entry of the report, whatever the filter. */
293
+ totalCount: number;
294
+ /** The entries the filter matches, on every page. */
295
+ matchingCount: number;
296
+ /** "" on the last page. */
297
+ nextPageToken: string;
298
+ }
299
+
300
+ /**
301
+ * A Dry Run's report (dry-run-an-import:AC3, AC4; CONTEXT.md "Dry Run"):
302
+ * what a real Import with the same inputs would do, written nowhere. It
303
+ * lists per Content whether it would be created, given a new Planned
304
+ * Release, corrected, kept, stubbed or left unchanged, filterable by that
305
+ * and by Mapping; calls out the corrections, the one action that changes
306
+ * what is already published; and lists every Item Problem and Pending
307
+ * Reference. Around it, the Dry Run as any Import's page shows one: its
308
+ * status and progress, what it ran on (the latest Releases, or the drafts),
309
+ * and Cancel for an importer while it runs.
310
+ *
311
+ * `ImportDetail` shows this page for a Dry Run, so a host need not mount it
312
+ * apart; a host that does gets the same page. An Import that is no Dry Run
313
+ * has no report, and this says so.
314
+ */
315
+ export declare function DryRunReport({ client, id, pollIntervalMs, }: DryRunReportProps): JSX.Element;
316
+
317
+ export declare interface DryRunReportProps {
318
+ client: ImporthubClient;
319
+ /** The Dry Run's id: an Import marked as a Dry Run. */
320
+ id: string;
321
+ /**
322
+ * How often the page reads the Dry Run again while it is queued or
323
+ * running, in ms; 2000 by default. It stops once the Dry Run has ended.
324
+ */
325
+ pollIntervalMs?: number;
326
+ }
327
+
237
328
  export declare type EntitySet = Configured<EntitySetContent>;
238
329
 
239
330
  /** What an admin edits of an Entity Set. */
@@ -829,6 +920,32 @@ export declare const i18nResources: {
829
920
  outcomeColumn: string;
830
921
  someone: string;
831
922
  mappings: string;
923
+ kind: string;
924
+ pendingReference: string;
925
+ itemProblem: string;
926
+ problemCountWithPending_one: string;
927
+ problemCountWithPending_other: string;
928
+ kindColumn: string;
929
+ kindImport: string;
930
+ kindDryRun: string;
931
+ content: string;
932
+ targetBlueprint: string;
933
+ targetBlueprintId: string;
934
+ targetSourceKey: string;
935
+ assetMoves: string;
936
+ assetKey: string;
937
+ movedFrom: string;
938
+ movedTo: string;
939
+ noAssetMoves: string;
940
+ rerun: string;
941
+ rerunTitle: string;
942
+ rerunMessage: string;
943
+ rerunConfirm: string;
944
+ rerunFailed: string;
945
+ rerunStarted: string;
946
+ openRerun: string;
947
+ sourceFileGoneTitle: string;
948
+ sourceFileGoneBody: string;
832
949
  };
833
950
  startImport: {
834
951
  title: string;
@@ -859,6 +976,18 @@ export declare const i18nResources: {
859
976
  refused: string;
860
977
  notAllowed: string;
861
978
  noProfiles: string;
979
+ on: string;
980
+ onRelease: string;
981
+ onDraft: string;
982
+ profileDraftHelp: string;
983
+ profileDraftOption: string;
984
+ startDryRun: string;
985
+ dryRunRefused: string;
986
+ dryRunConsent: string;
987
+ kind: string;
988
+ kindImport: string;
989
+ kindDryRun: string;
990
+ kindCard: string;
862
991
  };
863
992
  apiKeys: {
864
993
  title: string;
@@ -891,6 +1020,63 @@ export declare const i18nResources: {
891
1020
  revokeMessage: string;
892
1021
  revokeFailed: string;
893
1022
  };
1023
+ dryRun: {
1024
+ badge: string;
1025
+ subtitle: string;
1026
+ failedTitle: string;
1027
+ cancelledBody: string;
1028
+ problemsBody_one: string;
1029
+ problemsBody_other: string;
1030
+ cancel: string;
1031
+ cancelTitle: string;
1032
+ cancelMessage: string;
1033
+ phaseLong: {
1034
+ reading: string;
1035
+ writing: string;
1036
+ };
1037
+ ranOn: string;
1038
+ onReleases: string;
1039
+ onDrafts: string;
1040
+ configuration: string;
1041
+ draftOf: string;
1042
+ correctionsTitle_one: string;
1043
+ correctionsTitle_other: string;
1044
+ correctionsBody: string;
1045
+ showCorrections: string;
1046
+ summary: string;
1047
+ counts: {
1048
+ matched: string;
1049
+ created: string;
1050
+ planned: string;
1051
+ corrected: string;
1052
+ kept: string;
1053
+ stubbed: string;
1054
+ unchanged: string;
1055
+ problems: string;
1056
+ pendingReferences: string;
1057
+ };
1058
+ report: string;
1059
+ actionColumn: string;
1060
+ displayName: string;
1061
+ validity: string;
1062
+ filterAction: string;
1063
+ allActions: string;
1064
+ allMappings: string;
1065
+ emptyReport: string;
1066
+ noMatchingContent: string;
1067
+ validityRange: string;
1068
+ validityOpen: string;
1069
+ action: {
1070
+ created: string;
1071
+ planned: string;
1072
+ corrected: string;
1073
+ kept: string;
1074
+ stubbed: string;
1075
+ unchanged: string;
1076
+ };
1077
+ notDryRun: string;
1078
+ contentCount: string;
1079
+ };
894
1080
  };
895
1081
  };
896
1082
  de: {
@@ -1443,6 +1629,32 @@ export declare const i18nResources: {
1443
1629
  outcomeColumn: string;
1444
1630
  someone: string;
1445
1631
  mappings: string;
1632
+ kind: string;
1633
+ pendingReference: string;
1634
+ itemProblem: string;
1635
+ problemCountWithPending_one: string;
1636
+ problemCountWithPending_other: string;
1637
+ kindColumn: string;
1638
+ kindImport: string;
1639
+ kindDryRun: string;
1640
+ content: string;
1641
+ targetBlueprint: string;
1642
+ targetBlueprintId: string;
1643
+ targetSourceKey: string;
1644
+ assetMoves: string;
1645
+ assetKey: string;
1646
+ movedFrom: string;
1647
+ movedTo: string;
1648
+ noAssetMoves: string;
1649
+ rerun: string;
1650
+ rerunTitle: string;
1651
+ rerunMessage: string;
1652
+ rerunConfirm: string;
1653
+ rerunFailed: string;
1654
+ rerunStarted: string;
1655
+ openRerun: string;
1656
+ sourceFileGoneTitle: string;
1657
+ sourceFileGoneBody: string;
1446
1658
  };
1447
1659
  startImport: {
1448
1660
  title: string;
@@ -1473,6 +1685,18 @@ export declare const i18nResources: {
1473
1685
  refused: string;
1474
1686
  notAllowed: string;
1475
1687
  noProfiles: string;
1688
+ on: string;
1689
+ onRelease: string;
1690
+ onDraft: string;
1691
+ profileDraftHelp: string;
1692
+ profileDraftOption: string;
1693
+ startDryRun: string;
1694
+ dryRunRefused: string;
1695
+ dryRunConsent: string;
1696
+ kind: string;
1697
+ kindImport: string;
1698
+ kindDryRun: string;
1699
+ kindCard: string;
1476
1700
  };
1477
1701
  apiKeys: {
1478
1702
  title: string;
@@ -1505,6 +1729,63 @@ export declare const i18nResources: {
1505
1729
  revokeMessage: string;
1506
1730
  revokeFailed: string;
1507
1731
  };
1732
+ dryRun: {
1733
+ badge: string;
1734
+ subtitle: string;
1735
+ failedTitle: string;
1736
+ cancelledBody: string;
1737
+ problemsBody_one: string;
1738
+ problemsBody_other: string;
1739
+ cancel: string;
1740
+ cancelTitle: string;
1741
+ cancelMessage: string;
1742
+ phaseLong: {
1743
+ reading: string;
1744
+ writing: string;
1745
+ };
1746
+ ranOn: string;
1747
+ onReleases: string;
1748
+ onDrafts: string;
1749
+ configuration: string;
1750
+ draftOf: string;
1751
+ correctionsTitle_one: string;
1752
+ correctionsTitle_other: string;
1753
+ correctionsBody: string;
1754
+ showCorrections: string;
1755
+ summary: string;
1756
+ counts: {
1757
+ matched: string;
1758
+ created: string;
1759
+ planned: string;
1760
+ corrected: string;
1761
+ kept: string;
1762
+ stubbed: string;
1763
+ unchanged: string;
1764
+ problems: string;
1765
+ pendingReferences: string;
1766
+ };
1767
+ report: string;
1768
+ actionColumn: string;
1769
+ displayName: string;
1770
+ validity: string;
1771
+ filterAction: string;
1772
+ allActions: string;
1773
+ allMappings: string;
1774
+ emptyReport: string;
1775
+ noMatchingContent: string;
1776
+ validityRange: string;
1777
+ validityOpen: string;
1778
+ action: {
1779
+ created: string;
1780
+ planned: string;
1781
+ corrected: string;
1782
+ kept: string;
1783
+ stubbed: string;
1784
+ unchanged: string;
1785
+ };
1786
+ notDryRun: string;
1787
+ contentCount: string;
1788
+ };
1508
1789
  };
1509
1790
  };
1510
1791
  };
@@ -1548,6 +1829,28 @@ export declare interface Import {
1548
1829
  /** YYYY-MM-DD, or "" for none. */
1549
1830
  effectiveDate: string;
1550
1831
  source?: ImportSource;
1832
+ /**
1833
+ * Whether it is a Dry Run (CONTEXT.md "Dry Run"): it writes nothing and
1834
+ * opens no Change Set, its counts say what a real Import would do, and its
1835
+ * report is `listDryRunContents`'.
1836
+ */
1837
+ dryRun: boolean;
1838
+ /** Whether it runs drafts: a Dry Run started on them. Never for a real Import. */
1839
+ draft: boolean;
1840
+ /**
1841
+ * The Placeholder Assets it found in mediahub outside the folder mirroring
1842
+ * their path and moved there, in the order moved
1843
+ * (link-placeholder-assets-in-mediahub:AC7). `getImport` reads them;
1844
+ * `listImports` leaves them empty, as they grow with the Source File.
1845
+ */
1846
+ assetMoves: AssetMove[];
1847
+ /**
1848
+ * When its Source File was deleted, as an ISO 8601 timestamp, and why, as
1849
+ * importhub words it; both "" while it is kept. Re-run is offered only
1850
+ * while it is kept (re-run-a-source-file).
1851
+ */
1852
+ sourceFileDeleteTime: string;
1853
+ sourceFileDeletionReason: string;
1551
1854
  }
1552
1855
 
1553
1856
  /** What an Import has done (importhub.v1.ImportCounts). */
@@ -1566,6 +1869,10 @@ export declare interface ImportCounts {
1566
1869
  kept: number;
1567
1870
  /** Source Versions already in contenthub. */
1568
1871
  unchanged: number;
1872
+ /** Stubs created for a Stub Mapping's Source Keys no Content had. */
1873
+ stubbed: number;
1874
+ /** References it could not resolve: each one of its Item Problems too. */
1875
+ pendingReferences: number;
1569
1876
  }
1570
1877
 
1571
1878
  /**
@@ -1574,10 +1881,16 @@ export declare interface ImportCounts {
1574
1881
  * who cancelled it (AC6); its details with the link to its Change Set in
1575
1882
  * contenthub, where the host says that is (AC5); its counts; the exact
1576
1883
  * Releases it ran with (release-a-configuration:AC8); and its Item Problems
1577
- * (AC4). An importer cancels a queued or running one from the rail; a viewer
1578
- * sees no Cancel (AC8).
1884
+ * and Pending References (AC4); the assets it moved
1885
+ * (link-placeholder-assets-in-mediahub:AC7). An importer cancels a queued or
1886
+ * running one from the rail, and re-runs an ended one's Source File while it
1887
+ * is kept (re-run-a-source-file:AC1); once it is deleted, the page says so. A
1888
+ * viewer sees neither (AC8).
1889
+ *
1890
+ * A Dry Run's page is its report (`DryRunReport`), so a host that opens an
1891
+ * Import's page from the list opens a Dry Run's report the same way.
1579
1892
  */
1580
- export declare function ImportDetail({ client, id, pollIntervalMs, }: ImportDetailProps): JSX.Element;
1893
+ export declare function ImportDetail({ client, id, pollIntervalMs, onRerun, }: ImportDetailProps): JSX.Element;
1581
1894
 
1582
1895
  export declare interface ImportDetailProps {
1583
1896
  client: ImporthubClient;
@@ -1588,6 +1901,12 @@ export declare interface ImportDetailProps {
1588
1901
  * running, in ms; 2000 by default. It stops once the Import has ended.
1589
1902
  */
1590
1903
  pollIntervalMs?: number;
1904
+ /**
1905
+ * Hears the id of the new Import a Re-run started, for the host to open
1906
+ * its page (re-run-a-source-file:AC1). Without it, the page links to the
1907
+ * new Import itself.
1908
+ */
1909
+ onRerun?: (importId: string) => void;
1591
1910
  }
1592
1911
 
1593
1912
  /** Each section's icon, as the Standalone App's sidebar shows it too. */
@@ -1732,6 +2051,25 @@ export declare interface ImporthubClient {
1732
2051
  /** Asks a queued or running Import to stop; returns it as it is now. */
1733
2052
  cancelImport(id: string): Promise<Import>;
1734
2053
  listItemProblems(importId: string, filter: ItemProblemsFilter): Promise<ItemProblemsPage>;
2054
+ /**
2055
+ * Starts a new Import of the same Source File on the latest Releases, its
2056
+ * other inputs copied (re-run-a-source-file:AC1); a re-run of a Dry Run is
2057
+ * a Dry Run. Throws StartRefusedError, with importhub's reason, as
2058
+ * `startImport` does, and once the Source File is deleted.
2059
+ */
2060
+ rerunImport(id: string): Promise<Import>;
2061
+ /**
2062
+ * Queues a Dry Run: an Import with the same inputs that writes nothing
2063
+ * and opens no Change Set (dry-run-an-import:AC1, AC2). Throws
2064
+ * StartRefusedError, with importhub's reason, as `startImport` does, and
2065
+ * for a draft that is invalid.
2066
+ */
2067
+ startDryRun(input: StartDryRunInput): Promise<Import>;
2068
+ /**
2069
+ * One page of a Dry Run's report: per Source Version, what a real Import
2070
+ * would do with its Content (dry-run-an-import:AC3).
2071
+ */
2072
+ listDryRunContents(importId: string, filter: DryRunContentsFilter): Promise<DryRunContentsPage>;
1735
2073
  /**
1736
2074
  * Every API key of the workspace, every importer's, newest first, without
1737
2075
  * their secrets. Needs importhub's `importer`, as all three key calls do.
@@ -1799,6 +2137,8 @@ export declare const importhubKeys: {
1799
2137
  import: (workspaceId: string, id: string) => readonly ["importhub", string, "imports", string];
1800
2138
  /** An Import's Item Problems under a filter, one entry per filter. */
1801
2139
  itemProblems: (workspaceId: string, id: string, mappingId: string, sourceKeyQuery: string) => readonly ["importhub", string, "imports", string, "itemProblems", string, string];
2140
+ /** A Dry Run's report under a filter, one entry per filter. */
2141
+ dryRunContents: (workspaceId: string, id: string, action: string, mappingId: string, sourceKeyQuery: string) => readonly ["importhub", string, "imports", string, "dryRunContents", string, string, string];
1802
2142
  /** The workspace's importhub API keys. */
1803
2143
  apiKeys: (workspaceId: string) => readonly ["importhub", string, "apiKeys"];
1804
2144
  blueprints: (workspaceId: string) => readonly ["importhub", string, "blueprints"];
@@ -1908,14 +2248,19 @@ export declare interface ImportReleaseRef {
1908
2248
  configurationId: string;
1909
2249
  /** The configuration's name in that Release. */
1910
2250
  name: string;
2251
+ /** "" for a draft a Dry Run runs. */
1911
2252
  releaseId: string;
1912
- /** "Release 3". */
2253
+ /** "Release 3"; 0 for a draft a Dry Run runs. */
1913
2254
  number: number;
2255
+ /** The draft Revision a Dry Run on drafts runs; unset for a Release. */
2256
+ revisionId?: string;
1914
2257
  }
1915
2258
 
1916
2259
  /**
1917
2260
  * The workspace's Imports, newest first, with their Profile, starter,
1918
2261
  * Outcome and counts (follow-an-import:AC1); a queued Import shows as Queued.
2262
+ * A Dry Run is listed with them, marked as one: its counts say what a real
2263
+ * Import would do, and its page is its report.
1919
2264
  * The list follows Imports that are still running. An importer starts one
1920
2265
  * from the header; a viewer sees no Start (follow-an-import:AC8).
1921
2266
  */
@@ -1962,6 +2307,21 @@ export declare interface ItemProblem {
1962
2307
  field: string;
1963
2308
  /** Why, as importhub words it. */
1964
2309
  reason: string;
2310
+ /**
2311
+ * The Content's display name, as its Mapping's display-name template makes
2312
+ * it; "" without one, or when the problem is about no one Content.
2313
+ */
2314
+ displayName: string;
2315
+ /**
2316
+ * Set when it is a reference the Import could not resolve (CONTEXT.md
2317
+ * "Pending Reference"): what it names. Its holder is the Content its
2318
+ * Mapping and Source Key read, and `field` is where it holds it.
2319
+ */
2320
+ pendingReference?: {
2321
+ targetMappingId: string;
2322
+ targetBlueprintId: string;
2323
+ targetSourceKey: string;
2324
+ };
1965
2325
  }
1966
2326
 
1967
2327
  /** How an Import's Item Problems are filtered: by Mapping, and by Source Key. */
@@ -1987,6 +2347,8 @@ export declare interface ItemProblemsPage {
1987
2347
  mappingName: string;
1988
2348
  count: number;
1989
2349
  }[];
2350
+ /** The Item Problems that are Pending References, whatever the filter. */
2351
+ pendingReferenceCount: number;
1990
2352
  /** "" on the last page. */
1991
2353
  nextPageToken: string;
1992
2354
  }
@@ -2232,10 +2594,22 @@ export declare interface SourceFile {
2232
2594
  */
2233
2595
  export declare const STANDALONE_IMPORTHUB_PATHS: ImporthubPaths;
2234
2596
 
2597
+ /** What starting a Dry Run takes: an Import's inputs, and whether to run drafts. */
2598
+ export declare interface StartDryRunInput extends StartImportInput {
2599
+ /**
2600
+ * Run the drafts of the Profile, its Mappings and its Entity Set instead
2601
+ * of their latest Releases (ADR 0016); unset for the Releases.
2602
+ */
2603
+ draft?: boolean;
2604
+ }
2605
+
2235
2606
  /**
2236
- * The start flow (start-an-import:AC1–AC4): an importer picks one of the
2237
- * workspace's Import Profiles that has a Release, since an Import never runs
2238
- * a draft; uploads one XML file straight into importhub's storage, with its
2607
+ * The start flow (start-an-import:AC1–AC4): an importer chooses a real
2608
+ * Import or a Dry Run of one, with the same inputs (dry-run-an-import:AC1);
2609
+ * picks one of the workspace's Import Profiles that has a Release, since an
2610
+ * Import never runs a draft, while an admin may run a Dry Run on the drafts
2611
+ * of any Profile instead, to check them before releasing (ADR 0016);
2612
+ * uploads one XML file straight into importhub's storage, with its
2239
2613
  * progress; gives, if the file carries none, an effective date and a Source
2240
2614
  * (its date and reference, both or neither); reads what delegated access
2241
2615
  * Start grants; and starts with the header's one action. A Start importhub
@@ -2256,7 +2630,10 @@ export declare interface StartImportInput {
2256
2630
 
2257
2631
  export declare interface StartImportProps {
2258
2632
  client: ImporthubClient;
2259
- /** The Import is queued: the host opens its page. */
2633
+ /**
2634
+ * The Import or Dry Run is queued: the host opens its page, where a Dry
2635
+ * Run's page is its report.
2636
+ */
2260
2637
  onStarted: (importId: string) => void;
2261
2638
  }
2262
2639