@ldsg/resource-definition 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 +9 -9
- package/dist/handler.d.ts +5 -7
- package/dist/handler.d.ts.map +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/instantiate-resource.d.ts +4 -4
- package/dist/instantiate-resource.js +1 -1
- package/dist/instantiate-resources.d.ts +4 -4
- package/dist/instantiate-resources.d.ts.map +1 -1
- package/dist/instantiate-resources.js +3 -3
- package/dist/resource.d.ts +3 -3
- package/dist/resource.d.ts.map +1 -1
- package/dist/resource.js +1 -2
- package/package.json +20 -13
package/dist/constants.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { HandlerSpecificResourceSettings } from
|
|
2
|
-
import { GeneralResourceSettings } from
|
|
1
|
+
import { HandlerSpecificResourceSettings } from '@ldsg/handler';
|
|
2
|
+
import { GeneralResourceSettings } from '@ldsg/types';
|
|
3
3
|
/**
|
|
4
4
|
* Instantiate Resource Handler General Resource Settings
|
|
5
5
|
* 实例化资源处理程序普通资源配置
|
|
@@ -11,7 +11,7 @@ export declare const INSTANTIATE_RESOURCE_HANDLER_GENERAL_RESOURCE_SETTINGS: Gen
|
|
|
11
11
|
* 框架通过此实例化此资源
|
|
12
12
|
*/
|
|
13
13
|
export declare const INSTANTIATE_RESOURCE_HANDLER_SPECIFIC_RESOURCE_SETTINGS: HandlerSpecificResourceSettings;
|
|
14
|
-
import { ResourceDefinitionSpecificResourceSettings } from
|
|
14
|
+
import { ResourceDefinitionSpecificResourceSettings } from '@ldsg/resource-definition-part';
|
|
15
15
|
export declare const RESOURCE_DEFINITION_GENERAL_RESOURCE_SETTINGS: GeneralResourceSettings;
|
|
16
16
|
export declare const RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS: ResourceDefinitionSpecificResourceSettings;
|
|
17
17
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAEtD;;;GAGG;AACH,eAAO,MAAM,sDAAsD,EAAE,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AAChE,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,OAAO,EAAE,0CAA0C,EAAE,MAAM,gCAAgC,CAAC;AAE5F,eAAO,MAAM,6CAA6C,EAAE,uBAG3D,CAAC;AAEF,eAAO,MAAM,8CAA8C,EAAE,0CAG5D,CAAC"}
|
package/dist/constants.js
CHANGED
|
@@ -7,8 +7,8 @@ const constants_1 = require("@ldsg/constants");
|
|
|
7
7
|
* 实例化资源处理程序普通资源配置
|
|
8
8
|
*/
|
|
9
9
|
exports.INSTANTIATE_RESOURCE_HANDLER_GENERAL_RESOURCE_SETTINGS = {
|
|
10
|
-
title:
|
|
11
|
-
description:
|
|
10
|
+
title: '资源定义实例化资源处理程序',
|
|
11
|
+
description: ''
|
|
12
12
|
};
|
|
13
13
|
/**
|
|
14
14
|
* Instantiate Resource Handler Specific Resource Settings
|
|
@@ -19,15 +19,15 @@ exports.INSTANTIATE_RESOURCE_HANDLER_SPECIFIC_RESOURCE_SETTINGS = {
|
|
|
19
19
|
code: `export * from "@ldsg/resource-definition";`,
|
|
20
20
|
dependencies: [
|
|
21
21
|
{
|
|
22
|
-
name:
|
|
23
|
-
}
|
|
24
|
-
]
|
|
22
|
+
name: '@ldsg/resource-definition'
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
25
|
};
|
|
26
26
|
exports.RESOURCE_DEFINITION_GENERAL_RESOURCE_SETTINGS = {
|
|
27
|
-
title:
|
|
28
|
-
description:
|
|
27
|
+
title: '资源定义资源定义',
|
|
28
|
+
description: ''
|
|
29
29
|
};
|
|
30
30
|
exports.RESOURCE_DEFINITION_SPECIFIC_RESOURCE_SETTINGS = {
|
|
31
|
-
kind:
|
|
32
|
-
parentKind: constants_1.ROOT_RESOURCE_KIND
|
|
31
|
+
kind: 'resource_definition',
|
|
32
|
+
parentKind: constants_1.ROOT_RESOURCE_KIND
|
|
33
33
|
};
|
package/dist/handler.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { Handler, HandlerExtendedResourceSettings } from
|
|
2
|
-
import { InstantiateResourceParams, InstantiateResourceRes } from
|
|
3
|
-
import { ResourceDefinitionSpecificResourceSettings } from
|
|
4
|
-
import { ResourceDefinitionResource } from
|
|
5
|
-
export declare const handler: Handler<
|
|
6
|
-
InstantiateResourceParams<HandlerExtendedResourceSettings<ResourceDefinitionSpecificResourceSettings>>
|
|
7
|
-
], InstantiateResourceRes<ResourceDefinitionResource>>;
|
|
1
|
+
import { Handler, HandlerExtendedResourceSettings } from '@ldsg/handler';
|
|
2
|
+
import { InstantiateResourceParams, InstantiateResourceRes } from '@ldsg/resource';
|
|
3
|
+
import { ResourceDefinitionSpecificResourceSettings } from '@ldsg/resource-definition-part';
|
|
4
|
+
import { ResourceDefinitionResource } from './resource';
|
|
5
|
+
export declare const handler: Handler<InstantiateResourceParams<HandlerExtendedResourceSettings<ResourceDefinitionSpecificResourceSettings>>, InstantiateResourceRes<ResourceDefinitionResource>>;
|
|
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;AACnF,OAAO,EAAE,0CAA0C,EAAE,MAAM,gCAAgC,CAAC;AAE5F,OAAO,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAExD,eAAO,MAAM,OAAO,EAAE,OAAO,CAC3B,yBAAyB,CAAC,+BAA+B,CAAC,0CAA0C,CAAC,CAAC,EACtG,sBAAsB,CAAC,0BAA0B,CAAC,CAC7B,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
1
|
+
export * from '@ldsg/resource-definition-part';
|
|
2
|
+
export * from './constants';
|
|
3
|
+
export * from './handler';
|
|
4
|
+
export * from './instantiate-resource';
|
|
5
|
+
export * from './instantiate-resources';
|
|
6
|
+
export * from './resource';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { HandlerExtendedResourceSettings } from
|
|
2
|
-
import { InstantiateResource } from
|
|
3
|
-
import { ResourceDefinitionSpecificResourceSettings } from
|
|
4
|
-
import { ResourceDefinitionResource } from
|
|
1
|
+
import { HandlerExtendedResourceSettings } from '@ldsg/handler';
|
|
2
|
+
import { InstantiateResource } from '@ldsg/resource';
|
|
3
|
+
import { ResourceDefinitionSpecificResourceSettings } from '@ldsg/resource-definition-part';
|
|
4
|
+
import { ResourceDefinitionResource } from './resource';
|
|
5
5
|
export declare const instantiateResource: InstantiateResource<HandlerExtendedResourceSettings<ResourceDefinitionSpecificResourceSettings>, ResourceDefinitionResource>;
|
|
6
6
|
//# sourceMappingURL=instantiate-resource.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { HandlerExtendedResourceSettings } from
|
|
2
|
-
import { InstantiateResources } from
|
|
3
|
-
import { ResourceDefinitionSpecificResourceSettings } from
|
|
4
|
-
import { ResourceDefinitionResource } from
|
|
1
|
+
import { HandlerExtendedResourceSettings } from '@ldsg/handler';
|
|
2
|
+
import { InstantiateResources } from '@ldsg/resource';
|
|
3
|
+
import { ResourceDefinitionSpecificResourceSettings } from '@ldsg/resource-definition-part';
|
|
4
|
+
import { ResourceDefinitionResource } from './resource';
|
|
5
5
|
export declare const instantiateResources: InstantiateResources<HandlerExtendedResourceSettings<ResourceDefinitionSpecificResourceSettings>, ResourceDefinitionResource>;
|
|
6
6
|
//# sourceMappingURL=instantiate-resources.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instantiate-resources.d.ts","sourceRoot":"","sources":["../src/instantiate-resources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,0CAA0C,EAAE,MAAM,gCAAgC,CAAC;AAE5F,OAAO,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAExD,eAAO,MAAM,oBAAoB,EAAE,oBAAoB,CACrD,+BAA+B,CAAC,0CAA0C,CAAC,EAC3E,0BAA0B,
|
|
1
|
+
{"version":3,"file":"instantiate-resources.d.ts","sourceRoot":"","sources":["../src/instantiate-resources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,0CAA0C,EAAE,MAAM,gCAAgC,CAAC;AAE5F,OAAO,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAExD,eAAO,MAAM,oBAAoB,EAAE,oBAAoB,CACrD,+BAA+B,CAAC,0CAA0C,CAAC,EAC3E,0BAA0B,CAqB3B,CAAC"}
|
|
@@ -4,15 +4,15 @@ exports.instantiateResources = void 0;
|
|
|
4
4
|
const instantiate_resource_1 = require("./instantiate-resource");
|
|
5
5
|
const instantiateResources = (params) => {
|
|
6
6
|
const { resourceRecords } = params;
|
|
7
|
-
const resourceDefinitionManifestResources = resourceRecords.filter((value) => value.kind ===
|
|
7
|
+
const resourceDefinitionManifestResources = resourceRecords.filter((value) => value.kind === 'resource_definition');
|
|
8
8
|
const resources = resourceDefinitionManifestResources.map((resourceDefinitionManifestResource) => {
|
|
9
9
|
const { resource } = (0, instantiate_resource_1.instantiateResource)({
|
|
10
|
-
resourceConstructorParams: resourceDefinitionManifestResource
|
|
10
|
+
resourceConstructorParams: resourceDefinitionManifestResource
|
|
11
11
|
});
|
|
12
12
|
return resource;
|
|
13
13
|
});
|
|
14
14
|
const res = {
|
|
15
|
-
resources
|
|
15
|
+
resources
|
|
16
16
|
};
|
|
17
17
|
return res;
|
|
18
18
|
};
|
package/dist/resource.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { HandlerExtendedResource } from
|
|
2
|
-
import { InstantiateResource } from
|
|
3
|
-
import { ResourceDefinitionSpecificResourceSettings } from
|
|
1
|
+
import { HandlerExtendedResource } from '@ldsg/handler';
|
|
2
|
+
import { InstantiateResource } from '@ldsg/resource';
|
|
3
|
+
import { ResourceDefinitionSpecificResourceSettings } from '@ldsg/resource-definition-part';
|
|
4
4
|
export declare class ResourceDefinitionResource extends HandlerExtendedResource<ResourceDefinitionSpecificResourceSettings> {
|
|
5
5
|
/**
|
|
6
6
|
* 实例化资源
|
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,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,0CAA0C,EAAE,MAAM,gCAAgC,CAAC;AAE5F,qBAAa,0BAA2B,SAAQ,uBAAuB,CAAC,0CAA0C,CAAC;IACjH;;;;OAIG;IACH,mBAAmB,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACrD,OAAO,EAAE,0CAA0C,EAAE,MAAM,gCAAgC,CAAC;AAE5F,qBAAa,0BAA2B,SAAQ,uBAAuB,CAAC,0CAA0C,CAAC;IACjH;;;;OAIG;IACH,mBAAmB,EAAE,mBAAmB,CAItC;CACH"}
|
package/dist/resource.js
CHANGED
|
@@ -11,8 +11,7 @@ class ResourceDefinitionResource extends handler_1.HandlerExtendedResource {
|
|
|
11
11
|
* 2. 通过 HANDLER 类型子资源内的 handler 方法进行资源实例化
|
|
12
12
|
*/
|
|
13
13
|
this.instantiateResource = (params) => {
|
|
14
|
-
const
|
|
15
|
-
const res = extendedHandler(params);
|
|
14
|
+
const res = this.executeExtendedHandler(params);
|
|
16
15
|
return res;
|
|
17
16
|
};
|
|
18
17
|
}
|
package/package.json
CHANGED
|
@@ -1,27 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ldsg/resource-definition",
|
|
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
|
"lodash": "^4.17.21",
|
|
18
|
-
"@ldsg/
|
|
19
|
-
"@ldsg/resource
|
|
20
|
-
"@ldsg/
|
|
21
|
-
"@ldsg/
|
|
15
|
+
"@ldsg/constants": "0.3.10",
|
|
16
|
+
"@ldsg/resource": "0.3.10",
|
|
17
|
+
"@ldsg/resource-definition-part": "0.3.10",
|
|
18
|
+
"@ldsg/types": "0.3.10",
|
|
19
|
+
"@ldsg/handler": "0.3.10"
|
|
22
20
|
},
|
|
23
21
|
"devDependencies": {
|
|
24
|
-
"@types/
|
|
22
|
+
"@types/jest": "^29.5.2",
|
|
23
|
+
"@types/lodash": "^4.14.202",
|
|
24
|
+
"jest": "^29.5.0",
|
|
25
|
+
"supertest": "^6.3.4",
|
|
26
|
+
"ts-jest": "^29.1.5",
|
|
27
|
+
"ts-node": "^10.9.2",
|
|
28
|
+
"typescript": "^5.8.3"
|
|
29
|
+
},
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public"
|
|
25
32
|
},
|
|
26
33
|
"scripts": {
|
|
27
34
|
"build": "tsc --project tsconfig.build.json",
|