@ldsg/forms 0.3.24 → 0.3.26
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/LICENSE +1 -1
- package/dist/resource.d.ts +3 -0
- package/dist/resource.d.ts.map +1 -1
- package/dist/resource.js +2 -2
- package/dist/types/specific-resource-settings.d.ts +4 -3
- package/dist/types/specific-resource-settings.d.ts.map +1 -1
- package/dist/types/specific-resource-settings.js +4 -0
- package/dist/utils/handle-form-info-list/index.d.ts +9 -0
- package/dist/utils/handle-form-info-list/index.d.ts.map +1 -0
- package/dist/utils/handle-form-info-list/index.js +21 -0
- package/dist/utils/handle-form-info-list/utils/get-field-config-map-definition.d.ts.map +1 -0
- package/dist/utils/handle-form-info-list/utils/get-graphql-type-by-common-type.d.ts.map +1 -0
- package/dist/utils/handle-form-info-list/utils/get-graphql-type-by-type-info.d.ts.map +1 -0
- package/dist/utils/handle-form-info-list/utils/get-input-itc.d.ts.map +1 -0
- package/dist/utils/{get-new-fields → handle-form-info-list}/utils/get-input-itc.js +1 -6
- package/dist/utils/handle-form-info-list/utils/get-output-otc.d.ts.map +1 -0
- package/dist/utils/{get-new-fields → handle-form-info-list}/utils/get-output-otc.js +1 -12
- package/package.json +11 -10
- package/dist/utils/get-new-fields/index.d.ts +0 -13
- package/dist/utils/get-new-fields/index.d.ts.map +0 -1
- package/dist/utils/get-new-fields/index.js +0 -31
- package/dist/utils/get-new-fields/utils/get-field-config-map-definition.d.ts.map +0 -1
- package/dist/utils/get-new-fields/utils/get-graphql-type-by-common-type.d.ts.map +0 -1
- package/dist/utils/get-new-fields/utils/get-graphql-type-by-type-info.d.ts.map +0 -1
- package/dist/utils/get-new-fields/utils/get-input-itc.d.ts.map +0 -1
- package/dist/utils/get-new-fields/utils/get-output-otc.d.ts.map +0 -1
- package/dist/utils/get-new-fields/utils/index.d.ts +0 -3
- package/dist/utils/get-new-fields/utils/index.d.ts.map +0 -1
- package/dist/utils/get-new-fields/utils/index.js +0 -18
- package/dist/utils/index.d.ts +0 -3
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -18
- /package/dist/utils/{get-new-fields → handle-form-info-list}/utils/get-field-config-map-definition.d.ts +0 -0
- /package/dist/utils/{get-new-fields → handle-form-info-list}/utils/get-field-config-map-definition.js +0 -0
- /package/dist/utils/{get-new-fields → handle-form-info-list}/utils/get-graphql-type-by-common-type.d.ts +0 -0
- /package/dist/utils/{get-new-fields → handle-form-info-list}/utils/get-graphql-type-by-common-type.js +0 -0
- /package/dist/utils/{get-new-fields → handle-form-info-list}/utils/get-graphql-type-by-type-info.d.ts +0 -0
- /package/dist/utils/{get-new-fields → handle-form-info-list}/utils/get-graphql-type-by-type-info.js +0 -0
- /package/dist/utils/{get-new-fields → handle-form-info-list}/utils/get-input-itc.d.ts +0 -0
- /package/dist/utils/{get-new-fields → handle-form-info-list}/utils/get-output-otc.d.ts +0 -0
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2014-present
|
|
3
|
+
Copyright (c) 2014-present Wanxger and other contributors
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
6
|
a copy of this software and associated documentation files (the
|
package/dist/resource.d.ts
CHANGED
|
@@ -10,6 +10,9 @@ interface GetFormInfoListRes {
|
|
|
10
10
|
}
|
|
11
11
|
type GetFormInfoList = (params?: PlatformsParams) => GetFormInfoListRes;
|
|
12
12
|
export declare class FormsResource extends Resource<FormsSpecificResourceSettings> {
|
|
13
|
+
/**
|
|
14
|
+
* 用于缓存表单信息列表,避免重复计算
|
|
15
|
+
*/
|
|
13
16
|
formInfoList?: FormInfo[];
|
|
14
17
|
getFormInfoList: GetFormInfoList;
|
|
15
18
|
modifyGraphQLSchema: ModifyGraphQLSchema;
|
package/dist/resource.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,QAAQ,EAAE,6BAA6B,EAAe,MAAM,SAAS,CAAC;AAG/E,UAAU,kBAAkB;IAC1B;;OAEG;IACH,YAAY,EAAE,QAAQ,EAAE,CAAC;CAC1B;AAED,KAAK,eAAe,GAAG,CAAC,MAAM,CAAC,EAAE,eAAe,KAAK,kBAAkB,CAAC;AAExE,qBAAa,aAAc,SAAQ,QAAQ,CAAC,6BAA6B,CAAC;IACxE,YAAY,CAAC,EAAE,QAAQ,EAAE,CAAC;IAE1B,eAAe,EAAE,eAAe,CA4B9B;IAEF,mBAAmB,EAAE,mBAAmB,CAStC;CACH"}
|
|
1
|
+
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,QAAQ,EAAE,6BAA6B,EAAe,MAAM,SAAS,CAAC;AAG/E,UAAU,kBAAkB;IAC1B;;OAEG;IACH,YAAY,EAAE,QAAQ,EAAE,CAAC;CAC1B;AAED,KAAK,eAAe,GAAG,CAAC,MAAM,CAAC,EAAE,eAAe,KAAK,kBAAkB,CAAC;AAExE,qBAAa,aAAc,SAAQ,QAAQ,CAAC,6BAA6B,CAAC;IACxE;;OAEG;IACH,YAAY,CAAC,EAAE,QAAQ,EAAE,CAAC;IAE1B,eAAe,EAAE,eAAe,CA4B9B;IAEF,mBAAmB,EAAE,mBAAmB,CAStC;CACH"}
|
package/dist/resource.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.FormsResource = void 0;
|
|
7
7
|
const resource_1 = require("@ldsg/resource");
|
|
8
8
|
const lodash_1 = __importDefault(require("lodash"));
|
|
9
|
-
const
|
|
9
|
+
const handle_form_info_list_1 = require("./utils/handle-form-info-list");
|
|
10
10
|
class FormsResource extends resource_1.Resource {
|
|
11
11
|
constructor() {
|
|
12
12
|
super(...arguments);
|
|
@@ -33,7 +33,7 @@ class FormsResource extends resource_1.Resource {
|
|
|
33
33
|
this.modifyGraphQLSchema = (params) => {
|
|
34
34
|
const { schemaComposer } = params;
|
|
35
35
|
const { formInfoList } = this.getFormInfoList();
|
|
36
|
-
(0,
|
|
36
|
+
(0, handle_form_info_list_1.handleFormInfoList)({
|
|
37
37
|
formInfoList,
|
|
38
38
|
schemaComposer
|
|
39
39
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export
|
|
3
|
-
}
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const FormsSpecificResourceSettingsSchema: z.ZodObject<{}, z.core.$catchall<z.ZodAny>>;
|
|
3
|
+
export declare const SpecificResourceSettingsSchema: z.ZodObject<{}, z.core.$catchall<z.ZodAny>>;
|
|
4
|
+
export type FormsSpecificResourceSettings = z.infer<typeof FormsSpecificResourceSettingsSchema>;
|
|
4
5
|
//# sourceMappingURL=specific-resource-settings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"specific-resource-settings.d.ts","sourceRoot":"","sources":["../../src/types/specific-resource-settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"specific-resource-settings.d.ts","sourceRoot":"","sources":["../../src/types/specific-resource-settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,mCAAmC,6CAAiC,CAAC;AAElF,eAAO,MAAM,8BAA8B,6CAAsC,CAAC;AAClF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC"}
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SpecificResourceSettingsSchema = exports.FormsSpecificResourceSettingsSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
exports.FormsSpecificResourceSettingsSchema = zod_1.z.object({}).catchall(zod_1.z.any());
|
|
6
|
+
exports.SpecificResourceSettingsSchema = exports.FormsSpecificResourceSettingsSchema;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SchemaComposerParams } from '@ldsg/graphql';
|
|
2
|
+
import { FormInfo } from '../../types';
|
|
3
|
+
interface HandleFormInfoListParams extends SchemaComposerParams {
|
|
4
|
+
formInfoList: FormInfo[];
|
|
5
|
+
}
|
|
6
|
+
type HandleFormInfoList = (params: HandleFormInfoListParams) => void;
|
|
7
|
+
export declare const handleFormInfoList: HandleFormInfoList;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/handle-form-info-list/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIvC,UAAU,wBAAyB,SAAQ,oBAAoB;IAC7D,YAAY,EAAE,QAAQ,EAAE,CAAC;CAC1B;AAED,KAAK,kBAAkB,GAAG,CAAC,MAAM,EAAE,wBAAwB,KAAK,IAAI,CAAC;AAErE,eAAO,MAAM,kBAAkB,EAAE,kBAmBhC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.handleFormInfoList = void 0;
|
|
4
|
+
const get_input_itc_1 = require("./utils/get-input-itc");
|
|
5
|
+
const get_output_otc_1 = require("./utils/get-output-otc");
|
|
6
|
+
const handleFormInfoList = (params) => {
|
|
7
|
+
const { schemaComposer, formInfoList } = params;
|
|
8
|
+
formInfoList.forEach((formInfo) => {
|
|
9
|
+
const { inputObjectInfo, outputObjectInfo } = formInfo;
|
|
10
|
+
const { outputOTC } = (0, get_output_otc_1.getOutputOTC)({ schemaComposer, outputObjectInfo });
|
|
11
|
+
const { inputITC } = (0, get_input_itc_1.getInputITC)({ schemaComposer, inputObjectInfo });
|
|
12
|
+
outputOTC.addResolver({
|
|
13
|
+
name: 'submit',
|
|
14
|
+
type: outputOTC,
|
|
15
|
+
args: inputITC.getFields(),
|
|
16
|
+
resolve: undefined
|
|
17
|
+
});
|
|
18
|
+
schemaComposer.addSchemaMustHaveType(outputOTC);
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
exports.handleFormInfoList = handleFormInfoList;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-field-config-map-definition.d.ts","sourceRoot":"","sources":["../../../../src/utils/handle-form-info-list/utils/get-field-config-map-definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzC,UAAU,iCAAiC;IACzC,aAAa,EAAE,SAAS,EAAE,CAAC;CAC5B;AAED,UAAU,8BAA8B;IACtC,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC/C;AAED,KAAK,2BAA2B,GAAG,CACjC,MAAM,EAAE,iCAAiC,KACtC,8BAA8B,CAAC;AAEpC,eAAO,MAAM,2BAA2B,EAAE,2BAyBzC,CAAC"}
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-input-itc.d.ts","sourceRoot":"","sources":["../../../../src/utils/handle-form-info-list/utils/get-input-itc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAA+B,MAAM,iBAAiB,CAAC;AAGjF,UAAU,iBAAkB,SAAQ,oBAAoB;IACtD,eAAe,EAAE,UAAU,CAAC;CAC7B;AAED,UAAU,cAAc;IACtB,QAAQ,EAAE,iBAAiB,CAAC,GAAG,CAAC,CAAC;CAClC;AAED,KAAK,WAAW,GAAG,CAAC,MAAM,EAAE,iBAAiB,KAAK,cAAc,CAAC;AAEjE,eAAO,MAAM,WAAW,EAAE,WAuBzB,CAAC"}
|
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.getInputITC = void 0;
|
|
7
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
8
4
|
const get_field_config_map_definition_1 = require("./get-field-config-map-definition");
|
|
9
5
|
const getInputITC = (params) => {
|
|
10
6
|
const { schemaComposer, inputObjectInfo } = params;
|
|
11
7
|
const { title, description, name, fieldInfoList } = inputObjectInfo;
|
|
12
|
-
const upperFirstCamelCaseName = lodash_1.default.upperFirst(lodash_1.default.camelCase(name));
|
|
13
8
|
const { fieldConfigMapDefinition } = (0, get_field_config_map_definition_1.getFieldConfigMapDefinition)({
|
|
14
9
|
fieldInfoList
|
|
15
10
|
});
|
|
16
11
|
const definition = {
|
|
17
|
-
name
|
|
12
|
+
name,
|
|
18
13
|
fields: fieldConfigMapDefinition
|
|
19
14
|
};
|
|
20
15
|
const inputITC = schemaComposer.createInputTC(definition);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-output-otc.d.ts","sourceRoot":"","sources":["../../../../src/utils/handle-form-info-list/utils/get-output-otc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAgC,MAAM,iBAAiB,CAAC;AAGnF,UAAU,kBAAmB,SAAQ,oBAAoB;IACvD,gBAAgB,EAAE,UAAU,CAAC;CAC9B;AAED,UAAU,eAAe;IACvB,SAAS,EAAE,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;CACzC;AAED,KAAK,YAAY,GAAG,CAAC,MAAM,EAAE,kBAAkB,KAAK,eAAe,CAAC;AAEpE,eAAO,MAAM,YAAY,EAAE,YAuB1B,CAAC"}
|
|
@@ -1,30 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.getOutputOTC = void 0;
|
|
7
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
8
4
|
const get_field_config_map_definition_1 = require("./get-field-config-map-definition");
|
|
9
5
|
const getOutputOTC = (params) => {
|
|
10
6
|
const { schemaComposer, outputObjectInfo } = params;
|
|
11
7
|
const { title, description, name, fieldInfoList } = outputObjectInfo;
|
|
12
|
-
const upperFirstCamelCaseName = lodash_1.default.upperFirst(lodash_1.default.camelCase(name));
|
|
13
8
|
const { fieldConfigMapDefinition } = (0, get_field_config_map_definition_1.getFieldConfigMapDefinition)({
|
|
14
9
|
fieldInfoList
|
|
15
10
|
});
|
|
16
11
|
const definition = {
|
|
17
|
-
name
|
|
12
|
+
name,
|
|
18
13
|
fields: fieldConfigMapDefinition
|
|
19
14
|
};
|
|
20
15
|
const outputOTC = schemaComposer.createObjectTC(definition);
|
|
21
16
|
outputOTC.setDescription(`${title}${description ? `:${description}` : ''}`);
|
|
22
|
-
outputOTC.addResolver({
|
|
23
|
-
name: 'submit',
|
|
24
|
-
type: outputOTC,
|
|
25
|
-
args: outputOTC.getInputTypeComposer().getFields(),
|
|
26
|
-
resolve: undefined
|
|
27
|
-
});
|
|
28
17
|
const res = {
|
|
29
18
|
outputOTC
|
|
30
19
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ldsg/forms",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.26",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "MIT",
|
|
@@ -14,10 +14,11 @@
|
|
|
14
14
|
"@formily/json-schema": "^2.3.1",
|
|
15
15
|
"json-schema": "^0.4.0",
|
|
16
16
|
"lodash": "^4.17.21",
|
|
17
|
-
"
|
|
18
|
-
"@ldsg/
|
|
19
|
-
"@ldsg/
|
|
20
|
-
"@ldsg/
|
|
17
|
+
"zod": "^4.1.11",
|
|
18
|
+
"@ldsg/resource": "0.3.26",
|
|
19
|
+
"@ldsg/handler": "0.3.26",
|
|
20
|
+
"@ldsg/resource-definition": "0.3.26",
|
|
21
|
+
"@ldsg/field-type": "0.3.26"
|
|
21
22
|
},
|
|
22
23
|
"devDependencies": {
|
|
23
24
|
"@types/jest": "^29.5.2",
|
|
@@ -31,11 +32,11 @@
|
|
|
31
32
|
"ts-jest": "^29.1.5",
|
|
32
33
|
"ts-node": "^10.9.2",
|
|
33
34
|
"typescript": "^5.8.3",
|
|
34
|
-
"@ldsg/graphql": "0.3.
|
|
35
|
-
"@ldsg/object": "0.3.
|
|
36
|
-
"@ldsg/
|
|
37
|
-
"@ldsg/
|
|
38
|
-
"@ldsg/
|
|
35
|
+
"@ldsg/graphql": "0.3.26",
|
|
36
|
+
"@ldsg/object": "0.3.26",
|
|
37
|
+
"@ldsg/workflow": "0.3.26",
|
|
38
|
+
"@ldsg/object-field": "0.3.26",
|
|
39
|
+
"@ldsg/types": "0.3.26"
|
|
39
40
|
},
|
|
40
41
|
"publishConfig": {
|
|
41
42
|
"access": "public"
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { SchemaComposerParams } from '@ldsg/graphql';
|
|
2
|
-
import { ObjectTypeComposerFieldConfigMapDefinition } from 'graphql-compose';
|
|
3
|
-
import { FormInfo } from '../../types';
|
|
4
|
-
interface GetNewFieldsParams extends SchemaComposerParams {
|
|
5
|
-
formInfoList: FormInfo[];
|
|
6
|
-
}
|
|
7
|
-
interface GetNewFieldsRes {
|
|
8
|
-
newFields: ObjectTypeComposerFieldConfigMapDefinition<any, any>;
|
|
9
|
-
}
|
|
10
|
-
type GetNewFields = (params: GetNewFieldsParams) => GetNewFieldsRes;
|
|
11
|
-
export declare const getNewFields: GetNewFields;
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/get-new-fields/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,0CAA0C,EAAsB,MAAM,iBAAiB,CAAC;AAEjG,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvC,UAAU,kBAAmB,SAAQ,oBAAoB;IACvD,YAAY,EAAE,QAAQ,EAAE,CAAC;CAC1B;AAED,UAAU,eAAe;IACvB,SAAS,EAAE,0CAA0C,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;CACjE;AAED,KAAK,YAAY,GAAG,CAAC,MAAM,EAAE,kBAAkB,KAAK,eAAe,CAAC;AAEpE,eAAO,MAAM,YAAY,EAAE,YA+B1B,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getNewFields = void 0;
|
|
7
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
8
|
-
const utils_1 = require("./utils");
|
|
9
|
-
const getNewFields = (params) => {
|
|
10
|
-
const { schemaComposer, formInfoList } = params;
|
|
11
|
-
const newFields = {};
|
|
12
|
-
formInfoList.forEach((formInfo) => {
|
|
13
|
-
const { title, description, name, inputObjectInfo, outputObjectInfo } = formInfo;
|
|
14
|
-
const graphqlFieldName = lodash_1.default.camelCase(name);
|
|
15
|
-
const { outputOTC } = (0, utils_1.getOutputOTC)({ schemaComposer, outputObjectInfo });
|
|
16
|
-
const { inputITC } = (0, utils_1.getInputITC)({ schemaComposer, inputObjectInfo });
|
|
17
|
-
const resolverDefinition = {
|
|
18
|
-
name: graphqlFieldName,
|
|
19
|
-
description: `${title}${description ? `:${description}` : ''}`,
|
|
20
|
-
type: outputOTC,
|
|
21
|
-
args: inputITC.getFields()
|
|
22
|
-
};
|
|
23
|
-
const fieldResolver = schemaComposer.createResolver(resolverDefinition);
|
|
24
|
-
newFields[graphqlFieldName] = fieldResolver;
|
|
25
|
-
});
|
|
26
|
-
const res = {
|
|
27
|
-
newFields
|
|
28
|
-
};
|
|
29
|
-
return res;
|
|
30
|
-
};
|
|
31
|
-
exports.getNewFields = getNewFields;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-field-config-map-definition.d.ts","sourceRoot":"","sources":["../../../../src/utils/get-new-fields/utils/get-field-config-map-definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzC,UAAU,iCAAiC;IACzC,aAAa,EAAE,SAAS,EAAE,CAAC;CAC5B;AAED,UAAU,8BAA8B;IACtC,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC/C;AAED,KAAK,2BAA2B,GAAG,CACjC,MAAM,EAAE,iCAAiC,KACtC,8BAA8B,CAAC;AAEpC,eAAO,MAAM,2BAA2B,EAAE,2BAyBzC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-graphql-type-by-common-type.d.ts","sourceRoot":"","sources":["../../../../src/utils/get-new-fields/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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-graphql-type-by-type-info.d.ts","sourceRoot":"","sources":["../../../../src/utils/get-new-fields/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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-input-itc.d.ts","sourceRoot":"","sources":["../../../../src/utils/get-new-fields/utils/get-input-itc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAA+B,MAAM,iBAAiB,CAAC;AAIjF,UAAU,iBAAkB,SAAQ,oBAAoB;IACtD,eAAe,EAAE,UAAU,CAAC;CAC7B;AAED,UAAU,cAAc;IACtB,QAAQ,EAAE,iBAAiB,CAAC,GAAG,CAAC,CAAC;CAClC;AAED,KAAK,WAAW,GAAG,CAAC,MAAM,EAAE,iBAAiB,KAAK,cAAc,CAAC;AAEjE,eAAO,MAAM,WAAW,EAAE,WAyBzB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-output-otc.d.ts","sourceRoot":"","sources":["../../../../src/utils/get-new-fields/utils/get-output-otc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAgC,MAAM,iBAAiB,CAAC;AAInF,UAAU,kBAAmB,SAAQ,oBAAoB;IACvD,gBAAgB,EAAE,UAAU,CAAC;CAC9B;AAED,UAAU,eAAe;IACvB,SAAS,EAAE,kBAAkB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;CACzC;AAED,KAAK,YAAY,GAAG,CAAC,MAAM,EAAE,kBAAkB,KAAK,eAAe,CAAC;AAEpE,eAAO,MAAM,YAAY,EAAE,YAgC1B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/get-new-fields/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./get-input-itc"), exports);
|
|
18
|
-
__exportStar(require("./get-output-otc"), exports);
|
package/dist/utils/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC"}
|
package/dist/utils/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./add-query-fields"), exports);
|
|
18
|
-
__exportStar(require("./get-new-fields"), exports);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/utils/{get-new-fields → handle-form-info-list}/utils/get-graphql-type-by-type-info.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|