Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12,524 changes: 3,252 additions & 9,272 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,17 @@
"access": "public"
},
"devDependencies": {
"@thisisagile/easy-test": "^1.14.2",
"@thisisagile/easy-test": "^11.3.16",
"dotenv": "^8.2.0",
"prettier": "^2.2.1",
"semantic-release": "^17.4.2",
"ts-jest": "^28.0.5",
"ts-node": "^9.1.1",
"typescript": "4.2.4"
"typescript": "4.7.4"
},
"dependencies": {
"@thisisagile/easy": "^4.4.13",
"@thisisagile/easy": "^11.3.16",
"@thisisagile/easy-express": "^11.3.16",
"@types/express": "^4.17.11",
"express": "^4.17.1"
},
Expand Down
3 changes: 2 additions & 1 deletion src/SampleService.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { error, ExpressProvider, Handler, HealthResource, notFound, Service } from '@thisisagile/easy';
import { Handler, HealthResource, Service } from '@thisisagile/easy';
import { error, ExpressProvider, notFound } from '@thisisagile/easy-express';

export class SampleService extends Service {
static readonly Movie = new SampleService('movie', new ExpressProvider());
Expand Down
12 changes: 6 additions & 6 deletions src/data/MovieMap.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Map } from '@thisisagile/easy';
import { Mapper } from '@thisisagile/easy';

export class MovieMap extends Map {
readonly id = this.prop('imdbID');
readonly title = this.prop('Title');
readonly year = this.prop('Year');
readonly poster = this.prop('Poster');
export class MovieMap extends Mapper {
readonly id = this.map.item('imdbID');
readonly title = this.map.item('Title');
readonly year = this.map.item('Year');
readonly poster = this.map.item('Poster');
}
6 changes: 5 additions & 1 deletion src/data/OmdbGateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import { OmdbUri } from './OmdbUri';

export class OmdbGateway extends RouteGateway {
constructor(readonly api = new Api()) {
super(OmdbUri.Movies, OmdbUri.Movie, api);
super(
() => OmdbUri.Movies,
() => OmdbUri.Movie,
api
);
}

search = (q: unknown): Promise<List<Json>> =>
Expand Down
3 changes: 2 additions & 1 deletion test/domain/Movie.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Movie } from '../../src/domain/Movie';
import '@thisisagile/easy-test';
import movies from '../ref/movies.json';
import omdb from '../ref/omdb.json';
import { fits } from '@thisisagile/easy-test';

describe('Movie', () => {
test('Movie maps correctly', () => {
Expand All @@ -25,6 +26,6 @@ describe('Movie', () => {
test('Movie from data is correct', () => {
const m = new Movie(omdb[0]);
expect(m.id).toBe('tt0079470');
expect(m.toJSON()).toEqual(movies[0]);
expect(m.toJSON()).toEqual(fits.json(movies[0]));
});
});
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"sourceMap": true,
"outDir": "dist",
"baseUrl": ".",
"skipLibCheck": true,
"paths": {
"*": ["node_modules/*"]
}
Expand Down