create-dp-koa 1.1.0 → 1.1.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-dp-koa",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Scaffold a DP-Koa framework project from the official template",
5
5
  "type": "module",
6
6
  "bin": {
@@ -14,7 +14,9 @@
14
14
  "node": ">=18"
15
15
  },
16
16
  "scripts": {
17
- "prepublishOnly": "node ../../scripts/sync-template.mjs"
17
+ "prepublishOnly": "node ../../scripts/sync-template.mjs",
18
+ "publish:all": "npm publish --prefix ../dp-koa-framework-libs && npm publish --prefix ../dp-koa-framework-core && npm publish",
19
+ "publish:all:otp": "npm publish --prefix ../dp-koa-framework-libs --otp=$NPM_OTP && npm publish --prefix ../dp-koa-framework-core --otp=$NPM_OTP && npm publish --otp=$NPM_OTP"
18
20
  },
19
21
  "dependencies": {
20
22
  "prompts": "^2.4.2"
@@ -65,8 +65,8 @@
65
65
  "dotenv": "^16.5.0",
66
66
  "dp-ioc2": "^1.0.1",
67
67
  "dp-mqueue": "^1.0.4",
68
- "dp-koa-framework-core": "0.1.0",
69
- "dp-koa-framework-libs": "0.1.0",
68
+ "dp-koa-framework-core": "^0.1.2",
69
+ "dp-koa-framework-libs": "^0.1.2",
70
70
  "jsonwebtoken": "^9.0.2",
71
71
  "koa": "^3.0.0",
72
72
  "koa-body": "^6.0.1",
@@ -38,6 +38,7 @@ const PRESERVE_RELATIVE_PATHS = [
38
38
  'src/controllers/demo/AnnotationDemoController.ts',
39
39
  'src/controllers/example/ExampleController.ts',
40
40
  'src/controllers/example/EnterpriseExampleController.ts',
41
+ 'src/plugins/weboffice/http/routes.ts',
41
42
  ];
42
43
 
43
44
  function shouldCopySource(absSrc, baseRoot) {
@@ -1,7 +1,4 @@
1
1
  import { DataSourceOptions } from "typeorm";
2
- import { testDataInitializer } from "@src/utils/testDataInitializer";
3
- import Router from "@src/routers";
4
- import dbEntities from "@src/entity"
5
2
  import {
6
3
  bootstrap,
7
4
  setAfterBootstrap,
@@ -22,13 +19,18 @@ import {
22
19
  annotationRegistry,
23
20
  createGracefulShutdownController,
24
21
  router,
22
+ staticMiddleware,
23
+ } from "dp-koa-framework-core";
24
+ import { testDataInitializer } from "@src/utils/testDataInitializer";
25
+ import Router from "@src/routers";
26
+ import dbEntities from "@src/entity"
27
+ import {
25
28
  collectPluginEntities,
26
29
  getEnabledPlugins,
27
30
  registerPluginRoutes,
28
31
  runAfterBootstrapHooks,
29
32
  runBeforeBootstrapHooks,
30
- staticMiddleware,
31
- } from "dp-koa-framework-core";
33
+ } from "@src/framework/plugins/registry";
32
34
  import Koa from "koa";
33
35
  import path from "path";
34
36
 
@@ -33,7 +33,7 @@ function registerUnderPrefix(router: Router, basePath: string): void {
33
33
  router.post(`${base}/files`, async (ctx) => {
34
34
  try {
35
35
  const woCtx = parseWebOfficeContext(ctx);
36
- const body = (ctx.request.body as any) || {};
36
+ const body = ((ctx.request as any).body as any) || {};
37
37
  const name = body.name || "未命名文档";
38
38
  const projectId = body.project_id != null ? Number(body.project_id) : undefined;
39
39
  const data = await service.createDocument(woCtx, name, projectId);