Udostępnij za pomocą


WikiRestClient class

Klasa bazowa, która powinna być używana (pochodna) do tworzenia żądań do interfejsów API REST usługi VSS

Rozszerzenie

Konstruktory

WikiRestClient(IVssRestClientOptions)

Właściwości

RESOURCE_AREA_ID

Metody

addComment(CommentCreateParameters, string, string, number)

Dodawanie komentarza na stronie typu wiki.

addCommentReaction(string, string, number, number, CommentReactionType)

Dodawanie reakcji w komentarzu na stronie typu wiki.

createCommentAttachment(any, string, string, number)

Przekazuje załącznik do komentarza na stronie typu wiki.

createOrUpdatePageViewStats(string, string, GitVersionDescriptor, string, string)

Tworzy nowy zasób statystyk wyświetleń strony lub aktualizuje istniejący zasób statystyk wyświetleń strony.

createWiki(WikiCreateParametersV2, string)

Tworzy zasób typu wiki.

deleteComment(string, string, number, number)

Usuwanie komentarza na stronie typu wiki.

deleteCommentReaction(string, string, number, number, CommentReactionType)

Usuwanie reakcji w komentarzu na stronie typu wiki.

deleteWiki(string, string)

Usuwa witrynę typu wiki odpowiadającą podanemu identyfikatorowi witryny typu wiki lub nazwie witryny typu wiki.

getAllWikis(string)

Pobiera wszystkie witryny typu wiki w projekcie lub kolekcji.

getAttachmentContent(string, string, number, string)

Pobiera załącznik do komentarza na stronie typu wiki.

getComment(string, string, number, number, boolean, CommentExpandOptions)

Zwraca komentarz skojarzony ze stroną typu wiki.

getEngagedUsers(string, string, number, number, CommentReactionType, number, number)

Pobiera listę użytkowników, którzy zareagowali na dany komentarz wiki o danym typie reakcji. Obsługuje stronicowanie z domyślnym rozmiarem strony 100 użytkowników jednocześnie.

getPageByIdText(string, string, number, VersionControlRecursionType, boolean)

Pobiera metadane lub zawartość strony typu wiki dla podanego identyfikatora strony. Negocjacja treści odbywa się na podstawie nagłówka wysłanego Accept w żądaniu.

getPageByIdZip(string, string, number, VersionControlRecursionType, boolean)

Pobiera metadane lub zawartość strony typu wiki dla podanego identyfikatora strony. Negocjacja treści odbywa się na podstawie nagłówka wysłanego Accept w żądaniu.

getPageData(string, string, number, number)

Zwraca szczegóły strony odpowiadające identyfikatorowi strony.

getPagesBatch(WikiPagesBatchRequest, string, string, GitVersionDescriptor)

Zwraca stronicowaną listę stron typu wiki

getPageText(string, string, string, VersionControlRecursionType, GitVersionDescriptor, boolean)

Pobiera metadane lub zawartość strony typu wiki dla podanej ścieżki. Negocjacja treści odbywa się na podstawie nagłówka wysłanego Accept w żądaniu.

getPageZip(string, string, string, VersionControlRecursionType, GitVersionDescriptor, boolean)

Pobiera metadane lub zawartość strony typu wiki dla podanej ścieżki. Negocjacja treści odbywa się na podstawie nagłówka wysłanego Accept w żądaniu.

getWiki(string, string)

Pobiera witrynę typu wiki odpowiadającą podanemu identyfikatorowi witryny typu wiki lub nazwie witryny typu wiki.

listComments(string, string, number, number, string, boolean, CommentExpandOptions, CommentSortOrder, number)

Zwraca listę komentarzy do stronicowania.

updateComment(CommentUpdateParameters, string, string, number, number)

Aktualizowanie komentarza na stronie typu wiki.

updateWiki(WikiUpdateParameters, string, string)

Aktualizuje witrynę typu wiki odpowiadającą identyfikatorowi witryny typu wiki lub nazwie witryny typu wiki podanej przy użyciu parametrów aktualizacji.

Szczegóły konstruktora

WikiRestClient(IVssRestClientOptions)

new WikiRestClient(options: IVssRestClientOptions)

Parametry

Szczegóły właściwości

RESOURCE_AREA_ID

static RESOURCE_AREA_ID: string

Wartość właściwości

string

Szczegóły metody

addComment(CommentCreateParameters, string, string, number)

Dodawanie komentarza na stronie typu wiki.

function addComment(request: CommentCreateParameters, project: string, wikiIdentifier: string, pageId: number): Promise<Comment>

Parametry

request
CommentCreateParameters

Prośba o utworzenie komentarza.

project

string

Identyfikator projektu lub nazwa projektu

wikiIdentifier

string

Identyfikator wiki lub nazwa wiki.

pageId

number

Identyfikator strony typu wiki.

Zwraca

Promise<Comment>

addCommentReaction(string, string, number, number, CommentReactionType)

Dodawanie reakcji w komentarzu na stronie typu wiki.

function addCommentReaction(project: string, wikiIdentifier: string, pageId: number, commentId: number, type: CommentReactionType): Promise<CommentReaction>

Parametry

project

string

Identyfikator projektu lub nazwa projektu

wikiIdentifier

string

Identyfikator wiki lub nazwa wiki

pageId

number

Identyfikator strony typu wiki

commentId

number

Identyfikator powiązanego komentarza

type
CommentReactionType

Rodzaj dodawanej reakcji

Zwraca

Promise<CommentReaction>

createCommentAttachment(any, string, string, number)

Przekazuje załącznik do komentarza na stronie typu wiki.

function createCommentAttachment(content: any, project: string, wikiIdentifier: string, pageId: number): Promise<CommentAttachment>

Parametry

content

any

Zawartość do przekazania

project

string

Identyfikator projektu lub nazwa projektu

wikiIdentifier

string

Identyfikator wiki lub nazwa wiki.

pageId

number

Identyfikator strony typu wiki.

Zwraca

createOrUpdatePageViewStats(string, string, GitVersionDescriptor, string, string)

Tworzy nowy zasób statystyk wyświetleń strony lub aktualizuje istniejący zasób statystyk wyświetleń strony.

function createOrUpdatePageViewStats(project: string, wikiIdentifier: string, wikiVersion: GitVersionDescriptor, path: string, oldPath?: string): Promise<WikiPageViewStats>

Parametry

project

string

Identyfikator projektu lub nazwa projektu

wikiIdentifier

string

Identyfikator wiki lub nazwa wiki.

wikiVersion
GitVersionDescriptor

Wersja wiki.

path

string

Ścieżka strony typu wiki.

oldPath

string

Stara ścieżka strony. Jest to opcjonalne i wymagane do zmiany nazwy ścieżki w istniejących statystykach wyświetleń strony.

Zwraca

createWiki(WikiCreateParametersV2, string)

Tworzy zasób typu wiki.

function createWiki(wikiCreateParams: WikiCreateParametersV2, project?: string): Promise<WikiV2>

Parametry

wikiCreateParams
WikiCreateParametersV2

Parametry tworzenia wiki.

project

string

Identyfikator projektu lub nazwa projektu

Zwraca

Promise<WikiV2>

deleteComment(string, string, number, number)

Usuwanie komentarza na stronie typu wiki.

function deleteComment(project: string, wikiIdentifier: string, pageId: number, id: number): Promise<void>

Parametry

project

string

Identyfikator projektu lub nazwa projektu

wikiIdentifier

string

Identyfikator lub nazwa wiki.

pageId

number

Identyfikator strony typu wiki.

id

number

Identyfikator komentarza.

Zwraca

Promise<void>

deleteCommentReaction(string, string, number, number, CommentReactionType)

Usuwanie reakcji w komentarzu na stronie typu wiki.

function deleteCommentReaction(project: string, wikiIdentifier: string, pageId: number, commentId: number, type: CommentReactionType): Promise<CommentReaction>

Parametry

project

string

Identyfikator projektu lub nazwa projektu

wikiIdentifier

string

Identyfikator lub nazwa witryny typu wiki

pageId

number

Identyfikator strony typu wiki

commentId

number

Identyfikator powiązanego komentarza

type
CommentReactionType

Rodzaj usuwanej reakcji

Zwraca

Promise<CommentReaction>

deleteWiki(string, string)

Usuwa witrynę typu wiki odpowiadającą podanemu identyfikatorowi witryny typu wiki lub nazwie witryny typu wiki.

function deleteWiki(wikiIdentifier: string, project?: string): Promise<WikiV2>

Parametry

wikiIdentifier

string

Identyfikator wiki lub nazwa wiki.

project

string

Identyfikator projektu lub nazwa projektu

Zwraca

Promise<WikiV2>

getAllWikis(string)

Pobiera wszystkie witryny typu wiki w projekcie lub kolekcji.

function getAllWikis(project?: string): Promise<WikiV2[]>

Parametry

project

string

Identyfikator projektu lub nazwa projektu

Zwraca

Promise<WikiV2[]>

getAttachmentContent(string, string, number, string)

Pobiera załącznik do komentarza na stronie typu wiki.

function getAttachmentContent(project: string, wikiIdentifier: string, pageId: number, attachmentId: string): Promise<ArrayBuffer>

Parametry

project

string

Identyfikator projektu lub nazwa projektu

wikiIdentifier

string

Identyfikator wiki lub nazwa wiki.

pageId

number

Identyfikator strony typu wiki.

attachmentId

string

Identyfikator załącznika.

Zwraca

Promise<ArrayBuffer>

getComment(string, string, number, number, boolean, CommentExpandOptions)

Zwraca komentarz skojarzony ze stroną typu wiki.

function getComment(project: string, wikiIdentifier: string, pageId: number, id: number, excludeDeleted?: boolean, expand?: CommentExpandOptions): Promise<Comment>

Parametry

project

string

Identyfikator projektu lub nazwa projektu

wikiIdentifier

string

Identyfikator wiki lub nazwa wiki.

pageId

number

Identyfikator strony typu wiki.

id

number

Identyfikator komentarza do zwrócenia.

excludeDeleted

boolean

Określ, czy usunięty komentarz ma zostać pominięty.

expand
CommentExpandOptions

Określa dodatkowe opcje pobierania danych dla komentarzy.

Zwraca

Promise<Comment>

getEngagedUsers(string, string, number, number, CommentReactionType, number, number)

Pobiera listę użytkowników, którzy zareagowali na dany komentarz wiki o danym typie reakcji. Obsługuje stronicowanie z domyślnym rozmiarem strony 100 użytkowników jednocześnie.

function getEngagedUsers(project: string, wikiIdentifier: string, pageId: number, commentId: number, type: CommentReactionType, top?: number, skip?: number): Promise<IdentityRef[]>

Parametry

project

string

Identyfikator projektu lub nazwa projektu

wikiIdentifier

string

Identyfikator wiki lub nazwa wiki.

pageId

number

Identyfikator strony typu wiki.

commentId

number

Identyfikator powiązanego komentarza

type
CommentReactionType

Rodzaj reakcji, o którą proszeni są zaangażowani użytkownicy

top

number

Liczba zarejestrowanych użytkowników, którzy mają zostać zwróconi na danej stronie. Opcjonalnie, wartość domyślna to 100

skip

number

Liczba zaangażowanych użytkowników, którzy mają zostać pominięci, aby przejść do następnego zestawu zaangażowanych użytkowników, domyślnie 0

Zwraca

Promise<IdentityRef[]>

getPageByIdText(string, string, number, VersionControlRecursionType, boolean)

Pobiera metadane lub zawartość strony typu wiki dla podanego identyfikatora strony. Negocjacja treści odbywa się na podstawie nagłówka wysłanego Accept w żądaniu.

function getPageByIdText(project: string, wikiIdentifier: string, id: number, recursionLevel?: VersionControlRecursionType, includeContent?: boolean): Promise<string>

Parametry

project

string

Identyfikator projektu lub nazwa projektu

wikiIdentifier

string

Identyfikator wiki lub nazwa wiki.

id

number

Identyfikator strony typu wiki.

recursionLevel
VersionControlRecursionType

Poziom rekurencji do pobierania podstron. Wartość domyślna to None (opcjonalnie).

includeContent

boolean

True, aby uwzględnić zawartość strony w odpowiedzi dla typu zawartości Json. Wartość domyślna to false (opcjonalnie)

Zwraca

Promise<string>

getPageByIdZip(string, string, number, VersionControlRecursionType, boolean)

Pobiera metadane lub zawartość strony typu wiki dla podanego identyfikatora strony. Negocjacja treści odbywa się na podstawie nagłówka wysłanego Accept w żądaniu.

function getPageByIdZip(project: string, wikiIdentifier: string, id: number, recursionLevel?: VersionControlRecursionType, includeContent?: boolean): Promise<ArrayBuffer>

Parametry

project

string

Identyfikator projektu lub nazwa projektu

wikiIdentifier

string

Identyfikator wiki lub nazwa wiki.

id

number

Identyfikator strony typu wiki.

recursionLevel
VersionControlRecursionType

Poziom rekurencji do pobierania podstron. Wartość domyślna to None (opcjonalnie).

includeContent

boolean

True, aby uwzględnić zawartość strony w odpowiedzi dla typu zawartości Json. Wartość domyślna to false (opcjonalnie)

Zwraca

Promise<ArrayBuffer>

getPageData(string, string, number, number)

Zwraca szczegóły strony odpowiadające identyfikatorowi strony.

function getPageData(project: string, wikiIdentifier: string, pageId: number, pageViewsForDays?: number): Promise<WikiPageDetail>

Parametry

project

string

Identyfikator projektu lub nazwa projektu

wikiIdentifier

string

Identyfikator wiki lub nazwa wiki.

pageId

number

Identyfikator strony typu wiki.

pageViewsForDays

number

ostatnie N dni od bieżącego dnia, dla którego mają zostać zwrócone wyświetlenia strony. Obejmuje bieżący dzień.

Zwraca

Promise<WikiPageDetail>

getPagesBatch(WikiPagesBatchRequest, string, string, GitVersionDescriptor)

Zwraca stronicowaną listę stron typu wiki

function getPagesBatch(pagesBatchRequest: WikiPagesBatchRequest, project: string, wikiIdentifier: string, versionDescriptor?: GitVersionDescriptor): Promise<PagedList<WikiPageDetail>>

Parametry

pagesBatchRequest
WikiPagesBatchRequest

Żądanie strony wsadowej typu wiki.

project

string

Identyfikator projektu lub nazwa projektu

wikiIdentifier

string

Identyfikator wiki lub nazwa wiki.

versionDescriptor
GitVersionDescriptor

GitVersionDescriptor dla strony. (Opcjonalnie w przypadku ProjectWiki).

Zwraca

getPageText(string, string, string, VersionControlRecursionType, GitVersionDescriptor, boolean)

Pobiera metadane lub zawartość strony typu wiki dla podanej ścieżki. Negocjacja treści odbywa się na podstawie nagłówka wysłanego Accept w żądaniu.

function getPageText(project: string, wikiIdentifier: string, path?: string, recursionLevel?: VersionControlRecursionType, versionDescriptor?: GitVersionDescriptor, includeContent?: boolean): Promise<string>

Parametry

project

string

Identyfikator projektu lub nazwa projektu

wikiIdentifier

string

Identyfikator wiki lub nazwa wiki.

path

string

Ścieżka strony typu wiki.

recursionLevel
VersionControlRecursionType

Poziom rekurencji do pobierania podstron. Wartość domyślna to None (opcjonalnie).

versionDescriptor
GitVersionDescriptor

GitVersionDescriptor dla strony. Wartość domyślna to gałąź domyślna (opcjonalnie).

includeContent

boolean

True, aby uwzględnić zawartość strony w odpowiedzi dla typu zawartości Json. Wartość domyślna to false (opcjonalnie)

Zwraca

Promise<string>

getPageZip(string, string, string, VersionControlRecursionType, GitVersionDescriptor, boolean)

Pobiera metadane lub zawartość strony typu wiki dla podanej ścieżki. Negocjacja treści odbywa się na podstawie nagłówka wysłanego Accept w żądaniu.

function getPageZip(project: string, wikiIdentifier: string, path?: string, recursionLevel?: VersionControlRecursionType, versionDescriptor?: GitVersionDescriptor, includeContent?: boolean): Promise<ArrayBuffer>

Parametry

project

string

Identyfikator projektu lub nazwa projektu

wikiIdentifier

string

Identyfikator wiki lub nazwa wiki.

path

string

Ścieżka strony typu wiki.

recursionLevel
VersionControlRecursionType

Poziom rekurencji do pobierania podstron. Wartość domyślna to None (opcjonalnie).

versionDescriptor
GitVersionDescriptor

GitVersionDescriptor dla strony. Wartość domyślna to gałąź domyślna (opcjonalnie).

includeContent

boolean

True, aby uwzględnić zawartość strony w odpowiedzi dla typu zawartości Json. Wartość domyślna to false (opcjonalnie)

Zwraca

Promise<ArrayBuffer>

getWiki(string, string)

Pobiera witrynę typu wiki odpowiadającą podanemu identyfikatorowi witryny typu wiki lub nazwie witryny typu wiki.

function getWiki(wikiIdentifier: string, project?: string): Promise<WikiV2>

Parametry

wikiIdentifier

string

Identyfikator wiki lub nazwa wiki.

project

string

Identyfikator projektu lub nazwa projektu

Zwraca

Promise<WikiV2>

listComments(string, string, number, number, string, boolean, CommentExpandOptions, CommentSortOrder, number)

Zwraca listę komentarzy do stronicowania.

function listComments(project: string, wikiIdentifier: string, pageId: number, top?: number, continuationToken?: string, excludeDeleted?: boolean, expand?: CommentExpandOptions, order?: CommentSortOrder, parentId?: number): Promise<CommentList>

Parametry

project

string

Identyfikator projektu lub nazwa projektu

wikiIdentifier

string

Identyfikator wiki lub nazwa wiki.

pageId

number

Identyfikator strony typu wiki.

top

number

Maksymalna liczba komentarzy do zwrócenia.

continuationToken

string

Służy do wysyłania zapytań o następną stronę komentarzy.

excludeDeleted

boolean

Określ, czy usunięte komentarze mają zostać pominięte.

expand
CommentExpandOptions

Określa dodatkowe opcje pobierania danych dla komentarzy.

order
CommentSortOrder

Kolejność, w jakiej powinny być zwracane komentarze.

parentId

number

CommentId komentarza nadrzędnego.

Zwraca

Promise<CommentList>

updateComment(CommentUpdateParameters, string, string, number, number)

Aktualizowanie komentarza na stronie typu wiki.

function updateComment(comment: CommentUpdateParameters, project: string, wikiIdentifier: string, pageId: number, id: number): Promise<Comment>

Parametry

comment
CommentUpdateParameters

Prośba o aktualizację komentarza.

project

string

Identyfikator projektu lub nazwa projektu

wikiIdentifier

string

Identyfikator wiki lub nazwa wiki.

pageId

number

Identyfikator strony typu wiki.

id

number

Identyfikator komentarza.

Zwraca

Promise<Comment>

updateWiki(WikiUpdateParameters, string, string)

Aktualizuje witrynę typu wiki odpowiadającą identyfikatorowi witryny typu wiki lub nazwie witryny typu wiki podanej przy użyciu parametrów aktualizacji.

function updateWiki(updateParameters: WikiUpdateParameters, wikiIdentifier: string, project?: string): Promise<WikiV2>

Parametry

updateParameters
WikiUpdateParameters

Zaktualizuj parametry.

wikiIdentifier

string

Identyfikator wiki lub nazwa wiki.

project

string

Identyfikator projektu lub nazwa projektu

Zwraca

Promise<WikiV2>