Skip to content

Built for people who want to own their automations. Join the waitlist for an invite.

Package listing

@kentcdodds/google

src/types.ts

87 lines · 2.6 KB · TypeScript
export type JsonPrimitive = string | number | boolean | null
export type JsonValue = JsonPrimitive | JsonObject | JsonValue[]
export type JsonObject = { [key: string]: JsonValue | unknown }
export type UserInfo = {
	sub?: string
	name?: string
	given_name?: string
	family_name?: string
	picture?: string
	email?: string
	email_verified?: boolean
}
export type SmokeTestResult = {
	account: string
	profile: { email?: string; name?: string; emailVerified?: boolean }
}
export type { GoogleAccountAlias, GoogleAccountInfo } from './accounts.ts'
export type { GoogleRequestParams, GoogleApiErrorDetails } from './core.ts'
export type {
	GmailAddressList,
	GmailSearchParams,
	GmailMessageParams,
	GmailRawMessageMutationParams,
	GmailComposedMutationParams,
	GmailMessageMutationParams,
	GmailReplyDraftParams,
	GmailModifyMessageParams,
	GmailEnsureLabelParams,
} from './gmail.ts'
export type {
	CalendarListParams,
	CalendarGetParams,
	CalendarEventsParams,
	CalendarEventsAcrossCalendarsParams,
	CalendarEventMutationParams,
	CalendarEventDeleteParams,
	CalendarEventGetParams,
	CalendarEventMoveParams,
	CalendarEventQuickAddParams,
	CalendarAclListParams,
	CalendarFreeBusyParams,
} from './calendar.ts'
export type { DriveSearchParams, DriveFileParams, DriveExportParams } from './drive.ts'
export type { PeopleSearchParams } from './people.ts'
export type {
	YouTubeChannelsParams,
	YouTubeSearchParams,
	YouTubeVideosParams,
	YouTubeCommentThreadsParams,
	YouTubeUploadVideoParams,
	YouTubeUploadVideoResult,
	YouTubeUpdateVideoParams,
	YouTubePrivacyStatus,
} from './youtube.ts'
export type { YouTubeAnalyticsReportParams } from './youtube-analytics.ts'

/** Overview of shared Google product TypeScript param and result types. */
export default function googleProductTypes() {
	return {
		accountAliases: ['personal', 'business', 'youtube-brand', 'youtube-plus'],
		coreTypes: ['GoogleRequestParams', 'GoogleApiErrorDetails', 'UserInfo', 'SmokeTestResult'],
		productParamTypes: [
			'GmailSearchParams',
			'GmailMessageParams',
			'GmailRawMessageMutationParams',
			'GmailComposedMutationParams',
			'GmailReplyDraftParams',
			'GmailModifyMessageParams',
			'CalendarListParams',
			'CalendarGetParams',
			'CalendarEventsParams',
			'CalendarEventsAcrossCalendarsParams',
			'CalendarEventMutationParams',
			'CalendarEventDeleteParams',
			'CalendarEventGetParams',
			'CalendarEventMoveParams',
			'CalendarEventQuickAddParams',
			'CalendarAclListParams',
			'CalendarFreeBusyParams',
			'DriveSearchParams',
			'DriveFileParams',
			'PeopleSearchParams',
			'YouTubeChannelsParams',
			'YouTubeAnalyticsReportParams',
		],
	}
}