@edgedev/firebase 1.7.4 → 1.7.6

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/README.md CHANGED
@@ -374,12 +374,13 @@ Remove a role from a user for a collection:
374
374
 
375
375
  ### Root permissions and first user
376
376
 
377
- You can assign a user access to all collections in the entire project by giving them a role on "-", which is used to define the root collection path. This would be for someone who is acting like a super admin. If this is your first user, you will need to manually set them up in the Firstore console. Once a root user is added manually you can use this user to add other "root users" or setup other collections and assign roles to them. The first time you login with your root user the collection-data/-default- role permissions document (mentioned above) will be automatically created.
377
+ You can assign a user access to all collections in the entire project by giving them a role on "-", which is used to define the root collection path. This would be for someone who is acting like a super admin. If this is your first user, you will need to manually set them up in the Firstore console inside the "staged-users". Once a root user is added manually, you will need to "Register" that user using the docId of the "staged user" as the registration code, please see the user registration section of this documentation. You can use this user to add other "root users" or setup other collections and assign roles to them. You will also need to manually create the collection-data/-default- role permissions document (mentioned above) and the root permission document, see examples below:
378
378
 
379
- | ![root-collection-roles](./images/root-collection-roles.png) | ![root-user](./images/root-user.jpg) |
380
- | ------------------------------------------------------------ | ------------------------------------ |
379
+ ![root-collection-roles](./images/default-collection-roles.png)
381
380
 
381
+ ![root-collection-roles](./images/root-collection-roles.png)
382
382
 
383
+ ![root-user](./images/root-user.png)
383
384
 
384
385
  ### User special permissions
385
386
 
package/edgeFirebase.ts CHANGED
@@ -1535,6 +1535,28 @@ export const EdgeFirebase = class {
1535
1535
  }
1536
1536
  };
1537
1537
 
1538
+ //TODO: Add documentation for this function
1539
+ public storeDocRaw = async (
1540
+ collectionPath: string,
1541
+ item: object,
1542
+ docId?: string,
1543
+ ): Promise<actionResponse> => {
1544
+ const cloneItem = JSON.parse(JSON.stringify(item));
1545
+ if (docId !== undefined) {
1546
+ await setDoc( doc(this.db, collectionPath, docId), cloneItem);
1547
+ } else {
1548
+ await addDoc(
1549
+ collection(this.db, collectionPath),
1550
+ cloneItem
1551
+ );
1552
+ }
1553
+ return this.sendResponse({
1554
+ success: true,
1555
+ message: "",
1556
+ meta: {}
1557
+ });
1558
+ }
1559
+
1538
1560
 
1539
1561
  public storeDoc = async (
1540
1562
  collectionPath: string,
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edgedev/firebase",
3
- "version": "1.7.4",
3
+ "version": "1.7.6",
4
4
  "description": "Vue 3 / Nuxt 3 Plugin or Nuxt 3 plugin for firebase authentication and firestore.",
5
5
  "main": "index.ts",
6
6
  "scripts": {
File without changes