@ldsg/resource 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/index.d.ts +2 -2
- package/dist/resource.d.ts +2 -2
- package/dist/resource.d.ts.map +1 -1
- package/dist/resource.js +5 -5
- package/dist/types/index.d.ts +2 -2
- package/dist/types/instantiate-resource.d.ts +2 -2
- package/dist/types/instantiate-resource.d.ts.map +1 -1
- package/dist/types/instantiate-resources.d.ts +2 -2
- package/dist/types/instantiate-resources.d.ts.map +1 -1
- package/package.json +16 -10
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from './resource';
|
|
2
|
+
export * from './types';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/resource.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ResourceRecord, ResourceSettings, SpecificResourceSettings } from
|
|
2
|
-
import { ListIterateeCustom } from
|
|
1
|
+
import { ResourceRecord, ResourceSettings, SpecificResourceSettings } from '@ldsg/types';
|
|
2
|
+
import { ListIterateeCustom } from 'lodash';
|
|
3
3
|
export interface ResourceConstructorParams<T extends SpecificResourceSettings = SpecificResourceSettings> extends ResourceRecord<T> {
|
|
4
4
|
}
|
|
5
5
|
export type GetFilteredResourcesParams = ListIterateeCustom<Resource, boolean>;
|
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,
|
|
1
|
+
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACzF,OAAU,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;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,yBAAyB,CAAC,CAAC,CAAC;IAUhD;;OAEG;IACH,mBAAmB,GAAI,GAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACxE,QAAQ,0BAA0B,iCASlC;IAEF;;OAEG;IACH,oBAAoB,GAAI,GAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACzE,QAAQ,0BAA0B,kCAWlC;IAEF;;OAEG;IACH,wBAAwB,uCAsBtB;CACH"}
|
package/dist/resource.js
CHANGED
|
@@ -13,7 +13,7 @@ class Resource {
|
|
|
13
13
|
this.getFilteredResource = (params) => {
|
|
14
14
|
const getFilteredResourcesRes = this.getFilteredResources(params);
|
|
15
15
|
const res = {
|
|
16
|
-
resource: getFilteredResourcesRes.resources[0]
|
|
16
|
+
resource: getFilteredResourcesRes.resources[0]
|
|
17
17
|
};
|
|
18
18
|
return res;
|
|
19
19
|
};
|
|
@@ -24,7 +24,7 @@ class Resource {
|
|
|
24
24
|
const { resourceList } = Resource;
|
|
25
25
|
const filterRes = lodash_1.default.filter(resourceList, params);
|
|
26
26
|
const res = {
|
|
27
|
-
resources: filterRes
|
|
27
|
+
resources: filterRes
|
|
28
28
|
};
|
|
29
29
|
return res;
|
|
30
30
|
};
|
|
@@ -33,15 +33,15 @@ class Resource {
|
|
|
33
33
|
*/
|
|
34
34
|
this.getResourcesFromSettings = () => {
|
|
35
35
|
const { settings } = this;
|
|
36
|
-
const pickByRes = lodash_1.default.pickBy(settings, (value, key) => lodash_1.default.endsWith(key,
|
|
36
|
+
const pickByRes = lodash_1.default.pickBy(settings, (value, key) => lodash_1.default.endsWith(key, 'ResourceId'));
|
|
37
37
|
const mapValuesRes = lodash_1.default.mapValues(pickByRes, (resourceId) => {
|
|
38
38
|
const { resource } = this.getFilteredResource({
|
|
39
|
-
id: resourceId
|
|
39
|
+
id: resourceId
|
|
40
40
|
});
|
|
41
41
|
return resource;
|
|
42
42
|
});
|
|
43
43
|
const mapKeysRes = lodash_1.default.mapKeys(mapValuesRes, (value, key) => {
|
|
44
|
-
const res = lodash_1.default.replace(key,
|
|
44
|
+
const res = lodash_1.default.replace(key, 'ResourceId', 'Resource');
|
|
45
45
|
return res;
|
|
46
46
|
});
|
|
47
47
|
const res = mapKeysRes;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from './instantiate-resource';
|
|
2
|
+
export * from './instantiate-resources';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SpecificResourceSettings } from
|
|
2
|
-
import { Resource, ResourceConstructorParams } from
|
|
1
|
+
import { SpecificResourceSettings } from '@ldsg/types';
|
|
2
|
+
import { Resource, ResourceConstructorParams } from '../resource';
|
|
3
3
|
export interface InstantiateResourceParams<T extends SpecificResourceSettings = SpecificResourceSettings> {
|
|
4
4
|
resourceConstructorParams: ResourceConstructorParams<T>;
|
|
5
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instantiate-resource.d.ts","sourceRoot":"","sources":["../../src/types/instantiate-resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAElE,MAAM,WAAW,yBAAyB,
|
|
1
|
+
{"version":3,"file":"instantiate-resource.d.ts","sourceRoot":"","sources":["../../src/types/instantiate-resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAElE,MAAM,WAAW,yBAAyB,CAAC,CAAC,SAAS,wBAAwB,GAAG,wBAAwB;IACtG,yBAAyB,EAAE,yBAAyB,CAAC,CAAC,CAAC,CAAC;CACzD;AAED,MAAM,WAAW,sBAAsB,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ;IACnE,QAAQ,EAAE,CAAC,CAAC;CACb;AAED,MAAM,MAAM,mBAAmB,CAC7B,CAAC,SAAS,wBAAwB,GAAG,wBAAwB,EAC7D,CAAC,SAAS,QAAQ,GAAG,QAAQ,IAC3B,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAC,CAAC,KAAK,sBAAsB,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ResourceRecord, SpecificResourceSettings } from
|
|
2
|
-
import { Resource } from
|
|
1
|
+
import { ResourceRecord, SpecificResourceSettings } from '@ldsg/types';
|
|
2
|
+
import { Resource } from '../resource';
|
|
3
3
|
export interface InstantiateResourcesParams<T extends SpecificResourceSettings = SpecificResourceSettings> {
|
|
4
4
|
resourceRecords: ResourceRecord<T>[];
|
|
5
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instantiate-resources.d.ts","sourceRoot":"","sources":["../../src/types/instantiate-resources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,WAAW,0BAA0B,
|
|
1
|
+
{"version":3,"file":"instantiate-resources.d.ts","sourceRoot":"","sources":["../../src/types/instantiate-resources.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,WAAW,0BAA0B,CAAC,CAAC,SAAS,wBAAwB,GAAG,wBAAwB;IACvG,eAAe,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;CACtC;AAED,MAAM,WAAW,uBAAuB,CAAC,CAAC,SAAS,QAAQ,GAAG,QAAQ;IACpE,SAAS,EAAE,CAAC,EAAE,CAAC;CAChB;AAED,MAAM,MAAM,oBAAoB,CAC9B,CAAC,SAAS,wBAAwB,GAAG,wBAAwB,EAC7D,CAAC,SAAS,QAAQ,GAAG,QAAQ,IAC3B,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAAC,CAAC,KAAK,uBAAuB,CAAC,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,24 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ldsg/resource",
|
|
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/types": "0.3.
|
|
15
|
+
"@ldsg/types": "0.3.10"
|
|
19
16
|
},
|
|
20
17
|
"devDependencies": {
|
|
21
|
-
"@types/
|
|
18
|
+
"@types/jest": "^29.5.2",
|
|
19
|
+
"@types/lodash": "^4.14.202",
|
|
20
|
+
"jest": "^29.5.0",
|
|
21
|
+
"supertest": "^6.3.4",
|
|
22
|
+
"ts-jest": "^29.1.5",
|
|
23
|
+
"ts-node": "^10.9.2",
|
|
24
|
+
"typescript": "^5.8.3"
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
22
28
|
},
|
|
23
29
|
"scripts": {
|
|
24
30
|
"build": "tsc --project tsconfig.build.json",
|