mirror of https://github.com/fantasticit/think.git
root: fix build:dep
This commit is contained in:
parent
232c2bb6fd
commit
21262a426c
|
@ -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",
|
||||
|
|
|
@ -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
|
|
@ -12,9 +12,13 @@
|
|||
"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"
|
||||
}
|
||||
|
|
|
@ -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"]
|
||||
}
|
|
@ -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
|
|
@ -12,9 +12,12 @@
|
|||
"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"
|
||||
}
|
||||
|
|
|
@ -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"]
|
||||
}
|
|
@ -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
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAyB;AACzB,yCAAuB"}
|
|
@ -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
|
|
@ -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"}
|
|
@ -1,5 +1,8 @@
|
|||
import { IUser } from './user';
|
||||
import { IDocument } from './document';
|
||||
/**
|
||||
* 评论
|
||||
*/
|
||||
export interface IComment {
|
||||
id: string;
|
||||
parentCommentId?: IComment['id'];
|
||||
|
|
|
@ -1,3 +1,2 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=comment.js.map
|
||||
exports.__esModule = true;
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"comment.js","sourceRoot":"","sources":["../../src/models/comment.ts"],"names":[],"mappings":""}
|
|
@ -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'];
|
||||
|
|
|
@ -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
|
|
@ -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"}
|
|
@ -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
|
|
@ -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"}
|
|
@ -1,4 +1,7 @@
|
|||
import { IUser } from './user';
|
||||
/**
|
||||
* 消息数据定义
|
||||
*/
|
||||
export interface IMessage {
|
||||
id: string;
|
||||
userId: IUser['id'];
|
||||
|
|
|
@ -1,3 +1,2 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=message.js.map
|
||||
exports.__esModule = true;
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"message.js","sourceRoot":"","sources":["../../src/models/message.ts"],"names":[],"mappings":""}
|
|
@ -1,3 +1,2 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=pagination.js.map
|
||||
exports.__esModule = true;
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../../src/models/pagination.ts"],"names":[],"mappings":""}
|
|
@ -1,4 +1,7 @@
|
|||
import { IUser } from './user';
|
||||
/**
|
||||
* 文档模板数据定义
|
||||
*/
|
||||
export interface ITemplate {
|
||||
id: string;
|
||||
createUserId: IUser['id'];
|
||||
|
|
|
@ -1,3 +1,2 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=template.js.map
|
||||
exports.__esModule = true;
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../src/models/template.ts"],"names":[],"mappings":""}
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
|
@ -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"}
|
|
@ -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;
|
||||
|
|
|
@ -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
|
|
@ -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"}
|
|
@ -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<void>;
|
||||
abstract checkCollect(data: ICollectDto): Promise<boolean>;
|
||||
abstract getCollectWikis(user?: IUser): Promise<IWiki[]>;
|
||||
abstract getCollectDocuments(user?: IUser): Promise<IDocument[]>;
|
||||
}
|
|
@ -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
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"ICollectorService.js","sourceRoot":"","sources":["../../src/services/ICollectorService.ts"],"names":[],"mappings":";;;AAcA,MAAsB,iBAAiB;CAyBtC;AAzBD,8CAyBC"}
|
|
@ -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<IComment>;
|
||||
abstract updateComment(data: IUpdateCommentDto, user?: IUser): Promise<IComment>;
|
||||
abstract deleteComment(id: IComment["id"], user?: IUser): Promise<void>;
|
||||
abstract getDocumentComments(documentId: IDocument["id"], pagination: IPagination): Promise<IComment[]>;
|
||||
}
|
|
@ -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
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"ICommentService.js","sourceRoot":"","sources":["../../src/services/ICommentService.ts"],"names":[],"mappings":";;;AAkCA,MAAsB,eAAe;CAuCpC;AAvCD,0CAuCC"}
|
|
@ -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<ICreateDocumentDto, "title">;
|
||||
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<any, any>;
|
||||
getDocumentDetailLoading: boolean;
|
||||
getDocumentDetailError: any;
|
||||
updateDocumentLoading: boolean;
|
||||
updateDocumentError: any;
|
||||
deleteDocumentLoading: boolean;
|
||||
deleteDocumentError: any;
|
||||
documentsChildren: Map<any, any>;
|
||||
getDocumentChildrenLoading: boolean;
|
||||
getDocumentChildrenError: any;
|
||||
publicDocumentsChildren: Map<any, any>;
|
||||
getPublicDocumentChildrenLoading: boolean;
|
||||
getPublicDocumentChildrenError: any;
|
||||
shareLoading: boolean;
|
||||
shareError: any;
|
||||
documentsUsers: Map<any, any>;
|
||||
getDocumentUsersLoading: boolean;
|
||||
getDocumentUsersError: any;
|
||||
addDocumentUserLoading: boolean;
|
||||
addDocumentUserError: any;
|
||||
updateDocumentUserLoading: boolean;
|
||||
updateDocumentUserError: any;
|
||||
deleteDocumentUserLoading: boolean;
|
||||
deleteDocumentUserError: any;
|
||||
recentlyViewedDocuments: any[];
|
||||
getRecentlyViewedDocumentsLoading: boolean;
|
||||
getRecentlyViewedDocumentsError: any;
|
||||
publicDocumentsDetail: Map<any, any>;
|
||||
getPublicDocumentDetailLoading: boolean;
|
||||
getPublicDocumentDetailError: any;
|
||||
abstract createDocument(data: ICreateDocumentDto, user?: IUser): Promise<IDocument>;
|
||||
abstract getDocumentDetail(id: IDocument["id"], user: IUser): Promise<IDocument>;
|
||||
abstract updateDocument(id: IDocument["id"], data: IUpdateDocumentDto, user?: IUser): Promise<IDocument>;
|
||||
abstract deleteDocument(id: IDocument["id"], user?: IUser): Promise<void>;
|
||||
abstract getDocumentChidren(wikiId: IWiki["id"], documentId: IDocument["id"], user?: IUser): Promise<IDocument[]>;
|
||||
abstract shareDocument(id: IDocument["id"], data: IShareDocumentDto, user?: IUser): Promise<IDocument>;
|
||||
abstract getDocumentUsers(id: IDocument["id"], user?: IUser): Promise<Array<{
|
||||
user: IUser;
|
||||
authority: IAuthority;
|
||||
}>>;
|
||||
abstract addDocumentUser(data: IDocumentAuthorityDto, user?: IUser): Promise<IAuthority>;
|
||||
abstract updateDocumentUser(data: IDocumentAuthorityDto, user?: IUser): Promise<IAuthority>;
|
||||
abstract deleteDocumentUser(data: IDocumentAuthorityDto, user?: IUser): Promise<void>;
|
||||
abstract getRecentlyViewedDocuments(user?: IUser): Promise<IDocument[]>;
|
||||
abstract getPublicDocumentDetail(id: IDocument["id"], data?: IShareDocumentDto, userAgent?: string): any;
|
||||
abstract getPublicDocumentChildren(wikiId: IWiki["id"], documentId: IDocument["id"]): Promise<IDocument[]>;
|
||||
}
|
|
@ -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
|
|
@ -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"}
|
|
@ -1,3 +0,0 @@
|
|||
export declare abstract class IFileService {
|
||||
abstract uploadFile(file: any): Promise<string>;
|
||||
}
|
|
@ -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
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"IFileService.js","sourceRoot":"","sources":["../../src/services/IFileService.ts"],"names":[],"mappings":";;;AAAA,MAAsB,YAAY;CAMjC;AAND,oCAMC"}
|
|
@ -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<void>;
|
||||
}
|
|
@ -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
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"IMessageService.js","sourceRoot":"","sources":["../../src/services/IMessageService.ts"],"names":[],"mappings":";;;AAEA,MAAsB,eAAe;CAqCpC;AArCD,0CAqCC"}
|
|
@ -1,15 +0,0 @@
|
|||
export interface IResponse<T> {
|
||||
data: T | null;
|
||||
msg: string | null;
|
||||
statusCode: number;
|
||||
success: boolean;
|
||||
}
|
||||
export declare abstract class IRequestService {
|
||||
abstract get<R>(url: string, config?: unknown): Promise<R>;
|
||||
abstract delete<R>(url: string, config?: unknown): Promise<R>;
|
||||
abstract head<R>(url: string, config?: unknown): Promise<R>;
|
||||
abstract options<R>(url: string, config?: unknown): Promise<R>;
|
||||
abstract post<R>(url: string, data?: unknown, config?: unknown): Promise<R>;
|
||||
abstract put<R>(url: string, data?: unknown, config?: unknown): Promise<R>;
|
||||
abstract patch<R>(url: string, data?: unknown, config?: unknown): Promise<R>;
|
||||
}
|
|
@ -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
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"IRequestService.js","sourceRoot":"","sources":["../../src/services/IRequestService.ts"],"names":[],"mappings":";;;AAOA,MAAsB,eAAe;CAQpC;AARD,0CAQC"}
|
|
@ -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<ITemplate>;
|
||||
abstract updateTemplate(id: ITemplate["id"], data: ICreateTemplateDto): Promise<ITemplate>;
|
||||
abstract deleteTemplate(id: ITemplate["id"], data: ICreateTemplateDto): Promise<void>;
|
||||
abstract getTemplateDetail(id: ITemplate["id"]): Promise<ITemplate>;
|
||||
abstract getPrivateTemplates(pagination: IPagination, user?: IUser): Promise<{
|
||||
data: ITemplate[];
|
||||
total: number;
|
||||
}>;
|
||||
abstract getPublicTemplates(pagination: IPagination): Promise<{
|
||||
data: ITemplate[];
|
||||
total: number;
|
||||
}>;
|
||||
}
|
|
@ -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
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"ITemplateService.js","sourceRoot":"","sources":["../../src/services/ITemplateService.ts"],"names":[],"mappings":";;;AAwBA,MAAsB,gBAAgB;CAsDrC;AAtDD,4CAsDC"}
|
|
@ -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<ICreateUserDto, "name" | "password">;
|
||||
export declare type IUpdateUserDto = Pick<ICreateUserDto, "avatar" | "email">;
|
||||
export declare abstract class IUserService {
|
||||
user;
|
||||
token;
|
||||
registerLoading;
|
||||
registerError;
|
||||
loginLoading;
|
||||
loginError;
|
||||
updateLoading;
|
||||
updateError;
|
||||
abstract register(createUser: ICreateUserDto): Promise<IUser>;
|
||||
abstract login(loginUser: ILoginUserDto): Promise<ILoginUser>;
|
||||
abstract updateUser(updateUser: IUpdateUserDto): Promise<IUser>;
|
||||
abstract logout(): void;
|
||||
/**
|
||||
* 将数据存储到浏览器
|
||||
*/
|
||||
abstract storetDataInBrowser(): void;
|
||||
|
||||
/**
|
||||
* 从浏览器恢复数据
|
||||
*/
|
||||
abstract syncDataInBrowser(): void;
|
||||
}
|
|
@ -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
|
|
@ -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"}
|
|
@ -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<ICreateWikiDto>;
|
||||
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<any, any>;
|
||||
getWikiLoading: boolean;
|
||||
getWikiError: any;
|
||||
updateWikiLoading: boolean;
|
||||
updateWikiError: any;
|
||||
deleteWikiLoading: boolean;
|
||||
deleteWikiError: any;
|
||||
wikisHomeDocument: Map<any, any>;
|
||||
getWikisHomeDocumentLoading: boolean;
|
||||
getWikisHomeDocumentError: any;
|
||||
wikiUsers: Map<any, any>;
|
||||
getWikiUsersLoading: boolean;
|
||||
getWikiUsersError: any;
|
||||
addWikiUserLoading: boolean;
|
||||
addWikiUserError: any;
|
||||
updateWikiUserLoading: boolean;
|
||||
updateWikiUserError: any;
|
||||
deleteWikiUserLoading: boolean;
|
||||
deleteWikiUserError: any;
|
||||
wikisDocuments: Map<any, any>;
|
||||
getWikisDocumentsLoading: boolean;
|
||||
getWikisDocumentsError: any;
|
||||
wikisTocs: Map<any, any>;
|
||||
getWikisTocsLoading: boolean;
|
||||
getWikisTocsError: any;
|
||||
updateWikisTocsLoading: boolean;
|
||||
updateWikisTocsError: any;
|
||||
shareWikiLoading: boolean;
|
||||
shareWikiError: any;
|
||||
publicWikisHomeDocuments: Map<any, any>;
|
||||
getPublictWikisHomeDocumentLoading: boolean;
|
||||
getPublicWikisHomeDocumentError: any;
|
||||
publicWikisTocs: Map<any, any>;
|
||||
getPublicWikisTocsLoading: boolean;
|
||||
getPublicWikisTocsError: any;
|
||||
publicWikisDetail: Map<any, any>;
|
||||
getPublicWikiLoading: boolean;
|
||||
getPublicWikiError: any;
|
||||
abstract createWiki(data: ICreateWikiDto, user?: IUser): Promise<IWiki>;
|
||||
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<IWiki>;
|
||||
abstract updateWiki(wikiId: IWiki["id"], data: IUpdateWikiDto, user?: IUser): Promise<IWiki>;
|
||||
abstract deleteWiki(wikiId: IWiki["id"], user?: IUser): Promise<void>;
|
||||
abstract getWikiHomeDocument(wikiId: IWiki["id"], user?: IUser): Promise<IDocument>;
|
||||
abstract getWikiUsers(wikiId: IWiki["id"], user?: IUser): Promise<IWikiUser[]>;
|
||||
abstract addWikiUser(wikiId: IWiki["id"], data: IWikiUserDto, user?: IUser): Promise<IWikiUser>;
|
||||
abstract updateWikiUser(wikiId: IWiki["id"], data: IWikiUserDto, user?: IUser): Promise<IWikiUser>;
|
||||
abstract deleteWikiUser(wikiId: IWiki["id"], data: IWikiUserDto, user?: IUser): Promise<void>;
|
||||
abstract getWikiDocuments(wikiId: IWiki["id"], user?: IUser): Promise<IDocument[]>;
|
||||
abstract getWikiTocs(wikiId: IWiki["id"], user?: IUser): Promise<IDocument[]>;
|
||||
abstract updateWikiTocs(wikiId: IWiki["id"], relations: IWikiTocRelation[], user?: IUser): Promise<IDocument[]>;
|
||||
abstract shareWiki(wikiId: IWiki["id"], data: IShareWikiDto, user?: IUser): Promise<IWiki>;
|
||||
abstract getPublicWikiHomeDocument(wikiId: IWiki["id"]): Promise<IDocument>;
|
||||
abstract getPublicWikiTocs(wikiId: IWiki["id"]): Promise<IDocument[]>;
|
||||
abstract getPublicWikiDetail(wikiId: IWiki["id"]): Promise<IWiki>;
|
||||
}
|
|
@ -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
|
|
@ -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"}
|
|
@ -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";
|
|
@ -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
|
|
@ -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"}
|
|
@ -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;
|
||||
|
|
|
@ -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
|
|
@ -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"}
|
|
@ -12,9 +12,12 @@
|
|||
"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"
|
||||
}
|
||||
|
|
|
@ -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"]
|
||||
}
|
Loading…
Reference in New Issue