diff --git a/.changeset/clean-bags-flash.md b/.changeset/clean-bags-flash.md new file mode 100644 index 0000000000..7bbb33fc36 --- /dev/null +++ b/.changeset/clean-bags-flash.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-todo-common': minor +--- + +Creates a new common package to host the generated client at `@backstage/plugin-todo-common/client`. diff --git a/.changeset/fair-buttons-divide.md b/.changeset/fair-buttons-divide.md new file mode 100644 index 0000000000..873610794c --- /dev/null +++ b/.changeset/fair-buttons-divide.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-search-common': minor +--- + +Adds a new export for the generated client, `@backstage/plugin-search-common/client`. diff --git a/.changeset/quiet-cherries-deny.md b/.changeset/quiet-cherries-deny.md new file mode 100644 index 0000000000..145ab9f39f --- /dev/null +++ b/.changeset/quiet-cherries-deny.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-todo': minor +--- + +Updates the `TodoClient` to use `fetchApi` instead of `identityApi` for authenticated calls. diff --git a/plugins/search-common/api-report-client.md b/plugins/search-common/api-report-client.md new file mode 100644 index 0000000000..6e997b63bb --- /dev/null +++ b/plugins/search-common/api-report-client.md @@ -0,0 +1,107 @@ +## API Report File for "@backstage/plugin-search-common" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +// @public +export class DefaultApiClient { + constructor(options: { + discoveryApi: { + getBaseUrl(pluginId: string): Promise; + }; + fetchApi?: { + fetch: typeof fetch; + }; + }); + query( + request: Query, + options?: RequestOptions, + ): Promise>; +} + +// @public (undocumented) +export interface ErrorError { + // (undocumented) + message: string; + // (undocumented) + name: string; +} + +// @public (undocumented) +export interface ErrorRequest { + // (undocumented) + method: string; + // (undocumented) + url: string; +} + +// @public (undocumented) +export interface ErrorResponse { + // (undocumented) + statusCode: number; +} + +// @public (undocumented) +export interface ModelError { + // (undocumented) + error: ErrorError; + // (undocumented) + request: ErrorRequest; + // (undocumented) + response: ErrorResponse; +} + +// @public (undocumented) +export type Query = { + query: { + term?: string; + filters?: { + [key: string]: any; + }; + types?: Array; + pageCursor?: string; + pageLimit?: number; + }; +}; + +// @public (undocumented) +export interface Query200Response { + // (undocumented) + nextPageCursor?: string; + // (undocumented) + numberOfResults?: number; + // (undocumented) + previousPageCursor?: string; + // (undocumented) + results: Array; +} + +// @public (undocumented) +export interface Query200ResponseResultsInner { + // (undocumented) + document: Query200ResponseResultsInnerDocument; + highlight?: any; + rank?: number; + type: string; +} + +// @public +export interface Query200ResponseResultsInnerDocument { + location?: string; + text?: string; + title?: string; +} + +// @public +export interface RequestOptions { + // (undocumented) + token?: string; +} + +// @public +export type TypedResponse = Omit & { + json: () => Promise; +}; + +// (No @packageDocumentation comment for this package) +``` diff --git a/plugins/todo-common/api-report-client.md b/plugins/todo-common/api-report-client.md new file mode 100644 index 0000000000..5a866133d5 --- /dev/null +++ b/plugins/todo-common/api-report-client.md @@ -0,0 +1,80 @@ +## API Report File for "@backstage/plugin-todo-common" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +// @public +export class DefaultApiClient { + constructor(options: { + discoveryApi: { + getBaseUrl(pluginId: string): Promise; + }; + fetchApi?: { + fetch: typeof fetch; + }; + }); + // (undocumented) + listTodos( + request: ListTodos, + options?: RequestOptions, + ): Promise>; +} + +// @public (undocumented) +export type ListTodos = { + query: { + entity?: string; + orderBy?: string; + filter?: Array; + offset?: number; + limit?: number; + }; +}; + +// @public (undocumented) +export interface ListTodos200Response { + // (undocumented) + items: Array; + // (undocumented) + limit: number; + // (undocumented) + offset: number; + // (undocumented) + totalCount: number; +} + +// @public (undocumented) +export interface ListTodos400Response { + // (undocumented) + error?: ListTodos400ResponseError; +} + +// @public (undocumented) +export interface ListTodos400ResponseError { + // (undocumented) + message?: string; +} + +// @public +export interface RequestOptions { + // (undocumented) + token?: string; +} + +// @public (undocumented) +export interface TodoItem { + author?: string; + lineNumber?: number; + repoFilePath?: string; + tag: string; + text: string; + viewUrl?: string; +} + +// @public +export type TypedResponse = Omit & { + json: () => Promise; +}; + +// (No @packageDocumentation comment for this package) +``` diff --git a/plugins/todo-common/api-report.md b/plugins/todo-common/api-report.md new file mode 100644 index 0000000000..e0cbc50301 --- /dev/null +++ b/plugins/todo-common/api-report.md @@ -0,0 +1,7 @@ +## API Report File for "@backstage/plugin-todo-common" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +// (No @packageDocumentation comment for this package) +``` diff --git a/plugins/todo-common/src/index.ts b/plugins/todo-common/src/index.ts index b0d900d42e..b0f602d2d8 100644 --- a/plugins/todo-common/src/index.ts +++ b/plugins/todo-common/src/index.ts @@ -14,21 +14,4 @@ * limitations under the License. */ -/** - * Common functionalities for the todo plugin. - * - * @packageDocumentation - */ - -/** - * In this package you might for example declare types that are common - * between the frontend and backend plugin packages. - */ -export type CommonType = { - field: string; -}; - -/** - * Or you might declare some common constants. - */ -export const COMMON_CONSTANT = 1; +export {};