import * as _wix_sdk_types from '@wix/sdk-types'; import { QuerySpec, Query as Query$1, NonNullablePaths } from '@wix/sdk-types'; interface Location { /** * Location ID. * @format GUID * @readonly */ _id?: string | null; /** * Location name. * @maxLength 150 */ name?: string; /** * Location description. * @maxLength 500 */ description?: string | null; /** * Whether this is the default location. There can only be one default location per site. The default location can't be archived. * @readonly */ default?: boolean; /** * Location status. Defaults to `ACTIVE`. * __Notes:__ * - [Archiving a location](https://dev.wix.com/api/rest/business-info/locations/archive-location) * doesn't affect the location's status. * - `INACTIVE` status is currently not supported. */ status?: LocationStatusWithLiterals; /** * Location type. * * **Note:** Currently not supported. * @deprecated */ locationType?: LocationTypeWithLiterals; /** Fax number. */ fax?: string | null; /** Timezone in `America/New_York` format. */ timeZone?: string | null; /** Email address. */ email?: string | null; /** Phone number. */ phone?: string | null; /** Address. */ address?: Address; /** * Business schedule. Array of weekly recurring time periods when the location is open for business. Limited to 100 time periods. * * __Note:__ Not supported by Wix Bookings. */ businessSchedule?: BusinessSchedule; /** * Revision number, which increments by 1 each time the location is updated. * To prevent conflicting changes, the existing revision must be used when updating a location. */ revision?: string | null; /** * Whether the location is archived. Archived locations can't be updated. * __Note:__ [Archiving a location](https://dev.wix.com/api/rest/business-info/locations/archive-location) * doesn't affect its `status`. * @readonly */ archived?: boolean; /** * Location types. * @maxSize 10 */ locationTypes?: LocationTypeWithLiterals[]; /** Extended fields for data extensions. */ extendedFields?: ExtendedFields; } /** For future use */ declare enum LocationStatus { ACTIVE = "ACTIVE", INACTIVE = "INACTIVE" } /** @enumType */ type LocationStatusWithLiterals = LocationStatus | 'ACTIVE' | 'INACTIVE'; /** For future use */ declare enum LocationType { UNKNOWN = "UNKNOWN", BRANCH = "BRANCH", OFFICES = "OFFICES", RECEPTION = "RECEPTION", HEADQUARTERS = "HEADQUARTERS", INVENTORY = "INVENTORY" } /** @enumType */ type LocationTypeWithLiterals = LocationType | 'UNKNOWN' | 'BRANCH' | 'OFFICES' | 'RECEPTION' | 'HEADQUARTERS' | 'INVENTORY'; interface Address { /** * 2-letter country code in an [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format. * @format COUNTRY */ country?: string | null; /** Code for a subdivision (such as state, prefecture, or province) in [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) format. */ subdivision?: string | null; /** City name. */ city?: string | null; /** * Postal or zip code. * @maxLength 20 */ postalCode?: string | null; /** Street address. Includes street name, number, and apartment number in separate fields. */ streetAddress?: StreetAddress; /** Full address of the location. */ formatted?: string | null; /** * Extra information that helps finding the location. * @maxLength 500 */ hint?: string | null; /** Geographic coordinates of location. */ location?: AddressLocation; } /** Street address. Includes street name, number, and apartment number in separate fields. */ interface StreetAddress { /** Street number. */ number?: string; /** Street name. */ name?: string; /** Apartment number. */ apt?: string; } /** Address Geolocation */ interface AddressLocation { /** Latitude of the location. Must be between -90 and 90. */ latitude?: number | null; /** Longitude of the location. Must be between -180 and 180. */ longitude?: number | null; } /** Business schedule. Regular and exceptional time periods when the business is open or the service is available. */ interface BusinessSchedule { /** * Weekly recurring time periods when the business is regularly open or the service is available. Limited to 100 time periods. * @maxSize 100 */ periods?: TimePeriod[]; /** * Exceptions to the business's regular hours. The business can be open or closed during the exception. * @maxSize 100 */ specialHourPeriod?: SpecialHourPeriod[]; } /** Weekly recurring time periods when the business is regularly open or the service is available. */ interface TimePeriod { /** Day of the week the period starts on. */ openDay?: DayOfWeekWithLiterals; /** * Time the period starts in 24-hour [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) extended format. Valid values are `00:00` to `24:00`, where `24:00` represents * midnight at the end of the specified day. */ openTime?: string; /** Day of the week the period ends on. */ closeDay?: DayOfWeekWithLiterals; /** * Time the period ends in 24-hour [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) extended format. Valid values are `00:00` to `24:00`, where `24:00` represents * midnight at the end of the specified day. * * __Note:__ If `openDay` and `closeDay` specify the same day of the week `closeTime` must be later than `openTime`. */ closeTime?: string; } /** Enumerates the days of the week. */ declare enum DayOfWeek { MONDAY = "MONDAY", TUESDAY = "TUESDAY", WEDNESDAY = "WEDNESDAY", THURSDAY = "THURSDAY", FRIDAY = "FRIDAY", SATURDAY = "SATURDAY", SUNDAY = "SUNDAY" } /** @enumType */ type DayOfWeekWithLiterals = DayOfWeek | 'MONDAY' | 'TUESDAY' | 'WEDNESDAY' | 'THURSDAY' | 'FRIDAY' | 'SATURDAY' | 'SUNDAY'; /** Exception to the business's regular hours. The business can be open or closed during the exception. */ interface SpecialHourPeriod { /** Start date and time of the exception in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format and [Coordinated Universal Time (UTC)](https://en.wikipedia.org/wiki/Coordinated_Universal_Time). */ startDate?: string; /** End date and time of the exception in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format and [Coordinated Universal Time (UTC)](https://en.wikipedia.org/wiki/Coordinated_Universal_Time). */ endDate?: string; /** * Whether the business is closed (or the service is not available) during the exception. * * Default: `true`. */ isClosed?: boolean; /** Additional info about the exception. For example, "We close earlier on New Year's Eve." */ comment?: string; } 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 CreateLocationRequest { /** Location to create. */ location: Location; } interface CreateLocationResponse { /** Created location. */ location?: Location; } interface BulkCreateLocationRequest { /** * Locations to create. * @minSize 1 * @maxSize 10 */ locations: Location[]; } interface BulkCreateLocationResponse { /** Locations that were created. */ successfulLocations?: Location[]; /** Locations that failed. */ failedLocations?: FailedCreateLocation[]; } interface FailedCreateLocation { /** Location that couldn't be created. */ location?: Location; /** Error message. */ errorMessage?: string; } interface GetLocationRequest { /** * ID of the location to retrieve. * @format GUID */ _id: string; } interface GetLocationResponse { /** Retrieved location. */ location?: Location; /** True if the requesting entity is permitted to manage the location */ locationManagementAuthorized?: boolean; } interface ListLocationsRequest { /** Sort order. */ sort?: Sorting; /** * Pagination. * * Default values: * `offset`: 0 * `limit`: 50 (Max: 1000) */ paging?: Paging; /** * Whether to include `archived` locations in the response. * * Default: `false` */ includeArchived?: boolean; /** Whether to filter only authorized locations */ filterAuthorizedLocationEntities?: boolean; } 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 Paging { /** * Number of items to load. * * Default: `50` * * Max: `1000` */ limit?: number | null; /** * Number of items to skip in the current sort order. * * Default: `0` */ offset?: number | null; } interface ListLocationsResponse { /** Retrieved locations. */ locations?: Location[]; /** Paging info. */ pagingMetadata?: PagingMetadata; /** * Ids of the locations that the requesting entity can manage * @format GUID * @maxSize 100 */ authorizedLocationEntities?: string[] | null; } interface PagingMetadata { /** Number of items returned in the response. */ count?: number | null; /** Offset that was requested. */ offset?: number | null; /** * Indicates if there are more results after the current page. * If `true`, another page of results can be retrieved. * If `false`, this is the last page. */ hasNext?: boolean | null; } interface UpdateLocationRequest { /** Location to update. */ location: Location; } interface UpdateLocationResponse { /** Updated location. */ location?: Location; } interface BulkUpdateLocationRequest { /** * Locations to update. * @minSize 1 * @maxSize 10 */ locations?: Location[]; } interface BulkUpdateLocationResponse { /** Locations that were updated. */ successfulLocations?: Location[]; /** Locations that failed. */ failedLocations?: FailedUpdateLocation[]; } interface FailedUpdateLocation { /** Location that couldn't be updated. */ _id?: string; /** Error message. */ errorMessage?: string; } interface QueryLocationsRequest { /** Information about the filters, sorting, and paging. */ query?: Query; /** Whether to filter only authorized locations */ filterAuthorizedLocationEntities?: boolean; } interface Query { /** * 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?: any; /** * Sort object in the following format: * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]` */ sort?: Sorting[]; /** Paging options to limit and skip the number of items. */ paging?: Paging; /** Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. */ fields?: string[]; /** Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. */ fieldsets?: string[]; } interface QueryLocationsResponse { /** Retrieved locations. */ locations?: Location[]; /** Paging info. */ pagingMetadata?: PagingMetadata; /** * Ids of the locations that the requesting entity can manage * @format GUID * @maxSize 100 */ authorizedLocationEntities?: string[] | null; } interface GetOrCreateDefaultLocationRequest { } interface GetOrCreateDefaultLocationResponse { /** Default location (one that already exists or the one that was created) */ location?: Location; } interface SetDefaultLocationRequest { /** * ID of the location to set as the default location. * @format GUID */ _id: string; } interface SetDefaultLocationResponse { /** New default location. */ location?: Location; } interface SetDefaultLocation { /** * Previous default location id. * @format GUID */ prevDefaultLocationId?: string; /** * Current default location id. * @format GUID */ currDefaultLocationId?: string; } interface ArchiveLocationRequest { /** * ID of the location to archive. * @format GUID */ _id: string; } interface ArchiveLocationResponse { /** Archived location. */ location?: Location; } interface ArchiveLocation { /** @format GUID */ _id?: string; } interface UnarchiveLocationRequest { /** * ID of the location to unarchive. * @format GUID */ _id?: string; } interface UnarchiveLocationResponse { /** Unarchived location. */ location?: Location; } interface AddTypeToLocationRequest { /** * ID of the location where the type will be added. * @format GUID */ _id: string; /** Location type to add. */ locationType: LocationTypeWithLiterals; } interface AddTypeToLocationResponse { /** Updated location. */ location?: Location; } interface RemoveTypeFromLocationRequest { /** * ID of the location where the type will be removed. * @format GUID */ _id: string; /** Location type to remove. */ locationType: LocationTypeWithLiterals; } interface RemoveTypeFromLocationResponse { /** Updated location. */ location?: Location; } interface MetasiteLocationsRequest { } interface MetasiteLocationsResponse { } interface AddLocationTypeRequest { /** * Location id to add type * @format GUID */ _id: string; locationType: LocationTypeWithLiterals; } interface AddLocationTypeResponse { /** Full location with the new type */ location?: Location; } interface RemoveLocationTypeRequest { /** * Location id to add type * @format GUID */ _id: string; locationType: LocationTypeWithLiterals; } interface RemoveLocationTypeResponse { /** Full location with the new type */ location?: Location; } 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 CreateLocationApplicationErrors = { code?: 'CANNOT_PERFORM_ACTION_ON_ARCHIVED_LOCATION'; description?: string; data?: Record; }; /** @docsIgnore */ type UpdateLocationApplicationErrors = { code?: 'CANNOT_PERFORM_ACTION_ON_ARCHIVED_LOCATION'; description?: string; data?: Record; } | { code?: 'CANNOT_ARCHIVE_DEFAULT'; description?: string; data?: Record; } | { code?: 'LOCATION_NOT_FOUND'; description?: string; data?: Record; }; /** @docsIgnore */ type SetDefaultLocationApplicationErrors = { code?: 'CANNOT_PERFORM_ACTION_ON_ARCHIVED_LOCATION'; description?: string; data?: Record; } | { code?: 'DEFAULT_NOT_CHANGED'; description?: string; data?: Record; }; /** @docsIgnore */ type ArchiveLocationApplicationErrors = { code?: 'CANNOT_ARCHIVE_DEFAULT'; description?: string; data?: Record; }; /** @docsIgnore */ type AddTypeToLocationApplicationErrors = { code?: 'CANNOT_UPDATE_LOCATION_TYPES_FOR_LOCATION'; description?: string; data?: Record; }; /** @docsIgnore */ type RemoveTypeFromLocationApplicationErrors = { code?: 'CANNOT_UPDATE_LOCATION_TYPES_FOR_LOCATION'; description?: string; data?: Record; }; /** @docsIgnore */ type AddLocationTypeApplicationErrors = { code?: 'CANNOT_UPDATE_LOCATION_TYPES_FOR_LOCATION'; description?: string; data?: Record; }; /** @docsIgnore */ type RemoveLocationTypeApplicationErrors = { code?: 'CANNOT_UPDATE_LOCATION_TYPES_FOR_LOCATION'; 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 LocationArchiveStatusEnvelope { data: ArchiveLocation; metadata: EventMetadata; } /** * Triggered when a location is archived. * @permissionScope Wix Multilingual - Nile Wrapper Domain Events Read * @permissionScopeId SCOPE.MULTILINGUAL.NILE_WRAPPER_DOMAIN_EVENTS_READ * @permissionScope Manage Locations * @permissionScopeId SCOPE.DC-MULTILOCATION.MANAGE-LOCATIONS * @permissionId LOCATIONS.MANAGE * @webhook * @eventType wix.locations.v1.location_archive_status * @serviceIdentifier com.wixpress.locations.LocationsService * @slug archive_status */ declare function onLocationArchiveStatus(handler: (event: LocationArchiveStatusEnvelope) => void | Promise): void; interface LocationCreatedEnvelope { entity: Location; metadata: EventMetadata; } /** * Triggered when a location is created. * @permissionScope Wix Multilingual - Nile Wrapper Domain Events Read * @permissionScopeId SCOPE.MULTILINGUAL.NILE_WRAPPER_DOMAIN_EVENTS_READ * @permissionScope Manage Locations * @permissionScopeId SCOPE.DC-MULTILOCATION.MANAGE-LOCATIONS * @permissionId LOCATIONS.MANAGE * @webhook * @eventType wix.locations.v1.location_created * @serviceIdentifier com.wixpress.locations.LocationsService * @slug created */ declare function onLocationCreated(handler: (event: LocationCreatedEnvelope) => void | Promise): void; interface LocationSetDefaultLocationEnvelope { data: SetDefaultLocation; metadata: EventMetadata; } /** * Triggered when a location is set as default. * @permissionScope Wix Multilingual - Nile Wrapper Domain Events Read * @permissionScopeId SCOPE.MULTILINGUAL.NILE_WRAPPER_DOMAIN_EVENTS_READ * @permissionScope Manage Locations * @permissionScopeId SCOPE.DC-MULTILOCATION.MANAGE-LOCATIONS * @permissionId LOCATIONS.MANAGE * @webhook * @eventType wix.locations.v1.location_set_default_location * @serviceIdentifier com.wixpress.locations.LocationsService * @slug set_default_location */ declare function onLocationSetDefaultLocation(handler: (event: LocationSetDefaultLocationEnvelope) => void | Promise): void; interface LocationUpdatedEnvelope { entity: Location; metadata: EventMetadata; /** @hidden */ modifiedFields: Record; } /** @permissionScope Wix Multilingual - Nile Wrapper Domain Events Read * @permissionScopeId SCOPE.MULTILINGUAL.NILE_WRAPPER_DOMAIN_EVENTS_READ * @permissionScope Manage Locations * @permissionScopeId SCOPE.DC-MULTILOCATION.MANAGE-LOCATIONS * @permissionId LOCATIONS.MANAGE * @webhook * @eventType wix.locations.v1.location_updated * @slug updated */ declare function onLocationUpdated(handler: (event: LocationUpdatedEnvelope) => void | Promise): void; /** * Creates a location. * @param location - Location to create. * @public * @requiredField location * @requiredField location.address * @requiredField location.name * @requiredField location.timeZone * @permissionId LOCATIONS.MANAGE * @applicableIdentity APP * @returns Created location. * @fqn com.wixpress.locations.LocationsService.CreateLocation */ declare function createLocation(location: NonNullablePaths): Promise & { __applicationErrorsType?: CreateLocationApplicationErrors; }>; /** * Creates locations in bulk. * @param locations - Locations to create. * @internal * @documentationMaturity preview * @requiredField locations * @permissionId LOCATIONS.MANAGE * @applicableIdentity APP * @fqn com.wixpress.locations.LocationsService.BulkCreateLocation */ declare function bulkCreateLocation(locations: Location[]): Promise>; /** * Retrieves a location. * @param _id - ID of the location to retrieve. * @public * @requiredField _id * @permissionId LOCATIONS.READ * @applicableIdentity APP * @returns Retrieved location. * @fqn com.wixpress.locations.LocationsService.GetLocation */ declare function getLocation(_id: string): Promise>; /** * Retrieves locations, given the specified filters, sorting, and paging. * @public * @param options - Options to use when retrieving a list of locations. * @permissionId LOCATIONS.READ * @applicableIdentity APP * @fqn com.wixpress.locations.LocationsService.ListLocations */ declare function listLocations(options?: ListLocationsOptions): Promise>; interface ListLocationsOptions { /** Sort order. */ sort?: Sorting; /** * Pagination. * * Default values: * `offset`: 0 * `limit`: 50 (Max: 1000) */ paging?: Paging; /** * Whether to include `archived` locations in the response. * * Default: `false` */ includeArchived?: boolean; /** Whether to filter only authorized locations */ filterAuthorizedLocationEntities?: boolean; } /** * Overrides an existing location. * * * > **Note:** Currently, it isn't possible to partially update a location. Therefore, you'll need to pass the full location object in the body of the call. * @param _id - Location ID. * @public * @requiredField _id * @requiredField location * @requiredField location.address * @requiredField location.name * @requiredField location.timeZone * @param location - Updated location details. * @permissionId LOCATIONS.MANAGE * @applicableIdentity APP * @returns Updated location. * @fqn com.wixpress.locations.LocationsService.UpdateLocation */ declare function updateLocation(_id: string, location: NonNullablePaths): Promise & { __applicationErrorsType?: UpdateLocationApplicationErrors; }>; interface UpdateLocation { /** * Location ID. * @format GUID * @readonly */ _id?: string | null; /** * Location name. * @maxLength 150 */ name?: string; /** * Location description. * @maxLength 500 */ description?: string | null; /** * Whether this is the default location. There can only be one default location per site. The default location can't be archived. * @readonly */ default?: boolean; /** * Location status. Defaults to `ACTIVE`. * __Notes:__ * - [Archiving a location](https://dev.wix.com/api/rest/business-info/locations/archive-location) * doesn't affect the location's status. * - `INACTIVE` status is currently not supported. */ status?: LocationStatusWithLiterals; /** * Location type. * * **Note:** Currently not supported. * @deprecated */ locationType?: LocationTypeWithLiterals; /** Fax number. */ fax?: string | null; /** Timezone in `America/New_York` format. */ timeZone?: string | null; /** Email address. */ email?: string | null; /** Phone number. */ phone?: string | null; /** Address. */ address?: Address; /** * Business schedule. Array of weekly recurring time periods when the location is open for business. Limited to 100 time periods. * * __Note:__ Not supported by Wix Bookings. */ businessSchedule?: BusinessSchedule; /** * Revision number, which increments by 1 each time the location is updated. * To prevent conflicting changes, the existing revision must be used when updating a location. */ revision?: string | null; /** * Whether the location is archived. Archived locations can't be updated. * __Note:__ [Archiving a location](https://dev.wix.com/api/rest/business-info/locations/archive-location) * doesn't affect its `status`. * @readonly */ archived?: boolean; /** * Location types. * @maxSize 10 */ locationTypes?: LocationTypeWithLiterals[]; /** Extended fields for data extensions. */ extendedFields?: ExtendedFields; } /** * Creates a query to retrieve a list of locations. * * * The `queryLocations()` function builds a query to retrieve a list of up to 1,000 locations and returns a `LocationsQueryBuilder` object. * * The returned object contains the query definition which is typically used to run the query using the `find()` function. * * You can refine the query by chaining `LocationsQueryBuilder` functions onto the query. `LocationsQueryBuilder` functions enable you to sort, filter, and control the results that `queryLocations()` returns. The functions that are chained to `queryLocations()` are applied in the order they are called. * * `queryLocations()` runs with the following `LocationsQueryBuilder` defaults that you can override: * - `skip`: `0` * - `limit`: `50` * * The following `QueryLocationsBuilder` functions are supported for the `queryLocations()` function. For a full description of the Locations object, see the object returned for the `items` property in `LocationsQueryResult`. * @public * @param options - Options to use when querying locations. * @permissionId LOCATIONS.READ * @applicableIdentity APP * @fqn com.wixpress.locations.LocationsService.QueryLocations */ declare function queryLocations(options?: QueryLocationsOptions): LocationsQueryBuilder; interface QueryLocationsOptions { /** Whether to filter only authorized locations */ filterAuthorizedLocationEntities?: boolean | undefined; } interface QueryOffsetResult { currentPage: number | undefined; totalPages: number | undefined; totalCount: number | undefined; hasNext: () => boolean; hasPrev: () => boolean; length: number; pageSize: number; } interface LocationsQueryResult extends QueryOffsetResult { items: Location[]; query: LocationsQueryBuilder; next: () => Promise; prev: () => Promise; } interface LocationsQueryBuilder { /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ eq: (propertyName: '_id' | 'name' | 'description' | 'default' | 'status' | 'locationType' | 'fax' | 'timeZone' | 'email' | 'phone' | 'address.country' | 'address.subdivision' | 'address.city' | 'address.postalCode' | 'address.streetAddress.number' | 'address.streetAddress.name' | 'address.streetAddress.apt' | 'address.formattedAddress' | 'address.hint' | 'address.geocode.latitude' | 'address.geocode.longitude' | 'businessSchedule.periods.openDay' | 'businessSchedule.periods.openTime' | 'businessSchedule.periods.closeDay' | 'businessSchedule.periods.closeTime' | 'businessSchedule.specialHourPeriod.startDate' | 'businessSchedule.specialHourPeriod.endDate' | 'businessSchedule.specialHourPeriod.isClosed' | 'businessSchedule.specialHourPeriod.comment' | 'revision' | 'archived', value: any) => LocationsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ ne: (propertyName: '_id' | 'name' | 'description' | 'default' | 'status' | 'locationType' | 'fax' | 'timeZone' | 'email' | 'phone' | 'address.country' | 'address.subdivision' | 'address.city' | 'address.postalCode' | 'address.streetAddress.number' | 'address.streetAddress.name' | 'address.streetAddress.apt' | 'address.formattedAddress' | 'address.hint' | 'address.geocode.latitude' | 'address.geocode.longitude' | 'businessSchedule.periods.openDay' | 'businessSchedule.periods.openTime' | 'businessSchedule.periods.closeDay' | 'businessSchedule.periods.closeTime' | 'businessSchedule.specialHourPeriod.startDate' | 'businessSchedule.specialHourPeriod.endDate' | 'businessSchedule.specialHourPeriod.isClosed' | 'businessSchedule.specialHourPeriod.comment' | 'revision' | 'archived', value: any) => LocationsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ ge: (propertyName: '_id' | 'name' | 'description' | 'fax' | 'timeZone' | 'email' | 'phone' | 'address.country' | 'address.subdivision' | 'address.city' | 'address.postalCode' | 'address.streetAddress.number' | 'address.streetAddress.name' | 'address.streetAddress.apt' | 'address.formattedAddress' | 'address.hint' | 'address.geocode.latitude' | 'address.geocode.longitude' | 'businessSchedule.periods.openTime' | 'businessSchedule.periods.closeTime' | 'businessSchedule.specialHourPeriod.startDate' | 'businessSchedule.specialHourPeriod.endDate' | 'businessSchedule.specialHourPeriod.comment' | 'revision', value: any) => LocationsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ gt: (propertyName: '_id' | 'name' | 'description' | 'fax' | 'timeZone' | 'email' | 'phone' | 'address.country' | 'address.subdivision' | 'address.city' | 'address.postalCode' | 'address.streetAddress.number' | 'address.streetAddress.name' | 'address.streetAddress.apt' | 'address.formattedAddress' | 'address.hint' | 'address.geocode.latitude' | 'address.geocode.longitude' | 'businessSchedule.periods.openTime' | 'businessSchedule.periods.closeTime' | 'businessSchedule.specialHourPeriod.startDate' | 'businessSchedule.specialHourPeriod.endDate' | 'businessSchedule.specialHourPeriod.comment' | 'revision', value: any) => LocationsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ le: (propertyName: '_id' | 'name' | 'description' | 'fax' | 'timeZone' | 'email' | 'phone' | 'address.country' | 'address.subdivision' | 'address.city' | 'address.postalCode' | 'address.streetAddress.number' | 'address.streetAddress.name' | 'address.streetAddress.apt' | 'address.formattedAddress' | 'address.hint' | 'address.geocode.latitude' | 'address.geocode.longitude' | 'businessSchedule.periods.openTime' | 'businessSchedule.periods.closeTime' | 'businessSchedule.specialHourPeriod.startDate' | 'businessSchedule.specialHourPeriod.endDate' | 'businessSchedule.specialHourPeriod.comment' | 'revision', value: any) => LocationsQueryBuilder; /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. */ lt: (propertyName: '_id' | 'name' | 'description' | 'fax' | 'timeZone' | 'email' | 'phone' | 'address.country' | 'address.subdivision' | 'address.city' | 'address.postalCode' | 'address.streetAddress.number' | 'address.streetAddress.name' | 'address.streetAddress.apt' | 'address.formattedAddress' | 'address.hint' | 'address.geocode.latitude' | 'address.geocode.longitude' | 'businessSchedule.periods.openTime' | 'businessSchedule.periods.closeTime' | 'businessSchedule.specialHourPeriod.startDate' | 'businessSchedule.specialHourPeriod.endDate' | 'businessSchedule.specialHourPeriod.comment' | 'revision', value: any) => LocationsQueryBuilder; /** @param propertyName - Property whose value is compared with `string`. * @param string - String to compare against. Case-insensitive. */ startsWith: (propertyName: '_id' | 'name' | 'description' | 'fax' | 'timeZone' | 'email' | 'phone' | 'address.country' | 'address.subdivision' | 'address.city' | 'address.postalCode' | 'address.streetAddress.number' | 'address.streetAddress.name' | 'address.streetAddress.apt' | 'address.formattedAddress' | 'address.hint' | 'businessSchedule.periods.openTime' | 'businessSchedule.periods.closeTime' | 'businessSchedule.specialHourPeriod.startDate' | 'businessSchedule.specialHourPeriod.endDate' | 'businessSchedule.specialHourPeriod.comment', value: string) => LocationsQueryBuilder; /** @param propertyName - Property whose value is compared with `values`. * @param values - List of values to compare against. */ hasSome: (propertyName: '_id' | 'name' | 'description' | 'default' | 'status' | 'locationType' | 'fax' | 'timeZone' | 'email' | 'phone' | 'address.country' | 'address.subdivision' | 'address.city' | 'address.postalCode' | 'address.streetAddress.number' | 'address.streetAddress.name' | 'address.streetAddress.apt' | 'address.formattedAddress' | 'address.hint' | 'address.geocode.latitude' | 'address.geocode.longitude' | 'businessSchedule.periods.openDay' | 'businessSchedule.periods.openTime' | 'businessSchedule.periods.closeDay' | 'businessSchedule.periods.closeTime' | 'businessSchedule.specialHourPeriod.startDate' | 'businessSchedule.specialHourPeriod.endDate' | 'businessSchedule.specialHourPeriod.isClosed' | 'businessSchedule.specialHourPeriod.comment' | 'revision' | 'archived', value: any[]) => LocationsQueryBuilder; in: (propertyName: '_id' | 'name' | 'description' | 'default' | 'status' | 'locationType' | 'fax' | 'timeZone' | 'email' | 'phone' | 'address.country' | 'address.subdivision' | 'address.city' | 'address.postalCode' | 'address.streetAddress.number' | 'address.streetAddress.name' | 'address.streetAddress.apt' | 'address.formattedAddress' | 'address.hint' | 'address.geocode.latitude' | 'address.geocode.longitude' | 'businessSchedule.periods.openDay' | 'businessSchedule.periods.openTime' | 'businessSchedule.periods.closeDay' | 'businessSchedule.periods.closeTime' | 'businessSchedule.specialHourPeriod.startDate' | 'businessSchedule.specialHourPeriod.endDate' | 'businessSchedule.specialHourPeriod.isClosed' | 'businessSchedule.specialHourPeriod.comment' | 'revision' | 'archived', value: any) => LocationsQueryBuilder; exists: (propertyName: '_id' | 'name' | 'description' | 'default' | 'status' | 'locationType' | 'fax' | 'timeZone' | 'email' | 'phone' | 'address.country' | 'address.subdivision' | 'address.city' | 'address.postalCode' | 'address.streetAddress.number' | 'address.streetAddress.name' | 'address.streetAddress.apt' | 'address.formattedAddress' | 'address.hint' | 'address.geocode.latitude' | 'address.geocode.longitude' | 'businessSchedule.periods.openDay' | 'businessSchedule.periods.openTime' | 'businessSchedule.periods.closeDay' | 'businessSchedule.periods.closeTime' | 'businessSchedule.specialHourPeriod.startDate' | 'businessSchedule.specialHourPeriod.endDate' | 'businessSchedule.specialHourPeriod.isClosed' | 'businessSchedule.specialHourPeriod.comment' | 'revision' | 'archived', value: boolean) => LocationsQueryBuilder; /** @param limit - Number of items to return, which is also the `pageSize` of the results object. */ limit: (limit: number) => LocationsQueryBuilder; /** @param skip - Number of items to skip in the query results before returning the results. */ skip: (skip: number) => LocationsQueryBuilder; find: () => Promise; } /** * @hidden * @fqn com.wixpress.locations.LocationsService.QueryLocations * @requiredField query */ declare function typedQueryLocations(query: LocationQuery, options?: QueryLocationsOptions): Promise>; interface LocationQuerySpec extends QuerySpec { paging: 'offset'; wql: [ { fields: [ 'businessSchedule.periods.closeDay', 'businessSchedule.periods.closeTime', 'businessSchedule.periods.openDay', 'businessSchedule.periods.openTime', 'businessSchedule.specialHourPeriod.comment', 'businessSchedule.specialHourPeriod.endDate', 'businessSchedule.specialHourPeriod.isClosed', 'businessSchedule.specialHourPeriod.startDate' ]; operators: ['$hasAll', '$hasSome']; sort: 'NONE'; }, { fields: [ '_id', 'address.city', 'address.country', 'address.formattedAddress', 'address.geocode.latitude', 'address.geocode.longitude', 'address.hint', 'address.postalCode', 'address.streetAddress.apt', 'address.streetAddress.name', 'address.streetAddress.number', 'address.subdivision', 'archived', 'default', 'description', 'email', 'fax', 'locationType', 'name', 'phone', 'revision', 'status', 'timeZone' ]; operators: '*'; sort: 'NONE'; } ]; } type CommonQueryWithEntityContext = Query$1; type LocationQuery = { /** 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']; /** Sort object in the following format: `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]` */ sort?: { /** Name of the field to sort by. @maxLength: 512 */ fieldName?: NonNullable[number]['fieldName']; /** Sort order. */ order?: NonNullable[number]['order']; }[]; /** Paging options to limit and skip the number of items. */ paging?: { /** Number of items to load. Default: `50` Max: `1000` */ limit?: NonNullable['limit'] | null; /** Number of items to skip in the current sort order. Default: `0` */ offset?: NonNullable['offset'] | null; }; }; declare const utils: { query: { QueryBuilder: () => _wix_sdk_types.QueryBuilder; Filter: _wix_sdk_types.FilterFactory; Sort: _wix_sdk_types.SortFactory; }; }; /** * Sets a new default location. * * * > **Notes:** * > + There can only be one default location per site. * > + The default location can't be archived. * @param _id - ID of the location to set as the default location. * @public * @requiredField _id * @permissionId LOCATIONS.MANAGE * @applicableIdentity APP * @fqn com.wixpress.locations.LocationsService.SetDefaultLocation */ declare function setDefaultLocation(_id: string): Promise & { __applicationErrorsType?: SetDefaultLocationApplicationErrors; }>; /** * Archives a location. * * * > **Notes:** * > + Changes the `archived` boolean of a location to `true`. * > + You can't change a location's `status` using this endpoint. * > + Archived locations can't be updated. * > + The `default` location can't be archived. * @param _id - ID of the location to archive. * @public * @requiredField _id * @permissionId LOCATIONS.MANAGE * @applicableIdentity APP * @fqn com.wixpress.locations.LocationsService.ArchiveLocation */ declare function archiveLocation(_id: string): Promise & { __applicationErrorsType?: ArchiveLocationApplicationErrors; }>; /** * Adds a location type to the specified location. * @param _id - ID of the location where the type will be added. * @param locationType - Location type to add. * @public * @requiredField _id * @requiredField locationType * @permissionId LOCATIONS.MANAGE * @applicableIdentity APP * @fqn com.wixpress.locations.LocationsService.AddTypeToLocation */ declare function addTypeToLocation(_id: string, locationType: LocationTypeWithLiterals): Promise & { __applicationErrorsType?: AddTypeToLocationApplicationErrors; }>; /** * Removes a location type from the specified location. * @param _id - ID of the location where the type will be removed. * @param locationType - Location type to remove. * @public * @requiredField _id * @requiredField locationType * @permissionId LOCATIONS.MANAGE * @applicableIdentity APP * @fqn com.wixpress.locations.LocationsService.RemoveTypeFromLocation */ declare function removeTypeFromLocation(_id: string, locationType: LocationTypeWithLiterals): Promise & { __applicationErrorsType?: RemoveTypeFromLocationApplicationErrors; }>; /** * Add location type to a specific location. * * > **Notes:** * > + Add one the location type (UNKNOWN, BRANCH, OFFICES, RECEPTION, HEADQUARTERS, INVENTORY) to a specific location by id. * > + This EP is deprecated - Please use AddTypeFromLocation instead. * @param _id - Location id to add type * @public * @documentationMaturity preview * @requiredField _id * @requiredField locationType * @permissionId LOCATIONS.MANAGE * @applicableIdentity APP * @fqn com.wixpress.locations.LocationsService.AddLocationType * @deprecated */ declare function addLocationType(_id: string, locationType: LocationTypeWithLiterals): Promise & { __applicationErrorsType?: AddLocationTypeApplicationErrors; }>; /** * Remove location type from a specific location. * * > **Notes:** * > + Remove location type (UNKNOWN, BRANCH, OFFICES, RECEPTION, HEADQUARTERS, INVENTORY) from a specific location by id. * > + This EP is deprecated - Please use RemoveTypeFromLocation instead. * @param _id - Location id to add type * @public * @documentationMaturity preview * @requiredField _id * @requiredField locationType * @permissionId LOCATIONS.MANAGE * @applicableIdentity APP * @fqn com.wixpress.locations.LocationsService.RemoveLocationType * @deprecated */ declare function removeLocationType(_id: string, locationType: LocationTypeWithLiterals): Promise & { __applicationErrorsType?: RemoveLocationTypeApplicationErrors; }>; export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type AddLocationTypeApplicationErrors, type AddLocationTypeRequest, type AddLocationTypeResponse, type AddTypeToLocationApplicationErrors, type AddTypeToLocationRequest, type AddTypeToLocationResponse, type Address, type AddressLocation, type ArchiveLocation, type ArchiveLocationApplicationErrors, type ArchiveLocationRequest, type ArchiveLocationResponse, type BaseEventMetadata, type BulkCreateLocationRequest, type BulkCreateLocationResponse, type BulkUpdateLocationRequest, type BulkUpdateLocationResponse, type BusinessSchedule, type CommonQueryWithEntityContext, type CreateLocationApplicationErrors, type CreateLocationRequest, type CreateLocationResponse, DayOfWeek, type DayOfWeekWithLiterals, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type ExtendedFields, type FailedCreateLocation, type FailedUpdateLocation, type GetLocationRequest, type GetLocationResponse, type GetOrCreateDefaultLocationRequest, type GetOrCreateDefaultLocationResponse, type IdentificationData, type IdentificationDataIdOneOf, type ListLocationsOptions, type ListLocationsRequest, type ListLocationsResponse, type Location, type LocationArchiveStatusEnvelope, type LocationCreatedEnvelope, type LocationQuery, type LocationQuerySpec, type LocationSetDefaultLocationEnvelope, LocationStatus, type LocationStatusWithLiterals, LocationType, type LocationTypeWithLiterals, type LocationUpdatedEnvelope, type LocationsQueryBuilder, type LocationsQueryResult, type MessageEnvelope, type MetasiteLocationsRequest, type MetasiteLocationsResponse, type Paging, type PagingMetadata, type Query, type QueryLocationsOptions, type QueryLocationsRequest, type QueryLocationsResponse, type RemoveLocationTypeApplicationErrors, type RemoveLocationTypeRequest, type RemoveLocationTypeResponse, type RemoveTypeFromLocationApplicationErrors, type RemoveTypeFromLocationRequest, type RemoveTypeFromLocationResponse, type RestoreInfo, type SetDefaultLocation, type SetDefaultLocationApplicationErrors, type SetDefaultLocationRequest, type SetDefaultLocationResponse, SortOrder, type SortOrderWithLiterals, type Sorting, type SpecialHourPeriod, type StreetAddress, type TimePeriod, type UnarchiveLocationRequest, type UnarchiveLocationResponse, type UpdateLocation, type UpdateLocationApplicationErrors, type UpdateLocationRequest, type UpdateLocationResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, addLocationType, addTypeToLocation, archiveLocation, bulkCreateLocation, createLocation, getLocation, listLocations, onLocationArchiveStatus, onLocationCreated, onLocationSetDefaultLocation, onLocationUpdated, queryLocations, removeLocationType, removeTypeFromLocation, setDefaultLocation, typedQueryLocations, updateLocation, utils };