Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Credentials to JSDoc #399

Merged
merged 4 commits into from
Oct 17, 2018
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
24 changes: 18 additions & 6 deletions dev/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,25 @@ export class Firestore {

/**
* @param {Object=} settings [Configuration object](#/docs).
* @param {string=} settings.projectId The Firestore Project ID. Can be
* omitted in environments that support `Application Default Credentials`
* {@see https://cloud.google.com/docs/authentication}
* @param {string=} settings.projectId The project ID from the Google
* Developer's Console, e.g. 'grape-spaceship-123'. We will also check the
* environment variable GCLOUD_PROJECT for your project ID. Can be omitted in
* environments that support
* {@link https://cloud.google.com/docs/authentication Application Default
* Credentials}
* @param {string=} settings.keyFilename Local file containing the Service
* Account credentials. Can be omitted in environments that support
* `Application Default Credentials`
* {@see https://cloud.google.com/docs/authentication}
* Account credentials as downloaded from the Google Developers Console. Can
* be omitted in environments that support
* {@link https://cloud.google.com/docs/authentication Application Default
* Credentials}. To configure Firestore with custom credentials, use
* `settings.credentials` and provide the `client_email` and `private_key` of
* your service account.
* @param {{client_email:string=, private_key:string=}=} settings.credentials
* The `client_email` and `private_key` properties of the service account
* to use with your Firestore project. Can be omitted in environments that
* support {@link https://cloud.google.com/docs/authentication Application
* Default Credentials}. If your credentials are stored in a JSON file, you
* can specify a `keyFilename` instead.
* @param {boolean=} settings.timestampsInSnapshots Enables the use of
* `Timestamp`s for timestamp fields in `DocumentSnapshots`.<br/>
* Currently, Firestore returns timestamp fields as `Date` but `Date` only
Expand Down
25 changes: 20 additions & 5 deletions types/firestore.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,33 @@ declare namespace FirebaseFirestore {
*/
export interface Settings {
/**
* The Firestore Project ID. Can be omitted in environments that support
* `Application Default Credentials` {@see https://cloud.google.com/docs/authentication}
* The project ID from the Google Developer's Console, e.g.
* 'grape-spaceship-123'. We will also check the environment variable
* GCLOUD_PROJECT for your project ID. Can be omitted in environments that
* support {@link https://cloud.google.com/docs/authentication Application
* Default Credentials}
*/
projectId?: string;

/**
* Local file containing the Service Account credentials. Can be omitted
* in environments that support `Application Default Credentials`
* {@see https://cloud.google.com/docs/authentication}
* Local file containing the Service Account credentials as downloaded from
* the Google Developers Console. Can be omitted in environments that
* support {@link https://cloud.google.com/docs/authentication Application
* Default Credentials}. To configure Firestore with custom credentials, use
* the `credentials` property to provide the `client_email` and
* `private_key` of your service account.
*/
keyFilename?: string;

/**
* The 'client_email' and 'private_key' properties of the service account
* to use with your Firestore project. Can be omitted in environments that
* support {@link https://cloud.google.com/docs/authentication Application
* Default Credentials}. If your credentials are stored in a JSON file, you
* can specify a `keyFilename` instead.
*/
credentials?: {client_email?:string, private_key?:string};

/**
* Enables the use of `Timestamp`s for timestamp fields in
* `DocumentSnapshot`s.
Expand Down