UNPKG

@withjoy/sdk-js

Version:
54 lines (53 loc) 2.44 kB
import { HttpResource, IHeader } from '../resources/http.resource'; import { IUrlObject } from '../resources/url.resource'; export interface HttpDataOptions extends HttpOptions { json?: Object; } export interface HttpOptions { pathname: Array<string>; headers?: Array<IHeader>; qs?: Object; } export interface QueryGraphQLOptions { variables: Record<string, any>; } export declare class ServiceApi { private serviceUrlObj; private activeAuth; private personKey?; constructor(serviceUrlObj: IUrlObject, activeAuth?: Object); getActiveAuth(): any; setPersonKey(personKey: string): void; private getBaseUrlFromObj; /** * Get a new Http Resource. * The resource is automatically authorized if activeAuth is present. * @returns {Promise<HttpResource>} */ protected newHttpResource(): Promise<HttpResource>; private parseOptions; getRequest(options: HttpOptions): Promise<any>; postRequest(options: HttpDataOptions): Promise<any>; putRequest(options: HttpDataOptions): Promise<any>; deleteRequest(options: HttpOptions): Promise<any>; createEvent(options: any): Promise<any>; quickStartCreateEvent(options: any): Promise<any>; joinEventWithSecret(code: string): Promise<any>; getEventHelpContact(eventId: string): Promise<any>; getPublicEventInfo(eventId: string): Promise<any>; getEvent(eventId: string): Promise<any>; getEventV2(eventId: any): Promise<any>; getEventsV2(): Promise<any>; getEventIdFromName(eventName: string): Promise<any>; getServiceApiForEventSecret(eventSecret: any): ServiceApi; getServiceApiForEventPassword: (eventId: any, eventPassword: any) => ServiceApi; createEventPermitWithEventSecret(eventSecret: string): Promise<any>; createEventPermitWithEventPassword: (eventId: string, eventPassword: string) => any; getEventAssetStores(eventId: any, options: any): Promise<any>; getEventUserProfiles(eventId: any, fieldsArray: any): Promise<any>; getEventJoinSecret(eventId: string): Promise<any>; requestEventJoinSecret(eventId: string, guestInfo: any): Promise<any>; requestAccessEmail(eventId: string, guestInfo: any): Promise<any>; graphQLQuery(query: string, options?: QueryGraphQLOptions): Promise<any>; queryGraphQLWithErrors(query: string, options?: QueryGraphQLOptions): Promise<any>; }