Comparing version 3.0.0-rc.3 to 3.0.0-rc.4
@@ -10,8 +10,19 @@ # Changelog | ||
## [3.0.0-rc.4] | ||
### Fixed | ||
- Properly handle a failure in basic digest function when saving ([#753](https://github.com/STORIS/mvom/pull/753)) | ||
- Fix regression in `_raw` property of `Document` that was no longer conditionally assigning property ([#754](https://github.com/STORIS/mvom/pull/754)) | ||
### TypeScript | ||
- Improve the type of schema type property `path` to be a union of numeric tuples instead of a numeric array ([#751](https://github.com/STORIS/mvom/pull/751)) | ||
## [3.0.0-rc.3] | ||
### TypeScript | ||
- Adjust `SchemaFilterKeys` type to exclude non-string keys and use `SchemaFilterKeys` in construction of `SortCriteria` type ([#747](https://github.com/STORIS/mvom/pull/747)) | ||
### TypeScript | ||
## [3.0.0-rc.2] | ||
@@ -484,3 +495,4 @@ | ||
[unreleased]: https://github.com/storis/mvom/compare/3.0.0-rc.3...HEAD | ||
[unreleased]: https://github.com/storis/mvom/compare/3.0.0-rc.4...HEAD | ||
[3.0.0-rc.4]: https://github.com/storis/mvom/compare/3.0.0-rc.3...3.0.0-rc.4 | ||
[3.0.0-rc.3]: https://github.com/storis/mvom/compare/3.0.0-rc.2...3.0.0-rc.3 | ||
@@ -487,0 +499,0 @@ [3.0.0-rc.2]: https://github.com/storis/mvom/compare/3.0.0-rc.1...3.0.0-rc.2 |
@@ -57,3 +57,3 @@ import type Connection from './Connection'; | ||
"__#2@#convertToMvString"(): string; | ||
_raw: TSchema extends Schema<import("./Schema").SchemaDefinition, Record<never, never>> ? undefined : import("./types").MvRecord; | ||
_raw: TSchema extends Schema<import("./Schema").SchemaDefinition, Record<never, never>> ? never : import("./types").MvRecord; | ||
_transformationErrors: import("./errors").TransformDataError[]; | ||
@@ -60,0 +60,0 @@ readonly "__#1@#schema": TSchema; |
@@ -87,4 +87,8 @@ "use strict"; | ||
message: 'Maximum return payload size exceeded' | ||
}, | ||
recordNotFound: { | ||
code: 21, | ||
message: 'Database record not found' | ||
} | ||
}; | ||
var _default = exports.default = dbErrors; |
@@ -26,3 +26,3 @@ import { TransformDataError } from './errors'; | ||
[key: string]: unknown; | ||
_raw: TSchema extends Schema ? undefined : MvRecord; | ||
_raw: TSchema extends Schema ? never : MvRecord; | ||
/** Array of any errors which occurred during transformation from the database */ | ||
@@ -29,0 +29,0 @@ _transformationErrors: TransformDataError[]; |
@@ -50,3 +50,5 @@ "use strict"; | ||
}); | ||
this._raw = schema == null ? this.#record : undefined; | ||
if (schema == null) { | ||
this._raw = this.#record; | ||
} | ||
this.#transformRecordToDocument(); | ||
@@ -53,0 +55,0 @@ |
@@ -10,2 +10,3 @@ export { default as ConnectionError } from './ConnectionError'; | ||
export { default as RecordLockedError } from './RecordLockedError'; | ||
export { default as RecordNotFoundError } from './RecordNotFoundError'; | ||
export { default as RecordVersionError } from './RecordVersionError'; | ||
@@ -12,0 +13,0 @@ export { default as TimeoutError } from './TimeoutError'; |
@@ -61,2 +61,8 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "RecordNotFoundError", { | ||
enumerable: true, | ||
get: function () { | ||
return _RecordNotFoundError.default; | ||
} | ||
}); | ||
Object.defineProperty(exports, "RecordVersionError", { | ||
@@ -95,2 +101,3 @@ enumerable: true, | ||
var _RecordLockedError = _interopRequireDefault(require("./RecordLockedError")); | ||
var _RecordNotFoundError = _interopRequireDefault(require("./RecordNotFoundError")); | ||
var _RecordVersionError = _interopRequireDefault(require("./RecordVersionError")); | ||
@@ -97,0 +104,0 @@ var _TimeoutError = _interopRequireDefault(require("./TimeoutError")); |
{ | ||
"name": "mvom", | ||
"private": false, | ||
"version": "3.0.0-rc.3", | ||
"version": "3.0.0-rc.4", | ||
"description": "Multivalue Object Mapper", | ||
@@ -6,0 +6,0 @@ "main": "index.js", |
@@ -1,2 +0,2 @@ | ||
import type { BaseSchemaType, SchemaTypeDefinitionBoolean, SchemaTypeDefinitionISOCalendarDate, SchemaTypeDefinitionISOCalendarDateTime, SchemaTypeDefinitionISOTime, SchemaTypeDefinitionNumber, SchemaTypeDefinitionScalar, SchemaTypeDefinitionString } from './schemaType'; | ||
import type { BaseSchemaType, SchemaTypeDefinitionBoolean, SchemaTypeDefinitionISOCalendarDate, SchemaTypeDefinitionISOCalendarDateTime, SchemaTypeDefinitionISOTime, SchemaTypeDefinitionNumber, SchemaTypeDefinitionScalar, SchemaTypeDefinitionString, SchemaTypePath } from './schemaType'; | ||
import type { DataTransformer, DecryptFn, EncryptFn, FlattenObject, MarkRequired, Remap } from './types'; | ||
@@ -99,3 +99,3 @@ export type SchemaTypeDefinition = Schema | SchemaTypeDefinitionScalar | SchemaDefinition | SchemaTypeDefinitionArray; | ||
/** Get all multivalue data paths in this schema and its subdocument schemas */ | ||
getMvPaths(): number[][]; | ||
getMvPaths(): SchemaTypePath[]; | ||
/** Transform the paths to positions */ | ||
@@ -102,0 +102,0 @@ transformPathsToDbPositions(paths: string[]): number[]; |
@@ -298,5 +298,3 @@ "use strict"; | ||
// add to mvPath array | ||
if (schemaTypeValue.path != null) { | ||
this.positionPaths.set(keyPath, schemaTypeValue.path); | ||
} | ||
this.positionPaths.set(keyPath, schemaTypeValue.path); | ||
@@ -303,0 +301,0 @@ // update dictPaths |
@@ -15,2 +15,3 @@ import type { DataTransformer, DecryptFn, EncryptFn, MvAttribute, MvRecord } from '../types'; | ||
type RecordSetType = string | null | (string | null | (string | null)[])[]; | ||
export type SchemaTypePath = [number] | [number, number] | [number, number, number]; | ||
/** Abstract Scalar Schema Type */ | ||
@@ -21,3 +22,3 @@ declare abstract class BaseScalarType extends BaseSchemaType implements DataTransformer { | ||
/** 0-indexed Array path */ | ||
readonly path: number[]; | ||
readonly path: SchemaTypePath; | ||
/** Multivalue dictionary id */ | ||
@@ -24,0 +25,0 @@ readonly dictionary: string | null; |
@@ -150,3 +150,3 @@ "use strict"; | ||
normalizeMvPath(path) { | ||
return (0, _lodash.toPath)(path).map(val => { | ||
return (0, _lodash.toPath)(path).slice(0, 3).map(val => { | ||
const numVal = +val; | ||
@@ -153,0 +153,0 @@ if (!Number.isInteger(numVal) || numVal < 1) { |
import type { ForeignKeyDbDefinition } from '../ForeignKeyDbTransformer'; | ||
import type { MvAttribute, MvRecord } from '../types'; | ||
export type SchemaTypeDefinitionPath = `${number}` | `${number}.${number}` | `${number}.${number}.${number}` | number; | ||
export interface SchemaTypeDefinitionBase { | ||
path: `${number}` | `${number}.${number}` | `${number}.${number}.${number}` | number; | ||
path: SchemaTypeDefinitionPath; | ||
dictionary?: string; | ||
@@ -6,0 +7,0 @@ required?: boolean; |
export { default as ArrayType } from './ArrayType'; | ||
export { default as BaseScalarArrayType } from './BaseScalarArrayType'; | ||
export { default as BaseScalarType, type SchemaTypeDefinitionScalar } from './BaseScalarType'; | ||
export { default as BaseScalarType, type SchemaTypeDefinitionScalar, type SchemaTypePath, } from './BaseScalarType'; | ||
export { default as BaseSchemaType } from './BaseSchemaType'; | ||
@@ -5,0 +5,0 @@ export { default as BooleanType, type SchemaTypeDefinitionBoolean } from './BooleanType'; |
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
289571
129
5297