@servable/tools 1.3.0 → 1.4.0
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/README.md +1 -1
- package/package.json +2 -2
- package/src/config/candidates/index.js +5 -5
- package/src/config/candidates/{featureCandidates → protocolCandidates}/index.js +5 -5
- package/src/config/validate/index.js +2 -2
- package/src/config/validate/{feature → protocol}/index.js +1 -1
- package/src/document/{1.1.0/all/build/feature → 1.0.0/all/build/protocol}/index.js +23 -23
- package/src/document/1.0.0/all/index.js +4 -4
- package/src/document/1.0.0/all/write/index.js +3 -3
- package/src/document/1.0.0/chunks/build/class/class.js +2 -2
- package/src/document/1.0.0/chunks/build/class/functions.js +2 -2
- package/src/document/1.0.0/chunks/build/class/lib.js +2 -2
- package/src/document/1.0.0/chunks/build/class/seed.js +2 -2
- package/src/document/1.0.0/chunks/build/class/triggers.js +2 -2
- package/src/document/1.0.0/chunks/build/{feature → protocol}/afterInit.js +2 -2
- package/src/document/{1.1.0/chunks/build/feature → 1.0.0/chunks/build/protocol}/beforeInit.js +2 -2
- package/src/document/1.0.0/chunks/build/{feature → protocol}/class.js +3 -3
- package/src/document/{1.1.0/chunks/build/feature → 1.0.0/chunks/build/protocol}/config.js +2 -2
- package/src/document/{1.1.0/chunks/build/feature → 1.0.0/chunks/build/protocol}/functions.js +2 -2
- package/src/document/{1.1.0/chunks/build/feature → 1.0.0/chunks/build/protocol}/lib.js +2 -2
- package/src/document/1.0.0/chunks/build/{feature → protocol}/liveClasses.js +2 -2
- package/src/document/1.0.0/chunks/build/{feature → protocol}/schema.js +2 -2
- package/src/document/1.0.0/chunks/build/{feature → protocol}/seed.js +2 -2
- package/src/document/1.0.0/chunks/build/{feature → protocol}/system.js +2 -2
- package/src/document/{1.1.0/chunks/build/feature → 1.0.0/chunks/build/protocol}/triggers.js +2 -2
- package/src/document/1.0.0/generateGithubReadme/build/chunks/dependencies/index.js +2 -2
- package/src/document/1.0.0/generateGithubReadme/build/chunks/footer.js +1 -1
- package/src/document/1.0.0/generateGithubReadme/build/chunks/githubTags.js +3 -3
- package/src/document/1.0.0/generateGithubReadme/build/chunks/registry.js +2 -2
- package/src/document/1.0.0/generateGithubReadme/build/chunks/usage.js +1 -1
- package/src/document/1.0.0/generateGithubReadme/build/index.js +23 -23
- package/src/document/{1.0.0/all/build/feature → 1.1.0/all/build/protocol}/index.js +23 -23
- package/src/document/1.1.0/all/index.js +4 -4
- package/src/document/1.1.0/all/write/index.js +3 -3
- package/src/document/1.1.0/chunks/build/class/class.js +2 -2
- package/src/document/1.1.0/chunks/build/class/functions.js +2 -2
- package/src/document/1.1.0/chunks/build/class/lib.js +2 -2
- package/src/document/1.1.0/chunks/build/class/seed.js +2 -2
- package/src/document/1.1.0/chunks/build/class/triggers.js +2 -2
- package/src/document/1.1.0/chunks/build/{feature → protocol}/afterInit.js +2 -2
- package/src/document/{1.0.0/chunks/build/feature → 1.1.0/chunks/build/protocol}/beforeInit.js +2 -2
- package/src/document/1.1.0/chunks/build/{feature → protocol}/class.js +3 -3
- package/src/document/{1.0.0/chunks/build/feature → 1.1.0/chunks/build/protocol}/config.js +2 -2
- package/src/document/{1.0.0/chunks/build/feature → 1.1.0/chunks/build/protocol}/functions.js +2 -2
- package/src/document/{1.0.0/chunks/build/feature → 1.1.0/chunks/build/protocol}/lib.js +2 -2
- package/src/document/1.1.0/chunks/build/{feature → protocol}/liveClasses.js +2 -2
- package/src/document/1.1.0/chunks/build/{feature → protocol}/schema.js +2 -2
- package/src/document/1.1.0/chunks/build/{feature → protocol}/seed.js +2 -2
- package/src/document/1.1.0/chunks/build/{feature → protocol}/system.js +2 -2
- package/src/document/{1.0.0/chunks/build/feature → 1.1.0/chunks/build/protocol}/triggers.js +2 -2
- package/src/document/1.1.0/generateGithubReadme/build/chunks/dependencies/index.js +2 -2
- package/src/document/1.1.0/generateGithubReadme/build/chunks/footer.js +1 -1
- package/src/document/1.1.0/generateGithubReadme/build/chunks/githubTags.js +3 -3
- package/src/document/1.1.0/generateGithubReadme/build/chunks/registry.js +2 -2
- package/src/document/1.1.0/generateGithubReadme/build/chunks/usage.js +1 -1
- package/src/document/1.1.0/generateGithubReadme/build/index.js +23 -23
- package/src/document/gateway/all/index.js +2 -2
- package/src/document/gateway/generateGithubReadme/index.js +2 -2
- package/src/domain/{feature → protocol}/factory/absoluteModuleSrcPath.js +3 -3
- package/src/domain/protocol/factory/index.js +71 -0
- package/src/domain/protocol/factory/protocolPath.js +41 -0
- package/src/domain/{feature → protocol}/index.js +6 -6
- package/src/domain/{feature → protocol}/lib/instancesPathIdUniqueId.js +3 -3
- package/src/domain/protocolInstance/factory/getLoaderWithPayload.js +7 -0
- package/src/domain/{featureInstance → protocolInstance}/factory/index.js +7 -7
- package/src/domain/{featureInstance → protocolInstance}/index.js +16 -16
- package/src/domain/{featureLoader → protocolLoader}/base.js +9 -9
- package/src/domain/protocolLoader/lib/mergeClassProtocols.js +17 -0
- package/src/domain/{featureLoader → protocolLoader}/v1.0.0.js +66 -34
- package/src/domain/{featureLoader → protocolLoader}/v1.1.0.js +68 -31
- package/src/index.js +7 -7
- package/src/lib/adaptConfig/basic.js +59 -59
- package/src/manifest/access/index.js +1 -1
- package/src/manifest/data/1.0.0/class.json +3 -3
- package/src/manifest/data/1.0.0/enums.js +6 -6
- package/src/manifest/data/1.0.0/{feature.json → protocol.json} +5 -5
- package/src/manifest/data/1.1.0/class.json +3 -3
- package/src/manifest/data/1.1.0/enums.js +6 -6
- package/src/manifest/data/1.1.0/{feature.json → protocol.json} +4 -4
- package/src/manifest/extract/index.js +1 -1
- package/src/manifest/extract/templateDataForId.js +3 -3
- package/src/schema/build/buildProtocol/classStruct/extractProtocolsProtocols.js +29 -0
- package/src/schema/build/buildProtocol/classStruct/index.js +62 -0
- package/src/schema/build/{buildFeature/classStruct/featureInClassClassSchema.js → buildProtocol/classStruct/protocolInClassClassSchema.js} +7 -7
- package/src/schema/build/buildProtocol/extractClassesProtocol.js +49 -0
- package/src/schema/build/{buildFeature → buildProtocol}/index.js +40 -40
- package/src/schema/build/index.js +29 -29
- package/src/schema/build/lib/{getFeaturesLiveClasses.js → getProtocolsLiveClasses.js} +4 -4
- package/src/schema/build/lib/updateProtocolsExcerpt.js +24 -0
- package/src/schema/index.js +30 -30
- package/src/schema/validate/{handleFeature → handleProtocol}/computeVersions.js +2 -2
- package/src/schema/validate/handleProtocol/index.js +5 -0
- package/src/schema/validate/index.js +6 -6
- package/src/domain/feature/factory/featurePath.js +0 -41
- package/src/domain/feature/factory/index.js +0 -71
- package/src/domain/featureInstance/factory/getLoaderWithPayload.js +0 -7
- package/src/domain/featureLoader/lib/mergeClassFeatures.js +0 -17
- package/src/schema/build/buildFeature/classStruct/extractFeaturesFeatures.js +0 -29
- package/src/schema/build/buildFeature/classStruct/index.js +0 -62
- package/src/schema/build/buildFeature/extractClassesFeature.js +0 -49
- package/src/schema/build/lib/updateFeaturesExcerpt.js +0 -24
- package/src/schema/validate/handleFeature/index.js +0 -5
- /package/src/document/1.0.0/all/write/{feature → protocol}/index.js +0 -0
- /package/src/document/1.1.0/all/write/{feature → protocol}/index.js +0 -0
- /package/src/domain/{featureInstance → protocolInstance}/factory/instancesWithPath.js +0 -0
- /package/src/domain/{featureLoader → protocolLoader}/factory/getModule.js +0 -0
- /package/src/domain/{featureLoader → protocolLoader}/factory/index.js +0 -0
- /package/src/domain/{featureLoader → protocolLoader}/lib/importJSDefault.js +0 -0
- /package/src/domain/{featureLoader → protocolLoader}/lib/importJSONDefault.js +0 -0
- /package/src/domain/{featureLoader → protocolLoader}/lib/triggerItems.js +0 -0
- /package/src/lib/{adaptFeaturePayload.js → adaptProtocolPayload.js} +0 -0
- /package/src/lib/{cleanFeatures.js → cleanProtocols.js} +0 -0
- /package/src/lib/{featureApiVersion.js → protocolApiVersion.js} +0 -0
- /package/src/schema/build/{buildFeature → buildProtocol}/classStruct/preserveMostRestricted.js +0 -0
package/src/schema/index.js
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import protocolFactory from "../domain/protocol/factory/index.js"
|
|
2
|
+
import getProtocolsLiveClasses from "./build/lib/getProtocolsLiveClasses.js"
|
|
3
3
|
import adaptConfigBasic from "../lib/adaptConfig/basic.js"
|
|
4
|
-
import
|
|
5
|
-
import
|
|
4
|
+
import extractProtocol from './extractProtocol/index.js'
|
|
5
|
+
import updateProtocolsExcerpt from './build/lib/updateProtocolsExcerpt.js'
|
|
6
6
|
|
|
7
7
|
export default async ({ servableConfig }) => {
|
|
8
|
-
const {
|
|
8
|
+
const { rootProtocolPayload } = servableConfig
|
|
9
9
|
adaptConfigBasic({ servableConfig, live: false })
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
id:
|
|
14
|
-
type:
|
|
15
|
-
path:
|
|
16
|
-
version:
|
|
10
|
+
const protocolsCache = []
|
|
11
|
+
const appProtocol = await protocolFactory({
|
|
12
|
+
protocolPayload: {
|
|
13
|
+
id: rootProtocolPayload.id,
|
|
14
|
+
type: rootProtocolPayload.type,
|
|
15
|
+
path: rootProtocolPayload.path,
|
|
16
|
+
version: rootProtocolPayload.version
|
|
17
17
|
},
|
|
18
18
|
servableConfig,
|
|
19
|
-
|
|
19
|
+
protocolsCache,
|
|
20
20
|
instancesPathId: [
|
|
21
|
-
{ type: '
|
|
21
|
+
{ type: 'protocol', value: { id: 'app' } }
|
|
22
22
|
],
|
|
23
23
|
})
|
|
24
24
|
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
const protocolsExcerpt = {}
|
|
26
|
+
const protocols = await extractProtocol({
|
|
27
|
+
protocol: appProtocol,
|
|
28
|
+
protocolFactory: async ({
|
|
29
|
+
protocolPayload,
|
|
30
30
|
instancesPathId
|
|
31
31
|
}) =>
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
protocolFactory({
|
|
33
|
+
protocolPayload,
|
|
34
34
|
servableConfig,
|
|
35
|
-
|
|
35
|
+
protocolsCache,
|
|
36
36
|
instancesPathId
|
|
37
37
|
}),
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
updateProtocolsExcerpt: async ({ adaptedClassesStructs }) =>
|
|
39
|
+
updateProtocolsExcerpt({
|
|
40
40
|
adaptedClassesStructs,
|
|
41
|
-
|
|
41
|
+
protocolsExcerpt
|
|
42
42
|
}),
|
|
43
43
|
instancesPathId: [
|
|
44
|
-
{ type: '
|
|
44
|
+
{ type: 'protocol', value: { id: 'app' } }
|
|
45
45
|
],
|
|
46
46
|
})
|
|
47
47
|
|
|
48
|
-
const liveClasses = await
|
|
48
|
+
const liveClasses = await getProtocolsLiveClasses({ protocols })
|
|
49
49
|
|
|
50
50
|
return {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
protocols,
|
|
52
|
+
protocolsExcerpt,
|
|
53
|
+
appProtocol,
|
|
54
54
|
liveClasses
|
|
55
55
|
}
|
|
56
56
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import handleProtocol from "./handleProtocol/index.js"
|
|
2
2
|
import semver from 'semver'
|
|
3
3
|
|
|
4
4
|
export default async ({
|
|
@@ -6,13 +6,13 @@ export default async ({
|
|
|
6
6
|
}) => {
|
|
7
7
|
|
|
8
8
|
const {
|
|
9
|
-
|
|
9
|
+
protocols
|
|
10
10
|
} = schema
|
|
11
11
|
const comparisons = []
|
|
12
|
-
for (var i in
|
|
13
|
-
const
|
|
14
|
-
const comparison = await
|
|
15
|
-
|
|
12
|
+
for (var i in protocols) {
|
|
13
|
+
const protocol = protocols[i]
|
|
14
|
+
const comparison = await handleProtocol({
|
|
15
|
+
protocol,
|
|
16
16
|
})
|
|
17
17
|
comparisons.push(comparison)
|
|
18
18
|
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import checkFileExists from '../../../lib/checkFileExists.js'
|
|
3
|
-
import absoluteModuleSrcPath from './absoluteModuleSrcPath.js'
|
|
4
|
-
|
|
5
|
-
export default async (props) => {
|
|
6
|
-
const { id, module, servableConfig } = props
|
|
7
|
-
let featurePath = null
|
|
8
|
-
|
|
9
|
-
if (typeof module === 'object'
|
|
10
|
-
&& Object.keys(module).length) {
|
|
11
|
-
const item = Object.keys(module)[0]
|
|
12
|
-
if (item) {
|
|
13
|
-
featurePath = absoluteModuleSrcPath(item)
|
|
14
|
-
return featurePath
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
if (servableConfig.features
|
|
19
|
-
&& servableConfig.features.external
|
|
20
|
-
&& servableConfig.features.external[id]) {
|
|
21
|
-
featurePath = absoluteModuleSrcPath(servableConfig.features.external[id])
|
|
22
|
-
return featurePath
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
if (servableConfig.features
|
|
26
|
-
&& servableConfig.features.local
|
|
27
|
-
&& servableConfig.features.local.length) {
|
|
28
|
-
|
|
29
|
-
let i = 0
|
|
30
|
-
do {
|
|
31
|
-
const repo = servableConfig.features.local[i]
|
|
32
|
-
featurePath = `${repo}/${id}`
|
|
33
|
-
if ((await checkFileExists(featurePath))) {
|
|
34
|
-
return featurePath
|
|
35
|
-
}
|
|
36
|
-
i++
|
|
37
|
-
} while (i < servableConfig.features.local.length)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return null
|
|
41
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import featurePath from './featurePath.js'
|
|
2
|
-
|
|
3
|
-
import _ from 'underscore'
|
|
4
|
-
import FeatureClass from '../index.js'
|
|
5
|
-
|
|
6
|
-
export default async ({
|
|
7
|
-
featurePayload,
|
|
8
|
-
servableConfig,
|
|
9
|
-
featuresCache,
|
|
10
|
-
instancesPathId
|
|
11
|
-
}) => {
|
|
12
|
-
|
|
13
|
-
const { id, module, version, type, } = featurePayload
|
|
14
|
-
let path = featurePayload.path
|
|
15
|
-
if (!path) {
|
|
16
|
-
path = await featurePath({
|
|
17
|
-
id,
|
|
18
|
-
module,
|
|
19
|
-
version,
|
|
20
|
-
servableConfig
|
|
21
|
-
})
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
if (!path) {
|
|
25
|
-
return null
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
let feature = null
|
|
29
|
-
const valueInCache = cacheValue({
|
|
30
|
-
featurePayload: {
|
|
31
|
-
...featurePayload,
|
|
32
|
-
path
|
|
33
|
-
}, featuresCache
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
if (valueInCache) {
|
|
37
|
-
feature = valueInCache.feature
|
|
38
|
-
} else {
|
|
39
|
-
feature = new FeatureClass({ id, type })
|
|
40
|
-
featuresCache.push({
|
|
41
|
-
id,
|
|
42
|
-
module,
|
|
43
|
-
version,
|
|
44
|
-
path,
|
|
45
|
-
feature
|
|
46
|
-
})
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
await feature.addInstanceIfNeeded({
|
|
50
|
-
featurePayload: {
|
|
51
|
-
...featurePayload,
|
|
52
|
-
path
|
|
53
|
-
},
|
|
54
|
-
instancesPathId,
|
|
55
|
-
servableConfig
|
|
56
|
-
})
|
|
57
|
-
// console.log(instancesPathId)
|
|
58
|
-
return feature
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const cacheValue = ({ featurePayload, featuresCache }) => {
|
|
63
|
-
const { id, module, version, path } = featurePayload
|
|
64
|
-
const candidates = _.where(featuresCache, {
|
|
65
|
-
id,
|
|
66
|
-
// version,
|
|
67
|
-
// path,
|
|
68
|
-
// module
|
|
69
|
-
})
|
|
70
|
-
return (candidates && candidates.length) ? candidates[0] : null
|
|
71
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import * as FeatureLoaderFactory from '../../featureLoader/factory/index.js'
|
|
2
|
-
|
|
3
|
-
export default async ({ featurePayload }) => {
|
|
4
|
-
const { path, version } = featurePayload
|
|
5
|
-
const _loader = await FeatureLoaderFactory.getByPathAndVersion({ path, version })
|
|
6
|
-
return _loader
|
|
7
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import cleanFeatures from "../../../lib/cleanFeatures.js"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export default ({ items = [], _class, withFeaturesFeatures }) => {
|
|
5
|
-
let classFeatures = _class.features ? _class.features : []
|
|
6
|
-
if (!withFeaturesFeatures) {
|
|
7
|
-
return cleanFeatures([...items, ...classFeatures])
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
return cleanFeatures([...items])
|
|
11
|
-
|
|
12
|
-
// let inheritedFeatures = _class.inheritedFeatures ? _class.inheritedFeatures : []
|
|
13
|
-
// return cleanFeatures([
|
|
14
|
-
// ...classFeatures,
|
|
15
|
-
// ...inheritedFeatures
|
|
16
|
-
// ])
|
|
17
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import _ from 'underscore'
|
|
2
|
-
import adaptFeaturePayload from '../../../../lib/adaptFeaturePayload.js'
|
|
3
|
-
import cleanFeatures from '../../../../lib/cleanFeatures.js'
|
|
4
|
-
|
|
5
|
-
export default async ({
|
|
6
|
-
featuresPayloads,
|
|
7
|
-
featureFactory,
|
|
8
|
-
instancesPathId }) => {
|
|
9
|
-
|
|
10
|
-
let items = []
|
|
11
|
-
|
|
12
|
-
for (var i in featuresPayloads) {
|
|
13
|
-
const featurePayload = featuresPayloads[i]
|
|
14
|
-
const feature = await featureFactory({
|
|
15
|
-
featurePayload,
|
|
16
|
-
instancesPathId
|
|
17
|
-
})
|
|
18
|
-
//#TODO: feature.loader
|
|
19
|
-
const ownFeatures = await feature.loader.ownFeatures()
|
|
20
|
-
let a = (ownFeatures && ownFeatures.length) ? ownFeatures.map(adaptFeaturePayload) : null
|
|
21
|
-
if (a && a.length) {
|
|
22
|
-
items = items.concat(a)
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
items = _.flatten(items.filter(a => a)).filter(a => a)
|
|
27
|
-
items = cleanFeatures(items)
|
|
28
|
-
return items
|
|
29
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import featureInClassClassSchema from './featureInClassClassSchema.js'
|
|
2
|
-
import adaptFeaturePayload from '../../../../lib/adaptFeaturePayload.js'
|
|
3
|
-
import extractFeaturesFeatures from './extractFeaturesFeatures.js'
|
|
4
|
-
import cleanFeatures from '../../../../lib/cleanFeatures.js'
|
|
5
|
-
|
|
6
|
-
export default async ({
|
|
7
|
-
feature,
|
|
8
|
-
classSchema,
|
|
9
|
-
featureFactory,
|
|
10
|
-
instancesPathId
|
|
11
|
-
}) => {
|
|
12
|
-
|
|
13
|
-
const { className } = classSchema
|
|
14
|
-
|
|
15
|
-
//#TODO: feature.loader
|
|
16
|
-
let featuresPayloads = await feature.loader.classFeatures({
|
|
17
|
-
className,
|
|
18
|
-
withFeaturesFeatures: false
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
if (!featuresPayloads
|
|
22
|
-
|| !featuresPayloads.length) {
|
|
23
|
-
return { classSchema }
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
featuresPayloads = featuresPayloads.map(adaptFeaturePayload)
|
|
27
|
-
|
|
28
|
-
if (!featuresPayloads || !featuresPayloads.length) {
|
|
29
|
-
return { classSchema }
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
let featuresFeatures = await extractFeaturesFeatures({
|
|
33
|
-
featuresPayloads,
|
|
34
|
-
featureFactory,
|
|
35
|
-
instancesPathId
|
|
36
|
-
})
|
|
37
|
-
featuresPayloads = cleanFeatures([...featuresPayloads, ...featuresFeatures])
|
|
38
|
-
|
|
39
|
-
let _classSchema = { ...classSchema }
|
|
40
|
-
|
|
41
|
-
for (var i in featuresPayloads) {
|
|
42
|
-
const featurePayload = featuresPayloads[i]
|
|
43
|
-
const feature = await featureFactory({
|
|
44
|
-
featurePayload,
|
|
45
|
-
instancesPathId
|
|
46
|
-
})
|
|
47
|
-
_classSchema = await featureInClassClassSchema({
|
|
48
|
-
feature,
|
|
49
|
-
classSchema: _classSchema,
|
|
50
|
-
})
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
//#TODO: feature.loader
|
|
55
|
-
const _class = await feature.loader.getClass({ className })
|
|
56
|
-
|
|
57
|
-
return {
|
|
58
|
-
classSchema: _classSchema,
|
|
59
|
-
featuresPayloads,
|
|
60
|
-
_class
|
|
61
|
-
}
|
|
62
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import _ from 'underscore'
|
|
2
|
-
|
|
3
|
-
export default async ({
|
|
4
|
-
featuresPayloads,
|
|
5
|
-
featureFactory,
|
|
6
|
-
extractFeature,
|
|
7
|
-
updateFeaturesExcerpt,
|
|
8
|
-
instancesPathId }) => {
|
|
9
|
-
|
|
10
|
-
let features = []
|
|
11
|
-
|
|
12
|
-
for (var i in featuresPayloads) {
|
|
13
|
-
const featurePayload = featuresPayloads[i]
|
|
14
|
-
|
|
15
|
-
const feature = await featureFactory({
|
|
16
|
-
featurePayload,
|
|
17
|
-
instancesPathId,
|
|
18
|
-
// instancesPathId: _instancesPathId
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
if (feature && feature.extractionStatus === 2) {
|
|
22
|
-
features.push(feature)
|
|
23
|
-
continue
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const extractedFeatureStruct = await extractFeature({
|
|
27
|
-
featureFactory,
|
|
28
|
-
updateFeaturesExcerpt,
|
|
29
|
-
feature,
|
|
30
|
-
instancesPathId: [
|
|
31
|
-
...instancesPathId,
|
|
32
|
-
{ type: 'feature', value: { id: featurePayload.id } }
|
|
33
|
-
]
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
features.push(extractedFeatureStruct)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if (!features || !features.length) {
|
|
40
|
-
return []
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
features = _.flatten(features)
|
|
44
|
-
features = features.filter(a => a)
|
|
45
|
-
features = _.flatten(_.flatten(features))
|
|
46
|
-
features = _.uniq(features, 'id')
|
|
47
|
-
|
|
48
|
-
return features
|
|
49
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
export default async ({
|
|
3
|
-
adaptedClassesStructs,
|
|
4
|
-
featuresExcerpt }) => {
|
|
5
|
-
const candidates = adaptedClassesStructs.filter(a =>
|
|
6
|
-
(a && a.features && a.features.length))
|
|
7
|
-
|
|
8
|
-
if (!candidates || !candidates.length) {
|
|
9
|
-
return
|
|
10
|
-
}
|
|
11
|
-
candidates.forEach(adaptedClassesStruct => {
|
|
12
|
-
const { features, classSchema: { className } } = adaptedClassesStruct
|
|
13
|
-
features.forEach(feature => {
|
|
14
|
-
if (!featuresExcerpt[feature.id]) {
|
|
15
|
-
featuresExcerpt[feature.id] = {
|
|
16
|
-
classes: []
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
if (!featuresExcerpt[feature.id].classes.includes(className)) {
|
|
20
|
-
featuresExcerpt[feature.id].classes.push(className)
|
|
21
|
-
}
|
|
22
|
-
})
|
|
23
|
-
})
|
|
24
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/schema/build/{buildFeature → buildProtocol}/classStruct/preserveMostRestricted.js
RENAMED
|
File without changes
|