Releases: grahamearley/FirestoreGoogleAppsScript
Version 33: Added Document.path and Tests
- Added
Document.path
property to get the local path of a document from the database. Thanks @juliusn for this! #99 - Updated Tests to check for the above and fix tests that couldn't fail!
- Updated README with a section that denotes all the Document properties.
- Updated dependent packages.
Usage
To utilize the new version:
- Edit your Google Apps Script
- Open
Resources
>Libraries...
from the menu. - Change the version dropdown to
33
next toFirestoreApp
(or whatever name you use locally).
Version 32: Updated Tests and Testing Badge
- Updated Tests badge on README such that clicking on it will rerun the Tests and cache the results properly.
- Cleaned up Tests.ts.
- Silenced npm errors when running "lint" and "fix" scripts.
- Updated dependent packages.
Updates to the Tests file requires a new version for Live Tests to be runnable.
Usage
To utilize the new version:
- Edit your Google Apps Script
- Open
Resources
>Libraries...
from the menu. - Change the version dropdown to
32
next toFirestoreApp
.
Version 31: Bugfix - Nested Objects inside Arrays
- Fixed issue where extracting maps/objects nested within arrays would fail. Thanks @marcolong for bringing up this issue! #95
- Updated Test cases.
Usage
To utilize the new version:
- Edit your Google Apps Script
- Open
Resources
>Libraries...
from the menu. - Change the version dropdown to
31
next toFirestoreApp
.
Version 30: Bugfixes and Markdown Links
- Fixed bug where
.getDocuments
and.query
didn't returnDocument.obj
data. Thanks @tricknotes for the nice find! #94 - Added
.gitattributes
to handle line endings. Again, thanks @tricknotes for bringing this up. #93
Thanks to @tricknotes for these quick finds!
Usage
To utilize the new version:
- Edit your Google Apps Script
- Open
Resources
>Libraries...
from the menu. - Change the version dropdown to
30
next toFirestoreApp
.
Version 29: Test Caching
The new badges from v27 were nice, but the Testing badge wouldn't display. This is because GitHub anonymizes images on the README pages.
This is great, however the service times out after 3 seconds, and the image is dynamically generated after running the tests.. and this took more than 3 seconds.
I took the liberty of running the tests every hour via. Script Trigger and caching the results. This should allow the badge to pull up the cached results and load them onto the README.
No library update is required for this.
Version 28: Date data bugfix
- Fixed a minor issue where
Date
objects created would not be recognized as aDate
object. #86
Thanks to all that brought up the issue and @rielzzapps for narrowing it down.
Usage
To utilize the new version:
- Edit your Google Apps Script
- Open
Resources
>Libraries...
from the menu. - Change the version dropdown to
28
next toFirestoreApp
.
Version 27: V8 Runtime Overhaul
- Converted project to V8 Runtime with Classes. Resolves #83, Resolves #56
- Converted JavaScript to Typescript and create custom typings. Resolves #64
- Added Typings from gapi.client, google-apps-script, and jsonwebtoken.
- Generated typings from Firestore Discovery URL from google-api-typings-generator.
- Created workaround for duplicate "console" definitions.
- Embraced ESLint and Prettier for code style.
- Integrated Unit Tests utilizing GSUnit.
- Added a plethora of badges and updated documentation. :)
Breaking Changes
- Query function names have been capitalized (
Select
,Where
,OrderBy
,Limit
,Offset
,Range
). - All functions return
Document
orDocument[]
types directly from Firebase. Usedocument.obj
to extract the raw object. - Undo breaking change from v23.
document.createTime
anddocument.updateTime
will remain as timestamped strings. Howeverdocument.created
,document.updated
, anddocument.read
areDate
objects.
Usage
To utilize the new version:
- Edit your Google Apps Script
- Open
Resources
>Libraries...
from the menu. - Change the version dropdown to
27
next toFirestoreApp
.
Your project runtime (V8 or Rhino) is independent of this library and they do not have to align for things to run.
Version 26: Create Document Bugfix
The Firebase API's PATCH endpoint to update documents does not handle the creation of documents with dynamic names.
This issue has been solved in v26, and now correctly creates documents when a document name is omitted from the path
in .createDocument(path, fields)
function.
Collections and documents with special characters are still created properly.
v25 has been removed from the Apps Script Library.
Version 25: Firebase Naming Stability
This release allows for virtually any Collection, Document, and Field names can be utilized. International characters and most symbols are supported.
Since API projects.databases.documents/createDocument does not properly handle escaped document names, document creation is handled by the patch endpoint.
Field names have been internally wrapped with the backtick (`
) character as recommended.
If any characters are found to not be handled properly, please create an issue with the character(s) to address.
Version 24: Firebase v1 API Support
The Firebase REST API has been updated with 3 available versions. This application originally supported "v1beta1", and now supports "v1beta2" and "v1".
- To start utilizing another version (such as "v1") update your initial constructor to:
FirestoreApp.getFirestore(email, key, projectId, "v1");
- If version is omitted, it defaults to "v1beta1". This will change in the future.
- v1 supports to utilization of the new
.query().filter()
operators: "IN" and "Contains_Any" (case-insensitive).
The .getDocuments()
function now allows for an optional second parameter to only select specific documents by name.
const someDocuments = firestore.getDocuments("FirstCollection", ["Doc1", "Doc2", "Doc3"]);
Thanks to @ken-prayogo for the feature request. #79