UNPKG

mindbody-api-v6

Version:

Type safe library for interacting with Mindbody's Public API (v6) and Webhooks

1,719 lines (1,624 loc) 184 kB
import { MarkRequired } from 'ts-essentials'; declare enum ErrorCode { ClassRequiresPayment = "ClassRequiresPayment", ClassScheduleNotFound = "ClassScheduleNotFound", ClassSignUpsFull = "ClassSignUpsFull", ClientCustomFieldNotFound = "ClientCustomFieldNotFound", ClientIndexNotFound = "ClientIndexNotFound", ClientIndexValueNotFound = "ClientIndexValueNotFound", ClientIsAlreadyBooked = "ClientIsAlreadyBooked", ClientIsAlreadyOnWaitlist = "ClientIsAlreadyOnWaitlist", ClientIsSuspended = "ClientIsSuspended", ClientNotFound = "ClientNotFound", CrossRegionalNotSupported = "CrossRegionalNotSupported", DeniedAccess = "DeniedAccess", EnrollmentSignUpsFull = "EnrollmentSignUpsFull", EnrollmentWaitlistFull = "EnrollmentWaitlistFull", FormulaNoteNotFound = "FormulaNoteNotFound", InvalidBookingTime = "InvalidBookingTime", InvalidClassId = "InvalidClassId", InvalidClientCreation = "InvalidClientCreation", InvalidClientUpdate = "InvalidClientUpdate", InvalidCountry = "InvalidCountry", InvalidFileFormat = "InvalidFileFormat", InvalidItem = "InvalidItem", InvalidLocation = "InvalidLocation", InvalidLoginCredentials = "InvalidLoginCredentials", InvalidParameter = "InvalidParameter", InvalidPaymentInfo = "InvalidPaymentInfo", InvalidPermissionConfiguration = "InvalidPermissionConfiguration", InvalidPrerequisite = "InvalidPrerequisite", InvalidPromotionCode = "InvalidPromotionCode", InvalidResource = "InvalidResource", InvalidSaleReturn = "InvalidSaleReturn", InvalidSalesRepId = "InvalidSalesRepId", InvalidSettingConfiguration = "InvalidSettingConfiguration", InvalidSiteId = "InvalidSiteId", InvalidSourceCredentials = "InvalidSourceCredentials", InvalidStaffAndProviderId = "InvalidStaffAndProviderId", InvalidStaffCredentials = "InvalidStaffCredentials", InvalidUserAccessLevel = "InvalidUserAccessLevel", InvalidUserCredentials = "InvalidUserCredentials", ItemNotFound = "ItemNotFound", LeaderFollowerFull = "LeaderFollowerFull", MissingRequiredFields = "MissingRequiredFields", PaymentRequired = "PaymentRequired", RelatedClientNotFound = "RelatedClientNotFound", ResourceDoesNotExist = "ResourceDoesNotExist", SaleIdNotFound = "SaleIdNotFound", SchedulingRestrictionsViolated = "SchedulingRestrictionsViolated", SchedulingWindowViolated = "SchedulingWindowViolated", ServiceDoesNotPayForAppointment = "ServiceDoesNotPayForAppointment", ServiceDoesNotPayForVisit = "ServiceDoesNotPayForVisit", SessionTypeNotFound = "SessionTypeNotFound", StaffCannotTakeTips = "StaffCannotTakeTips", StaffIsInactive = "StaffIsInactive", StaffIsNotATrainer = "StaffIsNotATrainer", StaffMemberNotFound = "StaffMemberNotFound", TooManyRequests = "TooManyRequests", Unknown = "Unknown", ValidationFailed = "ValidationFailed", VisitMustBeAClass = "VisitMustBeAClass", SQLDBMaintenance = "SQLDBMaintenance", ClassVisitNotFound = "ClassVisitNotFound" } type ErrorResponse = { Error: { Message: string; Code: ErrorCode; }; }; type Headers = { 'Api-Key': string; 'Content-Type': string; SiteId: string; Authorization?: string; }; type Kv = Record<string, unknown>; type Returnable = Kv | (string | number)[]; type PaginatedResponse<TResponse extends Returnable> = { PaginationResponse: { RequestedLimit: number; RequestedOffset: number; PageSize: number; TotalResults: number; }; } & TResponse; type QueryParams<TParams extends Kv> = { Limit?: number; Offset?: number; } & TParams; type RequestArgsGet<TParam extends Kv> = { siteID: string; params: QueryParams<TParam>; autoPaginate?: boolean; }; type RequestArgsGetOptionalParams<TParam extends Kv> = { siteID: string; params?: QueryParams<TParam>; autoPaginate?: boolean; }; type RequestArgsPost<TPayload extends Kv> = { siteID: string; payload: TPayload; }; type RequestArgsDelete<TParam extends Kv> = { siteID: string; params?: TParam; }; type WebhooksRequestsArgsPost<TParam extends Kv> = TParam; type WebhooksRequestsArgsPatch<TParam extends Kv> = TParam; type TokenResponse = { TokenType: string; AccessToken: string; User: { Id: number; FirstName: string; LastName: string; Type: string; }; }; type index$2_ErrorCode = ErrorCode; declare const index$2_ErrorCode: typeof ErrorCode; type index$2_ErrorResponse = ErrorResponse; type index$2_Headers = Headers; type index$2_PaginatedResponse<TResponse extends Returnable> = PaginatedResponse<TResponse>; type index$2_QueryParams<TParams extends Kv> = QueryParams<TParams>; type index$2_RequestArgsDelete<TParam extends Kv> = RequestArgsDelete<TParam>; type index$2_RequestArgsGet<TParam extends Kv> = RequestArgsGet<TParam>; type index$2_RequestArgsGetOptionalParams<TParam extends Kv> = RequestArgsGetOptionalParams<TParam>; type index$2_RequestArgsPost<TPayload extends Kv> = RequestArgsPost<TPayload>; type index$2_TokenResponse = TokenResponse; type index$2_WebhooksRequestsArgsPatch<TParam extends Kv> = WebhooksRequestsArgsPatch<TParam>; type index$2_WebhooksRequestsArgsPost<TParam extends Kv> = WebhooksRequestsArgsPost<TParam>; declare namespace index$2 { export { index$2_ErrorCode as ErrorCode, type index$2_ErrorResponse as ErrorResponse, type index$2_Headers as Headers, type index$2_PaginatedResponse as PaginatedResponse, type index$2_QueryParams as QueryParams, type index$2_RequestArgsDelete as RequestArgsDelete, type index$2_RequestArgsGet as RequestArgsGet, type index$2_RequestArgsGetOptionalParams as RequestArgsGetOptionalParams, type index$2_RequestArgsPost as RequestArgsPost, type index$2_TokenResponse as TokenResponse, type index$2_WebhooksRequestsArgsPatch as WebhooksRequestsArgsPatch, type index$2_WebhooksRequestsArgsPost as WebhooksRequestsArgsPost }; } type AppointmentAddOnCreated = WebhookEventBase<{ siteId: number; appointmentId: number; addOnAppointmentId: number; addOnName: string; clientId: string; staffId: number; }>; type AppointmentAddOnDeleted = WebhookEventBase<{ siteId: number; appointmentId: number; }>; type AppointmentBookingCancelled = WebhookEventBase<{ siteId: number; appointmentId: number; }>; /** * T or null */ type Nullable<T> = T | null; type AppointmentBookingCreated = WebhookEventBase<{ siteId: number; appointmentId: number; status: string; isConfirmed: boolean; hasArrived: boolean; locationId: number; clientId: string; clientFirstName: string; clientLastName: string; clientEmail: string; clientPhone: string; staffId: number; staffFirstName: string; staffLastName: string; startDateTime: string; endDateTime: string; durationMinutes: number; genderRequested: Nullable<'Male' | 'Female'>; resources: { id: number; name: string; }[]; notes: Nullable<string>; formulaNotes: Nullable<string>; icdCodes: { code: string; description: string; }[]; providerId: Nullable<string>; }>; type AppointmentBookingUpdated = WebhookEventBase<{ siteId: number; appointmentId: number; status: string; isConfirmed: boolean; hasArrived: boolean; locationId: number; clientId: string; clientFirstName: string; clientLastName: string; clientEmail: string; clientPhone: string; staffId: number; staffFirstName: string; staffLastName: string; startDateTime: string; endDateTime: string; durationMinutes: number; genderRequested: Nullable<'Male' | 'Female'>; resources: { id: number; name: string; }[]; notes: Nullable<string>; formulaNotes: Nullable<string>; icdCodes: { code: string; description: string; }[]; providerId: Nullable<string>; }>; type ClassDescriptionUpdated = WebhookEventBase<{ siteId: number; id: number; name: string; description: string; }>; type ClassRosterBookingCreated = WebhookEventBase<{ siteId: number; locationId: number; classId: number; classRosterBookingId: number; classStartDateTime: string; classEndDateTime: string; signedInStatus: string; staffId: number; staffName: string; maxCapacity: number; webCapacity: number; totalBooked: number; webBooked: number; totalWaitlisted: number; clientId: string; clientUniqueId: number; clientFirstName: string; clientLastName: string; clientEmail: string; clientPhone: string; clientPassId: string; clientPassSessionsTotal: number; clientPassSessionsDeducted: number; clientPassSessionsRemaining: number; clientPassActivationDateTime: string; clientPassExpirationDateTime: string; bookingOriginatedFromWaitlist: boolean; clientsNumberOfVisitsAtSite: number; itemId: number; itemName: string; itemSiteId: number; }>; type ClassRosterBookingStatusCancelled = WebhookEventBase<{ siteId: number; locationId: number; classId: number; classRosterBookingId: number; clientId: string; clientUniqueId: number; }>; type ClassRosterBookingStatusUpdated = WebhookEventBase<{ siteId: number; locationId: number; classId: number; classRosterBookingId: number; classDateTime: string; signedInStatus: string; staffId: number; clientId: string; clientUniqueId: number; clientFirstName: string; clientLastName: string; clientEmail: string; clientPhone: string; itemId: number; itemName: string; itemSiteId: number; clientPassId: string; }>; type ClassScheduleCancelled = WebhookEventBase<{ siteId: number; classScheduleId: number; }>; type ClassScheduleCreated = WebhookEventBase<{ siteId: number; locationId: number; classScheduleId: number; classDescriptionId: number; resources: { id: number; name: string; }[]; maxCapacity: number; webCapacity: number; staffId: number; staffName: string; isActive: boolean; startDate: string; endDate: string; startTime: string; endTime: string; daysOfWeek: string[]; assistantOneId: number; assistantOneName: string; assistantTwoId: number; assistantTwoName: string; }>; type ClassScheduleUpdated = WebhookEventBase<{ siteId: number; locationId: number; classScheduleId: number; classDescriptionId: number; resources: { id: number; name: string; }[]; maxCapacity: number; webCapacity: number; staffId: number; staffName: string; isActive: boolean; startDate: string; endDate: string; startTime: string; endTime: string; daysOfWeek: string[]; assistantOneId: number; assistantOneName: string; assistantTwoId: number; assistantTwoName: string; }>; type ClassUpdated = WebhookEventBase<{ siteId: number; locationId: number; classId: number; classScheduleId: number; isCancelled: boolean; isStaffASubstitute: boolean; isWaitlistAvailable: boolean; isIntendedForOnlineViewing: boolean; staffId: number; staffName: string; startDateTime: string; endDateTime: string; classDescriptionId: number; assistantOneId: number; assistantOneName: string; assistantTwoId: Nullable<number>; assistantTwoName: Nullable<string>; resources: { id: number; name: string; }[]; }>; type ClassWaitlistRequestCancelled = WebhookEventBase<{ siteId: number; waitlistEntryId: number; }>; type ClassWaitlistRequestCreated = WebhookEventBase<{ siteId: number; locationId: number; classId: number; classScheduleId: number; waitlistEntryId: number; waitlistMaxSize: number; clientId: string; clientUniqueId: number; clientEmail: string; clientPhone: string; classStartDateTime: string; classEndDateTime: string; clientsNumberOfVisitsAtSite: number; }>; type ClientContractCancelled = WebhookEventBase<{ siteId: number; clientId: string; clientUniqueId: number; clientContractId: number; }>; type ClientContractCreated = WebhookEventBase<{ siteId: number; clientId: string; clientUniqueId: number; clientFirstName: string; clientLastName: string; clientEmail: string; agreementDateTime: string; contractSoldByStaffId: number; contractSoldByStaffFirstName: string; contractSoldByStaffLastName: string; contractOriginationLocation: number; contractId: number; contractName: string; clientContractId: number; contractStartDateTime: string; contractEndDateTime: string; isAutoRenewing: boolean; }>; type ClientContractUpdated = WebhookEventBase<{ siteId: number; agreementDateTime: string; clientId: string; clientUniqueId: number; clientContractId: number; contractStartDateTime: string; contractEndDateTime: string; isAutoRenewing: boolean; }>; type ClientCreated = WebhookEventBase<{ siteId: number; clientId: string; clientUniqueId: number; creationDateTime: string; status: string; firstName: string; lastName: string; email: string; mobilePhone: string; homePhone: Nullable<string>; workPhone: Nullable<string>; addressLine1: string; addressLine2: Nullable<string>; city: string; state: string; postalCode: string; country: string; birthDateTime: string; gender: string; appointmentGenderPreference: Nullable<'Male' | 'Female'>; firstAppointmentDateTime: string; referredBy: Nullable<string>; isProspect: boolean; isCompany: boolean; isLiabilityReleased: boolean; liabilityAgreementDateTime: string; homeLocation: number; clientNumberOfVisitsAtSite: number; indexes: { indexName: string; indexValue: string; }[]; sendPromotionalEmails: boolean; sendScheduleEmails: boolean; sendAccountEmails: boolean; sendPromotionalTexts: boolean; sendScheduleTexts: boolean; sendAccountTexts: boolean; creditCardLastFour: string; creditCardExpDate: string; directDebitLastFour: string; notes: string; photoUrl: string; previousEmail: Nullable<string>; }>; type ClientDeactivated = WebhookEventBase<{ siteId: number; clientId: string; clientUniqueId: number; creationDateTime: string; status: string; firstName: string; lastName: string; email: string; mobilePhone: string; homePhone: Nullable<string>; workPhone: Nullable<string>; addressLine1: string; addressLine2: Nullable<string>; city: string; state: string; postalCode: string; country: string; birthDateTime: string; gender: string; appointmentGenderPreference: Nullable<'Male' | 'Female'>; firstAppointmentDateTime: string; referredBy: Nullable<string>; isProspect: boolean; isCompany: boolean; isLiabilityReleased: boolean; liabilityAgreementDateTime: string; homeLocation: number; clientNumberOfVisitsAtSite: number; indexes: { indexName: string; indexValue: string; }[]; sendPromotionalEmails: boolean; sendScheduleEmails: boolean; sendAccountEmails: boolean; sendPromotionalTexts: boolean; sendScheduleTexts: boolean; sendAccountTexts: boolean; creditCardLastFour: string; creditCardExpDate: string; directDebitLastFour: string; notes: string; photoUrl: string; previousEmail: Nullable<string>; }>; type ClientMembershipAssignmentCancelled = WebhookEventBase<{ siteId: number; clientId: string; membershipId: number; }>; type ClientMembershipAssignmentCreated = WebhookEventBase<{ siteId: number; clientId: string; clientUniqueId: number; clientFirstName: string; clientLastName: string; clientEmail: string; membershipId: number; membershipName: string; }>; type ClientUpdated = WebhookEventBase<{ siteId: number; clientId: string; clientUniqueId: number; creationDateTime: string; status: string; firstName: string; lastName: string; email: string; mobilePhone: string; homePhone: Nullable<string>; workPhone: Nullable<string>; addressLine1: string; addressLine2: Nullable<string>; city: string; state: string; postalCode: string; country: string; birthDateTime: string; gender: string; appointmentGenderPreference: Nullable<'Male' | 'Female'>; firstAppointmentDateTime: string; referredBy: Nullable<string>; isProspect: boolean; isCompany: boolean; isLiabilityReleased: boolean; liabilityAgreementDateTime: string; homeLocation: number; clientNumberOfVisitsAtSite: number; indexes: { indexName: string; indexValue: string; }[]; sendPromotionalEmails: boolean; sendScheduleEmails: boolean; sendAccountEmails: boolean; sendPromotionalTexts: boolean; sendScheduleTexts: boolean; sendAccountTexts: boolean; creditCardLastFour: string; creditCardExpDate: string; directDebitLastFour: string; notes: string; photoUrl: string; previousEmail: Nullable<string>; }>; type LocationDeactivated = WebhookEventBase<{ siteId: number; locationId: number; name: string; description: string; hasClasses: boolean; phoneExtension: Nullable<string>; addressLine1: string; addressLine2: Nullable<string>; city: string; state: string; postalCode: string; phone: string; latitude: number; longitude: number; tax1: number; tax2: number; tax3: number; tax4: number; tax5: number; webColor5: string; }>; type LocationCreated = WebhookEventBase<{ siteId: number; locationId: number; name: string; description: string; hasClasses: boolean; phoneExtension: Nullable<string>; addressLine1: string; addressLine2: Nullable<string>; city: string; state: string; postalCode: string; phone: string; latitude: number; longitude: number; tax1: number; tax2: number; tax3: number; tax4: number; tax5: number; webColor5: string; }>; type LocationUpdated = WebhookEventBase<{ siteId: number; locationId: number; name: string; description: string; hasClasses: boolean; phoneExtension: Nullable<string>; addressLine1: string; addressLine2: Nullable<string>; city: string; state: string; postalCode: string; phone: string; latitude: number; longitude: number; tax1: number; tax2: number; tax3: number; tax4: number; tax5: number; webColor5: string; }>; type SiteBusinessDayClosureCancelled = WebhookEventBase<{ siteId: number; businessDayClosureId: number; }>; type SiteBusinessDayClosureCreated = WebhookEventBase<{ siteId: number; businessDayClosureId: number; nameClosedDay: string; startDateTime: string; endDateTime: string; serviceCategoriesAffectedIds: number[]; }>; type SiteCreated = WebhookEventBase<{ siteId: number; name: string; description: string; logoURL: string; pageColor1: string; pageColor2: string; pageColor3: string; pageColor4: string; pageColor5: string; acceptsVisa: boolean; acceptsDiscover: boolean; acceptsMasterCard: boolean; acceptsAmericanExpress: boolean; isEmailContactApproved: boolean; isSmsPackageEnabled: boolean; subscriptionLevel: string; isActive: boolean; }>; type SiteDeactivated = WebhookEventBase<{ siteId: number; businessDayClosureId: number; nameClosedDay: string; startDateTime: string; endDateTime: string; serviceCategoriesAffectedIds: number[]; }>; type SiteUpdated = WebhookEventBase<{ siteId: number; businessDayClosureId: number; nameClosedDay: string; startDateTime: string; endDateTime: string; serviceCategoriesAffectedIds: number[]; }>; type EventType = 'site.created' | 'site.updated' | 'site.deactivated' | 'siteBusinessDayClosure.created' | 'siteBusinessDayClosure.cancelled' | 'location.created' | 'location.updated' | 'location.deactivated' | 'appointmentBooking.created' | 'appointmentBooking.updated' | 'appointmentBooking.cancelled' | 'appointmentAddOn.created' | 'appointmentAddOn.deleted' | 'classSchedule.created' | 'classSchedule.updated' | 'classSchedule.cancelled' | 'class.updated' | 'classRosterBooking.created' | 'classRosterBooking.cancelled' | 'classRosterBookingStatus.updated' | 'classWaitlistRequest.created' | 'classWaitlistRequest.cancelled' | 'client.created' | 'client.updated' | 'client.deactivated' | 'clientProfileMerger.created' | 'clientMembershipAssignment.created' | 'clientMembershipAssignment.cancelled' | 'clientContract.created' | 'clientContract.updated' | 'clientContract.cancelled' | 'clientSale.created' | 'staff.created' | 'staff.updated' | 'staff.deactivated'; type Metrics = { items: Metric[]; }; type Metric = { subscriptionId: string; status: 'PendingActivation' | 'Active' | 'DeactivatedByUser' | 'DeactivatedByAdmin' | 'DeactivatedTooManyFailedMessageDeliveryAttempts' | 'DeactivatedByEventDeactivation'; statusChangeDate: string; creationDateTime: string; messagesAttempted: number; messagesDelivered: number; messagesUndelivered: number; messagesFailed: number; }; type SubscriptionStatus = 'PendingActivation' | 'Active' | 'DeactivatedByUser' | 'DeactivatedByAdmin' | 'DeactivatedTooManyFailedMessageDeliveryAttempts' | 'DeactivatedByEventDeactivation'; type Subscriptions = { items: Subscription[]; }; type Subscription = { subscriptionId: string; status: SubscriptionStatus; subscriptionCreationDateTime: string; statusChangeDate: string; statusChangeMessage: Nullable<string>; statusChangeUser: string; eventIds: string[]; eventSchemaVersion: number; referenceId: string; webhookUrl: string; }; type DeactivatedSubscription = { message: string; deactivationDateTime: string; subscriptionId: string; referenceId: string; }; declare enum WebhookErrorCode { missingAPIKeyHeader = "missingAPIKeyHeader", forbidden = "forbidden", developerAccountNotActive = "developerAccountNotActive", resourceNotFound = "resourceNotFound", invalidValueWebhookURLRequired = "invalidValueWebhookURLRequired", invalidValueWebhookURLCannotBeBlank = "invalidValueWebhookURLCannotBeBlank", invalidValueWebhookURLTooLong = "invalidValueWebhookURLTooLong", invalidWebhookURLMissingHTTPS = "invalidWebhookURLMissingHTTPS", invalidWebhookURLNoResponse = "invalidWebhookURLNoResponse", invalidEventSchemaVersionRequired = "invalidEventSchemaVersionRequired", invalidEventSchemaVersion = "invalidEventSchemaVersion", invalidValueEventIdsRequired = "invalidValueEventIdsRequired", invalidValueEventIdsCannotBeBlank = "invalidValueEventIdsCannotBeBlank", invalidValueEventIds = "invalidValueEventIds", invalidValueReferenceIdTooLong = "invalidValueReferenceIdTooLong", invalidSubscriptionId = "invalidSubscriptionId", invalidWebhookUrlBadFormat = "invalidWebhookUrlBadFormat", invalidWebhookUrlError = "invalidWebhookUrlError", subscriptionStatusNotValid = "subscriptionStatusNotValid" } type WebhookErrorResponse = { errors: { errorCode: number; errorType: WebhookErrorCode; errorMessage: string; }[]; }; type WebhookEventBase<TEventData extends Kv> = { messageId: string; eventId: string; eventSchemaVersion: number; eventInstanceOriginationDate: string; eventData: TEventData; }; type index$1_AppointmentAddOnCreated = AppointmentAddOnCreated; type index$1_AppointmentAddOnDeleted = AppointmentAddOnDeleted; type index$1_AppointmentBookingCancelled = AppointmentBookingCancelled; type index$1_AppointmentBookingCreated = AppointmentBookingCreated; type index$1_AppointmentBookingUpdated = AppointmentBookingUpdated; type index$1_ClassDescriptionUpdated = ClassDescriptionUpdated; type index$1_ClassRosterBookingCreated = ClassRosterBookingCreated; type index$1_ClassRosterBookingStatusCancelled = ClassRosterBookingStatusCancelled; type index$1_ClassRosterBookingStatusUpdated = ClassRosterBookingStatusUpdated; type index$1_ClassScheduleCancelled = ClassScheduleCancelled; type index$1_ClassScheduleCreated = ClassScheduleCreated; type index$1_ClassScheduleUpdated = ClassScheduleUpdated; type index$1_ClassUpdated = ClassUpdated; type index$1_ClassWaitlistRequestCancelled = ClassWaitlistRequestCancelled; type index$1_ClassWaitlistRequestCreated = ClassWaitlistRequestCreated; type index$1_ClientContractCancelled = ClientContractCancelled; type index$1_ClientContractCreated = ClientContractCreated; type index$1_ClientContractUpdated = ClientContractUpdated; type index$1_ClientCreated = ClientCreated; type index$1_ClientDeactivated = ClientDeactivated; type index$1_ClientMembershipAssignmentCancelled = ClientMembershipAssignmentCancelled; type index$1_ClientMembershipAssignmentCreated = ClientMembershipAssignmentCreated; type index$1_ClientUpdated = ClientUpdated; type index$1_DeactivatedSubscription = DeactivatedSubscription; type index$1_EventType = EventType; type index$1_LocationCreated = LocationCreated; type index$1_LocationDeactivated = LocationDeactivated; type index$1_LocationUpdated = LocationUpdated; type index$1_Metric = Metric; type index$1_Metrics = Metrics; type index$1_SiteBusinessDayClosureCancelled = SiteBusinessDayClosureCancelled; type index$1_SiteBusinessDayClosureCreated = SiteBusinessDayClosureCreated; type index$1_SiteCreated = SiteCreated; type index$1_SiteDeactivated = SiteDeactivated; type index$1_SiteUpdated = SiteUpdated; type index$1_Subscription = Subscription; type index$1_SubscriptionStatus = SubscriptionStatus; type index$1_Subscriptions = Subscriptions; type index$1_WebhookErrorCode = WebhookErrorCode; declare const index$1_WebhookErrorCode: typeof WebhookErrorCode; type index$1_WebhookErrorResponse = WebhookErrorResponse; type index$1_WebhookEventBase<TEventData extends Kv> = WebhookEventBase<TEventData>; declare namespace index$1 { export { type index$1_AppointmentAddOnCreated as AppointmentAddOnCreated, type index$1_AppointmentAddOnDeleted as AppointmentAddOnDeleted, type index$1_AppointmentBookingCancelled as AppointmentBookingCancelled, type index$1_AppointmentBookingCreated as AppointmentBookingCreated, type index$1_AppointmentBookingUpdated as AppointmentBookingUpdated, type index$1_ClassDescriptionUpdated as ClassDescriptionUpdated, type index$1_ClassRosterBookingCreated as ClassRosterBookingCreated, type index$1_ClassRosterBookingStatusCancelled as ClassRosterBookingStatusCancelled, type index$1_ClassRosterBookingStatusUpdated as ClassRosterBookingStatusUpdated, type index$1_ClassScheduleCancelled as ClassScheduleCancelled, type index$1_ClassScheduleCreated as ClassScheduleCreated, type index$1_ClassScheduleUpdated as ClassScheduleUpdated, type index$1_ClassUpdated as ClassUpdated, type index$1_ClassWaitlistRequestCancelled as ClassWaitlistRequestCancelled, type index$1_ClassWaitlistRequestCreated as ClassWaitlistRequestCreated, type index$1_ClientContractCancelled as ClientContractCancelled, type index$1_ClientContractCreated as ClientContractCreated, type index$1_ClientContractUpdated as ClientContractUpdated, type index$1_ClientCreated as ClientCreated, type index$1_ClientDeactivated as ClientDeactivated, type index$1_ClientMembershipAssignmentCancelled as ClientMembershipAssignmentCancelled, type index$1_ClientMembershipAssignmentCreated as ClientMembershipAssignmentCreated, type index$1_ClientUpdated as ClientUpdated, type index$1_DeactivatedSubscription as DeactivatedSubscription, type index$1_EventType as EventType, type index$1_LocationCreated as LocationCreated, type index$1_LocationDeactivated as LocationDeactivated, type index$1_LocationUpdated as LocationUpdated, type index$1_Metric as Metric, type index$1_Metrics as Metrics, type index$1_SiteBusinessDayClosureCancelled as SiteBusinessDayClosureCancelled, type index$1_SiteBusinessDayClosureCreated as SiteBusinessDayClosureCreated, type index$1_SiteCreated as SiteCreated, type index$1_SiteDeactivated as SiteDeactivated, type index$1_SiteUpdated as SiteUpdated, type index$1_Subscription as Subscription, type index$1_SubscriptionStatus as SubscriptionStatus, type index$1_Subscriptions as Subscriptions, index$1_WebhookErrorCode as WebhookErrorCode, type index$1_WebhookErrorResponse as WebhookErrorResponse, type index$1_WebhookEventBase as WebhookEventBase }; } type CreateSubscriptionPayload = { eventIds: EventType[]; webhookUrl: string; eventSchemaVersion: 1; referenceId?: string; }; type UpdateSubscriptionPayload = { eventIds: EventType[]; webhookUrl: string; status: 'Active' | 'DeactivatedByUser'; eventSchemaVersion: 1; referenceId?: string; }; type ActivationCode = { ActivationCode: string; ActivationLink: string; }; type AddClientToEnrollment = { Classes: { ClassScheduleId: number; Visits: Visit[]; Clients: Client[]; Location: Location; Resource: { Id: number; Name: string; }; MaxCapacity: number; WebCapacity: number; TotalBooked: number; TotalBookedWaitlist: number; WebBooked: number; SemesterId: number; IsCanceled: boolean; Substitute: boolean; Active: boolean; IsWaitlistAvailable: boolean; IsEnrolled: boolean; HideCancel: boolean; Id: number; IsAvailable: boolean; StartDateTime: string; EndDateTime: string; LastModifiedDateTime: string; ClassDescription: ClassDescription; Staff: Staff; BookingWindow: { StartDateTime: string; EndDateTime: string; DailyStartTime: string; DailyEndTime: string; }; BookingStatus: string; VirtualStreamLink: string; }[]; Clients: Client[]; Course: Course; SemesterId: number; IsAvailable: boolean; Id: number; ClassDescription: ClassDescription; DaySunday: boolean; DayMonday: boolean; DayTuesday: boolean; DayWednesday: boolean; DayThursday: boolean; DayFriday: boolean; DaySaturday: boolean; AllowOpenEnrollment: boolean; AllowDateForwardEnrollment: boolean; StartTime: string; EndTime: string; StartDate: string; EndDate: string; Staff: Staff; Location: Location; }; type AddContactLog = { Id: number; Text: string; CreatedDateTime: string; FollowupByDate: string; ContactMethod: string; ContactName: string; Client: Client; CreatedBy: Staff; AssignedTo: Staff; Comments: { Id: number; Text: string; CreatedDateTime: string; CreatedBy: Staff; Types: { Id: number; SubTypes: { Id: number; }[]; }[]; }[]; }; type AddOns = { AddOnds: AddOn[]; }; type AddOn = { Name: string; Id: number; NumDeducted: number; Category: string; CategoryId: string; }; type AddStaffSessionType = { StaffId: number; SessionType: number; Active: boolean; TimeLength: number; PrepTime: number; FinishTime: number; PayRateTime: number; PayRateType: string; PayRateAmount: number; }; type ApplicableItem = { ID: number; Name: string; Type: 'ServiceCategory' | 'RevenueCategory' | 'Supplier' | 'Item'; }; type Appointments = { Appointments: Appointment[]; }; type Appointment = { GenderPreference: 'None' | 'Female' | 'Male'; Duration: number; ProviderId: string; Id: number; Status: 'None' | 'Requested' | 'Booked' | 'Completed' | 'Confirmed' | 'Arrived' | 'NoShow' | 'Cancelled' | 'LateCancelled'; StartDateTime: string; EndDateTime: string; Notes: string; StaffRequested: boolean; ProgramId: number; SessionTypeId: number; LocationId: number; StaffId: number; ClientId: string; FirstAppointment: boolean; IsWaitlist: boolean; WaitlistEntryId: Nullable<number>; ClientServiceId: number; Resources: { Id: number; Name: string; }[]; AddOns: { Id: number; Name: string; StaffId: number; }[]; OnlineDescription: string; }; type AppointmentOptions = { AppointmentOptions: AppointmentOption[]; }; type AppointmentOption = { DisplayName: string; Name: string; Value: string; Type: string; }; type AssignedClientIndex = { Id: number; ValueId: number; }; type Availabilities = { Availabilities: Availability[]; }; type Availability = { Id: number; Staff: Staff; SessionType: SessionType; Program: Program; StartDateTime: string; EndDateTime: string; BookableEndDateTime: string; Location: Location; }; type Categories = { Categories: Category[]; }; type Category = { Id: number; CategoryName: string; Description: Nullable<string>; Service: boolean; Active: boolean; IsPrimary: boolean; IsSecondary: boolean; CreatedDateTimeUTC: string; ModifiedDateTimeUTC: string; SubCategories: SubCategory[]; }; type Classes = { Classes: Class[]; }; type Class = { ClassScheduleId: number; Visits: Nullable<Visit[]>; Clients: Client[]; Location: Location; Resource: Nullable<{ Id: number; Name: string; }>; MaxCapacity: number; WebCapacity: number; TotalBooked: number; TotalBookedWaitlist: number; WebBooked: number; SemesterId: Nullable<number>; IsCanceled: boolean; Substitute: boolean; Active: boolean; IsWaitlistAvailable: boolean; IsEnrolled: Nullable<boolean>; HideCancel: boolean; Id: number; IsAvailable: boolean; StartDateTime: string; EndDateTime: string; LastModifiedDateTime: string; ClassDescription: ClassDescription; Staff: Staff; BookingWindow: { StartDateTime: string; EndDateTime: string; DailyStartTime: Nullable<string>; DailyEndTime: Nullable<string>; }; BookingStatus: 'PaymentRequired' | 'BookAndPayLater' | 'Free'; VirtualStreamLink: Nullable<string>; }; type ClassDescriptions = { ClassDescriptions: ClassDescription[]; }; type ClassDescription = { Active: boolean; Description: string; Id: number; ImageURL: Nullable<string>; LastUpdated: string; Level: Nullable<{ Id: number; Name: string; Description: string; }>; Name: string; Notes: string; Prereq: string; Program: Program; SessionType: SessionType; Category: string; CategoryId: number; Subcategory: string; SubcategoryId: number; }; type ClassSchedules = { ClassSchedules: ClassSchedule[]; }; type ClassSchedule = { Classes: Class[]; Clients: Nullable<Client[]>; Course: Nullable<Course[]>; SemesterId: Nullable<number>; IsAvailable: boolean; Id: number; ClassDescription: ClassDescription; DaySunday: boolean; DayMonday: boolean; DayTuesday: boolean; DayWednesday: boolean; DayThursday: boolean; DayFriday: boolean; DaySaturday: boolean; AllowOpenEnrollment: boolean; AllowDateForwardEnrollment: boolean; StartTime: string; EndTime: string; StartDate: string; EndDate: string; Staff: Staff; Location: Location; }; type Clients = { Clients: Client[]; }; type Client = { AppointmentGenderPreference: string; BirthDate: Nullable<string>; Country: string; CreationDate: string; CustomClientFields: Record<string, unknown>[]; ClientCreditCard: Nullable<ClientCreditCard>; ClientIndexes: AssignedClientIndex[]; ClientRelationships: ClientRelationship[]; FirstAppointmentDate: Nullable<string>; FirstName: string; Id: string; IsCompany: boolean; IsProspect: boolean; LastName: string; Liability: { AgreementDate: Nullable<string>; IsReleased: boolean; ReleasedBy: Nullable<number>; }; LiabilityRelease: boolean; MembershipIcon: number; MobileProvider: MobileProvider; Notes: string; State: string; UniqueId: number; LastModifiedDateTime: string; RedAlert: Nullable<string>; YellowAlert: Nullable<string>; MiddleName: Nullable<string>; ProspectStage: Nullable<ProspectStage>; Email: string; MobilePhone: Nullable<string>; HomePhone: Nullable<string>; WorkPhone: Nullable<string>; AccountBalance: number; AddressLine1: Nullable<string>; AddressLine2: Nullable<string>; City: string; PostalCode: string; WorkExtension: Nullable<string>; ReferredBy: Nullable<string>; PhotoUrl: Nullable<string>; EmergencyContactInfoName: Nullable<string>; EmergencyContactInfoEmail: Nullable<string>; EmergencyContactInfoPhone: Nullable<string>; EmergencyContactInfoRelationship: Nullable<string>; Gender: string; LastFormulaNotes: Nullable<string>; Active: boolean; SalesReps: Nullable<SalesRep[]>; Status: string; Action: string; SendAccountEmails: boolean; SendAccountTexts: boolean; SendPromotionalEmails: boolean; SendPromotionalTexts: boolean; SendScheduleEmails: boolean; SendScheduleTexts: boolean; HomeLocation: Location; LockerNumber: Nullable<string>; SuspensionInfo: Nullable<{ BookingSuspended: boolean; SuspensionStartDate: Nullable<string>; SuspensionEndDate: Nullable<string>; }>; }; type ClientArrival = { ArrivalProgramID: number; ArrivalProgramName: string; CanAccess: boolean; LocationsIDs: Nullable<number>[]; }; type ClientCompleteInfo = { Client: Client; ClientServices: ClientService[]; ClientContracts: Contract[]; ClientMemberships: ClientMembership[]; ClientArrivals: ClientArrival[]; }; type ClientContracts = { Contracts: ClientContract[]; }; type ClientContract = { AgreementDate: string; AutopayStatus: 'Active' | 'Inactive' | 'Suspended'; ContractName: string; EndDate: string; Id: number; OriginationLocationId: number; StartDate: string; SiteId: number; UpcomingAutopayEvents: { ClientContractId: number; ChargeAmount: number; PaymentMethod: string; ScheduleDate: string; }[]; }; type ClientCreditCard = { Address: string; CardHolder: string; CardNumber: string; CardType: string; City: string; ExpMonth: string; ExpYear: string; LastFour: string; PostalCode: string; State: string; }; type ClientDuplicates = { ClientDuplicates: ClientDuplicate[]; }; type ClientDuplicate = { Id: string; UniqueId: string; FirstName: string; LastName: string; Email: string; }; type ClientIndexes = { ClientIndexes: ClientIndex[]; }; type ClientIndex = { Id: number; Name: string; RequiredBusinessMode: boolean; RequiredConsumerMode: boolean; Values: { Active: boolean; Id: number; Name: string; }[]; Action: string; }; type ActiveClientMemberships = { ClientMemberships: ClientMembership[]; }; type ClientsMemberships = { ClientMemberships: { ClientId: string; Memberships: ClientMembership[]; }[]; }; type ClientMembership = { RestrictedLocations: Location[]; IconCode: string; MembershipId: number; } & ClientService; type ClientPurchases = { Purchases: ClientPurchase[]; }; type ClientPurchase = { Sale: Sale; }; type ClientRelationship = { RelatedClientId: string; RelationshipName: string; Delete: boolean; Relationship: Relationship[]; }; type ClientRewards = { Balance: number; Transactions: RewardTransaction[]; }; type RewardTransaction = { ActionDateTime: string; Action: string; Source: string; SourceID: number; ExpirationDateTime: Nullable<string>; Points: number; }; type ClientServices = { ClientServices: ClientService[]; }; type ClientService = { ActiveDate: string; Count: number; Current: boolean; ExpirationDate: string; Id: number; ProductId: number; Name: string; PaymentDate: string; Program: Program; Remaining: number; SiteId: number; Action: 'None' | 'Added' | 'Updated' | 'Failed' | 'Removed'; }; type ClientVisits = { Visits: ClientVisit[]; }; type ClientVisit = { AppointmentId: number; AppointmentGenderPreference: string; AppointmentStatus: string; ClassId: number; ClientId: number; StartDateTime: string; EndDateTime: string; Id: number; LastModifiedDateTime: string; LateCancelled: boolean; SiteId: number; LocationId: number; MakeUp: boolean; Name: string; ServiceId: number; ServiceName: string; ProductId: number; SignedIn: boolean; StaffId: number; WebSignup: boolean; Action: string; Missed: boolean; VisitType: number; TypeGroup: number; TypeTaken: string; }; type CommissionType = 'ItemStandardPercentageCommission' | 'ItemStandardFlatCommission' | 'ItemPromotionalPercentageCommission' | 'ItemPromotionalFlatCommission' | 'StaffStandardPercentageCommission' | 'StaffStandardFlatCommission' | 'StaffPromotionalPercentageCommission' | 'StaffPromotionalFlatCommission' | 'ItemStandardPercentageCommissionReturn' | 'ItemStandardFlatCommissionReturn' | 'ItemPromotionalPercentageCommissionReturn' | 'ItemPromotionalFlatCommissionReturn' | 'StaffStandardPercentageCommissionReturn' | 'StaffStandardFlatCommissionReturn' | 'StaffPromotionalPercentageCommissionReturn' | 'StaffPromotionalFlatCommissionReturn'; type Commissions = { Commissions: { OriginatingSaleId?: number; StaffId: number; SaleDateTime: string; SaleId: number; SaleType: 'Purchase' | 'Return'; ProductId: number; Earnings: number; EarningsDetails: { CommissionType: CommissionType; CommissionEarnings: number; }[]; }[]; }; type ContactLogs = { ContactLogTypes: ContactLog[]; }; type ContactLog = { Id: number; Name: string; SubTypes: { Id: number; }; }; type Contracts = { Contracts: Contract[]; }; type Contract = { Id: number; Name: string; Description: string; AssignsMembershipId: number; AssignsMembershipName: string; SoldOnline: boolean; ContractItems: { Id: string; Name: string; Description: string; Type: string; Price: number; Quantity: number; OneTimeItem: boolean; }[]; IntroOffer: 'None' | 'NewConsumer' | 'NewAndReturningCustomer'; AutopaySchedule: Nullable<{ FrequencyType: 'SetNumberOfAutopays' | 'MonthToMonth'; FrequencyValue: Nullable<number>; FrequencyTimeUnit: Nullable<'Weekly' | 'Monthly' | 'Yearly'>; }>; NumberOfAutopays: Nullable<number>; AutopayTriggerType: 'ContractExpires' | 'ContractAutomaticallyRenews'; ActionUponCompletionOfAutopays: string; ClientsChargedOn: 'OnSaleDate' | 'FirstOfTheMonth' | 'FifteenthOfTheMonth' | 'LastDayOfTheMonth' | 'FirstOrFifteenthOfTheMonth' | 'FirstOrSixteenthOfTheMonth' | 'FifteenthOrEndOfTheMonth' | 'SpecificDate'; ClientsChargedOnSpecificDate: Nullable<string>; DiscountAmount: number; DepositAmount: number; FirstAutopayFree: boolean; LastAutopayFree: boolean; ClientTerminateOnline: boolean; MembershipTypeRestrictions: { Id: number; Name: string; }[]; LocationPurchaseRestrictionIds: number[]; LocationPurchaseRestrictionNames: string[]; AgreementTerms: string; RequiresElectronicConfirmation: boolean; AutopayEnabled: boolean; FirstPaymentAmountSubtotal: number; FirstPaymentAmountTax: number; FirstPaymentAmountTotal: number; RecurringPaymentAmountSubtotal: number; RecurringPaymentAmountTax: number; RecurringPaymentAmountTotal: number; TotalContractAmountSubtotal: number; TotalContractAmountTax: number; TotalContractAmountTotal: number; }; type Courses = { Courses: Course[]; }; type Course = { Id: number; Name: string; Description: string; Notes: string; StartDate: string; EndDate: string; Location: Location; ImageUrl: string; Organizer: Staff; Program: Program; }; type CrossRegionalClientAssociations = { CrossRegionalClientAssociations: CrossRegionalClientAssociation[]; }; type CrossRegionalClientAssociation = { SiteId: string; ClientId: string; UniqueId: string; }; type CustomClientFields = { CustomClientFields: CustomClientField[]; }; type CustomClientField = { Id: string; DataType: string; Name: string; }; type CustomPaymentMethods = { PaymentMethods: CustomPaymentMethod[]; }; type CustomPaymentMethod = { Id: number; Name: string; }; type DirectDebitInfo = { NameOnAccount: string; RoutingNumber: string; AccountNumber: string; AccountType: 'Checking' | 'Savings'; }; type Enrollments = { Enrollments: Enrollment[]; }; type Enrollment = { Id: number; IsAvailable: boolean; SemesterId: number; Classes: Class[]; Clients: Client[]; Course: Course; Staff: Staff; Location: Location; ClassDescription: ClassDescription; DaySunday: boolean; DayMonday: boolean; DayTuesday: boolean; DayWednesday: boolean; DayThursday: boolean; DayFriday: boolean; DaySaturday: boolean; AllowOpenEnrollment: boolean; AllowDateForwardEnrollment: boolean; StartTime: string; EndTime: string; StartDate: string; EndDate: string; }; type FormulaNotes = { FormulaNotes: FormulaNote[]; }; type FormulaNote = { Id: number; ClientId: string; Note: string; EntryDate: string; AppointmentId: number; SiteId: string; SiteName: string; StaffFirstName: Nullable<string>; StaffLastName: Nullable<string>; StaffDisplayName: Nullable<string>; }; type GenderOptions = { GenderOptions: Gender[]; }; type Gender = { Id: number; Name: string; IsActive: boolean; IsDefault: boolean; }; type GiftCardBalance = { BarcodeId: string; RemainingBalance: number; }; type GiftCards = { GiftCards: GiftCard[]; }; type GiftCard = { Id: number; LocationIds: number[]; Description: string; EditableByConsumer: boolean; CardValue: number; SalePrice: number; SoldOnline: boolean; MembershipRestrictionIds: number[]; GiftCardTerms: string; ContactInfo: Nullable<string>; DisplayLogo: boolean; Layouts: { LayoutId: number; LayoutName: string; LayoutUrl: string; }[]; }; type Locations = { Locations: Location[]; }; type Location = { AdditionalImageURLs: Nullable<string[]>; Address: string; Address2: string; Amenities: Nullable<{ Id: number; Name: string; }[]>; BusinessDescription: Nullable<string>; City: string; Description: string; HasClasses: boolean; Id: number; Latitude: number; Longitude: number; Name: string; Phone: string; PhoneExtension: Nullable<string>; PostalCode: string; SiteID: number; StateProvCode: string; Tax1: number; Tax2: number; Tax3: number; Tax4: number; Tax5: number; TotalNumberOfRatings: number; AverageRating: number; TotalNumberOfDeals: number; }; type Memberships = { Memberships: Membership[]; }; type Membership = { MembershipId: number; MembershipName: string; Priority: number; MemberRetailDiscount: number; MemberServiceDiscount: number; AllowClientsToScheduleUnpaid: boolean; OnlineBookingRestrictedToMembersOnly: { Id: number; Name: string; }[]; DayOfMonthSchedulingOpensForNextMonth: Nullable<number[]>; RestrictSelfSignInToMembersOnly: boolean; AllowMembersToBookAppointmentsWithoutPaying: boolean; AllowMembersToPurchaseNonMembersServices: boolean; AllowMembersToPurchaseNonMembersProducts: boolean; IsActive: boolean; }; type MobileProviders = { MobileProviders: MobileProvider[]; }; type MobileProvider = { Id: number; Active: boolean; ProviderName: string; ProviderAddress: string; }; type Packages = { Packages: Package[]; }; type Package = { Id: number; Name: string; DiscountPercentage: number; SellOnline: boolean; Services: Service[]; Products: Product[]; }; type CreditCardPaymentItemMetadata = { Amount: number; CreditCardNumber: string; ExpMonth: number; ExpYear: number; Cvv: string; BillingName: string; BillingAddress: string; BillingCity: string; BillingState: string; BillingPostalCode: string; SaveInfo?: boolean; }; type PackagePaymentItemMetadata = { Id: number; }; type TipPaymentItemMetadata = { StaffId: number; Amount: number; }; type StoredCardPaymentItemMetadata = { Amount: number; Last4: string; }; type DirectDebitPaymentItemMetadata = { Amount: number; }; type EncryptedTrackDataPaymentItemMetadata = { Amount: number; TrackData: string; }; type TrackDataPaymentItemMetadata = { Amount: number; TrackData: string; }; type DebitPaymentItemMetadata = { Amount: number; TrackData: string; }; type CustomPayment