@egdata/core.schemas.collections
Advanced tools
Comparing version 2.0.0 to 2.0.1
import mongoose from 'mongoose'; | ||
const CollectionOfferSchema = new mongoose.Schema({ | ||
const GamePositionSchema = new mongoose.Schema({ | ||
_id: { | ||
@@ -8,2 +8,7 @@ type: String, | ||
}, | ||
collectionId: { | ||
type: String, | ||
required: true, | ||
index: true, | ||
}, | ||
position: { | ||
@@ -15,30 +20,45 @@ type: Number, | ||
type: Number, | ||
required: false, | ||
default: 0, | ||
}, | ||
timesInTop5: { | ||
type: Number, | ||
required: false, | ||
default: 0, | ||
}, | ||
timesInTop10: { | ||
type: Number, | ||
required: false, | ||
default: 0, | ||
}, | ||
timesInTop20: { | ||
type: Number, | ||
required: false, | ||
default: 0, | ||
}, | ||
timesInTop50: { | ||
type: Number, | ||
required: false, | ||
default: 0, | ||
}, | ||
timesInTop100: { | ||
type: Number, | ||
required: false, | ||
default: 0, | ||
}, | ||
previous: { | ||
type: Number, | ||
required: false, | ||
default: null, | ||
}, | ||
positions: [{ | ||
date: { | ||
type: Date, | ||
required: true, | ||
}, | ||
position: { | ||
type: Number, | ||
required: true, | ||
} | ||
}], | ||
lastUpdated: { | ||
type: Date, | ||
required: true, | ||
} | ||
}); | ||
// Schema for collections metadata | ||
const CollectionsSchema = new mongoose.Schema({ | ||
@@ -61,4 +81,4 @@ _id: { | ||
}, | ||
offers: { | ||
type: [CollectionOfferSchema], | ||
postDate: { | ||
type: Date, | ||
required: true, | ||
@@ -68,10 +88,15 @@ }, | ||
export const CollectionOffer = mongoose.model( | ||
'CollectionOffer', | ||
CollectionsSchema, | ||
'collections' | ||
); | ||
export type CollectionOfferType = mongoose.InferSchemaType< | ||
typeof CollectionOfferSchema | ||
>; | ||
// Export models | ||
export const GamePosition = mongoose.model('GamePosition', GamePositionSchema, 'game_positions'); | ||
export const Collection = mongoose.model('Collection', CollectionsSchema, 'collections_v2'); | ||
// Export types | ||
export type GamePositionType = mongoose.InferSchemaType<typeof GamePositionSchema>; | ||
export type CollectionType = mongoose.InferSchemaType<typeof CollectionsSchema>; | ||
// Type for position history entries | ||
export interface PositionEntry { | ||
date: Date; | ||
position: number; | ||
} |
import mongoose from 'mongoose'; | ||
declare const CollectionOfferSchema: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, { | ||
declare const GamePositionSchema: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, { | ||
_id: string; | ||
collectionId: string; | ||
position: number; | ||
timesInTop1?: number; | ||
timesInTop5?: number; | ||
timesInTop10?: number; | ||
timesInTop20?: number; | ||
timesInTop50?: number; | ||
timesInTop100?: number; | ||
previous?: number; | ||
timesInTop1: number; | ||
timesInTop5: number; | ||
timesInTop10: number; | ||
timesInTop20: number; | ||
timesInTop50: number; | ||
timesInTop100: number; | ||
previous: number; | ||
positions: mongoose.Types.DocumentArray<{ | ||
date: NativeDate; | ||
position: number; | ||
}, mongoose.Types.Subdocument<mongoose.Types.ObjectId, any, { | ||
date: NativeDate; | ||
position: number; | ||
}> & { | ||
date: NativeDate; | ||
position: number; | ||
}>; | ||
lastUpdated: NativeDate; | ||
}, mongoose.Document<unknown, {}, mongoose.FlatRecord<{ | ||
_id: string; | ||
collectionId: string; | ||
position: number; | ||
timesInTop1?: number; | ||
timesInTop5?: number; | ||
timesInTop10?: number; | ||
timesInTop20?: number; | ||
timesInTop50?: number; | ||
timesInTop100?: number; | ||
previous?: number; | ||
timesInTop1: number; | ||
timesInTop5: number; | ||
timesInTop10: number; | ||
timesInTop20: number; | ||
timesInTop50: number; | ||
timesInTop100: number; | ||
previous: number; | ||
positions: mongoose.Types.DocumentArray<{ | ||
date: NativeDate; | ||
position: number; | ||
}, mongoose.Types.Subdocument<mongoose.Types.ObjectId, any, { | ||
date: NativeDate; | ||
position: number; | ||
}> & { | ||
date: NativeDate; | ||
position: number; | ||
}>; | ||
lastUpdated: NativeDate; | ||
}>> & mongoose.FlatRecord<{ | ||
_id: string; | ||
collectionId: string; | ||
position: number; | ||
timesInTop1?: number; | ||
timesInTop5?: number; | ||
timesInTop10?: number; | ||
timesInTop20?: number; | ||
timesInTop50?: number; | ||
timesInTop100?: number; | ||
previous?: number; | ||
timesInTop1: number; | ||
timesInTop5: number; | ||
timesInTop10: number; | ||
timesInTop20: number; | ||
timesInTop50: number; | ||
timesInTop100: number; | ||
previous: number; | ||
positions: mongoose.Types.DocumentArray<{ | ||
date: NativeDate; | ||
position: number; | ||
}, mongoose.Types.Subdocument<mongoose.Types.ObjectId, any, { | ||
date: NativeDate; | ||
position: number; | ||
}> & { | ||
date: NativeDate; | ||
position: number; | ||
}>; | ||
lastUpdated: NativeDate; | ||
}> & Required<{ | ||
@@ -37,3 +73,3 @@ _id: string; | ||
}>; | ||
export declare const CollectionOffer: mongoose.Model<{ | ||
declare const CollectionsSchema: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, { | ||
_id: string; | ||
@@ -43,105 +79,86 @@ updatedAt: NativeDate; | ||
addedAt: NativeDate; | ||
offers: mongoose.Types.DocumentArray<{ | ||
_id: string; | ||
postDate: NativeDate; | ||
}, mongoose.Document<unknown, {}, mongoose.FlatRecord<{ | ||
_id: string; | ||
updatedAt: NativeDate; | ||
name: string; | ||
addedAt: NativeDate; | ||
postDate: NativeDate; | ||
}>> & mongoose.FlatRecord<{ | ||
_id: string; | ||
updatedAt: NativeDate; | ||
name: string; | ||
addedAt: NativeDate; | ||
postDate: NativeDate; | ||
}> & Required<{ | ||
_id: string; | ||
}> & { | ||
__v: number; | ||
}>; | ||
export declare const GamePosition: mongoose.Model<{ | ||
_id: string; | ||
collectionId: string; | ||
position: number; | ||
timesInTop1: number; | ||
timesInTop5: number; | ||
timesInTop10: number; | ||
timesInTop20: number; | ||
timesInTop50: number; | ||
timesInTop100: number; | ||
previous: number; | ||
positions: mongoose.Types.DocumentArray<{ | ||
date: NativeDate; | ||
position: number; | ||
timesInTop1?: number; | ||
timesInTop5?: number; | ||
timesInTop10?: number; | ||
timesInTop20?: number; | ||
timesInTop50?: number; | ||
timesInTop100?: number; | ||
previous?: number; | ||
}, mongoose.Types.Subdocument<string, any, { | ||
_id: string; | ||
}, mongoose.Types.Subdocument<mongoose.Types.ObjectId, any, { | ||
date: NativeDate; | ||
position: number; | ||
timesInTop1?: number; | ||
timesInTop5?: number; | ||
timesInTop10?: number; | ||
timesInTop20?: number; | ||
timesInTop50?: number; | ||
timesInTop100?: number; | ||
previous?: number; | ||
}> & { | ||
_id: string; | ||
date: NativeDate; | ||
position: number; | ||
timesInTop1?: number; | ||
timesInTop5?: number; | ||
timesInTop10?: number; | ||
timesInTop20?: number; | ||
timesInTop50?: number; | ||
timesInTop100?: number; | ||
previous?: number; | ||
}>; | ||
lastUpdated: NativeDate; | ||
}, {}, {}, {}, mongoose.Document<unknown, {}, { | ||
_id: string; | ||
updatedAt: NativeDate; | ||
name: string; | ||
addedAt: NativeDate; | ||
offers: mongoose.Types.DocumentArray<{ | ||
_id: string; | ||
collectionId: string; | ||
position: number; | ||
timesInTop1: number; | ||
timesInTop5: number; | ||
timesInTop10: number; | ||
timesInTop20: number; | ||
timesInTop50: number; | ||
timesInTop100: number; | ||
previous: number; | ||
positions: mongoose.Types.DocumentArray<{ | ||
date: NativeDate; | ||
position: number; | ||
timesInTop1?: number; | ||
timesInTop5?: number; | ||
timesInTop10?: number; | ||
timesInTop20?: number; | ||
timesInTop50?: number; | ||
timesInTop100?: number; | ||
previous?: number; | ||
}, mongoose.Types.Subdocument<string, any, { | ||
_id: string; | ||
}, mongoose.Types.Subdocument<mongoose.Types.ObjectId, any, { | ||
date: NativeDate; | ||
position: number; | ||
timesInTop1?: number; | ||
timesInTop5?: number; | ||
timesInTop10?: number; | ||
timesInTop20?: number; | ||
timesInTop50?: number; | ||
timesInTop100?: number; | ||
previous?: number; | ||
}> & { | ||
_id: string; | ||
date: NativeDate; | ||
position: number; | ||
timesInTop1?: number; | ||
timesInTop5?: number; | ||
timesInTop10?: number; | ||
timesInTop20?: number; | ||
timesInTop50?: number; | ||
timesInTop100?: number; | ||
previous?: number; | ||
}>; | ||
lastUpdated: NativeDate; | ||
}> & { | ||
_id: string; | ||
updatedAt: NativeDate; | ||
name: string; | ||
addedAt: NativeDate; | ||
offers: mongoose.Types.DocumentArray<{ | ||
_id: string; | ||
collectionId: string; | ||
position: number; | ||
timesInTop1: number; | ||
timesInTop5: number; | ||
timesInTop10: number; | ||
timesInTop20: number; | ||
timesInTop50: number; | ||
timesInTop100: number; | ||
previous: number; | ||
positions: mongoose.Types.DocumentArray<{ | ||
date: NativeDate; | ||
position: number; | ||
timesInTop1?: number; | ||
timesInTop5?: number; | ||
timesInTop10?: number; | ||
timesInTop20?: number; | ||
timesInTop50?: number; | ||
timesInTop100?: number; | ||
previous?: number; | ||
}, mongoose.Types.Subdocument<string, any, { | ||
_id: string; | ||
}, mongoose.Types.Subdocument<mongoose.Types.ObjectId, any, { | ||
date: NativeDate; | ||
position: number; | ||
timesInTop1?: number; | ||
timesInTop5?: number; | ||
timesInTop10?: number; | ||
timesInTop20?: number; | ||
timesInTop50?: number; | ||
timesInTop100?: number; | ||
previous?: number; | ||
}> & { | ||
_id: string; | ||
date: NativeDate; | ||
position: number; | ||
timesInTop1?: number; | ||
timesInTop5?: number; | ||
timesInTop10?: number; | ||
timesInTop20?: number; | ||
timesInTop50?: number; | ||
timesInTop100?: number; | ||
previous?: number; | ||
}>; | ||
lastUpdated: NativeDate; | ||
} & Required<{ | ||
@@ -153,108 +170,66 @@ _id: string; | ||
_id: string; | ||
updatedAt: NativeDate; | ||
name: string; | ||
addedAt: NativeDate; | ||
offers: mongoose.Types.DocumentArray<{ | ||
_id: string; | ||
collectionId: string; | ||
position: number; | ||
timesInTop1: number; | ||
timesInTop5: number; | ||
timesInTop10: number; | ||
timesInTop20: number; | ||
timesInTop50: number; | ||
timesInTop100: number; | ||
previous: number; | ||
positions: mongoose.Types.DocumentArray<{ | ||
date: NativeDate; | ||
position: number; | ||
timesInTop1?: number; | ||
timesInTop5?: number; | ||
timesInTop10?: number; | ||
timesInTop20?: number; | ||
timesInTop50?: number; | ||
timesInTop100?: number; | ||
previous?: number; | ||
}, mongoose.Types.Subdocument<string, any, { | ||
_id: string; | ||
}, mongoose.Types.Subdocument<mongoose.Types.ObjectId, any, { | ||
date: NativeDate; | ||
position: number; | ||
timesInTop1?: number; | ||
timesInTop5?: number; | ||
timesInTop10?: number; | ||
timesInTop20?: number; | ||
timesInTop50?: number; | ||
timesInTop100?: number; | ||
previous?: number; | ||
}> & { | ||
_id: string; | ||
date: NativeDate; | ||
position: number; | ||
timesInTop1?: number; | ||
timesInTop5?: number; | ||
timesInTop10?: number; | ||
timesInTop20?: number; | ||
timesInTop50?: number; | ||
timesInTop100?: number; | ||
previous?: number; | ||
}>; | ||
lastUpdated: NativeDate; | ||
}, mongoose.Document<unknown, {}, mongoose.FlatRecord<{ | ||
_id: string; | ||
updatedAt: NativeDate; | ||
name: string; | ||
addedAt: NativeDate; | ||
offers: mongoose.Types.DocumentArray<{ | ||
_id: string; | ||
collectionId: string; | ||
position: number; | ||
timesInTop1: number; | ||
timesInTop5: number; | ||
timesInTop10: number; | ||
timesInTop20: number; | ||
timesInTop50: number; | ||
timesInTop100: number; | ||
previous: number; | ||
positions: mongoose.Types.DocumentArray<{ | ||
date: NativeDate; | ||
position: number; | ||
timesInTop1?: number; | ||
timesInTop5?: number; | ||
timesInTop10?: number; | ||
timesInTop20?: number; | ||
timesInTop50?: number; | ||
timesInTop100?: number; | ||
previous?: number; | ||
}, mongoose.Types.Subdocument<string, any, { | ||
_id: string; | ||
}, mongoose.Types.Subdocument<mongoose.Types.ObjectId, any, { | ||
date: NativeDate; | ||
position: number; | ||
timesInTop1?: number; | ||
timesInTop5?: number; | ||
timesInTop10?: number; | ||
timesInTop20?: number; | ||
timesInTop50?: number; | ||
timesInTop100?: number; | ||
previous?: number; | ||
}> & { | ||
_id: string; | ||
date: NativeDate; | ||
position: number; | ||
timesInTop1?: number; | ||
timesInTop5?: number; | ||
timesInTop10?: number; | ||
timesInTop20?: number; | ||
timesInTop50?: number; | ||
timesInTop100?: number; | ||
previous?: number; | ||
}>; | ||
lastUpdated: NativeDate; | ||
}>> & mongoose.FlatRecord<{ | ||
_id: string; | ||
updatedAt: NativeDate; | ||
name: string; | ||
addedAt: NativeDate; | ||
offers: mongoose.Types.DocumentArray<{ | ||
_id: string; | ||
collectionId: string; | ||
position: number; | ||
timesInTop1: number; | ||
timesInTop5: number; | ||
timesInTop10: number; | ||
timesInTop20: number; | ||
timesInTop50: number; | ||
timesInTop100: number; | ||
previous: number; | ||
positions: mongoose.Types.DocumentArray<{ | ||
date: NativeDate; | ||
position: number; | ||
timesInTop1?: number; | ||
timesInTop5?: number; | ||
timesInTop10?: number; | ||
timesInTop20?: number; | ||
timesInTop50?: number; | ||
timesInTop100?: number; | ||
previous?: number; | ||
}, mongoose.Types.Subdocument<string, any, { | ||
_id: string; | ||
}, mongoose.Types.Subdocument<mongoose.Types.ObjectId, any, { | ||
date: NativeDate; | ||
position: number; | ||
timesInTop1?: number; | ||
timesInTop5?: number; | ||
timesInTop10?: number; | ||
timesInTop20?: number; | ||
timesInTop50?: number; | ||
timesInTop100?: number; | ||
previous?: number; | ||
}> & { | ||
_id: string; | ||
date: NativeDate; | ||
position: number; | ||
timesInTop1?: number; | ||
timesInTop5?: number; | ||
timesInTop10?: number; | ||
timesInTop20?: number; | ||
timesInTop50?: number; | ||
timesInTop100?: number; | ||
previous?: number; | ||
}>; | ||
lastUpdated: NativeDate; | ||
}> & Required<{ | ||
@@ -265,3 +240,53 @@ _id: string; | ||
}>>; | ||
export type CollectionOfferType = mongoose.InferSchemaType<typeof CollectionOfferSchema>; | ||
export declare const Collection: mongoose.Model<{ | ||
_id: string; | ||
updatedAt: NativeDate; | ||
name: string; | ||
addedAt: NativeDate; | ||
postDate: NativeDate; | ||
}, {}, {}, {}, mongoose.Document<unknown, {}, { | ||
_id: string; | ||
updatedAt: NativeDate; | ||
name: string; | ||
addedAt: NativeDate; | ||
postDate: NativeDate; | ||
}> & { | ||
_id: string; | ||
updatedAt: NativeDate; | ||
name: string; | ||
addedAt: NativeDate; | ||
postDate: NativeDate; | ||
} & Required<{ | ||
_id: string; | ||
}> & { | ||
__v: number; | ||
}, mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, { | ||
_id: string; | ||
updatedAt: NativeDate; | ||
name: string; | ||
addedAt: NativeDate; | ||
postDate: NativeDate; | ||
}, mongoose.Document<unknown, {}, mongoose.FlatRecord<{ | ||
_id: string; | ||
updatedAt: NativeDate; | ||
name: string; | ||
addedAt: NativeDate; | ||
postDate: NativeDate; | ||
}>> & mongoose.FlatRecord<{ | ||
_id: string; | ||
updatedAt: NativeDate; | ||
name: string; | ||
addedAt: NativeDate; | ||
postDate: NativeDate; | ||
}> & Required<{ | ||
_id: string; | ||
}> & { | ||
__v: number; | ||
}>>; | ||
export type GamePositionType = mongoose.InferSchemaType<typeof GamePositionSchema>; | ||
export type CollectionType = mongoose.InferSchemaType<typeof CollectionsSchema>; | ||
export interface PositionEntry { | ||
date: Date; | ||
position: number; | ||
} | ||
export {}; |
import mongoose from 'mongoose'; | ||
const CollectionOfferSchema = new mongoose.Schema({ | ||
const GamePositionSchema = new mongoose.Schema({ | ||
_id: { | ||
@@ -7,2 +7,7 @@ type: String, | ||
}, | ||
collectionId: { | ||
type: String, | ||
required: true, | ||
index: true, | ||
}, | ||
position: { | ||
@@ -14,29 +19,44 @@ type: Number, | ||
type: Number, | ||
required: false, | ||
default: 0, | ||
}, | ||
timesInTop5: { | ||
type: Number, | ||
required: false, | ||
default: 0, | ||
}, | ||
timesInTop10: { | ||
type: Number, | ||
required: false, | ||
default: 0, | ||
}, | ||
timesInTop20: { | ||
type: Number, | ||
required: false, | ||
default: 0, | ||
}, | ||
timesInTop50: { | ||
type: Number, | ||
required: false, | ||
default: 0, | ||
}, | ||
timesInTop100: { | ||
type: Number, | ||
required: false, | ||
default: 0, | ||
}, | ||
previous: { | ||
type: Number, | ||
required: false, | ||
default: null, | ||
}, | ||
positions: [{ | ||
date: { | ||
type: Date, | ||
required: true, | ||
}, | ||
position: { | ||
type: Number, | ||
required: true, | ||
} | ||
}], | ||
lastUpdated: { | ||
type: Date, | ||
required: true, | ||
} | ||
}); | ||
// Schema for collections metadata | ||
const CollectionsSchema = new mongoose.Schema({ | ||
@@ -59,8 +79,10 @@ _id: { | ||
}, | ||
offers: { | ||
type: [CollectionOfferSchema], | ||
postDate: { | ||
type: Date, | ||
required: true, | ||
}, | ||
}); | ||
export const CollectionOffer = mongoose.model('CollectionOffer', CollectionsSchema, 'collections'); | ||
// Export models | ||
export const GamePosition = mongoose.model('GamePosition', GamePositionSchema, 'game_positions'); | ||
export const Collection = mongoose.model('Collection', CollectionsSchema, 'collections_v2'); | ||
//# sourceMappingURL=collections.js.map |
@@ -1,2 +0,2 @@ | ||
export { CollectionOffer } from './collections.js'; | ||
export type { CollectionOfferType } from './collections.js'; | ||
export { Collection, GamePosition } from './collections.js'; | ||
export type { CollectionType, GamePositionType } from './collections.js'; |
@@ -1,2 +0,2 @@ | ||
export { CollectionOffer } from './collections.js'; | ||
export { Collection, GamePosition } from './collections.js'; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
export { CollectionOffer } from './collections.js'; | ||
export type { CollectionOfferType } from './collections.js'; | ||
export { Collection, GamePosition } from './collections.js'; | ||
export type { CollectionType, GamePositionType } from './collections.js'; |
{ | ||
"name": "@egdata/core.schemas.collections", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"homepage": "https://bit.cloud/egdata/core/schemas/collections", | ||
@@ -9,3 +9,3 @@ "main": "dist/index.js", | ||
"name": "schemas/collections", | ||
"version": "2.0.0" | ||
"version": "2.0.1" | ||
}, | ||
@@ -12,0 +12,0 @@ "dependencies": {}, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16212
562
1