biketag-admin
Version:
<h1 align=center>BikeTag-Admin</h1> <div align="center"> <img alt="biketag-admin logo" src="https://raw.githubusercontent.com/keneucker/biketag-website/production/public/img/Tag-Logo-Stacked-V2-medium.png" height="auto" width="200" style="border-radius:25
77 lines (76 loc) • 4.95 kB
TypeScript
import BikeTagClient from 'biketag';
import request from 'request';
import { Ambassador, BackgroundProcessResults, BikeTagProfile, DomainInfo, Game, Tag, activeQueue } from '.';
export declare const isAuthenticationEnabled: () => boolean;
export declare const isGmapsEnabled: () => boolean;
export declare const getBikeTagHash: (val: string) => string;
export declare const debug: (message: string, context?: any) => void;
export declare const getImgurImageSized: (imgurUrl?: string, size?: string) => string;
export declare const getApiUrl: (game?: string, path?: string) => string;
export declare const isRequestAllowed: (req: any, authorized?: boolean, admin?: boolean, isFrontendRequest?: boolean, restrictMethod?: string[] | string) => boolean;
export declare const getDomainInfo: (req: any) => DomainInfo;
export declare const getTagDate: (time: number) => Date;
export declare const getBikeTagAdminOpts: (req?: request.Request, authorized?: boolean, nonpublic?: boolean, game?: Game) => any;
export declare const parseQuery: (query?: string) => {
[k: string]: any;
};
export declare const parseBody: (body?: string) => {};
export declare const getPayloadOpts: (event: any, base?: {}) => any;
export declare const isValidJson: (data: object, type?: string) => boolean;
export interface IdentityContext {
/**
* The token that was provided.
*/
token: string;
/**
* Claims for the authenticated user.
*/
claims: Record<string, unknown>;
}
export declare const getThisGamesAmbassadors: (client: BikeTagClient, adminBikeTagOpts?: any) => Promise<Ambassador[] | import("biketag").BikeTagApiResponse<Ambassador[]>>;
export declare const encodeBikeTagString: (basic: string) => string;
export declare const getProfileAuthorization: (event: any) => Promise<any>;
export declare const getPayloadAuthorization: (event: any) => Promise<any>;
export declare const getSupportedGames: (games: Game[]) => Game[];
export declare const getSanityImageUrl: (logo: string, size?: string, sanityBaseCDNUrl?: string, squared?: boolean) => string;
export declare const archiveAndClearQueue: (queuedTags: Tag[], game?: Game | null, adminBiketag?: BikeTagClient, nonAdminBikeTag?: BikeTagClient) => Promise<BackgroundProcessResults>;
export declare const getActiveQueueForGame: (game: Game, adminBikeTag?: BikeTagClient, approvingAmbassador?: string) => Promise<activeQueue>;
export declare const createBikeTagPlayerProfile: (profile?: any, game?: string, biketag?: BikeTagClient) => Promise<import("biketag").BikeTagApiResponse<import("biketag/dist/common/schema").Player[]> | {
data: null;
success: boolean;
}>;
export declare const handleAuth0ProfileRequest: (req: any, request: any, profile: any) => Promise<any>;
export declare const getBikeTagAuth0Profile: (name: string, authorized?: boolean, passcode?: string, sub?: string) => Promise<any>;
export declare const getBikeTagPlayerProfile: (profile: any, authorized?: boolean, stringifyResponse?: boolean, adminBikeTag?: BikeTagClient) => Promise<any>;
export declare const sendBikeTagPostNotificationToWebhook: (currentTag: Tag, winningTag: Tag, webhook: string, type: string, host: string, game: Game) => Promise<string> | undefined;
export declare const sendNewBikeTagNotifications: (game: Game, currentTag: Tag, winningTag: Tag, adminBiketag?: BikeTagClient) => Promise<any>;
/**
* Sets a new BikeTag post by updating the current BikeTag with the winning tag information
* and posting the new BikeTag from the queue.
*
* @param game - The game object.
* @param winningBikeTagPost - The winning BikeTag post.
* @param previousBikeTag - The previous BikeTag post.
* @returns A promise that resolves to the background process results.
*/
export declare const setNewBikeTagPost: (game: Game, winningBikeTagPost: Tag, previousBikeTag: Tag, adminBiketag?: BikeTagClient, nonAdminBiketag?: BikeTagClient) => Promise<BackgroundProcessResults>;
export declare const getWinningTagForCurrentRound: (timedOutTags: Tag[], currentBikeTag: Tag) => Tag | undefined;
export declare const auth0Headers: () => Promise<{
Authorization: string;
} | {
Authorization?: undefined;
}>;
export declare const acceptCorsHeaders: () => {
Accept: string;
'Access-Control-Allow-Headers': string;
'Content-Type': string;
'Access-Control-Allow-Methods': string;
'Access-Control-Allow-Origin': string;
'Access-Control-Max-Age': string;
};
export declare const constructAmbassadorProfile: (profile?: any, defaults?: any) => BikeTagProfile;
export declare const constructPlayerProfile: (profile?: any, defaults?: any) => BikeTagProfile;
export declare const setProfileCookie: (profile?: BikeTagProfile, profileCookieKey?: string) => boolean;
export declare const getProfileFromCookie: (profileCookieKey?: string) => BikeTagProfile;
export declare const stringifyNumber: (n: number) => string;
export declare const ordinalSuffixOf: (n: number) => string;