jamespot-user-api 1.0.102 → 1.0.104
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/AdminLicenseApi.html +58 -0
- package/documentation/classes/AdminStoreApi.html +1 -1
- package/documentation/classes/AdminUtilsApi.html +3 -0
- 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/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/AdminLicenseUser.html +1 -0
- 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 +17 -3
- package/lib/jamespot-user-api.js +1 -1
- package/lib/jamespot-user-api.js.map +1 -1
- package/lib/src/apis/admin/index.d.ts +3 -0
- package/lib/src/apis/admin/license.d.ts +74 -0
- package/lib/src/apis/{Licenses → admin}/licenses.mock.d.ts +3 -4
- package/lib/src/apis/{adminStore.d.ts → admin/store.d.ts} +2 -3
- package/lib/src/apis/admin/utils.d.ts +8 -0
- package/lib/src/apis/bookmark.d.ts +19 -1
- package/lib/src/apis/group.d.ts +50 -5
- package/lib/src/apis/index.d.ts +1 -2
- package/lib/src/apis/jamespotUserApi.d.ts +3 -3
- package/lib/src/apis/jland/jland.d.ts +2 -3
- package/lib/src/apis/user/user.d.ts +0 -1
- package/lib/src/types/adminLicence.d.ts +43 -0
- package/lib/src/types/adminUtils.d.ts +18 -0
- package/lib/src/types/index.d.ts +3 -0
- package/lib/src/types/model.d.ts +3 -1
- package/lib/src/types/spot.d.ts +5 -0
- package/lib/src/types/tvDisplay.d.ts +32 -0
- package/lib/src/types/user.d.ts +4 -0
- package/lib/src/types/utils.d.ts +26 -3
- package/lib/src/util/Test.d.ts +21 -2
- package/package.json +1 -1
- package/phpunitMock/objectListJamespotUserQueryList-rawList.json +25 -14
- package/documentation/classes/JLicenseApi.html +0 -18
- package/lib/src/apis/Licenses/licenses.d.ts +0 -44
- /package/lib/src/apis/{Licenses → admin}/licences.test.d.ts +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { ApiWrapper } from '
|
|
2
|
-
import { JBaseApi } from '
|
|
3
|
-
import { StoreItem, StoreFinalize } from '../types/adminStore';
|
|
1
|
+
import { ApiWrapper, StoreItem, StoreFinalize } from '../../types';
|
|
2
|
+
import { JBaseApi } from '../base';
|
|
4
3
|
export declare class AdminStoreApi extends JBaseApi {
|
|
5
4
|
getItem(uri: string): Promise<ApiWrapper<StoreItem>>;
|
|
6
5
|
checkoutBilling(uri: string): Promise<ApiWrapper<boolean>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AdminApps } from '../../types';
|
|
2
|
+
import { JBaseApi } from '../base';
|
|
3
|
+
export declare class AdminUtilsApi extends JBaseApi {
|
|
4
|
+
/**
|
|
5
|
+
* Request the admin applications and sub applications for the admin panel
|
|
6
|
+
*/
|
|
7
|
+
getApps(): Promise<import("../../types").ApiWrapper<AdminApps, import("../../types").BaseMessages>>;
|
|
8
|
+
}
|
|
@@ -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/apis/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './admin';
|
|
2
2
|
export * from './application';
|
|
3
3
|
export * from './article/article';
|
|
4
4
|
export * from './assetReservation';
|
|
@@ -12,7 +12,6 @@ export * from './filebank';
|
|
|
12
12
|
export * from './group';
|
|
13
13
|
export * from './jamespotUserApi';
|
|
14
14
|
export * from './jland/jland';
|
|
15
|
-
export * from './Licenses/licenses';
|
|
16
15
|
export * from './messenger';
|
|
17
16
|
export * from './search/search';
|
|
18
17
|
export * from './share';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AdminStoreApi } from './
|
|
1
|
+
import { AdminLicenseApi, AdminUtilsApi, AdminStoreApi } from './admin';
|
|
2
2
|
import { JApplicationApi } from './application';
|
|
3
3
|
import { JArticleApi } from './article/article';
|
|
4
4
|
import { JAseiApi } from './asei';
|
|
@@ -19,7 +19,6 @@ import { JDiapazoneApi } from './diapazone';
|
|
|
19
19
|
import { JWedocApi } from './wedoc';
|
|
20
20
|
import { Network } from '../util/network';
|
|
21
21
|
import { JShareApi } from './share';
|
|
22
|
-
import { JLicenseApi } from './Licenses/licenses';
|
|
23
22
|
/**
|
|
24
23
|
* In browser usage, 'window' should be the window object.
|
|
25
24
|
* In server side usage, 'window' object given must implement the fetch method, used by the Apis.
|
|
@@ -31,7 +30,9 @@ export declare class JamespotUserApi {
|
|
|
31
30
|
version: string;
|
|
32
31
|
network: Network;
|
|
33
32
|
admin: {
|
|
33
|
+
license: AdminLicenseApi;
|
|
34
34
|
store: AdminStoreApi;
|
|
35
|
+
utils: AdminUtilsApi;
|
|
35
36
|
};
|
|
36
37
|
application: JApplicationApi;
|
|
37
38
|
article: JArticleApi;
|
|
@@ -45,7 +46,6 @@ export declare class JamespotUserApi {
|
|
|
45
46
|
filebank: JFilebankApi;
|
|
46
47
|
group: JGroupApi;
|
|
47
48
|
jland: JLandApi;
|
|
48
|
-
license: JLicenseApi;
|
|
49
49
|
mediaLibrary: JMediaLibraryApi;
|
|
50
50
|
messenger: JMessengerApi;
|
|
51
51
|
search: JSearchApi;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { JBaseApi } from '../base';
|
|
2
|
-
import { ApiWrapper, jArticleList, MaybeWithToken, PagingResults } from '../../types';
|
|
2
|
+
import { ApiWrapper, jArticleList, License, MaybeWithToken, PagingResults } from '../../types';
|
|
3
3
|
import { ArticleCreation } from '../article/article';
|
|
4
|
-
import { JLicense } from '../Licenses/licenses';
|
|
5
4
|
export declare type JLandLog = {
|
|
6
5
|
idLog: number;
|
|
7
6
|
slug: string;
|
|
@@ -23,7 +22,7 @@ export declare type JLandMap = jArticleList & {
|
|
|
23
22
|
waMapUrl?: string;
|
|
24
23
|
limit?: number;
|
|
25
24
|
_extend: {
|
|
26
|
-
licenses: Array<
|
|
25
|
+
licenses: Array<License>;
|
|
27
26
|
};
|
|
28
27
|
};
|
|
29
28
|
export declare type JLandMapCreation = ArticleCreation & {
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ObjectListProps } from '../apis';
|
|
2
|
+
import { jUserList } from './user';
|
|
3
|
+
export declare type AdminLicenseUserStats = {
|
|
4
|
+
countActiveUsersWithoutLicense: number;
|
|
5
|
+
countLicensesAssigned: number;
|
|
6
|
+
countLicensesNotAssigned: number;
|
|
7
|
+
};
|
|
8
|
+
export declare type ObjectWithoutLicenseFilter = {
|
|
9
|
+
name: string;
|
|
10
|
+
operator: string;
|
|
11
|
+
value: number;
|
|
12
|
+
};
|
|
13
|
+
export declare type AdminLicensesNotAssigned = {
|
|
14
|
+
[key: string]: number;
|
|
15
|
+
};
|
|
16
|
+
export declare type AdminLicensesAssigned = {
|
|
17
|
+
id: number;
|
|
18
|
+
kind: string;
|
|
19
|
+
dateCreation: string;
|
|
20
|
+
idFeature: number;
|
|
21
|
+
uri: string;
|
|
22
|
+
contentId: number;
|
|
23
|
+
contentType: string;
|
|
24
|
+
status: number;
|
|
25
|
+
};
|
|
26
|
+
export declare type License = {
|
|
27
|
+
id: number;
|
|
28
|
+
kind: string;
|
|
29
|
+
dateCreation: string;
|
|
30
|
+
idFeature: number;
|
|
31
|
+
uri: string;
|
|
32
|
+
contentId: number;
|
|
33
|
+
contentType: string;
|
|
34
|
+
status: number;
|
|
35
|
+
};
|
|
36
|
+
export declare type JAdminLicenseUserList = jUserList & {
|
|
37
|
+
_extend: {
|
|
38
|
+
licenses: Array<License>;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export interface AdminLicenseUser extends ObjectListProps {
|
|
42
|
+
data: JAdminLicenseUserList[];
|
|
43
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare type AdminAppTab = {
|
|
2
|
+
sref?: string;
|
|
3
|
+
href?: string;
|
|
4
|
+
idDiv: string;
|
|
5
|
+
label: string;
|
|
6
|
+
icon: string;
|
|
7
|
+
};
|
|
8
|
+
export declare type AdminApp = {
|
|
9
|
+
name: string;
|
|
10
|
+
label: string;
|
|
11
|
+
icon: string;
|
|
12
|
+
color: [string, string, string];
|
|
13
|
+
state?: string;
|
|
14
|
+
access: boolean;
|
|
15
|
+
url?: string;
|
|
16
|
+
tabs?: AdminAppTab[];
|
|
17
|
+
};
|
|
18
|
+
export declare type AdminApps = AdminApp[];
|
package/lib/src/types/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
export * from './adminLicence';
|
|
1
2
|
export * from './adminStore';
|
|
3
|
+
export * from './adminUtils';
|
|
2
4
|
export * from './asei';
|
|
3
5
|
export * from './assetReservation';
|
|
4
6
|
export * from './autocomplete';
|
|
@@ -9,6 +11,7 @@ export * from './mediaLibrary';
|
|
|
9
11
|
export * from './model';
|
|
10
12
|
export * from './search';
|
|
11
13
|
export * from './share';
|
|
14
|
+
export * from './tvDisplay';
|
|
12
15
|
export * from './user';
|
|
13
16
|
export * from './utils';
|
|
14
17
|
export * from './wedoc';
|
package/lib/src/types/model.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export declare type WidgetDatePicker = {
|
|
|
27
27
|
type: 'datePicker';
|
|
28
28
|
};
|
|
29
29
|
export declare type WidgetDatePickerValue = string | null;
|
|
30
|
+
export declare type WidgetActiveValue = number;
|
|
30
31
|
export declare type WidgetMultiattribute = {
|
|
31
32
|
type: 'multiattribute';
|
|
32
33
|
};
|
|
@@ -71,6 +72,7 @@ export declare type WidgetTaxonomy = {
|
|
|
71
72
|
type: 'taxonomy';
|
|
72
73
|
params: {
|
|
73
74
|
idTaxonomy: string;
|
|
75
|
+
type?: string;
|
|
74
76
|
};
|
|
75
77
|
};
|
|
76
78
|
export declare type WidgetOrientedlinks = {
|
|
@@ -90,7 +92,7 @@ export declare type WidgetUri = {
|
|
|
90
92
|
};
|
|
91
93
|
};
|
|
92
94
|
export declare type Widget = WidgetText | WidgetTextarea | WidgetNumber | WidgetDate | WidgetDatetime | WidgetDatePicker | WidgetSelect | WidgetEmail | WidgetUrl | WidgetRefUser | WidgetRadio | WidgetCheckbox | WidgetOrientedlinks | WidgetTaxonomy | WidgetUri | WidgetTransient | WidgetMultiattribute | WidgetFile;
|
|
93
|
-
export declare type WidgetsValue = WidgetDatePickerValue | WidgetDatetimeValue | WidgetDateValue | WidgetEmailValue | WidgetNumberValue | WidgetTextareaValue | WidgetTextValue | WidgetUrlValue;
|
|
95
|
+
export declare type WidgetsValue = WidgetActiveValue | WidgetDatePickerValue | WidgetDatetimeValue | WidgetDateValue | WidgetEmailValue | WidgetNumberValue | WidgetTextareaValue | WidgetTextValue | WidgetUrlValue;
|
|
94
96
|
export declare type FieldConfiguration<T extends string = string> = {
|
|
95
97
|
label: string;
|
|
96
98
|
description?: string;
|
|
@@ -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/user.d.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { WidgetsValue } from './model';
|
|
2
2
|
import { jObjectLittle } from './utils';
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Use jUserList instead
|
|
5
|
+
*/
|
|
3
6
|
export declare type UserModel = jObjectLittle & {
|
|
4
7
|
firstname: string;
|
|
5
8
|
lastname: string;
|
|
9
|
+
active: number;
|
|
6
10
|
mail?: string;
|
|
7
11
|
};
|
|
8
12
|
export declare type UserMapModel = {
|
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,12 +67,13 @@ 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;
|
|
76
|
+
active: number;
|
|
55
77
|
_user: jUserLittle;
|
|
56
78
|
_right: Rights;
|
|
57
79
|
};
|
|
@@ -89,7 +111,7 @@ export declare type Order = {
|
|
|
89
111
|
sort: 'ASC' | 'DESC';
|
|
90
112
|
};
|
|
91
113
|
export declare type Orders = Array<Order>;
|
|
92
|
-
export declare type FilterValue = boolean | string | string[] | {
|
|
114
|
+
export declare type FilterValue = boolean | string | number | string[] | {
|
|
93
115
|
srcId: number | string;
|
|
94
116
|
srcType: string;
|
|
95
117
|
} | {
|
|
@@ -118,3 +140,4 @@ export declare type MaybeWithParent<T extends jObjectBase = jObjectBase> = {
|
|
|
118
140
|
export declare type Format = 'raw-little' | 'raw-list' | 'raw-view' | undefined;
|
|
119
141
|
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
142
|
export declare type ValueOf<T> = T[keyof T];
|
|
143
|
+
export {};
|
package/lib/src/util/Test.d.ts
CHANGED
|
@@ -1,10 +1,29 @@
|
|
|
1
1
|
import { JamespotUserApi } from '../apis';
|
|
2
|
-
import { ApiDefaultWrapper, PagingResults, jArticleLittle, jObjectAutocomplete,
|
|
2
|
+
import { ApiDefaultWrapper, PagingResults, jArticleLittle, jObjectAutocomplete, jObjectList } 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;
|
|
28
|
+
export declare const validateObjectIsFormatList: <T extends jObjectList = jObjectList>(object: T) => boolean;
|
|
10
29
|
export declare const validateObjectIsFormatAutocomplete: <T extends jObjectAutocomplete = jObjectAutocomplete>(object: T) => boolean;
|
package/package.json
CHANGED
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"firstname": "Admin",
|
|
22
22
|
"lastname": "Jenkins",
|
|
23
23
|
"company": "",
|
|
24
|
-
"mail": "admin.jenkins@jamespot.com"
|
|
24
|
+
"mail": "admin.jenkins@jamespot.com",
|
|
25
|
+
"active": 1
|
|
25
26
|
},
|
|
26
27
|
{
|
|
27
28
|
"id": 2,
|
|
@@ -36,7 +37,8 @@
|
|
|
36
37
|
"firstname": "Browser",
|
|
37
38
|
"lastname": "Stack",
|
|
38
39
|
"company": "",
|
|
39
|
-
"mail": "browserstack@jamespot.com"
|
|
40
|
+
"mail": "browserstack@jamespot.com",
|
|
41
|
+
"active": 1
|
|
40
42
|
},
|
|
41
43
|
{
|
|
42
44
|
"id": 4,
|
|
@@ -44,14 +46,15 @@
|
|
|
44
46
|
"type": "user",
|
|
45
47
|
"uri": "user/4",
|
|
46
48
|
"dateCreation": "2019-07-09 15:48:26",
|
|
47
|
-
"dateModified": "
|
|
49
|
+
"dateModified": "2019-07-09 15:51:24",
|
|
48
50
|
"title": "Admin1",
|
|
49
51
|
"_url": "/user/4",
|
|
50
52
|
"level": 9,
|
|
51
53
|
"firstname": "Un",
|
|
52
54
|
"lastname": "Admin",
|
|
53
|
-
"company": "
|
|
54
|
-
"mail": "admin1@jamespot.com"
|
|
55
|
+
"company": "",
|
|
56
|
+
"mail": "admin1@jamespot.com",
|
|
57
|
+
"active": 1
|
|
55
58
|
},
|
|
56
59
|
{
|
|
57
60
|
"id": 5,
|
|
@@ -59,14 +62,15 @@
|
|
|
59
62
|
"type": "user",
|
|
60
63
|
"uri": "user/5",
|
|
61
64
|
"dateCreation": "2019-07-09 15:48:45",
|
|
62
|
-
"dateModified": "
|
|
65
|
+
"dateModified": "2019-07-09 15:51:16",
|
|
63
66
|
"title": "Admin2",
|
|
64
67
|
"_url": "/user/5",
|
|
65
68
|
"level": 9,
|
|
66
69
|
"firstname": "Deux",
|
|
67
70
|
"lastname": "Admin",
|
|
68
71
|
"company": "",
|
|
69
|
-
"mail": "admin2@jamespot.com"
|
|
72
|
+
"mail": "admin2@jamespot.com",
|
|
73
|
+
"active": 1
|
|
70
74
|
},
|
|
71
75
|
{
|
|
72
76
|
"id": 6,
|
|
@@ -81,7 +85,8 @@
|
|
|
81
85
|
"firstname": "Un",
|
|
82
86
|
"lastname": "User",
|
|
83
87
|
"company": "",
|
|
84
|
-
"mail": "user1@jamespot.com"
|
|
88
|
+
"mail": "user1@jamespot.com",
|
|
89
|
+
"active": 1
|
|
85
90
|
},
|
|
86
91
|
{
|
|
87
92
|
"id": 7,
|
|
@@ -96,7 +101,8 @@
|
|
|
96
101
|
"firstname": "Deux",
|
|
97
102
|
"lastname": "User",
|
|
98
103
|
"company": "",
|
|
99
|
-
"mail": "user2@jamespot.com"
|
|
104
|
+
"mail": "user2@jamespot.com",
|
|
105
|
+
"active": 1
|
|
100
106
|
},
|
|
101
107
|
{
|
|
102
108
|
"id": 8,
|
|
@@ -111,7 +117,8 @@
|
|
|
111
117
|
"firstname": "Un",
|
|
112
118
|
"lastname": "Limited",
|
|
113
119
|
"company": "",
|
|
114
|
-
"mail": "limited1@jamespot.com"
|
|
120
|
+
"mail": "limited1@jamespot.com",
|
|
121
|
+
"active": 1
|
|
115
122
|
},
|
|
116
123
|
{
|
|
117
124
|
"id": 9,
|
|
@@ -126,7 +133,8 @@
|
|
|
126
133
|
"firstname": "Deux",
|
|
127
134
|
"lastname": "Limited",
|
|
128
135
|
"company": "",
|
|
129
|
-
"mail": "limited2@jamespot.com"
|
|
136
|
+
"mail": "limited2@jamespot.com",
|
|
137
|
+
"active": 1
|
|
130
138
|
},
|
|
131
139
|
{
|
|
132
140
|
"id": 10,
|
|
@@ -141,7 +149,8 @@
|
|
|
141
149
|
"firstname": "Un",
|
|
142
150
|
"lastname": "InactiveAdmin",
|
|
143
151
|
"company": "",
|
|
144
|
-
"mail": "inactiveAdmin1@jamespot.com"
|
|
152
|
+
"mail": "inactiveAdmin1@jamespot.com",
|
|
153
|
+
"active": 0
|
|
145
154
|
},
|
|
146
155
|
{
|
|
147
156
|
"id": 11,
|
|
@@ -156,7 +165,8 @@
|
|
|
156
165
|
"firstname": "InactiveUser",
|
|
157
166
|
"lastname": "Un",
|
|
158
167
|
"company": "",
|
|
159
|
-
"mail": "inactiveUser1@jamespot.com"
|
|
168
|
+
"mail": "inactiveUser1@jamespot.com",
|
|
169
|
+
"active": 0
|
|
160
170
|
},
|
|
161
171
|
{
|
|
162
172
|
"id": 12,
|
|
@@ -171,7 +181,8 @@
|
|
|
171
181
|
"firstname": "InactiveLimited",
|
|
172
182
|
"lastname": "Un",
|
|
173
183
|
"company": "",
|
|
174
|
-
"mail": "inactiveLimited1@jamespot.com"
|
|
184
|
+
"mail": "inactiveLimited1@jamespot.com",
|
|
185
|
+
"active": 0
|
|
175
186
|
}
|
|
176
187
|
],
|
|
177
188
|
"facets": null
|