Options
All
  • Public
  • Public/Protected
  • All
Menu

codingame-api-node-ts

Index

Functions

Const findAllMinimalProgress

Const findProgressByIds

  • findProgressByIds(ids: number[], userId: number): Promise<IPuzzleProgress[]>
  • Find puzzle informations and player's completion from an array of number IDs.

    Parameters

    • ids: number[]

      Every Puzzle IDs you want to inspect

    • userId: number

      User ID you want to retrieve the completion

    Returns Promise<IPuzzleProgress[]>

Const findProgressByPrettyId

  • findProgressByPrettyId(cookies: string, puzzlePrettyId: string, userId: number): Promise<IPuzzlePrettyProgress>
  • Find puzzle informations and player's completion from a "pretty ID" which is a string, found in the URL of the puzzle.

    Requires to log in before.

    Parameters

    • cookies: string

      The cookies string that you obtain when you're loggin in with loginSite

    • puzzlePrettyId: string

      Puzzle's "pretty ID", found in its URL.

    • userId: number

      User ID you want to retrieve the completion

    Returns Promise<IPuzzlePrettyProgress>

Const generateLspToken

  • generateLspToken(cookies: string, testSessionId: number): Promise<ILspToken>

Const generateSessionFromPuzzlePrettyId

  • generateSessionFromPuzzlePrettyId(cookies: string, userId: number, puzzlePrettyId: string): Promise<IPuzzleSession>

Const getCareerData

  • getCareerData(cookies: string, userId: number): Promise<ICareerData>

Const getChallengeByPublicId

  • getChallengeByPublicId(publicId: string): Promise<IChallenge>

Const getClashLeaderboard

  • getClashLeaderboard(page: number, filter: { active: boolean; column: string; filter: string; keyword: string }, codinGamerPublicHandle: string): Promise<IClashLeaderboard>
  • Get the Clash Of Code Leaderboard

    Parameters

    • page: number

      Leaderboard's page

    • filter: { active: boolean; column: string; filter: string; keyword: string }

      Leaderboar's filter

      • active: boolean
      • column: string
      • filter: string
      • keyword: string
    • codinGamerPublicHandle: string

      Public Handle from the CodinGamer

    Returns Promise<IClashLeaderboard>

Const getCodingamerAchievements

Const getCodingamerPointsStats

Const getCodingamerXpHistory

  • getCodingamerXpHistory(cookies: string, userId: number, limit: number): Promise<IXpEntry[]>
  • Get the global leaderboard

    Requires to log in before.

    Parameters

    • cookies: string

      The cookies string that you obtain when you're logging in with loginCodinGamer

    • userId: number

      User's ID

    • limit: number

      The limit of the history. For example, a limit of 50 will return a list of 50 objects, if there are at least 50 objects

    Returns Promise<IXpEntry[]>

Const getCompaniesByQuery

  • getCompaniesByQuery(cookies: string, userId: number, searchQuery: string): Promise<ICompany[]>

Const getContributionById

  • getContributionById(contributionId: string): Promise<IContribution>

Const getFileFromId

  • getFileFromId(fileId: number, format?: string): Promise<IFile>
  • Get a file from its id

    Parameters

    • fileId: number

      File's ID (can be referred as binary ID)

    • Optional format: string

      File's format. Can be profile_avatar, playground_card_cover or can also be not declared

    Returns Promise<IFile>

Const getGlobalLeaderboard

  • getGlobalLeaderboard(page: number, category: string, filter: { active: boolean; column: string; filter: string; keyword: string }, codinGamerPublicHandle: string): Promise<IGlobalLeaderboard>
  • Get the global leaderboard

    Parameters

    • page: number

      Leaderboard's Page

    • category: string

      Leaderboard's category. Can be GENERAL, CONTESTS, BOT_PROGRAMMING, OPTIM or CODEGOLF

    • filter: { active: boolean; column: string; filter: string; keyword: string }

      Leaderboard's filter

      • active: boolean
      • column: string
      • filter: string
      • keyword: string
    • codinGamerPublicHandle: string

      Public Handle from the CodinGamer

    Returns Promise<IGlobalLeaderboard>

Const getPastChallenges

  • getPastChallenges(cookies: string, userId: number): Promise<IPastChallenge[]>

Const getPendingClashes

Const getPendingContributions

  • getPendingContributions(cookies: string, page: number, filter: string, userId: number): Promise<IPendingContribution[]>

Const getPreviousCodeByLanguageId

  • getPreviousCodeByLanguageId(cookies: string, sessionHandle: string, languageId: string): Promise<IPreviousCode>
  • Get the previous code of a puzzle by the puzzle ID and the language ID

    Requires to log in before.

    Parameters

    • cookies: string

      The cookies string that you obtain when you're logging in with loginCodinGamer

    • sessionHandle: string

      session handle generated by others functions, such as generateSessionFromPuzzlePrettyId

    • languageId: string

      Language's ID, usually its name

    Returns Promise<IPreviousCode>

Const getPublishedCoursesByIds

  • getPublishedCoursesByIds(cookies: string, userId: number, coursesId: number[]): Promise<ICourse>
  • Get every published courses by ids provided

    Requires to log in before.

    Parameters

    • cookies: string

      The cookies string that you obtain when you're logging in with loginCodinGamer

    • userId: number

      User's ID

    • coursesId: number[]

      List containing every courses you want to get infos

    Returns Promise<ICourse>

Const getQuestMap

  • getQuestMap(cookies: string, userId: number): Promise<IQuestMap>

Const getSchoolsByQuery

  • getSchoolsByQuery(cookies: string, userId: number, searchQuery: string): Promise<ISchool[]>

Const loginCodinGamer

  • Login to CodinGame as a CodinGamer

    Parameters

    • email: string

      Account Email

    • password: string

      Account Password

    Returns Promise<ILoginCodinGamer>

Const startTestSession

  • startTestSession(cookies: string, sessionHandle: string): Promise<ITestSession>
  • Starts a test session, used for testing the code

    Requires to log in before.

    Parameters

    • cookies: string

      The cookies string that you obtain when you're logging in with loginCodinGamer

    • sessionHandle: string

      session handle generated by others functions, such as generateSessionFromPuzzlePrettyId

    Returns Promise<ITestSession>

Generated using TypeDoc