@builder6/sharepoint 0.11.6 → 0.11.8
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/microsoft365/microsoft365.controller.d.ts +8 -2
- package/dist/microsoft365/microsoft365.controller.js +71 -15
- package/dist/microsoft365/microsoft365.controller.js.map +1 -1
- package/dist/microsoft365/microsoft365.module.js +2 -0
- package/dist/microsoft365/microsoft365.module.js.map +1 -1
- package/dist/microsoft365/microsoft365.service.d.ts +7 -0
- package/dist/microsoft365/microsoft365.service.js +16 -8
- package/dist/microsoft365/microsoft365.service.js.map +1 -1
- package/dist/plugin.module.d.ts +3 -1
- package/dist/plugin.module.js +19 -3
- package/dist/plugin.module.js.map +1 -1
- package/package.json +4 -4
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
/// <reference types="multer" />
|
|
1
2
|
import { Microsoft365Service } from './microsoft365.service';
|
|
2
3
|
export declare class Microsoft365Controller {
|
|
3
4
|
private microsoft365Service;
|
|
5
|
+
private logger;
|
|
4
6
|
constructor(microsoft365Service: Microsoft365Service);
|
|
5
|
-
|
|
7
|
+
auth(): Promise<{
|
|
8
|
+
accessToken: any;
|
|
9
|
+
}>;
|
|
6
10
|
getSites(): Promise<any>;
|
|
7
|
-
|
|
11
|
+
getSiteDrive(siteId: string): Promise<any>;
|
|
12
|
+
downloadFile(siteId: string, fileId: string): Promise<any>;
|
|
13
|
+
uploadFile(file: Express.Multer.File, siteId: string): Promise<any>;
|
|
8
14
|
}
|
|
@@ -11,20 +11,28 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
12
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
13
|
};
|
|
14
|
+
var Microsoft365Controller_1;
|
|
14
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
16
|
exports.Microsoft365Controller = void 0;
|
|
16
17
|
const common_1 = require("@nestjs/common");
|
|
17
18
|
const axios_1 = require("axios");
|
|
19
|
+
const platform_express_1 = require("@nestjs/platform-express");
|
|
20
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
18
21
|
const microsoft365_service_1 = require("./microsoft365.service");
|
|
19
|
-
|
|
22
|
+
const core_1 = require("@builder6/core");
|
|
23
|
+
let Microsoft365Controller = Microsoft365Controller_1 = class Microsoft365Controller {
|
|
20
24
|
constructor(microsoft365Service) {
|
|
21
25
|
this.microsoft365Service = microsoft365Service;
|
|
26
|
+
this.logger = new common_1.Logger(Microsoft365Controller_1.name);
|
|
22
27
|
}
|
|
23
|
-
async
|
|
24
|
-
const
|
|
28
|
+
async auth() {
|
|
29
|
+
const accessToken = await this.microsoft365Service.getAccessToken();
|
|
30
|
+
return { accessToken };
|
|
31
|
+
}
|
|
32
|
+
async getSites() {
|
|
25
33
|
try {
|
|
26
34
|
const accessToken = await this.microsoft365Service.getAccessToken();
|
|
27
|
-
const driveResponse = await axios_1.default.get(`https://graph.microsoft.com/v1.0/
|
|
35
|
+
const driveResponse = await axios_1.default.get(`https://graph.microsoft.com/v1.0/sites`, { headers: { Authorization: `Bearer ${accessToken}` } });
|
|
28
36
|
return driveResponse.data;
|
|
29
37
|
}
|
|
30
38
|
catch (error) {
|
|
@@ -32,36 +40,51 @@ let Microsoft365Controller = class Microsoft365Controller {
|
|
|
32
40
|
throw new common_1.HttpException(message, common_1.HttpStatus.INTERNAL_SERVER_ERROR);
|
|
33
41
|
}
|
|
34
42
|
}
|
|
35
|
-
async
|
|
43
|
+
async getSiteDrive(siteId) {
|
|
36
44
|
try {
|
|
37
45
|
const accessToken = await this.microsoft365Service.getAccessToken();
|
|
38
|
-
const
|
|
39
|
-
return
|
|
46
|
+
const respose = await axios_1.default.get(`https://graph.microsoft.com/v1.0/sites/${siteId}/drive`, { headers: { Authorization: `Bearer ${accessToken}` } });
|
|
47
|
+
return respose.data;
|
|
40
48
|
}
|
|
41
49
|
catch (error) {
|
|
42
50
|
const message = error.response ? error.response.data : error.message;
|
|
43
51
|
throw new common_1.HttpException(message, common_1.HttpStatus.INTERNAL_SERVER_ERROR);
|
|
44
52
|
}
|
|
45
53
|
}
|
|
46
|
-
async
|
|
54
|
+
async downloadFile(siteId, fileId) {
|
|
47
55
|
try {
|
|
48
56
|
const accessToken = await this.microsoft365Service.getAccessToken();
|
|
49
|
-
const respose = await axios_1.default.get(`https://graph.microsoft.com/v1.0/sites/${siteId}/drive`, { headers: { Authorization: `Bearer ${accessToken}` } });
|
|
57
|
+
const respose = await axios_1.default.get(`https://graph.microsoft.com/v1.0/sites/${siteId}/drive/items/${fileId}/content`, { headers: { Authorization: `Bearer ${accessToken}` } });
|
|
58
|
+
return respose.data;
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
const message = error.response ? error.response.data : error.message;
|
|
62
|
+
throw new common_1.HttpException(message, common_1.HttpStatus.INTERNAL_SERVER_ERROR);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
async uploadFile(file, siteId) {
|
|
66
|
+
try {
|
|
67
|
+
const accessToken = await this.microsoft365Service.getAccessToken();
|
|
68
|
+
const fileName = Buffer.from(file.originalname, 'binary').toString('utf8');
|
|
69
|
+
const url = `https://graph.microsoft.com/v1.0/sites/${siteId}/drive/items/root:/${fileName}:/content`;
|
|
70
|
+
this.logger.log(`Uploading file to ${url}`);
|
|
71
|
+
const respose = await axios_1.default.put(url, file.buffer, {
|
|
72
|
+
headers: { Authorization: `Bearer ${accessToken}` },
|
|
73
|
+
});
|
|
50
74
|
return respose.data;
|
|
51
75
|
}
|
|
52
76
|
catch (error) {
|
|
53
|
-
console.log(error.response);
|
|
54
77
|
const message = error.response ? error.response.data : error.message;
|
|
55
78
|
throw new common_1.HttpException(message, common_1.HttpStatus.INTERNAL_SERVER_ERROR);
|
|
56
79
|
}
|
|
57
80
|
}
|
|
58
81
|
};
|
|
59
82
|
__decorate([
|
|
60
|
-
(0, common_1.Get)('
|
|
83
|
+
(0, common_1.Get)('auth'),
|
|
61
84
|
__metadata("design:type", Function),
|
|
62
85
|
__metadata("design:paramtypes", []),
|
|
63
86
|
__metadata("design:returntype", Promise)
|
|
64
|
-
], Microsoft365Controller.prototype, "
|
|
87
|
+
], Microsoft365Controller.prototype, "auth", null);
|
|
65
88
|
__decorate([
|
|
66
89
|
(0, common_1.Get)('sites'),
|
|
67
90
|
__metadata("design:type", Function),
|
|
@@ -69,13 +92,46 @@ __decorate([
|
|
|
69
92
|
__metadata("design:returntype", Promise)
|
|
70
93
|
], Microsoft365Controller.prototype, "getSites", null);
|
|
71
94
|
__decorate([
|
|
72
|
-
(0, common_1.Get)('sites/:siteId'),
|
|
95
|
+
(0, common_1.Get)('sites/:siteId/drive'),
|
|
73
96
|
__param(0, (0, common_1.Param)('siteId')),
|
|
74
97
|
__metadata("design:type", Function),
|
|
75
98
|
__metadata("design:paramtypes", [String]),
|
|
76
99
|
__metadata("design:returntype", Promise)
|
|
77
|
-
], Microsoft365Controller.prototype, "
|
|
78
|
-
|
|
100
|
+
], Microsoft365Controller.prototype, "getSiteDrive", null);
|
|
101
|
+
__decorate([
|
|
102
|
+
(0, swagger_1.ApiOperation)({ summary: 'Download a file' }),
|
|
103
|
+
(0, common_1.Get)('sites/:siteId/drive/items/:fileId/content'),
|
|
104
|
+
__param(0, (0, common_1.Param)('siteId')),
|
|
105
|
+
__param(1, (0, common_1.Param)('fileId')),
|
|
106
|
+
__metadata("design:type", Function),
|
|
107
|
+
__metadata("design:paramtypes", [String, String]),
|
|
108
|
+
__metadata("design:returntype", Promise)
|
|
109
|
+
], Microsoft365Controller.prototype, "downloadFile", null);
|
|
110
|
+
__decorate([
|
|
111
|
+
(0, common_1.Put)('sites/:siteId/drive/items/root:'),
|
|
112
|
+
(0, common_1.HttpCode)(200),
|
|
113
|
+
(0, swagger_1.ApiOperation)({ summary: 'Upload a file' }),
|
|
114
|
+
(0, swagger_1.ApiConsumes)('multipart/form-data'),
|
|
115
|
+
(0, swagger_1.ApiBody)({
|
|
116
|
+
schema: {
|
|
117
|
+
type: 'object',
|
|
118
|
+
properties: {
|
|
119
|
+
file: {
|
|
120
|
+
type: 'string',
|
|
121
|
+
format: 'binary',
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
}),
|
|
126
|
+
(0, common_1.UseInterceptors)((0, platform_express_1.FileInterceptor)('file')),
|
|
127
|
+
__param(0, (0, common_1.UploadedFile)()),
|
|
128
|
+
__param(1, (0, common_1.Param)('siteId')),
|
|
129
|
+
__metadata("design:type", Function),
|
|
130
|
+
__metadata("design:paramtypes", [Object, String]),
|
|
131
|
+
__metadata("design:returntype", Promise)
|
|
132
|
+
], Microsoft365Controller.prototype, "uploadFile", null);
|
|
133
|
+
Microsoft365Controller = Microsoft365Controller_1 = __decorate([
|
|
134
|
+
(0, common_1.UseGuards)(core_1.AdminGuard),
|
|
79
135
|
(0, common_1.Controller)('api/v6/microsoft365'),
|
|
80
136
|
__metadata("design:paramtypes", [microsoft365_service_1.Microsoft365Service])
|
|
81
137
|
], Microsoft365Controller);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"microsoft365.controller.js","sourceRoot":"","sources":["../../src/microsoft365/microsoft365.controller.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"microsoft365.controller.js","sourceRoot":"","sources":["../../src/microsoft365/microsoft365.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAYwB;AACxB,iCAAyC;AACzC,+DAA2D;AAC3D,6CAAqE;AAErE,iEAA6D;AAC7D,yCAA4C;AAIrC,IAAM,sBAAsB,8BAA5B,MAAM,sBAAsB;IAEjC,YAAoB,mBAAwC;QAAxC,wBAAmB,GAAnB,mBAAmB,CAAqB;QADpD,WAAM,GAAW,IAAI,eAAM,CAAC,wBAAsB,CAAC,IAAI,CAAC,CAAC;IACF,CAAC;IAG1D,AAAN,KAAK,CAAC,IAAI;QACR,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,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,kBAAS,EAAC,iBAAU,CAAC;IACrB,IAAA,mBAAU,EAAC,qBAAqB,CAAC;qCAGS,0CAAmB;GAFjD,sBAAsB,CAuGlC;AAvGY,wDAAsB"}
|
|
@@ -10,10 +10,12 @@ exports.Microsoft365Module = void 0;
|
|
|
10
10
|
const common_1 = require("@nestjs/common");
|
|
11
11
|
const microsoft365_service_1 = require("./microsoft365.service");
|
|
12
12
|
const microsoft365_controller_1 = require("./microsoft365.controller");
|
|
13
|
+
const core_1 = require("@builder6/core");
|
|
13
14
|
let Microsoft365Module = class Microsoft365Module {
|
|
14
15
|
};
|
|
15
16
|
Microsoft365Module = __decorate([
|
|
16
17
|
(0, common_1.Module)({
|
|
18
|
+
imports: [core_1.AuthModule],
|
|
17
19
|
providers: [microsoft365_service_1.Microsoft365Service],
|
|
18
20
|
controllers: [microsoft365_controller_1.Microsoft365Controller],
|
|
19
21
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"microsoft365.module.js","sourceRoot":"","sources":["../../src/microsoft365/microsoft365.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,iEAA6D;AAC7D,uEAAmE;
|
|
1
|
+
{"version":3,"file":"microsoft365.module.js","sourceRoot":"","sources":["../../src/microsoft365/microsoft365.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,iEAA6D;AAC7D,uEAAmE;AACnE,yCAA4C;AAOrC,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;CAAG,CAAA;AAArB,kBAAkB;IAL9B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,iBAAU,CAAC;QACrB,SAAS,EAAE,CAAC,0CAAmB,CAAC;QAChC,WAAW,EAAE,CAAC,gDAAsB,CAAC;KACtC,CAAC;GACW,kBAAkB,CAAG;AAArB,gDAAkB"}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import { ConfigService } from '@nestjs/config';
|
|
1
2
|
export declare class Microsoft365Service {
|
|
3
|
+
private configService;
|
|
4
|
+
tenantId: string;
|
|
5
|
+
clientId: string;
|
|
6
|
+
clientSecret: string;
|
|
7
|
+
siteId: string;
|
|
8
|
+
constructor(configService: ConfigService);
|
|
2
9
|
getAccessToken(): Promise<any>;
|
|
3
10
|
}
|
|
@@ -5,28 +5,36 @@ 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
|
+
};
|
|
8
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
12
|
exports.Microsoft365Service = void 0;
|
|
10
13
|
const common_1 = require("@nestjs/common");
|
|
11
14
|
const axios_1 = require("axios");
|
|
15
|
+
const config_1 = require("@nestjs/config");
|
|
12
16
|
let Microsoft365Service = class Microsoft365Service {
|
|
17
|
+
constructor(configService) {
|
|
18
|
+
this.configService = configService;
|
|
19
|
+
this.tenantId = configService.get('microsoft.graph.tenant.id');
|
|
20
|
+
this.clientId = configService.get('microsoft.graph.client.id');
|
|
21
|
+
this.clientSecret = configService.get('microsoft.graph.client.secret');
|
|
22
|
+
this.siteId = configService.get('microsoft.graph.site.id');
|
|
23
|
+
}
|
|
13
24
|
async getAccessToken() {
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const tokenResponse = await axios_1.default.post(`https://login.microsoftonline.com/${tenantId}/oauth2/v2.0/token`, new URLSearchParams({
|
|
18
|
-
client_id: clientId,
|
|
19
|
-
client_secret: clientSecret,
|
|
25
|
+
const tokenResponse = await axios_1.default.post(`https://login.microsoftonline.com/${this.tenantId}/oauth2/v2.0/token`, new URLSearchParams({
|
|
26
|
+
client_id: this.clientId,
|
|
27
|
+
client_secret: this.clientSecret,
|
|
20
28
|
grant_type: 'client_credentials',
|
|
21
29
|
scope: 'https://graph.microsoft.com/.default',
|
|
22
30
|
}).toString(), { headers: { 'Content-Type': 'application/x-www-form-urlencoded' } });
|
|
23
31
|
const accessToken = tokenResponse.data.access_token;
|
|
24
|
-
console.log(accessToken);
|
|
25
32
|
return accessToken;
|
|
26
33
|
}
|
|
27
34
|
};
|
|
28
35
|
Microsoft365Service = __decorate([
|
|
29
|
-
(0, common_1.Injectable)()
|
|
36
|
+
(0, common_1.Injectable)(),
|
|
37
|
+
__metadata("design:paramtypes", [config_1.ConfigService])
|
|
30
38
|
], Microsoft365Service);
|
|
31
39
|
exports.Microsoft365Service = Microsoft365Service;
|
|
32
40
|
//# sourceMappingURL=microsoft365.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"microsoft365.service.js","sourceRoot":"","sources":["../../src/microsoft365/microsoft365.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"microsoft365.service.js","sourceRoot":"","sources":["../../src/microsoft365/microsoft365.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,iCAAyC;AACzC,2CAA+C;AAGxC,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAM9B,YAAoB,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;QAC9C,IAAI,CAAC,QAAQ,GAAG,aAAa,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;QAC/D,IAAI,CAAC,QAAQ,GAAG,aAAa,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;QAC/D,IAAI,CAAC,YAAY,GAAG,aAAa,CAAC,GAAG,CAAC,+BAA+B,CAAC,CAAC;QACvE,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IAC7D,CAAC;IACD,KAAK,CAAC,cAAc;QAGlB,MAAM,aAAa,GAAG,MAAM,eAAK,CAAC,IAAI,CACpC,qCAAqC,IAAI,CAAC,QAAQ,oBAAoB,EACtE,IAAI,eAAe,CAAC;YAClB,SAAS,EAAE,IAAI,CAAC,QAAQ;YACxB,aAAa,EAAE,IAAI,CAAC,YAAY;YAChC,UAAU,EAAE,oBAAoB;YAChC,KAAK,EAAE,sCAAsC;SAC9C,CAAC,CAAC,QAAQ,EAAE,EACb,EAAE,OAAO,EAAE,EAAE,cAAc,EAAE,mCAAmC,EAAE,EAAE,CACrE,CAAC;QAEF,MAAM,WAAW,GAAG,aAAa,CAAC,IAAI,CAAC,YAAY,CAAC;QACpD,OAAO,WAAW,CAAC;IACrB,CAAC;CACF,CAAA;AA7BY,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;qCAOwB,sBAAa;GANrC,mBAAmB,CA6B/B;AA7BY,kDAAmB"}
|
package/dist/plugin.module.d.ts
CHANGED
package/dist/plugin.module.js
CHANGED
|
@@ -10,13 +10,29 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
11
|
o[k2] = m[k];
|
|
12
12
|
}));
|
|
13
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
14
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
15
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
16
|
+
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;
|
|
17
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
18
|
+
};
|
|
13
19
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
20
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
21
|
};
|
|
16
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
23
|
+
exports.SharepointModule = void 0;
|
|
24
|
+
const common_1 = require("@nestjs/common");
|
|
25
|
+
const sharepoint_1 = require("./sharepoint");
|
|
26
|
+
const microsoft365_1 = require("./microsoft365");
|
|
18
27
|
__exportStar(require("./microsoft365"), exports);
|
|
19
28
|
__exportStar(require("./sharepoint"), exports);
|
|
20
|
-
|
|
21
|
-
|
|
29
|
+
let SharepointModule = class SharepointModule {
|
|
30
|
+
};
|
|
31
|
+
SharepointModule = __decorate([
|
|
32
|
+
(0, common_1.Module)({
|
|
33
|
+
imports: [sharepoint_1.SharepointModule, microsoft365_1.Microsoft365Module],
|
|
34
|
+
})
|
|
35
|
+
], SharepointModule);
|
|
36
|
+
exports.SharepointModule = SharepointModule;
|
|
37
|
+
exports.default = SharepointModule;
|
|
22
38
|
//# sourceMappingURL=plugin.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.module.js","sourceRoot":"","sources":["../src/plugin.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.module.js","sourceRoot":"","sources":["../src/plugin.module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgE;AAChE,iDAAoD;AAEpD,iDAA+B;AAC/B,+CAA6B;AAKtB,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAAG,CAAA;AAAnB,gBAAgB;IAH5B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,6BAAY,EAAE,iCAAkB,CAAC;KAC5C,CAAC;GACW,gBAAgB,CAAG;AAAnB,4CAAgB;AAE7B,kBAAe,gBAAgB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builder6/sharepoint",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.8",
|
|
4
4
|
"main": "dist/plugin.module.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
@@ -12,8 +12,8 @@
|
|
|
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.8",
|
|
16
|
+
"@builder6/files": "^0.11.8",
|
|
17
17
|
"form-data": "^4.0.1",
|
|
18
18
|
"line-reader": "^0.4.0",
|
|
19
19
|
"nodemailer": "^6.9.16"
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
"publishConfig": {
|
|
22
22
|
"access": "public"
|
|
23
23
|
},
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "32d05968882b15571b00cd26d80df23f43e7015d"
|
|
25
25
|
}
|