Open duncanbeevers opened 1 month ago
@avaly
We got a different set of failures on media-providers with these changes. However, I went ahead and linked my locally-built papr into media-providers and made one simple adjustment. This change does make this a breaking change, since PropertyType
is part of the public contract.
diff --git a/@types/mongodb.d.ts b/@types/mongodb.d.ts
index c9004704d4..2ce4be1716 100644
--- a/@types/mongodb.d.ts
+++ b/@types/mongodb.d.ts
@@ -36,6 +36,6 @@ declare global {
// This type is extracted from `papr.PaprMatchKeysAndValues`, because that type is too complex for our usage here,
// and it would introduce more than 3 minutes on the `tsc` check times.
export type MongoAttributes<TSchema> = {
- [Property in mongodb.Join<papr.NestedPaths<TSchema, []>, '.'>]?: papr.PropertyType<TSchema, Property>;
+ [Property in mongodb.Join<papr.NestedPaths<TSchema, []>, '.'>]?: Mutable<papr.PropertyType<TSchema, Property>>;
};
}
@avaly I've tested it in our internal repos and it is compiling without errors.
Should we adapt other methods like insert to support readonly array too?
Thanks for testing @CarlosLozanoHealthCaters! Yeah, we plan to extend support to all methods that accept user input.
🐞 Permit
readonly
arraysRelated issue: https://github.com/plexinc/papr/issues/828
Test case demonstrating TS type error.