export declare enum ConnectionType {
    /** Unknown connection type. */
    UNKNOWN_CONNECTION_TYPE = "UNKNOWN_CONNECTION_TYPE",
    /** External database connection based on the legacy [external database collection service plugin](https://dev.wix.com/docs/velo/api-reference/wix-data-v2/service-plugins-spis/external-database-collection-legacy/introduction). */
    STANDALONE = "STANDALONE",
    /** External database connection based on the [external database service plugin](https://dev.wix.com/docs/rest/business-solutions/cms/service-plugins/external-database-service-plugin/introduction). */
    WIX_SERVICE_PLUGIN = "WIX_SERVICE_PLUGIN"
}
export interface CreateExternalDatabaseConnectionRequest {
    /** External database connection details. */
    externalDatabaseConnection: ExternalDatabaseConnection;
    /** Connection type. The connection type specifies the type of adaptor by which the external collection is integrated with the site. */
    connectionType: ConnectionType;
    /**
     * Whether the database is managed by Wix.
     * @internal
     */
    databaseManagedByWix?: boolean;
}
export interface CreateExternalDatabaseConnectionResponse {
    /** Details of the created external database connection. */
    externalDatabaseConnection?: ExternalDatabaseConnection;
}
export interface DeleteExternalDatabaseConnectionRequest {
    /**
     * Name of the external database connection to delete.
     * @maxLength 255
     */
    name: string;
}
export interface DeleteExternalDatabaseConnectionResponse {
}
/** An external database connection defines a connection between an external database and a Wix site. */
export interface ExternalDatabaseConnection {
    /**
     * Name of the external database connection.
     *
     * An external database connection can connect to one or more external data collections or tables. These appear as `connectionName/dataCollectionId`.
     * @immutable
     * @minLength 1
     * @maxLength 255
     */
    name?: string;
    /**
     * Base URL for accessing and managing data in the external database. For example: `https://example.com/my-external-database`.
     * Required for STANDALONE connection type.
     * @format WEB_URL
     */
    endpoint?: string | null;
    /**
     * Settings specified to the external database connection as part of each request.
     *
     * These settings can relate to authentication, tenancy, or provide any other information necessary for processing a request. Their content and structure depend on the specific requirements of the external database's API.
     */
    configuration?: Record<string, any> | null;
    /**
     * Status of the external database connection. Includes whether the connection was established successfully, and if not, the reason for the failure.
     * @readonly
     */
    connectionStatus?: ConnectionStatus;
    /**
     * Protocol version of the external database connection.
     * @internal
     * @readonly
     */
    protocolVersion?: ProtocolVersion;
    /**
     * Public key used to validate requests to the external database.
     * @readonly
     * @maxLength 128
     */
    publicKey?: string | null;
    /**
     * Capabilities of the external database.
     * @readonly
     */
    capabilities?: Capabilities;
    /**
     * ID of the app used to integrate this external database.
     * @internal
     * @readonly
     * @maxLength 128
     */
    applicationId?: string | null;
}
export interface Capabilities {
    /** Whether the external database supports creating new collections, updating the structure of existing collections, or deleting them. */
    collectionModificationsSupported?: boolean;
    /**
     * Field types the external database supports. Applies only when `collectionModificationsSupported` is set to `true`.
     * @maxSize 255
     */
    fieldTypes?: FieldType[];
}
export interface ConnectionStatus {
    /** Whether the connection was established successfully. */
    successful?: boolean;
    /** Whether and why the connection attempt failed. */
    causeOfFailure?: CauseOfFailure;
    /**
     * Whether the external database has collections.
     * @readonly
     */
    hasCollections?: CollectionsFound;
}
export declare enum CauseOfFailure {
    /** No connection failure. */
    NONE = "NONE",
    /** General communication failure. */
    COMMUNICATION_FAILURE = "COMMUNICATION_FAILURE",
    /** External database host is unreachable. */
    DESTINATION_HOST_UNREACHABLE = "DESTINATION_HOST_UNREACHABLE",
    /** Unauthorized to access the external database. */
    UNAUTHORIZED = "UNAUTHORIZED",
    /** `endpoint` is not set. */
    DESTINATION_ENDPOINT_NOT_DEFINED = "DESTINATION_ENDPOINT_NOT_DEFINED"
}
export declare enum CollectionsFound {
    /** Attempt to connect to the external database failed, so status is unknown. */
    UNKNOWN = "UNKNOWN",
    /** External database has collections. */
    YES = "YES",
    /** External database does not have any collections. */
    NO = "NO"
}
export declare enum ProtocolVersion {
    UNKNOWN_PROTOCOL_VERSION = "UNKNOWN_PROTOCOL_VERSION",
    V1 = "V1",
    V2 = "V2",
    V3 = "V3"
}
export interface GetExternalDatabaseConnectionRequest {
    /**
     * Name of the external database connection to retrieve.
     * @maxLength 255
     */
    name: string;
}
export interface GetExternalDatabaseConnectionResponse {
    /** Details of the retrieved external database connection. */
    externalDatabaseConnection?: ExternalDatabaseConnection;
}
export interface ListExternalDatabaseConnectionsRequest {
    /** Paging metadata. */
    paging?: Paging;
}
export interface ListExternalDatabaseConnectionsResponse {
    /** List of external database connections. */
    externalDatabaseConnections?: ExternalDatabaseConnection[];
    /** Paging metadata. */
    pagingMetadata?: PagingMetadata;
}
export interface UpdateExternalDatabaseConnectionRequest {
    /** Updated external database connection. The existing connection is replaced with this version. */
    externalDatabaseConnection: ExternalDatabaseConnection;
}
export interface UpdateExternalDatabaseConnectionResponse {
    /** Details of the updated external database connection. */
    externalDatabaseConnection?: ExternalDatabaseConnection;
}
export declare enum FieldType {
    UNKNOWN_FIELD_TYPE = "UNKNOWN_FIELD_TYPE",
    TEXT = "TEXT",
    NUMBER = "NUMBER",
    DATE = "DATE",
    DATETIME = "DATETIME",
    IMAGE = "IMAGE",
    BOOLEAN = "BOOLEAN",
    DOCUMENT = "DOCUMENT",
    URL = "URL",
    RICH_TEXT = "RICH_TEXT",
    VIDEO = "VIDEO",
    ANY = "ANY",
    ARRAY_STRING = "ARRAY_STRING",
    ARRAY_DOCUMENT = "ARRAY_DOCUMENT",
    AUDIO = "AUDIO",
    TIME = "TIME",
    LANGUAGE = "LANGUAGE",
    RICH_CONTENT = "RICH_CONTENT",
    MEDIA_GALLERY = "MEDIA_GALLERY",
    ADDRESS = "ADDRESS",
    PAGE_LINK = "PAGE_LINK",
    REFERENCE = "REFERENCE",
    MULTI_REFERENCE = "MULTI_REFERENCE",
    OBJECT = "OBJECT",
    ARRAY = "ARRAY",
    /** Deprecated - can’t be added to collections. Can only appear in older collections. */
    LEGACY_TIME = "LEGACY_TIME",
    /** Deprecated - can’t be added to collections. Can only appear in older collections. */
    LEGACY_BOOK = "LEGACY_BOOK",
    /** Deprecated - can’t be added to collections. Can only appear in older collections. */
    LEGACY_EXTERNAL_URL = "LEGACY_EXTERNAL_URL",
    /** Deprecated - can’t be added to collections. Can only appear in older collections. */
    LEGACY_BROKEN_REFERENCE = "LEGACY_BROKEN_REFERENCE",
    /** Deprecated - can’t be added to collections. Can only appear in older collections. */
    LEGACY_IMAGE = "LEGACY_IMAGE",
    /** Deprecated - can’t be added to collections. Can only appear in older collections. */
    LEGACY_COLOR = "LEGACY_COLOR",
    /** Deprecated - can’t be added to collections. Can only appear in older collections. */
    LEGACY_EXTERNAL_VIDEO = "LEGACY_EXTERNAL_VIDEO",
    SLUG = "SLUG",
    EMAIL = "EMAIL",
    SECURED_MEDIA = "SECURED_MEDIA",
    MEDIA_IMAGE = "MEDIA_IMAGE",
    MEDIA_VECTOR_ART = "MEDIA_VECTOR_ART"
}
export interface AccountInfo {
    /**
     * ID of the Wix account associated with the event.
     * @format GUID
     */
    accountId?: string | null;
    /**
     * ID of the parent Wix account. Only included when accountId belongs to a child account.
     * @format GUID
     */
    parentAccountId?: string | null;
    /**
     * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.
     * @format GUID
     */
    siteId?: string | null;
}
export interface IdentificationData extends IdentificationDataIdOneOf {
    /**
     * ID of a site visitor that has not logged in to the site.
     * @format GUID
     */
    anonymousVisitorId?: string;
    /**
     * ID of a site visitor that has logged in to the site.
     * @format GUID
     */
    memberId?: string;
    /**
     * ID of a Wix user (site owner, contributor, etc.).
     * @format GUID
     */
    wixUserId?: string;
    /**
     * ID of an app.
     * @format GUID
     */
    appId?: string;
    /** @readonly */
    identityType?: WebhookIdentityType;
}
/** @oneof */
export interface IdentificationDataIdOneOf {
    /**
     * ID of a site visitor that has not logged in to the site.
     * @format GUID
     */
    anonymousVisitorId?: string;
    /**
     * ID of a site visitor that has logged in to the site.
     * @format GUID
     */
    memberId?: string;
    /**
     * ID of a Wix user (site owner, contributor, etc.).
     * @format GUID
     */
    wixUserId?: string;
    /**
     * ID of an app.
     * @format GUID
     */
    appId?: string;
}
export declare enum WebhookIdentityType {
    UNKNOWN = "UNKNOWN",
    ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
    MEMBER = "MEMBER",
    WIX_USER = "WIX_USER",
    APP = "APP"
}
export interface MessageEnvelope {
    /**
     * App instance ID.
     * @format GUID
     */
    instanceId?: string | null;
    /**
     * Event type.
     * @maxLength 150
     */
    eventType?: string;
    /** The identification type and identity data. */
    identity?: IdentificationData;
    /** Stringify payload. */
    data?: string;
    /** Details related to the account */
    accountInfo?: AccountInfo;
}
export interface Paging {
    /** Number of items to load. */
    limit?: number | null;
    /** Number of items to skip in the current sort order. */
    offset?: number | null;
}
export interface PagingMetadata {
    /** Number of items returned in the response. */
    count?: number | null;
    /** Offset that was requested. */
    offset?: number | null;
    /** Total number of items that match the query. */
    total?: number | null;
    /** Flag that indicates the server failed to calculate the `total` field. */
    tooManyToCount?: boolean | null;
    /**
     * Indicates if there are more results after the current page.
     * If `true`, another page of results can be retrieved.
     * If `false`, this is the last page.
     * @internal
     */
    hasNext?: boolean | null;
}
export interface ActionEvent {
    bodyAsJson?: string;
}
export interface DomainEvent extends DomainEventBodyOneOf {
    createdEvent?: EntityCreatedEvent;
    updatedEvent?: EntityUpdatedEvent;
    deletedEvent?: EntityDeletedEvent;
    actionEvent?: ActionEvent;
    /** Event ID. With this ID you can easily spot duplicated events and ignore them. */
    id?: string;
    /**
     * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
     * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
     */
    entityFqdn?: string;
    /**
     * Event action name, placed at the top level to make it easier for users to dispatch messages.
     * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
     */
    slug?: string;
    /** ID of the entity associated with the event. */
    entityId?: string;
    /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
    eventTime?: Date | null;
    /**
     * Whether the event was triggered as a result of a privacy regulation application
     * (for example, GDPR).
     */
    triggeredByAnonymizeRequest?: boolean | null;
    /** If present, indicates the action that triggered the event. */
    originatedFrom?: string | null;
    /**
     * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.
     * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.
     */
    entityEventSequence?: string | null;
}
/** @oneof */
export interface DomainEventBodyOneOf {
    createdEvent?: EntityCreatedEvent;
    updatedEvent?: EntityUpdatedEvent;
    deletedEvent?: EntityDeletedEvent;
    actionEvent?: ActionEvent;
}
export interface EntityCreatedEvent {
    entityAsJson?: string;
    /**
     * Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity
     * @internal
     */
    triggeredByUndelete?: boolean | null;
    /** Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity */
    restoreInfo?: RestoreInfo;
    /**
     * Optional domain-specific metadata defined by the API owner, encoded as JSON.
     * @internal
     */
    additionalMetadataAsJson?: string | null;
}
export interface EntityDeletedEvent {
    /**
     * Indicates if the entity is sent to trash-bin. only available when trash-bin is enabled
     * @internal
     */
    movedToTrash?: boolean | null;
    /** Entity that was deleted. */
    deletedEntityAsJson?: string | null;
    /**
     * Optional domain-specific metadata defined by the API owner, encoded as JSON.
     * @internal
     */
    additionalMetadataAsJson?: string | null;
}
export interface EntityUpdatedEvent {
    /**
     * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
     * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
     * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
     */
    currentEntityAsJson?: string;
    /**
     * This field is currently part of the of the EntityUpdatedEvent msg, but scala/node libraries which implements the domain events standard
     * wont populate it / have any reference to it in the API.
     * The main reason for it is that fetching the old entity from the DB will have a performance hit on an update operation so unless truly needed,
     * the developer should send only the new (current) entity.
     * An additional reason is not wanting to send this additional entity over the wire (kafka) since in some cases it can be really big
     * Developers that must reflect the old entity will have to implement their own domain event sender mechanism which will follow the DomainEvent proto message.
     * @internal
     * @deprecated
     */
    previousEntityAsJson?: string | null;
    /**
     * Map of fully qualified field paths to their previous values for fields that changed.
     * For more details please see [AIP](https://dev.wix.com/docs/rnd-general/articles/p13n-guidelines-aips/guidance-aips/design-patterns/7016-events#modified-fields-format)
     * @internal
     */
    modifiedFields?: Record<string, any>;
    /**
     * Optional domain-specific metadata defined by the API owner, encoded as JSON.
     * @internal
     */
    additionalMetadataAsJson?: string | null;
}
export interface RestoreInfo {
    deletedDate?: Date | null;
}
