Options
All
  • Public
  • Public/Protected
  • All
Menu

codewars-node-api

Index

Type Aliases

CodeChallangeRank: CodeChallengeRank

Alias of CodeChallengeRank

see

CodeChallengeRank

deprecated

use CodeChallengeRank, will be removed in v2

CodewarsErrorCode: typeof CODEWARS_ERROR_CODES[number]

The type of http response codes the codewars api can return.

see

CODEWARS_ERROR_CODES

WebhookChallengeActions: typeof WEBHOOK_CHALLENGE_ACTIONS[number]

Type representing all the webhook challenge actions.

  • created - Code challenge was created
  • approved - Code challenge was successfully approved (no longer in beta state)
  • voted - Someone voted on the code challenge. Does not specify what type of vote
  • solution_finalized - Someone submitted a solution to the code challenge
see

WEBHOOK_CHALLENGE_ACTIONS

WebhookUserActions: typeof WEBHOOK_USER_ACTIONS[number]

Type representing all the webhook user actions.

  • rank_earned - The user's rank has been upgraded. Could be a global rank, or a language rank
  • honor_changed - User's honor changed (usually in a positive direction)
see

WEBHOOK_USER_ACTIONS

Variables

CODEWARS_ERROR_CODES: readonly [400, 401, 403, 404, 405, 406, 422, 429, 500, 503] = ...

The array of http response error-codes the codewars api can return.

see

CodewarsError

WEBHOOK_CHALLENGE_ACTIONS: readonly ["created", "approved", "voted", "solution_finalized"] = ...

Static list of all currently known webhook challenge actions.

note not sure if updated is a value, as its not documented.

Represented as type WebhookChallengeActions

Further documentation is here: https://dev.codewars.com/?shell#code-challenges

see

WebhookChallengeActions

WEBHOOK_USER_ACTIONS: readonly ["rank_earned", "honor_changed"] = ...

Static list of all currently known webhook user actions.

Represented as type WebhookUserActions

Further documentation is here: https://dev.codewars.com/?shell#user

see

WebhookUserActions

Functions

  • createCodewarsError(code: 400 | 401 | 403 | 404 | 405 | 406 | 422 | 429 | 500 | 503): undefined | CodewarsError
  • isCodewarsErrorCode(code: unknown): code is 400 | 401 | 403 | 404 | 405 | 406 | 422 | 429 | 500 | 503
  • Type-guard that can be used to verify if the given code is a codewars http response codes.

    see

    CODEWARS_ERROR_CODES

    see

    CodewarsErrorCode

    Parameters

    • code: unknown

      the code to check, will also verify if a number

    Returns code is 400 | 401 | 403 | 404 | 405 | 406 | 422 | 429 | 500 | 503

    true if the given code is a codewars http response codes

  • isWebhookChallengeAction(action: unknown): action is "created" | "approved" | "voted" | "solution_finalized"
  • isWebhookUserAction(action: unknown): action is "rank_earned" | "honor_changed"

Generated using TypeDoc