-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: update api docs, fix signedDataMonth descrption
- Loading branch information
Showing
22 changed files
with
1,028 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,47 @@ | ||
@ceajs/attendance-plugin / [Exports](modules.md) | ||
cea / [Exports](modules.md) | ||
|
||
### 简介 | ||
## 详细说明 | ||
|
||
Cea 插件: 实现自动查寝(无需配置查寝图片,自动获取) | ||
https://github.com/ceajs/cea/tree/main | ||
|
||
### 插件: <a align="center" href="https://www.npmjs.com/package/cea"><img alt="cea" src="https://img.shields.io/npm/v/cea?style=social&label=cea"></a> | ||
|
||
### 安装 | ||
|
||
```bash | ||
npm i @ceajs/attendance-plugin | ||
# Install cea as a cli | ||
npm i -g cea | ||
# Using cea as a module | ||
npm i cea | ||
``` | ||
|
||
### 示例 | ||
|
||
1. 使用 CLI | ||
|
||
今日校园签到: | ||
|
||
```bash | ||
cea sign | ||
``` | ||
|
||
2. 使用模块 | ||
|
||
今日校园签到: | ||
|
||
```ts | ||
// 导入 Cea 和内置的签到插件中的函数 checkIn | ||
import Cea, { checkIn } from 'cea' | ||
// 创建 Cea 的实例 | ||
const cea = new Cea() | ||
// 注册插件 | ||
cea.addPlugin(checkIn) | ||
// 执行签到脚本 | ||
cea.start() | ||
``` | ||
|
||
## 文档 | ||
# 文档 | ||
|
||
- 项目说明:https://github.com/ceajs/cea/tree/main/plugins/attendance-plugin | ||
- API 文档:https://github.com/ceajs/cea/blob/main/docs/api/plugins/attendance/modules.md | ||
- 项目说明:https://github.com/ceajs/cea/tree/main/internal | ||
- API 文档:https://github.com/ceajs/cea/blob/main/docs/api/internal/modules.md | ||
- 配置文档:https://github.com/ceajs/cea |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
@ceajs/core / [Exports](modules.md) | ||
|
||
### 插件: <a align="center" href="https://www.npmjs.com/package/cea-core"><img alt="cea-core" src="https://img.shields.io/npm/v/cea-core?style=social&label=cea-core"></a> | ||
|
||
### 安装 | ||
|
||
```bash | ||
npm i @ceajs/core | ||
``` | ||
|
||
## 文档 | ||
|
||
- 项目说明:https://github.com/ceajs/cea/tree/main/core | ||
- API 文档:https://github.com/ceajs/cea/blob/main/docs/api/core/modules.md | ||
- 配置文档:https://github.com/ceajs/cea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,248 @@ | ||
[@ceajs/core](README.md) / Exports | ||
|
||
# @ceajs/core | ||
|
||
## Table of contents | ||
|
||
### Namespaces | ||
|
||
- [sstore](modules/sstore.md) | ||
|
||
### Type aliases | ||
|
||
- [CookieRawObject](modules.md#cookierawobject) | ||
- [SchoolConf](modules.md#schoolconf) | ||
- [SchoolConfOpts](modules.md#schoolconfopts) | ||
- [StringKV](modules.md#stringkv) | ||
- [UserConfOpts](modules.md#userconfopts) | ||
- [UsersConf](modules.md#usersconf) | ||
|
||
### Variables | ||
|
||
- [log](modules.md#log) | ||
|
||
### Functions | ||
|
||
- [cookieParse](modules.md#cookieparse) | ||
- [cookieStr](modules.md#cookiestr) | ||
- [getSchoolInfos](modules.md#getschoolinfos) | ||
- [handleCookie](modules.md#handlecookie) | ||
- [loadConfFromToml](modules.md#loadconffromtoml) | ||
|
||
## Type aliases | ||
|
||
### CookieRawObject | ||
|
||
Ƭ **CookieRawObject**: `Object` | ||
|
||
#### Index signature | ||
|
||
▪ [K: `string`]: `string` | ||
|
||
#### Defined in | ||
|
||
[src/types/cookie.ts:3](https://github.com/ceajs/cea/blob/d993e68/src/core/src/types/cookie.ts#L3) | ||
|
||
___ | ||
|
||
### SchoolConf | ||
|
||
Ƭ **SchoolConf**: `Object` | ||
|
||
#### Index signature | ||
|
||
▪ [school: `string`]: [`SchoolConfOpts`](modules.md#schoolconfopts) | ||
|
||
#### Defined in | ||
|
||
[src/types/conf.ts:24](https://github.com/ceajs/cea/blob/d993e68/src/core/src/types/conf.ts#L24) | ||
|
||
___ | ||
|
||
### SchoolConfOpts | ||
|
||
Ƭ **SchoolConfOpts**: `Object` | ||
|
||
#### Type declaration | ||
|
||
| Name | Type | | ||
| :------ | :------ | | ||
| `authOrigin` | `string` | | ||
| `captchaAuthMode` | `CaptchaAuthMode` | | ||
| `chineseName` | `string` | | ||
| `defaultAddr` | `string` | | ||
| `edgeCase` | `SchoolEdgeCase` | | ||
| `isCloud` | `boolean` | | ||
| `loginURL?` | `string` | | ||
| `preAuthURL` | `string` | | ||
|
||
#### Defined in | ||
|
||
[src/types/conf.ts:28](https://github.com/ceajs/cea/blob/d993e68/src/core/src/types/conf.ts#L28) | ||
|
||
___ | ||
|
||
### StringKV | ||
|
||
Ƭ **StringKV**: `Object` | ||
|
||
#### Index signature | ||
|
||
▪ [key: `string`]: `string` | ||
|
||
#### Defined in | ||
|
||
[src/types/helper.ts:1](https://github.com/ceajs/cea/blob/d993e68/src/core/src/types/helper.ts#L1) | ||
|
||
___ | ||
|
||
### UserConfOpts | ||
|
||
Ƭ **UserConfOpts**: `Object` | ||
|
||
#### Type declaration | ||
|
||
| Name | Type | | ||
| :------ | :------ | | ||
| `addr` | [``""``] \| [`string`, `string`, `string`] | | ||
| `alias` | `string` | | ||
| `captcha?` | ``"MANUAL"`` \| ``"OCR"`` | | ||
| `password` | `string` | | ||
| `retry?` | `number` | | ||
| `school` | `string` | | ||
| `signedDataMonth?` | \`${number}-${number}\` | | ||
| `username` | `string` | | ||
|
||
#### Defined in | ||
|
||
[src/types/conf.ts:13](https://github.com/ceajs/cea/blob/d993e68/src/core/src/types/conf.ts#L13) | ||
|
||
___ | ||
|
||
### UsersConf | ||
|
||
Ƭ **UsersConf**: `Object` | ||
|
||
#### Type declaration | ||
|
||
| Name | Type | | ||
| :------ | :------ | | ||
| `localEdgeCasesFile?` | `string` | | ||
| `notifier?` | [\`${number}\`, `string`, `string`] | | ||
| `users` | [`UserConfOpts`](modules.md#userconfopts)[] | | ||
|
||
#### Defined in | ||
|
||
[src/types/conf.ts:8](https://github.com/ceajs/cea/blob/d993e68/src/core/src/types/conf.ts#L8) | ||
|
||
## Variables | ||
|
||
### log | ||
|
||
• **log**: `LogRouter` | ||
|
||
#### Defined in | ||
|
||
[src/utils/logger.ts:28](https://github.com/ceajs/cea/blob/d993e68/src/core/src/utils/logger.ts#L28) | ||
|
||
## Functions | ||
|
||
### cookieParse | ||
|
||
▸ **cookieParse**(`host`, `headers`): `CookieMap` | ||
|
||
Parse http response headers' cookie | ||
|
||
#### Parameters | ||
|
||
| Name | Type | | ||
| :------ | :------ | | ||
| `host` | `string` | | ||
| `headers` | `Headers` | | ||
|
||
#### Returns | ||
|
||
`CookieMap` | ||
|
||
#### Defined in | ||
|
||
[src/utils/cookie-helper.ts:7](https://github.com/ceajs/cea/blob/d993e68/src/core/src/utils/cookie-helper.ts#L7) | ||
|
||
___ | ||
|
||
### cookieStr | ||
|
||
▸ **cookieStr**(`host`, `cookieMap`): `string` | ||
|
||
Construct a cookie object based on host | ||
|
||
#### Parameters | ||
|
||
| Name | Type | | ||
| :------ | :------ | | ||
| `host` | `string` | | ||
| `cookieMap` | `CookieMap` | | ||
|
||
#### Returns | ||
|
||
`string` | ||
|
||
#### Defined in | ||
|
||
[src/utils/cookie-helper.ts:50](https://github.com/ceajs/cea/blob/d993e68/src/core/src/utils/cookie-helper.ts#L50) | ||
|
||
___ | ||
|
||
### getSchoolInfos | ||
|
||
▸ **getSchoolInfos**(`__namedParameters`): `Promise`<[`SchoolConf`](modules.md#schoolconf) \| ``null``\> | ||
|
||
#### Parameters | ||
|
||
| Name | Type | | ||
| :------ | :------ | | ||
| `__namedParameters` | [`UsersConf`](modules.md#usersconf) | | ||
|
||
#### Returns | ||
|
||
`Promise`<[`SchoolConf`](modules.md#schoolconf) \| ``null``\> | ||
|
||
#### Defined in | ||
|
||
[src/conf.ts:33](https://github.com/ceajs/cea/blob/d993e68/src/core/src/conf.ts#L33) | ||
|
||
___ | ||
|
||
### handleCookie | ||
|
||
▸ **handleCookie**(): `Promise`<`void`\> | ||
|
||
Iterate through all users: complete unified auth -> store cookie | ||
|
||
#### Returns | ||
|
||
`Promise`<`void`\> | ||
|
||
#### Defined in | ||
|
||
[src/index.ts:32](https://github.com/ceajs/cea/blob/d993e68/src/core/src/index.ts#L32) | ||
|
||
___ | ||
|
||
### loadConfFromToml | ||
|
||
▸ **loadConfFromToml**(`customPath?`): [`UsersConf`](modules.md#usersconf) \| ``null`` | ||
|
||
#### Parameters | ||
|
||
| Name | Type | | ||
| :------ | :------ | | ||
| `customPath?` | `string` | | ||
|
||
#### Returns | ||
|
||
[`UsersConf`](modules.md#usersconf) \| ``null`` | ||
|
||
#### Defined in | ||
|
||
[src/conf.ts:17](https://github.com/ceajs/cea/blob/d993e68/src/core/src/conf.ts#L17) |
Oops, something went wrong.