New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

papr

Package Overview
Dependencies
Maintainers
4
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

papr - npm Package Compare versions

Comparing version 7.3.0 to 7.3.1

2

cjs/index.d.ts

@@ -73,3 +73,3 @@ import { Db } from 'mongodb';

*/
updateSchema<TSchema extends BaseSchema, TDefaults>(model: Model<TSchema, TDefaults>): Promise<void>;
updateSchema<TSchema extends BaseSchema, TDefaults extends Partial<TSchema>>(model: Model<TSchema, TDefaults>): Promise<void>;
/**

@@ -76,0 +76,0 @@ * Updates the validation schemas and validation options on all the MongoDB collections registered by models.

import { ObjectId } from 'mongodb';
import type { AggregateOptions, BulkWriteOptions, BulkWriteResult, Collection, CountDocumentsOptions, DeleteOptions, DeleteResult, DistinctOptions, Filter, FindOneAndDeleteOptions, FindOneAndUpdateOptions, FindOptions, Flatten, InsertOneOptions, UpdateFilter, UpdateOptions, UpdateResult, WithId } from 'mongodb';
import { BaseSchema, BulkWriteOperation, DocumentForInsert, ModelOptions, ProjectionType } from './utils';
import { BaseSchema, BulkWriteOperation, DocumentForInsert, ModelOptions, Projection, ProjectionType } from './utils';
export interface Model<TSchema extends BaseSchema, TDefaults extends Partial<TSchema>> {

@@ -21,17 +21,17 @@ collection: Collection<TSchema>;

distinct: <TKey extends keyof WithId<TSchema>>(key: TKey, filter: Filter<TSchema>, options?: DistinctOptions) => Promise<Flatten<WithId<TSchema>[TKey]>[]>;
find: <Projection>(filter: Filter<TSchema>, options?: Omit<FindOptions<TSchema>, 'projection'> & {
projection?: Projection;
}) => Promise<ProjectionType<TSchema, Projection>[]>;
findById: <Projection>(id: string | ObjectId, options?: Omit<FindOptions<TSchema>, 'projection'> & {
projection?: Projection;
}) => Promise<ProjectionType<TSchema, Projection> | null>;
findOne: <Projection>(filter: Filter<TSchema>, options?: Omit<FindOptions<TSchema>, 'projection'> & {
projection?: Projection;
}) => Promise<ProjectionType<TSchema, Projection> | null>;
findOneAndDelete: <Projection>(filter: Filter<TSchema>, options?: Omit<FindOneAndDeleteOptions, 'projection'> & {
projection?: Projection;
}) => Promise<ProjectionType<TSchema, Projection> | null>;
findOneAndUpdate: <Projection>(filter: Filter<TSchema>, update: UpdateFilter<TSchema>, options?: Omit<FindOneAndUpdateOptions, 'projection'> & {
projection?: Projection;
}) => Promise<ProjectionType<TSchema, Projection> | null>;
find: <TProjection extends Projection<TSchema> | undefined>(filter: Filter<TSchema>, options?: Omit<FindOptions<TSchema>, 'projection'> & {
projection?: TProjection;
}) => Promise<ProjectionType<TSchema, TProjection>[]>;
findById: <TProjection extends Projection<TSchema> | undefined>(id: string | ObjectId, options?: Omit<FindOptions<TSchema>, 'projection'> & {
projection?: TProjection;
}) => Promise<ProjectionType<TSchema, TProjection> | null>;
findOne: <TProjection extends Projection<TSchema> | undefined>(filter: Filter<TSchema>, options?: Omit<FindOptions<TSchema>, 'projection'> & {
projection?: TProjection;
}) => Promise<ProjectionType<TSchema, TProjection> | null>;
findOneAndDelete: <TProjection extends Projection<TSchema> | undefined>(filter: Filter<TSchema>, options?: Omit<FindOneAndDeleteOptions, 'projection'> & {
projection?: TProjection;
}) => Promise<ProjectionType<TSchema, TProjection> | null>;
findOneAndUpdate: <TProjection extends Projection<TSchema> | undefined>(filter: Filter<TSchema>, update: UpdateFilter<TSchema>, options?: Omit<FindOneAndUpdateOptions, 'projection'> & {
projection?: TProjection;
}) => Promise<ProjectionType<TSchema, TProjection> | null>;
insertOne: (doc: DocumentForInsert<TSchema, TDefaults>, options?: InsertOneOptions) => Promise<TSchema>;

@@ -38,0 +38,0 @@ insertMany: (docs: DocumentForInsert<TSchema, TDefaults>[], options?: BulkWriteOptions) => Promise<TSchema[]>;

@@ -42,3 +42,4 @@ import { ObjectId } from 'mongodb';

};
export declare type ProjectionType<TSchema extends BaseSchema, Projection extends Partial<Record<Join<NestedPaths<WithId<TSchema>, true>, '.'>, number>> | undefined> = undefined extends Projection ? WithId<TSchema> : WithId<DeepPick<TSchema, keyof Projection & string>>;
export declare type ProjectionType<TSchema extends BaseSchema, Projection extends Partial<Record<Join<NestedPaths<WithId<TSchema>>, '.'>, number>> | undefined> = undefined extends Projection ? WithId<TSchema> : WithId<DeepPick<TSchema, keyof Projection & string>>;
export declare type Projection<TSchema> = Partial<Record<Join<NestedPaths<WithId<TSchema>>, '.'>, number>>;
export declare type Identity<Type> = Type;

@@ -111,3 +112,3 @@ export declare type Flatten<Type extends object> = Identity<{

export declare function timestampUpdateFilter<TSchema>(update: UpdateFilter<TSchema>): UpdateFilter<TSchema>;
export declare function timestampBulkWriteOperation<TSchema, TDefaults>(operation: BulkWriteOperation<TSchema, TDefaults>): BulkWriteOperation<TSchema, TDefaults>;
export declare function timestampBulkWriteOperation<TSchema, TDefaults extends Partial<TSchema>>(operation: BulkWriteOperation<TSchema, TDefaults>): BulkWriteOperation<TSchema, TDefaults>;
export declare function cleanSetOnInsert<TSchema>($setOnInsert: NonNullable<UpdateFilter<TSchema>['$setOnInsert']>, update: UpdateFilter<TSchema>): NonNullable<UpdateFilter<TSchema>['$setOnInsert']>;

@@ -73,3 +73,3 @@ import { Db } from 'mongodb';

*/
updateSchema<TSchema extends BaseSchema, TDefaults>(model: Model<TSchema, TDefaults>): Promise<void>;
updateSchema<TSchema extends BaseSchema, TDefaults extends Partial<TSchema>>(model: Model<TSchema, TDefaults>): Promise<void>;
/**

@@ -76,0 +76,0 @@ * Updates the validation schemas and validation options on all the MongoDB collections registered by models.

import { ObjectId } from 'mongodb';
import type { AggregateOptions, BulkWriteOptions, BulkWriteResult, Collection, CountDocumentsOptions, DeleteOptions, DeleteResult, DistinctOptions, Filter, FindOneAndDeleteOptions, FindOneAndUpdateOptions, FindOptions, Flatten, InsertOneOptions, UpdateFilter, UpdateOptions, UpdateResult, WithId } from 'mongodb';
import { BaseSchema, BulkWriteOperation, DocumentForInsert, ModelOptions, ProjectionType } from './utils';
import { BaseSchema, BulkWriteOperation, DocumentForInsert, ModelOptions, Projection, ProjectionType } from './utils';
export interface Model<TSchema extends BaseSchema, TDefaults extends Partial<TSchema>> {

@@ -21,17 +21,17 @@ collection: Collection<TSchema>;

distinct: <TKey extends keyof WithId<TSchema>>(key: TKey, filter: Filter<TSchema>, options?: DistinctOptions) => Promise<Flatten<WithId<TSchema>[TKey]>[]>;
find: <Projection>(filter: Filter<TSchema>, options?: Omit<FindOptions<TSchema>, 'projection'> & {
projection?: Projection;
}) => Promise<ProjectionType<TSchema, Projection>[]>;
findById: <Projection>(id: string | ObjectId, options?: Omit<FindOptions<TSchema>, 'projection'> & {
projection?: Projection;
}) => Promise<ProjectionType<TSchema, Projection> | null>;
findOne: <Projection>(filter: Filter<TSchema>, options?: Omit<FindOptions<TSchema>, 'projection'> & {
projection?: Projection;
}) => Promise<ProjectionType<TSchema, Projection> | null>;
findOneAndDelete: <Projection>(filter: Filter<TSchema>, options?: Omit<FindOneAndDeleteOptions, 'projection'> & {
projection?: Projection;
}) => Promise<ProjectionType<TSchema, Projection> | null>;
findOneAndUpdate: <Projection>(filter: Filter<TSchema>, update: UpdateFilter<TSchema>, options?: Omit<FindOneAndUpdateOptions, 'projection'> & {
projection?: Projection;
}) => Promise<ProjectionType<TSchema, Projection> | null>;
find: <TProjection extends Projection<TSchema> | undefined>(filter: Filter<TSchema>, options?: Omit<FindOptions<TSchema>, 'projection'> & {
projection?: TProjection;
}) => Promise<ProjectionType<TSchema, TProjection>[]>;
findById: <TProjection extends Projection<TSchema> | undefined>(id: string | ObjectId, options?: Omit<FindOptions<TSchema>, 'projection'> & {
projection?: TProjection;
}) => Promise<ProjectionType<TSchema, TProjection> | null>;
findOne: <TProjection extends Projection<TSchema> | undefined>(filter: Filter<TSchema>, options?: Omit<FindOptions<TSchema>, 'projection'> & {
projection?: TProjection;
}) => Promise<ProjectionType<TSchema, TProjection> | null>;
findOneAndDelete: <TProjection extends Projection<TSchema> | undefined>(filter: Filter<TSchema>, options?: Omit<FindOneAndDeleteOptions, 'projection'> & {
projection?: TProjection;
}) => Promise<ProjectionType<TSchema, TProjection> | null>;
findOneAndUpdate: <TProjection extends Projection<TSchema> | undefined>(filter: Filter<TSchema>, update: UpdateFilter<TSchema>, options?: Omit<FindOneAndUpdateOptions, 'projection'> & {
projection?: TProjection;
}) => Promise<ProjectionType<TSchema, TProjection> | null>;
insertOne: (doc: DocumentForInsert<TSchema, TDefaults>, options?: InsertOneOptions) => Promise<TSchema>;

@@ -38,0 +38,0 @@ insertMany: (docs: DocumentForInsert<TSchema, TDefaults>[], options?: BulkWriteOptions) => Promise<TSchema[]>;

@@ -42,3 +42,4 @@ import { ObjectId } from 'mongodb';

};
export declare type ProjectionType<TSchema extends BaseSchema, Projection extends Partial<Record<Join<NestedPaths<WithId<TSchema>, true>, '.'>, number>> | undefined> = undefined extends Projection ? WithId<TSchema> : WithId<DeepPick<TSchema, keyof Projection & string>>;
export declare type ProjectionType<TSchema extends BaseSchema, Projection extends Partial<Record<Join<NestedPaths<WithId<TSchema>>, '.'>, number>> | undefined> = undefined extends Projection ? WithId<TSchema> : WithId<DeepPick<TSchema, keyof Projection & string>>;
export declare type Projection<TSchema> = Partial<Record<Join<NestedPaths<WithId<TSchema>>, '.'>, number>>;
export declare type Identity<Type> = Type;

@@ -111,3 +112,3 @@ export declare type Flatten<Type extends object> = Identity<{

export declare function timestampUpdateFilter<TSchema>(update: UpdateFilter<TSchema>): UpdateFilter<TSchema>;
export declare function timestampBulkWriteOperation<TSchema, TDefaults>(operation: BulkWriteOperation<TSchema, TDefaults>): BulkWriteOperation<TSchema, TDefaults>;
export declare function timestampBulkWriteOperation<TSchema, TDefaults extends Partial<TSchema>>(operation: BulkWriteOperation<TSchema, TDefaults>): BulkWriteOperation<TSchema, TDefaults>;
export declare function cleanSetOnInsert<TSchema>($setOnInsert: NonNullable<UpdateFilter<TSchema>['$setOnInsert']>, update: UpdateFilter<TSchema>): NonNullable<UpdateFilter<TSchema>['$setOnInsert']>;

@@ -5,3 +5,3 @@ {

"author": "Plex Inc.",
"version": "7.3.0",
"version": "7.3.1",
"keywords": [

@@ -57,3 +57,3 @@ "mongodb",

"devDependencies": {
"@babel/core": "7.18.10",
"@babel/core": "7.18.13",
"@babel/preset-env": "7.18.10",

@@ -64,9 +64,8 @@ "@babel/preset-typescript": "7.18.6",

"@commitlint/config-conventional": "17.0.3",
"@types/jest": "28.1.7",
"@types/node": "14.18.26",
"@typescript-eslint/eslint-plugin": "5.33.0",
"@typescript-eslint/parser": "5.33.0",
"@typescript-eslint/eslint-plugin": "5.35.1",
"@typescript-eslint/parser": "5.35.1",
"arg": "5.0.2",
"docsify-cli": "4.4.4",
"eslint": "8.22.0",
"eslint": "8.23.0",
"eslint-config-prettier": "8.5.0",

@@ -79,8 +78,8 @@ "eslint-config-standard": "17.0.0",

"husky": "8.0.1",
"jest": "28.1.3",
"jest": "29.0.1",
"jsdoc-api": "7.1.1",
"jsdoc-parse": "6.1.0",
"lint-staged": "13.0.3",
"mongodb": "4.9.0",
"mongodb-memory-server": "8.8.0",
"mongodb": "4.9.1",
"mongodb-memory-server": "8.9.0",
"mongoose": "6.3.5",

@@ -92,6 +91,6 @@ "pinst": "3.0.0",

"ts-node": "10.9.1",
"typescript": "4.7.4"
"typescript": "4.8.2"
},
"peerDependencies": {
"mongodb": ">=4.9.0"
"mongodb": ">=4.9.1"
},

@@ -131,3 +130,3 @@ "commitlint": {

},
"packageManager": "yarn@3.2.2"
"packageManager": "yarn@3.2.3"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc