@christianriedl/media 1.0.168 → 1.0.170
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 +20 -0
- package/dist/booksService.js +56 -0
- package/dist/booksService.js.map +1 -0
- package/dist/iBooks.d.ts +38 -0
- package/dist/iBooks.js +2 -0
- package/dist/iBooks.js.map +1 -0
- package/dist/iMedia.d.ts +279 -275
- package/dist/iMedia.js +118 -114
- package/dist/iMedia.js.map +1 -1
- package/dist/iMediaInstance.d.ts +49 -49
- package/dist/iMediaInstance.js +1 -1
- package/dist/index.d.ts +10 -8
- package/dist/index.js +10 -8
- package/dist/index.js.map +1 -1
- package/dist/locationHelper.d.ts +11 -11
- package/dist/locationHelper.js +271 -271
- package/dist/locationHelper.js.map +1 -1
- package/dist/mediaHelper.d.ts +11 -11
- package/dist/mediaHelper.js +97 -97
- package/dist/mediaHelper.js.map +1 -1
- package/dist/mediaInstanceService.d.ts +18 -18
- package/dist/mediaInstanceService.js +88 -88
- package/dist/mediaInstanceService.js.map +1 -1
- package/dist/mediaService.d.ts +85 -85
- package/dist/mediaService.js +644 -644
- package/dist/mediaService.js.map +1 -1
- package/dist/mediaServiceBin.d.ts +84 -84
- package/dist/mediaServiceBin.js +746 -746
- package/dist/mediaServiceBin.js.map +1 -1
- package/dist/playerService.d.ts +51 -51
- package/dist/playerService.js +66 -66
- package/dist/playerService.js.map +1 -1
- package/package.json +5 -5
- package/src/views/MediaInstancePage.vue +1 -1
- package/src/views/MusicPage.vue +1 -1
- package/src/views/OnlineTVsPage.vue +2 -2
- package/src/views/PhotosPage.vue +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IRest } from '@christianriedl/rest';
|
|
2
|
+
import { ILogger, IStatistics, InjectionKey } from '@christianriedl/utils';
|
|
3
|
+
import { IBook, IAuthor, IAuthorShort, IBooksService } from "./iBooks";
|
|
4
|
+
export declare const getBooksSymbol: InjectionKey<() => BooksService>;
|
|
5
|
+
export declare class BooksService implements IBooksService {
|
|
6
|
+
rest: IRest;
|
|
7
|
+
mediaUrl: string;
|
|
8
|
+
user: string;
|
|
9
|
+
log: ILogger;
|
|
10
|
+
constructor(rest: IRest, user: string, statistics: IStatistics, log: ILogger);
|
|
11
|
+
getAuthors(surName?: string, givenName?: string, withBooks?: boolean, id?: number): Promise<IAuthor[]>;
|
|
12
|
+
getAuthorsShort(): Promise<IAuthorShort[]>;
|
|
13
|
+
addAuthor(author: IAuthor): Promise<boolean>;
|
|
14
|
+
updateAuthor(author: IAuthor): Promise<boolean>;
|
|
15
|
+
deleteAuthor(id: number): Promise<boolean>;
|
|
16
|
+
getBooks(authorId?: number, bookId?: number): Promise<IBook[]>;
|
|
17
|
+
addBook(book: IBook): Promise<boolean>;
|
|
18
|
+
updateBook(book: IBook): Promise<boolean>;
|
|
19
|
+
deleteBook(id: number): Promise<boolean>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export const getBooksSymbol = Symbol("get-books");
|
|
2
|
+
export class BooksService {
|
|
3
|
+
rest;
|
|
4
|
+
mediaUrl;
|
|
5
|
+
user;
|
|
6
|
+
log;
|
|
7
|
+
constructor(rest, user, statistics, log) {
|
|
8
|
+
this.log = log;
|
|
9
|
+
this.rest = rest;
|
|
10
|
+
this.user = user;
|
|
11
|
+
this.mediaUrl = rest.serviceUrl;
|
|
12
|
+
}
|
|
13
|
+
async getAuthors(surName, givenName, withBooks, id) {
|
|
14
|
+
const info = await this.rest.getData('apibooks/authors', { surName, givenName, withBooks, id });
|
|
15
|
+
return info.result;
|
|
16
|
+
}
|
|
17
|
+
async getAuthorsShort() {
|
|
18
|
+
const info = await this.rest.getData('apibooks/authors/short');
|
|
19
|
+
return info.result;
|
|
20
|
+
}
|
|
21
|
+
async addAuthor(author) {
|
|
22
|
+
const url = `apibooks/authors`;
|
|
23
|
+
const res = await this.rest.postData(url, author);
|
|
24
|
+
return res.result;
|
|
25
|
+
}
|
|
26
|
+
async updateAuthor(author) {
|
|
27
|
+
const url = `apibooks/authors`;
|
|
28
|
+
const res = await this.rest.putData(url, author);
|
|
29
|
+
return res.result;
|
|
30
|
+
}
|
|
31
|
+
async deleteAuthor(id) {
|
|
32
|
+
const url = `apibooks/authors?id=${id}`;
|
|
33
|
+
const res = await this.rest.deleteData(url);
|
|
34
|
+
return res.result;
|
|
35
|
+
}
|
|
36
|
+
async getBooks(authorId, bookId) {
|
|
37
|
+
const info = await this.rest.getData('apibooks/books', { authorId, bookId });
|
|
38
|
+
return info.result;
|
|
39
|
+
}
|
|
40
|
+
async addBook(book) {
|
|
41
|
+
const url = `apibooks/books`;
|
|
42
|
+
const res = await this.rest.postData(url, book);
|
|
43
|
+
return res.result;
|
|
44
|
+
}
|
|
45
|
+
async updateBook(book) {
|
|
46
|
+
const url = `apibooks/books`;
|
|
47
|
+
const res = await this.rest.putData(url, book);
|
|
48
|
+
return res.result;
|
|
49
|
+
}
|
|
50
|
+
async deleteBook(id) {
|
|
51
|
+
const url = `apibooks/books?id=${id}`;
|
|
52
|
+
const res = await this.rest.deleteData(url);
|
|
53
|
+
return res.result;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=booksService.js.map
|
|
@@ -0,0 +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,Q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AI,CAAC,IAAI,CAAC,OAAO,CAAU,gBAAgB,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;QACtF,OAAO,IAAI,CAAC,MAAiB,CAAC;IAClC,CAAC;IACD,KAAK,CAAC,OAAO,CAAC,IAAW;QACrB,MAAM,GAAG,GAAG,gBAAgB,CAAC;QAC7B,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAQ,GAAG,EAAE,IAAI,CAAC,CAAC;QACvD,OAAO,GAAG,CAAC,MAAiB,CAAC;IACjC,CAAC;IACD,KAAK,CAAC,UAAU,CAAC,IAAW;QAExB,MAAM,GAAG,GAAG,gBAAgB,CAAC;QAC7B,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAiB,GAAG,EAAE,IAAI,CAAC,CAAC;QAC/D,OAAO,GAAG,CAAC,MAAiB,CAAC;IACjC,CAAC;IACD,KAAK,CAAC,UAAU,CAAC,EAAU;QACvB,MAAM,GAAG,GAAG,qBAAqB,EAAE,EAAE,CAAC;QACtC,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,UAAU,CAAmB,GAAG,CAAC,CAAC;QAC9D,OAAO,GAAG,CAAC,MAAiB,CAAC;IACjC,CAAC;CACJ"}
|
package/dist/iBooks.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export interface IBookKey {
|
|
2
|
+
id: number;
|
|
3
|
+
value: string;
|
|
4
|
+
}
|
|
5
|
+
export interface IAuthor {
|
|
6
|
+
id: number;
|
|
7
|
+
surName: string;
|
|
8
|
+
givenName: string;
|
|
9
|
+
yearOfBirth: number;
|
|
10
|
+
yearOfDeath?: number;
|
|
11
|
+
country?: string;
|
|
12
|
+
books?: IBookKey[];
|
|
13
|
+
}
|
|
14
|
+
export interface IAuthorShort {
|
|
15
|
+
id: number;
|
|
16
|
+
sN: string;
|
|
17
|
+
gN: string;
|
|
18
|
+
}
|
|
19
|
+
export interface IBook {
|
|
20
|
+
id: number;
|
|
21
|
+
title: string;
|
|
22
|
+
authorId: number;
|
|
23
|
+
description?: string;
|
|
24
|
+
year?: number;
|
|
25
|
+
comment?: string;
|
|
26
|
+
rating?: number;
|
|
27
|
+
}
|
|
28
|
+
export interface IBooksService {
|
|
29
|
+
getAuthors(surName?: string, givenName?: string, withBooks?: boolean, id?: number): Promise<IAuthor[]>;
|
|
30
|
+
getAuthorsShort(): Promise<IAuthorShort[]>;
|
|
31
|
+
addAuthor(author: IAuthor): Promise<boolean>;
|
|
32
|
+
updateAuthor(author: IAuthor): Promise<boolean>;
|
|
33
|
+
deleteAuthor(id: number): Promise<boolean>;
|
|
34
|
+
getBooks(authorId?: number, bookId?: number): Promise<IBook[]>;
|
|
35
|
+
addBook(book: IBook): Promise<boolean>;
|
|
36
|
+
updateBook(book: IBook): Promise<boolean>;
|
|
37
|
+
deleteBook(id: number): Promise<boolean>;
|
|
38
|
+
}
|
package/dist/iBooks.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iBooks.js","sourceRoot":"","sources":["../src/iBooks.ts"],"names":[],"mappings":""}
|