سامانه صدور فاکتور و حسابداری
Align quality gates with master deletion and escaping invariants
davoodmehraban89 committed
Sep 29, 2026 at 22:36 UTC
60da9fd633eaaa1d1bf8871f7cb89959aca3b1e0
1 file changed
+2
-1
scripts/quality-check.mjs
+2
-1
@@ -16,6 +16,7 @@ for(const s of requiredScripts)if(!index.includes(s))throw new Error('Missing sc
16
for(const v of ['view-purchases','view-payments'])if(!index.includes(`data-view="${v}"`))throw new Error('Missing primary navigation: '+v);
17
if(!index.includes("frame-ancestors 'none'")||!index.includes('upgrade-insecure-requests'))throw new Error('Production CSP hardening missing');
18
if(!index.includes('name="referrer" content="strict-origin-when-cross-origin"'))throw new Error('Referrer policy metadata missing');
19
+for(const needle of ["replace(/&/g,'&')","replace(/</g,'<')","replace(/>/g,'>')","replace(/\"/g,'"')","replace(/'/g,''')"])if(!fs.readFileSync(path.join(root,'js','core.js'),'utf8').includes(needle))throw new Error('HTML escaping invariant missing '+needle);
20
if(!index.includes('فینورا — نسخه ۱.۰')||!index.includes('نسخه ۱.۰'))throw new Error('Visible application version is inconsistent');
21
for(const shellId of ['module-rail','module-panel','module-panel-links','global-command-search','command-search-results','topbar-company','topbar-fiscal-year','workspace-title','workspace-context-text'])if(!ids.includes(shellId))throw new Error('Phase 1 shell missing #'+shellId);
22
for(const cls of ['module-rail','module-panel','topbar','global-search'])if(!index.includes('class="'+cls)&&!index.includes('class="sidebar '+cls)&&!index.includes('class="'+cls+' '))throw new Error('Phase 1 shell class missing: '+cls);
@@ -31,7 +32,7 @@ const must={
32
'print.js':['function renderAndPrintDirect','FORMAL_ROWS_PER_PAGE=12','const isPreInvoice=',"const a4Landscape=isFormal||isPreInvoice",'size: A4 landscape','size: A5 landscape'],
33
'purchases.js':['window.purSave=function','window.purEdit=function','window.purPrint=function','window.purRefreshProjects=function','pur-payment-method','companyId'],
34
'projects.js':['editContactProject','deleteContactProject','addSubproject','editSubproject','deleteSubproject','usedExpense','usedPayment','projectDirectionLabel(s.direction||p.direction)','project-direction-select','return new Promise'],
34
- 'companies.js':['usedSales','usedPurchases','usedExpenses','usedPayments','usedCheques'],
35
+ 'companies.js':['Object.entries(datastore)',"key!=='companies'",'default_company_id'],
36
'operations.js':['editContact','editProduct','editCheque','editExpense','deleteInvoice','refreshExpenseProjects','projectId','getMyPayments','companyId'],
37
'selfcheck.js':['datastore.payments','invoices.has','purchases.has'],
38
'payments.js':['commitSavePayment','invoiceOutstanding','purchaseOutstanding','companyOk','legacyOk','amount>outstanding',"direction!=='inbound'","direction!=='outbound'",'projectId',"paymentMethod!=='credit'","old.invoiceType===invoiceType"],