Skip to content

Commit

Permalink
Merge pull request #20 from yamankatby/main
Browse files Browse the repository at this point in the history
chore: publish v0.0.7
  • Loading branch information
shamsmosowi committed May 28, 2024
2 parents 5dd679f + f6df47e commit f3a473e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
4 changes: 4 additions & 0 deletions firestore-user-document/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## Version 0.0.7

- Fix bugs

## Version 0.0.6

- Fix bugs
Expand Down
2 changes: 1 addition & 1 deletion firestore-user-document/extension.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: firestore-user-document
version: 0.0.6
version: 0.0.7
specVersion: v1beta
displayName: Firestore User Document

Expand Down
6 changes: 3 additions & 3 deletions firestore-user-document/functions/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ interface IConfig {

const config: IConfig = {
usersCollectionPath: process.env.USERS_COLLECTION_PATH!,
fieldsToPopulate: process.env.FIELDS_TO_POPULATE!.split(','),
fieldsToPopulate: process.env.FIELDS_TO_POPULATE!.split(","),
deleteDocumentOnUserDelete:
process.env.DELETE_DOCUMENT_ON_USER_DELETE === 'true',
backfillExistingUsers: process.env.BACKFILL_EXISTING_USERS === 'true',
process.env.DELETE_DOCUMENT_ON_USER_DELETE === "true",
backfillExistingUsers: process.env.BACKFILL_EXISTING_USERS === "true",
location: process.env.FUNCTIONS_LOCATION!,
};

Expand Down
5 changes: 3 additions & 2 deletions firestore-user-document/functions/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { initializeApp } from "firebase-admin/app";
import { getFirestore } from 'firebase-admin/firestore'
import { UserRecord, getAuth } from "firebase-admin/auth";
import { getExtensions } from "firebase-admin/extensions";
import { getFirestore } from "firebase-admin/firestore";
import { getFunctions } from "firebase-admin/functions";
import * as functions from "firebase-functions";

import config from "./config";

initializeApp();

const auth = getAuth();
const db = getFirestore();

const usersCollection = db.collection(config.usersCollectionPath);
Expand Down Expand Up @@ -74,7 +75,7 @@ export const backfillExistingUsers = functions.tasks
}

try {
const { users, pageToken } = await getAuth().listUsers(
const { users, pageToken } = await auth.listUsers(
BATCH_SIZE,
data.pageToken
);
Expand Down

0 comments on commit f3a473e

Please sign in to comment.