@microsoft/paris
Advanced tools
Comparing version 1.7.0 to 1.7.1
@@ -0,0 +0,0 @@ { |
@@ -0,0 +0,0 @@ # [1.3.6] (2018-11-25) |
@@ -0,0 +0,0 @@ # Contributor Covenant Code of Conduct |
import { ModelBase } from "./model.base"; | ||
import { EntityModelConfigBase } from "./entity-config-base.interface"; | ||
import { EntityId } from "../modeling/entity-id.type"; | ||
export declare class EntityModelBase<TId extends EntityId = string> extends ModelBase { | ||
id: TId; | ||
constructor(data: EntityModelConfigBase); | ||
} |
@@ -24,4 +24,4 @@ var __extends = (this && this.__extends) || (function () { | ||
__extends(EntityModelBase, _super); | ||
function EntityModelBase() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
function EntityModelBase(data) { | ||
return _super.call(this, data) || this; | ||
} | ||
@@ -28,0 +28,0 @@ var _a; |
export declare class ModelBase { | ||
id?: any; | ||
$parent?: ModelBase; | ||
_init?: (entityData?: any, rawData?: any) => never; | ||
constructor(data?: any); | ||
} |
@@ -79,3 +79,10 @@ import { ModelBase } from "../config/model.base"; | ||
propertyEntityValues.forEach(function (propertyEntityValue) { return Object.assign(modelData, propertyEntityValue); }); | ||
var model = instantiateModel(); | ||
var model; | ||
try { | ||
model = new entity.entityConstructor(modelData, rawData); | ||
} | ||
catch (e) { | ||
getModelDataError.message = getModelDataError.message + " Error: " + e.message; | ||
throw getModelDataError; | ||
} | ||
_this.setModelLinks(model); | ||
@@ -86,14 +93,5 @@ return model; | ||
else { | ||
model$ = of(instantiateModel()); | ||
} | ||
return entity.readonly ? model$.pipe(map(function (model) { return Object.freeze(model); })) : model$; | ||
function instantiateModel() { | ||
var model = void 0; | ||
try { | ||
var model = new entity.entityConstructor(modelData, rawData); | ||
if (Object.isFrozen(model) || Object.isSealed(model)) | ||
console.warn("Can't assign data to " + entity.singularName + ", since it's frozen or sealed."); | ||
Object.assign(model, modelData); | ||
if (model._init) | ||
model._init(modelData, rawData); | ||
return model; | ||
model = new entity.entityConstructor(modelData, rawData); | ||
} | ||
@@ -104,3 +102,5 @@ catch (e) { | ||
} | ||
model$ = of(model); | ||
} | ||
return entity.readonly ? model$.pipe(map(function (model) { return Object.freeze(model); })) : model$; | ||
}; | ||
@@ -107,0 +107,0 @@ Modeler.prototype.validateFieldData = function (entityField, rawData) { |
@@ -0,0 +0,0 @@ # Paris |
@@ -0,0 +0,0 @@ const gulp = require('gulp'); |
export * from "./lib/main"; |
import 'reflect-metadata'; | ||
(<any>global)['Reflect'] = Reflect; |
{ | ||
"_from": "json-stringify-safe@*", | ||
"_args": [ | ||
[ | ||
"json-stringify-safe@5.0.1", | ||
"/mnt/c/Users/aagreenw/code/paris" | ||
] | ||
], | ||
"_development": true, | ||
"_from": "json-stringify-safe@5.0.1", | ||
"_id": "json-stringify-safe@5.0.1", | ||
@@ -9,10 +16,10 @@ "_inBundle": false, | ||
"_requested": { | ||
"type": "range", | ||
"type": "version", | ||
"registry": true, | ||
"raw": "json-stringify-safe@*", | ||
"raw": "json-stringify-safe@5.0.1", | ||
"name": "json-stringify-safe", | ||
"escapedName": "json-stringify-safe", | ||
"rawSpec": "*", | ||
"rawSpec": "5.0.1", | ||
"saveSpec": null, | ||
"fetchSpec": "*" | ||
"fetchSpec": "5.0.1" | ||
}, | ||
@@ -25,5 +32,4 @@ "_requiredBy": [ | ||
"_resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", | ||
"_shasum": "1296a2d58fd45f19a0f6ce01d65701e2c735b6eb", | ||
"_spec": "json-stringify-safe@*", | ||
"_where": "/Users/maorfrankel/Workspace/paris", | ||
"_spec": "5.0.1", | ||
"_where": "/mnt/c/Users/aagreenw/code/paris", | ||
"author": { | ||
@@ -37,3 +43,2 @@ "name": "Isaac Z. Schlueter", | ||
}, | ||
"bundleDependencies": false, | ||
"contributors": [ | ||
@@ -46,3 +51,2 @@ { | ||
], | ||
"deprecated": false, | ||
"description": "Like JSON.stringify, but doesn't blow up on circular refs.", | ||
@@ -49,0 +53,0 @@ "devDependencies": { |
{ | ||
"name": "@microsoft/paris", | ||
"version": "1.7.0", | ||
"version": "1.7.1", | ||
"description": "Library for the implementation of Domain Driven Design with TypeScript + RxJS", | ||
@@ -14,2 +14,3 @@ "repository": { | ||
"dev": "rollup -c -w", | ||
"prepublish": "npm run build && npm run test", | ||
"test": "jest", | ||
@@ -16,0 +17,0 @@ "test:watch": "jest --watch", |
@@ -0,0 +0,0 @@ # Paris |
@@ -0,0 +0,0 @@ import resolve from 'rollup-plugin-node-resolve'; |
@@ -0,0 +0,0 @@ import {Paris} from '../../lib/paris'; |
@@ -0,0 +0,0 @@ import {Paris} from '../../lib/paris'; |
@@ -0,0 +0,0 @@ import {Paris} from '../../lib/paris'; |
@@ -0,0 +0,0 @@ import { DataStoreService } from "../../lib/data_access/data-store.service"; |
@@ -0,0 +0,0 @@ import {ApiCall} from "../../lib/config/decorators/api-call.decorator"; |
@@ -0,0 +0,0 @@ import {of} from "rxjs"; |
interface MockConfigData { | ||
version: number | ||
} |
@@ -0,0 +0,0 @@ import {ModelBase} from "../../lib/config/model.base"; |
@@ -0,0 +0,0 @@ import {EntityField} from '../../lib/config/decorators/entity-field.decorator'; |
@@ -0,0 +0,0 @@ import {ModelBase} from "../../lib/config/model.base"; |
@@ -0,0 +0,0 @@ import {EntityModelBase} from "../../lib/config/entity-model.base"; |
@@ -0,0 +0,0 @@ import {TodoList} from "./todo-list.entity"; |
@@ -0,0 +0,0 @@ import {Entity} from "../../lib/config/decorators/entity.decorator"; |
@@ -0,0 +0,0 @@ import {Todo} from "./todo.entity"; |
@@ -0,0 +0,0 @@ import { EntityModelBase } from '../../lib/config/entity-model.base'; |
@@ -0,0 +0,0 @@ import {EntityModelBase} from "../../lib/config/entity-model.base"; |
@@ -0,0 +0,0 @@ import { ApiCallModel } from "../../lib/api/api-calls/api-call.model"; |
@@ -0,0 +0,0 @@ import 'reflect-metadata'; |
@@ -0,0 +0,0 @@ import {forkJoin, Observable, of} from 'rxjs'; |
@@ -0,0 +0,0 @@ import { Observable, of, forkJoin } from 'rxjs'; |
@@ -0,0 +0,0 @@ { |
@@ -0,0 +0,0 @@ { |
@@ -0,0 +0,0 @@ { |
@@ -0,0 +0,0 @@ module.exports = { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
260169
5269
0