@christianriedl/media 1.0.170 → 1.0.172
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/booksService.d.ts +3 -2
- package/dist/booksService.js +28 -10
- package/dist/booksService.js.map +1 -1
- package/dist/iBooks.d.ts +3 -7
- package/package.json +1 -1
- package/src/views/MusicPage.vue +1 -1
package/dist/booksService.d.ts
CHANGED
|
@@ -7,14 +7,15 @@ export declare class BooksService implements IBooksService {
|
|
|
7
7
|
mediaUrl: string;
|
|
8
8
|
user: string;
|
|
9
9
|
log: ILogger;
|
|
10
|
+
cachedAuthors?: IAuthorShort[];
|
|
10
11
|
constructor(rest: IRest, user: string, statistics: IStatistics, log: ILogger);
|
|
11
12
|
getAuthors(surName?: string, givenName?: string, withBooks?: boolean, id?: number): Promise<IAuthor[]>;
|
|
12
13
|
getAuthorsShort(): Promise<IAuthorShort[]>;
|
|
13
|
-
addAuthor(author: IAuthor): Promise<
|
|
14
|
+
addAuthor(author: IAuthor): Promise<number>;
|
|
14
15
|
updateAuthor(author: IAuthor): Promise<boolean>;
|
|
15
16
|
deleteAuthor(id: number): Promise<boolean>;
|
|
16
17
|
getBooks(authorId?: number, bookId?: number): Promise<IBook[]>;
|
|
17
|
-
addBook(book: IBook): Promise<
|
|
18
|
+
addBook(book: IBook): Promise<number>;
|
|
18
19
|
updateBook(book: IBook): Promise<boolean>;
|
|
19
20
|
deleteBook(id: number): Promise<boolean>;
|
|
20
21
|
}
|
package/dist/booksService.js
CHANGED
|
@@ -4,6 +4,7 @@ export class BooksService {
|
|
|
4
4
|
mediaUrl;
|
|
5
5
|
user;
|
|
6
6
|
log;
|
|
7
|
+
cachedAuthors;
|
|
7
8
|
constructor(rest, user, statistics, log) {
|
|
8
9
|
this.log = log;
|
|
9
10
|
this.rest = rest;
|
|
@@ -15,23 +16,34 @@ export class BooksService {
|
|
|
15
16
|
return info.result;
|
|
16
17
|
}
|
|
17
18
|
async getAuthorsShort() {
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
if (!this.cachedAuthors) {
|
|
20
|
+
const info = await this.rest.getData('apibooks/authors/short');
|
|
21
|
+
this.cachedAuthors = info.result;
|
|
22
|
+
}
|
|
23
|
+
return this.cachedAuthors;
|
|
20
24
|
}
|
|
21
25
|
async addAuthor(author) {
|
|
22
26
|
const url = `apibooks/authors`;
|
|
23
|
-
const res = await this.rest.
|
|
24
|
-
|
|
27
|
+
const res = await this.rest.postDataEx(url, author);
|
|
28
|
+
this.cachedAuthors = undefined;
|
|
29
|
+
const r = res.result;
|
|
30
|
+
this.log.info(`Add author ${author.surName} : ${r.result}`);
|
|
31
|
+
return r.result;
|
|
25
32
|
}
|
|
26
33
|
async updateAuthor(author) {
|
|
27
34
|
const url = `apibooks/authors`;
|
|
28
35
|
const res = await this.rest.putData(url, author);
|
|
29
|
-
|
|
36
|
+
const r = res.result;
|
|
37
|
+
this.log.info(`Update author ${author.surName} : ${r.result}`);
|
|
38
|
+
return r.result;
|
|
30
39
|
}
|
|
31
40
|
async deleteAuthor(id) {
|
|
32
41
|
const url = `apibooks/authors?id=${id}`;
|
|
33
42
|
const res = await this.rest.deleteData(url);
|
|
34
|
-
|
|
43
|
+
this.cachedAuthors = undefined;
|
|
44
|
+
const r = res.result;
|
|
45
|
+
this.log.info(`Delete author ${id} : ${r.result}`);
|
|
46
|
+
return r.result;
|
|
35
47
|
}
|
|
36
48
|
async getBooks(authorId, bookId) {
|
|
37
49
|
const info = await this.rest.getData('apibooks/books', { authorId, bookId });
|
|
@@ -39,18 +51,24 @@ export class BooksService {
|
|
|
39
51
|
}
|
|
40
52
|
async addBook(book) {
|
|
41
53
|
const url = `apibooks/books`;
|
|
42
|
-
const res = await this.rest.
|
|
43
|
-
|
|
54
|
+
const res = await this.rest.postDataEx(url, book);
|
|
55
|
+
const r = res.result;
|
|
56
|
+
this.log.info(`Add book ${book.title} : ${r.result}`);
|
|
57
|
+
return r.result;
|
|
44
58
|
}
|
|
45
59
|
async updateBook(book) {
|
|
46
60
|
const url = `apibooks/books`;
|
|
47
61
|
const res = await this.rest.putData(url, book);
|
|
48
|
-
|
|
62
|
+
const r = res.result;
|
|
63
|
+
this.log.info(`Update book ${book.title} : ${r.result}`);
|
|
64
|
+
return r.result;
|
|
49
65
|
}
|
|
50
66
|
async deleteBook(id) {
|
|
51
67
|
const url = `apibooks/books?id=${id}`;
|
|
52
68
|
const res = await this.rest.deleteData(url);
|
|
53
|
-
|
|
69
|
+
const r = res.result;
|
|
70
|
+
this.log.info(`Add book ${id} : ${r.result}`);
|
|
71
|
+
return r.result;
|
|
54
72
|
}
|
|
55
73
|
}
|
|
56
74
|
//# sourceMappingURL=booksService.js.map
|
package/dist/booksService.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"booksService.js","sourceRoot":"","sources":["../src/booksService.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,cAAc,GAAqC,MAAM,CAAC,WAAW,CAAC,CAAC;AACpF,MAAM,OAAO,YAAY;IACrB,IAAI,CAAQ;IACZ,QAAQ,CAAS;IACjB,IAAI,CAAS;IACb,GAAG,CAAU;IACb,YAAY,IAAW,EAAE,IAAY,EAAE,UAAuB,EAAE,GAAY;QACxE,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAC;IACpC,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,OAAgB,EAAE,SAAkB,EAAE,SAAmB,EAAE,EAAW;QACnF,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAa,kBAAkB,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC;QAC5G,OAAO,IAAI,CAAC,MAAmB,CAAC;IACpC,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AC7C,OAAO,CAAC,CAAC,MAAM,CAAC;IACpB,CAAC;CACJ"}
|
package/dist/iBooks.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
export interface IBookKey {
|
|
2
|
-
id: number;
|
|
3
|
-
value: string;
|
|
4
|
-
}
|
|
5
1
|
export interface IAuthor {
|
|
6
2
|
id: number;
|
|
7
3
|
surName: string;
|
|
@@ -9,7 +5,7 @@ export interface IAuthor {
|
|
|
9
5
|
yearOfBirth: number;
|
|
10
6
|
yearOfDeath?: number;
|
|
11
7
|
country?: string;
|
|
12
|
-
books?:
|
|
8
|
+
books?: IBook[];
|
|
13
9
|
}
|
|
14
10
|
export interface IAuthorShort {
|
|
15
11
|
id: number;
|
|
@@ -28,11 +24,11 @@ export interface IBook {
|
|
|
28
24
|
export interface IBooksService {
|
|
29
25
|
getAuthors(surName?: string, givenName?: string, withBooks?: boolean, id?: number): Promise<IAuthor[]>;
|
|
30
26
|
getAuthorsShort(): Promise<IAuthorShort[]>;
|
|
31
|
-
addAuthor(author: IAuthor): Promise<
|
|
27
|
+
addAuthor(author: IAuthor): Promise<number>;
|
|
32
28
|
updateAuthor(author: IAuthor): Promise<boolean>;
|
|
33
29
|
deleteAuthor(id: number): Promise<boolean>;
|
|
34
30
|
getBooks(authorId?: number, bookId?: number): Promise<IBook[]>;
|
|
35
|
-
addBook(book: IBook): Promise<
|
|
31
|
+
addBook(book: IBook): Promise<number>;
|
|
36
32
|
updateBook(book: IBook): Promise<boolean>;
|
|
37
33
|
deleteBook(id: number): Promise<boolean>;
|
|
38
34
|
}
|
package/package.json
CHANGED
package/src/views/MusicPage.vue
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { inject, ref, reactive, computed, onMounted, onUnmounted, nextTick, watch, StyleValue } from 'vue';
|
|
2
|
+
import { inject, ref, reactive, computed, onMounted, onUnmounted, nextTick, watch, StyleValue } from 'vue';
|
|
3
3
|
import type { ComponentPublicInstance } from 'vue';
|
|
4
4
|
import { useRouter } from 'vue-router';
|
|
5
5
|
import { IAppState, Helper, EDevice, EScope, appStateSymbol, IAppConfig, appConfigSymbol } from '@christianriedl/utils';
|