import { NonNullablePaths } from '@wix/sdk-types'; /** * A CMP Config is a collection of settings and parameters defined within a consent management platform. * * Currently only contains a toggle to manage the visibility of social components until site visitors provide their consent. */ interface CmpConfig { /** * Revision number, which increments by 1 each time the CMP config is updated. * To prevent conflicting changes, * the current revision must be passed when updating the CMP config. * @readonly */ revision?: string | null; /** * Date and time the CMP config was created. * @readonly */ _createdDate?: Date | null; /** * Date and time the CMP config was last updated. * @readonly */ _updatedDate?: Date | null; /** Whether elements are blocked until consent is given. */ socialElementsBlocked?: boolean | null; } interface GetCmpConfigRequest { } interface GetCmpConfigResponse { /** Requested CMP config. */ cmpConfig?: CmpConfig; } interface UpdateCmpConfigRequest { /** CMP config to be updated. */ cmpConfig: CmpConfig; } interface UpdateCmpConfigResponse { /** Updated CMP config. */ cmpConfig?: CmpConfig; } 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 */ interface DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; } interface EntityCreatedEvent { entity?: string; } interface RestoreInfo { deletedDate?: Date | null; } 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. */ currentEntity?: string; } interface EntityDeletedEvent { /** Entity that was deleted. */ deletedEntity?: string | null; } interface ActionEvent { body?: string; } 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; } 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?: WebhookIdentityTypeWithLiterals; } /** @oneof */ 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; } declare enum WebhookIdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } /** @enumType */ type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP'; 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; } /** @docsIgnore */ type UpdateCmpConfigApplicationErrors = { code?: 'NO_HTML_WEB_APPLICATION_FOUND'; description?: string; data?: Record; }; /** * Retrieves a CMP config. * @public * @permissionId COOKIE_CONSENT.CMP_CONFIG_READ * @applicableIdentity APP * @returns Requested CMP config. * @fqn wix.bu.legal.v2.CmpConfigService.GetCmpConfig */ declare function getCmpConfig(): Promise; /** * Updates a CMP config. * @param cmpConfig - CMP config to be updated. * @public * @requiredField cmpConfig * @requiredField cmpConfig.revision * @permissionId COOKIE_CONSENT.CMP_CONFIG_UPDATE * @applicableIdentity APP * @returns Updated CMP config. * @fqn wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig */ declare function updateCmpConfig(cmpConfig: NonNullablePaths): Promise; export { type AccountInfo, type ActionEvent, type CmpConfig, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type GetCmpConfigRequest, type GetCmpConfigResponse, type IdentificationData, type IdentificationDataIdOneOf, type MessageEnvelope, type RestoreInfo, type UpdateCmpConfigApplicationErrors, type UpdateCmpConfigRequest, type UpdateCmpConfigResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, getCmpConfig, updateCmpConfig };