zyjj-web-sdk 1.0.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/README.md ADDED
@@ -0,0 +1,30 @@
1
+ # React + TypeScript + Vite
2
+
3
+ This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
4
+
5
+ Currently, two official plugins are available:
6
+
7
+ - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
8
+ - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
9
+
10
+ ## Expanding the ESLint configuration
11
+
12
+ If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
13
+
14
+ - Configure the top-level `parserOptions` property like this:
15
+
16
+ ```js
17
+ export default {
18
+ // other rules...
19
+ parserOptions: {
20
+ ecmaVersion: 'latest',
21
+ sourceType: 'module',
22
+ project: ['./tsconfig.json', './tsconfig.node.json'],
23
+ tsconfigRootDir: __dirname,
24
+ },
25
+ }
26
+ ```
27
+
28
+ - Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
29
+ - Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
30
+ - Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
@@ -0,0 +1,38 @@
1
+ import { AddTaskReq, GetCosResp, GetPageInfo, MqttClientInfo, PayCodeInfo, PayMethodInfo, PointRecordInfo, UserLoginReq, GetPageReq } from './entity.ts';
2
+ import { AppInfo, TaskInfo, ToolInfo, UserInfo } from "../types/cloud.ts";
3
+ export declare const UserLogin: (data: UserLoginReq) => Promise<string>;
4
+ export declare const GetAppInfo: () => Promise<AppInfo>;
5
+ export declare const UserRegister: (data: UserLoginReq) => Promise<void>;
6
+ export declare const UserPasswordReset: (data: UserLoginReq) => Promise<void>;
7
+ export declare const GetToken: (email: string) => Promise<void>;
8
+ export declare const GetUserInfo: () => Promise<UserInfo>;
9
+ export declare const UserCheckIn: () => Promise<void>;
10
+ export declare const PointExchange: (code: string) => Promise<void>;
11
+ export declare const GetPointRecordList: (no: number, size: number) => Promise<GetPageInfo<PointRecordInfo>>;
12
+ export declare const GetPayMethodsList: () => Promise<PayMethodInfo[]>;
13
+ export declare const GetPayCode: (id: number, price: number) => Promise<PayCodeInfo>;
14
+ export declare const GetPayStatus: (id: string) => Promise<number>;
15
+ export declare const CostPoint: (data: {
16
+ name: string;
17
+ point: number;
18
+ desc: string;
19
+ uid: string;
20
+ }) => Promise<void>;
21
+ export declare const GetToolList: (req: GetPageReq) => Promise<GetPageInfo<ToolInfo>>;
22
+ export declare const GetToolTagList: () => Promise<string[]>;
23
+ export declare const GetTencentCosInfo: () => Promise<GetCosResp>;
24
+ export declare const AddTask: (data: AddTaskReq) => Promise<string>;
25
+ export declare const GetTaskInfo: (id: string) => Promise<TaskInfo>;
26
+ export declare const GetMqttTaskClientInfo: () => Promise<MqttClientInfo>;
27
+ export declare const GetMaterialTagList: () => Promise<string[]>;
28
+ export declare const GetMaterialList: (req: GetPageReq) => Promise<GetPageInfo<any>>;
29
+ export declare const UserDownloadMaterial: (id: string) => Promise<string>;
30
+ export declare const GetMaterialUrl: (key_list: string[]) => Promise<{
31
+ [key: string]: string;
32
+ }>;
33
+ export declare const SendCommonRequest: (data: {
34
+ url: string;
35
+ data: any;
36
+ method: string;
37
+ }) => Promise<unknown>;
38
+ export declare const AddFeedback: (data: any) => Promise<unknown>;
@@ -0,0 +1,59 @@
1
+ export interface UserLoginReq {
2
+ email: string;
3
+ password?: string;
4
+ token?: string;
5
+ }
6
+ export interface GetPageReq {
7
+ current: number;
8
+ size: number;
9
+ tag?: string;
10
+ name?: string;
11
+ }
12
+ export interface GetPageInfo<T> {
13
+ total: number;
14
+ list: T[];
15
+ }
16
+ export interface GetCosResp {
17
+ token: GetCosToken;
18
+ bucket: string;
19
+ region: string;
20
+ path: string;
21
+ start_time: number;
22
+ end_time: number;
23
+ }
24
+ export interface GetCosToken {
25
+ Token: string;
26
+ TmpSecretId: string;
27
+ TmpSecretKey: string;
28
+ }
29
+ export interface AddTaskReq {
30
+ task_type: number;
31
+ input: string;
32
+ status: number;
33
+ }
34
+ export interface MqttClientInfo {
35
+ host: string;
36
+ client_id: string;
37
+ topic: string;
38
+ username: string;
39
+ password: string;
40
+ }
41
+ export interface PointRecordInfo {
42
+ id: string;
43
+ uid: string;
44
+ name: string;
45
+ point: number;
46
+ desc: string;
47
+ create_time: number;
48
+ }
49
+ export interface PayMethodInfo {
50
+ id: number;
51
+ name: string;
52
+ pic?: string;
53
+ msg?: string;
54
+ support: boolean;
55
+ }
56
+ export interface PayCodeInfo {
57
+ html: string;
58
+ no: string;
59
+ }
@@ -0,0 +1 @@
1
+ export default function request<D, T>(url: string, data: D, type: string, alert?: boolean): Promise<T>;
@@ -0,0 +1,6 @@
1
+ import './css/material.css';
2
+ import { MaterialInfo } from "../types/cloud.ts";
3
+ export default function MaterialCard(props: {
4
+ material: MaterialInfo;
5
+ onDownload: () => void;
6
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { ColumnProps } from '@arco-design/web-react/es/Table/interface';
2
+ import { GetPageInfo } from "../api/entity.ts";
3
+ export interface PageTableProps<T> {
4
+ columns: ColumnProps<T>[];
5
+ data: (num: number, size: number) => Promise<GetPageInfo<T>>;
6
+ refresh?: (refresh: () => void) => void;
7
+ id?: string;
8
+ pageSize?: number;
9
+ }
10
+ export default function PageTable<T>(props: PageTableProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { ReactElement } from 'react';
2
+ export default function TokenInput(props: {
3
+ callback: () => Promise<void>;
4
+ onChange?: (value: string) => void;
5
+ }): ReactElement;
@@ -0,0 +1,7 @@
1
+ import { ReactElement } from 'react';
2
+ import { ToolInfo } from "../types/cloud.ts";
3
+ export default function ToolCard(props: {
4
+ onTool: () => void;
5
+ onHelp: () => void;
6
+ info: ToolInfo;
7
+ }): ReactElement;
@@ -0,0 +1,10 @@
1
+ export declare const LoginComponent: (props: {
2
+ loginSuccess: (token: string) => void;
3
+ onForget: () => void;
4
+ }) => import("react/jsx-runtime").JSX.Element;
5
+ export interface UserLoginModalProps {
6
+ visible: boolean;
7
+ onCancel: () => void;
8
+ loginSuccess: (token: string) => void;
9
+ }
10
+ export default function UserLoginModal(props: UserLoginModalProps): import("react/jsx-runtime").JSX.Element;
package/lib/index.d.ts ADDED
@@ -0,0 +1,48 @@
1
+ import { FileSource, LocalTaskStatus, LocalActionReqType, LocalActionResType } from "./types/local-task.ts";
2
+ import { CloudTaskStatus, ToolType } from "./types/cloud.ts";
3
+ import { MQTTEventType } from "./types/mqtt.ts";
4
+ import { FfmpegActionType, ToolTaskType } from "./types/tool-task.ts";
5
+ export { default as UserLoginModal } from './components/UserLogin.tsx';
6
+ export type { UserLoginModalProps } from './components/UserLogin.tsx';
7
+ export { default as PageTable } from './components/PageTable.tsx';
8
+ export type { PageTableProps } from './components/PageTable.tsx';
9
+ export { default as ToolList } from './pages/ToolList.tsx';
10
+ export type { ToolListProps } from './pages/ToolList.tsx';
11
+ export { default as MaterialList } from './pages/MaterialList.tsx';
12
+ export type { MaterialListProps } from './pages/MaterialList.tsx';
13
+ export { default as UserInfoPage } from './pages/UserInfoPage.tsx';
14
+ export type { UserInfoPageProps } from './pages/UserInfoPage.tsx';
15
+ export { default as TaskList } from './pages/TaskList.tsx';
16
+ export type { TaskListProps } from './pages/TaskList.tsx';
17
+ export declare const Api: {
18
+ CostPoint: (data: {
19
+ name: string;
20
+ point: number;
21
+ desc: string;
22
+ uid: string;
23
+ }) => Promise<void>;
24
+ SendCommonRequest: (data: {
25
+ url: string;
26
+ data: any;
27
+ method: string;
28
+ }) => Promise<unknown>;
29
+ GetUserInfo: () => Promise<import("./types/cloud.ts").UserInfo>;
30
+ UserDownloadMaterial: (id: string) => Promise<string>;
31
+ GetMqttTaskClientInfo: () => Promise<import("./api/entity.ts").MqttClientInfo>;
32
+ AddTask: (data: import("./api/entity.ts").AddTaskReq) => Promise<string>;
33
+ GetTencentCosInfo: () => Promise<import("./api/entity.ts").GetCosResp>;
34
+ GetMaterialUrl: (key_list: string[]) => Promise<{
35
+ [key: string]: string;
36
+ }>;
37
+ };
38
+ export declare const Enum: {
39
+ ToolType: typeof ToolType;
40
+ LocalActionReqType: typeof LocalActionReqType;
41
+ LocalActionResType: typeof LocalActionResType;
42
+ MQTTEventType: typeof MQTTEventType;
43
+ FileSource: typeof FileSource;
44
+ LocalTaskStatus: typeof LocalTaskStatus;
45
+ ToolTaskType: typeof ToolTaskType;
46
+ FfmpegActionType: typeof FfmpegActionType;
47
+ CloudTaskStatus: typeof CloudTaskStatus;
48
+ };