import * as _wix_sdk_types from '@wix/sdk-types'; import { QuerySpec, Query, NonNullablePaths } from '@wix/sdk-types'; /** A review request is a request sent to a customer to solicit a review for a specific order or specific items. */ interface ReviewRequest extends ReviewRequestStatusOptionsOneOf { /** * Info if `status` is `SENT`. * @readonly */ sentOptions?: SentOptions; /** * Info if `status` is `FAILED`. * @readonly */ failedOptions?: FailedOptions; /** * Review request ID. * @format GUID * @readonly */ _id?: string | null; /** * Revision number, which increments by 1 each time the review request is updated. * To prevent conflicting changes, the current revision must be passed when updating the review request. * * Ignored when creating a review request. * @readonly */ revision?: string | null; /** * Date and time the review request was created. * @readonly */ _createdDate?: Date | null; /** * Date and time the review request was last updated. * @readonly */ _updatedDate?: Date | null; /** * Date and time the review request was, or will be, sent. This field is only informational and does not trigger a send action. * @immutable */ sendDate?: Date | null; /** * Name of the Wix app whose catalog the items being reviewed belong to. * * Supported values: * + Wix Stores: `stores` * * Currently, only Wix Stores is fully integrated with the Wix Reviews app. * @immutable * @minLength 1 * @maxLength 100 */ namespace?: string; /** * Order that a review is requested for. * @immutable */ order?: Order; /** * Items that a review is requested for. * @immutable * @maxSize 5 */ items?: Item[]; /** * Customer to send a review request to. * @immutable */ recipient?: Recipient; /** * Communication channel for sending the review request. * @immutable */ communicationChannel?: CommunicationChannelWithLiterals; /** * Review request status. * @readonly */ status?: ReviewRequestStatusWithLiterals; /** * ID of the automation action that triggered the review request to be created. * * This field is only used if a review request was created by the [automation included with Wix Reviews](https://support.wix.com/en/article/wix-stores-adding-and-setting-up-wix-reviews#step-3-optional-customize-review-requests). * Also see the Automations API for more information. * @immutable * @format GUID */ automationActivationId?: string | null; /** * ID of the user or app that generated the review request. * @readonly */ requestedBy?: IdentificationData; /** * Wix data extensions. * @internal */ extendedFields?: ExtendedFields; } /** @oneof */ interface ReviewRequestStatusOptionsOneOf { /** * Info if `status` is `SENT`. * @readonly */ sentOptions?: SentOptions; /** * Info if `status` is `FAILED`. * @readonly */ failedOptions?: FailedOptions; } interface Order { /** * Order ID. * @format GUID */ _id?: string; } /** Item that a review is requested for. */ interface Item { /** * ID of the item within the catalog it belongs to. * * For example, `product.id` for items from the Stores Catalog API. * @immutable * @minLength 1 * @maxLength 36 */ catalogItemId?: string; /** * ID of the review created for this item by the review request recipient. * @readonly * @format GUID */ reviewId?: string | null; } /** Customer to send a review request to. */ interface Recipient { /** * Recipient contact ID. See the Contacts API for more information. * @immutable * @format GUID */ contactId?: string; } /** Communication channel for sending the review request. */ declare enum CommunicationChannel { /** @internal */ UNKNOWN_COMMUNICATION_CHANNEL = "UNKNOWN_COMMUNICATION_CHANNEL", EMAIL = "EMAIL" } /** @enumType */ type CommunicationChannelWithLiterals = CommunicationChannel | 'EMAIL'; /** Status of a review request. */ declare enum ReviewRequestStatus { /** Unknown review request status. */ UNKNOWN_REVIEW_REQUEST_STATUS = "UNKNOWN_REVIEW_REQUEST_STATUS", /** Review request scheduled. */ SCHEDULED = "SCHEDULED", /** Review request canceled. */ CANCELED = "CANCELED", /** Review request failed to send. */ FAILED = "FAILED", /** Review request sent. */ SENT = "SENT" } /** @enumType */ type ReviewRequestStatusWithLiterals = ReviewRequestStatus | 'UNKNOWN_REVIEW_REQUEST_STATUS' | 'SCHEDULED' | 'CANCELED' | 'FAILED' | 'SENT'; /** Info if `status` is `SENT`. */ interface SentOptions { /** Whether the recipient opened the review request email. */ opened?: boolean; } /** Info if `status` is `FAILED`. */ interface FailedOptions { /** Reason review request `status` is `FAILED`. */ reason?: FailureReasonWithLiterals; /** * Error message for review request failure. * @maxLength 1000 */ message?: string | null; } declare enum FailureReason { /** Unknown reason for review request failure. */ UNKNOWN_FAILURE_REASON = "UNKNOWN_FAILURE_REASON", /** Review request failed due to a failure in the activation flow. */ ACTIVATION_FAILED = "ACTIVATION_FAILED", /** Email bounced. */ BOUNCED = "BOUNCED", /** * Review request failed because `deliverabilityStatus` is set to * `inactiveSubscription` in the recipient's contact information. */ SUBSCRIPTION_INACTIVE = "SUBSCRIPTION_INACTIVE" } /** @enumType */ type FailureReasonWithLiterals = FailureReason | 'UNKNOWN_FAILURE_REASON' | 'ACTIVATION_FAILED' | 'BOUNCED' | 'SUBSCRIPTION_INACTIVE'; interface IdentificationData extends IdentificationDataIdOneOf { /** * Anonymous site visitor ID. * @internal * @format GUID */ anonymousVisitorId?: string; /** * Member ID. * @internal * @format GUID */ memberId?: string; /** * Wix user ID. * @format GUID */ wixUserId?: string; /** * Wix app ID. * @format GUID */ appId?: string; /** * Identity type. * @readonly */ identityType?: IdentityTypeWithLiterals; } /** @oneof */ interface IdentificationDataIdOneOf { /** * Anonymous site visitor ID. * @internal * @format GUID */ anonymousVisitorId?: string; /** * Member ID. * @internal * @format GUID */ memberId?: string; /** * Wix user ID. * @format GUID */ wixUserId?: string; /** * Wix app ID. * @format GUID */ appId?: string; } declare enum IdentityType { WIX_USER = "WIX_USER", APP = "APP" } /** @enumType */ type IdentityTypeWithLiterals = IdentityType | 'WIX_USER' | 'APP'; interface ExtendedFields { /** * Extended field data. Each key corresponds to the namespace of the app that created the extended fields. * The value of each key is structured according to the schema defined when the extended fields were configured. * * You can only access fields for which you have the appropriate permissions. * * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields). */ namespaces?: Record>; } interface CreateReviewRequestRequest { /** Review request to create. */ reviewRequest: ReviewRequest; } interface CreateReviewRequestResponse { /** Created review request. */ reviewRequest?: ReviewRequest; } interface BulkCreateReviewRequestsRequest { /** * ReviewRequests to be created * @minSize 1 * @maxSize 50 */ reviewRequests: ReviewRequest[]; /** Whether to return the created ReviewRequest entities */ returnEntity?: boolean; } interface BulkCreateReviewRequestsResponse { /** * @minSize 1 * @maxSize 50 */ results?: BulkReviewRequestResult[]; bulkActionMetadata?: BulkActionMetadata; } interface ItemMetadata { /** * Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). * @format GUID */ _id?: string | null; /** Index of the item within the request array. Allows for correlation between request and response items. */ originalIndex?: number; /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */ success?: boolean; /** Details about the error in case of failure. */ error?: ApplicationError; } interface ApplicationError { /** Error code. */ code?: string; /** Description of the error. */ description?: string; /** Data related to the error. */ data?: Record | null; } interface BulkReviewRequestResult { /** Defined in wix.commons */ itemMetadata?: ItemMetadata; /** Only exists if `returnEntity` was set to true in the request */ item?: ReviewRequest; } interface BulkActionMetadata { /** Number of items that were successfully processed. */ totalSuccesses?: number; /** Number of items that couldn't be processed. */ totalFailures?: number; /** Number of failures without details because detailed failure threshold was exceeded. */ undetailedFailures?: number; } interface GetReviewRequestRequest { /** * ID of the review request to retrieve. * @format GUID */ reviewRequestId: string; } interface GetReviewRequestResponse { /** Retrieved review request. */ reviewRequest?: ReviewRequest; } interface DeleteReviewRequestRequest { /** * ID of the review request to delete. * @format GUID */ reviewRequestId: string; } interface DeleteReviewRequestResponse { } interface QueryReviewRequestsRequest { /** Query options. */ query: CursorQuery; } interface CursorQuery extends CursorQueryPagingMethodOneOf { /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */ cursorPaging?: CursorPaging; /** * Filter object in the following format: * `"filter" : { * "fieldName1": "value1", * "fieldName2":{"$operator":"value2"} * }` * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains` */ filter?: Record | null; /** * Sort object in the following format: * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]` * @maxSize 5 */ sort?: Sorting[]; } /** @oneof */ interface CursorQueryPagingMethodOneOf { /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */ cursorPaging?: CursorPaging; } interface Sorting { /** * Name of the field to sort by. * @maxLength 512 */ fieldName?: string; /** Sort order. */ order?: SortOrderWithLiterals; } declare enum SortOrder { ASC = "ASC", DESC = "DESC" } /** @enumType */ type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC'; interface CursorPaging { /** * Maximum number of items to return in the results. * @max 100 */ limit?: number | null; /** * Pointer to the next or previous page in the list of results. * * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. * Not relevant for the first request. * @maxLength 16000 */ cursor?: string | null; } interface QueryReviewRequestsResponse { /** Retrieved review requests. */ reviewRequests?: ReviewRequest[]; /** Paging metadata. */ pagingMetadata?: CursorPagingMetadata; } /** This is the preferred message for cursor-paging enabled services */ interface CursorPagingMetadata { /** Number of items returned in the response. */ count?: number | null; /** Cursor strings that point to the next page, previous page, or both. */ cursors?: Cursors; /** * Whether there are more pages to retrieve following the current page. * * + `true`: Another page of results can be retrieved. * + `false`: This is the last page. */ hasNext?: boolean | null; } interface Cursors { /** * Cursor string pointing to the next page in the list of results. * @maxLength 16000 */ next?: string | null; /** * Cursor pointing to the previous page in the list of results. * @maxLength 16000 */ prev?: string | null; } interface CountReviewRequestsRequest { /** * Filter object in the following format: * `"filter" : { * "fieldName1": "value1", * "fieldName2":{"$operator":"value2"} * }` */ filter?: Record | null; } interface CountReviewRequestsResponse { /** Number of review requests. */ count?: number; } interface BulkCancelReviewRequestsByFilterRequest { /** * Filter object in the following format: * `"filter" : { * "fieldName1": "value1", * "fieldName2":{"$operator":"value2"} * }` */ filter?: Record | null; } interface BulkCancelReviewRequestsByFilterResponse { /** * Bulk job ID. The job's status can be retrieved with Get Bulk Job or List Bulk Jobs. * @format GUID */ jobId?: string; } 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 Empty { } interface MessageEnvelope { /** * App instance ID. * @format GUID */ instanceId?: string | null; /** * Event type. * @maxLength 150 */ eventType?: string; /** The identification type and identity data. */ identity?: WebhooksIdentificationData; /** Stringify payload. */ data?: string; /** Details related to the account */ accountInfo?: AccountInfo; } interface WebhooksIdentificationData extends WebhooksIdentificationDataIdOneOf { /** * 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 WebhooksIdentificationDataIdOneOf { /** * 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 CreateReviewRequestApplicationErrors = { code?: 'INITIATOR_IDENTITY_NOT_SUPPORTED'; description?: string; data?: Record; } | { code?: 'ORDER_IS_EMPTY'; description?: string; data?: Record; } | { code?: 'ORDER_NOT_FOUND'; description?: string; data?: Record; } | { code?: 'EITHER_ORDER_OR_ITEMS_REQUIRED'; description?: string; data?: Record; }; /** @docsIgnore */ type CountReviewRequestsApplicationErrors = { code?: 'TOO_MANY_TO_COUNT'; description?: string; data?: Record; }; interface BaseEventMetadata { /** * App instance ID. * @format GUID */ instanceId?: string | null; /** * Event type. * @maxLength 150 */ eventType?: string; /** The identification type and identity data. */ identity?: WebhooksIdentificationData; /** Details related to the account */ accountInfo?: AccountInfo; } interface EventMetadata extends BaseEventMetadata { /** 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; accountInfo?: AccountInfoMetadata; } interface AccountInfoMetadata { /** ID of the Wix account associated with the event */ accountId: string; /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */ siteId?: string; /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */ parentAccountId?: string; } interface ReviewRequestCreatedEnvelope { entity: ReviewRequest; metadata: EventMetadata; } /** * Triggered when a review request is created. * @permissionScope Manage Stores * @permissionScopeId SCOPE.STORES.MANAGE-STORES * @permissionScope Manage Review Requests * @permissionScopeId SCOPE.DC_REVIEWS.MANAGE-REVIEW_REQUESTS * @permissionId REVIEWS.REVIEW_REQUEST_DOMAIN_EVENTS_READ_PERMISSION * @webhook * @eventType wix.reviews.v2.review_request_created * @slug created * @documentationMaturity preview */ declare function onReviewRequestCreated(handler: (event: ReviewRequestCreatedEnvelope) => void | Promise): void; interface ReviewRequestDeletedEnvelope { entity: ReviewRequest; metadata: EventMetadata; } /** * Triggered when a review request is deleted. * @permissionScope Manage Stores * @permissionScopeId SCOPE.STORES.MANAGE-STORES * @permissionScope Manage Review Requests * @permissionScopeId SCOPE.DC_REVIEWS.MANAGE-REVIEW_REQUESTS * @permissionId REVIEWS.REVIEW_REQUEST_DOMAIN_EVENTS_READ_PERMISSION * @webhook * @eventType wix.reviews.v2.review_request_deleted * @slug deleted * @documentationMaturity preview */ declare function onReviewRequestDeleted(handler: (event: ReviewRequestDeletedEnvelope) => void | Promise): void; interface ReviewRequestUpdatedEnvelope { entity: ReviewRequest; metadata: EventMetadata; } /** * Triggered when a review request is updated. * @permissionScope Manage Stores * @permissionScopeId SCOPE.STORES.MANAGE-STORES * @permissionScope Manage Review Requests * @permissionScopeId SCOPE.DC_REVIEWS.MANAGE-REVIEW_REQUESTS * @permissionId REVIEWS.REVIEW_REQUEST_DOMAIN_EVENTS_READ_PERMISSION * @webhook * @eventType wix.reviews.v2.review_request_updated * @slug updated * @documentationMaturity preview */ declare function onReviewRequestUpdated(handler: (event: ReviewRequestUpdatedEnvelope) => void | Promise): void; /** * Creates a new review request. * * A review request is a request sent to a customer to solicit a review for a specific order or specific items. * This method requires either the `order.id` or `items.catalogItemId`. * * You must pass either an order ID or at least 1 item ID: * + **Order ID only:** The review request automatically includes the 5 most expensive items from the order. * + **Item IDs only:** The review request includes only the specified items. * + **Order ID and item IDs:** The review request includes the specified items from the given order. * @param reviewRequest - Review request to create. * @public * @requiredField reviewRequest * @requiredField reviewRequest.communicationChannel * @permissionId REVIEWS.REVIEW_REQUEST_CREATE * @applicableIdentity APP * @returns Created review request. * @fqn com.wixpress.critique.requests.v2.ReviewRequestsV2.CreateReviewRequest */ declare function createReviewRequest(reviewRequest: NonNullablePaths): Promise & { __applicationErrorsType?: CreateReviewRequestApplicationErrors; }>; /** * Creates a bulk review requests. * @param reviewRequests - ReviewRequests to be created * @public * @requiredField reviewRequests * @requiredField reviewRequests.communicationChannel * @permissionId REVIEWS.REVIEW_REQUEST_CREATE * @applicableIdentity APP * @fqn com.wixpress.critique.requests.v2.ReviewRequestsV2.BulkCreateReviewRequests */ declare function bulkCreateReviewRequests(reviewRequests: NonNullablePaths[], options?: BulkCreateReviewRequestsOptions): Promise>; interface BulkCreateReviewRequestsOptions { /** Whether to return the created ReviewRequest entities */ returnEntity?: boolean; } /** * Retrieves a review request. * @param reviewRequestId - ID of the review request to retrieve. * @public * @requiredField reviewRequestId * @permissionId REVIEWS.REVIEW_REQUEST_READ * @applicableIdentity APP * @returns Retrieved review request. * @fqn com.wixpress.critique.requests.v2.ReviewRequestsV2.GetReviewRequest */ declare function getReviewRequest(reviewRequestId: string): Promise>; /** * Deletes a review request. * * Only review requests with `status` set to `CANCELED` can be deleted. * @param reviewRequestId - ID of the review request to delete. * @public * @requiredField reviewRequestId * @permissionId REVIEWS.REVIEW_REQUEST_DELETE * @applicableIdentity APP * @fqn com.wixpress.critique.requests.v2.ReviewRequestsV2.DeleteReviewRequest */ declare function deleteReviewRequest(reviewRequestId: string): Promise; /** * Creates a query to retrieve a list of review requests. * * The `queryReviewRequests()` function builds a query to retrieve a list of review requests and returns a `ReviewRequestsQueryBuilder` object. * * The returned object contains the query definition, which is typically used to run the query using the [`find()`](https://dev.wix.com/docs/sdk/backend-modules/reviews/review-requests/review-requests-query-builder/find) function. * * You can refine the query by chaining `ReviewRequestsQueryBuilder` functions onto the query. `ReviewRequestsQueryBuilder` functions enable you to sort, filter, and control the results that `queryReviewRequests()` returns. * * `queryReviewRequests()` runs with the following `ReviewRequestsBuilder` default that you can override: * + `ascending("_createdDate")` * * The functions that are chained to `queryReviewRequests()` are applied in the order they are called. For example, if you apply `in("items.catalogItemId")` and then `("requestedBy.appId")`, the results are sorted first by the `"items.catalogItem"`, and then, if there are multiple results with the same `"items.catalogItem"`, the items are sorted by `"appId"`. * * The following `ReviewRequestsQueryBuilder` functions are supported for the `queryReviewRequests()` function. For a full description of the review request object, see the object returned for the [`items`](https://dev.wix.com/docs/sdk/backend-modules/reviews/review-requests/review-requests-query-result/items) property in `ReviewRequestsQueryResult`. * @public * @permissionId REVIEWS.REVIEW_REQUEST_READ * @applicableIdentity APP * @fqn com.wixpress.critique.requests.v2.ReviewRequestsV2.QueryReviewRequests */ declare function queryReviewRequests(): ReviewRequestsQueryBuilder; interface QueryCursorResult { cursors: Cursors; hasNext: () => boolean; hasPrev: () => boolean; length: number; pageSize: number; } interface ReviewRequestsQueryResult extends QueryCursorResult { items: ReviewRequest[]; query: ReviewRequestsQueryBuilder; next: () => Promise; prev: () => Promise; } interface ReviewRequestsQueryBuilder { /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ eq: (propertyName: '_id' | '_createdDate' | 'sendDate' | 'namespace' | 'order.id' | 'items.catalogItemId' | 'items.reviewId' | 'recipient.contactId' | 'communicationChannel' | 'status' | 'automationActivationId' | 'requestedBy.wixUserId' | 'requestedBy.appId' | 'requestedBy.identityType', value: any) => ReviewRequestsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ ne: (propertyName: '_id' | '_createdDate' | 'sendDate' | 'namespace' | 'order.id' | 'items.catalogItemId' | 'items.reviewId' | 'recipient.contactId' | 'communicationChannel' | 'status' | 'automationActivationId' | 'requestedBy.wixUserId' | 'requestedBy.appId' | 'requestedBy.identityType', value: any) => ReviewRequestsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ ge: (propertyName: '_createdDate' | 'sendDate', value: any) => ReviewRequestsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ gt: (propertyName: '_createdDate' | 'sendDate', value: any) => ReviewRequestsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ le: (propertyName: '_createdDate' | 'sendDate', value: any) => ReviewRequestsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ lt: (propertyName: '_createdDate' | 'sendDate', value: any) => ReviewRequestsQueryBuilder; /** @param propertyName - Property whose value is compared with `values`. * @param values - List of values to compare against. */ hasSome: (propertyName: string, value: any[]) => ReviewRequestsQueryBuilder; /** @param propertyName - Property whose value is compared with `values`. * @param values - List of values to compare against. */ hasAll: (propertyName: string, value: any[]) => ReviewRequestsQueryBuilder; in: (propertyName: '_id' | '_createdDate' | 'sendDate' | 'namespace' | 'order.id' | 'items.catalogItemId' | 'items.reviewId' | 'recipient.contactId' | 'communicationChannel' | 'status' | 'automationActivationId' | 'requestedBy.wixUserId' | 'requestedBy.appId' | 'requestedBy.identityType', value: any) => ReviewRequestsQueryBuilder; exists: (propertyName: 'order.id' | 'items.reviewId' | 'automationActivationId', value: boolean) => ReviewRequestsQueryBuilder; /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */ ascending: (...propertyNames: Array<'_createdDate' | 'sendDate' | 'status'>) => ReviewRequestsQueryBuilder; /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */ descending: (...propertyNames: Array<'_createdDate' | 'sendDate' | 'status'>) => ReviewRequestsQueryBuilder; /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */ limit: (limit: number) => ReviewRequestsQueryBuilder; /** @param cursor - A pointer to specific record */ skipTo: (cursor: string) => ReviewRequestsQueryBuilder; find: () => Promise; } /** * @hidden * @fqn com.wixpress.critique.requests.v2.ReviewRequestsV2.QueryReviewRequests * @requiredField query */ declare function typedQueryReviewRequests(query: ReviewRequestQuery): Promise>; interface ReviewRequestQuerySpec extends QuerySpec { paging: 'cursor'; wql: [ { fields: [ '_id', 'communicationChannel', 'namespace', 'recipient.contactId', 'requestedBy.appId', 'requestedBy.identityType', 'requestedBy.wixUserId' ]; operators: ['$eq', '$in', '$ne', '$nin']; sort: 'NONE'; }, { fields: ['items.catalogItemId']; operators: ['$eq', '$hasAll', '$hasSome', '$in', '$ne', '$nin']; sort: 'NONE'; }, { fields: ['items.reviewId']; operators: [ '$eq', '$exists', '$hasAll', '$hasSome', '$in', '$ne', '$nin' ]; sort: 'NONE'; }, { fields: ['automationActivationId', 'order._id']; operators: ['$eq', '$exists', '$in', '$ne', '$nin']; sort: 'NONE'; }, { fields: ['_createdDate', 'sendDate']; operators: ['$eq', '$gt', '$gte', '$in', '$lt', '$lte', '$ne', '$nin']; sort: 'BOTH'; }, { fields: ['status']; operators: ['$eq', '$in', '$ne', '$nin']; sort: 'BOTH'; } ]; } type CommonQueryWithEntityContext = Query; type ReviewRequestQuery = { /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */ cursorPaging?: { /** Maximum number of items to return in the results. @max: 100 */ limit?: NonNullable['limit'] | null; /** Pointer to the next or previous page in the list of results. Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response. Not relevant for the first request. @maxLength: 16000 */ cursor?: NonNullable['cursor'] | null; }; /** Filter object in the following format: `"filter" : { "fieldName1": "value1", "fieldName2":{"$operator":"value2"} }` Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains` */ filter?: CommonQueryWithEntityContext['filter'] | null; /** Sort object in the following format: `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]` @maxSize: 5 */ sort?: { /** Name of the field to sort by. @maxLength: 512 */ fieldName?: NonNullable[number]['fieldName']; /** Sort order. */ order?: NonNullable[number]['order']; }[]; }; declare const utils: { query: _wix_sdk_types.QueryHelpers; }; /** * Counts review requests, given the specified filtering. * * For a list of supported filters, see the table in [`queryReviewRequests`](https://dev.wix.com/docs/sdk/backend-modules/reviews/review-requests/query-review-requests). * * If a filter isn't passed in the request, the method returns the count of all review requests. * @public * @permissionId REVIEWS.REVIEW_REQUEST_READ * @applicableIdentity APP * @fqn com.wixpress.critique.requests.v2.ReviewRequestsV2.CountReviewRequests */ declare function countReviewRequests(options?: CountReviewRequestsOptions): Promise & { __applicationErrorsType?: CountReviewRequestsApplicationErrors; }>; interface CountReviewRequestsOptions { /** * Filter object in the following format: * `"filter" : { * "fieldName1": "value1", * "fieldName2":{"$operator":"value2"} * }` */ filter?: Record | null; } /** * Cancels review requests given specified filters. * * When this method is used, a bulk job is started and the job ID is returned. The job might not complete right away, depending on its size. The job's status can be retrieved with [`getAsyncJob()`](https://dev.wix.com/docs/sdk/backend-modules/async-jobs/get-async-job) or [`listAsyncJobItems()`](https://dev.wix.com/docs/sdk/backend-modules/async-jobs/list-async-job-items). * * For a list of supported filters, see the table in [`queryReviewRequests`](https://dev.wix.com/docs/sdk/backend-modules/reviews/review-requests/query-review-requests). * * To check which review requests will be canceled with this filter, you can run the filter with [`queryReviewRequests()`](https://dev.wix.com/docs/sdk/backend-modules/reviews/review-requests/query-review-requests) and confirm which review requests are returned with that filter. * @public * @permissionId REVIEWS.REVIEW_REQUEST_CANCEL * @applicableIdentity APP * @fqn com.wixpress.critique.requests.v2.ReviewRequestsV2.BulkCancelReviewRequestsByFilter */ declare function bulkCancelReviewRequestsByFilter(options?: BulkCancelReviewRequestsByFilterOptions): Promise>; interface BulkCancelReviewRequestsByFilterOptions { /** * Filter object in the following format: * `"filter" : { * "fieldName1": "value1", * "fieldName2":{"$operator":"value2"} * }` */ filter?: Record | null; } export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type ApplicationError, type BaseEventMetadata, type BulkActionMetadata, type BulkCancelReviewRequestsByFilterOptions, type BulkCancelReviewRequestsByFilterRequest, type BulkCancelReviewRequestsByFilterResponse, type BulkCreateReviewRequestsOptions, type BulkCreateReviewRequestsRequest, type BulkCreateReviewRequestsResponse, type BulkReviewRequestResult, type CommonQueryWithEntityContext, CommunicationChannel, type CommunicationChannelWithLiterals, type CountReviewRequestsApplicationErrors, type CountReviewRequestsOptions, type CountReviewRequestsRequest, type CountReviewRequestsResponse, type CreateReviewRequestApplicationErrors, type CreateReviewRequestRequest, type CreateReviewRequestResponse, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DeleteReviewRequestRequest, type DeleteReviewRequestResponse, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type ExtendedFields, type FailedOptions, FailureReason, type FailureReasonWithLiterals, type GetReviewRequestRequest, type GetReviewRequestResponse, type IdentificationData, type IdentificationDataIdOneOf, IdentityType, type IdentityTypeWithLiterals, type Item, type ItemMetadata, type MessageEnvelope, type Order, type QueryReviewRequestsRequest, type QueryReviewRequestsResponse, type Recipient, type RestoreInfo, type ReviewRequest, type ReviewRequestCreatedEnvelope, type ReviewRequestDeletedEnvelope, type ReviewRequestQuery, type ReviewRequestQuerySpec, ReviewRequestStatus, type ReviewRequestStatusOptionsOneOf, type ReviewRequestStatusWithLiterals, type ReviewRequestUpdatedEnvelope, type ReviewRequestsQueryBuilder, type ReviewRequestsQueryResult, type SentOptions, SortOrder, type SortOrderWithLiterals, type Sorting, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, type WebhooksIdentificationData, type WebhooksIdentificationDataIdOneOf, bulkCancelReviewRequestsByFilter, bulkCreateReviewRequests, countReviewRequests, createReviewRequest, deleteReviewRequest, getReviewRequest, onReviewRequestCreated, onReviewRequestDeleted, onReviewRequestUpdated, queryReviewRequests, typedQueryReviewRequests, utils };