jamespot-user-api 1.0.102 → 1.0.103
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/documentation/assets/search.js +1 -1
- package/documentation/classes/AdminStoreApi.html +1 -1
- package/documentation/classes/JApplicationApi.html +8 -8
- package/documentation/classes/JArticleApi.html +1 -1
- package/documentation/classes/JAssetReservation.html +1 -1
- package/documentation/classes/JAudienceApi.html +1 -1
- package/documentation/classes/JBaseApi.html +1 -1
- package/documentation/classes/JBookmarkApi.html +1 -1
- package/documentation/classes/JCommunityApi.html +1 -1
- package/documentation/classes/JDiapazoneApi.html +1 -1
- package/documentation/classes/JFileApi.html +5 -5
- package/documentation/classes/JFilebankApi.html +1 -1
- package/documentation/classes/JGroupApi.html +9 -9
- package/documentation/classes/JLandApi.html +1 -1
- package/documentation/classes/JLicenseApi.html +4 -4
- package/documentation/classes/JMessengerApi.html +1 -1
- package/documentation/classes/JSearchApi.html +6 -6
- package/documentation/classes/JShareApi.html +1 -1
- package/documentation/classes/JTaxonomyApi.html +2 -2
- package/documentation/classes/JUserApi.html +5 -5
- package/documentation/classes/JWedocApi.html +1 -1
- package/documentation/classes/JamespotUserApi.html +1 -1
- package/documentation/classes/Network.html +1 -1
- package/documentation/classes/WindowBrowser.html +1 -1
- package/documentation/enums/StudioApplicationStatus.html +1 -1
- package/documentation/index.html +1 -1
- package/documentation/interfaces/AccessRightObject.html +1 -1
- package/documentation/interfaces/ApiDefaultWrapper.html +1 -1
- package/documentation/interfaces/ApiError.html +1 -1
- package/documentation/interfaces/ApiWrapper.html +1 -1
- package/documentation/interfaces/BaseAutocomplete.html +1 -1
- package/documentation/interfaces/BaseMessage.html +1 -1
- package/documentation/interfaces/Category.html +1 -1
- package/documentation/interfaces/FileBankProps.html +1 -1
- package/documentation/interfaces/FolderProps.html +1 -1
- package/documentation/interfaces/ListFilterSpec.html +1 -1
- package/documentation/interfaces/OF.html +1 -1
- package/documentation/interfaces/ObjectListProps.html +1 -1
- package/documentation/interfaces/PagingResults.html +1 -1
- package/documentation/interfaces/RootFolderProps.html +1 -1
- package/documentation/interfaces/SearchCategoryModel.html +1 -1
- package/documentation/interfaces/SearchCategoryValue.html +1 -1
- package/documentation/interfaces/SearchConfig.html +1 -1
- package/documentation/interfaces/SearchFacetModel.html +1 -1
- package/documentation/interfaces/SearchFacetValueModel.html +1 -1
- package/documentation/interfaces/SearchQuery.html +1 -1
- package/documentation/interfaces/SearchQueryFilterModel.html +1 -1
- package/documentation/interfaces/SearchQueryOption.html +1 -1
- package/documentation/interfaces/SearchQueryResult.html +1 -1
- package/documentation/interfaces/SearchQuerySortModel.html +1 -1
- package/documentation/interfaces/SearchResultCatProps.html +1 -1
- package/documentation/interfaces/SearchResultPropsApp.html +1 -1
- package/documentation/interfaces/SearchResultPropsObject.html +1 -1
- package/documentation/interfaces/SpotProps.html +1 -1
- package/documentation/interfaces/Taxonomy.html +1 -1
- package/documentation/interfaces/TaxonomyCreate.html +1 -1
- package/documentation/interfaces/WindowInterface.html +1 -1
- package/documentation/modules.html +16 -3
- package/lib/src/apis/bookmark.d.ts +19 -1
- package/lib/src/apis/group.d.ts +50 -5
- package/lib/src/types/index.d.ts +1 -0
- package/lib/src/types/spot.d.ts +5 -0
- package/lib/src/types/tvDisplay.d.ts +32 -0
- package/lib/src/types/utils.d.ts +24 -2
- package/lib/src/util/Test.d.ts +20 -2
- package/package.json +1 -1
|
@@ -10,7 +10,25 @@ export interface ListFilterSpec {
|
|
|
10
10
|
export declare class JBookmarkApi extends JBaseApi {
|
|
11
11
|
getFormattedList<T extends keyof BookmarkTypes>(filterSpecs: ListFilterSpec, format: T): Promise<ApiWrapper<PagingResults<BookmarkTypes[T]>, import("../types").BaseMessages>>;
|
|
12
12
|
addFormattedLink<T extends keyof BookmarkTypes>(targetId: number, targetType: string, format: T): Promise<ApiWrapper<BookmarkTypes[T], import("../types").BaseMessages>>;
|
|
13
|
-
addBookmark(bookmark: Pick<BookmarkTypes[keyof BookmarkTypes], 'bookmarkLabel' | 'bookmarkMeta' | 'bookmarkUrl'>, format?: keyof BookmarkTypes): Promise<ApiWrapper<import("../types").BookmarkRawList<
|
|
13
|
+
addBookmark(bookmark: Pick<BookmarkTypes[keyof BookmarkTypes], 'bookmarkLabel' | 'bookmarkMeta' | 'bookmarkUrl'>, format?: keyof BookmarkTypes): Promise<ApiWrapper<import("../types").BookmarkRawList<{
|
|
14
|
+
id: number;
|
|
15
|
+
mainType: string;
|
|
16
|
+
type: string;
|
|
17
|
+
uri: string;
|
|
18
|
+
dateCreation?: string;
|
|
19
|
+
dateModified?: string;
|
|
20
|
+
title: string;
|
|
21
|
+
_url: string;
|
|
22
|
+
}> | import("../types").BookmarkList<{
|
|
23
|
+
id: number;
|
|
24
|
+
mainType: string;
|
|
25
|
+
type: string;
|
|
26
|
+
uri: string;
|
|
27
|
+
dateCreation?: string;
|
|
28
|
+
dateModified?: string;
|
|
29
|
+
title: string;
|
|
30
|
+
_url: string;
|
|
31
|
+
}>, BaseMessagesOne>>;
|
|
14
32
|
delete(bookmarkId: number): Promise<ApiWrapper<null, BaseMessagesOne>>;
|
|
15
33
|
rename(bookmarkID: number, bookmarkLabel: string, bookmarkUrl?: string): Promise<ApiWrapper<null, BaseMessagesOne>>;
|
|
16
34
|
move(bookmarkID: number, bookmarkReference: number, position: 'before' | 'after'): Promise<ApiWrapper<null, BaseMessagesOne>>;
|
package/lib/src/apis/group.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiReturn, Category, CreateGroup, Format, GroupList, GroupProperties, GroupView, GroupWidget,
|
|
1
|
+
import { ApiReturn, Category, CreateGroup, Format, GroupList, GroupProperties, GroupView, GroupWidget, PagingResults, UpdateGroup } from '../types';
|
|
2
2
|
import { JBaseApi } from './base';
|
|
3
3
|
export declare class JGroupApi extends JBaseApi {
|
|
4
4
|
/**
|
|
@@ -7,21 +7,57 @@ export declare class JGroupApi extends JBaseApi {
|
|
|
7
7
|
* @param format return format
|
|
8
8
|
* @returns
|
|
9
9
|
*/
|
|
10
|
-
create<T extends Format = undefined>(group: CreateGroup, format?: T): Promise<import("../types").ApiWrapper<ApiReturn<T,
|
|
10
|
+
create<T extends Format = undefined>(group: CreateGroup, format?: T): Promise<import("../types").ApiWrapper<ApiReturn<T, {
|
|
11
|
+
id: number;
|
|
12
|
+
mainType: string;
|
|
13
|
+
type: string;
|
|
14
|
+
uri: string;
|
|
15
|
+
dateCreation?: string;
|
|
16
|
+
dateModified?: string;
|
|
17
|
+
title: string;
|
|
18
|
+
_url: string;
|
|
19
|
+
}, GroupList, GroupView, {
|
|
20
|
+
id: number;
|
|
21
|
+
mainType: string;
|
|
22
|
+
type: string;
|
|
23
|
+
uri: string;
|
|
24
|
+
dateCreation?: string;
|
|
25
|
+
dateModified?: string;
|
|
26
|
+
title: string;
|
|
27
|
+
_url: string;
|
|
28
|
+
}>, import("../types").BaseMessages>>;
|
|
11
29
|
/**
|
|
12
30
|
* Update a group
|
|
13
31
|
* @param group group to update. The uri is mandatory and identify the group to update
|
|
14
32
|
* @param format return format
|
|
15
33
|
* @returns
|
|
16
34
|
*/
|
|
17
|
-
update<T extends Format = undefined>(group: UpdateGroup, format?: T): Promise<import("../types").ApiWrapper<ApiReturn<T,
|
|
35
|
+
update<T extends Format = undefined>(group: UpdateGroup, format?: T): Promise<import("../types").ApiWrapper<ApiReturn<T, {
|
|
36
|
+
id: number;
|
|
37
|
+
mainType: string;
|
|
38
|
+
type: string;
|
|
39
|
+
uri: string;
|
|
40
|
+
dateCreation?: string;
|
|
41
|
+
dateModified?: string;
|
|
42
|
+
title: string;
|
|
43
|
+
_url: string;
|
|
44
|
+
}, GroupList, GroupView, string>, import("../types").BaseMessages>>;
|
|
18
45
|
/**
|
|
19
46
|
* Get a spot
|
|
20
47
|
* @param idSpot
|
|
21
48
|
* @param format
|
|
22
49
|
* @returns
|
|
23
50
|
*/
|
|
24
|
-
getSpot<T extends Format = undefined>(idSpot: number | string, format?: T): Promise<import("../types").ApiWrapper<ApiReturn<T,
|
|
51
|
+
getSpot<T extends Format = undefined>(idSpot: number | string, format?: T): Promise<import("../types").ApiWrapper<ApiReturn<T, {
|
|
52
|
+
id: number;
|
|
53
|
+
mainType: string;
|
|
54
|
+
type: string;
|
|
55
|
+
uri: string;
|
|
56
|
+
dateCreation?: string;
|
|
57
|
+
dateModified?: string;
|
|
58
|
+
title: string;
|
|
59
|
+
_url: string;
|
|
60
|
+
}, GroupList, GroupView, string>, import("../types").BaseMessages>>;
|
|
25
61
|
/**
|
|
26
62
|
* Get the properties of a group that are not within the model
|
|
27
63
|
* @param idSpot
|
|
@@ -45,5 +81,14 @@ export declare class JGroupApi extends JBaseApi {
|
|
|
45
81
|
* @param page page number
|
|
46
82
|
* @return array of User
|
|
47
83
|
*/
|
|
48
|
-
getObjectListJamespotSpotMembers(idSpot: number | string, query?: string, limit?: number, page?: number): Promise<import("../types").ApiWrapper<PagingResults<
|
|
84
|
+
getObjectListJamespotSpotMembers(idSpot: number | string, query?: string, limit?: number, page?: number): Promise<import("../types").ApiWrapper<PagingResults<{
|
|
85
|
+
id: number;
|
|
86
|
+
mainType: string;
|
|
87
|
+
type: string;
|
|
88
|
+
uri: string;
|
|
89
|
+
dateCreation?: string;
|
|
90
|
+
dateModified?: string;
|
|
91
|
+
title: string;
|
|
92
|
+
_url: string;
|
|
93
|
+
}>, import("../types").BaseMessages>>;
|
|
49
94
|
}
|
package/lib/src/types/index.d.ts
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jSpotLittle } from './spot';
|
|
2
|
+
import { Readable, jArticleList, jArticleLittle } from './utils';
|
|
3
|
+
declare type TVChannelCustomListDynamic = {
|
|
4
|
+
tvChannelType: 'DYNAMIC';
|
|
5
|
+
tvChannelBackgroundColor: string;
|
|
6
|
+
tvChannelGroupTarget?: jSpotLittle;
|
|
7
|
+
tvChannelConfig: {
|
|
8
|
+
contents: Array<{
|
|
9
|
+
uri: string;
|
|
10
|
+
dateEnd: Date;
|
|
11
|
+
}>;
|
|
12
|
+
};
|
|
13
|
+
tvChannelNumImages: 0;
|
|
14
|
+
};
|
|
15
|
+
declare type TVChannelCustomListSlideshow = {
|
|
16
|
+
tvChannelType: 'SLIDESHOW';
|
|
17
|
+
tvChannelBackgroundColor: string;
|
|
18
|
+
tvChannelNumImages: number;
|
|
19
|
+
tvChannelConfig: {
|
|
20
|
+
contents: Array<{
|
|
21
|
+
uri: string;
|
|
22
|
+
dateEnd: Date;
|
|
23
|
+
}>;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export declare type TVChannelLittle = Readable<jArticleLittle>;
|
|
27
|
+
export declare type TVChannelList = Readable<jArticleList & (TVChannelCustomListDynamic | TVChannelCustomListSlideshow)>;
|
|
28
|
+
export declare type TVChannelCreatePayload = {
|
|
29
|
+
tvChannelGroupTarget?: Array<string>;
|
|
30
|
+
tvChannelNumImages?: never;
|
|
31
|
+
};
|
|
32
|
+
export {};
|
package/lib/src/types/utils.d.ts
CHANGED
|
@@ -1,4 +1,25 @@
|
|
|
1
1
|
import { jUserLittle } from './user';
|
|
2
|
+
/**
|
|
3
|
+
* Ease usage in IDE by decomposing complex types
|
|
4
|
+
* Decompose combined types into simple object types
|
|
5
|
+
* A: {a: string}
|
|
6
|
+
* B: A & {b: int}
|
|
7
|
+
* Readable<B> => {a: string, b:int}
|
|
8
|
+
*/
|
|
9
|
+
export declare type Readable<T> = T extends infer U ? {
|
|
10
|
+
[K in keyof U]: U[K];
|
|
11
|
+
} : never;
|
|
12
|
+
declare type AllKeys<T> = T extends unknown ? keyof T : never;
|
|
13
|
+
declare type _ExclusifyUnion<T, K extends PropertyKey> = T extends unknown ? Readable<T & Partial<Record<Exclude<K, keyof T>, never>>> : never;
|
|
14
|
+
/**
|
|
15
|
+
* Builds an exclusive union type from a union type
|
|
16
|
+
* C = ExclusifyUnion<A|B>
|
|
17
|
+
* toto:C = {a: "tata"} OK
|
|
18
|
+
* tata:C = {b: 123} OK
|
|
19
|
+
* tutu: C = {a: "tata", b: 123} KO => Types of property 'a' are incompatible. Type 'string' is not assignable to type 'undefined'.
|
|
20
|
+
* This is the kind of error shown when you add too many properties with this definition.
|
|
21
|
+
*/
|
|
22
|
+
export declare type ExclusifyUnion<T> = _ExclusifyUnion<T, AllKeys<T>>;
|
|
2
23
|
export interface BaseMessage {
|
|
3
24
|
msg: string;
|
|
4
25
|
code: number;
|
|
@@ -46,10 +67,10 @@ export declare type jObjectBase = {
|
|
|
46
67
|
dateCreation?: string;
|
|
47
68
|
dateModified?: string;
|
|
48
69
|
};
|
|
49
|
-
export declare type jObjectLittle = jObjectBase & {
|
|
70
|
+
export declare type jObjectLittle = Readable<jObjectBase & {
|
|
50
71
|
title: string;
|
|
51
72
|
_url: string;
|
|
52
|
-
}
|
|
73
|
+
}>;
|
|
53
74
|
export declare type jObjectList = jObjectLittle & {
|
|
54
75
|
description?: string;
|
|
55
76
|
_user: jUserLittle;
|
|
@@ -118,3 +139,4 @@ export declare type MaybeWithParent<T extends jObjectBase = jObjectBase> = {
|
|
|
118
139
|
export declare type Format = 'raw-little' | 'raw-list' | 'raw-view' | undefined;
|
|
119
140
|
export declare type ApiReturn<T extends Format, Little, List = Little, View = List, Default = {}> = T extends 'raw-little' ? Little : T extends 'raw-list' ? List : T extends 'raw-view' ? View : Default;
|
|
120
141
|
export declare type ValueOf<T> = T[keyof T];
|
|
142
|
+
export {};
|
package/lib/src/util/Test.d.ts
CHANGED
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
import { JamespotUserApi } from '../apis';
|
|
2
|
-
import { ApiDefaultWrapper, PagingResults, jArticleLittle, jObjectAutocomplete
|
|
2
|
+
import { ApiDefaultWrapper, PagingResults, jArticleLittle, jObjectAutocomplete } from '../types';
|
|
3
3
|
import { Network } from './network';
|
|
4
4
|
export declare const network: Network;
|
|
5
5
|
export declare const jApi: JamespotUserApi;
|
|
6
6
|
export declare const validateJArticle: <T extends jArticleLittle>(received: T, expected: T, _format: 'raw-little' | 'raw-list' | 'raw-view') => void;
|
|
7
7
|
export declare const validateApiWrapper: <T extends ApiDefaultWrapper<import("../types").BaseMessages>>(res: T, o: string, f: string, error?: null) => void;
|
|
8
8
|
export declare const validatePagingResults: <T>(res: PagingResults<T>) => void;
|
|
9
|
-
export declare const validateObjectIsFormatLittle: <T extends
|
|
9
|
+
export declare const validateObjectIsFormatLittle: <T extends {
|
|
10
|
+
id: number;
|
|
11
|
+
mainType: string;
|
|
12
|
+
type: string;
|
|
13
|
+
uri: string;
|
|
14
|
+
dateCreation?: string;
|
|
15
|
+
dateModified?: string;
|
|
16
|
+
title: string;
|
|
17
|
+
_url: string;
|
|
18
|
+
} = {
|
|
19
|
+
id: number;
|
|
20
|
+
mainType: string;
|
|
21
|
+
type: string;
|
|
22
|
+
uri: string;
|
|
23
|
+
dateCreation?: string;
|
|
24
|
+
dateModified?: string;
|
|
25
|
+
title: string;
|
|
26
|
+
_url: string;
|
|
27
|
+
}>(object: T) => boolean;
|
|
10
28
|
export declare const validateObjectIsFormatAutocomplete: <T extends jObjectAutocomplete = jObjectAutocomplete>(object: T) => boolean;
|