@ldsg/object-field 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.
@@ -3,22 +3,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const field_type_1 = require("@ldsg/field-type");
4
4
  const handler_1 = require("@ldsg/handler");
5
5
  const resource_1 = require("../resource");
6
- test('object field', () => {
6
+ test("object field", () => {
7
7
  new handler_1.HandlerResource(field_type_1.stringFieldTypeHandlerResourceRecord);
8
8
  new field_type_1.FieldTypeResource(field_type_1.stringFieldTypeResourceRecord);
9
9
  const objectFieldResource = new resource_1.ObjectFieldResource({
10
- id: 'object-field',
11
- kind: 'object_field',
12
- parentId: 'application',
10
+ id: "object-field",
11
+ kind: "object_field",
12
+ parentId: "application",
13
13
  settings: {
14
- title: '测试字段',
15
- description: '',
16
- name: 'test',
14
+ title: "测试字段",
15
+ description: "",
16
+ name: "test",
17
17
  fieldTypeResourceId: field_type_1.stringFieldTypeResourceRecord.id,
18
18
  properties: {
19
- max: '10'
20
- }
21
- }
19
+ max: "10",
20
+ },
21
+ },
22
22
  });
23
23
  const getFieldInfoRes = objectFieldResource.getFieldInfo();
24
24
  expect(getFieldInfoRes).toMatchSnapshot();
@@ -1,6 +1,6 @@
1
- import { HandlerSpecificResourceSettings } from '@ldsg/handler';
2
- import { ResourceDefinitionSpecificResourceSettings } from '@ldsg/resource-definition';
3
- import { GeneralResourceSettings } from '@ldsg/types';
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
  * 实例化资源处理程序普通资源配置
@@ -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,+BAOrE,CAAC;AAEF,eAAO,MAAM,6CAA6C,EAAE,uBAG3D,CAAC;AAEF,eAAO,MAAM,8CAA8C,EAAE,0CAE5D,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,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"}
package/dist/constants.js CHANGED
@@ -6,8 +6,8 @@ exports.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS = exports.RESOURCE_DEFINI
6
6
  * 实例化资源处理程序普通资源配置
7
7
  */
8
8
  exports.INSTANTIATE_RESOURCE_HANDLER_GENERAL_RESOURCE_SETTINGS = {
9
- title: '对象字段实例化资源处理程序',
10
- description: ''
9
+ title: "对象字段实例化资源处理程序",
10
+ description: "",
11
11
  };
12
12
  /**
13
13
  * Instantiate Resource Handler Specific Resource Settings
@@ -18,14 +18,14 @@ exports.INSTANTIATE_RESOURCE_HANDLER_SPECIFIC_RESOURCE_SETTINGS = {
18
18
  code: `export * from "@ldsg/object-field";`,
19
19
  dependencies: [
20
20
  {
21
- name: '@ldsg/object-field'
22
- }
23
- ]
21
+ name: "@ldsg/object-field",
22
+ },
23
+ ],
24
24
  };
25
25
  exports.RESOURCE_DEFINITION_GENERAL_RESOURCE_SETTINGS = {
26
- title: '对象字段资源定义',
27
- description: ''
26
+ title: "对象字段资源定义",
27
+ description: "",
28
28
  };
29
29
  exports.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS = {
30
- kind: 'object_field'
30
+ kind: "object_field",
31
31
  };
package/dist/handler.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { Handler, HandlerExtendedResourceSettings } from '@ldsg/handler';
2
- import { InstantiateResourceParams, InstantiateResourceRes } from '@ldsg/resource';
3
- import { ObjectFieldResource } from './resource';
4
- import { ObjectFieldSpecificResourceSettings } from './types';
1
+ import { Handler, HandlerExtendedResourceSettings } from "@ldsg/handler";
2
+ import { InstantiateResourceParams, InstantiateResourceRes } from "@ldsg/resource";
3
+ import { ObjectFieldResource } from "./resource";
4
+ import { ObjectFieldSpecificResourceSettings } from "./types";
5
5
  export declare const handler: Handler<InstantiateResourceParams<HandlerExtendedResourceSettings<ObjectFieldSpecificResourceSettings>>, InstantiateResourceRes<ObjectFieldResource>>;
6
6
  //# sourceMappingURL=handler.d.ts.map
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- export * from './constants';
2
- export * from './handler';
3
- export * from './instantiate-resource';
4
- export * from './resource';
5
- export * from './types';
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 '@ldsg/handler';
2
- import { InstantiateResource } from '@ldsg/resource';
3
- import { ObjectFieldResource } from './resource';
4
- import { ObjectFieldSpecificResourceSettings } from './types';
1
+ import { HandlerExtendedResourceSettings } from "@ldsg/handler";
2
+ import { InstantiateResource } from "@ldsg/resource";
3
+ import { ObjectFieldResource } from "./resource";
4
+ import { ObjectFieldSpecificResourceSettings } from "./types";
5
5
  export declare const instantiateResource: InstantiateResource<HandlerExtendedResourceSettings<ObjectFieldSpecificResourceSettings>, ObjectFieldResource>;
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.ObjectFieldResource(resourceConstructorParams);
8
8
  const res = {
9
- resource
9
+ resource,
10
10
  };
11
11
  return res;
12
12
  };
@@ -1,6 +1,6 @@
1
- import { GetFieldInfo } from '@ldsg/object';
2
- import { Resource } from '@ldsg/resource';
3
- import { ObjectFieldSpecificResourceSettings } from './types';
1
+ import { GetFieldInfo } from "@ldsg/object";
2
+ import { Resource } from "@ldsg/resource";
3
+ import { ObjectFieldSpecificResourceSettings } from "./types";
4
4
  export declare class ObjectFieldResource extends Resource<ObjectFieldSpecificResourceSettings> {
5
5
  getFieldInfo: GetFieldInfo;
6
6
  }
package/dist/resource.js CHANGED
@@ -7,23 +7,23 @@ class ObjectFieldResource extends resource_1.Resource {
7
7
  constructor() {
8
8
  super(...arguments);
9
9
  this.getFieldInfo = (params) => {
10
- const { id, settings: { title, description, name, properties }, getResourcesFromSettings, getFilteredResources } = this;
10
+ const { id, settings: { title, description, name, properties }, getResourcesFromSettings, getFilteredResources, } = this;
11
11
  const { fieldTypeResource } = getResourcesFromSettings();
12
12
  const { fieldTypeInfo } = fieldTypeResource.getFieldTypeInfo({
13
13
  ...params,
14
- fieldProperties: properties
14
+ fieldProperties: properties,
15
15
  });
16
16
  const fieldInfo = {
17
17
  id,
18
18
  title,
19
19
  description,
20
20
  name,
21
- typeInfo: fieldTypeInfo
21
+ typeInfo: fieldTypeInfo,
22
22
  };
23
23
  const commonType = fieldTypeInfo.platformToTypeMap[field_type_1.FieldTypeBasePlatform.COMMON];
24
- if ((commonType === null || commonType === void 0 ? void 0 : commonType.type) === 'object' || (commonType === null || commonType === void 0 ? void 0 : commonType.type) === 'array') {
24
+ if ((commonType === null || commonType === void 0 ? void 0 : commonType.type) === "object" || (commonType === null || commonType === void 0 ? void 0 : commonType.type) === "array") {
25
25
  const { resources } = getFilteredResources({
26
- parentId: this.id
26
+ parentId: this.id,
27
27
  });
28
28
  if (resources.length > 0) {
29
29
  const nestedFieldInfoList = [];
@@ -38,7 +38,7 @@ class ObjectFieldResource extends resource_1.Resource {
38
38
  }
39
39
  }
40
40
  const res = {
41
- fieldInfo
41
+ fieldInfo,
42
42
  };
43
43
  return res;
44
44
  };
@@ -1,2 +1,2 @@
1
- export * from './specific-resource-settings';
1
+ export * from "./specific-resource-settings";
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- import { z } from 'zod';
1
+ import { z } from "zod";
2
2
  export declare const ObjectFieldSpecificResourceSettingsSchema: z.ZodObject<{
3
3
  name: z.ZodString;
4
4
  fieldTypeResourceId: z.ZodString;
@@ -1 +1 @@
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,yCAAyC;;;;8BAiBlC,CAAC;AAErB,eAAO,MAAM,8BAA8B;;;;8BAA4C,CAAC;AACxF,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yCAAyC,CAAC,CAAC"}
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,yCAAyC;;;;8BAiBlC,CAAC;AAErB,eAAO,MAAM,8BAA8B;;;;8BAA4C,CAAC;AACxF,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,yCAAyC,CACjD,CAAC"}
@@ -15,7 +15,7 @@ exports.ObjectFieldSpecificResourceSettingsSchema = zod_1.z
15
15
  /**
16
16
  * Field Properties
17
17
  */
18
- properties: zod_1.z.any()
18
+ properties: zod_1.z.any(),
19
19
  })
20
20
  .catchall(zod_1.z.any());
21
21
  exports.SpecificResourceSettingsSchema = exports.ObjectFieldSpecificResourceSettingsSchema;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ldsg/object-field",
3
- "version": "0.3.30",
3
+ "version": "0.3.32",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -12,20 +12,22 @@
12
12
  ],
13
13
  "dependencies": {
14
14
  "zod": "^4.1.11",
15
- "@ldsg/handler": "0.3.30",
16
- "@ldsg/resource-definition": "0.3.30",
17
- "@ldsg/resource": "0.3.30",
18
- "@ldsg/field-type": "0.3.30"
15
+ "@ldsg/handler": "0.3.32",
16
+ "@ldsg/field-type": "0.3.32",
17
+ "@ldsg/resource-definition": "0.3.32",
18
+ "@ldsg/resource": "0.3.32"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@types/jest": "^29.5.2",
22
22
  "jest": "^29.5.0",
23
+ "oxfmt": "latest",
24
+ "oxlint": "latest",
23
25
  "supertest": "^6.3.4",
24
26
  "ts-jest": "^29.1.5",
25
27
  "ts-node": "^10.9.2",
26
28
  "typescript": "^5.8.3",
27
- "@ldsg/object": "0.3.30",
28
- "@ldsg/types": "0.3.30"
29
+ "@ldsg/object": "0.3.32",
30
+ "@ldsg/types": "0.3.32"
29
31
  },
30
32
  "publishConfig": {
31
33
  "access": "public"
@@ -33,6 +35,8 @@
33
35
  "scripts": {
34
36
  "build": "tsc --project tsconfig.build.json",
35
37
  "clean": "rm -rf dist",
38
+ "format": "oxfmt --write src/",
39
+ "lint": "oxlint src/",
36
40
  "test": "jest"
37
41
  }
38
42
  }