@knkcs/importhub-ui 0.2.0 → 0.3.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 +3 -2
- package/dist/importhub-client-CrS-3Zuu.js +23 -0
- package/dist/importhub-client-CrS-3Zuu.js.map +1 -0
- package/dist/index.d.ts +257 -2
- package/dist/index.js +1473 -781
- package/dist/index.js.map +1 -1
- package/dist/testing.d.ts +74 -0
- package/dist/testing.js +289 -178
- package/dist/testing.js.map +1 -1
- package/package.json +1 -1
- package/dist/importhub-client-CYqd7Eeq.js +0 -16
- package/dist/importhub-client-CYqd7Eeq.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.3.0](https://github.com/knkCS/importhub/compare/importhub-ui-v0.2.0...importhub-ui-v0.3.0) (2026-12-04)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **ui:** release state, Cut Release and history of configuration (F3) ([#96](https://github.com/knkCS/importhub/issues/96)) ([babf756](https://github.com/knkCS/importhub/commit/babf7563edade0a91c7cc199072d1e7b16f6442c))
|
|
9
|
+
|
|
3
10
|
## [0.2.0](https://github.com/knkCS/importhub/compare/importhub-ui-v0.1.0...importhub-ui-v0.2.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) and a start page for Imports. The screens for Imports, the start flow, the Dry Run report, the Mapping editor and Mapping Test
|
|
7
|
+
So far it holds the configuration screens (Import Profiles, Mappings, Entity Sets and the Processor catalogue) with their release and history, and a start page for Imports. The screens for Imports, the start flow, the Dry Run report, and the Mapping editor and Mapping Test follow.
|
|
8
8
|
|
|
9
9
|
## Install
|
|
10
10
|
|
|
@@ -66,10 +66,11 @@ An Import fills one contenthub Change Set, and its page links out to it (`Change
|
|
|
66
66
|
- `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.
|
|
67
67
|
- `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.
|
|
68
68
|
- `EntitySetsIndex({ client, onOpen })` and `EntitySetDetail({ client, id, onDeleted })`: the Entity Sets and their tables of entities.
|
|
69
|
+
- `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.
|
|
69
70
|
- `ProcessorCatalogue({ client })`: every Processor with its kind, description and settings.
|
|
70
71
|
- `ImporthubStartPage({ client, section })`: a section's start page, for a section with no screen yet (Imports).
|
|
71
72
|
|
|
72
|
-
Every configuration screen shows why a configuration is invalid, saves with the header's one Save and deletes from the rail (anker ADR 0004)
|
|
73
|
+
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.
|
|
73
74
|
|
|
74
75
|
### Translations
|
|
75
76
|
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
class o extends Error {
|
|
2
|
+
importProfiles;
|
|
3
|
+
constructor(r, e = "in use by Import Profiles") {
|
|
4
|
+
super(e), this.name = "ConfigurationInUseError", this.importProfiles = r;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
class t extends Error {
|
|
8
|
+
validity;
|
|
9
|
+
constructor(r, e) {
|
|
10
|
+
super(r), this.name = "ReleaseRefusedError", this.validity = e;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
class a extends Error {
|
|
14
|
+
constructor(r = "the name is taken") {
|
|
15
|
+
super(r), this.name = "NameTakenError";
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
o as C,
|
|
20
|
+
a as N,
|
|
21
|
+
t as R
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=importhub-client-CrS-3Zuu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"importhub-client-CrS-3Zuu.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\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). The screens here edit only the\n * fields they name; every other setting (field mappings, Version Match,\n * Title Contributions, …) is the structured editor's (F4), and travels\n * through as given, so a save here never drops it.\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\t[key: string]: unknown;\n\t};\n\t/** Each an xmlmapper FieldMapping; `name` is the field path. */\n\tfields?: Array<Record<string, unknown>>;\n\t[key: string]: unknown;\n}\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/**\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"],"names":["ConfigurationInUseError","importProfiles","message","ReleaseRefusedError","validity","NameTakenError"],"mappings":"AA4JO,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;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -24,6 +24,51 @@ export declare interface ChangeSetLinkProps {
|
|
|
24
24
|
changeSetId: string;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
/** Two Revisions of one configuration, and how each top-level field differs. */
|
|
28
|
+
export declare interface ConfigurationComparison {
|
|
29
|
+
from: ConfigurationVersion;
|
|
30
|
+
to: ConfigurationVersion;
|
|
31
|
+
fields: {
|
|
32
|
+
field: string;
|
|
33
|
+
status: FieldComparisonStatus;
|
|
34
|
+
}[];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* A configuration's history (release-a-configuration:AC6, AC7): every
|
|
39
|
+
* Revision, newest first, with who saved it and when, the Releases cut from
|
|
40
|
+
* it with who cut them and when, and whether it was valid. Choosing two
|
|
41
|
+
* compares them side by side; an admin restores an older one as a new draft.
|
|
42
|
+
* A panel, not a page: the configuration's page renders it as its History
|
|
43
|
+
* tab, and a host may place it elsewhere. The table reaches both edges, as
|
|
44
|
+
* anker's flush tab bodies do.
|
|
45
|
+
*/
|
|
46
|
+
export declare function ConfigurationHistory({ client, kind, id, draftRevisionId, onRestored, }: ConfigurationHistoryProps): JSX.Element;
|
|
47
|
+
|
|
48
|
+
/** One page of a configuration's history. */
|
|
49
|
+
export declare interface ConfigurationHistoryPage {
|
|
50
|
+
/** This page's Revisions, newest first. */
|
|
51
|
+
revisions: ConfigurationRevision[];
|
|
52
|
+
/** Every Release, newest first, on every page. */
|
|
53
|
+
releases: ConfigurationReleaseRecord[];
|
|
54
|
+
/** The token of the next page; "" on the last. */
|
|
55
|
+
nextPageToken: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export declare interface ConfigurationHistoryProps {
|
|
59
|
+
client: ImporthubClient;
|
|
60
|
+
kind: ConfigurationKind;
|
|
61
|
+
/** The Import Profile's, Mapping's or Entity Set's id. */
|
|
62
|
+
id: string;
|
|
63
|
+
/** The draft as the page last read it: a restore builds on it. */
|
|
64
|
+
draftRevisionId: string;
|
|
65
|
+
/**
|
|
66
|
+
* A restore saved a new draft: the page reads it again, and drops edits
|
|
67
|
+
* it holds on the old one.
|
|
68
|
+
*/
|
|
69
|
+
onRestored?: () => void | Promise<void>;
|
|
70
|
+
}
|
|
71
|
+
|
|
27
72
|
/**
|
|
28
73
|
* A delete importhub refused because Import Profiles still include the
|
|
29
74
|
* Mapping, or name the Entity Set (manage-mappings:AC4,
|
|
@@ -34,12 +79,38 @@ export declare class ConfigurationInUseError extends Error {
|
|
|
34
79
|
constructor(importProfiles: ImportProfileRef[], message?: string);
|
|
35
80
|
}
|
|
36
81
|
|
|
82
|
+
/** The kinds of versioned configuration (ADR 0016). */
|
|
83
|
+
export declare type ConfigurationKind = "importProfile" | "mapping" | "entitySet";
|
|
84
|
+
|
|
37
85
|
/** A Configuration Release, as a list names it: "Release 3". */
|
|
38
86
|
export declare interface ConfigurationRelease {
|
|
39
87
|
id: string;
|
|
40
88
|
number: number;
|
|
41
89
|
}
|
|
42
90
|
|
|
91
|
+
/** A Configuration Release as the history lists it: who cut it, when, from what. */
|
|
92
|
+
export declare interface ConfigurationReleaseRecord extends ConfigurationRelease {
|
|
93
|
+
/** The Revision it pins. */
|
|
94
|
+
revisionId: string;
|
|
95
|
+
/** The odon user id of the admin who cut it. */
|
|
96
|
+
releasedBy: string;
|
|
97
|
+
/** When it was cut, as an ISO 8601 timestamp. */
|
|
98
|
+
releasedAt: string;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** One saved Revision of a configuration, as its history lists it. */
|
|
102
|
+
export declare interface ConfigurationRevision {
|
|
103
|
+
id: string;
|
|
104
|
+
/** The odon user id of who saved it; the host's members name them. */
|
|
105
|
+
savedBy: string;
|
|
106
|
+
/** When it was saved, as an ISO 8601 timestamp. */
|
|
107
|
+
savedAt: string;
|
|
108
|
+
/** Whether it could be released, as decided when it was saved. */
|
|
109
|
+
validity: Validity;
|
|
110
|
+
/** The Revision it restored; "" for an ordinary save. */
|
|
111
|
+
restoredFromRevisionId: string;
|
|
112
|
+
}
|
|
113
|
+
|
|
43
114
|
/** Where a configuration stands: its draft and its latest Release. */
|
|
44
115
|
export declare interface ConfigurationState {
|
|
45
116
|
draftRevisionId: string;
|
|
@@ -49,6 +120,15 @@ export declare interface ConfigurationState {
|
|
|
49
120
|
draftDiffersFromRelease: boolean;
|
|
50
121
|
}
|
|
51
122
|
|
|
123
|
+
/**
|
|
124
|
+
* One side of a comparison: a Revision's content, keyed as importhub keys
|
|
125
|
+
* the compared fields (the proto's field names, such as `mapping_ids`).
|
|
126
|
+
*/
|
|
127
|
+
export declare interface ConfigurationVersion {
|
|
128
|
+
revisionId: string;
|
|
129
|
+
content: Record<string, unknown>;
|
|
130
|
+
}
|
|
131
|
+
|
|
52
132
|
/** One configuration of a kind, at its draft. */
|
|
53
133
|
declare interface Configured<C> {
|
|
54
134
|
id: string;
|
|
@@ -86,6 +166,13 @@ export declare interface CreateConnectImporthubClientOptions {
|
|
|
86
166
|
transport?: Transport;
|
|
87
167
|
}
|
|
88
168
|
|
|
169
|
+
/** A Release cut, and for a Mapping the Import Profiles that take it. */
|
|
170
|
+
export declare interface CutReleaseResult {
|
|
171
|
+
release: ConfigurationReleaseRecord;
|
|
172
|
+
/** The Profiles that include the Mapping; empty for other kinds. */
|
|
173
|
+
importProfiles: ImportProfileRef[];
|
|
174
|
+
}
|
|
175
|
+
|
|
89
176
|
export declare type EntitySet = Configured<EntitySetContent>;
|
|
90
177
|
|
|
91
178
|
/** What an admin edits of an Entity Set. */
|
|
@@ -100,7 +187,10 @@ export declare interface EntitySetContent {
|
|
|
100
187
|
* One Entity Set (manage-entity-sets:AC1): its name and its table of
|
|
101
188
|
* entities, each with the text it stands for. An admin edits the table and
|
|
102
189
|
* saves with the header's Save, and deletes from the rail, which importhub
|
|
103
|
-
* refuses while a Profile names it, naming them (AC3).
|
|
190
|
+
* refuses while a Profile names it, naming them (AC3). It shows whether its
|
|
191
|
+
* draft differs from its latest Release, an admin cuts a Release from the
|
|
192
|
+
* rail, and its History tab lists, compares and restores its Revisions
|
|
193
|
+
* (release-a-configuration).
|
|
104
194
|
*/
|
|
105
195
|
export declare function EntitySetDetail({ client, id, onDeleted }: EntitySetDetailProps): JSX.Element;
|
|
106
196
|
|
|
@@ -124,6 +214,8 @@ export declare interface EntitySetsIndexProps {
|
|
|
124
214
|
onOpen: (id: string) => void;
|
|
125
215
|
}
|
|
126
216
|
|
|
217
|
+
export declare type FieldComparisonStatus = "unchanged" | "added" | "removed" | "changed";
|
|
218
|
+
|
|
127
219
|
/** The package's bundled translations, keyed by language, then by namespace. */
|
|
128
220
|
export declare const i18nResources: {
|
|
129
221
|
en: {
|
|
@@ -185,6 +277,11 @@ export declare const i18nResources: {
|
|
|
185
277
|
column: string;
|
|
186
278
|
number: string;
|
|
187
279
|
none: string;
|
|
280
|
+
state: {
|
|
281
|
+
none: string;
|
|
282
|
+
differs: string;
|
|
283
|
+
current: string;
|
|
284
|
+
};
|
|
188
285
|
};
|
|
189
286
|
delete: {
|
|
190
287
|
inUse: string;
|
|
@@ -305,6 +402,67 @@ export declare const i18nResources: {
|
|
|
305
402
|
deleteTitle: string;
|
|
306
403
|
deleteMessage: string;
|
|
307
404
|
};
|
|
405
|
+
tabs: {
|
|
406
|
+
settings: string;
|
|
407
|
+
history: string;
|
|
408
|
+
};
|
|
409
|
+
cut: {
|
|
410
|
+
action: string;
|
|
411
|
+
title: string;
|
|
412
|
+
confirm: string;
|
|
413
|
+
message: string;
|
|
414
|
+
unchanged: string;
|
|
415
|
+
unsaved: string;
|
|
416
|
+
profilesIntro: string;
|
|
417
|
+
profiles: string;
|
|
418
|
+
noProfiles: string;
|
|
419
|
+
refused: string;
|
|
420
|
+
failed: string;
|
|
421
|
+
done: string;
|
|
422
|
+
doneBody: string;
|
|
423
|
+
};
|
|
424
|
+
history: {
|
|
425
|
+
hint: string;
|
|
426
|
+
none: string;
|
|
427
|
+
loadMore: string;
|
|
428
|
+
columns: {
|
|
429
|
+
revision: string;
|
|
430
|
+
release: string;
|
|
431
|
+
savedBy: string;
|
|
432
|
+
savedAt: string;
|
|
433
|
+
};
|
|
434
|
+
draft: string;
|
|
435
|
+
revision: string;
|
|
436
|
+
revisionOf: string;
|
|
437
|
+
restoredFrom: string;
|
|
438
|
+
cutBy: string;
|
|
439
|
+
unknownPerson: string;
|
|
440
|
+
restore: string;
|
|
441
|
+
restoreTitle: string;
|
|
442
|
+
restoreConfirm: string;
|
|
443
|
+
restoreMessage: string;
|
|
444
|
+
restoreFailed: string;
|
|
445
|
+
olderRelease: string;
|
|
446
|
+
earlierRevision: string;
|
|
447
|
+
};
|
|
448
|
+
compare: {
|
|
449
|
+
title: string;
|
|
450
|
+
between: string;
|
|
451
|
+
field: string;
|
|
452
|
+
same: string;
|
|
453
|
+
differing_one: string;
|
|
454
|
+
differing_other: string;
|
|
455
|
+
status: {
|
|
456
|
+
unchanged: string;
|
|
457
|
+
added: string;
|
|
458
|
+
removed: string;
|
|
459
|
+
changed: string;
|
|
460
|
+
};
|
|
461
|
+
absent: string;
|
|
462
|
+
missingEntitySet: string;
|
|
463
|
+
yes: string;
|
|
464
|
+
no: string;
|
|
465
|
+
};
|
|
308
466
|
};
|
|
309
467
|
};
|
|
310
468
|
de: {
|
|
@@ -366,6 +524,11 @@ export declare const i18nResources: {
|
|
|
366
524
|
column: string;
|
|
367
525
|
number: string;
|
|
368
526
|
none: string;
|
|
527
|
+
state: {
|
|
528
|
+
none: string;
|
|
529
|
+
differs: string;
|
|
530
|
+
current: string;
|
|
531
|
+
};
|
|
369
532
|
};
|
|
370
533
|
delete: {
|
|
371
534
|
inUse: string;
|
|
@@ -486,6 +649,67 @@ export declare const i18nResources: {
|
|
|
486
649
|
deleteTitle: string;
|
|
487
650
|
deleteMessage: string;
|
|
488
651
|
};
|
|
652
|
+
tabs: {
|
|
653
|
+
settings: string;
|
|
654
|
+
history: string;
|
|
655
|
+
};
|
|
656
|
+
cut: {
|
|
657
|
+
action: string;
|
|
658
|
+
title: string;
|
|
659
|
+
confirm: string;
|
|
660
|
+
message: string;
|
|
661
|
+
unchanged: string;
|
|
662
|
+
unsaved: string;
|
|
663
|
+
profilesIntro: string;
|
|
664
|
+
profiles: string;
|
|
665
|
+
noProfiles: string;
|
|
666
|
+
refused: string;
|
|
667
|
+
failed: string;
|
|
668
|
+
done: string;
|
|
669
|
+
doneBody: string;
|
|
670
|
+
};
|
|
671
|
+
history: {
|
|
672
|
+
hint: string;
|
|
673
|
+
none: string;
|
|
674
|
+
loadMore: string;
|
|
675
|
+
columns: {
|
|
676
|
+
revision: string;
|
|
677
|
+
release: string;
|
|
678
|
+
savedBy: string;
|
|
679
|
+
savedAt: string;
|
|
680
|
+
};
|
|
681
|
+
draft: string;
|
|
682
|
+
revision: string;
|
|
683
|
+
revisionOf: string;
|
|
684
|
+
restoredFrom: string;
|
|
685
|
+
cutBy: string;
|
|
686
|
+
unknownPerson: string;
|
|
687
|
+
restore: string;
|
|
688
|
+
restoreTitle: string;
|
|
689
|
+
restoreConfirm: string;
|
|
690
|
+
restoreMessage: string;
|
|
691
|
+
restoreFailed: string;
|
|
692
|
+
olderRelease: string;
|
|
693
|
+
earlierRevision: string;
|
|
694
|
+
};
|
|
695
|
+
compare: {
|
|
696
|
+
title: string;
|
|
697
|
+
between: string;
|
|
698
|
+
field: string;
|
|
699
|
+
same: string;
|
|
700
|
+
differing_one: string;
|
|
701
|
+
differing_other: string;
|
|
702
|
+
status: {
|
|
703
|
+
unchanged: string;
|
|
704
|
+
added: string;
|
|
705
|
+
removed: string;
|
|
706
|
+
changed: string;
|
|
707
|
+
};
|
|
708
|
+
absent: string;
|
|
709
|
+
missingEntitySet: string;
|
|
710
|
+
yes: string;
|
|
711
|
+
no: string;
|
|
712
|
+
};
|
|
489
713
|
};
|
|
490
714
|
};
|
|
491
715
|
};
|
|
@@ -564,6 +788,16 @@ export declare interface ImporthubClient {
|
|
|
564
788
|
updateEntitySet(id: string, content: EntitySetContent, draftRevisionId: string): Promise<EntitySet>;
|
|
565
789
|
/** Throws ConfigurationInUseError while a Profile names it. */
|
|
566
790
|
deleteEntitySet(id: string): Promise<void>;
|
|
791
|
+
/**
|
|
792
|
+
* Cuts a Configuration Release from the draft named. Throws
|
|
793
|
+
* ReleaseRefusedError, with the reasons when the draft is invalid.
|
|
794
|
+
*/
|
|
795
|
+
cutRelease(kind: ConfigurationKind, id: string, draftRevisionId: string): Promise<CutReleaseResult>;
|
|
796
|
+
/** One page of the history; pageToken "" for the first. */
|
|
797
|
+
listHistory(kind: ConfigurationKind, id: string, pageToken: string): Promise<ConfigurationHistoryPage>;
|
|
798
|
+
compareRevisions(kind: ConfigurationKind, id: string, fromRevisionId: string, toRevisionId: string): Promise<ConfigurationComparison>;
|
|
799
|
+
/** Saves an older Revision's content as a new draft, on the draft named. */
|
|
800
|
+
restoreRevision(kind: ConfigurationKind, id: string, revisionId: string, draftRevisionId: string): Promise<void>;
|
|
567
801
|
}
|
|
568
802
|
|
|
569
803
|
export declare interface ImporthubHost {
|
|
@@ -607,6 +841,12 @@ export declare const importhubKeys: {
|
|
|
607
841
|
entitySet: (workspaceId: string, id: string) => readonly ["importhub", string, "entitySets", string];
|
|
608
842
|
blueprints: (workspaceId: string) => readonly ["importhub", string, "blueprints"];
|
|
609
843
|
blueprintReleases: (workspaceId: string, blueprintId: string) => readonly ["importhub", string, "blueprints", string, "releases"];
|
|
844
|
+
/** One configuration of a kind, as its page reads it. */
|
|
845
|
+
configuration: (workspaceId: string, kind: ConfigurationKind, id: string) => readonly ["importhub", string, "importProfiles", string] | readonly ["importhub", string, "mappings", string] | readonly ["importhub", string, "entitySets", string];
|
|
846
|
+
/** Every list of a kind, so one change refreshes them all. */
|
|
847
|
+
configurations: (workspaceId: string, kind: ConfigurationKind) => readonly ["importhub", string, "importProfiles"] | readonly ["importhub", string, "mappings"] | readonly ["importhub", string, "entitySets"];
|
|
848
|
+
history: (workspaceId: string, kind: ConfigurationKind, id: string) => readonly ["importhub", string, "importProfiles", string, "history"] | readonly ["importhub", string, "mappings", string, "history"] | readonly ["importhub", string, "entitySets", string, "history"];
|
|
849
|
+
comparison: (workspaceId: string, kind: ConfigurationKind, id: string, fromRevisionId: string, toRevisionId: string) => readonly ["importhub", string, "importProfiles", string, "comparison", string, string] | readonly ["importhub", string, "mappings", string, "comparison", string, string] | readonly ["importhub", string, "entitySets", string, "comparison", string, string];
|
|
610
850
|
};
|
|
611
851
|
|
|
612
852
|
/**
|
|
@@ -726,7 +966,11 @@ export declare interface MappingContent {
|
|
|
726
966
|
* Source Key, the Blueprint Release it pins with the move to another one
|
|
727
967
|
* (AC5), the Import Profiles that include it (AC3), and why it is invalid.
|
|
728
968
|
* An admin saves with the header's Save and deletes from the rail, which
|
|
729
|
-
* importhub refuses while a Profile includes it, naming them (AC4).
|
|
969
|
+
* importhub refuses while a Profile includes it, naming them (AC4). It
|
|
970
|
+
* shows whether its draft differs from its latest Release; an admin cuts a
|
|
971
|
+
* Release from the rail, seeing the Profiles that take it first, and its
|
|
972
|
+
* History tab lists, compares and restores its Revisions
|
|
973
|
+
* (release-a-configuration).
|
|
730
974
|
*/
|
|
731
975
|
export declare function MappingDetail({ client, id, onDeleted }: MappingDetailProps): JSX.Element;
|
|
732
976
|
|
|
@@ -792,6 +1036,17 @@ export declare interface ProcessorStep {
|
|
|
792
1036
|
|
|
793
1037
|
export declare type ProcessorTarget = "source_file" | "rich_text_field";
|
|
794
1038
|
|
|
1039
|
+
/**
|
|
1040
|
+
* A cut importhub refused (release-a-configuration:AC3): the draft is
|
|
1041
|
+
* invalid now, it does not differ from the latest Release, or somebody saved
|
|
1042
|
+
* in between. Carries the draft's validity when that was the reason, so the
|
|
1043
|
+
* screen lists why.
|
|
1044
|
+
*/
|
|
1045
|
+
export declare class ReleaseRefusedError extends Error {
|
|
1046
|
+
readonly validity?: Validity;
|
|
1047
|
+
constructor(message: string, validity?: Validity);
|
|
1048
|
+
}
|
|
1049
|
+
|
|
795
1050
|
/**
|
|
796
1051
|
* The Standalone App's paths: Imports at the top, the configuration under
|
|
797
1052
|
* `/settings/<item>`, one page per item (odon's integration guide, "Sidebar
|