@ccw-api/api 0.0.2 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ccw-api/api",
3
- "version": "0.0.2",
3
+ "version": "0.1.0",
4
4
  "description": "ccw api collections",
5
5
  "license": "MIT",
6
6
  "author": "Meng Fuzi",
package/tsconfig.esm.json CHANGED
@@ -2,6 +2,7 @@
2
2
  "extends": "./tsconfig.json",
3
3
  "compilerOptions": {
4
4
  "module": "esnext",
5
- "outDir": "./dist/esm"
5
+ "outDir": "./dist/esm",
6
+ "declaration": false
6
7
  }
7
8
  }
@@ -3,6 +3,7 @@
3
3
  "compilerOptions": {
4
4
  "module": "commonjs",
5
5
  "outDir": "./dist/node",
6
- "moduleResolution": "node"
6
+ "moduleResolution": "node",
7
+ "declaration": false
7
8
  }
8
9
  }
@@ -3,7 +3,7 @@
3
3
  "compilerOptions": {
4
4
  "declaration": true,
5
5
  "emitDeclarationOnly": true,
6
- "outDir": "./dist"
6
+ "outDir": "./dist/types"
7
7
  },
8
8
  "exclude": ["**/*.test.ts"]
9
9
  }
@@ -1 +0,0 @@
1
- export {};
package/dist/index.d.ts DELETED
@@ -1,10 +0,0 @@
1
- import { sso } from "./sso/index";
2
- export type * from "./types";
3
- export { sso };
4
- declare const _default: {
5
- sso: {
6
- loginByPassword: typeof import("./sso/web/auth/login-by-password").loginByPassword;
7
- logout: typeof import("./sso/web/auth/logout").logout;
8
- };
9
- };
10
- export default _default;
@@ -1,10 +0,0 @@
1
- import { sso } from "./sso/index";
2
- export type * from "./types";
3
- export { sso };
4
- declare const _default: {
5
- sso: {
6
- loginByPassword: typeof import("./sso/web/auth/login-by-password").loginByPassword;
7
- logout: typeof import("./sso/web/auth/logout").logout;
8
- };
9
- };
10
- export default _default;
@@ -1,6 +0,0 @@
1
- import { loginByPassword } from "./web/auth/login-by-password";
2
- import { logout } from "./web/auth/logout";
3
- export declare const sso: {
4
- loginByPassword: typeof loginByPassword;
5
- logout: typeof logout;
6
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,38 +0,0 @@
1
- import { ApiResponse, MongoDBId } from "../../../types";
2
- export declare const url = "https://sso.ccw.site/web/auth/login-by-password";
3
- export type Req = {
4
- loginKey: string;
5
- clientCode: "STUDY_COMMUNITY";
6
- password: string;
7
- extra: string;
8
- };
9
- export type Res<Extra = string> = ApiResponse<{
10
- accountId: -1;
11
- accountObjectId: MongoDBId;
12
- accountType: "STUDENT";
13
- clientCode: "STUDY_COMMUNITY";
14
- createdAt: number;
15
- email: null;
16
- expireTime: number;
17
- extra: Extra;
18
- id: number;
19
- lastAccessTime: number;
20
- orgId: "";
21
- scene: null;
22
- status: "ENABLED";
23
- token: string;
24
- urlEncodedFullName: null;
25
- }>;
26
- type Extra = {
27
- loginType: "BY_PASSWORD";
28
- browser: string;
29
- ip: string;
30
- loginParentOid: MongoDBId;
31
- device: string;
32
- orgId: "";
33
- };
34
- export declare function loginByPassword(loginKey: string, password: string, reqExtra?: {
35
- device: string;
36
- browser: string;
37
- }): Promise<Res<Extra>["body"]>;
38
- export {};
@@ -1,3 +0,0 @@
1
- import { ApiResponse } from "../../../types";
2
- export declare const url = "https://sso.ccw.site/web/auth/logout";
3
- export declare function logout(): Promise<ApiResponse<null>>;
@@ -1,17 +0,0 @@
1
- /**
2
- * 十六进制秒级时间戳
3
- * @example const date = new Date(Number.parseInt(t, 16) * 1000);
4
- */
5
- export type HexSecTimeStamp = string;
6
- /**
7
- * @example
8
- * const t = id.subString(0,8);
9
- * const date = new Date(Number.parseInt(t, 16) * 1000);
10
- */
11
- export type MongoDBId = `${HexSecTimeStamp}${string}`;
12
- export type ApiResponse<T> = {
13
- body: T;
14
- code: string;
15
- msg: string;
16
- status: number;
17
- };
@@ -1,6 +0,0 @@
1
- import { loginByPassword } from "./web/auth/login-by-password";
2
- import { logout } from "./web/auth/logout";
3
- export declare const sso: {
4
- loginByPassword: typeof loginByPassword;
5
- logout: typeof logout;
6
- };
@@ -1,38 +0,0 @@
1
- import { ApiResponse, MongoDBId } from "../../../types";
2
- export declare const url = "https://sso.ccw.site/web/auth/login-by-password";
3
- export type Req = {
4
- loginKey: string;
5
- clientCode: "STUDY_COMMUNITY";
6
- password: string;
7
- extra: string;
8
- };
9
- export type Res<Extra = string> = ApiResponse<{
10
- accountId: -1;
11
- accountObjectId: MongoDBId;
12
- accountType: "STUDENT";
13
- clientCode: "STUDY_COMMUNITY";
14
- createdAt: number;
15
- email: null;
16
- expireTime: number;
17
- extra: Extra;
18
- id: number;
19
- lastAccessTime: number;
20
- orgId: "";
21
- scene: null;
22
- status: "ENABLED";
23
- token: string;
24
- urlEncodedFullName: null;
25
- }>;
26
- type Extra = {
27
- loginType: "BY_PASSWORD";
28
- browser: string;
29
- ip: string;
30
- loginParentOid: MongoDBId;
31
- device: string;
32
- orgId: "";
33
- };
34
- export declare function loginByPassword(loginKey: string, password: string, reqExtra?: {
35
- device: string;
36
- browser: string;
37
- }): Promise<Res<Extra>["body"]>;
38
- export {};
@@ -1,3 +0,0 @@
1
- import { ApiResponse } from "../../../types";
2
- export declare const url = "https://sso.ccw.site/web/auth/logout";
3
- export declare function logout(): Promise<ApiResponse<null>>;
package/dist/types.d.ts DELETED
@@ -1,17 +0,0 @@
1
- /**
2
- * 十六进制秒级时间戳
3
- * @example const date = new Date(Number.parseInt(t, 16) * 1000);
4
- */
5
- export type HexSecTimeStamp = string;
6
- /**
7
- * @example
8
- * const t = id.subString(0,8);
9
- * const date = new Date(Number.parseInt(t, 16) * 1000);
10
- */
11
- export type MongoDBId = `${HexSecTimeStamp}${string}`;
12
- export type ApiResponse<T> = {
13
- body: T;
14
- code: string;
15
- msg: string;
16
- status: number;
17
- };
File without changes
File without changes
File without changes
File without changes