@ldsg/field-type 0.2.2 → 0.2.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.
@@ -2,14 +2,28 @@ import { HandlerSpecificResourceSettings } from "@ldsg/handler";
2
2
  import { ResourceDefinitionSpecificResourceSettings } from "@ldsg/resource-definition";
3
3
  import { GeneralResourceSettings } from "@ldsg/types";
4
4
  import { FieldTypeBasePlatform } from "./types/field-type-info";
5
- export declare const HANDLER_GENERAL_RESOURCE_SETTINGS: GeneralResourceSettings;
6
5
  /**
7
- * Handler Resource Settings
8
- * 此类型资源的子级处理程序资源的配置
9
- * 如无或为 undefined,则说明无需子级处理程序。
6
+ * Instantiate Resource Handler General Resource Settings
7
+ * 实例化资源处理程序普通资源配置
10
8
  */
11
- export declare const HANDLER_SPECIFIC_RESOURCE_SETTINGS: HandlerSpecificResourceSettings;
9
+ export declare const INSTANTIATE_RESOURCE_HANDLER_GENERAL_RESOURCE_SETTINGS: GeneralResourceSettings;
10
+ /**
11
+ * Instantiate Resource Handler Specific Resource Settings
12
+ * 实例化资源处理程序特殊资源配置
13
+ * 框架通过此实例化此资源
14
+ */
15
+ export declare const INSTANTIATE_RESOURCE_HANDLER_SPECIFIC_RESOURCE_SETTINGS: HandlerSpecificResourceSettings;
12
16
  export declare const RESOURCE_DEFINITION_GENERAL_RESOURCE_SETTINGS: GeneralResourceSettings;
13
17
  export declare const RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS: ResourceDefinitionSpecificResourceSettings;
14
18
  export declare const FieldTypeBasePlatformList: FieldTypeBasePlatform[];
19
+ /**
20
+ * Default Extended Handler General Resource Settings
21
+ * 默认扩展处理程序普通资源配置
22
+ */
23
+ export declare const DEFAULT_EXTENDED_HANDLER_GENERAL_RESOURCE_SETTINGS: GeneralResourceSettings;
24
+ /**
25
+ * Default Extended Handler Specific Resource Settings
26
+ * 默认扩展处理程序特殊资源配置
27
+ */
28
+ export declare const DEFAULT_EXTENDED_HANDLER_SPECIFIC_RESOURCE_SETTINGS: HandlerSpecificResourceSettings;
15
29
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,0CAA0C,EAAE,MAAM,2BAA2B,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,eAAO,MAAM,iCAAiC,EAAE,uBAG/C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kCAAkC,EAAE,+BAQ9C,CAAC;AAEJ,eAAO,MAAM,6CAA6C,EAAE,uBAClB,CAAC;AAE3C,eAAO,MAAM,8CAA8C,EAAE,0CAI1D,CAAC;AAEJ,eAAO,MAAM,yBAAyB,yBAKrC,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,0CAA0C,EAAE,MAAM,2BAA2B,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAEhE;;;GAGG;AACH,eAAO,MAAM,sDAAsD,EAAE,uBAIlE,CAAC;AAEJ;;;;GAIG;AACH,eAAO,MAAM,uDAAuD,EAAE,+BAQnE,CAAC;AAEJ,eAAO,MAAM,6CAA6C,EAAE,uBACpB,CAAC;AAEzC,eAAO,MAAM,8CAA8C,EAAE,0CAI1D,CAAC;AAEJ,eAAO,MAAM,yBAAyB,yBAKrC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kDAAkD,EAAE,uBAI9D,CAAC;AAEJ;;;GAGG;AACH,eAAO,MAAM,mDAAmD,EAAE,+BAyC/D,CAAC"}
package/dist/constants.js CHANGED
@@ -1,18 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FieldTypeBasePlatformList = exports.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS = exports.RESOURCE_DEFINITION_GENERAL_RESOURCE_SETTINGS = exports.HANDLER_SPECIFIC_RESOURCE_SETTINGS = exports.HANDLER_GENERAL_RESOURCE_SETTINGS = void 0;
3
+ exports.DEFAULT_EXTENDED_HANDLER_SPECIFIC_RESOURCE_SETTINGS = exports.DEFAULT_EXTENDED_HANDLER_GENERAL_RESOURCE_SETTINGS = exports.FieldTypeBasePlatformList = exports.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS = exports.RESOURCE_DEFINITION_GENERAL_RESOURCE_SETTINGS = exports.INSTANTIATE_RESOURCE_HANDLER_SPECIFIC_RESOURCE_SETTINGS = exports.INSTANTIATE_RESOURCE_HANDLER_GENERAL_RESOURCE_SETTINGS = void 0;
4
4
  const constants_1 = require("@ldsg/constants");
5
5
  const field_type_info_1 = require("./types/field-type-info");
6
- exports.HANDLER_GENERAL_RESOURCE_SETTINGS = {
7
- title: "字段类型类型资源处理程序",
6
+ /**
7
+ * Instantiate Resource Handler General Resource Settings
8
+ * 实例化资源处理程序普通资源配置
9
+ */
10
+ exports.INSTANTIATE_RESOURCE_HANDLER_GENERAL_RESOURCE_SETTINGS = {
11
+ title: "字段类型实例化资源处理程序",
8
12
  description: "",
9
13
  };
10
14
  /**
11
- * Handler Resource Settings
12
- * 此类型资源的子级处理程序资源的配置
13
- * 如无或为 undefined,则说明无需子级处理程序。
15
+ * Instantiate Resource Handler Specific Resource Settings
16
+ * 实例化资源处理程序特殊资源配置
17
+ * 框架通过此实例化此资源
14
18
  */
15
- exports.HANDLER_SPECIFIC_RESOURCE_SETTINGS = {
19
+ exports.INSTANTIATE_RESOURCE_HANDLER_SPECIFIC_RESOURCE_SETTINGS = {
16
20
  code: `export * from "@ldsg/field-type";`,
17
21
  dependencies: [
18
22
  {
@@ -20,7 +24,7 @@ exports.HANDLER_SPECIFIC_RESOURCE_SETTINGS = {
20
24
  },
21
25
  ],
22
26
  };
23
- exports.RESOURCE_DEFINITION_GENERAL_RESOURCE_SETTINGS = { title: "字段类型类型资源定义", description: "" };
27
+ exports.RESOURCE_DEFINITION_GENERAL_RESOURCE_SETTINGS = { title: "字段类型资源定义", description: "" };
24
28
  exports.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS = {
25
29
  kind: "field_type",
26
30
  parentKind: constants_1.ROOT_RESOURCE_KIND,
@@ -31,3 +35,56 @@ exports.FieldTypeBasePlatformList = [
31
35
  field_type_info_1.FieldTypeBasePlatform.JSON,
32
36
  field_type_info_1.FieldTypeBasePlatform.MONGOOSE,
33
37
  ];
38
+ /**
39
+ * Default Extended Handler General Resource Settings
40
+ * 默认扩展处理程序普通资源配置
41
+ */
42
+ exports.DEFAULT_EXTENDED_HANDLER_GENERAL_RESOURCE_SETTINGS = {
43
+ title: "字段类型默认扩展处理程序",
44
+ description: "",
45
+ };
46
+ /**
47
+ * Default Extended Handler Specific Resource Settings
48
+ * 默认扩展处理程序特殊资源配置
49
+ */
50
+ exports.DEFAULT_EXTENDED_HANDLER_SPECIFIC_RESOURCE_SETTINGS = {
51
+ code: `import {
52
+ FieldTypeBasePlatform,
53
+ FieldTypeResourceHandler,
54
+ } from "@ldsg/field-type";
55
+
56
+ export const handler: FieldTypeResourceHandler = (params) => {
57
+ const { fieldProperties, platform } = params;
58
+
59
+ let res;
60
+
61
+ switch (platform) {
62
+ case FieldTypeBasePlatform.COMMON: {
63
+ res = {
64
+ ...fieldProperties,
65
+ type: "string",
66
+ };
67
+
68
+ break;
69
+ }
70
+
71
+ case FieldTypeBasePlatform.GRAPHQL: {
72
+ res = "String";
73
+
74
+ break;
75
+ }
76
+
77
+ default: {
78
+ break;
79
+ }
80
+ }
81
+
82
+ return res;
83
+ };
84
+ `,
85
+ dependencies: [
86
+ {
87
+ name: "@ldsg/field-type",
88
+ },
89
+ ],
90
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ldsg/field-type",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [
@@ -15,16 +15,16 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "json-schema": "0.4.0",
18
- "@ldsg/handler": "0.2.2",
19
- "@ldsg/resource": "0.2.2",
20
- "@ldsg/resource-definition": "0.2.2"
18
+ "@ldsg/handler": "0.2.4",
19
+ "@ldsg/resource": "0.2.4",
20
+ "@ldsg/resource-definition": "0.2.4"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@types/json-schema": "^7.0.15",
24
- "@ldsg/types": "0.2.2"
24
+ "@ldsg/types": "0.2.4"
25
25
  },
26
26
  "scripts": {
27
- "build": "pnpm clean && tsc --project tsconfig.build.json",
27
+ "build": "tsc --project tsconfig.build.json",
28
28
  "clean": "rm -rf dist"
29
29
  }
30
30
  }