25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

20 lines
1.3 KiB

  1. import fs from 'node:fs';
  2. import assert from 'node:assert/strict';
  3. import {login,call} from './role-permissions-live.mjs';
  4. const dir='reports/bridge-model-match-20260914',s=await login('root');
  5. const api=async(p,data,method)=>{const r=await call('tran/v1/'+p,s.accessToken,data,method);assert.equal(r.status,200,`${p}: ${r.message}`);return r.data;};
  6. const cleanup=JSON.parse(fs.readFileSync('E:/work/edit_3d/.codex-tmp/bridge-model-match-cleanup-20260914/result.json','utf8'));
  7. assert.equal(cleanup.result,'PASS');
  8. const fixtures=fs.readdirSync(dir).filter(f=>f.startsWith('fixtures-')).flatMap(f=>JSON.parse(fs.readFileSync(dir+'/'+f)));
  9. const ids=[...new Set(fixtures.map(f=>Number(f.projectId)))].sort((a,b)=>a-b);
  10. assert.deepEqual(ids,[453,454,455]);
  11. for(const id of ids){
  12. let detail=await api('content/projects/'+id);
  13. assert.ok(detail.project.name.startsWith('三维验收·'));
  14. detail=await api(`content/projects/${id}/review`,{version:detail.project.version,action:'REVOKE',comment:'模型匹配验收完成,清理本次临时项目'});
  15. await api(`content/projects/${id}?version=${detail.project.version}`,undefined,'DELETE');
  16. }
  17. cleanup.softDeletedContentProjects=ids;
  18. fs.writeFileSync(dir+'/cleanup.json',JSON.stringify(cleanup,null,2));
  19. console.log(JSON.stringify(cleanup));