Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -51,7 +51,7 @@ export namespace apps {
variable?: any;
}

/** @internal */
/** @hidden */
export interface RefCounter {
[appName: string]: number;
}
Expand Down
14 changes: 4 additions & 10 deletions src/cloud-functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const WILDCARD_REGEX = new RegExp('{[^/{}]*}', 'g');

/**
* Wire format for an event.
* @internal
* @hidden
*/
export interface Event {
context: {
Expand Down Expand Up @@ -147,9 +147,7 @@ export namespace Change {
);
}

/**
* @internal
*/
/** @hidden */
export function applyFieldMask(
sparseBefore: any,
after: any,
Expand Down Expand Up @@ -226,9 +224,7 @@ export type CloudFunction<T> = Runnable<T> &
TriggerAnnotated &
((input: any, context?: any) => PromiseLike<any> | any);

/**
* @internal
*/
/** @hidden */
export interface MakeCloudFunctionArgs<EventData> {
after?: (raw: Event) => void;
before?: (raw: Event) => void;
Expand All @@ -248,9 +244,7 @@ export interface MakeCloudFunctionArgs<EventData> {
triggerResource: () => string;
}

/**
* @internal
*/
/** @hidden */
export function makeCloudFunction<EventData>({
after = () => {},
before = () => {},
Expand Down
4 changes: 2 additions & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
8 changes: 2 additions & 6 deletions src/function-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
};
Expand Down
4 changes: 2 additions & 2 deletions src/handler-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, {});
},
Expand Down
16 changes: 8 additions & 8 deletions src/providers/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

/**
Expand All @@ -43,7 +43,7 @@ export function event(analyticsEventType: string) {
return _eventWithOptions(analyticsEventType, {});
}

/** @internal */
/** @hidden */
export function _eventWithOptions(
analyticsEventType: string,
options: DeploymentOptions
Expand All @@ -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
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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, [
Expand Down Expand Up @@ -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');
Expand Down Expand Up @@ -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(
Expand Down
8 changes: 4 additions & 4 deletions src/providers/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

/**
Expand All @@ -42,7 +42,7 @@ export function user() {
return _userWithOptions({});
}

/** @internal */
/** @hidden */
export function _userWithOptions(options: DeploymentOptions) {
return new UserBuilder(() => {
if (!process.env.GCLOUD_PROJECT) {
Expand Down Expand Up @@ -70,7 +70,7 @@ export class UserBuilder {
return userRecordConstructor(raw.data);
}

/** @internal */
/** @hidden */
constructor(
private triggerResource: () => string,
private options?: DeploymentOptions
Expand Down
10 changes: 5 additions & 5 deletions src/providers/crashlytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

/**
Expand All @@ -40,7 +40,7 @@ export function issue() {
return _issueWithOptions({});
}

/** @internal */
/** @hidden */
export function _issueWithOptions(options: DeploymentOptions) {
return new IssueBuilder(() => {
if (!process.env.GCLOUD_PROJECT) {
Expand All @@ -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"');
}
Expand Down
14 changes: 7 additions & 7 deletions src/providers/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down Expand Up @@ -78,7 +78,7 @@ export function ref(path: string) {
return _refWithOptions(path, {});
}

/** @internal */
/** @hidden */
export function _instanceWithOptions(
instance: string,
options: DeploymentOptions
Expand All @@ -87,7 +87,7 @@ export function _instanceWithOptions(
}

export class InstanceBuilder {
/* @internal */
/** @hidden */
constructor(private instance: string, private options: DeploymentOptions) {}

ref(path: string): RefBuilder {
Expand All @@ -100,7 +100,7 @@ export class InstanceBuilder {
}
}

/** @internal */
/** @hidden */
export function _refWithOptions(
path: string,
options: DeploymentOptions
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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));
Expand Down
26 changes: 13 additions & 13 deletions src/providers/firestore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -53,40 +53,40 @@ 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
) {
return new DatabaseBuilder(database, options);
}

/** @internal */
/** @hidden */
export function _namespaceWithOptions(
namespace: string,
options: DeploymentOptions
) {
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) {
Expand All @@ -99,7 +99,7 @@ export class DatabaseBuilder {
}

export class NamespaceBuilder {
/** @internal */
/** @hidden */
constructor(
private database: string,
private options: DeploymentOptions,
Expand Down Expand Up @@ -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);
Expand All @@ -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) {
Expand All @@ -183,7 +183,7 @@ function changeConstructor(raw: Event) {
}

export class DocumentBuilder {
/** @internal */
/** @hidden */
constructor(
private triggerResource: () => string,
private options: DeploymentOptions
Expand Down
Loading