diff --git a/package.json b/package.json index dc12bcd5..9ec08443 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "dev": "concurrently 'pnpm:dev:*'", "dev:server": "pnpm run --dir packages/server dev", "dev:client": "pnpm run --dir packages/client dev", - "build": "pnpm build:server && pnpm build:client", + "build": "pnpm build:dep && pnpm build:server && pnpm build:client", "build:dep": "pnpm build:constants && pnpm build:domains && pnpm build:config", "build:constants": "pnpm run --dir packages/constants build", "build:domains": "pnpm run --dir packages/domains build", diff --git a/packages/config/lib/index.js b/packages/config/lib/index.js index 6c0f8fd6..7f9636cd 100644 --- a/packages/config/lib/index.js +++ b/packages/config/lib/index.js @@ -1,21 +1,20 @@ "use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); +exports.__esModule = true; exports.getConfig = void 0; -const fs = require("fs-extra"); -const yaml = require("js-yaml"); -const path = require("path"); -const FILE_ENV_NAME = { +var fs = require("fs-extra"); +var yaml = require("js-yaml"); +var path = require("path"); +var FILE_ENV_NAME = { development: 'dev', test: 'test', - production: 'prod', + production: 'prod' }; -const env = process.env.NODE_ENV || 'development'; +var env = process.env.NODE_ENV || 'development'; function getConfig() { - const filePath = path.join(__dirname, '../yaml/', `${FILE_ENV_NAME[env]}.yaml`); + var filePath = path.join(__dirname, '../yaml/', "".concat(FILE_ENV_NAME[env], ".yaml")); if (!fs.existsSync(filePath)) { - throw new Error(`Can not find config file: ${filePath}`); + throw new Error("Can not find config file: ".concat(filePath)); } return yaml.load(fs.readFileSync(filePath, 'utf8')); } exports.getConfig = getConfig; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/config/package.json b/packages/config/package.json index d804243a..5b44dfe2 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -12,10 +12,14 @@ "sideEffects": false, "license": "MIT", "scripts": { - "build": "tsc --declaration" + "build": "tsc src/*.ts --outDir lib --skipLibCheck --declaration" }, - "files": ["lib", "src", "yaml"], + "files": [ + "lib", + "src", + "yaml" + ], "dependencies": { "js-yaml": "^4.1.0" } -} +} \ No newline at end of file diff --git a/packages/config/tsconfig.json b/packages/config/tsconfig.json deleted file mode 100644 index be9056be..00000000 --- a/packages/config/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "declaration": true, - "removeComments": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "allowSyntheticDefaultImports": true, - "target": "ES2017", - "sourceMap": true, - "incremental": true, - "rootDir": "src", - "outDir": "lib" - }, - "include": ["src"], - "exclude": ["src/**/*.spec.ts"] -} diff --git a/packages/constants/lib/index.js b/packages/constants/lib/index.js index d4583e50..a269a6c3 100644 --- a/packages/constants/lib/index.js +++ b/packages/constants/lib/index.js @@ -1,5 +1,5 @@ "use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); +exports.__esModule = true; exports.EMPTY_DOCUMNENT = exports.WIKI_AVATARS = exports.DEFAULT_WIKI_AVATAR = void 0; exports.DEFAULT_WIKI_AVATAR = 'https://wipi.oss-cn-shanghai.aliyuncs.com/2022-02-01/default0-96.png'; exports.WIKI_AVATARS = [ @@ -18,10 +18,10 @@ exports.WIKI_AVATARS = [ ]; exports.EMPTY_DOCUMNENT = { content: JSON.stringify({ - default: { + "default": { type: 'doc', - content: [{ type: 'title', content: [{ type: 'text', text: '未命名文档' }] }], - }, + content: [{ type: 'title', content: [{ type: 'text', text: '未命名文档' }] }] + } }), state: Buffer.from(new Uint8Array([ 1, 14, 204, 224, 154, 225, 13, 0, 7, 1, 7, 100, 101, 102, 97, 117, 108, 116, 3, 5, 116, 105, 116, 108, 101, 1, 0, @@ -32,6 +32,5 @@ exports.EMPTY_DOCUMNENT = { 225, 13, 14, 6, 132, 204, 224, 154, 225, 13, 20, 6, 229, 145, 189, 229, 144, 141, 129, 204, 224, 154, 225, 13, 22, 5, 132, 204, 224, 154, 225, 13, 27, 6, 230, 150, 135, 230, 161, 163, 1, 204, 224, 154, 225, 13, 5, 1, 2, 6, 4, 11, 3, 15, 6, 23, 5, - ])), + ])) }; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/constants/package.json b/packages/constants/package.json index 14deaaac..eecc2e05 100644 --- a/packages/constants/package.json +++ b/packages/constants/package.json @@ -12,10 +12,13 @@ "sideEffects": false, "license": "MIT", "scripts": { - "build": "tsc --declaration" + "build": "tsc src/*.ts --outDir lib --skipLibCheck --declaration" }, - "files": ["lib", "src"], + "files": [ + "lib", + "src" + ], "devDependencies": { "typescript": "^4.5.5" } -} +} \ No newline at end of file diff --git a/packages/constants/tsconfig.json b/packages/constants/tsconfig.json deleted file mode 100644 index be9056be..00000000 --- a/packages/constants/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "declaration": true, - "removeComments": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "allowSyntheticDefaultImports": true, - "target": "ES2017", - "sourceMap": true, - "incremental": true, - "rootDir": "src", - "outDir": "lib" - }, - "include": ["src"], - "exclude": ["src/**/*.spec.ts"] -} diff --git a/packages/domains/lib/index.js b/packages/domains/lib/index.js index ee81a3dc..f4a7e2ca 100644 --- a/packages/domains/lib/index.js +++ b/packages/domains/lib/index.js @@ -9,7 +9,6 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; -Object.defineProperty(exports, "__esModule", { value: true }); +exports.__esModule = true; __exportStar(require("./models"), exports); __exportStar(require("./util"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/domains/lib/index.js.map b/packages/domains/lib/index.js.map deleted file mode 100644 index e48c23c1..00000000 --- a/packages/domains/lib/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAyB;AACzB,yCAAuB"} \ No newline at end of file diff --git a/packages/domains/lib/models/collector.js b/packages/domains/lib/models/collector.js index 2be2922c..3100a7cc 100644 --- a/packages/domains/lib/models/collector.js +++ b/packages/domains/lib/models/collector.js @@ -1,9 +1,8 @@ "use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); +exports.__esModule = true; exports.CollectType = void 0; var CollectType; (function (CollectType) { CollectType["document"] = "document"; CollectType["wiki"] = "wiki"; })(CollectType = exports.CollectType || (exports.CollectType = {})); -//# sourceMappingURL=collector.js.map \ No newline at end of file diff --git a/packages/domains/lib/models/collector.js.map b/packages/domains/lib/models/collector.js.map deleted file mode 100644 index 766941c2..00000000 --- a/packages/domains/lib/models/collector.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"collector.js","sourceRoot":"","sources":["../../src/models/collector.ts"],"names":[],"mappings":";;;AAAA,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,oCAAqB,CAAA;IACrB,4BAAa,CAAA;AACf,CAAC,EAHW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAGtB"} \ No newline at end of file diff --git a/packages/domains/lib/models/comment.d.ts b/packages/domains/lib/models/comment.d.ts index 45916b8b..af057901 100644 --- a/packages/domains/lib/models/comment.d.ts +++ b/packages/domains/lib/models/comment.d.ts @@ -1,5 +1,8 @@ import { IUser } from './user'; import { IDocument } from './document'; +/** + * 评论 + */ export interface IComment { id: string; parentCommentId?: IComment['id']; diff --git a/packages/domains/lib/models/comment.js b/packages/domains/lib/models/comment.js index 17c250c2..0e345787 100644 --- a/packages/domains/lib/models/comment.js +++ b/packages/domains/lib/models/comment.js @@ -1,3 +1,2 @@ "use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=comment.js.map \ No newline at end of file +exports.__esModule = true; diff --git a/packages/domains/lib/models/comment.js.map b/packages/domains/lib/models/comment.js.map deleted file mode 100644 index 49d93a56..00000000 --- a/packages/domains/lib/models/comment.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"comment.js","sourceRoot":"","sources":["../../src/models/comment.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/packages/domains/lib/models/document.d.ts b/packages/domains/lib/models/document.d.ts index 696e9204..b85e92cf 100644 --- a/packages/domains/lib/models/document.d.ts +++ b/packages/domains/lib/models/document.d.ts @@ -1,9 +1,15 @@ import { IUser } from './user'; import { IWiki } from './wiki'; +/** + * 文档状态枚举 + */ export declare enum DocumentStatus { private = "private", public = "public" } +/** + * 文档数据定义 + */ export interface IDocument { id: string; wikiId: IWiki['id']; @@ -21,6 +27,9 @@ export interface IDocument { updatedAt: Date; children?: IDocument[]; } +/** + * 文档成员权限数据定义 + */ export interface IAuthority { id: string; documentId: IDocument['id']; diff --git a/packages/domains/lib/models/document.js b/packages/domains/lib/models/document.js index 32691f66..eada4c6e 100644 --- a/packages/domains/lib/models/document.js +++ b/packages/domains/lib/models/document.js @@ -1,9 +1,11 @@ "use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); +exports.__esModule = true; exports.DocumentStatus = void 0; +/** + * 文档状态枚举 + */ var DocumentStatus; (function (DocumentStatus) { DocumentStatus["private"] = "private"; DocumentStatus["public"] = "public"; })(DocumentStatus = exports.DocumentStatus || (exports.DocumentStatus = {})); -//# sourceMappingURL=document.js.map \ No newline at end of file diff --git a/packages/domains/lib/models/document.js.map b/packages/domains/lib/models/document.js.map deleted file mode 100644 index 08f88ff6..00000000 --- a/packages/domains/lib/models/document.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"document.js","sourceRoot":"","sources":["../../src/models/document.ts"],"names":[],"mappings":";;;AAMA,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,mCAAiB,CAAA;AACnB,CAAC,EAHW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAGzB"} \ No newline at end of file diff --git a/packages/domains/lib/models/index.js b/packages/domains/lib/models/index.js index 872c083e..0088a0b6 100644 --- a/packages/domains/lib/models/index.js +++ b/packages/domains/lib/models/index.js @@ -9,7 +9,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); }; -Object.defineProperty(exports, "__esModule", { value: true }); +exports.__esModule = true; __exportStar(require("./user"), exports); __exportStar(require("./wiki"), exports); __exportStar(require("./document"), exports); @@ -18,4 +18,3 @@ __exportStar(require("./template"), exports); __exportStar(require("./comment"), exports); __exportStar(require("./collector"), exports); __exportStar(require("./pagination"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/domains/lib/models/index.js.map b/packages/domains/lib/models/index.js.map deleted file mode 100644 index c97d5f39..00000000 --- a/packages/domains/lib/models/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAuB;AACvB,yCAAuB;AACvB,6CAA2B;AAC3B,4CAA0B;AAC1B,6CAA2B;AAC3B,4CAA0B;AAC1B,8CAA4B;AAC5B,+CAA6B"} \ No newline at end of file diff --git a/packages/domains/lib/models/message.d.ts b/packages/domains/lib/models/message.d.ts index 7a55841c..98239494 100644 --- a/packages/domains/lib/models/message.d.ts +++ b/packages/domains/lib/models/message.d.ts @@ -1,4 +1,7 @@ import { IUser } from './user'; +/** + * 消息数据定义 + */ export interface IMessage { id: string; userId: IUser['id']; diff --git a/packages/domains/lib/models/message.js b/packages/domains/lib/models/message.js index d9d1c3b4..0e345787 100644 --- a/packages/domains/lib/models/message.js +++ b/packages/domains/lib/models/message.js @@ -1,3 +1,2 @@ "use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=message.js.map \ No newline at end of file +exports.__esModule = true; diff --git a/packages/domains/lib/models/message.js.map b/packages/domains/lib/models/message.js.map deleted file mode 100644 index 4f492a9f..00000000 --- a/packages/domains/lib/models/message.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"message.js","sourceRoot":"","sources":["../../src/models/message.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/packages/domains/lib/models/pagination.js b/packages/domains/lib/models/pagination.js index 7696f1a4..0e345787 100644 --- a/packages/domains/lib/models/pagination.js +++ b/packages/domains/lib/models/pagination.js @@ -1,3 +1,2 @@ "use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=pagination.js.map \ No newline at end of file +exports.__esModule = true; diff --git a/packages/domains/lib/models/pagination.js.map b/packages/domains/lib/models/pagination.js.map deleted file mode 100644 index 266b018c..00000000 --- a/packages/domains/lib/models/pagination.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../src/models/pagination.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/packages/domains/lib/models/template.d.ts b/packages/domains/lib/models/template.d.ts index eba765fb..6360e253 100644 --- a/packages/domains/lib/models/template.d.ts +++ b/packages/domains/lib/models/template.d.ts @@ -1,4 +1,7 @@ import { IUser } from './user'; +/** + * 文档模板数据定义 + */ export interface ITemplate { id: string; createUserId: IUser['id']; diff --git a/packages/domains/lib/models/template.js b/packages/domains/lib/models/template.js index ea29227b..0e345787 100644 --- a/packages/domains/lib/models/template.js +++ b/packages/domains/lib/models/template.js @@ -1,3 +1,2 @@ "use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=template.js.map \ No newline at end of file +exports.__esModule = true; diff --git a/packages/domains/lib/models/template.js.map b/packages/domains/lib/models/template.js.map deleted file mode 100644 index e74fd69e..00000000 --- a/packages/domains/lib/models/template.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"template.js","sourceRoot":"","sources":["../../src/models/template.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/packages/domains/lib/models/user.d.ts b/packages/domains/lib/models/user.d.ts index d065237a..d832b43e 100644 --- a/packages/domains/lib/models/user.d.ts +++ b/packages/domains/lib/models/user.d.ts @@ -1,12 +1,21 @@ +/** + * 用户角色枚举 + */ export declare enum UserRole { normal = "normal", admin = "admin", superadmin = "superadmin" } +/** + * 用户状态枚举 + */ export declare enum UserStatus { normal = "normal", locked = "locked" } +/** + * 用户数据定义 + */ export interface IUser { id: string; name: string; @@ -16,6 +25,9 @@ export interface IUser { role: UserRole; status: UserStatus; } +/** + * 登录用户数据定义 + */ export interface ILoginUser extends IUser { token: string; } diff --git a/packages/domains/lib/models/user.js b/packages/domains/lib/models/user.js index eb017266..244aa134 100644 --- a/packages/domains/lib/models/user.js +++ b/packages/domains/lib/models/user.js @@ -1,15 +1,20 @@ "use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); +exports.__esModule = true; exports.UserStatus = exports.UserRole = void 0; +/** + * 用户角色枚举 + */ var UserRole; (function (UserRole) { UserRole["normal"] = "normal"; UserRole["admin"] = "admin"; UserRole["superadmin"] = "superadmin"; })(UserRole = exports.UserRole || (exports.UserRole = {})); +/** + * 用户状态枚举 + */ var UserStatus; (function (UserStatus) { UserStatus["normal"] = "normal"; UserStatus["locked"] = "locked"; })(UserStatus = exports.UserStatus || (exports.UserStatus = {})); -//# sourceMappingURL=user.js.map \ No newline at end of file diff --git a/packages/domains/lib/models/user.js.map b/packages/domains/lib/models/user.js.map deleted file mode 100644 index be2d5037..00000000 --- a/packages/domains/lib/models/user.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/models/user.ts"],"names":[],"mappings":";;;AAGA,IAAY,QAIX;AAJD,WAAY,QAAQ;IAClB,6BAAiB,CAAA;IACjB,2BAAe,CAAA;IACf,qCAAyB,CAAA;AAC3B,CAAC,EAJW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAInB;AAKD,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;AACnB,CAAC,EAHW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAGrB"} \ No newline at end of file diff --git a/packages/domains/lib/models/wiki.d.ts b/packages/domains/lib/models/wiki.d.ts index 65b68c26..f9a1c35a 100644 --- a/packages/domains/lib/models/wiki.d.ts +++ b/packages/domains/lib/models/wiki.d.ts @@ -1,17 +1,29 @@ import { IUser } from './user'; +/** + * 知识库状态枚举 + */ export declare enum WikiStatus { private = "private", public = "public" } +/** + * 知识库成员状态枚举 + */ export declare enum WikiUserStatus { applying = "applying", inviting = "inviting", normal = "normal" } +/** + * 知识库成员角色枚举 + */ export declare enum WikiUserRole { normal = "normal", admin = "admin" } +/** + * 知识库数据定义 + */ export interface IWiki { id: string; name: string; @@ -23,6 +35,9 @@ export interface IWiki { createdAt: Date; updatedAt: Date; } +/** + * 知识库成员数据定义 + */ export interface IWikiUser extends IUser { userRole: WikiUserRole; userStatus: WikiUserStatus; diff --git a/packages/domains/lib/models/wiki.js b/packages/domains/lib/models/wiki.js index 18f2010d..408030d6 100644 --- a/packages/domains/lib/models/wiki.js +++ b/packages/domains/lib/models/wiki.js @@ -1,20 +1,28 @@ "use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); +exports.__esModule = true; exports.WikiUserRole = exports.WikiUserStatus = exports.WikiStatus = void 0; +/** + * 知识库状态枚举 + */ var WikiStatus; (function (WikiStatus) { WikiStatus["private"] = "private"; WikiStatus["public"] = "public"; })(WikiStatus = exports.WikiStatus || (exports.WikiStatus = {})); +/** + * 知识库成员状态枚举 + */ var WikiUserStatus; (function (WikiUserStatus) { WikiUserStatus["applying"] = "applying"; WikiUserStatus["inviting"] = "inviting"; WikiUserStatus["normal"] = "normal"; })(WikiUserStatus = exports.WikiUserStatus || (exports.WikiUserStatus = {})); +/** + * 知识库成员角色枚举 + */ var WikiUserRole; (function (WikiUserRole) { WikiUserRole["normal"] = "normal"; WikiUserRole["admin"] = "admin"; })(WikiUserRole = exports.WikiUserRole || (exports.WikiUserRole = {})); -//# sourceMappingURL=wiki.js.map \ No newline at end of file diff --git a/packages/domains/lib/models/wiki.js.map b/packages/domains/lib/models/wiki.js.map deleted file mode 100644 index 8133c7d4..00000000 --- a/packages/domains/lib/models/wiki.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"wiki.js","sourceRoot":"","sources":["../../src/models/wiki.ts"],"names":[],"mappings":";;;AAKA,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,iCAAmB,CAAA;IACnB,+BAAiB,CAAA;AACnB,CAAC,EAHW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAGrB;AAKD,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,uCAAqB,CAAA;IACrB,uCAAqB,CAAA;IACrB,mCAAiB,CAAA;AACnB,CAAC,EAJW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAIzB;AAKD,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,+BAAe,CAAA;AACjB,CAAC,EAHW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAGvB"} \ No newline at end of file diff --git a/packages/domains/lib/services/ICollectorService.d.ts b/packages/domains/lib/services/ICollectorService.d.ts deleted file mode 100644 index 959c1d0d..00000000 --- a/packages/domains/lib/services/ICollectorService.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { IUser, IWiki, IDocument, CollectType } from "../models"; -export declare type ICollectDto = { - targetId: IWiki["id"] | IDocument["id"]; - type: CollectType; -}; -export declare abstract class ICollectorService { - /** - * 知识库 - */ - wikis = []; - getWikisLoading = false; - getWikisError = null; - - /** - * 文档 - */ - documents = []; - getDocumentsLoading = false; - getDocumentsError = null; - - /** - * 收藏(或取消收藏) - */ - toggleLoading = false; - toggleError = null; - - /** - * 检查是否收藏 - */ - checkLoading = false; - checkError = null; - - abstract toggleCollect(data: ICollectDto, user?: IUser): Promise; - abstract checkCollect(data: ICollectDto): Promise; - abstract getCollectWikis(user?: IUser): Promise; - abstract getCollectDocuments(user?: IUser): Promise; -} diff --git a/packages/domains/lib/services/ICollectorService.js b/packages/domains/lib/services/ICollectorService.js deleted file mode 100644 index 7a6cae39..00000000 --- a/packages/domains/lib/services/ICollectorService.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ICollectorService = void 0; -class ICollectorService { -} -exports.ICollectorService = ICollectorService; -//# sourceMappingURL=ICollectorService.js.map \ No newline at end of file diff --git a/packages/domains/lib/services/ICollectorService.js.map b/packages/domains/lib/services/ICollectorService.js.map deleted file mode 100644 index fa7e718f..00000000 --- a/packages/domains/lib/services/ICollectorService.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ICollectorService.js","sourceRoot":"","sources":["../../src/services/ICollectorService.ts"],"names":[],"mappings":";;;AAcA,MAAsB,iBAAiB;CAyBtC;AAzBD,8CAyBC"} \ No newline at end of file diff --git a/packages/domains/lib/services/ICommentService.d.ts b/packages/domains/lib/services/ICommentService.d.ts deleted file mode 100644 index b26b463d..00000000 --- a/packages/domains/lib/services/ICommentService.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { IUser, IComment, IDocument, IPagination } from "../models"; -export declare type ICreateCommentDto = { - parentCommentId?: IComment["id"]; - documentId: IDocument["id"]; - html: string; - replyUserId?: IUser["id"]; -}; -export declare type IUpdateCommentDto = { - id: IComment["id"]; - html?: string; -}; -export declare abstract class ICommentService { - abstract createComment(data: ICreateCommentDto, user?: IUser, userAgent?: string): Promise; - abstract updateComment(data: IUpdateCommentDto, user?: IUser): Promise; - abstract deleteComment(id: IComment["id"], user?: IUser): Promise; - abstract getDocumentComments(documentId: IDocument["id"], pagination: IPagination): Promise; -} diff --git a/packages/domains/lib/services/ICommentService.js b/packages/domains/lib/services/ICommentService.js deleted file mode 100644 index f01e21e5..00000000 --- a/packages/domains/lib/services/ICommentService.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ICommentService = void 0; -class ICommentService { -} -exports.ICommentService = ICommentService; -//# sourceMappingURL=ICommentService.js.map \ No newline at end of file diff --git a/packages/domains/lib/services/ICommentService.js.map b/packages/domains/lib/services/ICommentService.js.map deleted file mode 100644 index 8a08255b..00000000 --- a/packages/domains/lib/services/ICommentService.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ICommentService.js","sourceRoot":"","sources":["../../src/services/ICommentService.ts"],"names":[],"mappings":";;;AAkCA,MAAsB,eAAe;CAuCpC;AAvCD,0CAuCC"} \ No newline at end of file diff --git a/packages/domains/lib/services/IDocumentService.d.ts b/packages/domains/lib/services/IDocumentService.d.ts deleted file mode 100644 index 2ada0694..00000000 --- a/packages/domains/lib/services/IDocumentService.d.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { IUser, IWiki, ITemplate, IDocument, IAuthority } from "../models"; -export declare type ICreateDocumentDto = { - wikiId: IWiki["id"]; - parentDocumentId?: IDocument["id"] | null; - title?: string; - templateId?: ITemplate["id"]; -}; -export declare type IUpdateDocumentDto = { - content: string; - state: Uint8Array; -} & Pick; -export declare type IShareDocumentDto = { - sharePassword?: string; -}; -export declare type IDocumentAuthorityDto = { - documentId: IDocument["id"]; - userName: IUser["name"]; - readable: boolean; - editable: boolean; -}; -export declare abstract class IDocumentService { - createLoading: boolean; - createError: any; - documentsDetail: Map; - getDocumentDetailLoading: boolean; - getDocumentDetailError: any; - updateDocumentLoading: boolean; - updateDocumentError: any; - deleteDocumentLoading: boolean; - deleteDocumentError: any; - documentsChildren: Map; - getDocumentChildrenLoading: boolean; - getDocumentChildrenError: any; - publicDocumentsChildren: Map; - getPublicDocumentChildrenLoading: boolean; - getPublicDocumentChildrenError: any; - shareLoading: boolean; - shareError: any; - documentsUsers: Map; - getDocumentUsersLoading: boolean; - getDocumentUsersError: any; - addDocumentUserLoading: boolean; - addDocumentUserError: any; - updateDocumentUserLoading: boolean; - updateDocumentUserError: any; - deleteDocumentUserLoading: boolean; - deleteDocumentUserError: any; - recentlyViewedDocuments: any[]; - getRecentlyViewedDocumentsLoading: boolean; - getRecentlyViewedDocumentsError: any; - publicDocumentsDetail: Map; - getPublicDocumentDetailLoading: boolean; - getPublicDocumentDetailError: any; - abstract createDocument(data: ICreateDocumentDto, user?: IUser): Promise; - abstract getDocumentDetail(id: IDocument["id"], user: IUser): Promise; - abstract updateDocument(id: IDocument["id"], data: IUpdateDocumentDto, user?: IUser): Promise; - abstract deleteDocument(id: IDocument["id"], user?: IUser): Promise; - abstract getDocumentChidren(wikiId: IWiki["id"], documentId: IDocument["id"], user?: IUser): Promise; - abstract shareDocument(id: IDocument["id"], data: IShareDocumentDto, user?: IUser): Promise; - abstract getDocumentUsers(id: IDocument["id"], user?: IUser): Promise>; - abstract addDocumentUser(data: IDocumentAuthorityDto, user?: IUser): Promise; - abstract updateDocumentUser(data: IDocumentAuthorityDto, user?: IUser): Promise; - abstract deleteDocumentUser(data: IDocumentAuthorityDto, user?: IUser): Promise; - abstract getRecentlyViewedDocuments(user?: IUser): Promise; - abstract getPublicDocumentDetail(id: IDocument["id"], data?: IShareDocumentDto, userAgent?: string): any; - abstract getPublicDocumentChildren(wikiId: IWiki["id"], documentId: IDocument["id"]): Promise; -} diff --git a/packages/domains/lib/services/IDocumentService.js b/packages/domains/lib/services/IDocumentService.js deleted file mode 100644 index 10b1dd39..00000000 --- a/packages/domains/lib/services/IDocumentService.js +++ /dev/null @@ -1,41 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.IDocumentService = void 0; -class IDocumentService { - constructor() { - this.createLoading = false; - this.createError = null; - this.documentsDetail = new Map(); - this.getDocumentDetailLoading = false; - this.getDocumentDetailError = null; - this.updateDocumentLoading = false; - this.updateDocumentError = null; - this.deleteDocumentLoading = false; - this.deleteDocumentError = null; - this.documentsChildren = new Map(); - this.getDocumentChildrenLoading = false; - this.getDocumentChildrenError = null; - this.publicDocumentsChildren = new Map(); - this.getPublicDocumentChildrenLoading = false; - this.getPublicDocumentChildrenError = null; - this.shareLoading = false; - this.shareError = null; - this.documentsUsers = new Map(); - this.getDocumentUsersLoading = false; - this.getDocumentUsersError = null; - this.addDocumentUserLoading = false; - this.addDocumentUserError = null; - this.updateDocumentUserLoading = false; - this.updateDocumentUserError = null; - this.deleteDocumentUserLoading = false; - this.deleteDocumentUserError = null; - this.recentlyViewedDocuments = []; - this.getRecentlyViewedDocumentsLoading = false; - this.getRecentlyViewedDocumentsError = null; - this.publicDocumentsDetail = new Map(); - this.getPublicDocumentDetailLoading = false; - this.getPublicDocumentDetailError = null; - } -} -exports.IDocumentService = IDocumentService; -//# sourceMappingURL=IDocumentService.js.map \ No newline at end of file diff --git a/packages/domains/lib/services/IDocumentService.js.map b/packages/domains/lib/services/IDocumentService.js.map deleted file mode 100644 index 62dd02f1..00000000 --- a/packages/domains/lib/services/IDocumentService.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"IDocumentService.js","sourceRoot":"","sources":["../../src/services/IDocumentService.ts"],"names":[],"mappings":";;;AA+DA,MAAsB,gBAAgB;IAAtC;QAIE,kBAAa,GAAG,KAAK,CAAC;QACtB,gBAAW,GAAG,IAAI,CAAC;QAKnB,oBAAe,GAAG,IAAI,GAAG,EAAE,CAAC;QAC5B,6BAAwB,GAAG,KAAK,CAAC;QACjC,2BAAsB,GAAG,IAAI,CAAC;QAK9B,0BAAqB,GAAG,KAAK,CAAC;QAC9B,wBAAmB,GAAG,IAAI,CAAC;QAK3B,0BAAqB,GAAG,KAAK,CAAC;QAC9B,wBAAmB,GAAG,IAAI,CAAC;QAK3B,sBAAiB,GAAG,IAAI,GAAG,EAAE,CAAC;QAC9B,+BAA0B,GAAG,KAAK,CAAC;QACnC,6BAAwB,GAAG,IAAI,CAAC;QAKhC,4BAAuB,GAAG,IAAI,GAAG,EAAE,CAAC;QACpC,qCAAgC,GAAG,KAAK,CAAC;QACzC,mCAA8B,GAAG,IAAI,CAAC;QAKtC,iBAAY,GAAG,KAAK,CAAC;QACrB,eAAU,GAAG,IAAI,CAAC;QAKlB,mBAAc,GAAG,IAAI,GAAG,EAAE,CAAC;QAC3B,4BAAuB,GAAG,KAAK,CAAC;QAChC,0BAAqB,GAAG,IAAI,CAAC;QAK7B,2BAAsB,GAAG,KAAK,CAAC;QAC/B,yBAAoB,GAAG,IAAI,CAAC;QAK5B,8BAAyB,GAAG,KAAK,CAAC;QAClC,4BAAuB,GAAG,IAAI,CAAC;QAK/B,8BAAyB,GAAG,KAAK,CAAC;QAClC,4BAAuB,GAAG,IAAI,CAAC;QAK/B,4BAAuB,GAAG,EAAE,CAAC;QAC7B,sCAAiC,GAAG,KAAK,CAAC;QAC1C,oCAA+B,GAAG,IAAI,CAAC;QAKvC,0BAAqB,GAAG,IAAI,GAAG,EAAE,CAAC;QAClC,mCAA8B,GAAG,KAAK,CAAC;QACvC,iCAA4B,GAAG,IAAI,CAAC;IAoItC,CAAC;CAAA;AAvND,4CAuNC"} \ No newline at end of file diff --git a/packages/domains/lib/services/IFileService.d.ts b/packages/domains/lib/services/IFileService.d.ts deleted file mode 100644 index 41d17d66..00000000 --- a/packages/domains/lib/services/IFileService.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export declare abstract class IFileService { - abstract uploadFile(file: any): Promise; -} diff --git a/packages/domains/lib/services/IFileService.js b/packages/domains/lib/services/IFileService.js deleted file mode 100644 index f3dfdc97..00000000 --- a/packages/domains/lib/services/IFileService.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.IFileService = void 0; -class IFileService { -} -exports.IFileService = IFileService; -//# sourceMappingURL=IFileService.js.map \ No newline at end of file diff --git a/packages/domains/lib/services/IFileService.js.map b/packages/domains/lib/services/IFileService.js.map deleted file mode 100644 index 69868cb9..00000000 --- a/packages/domains/lib/services/IFileService.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"IFileService.js","sourceRoot":"","sources":["../../src/services/IFileService.ts"],"names":[],"mappings":";;;AAAA,MAAsB,YAAY;CAMjC;AAND,oCAMC"} \ No newline at end of file diff --git a/packages/domains/lib/services/IMessageService.d.ts b/packages/domains/lib/services/IMessageService.d.ts deleted file mode 100644 index 7162600e..00000000 --- a/packages/domains/lib/services/IMessageService.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { IUser, IMessage, IPagination } from "../models"; -export declare abstract class IMessageService { - abstract getUnreadMessage(pagination: IPagination, user?: IUser): Promise<{ - data: IMessage[]; - total: number; - }>; - abstract getReadMessage(pagination: IPagination, user?: IUser): Promise<{ - data: IMessage[]; - total: number; - }>; - abstract getAllMessage(pagination: IPagination, user?: IUser): Promise<{ - data: IMessage[]; - total: number; - }>; - abstract readMessage(id: IMessage["id"], user?: IUser): Promise; -} diff --git a/packages/domains/lib/services/IMessageService.js b/packages/domains/lib/services/IMessageService.js deleted file mode 100644 index 67cd485f..00000000 --- a/packages/domains/lib/services/IMessageService.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.IMessageService = void 0; -class IMessageService { -} -exports.IMessageService = IMessageService; -//# sourceMappingURL=IMessageService.js.map \ No newline at end of file diff --git a/packages/domains/lib/services/IMessageService.js.map b/packages/domains/lib/services/IMessageService.js.map deleted file mode 100644 index 84646a2f..00000000 --- a/packages/domains/lib/services/IMessageService.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"IMessageService.js","sourceRoot":"","sources":["../../src/services/IMessageService.ts"],"names":[],"mappings":";;;AAEA,MAAsB,eAAe;CAqCpC;AArCD,0CAqCC"} \ No newline at end of file diff --git a/packages/domains/lib/services/IRequestService.d.ts b/packages/domains/lib/services/IRequestService.d.ts deleted file mode 100644 index e6969f6f..00000000 --- a/packages/domains/lib/services/IRequestService.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -export interface IResponse { - data: T | null; - msg: string | null; - statusCode: number; - success: boolean; -} -export declare abstract class IRequestService { - abstract get(url: string, config?: unknown): Promise; - abstract delete(url: string, config?: unknown): Promise; - abstract head(url: string, config?: unknown): Promise; - abstract options(url: string, config?: unknown): Promise; - abstract post(url: string, data?: unknown, config?: unknown): Promise; - abstract put(url: string, data?: unknown, config?: unknown): Promise; - abstract patch(url: string, data?: unknown, config?: unknown): Promise; -} diff --git a/packages/domains/lib/services/IRequestService.js b/packages/domains/lib/services/IRequestService.js deleted file mode 100644 index a9238220..00000000 --- a/packages/domains/lib/services/IRequestService.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.IRequestService = void 0; -class IRequestService { -} -exports.IRequestService = IRequestService; -//# sourceMappingURL=IRequestService.js.map \ No newline at end of file diff --git a/packages/domains/lib/services/IRequestService.js.map b/packages/domains/lib/services/IRequestService.js.map deleted file mode 100644 index ac2c5c5a..00000000 --- a/packages/domains/lib/services/IRequestService.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"IRequestService.js","sourceRoot":"","sources":["../../src/services/IRequestService.ts"],"names":[],"mappings":";;;AAOA,MAAsB,eAAe;CAQpC;AARD,0CAQC"} \ No newline at end of file diff --git a/packages/domains/lib/services/ITemplateService.d.ts b/packages/domains/lib/services/ITemplateService.d.ts deleted file mode 100644 index 0881e22a..00000000 --- a/packages/domains/lib/services/ITemplateService.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { IUser, ITemplate, IPagination } from "../models"; -export declare type ICreateTemplateDto = { - title: string; - content?: string; - state?: Uint8Array; - isPublic?: boolean; -}; -export declare abstract class ITemplateService { - abstract createTemplate(data: ICreateTemplateDto, user?: IUser): Promise; - abstract updateTemplate(id: ITemplate["id"], data: ICreateTemplateDto): Promise; - abstract deleteTemplate(id: ITemplate["id"], data: ICreateTemplateDto): Promise; - abstract getTemplateDetail(id: ITemplate["id"]): Promise; - abstract getPrivateTemplates(pagination: IPagination, user?: IUser): Promise<{ - data: ITemplate[]; - total: number; - }>; - abstract getPublicTemplates(pagination: IPagination): Promise<{ - data: ITemplate[]; - total: number; - }>; -} diff --git a/packages/domains/lib/services/ITemplateService.js b/packages/domains/lib/services/ITemplateService.js deleted file mode 100644 index 1db2669d..00000000 --- a/packages/domains/lib/services/ITemplateService.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ITemplateService = void 0; -class ITemplateService { -} -exports.ITemplateService = ITemplateService; -//# sourceMappingURL=ITemplateService.js.map \ No newline at end of file diff --git a/packages/domains/lib/services/ITemplateService.js.map b/packages/domains/lib/services/ITemplateService.js.map deleted file mode 100644 index 593709de..00000000 --- a/packages/domains/lib/services/ITemplateService.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ITemplateService.js","sourceRoot":"","sources":["../../src/services/ITemplateService.ts"],"names":[],"mappings":";;;AAwBA,MAAsB,gBAAgB;CAsDrC;AAtDD,4CAsDC"} \ No newline at end of file diff --git a/packages/domains/lib/services/IUserService.d.ts b/packages/domains/lib/services/IUserService.d.ts deleted file mode 100644 index 35b0c54c..00000000 --- a/packages/domains/lib/services/IUserService.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { IUser, ILoginUser } from "../models"; -export declare type ICreateUserDto = { - name: string; - password: string; - confirmPassword: string; - avatar?: string; - email?: string; -}; -export declare type ILoginUserDto = Pick; -export declare type IUpdateUserDto = Pick; -export declare abstract class IUserService { - user; - token; - registerLoading; - registerError; - loginLoading; - loginError; - updateLoading; - updateError; - abstract register(createUser: ICreateUserDto): Promise; - abstract login(loginUser: ILoginUserDto): Promise; - abstract updateUser(updateUser: IUpdateUserDto): Promise; - abstract logout(): void; - /** - * 将数据存储到浏览器 - */ - abstract storetDataInBrowser(): void; - - /** - * 从浏览器恢复数据 - */ - abstract syncDataInBrowser(): void; -} diff --git a/packages/domains/lib/services/IUserService.js b/packages/domains/lib/services/IUserService.js deleted file mode 100644 index 07c470b7..00000000 --- a/packages/domains/lib/services/IUserService.js +++ /dev/null @@ -1,17 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.IUserService = void 0; -class IUserService { - constructor() { - this.user = null; - this.token = null; - this.registerLoading = false; - this.registerError = null; - this.loginLoading = false; - this.loginError = null; - this.updateLoading = false; - this.updateError = null; - } -} -exports.IUserService = IUserService; -//# sourceMappingURL=IUserService.js.map \ No newline at end of file diff --git a/packages/domains/lib/services/IUserService.js.map b/packages/domains/lib/services/IUserService.js.map deleted file mode 100644 index d016437a..00000000 --- a/packages/domains/lib/services/IUserService.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"IUserService.js","sourceRoot":"","sources":["../../src/services/IUserService.ts"],"names":[],"mappings":";;;AAgCA,MAAsB,YAAY;IAAlC;QACU,SAAI,GAAsB,IAAI,CAAC;QAC/B,UAAK,GAAkB,IAAI,CAAC;QAC5B,oBAAe,GAAG,KAAK,CAAC;QACxB,kBAAa,GAAG,IAAI,CAAC;QACrB,iBAAY,GAAG,KAAK,CAAC;QACrB,eAAU,GAAG,IAAI,CAAC;QAClB,kBAAa,GAAG,KAAK,CAAC;QACtB,gBAAW,GAAG,IAAI,CAAC;IAmB7B,CAAC;CAAA;AA3BD,oCA2BC"} \ No newline at end of file diff --git a/packages/domains/lib/services/IWikiService.d.ts b/packages/domains/lib/services/IWikiService.d.ts deleted file mode 100644 index 5ffa4c12..00000000 --- a/packages/domains/lib/services/IWikiService.d.ts +++ /dev/null @@ -1,102 +0,0 @@ -import { IUser, IWiki, IWikiUser, WikiUserRole, WikiStatus, IDocument, IPagination } from "../models"; -export declare type ICreateWikiDto = { - name: string; - description: string; - cover: string; -}; -export declare type IUpdateWikiDto = Partial; -export declare type IWikiUserDto = { - userName: string; - userRole: WikiUserRole; -}; -export declare type IShareWikiDto = { - nextStatus: WikiStatus; - publicDocumentIds?: IDocument["id"][]; - privateDocumentIds?: IDocument["id"][]; -}; -export declare type IWikiTocRelation = { - id: IDocument["id"]; - parentDocumentId: IDocument["id"] | null; -}; -export declare abstract class IWikiService { - createLoading: boolean; - createError: any; - allWikis: any[]; - allWikisTotal: number; - getAllWikisLoading: boolean; - getAllWikisError: any; - joinWikis: any[]; - joinWikisTotal: number; - getJoinWikisLoading: boolean; - getJoinWikisError: any; - ownWikis: any[]; - ownWikisTotal: number; - getOwnWikisLoading: boolean; - getOwnWikisError: any; - wikisDetail: Map; - getWikiLoading: boolean; - getWikiError: any; - updateWikiLoading: boolean; - updateWikiError: any; - deleteWikiLoading: boolean; - deleteWikiError: any; - wikisHomeDocument: Map; - getWikisHomeDocumentLoading: boolean; - getWikisHomeDocumentError: any; - wikiUsers: Map; - getWikiUsersLoading: boolean; - getWikiUsersError: any; - addWikiUserLoading: boolean; - addWikiUserError: any; - updateWikiUserLoading: boolean; - updateWikiUserError: any; - deleteWikiUserLoading: boolean; - deleteWikiUserError: any; - wikisDocuments: Map; - getWikisDocumentsLoading: boolean; - getWikisDocumentsError: any; - wikisTocs: Map; - getWikisTocsLoading: boolean; - getWikisTocsError: any; - updateWikisTocsLoading: boolean; - updateWikisTocsError: any; - shareWikiLoading: boolean; - shareWikiError: any; - publicWikisHomeDocuments: Map; - getPublictWikisHomeDocumentLoading: boolean; - getPublicWikisHomeDocumentError: any; - publicWikisTocs: Map; - getPublicWikisTocsLoading: boolean; - getPublicWikisTocsError: any; - publicWikisDetail: Map; - getPublicWikiLoading: boolean; - getPublicWikiError: any; - abstract createWiki(data: ICreateWikiDto, user?: IUser): Promise; - abstract getUserAllWikis(pagination: IPagination, user?: IUser): Promise<{ - data: IWiki[]; - total: number; - }>; - abstract getUserOwnWikis(pagination: IPagination, user?: IUser): Promise<{ - data: IWiki[]; - total: number; - }>; - abstract getUserJoinWikis(pagination: IPagination, user?: IUser): Promise<{ - data: IWiki[]; - total: number; - }>; - abstract getWikiDetail(wikiId: IWiki["id"], user?: IUser): Promise; - abstract updateWiki(wikiId: IWiki["id"], data: IUpdateWikiDto, user?: IUser): Promise; - abstract deleteWiki(wikiId: IWiki["id"], user?: IUser): Promise; - abstract getWikiHomeDocument(wikiId: IWiki["id"], user?: IUser): Promise; - abstract getWikiUsers(wikiId: IWiki["id"], user?: IUser): Promise; - abstract addWikiUser(wikiId: IWiki["id"], data: IWikiUserDto, user?: IUser): Promise; - abstract updateWikiUser(wikiId: IWiki["id"], data: IWikiUserDto, user?: IUser): Promise; - abstract deleteWikiUser(wikiId: IWiki["id"], data: IWikiUserDto, user?: IUser): Promise; - abstract getWikiDocuments(wikiId: IWiki["id"], user?: IUser): Promise; - abstract getWikiTocs(wikiId: IWiki["id"], user?: IUser): Promise; - abstract updateWikiTocs(wikiId: IWiki["id"], relations: IWikiTocRelation[], user?: IUser): Promise; - abstract shareWiki(wikiId: IWiki["id"], data: IShareWikiDto, user?: IUser): Promise; - abstract getPublicWikiHomeDocument(wikiId: IWiki["id"]): Promise; - abstract getPublicWikiTocs(wikiId: IWiki["id"]): Promise; - abstract getPublicWikiDetail(wikiId: IWiki["id"]): Promise; -} diff --git a/packages/domains/lib/services/IWikiService.js b/packages/domains/lib/services/IWikiService.js deleted file mode 100644 index c6af2d11..00000000 --- a/packages/domains/lib/services/IWikiService.js +++ /dev/null @@ -1,61 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.IWikiService = void 0; -class IWikiService { - constructor() { - this.createLoading = false; - this.createError = null; - this.allWikis = []; - this.allWikisTotal = 0; - this.getAllWikisLoading = false; - this.getAllWikisError = null; - this.joinWikis = []; - this.joinWikisTotal = 0; - this.getJoinWikisLoading = false; - this.getJoinWikisError = null; - this.ownWikis = []; - this.ownWikisTotal = 0; - this.getOwnWikisLoading = false; - this.getOwnWikisError = null; - this.wikisDetail = new Map(); - this.getWikiLoading = false; - this.getWikiError = null; - this.updateWikiLoading = false; - this.updateWikiError = null; - this.deleteWikiLoading = false; - this.deleteWikiError = null; - this.wikisHomeDocument = new Map(); - this.getWikisHomeDocumentLoading = false; - this.getWikisHomeDocumentError = null; - this.wikiUsers = new Map(); - this.getWikiUsersLoading = false; - this.getWikiUsersError = null; - this.addWikiUserLoading = false; - this.addWikiUserError = null; - this.updateWikiUserLoading = false; - this.updateWikiUserError = null; - this.deleteWikiUserLoading = false; - this.deleteWikiUserError = null; - this.wikisDocuments = new Map(); - this.getWikisDocumentsLoading = false; - this.getWikisDocumentsError = null; - this.wikisTocs = new Map(); - this.getWikisTocsLoading = false; - this.getWikisTocsError = null; - this.updateWikisTocsLoading = false; - this.updateWikisTocsError = null; - this.shareWikiLoading = false; - this.shareWikiError = null; - this.publicWikisHomeDocuments = new Map(); - this.getPublictWikisHomeDocumentLoading = false; - this.getPublicWikisHomeDocumentError = null; - this.publicWikisTocs = new Map(); - this.getPublicWikisTocsLoading = false; - this.getPublicWikisTocsError = null; - this.publicWikisDetail = new Map(); - this.getPublicWikiLoading = false; - this.getPublicWikiError = null; - } -} -exports.IWikiService = IWikiService; -//# sourceMappingURL=IWikiService.js.map \ No newline at end of file diff --git a/packages/domains/lib/services/IWikiService.js.map b/packages/domains/lib/services/IWikiService.js.map deleted file mode 100644 index edde8d40..00000000 --- a/packages/domains/lib/services/IWikiService.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"IWikiService.js","sourceRoot":"","sources":["../../src/services/IWikiService.ts"],"names":[],"mappings":";;;AAsEA,MAAsB,YAAY;IAAlC;QAIE,kBAAa,GAAG,KAAK,CAAC;QACtB,gBAAW,GAAG,IAAI,CAAC;QAKnB,aAAQ,GAAG,EAAE,CAAC;QACd,kBAAa,GAAG,CAAC,CAAC;QAClB,uBAAkB,GAAG,KAAK,CAAC;QAC3B,qBAAgB,GAAG,IAAI,CAAC;QAKxB,cAAS,GAAG,EAAE,CAAC;QACf,mBAAc,GAAG,CAAC,CAAC;QACnB,wBAAmB,GAAG,KAAK,CAAC;QAC5B,sBAAiB,GAAG,IAAI,CAAC;QAKzB,aAAQ,GAAG,EAAE,CAAC;QACd,kBAAa,GAAG,CAAC,CAAC;QAClB,uBAAkB,GAAG,KAAK,CAAC;QAC3B,qBAAgB,GAAG,IAAI,CAAC;QAKxB,gBAAW,GAAG,IAAI,GAAG,EAAE,CAAC;QACxB,mBAAc,GAAG,KAAK,CAAC;QACvB,iBAAY,GAAG,IAAI,CAAC;QAKpB,sBAAiB,GAAG,KAAK,CAAC;QAC1B,oBAAe,GAAG,IAAI,CAAC;QAKvB,sBAAiB,GAAG,KAAK,CAAC;QAC1B,oBAAe,GAAG,IAAI,CAAC;QAKvB,sBAAiB,GAAG,IAAI,GAAG,EAAE,CAAC;QAC9B,gCAA2B,GAAG,KAAK,CAAC;QACpC,8BAAyB,GAAG,IAAI,CAAC;QAKjC,cAAS,GAAG,IAAI,GAAG,EAAE,CAAC;QACtB,wBAAmB,GAAG,KAAK,CAAC;QAC5B,sBAAiB,GAAG,IAAI,CAAC;QAKzB,uBAAkB,GAAG,KAAK,CAAC;QAC3B,qBAAgB,GAAG,IAAI,CAAC;QAKxB,0BAAqB,GAAG,KAAK,CAAC;QAC9B,wBAAmB,GAAG,IAAI,CAAC;QAK3B,0BAAqB,GAAG,KAAK,CAAC;QAC9B,wBAAmB,GAAG,IAAI,CAAC;QAK3B,mBAAc,GAAG,IAAI,GAAG,EAAE,CAAC;QAC3B,6BAAwB,GAAG,KAAK,CAAC;QACjC,2BAAsB,GAAG,IAAI,CAAC;QAK9B,cAAS,GAAG,IAAI,GAAG,EAAE,CAAC;QACtB,wBAAmB,GAAG,KAAK,CAAC;QAC5B,sBAAiB,GAAG,IAAI,CAAC;QACzB,2BAAsB,GAAG,KAAK,CAAC;QAC/B,yBAAoB,GAAG,IAAI,CAAC;QAK5B,qBAAgB,GAAG,KAAK,CAAC;QACzB,mBAAc,GAAG,IAAI,CAAC;QAKtB,6BAAwB,GAAG,IAAI,GAAG,EAAE,CAAC;QACrC,uCAAkC,GAAG,KAAK,CAAC;QAC3C,oCAA+B,GAAG,IAAI,CAAC;QAKvC,oBAAe,GAAG,IAAI,GAAG,EAAE,CAAC;QAC5B,8BAAyB,GAAG,KAAK,CAAC;QAClC,4BAAuB,GAAG,IAAI,CAAC;QAK/B,sBAAiB,GAAG,IAAI,GAAG,EAAE,CAAC;QAC9B,yBAAoB,GAAG,KAAK,CAAC;QAC7B,uBAAkB,GAAG,IAAI,CAAC;IA4L5B,CAAC;CAAA;AAvTD,oCAuTC"} \ No newline at end of file diff --git a/packages/domains/lib/services/index.d.ts b/packages/domains/lib/services/index.d.ts deleted file mode 100644 index 8c7366be..00000000 --- a/packages/domains/lib/services/index.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export * from "./IRequestService"; -export * from "./ICollectorService"; -export * from "./ICommentService"; -export * from "./IDocumentService"; -export * from "./IFileService"; -export * from "./IMessageService"; -export * from "./ITemplateService"; -export * from "./IUserService"; -export * from "./IWikiService"; diff --git a/packages/domains/lib/services/index.js b/packages/domains/lib/services/index.js deleted file mode 100644 index 927264cf..00000000 --- a/packages/domains/lib/services/index.js +++ /dev/null @@ -1,22 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __exportStar = (this && this.__exportStar) || function(m, exports) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -__exportStar(require("./IRequestService"), exports); -__exportStar(require("./ICollectorService"), exports); -__exportStar(require("./ICommentService"), exports); -__exportStar(require("./IDocumentService"), exports); -__exportStar(require("./IFileService"), exports); -__exportStar(require("./IMessageService"), exports); -__exportStar(require("./ITemplateService"), exports); -__exportStar(require("./IUserService"), exports); -__exportStar(require("./IWikiService"), exports); -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/packages/domains/lib/services/index.js.map b/packages/domains/lib/services/index.js.map deleted file mode 100644 index 039dc5cb..00000000 --- a/packages/domains/lib/services/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAkC;AAClC,sDAAoC;AACpC,oDAAkC;AAClC,qDAAmC;AACnC,iDAA+B;AAC/B,oDAAkC;AAClC,qDAAmC;AACnC,iDAA+B;AAC/B,iDAA+B"} \ No newline at end of file diff --git a/packages/domains/lib/util.d.ts b/packages/domains/lib/util.d.ts index ddd39fc5..b201622e 100644 --- a/packages/domains/lib/util.d.ts +++ b/packages/domains/lib/util.d.ts @@ -1,17 +1,46 @@ import { WikiStatus, WikiUserRole, DocumentStatus, IWiki, IDocument } from './models'; +/** + * 知识库状态列表数据 + */ export declare const WIKI_STATUS_LIST: { value: WikiStatus; label: string; }[]; +/** + * 知识库成员角色列表数据 + */ export declare const WIKI_USER_ROLES: { value: string; label: string; }[]; +/** + * 文档状态列表数据 + */ export declare const DOCUMENT_STATUS: { value: DocumentStatus; label: string; }[]; +/** + * 获取知识库状态对应文本 + * @param wiki 实例数据 + * @returns + */ export declare const getWikiStatusText: (wiki: IWiki) => string; +/** + * 检查知识库是否公开 + * @param currentStatus wiki 实例数据的 status 字段 + * @returns + */ export declare const isPublicWiki: (currentStatus: IWiki['status']) => boolean; +/** + * 获取知识库成员角色对应文本 + * @param role 实例数据的 role 字段 + * @returns + */ export declare const getWikiUserRoleText: (role: WikiUserRole) => string; +/** + * 检查文档是否公开 + * @param currentStatus document 实例数据的 status 字段 + * @returns + */ export declare const isPublicDocument: (currentStatus: IDocument['status']) => boolean; diff --git a/packages/domains/lib/util.js b/packages/domains/lib/util.js index ca51ea6b..ae37f8a6 100644 --- a/packages/domains/lib/util.js +++ b/packages/domains/lib/util.js @@ -1,47 +1,75 @@ "use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); +exports.__esModule = true; exports.isPublicDocument = exports.getWikiUserRoleText = exports.isPublicWiki = exports.getWikiStatusText = exports.DOCUMENT_STATUS = exports.WIKI_USER_ROLES = exports.WIKI_STATUS_LIST = void 0; -const models_1 = require("./models"); +var models_1 = require("./models"); +/** + * 知识库状态列表数据 + */ exports.WIKI_STATUS_LIST = [ { value: models_1.WikiStatus.private, - label: '私有', + label: '私有' }, { value: models_1.WikiStatus.public, - label: '公开', + label: '公开' }, ]; +/** + * 知识库成员角色列表数据 + */ exports.WIKI_USER_ROLES = [ { value: 'admin', - label: '管理员', + label: '管理员' }, { value: 'normal', - label: '成员', + label: '成员' }, ]; +/** + * 文档状态列表数据 + */ exports.DOCUMENT_STATUS = [ { value: models_1.DocumentStatus.private, - label: '私有', + label: '私有' }, { value: models_1.DocumentStatus.public, - label: '公开', + label: '公开' }, ]; -const getWikiStatusText = (wiki) => { - return exports.WIKI_STATUS_LIST.find((t) => t.value === wiki.status).label; +/** + * 获取知识库状态对应文本 + * @param wiki 实例数据 + * @returns + */ +var getWikiStatusText = function (wiki) { + return exports.WIKI_STATUS_LIST.find(function (t) { return t.value === wiki.status; }).label; }; exports.getWikiStatusText = getWikiStatusText; -const isPublicWiki = (currentStatus) => currentStatus === models_1.WikiStatus.public; +/** + * 检查知识库是否公开 + * @param currentStatus wiki 实例数据的 status 字段 + * @returns + */ +var isPublicWiki = function (currentStatus) { return currentStatus === models_1.WikiStatus.public; }; exports.isPublicWiki = isPublicWiki; -const getWikiUserRoleText = (role) => { - return exports.WIKI_USER_ROLES.find((d) => d.value === role).label; +/** + * 获取知识库成员角色对应文本 + * @param role 实例数据的 role 字段 + * @returns + */ +var getWikiUserRoleText = function (role) { + return exports.WIKI_USER_ROLES.find(function (d) { return d.value === role; }).label; }; exports.getWikiUserRoleText = getWikiUserRoleText; -const isPublicDocument = (currentStatus) => currentStatus === models_1.DocumentStatus.public; +/** + * 检查文档是否公开 + * @param currentStatus document 实例数据的 status 字段 + * @returns + */ +var isPublicDocument = function (currentStatus) { return currentStatus === models_1.DocumentStatus.public; }; exports.isPublicDocument = isPublicDocument; -//# sourceMappingURL=util.js.map \ No newline at end of file diff --git a/packages/domains/lib/util.js.map b/packages/domains/lib/util.js.map deleted file mode 100644 index ad3334f1..00000000 --- a/packages/domains/lib/util.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";;;AAAA,qCAAsF;AAKzE,QAAA,gBAAgB,GAAG;IAC9B;QACE,KAAK,EAAE,mBAAU,CAAC,OAAO;QACzB,KAAK,EAAE,IAAI;KACZ;IACD;QACE,KAAK,EAAE,mBAAU,CAAC,MAAM;QACxB,KAAK,EAAE,IAAI;KACZ;CACF,CAAC;AAKW,QAAA,eAAe,GAAG;IAC7B;QACE,KAAK,EAAE,OAAO;QACd,KAAK,EAAE,KAAK;KACb;IACD;QACE,KAAK,EAAE,QAAQ;QACf,KAAK,EAAE,IAAI;KACZ;CACF,CAAC;AAKW,QAAA,eAAe,GAAG;IAC7B;QACE,KAAK,EAAE,uBAAc,CAAC,OAAO;QAC7B,KAAK,EAAE,IAAI;KACZ;IACD;QACE,KAAK,EAAE,uBAAc,CAAC,MAAM;QAC5B,KAAK,EAAE,IAAI;KACZ;CACF,CAAC;AAOK,MAAM,iBAAiB,GAAG,CAAC,IAAW,EAAU,EAAE;IACvD,OAAO,wBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC;AACrE,CAAC,CAAC;AAFW,QAAA,iBAAiB,qBAE5B;AAOK,MAAM,YAAY,GAAG,CAAC,aAA8B,EAAE,EAAE,CAAC,aAAa,KAAK,mBAAU,CAAC,MAAM,CAAC;AAAvF,QAAA,YAAY,gBAA2E;AAO7F,MAAM,mBAAmB,GAAG,CAAC,IAAkB,EAAE,EAAE;IACxD,OAAO,uBAAe,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,KAAK,CAAC;AAC7D,CAAC,CAAC;AAFW,QAAA,mBAAmB,uBAE9B;AAOK,MAAM,gBAAgB,GAAG,CAAC,aAAkC,EAAE,EAAE,CAAC,aAAa,KAAK,uBAAc,CAAC,MAAM,CAAC;AAAnG,QAAA,gBAAgB,oBAAmF"} \ No newline at end of file diff --git a/packages/domains/package.json b/packages/domains/package.json index abba4a0d..b1e2c784 100644 --- a/packages/domains/package.json +++ b/packages/domains/package.json @@ -12,10 +12,13 @@ "sideEffects": false, "license": "MIT", "scripts": { - "build": "tsc --declaration" + "build": "tsc src/*.ts --outDir lib --skipLibCheck --declaration" }, - "files": ["lib", "src"], + "files": [ + "lib", + "src" + ], "devDependencies": { "typescript": "^4.5.5" } -} +} \ No newline at end of file diff --git a/packages/domains/tsconfig.json b/packages/domains/tsconfig.json deleted file mode 100644 index be9056be..00000000 --- a/packages/domains/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "declaration": true, - "removeComments": true, - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "allowSyntheticDefaultImports": true, - "target": "ES2017", - "sourceMap": true, - "incremental": true, - "rootDir": "src", - "outDir": "lib" - }, - "include": ["src"], - "exclude": ["src/**/*.spec.ts"] -}