AlertRestClient class

الفئة الأساسية التي يجب استخدامها (مشتقة من) لتقديم طلبات إلى VSS REST apis

يمتد

الأساليب

autofixCallback(AutofixCallbackRequest, string, string, number)

يتلقى استدعاء من خط أنابيب التثبيت التلقائي بنتيجة التشغيل. Idempotent: تكرار المكالمات لطلب موجود بالفعل في الحالة النهائية يعيد 200 بدون تغييرات.

createAutofixRequest(string, number, string, string)

أنشئ طلب تصحيح تلقائي للتنبيه المحدد.

createLegalReview(string, string, number, string)

إنشاء مراجعة قانونية. يؤدي ذلك إلى إنشاء المراجعة القانونية المقترنة بالتنبيه. يتضمن عنوان URL لعنصر عمل المراجعة.

deleteAllPipelineAnalyses(string, string)

يقوم بحذف بيانات التحليل تجريبيا لجميع خطوط الأنابيب في المستودع، وتنظيف تنبيهات الأمان المتقدمة المرتبطة.

deletePipelineAnalysis(string, string, number)

يقوم بحذف بيانات التحليل لخط أنابيب محدد، وتنظيف تنبيهات الأمان المتقدمة المرتبطة.

exportSarif(string, string, number[], string)

تصدير التنبيهات كملف SARIF واحد

getAlert(string, number, string, string, ExpandOption)

الحصول على تنبيه.

getAlertInstances(string, number, string, string)

احصل على مثيلات تنبيه على فرع محدد باستخدام @ref. إذا @ref لم يتم توفيرها، فسترجع مثيلات تنبيه على الفرع الافتراضي (إذا كان التنبيه موجودا في الفرع الافتراضي) أو أحدث فرع متأثر.

getAlertMetadata(string, number, string)

احصل على بيانات وصفية للتنبيه.

getAlertMetadataBatch(AlertMetadataBatchRequest, string, string)

احصل على بيانات وصفية للتنبيهات.

getAlerts(string, string, number, string, SearchCriteria, AlertListExpandOption, string)

الحصول على تنبيهات لمستودع

getAlertSarif(string, number, string, string, ExpandOption)

الحصول على تنبيه.

getAlertsByIds(AlertBatchRequest, string, string, boolean)

احصل على التنبيهات عبر معرفات التنبيهات يدعم حاليا جلب التنبيهات السرية فقط.

getAutofixRequestsByAlertId(string, number, string, string)

احصل على جميع طلبات التصحيح التلقائي للتنبيه المحدد.

getBranches(string, string, AlertType, string, string, number, boolean)

إرجاع الفروع التي تم إرسال نتائج التحليل لها.

getOrgLevelAlertsByIds(number[])

احصل على تنبيهات حسب معرفاتهم على مستوى المؤسسة. لا يعيد سوى إعادة تشغيل التنبيهات التي يمتلك المستخدم إذنا لعرضها. ترجع فقط تنبيهات خطط SKU التي تم تمكينها.

getSarif(number)

الحصول على حالة مهمة معالجة Sarif

getSarifContent(number)
getUxFilters(string, string, AlertType)
getValidityData(string, string, number)

احصل على تفاصيل الصلاحية للتنبيه.

initiateValidation(string, string, number)

بدء عملية التحقق من الصحة لتنبيه معين

updateAlert(AlertStateUpdate, string, number, string)

تحديث حالة التنبيه

updateAlertsBatch(AlertBatchStateUpdateRequest, string, string)

تنبيه تحديث الدفعة يذكر. الاستخدام الداخلي فقط — يستخدم من قبل أجهزة مسح الإثبات لنقل تنبيهات المسودة التي يولدها الذكاء الاصطناعي إلى تنبيهات نشطة أو مرفوضة. التنبيهات التي تم تمييزها ك Draft (غير محددة) تبقى دون تغيير.

updateAlertsMetadata(AlertMetadata[], string, string)

تحديث اقترانات بيانات تعريف التنبيه.

uploadOrgSarif(string)

تحميل ملف Sarif على مستوى المؤسسة

uploadSarif(string, string, string, String)

تحميل Sarif يحتوي على تنبيهات أمنية

uploadSarifToGitHub(string, string, string, string, string)

قم بتحميل ملف SARIF إلى GitHub أثناء مسح الشيفرة عبر تطبيق GitOps.

تفاصيل المنشئ

AlertRestClient(IVssRestClientOptions)

new AlertRestClient(options: IVssRestClientOptions)

المعلمات

تفاصيل الأسلوب

autofixCallback(AutofixCallbackRequest, string, string, number)

يتلقى استدعاء من خط أنابيب التثبيت التلقائي بنتيجة التشغيل. Idempotent: تكرار المكالمات لطلب موجود بالفعل في الحالة النهائية يعيد 200 بدون تغييرات.

function autofixCallback(callbackRequest: AutofixCallbackRequest, project: string, repository: string, alertId: number): Promise<void>

المعلمات

callbackRequest
AutofixCallbackRequest

حمولة الاستدعاء التي تحتوي على معرف requestId، الحالة، وpullRequestId الاختياري.

project

string

معرف المشروع أو اسم المشروع

repository

string

اسم المستودع أو معرفه.

alertId

number

معرف التنبيه لإنشاء تصحيح تلقائي ل.

المرتجعات

Promise<void>

createAutofixRequest(string, number, string, string)

أنشئ طلب تصحيح تلقائي للتنبيه المحدد.

function createAutofixRequest(project: string, alertId: number, repository: string, ref?: string): Promise<AutofixRequest>

المعلمات

project

string

معرف المشروع أو اسم المشروع

alertId

number

معرف التنبيه لإنشاء تصحيح تلقائي ل.

repository

string

اسم المستودع أو معرفه.

ref

string

مرجع Git الاختياري (مثل refs/heads/feature/x) يجب أن يستهدف التعديل التلقائي. عند حذفها، يستخدم الفرع الافتراضي للمستودع.

المرتجعات

Promise<AutofixRequest>

createLegalReview(string, string, number, string)

إنشاء مراجعة قانونية. يؤدي ذلك إلى إنشاء المراجعة القانونية المقترنة بالتنبيه. يتضمن عنوان URL لعنصر عمل المراجعة.

function createLegalReview(project: string, repository: string, alertId: number, ref?: string): Promise<LegalReview>

المعلمات

project

string

معرف المشروع أو اسم المشروع

repository

string

اسم أو معرف مستودع للتنبيه القانوني

alertId

number

معرف تنبيه الأمان المتقدم للتنبيه القانوني للحصول على المراجعة القانونية

ref

string

المرتجعات

Promise<LegalReview>

deleteAllPipelineAnalyses(string, string)

يقوم بحذف بيانات التحليل تجريبيا لجميع خطوط الأنابيب في المستودع، وتنظيف تنبيهات الأمان المتقدمة المرتبطة.

function deleteAllPipelineAnalyses(project: string, repository: string): Promise<void>

المعلمات

project

string

معرف المشروع أو اسم المشروع

repository

string

اسم المستودع أو معرفه.

المرتجعات

Promise<void>

deletePipelineAnalysis(string, string, number)

يقوم بحذف بيانات التحليل لخط أنابيب محدد، وتنظيف تنبيهات الأمان المتقدمة المرتبطة.

function deletePipelineAnalysis(project: string, repository: string, adoPipelineId: number): Promise<void>

المعلمات

project

string

معرف المشروع أو اسم المشروع

repository

string

اسم المستودع أو معرفه.

adoPipelineId

number

معرف خط أنابيب ADO الذي يجب تنظيف بيانات تحليله.

المرتجعات

Promise<void>

exportSarif(string, string, number[], string)

تصدير التنبيهات كملف SARIF واحد

function exportSarif(project: string, repository: string, alertIds: number[], branchName?: string): Promise<any>

المعلمات

project

string

معرف المشروع أو اسم المشروع

repository

string

اسم المستودع أو معرفه

alertIds

number[]

قائمة معرفات التنبيه للتصدير

branchName

string

اسم فرع الهدف ينبه. إذا لم يتم تحديده، سيتم استخدام الفرع الافتراضي.

المرتجعات

Promise<any>

getAlert(string, number, string, string, ExpandOption)

الحصول على تنبيه.

function getAlert(project: string, alertId: number, repository: string, ref?: string, expand?: ExpandOption): Promise<Alert>

المعلمات

project

string

معرف المشروع أو اسم المشروع

alertId

number

معرف التنبيه المراد استرداده

repository

string

اسم أو معرف مستودع يكون التنبيه جزءا منه

ref

string

expand
ExpandOption

قم بتوسيع سمات التنبيه السري. القيم المحتملة هي None و ValidationFingerprint. الإعدادات الافتراضية لـ None. اعلم أنه إذا expand تم تعيينه على ValidationFingerprint، فقد تحتوي الاستجابة على السر في شكله غير المشفر. يرجى توخي الحذر عند استخدام هذه البيانات.

المرتجعات

Promise<Alert>

getAlertInstances(string, number, string, string)

احصل على مثيلات تنبيه على فرع محدد باستخدام @ref. إذا @ref لم يتم توفيرها، فسترجع مثيلات تنبيه على الفرع الافتراضي (إذا كان التنبيه موجودا في الفرع الافتراضي) أو أحدث فرع متأثر.

function getAlertInstances(project: string, alertId: number, repository: string, ref?: string): Promise<AlertAnalysisInstance[]>

المعلمات

project

string

معرف المشروع أو اسم المشروع

alertId

number

معرف التنبيه المراد استرداده

repository

string

اسم أو معرف مستودع يكون التنبيه جزءا منه

ref

string

المرتجعات

getAlertMetadata(string, number, string)

احصل على بيانات وصفية للتنبيه.

function getAlertMetadata(project: string, alertId: number, repository: string): Promise<AlertMetadata>

المعلمات

project

string

معرف المشروع أو اسم المشروع

alertId

number

معرف التنبيه المراد استرداده

repository

string

اسم أو معرف مستودع يكون التنبيه جزءا منه

المرتجعات

Promise<AlertMetadata>

getAlertMetadataBatch(AlertMetadataBatchRequest, string, string)

احصل على بيانات وصفية للتنبيهات.

function getAlertMetadataBatch(alertMetadataBatchRequest: AlertMetadataBatchRequest, project: string, repository: string): Promise<AlertMetadata[]>

المعلمات

alertMetadataBatchRequest
AlertMetadataBatchRequest
project

string

معرف المشروع أو اسم المشروع

repository

string

اسم أو معرف مستودع يكون التنبيه جزءا منه

المرتجعات

Promise<AlertMetadata[]>

getAlerts(string, string, number, string, SearchCriteria, AlertListExpandOption, string)

الحصول على تنبيهات لمستودع

function getAlerts(project: string, repository: string, top?: number, orderBy?: string, criteria?: SearchCriteria, expand?: AlertListExpandOption, continuationToken?: string): Promise<PagedList<Alert>>

المعلمات

project

string

معرف المشروع أو اسم المشروع

repository

string

اسم المستودع أو معرفه

top

number

الحد الأقصى لعدد التنبيهات التي يجب إرجاعها

orderBy

string

يجب أن يكون "id" "firstSeen" "lastSeen" "fixedOn" أو "severity" Defaults إلى "id"

criteria
SearchCriteria

خيارات للحد من التنبيهات التي تم إرجاعها

continuationToken

string

إذا كان هناك تنبيهات أكثر مما يمكن إرجاعه، يتم وضع رمز مميز للمتابعة في عنوان "x-ms-continuationtoken". استخدم هذا الرمز المميز هنا للحصول على الصفحة التالية من التنبيهات

المرتجعات

Promise<PagedList<Alert>>

getAlertSarif(string, number, string, string, ExpandOption)

الحصول على تنبيه.

function getAlertSarif(project: string, alertId: number, repository: string, ref?: string, expand?: ExpandOption): Promise<string>

المعلمات

project

string

معرف المشروع أو اسم المشروع

alertId

number

معرف التنبيه المراد استرداده

repository

string

اسم أو معرف مستودع يكون التنبيه جزءا منه

ref

string

expand
ExpandOption

قم بتوسيع سمات التنبيه السري. القيم المحتملة هي None و ValidationFingerprint. الإعدادات الافتراضية لـ None. اعلم أنه إذا expand تم تعيينه على ValidationFingerprint، فقد تحتوي الاستجابة على السر في شكله غير المشفر. يرجى توخي الحذر عند استخدام هذه البيانات.

المرتجعات

Promise<string>

getAlertsByIds(AlertBatchRequest, string, string, boolean)

احصل على التنبيهات عبر معرفات التنبيهات يدعم حاليا جلب التنبيهات السرية فقط.

function getAlertsByIds(request: AlertBatchRequest, project: string, repository: string, includeSensitiveInformation?: boolean): Promise<Alert[]>

المعلمات

request
AlertBatchRequest

طلب يحتوي على معرفات تنبيه ومرشح تنبيه اختياري

project

string

معرف المشروع أو اسم المشروع

repository

string

اسم المستودع أو معرفه

includeSensitiveInformation

boolean

ينطبق فقط على التنبيهات السرية. عند الخطأ (الافتراضي)، يتم حذف 'ValidationFingerprintJson' الخاص ببصمات التحقق من كل تنبيه سري من الرد. ضبطها لتضمينها؛ كن على علم بأن بصمة التحقق JSON قد تحتوي على السر غير المشفر وبيانات حساسة أخرى، لذا توخي الحذر عند طلبها.

المرتجعات

Promise<Alert[]>

getAutofixRequestsByAlertId(string, number, string, string)

احصل على جميع طلبات التصحيح التلقائي للتنبيه المحدد.

function getAutofixRequestsByAlertId(project: string, alertId: number, repository: string, ref?: string): Promise<AutofixRequest[]>

المعلمات

project

string

معرف المشروع أو اسم المشروع

alertId

number

معرف التنبيه.

repository

string

اسم المستودع أو معرفه.

ref

string

مرجع Git الاختياري (مثل refs/heads/feature/x) يجب أن يستهدف التعديل التلقائي. عند حذفها، يستخدم الفرع الافتراضي للمستودع.

المرتجعات

Promise<AutofixRequest[]>

getBranches(string, string, AlertType, string, string, number, boolean)

إرجاع الفروع التي تم إرسال نتائج التحليل لها.

function getBranches(project: string, repository: string, alertType: AlertType, continuationToken?: string, branchNameContains?: string, top?: number, includePullRequestBranches?: boolean): Promise<Branch[]>

المعلمات

project

string

معرف المشروع أو اسم المشروع

repository

string

alertType
AlertType

نوع التنبيه: فحص التبعية (1) والسرية (2) والرمز QL (3) وما إلى ذلك.

continuationToken

string

متغير سلسلة يمثل اسم الفرع ويستخدم لجلب الفروع التي تتبعه بترتيب أبجدي.

branchNameContains

string

متغير سلسلة يستخدم لجلب الفروع التي تحتوي على هذه السلسلة في أي مكان في اسم الفرع، غير حساس لحالة الأحرف.

top

number

متغير int يستخدم لإرجاع فروع أعلى k التي تفي بمعايير البحث.

includePullRequestBranches

boolean

متغير منطقي يشير إلى ما إذا كان يجب تضمين فروع طلب السحب أم لا.

المرتجعات

Promise<Branch[]>

getOrgLevelAlertsByIds(number[])

احصل على تنبيهات حسب معرفاتهم على مستوى المؤسسة. لا يعيد سوى إعادة تشغيل التنبيهات التي يمتلك المستخدم إذنا لعرضها. ترجع فقط تنبيهات خطط SKU التي تم تمكينها.

function getOrgLevelAlertsByIds(alertIds: number[]): Promise<Alert[]>

المعلمات

alertIds

number[]

قائمة معرفات التنبيه المطلوب استردادها

المرتجعات

Promise<Alert[]>

getSarif(number)

الحصول على حالة مهمة معالجة Sarif

function getSarif(sarifId: number): Promise<SarifUploadStatus>

المعلمات

sarifId

number

تم إرجاع معرف Sarif عند تحميل Sarif

المرتجعات

getSarifContent(number)

function getSarifContent(submissionId: number): Promise<any>

المعلمات

submissionId

number

المرتجعات

Promise<any>

getUxFilters(string, string, AlertType)

function getUxFilters(project: string, repository: string, alertType: AlertType): Promise<UxFilters>

المعلمات

project

string

معرف المشروع أو اسم المشروع

repository

string

alertType
AlertType

المرتجعات

Promise<UxFilters>

getValidityData(string, string, number)

احصل على تفاصيل الصلاحية للتنبيه.

function getValidityData(project: string, repository: string, alertId: number): Promise<ValidationRequestInfo>

المعلمات

project

string

معرف المشروع أو اسم المشروع

repository

string

اسم المستودع أو معرفه

alertId

number

معرف التنبيه

المرتجعات

initiateValidation(string, string, number)

بدء عملية التحقق من الصحة لتنبيه معين

function initiateValidation(project: string, repository: string, alertId: number): Promise<AlertValidationRequestStatus>

المعلمات

project

string

معرف المشروع أو اسم المشروع

repository

string

اسم المستودع أو معرفه

alertId

number

معرف التنبيه

المرتجعات

updateAlert(AlertStateUpdate, string, number, string)

تحديث حالة التنبيه

function updateAlert(stateUpdate: AlertStateUpdate, project: string, alertId: number, repository: string): Promise<Alert>

المعلمات

stateUpdate
AlertStateUpdate

الحالة الجديدة للتنبيه

project

string

معرف المشروع أو اسم المشروع

alertId

number

معرف التنبيه

repository

string

اسم المستودع أو معرفه

المرتجعات

Promise<Alert>

updateAlertsBatch(AlertBatchStateUpdateRequest, string, string)

تنبيه تحديث الدفعة يذكر. الاستخدام الداخلي فقط — يستخدم من قبل أجهزة مسح الإثبات لنقل تنبيهات المسودة التي يولدها الذكاء الاصطناعي إلى تنبيهات نشطة أو مرفوضة. التنبيهات التي تم تمييزها ك Draft (غير محددة) تبقى دون تغيير.

function updateAlertsBatch(request: AlertBatchStateUpdateRequest, project: string, repository: string): Promise<Alert[]>

المعلمات

request
AlertBatchStateUpdateRequest

طلب يحتوي على تحديثات حالة التنبيه

project

string

معرف المشروع أو اسم المشروع

repository

string

اسم المستودع أو معرفه

المرتجعات

Promise<Alert[]>

updateAlertsMetadata(AlertMetadata[], string, string)

تحديث اقترانات بيانات تعريف التنبيه.

function updateAlertsMetadata(alertsMetadata: AlertMetadata[], project: string, repository: string): Promise<AlertMetadataChange[]>

المعلمات

alertsMetadata

AlertMetadata[]

قائمة ببيانات التعريف لإقرانها بالتنبيهات.

project

string

معرف المشروع أو اسم المشروع

repository

string

اسم المستودع أو معرفه.

المرتجعات

Promise<AlertMetadataChange[]>

uploadOrgSarif(string)

تحميل ملف Sarif على مستوى المؤسسة

function uploadOrgSarif(content: string): Promise<number>

المعلمات

content

string

المحتوى المطلوب تحميله

المرتجعات

Promise<number>

uploadSarif(string, string, string, String)

تحميل Sarif يحتوي على تنبيهات أمنية

function uploadSarif(content: string, project: string, repository: string, notificationFlag?: String): Promise<number>

المعلمات

content

string

المحتوى المطلوب تحميله

project

string

معرف المشروع أو اسم المشروع

repository

string

اسم المستودع أو معرفه

notificationFlag

String

رأس للإشارة إلى أن هذا إعلام تقدم

المرتجعات

Promise<number>

uploadSarifToGitHub(string, string, string, string, string)

قم بتحميل ملف SARIF إلى GitHub أثناء مسح الشيفرة عبر تطبيق GitOps.

function uploadSarifToGitHub(content: string, project: string, hostname: string, owner: string, repo: string): Promise<string>

المعلمات

content

string

المحتوى المطلوب تحميله

project

string

معرف المشروع أو اسم المشروع

hostname

string

اسم المضيف GitHub (مثل github.com أو microsoft.ghe.com)

owner

string

مالك مستودع GitHub (منظمة أو مستخدم)

repo

string

اسم مستودع GitHub

المرتجعات

Promise<string>