Git Product home page Git Product logo

nitasheu / zed.gg Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 135 KB

Sorry for not updating for a long time. I worked on a newer and better version with the newest Riot Api changes. Vacation is starting soon. Stay tuned for a fantastic Wrapper! Riot Api wrapper for Node.js written in typescript. RateLimit is handled with our built in logic and with the response headers (even async!). The first request is always sync, so we can adjust our RateLimit handler to the headers. retry-after case is not implemented yet. If you have any issues, just contact me on discord: nitash#3613!

License: MIT License

JavaScript 5.43% TypeScript 94.57%

zed.gg's People

Contributors

nitasheu avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

wooterz

zed.gg's Issues

Error trying to retrieve summoner data

My Code:

import { Queue, Region, Season } from 'zed.gg/enums';
import { RateLimit, ZedGG } from 'zed.gg';

import { CustomResponseException } from 'zed.gg/models';
import { MatchlistByAccountIdOptions } from 'zed.gg/request-options';

// ZedGG with two rate limits. 100 calls in 10 secnds and 6000 calls in 600 seconds.
let zedGG = new ZedGG(Region.BRAZIL, 'myApi', new RateLimit(10, 100)); 

zedGG.summoners.by.name('SummonerName').then(r => console.log(r));

Error:

node_modules/zed.gg/dist/models/matches/participant-timeline.model.d.ts(4,25): error TS2304: Cannot find name 'Map'.
node_modules/zed.gg/dist/models/matches/participant-timeline.model.d.ts(5,23): error TS2304: Cannot find name 'Map'.
node_modules/zed.gg/dist/models/matches/participant-timeline.model.d.ts(6,25): error TS2304: Cannot find name 'Map'.
node_modules/zed.gg/dist/models/matches/participant-timeline.model.d.ts(7,25): error TS2304: Cannot find name 'Map'.
node_modules/zed.gg/dist/models/matches/participant-timeline.model.d.ts(8,21): error TS2304: Cannot find name 'Map'.
node_modules/zed.gg/dist/models/matches/participant-timeline.model.d.ts(9,34): error TS2304: Cannot find name 'Map'.
node_modules/zed.gg/dist/models/matches/participant-timeline.model.d.ts(10,30): error TS2304: Cannot find name 'Map'.

The *.js files in the root are ES6. We should aim for ES5!

For example:

export * from './dist/models/summoners';
export * from './dist/models/matchlists';
export * from './dist/models/leagues';
export * from './dist/models/matches';
export * from './dist/models/custom-response.model';
export * from './dist/models/custom-response-exception.model';

should be:

'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _summoners = require('./dist/models/summoners');

Object.keys(_summoners).forEach(function (key) {
  if (key === "default" || key === "__esModule") return;
  Object.defineProperty(exports, key, {
    enumerable: true,
    get: function get() {
      return _summoners[key];
    }
  });
});

var _matchlists = require('./dist/models/matchlists');

Object.keys(_matchlists).forEach(function (key) {
  if (key === "default" || key === "__esModule") return;
  Object.defineProperty(exports, key, {
    enumerable: true,
    get: function get() {
      return _matchlists[key];
    }
  });
});

var _leagues = require('./dist/models/leagues');

Object.keys(_leagues).forEach(function (key) {
  if (key === "default" || key === "__esModule") return;
  Object.defineProperty(exports, key, {
    enumerable: true,
    get: function get() {
      return _leagues[key];
    }
  });
});

var _matches = require('./dist/models/matches');

Object.keys(_matches).forEach(function (key) {
  if (key === "default" || key === "__esModule") return;
  Object.defineProperty(exports, key, {
    enumerable: true,
    get: function get() {
      return _matches[key];
    }
  });
});

var _customResponse = require('./dist/models/custom-response.model');

Object.keys(_customResponse).forEach(function (key) {
  if (key === "default" || key === "__esModule") return;
  Object.defineProperty(exports, key, {
    enumerable: true,
    get: function get() {
      return _customResponse[key];
    }
  });
});

var _customResponseException = require('./dist/models/custom-response-exception.model');

Object.keys(_customResponseException).forEach(function (key) {
  if (key === "default" || key === "__esModule") return;
  Object.defineProperty(exports, key, {
    enumerable: true,
    get: function get() {
      return _customResponseException[key];
    }
  });
});

import * from '.' won't work always

Importing something from the same directory with '.' statement won't work always. We should replace those statements with './'

For example:

import { Headers } from '.';

should be

import { Headers } from './';

Implement endpoints

Champion v3

champion-masteries

  • bySummonerId
  • bySummonerIdAndChampionId

scores

  • bySummonerId

Champion-Mastery v3

champion-masteries

  • bySummonerId
  • bySummonerIdAndChampionId

scores

  • bySummonerId

Champion v3

champions

  • all
  • byId

League v3

leagues

  • bySummonerId

challengerleagues

  • byQueue

masterleagues

  • byQueue

positions

  • bySummonerId

Lol-Static-Data v3

champions

  • all
  • byId

items

  • all
  • byId

language-strings

  • all

languages

  • all

maps

  • all

masteries

  • all
  • byId

profile-icons

  • all

realms

  • all

runes

  • all
  • byId

summoner-spells

  • all
  • byId

versions

  • all

Lol-Status v3

shard-data

  • all

Masteries v3

masteries

  • bySummonerId

Match v3

matches

  • byMatchId

matchlists

  • byAccountId
  • byAccountIdRecent

timelines

  • byMatchId

Runes v3

runes

  • bySummonerId

Spectator v3

active-games

  • bySummonerId

featured-games

  • all

Summoner v3

summoners

  • byAccountId
  • bySummonerName
  • bySummonerId

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.