Compare commits

...

2 Commits

Author SHA1 Message Date
55b7945dc1
[js] add InvalidArgumentError 2024-02-11 16:59:13 +08:00
9135bc9c88
[docs] rename creation_time to created_at 2024-02-11 15:31:09 +08:00
4 changed files with 39 additions and 1 deletions

View File

@ -379,7 +379,7 @@
| `name` | `str` | 用户显示名 | | `name` | `str` | 用户显示名 |
| `passwd` | `u8[32]` | 用户密码的加盐 SHA256 摘要值 | | `passwd` | `u8[32]` | 用户密码的加盐 SHA256 摘要值 |
| `totp_key` | `u8[20]` | 用户的时间性一次性口令的秘钥 | | `totp_key` | `u8[20]` | 用户的时间性一次性口令的秘钥 |
| `creation_time` | `DateTime` | 账户创建时间 | | `created_at` | `DateTime` | 账户创建时间 |
| `rating` | `i32` | 用户的等级分 | | `rating` | `i32` | 用户的等级分 |
| `preference` | `AccountPreference` | 用户的偏好设置 | | `preference` | `AccountPreference` | 用户的偏好设置 |
| `replays` | `uuid[]` | 用户参与的比赛回放的全局唯一标识符列表 | | `replays` | `uuid[]` | 用户参与的比赛回放的全局唯一标识符列表 |

15
shared/apc/index.mjs Normal file
View File

@ -0,0 +1,15 @@
import { Buffer } from 'buffer';
export class AsyncProcedureCallEndpoint {
/**
* Constructs an AsyncProcedureCallEndpoint object.
* @param {any} input - stream of data sent by remote.
* @param {any} output - stream of data to send to remote.
*/
constructor(input, output) {
this.buf = Buffer();
input.ondata = () => {
};
}
};

11
shared/apc/package.json Normal file
View File

@ -0,0 +1,11 @@
{
"name": "@og/async-procedure-call",
"type": "module",
"main": "index.mjs",
"dependencies": {
"buffer": "^6.0.3",
"@og/error-utils": "file:../error-utils",
"@og/uuid": "file:../uuid",
"@og/binary-struct": "file:../bstruct"
}
}

View File

@ -9,3 +9,15 @@ export class VirtualMethodNotImplementedError extends Error {
super('virtual method not implemented.'); super('virtual method not implemented.');
} }
}; };
/**
* Represents an error that is thrown when called a function with invalid arguments.
* @class
* @extends {Error}
*/
export class InvalidArgumentError extends Error {
/** @constructor */
constructor(name, reason) {
super(`argument ${name} is invalid: ${reason}.`);
}
};