diff --git a/README.md b/README.md index 963369f..d22652d 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ - 关于签到插件: ([学校配置](./docs/config.md)时)使用百度地图 API 获取学校全局签到地址, 使用今日校园接口返回的签到数据获取签到经纬度, 简单来说, 只需知道学校英文简称即可配置好所有签到信息, 充分懒人化 -- 关于签到或查寝中的图片上传:无需特意配置,Cea 会自动使用之前成功签到过的图片来完成上传,这样既无需配置图片地址、也在运行过程中省去了图片上传操作(我们都知道这是个相对耗时的过程) +- 复用历史成功签到数据:表单填写方面,Cea 会查找历史签到中最新且成功签到的数据作为模板填写当前表单;查寝图片上传方面,Cea 使用同样的策略获取图片 URL;这省去了配置表单的繁琐过程和图片上传的费时操作 - 支持日志路由转发到微信:方便查看运行结果日志 (详见 [部署指南](./docs/deploy.md)),这也方便 Cea 插件开发者实现推送和统一日志输出 (详见 [插件开发](https://github.com/ceajs/cea#%E6%8F%92%E4%BB%B6%E5%BC%80%E5%8F%91)) @@ -124,7 +124,7 @@ cea.start() ## 插件列表 -- [`check-in-helper`](./docs/api/plugins/check-in/README.md) +- [`check-in-helper`](./docs/api/plugins/check-in-helper/README.md) - [`attendance`](./docs/api/plugins/attendance/README.md) - [`sign`](./docs/api/plugins/sign/README.md) diff --git a/build/docs.ts b/build/docs.ts index e70b73d..76b149a 100644 --- a/build/docs.ts +++ b/build/docs.ts @@ -34,12 +34,11 @@ async function main() { async function build(refs: Array) { for (const { path } of refs) { - console.log(path) const app = new TypeDoc.Application() // If you want TypeDoc to load tsconfig.json / typedoc.json files app.options.addReader(new TypeDoc.TSConfigReader()) app.options.addReader(new TypeDoc.TypeDocReader()) - const pkgName = path.slice(-1) + const pkgName = path.slice(3) app.bootstrap({ // typedoc options here entryPoints: [`${path}src/index.ts`], @@ -51,6 +50,7 @@ async function build(refs: Array) { // Project may not have converted correctly const outputDir = `docs/api${pkgName}` // Rendered docs + console.log(`Rendering ${outputDir}`) await app.generateDocs(project, outputDir) } } diff --git a/docs/api/README.md b/docs/api/README.md index a02fa82..21d75f5 100644 --- a/docs/api/README.md +++ b/docs/api/README.md @@ -1,17 +1,47 @@ -@ceajs/attendance-plugin / [Exports](modules.md) +cea / [Exports](modules.md) -### 简介 +## 详细说明 -Cea 插件: 实现自动查寝(无需配置查寝图片,自动获取) +https://github.com/ceajs/cea/tree/main + +### 插件: cea ### 安装 ```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 diff --git a/docs/api/.nojekyll b/docs/api/core/.nojekyll similarity index 100% rename from docs/api/.nojekyll rename to docs/api/core/.nojekyll diff --git a/docs/api/core/README.md b/docs/api/core/README.md new file mode 100644 index 0000000..8a7cc3a --- /dev/null +++ b/docs/api/core/README.md @@ -0,0 +1,15 @@ +@ceajs/core / [Exports](modules.md) + +### 插件: cea-core + +### 安装 + +```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 diff --git a/docs/api/core/modules.md b/docs/api/core/modules.md new file mode 100644 index 0000000..f9168a3 --- /dev/null +++ b/docs/api/core/modules.md @@ -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) diff --git a/docs/api/core/modules/sstore.md b/docs/api/core/modules/sstore.md new file mode 100644 index 0000000..135bfd2 --- /dev/null +++ b/docs/api/core/modules/sstore.md @@ -0,0 +1,108 @@ +[@ceajs/core](../README.md) / [Exports](../modules.md) / sstore + +# Namespace: sstore + +## Table of contents + +### Functions + +- [clear](sstore.md#clear) +- [close](sstore.md#close) +- [del](sstore.md#del) +- [get](sstore.md#get) +- [set](sstore.md#set) + +## Functions + +### clear + +▸ **clear**(): `void` + +#### Returns + +`void` + +#### Defined in + +node_modules/@beetcb/sstore/src/index.d.ts:4 + +___ + +### close + +▸ **close**(): `void` + +#### Returns + +`void` + +#### Defined in + +node_modules/@beetcb/sstore/src/index.d.ts:5 + +___ + +### del + +▸ **del**(`key`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | + +#### Returns + +`void` + +#### Defined in + +node_modules/@beetcb/sstore/src/index.d.ts:3 + +___ + +### get + +▸ **get**(`key`): `any` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | + +#### Returns + +`any` + +#### Defined in + +node_modules/@beetcb/sstore/src/index.d.ts:1 + +___ + +### set + +▸ **set**<`T`\>(`key`, `value`): `T` + +#### Type parameters + +| Name | Type | +| :------ | :------ | +| `T` | `any` | + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `key` | `string` | +| `value` | `T` | + +#### Returns + +`T` + +#### Defined in + +node_modules/@beetcb/sstore/src/index.d.ts:2 diff --git a/docs/api/internal/.nojekyll b/docs/api/internal/.nojekyll new file mode 100644 index 0000000..e2ac661 --- /dev/null +++ b/docs/api/internal/.nojekyll @@ -0,0 +1 @@ +TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. \ No newline at end of file diff --git a/docs/api/internal/README.md b/docs/api/internal/README.md new file mode 100644 index 0000000..21d75f5 --- /dev/null +++ b/docs/api/internal/README.md @@ -0,0 +1,47 @@ +cea / [Exports](modules.md) + +## 详细说明 + +https://github.com/ceajs/cea/tree/main + +### 插件: cea + +### 安装 + +```bash +# 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/internal +- API 文档:https://github.com/ceajs/cea/blob/main/docs/api/internal/modules.md +- 配置文档:https://github.com/ceajs/cea diff --git a/docs/api/internal/classes/default.md b/docs/api/internal/classes/default.md new file mode 100644 index 0000000..a9c8adf --- /dev/null +++ b/docs/api/internal/classes/default.md @@ -0,0 +1,68 @@ +[cea](../README.md) / [Exports](../modules.md) / default + +# Class: default + +## Table of contents + +### Constructors + +- [constructor](default.md#constructor) + +### Properties + +- [plugins](default.md#plugins) + +### Methods + +- [addPlugin](default.md#addplugin) +- [start](default.md#start) + +## Constructors + +### constructor + +• **new default**() + +## Properties + +### plugins + +• `Private` **plugins**: `Set`<() => `Promise`<`void`\>\> + +#### Defined in + +[internal/src/index.ts:6](https://github.com/ceajs/cea/blob/d993e68/src/internal/src/index.ts#L6) + +## Methods + +### addPlugin + +▸ **addPlugin**(`plugin`): `void` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `plugin` | () => `Promise`<`void`\> | + +#### Returns + +`void` + +#### Defined in + +[internal/src/index.ts:8](https://github.com/ceajs/cea/blob/d993e68/src/internal/src/index.ts#L8) + +___ + +### start + +▸ **start**(): `Promise`<`void`\> + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[internal/src/index.ts:12](https://github.com/ceajs/cea/blob/d993e68/src/internal/src/index.ts#L12) diff --git a/docs/api/internal/modules.md b/docs/api/internal/modules.md new file mode 100644 index 0000000..44ed650 --- /dev/null +++ b/docs/api/internal/modules.md @@ -0,0 +1,42 @@ +[cea](README.md) / Exports + +# cea + +## Table of contents + +### Classes + +- [default](classes/default.md) + +### Functions + +- [attendanceCheckIn](modules.md#attendancecheckin) +- [checkIn](modules.md#checkin) + +## Functions + +### attendanceCheckIn + +▸ **attendanceCheckIn**(): `Promise`<`void`\> + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +plugins/attendance/lib/src/index.d.ts:1 + +___ + +### checkIn + +▸ **checkIn**(): `Promise`<`void`\> + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +plugins/sign/lib/src/index.d.ts:1 diff --git a/docs/api/modules.md b/docs/api/modules.md index 84fc320..44ed650 100644 --- a/docs/api/modules.md +++ b/docs/api/modules.md @@ -1,12 +1,17 @@ -[@ceajs/attendance-plugin](README.md) / Exports +[cea](README.md) / Exports -# @ceajs/attendance-plugin +# cea ## Table of contents +### Classes + +- [default](classes/default.md) + ### Functions - [attendanceCheckIn](modules.md#attendancecheckin) +- [checkIn](modules.md#checkin) ## Functions @@ -20,4 +25,18 @@ #### Defined in -[index.ts:3](https://github.com/ceajs/cea/blob/6e33125/src/plugins/attendance/src/index.ts#L3) +plugins/attendance/lib/src/index.d.ts:1 + +___ + +### checkIn + +▸ **checkIn**(): `Promise`<`void`\> + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +plugins/sign/lib/src/index.d.ts:1 diff --git a/docs/api/plugins/attendance/.nojekyll b/docs/api/plugins/attendance/.nojekyll new file mode 100644 index 0000000..e2ac661 --- /dev/null +++ b/docs/api/plugins/attendance/.nojekyll @@ -0,0 +1 @@ +TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. \ No newline at end of file diff --git a/docs/api/plugins/attendance/README.md b/docs/api/plugins/attendance/README.md new file mode 100644 index 0000000..a02fa82 --- /dev/null +++ b/docs/api/plugins/attendance/README.md @@ -0,0 +1,17 @@ +@ceajs/attendance-plugin / [Exports](modules.md) + +### 简介 + +Cea 插件: 实现自动查寝(无需配置查寝图片,自动获取) + +### 安装 + +```bash +npm i @ceajs/attendance-plugin +``` + +## 文档 + +- 项目说明: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 diff --git a/docs/api/plugins/attendance/modules.md b/docs/api/plugins/attendance/modules.md new file mode 100644 index 0000000..1873fd8 --- /dev/null +++ b/docs/api/plugins/attendance/modules.md @@ -0,0 +1,23 @@ +[@ceajs/attendance-plugin](README.md) / Exports + +# @ceajs/attendance-plugin + +## Table of contents + +### Functions + +- [attendanceCheckIn](modules.md#attendancecheckin) + +## Functions + +### attendanceCheckIn + +▸ **attendanceCheckIn**(): `Promise`<`void`\> + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[index.ts:3](https://github.com/ceajs/cea/blob/d993e68/src/plugins/attendance/src/index.ts#L3) diff --git a/docs/api/plugins/check-in-helper/.nojekyll b/docs/api/plugins/check-in-helper/.nojekyll new file mode 100644 index 0000000..e2ac661 --- /dev/null +++ b/docs/api/plugins/check-in-helper/.nojekyll @@ -0,0 +1 @@ +TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. \ No newline at end of file diff --git a/docs/api/plugins/check-in-helper/README.md b/docs/api/plugins/check-in-helper/README.md new file mode 100644 index 0000000..421b510 --- /dev/null +++ b/docs/api/plugins/check-in-helper/README.md @@ -0,0 +1,17 @@ +@ceajs/check-in-helper / [Exports](modules.md) + +### 简介 + +为 Cea 插件提供与今日校园相关工具 + +### 安装 + +```bash +npm i @ceajs/check-in-helper +``` + +## 文档 + +- 项目说明:https://github.com/ceajs/cea/tree/main/plugins/check-in-helper +- API 文档:https://github.com/ceajs/cea/blob/main/docs/api/plugins/check-in-helper/modules.md +- 配置文档:https://github.com/ceajs/cea diff --git a/docs/api/plugins/check-in-helper/classes/CheckIn.md b/docs/api/plugins/check-in-helper/classes/CheckIn.md new file mode 100644 index 0000000..a3182cb --- /dev/null +++ b/docs/api/plugins/check-in-helper/classes/CheckIn.md @@ -0,0 +1,327 @@ +[@ceajs/check-in-helper](../README.md) / [Exports](../modules.md) / CheckIn + +# Class: CheckIn + +Universal Check In helper for `sign` | `attendance` + +## Table of contents + +### Constructors + +- [constructor](CheckIn.md#constructor) + +### Properties + +- [campusphereHost](CheckIn.md#campuspherehost) +- [checkInType](CheckIn.md#checkintype) +- [headers](CheckIn.md#headers) +- [school](CheckIn.md#school) +- [user](CheckIn.md#user) +- [EXTENSION\_ENCRYPT](CheckIn.md#extension_encrypt) +- [FORMBODY\_ENCRYPT](CheckIn.md#formbody_encrypt) +- [VERSION](CheckIn.md#version) + +### Methods + +- [grabSignedData](CheckIn.md#grabsigneddata) +- [signInfo](CheckIn.md#signinfo) +- [signTaskDetails](CheckIn.md#signtaskdetails) +- [signWithForm](CheckIn.md#signwithform) +- [extensionEncrypt](CheckIn.md#extensionencrypt) +- [fillExtra](CheckIn.md#fillextra) +- [fixedFloatRight](CheckIn.md#fixedfloatright) +- [formBodyEncrypt](CheckIn.md#formbodyencrypt) +- [signIn](CheckIn.md#signin) + +## Constructors + +### constructor + +• **new CheckIn**(`user`, `checkInType`) + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `user` | `UserConfOpts` | +| `checkInType` | ``"sign"`` \| ``"attendance"`` | + +#### Defined in + +[index.ts:54](https://github.com/ceajs/cea/blob/d993e68/src/plugins/check-in-helper/src/index.ts#L54) + +## Properties + +### campusphereHost + +• `Private` `Readonly` **campusphereHost**: `string` + +#### Defined in + +[index.ts:52](https://github.com/ceajs/cea/blob/d993e68/src/plugins/check-in-helper/src/index.ts#L52) + +___ + +### checkInType + +• `Private` `Readonly` **checkInType**: ``"sign"`` \| ``"attendance"`` + +#### Defined in + +[index.ts:53](https://github.com/ceajs/cea/blob/d993e68/src/plugins/check-in-helper/src/index.ts#L53) + +___ + +### headers + +• `Private` **headers**: `StringKV` + +#### Defined in + +[index.ts:49](https://github.com/ceajs/cea/blob/d993e68/src/plugins/check-in-helper/src/index.ts#L49) + +___ + +### school + +• `Private` **school**: `SchoolConfOpts` + +#### Defined in + +[index.ts:51](https://github.com/ceajs/cea/blob/d993e68/src/plugins/check-in-helper/src/index.ts#L51) + +___ + +### user + +• `Private` **user**: `UserConfOpts` + +#### Defined in + +[index.ts:50](https://github.com/ceajs/cea/blob/d993e68/src/plugins/check-in-helper/src/index.ts#L50) + +___ + +### EXTENSION\_ENCRYPT + +▪ `Static` `Readonly` **EXTENSION\_ENCRYPT**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `algo` | `string` | +| `iv` | `Buffer` | +| `key` | `string` | + +#### Defined in + +[index.ts:38](https://github.com/ceajs/cea/blob/d993e68/src/plugins/check-in-helper/src/index.ts#L38) + +___ + +### FORMBODY\_ENCRYPT + +▪ `Static` `Readonly` **FORMBODY\_ENCRYPT**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `algo` | `string` | +| `iv` | `Buffer` | +| `key` | `string` | + +#### Defined in + +[index.ts:43](https://github.com/ceajs/cea/blob/d993e68/src/plugins/check-in-helper/src/index.ts#L43) + +___ + +### VERSION + +▪ `Static` `Readonly` **VERSION**: `Object` + +#### Type declaration + +| Name | Type | +| :------ | :------ | +| `app` | `string` | +| `calVersion` | `string` | +| `version` | `string` | + +#### Defined in + +[index.ts:33](https://github.com/ceajs/cea/blob/d993e68/src/plugins/check-in-helper/src/index.ts#L33) + +## Methods + +### grabSignedData + +▸ **grabSignedData**(): `Promise`<``null`` \| `SignTaskDetail`\> + +#### Returns + +`Promise`<``null`` \| `SignTaskDetail`\> + +#### Defined in + +[index.ts:237](https://github.com/ceajs/cea/blob/d993e68/src/plugins/check-in-helper/src/index.ts#L237) + +___ + +### signInfo + +▸ **signInfo**(): `Promise`<`void` \| `SignTaskPerDay`\> + +#### Returns + +`Promise`<`void` \| `SignTaskPerDay`\> + +#### Defined in + +[index.ts:67](https://github.com/ceajs/cea/blob/d993e68/src/plugins/check-in-helper/src/index.ts#L67) + +___ + +### signTaskDetails + +▸ **signTaskDetails**(`task`): `Promise`<`SignTaskDetail`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `task` | `SignTask` | + +#### Returns + +`Promise`<`SignTaskDetail`\> + +#### Defined in + +[index.ts:222](https://github.com/ceajs/cea/blob/d993e68/src/plugins/check-in-helper/src/index.ts#L222) + +___ + +### signWithForm + +▸ **signWithForm**(`curTask`): `Promise`<`LogInfo`\> + +Cookie is preconfigured by singInfo method + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `curTask` | `SignTask` | + +#### Returns + +`Promise`<`LogInfo`\> + +#### Defined in + +[index.ts:101](https://github.com/ceajs/cea/blob/d993e68/src/plugins/check-in-helper/src/index.ts#L101) + +___ + +### extensionEncrypt + +▸ `Static` `Private` **extensionEncrypt**(`body`): `string` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `body` | `SignExtensionBody` | + +#### Returns + +`string` + +#### Defined in + +[index.ts:311](https://github.com/ceajs/cea/blob/d993e68/src/plugins/check-in-helper/src/index.ts#L311) + +___ + +### fillExtra + +▸ `Static` `Private` **fillExtra**(`extraField`, `signedTemplate`): `undefined` \| { `extraFieldItemValue`: `string` ; `extraFieldItemWid`: `string` }[] + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `extraField` | { `extraFieldItems`: { `content`: `string` ; `isAbnormal`: `boolean` ; `isSelected`: `boolean` ; `value`: `string` ; `wid`: `string` }[] ; `title?`: `string` }[] | +| `signedTemplate` | `SignTaskDetail` | + +#### Returns + +`undefined` \| { `extraFieldItemValue`: `string` ; `extraFieldItemWid`: `string` }[] + +#### Defined in + +[index.ts:279](https://github.com/ceajs/cea/blob/d993e68/src/plugins/check-in-helper/src/index.ts#L279) + +___ + +### fixedFloatRight + +▸ `Static` `Private` **fixedFloatRight**(`floatStr`): `number` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `floatStr` | `string` | + +#### Returns + +`number` + +#### Defined in + +[index.ts:269](https://github.com/ceajs/cea/blob/d993e68/src/plugins/check-in-helper/src/index.ts#L269) + +___ + +### formBodyEncrypt + +▸ `Static` `Private` **formBodyEncrypt**(`body`): `string` + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `body` | `SignFormBody` | + +#### Returns + +`string` + +#### Defined in + +[index.ts:319](https://github.com/ceajs/cea/blob/d993e68/src/plugins/check-in-helper/src/index.ts#L319) + +___ + +### signIn + +▸ `Static` **signIn**(`users`, `checkInType`): `Promise`<``null`` \| `GlobalLogInfo`\> + +#### Parameters + +| Name | Type | +| :------ | :------ | +| `users` | `UserConfOpts`[] | +| `checkInType` | ``"sign"`` \| ``"attendance"`` | + +#### Returns + +`Promise`<``null`` \| `GlobalLogInfo`\> + +#### Defined in + +[index.ts:327](https://github.com/ceajs/cea/blob/d993e68/src/plugins/check-in-helper/src/index.ts#L327) diff --git a/docs/api/plugins/check-in-helper/modules.md b/docs/api/plugins/check-in-helper/modules.md new file mode 100644 index 0000000..1ee71ff --- /dev/null +++ b/docs/api/plugins/check-in-helper/modules.md @@ -0,0 +1,9 @@ +[@ceajs/check-in-helper](README.md) / Exports + +# @ceajs/check-in-helper + +## Table of contents + +### Classes + +- [CheckIn](classes/CheckIn.md) diff --git a/docs/api/plugins/sign/.nojekyll b/docs/api/plugins/sign/.nojekyll new file mode 100644 index 0000000..e2ac661 --- /dev/null +++ b/docs/api/plugins/sign/.nojekyll @@ -0,0 +1 @@ +TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. \ No newline at end of file diff --git a/docs/api/plugins/sign/README.md b/docs/api/plugins/sign/README.md new file mode 100644 index 0000000..ea977d0 --- /dev/null +++ b/docs/api/plugins/sign/README.md @@ -0,0 +1,17 @@ +@ceajs/sign-plugin / [Exports](modules.md) + +### 简介 + +Cea 插件: 实现自动签到,自动填写表单(无需配置填报信息) + +### 安装 + +```bash +npm i @ceajs/sign-plugin +``` + +## 文档 + +- 项目说明:https://github.com/ceajs/cea/tree/main/plugins/sign-plugin +- API 文档:https://github.com/ceajs/cea/blob/main/docs/api/plugins/sign/modules.md +- 配置文档:https://github.com/ceajs/cea diff --git a/docs/api/plugins/sign/modules.md b/docs/api/plugins/sign/modules.md new file mode 100644 index 0000000..90f30a4 --- /dev/null +++ b/docs/api/plugins/sign/modules.md @@ -0,0 +1,23 @@ +[@ceajs/sign-plugin](README.md) / Exports + +# @ceajs/sign-plugin + +## Table of contents + +### Functions + +- [checkIn](modules.md#checkin) + +## Functions + +### checkIn + +▸ **checkIn**(): `Promise`<`void`\> + +#### Returns + +`Promise`<`void`\> + +#### Defined in + +[index.ts:3](https://github.com/ceajs/cea/blob/d993e68/src/plugins/sign/src/index.ts#L3)