@forestadmin/datasource-dummy
Advanced tools
Comparing version 1.0.0-beta.5 to 1.0.0-beta.6
@@ -0,1 +1,16 @@ | ||
# @forestadmin/datasource-dummy [1.0.0-beta.6](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/datasource-dummy@1.0.0-beta.5...@forestadmin/datasource-dummy@1.0.0-beta.6) (2022-04-21) | ||
### Features | ||
* harmonize datasource creation and pass logger to it ([#257](https://github.com/ForestAdmin/agent-nodejs/issues/257)) ([82cb4ea](https://github.com/ForestAdmin/agent-nodejs/commit/82cb4ea37ac0a9fe83423d917226dfd8fad7d0a6)) | ||
### Dependencies | ||
* **@forestadmin/datasource-toolkit:** upgraded to 1.0.0-beta.6 | ||
# @forestadmin/datasource-dummy [1.0.0-beta.5](https://github.com/ForestAdmin/agent-nodejs/compare/@forestadmin/datasource-dummy@1.0.0-beta.4...@forestadmin/datasource-dummy@1.0.0-beta.5) (2022-04-19) | ||
@@ -2,0 +17,0 @@ |
@@ -21,2 +21,2 @@ "use strict"; | ||
exports.default = DummyDataSource; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0YXNvdXJjZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9kYXRhc291cmNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsd0VBQWlFO0FBQ2pFLGdFQUFrRDtBQUNsRCxvRkFBcUU7QUFDckUsd0VBQTBEO0FBQzFELG9FQUFzRDtBQUV0RCxNQUFxQixlQUFnQixTQUFRLG1DQUFjO0lBQ3pEO1FBQ0UsS0FBSyxFQUFFLENBQUM7UUFFUixJQUFJLENBQUMsYUFBYSxDQUFDLElBQUksZUFBZSxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUM7UUFDOUMsSUFBSSxDQUFDLGFBQWEsQ0FBQyxJQUFJLGlCQUFpQixDQUFDLElBQUksQ0FBQyxDQUFDLENBQUM7UUFDaEQsSUFBSSxDQUFDLGFBQWEsQ0FBQyxJQUFJLG1CQUFtQixDQUFDLElBQUksQ0FBQyxDQUFDLENBQUM7UUFDbEQsSUFBSSxDQUFDLGFBQWEsQ0FBQyxJQUFJLHlCQUF3QixDQUFDLElBQUksQ0FBQyxDQUFDLENBQUM7SUFDekQsQ0FBQztDQUNGO0FBVEQsa0NBU0MifQ== | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGF0YXNvdXJjZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9kYXRhc291cmNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsd0VBQWlFO0FBRWpFLGdFQUFrRDtBQUNsRCxvRkFBcUU7QUFDckUsd0VBQTBEO0FBQzFELG9FQUFzRDtBQUV0RCxNQUFxQixlQUFnQixTQUFRLG1DQUFjO0lBQ3pEO1FBQ0UsS0FBSyxFQUFFLENBQUM7UUFFUixJQUFJLENBQUMsYUFBYSxDQUFDLElBQUksZUFBZSxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUM7UUFDOUMsSUFBSSxDQUFDLGFBQWEsQ0FBQyxJQUFJLGlCQUFpQixDQUFDLElBQUksQ0FBQyxDQUFDLENBQUM7UUFDaEQsSUFBSSxDQUFDLGFBQWEsQ0FBQyxJQUFJLG1CQUFtQixDQUFDLElBQUksQ0FBQyxDQUFDLENBQUM7UUFDbEQsSUFBSSxDQUFDLGFBQWEsQ0FBQyxJQUFJLHlCQUF3QixDQUFDLElBQUksQ0FBQyxDQUFDLENBQUM7SUFDekQsQ0FBQztDQUNGO0FBVEQsa0NBU0MifQ== |
@@ -1,3 +0,3 @@ | ||
import { DataSource } from '@forestadmin/datasource-toolkit'; | ||
export default function makeDummyDataSource(): DataSource; | ||
import { DataSourceFactory } from '@forestadmin/datasource-toolkit'; | ||
export default function createDummyDataSource(): DataSourceFactory; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -8,42 +8,44 @@ "use strict"; | ||
const datasource_1 = __importDefault(require("./datasource")); | ||
function makeDummyDataSource() { | ||
const dummy = new datasource_1.default(); | ||
const relations = new datasource_toolkit_1.DataSourceDecorator(dummy, datasource_toolkit_1.RelationCollectionDecorator); | ||
relations.getCollection('persons').addRelation('books', { | ||
type: 'OneToMany', | ||
foreignCollection: 'books', | ||
originKey: 'authorId', | ||
}); | ||
relations.getCollection('books').addRelation('author', { | ||
type: 'ManyToOne', | ||
foreignCollection: 'persons', | ||
foreignKey: 'authorId', | ||
}); | ||
relations.getCollection('books').addRelation('librairies', { | ||
type: 'ManyToMany', | ||
foreignCollection: 'libraries', | ||
throughCollection: 'librariesBooks', | ||
originKey: 'bookId', | ||
foreignKey: 'libraryId', | ||
}); | ||
relations.getCollection('libraries').addRelation('books', { | ||
type: 'ManyToMany', | ||
originKey: 'libraryId', | ||
foreignKey: 'bookId', | ||
throughCollection: 'librariesBooks', | ||
foreignCollection: 'books', | ||
}); | ||
relations.getCollection('librariesBooks').addRelation('book', { | ||
type: 'ManyToOne', | ||
foreignCollection: 'books', | ||
foreignKey: 'bookId', | ||
}); | ||
relations.getCollection('librariesBooks').addRelation('library', { | ||
type: 'ManyToOne', | ||
foreignCollection: 'libraries', | ||
foreignKey: 'libraryId', | ||
}); | ||
return relations; | ||
function createDummyDataSource() { | ||
return async () => { | ||
const dummy = new datasource_1.default(); | ||
const relations = new datasource_toolkit_1.DataSourceDecorator(dummy, datasource_toolkit_1.RelationCollectionDecorator); | ||
relations.getCollection('persons').addRelation('books', { | ||
type: 'OneToMany', | ||
foreignCollection: 'books', | ||
originKey: 'authorId', | ||
}); | ||
relations.getCollection('books').addRelation('author', { | ||
type: 'ManyToOne', | ||
foreignCollection: 'persons', | ||
foreignKey: 'authorId', | ||
}); | ||
relations.getCollection('books').addRelation('librairies', { | ||
type: 'ManyToMany', | ||
foreignCollection: 'libraries', | ||
throughCollection: 'librariesBooks', | ||
originKey: 'bookId', | ||
foreignKey: 'libraryId', | ||
}); | ||
relations.getCollection('libraries').addRelation('books', { | ||
type: 'ManyToMany', | ||
originKey: 'libraryId', | ||
foreignKey: 'bookId', | ||
throughCollection: 'librariesBooks', | ||
foreignCollection: 'books', | ||
}); | ||
relations.getCollection('librariesBooks').addRelation('book', { | ||
type: 'ManyToOne', | ||
foreignCollection: 'books', | ||
foreignKey: 'bookId', | ||
}); | ||
relations.getCollection('librariesBooks').addRelation('library', { | ||
type: 'ManyToOne', | ||
foreignCollection: 'libraries', | ||
foreignKey: 'libraryId', | ||
}); | ||
return relations; | ||
}; | ||
} | ||
exports.default = makeDummyDataSource; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSx3RUFJeUM7QUFDekMsOERBQTJDO0FBRTNDLFNBQXdCLG1CQUFtQjtJQUN6QyxNQUFNLEtBQUssR0FBRyxJQUFJLG9CQUFlLEVBQUUsQ0FBQztJQUNwQyxNQUFNLFNBQVMsR0FBRyxJQUFJLHdDQUFtQixDQUFDLEtBQUssRUFBRSxnREFBMkIsQ0FBQyxDQUFDO0lBRTlFLFNBQVMsQ0FBQyxhQUFhLENBQUMsU0FBUyxDQUFDLENBQUMsV0FBVyxDQUFDLE9BQU8sRUFBRTtRQUN0RCxJQUFJLEVBQUUsV0FBVztRQUNqQixpQkFBaUIsRUFBRSxPQUFPO1FBQzFCLFNBQVMsRUFBRSxVQUFVO0tBQ3RCLENBQUMsQ0FBQztJQUVILFNBQVMsQ0FBQyxhQUFhLENBQUMsT0FBTyxDQUFDLENBQUMsV0FBVyxDQUFDLFFBQVEsRUFBRTtRQUNyRCxJQUFJLEVBQUUsV0FBVztRQUNqQixpQkFBaUIsRUFBRSxTQUFTO1FB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QUMsV0FBVyxDQUFDLE9BQU8sRUFBRTtZQUN4RCxJQUFJLEVBQUUsWUFBWTtZQUNsQixTQUFTLEVBQUUsV0FBVztZQUN0QixVQUFVLEVBQUUsUUFBUTtZQUNwQixpQkFBaUIsRUFBRSxnQkFBZ0I7WUFDbkMsaUJBQWlCLEVBQUUsT0FBTztTQUMzQixDQUFDLENBQUM7UUFFSCxTQUFTLENBQUMsYUFBYSxDQUFDLGdCQUFnQixDQUFDLENBQUMsV0FBVyxDQUFDLE1BQU0sRUFBRTtZQUM1RCxJQUFJLEVBQUUsV0FBVztZQUNqQixpQkFBaUIsRUFBRSxPQUFPO1lBQzFCLFVBQVUsRUFBRSxRQUFRO1NBQ3JCLENBQUMsQ0FBQztRQUVILFNBQVMsQ0FBQyxhQUFhLENBQUMsZ0JBQWdCLENBQUMsQ0FBQyxXQUFXLENBQUMsU0FBUyxFQUFFO1lBQy9ELElBQUksRUFBRSxXQUFXO1lBQ2pCLGlCQUFpQixFQUFFLFdBQVc7WUFDOUIsVUFBVSxFQUFFLFdBQVc7U0FDeEIsQ0FBQyxDQUFDO1FBRUgsT0FBTyxTQUFTLENBQUM7SUFDbkIsQ0FBQyxDQUFDO0FBQ0osQ0FBQztBQS9DRCx3Q0ErQ0MifQ== |
{ | ||
"name": "@forestadmin/datasource-dummy", | ||
"version": "1.0.0-beta.5", | ||
"version": "1.0.0-beta.6", | ||
"main": "dist/index.js", | ||
@@ -15,3 +15,3 @@ "license": "GPL-3.0", | ||
"dependencies": { | ||
"@forestadmin/datasource-toolkit": "1.0.0-beta.5" | ||
"@forestadmin/datasource-toolkit": "1.0.0-beta.6" | ||
}, | ||
@@ -18,0 +18,0 @@ "files": [ |
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
66087
384
+ Added@forestadmin/datasource-toolkit@1.0.0-beta.6(transitive)
+ Addedobject-hash@3.0.0(transitive)
- Removed@forestadmin/datasource-toolkit@1.0.0-beta.5(transitive)
- Removedobject-hash@2.2.0(transitive)