Skip to content

Commit 66929a9

Browse files
authored
[discovery] Address APIView feedback and add CODEOWNERS for @azure/ai-discovery (#39499)
Follow-up to #39406 to address GA APIView review feedback from @maorleger and establish package ownership. ## APIView feedback (all "ShouldFix") - **Reserved-word `delete` methods** renamed via in-SDK customization (removes the `@fixme` the emitter generated): - `conversations.delete` → `deleteConversation` - `investigations.delete` → `deleteInvestigation` - `tasks.delete` → `deleteTask` - `knowledgeBases.delete` → `deleteKnowledgeBase` - **Restore poller exports camelCased** per reviewer guidance: - `BookshelfClientRestorePoller` → `bookshelfClientRestorePoller` - workspace `restorePoller` → `workspaceClientRestorePoller` (+ options type `WorkspaceClientRestorePollerOptions`) ## CODEOWNERS - Added the `%Discovery` entry for `/sdk/discovery/ai-discovery` (@ahall-msft @mike-menaker), matching the .NET PR and JS data-plane format. ## Validation - Build: 0 errors · Lint: 0 errors · Playback tests: 40/40 - API report regenerated
1 parent 7f102cf commit 66929a9

13 files changed

Lines changed: 50 additions & 58 deletions

File tree

.github/CODEOWNERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,12 @@
187187
# PRLabel: %Digital Twins
188188
/sdk/digitaltwins/ @johngallardo @olivakar @sjiherzig
189189

190+
# PRLabel: %Discovery
191+
/sdk/discovery/ai-discovery @ahall-msft @mike-menaker
192+
193+
# ServiceLabel: %Discovery
194+
# ServiceOwners: @ahall-msft @mike-menaker
195+
190196
# PRLabel: %DocumentTranslator
191197
/sdk/documenttranslator/ @jeremymeng
192198

sdk/discovery/ai-discovery/review/ai-discovery-bookshelf-node.api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export interface KnowledgeBasesListOptionalParams extends OperationOptions {
6464
export interface KnowledgeBasesOperations {
6565
cancelIndexing: (knowledgeBaseName: string, options?: KnowledgeBasesCancelIndexingOptionalParams) => PollerLike<OperationState<void>, void>;
6666
createOrUpdate: (knowledgeBaseName: string, resource: KnowledgeBaseCreateOrUpdateContent, options?: KnowledgeBasesCreateOrUpdateOptionalParams) => PollerLike<OperationState<KnowledgeBase>, KnowledgeBase>;
67-
delete: (knowledgeBaseName: string, options?: KnowledgeBasesDeleteOptionalParams) => PollerLike<OperationState<void>, void>;
67+
deleteKnowledgeBase: (knowledgeBaseName: string, options?: KnowledgeBasesDeleteOptionalParams) => PollerLike<OperationState<void>, void>;
6868
get: (knowledgeBaseName: string, options?: KnowledgeBasesGetOptionalParams) => Promise<KnowledgeBase>;
6969
getOperationStatus: (knowledgeBaseName: string, operationId: string, options?: KnowledgeBasesGetOperationStatusOptionalParams) => Promise<KnowledgeBaseOperationResponseUnion>;
7070
list: (options?: KnowledgeBasesListOptionalParams) => PagedAsyncIterableIterator<KnowledgeBase>;

sdk/discovery/ai-discovery/review/ai-discovery-node.api.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export interface BookshelfClientOptionalParams extends ClientOptions {
2828
}
2929

3030
// @public
31-
export function BookshelfClientRestorePoller<TResponse extends PathUncheckedResponse, TResult>(client: BookshelfClient, serializedState: string, sourceOperation: (...args: any[]) => PollerLike<OperationState_2<TResult>, TResult>, options?: BookshelfClientRestorePollerOptions<TResult>): PollerLike<OperationState_2<TResult>, TResult>;
31+
export function bookshelfClientRestorePoller<TResponse extends PathUncheckedResponse, TResult>(client: BookshelfClient, serializedState: string, sourceOperation: (...args: any[]) => PollerLike<OperationState_2<TResult>, TResult>, options?: BookshelfClientRestorePollerOptions<TResult>): PollerLike<OperationState_2<TResult>, TResult>;
3232

3333
// @public (undocumented)
3434
export interface BookshelfClientRestorePollerOptions<TResult, TResponse extends PathUncheckedResponse = PathUncheckedResponse> extends OperationOptions {
@@ -106,7 +106,7 @@ export interface ConversationsListOptionalParams extends OperationOptions {
106106
// @public
107107
export interface ConversationsOperations {
108108
create: (projectName: string, options?: ConversationsCreateOptionalParams) => Promise<Conversation>;
109-
delete: (conversationName: string, options?: ConversationsDeleteOptionalParams) => Promise<void>;
109+
deleteConversation: (conversationName: string, options?: ConversationsDeleteOptionalParams) => Promise<void>;
110110
get: (conversationName: string, options?: ConversationsGetOptionalParams) => Promise<Conversation>;
111111
list: (options?: ConversationsListOptionalParams) => PagedAsyncIterableIterator<Conversation>;
112112
update: (conversationName: string, resource: ConversationCreateOrUpdateContent, options?: ConversationsUpdateOptionalParams) => Promise<Conversation>;
@@ -262,7 +262,7 @@ export interface InvestigationsListOptionalParams extends OperationOptions {
262262
// @public
263263
export interface InvestigationsOperations {
264264
createOrReplace: (projectName: string, investigationName: string, resource: InvestigationCreateOrUpdateContent, options?: InvestigationsCreateOrReplaceOptionalParams) => Promise<Investigation>;
265-
delete: (projectName: string, investigationName: string, options?: InvestigationsDeleteOptionalParams) => PollerLike<OperationState_2<void>, void>;
265+
deleteInvestigation: (projectName: string, investigationName: string, options?: InvestigationsDeleteOptionalParams) => PollerLike<OperationState_2<void>, void>;
266266
get: (projectName: string, investigationName: string, options?: InvestigationsGetOptionalParams) => Promise<Investigation>;
267267
getDiscoveryEngine: (projectName: string, investigationName: string, options?: InvestigationsGetDiscoveryEngineOptionalParams) => Promise<DiscoveryEngine>;
268268
getOperationStatus: (projectName: string, investigationName: string, operationId: string, options?: InvestigationsGetOperationStatusOptionalParams) => Promise<InvestigationOperationStatus>;
@@ -381,7 +381,7 @@ export interface KnowledgeBasesListOptionalParams extends OperationOptions {
381381
export interface KnowledgeBasesOperations {
382382
cancelIndexing: (knowledgeBaseName: string, options?: KnowledgeBasesCancelIndexingOptionalParams) => PollerLike<OperationState_2<void>, void>;
383383
createOrUpdate: (knowledgeBaseName: string, resource: KnowledgeBaseCreateOrUpdateContent, options?: KnowledgeBasesCreateOrUpdateOptionalParams) => PollerLike<OperationState_2<KnowledgeBase>, KnowledgeBase>;
384-
delete: (knowledgeBaseName: string, options?: KnowledgeBasesDeleteOptionalParams) => PollerLike<OperationState_2<void>, void>;
384+
deleteKnowledgeBase: (knowledgeBaseName: string, options?: KnowledgeBasesDeleteOptionalParams) => PollerLike<OperationState_2<void>, void>;
385385
get: (knowledgeBaseName: string, options?: KnowledgeBasesGetOptionalParams) => Promise<KnowledgeBase>;
386386
getOperationStatus: (knowledgeBaseName: string, operationId: string, options?: KnowledgeBasesGetOperationStatusOptionalParams) => Promise<KnowledgeBaseOperationResponseUnion>;
387387
list: (options?: KnowledgeBasesListOptionalParams) => PagedAsyncIterableIterator<KnowledgeBase>;
@@ -608,16 +608,6 @@ export type RepeatabilityResult = "accepted" | "rejected";
608608

609609
export { RestError }
610610

611-
// @public
612-
export function restorePoller<TResponse extends PathUncheckedResponse, TResult>(client: WorkspaceClient, serializedState: string, sourceOperation: (...args: any[]) => PollerLike<OperationState_2<TResult>, TResult>, options?: RestorePollerOptions<TResult>): PollerLike<OperationState_2<TResult>, TResult>;
613-
614-
// @public (undocumented)
615-
export interface RestorePollerOptions<TResult, TResponse extends PathUncheckedResponse = PathUncheckedResponse> extends OperationOptions {
616-
abortSignal?: AbortSignalLike;
617-
processResponseBody?: (result: TResponse) => Promise<TResult>;
618-
updateIntervalInMs?: number;
619-
}
620-
621611
// @public
622612
export interface RunResult {
623613
readonly completedAt?: Date;
@@ -761,7 +751,7 @@ export interface TasksOperations {
761751
addComment: (projectName: string, investigationName: string, taskName: string, body: TaskComment, options?: TasksAddCommentOptionalParams) => Promise<Task>;
762752
addExecutionHistory: (projectName: string, investigationName: string, taskName: string, body: ExecutionHistoryEntry, options?: TasksAddExecutionHistoryOptionalParams) => Promise<Task>;
763753
create: (projectName: string, investigationName: string, body: TaskCreateOrUpdateContent, options?: TasksCreateOptionalParams) => Promise<Task>;
764-
delete: (projectName: string, investigationName: string, taskName: string, options?: TasksDeleteOptionalParams) => Promise<void>;
754+
deleteTask: (projectName: string, investigationName: string, taskName: string, options?: TasksDeleteOptionalParams) => Promise<void>;
765755
get: (projectName: string, investigationName: string, taskName: string, options?: TasksGetOptionalParams) => Promise<Task>;
766756
list: (projectName: string, investigationName: string, options?: TasksListOptionalParams) => PagedAsyncIterableIterator<Task>;
767757
start: (projectName: string, investigationName: string, taskName: string, options?: TasksStartOptionalParams) => Promise<Task>;
@@ -848,6 +838,16 @@ export class WorkspaceClient {
848838
export interface WorkspaceClientOptionalParams extends ClientOptions {
849839
}
850840

841+
// @public
842+
export function workspaceClientRestorePoller<TResponse extends PathUncheckedResponse, TResult>(client: WorkspaceClient, serializedState: string, sourceOperation: (...args: any[]) => PollerLike<OperationState_2<TResult>, TResult>, options?: WorkspaceClientRestorePollerOptions<TResult>): PollerLike<OperationState_2<TResult>, TResult>;
843+
844+
// @public (undocumented)
845+
export interface WorkspaceClientRestorePollerOptions<TResult, TResponse extends PathUncheckedResponse = PathUncheckedResponse> extends OperationOptions {
846+
abortSignal?: AbortSignalLike;
847+
processResponseBody?: (result: TResponse) => Promise<TResult>;
848+
updateIntervalInMs?: number;
849+
}
850+
851851
// (No @packageDocumentation comment for this package)
852852

853853
```

sdk/discovery/ai-discovery/review/ai-discovery-workspace-node.api.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export interface ConversationsListOptionalParams extends OperationOptions {
4242
// @public
4343
export interface ConversationsOperations {
4444
create: (projectName: string, options?: ConversationsCreateOptionalParams) => Promise<Conversation>;
45-
delete: (conversationName: string, options?: ConversationsDeleteOptionalParams) => Promise<void>;
45+
deleteConversation: (conversationName: string, options?: ConversationsDeleteOptionalParams) => Promise<void>;
4646
get: (conversationName: string, options?: ConversationsGetOptionalParams) => Promise<Conversation>;
4747
list: (options?: ConversationsListOptionalParams) => PagedAsyncIterableIterator<Conversation>;
4848
update: (conversationName: string, resource: ConversationCreateOrUpdateContent, options?: ConversationsUpdateOptionalParams) => Promise<Conversation>;
@@ -91,7 +91,7 @@ export interface InvestigationsListOptionalParams extends OperationOptions {
9191
// @public
9292
export interface InvestigationsOperations {
9393
createOrReplace: (projectName: string, investigationName: string, resource: InvestigationCreateOrUpdateContent, options?: InvestigationsCreateOrReplaceOptionalParams) => Promise<Investigation>;
94-
delete: (projectName: string, investigationName: string, options?: InvestigationsDeleteOptionalParams) => PollerLike<OperationState<void>, void>;
94+
deleteInvestigation: (projectName: string, investigationName: string, options?: InvestigationsDeleteOptionalParams) => PollerLike<OperationState<void>, void>;
9595
get: (projectName: string, investigationName: string, options?: InvestigationsGetOptionalParams) => Promise<Investigation>;
9696
getDiscoveryEngine: (projectName: string, investigationName: string, options?: InvestigationsGetDiscoveryEngineOptionalParams) => Promise<DiscoveryEngine>;
9797
getOperationStatus: (projectName: string, investigationName: string, operationId: string, options?: InvestigationsGetOperationStatusOptionalParams) => Promise<InvestigationOperationStatus>;
@@ -159,7 +159,7 @@ export interface TasksOperations {
159159
addComment: (projectName: string, investigationName: string, taskName: string, body: TaskComment, options?: TasksAddCommentOptionalParams) => Promise<Task>;
160160
addExecutionHistory: (projectName: string, investigationName: string, taskName: string, body: ExecutionHistoryEntry, options?: TasksAddExecutionHistoryOptionalParams) => Promise<Task>;
161161
create: (projectName: string, investigationName: string, body: TaskCreateOrUpdateContent, options?: TasksCreateOptionalParams) => Promise<Task>;
162-
delete: (projectName: string, investigationName: string, taskName: string, options?: TasksDeleteOptionalParams) => Promise<void>;
162+
deleteTask: (projectName: string, investigationName: string, taskName: string, options?: TasksDeleteOptionalParams) => Promise<void>;
163163
get: (projectName: string, investigationName: string, taskName: string, options?: TasksGetOptionalParams) => Promise<Task>;
164164
list: (projectName: string, investigationName: string, options?: TasksListOptionalParams) => PagedAsyncIterableIterator<Task>;
165165
start: (projectName: string, investigationName: string, taskName: string, options?: TasksStartOptionalParams) => Promise<Task>;

sdk/discovery/ai-discovery/src/bookshelf/classic/knowledgeBases/index.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,7 @@ import { PollerLike, OperationState } from "@azure/core-lro";
3535
/** Interface representing a KnowledgeBases operations. */
3636
export interface KnowledgeBasesOperations {
3737
/** Delete a KnowledgeBase. */
38-
/**
39-
* @fixme delete is a reserved word that cannot be used as an operation name.
40-
* Please add @clientName("clientName") or @clientName("<JS-Specific-Name>", "javascript")
41-
* to the operation to override the generated name.
42-
*/
43-
delete: (
38+
deleteKnowledgeBase: (
4439
knowledgeBaseName: string,
4540
options?: KnowledgeBasesDeleteOptionalParams,
4641
) => PollerLike<OperationState<void>, void>;
@@ -85,8 +80,10 @@ export interface KnowledgeBasesOperations {
8580
}
8681
function _getKnowledgeBases(context: BookshelfContext) {
8782
return {
88-
delete: (knowledgeBaseName: string, options?: KnowledgeBasesDeleteOptionalParams) =>
89-
$delete(context, knowledgeBaseName, options),
83+
deleteKnowledgeBase: (
84+
knowledgeBaseName: string,
85+
options?: KnowledgeBasesDeleteOptionalParams,
86+
) => $delete(context, knowledgeBaseName, options),
9087
search: (
9188
knowledgeBaseName: string,
9289
body: SearchRequest,

sdk/discovery/ai-discovery/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import {
88
} from "./static-helpers/pagingHelpers.js";
99

1010
export { WorkspaceClient } from "./workspace/workspaceClient.js";
11-
export type { RestorePollerOptions } from "./workspace/restorePollerHelpers.js";
12-
export { restorePoller } from "./workspace/restorePollerHelpers.js";
11+
export type { RestorePollerOptions as WorkspaceClientRestorePollerOptions } from "./workspace/restorePollerHelpers.js";
12+
export { restorePoller as workspaceClientRestorePoller } from "./workspace/restorePollerHelpers.js";
1313
export type {
1414
OperationState,
1515
PagedInvestigation,
@@ -137,7 +137,7 @@ export type { PageSettings, ContinuablePage, PagedAsyncIterableIterator };
137137
export { RestError, isRestError } from "@azure/core-rest-pipeline";
138138
export { BookshelfClient } from "./bookshelf/bookshelfClient.js";
139139
export type { RestorePollerOptions as BookshelfClientRestorePollerOptions } from "./bookshelf/restorePollerHelpers.js";
140-
export { restorePoller as BookshelfClientRestorePoller } from "./bookshelf/restorePollerHelpers.js";
140+
export { restorePoller as bookshelfClientRestorePoller } from "./bookshelf/restorePollerHelpers.js";
141141
export type { BookshelfClientOptionalParams } from "./bookshelf/api/index.js";
142142
export type {
143143
KnowledgeBasesDeleteOptionalParams,

sdk/discovery/ai-discovery/src/workspace/classic/conversations/index.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,11 @@ export interface ConversationsOperations {
2121
/** List Conversation resources */
2222
list: (options?: ConversationsListOptionalParams) => PagedAsyncIterableIterator<Conversation>;
2323
/** Deletes a Conversation. */
24-
/**
25-
* @fixme delete is a reserved word that cannot be used as an operation name.
26-
* Please add @clientName("clientName") or @clientName("<JS-Specific-Name>", "javascript")
27-
* to the operation to override the generated name.
28-
*/
29-
delete: (conversationName: string, options?: ConversationsDeleteOptionalParams) => Promise<void>;
24+
/** Delete a conversation. */
25+
deleteConversation: (
26+
conversationName: string,
27+
options?: ConversationsDeleteOptionalParams,
28+
) => Promise<void>;
3029
/** Updates a Conversation. */
3130
update: (
3231
conversationName: string,
@@ -47,7 +46,7 @@ export interface ConversationsOperations {
4746
function _getConversations(context: WorkspaceContext) {
4847
return {
4948
list: (options?: ConversationsListOptionalParams) => list(context, options),
50-
delete: (conversationName: string, options?: ConversationsDeleteOptionalParams) =>
49+
deleteConversation: (conversationName: string, options?: ConversationsDeleteOptionalParams) =>
5150
$delete(context, conversationName, options),
5251
update: (
5352
conversationName: string,

sdk/discovery/ai-discovery/src/workspace/classic/investigations/index.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,7 @@ export interface InvestigationsOperations {
7878
options?: InvestigationsListOptionalParams,
7979
) => PagedAsyncIterableIterator<Investigation>;
8080
/** Delete a Investigation. */
81-
/**
82-
* @fixme delete is a reserved word that cannot be used as an operation name.
83-
* Please add @clientName("clientName") or @clientName("<JS-Specific-Name>", "javascript")
84-
* to the operation to override the generated name.
85-
*/
86-
delete: (
81+
deleteInvestigation: (
8782
projectName: string,
8883
investigationName: string,
8984
options?: InvestigationsDeleteOptionalParams,
@@ -146,7 +141,7 @@ function _getInvestigations(context: WorkspaceContext) {
146141
) => getDiscoveryEngine(context, projectName, investigationName, options),
147142
list: (projectName: string, options?: InvestigationsListOptionalParams) =>
148143
list(context, projectName, options),
149-
delete: (
144+
deleteInvestigation: (
150145
projectName: string,
151146
investigationName: string,
152147
options?: InvestigationsDeleteOptionalParams,

sdk/discovery/ai-discovery/src/workspace/classic/tasks/index.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,7 @@ export interface TasksOperations {
5656
options?: TasksStartOptionalParams,
5757
) => Promise<Task>;
5858
/** Delete a task by ID. */
59-
/**
60-
* @fixme delete is a reserved word that cannot be used as an operation name.
61-
* Please add @clientName("clientName") or @clientName("<JS-Specific-Name>", "javascript")
62-
* to the operation to override the generated name.
63-
*/
64-
delete: (
59+
deleteTask: (
6560
projectName: string,
6661
investigationName: string,
6762
taskName: string,
@@ -118,7 +113,7 @@ function _getTasks(context: WorkspaceContext) {
118113
taskName: string,
119114
options?: TasksStartOptionalParams,
120115
) => start(context, projectName, investigationName, taskName, options),
121-
delete: (
116+
deleteTask: (
122117
projectName: string,
123118
investigationName: string,
124119
taskName: string,

sdk/discovery/ai-discovery/test/public/conversations.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ describe("Conversations operations (WorkspaceClient)", () => {
8686
});
8787

8888
it("delete removes a conversation", async () => {
89-
const result = await client.conversations.delete(createdConversationName);
89+
const result = await client.conversations.deleteConversation(createdConversationName);
9090
assert.isUndefined(result);
9191
});
9292
});

0 commit comments

Comments
 (0)