@builder6/sharepoint 0.11.3 → 0.11.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/sharepoint/sharepoint.controller.d.ts +37 -0
- package/dist/sharepoint/sharepoint.controller.js +159 -1
- package/dist/sharepoint/sharepoint.controller.js.map +1 -1
- package/dist/sharepoint/sharepoint.module.js +6 -2
- package/dist/sharepoint/sharepoint.module.js.map +1 -1
- package/dist/sharepoint/sharepoint.moleculer.d.ts +24 -0
- package/dist/sharepoint/sharepoint.moleculer.js +93 -0
- package/dist/sharepoint/sharepoint.moleculer.js.map +1 -0
- package/dist/sharepoint/sharepoint.service.d.ts +31 -0
- package/dist/sharepoint/sharepoint.service.js +206 -3
- package/dist/sharepoint/sharepoint.service.js.map +1 -1
- package/package.json +6 -4
|
@@ -1,2 +1,39 @@
|
|
|
1
|
+
import { SharepointService } from './sharepoint.service';
|
|
1
2
|
export declare class SharepointController {
|
|
3
|
+
private sharepointService;
|
|
4
|
+
constructor(sharepointService: SharepointService);
|
|
5
|
+
word2Xml(fileId: string): Promise<{
|
|
6
|
+
fileId: string;
|
|
7
|
+
error?: undefined;
|
|
8
|
+
} | {
|
|
9
|
+
error: {
|
|
10
|
+
code: number;
|
|
11
|
+
message: any;
|
|
12
|
+
};
|
|
13
|
+
fileId?: undefined;
|
|
14
|
+
}>;
|
|
15
|
+
xmlWriteComments(fileId: string, comments: Array<{
|
|
16
|
+
xml_start: number;
|
|
17
|
+
xml_end: number;
|
|
18
|
+
check_result: object;
|
|
19
|
+
}>): Promise<{
|
|
20
|
+
fileId: string;
|
|
21
|
+
error?: undefined;
|
|
22
|
+
} | {
|
|
23
|
+
error: {
|
|
24
|
+
code: number;
|
|
25
|
+
message: any;
|
|
26
|
+
};
|
|
27
|
+
fileId?: undefined;
|
|
28
|
+
}>;
|
|
29
|
+
xml2Word(fileId: string): Promise<{
|
|
30
|
+
fileId: string;
|
|
31
|
+
error?: undefined;
|
|
32
|
+
} | {
|
|
33
|
+
error: {
|
|
34
|
+
code: number;
|
|
35
|
+
message: any;
|
|
36
|
+
};
|
|
37
|
+
fileId?: undefined;
|
|
38
|
+
}>;
|
|
2
39
|
}
|
|
@@ -5,13 +5,171 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
8
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
15
|
exports.SharepointController = void 0;
|
|
10
16
|
const common_1 = require("@nestjs/common");
|
|
17
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
18
|
+
const core_1 = require("@builder6/core");
|
|
19
|
+
const sharepoint_service_1 = require("./sharepoint.service");
|
|
11
20
|
let SharepointController = class SharepointController {
|
|
21
|
+
constructor(sharepointService) {
|
|
22
|
+
this.sharepointService = sharepointService;
|
|
23
|
+
}
|
|
24
|
+
async word2Xml(fileId) {
|
|
25
|
+
try {
|
|
26
|
+
const xmlFileId = await this.sharepointService.word2Xml(fileId);
|
|
27
|
+
return { fileId: xmlFileId };
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
console.error(`word2Xml error: ${error}`);
|
|
31
|
+
return {
|
|
32
|
+
error: {
|
|
33
|
+
code: 500,
|
|
34
|
+
message: error.message,
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
async xmlWriteComments(fileId, comments) {
|
|
40
|
+
try {
|
|
41
|
+
const xmlFileId = await this.sharepointService.xmlWriteComments(fileId, comments);
|
|
42
|
+
return { fileId: xmlFileId };
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
console.error(`xmlWriteComments error: ${error}`);
|
|
46
|
+
return {
|
|
47
|
+
error: {
|
|
48
|
+
code: 500,
|
|
49
|
+
message: error.message,
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
async xml2Word(fileId) {
|
|
55
|
+
try {
|
|
56
|
+
const wordFileId = await this.sharepointService.xml2Word(fileId);
|
|
57
|
+
return { fileId: wordFileId };
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
console.error(`word2Xml error: ${error}`);
|
|
61
|
+
return {
|
|
62
|
+
error: {
|
|
63
|
+
code: 500,
|
|
64
|
+
message: error.message,
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
12
69
|
};
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, common_1.Post)('word2Xml'),
|
|
72
|
+
(0, swagger_1.ApiOperation)({
|
|
73
|
+
summary: 'word转xml',
|
|
74
|
+
description: '将word文档转换为xml格式',
|
|
75
|
+
}),
|
|
76
|
+
(0, swagger_1.ApiBody)({
|
|
77
|
+
description: 'word转xml所需的参数',
|
|
78
|
+
schema: {
|
|
79
|
+
type: 'object',
|
|
80
|
+
properties: {
|
|
81
|
+
fileId: {
|
|
82
|
+
type: 'string',
|
|
83
|
+
example: 'bd1f297d-a258-4bd9-a591-99cc1036bda3',
|
|
84
|
+
description: '文件id',
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
required: ['fileId'],
|
|
88
|
+
},
|
|
89
|
+
}),
|
|
90
|
+
__param(0, (0, common_1.Body)('fileId')),
|
|
91
|
+
__metadata("design:type", Function),
|
|
92
|
+
__metadata("design:paramtypes", [String]),
|
|
93
|
+
__metadata("design:returntype", Promise)
|
|
94
|
+
], SharepointController.prototype, "word2Xml", null);
|
|
95
|
+
__decorate([
|
|
96
|
+
(0, common_1.Post)('xmlWriteComments'),
|
|
97
|
+
(0, swagger_1.ApiOperation)({
|
|
98
|
+
summary: 'xml写入批注',
|
|
99
|
+
description: '将ai给出的comments写入xml',
|
|
100
|
+
}),
|
|
101
|
+
(0, swagger_1.ApiBody)({
|
|
102
|
+
description: 'xml写入批注所需的参数',
|
|
103
|
+
schema: {
|
|
104
|
+
type: 'object',
|
|
105
|
+
properties: {
|
|
106
|
+
fileId: {
|
|
107
|
+
type: 'string',
|
|
108
|
+
example: 'bd1f297d-a258-4bd9-a591-99cc1036bda3',
|
|
109
|
+
description: '文件id',
|
|
110
|
+
},
|
|
111
|
+
comments: {
|
|
112
|
+
type: 'array',
|
|
113
|
+
items: {
|
|
114
|
+
type: 'object',
|
|
115
|
+
properties: {
|
|
116
|
+
xml_start: {
|
|
117
|
+
type: 'integer',
|
|
118
|
+
example: 100,
|
|
119
|
+
description: '批注开始行号',
|
|
120
|
+
},
|
|
121
|
+
xml_end: {
|
|
122
|
+
type: 'integer',
|
|
123
|
+
example: 200,
|
|
124
|
+
description: '批注结束行号',
|
|
125
|
+
},
|
|
126
|
+
check_result: {
|
|
127
|
+
type: 'object',
|
|
128
|
+
description: '批注内容',
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
required: ['xml_start', 'xml_end'],
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
required: ['fileId', 'comments', 'check_result'],
|
|
136
|
+
},
|
|
137
|
+
}),
|
|
138
|
+
__param(0, (0, common_1.Body)('fileId')),
|
|
139
|
+
__param(1, (0, common_1.Body)('comments')),
|
|
140
|
+
__metadata("design:type", Function),
|
|
141
|
+
__metadata("design:paramtypes", [String, Array]),
|
|
142
|
+
__metadata("design:returntype", Promise)
|
|
143
|
+
], SharepointController.prototype, "xmlWriteComments", null);
|
|
144
|
+
__decorate([
|
|
145
|
+
(0, common_1.Post)('xml2Word'),
|
|
146
|
+
(0, swagger_1.ApiOperation)({
|
|
147
|
+
summary: 'xml转word',
|
|
148
|
+
description: '将xml文档转换为word格式',
|
|
149
|
+
}),
|
|
150
|
+
(0, swagger_1.ApiBody)({
|
|
151
|
+
description: 'xml转word所需的参数',
|
|
152
|
+
schema: {
|
|
153
|
+
type: 'object',
|
|
154
|
+
properties: {
|
|
155
|
+
fileId: {
|
|
156
|
+
type: 'string',
|
|
157
|
+
example: 'bd1f297d-a258-4bd9-a591-99cc1036bda3',
|
|
158
|
+
description: '文件id',
|
|
159
|
+
},
|
|
160
|
+
},
|
|
161
|
+
required: ['fileId'],
|
|
162
|
+
},
|
|
163
|
+
}),
|
|
164
|
+
__param(0, (0, common_1.Body)('fileId')),
|
|
165
|
+
__metadata("design:type", Function),
|
|
166
|
+
__metadata("design:paramtypes", [String]),
|
|
167
|
+
__metadata("design:returntype", Promise)
|
|
168
|
+
], SharepointController.prototype, "xml2Word", null);
|
|
13
169
|
SharepointController = __decorate([
|
|
14
|
-
(0, common_1.
|
|
170
|
+
(0, common_1.UseGuards)(core_1.AdminGuard),
|
|
171
|
+
(0, common_1.Controller)('api/v6/sharepoint'),
|
|
172
|
+
__metadata("design:paramtypes", [sharepoint_service_1.SharepointService])
|
|
15
173
|
], SharepointController);
|
|
16
174
|
exports.SharepointController = SharepointController;
|
|
17
175
|
//# sourceMappingURL=sharepoint.controller.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sharepoint.controller.js","sourceRoot":"","sources":["../../src/sharepoint/sharepoint.controller.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sharepoint.controller.js","sourceRoot":"","sources":["../../src/sharepoint/sharepoint.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAmE;AACnE,6CAAwD;AACxD,yCAA4C;AAC5C,6DAAyD;AAIlD,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;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Y,EAAE;gCACZ,IAAI,EAAE,QAAQ;gCACd,WAAW,EAAE,MAAM;6BACpB;yBACF;wBACD,QAAQ,EAAE,CAAC,WAAW,EAAE,SAAS,CAAC;qBACnC;iBACF;aACF;YACD,QAAQ,EAAE,CAAC,QAAQ,EAAE,UAAU,EAAE,cAAc,CAAC;SACjD;KACF,CAAC;IAEC,WAAA,IAAA,aAAI,EAAC,QAAQ,CAAC,CAAA;IAEd,WAAA,IAAA,aAAI,EAAC,UAAU,CAAC,CAAA;;6CAAW,KAAK;;4DAqBlC;AAqBK;IAnBL,IAAA,aAAI,EAAC,UAAU,CAAC;IAChB,IAAA,sBAAY,EAAC;QACZ,OAAO,EAAE,UAAU;QACnB,WAAW,EAAE,iBAAiB;KAC/B,CAAC;IACD,IAAA,iBAAO,EAAC;QACP,WAAW,EAAE,eAAe;QAC5B,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,MAAM,EAAE;oBACN,IAAI,EAAE,QAAQ;oBACd,OAAO,EAAE,sCAAsC;oBAC/C,WAAW,EAAE,MAAM;iBACpB;aACF;YACD,QAAQ,EAAE,CAAC,QAAQ,CAAC;SACrB;KACF,CAAC;IACc,WAAA,IAAA,aAAI,EAAC,QAAQ,CAAC,CAAA;;;;oDAa7B;AAzIU,oBAAoB;IAFhC,IAAA,kBAAS,EAAC,iBAAU,CAAC;IACrB,IAAA,mBAAU,EAAC,mBAAmB,CAAC;qCAES,sCAAiB;GAD7C,oBAAoB,CA0IhC;AA1IY,oDAAoB"}
|
|
@@ -10,12 +10,16 @@ exports.SharepointModule = void 0;
|
|
|
10
10
|
const common_1 = require("@nestjs/common");
|
|
11
11
|
const sharepoint_service_1 = require("./sharepoint.service");
|
|
12
12
|
const sharepoint_controller_1 = require("./sharepoint.controller");
|
|
13
|
+
const sharepoint_moleculer_1 = require("./sharepoint.moleculer");
|
|
14
|
+
const files_1 = require("@builder6/files");
|
|
15
|
+
const core_1 = require("@builder6/core");
|
|
13
16
|
let SharepointModule = class SharepointModule {
|
|
14
17
|
};
|
|
15
18
|
SharepointModule = __decorate([
|
|
16
19
|
(0, common_1.Module)({
|
|
17
|
-
|
|
18
|
-
controllers: [sharepoint_controller_1.SharepointController]
|
|
20
|
+
imports: [core_1.AuthModule, core_1.MongodbModule, files_1.FilesModule],
|
|
21
|
+
controllers: [sharepoint_controller_1.SharepointController],
|
|
22
|
+
providers: [sharepoint_service_1.SharepointService, files_1.FilesService, sharepoint_moleculer_1.SharepointMoleculer],
|
|
19
23
|
})
|
|
20
24
|
], SharepointModule);
|
|
21
25
|
exports.SharepointModule = SharepointModule;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sharepoint.module.js","sourceRoot":"","sources":["../../src/sharepoint/sharepoint.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6DAAyD;AACzD,mEAA+D;
|
|
1
|
+
{"version":3,"file":"sharepoint.module.js","sourceRoot":"","sources":["../../src/sharepoint/sharepoint.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6DAAyD;AACzD,mEAA+D;AAC/D,iEAA6D;AAC7D,2CAA4D;AAC5D,yCAA2D;AAOpD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAAG,CAAA;AAAnB,gBAAgB;IAL5B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,iBAAU,EAAE,oBAAa,EAAE,mBAAW,CAAC;QACjD,WAAW,EAAE,CAAC,4CAAoB,CAAC;QACnC,SAAS,EAAE,CAAC,sCAAiB,EAAE,oBAAY,EAAE,0CAAmB,CAAC;KAClE,CAAC;GACW,gBAAgB,CAAG;AAAnB,4CAAgB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Service, Context, ServiceBroker } from 'moleculer';
|
|
2
|
+
import { SharepointService } from './sharepoint.service';
|
|
3
|
+
export declare class SharepointMoleculer extends Service {
|
|
4
|
+
private sharepointService;
|
|
5
|
+
constructor(sharepointService: SharepointService, broker: ServiceBroker);
|
|
6
|
+
serviceCreated(): void;
|
|
7
|
+
serviceStarted(): Promise<void>;
|
|
8
|
+
serviceStopped(): Promise<void>;
|
|
9
|
+
word2Xml(ctx: Context): Promise<string | {
|
|
10
|
+
error: {
|
|
11
|
+
message: any;
|
|
12
|
+
};
|
|
13
|
+
}>;
|
|
14
|
+
xmlWriteComments(ctx: Context): Promise<string | {
|
|
15
|
+
error: {
|
|
16
|
+
message: any;
|
|
17
|
+
};
|
|
18
|
+
}>;
|
|
19
|
+
xml2Word(ctx: Context): Promise<string | {
|
|
20
|
+
error: {
|
|
21
|
+
message: any;
|
|
22
|
+
};
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.SharepointMoleculer = void 0;
|
|
16
|
+
const moleculer_1 = require("moleculer");
|
|
17
|
+
const common_1 = require("@nestjs/common");
|
|
18
|
+
const moleculer_2 = require("@builder6/moleculer");
|
|
19
|
+
const sharepoint_service_1 = require("./sharepoint.service");
|
|
20
|
+
let SharepointMoleculer = class SharepointMoleculer extends moleculer_1.Service {
|
|
21
|
+
constructor(sharepointService, broker) {
|
|
22
|
+
super(broker);
|
|
23
|
+
this.sharepointService = sharepointService;
|
|
24
|
+
this.parseServiceSchema({
|
|
25
|
+
name: '@builder6/sharepoint',
|
|
26
|
+
settings: {},
|
|
27
|
+
actions: {
|
|
28
|
+
word2Xml: this.word2Xml,
|
|
29
|
+
xmlWriteComments: this.xmlWriteComments,
|
|
30
|
+
xml2Word: this.xml2Word,
|
|
31
|
+
},
|
|
32
|
+
created: this.serviceCreated,
|
|
33
|
+
started: this.serviceStarted,
|
|
34
|
+
stopped: this.serviceStopped,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
serviceCreated() { }
|
|
38
|
+
async serviceStarted() { }
|
|
39
|
+
async serviceStopped() { }
|
|
40
|
+
async word2Xml(ctx) {
|
|
41
|
+
const { fileId } = ctx.params;
|
|
42
|
+
try {
|
|
43
|
+
const result = await this.sharepointService.word2Xml(fileId);
|
|
44
|
+
return result;
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
console.error(error);
|
|
48
|
+
return {
|
|
49
|
+
error: {
|
|
50
|
+
message: error.message,
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
async xmlWriteComments(ctx) {
|
|
56
|
+
const { fileId, comments } = ctx.params;
|
|
57
|
+
try {
|
|
58
|
+
const result = await this.sharepointService.xmlWriteComments(fileId, comments);
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
console.error(error);
|
|
63
|
+
return {
|
|
64
|
+
error: {
|
|
65
|
+
message: error.message,
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
async xml2Word(ctx) {
|
|
71
|
+
const { fileId } = ctx.params;
|
|
72
|
+
try {
|
|
73
|
+
const result = await this.sharepointService.xml2Word(fileId);
|
|
74
|
+
return result;
|
|
75
|
+
}
|
|
76
|
+
catch (error) {
|
|
77
|
+
console.error(error);
|
|
78
|
+
return {
|
|
79
|
+
error: {
|
|
80
|
+
message: error.message,
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
SharepointMoleculer = __decorate([
|
|
87
|
+
(0, common_1.Injectable)(),
|
|
88
|
+
__param(1, (0, moleculer_2.InjectBroker)()),
|
|
89
|
+
__metadata("design:paramtypes", [sharepoint_service_1.SharepointService,
|
|
90
|
+
moleculer_1.ServiceBroker])
|
|
91
|
+
], SharepointMoleculer);
|
|
92
|
+
exports.SharepointMoleculer = SharepointMoleculer;
|
|
93
|
+
//# sourceMappingURL=sharepoint.moleculer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sharepoint.moleculer.js","sourceRoot":"","sources":["../../src/sharepoint/sharepoint.moleculer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,yCAA4D;AAC5D,2CAA4C;AAC5C,mDAAmD;AACnD,6DAAyD;AAGlD,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,mBAAO;IAC9C,YACU,iBAAoC,EAC5B,MAAqB;QAErC,KAAK,CAAC,MAAM,CAAC,CAAC;QAHN,sBAAiB,GAAjB,iBAAiB,CAAmB;QAK5C,IAAI,CAAC,kBAAkB,CAAC;YACtB,IAAI,EAAE,sBAAsB;YAC5B,QAAQ,EAAE,EAAE;YACZ,OAAO,EAAE;gBACP,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;gBACvC,QAAQ,EAAE,IAAI,CAAC,QAAQ;aACxB;YACD,OAAO,EAAE,IAAI,CAAC,cAAc;YAC5B,OAAO,EAAE,IAAI,C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,KAAK,EAAE;YACd,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACrB,OAAO;gBACL,KAAK,EAAE;oBACL,OAAO,EAAE,KAAK,CAAC,OAAO;iBACvB;aACF,CAAC;SACH;IACH,CAAC;CACF,CAAA;AA1EY,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;IAIR,WAAA,IAAA,wBAAY,GAAE,CAAA;qCADY,sCAAiB;QACpB,yBAAa;GAH5B,mBAAmB,CA0E/B;AA1EY,kDAAmB"}
|
|
@@ -1,2 +1,33 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import { FilesService } from '@builder6/files';
|
|
4
|
+
import { ConfigService } from '@nestjs/config';
|
|
1
5
|
export declare class SharepointService {
|
|
6
|
+
private filesService;
|
|
7
|
+
private configService;
|
|
8
|
+
private readonly logger;
|
|
9
|
+
private readonly officeConvertUrl;
|
|
10
|
+
private readonly tempDir;
|
|
11
|
+
constructor(filesService: FilesService, configService: ConfigService);
|
|
12
|
+
word2Xml(fileId: string): Promise<string>;
|
|
13
|
+
xml2Word(fileId: string): Promise<string>;
|
|
14
|
+
xmlWriteComments(fileId: string, comments: Array<{
|
|
15
|
+
xml_start: number;
|
|
16
|
+
xml_end: number;
|
|
17
|
+
check_result: object;
|
|
18
|
+
}>): Promise<string>;
|
|
19
|
+
word2XmlByOffice(tempFilePath: string): Promise<any>;
|
|
20
|
+
xml2WordByOffice(tempFilePath: string): Promise<any>;
|
|
21
|
+
downloadFileToTempByFileId(fileId: string, ext: string): Promise<string>;
|
|
22
|
+
downloadFileToTempByUrl(url: string): Promise<Buffer>;
|
|
23
|
+
createComment(content: object, author: string): {
|
|
24
|
+
commentStartXml: string;
|
|
25
|
+
commentEndXml: string;
|
|
26
|
+
commentContentXml: string;
|
|
27
|
+
};
|
|
28
|
+
addComments(comments: Array<{
|
|
29
|
+
xml_start: number;
|
|
30
|
+
xml_end: number;
|
|
31
|
+
check_result: object;
|
|
32
|
+
}>, originFilePath: string, commFilePath: string): Promise<void>;
|
|
2
33
|
}
|
|
@@ -5,13 +5,216 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var SharepointService_1;
|
|
8
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
13
|
exports.SharepointService = void 0;
|
|
14
|
+
const files_1 = require("@builder6/files");
|
|
10
15
|
const common_1 = require("@nestjs/common");
|
|
11
|
-
|
|
16
|
+
const config_1 = require("@nestjs/config");
|
|
17
|
+
const FormData = require("form-data");
|
|
18
|
+
const axios_1 = require("axios");
|
|
19
|
+
const fs_1 = require("fs");
|
|
20
|
+
const path_1 = require("path");
|
|
21
|
+
const uuid_1 = require("uuid");
|
|
22
|
+
const lineReader = require("line-reader");
|
|
23
|
+
let SharepointService = SharepointService_1 = class SharepointService {
|
|
24
|
+
constructor(filesService, configService) {
|
|
25
|
+
this.filesService = filesService;
|
|
26
|
+
this.configService = configService;
|
|
27
|
+
this.logger = new common_1.Logger(SharepointService_1.name);
|
|
28
|
+
this.officeConvertUrl = this.configService.get('sharepoint.office.convert.url');
|
|
29
|
+
this.tempDir = (0, path_1.join)(this.filesService.getStorageDir(), 'sharepoint-temps');
|
|
30
|
+
if (!(0, fs_1.existsSync)(this.tempDir)) {
|
|
31
|
+
(0, fs_1.mkdirSync)(this.tempDir, { recursive: true });
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
async word2Xml(fileId) {
|
|
35
|
+
try {
|
|
36
|
+
const tempFilePath = await this.downloadFileToTempByFileId(fileId, 'docx');
|
|
37
|
+
const { filename, download_url } = await this.word2XmlByOffice(tempFilePath);
|
|
38
|
+
const buffer = await this.downloadFileToTempByUrl(`${this.officeConvertUrl}${download_url}`);
|
|
39
|
+
const record = (await this.filesService.uploadFile('cfs.files.filerecord', {
|
|
40
|
+
buffer,
|
|
41
|
+
originalname: filename,
|
|
42
|
+
size: buffer.length,
|
|
43
|
+
}, {}));
|
|
44
|
+
(0, fs_1.unlinkSync)(tempFilePath);
|
|
45
|
+
return record?._id;
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
this.logger.error(error);
|
|
49
|
+
throw new common_1.HttpException(error.message, common_1.HttpStatus.INTERNAL_SERVER_ERROR);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
async xml2Word(fileId) {
|
|
53
|
+
try {
|
|
54
|
+
const tempFilePath = await this.downloadFileToTempByFileId(fileId, 'xml');
|
|
55
|
+
const { filename, download_url } = await this.xml2WordByOffice(tempFilePath);
|
|
56
|
+
const buffer = await this.downloadFileToTempByUrl(`${this.officeConvertUrl}${download_url}`);
|
|
57
|
+
const record = (await this.filesService.uploadFile('cfs.files.filerecord', {
|
|
58
|
+
buffer,
|
|
59
|
+
originalname: filename,
|
|
60
|
+
size: buffer.length,
|
|
61
|
+
}, {}));
|
|
62
|
+
(0, fs_1.unlinkSync)(tempFilePath);
|
|
63
|
+
return record?._id;
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
this.logger.error(error);
|
|
67
|
+
throw new common_1.HttpException(error.message, common_1.HttpStatus.INTERNAL_SERVER_ERROR);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
async xmlWriteComments(fileId, comments) {
|
|
71
|
+
try {
|
|
72
|
+
const originFilePath = await this.downloadFileToTempByFileId(fileId, 'xml');
|
|
73
|
+
const commFilePath = (0, path_1.join)(this.tempDir, `${fileId}withComment.xml`);
|
|
74
|
+
await this.addComments(comments, originFilePath, commFilePath);
|
|
75
|
+
this.logger.log('批注已成功添加到XML文件中.');
|
|
76
|
+
const buffer = await fs_1.promises.readFile(commFilePath);
|
|
77
|
+
const record = (await this.filesService.uploadFile('cfs.files.filerecord', {
|
|
78
|
+
buffer,
|
|
79
|
+
originalname: `${fileId}withComment.xml`,
|
|
80
|
+
size: buffer.length,
|
|
81
|
+
}, {}));
|
|
82
|
+
(0, fs_1.unlinkSync)(originFilePath);
|
|
83
|
+
(0, fs_1.unlinkSync)(commFilePath);
|
|
84
|
+
return record?._id;
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
this.logger.error(error);
|
|
88
|
+
throw new common_1.HttpException(error.message, common_1.HttpStatus.INTERNAL_SERVER_ERROR);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
async word2XmlByOffice(tempFilePath) {
|
|
92
|
+
this.logger.log(`${this.officeConvertUrl}/convert/word-to-xml`);
|
|
93
|
+
const formData = new FormData();
|
|
94
|
+
formData.append('file', (0, fs_1.createReadStream)(tempFilePath));
|
|
95
|
+
const res = await axios_1.default.post(`${this.officeConvertUrl}/convert/word-to-xml`, formData, {
|
|
96
|
+
headers: formData.getHeaders(),
|
|
97
|
+
});
|
|
98
|
+
if (res.status !== 200) {
|
|
99
|
+
throw new common_1.HttpException(res.data, common_1.HttpStatus.INTERNAL_SERVER_ERROR);
|
|
100
|
+
}
|
|
101
|
+
this.logger.log(`res.data: ${JSON.stringify(res.data)}`);
|
|
102
|
+
return res.data ?? {};
|
|
103
|
+
}
|
|
104
|
+
async xml2WordByOffice(tempFilePath) {
|
|
105
|
+
this.logger.log(`${this.officeConvertUrl}/convert/xml-to-word`);
|
|
106
|
+
const formData = new FormData();
|
|
107
|
+
formData.append('file', (0, fs_1.createReadStream)(tempFilePath));
|
|
108
|
+
const res = await axios_1.default.post(`${this.officeConvertUrl}/convert/xml-to-word`, formData, {
|
|
109
|
+
headers: formData.getHeaders(),
|
|
110
|
+
});
|
|
111
|
+
if (res.status !== 200) {
|
|
112
|
+
throw new common_1.HttpException(res.data, common_1.HttpStatus.INTERNAL_SERVER_ERROR);
|
|
113
|
+
}
|
|
114
|
+
this.logger.log(`res.data: ${JSON.stringify(res.data)}`);
|
|
115
|
+
return res.data ?? {};
|
|
116
|
+
}
|
|
117
|
+
async downloadFileToTempByFileId(fileId, ext) {
|
|
118
|
+
const fileStream = await this.filesService.downloadFileStream('cfs.files.filerecord', fileId);
|
|
119
|
+
const tempFilePath = (0, path_1.join)(this.tempDir, `${fileId}.${ext}`);
|
|
120
|
+
const outputStream = (0, fs_1.createWriteStream)(tempFilePath);
|
|
121
|
+
fileStream.pipe(outputStream);
|
|
122
|
+
await new Promise((resolve, reject) => {
|
|
123
|
+
outputStream.on('finish', resolve);
|
|
124
|
+
outputStream.on('error', reject);
|
|
125
|
+
});
|
|
126
|
+
return tempFilePath;
|
|
127
|
+
}
|
|
128
|
+
async downloadFileToTempByUrl(url) {
|
|
129
|
+
const res = await (0, axios_1.default)({
|
|
130
|
+
method: 'get',
|
|
131
|
+
url,
|
|
132
|
+
responseType: 'arraybuffer',
|
|
133
|
+
});
|
|
134
|
+
return Buffer.from(res.data);
|
|
135
|
+
}
|
|
136
|
+
createComment(content, author) {
|
|
137
|
+
const commentId = (0, uuid_1.v4)();
|
|
138
|
+
const date = new Date().toISOString();
|
|
139
|
+
const commentStartXml = `<aml:annotation aml:id="${commentId}" w:type="Word.Comment.Start" />`;
|
|
140
|
+
const commentEndXml = `<aml:annotation aml:id="${commentId}" w:type="Word.Comment.End" />`;
|
|
141
|
+
const contents = Object.entries(content).reduce((acc, [key, value], currentIndex) => {
|
|
142
|
+
acc += `<w:r><w:rPr><w:rFonts w:hint="fareast" /><wx:font wx:val="宋体" /></w:rPr><w:t>${currentIndex + 1}、${key}:${value}</w:t></w:r><w:br/>`;
|
|
143
|
+
return acc;
|
|
144
|
+
}, '');
|
|
145
|
+
const commentContentXml = `
|
|
146
|
+
<w:r>
|
|
147
|
+
<aml:annotation aml:id="${commentId}" w:type="Word.Comment" aml:author="${author}" aml:createdate="${date}" w:initials="">
|
|
148
|
+
<aml:content>
|
|
149
|
+
<w:p wsp:rsidR="00375EA8" wsp:rsidRDefault="00D06F22">
|
|
150
|
+
<w:pPr>
|
|
151
|
+
<w:pStyle w:val="a3" />
|
|
152
|
+
</w:pPr>
|
|
153
|
+
${contents}
|
|
154
|
+
</w:p>
|
|
155
|
+
</aml:content>
|
|
156
|
+
</aml:annotation>
|
|
157
|
+
</w:r>`.trim();
|
|
158
|
+
return { commentStartXml, commentEndXml, commentContentXml };
|
|
159
|
+
}
|
|
160
|
+
async addComments(comments, originFilePath, commFilePath) {
|
|
161
|
+
const outputStream = (0, fs_1.createWriteStream)(commFilePath);
|
|
162
|
+
let currentLine = 1;
|
|
163
|
+
comments.sort((a, b) => a.xml_start - b.xml_start);
|
|
164
|
+
let intervalLines = [];
|
|
165
|
+
let shouldWriteCurrentLine = true;
|
|
166
|
+
await new Promise((resolve, reject) => {
|
|
167
|
+
lineReader.eachLine(originFilePath, (line, last) => {
|
|
168
|
+
try {
|
|
169
|
+
const comment = comments[0];
|
|
170
|
+
const { commentStartXml = '', commentEndXml = '', commentContentXml = '', } = comment
|
|
171
|
+
? this.createComment(comment.check_result, 'AI Reviewer')
|
|
172
|
+
: {};
|
|
173
|
+
if (comment && currentLine === comment.xml_start) {
|
|
174
|
+
shouldWriteCurrentLine = false;
|
|
175
|
+
outputStream.write(commentStartXml + '\n');
|
|
176
|
+
}
|
|
177
|
+
if (comment &&
|
|
178
|
+
currentLine <= comment.xml_end &&
|
|
179
|
+
!shouldWriteCurrentLine) {
|
|
180
|
+
intervalLines.push(line);
|
|
181
|
+
}
|
|
182
|
+
if (comment &&
|
|
183
|
+
currentLine === comment.xml_end &&
|
|
184
|
+
!shouldWriteCurrentLine) {
|
|
185
|
+
for (let i = 0; i < intervalLines.length; i++) {
|
|
186
|
+
const intervalLine = intervalLines[i];
|
|
187
|
+
outputStream.write(intervalLine + '\n');
|
|
188
|
+
}
|
|
189
|
+
outputStream.write(commentEndXml + '\n');
|
|
190
|
+
outputStream.write(commentContentXml + '\n');
|
|
191
|
+
shouldWriteCurrentLine = true;
|
|
192
|
+
intervalLines = [];
|
|
193
|
+
comments.shift();
|
|
194
|
+
}
|
|
195
|
+
else if (shouldWriteCurrentLine) {
|
|
196
|
+
outputStream.write(line + '\n');
|
|
197
|
+
}
|
|
198
|
+
currentLine++;
|
|
199
|
+
if (last) {
|
|
200
|
+
resolve();
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
catch (error) {
|
|
204
|
+
reject(error);
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
});
|
|
208
|
+
await new Promise((resolve, reject) => {
|
|
209
|
+
outputStream.end(() => resolve());
|
|
210
|
+
outputStream.on('error', reject);
|
|
211
|
+
});
|
|
212
|
+
}
|
|
12
213
|
};
|
|
13
|
-
SharepointService = __decorate([
|
|
14
|
-
(0, common_1.Injectable)()
|
|
214
|
+
SharepointService = SharepointService_1 = __decorate([
|
|
215
|
+
(0, common_1.Injectable)(),
|
|
216
|
+
__metadata("design:paramtypes", [files_1.FilesService,
|
|
217
|
+
config_1.ConfigService])
|
|
15
218
|
], SharepointService);
|
|
16
219
|
exports.SharepointService = SharepointService;
|
|
17
220
|
//# sourceMappingURL=sharepoint.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sharepoint.service.js","sourceRoot":"","sources":["../../src/sharepoint/sharepoint.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sharepoint.service.js","sourceRoot":"","sources":["../../src/sharepoint/sharepoint.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAA+C;AAC/C,2CAA+E;AAC/E,2CAA+C;AAC/C,sCAAsC;AACtC,iCAAyC;AACzC,2BAOY;AACZ,+BAA4B;AAC5B,+BAAoC;AACpC,0CAA0C;AAGnC,IAAM,iBAAiB,yBAAvB,MAAM,iBAAiB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
|
1
1
|
{
|
|
2
2
|
"name": "@builder6/sharepoint",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.4",
|
|
4
4
|
"main": "dist/plugin.module.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -12,12 +12,14 @@
|
|
|
12
12
|
"build:watch": "rimraf dist && tsc --watch"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
|
-
"@builder6/core": "^0.11.
|
|
16
|
-
"@builder6/files": "^0.11.
|
|
15
|
+
"@builder6/core": "^0.11.4",
|
|
16
|
+
"@builder6/files": "^0.11.4",
|
|
17
|
+
"form-data": "^4.0.1",
|
|
18
|
+
"line-reader": "^0.4.0",
|
|
17
19
|
"nodemailer": "^6.9.16"
|
|
18
20
|
},
|
|
19
21
|
"publishConfig": {
|
|
20
22
|
"access": "public"
|
|
21
23
|
},
|
|
22
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "855ea3883b298d65e843233320ab3ef478bcc6cc"
|
|
23
25
|
}
|