Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@contember/schema-definition

Package Overview
Dependencies
Maintainers
5
Versions
263
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@contember/schema-definition - npm Package Compare versions

Comparing version 1.2.0-alpha.6 to 1.2.0-alpha.7

2

dist/src/model/definition/ViewDefinition.d.ts
import { EntityConstructor } from './types';
export declare const View: (sql: string, { dependencies }?: {
dependencies?: EntityConstructor<any>[] | undefined;
dependencies?: EntityConstructor<any>[] | (() => EntityConstructor[]) | undefined;
}) => import("./types").DecoratorFunction<unknown>;
//# sourceMappingURL=ViewDefinition.d.ts.map

@@ -5,10 +5,23 @@ "use strict";

const extensions_1 = require("./extensions");
const View = (sql, { dependencies } = {}) => (0, extensions_1.extendEntity)(({ entity, registry }) => ({
...entity,
view: {
sql,
...(dependencies ? { dependencies: dependencies === null || dependencies === void 0 ? void 0 : dependencies.map(it => registry.getName(it)) } : {}),
},
}));
const View = (sql, { dependencies } = {}) => (0, extensions_1.extendEntity)(({ entity, registry }) => {
const dependenciesResolved = typeof dependencies === 'function' ? dependencies() : dependencies;
if (dependenciesResolved === null || dependenciesResolved === void 0 ? void 0 : dependenciesResolved.some(it => it === undefined)) {
throw `"undefined" value detected in dependencies of view entity ${entity.name}. This is possibly caused by circular imports.
Please wrap the array of dependencies into a function returning this array.
Instead of:
dependencies: [MyEntity]
Use:
dependencies: () => [MyEntity]
`;
}
return ({
...entity,
view: {
sql,
...(dependenciesResolved ? { dependencies: dependenciesResolved.map(it => registry.getName(it)) } : {}),
},
});
});
exports.View = View;
//# sourceMappingURL=ViewDefinition.js.map
{
"name": "@contember/schema-definition",
"version": "1.2.0-alpha.6",
"version": "1.2.0-alpha.7",
"license": "Apache-2.0",

@@ -11,4 +11,4 @@ "main": "dist/src/index.js",

"dependencies": {
"@contember/schema": "^1.2.0-alpha.6",
"@contember/schema-utils": "^1.2.0-alpha.6",
"@contember/schema": "^1.2.0-alpha.7",
"@contember/schema-utils": "^1.2.0-alpha.7",
"reflect-metadata": "^0.1.13"

@@ -15,0 +15,0 @@ },

import { extendEntity } from './extensions'
import { EntityConstructor } from './types'
export const View = (sql: string, { dependencies }: { dependencies?: EntityConstructor[] } = {}) =>
extendEntity(({ entity, registry }) => ({
...entity,
view: {
sql,
...(dependencies ? { dependencies: dependencies?.map(it => registry.getName(it)) } : {}),
},
}))
export const View = (sql: string, { dependencies }: { dependencies?: (() => EntityConstructor[]) | EntityConstructor[] } = {}) =>
extendEntity(({ entity, registry }) => {
const dependenciesResolved = typeof dependencies === 'function' ? dependencies() : dependencies
if (dependenciesResolved?.some(it => it === undefined)) {
throw `"undefined" value detected in dependencies of view entity ${entity.name}. This is possibly caused by circular imports.
Please wrap the array of dependencies into a function returning this array.
Instead of:
dependencies: [MyEntity]
Use:
dependencies: () => [MyEntity]
`
}
return ({
...entity,
view: {
sql,
...(dependenciesResolved ? { dependencies: dependenciesResolved.map(it => registry.getName(it)) } : {}),
},
})
})

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

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