Skip to content

Commit

Permalink
Add Credentials to JSDoc
Browse files Browse the repository at this point in the history
  • Loading branch information
schmidt-sebastian committed Oct 17, 2018
1 parent df6c40b commit 0fa908d
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 18 deletions.
31 changes: 18 additions & 13 deletions dev/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,20 +235,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}. If your credentials
* are not stored on disk, you can use `settings.credentials` to just provide
* the 'client_email' and 'private_key' of your service account.
* @param {{client_email:string, private_key:string}} settings.credentials Local file containing the Service
* Account credentials. Can be omitted in environments that support
* `Application Default Credentials`.
* {@see https://cloud.google.com/docs/authentication}. If your credentials
* are stored in a JSON file, you can load them using `settings.keyFilename`.
* 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}. If your credentials are not stored on disk, you can use
* `settings.credentials` to 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}. If your credentials are not stored on disk, you can use
* `credentials` 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

0 comments on commit 0fa908d

Please sign in to comment.