interface Contributor { /** Contributor's metadata. */ metaData?: PersonMetaData; /** Whether the contributor account is a team account. */ isTeam?: boolean | null; /** Date that the contributor joined the site. */ joinedAt?: Date | null; /** Email address that received the invite. */ invitedEmail?: string | null; /** Whether the contributor account is a client account. */ isClient?: boolean | null; /** * Contributor's user ID. * @readonly */ _id?: string; } interface PersonMetaData { /** Contributor's account ID. */ _id?: string; /** Contributor's full name. */ fullName?: string | null; /** URL for contributor's profile image. */ imageUrl?: string | null; /** Contributor's email address. */ email?: string | null; /** Contributor's access to assets and their assigned role (`policy`) for that asset. */ assignments?: Assignment[]; } interface Assignment { /** Role assigned to the user. */ policy?: AssignedPolicy; /** Unique ID for this specific assignment. */ assignmentId?: string; /** Identity assigned to the asset in an assignment, referred to as subject. Supported subjects include user IDs, account IDs, and app IDs. */ subject?: Subject; } interface AssignedPolicy { /** Role ID. */ policyId?: string; /** Role title. */ title?: string | null; /** Role description. */ description?: string | null; } interface Restriction extends RestrictionRestrictionsOneOf { /** * Deprecated. * @deprecated */ resource?: Resource; /** List of conditions restricting the user's access. Currently only folder conditions are supported. */ conditions?: Conditions; /** Site where the assignment restrictions apply. */ site?: SiteRestriction; } /** @oneof */ interface RestrictionRestrictionsOneOf { /** * Deprecated. * @deprecated */ resource?: Resource; /** List of conditions restricting the user's access. Currently only folder conditions are supported. */ conditions?: Conditions; /** Site where the assignment restrictions apply. */ site?: SiteRestriction; } interface Resource { /** Resource type. */ resourceType?: ResourceType; /** Resource ID. */ _id?: string; value?: string | null; } declare enum ResourceType { UNKNOWN_RESOURCE_TYPE = "UNKNOWN_RESOURCE_TYPE", SITE = "SITE" } interface Conditions { /** List of conditions. */ conditions?: Condition[]; } interface Condition { /** Condition type. */ conditionType?: ConditionAttributeType; /** Condition ID. */ _id?: string; /** Expected value of the condition. When `conditionType` = "FOLDER", this is the folder path. */ value?: string | null; } declare enum ConditionAttributeType { UNKNOWN_CONDITION_TYPE = "UNKNOWN_CONDITION_TYPE", FOLDER = "FOLDER" } interface SiteRestriction { /** Site ID. */ _id?: string; /** Site name. */ value?: string | null; } interface CompanionResource { /** Asset ID (referred to here as resource ID). */ _id?: string; /** Asset type (referred to here as resource type). as predefined in the authorization system */ resourceType?: string; } interface Subject { /** ID of identity assigned to the asset. */ _id?: string; /** Type of identity assigned to the asset. Supported subject types include user IDs, account IDs, and app IDs. */ subjectType?: SubjectType; /** Context of identity assigned to the asset. For example, a `subjectType` = `USER` will have `context` = `ACCOUNT`. */ context?: SubjectContext; } declare enum SubjectType { UNKNOWN = "UNKNOWN", ACCOUNT = "ACCOUNT", USER = "USER", USER_GROUP = "USER_GROUP", MEMBER_GROUP = "MEMBER_GROUP", VISITOR_GROUP = "VISITOR_GROUP", EXTERNAL_APP = "EXTERNAL_APP", ACCOUNT_GROUP = "ACCOUNT_GROUP", WIX_APP = "WIX_APP" } interface SubjectContext { _id?: string; contextType?: SubjectContextType; } declare enum SubjectContextType { UNKNOWN_CTX = "UNKNOWN_CTX", ORG_CTX = "ORG_CTX", ACCOUNT_CTX = "ACCOUNT_CTX" } interface GetSiteContributorsRequest { /** The locale of the request. Defaults to en-us */ locale?: string | null; } interface GetSiteContributorsResponse { users?: User[]; teams?: Team[]; invites?: SiteInvite[]; policies?: Policy[]; permissions?: string[]; userId?: string; loggedInAccountId?: string; pendingOwner?: PendingOwner; contributorLimit?: ContributorLimit; predefinedRoles?: PredefinedRoles; } interface User { /** User ID. */ _id?: string; /** * Deprecated. * @deprecated */ roles?: string[]; /** User's email address. */ email?: string; /** User's name. */ name?: Name; /** URL to user's profile image, when provided. */ profileImage?: string | null; /** Date the user joined the team. */ joinedTeamAt?: Date | null; /** * Deprecated. * @deprecated */ policyIds?: string[]; /** Resources the user can access. */ assignments?: Assignment[]; } interface Name { /** User's first name. */ firstName?: string; /** User's last name. */ lastName?: string; } interface Team { accountId?: string; accountInfo?: AccountInfo; policyIds?: string[]; joinedAt?: Date | null; } interface AccountInfo { accountName?: string; accountImage?: string; isTeam?: boolean; } interface SiteInvite { /** * Invite ID. * @readonly */ _id?: string; /** * Site ID the user is invited to as a collaborator. * @readonly */ siteId?: string; /** Email address where the invite was sent. */ email?: string; /** Role IDs included in the invite. */ policyIds?: string[]; /** * Deprecated. Use `inviterAccountId`. * @readonly * @deprecated */ inviterId?: string; /** * Invite Status. * * Supported values: * - **Pending:** The invite has been sent and is valid, waiting for the user's response. * - **Used:** The invite has been accepted. * - **Deleted:** The invite has been deleted or revoked. * - **Declined:** The user declined the invite. * - **Expired:** The invite has expired without being accepted. */ status?: InviteStatus; /** Link to accept the invite. */ acceptLink?: string; /** * Inviting account ID. * @readonly */ inviterAccountId?: string; /** * Account ID that accepted the invite. Populated only once the invite is accepted. * @readonly */ acceptedByAccountId?: string | null; /** Date the invite was created. */ dateCreated?: Date | null; /** User's Wix Bookings staff ID, if relevant. */ staffId?: string | null; /** Invite expiration date */ expirationDate?: Date | null; } /** Invite status stating whether the invite was accepted, waiting to be accepted, deleted etc.. */ declare enum InviteStatus { Pending = "Pending", Used = "Used", Deleted = "Deleted", Declined = "Declined", Expired = "Expired" } interface Policy { _id?: string; description?: string | null; name?: string | null; isCustom?: boolean; scopes?: string[]; } interface PendingOwner { email?: string; expirationDate?: Date | null; acceptLink?: string; } interface ContributorLimit { contributorLimit?: number; } interface PredefinedRoles { roles?: PredefinedRole[]; } interface PredefinedRole { titleKey?: string; roles?: Role[]; title?: string | null; areaId?: string; } interface Role { _id?: string; deprecatedKey?: string; /** @deprecated */ titleKey?: string; /** @deprecated */ descriptionKey?: string; deprecated?: boolean; restrictFromLevel?: string; experiments?: string[]; appDefIds?: string[]; title?: string | null; description?: string | null; isCustom?: boolean; scopes?: string[]; availableResourceTypes?: ResourceType[]; availableConditions?: ConditionAttributeType[]; limitToEditorTypes?: string[]; } interface GetSiteContributorsV2Request { /** The locale of the request. Defaults to en-us. */ locale?: string | null; } interface GetSiteContributorsV2Response { /** List of contributors of the given site. */ contributors?: Contributor[]; /** List of invites to contribute to the given site. */ invites?: SiteInvite[]; /** Quota information for contributors on the given site. */ contributorsQuota?: ContributorsQuota; } interface ContributorsQuota extends ContributorsQuotaOptionsOneOf { /** Limited contributors quota details. */ limitedOptions?: LimitedOptions; /** Type of contributors quota */ type?: Type; } /** @oneof */ interface ContributorsQuotaOptionsOneOf { /** Limited contributors quota details. */ limitedOptions?: LimitedOptions; } /** Enum to represent different types of contributors quota. */ declare enum Type { UNKNOWN = "UNKNOWN", LIMITED = "LIMITED", UNLIMITED = "UNLIMITED" } /** Details for a limited contributors quota. */ interface LimitedOptions { /** Maximum number of contributors allowed. */ limit?: number; /** Number of accepted or pending invitations. */ used?: number; } interface HandleSiteTransferRequest { originalOwnerAccountId?: string; newOwnerAccountId?: string; metaSiteId?: string; keepOriginalOwnerAsContributor?: boolean; } interface HandleSiteTransferResponse { } interface GetCurrentUserRolesRequest { /** The locale of the request. Defaults to en-us */ locale?: string | null; } interface GetCurrentUserRolesResponse { roles?: LocalizedRole[]; } interface LocalizedRole { name?: string; description?: string | null; } interface BulkGetUserRolesOnSiteRequest { users?: UserSubject[]; /** The locale of the request. Defaults to en-us */ locale?: string | null; } interface UserSubject { userId?: string; accountId?: string; } interface BulkGetUserRolesOnSiteResponse { userRoles?: UserLocalizedRoles[]; } interface UserLocalizedRoles { user?: UserSubject; roles?: LocalizedRole[]; } interface ChangeContributorRoleRequest { /** Contributor's account ID. */ accountId: string; /** New roles to assign to the contributor on the site. */ newRoles: SiteRoleAssignment[]; } interface SiteRoleAssignment { /** Role ID. Sometimes referred to as policy ID. See [Roles and Permissions](https://support.wix.com/en/article/roles-permissions-overview) for a list of available roles. */ roleId?: string; /** * Assignment ID mapping the role to the contributor on the site. * @readonly */ assignmentId?: string; } interface ChangeContributorRoleResponse { /** New roles assigned to the contributor on the site. */ newAssignedRoles?: SiteRoleAssignment[]; } interface QuerySiteContributorsRequest { filter?: QuerySiteContributorsFilter; } interface QuerySiteContributorsFilter { /** Role IDs (referred to here as policy IDs) to return. See [Roles and Permissions](https://support.wix.com/en/article/roles-permissions-overview) for available roles. */ policyIds?: string[]; } declare enum FieldSet { UNKNOWN = "UNKNOWN", /** Include only `account_id` and `account_owner_id` fields. */ META_DATA = "META_DATA" } interface QuerySiteContributorsResponse { /** List of site contributors. */ contributors?: ContributorV2[]; } interface ContributorV2 { /** Contributor's account ID. */ accountId?: string | null; /** User ID of the owner of the account that the contributor has joined. */ accountOwnerId?: string | null; } interface GetContributorsQuotaRequest { } interface GetContributorsQuotaResponse { /** Quota information for contributors on the given site. */ contributorsQuota?: ContributorsQuota; } interface GetAppContributorsRequest { appId?: string; /** The locale of the request. Defaults to en-us. */ locale?: string | null; } interface GetAppContributorsResponse { contributors?: Contributor[]; invites?: AppInvite[]; } interface AppInvite { /** @readonly */ _id?: string; /** TODO: amitis - remove this comment after the next merge */ destEmail?: string; /** @readonly */ status?: string; /** @readonly */ acceptLink?: string; invitePurpose?: string | null; policies?: AssignedPolicy[]; /** @readonly */ expirationDate?: Date | null; /** @readonly */ dateCreated?: Date | null; /** @readonly */ dateUpdated?: Date | null; } interface SiteRoleAssignmentNonNullableFields { roleId: string; assignmentId: string; } interface ChangeContributorRoleResponseNonNullableFields { newAssignedRoles: SiteRoleAssignmentNonNullableFields[]; } /** * Overrides all the roles of a contributor for the specified site. * @param accountId - Contributor's account ID. * @public * @documentationMaturity preview * @requiredField accountId * @requiredField options * @requiredField options.newRoles * @param options - Filter options. The `newRoles` field **must** be passed. * @permissionId SITE_ROLES.CHANGE_ROLE */ declare function changeRole(accountId: string, options: ChangeRoleOptions): Promise; interface ChangeRoleOptions { /** New roles to assign to the contributor on the site. */ newRoles: SiteRoleAssignment[]; } /** * Retrieves a list of contributors for the specified site, given the provided filters. * @public * @documentationMaturity preview * @param options - Filter options. * @permissionId site-users.view-users * @permissionScope Manage Bookings Services and Settings * @permissionScopeId SCOPE.BOOKINGS.CONFIGURATION * @permissionScope Manage Portfolio * @permissionScopeId SCOPE.PORTFOLIO.MANAGE-PORTFOLIO * @permissionScope Manage Restaurants - all permissions * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES * @applicableIdentity APP */ declare function querySiteContributors(options?: QuerySiteContributorsOptions): Promise; interface QuerySiteContributorsOptions { filter?: QuerySiteContributorsFilter; } export { type AccountInfo, type AppInvite, type AssignedPolicy, type Assignment, type BulkGetUserRolesOnSiteRequest, type BulkGetUserRolesOnSiteResponse, type ChangeContributorRoleRequest, type ChangeContributorRoleResponse, type ChangeContributorRoleResponseNonNullableFields, type ChangeRoleOptions, type CompanionResource, type Condition, ConditionAttributeType, type Conditions, type Contributor, type ContributorLimit, type ContributorV2, type ContributorsQuota, type ContributorsQuotaOptionsOneOf, FieldSet, type GetAppContributorsRequest, type GetAppContributorsResponse, type GetContributorsQuotaRequest, type GetContributorsQuotaResponse, type GetCurrentUserRolesRequest, type GetCurrentUserRolesResponse, type GetSiteContributorsRequest, type GetSiteContributorsResponse, type GetSiteContributorsV2Request, type GetSiteContributorsV2Response, type HandleSiteTransferRequest, type HandleSiteTransferResponse, InviteStatus, type LimitedOptions, type LocalizedRole, type Name, type PendingOwner, type PersonMetaData, type Policy, type PredefinedRole, type PredefinedRoles, type QuerySiteContributorsFilter, type QuerySiteContributorsOptions, type QuerySiteContributorsRequest, type QuerySiteContributorsResponse, type Resource, ResourceType, type Restriction, type RestrictionRestrictionsOneOf, type Role, type SiteInvite, type SiteRestriction, type SiteRoleAssignment, type Subject, type SubjectContext, SubjectContextType, SubjectType, type Team, Type, type User, type UserLocalizedRoles, type UserSubject, changeRole, querySiteContributors };