jamespot-user-api 1.0.13 → 1.0.43

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 (175) hide show
  1. package/documentation/.nojekyll +1 -0
  2. package/documentation/assets/highlight.css +50 -0
  3. package/documentation/assets/icons.css +1043 -0
  4. package/documentation/assets/icons.png +0 -0
  5. package/documentation/assets/icons@2x.png +0 -0
  6. package/documentation/assets/main.js +52 -0
  7. package/documentation/assets/search.js +1 -0
  8. package/documentation/assets/style.css +1413 -0
  9. package/documentation/assets/widgets.png +0 -0
  10. package/documentation/assets/widgets@2x.png +0 -0
  11. package/documentation/classes/JApplication.html +1 -0
  12. package/documentation/classes/JApplicationApi.html +30 -0
  13. package/documentation/classes/JArticleApi.html +1 -0
  14. package/documentation/classes/JAudienceApi.html +4 -0
  15. package/documentation/classes/JBaseApi.html +1 -0
  16. package/documentation/classes/JBaseObject.html +4 -0
  17. package/documentation/classes/JBookmark.html +1 -0
  18. package/documentation/classes/JBookmarkApi.html +1 -0
  19. package/documentation/classes/JCommunityApi.html +1 -0
  20. package/documentation/classes/JConcept.html +1 -0
  21. package/documentation/classes/JConceptApi.html +7 -0
  22. package/documentation/classes/JDiapazoneApi.html +1 -0
  23. package/documentation/classes/JFileApi.html +1 -0
  24. package/documentation/classes/JFilebankApi.html +1 -0
  25. package/documentation/classes/JGroupApi.html +12 -0
  26. package/documentation/classes/JLandApi.html +1 -0
  27. package/documentation/classes/JMessengerApi.html +1 -0
  28. package/documentation/classes/JSearchApi.html +18 -0
  29. package/documentation/classes/JUser.html +1 -0
  30. package/documentation/classes/JUserApi.html +17 -0
  31. package/documentation/classes/JWedocApi.html +1 -0
  32. package/documentation/classes/JamespotUserApi.html +6 -0
  33. package/documentation/classes/Network.html +1 -0
  34. package/documentation/enums/JApplicationStatus.html +1 -0
  35. package/documentation/index.html +79 -0
  36. package/documentation/interfaces/ApiError.html +1 -0
  37. package/documentation/interfaces/ApiWrapper.html +1 -0
  38. package/documentation/interfaces/AseiGroups.html +1 -0
  39. package/documentation/interfaces/AseiInstitution.html +1 -0
  40. package/documentation/interfaces/AseiRights.html +1 -0
  41. package/documentation/interfaces/AseiTicket.html +1 -0
  42. package/documentation/interfaces/BaseAutocomplete.html +1 -0
  43. package/documentation/interfaces/BaseMessage.html +1 -0
  44. package/documentation/interfaces/Category.html +1 -0
  45. package/documentation/interfaces/CreateGroup.html +1 -0
  46. package/documentation/interfaces/FileBankProps.html +1 -0
  47. package/documentation/interfaces/FileOption.html +1 -0
  48. package/documentation/interfaces/FolderProps.html +1 -0
  49. package/documentation/interfaces/ListFilterSpec.html +1 -0
  50. package/documentation/interfaces/OF.html +1 -0
  51. package/documentation/interfaces/PagingResults.html +1 -0
  52. package/documentation/interfaces/Result.html +1 -0
  53. package/documentation/interfaces/RootFolderProps.html +1 -0
  54. package/documentation/interfaces/SearchCategoryModel.html +1 -0
  55. package/documentation/interfaces/SearchConfig.html +1 -0
  56. package/documentation/interfaces/SearchFacetModel.html +1 -0
  57. package/documentation/interfaces/SearchFacetValueModel.html +1 -0
  58. package/documentation/interfaces/SearchQuery.html +1 -0
  59. package/documentation/interfaces/SearchQueryFilterModel.html +6 -0
  60. package/documentation/interfaces/SearchQueryOption.html +4 -0
  61. package/documentation/interfaces/SearchQueryResult.html +1 -0
  62. package/documentation/interfaces/SearchQuerySortModel.html +5 -0
  63. package/documentation/interfaces/SearchResultCatProps.html +1 -0
  64. package/documentation/interfaces/SearchResultProps.html +1 -0
  65. package/documentation/interfaces/SpotProps.html +1 -0
  66. package/documentation/interfaces/Taxonomy.html +1 -0
  67. package/documentation/interfaces/TaxonomyCreate.html +1 -0
  68. package/documentation/interfaces/TmpApplication.html +1 -0
  69. package/documentation/interfaces/TmpUser.html +1 -0
  70. package/documentation/interfaces/UserModel.html +1 -0
  71. package/documentation/modules.html +1 -0
  72. package/lib/jamespot-user-api.js +1 -1
  73. package/lib/jamespot-user-api.js.map +1 -1
  74. package/lib/src/apis/application.d.ts +60 -0
  75. package/lib/src/apis/article.d.ts +38 -0
  76. package/lib/src/apis/asei.d.ts +25 -0
  77. package/lib/src/apis/audience.d.ts +9 -0
  78. package/lib/src/apis/base.d.ts +5 -0
  79. package/lib/src/apis/bookmark.d.ts +21 -0
  80. package/lib/src/apis/community.d.ts +9 -0
  81. package/lib/src/apis/concept.d.ts +10 -0
  82. package/lib/src/apis/diapazone.d.ts +8 -0
  83. package/lib/src/apis/file.d.ts +5 -0
  84. package/lib/src/apis/filebank.d.ts +34 -0
  85. package/lib/src/apis/group.d.ts +16 -0
  86. package/lib/src/apis/index.d.ts +17 -0
  87. package/lib/src/apis/jamespotUserApi.d.ts +47 -0
  88. package/lib/src/apis/jland.d.ts +24 -0
  89. package/lib/src/apis/messenger.d.ts +6 -0
  90. package/lib/src/apis/search.d.ts +47 -0
  91. package/lib/src/apis/taxonomy.d.ts +9 -0
  92. package/lib/src/apis/user.d.ts +27 -0
  93. package/lib/src/apis/wedoc.d.ts +32 -0
  94. package/lib/src/classes/JApplication.d.ts +16 -0
  95. package/lib/src/classes/JBaseObject.d.ts +15 -0
  96. package/lib/src/classes/JBookmark.d.ts +16 -0
  97. package/lib/src/classes/JConcept.d.ts +3 -0
  98. package/lib/src/classes/JDiapazone.d.ts +16 -0
  99. package/lib/src/classes/JFile.d.ts +13 -0
  100. package/lib/src/classes/JUser.d.ts +4 -0
  101. package/lib/src/classes/index.d.ts +5 -0
  102. package/lib/src/index.d.ts +13 -0
  103. package/lib/src/indexMock.d.ts +9 -0
  104. package/lib/src/mock/windowMock.d.ts +9 -0
  105. package/lib/src/types/asei.d.ts +28 -0
  106. package/lib/src/types/autocomplete.d.ts +16 -0
  107. package/lib/src/types/group.d.ts +22 -0
  108. package/lib/src/types/index.d.ts +7 -0
  109. package/lib/src/types/listWrapper.d.ts +6 -0
  110. package/lib/src/types/search.d.ts +96 -0
  111. package/lib/src/types/taxonomy.d.ts +46 -0
  112. package/lib/src/types/user.d.ts +14 -0
  113. package/lib/src/types/utils.d.ts +56 -0
  114. package/lib/src/util/network.d.ts +23 -0
  115. package/package.json +1 -1
  116. package/src/apis/application.ts +132 -0
  117. package/src/apis/article.ts +74 -0
  118. package/src/apis/asei.ts +73 -0
  119. package/src/apis/audience.ts +18 -0
  120. package/src/apis/base.ts +9 -0
  121. package/src/apis/bookmark.ts +110 -0
  122. package/src/apis/community.ts +20 -0
  123. package/src/apis/concept.ts +31 -0
  124. package/src/apis/diapazone.ts +65 -0
  125. package/src/apis/file.ts +14 -0
  126. package/src/apis/filebank.ts +50 -0
  127. package/src/apis/group.ts +48 -0
  128. package/src/apis/index.ts +17 -0
  129. package/src/apis/jamespotUserApi.ts +69 -0
  130. package/src/apis/jland.ts +51 -0
  131. package/src/apis/messenger.ts +25 -0
  132. package/src/apis/search.ts +85 -0
  133. package/src/apis/taxonomy.ts +30 -0
  134. package/src/apis/user.ts +53 -0
  135. package/src/apis/wedoc.ts +77 -0
  136. package/src/classes/JApplication.ts +55 -0
  137. package/src/classes/JBaseObject.ts +64 -0
  138. package/src/classes/JBookmark.ts +44 -0
  139. package/src/classes/JConcept.ts +3 -0
  140. package/src/classes/JDiapazone.ts +42 -0
  141. package/src/classes/JFile.ts +37 -0
  142. package/src/classes/JUser.ts +7 -0
  143. package/src/classes/index.ts +5 -0
  144. package/src/index.ts +21 -0
  145. package/src/indexMock.ts +17 -0
  146. package/src/mock/data/autocomplete/audience/data.json +191 -0
  147. package/src/mock/data/autocomplete/community/data.json +47 -0
  148. package/src/mock/data/autocomplete/taxonomy/data.json +35 -0
  149. package/src/mock/data/autocomplete/user/data.json +107 -0
  150. package/src/mock/data/bookmarks/addBookmark/data.json +54 -0
  151. package/src/mock/data/bookmarks/addLink/data.json +63 -0
  152. package/src/mock/data/bookmarks/bookmarkList/data.json +271 -0
  153. package/src/mock/data/bookmarks/delete/data.json +12 -0
  154. package/src/mock/data/community/sendRequest/data.json +12 -0
  155. package/src/mock/data/file/create/data.json +18 -0
  156. package/src/mock/data/messenger/newMessage/data.json +47 -0
  157. package/src/mock/data/misc/tokenCSRF/data.json +7 -0
  158. package/src/mock/data/search/getConfig/data.json +318 -0
  159. package/src/mock/data/search/lastQueries/data.json +7 -0
  160. package/src/mock/data/search/proposition/data.json +125 -0
  161. package/src/mock/data/spot/create/data.json +7 -0
  162. package/src/mock/data/spot/get-available-widget/data.json +56 -0
  163. package/src/mock/data/spot/get-categories/data.json +28 -0
  164. package/src/mock/data/user/signIn/data.json +197 -0
  165. package/src/mock/windowMock.ts +113 -0
  166. package/src/types/asei.ts +33 -0
  167. package/src/types/autocomplete.ts +17 -0
  168. package/src/types/group.ts +27 -0
  169. package/src/types/index.ts +7 -0
  170. package/src/types/listWrapper.ts +6 -0
  171. package/src/types/search.ts +105 -0
  172. package/src/types/taxonomy.ts +47 -0
  173. package/src/types/user.ts +14 -0
  174. package/src/types/utils.ts +66 -0
  175. package/src/util/network.ts +96 -0
@@ -0,0 +1,47 @@
1
+ import { JApplicationApi } from './application';
2
+ import { JArticleApi } from './article';
3
+ import { JAseiApi } from './asei';
4
+ import { JAudienceApi } from './audience';
5
+ import { JCommunityApi } from './community';
6
+ import { JConceptApi } from './concept';
7
+ import { JFileApi } from './file';
8
+ import { JFilebankApi } from './filebank';
9
+ import { JGroupApi } from './group';
10
+ import { JLandApi } from './jland';
11
+ import { JMessengerApi } from './messenger';
12
+ import { JSearchApi } from './search';
13
+ import { JBookmarkApi } from './bookmark';
14
+ import { JTaxonomyApi } from './taxonomy';
15
+ import { JUserApi } from './user';
16
+ import { JDiapazoneApi } from './diapazone';
17
+ import { JWedocApi } from './wedoc';
18
+ import { Network } from '../util/network';
19
+ /**
20
+ * In browser usage, 'window' should be the window object.
21
+ * In server side usage, 'window' object given must implement the fetch method, used by the Apis.
22
+ * See tests implementation for a working Node sample.
23
+ *
24
+ * Each property (except {@link constants} and {@link window}) is an API providing access to a Jamespot.Pro backend.
25
+ */
26
+ export declare class JamespotUserApi {
27
+ version: string;
28
+ network: Network;
29
+ application: JApplicationApi;
30
+ article: JArticleApi;
31
+ asei: JAseiApi;
32
+ audience: JAudienceApi;
33
+ community: JCommunityApi;
34
+ concept: JConceptApi;
35
+ file: JFileApi;
36
+ filebank: JFilebankApi;
37
+ group: JGroupApi;
38
+ jland: JLandApi;
39
+ messenger: JMessengerApi;
40
+ search: JSearchApi;
41
+ bookmark: JBookmarkApi;
42
+ taxonomy: JTaxonomyApi;
43
+ user: JUserApi;
44
+ diapazone: JDiapazoneApi;
45
+ wedoc: JWedocApi;
46
+ constructor(network: Network);
47
+ }
@@ -0,0 +1,24 @@
1
+ import { JBaseApi } from './base';
2
+ import { ApiWrapper } from '../types';
3
+ export declare type JLandLog = {
4
+ idLog: number;
5
+ slug: string;
6
+ dateCreation: string;
7
+ map: string;
8
+ mail: string;
9
+ };
10
+ export declare type JLandStat = {
11
+ mail: string;
12
+ cnt: string;
13
+ };
14
+ export declare class JLandApi extends JBaseApi {
15
+ getLogs({ dateEnd, idLogMax, }: {
16
+ dateEnd?: string;
17
+ idLogMax?: number;
18
+ }): Promise<ApiWrapper<Array<JLandLog>>>;
19
+ getStats({ map, dateStart, dateEnd, }: {
20
+ map: string;
21
+ dateStart?: string;
22
+ dateEnd?: string;
23
+ }): Promise<ApiWrapper<Array<JLandStat>>>;
24
+ }
@@ -0,0 +1,6 @@
1
+ import { ApiWrapper } from '../types';
2
+ import { JBaseApi } from './base';
3
+ export declare class JMessengerApi extends JBaseApi {
4
+ sendMessage(message: string, idDiscussion: string): Promise<ApiWrapper<Record<string, never>>>;
5
+ getOrCreateDiscussion(idSender: number, idUserTo: number): Promise<ApiWrapper<Record<string, never>>>;
6
+ }
@@ -0,0 +1,47 @@
1
+ import { ApiWrapper, SearchConfig, SearchQuery, SearchQueryResult, SearchResultCatProps } from '../types';
2
+ import { JBaseApi } from './base';
3
+ export declare class JSearchApi extends JBaseApi {
4
+ /**
5
+ * return a completed version of the current config, taking in account platform installed modules
6
+ */
7
+ getConfig(): Promise<ApiWrapper<SearchConfig>>;
8
+ /**
9
+ * Return a maximum of 8 results for a given text query, classed upon config categories
10
+ * @param query string, words can be preceded by + and - for inclusive/exclusive search
11
+ * @param signal: @AbortSignal to cancel the fetch
12
+ */
13
+ proposition({ query, format }: {
14
+ query: string;
15
+ format?: 'list' | 'little';
16
+ }, signal?: AbortSignal): Promise<ApiWrapper<SearchResultCatProps[]>>;
17
+ /**
18
+ * Return a page of results based on a text query and various filters.
19
+ * All parameters are optional
20
+ * @param query
21
+ * @param query.keywords string, words can be preceded by + and - for inclusive/exclusive search (default *:*)
22
+ * @param query.category text id of a category from config,if specified: restrict results to these category
23
+ * @param query.facetCategories boolean, if true: count by categories are returned
24
+ * @param query.filters array of @SearchQueryFilterModel @SearchQueryFilterModel.
25
+ * @param query.page integer. default 1. index of returned page (start by 1)
26
+ * @param query.limit integer. default 20. number of result by page
27
+ * @param query.sort @SearchQuerySortModel default score then date
28
+ * @param query.options @SearchQueryOption. extra possible options for the search
29
+ * @param signal: @AbortSignal to cancel the fetch
30
+
31
+ * // Todo add query.facets (to be specified first)
32
+ */
33
+ searchQuery(query: SearchQuery, signal?: AbortSignal): Promise<ApiWrapper<SearchQueryResult>>;
34
+ /**
35
+ * return the five last keywords typed in the searchbar by the user
36
+ */
37
+ getLastQueries(): Promise<ApiWrapper<string[]>>;
38
+ /**
39
+ * return the current platform json search-config object
40
+ */
41
+ getAdminConfig(): Promise<any>;
42
+ /**
43
+ * set the platform search-config to the given json object
44
+ * @param config object. json search config
45
+ */
46
+ setAdminConfig(config: any): Promise<any>;
47
+ }
@@ -0,0 +1,9 @@
1
+ import { JBaseApi } from './base';
2
+ import { ApiWrapper, BaseMessagesOne, Taxonomy, TaxonomyCreate } from '../types';
3
+ export declare class JTaxonomyApi extends JBaseApi {
4
+ /**
5
+ * list all taxonomies (no pagination)
6
+ */
7
+ list(): Promise<Taxonomy[]>;
8
+ create(taxonomy: TaxonomyCreate): Promise<ApiWrapper<Taxonomy, BaseMessagesOne>>;
9
+ }
@@ -0,0 +1,27 @@
1
+ import { JBaseApi } from './base';
2
+ import { JUser } from '../classes';
3
+ import { ApiWrapper, Little } from '../types';
4
+ export interface TmpUser {
5
+ idUser: string;
6
+ type: string;
7
+ id: string;
8
+ }
9
+ export declare class JUserApi extends JBaseApi {
10
+ /**
11
+ * autocomplete return a list or JUser
12
+ * @param query <string>
13
+ */
14
+ autocomplete(query: string): Promise<Array<JUser>>;
15
+ /**
16
+ * Get a user
17
+ * @param uri uri
18
+ * @param format little by default. If another format is provided, the generic types should be defined
19
+ */
20
+ get<T extends Little = Little>(uri: string, format?: string): Promise<ApiWrapper<T>>;
21
+ /**
22
+ * signIn function returns a Promise of JUser.
23
+ * @param mail Mail or username
24
+ * @param pwd Password to be validated
25
+ */
26
+ signIn(mail: string, pwd: string): Promise<JUser>;
27
+ }
@@ -0,0 +1,32 @@
1
+ import { ApiWrapper } from '../types';
2
+ import { JBaseApi } from './base';
3
+ import { ListWrapper } from '../types/listWrapper';
4
+ import { jFile } from '../classes/JFile';
5
+ import { Orders, Filters } from '../types';
6
+ export declare class JWedocApi extends JBaseApi {
7
+ getFiles(page: number, query: string, filters: Filters, orders: Orders, limit: number): Promise<ListWrapper<jFile>>;
8
+ getTemplates(): Promise<ApiWrapper<boolean, {
9
+ code: number;
10
+ msg: string;
11
+ }>>;
12
+ duplicateFile(idFile: number, title: string, publishTo: Array<any>): Promise<ApiWrapper<boolean, {
13
+ code: number;
14
+ msg: string;
15
+ }>>;
16
+ deleteFile(idFile: number): Promise<ApiWrapper<boolean, {
17
+ code: number;
18
+ msg: string;
19
+ }>>;
20
+ createFile(title: string, type: string, publishTo: Array<any>): Promise<ApiWrapper<boolean, {
21
+ code: number;
22
+ msg: string;
23
+ }>>;
24
+ updateFile(idFile: number, title: string, publishTo: Array<string>): Promise<ApiWrapper<boolean, {
25
+ code: number;
26
+ msg: string;
27
+ }>>;
28
+ getFileInfo(idFile: number, mode: string): Promise<ApiWrapper<boolean, {
29
+ code: number;
30
+ msg: string;
31
+ }>>;
32
+ }
@@ -0,0 +1,16 @@
1
+ import { JBaseObject } from './JBaseObject';
2
+ export declare enum JApplicationStatus {
3
+ local = "local",
4
+ installed = "installed",
5
+ autosaved = "autosaved",
6
+ saved = "saved"
7
+ }
8
+ export declare class JApplication extends JBaseObject {
9
+ private status?;
10
+ constructor(id?: string, type?: string, status?: JApplicationStatus);
11
+ get(prop: string): any;
12
+ set(prop: string, val: any): void;
13
+ setStatus(status: JApplicationStatus): void;
14
+ getStatus(): JApplicationStatus | undefined;
15
+ updateUsing(newerJApplication: JApplication): JApplication;
16
+ }
@@ -0,0 +1,15 @@
1
+ /** Base class to represent objects retreived from or sent to the backend.
2
+ * This JBaseObject is then derived to provide a more understandable result for each API.
3
+ */
4
+ export declare class JBaseObject {
5
+ protected type?: string;
6
+ protected id?: string;
7
+ protected record: Record<string, any>;
8
+ constructor(id?: string, type?: string);
9
+ hydrate(data?: any): void;
10
+ getType(): string | undefined;
11
+ getId(): string | undefined;
12
+ getUri(): string;
13
+ get(prop: string): any;
14
+ set(prop: string, val: any): void;
15
+ }
@@ -0,0 +1,16 @@
1
+ export declare class JBookmark {
2
+ id?: number;
3
+ type?: string;
4
+ targetId?: number;
5
+ targetType?: string;
6
+ bookmarkUrl?: string;
7
+ bookmarkOrder?: number;
8
+ bookmarkLabel?: string;
9
+ bookmarkMeta?: string;
10
+ _cssClass?: string;
11
+ _cssColor?: string;
12
+ _values?: Record<string, string>;
13
+ url?: string;
14
+ private static fields;
15
+ static createFromObject(o: Record<string, object>): JBookmark;
16
+ }
@@ -0,0 +1,3 @@
1
+ import { JBaseObject } from './JBaseObject';
2
+ export declare class JConcept extends JBaseObject {
3
+ }
@@ -0,0 +1,16 @@
1
+ export declare class JDiapazone {
2
+ id: number;
3
+ title: string;
4
+ type: string;
5
+ _user?: Record<string, string>;
6
+ _audience?: Record<string, string>;
7
+ _audienceLeft?: number;
8
+ _right?: Record<string, string>;
9
+ _cssClass?: string;
10
+ _cssColor?: string;
11
+ _values?: Record<string, string>;
12
+ _extend?: Record<string, string>;
13
+ _url?: string;
14
+ private static fields;
15
+ static createFromObject(o: Record<string, object>): JDiapazone;
16
+ }
@@ -0,0 +1,13 @@
1
+ export declare class jFile {
2
+ id: number;
3
+ title: string;
4
+ type: string;
5
+ dateCreation: string;
6
+ mimetype: string;
7
+ _extend: any;
8
+ _user: any;
9
+ _right: any;
10
+ _audience: any;
11
+ private static fields;
12
+ static createFromObject(o: Record<string, object>): jFile;
13
+ }
@@ -0,0 +1,4 @@
1
+ import { JBaseObject } from './JBaseObject';
2
+ export declare class JUser extends JBaseObject {
3
+ getMail(): string;
4
+ }
@@ -0,0 +1,5 @@
1
+ export * from './JApplication';
2
+ export * from './JBaseObject';
3
+ export * from './JConcept';
4
+ export * from './JUser';
5
+ export * from './JBookmark';
@@ -0,0 +1,13 @@
1
+ import { JamespotUserApi } from './apis/jamespotUserApi';
2
+ declare const JamespotUserApiInstance: JamespotUserApi;
3
+ declare global {
4
+ interface Window {
5
+ JamespotUserApi: JamespotUserApi;
6
+ }
7
+ }
8
+ export { JamespotUserApiInstance };
9
+ export default JamespotUserApiInstance;
10
+ export * from './apis';
11
+ export * from './types';
12
+ export * from './classes';
13
+ export * from './util/network';
@@ -0,0 +1,9 @@
1
+ import { JamespotUserApi } from './apis';
2
+ declare const JamespotUserApiInstance: JamespotUserApi;
3
+ declare global {
4
+ interface Window {
5
+ JamespotUserApi: JamespotUserApi;
6
+ }
7
+ }
8
+ export { JamespotUserApiInstance };
9
+ export default JamespotUserApiInstance;
@@ -0,0 +1,9 @@
1
+ export declare class WindowMock {
2
+ private readonly data;
3
+ location: {
4
+ protocol: string;
5
+ host: string;
6
+ };
7
+ constructor();
8
+ fetch(url: string, requestInit: RequestInit): Promise<Response>;
9
+ }
@@ -0,0 +1,28 @@
1
+ import { Little, Rights } from './utils';
2
+ export declare type AseiTicketStatus = 'created' | 'validated' | 'handled';
3
+ export interface AseiTicket extends Little {
4
+ _right: Rights;
5
+ _user: Little;
6
+ aseiClearanceTicketValidator: Little[];
7
+ aseiClearanceTicketInstitution: Little[];
8
+ processContext: null;
9
+ aseiClearanceTicketType: string;
10
+ aseiClearanceTicketNatureOfDemand: null;
11
+ aseiClearanceTicketLastName: string;
12
+ aseiClearanceTicketFirstName: string;
13
+ aseiClearanceTicketStatus: AseiTicketStatus;
14
+ }
15
+ export interface AseiInstitution extends Little {
16
+ _right: Rights;
17
+ _user: Little;
18
+ aseiInstitutionValidator: Little[];
19
+ processContext: null;
20
+ }
21
+ export interface AseiGroups {
22
+ dsi: number;
23
+ gestionnaireApplicatif: number;
24
+ }
25
+ export interface AseiRights {
26
+ accessWriter: boolean;
27
+ accessApp: boolean;
28
+ }
@@ -0,0 +1,16 @@
1
+ export interface BaseAutocomplete {
2
+ value: string;
3
+ uri: string;
4
+ shortUri: string;
5
+ title: string;
6
+ name: string;
7
+ mainType: string;
8
+ type: string;
9
+ label: string;
10
+ cssClass: string;
11
+ cssColor: string;
12
+ class: string;
13
+ Pseudo: string;
14
+ }
15
+ export declare type AudienceAutocomplete = BaseAutocomplete;
16
+ export declare type CommunityAutocomplete = BaseAutocomplete;
@@ -0,0 +1,22 @@
1
+ export interface CreateGroup {
2
+ title: string;
3
+ description: string;
4
+ privacy: string;
5
+ idCategory?: string;
6
+ type: string;
7
+ uriCommunity?: string;
8
+ widgets: Array<string>;
9
+ }
10
+ export declare type GroupWidgets = Record<string, {
11
+ idWidget: string;
12
+ title: string;
13
+ url: string;
14
+ type: string;
15
+ icon: string;
16
+ description: string;
17
+ }>;
18
+ export interface Category {
19
+ id: string;
20
+ idorder: number;
21
+ label: string;
22
+ }
@@ -0,0 +1,7 @@
1
+ export * from './asei';
2
+ export * from './autocomplete';
3
+ export * from './group';
4
+ export * from './search';
5
+ export * from './utils';
6
+ export * from './taxonomy';
7
+ export * from './user';
@@ -0,0 +1,6 @@
1
+ export interface ListWrapper<T> {
2
+ page?: number;
3
+ limit?: number;
4
+ cnt?: number;
5
+ data: T[];
6
+ }
@@ -0,0 +1,96 @@
1
+ export interface SearchCategoryModel {
2
+ id: string;
3
+ mainType: string;
4
+ type?: string;
5
+ title: string;
6
+ cssclass?: string;
7
+ active?: boolean;
8
+ count?: number;
9
+ typesExcluded: string[];
10
+ facets: SearchFacetModel[];
11
+ }
12
+ export interface SearchFacetModel {
13
+ facetType: string;
14
+ facetOptions: any;
15
+ field: string;
16
+ title: string;
17
+ category?: SearchCategoryModel['id'];
18
+ }
19
+ export interface SearchFacetValueModel {
20
+ count: number;
21
+ value: string;
22
+ title: string;
23
+ }
24
+ /** *
25
+ * Used in search query to specify a filter
26
+ * field : name/id of the filter category (ie skills)
27
+ * value : id of the field (ie react)
28
+ * exclude : boolean to include or exclude the filter
29
+ */
30
+ export interface SearchQueryFilterModel {
31
+ field: string;
32
+ value: string;
33
+ exclude: boolean;
34
+ }
35
+ /**
36
+ * Used in search query to specify a filter
37
+ * field : name/id of the field to sort
38
+ * order : desc' | 'asc'
39
+ */
40
+ export interface SearchQuerySortModel {
41
+ field: string;
42
+ order: 'desc' | 'asc';
43
+ }
44
+ /**
45
+ * facetLimit : max number of facets (default 25)
46
+ * skipEmptyFacets : remove empty facets (with 0 results)
47
+ */
48
+ export interface SearchQueryOption {
49
+ facetLimit: number;
50
+ skipEmptyFacets: boolean;
51
+ }
52
+ export interface SearchConfig {
53
+ home: {
54
+ mode: 'result' | 'category';
55
+ facets: SearchFacetModel[];
56
+ };
57
+ categories: SearchCategoryModel[];
58
+ viewcard?: Record<string, {
59
+ name: string;
60
+ title: string;
61
+ }[]>;
62
+ }
63
+ export interface SearchResultCatProps {
64
+ title: string;
65
+ id: string;
66
+ showAll?: boolean;
67
+ results: SearchResultProps[];
68
+ }
69
+ export interface SearchResultProps {
70
+ title: string;
71
+ picture: string;
72
+ uri: string;
73
+ }
74
+ export interface SearchQuery {
75
+ keywords?: string;
76
+ category?: string;
77
+ facetCategories?: boolean;
78
+ filters?: SearchQueryFilterModel[];
79
+ page?: number;
80
+ limit?: number;
81
+ sort?: SearchQuerySortModel;
82
+ options?: SearchQueryOption;
83
+ }
84
+ export interface Result {
85
+ id: number;
86
+ type: string;
87
+ uri: string;
88
+ title: string;
89
+ mainType: string;
90
+ _url: string;
91
+ }
92
+ export interface SearchQueryResult {
93
+ results: Result[];
94
+ facets: SearchFacetModel[];
95
+ categories: SearchCategoryModel[];
96
+ }
@@ -0,0 +1,46 @@
1
+ export interface Taxonomy {
2
+ id: number;
3
+ type: string;
4
+ title: string;
5
+ dateCreation: string;
6
+ mainTypes: never[];
7
+ types: null;
8
+ mandatory: null;
9
+ public: null;
10
+ wallFilter: null;
11
+ jamespot: string;
12
+ uri: string;
13
+ mainType: string;
14
+ _cssColor: string;
15
+ _cssClass: string;
16
+ _right: {
17
+ create: boolean;
18
+ read: boolean;
19
+ publish: boolean;
20
+ administrate: boolean;
21
+ update: boolean;
22
+ delete: boolean;
23
+ comment: boolean;
24
+ member: boolean;
25
+ };
26
+ _values: {
27
+ type: string;
28
+ title: string;
29
+ dateCreation: string;
30
+ mainTypes: null;
31
+ types: null;
32
+ mandatory: null;
33
+ public: null;
34
+ wallFilter: null;
35
+ jamespot: string;
36
+ };
37
+ _timezone: {
38
+ dateCreation: string;
39
+ };
40
+ _url: string;
41
+ }
42
+ export interface TaxonomyCreate {
43
+ type: 'taxonomyClose' | 'taxonomyOpen';
44
+ title: string;
45
+ concepts: Array<string>;
46
+ }
@@ -0,0 +1,14 @@
1
+ export interface UserModel {
2
+ id: number;
3
+ title: string;
4
+ type: string;
5
+ uri: string;
6
+ mainType: string;
7
+ _cssColor: string;
8
+ _cssClass: string;
9
+ url: string;
10
+ firstname: string;
11
+ lastname: string;
12
+ company: string;
13
+ mail: string;
14
+ }
@@ -0,0 +1,56 @@
1
+ export interface ApiWrapper<T, U = string[]> {
2
+ o: string;
3
+ f: string;
4
+ error: number;
5
+ messages: U;
6
+ errorMsg?: string;
7
+ result: T;
8
+ }
9
+ export interface PagingResults<T> {
10
+ cnt: number;
11
+ data: Array<T>;
12
+ facets: Array<{}>;
13
+ idQuery?: number;
14
+ limit: number;
15
+ page: number;
16
+ }
17
+ export interface ApiError<U = string> {
18
+ error: number;
19
+ messages: U[];
20
+ }
21
+ export interface BaseMessage {
22
+ msg: string;
23
+ code: number;
24
+ }
25
+ export declare type BaseMessages = BaseMessage[];
26
+ export declare type BaseMessagesOne = [BaseMessage];
27
+ export declare type Rights = {
28
+ create: boolean;
29
+ read: boolean;
30
+ publish: boolean;
31
+ administrate: boolean;
32
+ update: boolean;
33
+ delete: boolean;
34
+ comment: boolean;
35
+ member: boolean;
36
+ };
37
+ export declare type Little = {
38
+ id: number;
39
+ type: string;
40
+ uri: string;
41
+ title: string;
42
+ _url: string;
43
+ dateCreation: string;
44
+ dateModified: string;
45
+ };
46
+ export declare type Order = {
47
+ name: string;
48
+ sort: 'ASC' | 'DESC';
49
+ };
50
+ export declare type Orders = Array<Order>;
51
+ export declare type Filter = {
52
+ name: string;
53
+ value: string;
54
+ operator?: '<' | '>' | '<=' | '>=' | '!=' | '<>' | 'like' | 'between' | 'is' | 'is not' | 'in' | 'link' | 'match';
55
+ };
56
+ export declare type Filters = Array<Filter>;
@@ -0,0 +1,23 @@
1
+ import { ApiWrapper } from '../types';
2
+ export interface FileOption {
3
+ makeImage: boolean;
4
+ size: string;
5
+ }
6
+ export interface OF {
7
+ o: string;
8
+ f: string;
9
+ }
10
+ export declare class Network {
11
+ private readonly backUrl;
12
+ private readonly apiUrl;
13
+ private readonly window;
14
+ constructor(window: Window, suffix?: string);
15
+ static _formatPostOptions(body: object): RequestInit;
16
+ static _formatQueryOptions(options: Record<string, string | boolean | number>): string;
17
+ fetch(body: OF, signal?: AbortSignal): Promise<Response>;
18
+ post<T, U = string[]>(body: OF, signal?: AbortSignal): Promise<ApiWrapper<T, U>>;
19
+ postFile(body: FormData, options: FileOption): Promise<any>;
20
+ postCSRF<T, U = string[]>(body: OF): Promise<ApiWrapper<T, U>>;
21
+ token(): Promise<ApiWrapper<string>>;
22
+ tokenCSRF(): Promise<ApiWrapper<string>>;
23
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jamespot-user-api",
3
- "version": "1.0.13",
3
+ "version": "1.0.43",
4
4
  "scripts": {
5
5
  "build": "npx webpack --env NODE_ENV=production",
6
6
  "build-mock": "npx webpack --env NODE_ENV=production --env MOCK_MODE=true",