@ruiapp/rapid-core 0.10.3 → 0.10.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/index.js CHANGED
@@ -1582,6 +1582,13 @@ var bootstrapApplicationConfig = {
1582
1582
  type: "text",
1583
1583
  required: false,
1584
1584
  },
1585
+ {
1586
+ name: "target type column name",
1587
+ code: "targetTypeColumnName",
1588
+ columnName: "target_type_column_name",
1589
+ type: "text",
1590
+ required: false,
1591
+ },
1585
1592
  {
1586
1593
  name: "target id column name",
1587
1594
  code: "targetIdColumnName",
@@ -4996,7 +5003,7 @@ class RapidRequest {
4996
5003
  else if (contentType.startsWith("multipart/form-data")) {
4997
5004
  this.#body = {
4998
5005
  type: "form-data",
4999
- value: await parseFormDataBody(req),
5006
+ value: await parseFormDataBody(req, { all: true }),
5000
5007
  };
5001
5008
  }
5002
5009
  this.#bodyParsed = true;
package/dist/types.d.ts CHANGED
@@ -315,6 +315,10 @@ export interface RpdDataModelProperty {
315
315
  * 关联实体的singular code,不管 relation 为 one 或者 many 都需要设置。
316
316
  */
317
317
  targetSingularCode?: string;
318
+ /**
319
+ * 保存关联实体类型的字段名。当设置 targetTypeColumnName 时,表示关联实体类型不固定,可以关联不同类型的实体。
320
+ */
321
+ targetTypeColumnName?: string;
318
322
  /**
319
323
  * 当 relation 为 one 时,设置当前模型表中表示关联实体 id 的列名。
320
324
  * 当 relation 为 many,并且使用关联关系表保存关联信息时,设置关联关系表中表示关联实体 id 的列名。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ruiapp/rapid-core",
3
- "version": "0.10.3",
3
+ "version": "0.10.4",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -350,6 +350,13 @@ export default {
350
350
  type: "text",
351
351
  required: false,
352
352
  },
353
+ {
354
+ name: "target type column name",
355
+ code: "targetTypeColumnName",
356
+ columnName: "target_type_column_name",
357
+ type: "text",
358
+ required: false,
359
+ },
353
360
  {
354
361
  name: "target id column name",
355
362
  code: "targetIdColumnName",
@@ -1,5 +1,3 @@
1
- import type { RapidRequest } from "../request";
2
-
3
1
  export type BodyData = Record<string, string | File | (string | File)[]>;
4
2
  export type ParseBodyOptions = {
5
3
  /**
@@ -66,7 +66,7 @@ export class RapidRequest {
66
66
  } else if (contentType.startsWith("multipart/form-data")) {
67
67
  this.#body = {
68
68
  type: "form-data",
69
- value: await parseFormDataBody(req),
69
+ value: await parseFormDataBody(req, { all: true }),
70
70
  };
71
71
  }
72
72
  this.#bodyParsed = true;
package/src/types.ts CHANGED
@@ -359,6 +359,10 @@ export interface RpdDataModelProperty {
359
359
  * 关联实体的singular code,不管 relation 为 one 或者 many 都需要设置。
360
360
  */
361
361
  targetSingularCode?: string;
362
+ /**
363
+ * 保存关联实体类型的字段名。当设置 targetTypeColumnName 时,表示关联实体类型不固定,可以关联不同类型的实体。
364
+ */
365
+ targetTypeColumnName?: string;
362
366
  /**
363
367
  * 当 relation 为 one 时,设置当前模型表中表示关联实体 id 的列名。
364
368
  * 当 relation 为 many,并且使用关联关系表保存关联信息时,设置关联关系表中表示关联实体 id 的列名。