Dependency update

This commit is contained in:
2025-04-08 22:04:41 +02:00
committed by Philipp Horstenkamp
parent 78549e06b4
commit f7b40cb8dd
492 changed files with 7483 additions and 47496 deletions

View File

@ -3,7 +3,7 @@ jobs:
build:
working_directory: ~/repo
docker:
- image: circleci/node:12
- image: circleci/node:8
steps:
- checkout
- restore_cache:

View File

@ -1,2 +0,0 @@
patreon: ags131
github: [ags131]

4
node_modules/screeps-api/README.md generated vendored
View File

@ -20,7 +20,7 @@ User/pass auth will stop working February 1, 2018!
As of 1.7.0, a small CLI program (`screeps-api`) is included.
Server config is specified via a `.screeps.yml` file conforming to the [Unified Credentials File format](https://github.com/screepers/screepers-standards/blob/master/SS3-Unified_Credentials_File.md)
Server config is specified via a `.screeps.yml` file conforming to the [Unified Credentials File format](https://github.com/screepers/screepers-standards/blob/34bd4e6e5c8250fa0794d915d9f78d3c45326076/SS3-Unified_Credentials_File.md) (Pending [screepers-standard PR #8](https://github.com/screepers/screepers-standards/pull/8))
```
screeps-api
@ -107,7 +107,7 @@ api.socket.connect()
// data: { ... }
// }
api.socket.on('connected',()=>{
// Do stuff after connected
// Do stuff after conntected
})
api.socket.on('auth',(event)=>{
event.data.status contains either 'ok' or 'failed'

View File

@ -1,5 +1,5 @@
#!/usr/bin/env node
const { Command } = require('commander')
const program = require('commander')
const { ScreepsAPI } = require('../')
const fs = require('fs')
const util = require('util')
@ -8,15 +8,15 @@ const path = require('path')
const readFile = util.promisify(fs.readFile)
const writeFile = util.promisify(fs.writeFile)
async function init(opts) {
return ScreepsAPI.fromConfig(opts.server)
async function init (opts) {
return ScreepsAPI.fromConfig(opts.parent.server)
}
async function json(data) {
async function json (data) {
process.stdout.write(JSON.stringify(data))
}
async function out(data, opts) {
async function out (data, opts) {
data = await data
data = (data && data.data) || data
if (process.stdout.isTTY) {
@ -26,29 +26,18 @@ async function out(data, opts) {
}
}
async function run() {
const program = new Command()
/** @param {string} name */
const commandBase = (name, args = '') => {
const command = new Command(name)
command
.arguments(args)
.option('--server <server>', 'Server config to use', 'main')
program.addCommand(command)
return command
}
async function run () {
program
.version(require('../package.json').version)
.option('--server <server>', 'Server config to use', 'main')
commandBase('raw', '<cmd> [args...]')
program
.command('raw <cmd> [args...]')
.description('Execute raw API call')
.action(async function (cmd, args, opts) {
try {
const api = await init(opts)
const path = cmd.split('.')
/** @type {function} */
let fn = api.raw
for (const part of path) {
fn = fn[part]
@ -57,13 +46,14 @@ async function run() {
console.log('Invalid cmd')
return
}
out(fn.apply(api, args))
out(fn(...args))
} catch (e) {
console.error(e)
}
})
commandBase('memory', '[path]')
program
.command('memory [path]')
.description(`Get Memory contents`)
.option('--set <file>', 'Sets the memory path to the contents of file')
.option('--allow-root', 'Allows writing without path')
@ -92,7 +82,8 @@ async function run() {
}
})
commandBase('segment', '<segment>')
const seg = program
.command('segment <segment>')
.description(`Get segment contents. Use 'all' to get all)`)
.option('--set <file>', 'Sets the segment content to the contents of file')
.option('-s --shard <shard>', 'Shard to read from', 'shard0')
@ -125,7 +116,8 @@ async function run() {
}
})
commandBase('download')
program
.command('download')
.description(`Download code`)
.option('-b --branch <branch>', 'Code branch', 'default')
.option('-d --dir <dir>', 'Directory to save in (defaults to outputing in console)')
@ -152,7 +144,8 @@ async function run() {
}
})
commandBase('upload', '<files...>')
program
.command('upload <files...>')
.description(`Upload code`)
.option('-b --branch <branch>', 'Code branch', 'default')
.action(async function (files, opts) {
@ -183,7 +176,7 @@ async function run() {
program.outputHelp()
}
await program.parseAsync()
program.parse(process.argv)
}
run().then(data => {

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +0,0 @@
export class ConfigManager {
refresh(): Promise<void>;
_config: any;
getServers(): Promise<string[]>;
getConfig(): Promise<any>;
path: any;
loadConfig(file: any): Promise<any>;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,286 +0,0 @@
export class ScreepsAPI extends RawAPI {
static fromConfig(server?: string, config?: boolean, opts?: {}): Promise<ScreepsAPI>;
constructor(opts: any);
rateLimits: {
global: {
limit: any;
period: any;
remaining: any;
reset: number;
toReset: number;
};
GET: {
'/api/game/room-terrain': {
limit: any;
period: any;
remaining: any;
reset: number;
toReset: number;
};
'/api/user/code': {
limit: any;
period: any;
remaining: any;
reset: number;
toReset: number;
};
'/api/user/memory': {
limit: any;
period: any;
remaining: any;
reset: number;
toReset: number;
};
'/api/user/memory-segment': {
limit: any;
period: any;
remaining: any;
reset: number;
toReset: number;
};
'/api/game/market/orders-index': {
limit: any;
period: any;
remaining: any;
reset: number;
toReset: number;
};
'/api/game/market/orders': {
limit: any;
period: any;
remaining: any;
reset: number;
toReset: number;
};
'/api/game/market/my-orders': {
limit: any;
period: any;
remaining: any;
reset: number;
toReset: number;
};
'/api/game/market/stats': {
limit: any;
period: any;
remaining: any;
reset: number;
toReset: number;
};
'/api/game/user/money-history': {
limit: any;
period: any;
remaining: any;
reset: number;
toReset: number;
};
};
POST: {
'/api/user/console': {
limit: any;
period: any;
remaining: any;
reset: number;
toReset: number;
};
'/api/game/map-stats': {
limit: any;
period: any;
remaining: any;
reset: number;
toReset: number;
};
'/api/user/code': {
limit: any;
period: any;
remaining: any;
reset: number;
toReset: number;
};
'/api/user/set-active-branch': {
limit: any;
period: any;
remaining: any;
reset: number;
toReset: number;
};
'/api/user/memory': {
limit: any;
period: any;
remaining: any;
reset: number;
toReset: number;
};
'/api/user/memory-segment': {
limit: any;
period: any;
remaining: any;
reset: number;
toReset: number;
};
};
};
socket: Socket;
getRateLimit(method: any, path: any): any;
get rateLimitResetUrl(): string;
me(): Promise<{
_id: any;
username: any;
badge: import("./RawAPI").Badge;
gcl: any;
}>;
_user: {
_id: any;
username: any;
badge: import("./RawAPI").Badge;
gcl: any;
};
tokenInfo(): Promise<any>;
_tokenInfo: any;
userID(): Promise<any>;
get history(): (room: string, tick: number, shard?: string) => any;
get authmod(): () => any;
get version(): () => {
ok: 1;
package: number;
protocol: number;
serverData: {
customObjectTypes: any;
historyChunkSize: number;
features: any;
shards: string[];
};
users: number;
};
get time(): (shard?: string) => {
ok: number;
time: number;
};
get leaderboard(): {
list(limit: number, mode: "world" | "power", offset: number, season: string): {
ok: any;
list: [{
_id: any;
season: any;
user: any;
score: any;
rank: any;
}];
count: any;
users: {
<user>(): any;
's _id>: { _id, username, badge: { type, color1, color2, color3, param, flip }, gcl } } }}': any;
};
};
find(username: string, mode?: string, season?: string): {
ok: any;
_id: any;
season: any;
user: any;
score: any;
rank: any;
};
seasons(): {
ok: any;
seasons: [{
_id: any;
name: any;
date: any;
}];
};
};
get market(): {
ordersIndex(shard?: string): {
ok: 1;
list: [{
_id: string;
count: number;
}];
};
myOrders(): {
ok: number;
list: [{
_id: any;
created: any;
user: any;
active: any;
type: any;
amount: any;
remainingAmount: any;
resourceType: any;
price: any;
totalAmount: any;
roomName: any;
}];
};
orders(resourceType: string, shard?: string): {
ok: number;
list: [{
_id: any;
created: any;
user: any;
active: any;
type: any;
amount: any;
remainingAmount: any;
resourceType: any;
price: any;
totalAmount: any;
roomName: any;
}];
};
stats(resourceType: any, shard?: string): any;
};
get registerUser(): (username: string, email: string, password: string, modules: any) => any;
get code(): {
get(branch: string): any;
set(branch: string, modules: any, _hash: any): any;
};
get memory(): {
get(path: string, shard?: string): string;
set(path: string, value: any, shard?: string): {
ok: any;
result: {
ok: any;
n: any;
};
ops: [{
user: any;
expression: any;
hidden: any;
}];
data: any;
insertedCount: any;
insertedIds: any;
};
segment: {
get(segment: number, shard?: string): {
ok: any;
data: string;
};
set(segment: number, data: any, shard?: string): any;
};
};
get segment(): {
get(segment: number, shard?: string): {
ok: any;
data: string;
};
set(segment: number, data: any, shard?: string): any;
};
get console(): (expression: any, shard?: string) => {
ok: any;
result: {
ok: any;
n: any;
};
ops: [{
user: any;
expression: any;
_id: any;
}];
insertedCount: any;
insertedIds: [<mongodb, id>() => any];
};
}
import { RawAPI } from "./RawAPI";
import { Socket } from "./Socket";

View File

@ -1,31 +0,0 @@
export class Socket extends EventEmitter {
constructor(ScreepsAPI: any);
api: any;
opts: {
reconnect: boolean;
resubscribe: boolean;
keepAlive: boolean;
maxRetries: number;
maxRetryDelay: number;
};
keepAliveInter: NodeJS.Timeout;
reset(): void;
authed: boolean;
connected: boolean;
reconnecting: boolean;
__queue: any[];
__subQueue: any[];
__subs: {};
connect(opts?: {}): Promise<any>;
ws: any;
reconnect(): Promise<void>;
disconnect(): void;
sleep(time: any): Promise<any>;
handleMessage(msg: any): void;
gzip(bool: any): Promise<void>;
send(data: any): Promise<void>;
auth(token: any): Promise<any>;
subscribe(path: any, cb: any): Promise<void>;
unsubscribe(path: any): Promise<void>;
}
import { EventEmitter } from "events";

View File

@ -1 +0,0 @@
export * from "./ScreepsAPI.js";

View File

@ -1,2 +0,0 @@
declare const _exports: any;
export = _exports;

View File

@ -132,7 +132,7 @@ are the ones listed below.
- `https://screeps.com/api/user/world-status`
- `{ ok, status }`
- `status` can be `"lost"`, `"empty"` or `"normal"`, lost is when you loose all your spawns, empty is when you have respawned and not placed your spawn yet.;
- `status` is usually "normal"; it's unknown what else it can be
- `https://screeps.com/api/user/world-start-room`
- `{ ok, room: [ <room name> ] }`

View File

@ -1,18 +1,16 @@
{
"name": "screeps-api",
"version": "1.16.1",
"version": "1.7.2",
"description": "",
"repository": "screepers/node-screeps-api",
"main": "dist/ScreepsAPI.js",
"module": "src/index.js",
"main": "dist/ScreepsAPI.cjs.js",
"module": "dist/ScreepsAPI.es.js",
"scripts": {
"build": "rollup -c",
"prepublishOnly": "npm run build",
"lint": "standard src/**/*.js",
"lint-fix": "standard src/**/*.js --fix",
"test_": "mocha",
"test": "echo Tests disabled, TODO: FIX THIS!",
"2npm": "publish-if-not-published"
"prepublish": "npm run build",
"lint": "standard src test",
"test": "mocha",
"2npm": "publish"
},
"author": "Adam Shumann",
"license": "ISC",
@ -20,28 +18,34 @@
"screeps-api": "bin/screeps-api.js"
},
"dependencies": {
"axios": "^0.28.0",
"commander": "^7.2.0",
"debug": "^4.1.1",
"ws": "^7.4.4",
"commander": "^2.15.1",
"bluebird": "^3.5.0",
"fetch-ponyfill": "^6.0.2",
"node-fetch": "^2.1.2",
"ws": "^5.2.0",
"yamljs": "^0.3.0"
},
"optionalDependencies": {
"bufferutil": "^4.0.1",
"utf-8-validate": "^5.0.2"
"bufferutil": "^3.0.5",
"utf-8-validate": "^4.0.2"
},
"devDependencies": {
"lodash": "^4.17.11",
"mocha": "^8.3.2",
"publish-if-not-published": "^2.0.0",
"rollup": "^2.44.0",
"rollup-plugin-typescript2": "^0.30.0",
"standard": "*",
"tslib": "^2.2.0",
"typescript": "^4.2.4"
"babel-plugin-external-helpers": "^6.22.0",
"babel-plugin-transform-async-to-generator": "^6.24.1",
"babel-preset-env": "^1.6.0",
"babel-preset-es2015": "^6.24.1",
"lodash": "^4.17.4",
"mocha": "^3.5.0",
"publish": "^0.6.0",
"rollup": "^0.45.2",
"rollup-plugin-babel": "^2.7.1",
"rollup-plugin-commonjs": "^8.0.2",
"rollup-plugin-node-builtins": "^2.1.2",
"rollup-plugin-node-resolve": "^3.0.0",
"rollup-watch": "^4.3.1",
"standard": "*"
},
"browser": {
"ws": "./src/ws-browser.js"
},
"types": "dist/types/index.d.ts"
}
}

View File

@ -1,25 +1,32 @@
import typescript from 'rollup-plugin-typescript2'
import resolve from 'rollup-plugin-node-resolve'
import builtins from 'rollup-plugin-node-builtins'
import commonjs from 'rollup-plugin-commonjs'
import babel from 'rollup-plugin-babel'
export default {
input: {
ScreepsAPI: 'src/index.js'
},
output: {
dir: 'dist',
format: 'cjs',
exports: 'named',
preferConst: true,
globals: {
ws: 'WebSocket'
},
},
entry: 'src/index.js',
// external(id){
// return !!require('./package.json').dependencies[id];
// },
external: ['ws', 'fs', 'axios', 'bluebird', 'yamljs', 'url', 'events', 'zlib', 'path','debug', 'util'],
globals: {
ws: 'WebSocket',
'node-fetch': 'fetch'
},
external: ['ws', 'fs', 'node-fetch'],
moduleName: 'ScreepsAPI',
targets: [
{ dest: 'dist/ScreepsAPI.iife.js', format: 'iife' },
{ dest: 'dist/ScreepsAPI.umd.js', format: 'umd' },
{ dest: 'dist/ScreepsAPI.cjs.js', format: 'cjs' },
{ dest: 'dist/ScreepsAPI.es.js', format: 'es' }
],
plugins: [
typescript({
useTsconfigDeclarationDir: true
})
builtins(),
commonjs(),
resolve({
module: true,
preferBuiltins: true
}),
babel()
]
}

View File

@ -1,10 +0,0 @@
{
"compilerOptions": {
"declaration": true,
"declarationDir": "dist/types",
"rootDir": "src",
"allowJs": true,
},
"include": ["src/**/*"],
"exclude": ["node_modules/**/*"]
}