Skip to content

Commit aba1efe

Browse files
author
Patryk Lesiewicz
committed
Merge remote-tracking branch 'origin/next' into patryk/cnt-docs
2 parents 4952a8b + a115522 commit aba1efe

File tree

48 files changed

+658
-450
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+658
-450
lines changed

auth-mailchimp-sync/POSTINSTALL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ You can test out this extension right away:
66

77
1. Click **Add User** to add a test user.
88

9-
1. In a few seconds, go to your Mailchimp audience page, you'll see the test user's email appear in the list.
9+
1. In a few seconds, go to your Mailchimp audience page, you'll see the test user's email appear.
1010

1111
### Using the extension
1212

auth-mailchimp-sync/PREINSTALL.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,15 @@ This extension adds the email address of each new user to your specified Mailchi
66

77
This extension uses Mailchimp, so you'll need to supply your Mailchimp API Key and Audience ID when installing this extension.
88

9-
### Additional setup
9+
#### Additional setup
1010

1111
Make sure that you've set up [Firebase Authentication](https://firebase.google.com/docs/auth) to manage your users.
1212

1313
You must also have a Mailchimp account before installing this extension.
1414

15-
### Billing
15+
#### Billing
1616

1717
This extension uses other Firebase or Google Cloud Platform services which may have associated charges:
18-
1918
- Firebase Realtime Database
2019
- Cloud Functions
2120

auth-mailchimp-sync/functions/lib/logs.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ exports.complete = () => {
2121
console.log("Completed execution of extension");
2222
};
2323
exports.errorAddUser = (err) => {
24-
console.error("Error when adding user to Mailchimp list", err);
24+
console.error("Error when adding user to Mailchimp audience", err);
2525
};
2626
exports.errorRemoveUser = (err) => {
27-
console.error("Error when removing user from Mailchimp list", err);
27+
console.error("Error when removing user from Mailchimp audience", err);
2828
};
2929
exports.init = () => {
3030
console.log("Initializing extension with configuration", obfuscatedConfig);

auth-mailchimp-sync/functions/src/logs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ export const complete = () => {
2626
};
2727

2828
export const errorAddUser = (err: Error) => {
29-
console.error("Error when adding user to Mailchimp list", err);
29+
console.error("Error when adding user to Mailchimp audience", err);
3030
};
3131

3232
export const errorRemoveUser = (err: Error) => {
33-
console.error("Error when removing user from Mailchimp list", err);
33+
console.error("Error when removing user from Mailchimp audience", err);
3434
};
3535

3636
export const init = () => {

delete-user-data/PREINSTALL.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,15 @@ You can configure this extension to delete user data from any or all of the foll
66

77
This extension is useful in respecting user privacy and fulfilling compliance requirements. However, using this extension does not guarantee compliance with government and industry regulations.
88

9-
### Additional setup
9+
#### Additional setup
1010

1111
Depending on where you'd like to delete user data from, make sure that you've set up [Cloud Firestore](https://firebase.google.com/docs/firestore), [Realtime Database](https://firebase.google.com/docs/database), or [Cloud Storage](https://firebase.google.com/docs/storage) in your Firebase project before installing this extension.
1212

1313
Also, make sure that you've set up [Firebase Authentication](https://firebase.google.com/docs/auth) to manage your users.
1414

15-
### Billing
15+
#### Billing
1616

1717
This extension uses other Firebase or Google Cloud Platform services which may have associated charges:
18-
1918
- Cloud Firestore
2019
- Firebase Realtime Database
2120
- Cloud Storage

delete-user-data/functions/lib/index.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,6 @@ const clearStorageData = (storagePaths, uid) => __awaiter(this, void 0, void 0,
109109
logs.storageDeleted();
110110
});
111111
const clearFirestoreData = (firestorePaths, uid) => __awaiter(this, void 0, void 0, function* () {
112-
// admin.firestore().settings({
113-
// timestampsInSnapshots: true,
114-
// });
115112
logs.firestoreDeleting();
116113
const paths = extractUserPaths(firestorePaths, uid);
117114
const promises = paths.map((path) => __awaiter(this, void 0, void 0, function* () {

delete-user-data/functions/src/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,6 @@ const clearStorageData = async (storagePaths: string, uid: string) => {
112112
};
113113

114114
const clearFirestoreData = async (firestorePaths: string, uid: string) => {
115-
// admin.firestore().settings({
116-
// timestampsInSnapshots: true,
117-
// });
118115
logs.firestoreDeleting();
119116

120117
const paths = extractUserPaths(firestorePaths, uid);

firestore-bigquery-export/POSTINSTALL.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ You can test out this extension right away:
1313
1. Query your **raw changelog table**, which should contain a single log of creating the `bigquery-mirror-test` document.
1414

1515
```
16-
SELECT * FROM `${param:PROJECT_ID}.${param:DATASET_ID}.${param:COLLECTION_PATH}_raw_changelog`
16+
SELECT * FROM `${param:PROJECT_ID}.${param:DATASET_ID}.${param:TABLE_ID}_raw_changelog`
1717
```
1818
1919
1. Query your **latest view**, which should return the latest change event for the only document present -- `bigquery-mirror-test`.
2020
2121
```
22-
SELECT * FROM `${param:PROJECT_ID}.${param:DATASET_ID}.${param:COLLECTION_PATH}_raw_latest`
22+
SELECT * FROM `${param:PROJECT_ID}.${param:DATASET_ID}.${param:TABLE_ID}_raw_latest`
2323
```
2424
2525
1. Delete the `bigquery-mirror-test` document from [Cloud Firestore](https://console.firebase.google.com/project/${param:PROJECT_ID}/database/firestore/data).
@@ -28,7 +28,7 @@ The `bigquery-mirror-test` document will disappear from the **latest view** and
2828
1. You can check the changelogs of a single document with this query:
2929
3030
```
31-
SELECT * FROM `${param:PROJECT_ID}.${param:DATASET_ID}.${param:COLLECTION_PATH}_raw_changelog`
31+
SELECT * FROM `${param:PROJECT_ID}.${param:DATASET_ID}.${param:TABLE_ID}_raw_changelog`
3232
WHERE document_name = "bigquery-mirror-test"
3333
ORDER BY TIMESTAMP ASC
3434
```
@@ -37,12 +37,12 @@ The `bigquery-mirror-test` document will disappear from the **latest view** and
3737
3838
Whenever a document is created, updated, imported, or deleted in the specified collection, this extension sends that update to BigQuery. You can then run queries on this mirrored dataset which contains the following resources:
3939
40-
+ **raw changelog table:** [`${param:DATASET_ID}_raw_changelog`](https://console.cloud.google.com/bigquery?project=${param:PROJECT_ID}&p=${param:PROJECT_ID}&d=${param:DATASET_ID}&t=${param:COLLECTION_PATH}_raw_changelog&page=table)
41-
+ **latest view:** [`${param:DATASET_ID}_raw_latest`](https://console.cloud.google.com/bigquery?project=${param:PROJECT_ID}&p=${param:PROJECT_ID}&d=${param:DATASET_ID}&t=${param:COLLECTION_PATH}_raw_latest&page=table)
40+
+ **raw changelog table:** [`${param:TABLE_ID}_raw_changelog`](https://console.cloud.google.com/bigquery?project=${param:PROJECT_ID}&p=${param:PROJECT_ID}&d=${param:DATASET_ID}&t=${param:TABLE_ID}_raw_changelog&page=table)
41+
+ **latest view:** [`${param:TABLE_ID}_raw_latest`](https://console.cloud.google.com/bigquery?project=${param:PROJECT_ID}&p=${param:PROJECT_ID}&d=${param:DATASET_ID}&t=${param:TABLE_ID}_raw_latest&page=table)
4242
4343
To review the schema for these two resources, click the **Schema** tab for each resource in BigQuery.
4444
45-
Note that this extension only listens for _document_ changes in the collection, but not changes in any _subcollection_. You can, though, install additional instances of this extension to specifically listen to a subcollection or other collections in your database.
45+
Note that this extension only listens for _document_ changes in the collection, but not changes in any _subcollection_. You can, though, install additional instances of this extension to specifically listen to a subcollection or other collections in your database. Or if you have the same subcollection across documents in a given collection, you can use `{wildcard}` notation to listen to all those subcollections (for example: `chats/{chatid}/posts`).
4646
4747
### _(Optional)_ Import existing documents
4848

firestore-bigquery-export/PREINSTALL.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,28 @@
11
Use this extension to export the documents in a Cloud Firestore collection to BigQuery. Exports are realtime and incremental, so the data in BigQuery is a mirror of your content in Cloud Firestore.
22

33
The extension creates and updates a [dataset](https://cloud.google.com/bigquery/docs/datasets-intro) containing the following two BigQuery resources:
4-
54
+ A [table](https://cloud.google.com/bigquery/docs/tables-intro) of raw data that stores a full change history of the documents within your collection. This table includes a number of metadata fields so that BigQuery can display the current state of your data. The principle metadata fields are `timestamp`, `document_name`, and the `operation` for the document change.
65
+ A [view](https://cloud.google.com/bigquery/docs/views-intro) which represents the current state of the data within your collection. It also shows a log of the latest `operation` for each document (`CREATE`, `UPDATE`, or `IMPORT`).
76

87
Whenever a document is created, updated, deleted, or imported in the specified collection, this extension sends that update to BigQuery. You can then run queries on this mirrored dataset.
98

10-
Note that this extension only listens for _document_ changes in the collection, but not changes in any _subcollection_. You can, though, install additional instances of this extension to specifically listen to a subcollection or other collections in your database.
9+
Note that this extension only listens for _document_ changes in the collection, but not changes in any _subcollection_. You can, though, install additional instances of this extension to specifically listen to a subcollection or other collections in your database. Or if you have the same subcollection across documents in a given collection, you can use `{wildcard}` notation to listen to all those subcollections (for example: `chats/{chatid}/posts`).
1110

12-
### Additional setup
11+
#### Additional setup
1312

1413
Before installing this extension, you'll need to:
15-
1614
+ [Set up Cloud Firestore in your Firebase project.](https://firebase.google.com/docs/firestore/quickstart)
1715
+ [Link your Firebase project to BigQuery.](https://support.google.com/firebase/answer/6318765)
1816

19-
#### Import existing documents
20-
2117
This extension only sends the content of documents that have been changed -- it does not export your full dataset of existing documents into BigQuery. So, to backfill your BigQuery dataset with all the documents in your collection, you can run the import script provided by this extension.
2218

2319
**Important:** Run the script over the entire collection _after_ installing this extension, otherwise all writes to your database during the import might be lost.
2420

2521
Learn more about using this script to [backfill your existing collection](https://dev-partners.googlesource.com/samples/firebase/mods/+/master/firestore-bigquery-export/guides/IMPORT_EXISTING_DOCUMENTS.md).
2622

27-
### Billing
23+
#### Billing
2824

2925
This extension uses other Firebase or Google Cloud Platform services which may have associated charges:
30-
3126
+ Cloud Firestore
3227
+ BigQuery
3328
+ Cloud Functions

firestore-bigquery-export/extension.yaml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,11 @@ params:
8585
type: string
8686
label: Collection path
8787
description: >-
88-
What is the path of the collection that you would like to export?
89-
default: extensions
90-
example: extensions
88+
What is the path of the collection that you would like to export?
89+
You may use `{wildcard}` notation to match a subcollection of all documents in a collection
90+
(for example: `chatrooms/{chatid}/posts`).
91+
default: posts
92+
example: posts
9193
validationRegex: "^[^/]+(/[^/]+/[^/]+)*$"
9294
validationErrorMessage: Must be a valid Cloud Firestore collection
9395
required: true
@@ -98,10 +100,25 @@ params:
98100
description: >-
99101
What ID would you like to use for your BigQuery dataset? This
100102
extension will create the dataset, if it doesn't already exist.
101-
validationRegex: ^[a-zA-Z0-9_]+$
103+
validationRegex: "^[a-zA-Z0-9_]+$"
102104
validationErrorMessage: >
103-
Dataset IDs must be alphanumeric (plus underscores) and must be no more than
105+
BigQuery dataset IDs must be alphanumeric (plus underscores) and must be no more than
104106
1024 characters.
105-
default: exported_collection
106-
example: exported_collection
107+
default: firestore_export
108+
example: firestore_export
109+
required: true
110+
111+
- param: TABLE_ID
112+
type: string
113+
label: Table ID
114+
description: >-
115+
What identifying prefix would you like to use for your table and view
116+
inside your BigQuery dataset? This extension will create the table and view,
117+
if they don't already exist.
118+
validationRegex: "^[a-zA-Z0-9_]+$"
119+
validationErrorMessage: >
120+
BigQuery table IDs must be alphanumeric (plus underscores) and must be no more than
121+
1024 characters.
122+
default: posts
123+
example: posts
107124
required: true

0 commit comments

Comments
 (0)