UNPKG

tickethead-sdk

Version:

SDK for the Tickethead API

395 lines 10.3 kB
import { TicketFormatType } from '../order/types'; import { Address, IdParam } from '../common/types'; export declare enum KycLevel { None = 1, TicketHolderInfo = 2, PhotoIdNoFm = 3, PhotoIdFm = 4 } /** * Additional fields which can be included in an organizer response */ export type OrganizerAdditionalFields = 'tos' | 'payment_providers' | 'ticket_format' | 'workspace' | 'branding'; export type UserAdditionalFields = 'permissions'; /** * The ID or the `name` of an organizer */ export interface OrganizerId { id: string | number; } export interface OrganizerQuery { fields?: OrganizerAdditionalFields[]; } export interface UserQuery { fields?: UserAdditionalFields[]; } export interface ListUserQuery { email?: string; deleted?: boolean; sort_by?: 'id' | 'username' | 'verified' | 'email'; direction?: 'asc' | 'desc'; limit?: number; offset?: number; enrollment_id?: string[]; include_permissions?: boolean; } export interface GetOrganizerRequest extends OrganizerId, OrganizerQuery { } /** * For creating a new organizer. * * @param name will be in the url and used internally, can't be changed * @param displayName shown to clients * @param organizationName blockchain tenant, umbrella organization * @param parentOrganizerName Specify the name of the parent if this is a child organizer * @param ownerId id of the person to be granted all permissions * @param kycLevelId default KYC level required on the organizer's events * @param ticketFormats which ticket formats are supported by default * @param url website of the organization * @param tos Terms of Service of the organizer */ export interface NewOrganizer extends Partial<Address> { name: string; displayName?: string; organizationName?: string; ownerId: number; email?: string; phone?: string; kycLevelId?: KycLevel; ticketFormats?: TicketFormatType[]; url?: string; tos?: string; companyRegisterNumber?: string; logoUrl?: string; parentOrganizerName?: string; } /** * Organizer interface */ export interface Organizer { id: number; name: string; organizationName: string; displayName: string; url: string; ownerId: number; kycLevelId: KycLevel; eventTimerS: number; street1: string; street2: string; city: string; state: string; country: string; zip: string; email: string; phone: string; taxNumber?: string; companyRegisterNumber?: string; logoUrl?: string; status?: string; tos?: string; workspaceKey?: string; fees?: Fee[]; ticketFormats?: string[]; paymentProviders?: PaymentProviderData[]; manuallyApproved?: boolean; dashboardId?: string; metaPixelId?: string; gtmId?: string; stripeConnectComplete?: boolean; stripeConnectMatch?: boolean; legalInfoComplete?: boolean; requireStripeConnect?: boolean; requireLegalInfo?: boolean; parentOrganizerName?: string; branding?: OrganizerBrandingResponse; } export interface PaymentProviderData { id: number; orgId: number; name: string; providerAccId: string; } export interface Fee { id: number; organizerId: number; type: FeeType; fixedAmount?: number; minimumAmount?: number; maximumAmount?: number; percentage?: number; currencyId: number; taxRate?: number; currency?: Currency; } export declare enum FeeType { PerOrder = 0, PerOrderItem = 1, PerTicket = 2 } export interface Currency { id: number; name: string; acronym: string; } export interface FeeUpdate { fixedAmount?: number; minimumAmount?: number; maximumAmount?: number; percentage?: number; currencyId?: number; taxRate?: number; } export type FeeCreate = Omit<Fee, 'id' | 'currency'>; export interface FeeQuery extends ListQuery { organizer_id?: string; sort_by?: 'id' | 'currencyId' | 'organizerId'; direction?: 'asc' | 'desc'; } export declare enum Roles { User = 0, OnSiteSales = 1, HostOrganizer = 2, HostManager = 3, Admin = 4, Custom = 5 } export interface EnrollmentId { enrollmentId: string; } export interface UserMeta extends Partial<Address> { firstName?: string; lastName?: string; dateOfBirth?: Date; gender?: string; phone?: string; description?: string; pictureUrl?: string; paypalAccount?: string; localeCode?: string; firebaseToken?: string; referral_source?: string; } export interface User extends UserMeta, IdParam { username: string; email: string; enrollmentId: string; verified: boolean; permissions?: CompletePermissions; shouldRenewCertificate: boolean; } export interface NewUser extends UserMeta { password: string; username: string; email: string; } export type PublicUser = Pick<User, 'pictureUrl' | 'username' | 'id'>; export interface UserPermissions { organizationName: string; role: Roles; grantedPermissions?: PerOrgPermissions; } export interface UserInviteData extends UserMeta { password?: string; username?: string; email: string; } export interface UserInvite extends UserInviteData, UserPermissions { } export interface UserUpdate extends UserMeta { password?: string; username?: string; email?: string; deleted?: boolean; } export interface UserPermissionChange { granted: CompletePermissions; revoked: CompletePermissions; } export interface PublicUserData { id: number; username: string; pictureUrl?: string; enrollmentId?: string; } export type CompletePermissions = { [key: string]: PerOrgPermissions; }; export type PerOrgPermissions = { [key: string]: string[]; }; export interface Email { email: string; } export interface VerificationCode { code: string; } export interface Password { password: string; } export interface ResetPasswordCode { resetCode: string; } export interface PasswordResetRequest extends ResetPasswordCode, Password { } export interface Wallet { id: number; enrollmentId: string; certificate: string; privateKey: string; } /** * Represents a workspace on seats.io. * It is used for creating seating charts, social distancing rules and associating events with seating charts. * * @param organizerId the number id of the organizer to which the workspace belongs to * @param name the name of the workspace * @param key the public key, used for rendering charts on the frontend * @param secretKey the key which is used for administration of the workspace * @param isTest represents if the workspace and the organizer are in test mode */ export interface SeatsWorkspace { id: number; organizerId: number; name: string; key: string; secretKey: string; isTest: boolean; isActive: boolean; isDefault: boolean; } export interface MarketRuleset { id: string; name: string; priceLimitPercentage: number; priceLimitFixed: number; feeFixed: number; feePercentage: number; transferEnabled: boolean; resaleEnabled: boolean; organizerId: number; status: MarketControlStatus; } export interface MarketRulesetCreate { organizerId: number; name?: string; priceLimitPercentage?: number; priceLimitFixed?: number; feeFixed?: number; feePercentage?: number; transferEnabled?: boolean; resaleEnabled?: boolean; } export interface MarketRulesetUpdate { name?: string; priceLimitPercentage?: number; priceLimitFixed?: number; feeFixed?: number; feePercentage?: number; transferEnabled?: boolean; resaleEnabled?: boolean; } export interface ListQuery { sort_by?: string; direction?: string; } export interface MarketRulesetListQuery extends ListQuery { organizer_id?: number; } export declare enum MarketControlStatus { Draft = "draft", Published = "published", Updated = "updated" } export interface KYCLevel { id: number; level: string; displayName: string; } export interface OnboardStripePayload { returnUrl: string; refreshUrl: string; } export interface OnboardStripeResponse { redirectUrl: string; } export interface OnboardStripeStatus { completedOnboarding: boolean; fullyOnboard: boolean; canUseStripe: boolean; } export interface OrganizerDomain { id: number; organizerId: number; name: string; organizer?: Organizer; } export type OrganizerDomainCreate = { organizerId: number; name: string; } | { organizerName: string; name: string; }; export interface OrganizerDomainUpdate { name: string; } /** * Query for listing organizer domains * * @param organizer_id the id or the name of the organizer * @param name the whole or partial domain */ export interface OrganizerDomainQuery extends ListQuery { organizer_id?: number | string; name?: string; } export interface NewsletterCreate { subject: string; content: string; } export type NewsletterUpdate = Partial<NewsletterCreate>; export interface Newsletter extends NewsletterCreate { id: number; sentAt?: Date; } export interface NewsletterQuery extends ListQuery { sort_by?: 'sentAt' | 'subject' | 'id'; } /** * @param organizerId organizers name or ID * @param dashboardId the ID of the superset dashboard * @param eventId optionally, the reports should only include rows from this event * @param parentEventId optionally, the reports should only include rows from events with this parent event ID */ export interface ReportParams { organizerId: string; dashboardId: string; eventId?: number; parentEventId?: number; } /** * @param token Guest access token for the report dashboard */ export interface ReportResponse { token: string; } export interface OrganizerBrandingData { primary?: string; gray?: string; highlightSuccess?: string; highlightInfo?: string; highlightWarning?: string; highlightError?: string; } export interface OrganizerBrandingResponse { id?: number; organizerId: number; primary?: string; gray?: string; highlightSuccess?: string; highlightInfo?: string; highlightWarning?: string; highlightError?: string; } //# sourceMappingURL=types.d.ts.map