@ldsg/object 0.3.37 → 0.3.40

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.
@@ -1,13 +1,8 @@
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
- const constants_1 = require("@ldsg/constants");
7
3
  const field_type_1 = require("@ldsg/field-type");
8
4
  const handler_1 = require("@ldsg/handler");
9
5
  const resource_1 = require("@ldsg/resource");
10
- const lodash_1 = __importDefault(require("lodash"));
11
6
  const resource_2 = require("../resource");
12
7
  class MockObjectFieldResource extends resource_1.Resource {
13
8
  constructor() {
@@ -21,10 +16,9 @@ class MockObjectFieldResource extends resource_1.Resource {
21
16
  });
22
17
  const fieldInfo = {
23
18
  id,
19
+ slug,
24
20
  title,
25
21
  description,
26
- name: lodash_1.default.camelCase(slug),
27
- dbKey: lodash_1.default.snakeCase(slug),
28
22
  typeInfo: fieldTypeInfo,
29
23
  };
30
24
  const res = {
@@ -40,11 +34,11 @@ test("object", () => {
40
34
  const testObject = new resource_2.ObjectResource({
41
35
  id: "test-object",
42
36
  kind: "object",
43
- parentId: constants_1.ROOT_RESOURCE_ID,
37
+ parentId: null,
44
38
  settings: {
39
+ slug: "test",
45
40
  title: "测试对象",
46
41
  description: "",
47
- slug: "test",
48
42
  },
49
43
  });
50
44
  new MockObjectFieldResource({
@@ -52,9 +46,9 @@ test("object", () => {
52
46
  kind: "object_field",
53
47
  parentId: "test-object",
54
48
  settings: {
49
+ slug: "test1",
55
50
  title: "测试对象测试1对象字段",
56
51
  description: "",
57
- slug: "test1",
58
52
  fieldTypeResourceId: field_type_1.stringFieldTypeResourceRecord.id,
59
53
  properties: {
60
54
  max: "10",
@@ -1 +1 @@
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,+BAQnE,CAAC;AAEJ,eAAO,MAAM,6CAA6C,EAAE,uBAG3D,CAAC;AAEF,eAAO,MAAM,8CAA8C,EAAE,0CAG1D,CAAC"}
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,uBAIpE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,uDAAuD,EAAE,+BAQnE,CAAC;AAEJ,eAAO,MAAM,6CAA6C,EAAE,uBAI3D,CAAC;AAEF,eAAO,MAAM,8CAA8C,EAAE,0CAG1D,CAAC"}
package/dist/constants.js CHANGED
@@ -6,6 +6,7 @@ exports.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS = exports.RESOURCE_DEFINI
6
6
  * 实例化资源处理程序普通资源配置
7
7
  */
8
8
  exports.INSTANTIATE_RESOURCE_HANDLER_GENERAL_RESOURCE_SETTINGS = {
9
+ slug: "object-instantiate-resource-handler",
9
10
  title: "对象实例化资源处理程序",
10
11
  description: "",
11
12
  };
@@ -23,6 +24,7 @@ exports.INSTANTIATE_RESOURCE_HANDLER_SPECIFIC_RESOURCE_SETTINGS = {
23
24
  ],
24
25
  };
25
26
  exports.RESOURCE_DEFINITION_GENERAL_RESOURCE_SETTINGS = {
27
+ slug: "object-resource-definition",
26
28
  title: "对象资源定义",
27
29
  description: "",
28
30
  };
@@ -3,16 +3,6 @@ import { Resource } from "@ldsg/resource";
3
3
  import { GeneralResourceSettings } from "@ldsg/types";
4
4
  import { FieldInfo, ObjectSpecificResourceSettings } from "./types";
5
5
  export interface ObjectInfo extends GeneralResourceSettings {
6
- /**
7
- * Object Name
8
- * camel case
9
- */
10
- name: string;
11
- /**
12
- * Object Type Name
13
- * pascal case
14
- */
15
- objectTypeName: string;
16
6
  /**
17
7
  * Field Info List
18
8
  */
@@ -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,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEtD,OAAO,EAAE,SAAS,EAAgB,8BAA8B,EAAE,MAAM,SAAS,CAAC;AAElF,MAAM,WAAW,UAAW,SAAQ,uBAAuB;IACzD;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,cAAc,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,aAAa,EAAE,SAAS,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,KAAK,aAAa,GAAG,CAAC,MAAM,CAAC,EAAE,eAAe,KAAK,gBAAgB,CAAC;AAEpE,qBAAa,cAAe,SAAQ,QAAQ,CAAC,8BAA8B,CAAC;IAC1E,aAAa,EAAE,aAAa,CAsC1B;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,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEtD,OAAO,EAAE,SAAS,EAAgB,8BAA8B,EAAE,MAAM,SAAS,CAAC;AAElF,MAAM,WAAW,UAAW,SAAQ,uBAAuB;IACzD;;OAEG;IACH,aAAa,EAAE,SAAS,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,UAAU,EAAE,UAAU,CAAC;CACxB;AAED,KAAK,aAAa,GAAG,CAAC,MAAM,CAAC,EAAE,eAAe,KAAK,gBAAgB,CAAC;AAEpE,qBAAa,cAAe,SAAQ,QAAQ,CAAC,8BAA8B,CAAC;IAC1E,aAAa,EAAE,aAAa,CAiC1B;CACH"}
package/dist/resource.js CHANGED
@@ -11,8 +11,6 @@ class ObjectResource extends resource_1.Resource {
11
11
  super(...arguments);
12
12
  this.getObjectInfo = (params) => {
13
13
  const { id, settings: { title, description, slug }, getFilteredResources, } = this;
14
- const name = lodash_1.default.camelCase(slug);
15
- const objectTypeName = lodash_1.default.upperFirst(lodash_1.default.camelCase(slug));
16
14
  const { resources } = getFilteredResources({
17
15
  parentId: id,
18
16
  });
@@ -24,10 +22,9 @@ class ObjectResource extends resource_1.Resource {
24
22
  const filterRes = lodash_1.default.filter(mapRes, (value) => !lodash_1.default.isUndefined(value));
25
23
  const fieldInfoList = lodash_1.default.map(filterRes, "fieldInfo");
26
24
  const objectInfo = {
25
+ slug,
27
26
  title,
28
27
  description,
29
- name,
30
- objectTypeName,
31
28
  fieldInfoList,
32
29
  };
33
30
  const res = {
@@ -5,16 +5,6 @@ export interface FieldInfo extends GeneralResourceSettings {
5
5
  * Field ID
6
6
  */
7
7
  id: string;
8
- /**
9
- * Field name (camelCase, e.g. "userId")
10
- * Used as the GraphQL field name / Mongoose alias.
11
- */
12
- name: string;
13
- /**
14
- * Database field key (snake_case, e.g. "user_id")
15
- * Used as the MongoDB document field key.
16
- */
17
- dbKey: string;
18
8
  /**
19
9
  * Field Type Info
20
10
  */
@@ -1 +1 @@
1
- {"version":3,"file":"get-field-info.d.ts","sourceRoot":"","sources":["../../src/types/get-field-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEtD,MAAM,WAAW,SAAU,SAAQ,uBAAuB;IACxD;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,QAAQ,EAAE,aAAa,CAAC;IAExB;;OAEG;IACH,aAAa,CAAC,EAAE,SAAS,EAAE,CAAC;CAC7B;AAED,UAAU,eAAe;IACvB,SAAS,EAAE,SAAS,CAAC;CACtB;AAED,MAAM,MAAM,YAAY,GAAG,CAAC,MAAM,CAAC,EAAE,eAAe,KAAK,eAAe,GAAG,SAAS,CAAC"}
1
+ {"version":3,"file":"get-field-info.d.ts","sourceRoot":"","sources":["../../src/types/get-field-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEtD,MAAM,WAAW,SAAU,SAAQ,uBAAuB;IACxD;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,QAAQ,EAAE,aAAa,CAAC;IAExB;;OAEG;IACH,aAAa,CAAC,EAAE,SAAS,EAAE,CAAC;CAC7B;AAED,UAAU,eAAe;IACvB,SAAS,EAAE,SAAS,CAAC;CACtB;AAED,MAAM,MAAM,YAAY,GAAG,CAAC,MAAM,CAAC,EAAE,eAAe,KAAK,eAAe,GAAG,SAAS,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ldsg/object",
3
- "version": "0.3.37",
3
+ "version": "0.3.40",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -16,12 +16,12 @@
16
16
  "dependencies": {
17
17
  "lodash": "^4.17.21",
18
18
  "zod": "^4.1.11",
19
- "@ldsg/constants": "0.3.37",
20
- "@ldsg/field-type": "0.3.37",
21
- "@ldsg/resource": "0.3.37",
22
- "@ldsg/resource-definition": "0.3.37",
23
- "@ldsg/handler": "0.3.37",
24
- "@ldsg/types": "0.3.37"
19
+ "@ldsg/resource": "0.3.40",
20
+ "@ldsg/handler": "0.3.40",
21
+ "@ldsg/field-type": "0.3.40",
22
+ "@ldsg/resource-definition": "0.3.40",
23
+ "@ldsg/types": "0.3.40",
24
+ "@ldsg/constants": "0.3.40"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@types/jest": "^29.5.2",