Skip to content

Commit 131f918

Browse files
authored
Merge branch 'master' into master
2 parents 459d425 + f4b4baa commit 131f918

17 files changed

+227
-81
lines changed

.claspignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
LICENSE
22
!appsscript.json
3-
*.md
3+
*.md
4+
package*.json
File renamed without changes.

CONTRIBUTING.md renamed to .github/CONTRIBUTING.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ Contributions are welcome! To contribute, fork this repository and create a pull
77

88
#### Checklist for your code
99
* Have you tested the code yourself?
10+
* Install [clasp](https://developers.google.com/apps-script/guides/clasp) `npm install --global @google/clasp`
11+
* Log into your Google Account `clasp login`
12+
* Create/Clone Apps Script Project
13+
* Create a Test.js file which creates a Firestore instance (via. `getFirestore()`)
14+
* Debug/Test your code against your database
1015
* Have you [documented your functions and their parameters and return values with JSDoc](http://usejsdoc.org/about-getting-started.html)?
1116
* Have you made all functions that an end user of the library should not see private? (You can make a function private by adding `_` to the end of its name, as in `publicFunction()` and `privateFunction_()`).
17+
* Add new "global" functions to `package.json`
1218
* Does your code follow the [Standard Javascript Style Guide](https://github.com/standard/standard)?
19+
* Install [standard](https://github.com/standard/standard) `npm install --global standard`
20+
* Check code against rules `standard --verbose`
21+
* Autofix most issues `standard --fix`

LICENSE renamed to .github/LICENSE

File renamed without changes.

PULL_REQUEST_TEMPLATE.md renamed to .github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ Hi! Thanks for creating a pull request.
22

33
Please make sure you have read the [Contributing](https://github.com/grahamearley/FirestoreGoogleAppsScript/blob/master/CONTRIBUTING.md) guidelines before submitting.
44

5-
(You can delete this text).
5+
(You can delete this text).

README.md renamed to .github/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Firestore for Google Apps Scripts
2+
3+
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
4+
25
### A Google Apps Script library for accessing Google Cloud Firestore.
36

7+
48
This library allows a user (or service account) to authenticate with Firestore and edit their Firestore database within a Google Apps Script.
59

610
Read how this project was started [here](http://grahamearley.website/blog/2017/10/18/firestore-in-google-apps-script.html).

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
gapps.config.json
22
appsscript.json
33
.clasp.json
4+
.vs

Authenticate.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* eslint no-unused-vars: ["error", { "varsIgnorePattern": "_" }] */
2-
/* global FirestoreRequest_, Utilities, base64EncodeSafe_ */
2+
/* eslint quote-props: ["error", "always"] */
33

44
/**
55
* Auth token is formatted to {@link https://developers.google.com/identity/protocols/OAuth2ServiceAccount#authorizingrequests}
@@ -14,7 +14,7 @@ function getAuthToken_ (email, key, authUrl) {
1414
const jwt = createJwt_(email, key, authUrl)
1515

1616
var options = {
17-
payload: 'grant_type=' + decodeURIComponent('urn:ietf:params:oauth:grant-type:jwt-bearer') + '&assertion=' + jwt
17+
'payload': 'grant_type=' + decodeURIComponent('urn:ietf:params:oauth:grant-type:jwt-bearer') + '&assertion=' + jwt
1818
}
1919
const responseObj = new FirestoreRequest_(authUrl, null, options).post()
2020
return responseObj.access_token

Delete.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* Delete the Firestore document at the given path.
55
* Note: this deletes ONLY this document, and not any subcollections.
66
*
7+
* @private
78
* @param {string} path the path to the document to delete
89
* @param {string} request the Firestore Request object to manipulate
910
* @return {object} the JSON response from the DELETE request

Firestore.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/* eslint no-unused-vars: ["error", { "varsIgnorePattern": "_|Fire|get" }] */
2-
/* globals FirestoreRequest_, createDocument_, deleteDocument_, getAuthToken_, getDocument_, getDocumentIds_, query_, updateDocument_ */
32

43
/**
54
* Get an object that acts as an authenticated interface with a Firestore project.

0 commit comments

Comments
 (0)