Files
MikrotikManager/backend/scripts/writer-profile/fixed57-build-definition.ts
T

27 lines
1.2 KiB
TypeScript

import { canonical, sha } from "./application-writer-profile-canonical.js"
import { sorted, type Inventory } from "./catalogue-projection.js"
import { FIXED56_ROLE_TEMPLATE } from "./fixed56-build-definition.js"
export const BUILD57_PROVENANCE = Object.freeze({
format: "source57-build-candidate-v1",
manifestSha256: "7dbd678e59740c14a29594180c86b85b3b2dd53fd5aa7a72da6d14a513760dbc",
templateSha256: "8d81bb1954c17dc46d69ce18c5d7636a0d080552812e40c94506bd305c89429e",
})
export const FIXED57_ROLE_TEMPLATE: Readonly<Inventory> = Object.freeze({
...FIXED56_ROLE_TEMPLATE,
indexes: sorted([...FIXED56_ROLE_TEMPLATE.indexes, {
relname: "mcp_audit",
index_name: "mcp_audit_routing_charge_profile_window",
indisvalid: true,
indisready: true,
indisunique: false,
indisprimary: false,
definition: "CREATE INDEX mcp_audit_routing_charge_profile_window ON public.mcp_audit USING btree (connection_id, (((payload -> 'anchor'::text) ->> 'profileId'::text)), created_at, id) WHERE (action = 'routing.charge.admitted'::text)",
}]),
})
if (sha(canonical(FIXED57_ROLE_TEMPLATE)) !== BUILD57_PROVENANCE.templateSha256) {
throw new Error("Fixed57 writer catalogue changed")
}