/** * The `participation` object represents the relationship between a participant and * an [event](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/event-object) * or [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/schedule-object). * It includes details about the participant, whether the participation status is confirmed or * pending, which app owns the relevant event or schedule, and allows for custom data extensions. */ export interface Participation extends ParticipationParticipatedItemOneOf { /** * ID of the [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/schedule-object) * associated with the participation. */ scheduleId?: string | null; /** * ID of the [event](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/event-object) * associated with the participation. */ eventId?: string | null; /** * Participation ID. * @readonly */ _id?: string | null; /** External ID. */ externalId?: string | null; /** Information about the participant. */ participant?: Participant; /** * Party size of the group or `1` for individuals. * * Min: `1` * Max: `1000` */ partySize?: number | null; /** * Status of the party's participation in the event. Depending on your * implementation, confirmation may be handled by the business owner or the customer. * * Supported values: * + `CONFIRMED`: The party's participation is confirmed. For example, the business owner has confirmed a [booking](https://dev.wix.com/docs/rest/business-solutions/bookings/about-wix-bookings). * + `PENDING_CONFIRMATION`: The party's participation is awaiting confirmation. For example, the business owner still needs to approve the [booking](https://dev.wix.com/docs/rest/business-solutions/bookings/about-wix-bookings). * * Default: `CONFIRMED` */ status?: Status; /** * ID of the app that owns the participation `object`. Identical to `appId` of the * [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/schedule-object) * that the related * [event](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/event-object) * belongs to. * @readonly */ appId?: string | null; /** * Revision number, which increments by 1 each time the participation is updated. * To prevent conflicting changes, the current revision must be passed when updating the participation. * Ignored when creating a participation. * @readonly */ revision?: string | null; /** * Date the participation was created in `YYYY-MM-DDThh:mm:ss.sssZ` format. * @readonly */ _createdDate?: Date | null; /** * Date the participation was updated in `YYYY-MM-DDThh:mm:ss.sssZ` format. * @readonly */ _updatedDate?: Date | null; /** Extensions enabling applications or users to save custom data related to the participation. */ extendedFields?: ExtendedFields; } /** @oneof */ export interface ParticipationParticipatedItemOneOf { /** * ID of the [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/schedule-object) * associated with the participation. */ scheduleId?: string | null; /** * ID of the [event](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/event-object) * associated with the participation. */ eventId?: string | null; } export interface Participant { /** * Participant name. * * Min: 1 character * Max: 200 characters */ name?: string | null; /** Participant's phone number. */ phone?: string | null; /** Participant's email address. */ email?: string | null; /** * [Contact](https://dev.wix.com/docs/sdk/backend-modules/crm/contacts/introduction) * ID of the participant. */ contactId?: string | null; } export declare enum Status { /** The party's participation is confirmed. For example, the business owner has confirmed a [booking](https://dev.wix.com/docs/rest/business-solutions/bookings/about-wix-bookings). */ CONFIRMED = "CONFIRMED", /** The party's participation is awaiting confirmation. For example, the business owner still needs to approve the [booking](https://dev.wix.com/docs/rest/business-solutions/bookings/about-wix-bookings). */ PENDING_CONFIRMATION = "PENDING_CONFIRMATION" } export 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>; } export interface GetParticipationRequest { /** ID of the `participation` object to retrieve. */ participationId: string | null; } export interface GetParticipationResponse { /** Retrieved `participation` object. */ participation?: Participation; } export interface QueryParticipationsRequest { /** Query containing filters and paging. */ query?: CursorQuery; } export 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; } /** @oneof */ export 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; } export interface CursorPaging { /** Number of participations to load. */ limit?: number | null; /** * Pointer to the next or previous page in the list of results. * * You can get the relevant cursor token * from the `pagingMetadata` object in the previous call's response. * Not relevant for the first request. */ cursor?: string | null; } export interface QueryParticipationsResponse { /** Retrieved `participation` objects matching the provided query. */ participations?: Participation[]; /** Paging metadata. */ pagingMetadata?: CursorPagingMetadata; } export interface CursorPagingMetadata { /** Number of items returned in the response. */ count?: number | null; /** Offset that was requested. */ cursors?: Cursors; /** * 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; } export interface Cursors { /** Cursor pointing to next page in the list of results. */ next?: string | null; /** Cursor pointing to previous page in the list of results. */ prev?: string | null; } export interface CreateParticipationRequest { /** `participation` object to create. */ participation: Participation; /** * Idempotency key guaranteeing that you don't create the same `participation` * object more than once. */ idempotencyKey?: string | null; } export interface CreateParticipationResponse { /** Created `participation` object. */ participation?: Participation; } export interface UpdateParticipationRequest { /** `participation` object to update. */ participation: Participation; } export interface UpdateParticipationResponse { /** Updated `participation` object. */ participation?: Participation; } /** Deprecated. Use the standard ParticipationUpdated event instead, which also includes the modified fields. */ export interface ParticipationUpdatedWithMetadata { /** The updated participation. */ participation?: Participation; } export interface DeleteParticipationRequest { /** ID of `participation` object to delete. */ participationId: string | null; } export interface DeleteParticipationResponse { } export interface DomainEvent extends DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; /** * Unique event ID. * Allows clients to ignore duplicate webhooks. */ _id?: string; /** * Assumes actions are also always typed to an entity_type * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction */ entityFqdn?: string; /** * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug) * This is although the created/updated/deleted notion is duplication of the oneof types * 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 defining the order of updates to the underlying entity. * For example, given that some entity was updated at 16:00 and than again at 16:01, * it is guaranteed that the sequence number of the second update is strictly higher than the first. * As the consumer, you can use this value to ensure that you handle messages in the correct order. * To do so, you will need to persist this number on your end, and compare the sequence number from the * message against the one you have stored. Given that the stored number is higher, you should ignore the message. */ entityEventSequence?: string | null; } /** @oneof */ export interface DomainEventBodyOneOf { createdEvent?: EntityCreatedEvent; updatedEvent?: EntityUpdatedEvent; deletedEvent?: EntityDeletedEvent; actionEvent?: ActionEvent; } export interface EntityCreatedEvent { entity?: string; } export interface RestoreInfo { deletedDate?: Date | null; } export 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; } export interface EntityDeletedEvent { /** Entity that was deleted */ deletedEntity?: string | null; } export interface ActionEvent { body?: string; } export interface Empty { } export interface SumParticipationsPartySizeByScheduleIdRequest { /** The schedule IDs. */ scheduleIds?: string[] | null; } export interface SumParticipationsPartySizeByScheduleIdResponse { /** The sum of party size by schedule ID. */ partySizeSumByScheduleId?: PartySizeSumByScheduleId[]; } export interface PartySizeSumByScheduleId { /** The ID of the schedule. */ scheduleId?: string | null; /** The sum of the participations party size. */ partySizeSum?: number | null; } export interface MessageEnvelope { /** App instance ID. */ instanceId?: string | null; /** Event type. */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; /** Stringify payload. */ data?: string; } export interface IdentificationData extends IdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app. */ appId?: string; /** @readonly */ identityType?: WebhookIdentityType; } /** @oneof */ export interface IdentificationDataIdOneOf { /** ID of a site visitor that has not logged in to the site. */ anonymousVisitorId?: string; /** ID of a site visitor that has logged in to the site. */ memberId?: string; /** ID of a Wix user (site owner, contributor, etc.). */ wixUserId?: string; /** ID of an app. */ appId?: string; } export declare enum WebhookIdentityType { UNKNOWN = "UNKNOWN", ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR", MEMBER = "MEMBER", WIX_USER = "WIX_USER", APP = "APP" } export interface ParticipationNonNullableFields { status: Status; } export interface GetParticipationResponseNonNullableFields { participation?: ParticipationNonNullableFields; } export interface QueryParticipationsResponseNonNullableFields { participations: ParticipationNonNullableFields[]; } export interface CreateParticipationResponseNonNullableFields { participation?: ParticipationNonNullableFields; } export interface UpdateParticipationResponseNonNullableFields { participation?: ParticipationNonNullableFields; } export interface BaseEventMetadata { /** App instance ID. */ instanceId?: string | null; /** Event type. */ eventType?: string; /** The identification type and identity data. */ identity?: IdentificationData; } export interface EventMetadata extends BaseEventMetadata { /** * Unique event ID. * Allows clients to ignore duplicate webhooks. */ _id?: string; /** * Assumes actions are also always typed to an entity_type * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction */ entityFqdn?: string; /** * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug) * This is although the created/updated/deleted notion is duplication of the oneof types * 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 defining the order of updates to the underlying entity. * For example, given that some entity was updated at 16:00 and than again at 16:01, * it is guaranteed that the sequence number of the second update is strictly higher than the first. * As the consumer, you can use this value to ensure that you handle messages in the correct order. * To do so, you will need to persist this number on your end, and compare the sequence number from the * message against the one you have stored. Given that the stored number is higher, you should ignore the message. */ entityEventSequence?: string | null; } export interface ParticipationCreatedEnvelope { entity: Participation; metadata: EventMetadata; } /** * Triggered when a `participation` object is created. * @permissionScope Manage Calendars * @permissionScopeId SCOPE.DC-CALENDAR.MANAGE * @permissionScope Manage Bookings * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS * @permissionScope Manage Bookings - all permissions * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS * @permissionId CALENDAR.PARTICIPATION_READ * @webhook * @eventType wix.calendar.v3.participation_created * @documentationMaturity preview */ export declare function onParticipationCreated(handler: (event: ParticipationCreatedEnvelope) => void | Promise): void; export interface ParticipationDeletedEnvelope { metadata: EventMetadata; } /** * Triggered when a `participation` object is deleted. * @permissionScope Manage Calendars * @permissionScopeId SCOPE.DC-CALENDAR.MANAGE * @permissionScope Manage Bookings * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS * @permissionScope Manage Bookings - all permissions * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS * @permissionId CALENDAR.PARTICIPATION_READ * @webhook * @eventType wix.calendar.v3.participation_deleted * @documentationMaturity preview */ export declare function onParticipationDeleted(handler: (event: ParticipationDeletedEnvelope) => void | Promise): void; export interface ParticipationUpdatedEnvelope { entity: Participation; metadata: EventMetadata; } /** * Triggered when a `participation` object is updated. * @permissionScope Manage Calendars * @permissionScopeId SCOPE.DC-CALENDAR.MANAGE * @permissionScope Manage Bookings * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS * @permissionScope Manage Bookings - all permissions * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS * @permissionId CALENDAR.PARTICIPATION_READ * @webhook * @eventType wix.calendar.v3.participation_updated * @documentationMaturity preview */ export declare function onParticipationUpdated(handler: (event: ParticipationUpdatedEnvelope) => void | Promise): void; /** * Retrieves a `participation` object. * @param participationId - ID of the `participation` object to retrieve. * @public * @documentationMaturity preview * @requiredField participationId * @permissionId CALENDAR.PARTICIPATION_READ * @permissionScope Manage Calendars * @permissionScopeId SCOPE.DC-CALENDAR.MANAGE * @permissionScope Manage Bookings * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS * @permissionScope Manage Bookings - all permissions * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS * @applicableIdentity APP * @returns Retrieved `participation` object. * @fqn wix.calendar.participations.v3.ParticipationsService.GetParticipation */ export declare function getParticipation(participationId: string | null): Promise; /** * Creates a query to retrieve a list of participations. * * The `queryParticipations()` function builds a query to retrieve a list of participations and returns a `ParticipationsQueryBuilder` object. * * The returned object contains the query definition, which is typically used to run the query using the [find()](https://dev.wix.com/docs/sdk/backend-modules/calendar/participations/participations-query-builder/find) function. * * You can refine the query by chaining `ParticipationsQueryBuilder` functions onto the query. `ParticipationsQueryBuilder` functions enable you to sort, filter, and control the results that `queryParticipations()` returns. * * `queryParticipations()` runs with the following `ParticipationsQueryBuilder` default that you can override: * * + `limit` is `50`. * + Sorted by `createdDate` in ascending order. * * The functions that are chained to `queryParticipations()` are applied in the order they are called. * * The following `ParticipationsQueryBuilder` functions are supported for the `queryParticipations()` function. For a full description of the participations object, see the object returned for the [items](https://dev.wix.com/docs/sdk/backend-modules/calendar/participations/participations-query-result/items) property in `ParticipationsQueryResult`. * * @public * @documentationMaturity preview * @permissionScope Manage Calendars * @permissionScopeId SCOPE.DC-CALENDAR.MANAGE * @permissionScope Manage Bookings * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS * @permissionScope Manage Bookings - all permissions * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS * @permissionId CALENDAR.PARTICIPATION_READ * @applicableIdentity APP * @fqn wix.calendar.participations.v3.ParticipationsService.QueryParticipations */ export declare function queryParticipations(): ParticipationsQueryBuilder; interface QueryCursorResult { cursors: Cursors; hasNext: () => boolean; hasPrev: () => boolean; length: number; pageSize: number; } export interface ParticipationsQueryResult extends QueryCursorResult { items: Participation[]; query: ParticipationsQueryBuilder; next: () => Promise; prev: () => Promise; } export interface ParticipationsQueryBuilder { /** @param propertyName - Property whose value is compared with `value`. * @param value - Value to compare against. * @documentationMaturity preview */ eq: (propertyName: 'scheduleId' | 'eventId' | 'externalId', value: any) => ParticipationsQueryBuilder; /** @documentationMaturity preview */ in: (propertyName: 'scheduleId' | 'eventId' | '_id' | 'externalId', value: any) => ParticipationsQueryBuilder; /** @param limit - Number of items to return, which is also the `pageSize` of the results object. * @documentationMaturity preview */ limit: (limit: number) => ParticipationsQueryBuilder; /** @param cursor - A pointer to specific record * @documentationMaturity preview */ skipTo: (cursor: string) => ParticipationsQueryBuilder; /** @documentationMaturity preview */ find: () => Promise; } /** * Creates a `participation` object for a schedule or event. * @param participation - `participation` object to create. * @public * @documentationMaturity preview * @requiredField participation * @requiredField participation.participant * @requiredField participation.participant.name * @requiredField participation.partySize * @permissionId CALENDAR.PARTICIPATION_CREATE * @permissionScope Manage Calendars * @permissionScopeId SCOPE.DC-CALENDAR.MANAGE * @permissionScope Manage Bookings * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS * @permissionScope Manage Bookings - all permissions * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS * @applicableIdentity APP * @returns Created `participation` object. * @fqn wix.calendar.participations.v3.ParticipationsService.CreateParticipation */ export declare function createParticipation(participation: Participation, options?: CreateParticipationOptions): Promise; export interface CreateParticipationOptions { /** * Idempotency key guaranteeing that you don't create the same `participation` * object more than once. */ idempotencyKey?: string | null; } /** * Updates a `participation` object. * @param _id - Participation ID. * @public * @documentationMaturity preview * @requiredField _id * @requiredField participation * @requiredField participation.revision * @permissionId CALENDAR.PARTICIPATION_UPDATE * @permissionScope Manage Calendars * @permissionScopeId SCOPE.DC-CALENDAR.MANAGE * @permissionScope Manage Bookings * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS * @permissionScope Manage Bookings - all permissions * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS * @applicableIdentity APP * @returns Updated `participation` object. * @fqn wix.calendar.participations.v3.ParticipationsService.UpdateParticipation */ export declare function updateParticipation(_id: string | null, participation: UpdateParticipation): Promise; export interface UpdateParticipation { /** * ID of the [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/schedule-object) * associated with the participation. */ scheduleId?: string | null; /** * ID of the [event](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/event-object) * associated with the participation. */ eventId?: string | null; /** * Participation ID. * @readonly */ _id?: string | null; /** External ID. */ externalId?: string | null; /** Information about the participant. */ participant?: Participant; /** * Party size of the group or `1` for individuals. * * Min: `1` * Max: `1000` */ partySize?: number | null; /** * Status of the party's participation in the event. Depending on your * implementation, confirmation may be handled by the business owner or the customer. * * Supported values: * + `CONFIRMED`: The party's participation is confirmed. For example, the business owner has confirmed a [booking](https://dev.wix.com/docs/rest/business-solutions/bookings/about-wix-bookings). * + `PENDING_CONFIRMATION`: The party's participation is awaiting confirmation. For example, the business owner still needs to approve the [booking](https://dev.wix.com/docs/rest/business-solutions/bookings/about-wix-bookings). * * Default: `CONFIRMED` */ status?: Status; /** * ID of the app that owns the participation `object`. Identical to `appId` of the * [schedule](https://dev.wix.com/docs/rest/business-management/calendar/schedules-v3/schedule-object) * that the related * [event](https://dev.wix.com/docs/rest/business-management/calendar/events-v3/event-object) * belongs to. * @readonly */ appId?: string | null; /** * Revision number, which increments by 1 each time the participation is updated. * To prevent conflicting changes, the current revision must be passed when updating the participation. * Ignored when creating a participation. * @readonly */ revision?: string | null; /** * Date the participation was created in `YYYY-MM-DDThh:mm:ss.sssZ` format. * @readonly */ _createdDate?: Date | null; /** * Date the participation was updated in `YYYY-MM-DDThh:mm:ss.sssZ` format. * @readonly */ _updatedDate?: Date | null; /** Extensions enabling applications or users to save custom data related to the participation. */ extendedFields?: ExtendedFields; } /** * Deletes a `participation` object. * @param participationId - ID of `participation` object to delete. * @public * @documentationMaturity preview * @requiredField participationId * @permissionId CALENDAR.PARTICIPATION_DELETE * @permissionScope Manage Calendars * @permissionScopeId SCOPE.DC-CALENDAR.MANAGE * @permissionScope Manage Bookings * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS * @permissionScope Manage Bookings - all permissions * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS * @applicableIdentity APP * @fqn wix.calendar.participations.v3.ParticipationsService.DeleteParticipation */ export declare function deleteParticipation(participationId: string | null): Promise; export {};