Comparing version 3.0.0-rc.5 to 3.0.0-rc.6
@@ -10,2 +10,14 @@ # Changelog | ||
## [3.0.0-rc.6] | ||
### Added | ||
- Export `MvRecord` type from index ([#791](https://github.com/STORIS/mvom/pull/791)) | ||
- Allow for required empty string enumerations ([#789](https://github.com/STORIS/mvom/pull/789)) | ||
### Fixed | ||
- Switch the type definition of array schema properties to readonly tuples ([#794](https://github.com/STORIS/mvom/pull/794)) | ||
- Add `_id` and `__v` to types for schemaless models ([#790](https://github.com/STORIS/mvom/pull/790)) | ||
## [3.0.0-rc.5] | ||
@@ -503,3 +515,4 @@ | ||
[unreleased]: https://github.com/storis/mvom/compare/3.0.0-rc.5...HEAD | ||
[unreleased]: https://github.com/storis/mvom/compare/3.0.0-rc.6...HEAD | ||
[3.0.0-rc.6]: https://github.com/storis/mvom/compare/3.0.0-rc.5...3.0.0-rc.6 | ||
[3.0.0-rc.5]: https://github.com/storis/mvom/compare/3.0.0-rc.4...3.0.0-rc.5 | ||
@@ -506,0 +519,0 @@ [3.0.0-rc.4]: https://github.com/storis/mvom/compare/3.0.0-rc.3...3.0.0-rc.4 |
@@ -8,3 +8,3 @@ import type Connection from './Connection'; | ||
import type { SchemaTypeDefinitionNumber } from './schemaType'; | ||
import type { DbServerDelimiters, DbSubroutineInputIncrementOperation, DbSubroutineUserDefinedOptions } from './types'; | ||
import type { DbServerDelimiters, DbSubroutineInputIncrementOperation, DbSubroutineUserDefinedOptions, Remap } from './types'; | ||
export interface ModelConstructorOptions<TSchema extends Schema | null> { | ||
@@ -18,2 +18,7 @@ _id?: string | null; | ||
export type Model<TSchema extends Schema | null> = InstanceType<ModelConstructor<TSchema>>; | ||
/** Used as an intersection type to make _id & __v properties required */ | ||
export interface RequiredModelMeta { | ||
_id: string; | ||
__v: string; | ||
} | ||
/** | ||
@@ -23,3 +28,3 @@ * An intersection type that combines the `Model` class instance with the | ||
*/ | ||
export type ModelCompositeValue<TSchema extends Schema | null> = TSchema extends Schema ? InstanceType<ModelConstructor<TSchema>> & InferModelObject<TSchema> : InstanceType<ModelConstructor<TSchema>>; | ||
export type ModelCompositeValue<TSchema extends Schema | null> = Remap<Model<TSchema> & (TSchema extends Schema ? InferModelObject<TSchema> : RequiredModelMeta)>; | ||
export interface ModelFindAndCountResult<TSchema extends Schema | null> { | ||
@@ -26,0 +31,0 @@ /** Number of documents returned */ |
@@ -14,2 +14,4 @@ "use strict"; | ||
/** Used as an intersection type to make _id & __v properties required */ | ||
/** | ||
@@ -16,0 +18,0 @@ * An intersection type that combines the `Model` class instance with the |
@@ -46,3 +46,3 @@ "use strict"; | ||
constructor( /** URL of the MVIS which facilitates access to the mv database */ | ||
constructor(/** URL of the MVIS which facilitates access to the mv database */ | ||
mvisUrl, /** Database account that connection will be used against */ | ||
@@ -87,3 +87,3 @@ account, /** Lifetime of cache of db server data (s) */ | ||
/** Create a connection */ | ||
static createConnection( /** URL of the MVIS which facilitates access to the mv database */ | ||
static createConnection(/** URL of the MVIS which facilitates access to the mv database */ | ||
mvisUrl, /** URL of the MVIS Admin */ | ||
@@ -90,0 +90,0 @@ mvisAdminUrl, /** MVIS Admin Username */ |
@@ -32,3 +32,3 @@ "use strict"; | ||
constructor( /** URL of the MVIS Admin */ | ||
constructor(/** URL of the MVIS Admin */ | ||
mvisAdminUrl, /** Database account that will be administered will be used against */ | ||
@@ -73,3 +73,3 @@ account, /** MVIS Admin username */ | ||
/** Create a deployment manager */ | ||
static createDeploymentManager( /** URL of the MVIS Admin */ | ||
static createDeploymentManager(/** URL of the MVIS Admin */ | ||
mvisAdminUrl, /** Database account that will be administered will be used against */ | ||
@@ -76,0 +76,0 @@ account, /** MVIS Admin username */ |
@@ -8,2 +8,2 @@ export { default as Connection } from './Connection'; | ||
export type { SchemaTypeDefinitionBoolean, SchemaTypeDefinitionISOCalendarDateTime, SchemaTypeDefinitionISOCalendarDate, SchemaTypeDefinitionISOTime, SchemaTypeDefinitionNumber, SchemaTypeDefinitionString, } from './schemaType'; | ||
export type { EncryptFn, DecryptFn } from './types'; | ||
export type { EncryptFn, DecryptFn, MvRecord } from './types'; |
{ | ||
"name": "mvom", | ||
"private": false, | ||
"version": "3.0.0-rc.5", | ||
"version": "3.0.0-rc.6", | ||
"description": "Multivalue Object Mapper", | ||
@@ -22,5 +22,5 @@ "main": "index.js", | ||
"dependencies": { | ||
"@babel/runtime": "^7.25.0", | ||
"@babel/runtime": "^7.25.7", | ||
"async-mutex": "^0.5.0", | ||
"axios": "^1.7.3", | ||
"axios": "^1.7.7", | ||
"date-fns": "^3.6.0", | ||
@@ -27,0 +27,0 @@ "fs-extra": "^11.2.0", |
@@ -0,5 +1,6 @@ | ||
import type { RequiredModelMeta } from './compileModel'; | ||
import type { BaseSchemaType, SchemaTypeDefinitionBoolean, SchemaTypeDefinitionISOCalendarDate, SchemaTypeDefinitionISOCalendarDateTime, SchemaTypeDefinitionISOTime, SchemaTypeDefinitionNumber, SchemaTypeDefinitionScalar, SchemaTypeDefinitionString, SchemaTypePath } from './schemaType'; | ||
import type { DataTransformer, DecryptFn, EncryptFn, FlattenObject, MarkRequired, Remap } from './types'; | ||
export type SchemaTypeDefinition = Schema | SchemaTypeDefinitionScalar | SchemaDefinition | SchemaTypeDefinitionArray; | ||
type SchemaTypeDefinitionArray = Schema[] | SchemaTypeDefinitionScalar[] | SchemaTypeDefinitionScalar[][] | SchemaDefinition[]; | ||
type SchemaTypeDefinitionArray = readonly [Schema] | readonly [SchemaTypeDefinitionScalar] | readonly [[SchemaTypeDefinitionScalar]] | readonly [SchemaDefinition]; | ||
export interface SchemaDefinition { | ||
@@ -65,6 +66,3 @@ [x: string]: SchemaTypeDefinition; | ||
/** Infer the shape of a `Model` instance based upon the Schema it was instantiated with */ | ||
export type InferModelObject<TSchema extends Schema> = Remap<{ | ||
_id: string; | ||
__v: string; | ||
} & InferDocumentObject<TSchema>>; | ||
export type InferModelObject<TSchema extends Schema> = Remap<InferDocumentObject<TSchema> & RequiredModelMeta>; | ||
/** | ||
@@ -71,0 +69,0 @@ * Flatten a document to string keyPath (i.e. { "foo.bar.baz": number }) |
@@ -25,3 +25,3 @@ import { StringDataTransformer } from '../dataTransformers'; | ||
/** String required validator */ | ||
protected validateRequired: (value: unknown) => boolean; | ||
protected validateRequired: (value: any) => boolean; | ||
/** Enum validator */ | ||
@@ -28,0 +28,0 @@ private validateEnum; |
@@ -44,6 +44,7 @@ "use strict"; | ||
/** String required validator */ | ||
validateRequired = value => !this.required || value != null && value !== ''; | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types -- Use any instead of unknown to avoid type errors in enum validation | ||
validateRequired = value => !this.required || this.enum?.includes(value) || value != null && value !== ''; | ||
/** Enum validator */ | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Use any instead of unknown to avoid type errors in enum validation | ||
validateEnum = value => | ||
@@ -50,0 +51,0 @@ // skip validation on nullish values because a required validation error, if applicable, is more helpful |
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
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
305408
5465
Updated@babel/runtime@^7.25.7
Updatedaxios@^1.7.7