rest-client-sdk
Advanced tools
Comparing version 6.4.1 to 6.5.0
# Changelog | ||
## 6.5.0 | ||
### Added | ||
Accept Relation.ONE_TO_ONE relation. | ||
It is basically handled the same way as MANY_TO_ONE, but has been added for semantic purpose. | ||
The comportment may differ later. | ||
## 6.4.1 | ||
@@ -4,0 +12,0 @@ |
declare enum RelationTypes { | ||
ONE_TO_ONE = "ONE_TO_ONE", | ||
ONE_TO_MANY = "ONE_TO_MANY", | ||
@@ -7,2 +8,3 @@ MANY_TO_MANY = "MANY_TO_MANY", | ||
declare class Relation { | ||
static ONE_TO_ONE: RelationTypes; | ||
static ONE_TO_MANY: RelationTypes; | ||
@@ -22,2 +24,3 @@ static MANY_TO_ONE: RelationTypes; | ||
constructor(type: RelationTypes, targetMetadataKey: string, serializedKey: string, attributeName?: string | null); | ||
isOneToOne(): boolean; | ||
isOneToMany(): boolean; | ||
@@ -27,3 +30,4 @@ isManyToOne(): boolean; | ||
isRelationToMany(): boolean; | ||
isRelationToOne(): boolean; | ||
} | ||
export default Relation; |
{ | ||
"name": "rest-client-sdk", | ||
"version": "6.4.1", | ||
"version": "6.5.0", | ||
"description": "Rest Client SDK for API", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -1,2 +0,2 @@ | ||
# Mapado Rest Client JS SDK [![Build Status](https://travis-ci.org/mapado/rest-client-js-sdk.svg?branch=master)](https://travis-ci.org/mapado/rest-client-js-sdk) | ||
# Rest Client JS SDK [![Build Status](https://travis-ci.org/mapado/rest-client-js-sdk.svg?branch=master)](https://travis-ci.org/mapado/rest-client-js-sdk) | ||
@@ -3,0 +3,0 @@ Rest client SDK for API for Javascript usage. |
@@ -64,3 +64,3 @@ import ClassMetadata from './Mapping/ClassMetadata'; | ||
if ( | ||
relation.isManyToOne() && | ||
relation.isRelationToOne() && | ||
attribute.attributeName.endsWith('List') | ||
@@ -67,0 +67,0 @@ ) { |
enum RelationTypes { | ||
ONE_TO_ONE = 'ONE_TO_ONE', | ||
ONE_TO_MANY = 'ONE_TO_MANY', | ||
@@ -8,2 +9,4 @@ MANY_TO_MANY = 'MANY_TO_MANY', | ||
class Relation { | ||
public static ONE_TO_ONE = RelationTypes.ONE_TO_ONE; | ||
public static ONE_TO_MANY = RelationTypes.ONE_TO_MANY; | ||
@@ -41,2 +44,6 @@ | ||
isOneToOne(): boolean { | ||
return this.type === Relation.ONE_TO_ONE; | ||
} | ||
isOneToMany(): boolean { | ||
@@ -57,4 +64,8 @@ return this.type === Relation.ONE_TO_MANY; | ||
} | ||
isRelationToOne(): boolean { | ||
return this.isManyToOne() || this.isOneToOne(); | ||
} | ||
} | ||
export default Relation; |
@@ -326,3 +326,3 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ | ||
// MANY_TO_ONE relation | ||
if (currentRelation.isManyToOne()) { | ||
if (currentRelation.isRelationToOne()) { | ||
dirtyFields = this._getDirtyFieldsForManyToOne( | ||
@@ -329,0 +329,0 @@ dirtyFields, |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
545979
7059