@fecommunity/reactpress-server 1.0.0-beta.11 → 1.0.0-beta.12

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.
@@ -4221,6 +4221,11 @@
4221
4221
  "signature": "003f07cf566395059625b39785398f18652c8952e19790e7d6eeb22a9cbe0440",
4222
4222
  "affectsGlobalScope": false
4223
4223
  },
4224
+ "../../node_modules/.pnpm/open@8.4.2/node_modules/open/index.d.ts": {
4225
+ "version": "ac0e45806dfb87684696b8a268697c8e789c50e29fd285fec047830e773f9832",
4226
+ "signature": "ac0e45806dfb87684696b8a268697c8e789c50e29fd285fec047830e773f9832",
4227
+ "affectsGlobalScope": false
4228
+ },
4224
4229
  "../../node_modules/.pnpm/log4js@6.9.1/node_modules/log4js/types/log4js.d.ts": {
4225
4230
  "version": "07eaba6c381ae3c3f513d61a39adc62373fa538f5f2e3852abbc7505f45e44b6",
4226
4231
  "signature": "07eaba6c381ae3c3f513d61a39adc62373fa538f5f2e3852abbc7505f45e44b6",
@@ -4761,16 +4766,6 @@
4761
4766
  "signature": "636d49fbd8a3b4f22bec1ceefa3bcf9244dddcf29eeedfdfd586a134789bdd56",
4762
4767
  "affectsGlobalScope": false
4763
4768
  },
4764
- "../src/bootstrap.ts": {
4765
- "version": "fa87cadf6f2109588fc0b52897eaf3dc64af56bfad1f529db78ce8bb21a1c01e",
4766
- "signature": "c1d713edafcfe3e52a4cc402f2e8800ba460f52ab5f4e85ecfe7e8c1b650dc7d",
4767
- "affectsGlobalScope": false
4768
- },
4769
- "../../node_modules/.pnpm/open@8.4.2/node_modules/open/index.d.ts": {
4770
- "version": "ac0e45806dfb87684696b8a268697c8e789c50e29fd285fec047830e773f9832",
4771
- "signature": "ac0e45806dfb87684696b8a268697c8e789c50e29fd285fec047830e773f9832",
4772
- "affectsGlobalScope": false
4773
- },
4774
4769
  "../src/main.ts": {
4775
4770
  "version": "2b22636e7b227b9264a3024511631e0625c03bfff744e411326f0ebc8b66c4f6",
4776
4771
  "signature": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881",
@@ -4836,9 +4831,9 @@
4836
4831
  "signature": "24bd01a91f187b22456c7171c07dbf44f3ad57ebd50735aab5c13fa23d7114b4",
4837
4832
  "affectsGlobalScope": false
4838
4833
  },
4839
- "../../node_modules/.pnpm/buffer@6.0.3/node_modules/buffer/index.d.ts": {
4840
- "version": "4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188",
4841
- "signature": "4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188",
4834
+ "../../node_modules/.pnpm/buffer@5.7.1/node_modules/buffer/index.d.ts": {
4835
+ "version": "8e9c23ba78aabc2e0a27033f18737a6df754067731e69dc5f52823957d60a4b6",
4836
+ "signature": "8e9c23ba78aabc2e0a27033f18737a6df754067731e69dc5f52823957d60a4b6",
4842
4837
  "affectsGlobalScope": false
4843
4838
  },
4844
4839
  "../../node_modules/.pnpm/@types+superagent@8.1.9/node_modules/@types/superagent/lib/request-base.d.ts": {
@@ -6540,7 +6535,7 @@
6540
6535
  "../../node_modules/.pnpm/axios@0.23.0/node_modules/axios/index.d.ts": [
6541
6536
  "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/typings.d.ts"
6542
6537
  ],
6543
- "../../node_modules/.pnpm/buffer@6.0.3/node_modules/buffer/index.d.ts": [
6538
+ "../../node_modules/.pnpm/buffer@5.7.1/node_modules/buffer/index.d.ts": [
6544
6539
  "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/typings.d.ts"
6545
6540
  ],
6546
6541
  "../../node_modules/.pnpm/class-transformer@0.2.3/node_modules/class-transformer/classtransformer.d.ts": [
@@ -9741,16 +9736,6 @@
9741
9736
  "../src/modules/view/view.entity.ts",
9742
9737
  "../src/modules/view/view.module.ts"
9743
9738
  ],
9744
- "../src/bootstrap.ts": [
9745
- "../../node_modules/.pnpm/@nestjs+core@6.11.11_@nestjs+common@6.11.11_reflect-metadata@0.1.14_rxjs@6.6.7__encodin_bd967b2290cd06c255f4246a7c6b6978/node_modules/@nestjs/core/index.d.ts",
9746
- "../../node_modules/.pnpm/@nestjs+swagger@4.8.2_@nestjs+common@6.11.11_reflect-metadata@0.1.14_rxjs@6.6.7__@nestj_c3362467100c8f1dffaacb0485638c6c/node_modules/@nestjs/swagger/index.d.ts",
9747
- "../../node_modules/.pnpm/@types+express@4.17.18/node_modules/@types/express/index.d.ts",
9748
- "../../node_modules/.pnpm/@types+node@12.20.55/node_modules/@types/node/path.d.ts",
9749
- "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/typings.d.ts",
9750
- "../src/app.module.ts",
9751
- "../src/filters/http-exception.filter.ts",
9752
- "../src/interceptors/transform.interceptor.ts"
9753
- ],
9754
9739
  "../src/filters/http-exception.filter.ts": [
9755
9740
  "../../node_modules/.pnpm/@nestjs+common@6.11.11_reflect-metadata@0.1.14_rxjs@6.6.7/node_modules/@nestjs/common/index.d.ts",
9756
9741
  "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/typings.d.ts",
@@ -11975,7 +11960,7 @@
11975
11960
  "../../node_modules/.pnpm/axios@0.23.0/node_modules/axios/index.d.ts": [
11976
11961
  "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/typings.d.ts"
11977
11962
  ],
11978
- "../../node_modules/.pnpm/buffer@6.0.3/node_modules/buffer/index.d.ts": [
11963
+ "../../node_modules/.pnpm/buffer@5.7.1/node_modules/buffer/index.d.ts": [
11979
11964
  "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/typings.d.ts"
11980
11965
  ],
11981
11966
  "../../node_modules/.pnpm/class-transformer@0.2.3/node_modules/class-transformer/classtransformer.d.ts": [
@@ -15144,9 +15129,6 @@
15144
15129
  "../../node_modules/.pnpm/typescript@4.1.6/node_modules/typescript/lib/lib.webworker.importscripts.d.ts": [
15145
15130
  "../../node_modules/.pnpm/date-fns@2.30.0/node_modules/date-fns/typings.d.ts"
15146
15131
  ],
15147
- "../src/bootstrap.ts": [
15148
- "../../node_modules/.pnpm/@nestjs+common@6.11.11_reflect-metadata@0.1.14_rxjs@6.6.7/node_modules/@nestjs/common/index.d.ts"
15149
- ],
15150
15132
  "../src/filters/http-exception.filter.ts": [
15151
15133
  "../../node_modules/.pnpm/@nestjs+common@6.11.11_reflect-metadata@0.1.14_rxjs@6.6.7/node_modules/@nestjs/common/index.d.ts"
15152
15134
  ],
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@fecommunity/reactpress-server",
3
- "version": "1.0.0-beta.11",
3
+ "version": "1.0.0-beta.12",
4
4
  "description": "ReactPress Server - NestJS-based backend API for ReactPress CMS",
5
5
  "author": "fecommunity",
6
6
  "license": "MIT",
7
7
  "main": "dist/main.js",
8
8
  "types": "dist/index.d.ts",
9
9
  "bin": {
10
- "@fecommunity/reactpress-server": "./bin/reactpress-server.js"
10
+ "reactpress-server": "./bin/reactpress-server.js"
11
11
  },
12
12
  "files": [
13
13
  "dist/**/*",
@@ -27,7 +27,7 @@
27
27
  ],
28
28
  "repository": {
29
29
  "type": "git",
30
- "url": "https://github.com/fecommunity/reactpress.git",
30
+ "url": "git+https://github.com/fecommunity/reactpress.git",
31
31
  "directory": "server"
32
32
  },
33
33
  "engines": {
@@ -97,7 +97,8 @@
97
97
  "swagger-ui-express": "^4.1.6",
98
98
  "typeorm": "^0.2.22",
99
99
  "ua-parser-js": "^0.7.28",
100
- "open": "^8.2.1"
100
+ "open": "^8.2.1",
101
+ "express": "^4.18.2"
101
102
  },
102
103
  "devDependencies": {
103
104
  "@nestjs/cli": "^6.9.0",
@@ -1,10 +0,0 @@
1
- interface BootstrapOptions {
2
- port?: number;
3
- apiPrefix?: string;
4
- enableSwagger?: boolean;
5
- enableCors?: boolean;
6
- staticPath?: string;
7
- openBrowser?: boolean;
8
- }
9
- export declare function bootstrap(options?: BootstrapOptions): Promise<import("@nestjs/common").INestApplication>;
10
- export {};
package/dist/bootstrap.js DELETED
@@ -1,57 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.bootstrap = void 0;
4
- const core_1 = require("@nestjs/core");
5
- const swagger_1 = require("@nestjs/swagger");
6
- const bodyParser = require("body-parser");
7
- const compression = require("compression");
8
- const express = require("express");
9
- const rateLimit = require("express-rate-limit");
10
- const helmet = require("helmet");
11
- const path_1 = require("path");
12
- const app_module_1 = require("./app.module");
13
- const http_exception_filter_1 = require("./filters/http-exception.filter");
14
- const transform_interceptor_1 = require("./interceptors/transform.interceptor");
15
- async function bootstrap(options = {}) {
16
- const app = await core_1.NestFactory.create(app_module_1.AppModule);
17
- const configService = app.get('ConfigService');
18
- const { port = configService.get('SERVER_PORT', 3002), apiPrefix = configService.get('SERVER_API_PREFIX', '/api'), enableSwagger = true, enableCors = true, staticPath = path_1.join(__dirname, '../public'), openBrowser = false } = options;
19
- if (enableCors) {
20
- app.enableCors();
21
- }
22
- app.setGlobalPrefix(apiPrefix);
23
- app.use(rateLimit({
24
- windowMs: 60 * 1000,
25
- max: 10000,
26
- }));
27
- app.use('/public', express.static(staticPath));
28
- app.use(compression());
29
- app.use(helmet());
30
- app.useGlobalInterceptors(new transform_interceptor_1.TransformInterceptor());
31
- app.useGlobalFilters(new http_exception_filter_1.HttpExceptionFilter());
32
- app.use(bodyParser.json({ limit: '10mb' }));
33
- app.use(bodyParser.urlencoded({ limit: '10mb', extended: true }));
34
- if (enableSwagger) {
35
- const swaggerConfig = new swagger_1.DocumentBuilder()
36
- .setTitle('ReactPress Open Api')
37
- .setDescription('ReactPress Open Api Document')
38
- .setVersion('1.0')
39
- .build();
40
- const document = swagger_1.SwaggerModule.createDocument(app, swaggerConfig);
41
- swagger_1.SwaggerModule.setup('api', app, document);
42
- }
43
- await app.listen(port);
44
- if (openBrowser) {
45
- try {
46
- const open = require('open');
47
- await open(`http://localhost:${port}${apiPrefix}`);
48
- }
49
- catch (error) {
50
- console.log(`[ReactPress] Could not open browser. Visit: http://localhost:${port}${apiPrefix}`);
51
- }
52
- }
53
- console.log(`[ReactPress] 服务启动成功 - Port: ${port}`);
54
- return app;
55
- }
56
- exports.bootstrap = bootstrap;
57
- //# sourceMappingURL=bootstrap.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bootstrap.js","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":";;;AAAA,uCAA2C;AAC3C,6CAAiE;AACjE,0CAA0C;AAC1C,2CAA2C;AAC3C,mCAAmC;AACnC,gDAAgD;AAChD,iCAAiC;AACjC,+BAA4B;AAE5B,6CAAyC;AACzC,2EAAsE;AACtE,gFAA4E;AAWrE,KAAK,UAAU,SAAS,CAAC,UAA4B,EAAE;IAC5D,MAAM,GAAG,GAAG,MAAM,kBAAW,CAAC,MAAM,CAAC,sBAAS,CAAC,CAAC;IAChD,MAAM,aAAa,GAAG,GAAG,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAG/C,MAAM,EACJ,IAAI,GAAG,aAAa,CAAC,GAAG,CAAC,aAAa,EAAE,IAAI,CAAC,EAC7C,SAAS,GAAG,aAAa,CAAC,GAAG,CAAC,mBAAmB,EAAE,MAAM,CAAC,EAC1D,aAAa,GAAG,IAAI,EACpB,UAAU,GAAG,IAAI,EACjB,UAAU,GAAG,WAAI,CAAC,SAAS,EAAE,WAAW,CAAC,EACzC,WAAW,GAAG,KAAK,EACpB,GAAG,OAAO,CAAC;IAEZ,IAAI,UAAU,EAAE;QACd,GAAG,CAAC,UAAU,EAAE,CAAC;KAClB;IAED,GAAG,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC;IAE/B,GAAG,CAAC,GAAG,CACL,SAAS,CAAC;QACR,QAAQ,EAAE,EAAE,GAAG,IAAI;QACnB,GAAG,EAAE,KAAK;KACX,CAAC,CACH,CAAC;IAGF,GAAG,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;IAE/C,GA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