forked from unimatrix/web
Fresh production baseline [skip ci]
This commit is contained in:
commit
0a11a18274
1 changed files with 229644 additions and 0 deletions
8
website/scripts/export-dev-request-catalogue.mjs
Normal file
8
website/scripts/export-dev-request-catalogue.mjs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import {MASTER_KEY_TEMPLATES} from '../control-panel/public/jarvis-master-keys.mjs';
|
||||
import {readFileSync,writeFileSync} from 'node:fs';import {createHash} from 'node:crypto';
|
||||
export function devRequestCatalogue(){
|
||||
return {schemaVersion:1,sourceHash:createHash('sha256').update(readFileSync(new URL('../control-panel/public/jarvis-master-keys.mjs',import.meta.url),'utf8').replaceAll('\r\n','\n')).digest('hex'),actions:MASTER_KEY_TEMPLATES.flatMap(t=>t.actions.map(a=>({id:a.id,label:t.label+' · '+a.label,version:a.version,keyType:a.keyType,fields:a.fields,effect:a.effect||'',fixedTargets:a.fixedTargets||[],webIssue:a.webIssue===true,recordOnly:a.recordOnly===true})))};
|
||||
}
|
||||
if(process.argv[1]&&import.meta.url.endsWith('/'+process.argv[1].replaceAll('\\','/').split('/').pop())){
|
||||
const data=JSON.stringify(devRequestCatalogue(),null,2)+'\n';if(process.argv[2])writeFileSync(process.argv[2],data);else process.stdout.write(data);
|
||||
}
|
||||
Loading…
Reference in a new issue

Staff