import * as _wix_sdk_types from '@wix/sdk-types'; import { QuerySpec, Query, NonNullablePaths } from '@wix/sdk-types'; /** A function is the main entity in the Wix Functions ecosystem. All other entities are used to create functions or to define their behavior. Learn more about [Functions](https://support.wix.com/en/wix-functions). */ interface _Function { /** * Function ID. * @format GUID * @readonly */ _id?: string | null; /** * Revision number, which increments by 1 each time the function is updated. * To prevent conflicting changes, * the current revision must be passed when updating the function. * * Ignored when creating a function. * @readonly */ revision?: string | null; /** * Date and time the function was created. * @readonly */ _createdDate?: Date | null; /** * Date and time the function was last updated. * @readonly */ _updatedDate?: Date | null; /** * ID of the function type that defines when and how the function runs. This is the function type that the function is based on. * @format GUID */ functionExtensionId?: string | null; /** * Display name for the function in the dashboard's function builder. * @maxLength 100 */ functionName?: string | null; /** * Activation status. * @readonly */ activationStatus?: ActivationStatusWithLiterals; /** * ID of the Wix app that defines the function type that the function is based on. * @format GUID */ appId?: string | null; /** * Display name of the function type. * @minLength 1 * @maxLength 100 */ functionExtensionName?: string | null; /** * External IDs that link the function to other entities. * @internal * @format GUID * @maxSize 100 * @readonly */ externalIds?: string[] | null; /** * ID of the function template used to create this function. * @format GUID */ functionTemplateExtensionId?: string | null; /** * ID of the form template used to create this function. Included if the function was created using the [Builderless Productions](https://dev.wix.com/docs/api-reference/business-management/functions/builderless-productions/introduction) API. * @format GUID */ formTemplateExtensionId?: string | null; /** Whether the function has changes that were made since it was last activated. */ hasUnpublishedChanges?: boolean | null; /** Tags assigned to the function for organization and filtering. */ tags?: Tags; } declare enum ActivationStatus { /** Function is active and runs when triggered. */ ACTIVE = "ACTIVE", /** Function is inactive and doesn't run when triggered. */ INACTIVE = "INACTIVE", /** Function is saved but has never been activated. */ DRAFT = "DRAFT" } /** @enumType */ type ActivationStatusWithLiterals = ActivationStatus | 'ACTIVE' | 'INACTIVE' | 'DRAFT'; /** * Common object for tags. * Should be use as in this example: * message Foo { * option (.wix.api.decomposite_of) = "wix.commons.v2.tags.Foo"; * string id = 1; * ... * Tags tags = 5 * } * * example of taggable entity * { * id: "123" * tags: { * public_tags: { * tag_ids:["11","22"] * }, * private_tags: { * tag_ids: ["33", "44"] * } * } * } */ interface Tags { /** Tags that require an additional permission in order to access them, typically restricted from site members and visitors. */ privateTags?: TagList; /** Tags that are exposed to anyone with access to the entity, including site members and visitors. */ publicTags?: TagList; } interface TagList { /** * List of tag IDs. * @maxSize 100 * @maxLength 5 */ tagIds?: string[]; } interface DraftDiscarded { /** * Function ID associated with the discarded draft * @format GUID */ functionId?: string; /** Date and time when the draft was discarded */ discardedDate?: Date | null; } interface TagsModified { /** Updated function. */ function?: _Function; /** Tags that were assigned to the Function. */ assignedTags?: Tags; /** Tags that were unassigned from the Function. */ unassignedTags?: Tags; } interface CreateFunctionRequest { /** Function to create. */ function: _Function; } interface CreateFunctionResponse { /** The created function. */ function?: _Function; } interface GetFunctionRequest { /** * ID of the function to retrieve. * @format GUID */ functionId: string; } interface GetFunctionResponse { /** The retrieved function. */ function?: _Function; } interface UpdateFunctionRequest { /** Function to update. */ function: _Function; /** * Set of fields to update. * * Fields that aren't included in `fieldMask.paths` are ignored. * @internal */ fieldMask?: string[]; } interface UpdateFunctionResponse { /** Updated function. */ function?: _Function; } interface DeleteFunctionRequest { /** * ID of the function to delete. * @format GUID */ functionId: string; } interface DeleteFunctionResponse { } interface QueryFunctionsRequest { /** Wix Query Language expression. */ 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 QueryFunctionsResponse { /** List of retrieved functions. */ functions?: _Function[]; /** Metadata for the paginated results. */ pagingMetadata?: 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 ListValuesByFieldRequest { /** * Field to list values for. * @minLength 1 * @maxLength 100 */ field?: string; } interface ListValuesByFieldResponse { /** * List of values for the field. * @maxSize 100 */ fieldAndCount?: FieldAndCount[]; } interface FieldAndCount { /** * Field value. * @minLength 1 * @maxLength 100 */ field?: string; /** Number of times the value occurs. */ count?: number; } 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 UpdateFunctionExternalIdsRequest { /** * ID of the function to update. * @format GUID */ functionId?: string; /** * External ids to set. * @format GUID * @maxSize 100 */ externalIds?: string[]; } interface UpdateFunctionExternalIdsResponse { /** The updated function. */ function?: _Function; } interface BulkUpdateFunctionTagsRequest { /** * IDs of functions to update tags for. * @minSize 1 * @maxSize 100 * @format GUID */ ids: string[]; /** List of tags to assign. */ assignTags: Tags; /** List of tags to unassign. */ unassignTags?: Tags; } interface BulkUpdateFunctionTagsResponse { /** * Results. * @minSize 1 * @maxSize 100 */ results?: BulkUpdateFunctionTagsResult[]; /** Bulk action metadata. */ bulkActionMetadata?: BulkActionMetadata; } interface ItemMetadata { /** * Item ID. Provided only whenever possible. For example, `itemId` can't be provided when item creation has failed. * @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 for this item was successful. When `false`, the `error` field is returned. */ 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 BulkUpdateFunctionTagsResult { /** Item metadata. */ itemMetadata?: ItemMetadata; } 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 BulkUpdateFunctionTagsByFilterRequest { /** Filter. */ filter: Record | null; /** List of tags to assign. */ assignTags: Tags; /** List of tags to unassign. */ unassignTags?: Tags; } interface BulkUpdateFunctionTagsByFilterResponse { /** * Job ID for the bulk update operation. * @format GUID */ jobId?: 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 BulkUpdateFunctionTagsApplicationErrors = { code?: 'EMPTY_ASSIGN_AND_UNASSIGN_LISTS'; description?: string; data?: Record; }; /** @docsIgnore */ type BulkUpdateFunctionTagsByFilterApplicationErrors = { code?: 'EMPTY_ASSIGN_AND_UNASSIGN_LISTS'; 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?: IdentificationData; /** 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 FunctionCreatedEnvelope { entity: _Function; metadata: EventMetadata; } /** * Triggered when a function is created. * @permissionScope Manage_Wix_Rentals_App_Forms_submissions * @permissionScopeId SCOPE.RENTALS.MANAGE * @permissionScope Manage Stores * @permissionScopeId SCOPE.STORES.MANAGE-STORES * @permissionScope View Forms * @permissionScopeId SCOPE.FORMS.VIEW-FORM * @permissionScope Manage form submissions. * @permissionScopeId SCOPE.FORMS.MANAGE-SUBMISSIONS * @permissionScope Manage forms * @permissionScopeId SCOPE.FORMS.EDIT-FORM * @permissionScope Manage Events * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS * @permissionScope Manage Functions * @permissionScopeId SCOPE.DC-FUNCTIONS.MANAGE-FUNCTIONS * @permissionScope Manage Restaurants - all permissions * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES * @permissionScope Set Up Automations * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS * @permissionId FUNCTIONS.FUNCTION_READ * @webhook * @eventType wix.functions.v1.function_created * @slug created */ declare function onFunctionCreated(handler: (event: FunctionCreatedEnvelope) => void | Promise): void; interface FunctionDeletedEnvelope { entity: _Function; metadata: EventMetadata; } /** * Triggered when a function is deleted. * @permissionScope Manage_Wix_Rentals_App_Forms_submissions * @permissionScopeId SCOPE.RENTALS.MANAGE * @permissionScope Manage Stores * @permissionScopeId SCOPE.STORES.MANAGE-STORES * @permissionScope View Forms * @permissionScopeId SCOPE.FORMS.VIEW-FORM * @permissionScope Manage form submissions. * @permissionScopeId SCOPE.FORMS.MANAGE-SUBMISSIONS * @permissionScope Manage forms * @permissionScopeId SCOPE.FORMS.EDIT-FORM * @permissionScope Manage Events * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS * @permissionScope Manage Functions * @permissionScopeId SCOPE.DC-FUNCTIONS.MANAGE-FUNCTIONS * @permissionScope Manage Restaurants - all permissions * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES * @permissionScope Set Up Automations * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS * @permissionId FUNCTIONS.FUNCTION_READ * @webhook * @eventType wix.functions.v1.function_deleted * @slug deleted */ declare function onFunctionDeleted(handler: (event: FunctionDeletedEnvelope) => void | Promise): void; interface FunctionTagsModifiedEnvelope { data: TagsModified; metadata: EventMetadata; } /** * Triggered when tags are modified. * @permissionScope Manage_Wix_Rentals_App_Forms_submissions * @permissionScopeId SCOPE.RENTALS.MANAGE * @permissionScope Manage Stores * @permissionScopeId SCOPE.STORES.MANAGE-STORES * @permissionScope View Forms * @permissionScopeId SCOPE.FORMS.VIEW-FORM * @permissionScope Manage form submissions. * @permissionScopeId SCOPE.FORMS.MANAGE-SUBMISSIONS * @permissionScope Manage forms * @permissionScopeId SCOPE.FORMS.EDIT-FORM * @permissionScope Manage Events * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS * @permissionScope Manage Functions * @permissionScopeId SCOPE.DC-FUNCTIONS.MANAGE-FUNCTIONS * @permissionScope Manage Restaurants - all permissions * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES * @permissionScope Set Up Automations * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS * @permissionId FUNCTIONS.FUNCTION_READ * @webhook * @eventType wix.functions.v1.function_tags_modified * @slug tags_modified */ declare function onFunctionTagsModified(handler: (event: FunctionTagsModifiedEnvelope) => void | Promise): void; interface FunctionUpdatedEnvelope { entity: _Function; metadata: EventMetadata; /** @hidden */ modifiedFields: Record; } /** * Triggered when a function is updated. * @permissionScope Manage_Wix_Rentals_App_Forms_submissions * @permissionScopeId SCOPE.RENTALS.MANAGE * @permissionScope Manage Stores * @permissionScopeId SCOPE.STORES.MANAGE-STORES * @permissionScope View Forms * @permissionScopeId SCOPE.FORMS.VIEW-FORM * @permissionScope Manage form submissions. * @permissionScopeId SCOPE.FORMS.MANAGE-SUBMISSIONS * @permissionScope Manage forms * @permissionScopeId SCOPE.FORMS.EDIT-FORM * @permissionScope Manage Events * @permissionScopeId SCOPE.EVENTS.MANAGE-EVENTS * @permissionScope Manage Functions * @permissionScopeId SCOPE.DC-FUNCTIONS.MANAGE-FUNCTIONS * @permissionScope Manage Restaurants - all permissions * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES * @permissionScope Set Up Automations * @permissionScopeId SCOPE.CRM.SETUP-AUTOMATIONS * @permissionId FUNCTIONS.FUNCTION_READ * @webhook * @eventType wix.functions.v1.function_updated * @slug updated */ declare function onFunctionUpdated(handler: (event: FunctionUpdatedEnvelope) => void | Promise): void; /** * Creates a function with the specified configuration. After creation, you'll need to attach automation logic using the Function Methods API and configure any required service plugin settings before the function can be activated. * * This isn't the recommended way to create a function. Learn more about [function creation](https://dev.wix.com/docs/api-reference/business-management/functions/about-function-creation-and-activation#quick-creation-and-configuration). * @param _function - Function to create. * @public * @requiredField function * @requiredField function.appId * @requiredField function.functionExtensionId * @permissionId FUNCTIONS.FUNCTION_CREATE * @applicableIdentity APP * @returns The created function. * @fqn wix.functions.api.v1.Functions.CreateFunction */ declare function createFunction(_function?: _Function): Promise>; /** * Retrieves a function. * @param functionId - ID of the function to retrieve. * @public * @requiredField functionId * @permissionId FUNCTIONS.FUNCTION_READ * @applicableIdentity APP * @returns The retrieved function. * @fqn wix.functions.api.v1.Functions.GetFunction */ declare function getFunction(functionId: string): Promise>; /** * Updates a function. * * Each time the function is updated, * `revision` increments by 1. * The existing `revision` must be passed when updating the function. * This ensures you're working with the latest version of the function * and prevents unintended overwrites. * @param _id - Function ID. * @public * @requiredField _id * @requiredField function * @requiredField function.revision * @permissionId FUNCTIONS.FUNCTION_UPDATE * @applicableIdentity APP * @returns Updated function. * @fqn wix.functions.api.v1.Functions.UpdateFunction */ declare function updateFunction(_id: string, _function?: UpdateFunction): Promise>; interface UpdateFunction { /** * Function ID. * @format GUID * @readonly */ _id?: string | null; /** * Revision number, which increments by 1 each time the function is updated. * To prevent conflicting changes, * the current revision must be passed when updating the function. * * Ignored when creating a function. * @readonly */ revision?: string | null; /** * Date and time the function was created. * @readonly */ _createdDate?: Date | null; /** * Date and time the function was last updated. * @readonly */ _updatedDate?: Date | null; /** * ID of the function type that defines when and how the function runs. This is the function type that the function is based on. * @format GUID */ functionExtensionId?: string | null; /** * Display name for the function in the dashboard's function builder. * @maxLength 100 */ functionName?: string | null; /** * Activation status. * @readonly */ activationStatus?: ActivationStatusWithLiterals; /** * ID of the Wix app that defines the function type that the function is based on. * @format GUID */ appId?: string | null; /** * Display name of the function type. * @minLength 1 * @maxLength 100 */ functionExtensionName?: string | null; /** * External IDs that link the function to other entities. * @internal * @format GUID * @maxSize 100 * @readonly */ externalIds?: string[] | null; /** * ID of the function template used to create this function. * @format GUID */ functionTemplateExtensionId?: string | null; /** * ID of the form template used to create this function. Included if the function was created using the [Builderless Productions](https://dev.wix.com/docs/api-reference/business-management/functions/builderless-productions/introduction) API. * @format GUID */ formTemplateExtensionId?: string | null; /** Whether the function has changes that were made since it was last activated. */ hasUnpublishedChanges?: boolean | null; /** Tags assigned to the function for organization and filtering. */ tags?: Tags; } /** * Deletes a function. * * Deleting a function permanently removes it from the Function List * in the site's dashboard. * @param functionId - ID of the function to delete. * @public * @requiredField functionId * @permissionId FUNCTIONS.FUNCTION_DELETE * @applicableIdentity APP * @fqn wix.functions.api.v1.Functions.DeleteFunction */ declare function deleteFunction(functionId: string): Promise; /** * Creates a query to retrieve a list of functions. * * The Query Functions method builds a query to retrieve a list of functions and returns a `FunctionsQueryBuilder` 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 `FunctionsQueryBuilder` methods onto the query. `FunctionsQueryBuilder` methods enable you to filter, sort, and control the results that Query Functions returns. * * Query Functions 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 `FunctionsQueryResult`. * @public * @permissionId FUNCTIONS.FUNCTION_READ * @applicableIdentity APP * @fqn wix.functions.api.v1.Functions.QueryFunctions */ declare function queryFunctions(): FunctionsQueryBuilder; interface QueryCursorResult { cursors: Cursors; hasNext: () => boolean; hasPrev: () => boolean; length: number; pageSize: number; } interface FunctionsQueryResult extends QueryCursorResult { items: _Function[]; query: FunctionsQueryBuilder; next: () => Promise; prev: () => Promise; } interface FunctionsQueryBuilder { /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ eq: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'functionExtensionId' | 'functionName' | 'activationStatus' | 'appId' | 'functionExtensionName', value: any) => FunctionsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ ne: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'functionExtensionId' | 'functionName' | 'activationStatus' | 'appId' | 'functionExtensionName', value: any) => FunctionsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ ge: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'functionExtensionId' | 'functionName' | 'appId' | 'functionExtensionName', value: any) => FunctionsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ gt: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'functionExtensionId' | 'functionName' | 'appId' | 'functionExtensionName', value: any) => FunctionsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ le: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'functionExtensionId' | 'functionName' | 'appId' | 'functionExtensionName', value: any) => FunctionsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ lt: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'functionExtensionId' | 'functionName' | 'appId' | 'functionExtensionName', value: any) => FunctionsQueryBuilder; /** @param propertyName - Property whose value is compared with `string`. * @param string - String to compare against. Case-insensitive. */ startsWith: (propertyName: '_id' | 'functionExtensionId' | 'functionName' | 'appId' | 'functionExtensionName', value: string) => FunctionsQueryBuilder; /** @param propertyName - Property whose value is compared with `values`. * @param values - List of values to compare against. */ hasSome: (propertyName: string, value: any[]) => FunctionsQueryBuilder; /** @param propertyName - Property whose value is compared with `values`. * @param values - List of values to compare against. */ hasAll: (propertyName: string, value: any[]) => FunctionsQueryBuilder; in: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'functionExtensionId' | 'functionName' | 'activationStatus' | 'appId' | 'functionExtensionName', value: any) => FunctionsQueryBuilder; exists: (propertyName: '_id' | '_createdDate' | '_updatedDate' | 'functionExtensionId' | 'functionName' | 'activationStatus' | 'appId' | 'functionExtensionName', value: boolean) => FunctionsQueryBuilder; /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */ ascending: (...propertyNames: Array<'_id' | '_createdDate' | '_updatedDate' | 'functionExtensionId' | 'functionName' | 'activationStatus' | 'appId' | 'functionExtensionName'>) => FunctionsQueryBuilder; /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */ descending: (...propertyNames: Array<'_id' | '_createdDate' | '_updatedDate' | 'functionExtensionId' | 'functionName' | 'activationStatus' | 'appId' | 'functionExtensionName'>) => FunctionsQueryBuilder; /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */ limit: (limit: number) => FunctionsQueryBuilder; /** @param cursor - A pointer to specific record */ skipTo: (cursor: string) => FunctionsQueryBuilder; find: () => Promise; } /** * @hidden * @fqn wix.functions.api.v1.Functions.QueryFunctions * @requiredField query */ declare function typedQueryFunctions(query: _FunctionQuery): Promise>; interface _FunctionQuerySpec extends QuerySpec { paging: 'cursor'; wql: [ { fields: [ '_createdDate', '_id', '_updatedDate', 'activationStatus', 'appId', 'functionExtensionId', 'functionExtensionName', 'functionName' ]; operators: '*'; sort: 'BOTH'; } ]; } type CommonQueryWithEntityContext = Query<_Function, _FunctionQuerySpec>; type _FunctionQuery = { /** 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<_Function, _FunctionQuerySpec, _FunctionQuery>; }; /** * Synchronously update tags on multiple functions. * A tag that appears both the list to assign and the list to unassign tags, will be assigned. * @param ids - IDs of functions to update tags for. * @public * @requiredField ids * @requiredField options.assignTags * @permissionId FUNCTIONS.FUNCTION_UPDATE_TAGS * @applicableIdentity APP * @fqn wix.functions.api.v1.Functions.BulkUpdateFunctionTags */ declare function bulkUpdateFunctionTags(ids: string[], options?: NonNullablePaths): Promise & { __applicationErrorsType?: BulkUpdateFunctionTagsApplicationErrors; }>; interface BulkUpdateFunctionTagsOptions { /** List of tags to assign. */ assignTags: Tags; /** List of tags to unassign. */ unassignTags?: Tags; } /** * Asynchronously update tags on multiple functions. * An empty filter updates all functions. * A tag that appears both the list to assign and the list to unassign tags, will be assigned. * @param filter - Filter. * @public * @requiredField filter * @requiredField options.assignTags * @permissionId FUNCTIONS.FUNCTION_UPDATE_TAGS * @applicableIdentity APP * @fqn wix.functions.api.v1.Functions.BulkUpdateFunctionTagsByFilter */ declare function bulkUpdateFunctionTagsByFilter(filter: Record, options?: NonNullablePaths): Promise & { __applicationErrorsType?: BulkUpdateFunctionTagsByFilterApplicationErrors; }>; interface BulkUpdateFunctionTagsByFilterOptions { /** List of tags to assign. */ assignTags: Tags; /** List of tags to unassign. */ unassignTags?: Tags; } export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, ActivationStatus, type ActivationStatusWithLiterals, type ApplicationError, type BaseEventMetadata, type BulkActionMetadata, type BulkUpdateFunctionTagsApplicationErrors, type BulkUpdateFunctionTagsByFilterApplicationErrors, type BulkUpdateFunctionTagsByFilterOptions, type BulkUpdateFunctionTagsByFilterRequest, type BulkUpdateFunctionTagsByFilterResponse, type BulkUpdateFunctionTagsOptions, type BulkUpdateFunctionTagsRequest, type BulkUpdateFunctionTagsResponse, type BulkUpdateFunctionTagsResult, type CommonQueryWithEntityContext, type CreateFunctionRequest, type CreateFunctionResponse, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DeleteFunctionRequest, type DeleteFunctionResponse, type DomainEvent, type DomainEventBodyOneOf, type DraftDiscarded, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type FieldAndCount, type FunctionCreatedEnvelope, type FunctionDeletedEnvelope, type FunctionTagsModifiedEnvelope, type FunctionUpdatedEnvelope, type FunctionsQueryBuilder, type FunctionsQueryResult, type GetFunctionRequest, type GetFunctionResponse, type IdentificationData, type IdentificationDataIdOneOf, type ItemMetadata, type ListValuesByFieldRequest, type ListValuesByFieldResponse, type MessageEnvelope, type QueryFunctionsRequest, type QueryFunctionsResponse, type RestoreInfo, SortOrder, type SortOrderWithLiterals, type Sorting, type TagList, type Tags, type TagsModified, type UpdateFunction, type UpdateFunctionExternalIdsRequest, type UpdateFunctionExternalIdsResponse, type UpdateFunctionRequest, type UpdateFunctionResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, type _Function, type _FunctionQuery, type _FunctionQuerySpec, bulkUpdateFunctionTags, bulkUpdateFunctionTagsByFilter, createFunction, deleteFunction, getFunction, onFunctionCreated, onFunctionDeleted, onFunctionTagsModified, onFunctionUpdated, queryFunctions, typedQueryFunctions, updateFunction, utils };