@ldsg/tables 0.3.8 → 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.
- package/dist/constants.d.ts +3 -3
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +10 -9
- package/dist/handler.d.ts +5 -7
- package/dist/handler.d.ts.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/instantiate-resource.d.ts +4 -4
- package/dist/instantiate-resource.js +1 -1
- package/dist/resource.d.ts +4 -4
- package/dist/resource.d.ts.map +1 -1
- package/dist/resource.js +3 -3
- package/dist/types/get-table-info.d.ts +3 -3
- package/dist/types/index.d.ts +2 -2
- package/dist/types/specific-resource-settings.d.ts +1 -1
- package/dist/types/specific-resource-settings.d.ts.map +1 -1
- package/dist/utils/add-fields/constants.d.ts +1 -1
- package/dist/utils/add-fields/constants.js +17 -17
- package/dist/utils/add-fields/index.d.ts +3 -3
- package/dist/utils/add-fields/index.d.ts.map +1 -1
- package/dist/utils/add-fields/index.js +18 -5
- package/dist/utils/add-fields/utils/get-object-type-composer.d.ts +3 -3
- package/dist/utils/add-fields/utils/get-object-type-composer.d.ts.map +1 -1
- package/dist/utils/add-fields/utils/get-object-type-composer.js +2 -2
- package/dist/utils/add-fields/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/package.json +23 -18
package/dist/constants.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { HandlerSpecificResourceSettings } from
|
|
2
|
-
import { ResourceDefinitionSpecificResourceSettings } from
|
|
3
|
-
import { GeneralResourceSettings } from
|
|
1
|
+
import { HandlerSpecificResourceSettings } from '@ldsg/handler';
|
|
2
|
+
import { ResourceDefinitionSpecificResourceSettings } from '@ldsg/resource-definition';
|
|
3
|
+
import { GeneralResourceSettings } from '@ldsg/types';
|
|
4
4
|
/**
|
|
5
5
|
* Instantiate Resource Handler General Resource Settings
|
|
6
6
|
* 实例化资源处理程序普通资源配置
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,0CAA0C,EAAE,MAAM,2BAA2B,CAAC;AACvF,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEtD;;;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,0CAE5D,CAAC"}
|
package/dist/constants.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS = exports.RESOURCE_DEFINITION_GENERAL_RESOURCE_SETTINGS = exports.INSTANTIATE_RESOURCE_HANDLER_SPECIFIC_RESOURCE_SETTINGS = exports.INSTANTIATE_RESOURCE_HANDLER_GENERAL_RESOURCE_SETTINGS = void 0;
|
|
4
|
-
const application_1 = require("@ldsg/application");
|
|
5
4
|
/**
|
|
6
5
|
* Instantiate Resource Handler General Resource Settings
|
|
7
6
|
* 实例化资源处理程序普通资源配置
|
|
8
7
|
*/
|
|
9
8
|
exports.INSTANTIATE_RESOURCE_HANDLER_GENERAL_RESOURCE_SETTINGS = {
|
|
10
|
-
title:
|
|
11
|
-
description:
|
|
9
|
+
title: '表格组实例化资源处理程序',
|
|
10
|
+
description: ''
|
|
12
11
|
};
|
|
13
12
|
/**
|
|
14
13
|
* Instantiate Resource Handler Specific Resource Settings
|
|
@@ -19,12 +18,14 @@ exports.INSTANTIATE_RESOURCE_HANDLER_SPECIFIC_RESOURCE_SETTINGS = {
|
|
|
19
18
|
code: `export * from "@ldsg/tables";`,
|
|
20
19
|
dependencies: [
|
|
21
20
|
{
|
|
22
|
-
name:
|
|
23
|
-
}
|
|
24
|
-
]
|
|
21
|
+
name: '@ldsg/tables'
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
};
|
|
25
|
+
exports.RESOURCE_DEFINITION_GENERAL_RESOURCE_SETTINGS = {
|
|
26
|
+
title: '表格组资源定义',
|
|
27
|
+
description: ''
|
|
25
28
|
};
|
|
26
|
-
exports.RESOURCE_DEFINITION_GENERAL_RESOURCE_SETTINGS = { title: "表格组资源定义", description: "" };
|
|
27
29
|
exports.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS = {
|
|
28
|
-
kind:
|
|
29
|
-
parentKind: application_1.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS.kind,
|
|
30
|
+
kind: 'tables'
|
|
30
31
|
};
|
package/dist/handler.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { Handler, HandlerExtendedResourceSettings } from
|
|
2
|
-
import { InstantiateResourceParams, InstantiateResourceRes } from
|
|
3
|
-
import { TablesResource } from
|
|
4
|
-
import { TablesSpecificResourceSettings } from
|
|
5
|
-
export declare const handler: Handler<
|
|
6
|
-
InstantiateResourceParams<HandlerExtendedResourceSettings<TablesSpecificResourceSettings>>
|
|
7
|
-
], InstantiateResourceRes<TablesResource>>;
|
|
1
|
+
import { Handler, HandlerExtendedResourceSettings } from '@ldsg/handler';
|
|
2
|
+
import { InstantiateResourceParams, InstantiateResourceRes } from '@ldsg/resource';
|
|
3
|
+
import { TablesResource } from './resource';
|
|
4
|
+
import { TablesSpecificResourceSettings } from './types';
|
|
5
|
+
export declare const handler: Handler<InstantiateResourceParams<HandlerExtendedResourceSettings<TablesSpecificResourceSettings>>, InstantiateResourceRes<TablesResource>>;
|
|
8
6
|
//# sourceMappingURL=handler.d.ts.map
|
package/dist/handler.d.ts.map
CHANGED
|
@@ -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,
|
|
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,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAC;AAEzD,eAAO,MAAM,OAAO,EAAE,OAAO,CAC3B,yBAAyB,CAAC,+BAA+B,CAAC,8BAA8B,CAAC,CAAC,EAC1F,sBAAsB,CAAC,cAAc,CAAC,CACjB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
1
|
+
export * from './constants';
|
|
2
|
+
export * from './handler';
|
|
3
|
+
export * from './instantiate-resource';
|
|
4
|
+
export * from './resource';
|
|
5
|
+
export * from './types';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { HandlerExtendedResourceSettings } from
|
|
2
|
-
import { InstantiateResource } from
|
|
3
|
-
import { TablesResource } from
|
|
4
|
-
import { TablesSpecificResourceSettings } from
|
|
1
|
+
import { HandlerExtendedResourceSettings } from '@ldsg/handler';
|
|
2
|
+
import { InstantiateResource } from '@ldsg/resource';
|
|
3
|
+
import { TablesResource } from './resource';
|
|
4
|
+
import { TablesSpecificResourceSettings } from './types';
|
|
5
5
|
export declare const instantiateResource: InstantiateResource<HandlerExtendedResourceSettings<TablesSpecificResourceSettings>, TablesResource>;
|
|
6
6
|
//# sourceMappingURL=instantiate-resource.d.ts.map
|
package/dist/resource.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { PlatformsParams } from
|
|
2
|
-
import { ModifyGraphQLSchema } from
|
|
3
|
-
import { Resource } from
|
|
4
|
-
import { TableInfo, TablesSpecificResourceSettings } from
|
|
1
|
+
import { PlatformsParams } from '@ldsg/field-type';
|
|
2
|
+
import { ModifyGraphQLSchema } from '@ldsg/graphql';
|
|
3
|
+
import { Resource } from '@ldsg/resource';
|
|
4
|
+
import { TableInfo, TablesSpecificResourceSettings } from './types';
|
|
5
5
|
interface GetTableInfoListRes {
|
|
6
6
|
/**
|
|
7
7
|
* Table Info List
|
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,
|
|
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,EAAgB,SAAS,EAAE,8BAA8B,EAAE,MAAM,SAAS,CAAC;AAGlF,UAAU,mBAAmB;IAC3B;;OAEG;IACH,aAAa,EAAE,SAAS,EAAE,CAAC;CAC5B;AAED,KAAK,gBAAgB,GAAG,CAAC,MAAM,CAAC,EAAE,eAAe,KAAK,mBAAmB,CAAC;AAE1E,qBAAa,cAAe,SAAQ,QAAQ,CAAC,8BAA8B,CAAC;IAC1E,gBAAgB,EAAE,gBAAgB,CAoBhC;IAEF,mBAAmB,EAAE,mBAAmB,CAStC;CACH"}
|
package/dist/resource.js
CHANGED
|
@@ -13,7 +13,7 @@ class TablesResource extends resource_1.Resource {
|
|
|
13
13
|
this.getTableInfoList = (params) => {
|
|
14
14
|
const { id, getFilteredResources } = this;
|
|
15
15
|
const { resources } = getFilteredResources({
|
|
16
|
-
parentId: id
|
|
16
|
+
parentId: id
|
|
17
17
|
});
|
|
18
18
|
const mapRes = resources.map((resource) => {
|
|
19
19
|
var _a;
|
|
@@ -21,7 +21,7 @@ class TablesResource extends resource_1.Resource {
|
|
|
21
21
|
});
|
|
22
22
|
const tableInfoList = lodash_1.default.filter(mapRes, (value) => !lodash_1.default.isUndefined(value));
|
|
23
23
|
const res = {
|
|
24
|
-
tableInfoList
|
|
24
|
+
tableInfoList
|
|
25
25
|
};
|
|
26
26
|
return res;
|
|
27
27
|
};
|
|
@@ -30,7 +30,7 @@ class TablesResource extends resource_1.Resource {
|
|
|
30
30
|
const { tableInfoList } = this.getTableInfoList();
|
|
31
31
|
(0, utils_1.addFields)({
|
|
32
32
|
tableInfoList,
|
|
33
|
-
schemaComposer
|
|
33
|
+
schemaComposer
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
36
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PlatformsParams } from
|
|
2
|
-
import { ObjectInfo } from
|
|
3
|
-
import { GeneralResourceSettings } from
|
|
1
|
+
import { PlatformsParams } from '@ldsg/field-type';
|
|
2
|
+
import { ObjectInfo } from '@ldsg/object';
|
|
3
|
+
import { GeneralResourceSettings } from '@ldsg/types';
|
|
4
4
|
export interface TableInfo extends GeneralResourceSettings {
|
|
5
5
|
/**
|
|
6
6
|
* Table Name
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from './get-table-info';
|
|
2
|
+
export * from './specific-resource-settings';
|
|
3
3
|
//# sourceMappingURL=index.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,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,WAAW,
|
|
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;AAEvD,MAAM,WAAW,8BAA+B,SAAQ,wBAAwB;CAAG"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { resolverFactory } from
|
|
1
|
+
import { resolverFactory } from 'graphql-compose-mongoose';
|
|
2
2
|
export type ResolverFactoryKeyList = (keyof typeof resolverFactory)[];
|
|
3
3
|
export declare const MUTATION_RESOLVER_FACTORY_KEY_LIST: ResolverFactoryKeyList;
|
|
4
4
|
export declare const QUERY_RESOLVER_FACTORY_KEY_LIST: ResolverFactoryKeyList;
|
|
@@ -2,23 +2,23 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.QUERY_RESOLVER_FACTORY_KEY_LIST = exports.MUTATION_RESOLVER_FACTORY_KEY_LIST = void 0;
|
|
4
4
|
exports.MUTATION_RESOLVER_FACTORY_KEY_LIST = [
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
'createOne',
|
|
6
|
+
'createMany',
|
|
7
|
+
'updateById',
|
|
8
|
+
'updateOne',
|
|
9
|
+
'updateMany',
|
|
10
|
+
'removeById',
|
|
11
|
+
'removeOne',
|
|
12
|
+
'removeMany'
|
|
13
13
|
];
|
|
14
14
|
exports.QUERY_RESOLVER_FACTORY_KEY_LIST = [
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
'findById',
|
|
16
|
+
'findByIds',
|
|
17
|
+
'findOne',
|
|
18
|
+
'findMany',
|
|
19
|
+
'dataLoader',
|
|
20
|
+
'dataLoaderMany',
|
|
21
|
+
'count',
|
|
22
|
+
'connection',
|
|
23
|
+
'pagination'
|
|
24
24
|
];
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { SchemaComposerParams } from
|
|
2
|
-
import { TableInfo } from
|
|
1
|
+
import { SchemaComposerParams } from '@ldsg/graphql';
|
|
2
|
+
import { TableInfo } from '../../types';
|
|
3
|
+
export * from './constants';
|
|
3
4
|
interface AddFieldsParams extends SchemaComposerParams {
|
|
4
5
|
tableInfoList: TableInfo[];
|
|
5
6
|
}
|
|
6
7
|
type AddFields = (params: AddFieldsParams) => void;
|
|
7
8
|
export declare const addFields: AddFields;
|
|
8
|
-
export {};
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/add-fields/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAGrD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAQxC,UAAU,eAAgB,SAAQ,oBAAoB;IACpD,aAAa,EAAE,SAAS,EAAE,CAAC;CAC5B;AAED,KAAK,SAAS,GAAG,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;AAEnD,eAAO,MAAM,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/add-fields/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAGrD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAQxC,cAAc,aAAa,CAAC;AAE5B,UAAU,eAAgB,SAAQ,oBAAoB;IACpD,aAAa,EAAE,SAAS,EAAE,CAAC;CAC5B;AAED,KAAK,SAAS,GAAG,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAC;AAEnD,eAAO,MAAM,SAAS,EAAE,SAiCvB,CAAC"}
|
|
@@ -1,4 +1,18 @@
|
|
|
1
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
|
+
};
|
|
2
16
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
18
|
};
|
|
@@ -8,6 +22,7 @@ const graphql_compose_mongoose_1 = require("graphql-compose-mongoose");
|
|
|
8
22
|
const lodash_1 = __importDefault(require("lodash"));
|
|
9
23
|
const constants_1 = require("./constants");
|
|
10
24
|
const utils_1 = require("./utils");
|
|
25
|
+
__exportStar(require("./constants"), exports);
|
|
11
26
|
const addFields = (params) => {
|
|
12
27
|
const { schemaComposer, tableInfoList } = params;
|
|
13
28
|
const mutationNewFields = {};
|
|
@@ -20,18 +35,16 @@ const addFields = (params) => {
|
|
|
20
35
|
const { title, description, name: tableName, objectInfo } = tableInfo;
|
|
21
36
|
const { objectTypeComposer } = (0, utils_1.getObjectTypeComposer)({
|
|
22
37
|
tableName,
|
|
23
|
-
objectInfo
|
|
38
|
+
objectInfo
|
|
24
39
|
});
|
|
25
40
|
lodash_1.default.each(resolverFactoryKeys, (key) => {
|
|
26
41
|
var _a, _b, _c, _d;
|
|
27
42
|
const fieldName = lodash_1.default.camelCase(`${tableName}-${key}`);
|
|
28
43
|
if (constants_1.MUTATION_RESOLVER_FACTORY_KEY_LIST.includes(key)) {
|
|
29
|
-
mutationNewFields[fieldName] =
|
|
30
|
-
(_b = (_a = objectTypeComposer.mongooseResolvers)[key]) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
44
|
+
mutationNewFields[fieldName] = (_b = (_a = objectTypeComposer.mongooseResolvers)[key]) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
31
45
|
}
|
|
32
46
|
else if (constants_1.QUERY_RESOLVER_FACTORY_KEY_LIST.includes(key)) {
|
|
33
|
-
queryNewFields[fieldName] =
|
|
34
|
-
(_d = (_c = objectTypeComposer.mongooseResolvers)[key]) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
47
|
+
queryNewFields[fieldName] = (_d = (_c = objectTypeComposer.mongooseResolvers)[key]) === null || _d === void 0 ? void 0 : _d.call(_c);
|
|
35
48
|
}
|
|
36
49
|
});
|
|
37
50
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ObjectInfo } from
|
|
2
|
-
import { ObjectTypeComposerWithMongooseResolvers } from
|
|
3
|
-
import mongoose from
|
|
1
|
+
import { ObjectInfo } from '@ldsg/object';
|
|
2
|
+
import { ObjectTypeComposerWithMongooseResolvers } from 'graphql-compose-mongoose';
|
|
3
|
+
import mongoose from 'mongoose';
|
|
4
4
|
interface GetObjectTypeComposerParams {
|
|
5
5
|
tableName: string;
|
|
6
6
|
objectInfo: ObjectInfo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-object-type-composer.d.ts","sourceRoot":"","sources":["../../../../src/utils/add-fields/utils/get-object-type-composer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,
|
|
1
|
+
{"version":3,"file":"get-object-type-composer.d.ts","sourceRoot":"","sources":["../../../../src/utils/add-fields/utils/get-object-type-composer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAmB,uCAAuC,EAAE,MAAM,0BAA0B,CAAC;AAEpG,OAAO,QAA8B,MAAM,UAAU,CAAC;AAEtD,UAAU,2BAA2B;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,UAAU,wBAAwB;IAChC,kBAAkB,EAAE,uCAAuC,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC;CACpG;AAED,KAAK,qBAAqB,GAAG,CAAC,MAAM,EAAE,2BAA2B,KAAK,wBAAwB,CAAC;AAE/F,eAAO,MAAM,qBAAqB,EAAE,qBAuCnC,CAAC"}
|
|
@@ -12,7 +12,7 @@ const getObjectTypeComposer = (params) => {
|
|
|
12
12
|
const { fieldInfoList } = objectInfo;
|
|
13
13
|
const mongooseSchemaDefinition = {};
|
|
14
14
|
lodash_1.default.each(fieldInfoList, (fieldInfo) => {
|
|
15
|
-
const { name, typeInfo: { platformToTypeMap }
|
|
15
|
+
const { name, typeInfo: { platformToTypeMap } } = fieldInfo;
|
|
16
16
|
const { COMMON, MONGOOSE } = platformToTypeMap;
|
|
17
17
|
const type = MONGOOSE !== null && MONGOOSE !== void 0 ? MONGOOSE : COMMON;
|
|
18
18
|
mongooseSchemaDefinition[name] = type;
|
|
@@ -25,7 +25,7 @@ const getObjectTypeComposer = (params) => {
|
|
|
25
25
|
// @ts-ignore
|
|
26
26
|
mongooseModel, customizationOptions);
|
|
27
27
|
const res = {
|
|
28
|
-
objectTypeComposer
|
|
28
|
+
objectTypeComposer
|
|
29
29
|
};
|
|
30
30
|
return res;
|
|
31
31
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './get-object-type-composer';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './add-fields';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,39 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ldsg/tables",
|
|
3
|
-
"version": "0.3.
|
|
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
|
"graphql-compose-mongoose": "^10.0.0",
|
|
18
15
|
"lodash": "^4.17.21",
|
|
19
16
|
"mongoose": "^8.14.3",
|
|
20
|
-
"@ldsg/handler": "0.3.
|
|
21
|
-
"@ldsg/resource": "0.3.
|
|
22
|
-
"@ldsg/resource-definition": "0.3.
|
|
17
|
+
"@ldsg/handler": "0.3.10",
|
|
18
|
+
"@ldsg/resource": "0.3.10",
|
|
19
|
+
"@ldsg/resource-definition": "0.3.10"
|
|
23
20
|
},
|
|
24
21
|
"devDependencies": {
|
|
22
|
+
"@types/jest": "^29.5.2",
|
|
25
23
|
"@types/lodash": "^4.14.202",
|
|
26
24
|
"@types/supertest": "^6.0.0",
|
|
27
25
|
"graphql": "16.11.0",
|
|
28
26
|
"graphql-compose": "^9.1.0",
|
|
27
|
+
"jest": "^29.5.0",
|
|
29
28
|
"supertest": "^6.3.4",
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"@ldsg/
|
|
34
|
-
"@ldsg/
|
|
35
|
-
"@ldsg/
|
|
36
|
-
"@ldsg/
|
|
29
|
+
"ts-jest": "^29.1.5",
|
|
30
|
+
"ts-node": "^10.9.2",
|
|
31
|
+
"typescript": "^5.8.3",
|
|
32
|
+
"@ldsg/application": "0.3.10",
|
|
33
|
+
"@ldsg/field-type": "0.3.10",
|
|
34
|
+
"@ldsg/graphql": "0.3.10",
|
|
35
|
+
"@ldsg/object": "0.3.10",
|
|
36
|
+
"@ldsg/object-field": "0.3.10",
|
|
37
|
+
"@ldsg/types": "0.3.10",
|
|
38
|
+
"@ldsg/workflow": "0.3.10"
|
|
39
|
+
},
|
|
40
|
+
"publishConfig": {
|
|
41
|
+
"access": "public"
|
|
37
42
|
},
|
|
38
43
|
"scripts": {
|
|
39
44
|
"build": "tsc --project tsconfig.build.json",
|