@robotevents/client
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -1,92 +0,2 @@ | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.RobotEventsClient = void 0; | ||
const tslib_1 = require("tslib"); | ||
const axios_1 = tslib_1.__importDefault(require("axios")); | ||
const axios_rate_limit_1 = tslib_1.__importDefault(require("axios-rate-limit")); | ||
const awards_1 = require("./clients/awards"); | ||
const events_1 = require("./clients/events"); | ||
const matches_1 = require("./clients/matches"); | ||
const programs_1 = require("./clients/programs"); | ||
const rankings_1 = require("./clients/rankings"); | ||
const seasons_1 = require("./clients/seasons"); | ||
const skills_1 = require("./clients/skills"); | ||
const teams_1 = require("./clients/teams"); | ||
tslib_1.__exportStar(require("./clients"), exports); | ||
class RobotEventsClient { | ||
constructor(options = {}) { | ||
Object.defineProperty(this, "awards", { | ||
enumerable: true, | ||
configurable: true, | ||
writable: true, | ||
value: void 0 | ||
}); | ||
Object.defineProperty(this, "events", { | ||
enumerable: true, | ||
configurable: true, | ||
writable: true, | ||
value: void 0 | ||
}); | ||
Object.defineProperty(this, "matches", { | ||
enumerable: true, | ||
configurable: true, | ||
writable: true, | ||
value: void 0 | ||
}); | ||
Object.defineProperty(this, "programs", { | ||
enumerable: true, | ||
configurable: true, | ||
writable: true, | ||
value: void 0 | ||
}); | ||
Object.defineProperty(this, "rankings", { | ||
enumerable: true, | ||
configurable: true, | ||
writable: true, | ||
value: void 0 | ||
}); | ||
Object.defineProperty(this, "seasons", { | ||
enumerable: true, | ||
configurable: true, | ||
writable: true, | ||
value: void 0 | ||
}); | ||
Object.defineProperty(this, "skills", { | ||
enumerable: true, | ||
configurable: true, | ||
writable: true, | ||
value: void 0 | ||
}); | ||
Object.defineProperty(this, "teams", { | ||
enumerable: true, | ||
configurable: true, | ||
writable: true, | ||
value: void 0 | ||
}); | ||
const { url, rateLimit } = options; | ||
const token = options.token ?? process.env.ROBOT_EVENTS_TOKEN; | ||
if (token === undefined) { | ||
throw new Error('Robot Events API token must be provided via client option "token" or environment variable ROBOT_EVENTS_TOKEN'); | ||
} | ||
const axiosInstance = axios_1.default.create({ | ||
baseURL: url ?? 'https://robotevents.com/api/v2', | ||
headers: { | ||
Authorization: `Bearer ${token}`, | ||
}, | ||
}); | ||
(0, axios_rate_limit_1.default)(axiosInstance, rateLimit ?? { | ||
maxRequests: 1000, | ||
perMilliseconds: 60000, | ||
}); | ||
this.awards = new awards_1.Awards(axiosInstance); | ||
this.events = new events_1.Events(axiosInstance); | ||
this.matches = new matches_1.Matches(axiosInstance); | ||
this.programs = new programs_1.Programs(axiosInstance); | ||
this.rankings = new rankings_1.Rankings(axiosInstance); | ||
this.seasons = new seasons_1.Seasons(axiosInstance); | ||
this.skills = new skills_1.Skills(axiosInstance); | ||
this.teams = new teams_1.Teams(axiosInstance); | ||
} | ||
} | ||
exports.RobotEventsClient = RobotEventsClient; | ||
export * from './v2/index.js'; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@robotevents/client", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "A Robot Events API client.", | ||
@@ -17,2 +17,6 @@ "keywords": [ | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/jtkiesel/robot-events.git" | ||
}, | ||
"license": "MIT", | ||
@@ -23,12 +27,16 @@ "author": { | ||
}, | ||
"type": "module", | ||
"exports": { | ||
".": { | ||
"import": "./dist/index.js", | ||
"types": "./dist/index.d.ts" | ||
}, | ||
"./v1": { | ||
"import": "./dist/v1/index.js", | ||
"types": "./dist/v1/index.d.ts" | ||
} | ||
}, | ||
"main": "dist/index.js", | ||
"files": [ | ||
"dist" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/jtkiesel/robot-events.git" | ||
}, | ||
"scripts": { | ||
"build": "tsc", | ||
"build": "yarn clean && tsc", | ||
"clean": "rm -fr dist", | ||
@@ -38,15 +46,14 @@ "prepublishOnly": "yarn build" | ||
"dependencies": { | ||
"axios": "^1.3.4", | ||
"axios": "^1.4.0", | ||
"axios-rate-limit": "^1.3.0" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^18.15.10", | ||
"prettier": "^2.8.7", | ||
"tslib": "^2.5.0", | ||
"typescript": "^5.0.2" | ||
"@types/node": "^20.1.7", | ||
"prettier": "^2.8.8", | ||
"typescript": "^5.0.4" | ||
}, | ||
"packageManager": "yarn@3.5.1", | ||
"engines": { | ||
"node": ">=14" | ||
}, | ||
"packageManager": "yarn@3.5.0" | ||
"node": ">=16.0.0" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# robot-events | ||
# @robotevents/client | ||
@@ -7,8 +7,8 @@ A Robot Events API client. | ||
**Node.js 14.0.0 or newer is required.** | ||
**Node.js 16.0.0 or newer is required.** | ||
```sh | ||
npm install robot-events | ||
yarn add robot-events | ||
pnpm add robot-events | ||
npm install @robotevents/client | ||
yarn add @robotevents/client | ||
pnpm add @robotevents/client | ||
``` | ||
@@ -21,3 +21,3 @@ | ||
```js | ||
import {RobotEventsClient} from 'robot-events'; | ||
import {ProgramId, RobotEventsClient} from '@robotevents/client'; | ||
@@ -28,9 +28,11 @@ const robotEventsClient = new RobotEventsClient({ | ||
(async () => { | ||
const team = await robotEventsClient.teams | ||
.findAll(t => t.programIds(1, 4).numbers('24C')) | ||
.next(); | ||
const teams = await robotEventsClient.teams | ||
.findAll(_ => _.programIds(ProgramId.VRC).numbers('24C')) | ||
.toArray(); | ||
console.log(team); | ||
})(); | ||
if (teams.length) { | ||
console.log(teams[0]); | ||
} else { | ||
console.log('Team not found'); | ||
} | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 2 instances in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
3
36
0
Yes
98936
33
2392
1
3
+ Addedaxios@1.7.8(transitive)
- Removedaxios@1.7.7(transitive)
Updatedaxios@^1.4.0