@servable/tools 2.0.1 → 2.2.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/global.d.ts +13 -0
- package/package.json +17 -15
- package/src/domain/protocolInstance/factory/index.js +8 -4
- package/src/domain/protocolInstance/index.js +15 -2
- package/src/domain/protocolLoader/base.js +19 -0
- package/src/domain/protocolLoader/v1.0.0.js +6 -3
- package/src/domain/protocolLoader/v1.1.0.js +7 -4
- package/src/domain/servable/parse/utils/index.js +21 -6
- package/src/index.js +8 -0
- package/src/lib/defineConfig.js +94 -0
- package/src/lib/directoryFilesRecursive.js +9 -1
- package/src/lib/directoryGlob.js +15 -1
- package/src/lib/ensureDirectoryExists.js +18 -5
- package/src/lib/getModuleDir.js +8 -3
- package/src/manifest/access/index.js +21 -0
- package/src/manifest/extract/extractItem.js +1 -1
- package/src/manifest/extract/route/extractFiles.js +8 -4
- package/src/manifest/extract/route/imageToBase64.js +12 -0
- package/src/schema/build/buildProtocol/classStruct/preserveMostRestricted.js +16 -2
- package/src/schema/build/index.js +4 -1
- package/src/schema/protocolResources/generateTypes.js +106 -0
- package/src/schema/protocolResources/index.js +103 -0
- package/src/schema/types/index.js +109 -0
- package/src/schema/validate/index.js +0 -1
- package/types/config/candidates/index.d.ts +2 -0
- package/types/config/candidates/protocolCandidates/index.d.ts +9 -0
- package/types/config/index.d.ts +2 -0
- package/types/config/validate/index.d.ts +4 -0
- package/types/config/validate/protocol/index.d.ts +5 -0
- package/types/document/gateway/all/index.d.ts +2 -0
- package/types/document/gateway/generateGithubReadme/index.d.ts +2 -0
- package/types/domain/lib/checkFileExists.d.ts +2 -0
- package/types/domain/protocol/factory/absoluteModuleSrcPath.d.ts +2 -0
- package/types/domain/protocol/factory/index.d.ts +7 -0
- package/types/domain/protocol/factory/protocolPath.d.ts +2 -0
- package/types/domain/protocol/index.d.ts +34 -0
- package/types/domain/protocol/lib/instancesPathIdUniqueId.d.ts +5 -0
- package/types/domain/protocolInstance/factory/getLoaderWithPayload.d.ts +4 -0
- package/types/domain/protocolInstance/factory/index.d.ts +6 -0
- package/types/domain/protocolInstance/factory/instancesWithPath.d.ts +6 -0
- package/types/domain/protocolInstance/index.d.ts +71 -0
- package/types/domain/protocolLoader/base.d.ts +52 -0
- package/types/domain/protocolLoader/factory/getModule.d.ts +6 -0
- package/types/domain/protocolLoader/factory/index.d.ts +4 -0
- package/types/domain/protocolLoader/lib/importJSDefault.d.ts +6 -0
- package/types/domain/protocolLoader/lib/importJSONDefault.d.ts +6 -0
- package/types/domain/protocolLoader/lib/mergeClassProtocols.d.ts +6 -0
- package/types/domain/protocolLoader/lib/triggerItems.d.ts +2 -0
- package/types/domain/protocolLoader/v1.0.0.d.ts +68 -0
- package/types/domain/protocolLoader/v1.1.0.d.ts +70 -0
- package/types/domain/servable/index.d.ts +8 -0
- package/types/domain/servable/parse/index.d.ts +5 -0
- package/types/domain/servable/parse/utils/index.d.ts +41 -0
- package/types/index.d.ts +22 -0
- package/types/lib/adaptConfig/basic.d.ts +4 -0
- package/types/lib/adaptProtocolPayload.d.ts +2 -0
- package/types/lib/checkFileExists.d.ts +2 -0
- package/types/lib/cleanProtocols.d.ts +2 -0
- package/types/lib/defineConfig.d.ts +175 -0
- package/types/lib/directories.d.ts +9 -0
- package/types/lib/directoryFilesRecursive.d.ts +7 -0
- package/types/lib/directoryGlob.d.ts +5 -0
- package/types/lib/ensureDirectoryExists.d.ts +15 -0
- package/types/lib/foldersInFolder.d.ts +9 -0
- package/types/lib/getModuleDir.d.ts +2 -0
- package/types/lib/importFileAsText.d.ts +2 -0
- package/types/lib/importJSONAsync.d.ts +2 -0
- package/types/lib/protocolApiVersion.d.ts +4 -0
- package/types/lib/sanitize.d.ts +2 -0
- package/types/lib/stableStringify.d.ts +2 -0
- package/types/manifest/access/accessChildInTreeWithRoute.d.ts +5 -0
- package/types/manifest/access/index.d.ts +10 -0
- package/types/manifest/data/1.0.0/enums.d.ts +382 -0
- package/types/manifest/data/1.1.0/enums.d.ts +401 -0
- package/types/manifest/extract/extractAst.d.ts +2 -0
- package/types/manifest/extract/extractItem.d.ts +2 -0
- package/types/manifest/extract/formatFile.d.ts +4 -0
- package/types/manifest/extract/index.d.ts +8 -0
- package/types/manifest/extract/route/extractFileWithVariants.d.ts +2 -0
- package/types/manifest/extract/route/extractFiles.d.ts +2 -0
- package/types/manifest/extract/route/imageToBase64.d.ts +13 -0
- package/types/manifest/extract/route/index.d.ts +2 -0
- package/types/manifest/extract/templateDataForId.d.ts +5 -0
- package/types/schema/artifact/index.d.ts +21 -0
- package/types/schema/build/buildProtocol/classStruct/extractProtocolsProtocols.d.ts +6 -0
- package/types/schema/build/buildProtocol/classStruct/index.d.ts +15 -0
- package/types/schema/build/buildProtocol/classStruct/preserveMostRestricted.d.ts +4 -0
- package/types/schema/build/buildProtocol/classStruct/protocolInClassClassSchema.d.ts +2 -0
- package/types/schema/build/buildProtocol/extractClassesProtocol.d.ts +8 -0
- package/types/schema/build/buildProtocol/index.d.ts +7 -0
- package/types/schema/build/buildProtocol/index.for.d.ts +7 -0
- package/types/schema/build/buildProtocol/index.promiseall.d.ts +7 -0
- package/types/schema/build/index.d.ts +9 -0
- package/types/schema/build/lib/getProtocolsLiveClasses.d.ts +4 -0
- package/types/schema/build/lib/updateProtocolsExcerpt.d.ts +5 -0
- package/types/schema/plan/classifyField.d.ts +23 -0
- package/types/schema/plan/index.d.ts +11 -0
- package/types/schema/protocolResources/generateTypes.d.ts +11 -0
- package/types/schema/protocolResources/index.d.ts +42 -0
- package/types/schema/types/index.d.ts +18 -0
- package/types/schema/validate/handleProtocol/computeVersions.d.ts +16 -0
- package/types/schema/validate/handleProtocol/index.d.ts +18 -0
- package/types/schema/validate/index.d.ts +26 -0
- package/src/schema/index.js +0 -56
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare function _default(props: any): Promise<{
|
|
2
|
+
highestVersion?: undefined;
|
|
3
|
+
lowestCompatibleVersion?: undefined;
|
|
4
|
+
lowestVersion?: undefined;
|
|
5
|
+
} | {
|
|
6
|
+
highestVersion: {
|
|
7
|
+
value: string;
|
|
8
|
+
};
|
|
9
|
+
lowestCompatibleVersion: {
|
|
10
|
+
value: string;
|
|
11
|
+
};
|
|
12
|
+
lowestVersion: {
|
|
13
|
+
value: string;
|
|
14
|
+
};
|
|
15
|
+
}>;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare function _default({ protocol }: {
|
|
2
|
+
protocol: any;
|
|
3
|
+
}): Promise<{
|
|
4
|
+
highestVersion?: undefined;
|
|
5
|
+
lowestCompatibleVersion?: undefined;
|
|
6
|
+
lowestVersion?: undefined;
|
|
7
|
+
} | {
|
|
8
|
+
highestVersion: {
|
|
9
|
+
value: string;
|
|
10
|
+
};
|
|
11
|
+
lowestCompatibleVersion: {
|
|
12
|
+
value: string;
|
|
13
|
+
};
|
|
14
|
+
lowestVersion: {
|
|
15
|
+
value: string;
|
|
16
|
+
};
|
|
17
|
+
}>;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
declare function _default({ schema, }: {
|
|
2
|
+
schema: any;
|
|
3
|
+
}): Promise<{
|
|
4
|
+
isValid: boolean;
|
|
5
|
+
issues: {
|
|
6
|
+
comparison: {
|
|
7
|
+
highestVersion?: undefined;
|
|
8
|
+
lowestCompatibleVersion?: undefined;
|
|
9
|
+
lowestVersion?: undefined;
|
|
10
|
+
} | {
|
|
11
|
+
highestVersion: {
|
|
12
|
+
value: string;
|
|
13
|
+
};
|
|
14
|
+
lowestCompatibleVersion: {
|
|
15
|
+
value: string;
|
|
16
|
+
};
|
|
17
|
+
lowestVersion: {
|
|
18
|
+
value: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
message: string;
|
|
22
|
+
}[];
|
|
23
|
+
} | {
|
|
24
|
+
isValid: boolean;
|
|
25
|
+
}>;
|
|
26
|
+
export default _default;
|
package/src/schema/index.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import protocolFactory from "../domain/protocol/factory/index.js"
|
|
2
|
-
import getProtocolsLiveClasses from "./build/lib/getProtocolsLiveClasses.js"
|
|
3
|
-
import adaptConfigBasic from "../lib/adaptConfig/basic.js"
|
|
4
|
-
import extractProtocol from './extractProtocol/index.js'
|
|
5
|
-
import updateProtocolsExcerpt from './build/lib/updateProtocolsExcerpt.js'
|
|
6
|
-
|
|
7
|
-
export default async ({ servableConfig }) => {
|
|
8
|
-
const { rootProtocolPayload } = servableConfig
|
|
9
|
-
adaptConfigBasic({ servableConfig, live: false })
|
|
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
|
-
},
|
|
18
|
-
servableConfig,
|
|
19
|
-
protocolsCache,
|
|
20
|
-
instancesPathId: [
|
|
21
|
-
{ type: 'protocol', value: { id: 'app' } }
|
|
22
|
-
],
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
const protocolsExcerpt = {}
|
|
26
|
-
const protocols = await extractProtocol({
|
|
27
|
-
protocol: appProtocol,
|
|
28
|
-
protocolFactory: async ({
|
|
29
|
-
protocolPayload,
|
|
30
|
-
instancesPathId
|
|
31
|
-
}) =>
|
|
32
|
-
protocolFactory({
|
|
33
|
-
protocolPayload,
|
|
34
|
-
servableConfig,
|
|
35
|
-
protocolsCache,
|
|
36
|
-
instancesPathId
|
|
37
|
-
}),
|
|
38
|
-
updateProtocolsExcerpt: async ({ adaptedClassesStructs }) =>
|
|
39
|
-
updateProtocolsExcerpt({
|
|
40
|
-
adaptedClassesStructs,
|
|
41
|
-
protocolsExcerpt
|
|
42
|
-
}),
|
|
43
|
-
instancesPathId: [
|
|
44
|
-
{ type: 'protocol', value: { id: 'app' } }
|
|
45
|
-
],
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
const liveClasses = await getProtocolsLiveClasses({ protocols })
|
|
49
|
-
|
|
50
|
-
return {
|
|
51
|
-
protocols,
|
|
52
|
-
protocolsExcerpt,
|
|
53
|
-
appProtocol,
|
|
54
|
-
liveClasses
|
|
55
|
-
}
|
|
56
|
-
}
|