@lpdjs/firestore-repo-service 2.1.2 → 2.1.3
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 +22 -13
- package/dist/index.cjs +44 -44
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +44 -44
- package/dist/index.js.map +1 -1
- package/dist/servers/admin/index.cjs +4 -4
- package/dist/servers/admin/index.cjs.map +1 -1
- package/dist/servers/admin/index.js +4 -4
- package/dist/servers/admin/index.js.map +1 -1
- package/dist/servers/crud/index.cjs +2 -2
- package/dist/servers/crud/index.cjs.map +1 -1
- package/dist/servers/crud/index.js +2 -2
- package/dist/servers/crud/index.js.map +1 -1
- package/dist/servers/index.cjs +2 -2
- package/dist/servers/index.cjs.map +1 -1
- package/dist/servers/index.js +2 -2
- package/dist/servers/index.js.map +1 -1
- package/dist/sync/bigquery.d.cts +1 -1
- package/dist/sync/bigquery.d.ts +1 -1
- package/dist/sync/index.cjs +33 -33
- package/dist/sync/index.cjs.map +1 -1
- package/dist/sync/index.d.cts +170 -170
- package/dist/sync/index.d.ts +170 -170
- package/dist/sync/index.js +33 -33
- package/dist/sync/index.js.map +1 -1
- package/dist/{types-PzZ0APQ_.d.cts → types-BG1kGsLO.d.cts} +25 -12
- package/dist/{types-PzZ0APQ_.d.ts → types-BG1kGsLO.d.ts} +25 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -262,7 +262,7 @@ const updated = await repos.users.update("user123", {
|
|
|
262
262
|
const updatedComment = await repos.comments.update(
|
|
263
263
|
"post123", // postId
|
|
264
264
|
"comment456", // commentId
|
|
265
|
-
{ text: "Updated text" }
|
|
265
|
+
{ text: "Updated text" },
|
|
266
266
|
);
|
|
267
267
|
```
|
|
268
268
|
|
|
@@ -359,7 +359,7 @@ const unsubscribe = repos.users.query.onSnapshot(
|
|
|
359
359
|
},
|
|
360
360
|
(error) => {
|
|
361
361
|
console.error("Erreur:", error);
|
|
362
|
-
}
|
|
362
|
+
},
|
|
363
363
|
);
|
|
364
364
|
|
|
365
365
|
// Arrêter l'écoute
|
|
@@ -417,7 +417,7 @@ await repos.users.set("user123", {
|
|
|
417
417
|
await repos.users.set(
|
|
418
418
|
"user123",
|
|
419
419
|
{ age: 31 }, // Seul 'age' sera modifié
|
|
420
|
-
{ merge: true }
|
|
420
|
+
{ merge: true },
|
|
421
421
|
);
|
|
422
422
|
|
|
423
423
|
// Update - Mise à jour partielle
|
|
@@ -510,7 +510,7 @@ const repositoryMapping = {
|
|
|
510
510
|
db: Firestore,
|
|
511
511
|
residenceId: string,
|
|
512
512
|
eventId: string,
|
|
513
|
-
ratingId: string
|
|
513
|
+
ratingId: string,
|
|
514
514
|
) =>
|
|
515
515
|
doc(
|
|
516
516
|
db,
|
|
@@ -519,7 +519,7 @@ const repositoryMapping = {
|
|
|
519
519
|
"events",
|
|
520
520
|
eventId,
|
|
521
521
|
"ratings",
|
|
522
|
-
ratingId
|
|
522
|
+
ratingId,
|
|
523
523
|
),
|
|
524
524
|
}),
|
|
525
525
|
};
|
|
@@ -529,7 +529,7 @@ const rating = await repos.eventRatings.update(
|
|
|
529
529
|
"residence123",
|
|
530
530
|
"event456",
|
|
531
531
|
"rating789",
|
|
532
|
-
{ score: 5 }
|
|
532
|
+
{ score: 5 },
|
|
533
533
|
);
|
|
534
534
|
```
|
|
535
535
|
|
|
@@ -566,7 +566,7 @@ const userWithPosts = await repos.users.populate(
|
|
|
566
566
|
{
|
|
567
567
|
relation: "docId",
|
|
568
568
|
select: ["docId", "title", "status"], // Type-safe: keyof PostModel
|
|
569
|
-
}
|
|
569
|
+
},
|
|
570
570
|
);
|
|
571
571
|
|
|
572
572
|
// Populate plusieurs relations
|
|
@@ -644,12 +644,21 @@ const sync = createFirestoreSync(repos, {
|
|
|
644
644
|
},
|
|
645
645
|
});
|
|
646
646
|
|
|
647
|
-
// Export des Cloud Functions (
|
|
647
|
+
// Export des Cloud Functions (adminsync auto-wrappé via onRequest + httpsOptions)
|
|
648
648
|
export const {
|
|
649
|
-
users_onCreate,
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
649
|
+
users_onCreate,
|
|
650
|
+
users_onUpdate,
|
|
651
|
+
users_onDelete,
|
|
652
|
+
sync_users,
|
|
653
|
+
posts_onCreate,
|
|
654
|
+
posts_onUpdate,
|
|
655
|
+
posts_onDelete,
|
|
656
|
+
sync_posts,
|
|
657
|
+
comments_onCreate,
|
|
658
|
+
comments_onUpdate,
|
|
659
|
+
comments_onDelete,
|
|
660
|
+
sync_comments,
|
|
661
|
+
adminsync,
|
|
653
662
|
} = sync.functions;
|
|
654
663
|
```
|
|
655
664
|
|
|
@@ -707,7 +716,7 @@ import type {
|
|
|
707
716
|
SqlColumn,
|
|
708
717
|
SqlTableDef,
|
|
709
718
|
RepoSyncConfig,
|
|
710
|
-
|
|
719
|
+
adminsyncConfig,
|
|
711
720
|
} from "@lpdjs/firestore-repo-service/sync";
|
|
712
721
|
```
|
|
713
722
|
|