Skip to content

Commit

Permalink
@invertase/release-july-20-23
Browse files Browse the repository at this point in the history
  • Loading branch information
dackers86 authored Jul 24, 2023
2 parents 8705822 + d4d43f4 commit 46636f4
Show file tree
Hide file tree
Showing 42 changed files with 4,384 additions and 17,873 deletions.
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
name: ⚠️ Report a Bug
about: Think you found a bug in an extension? Report it here.
title: "\U0001F41B [EXTENSION_NAME_HERE] Your issue title here"
labels: "type: bug"
---

<!-- DO NOT DELETE
Expand Down
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/fr.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
name: 💡 Feature Request
about: Have a feature you'd like to see in an extension? Request it here.
title: "\U0001F41B [EXTENSION_NAME_HERE] Your request title here"
labels: "type: feature request"
---

<!-- DO NOT DELETE
Expand Down
10 changes: 10 additions & 0 deletions _emulator/extensions/firestore-bigquery-export.env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
BIGQUERY_PROJECT_ID=dev-extensions-testing
COLLECTION_PATH=posts
DATASET_ID=firestore_export
DATASET_LOCATION=us-central1
firebaseextensions.v1beta.function/location=us-central1
TABLE_ID=bq_e2e_test
TABLE_PARTITIONING=HOUR
TIME_PARTITIONING_FIELD_TYPE=omit
USE_NEW_SNAPSHOT_QUERY_SYNTAX=yes
WILDCARD_IDS=false
3 changes: 2 additions & 1 deletion _emulator/firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"firestore-send-email": "../firestore-send-email",
"delete-user-data": "../delete-user-data",
"storage-resize-images": "../storage-resize-images",
"firestore-counter": "../firestore-counter"
"firestore-counter": "../firestore-counter",
"firestore-bigquery-export": "../firestore-bigquery-export"
},
"storage": {
"rules": "storage.rules"
Expand Down
4 changes: 4 additions & 0 deletions auth-mailchimp-sync/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Version 0.2.5

feature - Added lifecycle events

## Version 0.2.4

feature - bump to node 18
Expand Down
6 changes: 5 additions & 1 deletion auth-mailchimp-sync/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,14 @@ Usage of this extension also requires you to have a Mailchimp account. You are r

* Contact status: When the extension adds a new user to the Mailchimp audience, what is their initial status? This value can be `subscribed` or `pending`. `subscribed` means the user can receive campaigns; `pending` means the user still needs to opt-in to receive campaigns.

* Import existing users into Mailchimp audience: Do you want to add existing users to the Mailchimp audience?



**Cloud Functions:**

* **addUserToList:** Listens for new user accounts (as managed by Firebase Authentication), then automatically adds the new user to your specified MailChimp audience.

* **removeUserFromList:** Listens for existing user accounts to be deleted (as managed by Firebase Authentication), then automatically removes them from your specified MailChimp audience.
* **removeUserFromList:** Listens for existing user accounts to be deleted (as managed by Firebase Authentication), then automatically removes them from your specified Mailchimp audience.

* **addExistingUsersToList:** Adds existing users into the specified Mailchimp audience.
37 changes: 35 additions & 2 deletions auth-mailchimp-sync/extension.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

name: auth-mailchimp-sync
version: 0.2.4
version: 0.2.5
specVersion: v1beta

displayName: Sync with Mailchimp
Expand Down Expand Up @@ -41,6 +41,10 @@ contributors:

billingRequired: true

roles:
- role: firebaseauth.viewer
reason: Allows the extension to read existing users while handling lifecycle events.

resources:
- name: addUserToList
type: firebaseextensions.v1beta.function
Expand All @@ -58,12 +62,20 @@ resources:
description:
Listens for existing user accounts to be deleted (as managed by Firebase
Authentication), then automatically removes them from your specified
MailChimp audience.
Mailchimp audience.
properties:
runtime: nodejs18
eventTrigger:
eventType: providers/firebase.auth/eventTypes/user.delete
resource: projects/${param:PROJECT_ID}

- name: addExistingUsersToList
type: firebaseextensions.v1beta.function
description:
Adds existing users into the specified Mailchimp audience.
properties:
runtime: nodejs18
taskQueueTrigger: {}

params:
- param: MAILCHIMP_API_KEY
Expand Down Expand Up @@ -101,3 +113,24 @@ params:
value: pending
default: subscribed
required: true

- param: DO_BACKFILL
label: Import existing users into Mailchimp audience
description: >-
Do you want to add existing users to the Mailchimp audience when you install or update this extension?
type: select
required: true
options:
- label: Yes
value: true
- label: No
value: false


lifecycleEvents:
onInstall:
function: addExistingUsersToList
processingMessage: "Adding existing users to Mailchimp audience"
onUpdate:
function: addExistingUsersToList
processingMessage: "Adding existing users to Mailchimp audience"
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

exports[`extension functions configuration detected from environment variables 1`] = `
Object {
"doBackfill": false,
"location": "europe-west2",
"mailchimpApiKey": "123456-789",
"mailchimpAudienceId": "123456789",
Expand Down
8 changes: 8 additions & 0 deletions auth-mailchimp-sync/functions/__tests__/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"outDir": "lib",
"target": "ES2020"
},
"include": ["**/*"]
}
23 changes: 23 additions & 0 deletions auth-mailchimp-sync/functions/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,33 @@ module.exports = {
name: packageJson.name,
displayName: packageJson.name,
rootDir: "./",
globals: {
"ts-jest": {
tsConfig: "<rootDir>/__tests__/tsconfig.json",
},
},
testEnvironment: "node",
preset: "ts-jest",
globalSetup: "./jest.setup.js",
globalTeardown: "./jest.teardown.js",
moduleNameMapper: {
"firebase-admin/app": "<rootDir>/node_modules/firebase-admin/lib/app",
"firebase-admin/eventarc":
"<rootDir>/node_modules/firebase-admin/lib/eventarc",
"firebase-admin/database":
"<rootDir>/node_modules/firebase-admin/lib/database",
"firebase-admin/auth": "<rootDir>/node_modules/firebase-admin/lib/auth",
"firebase-functions/encoder":
"<rootDir>/node_modules/firebase-functions/lib/encoder",
"firebase-admin/database":
"<rootDir>/node_modules/firebase-admin/lib/database",
"firebase-functions/lib/encoder":
"<rootDir>/node_modules/firebase-functions-test/lib/providers/firestore.js",
"firebase-admin/firestore":
"<rootDir>/node_modules/firebase-functions/lib/v1/providers/firestore.js",
"firebase-admin/extensions":
"<rootDir>/node_modules/firebase-admin/lib/extensions",
"firebase-admin/functions":
"<rootDir>/node_modules/firebase-admin/lib/functions",
},
};
Loading

0 comments on commit 46636f4

Please sign in to comment.