@ldsg/forms 0.3.30 → 0.3.32

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 (45) hide show
  1. package/dist/constants.d.ts +3 -3
  2. package/dist/constants.d.ts.map +1 -1
  3. package/dist/constants.js +9 -9
  4. package/dist/handler.d.ts +4 -4
  5. package/dist/index.d.ts +5 -5
  6. package/dist/instantiate-resource.d.ts +4 -4
  7. package/dist/instantiate-resource.js +1 -1
  8. package/dist/resource.d.ts +4 -4
  9. package/dist/resource.js +3 -3
  10. package/dist/test/__tests__/unit.js +163 -163
  11. package/dist/types/get-form-info.d.ts +3 -3
  12. package/dist/types/index.d.ts +3 -3
  13. package/dist/types/query-types.d.ts +3 -3
  14. package/dist/types/specific-resource-settings.d.ts +1 -1
  15. package/dist/utils/add-query-fields/index.d.ts +2 -2
  16. package/dist/utils/add-query-fields/index.js +1 -1
  17. package/dist/utils/add-query-fields/utils/create-resolvers.d.ts +1 -1
  18. package/dist/utils/add-query-fields/utils/create-resolvers.js +7 -7
  19. package/dist/utils/add-query-fields/utils/create-types.d.ts +1 -1
  20. package/dist/utils/add-query-fields/utils/create-types.js +41 -41
  21. package/dist/utils/add-query-fields/utils/get-json-schema.d.ts +1 -1
  22. package/dist/utils/add-query-fields/utils/get-json-schema.js +13 -13
  23. package/dist/utils/add-query-fields/utils/get-schema-for-formily/constants.d.ts +1 -1
  24. package/dist/utils/add-query-fields/utils/get-schema-for-formily/constants.js +12 -12
  25. package/dist/utils/add-query-fields/utils/get-schema-for-formily/index.d.ts +1 -1
  26. package/dist/utils/add-query-fields/utils/get-schema-for-formily/index.js +2 -2
  27. package/dist/utils/add-query-fields/utils/get-schema-for-formily/utils/process-object-schema.d.ts +1 -1
  28. package/dist/utils/add-query-fields/utils/get-schema-for-formily/utils/process-object-schema.js +6 -6
  29. package/dist/utils/add-query-fields/utils/map-form-info.d.ts +2 -2
  30. package/dist/utils/add-query-fields/utils/map-form-info.d.ts.map +1 -1
  31. package/dist/utils/add-query-fields/utils/map-form-info.js +4 -4
  32. package/dist/utils/handle-form-info-list/index.d.ts +2 -2
  33. package/dist/utils/handle-form-info-list/index.js +2 -2
  34. package/dist/utils/handle-form-info-list/utils/get-field-config-map-definition.d.ts +1 -1
  35. package/dist/utils/handle-form-info-list/utils/get-field-config-map-definition.js +3 -3
  36. package/dist/utils/handle-form-info-list/utils/get-graphql-type-by-common-type.d.ts.map +1 -1
  37. package/dist/utils/handle-form-info-list/utils/get-graphql-type-by-common-type.js +3 -3
  38. package/dist/utils/handle-form-info-list/utils/get-graphql-type-by-type-info.d.ts +1 -1
  39. package/dist/utils/handle-form-info-list/utils/get-graphql-type-by-type-info.d.ts.map +1 -1
  40. package/dist/utils/handle-form-info-list/utils/get-graphql-type-by-type-info.js +2 -2
  41. package/dist/utils/handle-form-info-list/utils/get-input-itc.d.ts +3 -3
  42. package/dist/utils/handle-form-info-list/utils/get-input-itc.js +4 -4
  43. package/dist/utils/handle-form-info-list/utils/get-output-otc.d.ts +3 -3
  44. package/dist/utils/handle-form-info-list/utils/get-output-otc.js +4 -4
  45. package/package.json +15 -11
@@ -8,10 +8,10 @@ const map_form_info_1 = require("./map-form-info");
8
8
  */
9
9
  function createFormResolver(formInfoList) {
10
10
  return {
11
- name: 'form',
12
- type: 'FormDetail',
11
+ name: "form",
12
+ type: "FormDetail",
13
13
  args: {
14
- name: 'String!'
14
+ name: "String!",
15
15
  },
16
16
  resolve: async (_root, args) => {
17
17
  const { name } = args;
@@ -20,7 +20,7 @@ function createFormResolver(formInfoList) {
20
20
  throw new Error(`Form not found: ${name}`);
21
21
  }
22
22
  return (0, map_form_info_1.mapFormInfoToDetail)(formInfo);
23
- }
23
+ },
24
24
  };
25
25
  }
26
26
  /**
@@ -28,10 +28,10 @@ function createFormResolver(formInfoList) {
28
28
  */
29
29
  function createFormsResolver(formInfoList) {
30
30
  return {
31
- name: 'forms',
32
- type: '[FormMetadata!]!',
31
+ name: "forms",
32
+ type: "[FormMetadata!]!",
33
33
  resolve: async () => {
34
34
  return formInfoList.map((f) => (0, map_form_info_1.mapFormInfoToMetadata)(f));
35
- }
35
+ },
36
36
  };
37
37
  }
@@ -1,4 +1,4 @@
1
- import { ObjectTypeComposer, SchemaComposer } from 'graphql-compose';
1
+ import { ObjectTypeComposer, SchemaComposer } from "graphql-compose";
2
2
  /**
3
3
  * Creates GraphQL type for FormMetadata
4
4
  */
@@ -6,95 +6,95 @@ exports.createFormDetailTC = createFormDetailTC;
6
6
  * Creates GraphQL type for ObjectInfo (used in inputObject and outputObject)
7
7
  */
8
8
  function createObjectInfoTC(schemaComposer) {
9
- if (schemaComposer.has('FormObjectInfo')) {
10
- return schemaComposer.getOTC('FormObjectInfo');
9
+ if (schemaComposer.has("FormObjectInfo")) {
10
+ return schemaComposer.getOTC("FormObjectInfo");
11
11
  }
12
12
  return schemaComposer.createObjectTC({
13
- name: 'FormObjectInfo',
13
+ name: "FormObjectInfo",
14
14
  fields: {
15
15
  name: {
16
- type: 'String',
17
- description: 'Object name'
16
+ type: "String",
17
+ description: "Object name",
18
18
  },
19
19
  title: {
20
- type: 'String',
21
- description: 'Object title'
20
+ type: "String",
21
+ description: "Object title",
22
22
  },
23
23
  description: {
24
- type: 'String',
25
- description: 'Object description'
24
+ type: "String",
25
+ description: "Object description",
26
26
  },
27
27
  fieldInfoList: {
28
- type: 'JSON',
29
- description: 'List of field information'
28
+ type: "JSON",
29
+ description: "List of field information",
30
30
  },
31
31
  jsonSchema: {
32
- type: 'JSON',
33
- description: 'JSON Schema for the object'
32
+ type: "JSON",
33
+ description: "JSON Schema for the object",
34
34
  },
35
35
  formilyJsonSchema: {
36
- type: 'JSON',
37
- description: 'Formily JSON Schema for the object'
38
- }
39
- }
36
+ type: "JSON",
37
+ description: "Formily JSON Schema for the object",
38
+ },
39
+ },
40
40
  });
41
41
  }
42
42
  /**
43
43
  * Creates GraphQL type for FormMetadata
44
44
  */
45
45
  function createFormMetadataTC(schemaComposer) {
46
- if (schemaComposer.has('FormMetadata')) {
47
- return schemaComposer.getOTC('FormMetadata');
46
+ if (schemaComposer.has("FormMetadata")) {
47
+ return schemaComposer.getOTC("FormMetadata");
48
48
  }
49
49
  return schemaComposer.createObjectTC({
50
- name: 'FormMetadata',
50
+ name: "FormMetadata",
51
51
  fields: {
52
52
  name: {
53
- type: 'String!',
54
- description: 'Form name'
53
+ type: "String!",
54
+ description: "Form name",
55
55
  },
56
56
  title: {
57
- type: 'String',
58
- description: 'Human-readable form title'
57
+ type: "String",
58
+ description: "Human-readable form title",
59
59
  },
60
60
  description: {
61
- type: 'String',
62
- description: 'Optional form description'
63
- }
64
- }
61
+ type: "String",
62
+ description: "Optional form description",
63
+ },
64
+ },
65
65
  });
66
66
  }
67
67
  /**
68
68
  * Creates GraphQL type for FormDetail
69
69
  */
70
70
  function createFormDetailTC(schemaComposer) {
71
- if (schemaComposer.has('FormDetail')) {
72
- return schemaComposer.getOTC('FormDetail');
71
+ if (schemaComposer.has("FormDetail")) {
72
+ return schemaComposer.getOTC("FormDetail");
73
73
  }
74
74
  const objectInfoTC = createObjectInfoTC(schemaComposer);
75
75
  return schemaComposer.createObjectTC({
76
- name: 'FormDetail',
76
+ name: "FormDetail",
77
77
  fields: {
78
78
  name: {
79
- type: 'String!',
80
- description: 'Form name'
79
+ type: "String!",
80
+ description: "Form name",
81
81
  },
82
82
  title: {
83
- type: 'String',
84
- description: 'Human-readable form title'
83
+ type: "String",
84
+ description: "Human-readable form title",
85
85
  },
86
86
  description: {
87
- type: 'String',
88
- description: 'Optional form description'
87
+ type: "String",
88
+ description: "Optional form description",
89
89
  },
90
90
  inputObjectInfo: {
91
91
  type: objectInfoTC,
92
- description: 'Input object information'
92
+ description: "Input object information",
93
93
  },
94
94
  outputObjectInfo: {
95
95
  type: objectInfoTC,
96
- description: 'Output object information'
97
- }
98
- }
96
+ description: "Output object information",
97
+ },
98
+ },
99
99
  });
100
100
  }
@@ -1,4 +1,4 @@
1
- import { FieldInfo } from '@ldsg/object';
1
+ import { FieldInfo } from "@ldsg/object";
2
2
  /**
3
3
  * Generates JSON Schema for an object from its field info list
4
4
  */
@@ -20,19 +20,19 @@ function getJsonSchemaForField(fieldInfo) {
20
20
  const commonType = platformToTypeMap[field_type_1.FieldTypeBasePlatform.COMMON];
21
21
  if (!commonType) {
22
22
  return {
23
- type: 'string',
24
- title: fieldInfo.title || fieldInfo.name
23
+ type: "string",
24
+ title: fieldInfo.title || fieldInfo.name,
25
25
  };
26
26
  }
27
27
  // Basic type mapping
28
28
  const typeMap = {
29
- string: { type: 'string', title: fieldInfo.title || fieldInfo.name },
30
- number: { type: 'number', title: fieldInfo.title || fieldInfo.name },
31
- boolean: { type: 'boolean', title: fieldInfo.title || fieldInfo.name },
32
- array: { type: 'array', title: fieldInfo.title || fieldInfo.name },
33
- object: { type: 'object', title: fieldInfo.title || fieldInfo.name }
29
+ string: { type: "string", title: fieldInfo.title || fieldInfo.name },
30
+ number: { type: "number", title: fieldInfo.title || fieldInfo.name },
31
+ boolean: { type: "boolean", title: fieldInfo.title || fieldInfo.name },
32
+ array: { type: "array", title: fieldInfo.title || fieldInfo.name },
33
+ object: { type: "object", title: fieldInfo.title || fieldInfo.name },
34
34
  };
35
- return typeMap[commonType] || { type: 'string', title: fieldInfo.title || fieldInfo.name };
35
+ return typeMap[commonType] || { type: "string", title: fieldInfo.title || fieldInfo.name };
36
36
  }
37
37
  /**
38
38
  * Generates Formily JSON Schema for a field based on its type info
@@ -64,8 +64,8 @@ function getJsonSchemaByFieldInfoList(fieldInfoList) {
64
64
  }
65
65
  });
66
66
  return {
67
- type: 'object',
68
- properties
67
+ type: "object",
68
+ properties,
69
69
  };
70
70
  }
71
71
  /**
@@ -79,11 +79,11 @@ function getFormilyJsonSchemaByFieldInfoList(fieldInfoList) {
79
79
  properties[fieldInfo.name] = formilySchema;
80
80
  });
81
81
  const schema = new json_schema_1.Schema({
82
- type: 'object',
83
- properties
82
+ type: "object",
83
+ properties,
84
84
  });
85
85
  const { schemaForFormily } = (0, get_schema_for_formily_1.getSchemaForFormily)({
86
- schema
86
+ schema,
87
87
  });
88
88
  const res = schemaForFormily;
89
89
  return res;
@@ -1,3 +1,3 @@
1
- import { ISchema, SchemaTypes } from '@formily/json-schema';
1
+ import { ISchema, SchemaTypes } from "@formily/json-schema";
2
2
  export declare const SchemaTypeMap: Partial<Record<SchemaTypes, ISchema>>;
3
3
  //# sourceMappingURL=constants.d.ts.map
@@ -3,27 +3,27 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SchemaTypeMap = void 0;
4
4
  exports.SchemaTypeMap = {
5
5
  boolean: {
6
- 'x-decorator': 'FormItem',
7
- 'x-component': 'Checkbox'
6
+ "x-decorator": "FormItem",
7
+ "x-component": "Checkbox",
8
8
  },
9
9
  integer: {
10
- 'x-decorator': 'FormItem',
11
- 'x-component': 'NumberPicker'
10
+ "x-decorator": "FormItem",
11
+ "x-component": "NumberPicker",
12
12
  },
13
13
  number: {
14
- 'x-decorator': 'FormItem',
15
- 'x-component': 'NumberPicker'
14
+ "x-decorator": "FormItem",
15
+ "x-component": "NumberPicker",
16
16
  },
17
17
  object: {},
18
18
  objectWithoutProperties: {
19
- 'x-decorator': 'FormItem',
20
- 'x-component': 'JsonInput'
19
+ "x-decorator": "FormItem",
20
+ "x-component": "JsonInput",
21
21
  },
22
22
  string: {
23
- 'x-decorator': 'FormItem',
24
- 'x-component': 'Input'
23
+ "x-decorator": "FormItem",
24
+ "x-component": "Input",
25
25
  },
26
26
  array: {
27
- 'x-decorator': 'FormItem'
28
- }
27
+ "x-decorator": "FormItem",
28
+ },
29
29
  };
@@ -1,4 +1,4 @@
1
- import { Schema } from '@formily/json-schema';
1
+ import { Schema } from "@formily/json-schema";
2
2
  interface GetSchemaForFormilyParams {
3
3
  schema: Schema;
4
4
  }
@@ -5,10 +5,10 @@ const process_object_schema_1 = require("./utils/process-object-schema");
5
5
  const getSchemaForFormily = (params) => {
6
6
  const { schema } = params;
7
7
  (0, process_object_schema_1.processObjectSchema)({
8
- schema
8
+ schema,
9
9
  });
10
10
  const res = {
11
- schemaForFormily: schema
11
+ schemaForFormily: schema,
12
12
  };
13
13
  return res;
14
14
  };
@@ -1,4 +1,4 @@
1
- import { Schema } from '@formily/json-schema';
1
+ import { Schema } from "@formily/json-schema";
2
2
  interface ProcessObjectSchemaParams {
3
3
  schema: Schema;
4
4
  }
@@ -10,28 +10,28 @@ const processObjectSchema = (params) => {
10
10
  const { schema } = params;
11
11
  const { type, properties } = schema;
12
12
  switch (type) {
13
- case 'object': {
13
+ case "object": {
14
14
  if (properties && lodash_1.default.keys(properties).length) {
15
- const schemaTypeMapValue = constants_1.SchemaTypeMap['object'];
15
+ const schemaTypeMapValue = constants_1.SchemaTypeMap["object"];
16
16
  lodash_1.default.defaults(schema, schemaTypeMapValue);
17
17
  schema.mapProperties((property) => {
18
18
  (0, exports.processObjectSchema)({
19
- schema: property
19
+ schema: property,
20
20
  });
21
21
  });
22
22
  }
23
23
  else {
24
- const schemaTypeMapValue = constants_1.SchemaTypeMap['objectWithoutProperties'];
24
+ const schemaTypeMapValue = constants_1.SchemaTypeMap["objectWithoutProperties"];
25
25
  lodash_1.default.defaults(schema, schemaTypeMapValue);
26
26
  }
27
27
  break;
28
28
  }
29
29
  default: {
30
- if (schema.enum && schema.enum.length && !schema['x-component']) {
30
+ if (schema.enum && schema.enum.length && !schema["x-component"]) {
31
31
  /**
32
32
  * TODO:应改成 Select,但在此 react 版本中 Select 功能异常
33
33
  */
34
- schema['x-component'] = 'Radio.Group';
34
+ schema["x-component"] = "Radio.Group";
35
35
  }
36
36
  const schemaTypeMapValue = constants_1.SchemaTypeMap[type];
37
37
  if (schemaTypeMapValue) {
@@ -1,5 +1,5 @@
1
- import { FormInfo } from '../../../types';
2
- import { FormDetail, FormMetadata } from '../../../types/query-types';
1
+ import { FormInfo } from "../../../types";
2
+ import { FormDetail, FormMetadata } from "../../../types/query-types";
3
3
  /**
4
4
  * Maps FormInfo to FormMetadata (lightweight version without schemas)
5
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"map-form-info.d.ts","sourceRoot":"","sources":["../../../../src/utils/add-query-fields/utils/map-form-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAGtE;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,GAAG,YAAY,CAMtE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,GAAG,UAAU,CA0BlE"}
1
+ {"version":3,"file":"map-form-info.d.ts","sourceRoot":"","sources":["../../../../src/utils/add-query-fields/utils/map-form-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAMtE;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,GAAG,YAAY,CAMtE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,GAAG,UAAU,CA4BlE"}
@@ -10,7 +10,7 @@ function mapFormInfoToMetadata(formInfo) {
10
10
  return {
11
11
  name: formInfo.name,
12
12
  title: formInfo.title,
13
- description: formInfo.description
13
+ description: formInfo.description,
14
14
  };
15
15
  }
16
16
  /**
@@ -31,12 +31,12 @@ function mapFormInfoToDetail(formInfo) {
31
31
  inputObjectInfo: {
32
32
  ...inputObjectInfo,
33
33
  jsonSchema: inputJsonSchema,
34
- formilyJsonSchema: inputFormilyJsonSchema
34
+ formilyJsonSchema: inputFormilyJsonSchema,
35
35
  },
36
36
  outputObjectInfo: {
37
37
  ...outputObjectInfo,
38
38
  jsonSchema: outputJsonSchema,
39
- formilyJsonSchema: outputFormilyJsonSchema
40
- }
39
+ formilyJsonSchema: outputFormilyJsonSchema,
40
+ },
41
41
  };
42
42
  }
@@ -1,5 +1,5 @@
1
- import { SchemaComposerParams } from '@ldsg/graphql';
2
- import { FormInfo } from '../../types';
1
+ import { SchemaComposerParams } from "@ldsg/graphql";
2
+ import { FormInfo } from "../../types";
3
3
  interface HandleFormInfoListParams extends SchemaComposerParams {
4
4
  formInfoList: FormInfo[];
5
5
  }
@@ -10,10 +10,10 @@ const handleFormInfoList = (params) => {
10
10
  const { outputOTC } = (0, get_output_otc_1.getOutputOTC)({ schemaComposer, outputObjectInfo });
11
11
  const { inputITC } = (0, get_input_itc_1.getInputITC)({ schemaComposer, inputObjectInfo });
12
12
  outputOTC.addResolver({
13
- name: 'submit',
13
+ name: "submit",
14
14
  type: outputOTC,
15
15
  args: inputITC.getFields(),
16
- resolve: undefined
16
+ resolve: undefined,
17
17
  });
18
18
  schemaComposer.addSchemaMustHaveType(outputOTC);
19
19
  });
@@ -1,4 +1,4 @@
1
- import { FieldInfo } from '@ldsg/object';
1
+ import { FieldInfo } from "@ldsg/object";
2
2
  interface GetFieldConfigMapDefinitionParams {
3
3
  fieldInfoList: FieldInfo[];
4
4
  }
@@ -13,15 +13,15 @@ const getFieldConfigMapDefinition = (params) => {
13
13
  const { title, description, name, typeInfo } = fieldInfo;
14
14
  const camelCaseName = lodash_1.default.camelCase(name);
15
15
  const { graphqlType } = (0, get_graphql_type_by_type_info_1.getGraphqlTypeByTypeInfo)({
16
- typeInfo
16
+ typeInfo,
17
17
  });
18
18
  fieldConfigMapDefinition[camelCaseName] = {
19
19
  type: graphqlType,
20
- description: `${title}${description ? `:${description}` : ''}`
20
+ description: `${title}${description ? `:${description}` : ""}`,
21
21
  };
22
22
  });
23
23
  const res = {
24
- fieldConfigMapDefinition
24
+ fieldConfigMapDefinition,
25
25
  };
26
26
  return res;
27
27
  };
@@ -1 +1 @@
1
- {"version":3,"file":"get-graphql-type-by-common-type.d.ts","sourceRoot":"","sources":["../../../../src/utils/handle-form-info-list/utils/get-graphql-type-by-common-type.ts"],"names":[],"mappings":"AAAA,UAAU,gCAAgC;IACxC,UAAU,EAAE,GAAG,CAAC;CACjB;AAED,UAAU,6BAA6B;IACrC,WAAW,EAAE,GAAG,CAAC;CAClB;AAED,KAAK,0BAA0B,GAAG,CAAC,MAAM,EAAE,gCAAgC,KAAK,6BAA6B,CAAC;AAE9G,eAAO,MAAM,0BAA0B,EAAE,0BAuBxC,CAAC"}
1
+ {"version":3,"file":"get-graphql-type-by-common-type.d.ts","sourceRoot":"","sources":["../../../../src/utils/handle-form-info-list/utils/get-graphql-type-by-common-type.ts"],"names":[],"mappings":"AAAA,UAAU,gCAAgC;IACxC,UAAU,EAAE,GAAG,CAAC;CACjB;AAED,UAAU,6BAA6B;IACrC,WAAW,EAAE,GAAG,CAAC;CAClB;AAED,KAAK,0BAA0B,GAAG,CAChC,MAAM,EAAE,gCAAgC,KACrC,6BAA6B,CAAC;AAEnC,eAAO,MAAM,0BAA0B,EAAE,0BAuBxC,CAAC"}
@@ -6,15 +6,15 @@ const getGraphqlTypeByCommonType = (params) => {
6
6
  const { type } = commonType;
7
7
  let graphqlType;
8
8
  switch (type) {
9
- case 'string': {
10
- graphqlType = 'String';
9
+ case "string": {
10
+ graphqlType = "String";
11
11
  break;
12
12
  }
13
13
  default:
14
14
  break;
15
15
  }
16
16
  const res = {
17
- graphqlType
17
+ graphqlType,
18
18
  };
19
19
  return res;
20
20
  };
@@ -1,4 +1,4 @@
1
- import { FieldTypeInfo } from '@ldsg/field-type';
1
+ import { FieldTypeInfo } from "@ldsg/field-type";
2
2
  interface GetGraphqlTypeByTypeInfoParams {
3
3
  typeInfo: FieldTypeInfo;
4
4
  }
@@ -1 +1 @@
1
- {"version":3,"file":"get-graphql-type-by-type-info.d.ts","sourceRoot":"","sources":["../../../../src/utils/handle-form-info-list/utils/get-graphql-type-by-type-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGxE,UAAU,8BAA8B;IACtC,QAAQ,EAAE,aAAa,CAAC;CACzB;AAED,UAAU,2BAA2B;IACnC,WAAW,EAAE,GAAG,CAAC;CAClB;AAED,KAAK,wBAAwB,GAAG,CAAC,MAAM,EAAE,8BAA8B,KAAK,2BAA2B,CAAC;AAExG,eAAO,MAAM,wBAAwB,EAAE,wBAoBtC,CAAC"}
1
+ {"version":3,"file":"get-graphql-type-by-type-info.d.ts","sourceRoot":"","sources":["../../../../src/utils/handle-form-info-list/utils/get-graphql-type-by-type-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGxE,UAAU,8BAA8B;IACtC,QAAQ,EAAE,aAAa,CAAC;CACzB;AAED,UAAU,2BAA2B;IACnC,WAAW,EAAE,GAAG,CAAC;CAClB;AAED,KAAK,wBAAwB,GAAG,CAC9B,MAAM,EAAE,8BAA8B,KACnC,2BAA2B,CAAC;AAEjC,eAAO,MAAM,wBAAwB,EAAE,wBAoBtC,CAAC"}
@@ -10,11 +10,11 @@ const getGraphqlTypeByTypeInfo = (params) => {
10
10
  if (!graphqlType) {
11
11
  const commonType = platformToTypeMap[field_type_1.FieldTypeBasePlatform.COMMON];
12
12
  graphqlType = (0, get_graphql_type_by_common_type_1.getGraphqlTypeByCommonType)({
13
- commonType
13
+ commonType,
14
14
  }).graphqlType;
15
15
  }
16
16
  const res = {
17
- graphqlType
17
+ graphqlType,
18
18
  };
19
19
  return res;
20
20
  };
@@ -1,6 +1,6 @@
1
- import { SchemaComposerParams } from '@ldsg/graphql';
2
- import { ObjectInfo } from '@ldsg/object';
3
- import { InputTypeComposer } from 'graphql-compose';
1
+ import { SchemaComposerParams } from "@ldsg/graphql";
2
+ import { ObjectInfo } from "@ldsg/object";
3
+ import { InputTypeComposer } from "graphql-compose";
4
4
  interface GetInputITCParams extends SchemaComposerParams {
5
5
  inputObjectInfo: ObjectInfo;
6
6
  }
@@ -6,16 +6,16 @@ const getInputITC = (params) => {
6
6
  const { schemaComposer, inputObjectInfo } = params;
7
7
  const { title, description, name, fieldInfoList } = inputObjectInfo;
8
8
  const { fieldConfigMapDefinition } = (0, get_field_config_map_definition_1.getFieldConfigMapDefinition)({
9
- fieldInfoList
9
+ fieldInfoList,
10
10
  });
11
11
  const definition = {
12
12
  name,
13
- fields: fieldConfigMapDefinition
13
+ fields: fieldConfigMapDefinition,
14
14
  };
15
15
  const inputITC = schemaComposer.createInputTC(definition);
16
- inputITC.setDescription(`${title}${description ? `:${description}` : ''}`);
16
+ inputITC.setDescription(`${title}${description ? `:${description}` : ""}`);
17
17
  const res = {
18
- inputITC
18
+ inputITC,
19
19
  };
20
20
  return res;
21
21
  };
@@ -1,6 +1,6 @@
1
- import { SchemaComposerParams } from '@ldsg/graphql';
2
- import { ObjectInfo } from '@ldsg/object';
3
- import { ObjectTypeComposer } from 'graphql-compose';
1
+ import { SchemaComposerParams } from "@ldsg/graphql";
2
+ import { ObjectInfo } from "@ldsg/object";
3
+ import { ObjectTypeComposer } from "graphql-compose";
4
4
  interface GetOutputOTCParams extends SchemaComposerParams {
5
5
  outputObjectInfo: ObjectInfo;
6
6
  }
@@ -6,16 +6,16 @@ const getOutputOTC = (params) => {
6
6
  const { schemaComposer, outputObjectInfo } = params;
7
7
  const { title, description, name, fieldInfoList } = outputObjectInfo;
8
8
  const { fieldConfigMapDefinition } = (0, get_field_config_map_definition_1.getFieldConfigMapDefinition)({
9
- fieldInfoList
9
+ fieldInfoList,
10
10
  });
11
11
  const definition = {
12
12
  name,
13
- fields: fieldConfigMapDefinition
13
+ fields: fieldConfigMapDefinition,
14
14
  };
15
15
  const outputOTC = schemaComposer.createObjectTC(definition);
16
- outputOTC.setDescription(`${title}${description ? `:${description}` : ''}`);
16
+ outputOTC.setDescription(`${title}${description ? `:${description}` : ""}`);
17
17
  const res = {
18
- outputOTC
18
+ outputOTC,
19
19
  };
20
20
  return res;
21
21
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ldsg/forms",
3
- "version": "0.3.30",
3
+ "version": "0.3.32",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -15,10 +15,10 @@
15
15
  "json-schema": "^0.4.0",
16
16
  "lodash": "^4.17.21",
17
17
  "zod": "^4.1.11",
18
- "@ldsg/field-type": "0.3.30",
19
- "@ldsg/handler": "0.3.30",
20
- "@ldsg/resource": "0.3.30",
21
- "@ldsg/resource-definition": "0.3.30"
18
+ "@ldsg/field-type": "0.3.32",
19
+ "@ldsg/handler": "0.3.32",
20
+ "@ldsg/resource": "0.3.32",
21
+ "@ldsg/resource-definition": "0.3.32"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@types/jest": "^29.5.2",
@@ -26,17 +26,19 @@
26
26
  "@types/lodash": "^4.14.202",
27
27
  "@types/supertest": "^6.0.0",
28
28
  "graphql": "16.11.0",
29
- "graphql-compose": "^9.1.0",
29
+ "graphql-compose": "9.1.0",
30
30
  "jest": "^29.5.0",
31
+ "oxfmt": "latest",
32
+ "oxlint": "latest",
31
33
  "supertest": "^6.3.4",
32
34
  "ts-jest": "^29.1.5",
33
35
  "ts-node": "^10.9.2",
34
36
  "typescript": "^5.8.3",
35
- "@ldsg/graphql": "0.3.30",
36
- "@ldsg/object": "0.3.30",
37
- "@ldsg/object-field": "0.3.30",
38
- "@ldsg/types": "0.3.30",
39
- "@ldsg/workflow": "0.3.30"
37
+ "@ldsg/graphql": "0.3.32",
38
+ "@ldsg/object": "0.3.32",
39
+ "@ldsg/object-field": "0.3.32",
40
+ "@ldsg/types": "0.3.32",
41
+ "@ldsg/workflow": "0.3.32"
40
42
  },
41
43
  "publishConfig": {
42
44
  "access": "public"
@@ -44,6 +46,8 @@
44
46
  "scripts": {
45
47
  "build": "tsc --project tsconfig.build.json",
46
48
  "clean": "rm -rf dist",
49
+ "format": "oxfmt --write src/",
50
+ "lint": "oxlint src/",
47
51
  "test": "jest"
48
52
  }
49
53
  }