Socket
Socket
Sign inDemoInstall

lambdaorm-base

Package Overview
Dependencies
Maintainers
1
Versions
96
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lambdaorm-base - npm Package Compare versions

Comparing version 1.1.1 to 1.2.0

2

package.json
{
"name": "lambdaorm-base",
"version": "1.1.1",
"version": "1.2.0",
"description": "ORM",

@@ -5,0 +5,0 @@ "author": "Flavio Lionel Rita <flaviolrita@proton.me>",

@@ -1,2 +0,2 @@

import { Schema, SchemaData, ClauseInfo, SourceRule, Mapping, MatchOptions, InitializeSchemaArgs } from '../domain';
import { Schema, SchemaData, ClauseInfo, SourceRule, Mapping, MatchOptions, InitializeSchemaArgs, DomainSchema, Entity, Enum, EntityMapping, Stage } from '../domain';
import { DataSourceConfigService } from './services/config/dataSourceConfigService';

@@ -31,3 +31,25 @@ import { MappingsConfigService } from './services/config/mappingsConfigService';

getSource(clauseInfo: ClauseInfo, stage?: string): string;
getSchemaSources(): {
name: string;
dialect: string;
}[];
getSchemaSource(source: string): {
name: string;
dialect: string;
};
getSchemaVersion(): {
version: string | undefined;
};
getSchemaSDomain(): DomainSchema;
getSchemaEntities(): Entity[];
getSchemaEntity(entity: string): Entity | undefined;
getSchemaEnums(): Enum[];
getSchemaEnum(_enum: string): Enum | undefined;
getSchemaMappings(): Mapping[];
getSchemaMapping(mapping: string): Mapping | undefined;
getSchemaEntityMapping(mapping: string, entity: string): EntityMapping | undefined;
getSchemaStages(): Stage[];
getSchemaStage(stage: string): Stage | undefined;
getSchemaViews(): string[];
private toSchema;
}

@@ -100,2 +100,66 @@ "use strict";

}
getSchemaSources() {
var _a, _b;
return ((_b = (_a = this.schema.infrastructure) === null || _a === void 0 ? void 0 : _a.sources) === null || _b === void 0 ? void 0 : _b.map(s => ({ name: s.name, dialect: s.dialect }))) || [];
}
getSchemaSource(source) {
const sources = this.getSchemaSources();
if (sources !== undefined) {
return sources.find(s => s.name === source) || { name: source, dialect: 'unknown' };
}
else {
return { name: source, dialect: 'unknown' };
}
}
getSchemaVersion() {
return { version: this.schema.version || undefined };
}
getSchemaSDomain() {
return this.schema.domain;
}
getSchemaEntities() {
return this.schema.domain.entities || [];
}
getSchemaEntity(entity) {
return this.schema.domain.entities.find(e => e.name === entity);
}
getSchemaEnums() {
return this.schema.domain.enums || [];
}
getSchemaEnum(_enum) {
var _a;
return (_a = this.schema.domain.enums) === null || _a === void 0 ? void 0 : _a.find(e => e.name === _enum);
}
getSchemaMappings() {
var _a;
return ((_a = this.schema.infrastructure) === null || _a === void 0 ? void 0 : _a.mappings) || [];
}
getSchemaMapping(mapping) {
if (this.schema.infrastructure === undefined || this.schema.infrastructure.mappings === undefined) {
return undefined;
}
return this.schema.infrastructure.mappings.find(m => m.name === mapping);
}
getSchemaEntityMapping(mapping, entity) {
var _a, _b;
if (this.schema.infrastructure === undefined || this.schema.infrastructure.mappings === undefined) {
return undefined;
}
return (_b = (_a = this.schema.infrastructure.mappings.find(m => m.name === mapping)) === null || _a === void 0 ? void 0 : _a.entities) === null || _b === void 0 ? void 0 : _b.find(e => e.name === entity);
}
getSchemaStages() {
var _a;
return ((_a = this.schema.infrastructure) === null || _a === void 0 ? void 0 : _a.stages) || [];
}
getSchemaStage(stage) {
var _a;
if (this.schema.infrastructure === undefined || this.schema.infrastructure.stages === undefined) {
return undefined;
}
return (_a = this.schema.infrastructure) === null || _a === void 0 ? void 0 : _a.stages.find(s => s.name === stage);
}
getSchemaViews() {
var _a, _b;
return ((_b = (_a = this.schema.infrastructure) === null || _a === void 0 ? void 0 : _a.views) === null || _b === void 0 ? void 0 : _b.map(p => p.name)) || [];
}
toSchema(originalSchema) {

@@ -102,0 +166,0 @@ const _schema = this.helper.obj.clone(originalSchema);

@@ -54,3 +54,3 @@ "use strict";

if (source) {
if (!args.connection) {
if (args.connection) {
source.connection = args.connection;

@@ -57,0 +57,0 @@ }

@@ -161,2 +161,5 @@ import { SentenceAction } from './actions';

}
export interface ServerConfig {
url: string;
}
export interface InfrastructureSchema {

@@ -168,2 +171,3 @@ paths?: AppPathsConfig;

stages?: Stage[];
server?: ServerConfig;
}

@@ -170,0 +174,0 @@ export interface ApplicationSchema {

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