@edgedev/firebase 1.9.3 → 1.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/functions.js +0 -1
- package/src/postinstall.sh +6 -6
package/package.json
CHANGED
package/src/functions.js
CHANGED
|
@@ -128,7 +128,6 @@ exports.updateUser = functions.firestore.document('staged-users/{docId}').onUpda
|
|
|
128
128
|
return shouldProcess(eventRef).then((process) => {
|
|
129
129
|
if (process) {
|
|
130
130
|
// Note: we can trust on newData.uid because we are checking in rules that it matches the auth.uid
|
|
131
|
-
// TODO: user might be invited to join another org with reg code.. if used when logged will combine new staged-user doc into first stage-user doc and sync to users.
|
|
132
131
|
if (newData.userId) {
|
|
133
132
|
const userRef = db.collection('users').doc(newData.userId)
|
|
134
133
|
setUser(userRef, newData, oldData, stagedDocId).then(() => {
|
package/src/postinstall.sh
CHANGED
|
@@ -22,12 +22,12 @@ awk '/\/\/ #EDGE FIREBASE RULES START/,/\/\/ #EDGE FIREBASE RULES END/' ./src/fi
|
|
|
22
22
|
sed -e '1s/^/\/\/ #EDGE FIREBASE RULES START\n/' -e '$s/$/\n\/\/ #EDGE FIREBASE RULES END/' \
|
|
23
23
|
>> "$project_root/firestore.rules";
|
|
24
24
|
|
|
25
|
-
if [ ! -f
|
|
26
|
-
mkdir -p
|
|
27
|
-
echo "const functions = require('firebase-functions');" >
|
|
28
|
-
echo "const admin = require('firebase-admin');" >>
|
|
29
|
-
echo "admin.initializeApp();" >>
|
|
30
|
-
echo "const db = admin.firestore();" >>
|
|
25
|
+
if [ ! -f "$project_root/functions/index.js" ]; then
|
|
26
|
+
mkdir -p "$project_root/functions"
|
|
27
|
+
echo "const functions = require('firebase-functions');" > "$project_root/functions/index.js";
|
|
28
|
+
echo "const admin = require('firebase-admin');" >> "$project_root/functions/index.js";
|
|
29
|
+
echo "admin.initializeApp();" >> "$project_root/functions/index.js";
|
|
30
|
+
echo "const db = admin.firestore();" >> "$project_root/functions/index.js";
|
|
31
31
|
fi
|
|
32
32
|
|
|
33
33
|
[ "$(tail -c1 $project_root/functions/index.js)" != "" ] && echo "" >> "$project_root/functions/index.js"
|