@builder6/server 0.6.3 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.express.js +0 -1
- package/dist/app.express.js.map +1 -1
- package/dist/app.module.js +4 -4
- package/dist/app.module.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -15
- package/dist/index.js.map +1 -1
- package/dist/oidc/oidc.service.js +1 -1
- package/dist/oidc/oidc.service.js.map +1 -1
- package/dist/plugin/plugin.module.js +1 -3
- package/dist/plugin/plugin.module.js.map +1 -1
- package/package.json +9 -8
- package/dist/files/files.controller.d.ts +0 -11
- package/dist/files/files.controller.js +0 -148
- package/dist/files/files.controller.js.map +0 -1
- package/dist/files/files.module.d.ts +0 -2
- package/dist/files/files.module.js +0 -26
- package/dist/files/files.module.js.map +0 -1
- package/dist/files/files.moleculer.d.ts +0 -10
- package/dist/files/files.moleculer.js +0 -53
- package/dist/files/files.moleculer.js.map +0 -1
- package/dist/files/files.service.d.ts +0 -30
- package/dist/files/files.service.js +0 -207
- package/dist/files/files.service.js.map +0 -1
- package/dist/files/index.d.ts +0 -3
- package/dist/files/index.js +0 -20
- package/dist/files/index.js.map +0 -1
- package/dist/rooms/globals/augmentation.d.ts +0 -25
- package/dist/rooms/globals/augmentation.js +0 -3
- package/dist/rooms/globals/augmentation.js.map +0 -1
- package/dist/rooms/lib/DateToString.d.ts +0 -3
- package/dist/rooms/lib/DateToString.js +0 -3
- package/dist/rooms/lib/DateToString.js.map +0 -1
- package/dist/rooms/lib/Json.d.ts +0 -9
- package/dist/rooms/lib/Json.js +0 -18
- package/dist/rooms/lib/Json.js.map +0 -1
- package/dist/rooms/lib/utils.d.ts +0 -33
- package/dist/rooms/lib/utils.js +0 -122
- package/dist/rooms/lib/utils.js.map +0 -1
- package/dist/rooms/protocol/AuthToken.d.ts +0 -50
- package/dist/rooms/protocol/AuthToken.js +0 -49
- package/dist/rooms/protocol/AuthToken.js.map +0 -1
- package/dist/rooms/protocol/Authentication.d.ts +0 -22
- package/dist/rooms/protocol/Authentication.js +0 -3
- package/dist/rooms/protocol/Authentication.js.map +0 -1
- package/dist/rooms/protocol/BaseActivitiesData.d.ts +0 -4
- package/dist/rooms/protocol/BaseActivitiesData.js +0 -3
- package/dist/rooms/protocol/BaseActivitiesData.js.map +0 -1
- package/dist/rooms/protocol/BaseRoomInfo.d.ts +0 -6
- package/dist/rooms/protocol/BaseRoomInfo.js +0 -3
- package/dist/rooms/protocol/BaseRoomInfo.js.map +0 -1
- package/dist/rooms/protocol/BaseUserMeta.d.ts +0 -10
- package/dist/rooms/protocol/BaseUserMeta.js +0 -3
- package/dist/rooms/protocol/BaseUserMeta.js.map +0 -1
- package/dist/rooms/protocol/ClientMsg.d.ts +0 -41
- package/dist/rooms/protocol/ClientMsg.js +0 -13
- package/dist/rooms/protocol/ClientMsg.js.map +0 -1
- package/dist/rooms/protocol/Comments.d.ts +0 -146
- package/dist/rooms/protocol/Comments.js +0 -3
- package/dist/rooms/protocol/Comments.js.map +0 -1
- package/dist/rooms/protocol/InboxNotifications.d.ts +0 -49
- package/dist/rooms/protocol/InboxNotifications.js +0 -3
- package/dist/rooms/protocol/InboxNotifications.js.map +0 -1
- package/dist/rooms/protocol/Op.d.ts +0 -82
- package/dist/rooms/protocol/Op.js +0 -28
- package/dist/rooms/protocol/Op.js.map +0 -1
- package/dist/rooms/protocol/SerializedCrdt.d.ts +0 -40
- package/dist/rooms/protocol/SerializedCrdt.js +0 -19
- package/dist/rooms/protocol/SerializedCrdt.js.map +0 -1
- package/dist/rooms/protocol/ServerMsg.d.ts +0 -128
- package/dist/rooms/protocol/ServerMsg.js +0 -25
- package/dist/rooms/protocol/ServerMsg.js.map +0 -1
- package/dist/rooms/protocol/VersionHistory.d.ts +0 -9
- package/dist/rooms/protocol/VersionHistory.js +0 -3
- package/dist/rooms/protocol/VersionHistory.js.map +0 -1
- package/dist/rooms/rooms.controller.d.ts +0 -64
- package/dist/rooms/rooms.controller.js +0 -401
- package/dist/rooms/rooms.controller.js.map +0 -1
- package/dist/rooms/rooms.gateway.d.ts +0 -30
- package/dist/rooms/rooms.gateway.js +0 -188
- package/dist/rooms/rooms.gateway.js.map +0 -1
- package/dist/rooms/rooms.guard.d.ts +0 -9
- package/dist/rooms/rooms.guard.js +0 -48
- package/dist/rooms/rooms.guard.js.map +0 -1
- package/dist/rooms/rooms.module.d.ts +0 -2
- package/dist/rooms/rooms.module.js +0 -36
- package/dist/rooms/rooms.module.js.map +0 -1
- package/dist/rooms/rooms.service.d.ts +0 -51
- package/dist/rooms/rooms.service.js +0 -225
- package/dist/rooms/rooms.service.js.map +0 -1
- package/views/ag-grid/README.md +0 -15
- package/views/ag-grid/ag-grid.hbs +0 -1099
- package/views/devextreme/datagrid.hbs +0 -240
package/dist/app.express.js
CHANGED
|
@@ -34,7 +34,6 @@ async function ExpressApplication() {
|
|
|
34
34
|
const documentFactory = () => swagger_1.SwaggerModule.createDocument(app, swaggerConfig);
|
|
35
35
|
swagger_1.SwaggerModule.setup('api/v6', app, documentFactory);
|
|
36
36
|
app.useStaticAssets((0, path_1.join)(__dirname, '..', 'public'));
|
|
37
|
-
app.setBaseViewsDir((0, path_1.join)(__dirname, '..', 'views'));
|
|
38
37
|
app.setViewEngine('hbs');
|
|
39
38
|
app.use(cookieParser());
|
|
40
39
|
app.use((0, express_1.json)({ limit: '50mb' }));
|
package/dist/app.express.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.express.js","sourceRoot":"","sources":["../src/app.express.ts"],"names":[],"mappings":";;AAYA,
|
|
1
|
+
{"version":3,"file":"app.express.js","sourceRoot":"","sources":["../src/app.express.ts"],"names":[],"mappings":";;AAYA,qCAwCC;AApDD,uCAA2C;AAC3C,6CAAyC;AACzC,+BAA4B;AAE5B,6CAAiE;AACjE,8CAA8C;AAC9C,2CAA2C;AAC3C,qCAA2C;AAC3C,qDAAgD;AAEhD,2CAA2C;AAE5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AE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,CAAC,CACxE,CAAC;IACF,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;IAEvB,OAAO,GAAG,CAAC;AACb,CAAC"}
|
package/dist/app.module.js
CHANGED
|
@@ -13,8 +13,8 @@ const core_1 = require("@builder6/core");
|
|
|
13
13
|
const tables_1 = require("@builder6/tables");
|
|
14
14
|
const core_2 = require("@builder6/core");
|
|
15
15
|
const steedos_module_1 = require("./steedos/steedos.module");
|
|
16
|
-
const
|
|
17
|
-
const
|
|
16
|
+
const rooms_1 = require("@builder6/rooms");
|
|
17
|
+
const core_3 = require("@builder6/core");
|
|
18
18
|
const moleculer_1 = require("@builder6/moleculer");
|
|
19
19
|
const microsoft365_module_1 = require("./microsoft365/microsoft365.module");
|
|
20
20
|
const oidc_module_1 = require("./oidc/oidc.module");
|
|
@@ -41,8 +41,8 @@ exports.AppModule = AppModule = __decorate([
|
|
|
41
41
|
core_1.MongodbModule,
|
|
42
42
|
steedos_module_1.SteedosModule,
|
|
43
43
|
tables_1.TablesModule,
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
rooms_1.RoomsModule,
|
|
45
|
+
core_3.FilesModule,
|
|
46
46
|
microsoft365_module_1.Microsoft365Module,
|
|
47
47
|
email_1.EmailModule,
|
|
48
48
|
plugin_module_1.PluginModule.forRoot(),
|
package/dist/app.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,2CAA8C;AAE9C,yCAA+C;AAC/C,6CAAgD;AAChD,yCAA4C;AAC5C,6DAAyD;AACzD,
|
|
1
|
+
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,2CAA8C;AAE9C,yCAA+C;AAC/C,6CAAgD;AAChD,yCAA4C;AAC5C,6DAAyD;AACzD,2CAA8C;AAC9C,yCAA6C;AAC7C,mDAAsD;AACtD,4EAAwE;AACxE,oDAAgD;AAChD,qDAAiD;AACjD,0DAAsD;AACtD,2CAA8C;AAC9C,6CAAqC;AA6B9B,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,8BAAS;oBAAT,SAAS;IA3BrB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,qBAAY,CAAC,OAAO,CAAC;gBACnB,WAAW,EAAE,CAAC,YAAY,EAAE,MAAM,CAAC;gBACnC,IAAI,EAAE,CAAC,oBAAS,CAAC;gBACjB,QAAQ,EAAE,IAAI;aACf,CAAC;YACF,2BAAe,CAAC,OAAO,CAAC;gBAEpB,SAAS,EAAE,SAAS;gBACpB,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc;aAE1C,CAAC;YACF,iBAAU;YACV,oBAAa;YACb,8BAAa;YACb,qBAAY;YACZ,mBAAW;YACX,kBAAW;YACX,wCAAkB;YAClB,mBAAW;YACX,4BAAY,CAAC,OAAO,EAAE;YACtB,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,wBAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;SACrD;QACD,WAAW,EAAE,CAAC,8BAAa,CAAC;QAC5B,SAAS,EAAE,EAAE;KACd,CAAC;GACW,SAAS,CAAG"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,23 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
3
|
exports.app = void 0;
|
|
18
4
|
const core_1 = require("@nestjs/core");
|
|
19
5
|
const app_module_1 = require("./app.module");
|
|
20
|
-
__exportStar(require("./files"), exports);
|
|
21
6
|
async function bootstrap() {
|
|
22
7
|
exports.app = await core_1.NestFactory.createApplicationContext(app_module_1.AppModule);
|
|
23
8
|
await exports.app.close();
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,uCAA2C;AAE3C,6CAAyC;AAKzC,KAAK,UAAU,SAAS;IACtB,WAAG,GAAG,MAAM,kBAAW,CAAC,wBAAwB,CAAC,sBAAS,CAAC,CAAC;IAC5D,MAAM,WAAG,CAAC,KAAK,EAAE,CAAC;AACpB,CAAC;AAED,SAAS,EAAE,CAAC"}
|
|
@@ -21,7 +21,7 @@ let OidcService = class OidcService {
|
|
|
21
21
|
configUrl: process.env.B6_OIDC_CONFIG_URL,
|
|
22
22
|
client_id: process.env.B6_OIDC_CLIENT_ID,
|
|
23
23
|
client_secret: process.env.B6_OIDC_CLIENT_SECRET,
|
|
24
|
-
redirect_uri: `${process.env.ROOT_URL}/api/v6/oidc/${providerId}/callback`,
|
|
24
|
+
redirect_uri: `${process.env.ROOT_URL}/api/v6/oidc/${providerId}/login/callback`,
|
|
25
25
|
scope: process.env.B6_OIDC_CLIENT_SCOPE || 'openid email profile',
|
|
26
26
|
state,
|
|
27
27
|
nonce,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oidc.service.js","sourceRoot":"","sources":["../../src/oidc/oidc.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAC5C,iDAA2C;AAGpC,IAAM,WAAW,GAAjB,MAAM,WAAW;IACtB,KAAK,CAAC,iBAAiB,CAAC,UAAkB;QACxC,MAAM,qBAAqB,GAAG,MAAM,CAAC;QACrC,MAAM,aAAa,GAAG,0BAAU,CAAC,YAAY,EAAE,CAAC;QAChD,MAAM,cAAc,GAAG,0BAAU,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;QAC/D,MAAM,KAAK,GAAG,0BAAU,CAAC,MAAM,EAAE,CAAC;QAClC,MAAM,KAAK,GAAG,0BAAU,CAAC,MAAM,EAAE,CAAC;QAGlC,OAAO;YACL,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc;YAClC,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB;YACzC,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB;YACxC,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,qBAAqB;YAChD,YAAY,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,gBAAgB,UAAU,
|
|
1
|
+
{"version":3,"file":"oidc.service.js","sourceRoot":"","sources":["../../src/oidc/oidc.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA4C;AAC5C,iDAA2C;AAGpC,IAAM,WAAW,GAAjB,MAAM,WAAW;IACtB,KAAK,CAAC,iBAAiB,CAAC,UAAkB;QACxC,MAAM,qBAAqB,GAAG,MAAM,CAAC;QACrC,MAAM,aAAa,GAAG,0BAAU,CAAC,YAAY,EAAE,CAAC;QAChD,MAAM,cAAc,GAAG,0BAAU,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;QAC/D,MAAM,KAAK,GAAG,0BAAU,CAAC,MAAM,EAAE,CAAC;QAClC,MAAM,KAAK,GAAG,0BAAU,CAAC,MAAM,EAAE,CAAC;QAGlC,OAAO;YACL,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,cAAc;YAClC,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB;YACzC,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB;YACxC,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,qBAAqB;YAChD,YAAY,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,gBAAgB,UAAU,iBAAiB;YAChF,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,sBAAsB;YACjE,KAAK;YACL,KAAK;YACL,qBAAqB;YACrB,aAAa;YACb,cAAc;SACf,CAAC;IACJ,CAAC;CACF,CAAA;AAvBY,kCAAW;sBAAX,WAAW;IADvB,IAAA,mBAAU,GAAE;GACA,WAAW,CAuBvB"}
|
|
@@ -63,9 +63,7 @@ PluginModule.config = (0, app_config_1.default)();
|
|
|
63
63
|
PluginModule.plugins = [];
|
|
64
64
|
exports.PluginModule = PluginModule = PluginModule_1 = __decorate([
|
|
65
65
|
(0, common_1.Module)({
|
|
66
|
-
imports: [
|
|
67
|
-
moleculer_1.MoleculerModule.forRoot({})
|
|
68
|
-
],
|
|
66
|
+
imports: [moleculer_1.MoleculerModule.forRoot({})],
|
|
69
67
|
providers: [plugin_service_1.PluginService, moleculer_service_1.MoleculerPluginService],
|
|
70
68
|
})
|
|
71
69
|
], PluginModule);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.module.js","sourceRoot":"","sources":["../../src/plugin/plugin.module.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,2CAA+D;AAC/D,yBAAyB;AACzB,6BAA6B;AAC7B,qDAAiD;AACjD,
|
|
1
|
+
{"version":3,"file":"plug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OAAO,CAAC,iBAAiB,CAAC,CAAC;QAEhD,OAAO,YAAY,CAAC,OAAO,CAAC;IAC9B,CAAC;IAED,MAAM,CAAC,cAAc,CAAC,WAAmB;QACvC,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,OAAO,CACjB,OAAO,CAAC,OAAO,CAAC,GAAG,WAAW,eAAe,EAAE;gBAC7C,KAAK,EAAE;oBACL,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,cAAc,CAAC;oBACpD,GAAG,MAAM,CAAC,KAAK;iBAChB;aACF,CAAC,CACH,CAAC;QACJ,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACjB,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;;AA5DU,oCAAY;AACP,mBAAM,GAAG,IAAI,eAAM,CAAC,cAAY,CAAC,IAAI,CAAC,AAAhC,CAAiC;AAChD,mBAAM,GAAG,IAAA,oBAAS,GAAE,AAAd,CAAe;AACd,oBAAO,GAAa,EAAE,AAAf,CAAgB;uBAH1B,YAAY;IAJxB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,2BAAe,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACtC,SAAS,EAAE,CAAC,8BAAa,EAAE,0CAAsB,CAAC;KACnD,CAAC;GACW,YAAY,CA6DxB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builder6/server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "AGPL-3.0-only",
|
|
@@ -29,12 +29,13 @@
|
|
|
29
29
|
"test:e2e": "jest --config ./test/jest-e2e.json"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@builder6/core": "^0.
|
|
33
|
-
"@builder6/email": "^0.
|
|
34
|
-
"@builder6/moleculer": "^0.
|
|
35
|
-
"@builder6/query-mongodb": "^0.
|
|
36
|
-
"@builder6/
|
|
37
|
-
"@
|
|
32
|
+
"@builder6/core": "^0.7.0",
|
|
33
|
+
"@builder6/email": "^0.7.0",
|
|
34
|
+
"@builder6/moleculer": "^0.7.0",
|
|
35
|
+
"@builder6/query-mongodb": "^0.7.0",
|
|
36
|
+
"@builder6/rooms": "^0.7.0",
|
|
37
|
+
"@builder6/tables": "^0.6.5",
|
|
38
|
+
"@nestjs/common": "^10.0.0",
|
|
38
39
|
"@nestjs/config": "^3.3.0",
|
|
39
40
|
"@nestjs/core": "^9.0.0",
|
|
40
41
|
"@nestjs/jwt": "^9.0.0",
|
|
@@ -115,5 +116,5 @@
|
|
|
115
116
|
"publishConfig": {
|
|
116
117
|
"access": "public"
|
|
117
118
|
},
|
|
118
|
-
"gitHead": "
|
|
119
|
+
"gitHead": "d30a865347a5c71f33e0c337658bae231a8d271d"
|
|
119
120
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { FilesService } from './files.service';
|
|
2
|
-
import { Response } from 'express';
|
|
3
|
-
export declare class FilesController {
|
|
4
|
-
private readonly filesService;
|
|
5
|
-
constructor(filesService: FilesService);
|
|
6
|
-
uploadFile(collectionName: string, file: Express.Multer.File): Promise<object>;
|
|
7
|
-
downloadFile(collectionName: string, fileId: string, fileName: string, res: Response): Promise<void>;
|
|
8
|
-
presignedUrls(collectionName: string, records: string[]): Promise<{
|
|
9
|
-
urls: string[];
|
|
10
|
-
}>;
|
|
11
|
-
}
|
|
@@ -1,148 +0,0 @@
|
|
|
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.FilesController = void 0;
|
|
16
|
-
const common_1 = require("@nestjs/common");
|
|
17
|
-
const platform_express_1 = require("@nestjs/platform-express");
|
|
18
|
-
const files_service_1 = require("./files.service");
|
|
19
|
-
const swagger_1 = require("@nestjs/swagger");
|
|
20
|
-
let FilesController = class FilesController {
|
|
21
|
-
constructor(filesService) {
|
|
22
|
-
this.filesService = filesService;
|
|
23
|
-
}
|
|
24
|
-
async uploadFile(collectionName, file) {
|
|
25
|
-
if (!file) {
|
|
26
|
-
throw new Error('未找到上传的文件');
|
|
27
|
-
}
|
|
28
|
-
const fileRecord = await this.filesService.uploadFile(collectionName, file, {});
|
|
29
|
-
return fileRecord;
|
|
30
|
-
}
|
|
31
|
-
async downloadFile(collectionName, fileId, fileName, res) {
|
|
32
|
-
try {
|
|
33
|
-
if (this.filesService.cfsStore === 'S3') {
|
|
34
|
-
const s3SignedUrl = await this.filesService.getPreSignedUrl(collectionName, fileId);
|
|
35
|
-
if (s3SignedUrl) {
|
|
36
|
-
return res.redirect(s3SignedUrl);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
const fileStream = await this.filesService.downloadFileStream(collectionName, fileId);
|
|
40
|
-
fileStream.pipe(res).on('error', () => {
|
|
41
|
-
throw new common_1.HttpException('文件下载失败', common_1.HttpStatus.INTERNAL_SERVER_ERROR);
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
catch (error) {
|
|
45
|
-
throw new common_1.HttpException(error.message, common_1.HttpStatus.INTERNAL_SERVER_ERROR);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
async presignedUrls(collectionName, records) {
|
|
49
|
-
const urls = await Promise.all(records.map(async (attachmentId) => {
|
|
50
|
-
return this.filesService.getPreSignedUrl(collectionName, attachmentId);
|
|
51
|
-
}));
|
|
52
|
-
return { urls };
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
exports.FilesController = FilesController;
|
|
56
|
-
__decorate([
|
|
57
|
-
(0, common_1.Post)(':collectionName'),
|
|
58
|
-
(0, swagger_1.ApiOperation)({ summary: 'Upload a file' }),
|
|
59
|
-
(0, swagger_1.ApiParam)({
|
|
60
|
-
name: 'collectionName',
|
|
61
|
-
required: true,
|
|
62
|
-
type: 'string',
|
|
63
|
-
schema: {
|
|
64
|
-
type: 'string',
|
|
65
|
-
default: 'cfs.files.filerecord',
|
|
66
|
-
},
|
|
67
|
-
}),
|
|
68
|
-
(0, swagger_1.ApiConsumes)('multipart/form-data'),
|
|
69
|
-
(0, swagger_1.ApiBody)({
|
|
70
|
-
schema: {
|
|
71
|
-
type: 'object',
|
|
72
|
-
properties: {
|
|
73
|
-
file: {
|
|
74
|
-
type: 'string',
|
|
75
|
-
format: 'binary',
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
}),
|
|
80
|
-
(0, common_1.UseInterceptors)((0, platform_express_1.FileInterceptor)('file')),
|
|
81
|
-
__param(0, (0, common_1.Param)('collectionName')),
|
|
82
|
-
__param(1, (0, common_1.UploadedFile)()),
|
|
83
|
-
__metadata("design:type", Function),
|
|
84
|
-
__metadata("design:paramtypes", [String, Object]),
|
|
85
|
-
__metadata("design:returntype", Promise)
|
|
86
|
-
], FilesController.prototype, "uploadFile", null);
|
|
87
|
-
__decorate([
|
|
88
|
-
(0, common_1.Get)(':collectionName/:fileId/:fileName?'),
|
|
89
|
-
(0, swagger_1.ApiOperation)({ summary: 'Download a file' }),
|
|
90
|
-
(0, swagger_1.ApiParam)({
|
|
91
|
-
name: 'collectionName',
|
|
92
|
-
required: true,
|
|
93
|
-
type: 'string',
|
|
94
|
-
schema: {
|
|
95
|
-
type: 'string',
|
|
96
|
-
default: 'cfs.files.filerecord',
|
|
97
|
-
},
|
|
98
|
-
}),
|
|
99
|
-
(0, swagger_1.ApiParam)({
|
|
100
|
-
name: 'fileName',
|
|
101
|
-
required: false,
|
|
102
|
-
type: 'string',
|
|
103
|
-
}),
|
|
104
|
-
__param(0, (0, common_1.Param)('collectionName')),
|
|
105
|
-
__param(1, (0, common_1.Param)('fileId')),
|
|
106
|
-
__param(2, (0, common_1.Param)('fileName')),
|
|
107
|
-
__param(3, (0, common_1.Res)()),
|
|
108
|
-
__metadata("design:type", Function),
|
|
109
|
-
__metadata("design:paramtypes", [String, String, String, Object]),
|
|
110
|
-
__metadata("design:returntype", Promise)
|
|
111
|
-
], FilesController.prototype, "downloadFile", null);
|
|
112
|
-
__decorate([
|
|
113
|
-
(0, common_1.Post)(':collectionName/presigned-urls'),
|
|
114
|
-
(0, swagger_1.ApiOperation)({ summary: 'Get presigned urls for files' }),
|
|
115
|
-
(0, swagger_1.ApiBody)({
|
|
116
|
-
schema: {
|
|
117
|
-
type: 'object',
|
|
118
|
-
description: 'Array of record id',
|
|
119
|
-
properties: {
|
|
120
|
-
records: {
|
|
121
|
-
type: 'array',
|
|
122
|
-
items: {
|
|
123
|
-
type: 'string',
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
}),
|
|
129
|
-
(0, swagger_1.ApiParam)({
|
|
130
|
-
name: 'collectionName',
|
|
131
|
-
required: true,
|
|
132
|
-
type: 'string',
|
|
133
|
-
schema: {
|
|
134
|
-
type: 'string',
|
|
135
|
-
default: 'cfs.files.filerecord',
|
|
136
|
-
},
|
|
137
|
-
}),
|
|
138
|
-
__param(0, (0, common_1.Param)('collectionName')),
|
|
139
|
-
__param(1, (0, common_1.Body)('records')),
|
|
140
|
-
__metadata("design:type", Function),
|
|
141
|
-
__metadata("design:paramtypes", [String, Array]),
|
|
142
|
-
__metadata("design:returntype", Promise)
|
|
143
|
-
], FilesController.prototype, "presignedUrls", null);
|
|
144
|
-
exports.FilesController = FilesController = __decorate([
|
|
145
|
-
(0, common_1.Controller)('api/v6/files/'),
|
|
146
|
-
__metadata("design:paramtypes", [files_service_1.FilesService])
|
|
147
|
-
], FilesController);
|
|
148
|
-
//# sourceMappingURL=files.controller.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"files.controller.js","sourceRoot":"","sources":["../../src/files/files.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAWwB;AACxB,+DAA2D;AAC3D,mDAA+C;AAE/C,6CAA+E;AAGxE,IAAM,eAAe,GAArB,MAAM,eAAe;IAC1B,YAA6B,YAA0B;QAA1B,iBAAY,GAAZ,YAAY,CAAc;IAAG,CAAC;IA0BrD,AAAN,KAAK,CAAC,UAAU,CACW,cAAsB,EAC/B,IAAyB;QAEzC,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC;QAC9B,CAAC;QACD,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,UAAU,CACnD,cAAc,EACd,IAAI,EACJ,EAAE,CACH,CAAC;QACF,OAAO,UAAU,CAAC;IACpB,CAAC;IAkBK,AAAN,KAAK,CAAC,YAAY,CACS,cAAsB,EAC9B,MAAc,EACZ,QAAgB,EAC5B,GAAa;QAEpB,IAAI,CAAC;YAEH,IAAI,IAAI,CAAC,YAAY,CAAC,QAAQ,KAAK,IAAI,EAAE,CAAC;gBACxC,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,eAAe,C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;oBACb,KAAK,EAAE;wBACL,IAAI,EAAE,QAAQ;qBACf;iBACF;aACF;SACF;KACF,CAAC;IACD,IAAA,kBAAQ,EAAC;QACR,IAAI,EAAE,gBAAgB;QACtB,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,sBAAsB;SAChC;KACF,CAAC;IAEC,WAAA,IAAA,cAAK,EAAC,gBAAgB,CAAC,CAAA;IACvB,WAAA,IAAA,aAAI,EAAC,SAAS,CAAC,CAAA;;;;oDAQjB;0BAlIU,eAAe;IAD3B,IAAA,mBAAU,EAAC,eAAe,CAAC;qCAEiB,4BAAY;GAD5C,eAAe,CAmI3B"}
|
|
@@ -1,26 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.FilesModule = void 0;
|
|
10
|
-
const common_1 = require("@nestjs/common");
|
|
11
|
-
const files_controller_1 = require("./files.controller");
|
|
12
|
-
const files_service_1 = require("./files.service");
|
|
13
|
-
const core_1 = require("@builder6/core");
|
|
14
|
-
const files_moleculer_1 = require("./files.moleculer");
|
|
15
|
-
let FilesModule = class FilesModule {
|
|
16
|
-
};
|
|
17
|
-
exports.FilesModule = FilesModule;
|
|
18
|
-
exports.FilesModule = FilesModule = __decorate([
|
|
19
|
-
(0, common_1.Module)({
|
|
20
|
-
imports: [core_1.MongodbModule],
|
|
21
|
-
controllers: [files_controller_1.FilesController],
|
|
22
|
-
providers: [files_service_1.FilesService, files_moleculer_1.FilesMoleculer],
|
|
23
|
-
exports: [files_service_1.FilesService],
|
|
24
|
-
})
|
|
25
|
-
], FilesModule);
|
|
26
|
-
//# sourceMappingURL=files.module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"files.module.js","sourceRoot":"","sources":["../../src/files/files.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,yDAAqD;AACrD,mDAA+C;AAC/C,yCAA+C;AAC/C,uDAAmD;AAQ5C,IAAM,WAAW,GAAjB,MAAM,WAAW;CAAG,CAAA;AAAd,kCAAW;sBAAX,WAAW;IANvB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,oBAAa,CAAC;QACxB,WAAW,EAAE,CAAC,kCAAe,CAAC;QAC9B,SAAS,EAAE,CAAC,4BAAY,EAAE,gCAAc,CAAC;QACzC,OAAO,EAAE,CAAC,4BAAY,CAAC;KACxB,CAAC;GACW,WAAW,CAAG"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Service, Context, ServiceBroker } from 'moleculer';
|
|
2
|
-
import { FilesService } from './files.service';
|
|
3
|
-
export declare class FilesMoleculer extends Service {
|
|
4
|
-
private filesService;
|
|
5
|
-
constructor(broker: ServiceBroker, filesService: FilesService);
|
|
6
|
-
serviceCreated(): void;
|
|
7
|
-
serviceStarted(): Promise<void>;
|
|
8
|
-
serviceStopped(): Promise<void>;
|
|
9
|
-
getPreSignedUrl(ctx: Context): Promise<string>;
|
|
10
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
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.FilesMoleculer = void 0;
|
|
16
|
-
const moleculer_1 = require("moleculer");
|
|
17
|
-
const common_1 = require("@nestjs/common");
|
|
18
|
-
const moleculer_2 = require("@builder6/moleculer");
|
|
19
|
-
const files_service_1 = require("./files.service");
|
|
20
|
-
let FilesMoleculer = class FilesMoleculer extends moleculer_1.Service {
|
|
21
|
-
constructor(broker, filesService) {
|
|
22
|
-
super(broker);
|
|
23
|
-
this.filesService = filesService;
|
|
24
|
-
this.parseServiceSchema({
|
|
25
|
-
name: "@builder6/files",
|
|
26
|
-
settings: {},
|
|
27
|
-
actions: {
|
|
28
|
-
getPreSignedUrl: this.getPreSignedUrl,
|
|
29
|
-
},
|
|
30
|
-
created: this.serviceCreated,
|
|
31
|
-
started: this.serviceStarted,
|
|
32
|
-
stopped: this.serviceStopped,
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
serviceCreated() {
|
|
36
|
-
}
|
|
37
|
-
async serviceStarted() {
|
|
38
|
-
}
|
|
39
|
-
async serviceStopped() {
|
|
40
|
-
}
|
|
41
|
-
async getPreSignedUrl(ctx) {
|
|
42
|
-
const { collectionName, fileId } = ctx.params;
|
|
43
|
-
return this.filesService.getPreSignedUrl(collectionName, fileId);
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
exports.FilesMoleculer = FilesMoleculer;
|
|
47
|
-
exports.FilesMoleculer = FilesMoleculer = __decorate([
|
|
48
|
-
(0, common_1.Injectable)(),
|
|
49
|
-
__param(0, (0, moleculer_2.InjectBroker)()),
|
|
50
|
-
__metadata("design:paramtypes", [moleculer_1.ServiceBroker,
|
|
51
|
-
files_service_1.FilesService])
|
|
52
|
-
], FilesMoleculer);
|
|
53
|
-
//# sourceMappingURL=files.moleculer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"files.moleculer.js","sourceRoot":"","sources":["../../src/files/files.moleculer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,yCAA4D;AAC5D,2CAAoD;AACpD,mDAAmD;AACnD,mDAA+C;AAGxC,IAAM,cAAc,GAApB,MAAM,cAAe,SAAQ,mBAAO;IACvC,YAA4B,MAAqB,EACrC,YAA0B;QAElC,KAAK,CAAC,MAAM,CAAC,CAAC;QAFN,iBAAY,GAAZ,YAAY,CAAc;QAIlC,IAAI,CAAC,kBAAkB,CAAC;YACpB,IAAI,EAAE,iBAAiB;YACvB,QAAQ,EAAE,EACT;YACD,OAAO,EAAE;gBACL,eAAe,EAAE,IAAI,CAAC,eAAe;aACxC;YACD,OAAO,EAAE,IAAI,CAAC,cAAc;YAC5B,OAAO,EAAE,IAAI,CAAC,cAAc;YAC5B,OAAO,EAAE,IAAI,CAAC,cAAc;SAC/B,CAAC,CAAC;IACP,CAAC;IAED,cAAc;IACd,CAAC;IAED,KAAK,CAAC,cAAc;IACpB,CAAC;IAED,KAAK,CAAC,cAAc;IACpB,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,GAAY;QAC9B,MAAM,EAAC,cAAc,EAAE,MAAM,EAAC,GAAG,GAAG,CAAC,MAAa,CAAC;QAEnD,OAAO,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;IACrE,CAAC;CACJ,CAAA;AAjCY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;IAEI,WAAA,IAAA,wBAAY,GAAE,CAAA;qCAAS,yBAAa;QACvB,4BAAY;GAF7B,cAAc,CAiC1B"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { MongodbService } from '@builder6/core';
|
|
2
|
-
import stream from 'stream';
|
|
3
|
-
import { ConfigService } from '@nestjs/config';
|
|
4
|
-
export declare class FilesService {
|
|
5
|
-
private configService;
|
|
6
|
-
private mongodbService;
|
|
7
|
-
private s3;
|
|
8
|
-
cfsStore: string;
|
|
9
|
-
storageDir: string;
|
|
10
|
-
s3Bucket: string;
|
|
11
|
-
rootUrl: string;
|
|
12
|
-
constructor(configService: ConfigService, mongodbService: MongodbService);
|
|
13
|
-
getCollectionFolderName(collectionName: any): string;
|
|
14
|
-
uploadFile(collectionName: string, file: {
|
|
15
|
-
buffer: Buffer;
|
|
16
|
-
originalname: string;
|
|
17
|
-
size: number;
|
|
18
|
-
mimetype?: string;
|
|
19
|
-
}, metadata: {
|
|
20
|
-
_id?: string;
|
|
21
|
-
userId?: string;
|
|
22
|
-
spaceId?: string;
|
|
23
|
-
objectName?: string;
|
|
24
|
-
recordId?: string;
|
|
25
|
-
parentId?: string;
|
|
26
|
-
}): Promise<object>;
|
|
27
|
-
getFile(collectionName: string, fileId: string): Promise<any>;
|
|
28
|
-
getPreSignedUrl(collectionName: string, fileId: string): Promise<string | null>;
|
|
29
|
-
downloadFileStream(collectionName: string, fileId: string): Promise<stream.Readable>;
|
|
30
|
-
}
|