import * as _wix_sdk_types from '@wix/sdk-types'; import { QuerySpec, Query, NonNullablePaths } from '@wix/sdk-types'; interface PoolDefinition { /** * Pool definition ID. * @format GUID * @immutable * @readonly */ _id?: string | null; /** * Revision number, which increments by 1 each time the pool definition is updated. * To prevent conflicting changes, the current revision must be specified when updating the pool definition. * * Ignored when creating a pool definition. * @readonly */ revision?: string | null; /** * Date and time the pool definition was created. * @readonly */ _createdDate?: Date | null; /** * Date and time the pool definition was updated. * @readonly */ _updatedDate?: Date | null; /** * Pool definition name. * @maxLength 128 */ displayName?: string; /** * List of program definition IDs that are associated with this pool definition. * @format GUID * @maxSize 20 */ programDefinitionIds?: string[]; /** Pool definition benefits and settings. */ details?: Details; /** * Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created. * @immutable * @readonly * @minLength 1 * @maxLength 20 */ namespace?: string | null; /** * Custom field data for the pool definition object. * * [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls. */ extendedFields?: ExtendedFields; /** * Program definitions that this pool definition is associated with. * @readonly * @maxSize 20 */ programDefinitions?: ProgramDefinitionInfo[]; } interface Details { /** * List of benefits. * @maxSize 10 */ benefits?: Benefit[]; /** * Credit settings. * * If this object is empty, you can't set a price for the benefit. */ creditConfiguration?: CreditConfiguration; /** Additional information relating to this object. */ additionalData?: Record | null; } interface Benefit { /** * Unique identifier for this benefit. * * This key is consistent across the pool definition and all associated pools that contain this benefit. * @maxLength 64 */ benefitKey?: string; /** * ID that is used to associated items with this benefit. * @format GUID * @immutable * @readonly */ itemSetId?: string | null; /** * Price of the benefit in credits. The price is the same for all of this benefit's items. * @decimalValue options { gte:0, maxScale:4 } */ price?: string | null; /** Additional information for this benefit. */ additionalData?: Record | null; /** * ID of the app providing the benefit items. * @format GUID * @immutable */ providerAppId?: string | null; /** * Benefit name. * @maxLength 40 */ displayName?: string | null; /** * Benefit description. * @maxLength 255 */ description?: string | null; } interface PolicyExpression extends PolicyExpressionExpressionOneOf { /** Benefits can be redeemed if the expression in this object is not fulfilled. */ operatorNotOptions?: PolicyExpressionNot; /** Benefits can be redeemed if all the expression in this object's array are fulfilled. */ operatorAndOptions?: PolicyExpressionAnd; /** Benefits can be redeemed if at least one of the expressions in this object's array is fulfilled. */ operatorOrOptions?: PolicyExpressionOr; /** Defines when benefits can be redeemed or how many benefits can be redeemed in a specific time period. */ policyOptions?: Policy; /** Policy expression type. */ type?: PolicyExpressionTypeWithLiterals; } /** @oneof */ interface PolicyExpressionExpressionOneOf { /** Benefits can be redeemed if the expression in this object is not fulfilled. */ operatorNotOptions?: PolicyExpressionNot; /** Benefits can be redeemed if all the expression in this object's array are fulfilled. */ operatorAndOptions?: PolicyExpressionAnd; /** Benefits can be redeemed if at least one of the expressions in this object's array is fulfilled. */ operatorOrOptions?: PolicyExpressionOr; /** Defines when benefits can be redeemed or how many benefits can be redeemed in a specific time period. */ policyOptions?: Policy; } declare enum PolicyExpressionType { /** Use with `operatorNotOptions`. */ OPERATOR_NOT = "OPERATOR_NOT", /** Use with `operatorAndOptions`. */ OPERATOR_AND = "OPERATOR_AND", /** Use with `operatorOrOptions`. */ OPERATOR_OR = "OPERATOR_OR", /** Use with `policyOptions`. */ POLICY = "POLICY" } /** @enumType */ type PolicyExpressionTypeWithLiterals = PolicyExpressionType | 'OPERATOR_NOT' | 'OPERATOR_AND' | 'OPERATOR_OR' | 'POLICY'; interface PolicyExpressionNot { /** Policy expression. If this expression is not fulfilled, benefits can be redeemed. */ expression?: PolicyExpression; } interface PolicyExpressionAnd { /** * Array of policy expressions. If all expressions are fulfilled, benefits can be redeemed. * @minSize 2 * @maxSize 10 */ expressions?: PolicyExpression[]; } interface PolicyExpressionOr { /** * Array of policy expressions. If at least one expression is fulfilled, benefits can be redeemed. * @minSize 2 * @maxSize 10 */ expressions?: PolicyExpression[]; } interface Policy extends PolicyPolicyOneOf { /** * Defines an interval during which the policy expression is fulfilled. * * If `fromWeekDay` and `toWeekDay` are defined, this interval applies weekly. Otherwise, it applies daily. */ fixedIntervalOptions?: FixedIntervalPolicy; /** Maximum amount of times a benefit can be redeemed during a specified time period. */ rateLimitedOptions?: RateLimitedPolicy; /** Custom policy defined by a different app. */ customOptions?: CustomPolicy; /** Policy type. */ type?: TypeWithLiterals; } /** @oneof */ interface PolicyPolicyOneOf { /** * Defines an interval during which the policy expression is fulfilled. * * If `fromWeekDay` and `toWeekDay` are defined, this interval applies weekly. Otherwise, it applies daily. */ fixedIntervalOptions?: FixedIntervalPolicy; /** Maximum amount of times a benefit can be redeemed during a specified time period. */ rateLimitedOptions?: RateLimitedPolicy; /** Custom policy defined by a different app. */ customOptions?: CustomPolicy; } declare enum Type { /** Use with `fixedIntervalOptions`. */ FIXED_INTERVAL = "FIXED_INTERVAL", /** Use with `rateLimitedOptions`. */ RATE_LIMITED = "RATE_LIMITED", /** Use with `customOptions`. */ CUSTOM = "CUSTOM" } /** @enumType */ type TypeWithLiterals = Type | 'FIXED_INTERVAL' | 'RATE_LIMITED' | 'CUSTOM'; interface FixedIntervalPolicy { /** Weekday that this interval starts from. If this field is defined, then `toWeekDay` is required. */ fromWeekDay?: WeekDayWithLiterals; /** Weekday that this interval ends at. If this field is defined, then `fromWeekDay` is required. */ toWeekDay?: WeekDayWithLiterals; /** * Hour that this interval starts from. If this field is defined, then `toHour` is required. * @max 23 */ fromHour?: number | null; /** * Hour that this interval ends at. If this field is defined, then `fromHour` is required. * @max 23 */ toHour?: number | null; /** * Minute that this interval starts from. If this field is defined, then `toMinute` is required. * @max 59 */ fromMinute?: number | null; /** * Minute that this interval ends at. If this field is defined, then `fromMinute` is required. * @max 59 */ toMinute?: number | null; } declare enum WeekDay { /** Unknown weekday. */ UNKNOWN = "UNKNOWN", /** Monday. */ MONDAY = "MONDAY", /** Tuesday. */ TUESDAY = "TUESDAY", /** Wednesday. */ WEDNESDAY = "WEDNESDAY", /** Thursday. */ THURSDAY = "THURSDAY", /** Friday. */ FRIDAY = "FRIDAY", /** Saturday. */ SATURDAY = "SATURDAY", /** Sunday. */ SUNDAY = "SUNDAY" } /** @enumType */ type WeekDayWithLiterals = WeekDay | 'UNKNOWN' | 'MONDAY' | 'TUESDAY' | 'WEDNESDAY' | 'THURSDAY' | 'FRIDAY' | 'SATURDAY' | 'SUNDAY'; interface RateLimitedPolicy { /** Maximum number of times a benefit can be redeemed per specified time period. */ times?: number; /** Time period for the rate limit, resets at the start of each period. */ timePeriod?: TimePeriodWithLiterals; /** * Unique identifier for the quota resource. Set automatically when creating a policy. * Updating RateLimitedPolicy `time period` or `times` will result in a quota reset. * @immutable * @readonly * @format GUID */ quotaId?: string | null; } declare enum TimePeriod { /** Day, starting at midnight. */ DAY = "DAY", /** Calendar month, starting on the first day of the month. */ MONTH = "MONTH" } /** @enumType */ type TimePeriodWithLiterals = TimePeriod | 'DAY' | 'MONTH'; /** Custom policy as implemented by the Entitlement Policy Provider */ interface CustomPolicy { /** * Policy ID. * @format GUID */ _id?: string; /** * ID of the app providing the policy. * @format GUID */ appId?: string | null; /** Additional information for this custom policy. */ additionalData?: Record | null; } interface CreditConfiguration { /** * Initial available amount for associated balances. * @decimalValue options { gte:0, maxScale:4 } */ amount?: string; /** Rollover settings. */ rolloverConfiguration?: RolloverConfiguration; /** * Credit unit display name. * @maxLength 32 */ unitDisplayName?: string | null; } interface RolloverConfiguration { /** Whether unused credits roll over to a new cycle when a program renews. */ enabled?: boolean | null; /** * Maximum number of credits that can roll over to the next cycle when a program renews. * @decimalValue options { gte:0, maxScale:4 } */ balanceCap?: string | null; } 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 ProgramDefinitionInfo { /** * Program definition ID. * @format GUID * @readonly */ _id?: string; /** * Program definition external ID. * @format GUID * @readonly */ externalId?: string | null; } interface PoolDefinitionAddedToProgramDefinition { /** PoolDefinition that was added to the program definition */ poolDefinition?: PoolDefinition; /** * Program Definition that the pool definition was added to * @format GUID */ programDefinitionId?: string; /** Type of cascade */ cascadeType?: CascadeWithLiterals; } declare enum Cascade { /** Unknown cascade. */ UNKNOWN_CASCADE = "UNKNOWN_CASCADE", /** Changes are applied to existing programs and pools when they are next renewed. */ NEXT_RENEWAL = "NEXT_RENEWAL", /** Changes are applied to associated programs and pools immediately. */ IMMEDIATELY = "IMMEDIATELY", /** Changes are not applied to existing associated programs and pools. They are only applied to future programs and pools. */ FUTURE_PROVISIONS = "FUTURE_PROVISIONS" } /** @enumType */ type CascadeWithLiterals = Cascade | 'UNKNOWN_CASCADE' | 'NEXT_RENEWAL' | 'IMMEDIATELY' | 'FUTURE_PROVISIONS'; interface PoolDefinitionRemovedFromProgramDefinition { /** PoolDefinition that was removed from the program definition */ poolDefinition?: PoolDefinition; /** * Program Definition that the pool definition was removed from * @format GUID */ programDefinitionId?: string; /** Type of cascade */ cascadeType?: CascadeWithLiterals; } /** This event is needed to support legacy benefit notification event. Should be only consumed in the proxy. */ interface PoolDefinitionUpdatedProxySupport { /** PoolDefinition after the update */ currentPoolDefinition?: PoolDefinition; /** PoolDefinition before the update */ previousPoolDefinition?: PoolDefinition; } /** This event is needed to support legacy benefit notification event. Should be only consumed in the proxy. */ interface PoolDefinitionDeletedProxySupport { /** PoolDefinition which was deleted */ deletedPoolDefinition?: PoolDefinition; } interface PoolDefinitionTranslated { /** The translated pool definition. */ poolDefinition?: PoolDefinition; /** * The language code of the translation. * @maxLength 16 */ language?: string; } interface PoolDefinitionTranslationDeleted { /** * The ID of the pool definition. * @format GUID */ poolDefinitionId?: string; /** * The language code of the translation. * @maxLength 16 */ language?: string; /** The current revision of the pool definition. */ poolDefinitionRevision?: string; } interface CreatePoolDefinitionRequest { /** Pool definition to create. */ poolDefinition: PoolDefinition; /** * Determines when the changes to the program definitions containing this pool definition will be applied to associated programs. * * Required if the `poolDefinition.programDefinitionIds` parameter is defined. */ cascade?: CascadeWithLiterals; } interface CreatePoolDefinitionResponse { /** Created pool definition. */ poolDefinition?: PoolDefinition; } interface BulkCreatePoolDefinitionsRequest { /** * Pool definitions to create. * @minSize 1 * @maxSize 100 */ poolDefinitions: PoolDefinition[]; /** * Determines when the changes to the program definitions containing these pool definitions will be applied to associated programs. * * Required if the `poolDefinition.programDefinitionIds` parameter is defined. */ cascade?: CascadeWithLiterals; /** * Whether to return the created pool definitions. * * Default: `false` */ returnEntity?: boolean; } interface BulkCreatePoolDefinitionsResponse { /** * List of created pool definitions and associated metadata. * @minSize 1 * @maxSize 100 */ results?: BulkPoolDefinitionResult[]; /** Bulk action metadata. */ bulkActionMetadata?: BulkActionMetadata; } interface BulkPoolDefinitionResult { /** Item metadata. */ itemMetadata?: ItemMetadata; /** Pool definition. */ item?: PoolDefinition; } 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 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 UpdatePoolDefinitionRequest { /** Pool definition to update. */ poolDefinition: PoolDefinition; /** *Required.** Determines when the changes to this pool definition and program definitions containing it will be applied to associated programs and pools. */ cascade?: CascadeWithLiterals; } interface UpdatePoolDefinitionResponse { /** Updated pool definition. */ poolDefinition?: PoolDefinition; } interface BulkUpdatePoolDefinitionsRequest { /** * Pool definitions to update. * @minSize 1 * @maxSize 100 */ poolDefinitions?: MaskedPoolDefinition[]; /** *Required.** Determines when the changes to these pool definitions program definitions containing them will be applied to associated programs and pools. */ cascade?: CascadeWithLiterals; /** * Whether to return the updated pool definitions. * * Default: `false` */ returnEntity?: boolean; } interface MaskedPoolDefinition { /** Pool definition to update. */ poolDefinition?: PoolDefinition; /** Explicit list of fields to update. */ fieldMask?: string[]; } interface BulkUpdatePoolDefinitionsResponse { /** * List of updated pool definitions and associated metadata. * @minSize 1 * @maxSize 100 */ results?: BulkPoolDefinitionResult[]; /** Bulk action metadata. */ bulkActionMetadata?: BulkActionMetadata; } interface DeletePoolDefinitionRequest { /** * ID of the pool definition to delete. * @format GUID */ poolDefinitionId: string; /** *Required**. Determines when the changes to this pool definition the program definitions containing it will be applied to associated programs and pools. */ cascade: CascadeWithLiterals; } interface DeletePoolDefinitionResponse { } interface BulkDeletePoolDefinitionsRequest { /** * List of IDs of the pool definitions to delete. * @minSize 1 * @maxSize 100 * @format GUID */ poolDefinitionIds: string[]; /** *Required**. Determines when the changes to these pool definitions the program definitions containing it will be applied to associated programs and pools. */ cascade?: CascadeWithLiterals; } interface BulkDeletePoolDefinitionsResponse { /** * List of deleted pool definitions and associated metadata. * @minSize 1 * @maxSize 100 */ results?: BulkPoolDefinitionResult[]; /** Bulk action metadata. */ bulkActionMetadata?: BulkActionMetadata; } interface GetPoolDefinitionRequest { /** * ID of the pool definition to retrieve. * @format GUID */ poolDefinitionId: string; } interface GetPoolDefinitionResponse { /** Retrieved pool definition. */ poolDefinition?: PoolDefinition; } interface QueryPoolDefinitionsRequest { /** Filter, sort, and paging to apply to the query. */ 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. * See [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language) * for more information. */ filter?: Record | null; /** * List of sort objects. * @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 { /** * Field to sort by. * @maxLength 512 */ fieldName?: string; /** * Sort order. Use `ASC` for ascending order or `DESC` for descending order. * * Default: `ASC` */ order?: SortOrderWithLiterals; } declare enum SortOrder { /** Ascending sort order. */ ASC = "ASC", /** Descending sort order. */ DESC = "DESC" } /** @enumType */ type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC'; interface CursorPaging { /** * Maximum number of items to return. * @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 QueryPoolDefinitionsResponse { /** List of retrieved pool definitions. */ poolDefinitions?: PoolDefinition[]; /** Metadata for the paginated results. */ metadata?: CursorPagingMetadata; } 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 AddPoolDefinitionToProgramDefinitionRequest { /** * ID of the pool definition to add to the program definition. * @format GUID */ poolDefinitionId: string; /** * ID of the program definition to add the pool definition to. * @format GUID */ programDefinitionId: string; /** Determines when the changes to this program definition and pool definition will be applied to associated programs and pools. */ cascade: CascadeWithLiterals; } interface AddPoolDefinitionToProgramDefinitionResponse { /** Updated pool definition. */ poolDefinition?: PoolDefinition; } interface RemovePoolDefinitionFromProgramDefinitionRequest { /** * ID of the pool definition to remove from the program definition. * @format GUID */ poolDefinitionId: string; /** * ID of the program definition to remove the pool definition from. * @format GUID */ programDefinitionId: string; /** Determines when the changes to this program definition and pool definition will be applied to associated programs and pools. */ cascade: CascadeWithLiterals; } interface RemovePoolDefinitionFromProgramDefinitionResponse { /** Updated pool definition. */ poolDefinition?: PoolDefinition; } interface FindPoolDefinitionsByProgramDefinitionRequest { /** * ID of the program definition to retrieve its pool definitions. * @format GUID */ programDefinitionId: string; /** * Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created. * @minLength 1 * @maxLength 20 */ namespace: string; } interface FindPoolDefinitionsByProgramDefinitionResponse { /** Retrieved pool definitions. */ poolDefinitions?: PoolDefinition[]; } 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 UpdatePoolDefinitionValidationErrors = { ruleName?: 'cascade_is_required'; } | { ruleName?: 'cascade_value_not_supported'; }; /** @docsIgnore */ type BulkUpdatePoolDefinitionsValidationErrors = { ruleName?: 'cascade_is_required'; } | { ruleName?: 'cascade_value_not_supported'; }; /** @docsIgnore */ type AddPoolDefinitionToProgramDefinitionValidationErrors = { ruleName?: 'cascade_is_required'; } | { ruleName?: 'cascade_value_not_supported'; }; /** @docsIgnore */ type RemovePoolDefinitionFromProgramDefinitionValidationErrors = { ruleName?: 'cascade_is_required'; } | { ruleName?: 'cascade_value_not_supported'; }; /** * Creates a pool definition. * @param poolDefinition - Pool definition to create. * @public * @requiredField poolDefinition * @requiredField poolDefinition.details * @requiredField poolDefinition.details.benefits * @requiredField poolDefinition.details.benefits.benefitKey * @requiredField poolDefinition.details.benefits.providerAppId * @requiredField poolDefinition.namespace * @permissionId BENEFIT_PROGRAMS.POOL_DEFINITION_CREATE * @applicableIdentity APP * @returns Created pool definition. * @fqn wix.benefit_programs.v1.pool_definition.PoolDefinitionService.CreatePoolDefinition */ declare function createPoolDefinition(poolDefinition: NonNullablePaths, options?: CreatePoolDefinitionOptions): Promise>; interface CreatePoolDefinitionOptions { /** * Determines when the changes to the program definitions containing this pool definition will be applied to associated programs. * * Required if the `poolDefinition.programDefinitionIds` parameter is defined. */ cascade?: CascadeWithLiterals; } /** * Creates pool definitions. * @param poolDefinitions - Pool definitions to create. * @public * @requiredField poolDefinitions * @requiredField poolDefinitions.details * @requiredField poolDefinitions.details.benefits * @requiredField poolDefinitions.details.benefits.benefitKey * @requiredField poolDefinitions.details.benefits.providerAppId * @requiredField poolDefinitions.namespace * @permissionId BENEFIT_PROGRAMS.POOL_DEFINITION_CREATE * @applicableIdentity APP * @fqn wix.benefit_programs.v1.pool_definition.PoolDefinitionService.BulkCreatePoolDefinitions */ declare function bulkCreatePoolDefinitions(poolDefinitions: NonNullablePaths[], options?: BulkCreatePoolDefinitionsOptions): Promise>; interface BulkCreatePoolDefinitionsOptions { /** * Determines when the changes to the program definitions containing these pool definitions will be applied to associated programs. * * Required if the `poolDefinition.programDefinitionIds` parameter is defined. */ cascade?: CascadeWithLiterals; /** * Whether to return the created pool definitions. * * Default: `false` */ returnEntity?: boolean; } /** * Updates a pool definition. * * Each time the pool definition is updated, * `revision` increments by 1. * The current `revision` must be passed when updating the pool definition. * This ensures you're working with the latest pool definition * and prevents unintended overwrites. * @param _id - Pool definition ID. * @public * @requiredField _id * @requiredField poolDefinition * @requiredField poolDefinition.revision * @permissionId BENEFIT_PROGRAMS.POOL_DEFINITION_UPDATE * @applicableIdentity APP * @returns Updated pool definition. * @fqn wix.benefit_programs.v1.pool_definition.PoolDefinitionService.UpdatePoolDefinition */ declare function updatePoolDefinition(_id: string, poolDefinition: NonNullablePaths, options?: UpdatePoolDefinitionOptions): Promise & { __validationErrorsType?: UpdatePoolDefinitionValidationErrors; }>; interface UpdatePoolDefinition { /** * Pool definition ID. * @format GUID * @immutable * @readonly */ _id?: string | null; /** * Revision number, which increments by 1 each time the pool definition is updated. * To prevent conflicting changes, the current revision must be specified when updating the pool definition. * * Ignored when creating a pool definition. * @readonly */ revision?: string | null; /** * Date and time the pool definition was created. * @readonly */ _createdDate?: Date | null; /** * Date and time the pool definition was updated. * @readonly */ _updatedDate?: Date | null; /** * Pool definition name. * @maxLength 128 */ displayName?: string; /** * List of program definition IDs that are associated with this pool definition. * @format GUID * @maxSize 20 */ programDefinitionIds?: string[]; /** Pool definition benefits and settings. */ details?: Details; /** * Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created. * @immutable * @readonly * @minLength 1 * @maxLength 20 */ namespace?: string | null; /** * Custom field data for the pool definition object. * * [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls. */ extendedFields?: ExtendedFields; /** * Program definitions that this pool definition is associated with. * @readonly * @maxSize 20 */ programDefinitions?: ProgramDefinitionInfo[]; } interface UpdatePoolDefinitionOptions { /** Required.** Determines when the changes to this pool definition and program definitions containing it will be applied to associated programs and pools. */ cascade?: CascadeWithLiterals; } /** * Updates pool definitions. * @public * @requiredField options.poolDefinitions.poolDefinition * @requiredField options.poolDefinitions.poolDefinition._id * @requiredField options.poolDefinitions.poolDefinition.revision * @permissionId BENEFIT_PROGRAMS.POOL_DEFINITION_UPDATE * @applicableIdentity APP * @fqn wix.benefit_programs.v1.pool_definition.PoolDefinitionService.BulkUpdatePoolDefinitions */ declare function bulkUpdatePoolDefinitions(options?: NonNullablePaths): Promise & { __validationErrorsType?: BulkUpdatePoolDefinitionsValidationErrors; }>; interface BulkUpdatePoolDefinitionsOptions { /** * Pool definitions to update. * @minSize 1 * @maxSize 100 */ poolDefinitions?: MaskedPoolDefinition[]; /** Required.** Determines when the changes to these pool definitions program definitions containing them will be applied to associated programs and pools. */ cascade?: CascadeWithLiterals; /** * Whether to return the updated pool definitions. * * Default: `false` */ returnEntity?: boolean; } /** * Deletes a pool definition. * @param poolDefinitionId - ID of the pool definition to delete. * @param cascade - *Required**. Determines when the changes to this pool definition the program definitions containing it will be applied to associated programs and pools. * @public * @requiredField cascade * @requiredField poolDefinitionId * @permissionId BENEFIT_PROGRAMS.POOL_DEFINITION_DELETE * @applicableIdentity APP * @fqn wix.benefit_programs.v1.pool_definition.PoolDefinitionService.DeletePoolDefinition */ declare function deletePoolDefinition(poolDefinitionId: string, cascade: CascadeWithLiterals): Promise; /** * Deletes pool definitions. * @param poolDefinitionIds - List of IDs of the pool definitions to delete. * @public * @requiredField poolDefinitionIds * @permissionId BENEFIT_PROGRAMS.POOL_DEFINITION_DELETE * @applicableIdentity APP * @fqn wix.benefit_programs.v1.pool_definition.PoolDefinitionService.BulkDeletePoolDefinitions */ declare function bulkDeletePoolDefinitions(poolDefinitionIds: string[], options?: BulkDeletePoolDefinitionsOptions): Promise>; interface BulkDeletePoolDefinitionsOptions { /** Required**. Determines when the changes to these pool definitions the program definitions containing it will be applied to associated programs and pools. */ cascade?: CascadeWithLiterals; } /** * Retrieves a pool definition. * @param poolDefinitionId - ID of the pool definition to retrieve. * @public * @requiredField poolDefinitionId * @permissionId BENEFIT_PROGRAMS.POOL_DEFINITION_READ * @applicableIdentity APP * @returns Retrieved pool definition. * @fqn wix.benefit_programs.v1.pool_definition.PoolDefinitionService.GetPoolDefinition */ declare function getPoolDefinition(poolDefinitionId: string): Promise>; /** * Creates a query to retrieve a list of pool definitions. * * The Query Pool Definitions method builds a query to retrieve a list of pool definitions and returns a `PoolDefinitionsQueryBuilder` object. * * The returned object contains the query definition, which is used to run the query using the `find()` method. * * You can refine the query by chaining `PoolDefinitionsQueryBuilder` methods onto the query. `PoolDefinitionsQueryBuilder` methods enable you to filter, sort, and control the results that Query Pool Definitions returns. * * Query Pool Definitions has a default paging limit of 50, which you can override. * * For a full description of the item object, see the object returned for the `items` property in `PoolDefinitionsQueryResult`. * @public * @permissionId BENEFIT_PROGRAMS.POOL_DEFINITION_READ * @applicableIdentity APP * @fqn wix.benefit_programs.v1.pool_definition.PoolDefinitionService.QueryPoolDefinitions */ declare function queryPoolDefinitions(options?: QueryPoolDefinitionsOptions): PoolDefinitionsQueryBuilder; interface QueryPoolDefinitionsOptions { } interface QueryCursorResult { cursors: Cursors; hasNext: () => boolean; hasPrev: () => boolean; length: number; pageSize: number; } interface PoolDefinitionsQueryResult extends QueryCursorResult { items: PoolDefinition[]; query: PoolDefinitionsQueryBuilder; next: () => Promise; prev: () => Promise; } interface PoolDefinitionsQueryBuilder { /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ eq: (propertyName: '_id' | '_createdDate' | 'programDefinitionIds' | 'details.benefits.itemSetId' | 'details.benefits.providerAppId' | 'namespace', value: any) => PoolDefinitionsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ ne: (propertyName: '_id' | '_createdDate' | 'programDefinitionIds' | 'details.benefits.itemSetId' | 'details.benefits.providerAppId' | 'namespace', value: any) => PoolDefinitionsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ ge: (propertyName: '_id' | '_createdDate' | 'details.benefits.itemSetId' | 'details.benefits.providerAppId' | 'namespace', value: any) => PoolDefinitionsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ gt: (propertyName: '_id' | '_createdDate' | 'details.benefits.itemSetId' | 'details.benefits.providerAppId' | 'namespace', value: any) => PoolDefinitionsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ le: (propertyName: '_id' | '_createdDate' | 'details.benefits.itemSetId' | 'details.benefits.providerAppId' | 'namespace', value: any) => PoolDefinitionsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ lt: (propertyName: '_id' | '_createdDate' | 'details.benefits.itemSetId' | 'details.benefits.providerAppId' | 'namespace', value: any) => PoolDefinitionsQueryBuilder; /** @param propertyName - Property whose value is compared with `string`. * @param string - String to compare against. Case-insensitive. */ startsWith: (propertyName: '_id' | 'details.benefits.itemSetId' | 'details.benefits.providerAppId' | 'namespace', value: string) => PoolDefinitionsQueryBuilder; /** @param propertyName - Property whose value is compared with `values`. * @param values - List of values to compare against. */ hasSome: (propertyName: '_id' | '_createdDate' | 'programDefinitionIds' | 'details.benefits.itemSetId' | 'details.benefits.providerAppId' | 'namespace', value: any[]) => PoolDefinitionsQueryBuilder; /** @param propertyName - Property whose value is compared with `values`. * @param values - List of values to compare against. */ hasAll: (propertyName: 'programDefinitionIds', value: any[]) => PoolDefinitionsQueryBuilder; in: (propertyName: '_id' | '_createdDate' | 'programDefinitionIds' | 'details.benefits.itemSetId' | 'details.benefits.providerAppId' | 'namespace', value: any) => PoolDefinitionsQueryBuilder; exists: (propertyName: '_id' | '_createdDate' | 'programDefinitionIds' | 'details.benefits.itemSetId' | 'details.benefits.providerAppId' | 'namespace', value: boolean) => PoolDefinitionsQueryBuilder; /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */ ascending: (...propertyNames: Array<'_id' | '_createdDate' | 'programDefinitionIds' | 'details.benefits.itemSetId' | 'details.benefits.providerAppId' | 'namespace'>) => PoolDefinitionsQueryBuilder; /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */ descending: (...propertyNames: Array<'_id' | '_createdDate' | 'programDefinitionIds' | 'details.benefits.itemSetId' | 'details.benefits.providerAppId' | 'namespace'>) => PoolDefinitionsQueryBuilder; /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */ limit: (limit: number) => PoolDefinitionsQueryBuilder; /** @param cursor - A pointer to specific record */ skipTo: (cursor: string) => PoolDefinitionsQueryBuilder; find: () => Promise; } /** * @hidden * @fqn wix.benefit_programs.v1.pool_definition.PoolDefinitionService.QueryPoolDefinitions * @requiredField query */ declare function typedQueryPoolDefinitions(query: PoolDefinitionQuery, options?: QueryPoolDefinitionsOptions): Promise>; interface PoolDefinitionQuerySpec extends QuerySpec { paging: 'cursor'; wql: [ { fields: [ 'details.benefits.itemSetId', 'details.benefits.providerAppId', 'programDefinitionIds' ]; operators: ['$hasAll', '$hasSome']; sort: 'BOTH'; }, { fields: ['_createdDate', '_id', 'namespace']; operators: '*'; sort: 'BOTH'; } ]; } type CommonQueryWithEntityContext = Query; type PoolDefinitionQuery = { /** 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. @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. See [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language) for more information. */ filter?: CommonQueryWithEntityContext['filter'] | null; /** List of sort objects. @maxSize: 5 */ sort?: { /** Field to sort by. @maxLength: 512 */ fieldName?: NonNullable[number]['fieldName']; /** Sort order. Use `ASC` for ascending order or `DESC` for descending order. Default: `ASC` */ order?: NonNullable[number]['order']; }[]; }; declare const utils: { query: { QueryBuilder: () => _wix_sdk_types.QueryBuilder; Filter: _wix_sdk_types.FilterFactory; Sort: _wix_sdk_types.SortFactory; }; }; /** * Adds a pool definition to a program definition. * * Pool definitions can be contained by multiple program definitions, so this doesn't affect other program definitions that contain this pool definition. * @param poolDefinitionId - ID of the pool definition to add to the program definition. * @public * @requiredField options * @requiredField options.cascade * @requiredField options.programDefinitionId * @requiredField poolDefinitionId * @permissionId BENEFIT_PROGRAMS.POOL_DEFINITION_UPDATE * @applicableIdentity APP * @fqn wix.benefit_programs.v1.pool_definition.PoolDefinitionService.AddPoolDefinitionToProgramDefinition */ declare function addPoolDefinitionToProgramDefinition(poolDefinitionId: string, options: NonNullablePaths): Promise & { __validationErrorsType?: AddPoolDefinitionToProgramDefinitionValidationErrors; }>; interface AddPoolDefinitionToProgramDefinitionOptions { /** * ID of the program definition to add the pool definition to. * @format GUID */ programDefinitionId: string; /** Determines when the changes to this program definition and pool definition will be applied to associated programs and pools. */ cascade: CascadeWithLiterals; } /** * Removes a pool definition from a program definition. * * Pool definitions don't need to be contained by a program definition, so this doesn't affect the usability of this pool definition. * @param poolDefinitionId - ID of the pool definition to remove from the program definition. * @public * @requiredField options * @requiredField options.cascade * @requiredField options.programDefinitionId * @requiredField poolDefinitionId * @permissionId BENEFIT_PROGRAMS.POOL_DEFINITION_UPDATE * @applicableIdentity APP * @fqn wix.benefit_programs.v1.pool_definition.PoolDefinitionService.RemovePoolDefinitionFromProgramDefinition */ declare function removePoolDefinitionFromProgramDefinition(poolDefinitionId: string, options: NonNullablePaths): Promise & { __validationErrorsType?: RemovePoolDefinitionFromProgramDefinitionValidationErrors; }>; interface RemovePoolDefinitionFromProgramDefinitionOptions { /** * ID of the program definition to remove the pool definition from. * @format GUID */ programDefinitionId: string; /** Determines when the changes to this program definition and pool definition will be applied to associated programs and pools. */ cascade: CascadeWithLiterals; } /** * Retrieve all a program definition's pool definitions. * @param programDefinitionId - ID of the program definition to retrieve its pool definitions. * @public * @requiredField options * @requiredField options.namespace * @requiredField programDefinitionId * @permissionId BENEFIT_PROGRAMS.POOL_DEFINITION_READ * @applicableIdentity APP * @fqn wix.benefit_programs.v1.pool_definition.PoolDefinitionService.FindPoolDefinitionsByProgramDefinition */ declare function findPoolDefinitionsByProgramDefinition(programDefinitionId: string, options: NonNullablePaths): Promise>; interface FindPoolDefinitionsByProgramDefinitionOptions { /** * Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created. * @minLength 1 * @maxLength 20 */ namespace: string; } export { type AccountInfo, type ActionEvent, type AddPoolDefinitionToProgramDefinitionOptions, type AddPoolDefinitionToProgramDefinitionRequest, type AddPoolDefinitionToProgramDefinitionResponse, type AddPoolDefinitionToProgramDefinitionValidationErrors, type ApplicationError, type Benefit, type BulkActionMetadata, type BulkCreatePoolDefinitionsOptions, type BulkCreatePoolDefinitionsRequest, type BulkCreatePoolDefinitionsResponse, type BulkDeletePoolDefinitionsOptions, type BulkDeletePoolDefinitionsRequest, type BulkDeletePoolDefinitionsResponse, type BulkPoolDefinitionResult, type BulkUpdatePoolDefinitionsOptions, type BulkUpdatePoolDefinitionsRequest, type BulkUpdatePoolDefinitionsResponse, type BulkUpdatePoolDefinitionsValidationErrors, Cascade, type CascadeWithLiterals, type CommonQueryWithEntityContext, type CreatePoolDefinitionOptions, type CreatePoolDefinitionRequest, type CreatePoolDefinitionResponse, type CreditConfiguration, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type CustomPolicy, type DeletePoolDefinitionRequest, type DeletePoolDefinitionResponse, type Details, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type ExtendedFields, type FindPoolDefinitionsByProgramDefinitionOptions, type FindPoolDefinitionsByProgramDefinitionRequest, type FindPoolDefinitionsByProgramDefinitionResponse, type FixedIntervalPolicy, type GetPoolDefinitionRequest, type GetPoolDefinitionResponse, type IdentificationData, type IdentificationDataIdOneOf, type ItemMetadata, type MaskedPoolDefinition, type MessageEnvelope, type Policy, type PolicyExpression, type PolicyExpressionAnd, type PolicyExpressionExpressionOneOf, type PolicyExpressionNot, type PolicyExpressionOr, PolicyExpressionType, type PolicyExpressionTypeWithLiterals, type PolicyPolicyOneOf, type PoolDefinition, type PoolDefinitionAddedToProgramDefinition, type PoolDefinitionDeletedProxySupport, type PoolDefinitionQuery, type PoolDefinitionQuerySpec, type PoolDefinitionRemovedFromProgramDefinition, type PoolDefinitionTranslated, type PoolDefinitionTranslationDeleted, type PoolDefinitionUpdatedProxySupport, type PoolDefinitionsQueryBuilder, type PoolDefinitionsQueryResult, type ProgramDefinitionInfo, type QueryPoolDefinitionsOptions, type QueryPoolDefinitionsRequest, type QueryPoolDefinitionsResponse, type RateLimitedPolicy, type RemovePoolDefinitionFromProgramDefinitionOptions, type RemovePoolDefinitionFromProgramDefinitionRequest, type RemovePoolDefinitionFromProgramDefinitionResponse, type RemovePoolDefinitionFromProgramDefinitionValidationErrors, type RestoreInfo, type RolloverConfiguration, SortOrder, type SortOrderWithLiterals, type Sorting, TimePeriod, type TimePeriodWithLiterals, Type, type TypeWithLiterals, type UpdatePoolDefinition, type UpdatePoolDefinitionOptions, type UpdatePoolDefinitionRequest, type UpdatePoolDefinitionResponse, type UpdatePoolDefinitionValidationErrors, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, WeekDay, type WeekDayWithLiterals, addPoolDefinitionToProgramDefinition, bulkCreatePoolDefinitions, bulkDeletePoolDefinitions, bulkUpdatePoolDefinitions, createPoolDefinition, deletePoolDefinition, findPoolDefinitionsByProgramDefinition, getPoolDefinition, queryPoolDefinitions, removePoolDefinitionFromProgramDefinition, typedQueryPoolDefinitions, updatePoolDefinition, utils };