diff --git a/src/apps.ts b/src/apps.ts index f1c30ebf6..43c8d705d 100644 --- a/src/apps.ts +++ b/src/apps.ts @@ -32,10 +32,10 @@ export function apps(): apps.Apps { } export namespace apps { - /** @internal */ + /** @hidden */ export const garbageCollectionInterval = 2 * 60 * 1000; - /** @internal */ + /** @hidden */ export function delay(delay: number) { return new Promise((resolve) => { setTimeout(resolve, delay); @@ -51,7 +51,7 @@ export namespace apps { variable?: any; } - /** @internal */ + /** @hidden */ export interface RefCounter { [appName: string]: number; } diff --git a/src/cloud-functions.ts b/src/cloud-functions.ts index e74a23645..686e9e31e 100644 --- a/src/cloud-functions.ts +++ b/src/cloud-functions.ts @@ -29,7 +29,7 @@ const WILDCARD_REGEX = new RegExp('{[^/{}]*}', 'g'); /** * Wire format for an event. - * @internal + * @hidden */ export interface Event { context: { @@ -147,9 +147,7 @@ export namespace Change { ); } - /** - * @internal - */ + /** @hidden */ export function applyFieldMask( sparseBefore: any, after: any, @@ -226,9 +224,7 @@ export type CloudFunction = Runnable & TriggerAnnotated & ((input: any, context?: any) => PromiseLike | any); -/** - * @internal - */ +/** @hidden */ export interface MakeCloudFunctionArgs { after?: (raw: Event) => void; before?: (raw: Event) => void; @@ -248,9 +244,7 @@ export interface MakeCloudFunctionArgs { triggerResource: () => string; } -/** - * @internal - */ +/** @hidden */ export function makeCloudFunction({ after = () => {}, before = () => {}, diff --git a/src/config.ts b/src/config.ts index 1547b7679..9823b3746 100644 --- a/src/config.ts +++ b/src/config.ts @@ -36,11 +36,11 @@ export namespace config { [key: string]: any; } - /** @internal */ + /** @hidden */ export let singleton: config.Config; } -/* @internal */ +/** @hidden */ export function firebaseConfig(): firebase.AppOptions | null { const env = process.env.FIREBASE_CONFIG; if (env) { diff --git a/src/function-builder.ts b/src/function-builder.ts index bdf7f296f..d39dbfbfc 100644 --- a/src/function-builder.ts +++ b/src/function-builder.ts @@ -222,15 +222,11 @@ export class FunctionBuilder { document: (path: string) => firestore._documentWithOptions(path, this.options), - /** - * @internal - */ + /** @hidden */ namespace: (namespace: string) => firestore._namespaceWithOptions(namespace, this.options), - /** - * @internal - */ + /** @hidden */ database: (database: string) => firestore._databaseWithOptions(database, this.options), }; diff --git a/src/handler-builder.ts b/src/handler-builder.ts index 20e15986d..d0e5ac9a7 100644 --- a/src/handler-builder.ts +++ b/src/handler-builder.ts @@ -119,11 +119,11 @@ export class HandlerBuilder { get document() { return new firestore.DocumentBuilder(() => null, {}); }, - /** @internal */ + /** @hidden */ get namespace() { return new firestore.DocumentBuilder(() => null, {}); }, - /** @internal */ + /** @hidden */ get database() { return new firestore.DocumentBuilder(() => null, {}); }, diff --git a/src/providers/analytics.ts b/src/providers/analytics.ts index 3cd5612c5..457307e46 100644 --- a/src/providers/analytics.ts +++ b/src/providers/analytics.ts @@ -30,9 +30,9 @@ import { } from '../cloud-functions'; import { DeploymentOptions } from '../function-configuration'; -/** @internal */ +/** @hidden */ export const provider = 'google.analytics'; -/** @internal */ +/** @hidden */ export const service = 'app-measurement.com'; /** @@ -43,7 +43,7 @@ export function event(analyticsEventType: string) { return _eventWithOptions(analyticsEventType, {}); } -/** @internal */ +/** @hidden */ export function _eventWithOptions( analyticsEventType: string, options: DeploymentOptions @@ -64,7 +64,7 @@ export function _eventWithOptions( * Access via [`functions.analytics.event()`](functions.analytics#event). */ export class AnalyticsEventBuilder { - /** @internal */ + /** @hidden */ constructor( private triggerResource: () => string, private options: DeploymentOptions @@ -136,7 +136,7 @@ export class AnalyticsEvent { /** User-related dimensions. */ user?: UserDimensions; - /** @internal */ + /** @hidden */ constructor(wireFormat: any) { this.params = {}; // In case of absent field, show empty (not absent) map. if (wireFormat.eventDim && wireFormat.eventDim.length > 0) { @@ -200,7 +200,7 @@ export class UserDimensions { /** Information regarding the bundle in which these events were uploaded. */ bundleInfo: ExportBundleInfo; - /** @internal */ + /** @hidden */ constructor(wireFormat: any) { // These are interfaces or primitives, no transformation needed. copyFields(wireFormat, this, [ @@ -242,7 +242,7 @@ export class UserPropertyValue { /** UTC client time when the user property was last set. */ setTime: string; - /** @internal */ + /** @hidden */ constructor(wireFormat: any) { copyField(wireFormat, this, 'value', unwrapValueAsString); copyTimestampToString(wireFormat, this, 'setTimestampUsec', 'setTime'); @@ -381,7 +381,7 @@ export class ExportBundleInfo { /** Timestamp offset (in milliseconds) between collection time and upload time. */ serverTimestampOffset: number; - /** @internal */ + /** @hidden */ constructor(wireFormat: any) { copyField(wireFormat, this, 'bundleSequenceId'); copyTimestampToMillis( diff --git a/src/providers/auth.ts b/src/providers/auth.ts index e775116d2..722410340 100644 --- a/src/providers/auth.ts +++ b/src/providers/auth.ts @@ -30,9 +30,9 @@ import { } from '../cloud-functions'; import { DeploymentOptions } from '../function-configuration'; -/** @internal */ +/** @hidden */ export const provider = 'google.firebase.auth'; -/** @internal */ +/** @hidden */ export const service = 'firebaseauth.googleapis.com'; /** @@ -42,7 +42,7 @@ export function user() { return _userWithOptions({}); } -/** @internal */ +/** @hidden */ export function _userWithOptions(options: DeploymentOptions) { return new UserBuilder(() => { if (!process.env.GCLOUD_PROJECT) { @@ -70,7 +70,7 @@ export class UserBuilder { return userRecordConstructor(raw.data); } - /** @internal */ + /** @hidden */ constructor( private triggerResource: () => string, private options?: DeploymentOptions diff --git a/src/providers/crashlytics.ts b/src/providers/crashlytics.ts index 751e868bd..89701d42f 100644 --- a/src/providers/crashlytics.ts +++ b/src/providers/crashlytics.ts @@ -27,9 +27,9 @@ import { } from '../cloud-functions'; import { DeploymentOptions } from '../function-configuration'; -/** @internal */ +/** @hidden */ export const provider = 'google.firebase.crashlytics'; -/** @internal */ +/** @hidden */ export const service = 'fabric.io'; /** @@ -40,7 +40,7 @@ export function issue() { return _issueWithOptions({}); } -/** @internal */ +/** @hidden */ export function _issueWithOptions(options: DeploymentOptions) { return new IssueBuilder(() => { if (!process.env.GCLOUD_PROJECT) { @@ -52,13 +52,13 @@ export function _issueWithOptions(options: DeploymentOptions) { /** Builder used to create Cloud Functions for Crashlytics issue events. */ export class IssueBuilder { - /** @internal */ + /** @hidden */ constructor( private triggerResource: () => string, private options: DeploymentOptions ) {} - /** @internal */ + /** @hidden */ onNewDetected(handler: any): Error { throw new Error('"onNewDetected" is now deprecated, please use "onNew"'); } diff --git a/src/providers/database.ts b/src/providers/database.ts index 4fb28a2bd..7740a4373 100644 --- a/src/providers/database.ts +++ b/src/providers/database.ts @@ -34,9 +34,9 @@ import { firebaseConfig } from '../config'; import { DeploymentOptions } from '../function-configuration'; import { applyChange, joinPath, normalizePath, pathParts } from '../utils'; -/** @internal */ +/** @hidden */ export const provider = 'google.firebase.database'; -/** @internal */ +/** @hidden */ export const service = 'firebaseio.com'; // NOTE(inlined): Should we relax this a bit to allow staging or alternate implementations of our API? @@ -78,7 +78,7 @@ export function ref(path: string) { return _refWithOptions(path, {}); } -/** @internal */ +/** @hidden */ export function _instanceWithOptions( instance: string, options: DeploymentOptions @@ -87,7 +87,7 @@ export function _instanceWithOptions( } export class InstanceBuilder { - /* @internal */ + /** @hidden */ constructor(private instance: string, private options: DeploymentOptions) {} ref(path: string): RefBuilder { @@ -100,7 +100,7 @@ export class InstanceBuilder { } } -/** @internal */ +/** @hidden */ export function _refWithOptions( path: string, options: DeploymentOptions @@ -131,7 +131,7 @@ export function _refWithOptions( /** Builder used to create Cloud Functions for Firebase Realtime Database References. */ export class RefBuilder { - /** @internal */ + /** @hidden */ constructor( private apps: apps.Apps, private triggerResource: () => string, @@ -238,7 +238,7 @@ export class RefBuilder { } /* Utility function to extract database reference from resource string */ -/** @internal */ +/** @hidden */ export function resourceToInstanceAndPath(resource: string) { const resourceRegex = `projects/([^/]+)/instances/([a-zA-Z0-9\-^/]+)/refs(/.+)?`; const match = resource.match(new RegExp(resourceRegex)); diff --git a/src/providers/firestore.ts b/src/providers/firestore.ts index 923763225..291d7d7f9 100644 --- a/src/providers/firestore.ts +++ b/src/providers/firestore.ts @@ -34,11 +34,11 @@ import { import { dateToTimestampProto } from '../encoder'; import { DeploymentOptions } from '../function-configuration'; -/** @internal */ +/** @hidden */ export const provider = 'google.firestore'; -/** @internal */ +/** @hidden */ export const service = 'firestore.googleapis.com'; -/** @internal */ +/** @hidden */ export const defaultDatabase = '(default)'; let firestoreInstance: any; export type DocumentSnapshot = firebase.firestore.DocumentSnapshot; @@ -53,18 +53,18 @@ export type DocumentSnapshot = firebase.firestore.DocumentSnapshot; export function document(path: string) { return _documentWithOptions(path, {}); } -/** @internal */ +/** @hidden */ // Multiple namespaces are not yet supported by Firestore. export function namespace(namespace: string) { return _namespaceWithOptions(namespace, {}); } -/** @internal */ +/** @hidden */ // Multiple databases are not yet supported by Firestore. export function database(database: string) { return _databaseWithOptions(database, {}); } -/** @internal */ +/** @hidden */ export function _databaseWithOptions( database: string = defaultDatabase, options: DeploymentOptions @@ -72,7 +72,7 @@ export function _databaseWithOptions( return new DatabaseBuilder(database, options); } -/** @internal */ +/** @hidden */ export function _namespaceWithOptions( namespace: string, options: DeploymentOptions @@ -80,13 +80,13 @@ export function _namespaceWithOptions( return _databaseWithOptions(defaultDatabase, options).namespace(namespace); } -/** @internal */ +/** @hidden */ export function _documentWithOptions(path: string, options: DeploymentOptions) { return _databaseWithOptions(defaultDatabase, options).document(path); } export class DatabaseBuilder { - /** @internal */ + /** @hidden */ constructor(private database: string, private options: DeploymentOptions) {} namespace(namespace: string) { @@ -99,7 +99,7 @@ export class DatabaseBuilder { } export class NamespaceBuilder { - /** @internal */ + /** @hidden */ constructor( private database: string, private options: DeploymentOptions, @@ -144,7 +144,7 @@ function _getValueProto(data: any, resource: string, valueFieldName: string) { return proto; } -/** @internal */ +/** @hidden */ export function snapshotConstructor(event: Event): DocumentSnapshot { if (!firestoreInstance) { firestoreInstance = firebase.firestore(apps().admin); @@ -158,7 +158,7 @@ export function snapshotConstructor(event: Event): DocumentSnapshot { return firestoreInstance.snapshot_(valueProto, readTime, 'json'); } -/** @internal */ +/** @hidden */ // TODO remove this function when wire format changes to new format export function beforeSnapshotConstructor(event: Event): DocumentSnapshot { if (!firestoreInstance) { @@ -183,7 +183,7 @@ function changeConstructor(raw: Event) { } export class DocumentBuilder { - /** @internal */ + /** @hidden */ constructor( private triggerResource: () => string, private options: DeploymentOptions diff --git a/src/providers/https.ts b/src/providers/https.ts index 8c25ba82a..e6c8a63f4 100644 --- a/src/providers/https.ts +++ b/src/providers/https.ts @@ -53,7 +53,7 @@ export function onCall( return _onCallWithOptions(handler, {}); } -/** @internal */ +/** @hidden */ export function _onRequestWithOptions( handler: (req: Request, resp: express.Response) => void, options: DeploymentOptions @@ -182,7 +182,7 @@ export class HttpsError extends Error { } /** - * @internal + * @hidden * A string representation of the Google error code for this error for HTTP. */ get status() { @@ -190,7 +190,7 @@ export class HttpsError extends Error { } /** - * @internal + * @hidden * Returns the canonical http status code for the given error. */ get httpStatus(): number { @@ -235,7 +235,7 @@ export class HttpsError extends Error { } } - /** @internal */ + /** @hidden */ public toJSON() { const json: any = { status: this.status, @@ -334,7 +334,7 @@ const UNSIGNED_LONG_TYPE = 'type.googleapis.com/google.protobuf.UInt64Value'; * Encodes arbitrary data in our special format for JSON. * This is exposed only for testing. */ -/** @internal */ +/** @hidden */ export function encode(data: any): any { if (_.isNull(data) || _.isUndefined(data)) { return null; @@ -372,7 +372,7 @@ export function encode(data: any): any { * Decodes our special format for JSON into native types. * This is exposed only for testing. */ -/** @internal */ +/** @hidden */ export function decode(data: any): any { if (data === null) { return data; @@ -412,7 +412,7 @@ export function decode(data: any): any { const corsHandler = cors({ origin: true, methods: 'POST' }); -/** @internal */ +/** @hidden */ export function _onCallWithOptions( handler: (data: any, context: CallableContext) => any | Promise, options: DeploymentOptions diff --git a/src/providers/pubsub.ts b/src/providers/pubsub.ts index 837594b3d..265c39deb 100644 --- a/src/providers/pubsub.ts +++ b/src/providers/pubsub.ts @@ -30,9 +30,9 @@ import { ScheduleRetryConfig, } from '../function-configuration'; -/** @internal */ +/** @hidden */ export const provider = 'google.pubsub'; -/** @internal */ +/** @hidden */ export const service = 'pubsub.googleapis.com'; /** Select Cloud Pub/Sub topic to listen to. @@ -42,7 +42,7 @@ export function topic(topic: string) { return _topicWithOptions(topic, {}); } -/** @internal */ +/** @hidden */ export function _topicWithOptions( topic: string, options: DeploymentOptions @@ -64,7 +64,7 @@ export function schedule(schedule: string): ScheduleBuilder { } export class ScheduleBuilder { - /** @internal */ + /** @hidden */ constructor(private options: DeploymentOptions) {} retryConfig(config: ScheduleRetryConfig): ScheduleBuilder { @@ -97,7 +97,7 @@ export class ScheduleBuilder { } } -/** @internal */ +/** @hidden */ export function _scheduleWithOptions( schedule: string, options: DeploymentOptions @@ -107,7 +107,7 @@ export function _scheduleWithOptions( /** Builder used to create Cloud Functions for Google Pub/Sub topics. */ export class TopicBuilder { - /** @internal */ + /** @hidden */ constructor( private triggerResource: () => string, private options: DeploymentOptions diff --git a/src/providers/remoteConfig.ts b/src/providers/remoteConfig.ts index a43ed9164..cd32e5423 100644 --- a/src/providers/remoteConfig.ts +++ b/src/providers/remoteConfig.ts @@ -29,9 +29,9 @@ import { } from '../cloud-functions'; import { DeploymentOptions } from '../function-configuration'; -/** @internal */ +/** @hidden */ export const provider = 'google.firebase.remoteconfig'; -/** @internal */ +/** @hidden */ export const service = 'firebaseremoteconfig.googleapis.com'; /** @@ -48,7 +48,7 @@ export function onUpdate( return _onUpdateWithOptions(handler, {}); } -/** @internal */ +/** @hidden */ export function _onUpdateWithOptions( handler: ( version: TemplateVersion, @@ -67,7 +67,7 @@ export function _onUpdateWithOptions( /** Builder used to create Cloud Functions for Remote Config. */ export class UpdateBuilder { - /** @internal */ + /** @hidden */ constructor( private triggerResource: () => string, private options: DeploymentOptions diff --git a/src/providers/storage.ts b/src/providers/storage.ts index 2fc705776..93d6b0ed0 100644 --- a/src/providers/storage.ts +++ b/src/providers/storage.ts @@ -28,9 +28,9 @@ import { import { firebaseConfig } from '../config'; import { DeploymentOptions } from '../function-configuration'; -/** @internal */ +/** @hidden */ export const provider = 'google.storage'; -/** @internal */ +/** @hidden */ export const service = 'storage.googleapis.com'; /** @@ -50,7 +50,7 @@ export function object() { return _objectWithOptions({}); } -/** @internal */ +/** @hidden */ export function _bucketWithOptions( options: DeploymentOptions, bucket?: string @@ -71,13 +71,13 @@ export function _bucketWithOptions( return new BucketBuilder(resourceGetter, options); } -/** @internal */ +/** @hidden */ export function _objectWithOptions(options: DeploymentOptions): ObjectBuilder { return _bucketWithOptions(options).object(); } export class BucketBuilder { - /** @internal */ + /** @hidden */ constructor( private triggerResource: () => string, private options: DeploymentOptions @@ -90,13 +90,13 @@ export class BucketBuilder { } export class ObjectBuilder { - /** @internal */ + /** @hidden */ constructor( private triggerResource: () => string, private options: DeploymentOptions ) {} - /** @internal */ + /** @hidden */ onChange(handler: any): Error { throw new Error( '"onChange" is now deprecated, please use "onArchive", "onDelete", ' +