@ldsg/field-type 0.3.9 → 0.3.10

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.
Files changed (49) hide show
  1. package/dist/__tests__/unit.js +3 -3
  2. package/dist/constants.d.ts +4 -4
  3. package/dist/constants.d.ts.map +1 -1
  4. package/dist/constants.js +19 -16
  5. package/dist/handler.d.ts +5 -7
  6. package/dist/handler.d.ts.map +1 -1
  7. package/dist/index.d.ts +6 -6
  8. package/dist/instantiate-resource.d.ts +4 -4
  9. package/dist/instantiate-resource.js +1 -1
  10. package/dist/resource-records/array.d.ts +3 -3
  11. package/dist/resource-records/array.d.ts.map +1 -1
  12. package/dist/resource-records/array.js +15 -15
  13. package/dist/resource-records/boolean.d.ts +3 -3
  14. package/dist/resource-records/boolean.d.ts.map +1 -1
  15. package/dist/resource-records/boolean.js +16 -16
  16. package/dist/resource-records/index.d.ts +6 -6
  17. package/dist/resource-records/index.d.ts.map +1 -1
  18. package/dist/resource-records/index.js +1 -1
  19. package/dist/resource-records/mongo-id.d.ts +3 -3
  20. package/dist/resource-records/mongo-id.d.ts.map +1 -1
  21. package/dist/resource-records/mongo-id.js +17 -17
  22. package/dist/resource-records/number.d.ts +3 -3
  23. package/dist/resource-records/number.d.ts.map +1 -1
  24. package/dist/resource-records/number.js +23 -23
  25. package/dist/resource-records/object.d.ts +3 -3
  26. package/dist/resource-records/object.d.ts.map +1 -1
  27. package/dist/resource-records/object.js +15 -15
  28. package/dist/resource-records/string.d.ts +3 -3
  29. package/dist/resource-records/string.d.ts.map +1 -1
  30. package/dist/resource-records/string.js +16 -16
  31. package/dist/resource.d.ts +2 -2
  32. package/dist/resource.d.ts.map +1 -1
  33. package/dist/resource.js +6 -7
  34. package/dist/types/field-type-resource-handler.d.ts +4 -4
  35. package/dist/types/field-type-resource-handler.d.ts.map +1 -1
  36. package/dist/types/get-field-type-info.d.ts +1 -1
  37. package/dist/types/get-field-type-info.d.ts.map +1 -1
  38. package/dist/types/get-field-type.d.ts +16 -0
  39. package/dist/types/get-field-type.d.ts.map +1 -0
  40. package/dist/types/get-field-type.js +2 -0
  41. package/dist/types/index.d.ts +5 -4
  42. package/dist/types/index.d.ts.map +1 -1
  43. package/dist/types/index.js +2 -1
  44. package/dist/types/resource-extended-handler.d.ts +5 -0
  45. package/dist/types/resource-extended-handler.d.ts.map +1 -0
  46. package/dist/types/resource-extended-handler.js +2 -0
  47. package/dist/types/specific-resource-settings.d.ts +2 -2
  48. package/dist/types/specific-resource-settings.d.ts.map +1 -1
  49. package/package.json +20 -12
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const handler_1 = require("@ldsg/handler");
4
4
  const resource_1 = require("../resource");
5
5
  const resource_records_1 = require("../resource-records");
6
- test("field type", () => {
6
+ test('field type', () => {
7
7
  new handler_1.HandlerResource(resource_records_1.stringFieldTypeHandlerResourceRecord);
8
8
  const fieldTypeResource = new resource_1.FieldTypeResource(resource_records_1.stringFieldTypeResourceRecord);
9
9
  const { fieldTypeInfo } = fieldTypeResource.getFieldTypeInfo({
10
10
  fieldProperties: {
11
- max: "10",
12
- },
11
+ max: '10'
12
+ }
13
13
  });
14
14
  expect(fieldTypeInfo).toMatchSnapshot();
15
15
  });
@@ -1,7 +1,7 @@
1
- import { HandlerSpecificResourceSettings } from "@ldsg/handler";
2
- import { ResourceDefinitionSpecificResourceSettings } from "@ldsg/resource-definition";
3
- import { GeneralResourceSettings } from "@ldsg/types";
4
- import { FieldTypeBasePlatform } from "./types/field-type-info";
1
+ import { HandlerSpecificResourceSettings } from '@ldsg/handler';
2
+ import { ResourceDefinitionSpecificResourceSettings } from '@ldsg/resource-definition';
3
+ import { GeneralResourceSettings } from '@ldsg/types';
4
+ import { FieldTypeBasePlatform } from './types/field-type-info';
5
5
  /**
6
6
  * Instantiate Resource Handler General Resource Settings
7
7
  * 实例化资源处理程序普通资源配置
@@ -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;;;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"}
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,uBAGpE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,uDAAuD,EAAE,+BAOrE,CAAC;AAEF,eAAO,MAAM,6CAA6C,EAAE,uBAG3D,CAAC;AAEF,eAAO,MAAM,8CAA8C,EAAE,0CAG5D,CAAC;AAEF,eAAO,MAAM,yBAAyB,yBAKrC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,kDAAkD,EAAE,uBAGhE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mDAAmD,EAAE,+BAwCjE,CAAC"}
package/dist/constants.js CHANGED
@@ -8,8 +8,8 @@ const field_type_info_1 = require("./types/field-type-info");
8
8
  * 实例化资源处理程序普通资源配置
9
9
  */
10
10
  exports.INSTANTIATE_RESOURCE_HANDLER_GENERAL_RESOURCE_SETTINGS = {
11
- title: "字段类型实例化资源处理程序",
12
- description: "",
11
+ title: '字段类型实例化资源处理程序',
12
+ description: ''
13
13
  };
14
14
  /**
15
15
  * Instantiate Resource Handler Specific Resource Settings
@@ -20,28 +20,31 @@ exports.INSTANTIATE_RESOURCE_HANDLER_SPECIFIC_RESOURCE_SETTINGS = {
20
20
  code: `export * from "@ldsg/field-type";`,
21
21
  dependencies: [
22
22
  {
23
- name: "@ldsg/field-type",
24
- },
25
- ],
23
+ name: '@ldsg/field-type'
24
+ }
25
+ ]
26
+ };
27
+ exports.RESOURCE_DEFINITION_GENERAL_RESOURCE_SETTINGS = {
28
+ title: '字段类型资源定义',
29
+ description: ''
26
30
  };
27
- exports.RESOURCE_DEFINITION_GENERAL_RESOURCE_SETTINGS = { title: "字段类型资源定义", description: "" };
28
31
  exports.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS = {
29
- kind: "field_type",
30
- parentKind: constants_1.ROOT_RESOURCE_KIND,
32
+ kind: 'field_type',
33
+ parentKind: constants_1.ROOT_RESOURCE_KIND
31
34
  };
32
35
  exports.FieldTypeBasePlatformList = [
33
36
  field_type_info_1.FieldTypeBasePlatform.COMMON,
34
37
  field_type_info_1.FieldTypeBasePlatform.GRAPHQL,
35
38
  field_type_info_1.FieldTypeBasePlatform.JSON,
36
- field_type_info_1.FieldTypeBasePlatform.MONGOOSE,
39
+ field_type_info_1.FieldTypeBasePlatform.MONGOOSE
37
40
  ];
38
41
  /**
39
42
  * Default Extended Handler General Resource Settings
40
43
  * 默认扩展处理程序普通资源配置
41
44
  */
42
45
  exports.DEFAULT_EXTENDED_HANDLER_GENERAL_RESOURCE_SETTINGS = {
43
- title: "字段类型默认扩展处理程序",
44
- description: "",
46
+ title: '字段类型默认扩展处理程序',
47
+ description: ''
45
48
  };
46
49
  /**
47
50
  * Default Extended Handler Specific Resource Settings
@@ -50,10 +53,10 @@ exports.DEFAULT_EXTENDED_HANDLER_GENERAL_RESOURCE_SETTINGS = {
50
53
  exports.DEFAULT_EXTENDED_HANDLER_SPECIFIC_RESOURCE_SETTINGS = {
51
54
  code: `import {
52
55
  FieldTypeBasePlatform,
53
- FieldTypeResourceHandler,
56
+ FieldTypeResourceExtendedHandler,
54
57
  } from "@ldsg/field-type";
55
58
 
56
- export const handler: FieldTypeResourceHandler = (params) => {
59
+ export const handler: FieldTypeResourceExtendedHandler = (params) => {
57
60
  const { fieldProperties, platform } = params;
58
61
 
59
62
  let res;
@@ -84,7 +87,7 @@ export const handler: FieldTypeResourceHandler = (params) => {
84
87
  `,
85
88
  dependencies: [
86
89
  {
87
- name: "@ldsg/field-type",
88
- },
89
- ],
90
+ name: '@ldsg/field-type'
91
+ }
92
+ ]
90
93
  };
package/dist/handler.d.ts CHANGED
@@ -1,8 +1,6 @@
1
- import { Handler, HandlerExtendedResourceSettings } from "@ldsg/handler";
2
- import { InstantiateResourceParams, InstantiateResourceRes } from "@ldsg/resource";
3
- import { FieldTypeResource } from "./resource";
4
- import { FieldTypeSpecificResourceSettings } from "./types";
5
- export declare const handler: Handler<[
6
- InstantiateResourceParams<HandlerExtendedResourceSettings<FieldTypeSpecificResourceSettings>>
7
- ], InstantiateResourceRes<FieldTypeResource>>;
1
+ import { Handler, HandlerExtendedResourceSettings } from '@ldsg/handler';
2
+ import { InstantiateResourceParams, InstantiateResourceRes } from '@ldsg/resource';
3
+ import { FieldTypeResource } from './resource';
4
+ import { FieldTypeSpecificResourceSettings } from './types';
5
+ export declare const handler: Handler<InstantiateResourceParams<HandlerExtendedResourceSettings<FieldTypeSpecificResourceSettings>>, InstantiateResourceRes<FieldTypeResource>>;
8
6
  //# sourceMappingURL=handler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../src/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EACL,yBAAyB,EACzB,sBAAsB,EACvB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,iCAAiC,EAAE,MAAM,SAAS,CAAC;AAE5D,eAAO,MAAM,OAAO,EAAE,OAAO,CAC3B;IACE,yBAAyB,CACvB,+BAA+B,CAAC,iCAAiC,CAAC,CACnE;CACF,EACD,sBAAsB,CAAC,iBAAiB,CAAC,CACpB,CAAC"}
1
+ {"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../src/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAEnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,iCAAiC,EAAE,MAAM,SAAS,CAAC;AAE5D,eAAO,MAAM,OAAO,EAAE,OAAO,CAC3B,yBAAyB,CAAC,+BAA+B,CAAC,iCAAiC,CAAC,CAAC,EAC7F,sBAAsB,CAAC,iBAAiB,CAAC,CACpB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export * from "./constants";
2
- export * from "./handler";
3
- export * from "./instantiate-resource";
4
- export * from "./resource";
5
- export * from "./resource-records";
6
- export * from "./types";
1
+ export * from './constants';
2
+ export * from './handler';
3
+ export * from './instantiate-resource';
4
+ export * from './resource';
5
+ export * from './resource-records';
6
+ export * from './types';
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1,6 +1,6 @@
1
- import { HandlerExtendedResourceSettings } from "@ldsg/handler";
2
- import { InstantiateResource } from "@ldsg/resource";
3
- import { FieldTypeResource } from "./resource";
4
- import { FieldTypeSpecificResourceSettings } from "./types";
1
+ import { HandlerExtendedResourceSettings } from '@ldsg/handler';
2
+ import { InstantiateResource } from '@ldsg/resource';
3
+ import { FieldTypeResource } from './resource';
4
+ import { FieldTypeSpecificResourceSettings } from './types';
5
5
  export declare const instantiateResource: InstantiateResource<HandlerExtendedResourceSettings<FieldTypeSpecificResourceSettings>, FieldTypeResource>;
6
6
  //# sourceMappingURL=instantiate-resource.d.ts.map
@@ -6,7 +6,7 @@ const instantiateResource = (params) => {
6
6
  const { resourceConstructorParams } = params;
7
7
  const resource = new resource_1.FieldTypeResource(resourceConstructorParams);
8
8
  const res = {
9
- resource,
9
+ resource
10
10
  };
11
11
  return res;
12
12
  };
@@ -1,6 +1,6 @@
1
- import { HandlerExtendedResourceSettings, HandlerSpecificResourceSettings } from "@ldsg/handler";
2
- import { ResourceRecord } from "@ldsg/types";
3
- import { FieldTypeSpecificResourceSettings } from "../types";
1
+ import { HandlerExtendedResourceSettings, HandlerSpecificResourceSettings } from '@ldsg/handler';
2
+ import { ResourceRecord } from '@ldsg/types';
3
+ import { FieldTypeSpecificResourceSettings } from '../types';
4
4
  export declare const arrayFieldTypeResourceRecord: ResourceRecord<HandlerExtendedResourceSettings<FieldTypeSpecificResourceSettings>>;
5
5
  export declare const arrayFieldTypeHandlerResourceRecord: ResourceRecord<HandlerSpecificResourceSettings>;
6
6
  //# sourceMappingURL=array.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../src/resource-records/array.ts"],"names":[],"mappings":"AACA,OAAO,EACL,+BAA+B,EAC/B,+BAA+B,EAChC,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAGL,iCAAiC,EAClC,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,4BAA4B,EAAE,cAAc,CACvD,+BAA+B,CAAC,iCAAiC,CAAC,CAcnE,CAAC;AAyBF,eAAO,MAAM,mCAAmC,EAAE,cAAc,CAAC,+BAA+B,CAY7F,CAAC"}
1
+ {"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../src/resource-records/array.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,+BAA+B,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AACjG,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAGL,iCAAiC,EAClC,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,4BAA4B,EAAE,cAAc,CACvD,+BAA+B,CAAC,iCAAiC,CAAC,CAcnE,CAAC;AAyBF,eAAO,MAAM,mCAAmC,EAAE,cAAc,CAAC,+BAA+B,CAW/F,CAAC"}
@@ -5,18 +5,18 @@ const constants_1 = require("@ldsg/constants");
5
5
  const constants_2 = require("../constants");
6
6
  const types_1 = require("../types");
7
7
  exports.arrayFieldTypeResourceRecord = {
8
- id: "array-field-type",
8
+ id: 'array-field-type',
9
9
  kind: constants_2.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS.kind,
10
10
  parentId: constants_1.ROOT_RESOURCE_ID,
11
11
  settings: {
12
- title: "数组字段类型",
13
- description: "",
12
+ title: '数组字段类型',
13
+ description: '',
14
14
  fieldPropertiesSchema: {
15
- type: "object",
16
- properties: {},
15
+ type: 'object',
16
+ properties: {}
17
17
  },
18
- handlerResourceId: "array-field-type-handler",
19
- },
18
+ handlerResourceId: 'array-field-type-handler'
19
+ }
20
20
  };
21
21
  const handler = (params) => {
22
22
  const { fieldProperties, platform } = params;
@@ -25,7 +25,7 @@ const handler = (params) => {
25
25
  case types_1.FieldTypeBasePlatform.COMMON: {
26
26
  res = {
27
27
  ...fieldProperties,
28
- type: "array",
28
+ type: 'array'
29
29
  };
30
30
  break;
31
31
  }
@@ -36,14 +36,14 @@ const handler = (params) => {
36
36
  return res;
37
37
  };
38
38
  exports.arrayFieldTypeHandlerResourceRecord = {
39
- id: "array-field-type-handler",
40
- kind: "handler",
39
+ id: 'array-field-type-handler',
40
+ kind: 'handler',
41
41
  parentId: constants_1.ROOT_RESOURCE_ID,
42
42
  settings: {
43
- title: "数组字段类型处理程序",
44
- description: "",
45
- code: "",
43
+ title: '数组字段类型处理程序',
44
+ description: '',
45
+ code: '',
46
46
  dependencies: [],
47
- handler,
48
- },
47
+ handler
48
+ }
49
49
  };
@@ -1,6 +1,6 @@
1
- import { HandlerExtendedResourceSettings, HandlerSpecificResourceSettings } from "@ldsg/handler";
2
- import { ResourceRecord } from "@ldsg/types";
3
- import { FieldTypeSpecificResourceSettings } from "../types";
1
+ import { HandlerExtendedResourceSettings, HandlerSpecificResourceSettings } from '@ldsg/handler';
2
+ import { ResourceRecord } from '@ldsg/types';
3
+ import { FieldTypeSpecificResourceSettings } from '../types';
4
4
  export declare const booleanFieldTypeResourceRecord: ResourceRecord<HandlerExtendedResourceSettings<FieldTypeSpecificResourceSettings>>;
5
5
  export declare const booleanFieldTypeHandlerResourceRecord: ResourceRecord<HandlerSpecificResourceSettings>;
6
6
  //# sourceMappingURL=boolean.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"boolean.d.ts","sourceRoot":"","sources":["../../src/resource-records/boolean.ts"],"names":[],"mappings":"AACA,OAAO,EACL,+BAA+B,EAC/B,+BAA+B,EAChC,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAGL,iCAAiC,EAClC,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,8BAA8B,EAAE,cAAc,CACzD,+BAA+B,CAAC,iCAAiC,CAAC,CAcnE,CAAC;AA+BF,eAAO,MAAM,qCAAqC,EAAE,cAAc,CAAC,+BAA+B,CAY/F,CAAC"}
1
+ {"version":3,"file":"boolean.d.ts","sourceRoot":"","sources":["../../src/resource-records/boolean.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,+BAA+B,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AACjG,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAGL,iCAAiC,EAClC,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,8BAA8B,EAAE,cAAc,CACzD,+BAA+B,CAAC,iCAAiC,CAAC,CAcnE,CAAC;AA+BF,eAAO,MAAM,qCAAqC,EAAE,cAAc,CAAC,+BAA+B,CAWjG,CAAC"}
@@ -5,18 +5,18 @@ const constants_1 = require("@ldsg/constants");
5
5
  const constants_2 = require("../constants");
6
6
  const types_1 = require("../types");
7
7
  exports.booleanFieldTypeResourceRecord = {
8
- id: "boolean-field-type",
8
+ id: 'boolean-field-type',
9
9
  kind: constants_2.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS.kind,
10
10
  parentId: constants_1.ROOT_RESOURCE_ID,
11
11
  settings: {
12
- title: "布尔字段类型",
13
- description: "",
12
+ title: '布尔字段类型',
13
+ description: '',
14
14
  fieldPropertiesSchema: {
15
- type: "object",
16
- properties: {},
15
+ type: 'object',
16
+ properties: {}
17
17
  },
18
- handlerResourceId: "boolean-field-type-handler",
19
- },
18
+ handlerResourceId: 'boolean-field-type-handler'
19
+ }
20
20
  };
21
21
  const handler = (params) => {
22
22
  const { fieldProperties, platform } = params;
@@ -25,12 +25,12 @@ const handler = (params) => {
25
25
  case types_1.FieldTypeBasePlatform.COMMON: {
26
26
  res = {
27
27
  ...fieldProperties,
28
- type: "boolean",
28
+ type: 'boolean'
29
29
  };
30
30
  break;
31
31
  }
32
32
  case types_1.FieldTypeBasePlatform.GRAPHQL: {
33
- res = "Boolean";
33
+ res = 'Boolean';
34
34
  break;
35
35
  }
36
36
  default: {
@@ -40,14 +40,14 @@ const handler = (params) => {
40
40
  return res;
41
41
  };
42
42
  exports.booleanFieldTypeHandlerResourceRecord = {
43
- id: "boolean-field-type-handler",
44
- kind: "handler",
43
+ id: 'boolean-field-type-handler',
44
+ kind: 'handler',
45
45
  parentId: constants_1.ROOT_RESOURCE_ID,
46
46
  settings: {
47
- title: "布尔字段类型处理程序",
48
- description: "",
49
- code: "",
47
+ title: '布尔字段类型处理程序',
48
+ description: '',
49
+ code: '',
50
50
  dependencies: [],
51
- handler,
52
- },
51
+ handler
52
+ }
53
53
  };
@@ -1,8 +1,8 @@
1
- export * from "./array";
2
- export * from "./boolean";
3
- export * from "./mongo-id";
4
- export * from "./number";
5
- export * from "./object";
6
- export * from "./string";
1
+ export * from './array';
2
+ export * from './boolean';
3
+ export * from './mongo-id';
4
+ export * from './number';
5
+ export * from './object';
6
+ export * from './string';
7
7
  export declare const FIELD_TYPE_RELATED_RESOURCE_RECORD: (import("@ldsg/types").ResourceRecord<import("@ldsg/handler").HandlerExtendedResourceSettings<import("..").FieldTypeSpecificResourceSettings>> | import("@ldsg/types").ResourceRecord<import("@ldsg/handler").HandlerSpecificResourceSettings>)[];
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resource-records/index.ts"],"names":[],"mappings":"AAyBA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AAEzB,eAAO,MAAM,kCAAkC,mPAa9C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resource-records/index.ts"],"names":[],"mappings":"AAOA,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AAEzB,eAAO,MAAM,kCAAkC,mPAa9C,CAAC"}
@@ -39,5 +39,5 @@ exports.FIELD_TYPE_RELATED_RESOURCE_RECORD = [
39
39
  object_1.objectFieldTypeHandlerResourceRecord,
40
40
  object_1.objectFieldTypeResourceRecord,
41
41
  string_1.stringFieldTypeHandlerResourceRecord,
42
- string_1.stringFieldTypeResourceRecord,
42
+ string_1.stringFieldTypeResourceRecord
43
43
  ];
@@ -1,6 +1,6 @@
1
- import { HandlerExtendedResourceSettings, HandlerSpecificResourceSettings } from "@ldsg/handler";
2
- import { ResourceRecord } from "@ldsg/types";
3
- import { FieldTypeSpecificResourceSettings } from "../types";
1
+ import { HandlerExtendedResourceSettings, HandlerSpecificResourceSettings } from '@ldsg/handler';
2
+ import { ResourceRecord } from '@ldsg/types';
3
+ import { FieldTypeSpecificResourceSettings } from '../types';
4
4
  export declare const mongoIdFieldTypeResourceRecord: ResourceRecord<HandlerExtendedResourceSettings<FieldTypeSpecificResourceSettings>>;
5
5
  export declare const mongoIdFieldTypeHandlerResourceRecord: ResourceRecord<HandlerSpecificResourceSettings>;
6
6
  //# sourceMappingURL=mongo-id.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mongo-id.d.ts","sourceRoot":"","sources":["../../src/resource-records/mongo-id.ts"],"names":[],"mappings":"AACA,OAAO,EACL,+BAA+B,EAC/B,+BAA+B,EAChC,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C,OAAO,EAGL,iCAAiC,EAClC,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,8BAA8B,EAAE,cAAc,CACzD,+BAA+B,CAAC,iCAAiC,CAAC,CAcnE,CAAC;AAuCF,eAAO,MAAM,qCAAqC,EAAE,cAAc,CAAC,+BAA+B,CAY/F,CAAC"}
1
+ {"version":3,"file":"mongo-id.d.ts","sourceRoot":"","sources":["../../src/resource-records/mongo-id.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,+BAA+B,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AACjG,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAG7C,OAAO,EAGL,iCAAiC,EAClC,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,8BAA8B,EAAE,cAAc,CACzD,+BAA+B,CAAC,iCAAiC,CAAC,CAcnE,CAAC;AAuCF,eAAO,MAAM,qCAAqC,EAAE,cAAc,CAAC,+BAA+B,CAWjG,CAAC"}
@@ -39,18 +39,18 @@ const mongodb = __importStar(require("mongodb"));
39
39
  const constants_2 = require("../constants");
40
40
  const types_1 = require("../types");
41
41
  exports.mongoIdFieldTypeResourceRecord = {
42
- id: "mongo-id-field-type",
42
+ id: 'mongo-id-field-type',
43
43
  kind: constants_2.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS.kind,
44
44
  parentId: constants_1.ROOT_RESOURCE_ID,
45
45
  settings: {
46
- title: "MongoID字段类型",
47
- description: "",
46
+ title: 'MongoID字段类型',
47
+ description: '',
48
48
  fieldPropertiesSchema: {
49
- type: "object",
50
- properties: {},
49
+ type: 'object',
50
+ properties: {}
51
51
  },
52
- handlerResourceId: "mongo-id-field-type-handler",
53
- },
52
+ handlerResourceId: 'mongo-id-field-type-handler'
53
+ }
54
54
  };
55
55
  const handler = (params) => {
56
56
  const { fieldProperties, platform } = params;
@@ -59,17 +59,17 @@ const handler = (params) => {
59
59
  case types_1.FieldTypeBasePlatform.COMMON: {
60
60
  res = {
61
61
  ...fieldProperties,
62
- type: "mongo_id",
62
+ type: 'mongo_id'
63
63
  };
64
64
  break;
65
65
  }
66
66
  case types_1.FieldTypeBasePlatform.GRAPHQL: {
67
- res = "ID";
67
+ res = 'ID';
68
68
  break;
69
69
  }
70
70
  case types_1.FieldTypeBasePlatform.MONGOOSE: {
71
71
  res = {
72
- type: mongodb.ObjectId,
72
+ type: mongodb.ObjectId
73
73
  };
74
74
  break;
75
75
  }
@@ -80,14 +80,14 @@ const handler = (params) => {
80
80
  return res;
81
81
  };
82
82
  exports.mongoIdFieldTypeHandlerResourceRecord = {
83
- id: "mongo-id-field-type-handler",
84
- kind: "handler",
83
+ id: 'mongo-id-field-type-handler',
84
+ kind: 'handler',
85
85
  parentId: constants_1.ROOT_RESOURCE_ID,
86
86
  settings: {
87
- title: "MongoID字段类型处理程序",
88
- description: "",
89
- code: "",
87
+ title: 'MongoID字段类型处理程序',
88
+ description: '',
89
+ code: '',
90
90
  dependencies: [],
91
- handler,
92
- },
91
+ handler
92
+ }
93
93
  };
@@ -1,6 +1,6 @@
1
- import { HandlerExtendedResourceSettings, HandlerSpecificResourceSettings } from "@ldsg/handler";
2
- import { ResourceRecord } from "@ldsg/types";
3
- import { FieldTypeSpecificResourceSettings } from "../types";
1
+ import { HandlerExtendedResourceSettings, HandlerSpecificResourceSettings } from '@ldsg/handler';
2
+ import { ResourceRecord } from '@ldsg/types';
3
+ import { FieldTypeSpecificResourceSettings } from '../types';
4
4
  export declare const numberFieldTypeResourceRecord: ResourceRecord<HandlerExtendedResourceSettings<FieldTypeSpecificResourceSettings>>;
5
5
  export declare const numberFieldTypeHandlerResourceRecord: ResourceRecord<HandlerSpecificResourceSettings>;
6
6
  //# sourceMappingURL=number.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../src/resource-records/number.ts"],"names":[],"mappings":"AACA,OAAO,EACL,+BAA+B,EAC/B,+BAA+B,EAChC,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAGL,iCAAiC,EAClC,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,6BAA6B,EAAE,cAAc,CACxD,+BAA+B,CAAC,iCAAiC,CAAC,CAyBnE,CAAC;AA+BF,eAAO,MAAM,oCAAoC,EAAE,cAAc,CAAC,+BAA+B,CAY9F,CAAC"}
1
+ {"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../src/resource-records/number.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,+BAA+B,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AACjG,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAGL,iCAAiC,EAClC,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,6BAA6B,EAAE,cAAc,CACxD,+BAA+B,CAAC,iCAAiC,CAAC,CAyBnE,CAAC;AA+BF,eAAO,MAAM,oCAAoC,EAAE,cAAc,CAAC,+BAA+B,CAWhG,CAAC"}
@@ -5,29 +5,29 @@ const constants_1 = require("@ldsg/constants");
5
5
  const constants_2 = require("../constants");
6
6
  const types_1 = require("../types");
7
7
  exports.numberFieldTypeResourceRecord = {
8
- id: "number-field-type",
8
+ id: 'number-field-type',
9
9
  kind: constants_2.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS.kind,
10
10
  parentId: constants_1.ROOT_RESOURCE_ID,
11
11
  settings: {
12
- title: "数字字段类型",
13
- description: "可用来存储各种数字",
12
+ title: '数字字段类型',
13
+ description: '可用来存储各种数字',
14
14
  fieldPropertiesSchema: {
15
- type: "object",
15
+ type: 'object',
16
16
  properties: {
17
17
  max: {
18
- type: "integer",
19
- title: "最大值",
20
- description: "",
18
+ type: 'integer',
19
+ title: '最大值',
20
+ description: ''
21
21
  },
22
22
  min: {
23
- type: "integer",
24
- title: "最小值",
25
- description: "",
26
- },
27
- },
23
+ type: 'integer',
24
+ title: '最小值',
25
+ description: ''
26
+ }
27
+ }
28
28
  },
29
- handlerResourceId: "number-field-type-handler",
30
- },
29
+ handlerResourceId: 'number-field-type-handler'
30
+ }
31
31
  };
32
32
  const handler = (params) => {
33
33
  const { fieldProperties, platform } = params;
@@ -36,12 +36,12 @@ const handler = (params) => {
36
36
  case types_1.FieldTypeBasePlatform.COMMON: {
37
37
  res = {
38
38
  ...fieldProperties,
39
- type: "number",
39
+ type: 'number'
40
40
  };
41
41
  break;
42
42
  }
43
43
  case types_1.FieldTypeBasePlatform.GRAPHQL: {
44
- res = "Float";
44
+ res = 'Float';
45
45
  break;
46
46
  }
47
47
  default: {
@@ -51,14 +51,14 @@ const handler = (params) => {
51
51
  return res;
52
52
  };
53
53
  exports.numberFieldTypeHandlerResourceRecord = {
54
- id: "number-field-type-handler",
55
- kind: "handler",
54
+ id: 'number-field-type-handler',
55
+ kind: 'handler',
56
56
  parentId: constants_1.ROOT_RESOURCE_ID,
57
57
  settings: {
58
- title: "数字字段类型处理程序",
59
- description: "",
60
- code: "",
58
+ title: '数字字段类型处理程序',
59
+ description: '',
60
+ code: '',
61
61
  dependencies: [],
62
- handler,
63
- },
62
+ handler
63
+ }
64
64
  };
@@ -1,6 +1,6 @@
1
- import { HandlerExtendedResourceSettings, HandlerSpecificResourceSettings } from "@ldsg/handler";
2
- import { ResourceRecord } from "@ldsg/types";
3
- import { FieldTypeSpecificResourceSettings } from "../types";
1
+ import { HandlerExtendedResourceSettings, HandlerSpecificResourceSettings } from '@ldsg/handler';
2
+ import { ResourceRecord } from '@ldsg/types';
3
+ import { FieldTypeSpecificResourceSettings } from '../types';
4
4
  export declare const objectFieldTypeResourceRecord: ResourceRecord<HandlerExtendedResourceSettings<FieldTypeSpecificResourceSettings>>;
5
5
  export declare const objectFieldTypeHandlerResourceRecord: ResourceRecord<HandlerSpecificResourceSettings>;
6
6
  //# sourceMappingURL=object.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../src/resource-records/object.ts"],"names":[],"mappings":"AACA,OAAO,EACL,+BAA+B,EAC/B,+BAA+B,EAChC,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAGL,iCAAiC,EAClC,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,6BAA6B,EAAE,cAAc,CACxD,+BAA+B,CAAC,iCAAiC,CAAC,CAcnE,CAAC;AAyBF,eAAO,MAAM,oCAAoC,EAAE,cAAc,CAAC,+BAA+B,CAY9F,CAAC"}
1
+ {"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../src/resource-records/object.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,+BAA+B,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AACjG,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAGL,iCAAiC,EAClC,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,6BAA6B,EAAE,cAAc,CACxD,+BAA+B,CAAC,iCAAiC,CAAC,CAcnE,CAAC;AAyBF,eAAO,MAAM,oCAAoC,EAAE,cAAc,CAAC,+BAA+B,CAWhG,CAAC"}
@@ -5,18 +5,18 @@ const constants_1 = require("@ldsg/constants");
5
5
  const constants_2 = require("../constants");
6
6
  const types_1 = require("../types");
7
7
  exports.objectFieldTypeResourceRecord = {
8
- id: "object-field-type",
8
+ id: 'object-field-type',
9
9
  kind: constants_2.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS.kind,
10
10
  parentId: constants_1.ROOT_RESOURCE_ID,
11
11
  settings: {
12
- title: "对象字段类型",
13
- description: "",
12
+ title: '对象字段类型',
13
+ description: '',
14
14
  fieldPropertiesSchema: {
15
- type: "object",
16
- properties: {},
15
+ type: 'object',
16
+ properties: {}
17
17
  },
18
- handlerResourceId: "object-field-type-handler",
19
- },
18
+ handlerResourceId: 'object-field-type-handler'
19
+ }
20
20
  };
21
21
  const handler = (params) => {
22
22
  const { fieldProperties, platform } = params;
@@ -25,7 +25,7 @@ const handler = (params) => {
25
25
  case types_1.FieldTypeBasePlatform.COMMON: {
26
26
  res = {
27
27
  ...fieldProperties,
28
- type: "object",
28
+ type: 'object'
29
29
  };
30
30
  break;
31
31
  }
@@ -36,14 +36,14 @@ const handler = (params) => {
36
36
  return res;
37
37
  };
38
38
  exports.objectFieldTypeHandlerResourceRecord = {
39
- id: "object-field-type-handler",
40
- kind: "handler",
39
+ id: 'object-field-type-handler',
40
+ kind: 'handler',
41
41
  parentId: constants_1.ROOT_RESOURCE_ID,
42
42
  settings: {
43
- title: "对象字段类型处理程序",
44
- description: "",
45
- code: "",
43
+ title: '对象字段类型处理程序',
44
+ description: '',
45
+ code: '',
46
46
  dependencies: [],
47
- handler,
48
- },
47
+ handler
48
+ }
49
49
  };
@@ -1,6 +1,6 @@
1
- import { HandlerExtendedResourceSettings, HandlerSpecificResourceSettings } from "@ldsg/handler";
2
- import { ResourceRecord } from "@ldsg/types";
3
- import { FieldTypeSpecificResourceSettings } from "../types";
1
+ import { HandlerExtendedResourceSettings, HandlerSpecificResourceSettings } from '@ldsg/handler';
2
+ import { ResourceRecord } from '@ldsg/types';
3
+ import { FieldTypeSpecificResourceSettings } from '../types';
4
4
  export declare const stringFieldTypeResourceRecord: ResourceRecord<HandlerExtendedResourceSettings<FieldTypeSpecificResourceSettings>>;
5
5
  export declare const stringFieldTypeHandlerResourceRecord: ResourceRecord<HandlerSpecificResourceSettings>;
6
6
  //# sourceMappingURL=string.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../src/resource-records/string.ts"],"names":[],"mappings":"AACA,OAAO,EACL,+BAA+B,EAC/B,+BAA+B,EAChC,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAGL,iCAAiC,EAClC,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,6BAA6B,EAAE,cAAc,CACxD,+BAA+B,CAAC,iCAAiC,CAAC,CAcnE,CAAC;AA+BF,eAAO,MAAM,oCAAoC,EAAE,cAAc,CAAC,+BAA+B,CAY9F,CAAC"}
1
+ {"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../src/resource-records/string.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,+BAA+B,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AACjG,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAGL,iCAAiC,EAClC,MAAM,UAAU,CAAC;AAElB,eAAO,MAAM,6BAA6B,EAAE,cAAc,CACxD,+BAA+B,CAAC,iCAAiC,CAAC,CAcnE,CAAC;AA+BF,eAAO,MAAM,oCAAoC,EAAE,cAAc,CAAC,+BAA+B,CAWhG,CAAC"}
@@ -5,18 +5,18 @@ const constants_1 = require("@ldsg/constants");
5
5
  const constants_2 = require("../constants");
6
6
  const types_1 = require("../types");
7
7
  exports.stringFieldTypeResourceRecord = {
8
- id: "string-field-type",
8
+ id: 'string-field-type',
9
9
  kind: constants_2.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS.kind,
10
10
  parentId: constants_1.ROOT_RESOURCE_ID,
11
11
  settings: {
12
- title: "字符串字段类型",
13
- description: "",
12
+ title: '字符串字段类型',
13
+ description: '',
14
14
  fieldPropertiesSchema: {
15
- type: "object",
16
- properties: {},
15
+ type: 'object',
16
+ properties: {}
17
17
  },
18
- handlerResourceId: "string-field-type-handler",
19
- },
18
+ handlerResourceId: 'string-field-type-handler'
19
+ }
20
20
  };
21
21
  const handler = (params) => {
22
22
  const { fieldProperties, platform } = params;
@@ -25,12 +25,12 @@ const handler = (params) => {
25
25
  case types_1.FieldTypeBasePlatform.COMMON: {
26
26
  res = {
27
27
  ...fieldProperties,
28
- type: "string",
28
+ type: 'string'
29
29
  };
30
30
  break;
31
31
  }
32
32
  case types_1.FieldTypeBasePlatform.GRAPHQL: {
33
- res = "String";
33
+ res = 'String';
34
34
  break;
35
35
  }
36
36
  default: {
@@ -40,14 +40,14 @@ const handler = (params) => {
40
40
  return res;
41
41
  };
42
42
  exports.stringFieldTypeHandlerResourceRecord = {
43
- id: "string-field-type-handler",
44
- kind: "handler",
43
+ id: 'string-field-type-handler',
44
+ kind: 'handler',
45
45
  parentId: constants_1.ROOT_RESOURCE_ID,
46
46
  settings: {
47
- title: "字符串字段类型处理程序",
48
- description: "",
49
- code: "",
47
+ title: '字符串字段类型处理程序',
48
+ description: '',
49
+ code: '',
50
50
  dependencies: [],
51
- handler,
52
- },
51
+ handler
52
+ }
53
53
  };
@@ -1,5 +1,5 @@
1
- import { HandlerExtendedResource } from "@ldsg/handler";
2
- import { FieldTypeSpecificResourceSettings, GetFieldTypeInfo } from "./types";
1
+ import { HandlerExtendedResource } from '@ldsg/handler';
2
+ import { FieldTypeSpecificResourceSettings, GetFieldTypeInfo } from './types';
3
3
  export declare class FieldTypeResource extends HandlerExtendedResource<FieldTypeSpecificResourceSettings> {
4
4
  getFieldTypeInfo: GetFieldTypeInfo;
5
5
  }
@@ -1 +1 @@
1
- {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAExD,OAAO,EAEL,iCAAiC,EACjC,gBAAgB,EAGjB,MAAM,SAAS,CAAC;AAGjB,qBAAa,iBAAkB,SAAQ,uBAAuB,CAAC,iCAAiC,CAAC;IAC/F,gBAAgB,EAAE,gBAAgB,CAmChC;CACH"}
1
+ {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAExD,OAAO,EAEL,iCAAiC,EAEjC,gBAAgB,EAGjB,MAAM,SAAS,CAAC;AAEjB,qBAAa,iBAAkB,SAAQ,uBAAuB,CAAC,iCAAiC,CAAC;IAC/F,gBAAgB,EAAE,gBAAgB,CA6BhC;CACH"}
package/dist/resource.js CHANGED
@@ -7,9 +7,8 @@ class FieldTypeResource extends handler_1.HandlerExtendedResource {
7
7
  constructor() {
8
8
  super(...arguments);
9
9
  this.getFieldTypeInfo = (params) => {
10
- const { fieldProperties, platforms: paramsPlatforms, extraPlatforms, } = params;
11
- const { getExtendedHandler } = this;
12
- const extendedHandler = getExtendedHandler();
10
+ const { fieldProperties, platforms: paramsPlatforms, extraPlatforms } = params;
11
+ const getFieldType = this.executeExtendedHandler;
13
12
  let platforms = paramsPlatforms
14
13
  ? paramsPlatforms
15
14
  : extraPlatforms
@@ -17,16 +16,16 @@ class FieldTypeResource extends handler_1.HandlerExtendedResource {
17
16
  : constants_1.FieldTypeBasePlatformList;
18
17
  const platformToTypeMap = {};
19
18
  for (const platform of platforms) {
20
- const fieldType = extendedHandler({
19
+ const fieldType = getFieldType({
21
20
  fieldProperties,
22
- platform,
21
+ platform
23
22
  });
24
23
  platformToTypeMap[platform] = fieldType;
25
24
  }
26
25
  const res = {
27
26
  fieldTypeInfo: {
28
- platformToTypeMap,
29
- },
27
+ platformToTypeMap
28
+ }
30
29
  };
31
30
  return res;
32
31
  };
@@ -1,4 +1,5 @@
1
- import { FieldType, FieldTypePlatform } from "./field-type-info";
1
+ import { HandlerWithHandlerResourceInstance } from '@ldsg/handler';
2
+ import { FieldType, FieldTypePlatform } from './field-type-info';
2
3
  export interface PlatformParams {
3
4
  /**
4
5
  * Platform
@@ -6,13 +7,12 @@ export interface PlatformParams {
6
7
  */
7
8
  platform: FieldTypePlatform;
8
9
  }
9
- interface GetFieldTypeParams extends PlatformParams {
10
+ interface FieldTypeResourceExtendedHandlerParams extends PlatformParams {
10
11
  /**
11
12
  * Field Properties
12
13
  */
13
14
  fieldProperties: any;
14
15
  }
15
- export type GetFieldType = (parmas: GetFieldTypeParams) => FieldType;
16
- export type FieldTypeResourceHandler = GetFieldType;
16
+ export type FieldTypeResourceExtendedHandler = HandlerWithHandlerResourceInstance<FieldTypeResourceExtendedHandlerParams, FieldType>;
17
17
  export {};
18
18
  //# sourceMappingURL=field-type-resource-handler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"field-type-resource-handler.d.ts","sourceRoot":"","sources":["../../src/types/field-type-resource-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEjE,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,QAAQ,EAAE,iBAAiB,CAAC;CAC7B;AAED,UAAU,kBAAmB,SAAQ,cAAc;IACjD;;OAEG;IACH,eAAe,EAAE,GAAG,CAAC;CACtB;AAED,MAAM,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,kBAAkB,KAAK,SAAS,CAAC;AAErE,MAAM,MAAM,wBAAwB,GAAG,YAAY,CAAC"}
1
+ {"version":3,"file":"field-type-resource-handler.d.ts","sourceRoot":"","sources":["../../src/types/field-type-resource-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kCAAkC,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEjE,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,QAAQ,EAAE,iBAAiB,CAAC;CAC7B;AAED,UAAU,sCAAuC,SAAQ,cAAc;IACrE;;OAEG;IACH,eAAe,EAAE,GAAG,CAAC;CACtB;AAED,MAAM,MAAM,gCAAgC,GAAG,kCAAkC,CAC/E,sCAAsC,EACtC,SAAS,CACV,CAAC"}
@@ -1,4 +1,4 @@
1
- import { FieldTypeInfo, FieldTypePlatform } from "./field-type-info";
1
+ import { FieldTypeInfo, FieldTypePlatform } from './field-type-info';
2
2
  export interface PlatformsParams {
3
3
  /**
4
4
  * Platforms
@@ -1 +1 @@
1
- {"version":3,"file":"get-field-type-info.d.ts","sourceRoot":"","sources":["../../src/types/get-field-type-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAErE,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,SAAS,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAEhC;;OAEG;IACH,cAAc,CAAC,EAAE,iBAAiB,EAAE,CAAC;CACtC;AAED,MAAM,WAAW,sBAAuB,SAAQ,eAAe;IAC7D;;OAEG;IACH,eAAe,EAAE,GAAG,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAClC,aAAa,EAAE,aAAa,CAAC;CAC9B;AAED,MAAM,MAAM,gBAAgB,GAAG,CAC7B,MAAM,EAAE,sBAAsB,KAC3B,mBAAmB,CAAC"}
1
+ {"version":3,"file":"get-field-type-info.d.ts","sourceRoot":"","sources":["../../src/types/get-field-type-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAErE,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,SAAS,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAEhC;;OAEG;IACH,cAAc,CAAC,EAAE,iBAAiB,EAAE,CAAC;CACtC;AAED,MAAM,WAAW,sBAAuB,SAAQ,eAAe;IAC7D;;OAEG;IACH,eAAe,EAAE,GAAG,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IAClC,aAAa,EAAE,aAAa,CAAC;CAC9B;AAED,MAAM,MAAM,gBAAgB,GAAG,CAAC,MAAM,EAAE,sBAAsB,KAAK,mBAAmB,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { FieldType, FieldTypePlatform } from './field-type-info';
2
+ export interface PlatformParams {
3
+ /**
4
+ * Platform
5
+ * Such as mongoose\formily.
6
+ */
7
+ platform: FieldTypePlatform;
8
+ }
9
+ export interface GetFieldTypeParams extends PlatformParams {
10
+ /**
11
+ * Field Properties
12
+ */
13
+ fieldProperties: any;
14
+ }
15
+ export type GetFieldType = (parmas: GetFieldTypeParams) => FieldType;
16
+ //# sourceMappingURL=get-field-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-field-type.d.ts","sourceRoot":"","sources":["../../src/types/get-field-type.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEjE,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,QAAQ,EAAE,iBAAiB,CAAC;CAC7B;AAED,MAAM,WAAW,kBAAmB,SAAQ,cAAc;IACxD;;OAEG;IACH,eAAe,EAAE,GAAG,CAAC;CACtB;AAED,MAAM,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,kBAAkB,KAAK,SAAS,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,6 @@
1
- export * from "./field-type-info";
2
- export * from "./field-type-resource-handler";
3
- export * from "./get-field-type-info";
4
- export * from "./specific-resource-settings";
1
+ export * from './field-type-info';
2
+ export * from './get-field-type';
3
+ export * from './get-field-type-info';
4
+ export * from './resource-extended-handler';
5
+ export * from './specific-resource-settings';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC"}
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./field-type-info"), exports);
18
- __exportStar(require("./field-type-resource-handler"), exports);
18
+ __exportStar(require("./get-field-type"), exports);
19
19
  __exportStar(require("./get-field-type-info"), exports);
20
+ __exportStar(require("./resource-extended-handler"), exports);
20
21
  __exportStar(require("./specific-resource-settings"), exports);
@@ -0,0 +1,5 @@
1
+ import { ResourceExtendedHandler } from '@ldsg/handler';
2
+ import { FieldType } from './field-type-info';
3
+ import { GetFieldTypeParams } from './get-field-type';
4
+ export type FieldTypeResourceExtendedHandler = ResourceExtendedHandler<GetFieldTypeParams, FieldType>;
5
+ //# sourceMappingURL=resource-extended-handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resource-extended-handler.d.ts","sourceRoot":"","sources":["../../src/types/resource-extended-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAEtD,MAAM,MAAM,gCAAgC,GAAG,uBAAuB,CAAC,kBAAkB,EAAE,SAAS,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,5 +1,5 @@
1
- import { SpecificResourceSettings } from "@ldsg/types";
2
- import { JSONSchema7 } from "json-schema";
1
+ import { SpecificResourceSettings } from '@ldsg/types';
2
+ import { JSONSchema7 } from 'json-schema';
3
3
  export interface FieldTypeSpecificResourceSettings extends SpecificResourceSettings {
4
4
  /**
5
5
  * Field Properties Schema
@@ -1 +1 @@
1
- {"version":3,"file":"specific-resource-settings.d.ts","sourceRoot":"","sources":["../../src/types/specific-resource-settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,WAAW,iCACf,SAAQ,wBAAwB;IAChC;;OAEG;IACH,qBAAqB,CAAC,EAAE,WAAW,CAAC;CACrC"}
1
+ {"version":3,"file":"specific-resource-settings.d.ts","sourceRoot":"","sources":["../../src/types/specific-resource-settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,MAAM,WAAW,iCAAkC,SAAQ,wBAAwB;IACjF;;OAEG;IACH,qBAAqB,CAAC,EAAE,WAAW,CAAC;CACrC"}
package/package.json CHANGED
@@ -1,27 +1,35 @@
1
1
  {
2
2
  "name": "@ldsg/field-type",
3
- "version": "0.3.9",
3
+ "version": "0.3.10",
4
4
  "description": "",
5
+ "keywords": [],
6
+ "license": "MIT",
7
+ "author": "wanxger",
5
8
  "main": "dist/index.js",
9
+ "types": "dist",
6
10
  "files": [
7
11
  "dist/"
8
12
  ],
9
- "types": "dist",
10
- "keywords": [],
11
- "author": "wanxger",
12
- "license": "MIT",
13
- "publishConfig": {
14
- "access": "public"
15
- },
16
13
  "dependencies": {
17
14
  "json-schema": "0.4.0",
18
- "@ldsg/handler": "0.3.9",
19
- "@ldsg/resource": "0.3.9",
20
- "@ldsg/resource-definition": "0.3.9"
15
+ "mongodb": "^6.16.0",
16
+ "@ldsg/resource": "0.3.10",
17
+ "@ldsg/constants": "0.3.10",
18
+ "@ldsg/resource-definition": "0.3.10",
19
+ "@ldsg/handler": "0.3.10"
21
20
  },
22
21
  "devDependencies": {
22
+ "@types/jest": "^29.5.2",
23
23
  "@types/json-schema": "^7.0.15",
24
- "@ldsg/types": "0.3.9"
24
+ "jest": "^29.5.0",
25
+ "supertest": "^6.3.4",
26
+ "ts-jest": "^29.1.5",
27
+ "ts-node": "^10.9.2",
28
+ "typescript": "^5.8.3",
29
+ "@ldsg/types": "0.3.10"
30
+ },
31
+ "publishConfig": {
32
+ "access": "public"
25
33
  },
26
34
  "scripts": {
27
35
  "build": "tsc --project tsconfig.build.json",