@aikdna/kdna-cli 0.21.0 → 0.22.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 +31 -96
- package/fixtures/v1-minimal/checksums.json +6 -0
- package/fixtures/v1-minimal/kdna.json +42 -0
- package/fixtures/v1-minimal/mimetype +1 -0
- package/fixtures/v1-minimal/payload.kdnab +31 -0
- package/package.json +10 -8
- package/schema/checksums.schema.json +43 -0
- package/schema/load-contract.schema.json +41 -0
- package/schema/manifest.schema.json +198 -0
- package/schema/payload-profile-v1.schema.json +70 -0
- package/src/agent.js +14 -65
- package/src/cli.js +72 -4
- package/src/cmds/anti-monolithic.js +192 -0
- package/src/cmds/domain.js +104 -0
- package/src/v1-cli.js +715 -0
- package/src/verify.js +18 -4
package/src/verify.js
CHANGED
|
@@ -62,7 +62,11 @@ function validateManifestFn(manifest) {
|
|
|
62
62
|
if (manifest.format && manifest.format !== 'kdna') {
|
|
63
63
|
errors.push(`kdna.json.format: invalid value "${manifest.format}". Expected "kdna".`);
|
|
64
64
|
}
|
|
65
|
-
if (
|
|
65
|
+
if (
|
|
66
|
+
manifest.format_version &&
|
|
67
|
+
manifest.format_version !== '1.0' &&
|
|
68
|
+
manifest.format_version !== '2.0'
|
|
69
|
+
) {
|
|
66
70
|
errors.push(
|
|
67
71
|
`kdna.json.format_version: invalid value "${manifest.format_version}". Expected "1.0" or "2.0".`,
|
|
68
72
|
);
|
|
@@ -118,8 +122,11 @@ function assetView(kdnaPath, options = {}) {
|
|
|
118
122
|
allEntries.add('KDNA_Core.json');
|
|
119
123
|
allEntries.add('KDNA_Patterns.json');
|
|
120
124
|
return {
|
|
121
|
-
kind: 'asset',
|
|
122
|
-
|
|
125
|
+
kind: 'asset',
|
|
126
|
+
path: kdnaPath,
|
|
127
|
+
exists(name) {
|
|
128
|
+
return allEntries.has(name) || entries.has(name);
|
|
129
|
+
},
|
|
123
130
|
readJson(name) {
|
|
124
131
|
if (entries.has(name)) return readContainerJson(kdnaPath, name, options);
|
|
125
132
|
return _ensureDataMap()[name] || null;
|
|
@@ -130,7 +137,14 @@ function assetView(kdnaPath, options = {}) {
|
|
|
130
137
|
return dm[name] ? JSON.stringify(dm[name]) : '';
|
|
131
138
|
},
|
|
132
139
|
listDirFiles(dirName) {
|
|
133
|
-
|
|
140
|
+
const prefix = dirName.replace(/\/+$/, '') + '/';
|
|
141
|
+
return [...entries]
|
|
142
|
+
.filter((e) => e.startsWith(prefix))
|
|
143
|
+
.map((e) => {
|
|
144
|
+
const r = e.slice(prefix.length);
|
|
145
|
+
return r.includes('/') ? null : r;
|
|
146
|
+
})
|
|
147
|
+
.filter(Boolean);
|
|
134
148
|
},
|
|
135
149
|
};
|
|
136
150
|
}
|