import { type AvailableRelease, type OfferedRelease } from "./latest.js"; import type { DeviceIdentity } from "./license-identity.js"; import type { BundlePlatformId } from "../packaging/platform.js"; import type { UpdateTrigger } from "../updating/progress-file.js"; export type BundleChannel = "stable" | "beta"; export interface BundleQuery { product: string; platform: BundlePlatformId; channel: BundleChannel; /** النسخة المثبَّتة — المركز لا يعيد ما هو ≤ منها. */ current: string; /** إصدارٌ مسمًّى (الرجوع): يُعاد بعينه ولو كان أقدم. */ version?: string; /** * AR: ما يفهمه هذا المحدِّث (2026-10-14): ‎update‎ = «أطبّق ملف التحديث إن غطّاني»، ‎full‎ = «الحزمة الكاملة * وحدها» (الرجوع بعد فشل ملف التحديث). **المحدِّث القديم لا يرسله، فيأخذ ما أخذه دائمًا أو حزمة الجسر.** * EN: What this updater understands (2026-10-14): `update` = "I apply the update file when it covers me", * `full` = "the full bundle only" (falling back after an update file failed). **An old updater does not * send it, so it gets what it always got, or the bridge.** */ format?: "update" | "full"; } /** حزمةٌ عرضها المركز لهذا الجهاز: ما يلزم التنزيلَ والتحقّقَ، ورابطٌ برمزٍ قصير العمر. */ export interface BundleOffer extends AvailableRelease { /** مطلقٌ (مركّب على عنوان المركز)، يحمل الرمز. */ downloadUrl: string; } export interface BundleReportBody { from: string; to: string; outcome: "installed" | "failed" | "skipped"; trigger: UpdateTrigger; reason?: string; durationSeconds?: number; /** أيّ ملفٍّ ثُبِّت أو فشل (2026-10-14) — مركزٌ أقدم يرفض الحقل، فلا يُرسَل إلّا حين يُعرَف. */ kind?: "full" | "update"; } /** * AR: **المركز رفض هذا الجهاز** — محظور، أو رخصته موقوفة أو منتهية. ليس عطلَ شبكة: الجهاز يُقلع على * نسخته والنواة تعرض الحالة. ‎code‎ و‎message‎ من المركز كما هما (نصوص 002). * EN: **The centre refused this appliance** — blocked, or its licence suspended or expired. Not a * network fault: the appliance boots on its version and the core shows the state. `code` and * `message` come from the centre verbatim (002's wording). */ export declare class BundleRefused extends Error { readonly code: string; constructor(code: string, message: string); } export declare function identityHeaders(identity: DeviceIdentity): Record; /** * AR: أحدث حزمة لهذا الجهاز، أو ‎null‎ إن لم يوجد أحدث. يرمي ‎BundleRefused‎ عند رفض المركز، وأيّ خطأ * آخر (مهلة، شبكة، 5xx) كما هو — المُنادي يعامله «تعذّر الوصول» ويُقلع. * EN: The newest bundle for this appliance, or `null` when there is none. Throws `BundleRefused` when * the centre refuses, and any other error (timeout, network, 5xx) as is — the caller treats it as * "unreachable" and boots. */ export declare function fetchBundleLatest(identity: DeviceIdentity, query: BundleQuery, timeoutMs: number): Promise; /** * AR: الإصدارات المنشورة التي يجوز الرجوع إليها، بالهويّة (مواصفة 003) — القائمة نفسها التي يعيدها * ‎/setup/versions‎ بالكود، لكن داخل غلاف D4 ‎{ data }‎. * EN: The published versions one may go back to, by identity (spec 003) — the same list `/setup/versions` * returns by code, but inside the D4 envelope `{ data }`. */ export declare function fetchBundleVersions(identity: DeviceIdentity, query: { product: string; platform: BundlePlatformId; }, timeoutMs?: number): Promise; /** * AR: يبلّغ المركز بنتيجة تحديث. **أفضل جهد ولا يرمي أبدًا**: تقريرٌ فاشل لا يستحقّ أن يُفشل إقلاعًا. * EN: Reports an update's outcome to the centre. **Best effort, never throws**: a failed report does * not deserve to fail a boot. */ export declare function reportBundleOutcome(identity: DeviceIdentity, body: BundleReportBody, timeoutMs?: number): Promise; //# sourceMappingURL=bundle.d.ts.map