jamespot-user-api 1.0.99 → 1.0.101

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.
Files changed (108) hide show
  1. package/documentation/assets/search.js +1 -1
  2. package/documentation/classes/AdminStoreApi.html +1 -1
  3. package/documentation/classes/JApplicationApi.html +14 -14
  4. package/documentation/classes/JArticleApi.html +1 -1
  5. package/documentation/classes/JAssetReservation.html +1 -1
  6. package/documentation/classes/JAudienceApi.html +1 -1
  7. package/documentation/classes/JBaseApi.html +1 -1
  8. package/documentation/classes/JBookmarkApi.html +1 -1
  9. package/documentation/classes/JCommunityApi.html +1 -1
  10. package/documentation/classes/JDiapazoneApi.html +1 -1
  11. package/documentation/classes/JFileApi.html +6 -6
  12. package/documentation/classes/JFilebankApi.html +1 -1
  13. package/documentation/classes/JGroupApi.html +9 -9
  14. package/documentation/classes/JLandApi.html +1 -1
  15. package/documentation/classes/JLicenseApi.html +7 -7
  16. package/documentation/classes/JMessengerApi.html +1 -1
  17. package/documentation/classes/JSearchApi.html +7 -7
  18. package/documentation/classes/JShareApi.html +1 -1
  19. package/documentation/classes/JTaxonomyApi.html +9 -0
  20. package/documentation/classes/JUserApi.html +4 -4
  21. package/documentation/classes/JWedocApi.html +1 -1
  22. package/documentation/classes/JamespotUserApi.html +1 -1
  23. package/documentation/classes/Network.html +1 -1
  24. package/documentation/classes/WindowBrowser.html +1 -1
  25. package/documentation/enums/StudioApplicationStatus.html +1 -1
  26. package/documentation/index.html +1 -1
  27. package/documentation/interfaces/AccessRightObject.html +1 -1
  28. package/documentation/interfaces/ApiDefaultWrapper.html +1 -0
  29. package/documentation/interfaces/ApiError.html +1 -1
  30. package/documentation/interfaces/ApiWrapper.html +1 -1
  31. package/documentation/interfaces/BaseAutocomplete.html +1 -1
  32. package/documentation/interfaces/BaseMessage.html +1 -1
  33. package/documentation/interfaces/Category.html +1 -1
  34. package/documentation/interfaces/FileBankProps.html +1 -1
  35. package/documentation/interfaces/FolderProps.html +1 -1
  36. package/documentation/interfaces/ListFilterSpec.html +1 -1
  37. package/documentation/interfaces/OF.html +1 -1
  38. package/documentation/interfaces/ObjectListProps.html +1 -1
  39. package/documentation/interfaces/PagingResults.html +1 -1
  40. package/documentation/interfaces/RootFolderProps.html +1 -1
  41. package/documentation/interfaces/SearchCategoryModel.html +1 -1
  42. package/documentation/interfaces/SearchCategoryValue.html +1 -1
  43. package/documentation/interfaces/SearchConfig.html +1 -1
  44. package/documentation/interfaces/SearchFacetModel.html +1 -1
  45. package/documentation/interfaces/SearchFacetValueModel.html +1 -1
  46. package/documentation/interfaces/SearchQuery.html +1 -1
  47. package/documentation/interfaces/SearchQueryFilterModel.html +1 -1
  48. package/documentation/interfaces/SearchQueryOption.html +1 -1
  49. package/documentation/interfaces/SearchQueryResult.html +1 -1
  50. package/documentation/interfaces/SearchQuerySortModel.html +1 -1
  51. package/documentation/interfaces/SearchResultCatProps.html +1 -1
  52. package/documentation/interfaces/SearchResultPropsApp.html +1 -1
  53. package/documentation/interfaces/SearchResultPropsObject.html +1 -1
  54. package/documentation/interfaces/SpotProps.html +1 -1
  55. package/documentation/interfaces/Taxonomy.html +1 -1
  56. package/documentation/interfaces/TaxonomyCreate.html +1 -1
  57. package/documentation/interfaces/WindowInterface.html +1 -1
  58. package/documentation/modules.html +3 -3
  59. package/lib/jamespot-user-api.js +1 -1
  60. package/lib/jamespot-user-api.js.map +1 -1
  61. package/lib/src/apis/application/application.d.ts +6 -6
  62. package/lib/src/apis/article/article.d.ts +1 -0
  63. package/lib/src/apis/bookmark.d.ts +4 -7
  64. package/lib/src/apis/file.d.ts +6 -6
  65. package/lib/src/apis/filebank.d.ts +2 -3
  66. package/lib/src/apis/group.d.ts +7 -7
  67. package/lib/src/apis/index.d.ts +2 -2
  68. package/lib/src/apis/jamespotUserApi.d.ts +3 -3
  69. package/lib/src/apis/jland/jland.d.ts +1 -1
  70. package/lib/src/apis/mediaLibrary/mediaLibrary.d.ts +5 -0
  71. package/lib/src/apis/mediaLibrary/mediaLibrary.mock.d.ts +2 -0
  72. package/lib/src/apis/mediaLibrary/mediaLibrary.test.d.ts +1 -0
  73. package/lib/src/apis/taxonomy/index.d.ts +2 -0
  74. package/lib/src/apis/taxonomy/taxonomy.d.ts +21 -0
  75. package/lib/src/apis/taxonomy/taxonomy.mock.d.ts +8 -0
  76. package/lib/src/apis/taxonomy/taxonomy.test.d.ts +1 -0
  77. package/lib/src/apis/taxonomy/types.d.ts +115 -0
  78. package/lib/src/apis/{user.d.ts → user/user.d.ts} +18 -17
  79. package/lib/src/apis/user/user.mock.d.ts +9 -0
  80. package/lib/src/apis/user/user.test.d.ts +1 -0
  81. package/lib/src/types/autocomplete.d.ts +1 -0
  82. package/lib/src/types/index.d.ts +1 -1
  83. package/lib/src/types/mediaLibrary.d.ts +14 -0
  84. package/lib/src/types/model.d.ts +4 -2
  85. package/lib/src/types/user.d.ts +1 -0
  86. package/lib/src/types/utils.d.ts +13 -8
  87. package/lib/src/util/Test.d.ts +3 -2
  88. package/lib/src/util/network.d.ts +7 -7
  89. package/package.json +1 -1
  90. package/phpunitMock/autocompleteTaxonomy-default.json +21 -0
  91. package/phpunitMock/autocompleteUser-a.json +64 -0
  92. package/phpunitMock/objectListJamespotUserMap-default.json +17 -0
  93. package/phpunitMock/objectListJamespotUserQueryList-rawList.json +179 -0
  94. package/phpunitMock/objectListMediaLibraryGetUnclassifiedFiles-default.json +13 -0
  95. package/phpunitMock/objectListTaxonomyConcept-default.json +80 -0
  96. package/phpunitMock/objectListTaxonomyHierarchyConcept-default.json +27 -0
  97. package/phpunitMock/taxonomyCreate-default.json +45 -0
  98. package/phpunitMock/taxonomyList-default.json +203 -0
  99. package/phpunitMock/userAddContact-default.json +1 -0
  100. package/phpunitMock/userDirectoryConfiguration-default.json +34 -0
  101. package/phpunitMock/userGet-rawView.json +29 -0
  102. package/phpunitMock/userRemoveContact-default.json +1 -0
  103. package/documentation/classes/JConceptApi.html +0 -7
  104. package/lib/src/apis/concept.d.ts +0 -15
  105. package/lib/src/apis/taxonomy.d.ts +0 -9
  106. package/lib/src/types/concept.d.ts +0 -29
  107. package/lib/src/types/listWrapper.d.ts +0 -8
  108. package/lib/src/types/taxonomy.d.ts +0 -46
@@ -5,20 +5,20 @@ export declare class JFileApi extends JBaseApi {
5
5
  * Upload a file to the server. use the same token to link the file to an article
6
6
  * @param config configuration object. One of "file" and "url" is mandatory
7
7
  */
8
- upload(config: UploadConfig): Promise<import("../types").ApiWrapper<FileResponse, string[]>>;
8
+ upload(config: UploadConfig): Promise<import("../types").ApiWrapper<FileResponse, import("../types").BaseMessages>>;
9
9
  /**
10
10
  * Upload a list of files to the server. use the same token to link the file to an article
11
11
  * @param attrName file name (attachment, image, bannerImage, etc.)
12
12
  * @param files files
13
13
  * @param token token
14
14
  */
15
- uploadMany(configArray: Array<UploadConfig>): Promise<import("../types").ApiWrapper<FileResponse, string[]>[]>;
15
+ uploadMany(configArray: Array<UploadConfig>): Promise<import("../types").ApiWrapper<FileResponse, import("../types").BaseMessages>[]>;
16
16
  /**
17
17
  * Crop an image
18
18
  * @param config crop configuration
19
19
  * @returns
20
20
  */
21
- update(idFile: number | string, type: string, config: FileCropConfig): Promise<import("../types").ApiWrapper<FileResponse, string[]> | {
21
+ update(idFile: number | string, type: string, config: FileCropConfig): Promise<import("../types").ApiWrapper<FileResponse, import("../types").BaseMessages> | {
22
22
  result: {
23
23
  crop: {
24
24
  width: any;
@@ -41,7 +41,7 @@ export declare class JFileApi extends JBaseApi {
41
41
  o: string;
42
42
  f: string;
43
43
  error: number;
44
- messages: string[];
44
+ messages: import("../types").BaseMessages;
45
45
  errorMsg?: string;
46
46
  }>;
47
47
  /**
@@ -51,7 +51,7 @@ export declare class JFileApi extends JBaseApi {
51
51
  * @param token token
52
52
  * @returns
53
53
  */
54
- deleteFile(idFile: number | string, attrName: string, token: string): Promise<import("../types").ApiWrapper<"", string[]>>;
54
+ deleteFile(idFile: number | string, attrName: string, token: string): Promise<import("../types").ApiWrapper<"", import("../types").BaseMessages>>;
55
55
  /**
56
56
  * delete the image associated with a content. This action is permanent. There is no two step process with a token
57
57
  * @param id content id
@@ -60,5 +60,5 @@ export declare class JFileApi extends JBaseApi {
60
60
  */
61
61
  deleteImage(id: number | string, type: string): Promise<import("../types").ApiWrapper<{
62
62
  id: number;
63
- }, string[]>>;
63
+ }, import("../types").BaseMessages>>;
64
64
  }
@@ -1,6 +1,5 @@
1
1
  import { JBaseApi } from './base';
2
- import { ListWrapper } from '../types/listWrapper';
3
- import { jObjectLittle, Rights } from '../types';
2
+ import { jObjectLittle, PagingResults, Rights } from '../types';
4
3
  export interface RootFolderProps {
5
4
  id: number;
6
5
  title: string;
@@ -30,5 +29,5 @@ export interface FolderProps extends jObjectLittle {
30
29
  }
31
30
  export declare class JFilebankApi extends JBaseApi {
32
31
  getBanks(format?: string): Promise<Array<FileBankProps>>;
33
- getFolders(parentURI: string): Promise<ListWrapper<FolderProps>>;
32
+ getFolders(parentURI: string): Promise<PagingResults<FolderProps[]>>;
34
33
  }
@@ -7,36 +7,36 @@ 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, jObjectLittle, GroupList, GroupView, jObjectLittle>, string[]>>;
10
+ create<T extends Format = undefined>(group: CreateGroup, format?: T): Promise<import("../types").ApiWrapper<ApiReturn<T, jObjectLittle, GroupList, GroupView, jObjectLittle>, import("../types").BaseMessages>>;
11
11
  /**
12
12
  * Update a group
13
13
  * @param group group to update. The uri is mandatory and identify the group to update
14
14
  * @param format return format
15
15
  * @returns
16
16
  */
17
- update<T extends Format = undefined>(group: UpdateGroup, format?: T): Promise<import("../types").ApiWrapper<ApiReturn<T, jObjectLittle, GroupList, GroupView, string>, string[]>>;
17
+ update<T extends Format = undefined>(group: UpdateGroup, format?: T): Promise<import("../types").ApiWrapper<ApiReturn<T, jObjectLittle, GroupList, GroupView, string>, import("../types").BaseMessages>>;
18
18
  /**
19
19
  * Get a spot
20
20
  * @param idSpot
21
21
  * @param format
22
22
  * @returns
23
23
  */
24
- getSpot<T extends Format = undefined>(idSpot: number | string, format?: T): Promise<import("../types").ApiWrapper<ApiReturn<T, jObjectLittle, GroupList, GroupView, string>, string[]>>;
24
+ getSpot<T extends Format = undefined>(idSpot: number | string, format?: T): Promise<import("../types").ApiWrapper<ApiReturn<T, jObjectLittle, GroupList, GroupView, string>, import("../types").BaseMessages>>;
25
25
  /**
26
26
  * Get the properties of a group that are not within the model
27
27
  * @param idSpot
28
28
  * @returns
29
29
  */
30
- getProperties(idSpot: number | string): Promise<import("../types").ApiWrapper<GroupProperties, string[]>>;
30
+ getProperties(idSpot: number | string): Promise<import("../types").ApiWrapper<GroupProperties, import("../types").BaseMessages>>;
31
31
  /**
32
32
  * Get the available applications that can be added to a group
33
33
  */
34
- getApplications(): Promise<import("../types").ApiWrapper<Record<string, GroupWidget>, string[]>>;
34
+ getApplications(): Promise<import("../types").ApiWrapper<Record<string, GroupWidget>, import("../types").BaseMessages>>;
35
35
  /**
36
36
  * Get the available group categories
37
37
  * @returns
38
38
  */
39
- getCategories(): Promise<import("../types").ApiWrapper<Category[], string[]>>;
39
+ getCategories(): Promise<import("../types").ApiWrapper<Category[], import("../types").BaseMessages>>;
40
40
  /**
41
41
  * Get the members of a group
42
42
  * @param idSpot spot id
@@ -45,5 +45,5 @@ export declare class JGroupApi extends JBaseApi {
45
45
  * @param page page number
46
46
  * @return array of User
47
47
  */
48
- getObjectListJamespotSpotMembers(idSpot: number | string, query?: string, limit?: number, page?: number): Promise<import("../types").ApiWrapper<PagingResults<jObjectLittle>, string[]>>;
48
+ getObjectListJamespotSpotMembers(idSpot: number | string, query?: string, limit?: number, page?: number): Promise<import("../types").ApiWrapper<PagingResults<jObjectLittle>, import("../types").BaseMessages>>;
49
49
  }
@@ -6,7 +6,6 @@ export * from './audience/audience';
6
6
  export * from './base';
7
7
  export * from './bookmark';
8
8
  export * from './community';
9
- export * from './concept';
10
9
  export * from './diapazone';
11
10
  export * from './file';
12
11
  export * from './filebank';
@@ -17,5 +16,6 @@ export * from './Licenses/licenses';
17
16
  export * from './messenger';
18
17
  export * from './search/search';
19
18
  export * from './share';
20
- export * from './user';
19
+ export * from './user/user';
20
+ export * from './taxonomy';
21
21
  export * from './wedoc';
@@ -5,16 +5,16 @@ import { JAseiApi } from './asei';
5
5
  import { JAssetReservation } from './assetReservation';
6
6
  import { JAudienceApi } from './audience/audience';
7
7
  import { JCommunityApi } from './community';
8
- import { JConceptApi } from './concept';
9
8
  import { JFileApi } from './file';
10
9
  import { JFilebankApi } from './filebank';
11
10
  import { JGroupApi } from './group';
11
+ import { JMediaLibraryApi } from './mediaLibrary/mediaLibrary';
12
12
  import { JLandApi } from './jland/jland';
13
13
  import { JMessengerApi } from './messenger';
14
14
  import { JSearchApi } from './search/search';
15
15
  import { JBookmarkApi } from './bookmark';
16
16
  import { JTaxonomyApi } from './taxonomy';
17
- import { JUserApi } from './user';
17
+ import { JUserApi } from './user/user';
18
18
  import { JDiapazoneApi } from './diapazone';
19
19
  import { JWedocApi } from './wedoc';
20
20
  import { Network } from '../util/network';
@@ -40,13 +40,13 @@ export declare class JamespotUserApi {
40
40
  audience: JAudienceApi;
41
41
  bookmark: JBookmarkApi;
42
42
  community: JCommunityApi;
43
- concept: JConceptApi;
44
43
  diapazone: JDiapazoneApi;
45
44
  file: JFileApi;
46
45
  filebank: JFilebankApi;
47
46
  group: JGroupApi;
48
47
  jland: JLandApi;
49
48
  license: JLicenseApi;
49
+ mediaLibrary: JMediaLibraryApi;
50
50
  messenger: JMessengerApi;
51
51
  search: JSearchApi;
52
52
  share: JShareApi;
@@ -41,5 +41,5 @@ export declare class JLandApi extends JBaseApi {
41
41
  dateEnd?: string;
42
42
  }): Promise<ApiWrapper<Array<JLandStat>>>;
43
43
  getAllMapsAsAdmin(format?: string): Promise<ApiWrapper<PagingResults<JLandMap>>>;
44
- createMap(map: MaybeWithToken<JLandMapCreation>, format?: string): Promise<ApiWrapper<unknown, string[]>>;
44
+ createMap(map: MaybeWithToken<JLandMapCreation>, format?: string): Promise<ApiWrapper<unknown, import("../../types").BaseMessages>>;
45
45
  }
@@ -0,0 +1,5 @@
1
+ import { JBaseApi } from '../base';
2
+ import { PagingResults, ApiWrapper, MediaLibraryList } from '../../types';
3
+ export declare class JMediaLibraryApi extends JBaseApi {
4
+ GetUnclassifiedFiles(format?: string): Promise<ApiWrapper<PagingResults<MediaLibraryList>>>;
5
+ }
@@ -0,0 +1,2 @@
1
+ import { ApiWrapper, MediaLibraryList, PagingResults } from '../../types';
2
+ export declare const mediaLibraryGetUnclassifiedFilesDefault: ApiWrapper<PagingResults<MediaLibraryList>>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './types';
2
+ export * from './taxonomy';
@@ -0,0 +1,21 @@
1
+ import { JBaseApi } from '../base';
2
+ import { ApiWrapper, BaseMessagesOne, PagingResults } from '../../types';
3
+ import { AutoCompeteConcept, AutocompleteHierarchy, AutoCompleteList, Concept, Taxonomy, TaxonomyCreate } from './types';
4
+ export declare class JTaxonomyApi extends JBaseApi {
5
+ /**
6
+ * list all taxonomies (no pagination)
7
+ */
8
+ list(): Promise<Taxonomy[]>;
9
+ create(taxonomy: TaxonomyCreate): Promise<ApiWrapper<Taxonomy, BaseMessagesOne>>;
10
+ /**
11
+ * autocomplete return a list of tags
12
+ * @param idTaxonomy taxonomy id
13
+ * @param query search characters
14
+ */
15
+ autocomplete(idTaxonomy: string, query: string): Promise<ApiWrapper<{
16
+ id: string;
17
+ type: string;
18
+ }[], import("../../types").BaseMessages>>;
19
+ autocompleteList(payload: AutoCompleteList): Promise<ApiWrapper<PagingResults<Concept>, import("../../types").BaseMessages>>;
20
+ autocompleteHierarchy(payload: AutocompleteHierarchy): Promise<ApiWrapper<PagingResults<AutoCompeteConcept>, import("../../types").BaseMessages>>;
21
+ }
@@ -0,0 +1,8 @@
1
+ import { AutoCompeteConcept, Concept, Taxonomy, TaxonomyCreate } from './types';
2
+ import { ApiWrapper, BaseMessages, PagingResults } from '../../types';
3
+ export declare const taxonomyList: ApiWrapper<Taxonomy[]>;
4
+ export declare const taxonomyCreateParam: TaxonomyCreate;
5
+ export declare const taxonomyCreateResponse: ApiWrapper<Taxonomy, BaseMessages>;
6
+ export declare const taxonomyAutocomplete: ApiWrapper<AutoCompeteConcept[]>;
7
+ export declare const conceptAutocomplete: ApiWrapper<PagingResults<Concept>>;
8
+ export declare const conceptTaxonomyHierarchy: ApiWrapper<PagingResults<AutoCompeteConcept>>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,115 @@
1
+ import { Filter, Rights } from '../../types';
2
+ export interface Taxonomy {
3
+ id: number;
4
+ type: string;
5
+ title: string;
6
+ dateCreation?: string;
7
+ mainTypes?: string[];
8
+ types?: null;
9
+ mandatory?: null;
10
+ public?: null;
11
+ wallFilter?: null;
12
+ jamespot?: string;
13
+ uri: string;
14
+ mainType?: string;
15
+ _cssColor?: string;
16
+ _cssClass?: string;
17
+ _right?: {
18
+ create: boolean;
19
+ read: boolean;
20
+ publish: boolean;
21
+ administrate: boolean;
22
+ update: boolean;
23
+ delete: boolean;
24
+ comment: boolean;
25
+ member: boolean;
26
+ };
27
+ _values?: {
28
+ type: string;
29
+ title: string;
30
+ dateCreation: string;
31
+ mainTypes?: string | null;
32
+ types: string[] | null;
33
+ mandatory: null;
34
+ public: null;
35
+ wallFilter: null;
36
+ jamespot: string | null;
37
+ };
38
+ _timezone?: {
39
+ dateCreation: string;
40
+ };
41
+ _url?: string;
42
+ }
43
+ export interface TaxonomyCreate {
44
+ type: 'taxonomyClose' | 'taxonomyOpen';
45
+ title: string;
46
+ concepts: Array<string>;
47
+ }
48
+ export declare type AutoCompleteList = {
49
+ query?: string;
50
+ queryFields?: Array<string>;
51
+ limit?: number;
52
+ page?: number;
53
+ format?: string;
54
+ additionalFilter?: {};
55
+ filters?: Array<Filter>;
56
+ orders?: Array<{
57
+ name: string;
58
+ sort: string;
59
+ }>;
60
+ security?: number;
61
+ uriTaxonomy: string;
62
+ };
63
+ export declare type AutocompleteHierarchy = {
64
+ limit?: number;
65
+ page?: number;
66
+ format?: string;
67
+ additionalFilter?: {};
68
+ filters?: Array<Filter>;
69
+ orders?: Array<{
70
+ name: string;
71
+ sort: string;
72
+ }>;
73
+ security?: number;
74
+ uriTaxonomy: string;
75
+ uriConcept?: string;
76
+ };
77
+ export declare type AutoCompeteConcept = {
78
+ id: string;
79
+ uri: string;
80
+ shortUri: string;
81
+ title: string;
82
+ name: string;
83
+ mainType: string;
84
+ type: string;
85
+ label: string;
86
+ cssClass: string;
87
+ cssColor: string;
88
+ class: string;
89
+ };
90
+ export declare type Concept = {
91
+ id: number;
92
+ uri: string;
93
+ title: string;
94
+ type: string;
95
+ idTaxonomy: string;
96
+ dateCreation: string;
97
+ terms: string[];
98
+ _label: string;
99
+ _count: string;
100
+ mainType: string;
101
+ _cssClass: string;
102
+ _cssColor: string;
103
+ _right: Rights;
104
+ _values: {
105
+ type: string;
106
+ title: string;
107
+ idTaxonomy: string;
108
+ dateCreation: string;
109
+ terms: string | null;
110
+ };
111
+ _timezone: {
112
+ dateCreation: string;
113
+ };
114
+ _url: string;
115
+ };
@@ -1,6 +1,5 @@
1
- import { JBaseApi } from './base';
2
- import { ApiWrapper, Little, jObjectLittle, UserModel, UserMapModel, jUserAutocomplete } from '../types';
3
- import { ListWrapper } from '../types/listWrapper';
1
+ import { JBaseApi } from '../base';
2
+ import { ApiWrapper, Little, jObjectLittle, UserModel, UserMapModel, jUserAutocomplete, ApiPagingResults, ApiDefaultWrapper, jUserLittle } from '../../types';
4
3
  export declare type User = Little & {
5
4
  id: string;
6
5
  shortUri: string;
@@ -12,15 +11,17 @@ export declare type User = Little & {
12
11
  Pseudo: string;
13
12
  _values: Record<string, unknown>;
14
13
  };
15
- import { Orders, Filters } from '../types';
14
+ import { Orders, Filters } from '../../types';
16
15
  export interface ObjectListProps {
17
- additionalFilter?: any;
18
- facets?: any;
16
+ additionalFilter?: {};
17
+ facets?: {}[];
19
18
  filters?: Filters;
20
19
  query?: string;
21
- orders?: Orders;
20
+ queryFields?: Array<string>;
22
21
  limit?: number;
23
22
  page?: number;
23
+ orders?: Orders;
24
+ format?: string;
24
25
  }
25
26
  export declare type UserDirectoryConfiguration = {
26
27
  userDirectoryShow: '' | '1';
@@ -30,7 +31,7 @@ export declare type UserDirectoryConfiguration = {
30
31
  cardFields: Array<string>;
31
32
  tableFields: Array<string>;
32
33
  viewFields: Array<string>;
33
- userGeoloc?: string;
34
+ userGeoloc?: boolean;
34
35
  sort: string;
35
36
  cnt?: number;
36
37
  filters: Array<{
@@ -66,18 +67,18 @@ export declare class JUserApi extends JBaseApi {
66
67
  */
67
68
  get<T extends jObjectLittle = jObjectLittle>(uri: string, format?: string): Promise<ApiWrapper<T>>;
68
69
  configuration(): Promise<ApiWrapper<UserDirectoryConfiguration>>;
69
- userQueryList(payload: ObjectListProps): Promise<ApiWrapper<ListWrapper<UserModel>>>;
70
- userMap(payload: ObjectListProps): Promise<ApiWrapper<ListWrapper<UserMapModel>>>;
71
- userBusinessContactQueryList(query: ObjectListProps): Promise<ApiWrapper<ListWrapper<UserModel>>>;
72
- userCreateBusinessContact(user: BusinessContact): Promise<ApiWrapper<import("../types").jArticleLittle[], import("../types").BaseMessages>>;
73
- userUpdateBusinessContact(user: BusinessContact): Promise<ApiWrapper<import("../types").jArticleView, import("../types").BaseMessages>>;
74
- userDeleteBusinessContact(idArticle: number): Promise<ApiWrapper<boolean, import("../types").BaseMessages>>;
75
- userAddContact(idUser: number): Promise<ApiWrapper<unknown>>;
76
- userRemoveContact(idUser: number): Promise<ApiWrapper<unknown>>;
70
+ userQueryList<T extends jObjectLittle = jUserLittle>(payload: ObjectListProps): Promise<ApiPagingResults<T>>;
71
+ userMap(payload: ObjectListProps): Promise<ApiPagingResults<UserMapModel>>;
72
+ userBusinessContactQueryList(query: ObjectListProps): Promise<ApiPagingResults<UserModel>>;
73
+ userCreateBusinessContact(user: BusinessContact): Promise<ApiWrapper<import("../../types").jArticleLittle[], import("../../types").BaseMessages>>;
74
+ userUpdateBusinessContact(user: BusinessContact): Promise<ApiWrapper<import("../../types").jArticleView, import("../../types").BaseMessages>>;
75
+ userDeleteBusinessContact(idArticle: number): Promise<ApiWrapper<boolean, import("../../types").BaseMessages>>;
76
+ userAddContact(idUser: number): Promise<ApiDefaultWrapper>;
77
+ userRemoveContact(idUser: number): Promise<ApiDefaultWrapper>;
77
78
  /**
78
79
  * signIn function returns a Promise of users.
79
80
  * @param mail Mail or username
80
81
  * @param pwd Password to be validated
81
82
  */
82
- signIn(mail: string, pwd: string): Promise<ApiWrapper<jUserAutocomplete, string[]>>;
83
+ signIn(mail: string, pwd: string): Promise<ApiWrapper<jUserAutocomplete, import("../../types").BaseMessages>>;
83
84
  }
@@ -0,0 +1,9 @@
1
+ import { ApiDefaultWrapper, ApiPagingResults, ApiWrapper, UserMapModel, jUserAutocomplete, jUserList, jUserView } from '../../types';
2
+ import { UserDirectoryConfiguration } from './user';
3
+ export declare const userAutocompleteA: ApiWrapper<jUserAutocomplete[]>;
4
+ export declare const userGetUser1: ApiWrapper<jUserView>;
5
+ export declare const userDirectoryConfigurationDefault: ApiWrapper<UserDirectoryConfiguration>;
6
+ export declare const userQueryListRawList: ApiPagingResults<jUserList>;
7
+ export declare const userMapDefault: ApiPagingResults<UserMapModel>;
8
+ export declare const userAddContactDefault: ApiDefaultWrapper;
9
+ export declare const userRemoveContactDefault: ApiDefaultWrapper;
@@ -0,0 +1 @@
1
+ export {};
@@ -2,6 +2,7 @@ export interface BaseAutocomplete {
2
2
  id: string;
3
3
  uri: string;
4
4
  shortUri: string;
5
+ title: string;
5
6
  name: string;
6
7
  mainType: string;
7
8
  type: string;
@@ -5,10 +5,10 @@ export * from './autocomplete';
5
5
  export * from './bookmark';
6
6
  export * from './file';
7
7
  export * from './group';
8
+ export * from './mediaLibrary';
8
9
  export * from './model';
9
10
  export * from './search';
10
11
  export * from './share';
11
- export * from './taxonomy';
12
12
  export * from './user';
13
13
  export * from './utils';
14
14
  export * from './wedoc';
@@ -0,0 +1,14 @@
1
+ import { AudienceAutocomplete, jArticleList, jArticleLittle, jObjectBase } from '../types';
2
+ export declare type MediaLibraryAttachment = jObjectBase & {
3
+ title: string;
4
+ size: string;
5
+ };
6
+ export declare type MediaLibraryLittle = jArticleLittle & {
7
+ attachment: MediaLibraryAttachment;
8
+ description: string;
9
+ };
10
+ export declare type MediaLibraryList = jArticleList & {
11
+ description: string;
12
+ attachment: MediaLibraryAttachment;
13
+ _audience: Array<AudienceAutocomplete>;
14
+ };
@@ -18,13 +18,15 @@ export declare type WidgetDate = {
18
18
  type: 'date';
19
19
  format: string;
20
20
  };
21
- export declare type WidgetDateValue = string;
21
+ export declare type WidgetDateValue = string | null;
22
22
  export declare type WidgetDatetime = {
23
23
  type: 'datetime';
24
24
  };
25
+ export declare type WidgetDatetimeValue = string | null;
25
26
  export declare type WidgetDatePicker = {
26
27
  type: 'datePicker';
27
28
  };
29
+ export declare type WidgetDatePickerValue = string | null;
28
30
  export declare type WidgetMultiattribute = {
29
31
  type: 'multiattribute';
30
32
  };
@@ -88,7 +90,7 @@ export declare type WidgetUri = {
88
90
  };
89
91
  };
90
92
  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;
93
+ export declare type WidgetsValue = WidgetDatePickerValue | WidgetDatetimeValue | WidgetDateValue | WidgetEmailValue | WidgetNumberValue | WidgetTextareaValue | WidgetTextValue | WidgetUrlValue;
92
94
  export declare type FieldConfiguration<T extends string = string> = {
93
95
  label: string;
94
96
  description?: string;
@@ -24,3 +24,4 @@ export declare type jUserLittle = jObjectLittle & {
24
24
  export declare type jUserList = jUserLittle & {
25
25
  [key: string]: WidgetsValue;
26
26
  };
27
+ export declare type jUserView = jUserList & {};
@@ -1,10 +1,18 @@
1
1
  import { jUserLittle } from './user';
2
- export interface ApiWrapper<T, U = string[]> {
2
+ export interface BaseMessage {
3
+ msg: string;
4
+ code: number;
5
+ }
6
+ export declare type BaseMessages = BaseMessage[];
7
+ export declare type BaseMessagesOne = [BaseMessage];
8
+ export interface ApiDefaultWrapper<U = BaseMessages> {
3
9
  o: string;
4
10
  f: string;
5
11
  error: number;
6
12
  messages: U;
7
13
  errorMsg?: string;
14
+ }
15
+ export interface ApiWrapper<T, U = BaseMessages> extends ApiDefaultWrapper<U> {
8
16
  result: T;
9
17
  }
10
18
  export interface PagingResults<T> {
@@ -15,17 +23,11 @@ export interface PagingResults<T> {
15
23
  limit: number;
16
24
  page: number;
17
25
  }
18
- export declare type ApiPagingResults<T, U = string[]> = ApiWrapper<PagingResults<T>, U>;
26
+ export declare type ApiPagingResults<T, U = BaseMessages> = ApiWrapper<PagingResults<T>, U>;
19
27
  export interface ApiError<U = string> {
20
28
  error: number;
21
29
  messages: U[];
22
30
  }
23
- export interface BaseMessage {
24
- msg: string;
25
- code: number;
26
- }
27
- export declare type BaseMessages = BaseMessage[];
28
- export declare type BaseMessagesOne = [BaseMessage];
29
31
  export declare type Rights = {
30
32
  create: boolean;
31
33
  read: boolean;
@@ -90,6 +92,9 @@ export declare type Orders = Array<Order>;
90
92
  export declare type FilterValue = boolean | string | string[] | {
91
93
  srcId: number | string;
92
94
  srcType: string;
95
+ } | {
96
+ targetId: number | string;
97
+ targetType: string;
93
98
  } | {
94
99
  start: string;
95
100
  end: string;
@@ -1,9 +1,10 @@
1
1
  import { JamespotUserApi } from '../apis';
2
- import { PagingResults, jArticleLittle, jObjectAutocomplete, jObjectLittle } from '../types';
2
+ import { ApiDefaultWrapper, PagingResults, jArticleLittle, jObjectAutocomplete, jObjectLittle } 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
- export declare const validatePagingResults: <T>(received: PagingResults<T>, expected: PagingResults<T>) => void;
7
+ export declare const validateApiWrapper: <T extends ApiDefaultWrapper<import("../types").BaseMessages>>(res: T, o: string, f: string, error?: null) => void;
8
+ export declare const validatePagingResults: <T>(res: PagingResults<T>) => void;
8
9
  export declare const validateObjectIsFormatLittle: <T extends jObjectLittle = jObjectLittle>(object: T) => boolean;
9
10
  export declare const validateObjectIsFormatAutocomplete: <T extends jObjectAutocomplete = jObjectAutocomplete>(object: T) => boolean;
@@ -1,4 +1,4 @@
1
- import { ApiWrapper, FileResponse, MaybeWithCsrf, MaybeWithToken } from '../types';
1
+ import { ApiWrapper, BaseMessages, FileResponse, MaybeWithCsrf, MaybeWithToken } from '../types';
2
2
  import { FetchReturnType, WindowInterface } from '../window/Window';
3
3
  export interface OF {
4
4
  o: string;
@@ -16,12 +16,12 @@ export declare class Network {
16
16
  getUrl(o: string, f: string): Promise<string>;
17
17
  getHostname(): Promise<string>;
18
18
  fetch({ o, f, ...body }: OF, signal?: AbortSignal | null): FetchReturnType;
19
- post<T, U = string[]>(body: OF, signal?: AbortSignal): Promise<ApiWrapper<T, U>>;
20
- postFile(body: FormData): Promise<ApiWrapper<FileResponse, string[]>>;
21
- postCSRF<T, U = string[]>(body: OF): Promise<ApiWrapper<T, U>>;
22
- maybePostCSRF<T, U = string[]>(body: MaybeWithCsrf<OF>): Promise<ApiWrapper<T, U>>;
23
- postToken<T, U = string[]>(body: OF): Promise<ApiWrapper<T, U>>;
24
- maybePostToken<T, U = string[]>(body: MaybeWithToken<OF>): Promise<ApiWrapper<T, U>>;
19
+ post<T, U = BaseMessages>(body: OF, signal?: AbortSignal): Promise<ApiWrapper<T, U>>;
20
+ postFile(body: FormData): Promise<ApiWrapper<FileResponse, BaseMessages>>;
21
+ postCSRF<T, U = BaseMessages>(body: OF): Promise<ApiWrapper<T, U>>;
22
+ maybePostCSRF<T, U = BaseMessages>(body: MaybeWithCsrf<OF>): Promise<ApiWrapper<T, U>>;
23
+ postToken<T, U = BaseMessages>(body: OF): Promise<ApiWrapper<T, U>>;
24
+ maybePostToken<T, U = BaseMessages>(body: MaybeWithToken<OF>): Promise<ApiWrapper<T, U>>;
25
25
  token(): Promise<ApiWrapper<string>>;
26
26
  tokenCSRF(): Promise<ApiWrapper<string>>;
27
27
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jamespot-user-api",
3
- "version": "1.0.99",
3
+ "version": "1.0.101",
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",
@@ -0,0 +1,21 @@
1
+ {
2
+ "o": "autocomplete",
3
+ "f": "taxonomy",
4
+ "error": 0,
5
+ "messages": [],
6
+ "result": [
7
+ {
8
+ "id": "tagConcept/101",
9
+ "uri": "tagConcept/101",
10
+ "shortUri": "",
11
+ "title": "autocomplete",
12
+ "name": "autocomplete",
13
+ "mainType": "tagConcept",
14
+ "type": "tagConcept",
15
+ "label": "Tag",
16
+ "cssClass": "article",
17
+ "cssColor": "#76b9f2",
18
+ "class": "user-selector-spot"
19
+ }
20
+ ]
21
+ }