@knkcs/importhub-ui 0.6.0 → 0.8.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.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../gen/ts/importhub/v1/api_key_pb.ts","../../../gen/ts/importhub/v1/configuration_pb.ts","../../../gen/ts/importhub/v1/entity_set_pb.ts","../../../gen/ts/importhub/v1/import_pb.ts","../../../gen/ts/importhub/v1/import_profile_pb.ts","../../../gen/ts/importhub/v1/mapping_pb.ts","../../../gen/ts/importhub/v1/processor_pb.ts","../src/client/connect-importhub-client.ts","../src/common/change-set-link.tsx","../src/common/start-page.tsx","../src/common/import-status.tsx","../src/common/use-can-import.ts","../src/screens/api-keys/create-api-key-dialog.tsx","../src/screens/api-keys/revoke-api-key-dialog.tsx","../src/screens/api-keys/api-keys-index.tsx","../src/screens/entity-sets/entity-set-detail.tsx","../src/common/create-dialog.tsx","../src/screens/entity-sets/entity-sets-index.tsx","../src/screens/imports/item-problems-table.tsx","../src/screens/imports/import-detail.tsx","../src/screens/imports/imports-index.tsx","../src/screens/mappings/mapping-detail.tsx","../src/screens/mappings/blueprint-fields.tsx","../src/screens/mappings/mappings-index.tsx","../src/screens/processors/processor-catalogue.tsx","../src/screens/profiles/ordered-list.tsx","../src/screens/profiles/processor-settings-dialog.tsx","../src/screens/profiles/import-profile-detail.tsx","../src/screens/profiles/import-profiles-index.tsx","../src/screens/start-import/start-import.tsx"],"sourcesContent":["// @generated by protoc-gen-es v2.13.0 with parameter \"target=ts\"\n// @generated from file importhub/v1/api_key.proto (package importhub.v1, syntax proto3)\n/* eslint-disable */\n\nimport type { GenFile, GenMessage, GenService } from \"@bufbuild/protobuf/codegenv2\";\nimport { fileDesc, messageDesc, serviceDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport type { Timestamp } from \"@bufbuild/protobuf/wkt\";\nimport { file_google_protobuf_timestamp } from \"@bufbuild/protobuf/wkt\";\nimport type { Message } from \"@bufbuild/protobuf\";\n\n/**\n * Describes the file importhub/v1/api_key.proto.\n */\nexport const file_importhub_v1_api_key: GenFile = /*@__PURE__*/\n fileDesc(\"ChppbXBvcnRodWIvdjEvYXBpX2tleS5wcm90bxIMaW1wb3J0aHViLnYxIlQKE0NyZWF0ZUFQSUtleVJlcXVlc3QSDAoEbmFtZRgBIAEoCRIvCgtleHBpcmVfdGltZRgCIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXAiTQoUQ3JlYXRlQVBJS2V5UmVzcG9uc2USJQoHYXBpX2tleRgBIAEoCzIULmltcG9ydGh1Yi52MS5BUElLZXkSDgoGc2VjcmV0GAIgASgJIhQKEkxpc3RBUElLZXlzUmVxdWVzdCI9ChNMaXN0QVBJS2V5c1Jlc3BvbnNlEiYKCGFwaV9rZXlzGAEgAygLMhQuaW1wb3J0aHViLnYxLkFQSUtleSIhChNSZXZva2VBUElLZXlSZXF1ZXN0EgoKAmlkGAEgASgJIhYKFFJldm9rZUFQSUtleVJlc3BvbnNlIqcBCgZBUElLZXkSCgoCaWQYASABKAkSDAoEbmFtZRgCIAEoCRISCgprZXlfcHJlZml4GAMgASgJEg0KBW93bmVyGAQgASgJEi8KC2V4cGlyZV90aW1lGAUgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcBIvCgtjcmVhdGVfdGltZRgGIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXAykQIKDUFQSUtleVNlcnZpY2USVQoMQ3JlYXRlQVBJS2V5EiEuaW1wb3J0aHViLnYxLkNyZWF0ZUFQSUtleVJlcXVlc3QaIi5pbXBvcnRodWIudjEuQ3JlYXRlQVBJS2V5UmVzcG9uc2USUgoLTGlzdEFQSUtleXMSIC5pbXBvcnRodWIudjEuTGlzdEFQSUtleXNSZXF1ZXN0GiEuaW1wb3J0aHViLnYxLkxpc3RBUElLZXlzUmVzcG9uc2USVQoMUmV2b2tlQVBJS2V5EiEuaW1wb3J0aHViLnYxLlJldm9rZUFQSUtleVJlcXVlc3QaIi5pbXBvcnRodWIudjEuUmV2b2tlQVBJS2V5UmVzcG9uc2VCOVo3Z2l0aHViLmNvbS9rbmtjcy9pbXBvcnRodWIvZ2VuL2ltcG9ydGh1Yi92MTtpbXBvcnRodWJ2MWIGcHJvdG8z\", [file_google_protobuf_timestamp]);\n\n/**\n * @generated from message importhub.v1.CreateAPIKeyRequest\n */\nexport type CreateAPIKeyRequest = Message<\"importhub.v1.CreateAPIKeyRequest\"> & {\n /**\n * What the key is for, as people read it (\"Nightly gesetz feed\"): not\n * blank, at most 100 characters.\n *\n * @generated from field: string name = 1;\n */\n name: string;\n\n /**\n * When the key stops working; unset for never. Its Delegation Grant ends\n * with it. It must lie in the future.\n *\n * @generated from field: google.protobuf.Timestamp expire_time = 2;\n */\n expireTime?: Timestamp | undefined;\n};\n\n/**\n * Describes the message importhub.v1.CreateAPIKeyRequest.\n * Use `create(CreateAPIKeyRequestSchema)` to create a new message.\n */\nexport const CreateAPIKeyRequestSchema: GenMessage<CreateAPIKeyRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_api_key, 0);\n\n/**\n * @generated from message importhub.v1.CreateAPIKeyResponse\n */\nexport type CreateAPIKeyResponse = Message<\"importhub.v1.CreateAPIKeyResponse\"> & {\n /**\n * @generated from field: importhub.v1.APIKey api_key = 1;\n */\n apiKey?: APIKey | undefined;\n\n /**\n * The key's secret, to send as `Authorization: Bearer <secret>`. Shown\n * this once: keep it now.\n *\n * @generated from field: string secret = 2;\n */\n secret: string;\n};\n\n/**\n * Describes the message importhub.v1.CreateAPIKeyResponse.\n * Use `create(CreateAPIKeyResponseSchema)` to create a new message.\n */\nexport const CreateAPIKeyResponseSchema: GenMessage<CreateAPIKeyResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_api_key, 1);\n\n/**\n * @generated from message importhub.v1.ListAPIKeysRequest\n */\nexport type ListAPIKeysRequest = Message<\"importhub.v1.ListAPIKeysRequest\"> & {\n};\n\n/**\n * Describes the message importhub.v1.ListAPIKeysRequest.\n * Use `create(ListAPIKeysRequestSchema)` to create a new message.\n */\nexport const ListAPIKeysRequestSchema: GenMessage<ListAPIKeysRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_api_key, 2);\n\n/**\n * @generated from message importhub.v1.ListAPIKeysResponse\n */\nexport type ListAPIKeysResponse = Message<\"importhub.v1.ListAPIKeysResponse\"> & {\n /**\n * @generated from field: repeated importhub.v1.APIKey api_keys = 1;\n */\n apiKeys: APIKey[];\n};\n\n/**\n * Describes the message importhub.v1.ListAPIKeysResponse.\n * Use `create(ListAPIKeysResponseSchema)` to create a new message.\n */\nexport const ListAPIKeysResponseSchema: GenMessage<ListAPIKeysResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_api_key, 3);\n\n/**\n * @generated from message importhub.v1.RevokeAPIKeyRequest\n */\nexport type RevokeAPIKeyRequest = Message<\"importhub.v1.RevokeAPIKeyRequest\"> & {\n /**\n * The key's id, as APIKey.id gives it.\n *\n * @generated from field: string id = 1;\n */\n id: string;\n};\n\n/**\n * Describes the message importhub.v1.RevokeAPIKeyRequest.\n * Use `create(RevokeAPIKeyRequestSchema)` to create a new message.\n */\nexport const RevokeAPIKeyRequestSchema: GenMessage<RevokeAPIKeyRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_api_key, 4);\n\n/**\n * @generated from message importhub.v1.RevokeAPIKeyResponse\n */\nexport type RevokeAPIKeyResponse = Message<\"importhub.v1.RevokeAPIKeyResponse\"> & {\n};\n\n/**\n * Describes the message importhub.v1.RevokeAPIKeyResponse.\n * Use `create(RevokeAPIKeyResponseSchema)` to create a new message.\n */\nexport const RevokeAPIKeyResponseSchema: GenMessage<RevokeAPIKeyResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_api_key, 5);\n\n/**\n * APIKey is an importhub API key of the workspace, never its secret.\n *\n * @generated from message importhub.v1.APIKey\n */\nexport type APIKey = Message<\"importhub.v1.APIKey\"> & {\n /**\n * odon's id of the key.\n *\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * @generated from field: string name = 2;\n */\n name: string;\n\n /**\n * The secret's first characters, as odon shows them, for telling keys\n * apart.\n *\n * @generated from field: string key_prefix = 3;\n */\n keyPrefix: string;\n\n /**\n * The odon user id of the key's owner, who created it: the key acts as\n * them, and Imports started with it name them as their starter.\n *\n * @generated from field: string owner = 4;\n */\n owner: string;\n\n /**\n * When it stops working; unset for never.\n *\n * @generated from field: google.protobuf.Timestamp expire_time = 5;\n */\n expireTime?: Timestamp | undefined;\n\n /**\n * @generated from field: google.protobuf.Timestamp create_time = 6;\n */\n createTime?: Timestamp | undefined;\n};\n\n/**\n * Describes the message importhub.v1.APIKey.\n * Use `create(APIKeySchema)` to create a new message.\n */\nexport const APIKeySchema: GenMessage<APIKey> = /*@__PURE__*/\n messageDesc(file_importhub_v1_api_key, 6);\n\n/**\n * APIKeyService creates, lists and revokes the workspace's importhub API keys:\n * odon API keys with scope `importhub:workspace:<W>`, with which an unattended\n * caller (a nightly feed, a pipeline) starts and follows Imports as the key's\n * owner (ADR 0006, amended; import-with-an-api-key).\n *\n * importhub creates each key itself, from the person's own token: the key in\n * odon, and a standing Delegation Grant `apikey:<key id>` that ends with the\n * key, on which every Import started with the key runs. A key created directly\n * in odon has no such Grant and is refused, naming that keys are created\n * through importhub.\n *\n * Every RPC acts on the caller's workspace, which comes from the token's active\n * workspace and never from a request field, and needs `importer` (ADR 0010).\n * Each needs a person's own sign-in: a call made with an API key cannot create,\n * list or revoke keys.\n *\n * @generated from service importhub.v1.APIKeyService\n */\nexport const APIKeyService: GenService<{\n /**\n * CreateAPIKey creates an API key for the caller in their workspace and\n * returns its secret, once: importhub never stores it, and no later call\n * returns it again (import-with-an-api-key:AC5).\n *\n * @generated from rpc importhub.v1.APIKeyService.CreateAPIKey\n */\n createAPIKey: {\n methodKind: \"unary\";\n input: typeof CreateAPIKeyRequestSchema;\n output: typeof CreateAPIKeyResponseSchema;\n },\n /**\n * ListAPIKeys returns the workspace's API keys, every importer's, newest\n * first, without their secrets.\n *\n * @generated from rpc importhub.v1.APIKeyService.ListAPIKeys\n */\n listAPIKeys: {\n methodKind: \"unary\";\n input: typeof ListAPIKeysRequestSchema;\n output: typeof ListAPIKeysResponseSchema;\n },\n /**\n * RevokeAPIKey revokes an API key of the workspace: in odon, and by\n * releasing its Delegation Grant, so the key stops working at once and an\n * Import running with it ends Failed naming the revocation\n * (import-with-an-api-key:AC4, AC7). An unknown key is NotFound.\n *\n * @generated from rpc importhub.v1.APIKeyService.RevokeAPIKey\n */\n revokeAPIKey: {\n methodKind: \"unary\";\n input: typeof RevokeAPIKeyRequestSchema;\n output: typeof RevokeAPIKeyResponseSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_importhub_v1_api_key, 0);\n\n","// @generated by protoc-gen-es v2.13.0 with parameter \"target=ts\"\n// @generated from file importhub/v1/configuration.proto (package importhub.v1, syntax proto3)\n/* eslint-disable */\n\nimport type { GenEnum, GenFile, GenMessage } from \"@bufbuild/protobuf/codegenv2\";\nimport { enumDesc, fileDesc, messageDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport type { Timestamp } from \"@bufbuild/protobuf/wkt\";\nimport { file_google_protobuf_timestamp } from \"@bufbuild/protobuf/wkt\";\nimport type { Message } from \"@bufbuild/protobuf\";\n\n/**\n * Describes the file importhub/v1/configuration.proto.\n */\nexport const file_importhub_v1_configuration: GenFile = /*@__PURE__*/\n fileDesc(\"CiBpbXBvcnRodWIvdjEvY29uZmlndXJhdGlvbi5wcm90bxIMaW1wb3J0aHViLnYxIkgKCFZhbGlkaXR5Eg0KBXZhbGlkGAEgASgIEi0KB3JlYXNvbnMYAiADKAsyHC5pbXBvcnRodWIudjEuVmFsaWRpdHlSZWFzb24iPQoOVmFsaWRpdHlSZWFzb24SDAoEcGF0aBgBIAEoCRIMCgRjb2RlGAIgASgJEg8KB21lc3NhZ2UYAyABKAkis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RUxEX0NPTVBBUklTT05fU1RBVFVTX1VOQ0hBTkdFRBABEiEKHUZJRUxEX0NPTVBBUklTT05fU1RBVFVTX0FEREVEEAISIwofRklFTERfQ09NUEFSSVNPTl9TVEFUVVNfUkVNT1ZFRBADEiMKH0ZJRUxEX0NPTVBBUklTT05fU1RBVFVTX0NIQU5HRUQQBEI5WjdnaXRodWIuY29tL2tua2NzL2ltcG9ydGh1Yi9nZW4vaW1wb3J0aHViL3YxO2ltcG9ydGh1YnYxYgZwcm90bzM\", [file_google_protobuf_timestamp]);\n\n/**\n * Validity says whether a Revision may be released, and if not, why. It is\n * decided when the Revision is saved, and decided again when a Release is\n * cut from it, so a Release never holds a Revision that is invalid by the\n * rules in force when it was cut.\n *\n * @generated from message importhub.v1.Validity\n */\nexport type Validity = Message<\"importhub.v1.Validity\"> & {\n /**\n * True when no reason was found.\n *\n * @generated from field: bool valid = 1;\n */\n valid: boolean;\n\n /**\n * Why the Revision is invalid; empty when it is valid. In a stable order:\n * the same data gives the same reasons in the same order.\n *\n * @generated from field: repeated importhub.v1.ValidityReason reasons = 2;\n */\n reasons: ValidityReason[];\n};\n\n/**\n * Describes the message importhub.v1.Validity.\n * Use `create(ValiditySchema)` to create a new message.\n */\nexport const ValiditySchema: GenMessage<Validity> = /*@__PURE__*/\n messageDesc(file_importhub_v1_configuration, 0);\n\n/**\n * ValidityReason is one thing that makes a Revision invalid.\n *\n * @generated from message importhub.v1.ValidityReason\n */\nexport type ValidityReason = Message<\"importhub.v1.ValidityReason\"> & {\n /**\n * Where in the configuration, as a JSON Pointer into its content (for\n * example `/entities/nbsp`); empty when it concerns the whole.\n *\n * @generated from field: string path = 1;\n */\n path: string;\n\n /**\n * A stable, machine-readable code, such as `no_entities`; the type's\n * service documents its codes.\n *\n * @generated from field: string code = 2;\n */\n code: string;\n\n /**\n * What is wrong, in English, for a person.\n *\n * @generated from field: string message = 3;\n */\n message: string;\n};\n\n/**\n * Describes the message importhub.v1.ValidityReason.\n * Use `create(ValidityReasonSchema)` to create a new message.\n */\nexport const ValidityReasonSchema: GenMessage<ValidityReason> = /*@__PURE__*/\n messageDesc(file_importhub_v1_configuration, 1);\n\n/**\n * ConfigurationRevision is one saved Revision of a configuration, as its\n * history lists it.\n *\n * @generated from message importhub.v1.ConfigurationRevision\n */\nexport type ConfigurationRevision = Message<\"importhub.v1.ConfigurationRevision\"> & {\n /**\n * The Revision's id.\n *\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * The odon user id of the person who saved it.\n *\n * @generated from field: string saved_by = 2;\n */\n savedBy: string;\n\n /**\n * When it was saved.\n *\n * @generated from field: google.protobuf.Timestamp saved_at = 3;\n */\n savedAt?: Timestamp | undefined;\n\n /**\n * Whether it could be released, as decided when it was saved.\n *\n * @generated from field: importhub.v1.Validity validity = 4;\n */\n validity?: Validity | undefined;\n\n /**\n * The Revision it restored, when it was saved by a restore; empty for an\n * ordinary save.\n *\n * @generated from field: string restored_from_revision_id = 5;\n */\n restoredFromRevisionId: string;\n};\n\n/**\n * Describes the message importhub.v1.ConfigurationRevision.\n * Use `create(ConfigurationRevisionSchema)` to create a new message.\n */\nexport const ConfigurationRevisionSchema: GenMessage<ConfigurationRevision> = /*@__PURE__*/\n messageDesc(file_importhub_v1_configuration, 2);\n\n/**\n * ConfigurationRelease is one Configuration Release: a Revision an admin\n * declared ready to run. A real Import runs only on Releases (ADR 0016).\n * A Release never changes.\n *\n * @generated from message importhub.v1.ConfigurationRelease\n */\nexport type ConfigurationRelease = Message<\"importhub.v1.ConfigurationRelease\"> & {\n /**\n * The Release's id.\n *\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * The Revision it pins.\n *\n * @generated from field: string revision_id = 2;\n */\n revisionId: string;\n\n /**\n * Its place among the configuration's Releases: 1 for the first, counting\n * up, so a person can say \"Release 3\".\n *\n * @generated from field: int32 number = 3;\n */\n number: number;\n\n /**\n * The odon user id of the admin who cut it.\n *\n * @generated from field: string released_by = 4;\n */\n releasedBy: string;\n\n /**\n * When it was cut.\n *\n * @generated from field: google.protobuf.Timestamp released_at = 5;\n */\n releasedAt?: Timestamp | undefined;\n};\n\n/**\n * Describes the message importhub.v1.ConfigurationRelease.\n * Use `create(ConfigurationReleaseSchema)` to create a new message.\n */\nexport const ConfigurationReleaseSchema: GenMessage<ConfigurationRelease> = /*@__PURE__*/\n messageDesc(file_importhub_v1_configuration, 3);\n\n/**\n * ConfigurationState is where a configuration stands: its draft, and how the\n * draft compares with the latest Release (release-a-configuration:AC1).\n *\n * @generated from message importhub.v1.ConfigurationState\n */\nexport type ConfigurationState = Message<\"importhub.v1.ConfigurationState\"> & {\n /**\n * The draft: the head Revision, the one the next save builds on and a\n * Release would be cut from.\n *\n * @generated from field: string draft_revision_id = 1;\n */\n draftRevisionId: string;\n\n /**\n * Whether the draft may be released, as decided when it was saved.\n *\n * @generated from field: importhub.v1.Validity draft_validity = 2;\n */\n draftValidity?: Validity | undefined;\n\n /**\n * The latest Release; unset while the configuration has none.\n *\n * @generated from field: importhub.v1.ConfigurationRelease latest_release = 3;\n */\n latestRelease?: ConfigurationRelease | undefined;\n\n /**\n * True when the draft's content differs from the latest Release's, and\n * always true while there is no Release. A draft that restored the latest\n * Release's content does not differ, even though it is another Revision.\n *\n * @generated from field: bool draft_differs_from_release = 4;\n */\n draftDiffersFromRelease: boolean;\n};\n\n/**\n * Describes the message importhub.v1.ConfigurationState.\n * Use `create(ConfigurationStateSchema)` to create a new message.\n */\nexport const ConfigurationStateSchema: GenMessage<ConfigurationState> = /*@__PURE__*/\n messageDesc(file_importhub_v1_configuration, 4);\n\n/**\n * FieldComparison is how one top-level field of a configuration differs\n * between two of its Revisions.\n *\n * @generated from message importhub.v1.FieldComparison\n */\nexport type FieldComparison = Message<\"importhub.v1.FieldComparison\"> & {\n /**\n * The field's key in the content, such as `entities`.\n *\n * @generated from field: string field = 1;\n */\n field: string;\n\n /**\n * @generated from field: importhub.v1.FieldComparisonStatus status = 2;\n */\n status: FieldComparisonStatus;\n};\n\n/**\n * Describes the message importhub.v1.FieldComparison.\n * Use `create(FieldComparisonSchema)` to create a new message.\n */\nexport const FieldComparisonSchema: GenMessage<FieldComparison> = /*@__PURE__*/\n messageDesc(file_importhub_v1_configuration, 5);\n\n/**\n * ImportProfileRef names one Import Profile: where another configuration is\n * used (manage-mappings:AC3, release-a-configuration:AC4) or why it may not be\n * deleted (manage-mappings:AC4, manage-entity-sets:AC3).\n *\n * @generated from message importhub.v1.ImportProfileRef\n */\nexport type ImportProfileRef = Message<\"importhub.v1.ImportProfileRef\"> & {\n /**\n * The Import Profile's id.\n *\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * Its name, as its draft has it.\n *\n * @generated from field: string name = 2;\n */\n name: string;\n};\n\n/**\n * Describes the message importhub.v1.ImportProfileRef.\n * Use `create(ImportProfileRefSchema)` to create a new message.\n */\nexport const ImportProfileRefSchema: GenMessage<ImportProfileRef> = /*@__PURE__*/\n messageDesc(file_importhub_v1_configuration, 6);\n\n/**\n * ConfigurationInUse is the detail of a FailedPrecondition delete of a\n * Mapping that Import Profiles include, or of an Entity Set they name: the\n * Profiles, by name. A Profile counts when its draft or its latest Release\n * includes or names it, since either may still run or be released.\n *\n * @generated from message importhub.v1.ConfigurationInUse\n */\nexport type ConfigurationInUse = Message<\"importhub.v1.ConfigurationInUse\"> & {\n /**\n * @generated from field: repeated importhub.v1.ImportProfileRef import_profiles = 1;\n */\n importProfiles: ImportProfileRef[];\n};\n\n/**\n * Describes the message importhub.v1.ConfigurationInUse.\n * Use `create(ConfigurationInUseSchema)` to create a new message.\n */\nexport const ConfigurationInUseSchema: GenMessage<ConfigurationInUse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_configuration, 7);\n\n/**\n * FieldComparisonStatus is how a field differs between two Revisions, from\n * the first to the second.\n *\n * @generated from enum importhub.v1.FieldComparisonStatus\n */\nexport enum FieldComparisonStatus {\n /**\n * @generated from enum value: FIELD_COMPARISON_STATUS_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * The same value on both sides, or absent from both.\n *\n * @generated from enum value: FIELD_COMPARISON_STATUS_UNCHANGED = 1;\n */\n UNCHANGED = 1,\n\n /**\n * Absent from the first, present in the second.\n *\n * @generated from enum value: FIELD_COMPARISON_STATUS_ADDED = 2;\n */\n ADDED = 2,\n\n /**\n * Present in the first, absent from the second.\n *\n * @generated from enum value: FIELD_COMPARISON_STATUS_REMOVED = 3;\n */\n REMOVED = 3,\n\n /**\n * Present on both sides with different values.\n *\n * @generated from enum value: FIELD_COMPARISON_STATUS_CHANGED = 4;\n */\n CHANGED = 4,\n}\n\n/**\n * Describes the enum importhub.v1.FieldComparisonStatus.\n */\nexport const FieldComparisonStatusSchema: GenEnum<FieldComparisonStatus> = /*@__PURE__*/\n enumDesc(file_importhub_v1_configuration, 0);\n\n","// @generated by protoc-gen-es v2.13.0 with parameter \"target=ts\"\n// @generated from file importhub/v1/entity_set.proto (package importhub.v1, syntax proto3)\n/* eslint-disable */\n\nimport type { GenFile, GenMessage, GenService } from \"@bufbuild/protobuf/codegenv2\";\nimport { fileDesc, messageDesc, serviceDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport type { Timestamp } from \"@bufbuild/protobuf/wkt\";\nimport { file_google_protobuf_timestamp } from \"@bufbuild/protobuf/wkt\";\nimport type { ConfigurationRelease, ConfigurationRevision, ConfigurationState, FieldComparison, Validity } from \"./configuration_pb\";\nimport { file_importhub_v1_configuration } from \"./configuration_pb\";\nimport type { Message } from \"@bufbuild/protobuf\";\n\n/**\n * Describes the file importhub/v1/entity_set.proto.\n */\nexport const file_importhub_v1_entity_set: GenFile = /*@__PURE__*/\n fileDesc(\"Ch1pbXBvcnRodWIvdjEvZW50aXR5X3NldC5wcm90bxIMaW1wb3J0aHViLnYxIugBCglFbnRpdHlTZXQSCgoCaWQYASABKAkSEwoLcmV2aXNpb25faWQYAiABKAkSLwoHY29udGVudBgDIAEoCzIeLmltcG9ydGh1Yi52MS5FbnRpdHlTZXRDb250ZW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uTGlzdEVudGl0eVNldEhpc3RvcnlSZXF1ZXN0GiouaW1wb3J0aHViLnYxLkxpc3RFbnRpdHlTZXRIaXN0b3J5UmVzcG9uc2USfAoZQ29tcGFyZUVudGl0eVNldFJldmlzaW9ucxIuLmltcG9ydGh1Yi52MS5Db21wYXJlRW50aXR5U2V0UmV2aXNpb25zUmVxdWVzdBovLmltcG9ydGh1Yi52MS5Db21wYXJlRW50aXR5U2V0UmV2aXNpb25zUmVzcG9uc2USeQoYUmVzdG9yZUVudGl0eVNldFJldmlzaW9uEi0uaW1wb3J0aHViLnYxLlJlc3RvcmVFbnRpdHlTZXRSZXZpc2lvblJlcXVlc3QaLi5pbXBvcnRodWIudjEuUmVzdG9yZUVudGl0eVNldFJldmlzaW9uUmVzcG9uc2VCOVo3Z2l0aHViLmNvbS9rbmtjcy9pbXBvcnRodWIvZ2VuL2ltcG9ydGh1Yi92MTtpbXBvcnRodWJ2MWIGcHJvdG8z\", [file_google_protobuf_timestamp, file_importhub_v1_configuration]);\n\n/**\n * EntitySet is one Entity Set, at one of its Revisions.\n *\n * @generated from message importhub.v1.EntitySet\n */\nexport type EntitySet = Message<\"importhub.v1.EntitySet\"> & {\n /**\n * The Entity Set's id, a KSUID.\n *\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * The Revision this content is from: the draft, unless an older one was\n * asked for.\n *\n * @generated from field: string revision_id = 2;\n */\n revisionId: string;\n\n /**\n * The content at that Revision.\n *\n * @generated from field: importhub.v1.EntitySetContent content = 3;\n */\n content?: EntitySetContent | undefined;\n\n /**\n * Whether that Revision may be released, as decided when it was saved.\n *\n * @generated from field: importhub.v1.Validity validity = 4;\n */\n validity?: Validity | undefined;\n\n /**\n * Where the Entity Set stands: its draft and latest Release.\n *\n * @generated from field: importhub.v1.ConfigurationState state = 5;\n */\n state?: ConfigurationState | undefined;\n\n /**\n * When the Entity Set was created.\n *\n * @generated from field: google.protobuf.Timestamp created_at = 6;\n */\n createdAt?: Timestamp | undefined;\n};\n\n/**\n * Describes the message importhub.v1.EntitySet.\n * Use `create(EntitySetSchema)` to create a new message.\n */\nexport const EntitySetSchema: GenMessage<EntitySet> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 0);\n\n/**\n * EntitySetContent is what an admin edits, and what a Revision holds.\n *\n * @generated from message importhub.v1.EntitySetContent\n */\nexport type EntitySetContent = Message<\"importhub.v1.EntitySetContent\"> & {\n /**\n * The Entity Set's name, unique in the workspace. An Import Profile names\n * its Entity Set by id, so renaming it breaks no Profile.\n *\n * @generated from field: string name = 1;\n */\n name: string;\n\n /**\n * What the Entity Set is for; free text.\n *\n * @generated from field: string description = 2;\n */\n description: string;\n\n /**\n * The entities, by name without `&` and `;`: `auml` for `&auml;`, mapped\n * to the text each stands for, which may be empty.\n *\n * @generated from field: map<string, string> entities = 3;\n */\n entities: { [key: string]: string };\n};\n\n/**\n * Describes the message importhub.v1.EntitySetContent.\n * Use `create(EntitySetContentSchema)` to create a new message.\n */\nexport const EntitySetContentSchema: GenMessage<EntitySetContent> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 1);\n\n/**\n * @generated from message importhub.v1.ListEntitySetsRequest\n */\nexport type ListEntitySetsRequest = Message<\"importhub.v1.ListEntitySetsRequest\"> & {\n};\n\n/**\n * Describes the message importhub.v1.ListEntitySetsRequest.\n * Use `create(ListEntitySetsRequestSchema)` to create a new message.\n */\nexport const ListEntitySetsRequestSchema: GenMessage<ListEntitySetsRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 2);\n\n/**\n * @generated from message importhub.v1.ListEntitySetsResponse\n */\nexport type ListEntitySetsResponse = Message<\"importhub.v1.ListEntitySetsResponse\"> & {\n /**\n * @generated from field: repeated importhub.v1.EntitySet entity_sets = 1;\n */\n entitySets: EntitySet[];\n};\n\n/**\n * Describes the message importhub.v1.ListEntitySetsResponse.\n * Use `create(ListEntitySetsResponseSchema)` to create a new message.\n */\nexport const ListEntitySetsResponseSchema: GenMessage<ListEntitySetsResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 3);\n\n/**\n * @generated from message importhub.v1.GetEntitySetRequest\n */\nexport type GetEntitySetRequest = Message<\"importhub.v1.GetEntitySetRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * An older Revision to read the content of; empty for the draft.\n *\n * @generated from field: string revision_id = 2;\n */\n revisionId: string;\n};\n\n/**\n * Describes the message importhub.v1.GetEntitySetRequest.\n * Use `create(GetEntitySetRequestSchema)` to create a new message.\n */\nexport const GetEntitySetRequestSchema: GenMessage<GetEntitySetRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 4);\n\n/**\n * @generated from message importhub.v1.GetEntitySetResponse\n */\nexport type GetEntitySetResponse = Message<\"importhub.v1.GetEntitySetResponse\"> & {\n /**\n * @generated from field: importhub.v1.EntitySet entity_set = 1;\n */\n entitySet?: EntitySet | undefined;\n};\n\n/**\n * Describes the message importhub.v1.GetEntitySetResponse.\n * Use `create(GetEntitySetResponseSchema)` to create a new message.\n */\nexport const GetEntitySetResponseSchema: GenMessage<GetEntitySetResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 5);\n\n/**\n * @generated from message importhub.v1.CreateEntitySetRequest\n */\nexport type CreateEntitySetRequest = Message<\"importhub.v1.CreateEntitySetRequest\"> & {\n /**\n * @generated from field: importhub.v1.EntitySetContent content = 1;\n */\n content?: EntitySetContent | undefined;\n};\n\n/**\n * Describes the message importhub.v1.CreateEntitySetRequest.\n * Use `create(CreateEntitySetRequestSchema)` to create a new message.\n */\nexport const CreateEntitySetRequestSchema: GenMessage<CreateEntitySetRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 6);\n\n/**\n * @generated from message importhub.v1.CreateEntitySetResponse\n */\nexport type CreateEntitySetResponse = Message<\"importhub.v1.CreateEntitySetResponse\"> & {\n /**\n * @generated from field: importhub.v1.EntitySet entity_set = 1;\n */\n entitySet?: EntitySet | undefined;\n};\n\n/**\n * Describes the message importhub.v1.CreateEntitySetResponse.\n * Use `create(CreateEntitySetResponseSchema)` to create a new message.\n */\nexport const CreateEntitySetResponseSchema: GenMessage<CreateEntitySetResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 7);\n\n/**\n * @generated from message importhub.v1.UpdateEntitySetRequest\n */\nexport type UpdateEntitySetRequest = Message<\"importhub.v1.UpdateEntitySetRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * The whole new content; it replaces the draft's.\n *\n * @generated from field: importhub.v1.EntitySetContent content = 2;\n */\n content?: EntitySetContent | undefined;\n\n /**\n * The draft this edit was made on. Given, the save is refused if the\n * draft has moved since; empty, it saves on whatever the draft is.\n *\n * @generated from field: string draft_revision_id = 3;\n */\n draftRevisionId: string;\n};\n\n/**\n * Describes the message importhub.v1.UpdateEntitySetRequest.\n * Use `create(UpdateEntitySetRequestSchema)` to create a new message.\n */\nexport const UpdateEntitySetRequestSchema: GenMessage<UpdateEntitySetRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 8);\n\n/**\n * @generated from message importhub.v1.UpdateEntitySetResponse\n */\nexport type UpdateEntitySetResponse = Message<\"importhub.v1.UpdateEntitySetResponse\"> & {\n /**\n * @generated from field: importhub.v1.EntitySet entity_set = 1;\n */\n entitySet?: EntitySet | undefined;\n};\n\n/**\n * Describes the message importhub.v1.UpdateEntitySetResponse.\n * Use `create(UpdateEntitySetResponseSchema)` to create a new message.\n */\nexport const UpdateEntitySetResponseSchema: GenMessage<UpdateEntitySetResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 9);\n\n/**\n * @generated from message importhub.v1.DeleteEntitySetRequest\n */\nexport type DeleteEntitySetRequest = Message<\"importhub.v1.DeleteEntitySetRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n};\n\n/**\n * Describes the message importhub.v1.DeleteEntitySetRequest.\n * Use `create(DeleteEntitySetRequestSchema)` to create a new message.\n */\nexport const DeleteEntitySetRequestSchema: GenMessage<DeleteEntitySetRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 10);\n\n/**\n * @generated from message importhub.v1.DeleteEntitySetResponse\n */\nexport type DeleteEntitySetResponse = Message<\"importhub.v1.DeleteEntitySetResponse\"> & {\n};\n\n/**\n * Describes the message importhub.v1.DeleteEntitySetResponse.\n * Use `create(DeleteEntitySetResponseSchema)` to create a new message.\n */\nexport const DeleteEntitySetResponseSchema: GenMessage<DeleteEntitySetResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 11);\n\n/**\n * @generated from message importhub.v1.CutEntitySetReleaseRequest\n */\nexport type CutEntitySetReleaseRequest = Message<\"importhub.v1.CutEntitySetReleaseRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * The draft the admin is releasing. Given, the cut is refused if the\n * draft has moved since, so what was reviewed is what is released.\n *\n * @generated from field: string draft_revision_id = 2;\n */\n draftRevisionId: string;\n};\n\n/**\n * Describes the message importhub.v1.CutEntitySetReleaseRequest.\n * Use `create(CutEntitySetReleaseRequestSchema)` to create a new message.\n */\nexport const CutEntitySetReleaseRequestSchema: GenMessage<CutEntitySetReleaseRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 12);\n\n/**\n * @generated from message importhub.v1.CutEntitySetReleaseResponse\n */\nexport type CutEntitySetReleaseResponse = Message<\"importhub.v1.CutEntitySetReleaseResponse\"> & {\n /**\n * The Release cut.\n *\n * @generated from field: importhub.v1.ConfigurationRelease release = 1;\n */\n release?: ConfigurationRelease | undefined;\n\n /**\n * The Entity Set after the cut.\n *\n * @generated from field: importhub.v1.EntitySet entity_set = 2;\n */\n entitySet?: EntitySet | undefined;\n};\n\n/**\n * Describes the message importhub.v1.CutEntitySetReleaseResponse.\n * Use `create(CutEntitySetReleaseResponseSchema)` to create a new message.\n */\nexport const CutEntitySetReleaseResponseSchema: GenMessage<CutEntitySetReleaseResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 13);\n\n/**\n * @generated from message importhub.v1.ListEntitySetHistoryRequest\n */\nexport type ListEntitySetHistoryRequest = Message<\"importhub.v1.ListEntitySetHistoryRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * Revisions per page; 0 means 100, and at most 1000.\n *\n * @generated from field: int32 page_size = 2;\n */\n pageSize: number;\n\n /**\n * The next_page_token of the previous page; empty for the first.\n *\n * @generated from field: string page_token = 3;\n */\n pageToken: string;\n};\n\n/**\n * Describes the message importhub.v1.ListEntitySetHistoryRequest.\n * Use `create(ListEntitySetHistoryRequestSchema)` to create a new message.\n */\nexport const ListEntitySetHistoryRequestSchema: GenMessage<ListEntitySetHistoryRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 14);\n\n/**\n * @generated from message importhub.v1.ListEntitySetHistoryResponse\n */\nexport type ListEntitySetHistoryResponse = Message<\"importhub.v1.ListEntitySetHistoryResponse\"> & {\n /**\n * One page of Revisions, newest first.\n *\n * @generated from field: repeated importhub.v1.ConfigurationRevision revisions = 1;\n */\n revisions: ConfigurationRevision[];\n\n /**\n * Every Release, newest first, on every page.\n *\n * @generated from field: repeated importhub.v1.ConfigurationRelease releases = 2;\n */\n releases: ConfigurationRelease[];\n\n /**\n * The page_token of the next page; empty on the last.\n *\n * @generated from field: string next_page_token = 3;\n */\n nextPageToken: string;\n};\n\n/**\n * Describes the message importhub.v1.ListEntitySetHistoryResponse.\n * Use `create(ListEntitySetHistoryResponseSchema)` to create a new message.\n */\nexport const ListEntitySetHistoryResponseSchema: GenMessage<ListEntitySetHistoryResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 15);\n\n/**\n * @generated from message importhub.v1.CompareEntitySetRevisionsRequest\n */\nexport type CompareEntitySetRevisionsRequest = Message<\"importhub.v1.CompareEntitySetRevisionsRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * The Revision compared from.\n *\n * @generated from field: string from_revision_id = 2;\n */\n fromRevisionId: string;\n\n /**\n * The Revision compared to.\n *\n * @generated from field: string to_revision_id = 3;\n */\n toRevisionId: string;\n};\n\n/**\n * Describes the message importhub.v1.CompareEntitySetRevisionsRequest.\n * Use `create(CompareEntitySetRevisionsRequestSchema)` to create a new message.\n */\nexport const CompareEntitySetRevisionsRequestSchema: GenMessage<CompareEntitySetRevisionsRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 16);\n\n/**\n * @generated from message importhub.v1.CompareEntitySetRevisionsResponse\n */\nexport type CompareEntitySetRevisionsResponse = Message<\"importhub.v1.CompareEntitySetRevisionsResponse\"> & {\n /**\n * The Entity Set at from_revision_id.\n *\n * @generated from field: importhub.v1.EntitySet from = 1;\n */\n from?: EntitySet | undefined;\n\n /**\n * The Entity Set at to_revision_id.\n *\n * @generated from field: importhub.v1.EntitySet to = 2;\n */\n to?: EntitySet | undefined;\n\n /**\n * Each field, and how it differs from `from` to `to`.\n *\n * @generated from field: repeated importhub.v1.FieldComparison fields = 3;\n */\n fields: FieldComparison[];\n};\n\n/**\n * Describes the message importhub.v1.CompareEntitySetRevisionsResponse.\n * Use `create(CompareEntitySetRevisionsResponseSchema)` to create a new message.\n */\nexport const CompareEntitySetRevisionsResponseSchema: GenMessage<CompareEntitySetRevisionsResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 17);\n\n/**\n * @generated from message importhub.v1.RestoreEntitySetRevisionRequest\n */\nexport type RestoreEntitySetRevisionRequest = Message<\"importhub.v1.RestoreEntitySetRevisionRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * The older Revision whose content becomes the new draft.\n *\n * @generated from field: string revision_id = 2;\n */\n revisionId: string;\n\n /**\n * As UpdateEntitySetRequest's.\n *\n * @generated from field: string draft_revision_id = 3;\n */\n draftRevisionId: string;\n};\n\n/**\n * Describes the message importhub.v1.RestoreEntitySetRevisionRequest.\n * Use `create(RestoreEntitySetRevisionRequestSchema)` to create a new message.\n */\nexport const RestoreEntitySetRevisionRequestSchema: GenMessage<RestoreEntitySetRevisionRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 18);\n\n/**\n * @generated from message importhub.v1.RestoreEntitySetRevisionResponse\n */\nexport type RestoreEntitySetRevisionResponse = Message<\"importhub.v1.RestoreEntitySetRevisionResponse\"> & {\n /**\n * @generated from field: importhub.v1.EntitySet entity_set = 1;\n */\n entitySet?: EntitySet | undefined;\n};\n\n/**\n * Describes the message importhub.v1.RestoreEntitySetRevisionResponse.\n * Use `create(RestoreEntitySetRevisionResponseSchema)` to create a new message.\n */\nexport const RestoreEntitySetRevisionResponseSchema: GenMessage<RestoreEntitySetRevisionResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 19);\n\n/**\n * EntitySetService holds the workspace's Entity Sets: named tables of XML\n * character entities and what they stand for, with which an Import reads a\n * Source File that uses entities it does not declare (CONTEXT.md,\n * manage-entity-sets).\n *\n * An Entity Set is versioned configuration (ADR 0016): every create, update\n * and restore saves a draft Revision, and an admin cuts a Configuration\n * Release from a valid draft. A real Import runs only on a Release.\n *\n * Every RPC acts on the caller's workspace, which comes from the token's\n * active workspace and never from a request field. Reads need `viewer`;\n * every write needs `admin` (ADR 0010, control-who-may-import:AC3).\n *\n * The validity reason codes of an Entity Set:\n *\n * - `no_entities`: it defines no entity.\n * - `unreadable_name`: an entity's name is not a letter followed by\n * letters, digits, `.`, `_` or `-`, so no reference in a Source File\n * could ever name it.\n * - `predefined_entity`: it redefines one of XML's own entities (`amp`,\n * `lt`, `gt`, `quot`, `apos`), which would change how every file is\n * read.\n *\n * @generated from service importhub.v1.EntitySetService\n */\nexport const EntitySetService: GenService<{\n /**\n * ListEntitySets returns every Entity Set of the workspace, by name, each\n * with its draft. A workspace keeps a handful, so the list is not paged.\n *\n * @generated from rpc importhub.v1.EntitySetService.ListEntitySets\n */\n listEntitySets: {\n methodKind: \"unary\";\n input: typeof ListEntitySetsRequestSchema;\n output: typeof ListEntitySetsResponseSchema;\n },\n /**\n * GetEntitySet returns one Entity Set with its draft, or with an older\n * Revision of it when one is named.\n *\n * @generated from rpc importhub.v1.EntitySetService.GetEntitySet\n */\n getEntitySet: {\n methodKind: \"unary\";\n input: typeof GetEntitySetRequestSchema;\n output: typeof GetEntitySetResponseSchema;\n },\n /**\n * CreateEntitySet creates an Entity Set, its content the first draft. An\n * invalid table of entities is saved and marked invalid with its reasons;\n * a missing name, or one another Entity Set of the workspace has, is\n * refused (InvalidArgument, AlreadyExists).\n *\n * @generated from rpc importhub.v1.EntitySetService.CreateEntitySet\n */\n createEntitySet: {\n methodKind: \"unary\";\n input: typeof CreateEntitySetRequestSchema;\n output: typeof CreateEntitySetResponseSchema;\n },\n /**\n * UpdateEntitySet saves new content as a new draft Revision. It is\n * refused with FailedPrecondition when draft_revision_id is given and is\n * no longer the draft: somebody saved in between.\n *\n * @generated from rpc importhub.v1.EntitySetService.UpdateEntitySet\n */\n updateEntitySet: {\n methodKind: \"unary\";\n input: typeof UpdateEntitySetRequestSchema;\n output: typeof UpdateEntitySetResponseSchema;\n },\n /**\n * DeleteEntitySet deletes an Entity Set; it no longer appears in the list,\n * and its name is free again. It is refused with FailedPrecondition while\n * an Import Profile names it, naming the Profiles in the message and in a\n * ConfigurationInUse detail (manage-entity-sets:AC3).\n *\n * @generated from rpc importhub.v1.EntitySetService.DeleteEntitySet\n */\n deleteEntitySet: {\n methodKind: \"unary\";\n input: typeof DeleteEntitySetRequestSchema;\n output: typeof DeleteEntitySetResponseSchema;\n },\n /**\n * CutEntitySetRelease cuts a Configuration Release from the draft. It is\n * refused with FailedPrecondition when the draft is invalid (the error\n * carries the draft's Validity as a detail, with its reasons), when the\n * draft does not differ from the latest Release, or when\n * draft_revision_id is given and is no longer the draft.\n *\n * @generated from rpc importhub.v1.EntitySetService.CutEntitySetRelease\n */\n cutEntitySetRelease: {\n methodKind: \"unary\";\n input: typeof CutEntitySetReleaseRequestSchema;\n output: typeof CutEntitySetReleaseResponseSchema;\n },\n /**\n * ListEntitySetHistory lists an Entity Set's Revisions, newest first and\n * paged, with who saved each and when, and all its Releases, with who cut\n * each and when (release-a-configuration:AC6).\n *\n * @generated from rpc importhub.v1.EntitySetService.ListEntitySetHistory\n */\n listEntitySetHistory: {\n methodKind: \"unary\";\n input: typeof ListEntitySetHistoryRequestSchema;\n output: typeof ListEntitySetHistoryResponseSchema;\n },\n /**\n * CompareEntitySetRevisions compares two Revisions of one Entity Set: both\n * contents, for a side-by-side view, and how each field differs from the\n * first to the second. A Release is compared through the Revision it pins.\n *\n * @generated from rpc importhub.v1.EntitySetService.CompareEntitySetRevisions\n */\n compareEntitySetRevisions: {\n methodKind: \"unary\";\n input: typeof CompareEntitySetRevisionsRequestSchema;\n output: typeof CompareEntitySetRevisionsResponseSchema;\n },\n /**\n * RestoreEntitySetRevision saves an older Revision's content as a new\n * draft (release-a-configuration:AC7). Its validity is decided anew, by\n * the rules in force now. It is refused like UpdateEntitySet when the\n * draft moved, and with AlreadyExists when the old name is now another\n * Entity Set's.\n *\n * @generated from rpc importhub.v1.EntitySetService.RestoreEntitySetRevision\n */\n restoreEntitySetRevision: {\n methodKind: \"unary\";\n input: typeof RestoreEntitySetRevisionRequestSchema;\n output: typeof RestoreEntitySetRevisionResponseSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_importhub_v1_entity_set, 0);\n\n","// @generated by protoc-gen-es v2.13.0 with parameter \"target=ts\"\n// @generated from file importhub/v1/import.proto (package importhub.v1, syntax proto3)\n/* eslint-disable */\n\nimport type { GenEnum, GenFile, GenMessage, GenService } from \"@bufbuild/protobuf/codegenv2\";\nimport { enumDesc, fileDesc, messageDesc, serviceDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport type { Timestamp } from \"@bufbuild/protobuf/wkt\";\nimport { file_google_protobuf_timestamp } from \"@bufbuild/protobuf/wkt\";\nimport type { Message } from \"@bufbuild/protobuf\";\n\n/**\n * Describes the file importhub/v1/import.proto.\n */\nexport const file_importhub_v1_import: GenFile = /*@__PURE__*/\n fileDesc(\"ChlpbXBvcnRodWIvdjEvaW1wb3J0LnByb3RvEgxpbXBvcnRodWIudjEiMgodQ3JlYXRlU291cmNlRmlsZVVwbG9hZFJlcXVlc3QSEQoJZmlsZV9uYW1lGAEgASgJIpsBCh5DcmVhdGVTb3VyY2VGaWxlVXBsb2FkUmVzcG9uc2USLQoLc291cmNlX2ZpbGUYASABKAsyGC5pbXBvcnRodWIudjEuU291cmNlRmlsZRISCgp1cGxvYWRfdXJsGAIgASgJEjYKEnVwbG9hZF9leHBpcmVfdGltZRgDIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXAicAoKU291cmNlRmlsZRIKCgJpZBgBIAEoCRIRCglmaWxlX25hbWUYAiABKAkSEgoKY3JlYXRlZF9ieRgDIAEoCRIvCgtjcmVhdGVfdGltZRgEIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXAiiwEKElN0YXJ0SW1wb3J0UmVxdWVzdBIZChFpbXBvcnRfcHJvZmlsZV9pZBgBIAEoCRIWCg5zb3VyY2VfZmlsZV9pZBgCIAEoCRIWCg5lZmZlY3RpdmVfZGF0ZRgDIAEoCRIqCgZzb3VyY2UYBCABKAsyGi5pbXBvcnRodWIudjEuSW1wb3J0U291cmNlIi8KDEltcG9ydFNvdXJjZRIMCgRkYXRlGAEgASgJEhEKCXJlZmVyZW5jZRgCIAEoCSI7ChNTdGFydEltcG9ydFJlc3BvbnNlEiQKBmltcG9ydBgBIAEoCzIULmltcG9ydGh1Yi52MS5JbXBvcnQiOwoSTGlzdEltcG9ydHNSZXF1ZXN0EhEKCXBhZ2Vfc2l6ZRgBIAEoBRISCgpwYWdlX3Rva2VuGAIgASgJIlUKE0xpc3RJbXBvcnRzUmVzcG9uc2USJQoHaW1wb3J0cxgBIAMoCzIULmltcG9ydGh1Yi52MS5JbXBvcnQSFwo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DQ0VFREVEEAESKgomSU1QT1JUX09VVENPTUVfU1VDQ0VFREVEX1dJVEhfUFJPQkxFTVMQAhIZChVJTVBPUlRfT1VUQ09NRV9GQUlMRUQQAxIcChhJTVBPUlRfT1VUQ09NRV9DQU5DRUxMRUQQBDK0BAoNSW1wb3J0U2VydmljZRJzChZDcmVhdGVTb3VyY2VGaWxlVXBsb2FkEisuaW1wb3J0aHViLnYxLkNyZWF0ZVNvdXJjZUZpbGVVcGxvYWRSZXF1ZXN0GiwuaW1wb3J0aHViLnYxLkNyZWF0ZVNvdXJjZUZpbGVVcGxvYWRSZXNwb25zZRJSCgtTdGFydEltcG9ydBIgLmltcG9ydGh1Yi52MS5TdGFydEltcG9ydFJlcXVlc3QaIS5pbXBvcnRodWIudjEuU3RhcnRJbXBvcnRSZXNwb25zZRJSCgtMaXN0SW1wb3J0cxIgLmltcG9ydGh1Yi52MS5MaXN0SW1wb3J0c1JlcXVlc3QaIS5pbXBvcnRodWIudjEuTGlzdEltcG9ydHNSZXNwb25zZRJMCglHZXRJbXBvcnQSHi5pbXBvcnRodWIudjEuR2V0SW1wb3J0UmVxdWVzdBofLmltcG9ydGh1Yi52MS5HZXRJbXBvcnRSZXNwb25zZRJVCgxDYW5jZWxJbXBvcnQSIS5pbXBvcnRodWIudjEuQ2FuY2VsSW1wb3J0UmVxdWVzdBoiLmltcG9ydGh1Yi52MS5DYW5jZWxJbXBvcnRSZXNwb25zZRJhChBMaXN0SXRlbVByb2JsZW1zEiUuaW1wb3J0aHViLnYxLkxpc3RJdGVtUHJvYmxlbXNSZXF1ZXN0GiYuaW1wb3J0aHViLnYxLkxpc3RJdGVtUHJvYmxlbXNSZXNwb25zZUI5WjdnaXRodWIuY29tL2tua2NzL2ltcG9ydGh1Yi9nZW4vaW1wb3J0aHViL3YxO2ltcG9ydGh1YnYxYgZwcm90bzM\", [file_google_protobuf_timestamp]);\n\n/**\n * @generated from message importhub.v1.CreateSourceFileUploadRequest\n */\nexport type CreateSourceFileUploadRequest = Message<\"importhub.v1.CreateSourceFileUploadRequest\"> & {\n /**\n * The file's name as the person knows it, for display: not blank, at most\n * 255 characters. It is never part of where the file is stored.\n *\n * @generated from field: string file_name = 1;\n */\n fileName: string;\n};\n\n/**\n * Describes the message importhub.v1.CreateSourceFileUploadRequest.\n * Use `create(CreateSourceFileUploadRequestSchema)` to create a new message.\n */\nexport const CreateSourceFileUploadRequestSchema: GenMessage<CreateSourceFileUploadRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 0);\n\n/**\n * @generated from message importhub.v1.CreateSourceFileUploadResponse\n */\nexport type CreateSourceFileUploadResponse = Message<\"importhub.v1.CreateSourceFileUploadResponse\"> & {\n /**\n * @generated from field: importhub.v1.SourceFile source_file = 1;\n */\n sourceFile?: SourceFile | undefined;\n\n /**\n * Where to PUT the file's content, until upload_expire_time.\n *\n * @generated from field: string upload_url = 2;\n */\n uploadUrl: string;\n\n /**\n * @generated from field: google.protobuf.Timestamp upload_expire_time = 3;\n */\n uploadExpireTime?: Timestamp | undefined;\n};\n\n/**\n * Describes the message importhub.v1.CreateSourceFileUploadResponse.\n * Use `create(CreateSourceFileUploadResponseSchema)` to create a new message.\n */\nexport const CreateSourceFileUploadResponseSchema: GenMessage<CreateSourceFileUploadResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 1);\n\n/**\n * SourceFile is the one XML file an Import reads, kept in importhub's own\n * blob store (CONTEXT.md \"Source File\").\n *\n * @generated from message importhub.v1.SourceFile\n */\nexport type SourceFile = Message<\"importhub.v1.SourceFile\"> & {\n /**\n * Its id, a KSUID.\n *\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * @generated from field: string file_name = 2;\n */\n fileName: string;\n\n /**\n * The odon user id of the person who made it.\n *\n * @generated from field: string created_by = 3;\n */\n createdBy: string;\n\n /**\n * @generated from field: google.protobuf.Timestamp create_time = 4;\n */\n createTime?: Timestamp | undefined;\n};\n\n/**\n * Describes the message importhub.v1.SourceFile.\n * Use `create(SourceFileSchema)` to create a new message.\n */\nexport const SourceFileSchema: GenMessage<SourceFile> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 2);\n\n/**\n * @generated from message importhub.v1.StartImportRequest\n */\nexport type StartImportRequest = Message<\"importhub.v1.StartImportRequest\"> & {\n /**\n * The Import Profile to run; the Import runs its latest Release.\n *\n * @generated from field: string import_profile_id = 1;\n */\n importProfileId: string;\n\n /**\n * The Source File to read, uploaded with CreateSourceFileUpload's URL.\n *\n * @generated from field: string source_file_id = 2;\n */\n sourceFileId: string;\n\n /**\n * Optional: the day, YYYY-MM-DD, the Source Versions of Dated Content\n * the file gives no dates for take effect: their Planned Releases start\n * that day (start-an-import:AC2). A day the file gives always wins.\n *\n * @generated from field: string effective_date = 3;\n */\n effectiveDate: string;\n\n /**\n * Optional: the publication that triggered the Import. The Change Set the\n * Import opens records it, and contenthub prefills Release Spec fields\n * from it. Its date and reference are then both required.\n *\n * @generated from field: importhub.v1.ImportSource source = 4;\n */\n source?: ImportSource | undefined;\n};\n\n/**\n * Describes the message importhub.v1.StartImportRequest.\n * Use `create(StartImportRequestSchema)` to create a new message.\n */\nexport const StartImportRequestSchema: GenMessage<StartImportRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 3);\n\n/**\n * ImportSource is the publication that triggered an Import, as contenthub\n * records it on a Change Set (contenthub's CONTEXT.md \"Source\"): such as\n * 2026-09-20, \"BGBl. 2026 I Nr. 270\".\n *\n * @generated from message importhub.v1.ImportSource\n */\nexport type ImportSource = Message<\"importhub.v1.ImportSource\"> & {\n /**\n * The day it was published, as YYYY-MM-DD.\n *\n * @generated from field: string date = 1;\n */\n date: string;\n\n /**\n * How it is cited: one line, at most 500 characters.\n *\n * @generated from field: string reference = 2;\n */\n reference: string;\n};\n\n/**\n * Describes the message importhub.v1.ImportSource.\n * Use `create(ImportSourceSchema)` to create a new message.\n */\nexport const ImportSourceSchema: GenMessage<ImportSource> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 4);\n\n/**\n * @generated from message importhub.v1.StartImportResponse\n */\nexport type StartImportResponse = Message<\"importhub.v1.StartImportResponse\"> & {\n /**\n * The Import, queued.\n *\n * @generated from field: importhub.v1.Import import = 1;\n */\n import?: Import | undefined;\n};\n\n/**\n * Describes the message importhub.v1.StartImportResponse.\n * Use `create(StartImportResponseSchema)` to create a new message.\n */\nexport const StartImportResponseSchema: GenMessage<StartImportResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 5);\n\n/**\n * @generated from message importhub.v1.ListImportsRequest\n */\nexport type ListImportsRequest = Message<\"importhub.v1.ListImportsRequest\"> & {\n /**\n * At most 200; 0 means 50.\n *\n * @generated from field: int32 page_size = 1;\n */\n pageSize: number;\n\n /**\n * The next_page_token of the previous page; empty for the first.\n *\n * @generated from field: string page_token = 2;\n */\n pageToken: string;\n};\n\n/**\n * Describes the message importhub.v1.ListImportsRequest.\n * Use `create(ListImportsRequestSchema)` to create a new message.\n */\nexport const ListImportsRequestSchema: GenMessage<ListImportsRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 6);\n\n/**\n * @generated from message importhub.v1.ListImportsResponse\n */\nexport type ListImportsResponse = Message<\"importhub.v1.ListImportsResponse\"> & {\n /**\n * @generated from field: repeated importhub.v1.Import imports = 1;\n */\n imports: Import[];\n\n /**\n * Empty on the last page.\n *\n * @generated from field: string next_page_token = 2;\n */\n nextPageToken: string;\n};\n\n/**\n * Describes the message importhub.v1.ListImportsResponse.\n * Use `create(ListImportsResponseSchema)` to create a new message.\n */\nexport const ListImportsResponseSchema: GenMessage<ListImportsResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 7);\n\n/**\n * @generated from message importhub.v1.GetImportRequest\n */\nexport type GetImportRequest = Message<\"importhub.v1.GetImportRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n};\n\n/**\n * Describes the message importhub.v1.GetImportRequest.\n * Use `create(GetImportRequestSchema)` to create a new message.\n */\nexport const GetImportRequestSchema: GenMessage<GetImportRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 8);\n\n/**\n * @generated from message importhub.v1.GetImportResponse\n */\nexport type GetImportResponse = Message<\"importhub.v1.GetImportResponse\"> & {\n /**\n * @generated from field: importhub.v1.Import import = 1;\n */\n import?: Import | undefined;\n};\n\n/**\n * Describes the message importhub.v1.GetImportResponse.\n * Use `create(GetImportResponseSchema)` to create a new message.\n */\nexport const GetImportResponseSchema: GenMessage<GetImportResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 9);\n\n/**\n * @generated from message importhub.v1.CancelImportRequest\n */\nexport type CancelImportRequest = Message<\"importhub.v1.CancelImportRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n};\n\n/**\n * Describes the message importhub.v1.CancelImportRequest.\n * Use `create(CancelImportRequestSchema)` to create a new message.\n */\nexport const CancelImportRequestSchema: GenMessage<CancelImportRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 10);\n\n/**\n * @generated from message importhub.v1.CancelImportResponse\n */\nexport type CancelImportResponse = Message<\"importhub.v1.CancelImportResponse\"> & {\n /**\n * The Import as it is now: Cancelled, or still running until the worker\n * reaches its next item.\n *\n * @generated from field: importhub.v1.Import import = 1;\n */\n import?: Import | undefined;\n};\n\n/**\n * Describes the message importhub.v1.CancelImportResponse.\n * Use `create(CancelImportResponseSchema)` to create a new message.\n */\nexport const CancelImportResponseSchema: GenMessage<CancelImportResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 11);\n\n/**\n * @generated from message importhub.v1.ListItemProblemsRequest\n */\nexport type ListItemProblemsRequest = Message<\"importhub.v1.ListItemProblemsRequest\"> & {\n /**\n * The Import whose Item Problems to list.\n *\n * @generated from field: string import_id = 1;\n */\n importId: string;\n\n /**\n * Only the Item Problems of this Mapping; empty for every Mapping.\n *\n * @generated from field: string mapping_id = 2;\n */\n mappingId: string;\n\n /**\n * Only the Item Problems whose Source Key contains this, ignoring case;\n * empty for all.\n *\n * @generated from field: string source_key_query = 3;\n */\n sourceKeyQuery: string;\n\n /**\n * At most 200; 0 means 50.\n *\n * @generated from field: int32 page_size = 4;\n */\n pageSize: number;\n\n /**\n * The next_page_token of the previous page, with the same filters; empty\n * for the first.\n *\n * @generated from field: string page_token = 5;\n */\n pageToken: string;\n};\n\n/**\n * Describes the message importhub.v1.ListItemProblemsRequest.\n * Use `create(ListItemProblemsRequestSchema)` to create a new message.\n */\nexport const ListItemProblemsRequestSchema: GenMessage<ListItemProblemsRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 12);\n\n/**\n * @generated from message importhub.v1.ListItemProblemsResponse\n */\nexport type ListItemProblemsResponse = Message<\"importhub.v1.ListItemProblemsResponse\"> & {\n /**\n * @generated from field: repeated importhub.v1.ItemProblem item_problems = 1;\n */\n itemProblems: ItemProblem[];\n\n /**\n * Every Item Problem of the Import, whatever the filters.\n *\n * @generated from field: int32 total_count = 2;\n */\n totalCount: number;\n\n /**\n * The Item Problems the filters match, on every page.\n *\n * @generated from field: int32 matching_count = 3;\n */\n matchingCount: number;\n\n /**\n * Every Mapping with Item Problems, with how many each has, whatever the\n * filters: what a filter by Mapping offers.\n *\n * @generated from field: repeated importhub.v1.ItemProblemMappingCount mappings = 4;\n */\n mappings: ItemProblemMappingCount[];\n\n /**\n * Empty on the last page.\n *\n * @generated from field: string next_page_token = 5;\n */\n nextPageToken: string;\n\n /**\n * The Item Problems of the Import that are Pending References, whatever\n * the filters; total_count counts them too.\n *\n * @generated from field: int32 pending_reference_count = 6;\n */\n pendingReferenceCount: number;\n};\n\n/**\n * Describes the message importhub.v1.ListItemProblemsResponse.\n * Use `create(ListItemProblemsResponseSchema)` to create a new message.\n */\nexport const ListItemProblemsResponseSchema: GenMessage<ListItemProblemsResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 13);\n\n/**\n * ItemProblem is one Source Version an Import could not save and skipped\n * (CONTEXT.md \"Item Problem\").\n *\n * @generated from message importhub.v1.ItemProblem\n */\nexport type ItemProblem = Message<\"importhub.v1.ItemProblem\"> & {\n /**\n * Its id, a KSUID.\n *\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * @generated from field: string import_id = 2;\n */\n importId: string;\n\n /**\n * The Mapping that read it, and its name in the Release the Import ran.\n *\n * @generated from field: string mapping_id = 3;\n */\n mappingId: string;\n\n /**\n * @generated from field: string mapping_name = 4;\n */\n mappingName: string;\n\n /**\n * The element's Source Key; empty when it has none.\n *\n * @generated from field: string source_key = 5;\n */\n sourceKey: string;\n\n /**\n * The field it is about, a /-separated path in the Content's data; empty\n * when it is about the Source Version as a whole.\n *\n * @generated from field: string field = 6;\n */\n field: string;\n\n /**\n * Why, for a person.\n *\n * @generated from field: string reason = 7;\n */\n reason: string;\n\n /**\n * @generated from field: google.protobuf.Timestamp create_time = 8;\n */\n createTime?: Timestamp | undefined;\n\n /**\n * Set when the Item Problem is a reference the Import could not resolve\n * (CONTEXT.md \"Pending Reference\"): its holder is the Content the Item\n * Problem's Mapping and Source Key read, and field is where it holds it.\n *\n * @generated from field: importhub.v1.PendingReference pending_reference = 9;\n */\n pendingReference?: PendingReference | undefined;\n};\n\n/**\n * Describes the message importhub.v1.ItemProblem.\n * Use `create(ItemProblemSchema)` to create a new message.\n */\nexport const ItemProblemSchema: GenMessage<ItemProblem> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 14);\n\n/**\n * PendingReference is a reference whose target neither existed nor was\n * covered by a Stub Mapping (ADR 0008). Its holder was saved without it;\n * importing the holder's Source File again once the target exists resolves\n * it.\n *\n * @generated from message importhub.v1.PendingReference\n */\nexport type PendingReference = Message<\"importhub.v1.PendingReference\"> & {\n /**\n * The Content that holds the reference.\n *\n * @generated from field: string holder_content_id = 1;\n */\n holderContentId: string;\n\n /**\n * What it names: the Mapping it read the target under, and a Source Key\n * among the Content Keys of that Mapping's Blueprint.\n *\n * @generated from field: string target_mapping_id = 2;\n */\n targetMappingId: string;\n\n /**\n * @generated from field: string target_blueprint_id = 3;\n */\n targetBlueprintId: string;\n\n /**\n * @generated from field: string target_source_key = 4;\n */\n targetSourceKey: string;\n};\n\n/**\n * Describes the message importhub.v1.PendingReference.\n * Use `create(PendingReferenceSchema)` to create a new message.\n */\nexport const PendingReferenceSchema: GenMessage<PendingReference> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 15);\n\n/**\n * ItemProblemMappingCount is how many Item Problems one Mapping has.\n *\n * @generated from message importhub.v1.ItemProblemMappingCount\n */\nexport type ItemProblemMappingCount = Message<\"importhub.v1.ItemProblemMappingCount\"> & {\n /**\n * @generated from field: string mapping_id = 1;\n */\n mappingId: string;\n\n /**\n * @generated from field: string mapping_name = 2;\n */\n mappingName: string;\n\n /**\n * @generated from field: int32 count = 3;\n */\n count: number;\n};\n\n/**\n * Describes the message importhub.v1.ItemProblemMappingCount.\n * Use `create(ItemProblemMappingCountSchema)` to create a new message.\n */\nexport const ItemProblemMappingCountSchema: GenMessage<ItemProblemMappingCount> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 16);\n\n/**\n * Import is one run of one Import Profile's Release over one Source File.\n *\n * @generated from message importhub.v1.Import\n */\nexport type Import = Message<\"importhub.v1.Import\"> & {\n /**\n * Its id, a KSUID. contenthub's Change Set names it as its Origin.\n *\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * The Import Profile it runs, and its name when the Import started.\n *\n * @generated from field: string import_profile_id = 2;\n */\n importProfileId: string;\n\n /**\n * @generated from field: string import_profile_name = 3;\n */\n importProfileName: string;\n\n /**\n * @generated from field: string source_file_id = 4;\n */\n sourceFileId: string;\n\n /**\n * The odon user id of the person who started it.\n *\n * @generated from field: string started_by = 5;\n */\n startedBy: string;\n\n /**\n * Where it is now.\n *\n * @generated from field: importhub.v1.ImportPhase phase = 6;\n */\n phase: ImportPhase;\n\n /**\n * How it ended; unspecified until it has.\n *\n * @generated from field: importhub.v1.ImportOutcome outcome = 7;\n */\n outcome: ImportOutcome;\n\n /**\n * Why it Failed, for a person; empty otherwise. An Import whose workers\n * crashed three times Fails naming the crashes.\n *\n * @generated from field: string failure_reason = 8;\n */\n failureReason: string;\n\n /**\n * How far the current phase is.\n *\n * @generated from field: importhub.v1.ImportProgress progress = 9;\n */\n progress?: ImportProgress | undefined;\n\n /**\n * What it has done so far.\n *\n * @generated from field: importhub.v1.ImportCounts counts = 10;\n */\n counts?: ImportCounts | undefined;\n\n /**\n * The contenthub Change Set it fills; empty until it opened one. A client\n * links to it in contenthub (follow-an-import:AC5).\n *\n * @generated from field: string change_set_id = 11;\n */\n changeSetId: string;\n\n /**\n * The exact Configuration Releases it runs with, pinned at Start.\n *\n * @generated from field: importhub.v1.ImportReleases releases = 12;\n */\n releases?: ImportReleases | undefined;\n\n /**\n * @generated from field: google.protobuf.Timestamp create_time = 13;\n */\n createTime?: Timestamp | undefined;\n\n /**\n * When a worker started it; unset while it is queued.\n *\n * @generated from field: google.protobuf.Timestamp start_time = 14;\n */\n startTime?: Timestamp | undefined;\n\n /**\n * When it ended; unset until it has.\n *\n * @generated from field: google.protobuf.Timestamp end_time = 15;\n */\n endTime?: Timestamp | undefined;\n\n /**\n * The odon user id of the person who cancelled it; empty when nobody did.\n * Set as soon as they asked: outcome says whether it has ended Cancelled.\n *\n * @generated from field: string cancelled_by = 16;\n */\n cancelledBy: string;\n\n /**\n * The effective date and Source it was started with; empty and unset\n * for none.\n *\n * @generated from field: string effective_date = 17;\n */\n effectiveDate: string;\n\n /**\n * @generated from field: importhub.v1.ImportSource source = 18;\n */\n source?: ImportSource | undefined;\n};\n\n/**\n * Describes the message importhub.v1.Import.\n * Use `create(ImportSchema)` to create a new message.\n */\nexport const ImportSchema: GenMessage<Import> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 17);\n\n/**\n * ImportProgress is how far an Import's current phase is: done of total\n * items. Both are 0 while the total is not known yet.\n *\n * @generated from message importhub.v1.ImportProgress\n */\nexport type ImportProgress = Message<\"importhub.v1.ImportProgress\"> & {\n /**\n * @generated from field: int32 done = 1;\n */\n done: number;\n\n /**\n * @generated from field: int32 total = 2;\n */\n total: number;\n};\n\n/**\n * Describes the message importhub.v1.ImportProgress.\n * Use `create(ImportProgressSchema)` to create a new message.\n */\nexport const ImportProgressSchema: GenMessage<ImportProgress> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 18);\n\n/**\n * ImportCounts are what an Import has done.\n *\n * @generated from message importhub.v1.ImportCounts\n */\nexport type ImportCounts = Message<\"importhub.v1.ImportCounts\"> & {\n /**\n * The Source Versions its Mappings matched in the Source File.\n *\n * @generated from field: int32 matched = 1;\n */\n matched: number;\n\n /**\n * The Content it created in its Change Set.\n *\n * @generated from field: int32 created = 2;\n */\n created: number;\n\n /**\n * The Item Problems it recorded: Source Versions it skipped.\n *\n * @generated from field: int32 problems = 3;\n */\n problems: number;\n\n /**\n * The new Planned Releases it gave Content that exists (ADR 0003).\n *\n * @generated from field: int32 planned = 4;\n */\n planned: number;\n\n /**\n * The Changed Versions it planned as corrections Superseding the\n * Release they matched.\n *\n * @generated from field: int32 corrected = 5;\n */\n corrected: number;\n\n /**\n * The Changed Versions it kept, as their Mapping says.\n *\n * @generated from field: int32 kept = 6;\n */\n kept: number;\n\n /**\n * The Source Versions already in contenthub, which it wrote nothing for.\n * A Stub Mapping's Source Key whose Content exists counts here: a Stub\n * Mapping never changes it.\n *\n * @generated from field: int32 unchanged = 7;\n */\n unchanged: number;\n\n /**\n * The Stubs it created for Source Keys of a Stub Mapping no Content had\n * (CONTEXT.md \"Stub Mapping\"); not counted in created.\n *\n * @generated from field: int32 stubbed = 8;\n */\n stubbed: number;\n\n /**\n * The references it could not resolve, saved without them: each is one\n * of its Item Problems too (CONTEXT.md \"Pending Reference\").\n *\n * @generated from field: int32 pending_references = 9;\n */\n pendingReferences: number;\n};\n\n/**\n * Describes the message importhub.v1.ImportCounts.\n * Use `create(ImportCountsSchema)` to create a new message.\n */\nexport const ImportCountsSchema: GenMessage<ImportCounts> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 19);\n\n/**\n * ImportReleases are the Configuration Releases an Import runs with.\n *\n * @generated from message importhub.v1.ImportReleases\n */\nexport type ImportReleases = Message<\"importhub.v1.ImportReleases\"> & {\n /**\n * @generated from field: importhub.v1.ConfigurationReleaseRef import_profile = 1;\n */\n importProfile?: ConfigurationReleaseRef | undefined;\n\n /**\n * In the Profile's order.\n *\n * @generated from field: repeated importhub.v1.ConfigurationReleaseRef mappings = 2;\n */\n mappings: ConfigurationReleaseRef[];\n\n /**\n * Unset when the Profile names no Entity Set.\n *\n * @generated from field: importhub.v1.ConfigurationReleaseRef entity_set = 3;\n */\n entitySet?: ConfigurationReleaseRef | undefined;\n};\n\n/**\n * Describes the message importhub.v1.ImportReleases.\n * Use `create(ImportReleasesSchema)` to create a new message.\n */\nexport const ImportReleasesSchema: GenMessage<ImportReleases> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 20);\n\n/**\n * ConfigurationReleaseRef names one Configuration Release.\n *\n * @generated from message importhub.v1.ConfigurationReleaseRef\n */\nexport type ConfigurationReleaseRef = Message<\"importhub.v1.ConfigurationReleaseRef\"> & {\n /**\n * The configuration's id.\n *\n * @generated from field: string configuration_id = 1;\n */\n configurationId: string;\n\n /**\n * Its name in that Release.\n *\n * @generated from field: string name = 2;\n */\n name: string;\n\n /**\n * The Release's id.\n *\n * @generated from field: string release_id = 3;\n */\n releaseId: string;\n\n /**\n * Its number among the configuration's Releases, 1 for the first.\n *\n * @generated from field: int32 number = 4;\n */\n number: number;\n};\n\n/**\n * Describes the message importhub.v1.ConfigurationReleaseRef.\n * Use `create(ConfigurationReleaseRefSchema)` to create a new message.\n */\nexport const ConfigurationReleaseRefSchema: GenMessage<ConfigurationReleaseRef> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 21);\n\n/**\n * ImportPhase is where an Import is.\n *\n * @generated from enum importhub.v1.ImportPhase\n */\nexport enum ImportPhase {\n /**\n * @generated from enum value: IMPORT_PHASE_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * Waiting for a worker.\n *\n * @generated from enum value: IMPORT_PHASE_QUEUED = 1;\n */\n QUEUED = 1,\n\n /**\n * Reading the Source File: Preprocessors, Mappings, Post-processors.\n *\n * @generated from enum value: IMPORT_PHASE_READING = 2;\n */\n READING = 2,\n\n /**\n * Writing the Change Set in contenthub.\n *\n * @generated from enum value: IMPORT_PHASE_WRITING = 3;\n */\n WRITING = 3,\n\n /**\n * Ended: outcome says how.\n *\n * @generated from enum value: IMPORT_PHASE_ENDED = 4;\n */\n ENDED = 4,\n}\n\n/**\n * Describes the enum importhub.v1.ImportPhase.\n */\nexport const ImportPhaseSchema: GenEnum<ImportPhase> = /*@__PURE__*/\n enumDesc(file_importhub_v1_import, 0);\n\n/**\n * ImportOutcome is how an Import ended (CONTEXT.md \"Import Outcome\").\n *\n * @generated from enum importhub.v1.ImportOutcome\n */\nexport enum ImportOutcome {\n /**\n * It has not ended.\n *\n * @generated from enum value: IMPORT_OUTCOME_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * Ended with no Item Problems.\n *\n * @generated from enum value: IMPORT_OUTCOME_SUCCEEDED = 1;\n */\n SUCCEEDED = 1,\n\n /**\n * Ended with Item Problems; its Change Set is kept for editors to fix.\n *\n * @generated from enum value: IMPORT_OUTCOME_SUCCEEDED_WITH_PROBLEMS = 2;\n */\n SUCCEEDED_WITH_PROBLEMS = 2,\n\n /**\n * The run as a whole stopped; failure_reason says why, and the Change\n * Set it opened is discarded.\n *\n * @generated from enum value: IMPORT_OUTCOME_FAILED = 3;\n */\n FAILED = 3,\n\n /**\n * A person stopped it; cancelled_by names them, and the Change Set it\n * opened is discarded.\n *\n * @generated from enum value: IMPORT_OUTCOME_CANCELLED = 4;\n */\n CANCELLED = 4,\n}\n\n/**\n * Describes the enum importhub.v1.ImportOutcome.\n */\nexport const ImportOutcomeSchema: GenEnum<ImportOutcome> = /*@__PURE__*/\n enumDesc(file_importhub_v1_import, 1);\n\n/**\n * ImportService runs Imports: one Import Profile's Release over one Source\n * File, filling exactly one contenthub Change Set (CONTEXT.md \"Import\", ADR\n * 0001).\n *\n * A person uploads the Source File straight into importhub's own blob store\n * with the URL CreateSourceFileUpload hands out, then starts the Import with\n * StartImport. Start pins the latest Configuration Release of the Profile, of\n * every Mapping it includes and of its Entity Set (ADR 0016), and queues the\n * Import; a `worker` claims it from the queue and runs it (ADR 0004).\n *\n * Every RPC acts on the caller's workspace, which comes from the token's\n * active workspace and never from a request field. Uploading, starting and\n * cancelling need `importer`; reading needs `viewer` (ADR 0010, control-who-may-import).\n *\n * @generated from service importhub.v1.ImportService\n */\nexport const ImportService: GenService<{\n /**\n * CreateSourceFileUpload makes a Source File and returns the URL to upload\n * its content to: a direct, write-only, short-lived URL into importhub's\n * blob container (a SAS URL), so a large file never passes through\n * importhub. Upload it with one `PUT` carrying `x-ms-blob-type:\n * BlockBlob`.\n *\n * @generated from rpc importhub.v1.ImportService.CreateSourceFileUpload\n */\n createSourceFileUpload: {\n methodKind: \"unary\";\n input: typeof CreateSourceFileUploadRequestSchema;\n output: typeof CreateSourceFileUploadResponseSchema;\n },\n /**\n * StartImport queues an Import of a Source File with an Import Profile.\n *\n * It is refused with FailedPrecondition, naming what stands in the way,\n * when the Profile, a Mapping it includes or its Entity Set has no\n * Release, or when what an Import would run of one is invalid now (a\n * Mapping whose Blueprint is gone, say): drafts are never run\n * (release-a-configuration:AC2, AC5). An unknown Profile or Source File is\n * NotFound, and a Source File nothing was uploaded to is FailedPrecondition.\n *\n * @generated from rpc importhub.v1.ImportService.StartImport\n */\n startImport: {\n methodKind: \"unary\";\n input: typeof StartImportRequestSchema;\n output: typeof StartImportResponseSchema;\n },\n /**\n * ListImports returns the workspace's Imports, newest first, each with its\n * Profile, its starter, its Outcome and its counts (follow-an-import:AC1).\n *\n * @generated from rpc importhub.v1.ImportService.ListImports\n */\n listImports: {\n methodKind: \"unary\";\n input: typeof ListImportsRequestSchema;\n output: typeof ListImportsResponseSchema;\n },\n /**\n * GetImport returns one Import with its phase and progress, its Change Set\n * and the exact Releases it runs with (follow-an-import:AC2, AC5,\n * release-a-configuration:AC8).\n *\n * @generated from rpc importhub.v1.ImportService.GetImport\n */\n getImport: {\n methodKind: \"unary\";\n input: typeof GetImportRequestSchema;\n output: typeof GetImportResponseSchema;\n },\n /**\n * CancelImport cancels an Import that has not ended (follow-an-import:AC6).\n * A queued Import ends Cancelled at once. A running one stops at its next\n * item: the worker discards the Change Set it opened and ends it Cancelled,\n * so the Import returned may still be running. Either way the Import names\n * the caller as who cancelled it. An Import that has ended is\n * FailedPrecondition; cancelling one already being cancelled changes\n * nothing.\n *\n * @generated from rpc importhub.v1.ImportService.CancelImport\n */\n cancelImport: {\n methodKind: \"unary\";\n input: typeof CancelImportRequestSchema;\n output: typeof CancelImportResponseSchema;\n },\n /**\n * ListItemProblems returns one page of an Import's Item Problems, in the\n * order they were recorded, filtered by Mapping and searched by Source Key,\n * with their counts (follow-an-import:AC4). A Pending Reference is one of\n * them, carrying what it names.\n *\n * @generated from rpc importhub.v1.ImportService.ListItemProblems\n */\n listItemProblems: {\n methodKind: \"unary\";\n input: typeof ListItemProblemsRequestSchema;\n output: typeof ListItemProblemsResponseSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_importhub_v1_import, 0);\n\n","// @generated by protoc-gen-es v2.13.0 with parameter \"target=ts\"\n// @generated from file importhub/v1/import_profile.proto (package importhub.v1, syntax proto3)\n/* eslint-disable */\n\nimport type { GenFile, GenMessage, GenService } from \"@bufbuild/protobuf/codegenv2\";\nimport { fileDesc, messageDesc, serviceDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport type { Timestamp } from \"@bufbuild/protobuf/wkt\";\nimport { file_google_protobuf_struct, file_google_protobuf_timestamp } from \"@bufbuild/protobuf/wkt\";\nimport type { ConfigurationRelease, ConfigurationRevision, ConfigurationState, FieldComparison, Validity } from \"./configuration_pb\";\nimport { file_importhub_v1_configuration } from \"./configuration_pb\";\nimport type { JsonObject, Message } from \"@bufbuild/protobuf\";\n\n/**\n * Describes the file importhub/v1/import_profile.proto.\n */\nexport const file_importhub_v1_import_profile: GenFile = /*@__PURE__*/\n fileDesc(\"CiFpbXBvcnRodWIvdjEvaW1wb3J0X3Byb2ZpbGUucHJvdG8SDGltcG9ydGh1Yi52MSKiAgoNSW1wb3J0UHJvZmlsZRIKCgJpZBgBIAEoCRITCgtyZXZpc2lvbl9pZBgCIAEoCRIzCgdjb250ZW50GAMgASgLMiIuaW1wb3J0aHViLnYxLkltcG9ydFByb2ZpbGVDb250ZW50EigKCHZhbGlkaXR5GAQgASgLMhYuaW1wb3J0aHViLnYxLlZhbGlkaXR5Ei8KBXN0YXRlGAUgASgLMiAuaW1wb3J0aHViLnYxLkNvbmZpZ3VyYXRpb25TdGF0ZRIuCgpjcmVhdGVkX2F0GAYgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcBIwChBjdXJyZW50X3ZhbGlkaXR5GAcgASgLMhYuaW1wb3J0aHViLnYxLlZhbGlkaXR5IowCChRJbXBvcnRQcm9maWxlQ29udGVudBIMCgRuYW1lGAEgASgJEhMKC2Rlc2NyaXB0aW9uGAIgASgJEhUKDWVudGl0eV9zZXRfaWQYAyABKAkSMgoNcHJlcHJvY2Vzc29ycxgEIAMoCzIbLmltcG9ydGh1Yi52MS5Qcm9jZXNzb3JTdGVwEhMKC21hcHBpbmdfaWRzGAUgAygJEjQKD3Bvc3RfcHJvY2Vzc29ycxgGIAMoCzIbLmltcG9ydGh1Yi52MS5Qcm9jZXNzb3JTdGVwEhQKDGF1dG9fcHVibGlzaBgHIAEoCBIlCh1kZWxldGVfc291cmNlX2ZpbGVfb25fc3VjY2VzcxgIIAEoCCJNCg1Qcm9jZXNzb3JTdGVwEhEKCXByb2Nlc3NvchgBIAEoCRIpCghzZXR0aW5ncxgCIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3QiGwoZTGlzdEltcG9ydFBy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0b3J5UmVzcG9uc2USiAEKHUNvbXBhcmVJbXBvcnRQcm9maWxlUmV2aXNpb25zEjIuaW1wb3J0aHViLnYxLkNvbXBhcmVJbXBvcnRQcm9maWxlUmV2aXNpb25zUmVxdWVzdBozLmltcG9ydGh1Yi52MS5Db21wYXJlSW1wb3J0UHJvZmlsZVJldmlzaW9uc1Jlc3BvbnNlEoUBChxSZXN0b3JlSW1wb3J0UHJvZmlsZVJldmlzaW9uEjEuaW1wb3J0aHViLnYxLlJlc3RvcmVJbXBvcnRQcm9maWxlUmV2aXNpb25SZXF1ZXN0GjIuaW1wb3J0aHViLnYxLlJlc3RvcmVJbXBvcnRQcm9maWxlUmV2aXNpb25SZXNwb25zZUI5WjdnaXRodWIuY29tL2tua2NzL2ltcG9ydGh1Yi9nZW4vaW1wb3J0aHViL3YxO2ltcG9ydGh1YnYxYgZwcm90bzM\", [file_google_protobuf_struct, file_google_protobuf_timestamp, file_importhub_v1_configuration]);\n\n/**\n * ImportProfile is one Import Profile, at one of its Revisions.\n *\n * @generated from message importhub.v1.ImportProfile\n */\nexport type ImportProfile = Message<\"importhub.v1.ImportProfile\"> & {\n /**\n * The Import Profile's id, a KSUID.\n *\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * The Revision this content is from: the draft, unless an older one was\n * asked for.\n *\n * @generated from field: string revision_id = 2;\n */\n revisionId: string;\n\n /**\n * The content at that Revision.\n *\n * @generated from field: importhub.v1.ImportProfileContent content = 3;\n */\n content?: ImportProfileContent | undefined;\n\n /**\n * Whether that Revision may be released, as decided when it was saved.\n *\n * @generated from field: importhub.v1.Validity validity = 4;\n */\n validity?: Validity | undefined;\n\n /**\n * Where the Profile stands: its draft and latest Release.\n *\n * @generated from field: importhub.v1.ConfigurationState state = 5;\n */\n state?: ConfigurationState | undefined;\n\n /**\n * When the Profile was created.\n *\n * @generated from field: google.protobuf.Timestamp created_at = 6;\n */\n createdAt?: Timestamp | undefined;\n\n /**\n * Whether the draft can be released now: its validity as saved, plus\n * what changed since without the Profile being saved, such as a Mapping\n * it includes becoming invalid (manage-import-profiles:AC6).\n *\n * @generated from field: importhub.v1.Validity current_validity = 7;\n */\n currentValidity?: Validity | undefined;\n};\n\n/**\n * Describes the message importhub.v1.ImportProfile.\n * Use `create(ImportProfileSchema)` to create a new message.\n */\nexport const ImportProfileSchema: GenMessage<ImportProfile> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 0);\n\n/**\n * ImportProfileContent is what an admin edits, and what a Revision holds.\n *\n * @generated from message importhub.v1.ImportProfileContent\n */\nexport type ImportProfileContent = Message<\"importhub.v1.ImportProfileContent\"> & {\n /**\n * The Profile's name, unique in the workspace.\n *\n * @generated from field: string name = 1;\n */\n name: string;\n\n /**\n * What the Profile is for; free text.\n *\n * @generated from field: string description = 2;\n */\n description: string;\n\n /**\n * The id of the Entity Set the Source File is read with; empty for none.\n *\n * @generated from field: string entity_set_id = 3;\n */\n entitySetId: string;\n\n /**\n * The Preprocessors, in the order they run on the Source File.\n *\n * @generated from field: repeated importhub.v1.ProcessorStep preprocessors = 4;\n */\n preprocessors: ProcessorStep[];\n\n /**\n * The ids of the Mappings it includes, in the order they run.\n *\n * @generated from field: repeated string mapping_ids = 5;\n */\n mappingIds: string[];\n\n /**\n * The Post-processors, in the order they run on the mapped Source\n * Versions.\n *\n * @generated from field: repeated importhub.v1.ProcessorStep post_processors = 6;\n */\n postProcessors: ProcessorStep[];\n\n /**\n * Publish the Change Set of an Import that Succeeds without Item\n * Problems (CONTEXT.md \"Auto-publish\").\n *\n * @generated from field: bool auto_publish = 7;\n */\n autoPublish: boolean;\n\n /**\n * Delete the Source File as soon as an Import Succeeds without Item\n * Problems, instead of after the retention period.\n *\n * @generated from field: bool delete_source_file_on_success = 8;\n */\n deleteSourceFileOnSuccess: boolean;\n};\n\n/**\n * Describes the message importhub.v1.ImportProfileContent.\n * Use `create(ImportProfileContentSchema)` to create a new message.\n */\nexport const ImportProfileContentSchema: GenMessage<ImportProfileContent> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 1);\n\n/**\n * ProcessorStep is one Processor in a Profile's pipeline, with its settings.\n *\n * @generated from message importhub.v1.ProcessorStep\n */\nexport type ProcessorStep = Message<\"importhub.v1.ProcessorStep\"> & {\n /**\n * The Processor, by its name in the catalogue.\n *\n * @generated from field: string processor = 1;\n */\n processor: string;\n\n /**\n * Its settings: one value per setting of its settings spec, by the\n * setting's `api_accessor`.\n *\n * @generated from field: google.protobuf.Struct settings = 2;\n */\n settings?: JsonObject | undefined;\n};\n\n/**\n * Describes the message importhub.v1.ProcessorStep.\n * Use `create(ProcessorStepSchema)` to create a new message.\n */\nexport const ProcessorStepSchema: GenMessage<ProcessorStep> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 2);\n\n/**\n * @generated from message importhub.v1.ListImportProfilesRequest\n */\nexport type ListImportProfilesRequest = Message<\"importhub.v1.ListImportProfilesRequest\"> & {\n};\n\n/**\n * Describes the message importhub.v1.ListImportProfilesRequest.\n * Use `create(ListImportProfilesRequestSchema)` to create a new message.\n */\nexport const ListImportProfilesRequestSchema: GenMessage<ListImportProfilesRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 3);\n\n/**\n * @generated from message importhub.v1.ListImportProfilesResponse\n */\nexport type ListImportProfilesResponse = Message<\"importhub.v1.ListImportProfilesResponse\"> & {\n /**\n * @generated from field: repeated importhub.v1.ImportProfile import_profiles = 1;\n */\n importProfiles: ImportProfile[];\n};\n\n/**\n * Describes the message importhub.v1.ListImportProfilesResponse.\n * Use `create(ListImportProfilesResponseSchema)` to create a new message.\n */\nexport const ListImportProfilesResponseSchema: GenMessage<ListImportProfilesResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 4);\n\n/**\n * @generated from message importhub.v1.GetImportProfileRequest\n */\nexport type GetImportProfileRequest = Message<\"importhub.v1.GetImportProfileRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * An older Revision to read the content of; empty for the draft.\n *\n * @generated from field: string revision_id = 2;\n */\n revisionId: string;\n};\n\n/**\n * Describes the message importhub.v1.GetImportProfileRequest.\n * Use `create(GetImportProfileRequestSchema)` to create a new message.\n */\nexport const GetImportProfileRequestSchema: GenMessage<GetImportProfileRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 5);\n\n/**\n * @generated from message importhub.v1.GetImportProfileResponse\n */\nexport type GetImportProfileResponse = Message<\"importhub.v1.GetImportProfileResponse\"> & {\n /**\n * @generated from field: importhub.v1.ImportProfile import_profile = 1;\n */\n importProfile?: ImportProfile | undefined;\n};\n\n/**\n * Describes the message importhub.v1.GetImportProfileResponse.\n * Use `create(GetImportProfileResponseSchema)` to create a new message.\n */\nexport const GetImportProfileResponseSchema: GenMessage<GetImportProfileResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 6);\n\n/**\n * @generated from message importhub.v1.CreateImportProfileRequest\n */\nexport type CreateImportProfileRequest = Message<\"importhub.v1.CreateImportProfileRequest\"> & {\n /**\n * @generated from field: importhub.v1.ImportProfileContent content = 1;\n */\n content?: ImportProfileContent | undefined;\n};\n\n/**\n * Describes the message importhub.v1.CreateImportProfileRequest.\n * Use `create(CreateImportProfileRequestSchema)` to create a new message.\n */\nexport const CreateImportProfileRequestSchema: GenMessage<CreateImportProfileRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 7);\n\n/**\n * @generated from message importhub.v1.CreateImportProfileResponse\n */\nexport type CreateImportProfileResponse = Message<\"importhub.v1.CreateImportProfileResponse\"> & {\n /**\n * @generated from field: importhub.v1.ImportProfile import_profile = 1;\n */\n importProfile?: ImportProfile | undefined;\n};\n\n/**\n * Describes the message importhub.v1.CreateImportProfileResponse.\n * Use `create(CreateImportProfileResponseSchema)` to create a new message.\n */\nexport const CreateImportProfileResponseSchema: GenMessage<CreateImportProfileResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 8);\n\n/**\n * @generated from message importhub.v1.UpdateImportProfileRequest\n */\nexport type UpdateImportProfileRequest = Message<\"importhub.v1.UpdateImportProfileRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * The whole new content; it replaces the draft's.\n *\n * @generated from field: importhub.v1.ImportProfileContent content = 2;\n */\n content?: ImportProfileContent | undefined;\n\n /**\n * The draft this edit was made on. Given, the save is refused if the\n * draft has moved since; empty, it saves on whatever the draft is.\n *\n * @generated from field: string draft_revision_id = 3;\n */\n draftRevisionId: string;\n};\n\n/**\n * Describes the message importhub.v1.UpdateImportProfileRequest.\n * Use `create(UpdateImportProfileRequestSchema)` to create a new message.\n */\nexport const UpdateImportProfileRequestSchema: GenMessage<UpdateImportProfileRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 9);\n\n/**\n * @generated from message importhub.v1.UpdateImportProfileResponse\n */\nexport type UpdateImportProfileResponse = Message<\"importhub.v1.UpdateImportProfileResponse\"> & {\n /**\n * @generated from field: importhub.v1.ImportProfile import_profile = 1;\n */\n importProfile?: ImportProfile | undefined;\n};\n\n/**\n * Describes the message importhub.v1.UpdateImportProfileResponse.\n * Use `create(UpdateImportProfileResponseSchema)` to create a new message.\n */\nexport const UpdateImportProfileResponseSchema: GenMessage<UpdateImportProfileResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 10);\n\n/**\n * @generated from message importhub.v1.DeleteImportProfileRequest\n */\nexport type DeleteImportProfileRequest = Message<\"importhub.v1.DeleteImportProfileRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n};\n\n/**\n * Describes the message importhub.v1.DeleteImportProfileRequest.\n * Use `create(DeleteImportProfileRequestSchema)` to create a new message.\n */\nexport const DeleteImportProfileRequestSchema: GenMessage<DeleteImportProfileRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 11);\n\n/**\n * @generated from message importhub.v1.DeleteImportProfileResponse\n */\nexport type DeleteImportProfileResponse = Message<\"importhub.v1.DeleteImportProfileResponse\"> & {\n};\n\n/**\n * Describes the message importhub.v1.DeleteImportProfileResponse.\n * Use `create(DeleteImportProfileResponseSchema)` to create a new message.\n */\nexport const DeleteImportProfileResponseSchema: GenMessage<DeleteImportProfileResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 12);\n\n/**\n * @generated from message importhub.v1.CutImportProfileReleaseRequest\n */\nexport type CutImportProfileReleaseRequest = Message<\"importhub.v1.CutImportProfileReleaseRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * The draft the admin is releasing. Given, the cut is refused if the\n * draft has moved since.\n *\n * @generated from field: string draft_revision_id = 2;\n */\n draftRevisionId: string;\n};\n\n/**\n * Describes the message importhub.v1.CutImportProfileReleaseRequest.\n * Use `create(CutImportProfileReleaseRequestSchema)` to create a new message.\n */\nexport const CutImportProfileReleaseRequestSchema: GenMessage<CutImportProfileReleaseRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 13);\n\n/**\n * @generated from message importhub.v1.CutImportProfileReleaseResponse\n */\nexport type CutImportProfileReleaseResponse = Message<\"importhub.v1.CutImportProfileReleaseResponse\"> & {\n /**\n * The Release cut.\n *\n * @generated from field: importhub.v1.ConfigurationRelease release = 1;\n */\n release?: ConfigurationRelease | undefined;\n\n /**\n * The Profile after the cut.\n *\n * @generated from field: importhub.v1.ImportProfile import_profile = 2;\n */\n importProfile?: ImportProfile | undefined;\n};\n\n/**\n * Describes the message importhub.v1.CutImportProfileReleaseResponse.\n * Use `create(CutImportProfileReleaseResponseSchema)` to create a new message.\n */\nexport const CutImportProfileReleaseResponseSchema: GenMessage<CutImportProfileReleaseResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 14);\n\n/**\n * @generated from message importhub.v1.ListImportProfileHistoryRequest\n */\nexport type ListImportProfileHistoryRequest = Message<\"importhub.v1.ListImportProfileHistoryRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * Revisions per page; 0 means 100, and at most 1000.\n *\n * @generated from field: int32 page_size = 2;\n */\n pageSize: number;\n\n /**\n * The next_page_token of the previous page; empty for the first.\n *\n * @generated from field: string page_token = 3;\n */\n pageToken: string;\n};\n\n/**\n * Describes the message importhub.v1.ListImportProfileHistoryRequest.\n * Use `create(ListImportProfileHistoryRequestSchema)` to create a new message.\n */\nexport const ListImportProfileHistoryRequestSchema: GenMessage<ListImportProfileHistoryRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 15);\n\n/**\n * @generated from message importhub.v1.ListImportProfileHistoryResponse\n */\nexport type ListImportProfileHistoryResponse = Message<\"importhub.v1.ListImportProfileHistoryResponse\"> & {\n /**\n * One page of Revisions, newest first.\n *\n * @generated from field: repeated importhub.v1.ConfigurationRevision revisions = 1;\n */\n revisions: ConfigurationRevision[];\n\n /**\n * Every Release, newest first, on every page.\n *\n * @generated from field: repeated importhub.v1.ConfigurationRelease releases = 2;\n */\n releases: ConfigurationRelease[];\n\n /**\n * The page_token of the next page; empty on the last.\n *\n * @generated from field: string next_page_token = 3;\n */\n nextPageToken: string;\n};\n\n/**\n * Describes the message importhub.v1.ListImportProfileHistoryResponse.\n * Use `create(ListImportProfileHistoryResponseSchema)` to create a new message.\n */\nexport const ListImportProfileHistoryResponseSchema: GenMessage<ListImportProfileHistoryResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 16);\n\n/**\n * @generated from message importhub.v1.CompareImportProfileRevisionsRequest\n */\nexport type CompareImportProfileRevisionsRequest = Message<\"importhub.v1.CompareImportProfileRevisionsRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * @generated from field: string from_revision_id = 2;\n */\n fromRevisionId: string;\n\n /**\n * @generated from field: string to_revision_id = 3;\n */\n toRevisionId: string;\n};\n\n/**\n * Describes the message importhub.v1.CompareImportProfileRevisionsRequest.\n * Use `create(CompareImportProfileRevisionsRequestSchema)` to create a new message.\n */\nexport const CompareImportProfileRevisionsRequestSchema: GenMessage<CompareImportProfileRevisionsRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 17);\n\n/**\n * @generated from message importhub.v1.CompareImportProfileRevisionsResponse\n */\nexport type CompareImportProfileRevisionsResponse = Message<\"importhub.v1.CompareImportProfileRevisionsResponse\"> & {\n /**\n * @generated from field: importhub.v1.ImportProfile from = 1;\n */\n from?: ImportProfile | undefined;\n\n /**\n * @generated from field: importhub.v1.ImportProfile to = 2;\n */\n to?: ImportProfile | undefined;\n\n /**\n * Each field, and how it differs from `from` to `to`.\n *\n * @generated from field: repeated importhub.v1.FieldComparison fields = 3;\n */\n fields: FieldComparison[];\n};\n\n/**\n * Describes the message importhub.v1.CompareImportProfileRevisionsResponse.\n * Use `create(CompareImportProfileRevisionsResponseSchema)` to create a new message.\n */\nexport const CompareImportProfileRevisionsResponseSchema: GenMessage<CompareImportProfileRevisionsResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 18);\n\n/**\n * @generated from message importhub.v1.RestoreImportProfileRevisionRequest\n */\nexport type RestoreImportProfileRevisionRequest = Message<\"importhub.v1.RestoreImportProfileRevisionRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * The older Revision whose content becomes the new draft.\n *\n * @generated from field: string revision_id = 2;\n */\n revisionId: string;\n\n /**\n * As UpdateImportProfileRequest's.\n *\n * @generated from field: string draft_revision_id = 3;\n */\n draftRevisionId: string;\n};\n\n/**\n * Describes the message importhub.v1.RestoreImportProfileRevisionRequest.\n * Use `create(RestoreImportProfileRevisionRequestSchema)` to create a new message.\n */\nexport const RestoreImportProfileRevisionRequestSchema: GenMessage<RestoreImportProfileRevisionRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 19);\n\n/**\n * @generated from message importhub.v1.RestoreImportProfileRevisionResponse\n */\nexport type RestoreImportProfileRevisionResponse = Message<\"importhub.v1.RestoreImportProfileRevisionResponse\"> & {\n /**\n * @generated from field: importhub.v1.ImportProfile import_profile = 1;\n */\n importProfile?: ImportProfile | undefined;\n};\n\n/**\n * Describes the message importhub.v1.RestoreImportProfileRevisionResponse.\n * Use `create(RestoreImportProfileRevisionResponseSchema)` to create a new message.\n */\nexport const RestoreImportProfileRevisionResponseSchema: GenMessage<RestoreImportProfileRevisionResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 20);\n\n/**\n * ImportProfileService holds the workspace's Import Profiles: the named\n * recipes an Import runs, one per kind of Source File (CONTEXT.md,\n * manage-import-profiles). A Profile names at most one Entity Set, its\n * Preprocessors, the Mappings it includes and its Post-processors, in order,\n * and what happens to the result.\n *\n * An Import Profile is versioned configuration (ADR 0016): every create,\n * update and restore saves a draft Revision, and an admin cuts a\n * Configuration Release from a valid draft. A Profile names its Mappings and\n * its Entity Set by id, not their Releases: an Import takes the latest\n * Release of each when it starts.\n *\n * Every RPC acts on the caller's workspace, which comes from the token's\n * active workspace and never from a request field. Reads need `viewer`;\n * every write needs `admin` (ADR 0010, control-who-may-import:AC3).\n *\n * The validity reason codes of an Import Profile, decided when it is saved:\n *\n * - `unknown_processor`: a step names a Processor the catalogue does not\n * list (ProcessorService).\n * - `wrong_processor_kind`: a Post-processor listed among the\n * Preprocessors, or the other way round.\n * - `rich_text_processor`: a Processor that works on one rich-text field,\n * which a Mapping's field configures, listed on the Profile.\n * - `invalid_processor_settings`: a setting the Processor does not take, a\n * required one left out, or a value of the wrong type.\n * - `no_mappings`: it includes no Mapping.\n * - `duplicate_mapping`: it includes one Mapping twice.\n * - `mapping_missing`: it includes a Mapping that does not exist.\n * - `entity_set_missing`: it names an Entity Set that does not exist.\n *\n * And the ones current_validity adds, decided at each read and when a Release\n * is cut, since they change without the Profile being saved\n * (manage-import-profiles:AC6):\n *\n * - `mapping_invalid`: what an Import would run of a Mapping it includes\n * is invalid now: its latest Release, when its Blueprint is gone, or,\n * while it has no Release, its draft. The message names the Mapping and\n * its reasons.\n * - `entity_set_invalid`: the Entity Set it names has no Release and an\n * invalid draft (a Release was valid when cut).\n * - `mapping_missing`, `entity_set_missing`, as above, once deleted.\n *\n * @generated from service importhub.v1.ImportProfileService\n */\nexport const ImportProfileService: GenService<{\n /**\n * ListImportProfiles returns every Import Profile of the workspace, by\n * name, each with its draft, its latest Release and whether it is valid\n * now. A workspace keeps a handful, so the list is not paged.\n *\n * @generated from rpc importhub.v1.ImportProfileService.ListImportProfiles\n */\n listImportProfiles: {\n methodKind: \"unary\";\n input: typeof ListImportProfilesRequestSchema;\n output: typeof ListImportProfilesResponseSchema;\n },\n /**\n * GetImportProfile returns one Import Profile with its draft, or with an\n * older Revision of it when one is named.\n *\n * @generated from rpc importhub.v1.ImportProfileService.GetImportProfile\n */\n getImportProfile: {\n methodKind: \"unary\";\n input: typeof GetImportProfileRequestSchema;\n output: typeof GetImportProfileResponseSchema;\n },\n /**\n * CreateImportProfile creates an Import Profile, its content the first\n * draft. Invalid settings are saved and marked invalid with their\n * reasons; a missing name, or one another Profile of the workspace has,\n * is refused (InvalidArgument, AlreadyExists).\n *\n * @generated from rpc importhub.v1.ImportProfileService.CreateImportProfile\n */\n createImportProfile: {\n methodKind: \"unary\";\n input: typeof CreateImportProfileRequestSchema;\n output: typeof CreateImportProfileResponseSchema;\n },\n /**\n * UpdateImportProfile saves new content as a new draft Revision. It is\n * refused with FailedPrecondition when draft_revision_id is given and is\n * no longer the draft.\n *\n * @generated from rpc importhub.v1.ImportProfileService.UpdateImportProfile\n */\n updateImportProfile: {\n methodKind: \"unary\";\n input: typeof UpdateImportProfileRequestSchema;\n output: typeof UpdateImportProfileResponseSchema;\n },\n /**\n * DeleteImportProfile deletes an Import Profile; it no longer appears in\n * the list, and its name is free again.\n *\n * @generated from rpc importhub.v1.ImportProfileService.DeleteImportProfile\n */\n deleteImportProfile: {\n methodKind: \"unary\";\n input: typeof DeleteImportProfileRequestSchema;\n output: typeof DeleteImportProfileResponseSchema;\n },\n /**\n * CutImportProfileRelease cuts a Configuration Release from the draft. It\n * is refused with FailedPrecondition, the Validity as a detail, when the\n * draft is not valid now (current_validity: an included Mapping that is\n * invalid refuses it too), when the draft does not differ from the latest\n * Release, or when draft_revision_id is given and is no longer the draft.\n *\n * @generated from rpc importhub.v1.ImportProfileService.CutImportProfileRelease\n */\n cutImportProfileRelease: {\n methodKind: \"unary\";\n input: typeof CutImportProfileReleaseRequestSchema;\n output: typeof CutImportProfileReleaseResponseSchema;\n },\n /**\n * ListImportProfileHistory lists an Import Profile's Revisions, newest\n * first and paged, and all its Releases (release-a-configuration:AC6).\n *\n * @generated from rpc importhub.v1.ImportProfileService.ListImportProfileHistory\n */\n listImportProfileHistory: {\n methodKind: \"unary\";\n input: typeof ListImportProfileHistoryRequestSchema;\n output: typeof ListImportProfileHistoryResponseSchema;\n },\n /**\n * CompareImportProfileRevisions compares two Revisions of one Import\n * Profile: both contents, and how each field differs.\n *\n * @generated from rpc importhub.v1.ImportProfileService.CompareImportProfileRevisions\n */\n compareImportProfileRevisions: {\n methodKind: \"unary\";\n input: typeof CompareImportProfileRevisionsRequestSchema;\n output: typeof CompareImportProfileRevisionsResponseSchema;\n },\n /**\n * RestoreImportProfileRevision saves an older Revision's content as a new\n * draft (release-a-configuration:AC7), its validity decided anew.\n *\n * @generated from rpc importhub.v1.ImportProfileService.RestoreImportProfileRevision\n */\n restoreImportProfileRevision: {\n methodKind: \"unary\";\n input: typeof RestoreImportProfileRevisionRequestSchema;\n output: typeof RestoreImportProfileRevisionResponseSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_importhub_v1_import_profile, 0);\n\n","// @generated by protoc-gen-es v2.13.0 with parameter \"target=ts\"\n// @generated from file importhub/v1/mapping.proto (package importhub.v1, syntax proto3)\n/* eslint-disable */\n\nimport type { GenEnum, GenFile, GenMessage, GenService } from \"@bufbuild/protobuf/codegenv2\";\nimport { enumDesc, fileDesc, messageDesc, serviceDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport type { Timestamp } from \"@bufbuild/protobuf/wkt\";\nimport { file_google_protobuf_struct, file_google_protobuf_timestamp } from \"@bufbuild/protobuf/wkt\";\nimport type { ConfigurationRelease, ConfigurationRevision, ConfigurationState, FieldComparison, ImportProfileRef, Validity } from \"./configuration_pb\";\nimport { file_importhub_v1_configuration } from \"./configuration_pb\";\nimport type { JsonObject, Message } from \"@bufbuild/protobuf\";\n\n/**\n * Describes the file importhub/v1/mapping.proto.\n */\nexport const file_importhub_v1_mapping: GenFile = /*@__PURE__*/\n fileDesc(\"ChppbXBvcnRodWIvdjEvbWFwcGluZy5wcm90bxIMaW1wb3J0aHViLnYxIpYCCgdNYXBwaW5nEgoKAmlkGAEgASgJEhMKC3JldmlzaW9uX2lkGAIgASgJEi0KB2NvbnRlbnQYAyABKAsyHC5pbXBvcnRodWIudjEuTWFwcGluZ0NvbnRlbnQSKAoIdmFsaWRpdHkYBCABKAsyFi5pbXBvcnRodWIudjEuVmFsaWRpdHkSLwoFc3RhdGUYBSABKAsyIC5pbXBvcnRodWIudjEuQ29uZmlndXJhdGlvblN0YXRlEi4KCmNyZWF0ZWRfYXQYBiABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEjAKEGN1cnJlbnRfdmFsaWRpdHkYByABKAsyFi5pbXBvcnRodWIudjEuVmFsaWRpdHkitwUKDk1hcHBpbmdDb250ZW50EgwKBG5hbWUYASABKAkSEwoLZGVzY3JpcHRpb24YAiABKAkSFAoMYmx1ZXByaW50X2lkGAMgASgJEhwKFGJsdWVwcmludF9yZWxlYXNlX2lkGAQgASgJEhgKEGVsZW1lbnRfc2VsZWN0b3IYBSABKAkSKwoKc291cmNlX2tleRgGIAEoCzIXLmltcG9ydGh1Yi52MS5Tb3VyY2VLZXkSJwoGZmllbGRzGAcgAygLMhcuZ29vZ2xlLnByb3RvYnVmLlN0cnVjdBIxCg12ZXJzaW9uX21hdGNoGAggASgLMhouaW1wb3J0aHViLnYxLlZlcnNpb25NYXRjaBI7Cg92YWxpZGl0eV9wZXJpb2QYCSABKA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xlc1Jlc3BvbnNlEoUBChxDaGVja01hcHBpbmdCbHVlcHJpbnRSZWxlYXNlEjEuaW1wb3J0aHViLnYxLkNoZWNrTWFwcGluZ0JsdWVwcmludFJlbGVhc2VSZXF1ZXN0GjIuaW1wb3J0aHViLnYxLkNoZWNrTWFwcGluZ0JsdWVwcmludFJlbGVhc2VSZXNwb25zZUI5WjdnaXRodWIuY29tL2tua2NzL2ltcG9ydGh1Yi9nZW4vaW1wb3J0aHViL3YxO2ltcG9ydGh1YnYxYgZwcm90bzM\", [file_google_protobuf_struct, file_google_protobuf_timestamp, file_importhub_v1_configuration]);\n\n/**\n * Mapping is one Mapping, at one of its Revisions.\n *\n * @generated from message importhub.v1.Mapping\n */\nexport type Mapping = Message<\"importhub.v1.Mapping\"> & {\n /**\n * The Mapping's id, a KSUID.\n *\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * The Revision this content is from: the draft, unless an older one was\n * asked for.\n *\n * @generated from field: string revision_id = 2;\n */\n revisionId: string;\n\n /**\n * The content at that Revision.\n *\n * @generated from field: importhub.v1.MappingContent content = 3;\n */\n content?: MappingContent | undefined;\n\n /**\n * Whether that Revision may be released, as decided when it was saved.\n *\n * @generated from field: importhub.v1.Validity validity = 4;\n */\n validity?: Validity | undefined;\n\n /**\n * Where the Mapping stands: its draft and latest Release.\n *\n * @generated from field: importhub.v1.ConfigurationState state = 5;\n */\n state?: ConfigurationState | undefined;\n\n /**\n * When the Mapping was created.\n *\n * @generated from field: google.protobuf.Timestamp created_at = 6;\n */\n createdAt?: Timestamp | undefined;\n\n /**\n * Whether the draft can be released now: its validity as saved, plus\n * `blueprint_gone` when blueprinthub no longer knows a Release the draft\n * or the latest Release pins (manage-mappings:AC7).\n *\n * @generated from field: importhub.v1.Validity current_validity = 7;\n */\n currentValidity?: Validity | undefined;\n};\n\n/**\n * Describes the message importhub.v1.Mapping.\n * Use `create(MappingSchema)` to create a new message.\n */\nexport const MappingSchema: GenMessage<Mapping> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 0);\n\n/**\n * MappingContent is what an admin edits, and what a Revision holds. Every\n * setting is defined here, including those whose behaviour later Tasks\n * build, so the structured editor is built against one shape.\n *\n * @generated from message importhub.v1.MappingContent\n */\nexport type MappingContent = Message<\"importhub.v1.MappingContent\"> & {\n /**\n * The Mapping's name, unique in the workspace.\n *\n * @generated from field: string name = 1;\n */\n name: string;\n\n /**\n * What the Mapping is for; free text.\n *\n * @generated from field: string description = 2;\n */\n description: string;\n\n /**\n * The target Blueprint in blueprinthub.\n *\n * @generated from field: string blueprint_id = 3;\n */\n blueprintId: string;\n\n /**\n * The Blueprint Release it pins, a Release of blueprint_id. Every Import\n * creates Content on exactly this Release (ADR 0002).\n *\n * @generated from field: string blueprint_release_id = 4;\n */\n blueprintReleaseId: string;\n\n /**\n * The XPath selecting the source elements that each become one Content.\n *\n * @generated from field: string element_selector = 5;\n */\n elementSelector: string;\n\n /**\n * How each element's Source Key is extracted.\n *\n * @generated from field: importhub.v1.SourceKey source_key = 6;\n */\n sourceKey?: SourceKey | undefined;\n\n /**\n * The field mappings, each an xmlmapper FieldMapping object (`name`,\n * `selector`, `type` and the options of its type, xmlmapper's JSON keys):\n * `name` is the field path in the pinned Release, and a fieldset's or a\n * virtual table's children are named relative to it. Every key is kept\n * as given, including those the structured editor has no form for\n * (edit-a-mapping-in-the-structured-editor:AC3).\n *\n * @generated from field: repeated google.protobuf.Struct fields = 7;\n */\n fields: JsonObject[];\n\n /**\n * The values that decide whether a Source Version is already in\n * contenthub (CONTEXT.md \"Version Match\"). Unset: each element is a\n * single version, compared with Main's head.\n *\n * @generated from field: importhub.v1.VersionMatch version_match = 8;\n */\n versionMatch?: VersionMatch | undefined;\n\n /**\n * Where a Source Version's Validity Period is read from; unset when the\n * source carries none (the Import's effective date applies).\n *\n * @generated from field: importhub.v1.ValidityPeriodSource validity_period = 9;\n */\n validityPeriod?: ValidityPeriodSource | undefined;\n\n /**\n * Where a Source Version's Release Spec values are read from.\n *\n * @generated from field: repeated importhub.v1.ReleaseSpecSource release_spec = 10;\n */\n releaseSpec: ReleaseSpecSource[];\n\n /**\n * What happens to a Changed Version.\n *\n * @generated from field: importhub.v1.ChangedVersionHandling changed_version = 11;\n */\n changedVersion: ChangedVersionHandling;\n\n /**\n * A Stub Mapping: for each Source Key no Content has yet, it creates\n * Content holding only the Content Key and the fields it maps, and never\n * changes existing Content (CONTEXT.md \"Stub Mapping\").\n *\n * @generated from field: bool stub = 12;\n */\n stub: boolean;\n\n /**\n * The per-Ausgabe data written onto Titles (CONTEXT.md \"Title\n * Contribution\").\n *\n * @generated from field: repeated importhub.v1.TitleContribution title_contributions = 13;\n */\n titleContributions: TitleContribution[];\n\n /**\n * How each Content's Collection is derived from the source.\n *\n * @generated from field: importhub.v1.CollectionRouting collection_routing = 14;\n */\n collectionRouting?: CollectionRouting | undefined;\n\n /**\n * The keys of the Collections every Content of the Mapping is filed\n * into, beside what collection_routing derives.\n *\n * @generated from field: repeated string collections = 15;\n */\n collections: string[];\n\n /**\n * The display name of each Content, with field paths in braces, such as\n * `{titelnum} — {titel}`.\n *\n * @generated from field: string display_name_template = 16;\n */\n displayNameTemplate: string;\n\n /**\n * The file references that become Placeholder Assets in mediahub.\n *\n * @generated from field: repeated importhub.v1.PlaceholderAssets placeholder_assets = 17;\n */\n placeholderAssets: PlaceholderAssets[];\n};\n\n/**\n * Describes the message importhub.v1.MappingContent.\n * Use `create(MappingContentSchema)` to create a new message.\n */\nexport const MappingContentSchema: GenMessage<MappingContent> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 1);\n\n/**\n * SourceKey says how the Source Key is extracted from an element: by\n * selector, or by template, which wins when both are set (xmlmapper's\n * idSelector and idTemplate).\n *\n * @generated from message importhub.v1.SourceKey\n */\nexport type SourceKey = Message<\"importhub.v1.SourceKey\"> & {\n /**\n * An XPath, relative to the element, whose value is the Source Key.\n *\n * @generated from field: string selector = 1;\n */\n selector: string;\n\n /**\n * The Source Key built from XPath expressions in braces, such as\n * `{ancestor::gesetz/@refid}-{@nr}`.\n *\n * @generated from field: string template = 2;\n */\n template: string;\n\n /**\n * A regular expression applied to each placeholder's value; its capture\n * groups replace a value it matches (xmlmapper's idExtractPattern).\n *\n * @generated from field: string extract_pattern = 3;\n */\n extractPattern: string;\n\n /**\n * Joins the capture groups; `-` when unset (idExtractSeparator).\n *\n * @generated from field: optional string extract_separator = 4;\n */\n extractSeparator?: string | undefined;\n\n /**\n * Removes all whitespace from the Source Key (idNormalize).\n *\n * @generated from field: bool normalize = 5;\n */\n normalize: boolean;\n};\n\n/**\n * Describes the message importhub.v1.SourceKey.\n * Use `create(SourceKeySchema)` to create a new message.\n */\nexport const SourceKeySchema: GenMessage<SourceKey> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 2);\n\n/**\n * VersionMatch is any combination of the Validity Period, Release Spec fields\n * and content fields. A Source Version matches an existing Release of the\n * same Content whose values are all equal.\n *\n * @generated from message importhub.v1.VersionMatch\n */\nexport type VersionMatch = Message<\"importhub.v1.VersionMatch\"> & {\n /**\n * Compare the Validity Period.\n *\n * @generated from field: bool validity_period = 1;\n */\n validityPeriod: boolean;\n\n /**\n * The Release Spec fields to compare, by path.\n *\n * @generated from field: repeated string release_spec_fields = 2;\n */\n releaseSpecFields: string[];\n\n /**\n * The content fields to compare, by path; each must be mapped.\n *\n * @generated from field: repeated string content_fields = 3;\n */\n contentFields: string[];\n};\n\n/**\n * Describes the message importhub.v1.VersionMatch.\n * Use `create(VersionMatchSchema)` to create a new message.\n */\nexport const VersionMatchSchema: GenMessage<VersionMatch> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 3);\n\n/**\n * ValidityPeriodSource is where the Validity Period of a Source Version is\n * read from.\n *\n * @generated from message importhub.v1.ValidityPeriodSource\n */\nexport type ValidityPeriodSource = Message<\"importhub.v1.ValidityPeriodSource\"> & {\n /**\n * An XPath, relative to the element, for the first day it is valid.\n *\n * @generated from field: string valid_from_selector = 1;\n */\n validFromSelector: string;\n\n /**\n * An XPath for the last day; empty for open-ended.\n *\n * @generated from field: string valid_to_selector = 2;\n */\n validToSelector: string;\n\n /**\n * Go time layouts the dates are read with, tried in order; ISO dates\n * (`2006-01-02`) when empty.\n *\n * @generated from field: repeated string date_formats = 3;\n */\n dateFormats: string[];\n};\n\n/**\n * Describes the message importhub.v1.ValidityPeriodSource.\n * Use `create(ValidityPeriodSourceSchema)` to create a new message.\n */\nexport const ValidityPeriodSourceSchema: GenMessage<ValidityPeriodSource> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 4);\n\n/**\n * ReleaseSpecSource is where one Release Spec value is read from.\n *\n * @generated from message importhub.v1.ReleaseSpecSource\n */\nexport type ReleaseSpecSource = Message<\"importhub.v1.ReleaseSpecSource\"> & {\n /**\n * The Release Spec field, by its path in the pinned Release.\n *\n * @generated from field: string field = 1;\n */\n field: string;\n\n /**\n * An XPath, relative to the element.\n *\n * @generated from field: string selector = 2;\n */\n selector: string;\n};\n\n/**\n * Describes the message importhub.v1.ReleaseSpecSource.\n * Use `create(ReleaseSpecSourceSchema)` to create a new message.\n */\nexport const ReleaseSpecSourceSchema: GenMessage<ReleaseSpecSource> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 5);\n\n/**\n * TitleContribution writes per-Ausgabe data found in the element onto the\n * Title whose Content Key equals the Ausgabe code (ADR 0013).\n *\n * @generated from message importhub.v1.TitleContribution\n */\nexport type TitleContribution = Message<\"importhub.v1.TitleContribution\"> & {\n /**\n * An XPath, relative to the element, selecting the elements that carry\n * one Ausgabe's data each.\n *\n * @generated from field: string selector = 1;\n */\n selector: string;\n\n /**\n * An XPath, relative to each of those, for the Ausgabe code.\n *\n * @generated from field: string ausgabe_code_selector = 2;\n */\n ausgabeCodeSelector: string;\n\n /**\n * Reference Spec values written on the Title's Include.\n *\n * @generated from field: repeated importhub.v1.TitleValueSource reference_spec_values = 3;\n */\n referenceSpecValues: TitleValueSource[];\n\n /**\n * An XPath for the reference filter written on the Title; empty for\n * none.\n *\n * @generated from field: string reference_filter_selector = 4;\n */\n referenceFilterSelector: string;\n\n /**\n * An intent written on the Title's tree; unset for none.\n *\n * @generated from field: importhub.v1.TitleIntent intent = 5;\n */\n intent: TitleIntent;\n\n /**\n * An XPath for the replacement or annotation text of a `replace` or\n * `annotate` intent.\n *\n * @generated from field: string intent_text_selector = 6;\n */\n intentTextSelector: string;\n};\n\n/**\n * Describes the message importhub.v1.TitleContribution.\n * Use `create(TitleContributionSchema)` to create a new message.\n */\nexport const TitleContributionSchema: GenMessage<TitleContribution> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 6);\n\n/**\n * TitleValueSource is where one value written on a Title is read from.\n *\n * @generated from message importhub.v1.TitleValueSource\n */\nexport type TitleValueSource = Message<\"importhub.v1.TitleValueSource\"> & {\n /**\n * The field, by its path in the Title's Reference Spec.\n *\n * @generated from field: string field = 1;\n */\n field: string;\n\n /**\n * An XPath, relative to the Ausgabe's element.\n *\n * @generated from field: string selector = 2;\n */\n selector: string;\n};\n\n/**\n * Describes the message importhub.v1.TitleValueSource.\n * Use `create(TitleValueSourceSchema)` to create a new message.\n */\nexport const TitleValueSourceSchema: GenMessage<TitleValueSource> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 7);\n\n/**\n * CollectionRouting derives one Collection per Content from the source. It\n * yields at most one key: the selector's value, mapped through\n * collection_map when it has entries; else id_pattern's first capture group\n * on the Source Key, filled into collection_template; else fallback.\n *\n * @generated from message importhub.v1.CollectionRouting\n */\nexport type CollectionRouting = Message<\"importhub.v1.CollectionRouting\"> & {\n /**\n * An XPath, relative to the element, whose value decides the Collection.\n *\n * @generated from field: string selector = 1;\n */\n selector: string;\n\n /**\n * The selector's values, mapped to Collection keys. Empty: the value is\n * the key.\n *\n * @generated from field: map<string, string> collection_map = 2;\n */\n collectionMap: { [key: string]: string };\n\n /**\n * A regular expression applied to the Source Key; its first capture\n * group is `{match}` in collection_template.\n *\n * @generated from field: string id_pattern = 3;\n */\n idPattern: string;\n\n /**\n * The Collection key, with `{match}` and `{suffix}` placeholders.\n *\n * @generated from field: string collection_template = 4;\n */\n collectionTemplate: string;\n\n /**\n * The static text `{suffix}` stands for.\n *\n * @generated from field: string suffix = 5;\n */\n suffix: string;\n\n /**\n * The Collection key used when the routing yields nothing; each use is\n * reported.\n *\n * @generated from field: string fallback = 6;\n */\n fallback: string;\n};\n\n/**\n * Describes the message importhub.v1.CollectionRouting.\n * Use `create(CollectionRoutingSchema)` to create a new message.\n */\nexport const CollectionRoutingSchema: GenMessage<CollectionRouting> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 8);\n\n/**\n * PlaceholderAssets turns the file references a Mapping marks into\n * Placeholder Assets in mediahub (CONTEXT.md \"Placeholder Asset\").\n *\n * @generated from message importhub.v1.PlaceholderAssets\n */\nexport type PlaceholderAssets = Message<\"importhub.v1.PlaceholderAssets\"> & {\n /**\n * An XPath, relative to the element, selecting the file references, such\n * as `.//grafik`.\n *\n * @generated from field: string selector = 1;\n */\n selector: string;\n\n /**\n * The mediahub asset type of the assets created.\n *\n * @generated from field: string asset_type = 2;\n */\n assetType: string;\n\n /**\n * XPath expressions, relative to each reference, whose values joined by\n * `/` form the asset's key in mediahub (its external_key).\n *\n * @generated from field: repeated string key_parts = 3;\n */\n keyParts: string[];\n\n /**\n * An XPath for the asset's name.\n *\n * @generated from field: string name_selector = 4;\n */\n nameSelector: string;\n\n /**\n * An XPath for the asset's description; empty for none.\n *\n * @generated from field: string description_selector = 5;\n */\n descriptionSelector: string;\n\n /**\n * The asset's metadata: XPath expressions, by metadata field.\n *\n * @generated from field: map<string, string> metadata = 6;\n */\n metadata: { [key: string]: string };\n\n /**\n * The mediahub folder path the mirrored folders are made under.\n *\n * @generated from field: string folder_root = 7;\n */\n folderRoot: string;\n\n /**\n * An XPath for the file's path, mirrored as folders under folder_root.\n *\n * @generated from field: string folder_path_selector = 8;\n */\n folderPathSelector: string;\n};\n\n/**\n * Describes the message importhub.v1.PlaceholderAssets.\n * Use `create(PlaceholderAssetsSchema)` to create a new message.\n */\nexport const PlaceholderAssetsSchema: GenMessage<PlaceholderAssets> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 9);\n\n/**\n * @generated from message importhub.v1.ListMappingsRequest\n */\nexport type ListMappingsRequest = Message<\"importhub.v1.ListMappingsRequest\"> & {\n};\n\n/**\n * Describes the message importhub.v1.ListMappingsRequest.\n * Use `create(ListMappingsRequestSchema)` to create a new message.\n */\nexport const ListMappingsRequestSchema: GenMessage<ListMappingsRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 10);\n\n/**\n * @generated from message importhub.v1.ListMappingsResponse\n */\nexport type ListMappingsResponse = Message<\"importhub.v1.ListMappingsResponse\"> & {\n /**\n * @generated from field: repeated importhub.v1.Mapping mappings = 1;\n */\n mappings: Mapping[];\n};\n\n/**\n * Describes the message importhub.v1.ListMappingsResponse.\n * Use `create(ListMappingsResponseSchema)` to create a new message.\n */\nexport const ListMappingsResponseSchema: GenMessage<ListMappingsResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 11);\n\n/**\n * @generated from message importhub.v1.GetMappingRequest\n */\nexport type GetMappingRequest = Message<\"importhub.v1.GetMappingRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * An older Revision to read the content of; empty for the draft.\n *\n * @generated from field: string revision_id = 2;\n */\n revisionId: string;\n};\n\n/**\n * Describes the message importhub.v1.GetMappingRequest.\n * Use `create(GetMappingRequestSchema)` to create a new message.\n */\nexport const GetMappingRequestSchema: GenMessage<GetMappingRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 12);\n\n/**\n * @generated from message importhub.v1.GetMappingResponse\n */\nexport type GetMappingResponse = Message<\"importhub.v1.GetMappingResponse\"> & {\n /**\n * @generated from field: importhub.v1.Mapping mapping = 1;\n */\n mapping?: Mapping | undefined;\n};\n\n/**\n * Describes the message importhub.v1.GetMappingResponse.\n * Use `create(GetMappingResponseSchema)` to create a new message.\n */\nexport const GetMappingResponseSchema: GenMessage<GetMappingResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 13);\n\n/**\n * @generated from message importhub.v1.CreateMappingRequest\n */\nexport type CreateMappingRequest = Message<\"importhub.v1.CreateMappingRequest\"> & {\n /**\n * @generated from field: importhub.v1.MappingContent content = 1;\n */\n content?: MappingContent | undefined;\n};\n\n/**\n * Describes the message importhub.v1.CreateMappingRequest.\n * Use `create(CreateMappingRequestSchema)` to create a new message.\n */\nexport const CreateMappingRequestSchema: GenMessage<CreateMappingRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 14);\n\n/**\n * @generated from message importhub.v1.CreateMappingResponse\n */\nexport type CreateMappingResponse = Message<\"importhub.v1.CreateMappingResponse\"> & {\n /**\n * @generated from field: importhub.v1.Mapping mapping = 1;\n */\n mapping?: Mapping | undefined;\n};\n\n/**\n * Describes the message importhub.v1.CreateMappingResponse.\n * Use `create(CreateMappingResponseSchema)` to create a new message.\n */\nexport const CreateMappingResponseSchema: GenMessage<CreateMappingResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 15);\n\n/**\n * @generated from message importhub.v1.UpdateMappingRequest\n */\nexport type UpdateMappingRequest = Message<\"importhub.v1.UpdateMappingRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * The whole new content; it replaces the draft's.\n *\n * @generated from field: importhub.v1.MappingContent content = 2;\n */\n content?: MappingContent | undefined;\n\n /**\n * The draft this edit was made on. Given, the save is refused if the\n * draft has moved since; empty, it saves on whatever the draft is.\n *\n * @generated from field: string draft_revision_id = 3;\n */\n draftRevisionId: string;\n};\n\n/**\n * Describes the message importhub.v1.UpdateMappingRequest.\n * Use `create(UpdateMappingRequestSchema)` to create a new message.\n */\nexport const UpdateMappingRequestSchema: GenMessage<UpdateMappingRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 16);\n\n/**\n * @generated from message importhub.v1.UpdateMappingResponse\n */\nexport type UpdateMappingResponse = Message<\"importhub.v1.UpdateMappingResponse\"> & {\n /**\n * @generated from field: importhub.v1.Mapping mapping = 1;\n */\n mapping?: Mapping | undefined;\n};\n\n/**\n * Describes the message importhub.v1.UpdateMappingResponse.\n * Use `create(UpdateMappingResponseSchema)` to create a new message.\n */\nexport const UpdateMappingResponseSchema: GenMessage<UpdateMappingResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 17);\n\n/**\n * @generated from message importhub.v1.DeleteMappingRequest\n */\nexport type DeleteMappingRequest = Message<\"importhub.v1.DeleteMappingRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n};\n\n/**\n * Describes the message importhub.v1.DeleteMappingRequest.\n * Use `create(DeleteMappingRequestSchema)` to create a new message.\n */\nexport const DeleteMappingRequestSchema: GenMessage<DeleteMappingRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 18);\n\n/**\n * @generated from message importhub.v1.DeleteMappingResponse\n */\nexport type DeleteMappingResponse = Message<\"importhub.v1.DeleteMappingResponse\"> & {\n};\n\n/**\n * Describes the message importhub.v1.DeleteMappingResponse.\n * Use `create(DeleteMappingResponseSchema)` to create a new message.\n */\nexport const DeleteMappingResponseSchema: GenMessage<DeleteMappingResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 19);\n\n/**\n * @generated from message importhub.v1.CutMappingReleaseRequest\n */\nexport type CutMappingReleaseRequest = Message<\"importhub.v1.CutMappingReleaseRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * The draft the admin is releasing. Given, the cut is refused if the\n * draft has moved since.\n *\n * @generated from field: string draft_revision_id = 2;\n */\n draftRevisionId: string;\n};\n\n/**\n * Describes the message importhub.v1.CutMappingReleaseRequest.\n * Use `create(CutMappingReleaseRequestSchema)` to create a new message.\n */\nexport const CutMappingReleaseRequestSchema: GenMessage<CutMappingReleaseRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 20);\n\n/**\n * @generated from message importhub.v1.CutMappingReleaseResponse\n */\nexport type CutMappingReleaseResponse = Message<\"importhub.v1.CutMappingReleaseResponse\"> & {\n /**\n * The Release cut.\n *\n * @generated from field: importhub.v1.ConfigurationRelease release = 1;\n */\n release?: ConfigurationRelease | undefined;\n\n /**\n * The Mapping after the cut.\n *\n * @generated from field: importhub.v1.Mapping mapping = 2;\n */\n mapping?: Mapping | undefined;\n\n /**\n * The Import Profiles that include it, by name.\n *\n * @generated from field: repeated importhub.v1.ImportProfileRef import_profiles = 3;\n */\n importProfiles: ImportProfileRef[];\n};\n\n/**\n * Describes the message importhub.v1.CutMappingReleaseResponse.\n * Use `create(CutMappingReleaseResponseSchema)` to create a new message.\n */\nexport const CutMappingReleaseResponseSchema: GenMessage<CutMappingReleaseResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 21);\n\n/**\n * @generated from message importhub.v1.ListMappingHistoryRequest\n */\nexport type ListMappingHistoryRequest = Message<\"importhub.v1.ListMappingHistoryRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * Revisions per page; 0 means 100, and at most 1000.\n *\n * @generated from field: int32 page_size = 2;\n */\n pageSize: number;\n\n /**\n * The next_page_token of the previous page; empty for the first.\n *\n * @generated from field: string page_token = 3;\n */\n pageToken: string;\n};\n\n/**\n * Describes the message importhub.v1.ListMappingHistoryRequest.\n * Use `create(ListMappingHistoryRequestSchema)` to create a new message.\n */\nexport const ListMappingHistoryRequestSchema: GenMessage<ListMappingHistoryRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 22);\n\n/**\n * @generated from message importhub.v1.ListMappingHistoryResponse\n */\nexport type ListMappingHistoryResponse = Message<\"importhub.v1.ListMappingHistoryResponse\"> & {\n /**\n * One page of Revisions, newest first.\n *\n * @generated from field: repeated importhub.v1.ConfigurationRevision revisions = 1;\n */\n revisions: ConfigurationRevision[];\n\n /**\n * Every Release, newest first, on every page.\n *\n * @generated from field: repeated importhub.v1.ConfigurationRelease releases = 2;\n */\n releases: ConfigurationRelease[];\n\n /**\n * The page_token of the next page; empty on the last.\n *\n * @generated from field: string next_page_token = 3;\n */\n nextPageToken: string;\n};\n\n/**\n * Describes the message importhub.v1.ListMappingHistoryResponse.\n * Use `create(ListMappingHistoryResponseSchema)` to create a new message.\n */\nexport const ListMappingHistoryResponseSchema: GenMessage<ListMappingHistoryResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 23);\n\n/**\n * @generated from message importhub.v1.CompareMappingRevisionsRequest\n */\nexport type CompareMappingRevisionsRequest = Message<\"importhub.v1.CompareMappingRevisionsRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * @generated from field: string from_revision_id = 2;\n */\n fromRevisionId: string;\n\n /**\n * @generated from field: string to_revision_id = 3;\n */\n toRevisionId: string;\n};\n\n/**\n * Describes the message importhub.v1.CompareMappingRevisionsRequest.\n * Use `create(CompareMappingRevisionsRequestSchema)` to create a new message.\n */\nexport const CompareMappingRevisionsRequestSchema: GenMessage<CompareMappingRevisionsRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 24);\n\n/**\n * @generated from message importhub.v1.CompareMappingRevisionsResponse\n */\nexport type CompareMappingRevisionsResponse = Message<\"importhub.v1.CompareMappingRevisionsResponse\"> & {\n /**\n * @generated from field: importhub.v1.Mapping from = 1;\n */\n from?: Mapping | undefined;\n\n /**\n * @generated from field: importhub.v1.Mapping to = 2;\n */\n to?: Mapping | undefined;\n\n /**\n * Each field, and how it differs from `from` to `to`.\n *\n * @generated from field: repeated importhub.v1.FieldComparison fields = 3;\n */\n fields: FieldComparison[];\n};\n\n/**\n * Describes the message importhub.v1.CompareMappingRevisionsResponse.\n * Use `create(CompareMappingRevisionsResponseSchema)` to create a new message.\n */\nexport const CompareMappingRevisionsResponseSchema: GenMessage<CompareMappingRevisionsResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 25);\n\n/**\n * @generated from message importhub.v1.RestoreMappingRevisionRequest\n */\nexport type RestoreMappingRevisionRequest = Message<\"importhub.v1.RestoreMappingRevisionRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * The older Revision whose content becomes the new draft.\n *\n * @generated from field: string revision_id = 2;\n */\n revisionId: string;\n\n /**\n * As UpdateMappingRequest's.\n *\n * @generated from field: string draft_revision_id = 3;\n */\n draftRevisionId: string;\n};\n\n/**\n * Describes the message importhub.v1.RestoreMappingRevisionRequest.\n * Use `create(RestoreMappingRevisionRequestSchema)` to create a new message.\n */\nexport const RestoreMappingRevisionRequestSchema: GenMessage<RestoreMappingRevisionRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 26);\n\n/**\n * @generated from message importhub.v1.RestoreMappingRevisionResponse\n */\nexport type RestoreMappingRevisionResponse = Message<\"importhub.v1.RestoreMappingRevisionResponse\"> & {\n /**\n * @generated from field: importhub.v1.Mapping mapping = 1;\n */\n mapping?: Mapping | undefined;\n};\n\n/**\n * Describes the message importhub.v1.RestoreMappingRevisionResponse.\n * Use `create(RestoreMappingRevisionResponseSchema)` to create a new message.\n */\nexport const RestoreMappingRevisionResponseSchema: GenMessage<RestoreMappingRevisionResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 27);\n\n/**\n * @generated from message importhub.v1.ListMappingImportProfilesRequest\n */\nexport type ListMappingImportProfilesRequest = Message<\"importhub.v1.ListMappingImportProfilesRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n};\n\n/**\n * Describes the message importhub.v1.ListMappingImportProfilesRequest.\n * Use `create(ListMappingImportProfilesRequestSchema)` to create a new message.\n */\nexport const ListMappingImportProfilesRequestSchema: GenMessage<ListMappingImportProfilesRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 28);\n\n/**\n * @generated from message importhub.v1.ListMappingImportProfilesResponse\n */\nexport type ListMappingImportProfilesResponse = Message<\"importhub.v1.ListMappingImportProfilesResponse\"> & {\n /**\n * @generated from field: repeated importhub.v1.ImportProfileRef import_profiles = 1;\n */\n importProfiles: ImportProfileRef[];\n};\n\n/**\n * Describes the message importhub.v1.ListMappingImportProfilesResponse.\n * Use `create(ListMappingImportProfilesResponseSchema)` to create a new message.\n */\nexport const ListMappingImportProfilesResponseSchema: GenMessage<ListMappingImportProfilesResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 29);\n\n/**\n * @generated from message importhub.v1.CheckMappingBlueprintReleaseRequest\n */\nexport type CheckMappingBlueprintReleaseRequest = Message<\"importhub.v1.CheckMappingBlueprintReleaseRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * The Blueprint Release the draft would move to.\n *\n * @generated from field: string blueprint_release_id = 2;\n */\n blueprintReleaseId: string;\n};\n\n/**\n * Describes the message importhub.v1.CheckMappingBlueprintReleaseRequest.\n * Use `create(CheckMappingBlueprintReleaseRequestSchema)` to create a new message.\n */\nexport const CheckMappingBlueprintReleaseRequestSchema: GenMessage<CheckMappingBlueprintReleaseRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 30);\n\n/**\n * @generated from message importhub.v1.CheckMappingBlueprintReleaseResponse\n */\nexport type CheckMappingBlueprintReleaseResponse = Message<\"importhub.v1.CheckMappingBlueprintReleaseResponse\"> & {\n /**\n * The Blueprint that Release is of.\n *\n * @generated from field: string blueprint_id = 1;\n */\n blueprintId: string;\n\n /**\n * Every field path the draft maps (field mappings, Version Match content\n * fields) that the Release does not have, in the draft's order.\n *\n * @generated from field: repeated string missing_field_paths = 2;\n */\n missingFieldPaths: string[];\n\n /**\n * Every Release Spec field the draft reads or matches on that the\n * Release does not have.\n *\n * @generated from field: repeated string missing_release_spec_fields = 3;\n */\n missingReleaseSpecFields: string[];\n};\n\n/**\n * Describes the message importhub.v1.CheckMappingBlueprintReleaseResponse.\n * Use `create(CheckMappingBlueprintReleaseResponseSchema)` to create a new message.\n */\nexport const CheckMappingBlueprintReleaseResponseSchema: GenMessage<CheckMappingBlueprintReleaseResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 31);\n\n/**\n * ChangedVersionHandling is what happens to a Source Version that matches an\n * existing Release but whose mapped data differs (CONTEXT.md \"Changed\n * Version\").\n *\n * @generated from enum importhub.v1.ChangedVersionHandling\n */\nexport enum ChangedVersionHandling {\n /**\n * Unset: Correct.\n *\n * @generated from enum value: CHANGED_VERSION_HANDLING_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * A Planned Release that Supersedes the matched one.\n *\n * @generated from enum value: CHANGED_VERSION_HANDLING_CORRECT = 1;\n */\n CORRECT = 1,\n\n /**\n * Keep the existing Release; skip the Source Version.\n *\n * @generated from enum value: CHANGED_VERSION_HANDLING_KEEP = 2;\n */\n KEEP = 2,\n\n /**\n * Fail the Import.\n *\n * @generated from enum value: CHANGED_VERSION_HANDLING_FAIL = 3;\n */\n FAIL = 3,\n}\n\n/**\n * Describes the enum importhub.v1.ChangedVersionHandling.\n */\nexport const ChangedVersionHandlingSchema: GenEnum<ChangedVersionHandling> = /*@__PURE__*/\n enumDesc(file_importhub_v1_mapping, 0);\n\n/**\n * TitleIntent is an intent a Title Contribution writes on the Title's tree.\n *\n * @generated from enum importhub.v1.TitleIntent\n */\nexport enum TitleIntent {\n /**\n * None.\n *\n * @generated from enum value: TITLE_INTENT_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * @generated from enum value: TITLE_INTENT_EXCLUDE = 1;\n */\n EXCLUDE = 1,\n\n /**\n * @generated from enum value: TITLE_INTENT_REPLACE = 2;\n */\n REPLACE = 2,\n\n /**\n * @generated from enum value: TITLE_INTENT_ANNOTATE = 3;\n */\n ANNOTATE = 3,\n}\n\n/**\n * Describes the enum importhub.v1.TitleIntent.\n */\nexport const TitleIntentSchema: GenEnum<TitleIntent> = /*@__PURE__*/\n enumDesc(file_importhub_v1_mapping, 1);\n\n/**\n * MappingService holds the workspace's Mappings: the rules that turn each\n * matching element of a Source File into one Content of one target Blueprint,\n * field by field (CONTEXT.md, manage-mappings). A Mapping stands on its own,\n * and any number of Import Profiles include it.\n *\n * Each Mapping pins one Blueprint Release (ADR 0002), read from blueprinthub\n * with the caller's token, and every field path it maps is checked against\n * that Release when it is saved. Moving it to a newer Release is an explicit\n * edit, which CheckMappingBlueprintRelease checks first.\n *\n * A Mapping is versioned configuration (ADR 0016): every create, update and\n * restore saves a draft Revision, and an admin cuts a Configuration Release\n * from a valid draft.\n *\n * Every RPC acts on the caller's workspace, which comes from the token's\n * active workspace and never from a request field. Reads need `viewer`;\n * every write needs `admin` (ADR 0010, control-who-may-import:AC3).\n *\n * The validity reason codes of a Mapping, decided when it is saved:\n *\n * - `no_blueprint_release`: it pins no Blueprint Release.\n * - `blueprint_gone`: blueprinthub does not know the Release it pins: the\n * Blueprint is gone, or the Release is of another workspace.\n * - `release_of_other_blueprint`: the pinned Release is not of\n * blueprint_id.\n * - `no_element_selector`, `no_source_key`: the element selector or the\n * Source Key is missing.\n * - `invalid_xpath`: a selector is not an XPath.\n * - `invalid_pattern`: an extract pattern is not a regular expression.\n * - `unknown_processor`, `wrong_processor_kind`,\n * `invalid_processor_settings`: a rich-text field's Preprocessors\n * (`richTextConfig.preprocessors`), checked against the catalogue as an\n * Import Profile's are.\n * - `unknown_option`: a field mapping holds a key xmlmapper does not read.\n * - `xmlmapper_schema`: a field mapping breaks xmlmapper's schema, such as\n * a select field without options; the message is xmlmapper's.\n * - `duplicate_field`: two field mappings write one field path.\n * - `unknown_field_path`: a field mapping writes a field path the pinned\n * Release does not have.\n * - `unknown_release_spec_field`: a Release Spec source or the Version\n * Match names a Release Spec field the pinned Release does not have.\n * - `unknown_version_match_field`: the Version Match compares a content\n * field the Mapping does not map.\n * - `incomplete_title_contribution`, `incomplete_placeholder_assets`: a\n * Title Contribution or Placeholder Asset setting misses a selector it\n * cannot work without.\n *\n * current_validity adds `blueprint_gone` when blueprinthub no longer knows\n * the Release the draft or the latest Release pins (manage-mappings:AC7).\n *\n * @generated from service importhub.v1.MappingService\n */\nexport const MappingService: GenService<{\n /**\n * ListMappings returns every Mapping of the workspace, by name, each with\n * its target Blueprint, its pinned Blueprint Release and whether it is\n * valid now (manage-mappings:AC1).\n *\n * @generated from rpc importhub.v1.MappingService.ListMappings\n */\n listMappings: {\n methodKind: \"unary\";\n input: typeof ListMappingsRequestSchema;\n output: typeof ListMappingsResponseSchema;\n },\n /**\n * GetMapping returns one Mapping with its draft, or with an older\n * Revision of it when one is named.\n *\n * @generated from rpc importhub.v1.MappingService.GetMapping\n */\n getMapping: {\n methodKind: \"unary\";\n input: typeof GetMappingRequestSchema;\n output: typeof GetMappingResponseSchema;\n },\n /**\n * CreateMapping creates a Mapping, its content the first draft. A Mapping\n * that breaks xmlmapper's schema or maps a field path its Release lacks\n * is saved and marked invalid with its reasons (manage-mappings:AC6); a\n * missing name, or one another Mapping of the workspace has, is refused\n * (InvalidArgument, AlreadyExists). blueprinthub not answering is\n * Unavailable, and nothing is saved.\n *\n * @generated from rpc importhub.v1.MappingService.CreateMapping\n */\n createMapping: {\n methodKind: \"unary\";\n input: typeof CreateMappingRequestSchema;\n output: typeof CreateMappingResponseSchema;\n },\n /**\n * UpdateMapping saves new content as a new draft Revision. It is refused\n * with FailedPrecondition when draft_revision_id is given and is no longer\n * the draft.\n *\n * @generated from rpc importhub.v1.MappingService.UpdateMapping\n */\n updateMapping: {\n methodKind: \"unary\";\n input: typeof UpdateMappingRequestSchema;\n output: typeof UpdateMappingResponseSchema;\n },\n /**\n * DeleteMapping deletes a Mapping. It is refused with FailedPrecondition\n * while an Import Profile includes it, naming the Profiles in the message\n * and in a ConfigurationInUse detail (manage-mappings:AC4).\n *\n * @generated from rpc importhub.v1.MappingService.DeleteMapping\n */\n deleteMapping: {\n methodKind: \"unary\";\n input: typeof DeleteMappingRequestSchema;\n output: typeof DeleteMappingResponseSchema;\n },\n /**\n * CutMappingRelease cuts a Configuration Release from the draft, and\n * returns the Import Profiles that include the Mapping, which take the\n * new Release at their next Import (release-a-configuration:AC4). It is\n * refused with FailedPrecondition, the Validity as a detail, when the\n * draft is not valid now, when it does not differ from the latest\n * Release, or when draft_revision_id is given and is no longer the draft.\n *\n * @generated from rpc importhub.v1.MappingService.CutMappingRelease\n */\n cutMappingRelease: {\n methodKind: \"unary\";\n input: typeof CutMappingReleaseRequestSchema;\n output: typeof CutMappingReleaseResponseSchema;\n },\n /**\n * ListMappingHistory lists a Mapping's Revisions, newest first and paged,\n * and all its Releases (release-a-configuration:AC6).\n *\n * @generated from rpc importhub.v1.MappingService.ListMappingHistory\n */\n listMappingHistory: {\n methodKind: \"unary\";\n input: typeof ListMappingHistoryRequestSchema;\n output: typeof ListMappingHistoryResponseSchema;\n },\n /**\n * CompareMappingRevisions compares two Revisions of one Mapping: both\n * contents, and how each field differs.\n *\n * @generated from rpc importhub.v1.MappingService.CompareMappingRevisions\n */\n compareMappingRevisions: {\n methodKind: \"unary\";\n input: typeof CompareMappingRevisionsRequestSchema;\n output: typeof CompareMappingRevisionsResponseSchema;\n },\n /**\n * RestoreMappingRevision saves an older Revision's content as a new draft\n * (release-a-configuration:AC7), its validity decided anew against the\n * Release it pins.\n *\n * @generated from rpc importhub.v1.MappingService.RestoreMappingRevision\n */\n restoreMappingRevision: {\n methodKind: \"unary\";\n input: typeof RestoreMappingRevisionRequestSchema;\n output: typeof RestoreMappingRevisionResponseSchema;\n },\n /**\n * ListMappingImportProfiles lists the Import Profiles that include a\n * Mapping, by name: those whose draft or latest Release includes it\n * (manage-mappings:AC3, and before a cut, release-a-configuration:AC4).\n *\n * @generated from rpc importhub.v1.MappingService.ListMappingImportProfiles\n */\n listMappingImportProfiles: {\n methodKind: \"unary\";\n input: typeof ListMappingImportProfilesRequestSchema;\n output: typeof ListMappingImportProfilesResponseSchema;\n },\n /**\n * CheckMappingBlueprintRelease checks moving a Mapping's draft to\n * another Blueprint Release, saving nothing: every field path the draft\n * maps that the other Release no longer has (manage-mappings:AC5). An\n * unknown Release is NotFound; a Release of another Blueprint than the\n * Mapping's is FailedPrecondition. The report is against the draft, not\n * the latest Release. Any Release of the Mapping's Blueprint may be\n * checked, an older one too: moving back is an edit like moving forward,\n * validated the same way when it is saved.\n *\n * @generated from rpc importhub.v1.MappingService.CheckMappingBlueprintRelease\n */\n checkMappingBlueprintRelease: {\n methodKind: \"unary\";\n input: typeof CheckMappingBlueprintReleaseRequestSchema;\n output: typeof CheckMappingBlueprintReleaseResponseSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_importhub_v1_mapping, 0);\n\n","// @generated by protoc-gen-es v2.13.0 with parameter \"target=ts\"\n// @generated from file importhub/v1/processor.proto (package importhub.v1, syntax proto3)\n/* eslint-disable */\n\nimport type { GenEnum, GenFile, GenMessage, GenService } from \"@bufbuild/protobuf/codegenv2\";\nimport { enumDesc, fileDesc, messageDesc, serviceDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport { file_google_protobuf_struct } from \"@bufbuild/protobuf/wkt\";\nimport type { JsonObject, Message } from \"@bufbuild/protobuf\";\n\n/**\n * Describes the file importhub/v1/processor.proto.\n */\nexport const file_importhub_v1_processor: GenFile = /*@__PURE__*/\n fileDesc(\"ChxpbXBvcnRodWIvdjEvcHJvY2Vzc29yLnByb3RvEgxpbXBvcnRodWIudjEiFwoVTGlzdFByb2Nlc3NvcnNSZXF1ZXN0IkUKFkxpc3RQcm9jZXNzb3JzUmVzcG9uc2USKwoKcHJvY2Vzc29ycxgBIAMoCzIXLmltcG9ydGh1Yi52MS5Qcm9jZXNzb3IiuAEKCVByb2Nlc3NvchIMCgRuYW1lGAEgASgJEikKBGtpbmQYAiABKA4yGy5pbXBvcnRodWIudjEuUHJvY2Vzc29yS2luZBItCgZ0YXJnZXQYAyABKA4yHS5pbXBvcnRodWIudjEuUHJvY2Vzc29yVGFyZ2V0EhMKC2Rlc2NyaXB0aW9uGAQgASgJEi4KDXNldHRpbmdzX3NwZWMYBSADKAsyFy5nb29nbGUucHJvdG9idWYuU3RydWN0KnMKDVByb2Nlc3NvcktpbmQSHgoaUFJPQ0VTU09SX0tJTkRfVU5TUEVDSUZJRUQQABIfChtQUk9DRVNTT1JfS0lORF9QUkVQUk9DRVNTT1IQARIhCh1QUk9DRVNTT1JfS0lORF9QT1NUX1BST0NFU1NPUhACKnsKD1Byb2Nlc3NvclRhcmdldBIgChxQUk9DRVNTT1JfVEFSR0VUX1VOU1BFQ0lGSUVEEAASIAocUFJPQ0VTU09SX1RBUkdFVF9TT1VSQ0VfRklMRRABEiQKIFBST0NFU1NPUl9UQVJHRVRfUklDSF9URVhUX0ZJRUxEEAIybwoQUHJvY2Vzc29yU2VydmljZRJbCg5MaXN0UHJvY2Vzc29ycxIjLmltcG9ydGh1Yi52MS5MaXN0UHJvY2Vzc29yc1JlcXVlc3QaJC5pbXBvcnRodWIudjEuTGlzdFByb2Nlc3NvcnNSZXNwb25zZUI5WjdnaXRodWIuY29tL2tua2NzL2ltcG9ydGh1Yi9nZW4vaW1wb3J0aHViL3YxO2ltcG9ydGh1YnYxYgZwcm90bzM\", [file_google_protobuf_struct]);\n\n/**\n * @generated from message importhub.v1.ListProcessorsRequest\n */\nexport type ListProcessorsRequest = Message<\"importhub.v1.ListProcessorsRequest\"> & {\n};\n\n/**\n * Describes the message importhub.v1.ListProcessorsRequest.\n * Use `create(ListProcessorsRequestSchema)` to create a new message.\n */\nexport const ListProcessorsRequestSchema: GenMessage<ListProcessorsRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_processor, 0);\n\n/**\n * @generated from message importhub.v1.ListProcessorsResponse\n */\nexport type ListProcessorsResponse = Message<\"importhub.v1.ListProcessorsResponse\"> & {\n /**\n * @generated from field: repeated importhub.v1.Processor processors = 1;\n */\n processors: Processor[];\n};\n\n/**\n * Describes the message importhub.v1.ListProcessorsResponse.\n * Use `create(ListProcessorsResponseSchema)` to create a new message.\n */\nexport const ListProcessorsResponseSchema: GenMessage<ListProcessorsResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_processor, 1);\n\n/**\n * Processor is one entry of the catalogue.\n *\n * @generated from message importhub.v1.Processor\n */\nexport type Processor = Message<\"importhub.v1.Processor\"> & {\n /**\n * How a Profile names it, such as `entity-element`. Stable.\n *\n * @generated from field: string name = 1;\n */\n name: string;\n\n /**\n * @generated from field: importhub.v1.ProcessorKind kind = 2;\n */\n kind: ProcessorKind;\n\n /**\n * What it works on, and so where it is configured.\n *\n * @generated from field: importhub.v1.ProcessorTarget target = 3;\n */\n target: ProcessorTarget;\n\n /**\n * What it does, in English, for a person.\n *\n * @generated from field: string description = 4;\n */\n description: string;\n\n /**\n * Its settings, in form order, each a fieldkit Field (`field_type`,\n * `config` with `api_accessor`, `required`, `name`, `instructions`, and\n * `settings`): a Profile's ProcessorStep.settings holds one value per\n * `config.api_accessor`. Empty for a Processor without settings.\n *\n * @generated from field: repeated google.protobuf.Struct settings_spec = 5;\n */\n settingsSpec: JsonObject[];\n};\n\n/**\n * Describes the message importhub.v1.Processor.\n * Use `create(ProcessorSchema)` to create a new message.\n */\nexport const ProcessorSchema: GenMessage<Processor> = /*@__PURE__*/\n messageDesc(file_importhub_v1_processor, 2);\n\n/**\n * ProcessorKind is where in a Profile's pipeline a Processor runs (ADR 0007).\n *\n * @generated from enum importhub.v1.ProcessorKind\n */\nexport enum ProcessorKind {\n /**\n * @generated from enum value: PROCESSOR_KIND_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * Rewrites the Source File before Mapping.\n *\n * @generated from enum value: PROCESSOR_KIND_PREPROCESSOR = 1;\n */\n PREPROCESSOR = 1,\n\n /**\n * Enriches mapped Source Versions before they are saved.\n *\n * @generated from enum value: PROCESSOR_KIND_POST_PROCESSOR = 2;\n */\n POST_PROCESSOR = 2,\n}\n\n/**\n * Describes the enum importhub.v1.ProcessorKind.\n */\nexport const ProcessorKindSchema: GenEnum<ProcessorKind> = /*@__PURE__*/\n enumDesc(file_importhub_v1_processor, 0);\n\n/**\n * ProcessorTarget is what a Processor works on.\n *\n * @generated from enum importhub.v1.ProcessorTarget\n */\nexport enum ProcessorTarget {\n /**\n * @generated from enum value: PROCESSOR_TARGET_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * The whole Source File: an Import Profile lists it among its\n * Preprocessors or Post-processors.\n *\n * @generated from enum value: PROCESSOR_TARGET_SOURCE_FILE = 1;\n */\n SOURCE_FILE = 1,\n\n /**\n * One rich-text field's XML before it is converted: a Mapping lists it\n * in that field's xmlmapper settings (`richTextConfig.preprocessors`),\n * never a Profile.\n *\n * @generated from enum value: PROCESSOR_TARGET_RICH_TEXT_FIELD = 2;\n */\n RICH_TEXT_FIELD = 2,\n}\n\n/**\n * Describes the enum importhub.v1.ProcessorTarget.\n */\nexport const ProcessorTargetSchema: GenEnum<ProcessorTarget> = /*@__PURE__*/\n enumDesc(file_importhub_v1_processor, 1);\n\n/**\n * ProcessorService is the Processor catalogue: every Processor an Import\n * Profile may list, with what it is for and the settings it takes\n * (manage-import-profiles:AC5). The UI generates each Processor's settings\n * form from its settings spec (manage-import-profiles:AC4), and a Profile's\n * settings are checked against the same spec when it is saved.\n *\n * The catalogue is the same for every workspace; reading it needs `viewer`\n * (ADR 0010).\n *\n * @generated from service importhub.v1.ProcessorService\n */\nexport const ProcessorService: GenService<{\n /**\n * ListProcessors returns every Processor, by name.\n *\n * @generated from rpc importhub.v1.ProcessorService.ListProcessors\n */\n listProcessors: {\n methodKind: \"unary\";\n input: typeof ListProcessorsRequestSchema;\n output: typeof ListProcessorsResponseSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_importhub_v1_processor, 0);\n\n","import { create, fromJson, type JsonObject, type JsonValue, toJson } from \"@bufbuild/protobuf\";\nimport { type Timestamp, timestampDate, timestampFromDate } from \"@bufbuild/protobuf/wkt\";\nimport { Code, ConnectError, createClient, type Transport } from \"@connectrpc/connect\";\nimport { createConnectTransport } from \"@connectrpc/connect-web\";\nimport type { Schema } from \"@knkcs/fieldkit/schema\";\nimport { type APIKey as APIKeyPb, APIKeyService } from \"../../../../gen/ts/importhub/v1/api_key_pb\";\nimport {\n\tConfigurationInUseSchema,\n\ttype ConfigurationRelease as ConfigurationReleasePb,\n\ttype ConfigurationRevision as ConfigurationRevisionPb,\n\ttype ConfigurationState as ConfigurationStatePb,\n\ttype FieldComparison as FieldComparisonPb,\n\tFieldComparisonStatus as FieldComparisonStatusPb,\n\ttype Validity as ValidityPb,\n\tValiditySchema,\n} from \"../../../../gen/ts/importhub/v1/configuration_pb\";\nimport {\n\tEntitySetContentSchema,\n\ttype EntitySet as EntitySetPb,\n\tEntitySetService,\n} from \"../../../../gen/ts/importhub/v1/entity_set_pb\";\nimport {\n\ttype ConfigurationReleaseRef as ConfigurationReleaseRefPb,\n\tImportOutcome as ImportOutcomePb,\n\ttype Import as ImportPb,\n\tImportPhase as ImportPhasePb,\n\tImportService,\n} from \"../../../../gen/ts/importhub/v1/import_pb\";\nimport {\n\tImportProfileContentSchema,\n\ttype ImportProfile as ImportProfilePb,\n\tImportProfileService,\n\ttype ProcessorStep as ProcessorStepPb,\n\tProcessorStepSchema,\n} from \"../../../../gen/ts/importhub/v1/import_profile_pb\";\nimport {\n\tMappingContentSchema,\n\ttype Mapping as MappingPb,\n\tMappingService,\n} from \"../../../../gen/ts/importhub/v1/mapping_pb\";\nimport {\n\tProcessorKind,\n\tProcessorService,\n\tProcessorTarget,\n} from \"../../../../gen/ts/importhub/v1/processor_pb\";\nimport {\n\ttype ApiKey,\n\ttype ConfigurationComparison,\n\ttype ConfigurationHistoryPage,\n\tConfigurationInUseError,\n\ttype ConfigurationReleaseRecord,\n\ttype ConfigurationState,\n\ttype ConfigurationVersion,\n\ttype EntitySet,\n\ttype FieldComparisonStatus,\n\ttype Import,\n\ttype ImporthubClient,\n\ttype ImportOutcome,\n\ttype ImportPhase,\n\ttype ImportProfile,\n\ttype ImportProfileContent,\n\ttype ImportReleaseRef,\n\ttype Mapping,\n\ttype MappingContent,\n\tNameTakenError,\n\ttype ProcessorStep,\n\tReleaseRefusedError,\n\tStartRefusedError,\n\ttype Validity,\n} from \"./importhub-client\";\n\nexport interface CreateConnectImporthubClientOptions {\n\t/**\n\t * Base URL on the host origin under which `/importhub.v1.…Service/…` is\n\t * served: \"\" when importhub serves the page itself (the Standalone App),\n\t * the mount prefix when a host proxies it.\n\t */\n\tbaseUrl: string;\n\t/**\n\t * The fetch the transport calls, e.g. one that adds `credentials:\n\t * \"include\"` so a session cookie travels, or a host's own token.\n\t */\n\tfetch?: typeof fetch;\n\t/** A pre-built transport (tests: `createRouterTransport`). Overrides baseUrl and fetch. */\n\ttransport?: Transport;\n\t/**\n\t * How a Source File's content is sent to the upload URL importhub hands\n\t * out; `putToBlobStore` by default. Tests in Node, which has no\n\t * XMLHttpRequest, pass their own.\n\t */\n\tputFile?: (url: string, file: File, onProgress: (fraction: number) => void) => Promise<void>;\n}\n\n/**\n * Sends a file to an upload URL of importhub's blob store: one `PUT` with\n * `x-ms-blob-type: BlockBlob`, as CreateSourceFileUpload asks. Through\n * XMLHttpRequest, not fetch, because only XHR reports upload progress\n * (mediahub-ui's lib/sas-upload.ts does the same). No credentials travel: the\n * URL carries its own short-lived signature, and the blob store is another\n * origin.\n */\nexport function putToBlobStore(\n\turl: string,\n\tfile: File,\n\tonProgress: (fraction: number) => void,\n): Promise<void> {\n\treturn new Promise((resolve, reject) => {\n\t\tconst xhr = new XMLHttpRequest();\n\t\txhr.open(\"PUT\", url);\n\t\txhr.setRequestHeader(\"x-ms-blob-type\", \"BlockBlob\");\n\t\txhr.setRequestHeader(\"Content-Type\", file.type || \"application/xml\");\n\t\txhr.upload.onprogress = (e) => {\n\t\t\tif (e.lengthComputable && e.total > 0) onProgress(e.loaded / e.total);\n\t\t};\n\t\txhr.onload = () => {\n\t\t\tif (xhr.status >= 200 && xhr.status < 300) {\n\t\t\t\tonProgress(1);\n\t\t\t\tresolve();\n\t\t\t} else {\n\t\t\t\treject(new Error(`the upload failed: ${xhr.status} ${xhr.statusText}`));\n\t\t\t}\n\t\t};\n\t\txhr.onerror = () => reject(new Error(\"the upload failed: the network is away\"));\n\t\txhr.send(file);\n\t});\n}\n\nconst validityOf = (v: ValidityPb | undefined): Validity => ({\n\tvalid: v?.valid ?? false,\n\treasons: (v?.reasons ?? []).map((r) => ({ path: r.path, code: r.code, message: r.message })),\n});\n\nconst stateOf = (s: ConfigurationStatePb | undefined): ConfigurationState => ({\n\tdraftRevisionId: s?.draftRevisionId ?? \"\",\n\tdraftDiffersFromRelease: s?.draftDiffersFromRelease ?? true,\n\t...(s?.latestRelease\n\t\t? { latestRelease: { id: s.latestRelease.id, number: s.latestRelease.number } }\n\t\t: {}),\n});\n\nconst stepOf = (s: ProcessorStepPb): ProcessorStep => ({\n\tprocessor: s.processor,\n\tsettings: { ...(s.settings ?? {}) },\n});\n\nconst stepPb = (s: ProcessorStep) => ({\n\tprocessor: s.processor,\n\tsettings: s.settings as JsonObject,\n});\n\nfunction profileOf(p: ImportProfilePb): ImportProfile {\n\tconst c = p.content;\n\treturn {\n\t\tid: p.id,\n\t\tcontent: {\n\t\t\tname: c?.name ?? \"\",\n\t\t\tdescription: c?.description ?? \"\",\n\t\t\tentitySetId: c?.entitySetId ?? \"\",\n\t\t\tpreprocessors: (c?.preprocessors ?? []).map(stepOf),\n\t\t\tmappingIds: [...(c?.mappingIds ?? [])],\n\t\t\tpostProcessors: (c?.postProcessors ?? []).map(stepOf),\n\t\t\tautoPublish: c?.autoPublish ?? false,\n\t\t\tdeleteSourceFileOnSuccess: c?.deleteSourceFileOnSuccess ?? false,\n\t\t},\n\t\t// What an Import would meet now, not only what was decided at the save\n\t\t// (manage-import-profiles:AC6).\n\t\tvalidity: validityOf(p.currentValidity ?? p.validity),\n\t\tstate: stateOf(p.state),\n\t};\n}\n\nconst profileContentPb = (c: ImportProfileContent) =>\n\tcreate(ImportProfileContentSchema, {\n\t\t...c,\n\t\tpreprocessors: c.preprocessors.map((s) => create(ProcessorStepSchema, stepPb(s))),\n\t\tpostProcessors: c.postProcessors.map((s) => create(ProcessorStepSchema, stepPb(s))),\n\t});\n\n// A Mapping's content travels as its proto JSON: the screens edit a few\n// fields, and every other one (F4's) must come back exactly as it went out.\nfunction mappingOf(m: MappingPb): Mapping {\n\tconst content = m.content\n\t\t? (toJson(MappingContentSchema, m.content) as unknown as MappingContent)\n\t\t: ({ name: \"\", blueprintId: \"\", blueprintReleaseId: \"\" } as MappingContent);\n\treturn {\n\t\tid: m.id,\n\t\tcontent: {\n\t\t\t...content,\n\t\t\tname: content.name ?? \"\",\n\t\t\tblueprintId: content.blueprintId ?? \"\",\n\t\t\tblueprintReleaseId: content.blueprintReleaseId ?? \"\",\n\t\t},\n\t\tvalidity: validityOf(m.currentValidity ?? m.validity),\n\t\tstate: stateOf(m.state),\n\t};\n}\n\nconst mappingContentPb = (c: MappingContent) =>\n\tfromJson(MappingContentSchema, c as unknown as JsonValue, { ignoreUnknownFields: false });\n\nfunction entitySetOf(e: EntitySetPb): EntitySet {\n\treturn {\n\t\tid: e.id,\n\t\tcontent: {\n\t\t\tname: e.content?.name ?? \"\",\n\t\t\tdescription: e.content?.description ?? \"\",\n\t\t\tentities: { ...(e.content?.entities ?? {}) },\n\t\t},\n\t\tvalidity: validityOf(e.validity),\n\t\tstate: stateOf(e.state),\n\t};\n}\n\nconst isoOf = (t: Timestamp | undefined): string => (t ? timestampDate(t).toISOString() : \"\");\n\nconst releaseOf = (r: ConfigurationReleasePb | undefined): ConfigurationReleaseRecord => ({\n\tid: r?.id ?? \"\",\n\tnumber: r?.number ?? 0,\n\trevisionId: r?.revisionId ?? \"\",\n\treleasedBy: r?.releasedBy ?? \"\",\n\treleasedAt: isoOf(r?.releasedAt),\n});\n\nconst revisionOf = (r: ConfigurationRevisionPb) => ({\n\tid: r.id,\n\tsavedBy: r.savedBy,\n\tsavedAt: isoOf(r.savedAt),\n\tvalidity: validityOf(r.validity),\n\trestoredFromRevisionId: r.restoredFromRevisionId,\n});\n\nconst historyOf = (res: {\n\trevisions: ConfigurationRevisionPb[];\n\treleases: ConfigurationReleasePb[];\n\tnextPageToken: string;\n}): ConfigurationHistoryPage => ({\n\trevisions: res.revisions.map(revisionOf),\n\treleases: res.releases.map(releaseOf),\n\tnextPageToken: res.nextPageToken,\n});\n\nconst STATUS: Record<FieldComparisonStatusPb, FieldComparisonStatus> = {\n\t[FieldComparisonStatusPb.UNSPECIFIED]: \"changed\",\n\t[FieldComparisonStatusPb.UNCHANGED]: \"unchanged\",\n\t[FieldComparisonStatusPb.ADDED]: \"added\",\n\t[FieldComparisonStatusPb.REMOVED]: \"removed\",\n\t[FieldComparisonStatusPb.CHANGED]: \"changed\",\n};\n\n// A compared Revision's content as JSON in the proto's own field names, the\n// names importhub's FieldComparison uses, and with every field present, so\n// a side by side reads the same rows on both sides.\nconst versionOf = <M extends { revisionId: string }, C>(\n\tm: (M & { content?: C }) | undefined,\n\tasJson: (c: C) => JsonValue,\n): ConfigurationVersion => ({\n\trevisionId: m?.revisionId ?? \"\",\n\tcontent: m?.content ? (asJson(m.content) as Record<string, unknown>) : {},\n});\nconst JSON_OPTS = { useProtoFieldName: true, alwaysEmitImplicit: true } as const;\n\nconst comparisonOf = <M extends { revisionId: string }, C>(\n\tres: { from?: M & { content?: C }; to?: M & { content?: C }; fields: FieldComparisonPb[] },\n\tasJson: (c: C) => JsonValue,\n): ConfigurationComparison => ({\n\tfrom: versionOf(res.from, asJson),\n\tto: versionOf(res.to, asJson),\n\tfields: res.fields.map((f) => ({ field: f.field, status: STATUS[f.status] ?? \"changed\" })),\n});\n\nconst PHASES: Record<ImportPhasePb, ImportPhase> = {\n\t[ImportPhasePb.UNSPECIFIED]: \"queued\",\n\t[ImportPhasePb.QUEUED]: \"queued\",\n\t[ImportPhasePb.READING]: \"reading\",\n\t[ImportPhasePb.WRITING]: \"writing\",\n\t[ImportPhasePb.ENDED]: \"ended\",\n};\n\nconst OUTCOMES: Partial<Record<ImportOutcomePb, ImportOutcome>> = {\n\t[ImportOutcomePb.SUCCEEDED]: \"succeeded\",\n\t[ImportOutcomePb.SUCCEEDED_WITH_PROBLEMS]: \"succeeded_with_problems\",\n\t[ImportOutcomePb.FAILED]: \"failed\",\n\t[ImportOutcomePb.CANCELLED]: \"cancelled\",\n};\n\nconst releaseRefOf = (r: ConfigurationReleaseRefPb): ImportReleaseRef => ({\n\tconfigurationId: r.configurationId,\n\tname: r.name,\n\treleaseId: r.releaseId,\n\tnumber: r.number,\n});\n\nfunction importOf(i: ImportPb): Import {\n\tconst c = i.counts;\n\tconst outcome = OUTCOMES[i.outcome];\n\treturn {\n\t\tid: i.id,\n\t\timportProfileId: i.importProfileId,\n\t\timportProfileName: i.importProfileName,\n\t\tsourceFileId: i.sourceFileId,\n\t\tstartedBy: i.startedBy,\n\t\tphase: PHASES[i.phase] ?? \"queued\",\n\t\t...(outcome ? { outcome } : {}),\n\t\tfailureReason: i.failureReason,\n\t\tprogress: { done: i.progress?.done ?? 0, total: i.progress?.total ?? 0 },\n\t\tcounts: {\n\t\t\tmatched: c?.matched ?? 0,\n\t\t\tcreated: c?.created ?? 0,\n\t\t\tproblems: c?.problems ?? 0,\n\t\t\tplanned: c?.planned ?? 0,\n\t\t\tcorrected: c?.corrected ?? 0,\n\t\t\tkept: c?.kept ?? 0,\n\t\t\tunchanged: c?.unchanged ?? 0,\n\t\t},\n\t\tchangeSetId: i.changeSetId,\n\t\treleases: {\n\t\t\t...(i.releases?.importProfile\n\t\t\t\t? { importProfile: releaseRefOf(i.releases.importProfile) }\n\t\t\t\t: {}),\n\t\t\tmappings: (i.releases?.mappings ?? []).map(releaseRefOf),\n\t\t\t...(i.releases?.entitySet ? { entitySet: releaseRefOf(i.releases.entitySet) } : {}),\n\t\t},\n\t\tcreateTime: isoOf(i.createTime),\n\t\tstartTime: isoOf(i.startTime),\n\t\tendTime: isoOf(i.endTime),\n\t\tcancelledBy: i.cancelledBy,\n\t\teffectiveDate: i.effectiveDate,\n\t\t...(i.source ? { source: { date: i.source.date, reference: i.source.reference } } : {}),\n\t};\n}\n\nconst apiKeyOf = (k: APIKeyPb): ApiKey => ({\n\tid: k.id,\n\tname: k.name,\n\tkeyPrefix: k.keyPrefix,\n\towner: k.owner,\n\texpireTime: isoOf(k.expireTime),\n\tcreateTime: isoOf(k.createTime),\n});\n\n/**\n * As `call`, but a refused Start is a StartRefusedError: PermissionDenied\n * names the right the starter lacks (contenthub `editor`, or `publisher` for\n * Auto-publish, or importhub's own `importer`), FailedPrecondition what of\n * the configuration has no Release or is invalid now, NotFound a Profile or\n * Source File gone meanwhile (StartImport's contract). Its message is importhub's, which the screen shows as it is.\n */\nasync function startCall<T>(run: () => Promise<T>): Promise<T> {\n\ttry {\n\t\treturn await run();\n\t} catch (err) {\n\t\tconst e = ConnectError.from(err);\n\t\tif (\n\t\t\te.code === Code.PermissionDenied ||\n\t\t\te.code === Code.FailedPrecondition ||\n\t\t\te.code === Code.NotFound\n\t\t) {\n\t\t\tthrow new StartRefusedError(e.rawMessage);\n\t\t}\n\t\tthrow e;\n\t}\n}\n\n/**\n * The errors a screen tells apart: a delete refused because Profiles use the\n * configuration, with them; a name another one has; and a cut refused, with\n * the draft's reasons when it is invalid. Anything else is thrown as it came.\n */\nfunction translate(err: unknown): never {\n\tconst e = ConnectError.from(err);\n\tif (e.code === Code.FailedPrecondition) {\n\t\tconst [inUse] = e.findDetails(ConfigurationInUseSchema);\n\t\tif (inUse) {\n\t\t\tthrow new ConfigurationInUseError(\n\t\t\t\tinUse.importProfiles.map((p) => ({ id: p.id, name: p.name })),\n\t\t\t\te.rawMessage,\n\t\t\t);\n\t\t}\n\t}\n\tif (e.code === Code.AlreadyExists) throw new NameTakenError(e.rawMessage);\n\tthrow e;\n}\n\n/**\n * As `call`, but a refused cut is a ReleaseRefusedError. FailedPrecondition\n * is how every Cut…Release RPC refuses (an invalid draft, with its Validity\n * as a detail; an unchanged draft; a draft that moved), and the only thing\n * it means there.\n */\nasync function cutCall<T>(run: () => Promise<T>): Promise<T> {\n\ttry {\n\t\treturn await run();\n\t} catch (err) {\n\t\tconst e = ConnectError.from(err);\n\t\tif (e.code === Code.FailedPrecondition) {\n\t\t\tconst [validity] = e.findDetails(ValiditySchema);\n\t\t\tthrow new ReleaseRefusedError(e.rawMessage, validity ? validityOf(validity) : undefined);\n\t\t}\n\t\ttranslate(err);\n\t}\n}\n\nasync function call<T>(run: () => Promise<T>): Promise<T> {\n\ttry {\n\t\treturn await run();\n\t} catch (err) {\n\t\ttranslate(err);\n\t}\n}\n\n/**\n * The one call a host makes to talk to importhub (knkcms/core ADR 0003):\n * an `ImporthubClient` over Connect.\n */\nexport function createConnectImporthubClient(\n\toptions: CreateConnectImporthubClientOptions,\n): ImporthubClient {\n\tconst transport =\n\t\toptions.transport ?? createConnectTransport({ baseUrl: options.baseUrl, fetch: options.fetch });\n\tconst profiles = createClient(ImportProfileService, transport);\n\tconst processors = createClient(ProcessorService, transport);\n\tconst mappings = createClient(MappingService, transport);\n\tconst entitySets = createClient(EntitySetService, transport);\n\tconst imports = createClient(ImportService, transport);\n\tconst apiKeys = createClient(APIKeyService, transport);\n\tconst putFile = options.putFile ?? putToBlobStore;\n\treturn {\n\t\tlistImportProfiles: () =>\n\t\t\tcall(async () => (await profiles.listImportProfiles({})).importProfiles.map(profileOf)),\n\t\tgetImportProfile: (id) =>\n\t\t\tcall(async () =>\n\t\t\t\tprofileOf(requireMessage((await profiles.getImportProfile({ id })).importProfile)),\n\t\t\t),\n\t\tcreateImportProfile: (content) =>\n\t\t\tcall(async () =>\n\t\t\t\tprofileOf(\n\t\t\t\t\trequireMessage(\n\t\t\t\t\t\t(await profiles.createImportProfile({ content: profileContentPb(content) }))\n\t\t\t\t\t\t\t.importProfile,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\tupdateImportProfile: (id, content, draftRevisionId) =>\n\t\t\tcall(async () =>\n\t\t\t\tprofileOf(\n\t\t\t\t\trequireMessage(\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tawait profiles.updateImportProfile({\n\t\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\t\tcontent: profileContentPb(content),\n\t\t\t\t\t\t\t\tdraftRevisionId,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t).importProfile,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\tdeleteImportProfile: (id) =>\n\t\t\tcall(async () => {\n\t\t\t\tawait profiles.deleteImportProfile({ id });\n\t\t\t}),\n\n\t\tlistProcessors: () =>\n\t\t\tcall(async () =>\n\t\t\t\t(await processors.listProcessors({})).processors.map((p) => ({\n\t\t\t\t\tname: p.name,\n\t\t\t\t\tkind:\n\t\t\t\t\t\tp.kind === ProcessorKind.POST_PROCESSOR\n\t\t\t\t\t\t\t? (\"post_processor\" as const)\n\t\t\t\t\t\t\t: (\"preprocessor\" as const),\n\t\t\t\t\ttarget:\n\t\t\t\t\t\tp.target === ProcessorTarget.RICH_TEXT_FIELD\n\t\t\t\t\t\t\t? (\"rich_text_field\" as const)\n\t\t\t\t\t\t\t: (\"source_file\" as const),\n\t\t\t\t\tdescription: p.description,\n\t\t\t\t\tsettingsSpec: p.settingsSpec as unknown as Schema,\n\t\t\t\t})),\n\t\t\t),\n\n\t\tlistMappings: () => call(async () => (await mappings.listMappings({})).mappings.map(mappingOf)),\n\t\tgetMapping: (id) =>\n\t\t\tcall(async () => mappingOf(requireMessage((await mappings.getMapping({ id })).mapping))),\n\t\tcreateMapping: (content) =>\n\t\t\tcall(async () =>\n\t\t\t\tmappingOf(\n\t\t\t\t\trequireMessage(\n\t\t\t\t\t\t(await mappings.createMapping({ content: mappingContentPb(content) })).mapping,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\tupdateMapping: (id, content, draftRevisionId) =>\n\t\t\tcall(async () =>\n\t\t\t\tmappingOf(\n\t\t\t\t\trequireMessage(\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tawait mappings.updateMapping({\n\t\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\t\tcontent: mappingContentPb(content),\n\t\t\t\t\t\t\t\tdraftRevisionId,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t).mapping,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\tdeleteMapping: (id) =>\n\t\t\tcall(async () => {\n\t\t\t\tawait mappings.deleteMapping({ id });\n\t\t\t}),\n\t\tlistMappingImportProfiles: (id) =>\n\t\t\tcall(async () =>\n\t\t\t\t(await mappings.listMappingImportProfiles({ id })).importProfiles.map((p) => ({\n\t\t\t\t\tid: p.id,\n\t\t\t\t\tname: p.name,\n\t\t\t\t})),\n\t\t\t),\n\t\tcheckMappingBlueprintRelease: (id, blueprintReleaseId) =>\n\t\t\tcall(async () => {\n\t\t\t\tconst res = await mappings.checkMappingBlueprintRelease({ id, blueprintReleaseId });\n\t\t\t\treturn {\n\t\t\t\t\tblueprintId: res.blueprintId,\n\t\t\t\t\tmissingFieldPaths: [...res.missingFieldPaths],\n\t\t\t\t\tmissingReleaseSpecFields: [...res.missingReleaseSpecFields],\n\t\t\t\t};\n\t\t\t}),\n\n\t\tlistEntitySets: () =>\n\t\t\tcall(async () => (await entitySets.listEntitySets({})).entitySets.map(entitySetOf)),\n\t\tgetEntitySet: (id) =>\n\t\t\tcall(async () =>\n\t\t\t\tentitySetOf(requireMessage((await entitySets.getEntitySet({ id })).entitySet)),\n\t\t\t),\n\t\tcreateEntitySet: (content) =>\n\t\t\tcall(async () =>\n\t\t\t\tentitySetOf(requireMessage((await entitySets.createEntitySet({ content })).entitySet)),\n\t\t\t),\n\t\tupdateEntitySet: (id, content, draftRevisionId) =>\n\t\t\tcall(async () =>\n\t\t\t\tentitySetOf(\n\t\t\t\t\trequireMessage(\n\t\t\t\t\t\t(await entitySets.updateEntitySet({ id, content, draftRevisionId })).entitySet,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\tdeleteEntitySet: (id) =>\n\t\t\tcall(async () => {\n\t\t\t\tawait entitySets.deleteEntitySet({ id });\n\t\t\t}),\n\n\t\t// One RPC per kind of configuration, each on its own service (the\n\t\t// protos have no configuration service: a client always knows which\n\t\t// kind it looks at); the screens ask by kind.\n\t\tcutRelease: (kind, id, draftRevisionId) =>\n\t\t\tcutCall(async () => {\n\t\t\t\tconst req = { id, draftRevisionId };\n\t\t\t\tswitch (kind) {\n\t\t\t\t\tcase \"importProfile\":\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\trelease: releaseOf((await profiles.cutImportProfileRelease(req)).release),\n\t\t\t\t\t\t\timportProfiles: [],\n\t\t\t\t\t\t};\n\t\t\t\t\tcase \"mapping\": {\n\t\t\t\t\t\tconst res = await mappings.cutMappingRelease(req);\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\trelease: releaseOf(res.release),\n\t\t\t\t\t\t\timportProfiles: res.importProfiles.map((p) => ({ id: p.id, name: p.name })),\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\tcase \"entitySet\":\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\trelease: releaseOf((await entitySets.cutEntitySetRelease(req)).release),\n\t\t\t\t\t\t\timportProfiles: [],\n\t\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}),\n\t\tlistHistory: (kind, id, pageToken) =>\n\t\t\tcall(async () => {\n\t\t\t\tconst req = { id, pageToken };\n\t\t\t\tswitch (kind) {\n\t\t\t\t\tcase \"importProfile\":\n\t\t\t\t\t\treturn historyOf(await profiles.listImportProfileHistory(req));\n\t\t\t\t\tcase \"mapping\":\n\t\t\t\t\t\treturn historyOf(await mappings.listMappingHistory(req));\n\t\t\t\t\tcase \"entitySet\":\n\t\t\t\t\t\treturn historyOf(await entitySets.listEntitySetHistory(req));\n\t\t\t\t}\n\t\t\t}),\n\t\tcompareRevisions: (kind, id, fromRevisionId, toRevisionId) =>\n\t\t\tcall(async () => {\n\t\t\t\tconst req = { id, fromRevisionId, toRevisionId };\n\t\t\t\tswitch (kind) {\n\t\t\t\t\tcase \"importProfile\":\n\t\t\t\t\t\treturn comparisonOf(await profiles.compareImportProfileRevisions(req), (c) =>\n\t\t\t\t\t\t\ttoJson(ImportProfileContentSchema, c, JSON_OPTS),\n\t\t\t\t\t\t);\n\t\t\t\t\tcase \"mapping\":\n\t\t\t\t\t\treturn comparisonOf(await mappings.compareMappingRevisions(req), (c) =>\n\t\t\t\t\t\t\ttoJson(MappingContentSchema, c, JSON_OPTS),\n\t\t\t\t\t\t);\n\t\t\t\t\tcase \"entitySet\":\n\t\t\t\t\t\treturn comparisonOf(await entitySets.compareEntitySetRevisions(req), (c) =>\n\t\t\t\t\t\t\ttoJson(EntitySetContentSchema, c, JSON_OPTS),\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}),\n\t\trestoreRevision: (kind, id, revisionId, draftRevisionId) =>\n\t\t\tcall(async () => {\n\t\t\t\tconst req = { id, revisionId, draftRevisionId };\n\t\t\t\tswitch (kind) {\n\t\t\t\t\tcase \"importProfile\":\n\t\t\t\t\t\tawait profiles.restoreImportProfileRevision(req);\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase \"mapping\":\n\t\t\t\t\t\tawait mappings.restoreMappingRevision(req);\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase \"entitySet\":\n\t\t\t\t\t\tawait entitySets.restoreEntitySetRevision(req);\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}),\n\n\t\tuploadSourceFile: (file, onProgress) =>\n\t\t\tcall(async () => {\n\t\t\t\tconst res = await imports.createSourceFileUpload({ fileName: file.name });\n\t\t\t\tconst sf = requireMessage(res.sourceFile);\n\t\t\t\tawait putFile(res.uploadUrl, file, onProgress);\n\t\t\t\treturn { id: sf.id, fileName: sf.fileName };\n\t\t\t}),\n\t\tstartImport: (input) =>\n\t\t\tstartCall(async () =>\n\t\t\t\timportOf(\n\t\t\t\t\trequireMessage(\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tawait imports.startImport({\n\t\t\t\t\t\t\t\timportProfileId: input.importProfileId,\n\t\t\t\t\t\t\t\tsourceFileId: input.sourceFileId,\n\t\t\t\t\t\t\t\teffectiveDate: input.effectiveDate ?? \"\",\n\t\t\t\t\t\t\t\tsource: input.source,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t).import,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\tlistImports: (pageToken) =>\n\t\t\tcall(async () => {\n\t\t\t\tconst res = await imports.listImports({ pageToken });\n\t\t\t\treturn { imports: res.imports.map(importOf), nextPageToken: res.nextPageToken };\n\t\t\t}),\n\t\tgetImport: (id) =>\n\t\t\tcall(async () => importOf(requireMessage((await imports.getImport({ id })).import))),\n\t\tcancelImport: (id) =>\n\t\t\tcall(async () => importOf(requireMessage((await imports.cancelImport({ id })).import))),\n\t\tlistItemProblems: (importId, filter) =>\n\t\t\tcall(async () => {\n\t\t\t\tconst res = await imports.listItemProblems({\n\t\t\t\t\timportId,\n\t\t\t\t\tmappingId: filter.mappingId,\n\t\t\t\t\tsourceKeyQuery: filter.sourceKeyQuery,\n\t\t\t\t\tpageToken: filter.pageToken,\n\t\t\t\t});\n\t\t\t\treturn {\n\t\t\t\t\titemProblems: res.itemProblems.map((p) => ({\n\t\t\t\t\t\tid: p.id,\n\t\t\t\t\t\tmappingId: p.mappingId,\n\t\t\t\t\t\tmappingName: p.mappingName,\n\t\t\t\t\t\tsourceKey: p.sourceKey,\n\t\t\t\t\t\tfield: p.field,\n\t\t\t\t\t\treason: p.reason,\n\t\t\t\t\t})),\n\t\t\t\t\ttotalCount: res.totalCount,\n\t\t\t\t\tmatchingCount: res.matchingCount,\n\t\t\t\t\tmappings: res.mappings.map((m) => ({\n\t\t\t\t\t\tmappingId: m.mappingId,\n\t\t\t\t\t\tmappingName: m.mappingName,\n\t\t\t\t\t\tcount: m.count,\n\t\t\t\t\t})),\n\t\t\t\t\tnextPageToken: res.nextPageToken,\n\t\t\t\t};\n\t\t\t}),\n\n\t\tlistApiKeys: () => call(async () => (await apiKeys.listAPIKeys({})).apiKeys.map(apiKeyOf)),\n\t\tcreateApiKey: (input) =>\n\t\t\tcall(async () => {\n\t\t\t\tconst res = await apiKeys.createAPIKey({\n\t\t\t\t\tname: input.name,\n\t\t\t\t\t// Unset for never, as CreateAPIKey reads it.\n\t\t\t\t\texpireTime: input.expireTime ? timestampFromDate(new Date(input.expireTime)) : undefined,\n\t\t\t\t});\n\t\t\t\treturn { apiKey: apiKeyOf(requireMessage(res.apiKey)), secret: res.secret };\n\t\t\t}),\n\t\trevokeApiKey: (id) =>\n\t\t\tcall(async () => {\n\t\t\t\tawait apiKeys.revokeAPIKey({ id });\n\t\t\t}),\n\t};\n}\n\n/** A response's one message, which importhub always sets. */\nfunction requireMessage<T>(m: T | undefined): T {\n\tif (m === undefined)\n\t\tthrow new ConnectError(\"importhub answered without a message\", Code.Internal);\n\treturn m;\n}\n","import { Link } from \"@knkcs/anker/primitives\";\nimport { ExternalLink } from \"lucide-react\";\nimport { useTranslation } from \"react-i18next\";\nimport { IMPORTHUB_UI_NS } from \"../i18n/resources\";\nimport { useImporthubHost } from \"./host\";\n\nexport interface ChangeSetLinkProps {\n\tchangeSetId: string;\n}\n\n/**\n * The link out to a Change Set in contenthub, where the host says it is\n * (`ImporthubHost.changeSetHref`). Nothing when the host has no address for\n * it: a link to nowhere is worse than none.\n */\nexport function ChangeSetLink({ changeSetId }: ChangeSetLinkProps) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst href = useImporthubHost().changeSetHref(changeSetId);\n\tif (!href) return null;\n\treturn (\n\t\t<Link href={href} target=\"_blank\" rel=\"noopener noreferrer\">\n\t\t\t{t(\"changeSet.open\")}\n\t\t\t<ExternalLink size={14} aria-hidden />\n\t\t</Link>\n\t);\n}\n","import { EmptyState } from \"@knkcs/anker/atoms\";\nimport { useHostIdentity } from \"@knkcs/anker/host\";\nimport { Box, Spinner } from \"@knkcs/anker/primitives\";\nimport { IndexPageTemplate } from \"@knkcs/anker/templates\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport { Ampersand, Blocks, FileCog, FileUp, type LucideIcon, Waypoints } from \"lucide-react\";\nimport { useTranslation } from \"react-i18next\";\nimport type { ImporthubClient } from \"../client/importhub-client\";\nimport { IMPORTHUB_UI_NS } from \"../i18n/resources\";\nimport type { ImporthubSection } from \"./host\";\nimport { importhubKeys } from \"./query-keys\";\n\nexport interface ImporthubStartPageProps {\n\tclient: ImporthubClient;\n\t/** The section whose start page this is. */\n\tsection: ImporthubSection;\n}\n\n/** Each section's icon, as the Standalone App's sidebar shows it too. */\nexport const IMPORTHUB_SECTION_ICONS: Record<ImporthubSection, LucideIcon> = {\n\timports: FileUp,\n\tprofiles: FileCog,\n\tmappings: Waypoints,\n\tentitySets: Ampersand,\n\tprocessors: Blocks,\n};\n\n/**\n * A section's start page, for a host that has no screen for it yet: the section's\n * title in the frame, and a body saying what the workspace holds of it. Where\n * importhub can already list a section it says how many there are, read for the host's active workspace; Imports have\n * nothing to read yet, and Mappings are counted on their own screen.\n */\nexport function ImporthubStartPage({ client, section }: ImporthubStartPageProps) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst Icon = IMPORTHUB_SECTION_ICONS[section];\n\treturn (\n\t\t<IndexPageTemplate title={t(`section.${section}.title`)}>\n\t\t\t<Box px=\"8\" py=\"6\">\n\t\t\t\t<EmptyState\n\t\t\t\t\ticon={<Icon size={32} aria-hidden />}\n\t\t\t\t\theader={t(`section.${section}.title`)}\n\t\t\t\t\tdescription={<SectionSummary client={client} section={section} />}\n\t\t\t\t/>\n\t\t\t</Box>\n\t\t</IndexPageTemplate>\n\t);\n}\n\nfunction SectionSummary({ client, section }: ImporthubStartPageProps) {\n\tswitch (section) {\n\t\tcase \"profiles\":\n\t\t\treturn (\n\t\t\t\t<CountSummary\n\t\t\t\t\tsection={section}\n\t\t\t\t\tqueryKey={importhubKeys.importProfiles}\n\t\t\t\t\tread={() => client.listImportProfiles()}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase \"entitySets\":\n\t\t\treturn (\n\t\t\t\t<CountSummary\n\t\t\t\t\tsection={section}\n\t\t\t\t\tqueryKey={importhubKeys.entitySets}\n\t\t\t\t\tread={() => client.listEntitySets()}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase \"processors\":\n\t\t\treturn (\n\t\t\t\t<CountSummary\n\t\t\t\t\tsection={section}\n\t\t\t\t\tqueryKey={importhubKeys.processors}\n\t\t\t\t\tread={() => client.listProcessors()}\n\t\t\t\t/>\n\t\t\t);\n\t\tdefault:\n\t\t\treturn <NothingYet section={section} />;\n\t}\n}\n\nfunction NothingYet({ section }: { section: \"imports\" | \"mappings\" }) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\treturn <>{t(`section.${section}.empty`)}</>;\n}\n\nfunction CountSummary({\n\tsection,\n\tqueryKey,\n\tread,\n}: {\n\tsection: \"profiles\" | \"entitySets\" | \"processors\";\n\t/** The section's query key for a workspace (`importhubKeys`). */\n\tqueryKey: (workspaceId: string) => readonly unknown[];\n\tread: () => Promise<unknown[]>;\n}) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { workspaceId } = useHostIdentity();\n\tconst query = useQuery({ queryKey: queryKey(workspaceId), queryFn: read });\n\tif (query.isPending) return <Spinner size=\"sm\" aria-label={t(\"startPage.loading\")} />;\n\t// Text, not an Alert: the summary is the EmptyState's description, a\n\t// paragraph, which can hold no block.\n\tif (query.isError) return <>{t(\"startPage.error\")}</>;\n\treturn <>{t(`section.${section}.summary`, { count: query.data.length })}</>;\n}\n","import { StatusBadge, type StatusBadgeTone } from \"@knkcs/anker/atoms\";\nimport { StatusBadgeCell } from \"@knkcs/anker/components\";\nimport { useHostIdentity } from \"@knkcs/anker/host\";\nimport type { TFunction } from \"i18next\";\nimport { useCallback } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport type { Import } from \"../client/importhub-client\";\nimport { IMPORTHUB_UI_NS } from \"../i18n/resources\";\n\n/** Where an Import stands, as one word: its Outcome once it has one, else its phase. */\ntype ImportState =\n\t| \"queued\"\n\t| \"reading\"\n\t| \"writing\"\n\t| \"cancelling\"\n\t| \"succeeded\"\n\t| \"succeeded_with_problems\"\n\t| \"failed\"\n\t| \"cancelled\";\n\n// A cancel asked of a running Import shows as Cancelling until the worker\n// reaches its next item and ends it (CancelImport's contract): the person who\n// asked sees their ask was heard, before the Outcome arrives.\nfunction statusOf(im: Import): ImportState {\n\tif (im.outcome) return im.outcome;\n\tif (im.cancelledBy) return \"cancelling\";\n\treturn im.phase === \"ended\" ? \"succeeded\" : im.phase;\n}\n\nconst TONES: Record<ImportState, StatusBadgeTone> = {\n\tqueued: \"neutral\",\n\treading: \"info\",\n\twriting: \"info\",\n\tcancelling: \"warning\",\n\tsucceeded: \"success\",\n\tsucceeded_with_problems: \"warning\",\n\tfailed: \"danger\",\n\tcancelled: \"neutral\",\n};\n\nfunction labelOf(status: ImportState, t: TFunction): string {\n\tswitch (status) {\n\t\tcase \"queued\":\n\t\tcase \"reading\":\n\t\tcase \"writing\":\n\t\tcase \"cancelling\":\n\t\t\treturn t(`imports.phase.${status}`);\n\t\tdefault:\n\t\t\treturn t(`imports.outcome.${status}`);\n\t}\n}\n\n/**\n * How often a list or page showing a queued or running Import reads it\n * again, by default: importhub pushes nothing, and two seconds keeps the\n * progress alive without hammering it.\n */\nexport const DEFAULT_POLL_INTERVAL_MS = 2000;\n\n/** Whether an Import is still to end: queued or running. */\nexport const isRunning = (im: Import): boolean => im.phase !== \"ended\";\n\n/** An Import's status as the page header's badge. */\nexport function ImportStatusBadge({ im }: { im: Import }) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst status = statusOf(im);\n\treturn <StatusBadge tone={TONES[status]} label={labelOf(status, t)} />;\n}\n\n/** An Import's status in a list's column. */\nexport function ImportStatusCell({ im }: { im: Import }) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst status = statusOf(im);\n\treturn (\n\t\t<StatusBadgeCell value={labelOf(status, t)} toneMap={{ [labelOf(status, t)]: TONES[status] }} />\n\t);\n}\n\n/**\n * Names a person by their odon user id, through the host's members; an id\n * is never shown (anker: never label a thing with an id). One the members do\n * not hold is \"Someone\": a host may list only some members (the Standalone\n * App knows only the viewer), so it cannot say they left.\n */\nexport function usePersonName(): (userId: string) => string {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { members } = useHostIdentity();\n\treturn useCallback(\n\t\t(userId: string) => members.byId(userId)?.displayName ?? t(\"imports.someone\"),\n\t\t[members, t],\n\t);\n}\n","import { useImporthubHost } from \"./host\";\n\n/**\n * Whether to offer the viewer Start and Cancel: the host's `canImport`, and\n * neither when it says nothing (control-who-may-import:AC1,\n * follow-an-import:AC8).\n */\nexport function useCanImport(): boolean {\n\treturn useImporthubHost().canImport ?? false;\n}\n","import { Button, ClipboardInput } from \"@knkcs/anker/atoms\";\nimport { Modal } from \"@knkcs/anker/components\";\nimport { DatePickerField, InputField } from \"@knkcs/anker/forms\";\nimport { useHostIdentity } from \"@knkcs/anker/host\";\nimport { Alert, HStack, Stack } from \"@knkcs/anker/primitives\";\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport { useEffect } from \"react\";\nimport { FormProvider, useForm } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport { API_KEY_NAME_MAX, type ImporthubClient } from \"../../client/importhub-client\";\nimport { importhubKeys } from \"../../common/query-keys\";\nimport { IMPORTHUB_UI_NS } from \"../../i18n/resources\";\n\ntype CreateValues = {\n\tname: string;\n\t/** YYYY-MM-DD, or \"\" for never. */\n\texpiresOn: string;\n};\n\nconst EMPTY: CreateValues = { name: \"\", expiresOn: \"\" };\n\n/** Today in the viewer's time zone, as YYYY-MM-DD, as a date input writes it. */\nfunction today(): string {\n\tconst d = new Date();\n\tconst pad = (n: number) => String(n).padStart(2, \"0\");\n\treturn `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;\n}\n\n/**\n * When a key given an \"Expires on\" day stops working: at the end of that day\n * in the viewer's time zone, so a key set to expire today still works today.\n * As an ISO timestamp, which is how importhub takes it; \"\" for never.\n */\nexport function expiryOf(expiresOn: string): string {\n\tif (!expiresOn) return \"\";\n\treturn new Date(`${expiresOn}T23:59:59`).toISOString();\n}\n\nexport interface CreateApiKeyDialogProps {\n\tclient: ImporthubClient;\n\topen: boolean;\n\tonClose: () => void;\n}\n\n/**\n * Creates an API key from a name and an optional expiry, in a Modal (never a\n * form above the list, anker's rule), and says first what the key may do in\n * the creator's name (import-with-an-api-key:AC5): it acts as them, and\n * importhub holds a standing Delegation Grant for it (ADR 0006, amended).\n *\n * Once created, the dialog shows the secret with a copy action, this once:\n * importhub never returns it again, and the dialog keeps it only in the\n * mutation's result, which the next opening resets and closing unmounts\n * (`lazyMount unmountOnExit`), so it is never left on the page.\n */\nexport function CreateApiKeyDialog({ client, open, onClose }: CreateApiKeyDialogProps) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { workspaceId } = useHostIdentity();\n\tconst queryClient = useQueryClient();\n\tconst form = useForm<CreateValues>({ defaultValues: EMPTY });\n\tconst create = useMutation({\n\t\tmutationFn: (values: CreateValues) =>\n\t\t\tclient.createApiKey({ name: values.name.trim(), expireTime: expiryOf(values.expiresOn) }),\n\t\tonSuccess: () =>\n\t\t\tqueryClient.invalidateQueries({ queryKey: importhubKeys.apiKeys(workspaceId) }),\n\t});\n\tconst { reset } = form;\n\tconst { reset: resetCreate } = create;\n\t// Each opening starts empty, and with no secret, whether or not the exit\n\t// callback ran (anker's Modal rule).\n\tuseEffect(() => {\n\t\tif (open) {\n\t\t\treset(EMPTY);\n\t\t\tresetCreate();\n\t\t}\n\t}, [open, reset, resetCreate]);\n\tconst close = () => {\n\t\t// Drop the secret now, not only on unmount.\n\t\tresetCreate();\n\t\tonClose();\n\t};\n\tconst submit = form.handleSubmit((values) => {\n\t\tconst name = values.name.trim();\n\t\tif (!name) {\n\t\t\tform.setError(\"name\", { message: t(\"apiKeys.nameRequired\") });\n\t\t\treturn;\n\t\t}\n\t\tif (name.length > API_KEY_NAME_MAX) {\n\t\t\tform.setError(\"name\", { message: t(\"apiKeys.nameTooLong\", { max: API_KEY_NAME_MAX }) });\n\t\t\treturn;\n\t\t}\n\t\tif (values.expiresOn && values.expiresOn < today()) {\n\t\t\tform.setError(\"expiresOn\", { message: t(\"apiKeys.expiryPast\") });\n\t\t\treturn;\n\t\t}\n\t\tcreate.mutate(values);\n\t});\n\tconst secret = create.data?.secret;\n\treturn (\n\t\t<Modal\n\t\t\topen={open}\n\t\t\tonClose={close}\n\t\t\theader={t(\"apiKeys.new\")}\n\t\t\tlazyMount\n\t\t\tunmountOnExit\n\t\t\t// While the secret shows, only Done (or the close button) closes:\n\t\t\t// a stray Escape or click beside the dialog would lose the one\n\t\t\t// copy of it there is.\n\t\t\tcloseOnEscape={!secret}\n\t\t\tcloseOnInteractOutside={!secret}\n\t\t\tfooter={\n\t\t\t\tsecret ? (\n\t\t\t\t\t<Button variant=\"solid\" onClick={close}>\n\t\t\t\t\t\t{t(\"apiKeys.done\")}\n\t\t\t\t\t</Button>\n\t\t\t\t) : (\n\t\t\t\t\t<HStack gap=\"2\">\n\t\t\t\t\t\t<Button variant=\"outline\" onClick={close}>\n\t\t\t\t\t\t\t{t(\"common.cancel\")}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button variant=\"solid\" loading={create.isPending} onClick={() => void submit()}>\n\t\t\t\t\t\t\t{t(\"common.create\")}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t)\n\t\t\t}\n\t\t>\n\t\t\t{secret ? (\n\t\t\t\t<Stack gap=\"4\">\n\t\t\t\t\t<Alert status=\"warning\" colorPalette=\"warning\" title={t(\"apiKeys.secretTitle\")}>\n\t\t\t\t\t\t{t(\"apiKeys.secretOnce\")}\n\t\t\t\t\t</Alert>\n\t\t\t\t\t<ClipboardInput\n\t\t\t\t\t\tvalue={secret}\n\t\t\t\t\t\tlabel={t(\"apiKeys.copySecret\")}\n\t\t\t\t\t\tinputProps={{ \"aria-label\": t(\"apiKeys.secret\"), fontFamily: \"mono\" }}\n\t\t\t\t\t/>\n\t\t\t\t</Stack>\n\t\t\t) : (\n\t\t\t\t<FormProvider {...form}>\n\t\t\t\t\t<form\n\t\t\t\t\t\tonSubmit={(e) => {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\tvoid submit();\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Stack gap=\"4\">\n\t\t\t\t\t\t\t<InputField<CreateValues>\n\t\t\t\t\t\t\t\tname=\"name\"\n\t\t\t\t\t\t\t\tlabel={t(\"fields.name\")}\n\t\t\t\t\t\t\t\thelperText={t(\"apiKeys.nameHelp\")}\n\t\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<DatePickerField<CreateValues>\n\t\t\t\t\t\t\t\tname=\"expiresOn\"\n\t\t\t\t\t\t\t\tlabel={t(\"apiKeys.expiresOn\")}\n\t\t\t\t\t\t\t\thelperText={t(\"apiKeys.expiresOnHelp\")}\n\t\t\t\t\t\t\t\tmin={today()}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<Alert status=\"info\" colorPalette=\"info\" title={t(\"apiKeys.consentTitle\")}>\n\t\t\t\t\t\t\t\t{t(\"apiKeys.consent\")}\n\t\t\t\t\t\t\t</Alert>\n\t\t\t\t\t\t\t{create.isError ? (\n\t\t\t\t\t\t\t\t<Alert status=\"error\" colorPalette=\"danger\" title={t(\"apiKeys.createFailed\")} />\n\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t</form>\n\t\t\t\t</FormProvider>\n\t\t\t)}\n\t\t</Modal>\n\t);\n}\n","import { Button } from \"@knkcs/anker/atoms\";\nimport { Modal } from \"@knkcs/anker/components\";\nimport { useHostIdentity } from \"@knkcs/anker/host\";\nimport { Alert, HStack, Stack, Text } from \"@knkcs/anker/primitives\";\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport { useEffect } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport type { ApiKey, ImporthubClient } from \"../../client/importhub-client\";\nimport { importhubKeys } from \"../../common/query-keys\";\nimport { IMPORTHUB_UI_NS } from \"../../i18n/resources\";\n\nexport interface RevokeApiKeyDialogProps {\n\tclient: ImporthubClient;\n\t/** The key to revoke; kept while the dialog closes. */\n\tapiKey: ApiKey | null;\n\topen: boolean;\n\tonClose: () => void;\n}\n\n/**\n * Confirms revoking an API key, then revokes it: importhub revokes it in odon\n * and releases its Delegation Grant, so it stops working at once and an\n * Import running with it fails (import-with-an-api-key:AC4, AC7). The list\n * reads again, without it. Always mounted and driven by `open`, as anker's\n * Modal rule says.\n *\n * Not `DeleteDialog`: that one says Delete and knows a configuration's\n * refusal (the Import Profiles that use it), neither of which a revoke has,\n * and giving it labels and a no-refusal mode would make it serve two things.\n */\nexport function RevokeApiKeyDialog({ client, apiKey, open, onClose }: RevokeApiKeyDialogProps) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { workspaceId } = useHostIdentity();\n\tconst queryClient = useQueryClient();\n\tconst revoke = useMutation({\n\t\tmutationFn: (id: string) => client.revokeApiKey(id),\n\t\tonSuccess: async () => {\n\t\t\tawait queryClient.invalidateQueries({ queryKey: importhubKeys.apiKeys(workspaceId) });\n\t\t\tonClose();\n\t\t},\n\t});\n\tconst { reset } = revoke;\n\t// A fresh session each time it opens, so last time's failure is gone.\n\tuseEffect(() => {\n\t\tif (open) reset();\n\t}, [open, reset]);\n\tconst name = apiKey?.name ?? \"\";\n\treturn (\n\t\t<Modal\n\t\t\topen={open}\n\t\t\tonClose={onClose}\n\t\t\theader={t(\"apiKeys.revokeTitle\", { name })}\n\t\t\tlazyMount\n\t\t\tunmountOnExit\n\t\t\tfooter={\n\t\t\t\t<HStack gap=\"2\">\n\t\t\t\t\t<Button variant=\"outline\" onClick={onClose}>\n\t\t\t\t\t\t{t(\"common.cancel\")}\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"solid\"\n\t\t\t\t\t\tcolorPalette=\"red\"\n\t\t\t\t\t\tloading={revoke.isPending}\n\t\t\t\t\t\tdisabled={!apiKey}\n\t\t\t\t\t\tonClick={() => apiKey && revoke.mutate(apiKey.id)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{t(\"apiKeys.revoke\")}\n\t\t\t\t\t</Button>\n\t\t\t\t</HStack>\n\t\t\t}\n\t\t>\n\t\t\t<Stack gap=\"4\">\n\t\t\t\t<Text>{t(\"apiKeys.revokeMessage\", { name })}</Text>\n\t\t\t\t{revoke.isError ? (\n\t\t\t\t\t<Alert status=\"error\" colorPalette=\"danger\" title={t(\"apiKeys.revokeFailed\")} />\n\t\t\t\t) : null}\n\t\t\t</Stack>\n\t\t</Modal>\n\t);\n}\n","import { Button, EmptyState } from \"@knkcs/anker/atoms\";\nimport {\n\tActionCell,\n\tCodeCell,\n\tDataTable,\n\tDateCell,\n\tIdentityCell,\n\tTruncatedTextCell,\n} from \"@knkcs/anker/components\";\nimport { useHostIdentity } from \"@knkcs/anker/host\";\nimport { Box } from \"@knkcs/anker/primitives\";\nimport { IndexPageTemplate } from \"@knkcs/anker/templates\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { ColumnDef } from \"@tanstack/react-table\";\nimport { KeyRound, Plus, Trash2 } from \"lucide-react\";\nimport { useMemo, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport type { ApiKey, ImporthubClient } from \"../../client/importhub-client\";\nimport { usePersonName } from \"../../common/import-status\";\nimport { importhubKeys } from \"../../common/query-keys\";\nimport { LoadFailed } from \"../../common/query-state\";\nimport { useCanImport } from \"../../common/use-can-import\";\nimport { IMPORTHUB_UI_NS } from \"../../i18n/resources\";\nimport { CreateApiKeyDialog } from \"./create-api-key-dialog\";\nimport { RevokeApiKeyDialog } from \"./revoke-api-key-dialog\";\n\nexport interface ApiKeysIndexProps {\n\tclient: ImporthubClient;\n}\n\n// DataTable takes rows that are records.\ntype Row = ApiKey & Record<string, unknown>;\n\n/**\n * The workspace's importhub API keys, every importer's, with their name,\n * owner, creation and expiry, never a secret (import-with-an-api-key:AC5,\n * AC7). An importer creates one from the header and revokes one from its\n * row.\n *\n * A viewer sees neither, nor the keys: every API key RPC needs importhub's\n * `importer` (ADR 0010), ListAPIKeys too, so the screen does not ask for a\n * list importhub would refuse and says who manages keys instead. As with\n * Start and Cancel, `canImport` hides actions and guards nothing.\n */\nexport function ApiKeysIndex({ client }: ApiKeysIndexProps) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { workspaceId } = useHostIdentity();\n\tconst canImport = useCanImport();\n\tconst personName = usePersonName();\n\tconst [creating, setCreating] = useState(false);\n\t// The key whose revoke is being confirmed; latched while the dialog closes,\n\t// so its text does not blank out during the exit animation.\n\tconst [revoking, setRevoking] = useState<ApiKey | null>(null);\n\tconst [revokeOpen, setRevokeOpen] = useState(false);\n\tconst query = useQuery({\n\t\tqueryKey: importhubKeys.apiKeys(workspaceId),\n\t\tqueryFn: () => client.listApiKeys(),\n\t\tenabled: canImport,\n\t});\n\tconst columns = useMemo<ColumnDef<Row, unknown>[]>(\n\t\t() => [\n\t\t\t{\n\t\t\t\tid: \"name\",\n\t\t\t\theader: t(\"fields.name\"),\n\t\t\t\tcell: (c) => <TruncatedTextCell value={c.row.original.name} />,\n\t\t\t},\n\t\t\t{\n\t\t\t\t// The secret's first characters, which tell keys apart where a\n\t\t\t\t// pipeline's settings show the key; never the secret.\n\t\t\t\tid: \"prefix\",\n\t\t\t\theader: t(\"apiKeys.prefix\"),\n\t\t\t\tsize: 120,\n\t\t\t\tcell: (c) => <CodeCell value={c.row.original.keyPrefix} />,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"owner\",\n\t\t\t\theader: t(\"apiKeys.owner\"),\n\t\t\t\tsize: 160,\n\t\t\t\tcell: (c) => <IdentityCell name={personName(c.row.original.owner)} />,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"created\",\n\t\t\t\theader: t(\"apiKeys.created\"),\n\t\t\t\tsize: 130,\n\t\t\t\tcell: (c) => <DateCell value={c.row.original.createTime} />,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"expires\",\n\t\t\t\theader: t(\"apiKeys.expires\"),\n\t\t\t\tsize: 130,\n\t\t\t\tcell: (c) =>\n\t\t\t\t\tc.row.original.expireTime ? (\n\t\t\t\t\t\t<DateCell value={c.row.original.expireTime} />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<TruncatedTextCell value={t(\"apiKeys.never\")} />\n\t\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"actions\",\n\t\t\t\theader: \"\",\n\t\t\t\tminSize: 60,\n\t\t\t\tcell: (c) => (\n\t\t\t\t\t<ActionCell\n\t\t\t\t\t\tactions={[\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ticon: Trash2,\n\t\t\t\t\t\t\t\tlabel: t(\"apiKeys.revokeKey\", { name: c.row.original.name }),\n\t\t\t\t\t\t\t\tcolorPalette: \"red\",\n\t\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\tsetRevoking(c.row.original);\n\t\t\t\t\t\t\t\t\tsetRevokeOpen(true);\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t]}\n\t\t\t\t\t/>\n\t\t\t\t),\n\t\t\t},\n\t\t],\n\t\t[t, personName],\n\t);\n\treturn (\n\t\t<IndexPageTemplate\n\t\t\ttitle={t(\"apiKeys.title\")}\n\t\t\tsubtitle={t(\"apiKeys.subtitle\")}\n\t\t\tactions={\n\t\t\t\tcanImport ? (\n\t\t\t\t\t<Button variant=\"solid\" onClick={() => setCreating(true)}>\n\t\t\t\t\t\t<Plus size={16} aria-hidden />\n\t\t\t\t\t\t{t(\"apiKeys.new\")}\n\t\t\t\t\t</Button>\n\t\t\t\t) : undefined\n\t\t\t}\n\t\t>\n\t\t\t{!canImport ? (\n\t\t\t\t<Box px=\"8\" py=\"6\">\n\t\t\t\t\t<EmptyState\n\t\t\t\t\t\ticon={<KeyRound size={32} aria-hidden />}\n\t\t\t\t\t\theader={t(\"apiKeys.title\")}\n\t\t\t\t\t\tdescription={t(\"apiKeys.importersOnly\")}\n\t\t\t\t\t/>\n\t\t\t\t</Box>\n\t\t\t) : query.isError ? (\n\t\t\t\t<LoadFailed />\n\t\t\t) : (\n\t\t\t\t<DataTable\n\t\t\t\t\tcolumns={columns}\n\t\t\t\t\tdata={(query.data ?? []) as Row[]}\n\t\t\t\t\tloading={query.isPending}\n\t\t\t\t\tgetRowId={(k) => k.id}\n\t\t\t\t\temptyState={t(\"apiKeys.empty\")}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<CreateApiKeyDialog client={client} open={creating} onClose={() => setCreating(false)} />\n\t\t\t<RevokeApiKeyDialog\n\t\t\t\tclient={client}\n\t\t\t\tapiKey={revoking}\n\t\t\t\topen={revokeOpen}\n\t\t\t\tonClose={() => setRevokeOpen(false)}\n\t\t\t/>\n\t\t</IndexPageTemplate>\n\t);\n}\n","import { Button, IconButton, StatusBadge } from \"@knkcs/anker/atoms\";\nimport { Card, ContextRail } from \"@knkcs/anker/components\";\nimport { InputField, TextareaField } from \"@knkcs/anker/forms\";\nimport { useHostIdentity } from \"@knkcs/anker/host\";\nimport { Alert, Box, Grid, HStack, Stack, Text } from \"@knkcs/anker/primitives\";\nimport { DetailPageTemplate, usePageRail } from \"@knkcs/anker/templates\";\nimport { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport { Plus, Trash2 } from \"lucide-react\";\nimport { useEffect, useState } from \"react\";\nimport { FormProvider, useFieldArray, useForm } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport type { EntitySet, EntitySetContent, ImporthubClient } from \"../../client/importhub-client\";\nimport { useConfigurationTab } from \"../../common/configuration-tabs\";\nimport { DeleteDialog } from \"../../common/delete-dialog\";\nimport { useImporthubHost } from \"../../common/host\";\nimport { importhubKeys } from \"../../common/query-keys\";\nimport { LoadFailed, Loading } from \"../../common/query-state\";\nimport { ReleaseStateBadge } from \"../../common/release-state\";\nimport { useCanConfigure } from \"../../common/use-can-configure\";\nimport { useConfigurationRelease } from \"../../common/use-configuration-release\";\nimport { ValidityAlert } from \"../../common/validity\";\nimport { IMPORTHUB_UI_NS } from \"../../i18n/resources\";\nimport { ConfigurationHistory } from \"../history/configuration-history\";\n\nexport interface EntitySetDetailProps {\n\tclient: ImporthubClient;\n\t/** The Entity Set's id. */\n\tid: string;\n\t/** It was deleted: the host leaves its page. */\n\tonDeleted: () => void;\n}\n\n/** The entity table as form rows: a map has no order, a form needs one. */\ntype EntitySetValues = {\n\tname: string;\n\tdescription: string;\n\tentities: { name: string; text: string }[];\n};\n\nconst valuesOf = (c: EntitySetContent): EntitySetValues => ({\n\tname: c.name,\n\tdescription: c.description,\n\tentities: Object.entries(c.entities)\n\t\t.sort(([a], [b]) => a.localeCompare(b))\n\t\t.map(([name, text]) => ({ name, text })),\n});\n\n// A row without a name is dropped rather than saved as `\"\"`, which no\n// reference in a Source File could name.\nconst contentOf = (v: EntitySetValues): EntitySetContent => ({\n\tname: v.name,\n\tdescription: v.description,\n\tentities: Object.fromEntries(\n\t\tv.entities.filter((e) => e.name.trim() !== \"\").map((e) => [e.name.trim(), e.text]),\n\t),\n});\n\n/**\n * One Entity Set (manage-entity-sets:AC1): its name and its table of\n * entities, each with the text it stands for. An admin edits the table and\n * saves with the header's Save, and deletes from the rail, which importhub\n * refuses while a Profile names it, naming them (AC3). It shows whether its\n * draft differs from its latest Release, an admin cuts a Release from the\n * rail, and its History tab lists, compares and restores its Revisions\n * (release-a-configuration).\n */\nexport function EntitySetDetail({ client, id, onDeleted }: EntitySetDetailProps) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { workspaceId } = useHostIdentity();\n\tconst query = useQuery({\n\t\tqueryKey: importhubKeys.entitySet(workspaceId, id),\n\t\tqueryFn: () => client.getEntitySet(id),\n\t});\n\tif (query.isError || !query.data) {\n\t\treturn (\n\t\t\t<DetailPageTemplate title={t(\"section.entitySets.title\")}>\n\t\t\t\t{query.isError ? <LoadFailed /> : <Loading />}\n\t\t\t</DetailPageTemplate>\n\t\t);\n\t}\n\treturn <EntitySetPage client={client} entitySet={query.data} onDeleted={onDeleted} />;\n}\n\nfunction EntitySetPage({\n\tclient,\n\tentitySet,\n\tonDeleted,\n}: {\n\tclient: ImporthubClient;\n\tentitySet: EntitySet;\n\tonDeleted: () => void;\n}) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { workspaceId } = useHostIdentity();\n\tconst { paths } = useImporthubHost();\n\tconst canConfigure = useCanConfigure();\n\tconst queryClient = useQueryClient();\n\tconst [deleting, setDeleting] = useState(false);\n\n\tconst form = useForm<EntitySetValues>({ defaultValues: valuesOf(entitySet.content) });\n\tconst { reset, formState, control } = form;\n\tconst rows = useFieldArray({ control, name: \"entities\" });\n\tuseEffect(() => {\n\t\tif (!formState.isDirty) reset(valuesOf(entitySet.content));\n\t}, [entitySet, reset, formState.isDirty]);\n\n\tconst save = useMutation({\n\t\tmutationFn: (values: EntitySetValues) =>\n\t\t\tclient.updateEntitySet(entitySet.id, contentOf(values), entitySet.state.draftRevisionId),\n\t\tonSuccess: (saved) => {\n\t\t\tqueryClient.setQueryData(importhubKeys.entitySet(workspaceId, saved.id), saved);\n\t\t\treset(valuesOf(saved.content));\n\t\t\tvoid queryClient.invalidateQueries({ queryKey: importhubKeys.entitySets(workspaceId) });\n\t\t},\n\t});\n\tconst onSave = form.handleSubmit((values) => save.mutate(values));\n\tconst [tab, tabs] = useConfigurationTab();\n\tconst releasing = useConfigurationRelease({\n\t\tclient,\n\t\tkind: \"entitySet\",\n\t\tid: entitySet.id,\n\t\tvalidity: entitySet.validity,\n\t\tstate: entitySet.state,\n\t\tunsaved: formState.isDirty,\n\t});\n\n\tusePageRail(\n\t\tcanConfigure ? (\n\t\t\t<ContextRail storageKey=\"importhub.entitySet.rail\">\n\t\t\t\t<ContextRail.Header title={t(\"rail.title\")} />\n\t\t\t\t<ContextRail.Section id=\"actions\" label={t(\"rail.actions\")}>\n\t\t\t\t\t{releasing.railAction}\n\t\t\t\t\t<ContextRail.IconButton\n\t\t\t\t\t\tlabel={t(\"entitySets.delete\")}\n\t\t\t\t\t\ticon={<Trash2 size={16} />}\n\t\t\t\t\t\ttone=\"outline-red\"\n\t\t\t\t\t\tonClick={() => setDeleting(true)}\n\t\t\t\t\t/>\n\t\t\t\t</ContextRail.Section>\n\t\t\t</ContextRail>\n\t\t) : null,\n\t);\n\n\treturn (\n\t\t<DetailPageTemplate\n\t\t\ttitle={entitySet.content.name}\n\t\t\tbreadcrumbs={[{ label: t(\"section.entitySets.title\"), to: paths.entitySets }]}\n\t\t\tbadges={\n\t\t\t\t<HStack gap=\"2\">\n\t\t\t\t\t<StatusBadge\n\t\t\t\t\t\ttone={entitySet.validity.valid ? \"success\" : \"danger\"}\n\t\t\t\t\t\tlabel={entitySet.validity.valid ? t(\"validity.valid\") : t(\"validity.invalid\")}\n\t\t\t\t\t/>\n\t\t\t\t\t<ReleaseStateBadge state={entitySet.state} />\n\t\t\t\t</HStack>\n\t\t\t}\n\t\t\ttabs={tabs}\n\t\t\tactions={\n\t\t\t\tcanConfigure ? (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"solid\"\n\t\t\t\t\t\tdisabled={!formState.isDirty}\n\t\t\t\t\t\tloading={save.isPending}\n\t\t\t\t\t\tonClick={() => void onSave()}\n\t\t\t\t\t>\n\t\t\t\t\t\t{t(\"common.save\")}\n\t\t\t\t\t</Button>\n\t\t\t\t) : undefined\n\t\t\t}\n\t\t>\n\t\t\t{tab === \"history\" ? (\n\t\t\t\t<ConfigurationHistory\n\t\t\t\t\tclient={client}\n\t\t\t\t\tkind=\"entitySet\"\n\t\t\t\t\tid={entitySet.id}\n\t\t\t\t\tdraftRevisionId={entitySet.state.draftRevisionId}\n\t\t\t\t\tonRestored={async () => {\n\t\t\t\t\t\t// The restored draft replaces what the form holds.\n\t\t\t\t\t\tconst fresh = await client.getEntitySet(entitySet.id);\n\t\t\t\t\t\tqueryClient.setQueryData(importhubKeys.entitySet(workspaceId, fresh.id), fresh);\n\t\t\t\t\t\treset(valuesOf(fresh.content));\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<Box px=\"8\" py=\"6\">\n\t\t\t\t\t<FormProvider {...form}>\n\t\t\t\t\t\t<form\n\t\t\t\t\t\t\tonSubmit={(e) => {\n\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\tif (canConfigure) void onSave();\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Stack gap=\"4\">\n\t\t\t\t\t\t\t\t{releasing.notice}\n\t\t\t\t\t\t\t\t<ValidityAlert validity={entitySet.validity} />\n\t\t\t\t\t\t\t\t{save.isError ? (\n\t\t\t\t\t\t\t\t\t<Alert status=\"error\" colorPalette=\"danger\" title={t(\"save.failed\")}>\n\t\t\t\t\t\t\t\t\t\t{save.error.message}\n\t\t\t\t\t\t\t\t\t</Alert>\n\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t<Card title={t(\"entitySets.general\")}>\n\t\t\t\t\t\t\t\t\t<Stack gap=\"4\">\n\t\t\t\t\t\t\t\t\t\t<InputField<EntitySetValues>\n\t\t\t\t\t\t\t\t\t\t\tname=\"name\"\n\t\t\t\t\t\t\t\t\t\t\tlabel={t(\"fields.name\")}\n\t\t\t\t\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\t\t\t\t\tdisabled={!canConfigure}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t<TextareaField<EntitySetValues>\n\t\t\t\t\t\t\t\t\t\t\tname=\"description\"\n\t\t\t\t\t\t\t\t\t\t\tlabel={t(\"fields.description\")}\n\t\t\t\t\t\t\t\t\t\t\tdisabled={!canConfigure}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t\t</Card>\n\t\t\t\t\t\t\t\t<Card title={t(\"entitySets.entities\")}>\n\t\t\t\t\t\t\t\t\t<Stack gap=\"3\">\n\t\t\t\t\t\t\t\t\t\t{rows.fields.length === 0 ? (\n\t\t\t\t\t\t\t\t\t\t\t<Text color=\"fg.muted\">{t(\"entitySets.noEntities\")}</Text>\n\t\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t\t{rows.fields.map((row, index) => (\n\t\t\t\t\t\t\t\t\t\t\t<Grid key={row.id} templateColumns=\"1fr 1fr auto\" gap=\"3\" alignItems=\"end\">\n\t\t\t\t\t\t\t\t\t\t\t\t<InputField<EntitySetValues>\n\t\t\t\t\t\t\t\t\t\t\t\t\tname={`entities.${index}.name`}\n\t\t\t\t\t\t\t\t\t\t\t\t\tlabel={t(\"entitySets.entityName\", { index: index + 1 })}\n\t\t\t\t\t\t\t\t\t\t\t\t\tprepend=\"&\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tappend=\";\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tdisabled={!canConfigure}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t<InputField<EntitySetValues>\n\t\t\t\t\t\t\t\t\t\t\t\t\tname={`entities.${index}.text`}\n\t\t\t\t\t\t\t\t\t\t\t\t\tlabel={t(\"entitySets.entityText\", { index: index + 1 })}\n\t\t\t\t\t\t\t\t\t\t\t\t\tdisabled={!canConfigure}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t{canConfigure ? (\n\t\t\t\t\t\t\t\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t\t\t\t\t\t\t\taria-label={t(\"entitySets.removeEntity\", { index: index + 1 })}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolorPalette=\"red\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={() => rows.remove(index)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Trash2 size={16} />\n\t\t\t\t\t\t\t\t\t\t\t\t\t</IconButton>\n\t\t\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span />\n\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t</Grid>\n\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t\t{canConfigure ? (\n\t\t\t\t\t\t\t\t\t\t\t<Box>\n\t\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={() => rows.append({ name: \"\", text: \"\" })}\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Plus size={14} aria-hidden />\n\t\t\t\t\t\t\t\t\t\t\t\t\t{t(\"entitySets.addEntity\")}\n\t\t\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t\t</Box>\n\t\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t\t</Card>\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</FormProvider>\n\t\t\t\t</Box>\n\t\t\t)}\n\t\t\t{releasing.dialog}\n\t\t\t<DeleteDialog\n\t\t\t\topen={deleting}\n\t\t\t\tonClose={() => setDeleting(false)}\n\t\t\t\ttitle={t(\"entitySets.deleteTitle\", { name: entitySet.content.name })}\n\t\t\t\tmessage={t(\"entitySets.deleteMessage\")}\n\t\t\t\tonDelete={() => client.deleteEntitySet(entitySet.id)}\n\t\t\t\tonDeleted={() => {\n\t\t\t\t\tsetDeleting(false);\n\t\t\t\t\tqueryClient.removeQueries({\n\t\t\t\t\t\tqueryKey: importhubKeys.entitySet(workspaceId, entitySet.id),\n\t\t\t\t\t});\n\t\t\t\t\tvoid queryClient.invalidateQueries({ queryKey: importhubKeys.entitySets(workspaceId) });\n\t\t\t\t\tonDeleted();\n\t\t\t\t}}\n\t\t\t/>\n\t\t</DetailPageTemplate>\n\t);\n}\n","import { Modal } from \"@knkcs/anker/components\";\nimport { InputField, TextareaField } from \"@knkcs/anker/forms\";\nimport { Alert, Stack } from \"@knkcs/anker/primitives\";\nimport { useMutation } from \"@tanstack/react-query\";\nimport { type ReactNode, useEffect } from \"react\";\nimport { FormProvider, useForm } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport { NameTakenError } from \"../client/importhub-client\";\nimport { IMPORTHUB_UI_NS } from \"../i18n/resources\";\n\n/** What every create asks first: a name and what it is for. */\nexport type CreateValues = { name: string; description: string } & Record<string, string>;\n\nexport interface CreateDialogProps {\n\topen: boolean;\n\tonClose: () => void;\n\t/** The dialog's header: \"New Import Profile\". */\n\ttitle: string;\n\t/** Fields a kind asks besides name and description, over the same form. */\n\tchildren?: ReactNode;\n\t/** Their starting values; a stable object (a module constant), as it resets the form. */\n\tdefaultValues?: Record<string, string>;\n\t/** Creates it from the values; resolves to the new id. */\n\tonCreate: (values: CreateValues) => Promise<string>;\n\t/** It exists: the host opens its page. */\n\tonCreated: (id: string) => void;\n}\n\n/**\n * Creates a configuration from a name and a description in a Modal, never a\n * form above the list (anker's rule); the rest is set on its page. A name\n * another one of the kind has is said at the name.\n */\nexport function CreateDialog({\n\topen,\n\tonClose,\n\ttitle,\n\tchildren,\n\tdefaultValues,\n\tonCreate,\n\tonCreated,\n}: CreateDialogProps) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst form = useForm<CreateValues>({\n\t\tdefaultValues: { name: \"\", description: \"\", ...defaultValues },\n\t});\n\tconst create = useMutation({ mutationFn: onCreate, onSuccess: onCreated });\n\tconst { reset } = form;\n\tconst { reset: resetCreate } = create;\n\t// Each opening starts empty, whether or not the exit callback ran.\n\tuseEffect(() => {\n\t\tif (open) {\n\t\t\treset({ name: \"\", description: \"\", ...defaultValues });\n\t\t\tresetCreate();\n\t\t}\n\t}, [open, reset, resetCreate, defaultValues]);\n\tconst submit = form.handleSubmit((values) => {\n\t\tif (!values.name.trim()) {\n\t\t\tform.setError(\"name\", { message: t(\"create.nameRequired\") });\n\t\t\treturn;\n\t\t}\n\t\tcreate.mutate(values, {\n\t\t\tonError: (err) => {\n\t\t\t\tif (err instanceof NameTakenError) {\n\t\t\t\t\tform.setError(\"name\", { message: t(\"create.nameTaken\") });\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\t});\n\treturn (\n\t\t<Modal\n\t\t\topen={open}\n\t\t\tonClose={onClose}\n\t\t\theader={title}\n\t\t\tlazyMount\n\t\t\tunmountOnExit\n\t\t\tsaveLabel={t(\"common.create\")}\n\t\t\tcancelLabel={t(\"common.cancel\")}\n\t\t\tonSave={() => void submit()}\n\t\t\tloading={create.isPending}\n\t\t>\n\t\t\t<FormProvider {...form}>\n\t\t\t\t<form\n\t\t\t\t\tonSubmit={(e) => {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\tvoid submit();\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<Stack gap=\"4\">\n\t\t\t\t\t\t<InputField<CreateValues> name=\"name\" label={t(\"fields.name\")} required />\n\t\t\t\t\t\t<TextareaField<CreateValues> name=\"description\" label={t(\"fields.description\")} />\n\t\t\t\t\t\t{children}\n\t\t\t\t\t\t{create.isError && !(create.error instanceof NameTakenError) ? (\n\t\t\t\t\t\t\t<Alert status=\"error\" colorPalette=\"danger\" title={t(\"create.failed\")} />\n\t\t\t\t\t\t) : null}\n\t\t\t\t\t</Stack>\n\t\t\t\t</form>\n\t\t\t</FormProvider>\n\t\t</Modal>\n\t);\n}\n","import { Button } from \"@knkcs/anker/atoms\";\nimport { CountCell, DataTable, LinkCell, TruncatedTextCell } from \"@knkcs/anker/components\";\nimport { useHostIdentity } from \"@knkcs/anker/host\";\nimport { IndexPageTemplate } from \"@knkcs/anker/templates\";\nimport { useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport type { ColumnDef } from \"@tanstack/react-table\";\nimport { Plus } from \"lucide-react\";\nimport { useMemo, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport type { EntitySet, ImporthubClient } from \"../../client/importhub-client\";\nimport { CreateDialog } from \"../../common/create-dialog\";\nimport { itemPath, useImporthubHost } from \"../../common/host\";\nimport { importhubKeys } from \"../../common/query-keys\";\nimport { LoadFailed } from \"../../common/query-state\";\nimport { useCanConfigure } from \"../../common/use-can-configure\";\nimport { releaseLabel, ValidityCell } from \"../../common/validity\";\nimport { IMPORTHUB_UI_NS } from \"../../i18n/resources\";\n\nexport interface EntitySetsIndexProps {\n\tclient: ImporthubClient;\n\t/** Opens an Entity Set's page: the host navigates, after a create too. */\n\tonOpen: (id: string) => void;\n}\n\n// DataTable takes rows that are records.\ntype Row = EntitySet & Record<string, unknown>;\n\n/**\n * Every Entity Set of the workspace, with how many entities each defines\n * (manage-entity-sets:AC1); an admin creates one from the header.\n */\nexport function EntitySetsIndex({ client, onOpen }: EntitySetsIndexProps) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { workspaceId } = useHostIdentity();\n\tconst { paths } = useImporthubHost();\n\tconst canConfigure = useCanConfigure();\n\tconst queryClient = useQueryClient();\n\tconst [creating, setCreating] = useState(false);\n\tconst query = useQuery({\n\t\tqueryKey: importhubKeys.entitySets(workspaceId),\n\t\tqueryFn: () => client.listEntitySets(),\n\t});\n\tconst columns = useMemo<ColumnDef<Row, unknown>[]>(\n\t\t() => [\n\t\t\t{\n\t\t\t\tid: \"name\",\n\t\t\t\theader: t(\"fields.name\"),\n\t\t\t\tcell: (c) => (\n\t\t\t\t\t<LinkCell\n\t\t\t\t\t\tto={itemPath(paths, \"entitySets\", c.row.original.id)}\n\t\t\t\t\t\tlabel={c.row.original.content.name}\n\t\t\t\t\t/>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"entities\",\n\t\t\t\theader: t(\"entitySets.entities\"),\n\t\t\t\tsize: 120,\n\t\t\t\tcell: (c) => (\n\t\t\t\t\t<CountCell\n\t\t\t\t\t\tvalue={c.row.original.content.entities}\n\t\t\t\t\t\tsingular={t(\"entitySets.entity\")}\n\t\t\t\t\t\tplural={t(\"entitySets.entities\")}\n\t\t\t\t\t/>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"validity\",\n\t\t\t\theader: t(\"validity.column\"),\n\t\t\t\tcell: (c) => <ValidityCell validity={c.row.original.validity} />,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"release\",\n\t\t\t\theader: t(\"release.column\"),\n\t\t\t\tsize: 140,\n\t\t\t\tcell: (c) => <TruncatedTextCell value={releaseLabel(c.row.original.state, t)} />,\n\t\t\t},\n\t\t],\n\t\t[t, paths],\n\t);\n\treturn (\n\t\t<IndexPageTemplate\n\t\t\ttitle={t(\"section.entitySets.title\")}\n\t\t\tactions={\n\t\t\t\tcanConfigure ? (\n\t\t\t\t\t<Button variant=\"solid\" onClick={() => setCreating(true)}>\n\t\t\t\t\t\t<Plus size={16} aria-hidden />\n\t\t\t\t\t\t{t(\"entitySets.new\")}\n\t\t\t\t\t</Button>\n\t\t\t\t) : undefined\n\t\t\t}\n\t\t>\n\t\t\t{query.isError ? (\n\t\t\t\t<LoadFailed />\n\t\t\t) : (\n\t\t\t\t<DataTable\n\t\t\t\t\tcolumns={columns}\n\t\t\t\t\tdata={(query.data ?? []) as Row[]}\n\t\t\t\t\tloading={query.isPending}\n\t\t\t\t\tgetRowId={(e) => e.id}\n\t\t\t\t\temptyState={t(\"entitySets.empty\")}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<CreateDialog\n\t\t\t\topen={creating}\n\t\t\t\tonClose={() => setCreating(false)}\n\t\t\t\ttitle={t(\"entitySets.new\")}\n\t\t\t\tonCreate={async ({ name, description }) => {\n\t\t\t\t\tconst e = await client.createEntitySet({ name, description, entities: {} });\n\t\t\t\t\tawait queryClient.invalidateQueries({ queryKey: importhubKeys.entitySets(workspaceId) });\n\t\t\t\t\treturn e.id;\n\t\t\t\t}}\n\t\t\t\tonCreated={(id) => {\n\t\t\t\t\tsetCreating(false);\n\t\t\t\t\tonOpen(id);\n\t\t\t\t}}\n\t\t\t/>\n\t\t</IndexPageTemplate>\n\t);\n}\n","import { Button, SearchInput } from \"@knkcs/anker/atoms\";\nimport { CodeCell, DataTable, SlugCell, Toolbar, TruncatedTextCell } from \"@knkcs/anker/components\";\nimport { useHostIdentity } from \"@knkcs/anker/host\";\nimport { Center, NativeSelect, Stack } from \"@knkcs/anker/primitives\";\nimport { useInfiniteQuery } from \"@tanstack/react-query\";\nimport type { ColumnDef } from \"@tanstack/react-table\";\nimport { useEffect, useMemo, useRef, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport type { Import, ImporthubClient, ItemProblem } from \"../../client/importhub-client\";\nimport { importhubKeys } from \"../../common/query-keys\";\nimport { LoadFailed } from \"../../common/query-state\";\nimport { IMPORTHUB_UI_NS } from \"../../i18n/resources\";\n\ntype Row = ItemProblem & Record<string, unknown>;\n\n/**\n * An Import's Item Problems (follow-an-import:AC4): filtered by Mapping and\n * searched by Source Key, both by importhub, with how many match of how many\n * there are. The Mappings offered are every Mapping with Item Problems, each\n * with its count, whatever the filter.\n */\nexport function ItemProblemsTable({ client, im }: { client: ImporthubClient; im: Import }) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { workspaceId } = useHostIdentity();\n\tconst [mappingId, setMappingId] = useState(\"\");\n\tconst [sourceKeyQuery, setSourceKeyQuery] = useState(\"\");\n\tconst query = useInfiniteQuery({\n\t\tqueryKey: importhubKeys.itemProblems(workspaceId, im.id, mappingId, sourceKeyQuery),\n\t\tqueryFn: ({ pageParam }) =>\n\t\t\tclient.listItemProblems(im.id, { mappingId, sourceKeyQuery, pageToken: pageParam }),\n\t\tinitialPageParam: \"\",\n\t\tgetNextPageParam: (last) => last.nextPageToken || undefined,\n\t\t// Keeps the rows while a new filter's answer loads, rather than\n\t\t// flashing an empty table at every keystroke.\n\t\tplaceholderData: (previous) => previous,\n\t});\n\t// Re-read when the Import has recorded more, so a running Import's table\n\t// keeps up with its count without polling on its own; the page around it\n\t// polls the Import already.\n\tconst problems = im.counts.problems;\n\tconst seen = useRef(problems);\n\tconst { refetch } = query;\n\tuseEffect(() => {\n\t\tif (problems === seen.current) return;\n\t\tseen.current = problems;\n\t\tvoid refetch();\n\t}, [problems, refetch]);\n\n\tconst first = query.data?.pages[0];\n\tconst rows = useMemo(\n\t\t() => (query.data?.pages.flatMap((p) => p.itemProblems) ?? []) as Row[],\n\t\t[query.data],\n\t);\n\tconst columns = useMemo<ColumnDef<Row, unknown>[]>(\n\t\t() => [\n\t\t\t{\n\t\t\t\tid: \"sourceKey\",\n\t\t\t\theader: t(\"imports.sourceKey\"),\n\t\t\t\tsize: 180,\n\t\t\t\tcell: (c) => <SlugCell value={c.row.original.sourceKey || t(\"imports.noSourceKey\")} />,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"mapping\",\n\t\t\t\theader: t(\"imports.mapping\"),\n\t\t\t\tsize: 160,\n\t\t\t\tcell: (c) => <TruncatedTextCell value={c.row.original.mappingName} />,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"field\",\n\t\t\t\theader: t(\"imports.field\"),\n\t\t\t\tsize: 160,\n\t\t\t\tcell: (c) =>\n\t\t\t\t\tc.row.original.field ? (\n\t\t\t\t\t\t<CodeCell value={c.row.original.field} />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<TruncatedTextCell value={t(\"imports.wholeVersion\")} />\n\t\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"reason\",\n\t\t\t\theader: t(\"imports.reason\"),\n\t\t\t\tminSize: 240,\n\t\t\t\tcell: (c) => <TruncatedTextCell value={c.row.original.reason} />,\n\t\t\t},\n\t\t],\n\t\t[t],\n\t);\n\tif (query.isError) return <LoadFailed />;\n\tconst total = first?.totalCount ?? 0;\n\treturn (\n\t\t<Stack gap=\"3\">\n\t\t\t<Toolbar>\n\t\t\t\t<SearchInput\n\t\t\t\t\taria-label={t(\"imports.searchSourceKey\")}\n\t\t\t\t\tplaceholder={t(\"imports.searchSourceKey\")}\n\t\t\t\t\tonSearch={setSourceKeyQuery}\n\t\t\t\t\tdebounceMs={200}\n\t\t\t\t\tmaxWidth=\"260px\"\n\t\t\t\t/>\n\t\t\t\t<NativeSelect\n\t\t\t\t\taria-label={t(\"imports.filterMapping\")}\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\twidth=\"auto\"\n\t\t\t\t\tvalue={mappingId}\n\t\t\t\t\tonChange={(e) => setMappingId(e.currentTarget.value)}\n\t\t\t\t>\n\t\t\t\t\t<option value=\"\">{t(\"imports.allMappings\", { count: total })}</option>\n\t\t\t\t\t{(first?.mappings ?? []).map((m) => (\n\t\t\t\t\t\t<option key={m.mappingId} value={m.mappingId}>\n\t\t\t\t\t\t\t{t(\"imports.mappingCount\", { name: m.mappingName, count: m.count })}\n\t\t\t\t\t\t</option>\n\t\t\t\t\t))}\n\t\t\t\t</NativeSelect>\n\t\t\t\t<Toolbar.Right>\n\t\t\t\t\t<Toolbar.Count>\n\t\t\t\t\t\t{t(\"imports.problemCount\", { matching: first?.matchingCount ?? 0, total })}\n\t\t\t\t\t</Toolbar.Count>\n\t\t\t\t</Toolbar.Right>\n\t\t\t</Toolbar>\n\t\t\t<DataTable\n\t\t\t\tcolumns={columns}\n\t\t\t\tdata={rows}\n\t\t\t\tloading={query.isPending}\n\t\t\t\tgetRowId={(p) => p.id}\n\t\t\t\temptyState={total === 0 ? t(\"imports.noItemProblems\") : t(\"imports.noMatchingProblems\")}\n\t\t\t/>\n\t\t\t{query.hasNextPage ? (\n\t\t\t\t<Center>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\tloading={query.isFetchingNextPage}\n\t\t\t\t\t\tonClick={() => void query.fetchNextPage()}\n\t\t\t\t\t>\n\t\t\t\t\t\t{t(\"imports.loadMore\")}\n\t\t\t\t\t</Button>\n\t\t\t\t</Center>\n\t\t\t) : null}\n\t\t</Stack>\n\t);\n}\n","import { Button } from \"@knkcs/anker/atoms\";\nimport { Card, ContextRail, DescriptionList, Modal } from \"@knkcs/anker/components\";\nimport { useHostIdentity } from \"@knkcs/anker/host\";\nimport { Alert, Box, HStack, Link, List, Progress, Stack, Text } from \"@knkcs/anker/primitives\";\nimport { DetailPageTemplate, usePageRail } from \"@knkcs/anker/templates\";\nimport { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport { CircleStop } from \"lucide-react\";\nimport { useEffect, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { Link as RouterLink } from \"react-router\";\nimport type { Import, ImporthubClient, ImportReleaseRef } from \"../../client/importhub-client\";\nimport { ChangeSetLink } from \"../../common/change-set-link\";\nimport { type ImporthubSection, itemPath, useImporthubHost } from \"../../common/host\";\nimport {\n\tDEFAULT_POLL_INTERVAL_MS,\n\tImportStatusBadge,\n\tisRunning,\n\tusePersonName,\n} from \"../../common/import-status\";\nimport { importhubKeys } from \"../../common/query-keys\";\nimport { LoadFailed, Loading } from \"../../common/query-state\";\nimport { useCanImport } from \"../../common/use-can-import\";\nimport { IMPORTHUB_UI_NS } from \"../../i18n/resources\";\nimport { ItemProblemsTable } from \"./item-problems-table\";\n\nexport interface ImportDetailProps {\n\tclient: ImporthubClient;\n\t/** The Import's id. */\n\tid: string;\n\t/**\n\t * How often the page reads the Import again while it is queued or\n\t * running, in ms; 2000 by default. It stops once the Import has ended.\n\t */\n\tpollIntervalMs?: number;\n}\n\n/**\n * One Import (follow-an-import): its status, and while it runs its phase\n * and progress, read again until it ends (AC2); how it ended and why (AC7),\n * who cancelled it (AC6); its details with the link to its Change Set in\n * contenthub, where the host says that is (AC5); its counts; the exact\n * Releases it ran with (release-a-configuration:AC8); and its Item Problems\n * (AC4). An importer cancels a queued or running one from the rail; a viewer\n * sees no Cancel (AC8).\n */\nexport function ImportDetail({\n\tclient,\n\tid,\n\tpollIntervalMs = DEFAULT_POLL_INTERVAL_MS,\n}: ImportDetailProps) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { workspaceId } = useHostIdentity();\n\tconst query = useQuery({\n\t\tqueryKey: importhubKeys.import(workspaceId, id),\n\t\tqueryFn: () => client.getImport(id),\n\t\trefetchInterval: (q) => (q.state.data && isRunning(q.state.data) ? pollIntervalMs : false),\n\t});\n\tif (query.isError || !query.data) {\n\t\treturn (\n\t\t\t<DetailPageTemplate title={t(\"section.imports.title\")}>\n\t\t\t\t{query.isError ? <LoadFailed /> : <Loading />}\n\t\t\t</DetailPageTemplate>\n\t\t);\n\t}\n\treturn <ImportPage client={client} im={query.data} />;\n}\n\nfunction ImportPage({ client, im }: { client: ImporthubClient; im: Import }) {\n\tconst { t, i18n } = useTranslation(IMPORTHUB_UI_NS);\n\tconst lng = i18n.language;\n\tconst { workspaceId } = useHostIdentity();\n\tconst { paths } = useImporthubHost();\n\tconst canImport = useCanImport();\n\tconst personName = usePersonName();\n\tconst queryClient = useQueryClient();\n\tconst [cancelling, setCancelling] = useState(false);\n\n\t// Cancel is offered while the Import may still be stopped, and until\n\t// somebody has asked: asking twice changes nothing (CancelImport).\n\tconst cancellable = canImport && isRunning(im) && !im.cancelledBy;\n\tusePageRail(\n\t\tcancellable ? (\n\t\t\t<ContextRail storageKey=\"importhub.import.rail\">\n\t\t\t\t<ContextRail.Header title={t(\"rail.title\")} />\n\t\t\t\t<ContextRail.Section id=\"actions\" label={t(\"rail.actions\")}>\n\t\t\t\t\t<ContextRail.IconButton\n\t\t\t\t\t\tlabel={t(\"imports.cancel\")}\n\t\t\t\t\t\ticon={<CircleStop size={16} />}\n\t\t\t\t\t\ttone=\"outline-red\"\n\t\t\t\t\t\tonClick={() => setCancelling(true)}\n\t\t\t\t\t/>\n\t\t\t\t</ContextRail.Section>\n\t\t\t</ContextRail>\n\t\t) : null,\n\t);\n\n\tconst cancel = useMutation({\n\t\tmutationFn: () => client.cancelImport(im.id),\n\t\tonSuccess: (now) => {\n\t\t\tqueryClient.setQueryData(importhubKeys.import(workspaceId, now.id), now);\n\t\t\tvoid queryClient.invalidateQueries({ queryKey: importhubKeys.imports(workspaceId) });\n\t\t\tsetCancelling(false);\n\t\t},\n\t});\n\tconst { reset } = cancel;\n\tuseEffect(() => {\n\t\tif (cancelling) reset();\n\t}, [cancelling, reset]);\n\n\treturn (\n\t\t<DetailPageTemplate\n\t\t\ttitle={im.importProfileName}\n\t\t\tsubtitle={t(\"imports.subtitle\", {\n\t\t\t\tperson: personName(im.startedBy),\n\t\t\t\ttime: formatTime(lng, im.createTime),\n\t\t\t})}\n\t\t\tbreadcrumbs={[{ label: t(\"section.imports.title\"), to: paths.imports }]}\n\t\t\tbadges={<ImportStatusBadge im={im} />}\n\t\t>\n\t\t\t<Box px=\"8\" py=\"6\">\n\t\t\t\t<Stack gap=\"6\">\n\t\t\t\t\t<OutcomeAlert im={im} />\n\t\t\t\t\t{im.phase === \"reading\" || im.phase === \"writing\" ? <ProgressCard im={im} /> : null}\n\t\t\t\t\t<Card title={t(\"imports.details\")}>\n\t\t\t\t\t\t<DescriptionList>\n\t\t\t\t\t\t\t<DescriptionList.Row label={t(\"imports.startedBy\")}>\n\t\t\t\t\t\t\t\t{personName(im.startedBy)}\n\t\t\t\t\t\t\t</DescriptionList.Row>\n\t\t\t\t\t\t\t<DescriptionList.Row label={t(\"imports.started\")}>\n\t\t\t\t\t\t\t\t{formatTime(lng, im.startTime || im.createTime)}\n\t\t\t\t\t\t\t</DescriptionList.Row>\n\t\t\t\t\t\t\t{im.endTime ? (\n\t\t\t\t\t\t\t\t<DescriptionList.Row label={t(\"imports.ended\")}>\n\t\t\t\t\t\t\t\t\t{formatTime(lng, im.endTime)}\n\t\t\t\t\t\t\t\t</DescriptionList.Row>\n\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t<DescriptionList.Row label={t(\"imports.effectiveDate\")}>\n\t\t\t\t\t\t\t\t{im.effectiveDate || t(\"imports.none\")}\n\t\t\t\t\t\t\t</DescriptionList.Row>\n\t\t\t\t\t\t\t<DescriptionList.Row label={t(\"imports.source\")}>\n\t\t\t\t\t\t\t\t{im.source\n\t\t\t\t\t\t\t\t\t? t(\"imports.sourceValue\", {\n\t\t\t\t\t\t\t\t\t\t\treference: im.source.reference,\n\t\t\t\t\t\t\t\t\t\t\tdate: im.source.date,\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t: t(\"imports.none\")}\n\t\t\t\t\t\t\t</DescriptionList.Row>\n\t\t\t\t\t\t\t{im.changeSetId ? (\n\t\t\t\t\t\t\t\t<DescriptionList.Row label={t(\"imports.changeSet\")}>\n\t\t\t\t\t\t\t\t\t<ChangeSetLink changeSetId={im.changeSetId} />\n\t\t\t\t\t\t\t\t</DescriptionList.Row>\n\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t</DescriptionList>\n\t\t\t\t\t</Card>\n\t\t\t\t\t<Card title={t(\"imports.counts\")}>\n\t\t\t\t\t\t<DescriptionList>\n\t\t\t\t\t\t\t{(\n\t\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t\t\"matched\",\n\t\t\t\t\t\t\t\t\t\"created\",\n\t\t\t\t\t\t\t\t\t\"planned\",\n\t\t\t\t\t\t\t\t\t\"corrected\",\n\t\t\t\t\t\t\t\t\t\"kept\",\n\t\t\t\t\t\t\t\t\t\"unchanged\",\n\t\t\t\t\t\t\t\t\t\"problems\",\n\t\t\t\t\t\t\t\t] as const\n\t\t\t\t\t\t\t).map((k) => (\n\t\t\t\t\t\t\t\t<DescriptionList.Row key={k} label={t(`imports.${k}`)}>\n\t\t\t\t\t\t\t\t\t{im.counts[k].toLocaleString()}\n\t\t\t\t\t\t\t\t</DescriptionList.Row>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</DescriptionList>\n\t\t\t\t\t</Card>\n\t\t\t\t\t<ReleasesCard im={im} />\n\t\t\t\t\t<Card title={t(\"imports.itemProblems\")}>\n\t\t\t\t\t\t<ItemProblemsTable client={client} im={im} />\n\t\t\t\t\t</Card>\n\t\t\t\t</Stack>\n\t\t\t</Box>\n\t\t\t<Modal\n\t\t\t\topen={cancelling}\n\t\t\t\tonClose={() => setCancelling(false)}\n\t\t\t\theader={t(\"imports.cancelTitle\")}\n\t\t\t\tlazyMount\n\t\t\t\tunmountOnExit\n\t\t\t\tfooter={\n\t\t\t\t\t<HStack gap=\"2\">\n\t\t\t\t\t\t<Button variant=\"outline\" onClick={() => setCancelling(false)}>\n\t\t\t\t\t\t\t{t(\"imports.keepRunning\")}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"solid\"\n\t\t\t\t\t\t\tcolorPalette=\"red\"\n\t\t\t\t\t\t\tloading={cancel.isPending}\n\t\t\t\t\t\t\tonClick={() => cancel.mutate()}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{t(\"imports.cancelConfirm\")}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<Stack gap=\"4\">\n\t\t\t\t\t<Text>{t(\"imports.cancelMessage\")}</Text>\n\t\t\t\t\t{cancel.isError ? (\n\t\t\t\t\t\t<Alert\n\t\t\t\t\t\t\tstatus=\"error\"\n\t\t\t\t\t\t\tcolorPalette=\"danger\"\n\t\t\t\t\t\t\ttitle={t(\"imports.cancelFailed\", { message: cancel.error.message })}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : null}\n\t\t\t\t</Stack>\n\t\t\t</Modal>\n\t\t</DetailPageTemplate>\n\t);\n}\n\n/** A timestamp as the UI's language writes it. */\nconst formatTime = (lng: string, iso: string) => new Date(iso).toLocaleString(lng);\n\n/** How the Import stands, when that needs saying: queued, cancelling, or how it ended. */\nfunction OutcomeAlert({ im }: { im: Import }) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst personName = usePersonName();\n\tif (im.outcome === \"failed\") {\n\t\treturn (\n\t\t\t<Alert status=\"error\" colorPalette=\"danger\" title={t(\"imports.failedTitle\")}>\n\t\t\t\t{im.failureReason}\n\t\t\t</Alert>\n\t\t);\n\t}\n\tif (im.outcome === \"cancelled\") {\n\t\treturn (\n\t\t\t<Alert status=\"info\" colorPalette=\"gray\">\n\t\t\t\t{t(\"imports.cancelledBody\", { person: personName(im.cancelledBy) })}\n\t\t\t</Alert>\n\t\t);\n\t}\n\tif (im.outcome === \"succeeded_with_problems\") {\n\t\treturn (\n\t\t\t<Alert status=\"warning\" colorPalette=\"warning\">\n\t\t\t\t{t(\"imports.problemsBody\", { count: im.counts.problems })}\n\t\t\t</Alert>\n\t\t);\n\t}\n\tif (isRunning(im) && im.cancelledBy) {\n\t\treturn (\n\t\t\t<Alert status=\"warning\" colorPalette=\"warning\">\n\t\t\t\t{t(\"imports.cancellingBody\", { person: personName(im.cancelledBy) })}\n\t\t\t</Alert>\n\t\t);\n\t}\n\tif (im.phase === \"queued\") {\n\t\treturn (\n\t\t\t<Alert status=\"info\" colorPalette=\"info\">\n\t\t\t\t{t(\"imports.queuedBody\")}\n\t\t\t</Alert>\n\t\t);\n\t}\n\treturn null;\n}\n\n/** A running Import's phase and how far it is (follow-an-import:AC2). */\nfunction ProgressCard({ im }: { im: Import }) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { done, total } = im.progress;\n\tconst known = total > 0;\n\treturn (\n\t\t<Card title={t(\"imports.progressTitle\")}>\n\t\t\t<Stack gap=\"2\">\n\t\t\t\t<Progress\n\t\t\t\t\tlabel={t(`imports.phaseLong.${im.phase as \"reading\" | \"writing\"}`)}\n\t\t\t\t\t// null is anker's indeterminate bar, while the total is unknown.\n\t\t\t\t\tvalue={known ? Math.round((done / total) * 100) : null}\n\t\t\t\t\tcolorPalette=\"info\"\n\t\t\t\t/>\n\t\t\t\t<Text color=\"muted\" fontSize=\"sm\">\n\t\t\t\t\t{known ? t(\"imports.progressOf\", { done, total }) : t(\"imports.progressUnknown\")}\n\t\t\t\t</Text>\n\t\t\t</Stack>\n\t\t</Card>\n\t);\n}\n\n/**\n * The exact Releases the Import ran with, pinned at Start\n * (release-a-configuration:AC8), each a link to its configuration's page.\n */\nfunction ReleasesCard({ im }: { im: Import }) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { importProfile, mappings, entitySet } = im.releases;\n\treturn (\n\t\t<Card title={t(\"imports.releases\")}>\n\t\t\t<DescriptionList>\n\t\t\t\t{importProfile ? (\n\t\t\t\t\t<DescriptionList.Row label={t(\"imports.profile\")}>\n\t\t\t\t\t\t<ReleaseLink section=\"profiles\" release={importProfile} />\n\t\t\t\t\t</DescriptionList.Row>\n\t\t\t\t) : null}\n\t\t\t\t<DescriptionList.Row label={t(\"imports.mappings\")}>\n\t\t\t\t\t<List.Root ps=\"0\" listStyleType=\"none\">\n\t\t\t\t\t\t{mappings.map((m) => (\n\t\t\t\t\t\t\t<List.Item key={m.releaseId}>\n\t\t\t\t\t\t\t\t<ReleaseLink section=\"mappings\" release={m} />\n\t\t\t\t\t\t\t</List.Item>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</List.Root>\n\t\t\t\t</DescriptionList.Row>\n\t\t\t\t<DescriptionList.Row label={t(\"imports.entitySet\")}>\n\t\t\t\t\t{entitySet ? <ReleaseLink section=\"entitySets\" release={entitySet} /> : t(\"imports.none\")}\n\t\t\t\t</DescriptionList.Row>\n\t\t\t</DescriptionList>\n\t\t</Card>\n\t);\n}\n\nfunction ReleaseLink({\n\tsection,\n\trelease,\n}: {\n\tsection: ImporthubSection;\n\trelease: ImportReleaseRef;\n}) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { paths } = useImporthubHost();\n\treturn (\n\t\t<Link asChild>\n\t\t\t<RouterLink to={itemPath(paths, section, release.configurationId)}>\n\t\t\t\t{t(\"imports.releaseOf\", { name: release.name, number: release.number })}\n\t\t\t</RouterLink>\n\t\t</Link>\n\t);\n}\n","import { Button } from \"@knkcs/anker/atoms\";\nimport {\n\tDataTable,\n\tDateCell,\n\tLinkCell,\n\tNumberCell,\n\tTruncatedTextCell,\n} from \"@knkcs/anker/components\";\nimport { useHostIdentity } from \"@knkcs/anker/host\";\nimport { Center } from \"@knkcs/anker/primitives\";\nimport { IndexPageTemplate } from \"@knkcs/anker/templates\";\nimport { useInfiniteQuery } from \"@tanstack/react-query\";\nimport type { ColumnDef } from \"@tanstack/react-table\";\nimport { Play } from \"lucide-react\";\nimport { useMemo } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport type { Import, ImporthubClient } from \"../../client/importhub-client\";\nimport { itemPath, useImporthubHost } from \"../../common/host\";\nimport {\n\tDEFAULT_POLL_INTERVAL_MS,\n\tImportStatusCell,\n\tisRunning,\n\tusePersonName,\n} from \"../../common/import-status\";\nimport { importhubKeys } from \"../../common/query-keys\";\nimport { LoadFailed } from \"../../common/query-state\";\nimport { useCanImport } from \"../../common/use-can-import\";\nimport { IMPORTHUB_UI_NS } from \"../../i18n/resources\";\n\nexport interface ImportsIndexProps {\n\tclient: ImporthubClient;\n\t/** Opens the start flow: the host navigates to where it mounts `StartImport`. */\n\tonStart: () => void;\n\t/**\n\t * How often the list reads again while one of its Imports is queued or\n\t * running, in ms; 2000 by default. It stops once all have ended.\n\t */\n\tpollIntervalMs?: number;\n}\n\n// DataTable takes rows that are records.\ntype Row = Import & Record<string, unknown>;\n\n/**\n * The workspace's Imports, newest first, with their Profile, starter,\n * Outcome and counts (follow-an-import:AC1); a queued Import shows as Queued.\n * The list follows Imports that are still running. An importer starts one\n * from the header; a viewer sees no Start (follow-an-import:AC8).\n */\nexport function ImportsIndex({\n\tclient,\n\tonStart,\n\tpollIntervalMs = DEFAULT_POLL_INTERVAL_MS,\n}: ImportsIndexProps) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { workspaceId } = useHostIdentity();\n\tconst { paths } = useImporthubHost();\n\tconst canImport = useCanImport();\n\tconst personName = usePersonName();\n\tconst query = useInfiniteQuery({\n\t\tqueryKey: importhubKeys.imports(workspaceId),\n\t\tqueryFn: ({ pageParam }) => client.listImports(pageParam),\n\t\tinitialPageParam: \"\",\n\t\tgetNextPageParam: (last) => last.nextPageToken || undefined,\n\t\trefetchInterval: (q) =>\n\t\t\tq.state.data?.pages.some((p) => p.imports.some(isRunning)) ? pollIntervalMs : false,\n\t});\n\tconst rows = useMemo(\n\t\t() => (query.data?.pages.flatMap((p) => p.imports) ?? []) as Row[],\n\t\t[query.data],\n\t);\n\tconst columns = useMemo<ColumnDef<Row, unknown>[]>(\n\t\t() => [\n\t\t\t{\n\t\t\t\tid: \"profile\",\n\t\t\t\theader: t(\"imports.profile\"),\n\t\t\t\tcell: (c) => (\n\t\t\t\t\t<LinkCell\n\t\t\t\t\t\tto={itemPath(paths, \"imports\", c.row.original.id)}\n\t\t\t\t\t\tlabel={c.row.original.importProfileName}\n\t\t\t\t\t/>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"startedBy\",\n\t\t\t\theader: t(\"imports.startedBy\"),\n\t\t\t\tsize: 160,\n\t\t\t\tcell: (c) => <TruncatedTextCell value={personName(c.row.original.startedBy)} />,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"started\",\n\t\t\t\theader: t(\"imports.started\"),\n\t\t\t\tsize: 150,\n\t\t\t\tcell: (c) => <DateCell value={c.row.original.createTime} />,\n\t\t\t},\n\t\t\t{\n\t\t\t\t// Its Outcome once it has one, its phase until then.\n\t\t\t\tid: \"outcome\",\n\t\t\t\theader: t(\"imports.outcomeColumn\"),\n\t\t\t\tsize: 190,\n\t\t\t\tcell: (c) => <ImportStatusCell im={c.row.original} />,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"matched\",\n\t\t\t\theader: t(\"imports.matched\"),\n\t\t\t\tsize: 90,\n\t\t\t\tcell: (c) => <NumberCell value={c.row.original.counts.matched} />,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"created\",\n\t\t\t\theader: t(\"imports.created\"),\n\t\t\t\tsize: 90,\n\t\t\t\tcell: (c) => <NumberCell value={c.row.original.counts.created} />,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"problems\",\n\t\t\t\theader: t(\"imports.problems\"),\n\t\t\t\tsize: 90,\n\t\t\t\tcell: (c) => <NumberCell value={c.row.original.counts.problems} />,\n\t\t\t},\n\t\t],\n\t\t[t, paths, personName],\n\t);\n\treturn (\n\t\t<IndexPageTemplate\n\t\t\ttitle={t(\"section.imports.title\")}\n\t\t\tactions={\n\t\t\t\tcanImport ? (\n\t\t\t\t\t<Button variant=\"solid\" onClick={onStart}>\n\t\t\t\t\t\t<Play size={16} aria-hidden />\n\t\t\t\t\t\t{t(\"imports.start\")}\n\t\t\t\t\t</Button>\n\t\t\t\t) : undefined\n\t\t\t}\n\t\t>\n\t\t\t{query.isError ? (\n\t\t\t\t<LoadFailed />\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<DataTable\n\t\t\t\t\t\tcolumns={columns}\n\t\t\t\t\t\tdata={rows}\n\t\t\t\t\t\tloading={query.isPending}\n\t\t\t\t\t\tgetRowId={(i) => i.id}\n\t\t\t\t\t\temptyState={t(\"imports.empty\")}\n\t\t\t\t\t/>\n\t\t\t\t\t{query.hasNextPage ? (\n\t\t\t\t\t\t<Center py=\"4\">\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\t\t\tloading={query.isFetchingNextPage}\n\t\t\t\t\t\t\t\tonClick={() => void query.fetchNextPage()}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{t(\"imports.loadMore\")}\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</Center>\n\t\t\t\t\t) : null}\n\t\t\t\t</>\n\t\t\t)}\n\t\t</IndexPageTemplate>\n\t);\n}\n","import type { ImporthubClient } from \"../../client/importhub-client\";\nimport { MappingScreen } from \"./mapping-page\";\n\nexport interface MappingDetailProps {\n\tclient: ImporthubClient;\n\t/** The Mapping's id. */\n\tid: string;\n\t/** It was deleted: the host leaves its page. */\n\tonDeleted: () => void;\n}\n\n/**\n * One Mapping's page without the structured editor (manage-mappings:AC2):\n * its name, element selector and Source Key, its target, the Profiles that\n * include it, release and history. Every other setting (field mappings,\n * Version Match, Title Contributions, …) is the Mapping editor's, from\n * `@knkcs/importhub-ui/mapping-editor`, and is saved back exactly as it came.\n * A host that loads the editor mounts `MappingEditor` in its place: the same\n * page with the editor's tabs.\n */\nexport function MappingDetail({ client, id, onDeleted }: MappingDetailProps) {\n\treturn <MappingScreen client={client} id={id} onDeleted={onDeleted} />;\n}\n","import { BaseSelectField, InputField } from \"@knkcs/anker/forms\";\nimport { useHostIdentity } from \"@knkcs/anker/host\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport { useEffect, useRef } from \"react\";\nimport { useFormContext, useWatch } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport { useImporthubHost } from \"../../common/host\";\nimport { importhubKeys } from \"../../common/query-keys\";\nimport { IMPORTHUB_UI_NS } from \"../../i18n/resources\";\n\ntype Values = { blueprintId: string; blueprintReleaseId: string };\n\n/**\n * A new Mapping's target Blueprint and the Release it pins\n * (manage-mappings:AC2): picked by name from the host's lookup, or, where the\n * host has none, entered as the ids they are, labelled as such.\n */\nexport function BlueprintFields() {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { blueprints } = useImporthubHost();\n\tif (!blueprints) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<InputField<Values> name=\"blueprintId\" label={t(\"mappings.blueprintId\")} required />\n\t\t\t\t<InputField<Values>\n\t\t\t\t\tname=\"blueprintReleaseId\"\n\t\t\t\t\tlabel={t(\"mappings.releaseId\")}\n\t\t\t\t\thelperText={t(\"mappings.idsHelp\")}\n\t\t\t\t\trequired\n\t\t\t\t/>\n\t\t\t</>\n\t\t);\n\t}\n\treturn <BlueprintSelects />;\n}\n\nfunction BlueprintSelects() {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { blueprints } = useImporthubHost();\n\tconst { workspaceId } = useHostIdentity();\n\tconst { control, setValue } = useFormContext<Values>();\n\tconst blueprintId = useWatch({ control, name: \"blueprintId\" });\n\t// Another Blueprint empties the Release: one of the old Blueprint's would\n\t// make the Mapping invalid (`release_of_other_blueprint`).\n\tconst previous = useRef(blueprintId);\n\tuseEffect(() => {\n\t\tif (previous.current !== blueprintId) setValue(\"blueprintReleaseId\", \"\");\n\t\tprevious.current = blueprintId;\n\t}, [blueprintId, setValue]);\n\tconst list = useQuery({\n\t\tqueryKey: importhubKeys.blueprints(workspaceId),\n\t\tqueryFn: () => blueprints?.listBlueprints() ?? Promise.resolve([]),\n\t});\n\tconst releases = useQuery({\n\t\tqueryKey: importhubKeys.blueprintReleases(workspaceId, blueprintId ?? \"\"),\n\t\tqueryFn: () => blueprints?.listReleases(blueprintId) ?? Promise.resolve([]),\n\t\tenabled: Boolean(blueprintId),\n\t});\n\treturn (\n\t\t<>\n\t\t\t<BaseSelectField<Values>\n\t\t\t\tname=\"blueprintId\"\n\t\t\t\tlabel={t(\"mappings.blueprint\")}\n\t\t\t\trequired\n\t\t\t\toptions={(list.data ?? []).map((b) => ({ id: b.id, label: b.name }))}\n\t\t\t/>\n\t\t\t<BaseSelectField<Values>\n\t\t\t\tname=\"blueprintReleaseId\"\n\t\t\t\tlabel={t(\"mappings.release\")}\n\t\t\t\trequired\n\t\t\t\tdisabled={!blueprintId}\n\t\t\t\toptions={(releases.data ?? []).map((r) => ({ id: r.id, label: r.label }))}\n\t\t\t/>\n\t\t</>\n\t);\n}\n","import { Button } from \"@knkcs/anker/atoms\";\nimport { CodeCell, DataTable, LinkCell, TruncatedTextCell } from \"@knkcs/anker/components\";\nimport { useHostIdentity } from \"@knkcs/anker/host\";\nimport { IndexPageTemplate } from \"@knkcs/anker/templates\";\nimport { useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport type { ColumnDef } from \"@tanstack/react-table\";\nimport { Plus } from \"lucide-react\";\nimport { useMemo, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport type { ImporthubClient, Mapping } from \"../../client/importhub-client\";\nimport { useBlueprintNames } from \"../../common/blueprint-names\";\nimport { CreateDialog } from \"../../common/create-dialog\";\nimport { itemPath, useImporthubHost } from \"../../common/host\";\nimport { importhubKeys } from \"../../common/query-keys\";\nimport { LoadFailed } from \"../../common/query-state\";\nimport { useCanConfigure } from \"../../common/use-can-configure\";\nimport { ValidityCell } from \"../../common/validity\";\nimport { IMPORTHUB_UI_NS } from \"../../i18n/resources\";\nimport { BlueprintFields } from \"./blueprint-fields\";\n\nexport interface MappingsIndexProps {\n\tclient: ImporthubClient;\n\t/** Opens a Mapping's page: the host navigates, after a create too. */\n\tonOpen: (id: string) => void;\n}\n\n// DataTable takes rows that are records.\ntype Row = Mapping & Record<string, unknown>;\n\nconst CREATE_DEFAULTS = { blueprintId: \"\", blueprintReleaseId: \"\" };\n\n/**\n * Every Mapping of the workspace with its target Blueprint, its pinned\n * Blueprint Release and its validity (manage-mappings:AC1); an admin creates\n * one, naming the Blueprint and the Release, from the header (AC2).\n */\nexport function MappingsIndex({ client, onOpen }: MappingsIndexProps) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { workspaceId } = useHostIdentity();\n\tconst { paths } = useImporthubHost();\n\tconst canConfigure = useCanConfigure();\n\tconst queryClient = useQueryClient();\n\tconst [creating, setCreating] = useState(false);\n\tconst query = useQuery({\n\t\tqueryKey: importhubKeys.mappings(workspaceId),\n\t\tqueryFn: () => client.listMappings(),\n\t});\n\tconst names = useBlueprintNames((query.data ?? []).map((m) => m.content.blueprintId));\n\tconst columns = useMemo<ColumnDef<Row, unknown>[]>(\n\t\t() => [\n\t\t\t{\n\t\t\t\tid: \"name\",\n\t\t\t\theader: t(\"fields.name\"),\n\t\t\t\tcell: (c) => (\n\t\t\t\t\t<LinkCell\n\t\t\t\t\t\tto={itemPath(paths, \"mappings\", c.row.original.id)}\n\t\t\t\t\t\tlabel={c.row.original.content.name}\n\t\t\t\t\t/>\n\t\t\t\t),\n\t\t\t},\n\t\t\tnames.available\n\t\t\t\t? {\n\t\t\t\t\t\tid: \"blueprint\",\n\t\t\t\t\t\theader: t(\"mappings.blueprint\"),\n\t\t\t\t\t\tcell: (c) => (\n\t\t\t\t\t\t\t<TruncatedTextCell\n\t\t\t\t\t\t\t\tvalue={names.blueprintName(c.row.original.content.blueprintId) ?? \"\"}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t),\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\tid: \"blueprint\",\n\t\t\t\t\t\theader: t(\"mappings.blueprintId\"),\n\t\t\t\t\t\tcell: (c) => <CodeCell value={c.row.original.content.blueprintId} />,\n\t\t\t\t\t},\n\t\t\tnames.available\n\t\t\t\t? {\n\t\t\t\t\t\tid: \"release\",\n\t\t\t\t\t\theader: t(\"mappings.release\"),\n\t\t\t\t\t\tcell: (c) => (\n\t\t\t\t\t\t\t<TruncatedTextCell\n\t\t\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\t\t\tnames.releaseLabel(\n\t\t\t\t\t\t\t\t\t\tc.row.original.content.blueprintId,\n\t\t\t\t\t\t\t\t\t\tc.row.original.content.blueprintReleaseId,\n\t\t\t\t\t\t\t\t\t) ?? \"\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t),\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\tid: \"release\",\n\t\t\t\t\t\theader: t(\"mappings.releaseId\"),\n\t\t\t\t\t\tcell: (c) => <CodeCell value={c.row.original.content.blueprintReleaseId} />,\n\t\t\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"validity\",\n\t\t\t\theader: t(\"validity.column\"),\n\t\t\t\tcell: (c) => <ValidityCell validity={c.row.original.validity} />,\n\t\t\t},\n\t\t],\n\t\t[t, paths, names],\n\t);\n\treturn (\n\t\t<IndexPageTemplate\n\t\t\ttitle={t(\"section.mappings.title\")}\n\t\t\tactions={\n\t\t\t\tcanConfigure ? (\n\t\t\t\t\t<Button variant=\"solid\" onClick={() => setCreating(true)}>\n\t\t\t\t\t\t<Plus size={16} aria-hidden />\n\t\t\t\t\t\t{t(\"mappings.new\")}\n\t\t\t\t\t</Button>\n\t\t\t\t) : undefined\n\t\t\t}\n\t\t>\n\t\t\t{query.isError ? (\n\t\t\t\t<LoadFailed />\n\t\t\t) : (\n\t\t\t\t<DataTable\n\t\t\t\t\tcolumns={columns}\n\t\t\t\t\tdata={(query.data ?? []) as Row[]}\n\t\t\t\t\tloading={query.isPending}\n\t\t\t\t\tgetRowId={(m) => m.id}\n\t\t\t\t\temptyState={t(\"mappings.empty\")}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<CreateDialog\n\t\t\t\topen={creating}\n\t\t\t\tonClose={() => setCreating(false)}\n\t\t\t\ttitle={t(\"mappings.new\")}\n\t\t\t\tdefaultValues={CREATE_DEFAULTS}\n\t\t\t\tonCreate={async ({ name, description, blueprintId, blueprintReleaseId }) => {\n\t\t\t\t\tconst m = await client.createMapping({\n\t\t\t\t\t\tname,\n\t\t\t\t\t\tdescription,\n\t\t\t\t\t\tblueprintId: blueprintId ?? \"\",\n\t\t\t\t\t\tblueprintReleaseId: blueprintReleaseId ?? \"\",\n\t\t\t\t\t});\n\t\t\t\t\tawait queryClient.invalidateQueries({ queryKey: importhubKeys.mappings(workspaceId) });\n\t\t\t\t\treturn m.id;\n\t\t\t\t}}\n\t\t\t\tonCreated={(id) => {\n\t\t\t\t\tsetCreating(false);\n\t\t\t\t\tonOpen(id);\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<BlueprintFields />\n\t\t\t</CreateDialog>\n\t\t</IndexPageTemplate>\n\t);\n}\n","import { DataTable, SlugCell, TruncatedTextCell } from \"@knkcs/anker/components\";\nimport { useHostIdentity } from \"@knkcs/anker/host\";\nimport { IndexPageTemplate } from \"@knkcs/anker/templates\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { ColumnDef } from \"@tanstack/react-table\";\nimport { useMemo } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport type { ImporthubClient, Processor } from \"../../client/importhub-client\";\nimport { importhubKeys } from \"../../common/query-keys\";\nimport { LoadFailed } from \"../../common/query-state\";\nimport { IMPORTHUB_UI_NS } from \"../../i18n/resources\";\n\nexport interface ProcessorCatalogueProps {\n\tclient: ImporthubClient;\n}\n\n// DataTable takes rows that are records.\ntype Row = Processor & Record<string, unknown>;\n\n/**\n * The Processor catalogue (manage-import-profiles:AC5): every Processor with\n * its kind, where it is configured, what it does and the settings it takes,\n * by their names. Read-only for everyone: the catalogue is importhub's.\n */\nexport function ProcessorCatalogue({ client }: ProcessorCatalogueProps) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { workspaceId } = useHostIdentity();\n\tconst query = useQuery({\n\t\tqueryKey: importhubKeys.processors(workspaceId),\n\t\tqueryFn: () => client.listProcessors(),\n\t});\n\tconst columns = useMemo<ColumnDef<Row, unknown>[]>(\n\t\t() => [\n\t\t\t{\n\t\t\t\tid: \"name\",\n\t\t\t\theader: t(\"fields.name\"),\n\t\t\t\tsize: 180,\n\t\t\t\tcell: (c) => <SlugCell value={c.row.original.name} />,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"kind\",\n\t\t\t\theader: t(\"processors.kindColumn\"),\n\t\t\t\tsize: 140,\n\t\t\t\tcell: (c) => <TruncatedTextCell value={t(`processors.kind.${c.row.original.kind}`)} />,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"target\",\n\t\t\t\theader: t(\"processors.targetColumn\"),\n\t\t\t\tsize: 160,\n\t\t\t\tcell: (c) => <TruncatedTextCell value={t(`processors.target.${c.row.original.target}`)} />,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"description\",\n\t\t\t\theader: t(\"fields.description\"),\n\t\t\t\tcell: (c) => <TruncatedTextCell value={c.row.original.description} />,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"settings\",\n\t\t\t\theader: t(\"processors.settingsColumn\"),\n\t\t\t\tcell: (c) => (\n\t\t\t\t\t<TruncatedTextCell\n\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\tc.row.original.settingsSpec.length === 0\n\t\t\t\t\t\t\t\t? t(\"processors.noSettings\")\n\t\t\t\t\t\t\t\t: c.row.original.settingsSpec\n\t\t\t\t\t\t\t\t\t\t.map((f) => f.config.name || f.config.api_accessor)\n\t\t\t\t\t\t\t\t\t\t.join(\", \")\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t),\n\t\t\t},\n\t\t],\n\t\t[t],\n\t);\n\treturn (\n\t\t<IndexPageTemplate title={t(\"section.processors.title\")}>\n\t\t\t{query.isError ? (\n\t\t\t\t<LoadFailed />\n\t\t\t) : (\n\t\t\t\t<DataTable\n\t\t\t\t\tcolumns={columns}\n\t\t\t\t\tdata={(query.data ?? []) as Row[]}\n\t\t\t\t\tloading={query.isPending}\n\t\t\t\t\tgetRowId={(p) => p.name}\n\t\t\t\t\temptyState={t(\"processors.empty\")}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</IndexPageTemplate>\n\t);\n}\n","import { Button, IconButton } from \"@knkcs/anker/atoms\";\nimport {\n\tBox,\n\tHStack,\n\tMenuContent,\n\tMenuItem,\n\tMenuRoot,\n\tMenuTrigger,\n\tStack,\n\tText,\n} from \"@knkcs/anker/primitives\";\nimport { ArrowDown, ArrowUp, Plus, Trash2 } from \"lucide-react\";\nimport type { ReactNode } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { IMPORTHUB_UI_NS } from \"../../i18n/resources\";\n\n/** Moves the item at `from` to `to`, returning a new list. */\nexport function moved<T>(list: readonly T[], from: number, to: number): T[] {\n\tconst next = [...list];\n\tconst [item] = next.splice(from, 1);\n\tnext.splice(to, 0, item as T);\n\treturn next;\n}\n\nexport interface OrderedListProps<T> {\n\titems: readonly T[];\n\t/** Each row's content: its name and what else it shows. */\n\trenderItem: (item: T, index: number) => ReactNode;\n\t/** The row's name in the move and remove buttons' labels. */\n\tnameOf: (item: T) => string;\n\t/** Whether to offer moving, removing and adding: an admin's. */\n\teditable: boolean;\n\tonChange: (next: T[]) => void;\n\t/** Shown when the list is empty. */\n\temptyLabel: string;\n\t/** The add menu's button label, and what it offers. */\n\taddLabel: string;\n\taddOptions: { value: string; label: string }[];\n\tonAdd: (value: string) => void;\n}\n\n/**\n * An ordered list a Profile holds (its Preprocessors, Mappings and\n * Post-processors), in the order they run: an admin moves each up or down\n * with a button, which the keyboard reaches as well as the pointer, removes\n * it, and adds from a menu (manage-import-profiles:AC4).\n */\nexport function OrderedList<T>({\n\titems,\n\trenderItem,\n\tnameOf,\n\teditable,\n\tonChange,\n\temptyLabel,\n\taddLabel,\n\taddOptions,\n\tonAdd,\n}: OrderedListProps<T>) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\treturn (\n\t\t<Stack gap=\"2\">\n\t\t\t{items.length === 0 ? (\n\t\t\t\t<Text color=\"fg.muted\">{emptyLabel}</Text>\n\t\t\t) : (\n\t\t\t\t<Stack as=\"ol\" gap=\"0\" listStyleType=\"none\" ms=\"0\">\n\t\t\t\t\t{items.map((item, index) => {\n\t\t\t\t\t\tconst name = nameOf(item);\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\t\tas=\"li\"\n\t\t\t\t\t\t\t\t// Items carry no id of their own; the same Processor may run twice.\n\t\t\t\t\t\t\t\t// biome-ignore lint/suspicious/noArrayIndexKey: the position is the identity here\n\t\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\t\tgap=\"3\"\n\t\t\t\t\t\t\t\tpy=\"2\"\n\t\t\t\t\t\t\t\tborderBottomWidth=\"1px\"\n\t\t\t\t\t\t\t\tborderColor=\"border\"\n\t\t\t\t\t\t\t\talign=\"start\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Text color=\"fg.muted\" minW=\"6\" textAlign=\"end\">\n\t\t\t\t\t\t\t\t\t{index + 1}.\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t<Box flex=\"1\" minW=\"0\">\n\t\t\t\t\t\t\t\t\t{renderItem(item, index)}\n\t\t\t\t\t\t\t\t</Box>\n\t\t\t\t\t\t\t\t{editable ? (\n\t\t\t\t\t\t\t\t\t<HStack gap=\"1\">\n\t\t\t\t\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t\t\t\t\taria-label={t(\"order.moveUp\", { name })}\n\t\t\t\t\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\t\t\t\t\t\tdisabled={index === 0}\n\t\t\t\t\t\t\t\t\t\t\tonClick={() => onChange(moved(items, index, index - 1))}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<ArrowUp size={14} />\n\t\t\t\t\t\t\t\t\t\t</IconButton>\n\t\t\t\t\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t\t\t\t\taria-label={t(\"order.moveDown\", { name })}\n\t\t\t\t\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\t\t\t\t\t\tdisabled={index === items.length - 1}\n\t\t\t\t\t\t\t\t\t\t\tonClick={() => onChange(moved(items, index, index + 1))}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<ArrowDown size={14} />\n\t\t\t\t\t\t\t\t\t\t</IconButton>\n\t\t\t\t\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t\t\t\t\taria-label={t(\"order.remove\", { name })}\n\t\t\t\t\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\t\t\t\t\t\tcolorPalette=\"red\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={() => onChange(items.filter((_, i) => i !== index))}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<Trash2 size={14} />\n\t\t\t\t\t\t\t\t\t\t</IconButton>\n\t\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</Stack>\n\t\t\t)}\n\t\t\t{editable ? (\n\t\t\t\t<Box>\n\t\t\t\t\t<MenuRoot onSelect={(d) => onAdd(d.value)}>\n\t\t\t\t\t\t<MenuTrigger asChild>\n\t\t\t\t\t\t\t<Button variant=\"outline\" size=\"sm\" disabled={addOptions.length === 0}>\n\t\t\t\t\t\t\t\t<Plus size={14} aria-hidden />\n\t\t\t\t\t\t\t\t{addLabel}\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</MenuTrigger>\n\t\t\t\t\t\t<MenuContent>\n\t\t\t\t\t\t\t{addOptions.map((o) => (\n\t\t\t\t\t\t\t\t<MenuItem key={o.value} value={o.value}>\n\t\t\t\t\t\t\t\t\t{o.label}\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</MenuContent>\n\t\t\t\t\t</MenuRoot>\n\t\t\t\t</Box>\n\t\t\t) : null}\n\t\t</Stack>\n\t);\n}\n","import { zodResolver } from \"@hookform/resolvers/zod\";\nimport { Modal } from \"@knkcs/anker/components\";\nimport { FieldKitProvider, SpecForm } from \"@knkcs/fieldkit/renderer\";\nimport { builtInFieldTypes, specToZodSchema } from \"@knkcs/fieldkit/schema\";\nimport { useEffect, useMemo } from \"react\";\nimport { FormProvider, useForm } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport type { Processor } from \"../../client/importhub-client\";\nimport { IMPORTHUB_UI_NS } from \"../../i18n/resources\";\n\nexport interface ProcessorSettingsDialogProps {\n\topen: boolean;\n\tonClose: () => void;\n\t/** The Processor whose settings these are; null while nothing is open. */\n\tprocessor: Processor | null;\n\tsettings: Record<string, unknown>;\n\t/** Shows the settings without a way to change them: a viewer's. */\n\treadOnly: boolean;\n\t/** Applies the settings into the Profile's draft; the header's Save persists them. */\n\tonApply: (settings: Record<string, unknown>) => void;\n}\n\nconst NO_SETTINGS: Record<string, unknown> = {};\n\n/**\n * One Processor step's settings, in the form fieldkit generates from the\n * Processor's settings spec (manage-import-profiles:AC4): anker fields,\n * validated by the spec's own Zod schema, which is the shape importhub\n * checks on save. \"Apply\" puts them into the Profile's draft; nothing is\n * saved until the page's Save (anker ADR 0004).\n */\nexport function ProcessorSettingsDialog({\n\topen,\n\tonClose,\n\tprocessor,\n\tsettings,\n\treadOnly,\n\tonApply,\n}: ProcessorSettingsDialogProps) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst spec = processor?.settingsSpec ?? [];\n\tconst resolver = useMemo(() => zodResolver(specToZodSchema(spec, builtInFieldTypes)), [spec]);\n\tconst form = useForm<Record<string, unknown>>({ defaultValues: settings, resolver });\n\tconst { reset } = form;\n\t// Each opening starts from the step's settings as they are in the draft.\n\tuseEffect(() => {\n\t\tif (open) reset(settings ?? NO_SETTINGS);\n\t}, [open, settings, reset]);\n\tconst apply = form.handleSubmit((values) => onApply(values));\n\treturn (\n\t\t<Modal\n\t\t\topen={open}\n\t\t\tonClose={onClose}\n\t\t\theader={t(\"processors.settingsOf\", { name: processor?.name ?? \"\" })}\n\t\t\tlazyMount\n\t\t\tunmountOnExit\n\t\t\tcancelLabel={readOnly ? t(\"common.close\") : t(\"common.cancel\")}\n\t\t\tsaveLabel={t(\"common.apply\")}\n\t\t\tonSave={readOnly ? undefined : () => void apply()}\n\t\t>\n\t\t\t<FormProvider {...form}>\n\t\t\t\t<form\n\t\t\t\t\tonSubmit={(e) => {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\tvoid apply();\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<FieldKitProvider plugins={builtInFieldTypes}>\n\t\t\t\t\t\t{readOnly ? (\n\t\t\t\t\t\t\t<SpecForm schema={spec} mode=\"read\" values={settings} />\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<SpecForm schema={spec} />\n\t\t\t\t\t\t)}\n\t\t\t\t\t</FieldKitProvider>\n\t\t\t\t</form>\n\t\t\t</FormProvider>\n\t\t</Modal>\n\t);\n}\n","import { Button, StatusBadge } from \"@knkcs/anker/atoms\";\nimport { Card, ContextRail } from \"@knkcs/anker/components\";\nimport { BaseSelectField, InputField, SwitchField, TextareaField } from \"@knkcs/anker/forms\";\nimport { useHostIdentity } from \"@knkcs/anker/host\";\nimport { Alert, Box, HStack, Link, Stack, Text } from \"@knkcs/anker/primitives\";\nimport { DetailPageTemplate, usePageRail } from \"@knkcs/anker/templates\";\nimport { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport { Settings2, Trash2 } from \"lucide-react\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport { FormProvider, useForm, useFormContext, useWatch } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport { Link as RouterLink } from \"react-router\";\nimport type {\n\tImporthubClient,\n\tImportProfile,\n\tImportProfileContent,\n\tProcessor,\n\tProcessorKind,\n\tProcessorStep,\n} from \"../../client/importhub-client\";\nimport { useConfigurationTab } from \"../../common/configuration-tabs\";\nimport { DeleteDialog } from \"../../common/delete-dialog\";\nimport { itemPath, useImporthubHost } from \"../../common/host\";\nimport { importhubKeys } from \"../../common/query-keys\";\nimport { LoadFailed, Loading } from \"../../common/query-state\";\nimport { ReleaseStateBadge } from \"../../common/release-state\";\nimport { useCanConfigure } from \"../../common/use-can-configure\";\nimport { useConfigurationRelease } from \"../../common/use-configuration-release\";\nimport { ValidityAlert } from \"../../common/validity\";\nimport { IMPORTHUB_UI_NS } from \"../../i18n/resources\";\nimport { ConfigurationHistory } from \"../history/configuration-history\";\nimport { OrderedList } from \"./ordered-list\";\nimport { ProcessorSettingsDialog } from \"./processor-settings-dialog\";\n\nexport interface ImportProfileDetailProps {\n\tclient: ImporthubClient;\n\t/** The Import Profile's id. */\n\tid: string;\n\t/** It was deleted: the host leaves its page, for the list, say. */\n\tonDeleted: () => void;\n}\n\n/** The form's values: the content, with \"no Entity Set\" as null for the select. */\ntype ProfileValues = Omit<ImportProfileContent, \"entitySetId\"> & { entitySetId: string | null };\n\nconst valuesOf = (c: ImportProfileContent): ProfileValues => ({\n\t...c,\n\tentitySetId: c.entitySetId || null,\n});\n\nconst contentOf = (v: ProfileValues): ImportProfileContent => ({\n\t...v,\n\tentitySetId: v.entitySetId ?? \"\",\n});\n\n/**\n * One Import Profile with every setting (manage-import-profiles:AC3): its\n * Entity Set, its Preprocessors, Mappings and Post-processors in order, each\n * Processor configured in a form generated from its settings spec (AC4), and\n * what happens to the result. An admin edits all of it as one draft and\n * saves it with the header's one Save, and deletes the Profile from the rail\n * (anker ADR 0004); a viewer sees the same page read-only. Why it is invalid\n * heads the page (AC6).\n */\nexport function ImportProfileDetail({ client, id, onDeleted }: ImportProfileDetailProps) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { workspaceId } = useHostIdentity();\n\tconst query = useQuery({\n\t\tqueryKey: importhubKeys.importProfile(workspaceId, id),\n\t\tqueryFn: () => client.getImportProfile(id),\n\t});\n\tif (query.isError) {\n\t\treturn (\n\t\t\t<DetailPageTemplate title={t(\"section.profiles.title\")}>\n\t\t\t\t<LoadFailed />\n\t\t\t</DetailPageTemplate>\n\t\t);\n\t}\n\tif (!query.data) {\n\t\treturn (\n\t\t\t<DetailPageTemplate title={t(\"section.profiles.title\")}>\n\t\t\t\t<Loading />\n\t\t\t</DetailPageTemplate>\n\t\t);\n\t}\n\treturn <ProfilePage client={client} profile={query.data} onDeleted={onDeleted} />;\n}\n\nfunction ProfilePage({\n\tclient,\n\tprofile,\n\tonDeleted,\n}: {\n\tclient: ImporthubClient;\n\tprofile: ImportProfile;\n\tonDeleted: () => void;\n}) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { workspaceId } = useHostIdentity();\n\tconst { paths } = useImporthubHost();\n\tconst canConfigure = useCanConfigure();\n\tconst queryClient = useQueryClient();\n\tconst [deleting, setDeleting] = useState(false);\n\n\tconst processors = useQuery({\n\t\tqueryKey: importhubKeys.processors(workspaceId),\n\t\tqueryFn: () => client.listProcessors(),\n\t});\n\tconst mappings = useQuery({\n\t\tqueryKey: importhubKeys.mappings(workspaceId),\n\t\tqueryFn: () => client.listMappings(),\n\t});\n\tconst entitySets = useQuery({\n\t\tqueryKey: importhubKeys.entitySets(workspaceId),\n\t\tqueryFn: () => client.listEntitySets(),\n\t});\n\n\tconst form = useForm<ProfileValues>({ defaultValues: valuesOf(profile.content) });\n\tconst { reset, formState } = form;\n\t// A newer draft from the server (a save, a refetch) becomes the baseline\n\t// unless the admin is in the middle of an edit.\n\tuseEffect(() => {\n\t\tif (!formState.isDirty) reset(valuesOf(profile.content));\n\t}, [profile, reset, formState.isDirty]);\n\n\tconst save = useMutation({\n\t\tmutationFn: (values: ProfileValues) =>\n\t\t\tclient.updateImportProfile(profile.id, contentOf(values), profile.state.draftRevisionId),\n\t\tonSuccess: (saved) => {\n\t\t\tqueryClient.setQueryData(importhubKeys.importProfile(workspaceId, saved.id), saved);\n\t\t\treset(valuesOf(saved.content));\n\t\t\tvoid queryClient.invalidateQueries({ queryKey: importhubKeys.importProfiles(workspaceId) });\n\t\t},\n\t});\n\tconst onSave = form.handleSubmit((values) => save.mutate(values));\n\n\tconst name = useWatch({ control: form.control, name: \"name\" });\n\tconst [tab, tabs] = useConfigurationTab();\n\tconst releasing = useConfigurationRelease({\n\t\tclient,\n\t\tkind: \"importProfile\",\n\t\tid: profile.id,\n\t\tvalidity: profile.validity,\n\t\tstate: profile.state,\n\t\tunsaved: formState.isDirty,\n\t});\n\n\tusePageRail(\n\t\tcanConfigure ? (\n\t\t\t<ContextRail storageKey=\"importhub.profile.rail\">\n\t\t\t\t<ContextRail.Header title={t(\"rail.title\")} />\n\t\t\t\t<ContextRail.Section id=\"actions\" label={t(\"rail.actions\")}>\n\t\t\t\t\t{releasing.railAction}\n\t\t\t\t\t<ContextRail.IconButton\n\t\t\t\t\t\tlabel={t(\"profiles.delete\")}\n\t\t\t\t\t\ticon={<Trash2 size={16} />}\n\t\t\t\t\t\ttone=\"outline-red\"\n\t\t\t\t\t\tonClick={() => setDeleting(true)}\n\t\t\t\t\t/>\n\t\t\t\t</ContextRail.Section>\n\t\t\t</ContextRail>\n\t\t) : null,\n\t);\n\n\treturn (\n\t\t<DetailPageTemplate\n\t\t\ttitle={profile.content.name}\n\t\t\tbreadcrumbs={[{ label: t(\"section.profiles.title\"), to: paths.profiles }]}\n\t\t\tbadges={\n\t\t\t\t<HStack gap=\"2\">\n\t\t\t\t\t<StatusBadge\n\t\t\t\t\t\ttone={profile.validity.valid ? \"success\" : \"danger\"}\n\t\t\t\t\t\tlabel={profile.validity.valid ? t(\"validity.valid\") : t(\"validity.invalid\")}\n\t\t\t\t\t/>\n\t\t\t\t\t<ReleaseStateBadge state={profile.state} />\n\t\t\t\t</HStack>\n\t\t\t}\n\t\t\ttabs={tabs}\n\t\t\tactions={\n\t\t\t\tcanConfigure ? (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"solid\"\n\t\t\t\t\t\tdisabled={!formState.isDirty}\n\t\t\t\t\t\tloading={save.isPending}\n\t\t\t\t\t\tonClick={() => void onSave()}\n\t\t\t\t\t>\n\t\t\t\t\t\t{t(\"common.save\")}\n\t\t\t\t\t</Button>\n\t\t\t\t) : undefined\n\t\t\t}\n\t\t>\n\t\t\t{tab === \"history\" ? (\n\t\t\t\t<ConfigurationHistory\n\t\t\t\t\tclient={client}\n\t\t\t\t\tkind=\"importProfile\"\n\t\t\t\t\tid={profile.id}\n\t\t\t\t\tdraftRevisionId={profile.state.draftRevisionId}\n\t\t\t\t\tonRestored={async () => {\n\t\t\t\t\t\t// The restored draft replaces what the form holds.\n\t\t\t\t\t\tconst fresh = await client.getImportProfile(profile.id);\n\t\t\t\t\t\tqueryClient.setQueryData(importhubKeys.importProfile(workspaceId, fresh.id), fresh);\n\t\t\t\t\t\treset(valuesOf(fresh.content));\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<Box px=\"8\" py=\"6\">\n\t\t\t\t\t{/* The lists the settings name things from: until they are read, a\n\t\t\t\t step would show as unknown and the Entity Set as its id. */}\n\t\t\t\t\t{processors.isPending || mappings.isPending || entitySets.isPending ? (\n\t\t\t\t\t\t<Loading />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<FormProvider {...form}>\n\t\t\t\t\t\t\t<form\n\t\t\t\t\t\t\t\tonSubmit={(e) => {\n\t\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\t\tif (canConfigure) void onSave();\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Stack gap=\"4\">\n\t\t\t\t\t\t\t\t\t{releasing.notice}\n\t\t\t\t\t\t\t\t\t<ValidityAlert validity={profile.validity} />\n\t\t\t\t\t\t\t\t\t{save.isError ? (\n\t\t\t\t\t\t\t\t\t\t<Alert status=\"error\" colorPalette=\"danger\" title={t(\"save.failed\")}>\n\t\t\t\t\t\t\t\t\t\t\t{save.error.message}\n\t\t\t\t\t\t\t\t\t\t</Alert>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t<Card title={t(\"profiles.general\")}>\n\t\t\t\t\t\t\t\t\t\t<Stack gap=\"4\">\n\t\t\t\t\t\t\t\t\t\t\t<InputField<ProfileValues>\n\t\t\t\t\t\t\t\t\t\t\t\tname=\"name\"\n\t\t\t\t\t\t\t\t\t\t\t\tlabel={t(\"fields.name\")}\n\t\t\t\t\t\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\t\t\t\t\t\tdisabled={!canConfigure}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t<TextareaField<ProfileValues>\n\t\t\t\t\t\t\t\t\t\t\t\tname=\"description\"\n\t\t\t\t\t\t\t\t\t\t\t\tlabel={t(\"fields.description\")}\n\t\t\t\t\t\t\t\t\t\t\t\tdisabled={!canConfigure}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t<BaseSelectField<ProfileValues>\n\t\t\t\t\t\t\t\t\t\t\t\tname=\"entitySetId\"\n\t\t\t\t\t\t\t\t\t\t\t\tlabel={t(\"profiles.entitySet\")}\n\t\t\t\t\t\t\t\t\t\t\t\thelperText={t(\"profiles.entitySetHelp\")}\n\t\t\t\t\t\t\t\t\t\t\t\tplaceholder={t(\"profiles.noEntitySet\")}\n\t\t\t\t\t\t\t\t\t\t\t\toptions={(entitySets.data ?? []).map((e) => ({\n\t\t\t\t\t\t\t\t\t\t\t\t\tid: e.id,\n\t\t\t\t\t\t\t\t\t\t\t\t\tlabel: e.content.name,\n\t\t\t\t\t\t\t\t\t\t\t\t}))}\n\t\t\t\t\t\t\t\t\t\t\t\tdisabled={!canConfigure}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t<SwitchField<ProfileValues>\n\t\t\t\t\t\t\t\t\t\t\t\tname=\"autoPublish\"\n\t\t\t\t\t\t\t\t\t\t\t\tlabel={t(\"profiles.autoPublish\")}\n\t\t\t\t\t\t\t\t\t\t\t\thelperText={t(\"profiles.autoPublishHelp\")}\n\t\t\t\t\t\t\t\t\t\t\t\tdisabled={!canConfigure}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t<SwitchField<ProfileValues>\n\t\t\t\t\t\t\t\t\t\t\t\tname=\"deleteSourceFileOnSuccess\"\n\t\t\t\t\t\t\t\t\t\t\t\tlabel={t(\"profiles.deleteOnSuccess\")}\n\t\t\t\t\t\t\t\t\t\t\t\thelperText={t(\"profiles.deleteOnSuccessHelp\")}\n\t\t\t\t\t\t\t\t\t\t\t\tdisabled={!canConfigure}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t\t\t</Card>\n\t\t\t\t\t\t\t\t\t<Card title={t(\"profiles.preprocessors\")}>\n\t\t\t\t\t\t\t\t\t\t<StepsField\n\t\t\t\t\t\t\t\t\t\t\tname=\"preprocessors\"\n\t\t\t\t\t\t\t\t\t\t\tkind=\"preprocessor\"\n\t\t\t\t\t\t\t\t\t\t\tcatalogue={processors.data ?? []}\n\t\t\t\t\t\t\t\t\t\t\teditable={canConfigure}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</Card>\n\t\t\t\t\t\t\t\t\t<Card title={t(\"profiles.mappings\")}>\n\t\t\t\t\t\t\t\t\t\t<MappingsField\n\t\t\t\t\t\t\t\t\t\t\tmappings={(mappings.data ?? []).map((m) => ({\n\t\t\t\t\t\t\t\t\t\t\t\tid: m.id,\n\t\t\t\t\t\t\t\t\t\t\t\tname: m.content.name,\n\t\t\t\t\t\t\t\t\t\t\t\tvalid: m.validity.valid,\n\t\t\t\t\t\t\t\t\t\t\t}))}\n\t\t\t\t\t\t\t\t\t\t\teditable={canConfigure}\n\t\t\t\t\t\t\t\t\t\t\threfOf={(mappingId) => itemPath(paths, \"mappings\", mappingId)}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</Card>\n\t\t\t\t\t\t\t\t\t<Card title={t(\"profiles.postProcessors\")}>\n\t\t\t\t\t\t\t\t\t\t<StepsField\n\t\t\t\t\t\t\t\t\t\t\tname=\"postProcessors\"\n\t\t\t\t\t\t\t\t\t\t\tkind=\"post_processor\"\n\t\t\t\t\t\t\t\t\t\t\tcatalogue={processors.data ?? []}\n\t\t\t\t\t\t\t\t\t\t\teditable={canConfigure}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</Card>\n\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t</FormProvider>\n\t\t\t\t\t)}\n\t\t\t\t</Box>\n\t\t\t)}\n\t\t\t{releasing.dialog}\n\t\t\t<DeleteDialog\n\t\t\t\topen={deleting}\n\t\t\t\tonClose={() => setDeleting(false)}\n\t\t\t\ttitle={t(\"profiles.deleteTitle\", { name: name || profile.content.name })}\n\t\t\t\tmessage={t(\"profiles.deleteMessage\")}\n\t\t\t\tonDelete={() => client.deleteImportProfile(profile.id)}\n\t\t\t\tonDeleted={() => {\n\t\t\t\t\tsetDeleting(false);\n\t\t\t\t\tqueryClient.removeQueries({\n\t\t\t\t\t\tqueryKey: importhubKeys.importProfile(workspaceId, profile.id),\n\t\t\t\t\t});\n\t\t\t\t\tvoid queryClient.invalidateQueries({\n\t\t\t\t\t\tqueryKey: importhubKeys.importProfiles(workspaceId),\n\t\t\t\t\t});\n\t\t\t\t\tonDeleted();\n\t\t\t\t}}\n\t\t\t/>\n\t\t</DetailPageTemplate>\n\t);\n}\n\n/**\n * A Profile's Preprocessors or Post-processors: the Processors of that kind\n * that work on the whole Source File are offered (a rich-text field's are a\n * Mapping's, ADR 0007), and each step's settings open in a dialog.\n */\nfunction StepsField({\n\tname,\n\tkind,\n\tcatalogue,\n\teditable,\n}: {\n\tname: \"preprocessors\" | \"postProcessors\";\n\tkind: ProcessorKind;\n\tcatalogue: Processor[];\n\teditable: boolean;\n}) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { control, setValue } = useFormContextTyped();\n\tconst steps = useWatch({ control, name }) ?? [];\n\tconst [open, setOpen] = useState<number | null>(null);\n\tconst set = (next: ProcessorStep[]) => setValue(name, next, { shouldDirty: true });\n\tconst processorOf = (step: ProcessorStep) => catalogue.find((p) => p.name === step.processor);\n\tconst openStep = open === null ? undefined : steps[open];\n\tconst offered = catalogue.filter((p) => p.kind === kind && p.target === \"source_file\");\n\treturn (\n\t\t<>\n\t\t\t<OrderedList<ProcessorStep>\n\t\t\t\titems={steps}\n\t\t\t\tnameOf={(s) => s.processor}\n\t\t\t\teditable={editable}\n\t\t\t\tonChange={set}\n\t\t\t\temptyLabel={t(\n\t\t\t\t\tkind === \"preprocessor\" ? \"profiles.noPreprocessors\" : \"profiles.noPostProcessors\",\n\t\t\t\t)}\n\t\t\t\taddLabel={t(\n\t\t\t\t\tkind === \"preprocessor\" ? \"profiles.addPreprocessor\" : \"profiles.addPostProcessor\",\n\t\t\t\t)}\n\t\t\t\taddOptions={offered.map((p) => ({ value: p.name, label: p.name }))}\n\t\t\t\tonAdd={(processor) => {\n\t\t\t\t\tset([...steps, { processor, settings: {} }]);\n\t\t\t\t\t// A Processor with settings opens them at once: most need some.\n\t\t\t\t\tif ((offered.find((p) => p.name === processor)?.settingsSpec.length ?? 0) > 0) {\n\t\t\t\t\t\tsetOpen(steps.length);\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\trenderItem={(step, index) => {\n\t\t\t\t\tconst p = processorOf(step);\n\t\t\t\t\tconst count = Object.keys(step.settings).length;\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<HStack justify=\"space-between\" gap=\"3\">\n\t\t\t\t\t\t\t<Stack gap=\"0\" minW=\"0\">\n\t\t\t\t\t\t\t\t<Text fontFamily=\"mono\" fontSize=\"sm\">\n\t\t\t\t\t\t\t\t\t{step.processor}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t<Text color=\"fg.muted\" fontSize=\"sm\">\n\t\t\t\t\t\t\t\t\t{p ? p.description : t(\"processors.unknown\")}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t{p && p.settingsSpec.length > 0 ? (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\t\t\t\tonClick={() => setOpen(index)}\n\t\t\t\t\t\t\t\t\taria-label={t(editable ? \"processors.configure\" : \"processors.viewSettings\", {\n\t\t\t\t\t\t\t\t\t\tname: step.processor,\n\t\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Settings2 size={14} aria-hidden />\n\t\t\t\t\t\t\t\t\t{t(\"processors.settingsCount\", { count })}\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t);\n\t\t\t\t}}\n\t\t\t/>\n\t\t\t<ProcessorSettingsDialog\n\t\t\t\topen={openStep !== undefined}\n\t\t\t\tonClose={() => setOpen(null)}\n\t\t\t\tprocessor={openStep ? (processorOf(openStep) ?? null) : null}\n\t\t\t\tsettings={openStep?.settings ?? EMPTY}\n\t\t\t\treadOnly={!editable}\n\t\t\t\tonApply={(settings) => {\n\t\t\t\t\tif (open === null) return;\n\t\t\t\t\tset(steps.map((s, i) => (i === open ? { ...s, settings } : s)));\n\t\t\t\t\tsetOpen(null);\n\t\t\t\t}}\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nconst EMPTY: Record<string, unknown> = {};\n\n/** The Mappings a Profile includes, in the order they run, each a link to its page. */\nfunction MappingsField({\n\tmappings,\n\teditable,\n\threfOf,\n}: {\n\tmappings: { id: string; name: string; valid: boolean }[];\n\teditable: boolean;\n\threfOf: (id: string) => string;\n}) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { control, setValue } = useFormContextTyped();\n\tconst ids = useWatch({ control, name: \"mappingIds\" }) ?? [];\n\tconst byId = useMemo(() => new Map(mappings.map((m) => [m.id, m])), [mappings]);\n\tconst set = (next: string[]) => setValue(\"mappingIds\", next, { shouldDirty: true });\n\tconst nameOf = (id: string) => byId.get(id)?.name ?? t(\"profiles.missingMapping\");\n\treturn (\n\t\t<OrderedList<string>\n\t\t\titems={ids}\n\t\t\tnameOf={nameOf}\n\t\t\teditable={editable}\n\t\t\tonChange={set}\n\t\t\temptyLabel={t(\"profiles.noMappings\")}\n\t\t\taddLabel={t(\"profiles.addMapping\")}\n\t\t\taddOptions={mappings\n\t\t\t\t.filter((m) => !ids.includes(m.id))\n\t\t\t\t.map((m) => ({ value: m.id, label: m.name }))}\n\t\t\tonAdd={(mappingId) => set([...ids, mappingId])}\n\t\t\trenderItem={(mappingId) => {\n\t\t\t\tconst m = byId.get(mappingId);\n\t\t\t\tif (!m) return <Text color=\"fg.muted\">{t(\"profiles.missingMapping\")}</Text>;\n\t\t\t\treturn (\n\t\t\t\t\t<HStack gap=\"2\">\n\t\t\t\t\t\t<Link asChild>\n\t\t\t\t\t\t\t<RouterLink to={hrefOf(m.id)}>{m.name}</RouterLink>\n\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t{m.valid ? null : <StatusBadge tone=\"danger\" label={t(\"validity.invalid\")} />}\n\t\t\t\t\t</HStack>\n\t\t\t\t);\n\t\t\t}}\n\t\t/>\n\t);\n}\n\nconst useFormContextTyped = () => useFormContext<ProfileValues>();\n","import { Button } from \"@knkcs/anker/atoms\";\nimport { DataTable, LinkCell, TruncatedTextCell } from \"@knkcs/anker/components\";\nimport { useHostIdentity } from \"@knkcs/anker/host\";\nimport { IndexPageTemplate } from \"@knkcs/anker/templates\";\nimport { useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport type { ColumnDef } from \"@tanstack/react-table\";\nimport { Plus } from \"lucide-react\";\nimport { useMemo, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport type { ImporthubClient, ImportProfile } from \"../../client/importhub-client\";\nimport { CreateDialog } from \"../../common/create-dialog\";\nimport { itemPath, useImporthubHost } from \"../../common/host\";\nimport { importhubKeys } from \"../../common/query-keys\";\nimport { LoadFailed } from \"../../common/query-state\";\nimport { useCanConfigure } from \"../../common/use-can-configure\";\nimport { releaseLabel, ValidityCell } from \"../../common/validity\";\nimport { IMPORTHUB_UI_NS } from \"../../i18n/resources\";\n\nexport interface ImportProfilesIndexProps {\n\tclient: ImporthubClient;\n\t/** Opens an Import Profile's page: the host navigates, after a create too. */\n\tonOpen: (id: string) => void;\n}\n\n// DataTable takes rows that are records.\ntype Row = ImportProfile & Record<string, unknown>;\n\n/**\n * Every Import Profile of the workspace, with its validity and its latest\n * Release (manage-import-profiles:AC1, AC6); an admin creates one from the\n * header (AC2).\n */\nexport function ImportProfilesIndex({ client, onOpen }: ImportProfilesIndexProps) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { workspaceId } = useHostIdentity();\n\tconst { paths } = useImporthubHost();\n\tconst canConfigure = useCanConfigure();\n\tconst queryClient = useQueryClient();\n\tconst [creating, setCreating] = useState(false);\n\tconst query = useQuery({\n\t\tqueryKey: importhubKeys.importProfiles(workspaceId),\n\t\tqueryFn: () => client.listImportProfiles(),\n\t});\n\tconst columns = useMemo<ColumnDef<Row, unknown>[]>(\n\t\t() => [\n\t\t\t{\n\t\t\t\tid: \"name\",\n\t\t\t\theader: t(\"fields.name\"),\n\t\t\t\tcell: (c) => (\n\t\t\t\t\t<LinkCell\n\t\t\t\t\t\tto={itemPath(paths, \"profiles\", c.row.original.id)}\n\t\t\t\t\t\tlabel={c.row.original.content.name}\n\t\t\t\t\t/>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"validity\",\n\t\t\t\theader: t(\"validity.column\"),\n\t\t\t\tcell: (c) => <ValidityCell validity={c.row.original.validity} />,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"release\",\n\t\t\t\theader: t(\"release.column\"),\n\t\t\t\tsize: 140,\n\t\t\t\tcell: (c) => <TruncatedTextCell value={releaseLabel(c.row.original.state, t)} />,\n\t\t\t},\n\t\t],\n\t\t[t, paths],\n\t);\n\treturn (\n\t\t<IndexPageTemplate\n\t\t\ttitle={t(\"section.profiles.title\")}\n\t\t\tactions={\n\t\t\t\tcanConfigure ? (\n\t\t\t\t\t<Button variant=\"solid\" onClick={() => setCreating(true)}>\n\t\t\t\t\t\t<Plus size={16} aria-hidden />\n\t\t\t\t\t\t{t(\"profiles.new\")}\n\t\t\t\t\t</Button>\n\t\t\t\t) : undefined\n\t\t\t}\n\t\t>\n\t\t\t{query.isError ? (\n\t\t\t\t<LoadFailed />\n\t\t\t) : (\n\t\t\t\t<DataTable\n\t\t\t\t\tcolumns={columns}\n\t\t\t\t\tdata={(query.data ?? []) as Row[]}\n\t\t\t\t\tloading={query.isPending}\n\t\t\t\t\tgetRowId={(p) => p.id}\n\t\t\t\t\temptyState={t(\"profiles.empty\")}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<CreateDialog\n\t\t\t\topen={creating}\n\t\t\t\tonClose={() => setCreating(false)}\n\t\t\t\ttitle={t(\"profiles.new\")}\n\t\t\t\tonCreate={async ({ name, description }) => {\n\t\t\t\t\tconst p = await client.createImportProfile({\n\t\t\t\t\t\tname,\n\t\t\t\t\t\tdescription,\n\t\t\t\t\t\tentitySetId: \"\",\n\t\t\t\t\t\tpreprocessors: [],\n\t\t\t\t\t\tmappingIds: [],\n\t\t\t\t\t\tpostProcessors: [],\n\t\t\t\t\t\tautoPublish: false,\n\t\t\t\t\t\tdeleteSourceFileOnSuccess: false,\n\t\t\t\t\t});\n\t\t\t\t\tawait queryClient.invalidateQueries({\n\t\t\t\t\t\tqueryKey: importhubKeys.importProfiles(workspaceId),\n\t\t\t\t\t});\n\t\t\t\t\treturn p.id;\n\t\t\t\t}}\n\t\t\t\tonCreated={(id) => {\n\t\t\t\t\tsetCreating(false);\n\t\t\t\t\tonOpen(id);\n\t\t\t\t}}\n\t\t\t/>\n\t\t</IndexPageTemplate>\n\t);\n}\n","import { Button, EmptyState } from \"@knkcs/anker/atoms\";\nimport { Card, UploadDropZone } from \"@knkcs/anker/components\";\nimport { BaseSelectField, DatePickerField, InputField } from \"@knkcs/anker/forms\";\nimport { useHostIdentity } from \"@knkcs/anker/host\";\nimport { Alert, Box, Grid, Progress, Stack, Text } from \"@knkcs/anker/primitives\";\nimport { DetailPageTemplate } from \"@knkcs/anker/templates\";\nimport { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport { Lock, Play } from \"lucide-react\";\nimport { useState } from \"react\";\nimport { FormProvider, useForm, useWatch } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport type { ImporthubClient, SourceFile } from \"../../client/importhub-client\";\nimport { useImporthubHost } from \"../../common/host\";\nimport { importhubKeys } from \"../../common/query-keys\";\nimport { LoadFailed, Loading } from \"../../common/query-state\";\nimport { useCanImport } from \"../../common/use-can-import\";\nimport { IMPORTHUB_UI_NS } from \"../../i18n/resources\";\n\nexport interface StartImportProps {\n\tclient: ImporthubClient;\n\t/** The Import is queued: the host opens its page. */\n\tonStarted: (importId: string) => void;\n}\n\ntype StartValues = {\n\timportProfileId: string;\n\teffectiveDate: string;\n\tsourceDate: string;\n\tsourceReference: string;\n};\n\nconst EMPTY: StartValues = {\n\timportProfileId: \"\",\n\teffectiveDate: \"\",\n\tsourceDate: \"\",\n\tsourceReference: \"\",\n};\n\n/** Where the one file stands: being sent, sent, or refused on the way. */\ntype Upload =\n\t| { state: \"uploading\"; name: string; fraction: number }\n\t| { state: \"uploaded\"; name: string; sourceFile: SourceFile }\n\t| { state: \"failed\"; name: string; message: string };\n\nconst isXml = (f: File) =>\n\t/\\.xml$/i.test(f.name) || f.type === \"text/xml\" || f.type === \"application/xml\";\n\n/**\n * The start flow (start-an-import:AC1–AC4): an importer picks one of the\n * workspace's Import Profiles that has a Release, since an Import never runs\n * a draft; uploads one XML file straight into importhub's storage, with its\n * progress; gives, if the file carries none, an effective date and a Source\n * (its date and reference, both or neither); reads what delegated access\n * Start grants; and starts with the header's one action. A Start importhub\n * refuses (a missing contenthub right, a configuration without a Release or\n * invalid now) is shown with importhub's reason. A viewer gets no Start.\n */\nexport function StartImport({ client, onStarted }: StartImportProps) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { workspaceId } = useHostIdentity();\n\tconst { paths } = useImporthubHost();\n\tconst canImport = useCanImport();\n\tconst queryClient = useQueryClient();\n\tconst profiles = useQuery({\n\t\tqueryKey: importhubKeys.importProfiles(workspaceId),\n\t\tqueryFn: () => client.listImportProfiles(),\n\t\tenabled: canImport,\n\t});\n\tconst form = useForm<StartValues>({ defaultValues: EMPTY });\n\tconst importProfileId = useWatch({ control: form.control, name: \"importProfileId\" });\n\tconst [upload, setUpload] = useState<Upload | null>(null);\n\n\tconst send = (files: File[]) => {\n\t\tconst [file] = files;\n\t\tif (!file) return;\n\t\tif (!isXml(file)) {\n\t\t\tsetUpload({\n\t\t\t\tstate: \"failed\",\n\t\t\t\tname: file.name,\n\t\t\t\tmessage: t(\"startImport.notXml\", { name: file.name }),\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tsetUpload({ state: \"uploading\", name: file.name, fraction: 0 });\n\t\tclient\n\t\t\t.uploadSourceFile(file, (fraction) =>\n\t\t\t\tsetUpload((u) =>\n\t\t\t\t\tu?.state === \"uploading\" && u.name === file.name ? { ...u, fraction } : u,\n\t\t\t\t),\n\t\t\t)\n\t\t\t.then(\n\t\t\t\t(sourceFile) => setUpload({ state: \"uploaded\", name: file.name, sourceFile }),\n\t\t\t\t(err: unknown) =>\n\t\t\t\t\tsetUpload({\n\t\t\t\t\t\tstate: \"failed\",\n\t\t\t\t\t\tname: file.name,\n\t\t\t\t\t\tmessage: t(\"startImport.uploadFailed\", {\n\t\t\t\t\t\t\tname: file.name,\n\t\t\t\t\t\t\tmessage: err instanceof Error ? err.message : String(err),\n\t\t\t\t\t\t}),\n\t\t\t\t\t}),\n\t\t\t);\n\t};\n\n\tconst start = useMutation({\n\t\tmutationFn: (v: StartValues & { sourceFileId: string }) =>\n\t\t\tclient.startImport({\n\t\t\t\timportProfileId: v.importProfileId,\n\t\t\t\tsourceFileId: v.sourceFileId,\n\t\t\t\teffectiveDate: v.effectiveDate,\n\t\t\t\t...(v.sourceDate\n\t\t\t\t\t? { source: { date: v.sourceDate, reference: v.sourceReference.trim() } }\n\t\t\t\t\t: {}),\n\t\t\t}),\n\t\tonSuccess: (im) => {\n\t\t\tvoid queryClient.invalidateQueries({ queryKey: importhubKeys.imports(workspaceId) });\n\t\t\tonStarted(im.id);\n\t\t},\n\t});\n\n\tconst onStart = form.handleSubmit((v) => {\n\t\tif (upload?.state !== \"uploaded\") return;\n\t\tif (!v.importProfileId) {\n\t\t\tform.setError(\"importProfileId\", { message: t(\"startImport.profileRequired\") });\n\t\t\treturn;\n\t\t}\n\t\t// A Source is its date and its reference, both or neither\n\t\t// (StartImportRequest.source).\n\t\tif (Boolean(v.sourceDate) !== Boolean(v.sourceReference.trim())) {\n\t\t\tform.setError(v.sourceDate ? \"sourceReference\" : \"sourceDate\", {\n\t\t\t\tmessage: t(\"startImport.sourceIncomplete\"),\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tstart.mutate({ ...v, sourceFileId: upload.sourceFile.id });\n\t});\n\n\tconst ready = importProfileId !== \"\" && upload?.state === \"uploaded\";\n\tconst frame = {\n\t\ttitle: t(\"startImport.title\"),\n\t\tbreadcrumbs: [{ label: t(\"section.imports.title\"), to: paths.imports }],\n\t};\n\n\tif (!canImport) {\n\t\treturn (\n\t\t\t<DetailPageTemplate {...frame}>\n\t\t\t\t<Box px=\"8\" py=\"6\">\n\t\t\t\t\t<EmptyState icon={<Lock size={32} aria-hidden />} header={t(\"startImport.notAllowed\")} />\n\t\t\t\t</Box>\n\t\t\t</DetailPageTemplate>\n\t\t);\n\t}\n\tif (profiles.isError || !profiles.data) {\n\t\treturn (\n\t\t\t<DetailPageTemplate {...frame}>\n\t\t\t\t{profiles.isError ? <LoadFailed /> : <Loading />}\n\t\t\t</DetailPageTemplate>\n\t\t);\n\t}\n\t// An Import runs the latest Release, never a draft (ADR 0016): a Profile\n\t// without one cannot be started, so it is not offered.\n\tconst released = profiles.data.filter((p) => p.state.latestRelease);\n\n\treturn (\n\t\t<DetailPageTemplate\n\t\t\t{...frame}\n\t\t\tactions={\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"solid\"\n\t\t\t\t\tdisabled={!ready}\n\t\t\t\t\tloading={start.isPending}\n\t\t\t\t\tonClick={() => void onStart()}\n\t\t\t\t>\n\t\t\t\t\t<Play size={16} aria-hidden />\n\t\t\t\t\t{t(\"imports.start\")}\n\t\t\t\t</Button>\n\t\t\t}\n\t\t>\n\t\t\t<Box px=\"8\" py=\"6\">\n\t\t\t\t<FormProvider {...form}>\n\t\t\t\t\t<Stack gap=\"6\">\n\t\t\t\t\t\t{start.isError ? (\n\t\t\t\t\t\t\t<Alert status=\"error\" colorPalette=\"danger\" title={t(\"startImport.refused\")}>\n\t\t\t\t\t\t\t\t{start.error.message}\n\t\t\t\t\t\t\t</Alert>\n\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t<Card title={t(\"startImport.fileCard\")}>\n\t\t\t\t\t\t\t<Stack gap=\"4\">\n\t\t\t\t\t\t\t\t{released.length === 0 ? (\n\t\t\t\t\t\t\t\t\t<Alert status=\"info\" colorPalette=\"info\" title={t(\"startImport.noProfiles\")} />\n\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t<BaseSelectField<StartValues>\n\t\t\t\t\t\t\t\t\tname=\"importProfileId\"\n\t\t\t\t\t\t\t\t\tlabel={t(\"startImport.profile\")}\n\t\t\t\t\t\t\t\t\thelperText={t(\"startImport.profileHelp\")}\n\t\t\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\t\t\toptions={released.map((p) => ({\n\t\t\t\t\t\t\t\t\t\tid: p.id,\n\t\t\t\t\t\t\t\t\t\tlabel: t(\"startImport.profileOption\", {\n\t\t\t\t\t\t\t\t\t\t\tname: p.content.name,\n\t\t\t\t\t\t\t\t\t\t\tnumber: p.state.latestRelease?.number,\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t}))}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<Stack gap=\"2\">\n\t\t\t\t\t\t\t\t\t<Text fontWeight=\"medium\">{t(\"startImport.file\")}</Text>\n\t\t\t\t\t\t\t\t\t<Text color=\"muted\" fontSize=\"sm\">\n\t\t\t\t\t\t\t\t\t\t{t(\"startImport.fileHelp\")}\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t<UploadDropZone\n\t\t\t\t\t\t\t\t\t\tonFiles={send}\n\t\t\t\t\t\t\t\t\t\taccept=\".xml,text/xml,application/xml\"\n\t\t\t\t\t\t\t\t\t\tdisabled={upload?.state === \"uploading\" || start.isPending}\n\t\t\t\t\t\t\t\t\t\tdropHintText={t(\"startImport.dropHint\")}\n\t\t\t\t\t\t\t\t\t\tdragActiveText={t(\"startImport.dragActive\")}\n\t\t\t\t\t\t\t\t\t\tbuttonLabel={t(\"startImport.chooseFile\")}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<UploadState upload={upload} />\n\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t</Card>\n\t\t\t\t\t\t<Card title={t(\"startImport.datesCard\")}>\n\t\t\t\t\t\t\t<Stack gap=\"4\">\n\t\t\t\t\t\t\t\t<Text color=\"muted\" fontSize=\"sm\">\n\t\t\t\t\t\t\t\t\t{t(\"startImport.datesHelp\")}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t<DatePickerField<StartValues>\n\t\t\t\t\t\t\t\t\tname=\"effectiveDate\"\n\t\t\t\t\t\t\t\t\tlabel={t(\"startImport.effectiveDate\")}\n\t\t\t\t\t\t\t\t\thelperText={t(\"startImport.effectiveDateHelp\")}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<Grid templateColumns={{ base: \"1fr\", md: \"1fr 2fr\" }} gap=\"4\">\n\t\t\t\t\t\t\t\t\t<DatePickerField<StartValues>\n\t\t\t\t\t\t\t\t\t\tname=\"sourceDate\"\n\t\t\t\t\t\t\t\t\t\tlabel={t(\"startImport.sourceDate\")}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<InputField<StartValues>\n\t\t\t\t\t\t\t\t\t\tname=\"sourceReference\"\n\t\t\t\t\t\t\t\t\t\tlabel={t(\"startImport.sourceReference\")}\n\t\t\t\t\t\t\t\t\t\thelperText={t(\"startImport.sourceReferenceHelp\")}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</Grid>\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t</Card>\n\t\t\t\t\t\t<Alert status=\"info\" colorPalette=\"info\" title={t(\"startImport.consentTitle\")}>\n\t\t\t\t\t\t\t{t(\"startImport.consent\")}\n\t\t\t\t\t\t</Alert>\n\t\t\t\t\t</Stack>\n\t\t\t\t</FormProvider>\n\t\t\t</Box>\n\t\t</DetailPageTemplate>\n\t);\n}\n\n/** The file's upload: its progress while it goes, then that it arrived or why not. */\nfunction UploadState({ upload }: { upload: Upload | null }) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tif (!upload) return null;\n\tswitch (upload.state) {\n\t\tcase \"uploading\":\n\t\t\treturn (\n\t\t\t\t<Progress\n\t\t\t\t\tlabel={t(\"startImport.uploading\", { name: upload.name })}\n\t\t\t\t\tvalue={Math.round(upload.fraction * 100)}\n\t\t\t\t\tshowValue\n\t\t\t\t/>\n\t\t\t);\n\t\tcase \"uploaded\":\n\t\t\treturn (\n\t\t\t\t<Alert\n\t\t\t\t\tstatus=\"success\"\n\t\t\t\t\tcolorPalette=\"success\"\n\t\t\t\t\ttitle={t(\"startImport.uploaded\", { name: upload.name })}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase \"failed\":\n\t\t\treturn <Alert status=\"error\" colorPalette=\"danger\" title={upload.message} />;\n\t}\n}\n"],"names":["file_importhub_v1_api_key","fileDesc","file_google_protobuf_timestamp","APIKeyService","serviceDesc","file_importhub_v1_configuration","ValiditySchema","messageDesc","ConfigurationInUseSchema","FieldComparisonStatus","file_importhub_v1_entity_set","EntitySetContentSchema","EntitySetService","file_importhub_v1_import","ImportPhase","ImportOutcome","ImportService","file_importhub_v1_import_profile","file_google_protobuf_struct","ImportProfileContentSchema","ProcessorStepSchema","ImportProfileService","file_importhub_v1_mapping","MappingContentSchema","MappingService","file_importhub_v1_processor","ProcessorKind","ProcessorTarget","ProcessorService","putToBlobStore","url","file","onProgress","resolve","reject","xhr","e","validityOf","v","r","stateOf","s","stepOf","stepPb","profileOf","p","c","profileContentPb","create","mappingOf","m","content","toJson","mappingContentPb","fromJson","entitySetOf","isoOf","t","timestampDate","releaseOf","revisionOf","historyOf","res","STATUS","FieldComparisonStatusPb","versionOf","asJson","JSON_OPTS","comparisonOf","f","PHASES","ImportPhasePb","OUTCOMES","ImportOutcomePb","releaseRefOf","importOf","i","outcome","apiKeyOf","k","startCall","run","err","ConnectError","Code","StartRefusedError","translate","inUse","ConfigurationInUseError","NameTakenError","cutCall","validity","ReleaseRefusedError","call","createConnectImporthubClient","options","transport","createConnectTransport","profiles","createClient","processors","mappings","entitySets","imports","apiKeys","putFile","id","requireMessage","draftRevisionId","blueprintReleaseId","kind","req","pageToken","fromRevisionId","toRevisionId","revisionId","sf","input","importId","filter","timestampFromDate","ChangeSetLink","changeSetId","useTranslation","IMPORTHUB_UI_NS","href","useImporthubHost","Link","jsx","ExternalLink","IMPORTHUB_SECTION_ICONS","FileUp","FileCog","Waypoints","Ampersand","Blocks","ImporthubStartPage","client","section","Icon","IndexPageTemplate","Box","EmptyState","SectionSummary","CountSummary","importhubKeys","NothingYet","Fragment","queryKey","read","workspaceId","useHostIdentity","query","useQuery","Spinner","statusOf","im","TONES","labelOf","status","DEFAULT_POLL_INTERVAL_MS","isRunning","ImportStatusBadge","StatusBadge","ImportStatusCell","StatusBadgeCell","usePersonName","members","useCallback","userId","useCanImport","EMPTY","today","d","pad","n","expiryOf","expiresOn","CreateApiKeyDialog","open","onClose","queryClient","useQueryClient","form","useForm","useMutation","values","reset","resetCreate","useEffect","close","submit","name","API_KEY_NAME_MAX","secret","Modal","Button","jsxs","HStack","Stack","Alert","ClipboardInput","FormProvider","InputField","DatePickerField","RevokeApiKeyDialog","apiKey","revoke","Text","ApiKeysIndex","canImport","personName","creating","setCreating","useState","revoking","setRevoking","revokeOpen","setRevokeOpen","columns","useMemo","TruncatedTextCell","CodeCell","IdentityCell","DateCell","ActionCell","Trash2","Plus","LoadFailed","DataTable","KeyRound","valuesOf","a","b","text","contentOf","EntitySetDetail","onDeleted","DetailPageTemplate","Loading","EntitySetPage","entitySet","paths","canConfigure","useCanConfigure","deleting","setDeleting","formState","control","rows","useFieldArray","save","saved","onSave","tab","tabs","useConfigurationTab","releasing","useConfigurationRelease","usePageRail","ContextRail","ReleaseStateBadge","ConfigurationHistory","fresh","ValidityAlert","Card","TextareaField","row","index","Grid","IconButton","DeleteDialog","CreateDialog","title","children","defaultValues","onCreate","onCreated","EntitySetsIndex","onOpen","LinkCell","itemPath","CountCell","ValidityCell","releaseLabel","description","ItemProblemsTable","mappingId","setMappingId","sourceKeyQuery","setSourceKeyQuery","useInfiniteQuery","pageParam","last","previous","problems","seen","useRef","refetch","first","SlugCell","total","Toolbar","SearchInput","NativeSelect","Center","ImportDetail","pollIntervalMs","q","ImportPage","i18n","lng","cancelling","setCancelling","cancellable","CircleStop","cancel","now","formatTime","OutcomeAlert","ProgressCard","DescriptionList","ReleasesCard","iso","done","known","Progress","importProfile","ReleaseLink","List","release","RouterLink","ImportsIndex","onStart","NumberCell","Play","MappingDetail","MappingScreen","BlueprintFields","blueprints","BlueprintSelects","setValue","useFormContext","blueprintId","useWatch","list","releases","BaseSelectField","CREATE_DEFAULTS","MappingsIndex","names","useBlueprintNames","ProcessorCatalogue","moved","from","to","next","item","OrderedList","items","renderItem","nameOf","editable","onChange","emptyLabel","addLabel","addOptions","onAdd","ArrowUp","ArrowDown","_","MenuRoot","MenuTrigger","MenuContent","o","MenuItem","NO_SETTINGS","ProcessorSettingsDialog","processor","settings","readOnly","onApply","spec","resolver","zodResolver","specToZodSchema","builtInFieldTypes","apply","FieldKitProvider","SpecForm","ImportProfileDetail","ProfilePage","profile","SwitchField","StepsField","MappingsField","catalogue","useFormContextTyped","steps","setOpen","set","processorOf","step","openStep","offered","count","Settings2","hrefOf","ids","byId","ImportProfilesIndex","isXml","StartImport","onStarted","importProfileId","upload","setUpload","send","files","fraction","u","sourceFile","start","ready","frame","Lock","released","UploadDropZone","UploadState"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAaO,MAAMA,KACX,gBAAAC,EAAS,ooCAAooC,CAACC,EAA8B,CAAC,GA8LlqCC,KAsCX,gBAAAC,GAAYJ,IAA2B,CAAC,GCrO7BK,KACX,gBAAAJ,EAAS,+jDAA+jD,CAACC,EAA8B,CAAC,GA+B7lDI,KACX,gBAAAC,GAAYF,IAAiC,CAAC,GAwQnCG,KACX,gBAAAD,GAAYF,IAAiC,CAAC;AAQzC,IAAKI,uBAAAA,OAIVA,EAAAA,EAAA,cAAc,CAAA,IAAd,eAOAA,EAAAA,EAAA,YAAY,CAAA,IAAZ,aAOAA,EAAAA,EAAA,QAAQ,CAAA,IAAR,SAOAA,EAAAA,EAAA,UAAU,CAAA,IAAV,WAOAA,EAAAA,EAAA,UAAU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A;AAAA,MAAA;AAAA,IAGzD,KAAK;AACJ,aAAO,gBAAA/R,EAACwE,KAAM,QAAO,SAAQ,cAAa,UAAS,OAAOuN,EAAO,SAAS;AAAA,EAAA;AAE7E;"}
1
+ {"version":3,"file":"index.js","sources":["../../../gen/ts/importhub/v1/api_key_pb.ts","../../../gen/ts/importhub/v1/configuration_pb.ts","../../../gen/ts/importhub/v1/entity_set_pb.ts","../../../gen/ts/importhub/v1/import_pb.ts","../../../gen/ts/importhub/v1/import_profile_pb.ts","../../../gen/ts/importhub/v1/mapping_pb.ts","../../../gen/ts/importhub/v1/processor_pb.ts","../src/client/connect-importhub-client.ts","../src/common/change-set-link.tsx","../src/common/start-page.tsx","../src/common/import-status.tsx","../src/common/use-can-import.ts","../src/screens/api-keys/create-api-key-dialog.tsx","../src/screens/api-keys/revoke-api-key-dialog.tsx","../src/screens/api-keys/api-keys-index.tsx","../src/screens/entity-sets/entity-set-detail.tsx","../src/common/create-dialog.tsx","../src/screens/entity-sets/entity-sets-index.tsx","../src/screens/imports/item-problems-table.tsx","../src/screens/imports/import-detail.tsx","../src/screens/imports/imports-index.tsx","../src/screens/mappings/mapping-detail.tsx","../src/screens/mappings/blueprint-fields.tsx","../src/screens/mappings/mappings-index.tsx","../src/screens/processors/processor-catalogue.tsx","../src/screens/profiles/ordered-list.tsx","../src/screens/profiles/processor-settings-dialog.tsx","../src/screens/profiles/import-profile-detail.tsx","../src/screens/profiles/import-profiles-index.tsx","../src/screens/start-import/start-import.tsx"],"sourcesContent":["// @generated by protoc-gen-es v2.13.0 with parameter \"target=ts\"\n// @generated from file importhub/v1/api_key.proto (package importhub.v1, syntax proto3)\n/* eslint-disable */\n\nimport type { GenFile, GenMessage, GenService } from \"@bufbuild/protobuf/codegenv2\";\nimport { fileDesc, messageDesc, serviceDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport type { Timestamp } from \"@bufbuild/protobuf/wkt\";\nimport { file_google_protobuf_timestamp } from \"@bufbuild/protobuf/wkt\";\nimport type { Message } from \"@bufbuild/protobuf\";\n\n/**\n * Describes the file importhub/v1/api_key.proto.\n */\nexport const file_importhub_v1_api_key: GenFile = /*@__PURE__*/\n fileDesc(\"ChppbXBvcnRodWIvdjEvYXBpX2tleS5wcm90bxIMaW1wb3J0aHViLnYxIlQKE0NyZWF0ZUFQSUtleVJlcXVlc3QSDAoEbmFtZRgBIAEoCRIvCgtleHBpcmVfdGltZRgCIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXAiTQoUQ3JlYXRlQVBJS2V5UmVzcG9uc2USJQoHYXBpX2tleRgBIAEoCzIULmltcG9ydGh1Yi52MS5BUElLZXkSDgoGc2VjcmV0GAIgASgJIhQKEkxpc3RBUElLZXlzUmVxdWVzdCI9ChNMaXN0QVBJS2V5c1Jlc3BvbnNlEiYKCGFwaV9rZXlzGAEgAygLMhQuaW1wb3J0aHViLnYxLkFQSUtleSIhChNSZXZva2VBUElLZXlSZXF1ZXN0EgoKAmlkGAEgASgJIhYKFFJldm9rZUFQSUtleVJlc3BvbnNlIqcBCgZBUElLZXkSCgoCaWQYASABKAkSDAoEbmFtZRgCIAEoCRISCgprZXlfcHJlZml4GAMgASgJEg0KBW93bmVyGAQgASgJEi8KC2V4cGlyZV90aW1lGAUgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcBIvCgtjcmVhdGVfdGltZRgGIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXAykQIKDUFQSUtleVNlcnZpY2USVQoMQ3JlYXRlQVBJS2V5EiEuaW1wb3J0aHViLnYxLkNyZWF0ZUFQSUtleVJlcXVlc3QaIi5pbXBvcnRodWIudjEuQ3JlYXRlQVBJS2V5UmVzcG9uc2USUgoLTGlzdEFQSUtleXMSIC5pbXBvcnRodWIudjEuTGlzdEFQSUtleXNSZXF1ZXN0GiEuaW1wb3J0aHViLnYxLkxpc3RBUElLZXlzUmVzcG9uc2USVQoMUmV2b2tlQVBJS2V5EiEuaW1wb3J0aHViLnYxLlJldm9rZUFQSUtleVJlcXVlc3QaIi5pbXBvcnRodWIudjEuUmV2b2tlQVBJS2V5UmVzcG9uc2VCOVo3Z2l0aHViLmNvbS9rbmtjcy9pbXBvcnRodWIvZ2VuL2ltcG9ydGh1Yi92MTtpbXBvcnRodWJ2MWIGcHJvdG8z\", [file_google_protobuf_timestamp]);\n\n/**\n * @generated from message importhub.v1.CreateAPIKeyRequest\n */\nexport type CreateAPIKeyRequest = Message<\"importhub.v1.CreateAPIKeyRequest\"> & {\n /**\n * What the key is for, as people read it (\"Nightly gesetz feed\"): not\n * blank, at most 100 characters.\n *\n * @generated from field: string name = 1;\n */\n name: string;\n\n /**\n * When the key stops working; unset for never. Its Delegation Grant ends\n * with it. It must lie in the future.\n *\n * @generated from field: google.protobuf.Timestamp expire_time = 2;\n */\n expireTime?: Timestamp | undefined;\n};\n\n/**\n * Describes the message importhub.v1.CreateAPIKeyRequest.\n * Use `create(CreateAPIKeyRequestSchema)` to create a new message.\n */\nexport const CreateAPIKeyRequestSchema: GenMessage<CreateAPIKeyRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_api_key, 0);\n\n/**\n * @generated from message importhub.v1.CreateAPIKeyResponse\n */\nexport type CreateAPIKeyResponse = Message<\"importhub.v1.CreateAPIKeyResponse\"> & {\n /**\n * @generated from field: importhub.v1.APIKey api_key = 1;\n */\n apiKey?: APIKey | undefined;\n\n /**\n * The key's secret, to send as `Authorization: Bearer <secret>`. Shown\n * this once: keep it now.\n *\n * @generated from field: string secret = 2;\n */\n secret: string;\n};\n\n/**\n * Describes the message importhub.v1.CreateAPIKeyResponse.\n * Use `create(CreateAPIKeyResponseSchema)` to create a new message.\n */\nexport const CreateAPIKeyResponseSchema: GenMessage<CreateAPIKeyResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_api_key, 1);\n\n/**\n * @generated from message importhub.v1.ListAPIKeysRequest\n */\nexport type ListAPIKeysRequest = Message<\"importhub.v1.ListAPIKeysRequest\"> & {\n};\n\n/**\n * Describes the message importhub.v1.ListAPIKeysRequest.\n * Use `create(ListAPIKeysRequestSchema)` to create a new message.\n */\nexport const ListAPIKeysRequestSchema: GenMessage<ListAPIKeysRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_api_key, 2);\n\n/**\n * @generated from message importhub.v1.ListAPIKeysResponse\n */\nexport type ListAPIKeysResponse = Message<\"importhub.v1.ListAPIKeysResponse\"> & {\n /**\n * @generated from field: repeated importhub.v1.APIKey api_keys = 1;\n */\n apiKeys: APIKey[];\n};\n\n/**\n * Describes the message importhub.v1.ListAPIKeysResponse.\n * Use `create(ListAPIKeysResponseSchema)` to create a new message.\n */\nexport const ListAPIKeysResponseSchema: GenMessage<ListAPIKeysResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_api_key, 3);\n\n/**\n * @generated from message importhub.v1.RevokeAPIKeyRequest\n */\nexport type RevokeAPIKeyRequest = Message<\"importhub.v1.RevokeAPIKeyRequest\"> & {\n /**\n * The key's id, as APIKey.id gives it.\n *\n * @generated from field: string id = 1;\n */\n id: string;\n};\n\n/**\n * Describes the message importhub.v1.RevokeAPIKeyRequest.\n * Use `create(RevokeAPIKeyRequestSchema)` to create a new message.\n */\nexport const RevokeAPIKeyRequestSchema: GenMessage<RevokeAPIKeyRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_api_key, 4);\n\n/**\n * @generated from message importhub.v1.RevokeAPIKeyResponse\n */\nexport type RevokeAPIKeyResponse = Message<\"importhub.v1.RevokeAPIKeyResponse\"> & {\n};\n\n/**\n * Describes the message importhub.v1.RevokeAPIKeyResponse.\n * Use `create(RevokeAPIKeyResponseSchema)` to create a new message.\n */\nexport const RevokeAPIKeyResponseSchema: GenMessage<RevokeAPIKeyResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_api_key, 5);\n\n/**\n * APIKey is an importhub API key of the workspace, never its secret.\n *\n * @generated from message importhub.v1.APIKey\n */\nexport type APIKey = Message<\"importhub.v1.APIKey\"> & {\n /**\n * odon's id of the key.\n *\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * @generated from field: string name = 2;\n */\n name: string;\n\n /**\n * The secret's first characters, as odon shows them, for telling keys\n * apart.\n *\n * @generated from field: string key_prefix = 3;\n */\n keyPrefix: string;\n\n /**\n * The odon user id of the key's owner, who created it: the key acts as\n * them, and Imports started with it name them as their starter.\n *\n * @generated from field: string owner = 4;\n */\n owner: string;\n\n /**\n * When it stops working; unset for never.\n *\n * @generated from field: google.protobuf.Timestamp expire_time = 5;\n */\n expireTime?: Timestamp | undefined;\n\n /**\n * @generated from field: google.protobuf.Timestamp create_time = 6;\n */\n createTime?: Timestamp | undefined;\n};\n\n/**\n * Describes the message importhub.v1.APIKey.\n * Use `create(APIKeySchema)` to create a new message.\n */\nexport const APIKeySchema: GenMessage<APIKey> = /*@__PURE__*/\n messageDesc(file_importhub_v1_api_key, 6);\n\n/**\n * APIKeyService creates, lists and revokes the workspace's importhub API keys:\n * odon API keys with scope `importhub:workspace:<W>`, with which an unattended\n * caller (a nightly feed, a pipeline) starts and follows Imports as the key's\n * owner (ADR 0006, amended; import-with-an-api-key).\n *\n * importhub creates each key itself, from the person's own token: the key in\n * odon, and a standing Delegation Grant `apikey:<key id>` that ends with the\n * key, on which every Import started with the key runs. A key created directly\n * in odon has no such Grant and is refused, naming that keys are created\n * through importhub.\n *\n * Every RPC acts on the caller's workspace, which comes from the token's active\n * workspace and never from a request field, and needs `importer` (ADR 0010).\n * Each needs a person's own sign-in: a call made with an API key cannot create,\n * list or revoke keys.\n *\n * @generated from service importhub.v1.APIKeyService\n */\nexport const APIKeyService: GenService<{\n /**\n * CreateAPIKey creates an API key for the caller in their workspace and\n * returns its secret, once: importhub never stores it, and no later call\n * returns it again (import-with-an-api-key:AC5).\n *\n * @generated from rpc importhub.v1.APIKeyService.CreateAPIKey\n */\n createAPIKey: {\n methodKind: \"unary\";\n input: typeof CreateAPIKeyRequestSchema;\n output: typeof CreateAPIKeyResponseSchema;\n },\n /**\n * ListAPIKeys returns the workspace's API keys, every importer's, newest\n * first, without their secrets.\n *\n * @generated from rpc importhub.v1.APIKeyService.ListAPIKeys\n */\n listAPIKeys: {\n methodKind: \"unary\";\n input: typeof ListAPIKeysRequestSchema;\n output: typeof ListAPIKeysResponseSchema;\n },\n /**\n * RevokeAPIKey revokes an API key of the workspace: in odon, and by\n * releasing its Delegation Grant, so the key stops working at once and an\n * Import running with it ends Failed naming the revocation\n * (import-with-an-api-key:AC4, AC7). An unknown key is NotFound.\n *\n * @generated from rpc importhub.v1.APIKeyService.RevokeAPIKey\n */\n revokeAPIKey: {\n methodKind: \"unary\";\n input: typeof RevokeAPIKeyRequestSchema;\n output: typeof RevokeAPIKeyResponseSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_importhub_v1_api_key, 0);\n\n","// @generated by protoc-gen-es v2.13.0 with parameter \"target=ts\"\n// @generated from file importhub/v1/configuration.proto (package importhub.v1, syntax proto3)\n/* eslint-disable */\n\nimport type { GenEnum, GenFile, GenMessage } from \"@bufbuild/protobuf/codegenv2\";\nimport { enumDesc, fileDesc, messageDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport type { Timestamp } from \"@bufbuild/protobuf/wkt\";\nimport { file_google_protobuf_timestamp } from \"@bufbuild/protobuf/wkt\";\nimport type { Message } from \"@bufbuild/protobuf\";\n\n/**\n * Describes the file importhub/v1/configuration.proto.\n */\nexport const file_importhub_v1_configuration: GenFile = /*@__PURE__*/\n fileDesc(\"CiBpbXBvcnRodWIvdjEvY29uZmlndXJhdGlvbi5wcm90bxIMaW1wb3J0aHViLnYxIkgKCFZhbGlkaXR5Eg0KBXZhbGlkGAEgASgIEi0KB3JlYXNvbnMYAiADKAsyHC5pbXBvcnRodWIudjEuVmFsaWRpdHlSZWFzb24iPQoOVmFsaWRpdHlSZWFzb24SDAoEcGF0aBgBIAEoCRIMCgRjb2RlGAIgASgJEg8KB21lc3NhZ2UYAyABKAkisAEKFUNvbm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VBBUklTT05fU1RBVFVTX1VOQ0hBTkdFRBABEiEKHUZJRUxEX0NPTVBBUklTT05fU1RBVFVTX0FEREVEEAISIwofRklFTERfQ09NUEFSSVNPTl9TVEFUVVNfUkVNT1ZFRBADEiMKH0ZJRUxEX0NPTVBBUklTT05fU1RBVFVTX0NIQU5HRUQQBEI5WjdnaXRodWIuY29tL2tua2NzL2ltcG9ydGh1Yi9nZW4vaW1wb3J0aHViL3YxO2ltcG9ydGh1YnYxYgZwcm90bzM\", [file_google_protobuf_timestamp]);\n\n/**\n * Validity says whether a Revision may be released, and if not, why. It is\n * decided when the Revision is saved, and decided again when a Release is\n * cut from it, so a Release never holds a Revision that is invalid by the\n * rules in force when it was cut.\n *\n * @generated from message importhub.v1.Validity\n */\nexport type Validity = Message<\"importhub.v1.Validity\"> & {\n /**\n * True when no reason was found.\n *\n * @generated from field: bool valid = 1;\n */\n valid: boolean;\n\n /**\n * Why the Revision is invalid; empty when it is valid. In a stable order:\n * the same data gives the same reasons in the same order.\n *\n * @generated from field: repeated importhub.v1.ValidityReason reasons = 2;\n */\n reasons: ValidityReason[];\n};\n\n/**\n * Describes the message importhub.v1.Validity.\n * Use `create(ValiditySchema)` to create a new message.\n */\nexport const ValiditySchema: GenMessage<Validity> = /*@__PURE__*/\n messageDesc(file_importhub_v1_configuration, 0);\n\n/**\n * ValidityReason is one thing that makes a Revision invalid.\n *\n * @generated from message importhub.v1.ValidityReason\n */\nexport type ValidityReason = Message<\"importhub.v1.ValidityReason\"> & {\n /**\n * Where in the configuration, as a JSON Pointer into its content (for\n * example `/entities/nbsp`); empty when it concerns the whole.\n *\n * @generated from field: string path = 1;\n */\n path: string;\n\n /**\n * A stable, machine-readable code, such as `no_entities`; the type's\n * service documents its codes.\n *\n * @generated from field: string code = 2;\n */\n code: string;\n\n /**\n * What is wrong, in English, for a person.\n *\n * @generated from field: string message = 3;\n */\n message: string;\n};\n\n/**\n * Describes the message importhub.v1.ValidityReason.\n * Use `create(ValidityReasonSchema)` to create a new message.\n */\nexport const ValidityReasonSchema: GenMessage<ValidityReason> = /*@__PURE__*/\n messageDesc(file_importhub_v1_configuration, 1);\n\n/**\n * ConfigurationRevision is one saved Revision of a configuration, as its\n * history lists it.\n *\n * @generated from message importhub.v1.ConfigurationRevision\n */\nexport type ConfigurationRevision = Message<\"importhub.v1.ConfigurationRevision\"> & {\n /**\n * The Revision's id.\n *\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * The odon user id of the person who saved it.\n *\n * @generated from field: string saved_by = 2;\n */\n savedBy: string;\n\n /**\n * When it was saved.\n *\n * @generated from field: google.protobuf.Timestamp saved_at = 3;\n */\n savedAt?: Timestamp | undefined;\n\n /**\n * Whether it could be released, as decided when it was saved.\n *\n * @generated from field: importhub.v1.Validity validity = 4;\n */\n validity?: Validity | undefined;\n\n /**\n * The Revision it restored, when it was saved by a restore; empty for an\n * ordinary save.\n *\n * @generated from field: string restored_from_revision_id = 5;\n */\n restoredFromRevisionId: string;\n};\n\n/**\n * Describes the message importhub.v1.ConfigurationRevision.\n * Use `create(ConfigurationRevisionSchema)` to create a new message.\n */\nexport const ConfigurationRevisionSchema: GenMessage<ConfigurationRevision> = /*@__PURE__*/\n messageDesc(file_importhub_v1_configuration, 2);\n\n/**\n * ConfigurationRelease is one Configuration Release: a Revision an admin\n * declared ready to run. A real Import runs only on Releases (ADR 0016).\n * A Release never changes.\n *\n * @generated from message importhub.v1.ConfigurationRelease\n */\nexport type ConfigurationRelease = Message<\"importhub.v1.ConfigurationRelease\"> & {\n /**\n * The Release's id.\n *\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * The Revision it pins.\n *\n * @generated from field: string revision_id = 2;\n */\n revisionId: string;\n\n /**\n * Its place among the configuration's Releases: 1 for the first, counting\n * up, so a person can say \"Release 3\".\n *\n * @generated from field: int32 number = 3;\n */\n number: number;\n\n /**\n * The odon user id of the admin who cut it.\n *\n * @generated from field: string released_by = 4;\n */\n releasedBy: string;\n\n /**\n * When it was cut.\n *\n * @generated from field: google.protobuf.Timestamp released_at = 5;\n */\n releasedAt?: Timestamp | undefined;\n};\n\n/**\n * Describes the message importhub.v1.ConfigurationRelease.\n * Use `create(ConfigurationReleaseSchema)` to create a new message.\n */\nexport const ConfigurationReleaseSchema: GenMessage<ConfigurationRelease> = /*@__PURE__*/\n messageDesc(file_importhub_v1_configuration, 3);\n\n/**\n * ConfigurationState is where a configuration stands: its draft, and how the\n * draft compares with the latest Release (release-a-configuration:AC1).\n *\n * @generated from message importhub.v1.ConfigurationState\n */\nexport type ConfigurationState = Message<\"importhub.v1.ConfigurationState\"> & {\n /**\n * The draft: the head Revision, the one the next save builds on and a\n * Release would be cut from.\n *\n * @generated from field: string draft_revision_id = 1;\n */\n draftRevisionId: string;\n\n /**\n * Whether the draft may be released, as decided when it was saved.\n *\n * @generated from field: importhub.v1.Validity draft_validity = 2;\n */\n draftValidity?: Validity | undefined;\n\n /**\n * The latest Release; unset while the configuration has none.\n *\n * @generated from field: importhub.v1.ConfigurationRelease latest_release = 3;\n */\n latestRelease?: ConfigurationRelease | undefined;\n\n /**\n * True when the draft's content differs from the latest Release's, and\n * always true while there is no Release. A draft that restored the latest\n * Release's content does not differ, even though it is another Revision.\n *\n * @generated from field: bool draft_differs_from_release = 4;\n */\n draftDiffersFromRelease: boolean;\n};\n\n/**\n * Describes the message importhub.v1.ConfigurationState.\n * Use `create(ConfigurationStateSchema)` to create a new message.\n */\nexport const ConfigurationStateSchema: GenMessage<ConfigurationState> = /*@__PURE__*/\n messageDesc(file_importhub_v1_configuration, 4);\n\n/**\n * FieldComparison is how one top-level field of a configuration differs\n * between two of its Revisions.\n *\n * @generated from message importhub.v1.FieldComparison\n */\nexport type FieldComparison = Message<\"importhub.v1.FieldComparison\"> & {\n /**\n * The field's key in the content, such as `entities`.\n *\n * @generated from field: string field = 1;\n */\n field: string;\n\n /**\n * @generated from field: importhub.v1.FieldComparisonStatus status = 2;\n */\n status: FieldComparisonStatus;\n};\n\n/**\n * Describes the message importhub.v1.FieldComparison.\n * Use `create(FieldComparisonSchema)` to create a new message.\n */\nexport const FieldComparisonSchema: GenMessage<FieldComparison> = /*@__PURE__*/\n messageDesc(file_importhub_v1_configuration, 5);\n\n/**\n * ImportProfileRef names one Import Profile: where another configuration is\n * used (manage-mappings:AC3, release-a-configuration:AC4) or why it may not be\n * deleted (manage-mappings:AC4, manage-entity-sets:AC3).\n *\n * @generated from message importhub.v1.ImportProfileRef\n */\nexport type ImportProfileRef = Message<\"importhub.v1.ImportProfileRef\"> & {\n /**\n * The Import Profile's id.\n *\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * Its name, as its draft has it.\n *\n * @generated from field: string name = 2;\n */\n name: string;\n};\n\n/**\n * Describes the message importhub.v1.ImportProfileRef.\n * Use `create(ImportProfileRefSchema)` to create a new message.\n */\nexport const ImportProfileRefSchema: GenMessage<ImportProfileRef> = /*@__PURE__*/\n messageDesc(file_importhub_v1_configuration, 6);\n\n/**\n * ConfigurationInUse is the detail of a FailedPrecondition delete of a\n * Mapping that Import Profiles include, or of an Entity Set they name: the\n * Profiles, by name. A Profile counts when its draft or its latest Release\n * includes or names it, since either may still run or be released.\n *\n * @generated from message importhub.v1.ConfigurationInUse\n */\nexport type ConfigurationInUse = Message<\"importhub.v1.ConfigurationInUse\"> & {\n /**\n * @generated from field: repeated importhub.v1.ImportProfileRef import_profiles = 1;\n */\n importProfiles: ImportProfileRef[];\n};\n\n/**\n * Describes the message importhub.v1.ConfigurationInUse.\n * Use `create(ConfigurationInUseSchema)` to create a new message.\n */\nexport const ConfigurationInUseSchema: GenMessage<ConfigurationInUse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_configuration, 7);\n\n/**\n * FieldComparisonStatus is how a field differs between two Revisions, from\n * the first to the second.\n *\n * @generated from enum importhub.v1.FieldComparisonStatus\n */\nexport enum FieldComparisonStatus {\n /**\n * @generated from enum value: FIELD_COMPARISON_STATUS_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * The same value on both sides, or absent from both.\n *\n * @generated from enum value: FIELD_COMPARISON_STATUS_UNCHANGED = 1;\n */\n UNCHANGED = 1,\n\n /**\n * Absent from the first, present in the second.\n *\n * @generated from enum value: FIELD_COMPARISON_STATUS_ADDED = 2;\n */\n ADDED = 2,\n\n /**\n * Present in the first, absent from the second.\n *\n * @generated from enum value: FIELD_COMPARISON_STATUS_REMOVED = 3;\n */\n REMOVED = 3,\n\n /**\n * Present on both sides with different values.\n *\n * @generated from enum value: FIELD_COMPARISON_STATUS_CHANGED = 4;\n */\n CHANGED = 4,\n}\n\n/**\n * Describes the enum importhub.v1.FieldComparisonStatus.\n */\nexport const FieldComparisonStatusSchema: GenEnum<FieldComparisonStatus> = /*@__PURE__*/\n enumDesc(file_importhub_v1_configuration, 0);\n\n","// @generated by protoc-gen-es v2.13.0 with parameter \"target=ts\"\n// @generated from file importhub/v1/entity_set.proto (package importhub.v1, syntax proto3)\n/* eslint-disable */\n\nimport type { GenFile, GenMessage, GenService } from \"@bufbuild/protobuf/codegenv2\";\nimport { fileDesc, messageDesc, serviceDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport type { Timestamp } from \"@bufbuild/protobuf/wkt\";\nimport { file_google_protobuf_timestamp } from \"@bufbuild/protobuf/wkt\";\nimport type { ConfigurationRelease, ConfigurationRevision, ConfigurationState, FieldComparison, Validity } from \"./configuration_pb\";\nimport { file_importhub_v1_configuration } from \"./configuration_pb\";\nimport type { Message } from \"@bufbuild/protobuf\";\n\n/**\n * Describes the file importhub/v1/entity_set.proto.\n */\nexport const file_importhub_v1_entity_set: GenFile = /*@__PURE__*/\n fileDesc(\"Ch1pbXBvcnRodWIvdjEvZW50aXR5X3NldC5wcm90bxIMaW1wb3J0aHViLnYxIugBCglFbnRpdHlTZXQSCgoCaWQYASABKAkSEwoLcmV2aXNpb25faWQYAiABKAkSLwoHY29udGVudBgDIAEoCzIeLmltcG9ydGh1Yi52MS5FbnRpdHlTZXRDb250ZW50EigKCHZhb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Gl0eVNldEhpc3RvcnlSZXF1ZXN0GiouaW1wb3J0aHViLnYxLkxpc3RFbnRpdHlTZXRIaXN0b3J5UmVzcG9uc2USfAoZQ29tcGFyZUVudGl0eVNldFJldmlzaW9ucxIuLmltcG9ydGh1Yi52MS5Db21wYXJlRW50aXR5U2V0UmV2aXNpb25zUmVxdWVzdBovLmltcG9ydGh1Yi52MS5Db21wYXJlRW50aXR5U2V0UmV2aXNpb25zUmVzcG9uc2USeQoYUmVzdG9yZUVudGl0eVNldFJldmlzaW9uEi0uaW1wb3J0aHViLnYxLlJlc3RvcmVFbnRpdHlTZXRSZXZpc2lvblJlcXVlc3QaLi5pbXBvcnRodWIudjEuUmVzdG9yZUVudGl0eVNldFJldmlzaW9uUmVzcG9uc2VCOVo3Z2l0aHViLmNvbS9rbmtjcy9pbXBvcnRodWIvZ2VuL2ltcG9ydGh1Yi92MTtpbXBvcnRodWJ2MWIGcHJvdG8z\", [file_google_protobuf_timestamp, file_importhub_v1_configuration]);\n\n/**\n * EntitySet is one Entity Set, at one of its Revisions.\n *\n * @generated from message importhub.v1.EntitySet\n */\nexport type EntitySet = Message<\"importhub.v1.EntitySet\"> & {\n /**\n * The Entity Set's id, a KSUID.\n *\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * The Revision this content is from: the draft, unless an older one was\n * asked for.\n *\n * @generated from field: string revision_id = 2;\n */\n revisionId: string;\n\n /**\n * The content at that Revision.\n *\n * @generated from field: importhub.v1.EntitySetContent content = 3;\n */\n content?: EntitySetContent | undefined;\n\n /**\n * Whether that Revision may be released, as decided when it was saved.\n *\n * @generated from field: importhub.v1.Validity validity = 4;\n */\n validity?: Validity | undefined;\n\n /**\n * Where the Entity Set stands: its draft and latest Release.\n *\n * @generated from field: importhub.v1.ConfigurationState state = 5;\n */\n state?: ConfigurationState | undefined;\n\n /**\n * When the Entity Set was created.\n *\n * @generated from field: google.protobuf.Timestamp created_at = 6;\n */\n createdAt?: Timestamp | undefined;\n};\n\n/**\n * Describes the message importhub.v1.EntitySet.\n * Use `create(EntitySetSchema)` to create a new message.\n */\nexport const EntitySetSchema: GenMessage<EntitySet> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 0);\n\n/**\n * EntitySetContent is what an admin edits, and what a Revision holds.\n *\n * @generated from message importhub.v1.EntitySetContent\n */\nexport type EntitySetContent = Message<\"importhub.v1.EntitySetContent\"> & {\n /**\n * The Entity Set's name, unique in the workspace. An Import Profile names\n * its Entity Set by id, so renaming it breaks no Profile.\n *\n * @generated from field: string name = 1;\n */\n name: string;\n\n /**\n * What the Entity Set is for; free text.\n *\n * @generated from field: string description = 2;\n */\n description: string;\n\n /**\n * The entities, by name without `&` and `;`: `auml` for `&auml;`, mapped\n * to the text each stands for, which may be empty.\n *\n * @generated from field: map<string, string> entities = 3;\n */\n entities: { [key: string]: string };\n};\n\n/**\n * Describes the message importhub.v1.EntitySetContent.\n * Use `create(EntitySetContentSchema)` to create a new message.\n */\nexport const EntitySetContentSchema: GenMessage<EntitySetContent> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 1);\n\n/**\n * @generated from message importhub.v1.ListEntitySetsRequest\n */\nexport type ListEntitySetsRequest = Message<\"importhub.v1.ListEntitySetsRequest\"> & {\n};\n\n/**\n * Describes the message importhub.v1.ListEntitySetsRequest.\n * Use `create(ListEntitySetsRequestSchema)` to create a new message.\n */\nexport const ListEntitySetsRequestSchema: GenMessage<ListEntitySetsRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 2);\n\n/**\n * @generated from message importhub.v1.ListEntitySetsResponse\n */\nexport type ListEntitySetsResponse = Message<\"importhub.v1.ListEntitySetsResponse\"> & {\n /**\n * @generated from field: repeated importhub.v1.EntitySet entity_sets = 1;\n */\n entitySets: EntitySet[];\n};\n\n/**\n * Describes the message importhub.v1.ListEntitySetsResponse.\n * Use `create(ListEntitySetsResponseSchema)` to create a new message.\n */\nexport const ListEntitySetsResponseSchema: GenMessage<ListEntitySetsResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 3);\n\n/**\n * @generated from message importhub.v1.GetEntitySetRequest\n */\nexport type GetEntitySetRequest = Message<\"importhub.v1.GetEntitySetRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * An older Revision to read the content of; empty for the draft.\n *\n * @generated from field: string revision_id = 2;\n */\n revisionId: string;\n};\n\n/**\n * Describes the message importhub.v1.GetEntitySetRequest.\n * Use `create(GetEntitySetRequestSchema)` to create a new message.\n */\nexport const GetEntitySetRequestSchema: GenMessage<GetEntitySetRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 4);\n\n/**\n * @generated from message importhub.v1.GetEntitySetResponse\n */\nexport type GetEntitySetResponse = Message<\"importhub.v1.GetEntitySetResponse\"> & {\n /**\n * @generated from field: importhub.v1.EntitySet entity_set = 1;\n */\n entitySet?: EntitySet | undefined;\n};\n\n/**\n * Describes the message importhub.v1.GetEntitySetResponse.\n * Use `create(GetEntitySetResponseSchema)` to create a new message.\n */\nexport const GetEntitySetResponseSchema: GenMessage<GetEntitySetResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 5);\n\n/**\n * @generated from message importhub.v1.CreateEntitySetRequest\n */\nexport type CreateEntitySetRequest = Message<\"importhub.v1.CreateEntitySetRequest\"> & {\n /**\n * @generated from field: importhub.v1.EntitySetContent content = 1;\n */\n content?: EntitySetContent | undefined;\n};\n\n/**\n * Describes the message importhub.v1.CreateEntitySetRequest.\n * Use `create(CreateEntitySetRequestSchema)` to create a new message.\n */\nexport const CreateEntitySetRequestSchema: GenMessage<CreateEntitySetRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 6);\n\n/**\n * @generated from message importhub.v1.CreateEntitySetResponse\n */\nexport type CreateEntitySetResponse = Message<\"importhub.v1.CreateEntitySetResponse\"> & {\n /**\n * @generated from field: importhub.v1.EntitySet entity_set = 1;\n */\n entitySet?: EntitySet | undefined;\n};\n\n/**\n * Describes the message importhub.v1.CreateEntitySetResponse.\n * Use `create(CreateEntitySetResponseSchema)` to create a new message.\n */\nexport const CreateEntitySetResponseSchema: GenMessage<CreateEntitySetResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 7);\n\n/**\n * @generated from message importhub.v1.UpdateEntitySetRequest\n */\nexport type UpdateEntitySetRequest = Message<\"importhub.v1.UpdateEntitySetRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * The whole new content; it replaces the draft's.\n *\n * @generated from field: importhub.v1.EntitySetContent content = 2;\n */\n content?: EntitySetContent | undefined;\n\n /**\n * The draft this edit was made on. Given, the save is refused if the\n * draft has moved since; empty, it saves on whatever the draft is.\n *\n * @generated from field: string draft_revision_id = 3;\n */\n draftRevisionId: string;\n};\n\n/**\n * Describes the message importhub.v1.UpdateEntitySetRequest.\n * Use `create(UpdateEntitySetRequestSchema)` to create a new message.\n */\nexport const UpdateEntitySetRequestSchema: GenMessage<UpdateEntitySetRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 8);\n\n/**\n * @generated from message importhub.v1.UpdateEntitySetResponse\n */\nexport type UpdateEntitySetResponse = Message<\"importhub.v1.UpdateEntitySetResponse\"> & {\n /**\n * @generated from field: importhub.v1.EntitySet entity_set = 1;\n */\n entitySet?: EntitySet | undefined;\n};\n\n/**\n * Describes the message importhub.v1.UpdateEntitySetResponse.\n * Use `create(UpdateEntitySetResponseSchema)` to create a new message.\n */\nexport const UpdateEntitySetResponseSchema: GenMessage<UpdateEntitySetResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 9);\n\n/**\n * @generated from message importhub.v1.DeleteEntitySetRequest\n */\nexport type DeleteEntitySetRequest = Message<\"importhub.v1.DeleteEntitySetRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n};\n\n/**\n * Describes the message importhub.v1.DeleteEntitySetRequest.\n * Use `create(DeleteEntitySetRequestSchema)` to create a new message.\n */\nexport const DeleteEntitySetRequestSchema: GenMessage<DeleteEntitySetRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 10);\n\n/**\n * @generated from message importhub.v1.DeleteEntitySetResponse\n */\nexport type DeleteEntitySetResponse = Message<\"importhub.v1.DeleteEntitySetResponse\"> & {\n};\n\n/**\n * Describes the message importhub.v1.DeleteEntitySetResponse.\n * Use `create(DeleteEntitySetResponseSchema)` to create a new message.\n */\nexport const DeleteEntitySetResponseSchema: GenMessage<DeleteEntitySetResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 11);\n\n/**\n * @generated from message importhub.v1.CutEntitySetReleaseRequest\n */\nexport type CutEntitySetReleaseRequest = Message<\"importhub.v1.CutEntitySetReleaseRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * The draft the admin is releasing. Given, the cut is refused if the\n * draft has moved since, so what was reviewed is what is released.\n *\n * @generated from field: string draft_revision_id = 2;\n */\n draftRevisionId: string;\n};\n\n/**\n * Describes the message importhub.v1.CutEntitySetReleaseRequest.\n * Use `create(CutEntitySetReleaseRequestSchema)` to create a new message.\n */\nexport const CutEntitySetReleaseRequestSchema: GenMessage<CutEntitySetReleaseRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 12);\n\n/**\n * @generated from message importhub.v1.CutEntitySetReleaseResponse\n */\nexport type CutEntitySetReleaseResponse = Message<\"importhub.v1.CutEntitySetReleaseResponse\"> & {\n /**\n * The Release cut.\n *\n * @generated from field: importhub.v1.ConfigurationRelease release = 1;\n */\n release?: ConfigurationRelease | undefined;\n\n /**\n * The Entity Set after the cut.\n *\n * @generated from field: importhub.v1.EntitySet entity_set = 2;\n */\n entitySet?: EntitySet | undefined;\n};\n\n/**\n * Describes the message importhub.v1.CutEntitySetReleaseResponse.\n * Use `create(CutEntitySetReleaseResponseSchema)` to create a new message.\n */\nexport const CutEntitySetReleaseResponseSchema: GenMessage<CutEntitySetReleaseResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 13);\n\n/**\n * @generated from message importhub.v1.ListEntitySetHistoryRequest\n */\nexport type ListEntitySetHistoryRequest = Message<\"importhub.v1.ListEntitySetHistoryRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * Revisions per page; 0 means 100, and at most 1000.\n *\n * @generated from field: int32 page_size = 2;\n */\n pageSize: number;\n\n /**\n * The next_page_token of the previous page; empty for the first.\n *\n * @generated from field: string page_token = 3;\n */\n pageToken: string;\n};\n\n/**\n * Describes the message importhub.v1.ListEntitySetHistoryRequest.\n * Use `create(ListEntitySetHistoryRequestSchema)` to create a new message.\n */\nexport const ListEntitySetHistoryRequestSchema: GenMessage<ListEntitySetHistoryRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 14);\n\n/**\n * @generated from message importhub.v1.ListEntitySetHistoryResponse\n */\nexport type ListEntitySetHistoryResponse = Message<\"importhub.v1.ListEntitySetHistoryResponse\"> & {\n /**\n * One page of Revisions, newest first.\n *\n * @generated from field: repeated importhub.v1.ConfigurationRevision revisions = 1;\n */\n revisions: ConfigurationRevision[];\n\n /**\n * Every Release, newest first, on every page.\n *\n * @generated from field: repeated importhub.v1.ConfigurationRelease releases = 2;\n */\n releases: ConfigurationRelease[];\n\n /**\n * The page_token of the next page; empty on the last.\n *\n * @generated from field: string next_page_token = 3;\n */\n nextPageToken: string;\n};\n\n/**\n * Describes the message importhub.v1.ListEntitySetHistoryResponse.\n * Use `create(ListEntitySetHistoryResponseSchema)` to create a new message.\n */\nexport const ListEntitySetHistoryResponseSchema: GenMessage<ListEntitySetHistoryResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 15);\n\n/**\n * @generated from message importhub.v1.CompareEntitySetRevisionsRequest\n */\nexport type CompareEntitySetRevisionsRequest = Message<\"importhub.v1.CompareEntitySetRevisionsRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * The Revision compared from.\n *\n * @generated from field: string from_revision_id = 2;\n */\n fromRevisionId: string;\n\n /**\n * The Revision compared to.\n *\n * @generated from field: string to_revision_id = 3;\n */\n toRevisionId: string;\n};\n\n/**\n * Describes the message importhub.v1.CompareEntitySetRevisionsRequest.\n * Use `create(CompareEntitySetRevisionsRequestSchema)` to create a new message.\n */\nexport const CompareEntitySetRevisionsRequestSchema: GenMessage<CompareEntitySetRevisionsRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 16);\n\n/**\n * @generated from message importhub.v1.CompareEntitySetRevisionsResponse\n */\nexport type CompareEntitySetRevisionsResponse = Message<\"importhub.v1.CompareEntitySetRevisionsResponse\"> & {\n /**\n * The Entity Set at from_revision_id.\n *\n * @generated from field: importhub.v1.EntitySet from = 1;\n */\n from?: EntitySet | undefined;\n\n /**\n * The Entity Set at to_revision_id.\n *\n * @generated from field: importhub.v1.EntitySet to = 2;\n */\n to?: EntitySet | undefined;\n\n /**\n * Each field, and how it differs from `from` to `to`.\n *\n * @generated from field: repeated importhub.v1.FieldComparison fields = 3;\n */\n fields: FieldComparison[];\n};\n\n/**\n * Describes the message importhub.v1.CompareEntitySetRevisionsResponse.\n * Use `create(CompareEntitySetRevisionsResponseSchema)` to create a new message.\n */\nexport const CompareEntitySetRevisionsResponseSchema: GenMessage<CompareEntitySetRevisionsResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 17);\n\n/**\n * @generated from message importhub.v1.RestoreEntitySetRevisionRequest\n */\nexport type RestoreEntitySetRevisionRequest = Message<\"importhub.v1.RestoreEntitySetRevisionRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * The older Revision whose content becomes the new draft.\n *\n * @generated from field: string revision_id = 2;\n */\n revisionId: string;\n\n /**\n * As UpdateEntitySetRequest's.\n *\n * @generated from field: string draft_revision_id = 3;\n */\n draftRevisionId: string;\n};\n\n/**\n * Describes the message importhub.v1.RestoreEntitySetRevisionRequest.\n * Use `create(RestoreEntitySetRevisionRequestSchema)` to create a new message.\n */\nexport const RestoreEntitySetRevisionRequestSchema: GenMessage<RestoreEntitySetRevisionRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 18);\n\n/**\n * @generated from message importhub.v1.RestoreEntitySetRevisionResponse\n */\nexport type RestoreEntitySetRevisionResponse = Message<\"importhub.v1.RestoreEntitySetRevisionResponse\"> & {\n /**\n * @generated from field: importhub.v1.EntitySet entity_set = 1;\n */\n entitySet?: EntitySet | undefined;\n};\n\n/**\n * Describes the message importhub.v1.RestoreEntitySetRevisionResponse.\n * Use `create(RestoreEntitySetRevisionResponseSchema)` to create a new message.\n */\nexport const RestoreEntitySetRevisionResponseSchema: GenMessage<RestoreEntitySetRevisionResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_entity_set, 19);\n\n/**\n * EntitySetService holds the workspace's Entity Sets: named tables of XML\n * character entities and what they stand for, with which an Import reads a\n * Source File that uses entities it does not declare (CONTEXT.md,\n * manage-entity-sets).\n *\n * An Entity Set is versioned configuration (ADR 0016): every create, update\n * and restore saves a draft Revision, and an admin cuts a Configuration\n * Release from a valid draft. A real Import runs only on a Release.\n *\n * Every RPC acts on the caller's workspace, which comes from the token's\n * active workspace and never from a request field. Reads need `viewer`;\n * every write needs `admin` (ADR 0010, control-who-may-import:AC3).\n *\n * The validity reason codes of an Entity Set:\n *\n * - `no_entities`: it defines no entity.\n * - `unreadable_name`: an entity's name is not a letter followed by\n * letters, digits, `.`, `_` or `-`, so no reference in a Source File\n * could ever name it.\n * - `predefined_entity`: it redefines one of XML's own entities (`amp`,\n * `lt`, `gt`, `quot`, `apos`), which would change how every file is\n * read.\n *\n * @generated from service importhub.v1.EntitySetService\n */\nexport const EntitySetService: GenService<{\n /**\n * ListEntitySets returns every Entity Set of the workspace, by name, each\n * with its draft. A workspace keeps a handful, so the list is not paged.\n *\n * @generated from rpc importhub.v1.EntitySetService.ListEntitySets\n */\n listEntitySets: {\n methodKind: \"unary\";\n input: typeof ListEntitySetsRequestSchema;\n output: typeof ListEntitySetsResponseSchema;\n },\n /**\n * GetEntitySet returns one Entity Set with its draft, or with an older\n * Revision of it when one is named.\n *\n * @generated from rpc importhub.v1.EntitySetService.GetEntitySet\n */\n getEntitySet: {\n methodKind: \"unary\";\n input: typeof GetEntitySetRequestSchema;\n output: typeof GetEntitySetResponseSchema;\n },\n /**\n * CreateEntitySet creates an Entity Set, its content the first draft. An\n * invalid table of entities is saved and marked invalid with its reasons;\n * a missing name, or one another Entity Set of the workspace has, is\n * refused (InvalidArgument, AlreadyExists).\n *\n * @generated from rpc importhub.v1.EntitySetService.CreateEntitySet\n */\n createEntitySet: {\n methodKind: \"unary\";\n input: typeof CreateEntitySetRequestSchema;\n output: typeof CreateEntitySetResponseSchema;\n },\n /**\n * UpdateEntitySet saves new content as a new draft Revision. It is\n * refused with FailedPrecondition when draft_revision_id is given and is\n * no longer the draft: somebody saved in between.\n *\n * @generated from rpc importhub.v1.EntitySetService.UpdateEntitySet\n */\n updateEntitySet: {\n methodKind: \"unary\";\n input: typeof UpdateEntitySetRequestSchema;\n output: typeof UpdateEntitySetResponseSchema;\n },\n /**\n * DeleteEntitySet deletes an Entity Set; it no longer appears in the list,\n * and its name is free again. It is refused with FailedPrecondition while\n * an Import Profile names it, naming the Profiles in the message and in a\n * ConfigurationInUse detail (manage-entity-sets:AC3).\n *\n * @generated from rpc importhub.v1.EntitySetService.DeleteEntitySet\n */\n deleteEntitySet: {\n methodKind: \"unary\";\n input: typeof DeleteEntitySetRequestSchema;\n output: typeof DeleteEntitySetResponseSchema;\n },\n /**\n * CutEntitySetRelease cuts a Configuration Release from the draft. It is\n * refused with FailedPrecondition when the draft is invalid (the error\n * carries the draft's Validity as a detail, with its reasons), when the\n * draft does not differ from the latest Release, or when\n * draft_revision_id is given and is no longer the draft.\n *\n * @generated from rpc importhub.v1.EntitySetService.CutEntitySetRelease\n */\n cutEntitySetRelease: {\n methodKind: \"unary\";\n input: typeof CutEntitySetReleaseRequestSchema;\n output: typeof CutEntitySetReleaseResponseSchema;\n },\n /**\n * ListEntitySetHistory lists an Entity Set's Revisions, newest first and\n * paged, with who saved each and when, and all its Releases, with who cut\n * each and when (release-a-configuration:AC6).\n *\n * @generated from rpc importhub.v1.EntitySetService.ListEntitySetHistory\n */\n listEntitySetHistory: {\n methodKind: \"unary\";\n input: typeof ListEntitySetHistoryRequestSchema;\n output: typeof ListEntitySetHistoryResponseSchema;\n },\n /**\n * CompareEntitySetRevisions compares two Revisions of one Entity Set: both\n * contents, for a side-by-side view, and how each field differs from the\n * first to the second. A Release is compared through the Revision it pins.\n *\n * @generated from rpc importhub.v1.EntitySetService.CompareEntitySetRevisions\n */\n compareEntitySetRevisions: {\n methodKind: \"unary\";\n input: typeof CompareEntitySetRevisionsRequestSchema;\n output: typeof CompareEntitySetRevisionsResponseSchema;\n },\n /**\n * RestoreEntitySetRevision saves an older Revision's content as a new\n * draft (release-a-configuration:AC7). Its validity is decided anew, by\n * the rules in force now. It is refused like UpdateEntitySet when the\n * draft moved, and with AlreadyExists when the old name is now another\n * Entity Set's.\n *\n * @generated from rpc importhub.v1.EntitySetService.RestoreEntitySetRevision\n */\n restoreEntitySetRevision: {\n methodKind: \"unary\";\n input: typeof RestoreEntitySetRevisionRequestSchema;\n output: typeof RestoreEntitySetRevisionResponseSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_importhub_v1_entity_set, 0);\n\n","// @generated by protoc-gen-es v2.13.0 with parameter \"target=ts\"\n// @generated from file importhub/v1/import.proto (package importhub.v1, syntax proto3)\n/* eslint-disable */\n\nimport type { GenEnum, GenFile, GenMessage, GenService } from \"@bufbuild/protobuf/codegenv2\";\nimport { enumDesc, fileDesc, messageDesc, serviceDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport type { Timestamp } from \"@bufbuild/protobuf/wkt\";\nimport { file_google_protobuf_timestamp } from \"@bufbuild/protobuf/wkt\";\nimport type { Message } from \"@bufbuild/protobuf\";\n\n/**\n * Describes the file importhub/v1/import.proto.\n */\nexport const file_importhub_v1_import: GenFile = /*@__PURE__*/\n fileDesc(\"ChlpbXBvcnRodWIvdjEvaW1wb3J0LnByb3RvEgxpbXBvcnRodWIudjEiMgodQ3JlYXRlU291cmNlRmlsZVVwbG9hZFJlcXVlc3QSEQoJZmlsZV9uYW1lGAEgASgJIpsBCh5DcmVhdGVTb3VyY2VGaWxlVXBsb2FkUmVzcG9uc2USLQoLc291cmNlX2ZpbGUYASABKAsyGC5pbXBvcnRodWIudjEuU291cmNlRmlsZRISCgp1cGxvYWRfdXJsGAIgASgJEjYKEnVwbG9hZF9leHBpcmVfdGltZRgDIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXAicAoKU291cmNlRmlsZRIKCgJpZBgBIAEoCRIRCglmaWxlX25hbWUYAiABKAkSEgoKY3JlYXRlZF9ieRgDIAEoCRIvCgtjcmVhdGVfdGltZRgEIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXAiiwEKElN0YXJ0SW1wb3J0UmVxdWVzdBIZChFpbXBvcnRfcHJvZmlsZV9pZBgBIAEoCRIWCg5zb3VyY2VfZmlsZV9pZBgCIAEoCRIWCg5lZmZlY3RpdmVfZGF0ZRgDIAEoCRIqCgZzb3VyY2UYBCABKAsyGi5pbXBvcnRodWIudjEuSW1wb3J0U291cmNlIi8KDEltcG9ydFNvdXJjZRIMCgRkYXRlGAEgASgJEhEKCXJlZmVyZW5jZRgCIAEoCSI7ChNTdGFydEltcG9ydFJlc3BvbnNlEiQKBmltcG9ydBgBIAEoCzIULmltcG9ydGh1Yi52MS5JbXBvcnQiOwoSTGlzdEltcG9ydHNSZXF1ZXN0EhEKCXBhZ2Vfc2l6ZRgBIAEoBRISCgpwYWdlX3Rva2VuGAIgASgJIlUKE0xpc3RJbXBvcnRzUmVzcG9uc2USJQoHaW1wb3J0cxgBIAMoCzIULmltcG9ydGh1Yi52MS5JbXBvcnQSFwoPbmV4dF9w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ourceFileUploadRequest\n */\nexport type CreateSourceFileUploadRequest = Message<\"importhub.v1.CreateSourceFileUploadRequest\"> & {\n /**\n * The file's name as the person knows it, for display: not blank, at most\n * 255 characters. It is never part of where the file is stored.\n *\n * @generated from field: string file_name = 1;\n */\n fileName: string;\n};\n\n/**\n * Describes the message importhub.v1.CreateSourceFileUploadRequest.\n * Use `create(CreateSourceFileUploadRequestSchema)` to create a new message.\n */\nexport const CreateSourceFileUploadRequestSchema: GenMessage<CreateSourceFileUploadRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 0);\n\n/**\n * @generated from message importhub.v1.CreateSourceFileUploadResponse\n */\nexport type CreateSourceFileUploadResponse = Message<\"importhub.v1.CreateSourceFileUploadResponse\"> & {\n /**\n * @generated from field: importhub.v1.SourceFile source_file = 1;\n */\n sourceFile?: SourceFile | undefined;\n\n /**\n * Where to PUT the file's content, until upload_expire_time.\n *\n * @generated from field: string upload_url = 2;\n */\n uploadUrl: string;\n\n /**\n * @generated from field: google.protobuf.Timestamp upload_expire_time = 3;\n */\n uploadExpireTime?: Timestamp | undefined;\n};\n\n/**\n * Describes the message importhub.v1.CreateSourceFileUploadResponse.\n * Use `create(CreateSourceFileUploadResponseSchema)` to create a new message.\n */\nexport const CreateSourceFileUploadResponseSchema: GenMessage<CreateSourceFileUploadResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 1);\n\n/**\n * SourceFile is the one XML file an Import reads, kept in importhub's own\n * blob store (CONTEXT.md \"Source File\").\n *\n * @generated from message importhub.v1.SourceFile\n */\nexport type SourceFile = Message<\"importhub.v1.SourceFile\"> & {\n /**\n * Its id, a KSUID.\n *\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * @generated from field: string file_name = 2;\n */\n fileName: string;\n\n /**\n * The odon user id of the person who made it.\n *\n * @generated from field: string created_by = 3;\n */\n createdBy: string;\n\n /**\n * @generated from field: google.protobuf.Timestamp create_time = 4;\n */\n createTime?: Timestamp | undefined;\n};\n\n/**\n * Describes the message importhub.v1.SourceFile.\n * Use `create(SourceFileSchema)` to create a new message.\n */\nexport const SourceFileSchema: GenMessage<SourceFile> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 2);\n\n/**\n * @generated from message importhub.v1.StartImportRequest\n */\nexport type StartImportRequest = Message<\"importhub.v1.StartImportRequest\"> & {\n /**\n * The Import Profile to run; the Import runs its latest Release.\n *\n * @generated from field: string import_profile_id = 1;\n */\n importProfileId: string;\n\n /**\n * The Source File to read, uploaded with CreateSourceFileUpload's URL.\n *\n * @generated from field: string source_file_id = 2;\n */\n sourceFileId: string;\n\n /**\n * Optional: the day, YYYY-MM-DD, the Source Versions of Dated Content\n * the file gives no dates for take effect: their Planned Releases start\n * that day (start-an-import:AC2). A day the file gives always wins.\n *\n * @generated from field: string effective_date = 3;\n */\n effectiveDate: string;\n\n /**\n * Optional: the publication that triggered the Import. The Change Set the\n * Import opens records it, and contenthub prefills Release Spec fields\n * from it. Its date and reference are then both required.\n *\n * @generated from field: importhub.v1.ImportSource source = 4;\n */\n source?: ImportSource | undefined;\n};\n\n/**\n * Describes the message importhub.v1.StartImportRequest.\n * Use `create(StartImportRequestSchema)` to create a new message.\n */\nexport const StartImportRequestSchema: GenMessage<StartImportRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 3);\n\n/**\n * ImportSource is the publication that triggered an Import, as contenthub\n * records it on a Change Set (contenthub's CONTEXT.md \"Source\"): such as\n * 2026-09-20, \"BGBl. 2026 I Nr. 270\".\n *\n * @generated from message importhub.v1.ImportSource\n */\nexport type ImportSource = Message<\"importhub.v1.ImportSource\"> & {\n /**\n * The day it was published, as YYYY-MM-DD.\n *\n * @generated from field: string date = 1;\n */\n date: string;\n\n /**\n * How it is cited: one line, at most 500 characters.\n *\n * @generated from field: string reference = 2;\n */\n reference: string;\n};\n\n/**\n * Describes the message importhub.v1.ImportSource.\n * Use `create(ImportSourceSchema)` to create a new message.\n */\nexport const ImportSourceSchema: GenMessage<ImportSource> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 4);\n\n/**\n * @generated from message importhub.v1.StartImportResponse\n */\nexport type StartImportResponse = Message<\"importhub.v1.StartImportResponse\"> & {\n /**\n * The Import, queued.\n *\n * @generated from field: importhub.v1.Import import = 1;\n */\n import?: Import | undefined;\n};\n\n/**\n * Describes the message importhub.v1.StartImportResponse.\n * Use `create(StartImportResponseSchema)` to create a new message.\n */\nexport const StartImportResponseSchema: GenMessage<StartImportResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 5);\n\n/**\n * @generated from message importhub.v1.ListImportsRequest\n */\nexport type ListImportsRequest = Message<\"importhub.v1.ListImportsRequest\"> & {\n /**\n * At most 200; 0 means 50.\n *\n * @generated from field: int32 page_size = 1;\n */\n pageSize: number;\n\n /**\n * The next_page_token of the previous page; empty for the first.\n *\n * @generated from field: string page_token = 2;\n */\n pageToken: string;\n};\n\n/**\n * Describes the message importhub.v1.ListImportsRequest.\n * Use `create(ListImportsRequestSchema)` to create a new message.\n */\nexport const ListImportsRequestSchema: GenMessage<ListImportsRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 6);\n\n/**\n * @generated from message importhub.v1.ListImportsResponse\n */\nexport type ListImportsResponse = Message<\"importhub.v1.ListImportsResponse\"> & {\n /**\n * @generated from field: repeated importhub.v1.Import imports = 1;\n */\n imports: Import[];\n\n /**\n * Empty on the last page.\n *\n * @generated from field: string next_page_token = 2;\n */\n nextPageToken: string;\n};\n\n/**\n * Describes the message importhub.v1.ListImportsResponse.\n * Use `create(ListImportsResponseSchema)` to create a new message.\n */\nexport const ListImportsResponseSchema: GenMessage<ListImportsResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 7);\n\n/**\n * @generated from message importhub.v1.GetImportRequest\n */\nexport type GetImportRequest = Message<\"importhub.v1.GetImportRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n};\n\n/**\n * Describes the message importhub.v1.GetImportRequest.\n * Use `create(GetImportRequestSchema)` to create a new message.\n */\nexport const GetImportRequestSchema: GenMessage<GetImportRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 8);\n\n/**\n * @generated from message importhub.v1.GetImportResponse\n */\nexport type GetImportResponse = Message<\"importhub.v1.GetImportResponse\"> & {\n /**\n * @generated from field: importhub.v1.Import import = 1;\n */\n import?: Import | undefined;\n};\n\n/**\n * Describes the message importhub.v1.GetImportResponse.\n * Use `create(GetImportResponseSchema)` to create a new message.\n */\nexport const GetImportResponseSchema: GenMessage<GetImportResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 9);\n\n/**\n * @generated from message importhub.v1.CancelImportRequest\n */\nexport type CancelImportRequest = Message<\"importhub.v1.CancelImportRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n};\n\n/**\n * Describes the message importhub.v1.CancelImportRequest.\n * Use `create(CancelImportRequestSchema)` to create a new message.\n */\nexport const CancelImportRequestSchema: GenMessage<CancelImportRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 10);\n\n/**\n * @generated from message importhub.v1.CancelImportResponse\n */\nexport type CancelImportResponse = Message<\"importhub.v1.CancelImportResponse\"> & {\n /**\n * The Import as it is now: Cancelled, or still running until the worker\n * reaches its next item.\n *\n * @generated from field: importhub.v1.Import import = 1;\n */\n import?: Import | undefined;\n};\n\n/**\n * Describes the message importhub.v1.CancelImportResponse.\n * Use `create(CancelImportResponseSchema)` to create a new message.\n */\nexport const CancelImportResponseSchema: GenMessage<CancelImportResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 11);\n\n/**\n * @generated from message importhub.v1.ListItemProblemsRequest\n */\nexport type ListItemProblemsRequest = Message<\"importhub.v1.ListItemProblemsRequest\"> & {\n /**\n * The Import whose Item Problems to list.\n *\n * @generated from field: string import_id = 1;\n */\n importId: string;\n\n /**\n * Only the Item Problems of this Mapping; empty for every Mapping.\n *\n * @generated from field: string mapping_id = 2;\n */\n mappingId: string;\n\n /**\n * Only the Item Problems whose Source Key contains this, ignoring case;\n * empty for all.\n *\n * @generated from field: string source_key_query = 3;\n */\n sourceKeyQuery: string;\n\n /**\n * At most 200; 0 means 50.\n *\n * @generated from field: int32 page_size = 4;\n */\n pageSize: number;\n\n /**\n * The next_page_token of the previous page, with the same filters; empty\n * for the first.\n *\n * @generated from field: string page_token = 5;\n */\n pageToken: string;\n};\n\n/**\n * Describes the message importhub.v1.ListItemProblemsRequest.\n * Use `create(ListItemProblemsRequestSchema)` to create a new message.\n */\nexport const ListItemProblemsRequestSchema: GenMessage<ListItemProblemsRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 12);\n\n/**\n * @generated from message importhub.v1.ListItemProblemsResponse\n */\nexport type ListItemProblemsResponse = Message<\"importhub.v1.ListItemProblemsResponse\"> & {\n /**\n * @generated from field: repeated importhub.v1.ItemProblem item_problems = 1;\n */\n itemProblems: ItemProblem[];\n\n /**\n * Every Item Problem of the Import, whatever the filters.\n *\n * @generated from field: int32 total_count = 2;\n */\n totalCount: number;\n\n /**\n * The Item Problems the filters match, on every page.\n *\n * @generated from field: int32 matching_count = 3;\n */\n matchingCount: number;\n\n /**\n * Every Mapping with Item Problems, with how many each has, whatever the\n * filters: what a filter by Mapping offers.\n *\n * @generated from field: repeated importhub.v1.ItemProblemMappingCount mappings = 4;\n */\n mappings: ItemProblemMappingCount[];\n\n /**\n * Empty on the last page.\n *\n * @generated from field: string next_page_token = 5;\n */\n nextPageToken: string;\n\n /**\n * The Item Problems of the Import that are Pending References, whatever\n * the filters; total_count counts them too.\n *\n * @generated from field: int32 pending_reference_count = 6;\n */\n pendingReferenceCount: number;\n};\n\n/**\n * Describes the message importhub.v1.ListItemProblemsResponse.\n * Use `create(ListItemProblemsResponseSchema)` to create a new message.\n */\nexport const ListItemProblemsResponseSchema: GenMessage<ListItemProblemsResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 13);\n\n/**\n * ItemProblem is one Source Version an Import could not save and skipped\n * (CONTEXT.md \"Item Problem\").\n *\n * @generated from message importhub.v1.ItemProblem\n */\nexport type ItemProblem = Message<\"importhub.v1.ItemProblem\"> & {\n /**\n * Its id, a KSUID.\n *\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * @generated from field: string import_id = 2;\n */\n importId: string;\n\n /**\n * The Mapping that read it, and its name in the Release the Import ran.\n *\n * @generated from field: string mapping_id = 3;\n */\n mappingId: string;\n\n /**\n * @generated from field: string mapping_name = 4;\n */\n mappingName: string;\n\n /**\n * The element's Source Key; empty when it has none.\n *\n * @generated from field: string source_key = 5;\n */\n sourceKey: string;\n\n /**\n * The field it is about, a /-separated path in the Content's data; empty\n * when it is about the Source Version as a whole.\n *\n * @generated from field: string field = 6;\n */\n field: string;\n\n /**\n * Why, for a person.\n *\n * @generated from field: string reason = 7;\n */\n reason: string;\n\n /**\n * @generated from field: google.protobuf.Timestamp create_time = 8;\n */\n createTime?: Timestamp | undefined;\n\n /**\n * Set when the Item Problem is a reference the Import could not resolve\n * (CONTEXT.md \"Pending Reference\"): its holder is the Content the Item\n * Problem's Mapping and Source Key read, and field is where it holds it.\n *\n * @generated from field: importhub.v1.PendingReference pending_reference = 9;\n */\n pendingReference?: PendingReference | undefined;\n\n /**\n * The Content's display name, as its Mapping's display-name template\n * makes it; empty when the Mapping has none or the problem is about no\n * one Content.\n *\n * @generated from field: string display_name = 10;\n */\n displayName: string;\n};\n\n/**\n * Describes the message importhub.v1.ItemProblem.\n * Use `create(ItemProblemSchema)` to create a new message.\n */\nexport const ItemProblemSchema: GenMessage<ItemProblem> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 14);\n\n/**\n * PendingReference is a reference whose target neither existed nor was\n * covered by a Stub Mapping (ADR 0008). Its holder was saved without it;\n * importing the holder's Source File again once the target exists resolves\n * it.\n *\n * @generated from message importhub.v1.PendingReference\n */\nexport type PendingReference = Message<\"importhub.v1.PendingReference\"> & {\n /**\n * The Content that holds the reference.\n *\n * @generated from field: string holder_content_id = 1;\n */\n holderContentId: string;\n\n /**\n * What it names: the Mapping it read the target under, and a Source Key\n * among the Content Keys of that Mapping's Blueprint.\n *\n * @generated from field: string target_mapping_id = 2;\n */\n targetMappingId: string;\n\n /**\n * @generated from field: string target_blueprint_id = 3;\n */\n targetBlueprintId: string;\n\n /**\n * @generated from field: string target_source_key = 4;\n */\n targetSourceKey: string;\n};\n\n/**\n * Describes the message importhub.v1.PendingReference.\n * Use `create(PendingReferenceSchema)` to create a new message.\n */\nexport const PendingReferenceSchema: GenMessage<PendingReference> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 15);\n\n/**\n * ItemProblemMappingCount is how many Item Problems one Mapping has.\n *\n * @generated from message importhub.v1.ItemProblemMappingCount\n */\nexport type ItemProblemMappingCount = Message<\"importhub.v1.ItemProblemMappingCount\"> & {\n /**\n * @generated from field: string mapping_id = 1;\n */\n mappingId: string;\n\n /**\n * @generated from field: string mapping_name = 2;\n */\n mappingName: string;\n\n /**\n * @generated from field: int32 count = 3;\n */\n count: number;\n};\n\n/**\n * Describes the message importhub.v1.ItemProblemMappingCount.\n * Use `create(ItemProblemMappingCountSchema)` to create a new message.\n */\nexport const ItemProblemMappingCountSchema: GenMessage<ItemProblemMappingCount> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 16);\n\n/**\n * Import is one run of one Import Profile's Release over one Source File.\n *\n * @generated from message importhub.v1.Import\n */\nexport type Import = Message<\"importhub.v1.Import\"> & {\n /**\n * Its id, a KSUID. contenthub's Change Set names it as its Origin.\n *\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * The Import Profile it runs, and its name when the Import started.\n *\n * @generated from field: string import_profile_id = 2;\n */\n importProfileId: string;\n\n /**\n * @generated from field: string import_profile_name = 3;\n */\n importProfileName: string;\n\n /**\n * @generated from field: string source_file_id = 4;\n */\n sourceFileId: string;\n\n /**\n * The odon user id of the person who started it.\n *\n * @generated from field: string started_by = 5;\n */\n startedBy: string;\n\n /**\n * Where it is now.\n *\n * @generated from field: importhub.v1.ImportPhase phase = 6;\n */\n phase: ImportPhase;\n\n /**\n * How it ended; unspecified until it has.\n *\n * @generated from field: importhub.v1.ImportOutcome outcome = 7;\n */\n outcome: ImportOutcome;\n\n /**\n * Why it Failed, for a person; empty otherwise. An Import whose workers\n * crashed three times Fails naming the crashes.\n *\n * @generated from field: string failure_reason = 8;\n */\n failureReason: string;\n\n /**\n * How far the current phase is.\n *\n * @generated from field: importhub.v1.ImportProgress progress = 9;\n */\n progress?: ImportProgress | undefined;\n\n /**\n * What it has done so far.\n *\n * @generated from field: importhub.v1.ImportCounts counts = 10;\n */\n counts?: ImportCounts | undefined;\n\n /**\n * The contenthub Change Set it fills; empty until it opened one. A client\n * links to it in contenthub (follow-an-import:AC5).\n *\n * @generated from field: string change_set_id = 11;\n */\n changeSetId: string;\n\n /**\n * The exact Configuration Releases it runs with, pinned at Start.\n *\n * @generated from field: importhub.v1.ImportReleases releases = 12;\n */\n releases?: ImportReleases | undefined;\n\n /**\n * @generated from field: google.protobuf.Timestamp create_time = 13;\n */\n createTime?: Timestamp | undefined;\n\n /**\n * When a worker started it; unset while it is queued.\n *\n * @generated from field: google.protobuf.Timestamp start_time = 14;\n */\n startTime?: Timestamp | undefined;\n\n /**\n * When it ended; unset until it has.\n *\n * @generated from field: google.protobuf.Timestamp end_time = 15;\n */\n endTime?: Timestamp | undefined;\n\n /**\n * The odon user id of the person who cancelled it; empty when nobody did.\n * Set as soon as they asked: outcome says whether it has ended Cancelled.\n *\n * @generated from field: string cancelled_by = 16;\n */\n cancelledBy: string;\n\n /**\n * The effective date and Source it was started with; empty and unset\n * for none.\n *\n * @generated from field: string effective_date = 17;\n */\n effectiveDate: string;\n\n /**\n * @generated from field: importhub.v1.ImportSource source = 18;\n */\n source?: ImportSource | undefined;\n};\n\n/**\n * Describes the message importhub.v1.Import.\n * Use `create(ImportSchema)` to create a new message.\n */\nexport const ImportSchema: GenMessage<Import> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 17);\n\n/**\n * ImportProgress is how far an Import's current phase is: done of total\n * items. Both are 0 while the total is not known yet.\n *\n * @generated from message importhub.v1.ImportProgress\n */\nexport type ImportProgress = Message<\"importhub.v1.ImportProgress\"> & {\n /**\n * @generated from field: int32 done = 1;\n */\n done: number;\n\n /**\n * @generated from field: int32 total = 2;\n */\n total: number;\n};\n\n/**\n * Describes the message importhub.v1.ImportProgress.\n * Use `create(ImportProgressSchema)` to create a new message.\n */\nexport const ImportProgressSchema: GenMessage<ImportProgress> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 18);\n\n/**\n * ImportCounts are what an Import has done.\n *\n * @generated from message importhub.v1.ImportCounts\n */\nexport type ImportCounts = Message<\"importhub.v1.ImportCounts\"> & {\n /**\n * The Source Versions its Mappings matched in the Source File.\n *\n * @generated from field: int32 matched = 1;\n */\n matched: number;\n\n /**\n * The Content it created in its Change Set.\n *\n * @generated from field: int32 created = 2;\n */\n created: number;\n\n /**\n * The Item Problems it recorded: Source Versions it skipped.\n *\n * @generated from field: int32 problems = 3;\n */\n problems: number;\n\n /**\n * The new Planned Releases it gave Content that exists (ADR 0003).\n *\n * @generated from field: int32 planned = 4;\n */\n planned: number;\n\n /**\n * The Changed Versions it planned as corrections Superseding the\n * Release they matched.\n *\n * @generated from field: int32 corrected = 5;\n */\n corrected: number;\n\n /**\n * The Changed Versions it kept, as their Mapping says.\n *\n * @generated from field: int32 kept = 6;\n */\n kept: number;\n\n /**\n * The Source Versions already in contenthub, which it wrote nothing for.\n * A Stub Mapping's Source Key whose Content exists counts here: a Stub\n * Mapping never changes it.\n *\n * @generated from field: int32 unchanged = 7;\n */\n unchanged: number;\n\n /**\n * The Stubs it created for Source Keys of a Stub Mapping no Content had\n * (CONTEXT.md \"Stub Mapping\"); not counted in created.\n *\n * @generated from field: int32 stubbed = 8;\n */\n stubbed: number;\n\n /**\n * The references it could not resolve, saved without them: each is one\n * of its Item Problems too (CONTEXT.md \"Pending Reference\").\n *\n * @generated from field: int32 pending_references = 9;\n */\n pendingReferences: number;\n};\n\n/**\n * Describes the message importhub.v1.ImportCounts.\n * Use `create(ImportCountsSchema)` to create a new message.\n */\nexport const ImportCountsSchema: GenMessage<ImportCounts> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 19);\n\n/**\n * ImportReleases are the Configuration Releases an Import runs with.\n *\n * @generated from message importhub.v1.ImportReleases\n */\nexport type ImportReleases = Message<\"importhub.v1.ImportReleases\"> & {\n /**\n * @generated from field: importhub.v1.ConfigurationReleaseRef import_profile = 1;\n */\n importProfile?: ConfigurationReleaseRef | undefined;\n\n /**\n * In the Profile's order.\n *\n * @generated from field: repeated importhub.v1.ConfigurationReleaseRef mappings = 2;\n */\n mappings: ConfigurationReleaseRef[];\n\n /**\n * Unset when the Profile names no Entity Set.\n *\n * @generated from field: importhub.v1.ConfigurationReleaseRef entity_set = 3;\n */\n entitySet?: ConfigurationReleaseRef | undefined;\n};\n\n/**\n * Describes the message importhub.v1.ImportReleases.\n * Use `create(ImportReleasesSchema)` to create a new message.\n */\nexport const ImportReleasesSchema: GenMessage<ImportReleases> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 20);\n\n/**\n * ConfigurationReleaseRef names one Configuration Release.\n *\n * @generated from message importhub.v1.ConfigurationReleaseRef\n */\nexport type ConfigurationReleaseRef = Message<\"importhub.v1.ConfigurationReleaseRef\"> & {\n /**\n * The configuration's id.\n *\n * @generated from field: string configuration_id = 1;\n */\n configurationId: string;\n\n /**\n * Its name in that Release.\n *\n * @generated from field: string name = 2;\n */\n name: string;\n\n /**\n * The Release's id.\n *\n * @generated from field: string release_id = 3;\n */\n releaseId: string;\n\n /**\n * Its number among the configuration's Releases, 1 for the first.\n *\n * @generated from field: int32 number = 4;\n */\n number: number;\n};\n\n/**\n * Describes the message importhub.v1.ConfigurationReleaseRef.\n * Use `create(ConfigurationReleaseRefSchema)` to create a new message.\n */\nexport const ConfigurationReleaseRefSchema: GenMessage<ConfigurationReleaseRef> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import, 21);\n\n/**\n * ImportPhase is where an Import is.\n *\n * @generated from enum importhub.v1.ImportPhase\n */\nexport enum ImportPhase {\n /**\n * @generated from enum value: IMPORT_PHASE_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * Waiting for a worker.\n *\n * @generated from enum value: IMPORT_PHASE_QUEUED = 1;\n */\n QUEUED = 1,\n\n /**\n * Reading the Source File: Preprocessors, Mappings, Post-processors.\n *\n * @generated from enum value: IMPORT_PHASE_READING = 2;\n */\n READING = 2,\n\n /**\n * Writing the Change Set in contenthub.\n *\n * @generated from enum value: IMPORT_PHASE_WRITING = 3;\n */\n WRITING = 3,\n\n /**\n * Ended: outcome says how.\n *\n * @generated from enum value: IMPORT_PHASE_ENDED = 4;\n */\n ENDED = 4,\n}\n\n/**\n * Describes the enum importhub.v1.ImportPhase.\n */\nexport const ImportPhaseSchema: GenEnum<ImportPhase> = /*@__PURE__*/\n enumDesc(file_importhub_v1_import, 0);\n\n/**\n * ImportOutcome is how an Import ended (CONTEXT.md \"Import Outcome\").\n *\n * @generated from enum importhub.v1.ImportOutcome\n */\nexport enum ImportOutcome {\n /**\n * It has not ended.\n *\n * @generated from enum value: IMPORT_OUTCOME_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * Ended with no Item Problems.\n *\n * @generated from enum value: IMPORT_OUTCOME_SUCCEEDED = 1;\n */\n SUCCEEDED = 1,\n\n /**\n * Ended with Item Problems; its Change Set is kept for editors to fix.\n *\n * @generated from enum value: IMPORT_OUTCOME_SUCCEEDED_WITH_PROBLEMS = 2;\n */\n SUCCEEDED_WITH_PROBLEMS = 2,\n\n /**\n * The run as a whole stopped; failure_reason says why, and the Change\n * Set it opened is discarded.\n *\n * @generated from enum value: IMPORT_OUTCOME_FAILED = 3;\n */\n FAILED = 3,\n\n /**\n * A person stopped it; cancelled_by names them, and the Change Set it\n * opened is discarded.\n *\n * @generated from enum value: IMPORT_OUTCOME_CANCELLED = 4;\n */\n CANCELLED = 4,\n}\n\n/**\n * Describes the enum importhub.v1.ImportOutcome.\n */\nexport const ImportOutcomeSchema: GenEnum<ImportOutcome> = /*@__PURE__*/\n enumDesc(file_importhub_v1_import, 1);\n\n/**\n * ImportService runs Imports: one Import Profile's Release over one Source\n * File, filling exactly one contenthub Change Set (CONTEXT.md \"Import\", ADR\n * 0001).\n *\n * A person uploads the Source File straight into importhub's own blob store\n * with the URL CreateSourceFileUpload hands out, then starts the Import with\n * StartImport. Start pins the latest Configuration Release of the Profile, of\n * every Mapping it includes and of its Entity Set (ADR 0016), and queues the\n * Import; a `worker` claims it from the queue and runs it (ADR 0004).\n *\n * Every RPC acts on the caller's workspace, which comes from the token's\n * active workspace and never from a request field. Uploading, starting and\n * cancelling need `importer`; reading needs `viewer` (ADR 0010, control-who-may-import).\n *\n * @generated from service importhub.v1.ImportService\n */\nexport const ImportService: GenService<{\n /**\n * CreateSourceFileUpload makes a Source File and returns the URL to upload\n * its content to: a direct, write-only, short-lived URL into importhub's\n * blob container (a SAS URL), so a large file never passes through\n * importhub. Upload it with one `PUT` carrying `x-ms-blob-type:\n * BlockBlob`.\n *\n * @generated from rpc importhub.v1.ImportService.CreateSourceFileUpload\n */\n createSourceFileUpload: {\n methodKind: \"unary\";\n input: typeof CreateSourceFileUploadRequestSchema;\n output: typeof CreateSourceFileUploadResponseSchema;\n },\n /**\n * StartImport queues an Import of a Source File with an Import Profile.\n *\n * It is refused with FailedPrecondition, naming what stands in the way,\n * when the Profile, a Mapping it includes or its Entity Set has no\n * Release, or when what an Import would run of one is invalid now (a\n * Mapping whose Blueprint is gone, say): drafts are never run\n * (release-a-configuration:AC2, AC5). An unknown Profile or Source File is\n * NotFound, and a Source File nothing was uploaded to is FailedPrecondition.\n *\n * @generated from rpc importhub.v1.ImportService.StartImport\n */\n startImport: {\n methodKind: \"unary\";\n input: typeof StartImportRequestSchema;\n output: typeof StartImportResponseSchema;\n },\n /**\n * ListImports returns the workspace's Imports, newest first, each with its\n * Profile, its starter, its Outcome and its counts (follow-an-import:AC1).\n *\n * @generated from rpc importhub.v1.ImportService.ListImports\n */\n listImports: {\n methodKind: \"unary\";\n input: typeof ListImportsRequestSchema;\n output: typeof ListImportsResponseSchema;\n },\n /**\n * GetImport returns one Import with its phase and progress, its Change Set\n * and the exact Releases it runs with (follow-an-import:AC2, AC5,\n * release-a-configuration:AC8).\n *\n * @generated from rpc importhub.v1.ImportService.GetImport\n */\n getImport: {\n methodKind: \"unary\";\n input: typeof GetImportRequestSchema;\n output: typeof GetImportResponseSchema;\n },\n /**\n * CancelImport cancels an Import that has not ended (follow-an-import:AC6).\n * A queued Import ends Cancelled at once. A running one stops at its next\n * item: the worker discards the Change Set it opened and ends it Cancelled,\n * so the Import returned may still be running. Either way the Import names\n * the caller as who cancelled it. An Import that has ended is\n * FailedPrecondition; cancelling one already being cancelled changes\n * nothing.\n *\n * @generated from rpc importhub.v1.ImportService.CancelImport\n */\n cancelImport: {\n methodKind: \"unary\";\n input: typeof CancelImportRequestSchema;\n output: typeof CancelImportResponseSchema;\n },\n /**\n * ListItemProblems returns one page of an Import's Item Problems, in the\n * order they were recorded, filtered by Mapping and searched by Source Key,\n * with their counts (follow-an-import:AC4). A Pending Reference is one of\n * them, carrying what it names.\n *\n * @generated from rpc importhub.v1.ImportService.ListItemProblems\n */\n listItemProblems: {\n methodKind: \"unary\";\n input: typeof ListItemProblemsRequestSchema;\n output: typeof ListItemProblemsResponseSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_importhub_v1_import, 0);\n\n","// @generated by protoc-gen-es v2.13.0 with parameter \"target=ts\"\n// @generated from file importhub/v1/import_profile.proto (package importhub.v1, syntax proto3)\n/* eslint-disable */\n\nimport type { GenFile, GenMessage, GenService } from \"@bufbuild/protobuf/codegenv2\";\nimport { fileDesc, messageDesc, serviceDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport type { Timestamp } from \"@bufbuild/protobuf/wkt\";\nimport { file_google_protobuf_struct, file_google_protobuf_timestamp } from \"@bufbuild/protobuf/wkt\";\nimport type { ConfigurationRelease, ConfigurationRevision, ConfigurationState, FieldComparison, Validity } from \"./configuration_pb\";\nimport { file_importhub_v1_configuration } from \"./configuration_pb\";\nimport type { JsonObject, Message } from \"@bufbuild/protobuf\";\n\n/**\n * Describes the file importhub/v1/import_profile.proto.\n */\nexport const file_importhub_v1_import_profile: GenFile = /*@__PURE__*/\n fileDesc(\"CiFpbXBvcnRodWIvdjEvaW1wb3J0X3Byb2ZpbGUucHJvdG8SDGltcG9ydGh1Yi52MSKiAgoNSW1wb3J0UHJvZmlsZRIKCgJpZBgBIAEoCRITCgtyZXZpc2lvbl9pZBgCIAEoCRIzCgdjb250ZW50GAMgASgLMiIuaW1wb3J0aHViLnYxLkltcG9ydFByb2ZpbGVDb250ZW50EigKCHZhbGlkaXR5GAQgASgLMhYuaW1wb3J0aHViLnYxLlZhbGlkaXR5Ei8KBXN0YXRlGAUgASgLMiAuaW1wb3J0aHViLnYxLkNvbmZpZ3VyYXRpb25TdGF0ZRIuCgpjcmVhdGVkX2F0GAYgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcBIwChBjdXJyZW50X3ZhbGlkaXR5GAcgASgLMhYuaW1wb3J0aHViLnYxLlZhbGlkaXR5IowCChRJbXBvcnRQcm9maWxlQ29udGVudBIMCgRuYW1lGAEgASgJEhMKC2Rlc2NyaXB0aW9uGAIgASgJEhUKDWVudGl0eV9zZXRfaWQYAyABKAkSMgoNcHJlcHJvY2Vzc29ycxgEIAMoCzIbLmltcG9ydGh1Yi52MS5Qcm9jZXNzb3JTdGVwEhMKC21hcHBpbmdfaWRzGAUgAygJEjQKD3Bvc3RfcHJvY2Vzc29ycxgGIAMoCzIbLmltcG9ydGh1Yi52MS5Qcm9jZXNzb3JTdGVwEhQKDGF1dG9fcHVibGlzaBgHIAEoCBIlCh1kZWxldGVfc291cmNlX2ZpbGVfb25fc3VjY2VzcxgIIAEoCCJNCg1Q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GVIaXN0b3J5Ei0uaW1wb3J0aHViLnYxLkxpc3RJbXBvcnRQcm9maWxlSGlzdG9yeVJlcXVlc3QaLi5pbXBvcnRodWIudjEuTGlzdEltcG9ydFByb2ZpbGVIaXN0b3J5UmVzcG9uc2USiAEKHUNvbXBhcmVJbXBvcnRQcm9maWxlUmV2aXNpb25zEjIuaW1wb3J0aHViLnYxLkNvbXBhcmVJbXBvcnRQcm9maWxlUmV2aXNpb25zUmVxdWVzdBozLmltcG9ydGh1Yi52MS5Db21wYXJlSW1wb3J0UHJvZmlsZVJldmlzaW9uc1Jlc3BvbnNlEoUBChxSZXN0b3JlSW1wb3J0UHJvZmlsZVJldmlzaW9uEjEuaW1wb3J0aHViLnYxLlJlc3RvcmVJbXBvcnRQcm9maWxlUmV2aXNpb25SZXF1ZXN0GjIuaW1wb3J0aHViLnYxLlJlc3RvcmVJbXBvcnRQcm9maWxlUmV2aXNpb25SZXNwb25zZUI5WjdnaXRodWIuY29tL2tua2NzL2ltcG9ydGh1Yi9nZW4vaW1wb3J0aHViL3YxO2ltcG9ydGh1YnYxYgZwcm90bzM\", [file_google_protobuf_struct, file_google_protobuf_timestamp, file_importhub_v1_configuration]);\n\n/**\n * ImportProfile is one Import Profile, at one of its Revisions.\n *\n * @generated from message importhub.v1.ImportProfile\n */\nexport type ImportProfile = Message<\"importhub.v1.ImportProfile\"> & {\n /**\n * The Import Profile's id, a KSUID.\n *\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * The Revision this content is from: the draft, unless an older one was\n * asked for.\n *\n * @generated from field: string revision_id = 2;\n */\n revisionId: string;\n\n /**\n * The content at that Revision.\n *\n * @generated from field: importhub.v1.ImportProfileContent content = 3;\n */\n content?: ImportProfileContent | undefined;\n\n /**\n * Whether that Revision may be released, as decided when it was saved.\n *\n * @generated from field: importhub.v1.Validity validity = 4;\n */\n validity?: Validity | undefined;\n\n /**\n * Where the Profile stands: its draft and latest Release.\n *\n * @generated from field: importhub.v1.ConfigurationState state = 5;\n */\n state?: ConfigurationState | undefined;\n\n /**\n * When the Profile was created.\n *\n * @generated from field: google.protobuf.Timestamp created_at = 6;\n */\n createdAt?: Timestamp | undefined;\n\n /**\n * Whether the draft can be released now: its validity as saved, plus\n * what changed since without the Profile being saved, such as a Mapping\n * it includes becoming invalid (manage-import-profiles:AC6).\n *\n * @generated from field: importhub.v1.Validity current_validity = 7;\n */\n currentValidity?: Validity | undefined;\n};\n\n/**\n * Describes the message importhub.v1.ImportProfile.\n * Use `create(ImportProfileSchema)` to create a new message.\n */\nexport const ImportProfileSchema: GenMessage<ImportProfile> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 0);\n\n/**\n * ImportProfileContent is what an admin edits, and what a Revision holds.\n *\n * @generated from message importhub.v1.ImportProfileContent\n */\nexport type ImportProfileContent = Message<\"importhub.v1.ImportProfileContent\"> & {\n /**\n * The Profile's name, unique in the workspace.\n *\n * @generated from field: string name = 1;\n */\n name: string;\n\n /**\n * What the Profile is for; free text.\n *\n * @generated from field: string description = 2;\n */\n description: string;\n\n /**\n * The id of the Entity Set the Source File is read with; empty for none.\n *\n * @generated from field: string entity_set_id = 3;\n */\n entitySetId: string;\n\n /**\n * The Preprocessors, in the order they run on the Source File.\n *\n * @generated from field: repeated importhub.v1.ProcessorStep preprocessors = 4;\n */\n preprocessors: ProcessorStep[];\n\n /**\n * The ids of the Mappings it includes, in the order they run.\n *\n * @generated from field: repeated string mapping_ids = 5;\n */\n mappingIds: string[];\n\n /**\n * The Post-processors, in the order they run on the mapped Source\n * Versions.\n *\n * @generated from field: repeated importhub.v1.ProcessorStep post_processors = 6;\n */\n postProcessors: ProcessorStep[];\n\n /**\n * Publish the Change Set of an Import that Succeeds without Item\n * Problems (CONTEXT.md \"Auto-publish\").\n *\n * @generated from field: bool auto_publish = 7;\n */\n autoPublish: boolean;\n\n /**\n * Delete the Source File as soon as an Import Succeeds without Item\n * Problems, instead of after the retention period.\n *\n * @generated from field: bool delete_source_file_on_success = 8;\n */\n deleteSourceFileOnSuccess: boolean;\n};\n\n/**\n * Describes the message importhub.v1.ImportProfileContent.\n * Use `create(ImportProfileContentSchema)` to create a new message.\n */\nexport const ImportProfileContentSchema: GenMessage<ImportProfileContent> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 1);\n\n/**\n * ProcessorStep is one Processor in a Profile's pipeline, with its settings.\n *\n * @generated from message importhub.v1.ProcessorStep\n */\nexport type ProcessorStep = Message<\"importhub.v1.ProcessorStep\"> & {\n /**\n * The Processor, by its name in the catalogue.\n *\n * @generated from field: string processor = 1;\n */\n processor: string;\n\n /**\n * Its settings: one value per setting of its settings spec, by the\n * setting's `api_accessor`.\n *\n * @generated from field: google.protobuf.Struct settings = 2;\n */\n settings?: JsonObject | undefined;\n};\n\n/**\n * Describes the message importhub.v1.ProcessorStep.\n * Use `create(ProcessorStepSchema)` to create a new message.\n */\nexport const ProcessorStepSchema: GenMessage<ProcessorStep> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 2);\n\n/**\n * @generated from message importhub.v1.ListImportProfilesRequest\n */\nexport type ListImportProfilesRequest = Message<\"importhub.v1.ListImportProfilesRequest\"> & {\n};\n\n/**\n * Describes the message importhub.v1.ListImportProfilesRequest.\n * Use `create(ListImportProfilesRequestSchema)` to create a new message.\n */\nexport const ListImportProfilesRequestSchema: GenMessage<ListImportProfilesRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 3);\n\n/**\n * @generated from message importhub.v1.ListImportProfilesResponse\n */\nexport type ListImportProfilesResponse = Message<\"importhub.v1.ListImportProfilesResponse\"> & {\n /**\n * @generated from field: repeated importhub.v1.ImportProfile import_profiles = 1;\n */\n importProfiles: ImportProfile[];\n};\n\n/**\n * Describes the message importhub.v1.ListImportProfilesResponse.\n * Use `create(ListImportProfilesResponseSchema)` to create a new message.\n */\nexport const ListImportProfilesResponseSchema: GenMessage<ListImportProfilesResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 4);\n\n/**\n * @generated from message importhub.v1.GetImportProfileRequest\n */\nexport type GetImportProfileRequest = Message<\"importhub.v1.GetImportProfileRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * An older Revision to read the content of; empty for the draft.\n *\n * @generated from field: string revision_id = 2;\n */\n revisionId: string;\n};\n\n/**\n * Describes the message importhub.v1.GetImportProfileRequest.\n * Use `create(GetImportProfileRequestSchema)` to create a new message.\n */\nexport const GetImportProfileRequestSchema: GenMessage<GetImportProfileRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 5);\n\n/**\n * @generated from message importhub.v1.GetImportProfileResponse\n */\nexport type GetImportProfileResponse = Message<\"importhub.v1.GetImportProfileResponse\"> & {\n /**\n * @generated from field: importhub.v1.ImportProfile import_profile = 1;\n */\n importProfile?: ImportProfile | undefined;\n};\n\n/**\n * Describes the message importhub.v1.GetImportProfileResponse.\n * Use `create(GetImportProfileResponseSchema)` to create a new message.\n */\nexport const GetImportProfileResponseSchema: GenMessage<GetImportProfileResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 6);\n\n/**\n * @generated from message importhub.v1.CreateImportProfileRequest\n */\nexport type CreateImportProfileRequest = Message<\"importhub.v1.CreateImportProfileRequest\"> & {\n /**\n * @generated from field: importhub.v1.ImportProfileContent content = 1;\n */\n content?: ImportProfileContent | undefined;\n};\n\n/**\n * Describes the message importhub.v1.CreateImportProfileRequest.\n * Use `create(CreateImportProfileRequestSchema)` to create a new message.\n */\nexport const CreateImportProfileRequestSchema: GenMessage<CreateImportProfileRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 7);\n\n/**\n * @generated from message importhub.v1.CreateImportProfileResponse\n */\nexport type CreateImportProfileResponse = Message<\"importhub.v1.CreateImportProfileResponse\"> & {\n /**\n * @generated from field: importhub.v1.ImportProfile import_profile = 1;\n */\n importProfile?: ImportProfile | undefined;\n};\n\n/**\n * Describes the message importhub.v1.CreateImportProfileResponse.\n * Use `create(CreateImportProfileResponseSchema)` to create a new message.\n */\nexport const CreateImportProfileResponseSchema: GenMessage<CreateImportProfileResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 8);\n\n/**\n * @generated from message importhub.v1.UpdateImportProfileRequest\n */\nexport type UpdateImportProfileRequest = Message<\"importhub.v1.UpdateImportProfileRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * The whole new content; it replaces the draft's.\n *\n * @generated from field: importhub.v1.ImportProfileContent content = 2;\n */\n content?: ImportProfileContent | undefined;\n\n /**\n * The draft this edit was made on. Given, the save is refused if the\n * draft has moved since; empty, it saves on whatever the draft is.\n *\n * @generated from field: string draft_revision_id = 3;\n */\n draftRevisionId: string;\n};\n\n/**\n * Describes the message importhub.v1.UpdateImportProfileRequest.\n * Use `create(UpdateImportProfileRequestSchema)` to create a new message.\n */\nexport const UpdateImportProfileRequestSchema: GenMessage<UpdateImportProfileRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 9);\n\n/**\n * @generated from message importhub.v1.UpdateImportProfileResponse\n */\nexport type UpdateImportProfileResponse = Message<\"importhub.v1.UpdateImportProfileResponse\"> & {\n /**\n * @generated from field: importhub.v1.ImportProfile import_profile = 1;\n */\n importProfile?: ImportProfile | undefined;\n};\n\n/**\n * Describes the message importhub.v1.UpdateImportProfileResponse.\n * Use `create(UpdateImportProfileResponseSchema)` to create a new message.\n */\nexport const UpdateImportProfileResponseSchema: GenMessage<UpdateImportProfileResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 10);\n\n/**\n * @generated from message importhub.v1.DeleteImportProfileRequest\n */\nexport type DeleteImportProfileRequest = Message<\"importhub.v1.DeleteImportProfileRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n};\n\n/**\n * Describes the message importhub.v1.DeleteImportProfileRequest.\n * Use `create(DeleteImportProfileRequestSchema)` to create a new message.\n */\nexport const DeleteImportProfileRequestSchema: GenMessage<DeleteImportProfileRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 11);\n\n/**\n * @generated from message importhub.v1.DeleteImportProfileResponse\n */\nexport type DeleteImportProfileResponse = Message<\"importhub.v1.DeleteImportProfileResponse\"> & {\n};\n\n/**\n * Describes the message importhub.v1.DeleteImportProfileResponse.\n * Use `create(DeleteImportProfileResponseSchema)` to create a new message.\n */\nexport const DeleteImportProfileResponseSchema: GenMessage<DeleteImportProfileResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 12);\n\n/**\n * @generated from message importhub.v1.CutImportProfileReleaseRequest\n */\nexport type CutImportProfileReleaseRequest = Message<\"importhub.v1.CutImportProfileReleaseRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * The draft the admin is releasing. Given, the cut is refused if the\n * draft has moved since.\n *\n * @generated from field: string draft_revision_id = 2;\n */\n draftRevisionId: string;\n};\n\n/**\n * Describes the message importhub.v1.CutImportProfileReleaseRequest.\n * Use `create(CutImportProfileReleaseRequestSchema)` to create a new message.\n */\nexport const CutImportProfileReleaseRequestSchema: GenMessage<CutImportProfileReleaseRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 13);\n\n/**\n * @generated from message importhub.v1.CutImportProfileReleaseResponse\n */\nexport type CutImportProfileReleaseResponse = Message<\"importhub.v1.CutImportProfileReleaseResponse\"> & {\n /**\n * The Release cut.\n *\n * @generated from field: importhub.v1.ConfigurationRelease release = 1;\n */\n release?: ConfigurationRelease | undefined;\n\n /**\n * The Profile after the cut.\n *\n * @generated from field: importhub.v1.ImportProfile import_profile = 2;\n */\n importProfile?: ImportProfile | undefined;\n};\n\n/**\n * Describes the message importhub.v1.CutImportProfileReleaseResponse.\n * Use `create(CutImportProfileReleaseResponseSchema)` to create a new message.\n */\nexport const CutImportProfileReleaseResponseSchema: GenMessage<CutImportProfileReleaseResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 14);\n\n/**\n * @generated from message importhub.v1.ListImportProfileHistoryRequest\n */\nexport type ListImportProfileHistoryRequest = Message<\"importhub.v1.ListImportProfileHistoryRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * Revisions per page; 0 means 100, and at most 1000.\n *\n * @generated from field: int32 page_size = 2;\n */\n pageSize: number;\n\n /**\n * The next_page_token of the previous page; empty for the first.\n *\n * @generated from field: string page_token = 3;\n */\n pageToken: string;\n};\n\n/**\n * Describes the message importhub.v1.ListImportProfileHistoryRequest.\n * Use `create(ListImportProfileHistoryRequestSchema)` to create a new message.\n */\nexport const ListImportProfileHistoryRequestSchema: GenMessage<ListImportProfileHistoryRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 15);\n\n/**\n * @generated from message importhub.v1.ListImportProfileHistoryResponse\n */\nexport type ListImportProfileHistoryResponse = Message<\"importhub.v1.ListImportProfileHistoryResponse\"> & {\n /**\n * One page of Revisions, newest first.\n *\n * @generated from field: repeated importhub.v1.ConfigurationRevision revisions = 1;\n */\n revisions: ConfigurationRevision[];\n\n /**\n * Every Release, newest first, on every page.\n *\n * @generated from field: repeated importhub.v1.ConfigurationRelease releases = 2;\n */\n releases: ConfigurationRelease[];\n\n /**\n * The page_token of the next page; empty on the last.\n *\n * @generated from field: string next_page_token = 3;\n */\n nextPageToken: string;\n};\n\n/**\n * Describes the message importhub.v1.ListImportProfileHistoryResponse.\n * Use `create(ListImportProfileHistoryResponseSchema)` to create a new message.\n */\nexport const ListImportProfileHistoryResponseSchema: GenMessage<ListImportProfileHistoryResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 16);\n\n/**\n * @generated from message importhub.v1.CompareImportProfileRevisionsRequest\n */\nexport type CompareImportProfileRevisionsRequest = Message<\"importhub.v1.CompareImportProfileRevisionsRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * @generated from field: string from_revision_id = 2;\n */\n fromRevisionId: string;\n\n /**\n * @generated from field: string to_revision_id = 3;\n */\n toRevisionId: string;\n};\n\n/**\n * Describes the message importhub.v1.CompareImportProfileRevisionsRequest.\n * Use `create(CompareImportProfileRevisionsRequestSchema)` to create a new message.\n */\nexport const CompareImportProfileRevisionsRequestSchema: GenMessage<CompareImportProfileRevisionsRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 17);\n\n/**\n * @generated from message importhub.v1.CompareImportProfileRevisionsResponse\n */\nexport type CompareImportProfileRevisionsResponse = Message<\"importhub.v1.CompareImportProfileRevisionsResponse\"> & {\n /**\n * @generated from field: importhub.v1.ImportProfile from = 1;\n */\n from?: ImportProfile | undefined;\n\n /**\n * @generated from field: importhub.v1.ImportProfile to = 2;\n */\n to?: ImportProfile | undefined;\n\n /**\n * Each field, and how it differs from `from` to `to`.\n *\n * @generated from field: repeated importhub.v1.FieldComparison fields = 3;\n */\n fields: FieldComparison[];\n};\n\n/**\n * Describes the message importhub.v1.CompareImportProfileRevisionsResponse.\n * Use `create(CompareImportProfileRevisionsResponseSchema)` to create a new message.\n */\nexport const CompareImportProfileRevisionsResponseSchema: GenMessage<CompareImportProfileRevisionsResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 18);\n\n/**\n * @generated from message importhub.v1.RestoreImportProfileRevisionRequest\n */\nexport type RestoreImportProfileRevisionRequest = Message<\"importhub.v1.RestoreImportProfileRevisionRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * The older Revision whose content becomes the new draft.\n *\n * @generated from field: string revision_id = 2;\n */\n revisionId: string;\n\n /**\n * As UpdateImportProfileRequest's.\n *\n * @generated from field: string draft_revision_id = 3;\n */\n draftRevisionId: string;\n};\n\n/**\n * Describes the message importhub.v1.RestoreImportProfileRevisionRequest.\n * Use `create(RestoreImportProfileRevisionRequestSchema)` to create a new message.\n */\nexport const RestoreImportProfileRevisionRequestSchema: GenMessage<RestoreImportProfileRevisionRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 19);\n\n/**\n * @generated from message importhub.v1.RestoreImportProfileRevisionResponse\n */\nexport type RestoreImportProfileRevisionResponse = Message<\"importhub.v1.RestoreImportProfileRevisionResponse\"> & {\n /**\n * @generated from field: importhub.v1.ImportProfile import_profile = 1;\n */\n importProfile?: ImportProfile | undefined;\n};\n\n/**\n * Describes the message importhub.v1.RestoreImportProfileRevisionResponse.\n * Use `create(RestoreImportProfileRevisionResponseSchema)` to create a new message.\n */\nexport const RestoreImportProfileRevisionResponseSchema: GenMessage<RestoreImportProfileRevisionResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_import_profile, 20);\n\n/**\n * ImportProfileService holds the workspace's Import Profiles: the named\n * recipes an Import runs, one per kind of Source File (CONTEXT.md,\n * manage-import-profiles). A Profile names at most one Entity Set, its\n * Preprocessors, the Mappings it includes and its Post-processors, in order,\n * and what happens to the result.\n *\n * An Import Profile is versioned configuration (ADR 0016): every create,\n * update and restore saves a draft Revision, and an admin cuts a\n * Configuration Release from a valid draft. A Profile names its Mappings and\n * its Entity Set by id, not their Releases: an Import takes the latest\n * Release of each when it starts.\n *\n * Every RPC acts on the caller's workspace, which comes from the token's\n * active workspace and never from a request field. Reads need `viewer`;\n * every write needs `admin` (ADR 0010, control-who-may-import:AC3).\n *\n * The validity reason codes of an Import Profile, decided when it is saved:\n *\n * - `unknown_processor`: a step names a Processor the catalogue does not\n * list (ProcessorService).\n * - `wrong_processor_kind`: a Post-processor listed among the\n * Preprocessors, or the other way round.\n * - `rich_text_processor`: a Processor that works on one rich-text field,\n * which a Mapping's field configures, listed on the Profile.\n * - `invalid_processor_settings`: a setting the Processor does not take, a\n * required one left out, or a value of the wrong type.\n * - `no_mappings`: it includes no Mapping.\n * - `duplicate_mapping`: it includes one Mapping twice.\n * - `mapping_missing`: it includes a Mapping that does not exist.\n * - `entity_set_missing`: it names an Entity Set that does not exist.\n *\n * And the ones current_validity adds, decided at each read and when a Release\n * is cut, since they change without the Profile being saved\n * (manage-import-profiles:AC6):\n *\n * - `mapping_invalid`: what an Import would run of a Mapping it includes\n * is invalid now: its latest Release, when its Blueprint is gone, or,\n * while it has no Release, its draft. The message names the Mapping and\n * its reasons.\n * - `entity_set_invalid`: the Entity Set it names has no Release and an\n * invalid draft (a Release was valid when cut).\n * - `mapping_missing`, `entity_set_missing`, as above, once deleted.\n *\n * @generated from service importhub.v1.ImportProfileService\n */\nexport const ImportProfileService: GenService<{\n /**\n * ListImportProfiles returns every Import Profile of the workspace, by\n * name, each with its draft, its latest Release and whether it is valid\n * now. A workspace keeps a handful, so the list is not paged.\n *\n * @generated from rpc importhub.v1.ImportProfileService.ListImportProfiles\n */\n listImportProfiles: {\n methodKind: \"unary\";\n input: typeof ListImportProfilesRequestSchema;\n output: typeof ListImportProfilesResponseSchema;\n },\n /**\n * GetImportProfile returns one Import Profile with its draft, or with an\n * older Revision of it when one is named.\n *\n * @generated from rpc importhub.v1.ImportProfileService.GetImportProfile\n */\n getImportProfile: {\n methodKind: \"unary\";\n input: typeof GetImportProfileRequestSchema;\n output: typeof GetImportProfileResponseSchema;\n },\n /**\n * CreateImportProfile creates an Import Profile, its content the first\n * draft. Invalid settings are saved and marked invalid with their\n * reasons; a missing name, or one another Profile of the workspace has,\n * is refused (InvalidArgument, AlreadyExists).\n *\n * @generated from rpc importhub.v1.ImportProfileService.CreateImportProfile\n */\n createImportProfile: {\n methodKind: \"unary\";\n input: typeof CreateImportProfileRequestSchema;\n output: typeof CreateImportProfileResponseSchema;\n },\n /**\n * UpdateImportProfile saves new content as a new draft Revision. It is\n * refused with FailedPrecondition when draft_revision_id is given and is\n * no longer the draft.\n *\n * @generated from rpc importhub.v1.ImportProfileService.UpdateImportProfile\n */\n updateImportProfile: {\n methodKind: \"unary\";\n input: typeof UpdateImportProfileRequestSchema;\n output: typeof UpdateImportProfileResponseSchema;\n },\n /**\n * DeleteImportProfile deletes an Import Profile; it no longer appears in\n * the list, and its name is free again.\n *\n * @generated from rpc importhub.v1.ImportProfileService.DeleteImportProfile\n */\n deleteImportProfile: {\n methodKind: \"unary\";\n input: typeof DeleteImportProfileRequestSchema;\n output: typeof DeleteImportProfileResponseSchema;\n },\n /**\n * CutImportProfileRelease cuts a Configuration Release from the draft. It\n * is refused with FailedPrecondition, the Validity as a detail, when the\n * draft is not valid now (current_validity: an included Mapping that is\n * invalid refuses it too), when the draft does not differ from the latest\n * Release, or when draft_revision_id is given and is no longer the draft.\n *\n * @generated from rpc importhub.v1.ImportProfileService.CutImportProfileRelease\n */\n cutImportProfileRelease: {\n methodKind: \"unary\";\n input: typeof CutImportProfileReleaseRequestSchema;\n output: typeof CutImportProfileReleaseResponseSchema;\n },\n /**\n * ListImportProfileHistory lists an Import Profile's Revisions, newest\n * first and paged, and all its Releases (release-a-configuration:AC6).\n *\n * @generated from rpc importhub.v1.ImportProfileService.ListImportProfileHistory\n */\n listImportProfileHistory: {\n methodKind: \"unary\";\n input: typeof ListImportProfileHistoryRequestSchema;\n output: typeof ListImportProfileHistoryResponseSchema;\n },\n /**\n * CompareImportProfileRevisions compares two Revisions of one Import\n * Profile: both contents, and how each field differs.\n *\n * @generated from rpc importhub.v1.ImportProfileService.CompareImportProfileRevisions\n */\n compareImportProfileRevisions: {\n methodKind: \"unary\";\n input: typeof CompareImportProfileRevisionsRequestSchema;\n output: typeof CompareImportProfileRevisionsResponseSchema;\n },\n /**\n * RestoreImportProfileRevision saves an older Revision's content as a new\n * draft (release-a-configuration:AC7), its validity decided anew.\n *\n * @generated from rpc importhub.v1.ImportProfileService.RestoreImportProfileRevision\n */\n restoreImportProfileRevision: {\n methodKind: \"unary\";\n input: typeof RestoreImportProfileRevisionRequestSchema;\n output: typeof RestoreImportProfileRevisionResponseSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_importhub_v1_import_profile, 0);\n\n","// @generated by protoc-gen-es v2.13.0 with parameter \"target=ts\"\n// @generated from file importhub/v1/mapping.proto (package importhub.v1, syntax proto3)\n/* eslint-disable */\n\nimport type { GenEnum, GenFile, GenMessage, GenService } from \"@bufbuild/protobuf/codegenv2\";\nimport { enumDesc, fileDesc, messageDesc, serviceDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport type { Timestamp } from \"@bufbuild/protobuf/wkt\";\nimport { file_google_protobuf_struct, file_google_protobuf_timestamp } from \"@bufbuild/protobuf/wkt\";\nimport type { ConfigurationRelease, ConfigurationRevision, ConfigurationState, FieldComparison, ImportProfileRef, Validity } from \"./configuration_pb\";\nimport { file_importhub_v1_configuration } from \"./configuration_pb\";\nimport type { JsonObject, Message } from \"@bufbuild/protobuf\";\n\n/**\n * Describes the file importhub/v1/mapping.proto.\n */\nexport const file_importhub_v1_mapping: GenFile = /*@__PURE__*/\n fileDesc(\"ChppbXBvcnRodWIvdjEvbWFwcGluZy5wcm90bxIMaW1wb3J0aHViLnYxIpYCCgdNYXBwaW5nEgoKAmlkGAEgASgJEhMKC3JldmlzaW9uX2lkGAIgASgJEi0KB2NvbnRlbnQYAyABKAsyHC5pbXBvcnRodWIudjEuTWFwcGluZ0NvbnRlbnQSKAoIdmFsaWRpdHkYBCABKAsyFi5pbXBvcnRodWIudjEuVmFsaWRpdHkSLwoFc3RhdGUYBSABKAsyIC5pbXBvcnRodWIudjEuQ29uZmlndXJhdGlvblN0YXRlEi4KCmNyZWF0ZWRfYXQYBiABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEjAKEGN1cnJlbnRfdmFsaWRpdHkYByABKAsyFi5pbXBvcnRodWIudjEuVmFsaWRpdHki0wUKDk1hcHBpbmdDb250ZW50EgwKBG5hbWUYASABKAkSEwoLZGVzY3JpcHRpb24YAiABKAkSFAoMYmx1ZXByaW50X2lkGAMgASgJEhwKFGJsdWVwcmludF9yZWxlYXNlX2lkGAQgASgJEhgKEGVsZW1lbnRfc2VsZWN0b3IYBSABKAkSKwoKc291cmNlX2tleRgGIAEoCzIXLmltcG9ydGh1Yi52MS5Tb3VyY2VLZXkSJwoGZmllbGRzGAcgAygLMhcuZ29vZ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ChlMaXN0TWFwcGluZ0ltcG9ydFByb2ZpbGVzEi4uaW1wb3J0aHViLnYxLkxpc3RNYXBwaW5nSW1wb3J0UHJvZmlsZXNSZXF1ZXN0Gi8uaW1wb3J0aHViLnYxLkxpc3RNYXBwaW5nSW1wb3J0UHJvZmlsZXNSZXNwb25zZRKFAQocQ2hlY2tNYXBwaW5nQmx1ZXByaW50UmVsZWFzZRIxLmltcG9ydGh1Yi52MS5DaGVja01hcHBpbmdCbHVlcHJpbnRSZWxlYXNlUmVxdWVzdBoyLmltcG9ydGh1Yi52MS5DaGVja01hcHBpbmdCbHVlcHJpbnRSZWxlYXNlUmVzcG9uc2VCOVo3Z2l0aHViLmNvbS9rbmtjcy9pbXBvcnRodWIvZ2VuL2ltcG9ydGh1Yi92MTtpbXBvcnRodWJ2MWIGcHJvdG8z\", [file_google_protobuf_struct, file_google_protobuf_timestamp, file_importhub_v1_configuration]);\n\n/**\n * Mapping is one Mapping, at one of its Revisions.\n *\n * @generated from message importhub.v1.Mapping\n */\nexport type Mapping = Message<\"importhub.v1.Mapping\"> & {\n /**\n * The Mapping's id, a KSUID.\n *\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * The Revision this content is from: the draft, unless an older one was\n * asked for.\n *\n * @generated from field: string revision_id = 2;\n */\n revisionId: string;\n\n /**\n * The content at that Revision.\n *\n * @generated from field: importhub.v1.MappingContent content = 3;\n */\n content?: MappingContent | undefined;\n\n /**\n * Whether that Revision may be released, as decided when it was saved.\n *\n * @generated from field: importhub.v1.Validity validity = 4;\n */\n validity?: Validity | undefined;\n\n /**\n * Where the Mapping stands: its draft and latest Release.\n *\n * @generated from field: importhub.v1.ConfigurationState state = 5;\n */\n state?: ConfigurationState | undefined;\n\n /**\n * When the Mapping was created.\n *\n * @generated from field: google.protobuf.Timestamp created_at = 6;\n */\n createdAt?: Timestamp | undefined;\n\n /**\n * Whether the draft can be released now: its validity as saved, plus\n * `blueprint_gone` when blueprinthub no longer knows a Release the draft\n * or the latest Release pins (manage-mappings:AC7).\n *\n * @generated from field: importhub.v1.Validity current_validity = 7;\n */\n currentValidity?: Validity | undefined;\n};\n\n/**\n * Describes the message importhub.v1.Mapping.\n * Use `create(MappingSchema)` to create a new message.\n */\nexport const MappingSchema: GenMessage<Mapping> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 0);\n\n/**\n * MappingContent is what an admin edits, and what a Revision holds. Every\n * setting is defined here, including those whose behaviour later Tasks\n * build, so the structured editor is built against one shape.\n *\n * @generated from message importhub.v1.MappingContent\n */\nexport type MappingContent = Message<\"importhub.v1.MappingContent\"> & {\n /**\n * The Mapping's name, unique in the workspace.\n *\n * @generated from field: string name = 1;\n */\n name: string;\n\n /**\n * What the Mapping is for; free text.\n *\n * @generated from field: string description = 2;\n */\n description: string;\n\n /**\n * The target Blueprint in blueprinthub.\n *\n * @generated from field: string blueprint_id = 3;\n */\n blueprintId: string;\n\n /**\n * The Blueprint Release it pins, a Release of blueprint_id. Every Import\n * creates Content on exactly this Release (ADR 0002).\n *\n * @generated from field: string blueprint_release_id = 4;\n */\n blueprintReleaseId: string;\n\n /**\n * The XPath selecting the source elements that each become one Content.\n *\n * @generated from field: string element_selector = 5;\n */\n elementSelector: string;\n\n /**\n * How each element's Source Key is extracted.\n *\n * @generated from field: importhub.v1.SourceKey source_key = 6;\n */\n sourceKey?: SourceKey | undefined;\n\n /**\n * The field mappings, each an xmlmapper FieldMapping object (`name`,\n * `selector`, `type` and the options of its type, xmlmapper's JSON keys):\n * `name` is the field path in the pinned Release, and a fieldset's or a\n * virtual table's children are named relative to it. Every key is kept\n * as given, including those the structured editor has no form for\n * (edit-a-mapping-in-the-structured-editor:AC3).\n *\n * @generated from field: repeated google.protobuf.Struct fields = 7;\n */\n fields: JsonObject[];\n\n /**\n * The values that decide whether a Source Version is already in\n * contenthub (CONTEXT.md \"Version Match\"). Unset: each element is a\n * single version, compared with Main's head.\n *\n * @generated from field: importhub.v1.VersionMatch version_match = 8;\n */\n versionMatch?: VersionMatch | undefined;\n\n /**\n * Where a Source Version's Validity Period is read from; unset when the\n * source carries none (the Import's effective date applies).\n *\n * @generated from field: importhub.v1.ValidityPeriodSource validity_period = 9;\n */\n validityPeriod?: ValidityPeriodSource | undefined;\n\n /**\n * Where a Source Version's Release Spec values are read from.\n *\n * @generated from field: repeated importhub.v1.ReleaseSpecSource release_spec = 10;\n */\n releaseSpec: ReleaseSpecSource[];\n\n /**\n * What happens to a Changed Version.\n *\n * @generated from field: importhub.v1.ChangedVersionHandling changed_version = 11;\n */\n changedVersion: ChangedVersionHandling;\n\n /**\n * A Stub Mapping: for each Source Key no Content has yet, it creates\n * Content holding only the Content Key and the fields it maps, and never\n * changes existing Content (CONTEXT.md \"Stub Mapping\").\n *\n * @generated from field: bool stub = 12;\n */\n stub: boolean;\n\n /**\n * The per-Ausgabe data written onto Titles (CONTEXT.md \"Title\n * Contribution\").\n *\n * @generated from field: repeated importhub.v1.TitleContribution title_contributions = 13;\n */\n titleContributions: TitleContribution[];\n\n /**\n * How each Content's Collection is derived from the source.\n *\n * @generated from field: importhub.v1.CollectionRouting collection_routing = 14;\n */\n collectionRouting?: CollectionRouting | undefined;\n\n /**\n * The names of the Collections every Content of the Mapping is filed\n * into, beside what collection_routing derives. Each names exactly one of\n * the workspace's Collections in contenthub; a name none or several have\n * is an Item Problem, and the Content is not written. New Content is\n * created in its Collections; Content that exists is filed into them\n * besides those it is in.\n *\n * @generated from field: repeated string collections = 15;\n */\n collections: string[];\n\n /**\n * The display name of each Content, with field paths in braces, such as\n * `{titelnum} — {titel}`; `{titel:40}` keeps at most 40 characters, an\n * ellipsis marking a cut. A field path that names no mapped value is an\n * Item Problem, and the name is then not written. contenthub holds no\n * display name of its own, so the name is written into the field\n * display_name_field names; template and field are set together.\n *\n * @generated from field: string display_name_template = 16;\n */\n displayNameTemplate: string;\n\n /**\n * The file references that become Placeholder Assets in mediahub.\n *\n * @generated from field: repeated importhub.v1.PlaceholderAssets placeholder_assets = 17;\n */\n placeholderAssets: PlaceholderAssets[];\n\n /**\n * The field path, in the pinned Blueprint Release, that receives each\n * Content's display name: a plain-text field (`text` or `textarea`) the\n * Mapping does not also map, outside any virtual table. Set with\n * display_name_template, or neither. Created Content and every new\n * Revision on a re-import carry the name there; when a placeholder names\n * no mapped value, the field is left as the mapped data has it.\n *\n * @generated from field: string display_name_field = 18;\n */\n displayNameField: string;\n};\n\n/**\n * Describes the message importhub.v1.MappingContent.\n * Use `create(MappingContentSchema)` to create a new message.\n */\nexport const MappingContentSchema: GenMessage<MappingContent> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 1);\n\n/**\n * SourceKey says how the Source Key is extracted from an element: by\n * selector, or by template, which wins when both are set (xmlmapper's\n * idSelector and idTemplate).\n *\n * @generated from message importhub.v1.SourceKey\n */\nexport type SourceKey = Message<\"importhub.v1.SourceKey\"> & {\n /**\n * An XPath, relative to the element, whose value is the Source Key.\n *\n * @generated from field: string selector = 1;\n */\n selector: string;\n\n /**\n * The Source Key built from XPath expressions in braces, such as\n * `{ancestor::gesetz/@refid}-{@nr}`.\n *\n * @generated from field: string template = 2;\n */\n template: string;\n\n /**\n * A regular expression applied to each placeholder's value; its capture\n * groups replace a value it matches (xmlmapper's idExtractPattern).\n *\n * @generated from field: string extract_pattern = 3;\n */\n extractPattern: string;\n\n /**\n * Joins the capture groups; `-` when unset (idExtractSeparator).\n *\n * @generated from field: optional string extract_separator = 4;\n */\n extractSeparator?: string | undefined;\n\n /**\n * Removes all whitespace from the Source Key (idNormalize).\n *\n * @generated from field: bool normalize = 5;\n */\n normalize: boolean;\n};\n\n/**\n * Describes the message importhub.v1.SourceKey.\n * Use `create(SourceKeySchema)` to create a new message.\n */\nexport const SourceKeySchema: GenMessage<SourceKey> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 2);\n\n/**\n * VersionMatch is any combination of the Validity Period, Release Spec fields\n * and content fields. A Source Version matches an existing Release of the\n * same Content whose values are all equal.\n *\n * @generated from message importhub.v1.VersionMatch\n */\nexport type VersionMatch = Message<\"importhub.v1.VersionMatch\"> & {\n /**\n * Compare the Validity Period.\n *\n * @generated from field: bool validity_period = 1;\n */\n validityPeriod: boolean;\n\n /**\n * The Release Spec fields to compare, by path.\n *\n * @generated from field: repeated string release_spec_fields = 2;\n */\n releaseSpecFields: string[];\n\n /**\n * The content fields to compare, by path; each must be mapped.\n *\n * @generated from field: repeated string content_fields = 3;\n */\n contentFields: string[];\n};\n\n/**\n * Describes the message importhub.v1.VersionMatch.\n * Use `create(VersionMatchSchema)` to create a new message.\n */\nexport const VersionMatchSchema: GenMessage<VersionMatch> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 3);\n\n/**\n * ValidityPeriodSource is where the Validity Period of a Source Version is\n * read from.\n *\n * @generated from message importhub.v1.ValidityPeriodSource\n */\nexport type ValidityPeriodSource = Message<\"importhub.v1.ValidityPeriodSource\"> & {\n /**\n * An XPath, relative to the element, for the first day it is valid.\n *\n * @generated from field: string valid_from_selector = 1;\n */\n validFromSelector: string;\n\n /**\n * An XPath for the last day; empty for open-ended.\n *\n * @generated from field: string valid_to_selector = 2;\n */\n validToSelector: string;\n\n /**\n * Go time layouts the dates are read with, tried in order; ISO dates\n * (`2006-01-02`) when empty.\n *\n * @generated from field: repeated string date_formats = 3;\n */\n dateFormats: string[];\n};\n\n/**\n * Describes the message importhub.v1.ValidityPeriodSource.\n * Use `create(ValidityPeriodSourceSchema)` to create a new message.\n */\nexport const ValidityPeriodSourceSchema: GenMessage<ValidityPeriodSource> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 4);\n\n/**\n * ReleaseSpecSource is where one Release Spec value is read from.\n *\n * @generated from message importhub.v1.ReleaseSpecSource\n */\nexport type ReleaseSpecSource = Message<\"importhub.v1.ReleaseSpecSource\"> & {\n /**\n * The Release Spec field, by its path in the pinned Release.\n *\n * @generated from field: string field = 1;\n */\n field: string;\n\n /**\n * An XPath, relative to the element.\n *\n * @generated from field: string selector = 2;\n */\n selector: string;\n};\n\n/**\n * Describes the message importhub.v1.ReleaseSpecSource.\n * Use `create(ReleaseSpecSourceSchema)` to create a new message.\n */\nexport const ReleaseSpecSourceSchema: GenMessage<ReleaseSpecSource> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 5);\n\n/**\n * TitleContribution writes per-Ausgabe data found in the element onto the\n * Title whose Content Key equals the Ausgabe code (ADR 0013).\n *\n * @generated from message importhub.v1.TitleContribution\n */\nexport type TitleContribution = Message<\"importhub.v1.TitleContribution\"> & {\n /**\n * An XPath, relative to the element, selecting the elements that carry\n * one Ausgabe's data each.\n *\n * @generated from field: string selector = 1;\n */\n selector: string;\n\n /**\n * An XPath, relative to each of those, for the Ausgabe code.\n *\n * @generated from field: string ausgabe_code_selector = 2;\n */\n ausgabeCodeSelector: string;\n\n /**\n * Reference Spec values written on the Title's Include.\n *\n * @generated from field: repeated importhub.v1.TitleValueSource reference_spec_values = 3;\n */\n referenceSpecValues: TitleValueSource[];\n\n /**\n * An XPath for the reference filter written on the Title; empty for\n * none.\n *\n * @generated from field: string reference_filter_selector = 4;\n */\n referenceFilterSelector: string;\n\n /**\n * An intent written on the Title's tree; unset for none.\n *\n * @generated from field: importhub.v1.TitleIntent intent = 5;\n */\n intent: TitleIntent;\n\n /**\n * An XPath for the replacement or annotation text of a `replace` or\n * `annotate` intent.\n *\n * @generated from field: string intent_text_selector = 6;\n */\n intentTextSelector: string;\n};\n\n/**\n * Describes the message importhub.v1.TitleContribution.\n * Use `create(TitleContributionSchema)` to create a new message.\n */\nexport const TitleContributionSchema: GenMessage<TitleContribution> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 6);\n\n/**\n * TitleValueSource is where one value written on a Title is read from.\n *\n * @generated from message importhub.v1.TitleValueSource\n */\nexport type TitleValueSource = Message<\"importhub.v1.TitleValueSource\"> & {\n /**\n * The field, by its path in the Title's Reference Spec.\n *\n * @generated from field: string field = 1;\n */\n field: string;\n\n /**\n * An XPath, relative to the Ausgabe's element.\n *\n * @generated from field: string selector = 2;\n */\n selector: string;\n};\n\n/**\n * Describes the message importhub.v1.TitleValueSource.\n * Use `create(TitleValueSourceSchema)` to create a new message.\n */\nexport const TitleValueSourceSchema: GenMessage<TitleValueSource> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 7);\n\n/**\n * CollectionRouting derives one Collection per Content from the source,\n * named as `collections` names them. It yields at most one name: the selector's value, mapped through\n * collection_map when it has entries; else id_pattern's first capture group\n * on the Source Key, filled into collection_template; else fallback.\n *\n * @generated from message importhub.v1.CollectionRouting\n */\nexport type CollectionRouting = Message<\"importhub.v1.CollectionRouting\"> & {\n /**\n * An XPath, relative to the element, whose value decides the Collection.\n *\n * @generated from field: string selector = 1;\n */\n selector: string;\n\n /**\n * The selector's values, mapped to Collection names. Empty: the value is\n * the name.\n *\n * @generated from field: map<string, string> collection_map = 2;\n */\n collectionMap: { [key: string]: string };\n\n /**\n * A regular expression applied to the Source Key; its first capture\n * group is `{match}` in collection_template.\n *\n * @generated from field: string id_pattern = 3;\n */\n idPattern: string;\n\n /**\n * The Collection's name, with `{match}` and `{suffix}` placeholders.\n *\n * @generated from field: string collection_template = 4;\n */\n collectionTemplate: string;\n\n /**\n * The static text `{suffix}` stands for.\n *\n * @generated from field: string suffix = 5;\n */\n suffix: string;\n\n /**\n * The name of the Collection used when the routing yields nothing; each\n * use is reported as an Item Problem.\n *\n * @generated from field: string fallback = 6;\n */\n fallback: string;\n};\n\n/**\n * Describes the message importhub.v1.CollectionRouting.\n * Use `create(CollectionRoutingSchema)` to create a new message.\n */\nexport const CollectionRoutingSchema: GenMessage<CollectionRouting> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 8);\n\n/**\n * PlaceholderAssets turns the file references a Mapping marks into\n * Placeholder Assets in mediahub (CONTEXT.md \"Placeholder Asset\").\n *\n * @generated from message importhub.v1.PlaceholderAssets\n */\nexport type PlaceholderAssets = Message<\"importhub.v1.PlaceholderAssets\"> & {\n /**\n * An XPath, relative to the element, selecting the file references, such\n * as `.//grafik`.\n *\n * @generated from field: string selector = 1;\n */\n selector: string;\n\n /**\n * The mediahub asset type of the assets created.\n *\n * @generated from field: string asset_type = 2;\n */\n assetType: string;\n\n /**\n * XPath expressions, relative to each reference, whose values joined by\n * `/` form the asset's key in mediahub (its external_key).\n *\n * @generated from field: repeated string key_parts = 3;\n */\n keyParts: string[];\n\n /**\n * An XPath for the asset's name.\n *\n * @generated from field: string name_selector = 4;\n */\n nameSelector: string;\n\n /**\n * An XPath for the asset's description; empty for none.\n *\n * @generated from field: string description_selector = 5;\n */\n descriptionSelector: string;\n\n /**\n * The asset's metadata: XPath expressions, by metadata field.\n *\n * @generated from field: map<string, string> metadata = 6;\n */\n metadata: { [key: string]: string };\n\n /**\n * The mediahub folder path the mirrored folders are made under.\n *\n * @generated from field: string folder_root = 7;\n */\n folderRoot: string;\n\n /**\n * An XPath for the file's path, mirrored as folders under folder_root.\n *\n * @generated from field: string folder_path_selector = 8;\n */\n folderPathSelector: string;\n};\n\n/**\n * Describes the message importhub.v1.PlaceholderAssets.\n * Use `create(PlaceholderAssetsSchema)` to create a new message.\n */\nexport const PlaceholderAssetsSchema: GenMessage<PlaceholderAssets> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 9);\n\n/**\n * @generated from message importhub.v1.ListMappingsRequest\n */\nexport type ListMappingsRequest = Message<\"importhub.v1.ListMappingsRequest\"> & {\n};\n\n/**\n * Describes the message importhub.v1.ListMappingsRequest.\n * Use `create(ListMappingsRequestSchema)` to create a new message.\n */\nexport const ListMappingsRequestSchema: GenMessage<ListMappingsRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 10);\n\n/**\n * @generated from message importhub.v1.ListMappingsResponse\n */\nexport type ListMappingsResponse = Message<\"importhub.v1.ListMappingsResponse\"> & {\n /**\n * @generated from field: repeated importhub.v1.Mapping mappings = 1;\n */\n mappings: Mapping[];\n};\n\n/**\n * Describes the message importhub.v1.ListMappingsResponse.\n * Use `create(ListMappingsResponseSchema)` to create a new message.\n */\nexport const ListMappingsResponseSchema: GenMessage<ListMappingsResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 11);\n\n/**\n * @generated from message importhub.v1.GetMappingRequest\n */\nexport type GetMappingRequest = Message<\"importhub.v1.GetMappingRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * An older Revision to read the content of; empty for the draft.\n *\n * @generated from field: string revision_id = 2;\n */\n revisionId: string;\n};\n\n/**\n * Describes the message importhub.v1.GetMappingRequest.\n * Use `create(GetMappingRequestSchema)` to create a new message.\n */\nexport const GetMappingRequestSchema: GenMessage<GetMappingRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 12);\n\n/**\n * @generated from message importhub.v1.GetMappingResponse\n */\nexport type GetMappingResponse = Message<\"importhub.v1.GetMappingResponse\"> & {\n /**\n * @generated from field: importhub.v1.Mapping mapping = 1;\n */\n mapping?: Mapping | undefined;\n};\n\n/**\n * Describes the message importhub.v1.GetMappingResponse.\n * Use `create(GetMappingResponseSchema)` to create a new message.\n */\nexport const GetMappingResponseSchema: GenMessage<GetMappingResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 13);\n\n/**\n * @generated from message importhub.v1.CreateMappingRequest\n */\nexport type CreateMappingRequest = Message<\"importhub.v1.CreateMappingRequest\"> & {\n /**\n * @generated from field: importhub.v1.MappingContent content = 1;\n */\n content?: MappingContent | undefined;\n};\n\n/**\n * Describes the message importhub.v1.CreateMappingRequest.\n * Use `create(CreateMappingRequestSchema)` to create a new message.\n */\nexport const CreateMappingRequestSchema: GenMessage<CreateMappingRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 14);\n\n/**\n * @generated from message importhub.v1.CreateMappingResponse\n */\nexport type CreateMappingResponse = Message<\"importhub.v1.CreateMappingResponse\"> & {\n /**\n * @generated from field: importhub.v1.Mapping mapping = 1;\n */\n mapping?: Mapping | undefined;\n};\n\n/**\n * Describes the message importhub.v1.CreateMappingResponse.\n * Use `create(CreateMappingResponseSchema)` to create a new message.\n */\nexport const CreateMappingResponseSchema: GenMessage<CreateMappingResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 15);\n\n/**\n * @generated from message importhub.v1.UpdateMappingRequest\n */\nexport type UpdateMappingRequest = Message<\"importhub.v1.UpdateMappingRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * The whole new content; it replaces the draft's.\n *\n * @generated from field: importhub.v1.MappingContent content = 2;\n */\n content?: MappingContent | undefined;\n\n /**\n * The draft this edit was made on. Given, the save is refused if the\n * draft has moved since; empty, it saves on whatever the draft is.\n *\n * @generated from field: string draft_revision_id = 3;\n */\n draftRevisionId: string;\n};\n\n/**\n * Describes the message importhub.v1.UpdateMappingRequest.\n * Use `create(UpdateMappingRequestSchema)` to create a new message.\n */\nexport const UpdateMappingRequestSchema: GenMessage<UpdateMappingRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 16);\n\n/**\n * @generated from message importhub.v1.UpdateMappingResponse\n */\nexport type UpdateMappingResponse = Message<\"importhub.v1.UpdateMappingResponse\"> & {\n /**\n * @generated from field: importhub.v1.Mapping mapping = 1;\n */\n mapping?: Mapping | undefined;\n};\n\n/**\n * Describes the message importhub.v1.UpdateMappingResponse.\n * Use `create(UpdateMappingResponseSchema)` to create a new message.\n */\nexport const UpdateMappingResponseSchema: GenMessage<UpdateMappingResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 17);\n\n/**\n * @generated from message importhub.v1.DeleteMappingRequest\n */\nexport type DeleteMappingRequest = Message<\"importhub.v1.DeleteMappingRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n};\n\n/**\n * Describes the message importhub.v1.DeleteMappingRequest.\n * Use `create(DeleteMappingRequestSchema)` to create a new message.\n */\nexport const DeleteMappingRequestSchema: GenMessage<DeleteMappingRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 18);\n\n/**\n * @generated from message importhub.v1.DeleteMappingResponse\n */\nexport type DeleteMappingResponse = Message<\"importhub.v1.DeleteMappingResponse\"> & {\n};\n\n/**\n * Describes the message importhub.v1.DeleteMappingResponse.\n * Use `create(DeleteMappingResponseSchema)` to create a new message.\n */\nexport const DeleteMappingResponseSchema: GenMessage<DeleteMappingResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 19);\n\n/**\n * @generated from message importhub.v1.CutMappingReleaseRequest\n */\nexport type CutMappingReleaseRequest = Message<\"importhub.v1.CutMappingReleaseRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * The draft the admin is releasing. Given, the cut is refused if the\n * draft has moved since.\n *\n * @generated from field: string draft_revision_id = 2;\n */\n draftRevisionId: string;\n};\n\n/**\n * Describes the message importhub.v1.CutMappingReleaseRequest.\n * Use `create(CutMappingReleaseRequestSchema)` to create a new message.\n */\nexport const CutMappingReleaseRequestSchema: GenMessage<CutMappingReleaseRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 20);\n\n/**\n * @generated from message importhub.v1.CutMappingReleaseResponse\n */\nexport type CutMappingReleaseResponse = Message<\"importhub.v1.CutMappingReleaseResponse\"> & {\n /**\n * The Release cut.\n *\n * @generated from field: importhub.v1.ConfigurationRelease release = 1;\n */\n release?: ConfigurationRelease | undefined;\n\n /**\n * The Mapping after the cut.\n *\n * @generated from field: importhub.v1.Mapping mapping = 2;\n */\n mapping?: Mapping | undefined;\n\n /**\n * The Import Profiles that include it, by name.\n *\n * @generated from field: repeated importhub.v1.ImportProfileRef import_profiles = 3;\n */\n importProfiles: ImportProfileRef[];\n};\n\n/**\n * Describes the message importhub.v1.CutMappingReleaseResponse.\n * Use `create(CutMappingReleaseResponseSchema)` to create a new message.\n */\nexport const CutMappingReleaseResponseSchema: GenMessage<CutMappingReleaseResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 21);\n\n/**\n * @generated from message importhub.v1.ListMappingHistoryRequest\n */\nexport type ListMappingHistoryRequest = Message<\"importhub.v1.ListMappingHistoryRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * Revisions per page; 0 means 100, and at most 1000.\n *\n * @generated from field: int32 page_size = 2;\n */\n pageSize: number;\n\n /**\n * The next_page_token of the previous page; empty for the first.\n *\n * @generated from field: string page_token = 3;\n */\n pageToken: string;\n};\n\n/**\n * Describes the message importhub.v1.ListMappingHistoryRequest.\n * Use `create(ListMappingHistoryRequestSchema)` to create a new message.\n */\nexport const ListMappingHistoryRequestSchema: GenMessage<ListMappingHistoryRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 22);\n\n/**\n * @generated from message importhub.v1.ListMappingHistoryResponse\n */\nexport type ListMappingHistoryResponse = Message<\"importhub.v1.ListMappingHistoryResponse\"> & {\n /**\n * One page of Revisions, newest first.\n *\n * @generated from field: repeated importhub.v1.ConfigurationRevision revisions = 1;\n */\n revisions: ConfigurationRevision[];\n\n /**\n * Every Release, newest first, on every page.\n *\n * @generated from field: repeated importhub.v1.ConfigurationRelease releases = 2;\n */\n releases: ConfigurationRelease[];\n\n /**\n * The page_token of the next page; empty on the last.\n *\n * @generated from field: string next_page_token = 3;\n */\n nextPageToken: string;\n};\n\n/**\n * Describes the message importhub.v1.ListMappingHistoryResponse.\n * Use `create(ListMappingHistoryResponseSchema)` to create a new message.\n */\nexport const ListMappingHistoryResponseSchema: GenMessage<ListMappingHistoryResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 23);\n\n/**\n * @generated from message importhub.v1.CompareMappingRevisionsRequest\n */\nexport type CompareMappingRevisionsRequest = Message<\"importhub.v1.CompareMappingRevisionsRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * @generated from field: string from_revision_id = 2;\n */\n fromRevisionId: string;\n\n /**\n * @generated from field: string to_revision_id = 3;\n */\n toRevisionId: string;\n};\n\n/**\n * Describes the message importhub.v1.CompareMappingRevisionsRequest.\n * Use `create(CompareMappingRevisionsRequestSchema)` to create a new message.\n */\nexport const CompareMappingRevisionsRequestSchema: GenMessage<CompareMappingRevisionsRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 24);\n\n/**\n * @generated from message importhub.v1.CompareMappingRevisionsResponse\n */\nexport type CompareMappingRevisionsResponse = Message<\"importhub.v1.CompareMappingRevisionsResponse\"> & {\n /**\n * @generated from field: importhub.v1.Mapping from = 1;\n */\n from?: Mapping | undefined;\n\n /**\n * @generated from field: importhub.v1.Mapping to = 2;\n */\n to?: Mapping | undefined;\n\n /**\n * Each field, and how it differs from `from` to `to`.\n *\n * @generated from field: repeated importhub.v1.FieldComparison fields = 3;\n */\n fields: FieldComparison[];\n};\n\n/**\n * Describes the message importhub.v1.CompareMappingRevisionsResponse.\n * Use `create(CompareMappingRevisionsResponseSchema)` to create a new message.\n */\nexport const CompareMappingRevisionsResponseSchema: GenMessage<CompareMappingRevisionsResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 25);\n\n/**\n * @generated from message importhub.v1.RestoreMappingRevisionRequest\n */\nexport type RestoreMappingRevisionRequest = Message<\"importhub.v1.RestoreMappingRevisionRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * The older Revision whose content becomes the new draft.\n *\n * @generated from field: string revision_id = 2;\n */\n revisionId: string;\n\n /**\n * As UpdateMappingRequest's.\n *\n * @generated from field: string draft_revision_id = 3;\n */\n draftRevisionId: string;\n};\n\n/**\n * Describes the message importhub.v1.RestoreMappingRevisionRequest.\n * Use `create(RestoreMappingRevisionRequestSchema)` to create a new message.\n */\nexport const RestoreMappingRevisionRequestSchema: GenMessage<RestoreMappingRevisionRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 26);\n\n/**\n * @generated from message importhub.v1.RestoreMappingRevisionResponse\n */\nexport type RestoreMappingRevisionResponse = Message<\"importhub.v1.RestoreMappingRevisionResponse\"> & {\n /**\n * @generated from field: importhub.v1.Mapping mapping = 1;\n */\n mapping?: Mapping | undefined;\n};\n\n/**\n * Describes the message importhub.v1.RestoreMappingRevisionResponse.\n * Use `create(RestoreMappingRevisionResponseSchema)` to create a new message.\n */\nexport const RestoreMappingRevisionResponseSchema: GenMessage<RestoreMappingRevisionResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 27);\n\n/**\n * @generated from message importhub.v1.ListMappingImportProfilesRequest\n */\nexport type ListMappingImportProfilesRequest = Message<\"importhub.v1.ListMappingImportProfilesRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n};\n\n/**\n * Describes the message importhub.v1.ListMappingImportProfilesRequest.\n * Use `create(ListMappingImportProfilesRequestSchema)` to create a new message.\n */\nexport const ListMappingImportProfilesRequestSchema: GenMessage<ListMappingImportProfilesRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 28);\n\n/**\n * @generated from message importhub.v1.ListMappingImportProfilesResponse\n */\nexport type ListMappingImportProfilesResponse = Message<\"importhub.v1.ListMappingImportProfilesResponse\"> & {\n /**\n * @generated from field: repeated importhub.v1.ImportProfileRef import_profiles = 1;\n */\n importProfiles: ImportProfileRef[];\n};\n\n/**\n * Describes the message importhub.v1.ListMappingImportProfilesResponse.\n * Use `create(ListMappingImportProfilesResponseSchema)` to create a new message.\n */\nexport const ListMappingImportProfilesResponseSchema: GenMessage<ListMappingImportProfilesResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 29);\n\n/**\n * @generated from message importhub.v1.CheckMappingBlueprintReleaseRequest\n */\nexport type CheckMappingBlueprintReleaseRequest = Message<\"importhub.v1.CheckMappingBlueprintReleaseRequest\"> & {\n /**\n * @generated from field: string id = 1;\n */\n id: string;\n\n /**\n * The Blueprint Release the draft would move to.\n *\n * @generated from field: string blueprint_release_id = 2;\n */\n blueprintReleaseId: string;\n};\n\n/**\n * Describes the message importhub.v1.CheckMappingBlueprintReleaseRequest.\n * Use `create(CheckMappingBlueprintReleaseRequestSchema)` to create a new message.\n */\nexport const CheckMappingBlueprintReleaseRequestSchema: GenMessage<CheckMappingBlueprintReleaseRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 30);\n\n/**\n * @generated from message importhub.v1.CheckMappingBlueprintReleaseResponse\n */\nexport type CheckMappingBlueprintReleaseResponse = Message<\"importhub.v1.CheckMappingBlueprintReleaseResponse\"> & {\n /**\n * The Blueprint that Release is of.\n *\n * @generated from field: string blueprint_id = 1;\n */\n blueprintId: string;\n\n /**\n * Every field path the draft maps (field mappings, Version Match content\n * fields) that the Release does not have, in the draft's order.\n *\n * @generated from field: repeated string missing_field_paths = 2;\n */\n missingFieldPaths: string[];\n\n /**\n * Every Release Spec field the draft reads or matches on that the\n * Release does not have.\n *\n * @generated from field: repeated string missing_release_spec_fields = 3;\n */\n missingReleaseSpecFields: string[];\n};\n\n/**\n * Describes the message importhub.v1.CheckMappingBlueprintReleaseResponse.\n * Use `create(CheckMappingBlueprintReleaseResponseSchema)` to create a new message.\n */\nexport const CheckMappingBlueprintReleaseResponseSchema: GenMessage<CheckMappingBlueprintReleaseResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_mapping, 31);\n\n/**\n * ChangedVersionHandling is what happens to a Source Version that matches an\n * existing Release but whose mapped data differs (CONTEXT.md \"Changed\n * Version\").\n *\n * @generated from enum importhub.v1.ChangedVersionHandling\n */\nexport enum ChangedVersionHandling {\n /**\n * Unset: Correct.\n *\n * @generated from enum value: CHANGED_VERSION_HANDLING_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * A Planned Release that Supersedes the matched one.\n *\n * @generated from enum value: CHANGED_VERSION_HANDLING_CORRECT = 1;\n */\n CORRECT = 1,\n\n /**\n * Keep the existing Release; skip the Source Version.\n *\n * @generated from enum value: CHANGED_VERSION_HANDLING_KEEP = 2;\n */\n KEEP = 2,\n\n /**\n * Fail the Import.\n *\n * @generated from enum value: CHANGED_VERSION_HANDLING_FAIL = 3;\n */\n FAIL = 3,\n}\n\n/**\n * Describes the enum importhub.v1.ChangedVersionHandling.\n */\nexport const ChangedVersionHandlingSchema: GenEnum<ChangedVersionHandling> = /*@__PURE__*/\n enumDesc(file_importhub_v1_mapping, 0);\n\n/**\n * TitleIntent is an intent a Title Contribution writes on the Title's tree.\n *\n * @generated from enum importhub.v1.TitleIntent\n */\nexport enum TitleIntent {\n /**\n * None.\n *\n * @generated from enum value: TITLE_INTENT_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * @generated from enum value: TITLE_INTENT_EXCLUDE = 1;\n */\n EXCLUDE = 1,\n\n /**\n * @generated from enum value: TITLE_INTENT_REPLACE = 2;\n */\n REPLACE = 2,\n\n /**\n * @generated from enum value: TITLE_INTENT_ANNOTATE = 3;\n */\n ANNOTATE = 3,\n}\n\n/**\n * Describes the enum importhub.v1.TitleIntent.\n */\nexport const TitleIntentSchema: GenEnum<TitleIntent> = /*@__PURE__*/\n enumDesc(file_importhub_v1_mapping, 1);\n\n/**\n * MappingService holds the workspace's Mappings: the rules that turn each\n * matching element of a Source File into one Content of one target Blueprint,\n * field by field (CONTEXT.md, manage-mappings). A Mapping stands on its own,\n * and any number of Import Profiles include it.\n *\n * Each Mapping pins one Blueprint Release (ADR 0002), read from blueprinthub\n * with the caller's token, and every field path it maps is checked against\n * that Release when it is saved. Moving it to a newer Release is an explicit\n * edit, which CheckMappingBlueprintRelease checks first.\n *\n * A Mapping is versioned configuration (ADR 0016): every create, update and\n * restore saves a draft Revision, and an admin cuts a Configuration Release\n * from a valid draft.\n *\n * Every RPC acts on the caller's workspace, which comes from the token's\n * active workspace and never from a request field. Reads need `viewer`;\n * every write needs `admin` (ADR 0010, control-who-may-import:AC3).\n *\n * The validity reason codes of a Mapping, decided when it is saved:\n *\n * - `no_blueprint_release`: it pins no Blueprint Release.\n * - `blueprint_gone`: blueprinthub does not know the Release it pins: the\n * Blueprint is gone, or the Release is of another workspace.\n * - `release_of_other_blueprint`: the pinned Release is not of\n * blueprint_id.\n * - `no_element_selector`, `no_source_key`: the element selector or the\n * Source Key is missing.\n * - `invalid_xpath`: a selector is not an XPath.\n * - `invalid_pattern`: an extract pattern is not a regular expression.\n * - `unknown_processor`, `wrong_processor_kind`,\n * `invalid_processor_settings`: a rich-text field's Preprocessors\n * (`richTextConfig.preprocessors`), checked against the catalogue as an\n * Import Profile's are.\n * - `unknown_option`: a field mapping holds a key xmlmapper does not read.\n * - `xmlmapper_schema`: a field mapping breaks xmlmapper's schema, such as\n * a select field without options; the message is xmlmapper's.\n * - `duplicate_field`: two field mappings write one field path.\n * - `unknown_field_path`: a field mapping writes a field path the pinned\n * Release does not have.\n * - `unknown_release_spec_field`: a Release Spec source or the Version\n * Match names a Release Spec field the pinned Release does not have.\n * - `unknown_version_match_field`: the Version Match compares a content\n * field the Mapping does not map.\n * - `incomplete_title_contribution`, `incomplete_placeholder_assets`: a\n * Title Contribution or Placeholder Asset setting misses a selector it\n * cannot work without.\n * - `incomplete_display_name`: a display-name template without a\n * display-name field, or a field without a template.\n * - `unknown_display_name_field`: the display-name field is a path the\n * pinned Release does not have.\n * - `display_name_field_not_plain_text`: the display-name field is not a\n * `text` or `textarea` field, or is one in a virtual table's rows.\n * - `display_name_field_mapped`: a field mapping writes the display-name\n * field too; a field has one writer.\n *\n * current_validity adds `blueprint_gone` when blueprinthub no longer knows\n * the Release the draft or the latest Release pins (manage-mappings:AC7).\n *\n * @generated from service importhub.v1.MappingService\n */\nexport const MappingService: GenService<{\n /**\n * ListMappings returns every Mapping of the workspace, by name, each with\n * its target Blueprint, its pinned Blueprint Release and whether it is\n * valid now (manage-mappings:AC1).\n *\n * @generated from rpc importhub.v1.MappingService.ListMappings\n */\n listMappings: {\n methodKind: \"unary\";\n input: typeof ListMappingsRequestSchema;\n output: typeof ListMappingsResponseSchema;\n },\n /**\n * GetMapping returns one Mapping with its draft, or with an older\n * Revision of it when one is named.\n *\n * @generated from rpc importhub.v1.MappingService.GetMapping\n */\n getMapping: {\n methodKind: \"unary\";\n input: typeof GetMappingRequestSchema;\n output: typeof GetMappingResponseSchema;\n },\n /**\n * CreateMapping creates a Mapping, its content the first draft. A Mapping\n * that breaks xmlmapper's schema or maps a field path its Release lacks\n * is saved and marked invalid with its reasons (manage-mappings:AC6); a\n * missing name, or one another Mapping of the workspace has, is refused\n * (InvalidArgument, AlreadyExists). blueprinthub not answering is\n * Unavailable, and nothing is saved.\n *\n * @generated from rpc importhub.v1.MappingService.CreateMapping\n */\n createMapping: {\n methodKind: \"unary\";\n input: typeof CreateMappingRequestSchema;\n output: typeof CreateMappingResponseSchema;\n },\n /**\n * UpdateMapping saves new content as a new draft Revision. It is refused\n * with FailedPrecondition when draft_revision_id is given and is no longer\n * the draft.\n *\n * @generated from rpc importhub.v1.MappingService.UpdateMapping\n */\n updateMapping: {\n methodKind: \"unary\";\n input: typeof UpdateMappingRequestSchema;\n output: typeof UpdateMappingResponseSchema;\n },\n /**\n * DeleteMapping deletes a Mapping. It is refused with FailedPrecondition\n * while an Import Profile includes it, naming the Profiles in the message\n * and in a ConfigurationInUse detail (manage-mappings:AC4).\n *\n * @generated from rpc importhub.v1.MappingService.DeleteMapping\n */\n deleteMapping: {\n methodKind: \"unary\";\n input: typeof DeleteMappingRequestSchema;\n output: typeof DeleteMappingResponseSchema;\n },\n /**\n * CutMappingRelease cuts a Configuration Release from the draft, and\n * returns the Import Profiles that include the Mapping, which take the\n * new Release at their next Import (release-a-configuration:AC4). It is\n * refused with FailedPrecondition, the Validity as a detail, when the\n * draft is not valid now, when it does not differ from the latest\n * Release, or when draft_revision_id is given and is no longer the draft.\n *\n * @generated from rpc importhub.v1.MappingService.CutMappingRelease\n */\n cutMappingRelease: {\n methodKind: \"unary\";\n input: typeof CutMappingReleaseRequestSchema;\n output: typeof CutMappingReleaseResponseSchema;\n },\n /**\n * ListMappingHistory lists a Mapping's Revisions, newest first and paged,\n * and all its Releases (release-a-configuration:AC6).\n *\n * @generated from rpc importhub.v1.MappingService.ListMappingHistory\n */\n listMappingHistory: {\n methodKind: \"unary\";\n input: typeof ListMappingHistoryRequestSchema;\n output: typeof ListMappingHistoryResponseSchema;\n },\n /**\n * CompareMappingRevisions compares two Revisions of one Mapping: both\n * contents, and how each field differs.\n *\n * @generated from rpc importhub.v1.MappingService.CompareMappingRevisions\n */\n compareMappingRevisions: {\n methodKind: \"unary\";\n input: typeof CompareMappingRevisionsRequestSchema;\n output: typeof CompareMappingRevisionsResponseSchema;\n },\n /**\n * RestoreMappingRevision saves an older Revision's content as a new draft\n * (release-a-configuration:AC7), its validity decided anew against the\n * Release it pins.\n *\n * @generated from rpc importhub.v1.MappingService.RestoreMappingRevision\n */\n restoreMappingRevision: {\n methodKind: \"unary\";\n input: typeof RestoreMappingRevisionRequestSchema;\n output: typeof RestoreMappingRevisionResponseSchema;\n },\n /**\n * ListMappingImportProfiles lists the Import Profiles that include a\n * Mapping, by name: those whose draft or latest Release includes it\n * (manage-mappings:AC3, and before a cut, release-a-configuration:AC4).\n *\n * @generated from rpc importhub.v1.MappingService.ListMappingImportProfiles\n */\n listMappingImportProfiles: {\n methodKind: \"unary\";\n input: typeof ListMappingImportProfilesRequestSchema;\n output: typeof ListMappingImportProfilesResponseSchema;\n },\n /**\n * CheckMappingBlueprintRelease checks moving a Mapping's draft to\n * another Blueprint Release, saving nothing: every field path the draft\n * maps that the other Release no longer has (manage-mappings:AC5). An\n * unknown Release is NotFound; a Release of another Blueprint than the\n * Mapping's is FailedPrecondition. The report is against the draft, not\n * the latest Release. Any Release of the Mapping's Blueprint may be\n * checked, an older one too: moving back is an edit like moving forward,\n * validated the same way when it is saved.\n *\n * @generated from rpc importhub.v1.MappingService.CheckMappingBlueprintRelease\n */\n checkMappingBlueprintRelease: {\n methodKind: \"unary\";\n input: typeof CheckMappingBlueprintReleaseRequestSchema;\n output: typeof CheckMappingBlueprintReleaseResponseSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_importhub_v1_mapping, 0);\n\n","// @generated by protoc-gen-es v2.13.0 with parameter \"target=ts\"\n// @generated from file importhub/v1/processor.proto (package importhub.v1, syntax proto3)\n/* eslint-disable */\n\nimport type { GenEnum, GenFile, GenMessage, GenService } from \"@bufbuild/protobuf/codegenv2\";\nimport { enumDesc, fileDesc, messageDesc, serviceDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport { file_google_protobuf_struct } from \"@bufbuild/protobuf/wkt\";\nimport type { JsonObject, Message } from \"@bufbuild/protobuf\";\n\n/**\n * Describes the file importhub/v1/processor.proto.\n */\nexport const file_importhub_v1_processor: GenFile = /*@__PURE__*/\n fileDesc(\"ChxpbXBvcnRodWIvdjEvcHJvY2Vzc29yLnByb3RvEgxpbXBvcnRodWIudjEiFwoVTGlzdFByb2Nlc3NvcnNSZXF1ZXN0IkUKFkxpc3RQcm9jZXNzb3JzUmVzcG9uc2USKwoKcHJvY2Vzc29ycxgBIAMoCzIXLmltcG9ydGh1Yi52MS5Qcm9jZXNzb3IiuAEKCVByb2Nlc3NvchIMCgRuYW1lGAEgASgJEikKBGtpbmQYAiABKA4yGy5pbXBvcnRodWIudjEuUHJvY2Vzc29yS2luZBItCgZ0YXJnZXQYAyABKA4yHS5pbXBvcnRodWIudjEuUHJvY2Vzc29yVGFyZ2V0EhMKC2Rlc2NyaXB0aW9uGAQgASgJEi4KDXNldHRpbmdzX3NwZWMYBSADKAsyFy5nb29nbGUucHJvdG9idWYuU3RydWN0KnMKDVByb2Nlc3NvcktpbmQSHgoaUFJPQ0VTU09SX0tJTkRfVU5TUEVDSUZJRUQQABIfChtQUk9DRVNTT1JfS0lORF9QUkVQUk9DRVNTT1IQARIhCh1QUk9DRVNTT1JfS0lORF9QT1NUX1BST0NFU1NPUhACKnsKD1Byb2Nlc3NvclRhcmdldBIgChxQUk9DRVNTT1JfVEFSR0VUX1VOU1BFQ0lGSUVEEAASIAocUFJPQ0VTU09SX1RBUkdFVF9TT1VSQ0VfRklMRRABEiQKIFBST0NFU1NPUl9UQVJHRVRfUklDSF9URVhUX0ZJRUxEEAIybwoQUHJvY2Vzc29yU2VydmljZRJbCg5MaXN0UHJvY2Vzc29ycxIjLmltcG9ydGh1Yi52MS5MaXN0UHJvY2Vzc29yc1JlcXVlc3QaJC5pbXBvcnRodWIudjEuTGlzdFByb2Nlc3NvcnNSZXNwb25zZUI5WjdnaXRodWIuY29tL2tua2NzL2ltcG9ydGh1Yi9nZW4vaW1wb3J0aHViL3YxO2ltcG9ydGh1YnYxYgZwcm90bzM\", [file_google_protobuf_struct]);\n\n/**\n * @generated from message importhub.v1.ListProcessorsRequest\n */\nexport type ListProcessorsRequest = Message<\"importhub.v1.ListProcessorsRequest\"> & {\n};\n\n/**\n * Describes the message importhub.v1.ListProcessorsRequest.\n * Use `create(ListProcessorsRequestSchema)` to create a new message.\n */\nexport const ListProcessorsRequestSchema: GenMessage<ListProcessorsRequest> = /*@__PURE__*/\n messageDesc(file_importhub_v1_processor, 0);\n\n/**\n * @generated from message importhub.v1.ListProcessorsResponse\n */\nexport type ListProcessorsResponse = Message<\"importhub.v1.ListProcessorsResponse\"> & {\n /**\n * @generated from field: repeated importhub.v1.Processor processors = 1;\n */\n processors: Processor[];\n};\n\n/**\n * Describes the message importhub.v1.ListProcessorsResponse.\n * Use `create(ListProcessorsResponseSchema)` to create a new message.\n */\nexport const ListProcessorsResponseSchema: GenMessage<ListProcessorsResponse> = /*@__PURE__*/\n messageDesc(file_importhub_v1_processor, 1);\n\n/**\n * Processor is one entry of the catalogue.\n *\n * @generated from message importhub.v1.Processor\n */\nexport type Processor = Message<\"importhub.v1.Processor\"> & {\n /**\n * How a Profile names it, such as `entity-element`. Stable.\n *\n * @generated from field: string name = 1;\n */\n name: string;\n\n /**\n * @generated from field: importhub.v1.ProcessorKind kind = 2;\n */\n kind: ProcessorKind;\n\n /**\n * What it works on, and so where it is configured.\n *\n * @generated from field: importhub.v1.ProcessorTarget target = 3;\n */\n target: ProcessorTarget;\n\n /**\n * What it does, in English, for a person.\n *\n * @generated from field: string description = 4;\n */\n description: string;\n\n /**\n * Its settings, in form order, each a fieldkit Field (`field_type`,\n * `config` with `api_accessor`, `required`, `name`, `instructions`, and\n * `settings`): a Profile's ProcessorStep.settings holds one value per\n * `config.api_accessor`. Empty for a Processor without settings.\n *\n * @generated from field: repeated google.protobuf.Struct settings_spec = 5;\n */\n settingsSpec: JsonObject[];\n};\n\n/**\n * Describes the message importhub.v1.Processor.\n * Use `create(ProcessorSchema)` to create a new message.\n */\nexport const ProcessorSchema: GenMessage<Processor> = /*@__PURE__*/\n messageDesc(file_importhub_v1_processor, 2);\n\n/**\n * ProcessorKind is where in a Profile's pipeline a Processor runs (ADR 0007).\n *\n * @generated from enum importhub.v1.ProcessorKind\n */\nexport enum ProcessorKind {\n /**\n * @generated from enum value: PROCESSOR_KIND_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * Rewrites the Source File before Mapping.\n *\n * @generated from enum value: PROCESSOR_KIND_PREPROCESSOR = 1;\n */\n PREPROCESSOR = 1,\n\n /**\n * Enriches mapped Source Versions before they are saved.\n *\n * @generated from enum value: PROCESSOR_KIND_POST_PROCESSOR = 2;\n */\n POST_PROCESSOR = 2,\n}\n\n/**\n * Describes the enum importhub.v1.ProcessorKind.\n */\nexport const ProcessorKindSchema: GenEnum<ProcessorKind> = /*@__PURE__*/\n enumDesc(file_importhub_v1_processor, 0);\n\n/**\n * ProcessorTarget is what a Processor works on.\n *\n * @generated from enum importhub.v1.ProcessorTarget\n */\nexport enum ProcessorTarget {\n /**\n * @generated from enum value: PROCESSOR_TARGET_UNSPECIFIED = 0;\n */\n UNSPECIFIED = 0,\n\n /**\n * The whole Source File: an Import Profile lists it among its\n * Preprocessors or Post-processors.\n *\n * @generated from enum value: PROCESSOR_TARGET_SOURCE_FILE = 1;\n */\n SOURCE_FILE = 1,\n\n /**\n * One rich-text field's XML before it is converted: a Mapping lists it\n * in that field's xmlmapper settings (`richTextConfig.preprocessors`),\n * never a Profile.\n *\n * @generated from enum value: PROCESSOR_TARGET_RICH_TEXT_FIELD = 2;\n */\n RICH_TEXT_FIELD = 2,\n}\n\n/**\n * Describes the enum importhub.v1.ProcessorTarget.\n */\nexport const ProcessorTargetSchema: GenEnum<ProcessorTarget> = /*@__PURE__*/\n enumDesc(file_importhub_v1_processor, 1);\n\n/**\n * ProcessorService is the Processor catalogue: every Processor an Import\n * Profile may list, with what it is for and the settings it takes\n * (manage-import-profiles:AC5). The UI generates each Processor's settings\n * form from its settings spec (manage-import-profiles:AC4), and a Profile's\n * settings are checked against the same spec when it is saved.\n *\n * The catalogue is the same for every workspace; reading it needs `viewer`\n * (ADR 0010).\n *\n * @generated from service importhub.v1.ProcessorService\n */\nexport const ProcessorService: GenService<{\n /**\n * ListProcessors returns every Processor, by name.\n *\n * @generated from rpc importhub.v1.ProcessorService.ListProcessors\n */\n listProcessors: {\n methodKind: \"unary\";\n input: typeof ListProcessorsRequestSchema;\n output: typeof ListProcessorsResponseSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_importhub_v1_processor, 0);\n\n","import { create, fromJson, type JsonObject, type JsonValue, toJson } from \"@bufbuild/protobuf\";\nimport { type Timestamp, timestampDate, timestampFromDate } from \"@bufbuild/protobuf/wkt\";\nimport { Code, ConnectError, createClient, type Transport } from \"@connectrpc/connect\";\nimport { createConnectTransport } from \"@connectrpc/connect-web\";\nimport type { Schema } from \"@knkcs/fieldkit/schema\";\nimport { type APIKey as APIKeyPb, APIKeyService } from \"../../../../gen/ts/importhub/v1/api_key_pb\";\nimport {\n\tConfigurationInUseSchema,\n\ttype ConfigurationRelease as ConfigurationReleasePb,\n\ttype ConfigurationRevision as ConfigurationRevisionPb,\n\ttype ConfigurationState as ConfigurationStatePb,\n\ttype FieldComparison as FieldComparisonPb,\n\tFieldComparisonStatus as FieldComparisonStatusPb,\n\ttype Validity as ValidityPb,\n\tValiditySchema,\n} from \"../../../../gen/ts/importhub/v1/configuration_pb\";\nimport {\n\tEntitySetContentSchema,\n\ttype EntitySet as EntitySetPb,\n\tEntitySetService,\n} from \"../../../../gen/ts/importhub/v1/entity_set_pb\";\nimport {\n\ttype ConfigurationReleaseRef as ConfigurationReleaseRefPb,\n\tImportOutcome as ImportOutcomePb,\n\ttype Import as ImportPb,\n\tImportPhase as ImportPhasePb,\n\tImportService,\n} from \"../../../../gen/ts/importhub/v1/import_pb\";\nimport {\n\tImportProfileContentSchema,\n\ttype ImportProfile as ImportProfilePb,\n\tImportProfileService,\n\ttype ProcessorStep as ProcessorStepPb,\n\tProcessorStepSchema,\n} from \"../../../../gen/ts/importhub/v1/import_profile_pb\";\nimport {\n\tMappingContentSchema,\n\ttype Mapping as MappingPb,\n\tMappingService,\n} from \"../../../../gen/ts/importhub/v1/mapping_pb\";\nimport {\n\tProcessorKind,\n\tProcessorService,\n\tProcessorTarget,\n} from \"../../../../gen/ts/importhub/v1/processor_pb\";\nimport {\n\ttype ApiKey,\n\ttype ConfigurationComparison,\n\ttype ConfigurationHistoryPage,\n\tConfigurationInUseError,\n\ttype ConfigurationReleaseRecord,\n\ttype ConfigurationState,\n\ttype ConfigurationVersion,\n\ttype EntitySet,\n\ttype FieldComparisonStatus,\n\ttype Import,\n\ttype ImporthubClient,\n\ttype ImportOutcome,\n\ttype ImportPhase,\n\ttype ImportProfile,\n\ttype ImportProfileContent,\n\ttype ImportReleaseRef,\n\ttype Mapping,\n\ttype MappingContent,\n\tNameTakenError,\n\ttype ProcessorStep,\n\tReleaseRefusedError,\n\tStartRefusedError,\n\ttype Validity,\n} from \"./importhub-client\";\n\nexport interface CreateConnectImporthubClientOptions {\n\t/**\n\t * Base URL on the host origin under which `/importhub.v1.…Service/…` is\n\t * served: \"\" when importhub serves the page itself (the Standalone App),\n\t * the mount prefix when a host proxies it.\n\t */\n\tbaseUrl: string;\n\t/**\n\t * The fetch the transport calls, e.g. one that adds `credentials:\n\t * \"include\"` so a session cookie travels, or a host's own token.\n\t */\n\tfetch?: typeof fetch;\n\t/** A pre-built transport (tests: `createRouterTransport`). Overrides baseUrl and fetch. */\n\ttransport?: Transport;\n\t/**\n\t * How a Source File's content is sent to the upload URL importhub hands\n\t * out; `putToBlobStore` by default. Tests in Node, which has no\n\t * XMLHttpRequest, pass their own.\n\t */\n\tputFile?: (url: string, file: File, onProgress: (fraction: number) => void) => Promise<void>;\n}\n\n/**\n * Sends a file to an upload URL of importhub's blob store: one `PUT` with\n * `x-ms-blob-type: BlockBlob`, as CreateSourceFileUpload asks. Through\n * XMLHttpRequest, not fetch, because only XHR reports upload progress\n * (mediahub-ui's lib/sas-upload.ts does the same). No credentials travel: the\n * URL carries its own short-lived signature, and the blob store is another\n * origin.\n */\nexport function putToBlobStore(\n\turl: string,\n\tfile: File,\n\tonProgress: (fraction: number) => void,\n): Promise<void> {\n\treturn new Promise((resolve, reject) => {\n\t\tconst xhr = new XMLHttpRequest();\n\t\txhr.open(\"PUT\", url);\n\t\txhr.setRequestHeader(\"x-ms-blob-type\", \"BlockBlob\");\n\t\txhr.setRequestHeader(\"Content-Type\", file.type || \"application/xml\");\n\t\txhr.upload.onprogress = (e) => {\n\t\t\tif (e.lengthComputable && e.total > 0) onProgress(e.loaded / e.total);\n\t\t};\n\t\txhr.onload = () => {\n\t\t\tif (xhr.status >= 200 && xhr.status < 300) {\n\t\t\t\tonProgress(1);\n\t\t\t\tresolve();\n\t\t\t} else {\n\t\t\t\treject(new Error(`the upload failed: ${xhr.status} ${xhr.statusText}`));\n\t\t\t}\n\t\t};\n\t\txhr.onerror = () => reject(new Error(\"the upload failed: the network is away\"));\n\t\txhr.send(file);\n\t});\n}\n\nconst validityOf = (v: ValidityPb | undefined): Validity => ({\n\tvalid: v?.valid ?? false,\n\treasons: (v?.reasons ?? []).map((r) => ({ path: r.path, code: r.code, message: r.message })),\n});\n\nconst stateOf = (s: ConfigurationStatePb | undefined): ConfigurationState => ({\n\tdraftRevisionId: s?.draftRevisionId ?? \"\",\n\tdraftDiffersFromRelease: s?.draftDiffersFromRelease ?? true,\n\t...(s?.latestRelease\n\t\t? { latestRelease: { id: s.latestRelease.id, number: s.latestRelease.number } }\n\t\t: {}),\n});\n\nconst stepOf = (s: ProcessorStepPb): ProcessorStep => ({\n\tprocessor: s.processor,\n\tsettings: { ...(s.settings ?? {}) },\n});\n\nconst stepPb = (s: ProcessorStep) => ({\n\tprocessor: s.processor,\n\tsettings: s.settings as JsonObject,\n});\n\nfunction profileOf(p: ImportProfilePb): ImportProfile {\n\tconst c = p.content;\n\treturn {\n\t\tid: p.id,\n\t\tcontent: {\n\t\t\tname: c?.name ?? \"\",\n\t\t\tdescription: c?.description ?? \"\",\n\t\t\tentitySetId: c?.entitySetId ?? \"\",\n\t\t\tpreprocessors: (c?.preprocessors ?? []).map(stepOf),\n\t\t\tmappingIds: [...(c?.mappingIds ?? [])],\n\t\t\tpostProcessors: (c?.postProcessors ?? []).map(stepOf),\n\t\t\tautoPublish: c?.autoPublish ?? false,\n\t\t\tdeleteSourceFileOnSuccess: c?.deleteSourceFileOnSuccess ?? false,\n\t\t},\n\t\t// What an Import would meet now, not only what was decided at the save\n\t\t// (manage-import-profiles:AC6).\n\t\tvalidity: validityOf(p.currentValidity ?? p.validity),\n\t\tstate: stateOf(p.state),\n\t};\n}\n\nconst profileContentPb = (c: ImportProfileContent) =>\n\tcreate(ImportProfileContentSchema, {\n\t\t...c,\n\t\tpreprocessors: c.preprocessors.map((s) => create(ProcessorStepSchema, stepPb(s))),\n\t\tpostProcessors: c.postProcessors.map((s) => create(ProcessorStepSchema, stepPb(s))),\n\t});\n\n// A Mapping's content travels as its proto JSON: the screens edit a few\n// fields, and every other one (F4's) must come back exactly as it went out.\nfunction mappingOf(m: MappingPb): Mapping {\n\tconst content = m.content\n\t\t? (toJson(MappingContentSchema, m.content) as unknown as MappingContent)\n\t\t: ({ name: \"\", blueprintId: \"\", blueprintReleaseId: \"\" } as MappingContent);\n\treturn {\n\t\tid: m.id,\n\t\tcontent: {\n\t\t\t...content,\n\t\t\tname: content.name ?? \"\",\n\t\t\tblueprintId: content.blueprintId ?? \"\",\n\t\t\tblueprintReleaseId: content.blueprintReleaseId ?? \"\",\n\t\t},\n\t\tvalidity: validityOf(m.currentValidity ?? m.validity),\n\t\tstate: stateOf(m.state),\n\t};\n}\n\nconst mappingContentPb = (c: MappingContent) =>\n\tfromJson(MappingContentSchema, c as unknown as JsonValue, { ignoreUnknownFields: false });\n\nfunction entitySetOf(e: EntitySetPb): EntitySet {\n\treturn {\n\t\tid: e.id,\n\t\tcontent: {\n\t\t\tname: e.content?.name ?? \"\",\n\t\t\tdescription: e.content?.description ?? \"\",\n\t\t\tentities: { ...(e.content?.entities ?? {}) },\n\t\t},\n\t\tvalidity: validityOf(e.validity),\n\t\tstate: stateOf(e.state),\n\t};\n}\n\nconst isoOf = (t: Timestamp | undefined): string => (t ? timestampDate(t).toISOString() : \"\");\n\nconst releaseOf = (r: ConfigurationReleasePb | undefined): ConfigurationReleaseRecord => ({\n\tid: r?.id ?? \"\",\n\tnumber: r?.number ?? 0,\n\trevisionId: r?.revisionId ?? \"\",\n\treleasedBy: r?.releasedBy ?? \"\",\n\treleasedAt: isoOf(r?.releasedAt),\n});\n\nconst revisionOf = (r: ConfigurationRevisionPb) => ({\n\tid: r.id,\n\tsavedBy: r.savedBy,\n\tsavedAt: isoOf(r.savedAt),\n\tvalidity: validityOf(r.validity),\n\trestoredFromRevisionId: r.restoredFromRevisionId,\n});\n\nconst historyOf = (res: {\n\trevisions: ConfigurationRevisionPb[];\n\treleases: ConfigurationReleasePb[];\n\tnextPageToken: string;\n}): ConfigurationHistoryPage => ({\n\trevisions: res.revisions.map(revisionOf),\n\treleases: res.releases.map(releaseOf),\n\tnextPageToken: res.nextPageToken,\n});\n\nconst STATUS: Record<FieldComparisonStatusPb, FieldComparisonStatus> = {\n\t[FieldComparisonStatusPb.UNSPECIFIED]: \"changed\",\n\t[FieldComparisonStatusPb.UNCHANGED]: \"unchanged\",\n\t[FieldComparisonStatusPb.ADDED]: \"added\",\n\t[FieldComparisonStatusPb.REMOVED]: \"removed\",\n\t[FieldComparisonStatusPb.CHANGED]: \"changed\",\n};\n\n// A compared Revision's content as JSON in the proto's own field names, the\n// names importhub's FieldComparison uses, and with every field present, so\n// a side by side reads the same rows on both sides.\nconst versionOf = <M extends { revisionId: string }, C>(\n\tm: (M & { content?: C }) | undefined,\n\tasJson: (c: C) => JsonValue,\n): ConfigurationVersion => ({\n\trevisionId: m?.revisionId ?? \"\",\n\tcontent: m?.content ? (asJson(m.content) as Record<string, unknown>) : {},\n});\nconst JSON_OPTS = { useProtoFieldName: true, alwaysEmitImplicit: true } as const;\n\nconst comparisonOf = <M extends { revisionId: string }, C>(\n\tres: { from?: M & { content?: C }; to?: M & { content?: C }; fields: FieldComparisonPb[] },\n\tasJson: (c: C) => JsonValue,\n): ConfigurationComparison => ({\n\tfrom: versionOf(res.from, asJson),\n\tto: versionOf(res.to, asJson),\n\tfields: res.fields.map((f) => ({ field: f.field, status: STATUS[f.status] ?? \"changed\" })),\n});\n\nconst PHASES: Record<ImportPhasePb, ImportPhase> = {\n\t[ImportPhasePb.UNSPECIFIED]: \"queued\",\n\t[ImportPhasePb.QUEUED]: \"queued\",\n\t[ImportPhasePb.READING]: \"reading\",\n\t[ImportPhasePb.WRITING]: \"writing\",\n\t[ImportPhasePb.ENDED]: \"ended\",\n};\n\nconst OUTCOMES: Partial<Record<ImportOutcomePb, ImportOutcome>> = {\n\t[ImportOutcomePb.SUCCEEDED]: \"succeeded\",\n\t[ImportOutcomePb.SUCCEEDED_WITH_PROBLEMS]: \"succeeded_with_problems\",\n\t[ImportOutcomePb.FAILED]: \"failed\",\n\t[ImportOutcomePb.CANCELLED]: \"cancelled\",\n};\n\nconst releaseRefOf = (r: ConfigurationReleaseRefPb): ImportReleaseRef => ({\n\tconfigurationId: r.configurationId,\n\tname: r.name,\n\treleaseId: r.releaseId,\n\tnumber: r.number,\n});\n\nfunction importOf(i: ImportPb): Import {\n\tconst c = i.counts;\n\tconst outcome = OUTCOMES[i.outcome];\n\treturn {\n\t\tid: i.id,\n\t\timportProfileId: i.importProfileId,\n\t\timportProfileName: i.importProfileName,\n\t\tsourceFileId: i.sourceFileId,\n\t\tstartedBy: i.startedBy,\n\t\tphase: PHASES[i.phase] ?? \"queued\",\n\t\t...(outcome ? { outcome } : {}),\n\t\tfailureReason: i.failureReason,\n\t\tprogress: { done: i.progress?.done ?? 0, total: i.progress?.total ?? 0 },\n\t\tcounts: {\n\t\t\tmatched: c?.matched ?? 0,\n\t\t\tcreated: c?.created ?? 0,\n\t\t\tproblems: c?.problems ?? 0,\n\t\t\tplanned: c?.planned ?? 0,\n\t\t\tcorrected: c?.corrected ?? 0,\n\t\t\tkept: c?.kept ?? 0,\n\t\t\tunchanged: c?.unchanged ?? 0,\n\t\t},\n\t\tchangeSetId: i.changeSetId,\n\t\treleases: {\n\t\t\t...(i.releases?.importProfile\n\t\t\t\t? { importProfile: releaseRefOf(i.releases.importProfile) }\n\t\t\t\t: {}),\n\t\t\tmappings: (i.releases?.mappings ?? []).map(releaseRefOf),\n\t\t\t...(i.releases?.entitySet ? { entitySet: releaseRefOf(i.releases.entitySet) } : {}),\n\t\t},\n\t\tcreateTime: isoOf(i.createTime),\n\t\tstartTime: isoOf(i.startTime),\n\t\tendTime: isoOf(i.endTime),\n\t\tcancelledBy: i.cancelledBy,\n\t\teffectiveDate: i.effectiveDate,\n\t\t...(i.source ? { source: { date: i.source.date, reference: i.source.reference } } : {}),\n\t};\n}\n\nconst apiKeyOf = (k: APIKeyPb): ApiKey => ({\n\tid: k.id,\n\tname: k.name,\n\tkeyPrefix: k.keyPrefix,\n\towner: k.owner,\n\texpireTime: isoOf(k.expireTime),\n\tcreateTime: isoOf(k.createTime),\n});\n\n/**\n * As `call`, but a refused Start is a StartRefusedError: PermissionDenied\n * names the right the starter lacks (contenthub `editor`, or `publisher` for\n * Auto-publish, or importhub's own `importer`), FailedPrecondition what of\n * the configuration has no Release or is invalid now, NotFound a Profile or\n * Source File gone meanwhile (StartImport's contract). Its message is importhub's, which the screen shows as it is.\n */\nasync function startCall<T>(run: () => Promise<T>): Promise<T> {\n\ttry {\n\t\treturn await run();\n\t} catch (err) {\n\t\tconst e = ConnectError.from(err);\n\t\tif (\n\t\t\te.code === Code.PermissionDenied ||\n\t\t\te.code === Code.FailedPrecondition ||\n\t\t\te.code === Code.NotFound\n\t\t) {\n\t\t\tthrow new StartRefusedError(e.rawMessage);\n\t\t}\n\t\tthrow e;\n\t}\n}\n\n/**\n * The errors a screen tells apart: a delete refused because Profiles use the\n * configuration, with them; a name another one has; and a cut refused, with\n * the draft's reasons when it is invalid. Anything else is thrown as it came.\n */\nfunction translate(err: unknown): never {\n\tconst e = ConnectError.from(err);\n\tif (e.code === Code.FailedPrecondition) {\n\t\tconst [inUse] = e.findDetails(ConfigurationInUseSchema);\n\t\tif (inUse) {\n\t\t\tthrow new ConfigurationInUseError(\n\t\t\t\tinUse.importProfiles.map((p) => ({ id: p.id, name: p.name })),\n\t\t\t\te.rawMessage,\n\t\t\t);\n\t\t}\n\t}\n\tif (e.code === Code.AlreadyExists) throw new NameTakenError(e.rawMessage);\n\tthrow e;\n}\n\n/**\n * As `call`, but a refused cut is a ReleaseRefusedError. FailedPrecondition\n * is how every Cut…Release RPC refuses (an invalid draft, with its Validity\n * as a detail; an unchanged draft; a draft that moved), and the only thing\n * it means there.\n */\nasync function cutCall<T>(run: () => Promise<T>): Promise<T> {\n\ttry {\n\t\treturn await run();\n\t} catch (err) {\n\t\tconst e = ConnectError.from(err);\n\t\tif (e.code === Code.FailedPrecondition) {\n\t\t\tconst [validity] = e.findDetails(ValiditySchema);\n\t\t\tthrow new ReleaseRefusedError(e.rawMessage, validity ? validityOf(validity) : undefined);\n\t\t}\n\t\ttranslate(err);\n\t}\n}\n\nasync function call<T>(run: () => Promise<T>): Promise<T> {\n\ttry {\n\t\treturn await run();\n\t} catch (err) {\n\t\ttranslate(err);\n\t}\n}\n\n/**\n * The one call a host makes to talk to importhub (knkcms/core ADR 0003):\n * an `ImporthubClient` over Connect.\n */\nexport function createConnectImporthubClient(\n\toptions: CreateConnectImporthubClientOptions,\n): ImporthubClient {\n\tconst transport =\n\t\toptions.transport ?? createConnectTransport({ baseUrl: options.baseUrl, fetch: options.fetch });\n\tconst profiles = createClient(ImportProfileService, transport);\n\tconst processors = createClient(ProcessorService, transport);\n\tconst mappings = createClient(MappingService, transport);\n\tconst entitySets = createClient(EntitySetService, transport);\n\tconst imports = createClient(ImportService, transport);\n\tconst apiKeys = createClient(APIKeyService, transport);\n\tconst putFile = options.putFile ?? putToBlobStore;\n\treturn {\n\t\tlistImportProfiles: () =>\n\t\t\tcall(async () => (await profiles.listImportProfiles({})).importProfiles.map(profileOf)),\n\t\tgetImportProfile: (id) =>\n\t\t\tcall(async () =>\n\t\t\t\tprofileOf(requireMessage((await profiles.getImportProfile({ id })).importProfile)),\n\t\t\t),\n\t\tcreateImportProfile: (content) =>\n\t\t\tcall(async () =>\n\t\t\t\tprofileOf(\n\t\t\t\t\trequireMessage(\n\t\t\t\t\t\t(await profiles.createImportProfile({ content: profileContentPb(content) }))\n\t\t\t\t\t\t\t.importProfile,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\tupdateImportProfile: (id, content, draftRevisionId) =>\n\t\t\tcall(async () =>\n\t\t\t\tprofileOf(\n\t\t\t\t\trequireMessage(\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tawait profiles.updateImportProfile({\n\t\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\t\tcontent: profileContentPb(content),\n\t\t\t\t\t\t\t\tdraftRevisionId,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t).importProfile,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\tdeleteImportProfile: (id) =>\n\t\t\tcall(async () => {\n\t\t\t\tawait profiles.deleteImportProfile({ id });\n\t\t\t}),\n\n\t\tlistProcessors: () =>\n\t\t\tcall(async () =>\n\t\t\t\t(await processors.listProcessors({})).processors.map((p) => ({\n\t\t\t\t\tname: p.name,\n\t\t\t\t\tkind:\n\t\t\t\t\t\tp.kind === ProcessorKind.POST_PROCESSOR\n\t\t\t\t\t\t\t? (\"post_processor\" as const)\n\t\t\t\t\t\t\t: (\"preprocessor\" as const),\n\t\t\t\t\ttarget:\n\t\t\t\t\t\tp.target === ProcessorTarget.RICH_TEXT_FIELD\n\t\t\t\t\t\t\t? (\"rich_text_field\" as const)\n\t\t\t\t\t\t\t: (\"source_file\" as const),\n\t\t\t\t\tdescription: p.description,\n\t\t\t\t\tsettingsSpec: p.settingsSpec as unknown as Schema,\n\t\t\t\t})),\n\t\t\t),\n\n\t\tlistMappings: () => call(async () => (await mappings.listMappings({})).mappings.map(mappingOf)),\n\t\tgetMapping: (id) =>\n\t\t\tcall(async () => mappingOf(requireMessage((await mappings.getMapping({ id })).mapping))),\n\t\tcreateMapping: (content) =>\n\t\t\tcall(async () =>\n\t\t\t\tmappingOf(\n\t\t\t\t\trequireMessage(\n\t\t\t\t\t\t(await mappings.createMapping({ content: mappingContentPb(content) })).mapping,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\tupdateMapping: (id, content, draftRevisionId) =>\n\t\t\tcall(async () =>\n\t\t\t\tmappingOf(\n\t\t\t\t\trequireMessage(\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tawait mappings.updateMapping({\n\t\t\t\t\t\t\t\tid,\n\t\t\t\t\t\t\t\tcontent: mappingContentPb(content),\n\t\t\t\t\t\t\t\tdraftRevisionId,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t).mapping,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\tdeleteMapping: (id) =>\n\t\t\tcall(async () => {\n\t\t\t\tawait mappings.deleteMapping({ id });\n\t\t\t}),\n\t\tlistMappingImportProfiles: (id) =>\n\t\t\tcall(async () =>\n\t\t\t\t(await mappings.listMappingImportProfiles({ id })).importProfiles.map((p) => ({\n\t\t\t\t\tid: p.id,\n\t\t\t\t\tname: p.name,\n\t\t\t\t})),\n\t\t\t),\n\t\tcheckMappingBlueprintRelease: (id, blueprintReleaseId) =>\n\t\t\tcall(async () => {\n\t\t\t\tconst res = await mappings.checkMappingBlueprintRelease({ id, blueprintReleaseId });\n\t\t\t\treturn {\n\t\t\t\t\tblueprintId: res.blueprintId,\n\t\t\t\t\tmissingFieldPaths: [...res.missingFieldPaths],\n\t\t\t\t\tmissingReleaseSpecFields: [...res.missingReleaseSpecFields],\n\t\t\t\t};\n\t\t\t}),\n\n\t\tlistEntitySets: () =>\n\t\t\tcall(async () => (await entitySets.listEntitySets({})).entitySets.map(entitySetOf)),\n\t\tgetEntitySet: (id) =>\n\t\t\tcall(async () =>\n\t\t\t\tentitySetOf(requireMessage((await entitySets.getEntitySet({ id })).entitySet)),\n\t\t\t),\n\t\tcreateEntitySet: (content) =>\n\t\t\tcall(async () =>\n\t\t\t\tentitySetOf(requireMessage((await entitySets.createEntitySet({ content })).entitySet)),\n\t\t\t),\n\t\tupdateEntitySet: (id, content, draftRevisionId) =>\n\t\t\tcall(async () =>\n\t\t\t\tentitySetOf(\n\t\t\t\t\trequireMessage(\n\t\t\t\t\t\t(await entitySets.updateEntitySet({ id, content, draftRevisionId })).entitySet,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\tdeleteEntitySet: (id) =>\n\t\t\tcall(async () => {\n\t\t\t\tawait entitySets.deleteEntitySet({ id });\n\t\t\t}),\n\n\t\t// One RPC per kind of configuration, each on its own service (the\n\t\t// protos have no configuration service: a client always knows which\n\t\t// kind it looks at); the screens ask by kind.\n\t\tcutRelease: (kind, id, draftRevisionId) =>\n\t\t\tcutCall(async () => {\n\t\t\t\tconst req = { id, draftRevisionId };\n\t\t\t\tswitch (kind) {\n\t\t\t\t\tcase \"importProfile\":\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\trelease: releaseOf((await profiles.cutImportProfileRelease(req)).release),\n\t\t\t\t\t\t\timportProfiles: [],\n\t\t\t\t\t\t};\n\t\t\t\t\tcase \"mapping\": {\n\t\t\t\t\t\tconst res = await mappings.cutMappingRelease(req);\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\trelease: releaseOf(res.release),\n\t\t\t\t\t\t\timportProfiles: res.importProfiles.map((p) => ({ id: p.id, name: p.name })),\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\tcase \"entitySet\":\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\trelease: releaseOf((await entitySets.cutEntitySetRelease(req)).release),\n\t\t\t\t\t\t\timportProfiles: [],\n\t\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}),\n\t\tlistHistory: (kind, id, pageToken) =>\n\t\t\tcall(async () => {\n\t\t\t\tconst req = { id, pageToken };\n\t\t\t\tswitch (kind) {\n\t\t\t\t\tcase \"importProfile\":\n\t\t\t\t\t\treturn historyOf(await profiles.listImportProfileHistory(req));\n\t\t\t\t\tcase \"mapping\":\n\t\t\t\t\t\treturn historyOf(await mappings.listMappingHistory(req));\n\t\t\t\t\tcase \"entitySet\":\n\t\t\t\t\t\treturn historyOf(await entitySets.listEntitySetHistory(req));\n\t\t\t\t}\n\t\t\t}),\n\t\tcompareRevisions: (kind, id, fromRevisionId, toRevisionId) =>\n\t\t\tcall(async () => {\n\t\t\t\tconst req = { id, fromRevisionId, toRevisionId };\n\t\t\t\tswitch (kind) {\n\t\t\t\t\tcase \"importProfile\":\n\t\t\t\t\t\treturn comparisonOf(await profiles.compareImportProfileRevisions(req), (c) =>\n\t\t\t\t\t\t\ttoJson(ImportProfileContentSchema, c, JSON_OPTS),\n\t\t\t\t\t\t);\n\t\t\t\t\tcase \"mapping\":\n\t\t\t\t\t\treturn comparisonOf(await mappings.compareMappingRevisions(req), (c) =>\n\t\t\t\t\t\t\ttoJson(MappingContentSchema, c, JSON_OPTS),\n\t\t\t\t\t\t);\n\t\t\t\t\tcase \"entitySet\":\n\t\t\t\t\t\treturn comparisonOf(await entitySets.compareEntitySetRevisions(req), (c) =>\n\t\t\t\t\t\t\ttoJson(EntitySetContentSchema, c, JSON_OPTS),\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}),\n\t\trestoreRevision: (kind, id, revisionId, draftRevisionId) =>\n\t\t\tcall(async () => {\n\t\t\t\tconst req = { id, revisionId, draftRevisionId };\n\t\t\t\tswitch (kind) {\n\t\t\t\t\tcase \"importProfile\":\n\t\t\t\t\t\tawait profiles.restoreImportProfileRevision(req);\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase \"mapping\":\n\t\t\t\t\t\tawait mappings.restoreMappingRevision(req);\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase \"entitySet\":\n\t\t\t\t\t\tawait entitySets.restoreEntitySetRevision(req);\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}),\n\n\t\tuploadSourceFile: (file, onProgress) =>\n\t\t\tcall(async () => {\n\t\t\t\tconst res = await imports.createSourceFileUpload({ fileName: file.name });\n\t\t\t\tconst sf = requireMessage(res.sourceFile);\n\t\t\t\tawait putFile(res.uploadUrl, file, onProgress);\n\t\t\t\treturn { id: sf.id, fileName: sf.fileName };\n\t\t\t}),\n\t\tstartImport: (input) =>\n\t\t\tstartCall(async () =>\n\t\t\t\timportOf(\n\t\t\t\t\trequireMessage(\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tawait imports.startImport({\n\t\t\t\t\t\t\t\timportProfileId: input.importProfileId,\n\t\t\t\t\t\t\t\tsourceFileId: input.sourceFileId,\n\t\t\t\t\t\t\t\teffectiveDate: input.effectiveDate ?? \"\",\n\t\t\t\t\t\t\t\tsource: input.source,\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t).import,\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t),\n\t\tlistImports: (pageToken) =>\n\t\t\tcall(async () => {\n\t\t\t\tconst res = await imports.listImports({ pageToken });\n\t\t\t\treturn { imports: res.imports.map(importOf), nextPageToken: res.nextPageToken };\n\t\t\t}),\n\t\tgetImport: (id) =>\n\t\t\tcall(async () => importOf(requireMessage((await imports.getImport({ id })).import))),\n\t\tcancelImport: (id) =>\n\t\t\tcall(async () => importOf(requireMessage((await imports.cancelImport({ id })).import))),\n\t\tlistItemProblems: (importId, filter) =>\n\t\t\tcall(async () => {\n\t\t\t\tconst res = await imports.listItemProblems({\n\t\t\t\t\timportId,\n\t\t\t\t\tmappingId: filter.mappingId,\n\t\t\t\t\tsourceKeyQuery: filter.sourceKeyQuery,\n\t\t\t\t\tpageToken: filter.pageToken,\n\t\t\t\t});\n\t\t\t\treturn {\n\t\t\t\t\titemProblems: res.itemProblems.map((p) => ({\n\t\t\t\t\t\tid: p.id,\n\t\t\t\t\t\tmappingId: p.mappingId,\n\t\t\t\t\t\tmappingName: p.mappingName,\n\t\t\t\t\t\tsourceKey: p.sourceKey,\n\t\t\t\t\t\tfield: p.field,\n\t\t\t\t\t\treason: p.reason,\n\t\t\t\t\t})),\n\t\t\t\t\ttotalCount: res.totalCount,\n\t\t\t\t\tmatchingCount: res.matchingCount,\n\t\t\t\t\tmappings: res.mappings.map((m) => ({\n\t\t\t\t\t\tmappingId: m.mappingId,\n\t\t\t\t\t\tmappingName: m.mappingName,\n\t\t\t\t\t\tcount: m.count,\n\t\t\t\t\t})),\n\t\t\t\t\tnextPageToken: res.nextPageToken,\n\t\t\t\t};\n\t\t\t}),\n\n\t\tlistApiKeys: () => call(async () => (await apiKeys.listAPIKeys({})).apiKeys.map(apiKeyOf)),\n\t\tcreateApiKey: (input) =>\n\t\t\tcall(async () => {\n\t\t\t\tconst res = await apiKeys.createAPIKey({\n\t\t\t\t\tname: input.name,\n\t\t\t\t\t// Unset for never, as CreateAPIKey reads it.\n\t\t\t\t\texpireTime: input.expireTime ? timestampFromDate(new Date(input.expireTime)) : undefined,\n\t\t\t\t});\n\t\t\t\treturn { apiKey: apiKeyOf(requireMessage(res.apiKey)), secret: res.secret };\n\t\t\t}),\n\t\trevokeApiKey: (id) =>\n\t\t\tcall(async () => {\n\t\t\t\tawait apiKeys.revokeAPIKey({ id });\n\t\t\t}),\n\t};\n}\n\n/** A response's one message, which importhub always sets. */\nfunction requireMessage<T>(m: T | undefined): T {\n\tif (m === undefined)\n\t\tthrow new ConnectError(\"importhub answered without a message\", Code.Internal);\n\treturn m;\n}\n","import { Link } from \"@knkcs/anker/primitives\";\nimport { ExternalLink } from \"lucide-react\";\nimport { useTranslation } from \"react-i18next\";\nimport { IMPORTHUB_UI_NS } from \"../i18n/resources\";\nimport { useImporthubHost } from \"./host\";\n\nexport interface ChangeSetLinkProps {\n\tchangeSetId: string;\n}\n\n/**\n * The link out to a Change Set in contenthub, where the host says it is\n * (`ImporthubHost.changeSetHref`). Nothing when the host has no address for\n * it: a link to nowhere is worse than none.\n */\nexport function ChangeSetLink({ changeSetId }: ChangeSetLinkProps) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst href = useImporthubHost().changeSetHref(changeSetId);\n\tif (!href) return null;\n\treturn (\n\t\t<Link href={href} target=\"_blank\" rel=\"noopener noreferrer\">\n\t\t\t{t(\"changeSet.open\")}\n\t\t\t<ExternalLink size={14} aria-hidden />\n\t\t</Link>\n\t);\n}\n","import { EmptyState } from \"@knkcs/anker/atoms\";\nimport { useHostIdentity } from \"@knkcs/anker/host\";\nimport { Box, Spinner } from \"@knkcs/anker/primitives\";\nimport { IndexPageTemplate } from \"@knkcs/anker/templates\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport { Ampersand, Blocks, FileCog, FileUp, type LucideIcon, Waypoints } from \"lucide-react\";\nimport { useTranslation } from \"react-i18next\";\nimport type { ImporthubClient } from \"../client/importhub-client\";\nimport { IMPORTHUB_UI_NS } from \"../i18n/resources\";\nimport type { ImporthubSection } from \"./host\";\nimport { importhubKeys } from \"./query-keys\";\n\nexport interface ImporthubStartPageProps {\n\tclient: ImporthubClient;\n\t/** The section whose start page this is. */\n\tsection: ImporthubSection;\n}\n\n/** Each section's icon, as the Standalone App's sidebar shows it too. */\nexport const IMPORTHUB_SECTION_ICONS: Record<ImporthubSection, LucideIcon> = {\n\timports: FileUp,\n\tprofiles: FileCog,\n\tmappings: Waypoints,\n\tentitySets: Ampersand,\n\tprocessors: Blocks,\n};\n\n/**\n * A section's start page, for a host that has no screen for it yet: the section's\n * title in the frame, and a body saying what the workspace holds of it. Where\n * importhub can already list a section it says how many there are, read for the host's active workspace; Imports have\n * nothing to read yet, and Mappings are counted on their own screen.\n */\nexport function ImporthubStartPage({ client, section }: ImporthubStartPageProps) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst Icon = IMPORTHUB_SECTION_ICONS[section];\n\treturn (\n\t\t<IndexPageTemplate title={t(`section.${section}.title`)}>\n\t\t\t<Box px=\"8\" py=\"6\">\n\t\t\t\t<EmptyState\n\t\t\t\t\ticon={<Icon size={32} aria-hidden />}\n\t\t\t\t\theader={t(`section.${section}.title`)}\n\t\t\t\t\tdescription={<SectionSummary client={client} section={section} />}\n\t\t\t\t/>\n\t\t\t</Box>\n\t\t</IndexPageTemplate>\n\t);\n}\n\nfunction SectionSummary({ client, section }: ImporthubStartPageProps) {\n\tswitch (section) {\n\t\tcase \"profiles\":\n\t\t\treturn (\n\t\t\t\t<CountSummary\n\t\t\t\t\tsection={section}\n\t\t\t\t\tqueryKey={importhubKeys.importProfiles}\n\t\t\t\t\tread={() => client.listImportProfiles()}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase \"entitySets\":\n\t\t\treturn (\n\t\t\t\t<CountSummary\n\t\t\t\t\tsection={section}\n\t\t\t\t\tqueryKey={importhubKeys.entitySets}\n\t\t\t\t\tread={() => client.listEntitySets()}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase \"processors\":\n\t\t\treturn (\n\t\t\t\t<CountSummary\n\t\t\t\t\tsection={section}\n\t\t\t\t\tqueryKey={importhubKeys.processors}\n\t\t\t\t\tread={() => client.listProcessors()}\n\t\t\t\t/>\n\t\t\t);\n\t\tdefault:\n\t\t\treturn <NothingYet section={section} />;\n\t}\n}\n\nfunction NothingYet({ section }: { section: \"imports\" | \"mappings\" }) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\treturn <>{t(`section.${section}.empty`)}</>;\n}\n\nfunction CountSummary({\n\tsection,\n\tqueryKey,\n\tread,\n}: {\n\tsection: \"profiles\" | \"entitySets\" | \"processors\";\n\t/** The section's query key for a workspace (`importhubKeys`). */\n\tqueryKey: (workspaceId: string) => readonly unknown[];\n\tread: () => Promise<unknown[]>;\n}) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { workspaceId } = useHostIdentity();\n\tconst query = useQuery({ queryKey: queryKey(workspaceId), queryFn: read });\n\tif (query.isPending) return <Spinner size=\"sm\" aria-label={t(\"startPage.loading\")} />;\n\t// Text, not an Alert: the summary is the EmptyState's description, a\n\t// paragraph, which can hold no block.\n\tif (query.isError) return <>{t(\"startPage.error\")}</>;\n\treturn <>{t(`section.${section}.summary`, { count: query.data.length })}</>;\n}\n","import { StatusBadge, type StatusBadgeTone } from \"@knkcs/anker/atoms\";\nimport { StatusBadgeCell } from \"@knkcs/anker/components\";\nimport { useHostIdentity } from \"@knkcs/anker/host\";\nimport type { TFunction } from \"i18next\";\nimport { useCallback } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport type { Import } from \"../client/importhub-client\";\nimport { IMPORTHUB_UI_NS } from \"../i18n/resources\";\n\n/** Where an Import stands, as one word: its Outcome once it has one, else its phase. */\ntype ImportState =\n\t| \"queued\"\n\t| \"reading\"\n\t| \"writing\"\n\t| \"cancelling\"\n\t| \"succeeded\"\n\t| \"succeeded_with_problems\"\n\t| \"failed\"\n\t| \"cancelled\";\n\n// A cancel asked of a running Import shows as Cancelling until the worker\n// reaches its next item and ends it (CancelImport's contract): the person who\n// asked sees their ask was heard, before the Outcome arrives.\nfunction statusOf(im: Import): ImportState {\n\tif (im.outcome) return im.outcome;\n\tif (im.cancelledBy) return \"cancelling\";\n\treturn im.phase === \"ended\" ? \"succeeded\" : im.phase;\n}\n\nconst TONES: Record<ImportState, StatusBadgeTone> = {\n\tqueued: \"neutral\",\n\treading: \"info\",\n\twriting: \"info\",\n\tcancelling: \"warning\",\n\tsucceeded: \"success\",\n\tsucceeded_with_problems: \"warning\",\n\tfailed: \"danger\",\n\tcancelled: \"neutral\",\n};\n\nfunction labelOf(status: ImportState, t: TFunction): string {\n\tswitch (status) {\n\t\tcase \"queued\":\n\t\tcase \"reading\":\n\t\tcase \"writing\":\n\t\tcase \"cancelling\":\n\t\t\treturn t(`imports.phase.${status}`);\n\t\tdefault:\n\t\t\treturn t(`imports.outcome.${status}`);\n\t}\n}\n\n/**\n * How often a list or page showing a queued or running Import reads it\n * again, by default: importhub pushes nothing, and two seconds keeps the\n * progress alive without hammering it.\n */\nexport const DEFAULT_POLL_INTERVAL_MS = 2000;\n\n/** Whether an Import is still to end: queued or running. */\nexport const isRunning = (im: Import): boolean => im.phase !== \"ended\";\n\n/** An Import's status as the page header's badge. */\nexport function ImportStatusBadge({ im }: { im: Import }) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst status = statusOf(im);\n\treturn <StatusBadge tone={TONES[status]} label={labelOf(status, t)} />;\n}\n\n/** An Import's status in a list's column. */\nexport function ImportStatusCell({ im }: { im: Import }) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst status = statusOf(im);\n\treturn (\n\t\t<StatusBadgeCell value={labelOf(status, t)} toneMap={{ [labelOf(status, t)]: TONES[status] }} />\n\t);\n}\n\n/**\n * Names a person by their odon user id, through the host's members; an id\n * is never shown (anker: never label a thing with an id). One the members do\n * not hold is \"Someone\": a host may list only some members (the Standalone\n * App knows only the viewer), so it cannot say they left.\n */\nexport function usePersonName(): (userId: string) => string {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { members } = useHostIdentity();\n\treturn useCallback(\n\t\t(userId: string) => members.byId(userId)?.displayName ?? t(\"imports.someone\"),\n\t\t[members, t],\n\t);\n}\n","import { useImporthubHost } from \"./host\";\n\n/**\n * Whether to offer the viewer Start and Cancel: the host's `canImport`, and\n * neither when it says nothing (control-who-may-import:AC1,\n * follow-an-import:AC8).\n */\nexport function useCanImport(): boolean {\n\treturn useImporthubHost().canImport ?? false;\n}\n","import { Button, ClipboardInput } from \"@knkcs/anker/atoms\";\nimport { Modal } from \"@knkcs/anker/components\";\nimport { DatePickerField, InputField } from \"@knkcs/anker/forms\";\nimport { useHostIdentity } from \"@knkcs/anker/host\";\nimport { Alert, HStack, Stack } from \"@knkcs/anker/primitives\";\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport { useEffect } from \"react\";\nimport { FormProvider, useForm } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport { API_KEY_NAME_MAX, type ImporthubClient } from \"../../client/importhub-client\";\nimport { importhubKeys } from \"../../common/query-keys\";\nimport { IMPORTHUB_UI_NS } from \"../../i18n/resources\";\n\ntype CreateValues = {\n\tname: string;\n\t/** YYYY-MM-DD, or \"\" for never. */\n\texpiresOn: string;\n};\n\nconst EMPTY: CreateValues = { name: \"\", expiresOn: \"\" };\n\n/** Today in the viewer's time zone, as YYYY-MM-DD, as a date input writes it. */\nfunction today(): string {\n\tconst d = new Date();\n\tconst pad = (n: number) => String(n).padStart(2, \"0\");\n\treturn `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;\n}\n\n/**\n * When a key given an \"Expires on\" day stops working: at the end of that day\n * in the viewer's time zone, so a key set to expire today still works today.\n * As an ISO timestamp, which is how importhub takes it; \"\" for never.\n */\nexport function expiryOf(expiresOn: string): string {\n\tif (!expiresOn) return \"\";\n\treturn new Date(`${expiresOn}T23:59:59`).toISOString();\n}\n\nexport interface CreateApiKeyDialogProps {\n\tclient: ImporthubClient;\n\topen: boolean;\n\tonClose: () => void;\n}\n\n/**\n * Creates an API key from a name and an optional expiry, in a Modal (never a\n * form above the list, anker's rule), and says first what the key may do in\n * the creator's name (import-with-an-api-key:AC5): it acts as them, and\n * importhub holds a standing Delegation Grant for it (ADR 0006, amended).\n *\n * Once created, the dialog shows the secret with a copy action, this once:\n * importhub never returns it again, and the dialog keeps it only in the\n * mutation's result, which the next opening resets and closing unmounts\n * (`lazyMount unmountOnExit`), so it is never left on the page.\n */\nexport function CreateApiKeyDialog({ client, open, onClose }: CreateApiKeyDialogProps) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { workspaceId } = useHostIdentity();\n\tconst queryClient = useQueryClient();\n\tconst form = useForm<CreateValues>({ defaultValues: EMPTY });\n\tconst create = useMutation({\n\t\tmutationFn: (values: CreateValues) =>\n\t\t\tclient.createApiKey({ name: values.name.trim(), expireTime: expiryOf(values.expiresOn) }),\n\t\tonSuccess: () =>\n\t\t\tqueryClient.invalidateQueries({ queryKey: importhubKeys.apiKeys(workspaceId) }),\n\t});\n\tconst { reset } = form;\n\tconst { reset: resetCreate } = create;\n\t// Each opening starts empty, and with no secret, whether or not the exit\n\t// callback ran (anker's Modal rule).\n\tuseEffect(() => {\n\t\tif (open) {\n\t\t\treset(EMPTY);\n\t\t\tresetCreate();\n\t\t}\n\t}, [open, reset, resetCreate]);\n\tconst close = () => {\n\t\t// Drop the secret now, not only on unmount.\n\t\tresetCreate();\n\t\tonClose();\n\t};\n\tconst submit = form.handleSubmit((values) => {\n\t\tconst name = values.name.trim();\n\t\tif (!name) {\n\t\t\tform.setError(\"name\", { message: t(\"apiKeys.nameRequired\") });\n\t\t\treturn;\n\t\t}\n\t\tif (name.length > API_KEY_NAME_MAX) {\n\t\t\tform.setError(\"name\", { message: t(\"apiKeys.nameTooLong\", { max: API_KEY_NAME_MAX }) });\n\t\t\treturn;\n\t\t}\n\t\tif (values.expiresOn && values.expiresOn < today()) {\n\t\t\tform.setError(\"expiresOn\", { message: t(\"apiKeys.expiryPast\") });\n\t\t\treturn;\n\t\t}\n\t\tcreate.mutate(values);\n\t});\n\tconst secret = create.data?.secret;\n\treturn (\n\t\t<Modal\n\t\t\topen={open}\n\t\t\tonClose={close}\n\t\t\theader={t(\"apiKeys.new\")}\n\t\t\tlazyMount\n\t\t\tunmountOnExit\n\t\t\t// While the secret shows, only Done (or the close button) closes:\n\t\t\t// a stray Escape or click beside the dialog would lose the one\n\t\t\t// copy of it there is.\n\t\t\tcloseOnEscape={!secret}\n\t\t\tcloseOnInteractOutside={!secret}\n\t\t\tfooter={\n\t\t\t\tsecret ? (\n\t\t\t\t\t<Button variant=\"solid\" onClick={close}>\n\t\t\t\t\t\t{t(\"apiKeys.done\")}\n\t\t\t\t\t</Button>\n\t\t\t\t) : (\n\t\t\t\t\t<HStack gap=\"2\">\n\t\t\t\t\t\t<Button variant=\"outline\" onClick={close}>\n\t\t\t\t\t\t\t{t(\"common.cancel\")}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button variant=\"solid\" loading={create.isPending} onClick={() => void submit()}>\n\t\t\t\t\t\t\t{t(\"common.create\")}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t)\n\t\t\t}\n\t\t>\n\t\t\t{secret ? (\n\t\t\t\t<Stack gap=\"4\">\n\t\t\t\t\t<Alert status=\"warning\" colorPalette=\"warning\" title={t(\"apiKeys.secretTitle\")}>\n\t\t\t\t\t\t{t(\"apiKeys.secretOnce\")}\n\t\t\t\t\t</Alert>\n\t\t\t\t\t<ClipboardInput\n\t\t\t\t\t\tvalue={secret}\n\t\t\t\t\t\tlabel={t(\"apiKeys.copySecret\")}\n\t\t\t\t\t\tinputProps={{ \"aria-label\": t(\"apiKeys.secret\"), fontFamily: \"mono\" }}\n\t\t\t\t\t/>\n\t\t\t\t</Stack>\n\t\t\t) : (\n\t\t\t\t<FormProvider {...form}>\n\t\t\t\t\t<form\n\t\t\t\t\t\tonSubmit={(e) => {\n\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\tvoid submit();\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Stack gap=\"4\">\n\t\t\t\t\t\t\t<InputField<CreateValues>\n\t\t\t\t\t\t\t\tname=\"name\"\n\t\t\t\t\t\t\t\tlabel={t(\"fields.name\")}\n\t\t\t\t\t\t\t\thelperText={t(\"apiKeys.nameHelp\")}\n\t\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<DatePickerField<CreateValues>\n\t\t\t\t\t\t\t\tname=\"expiresOn\"\n\t\t\t\t\t\t\t\tlabel={t(\"apiKeys.expiresOn\")}\n\t\t\t\t\t\t\t\thelperText={t(\"apiKeys.expiresOnHelp\")}\n\t\t\t\t\t\t\t\tmin={today()}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<Alert status=\"info\" colorPalette=\"info\" title={t(\"apiKeys.consentTitle\")}>\n\t\t\t\t\t\t\t\t{t(\"apiKeys.consent\")}\n\t\t\t\t\t\t\t</Alert>\n\t\t\t\t\t\t\t{create.isError ? (\n\t\t\t\t\t\t\t\t<Alert status=\"error\" colorPalette=\"danger\" title={t(\"apiKeys.createFailed\")} />\n\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t</Stack>\n\t\t\t\t\t</form>\n\t\t\t\t</FormProvider>\n\t\t\t)}\n\t\t</Modal>\n\t);\n}\n","import { Button } from \"@knkcs/anker/atoms\";\nimport { Modal } from \"@knkcs/anker/components\";\nimport { useHostIdentity } from \"@knkcs/anker/host\";\nimport { Alert, HStack, Stack, Text } from \"@knkcs/anker/primitives\";\nimport { useMutation, useQueryClient } from \"@tanstack/react-query\";\nimport { useEffect } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport type { ApiKey, ImporthubClient } from \"../../client/importhub-client\";\nimport { importhubKeys } from \"../../common/query-keys\";\nimport { IMPORTHUB_UI_NS } from \"../../i18n/resources\";\n\nexport interface RevokeApiKeyDialogProps {\n\tclient: ImporthubClient;\n\t/** The key to revoke; kept while the dialog closes. */\n\tapiKey: ApiKey | null;\n\topen: boolean;\n\tonClose: () => void;\n}\n\n/**\n * Confirms revoking an API key, then revokes it: importhub revokes it in odon\n * and releases its Delegation Grant, so it stops working at once and an\n * Import running with it fails (import-with-an-api-key:AC4, AC7). The list\n * reads again, without it. Always mounted and driven by `open`, as anker's\n * Modal rule says.\n *\n * Not `DeleteDialog`: that one says Delete and knows a configuration's\n * refusal (the Import Profiles that use it), neither of which a revoke has,\n * and giving it labels and a no-refusal mode would make it serve two things.\n */\nexport function RevokeApiKeyDialog({ client, apiKey, open, onClose }: RevokeApiKeyDialogProps) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { workspaceId } = useHostIdentity();\n\tconst queryClient = useQueryClient();\n\tconst revoke = useMutation({\n\t\tmutationFn: (id: string) => client.revokeApiKey(id),\n\t\tonSuccess: async () => {\n\t\t\tawait queryClient.invalidateQueries({ queryKey: importhubKeys.apiKeys(workspaceId) });\n\t\t\tonClose();\n\t\t},\n\t});\n\tconst { reset } = revoke;\n\t// A fresh session each time it opens, so last time's failure is gone.\n\tuseEffect(() => {\n\t\tif (open) reset();\n\t}, [open, reset]);\n\tconst name = apiKey?.name ?? \"\";\n\treturn (\n\t\t<Modal\n\t\t\topen={open}\n\t\t\tonClose={onClose}\n\t\t\theader={t(\"apiKeys.revokeTitle\", { name })}\n\t\t\tlazyMount\n\t\t\tunmountOnExit\n\t\t\tfooter={\n\t\t\t\t<HStack gap=\"2\">\n\t\t\t\t\t<Button variant=\"outline\" onClick={onClose}>\n\t\t\t\t\t\t{t(\"common.cancel\")}\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"solid\"\n\t\t\t\t\t\tcolorPalette=\"red\"\n\t\t\t\t\t\tloading={revoke.isPending}\n\t\t\t\t\t\tdisabled={!apiKey}\n\t\t\t\t\t\tonClick={() => apiKey && revoke.mutate(apiKey.id)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{t(\"apiKeys.revoke\")}\n\t\t\t\t\t</Button>\n\t\t\t\t</HStack>\n\t\t\t}\n\t\t>\n\t\t\t<Stack gap=\"4\">\n\t\t\t\t<Text>{t(\"apiKeys.revokeMessage\", { name })}</Text>\n\t\t\t\t{revoke.isError ? (\n\t\t\t\t\t<Alert status=\"error\" colorPalette=\"danger\" title={t(\"apiKeys.revokeFailed\")} />\n\t\t\t\t) : null}\n\t\t\t</Stack>\n\t\t</Modal>\n\t);\n}\n","import { Button, EmptyState } from \"@knkcs/anker/atoms\";\nimport {\n\tActionCell,\n\tCodeCell,\n\tDataTable,\n\tDateCell,\n\tIdentityCell,\n\tTruncatedTextCell,\n} from \"@knkcs/anker/components\";\nimport { useHostIdentity } from \"@knkcs/anker/host\";\nimport { Box } from \"@knkcs/anker/primitives\";\nimport { IndexPageTemplate } from \"@knkcs/anker/templates\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { ColumnDef } from \"@tanstack/react-table\";\nimport { KeyRound, Plus, Trash2 } from \"lucide-react\";\nimport { useMemo, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport type { ApiKey, ImporthubClient } from \"../../client/importhub-client\";\nimport { usePersonName } from \"../../common/import-status\";\nimport { importhubKeys } from \"../../common/query-keys\";\nimport { LoadFailed } from \"../../common/query-state\";\nimport { useCanImport } from \"../../common/use-can-import\";\nimport { IMPORTHUB_UI_NS } from \"../../i18n/resources\";\nimport { CreateApiKeyDialog } from \"./create-api-key-dialog\";\nimport { RevokeApiKeyDialog } from \"./revoke-api-key-dialog\";\n\nexport interface ApiKeysIndexProps {\n\tclient: ImporthubClient;\n}\n\n// DataTable takes rows that are records.\ntype Row = ApiKey & Record<string, unknown>;\n\n/**\n * The workspace's importhub API keys, every importer's, with their name,\n * owner, creation and expiry, never a secret (import-with-an-api-key:AC5,\n * AC7). An importer creates one from the header and revokes one from its\n * row.\n *\n * A viewer sees neither, nor the keys: every API key RPC needs importhub's\n * `importer` (ADR 0010), ListAPIKeys too, so the screen does not ask for a\n * list importhub would refuse and says who manages keys instead. As with\n * Start and Cancel, `canImport` hides actions and guards nothing.\n */\nexport function ApiKeysIndex({ client }: ApiKeysIndexProps) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { workspaceId } = useHostIdentity();\n\tconst canImport = useCanImport();\n\tconst personName = usePersonName();\n\tconst [creating, setCreating] = useState(false);\n\t// The key whose revoke is being confirmed; latched while the dialog closes,\n\t// so its text does not blank out during the exit animation.\n\tconst [revoking, setRevoking] = useState<ApiKey | null>(null);\n\tconst [revokeOpen, setRevokeOpen] = useState(false);\n\tconst query = useQuery({\n\t\tqueryKey: importhubKeys.apiKeys(workspaceId),\n\t\tqueryFn: () => client.listApiKeys(),\n\t\tenabled: canImport,\n\t});\n\tconst columns = useMemo<ColumnDef<Row, unknown>[]>(\n\t\t() => [\n\t\t\t{\n\t\t\t\tid: \"name\",\n\t\t\t\theader: t(\"fields.name\"),\n\t\t\t\tcell: (c) => <TruncatedTextCell value={c.row.original.name} />,\n\t\t\t},\n\t\t\t{\n\t\t\t\t// The secret's first characters, which tell keys apart where a\n\t\t\t\t// pipeline's settings show the key; never the secret.\n\t\t\t\tid: \"prefix\",\n\t\t\t\theader: t(\"apiKeys.prefix\"),\n\t\t\t\tsize: 120,\n\t\t\t\tcell: (c) => <CodeCell value={c.row.original.keyPrefix} />,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"owner\",\n\t\t\t\theader: t(\"apiKeys.owner\"),\n\t\t\t\tsize: 160,\n\t\t\t\tcell: (c) => <IdentityCell name={personName(c.row.original.owner)} />,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"created\",\n\t\t\t\theader: t(\"apiKeys.created\"),\n\t\t\t\tsize: 130,\n\t\t\t\tcell: (c) => <DateCell value={c.row.original.createTime} />,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"expires\",\n\t\t\t\theader: t(\"apiKeys.expires\"),\n\t\t\t\tsize: 130,\n\t\t\t\tcell: (c) =>\n\t\t\t\t\tc.row.original.expireTime ? (\n\t\t\t\t\t\t<DateCell value={c.row.original.expireTime} />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<TruncatedTextCell value={t(\"apiKeys.never\")} />\n\t\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"actions\",\n\t\t\t\theader: \"\",\n\t\t\t\tminSize: 60,\n\t\t\t\tcell: (c) => (\n\t\t\t\t\t<ActionCell\n\t\t\t\t\t\tactions={[\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ticon: Trash2,\n\t\t\t\t\t\t\t\tlabel: t(\"apiKeys.revokeKey\", { name: c.row.original.name }),\n\t\t\t\t\t\t\t\tcolorPalette: \"red\",\n\t\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\tsetRevoking(c.row.original);\n\t\t\t\t\t\t\t\t\tsetRevokeOpen(true);\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t]}\n\t\t\t\t\t/>\n\t\t\t\t),\n\t\t\t},\n\t\t],\n\t\t[t, personName],\n\t);\n\treturn (\n\t\t<IndexPageTemplate\n\t\t\ttitle={t(\"apiKeys.title\")}\n\t\t\tsubtitle={t(\"apiKeys.subtitle\")}\n\t\t\tactions={\n\t\t\t\tcanImport ? (\n\t\t\t\t\t<Button variant=\"solid\" onClick={() => setCreating(true)}>\n\t\t\t\t\t\t<Plus size={16} aria-hidden />\n\t\t\t\t\t\t{t(\"apiKeys.new\")}\n\t\t\t\t\t</Button>\n\t\t\t\t) : undefined\n\t\t\t}\n\t\t>\n\t\t\t{!canImport ? (\n\t\t\t\t<Box px=\"8\" py=\"6\">\n\t\t\t\t\t<EmptyState\n\t\t\t\t\t\ticon={<KeyRound size={32} aria-hidden />}\n\t\t\t\t\t\theader={t(\"apiKeys.title\")}\n\t\t\t\t\t\tdescription={t(\"apiKeys.importersOnly\")}\n\t\t\t\t\t/>\n\t\t\t\t</Box>\n\t\t\t) : query.isError ? (\n\t\t\t\t<LoadFailed />\n\t\t\t) : (\n\t\t\t\t<DataTable\n\t\t\t\t\tcolumns={columns}\n\t\t\t\t\tdata={(query.data ?? []) as Row[]}\n\t\t\t\t\tloading={query.isPending}\n\t\t\t\t\tgetRowId={(k) => k.id}\n\t\t\t\t\temptyState={t(\"apiKeys.empty\")}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<CreateApiKeyDialog client={client} open={creating} onClose={() => setCreating(false)} />\n\t\t\t<RevokeApiKeyDialog\n\t\t\t\tclient={client}\n\t\t\t\tapiKey={revoking}\n\t\t\t\topen={revokeOpen}\n\t\t\t\tonClose={() => setRevokeOpen(false)}\n\t\t\t/>\n\t\t</IndexPageTemplate>\n\t);\n}\n","import { Button, IconButton, StatusBadge } from \"@knkcs/anker/atoms\";\nimport { Card, ContextRail } from \"@knkcs/anker/components\";\nimport { InputField, TextareaField } from \"@knkcs/anker/forms\";\nimport { useHostIdentity } from \"@knkcs/anker/host\";\nimport { Alert, Box, Grid, HStack, Stack, Text } from \"@knkcs/anker/primitives\";\nimport { DetailPageTemplate, usePageRail } from \"@knkcs/anker/templates\";\nimport { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport { Plus, Trash2 } from \"lucide-react\";\nimport { useEffect, useState } from \"react\";\nimport { FormProvider, useFieldArray, useForm } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport type { EntitySet, EntitySetContent, ImporthubClient } from \"../../client/importhub-client\";\nimport { useConfigurationTab } from \"../../common/configuration-tabs\";\nimport { DeleteDialog } from \"../../common/delete-dialog\";\nimport { useImporthubHost } from \"../../common/host\";\nimport { importhubKeys } from \"../../common/query-keys\";\nimport { LoadFailed, Loading } from \"../../common/query-state\";\nimport { ReleaseStateBadge } from \"../../common/release-state\";\nimport { useCanConfigure } from \"../../common/use-can-configure\";\nimport { useConfigurationRelease } from \"../../common/use-configuration-release\";\nimport { ValidityAlert } from \"../../common/validity\";\nimport { IMPORTHUB_UI_NS } from \"../../i18n/resources\";\nimport { ConfigurationHistory } from \"../history/configuration-history\";\n\nexport interface EntitySetDetailProps {\n\tclient: ImporthubClient;\n\t/** The Entity Set's id. */\n\tid: string;\n\t/** It was deleted: the host leaves its page. */\n\tonDeleted: () => void;\n}\n\n/** The entity table as form rows: a map has no order, a form needs one. */\ntype EntitySetValues = {\n\tname: string;\n\tdescription: string;\n\tentities: { name: string; text: string }[];\n};\n\nconst valuesOf = (c: EntitySetContent): EntitySetValues => ({\n\tname: c.name,\n\tdescription: c.description,\n\tentities: Object.entries(c.entities)\n\t\t.sort(([a], [b]) => a.localeCompare(b))\n\t\t.map(([name, text]) => ({ name, text })),\n});\n\n// A row without a name is dropped rather than saved as `\"\"`, which no\n// reference in a Source File could name.\nconst contentOf = (v: EntitySetValues): EntitySetContent => ({\n\tname: v.name,\n\tdescription: v.description,\n\tentities: Object.fromEntries(\n\t\tv.entities.filter((e) => e.name.trim() !== \"\").map((e) => [e.name.trim(), e.text]),\n\t),\n});\n\n/**\n * One Entity Set (manage-entity-sets:AC1): its name and its table of\n * entities, each with the text it stands for. An admin edits the table and\n * saves with the header's Save, and deletes from the rail, which importhub\n * refuses while a Profile names it, naming them (AC3). It shows whether its\n * draft differs from its latest Release, an admin cuts a Release from the\n * rail, and its History tab lists, compares and restores its Revisions\n * (release-a-configuration).\n */\nexport function EntitySetDetail({ client, id, onDeleted }: EntitySetDetailProps) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { workspaceId } = useHostIdentity();\n\tconst query = useQuery({\n\t\tqueryKey: importhubKeys.entitySet(workspaceId, id),\n\t\tqueryFn: () => client.getEntitySet(id),\n\t});\n\tif (query.isError || !query.data) {\n\t\treturn (\n\t\t\t<DetailPageTemplate title={t(\"section.entitySets.title\")}>\n\t\t\t\t{query.isError ? <LoadFailed /> : <Loading />}\n\t\t\t</DetailPageTemplate>\n\t\t);\n\t}\n\treturn <EntitySetPage client={client} entitySet={query.data} onDeleted={onDeleted} />;\n}\n\nfunction EntitySetPage({\n\tclient,\n\tentitySet,\n\tonDeleted,\n}: {\n\tclient: ImporthubClient;\n\tentitySet: EntitySet;\n\tonDeleted: () => void;\n}) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { workspaceId } = useHostIdentity();\n\tconst { paths } = useImporthubHost();\n\tconst canConfigure = useCanConfigure();\n\tconst queryClient = useQueryClient();\n\tconst [deleting, setDeleting] = useState(false);\n\n\tconst form = useForm<EntitySetValues>({ defaultValues: valuesOf(entitySet.content) });\n\tconst { reset, formState, control } = form;\n\tconst rows = useFieldArray({ control, name: \"entities\" });\n\tuseEffect(() => {\n\t\tif (!formState.isDirty) reset(valuesOf(entitySet.content));\n\t}, [entitySet, reset, formState.isDirty]);\n\n\tconst save = useMutation({\n\t\tmutationFn: (values: EntitySetValues) =>\n\t\t\tclient.updateEntitySet(entitySet.id, contentOf(values), entitySet.state.draftRevisionId),\n\t\tonSuccess: (saved) => {\n\t\t\tqueryClient.setQueryData(importhubKeys.entitySet(workspaceId, saved.id), saved);\n\t\t\treset(valuesOf(saved.content));\n\t\t\tvoid queryClient.invalidateQueries({ queryKey: importhubKeys.entitySets(workspaceId) });\n\t\t},\n\t});\n\tconst onSave = form.handleSubmit((values) => save.mutate(values));\n\tconst [tab, tabs] = useConfigurationTab();\n\tconst releasing = useConfigurationRelease({\n\t\tclient,\n\t\tkind: \"entitySet\",\n\t\tid: entitySet.id,\n\t\tvalidity: entitySet.validity,\n\t\tstate: entitySet.state,\n\t\tunsaved: formState.isDirty,\n\t});\n\n\tusePageRail(\n\t\tcanConfigure ? (\n\t\t\t<ContextRail storageKey=\"importhub.entitySet.rail\">\n\t\t\t\t<ContextRail.Header title={t(\"rail.title\")} />\n\t\t\t\t<ContextRail.Section id=\"actions\" label={t(\"rail.actions\")}>\n\t\t\t\t\t{releasing.railAction}\n\t\t\t\t\t<ContextRail.IconButton\n\t\t\t\t\t\tlabel={t(\"entitySets.delete\")}\n\t\t\t\t\t\ticon={<Trash2 size={16} />}\n\t\t\t\t\t\ttone=\"outline-red\"\n\t\t\t\t\t\tonClick={() => setDeleting(true)}\n\t\t\t\t\t/>\n\t\t\t\t</ContextRail.Section>\n\t\t\t</ContextRail>\n\t\t) : null,\n\t);\n\n\treturn (\n\t\t<DetailPageTemplate\n\t\t\ttitle={entitySet.content.name}\n\t\t\tbreadcrumbs={[{ label: t(\"section.entitySets.title\"), to: paths.entitySets }]}\n\t\t\tbadges={\n\t\t\t\t<HStack gap=\"2\">\n\t\t\t\t\t<StatusBadge\n\t\t\t\t\t\ttone={entitySet.validity.valid ? \"success\" : \"danger\"}\n\t\t\t\t\t\tlabel={entitySet.validity.valid ? t(\"validity.valid\") : t(\"validity.invalid\")}\n\t\t\t\t\t/>\n\t\t\t\t\t<ReleaseStateBadge state={entitySet.state} />\n\t\t\t\t</HStack>\n\t\t\t}\n\t\t\ttabs={tabs}\n\t\t\tactions={\n\t\t\t\tcanConfigure ? (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"solid\"\n\t\t\t\t\t\tdisabled={!formState.isDirty}\n\t\t\t\t\t\tloading={save.isPending}\n\t\t\t\t\t\tonClick={() => void onSave()}\n\t\t\t\t\t>\n\t\t\t\t\t\t{t(\"common.save\")}\n\t\t\t\t\t</Button>\n\t\t\t\t) : undefined\n\t\t\t}\n\t\t>\n\t\t\t{tab === \"history\" ? (\n\t\t\t\t<ConfigurationHistory\n\t\t\t\t\tclient={client}\n\t\t\t\t\tkind=\"entitySet\"\n\t\t\t\t\tid={entitySet.id}\n\t\t\t\t\tdraftRevisionId={entitySet.state.draftRevisionId}\n\t\t\t\t\tonRestored={async () => {\n\t\t\t\t\t\t// The restored draft replaces what the form holds.\n\t\t\t\t\t\tconst fresh = await client.getEntitySet(entitySet.id);\n\t\t\t\t\t\tqueryClient.setQueryData(importhubKeys.entitySet(workspaceId, fresh.id), fresh);\n\t\t\t\t\t\treset(valuesOf(fresh.content));\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<Box px=\"8\" py=\"6\">\n\t\t\t\t\t<FormProvider {...form}>\n\t\t\t\t\t\t<form\n\t\t\t\t\t\t\tonSubmit={(e) => {\n\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\tif (canConfigure) void onSave();\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Stack gap=\"4\">\n\t\t\t\t\t\t\t\t{releasing.notice}\n\t\t\t\t\t\t\t\t<ValidityAlert validity={entitySet.validity} />\n\t\t\t\t\t\t\t\t{save.isError ? (\n\t\t\t\t\t\t\t\t\t<Alert status=\"error\" colorPalette=\"danger\" title={t(\"save.failed\")}>\n\t\t\t\t\t\t\t\t\t\t{save.error.message}\n\t\t\t\t\t\t\t\t\t</Alert>\n\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t<Card title={t(\"entitySets.general\")}>\n\t\t\t\t\t\t\t\t\t<Stack gap=\"4\">\n\t\t\t\t\t\t\t\t\t\t<InputField<EntitySetValues>\n\t\t\t\t\t\t\t\t\t\t\tname=\"name\"\n\t\t\t\t\t\t\t\t\t\t\tlabel={t(\"fields.name\")}\n\t\t\t\t\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\t\t\t\t\tdisabled={!canConfigure}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t<TextareaField<EntitySetValues>\n\t\t\t\t\t\t\t\t\t\t\tname=\"description\"\n\t\t\t\t\t\t\t\t\t\t\tlabel={t(\"fields.description\")}\n\t\t\t\t\t\t\t\t\t\t\tdisabled={!canConfigure}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t\t</Card>\n\t\t\t\t\t\t\t\t<Card title={t(\"entitySets.entities\")}>\n\t\t\t\t\t\t\t\t\t<Stack gap=\"3\">\n\t\t\t\t\t\t\t\t\t\t{rows.fields.length === 0 ? (\n\t\t\t\t\t\t\t\t\t\t\t<Text color=\"fg.muted\">{t(\"entitySets.noEntities\")}</Text>\n\t\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t\t{rows.fields.map((row, index) => (\n\t\t\t\t\t\t\t\t\t\t\t<Grid key={row.id} templateColumns=\"1fr 1fr auto\" gap=\"3\" alignItems=\"end\">\n\t\t\t\t\t\t\t\t\t\t\t\t<InputField<EntitySetValues>\n\t\t\t\t\t\t\t\t\t\t\t\t\tname={`entities.${index}.name`}\n\t\t\t\t\t\t\t\t\t\t\t\t\tlabel={t(\"entitySets.entityName\", { index: index + 1 })}\n\t\t\t\t\t\t\t\t\t\t\t\t\tprepend=\"&\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tappend=\";\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tdisabled={!canConfigure}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t<InputField<EntitySetValues>\n\t\t\t\t\t\t\t\t\t\t\t\t\tname={`entities.${index}.text`}\n\t\t\t\t\t\t\t\t\t\t\t\t\tlabel={t(\"entitySets.entityText\", { index: index + 1 })}\n\t\t\t\t\t\t\t\t\t\t\t\t\tdisabled={!canConfigure}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t{canConfigure ? (\n\t\t\t\t\t\t\t\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t\t\t\t\t\t\t\taria-label={t(\"entitySets.removeEntity\", { index: index + 1 })}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolorPalette=\"red\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={() => rows.remove(index)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Trash2 size={16} />\n\t\t\t\t\t\t\t\t\t\t\t\t\t</IconButton>\n\t\t\t\t\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span />\n\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t</Grid>\n\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t\t{canConfigure ? (\n\t\t\t\t\t\t\t\t\t\t\t<Box>\n\t\t\t\t\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tonClick={() => rows.append({ name: \"\", text: \"\" })}\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Plus size={14} aria-hidden />\n\t\t\t\t\t\t\t\t\t\t\t\t\t{t(\"entitySets.addEntity\")}\n\t\t\t\t\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t\t\t\t</Box>\n\t\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t\t</Card>\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</FormProvider>\n\t\t\t\t</Box>\n\t\t\t)}\n\t\t\t{releasing.dialog}\n\t\t\t<DeleteDialog\n\t\t\t\topen={deleting}\n\t\t\t\tonClose={() => setDeleting(false)}\n\t\t\t\ttitle={t(\"entitySets.deleteTitle\", { name: entitySet.content.name })}\n\t\t\t\tmessage={t(\"entitySets.deleteMessage\")}\n\t\t\t\tonDelete={() => client.deleteEntitySet(entitySet.id)}\n\t\t\t\tonDeleted={() => {\n\t\t\t\t\tsetDeleting(false);\n\t\t\t\t\tqueryClient.removeQueries({\n\t\t\t\t\t\tqueryKey: importhubKeys.entitySet(workspaceId, entitySet.id),\n\t\t\t\t\t});\n\t\t\t\t\tvoid queryClient.invalidateQueries({ queryKey: importhubKeys.entitySets(workspaceId) });\n\t\t\t\t\tonDeleted();\n\t\t\t\t}}\n\t\t\t/>\n\t\t</DetailPageTemplate>\n\t);\n}\n","import { Modal } from \"@knkcs/anker/components\";\nimport { InputField, TextareaField } from \"@knkcs/anker/forms\";\nimport { Alert, Stack } from \"@knkcs/anker/primitives\";\nimport { useMutation } from \"@tanstack/react-query\";\nimport { type ReactNode, useEffect } from \"react\";\nimport { FormProvider, useForm } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport { NameTakenError } from \"../client/importhub-client\";\nimport { IMPORTHUB_UI_NS } from \"../i18n/resources\";\n\n/** What every create asks first: a name and what it is for. */\nexport type CreateValues = { name: string; description: string } & Record<string, string>;\n\nexport interface CreateDialogProps {\n\topen: boolean;\n\tonClose: () => void;\n\t/** The dialog's header: \"New Import Profile\". */\n\ttitle: string;\n\t/** Fields a kind asks besides name and description, over the same form. */\n\tchildren?: ReactNode;\n\t/** Their starting values; a stable object (a module constant), as it resets the form. */\n\tdefaultValues?: Record<string, string>;\n\t/** Creates it from the values; resolves to the new id. */\n\tonCreate: (values: CreateValues) => Promise<string>;\n\t/** It exists: the host opens its page. */\n\tonCreated: (id: string) => void;\n}\n\n/**\n * Creates a configuration from a name and a description in a Modal, never a\n * form above the list (anker's rule); the rest is set on its page. A name\n * another one of the kind has is said at the name.\n */\nexport function CreateDialog({\n\topen,\n\tonClose,\n\ttitle,\n\tchildren,\n\tdefaultValues,\n\tonCreate,\n\tonCreated,\n}: CreateDialogProps) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst form = useForm<CreateValues>({\n\t\tdefaultValues: { name: \"\", description: \"\", ...defaultValues },\n\t});\n\tconst create = useMutation({ mutationFn: onCreate, onSuccess: onCreated });\n\tconst { reset } = form;\n\tconst { reset: resetCreate } = create;\n\t// Each opening starts empty, whether or not the exit callback ran.\n\tuseEffect(() => {\n\t\tif (open) {\n\t\t\treset({ name: \"\", description: \"\", ...defaultValues });\n\t\t\tresetCreate();\n\t\t}\n\t}, [open, reset, resetCreate, defaultValues]);\n\tconst submit = form.handleSubmit((values) => {\n\t\tif (!values.name.trim()) {\n\t\t\tform.setError(\"name\", { message: t(\"create.nameRequired\") });\n\t\t\treturn;\n\t\t}\n\t\tcreate.mutate(values, {\n\t\t\tonError: (err) => {\n\t\t\t\tif (err instanceof NameTakenError) {\n\t\t\t\t\tform.setError(\"name\", { message: t(\"create.nameTaken\") });\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\t});\n\treturn (\n\t\t<Modal\n\t\t\topen={open}\n\t\t\tonClose={onClose}\n\t\t\theader={title}\n\t\t\tlazyMount\n\t\t\tunmountOnExit\n\t\t\tsaveLabel={t(\"common.create\")}\n\t\t\tcancelLabel={t(\"common.cancel\")}\n\t\t\tonSave={() => void submit()}\n\t\t\tloading={create.isPending}\n\t\t>\n\t\t\t<FormProvider {...form}>\n\t\t\t\t<form\n\t\t\t\t\tonSubmit={(e) => {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\tvoid submit();\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<Stack gap=\"4\">\n\t\t\t\t\t\t<InputField<CreateValues> name=\"name\" label={t(\"fields.name\")} required />\n\t\t\t\t\t\t<TextareaField<CreateValues> name=\"description\" label={t(\"fields.description\")} />\n\t\t\t\t\t\t{children}\n\t\t\t\t\t\t{create.isError && !(create.error instanceof NameTakenError) ? (\n\t\t\t\t\t\t\t<Alert status=\"error\" colorPalette=\"danger\" title={t(\"create.failed\")} />\n\t\t\t\t\t\t) : null}\n\t\t\t\t\t</Stack>\n\t\t\t\t</form>\n\t\t\t</FormProvider>\n\t\t</Modal>\n\t);\n}\n","import { Button } from \"@knkcs/anker/atoms\";\nimport { CountCell, DataTable, LinkCell, TruncatedTextCell } from \"@knkcs/anker/components\";\nimport { useHostIdentity } from \"@knkcs/anker/host\";\nimport { IndexPageTemplate } from \"@knkcs/anker/templates\";\nimport { useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport type { ColumnDef } from \"@tanstack/react-table\";\nimport { Plus } from \"lucide-react\";\nimport { useMemo, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport type { EntitySet, ImporthubClient } from \"../../client/importhub-client\";\nimport { CreateDialog } from \"../../common/create-dialog\";\nimport { itemPath, useImporthubHost } from \"../../common/host\";\nimport { importhubKeys } from \"../../common/query-keys\";\nimport { LoadFailed } from \"../../common/query-state\";\nimport { useCanConfigure } from \"../../common/use-can-configure\";\nimport { releaseLabel, ValidityCell } from \"../../common/validity\";\nimport { IMPORTHUB_UI_NS } from \"../../i18n/resources\";\n\nexport interface EntitySetsIndexProps {\n\tclient: ImporthubClient;\n\t/** Opens an Entity Set's page: the host navigates, after a create too. */\n\tonOpen: (id: string) => void;\n}\n\n// DataTable takes rows that are records.\ntype Row = EntitySet & Record<string, unknown>;\n\n/**\n * Every Entity Set of the workspace, with how many entities each defines\n * (manage-entity-sets:AC1); an admin creates one from the header.\n */\nexport function EntitySetsIndex({ client, onOpen }: EntitySetsIndexProps) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { workspaceId } = useHostIdentity();\n\tconst { paths } = useImporthubHost();\n\tconst canConfigure = useCanConfigure();\n\tconst queryClient = useQueryClient();\n\tconst [creating, setCreating] = useState(false);\n\tconst query = useQuery({\n\t\tqueryKey: importhubKeys.entitySets(workspaceId),\n\t\tqueryFn: () => client.listEntitySets(),\n\t});\n\tconst columns = useMemo<ColumnDef<Row, unknown>[]>(\n\t\t() => [\n\t\t\t{\n\t\t\t\tid: \"name\",\n\t\t\t\theader: t(\"fields.name\"),\n\t\t\t\tcell: (c) => (\n\t\t\t\t\t<LinkCell\n\t\t\t\t\t\tto={itemPath(paths, \"entitySets\", c.row.original.id)}\n\t\t\t\t\t\tlabel={c.row.original.content.name}\n\t\t\t\t\t/>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"entities\",\n\t\t\t\theader: t(\"entitySets.entities\"),\n\t\t\t\tsize: 120,\n\t\t\t\tcell: (c) => (\n\t\t\t\t\t<CountCell\n\t\t\t\t\t\tvalue={c.row.original.content.entities}\n\t\t\t\t\t\tsingular={t(\"entitySets.entity\")}\n\t\t\t\t\t\tplural={t(\"entitySets.entities\")}\n\t\t\t\t\t/>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"validity\",\n\t\t\t\theader: t(\"validity.column\"),\n\t\t\t\tcell: (c) => <ValidityCell validity={c.row.original.validity} />,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"release\",\n\t\t\t\theader: t(\"release.column\"),\n\t\t\t\tsize: 140,\n\t\t\t\tcell: (c) => <TruncatedTextCell value={releaseLabel(c.row.original.state, t)} />,\n\t\t\t},\n\t\t],\n\t\t[t, paths],\n\t);\n\treturn (\n\t\t<IndexPageTemplate\n\t\t\ttitle={t(\"section.entitySets.title\")}\n\t\t\tactions={\n\t\t\t\tcanConfigure ? (\n\t\t\t\t\t<Button variant=\"solid\" onClick={() => setCreating(true)}>\n\t\t\t\t\t\t<Plus size={16} aria-hidden />\n\t\t\t\t\t\t{t(\"entitySets.new\")}\n\t\t\t\t\t</Button>\n\t\t\t\t) : undefined\n\t\t\t}\n\t\t>\n\t\t\t{query.isError ? (\n\t\t\t\t<LoadFailed />\n\t\t\t) : (\n\t\t\t\t<DataTable\n\t\t\t\t\tcolumns={columns}\n\t\t\t\t\tdata={(query.data ?? []) as Row[]}\n\t\t\t\t\tloading={query.isPending}\n\t\t\t\t\tgetRowId={(e) => e.id}\n\t\t\t\t\temptyState={t(\"entitySets.empty\")}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<CreateDialog\n\t\t\t\topen={creating}\n\t\t\t\tonClose={() => setCreating(false)}\n\t\t\t\ttitle={t(\"entitySets.new\")}\n\t\t\t\tonCreate={async ({ name, description }) => {\n\t\t\t\t\tconst e = await client.createEntitySet({ name, description, entities: {} });\n\t\t\t\t\tawait queryClient.invalidateQueries({ queryKey: importhubKeys.entitySets(workspaceId) });\n\t\t\t\t\treturn e.id;\n\t\t\t\t}}\n\t\t\t\tonCreated={(id) => {\n\t\t\t\t\tsetCreating(false);\n\t\t\t\t\tonOpen(id);\n\t\t\t\t}}\n\t\t\t/>\n\t\t</IndexPageTemplate>\n\t);\n}\n","import { Button, SearchInput } from \"@knkcs/anker/atoms\";\nimport { CodeCell, DataTable, SlugCell, Toolbar, TruncatedTextCell } from \"@knkcs/anker/components\";\nimport { useHostIdentity } from \"@knkcs/anker/host\";\nimport { Center, NativeSelect, Stack } from \"@knkcs/anker/primitives\";\nimport { useInfiniteQuery } from \"@tanstack/react-query\";\nimport type { ColumnDef } from \"@tanstack/react-table\";\nimport { useEffect, useMemo, useRef, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport type { Import, ImporthubClient, ItemProblem } from \"../../client/importhub-client\";\nimport { importhubKeys } from \"../../common/query-keys\";\nimport { LoadFailed } from \"../../common/query-state\";\nimport { IMPORTHUB_UI_NS } from \"../../i18n/resources\";\n\ntype Row = ItemProblem & Record<string, unknown>;\n\n/**\n * An Import's Item Problems (follow-an-import:AC4): filtered by Mapping and\n * searched by Source Key, both by importhub, with how many match of how many\n * there are. The Mappings offered are every Mapping with Item Problems, each\n * with its count, whatever the filter.\n */\nexport function ItemProblemsTable({ client, im }: { client: ImporthubClient; im: Import }) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { workspaceId } = useHostIdentity();\n\tconst [mappingId, setMappingId] = useState(\"\");\n\tconst [sourceKeyQuery, setSourceKeyQuery] = useState(\"\");\n\tconst query = useInfiniteQuery({\n\t\tqueryKey: importhubKeys.itemProblems(workspaceId, im.id, mappingId, sourceKeyQuery),\n\t\tqueryFn: ({ pageParam }) =>\n\t\t\tclient.listItemProblems(im.id, { mappingId, sourceKeyQuery, pageToken: pageParam }),\n\t\tinitialPageParam: \"\",\n\t\tgetNextPageParam: (last) => last.nextPageToken || undefined,\n\t\t// Keeps the rows while a new filter's answer loads, rather than\n\t\t// flashing an empty table at every keystroke.\n\t\tplaceholderData: (previous) => previous,\n\t});\n\t// Re-read when the Import has recorded more, so a running Import's table\n\t// keeps up with its count without polling on its own; the page around it\n\t// polls the Import already.\n\tconst problems = im.counts.problems;\n\tconst seen = useRef(problems);\n\tconst { refetch } = query;\n\tuseEffect(() => {\n\t\tif (problems === seen.current) return;\n\t\tseen.current = problems;\n\t\tvoid refetch();\n\t}, [problems, refetch]);\n\n\tconst first = query.data?.pages[0];\n\tconst rows = useMemo(\n\t\t() => (query.data?.pages.flatMap((p) => p.itemProblems) ?? []) as Row[],\n\t\t[query.data],\n\t);\n\tconst columns = useMemo<ColumnDef<Row, unknown>[]>(\n\t\t() => [\n\t\t\t{\n\t\t\t\tid: \"sourceKey\",\n\t\t\t\theader: t(\"imports.sourceKey\"),\n\t\t\t\tsize: 180,\n\t\t\t\tcell: (c) => <SlugCell value={c.row.original.sourceKey || t(\"imports.noSourceKey\")} />,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"mapping\",\n\t\t\t\theader: t(\"imports.mapping\"),\n\t\t\t\tsize: 160,\n\t\t\t\tcell: (c) => <TruncatedTextCell value={c.row.original.mappingName} />,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"field\",\n\t\t\t\theader: t(\"imports.field\"),\n\t\t\t\tsize: 160,\n\t\t\t\tcell: (c) =>\n\t\t\t\t\tc.row.original.field ? (\n\t\t\t\t\t\t<CodeCell value={c.row.original.field} />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<TruncatedTextCell value={t(\"imports.wholeVersion\")} />\n\t\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"reason\",\n\t\t\t\theader: t(\"imports.reason\"),\n\t\t\t\tminSize: 240,\n\t\t\t\tcell: (c) => <TruncatedTextCell value={c.row.original.reason} />,\n\t\t\t},\n\t\t],\n\t\t[t],\n\t);\n\tif (query.isError) return <LoadFailed />;\n\tconst total = first?.totalCount ?? 0;\n\treturn (\n\t\t<Stack gap=\"3\">\n\t\t\t<Toolbar>\n\t\t\t\t<SearchInput\n\t\t\t\t\taria-label={t(\"imports.searchSourceKey\")}\n\t\t\t\t\tplaceholder={t(\"imports.searchSourceKey\")}\n\t\t\t\t\tonSearch={setSourceKeyQuery}\n\t\t\t\t\tdebounceMs={200}\n\t\t\t\t\tmaxWidth=\"260px\"\n\t\t\t\t/>\n\t\t\t\t<NativeSelect\n\t\t\t\t\taria-label={t(\"imports.filterMapping\")}\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\twidth=\"auto\"\n\t\t\t\t\tvalue={mappingId}\n\t\t\t\t\tonChange={(e) => setMappingId(e.currentTarget.value)}\n\t\t\t\t>\n\t\t\t\t\t<option value=\"\">{t(\"imports.allMappings\", { count: total })}</option>\n\t\t\t\t\t{(first?.mappings ?? []).map((m) => (\n\t\t\t\t\t\t<option key={m.mappingId} value={m.mappingId}>\n\t\t\t\t\t\t\t{t(\"imports.mappingCount\", { name: m.mappingName, count: m.count })}\n\t\t\t\t\t\t</option>\n\t\t\t\t\t))}\n\t\t\t\t</NativeSelect>\n\t\t\t\t<Toolbar.Right>\n\t\t\t\t\t<Toolbar.Count>\n\t\t\t\t\t\t{t(\"imports.problemCount\", { matching: first?.matchingCount ?? 0, total })}\n\t\t\t\t\t</Toolbar.Count>\n\t\t\t\t</Toolbar.Right>\n\t\t\t</Toolbar>\n\t\t\t<DataTable\n\t\t\t\tcolumns={columns}\n\t\t\t\tdata={rows}\n\t\t\t\tloading={query.isPending}\n\t\t\t\tgetRowId={(p) => p.id}\n\t\t\t\temptyState={total === 0 ? t(\"imports.noItemProblems\") : t(\"imports.noMatchingProblems\")}\n\t\t\t/>\n\t\t\t{query.hasNextPage ? (\n\t\t\t\t<Center>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\tloading={query.isFetchingNextPage}\n\t\t\t\t\t\tonClick={() => void query.fetchNextPage()}\n\t\t\t\t\t>\n\t\t\t\t\t\t{t(\"imports.loadMore\")}\n\t\t\t\t\t</Button>\n\t\t\t\t</Center>\n\t\t\t) : null}\n\t\t</Stack>\n\t);\n}\n","import { Button } from \"@knkcs/anker/atoms\";\nimport { Card, ContextRail, DescriptionList, Modal } from \"@knkcs/anker/components\";\nimport { useHostIdentity } from \"@knkcs/anker/host\";\nimport { Alert, Box, HStack, Link, List, Progress, Stack, Text } from \"@knkcs/anker/primitives\";\nimport { DetailPageTemplate, usePageRail } from \"@knkcs/anker/templates\";\nimport { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport { CircleStop } from \"lucide-react\";\nimport { useEffect, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { Link as RouterLink } from \"react-router\";\nimport type { Import, ImporthubClient, ImportReleaseRef } from \"../../client/importhub-client\";\nimport { ChangeSetLink } from \"../../common/change-set-link\";\nimport { type ImporthubSection, itemPath, useImporthubHost } from \"../../common/host\";\nimport {\n\tDEFAULT_POLL_INTERVAL_MS,\n\tImportStatusBadge,\n\tisRunning,\n\tusePersonName,\n} from \"../../common/import-status\";\nimport { importhubKeys } from \"../../common/query-keys\";\nimport { LoadFailed, Loading } from \"../../common/query-state\";\nimport { useCanImport } from \"../../common/use-can-import\";\nimport { IMPORTHUB_UI_NS } from \"../../i18n/resources\";\nimport { ItemProblemsTable } from \"./item-problems-table\";\n\nexport interface ImportDetailProps {\n\tclient: ImporthubClient;\n\t/** The Import's id. */\n\tid: string;\n\t/**\n\t * How often the page reads the Import again while it is queued or\n\t * running, in ms; 2000 by default. It stops once the Import has ended.\n\t */\n\tpollIntervalMs?: number;\n}\n\n/**\n * One Import (follow-an-import): its status, and while it runs its phase\n * and progress, read again until it ends (AC2); how it ended and why (AC7),\n * who cancelled it (AC6); its details with the link to its Change Set in\n * contenthub, where the host says that is (AC5); its counts; the exact\n * Releases it ran with (release-a-configuration:AC8); and its Item Problems\n * (AC4). An importer cancels a queued or running one from the rail; a viewer\n * sees no Cancel (AC8).\n */\nexport function ImportDetail({\n\tclient,\n\tid,\n\tpollIntervalMs = DEFAULT_POLL_INTERVAL_MS,\n}: ImportDetailProps) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { workspaceId } = useHostIdentity();\n\tconst query = useQuery({\n\t\tqueryKey: importhubKeys.import(workspaceId, id),\n\t\tqueryFn: () => client.getImport(id),\n\t\trefetchInterval: (q) => (q.state.data && isRunning(q.state.data) ? pollIntervalMs : false),\n\t});\n\tif (query.isError || !query.data) {\n\t\treturn (\n\t\t\t<DetailPageTemplate title={t(\"section.imports.title\")}>\n\t\t\t\t{query.isError ? <LoadFailed /> : <Loading />}\n\t\t\t</DetailPageTemplate>\n\t\t);\n\t}\n\treturn <ImportPage client={client} im={query.data} />;\n}\n\nfunction ImportPage({ client, im }: { client: ImporthubClient; im: Import }) {\n\tconst { t, i18n } = useTranslation(IMPORTHUB_UI_NS);\n\tconst lng = i18n.language;\n\tconst { workspaceId } = useHostIdentity();\n\tconst { paths } = useImporthubHost();\n\tconst canImport = useCanImport();\n\tconst personName = usePersonName();\n\tconst queryClient = useQueryClient();\n\tconst [cancelling, setCancelling] = useState(false);\n\n\t// Cancel is offered while the Import may still be stopped, and until\n\t// somebody has asked: asking twice changes nothing (CancelImport).\n\tconst cancellable = canImport && isRunning(im) && !im.cancelledBy;\n\tusePageRail(\n\t\tcancellable ? (\n\t\t\t<ContextRail storageKey=\"importhub.import.rail\">\n\t\t\t\t<ContextRail.Header title={t(\"rail.title\")} />\n\t\t\t\t<ContextRail.Section id=\"actions\" label={t(\"rail.actions\")}>\n\t\t\t\t\t<ContextRail.IconButton\n\t\t\t\t\t\tlabel={t(\"imports.cancel\")}\n\t\t\t\t\t\ticon={<CircleStop size={16} />}\n\t\t\t\t\t\ttone=\"outline-red\"\n\t\t\t\t\t\tonClick={() => setCancelling(true)}\n\t\t\t\t\t/>\n\t\t\t\t</ContextRail.Section>\n\t\t\t</ContextRail>\n\t\t) : null,\n\t);\n\n\tconst cancel = useMutation({\n\t\tmutationFn: () => client.cancelImport(im.id),\n\t\tonSuccess: (now) => {\n\t\t\tqueryClient.setQueryData(importhubKeys.import(workspaceId, now.id), now);\n\t\t\tvoid queryClient.invalidateQueries({ queryKey: importhubKeys.imports(workspaceId) });\n\t\t\tsetCancelling(false);\n\t\t},\n\t});\n\tconst { reset } = cancel;\n\tuseEffect(() => {\n\t\tif (cancelling) reset();\n\t}, [cancelling, reset]);\n\n\treturn (\n\t\t<DetailPageTemplate\n\t\t\ttitle={im.importProfileName}\n\t\t\tsubtitle={t(\"imports.subtitle\", {\n\t\t\t\tperson: personName(im.startedBy),\n\t\t\t\ttime: formatTime(lng, im.createTime),\n\t\t\t})}\n\t\t\tbreadcrumbs={[{ label: t(\"section.imports.title\"), to: paths.imports }]}\n\t\t\tbadges={<ImportStatusBadge im={im} />}\n\t\t>\n\t\t\t<Box px=\"8\" py=\"6\">\n\t\t\t\t<Stack gap=\"6\">\n\t\t\t\t\t<OutcomeAlert im={im} />\n\t\t\t\t\t{im.phase === \"reading\" || im.phase === \"writing\" ? <ProgressCard im={im} /> : null}\n\t\t\t\t\t<Card title={t(\"imports.details\")}>\n\t\t\t\t\t\t<DescriptionList>\n\t\t\t\t\t\t\t<DescriptionList.Row label={t(\"imports.startedBy\")}>\n\t\t\t\t\t\t\t\t{personName(im.startedBy)}\n\t\t\t\t\t\t\t</DescriptionList.Row>\n\t\t\t\t\t\t\t<DescriptionList.Row label={t(\"imports.started\")}>\n\t\t\t\t\t\t\t\t{formatTime(lng, im.startTime || im.createTime)}\n\t\t\t\t\t\t\t</DescriptionList.Row>\n\t\t\t\t\t\t\t{im.endTime ? (\n\t\t\t\t\t\t\t\t<DescriptionList.Row label={t(\"imports.ended\")}>\n\t\t\t\t\t\t\t\t\t{formatTime(lng, im.endTime)}\n\t\t\t\t\t\t\t\t</DescriptionList.Row>\n\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t<DescriptionList.Row label={t(\"imports.effectiveDate\")}>\n\t\t\t\t\t\t\t\t{im.effectiveDate || t(\"imports.none\")}\n\t\t\t\t\t\t\t</DescriptionList.Row>\n\t\t\t\t\t\t\t<DescriptionList.Row label={t(\"imports.source\")}>\n\t\t\t\t\t\t\t\t{im.source\n\t\t\t\t\t\t\t\t\t? t(\"imports.sourceValue\", {\n\t\t\t\t\t\t\t\t\t\t\treference: im.source.reference,\n\t\t\t\t\t\t\t\t\t\t\tdate: im.source.date,\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t: t(\"imports.none\")}\n\t\t\t\t\t\t\t</DescriptionList.Row>\n\t\t\t\t\t\t\t{im.changeSetId ? (\n\t\t\t\t\t\t\t\t<DescriptionList.Row label={t(\"imports.changeSet\")}>\n\t\t\t\t\t\t\t\t\t<ChangeSetLink changeSetId={im.changeSetId} />\n\t\t\t\t\t\t\t\t</DescriptionList.Row>\n\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t</DescriptionList>\n\t\t\t\t\t</Card>\n\t\t\t\t\t<Card title={t(\"imports.counts\")}>\n\t\t\t\t\t\t<DescriptionList>\n\t\t\t\t\t\t\t{(\n\t\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t\t\"matched\",\n\t\t\t\t\t\t\t\t\t\"created\",\n\t\t\t\t\t\t\t\t\t\"planned\",\n\t\t\t\t\t\t\t\t\t\"corrected\",\n\t\t\t\t\t\t\t\t\t\"kept\",\n\t\t\t\t\t\t\t\t\t\"unchanged\",\n\t\t\t\t\t\t\t\t\t\"problems\",\n\t\t\t\t\t\t\t\t] as const\n\t\t\t\t\t\t\t).map((k) => (\n\t\t\t\t\t\t\t\t<DescriptionList.Row key={k} label={t(`imports.${k}`)}>\n\t\t\t\t\t\t\t\t\t{im.counts[k].toLocaleString()}\n\t\t\t\t\t\t\t\t</DescriptionList.Row>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</DescriptionList>\n\t\t\t\t\t</Card>\n\t\t\t\t\t<ReleasesCard im={im} />\n\t\t\t\t\t<Card title={t(\"imports.itemProblems\")}>\n\t\t\t\t\t\t<ItemProblemsTable client={client} im={im} />\n\t\t\t\t\t</Card>\n\t\t\t\t</Stack>\n\t\t\t</Box>\n\t\t\t<Modal\n\t\t\t\topen={cancelling}\n\t\t\t\tonClose={() => setCancelling(false)}\n\t\t\t\theader={t(\"imports.cancelTitle\")}\n\t\t\t\tlazyMount\n\t\t\t\tunmountOnExit\n\t\t\t\tfooter={\n\t\t\t\t\t<HStack gap=\"2\">\n\t\t\t\t\t\t<Button variant=\"outline\" onClick={() => setCancelling(false)}>\n\t\t\t\t\t\t\t{t(\"imports.keepRunning\")}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tvariant=\"solid\"\n\t\t\t\t\t\t\tcolorPalette=\"red\"\n\t\t\t\t\t\t\tloading={cancel.isPending}\n\t\t\t\t\t\t\tonClick={() => cancel.mutate()}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{t(\"imports.cancelConfirm\")}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<Stack gap=\"4\">\n\t\t\t\t\t<Text>{t(\"imports.cancelMessage\")}</Text>\n\t\t\t\t\t{cancel.isError ? (\n\t\t\t\t\t\t<Alert\n\t\t\t\t\t\t\tstatus=\"error\"\n\t\t\t\t\t\t\tcolorPalette=\"danger\"\n\t\t\t\t\t\t\ttitle={t(\"imports.cancelFailed\", { message: cancel.error.message })}\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : null}\n\t\t\t\t</Stack>\n\t\t\t</Modal>\n\t\t</DetailPageTemplate>\n\t);\n}\n\n/** A timestamp as the UI's language writes it. */\nconst formatTime = (lng: string, iso: string) => new Date(iso).toLocaleString(lng);\n\n/** How the Import stands, when that needs saying: queued, cancelling, or how it ended. */\nfunction OutcomeAlert({ im }: { im: Import }) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst personName = usePersonName();\n\tif (im.outcome === \"failed\") {\n\t\treturn (\n\t\t\t<Alert status=\"error\" colorPalette=\"danger\" title={t(\"imports.failedTitle\")}>\n\t\t\t\t{im.failureReason}\n\t\t\t</Alert>\n\t\t);\n\t}\n\tif (im.outcome === \"cancelled\") {\n\t\treturn (\n\t\t\t<Alert status=\"info\" colorPalette=\"gray\">\n\t\t\t\t{t(\"imports.cancelledBody\", { person: personName(im.cancelledBy) })}\n\t\t\t</Alert>\n\t\t);\n\t}\n\tif (im.outcome === \"succeeded_with_problems\") {\n\t\treturn (\n\t\t\t<Alert status=\"warning\" colorPalette=\"warning\">\n\t\t\t\t{t(\"imports.problemsBody\", { count: im.counts.problems })}\n\t\t\t</Alert>\n\t\t);\n\t}\n\tif (isRunning(im) && im.cancelledBy) {\n\t\treturn (\n\t\t\t<Alert status=\"warning\" colorPalette=\"warning\">\n\t\t\t\t{t(\"imports.cancellingBody\", { person: personName(im.cancelledBy) })}\n\t\t\t</Alert>\n\t\t);\n\t}\n\tif (im.phase === \"queued\") {\n\t\treturn (\n\t\t\t<Alert status=\"info\" colorPalette=\"info\">\n\t\t\t\t{t(\"imports.queuedBody\")}\n\t\t\t</Alert>\n\t\t);\n\t}\n\treturn null;\n}\n\n/** A running Import's phase and how far it is (follow-an-import:AC2). */\nfunction ProgressCard({ im }: { im: Import }) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { done, total } = im.progress;\n\tconst known = total > 0;\n\treturn (\n\t\t<Card title={t(\"imports.progressTitle\")}>\n\t\t\t<Stack gap=\"2\">\n\t\t\t\t<Progress\n\t\t\t\t\tlabel={t(`imports.phaseLong.${im.phase as \"reading\" | \"writing\"}`)}\n\t\t\t\t\t// null is anker's indeterminate bar, while the total is unknown.\n\t\t\t\t\tvalue={known ? Math.round((done / total) * 100) : null}\n\t\t\t\t\tcolorPalette=\"info\"\n\t\t\t\t/>\n\t\t\t\t<Text color=\"muted\" fontSize=\"sm\">\n\t\t\t\t\t{known ? t(\"imports.progressOf\", { done, total }) : t(\"imports.progressUnknown\")}\n\t\t\t\t</Text>\n\t\t\t</Stack>\n\t\t</Card>\n\t);\n}\n\n/**\n * The exact Releases the Import ran with, pinned at Start\n * (release-a-configuration:AC8), each a link to its configuration's page.\n */\nfunction ReleasesCard({ im }: { im: Import }) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { importProfile, mappings, entitySet } = im.releases;\n\treturn (\n\t\t<Card title={t(\"imports.releases\")}>\n\t\t\t<DescriptionList>\n\t\t\t\t{importProfile ? (\n\t\t\t\t\t<DescriptionList.Row label={t(\"imports.profile\")}>\n\t\t\t\t\t\t<ReleaseLink section=\"profiles\" release={importProfile} />\n\t\t\t\t\t</DescriptionList.Row>\n\t\t\t\t) : null}\n\t\t\t\t<DescriptionList.Row label={t(\"imports.mappings\")}>\n\t\t\t\t\t<List.Root ps=\"0\" listStyleType=\"none\">\n\t\t\t\t\t\t{mappings.map((m) => (\n\t\t\t\t\t\t\t<List.Item key={m.releaseId}>\n\t\t\t\t\t\t\t\t<ReleaseLink section=\"mappings\" release={m} />\n\t\t\t\t\t\t\t</List.Item>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</List.Root>\n\t\t\t\t</DescriptionList.Row>\n\t\t\t\t<DescriptionList.Row label={t(\"imports.entitySet\")}>\n\t\t\t\t\t{entitySet ? <ReleaseLink section=\"entitySets\" release={entitySet} /> : t(\"imports.none\")}\n\t\t\t\t</DescriptionList.Row>\n\t\t\t</DescriptionList>\n\t\t</Card>\n\t);\n}\n\nfunction ReleaseLink({\n\tsection,\n\trelease,\n}: {\n\tsection: ImporthubSection;\n\trelease: ImportReleaseRef;\n}) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { paths } = useImporthubHost();\n\treturn (\n\t\t<Link asChild>\n\t\t\t<RouterLink to={itemPath(paths, section, release.configurationId)}>\n\t\t\t\t{t(\"imports.releaseOf\", { name: release.name, number: release.number })}\n\t\t\t</RouterLink>\n\t\t</Link>\n\t);\n}\n","import { Button } from \"@knkcs/anker/atoms\";\nimport {\n\tDataTable,\n\tDateCell,\n\tLinkCell,\n\tNumberCell,\n\tTruncatedTextCell,\n} from \"@knkcs/anker/components\";\nimport { useHostIdentity } from \"@knkcs/anker/host\";\nimport { Center } from \"@knkcs/anker/primitives\";\nimport { IndexPageTemplate } from \"@knkcs/anker/templates\";\nimport { useInfiniteQuery } from \"@tanstack/react-query\";\nimport type { ColumnDef } from \"@tanstack/react-table\";\nimport { Play } from \"lucide-react\";\nimport { useMemo } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport type { Import, ImporthubClient } from \"../../client/importhub-client\";\nimport { itemPath, useImporthubHost } from \"../../common/host\";\nimport {\n\tDEFAULT_POLL_INTERVAL_MS,\n\tImportStatusCell,\n\tisRunning,\n\tusePersonName,\n} from \"../../common/import-status\";\nimport { importhubKeys } from \"../../common/query-keys\";\nimport { LoadFailed } from \"../../common/query-state\";\nimport { useCanImport } from \"../../common/use-can-import\";\nimport { IMPORTHUB_UI_NS } from \"../../i18n/resources\";\n\nexport interface ImportsIndexProps {\n\tclient: ImporthubClient;\n\t/** Opens the start flow: the host navigates to where it mounts `StartImport`. */\n\tonStart: () => void;\n\t/**\n\t * How often the list reads again while one of its Imports is queued or\n\t * running, in ms; 2000 by default. It stops once all have ended.\n\t */\n\tpollIntervalMs?: number;\n}\n\n// DataTable takes rows that are records.\ntype Row = Import & Record<string, unknown>;\n\n/**\n * The workspace's Imports, newest first, with their Profile, starter,\n * Outcome and counts (follow-an-import:AC1); a queued Import shows as Queued.\n * The list follows Imports that are still running. An importer starts one\n * from the header; a viewer sees no Start (follow-an-import:AC8).\n */\nexport function ImportsIndex({\n\tclient,\n\tonStart,\n\tpollIntervalMs = DEFAULT_POLL_INTERVAL_MS,\n}: ImportsIndexProps) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { workspaceId } = useHostIdentity();\n\tconst { paths } = useImporthubHost();\n\tconst canImport = useCanImport();\n\tconst personName = usePersonName();\n\tconst query = useInfiniteQuery({\n\t\tqueryKey: importhubKeys.imports(workspaceId),\n\t\tqueryFn: ({ pageParam }) => client.listImports(pageParam),\n\t\tinitialPageParam: \"\",\n\t\tgetNextPageParam: (last) => last.nextPageToken || undefined,\n\t\trefetchInterval: (q) =>\n\t\t\tq.state.data?.pages.some((p) => p.imports.some(isRunning)) ? pollIntervalMs : false,\n\t});\n\tconst rows = useMemo(\n\t\t() => (query.data?.pages.flatMap((p) => p.imports) ?? []) as Row[],\n\t\t[query.data],\n\t);\n\tconst columns = useMemo<ColumnDef<Row, unknown>[]>(\n\t\t() => [\n\t\t\t{\n\t\t\t\tid: \"profile\",\n\t\t\t\theader: t(\"imports.profile\"),\n\t\t\t\tcell: (c) => (\n\t\t\t\t\t<LinkCell\n\t\t\t\t\t\tto={itemPath(paths, \"imports\", c.row.original.id)}\n\t\t\t\t\t\tlabel={c.row.original.importProfileName}\n\t\t\t\t\t/>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"startedBy\",\n\t\t\t\theader: t(\"imports.startedBy\"),\n\t\t\t\tsize: 160,\n\t\t\t\tcell: (c) => <TruncatedTextCell value={personName(c.row.original.startedBy)} />,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"started\",\n\t\t\t\theader: t(\"imports.started\"),\n\t\t\t\tsize: 150,\n\t\t\t\tcell: (c) => <DateCell value={c.row.original.createTime} />,\n\t\t\t},\n\t\t\t{\n\t\t\t\t// Its Outcome once it has one, its phase until then.\n\t\t\t\tid: \"outcome\",\n\t\t\t\theader: t(\"imports.outcomeColumn\"),\n\t\t\t\tsize: 190,\n\t\t\t\tcell: (c) => <ImportStatusCell im={c.row.original} />,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"matched\",\n\t\t\t\theader: t(\"imports.matched\"),\n\t\t\t\tsize: 90,\n\t\t\t\tcell: (c) => <NumberCell value={c.row.original.counts.matched} />,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"created\",\n\t\t\t\theader: t(\"imports.created\"),\n\t\t\t\tsize: 90,\n\t\t\t\tcell: (c) => <NumberCell value={c.row.original.counts.created} />,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"problems\",\n\t\t\t\theader: t(\"imports.problems\"),\n\t\t\t\tsize: 90,\n\t\t\t\tcell: (c) => <NumberCell value={c.row.original.counts.problems} />,\n\t\t\t},\n\t\t],\n\t\t[t, paths, personName],\n\t);\n\treturn (\n\t\t<IndexPageTemplate\n\t\t\ttitle={t(\"section.imports.title\")}\n\t\t\tactions={\n\t\t\t\tcanImport ? (\n\t\t\t\t\t<Button variant=\"solid\" onClick={onStart}>\n\t\t\t\t\t\t<Play size={16} aria-hidden />\n\t\t\t\t\t\t{t(\"imports.start\")}\n\t\t\t\t\t</Button>\n\t\t\t\t) : undefined\n\t\t\t}\n\t\t>\n\t\t\t{query.isError ? (\n\t\t\t\t<LoadFailed />\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<DataTable\n\t\t\t\t\t\tcolumns={columns}\n\t\t\t\t\t\tdata={rows}\n\t\t\t\t\t\tloading={query.isPending}\n\t\t\t\t\t\tgetRowId={(i) => i.id}\n\t\t\t\t\t\temptyState={t(\"imports.empty\")}\n\t\t\t\t\t/>\n\t\t\t\t\t{query.hasNextPage ? (\n\t\t\t\t\t\t<Center py=\"4\">\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\t\t\tloading={query.isFetchingNextPage}\n\t\t\t\t\t\t\t\tonClick={() => void query.fetchNextPage()}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{t(\"imports.loadMore\")}\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</Center>\n\t\t\t\t\t) : null}\n\t\t\t\t</>\n\t\t\t)}\n\t\t</IndexPageTemplate>\n\t);\n}\n","import type { ImporthubClient } from \"../../client/importhub-client\";\nimport { MappingScreen } from \"./mapping-page\";\n\nexport interface MappingDetailProps {\n\tclient: ImporthubClient;\n\t/** The Mapping's id. */\n\tid: string;\n\t/** It was deleted: the host leaves its page. */\n\tonDeleted: () => void;\n}\n\n/**\n * One Mapping's page without the structured editor (manage-mappings:AC2):\n * its name, element selector and Source Key, its target, the Profiles that\n * include it, release and history. Every other setting (field mappings,\n * Version Match, Title Contributions, …) is the Mapping editor's, from\n * `@knkcs/importhub-ui/mapping-editor`, and is saved back exactly as it came.\n * A host that loads the editor mounts `MappingEditor` in its place: the same\n * page with the editor's tabs.\n */\nexport function MappingDetail({ client, id, onDeleted }: MappingDetailProps) {\n\treturn <MappingScreen client={client} id={id} onDeleted={onDeleted} />;\n}\n","import { BaseSelectField, InputField } from \"@knkcs/anker/forms\";\nimport { useHostIdentity } from \"@knkcs/anker/host\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport { useEffect, useRef } from \"react\";\nimport { useFormContext, useWatch } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport { useImporthubHost } from \"../../common/host\";\nimport { importhubKeys } from \"../../common/query-keys\";\nimport { IMPORTHUB_UI_NS } from \"../../i18n/resources\";\n\ntype Values = { blueprintId: string; blueprintReleaseId: string };\n\n/**\n * A new Mapping's target Blueprint and the Release it pins\n * (manage-mappings:AC2): picked by name from the host's lookup, or, where the\n * host has none, entered as the ids they are, labelled as such.\n */\nexport function BlueprintFields() {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { blueprints } = useImporthubHost();\n\tif (!blueprints) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<InputField<Values> name=\"blueprintId\" label={t(\"mappings.blueprintId\")} required />\n\t\t\t\t<InputField<Values>\n\t\t\t\t\tname=\"blueprintReleaseId\"\n\t\t\t\t\tlabel={t(\"mappings.releaseId\")}\n\t\t\t\t\thelperText={t(\"mappings.idsHelp\")}\n\t\t\t\t\trequired\n\t\t\t\t/>\n\t\t\t</>\n\t\t);\n\t}\n\treturn <BlueprintSelects />;\n}\n\nfunction BlueprintSelects() {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { blueprints } = useImporthubHost();\n\tconst { workspaceId } = useHostIdentity();\n\tconst { control, setValue } = useFormContext<Values>();\n\tconst blueprintId = useWatch({ control, name: \"blueprintId\" });\n\t// Another Blueprint empties the Release: one of the old Blueprint's would\n\t// make the Mapping invalid (`release_of_other_blueprint`).\n\tconst previous = useRef(blueprintId);\n\tuseEffect(() => {\n\t\tif (previous.current !== blueprintId) setValue(\"blueprintReleaseId\", \"\");\n\t\tprevious.current = blueprintId;\n\t}, [blueprintId, setValue]);\n\tconst list = useQuery({\n\t\tqueryKey: importhubKeys.blueprints(workspaceId),\n\t\tqueryFn: () => blueprints?.listBlueprints() ?? Promise.resolve([]),\n\t});\n\tconst releases = useQuery({\n\t\tqueryKey: importhubKeys.blueprintReleases(workspaceId, blueprintId ?? \"\"),\n\t\tqueryFn: () => blueprints?.listReleases(blueprintId) ?? Promise.resolve([]),\n\t\tenabled: Boolean(blueprintId),\n\t});\n\treturn (\n\t\t<>\n\t\t\t<BaseSelectField<Values>\n\t\t\t\tname=\"blueprintId\"\n\t\t\t\tlabel={t(\"mappings.blueprint\")}\n\t\t\t\trequired\n\t\t\t\toptions={(list.data ?? []).map((b) => ({ id: b.id, label: b.name }))}\n\t\t\t/>\n\t\t\t<BaseSelectField<Values>\n\t\t\t\tname=\"blueprintReleaseId\"\n\t\t\t\tlabel={t(\"mappings.release\")}\n\t\t\t\trequired\n\t\t\t\tdisabled={!blueprintId}\n\t\t\t\toptions={(releases.data ?? []).map((r) => ({ id: r.id, label: r.label }))}\n\t\t\t/>\n\t\t</>\n\t);\n}\n","import { Button } from \"@knkcs/anker/atoms\";\nimport { CodeCell, DataTable, LinkCell, TruncatedTextCell } from \"@knkcs/anker/components\";\nimport { useHostIdentity } from \"@knkcs/anker/host\";\nimport { IndexPageTemplate } from \"@knkcs/anker/templates\";\nimport { useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport type { ColumnDef } from \"@tanstack/react-table\";\nimport { Plus } from \"lucide-react\";\nimport { useMemo, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport type { ImporthubClient, Mapping } from \"../../client/importhub-client\";\nimport { useBlueprintNames } from \"../../common/blueprint-names\";\nimport { CreateDialog } from \"../../common/create-dialog\";\nimport { itemPath, useImporthubHost } from \"../../common/host\";\nimport { importhubKeys } from \"../../common/query-keys\";\nimport { LoadFailed } from \"../../common/query-state\";\nimport { useCanConfigure } from \"../../common/use-can-configure\";\nimport { ValidityCell } from \"../../common/validity\";\nimport { IMPORTHUB_UI_NS } from \"../../i18n/resources\";\nimport { BlueprintFields } from \"./blueprint-fields\";\n\nexport interface MappingsIndexProps {\n\tclient: ImporthubClient;\n\t/** Opens a Mapping's page: the host navigates, after a create too. */\n\tonOpen: (id: string) => void;\n}\n\n// DataTable takes rows that are records.\ntype Row = Mapping & Record<string, unknown>;\n\nconst CREATE_DEFAULTS = { blueprintId: \"\", blueprintReleaseId: \"\" };\n\n/**\n * Every Mapping of the workspace with its target Blueprint, its pinned\n * Blueprint Release and its validity (manage-mappings:AC1); an admin creates\n * one, naming the Blueprint and the Release, from the header (AC2).\n */\nexport function MappingsIndex({ client, onOpen }: MappingsIndexProps) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { workspaceId } = useHostIdentity();\n\tconst { paths } = useImporthubHost();\n\tconst canConfigure = useCanConfigure();\n\tconst queryClient = useQueryClient();\n\tconst [creating, setCreating] = useState(false);\n\tconst query = useQuery({\n\t\tqueryKey: importhubKeys.mappings(workspaceId),\n\t\tqueryFn: () => client.listMappings(),\n\t});\n\tconst names = useBlueprintNames((query.data ?? []).map((m) => m.content.blueprintId));\n\tconst columns = useMemo<ColumnDef<Row, unknown>[]>(\n\t\t() => [\n\t\t\t{\n\t\t\t\tid: \"name\",\n\t\t\t\theader: t(\"fields.name\"),\n\t\t\t\tcell: (c) => (\n\t\t\t\t\t<LinkCell\n\t\t\t\t\t\tto={itemPath(paths, \"mappings\", c.row.original.id)}\n\t\t\t\t\t\tlabel={c.row.original.content.name}\n\t\t\t\t\t/>\n\t\t\t\t),\n\t\t\t},\n\t\t\tnames.available\n\t\t\t\t? {\n\t\t\t\t\t\tid: \"blueprint\",\n\t\t\t\t\t\theader: t(\"mappings.blueprint\"),\n\t\t\t\t\t\tcell: (c) => (\n\t\t\t\t\t\t\t<TruncatedTextCell\n\t\t\t\t\t\t\t\tvalue={names.blueprintName(c.row.original.content.blueprintId) ?? \"\"}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t),\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\tid: \"blueprint\",\n\t\t\t\t\t\theader: t(\"mappings.blueprintId\"),\n\t\t\t\t\t\tcell: (c) => <CodeCell value={c.row.original.content.blueprintId} />,\n\t\t\t\t\t},\n\t\t\tnames.available\n\t\t\t\t? {\n\t\t\t\t\t\tid: \"release\",\n\t\t\t\t\t\theader: t(\"mappings.release\"),\n\t\t\t\t\t\tcell: (c) => (\n\t\t\t\t\t\t\t<TruncatedTextCell\n\t\t\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\t\t\tnames.releaseLabel(\n\t\t\t\t\t\t\t\t\t\tc.row.original.content.blueprintId,\n\t\t\t\t\t\t\t\t\t\tc.row.original.content.blueprintReleaseId,\n\t\t\t\t\t\t\t\t\t) ?? \"\"\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t),\n\t\t\t\t\t}\n\t\t\t\t: {\n\t\t\t\t\t\tid: \"release\",\n\t\t\t\t\t\theader: t(\"mappings.releaseId\"),\n\t\t\t\t\t\tcell: (c) => <CodeCell value={c.row.original.content.blueprintReleaseId} />,\n\t\t\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"validity\",\n\t\t\t\theader: t(\"validity.column\"),\n\t\t\t\tcell: (c) => <ValidityCell validity={c.row.original.validity} />,\n\t\t\t},\n\t\t],\n\t\t[t, paths, names],\n\t);\n\treturn (\n\t\t<IndexPageTemplate\n\t\t\ttitle={t(\"section.mappings.title\")}\n\t\t\tactions={\n\t\t\t\tcanConfigure ? (\n\t\t\t\t\t<Button variant=\"solid\" onClick={() => setCreating(true)}>\n\t\t\t\t\t\t<Plus size={16} aria-hidden />\n\t\t\t\t\t\t{t(\"mappings.new\")}\n\t\t\t\t\t</Button>\n\t\t\t\t) : undefined\n\t\t\t}\n\t\t>\n\t\t\t{query.isError ? (\n\t\t\t\t<LoadFailed />\n\t\t\t) : (\n\t\t\t\t<DataTable\n\t\t\t\t\tcolumns={columns}\n\t\t\t\t\tdata={(query.data ?? []) as Row[]}\n\t\t\t\t\tloading={query.isPending}\n\t\t\t\t\tgetRowId={(m) => m.id}\n\t\t\t\t\temptyState={t(\"mappings.empty\")}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<CreateDialog\n\t\t\t\topen={creating}\n\t\t\t\tonClose={() => setCreating(false)}\n\t\t\t\ttitle={t(\"mappings.new\")}\n\t\t\t\tdefaultValues={CREATE_DEFAULTS}\n\t\t\t\tonCreate={async ({ name, description, blueprintId, blueprintReleaseId }) => {\n\t\t\t\t\tconst m = await client.createMapping({\n\t\t\t\t\t\tname,\n\t\t\t\t\t\tdescription,\n\t\t\t\t\t\tblueprintId: blueprintId ?? \"\",\n\t\t\t\t\t\tblueprintReleaseId: blueprintReleaseId ?? \"\",\n\t\t\t\t\t});\n\t\t\t\t\tawait queryClient.invalidateQueries({ queryKey: importhubKeys.mappings(workspaceId) });\n\t\t\t\t\treturn m.id;\n\t\t\t\t}}\n\t\t\t\tonCreated={(id) => {\n\t\t\t\t\tsetCreating(false);\n\t\t\t\t\tonOpen(id);\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<BlueprintFields />\n\t\t\t</CreateDialog>\n\t\t</IndexPageTemplate>\n\t);\n}\n","import { DataTable, SlugCell, TruncatedTextCell } from \"@knkcs/anker/components\";\nimport { useHostIdentity } from \"@knkcs/anker/host\";\nimport { IndexPageTemplate } from \"@knkcs/anker/templates\";\nimport { useQuery } from \"@tanstack/react-query\";\nimport type { ColumnDef } from \"@tanstack/react-table\";\nimport { useMemo } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport type { ImporthubClient, Processor } from \"../../client/importhub-client\";\nimport { importhubKeys } from \"../../common/query-keys\";\nimport { LoadFailed } from \"../../common/query-state\";\nimport { IMPORTHUB_UI_NS } from \"../../i18n/resources\";\n\nexport interface ProcessorCatalogueProps {\n\tclient: ImporthubClient;\n}\n\n// DataTable takes rows that are records.\ntype Row = Processor & Record<string, unknown>;\n\n/**\n * The Processor catalogue (manage-import-profiles:AC5): every Processor with\n * its kind, where it is configured, what it does and the settings it takes,\n * by their names. Read-only for everyone: the catalogue is importhub's.\n */\nexport function ProcessorCatalogue({ client }: ProcessorCatalogueProps) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { workspaceId } = useHostIdentity();\n\tconst query = useQuery({\n\t\tqueryKey: importhubKeys.processors(workspaceId),\n\t\tqueryFn: () => client.listProcessors(),\n\t});\n\tconst columns = useMemo<ColumnDef<Row, unknown>[]>(\n\t\t() => [\n\t\t\t{\n\t\t\t\tid: \"name\",\n\t\t\t\theader: t(\"fields.name\"),\n\t\t\t\tsize: 180,\n\t\t\t\tcell: (c) => <SlugCell value={c.row.original.name} />,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"kind\",\n\t\t\t\theader: t(\"processors.kindColumn\"),\n\t\t\t\tsize: 140,\n\t\t\t\tcell: (c) => <TruncatedTextCell value={t(`processors.kind.${c.row.original.kind}`)} />,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"target\",\n\t\t\t\theader: t(\"processors.targetColumn\"),\n\t\t\t\tsize: 160,\n\t\t\t\tcell: (c) => <TruncatedTextCell value={t(`processors.target.${c.row.original.target}`)} />,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"description\",\n\t\t\t\theader: t(\"fields.description\"),\n\t\t\t\tcell: (c) => <TruncatedTextCell value={c.row.original.description} />,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"settings\",\n\t\t\t\theader: t(\"processors.settingsColumn\"),\n\t\t\t\tcell: (c) => (\n\t\t\t\t\t<TruncatedTextCell\n\t\t\t\t\t\tvalue={\n\t\t\t\t\t\t\tc.row.original.settingsSpec.length === 0\n\t\t\t\t\t\t\t\t? t(\"processors.noSettings\")\n\t\t\t\t\t\t\t\t: c.row.original.settingsSpec\n\t\t\t\t\t\t\t\t\t\t.map((f) => f.config.name || f.config.api_accessor)\n\t\t\t\t\t\t\t\t\t\t.join(\", \")\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t),\n\t\t\t},\n\t\t],\n\t\t[t],\n\t);\n\treturn (\n\t\t<IndexPageTemplate title={t(\"section.processors.title\")}>\n\t\t\t{query.isError ? (\n\t\t\t\t<LoadFailed />\n\t\t\t) : (\n\t\t\t\t<DataTable\n\t\t\t\t\tcolumns={columns}\n\t\t\t\t\tdata={(query.data ?? []) as Row[]}\n\t\t\t\t\tloading={query.isPending}\n\t\t\t\t\tgetRowId={(p) => p.name}\n\t\t\t\t\temptyState={t(\"processors.empty\")}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</IndexPageTemplate>\n\t);\n}\n","import { Button, IconButton } from \"@knkcs/anker/atoms\";\nimport {\n\tBox,\n\tHStack,\n\tMenuContent,\n\tMenuItem,\n\tMenuRoot,\n\tMenuTrigger,\n\tStack,\n\tText,\n} from \"@knkcs/anker/primitives\";\nimport { ArrowDown, ArrowUp, Plus, Trash2 } from \"lucide-react\";\nimport type { ReactNode } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { IMPORTHUB_UI_NS } from \"../../i18n/resources\";\n\n/** Moves the item at `from` to `to`, returning a new list. */\nexport function moved<T>(list: readonly T[], from: number, to: number): T[] {\n\tconst next = [...list];\n\tconst [item] = next.splice(from, 1);\n\tnext.splice(to, 0, item as T);\n\treturn next;\n}\n\nexport interface OrderedListProps<T> {\n\titems: readonly T[];\n\t/** Each row's content: its name and what else it shows. */\n\trenderItem: (item: T, index: number) => ReactNode;\n\t/** The row's name in the move and remove buttons' labels. */\n\tnameOf: (item: T) => string;\n\t/** Whether to offer moving, removing and adding: an admin's. */\n\teditable: boolean;\n\tonChange: (next: T[]) => void;\n\t/** Shown when the list is empty. */\n\temptyLabel: string;\n\t/** The add menu's button label, and what it offers. */\n\taddLabel: string;\n\taddOptions: { value: string; label: string }[];\n\tonAdd: (value: string) => void;\n}\n\n/**\n * An ordered list a Profile holds (its Preprocessors, Mappings and\n * Post-processors), in the order they run: an admin moves each up or down\n * with a button, which the keyboard reaches as well as the pointer, removes\n * it, and adds from a menu (manage-import-profiles:AC4).\n */\nexport function OrderedList<T>({\n\titems,\n\trenderItem,\n\tnameOf,\n\teditable,\n\tonChange,\n\temptyLabel,\n\taddLabel,\n\taddOptions,\n\tonAdd,\n}: OrderedListProps<T>) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\treturn (\n\t\t<Stack gap=\"2\">\n\t\t\t{items.length === 0 ? (\n\t\t\t\t<Text color=\"fg.muted\">{emptyLabel}</Text>\n\t\t\t) : (\n\t\t\t\t<Stack as=\"ol\" gap=\"0\" listStyleType=\"none\" ms=\"0\">\n\t\t\t\t\t{items.map((item, index) => {\n\t\t\t\t\t\tconst name = nameOf(item);\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\t\tas=\"li\"\n\t\t\t\t\t\t\t\t// Items carry no id of their own; the same Processor may run twice.\n\t\t\t\t\t\t\t\t// biome-ignore lint/suspicious/noArrayIndexKey: the position is the identity here\n\t\t\t\t\t\t\t\tkey={index}\n\t\t\t\t\t\t\t\tgap=\"3\"\n\t\t\t\t\t\t\t\tpy=\"2\"\n\t\t\t\t\t\t\t\tborderBottomWidth=\"1px\"\n\t\t\t\t\t\t\t\tborderColor=\"border\"\n\t\t\t\t\t\t\t\talign=\"start\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Text color=\"fg.muted\" minW=\"6\" textAlign=\"end\">\n\t\t\t\t\t\t\t\t\t{index + 1}.\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t<Box flex=\"1\" minW=\"0\">\n\t\t\t\t\t\t\t\t\t{renderItem(item, index)}\n\t\t\t\t\t\t\t\t</Box>\n\t\t\t\t\t\t\t\t{editable ? (\n\t\t\t\t\t\t\t\t\t<HStack gap=\"1\">\n\t\t\t\t\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t\t\t\t\taria-label={t(\"order.moveUp\", { name })}\n\t\t\t\t\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\t\t\t\t\t\tdisabled={index === 0}\n\t\t\t\t\t\t\t\t\t\t\tonClick={() => onChange(moved(items, index, index - 1))}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<ArrowUp size={14} />\n\t\t\t\t\t\t\t\t\t\t</IconButton>\n\t\t\t\t\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t\t\t\t\taria-label={t(\"order.moveDown\", { name })}\n\t\t\t\t\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\t\t\t\t\t\tdisabled={index === items.length - 1}\n\t\t\t\t\t\t\t\t\t\t\tonClick={() => onChange(moved(items, index, index + 1))}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<ArrowDown size={14} />\n\t\t\t\t\t\t\t\t\t\t</IconButton>\n\t\t\t\t\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t\t\t\t\taria-label={t(\"order.remove\", { name })}\n\t\t\t\t\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\t\t\t\t\tvariant=\"ghost\"\n\t\t\t\t\t\t\t\t\t\t\tcolorPalette=\"red\"\n\t\t\t\t\t\t\t\t\t\t\tonClick={() => onChange(items.filter((_, i) => i !== index))}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<Trash2 size={14} />\n\t\t\t\t\t\t\t\t\t\t</IconButton>\n\t\t\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t</HStack>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</Stack>\n\t\t\t)}\n\t\t\t{editable ? (\n\t\t\t\t<Box>\n\t\t\t\t\t<MenuRoot onSelect={(d) => onAdd(d.value)}>\n\t\t\t\t\t\t<MenuTrigger asChild>\n\t\t\t\t\t\t\t<Button variant=\"outline\" size=\"sm\" disabled={addOptions.length === 0}>\n\t\t\t\t\t\t\t\t<Plus size={14} aria-hidden />\n\t\t\t\t\t\t\t\t{addLabel}\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</MenuTrigger>\n\t\t\t\t\t\t<MenuContent>\n\t\t\t\t\t\t\t{addOptions.map((o) => (\n\t\t\t\t\t\t\t\t<MenuItem key={o.value} value={o.value}>\n\t\t\t\t\t\t\t\t\t{o.label}\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</MenuContent>\n\t\t\t\t\t</MenuRoot>\n\t\t\t\t</Box>\n\t\t\t) : null}\n\t\t</Stack>\n\t);\n}\n","import { zodResolver } from \"@hookform/resolvers/zod\";\nimport { Modal } from \"@knkcs/anker/components\";\nimport { FieldKitProvider, SpecForm } from \"@knkcs/fieldkit/renderer\";\nimport { builtInFieldTypes, specToZodSchema } from \"@knkcs/fieldkit/schema\";\nimport { useEffect, useMemo } from \"react\";\nimport { FormProvider, useForm } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport type { Processor } from \"../../client/importhub-client\";\nimport { IMPORTHUB_UI_NS } from \"../../i18n/resources\";\n\nexport interface ProcessorSettingsDialogProps {\n\topen: boolean;\n\tonClose: () => void;\n\t/** The Processor whose settings these are; null while nothing is open. */\n\tprocessor: Processor | null;\n\tsettings: Record<string, unknown>;\n\t/** Shows the settings without a way to change them: a viewer's. */\n\treadOnly: boolean;\n\t/** Applies the settings into the Profile's draft; the header's Save persists them. */\n\tonApply: (settings: Record<string, unknown>) => void;\n}\n\nconst NO_SETTINGS: Record<string, unknown> = {};\n\n/**\n * One Processor step's settings, in the form fieldkit generates from the\n * Processor's settings spec (manage-import-profiles:AC4): anker fields,\n * validated by the spec's own Zod schema, which is the shape importhub\n * checks on save. \"Apply\" puts them into the Profile's draft; nothing is\n * saved until the page's Save (anker ADR 0004).\n */\nexport function ProcessorSettingsDialog({\n\topen,\n\tonClose,\n\tprocessor,\n\tsettings,\n\treadOnly,\n\tonApply,\n}: ProcessorSettingsDialogProps) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst spec = processor?.settingsSpec ?? [];\n\tconst resolver = useMemo(() => zodResolver(specToZodSchema(spec, builtInFieldTypes)), [spec]);\n\tconst form = useForm<Record<string, unknown>>({ defaultValues: settings, resolver });\n\tconst { reset } = form;\n\t// Each opening starts from the step's settings as they are in the draft.\n\tuseEffect(() => {\n\t\tif (open) reset(settings ?? NO_SETTINGS);\n\t}, [open, settings, reset]);\n\tconst apply = form.handleSubmit((values) => onApply(values));\n\treturn (\n\t\t<Modal\n\t\t\topen={open}\n\t\t\tonClose={onClose}\n\t\t\theader={t(\"processors.settingsOf\", { name: processor?.name ?? \"\" })}\n\t\t\tlazyMount\n\t\t\tunmountOnExit\n\t\t\tcancelLabel={readOnly ? t(\"common.close\") : t(\"common.cancel\")}\n\t\t\tsaveLabel={t(\"common.apply\")}\n\t\t\tonSave={readOnly ? undefined : () => void apply()}\n\t\t>\n\t\t\t<FormProvider {...form}>\n\t\t\t\t<form\n\t\t\t\t\tonSubmit={(e) => {\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\tvoid apply();\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<FieldKitProvider plugins={builtInFieldTypes}>\n\t\t\t\t\t\t{readOnly ? (\n\t\t\t\t\t\t\t<SpecForm schema={spec} mode=\"read\" values={settings} />\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<SpecForm schema={spec} />\n\t\t\t\t\t\t)}\n\t\t\t\t\t</FieldKitProvider>\n\t\t\t\t</form>\n\t\t\t</FormProvider>\n\t\t</Modal>\n\t);\n}\n","import { Button, StatusBadge } from \"@knkcs/anker/atoms\";\nimport { Card, ContextRail } from \"@knkcs/anker/components\";\nimport { BaseSelectField, InputField, SwitchField, TextareaField } from \"@knkcs/anker/forms\";\nimport { useHostIdentity } from \"@knkcs/anker/host\";\nimport { Alert, Box, HStack, Link, Stack, Text } from \"@knkcs/anker/primitives\";\nimport { DetailPageTemplate, usePageRail } from \"@knkcs/anker/templates\";\nimport { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport { Settings2, Trash2 } from \"lucide-react\";\nimport { useEffect, useMemo, useState } from \"react\";\nimport { FormProvider, useForm, useFormContext, useWatch } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport { Link as RouterLink } from \"react-router\";\nimport type {\n\tImporthubClient,\n\tImportProfile,\n\tImportProfileContent,\n\tProcessor,\n\tProcessorKind,\n\tProcessorStep,\n} from \"../../client/importhub-client\";\nimport { useConfigurationTab } from \"../../common/configuration-tabs\";\nimport { DeleteDialog } from \"../../common/delete-dialog\";\nimport { itemPath, useImporthubHost } from \"../../common/host\";\nimport { importhubKeys } from \"../../common/query-keys\";\nimport { LoadFailed, Loading } from \"../../common/query-state\";\nimport { ReleaseStateBadge } from \"../../common/release-state\";\nimport { useCanConfigure } from \"../../common/use-can-configure\";\nimport { useConfigurationRelease } from \"../../common/use-configuration-release\";\nimport { ValidityAlert } from \"../../common/validity\";\nimport { IMPORTHUB_UI_NS } from \"../../i18n/resources\";\nimport { ConfigurationHistory } from \"../history/configuration-history\";\nimport { OrderedList } from \"./ordered-list\";\nimport { ProcessorSettingsDialog } from \"./processor-settings-dialog\";\n\nexport interface ImportProfileDetailProps {\n\tclient: ImporthubClient;\n\t/** The Import Profile's id. */\n\tid: string;\n\t/** It was deleted: the host leaves its page, for the list, say. */\n\tonDeleted: () => void;\n}\n\n/** The form's values: the content, with \"no Entity Set\" as null for the select. */\ntype ProfileValues = Omit<ImportProfileContent, \"entitySetId\"> & { entitySetId: string | null };\n\nconst valuesOf = (c: ImportProfileContent): ProfileValues => ({\n\t...c,\n\tentitySetId: c.entitySetId || null,\n});\n\nconst contentOf = (v: ProfileValues): ImportProfileContent => ({\n\t...v,\n\tentitySetId: v.entitySetId ?? \"\",\n});\n\n/**\n * One Import Profile with every setting (manage-import-profiles:AC3): its\n * Entity Set, its Preprocessors, Mappings and Post-processors in order, each\n * Processor configured in a form generated from its settings spec (AC4), and\n * what happens to the result. An admin edits all of it as one draft and\n * saves it with the header's one Save, and deletes the Profile from the rail\n * (anker ADR 0004); a viewer sees the same page read-only. Why it is invalid\n * heads the page (AC6).\n */\nexport function ImportProfileDetail({ client, id, onDeleted }: ImportProfileDetailProps) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { workspaceId } = useHostIdentity();\n\tconst query = useQuery({\n\t\tqueryKey: importhubKeys.importProfile(workspaceId, id),\n\t\tqueryFn: () => client.getImportProfile(id),\n\t});\n\tif (query.isError) {\n\t\treturn (\n\t\t\t<DetailPageTemplate title={t(\"section.profiles.title\")}>\n\t\t\t\t<LoadFailed />\n\t\t\t</DetailPageTemplate>\n\t\t);\n\t}\n\tif (!query.data) {\n\t\treturn (\n\t\t\t<DetailPageTemplate title={t(\"section.profiles.title\")}>\n\t\t\t\t<Loading />\n\t\t\t</DetailPageTemplate>\n\t\t);\n\t}\n\treturn <ProfilePage client={client} profile={query.data} onDeleted={onDeleted} />;\n}\n\nfunction ProfilePage({\n\tclient,\n\tprofile,\n\tonDeleted,\n}: {\n\tclient: ImporthubClient;\n\tprofile: ImportProfile;\n\tonDeleted: () => void;\n}) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { workspaceId } = useHostIdentity();\n\tconst { paths } = useImporthubHost();\n\tconst canConfigure = useCanConfigure();\n\tconst queryClient = useQueryClient();\n\tconst [deleting, setDeleting] = useState(false);\n\n\tconst processors = useQuery({\n\t\tqueryKey: importhubKeys.processors(workspaceId),\n\t\tqueryFn: () => client.listProcessors(),\n\t});\n\tconst mappings = useQuery({\n\t\tqueryKey: importhubKeys.mappings(workspaceId),\n\t\tqueryFn: () => client.listMappings(),\n\t});\n\tconst entitySets = useQuery({\n\t\tqueryKey: importhubKeys.entitySets(workspaceId),\n\t\tqueryFn: () => client.listEntitySets(),\n\t});\n\n\tconst form = useForm<ProfileValues>({ defaultValues: valuesOf(profile.content) });\n\tconst { reset, formState } = form;\n\t// A newer draft from the server (a save, a refetch) becomes the baseline\n\t// unless the admin is in the middle of an edit.\n\tuseEffect(() => {\n\t\tif (!formState.isDirty) reset(valuesOf(profile.content));\n\t}, [profile, reset, formState.isDirty]);\n\n\tconst save = useMutation({\n\t\tmutationFn: (values: ProfileValues) =>\n\t\t\tclient.updateImportProfile(profile.id, contentOf(values), profile.state.draftRevisionId),\n\t\tonSuccess: (saved) => {\n\t\t\tqueryClient.setQueryData(importhubKeys.importProfile(workspaceId, saved.id), saved);\n\t\t\treset(valuesOf(saved.content));\n\t\t\tvoid queryClient.invalidateQueries({ queryKey: importhubKeys.importProfiles(workspaceId) });\n\t\t},\n\t});\n\tconst onSave = form.handleSubmit((values) => save.mutate(values));\n\n\tconst name = useWatch({ control: form.control, name: \"name\" });\n\tconst [tab, tabs] = useConfigurationTab();\n\tconst releasing = useConfigurationRelease({\n\t\tclient,\n\t\tkind: \"importProfile\",\n\t\tid: profile.id,\n\t\tvalidity: profile.validity,\n\t\tstate: profile.state,\n\t\tunsaved: formState.isDirty,\n\t});\n\n\tusePageRail(\n\t\tcanConfigure ? (\n\t\t\t<ContextRail storageKey=\"importhub.profile.rail\">\n\t\t\t\t<ContextRail.Header title={t(\"rail.title\")} />\n\t\t\t\t<ContextRail.Section id=\"actions\" label={t(\"rail.actions\")}>\n\t\t\t\t\t{releasing.railAction}\n\t\t\t\t\t<ContextRail.IconButton\n\t\t\t\t\t\tlabel={t(\"profiles.delete\")}\n\t\t\t\t\t\ticon={<Trash2 size={16} />}\n\t\t\t\t\t\ttone=\"outline-red\"\n\t\t\t\t\t\tonClick={() => setDeleting(true)}\n\t\t\t\t\t/>\n\t\t\t\t</ContextRail.Section>\n\t\t\t</ContextRail>\n\t\t) : null,\n\t);\n\n\treturn (\n\t\t<DetailPageTemplate\n\t\t\ttitle={profile.content.name}\n\t\t\tbreadcrumbs={[{ label: t(\"section.profiles.title\"), to: paths.profiles }]}\n\t\t\tbadges={\n\t\t\t\t<HStack gap=\"2\">\n\t\t\t\t\t<StatusBadge\n\t\t\t\t\t\ttone={profile.validity.valid ? \"success\" : \"danger\"}\n\t\t\t\t\t\tlabel={profile.validity.valid ? t(\"validity.valid\") : t(\"validity.invalid\")}\n\t\t\t\t\t/>\n\t\t\t\t\t<ReleaseStateBadge state={profile.state} />\n\t\t\t\t</HStack>\n\t\t\t}\n\t\t\ttabs={tabs}\n\t\t\tactions={\n\t\t\t\tcanConfigure ? (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"solid\"\n\t\t\t\t\t\tdisabled={!formState.isDirty}\n\t\t\t\t\t\tloading={save.isPending}\n\t\t\t\t\t\tonClick={() => void onSave()}\n\t\t\t\t\t>\n\t\t\t\t\t\t{t(\"common.save\")}\n\t\t\t\t\t</Button>\n\t\t\t\t) : undefined\n\t\t\t}\n\t\t>\n\t\t\t{tab === \"history\" ? (\n\t\t\t\t<ConfigurationHistory\n\t\t\t\t\tclient={client}\n\t\t\t\t\tkind=\"importProfile\"\n\t\t\t\t\tid={profile.id}\n\t\t\t\t\tdraftRevisionId={profile.state.draftRevisionId}\n\t\t\t\t\tonRestored={async () => {\n\t\t\t\t\t\t// The restored draft replaces what the form holds.\n\t\t\t\t\t\tconst fresh = await client.getImportProfile(profile.id);\n\t\t\t\t\t\tqueryClient.setQueryData(importhubKeys.importProfile(workspaceId, fresh.id), fresh);\n\t\t\t\t\t\treset(valuesOf(fresh.content));\n\t\t\t\t\t}}\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<Box px=\"8\" py=\"6\">\n\t\t\t\t\t{/* The lists the settings name things from: until they are read, a\n\t\t\t\t step would show as unknown and the Entity Set as its id. */}\n\t\t\t\t\t{processors.isPending || mappings.isPending || entitySets.isPending ? (\n\t\t\t\t\t\t<Loading />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<FormProvider {...form}>\n\t\t\t\t\t\t\t<form\n\t\t\t\t\t\t\t\tonSubmit={(e) => {\n\t\t\t\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t\t\t\t\tif (canConfigure) void onSave();\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Stack gap=\"4\">\n\t\t\t\t\t\t\t\t\t{releasing.notice}\n\t\t\t\t\t\t\t\t\t<ValidityAlert validity={profile.validity} />\n\t\t\t\t\t\t\t\t\t{save.isError ? (\n\t\t\t\t\t\t\t\t\t\t<Alert status=\"error\" colorPalette=\"danger\" title={t(\"save.failed\")}>\n\t\t\t\t\t\t\t\t\t\t\t{save.error.message}\n\t\t\t\t\t\t\t\t\t\t</Alert>\n\t\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t\t<Card title={t(\"profiles.general\")}>\n\t\t\t\t\t\t\t\t\t\t<Stack gap=\"4\">\n\t\t\t\t\t\t\t\t\t\t\t<InputField<ProfileValues>\n\t\t\t\t\t\t\t\t\t\t\t\tname=\"name\"\n\t\t\t\t\t\t\t\t\t\t\t\tlabel={t(\"fields.name\")}\n\t\t\t\t\t\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\t\t\t\t\t\tdisabled={!canConfigure}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t<TextareaField<ProfileValues>\n\t\t\t\t\t\t\t\t\t\t\t\tname=\"description\"\n\t\t\t\t\t\t\t\t\t\t\t\tlabel={t(\"fields.description\")}\n\t\t\t\t\t\t\t\t\t\t\t\tdisabled={!canConfigure}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t<BaseSelectField<ProfileValues>\n\t\t\t\t\t\t\t\t\t\t\t\tname=\"entitySetId\"\n\t\t\t\t\t\t\t\t\t\t\t\tlabel={t(\"profiles.entitySet\")}\n\t\t\t\t\t\t\t\t\t\t\t\thelperText={t(\"profiles.entitySetHelp\")}\n\t\t\t\t\t\t\t\t\t\t\t\tplaceholder={t(\"profiles.noEntitySet\")}\n\t\t\t\t\t\t\t\t\t\t\t\toptions={(entitySets.data ?? []).map((e) => ({\n\t\t\t\t\t\t\t\t\t\t\t\t\tid: e.id,\n\t\t\t\t\t\t\t\t\t\t\t\t\tlabel: e.content.name,\n\t\t\t\t\t\t\t\t\t\t\t\t}))}\n\t\t\t\t\t\t\t\t\t\t\t\tdisabled={!canConfigure}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t<SwitchField<ProfileValues>\n\t\t\t\t\t\t\t\t\t\t\t\tname=\"autoPublish\"\n\t\t\t\t\t\t\t\t\t\t\t\tlabel={t(\"profiles.autoPublish\")}\n\t\t\t\t\t\t\t\t\t\t\t\thelperText={t(\"profiles.autoPublishHelp\")}\n\t\t\t\t\t\t\t\t\t\t\t\tdisabled={!canConfigure}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t<SwitchField<ProfileValues>\n\t\t\t\t\t\t\t\t\t\t\t\tname=\"deleteSourceFileOnSuccess\"\n\t\t\t\t\t\t\t\t\t\t\t\tlabel={t(\"profiles.deleteOnSuccess\")}\n\t\t\t\t\t\t\t\t\t\t\t\thelperText={t(\"profiles.deleteOnSuccessHelp\")}\n\t\t\t\t\t\t\t\t\t\t\t\tdisabled={!canConfigure}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t\t\t</Card>\n\t\t\t\t\t\t\t\t\t<Card title={t(\"profiles.preprocessors\")}>\n\t\t\t\t\t\t\t\t\t\t<StepsField\n\t\t\t\t\t\t\t\t\t\t\tname=\"preprocessors\"\n\t\t\t\t\t\t\t\t\t\t\tkind=\"preprocessor\"\n\t\t\t\t\t\t\t\t\t\t\tcatalogue={processors.data ?? []}\n\t\t\t\t\t\t\t\t\t\t\teditable={canConfigure}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</Card>\n\t\t\t\t\t\t\t\t\t<Card title={t(\"profiles.mappings\")}>\n\t\t\t\t\t\t\t\t\t\t<MappingsField\n\t\t\t\t\t\t\t\t\t\t\tmappings={(mappings.data ?? []).map((m) => ({\n\t\t\t\t\t\t\t\t\t\t\t\tid: m.id,\n\t\t\t\t\t\t\t\t\t\t\t\tname: m.content.name,\n\t\t\t\t\t\t\t\t\t\t\t\tvalid: m.validity.valid,\n\t\t\t\t\t\t\t\t\t\t\t}))}\n\t\t\t\t\t\t\t\t\t\t\teditable={canConfigure}\n\t\t\t\t\t\t\t\t\t\t\threfOf={(mappingId) => itemPath(paths, \"mappings\", mappingId)}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</Card>\n\t\t\t\t\t\t\t\t\t<Card title={t(\"profiles.postProcessors\")}>\n\t\t\t\t\t\t\t\t\t\t<StepsField\n\t\t\t\t\t\t\t\t\t\t\tname=\"postProcessors\"\n\t\t\t\t\t\t\t\t\t\t\tkind=\"post_processor\"\n\t\t\t\t\t\t\t\t\t\t\tcatalogue={processors.data ?? []}\n\t\t\t\t\t\t\t\t\t\t\teditable={canConfigure}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</Card>\n\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t</FormProvider>\n\t\t\t\t\t)}\n\t\t\t\t</Box>\n\t\t\t)}\n\t\t\t{releasing.dialog}\n\t\t\t<DeleteDialog\n\t\t\t\topen={deleting}\n\t\t\t\tonClose={() => setDeleting(false)}\n\t\t\t\ttitle={t(\"profiles.deleteTitle\", { name: name || profile.content.name })}\n\t\t\t\tmessage={t(\"profiles.deleteMessage\")}\n\t\t\t\tonDelete={() => client.deleteImportProfile(profile.id)}\n\t\t\t\tonDeleted={() => {\n\t\t\t\t\tsetDeleting(false);\n\t\t\t\t\tqueryClient.removeQueries({\n\t\t\t\t\t\tqueryKey: importhubKeys.importProfile(workspaceId, profile.id),\n\t\t\t\t\t});\n\t\t\t\t\tvoid queryClient.invalidateQueries({\n\t\t\t\t\t\tqueryKey: importhubKeys.importProfiles(workspaceId),\n\t\t\t\t\t});\n\t\t\t\t\tonDeleted();\n\t\t\t\t}}\n\t\t\t/>\n\t\t</DetailPageTemplate>\n\t);\n}\n\n/**\n * A Profile's Preprocessors or Post-processors: the Processors of that kind\n * that work on the whole Source File are offered (a rich-text field's are a\n * Mapping's, ADR 0007), and each step's settings open in a dialog.\n */\nfunction StepsField({\n\tname,\n\tkind,\n\tcatalogue,\n\teditable,\n}: {\n\tname: \"preprocessors\" | \"postProcessors\";\n\tkind: ProcessorKind;\n\tcatalogue: Processor[];\n\teditable: boolean;\n}) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { control, setValue } = useFormContextTyped();\n\tconst steps = useWatch({ control, name }) ?? [];\n\tconst [open, setOpen] = useState<number | null>(null);\n\tconst set = (next: ProcessorStep[]) => setValue(name, next, { shouldDirty: true });\n\tconst processorOf = (step: ProcessorStep) => catalogue.find((p) => p.name === step.processor);\n\tconst openStep = open === null ? undefined : steps[open];\n\tconst offered = catalogue.filter((p) => p.kind === kind && p.target === \"source_file\");\n\treturn (\n\t\t<>\n\t\t\t<OrderedList<ProcessorStep>\n\t\t\t\titems={steps}\n\t\t\t\tnameOf={(s) => s.processor}\n\t\t\t\teditable={editable}\n\t\t\t\tonChange={set}\n\t\t\t\temptyLabel={t(\n\t\t\t\t\tkind === \"preprocessor\" ? \"profiles.noPreprocessors\" : \"profiles.noPostProcessors\",\n\t\t\t\t)}\n\t\t\t\taddLabel={t(\n\t\t\t\t\tkind === \"preprocessor\" ? \"profiles.addPreprocessor\" : \"profiles.addPostProcessor\",\n\t\t\t\t)}\n\t\t\t\taddOptions={offered.map((p) => ({ value: p.name, label: p.name }))}\n\t\t\t\tonAdd={(processor) => {\n\t\t\t\t\tset([...steps, { processor, settings: {} }]);\n\t\t\t\t\t// A Processor with settings opens them at once: most need some.\n\t\t\t\t\tif ((offered.find((p) => p.name === processor)?.settingsSpec.length ?? 0) > 0) {\n\t\t\t\t\t\tsetOpen(steps.length);\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\t\trenderItem={(step, index) => {\n\t\t\t\t\tconst p = processorOf(step);\n\t\t\t\t\tconst count = Object.keys(step.settings).length;\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<HStack justify=\"space-between\" gap=\"3\">\n\t\t\t\t\t\t\t<Stack gap=\"0\" minW=\"0\">\n\t\t\t\t\t\t\t\t<Text fontFamily=\"mono\" fontSize=\"sm\">\n\t\t\t\t\t\t\t\t\t{step.processor}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t<Text color=\"fg.muted\" fontSize=\"sm\">\n\t\t\t\t\t\t\t\t\t{p ? p.description : t(\"processors.unknown\")}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t{p && p.settingsSpec.length > 0 ? (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tsize=\"xs\"\n\t\t\t\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\t\t\t\tonClick={() => setOpen(index)}\n\t\t\t\t\t\t\t\t\taria-label={t(editable ? \"processors.configure\" : \"processors.viewSettings\", {\n\t\t\t\t\t\t\t\t\t\tname: step.processor,\n\t\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Settings2 size={14} aria-hidden />\n\t\t\t\t\t\t\t\t\t{t(\"processors.settingsCount\", { count })}\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t);\n\t\t\t\t}}\n\t\t\t/>\n\t\t\t<ProcessorSettingsDialog\n\t\t\t\topen={openStep !== undefined}\n\t\t\t\tonClose={() => setOpen(null)}\n\t\t\t\tprocessor={openStep ? (processorOf(openStep) ?? null) : null}\n\t\t\t\tsettings={openStep?.settings ?? EMPTY}\n\t\t\t\treadOnly={!editable}\n\t\t\t\tonApply={(settings) => {\n\t\t\t\t\tif (open === null) return;\n\t\t\t\t\tset(steps.map((s, i) => (i === open ? { ...s, settings } : s)));\n\t\t\t\t\tsetOpen(null);\n\t\t\t\t}}\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nconst EMPTY: Record<string, unknown> = {};\n\n/** The Mappings a Profile includes, in the order they run, each a link to its page. */\nfunction MappingsField({\n\tmappings,\n\teditable,\n\threfOf,\n}: {\n\tmappings: { id: string; name: string; valid: boolean }[];\n\teditable: boolean;\n\threfOf: (id: string) => string;\n}) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { control, setValue } = useFormContextTyped();\n\tconst ids = useWatch({ control, name: \"mappingIds\" }) ?? [];\n\tconst byId = useMemo(() => new Map(mappings.map((m) => [m.id, m])), [mappings]);\n\tconst set = (next: string[]) => setValue(\"mappingIds\", next, { shouldDirty: true });\n\tconst nameOf = (id: string) => byId.get(id)?.name ?? t(\"profiles.missingMapping\");\n\treturn (\n\t\t<OrderedList<string>\n\t\t\titems={ids}\n\t\t\tnameOf={nameOf}\n\t\t\teditable={editable}\n\t\t\tonChange={set}\n\t\t\temptyLabel={t(\"profiles.noMappings\")}\n\t\t\taddLabel={t(\"profiles.addMapping\")}\n\t\t\taddOptions={mappings\n\t\t\t\t.filter((m) => !ids.includes(m.id))\n\t\t\t\t.map((m) => ({ value: m.id, label: m.name }))}\n\t\t\tonAdd={(mappingId) => set([...ids, mappingId])}\n\t\t\trenderItem={(mappingId) => {\n\t\t\t\tconst m = byId.get(mappingId);\n\t\t\t\tif (!m) return <Text color=\"fg.muted\">{t(\"profiles.missingMapping\")}</Text>;\n\t\t\t\treturn (\n\t\t\t\t\t<HStack gap=\"2\">\n\t\t\t\t\t\t<Link asChild>\n\t\t\t\t\t\t\t<RouterLink to={hrefOf(m.id)}>{m.name}</RouterLink>\n\t\t\t\t\t\t</Link>\n\t\t\t\t\t\t{m.valid ? null : <StatusBadge tone=\"danger\" label={t(\"validity.invalid\")} />}\n\t\t\t\t\t</HStack>\n\t\t\t\t);\n\t\t\t}}\n\t\t/>\n\t);\n}\n\nconst useFormContextTyped = () => useFormContext<ProfileValues>();\n","import { Button } from \"@knkcs/anker/atoms\";\nimport { DataTable, LinkCell, TruncatedTextCell } from \"@knkcs/anker/components\";\nimport { useHostIdentity } from \"@knkcs/anker/host\";\nimport { IndexPageTemplate } from \"@knkcs/anker/templates\";\nimport { useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport type { ColumnDef } from \"@tanstack/react-table\";\nimport { Plus } from \"lucide-react\";\nimport { useMemo, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport type { ImporthubClient, ImportProfile } from \"../../client/importhub-client\";\nimport { CreateDialog } from \"../../common/create-dialog\";\nimport { itemPath, useImporthubHost } from \"../../common/host\";\nimport { importhubKeys } from \"../../common/query-keys\";\nimport { LoadFailed } from \"../../common/query-state\";\nimport { useCanConfigure } from \"../../common/use-can-configure\";\nimport { releaseLabel, ValidityCell } from \"../../common/validity\";\nimport { IMPORTHUB_UI_NS } from \"../../i18n/resources\";\n\nexport interface ImportProfilesIndexProps {\n\tclient: ImporthubClient;\n\t/** Opens an Import Profile's page: the host navigates, after a create too. */\n\tonOpen: (id: string) => void;\n}\n\n// DataTable takes rows that are records.\ntype Row = ImportProfile & Record<string, unknown>;\n\n/**\n * Every Import Profile of the workspace, with its validity and its latest\n * Release (manage-import-profiles:AC1, AC6); an admin creates one from the\n * header (AC2).\n */\nexport function ImportProfilesIndex({ client, onOpen }: ImportProfilesIndexProps) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { workspaceId } = useHostIdentity();\n\tconst { paths } = useImporthubHost();\n\tconst canConfigure = useCanConfigure();\n\tconst queryClient = useQueryClient();\n\tconst [creating, setCreating] = useState(false);\n\tconst query = useQuery({\n\t\tqueryKey: importhubKeys.importProfiles(workspaceId),\n\t\tqueryFn: () => client.listImportProfiles(),\n\t});\n\tconst columns = useMemo<ColumnDef<Row, unknown>[]>(\n\t\t() => [\n\t\t\t{\n\t\t\t\tid: \"name\",\n\t\t\t\theader: t(\"fields.name\"),\n\t\t\t\tcell: (c) => (\n\t\t\t\t\t<LinkCell\n\t\t\t\t\t\tto={itemPath(paths, \"profiles\", c.row.original.id)}\n\t\t\t\t\t\tlabel={c.row.original.content.name}\n\t\t\t\t\t/>\n\t\t\t\t),\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"validity\",\n\t\t\t\theader: t(\"validity.column\"),\n\t\t\t\tcell: (c) => <ValidityCell validity={c.row.original.validity} />,\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"release\",\n\t\t\t\theader: t(\"release.column\"),\n\t\t\t\tsize: 140,\n\t\t\t\tcell: (c) => <TruncatedTextCell value={releaseLabel(c.row.original.state, t)} />,\n\t\t\t},\n\t\t],\n\t\t[t, paths],\n\t);\n\treturn (\n\t\t<IndexPageTemplate\n\t\t\ttitle={t(\"section.profiles.title\")}\n\t\t\tactions={\n\t\t\t\tcanConfigure ? (\n\t\t\t\t\t<Button variant=\"solid\" onClick={() => setCreating(true)}>\n\t\t\t\t\t\t<Plus size={16} aria-hidden />\n\t\t\t\t\t\t{t(\"profiles.new\")}\n\t\t\t\t\t</Button>\n\t\t\t\t) : undefined\n\t\t\t}\n\t\t>\n\t\t\t{query.isError ? (\n\t\t\t\t<LoadFailed />\n\t\t\t) : (\n\t\t\t\t<DataTable\n\t\t\t\t\tcolumns={columns}\n\t\t\t\t\tdata={(query.data ?? []) as Row[]}\n\t\t\t\t\tloading={query.isPending}\n\t\t\t\t\tgetRowId={(p) => p.id}\n\t\t\t\t\temptyState={t(\"profiles.empty\")}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t<CreateDialog\n\t\t\t\topen={creating}\n\t\t\t\tonClose={() => setCreating(false)}\n\t\t\t\ttitle={t(\"profiles.new\")}\n\t\t\t\tonCreate={async ({ name, description }) => {\n\t\t\t\t\tconst p = await client.createImportProfile({\n\t\t\t\t\t\tname,\n\t\t\t\t\t\tdescription,\n\t\t\t\t\t\tentitySetId: \"\",\n\t\t\t\t\t\tpreprocessors: [],\n\t\t\t\t\t\tmappingIds: [],\n\t\t\t\t\t\tpostProcessors: [],\n\t\t\t\t\t\tautoPublish: false,\n\t\t\t\t\t\tdeleteSourceFileOnSuccess: false,\n\t\t\t\t\t});\n\t\t\t\t\tawait queryClient.invalidateQueries({\n\t\t\t\t\t\tqueryKey: importhubKeys.importProfiles(workspaceId),\n\t\t\t\t\t});\n\t\t\t\t\treturn p.id;\n\t\t\t\t}}\n\t\t\t\tonCreated={(id) => {\n\t\t\t\t\tsetCreating(false);\n\t\t\t\t\tonOpen(id);\n\t\t\t\t}}\n\t\t\t/>\n\t\t</IndexPageTemplate>\n\t);\n}\n","import { Button, EmptyState } from \"@knkcs/anker/atoms\";\nimport { Card, UploadDropZone } from \"@knkcs/anker/components\";\nimport { BaseSelectField, DatePickerField, InputField } from \"@knkcs/anker/forms\";\nimport { useHostIdentity } from \"@knkcs/anker/host\";\nimport { Alert, Box, Grid, Progress, Stack, Text } from \"@knkcs/anker/primitives\";\nimport { DetailPageTemplate } from \"@knkcs/anker/templates\";\nimport { useMutation, useQuery, useQueryClient } from \"@tanstack/react-query\";\nimport { Lock, Play } from \"lucide-react\";\nimport { useState } from \"react\";\nimport { FormProvider, useForm, useWatch } from \"react-hook-form\";\nimport { useTranslation } from \"react-i18next\";\nimport type { ImporthubClient, SourceFile } from \"../../client/importhub-client\";\nimport { useImporthubHost } from \"../../common/host\";\nimport { importhubKeys } from \"../../common/query-keys\";\nimport { LoadFailed, Loading } from \"../../common/query-state\";\nimport { useCanImport } from \"../../common/use-can-import\";\nimport { IMPORTHUB_UI_NS } from \"../../i18n/resources\";\n\nexport interface StartImportProps {\n\tclient: ImporthubClient;\n\t/** The Import is queued: the host opens its page. */\n\tonStarted: (importId: string) => void;\n}\n\ntype StartValues = {\n\timportProfileId: string;\n\teffectiveDate: string;\n\tsourceDate: string;\n\tsourceReference: string;\n};\n\nconst EMPTY: StartValues = {\n\timportProfileId: \"\",\n\teffectiveDate: \"\",\n\tsourceDate: \"\",\n\tsourceReference: \"\",\n};\n\n/** Where the one file stands: being sent, sent, or refused on the way. */\ntype Upload =\n\t| { state: \"uploading\"; name: string; fraction: number }\n\t| { state: \"uploaded\"; name: string; sourceFile: SourceFile }\n\t| { state: \"failed\"; name: string; message: string };\n\nconst isXml = (f: File) =>\n\t/\\.xml$/i.test(f.name) || f.type === \"text/xml\" || f.type === \"application/xml\";\n\n/**\n * The start flow (start-an-import:AC1–AC4): an importer picks one of the\n * workspace's Import Profiles that has a Release, since an Import never runs\n * a draft; uploads one XML file straight into importhub's storage, with its\n * progress; gives, if the file carries none, an effective date and a Source\n * (its date and reference, both or neither); reads what delegated access\n * Start grants; and starts with the header's one action. A Start importhub\n * refuses (a missing contenthub right, a configuration without a Release or\n * invalid now) is shown with importhub's reason. A viewer gets no Start.\n */\nexport function StartImport({ client, onStarted }: StartImportProps) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tconst { workspaceId } = useHostIdentity();\n\tconst { paths } = useImporthubHost();\n\tconst canImport = useCanImport();\n\tconst queryClient = useQueryClient();\n\tconst profiles = useQuery({\n\t\tqueryKey: importhubKeys.importProfiles(workspaceId),\n\t\tqueryFn: () => client.listImportProfiles(),\n\t\tenabled: canImport,\n\t});\n\tconst form = useForm<StartValues>({ defaultValues: EMPTY });\n\tconst importProfileId = useWatch({ control: form.control, name: \"importProfileId\" });\n\tconst [upload, setUpload] = useState<Upload | null>(null);\n\n\tconst send = (files: File[]) => {\n\t\tconst [file] = files;\n\t\tif (!file) return;\n\t\tif (!isXml(file)) {\n\t\t\tsetUpload({\n\t\t\t\tstate: \"failed\",\n\t\t\t\tname: file.name,\n\t\t\t\tmessage: t(\"startImport.notXml\", { name: file.name }),\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tsetUpload({ state: \"uploading\", name: file.name, fraction: 0 });\n\t\tclient\n\t\t\t.uploadSourceFile(file, (fraction) =>\n\t\t\t\tsetUpload((u) =>\n\t\t\t\t\tu?.state === \"uploading\" && u.name === file.name ? { ...u, fraction } : u,\n\t\t\t\t),\n\t\t\t)\n\t\t\t.then(\n\t\t\t\t(sourceFile) => setUpload({ state: \"uploaded\", name: file.name, sourceFile }),\n\t\t\t\t(err: unknown) =>\n\t\t\t\t\tsetUpload({\n\t\t\t\t\t\tstate: \"failed\",\n\t\t\t\t\t\tname: file.name,\n\t\t\t\t\t\tmessage: t(\"startImport.uploadFailed\", {\n\t\t\t\t\t\t\tname: file.name,\n\t\t\t\t\t\t\tmessage: err instanceof Error ? err.message : String(err),\n\t\t\t\t\t\t}),\n\t\t\t\t\t}),\n\t\t\t);\n\t};\n\n\tconst start = useMutation({\n\t\tmutationFn: (v: StartValues & { sourceFileId: string }) =>\n\t\t\tclient.startImport({\n\t\t\t\timportProfileId: v.importProfileId,\n\t\t\t\tsourceFileId: v.sourceFileId,\n\t\t\t\teffectiveDate: v.effectiveDate,\n\t\t\t\t...(v.sourceDate\n\t\t\t\t\t? { source: { date: v.sourceDate, reference: v.sourceReference.trim() } }\n\t\t\t\t\t: {}),\n\t\t\t}),\n\t\tonSuccess: (im) => {\n\t\t\tvoid queryClient.invalidateQueries({ queryKey: importhubKeys.imports(workspaceId) });\n\t\t\tonStarted(im.id);\n\t\t},\n\t});\n\n\tconst onStart = form.handleSubmit((v) => {\n\t\tif (upload?.state !== \"uploaded\") return;\n\t\tif (!v.importProfileId) {\n\t\t\tform.setError(\"importProfileId\", { message: t(\"startImport.profileRequired\") });\n\t\t\treturn;\n\t\t}\n\t\t// A Source is its date and its reference, both or neither\n\t\t// (StartImportRequest.source).\n\t\tif (Boolean(v.sourceDate) !== Boolean(v.sourceReference.trim())) {\n\t\t\tform.setError(v.sourceDate ? \"sourceReference\" : \"sourceDate\", {\n\t\t\t\tmessage: t(\"startImport.sourceIncomplete\"),\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tstart.mutate({ ...v, sourceFileId: upload.sourceFile.id });\n\t});\n\n\tconst ready = importProfileId !== \"\" && upload?.state === \"uploaded\";\n\tconst frame = {\n\t\ttitle: t(\"startImport.title\"),\n\t\tbreadcrumbs: [{ label: t(\"section.imports.title\"), to: paths.imports }],\n\t};\n\n\tif (!canImport) {\n\t\treturn (\n\t\t\t<DetailPageTemplate {...frame}>\n\t\t\t\t<Box px=\"8\" py=\"6\">\n\t\t\t\t\t<EmptyState icon={<Lock size={32} aria-hidden />} header={t(\"startImport.notAllowed\")} />\n\t\t\t\t</Box>\n\t\t\t</DetailPageTemplate>\n\t\t);\n\t}\n\tif (profiles.isError || !profiles.data) {\n\t\treturn (\n\t\t\t<DetailPageTemplate {...frame}>\n\t\t\t\t{profiles.isError ? <LoadFailed /> : <Loading />}\n\t\t\t</DetailPageTemplate>\n\t\t);\n\t}\n\t// An Import runs the latest Release, never a draft (ADR 0016): a Profile\n\t// without one cannot be started, so it is not offered.\n\tconst released = profiles.data.filter((p) => p.state.latestRelease);\n\n\treturn (\n\t\t<DetailPageTemplate\n\t\t\t{...frame}\n\t\t\tactions={\n\t\t\t\t<Button\n\t\t\t\t\tvariant=\"solid\"\n\t\t\t\t\tdisabled={!ready}\n\t\t\t\t\tloading={start.isPending}\n\t\t\t\t\tonClick={() => void onStart()}\n\t\t\t\t>\n\t\t\t\t\t<Play size={16} aria-hidden />\n\t\t\t\t\t{t(\"imports.start\")}\n\t\t\t\t</Button>\n\t\t\t}\n\t\t>\n\t\t\t<Box px=\"8\" py=\"6\">\n\t\t\t\t<FormProvider {...form}>\n\t\t\t\t\t<Stack gap=\"6\">\n\t\t\t\t\t\t{start.isError ? (\n\t\t\t\t\t\t\t<Alert status=\"error\" colorPalette=\"danger\" title={t(\"startImport.refused\")}>\n\t\t\t\t\t\t\t\t{start.error.message}\n\t\t\t\t\t\t\t</Alert>\n\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t<Card title={t(\"startImport.fileCard\")}>\n\t\t\t\t\t\t\t<Stack gap=\"4\">\n\t\t\t\t\t\t\t\t{released.length === 0 ? (\n\t\t\t\t\t\t\t\t\t<Alert status=\"info\" colorPalette=\"info\" title={t(\"startImport.noProfiles\")} />\n\t\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t\t<BaseSelectField<StartValues>\n\t\t\t\t\t\t\t\t\tname=\"importProfileId\"\n\t\t\t\t\t\t\t\t\tlabel={t(\"startImport.profile\")}\n\t\t\t\t\t\t\t\t\thelperText={t(\"startImport.profileHelp\")}\n\t\t\t\t\t\t\t\t\trequired\n\t\t\t\t\t\t\t\t\toptions={released.map((p) => ({\n\t\t\t\t\t\t\t\t\t\tid: p.id,\n\t\t\t\t\t\t\t\t\t\tlabel: t(\"startImport.profileOption\", {\n\t\t\t\t\t\t\t\t\t\t\tname: p.content.name,\n\t\t\t\t\t\t\t\t\t\t\tnumber: p.state.latestRelease?.number,\n\t\t\t\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\t\t\t}))}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<Stack gap=\"2\">\n\t\t\t\t\t\t\t\t\t<Text fontWeight=\"medium\">{t(\"startImport.file\")}</Text>\n\t\t\t\t\t\t\t\t\t<Text color=\"muted\" fontSize=\"sm\">\n\t\t\t\t\t\t\t\t\t\t{t(\"startImport.fileHelp\")}\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t<UploadDropZone\n\t\t\t\t\t\t\t\t\t\tonFiles={send}\n\t\t\t\t\t\t\t\t\t\taccept=\".xml,text/xml,application/xml\"\n\t\t\t\t\t\t\t\t\t\tdisabled={upload?.state === \"uploading\" || start.isPending}\n\t\t\t\t\t\t\t\t\t\tdropHintText={t(\"startImport.dropHint\")}\n\t\t\t\t\t\t\t\t\t\tdragActiveText={t(\"startImport.dragActive\")}\n\t\t\t\t\t\t\t\t\t\tbuttonLabel={t(\"startImport.chooseFile\")}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<UploadState upload={upload} />\n\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t</Card>\n\t\t\t\t\t\t<Card title={t(\"startImport.datesCard\")}>\n\t\t\t\t\t\t\t<Stack gap=\"4\">\n\t\t\t\t\t\t\t\t<Text color=\"muted\" fontSize=\"sm\">\n\t\t\t\t\t\t\t\t\t{t(\"startImport.datesHelp\")}\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t<DatePickerField<StartValues>\n\t\t\t\t\t\t\t\t\tname=\"effectiveDate\"\n\t\t\t\t\t\t\t\t\tlabel={t(\"startImport.effectiveDate\")}\n\t\t\t\t\t\t\t\t\thelperText={t(\"startImport.effectiveDateHelp\")}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<Grid templateColumns={{ base: \"1fr\", md: \"1fr 2fr\" }} gap=\"4\">\n\t\t\t\t\t\t\t\t\t<DatePickerField<StartValues>\n\t\t\t\t\t\t\t\t\t\tname=\"sourceDate\"\n\t\t\t\t\t\t\t\t\t\tlabel={t(\"startImport.sourceDate\")}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t<InputField<StartValues>\n\t\t\t\t\t\t\t\t\t\tname=\"sourceReference\"\n\t\t\t\t\t\t\t\t\t\tlabel={t(\"startImport.sourceReference\")}\n\t\t\t\t\t\t\t\t\t\thelperText={t(\"startImport.sourceReferenceHelp\")}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</Grid>\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t</Card>\n\t\t\t\t\t\t<Alert status=\"info\" colorPalette=\"info\" title={t(\"startImport.consentTitle\")}>\n\t\t\t\t\t\t\t{t(\"startImport.consent\")}\n\t\t\t\t\t\t</Alert>\n\t\t\t\t\t</Stack>\n\t\t\t\t</FormProvider>\n\t\t\t</Box>\n\t\t</DetailPageTemplate>\n\t);\n}\n\n/** The file's upload: its progress while it goes, then that it arrived or why not. */\nfunction UploadState({ upload }: { upload: Upload | null }) {\n\tconst { t } = useTranslation(IMPORTHUB_UI_NS);\n\tif (!upload) return null;\n\tswitch (upload.state) {\n\t\tcase \"uploading\":\n\t\t\treturn (\n\t\t\t\t<Progress\n\t\t\t\t\tlabel={t(\"startImport.uploading\", { name: upload.name })}\n\t\t\t\t\tvalue={Math.round(upload.fraction * 100)}\n\t\t\t\t\tshowValue\n\t\t\t\t/>\n\t\t\t);\n\t\tcase \"uploaded\":\n\t\t\treturn (\n\t\t\t\t<Alert\n\t\t\t\t\tstatus=\"success\"\n\t\t\t\t\tcolorPalette=\"success\"\n\t\t\t\t\ttitle={t(\"startImport.uploaded\", { name: upload.name })}\n\t\t\t\t/>\n\t\t\t);\n\t\tcase \"failed\":\n\t\t\treturn <Alert status=\"error\" colorPalette=\"danger\" title={upload.message} />;\n\t}\n}\n"],"names":["file_importhub_v1_api_key","fileDesc","file_google_protobuf_timestamp","APIKeyService","serviceDesc","file_importhub_v1_configuration","ValiditySchema","messageDesc","ConfigurationInUseSchema","FieldComparisonStatus","file_importhub_v1_entity_set","EntitySetContentSchema","EntitySetService","file_importhub_v1_import","ImportPhase","ImportOutcome","ImportService","file_importhub_v1_import_profile","file_google_protobuf_struct","ImportProfileContentSchema","ProcessorStepSchema","ImportProfileService","file_importhub_v1_mapping","MappingContentSchema","MappingService","file_importhub_v1_processor","ProcessorKind","ProcessorTarget","ProcessorService","putToBlobStore","url","file","onProgress","resolve","reject","xhr","e","validityOf","v","r","stateOf","s","stepOf","stepPb","profileOf","p","c","profileContentPb","create","mappingOf","m","content","toJson","mappingContentPb","fromJson","entitySetOf","isoOf","t","timestampDate","releaseOf","revisionOf","historyOf","res","STATUS","FieldComparisonStatusPb","versionOf","asJson","JSON_OPTS","comparisonOf","f","PHASES","ImportPhasePb","OUTCOMES","ImportOutcomePb","releaseRefOf","importOf","i","outcome","apiKeyOf","k","startCall","run","err","ConnectError","Code","StartRefusedError","translate","inUse","ConfigurationInUseError","NameTakenError","cutCall","validity","ReleaseRefusedError","call","createConnectImporthubClient","options","transport","createConnectTransport","profiles","createClient","processors","mappings","entitySets","imports","apiKeys","putFile","id","requireMessage","draftRevisionId","blueprintReleaseId","kind","req","pageToken","fromRevisionId","toRevisionId","revisionId","sf","input","importId","filter","timestampFromDate","ChangeSetLink","changeSetId","useTranslation","IMPORTHUB_UI_NS","href","useImporthubHost","Link","jsx","ExternalLink","IMPORTHUB_SECTION_ICONS","FileUp","FileCog","Waypoints","Ampersand","Blocks","ImporthubStartPage","client","section","Icon","IndexPageTemplate","Box","EmptyState","SectionSummary","CountSummary","importhubKeys","NothingYet","Fragment","queryKey","read","workspaceId","useHostIdentity","query","useQuery","Spinner","statusOf","im","TONES","labelOf","status","DEFAULT_POLL_INTERVAL_MS","isRunning","ImportStatusBadge","StatusBadge","ImportStatusCell","StatusBadgeCell","usePersonName","members","useCallback","userId","useCanImport","EMPTY","today","d","pad","n","expiryOf","expiresOn","CreateApiKeyDialog","open","onClose","queryClient","useQueryClient","form","useForm","useMutation","values","reset","resetCreate","useEffect","close","submit","name","API_KEY_NAME_MAX","secret","Modal","Button","jsxs","HStack","Stack","Alert","ClipboardInput","FormProvider","InputField","DatePickerField","RevokeApiKeyDialog","apiKey","revoke","Text","ApiKeysIndex","canImport","personName","creating","setCreating","useState","revoking","setRevoking","revokeOpen","setRevokeOpen","columns","useMemo","TruncatedTextCell","CodeCell","IdentityCell","DateCell","ActionCell","Trash2","Plus","LoadFailed","DataTable","KeyRound","valuesOf","a","b","text","contentOf","EntitySetDetail","onDeleted","DetailPageTemplate","Loading","EntitySetPage","entitySet","paths","canConfigure","useCanConfigure","deleting","setDeleting","formState","control","rows","useFieldArray","save","saved","onSave","tab","tabs","useConfigurationTab","releasing","useConfigurationRelease","usePageRail","ContextRail","ReleaseStateBadge","ConfigurationHistory","fresh","ValidityAlert","Card","TextareaField","row","index","Grid","IconButton","DeleteDialog","CreateDialog","title","children","defaultValues","onCreate","onCreated","EntitySetsIndex","onOpen","LinkCell","itemPath","CountCell","ValidityCell","releaseLabel","description","ItemProblemsTable","mappingId","setMappingId","sourceKeyQuery","setSourceKeyQuery","useInfiniteQuery","pageParam","last","previous","problems","seen","useRef","refetch","first","SlugCell","total","Toolbar","SearchInput","NativeSelect","Center","ImportDetail","pollIntervalMs","q","ImportPage","i18n","lng","cancelling","setCancelling","cancellable","CircleStop","cancel","now","formatTime","OutcomeAlert","ProgressCard","DescriptionList","ReleasesCard","iso","done","known","Progress","importProfile","ReleaseLink","List","release","RouterLink","ImportsIndex","onStart","NumberCell","Play","MappingDetail","MappingScreen","BlueprintFields","blueprints","BlueprintSelects","setValue","useFormContext","blueprintId","useWatch","list","releases","BaseSelectField","CREATE_DEFAULTS","MappingsIndex","names","useBlueprintNames","ProcessorCatalogue","moved","from","to","next","item","OrderedList","items","renderItem","nameOf","editable","onChange","emptyLabel","addLabel","addOptions","onAdd","ArrowUp","ArrowDown","_","MenuRoot","MenuTrigger","MenuContent","o","MenuItem","NO_SETTINGS","ProcessorSettingsDialog","processor","settings","readOnly","onApply","spec","resolver","zodResolver","specToZodSchema","builtInFieldTypes","apply","FieldKitProvider","SpecForm","ImportProfileDetail","ProfilePage","profile","SwitchField","StepsField","MappingsField","catalogue","useFormContextTyped","steps","setOpen","set","processorOf","step","openStep","offered","count","Settings2","hrefOf","ids","byId","ImportProfilesIndex","isXml","StartImport","onStarted","importProfileId","upload","setUpload","send","files","fraction","u","sourceFile","start","ready","frame","Lock","released","UploadDropZone","UploadState"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAaO,MAAMA,KACX,gBAAAC,EAAS,ooCAAooC,CAACC,EAA8B,CAAC,GA8LlqCC,KAsCX,gBAAAC,GAAYJ,IAA2B,CAAC,GCrO7BK,KACX,gBAAAJ,EAAS,+jDAA+jD,CAACC,EAA8B,CAAC,GA+B7lDI,KACX,gBAAAC,GAAYF,IAAiC,CAAC,GAwQnCG,KACX,gBAAAD,GAAYF,IAAiC,CAAC;AAQzC,IAAKI,uBAAAA,OAIVA,EAAAA,EAAA,cAAc,CAAA,IAAd,eAOAA,EAAAA,EAAA,YAAY,CAAA,IAAZ,aAOAA,EAAAA,EAAA,QAAQ,CAAA,IAAR,SAOAA,EAAAA,EAAA,UAAU,CAAA,IAAV,WAOAA,EAAAA,EAAA,UAAU,CAAA,IAAV,WAhCUA,IAAAA,MAAA,CAAA,CAAA;AChTL,MAAMC,KACX,gBAAAT,EAAS,o4HAAo4H,CAACC,IAAgCG,EAA+B,CAAC,GA6Fn8HM,KACX,gBAAAJ,GAAYG,IAA8B,CAAC,GAubhCE,KAkHX,gBAAAR,GAAYM,IAA8B,CAAC,GC1oBhCG,KACX,gBAAAZ,EAAS,goKAAgoK,CAACC,EAA8B,CAAC;AAq3BpqK,IAAKY,uBAAAA,OAIVA,EAAAA,EAAA,cAAc,CAAA,IAAd,eAOAA,EAAAA,EAAA,SAAS,CAAA,IAAT,UAOAA,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