From 680b8baebd8323e59edea56519face6fac7ba8a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Fri, 19 Aug 2022 12:13:09 +0200 Subject: [PATCH] gcalendar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/gcalendar/api-report.md | 21 +-------------------- plugins/gcalendar/src/api/client.ts | 11 ++++------- plugins/gcalendar/src/api/index.ts | 1 + plugins/gcalendar/src/api/types.ts | 5 +++++ plugins/gcalendar/src/index.ts | 1 + plugins/gcalendar/src/plugin.ts | 4 +++- scripts/api-extractor.ts | 1 - 7 files changed, 15 insertions(+), 29 deletions(-) diff --git a/plugins/gcalendar/api-report.md b/plugins/gcalendar/api-report.md index 61c39aaf2a..8c86e4d2c9 100644 --- a/plugins/gcalendar/api-report.md +++ b/plugins/gcalendar/api-report.md @@ -12,22 +12,15 @@ import { FetchApi } from '@backstage/core-plugin-api'; import { OAuthApi } from '@backstage/core-plugin-api'; import { RouteRef } from '@backstage/core-plugin-api'; -// Warning: (ae-missing-release-tag) "EventAttendee" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type EventAttendee = gapi.client.calendar.EventAttendee; -// Warning: (ae-missing-release-tag) "GCalendar" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type GCalendar = gapi.client.calendar.CalendarListEntry; -// Warning: (ae-missing-release-tag) "GCalendarApiClient" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export class GCalendarApiClient { - // Warning: (ae-forgotten-export) The symbol "Options" needs to be exported by the entry point index.d.ts - constructor(options: Options); + constructor(options: { authApi: OAuthApi; fetchApi: FetchApi }); // (undocumented) getCalendars(params?: any): Promise; // (undocumented) @@ -39,13 +32,9 @@ export class GCalendarApiClient { }>; } -// Warning: (ae-missing-release-tag) "gcalendarApiRef" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const gcalendarApiRef: ApiRef; -// Warning: (ae-missing-release-tag) "GCalendarEvent" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type GCalendarEvent = gapi.client.calendar.Event & Pick & @@ -53,13 +42,9 @@ export type GCalendarEvent = gapi.client.calendar.Event & calendarId?: string; }; -// Warning: (ae-missing-release-tag) "GCalendarList" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export type GCalendarList = gapi.client.calendar.CalendarList; -// Warning: (ae-missing-release-tag) "gcalendarPlugin" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const gcalendarPlugin: BackstagePlugin< { @@ -69,13 +54,9 @@ export const gcalendarPlugin: BackstagePlugin< {} >; -// Warning: (ae-missing-release-tag) "HomePageCalendar" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export const HomePageCalendar: () => JSX.Element; -// Warning: (ae-missing-release-tag) "ResponseStatus" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) -// // @public (undocumented) export enum ResponseStatus { // (undocumented) diff --git a/plugins/gcalendar/src/api/client.ts b/plugins/gcalendar/src/api/client.ts index 084c302636..0f5b56cc08 100644 --- a/plugins/gcalendar/src/api/client.ts +++ b/plugins/gcalendar/src/api/client.ts @@ -13,25 +13,22 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { OAuthApi, createApiRef, FetchApi } from '@backstage/core-plugin-api'; +import { OAuthApi, createApiRef, FetchApi } from '@backstage/core-plugin-api'; import { GCalendarEvent, GCalendarList } from './types'; import { ResponseError } from '@backstage/errors'; -type Options = { - authApi: OAuthApi; - fetchApi: FetchApi; -}; - +/** @public */ export const gcalendarApiRef = createApiRef({ id: 'plugin.gcalendar.service', }); +/** @public */ export class GCalendarApiClient { private readonly authApi: OAuthApi; private readonly fetchApi: FetchApi; - constructor(options: Options) { + constructor(options: { authApi: OAuthApi; fetchApi: FetchApi }) { this.authApi = options.authApi; this.fetchApi = options.fetchApi; } diff --git a/plugins/gcalendar/src/api/index.ts b/plugins/gcalendar/src/api/index.ts index 4c195158d3..09cc21a2d0 100644 --- a/plugins/gcalendar/src/api/index.ts +++ b/plugins/gcalendar/src/api/index.ts @@ -13,5 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + export * from './client'; export * from './types'; diff --git a/plugins/gcalendar/src/api/types.ts b/plugins/gcalendar/src/api/types.ts index 5c8bbdd1c1..9b1b508762 100644 --- a/plugins/gcalendar/src/api/types.ts +++ b/plugins/gcalendar/src/api/types.ts @@ -16,18 +16,23 @@ /// +/** @public */ export type GCalendarList = gapi.client.calendar.CalendarList; +/** @public */ export type GCalendar = gapi.client.calendar.CalendarListEntry; +/** @public */ export type EventAttendee = gapi.client.calendar.EventAttendee; +/** @public */ export type GCalendarEvent = gapi.client.calendar.Event & Pick & Pick & { calendarId?: string; }; +/** @public */ export enum ResponseStatus { needsAction = 'needsAction', accepted = 'accepted', diff --git a/plugins/gcalendar/src/index.ts b/plugins/gcalendar/src/index.ts index 7c7f0c6374..37d51d0ef4 100644 --- a/plugins/gcalendar/src/index.ts +++ b/plugins/gcalendar/src/index.ts @@ -13,5 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + export { gcalendarPlugin, HomePageCalendar } from './plugin'; export * from './api'; diff --git a/plugins/gcalendar/src/plugin.ts b/plugins/gcalendar/src/plugin.ts index 1f98f560f1..06c3922087 100644 --- a/plugins/gcalendar/src/plugin.ts +++ b/plugins/gcalendar/src/plugin.ts @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { createApiFactory, createComponentExtension, @@ -20,10 +21,10 @@ import { fetchApiRef, googleAuthApiRef, } from '@backstage/core-plugin-api'; - import { GCalendarApiClient, gcalendarApiRef } from './api'; import { rootRouteRef } from './routes'; +/** @public */ export const gcalendarPlugin = createPlugin({ id: 'gcalendar', routes: { @@ -40,6 +41,7 @@ export const gcalendarPlugin = createPlugin({ ], }); +/** @public */ export const HomePageCalendar = gcalendarPlugin.provide( createComponentExtension({ name: 'HomePageCalendar', diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index aa24fb2e06..98398ca5d9 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -215,7 +215,6 @@ const ALLOW_WARNINGS = [ 'plugins/explore', 'plugins/explore-react', 'plugins/firehydrant', - 'plugins/gcalendar', 'plugins/gcp-projects', 'plugins/git-release-manager', 'plugins/github-actions',