jamespot-user-api 1.0.105 → 1.0.107
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 +12 -12
- package/documentation/classes/AdminStoreApi.html +1 -1
- package/documentation/classes/AdminUtilsApi.html +2 -2
- package/documentation/classes/JApplicationApi.html +9 -9
- package/documentation/classes/JArticleApi.html +1 -1
- package/documentation/classes/JAssetReservation.html +1 -1
- package/documentation/classes/JAudienceApi.html +2 -2
- 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 +6 -6
- package/documentation/classes/JFilebankApi.html +1 -1
- package/documentation/classes/JGroupApi.html +12 -8
- package/documentation/classes/JLandApi.html +1 -1
- package/documentation/classes/JMessengerApi.html +1 -1
- package/documentation/classes/JSearchApi.html +7 -7
- package/documentation/classes/JShareApi.html +1 -1
- package/documentation/classes/JTaxonomyApi.html +3 -3
- package/documentation/classes/JUserApi.html +4 -4
- 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 -1
- package/documentation/interfaces/ApiDefaultWrapper.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 +6 -6
- package/lib/jamespot-user-api.js +1 -1
- package/lib/jamespot-user-api.js.map +1 -1
- package/lib/src/apis/base.d.ts +3 -1
- package/lib/src/apis/{bookmark.d.ts → bookmark/bookmark.d.ts} +7 -7
- package/lib/src/apis/bookmark/bookmark.mock.d.ts +8 -0
- package/lib/src/apis/bookmark/bookmark.test.d.ts +1 -0
- package/lib/src/apis/community.d.ts +39 -2
- package/lib/src/apis/{group.d.ts → group/group.d.ts} +23 -13
- package/lib/src/apis/group/group.mock.d.ts +4 -0
- package/lib/src/apis/group/group.test.d.ts +1 -0
- package/lib/src/apis/group/group.types.d.ts +122 -0
- package/lib/src/apis/group/index.d.ts +2 -0
- package/lib/src/apis/index.d.ts +4 -3
- package/lib/src/apis/jamespotUserApi.d.ts +4 -4
- package/lib/src/apis/share/share.d.ts +14 -0
- package/lib/src/apis/share/share.mock.d.ts +7 -0
- package/lib/src/apis/share/share.test.d.ts +1 -0
- package/lib/src/apis/wedoc/wedoc.d.ts +17 -0
- package/lib/src/apis/wedoc/wedoc.mock.d.ts +14 -0
- package/lib/src/apis/wedoc/wedoc.test.d.ts +1 -0
- package/lib/src/index.d.ts +1 -3
- package/lib/src/types/autocomplete.d.ts +12 -0
- package/lib/src/types/bookmark.d.ts +2 -1
- package/lib/src/types/index.d.ts +0 -1
- package/lib/src/types/realtime.d.ts +37 -11
- package/lib/src/types/share.d.ts +7 -17
- package/lib/src/types/utils.d.ts +2 -9
- package/lib/src/types/wedoc.d.ts +6 -21
- package/lib/src/util/Test.d.ts +10 -5
- package/lib/src/util/ensure.d.ts +3 -0
- package/lib/src/util/index.d.ts +4 -0
- package/lib/src/util/network.d.ts +14 -5
- package/lib/src/util/network.mock.d.ts +2 -1
- package/lib/src/util/network.test.d.ts +1 -0
- package/lib/src/util/object.d.ts +1 -0
- package/lib/src/util/object.test.d.ts +1 -0
- package/lib/src/window/Window.d.ts +5 -4
- package/lib/src/window/WindowBrowser.d.ts +2 -2
- package/lib/src/window/WindowBrowser.test.d.ts +1 -0
- package/package.json +1 -1
- package/phpunitMock/bookmarksAdd-url.json +35 -0
- package/phpunitMock/bookmarksDelete-spot1Article.json +7 -0
- package/phpunitMock/bookmarksMove-spot1Article.json +7 -0
- package/phpunitMock/bookmarksRename-spot1Article.json +7 -0
- package/phpunitMock/customActionAdd-bookmarkSpot1Article.json +45 -0
- package/phpunitMock/objectList-bookmarksList.json +92 -0
- package/phpunitMock/onlyOfficeAskObjectAccess-ask-read.json +1 -0
- package/phpunitMock/onlyOfficeCreateFile-create-file.json +19 -0
- package/phpunitMock/onlyOfficeDeleteFile-delete-file.json +1 -0
- package/phpunitMock/onlyOfficeDuplicateFile-duplicate-file.json +19 -0
- package/phpunitMock/onlyOfficeGetFile-get-file.json +50 -0
- package/phpunitMock/onlyOfficeGetFiles-get-files.json +58 -0
- package/phpunitMock/onlyOfficeGetObject-default.json +26 -0
- package/phpunitMock/onlyOfficeGetObjectAccess-default.json +34 -0
- package/phpunitMock/onlyOfficeGetObjectAccessRequest-all-request.json +19 -0
- package/phpunitMock/onlyOfficeGetTemplates-get-templates.json +29 -0
- package/phpunitMock/onlyOfficeSetObjectAccess-default.json +1 -0
- package/phpunitMock/onlyOfficeSetObjectAccessRequest-accept.json +1 -0
- package/phpunitMock/onlyOfficeUpdateFile-update-file.json +1 -0
- package/phpunitMock/spotGet-default.json +25 -0
- package/phpunitMock/spotGetProperties-default.json +77 -0
- package/documentation/interfaces/ApiError.html +0 -1
- package/lib/src/apis/share.d.ts +0 -17
- package/lib/src/apis/wedoc.d.ts +0 -26
- package/lib/src/types/group.d.ts +0 -58
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,44 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ApiReturn, CommunityAutocomplete, Format } from '../types';
|
|
2
2
|
import { JBaseApi } from './base';
|
|
3
3
|
export declare class JCommunityApi extends JBaseApi {
|
|
4
|
-
|
|
4
|
+
get<T extends Format = undefined>(idCommunity: string | number, format?: T): Promise<import("../types").ApiWrapper<ApiReturn<T, {
|
|
5
|
+
id: number;
|
|
6
|
+
mainType: string;
|
|
7
|
+
type: string;
|
|
8
|
+
uri: string;
|
|
9
|
+
dateCreation?: string;
|
|
10
|
+
dateModified?: string;
|
|
11
|
+
title: string;
|
|
12
|
+
_url: string;
|
|
13
|
+
}, {
|
|
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
|
+
}, {
|
|
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
|
+
}, {
|
|
32
|
+
id: number;
|
|
33
|
+
mainType: string;
|
|
34
|
+
type: string;
|
|
35
|
+
uri: string;
|
|
36
|
+
dateCreation?: string;
|
|
37
|
+
dateModified?: string;
|
|
38
|
+
title: string;
|
|
39
|
+
_url: string;
|
|
40
|
+
}>, import("../types").BaseMessages>>;
|
|
41
|
+
sendRequest(message: string, idUserTo: number): Promise<import("../types").ApiWrapper<boolean, {
|
|
5
42
|
code: number;
|
|
6
43
|
msg: string;
|
|
7
44
|
}>>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { JBaseApi } from '
|
|
1
|
+
import { Category, CreateGroup, GroupList, GroupProperties, GroupView, GroupWidget, ResetNotificationConfiguration, UpdateGroup } from './group.types';
|
|
2
|
+
import { JBaseApi } from '../base';
|
|
3
|
+
import { ApiReturn, Format, PagingResults } from '../../types';
|
|
3
4
|
export declare class JGroupApi extends JBaseApi {
|
|
4
5
|
/**
|
|
5
6
|
* Create a group from scratch
|
|
@@ -7,7 +8,7 @@ export declare class JGroupApi extends JBaseApi {
|
|
|
7
8
|
* @param format return format
|
|
8
9
|
* @returns
|
|
9
10
|
*/
|
|
10
|
-
create<T extends Format = undefined>(group: CreateGroup, format?: T): Promise<import("
|
|
11
|
+
create<T extends Format = undefined>(group: CreateGroup, format?: T): Promise<import("../../types").ApiWrapper<ApiReturn<T, {
|
|
11
12
|
id: number;
|
|
12
13
|
mainType: string;
|
|
13
14
|
type: string;
|
|
@@ -25,14 +26,14 @@ export declare class JGroupApi extends JBaseApi {
|
|
|
25
26
|
dateModified?: string;
|
|
26
27
|
title: string;
|
|
27
28
|
_url: string;
|
|
28
|
-
}>, import("
|
|
29
|
+
}>, import("../../types").BaseMessages>>;
|
|
29
30
|
/**
|
|
30
31
|
* Update a group
|
|
31
32
|
* @param group group to update. The uri is mandatory and identify the group to update
|
|
32
33
|
* @param format return format
|
|
33
34
|
* @returns
|
|
34
35
|
*/
|
|
35
|
-
update<T extends Format = undefined>(group: UpdateGroup, format?: T): Promise<import("
|
|
36
|
+
update<T extends Format = undefined>(group: UpdateGroup, format?: T): Promise<import("../../types").ApiWrapper<ApiReturn<T, {
|
|
36
37
|
id: number;
|
|
37
38
|
mainType: string;
|
|
38
39
|
type: string;
|
|
@@ -41,14 +42,14 @@ export declare class JGroupApi extends JBaseApi {
|
|
|
41
42
|
dateModified?: string;
|
|
42
43
|
title: string;
|
|
43
44
|
_url: string;
|
|
44
|
-
}, GroupList, GroupView, string>, import("
|
|
45
|
+
}, GroupList, GroupView, string>, import("../../types").BaseMessages>>;
|
|
45
46
|
/**
|
|
46
47
|
* Get a spot
|
|
47
48
|
* @param idSpot
|
|
48
49
|
* @param format
|
|
49
50
|
* @returns
|
|
50
51
|
*/
|
|
51
|
-
getSpot<T extends Format = undefined>(idSpot: number | string, format?: T): Promise<import("
|
|
52
|
+
getSpot<T extends Format = undefined>(idSpot: number | string, format?: T): Promise<import("../../types").ApiWrapper<ApiReturn<T, {
|
|
52
53
|
id: number;
|
|
53
54
|
mainType: string;
|
|
54
55
|
type: string;
|
|
@@ -57,22 +58,22 @@ export declare class JGroupApi extends JBaseApi {
|
|
|
57
58
|
dateModified?: string;
|
|
58
59
|
title: string;
|
|
59
60
|
_url: string;
|
|
60
|
-
}, GroupList, GroupView, string>, import("
|
|
61
|
+
}, GroupList, GroupView, string>, import("../../types").BaseMessages>>;
|
|
61
62
|
/**
|
|
62
63
|
* Get the properties of a group that are not within the model
|
|
63
64
|
* @param idSpot
|
|
64
65
|
* @returns
|
|
65
66
|
*/
|
|
66
|
-
getProperties(idSpot: number | string): Promise<import("
|
|
67
|
+
getProperties(idSpot: number | string): Promise<import("../../types").ApiWrapper<GroupProperties, import("../../types").BaseMessages>>;
|
|
67
68
|
/**
|
|
68
69
|
* Get the available applications that can be added to a group
|
|
69
70
|
*/
|
|
70
|
-
getApplications(): Promise<import("
|
|
71
|
+
getApplications(): Promise<import("../../types").ApiWrapper<Record<string, GroupWidget>, import("../../types").BaseMessages>>;
|
|
71
72
|
/**
|
|
72
73
|
* Get the available group categories
|
|
73
74
|
* @returns
|
|
74
75
|
*/
|
|
75
|
-
getCategories(): Promise<import("
|
|
76
|
+
getCategories(): Promise<import("../../types").ApiWrapper<Category[], import("../../types").BaseMessages>>;
|
|
76
77
|
/**
|
|
77
78
|
* Get the members of a group
|
|
78
79
|
* @param idSpot spot id
|
|
@@ -81,7 +82,7 @@ export declare class JGroupApi extends JBaseApi {
|
|
|
81
82
|
* @param page page number
|
|
82
83
|
* @return array of User
|
|
83
84
|
*/
|
|
84
|
-
getObjectListJamespotSpotMembers(idSpot: number | string, query?: string, limit?: number, page?: number): Promise<import("
|
|
85
|
+
getObjectListJamespotSpotMembers(idSpot: number | string, query?: string, limit?: number, page?: number): Promise<import("../../types").ApiWrapper<PagingResults<{
|
|
85
86
|
id: number;
|
|
86
87
|
mainType: string;
|
|
87
88
|
type: string;
|
|
@@ -90,5 +91,14 @@ export declare class JGroupApi extends JBaseApi {
|
|
|
90
91
|
dateModified?: string;
|
|
91
92
|
title: string;
|
|
92
93
|
_url: string;
|
|
93
|
-
}>, import("
|
|
94
|
+
}>, import("../../types").BaseMessages>>;
|
|
95
|
+
/**
|
|
96
|
+
* Reset the notifications configuration for all users of the group
|
|
97
|
+
* @param config configuration
|
|
98
|
+
* @returns
|
|
99
|
+
*/
|
|
100
|
+
resetNotifications(config: ResetNotificationConfiguration): Promise<import("../../types").ApiWrapper<{
|
|
101
|
+
members: number;
|
|
102
|
+
msg: string;
|
|
103
|
+
}, import("../../types").BaseMessages>>;
|
|
94
104
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { jObjectLittle } from '../../types/utils';
|
|
2
|
+
export declare type CreateGroup = {
|
|
3
|
+
type: string;
|
|
4
|
+
title: string;
|
|
5
|
+
description: string;
|
|
6
|
+
privacy: string | number;
|
|
7
|
+
edito: string | null;
|
|
8
|
+
language: string;
|
|
9
|
+
category: string;
|
|
10
|
+
idCommunity?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare type SpotBannerImage = {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
size: string;
|
|
16
|
+
};
|
|
17
|
+
export declare type UpdateGroup = CreateGroup & Partial<GroupProperties> & {
|
|
18
|
+
uri: string;
|
|
19
|
+
image?: string | null;
|
|
20
|
+
spotBanner?: [] | Record<string, SpotBannerImage>;
|
|
21
|
+
token?: string;
|
|
22
|
+
uriCommunity?: string;
|
|
23
|
+
custom_widgets?: Record<string, GroupCustomWidget> | [];
|
|
24
|
+
};
|
|
25
|
+
export declare type GroupProperties = {
|
|
26
|
+
edit_access: '' | 'author';
|
|
27
|
+
commentLevel: '-1' | '1' | '2' | '3';
|
|
28
|
+
user_level_signup: '' | '1' | '2' | '3';
|
|
29
|
+
nounsubscribe: '' | '1';
|
|
30
|
+
useTeaser: '' | '1' | '2';
|
|
31
|
+
displayType: string;
|
|
32
|
+
spot_right_user: string;
|
|
33
|
+
rss_feed: Array<RssType> | '';
|
|
34
|
+
spotDefaultPublishType: string;
|
|
35
|
+
mail_frequency: string;
|
|
36
|
+
mail_comment: '1' | '';
|
|
37
|
+
mail_spotit: '1' | '';
|
|
38
|
+
mail_subscriber: '1' | '';
|
|
39
|
+
lock_mail: '1' | '';
|
|
40
|
+
activity: '1' | '0';
|
|
41
|
+
publishFolder: '1' | '0';
|
|
42
|
+
notifyFolder: '1' | '0';
|
|
43
|
+
widgets: Array<string>;
|
|
44
|
+
rss_access: '1' | '0';
|
|
45
|
+
rss_key: string;
|
|
46
|
+
_options: GroupPropertiesOptions;
|
|
47
|
+
_errors: [];
|
|
48
|
+
lastRssExecution?: Record<string, string>;
|
|
49
|
+
};
|
|
50
|
+
export declare type GroupPropertiesOptions = {
|
|
51
|
+
edit_access: Array<ValueLabel & {
|
|
52
|
+
description: string;
|
|
53
|
+
}>;
|
|
54
|
+
commentLevel: Array<ValueLabel & {
|
|
55
|
+
selected?: boolean;
|
|
56
|
+
}>;
|
|
57
|
+
displayType: Array<ValueLabel>;
|
|
58
|
+
user_level_signup: Array<ValueLabel & {
|
|
59
|
+
selected?: boolean;
|
|
60
|
+
}>;
|
|
61
|
+
spot_right_user: Array<ValueLabel & {
|
|
62
|
+
selected?: boolean;
|
|
63
|
+
}>;
|
|
64
|
+
useTeaser: Array<ValueLabel>;
|
|
65
|
+
spotDefaultPublishType: Array<string>;
|
|
66
|
+
mail_frequency: Array<ValueLabel>;
|
|
67
|
+
widgets: Array<GroupWidget>;
|
|
68
|
+
custom_widgets: Record<string, GroupCustomWidget> | [];
|
|
69
|
+
};
|
|
70
|
+
export declare type RssType = {
|
|
71
|
+
url: string;
|
|
72
|
+
idUser: number;
|
|
73
|
+
send: boolean | undefined;
|
|
74
|
+
error?: string;
|
|
75
|
+
};
|
|
76
|
+
export declare type ValueLabel = {
|
|
77
|
+
value: string | number;
|
|
78
|
+
label: string;
|
|
79
|
+
};
|
|
80
|
+
export declare type GroupWidget = {
|
|
81
|
+
id: string;
|
|
82
|
+
title: string;
|
|
83
|
+
};
|
|
84
|
+
export declare type GroupCustomWidget = {
|
|
85
|
+
idSpot: string;
|
|
86
|
+
idOrder: string;
|
|
87
|
+
idWidget: string;
|
|
88
|
+
type: string;
|
|
89
|
+
title: string;
|
|
90
|
+
url: string;
|
|
91
|
+
visible: string;
|
|
92
|
+
};
|
|
93
|
+
export interface Category {
|
|
94
|
+
id: string;
|
|
95
|
+
idorder: number;
|
|
96
|
+
label: string;
|
|
97
|
+
}
|
|
98
|
+
export declare type GroupLittle = jObjectLittle & {
|
|
99
|
+
dateCreation: string;
|
|
100
|
+
dateModified: string;
|
|
101
|
+
};
|
|
102
|
+
export declare type GroupList = GroupLittle & {
|
|
103
|
+
description: string;
|
|
104
|
+
privacy: string | number;
|
|
105
|
+
edito: string | null;
|
|
106
|
+
language: string;
|
|
107
|
+
category: string;
|
|
108
|
+
idCategory: number;
|
|
109
|
+
};
|
|
110
|
+
export declare type GroupView = GroupList & {
|
|
111
|
+
image?: string | null;
|
|
112
|
+
spotBanner?: [] | Record<string, SpotBannerImage>;
|
|
113
|
+
idCommunity?: string;
|
|
114
|
+
useTeaser?: string;
|
|
115
|
+
};
|
|
116
|
+
export declare type ResetNotificationConfiguration = {
|
|
117
|
+
idSpot: string | number;
|
|
118
|
+
mailFrequency: string | number;
|
|
119
|
+
mailSpotit: boolean;
|
|
120
|
+
mailComment: boolean;
|
|
121
|
+
mailSubscriber: boolean;
|
|
122
|
+
};
|
package/lib/src/apis/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export * from './article/article';
|
|
|
4
4
|
export * from './assetReservation';
|
|
5
5
|
export * from './audience/audience';
|
|
6
6
|
export * from './base';
|
|
7
|
-
export * from './bookmark';
|
|
7
|
+
export * from './bookmark/bookmark';
|
|
8
8
|
export * from './community';
|
|
9
9
|
export * from './diapazone';
|
|
10
10
|
export * from './file';
|
|
@@ -13,8 +13,9 @@ export * from './group';
|
|
|
13
13
|
export * from './jamespotUserApi';
|
|
14
14
|
export * from './jland/jland';
|
|
15
15
|
export * from './messenger';
|
|
16
|
+
export * from './share/share';
|
|
16
17
|
export * from './search/search';
|
|
17
|
-
export * from './share';
|
|
18
|
+
export * from './share/share';
|
|
18
19
|
export * from './user/user';
|
|
19
20
|
export * from './taxonomy';
|
|
20
|
-
export * from './wedoc';
|
|
21
|
+
export * from './wedoc/wedoc';
|
|
@@ -8,18 +8,18 @@ import { JCommunityApi } from './community';
|
|
|
8
8
|
import { JDriveApi } from './drive/drive';
|
|
9
9
|
import { JFileApi } from './file';
|
|
10
10
|
import { JFilebankApi } from './filebank';
|
|
11
|
-
import { JGroupApi } from './group';
|
|
11
|
+
import { JGroupApi } from './group/group';
|
|
12
12
|
import { JMediaLibraryApi } from './mediaLibrary/mediaLibrary';
|
|
13
13
|
import { JLandApi } from './jland/jland';
|
|
14
14
|
import { JMessengerApi } from './messenger';
|
|
15
15
|
import { JSearchApi } from './search/search';
|
|
16
|
-
import { JBookmarkApi } from './bookmark';
|
|
16
|
+
import { JBookmarkApi } from './bookmark/bookmark';
|
|
17
17
|
import { JTaxonomyApi } from './taxonomy';
|
|
18
18
|
import { JUserApi } from './user/user';
|
|
19
19
|
import { JDiapazoneApi } from './diapazone';
|
|
20
|
-
import { JWedocApi } from './wedoc';
|
|
20
|
+
import { JWedocApi } from './wedoc/wedoc';
|
|
21
21
|
import { Network } from '../util/network';
|
|
22
|
-
import { JShareApi } from './share';
|
|
22
|
+
import { JShareApi } from './share/share';
|
|
23
23
|
/**
|
|
24
24
|
* In browser usage, 'window' should be the window object.
|
|
25
25
|
* In server side usage, 'window' object given must implement the fetch method, used by the Apis.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ApiWrapper } from '../../types';
|
|
2
|
+
import { JBaseApi } from '../base';
|
|
3
|
+
import { ShareAccessObject, ShareAccessProps, ShareAudienceItem, ShareGeneralAccessRules } from '../../types/share';
|
|
4
|
+
export declare class JShareApi extends JBaseApi {
|
|
5
|
+
setObjectAccessRequest(uri: string, idUser: number, requestAccessValue: 'accept' | 'deny', requestResponseMessage?: string): Promise<ApiWrapper<[]>>;
|
|
6
|
+
getObjectAccessRequest(uri: string, idUser?: number): Promise<ApiWrapper<ShareAudienceItem[]>>;
|
|
7
|
+
getObject(uri: string): Promise<ApiWrapper<ShareAccessObject>>;
|
|
8
|
+
askObjectAccess(uri: string, askAccess: 'read' | 'write', askMessage?: string): Promise<ApiWrapper<boolean>>;
|
|
9
|
+
setObjectAccess(uri: string, access: {
|
|
10
|
+
read: string[];
|
|
11
|
+
write: string[];
|
|
12
|
+
}, message: string, generalAccessRule: ShareGeneralAccessRules): Promise<ApiWrapper<boolean>>;
|
|
13
|
+
getObjectAccess(uri: string): Promise<ApiWrapper<ShareAccessProps>>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ApiWrapper, ShareAccessObject, ShareAccessProps, ShareAudienceItem } from '../../types';
|
|
2
|
+
export declare const shareAskObjectAccess: ApiWrapper<boolean>;
|
|
3
|
+
export declare const shareGetObject: ApiWrapper<ShareAccessObject>;
|
|
4
|
+
export declare const shareGetObjectAccess: ApiWrapper<ShareAccessProps>;
|
|
5
|
+
export declare const shareGetObjectAccessRequest: ApiWrapper<ShareAudienceItem[]>;
|
|
6
|
+
export declare const shareSetObjectAccess: ApiWrapper<boolean>;
|
|
7
|
+
export declare const shareSetObjectAccessRequest: ApiWrapper<[]>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ApiWrapper, PagingResults, WedocFileType, WedocQueryType, WedocTemplate, jArticleLittle } from '../../types';
|
|
2
|
+
import { JBaseApi } from '../base';
|
|
3
|
+
export declare class JWedocApi extends JBaseApi {
|
|
4
|
+
getFiles(query: WedocQueryType): Promise<ApiWrapper<PagingResults<WedocFileType>>>;
|
|
5
|
+
getFile(idFile: number, hash?: string): Promise<ApiWrapper<WedocFileType>>;
|
|
6
|
+
getTemplates(): Promise<ApiWrapper<WedocTemplate[]>>;
|
|
7
|
+
duplicateFile(idFile: number, title: string, publishTo: string[]): Promise<ApiWrapper<{
|
|
8
|
+
idFile: number;
|
|
9
|
+
article: jArticleLittle;
|
|
10
|
+
}>>;
|
|
11
|
+
deleteFile(idFile: number): Promise<ApiWrapper<boolean>>;
|
|
12
|
+
createFile(title: string, type: string, publishTo: string[]): Promise<ApiWrapper<{
|
|
13
|
+
idFile: number;
|
|
14
|
+
article: jArticleLittle;
|
|
15
|
+
}>>;
|
|
16
|
+
updateFile(idFile: number, title: string): Promise<ApiWrapper<boolean>>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ApiWrapper, PagingResults, WedocFileType, WedocTemplate, jArticleLittle } from '../../types';
|
|
2
|
+
export declare const wedocGetTemplates: ApiWrapper<WedocTemplate[]>;
|
|
3
|
+
export declare const wedocCreateFile: ApiWrapper<{
|
|
4
|
+
idFile: number;
|
|
5
|
+
article: jArticleLittle;
|
|
6
|
+
}>;
|
|
7
|
+
export declare const wedocDuplicateFile: ApiWrapper<{
|
|
8
|
+
idFile: number;
|
|
9
|
+
article: jArticleLittle;
|
|
10
|
+
}>;
|
|
11
|
+
export declare const wedocUpdateFile: ApiWrapper<boolean>;
|
|
12
|
+
export declare const wedocDeleteFile: ApiWrapper<boolean>;
|
|
13
|
+
export declare const wedocGetFile: ApiWrapper<WedocFileType>;
|
|
14
|
+
export declare const wedocGetFiles: ApiWrapper<PagingResults<WedocFileType>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/src/index.d.ts
CHANGED
|
@@ -11,8 +11,6 @@ export { JamespotUserApiInstance };
|
|
|
11
11
|
export default JamespotUserApiInstance;
|
|
12
12
|
export * from './apis';
|
|
13
13
|
export * from './types';
|
|
14
|
-
export * from './util/
|
|
15
|
-
export * from './util/file';
|
|
16
|
-
export * from './util/ensure';
|
|
14
|
+
export * from './util/';
|
|
17
15
|
export * from './window';
|
|
18
16
|
export declare const api: typeof JamespotUserApi;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jObjectLittle } from './utils';
|
|
1
2
|
export interface BaseAutocomplete {
|
|
2
3
|
id: string;
|
|
3
4
|
uri: string;
|
|
@@ -22,3 +23,14 @@ export declare type jSpotAutocomplete = jObjectAutocomplete & {
|
|
|
22
23
|
};
|
|
23
24
|
export declare type AudienceAutocomplete = jObjectAutocomplete | jUserAutocomplete | jSpotAutocomplete;
|
|
24
25
|
export declare type CommunityAutocomplete = jObjectAutocomplete;
|
|
26
|
+
export declare type Community = jObjectLittle & {
|
|
27
|
+
isTechnical: number;
|
|
28
|
+
status: number;
|
|
29
|
+
image: string;
|
|
30
|
+
isMember: boolean;
|
|
31
|
+
stats: {
|
|
32
|
+
moderators: number;
|
|
33
|
+
members: string;
|
|
34
|
+
};
|
|
35
|
+
_members: Array<jObjectLittle>;
|
|
36
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { jUserLittle } from './user';
|
|
1
2
|
import { jLinkList, jObjectBase, jObjectLittle } from './utils';
|
|
2
|
-
export declare type BookmarkRawList<T extends jObjectBase = jObjectLittle> = jLinkList<T> & {
|
|
3
|
+
export declare type BookmarkRawList<T extends jObjectBase = jObjectLittle | jUserLittle> = jLinkList<T> & {
|
|
3
4
|
bookmarkUrl?: string | null;
|
|
4
5
|
bookmarkOrder?: number;
|
|
5
6
|
bookmarkLabel?: string;
|
package/lib/src/types/index.d.ts
CHANGED
|
@@ -1,25 +1,51 @@
|
|
|
1
|
-
import { jObjectBase } from './utils';
|
|
1
|
+
import { AllKeys, Readable, jObjectBase } from './utils';
|
|
2
2
|
declare type BookmarksFunctions = 'update' | 'add' | 'delete';
|
|
3
3
|
declare type CustomActionFunctions = 'update' | 'add' | 'remove';
|
|
4
|
+
declare type WSFunctions = 'presence' | 'connection' | 'disconnect';
|
|
4
5
|
export declare type Namespaces = {
|
|
5
6
|
BOOKMARKS: BookmarksFunctions;
|
|
6
7
|
'CUSTOM-ACTION': CustomActionFunctions;
|
|
8
|
+
ws: WSFunctions;
|
|
7
9
|
};
|
|
8
|
-
export declare type
|
|
10
|
+
export declare type AllMessages = {
|
|
11
|
+
BOOKMARKS: {
|
|
12
|
+
update: RTMessageObject<'BOOKMARKS', 'update'>;
|
|
13
|
+
add: RTMessageObject<'BOOKMARKS', 'add'>;
|
|
14
|
+
delete: RTMessageObject<'BOOKMARKS', 'delete'>;
|
|
15
|
+
};
|
|
16
|
+
'CUSTOM-ACTION': {
|
|
17
|
+
update: RTMessageObject<'CUSTOM-ACTION', 'update'>;
|
|
18
|
+
add: RTMessageObject<'CUSTOM-ACTION', 'add'>;
|
|
19
|
+
remove: RTMessageObject<'CUSTOM-ACTION', 'remove'>;
|
|
20
|
+
};
|
|
21
|
+
ws: {
|
|
22
|
+
presence: RTMessageWsPresence;
|
|
23
|
+
connection: RTMessage<'ws', 'connection'>;
|
|
24
|
+
disconnect: RTMessage<'ws', 'disconnect'>;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
declare type NamespacesMessages<T extends keyof AllMessages> = Readable<AllMessages[T] & Record<Exclude<AllKeys<AllMessages[keyof AllMessages]>, keyof AllMessages[T]>, never>>;
|
|
28
|
+
declare type AllMessagesInternal = {
|
|
29
|
+
[K in keyof AllMessages]: NamespacesMessages<K>;
|
|
30
|
+
};
|
|
31
|
+
export declare type RTMessageHandler<T extends keyof AllMessages, F extends keyof AllMessages[T]> = {
|
|
9
32
|
namespace: T;
|
|
10
|
-
function:
|
|
11
|
-
handler: (message:
|
|
33
|
+
function: F;
|
|
34
|
+
handler: (message: AllMessagesInternal[T][F]) => void;
|
|
12
35
|
};
|
|
13
36
|
export declare type AnyRTHandlerFunction = {
|
|
14
|
-
[K in keyof Namespaces]: RTMessageHandler<K>['handler'];
|
|
37
|
+
[K in keyof Namespaces]: RTMessageHandler<K, keyof AllMessages[K]>['handler'];
|
|
15
38
|
}[keyof Namespaces];
|
|
16
|
-
export declare type RTMessage<T extends keyof Namespaces
|
|
39
|
+
export declare type RTMessage<T extends keyof Namespaces, F extends Namespaces[T]> = {
|
|
17
40
|
namespace: T;
|
|
18
|
-
function:
|
|
41
|
+
function: F;
|
|
42
|
+
};
|
|
43
|
+
export declare type RTMessageObject<T extends keyof Namespaces, F extends Namespaces[T], O extends jObjectBase = jObjectBase> = RTMessage<T, F> & {
|
|
19
44
|
object: O;
|
|
20
45
|
};
|
|
21
|
-
export declare type
|
|
22
|
-
[
|
|
23
|
-
}
|
|
24
|
-
export declare type
|
|
46
|
+
export declare type RTMessageWsPresence = RTMessage<'ws', 'presence'> & {
|
|
47
|
+
idUsers: number[];
|
|
48
|
+
};
|
|
49
|
+
export declare type AnyRTMessage = RTMessageObject<'BOOKMARKS', 'update'> | RTMessageObject<'BOOKMARKS', 'add'> | RTMessageObject<'BOOKMARKS', 'delete'> | RTMessageObject<'CUSTOM-ACTION', 'update'> | RTMessageObject<'CUSTOM-ACTION', 'add'> | RTMessageObject<'CUSTOM-ACTION', 'remove'> | RTMessageWsPresence | RTMessage<'ws', 'connection'> | RTMessage<'ws', 'disconnect'>;
|
|
50
|
+
export declare type RTReceivedMessage<T extends keyof Namespaces, F extends Namespaces[T]> = ['message', RTMessage<T, F>];
|
|
25
51
|
export {};
|
package/lib/src/types/share.d.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
+
import { jUserLittle } from './user';
|
|
1
2
|
import { Rights } from './utils';
|
|
2
|
-
export declare type
|
|
3
|
-
id: number;
|
|
4
|
-
uri: string;
|
|
5
|
-
title: string;
|
|
6
|
-
type: string;
|
|
7
|
-
};
|
|
3
|
+
export declare type ShareGeneralAccessRules = 'link' | 'invitation';
|
|
8
4
|
export declare type ShareOptionObject = {
|
|
9
5
|
id: number;
|
|
10
6
|
title: string;
|
|
@@ -17,21 +13,15 @@ export declare type ShareAccessObject = {
|
|
|
17
13
|
type: string;
|
|
18
14
|
uri: string;
|
|
19
15
|
title: string;
|
|
20
|
-
generalAccessRule:
|
|
21
|
-
generalAccessHash: string;
|
|
16
|
+
generalAccessRule: ShareGeneralAccessRules;
|
|
17
|
+
generalAccessHash: string | null;
|
|
22
18
|
idUser: number;
|
|
23
|
-
_audience:
|
|
19
|
+
_audience: ShareAudienceItem[];
|
|
24
20
|
_right: Rights;
|
|
25
|
-
_user: ShareAccessObjectAudience;
|
|
26
21
|
};
|
|
22
|
+
export declare type ShareAudienceItem = jUserLittle;
|
|
27
23
|
export declare type ShareAccessProps = {
|
|
28
|
-
audience:
|
|
24
|
+
audience: ShareAudienceItem[];
|
|
29
25
|
read: string[];
|
|
30
26
|
write: string[];
|
|
31
27
|
};
|
|
32
|
-
export declare type ShareAccessRequestProps = {
|
|
33
|
-
id: number;
|
|
34
|
-
uri: string;
|
|
35
|
-
title: string;
|
|
36
|
-
type: string;
|
|
37
|
-
};
|
package/lib/src/types/utils.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { jUserLittle } from './user';
|
|
|
9
9
|
export declare type Readable<T> = T extends infer U ? {
|
|
10
10
|
[K in keyof U]: U[K];
|
|
11
11
|
} : never;
|
|
12
|
-
declare type AllKeys<T> = T extends unknown ? keyof T : never;
|
|
12
|
+
export declare type AllKeys<T> = T extends unknown ? keyof T : never;
|
|
13
13
|
declare type _ExclusifyUnion<T, K extends PropertyKey> = T extends unknown ? Readable<T & Partial<Record<Exclude<K, keyof T>, never>>> : never;
|
|
14
14
|
/**
|
|
15
15
|
* Builds an exclusive union type from a union type
|
|
@@ -45,10 +45,6 @@ export interface PagingResults<T> {
|
|
|
45
45
|
page: number;
|
|
46
46
|
}
|
|
47
47
|
export declare type ApiPagingResults<T, U = BaseMessages> = ApiWrapper<PagingResults<T>, U>;
|
|
48
|
-
export interface ApiError<U = string> {
|
|
49
|
-
error: number;
|
|
50
|
-
messages: U[];
|
|
51
|
-
}
|
|
52
48
|
export declare type Rights = {
|
|
53
49
|
create: boolean;
|
|
54
50
|
read: boolean;
|
|
@@ -90,7 +86,7 @@ export declare type jLinkLittle = jObjectBase & {
|
|
|
90
86
|
targetId: number;
|
|
91
87
|
targetType: string | null;
|
|
92
88
|
};
|
|
93
|
-
export declare type jLinkList<T extends jObjectBase = jObjectLittle> = jLinkLittle & {
|
|
89
|
+
export declare type jLinkList<T extends jObjectBase = jObjectLittle | jUserLittle> = jLinkLittle & {
|
|
94
90
|
value: string | null;
|
|
95
91
|
_src?: T;
|
|
96
92
|
_target?: T | undefined;
|
|
@@ -127,9 +123,6 @@ export declare type Filter = {
|
|
|
127
123
|
method?: '<' | '>' | '<=' | '>=' | '!=' | '<>' | '+' | '-' | 'like' | 'between' | 'is' | 'is not' | 'in' | 'link' | 'match' | 'equal';
|
|
128
124
|
};
|
|
129
125
|
export declare type Filters = Array<Filter>;
|
|
130
|
-
export declare type MaybeWithCsrf<T> = T & {
|
|
131
|
-
tokenCSRF?: string | undefined;
|
|
132
|
-
};
|
|
133
126
|
export declare type MaybeWithToken<T> = T & {
|
|
134
127
|
token?: string | undefined;
|
|
135
128
|
};
|
package/lib/src/types/wedoc.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jUserLittle } from './user';
|
|
2
|
+
import { Filters, jObjectBase, jObjectLittle, Orders, Rights } from './utils';
|
|
2
3
|
export declare type WedocFileInfo = {
|
|
3
4
|
color: string;
|
|
4
5
|
description: string;
|
|
@@ -6,14 +7,9 @@ export declare type WedocFileInfo = {
|
|
|
6
7
|
icon: string;
|
|
7
8
|
label: string;
|
|
8
9
|
};
|
|
9
|
-
export declare type WedocFileType = {
|
|
10
|
-
dateCreation: string;
|
|
11
|
-
dateModified: string;
|
|
12
|
-
id: string;
|
|
13
|
-
mimetype: string;
|
|
10
|
+
export declare type WedocFileType = jObjectBase & {
|
|
14
11
|
title: string;
|
|
15
|
-
|
|
16
|
-
uri: string;
|
|
12
|
+
mimetype: string;
|
|
17
13
|
_extend: {
|
|
18
14
|
generalAccessRule: string;
|
|
19
15
|
dateModified: string;
|
|
@@ -22,20 +18,9 @@ export declare type WedocFileType = {
|
|
|
22
18
|
};
|
|
23
19
|
_audience: WedocFileAudienceType[];
|
|
24
20
|
_right: Rights;
|
|
25
|
-
_user:
|
|
26
|
-
};
|
|
27
|
-
export declare type WedocFileAudienceType = {
|
|
28
|
-
id: number;
|
|
29
|
-
title: string;
|
|
30
|
-
uri: string;
|
|
31
|
-
type: string;
|
|
32
|
-
};
|
|
33
|
-
export declare type WedocFileUserType = {
|
|
34
|
-
id: number;
|
|
35
|
-
title: string;
|
|
36
|
-
uri: string;
|
|
37
|
-
type: string;
|
|
21
|
+
_user: jUserLittle;
|
|
38
22
|
};
|
|
23
|
+
export declare type WedocFileAudienceType = jObjectLittle;
|
|
39
24
|
export declare type WedocTemplate = {
|
|
40
25
|
color: string;
|
|
41
26
|
description: string;
|