jamespot-user-api 1.0.97 → 1.0.99
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 +11 -11
- 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/JConceptApi.html +2 -2
- package/documentation/classes/JDiapazoneApi.html +1 -1
- package/documentation/classes/JFileApi.html +25 -7
- package/documentation/classes/JFilebankApi.html +1 -1
- package/documentation/classes/JGroupApi.html +20 -2
- 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 +7 -7
- package/documentation/classes/JShareApi.html +1 -1
- 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 -0
- 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 -0
- 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 -0
- package/documentation/interfaces/SearchResultPropsObject.html +1 -0
- 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 +3 -1
- package/{jest.fetch.base-config.ts → jest.config.ts} +6 -1
- package/jest.config.vm.ts +11 -0
- package/lib/jamespot-user-api.js +1 -1
- package/lib/jamespot-user-api.js.map +1 -1
- package/lib/{jest.mock.config.d.ts → jest.config.d.ts} +4 -1
- package/lib/{jest.fetch.base-config.d.ts → jest.config.vm.d.ts} +6 -2
- package/lib/src/apis/Licenses/licences.test.d.ts +1 -0
- package/lib/src/apis/{licenses.d.ts → Licenses/licenses.d.ts} +2 -2
- package/lib/src/apis/Licenses/licenses.mock.d.ts +8 -0
- package/lib/src/apis/{application.d.ts → application/application.d.ts} +6 -36
- package/lib/src/apis/application/application.test.d.ts +1 -0
- package/lib/src/apis/application/index.d.ts +2 -0
- package/lib/src/apis/application/listApplicationDefault.mock.d.ts +3 -0
- package/lib/src/apis/application/types.d.ts +89 -0
- package/lib/src/apis/{article.d.ts → article/article.d.ts} +8 -6
- package/lib/src/apis/article/article.mock.d.ts +7 -0
- package/lib/src/apis/article/article.test.d.ts +1 -0
- package/lib/src/apis/assetReservation.mock.d.ts +3 -0
- package/lib/src/apis/assetReservation.test.d.ts +1 -0
- package/lib/src/apis/{audience.d.ts → audience/audience.d.ts} +2 -2
- package/lib/src/apis/audience/audience.mock.d.ts +2 -0
- package/lib/src/apis/audience/audience.test.d.ts +1 -0
- package/lib/src/apis/bookmark.d.ts +4 -4
- package/lib/src/apis/file.d.ts +59 -4
- package/lib/src/apis/group.d.ts +38 -5
- package/lib/src/apis/index.d.ts +5 -5
- package/lib/src/apis/jamespotUserApi.d.ts +5 -5
- package/lib/src/apis/{jland.d.ts → jland/jland.d.ts} +6 -4
- package/lib/src/apis/jland/jland.mock.d.ts +5 -0
- package/lib/src/apis/jland/jland.test.d.ts +1 -0
- package/lib/src/apis/{search.d.ts → search/search.d.ts} +4 -4
- package/lib/src/apis/search/search.mock.d.ts +13 -0
- package/lib/src/apis/search/search.test.d.ts +1 -0
- package/lib/src/apis/user.d.ts +2 -2
- package/lib/src/index.d.ts +1 -0
- package/lib/src/types/asei.d.ts +3 -3
- package/lib/src/types/autocomplete.d.ts +12 -5
- package/lib/src/types/bookmark.d.ts +39 -10
- package/lib/src/types/file.d.ts +20 -2
- package/lib/src/types/group.d.ts +41 -5
- package/lib/src/types/index.d.ts +1 -1
- package/lib/src/types/model.d.ts +7 -0
- package/lib/src/types/realtime.d.ts +25 -0
- package/lib/src/types/search.d.ts +43 -16
- package/lib/src/types/user.d.ts +6 -15
- package/lib/src/types/utils.d.ts +35 -14
- package/lib/src/util/Test.d.ts +9 -0
- package/lib/src/util/ensure.d.ts +15 -0
- package/lib/src/util/network.d.ts +1 -1
- package/lib/src/util/network.mock.d.ts +3 -0
- package/lib/src/window/index.d.ts +0 -1
- package/package.json +3 -5
- package/phpunitMock/articleCount-mpArticle.json +1 -0
- package/phpunitMock/articleCreate-mpArticle-little.json +18 -0
- package/phpunitMock/articleDelete-mpArticle.json +7 -0
- package/phpunitMock/articleGet-mpArticle-list.json +39 -0
- package/phpunitMock/articleUpdate-mpArticleView.json +39 -0
- package/phpunitMock/assetReservationConfiguration-default.json +14 -0
- package/phpunitMock/assetReservationConfiguration-updated.json +14 -0
- package/phpunitMock/autocompleteAudience-u.json +64 -0
- package/phpunitMock/jLandAdminLogs-empty.json +1 -0
- package/phpunitMock/jLandAdminLogs-full.json +98 -0
- package/phpunitMock/jLandAdminStats-empty.json +1 -0
- package/phpunitMock/licenseManagerAssignLicense-default.json +7 -0
- package/phpunitMock/licenseManagerAssignLicense-isAssignLicense.json +1 -0
- package/phpunitMock/licenseManagerCountLicensesNotAssigned-count.json +15 -0
- package/phpunitMock/licenseManagerGetLicensesAssigned-default.json +48 -0
- package/phpunitMock/licenseManagerUnassignLicense-default.json +7 -0
- package/phpunitMock/licenseManagerUnassignLicense-isUnassign.json +1 -0
- package/phpunitMock/objectListJamespotArticleList-mpArticle-little.json +115 -0
- package/phpunitMock/searchGetAdminConfig-default.json +22 -0
- package/phpunitMock/searchGetConfig-default.json +249 -0
- package/phpunitMock/searchGetLastQueries-default.json +7 -0
- package/phpunitMock/searchProposition-gro.json +60 -0
- package/phpunitMock/searchQuery-admin.json +53 -0
- package/phpunitMock/searchSetAdminConfig-test.json +1 -0
- package/phpunitMock/studioList-testUserApiList.json +114 -0
- package/documentation/classes/WindowMock.html +0 -10
- package/documentation/interfaces/CreateGroup.html +0 -1
- package/documentation/interfaces/Result.html +0 -1
- package/documentation/interfaces/SearchResultProps.html +0 -1
- package/jest.fetch.config.ts +0 -7
- package/jest.fetch.jenkinsdev.config.ts +0 -7
- package/jest.mock.config.ts +0 -8
- package/lib/jest.fetch.config.d.ts +0 -12
- package/lib/jest.fetch.jenkinsdev.config.d.ts +0 -12
- package/lib/src/types/application.d.ts +0 -15
- package/lib/src/window/WindowJestFetch.d.ts +0 -6
- package/lib/src/window/WindowMock.d.ts +0 -16
package/lib/src/types/file.d.ts
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
|
+
export declare type UploadConfig = {
|
|
2
|
+
attrName: string;
|
|
3
|
+
token: string;
|
|
4
|
+
file?: File | null;
|
|
5
|
+
url?: string;
|
|
6
|
+
};
|
|
1
7
|
export declare type FileResponse = {
|
|
2
8
|
id: string;
|
|
3
9
|
name: string;
|
|
4
|
-
type:
|
|
5
|
-
token
|
|
10
|
+
type: string;
|
|
11
|
+
token?: string;
|
|
12
|
+
crop?: FileCropConfig;
|
|
6
13
|
size: string;
|
|
7
14
|
mediaKey: string;
|
|
8
15
|
imagesize: {
|
|
@@ -10,3 +17,14 @@ export declare type FileResponse = {
|
|
|
10
17
|
height: number;
|
|
11
18
|
};
|
|
12
19
|
};
|
|
20
|
+
export declare type FileCropConfig = {
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
rotation: number;
|
|
26
|
+
killSize?: boolean;
|
|
27
|
+
};
|
|
28
|
+
export declare type FileCropReturnType = Omit<FileResponse, 'token'> & {
|
|
29
|
+
crop: FileCropConfig;
|
|
30
|
+
};
|
package/lib/src/types/group.d.ts
CHANGED
|
@@ -1,12 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
import { jObjectLittle } from './utils';
|
|
2
|
+
export declare type CreateGroup = {
|
|
3
|
+
type: string;
|
|
2
4
|
title: string;
|
|
3
5
|
description: string;
|
|
4
6
|
privacy: string;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
edito: string;
|
|
8
|
+
language: string;
|
|
9
|
+
idCategory: 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 & GroupProperties & {
|
|
18
|
+
uri: string;
|
|
19
|
+
image?: string;
|
|
20
|
+
spotBanner?: [] | Record<string, SpotBannerImage>;
|
|
21
|
+
token?: string;
|
|
7
22
|
uriCommunity?: string;
|
|
8
|
-
|
|
9
|
-
|
|
23
|
+
};
|
|
24
|
+
export declare type GroupProperties = {
|
|
25
|
+
edit_access?: '' | 'author';
|
|
26
|
+
commentLevel?: '-1' | '1' | '2' | '3';
|
|
27
|
+
user_level_signup?: '' | '1' | '2' | '3';
|
|
28
|
+
nounsubscribe?: '' | '1';
|
|
29
|
+
};
|
|
10
30
|
export declare type GroupWidget = {
|
|
11
31
|
idWidget: string;
|
|
12
32
|
title: string;
|
|
@@ -20,3 +40,19 @@ export interface Category {
|
|
|
20
40
|
idorder: number;
|
|
21
41
|
label: string;
|
|
22
42
|
}
|
|
43
|
+
export declare type GroupLittle = jObjectLittle & {
|
|
44
|
+
dateCreation: string;
|
|
45
|
+
dateModified: string;
|
|
46
|
+
};
|
|
47
|
+
export declare type GroupList = GroupLittle & {
|
|
48
|
+
description: string;
|
|
49
|
+
privacy: string;
|
|
50
|
+
edito: string;
|
|
51
|
+
language: string;
|
|
52
|
+
idCategory: string;
|
|
53
|
+
};
|
|
54
|
+
export declare type GroupView = GroupList & {
|
|
55
|
+
image?: string;
|
|
56
|
+
spotBanner?: [] | Record<string, SpotBannerImage>;
|
|
57
|
+
uriCommunity?: string;
|
|
58
|
+
};
|
package/lib/src/types/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export * from './adminStore';
|
|
2
|
-
export * from './application';
|
|
3
2
|
export * from './asei';
|
|
4
3
|
export * from './assetReservation';
|
|
5
4
|
export * from './autocomplete';
|
|
@@ -14,3 +13,4 @@ export * from './user';
|
|
|
14
13
|
export * from './utils';
|
|
15
14
|
export * from './wedoc';
|
|
16
15
|
export * from './widgets';
|
|
16
|
+
export * from './realtime';
|
package/lib/src/types/model.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare type WidgetText = {
|
|
2
2
|
type: 'text';
|
|
3
3
|
};
|
|
4
|
+
export declare type WidgetTextValue = string;
|
|
4
5
|
export declare type WidgetTextarea = {
|
|
5
6
|
type: 'textarea';
|
|
6
7
|
params?: {
|
|
@@ -8,13 +9,16 @@ export declare type WidgetTextarea = {
|
|
|
8
9
|
mention: '1';
|
|
9
10
|
};
|
|
10
11
|
};
|
|
12
|
+
export declare type WidgetTextareaValue = string;
|
|
11
13
|
export declare type WidgetNumber = {
|
|
12
14
|
type: 'number';
|
|
13
15
|
};
|
|
16
|
+
export declare type WidgetNumberValue = number;
|
|
14
17
|
export declare type WidgetDate = {
|
|
15
18
|
type: 'date';
|
|
16
19
|
format: string;
|
|
17
20
|
};
|
|
21
|
+
export declare type WidgetDateValue = string;
|
|
18
22
|
export declare type WidgetDatetime = {
|
|
19
23
|
type: 'datetime';
|
|
20
24
|
};
|
|
@@ -39,12 +43,14 @@ export declare type WidgetSelect<U extends string = string> = {
|
|
|
39
43
|
export declare type WidgetEmail = {
|
|
40
44
|
type: 'email';
|
|
41
45
|
};
|
|
46
|
+
export declare type WidgetEmailValue = string;
|
|
42
47
|
export declare type WidgetUrl = {
|
|
43
48
|
type: 'url';
|
|
44
49
|
params: {
|
|
45
50
|
target?: '_blank';
|
|
46
51
|
};
|
|
47
52
|
};
|
|
53
|
+
export declare type WidgetUrlValue = string;
|
|
48
54
|
export declare type WidgetRefUser = {
|
|
49
55
|
type: 'refUser';
|
|
50
56
|
};
|
|
@@ -82,6 +88,7 @@ export declare type WidgetUri = {
|
|
|
82
88
|
};
|
|
83
89
|
};
|
|
84
90
|
export declare type Widget = WidgetText | WidgetTextarea | WidgetNumber | WidgetDate | WidgetDatetime | WidgetDatePicker | WidgetSelect | WidgetEmail | WidgetUrl | WidgetRefUser | WidgetRadio | WidgetCheckbox | WidgetOrientedlinks | WidgetTaxonomy | WidgetUri | WidgetTransient | WidgetMultiattribute | WidgetFile;
|
|
91
|
+
export declare type WidgetsValue = WidgetTextValue | WidgetTextareaValue | WidgetNumberValue | WidgetDateValue | WidgetEmailValue | WidgetUrlValue;
|
|
85
92
|
export declare type FieldConfiguration<T extends string = string> = {
|
|
86
93
|
label: string;
|
|
87
94
|
description?: string;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jObjectBase } from './utils';
|
|
2
|
+
declare type BookmarksFunctions = 'update' | 'add' | 'delete';
|
|
3
|
+
declare type CustomActionFunctions = 'update' | 'add' | 'remove';
|
|
4
|
+
export declare type Namespaces = {
|
|
5
|
+
BOOKMARKS: BookmarksFunctions;
|
|
6
|
+
'CUSTOM-ACTION': CustomActionFunctions;
|
|
7
|
+
};
|
|
8
|
+
export declare type RTMessageHandler<T extends keyof Namespaces = 'CUSTOM-ACTION'> = {
|
|
9
|
+
namespace: T;
|
|
10
|
+
function: Namespaces[T];
|
|
11
|
+
handler: (message: RTMessage<T>) => any;
|
|
12
|
+
};
|
|
13
|
+
export declare type AnyRTHandlerFunction = {
|
|
14
|
+
[K in keyof Namespaces]: RTMessageHandler<K>['handler'];
|
|
15
|
+
}[keyof Namespaces];
|
|
16
|
+
export declare type RTMessage<T extends keyof Namespaces = 'CUSTOM-ACTION', O extends jObjectBase = jObjectBase> = {
|
|
17
|
+
namespace: T;
|
|
18
|
+
function: Namespaces[T];
|
|
19
|
+
object: O;
|
|
20
|
+
};
|
|
21
|
+
export declare type AnyRTMessage = {
|
|
22
|
+
[K in keyof Namespaces]: RTMessage<K>;
|
|
23
|
+
}[keyof Namespaces];
|
|
24
|
+
export declare type RTReceivedMessage<T extends keyof Namespaces> = ['message', RTMessage<T>];
|
|
25
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jObjectLittle } from './utils';
|
|
1
2
|
export interface SearchCategoryModel {
|
|
2
3
|
id: string;
|
|
3
4
|
mainType: string;
|
|
@@ -9,6 +10,10 @@ export interface SearchCategoryModel {
|
|
|
9
10
|
typesExcluded: string[];
|
|
10
11
|
facets: SearchFacetModel[];
|
|
11
12
|
}
|
|
13
|
+
export interface SearchCategoryValue {
|
|
14
|
+
count: number;
|
|
15
|
+
id: string;
|
|
16
|
+
}
|
|
12
17
|
export interface SearchFacetModel {
|
|
13
18
|
facetType: string;
|
|
14
19
|
facetOptions: any;
|
|
@@ -17,10 +22,16 @@ export interface SearchFacetModel {
|
|
|
17
22
|
category?: SearchCategoryModel['id'];
|
|
18
23
|
}
|
|
19
24
|
export interface SearchFacetValueModel {
|
|
25
|
+
name: string;
|
|
20
26
|
count: number;
|
|
21
|
-
|
|
27
|
+
values: SearchFacetValues[];
|
|
22
28
|
title: string;
|
|
23
29
|
}
|
|
30
|
+
export declare type SearchFacetValues = {
|
|
31
|
+
count: number;
|
|
32
|
+
value: string;
|
|
33
|
+
title: string;
|
|
34
|
+
};
|
|
24
35
|
/** *
|
|
25
36
|
* Used in search query to specify a filter
|
|
26
37
|
* field : name/id of the filter category (ie skills)
|
|
@@ -30,7 +41,7 @@ export interface SearchFacetValueModel {
|
|
|
30
41
|
export interface SearchQueryFilterModel {
|
|
31
42
|
field: string;
|
|
32
43
|
value: string;
|
|
33
|
-
exclude
|
|
44
|
+
exclude?: boolean;
|
|
34
45
|
}
|
|
35
46
|
/**
|
|
36
47
|
* Used in search query to specify a filter
|
|
@@ -55,7 +66,7 @@ export interface SearchConfig {
|
|
|
55
66
|
facets: SearchFacetModel[];
|
|
56
67
|
};
|
|
57
68
|
categories: SearchCategoryModel[];
|
|
58
|
-
viewcard
|
|
69
|
+
viewcard: Record<string, {
|
|
59
70
|
name: string;
|
|
60
71
|
title: string;
|
|
61
72
|
}[]>;
|
|
@@ -66,34 +77,50 @@ export interface SearchResultCatProps {
|
|
|
66
77
|
showAll?: boolean;
|
|
67
78
|
results: SearchResultProps[];
|
|
68
79
|
}
|
|
69
|
-
export
|
|
80
|
+
export declare type SearchResultProps = SearchResultPropsApp | SearchResultPropsObject;
|
|
81
|
+
export interface SearchResultPropsApp {
|
|
82
|
+
name: string;
|
|
83
|
+
title: string;
|
|
84
|
+
icon: string;
|
|
85
|
+
_url: string;
|
|
86
|
+
}
|
|
87
|
+
export interface SearchResultPropsObject {
|
|
88
|
+
id?: number;
|
|
70
89
|
title: string;
|
|
71
90
|
picture: string;
|
|
72
91
|
uri: string;
|
|
92
|
+
type?: string;
|
|
93
|
+
icon?: string;
|
|
94
|
+
_cssColor?: string;
|
|
95
|
+
_url?: string;
|
|
96
|
+
idArticle?: number;
|
|
97
|
+
_user?: {
|
|
98
|
+
title: string;
|
|
99
|
+
};
|
|
100
|
+
_values?: {
|
|
101
|
+
dateModified: string;
|
|
102
|
+
};
|
|
73
103
|
}
|
|
74
104
|
export interface SearchQuery {
|
|
75
105
|
keywords?: string;
|
|
76
106
|
category?: string;
|
|
77
107
|
facetCategories?: boolean;
|
|
78
108
|
filters?: SearchQueryFilterModel[];
|
|
109
|
+
facets?: SearchFacetModel[];
|
|
79
110
|
page?: number;
|
|
80
111
|
limit?: number;
|
|
81
112
|
sort?: SearchQuerySortModel;
|
|
82
113
|
options?: SearchQueryOption;
|
|
114
|
+
format?: string;
|
|
83
115
|
}
|
|
84
|
-
export interface
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
_url: string;
|
|
91
|
-
}
|
|
92
|
-
export interface SearchQueryResult {
|
|
93
|
-
results: Result[];
|
|
94
|
-
facets: SearchFacetModel[];
|
|
95
|
-
categories: SearchCategoryModel[];
|
|
116
|
+
export interface SearchQueryResult<T extends jObjectLittle = jObjectLittle> {
|
|
117
|
+
start: number;
|
|
118
|
+
count: number;
|
|
119
|
+
results: T[];
|
|
120
|
+
facets: SearchFacetValueModel[];
|
|
121
|
+
categories: SearchCategoryValue[];
|
|
96
122
|
}
|
|
97
123
|
export declare type SearchLastQuery = {
|
|
98
124
|
keywords: string;
|
|
99
125
|
};
|
|
126
|
+
export declare type SearchAdminConfig = any;
|
package/lib/src/types/user.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { WidgetsValue } from './model';
|
|
1
2
|
import { jObjectLittle } from './utils';
|
|
2
3
|
export declare type UserModel = jObjectLittle & {
|
|
3
4
|
firstname: string;
|
|
@@ -15,21 +16,11 @@ export declare const UserLevel: {
|
|
|
15
16
|
readonly EXTERNAL: 3;
|
|
16
17
|
readonly GUEST: 0;
|
|
17
18
|
};
|
|
18
|
-
export declare type jUserAutocomplete = {
|
|
19
|
-
id: string;
|
|
20
|
-
uri: string;
|
|
21
|
-
shortUri: string;
|
|
22
|
-
title: string;
|
|
23
|
-
name: string;
|
|
24
|
-
mainType: string;
|
|
25
|
-
type: string;
|
|
26
|
-
label: string;
|
|
27
|
-
cssClass: string;
|
|
28
|
-
cssColor: string;
|
|
29
|
-
class: string;
|
|
30
|
-
Pseudo: string;
|
|
31
|
-
};
|
|
32
19
|
export declare type jUserLittle = jObjectLittle & {
|
|
33
20
|
level: typeof UserLevel[keyof typeof UserLevel];
|
|
21
|
+
dateCreation: string;
|
|
22
|
+
dateModified: string;
|
|
23
|
+
};
|
|
24
|
+
export declare type jUserList = jUserLittle & {
|
|
25
|
+
[key: string]: WidgetsValue;
|
|
34
26
|
};
|
|
35
|
-
export declare type jUserList = jUserLittle & {};
|
package/lib/src/types/utils.d.ts
CHANGED
|
@@ -36,37 +36,52 @@ export declare type Rights = {
|
|
|
36
36
|
comment: boolean;
|
|
37
37
|
member: boolean;
|
|
38
38
|
};
|
|
39
|
-
export declare type
|
|
39
|
+
export declare type jObjectBase = {
|
|
40
40
|
id: number;
|
|
41
41
|
mainType: string;
|
|
42
42
|
type: string;
|
|
43
43
|
uri: string;
|
|
44
|
+
dateCreation?: string;
|
|
45
|
+
dateModified?: string;
|
|
46
|
+
};
|
|
47
|
+
export declare type jObjectLittle = jObjectBase & {
|
|
44
48
|
title: string;
|
|
45
49
|
_url: string;
|
|
46
|
-
dateCreation: string;
|
|
47
|
-
dateModified: string;
|
|
48
50
|
};
|
|
49
|
-
export declare type
|
|
51
|
+
export declare type jObjectList = jObjectLittle & {
|
|
50
52
|
description?: string;
|
|
51
|
-
_user:
|
|
53
|
+
_user: jUserLittle;
|
|
52
54
|
_right: Rights;
|
|
53
55
|
};
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
/**
|
|
57
|
+
* @deprecated Use jObjectLittle instead
|
|
58
|
+
*/
|
|
59
|
+
export declare type Little = jObjectLittle;
|
|
60
|
+
/**
|
|
61
|
+
* @deprecated Use jObjectList instead
|
|
62
|
+
*/
|
|
63
|
+
export declare type List = jObjectList;
|
|
64
|
+
export declare type jLinkLittle = jObjectBase & {
|
|
65
|
+
srcId: number;
|
|
66
|
+
srcType: string;
|
|
67
|
+
targetId: number;
|
|
68
|
+
targetType: string | null;
|
|
69
|
+
};
|
|
70
|
+
export declare type jLinkList<T extends jObjectBase = jObjectLittle> = jLinkLittle & {
|
|
71
|
+
value: string | null;
|
|
72
|
+
_src?: T;
|
|
73
|
+
_target?: T | undefined;
|
|
74
|
+
};
|
|
75
|
+
export declare type jArticleLittle = jObjectLittle & {
|
|
61
76
|
dateCreation: string;
|
|
62
77
|
dateModified: string;
|
|
63
78
|
};
|
|
64
|
-
export declare type
|
|
65
|
-
export declare type jArticleList = jObjectLittle & {
|
|
79
|
+
export declare type jArticleList = jArticleLittle & {
|
|
66
80
|
description?: string;
|
|
67
81
|
_user: jUserLittle;
|
|
68
82
|
_right: Rights;
|
|
69
83
|
};
|
|
84
|
+
export declare type jArticleView = jArticleList & {};
|
|
70
85
|
export declare type Order = {
|
|
71
86
|
name: string;
|
|
72
87
|
sort: 'ASC' | 'DESC';
|
|
@@ -92,3 +107,9 @@ export declare type MaybeWithCsrf<T> = T & {
|
|
|
92
107
|
export declare type MaybeWithToken<T> = T & {
|
|
93
108
|
token?: string | undefined;
|
|
94
109
|
};
|
|
110
|
+
export declare type MaybeWithParent<T extends jObjectBase = jObjectBase> = {
|
|
111
|
+
_parent?: T;
|
|
112
|
+
};
|
|
113
|
+
export declare type Format = 'raw-little' | 'raw-list' | 'raw-view' | undefined;
|
|
114
|
+
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;
|
|
115
|
+
export declare type ValueOf<T> = T[keyof T];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { JamespotUserApi } from '../apis';
|
|
2
|
+
import { PagingResults, jArticleLittle, jObjectAutocomplete, jObjectLittle } from '../types';
|
|
3
|
+
import { Network } from './network';
|
|
4
|
+
export declare const network: Network;
|
|
5
|
+
export declare const jApi: JamespotUserApi;
|
|
6
|
+
export declare const validateJArticle: <T extends jArticleLittle>(received: T, expected: T, _format: 'raw-little' | 'raw-list' | 'raw-view') => void;
|
|
7
|
+
export declare const validatePagingResults: <T>(received: PagingResults<T>, expected: PagingResults<T>) => void;
|
|
8
|
+
export declare const validateObjectIsFormatLittle: <T extends jObjectLittle = jObjectLittle>(object: T) => boolean;
|
|
9
|
+
export declare const validateObjectIsFormatAutocomplete: <T extends jObjectAutocomplete = jObjectAutocomplete>(object: T) => boolean;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BookmarkCustom, BookmarkLink, BookmarkRawList, jObjectBase } from '../types';
|
|
2
|
+
declare function ensureIsBookmarkLink(bookmark: BookmarkCustom | BookmarkLink): bookmark is BookmarkLink;
|
|
3
|
+
declare function ensureIsBookmarkCustom(bookmark: BookmarkCustom | BookmarkLink): bookmark is BookmarkCustom;
|
|
4
|
+
declare function ensureIsBookmarkRawList(bookmark: jObjectBase | BookmarkRawList): bookmark is BookmarkRawList;
|
|
5
|
+
declare type jObjectTypes = {
|
|
6
|
+
bookmarkLink: BookmarkRawList;
|
|
7
|
+
};
|
|
8
|
+
declare function ensureObjectIsType<T extends keyof jObjectTypes>(type: T, object: jObjectBase): object is jObjectTypes[T];
|
|
9
|
+
export declare const jEnsure: {
|
|
10
|
+
isBookmarkLink: typeof ensureIsBookmarkLink;
|
|
11
|
+
isBookmarkCustom: typeof ensureIsBookmarkCustom;
|
|
12
|
+
isBookmarkRawList: typeof ensureIsBookmarkRawList;
|
|
13
|
+
objectIsType: typeof ensureObjectIsType;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -17,7 +17,7 @@ export declare class Network {
|
|
|
17
17
|
getHostname(): Promise<string>;
|
|
18
18
|
fetch({ o, f, ...body }: OF, signal?: AbortSignal | null): FetchReturnType;
|
|
19
19
|
post<T, U = string[]>(body: OF, signal?: AbortSignal): Promise<ApiWrapper<T, U>>;
|
|
20
|
-
postFile(body: FormData
|
|
20
|
+
postFile(body: FormData): Promise<ApiWrapper<FileResponse, string[]>>;
|
|
21
21
|
postCSRF<T, U = string[]>(body: OF): Promise<ApiWrapper<T, U>>;
|
|
22
22
|
maybePostCSRF<T, U = string[]>(body: MaybeWithCsrf<OF>): Promise<ApiWrapper<T, U>>;
|
|
23
23
|
postToken<T, U = string[]>(body: OF): Promise<ApiWrapper<T, U>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jamespot-user-api",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.99",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"build": "npx webpack --env NODE_ENV=production",
|
|
6
6
|
"build-dev-vm": "npx webpack --env NODE_ENV=development --env NODE_BUILD=VM",
|
|
@@ -14,10 +14,8 @@
|
|
|
14
14
|
"lint:fix": "npx eslint ./src/ --ext .ts,.tsx --fix ",
|
|
15
15
|
"lint:ci": "eslint --output-file eslint_report.json --format json . --ext .ts,.js",
|
|
16
16
|
"doc": "npx typedoc",
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"test": "npm run testMock",
|
|
20
|
-
"testJenkinsDev": "jest -c ./jest.fetch.jenkinsdev.config.ts",
|
|
17
|
+
"test": "jest",
|
|
18
|
+
"test:mockVM": "jest -c ./jest.config.vm.ts",
|
|
21
19
|
"prepare": "husky install"
|
|
22
20
|
},
|
|
23
21
|
"main": "lib/jamespot-user-api.js",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "o": "article", "f": "count", "error": 0, "messages": [], "result": 13 }
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"o": "article",
|
|
3
|
+
"f": "create",
|
|
4
|
+
"error": 0,
|
|
5
|
+
"messages": [{ "code": 200, "msg": "Enregistrement r\u00e9ussi" }],
|
|
6
|
+
"result": [
|
|
7
|
+
{
|
|
8
|
+
"id": 35,
|
|
9
|
+
"mainType": "article",
|
|
10
|
+
"type": "mpArticle",
|
|
11
|
+
"uri": "mpArticle/35",
|
|
12
|
+
"title": "Article for testArticleCreate",
|
|
13
|
+
"_url": "/article/35",
|
|
14
|
+
"dateCreation": "2023-04-11 14:53:51",
|
|
15
|
+
"dateModified": "2023-04-11 14:53:51"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"o": "article",
|
|
3
|
+
"f": "get",
|
|
4
|
+
"error": 0,
|
|
5
|
+
"messages": [],
|
|
6
|
+
"result": {
|
|
7
|
+
"id": 2,
|
|
8
|
+
"mainType": "article",
|
|
9
|
+
"type": "mpArticle",
|
|
10
|
+
"uri": "mpArticle/2",
|
|
11
|
+
"title": "Article groupe public",
|
|
12
|
+
"_url": "/article/2",
|
|
13
|
+
"dateCreation": "2019-07-19 09:36:25",
|
|
14
|
+
"dateModified": "2019-07-19 09:36:25",
|
|
15
|
+
"_right": {
|
|
16
|
+
"create": true,
|
|
17
|
+
"read": true,
|
|
18
|
+
"publish": false,
|
|
19
|
+
"administrate": true,
|
|
20
|
+
"update": true,
|
|
21
|
+
"delete": true,
|
|
22
|
+
"comment": true,
|
|
23
|
+
"member": true
|
|
24
|
+
},
|
|
25
|
+
"description": "<div class='content-html'></div>",
|
|
26
|
+
"_user": {
|
|
27
|
+
"id": 1,
|
|
28
|
+
"mainType": "user",
|
|
29
|
+
"type": "user",
|
|
30
|
+
"uri": "user/1",
|
|
31
|
+
"title": "AdminJenkins",
|
|
32
|
+
"_url": "/user/1",
|
|
33
|
+
"dateCreation": "2019-03-26 16:29:33",
|
|
34
|
+
"dateModified": "2019-07-19 09:39:23",
|
|
35
|
+
"level": 9
|
|
36
|
+
},
|
|
37
|
+
"_nbAttachedFiles": 0
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"o": "article",
|
|
3
|
+
"f": "update",
|
|
4
|
+
"error": 0,
|
|
5
|
+
"messages": [{ "code": 200, "msg": "Enregistrement r\u00e9ussi" }],
|
|
6
|
+
"result": {
|
|
7
|
+
"id": 64,
|
|
8
|
+
"mainType": "article",
|
|
9
|
+
"type": "mpArticle",
|
|
10
|
+
"uri": "mpArticle/64",
|
|
11
|
+
"title": "New Title for testArticleUpdate",
|
|
12
|
+
"_url": "/article/64",
|
|
13
|
+
"dateCreation": "2023-04-11 15:34:46",
|
|
14
|
+
"dateModified": "2023-04-11 15:34:46",
|
|
15
|
+
"_right": {
|
|
16
|
+
"create": true,
|
|
17
|
+
"read": true,
|
|
18
|
+
"publish": false,
|
|
19
|
+
"administrate": true,
|
|
20
|
+
"update": true,
|
|
21
|
+
"delete": true,
|
|
22
|
+
"comment": true,
|
|
23
|
+
"member": true
|
|
24
|
+
},
|
|
25
|
+
"description": "<div class='content-html'></div>",
|
|
26
|
+
"_user": {
|
|
27
|
+
"id": 4,
|
|
28
|
+
"mainType": "user",
|
|
29
|
+
"type": "user",
|
|
30
|
+
"uri": "user/4",
|
|
31
|
+
"title": "Admin1",
|
|
32
|
+
"_url": "/user/4",
|
|
33
|
+
"dateCreation": "2019-07-09 15:48:26",
|
|
34
|
+
"dateModified": "2019-07-09 15:51:24",
|
|
35
|
+
"level": 9
|
|
36
|
+
},
|
|
37
|
+
"processContext": null
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"o": "assetReservation",
|
|
3
|
+
"f": "configuration",
|
|
4
|
+
"error": 0,
|
|
5
|
+
"messages": [],
|
|
6
|
+
"result": {
|
|
7
|
+
"description": "",
|
|
8
|
+
"right": { "manage": true },
|
|
9
|
+
"weekEnd": "0",
|
|
10
|
+
"bookingOpeningTime": "08:00",
|
|
11
|
+
"bookingClosingTime": "21:00",
|
|
12
|
+
"lastBookingSchedule": "20:00"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"o": "assetReservation",
|
|
3
|
+
"f": "configuration",
|
|
4
|
+
"error": 0,
|
|
5
|
+
"messages": [],
|
|
6
|
+
"result": {
|
|
7
|
+
"description": "",
|
|
8
|
+
"right": { "manage": true },
|
|
9
|
+
"weekEnd": "0",
|
|
10
|
+
"bookingOpeningTime": "07:00",
|
|
11
|
+
"bookingClosingTime": "20:00",
|
|
12
|
+
"lastBookingSchedule": "20:00"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"o": "autocomplete",
|
|
3
|
+
"f": "audience",
|
|
4
|
+
"error": 0,
|
|
5
|
+
"messages": [],
|
|
6
|
+
"result": [
|
|
7
|
+
{
|
|
8
|
+
"id": "user/6",
|
|
9
|
+
"uri": "user/6",
|
|
10
|
+
"shortUri": "u6",
|
|
11
|
+
"title": "User1",
|
|
12
|
+
"name": "User1",
|
|
13
|
+
"mainType": "user",
|
|
14
|
+
"type": "user",
|
|
15
|
+
"label": "Utilisateur",
|
|
16
|
+
"cssClass": "user",
|
|
17
|
+
"cssColor": "#a4acaf",
|
|
18
|
+
"class": "user-selector-user",
|
|
19
|
+
"Pseudo": "User1"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"id": "user/7",
|
|
23
|
+
"uri": "user/7",
|
|
24
|
+
"shortUri": "u7",
|
|
25
|
+
"title": "User2",
|
|
26
|
+
"name": "User2",
|
|
27
|
+
"mainType": "user",
|
|
28
|
+
"type": "user",
|
|
29
|
+
"label": "Utilisateur",
|
|
30
|
+
"cssClass": "user",
|
|
31
|
+
"cssColor": "#a4acaf",
|
|
32
|
+
"class": "user-selector-user",
|
|
33
|
+
"Pseudo": "User2"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"id": "spot/3",
|
|
37
|
+
"idspot": "3",
|
|
38
|
+
"uri": "spot/3",
|
|
39
|
+
"shortUri": "s3",
|
|
40
|
+
"title": "Groupe mod\u00e9r\u00e9",
|
|
41
|
+
"name": "Groupe mod\u00e9r\u00e9",
|
|
42
|
+
"mainType": "spot",
|
|
43
|
+
"type": "spot",
|
|
44
|
+
"label": "Groupe",
|
|
45
|
+
"cssClass": "group",
|
|
46
|
+
"cssColor": "#e34d55",
|
|
47
|
+
"class": "user-selector-spot"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"id": "spot/1",
|
|
51
|
+
"idspot": "1",
|
|
52
|
+
"uri": "spot/1",
|
|
53
|
+
"shortUri": "s1",
|
|
54
|
+
"title": "Groupe public",
|
|
55
|
+
"name": "Groupe public",
|
|
56
|
+
"mainType": "spot",
|
|
57
|
+
"type": "spot",
|
|
58
|
+
"label": "Groupe",
|
|
59
|
+
"cssClass": "group",
|
|
60
|
+
"cssColor": "#e34d55",
|
|
61
|
+
"class": "user-selector-spot"
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
}
|