diff --git a/sdk/contentsafety/ai-content-safety-rest/api-extractor.json b/sdk/contentsafety/ai-content-safety-rest/api-extractor.json index c3efb349c43a..13a4abc8baf1 100644 --- a/sdk/contentsafety/ai-content-safety-rest/api-extractor.json +++ b/sdk/contentsafety/ai-content-safety-rest/api-extractor.json @@ -1,18 +1,31 @@ { "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", "mainEntryPointFilePath": "./types/src/index.d.ts", - "docModel": { "enabled": true }, - "apiReport": { "enabled": true, "reportFolder": "./review" }, + "docModel": { + "enabled": true + }, + "apiReport": { + "enabled": true, + "reportFolder": "./review" + }, "dtsRollup": { "enabled": true, "untrimmedFilePath": "", "publicTrimmedFilePath": "./types/ai-content-safety.d.ts" }, "messages": { - "tsdocMessageReporting": { "default": { "logLevel": "none" } }, + "tsdocMessageReporting": { + "default": { + "logLevel": "none" + } + }, "extractorMessageReporting": { - "ae-missing-release-tag": { "logLevel": "none" }, - "ae-unresolved-link": { "logLevel": "none" } + "ae-missing-release-tag": { + "logLevel": "none" + }, + "ae-unresolved-link": { + "logLevel": "none" + } } } -} +} \ No newline at end of file diff --git a/sdk/contentsafety/ai-content-safety-rest/package.json b/sdk/contentsafety/ai-content-safety-rest/package.json index b68dce6911c4..afcc3f23f9da 100644 --- a/sdk/contentsafety/ai-content-safety-rest/package.json +++ b/sdk/contentsafety/ai-content-safety-rest/package.json @@ -124,4 +124,4 @@ "disableDocsMs": true, "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure-rest/ai-content-safety?view=azure-node-preview" } -} +} \ No newline at end of file diff --git a/sdk/contentsafety/ai-content-safety-rest/review/ai-content-safety.api.md b/sdk/contentsafety/ai-content-safety-rest/review/ai-content-safety.api.md index 00722dfd17db..557b396ff4ed 100644 --- a/sdk/contentsafety/ai-content-safety-rest/review/ai-content-safety.api.md +++ b/sdk/contentsafety/ai-content-safety-rest/review/ai-content-safety.api.md @@ -15,52 +15,52 @@ import { PathUncheckedResponse } from '@azure-rest/core-client'; import { RawHttpHeaders } from '@azure/core-rest-pipeline'; import { RequestParameters } from '@azure-rest/core-client'; import { StreamableMethod } from '@azure-rest/core-client'; +import { TokenCredential } from '@azure/core-auth'; // @public (undocumented) -export interface AddBlockItems { - post(options?: AddBlockItemsParameters): StreamableMethod; +export interface AddOrUpdateBlocklistItems { + post(options: AddOrUpdateBlocklistItemsParameters): StreamableMethod; } // @public -export interface AddBlockItems200Response extends HttpResponse { +export interface AddOrUpdateBlocklistItems200Response extends HttpResponse { // (undocumented) - body: AddBlockItemsResultOutput; + body: AddOrUpdateTextBlocklistItemsResultOutput; // (undocumented) status: "200"; } // @public (undocumented) -export interface AddBlockItemsBodyParam { - // (undocumented) - body?: AddBlockItemsOptions; +export interface AddOrUpdateBlocklistItemsBodyParam { + body: AddOrUpdateTextBlocklistItemsOptions; } // @public (undocumented) -export interface AddBlockItemsDefaultHeaders { +export interface AddOrUpdateBlocklistItemsDefaultHeaders { "x-ms-error-code"?: string; } // @public (undocumented) -export interface AddBlockItemsDefaultResponse extends HttpResponse { +export interface AddOrUpdateBlocklistItemsDefaultResponse extends HttpResponse { // (undocumented) body: ErrorResponse; // (undocumented) - headers: RawHttpHeaders & AddBlockItemsDefaultHeaders; + headers: RawHttpHeaders & AddOrUpdateBlocklistItemsDefaultHeaders; // (undocumented) status: string; } +// @public (undocumented) +export type AddOrUpdateBlocklistItemsParameters = AddOrUpdateBlocklistItemsBodyParam & RequestParameters; + // @public -export interface AddBlockItemsOptions { - blockItems: Array; +export interface AddOrUpdateTextBlocklistItemsOptions { + blocklistItems: Array; } -// @public (undocumented) -export type AddBlockItemsParameters = AddBlockItemsBodyParam & RequestParameters; - // @public -export interface AddBlockItemsResultOutput { - value?: Array; +export interface AddOrUpdateTextBlocklistItemsResultOutput { + blocklistItems: Array; } // @public (undocumented) @@ -100,12 +100,14 @@ export interface AnalyzeImageDefaultResponse extends HttpResponse { export interface AnalyzeImageOptions { categories?: string[]; image: ImageData_2; + outputType?: string; } // @public export interface AnalyzeImageOptionsOutput { categories?: string[]; image: ImageDataOutput; + outputType?: string; } // @public (undocumented) @@ -113,10 +115,7 @@ export type AnalyzeImageParameters = AnalyzeImageBodyParam & RequestParameters; // @public export interface AnalyzeImageResultOutput { - hateResult?: ImageAnalyzeSeverityResultOutput; - selfHarmResult?: ImageAnalyzeSeverityResultOutput; - sexualResult?: ImageAnalyzeSeverityResultOutput; - violenceResult?: ImageAnalyzeSeverityResultOutput; + categoriesAnalysis: Array; } // @public (undocumented) @@ -155,16 +154,18 @@ export interface AnalyzeTextDefaultResponse extends HttpResponse { // @public export interface AnalyzeTextOptions { blocklistNames?: string[]; - breakByBlocklists?: boolean; categories?: string[]; + haltOnBlocklistHit?: boolean; + outputType?: string; text: string; } // @public export interface AnalyzeTextOptionsOutput { blocklistNames?: string[]; - breakByBlocklists?: boolean; categories?: string[]; + haltOnBlocklistHit?: boolean; + outputType?: string; text: string; } @@ -173,11 +174,8 @@ export type AnalyzeTextParameters = AnalyzeTextBodyParam & RequestParameters; // @public export interface AnalyzeTextResultOutput { - blocklistsMatchResults?: Array; - hateResult?: TextAnalyzeSeverityResultOutput; - selfHarmResult?: TextAnalyzeSeverityResultOutput; - sexualResult?: TextAnalyzeSeverityResultOutput; - violenceResult?: TextAnalyzeSeverityResultOutput; + blocklistsMatch?: Array; + categoriesAnalysis: Array; } // @public (undocumented) @@ -186,7 +184,7 @@ export type ContentSafetyClient = Client & { }; // @public -function createClient(endpoint: string, credentials: KeyCredential, options?: ClientOptions): ContentSafetyClient; +function createClient(endpoint: string, credentials: TokenCredential | KeyCredential, options?: ClientOptions): ContentSafetyClient; export default createClient; // @public @@ -304,7 +302,7 @@ export interface GetTextBlocklistItem { // @public export interface GetTextBlocklistItem200Response extends HttpResponse { // (undocumented) - body: TextBlockItemOutput; + body: TextBlocklistItemOutput; // (undocumented) status: "200"; } @@ -331,9 +329,9 @@ export type GetTextBlocklistItemParameters = RequestParameters; export type GetTextBlocklistParameters = RequestParameters; // @public -export interface ImageAnalyzeSeverityResultOutput { +export interface ImageCategoriesAnalysisOutput { category: string; - severity: number; + severity?: number; } // @public @@ -368,10 +366,10 @@ export function isUnexpected(response: DeleteTextBlocklist204Response | DeleteTe export function isUnexpected(response: ListTextBlocklists200Response | ListTextBlocklistsDefaultResponse): response is ListTextBlocklistsDefaultResponse; // @public (undocumented) -export function isUnexpected(response: AddBlockItems200Response | AddBlockItemsDefaultResponse): response is AddBlockItemsDefaultResponse; +export function isUnexpected(response: AddOrUpdateBlocklistItems200Response | AddOrUpdateBlocklistItemsDefaultResponse): response is AddOrUpdateBlocklistItemsDefaultResponse; // @public (undocumented) -export function isUnexpected(response: RemoveBlockItems204Response | RemoveBlockItemsDefaultResponse): response is RemoveBlockItemsDefaultResponse; +export function isUnexpected(response: RemoveBlocklistItems204Response | RemoveBlocklistItemsDefaultResponse): response is RemoveBlocklistItemsDefaultResponse; // @public (undocumented) export function isUnexpected(response: GetTextBlocklistItem200Response | GetTextBlocklistItemDefaultResponse): response is GetTextBlocklistItemDefaultResponse; @@ -387,7 +385,7 @@ export interface ListTextBlocklistItems { // @public export interface ListTextBlocklistItems200Response extends HttpResponse { // (undocumented) - body: TextBlockItemListOutput; + body: PagedTextBlocklistItemOutput; // (undocumented) status: "200"; } @@ -431,7 +429,7 @@ export interface ListTextBlocklists { // @public export interface ListTextBlocklists200Response extends HttpResponse { // (undocumented) - body: TextBlocklistListOutput; + body: PagedTextBlocklistOutput; // (undocumented) status: "200"; } @@ -454,6 +452,12 @@ export interface ListTextBlocklistsDefaultResponse extends HttpResponse { // @public (undocumented) export type ListTextBlocklistsParameters = RequestParameters; +// @public +export type PagedTextBlocklistItemOutput = Paged; + +// @public +export type PagedTextBlocklistOutput = Paged; + // @public export function paginate(client: Client, initialResponse: TResponse, options?: PagingOptions): PagedAsyncIterableIterator>; @@ -470,95 +474,80 @@ export interface PagingOptions { } // @public (undocumented) -export interface RemoveBlockItems { - post(options?: RemoveBlockItemsParameters): StreamableMethod; +export interface RemoveBlocklistItems { + post(options: RemoveBlocklistItemsParameters): StreamableMethod; } // @public -export interface RemoveBlockItems204Response extends HttpResponse { +export interface RemoveBlocklistItems204Response extends HttpResponse { // (undocumented) status: "204"; } // @public (undocumented) -export interface RemoveBlockItemsBodyParam { - // (undocumented) - body?: RemoveBlockItemsOptions; +export interface RemoveBlocklistItemsBodyParam { + body: RemoveTextBlocklistItemsOptions; } // @public (undocumented) -export interface RemoveBlockItemsDefaultHeaders { +export interface RemoveBlocklistItemsDefaultHeaders { "x-ms-error-code"?: string; } // @public (undocumented) -export interface RemoveBlockItemsDefaultResponse extends HttpResponse { +export interface RemoveBlocklistItemsDefaultResponse extends HttpResponse { // (undocumented) body: ErrorResponse; // (undocumented) - headers: RawHttpHeaders & RemoveBlockItemsDefaultHeaders; + headers: RawHttpHeaders & RemoveBlocklistItemsDefaultHeaders; // (undocumented) status: string; } +// @public (undocumented) +export type RemoveBlocklistItemsParameters = RemoveBlocklistItemsBodyParam & RequestParameters; + // @public -export interface RemoveBlockItemsOptions { - blockItemIds: string[]; +export interface RemoveTextBlocklistItemsOptions { + blocklistItemIds: string[]; } -// @public (undocumented) -export type RemoveBlockItemsParameters = RemoveBlockItemsBodyParam & RequestParameters; - // @public (undocumented) export interface Routes { (path: "/text:analyze"): AnalyzeText; (path: "/image:analyze"): AnalyzeImage; (path: "/text/blocklists/{blocklistName}", blocklistName: string): GetTextBlocklist; (path: "/text/blocklists"): ListTextBlocklists; - (path: "/text/blocklists/{blocklistName}:addBlockItems", blocklistName: string): AddBlockItems; - (path: "/text/blocklists/{blocklistName}:removeBlockItems", blocklistName: string): RemoveBlockItems; - (path: "/text/blocklists/{blocklistName}/blockItems/{blockItemId}", blocklistName: string, blockItemId: string): GetTextBlocklistItem; - (path: "/text/blocklists/{blocklistName}/blockItems", blocklistName: string): ListTextBlocklistItems; -} - -// @public -export interface TextAnalyzeSeverityResultOutput { - category: string; - severity: number; + (path: "/text/blocklists/{blocklistName}:addOrUpdateBlocklistItems", blocklistName: string): AddOrUpdateBlocklistItems; + (path: "/text/blocklists/{blocklistName}:removeBlocklistItems", blocklistName: string): RemoveBlocklistItems; + (path: "/text/blocklists/{blocklistName}/blocklistItems/{blocklistItemId}", blocklistName: string, blocklistItemId: string): GetTextBlocklistItem; + (path: "/text/blocklists/{blocklistName}/blocklistItems", blocklistName: string): ListTextBlocklistItems; } // @public -export interface TextBlockItemInfo { +export interface TextBlocklist { + blocklistName: string; description?: string; - text: string; } // @public -export type TextBlockItemListOutput = Paged; - -// @public -export interface TextBlockItemOutput { - blockItemId: string; +export interface TextBlocklistItem { description?: string; text: string; } // @public -export interface TextBlocklist { - blocklistName: string; +export interface TextBlocklistItemOutput { + readonly blocklistItemId: string; description?: string; + text: string; } // @public -export type TextBlocklistListOutput = Paged; - -// @public -export interface TextBlocklistMatchResultOutput { - blockItemId: string; - blockItemText: string; +export interface TextBlocklistMatchOutput { + blocklistItemId: string; + blocklistItemText: string; blocklistName: string; - length: number; - offset: number; } // @public @@ -570,6 +559,12 @@ export interface TextBlocklistOutput { // @public export type TextBlocklistResourceMergeAndPatch = Partial; +// @public +export interface TextCategoriesAnalysisOutput { + category: string; + severity?: number; +} + // (No @packageDocumentation comment for this package) ``` diff --git a/sdk/contentsafety/ai-content-safety-rest/src/clientDefinitions.ts b/sdk/contentsafety/ai-content-safety-rest/src/clientDefinitions.ts index a6465cc57e79..b20e9f68e8b9 100644 --- a/sdk/contentsafety/ai-content-safety-rest/src/clientDefinitions.ts +++ b/sdk/contentsafety/ai-content-safety-rest/src/clientDefinitions.ts @@ -8,8 +8,8 @@ import { CreateOrUpdateTextBlocklistParameters, DeleteTextBlocklistParameters, ListTextBlocklistsParameters, - AddBlockItemsParameters, - RemoveBlockItemsParameters, + AddOrUpdateBlocklistItemsParameters, + RemoveBlocklistItemsParameters, GetTextBlocklistItemParameters, ListTextBlocklistItemsParameters, } from "./parameters"; @@ -27,10 +27,10 @@ import { DeleteTextBlocklistDefaultResponse, ListTextBlocklists200Response, ListTextBlocklistsDefaultResponse, - AddBlockItems200Response, - AddBlockItemsDefaultResponse, - RemoveBlockItems204Response, - RemoveBlockItemsDefaultResponse, + AddOrUpdateBlocklistItems200Response, + AddOrUpdateBlocklistItemsDefaultResponse, + RemoveBlocklistItems204Response, + RemoveBlocklistItemsDefaultResponse, GetTextBlocklistItem200Response, GetTextBlocklistItemDefaultResponse, ListTextBlocklistItems200Response, @@ -39,14 +39,14 @@ import { import { Client, StreamableMethod } from "@azure-rest/core-client"; export interface AnalyzeText { - /** A sync API for harmful content analysis for text. Currently, we support four categories: Hate, SelfHarm, Sexual, Violence. */ + /** A synchronous API for the analysis of potentially harmful text content. Currently, it supports four categories: Hate, SelfHarm, Sexual, and Violence. */ post( options: AnalyzeTextParameters ): StreamableMethod; } export interface AnalyzeImage { - /** A sync API for harmful content analysis for image. Currently, we support four categories: Hate, SelfHarm, Sexual, Violence. */ + /** A synchronous API for the analysis of potentially harmful image content. Currently, it supports four categories: Hate, SelfHarm, Sexual, and Violence. */ post( options: AnalyzeImageParameters ): StreamableMethod; @@ -56,8 +56,10 @@ export interface GetTextBlocklist { /** Returns text blocklist details. */ get( options?: GetTextBlocklistParameters - ): StreamableMethod; - /** Updates a text blocklist, if blocklistName does not exist, create a new blocklist. */ + ): StreamableMethod< + GetTextBlocklist200Response | GetTextBlocklistDefaultResponse + >; + /** Updates a text blocklist. If the blocklistName does not exist, a new blocklist will be created. */ patch( options: CreateOrUpdateTextBlocklistParameters ): StreamableMethod< @@ -68,42 +70,55 @@ export interface GetTextBlocklist { /** Deletes a text blocklist. */ delete( options?: DeleteTextBlocklistParameters - ): StreamableMethod; + ): StreamableMethod< + DeleteTextBlocklist204Response | DeleteTextBlocklistDefaultResponse + >; } export interface ListTextBlocklists { /** Get all text blocklists details. */ get( options?: ListTextBlocklistsParameters - ): StreamableMethod; + ): StreamableMethod< + ListTextBlocklists200Response | ListTextBlocklistsDefaultResponse + >; } -export interface AddBlockItems { - /** Add blockItems to a text blocklist. You can add at most 100 BlockItems in one request. */ +export interface AddOrUpdateBlocklistItems { + /** Add or update blocklistItems to a text blocklist. You can add or update at most 100 blocklistItems in one request. */ post( - options?: AddBlockItemsParameters - ): StreamableMethod; + options: AddOrUpdateBlocklistItemsParameters + ): StreamableMethod< + | AddOrUpdateBlocklistItems200Response + | AddOrUpdateBlocklistItemsDefaultResponse + >; } -export interface RemoveBlockItems { - /** Remove blockItems from a text blocklist. You can remove at most 100 BlockItems in one request. */ +export interface RemoveBlocklistItems { + /** Remove blocklistItems from a text blocklist. You can remove at most 100 BlocklistItems in one request. */ post( - options?: RemoveBlockItemsParameters - ): StreamableMethod; + options: RemoveBlocklistItemsParameters + ): StreamableMethod< + RemoveBlocklistItems204Response | RemoveBlocklistItemsDefaultResponse + >; } export interface GetTextBlocklistItem { - /** Get blockItem By blockItemId from a text blocklist. */ + /** Get blocklistItem by blocklistName and blocklistItemId from a text blocklist. */ get( options?: GetTextBlocklistItemParameters - ): StreamableMethod; + ): StreamableMethod< + GetTextBlocklistItem200Response | GetTextBlocklistItemDefaultResponse + >; } export interface ListTextBlocklistItems { - /** Get all blockItems in a text blocklist */ + /** Get all blocklistItems in a text blocklist. */ get( options?: ListTextBlocklistItemsParameters - ): StreamableMethod; + ): StreamableMethod< + ListTextBlocklistItems200Response | ListTextBlocklistItemsDefaultResponse + >; } export interface Routes { @@ -112,25 +127,31 @@ export interface Routes { /** Resource for '/image:analyze' has methods for the following verbs: post */ (path: "/image:analyze"): AnalyzeImage; /** Resource for '/text/blocklists/\{blocklistName\}' has methods for the following verbs: get, patch, delete */ - (path: "/text/blocklists/{blocklistName}", blocklistName: string): GetTextBlocklist; + ( + path: "/text/blocklists/{blocklistName}", + blocklistName: string + ): GetTextBlocklist; /** Resource for '/text/blocklists' has methods for the following verbs: get */ (path: "/text/blocklists"): ListTextBlocklists; - /** Resource for '/text/blocklists/\{blocklistName\}:addBlockItems' has methods for the following verbs: post */ - (path: "/text/blocklists/{blocklistName}:addBlockItems", blocklistName: string): AddBlockItems; - /** Resource for '/text/blocklists/\{blocklistName\}:removeBlockItems' has methods for the following verbs: post */ + /** Resource for '/text/blocklists/\{blocklistName\}:addOrUpdateBlocklistItems' has methods for the following verbs: post */ + ( + path: "/text/blocklists/{blocklistName}:addOrUpdateBlocklistItems", + blocklistName: string + ): AddOrUpdateBlocklistItems; + /** Resource for '/text/blocklists/\{blocklistName\}:removeBlocklistItems' has methods for the following verbs: post */ ( - path: "/text/blocklists/{blocklistName}:removeBlockItems", + path: "/text/blocklists/{blocklistName}:removeBlocklistItems", blocklistName: string - ): RemoveBlockItems; - /** Resource for '/text/blocklists/\{blocklistName\}/blockItems/\{blockItemId\}' has methods for the following verbs: get */ + ): RemoveBlocklistItems; + /** Resource for '/text/blocklists/\{blocklistName\}/blocklistItems/\{blocklistItemId\}' has methods for the following verbs: get */ ( - path: "/text/blocklists/{blocklistName}/blockItems/{blockItemId}", + path: "/text/blocklists/{blocklistName}/blocklistItems/{blocklistItemId}", blocklistName: string, - blockItemId: string + blocklistItemId: string ): GetTextBlocklistItem; - /** Resource for '/text/blocklists/\{blocklistName\}/blockItems' has methods for the following verbs: get */ + /** Resource for '/text/blocklists/\{blocklistName\}/blocklistItems' has methods for the following verbs: get */ ( - path: "/text/blocklists/{blocklistName}/blockItems", + path: "/text/blocklists/{blocklistName}/blocklistItems", blocklistName: string ): ListTextBlocklistItems; } diff --git a/sdk/contentsafety/ai-content-safety-rest/src/contentSafetyClient.ts b/sdk/contentsafety/ai-content-safety-rest/src/contentSafetyClient.ts index 96343d411098..f0b0ae8ab923 100644 --- a/sdk/contentsafety/ai-content-safety-rest/src/contentSafetyClient.ts +++ b/sdk/contentsafety/ai-content-safety-rest/src/contentSafetyClient.ts @@ -3,7 +3,7 @@ import { getClient, ClientOptions } from "@azure-rest/core-client"; import { logger } from "./logger"; -import { KeyCredential } from "@azure/core-auth"; +import { TokenCredential, KeyCredential } from "@azure/core-auth"; import { ContentSafetyClient } from "./clientDefinitions"; /** @@ -15,19 +15,12 @@ import { ContentSafetyClient } from "./clientDefinitions"; */ export default function createClient( endpoint: string, - credentials: KeyCredential, + credentials: TokenCredential | KeyCredential, options: ClientOptions = {} ): ContentSafetyClient { const baseUrl = options.baseUrl ?? `${endpoint}/contentsafety`; - options.apiVersion = options.apiVersion ?? "2023-04-30-preview"; - options = { - ...options, - credentials: { - apiKeyHeaderName: options.credentials?.apiKeyHeaderName ?? "Ocp-Apim-Subscription-Key", - }, - }; - - const userAgentInfo = `azsdk-js-ai-content-safety-rest/1.0.0-beta.2`; + options.apiVersion = options.apiVersion ?? "2023-10-01"; + const userAgentInfo = `azsdk-js-ai-content-safety-rest/1.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}` @@ -40,9 +33,20 @@ export default function createClient( loggingOptions: { logger: options.loggingOptions?.logger ?? logger.info, }, + credentials: { + scopes: options.credentials?.scopes ?? [ + "https://cognitiveservices.azure.com/.default", + ], + apiKeyHeaderName: + options.credentials?.apiKeyHeaderName ?? "Ocp-Apim-Subscription-Key", + }, }; - const client = getClient(baseUrl, credentials, options) as ContentSafetyClient; + const client = getClient( + baseUrl, + credentials, + options + ) as ContentSafetyClient; return client; } diff --git a/sdk/contentsafety/ai-content-safety-rest/src/isUnexpected.ts b/sdk/contentsafety/ai-content-safety-rest/src/isUnexpected.ts index b72236ca40c6..9cf7564754bc 100644 --- a/sdk/contentsafety/ai-content-safety-rest/src/isUnexpected.ts +++ b/sdk/contentsafety/ai-content-safety-rest/src/isUnexpected.ts @@ -15,10 +15,10 @@ import { DeleteTextBlocklistDefaultResponse, ListTextBlocklists200Response, ListTextBlocklistsDefaultResponse, - AddBlockItems200Response, - AddBlockItemsDefaultResponse, - RemoveBlockItems204Response, - RemoveBlockItemsDefaultResponse, + AddOrUpdateBlocklistItems200Response, + AddOrUpdateBlocklistItemsDefaultResponse, + RemoveBlocklistItems204Response, + RemoveBlocklistItemsDefaultResponse, GetTextBlocklistItem200Response, GetTextBlocklistItemDefaultResponse, ListTextBlocklistItems200Response, @@ -32,10 +32,12 @@ const responseMap: Record = { "PATCH /text/blocklists/{blocklistName}": ["200", "201"], "DELETE /text/blocklists/{blocklistName}": ["204"], "GET /text/blocklists": ["200"], - "POST /text/blocklists/{blocklistName}:addBlockItems": ["200"], - "POST /text/blocklists/{blocklistName}:removeBlockItems": ["204"], - "GET /text/blocklists/{blocklistName}/blockItems/{blockItemId}": ["200"], - "GET /text/blocklists/{blocklistName}/blockItems": ["200"], + "POST /text/blocklists/{blocklistName}:addOrUpdateBlocklistItems": ["200"], + "POST /text/blocklists/{blocklistName}:removeBlocklistItems": ["204"], + "GET /text/blocklists/{blocklistName}/blocklistItems/{blocklistItemId}": [ + "200", + ], + "GET /text/blocklists/{blocklistName}/blocklistItems": ["200"], }; export function isUnexpected( @@ -60,16 +62,24 @@ export function isUnexpected( response: ListTextBlocklists200Response | ListTextBlocklistsDefaultResponse ): response is ListTextBlocklistsDefaultResponse; export function isUnexpected( - response: AddBlockItems200Response | AddBlockItemsDefaultResponse -): response is AddBlockItemsDefaultResponse; + response: + | AddOrUpdateBlocklistItems200Response + | AddOrUpdateBlocklistItemsDefaultResponse +): response is AddOrUpdateBlocklistItemsDefaultResponse; export function isUnexpected( - response: RemoveBlockItems204Response | RemoveBlockItemsDefaultResponse -): response is RemoveBlockItemsDefaultResponse; + response: + | RemoveBlocklistItems204Response + | RemoveBlocklistItemsDefaultResponse +): response is RemoveBlocklistItemsDefaultResponse; export function isUnexpected( - response: GetTextBlocklistItem200Response | GetTextBlocklistItemDefaultResponse + response: + | GetTextBlocklistItem200Response + | GetTextBlocklistItemDefaultResponse ): response is GetTextBlocklistItemDefaultResponse; export function isUnexpected( - response: ListTextBlocklistItems200Response | ListTextBlocklistItemsDefaultResponse + response: + | ListTextBlocklistItems200Response + | ListTextBlocklistItemsDefaultResponse ): response is ListTextBlocklistItemsDefaultResponse; export function isUnexpected( response: @@ -86,10 +96,10 @@ export function isUnexpected( | DeleteTextBlocklistDefaultResponse | ListTextBlocklists200Response | ListTextBlocklistsDefaultResponse - | AddBlockItems200Response - | AddBlockItemsDefaultResponse - | RemoveBlockItems204Response - | RemoveBlockItemsDefaultResponse + | AddOrUpdateBlocklistItems200Response + | AddOrUpdateBlocklistItemsDefaultResponse + | RemoveBlocklistItems204Response + | RemoveBlocklistItemsDefaultResponse | GetTextBlocklistItem200Response | GetTextBlocklistItemDefaultResponse | ListTextBlocklistItems200Response @@ -101,8 +111,8 @@ export function isUnexpected( | CreateOrUpdateTextBlocklistDefaultResponse | DeleteTextBlocklistDefaultResponse | ListTextBlocklistsDefaultResponse - | AddBlockItemsDefaultResponse - | RemoveBlockItemsDefaultResponse + | AddOrUpdateBlocklistItemsDefaultResponse + | RemoveBlocklistItemsDefaultResponse | GetTextBlocklistItemDefaultResponse | ListTextBlocklistItemsDefaultResponse { const lroOriginal = response.headers["x-ms-original-url"]; @@ -137,17 +147,24 @@ function getParametrizedPathSuccess(method: string, path: string): string[] { // track if we have found a match to return the values found. let found = true; - for (let i = candidateParts.length - 1, j = pathParts.length - 1; i >= 1 && j >= 1; i--, j--) { - if (candidateParts[i]?.startsWith("{") && candidateParts[i]?.indexOf("}") !== -1) { + for ( + let i = candidateParts.length - 1, j = pathParts.length - 1; + i >= 1 && j >= 1; + i--, j-- + ) { + if ( + candidateParts[i]?.startsWith("{") && + candidateParts[i]?.indexOf("}") !== -1 + ) { const start = candidateParts[i]!.indexOf("}") + 1, end = candidateParts[i]?.length; // If the current part of the candidate is a "template" part // Try to use the suffix of pattern to match the path // {guid} ==> $ // {guid}:export ==> :export$ - const isMatched = new RegExp(`${candidateParts[i]?.slice(start, end)}`).test( - pathParts[j] || "" - ); + const isMatched = new RegExp( + `${candidateParts[i]?.slice(start, end)}` + ).test(pathParts[j] || ""); if (!isMatched) { found = false; diff --git a/sdk/contentsafety/ai-content-safety-rest/src/models.ts b/sdk/contentsafety/ai-content-safety-rest/src/models.ts index b67c64ea80b5..f3368faf30b4 100644 --- a/sdk/contentsafety/ai-content-safety-rest/src/models.ts +++ b/sdk/contentsafety/ai-content-safety-rest/src/models.ts @@ -1,31 +1,43 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -/** The analysis request of the text. */ +/** The text analysis request. */ export interface AnalyzeTextOptions { - /** The text needs to be scanned. We support at most 1000 characters (unicode code points) in text of one request. */ + /** The text needs to be analyzed. We support a maximum of 10k Unicode characters (Unicode code points) in the text of one request. */ text: string; - /** The categories will be analyzed. If not assigned, a default set of the categories' analysis results will be returned. */ + /** The categories will be analyzed. If they are not assigned, a default set of analysis results for the categories will be returned. */ categories?: string[]; /** The names of blocklists. */ blocklistNames?: string[]; /** When set to true, further analyses of harmful content will not be performed in cases where blocklists are hit. When set to false, all analyses of harmful content will be performed, whether or not blocklists are hit. */ - breakByBlocklists?: boolean; + haltOnBlocklistHit?: boolean; + /** + * This refers to the type of text analysis output. If no value is assigned, the default value will be "FourSeverityLevels". + * + * Possible values: FourSeverityLevels, EightSeverityLevels + */ + outputType?: string; } -/** The analysis request of the image. */ +/** The image analysis request. */ export interface AnalyzeImageOptions { /** The image needs to be analyzed. */ image: ImageData; - /** The categories will be analyzed. If not assigned, a default set of the categories' analysis results will be returned. */ + /** The categories will be analyzed. If they are not assigned, a default set of analysis results for the categories will be returned. */ categories?: string[]; + /** + * This refers to the type of image analysis output. If no value is assigned, the default value will be "FourSeverityLevels". + * + * Possible values: FourSeverityLevels + */ + outputType?: string; } -/** The content or blob url of image, could be base64 encoding bytes or blob url. If both are given, the request will be refused. The maximum size of image is 2048 pixels * 2048 pixels, no larger than 4MB at the same time. The minimum size of image is 50 pixels * 50 pixels. */ +/** The image can be either base64 encoded bytes or a blob URL. You can choose only one of these options. If both are provided, the request will be refused. The maximum image size is 2048 x 2048 pixels and should not exceed 4 MB, while the minimum image size is 50 x 50 pixels. */ export interface ImageData { - /** Base64 encoding of image. */ + /** The Base64 encoding of the image. */ content?: string; - /** The blob url of image. */ + /** The blob url of the image. */ blobUrl?: string; } @@ -37,22 +49,22 @@ export interface TextBlocklist { description?: string; } -/** The request of adding blockItems to text blocklist. */ -export interface AddBlockItemsOptions { - /** Array of blockItemInfo to add. */ - blockItems: Array; +/** The request to add blocklistItems to a text blocklist. */ +export interface AddOrUpdateTextBlocklistItemsOptions { + /** Array of blocklistItems to add. */ + blocklistItems: Array; } -/** Block item info in text blocklist. */ -export interface TextBlockItemInfo { - /** Block item description. */ +/** Item in a TextBlocklist. */ +export interface TextBlocklistItem { + /** BlocklistItem description. */ description?: string; - /** Block item content. */ + /** BlocklistItem content. */ text: string; } -/** The request of removing blockItems from text blocklist. */ -export interface RemoveBlockItemsOptions { - /** Array of blockItemIds to remove. */ - blockItemIds: string[]; +/** The request to remove blocklistItems from a text blocklist. */ +export interface RemoveTextBlocklistItemsOptions { + /** Array of blocklistItemIds to remove. */ + blocklistItemIds: string[]; } diff --git a/sdk/contentsafety/ai-content-safety-rest/src/outputModels.ts b/sdk/contentsafety/ai-content-safety-rest/src/outputModels.ts index ea27e21f5116..ac215a7b18fa 100644 --- a/sdk/contentsafety/ai-content-safety-rest/src/outputModels.ts +++ b/sdk/contentsafety/ai-content-safety-rest/src/outputModels.ts @@ -3,96 +3,92 @@ import { Paged } from "@azure/core-paging"; -/** The analysis request of the text. */ +/** The text analysis request. */ export interface AnalyzeTextOptionsOutput { - /** The text needs to be scanned. We support at most 1000 characters (unicode code points) in text of one request. */ + /** The text needs to be analyzed. We support a maximum of 10k Unicode characters (Unicode code points) in the text of one request. */ text: string; - /** The categories will be analyzed. If not assigned, a default set of the categories' analysis results will be returned. */ + /** The categories will be analyzed. If they are not assigned, a default set of analysis results for the categories will be returned. */ categories?: string[]; /** The names of blocklists. */ blocklistNames?: string[]; /** When set to true, further analyses of harmful content will not be performed in cases where blocklists are hit. When set to false, all analyses of harmful content will be performed, whether or not blocklists are hit. */ - breakByBlocklists?: boolean; + haltOnBlocklistHit?: boolean; + /** + * This refers to the type of text analysis output. If no value is assigned, the default value will be "FourSeverityLevels". + * + * Possible values: FourSeverityLevels, EightSeverityLevels + */ + outputType?: string; } -/** The analysis response of the text */ +/** The text analysis response. */ export interface AnalyzeTextResultOutput { - /** The details of blocklist match. */ - blocklistsMatchResults?: Array; - /** Analysis result for Hate category. */ - hateResult?: TextAnalyzeSeverityResultOutput; - /** Analysis result for SelfHarm category. */ - selfHarmResult?: TextAnalyzeSeverityResultOutput; - /** Analysis result for Sexual category. */ - sexualResult?: TextAnalyzeSeverityResultOutput; - /** Analysis result for Violence category. */ - violenceResult?: TextAnalyzeSeverityResultOutput; + /** The blocklist match details. */ + blocklistsMatch?: Array; + /** Analysis result for categories. */ + categoriesAnalysis: Array; } /** The result of blocklist match. */ -export interface TextBlocklistMatchResultOutput { - /** The name of matched blocklist. */ +export interface TextBlocklistMatchOutput { + /** The name of the matched blocklist. */ blocklistName: string; - /** The id of matched item. */ - blockItemId: string; - /** The content of matched item. */ - blockItemText: string; - /** The character offset of matched text in original input. */ - offset: number; - /** The length of matched text in original input. */ - length: number; + /** The ID of the matched item. */ + blocklistItemId: string; + /** The content of the matched item. */ + blocklistItemText: string; } /** Text analysis result. */ -export interface TextAnalyzeSeverityResultOutput { +export interface TextCategoriesAnalysisOutput { /** - * The text category. + * The text analysis category. * * Possible values: Hate, SelfHarm, Sexual, Violence */ category: string; - /** The higher the severity of input content, the larger this value is. The values could be: 0,2,4,6. */ - severity: number; + /** The value increases with the severity of the input content. The value of this field is determined by the output type specified in the request. The output type could be ‘FourSeverityLevels’ or ‘EightSeverity Levels’, and the output value can be 0, 2, 4, 6 or 0, 1, 2, 3, 4, 5, 6, or 7. */ + severity?: number; } -/** The analysis request of the image. */ +/** The image analysis request. */ export interface AnalyzeImageOptionsOutput { /** The image needs to be analyzed. */ image: ImageDataOutput; - /** The categories will be analyzed. If not assigned, a default set of the categories' analysis results will be returned. */ + /** The categories will be analyzed. If they are not assigned, a default set of analysis results for the categories will be returned. */ categories?: string[]; + /** + * This refers to the type of image analysis output. If no value is assigned, the default value will be "FourSeverityLevels". + * + * Possible values: FourSeverityLevels + */ + outputType?: string; } -/** The content or blob url of image, could be base64 encoding bytes or blob url. If both are given, the request will be refused. The maximum size of image is 2048 pixels * 2048 pixels, no larger than 4MB at the same time. The minimum size of image is 50 pixels * 50 pixels. */ +/** The image can be either base64 encoded bytes or a blob URL. You can choose only one of these options. If both are provided, the request will be refused. The maximum image size is 2048 x 2048 pixels and should not exceed 4 MB, while the minimum image size is 50 x 50 pixels. */ export interface ImageDataOutput { - /** Base64 encoding of image. */ + /** The Base64 encoding of the image. */ content?: string; - /** The blob url of image. */ + /** The blob url of the image. */ blobUrl?: string; } -/** The analysis response of the image. */ +/** The image analysis response. */ export interface AnalyzeImageResultOutput { - /** Analysis result for Hate category. */ - hateResult?: ImageAnalyzeSeverityResultOutput; - /** Analysis result for SelfHarm category. */ - selfHarmResult?: ImageAnalyzeSeverityResultOutput; - /** Analysis result for Sexual category. */ - sexualResult?: ImageAnalyzeSeverityResultOutput; - /** Analysis result for Violence category. */ - violenceResult?: ImageAnalyzeSeverityResultOutput; + /** Analysis result for categories. */ + categoriesAnalysis: Array; } /** Image analysis result. */ -export interface ImageAnalyzeSeverityResultOutput { +export interface ImageCategoriesAnalysisOutput { /** - * The image category. + * The image analysis category. * * Possible values: Hate, SelfHarm, Sexual, Violence */ category: string; - /** The higher the severity of input content, the larger this value, currently its value could be: 0,2,4,6. */ - severity: number; + /** The value increases with the severity of the input content. The value of this field is determined by the output type specified in the request. The output type could be ‘FourSeverityLevels’, and the output value can be 0, 2, 4, 6. */ + severity?: number; } /** Text Blocklist. */ @@ -103,23 +99,23 @@ export interface TextBlocklistOutput { description?: string; } -/** The response of adding blockItems to text blocklist. */ -export interface AddBlockItemsResultOutput { - /** Array of blockItems added. */ - value?: Array; -} - -/** Item in TextBlocklist. */ -export interface TextBlockItemOutput { - /** Block Item Id. It will be uuid. */ - blockItemId: string; - /** Block item description. */ +/** Item in a TextBlocklist. */ +export interface TextBlocklistItemOutput { + /** The service will generate a BlocklistItemId, which will be a UUID. */ + readonly blocklistItemId: string; + /** BlocklistItem description. */ description?: string; - /** Block item content. */ + /** BlocklistItem content. */ text: string; } +/** The response of adding blocklistItems to the text blocklist. */ +export interface AddOrUpdateTextBlocklistItemsResultOutput { + /** Array of blocklistItems have been added. */ + blocklistItems: Array; +} + /** Paged collection of TextBlocklist items */ -export type TextBlocklistListOutput = Paged; -/** Paged collection of TextBlockItem items */ -export type TextBlockItemListOutput = Paged; +export type PagedTextBlocklistOutput = Paged; +/** Paged collection of TextBlocklistItem items */ +export type PagedTextBlocklistItemOutput = Paged; diff --git a/sdk/contentsafety/ai-content-safety-rest/src/paginateHelper.ts b/sdk/contentsafety/ai-content-safety-rest/src/paginateHelper.ts index 477bace4a37f..1c9af35b1efd 100644 --- a/sdk/contentsafety/ai-content-safety-rest/src/paginateHelper.ts +++ b/sdk/contentsafety/ai-content-safety-rest/src/paginateHelper.ts @@ -1,8 +1,16 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { getPagedAsyncIterator, PagedAsyncIterableIterator, PagedResult } from "@azure/core-paging"; -import { Client, createRestError, PathUncheckedResponse } from "@azure-rest/core-client"; +import { + getPagedAsyncIterator, + PagedAsyncIterableIterator, + PagedResult, +} from "@azure/core-paging"; +import { + Client, + createRestError, + PathUncheckedResponse, +} from "@azure-rest/core-client"; /** * Helper type to extract the type of an array @@ -67,7 +75,9 @@ export function paginate( typeof customGetPage === "function" ? customGetPage : async (pageLink: string) => { - const result = firstRun ? initialResponse : await client.pathUnchecked(pageLink).get(); + const result = firstRun + ? initialResponse + : await client.pathUnchecked(pageLink).get(); firstRun = false; checkPagingRequest(result); const nextLink = getNextLink(result.body, nextLinkName); @@ -93,7 +103,9 @@ function getNextLink(body: unknown, nextLinkName?: string): string | undefined { const nextLink = (body as Record)[nextLinkName]; if (typeof nextLink !== "string" && typeof nextLink !== "undefined") { - throw new Error(`Body Property ${nextLinkName} should be a string or undefined`); + throw new Error( + `Body Property ${nextLinkName} should be a string or undefined` + ); } return nextLink; @@ -121,7 +133,18 @@ function getElements(body: unknown, itemName: string): T[] { * Checks if a request failed */ function checkPagingRequest(response: PathUncheckedResponse): void { - const Http2xxStatusCodes = ["200", "201", "202", "203", "204", "205", "206", "207", "208", "226"]; + const Http2xxStatusCodes = [ + "200", + "201", + "202", + "203", + "204", + "205", + "206", + "207", + "208", + "226", + ]; if (!Http2xxStatusCodes.includes(response.status)) { throw createRestError( `Pagination failed with unexpected statusCode ${response.status}`, diff --git a/sdk/contentsafety/ai-content-safety-rest/src/parameters.ts b/sdk/contentsafety/ai-content-safety-rest/src/parameters.ts index 82a4913b2441..9a3206bdb42f 100644 --- a/sdk/contentsafety/ai-content-safety-rest/src/parameters.ts +++ b/sdk/contentsafety/ai-content-safety-rest/src/parameters.ts @@ -6,19 +6,19 @@ import { AnalyzeTextOptions, AnalyzeImageOptions, TextBlocklist, - AddBlockItemsOptions, - RemoveBlockItemsOptions, + AddOrUpdateTextBlocklistItemsOptions, + RemoveTextBlocklistItemsOptions, } from "./models"; export interface AnalyzeTextBodyParam { - /** The request of text analysis. */ + /** The text analysis request. */ body: AnalyzeTextOptions; } export type AnalyzeTextParameters = AnalyzeTextBodyParam & RequestParameters; export interface AnalyzeImageBodyParam { - /** The analysis request of the image. */ + /** The image analysis request. */ body: AnalyzeImageOptions; } @@ -37,23 +37,28 @@ export interface CreateOrUpdateTextBlocklistMediaTypesParam { contentType: "application/merge-patch+json"; } -export type CreateOrUpdateTextBlocklistParameters = CreateOrUpdateTextBlocklistMediaTypesParam & - CreateOrUpdateTextBlocklistBodyParam & - RequestParameters; +export type CreateOrUpdateTextBlocklistParameters = + CreateOrUpdateTextBlocklistMediaTypesParam & + CreateOrUpdateTextBlocklistBodyParam & + RequestParameters; export type DeleteTextBlocklistParameters = RequestParameters; export type ListTextBlocklistsParameters = RequestParameters; -export interface AddBlockItemsBodyParam { - body?: AddBlockItemsOptions; +export interface AddOrUpdateBlocklistItemsBodyParam { + /** Options for adding or updating blocklist items. */ + body: AddOrUpdateTextBlocklistItemsOptions; } -export type AddBlockItemsParameters = AddBlockItemsBodyParam & RequestParameters; +export type AddOrUpdateBlocklistItemsParameters = + AddOrUpdateBlocklistItemsBodyParam & RequestParameters; -export interface RemoveBlockItemsBodyParam { - body?: RemoveBlockItemsOptions; +export interface RemoveBlocklistItemsBodyParam { + /** Options for removing blocklist items. */ + body: RemoveTextBlocklistItemsOptions; } -export type RemoveBlockItemsParameters = RemoveBlockItemsBodyParam & RequestParameters; +export type RemoveBlocklistItemsParameters = RemoveBlocklistItemsBodyParam & + RequestParameters; export type GetTextBlocklistItemParameters = RequestParameters; export interface ListTextBlocklistItemsQueryParamProperties { @@ -69,4 +74,5 @@ export interface ListTextBlocklistItemsQueryParam { queryParameters?: ListTextBlocklistItemsQueryParamProperties; } -export type ListTextBlocklistItemsParameters = ListTextBlocklistItemsQueryParam & RequestParameters; +export type ListTextBlocklistItemsParameters = + ListTextBlocklistItemsQueryParam & RequestParameters; diff --git a/sdk/contentsafety/ai-content-safety-rest/src/responses.ts b/sdk/contentsafety/ai-content-safety-rest/src/responses.ts index fd3ccef7c027..d0de87a205c8 100644 --- a/sdk/contentsafety/ai-content-safety-rest/src/responses.ts +++ b/sdk/contentsafety/ai-content-safety-rest/src/responses.ts @@ -7,10 +7,10 @@ import { AnalyzeTextResultOutput, AnalyzeImageResultOutput, TextBlocklistOutput, - TextBlocklistListOutput, - AddBlockItemsResultOutput, - TextBlockItemOutput, - TextBlockItemListOutput, + PagedTextBlocklistOutput, + AddOrUpdateTextBlocklistItemsResultOutput, + TextBlocklistItemOutput, + PagedTextBlocklistItemOutput, } from "./outputModels"; /** The request has succeeded. */ @@ -81,7 +81,8 @@ export interface CreateOrUpdateTextBlocklistDefaultHeaders { "x-ms-error-code"?: string; } -export interface CreateOrUpdateTextBlocklistDefaultResponse extends HttpResponse { +export interface CreateOrUpdateTextBlocklistDefaultResponse + extends HttpResponse { status: string; body: ErrorResponse; headers: RawHttpHeaders & CreateOrUpdateTextBlocklistDefaultHeaders; @@ -106,7 +107,7 @@ export interface DeleteTextBlocklistDefaultResponse extends HttpResponse { /** The request has succeeded. */ export interface ListTextBlocklists200Response extends HttpResponse { status: "200"; - body: TextBlocklistListOutput; + body: PagedTextBlocklistOutput; } export interface ListTextBlocklistsDefaultHeaders { @@ -121,42 +122,42 @@ export interface ListTextBlocklistsDefaultResponse extends HttpResponse { } /** The request has succeeded. */ -export interface AddBlockItems200Response extends HttpResponse { +export interface AddOrUpdateBlocklistItems200Response extends HttpResponse { status: "200"; - body: AddBlockItemsResultOutput; + body: AddOrUpdateTextBlocklistItemsResultOutput; } -export interface AddBlockItemsDefaultHeaders { +export interface AddOrUpdateBlocklistItemsDefaultHeaders { /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -export interface AddBlockItemsDefaultResponse extends HttpResponse { +export interface AddOrUpdateBlocklistItemsDefaultResponse extends HttpResponse { status: string; body: ErrorResponse; - headers: RawHttpHeaders & AddBlockItemsDefaultHeaders; + headers: RawHttpHeaders & AddOrUpdateBlocklistItemsDefaultHeaders; } /** There is no content to send for this request, but the headers may be useful. */ -export interface RemoveBlockItems204Response extends HttpResponse { +export interface RemoveBlocklistItems204Response extends HttpResponse { status: "204"; } -export interface RemoveBlockItemsDefaultHeaders { +export interface RemoveBlocklistItemsDefaultHeaders { /** String error code indicating what went wrong. */ "x-ms-error-code"?: string; } -export interface RemoveBlockItemsDefaultResponse extends HttpResponse { +export interface RemoveBlocklistItemsDefaultResponse extends HttpResponse { status: string; body: ErrorResponse; - headers: RawHttpHeaders & RemoveBlockItemsDefaultHeaders; + headers: RawHttpHeaders & RemoveBlocklistItemsDefaultHeaders; } /** The request has succeeded. */ export interface GetTextBlocklistItem200Response extends HttpResponse { status: "200"; - body: TextBlockItemOutput; + body: TextBlocklistItemOutput; } export interface GetTextBlocklistItemDefaultHeaders { @@ -173,7 +174,7 @@ export interface GetTextBlocklistItemDefaultResponse extends HttpResponse { /** The request has succeeded. */ export interface ListTextBlocklistItems200Response extends HttpResponse { status: "200"; - body: TextBlockItemListOutput; + body: PagedTextBlocklistItemOutput; } export interface ListTextBlocklistItemsDefaultHeaders { diff --git a/sdk/contentsafety/ai-content-safety-rest/tsconfig.json b/sdk/contentsafety/ai-content-safety-rest/tsconfig.json index ddbefcd7cd49..766326d1019f 100644 --- a/sdk/contentsafety/ai-content-safety-rest/tsconfig.json +++ b/sdk/contentsafety/ai-content-safety-rest/tsconfig.json @@ -3,10 +3,19 @@ "compilerOptions": { "outDir": "./dist-esm", "declarationDir": "./types", - "lib": ["es6", "dom"], + "lib": [ + "es6", + "dom" + ], "paths": { - "@azure-rest/ai-content-safety": ["./src/index"] + "@azure-rest/ai-content-safety": [ + "./src/index" + ] } }, - "include": ["src/**/*.ts", "./test/**/*.ts", "samples-dev/**/*.ts"] -} + "include": [ + "src/**/*.ts", + "./test/**/*.ts", + "samples-dev/**/*.ts" + ] +} \ No newline at end of file diff --git a/sdk/contentsafety/ai-content-safety-rest/tsp-location.yaml b/sdk/contentsafety/ai-content-safety-rest/tsp-location.yaml new file mode 100644 index 000000000000..86cdc50361bf --- /dev/null +++ b/sdk/contentsafety/ai-content-safety-rest/tsp-location.yaml @@ -0,0 +1,5 @@ +directory: specification/cognitiveservices/ContentSafety +additionalDirectories: [] +commit: 4539708e7024bad1fcf4854bb1d852f856e2813a +repo: Azure/azure-rest-api-specs +