gcalendar

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2022-08-19 12:13:09 +02:00
parent d467b7e332
commit 680b8baebd
7 changed files with 15 additions and 29 deletions
+1 -20
View File
@@ -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<gapi.client.calendar.CalendarList>;
// (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<GCalendarApiClient>;
// 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<GCalendar, 'backgroundColor' | 'primary'> &
@@ -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)
+4 -7
View File
@@ -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<GCalendarApiClient>({
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;
}
+1
View File
@@ -13,5 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from './client';
export * from './types';
+5
View File
@@ -16,18 +16,23 @@
/// <reference types="@maxim_mazurok/gapi.client.calendar" />
/** @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<GCalendar, 'backgroundColor' | 'primary'> &
Pick<EventAttendee, 'responseStatus'> & {
calendarId?: string;
};
/** @public */
export enum ResponseStatus {
needsAction = 'needsAction',
accepted = 'accepted',
+1
View File
@@ -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';
+3 -1
View File
@@ -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',
-1
View File
@@ -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',